@agent-native/core 0.141.7 → 0.144.1
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/agent-native.eject.json +9 -0
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/provider-api/SKILL.md +19 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/analytics/AGENTS.md +35 -38
- package/corpus/templates/analytics/actions/ensure-native-v2-dashboards.ts +1 -1
- package/corpus/templates/analytics/actions/list-dashboard-usage-stats.ts +17 -22
- package/corpus/templates/analytics/actions/migrate-first-party-analytics-to-bigquery.ts +1 -1
- package/corpus/templates/analytics/actions/navigate.ts +4 -5
- package/corpus/templates/analytics/actions/provider-api-register.ts +50 -0
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +44 -11
- package/corpus/templates/analytics/actions/test-custom-api-connection.ts +106 -0
- package/corpus/templates/analytics/app/components/CustomApiCard.tsx +430 -0
- package/corpus/templates/analytics/app/i18n-data.ts +680 -0
- package/corpus/templates/analytics/app/lib/native-mcp-exclusions.ts +6 -0
- package/corpus/templates/analytics/app/lib/sql-query.ts +33 -6
- package/corpus/templates/analytics/app/pages/DataSources.tsx +4 -0
- package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-load-reliably-during-background-data-sw.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-remain-responsive-while-historical-data.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-analytics-query-results-now-render-as-a-table-with-csv-downl.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-connect-public-https-custom-apis-and-hand-tested-endpoints-t.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-durable-agent-worker-memory.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-live-dashboard-panels-use-the-shared-query-timeout.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-on-demand-billing-is-available-as-a-native-dashboard-with-ta.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-visible-dashboard-names-are-unique.md +6 -0
- package/corpus/templates/analytics/netlify.toml +7 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +4 -0
- package/corpus/templates/analytics/server/db/index.ts +27 -0
- package/corpus/templates/analytics/server/db/schema.ts +10 -0
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +227 -60
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +156 -45
- package/corpus/templates/analytics/server/lib/native-v2-dashboards.ts +227 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/analytics/server/plugins/analytics-rollup-backfill-jobs.ts +1 -0
- package/corpus/templates/analytics/server/plugins/db.ts +52 -18
- package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +28 -2
- package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +16 -1
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/assets/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/assets/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/brain/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/brain/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/brain/actions/list-connection-providers.ts +24 -3
- package/corpus/templates/brain/app/lib/dispatch-links.ts +44 -0
- package/corpus/templates/brain/app/routes/sources.tsx +15 -7
- package/corpus/templates/brain/changelog/2026-08-06-brain-provider-setup-links-open-dispatch-correctly-in-standa.md +6 -0
- package/corpus/templates/brain/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +26 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/calendar/AGENTS.md +11 -32
- package/corpus/templates/calendar/actions/update-event.ts +107 -1
- package/corpus/templates/calendar/app/components/calendar/EventCalendarSelect.tsx +83 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +57 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +59 -73
- package/corpus/templates/calendar/app/hooks/use-events.ts +4 -1
- package/corpus/templates/calendar/app/i18n-data.ts +20 -0
- package/corpus/templates/calendar/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
- package/corpus/templates/calendar/changelog/2026-08-06-existing-events-can-move-between-connected-google-account-ca.md +6 -0
- package/corpus/templates/calendar/server/lib/google-calendar.ts +101 -0
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +7 -1
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/clips/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/clips/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +9 -24
- package/corpus/templates/clips/app/components/editor/timeline-geometry.ts +15 -0
- package/corpus/templates/clips/app/components/editor/waveform.tsx +4 -17
- package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +14 -3
- package/corpus/templates/clips/app/components/player/player-controls.tsx +0 -3
- package/corpus/templates/clips/app/components/player/scrubber.tsx +2 -33
- package/corpus/templates/clips/app/components/player/video-player.tsx +58 -11
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +28 -38
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +21 -27
- package/corpus/templates/clips/changelog/2026-08-06-clips-recovers-from-stalled-recording-setup-without-requirin.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-clips-starts-faster-after-a-deploy-or-idle-period-startup-no.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-deleting-a-recording-returns-cleanly-to-the-library-and-fit-.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-hide-clip-insights-from-viewers-without-analytics-access.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-trimmed-clips-play-on-a-clean-timeline-without-cut-markers.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +48 -20
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +275 -74
- package/corpus/templates/clips/desktop/src/lib/recording-start-guard.ts +84 -0
- package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +14 -4
- package/corpus/templates/clips/server/plugins/db.ts +214 -26
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/content/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/content/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/crm/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/crm/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/crm/changelog/2026-08-06-crm-starts-faster-after-a-deploy-or-idle-period-one-time-dat.md +6 -0
- package/corpus/templates/crm/server/plugins/db.ts +11 -8
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +36 -1
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/design/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/design/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/design/actions/import-from-url.ts +1 -1
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +27 -18
- package/corpus/templates/design/app/pages/Index.tsx +6 -2
- package/corpus/templates/design/changelog/2026-08-05-deleting-a-design-from-the-home-page-no-longer-leaves-the-ap.md +6 -0
- package/corpus/templates/design/changelog/2026-08-05-renaming-a-layer-now-focuses-its-name-field-automatically.md +6 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +2 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/dispatch/AGENTS.md +8 -1
- package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -0
- package/corpus/templates/dispatch/app/hooks/use-navigation-state.ts +30 -15
- package/corpus/templates/dispatch/app/i18n-data.ts +131 -0
- package/corpus/templates/dispatch/app/routes/admin._index.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.agents.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.approvals.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.apps.$appId.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.apps.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.audit.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.automations.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.destinations.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.dreams.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.identities.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.integrations.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.messaging.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.metrics.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.new-app.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.operations.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.thread-debug.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.transactional-email.$appId.$id.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.transactional-email.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.vault.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.workspace.tsx +1 -0
- package/corpus/templates/dispatch/changelog/2026-08-06-dispatch-keeps-everyday-navigation-focused-while-management-.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-08-06-ready-workspace-apps-stay-one-click-away-in-a-compact-dispat.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-08-06-shared-vault-values-and-management-are-now-restricted-to-wor.md +6 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/factory/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/factory/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/forms/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/forms/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/forms/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
- package/corpus/templates/forms/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/macros/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/macros/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/mail/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/mail/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/mail/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
- package/corpus/templates/mail/server/plugins/agent-chat.ts +6 -0
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/plan/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/plan/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +48 -5
- package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +37 -1
- package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +6 -0
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +15 -2
- package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +29 -24
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/slides/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/slides/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/slides/AGENTS.md +17 -21
- package/corpus/templates/slides/_gitignore +1 -0
- package/corpus/templates/slides/actions/export-pptx.ts +470 -36
- package/corpus/templates/slides/actions/get-deck.ts +12 -0
- package/corpus/templates/slides/actions/import-file.ts +175 -139
- package/corpus/templates/slides/actions/import-google-slides-reference.ts +271 -12
- package/corpus/templates/slides/actions/import-pptx.ts +193 -68
- package/corpus/templates/slides/actions/patch-deck.ts +51 -0
- package/corpus/templates/slides/actions/update-slide.ts +29 -3
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +10 -13
- package/corpus/templates/slides/app/components/editor/AddSlidePopover.tsx +5 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +25 -12
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +112 -57
- package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +202 -0
- package/corpus/templates/slides/app/components/editor/GoogleSlidesReferenceImport.tsx +26 -14
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +173 -0
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +182 -141
- package/corpus/templates/slides/app/components/editor/canvas-interactions/index.ts +1 -0
- package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +18 -0
- package/corpus/templates/slides/app/components/editor/slide-text-targets.ts +85 -0
- package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +15 -0
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +27 -1
- package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
- package/corpus/templates/slides/app/lib/create-deck-generation.ts +72 -11
- package/corpus/templates/slides/app/lib/deck-preview-frame.ts +15 -0
- package/corpus/templates/slides/app/lib/deck-share-links.ts +9 -0
- package/corpus/templates/slides/app/lib/export-pptx-client.ts +89 -0
- package/corpus/templates/slides/app/lib/import-uploaded-deck.ts +89 -0
- package/corpus/templates/slides/app/lib/slide-animation-elements.ts +3 -0
- package/corpus/templates/slides/app/pages/Index.tsx +172 -15
- package/corpus/templates/slides/changelog/2026-08-06-clicking-the-gray-canvas-around-a-slide-clears-its-selection.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-deck-thumbnails-keep-a-consistent-listing-frame-across-aspec.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-deep-linked-decks-open-directly-instead-of-being-interrupted.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-google-slides-exports-now-show-clear-import-steps-when-direc.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-import-pdf-google-slides-and-powerpoint-decks-directly-from-.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-imported-powerpoint-exports-keep-text-and-images-editable-an.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-presentation-prompts-continue-adding-rendered-slides-until-t.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-public-decks-now-share-read-only-presentation-links-by-defau.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-slides-offers-a-direct-connect-google-button-when-a-drive-co.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-slides-preserve-uploaded-pdf-layouts-accept-larger-reference.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-styled-words-stay-part-of-their-text-box-instead-of-becoming.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-uploaded-decks-keep-their-slides-and-visuals-when-you-improv.md +6 -0
- package/corpus/templates/slides/server/handlers/google-docs-auth.ts +7 -20
- package/corpus/templates/slides/server/handlers/import/html-converter.ts +247 -13
- package/corpus/templates/slides/server/handlers/import/pptx-assets.ts +67 -0
- package/corpus/templates/slides/server/handlers/import/pptx-parser.ts +2 -0
- package/corpus/templates/slides/server/handlers/uploads.ts +7 -3
- package/corpus/templates/slides/server/lib/chat-attachments.ts +7 -4
- package/corpus/templates/slides/server/lib/emails.ts +7 -2
- package/corpus/templates/slides/server/lib/google-docs-error.ts +50 -0
- package/corpus/templates/slides/server/lib/google-docs-oauth.ts +1 -0
- package/corpus/templates/slides/server/lib/import-asset-storage.ts +127 -0
- package/corpus/templates/slides/server/lib/source-import.ts +167 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +12 -3
- package/corpus/templates/slides/server/routes/api/import-assets/[token].get.ts +70 -0
- package/corpus/templates/slides/shared/upload-types.ts +3 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/agent/production-agent.d.ts +17 -0
- package/dist/agent/production-agent.js +72 -1
- package/dist/cli/agent-plugin.d.ts +112 -0
- package/dist/cli/agent-plugin.js +1081 -0
- package/dist/cli/app-skill.js +39 -1
- package/dist/cli/code-agent-executor.d.ts +3 -0
- package/dist/cli/code-agent-executor.js +51 -13
- package/dist/cli/index.js +13 -0
- package/dist/cli/templates-meta.js +1 -1
- package/dist/client/AgentPanel.d.ts +3 -1
- package/dist/client/AgentPanel.js +9 -2
- package/dist/client/AssistantChat.d.ts +8 -0
- package/dist/client/AssistantChat.js +23 -8
- package/dist/client/NewWorkspaceAppFlow.js +1 -0
- package/dist/client/agent-chat-adapter.js +123 -4
- package/dist/client/assistant-ui-recovery.d.ts +2 -1
- package/dist/client/assistant-ui-recovery.js +7 -3
- package/dist/client/onboarding/FirstRunOnboarding.js +11 -4
- package/dist/client/org/TeamPage.js +1 -1
- package/dist/client/require-session.js +1 -1
- package/dist/client/resources/McpConnectionSuggestion.d.ts +1 -0
- package/dist/client/resources/McpConnectionSuggestion.js +27 -10
- package/dist/client/resources/McpIntegrationDialog.js +77 -45
- package/dist/client/resources/mcp-integration-catalog.d.ts +13 -1
- package/dist/client/resources/mcp-integration-catalog.js +255 -2
- package/dist/client/resources/mcp-integration-logos.js +18 -2
- package/dist/client/settings/AccountSettingsCard.js +2 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.d.ts +9 -0
- package/dist/db/client.js +51 -16
- package/dist/db/create-get-db.js +2 -2
- package/dist/db/ddl-guard.d.ts +11 -10
- package/dist/db/ddl-guard.js +40 -12
- package/dist/deploy/build.d.ts +2 -0
- package/dist/deploy/build.js +97 -4
- package/dist/deploy/workspace-deploy.js +0 -2
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/guards/no-env-credentials.js +9 -0
- package/dist/ingestion/index.d.ts +1 -1
- package/dist/ingestion/pptx.d.ts +68 -0
- package/dist/ingestion/pptx.js +660 -213
- package/dist/integrations/plugin.js +9 -6
- package/dist/jobs/scheduler.js +79 -23
- package/dist/localization/default-messages.d.ts +54 -0
- package/dist/localization/default-messages.js +57 -2
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/mcp-client/oauth-routes.d.ts +2 -0
- package/dist/mcp-client/oauth-routes.js +73 -6
- package/dist/observability/routes.d.ts +5 -5
- package/dist/onboarding/app-profile.js +11 -0
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/resources/store.js +15 -1
- package/dist/scripts/call-agent.js +34 -4
- package/dist/secrets/routes.d.ts +3 -3
- package/dist/server/agent-chat/action-filters-a2a.d.ts +1 -1
- package/dist/server/agent-chat/action-filters-a2a.js +36 -1
- package/dist/server/agent-chat-plugin.js +29 -8
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/auth.js +47 -11
- package/dist/server/better-auth-instance.js +5 -3
- package/dist/server/core-routes-plugin.d.ts +8 -1
- package/dist/server/core-routes-plugin.js +28 -3
- package/dist/server/credential-provider.d.ts +3 -3
- package/dist/server/credential-provider.js +90 -4
- package/dist/server/onboarding-html.d.ts +2 -0
- package/dist/server/onboarding-html.js +115 -29
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/self-dispatch.d.ts +5 -4
- package/dist/server/self-dispatch.js +25 -14
- package/dist/server/ssr-handler.d.ts +1 -1
- package/dist/server/ssr-handler.js +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/cache-control.d.ts +26 -2
- package/dist/shared/cache-control.js +43 -2
- package/dist/shared/password-policy.d.ts +3 -0
- package/dist/shared/password-policy.js +3 -0
- package/dist/sharing/actions/set-resource-visibility.js +16 -4
- package/dist/sharing/registry.d.ts +14 -0
- package/dist/styles/agent-native.css +6 -0
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
- package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/workspace-root/AGENTS.md +7 -0
- package/dist/user-profile/actions/change-password.js +8 -3
- package/dist/user-profile/actions/set-password.js +5 -1
- package/dist/vite/action-types-plugin.js +59 -0
- package/docs/content/creating-templates.mdx +1 -1
- package/docs/content/getting-started-actions.mdx +38 -189
- package/docs/content/getting-started-database.mdx +80 -164
- package/docs/content/getting-started-pages.mdx +44 -155
- package/docs/content/getting-started.mdx +26 -106
- package/docs/content/skills-guide.mdx +13 -0
- package/package.json +6 -2
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
- package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/workspace-root/AGENTS.md +7 -0
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
import PromptPopover, {
|
|
28
28
|
uploadPromptFiles,
|
|
29
29
|
type UploadedFile,
|
|
30
|
+
type PromptImportSelection,
|
|
30
31
|
} from "@/components/editor/PromptDialog";
|
|
31
32
|
import {
|
|
32
33
|
AlertDialog,
|
|
@@ -51,6 +52,10 @@ import { useWorkspaceDefaults } from "@/hooks/use-workspace-defaults";
|
|
|
51
52
|
import { createDeckAgentMessage } from "@/lib/agent-visible-message";
|
|
52
53
|
import { savePromptToComposerDraft } from "@/lib/composer-draft";
|
|
53
54
|
import { sortDecksByRecency } from "@/lib/deck-sorting";
|
|
55
|
+
import {
|
|
56
|
+
importUploadedDeckIntoDeck,
|
|
57
|
+
type ImportedSourceDeck,
|
|
58
|
+
} from "@/lib/import-uploaded-deck";
|
|
54
59
|
import {
|
|
55
60
|
readRecentReferences,
|
|
56
61
|
rememberRecentReference,
|
|
@@ -180,6 +185,7 @@ async function loadReferenceDeckGenerationContext(
|
|
|
180
185
|
function describeUploadedFilesForAgent(
|
|
181
186
|
files: UploadedFile[],
|
|
182
187
|
deckId: string,
|
|
188
|
+
importedSourceDeck?: ImportedSourceDeck | null,
|
|
183
189
|
): string {
|
|
184
190
|
if (files.length === 0) return "";
|
|
185
191
|
const fileList = files
|
|
@@ -190,12 +196,18 @@ function describeUploadedFilesForAgent(
|
|
|
190
196
|
.join("\n");
|
|
191
197
|
return [
|
|
192
198
|
"",
|
|
193
|
-
|
|
199
|
+
importedSourceDeck
|
|
200
|
+
? `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.`
|
|
201
|
+
: `The user uploaded ${files.length} file(s). These paths are real uploaded files; process them with import actions before using their contents:`,
|
|
194
202
|
fileList,
|
|
195
203
|
"",
|
|
196
204
|
"File handling rules:",
|
|
197
|
-
|
|
198
|
-
|
|
205
|
+
importedSourceDeck
|
|
206
|
+
? "- The imported source deck is the canonical source. Preserve its slide count, order, IDs, factual copy, notes, imagery, charts, tables, diagrams, and freeform objects while improving styling. Use update-slide on existing slide IDs; do not rebuild it with add-slide."
|
|
207
|
+
: `- PPTX files: call \`import-pptx --filePath "<path>" --deckId ${deckId}\` before adding or editing slides.`,
|
|
208
|
+
importedSourceDeck
|
|
209
|
+
? "- 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."
|
|
210
|
+
: `- PDF and DOCX files: call \`import-file --filePath "<path>" --format auto --deckId ${deckId}\` and use the returned extracted text as source material. For a visual PDF whose original layout should be preserved, pass \`--importIntoDeck true\` instead of rebuilding the pages from extracted text.`,
|
|
199
211
|
"- Text-like files: use the uploaded-text-file blocks already included in the prompt; do not call import-file for them.",
|
|
200
212
|
'- Image files with an embeddable URL can be inserted directly into slide HTML as `<img src="...">` or used as visual references.',
|
|
201
213
|
"- 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.",
|
|
@@ -554,11 +566,15 @@ export default function Index() {
|
|
|
554
566
|
const designSystemId =
|
|
555
567
|
referenceSelection.designSystemId !== undefined
|
|
556
568
|
? referenceSelection.designSystemId
|
|
557
|
-
: selectedDesignSystemId
|
|
569
|
+
: selectedDesignSystemId && selectedDesignSystemId !== "none"
|
|
570
|
+
? selectedDesignSystemId
|
|
571
|
+
: null;
|
|
558
572
|
const referenceDeckId =
|
|
559
573
|
referenceSelection.referenceDeckId !== undefined
|
|
560
574
|
? referenceSelection.referenceDeckId
|
|
561
|
-
: selectedReferenceDeckId
|
|
575
|
+
: selectedReferenceDeckId && selectedReferenceDeckId !== "none"
|
|
576
|
+
? selectedReferenceDeckId
|
|
577
|
+
: null;
|
|
562
578
|
const selectedDesignSystem = designSystemId
|
|
563
579
|
? designSystems.find((ds) => ds.id === designSystemId)
|
|
564
580
|
: undefined;
|
|
@@ -590,6 +606,28 @@ export default function Index() {
|
|
|
590
606
|
return;
|
|
591
607
|
}
|
|
592
608
|
|
|
609
|
+
let importedSourceDeck: ImportedSourceDeck | null = null;
|
|
610
|
+
try {
|
|
611
|
+
importedSourceDeck = await importUploadedDeckIntoDeck(
|
|
612
|
+
filesForGeneration,
|
|
613
|
+
deckId,
|
|
614
|
+
);
|
|
615
|
+
} catch (error) {
|
|
616
|
+
if (!savePromptForRetry(prompt)) {
|
|
617
|
+
setNewDeckInitialPrompt({ text: prompt, key: Date.now() });
|
|
618
|
+
}
|
|
619
|
+
setNewDeckRetryFiles(filesForGeneration);
|
|
620
|
+
deleteDeck(deckId);
|
|
621
|
+
toast.error(t("home.generationStartFailed"), {
|
|
622
|
+
description:
|
|
623
|
+
error instanceof Error
|
|
624
|
+
? error.message
|
|
625
|
+
: t("home.generationStartFailedDescription"),
|
|
626
|
+
});
|
|
627
|
+
setShowNewDeckPrompt(true);
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
|
|
593
631
|
clearPendingPromptForRetry();
|
|
594
632
|
setNewDeckInitialPrompt(null);
|
|
595
633
|
setNewDeckRetryFiles([]);
|
|
@@ -603,6 +641,7 @@ export default function Index() {
|
|
|
603
641
|
const fileContext = describeUploadedFilesForAgent(
|
|
604
642
|
filesForGeneration,
|
|
605
643
|
deckId,
|
|
644
|
+
importedSourceDeck,
|
|
606
645
|
);
|
|
607
646
|
const googleDocContext =
|
|
608
647
|
googleDocUrls.length > 0
|
|
@@ -632,7 +671,9 @@ export default function Index() {
|
|
|
632
671
|
: [
|
|
633
672
|
"",
|
|
634
673
|
"Design system selection:",
|
|
635
|
-
"-
|
|
674
|
+
"- No design system was selected in the picker.",
|
|
675
|
+
"- Before generating a bare or on-brand deck, call `get-workspace-defaults`. If it returns a usable design system, patch this deck with that designSystemId, call `get-design-system`, and follow its exact tokens, assets, and custom instructions.",
|
|
676
|
+
"- If no workspace default exists, report the missing configuration instead of inventing a generic Builder-like palette.",
|
|
636
677
|
].join("\n");
|
|
637
678
|
const referenceSource = referenceSelection.referenceSource;
|
|
638
679
|
const referenceSourceContext = referenceSource
|
|
@@ -647,25 +688,49 @@ export default function Index() {
|
|
|
647
688
|
: "Use the Figma source as the design reference. If Builder or Figma access is required, report the exact connection step instead of guessing.",
|
|
648
689
|
].join("\n")
|
|
649
690
|
: "";
|
|
691
|
+
const sourceDeckContext = importedSourceDeck
|
|
692
|
+
? [
|
|
693
|
+
"",
|
|
694
|
+
"Source-preserving improvement mode:",
|
|
695
|
+
`- 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.`,
|
|
696
|
+
"- 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.",
|
|
697
|
+
"- Read `get-deck` before editing, load the linked design system with `get-design-system`, then use one `update-slide` call per existing slide ID for bounded visual improvements. Keep every original `<img>` source and enough original factual copy for each slide; for PDF slides, use restrained design-system chrome around the page without obscuring it.",
|
|
698
|
+
"- 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.",
|
|
699
|
+
"- If `get-deck` reports partial source fidelity or skipped images, stop and report the exact warning instead of claiming a reliable restyle.",
|
|
700
|
+
].join("\n")
|
|
701
|
+
: "";
|
|
702
|
+
const sourceModeInstructions = importedSourceDeck
|
|
703
|
+
? [
|
|
704
|
+
"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.",
|
|
705
|
+
"Do not use the new-deck add-slide workflow for this source-preserving request.",
|
|
706
|
+
].join("\n")
|
|
707
|
+
: [
|
|
708
|
+
"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.",
|
|
709
|
+
"After reading any requested or imported source material, but before adding the first slide, choose a concise, specific deck title from the user's request and source material. Call `patch-deck` with `deckId: \"" +
|
|
710
|
+
deckId +
|
|
711
|
+
'\"` 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.',
|
|
712
|
+
"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.",
|
|
713
|
+
"If the request is for a presentation or deck and does not explicitly ask for one slide, infer a coherent multi-slide outline from the scope and keep adding slides until that outline is complete. Do not stop after the first slide just because the prompt has few explicit instructions.",
|
|
714
|
+
"Add slides ONE AT A TIME using the `add-slide` action with --deckId=" +
|
|
715
|
+
deckId +
|
|
716
|
+
". Wait for each `add-slide` result before calling it again; do not batch or parallelize slide writes.",
|
|
717
|
+
"Use create-deck and add-slide for this already-created deck. Do not call the legacy generate-slides-ai action: it returns Markdown drafts rather than persisted rendered slide HTML. Treat each successful add-slide result as confirmation to continue with the next planned slide.",
|
|
718
|
+
].join("\n");
|
|
650
719
|
|
|
651
720
|
const context = [
|
|
652
|
-
|
|
721
|
+
importedSourceDeck
|
|
722
|
+
? `The user uploaded a source presentation into target deck (id: "${deckId}") and wants a reliable visual improvement.`
|
|
723
|
+
: `The user just created a new empty deck (id: "${deckId}") and wants to create a presentation or standalone visual.`,
|
|
653
724
|
"The visible user message above contains the user's request and/or pasted source material for the deck. Treat pasted memo content as source material even if the user did not explicitly say they are pasting it.",
|
|
654
725
|
googleDocContext,
|
|
655
726
|
fileContext,
|
|
656
727
|
referenceDeckContext,
|
|
657
728
|
designSystemContext,
|
|
658
729
|
referenceSourceContext,
|
|
730
|
+
sourceDeckContext,
|
|
659
731
|
"",
|
|
660
732
|
"Before generating, if the request or selected references leave a meaningful choice unresolved, use the `ask-question` tool to ask one concise, prompt-specific question in the inline guided-question flow. Generate the question wording and 2 to 4 options from the user's request and selected references, like Claude's design-question flow; do not use a fixed generic questionnaire. Ask only a choice that materially affects the deck, such as audience, tone, structure, or length. If the prompt already makes the choice clear, do not ask it again. Wait for the user's answer or skip before adding slides.",
|
|
661
|
-
|
|
662
|
-
"After reading any requested or imported source material, but before adding the first slide, choose a concise, specific deck title from the user's request and source material. Call `patch-deck` with `deckId: \"" +
|
|
663
|
-
deckId +
|
|
664
|
-
'"` 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.',
|
|
665
|
-
"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.",
|
|
666
|
-
"Add slides ONE AT A TIME using the `add-slide` action with --deckId=" +
|
|
667
|
-
deckId +
|
|
668
|
-
". Wait for each `add-slide` result before calling it again; do not batch or parallelize slide writes.",
|
|
733
|
+
sourceModeInstructions,
|
|
669
734
|
"If the user asked for a specific slide count, keep going sequentially until that count is reached unless a tool error blocks you.",
|
|
670
735
|
"Every slide is rendered into a fixed native canvas (default 16:9 is 960x540 CSS pixels, with 740x380px available inside standard 80px 110px padding). Keep the main content within that fit budget; split dense source material across more slides instead of packing it tightly. Never use zoom, transform: scale(), clipping, or scroll overflow to hide content overflow, and keep body text at least 16px.",
|
|
671
736
|
"Each slide's --content must be full HTML. Slide HTML templates are in your AGENTS.md.",
|
|
@@ -692,6 +757,95 @@ export default function Index() {
|
|
|
692
757
|
[setNewDeckPromptOpen],
|
|
693
758
|
);
|
|
694
759
|
|
|
760
|
+
const handleDirectImport = useCallback(
|
|
761
|
+
async (selection: PromptImportSelection): Promise<boolean> => {
|
|
762
|
+
if (!session) {
|
|
763
|
+
setSignInPromptHadFiles(selection.kind !== "google-slides");
|
|
764
|
+
setShowSignInDialog(true);
|
|
765
|
+
return false;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
if (selection.kind === "google-slides") {
|
|
769
|
+
const imported = (await callAction("import-google-slides-reference", {
|
|
770
|
+
presentationUrl: selection.url,
|
|
771
|
+
})) as { id?: unknown };
|
|
772
|
+
if (typeof imported.id !== "string" || !imported.id) {
|
|
773
|
+
throw new Error(
|
|
774
|
+
"The Google Slides presentation did not create a deck.",
|
|
775
|
+
);
|
|
776
|
+
}
|
|
777
|
+
await reloadDecks();
|
|
778
|
+
navigate(`/deck/${imported.id}`, { flushSync: true });
|
|
779
|
+
return true;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
const uploaded = await uploadPromptFiles(selection.files);
|
|
783
|
+
const file = uploaded[0];
|
|
784
|
+
if (!file) throw new Error("The selected file could not be uploaded.");
|
|
785
|
+
|
|
786
|
+
if (selection.kind === "pptx") {
|
|
787
|
+
const imported = (await callAction("import-pptx", {
|
|
788
|
+
filePath: file.path,
|
|
789
|
+
designSystemId: initialDesignSystemId,
|
|
790
|
+
})) as { id?: unknown };
|
|
791
|
+
if (typeof imported.id !== "string" || !imported.id) {
|
|
792
|
+
throw new Error("The PowerPoint presentation did not create a deck.");
|
|
793
|
+
}
|
|
794
|
+
await reloadDecks();
|
|
795
|
+
navigate(`/deck/${imported.id}`, { flushSync: true });
|
|
796
|
+
return true;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
let deck: ReturnType<typeof createDeck> | undefined;
|
|
800
|
+
flushSync(() => {
|
|
801
|
+
deck = createDeck(undefined, {
|
|
802
|
+
noDefaultSlides: true,
|
|
803
|
+
designSystemId: initialDesignSystemId,
|
|
804
|
+
});
|
|
805
|
+
});
|
|
806
|
+
if (!deck) throw new Error("The PDF deck could not be created.");
|
|
807
|
+
|
|
808
|
+
const persisted = await ensureDeckPersisted(deck.id);
|
|
809
|
+
if (!persisted.persisted) {
|
|
810
|
+
deleteDeck(deck.id);
|
|
811
|
+
throw new Error(
|
|
812
|
+
describeDeckPersistenceFailure(
|
|
813
|
+
persisted,
|
|
814
|
+
"The PDF deck could not be saved.",
|
|
815
|
+
),
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
try {
|
|
820
|
+
const imported = (await callAction("import-file", {
|
|
821
|
+
filePath: file.path,
|
|
822
|
+
format: "pdf",
|
|
823
|
+
deckId: deck.id,
|
|
824
|
+
importIntoDeck: true,
|
|
825
|
+
})) as { imported?: unknown; deckId?: unknown };
|
|
826
|
+
if (imported.imported !== true || imported.deckId !== deck.id) {
|
|
827
|
+
throw new Error("The PDF could not be imported into the new deck.");
|
|
828
|
+
}
|
|
829
|
+
await reloadDecks();
|
|
830
|
+
navigate(`/deck/${deck.id}`, { flushSync: true });
|
|
831
|
+
return true;
|
|
832
|
+
} catch (error) {
|
|
833
|
+
deleteDeck(deck.id);
|
|
834
|
+
throw error;
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
[
|
|
838
|
+
callAction,
|
|
839
|
+
createDeck,
|
|
840
|
+
deleteDeck,
|
|
841
|
+
ensureDeckPersisted,
|
|
842
|
+
navigate,
|
|
843
|
+
reloadDecks,
|
|
844
|
+
session,
|
|
845
|
+
initialDesignSystemId,
|
|
846
|
+
],
|
|
847
|
+
);
|
|
848
|
+
|
|
695
849
|
const handleReferenceSelect = useCallback(
|
|
696
850
|
async (selection: NewDeckReferenceSelection) => {
|
|
697
851
|
const pending = pendingDeck;
|
|
@@ -1151,6 +1305,9 @@ export default function Index() {
|
|
|
1151
1305
|
onSkip={handleCreateDeckBlank}
|
|
1152
1306
|
skipLabel={t("home.skipPrompt")}
|
|
1153
1307
|
onSubmit={handlePromptSubmit}
|
|
1308
|
+
onImport={handleDirectImport}
|
|
1309
|
+
importFromLabel={t("home.importFrom")}
|
|
1310
|
+
importingLabel={t("editorToolbar.importing")}
|
|
1154
1311
|
onBeforeUpload={(prompt, files) => {
|
|
1155
1312
|
if (session) return true;
|
|
1156
1313
|
preservePromptForSignIn(prompt, { hadFiles: files.length > 0 });
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
type H3Event,
|
|
17
17
|
} from "h3";
|
|
18
18
|
|
|
19
|
+
import { formatGoogleOAuthError } from "../lib/google-docs-error.js";
|
|
19
20
|
import {
|
|
20
21
|
disconnectGoogleDocs,
|
|
21
22
|
exchangeGoogleDocsCode,
|
|
@@ -25,22 +26,8 @@ import {
|
|
|
25
26
|
isGoogleDocsOAuthConfigured,
|
|
26
27
|
listGoogleDocsAccounts,
|
|
27
28
|
} from "../lib/google-docs-oauth.js";
|
|
28
|
-
|
|
29
29
|
const OAUTH_STATE_APP_ID = process.env.APP_NAME || "slides";
|
|
30
30
|
|
|
31
|
-
function permissionMessage(error: unknown): string {
|
|
32
|
-
const message =
|
|
33
|
-
error instanceof Error ? error.message : String(error || "Unknown error");
|
|
34
|
-
if (
|
|
35
|
-
message.includes("Insufficient Permission") ||
|
|
36
|
-
message.includes("insufficient_scope") ||
|
|
37
|
-
message.includes("access_denied")
|
|
38
|
-
) {
|
|
39
|
-
return "Google Docs access was denied. Connect again and approve the requested Google Drive file permission.";
|
|
40
|
-
}
|
|
41
|
-
return message;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
31
|
async function requireSessionEmail(event: H3Event): Promise<string | null> {
|
|
45
32
|
const session = await getSession(event);
|
|
46
33
|
if (!session?.email) {
|
|
@@ -105,7 +92,7 @@ export const getGoogleDocsAuthUrlHandler = defineEventHandler(
|
|
|
105
92
|
return { url };
|
|
106
93
|
} catch (error) {
|
|
107
94
|
setResponseStatus(event, 500);
|
|
108
|
-
return { error:
|
|
95
|
+
return { error: formatGoogleOAuthError(error) };
|
|
109
96
|
}
|
|
110
97
|
},
|
|
111
98
|
);
|
|
@@ -127,7 +114,7 @@ export const handleGoogleDocsCallback = defineEventHandler(
|
|
|
127
114
|
if (googleError) {
|
|
128
115
|
const errorDesc =
|
|
129
116
|
(query.error_description as string | undefined) || googleError;
|
|
130
|
-
return oauthErrorPage(
|
|
117
|
+
return oauthErrorPage(formatGoogleOAuthError(new Error(errorDesc)));
|
|
131
118
|
}
|
|
132
119
|
|
|
133
120
|
const code = query.code as string | undefined;
|
|
@@ -157,7 +144,7 @@ export const handleGoogleDocsCallback = defineEventHandler(
|
|
|
157
144
|
});
|
|
158
145
|
} catch (error) {
|
|
159
146
|
return oauthErrorPage(
|
|
160
|
-
`Google Docs connection failed: ${
|
|
147
|
+
`Google Docs connection failed: ${formatGoogleOAuthError(error)}`,
|
|
161
148
|
);
|
|
162
149
|
}
|
|
163
150
|
},
|
|
@@ -183,7 +170,7 @@ export const getGoogleDocsStatus = defineEventHandler(
|
|
|
183
170
|
};
|
|
184
171
|
} catch (error) {
|
|
185
172
|
setResponseStatus(event, 500);
|
|
186
|
-
return { error:
|
|
173
|
+
return { error: formatGoogleOAuthError(error) };
|
|
187
174
|
}
|
|
188
175
|
},
|
|
189
176
|
);
|
|
@@ -230,7 +217,7 @@ export const getGoogleDocsPickerToken = defineEventHandler(
|
|
|
230
217
|
};
|
|
231
218
|
} catch (error) {
|
|
232
219
|
setResponseStatus(event, 401);
|
|
233
|
-
return { error:
|
|
220
|
+
return { error: formatGoogleOAuthError(error) };
|
|
234
221
|
}
|
|
235
222
|
},
|
|
236
223
|
);
|
|
@@ -247,7 +234,7 @@ export const disconnectGoogleDocsHandler = defineEventHandler(
|
|
|
247
234
|
return { ok: true };
|
|
248
235
|
} catch (error) {
|
|
249
236
|
setResponseStatus(event, 500);
|
|
250
|
-
return { error:
|
|
237
|
+
return { error: formatGoogleOAuthError(error) };
|
|
251
238
|
}
|
|
252
239
|
},
|
|
253
240
|
);
|