fix: slide 3 noire, watermark PPTX, quota génération slides
- canvas-board.tsx: préfère data.html (iframe) sur data.spec (ancien renderer) → corrige slide 3 noire en mode HTML viewer - pptx/route.ts: ajoute watermark 'memento-note.com' sur chaque slide via buildPptx (PPTX téléchargé depuis le canvas) - run-for-note/route.ts: checkEntitlementOrThrow avant création agent - slides.tool.ts: incrementUsageAsync après canvas créé avec succès Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { z } from 'zod'
|
||||
import { toolRegistry } from './registry'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { buildPresentationHTML } from './slides-html-builder'
|
||||
import { incrementUsageAsync } from '@/lib/entitlements'
|
||||
|
||||
const slideSchema = z.discriminatedUnion('type', [
|
||||
z.object({ type: z.literal('title'), title: z.string(), subtitle: z.string().optional() }),
|
||||
@@ -80,6 +81,9 @@ RULES:
|
||||
|
||||
console.log('[Slides Tool] Canvas created:', canvas.id, '| Slides:', slides.length, '| Size:', Math.round(html.length / 1024), 'KB')
|
||||
|
||||
// Decrement reformulate quota (agent-based generation consumes credits)
|
||||
incrementUsageAsync(ctx.userId, 'reformulate')
|
||||
|
||||
if (ctx.actionId) {
|
||||
await prisma.agentAction.update({
|
||||
where: { id: ctx.actionId },
|
||||
|
||||
Reference in New Issue
Block a user