@agent-native/core 0.149.1 → 0.149.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/analytics/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/analytics/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/analytics/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/analytics/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/analytics/.agents/skills/creative-context/SKILL.md +4 -2
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +2 -0
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/analytics/AGENTS.md +25 -32
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +150 -46
- package/corpus/templates/analytics/app/global.css +1 -1
- package/corpus/templates/analytics/app/i18n-data.ts +37 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +1 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +32 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +2 -0
- package/corpus/templates/analytics/changelog/2026-08-10-dashboard-tables-can-be-copied-and-sorted-by-multiple-column.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/assets/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/assets/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/assets/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/assets/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/assets/.agents/skills/creative-context/SKILL.md +4 -2
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/assets/AGENTS.md +6 -9
- package/corpus/templates/assets/app/global.css +1 -1
- package/corpus/templates/assets/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/assets/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/brain/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/brain/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/brain/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/brain/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/brain/AGENTS.md +5 -12
- package/corpus/templates/brain/app/global.css +1 -1
- package/corpus/templates/brain/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/brain/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/calendar/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/calendar/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/calendar/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/calendar/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/calendar/AGENTS.md +8 -9
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/chat/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/chat/AGENTS.md +32 -80
- package/corpus/templates/chat/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/clips/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/clips/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/clips/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/clips/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/clips/AGENTS.md +25 -31
- package/corpus/templates/clips/changelog/2026-08-10-clips-desktop-sign-in-now-starts-with-magic-links-and-google.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.css +1 -0
- package/corpus/templates/clips/desktop/src/app.tsx +274 -137
- package/corpus/templates/clips/desktop/src/styles.css +35 -0
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/content/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/content/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/content/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/content/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/content/.agents/skills/creative-context/SKILL.md +4 -2
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/content/AGENTS.md +5 -9
- package/corpus/templates/content/app/global.css +1 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/crm/AGENTS.md +7 -11
- package/corpus/templates/crm/app/global.css +1 -1
- package/corpus/templates/crm/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/crm/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/design/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/design/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/design/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/design/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +4 -2
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +70 -3
- package/corpus/templates/design/AGENTS.md +13 -21
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +12 -0
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +19 -2
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +115 -7
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +82 -7
- package/corpus/templates/design/app/components/design/design-trace.ts +120 -0
- package/corpus/templates/design/app/components/design/dnd-debug.ts +2 -1
- package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +40 -26
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +4 -1
- package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +12 -3
- package/corpus/templates/design/app/components/design/multi-screen/screen-content-cache.ts +4 -0
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +7 -0
- package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -2
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +2 -2
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +1 -0
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +5 -5
- package/corpus/templates/design/app/pages/DesignSystems.tsx +3 -2
- package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +100 -13
- package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +1 -1
- package/corpus/templates/design/app/pages/design-editor/data-operations.ts +14 -0
- package/corpus/templates/design/changelog/2026-08-10-marquee-selecting-layers-far-down-a-tall-screen-now-selects-.md +6 -0
- package/corpus/templates/design/changelog/2026-08-10-the-frame-tool-draws-a-plain-frame-by-default-with-screen-av.md +6 -0
- package/corpus/templates/design/e2e/global-setup.ts +27 -32
- package/corpus/templates/design/playwright.config.ts +3 -5
- package/corpus/templates/design/shared/breakpoint-media.ts +9 -2
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/dispatch/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/dispatch/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/dispatch/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/dispatch/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/dispatch/AGENTS.md +9 -16
- package/corpus/templates/dispatch/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/factory/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/factory/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/factory/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/factory/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/factory/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/factory/AGENTS.md +10 -24
- package/corpus/templates/factory/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/forms/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/forms/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/forms/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/forms/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/forms/AGENTS.md +11 -17
- package/corpus/templates/forms/app/global.css +1 -0
- package/corpus/templates/forms/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/forms/changelog/2026-08-11-full-page-chat-composers-stay-at-a-focused-750px-width.md +6 -0
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/macros/AGENTS.md +8 -8
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/mail/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/mail/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/mail/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/mail/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/mail/AGENTS.md +5 -6
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/plan/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/plan/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/plan/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/plan/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/plan/AGENTS.md +5 -14
- package/corpus/templates/plan/app/global.css +1 -0
- package/corpus/templates/plan/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/corpus/templates/plan/changelog/2026-08-11-plan-no-longer-reloads-when-runtime-state-changes.md +6 -0
- package/corpus/templates/plan/server/ui-plan-html.ts +4 -1
- package/corpus/templates/plan/vite.config.ts +5 -0
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/slides/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/slides/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/slides/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +2 -2
- package/corpus/templates/slides/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/slides/.agents/skills/creative-context/SKILL.md +6 -3
- package/corpus/templates/slides/.agents/skills/deck-management/SKILL.md +6 -1
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +3 -2
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +3 -0
- package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +3 -3
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/slides/AGENTS.md +33 -35
- package/corpus/templates/slides/actions/add-deck.ts +2 -0
- package/corpus/templates/slides/actions/add-slide.ts +15 -1
- package/corpus/templates/slides/actions/create-deck.ts +18 -6
- package/corpus/templates/slides/actions/get-deck-reference-context.ts +2 -2
- package/corpus/templates/slides/actions/get-deck.ts +83 -7
- package/corpus/templates/slides/actions/import-file.ts +2 -1
- package/corpus/templates/slides/actions/patch-deck.ts +165 -9
- package/corpus/templates/slides/actions/save-deck.ts +24 -1
- package/corpus/templates/slides/actions/update-slide.ts +1 -1
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +2 -2
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +1 -23
- package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +2 -2
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +6 -6
- package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +3 -3
- package/corpus/templates/slides/app/components/editor/DeckEditorSkeleton.tsx +4 -4
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +432 -668
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +296 -259
- package/corpus/templates/slides/app/components/editor/GeneratingSlidePreview.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +13 -1
- package/corpus/templates/slides/app/components/editor/NewDeckReferenceStep.tsx +56 -174
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +241 -116
- package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +42 -14
- package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +6 -12
- package/corpus/templates/slides/app/components/editor/editor-command-model.ts +35 -0
- package/corpus/templates/slides/app/components/layout/AgentWorkIndicator.tsx +1 -1
- package/corpus/templates/slides/app/components/layout/Layout.tsx +34 -35
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +8 -10
- package/corpus/templates/slides/app/components/layout/layout-route-policy.ts +2 -5
- package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +45 -40
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +63 -16
- package/corpus/templates/slides/app/context/DeckContext.tsx +2 -1
- package/corpus/templates/slides/app/global.css +76 -1
- package/corpus/templates/slides/app/hooks/use-generating-slide-preview.ts +25 -3
- package/corpus/templates/slides/app/i18n/en-US.ts +2 -0
- package/corpus/templates/slides/app/lib/create-deck-generation.ts +52 -23
- package/corpus/templates/slides/app/lib/recent-references.ts +23 -1
- package/corpus/templates/slides/app/lib/slide-animation-elements.ts +104 -3
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +17 -33
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +2 -2
- package/corpus/templates/slides/app/pages/Index.tsx +315 -151
- package/corpus/templates/slides/app/root.tsx +43 -0
- package/corpus/templates/slides/changelog/2026-08-10-ai-editing-avatar-badge.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-generated-decks-keep-a-clear-human-readable-title.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-new-deck-creation-now-shows-progress-opens-the-editor-direct.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-presentation-reveals-now-follow-valid-targets.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-slides-editing-controls-are-consolidated-into-one-focused-me.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-slides-now-verify-and-restyle-every-imported-slide-in-one-pa.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-slides-only-suggests-a-google-connection-for-relevant-reques.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-10-the-google-slides-import-option-is-now-labeled-slides.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-11-faster-slides-chat-deck-reads.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-11-slides-chat-can-read-one-slide-without-loading-the-full-deck.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-11-slides-clearly-indicate-when-an-ai-agent-is-editing-alongsid.md +6 -0
- package/corpus/templates/slides/package.json +1 -0
- package/corpus/templates/slides/server/lib/chat-attachments.ts +1 -1
- package/corpus/templates/slides/server/lib/validate-slide-animations.ts +163 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +8 -5
- package/corpus/templates/slides/shared/api.ts +47 -15
- package/corpus/templates/slides/shared/deck-title.ts +135 -0
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +54 -488
- package/corpus/templates/tasks/.agents/skills/actions/references/action-fields.md +136 -0
- package/corpus/templates/tasks/.agents/skills/actions/references/examples.md +94 -0
- package/corpus/templates/tasks/.agents/skills/actions/references/provider-apis.md +95 -0
- package/corpus/templates/tasks/.agents/skills/agent-watchdog/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/create-skill/SKILL.md +9 -35
- package/corpus/templates/tasks/.agents/skills/efficient-fable/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/efficient-frontier/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +4 -5
- package/corpus/templates/tasks/.agents/skills/plan-arbiter/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/plow-ahead/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/quick-recap/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/read-the-damn-docs/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/stay-within-limits/SKILL.md +1 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/corpus/templates/tasks/AGENTS.md +5 -20
- package/corpus/templates/tasks/app/components/tasks/TaskListRow.tsx +4 -1
- package/dist/agent/engine/ai-sdk-engine.js +1 -1
- package/dist/agent/production-agent.d.ts +21 -1
- package/dist/agent/production-agent.js +505 -355
- package/dist/agent/run-manager.js +156 -14
- package/dist/agent/run-store.d.ts +11 -10
- package/dist/agent/run-store.js +17 -13
- package/dist/agent/tool-approval-store.d.ts +18 -0
- package/dist/agent/tool-approval-store.js +122 -0
- package/dist/agent/types.d.ts +1 -1
- package/dist/cli/code-agent-executor.js +11 -2
- package/dist/client/AgentPanel.js +31 -6
- package/dist/client/AssistantChat.d.ts +9 -4
- package/dist/client/AssistantChat.js +221 -149
- package/dist/client/active-run-state.d.ts +9 -1
- package/dist/client/active-run-state.js +34 -3
- package/dist/client/agent-chat/index.d.ts +1 -1
- package/dist/client/agent-chat-adapter.d.ts +8 -0
- package/dist/client/agent-chat-adapter.js +125 -28
- package/dist/client/agent-chat.d.ts +1 -1
- package/dist/client/chat/markdown-renderer.js +14 -2
- package/dist/client/chat/message-components.d.ts +13 -3
- package/dist/client/chat/message-components.js +57 -52
- package/dist/client/chat/run-recovery.d.ts +1 -0
- package/dist/client/chat/run-recovery.js +8 -0
- package/dist/client/chat/tool-call-display.d.ts +5 -5
- package/dist/client/chat/tool-call-display.js +9 -212
- package/dist/client/chat-first/apps-rail.js +3 -3
- package/dist/client/chat-first/browser-pane.js +4 -1
- package/dist/client/chat-first/chat-history.d.ts +3 -1
- package/dist/client/chat-first/chat-history.js +7 -4
- package/dist/client/chat-first/surface-tabs.d.ts +1 -1
- package/dist/client/chat-first/surface-tabs.js +52 -41
- package/dist/client/chat-first/types.d.ts +3 -0
- package/dist/client/chat-first.d.ts +10 -0
- package/dist/client/chat-first.js +37 -2
- package/dist/client/components/ui/message-scroller.js +4 -1
- package/dist/client/i18n.js +3 -1
- package/dist/client/resources/McpConnectionSuggestion.js +9 -1
- package/dist/client/sse-event-processor.d.ts +4 -2
- package/dist/client/sse-event-processor.js +46 -6
- package/dist/client/use-chat-models.js +156 -80
- package/dist/client/use-run-stuck-detection.d.ts +2 -0
- package/dist/client/use-run-stuck-detection.js +85 -9
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/integrations/adapters/slack.d.ts +0 -4
- package/dist/integrations/adapters/slack.js +6 -30
- package/dist/integrations/catalog.js +1 -1
- package/dist/integrations/pending-tasks-store.d.ts +0 -8
- package/dist/integrations/pending-tasks-store.js +0 -21
- package/dist/integrations/slack-manifest.d.ts +2 -2
- package/dist/integrations/slack-manifest.js +0 -3
- package/dist/integrations/webhook-handler.js +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/scripts/docs/source-search.js +2 -2
- package/dist/server/agent-chat/framework-prompts.js +7 -2
- package/dist/server/agent-chat/prompt-resources.js +2 -2
- package/dist/server/agent-chat/skill-frontmatter.d.ts +31 -2
- package/dist/server/agent-chat/skill-frontmatter.js +41 -15
- package/dist/server/agent-chat-plugin.js +3 -3
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agents-bundle.d.ts +16 -19
- package/dist/server/agents-bundle.js +19 -35
- package/dist/server/auth.js +262 -31
- package/dist/server/better-auth-instance.d.ts +1 -0
- package/dist/server/better-auth-instance.js +17 -2
- package/dist/server/onboarding-html.js +56 -9
- package/dist/server/prompts/framework-core-compact.d.ts +6 -1
- package/dist/server/prompts/framework-core-compact.js +12 -9
- package/dist/server/prompts/framework-core.d.ts +6 -1
- package/dist/server/prompts/framework-core.js +11 -9
- package/dist/server/prompts/index.d.ts +1 -1
- package/dist/server/prompts/index.js +1 -1
- package/dist/server/prompts/shared-rules.d.ts +15 -11
- package/dist/server/prompts/shared-rules.js +17 -13
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/reasoning-effort.d.ts +8 -8
- package/dist/shared/reasoning-effort.js +10 -10
- package/dist/shared/streaming-text-smoothing.js +41 -11
- package/dist/styles/agent-native.css +19 -32
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +54 -488
- package/dist/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
- package/dist/templates/chat/.agents/skills/actions/references/examples.md +94 -0
- package/dist/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
- package/dist/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/dist/templates/chat/AGENTS.md +32 -80
- package/dist/templates/chat/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/dist/templates/default/.agents/skills/actions/SKILL.md +54 -488
- package/dist/templates/default/.agents/skills/actions/references/action-fields.md +136 -0
- package/dist/templates/default/.agents/skills/actions/references/examples.md +94 -0
- package/dist/templates/default/.agents/skills/actions/references/provider-apis.md +95 -0
- package/dist/templates/default/.agents/skills/create-skill/SKILL.md +9 -35
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +4 -5
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +54 -488
- package/dist/templates/headless/.agents/skills/actions/references/action-fields.md +136 -0
- package/dist/templates/headless/.agents/skills/actions/references/examples.md +94 -0
- package/dist/templates/headless/.agents/skills/actions/references/provider-apis.md +95 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +54 -488
- package/dist/templates/workspace-core/.agents/skills/actions/references/action-fields.md +136 -0
- package/dist/templates/workspace-core/.agents/skills/actions/references/examples.md +94 -0
- package/dist/templates/workspace-core/.agents/skills/actions/references/provider-apis.md +95 -0
- package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +1 -0
- package/dist/templates/workspace-core/.agents/skills/agent-page/SKILL.md +1 -0
- package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +9 -35
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +4 -5
- package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +21 -29
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -17
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +3 -3
- package/dist/templates/workspace-core/AGENTS.md +7 -16
- package/docs/content/messaging.mdx +6 -7
- package/docs/content/template-chat.mdx +1 -1
- package/package.json +2 -2
- package/src/templates/chat/.agents/skills/actions/SKILL.md +54 -488
- package/src/templates/chat/.agents/skills/actions/references/action-fields.md +136 -0
- package/src/templates/chat/.agents/skills/actions/references/examples.md +94 -0
- package/src/templates/chat/.agents/skills/actions/references/provider-apis.md +95 -0
- package/src/templates/chat/.agents/skills/create-skill/SKILL.md +9 -35
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +4 -5
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/src/templates/chat/AGENTS.md +32 -80
- package/src/templates/chat/changelog/2026-08-10-full-page-chat-now-uses-the-available-width-up-to-1000px-for.md +6 -0
- package/src/templates/default/.agents/skills/actions/SKILL.md +54 -488
- package/src/templates/default/.agents/skills/actions/references/action-fields.md +136 -0
- package/src/templates/default/.agents/skills/actions/references/examples.md +94 -0
- package/src/templates/default/.agents/skills/actions/references/provider-apis.md +95 -0
- package/src/templates/default/.agents/skills/create-skill/SKILL.md +9 -35
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +4 -5
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/src/templates/headless/.agents/skills/actions/SKILL.md +54 -488
- package/src/templates/headless/.agents/skills/actions/references/action-fields.md +136 -0
- package/src/templates/headless/.agents/skills/actions/references/examples.md +94 -0
- package/src/templates/headless/.agents/skills/actions/references/provider-apis.md +95 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +54 -488
- package/src/templates/workspace-core/.agents/skills/actions/references/action-fields.md +136 -0
- package/src/templates/workspace-core/.agents/skills/actions/references/examples.md +94 -0
- package/src/templates/workspace-core/.agents/skills/actions/references/provider-apis.md +95 -0
- package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +1 -0
- package/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +1 -0
- package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +9 -35
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +4 -5
- package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +21 -29
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -31
- package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -17
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +3 -3
- package/src/templates/workspace-core/AGENTS.md +7 -16
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
IconAlertTriangle,
|
|
16
16
|
IconPlus,
|
|
17
17
|
IconRefresh,
|
|
18
|
+
IconSearch,
|
|
18
19
|
IconStack2,
|
|
19
20
|
IconUserCircle,
|
|
20
21
|
} from "@tabler/icons-react";
|
|
@@ -33,6 +34,7 @@ import {
|
|
|
33
34
|
} from "@/components/editor/NewDeckReferenceStep";
|
|
34
35
|
import PromptPopover, {
|
|
35
36
|
uploadPromptFiles,
|
|
37
|
+
type PromptImportSelection,
|
|
36
38
|
type UploadedFile,
|
|
37
39
|
} from "@/components/editor/PromptDialog";
|
|
38
40
|
import {
|
|
@@ -46,6 +48,7 @@ import {
|
|
|
46
48
|
AlertDialogTitle,
|
|
47
49
|
} from "@/components/ui/alert-dialog";
|
|
48
50
|
import { Button } from "@/components/ui/button";
|
|
51
|
+
import { Input } from "@/components/ui/input";
|
|
49
52
|
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
|
50
53
|
import {
|
|
51
54
|
describeDeckPersistenceFailure,
|
|
@@ -57,6 +60,7 @@ import { useDesignSystems } from "@/hooks/use-design-systems";
|
|
|
57
60
|
import { useWorkspaceDefaults } from "@/hooks/use-workspace-defaults";
|
|
58
61
|
import { createDeckAgentMessage } from "@/lib/agent-visible-message";
|
|
59
62
|
import { savePromptToComposerDraft } from "@/lib/composer-draft";
|
|
63
|
+
import { isSourceImprovementRequest } from "@/lib/create-deck-generation";
|
|
60
64
|
import { sortDecksByRecency } from "@/lib/deck-sorting";
|
|
61
65
|
import {
|
|
62
66
|
IMPORT_ACTION_TIMEOUT_MS,
|
|
@@ -64,6 +68,7 @@ import {
|
|
|
64
68
|
type ImportedSourceDeck,
|
|
65
69
|
} from "@/lib/import-uploaded-deck";
|
|
66
70
|
import {
|
|
71
|
+
forgetRecentReference,
|
|
67
72
|
readRecentReferences,
|
|
68
73
|
rememberRecentReference,
|
|
69
74
|
type RecentReference,
|
|
@@ -206,20 +211,22 @@ function describeUploadedFilesForAgent(
|
|
|
206
211
|
"",
|
|
207
212
|
importedSourceDeck
|
|
208
213
|
? `The user uploaded ${files.length} file(s). The ${importedSourceDeck.file.originalName} source deck has already been imported into target deck ${deckId} with ${importedSourceDeck.slideCount} source slide(s); do not import it again.`
|
|
209
|
-
: `The user
|
|
214
|
+
: `The user attached ${files.length} file(s) as reference material for this new deck. Attachments are context for the agent by default; do not import or append their slides to target deck ${deckId} merely because they were attached.`,
|
|
210
215
|
fileList,
|
|
211
216
|
"",
|
|
212
217
|
"File handling rules:",
|
|
213
218
|
importedSourceDeck
|
|
214
|
-
? "- The imported source deck is
|
|
215
|
-
: `- PPTX files: call \`import-
|
|
219
|
+
? "- The imported source deck is canonical. Preserve its slide count, order, IDs, factual copy, notes, imagery, charts, tables, diagrams, and freeform objects while improving styling. For a deck-wide restyle, use one patch-deck call with requireAllSourceSlides=true; use update-slide only for a targeted one-slide edit. Do not rebuild it with add-slide."
|
|
220
|
+
: `- PDF, PPTX, and DOCX files: call \`import-file --filePath "<path>" --format auto\` (without \`importIntoDeck\`) when you need their text or structure. Use the returned material as reference while creating new slides with \`add-slide\`.`,
|
|
216
221
|
importedSourceDeck
|
|
217
222
|
? "- For a PDF source, keep the original full-page image in every slide and add restrained design-system chrome around it without obscuring source content. Never OCR-reconstruct a source-faithful page from extracted text."
|
|
218
|
-
:
|
|
223
|
+
: "- Do not pass `importIntoDeck: true` for an attached file unless the user explicitly asks to import or preserve the source pages in the current deck. An attached reference is not an instruction to replace or seed the deck.",
|
|
219
224
|
"- Text-like files: use the uploaded-text-file blocks already included in the prompt; do not call import-file for them.",
|
|
220
225
|
'- Image files with an embeddable URL are mandatory assets: if the user specified where to use one (e.g. "on the first and last slide"), embed it there with `<img src="...">` exactly as requested. Do not omit a requested image and continue silently — if it truly cannot be placed, say why in your final chat response.',
|
|
221
226
|
"- Image files without a URL are visual/reference assets only; do not claim to have processed a PPTX/PDF/DOCX unless the relevant import action succeeds.",
|
|
222
|
-
|
|
227
|
+
importedSourceDeck
|
|
228
|
+
? "- Before your final response, verify the same source slide IDs and count with get-deck after the restyle. If source fidelity is partial or images were skipped, report the exact warning instead of claiming success."
|
|
229
|
+
: "- Before your final response, verify every uploaded file above was either used as reference or placed as explicitly requested. If any file's content or requested placement is missing from the deck, say so explicitly instead of reporting success.",
|
|
223
230
|
].join("\n");
|
|
224
231
|
}
|
|
225
232
|
|
|
@@ -236,7 +243,7 @@ export default function Index() {
|
|
|
236
243
|
loadError,
|
|
237
244
|
reloadDecks,
|
|
238
245
|
} = useDecks();
|
|
239
|
-
const { designSystems
|
|
246
|
+
const { designSystems } = useDesignSystems();
|
|
240
247
|
const {
|
|
241
248
|
referenceDeck: workspaceReferenceDeck,
|
|
242
249
|
designSystem: workspaceDesignSystem,
|
|
@@ -276,6 +283,7 @@ export default function Index() {
|
|
|
276
283
|
const [selectedReferenceDeckId, setSelectedReferenceDeckId] = useState<
|
|
277
284
|
string | null
|
|
278
285
|
>(null);
|
|
286
|
+
const [deckSearch, setDeckSearch] = useState("");
|
|
279
287
|
// True while the picker still reflects an auto-applied default rather than
|
|
280
288
|
// an explicit user choice. `useWorkspaceDefaults()`/`useDesignSystems()`
|
|
281
289
|
// resolve asynchronously, so the initial value set on dialog open can be a
|
|
@@ -290,40 +298,39 @@ export default function Index() {
|
|
|
290
298
|
const anchorRef = useRef<HTMLElement | null>(null);
|
|
291
299
|
// Keep anchorRef.current in sync so PromptPopover can read it
|
|
292
300
|
anchorRef.current = anchorElRef.current;
|
|
293
|
-
const designSystemTitleById = useMemo<Map<string, string>>(
|
|
294
|
-
() => new Map(designSystems.map((ds) => [ds.id, ds.title])),
|
|
295
|
-
[designSystems],
|
|
296
|
-
);
|
|
297
|
-
// A workspace default the caller cannot open is reported by the action as
|
|
298
|
-
// `unavailable` rather than absent; preselecting it would send every new
|
|
299
|
-
// prompt at a deck that 404s, so fall back to no reference instead.
|
|
300
|
-
const workspaceReferenceDeckId =
|
|
301
|
-
workspaceReferenceDeck && !workspaceReferenceDeck.unavailable
|
|
302
|
-
? workspaceReferenceDeck.id
|
|
303
|
-
: null;
|
|
304
301
|
const workspaceDesignSystemId =
|
|
305
302
|
workspaceDesignSystem && !workspaceDesignSystem.unavailable
|
|
306
303
|
? workspaceDesignSystem.id
|
|
307
304
|
: null;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
305
|
+
const lastUsedDesignSystemId =
|
|
306
|
+
recentReferences.find(
|
|
307
|
+
(reference) =>
|
|
308
|
+
reference.kind === "design-system" &&
|
|
309
|
+
designSystems.some((designSystem) => designSystem.id === reference.id),
|
|
310
|
+
)?.id ?? null;
|
|
311
|
+
const lastUsedReferenceDeckId =
|
|
312
|
+
recentReferences.find(
|
|
313
|
+
(reference) =>
|
|
314
|
+
reference.kind === "deck" &&
|
|
315
|
+
decks.some((deck) => deck.id === reference.id),
|
|
316
|
+
)?.id ?? null;
|
|
313
317
|
const initialDesignSystemId =
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
defaultSystem?.id ??
|
|
317
|
-
null;
|
|
318
|
+
lastUsedDesignSystemId ?? workspaceDesignSystemId;
|
|
319
|
+
const initialReferenceDeckId = lastUsedReferenceDeckId;
|
|
318
320
|
const deckFilter = searchParams.get("createdBy") === "me" ? "mine" : "all";
|
|
321
|
+
const normalizedDeckSearch = deckSearch.trim().toLowerCase();
|
|
319
322
|
const visibleDecks = useMemo(
|
|
320
323
|
() =>
|
|
321
324
|
sortDecksByRecency(
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
+
decks.filter((deck) => {
|
|
326
|
+
if (deckFilter === "mine" && !deck.createdByMe) return false;
|
|
327
|
+
return (
|
|
328
|
+
normalizedDeckSearch.length === 0 ||
|
|
329
|
+
deck.title.toLowerCase().includes(normalizedDeckSearch)
|
|
330
|
+
);
|
|
331
|
+
}),
|
|
325
332
|
),
|
|
326
|
-
[deckFilter, decks],
|
|
333
|
+
[deckFilter, decks, normalizedDeckSearch],
|
|
327
334
|
);
|
|
328
335
|
const rememberReference = useCallback(
|
|
329
336
|
(reference: Parameters<typeof rememberRecentReference>[0]) => {
|
|
@@ -332,24 +339,16 @@ export default function Index() {
|
|
|
332
339
|
},
|
|
333
340
|
[],
|
|
334
341
|
);
|
|
342
|
+
const forgetReference = useCallback((kind: RecentReference["kind"]) => {
|
|
343
|
+
const result = forgetRecentReference(kind);
|
|
344
|
+
if (result.readable) setRecentReferences(result.items);
|
|
345
|
+
}, []);
|
|
335
346
|
|
|
336
347
|
useEffect(() => {
|
|
337
348
|
const result = readRecentReferences();
|
|
338
349
|
if (result.readable) setRecentReferences(result.items);
|
|
339
350
|
}, []);
|
|
340
351
|
|
|
341
|
-
useEffect(() => {
|
|
342
|
-
if (initialDesignSystemId) {
|
|
343
|
-
rememberReference({
|
|
344
|
-
id: initialDesignSystemId,
|
|
345
|
-
kind: "design-system",
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
if (workspaceReferenceDeckId) {
|
|
349
|
-
rememberReference({ id: workspaceReferenceDeckId, kind: "deck" });
|
|
350
|
-
}
|
|
351
|
-
}, [initialDesignSystemId, rememberReference, workspaceReferenceDeckId]);
|
|
352
|
-
|
|
353
352
|
const initialPrompt = searchParams.get("initialPrompt")?.trim() ?? "";
|
|
354
353
|
const onboardingPreview = searchParams.get("onboarding") === "preview";
|
|
355
354
|
const openInitialPrompt = useCallback(() => {
|
|
@@ -430,10 +429,10 @@ export default function Index() {
|
|
|
430
429
|
designSystemAutoRef.current = true;
|
|
431
430
|
referenceDeckAutoRef.current = true;
|
|
432
431
|
setSelectedDesignSystemId(initialDesignSystemId ?? null);
|
|
433
|
-
setSelectedReferenceDeckId(
|
|
432
|
+
setSelectedReferenceDeckId(initialReferenceDeckId ?? null);
|
|
434
433
|
setShowNewDeckPrompt(true);
|
|
435
434
|
},
|
|
436
|
-
[initialDesignSystemId,
|
|
435
|
+
[initialDesignSystemId, initialReferenceDeckId],
|
|
437
436
|
);
|
|
438
437
|
|
|
439
438
|
const setNewDeckPromptOpen = useCallback(
|
|
@@ -486,13 +485,13 @@ export default function Index() {
|
|
|
486
485
|
}
|
|
487
486
|
}, [initialDesignSystemId, designSystems.length, showNewDeckPrompt]);
|
|
488
487
|
|
|
489
|
-
// Same as above for the reference-deck picker:
|
|
488
|
+
// Same as above for the reference-deck picker: the local last-used reference
|
|
490
489
|
// can still be loading when the dialog opens, so re-apply it once it
|
|
491
490
|
// resolves unless the user already picked a reference deck.
|
|
492
491
|
useEffect(() => {
|
|
493
492
|
if (!showNewDeckPrompt || !referenceDeckAutoRef.current) return;
|
|
494
|
-
setSelectedReferenceDeckId(
|
|
495
|
-
}, [
|
|
493
|
+
setSelectedReferenceDeckId(initialReferenceDeckId ?? null);
|
|
494
|
+
}, [initialReferenceDeckId, showNewDeckPrompt]);
|
|
496
495
|
|
|
497
496
|
// Restore a prompt that was held back when the user wasn't signed in:
|
|
498
497
|
// we wrote the text to sessionStorage before redirecting to sign-in,
|
|
@@ -516,9 +515,9 @@ export default function Index() {
|
|
|
516
515
|
designSystemAutoRef.current = true;
|
|
517
516
|
referenceDeckAutoRef.current = true;
|
|
518
517
|
setSelectedDesignSystemId(initialDesignSystemId ?? null);
|
|
519
|
-
setSelectedReferenceDeckId(
|
|
518
|
+
setSelectedReferenceDeckId(initialReferenceDeckId ?? null);
|
|
520
519
|
setShowNewDeckPrompt(true);
|
|
521
|
-
}, [initialDesignSystemId,
|
|
520
|
+
}, [initialDesignSystemId, initialReferenceDeckId, session]);
|
|
522
521
|
|
|
523
522
|
// Recovering from a failed deck-generation kickoff (see
|
|
524
523
|
// recoverFromGenerationSetupFailure below) navigates back to this route
|
|
@@ -598,50 +597,67 @@ export default function Index() {
|
|
|
598
597
|
const deckId = deck.id;
|
|
599
598
|
setNewDeckPromptOpen(false);
|
|
600
599
|
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
// Leave the grid as soon as the optimistic deck exists. Persistence and
|
|
601
|
+
// agent context hydration can take several seconds, so the editor's
|
|
602
|
+
// generation state is the only useful surface while that work finishes.
|
|
603
|
+
navigate(`/deck/${deck.id}?generating=1`, {
|
|
604
|
+
replace: true,
|
|
605
|
+
flushSync: true,
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
const recoverFromGenerationSetupFailure = (description: string) => {
|
|
603
609
|
if (!savePromptForRetry(prompt)) {
|
|
604
610
|
setNewDeckInitialPrompt({ text: prompt, key: Date.now() });
|
|
605
611
|
}
|
|
606
612
|
setNewDeckRetryFiles(filesForGeneration);
|
|
607
613
|
deleteDeck(deckId);
|
|
608
|
-
toast.error(t("home.generationStartFailed"), {
|
|
609
|
-
|
|
614
|
+
toast.error(t("home.generationStartFailed"), { description });
|
|
615
|
+
if (
|
|
616
|
+
typeof window !== "undefined" &&
|
|
617
|
+
deckIdFromPathname(window.location.pathname) === deckId
|
|
618
|
+
) {
|
|
619
|
+
navigate("/", {
|
|
620
|
+
replace: true,
|
|
621
|
+
state: {
|
|
622
|
+
retryPrompt: prompt,
|
|
623
|
+
retryFiles: filesForGeneration,
|
|
624
|
+
} satisfies DeckGenerationRetryState,
|
|
625
|
+
flushSync: true,
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
const persisted = await ensureDeckPersisted(deck.id);
|
|
631
|
+
if (!persisted.persisted) {
|
|
632
|
+
recoverFromGenerationSetupFailure(
|
|
633
|
+
describeDeckPersistenceFailure(
|
|
610
634
|
persisted,
|
|
611
635
|
t("home.generationStartFailedDescription"),
|
|
612
636
|
),
|
|
613
|
-
|
|
614
|
-
setShowNewDeckPrompt(true);
|
|
637
|
+
);
|
|
615
638
|
return;
|
|
616
639
|
}
|
|
617
640
|
|
|
618
641
|
let importedSourceDeck: ImportedSourceDeck | null = null;
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
}
|
|
628
|
-
setNewDeckRetryFiles(filesForGeneration);
|
|
629
|
-
deleteDeck(deckId);
|
|
630
|
-
toast.error(t("home.generationStartFailed"), {
|
|
631
|
-
description:
|
|
642
|
+
if (isSourceImprovementRequest(prompt, filesForGeneration)) {
|
|
643
|
+
try {
|
|
644
|
+
importedSourceDeck = await importUploadedDeckIntoDeck(
|
|
645
|
+
filesForGeneration,
|
|
646
|
+
deckId,
|
|
647
|
+
);
|
|
648
|
+
} catch (error) {
|
|
649
|
+
recoverFromGenerationSetupFailure(
|
|
632
650
|
error instanceof Error
|
|
633
651
|
? error.message
|
|
634
652
|
: t("home.generationStartFailedDescription"),
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
653
|
+
);
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
638
656
|
}
|
|
639
657
|
|
|
640
658
|
clearPendingPromptForRetry();
|
|
641
659
|
setNewDeckInitialPrompt(null);
|
|
642
660
|
setNewDeckRetryFiles([]);
|
|
643
|
-
navigate(`/deck/${deck.id}`, { flushSync: true });
|
|
644
|
-
|
|
645
661
|
const trimmedPrompt = prompt.trim();
|
|
646
662
|
const hasImportedGoogleDocContext = trimmedPrompt.includes("<google-doc ");
|
|
647
663
|
const googleDocUrls = hasImportedGoogleDocContext
|
|
@@ -662,11 +678,11 @@ export default function Index() {
|
|
|
662
678
|
"If the action cannot read a private document, tell the user the exact sharing step from the action error instead of generating from the URL alone.",
|
|
663
679
|
].join("\n")
|
|
664
680
|
: "";
|
|
665
|
-
const referenceDeckContext =
|
|
666
|
-
await
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
681
|
+
const [referenceDeckContext, hydratedDesignSystemContext] =
|
|
682
|
+
await Promise.all([
|
|
683
|
+
loadReferenceDeckGenerationContext(referenceDeckId),
|
|
684
|
+
loadDesignSystemGenerationContext(selectedDesignSystem?.id),
|
|
685
|
+
]);
|
|
670
686
|
const designSystemContext = selectedDesignSystem
|
|
671
687
|
? [
|
|
672
688
|
"",
|
|
@@ -703,19 +719,21 @@ export default function Index() {
|
|
|
703
719
|
"Source-preserving improvement mode:",
|
|
704
720
|
`- The target deck already contains ${importedSourceDeck.slideCount} imported source slides. Treat those slides as the user's complete source, not as inspiration for a new deck.`,
|
|
705
721
|
"- Keep the exact source slide count, order, IDs, factual meaning, notes, images, charts, tables, diagrams, and freeform objects unless the user explicitly asks to change one of them.",
|
|
706
|
-
"- Read
|
|
707
|
-
"- Do not call
|
|
708
|
-
|
|
722
|
+
"- Read get-deck once before editing to obtain every existing slide ID and source HTML, load the linked design system with get-design-system, then make a deck-wide restyle with one patch-deck call using requireAllSourceSlides=true and one patch-slide operation with fields.content for every source slide ID. Do not split a full-deck restyle into arbitrary batches or fall back to one-by-one update-slide calls; use update-slide only for a targeted one-slide edit. Keep every original image source and enough original factual copy for each slide; for PDF slides, use restrained design-system chrome around the page without obscuring it.",
|
|
723
|
+
"- Do not call add-slide, delete slides, reorder slides, or replace source images with generic cards. Do not claim success until get-deck verifies the same slide IDs and count after the edits.",
|
|
724
|
+
'- After the patch succeeds, verify with get-deck using compact: "true" so only slide IDs, count, and previews are returned. Do not report an initial or partial pass, and do not leave any source slides for a later run.',
|
|
725
|
+
"- If get-deck reports partial source fidelity or skipped images, stop and report the exact warning instead of claiming a reliable restyle.",
|
|
709
726
|
].join("\n")
|
|
710
727
|
: "";
|
|
711
728
|
const sourceModeInstructions = importedSourceDeck
|
|
712
729
|
? [
|
|
713
730
|
"The request is an in-place visual improvement of an imported source deck. Make a coherent style pass across every existing slide while preserving all source content and media.",
|
|
714
|
-
"Do not use the new-deck add-slide workflow for this source-preserving request.",
|
|
731
|
+
"Do not use the new-deck add-slide workflow for this source-preserving request. Finish every source slide in this run; if patch-deck rejects incomplete coverage, continue with the returned missing IDs instead of reporting success with a partial deck.",
|
|
715
732
|
].join("\n")
|
|
716
733
|
: [
|
|
734
|
+
"This is a new deck. Keep it empty until generation begins; attached reference files must not seed it with imported slides.",
|
|
717
735
|
"Start a `manage-progress` run so progress appears in the app header. Add the first slide as soon as it is ready, then continue one slide at a time so the editor visibly fills in.",
|
|
718
|
-
"After reading any requested or
|
|
736
|
+
"After reading any requested or attached reference material, but before adding the first slide, choose a concise, specific deck title from the user's request and source material. Never use the deck id, run id, file id, or another opaque alphanumeric token as the title. Call `patch-deck` with `deckId: \"" +
|
|
719
737
|
deckId +
|
|
720
738
|
'\"` and `operations: [{ "op": "patch-deck-fields", "fields": { "title": "<generated title>" } }]`. Include only `title` in `fields`; omit all other optional fields. Never leave a generated deck named "Untitled Deck" or another placeholder.',
|
|
721
739
|
"If the user asks for a standalone visual, diagram, hero, one-pager, poster, or a couple of visuals, create only the requested one/few polished visual slides. Do not pad the result into a full presentation.",
|
|
@@ -754,10 +772,6 @@ export default function Index() {
|
|
|
754
772
|
).catch(() => {});
|
|
755
773
|
deleteClientAppState("guided-questions").catch(() => {});
|
|
756
774
|
|
|
757
|
-
navigate(`/deck/${deck.id}?generating=1`, {
|
|
758
|
-
replace: true,
|
|
759
|
-
flushSync: true,
|
|
760
|
-
});
|
|
761
775
|
agentSubmit(createDeckAgentMessage(trimmedPrompt), context, {
|
|
762
776
|
newTab: true,
|
|
763
777
|
reuseEmptyTab: true,
|
|
@@ -774,18 +788,150 @@ export default function Index() {
|
|
|
774
788
|
[setNewDeckPromptOpen],
|
|
775
789
|
);
|
|
776
790
|
|
|
791
|
+
const handlePromptSkip = useCallback(() => {
|
|
792
|
+
setNewDeckPromptOpen(false, { clearInitialPrompt: false });
|
|
793
|
+
setPendingDeck({ prompt: "", files: [] });
|
|
794
|
+
setShowNewDeckReferenceStep(true);
|
|
795
|
+
}, [setNewDeckPromptOpen]);
|
|
796
|
+
|
|
797
|
+
const handleDirectImport = useCallback(
|
|
798
|
+
async (selection: PromptImportSelection): Promise<boolean> => {
|
|
799
|
+
if (!session) {
|
|
800
|
+
setSignInPromptHadFiles(selection.kind !== "google-slides");
|
|
801
|
+
setShowSignInDialog(true);
|
|
802
|
+
return false;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
if (selection.kind === "google-slides") {
|
|
806
|
+
const imported = (await callAction("import-google-slides-reference", {
|
|
807
|
+
presentationUrl: selection.url,
|
|
808
|
+
})) as {
|
|
809
|
+
id?: unknown;
|
|
810
|
+
imported?: unknown;
|
|
811
|
+
slideCount?: unknown;
|
|
812
|
+
};
|
|
813
|
+
if (
|
|
814
|
+
typeof imported.id !== "string" ||
|
|
815
|
+
!imported.id ||
|
|
816
|
+
imported.imported !== true ||
|
|
817
|
+
typeof imported.slideCount !== "number" ||
|
|
818
|
+
imported.slideCount < 1
|
|
819
|
+
) {
|
|
820
|
+
throw new Error(
|
|
821
|
+
"The Google Slides presentation did not create a deck.",
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
await reloadDecks();
|
|
825
|
+
navigate(`/deck/${imported.id}`, { flushSync: true });
|
|
826
|
+
return true;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
const uploaded = await uploadPromptFiles(selection.files);
|
|
830
|
+
const file = uploaded[0];
|
|
831
|
+
if (!file) throw new Error("The selected file could not be uploaded.");
|
|
832
|
+
|
|
833
|
+
if (selection.kind === "pptx") {
|
|
834
|
+
const imported = (await callAction("import-pptx", {
|
|
835
|
+
filePath: file.path,
|
|
836
|
+
designSystemId: initialDesignSystemId,
|
|
837
|
+
})) as {
|
|
838
|
+
id?: unknown;
|
|
839
|
+
imported?: unknown;
|
|
840
|
+
slideCount?: unknown;
|
|
841
|
+
};
|
|
842
|
+
if (
|
|
843
|
+
typeof imported.id !== "string" ||
|
|
844
|
+
!imported.id ||
|
|
845
|
+
imported.imported !== true ||
|
|
846
|
+
typeof imported.slideCount !== "number" ||
|
|
847
|
+
imported.slideCount < 1
|
|
848
|
+
) {
|
|
849
|
+
throw new Error("The PowerPoint presentation did not create a deck.");
|
|
850
|
+
}
|
|
851
|
+
await reloadDecks();
|
|
852
|
+
navigate(`/deck/${imported.id}`, { flushSync: true });
|
|
853
|
+
return true;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
let deck: ReturnType<typeof createDeck> | undefined;
|
|
857
|
+
flushSync(() => {
|
|
858
|
+
deck = createDeck(undefined, {
|
|
859
|
+
noDefaultSlides: true,
|
|
860
|
+
designSystemId: initialDesignSystemId,
|
|
861
|
+
});
|
|
862
|
+
});
|
|
863
|
+
if (!deck) throw new Error("The PDF deck could not be created.");
|
|
864
|
+
|
|
865
|
+
const persisted = await ensureDeckPersisted(deck.id);
|
|
866
|
+
if (!persisted.persisted) {
|
|
867
|
+
deleteDeck(deck.id);
|
|
868
|
+
throw new Error(
|
|
869
|
+
describeDeckPersistenceFailure(
|
|
870
|
+
persisted,
|
|
871
|
+
"The PDF deck could not be saved.",
|
|
872
|
+
),
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
try {
|
|
877
|
+
const imported = (await callAction("import-file", {
|
|
878
|
+
filePath: file.path,
|
|
879
|
+
format: "pdf",
|
|
880
|
+
deckId: deck.id,
|
|
881
|
+
importIntoDeck: true,
|
|
882
|
+
})) as {
|
|
883
|
+
imported?: unknown;
|
|
884
|
+
deckId?: unknown;
|
|
885
|
+
pageCount?: unknown;
|
|
886
|
+
};
|
|
887
|
+
if (
|
|
888
|
+
imported.imported !== true ||
|
|
889
|
+
imported.deckId !== deck.id ||
|
|
890
|
+
typeof imported.pageCount !== "number" ||
|
|
891
|
+
imported.pageCount < 1
|
|
892
|
+
) {
|
|
893
|
+
throw new Error("The PDF could not be imported into the new deck.");
|
|
894
|
+
}
|
|
895
|
+
await reloadDecks();
|
|
896
|
+
navigate(`/deck/${deck.id}`, { flushSync: true });
|
|
897
|
+
return true;
|
|
898
|
+
} catch (error) {
|
|
899
|
+
deleteDeck(deck.id);
|
|
900
|
+
throw error;
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
[
|
|
904
|
+
callAction,
|
|
905
|
+
createDeck,
|
|
906
|
+
deleteDeck,
|
|
907
|
+
ensureDeckPersisted,
|
|
908
|
+
initialDesignSystemId,
|
|
909
|
+
navigate,
|
|
910
|
+
reloadDecks,
|
|
911
|
+
session,
|
|
912
|
+
],
|
|
913
|
+
);
|
|
914
|
+
|
|
777
915
|
const handleReferenceSelect = useCallback(
|
|
778
916
|
async (selection: NewDeckReferenceSelection) => {
|
|
779
917
|
const pending = pendingDeck;
|
|
780
918
|
if (!pending) return;
|
|
781
|
-
if (selection.designSystemId) {
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
919
|
+
if (selection.designSystemId !== undefined) {
|
|
920
|
+
if (selection.designSystemId) {
|
|
921
|
+
rememberReference({
|
|
922
|
+
id: selection.designSystemId,
|
|
923
|
+
kind: "design-system",
|
|
924
|
+
});
|
|
925
|
+
} else {
|
|
926
|
+
forgetReference("design-system");
|
|
927
|
+
}
|
|
786
928
|
}
|
|
787
|
-
if (selection.referenceDeckId) {
|
|
788
|
-
|
|
929
|
+
if (selection.referenceDeckId !== undefined) {
|
|
930
|
+
if (selection.referenceDeckId) {
|
|
931
|
+
rememberReference({ id: selection.referenceDeckId, kind: "deck" });
|
|
932
|
+
} else {
|
|
933
|
+
forgetReference("deck");
|
|
934
|
+
}
|
|
789
935
|
}
|
|
790
936
|
setShowNewDeckReferenceStep(false);
|
|
791
937
|
setPendingDeck(null);
|
|
@@ -795,7 +941,12 @@ export default function Index() {
|
|
|
795
941
|
selection,
|
|
796
942
|
);
|
|
797
943
|
},
|
|
798
|
-
[
|
|
944
|
+
[
|
|
945
|
+
forgetReference,
|
|
946
|
+
handleCreateDeckWithPrompt,
|
|
947
|
+
pendingDeck,
|
|
948
|
+
rememberReference,
|
|
949
|
+
],
|
|
799
950
|
);
|
|
800
951
|
|
|
801
952
|
const handleReferenceImport = useCallback(
|
|
@@ -901,7 +1052,6 @@ export default function Index() {
|
|
|
901
1052
|
);
|
|
902
1053
|
if (importedReference) {
|
|
903
1054
|
await reloadDecks();
|
|
904
|
-
rememberReference({ id: importedReference.id, kind: "deck" });
|
|
905
1055
|
setSelectedReferenceDeckId(importedReference.id);
|
|
906
1056
|
}
|
|
907
1057
|
return importedReference;
|
|
@@ -924,7 +1074,6 @@ export default function Index() {
|
|
|
924
1074
|
ensureDeckPersisted,
|
|
925
1075
|
pendingDeck,
|
|
926
1076
|
reloadDecks,
|
|
927
|
-
rememberReference,
|
|
928
1077
|
t,
|
|
929
1078
|
],
|
|
930
1079
|
);
|
|
@@ -964,7 +1113,6 @@ export default function Index() {
|
|
|
964
1113
|
source: "google-slides",
|
|
965
1114
|
};
|
|
966
1115
|
await reloadDecks();
|
|
967
|
-
rememberReference({ id: importedReference.id, kind: "deck" });
|
|
968
1116
|
setSelectedReferenceDeckId(importedReference.id);
|
|
969
1117
|
return importedReference;
|
|
970
1118
|
} catch (error) {
|
|
@@ -979,7 +1127,7 @@ export default function Index() {
|
|
|
979
1127
|
setReferenceImporting(false);
|
|
980
1128
|
}
|
|
981
1129
|
},
|
|
982
|
-
[callAction, reloadDecks,
|
|
1130
|
+
[callAction, reloadDecks, t],
|
|
983
1131
|
);
|
|
984
1132
|
|
|
985
1133
|
const handleReferenceSkip = useCallback(() => {
|
|
@@ -990,11 +1138,22 @@ export default function Index() {
|
|
|
990
1138
|
}
|
|
991
1139
|
setShowNewDeckReferenceStep(false);
|
|
992
1140
|
setPendingDeck(null);
|
|
1141
|
+
forgetReference("design-system");
|
|
1142
|
+
forgetReference("deck");
|
|
1143
|
+
if (!pending.prompt.trim() && pending.files.length === 0) {
|
|
1144
|
+
handleCreateDeckBlank();
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
993
1147
|
void handleCreateDeckWithPrompt(pending.prompt, pending.files, {
|
|
994
1148
|
designSystemId: null,
|
|
995
1149
|
referenceDeckId: null,
|
|
996
1150
|
});
|
|
997
|
-
}, [
|
|
1151
|
+
}, [
|
|
1152
|
+
forgetReference,
|
|
1153
|
+
handleCreateDeckBlank,
|
|
1154
|
+
handleCreateDeckWithPrompt,
|
|
1155
|
+
pendingDeck,
|
|
1156
|
+
]);
|
|
998
1157
|
|
|
999
1158
|
const handleConfirmDelete = () => {
|
|
1000
1159
|
if (deckToDelete) {
|
|
@@ -1132,7 +1291,7 @@ export default function Index() {
|
|
|
1132
1291
|
);
|
|
1133
1292
|
|
|
1134
1293
|
return (
|
|
1135
|
-
<main className="min-w-0 flex-1 overflow-y-auto px-4
|
|
1294
|
+
<main className="min-w-0 flex-1 overflow-y-auto px-4 pb-6 pt-0 sm:px-6 sm:pb-10">
|
|
1136
1295
|
{loading ? (
|
|
1137
1296
|
<>
|
|
1138
1297
|
<div className="mb-4 flex items-center justify-end">
|
|
@@ -1141,10 +1300,7 @@ export default function Index() {
|
|
|
1141
1300
|
<div className="deck-grid-container">
|
|
1142
1301
|
<div className="deck-grid grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
|
|
1143
1302
|
{Array.from({ length: 8 }).map((_, i) => (
|
|
1144
|
-
<div
|
|
1145
|
-
key={i}
|
|
1146
|
-
className="overflow-hidden rounded-xl border border-border bg-card"
|
|
1147
|
-
>
|
|
1303
|
+
<div key={i} className="overflow-hidden rounded-xl bg-card">
|
|
1148
1304
|
<div className="aspect-video animate-pulse bg-muted/50" />
|
|
1149
1305
|
<div className="space-y-2 p-4">
|
|
1150
1306
|
<div className="h-4 w-3/4 animate-pulse rounded bg-muted" />
|
|
@@ -1180,37 +1336,49 @@ export default function Index() {
|
|
|
1180
1336
|
) : (
|
|
1181
1337
|
<>
|
|
1182
1338
|
<div className="mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
1183
|
-
<
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
<ToggleGroupItem
|
|
1191
|
-
value="all"
|
|
1192
|
-
aria-label={t("home.showAllDecks")}
|
|
1193
|
-
className="h-7 rounded-md px-3 text-xs data-[state=on]:bg-accent"
|
|
1339
|
+
<div className="flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center">
|
|
1340
|
+
<ToggleGroup
|
|
1341
|
+
type="single"
|
|
1342
|
+
value={deckFilter}
|
|
1343
|
+
onValueChange={(value) => value && setDeckFilter(value)}
|
|
1344
|
+
className="w-fit rounded-lg border border-border bg-card p-0.5"
|
|
1345
|
+
size="sm"
|
|
1194
1346
|
>
|
|
1195
|
-
<
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
<
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1347
|
+
<ToggleGroupItem
|
|
1348
|
+
value="all"
|
|
1349
|
+
aria-label={t("home.showAllDecks")}
|
|
1350
|
+
className="h-7 rounded-md px-3 text-xs data-[state=on]:bg-accent"
|
|
1351
|
+
>
|
|
1352
|
+
<IconStack2 className="me-1.5 h-3.5 w-3.5" />
|
|
1353
|
+
{t("home.all")}
|
|
1354
|
+
</ToggleGroupItem>
|
|
1355
|
+
<ToggleGroupItem
|
|
1356
|
+
value="mine"
|
|
1357
|
+
aria-label={t("home.showMineDecks")}
|
|
1358
|
+
className="h-7 rounded-md px-3 text-xs data-[state=on]:bg-accent"
|
|
1359
|
+
>
|
|
1360
|
+
<IconUserCircle className="me-1.5 h-3.5 w-3.5" />
|
|
1361
|
+
{t("home.mine")}
|
|
1362
|
+
</ToggleGroupItem>
|
|
1363
|
+
</ToggleGroup>
|
|
1364
|
+
<label className="flex h-8 w-full items-center gap-2 rounded-lg border border-border bg-card px-2.5 text-muted-foreground sm:w-60">
|
|
1365
|
+
<IconSearch className="size-3.5 shrink-0" aria-hidden="true" />
|
|
1366
|
+
<Input
|
|
1367
|
+
type="search"
|
|
1368
|
+
value={deckSearch}
|
|
1369
|
+
onChange={(event) => setDeckSearch(event.target.value)}
|
|
1370
|
+
placeholder={t("root.searchDecks")}
|
|
1371
|
+
aria-label={t("root.searchDecks")}
|
|
1372
|
+
className="h-7 min-w-0 flex-1 border-0 bg-transparent p-0 text-xs shadow-none focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
1373
|
+
/>
|
|
1374
|
+
</label>
|
|
1375
|
+
</div>
|
|
1207
1376
|
<span className="text-xs text-muted-foreground/70">
|
|
1208
|
-
{deckFilter === "mine"
|
|
1377
|
+
{deckFilter === "mine" || normalizedDeckSearch
|
|
1209
1378
|
? `${visibleDecks.length} of ${decks.length}`
|
|
1210
|
-
:
|
|
1379
|
+
: visibleDecks.length}{" "}
|
|
1211
1380
|
{t("home.deckCount", {
|
|
1212
|
-
count:
|
|
1213
|
-
deckFilter === "mine" ? visibleDecks.length : decks.length,
|
|
1381
|
+
count: visibleDecks.length,
|
|
1214
1382
|
})}
|
|
1215
1383
|
</span>
|
|
1216
1384
|
</div>
|
|
@@ -1219,7 +1387,7 @@ export default function Index() {
|
|
|
1219
1387
|
{/* New deck card */}
|
|
1220
1388
|
<button
|
|
1221
1389
|
onClick={openNewDeck}
|
|
1222
|
-
className="group relative cursor-pointer overflow-hidden rounded-xl border border-
|
|
1390
|
+
className="group relative cursor-pointer overflow-hidden rounded-xl border border-transparent bg-card text-start transition-[background-color,border-color] duration-200 hover:border-border hover:bg-accent/30"
|
|
1223
1391
|
>
|
|
1224
1392
|
<div className="flex aspect-video items-center justify-center bg-muted/30">
|
|
1225
1393
|
<div className="flex h-12 w-12 items-center justify-center rounded-xl bg-accent/50 group-hover:bg-accent">
|
|
@@ -1230,9 +1398,6 @@ export default function Index() {
|
|
|
1230
1398
|
<h3 className="text-sm font-medium text-muted-foreground group-hover:text-foreground/70">
|
|
1231
1399
|
{t("home.newDeck")}
|
|
1232
1400
|
</h3>
|
|
1233
|
-
<div className="mt-1 text-xs text-muted-foreground/70">
|
|
1234
|
-
{t("home.createDeckOrVisual")}
|
|
1235
|
-
</div>
|
|
1236
1401
|
</div>
|
|
1237
1402
|
</button>
|
|
1238
1403
|
|
|
@@ -1244,19 +1409,16 @@ export default function Index() {
|
|
|
1244
1409
|
onRename={handleRename}
|
|
1245
1410
|
onDuplicate={handleDuplicate}
|
|
1246
1411
|
onToggleStar={handleToggleStar}
|
|
1247
|
-
designSystemTitle={
|
|
1248
|
-
deck.designSystemId
|
|
1249
|
-
? designSystemTitleById.get(deck.designSystemId)
|
|
1250
|
-
: null
|
|
1251
|
-
}
|
|
1252
1412
|
isWorkspaceDefault={workspaceReferenceDeck?.id === deck.id}
|
|
1253
1413
|
canSetWorkspaceDefault={canManageWorkspaceDefaults}
|
|
1254
1414
|
onSetWorkspaceDefault={handleSetWorkspaceDefaultDeck}
|
|
1255
1415
|
/>
|
|
1256
1416
|
))}
|
|
1257
1417
|
{visibleDecks.length === 0 && (
|
|
1258
|
-
<div className="rounded-xl
|
|
1259
|
-
{
|
|
1418
|
+
<div className="rounded-xl bg-card p-6 text-sm text-muted-foreground">
|
|
1419
|
+
{normalizedDeckSearch
|
|
1420
|
+
? t("home.noDecksMatchSearch")
|
|
1421
|
+
: t("home.noMineDecks")}
|
|
1260
1422
|
</div>
|
|
1261
1423
|
)}
|
|
1262
1424
|
</div>
|
|
@@ -1317,9 +1479,11 @@ export default function Index() {
|
|
|
1317
1479
|
onOpenChange={setNewDeckPromptOpen}
|
|
1318
1480
|
title={t("home.newDeckPromptTitle")}
|
|
1319
1481
|
placeholder={t("home.newDeckPlaceholder")}
|
|
1320
|
-
onSkip={
|
|
1482
|
+
onSkip={handlePromptSkip}
|
|
1321
1483
|
skipLabel={t("home.skipPrompt")}
|
|
1322
1484
|
onSubmit={handlePromptSubmit}
|
|
1485
|
+
onImport={handleDirectImport}
|
|
1486
|
+
importFromLabel={t("home.importFrom")}
|
|
1323
1487
|
importingLabel={t("editorToolbar.importing")}
|
|
1324
1488
|
onBeforeUpload={(prompt, files) => {
|
|
1325
1489
|
if (session) return true;
|
|
@@ -1337,11 +1501,14 @@ export default function Index() {
|
|
|
1337
1501
|
open={showNewDeckReferenceStep}
|
|
1338
1502
|
onOpenChange={(open) => {
|
|
1339
1503
|
if (!open) {
|
|
1340
|
-
const
|
|
1504
|
+
const pending = pendingDeck;
|
|
1341
1505
|
setShowNewDeckReferenceStep(false);
|
|
1342
1506
|
setPendingDeck(null);
|
|
1343
|
-
if (
|
|
1344
|
-
setNewDeckInitialPrompt({
|
|
1507
|
+
if (pending) {
|
|
1508
|
+
setNewDeckInitialPrompt({
|
|
1509
|
+
text: pending.prompt,
|
|
1510
|
+
key: Date.now(),
|
|
1511
|
+
});
|
|
1345
1512
|
setShowNewDeckPrompt(true);
|
|
1346
1513
|
}
|
|
1347
1514
|
}
|
|
@@ -1349,8 +1516,7 @@ export default function Index() {
|
|
|
1349
1516
|
designSystems={designSystems}
|
|
1350
1517
|
decks={decks}
|
|
1351
1518
|
defaultDesignSystemId={initialDesignSystemId}
|
|
1352
|
-
defaultReferenceDeckId={
|
|
1353
|
-
recentReferences={recentReferences}
|
|
1519
|
+
defaultReferenceDeckId={initialReferenceDeckId}
|
|
1354
1520
|
onSelect={(selection) => void handleReferenceSelect(selection)}
|
|
1355
1521
|
onImport={handleReferenceImport}
|
|
1356
1522
|
onImportSource={handleReferenceSourceImport}
|
|
@@ -1362,8 +1528,6 @@ export default function Index() {
|
|
|
1362
1528
|
chooseDeckLabel={t("home.referenceDeckPlaceholder")}
|
|
1363
1529
|
importingLabel={t("editorToolbar.importing")}
|
|
1364
1530
|
skipLabel={t("home.referenceDeckNone")}
|
|
1365
|
-
starredLabel={t("home.referenceDeckStarredGroup")}
|
|
1366
|
-
otherDecksLabel={t("home.referenceDeckOtherGroup")}
|
|
1367
1531
|
searchDecksLabel={t("root.searchDecks")}
|
|
1368
1532
|
promptSummary={pendingDeck?.prompt}
|
|
1369
1533
|
/>
|