From 4f950740ebaaca841e09bec2117423d5660957ac Mon Sep 17 00:00:00 2001 From: Antigravity Date: Tue, 5 May 2026 21:45:57 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20options=20de=20g=C3=A9n=C3=A9ration=20(?= =?UTF-8?q?th=C3=A8me/style/type)=20+=20masquer=20agents=20one-shot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Les agents créés par run-for-note ont frequency:'one-shot' et sont filtrés de la page /agents (NOT frequency:'one-shot' dans getAgents) - Panneau slides : sélecteurs Thème (11 palettes) + Style (sharp/soft/rounded/pill) - Panneau diagramme : sélecteurs Type (auto/flowchart/mindmap/timeline/ org-chart/architecture/process-map) + Style (sketchy/austere/sketch+) - Les valeurs sélectionnées sont transmises à l'API et injectées dans le prompt Co-authored-by: Cursor --- memento-note/app/actions/agent-actions.ts | 2 +- .../app/api/agents/run-for-note/route.ts | 2 +- .../components/contextual-ai-chat.tsx | 120 ++++++++++++------ memento-note/locales/en.json | 11 ++ memento-note/locales/fr.json | 11 ++ 5 files changed, 102 insertions(+), 44 deletions(-) diff --git a/memento-note/app/actions/agent-actions.ts b/memento-note/app/actions/agent-actions.ts index cd82501..3632a4f 100644 --- a/memento-note/app/actions/agent-actions.ts +++ b/memento-note/app/actions/agent-actions.ts @@ -204,7 +204,7 @@ export async function getAgents() { try { const agents = await prisma.agent.findMany({ - where: { userId: session.user.id }, + where: { userId: session.user.id, NOT: { frequency: 'one-shot' } }, include: { _count: { select: { actions: true } }, actions: { diff --git a/memento-note/app/api/agents/run-for-note/route.ts b/memento-note/app/api/agents/run-for-note/route.ts index 0514068..d8a7767 100644 --- a/memento-note/app/api/agents/run-for-note/route.ts +++ b/memento-note/app/api/agents/run-for-note/route.ts @@ -61,7 +61,7 @@ export async function POST(req: NextRequest) { role: defaults.role, tools: defaults.tools, maxSteps: defaults.maxSteps, - frequency: 'manual', + frequency: 'one-shot', isEnabled: true, sourceNoteIds: JSON.stringify([noteId]), targetNotebookId: note.notebookId ?? undefined, diff --git a/memento-note/components/contextual-ai-chat.tsx b/memento-note/components/contextual-ai-chat.tsx index 33323bb..03229ee 100644 --- a/memento-note/components/contextual-ai-chat.tsx +++ b/memento-note/components/contextual-ai-chat.tsx @@ -130,6 +130,11 @@ export function ContextualAIChat({ const [generateLoading, setGenerateLoading] = useState<'slides' | 'diagram' | null>(null) const [generateResult, setGenerateResult] = useState(null) const [customLangInput, setCustomLangInput] = useState('') + // Generation options + const [slideTheme, setSlideTheme] = useState('vibrant_tech') + const [slideStyle, setSlideStyle] = useState('soft') + const [diagramType, setDiagramType] = useState('auto') + const [diagramStyle, setDiagramStyle] = useState('default') // Resource tab state const [resourceUrl, setResourceUrl] = useState('') @@ -290,6 +295,8 @@ export function ContextualAIChat({ body: JSON.stringify({ noteId, type: type === 'slides' ? 'slide-generator' : 'excalidraw-generator', + theme: type === 'slides' ? slideTheme : diagramType, + style: type === 'slides' ? slideStyle : diagramStyle, }), }) const data = await res.json() @@ -999,62 +1006,91 @@ export function ContextualAIChat({ {t('ai.generate.sectionLabel') || 'Générer depuis cette note'}

- {/* Slides button */} - + {/* Button */} + + {/* Slides result */} {generateResult?.type === 'slides' && generateResult.canvasId && ( - + {t('ai.generate.downloadPptx') || 'Télécharger le .pptx'} )} - {/* Diagram button */} - + + {/* Diagram result */} {generateResult?.type === 'diagram' && generateResult.canvasId && ( - + {t('ai.generate.openDiagram') || 'Ouvrir dans le Lab'} diff --git a/memento-note/locales/en.json b/memento-note/locales/en.json index 7118a25..5375bed 100644 --- a/memento-note/locales/en.json +++ b/memento-note/locales/en.json @@ -447,6 +447,17 @@ "openDiagram": "Open in Lab", "error": "Error during generation", "noNoteId": "Save the note first", + "theme": "Theme", + "style": "Style", + "diagramType": "Type", + "typeAuto": "Auto", + "styleSoft": "Soft", + "styleSharp": "Sharp", + "styleRounded": "Rounded", + "stylePill": "Pill", + "styleSketchy": "Sketchy", + "styleAustere": "Austere", + "styleSketchPlus": "Sketch+", "toastLoading": { "slides": "⏳ Generating presentation…", "diagram": "⏳ Generating diagram…" diff --git a/memento-note/locales/fr.json b/memento-note/locales/fr.json index cc7da95..f5dc742 100644 --- a/memento-note/locales/fr.json +++ b/memento-note/locales/fr.json @@ -447,6 +447,17 @@ "openDiagram": "Ouvrir dans le Lab", "error": "Erreur lors de la génération", "noNoteId": "Enregistrez d'abord la note", + "theme": "Thème", + "style": "Style", + "diagramType": "Type", + "typeAuto": "Auto", + "styleSoft": "Soft", + "styleSharp": "Sharp", + "styleRounded": "Arrondi", + "stylePill": "Pill", + "styleSketchy": "Sketchy", + "styleAustere": "Austère", + "styleSketchPlus": "Sketch+", "toastLoading": { "slides": "⏳ Génération de la présentation en cours…", "diagram": "⏳ Génération du diagramme en cours…"