feat: add slides generation tool with multiple slide types
Some checks failed
CI / Lint, Test & Build (push) Failing after 17s
CI / Deploy production (on server) (push) Has been skipped

- Add slides.tool.ts with support for title, bullets, chart, stats, table, cards, timeline, quote, comparison, equation, image, summary slide types
- Chart types: bar, horizontal-bar, line, donut, radar
- Integrate with agent executor and canvas system
- Add multilingual support (en/fr)
- Various UI improvements and bug fixes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Antigravity
2026-05-22 17:18:48 +00:00
parent 0f6b9509da
commit 5728452b4a
68 changed files with 6990 additions and 2584 deletions

View File

@@ -1,7 +1,9 @@
import { NextRequest, NextResponse } from 'next/server'
import { Prisma } from '@prisma/client'
import prisma from '@/lib/prisma'
import { auth } from '@/auth'
import { revalidatePath } from 'next/cache'
import { CreateNotebookSchema } from '@/lib/validators'
const DEFAULT_COLORS = ['#3B82F6', '#8B5CF6', '#EC4899', '#F59E0B', '#10B981', '#06B6D4']
const DEFAULT_ICONS = ['📁', '📚', '💼', '🎯', '📊', '🎨', '💡', '🔧']
@@ -63,11 +65,14 @@ export async function POST(request: NextRequest) {
try {
const body = await request.json()
const { name, icon, color, parentId } = body
if (!name || typeof name !== 'string') {
return NextResponse.json({ success: false, error: 'Notebook name is required' }, { status: 400 })
const parsed = CreateNotebookSchema.safeParse(body)
if (!parsed.success) {
return NextResponse.json(
{ success: false, error: 'Invalid request body', details: parsed.error.flatten() },
{ status: 400 }
)
}
const { name, icon, color, parentId } = parsed.data
if (parentId) {
const parent = await prisma.notebook.findFirst({
@@ -78,9 +83,7 @@ export async function POST(request: NextRequest) {
}
}
const whereClause: any = { userId: session.user.id }
if (parentId) whereClause.parentId = parentId
else whereClause.parentId = null
const whereClause: Prisma.NotebookWhereInput = { userId: session.user.id, parentId: parentId ?? null }
const highestOrder = await prisma.notebook.findFirst({
where: whereClause,