@agent-native/core 0.95.1 → 0.97.0
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/README.md +6 -0
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +64 -0
- package/corpus/core/docs/content/audit-log.mdx +2 -1
- package/corpus/core/docs/content/automations.mdx +7 -7
- package/corpus/core/docs/content/creating-templates.mdx +1 -1
- package/corpus/core/docs/content/internationalization.mdx +2 -1
- package/corpus/core/docs/content/locales/ar-SA/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/ar-SA/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/ar-SA/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/ar-SA/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/package-lifecycle.mdx +19 -0
- package/corpus/core/docs/content/locales/ar-SA/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/ar-SA/security.mdx +8 -0
- package/corpus/core/docs/content/locales/de-DE/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/de-DE/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/de-DE/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/de-DE/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/package-lifecycle.mdx +22 -0
- package/corpus/core/docs/content/locales/de-DE/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/de-DE/security.mdx +8 -0
- package/corpus/core/docs/content/locales/es-ES/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/es-ES/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/es-ES/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/es-ES/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/package-lifecycle.mdx +22 -0
- package/corpus/core/docs/content/locales/es-ES/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/es-ES/security.mdx +8 -0
- package/corpus/core/docs/content/locales/fr-FR/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/fr-FR/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/fr-FR/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/fr-FR/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/package-lifecycle.mdx +21 -0
- package/corpus/core/docs/content/locales/fr-FR/sandbox-adapters.mdx +19 -8
- package/corpus/core/docs/content/locales/fr-FR/security.mdx +8 -0
- package/corpus/core/docs/content/locales/hi-IN/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/hi-IN/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/hi-IN/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/hi-IN/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/package-lifecycle.mdx +20 -0
- package/corpus/core/docs/content/locales/hi-IN/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/hi-IN/security.mdx +8 -0
- package/corpus/core/docs/content/locales/ja-JP/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/ja-JP/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/ja-JP/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/ja-JP/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/package-lifecycle.mdx +21 -0
- package/corpus/core/docs/content/locales/ja-JP/sandbox-adapters.mdx +17 -6
- package/corpus/core/docs/content/locales/ja-JP/security.mdx +8 -0
- package/corpus/core/docs/content/locales/ko-KR/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/ko-KR/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/ko-KR/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/ko-KR/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/package-lifecycle.mdx +20 -0
- package/corpus/core/docs/content/locales/ko-KR/sandbox-adapters.mdx +17 -6
- package/corpus/core/docs/content/locales/ko-KR/security.mdx +8 -0
- package/corpus/core/docs/content/locales/pt-BR/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/pt-BR/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/pt-BR/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/pt-BR/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/package-lifecycle.mdx +21 -0
- package/corpus/core/docs/content/locales/pt-BR/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/pt-BR/security.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-CN/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/zh-CN/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/zh-CN/getting-started.mdx +6 -4
- package/corpus/core/docs/content/locales/zh-CN/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/package-lifecycle.mdx +19 -0
- package/corpus/core/docs/content/locales/zh-CN/sandbox-adapters.mdx +17 -6
- package/corpus/core/docs/content/locales/zh-CN/security.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-TW/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/zh-TW/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/zh-TW/getting-started.mdx +6 -4
- package/corpus/core/docs/content/locales/zh-TW/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/package-lifecycle.mdx +19 -0
- package/corpus/core/docs/content/locales/zh-TW/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/zh-TW/security.mdx +8 -0
- package/corpus/core/docs/content/package-lifecycle.mdx +51 -0
- package/corpus/core/docs/content/sandbox-adapters.mdx +16 -5
- package/corpus/core/package.json +11 -2
- package/corpus/core/src/a2a/auth-policy.ts +33 -0
- package/corpus/core/src/a2a/client.ts +11 -1
- package/corpus/core/src/agent/durable-background.ts +15 -7
- package/corpus/core/src/agent/production-agent.ts +87 -27
- package/corpus/core/src/agent/run-store.ts +13 -4
- package/corpus/core/src/agent/thread-data-builder.ts +7 -5
- package/corpus/core/src/audit/actions/export-audit-events.ts +162 -0
- package/corpus/core/src/audit/store.ts +8 -3
- package/corpus/core/src/audit/types.ts +3 -0
- package/corpus/core/src/chat-threads/store.ts +20 -1
- package/corpus/core/src/cli/code-agent-executor.ts +1 -0
- package/corpus/core/src/cli/code-agent-runs.ts +14 -0
- package/corpus/core/src/cli/doctor.ts +396 -0
- package/corpus/core/src/cli/index.ts +56 -0
- package/corpus/core/src/cli/info.ts +3 -3
- package/corpus/core/src/cli/package-lifecycle.ts +821 -0
- package/corpus/core/src/client/AgentPanel.tsx +32 -25
- package/corpus/core/src/client/AssistantChat.tsx +36 -20
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +141 -90
- package/corpus/core/src/client/agent-chat-adapter.ts +9 -9
- package/corpus/core/src/client/chat/ChatHistoryList.tsx +404 -0
- package/corpus/core/src/client/chat/index.ts +6 -0
- package/corpus/core/src/client/chat/tool-call-display.tsx +37 -3
- package/corpus/core/src/client/code-agent-chat-adapter.ts +72 -4
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +52 -11
- package/corpus/core/src/client/composer/TiptapComposer.tsx +157 -20
- package/corpus/core/src/client/composer/VoiceButton.tsx +28 -0
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +5 -0
- package/corpus/core/src/client/conversation/code-agent-transcript.ts +4 -5
- package/corpus/core/src/client/guided-questions.tsx +2 -1
- package/corpus/core/src/client/index.ts +11 -0
- package/corpus/core/src/client/use-chat-threads.ts +10 -1
- package/corpus/core/src/client/voice-provider-status.ts +44 -0
- package/corpus/core/src/code-agents/transcript-normalizer.ts +76 -0
- package/corpus/core/src/deploy/build.ts +12 -11
- package/corpus/core/src/guards/db-tool-scoping.ts +129 -0
- package/corpus/core/src/guards/index.ts +23 -0
- package/corpus/core/src/guards/no-drizzle-push.ts +116 -0
- package/corpus/core/src/guards/no-env-credentials.ts +229 -0
- package/corpus/core/src/guards/no-env-mutation.ts +114 -0
- package/corpus/core/src/guards/no-localhost-fallback.ts +124 -0
- package/corpus/core/src/guards/no-unscoped-credentials.ts +227 -0
- package/corpus/core/src/guards/no-unscoped-queries.ts +834 -0
- package/corpus/core/src/guards/scan-utils.ts +105 -0
- package/corpus/core/src/guards/types.ts +30 -0
- package/corpus/core/src/integrations/a2a-continuation-processor.ts +35 -5
- package/corpus/core/src/integrations/adapters/slack.ts +74 -21
- package/corpus/core/src/integrations/webhook-handler.ts +14 -0
- package/corpus/core/src/localization/default-messages.ts +6 -0
- package/corpus/core/src/observability/hosted-model-experiment.ts +118 -0
- package/corpus/core/src/observability/routes.ts +17 -0
- package/corpus/core/src/observability/store.ts +4 -1
- package/corpus/core/src/observability/traces.ts +41 -2
- package/corpus/core/src/org/accept-pending.ts +9 -1
- package/corpus/core/src/org/migrations.ts +41 -0
- package/corpus/core/src/package-lifecycle/index.ts +1 -0
- package/corpus/core/src/package-lifecycle/manifest.ts +120 -0
- package/corpus/core/src/provider-api/custom-registry.ts +56 -0
- package/corpus/core/src/provider-api/index.ts +2 -0
- package/corpus/core/src/scripts/agent-engines/list-agent-engines.ts +19 -1
- package/corpus/core/src/scripts/call-agent.ts +53 -3
- package/corpus/core/src/scripts/chat/search-chats.ts +11 -8
- package/corpus/core/src/secrets/register-framework-secrets.ts +1 -1
- package/corpus/core/src/secrets/storage.ts +47 -27
- package/corpus/core/src/server/action-discovery.ts +4 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +95 -18
- package/corpus/core/src/server/core-routes-plugin.ts +45 -14
- package/corpus/core/src/server/csrf.ts +24 -5
- package/corpus/core/src/server/framework-request-handler.ts +34 -0
- package/corpus/core/src/server/google-realtime-session.ts +1 -36
- package/corpus/core/src/server/poll.ts +24 -2
- package/corpus/core/src/server/realtime-voice.ts +80 -24
- package/corpus/core/src/server/request-origin.ts +63 -0
- package/corpus/core/src/server/transcribe-voice.ts +1 -50
- package/corpus/core/src/server/voice-providers-status.ts +4 -3
- package/corpus/core/src/shared/cache-control.ts +2 -8
- package/corpus/core/src/styles/agent-native.css +1 -0
- package/corpus/core/src/styles/chat-history-list.css +313 -0
- package/corpus/core/src/templates/default/package.json +2 -2
- package/corpus/core/src/templates/headless/package.json +0 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/audit-log/SKILL.md +3 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +8 -4
- package/corpus/core/src/templates/workspace-core/package.json +0 -1
- package/corpus/core/src/templates/workspace-root/package.json +0 -1
- package/corpus/core/src/triggers/actions.ts +11 -3
- package/corpus/core/src/triggers/types.ts +7 -1
- package/corpus/core/src/vite/client.ts +1 -0
- package/corpus/templates/analytics/AGENTS.md +7 -0
- package/corpus/templates/analytics/actions/bigquery.ts +26 -2
- package/corpus/templates/analytics/actions/compose-dashboard.ts +65 -37
- package/corpus/templates/analytics/actions/data-source-status.ts +18 -0
- package/corpus/templates/analytics/actions/mutate-dashboard.ts +73 -24
- package/corpus/templates/analytics/actions/reorder-dashboard-panels.ts +16 -13
- package/corpus/templates/analytics/actions/update-dashboard.ts +53 -42
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +5 -4
- package/corpus/templates/analytics/app/global.css +10 -0
- package/corpus/templates/analytics/app/pages/Ask.tsx +25 -2
- package/corpus/templates/analytics/changelog/2026-07-10-analytics-answers-simple-time-bounded-metrics-without-unnece.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-analytics-chat-reliably-uses-connected-data-sources-across-s.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-chat-threads-now-stay-clear-of-top-actions-and-fade-smoothly.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-context-chips-can-now-be-selected-and-removed-one-at-a-time-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-dashboard-edits-from-the-agent-and-the-ui-at-the-same-time-n.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-the-ask-composer-no-longer-carries-dashboard-or-panel-contex.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-the-ask-section-stays-highlighted-while-its-chat-history-is-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-timed-out-bigquery-jobs-are-now-cancelled-so-they-stop-consu.md +6 -0
- package/corpus/templates/analytics/package.json +1 -2
- package/corpus/templates/analytics/server/lib/bigquery.ts +91 -14
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +154 -11
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +82 -7
- package/corpus/templates/assets/package.json +1 -2
- package/corpus/templates/brain/package.json +1 -2
- package/corpus/templates/calendar/package.json +1 -2
- package/corpus/templates/chat/package.json +1 -2
- package/corpus/templates/clips/changelog/2026-07-10-atomic-view-tracking.md +6 -0
- package/corpus/templates/clips/chrome-extension/package.json +3 -2
- package/corpus/templates/clips/desktop/package.json +6 -4
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +26 -13
- package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +4 -1
- package/corpus/templates/clips/package.json +1 -2
- package/corpus/templates/clips/server/db/schema.ts +29 -17
- package/corpus/templates/clips/server/plugins/db.ts +8 -0
- package/corpus/templates/clips/server/routes/api/view-event.post.ts +260 -105
- package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +16 -0
- package/corpus/templates/content/AGENTS.md +72 -62
- package/corpus/templates/content/actions/_content-database-source-adapters.ts +84 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +206 -96
- package/corpus/templates/content/actions/_notion-database-source-adapter.ts +216 -0
- package/corpus/templates/content/actions/_position-utils.ts +76 -0
- package/corpus/templates/content/actions/_property-utils.ts +31 -20
- package/corpus/templates/content/actions/add-database-item.ts +52 -39
- package/corpus/templates/content/actions/attach-content-database-source.ts +95 -11
- package/corpus/templates/content/actions/change-content-database-source-role.ts +24 -1
- package/corpus/templates/content/actions/configure-document-property.ts +36 -27
- package/corpus/templates/content/actions/create-content-database.ts +40 -30
- package/corpus/templates/content/actions/create-document.ts +39 -32
- package/corpus/templates/content/actions/duplicate-document-property.ts +37 -28
- package/corpus/templates/content/actions/list-notion-database-sources.ts +80 -0
- package/corpus/templates/content/actions/move-document.ts +64 -48
- package/corpus/templates/content/actions/refresh-content-database-source.ts +42 -3
- package/corpus/templates/content/actions/share-local-file-document.ts +36 -27
- package/corpus/templates/content/actions/suggest-source-join-key.ts +39 -16
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +89 -23
- package/corpus/templates/content/app/components/editor/database/settings.tsx +1 -1
- package/corpus/templates/content/app/hooks/use-content-database.ts +18 -1
- package/corpus/templates/content/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/content/app/i18n-data.ts +40 -0
- package/corpus/templates/content/changelog/2026-07-10-failed-row-creation-and-source-attach-now-show-an-error-inst.md +6 -0
- package/corpus/templates/content/changelog/2026-07-10-items-added-at-the-same-time-no-longer-end-up-with-identical.md +6 -0
- package/corpus/templates/content/changelog/2026-07-10-notion-databases-can-add-read-only-details-to-content-tables.md +6 -0
- package/corpus/templates/content/package.json +1 -2
- package/corpus/templates/content/parity/matrix.md +25 -25
- package/corpus/templates/content/parity/matrix.ts +1 -0
- package/corpus/templates/content/server/routes/api/documents/[id]/move.patch.ts +43 -26
- package/corpus/templates/content/shared/api.ts +16 -1
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +8 -4
- package/corpus/templates/design/AGENTS.md +12 -2
- package/corpus/templates/design/DEVELOPING.md +10 -6
- package/corpus/templates/design/actions/apply-visual-edit.ts +191 -6
- package/corpus/templates/design/actions/duplicate-design.ts +31 -25
- package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +5 -1
- package/corpus/templates/design/changelog/2026-07-10-duplicating-a-design-can-no-longer-produce-a-copy-with-missi.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-local-visual-edits-can-now-save-safe-leaf-text-class-and.md +6 -0
- package/corpus/templates/design/package.json +1 -1
- package/corpus/templates/design/shared/local-jsx-visual-edit.ts +388 -0
- package/corpus/templates/dispatch/package.json +1 -2
- package/corpus/templates/forms/actions/patch-form-fields.ts +82 -44
- package/corpus/templates/forms/changelog/2026-07-10-simultaneous-edits-to-different-form-fields-no-longer-overwr.md +6 -0
- package/corpus/templates/forms/package.json +1 -2
- package/corpus/templates/macros/package.json +1 -2
- package/corpus/templates/mail/app/components/email/EmailThread.tsx +3 -1
- package/corpus/templates/mail/changelog/2026-07-10-fixed-calendar-rsvp-buttons-in-emails-firing-duplicate-respo.md +6 -0
- package/corpus/templates/mail/package.json +1 -2
- package/corpus/templates/plan/actions/restore-plan-version.ts +126 -96
- package/corpus/templates/plan/changelog/2026-07-10-restoring-a-plan-version-can-no-longer-leave-a-plan-half-res.md +6 -0
- package/corpus/templates/plan/package.json +1 -2
- package/corpus/templates/plan/server/plans.ts +9 -2
- package/corpus/templates/slides/actions/list-decks.ts +28 -0
- package/corpus/templates/slides/app/components/deck/MermaidRenderer.tsx +41 -26
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +4 -8
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +2 -4
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +4 -8
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +5 -12
- package/corpus/templates/slides/app/components/editor/HistoryPanel.tsx +3 -6
- package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +3 -6
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +2 -5
- package/corpus/templates/slides/app/context/DeckContext.tsx +47 -4
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +11 -30
- package/corpus/templates/slides/app/pages/Index.tsx +2 -3
- package/corpus/templates/slides/app/root.tsx +0 -5
- package/corpus/templates/slides/changelog/2026-07-10-deck-lists-load-much-faster-and-no-longer-re-download-slide-.md +6 -0
- package/corpus/templates/slides/package.json +1 -2
- package/dist/a2a/auth-policy.d.ts +19 -0
- package/dist/a2a/auth-policy.d.ts.map +1 -1
- package/dist/a2a/auth-policy.js +32 -0
- package/dist/a2a/auth-policy.js.map +1 -1
- package/dist/a2a/client.d.ts +7 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +2 -1
- package/dist/a2a/client.js.map +1 -1
- package/dist/agent/durable-background.d.ts +8 -5
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +15 -8
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/production-agent.d.ts +6 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +63 -26
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +9 -4
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts +1 -0
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +6 -5
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/audit/actions/export-audit-events.d.ts +27 -0
- package/dist/audit/actions/export-audit-events.d.ts.map +1 -0
- package/dist/audit/actions/export-audit-events.js +144 -0
- package/dist/audit/actions/export-audit-events.js.map +1 -0
- package/dist/audit/store.d.ts +1 -0
- package/dist/audit/store.d.ts.map +1 -1
- package/dist/audit/store.js +8 -3
- package/dist/audit/store.js.map +1 -1
- package/dist/audit/types.d.ts +3 -0
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/audit/types.js.map +1 -1
- package/dist/chat-threads/store.d.ts +10 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +6 -0
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +1 -0
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/code-agent-runs.d.ts +12 -0
- package/dist/cli/code-agent-runs.d.ts.map +1 -1
- package/dist/cli/code-agent-runs.js +1 -0
- package/dist/cli/code-agent-runs.js.map +1 -1
- package/dist/cli/doctor.d.ts +83 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +277 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/index.js +50 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/info.js +3 -3
- package/dist/cli/info.js.map +1 -1
- package/dist/cli/package-lifecycle.d.ts +50 -0
- package/dist/cli/package-lifecycle.d.ts.map +1 -0
- package/dist/cli/package-lifecycle.js +560 -0
- package/dist/cli/package-lifecycle.js.map +1 -0
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +3 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +11 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +7 -4
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +83 -10
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.js +7 -3
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/chat/ChatHistoryList.d.ts +88 -0
- package/dist/client/chat/ChatHistoryList.d.ts.map +1 -0
- package/dist/client/chat/ChatHistoryList.js +83 -0
- package/dist/client/chat/ChatHistoryList.js.map +1 -0
- package/dist/client/chat/index.d.ts +1 -0
- package/dist/client/chat/index.d.ts.map +1 -1
- package/dist/client/chat/index.js +1 -0
- package/dist/client/chat/index.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +13 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +10 -2
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/code-agent-chat-adapter.d.ts +17 -1
- package/dist/client/code-agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/code-agent-chat-adapter.js +47 -3
- package/dist/client/code-agent-chat-adapter.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +11 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +5 -3
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +25 -2
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +96 -5
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +21 -1
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +5 -0
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/conversation/code-agent-transcript.d.ts +2 -0
- package/dist/client/conversation/code-agent-transcript.d.ts.map +1 -1
- package/dist/client/conversation/code-agent-transcript.js +3 -5
- package/dist/client/conversation/code-agent-transcript.js.map +1 -1
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +2 -1
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +9 -1
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/client/voice-provider-status.d.ts +10 -0
- package/dist/client/voice-provider-status.d.ts.map +1 -0
- package/dist/client/voice-provider-status.js +32 -0
- package/dist/client/voice-provider-status.js.map +1 -0
- package/dist/code-agents/transcript-normalizer.d.ts +29 -0
- package/dist/code-agents/transcript-normalizer.d.ts.map +1 -1
- package/dist/code-agents/transcript-normalizer.js +55 -0
- package/dist/code-agents/transcript-normalizer.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +13 -11
- package/dist/deploy/build.js.map +1 -1
- package/dist/guards/db-tool-scoping.d.ts +38 -0
- package/dist/guards/db-tool-scoping.d.ts.map +1 -0
- package/dist/guards/db-tool-scoping.js +114 -0
- package/dist/guards/db-tool-scoping.js.map +1 -0
- package/dist/guards/index.d.ts +23 -0
- package/dist/guards/index.d.ts.map +1 -0
- package/dist/guards/index.js +19 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/guards/no-drizzle-push.d.ts +14 -0
- package/dist/guards/no-drizzle-push.d.ts.map +1 -0
- package/dist/guards/no-drizzle-push.js +97 -0
- package/dist/guards/no-drizzle-push.js.map +1 -0
- package/dist/guards/no-env-credentials.d.ts +36 -0
- package/dist/guards/no-env-credentials.d.ts.map +1 -0
- package/dist/guards/no-env-credentials.js +204 -0
- package/dist/guards/no-env-credentials.js.map +1 -0
- package/dist/guards/no-env-mutation.d.ts +23 -0
- package/dist/guards/no-env-mutation.d.ts.map +1 -0
- package/dist/guards/no-env-mutation.js +90 -0
- package/dist/guards/no-env-mutation.js.map +1 -0
- package/dist/guards/no-localhost-fallback.d.ts +30 -0
- package/dist/guards/no-localhost-fallback.d.ts.map +1 -0
- package/dist/guards/no-localhost-fallback.js +105 -0
- package/dist/guards/no-localhost-fallback.js.map +1 -0
- package/dist/guards/no-unscoped-credentials.d.ts +28 -0
- package/dist/guards/no-unscoped-credentials.d.ts.map +1 -0
- package/dist/guards/no-unscoped-credentials.js +199 -0
- package/dist/guards/no-unscoped-credentials.js.map +1 -0
- package/dist/guards/no-unscoped-queries.d.ts +32 -0
- package/dist/guards/no-unscoped-queries.d.ts.map +1 -0
- package/dist/guards/no-unscoped-queries.js +720 -0
- package/dist/guards/no-unscoped-queries.js.map +1 -0
- package/dist/guards/scan-utils.d.ts +28 -0
- package/dist/guards/scan-utils.d.ts.map +1 -0
- package/dist/guards/scan-utils.js +92 -0
- package/dist/guards/scan-utils.js.map +1 -0
- package/dist/guards/types.d.ts +28 -0
- package/dist/guards/types.d.ts.map +1 -0
- package/dist/guards/types.js +11 -0
- package/dist/guards/types.js.map +1 -0
- package/dist/integrations/a2a-continuation-processor.d.ts.map +1 -1
- package/dist/integrations/a2a-continuation-processor.js +25 -5
- package/dist/integrations/a2a-continuation-processor.js.map +1 -1
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +55 -21
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +11 -0
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +5 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +5 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/hosted-model-experiment.d.ts +39 -0
- package/dist/observability/hosted-model-experiment.d.ts.map +1 -0
- package/dist/observability/hosted-model-experiment.js +90 -0
- package/dist/observability/hosted-model-experiment.js.map +1 -0
- package/dist/observability/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts.map +1 -1
- package/dist/observability/routes.js +16 -0
- package/dist/observability/routes.js.map +1 -1
- package/dist/observability/store.d.ts.map +1 -1
- package/dist/observability/store.js +4 -1
- package/dist/observability/store.js.map +1 -1
- package/dist/observability/traces.d.ts +6 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +28 -2
- package/dist/observability/traces.js.map +1 -1
- package/dist/org/accept-pending.d.ts.map +1 -1
- package/dist/org/accept-pending.js +9 -1
- package/dist/org/accept-pending.js.map +1 -1
- package/dist/org/migrations.d.ts +7 -2
- package/dist/org/migrations.d.ts.map +1 -1
- package/dist/org/migrations.js +41 -0
- package/dist/org/migrations.js.map +1 -1
- package/dist/package-lifecycle/index.d.ts +2 -0
- package/dist/package-lifecycle/index.d.ts.map +1 -0
- package/dist/package-lifecycle/index.js +2 -0
- package/dist/package-lifecycle/index.js.map +1 -0
- package/dist/package-lifecycle/manifest.d.ts +24 -0
- package/dist/package-lifecycle/manifest.d.ts.map +1 -0
- package/dist/package-lifecycle/manifest.js +81 -0
- package/dist/package-lifecycle/manifest.js.map +1 -0
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/custom-registry.d.ts +32 -1
- package/dist/provider-api/custom-registry.d.ts.map +1 -1
- package/dist/provider-api/custom-registry.js +41 -1
- package/dist/provider-api/custom-registry.js.map +1 -1
- package/dist/provider-api/index.d.ts +1 -1
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +1 -1
- package/dist/provider-api/index.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.d.ts.map +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.js +19 -1
- package/dist/scripts/agent-engines/list-agent-engines.js.map +1 -1
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +43 -3
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/scripts/chat/search-chats.d.ts +1 -1
- package/dist/scripts/chat/search-chats.d.ts.map +1 -1
- package/dist/scripts/chat/search-chats.js +11 -8
- package/dist/scripts/chat/search-chats.js.map +1 -1
- package/dist/secrets/register-framework-secrets.js +1 -1
- package/dist/secrets/register-framework-secrets.js.map +1 -1
- package/dist/secrets/storage.d.ts.map +1 -1
- package/dist/secrets/storage.js +45 -27
- package/dist/secrets/storage.js.map +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +4 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +11 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +74 -19
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/core-routes-plugin.d.ts +3 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +36 -12
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/csrf.js +18 -5
- package/dist/server/csrf.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +34 -0
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/google-realtime-session.d.ts.map +1 -1
- package/dist/server/google-realtime-session.js +2 -34
- package/dist/server/google-realtime-session.js.map +1 -1
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +24 -2
- package/dist/server/poll.js.map +1 -1
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +64 -21
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/request-origin.d.ts +10 -0
- package/dist/server/request-origin.d.ts.map +1 -0
- package/dist/server/request-origin.js +60 -0
- package/dist/server/request-origin.js.map +1 -0
- package/dist/server/transcribe-voice.d.ts.map +1 -1
- package/dist/server/transcribe-voice.js +2 -48
- package/dist/server/transcribe-voice.js.map +1 -1
- package/dist/server/voice-providers-status.d.ts.map +1 -1
- package/dist/server/voice-providers-status.js +2 -3
- package/dist/server/voice-providers-status.js.map +1 -1
- package/dist/shared/cache-control.d.ts +4 -6
- package/dist/shared/cache-control.d.ts.map +1 -1
- package/dist/shared/cache-control.js +2 -7
- package/dist/shared/cache-control.js.map +1 -1
- package/dist/styles/agent-native.css +1 -0
- package/dist/styles/chat-history-list.css +313 -0
- package/dist/templates/default/package.json +2 -2
- package/dist/templates/headless/package.json +0 -1
- package/dist/templates/workspace-core/.agents/skills/audit-log/SKILL.md +3 -0
- package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -1
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +8 -4
- package/dist/templates/workspace-core/package.json +0 -1
- package/dist/templates/workspace-root/package.json +0 -1
- package/dist/triggers/actions.d.ts.map +1 -1
- package/dist/triggers/actions.js +8 -3
- package/dist/triggers/actions.js.map +1 -1
- package/dist/triggers/types.d.ts +7 -1
- package/dist/triggers/types.d.ts.map +1 -1
- package/dist/triggers/types.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +1 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/audit-log.mdx +2 -1
- package/docs/content/automations.mdx +7 -7
- package/docs/content/creating-templates.mdx +1 -1
- package/docs/content/internationalization.mdx +2 -1
- package/docs/content/locales/ar-SA/audit-log.mdx +2 -1
- package/docs/content/locales/ar-SA/automations.mdx +7 -7
- package/docs/content/locales/ar-SA/getting-started.mdx +7 -1
- package/docs/content/locales/ar-SA/internationalization.mdx +1 -1
- package/docs/content/locales/ar-SA/package-lifecycle.mdx +19 -0
- package/docs/content/locales/ar-SA/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/ar-SA/security.mdx +8 -0
- package/docs/content/locales/de-DE/audit-log.mdx +2 -1
- package/docs/content/locales/de-DE/automations.mdx +7 -7
- package/docs/content/locales/de-DE/getting-started.mdx +7 -1
- package/docs/content/locales/de-DE/internationalization.mdx +1 -1
- package/docs/content/locales/de-DE/package-lifecycle.mdx +22 -0
- package/docs/content/locales/de-DE/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/de-DE/security.mdx +8 -0
- package/docs/content/locales/es-ES/audit-log.mdx +2 -1
- package/docs/content/locales/es-ES/automations.mdx +7 -7
- package/docs/content/locales/es-ES/getting-started.mdx +7 -1
- package/docs/content/locales/es-ES/internationalization.mdx +1 -1
- package/docs/content/locales/es-ES/package-lifecycle.mdx +22 -0
- package/docs/content/locales/es-ES/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/es-ES/security.mdx +8 -0
- package/docs/content/locales/fr-FR/audit-log.mdx +2 -1
- package/docs/content/locales/fr-FR/automations.mdx +7 -7
- package/docs/content/locales/fr-FR/getting-started.mdx +7 -1
- package/docs/content/locales/fr-FR/internationalization.mdx +1 -1
- package/docs/content/locales/fr-FR/package-lifecycle.mdx +21 -0
- package/docs/content/locales/fr-FR/sandbox-adapters.mdx +19 -8
- package/docs/content/locales/fr-FR/security.mdx +8 -0
- package/docs/content/locales/hi-IN/audit-log.mdx +2 -1
- package/docs/content/locales/hi-IN/automations.mdx +7 -7
- package/docs/content/locales/hi-IN/getting-started.mdx +7 -1
- package/docs/content/locales/hi-IN/internationalization.mdx +1 -1
- package/docs/content/locales/hi-IN/package-lifecycle.mdx +20 -0
- package/docs/content/locales/hi-IN/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/hi-IN/security.mdx +8 -0
- package/docs/content/locales/ja-JP/audit-log.mdx +2 -1
- package/docs/content/locales/ja-JP/automations.mdx +7 -7
- package/docs/content/locales/ja-JP/getting-started.mdx +7 -1
- package/docs/content/locales/ja-JP/internationalization.mdx +1 -1
- package/docs/content/locales/ja-JP/package-lifecycle.mdx +21 -0
- package/docs/content/locales/ja-JP/sandbox-adapters.mdx +17 -6
- package/docs/content/locales/ja-JP/security.mdx +8 -0
- package/docs/content/locales/ko-KR/audit-log.mdx +2 -1
- package/docs/content/locales/ko-KR/automations.mdx +7 -7
- package/docs/content/locales/ko-KR/getting-started.mdx +7 -1
- package/docs/content/locales/ko-KR/internationalization.mdx +1 -1
- package/docs/content/locales/ko-KR/package-lifecycle.mdx +20 -0
- package/docs/content/locales/ko-KR/sandbox-adapters.mdx +17 -6
- package/docs/content/locales/ko-KR/security.mdx +8 -0
- package/docs/content/locales/pt-BR/audit-log.mdx +2 -1
- package/docs/content/locales/pt-BR/automations.mdx +7 -7
- package/docs/content/locales/pt-BR/getting-started.mdx +7 -1
- package/docs/content/locales/pt-BR/internationalization.mdx +1 -1
- package/docs/content/locales/pt-BR/package-lifecycle.mdx +21 -0
- package/docs/content/locales/pt-BR/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/pt-BR/security.mdx +8 -0
- package/docs/content/locales/zh-CN/audit-log.mdx +2 -1
- package/docs/content/locales/zh-CN/automations.mdx +7 -7
- package/docs/content/locales/zh-CN/getting-started.mdx +6 -4
- package/docs/content/locales/zh-CN/internationalization.mdx +1 -1
- package/docs/content/locales/zh-CN/package-lifecycle.mdx +19 -0
- package/docs/content/locales/zh-CN/sandbox-adapters.mdx +17 -6
- package/docs/content/locales/zh-CN/security.mdx +8 -0
- package/docs/content/locales/zh-TW/audit-log.mdx +2 -1
- package/docs/content/locales/zh-TW/automations.mdx +7 -7
- package/docs/content/locales/zh-TW/getting-started.mdx +6 -4
- package/docs/content/locales/zh-TW/internationalization.mdx +1 -1
- package/docs/content/locales/zh-TW/package-lifecycle.mdx +19 -0
- package/docs/content/locales/zh-TW/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/zh-TW/security.mdx +8 -0
- package/docs/content/package-lifecycle.mdx +51 -0
- package/docs/content/sandbox-adapters.mdx +16 -5
- package/package.json +12 -3
- package/src/templates/default/package.json +2 -2
- package/src/templates/headless/package.json +0 -1
- package/src/templates/workspace-core/.agents/skills/audit-log/SKILL.md +3 -0
- package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -1
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +8 -4
- package/src/templates/workspace-core/package.json +0 -1
- package/src/templates/workspace-root/package.json +0 -1
- package/corpus/templates/slides/app/components/ui/toast.tsx +0 -1
- package/corpus/templates/slides/app/components/ui/toaster.tsx +0 -1
- package/corpus/templates/slides/app/hooks/use-toast.ts +0 -1
|
@@ -38,6 +38,13 @@ export default defineAction({
|
|
|
38
38
|
run: async ({ planId, versionId }) => {
|
|
39
39
|
const access = await assertPlanEditor(planId);
|
|
40
40
|
const ownerEmail = access.resource.ownerEmail as string;
|
|
41
|
+
// Optimistic-concurrency fence, mirroring the versionAtLoad/updatedAt
|
|
42
|
+
// pattern in update-visual-plan.ts: captured before any restore work
|
|
43
|
+
// starts, then used to guard the leading `plans` UPDATE below so a
|
|
44
|
+
// restore racing a concurrent edit fails cleanly instead of silently
|
|
45
|
+
// clobbering it or interleaving writes.
|
|
46
|
+
const versionAtLoad = (access.resource as typeof schema.plans.$inferSelect)
|
|
47
|
+
.updatedAt;
|
|
41
48
|
const db = getDb();
|
|
42
49
|
|
|
43
50
|
const [version] = await db
|
|
@@ -63,114 +70,137 @@ export default defineAction({
|
|
|
63
70
|
const snapshot = parsePlanVersionSnapshot(version.snapshotJson);
|
|
64
71
|
const now = nowIso();
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const anchored = await db
|
|
93
|
-
.select({
|
|
94
|
-
id: schema.planComments.id,
|
|
95
|
-
sectionId: schema.planComments.sectionId,
|
|
73
|
+
// The destructive part of the restore (plans update, comment sectionId
|
|
74
|
+
// nulling, section delete/re-insert, comment re-anchor, and the restore
|
|
75
|
+
// event) runs as a single atomic transaction. Without this, a
|
|
76
|
+
// mid-sequence failure could leave the plan with zero sections and
|
|
77
|
+
// permanently detached comments. better-sqlite3's normally-sync-only
|
|
78
|
+
// transaction() is patched to support async callbacks in
|
|
79
|
+
// packages/core/src/db/create-get-db.ts (patchBetterSqliteTransactions,
|
|
80
|
+
// wired into createGetDb for local sqlite urls), so this is safe on the
|
|
81
|
+
// local driver as well as libsql/Postgres.
|
|
82
|
+
await db.transaction(async (tx) => {
|
|
83
|
+
const updatedRows = await tx
|
|
84
|
+
.update(schema.plans)
|
|
85
|
+
.set({
|
|
86
|
+
title: snapshot.plan.title,
|
|
87
|
+
brief: snapshot.plan.brief,
|
|
88
|
+
status: snapshot.plan.status,
|
|
89
|
+
source: snapshot.plan.source,
|
|
90
|
+
repoPath: snapshot.plan.repoPath ?? null,
|
|
91
|
+
currentFocus: snapshot.plan.currentFocus ?? null,
|
|
92
|
+
html: snapshot.plan.html ?? null,
|
|
93
|
+
markdown: snapshot.plan.markdown ?? null,
|
|
94
|
+
content: snapshot.plan.content
|
|
95
|
+
? serializePlanContent(snapshot.plan.content)
|
|
96
|
+
: null,
|
|
97
|
+
approvedAt: snapshot.plan.approvedAt ?? null,
|
|
98
|
+
updatedAt: now,
|
|
96
99
|
})
|
|
97
|
-
.from(schema.planComments)
|
|
98
100
|
.where(
|
|
99
101
|
and(
|
|
100
|
-
eq(schema.
|
|
101
|
-
|
|
102
|
-
schema.planComments.sectionId,
|
|
103
|
-
Array.from(survivingSectionIds),
|
|
104
|
-
),
|
|
102
|
+
eq(schema.plans.id, planId),
|
|
103
|
+
eq(schema.plans.updatedAt, versionAtLoad),
|
|
105
104
|
),
|
|
105
|
+
)
|
|
106
|
+
.returning({ id: schema.plans.id });
|
|
107
|
+
|
|
108
|
+
if (updatedRows.length === 0) {
|
|
109
|
+
throw new Error(
|
|
110
|
+
"This plan was updated by someone else while the restore was being prepared. Reload the plan and try restoring again.",
|
|
106
111
|
);
|
|
107
|
-
for (const row of anchored) {
|
|
108
|
-
if (row.sectionId) commentAnchorMap.set(row.id, row.sectionId);
|
|
109
112
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
snapshot.sections.map((section, index) => ({
|
|
125
|
-
id: section.id,
|
|
126
|
-
planId,
|
|
127
|
-
type: section.type,
|
|
128
|
-
title: section.title,
|
|
129
|
-
body: section.body,
|
|
130
|
-
html: section.html ?? null,
|
|
131
|
-
order: section.order ?? index,
|
|
132
|
-
createdBy: section.createdBy,
|
|
133
|
-
createdAt: section.createdAt || now,
|
|
134
|
-
updatedAt: section.updatedAt || now,
|
|
135
|
-
})),
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Re-anchor comments that were pointing to sections present in the snapshot.
|
|
140
|
-
// These sections now exist again, so the FK is satisfied and the comment
|
|
141
|
-
// threads remain navigable. Comments on sections that did not survive stay
|
|
142
|
-
// detached (sectionId = null).
|
|
143
|
-
if (commentAnchorMap.size > 0) {
|
|
144
|
-
const anchorGroups = new Map<string, string[]>(); // sectionId → commentIds
|
|
145
|
-
for (const [commentId, sectionId] of commentAnchorMap) {
|
|
146
|
-
const ids = anchorGroups.get(sectionId) ?? [];
|
|
147
|
-
ids.push(commentId);
|
|
148
|
-
anchorGroups.set(sectionId, ids);
|
|
149
|
-
}
|
|
150
|
-
for (const [sectionId, commentIds] of anchorGroups) {
|
|
151
|
-
await db
|
|
152
|
-
.update(schema.planComments)
|
|
153
|
-
.set({ sectionId, updatedAt: now })
|
|
113
|
+
|
|
114
|
+
// Preserve comment anchors for sections whose ids survive in the snapshot.
|
|
115
|
+
// Strategy: capture comment→sectionId pairs for surviving sections first,
|
|
116
|
+
// then null ALL sectionIds (required to satisfy FK before section deletion),
|
|
117
|
+
// delete and re-insert sections, then re-anchor the surviving comments.
|
|
118
|
+
const survivingSectionIds = new Set(snapshot.sections.map((s) => s.id));
|
|
119
|
+
const commentAnchorMap = new Map<string, string>(); // commentId → sectionId
|
|
120
|
+
if (survivingSectionIds.size > 0) {
|
|
121
|
+
const anchored = await tx
|
|
122
|
+
.select({
|
|
123
|
+
id: schema.planComments.id,
|
|
124
|
+
sectionId: schema.planComments.sectionId,
|
|
125
|
+
})
|
|
126
|
+
.from(schema.planComments)
|
|
154
127
|
.where(
|
|
155
128
|
and(
|
|
156
129
|
eq(schema.planComments.planId, planId),
|
|
157
|
-
inArray(
|
|
130
|
+
inArray(
|
|
131
|
+
schema.planComments.sectionId,
|
|
132
|
+
Array.from(survivingSectionIds),
|
|
133
|
+
),
|
|
158
134
|
),
|
|
159
135
|
);
|
|
136
|
+
for (const row of anchored) {
|
|
137
|
+
if (row.sectionId) commentAnchorMap.set(row.id, row.sectionId);
|
|
138
|
+
}
|
|
160
139
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
140
|
+
|
|
141
|
+
// Null ALL comment anchors so the section delete below doesn't violate FK.
|
|
142
|
+
await tx
|
|
143
|
+
.update(schema.planComments)
|
|
144
|
+
.set({ sectionId: null, updatedAt: now })
|
|
145
|
+
.where(eq(schema.planComments.planId, planId));
|
|
146
|
+
|
|
147
|
+
await tx
|
|
148
|
+
.delete(schema.planSections)
|
|
149
|
+
.where(eq(schema.planSections.planId, planId));
|
|
150
|
+
|
|
151
|
+
if (snapshot.sections.length > 0) {
|
|
152
|
+
await tx.insert(schema.planSections).values(
|
|
153
|
+
snapshot.sections.map((section, index) => ({
|
|
154
|
+
id: section.id,
|
|
155
|
+
planId,
|
|
156
|
+
type: section.type,
|
|
157
|
+
title: section.title,
|
|
158
|
+
body: section.body,
|
|
159
|
+
html: section.html ?? null,
|
|
160
|
+
order: section.order ?? index,
|
|
161
|
+
createdBy: section.createdBy,
|
|
162
|
+
createdAt: section.createdAt || now,
|
|
163
|
+
updatedAt: section.updatedAt || now,
|
|
164
|
+
})),
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Re-anchor comments that were pointing to sections present in the snapshot.
|
|
169
|
+
// These sections now exist again, so the FK is satisfied and the comment
|
|
170
|
+
// threads remain navigable. Comments on sections that did not survive stay
|
|
171
|
+
// detached (sectionId = null).
|
|
172
|
+
if (commentAnchorMap.size > 0) {
|
|
173
|
+
const anchorGroups = new Map<string, string[]>(); // sectionId → commentIds
|
|
174
|
+
for (const [commentId, sectionId] of commentAnchorMap) {
|
|
175
|
+
const ids = anchorGroups.get(sectionId) ?? [];
|
|
176
|
+
ids.push(commentId);
|
|
177
|
+
anchorGroups.set(sectionId, ids);
|
|
178
|
+
}
|
|
179
|
+
for (const [sectionId, commentIds] of anchorGroups) {
|
|
180
|
+
await tx
|
|
181
|
+
.update(schema.planComments)
|
|
182
|
+
.set({ sectionId, updatedAt: now })
|
|
183
|
+
.where(
|
|
184
|
+
and(
|
|
185
|
+
eq(schema.planComments.planId, planId),
|
|
186
|
+
inArray(schema.planComments.id, commentIds),
|
|
187
|
+
),
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
await tx.insert(schema.planEvents).values({
|
|
193
|
+
id: newId("evt"),
|
|
194
|
+
planId,
|
|
195
|
+
type: "plan.version.restored",
|
|
196
|
+
message: "Restored plan from version history.",
|
|
197
|
+
payload: JSON.stringify({
|
|
198
|
+
restoredVersionId: version.id,
|
|
199
|
+
restoredVersionCreatedAt: version.createdAt,
|
|
200
|
+
}),
|
|
201
|
+
createdBy: "agent",
|
|
202
|
+
createdAt: now,
|
|
203
|
+
});
|
|
174
204
|
});
|
|
175
205
|
|
|
176
206
|
const bundle = await loadPlanBundle(planId);
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"diff": "9.0.0",
|
|
29
29
|
"drizzle-orm": "^0.45.2",
|
|
30
30
|
"gray-matter": "^4.0.3",
|
|
31
|
-
"h3": "
|
|
31
|
+
"h3": "catalog:",
|
|
32
32
|
"html2canvas": "^1.4.1",
|
|
33
33
|
"isbot": "^5",
|
|
34
34
|
"jszip": "^3.10.1",
|
|
@@ -102,7 +102,6 @@
|
|
|
102
102
|
"tailwind-merge": "^3.5.0",
|
|
103
103
|
"tailwindcss": "catalog:",
|
|
104
104
|
"tsx": "^4.20.3",
|
|
105
|
-
"typescript": "catalog:",
|
|
106
105
|
"typescript-7": "catalog:",
|
|
107
106
|
"vaul": "^1.1.2",
|
|
108
107
|
"vite": "catalog:",
|
|
@@ -434,6 +434,11 @@ export function buildUpdatedPlanCommentRows(input: {
|
|
|
434
434
|
return rows;
|
|
435
435
|
}
|
|
436
436
|
|
|
437
|
+
// Chunk size for batched comment inserts. Keeps a single INSERT well under
|
|
438
|
+
// SQLite's default 999-bound-parameter limit and Postgres' practical
|
|
439
|
+
// statement-size limits even for a wide comment row shape.
|
|
440
|
+
const PLAN_COMMENT_INSERT_CHUNK_SIZE = 200;
|
|
441
|
+
|
|
437
442
|
export async function insertInitialPlanComments(input: {
|
|
438
443
|
planId: string;
|
|
439
444
|
comments: PlanCommentInput[];
|
|
@@ -442,9 +447,11 @@ export async function insertInitialPlanComments(input: {
|
|
|
442
447
|
now: string;
|
|
443
448
|
}) {
|
|
444
449
|
const rows = buildInitialPlanCommentRows(input);
|
|
450
|
+
if (rows.length === 0) return;
|
|
445
451
|
const db = getDb();
|
|
446
|
-
for (
|
|
447
|
-
|
|
452
|
+
for (let i = 0; i < rows.length; i += PLAN_COMMENT_INSERT_CHUNK_SIZE) {
|
|
453
|
+
const chunk = rows.slice(i, i + PLAN_COMMENT_INSERT_CHUNK_SIZE);
|
|
454
|
+
await db.insert(schema.planComments).values(chunk);
|
|
448
455
|
}
|
|
449
456
|
}
|
|
450
457
|
|
|
@@ -23,6 +23,14 @@ export default defineAction({
|
|
|
23
23
|
.enum(["true", "false"])
|
|
24
24
|
.optional()
|
|
25
25
|
.describe("Set to 'true' for full frontend deck payloads"),
|
|
26
|
+
light: z
|
|
27
|
+
.enum(["true", "false"])
|
|
28
|
+
.optional()
|
|
29
|
+
.describe(
|
|
30
|
+
"Set to 'true' for a minimal id/title/updatedAt/visibility listing " +
|
|
31
|
+
"used for cheap add/remove diffing (e.g. background polling). " +
|
|
32
|
+
"Never reads the deck body — no slides, no slideCount.",
|
|
33
|
+
),
|
|
26
34
|
createdBy: z
|
|
27
35
|
.enum(["all", "me"])
|
|
28
36
|
.optional()
|
|
@@ -56,6 +64,26 @@ export default defineAction({
|
|
|
56
64
|
args.createdBy === "me" && ownerEmail
|
|
57
65
|
? and(visibleDecks, eq(schema.decks.ownerEmail, ownerEmail))
|
|
58
66
|
: visibleDecks;
|
|
67
|
+
|
|
68
|
+
if (args.light === "true") {
|
|
69
|
+
// Column-projected listing for cheap add/remove diffing (the client's
|
|
70
|
+
// background poll and SSE-reconnect resync). The `data` column holds
|
|
71
|
+
// each deck's entire slide JSON and can be large — never select it
|
|
72
|
+
// here. Callers that need slide content use `includeSlides: "true"` or
|
|
73
|
+
// fetch the specific deck via `get-deck`.
|
|
74
|
+
const rows = await db
|
|
75
|
+
.select({
|
|
76
|
+
id: schema.decks.id,
|
|
77
|
+
title: schema.decks.title,
|
|
78
|
+
updatedAt: schema.decks.updatedAt,
|
|
79
|
+
visibility: schema.decks.visibility,
|
|
80
|
+
})
|
|
81
|
+
.from(schema.decks)
|
|
82
|
+
.where(where)
|
|
83
|
+
.orderBy(desc(schema.decks.updatedAt));
|
|
84
|
+
return { count: rows.length, decks: rows };
|
|
85
|
+
}
|
|
86
|
+
|
|
59
87
|
const rows = await db
|
|
60
88
|
.select()
|
|
61
89
|
.from(schema.decks)
|
|
@@ -1,32 +1,48 @@
|
|
|
1
1
|
import DOMPurify from "dompurify";
|
|
2
|
-
import mermaid from "mermaid";
|
|
3
2
|
import { useEffect, useRef, useState } from "react";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
// `mermaid` pulls in d3 and its layout engine, which is a heavy chunk that
|
|
5
|
+
// every deck view would otherwise ship even when no slide has a diagram.
|
|
6
|
+
// Load it lazily and only once, the first time a mermaid slide actually
|
|
7
|
+
// renders — mirrors the shiki lazy-load pattern in
|
|
8
|
+
// packages/core/src/client/blocks/library/HighlightedCode.tsx.
|
|
9
|
+
type MermaidModule = typeof import("mermaid");
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
let mermaidLoader: Promise<MermaidModule["default"]> | null = null;
|
|
12
|
+
function loadMermaid(): Promise<MermaidModule["default"]> {
|
|
13
|
+
if (!mermaidLoader) {
|
|
14
|
+
mermaidLoader = import("mermaid")
|
|
15
|
+
.then((mod) => {
|
|
16
|
+
const mermaid = mod.default;
|
|
17
|
+
mermaid.initialize({
|
|
18
|
+
startOnLoad: false,
|
|
19
|
+
securityLevel: "strict",
|
|
20
|
+
theme: "dark",
|
|
21
|
+
themeVariables: {
|
|
22
|
+
darkMode: true,
|
|
23
|
+
background: "transparent",
|
|
24
|
+
primaryColor: "#1a1a2e",
|
|
25
|
+
primaryTextColor: "#e0e0e0",
|
|
26
|
+
primaryBorderColor: "#00E5FF",
|
|
27
|
+
lineColor: "#00E5FF",
|
|
28
|
+
secondaryColor: "#16213e",
|
|
29
|
+
tertiaryColor: "#0f3460",
|
|
30
|
+
fontFamily: "Poppins, sans-serif",
|
|
31
|
+
},
|
|
32
|
+
flowchart: { curve: "basis" },
|
|
33
|
+
});
|
|
34
|
+
return mermaid;
|
|
35
|
+
})
|
|
36
|
+
.catch((error) => {
|
|
37
|
+
mermaidLoader = null;
|
|
38
|
+
throw error;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return mermaidLoader;
|
|
28
42
|
}
|
|
29
43
|
|
|
44
|
+
let idCounter = 0;
|
|
45
|
+
|
|
30
46
|
interface MermaidRendererProps {
|
|
31
47
|
definition: string;
|
|
32
48
|
className?: string;
|
|
@@ -42,13 +58,12 @@ export function MermaidRenderer({
|
|
|
42
58
|
|
|
43
59
|
useEffect(() => {
|
|
44
60
|
if (!definition.trim()) return;
|
|
45
|
-
initMermaid();
|
|
46
61
|
|
|
47
62
|
let cancelled = false;
|
|
48
63
|
const id = `mermaid-${++idCounter}`;
|
|
49
64
|
|
|
50
|
-
|
|
51
|
-
.render(id, definition.trim())
|
|
65
|
+
loadMermaid()
|
|
66
|
+
.then((mermaid) => mermaid.render(id, definition.trim()))
|
|
52
67
|
.then(({ svg: renderedSvg }) => {
|
|
53
68
|
if (cancelled) return;
|
|
54
69
|
// Mermaid 11.x runs DOMPurify internally with `securityLevel:"strict"`,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
IconExternalLink,
|
|
21
21
|
} from "@tabler/icons-react";
|
|
22
22
|
import { useState, useCallback, useEffect, useRef, useMemo } from "react";
|
|
23
|
+
import { toast } from "sonner";
|
|
23
24
|
|
|
24
25
|
import { Button } from "@/components/ui/button";
|
|
25
26
|
import {
|
|
@@ -33,7 +34,6 @@ import { Input } from "@/components/ui/input";
|
|
|
33
34
|
import { Label } from "@/components/ui/label";
|
|
34
35
|
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
35
36
|
import { Textarea } from "@/components/ui/textarea";
|
|
36
|
-
import { toast } from "@/hooks/use-toast";
|
|
37
37
|
|
|
38
38
|
import {
|
|
39
39
|
MAX_BUILDER_INDEX_UPLOAD_BYTES,
|
|
@@ -305,12 +305,9 @@ export function DesignSystemSetup({
|
|
|
305
305
|
customInstructions,
|
|
306
306
|
});
|
|
307
307
|
onComplete();
|
|
308
|
-
toast(
|
|
308
|
+
toast.success(t("designSystemSetup.updated"));
|
|
309
309
|
} catch {
|
|
310
|
-
toast(
|
|
311
|
-
title: t("designSystemSetup.updateFailed"),
|
|
312
|
-
variant: "destructive",
|
|
313
|
-
});
|
|
310
|
+
toast.error(t("designSystemSetup.updateFailed"));
|
|
314
311
|
} finally {
|
|
315
312
|
setGenerating(false);
|
|
316
313
|
}
|
|
@@ -446,8 +443,7 @@ export function DesignSystemSetup({
|
|
|
446
443
|
|
|
447
444
|
openAgentSidebar();
|
|
448
445
|
sendToAgentChat({ message: parts.join("\n"), submit: true });
|
|
449
|
-
toast({
|
|
450
|
-
title: t("designSystemSetup.generationStarted"),
|
|
446
|
+
toast(t("designSystemSetup.generationStarted"), {
|
|
451
447
|
description: t("designSystemSetup.generationStartedDescription"),
|
|
452
448
|
});
|
|
453
449
|
onComplete();
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
import { useState, useRef, useEffect } from "react";
|
|
25
25
|
import { useCallback } from "react";
|
|
26
26
|
import { createPortal } from "react-dom";
|
|
27
|
+
import { toast } from "sonner";
|
|
27
28
|
|
|
28
29
|
import SlideRenderer from "@/components/deck/SlideRenderer";
|
|
29
30
|
import { GoogleDocImportHint } from "@/components/editor/GoogleDocImportHint";
|
|
@@ -35,7 +36,6 @@ import {
|
|
|
35
36
|
} from "@/components/ui/tooltip";
|
|
36
37
|
import type { Slide } from "@/context/DeckContext";
|
|
37
38
|
import { useAgentGenerating } from "@/hooks/use-agent-generating";
|
|
38
|
-
import { toast } from "@/hooks/use-toast";
|
|
39
39
|
import type { AspectRatio } from "@/lib/aspect-ratios";
|
|
40
40
|
|
|
41
41
|
interface EditorSidebarProps {
|
|
@@ -402,13 +402,11 @@ function AddSlidePopover({
|
|
|
402
402
|
}
|
|
403
403
|
uploaded = (await res.json()) as UploadedFile[];
|
|
404
404
|
} catch (error) {
|
|
405
|
-
toast({
|
|
406
|
-
title: t("editorSidebar.uploadFailed"),
|
|
405
|
+
toast.error(t("editorSidebar.uploadFailed"), {
|
|
407
406
|
description:
|
|
408
407
|
error instanceof Error
|
|
409
408
|
? error.message
|
|
410
409
|
: t("editorSidebar.uploadAttachedFileFailed"),
|
|
411
|
-
variant: "destructive",
|
|
412
410
|
});
|
|
413
411
|
return;
|
|
414
412
|
}
|
|
@@ -42,6 +42,7 @@ import { useTheme } from "next-themes";
|
|
|
42
42
|
import { useState, useRef, useEffect } from "react";
|
|
43
43
|
import { createPortal } from "react-dom";
|
|
44
44
|
import { Link } from "react-router";
|
|
45
|
+
import { toast } from "sonner";
|
|
45
46
|
|
|
46
47
|
import {
|
|
47
48
|
DropdownMenu,
|
|
@@ -58,7 +59,6 @@ import {
|
|
|
58
59
|
import { SaveStatusIndicator } from "@/components/visual-editor";
|
|
59
60
|
import type { Deck, Slide, SlideLayout } from "@/context/DeckContext";
|
|
60
61
|
import { defaultSlideContent, useSaveState } from "@/context/DeckContext";
|
|
61
|
-
import { toast } from "@/hooks/use-toast";
|
|
62
62
|
import {
|
|
63
63
|
ASPECT_RATIO_VALUES,
|
|
64
64
|
type AspectRatio,
|
|
@@ -321,8 +321,7 @@ export default function EditorToolbar({
|
|
|
321
321
|
const file = e.target.files?.[0];
|
|
322
322
|
if (!file) return;
|
|
323
323
|
setImporting(true);
|
|
324
|
-
toast({
|
|
325
|
-
title: t("editorToolbar.importingFile"),
|
|
324
|
+
toast(t("editorToolbar.importingFile"), {
|
|
326
325
|
description: t("editorToolbar.readingFile", { fileName: file.name }),
|
|
327
326
|
});
|
|
328
327
|
const formData = new FormData();
|
|
@@ -369,8 +368,7 @@ export default function EditorToolbar({
|
|
|
369
368
|
if (!importRes.ok || importData?.error) {
|
|
370
369
|
throw new Error(importData?.error || t("editorToolbar.importFailed"));
|
|
371
370
|
}
|
|
372
|
-
toast({
|
|
373
|
-
title: t("editorToolbar.importComplete"),
|
|
371
|
+
toast.success(t("editorToolbar.importComplete"), {
|
|
374
372
|
description:
|
|
375
373
|
typeof importData.slideCount === "number"
|
|
376
374
|
? t("editorToolbar.importCompleteSlides", {
|
|
@@ -383,13 +381,11 @@ export default function EditorToolbar({
|
|
|
383
381
|
});
|
|
384
382
|
} catch (err) {
|
|
385
383
|
console.error("Import failed:", err);
|
|
386
|
-
toast({
|
|
387
|
-
title: t("editorToolbar.importFailed"),
|
|
384
|
+
toast.error(t("editorToolbar.importFailed"), {
|
|
388
385
|
description:
|
|
389
386
|
err instanceof Error
|
|
390
387
|
? err.message
|
|
391
388
|
: t("editorToolbar.importFailedDescription"),
|
|
392
|
-
variant: "destructive",
|
|
393
389
|
});
|
|
394
390
|
} finally {
|
|
395
391
|
setImporting(false);
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
IconShare2,
|
|
8
8
|
IconBrandGoogle,
|
|
9
9
|
} from "@tabler/icons-react";
|
|
10
|
+
import { toast } from "sonner";
|
|
10
11
|
|
|
11
12
|
import {
|
|
12
13
|
DropdownMenu,
|
|
@@ -16,7 +17,6 @@ import {
|
|
|
16
17
|
DropdownMenuSeparator,
|
|
17
18
|
DropdownMenuTrigger,
|
|
18
19
|
} from "@/components/ui/dropdown-menu";
|
|
19
|
-
import { toast } from "@/hooks/use-toast";
|
|
20
20
|
|
|
21
21
|
interface ExportMenuProps {
|
|
22
22
|
deckId: string;
|
|
@@ -73,13 +73,11 @@ export function ExportMenu({
|
|
|
73
73
|
await onExportPptx();
|
|
74
74
|
} catch (err) {
|
|
75
75
|
console.error("Export failed:", err);
|
|
76
|
-
toast({
|
|
77
|
-
title: t("editorExport.exportFailed"),
|
|
76
|
+
toast.error(t("editorExport.exportFailed"), {
|
|
78
77
|
description:
|
|
79
78
|
err instanceof Error
|
|
80
79
|
? err.message
|
|
81
80
|
: t("editorExport.exportPptxError"),
|
|
82
|
-
variant: "destructive",
|
|
83
81
|
});
|
|
84
82
|
}
|
|
85
83
|
};
|
|
@@ -87,19 +85,16 @@ export function ExportMenu({
|
|
|
87
85
|
const handleExportGoogleSlides = async () => {
|
|
88
86
|
try {
|
|
89
87
|
await onExportPptx();
|
|
90
|
-
toast({
|
|
91
|
-
title: t("editorExport.googleSlidesDownloaded"),
|
|
88
|
+
toast.success(t("editorExport.googleSlidesDownloaded"), {
|
|
92
89
|
description: t("editorExport.googleSlidesImportHint"),
|
|
93
90
|
});
|
|
94
91
|
} catch (err) {
|
|
95
92
|
console.error("Export failed:", err);
|
|
96
|
-
toast({
|
|
97
|
-
title: t("editorExport.exportFailed"),
|
|
93
|
+
toast.error(t("editorExport.exportFailed"), {
|
|
98
94
|
description:
|
|
99
95
|
err instanceof Error
|
|
100
96
|
? err.message
|
|
101
97
|
: t("editorExport.exportGoogleSlidesError"),
|
|
102
|
-
variant: "destructive",
|
|
103
98
|
});
|
|
104
99
|
}
|
|
105
100
|
};
|
|
@@ -124,13 +119,11 @@ export function ExportMenu({
|
|
|
124
119
|
triggerBlobDownload(blob, filename);
|
|
125
120
|
} catch (err) {
|
|
126
121
|
console.error("Export failed:", err);
|
|
127
|
-
toast({
|
|
128
|
-
title: t("editorExport.exportFailed"),
|
|
122
|
+
toast.error(t("editorExport.exportFailed"), {
|
|
129
123
|
description:
|
|
130
124
|
err instanceof Error
|
|
131
125
|
? err.message
|
|
132
126
|
: t("editorExport.exportHtmlError"),
|
|
133
|
-
variant: "destructive",
|
|
134
127
|
});
|
|
135
128
|
}
|
|
136
129
|
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
IconRestore,
|
|
7
7
|
} from "@tabler/icons-react";
|
|
8
8
|
import { useMemo, useState, type RefObject } from "react";
|
|
9
|
+
import { toast } from "sonner";
|
|
9
10
|
|
|
10
11
|
import SlideRenderer from "@/components/deck/SlideRenderer";
|
|
11
12
|
import { Button } from "@/components/ui/button";
|
|
@@ -25,7 +26,6 @@ import {
|
|
|
25
26
|
useDeckVersions,
|
|
26
27
|
useRestoreDeckVersion,
|
|
27
28
|
} from "@/hooks/use-deck-versions";
|
|
28
|
-
import { toast } from "@/hooks/use-toast";
|
|
29
29
|
import type { AspectRatio } from "@/lib/aspect-ratios";
|
|
30
30
|
|
|
31
31
|
import type { DeckVersionSummary } from "../../../shared/api";
|
|
@@ -107,19 +107,16 @@ export default function HistoryPanel({
|
|
|
107
107
|
deckId,
|
|
108
108
|
versionId: selectedVersionId,
|
|
109
109
|
});
|
|
110
|
-
toast({
|
|
111
|
-
title: t("history.versionRestored"),
|
|
110
|
+
toast.success(t("history.versionRestored"), {
|
|
112
111
|
description: t("history.versionRestoredDescription"),
|
|
113
112
|
});
|
|
114
113
|
handleClose(false);
|
|
115
114
|
} catch (error) {
|
|
116
|
-
toast({
|
|
117
|
-
title: t("history.restoreFailed"),
|
|
115
|
+
toast.error(t("history.restoreFailed"), {
|
|
118
116
|
description:
|
|
119
117
|
error instanceof Error
|
|
120
118
|
? error.message
|
|
121
119
|
: t("history.restoreFailedDescription"),
|
|
122
|
-
variant: "destructive",
|
|
123
120
|
});
|
|
124
121
|
}
|
|
125
122
|
};
|