@agent-native/core 0.141.6 → 0.144.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/agent-native.eject.json +9 -0
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +3 -14
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +11 -6
- package/corpus/templates/analytics/.agents/skills/prometheus/SKILL.md +5 -5
- 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 +37 -40
- package/corpus/templates/analytics/actions/compose-dashboard.ts +1 -1
- 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 +135 -0
- package/corpus/templates/analytics/actions/navigate.ts +5 -6
- package/corpus/templates/analytics/actions/provider-api-register.ts +50 -0
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +46 -13
- package/corpus/templates/analytics/actions/test-custom-api-connection.ts +106 -0
- package/corpus/templates/analytics/actions/update-dashboard.ts +0 -1
- package/corpus/templates/analytics/actions/view-screen.ts +0 -20
- package/corpus/templates/analytics/app/components/CustomApiCard.tsx +430 -0
- package/corpus/templates/analytics/app/components/layout/Header.tsx +0 -1
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +5 -5
- package/corpus/templates/analytics/app/i18n-data.ts +682 -90
- 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/Agents.tsx +0 -3
- package/corpus/templates/analytics/app/pages/DataSources.tsx +4 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +22 -43
- package/corpus/templates/analytics/app/pages/settings/settings-search.ts +23 -20
- package/corpus/templates/analytics/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/analytics/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/analytics/app/routes/team.tsx +1 -1
- package/corpus/templates/analytics/changelog/2026-08-05-settings-no-longer-includes-an-unnecessary-about-section.md +6 -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/docs/schemas/first-party-analytics.md +1 -1
- 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/scripts/first-party-analytics-bigquery.sql +104 -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/agent-chat-plan-mode.ts +0 -2
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +227 -60
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +1147 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-health.ts +34 -15
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +57 -4
- package/corpus/templates/analytics/server/lib/native-v2-dashboards.ts +227 -1
- package/corpus/templates/analytics/server/lib/real-data-actions.ts +1 -3
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +7 -4
- 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 +36 -8
- package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +16 -1
- package/corpus/templates/assets/.agents/skills/library-management/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/assets/AGENTS.md +1 -0
- package/corpus/templates/assets/actions/_helpers.ts +12 -0
- package/corpus/templates/assets/actions/generate-image.ts +9 -3
- package/corpus/templates/assets/actions/import-style-from-url.ts +115 -0
- package/corpus/templates/assets/app/hooks/use-navigation-state.ts +3 -1
- package/corpus/templates/assets/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/assets/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/assets/app/routes/settings.tsx +5 -0
- package/corpus/templates/assets/app/routes/team.tsx +1 -1
- package/corpus/templates/assets/changelog/2026-08-05-brand-kits-can-import-a-website-s-hydrated-visual-language-a.md +6 -0
- package/corpus/templates/assets/changelog/2026-08-05-generated-images-now-hand-off-embeddable-previews-to-other-w.md +6 -0
- package/corpus/templates/assets/server/lib/generation.ts +58 -0
- package/corpus/templates/assets/shared/api.ts +12 -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/extensions._index.tsx +1 -1
- package/corpus/templates/brain/app/routes/sources.tsx +15 -7
- package/corpus/templates/brain/app/routes/team.tsx +1 -1
- package/corpus/templates/brain/app/routes.ts +1 -1
- 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/components/layout/AppLayout.tsx +3 -1
- 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/app/routes/_app.extensions._index.tsx +1 -1
- package/corpus/templates/calendar/app/routes/_app.settings.$.tsx +1 -0
- package/corpus/templates/calendar/app/routes/_app.team.tsx +1 -1
- 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/chat/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/chat/app/hooks/use-navigation-state.ts +1 -1
- package/corpus/templates/chat/app/root.tsx +1 -1
- package/corpus/templates/chat/app/routes/agent.tsx +7 -7
- package/corpus/templates/chat/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/chat/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/chat/app/routes/team.tsx +1 -1
- 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/library/library-layout.tsx +1 -1
- package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +14 -3
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +1 -1
- package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +1 -1
- package/corpus/templates/clips/app/routes/_app.extensions._index.tsx +1 -1
- package/corpus/templates/clips/app/routes/_app.settings.$.tsx +1 -0
- 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/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/content/app/routes/_app.extensions._index.tsx +1 -1
- package/corpus/templates/content/app/routes/_app.settings.$.tsx +1 -0
- package/corpus/templates/content/app/routes/_app.team.tsx +1 -1
- package/corpus/templates/content/e2e/global-setup.ts +1 -1
- 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/design-systems/SKILL.md +6 -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/analyze-brand-assets.ts +7 -7
- package/corpus/templates/design/actions/import-from-url.ts +6 -5
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +27 -18
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +2 -2
- package/corpus/templates/design/app/pages/Index.tsx +6 -2
- package/corpus/templates/design/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/design/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/design/app/routes/team.tsx +1 -1
- 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/changelog/2026-08-05-website-url-imports-now-capture-hydrated-browser-computed-de.md +6 -0
- package/corpus/templates/design/e2e/global-setup.ts +1 -1
- 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/app/hooks/use-navigation-state.ts +1 -1
- package/corpus/templates/dispatch/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/team.tsx +1 -1
- 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/factory/app/hooks/use-navigation-state.ts +1 -1
- package/corpus/templates/factory/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/factory/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/factory/app/routes/team.tsx +1 -1
- 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/app/routes/_app.extensions._index.tsx +1 -1
- package/corpus/templates/forms/app/routes/_app.settings.$.tsx +1 -0
- package/corpus/templates/forms/app/routes/_app.team.tsx +1 -1
- 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/forms/shared/navigation.ts +1 -1
- 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/macros/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/macros/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/macros/app/routes/team.tsx +1 -1
- 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/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/mail/app/routes/settings.$.tsx +1 -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/plan/app/hooks/use-navigation-state.ts +1 -1
- package/corpus/templates/plan/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/plan/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/plan/app/routes/team.tsx +1 -1
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +48 -5
- package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +40 -2
- 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 +7 -9
- package/corpus/templates/slides/_gitignore +1 -0
- package/corpus/templates/slides/actions/analyze-brand-assets.ts +7 -7
- package/corpus/templates/slides/actions/export-pptx.ts +402 -36
- package/corpus/templates/slides/actions/import-file.ts +46 -85
- package/corpus/templates/slides/actions/import-from-url.ts +6 -6
- package/corpus/templates/slides/actions/import-google-slides-reference.ts +271 -12
- package/corpus/templates/slides/actions/import-pptx.ts +85 -60
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +10 -13
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +1 -1
- 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 +176 -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 +13 -3
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +27 -1
- package/corpus/templates/slides/app/context/DeckContext.tsx +71 -20
- package/corpus/templates/slides/app/global.css +6 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
- package/corpus/templates/slides/app/lib/create-deck-generation.ts +10 -6
- 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/slide-animation-elements.ts +3 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +17 -0
- package/corpus/templates/slides/app/pages/Index.tsx +107 -6
- package/corpus/templates/slides/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/slides/app/routes/settings.$.tsx +1 -0
- package/corpus/templates/slides/app/routes/team.tsx +1 -1
- package/corpus/templates/slides/changelog/2026-08-05-failed-deck-creation-and-reference-uploads-now-recover-clean.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-05-slides-recover-completed-generation-results-after-a-sync-hic.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-05-website-url-imports-now-capture-hydrated-browser-computed-st.md +6 -0
- 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/server/handlers/google-docs-auth.ts +7 -20
- package/corpus/templates/slides/server/handlers/import/html-converter.ts +236 -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 +6 -3
- 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/plugins/agent-chat.ts +4 -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/corpus/templates/tasks/app/components/layout/Header.tsx +3 -1
- package/corpus/templates/tasks/app/routes/extensions._index.tsx +1 -1
- package/corpus/templates/tasks/app/routes/settings.$.tsx +1 -0
- package/dist/agent/engine/ai-sdk-engine.js +49 -3
- package/dist/agent/production-agent.d.ts +18 -0
- package/dist/agent/production-agent.js +80 -1
- package/dist/agent/types.d.ts +7 -0
- 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.d.ts +1 -1
- package/dist/client/agent-chat-adapter.js +153 -7
- package/dist/client/agent-page/AgentWorkspaceContent.d.ts +1 -1
- package/dist/client/agent-page/AgentWorkspaceContent.js +13 -13
- package/dist/client/assistant-ui-recovery.d.ts +2 -1
- package/dist/client/assistant-ui-recovery.js +7 -3
- package/dist/client/chat/run-recovery.js +5 -1
- package/dist/client/embed-auth.js +6 -2
- package/dist/client/error-format.js +12 -0
- package/dist/client/integrations/IntegrationsPanel.js +40 -6
- package/dist/client/onboarding/FirstRunOnboarding.js +11 -4
- package/dist/client/org/OrgSwitcher.js +2 -2
- package/dist/client/org/TeamPage.js +92 -72
- package/dist/client/require-session.d.ts +1 -1
- package/dist/client/require-session.js +4 -4
- 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/resources/use-mcp-servers.d.ts +5 -0
- package/dist/client/resources/use-mcp-servers.js +36 -0
- package/dist/client/settings/AccountSettingsCard.js +42 -36
- package/dist/client/settings/AutomationsSection.js +1 -1
- package/dist/client/settings/DemoModeSection.d.ts +3 -1
- package/dist/client/settings/DemoModeSection.js +4 -1
- package/dist/client/settings/ExtensionsSettingsContent.js +1 -1
- package/dist/client/settings/SchedulingTimezoneField.d.ts +3 -1
- package/dist/client/settings/SchedulingTimezoneField.js +9 -5
- package/dist/client/settings/SettingsPanel.d.ts +4 -1
- package/dist/client/settings/SettingsPanel.js +21 -21
- package/dist/client/settings/SettingsTabsPage.d.ts +2 -2
- package/dist/client/settings/SettingsTabsPage.js +98 -45
- package/dist/client/settings/VoiceTranscriptionSection.js +6 -1
- package/dist/client/settings/useSettingsPanelController.js +47 -8
- package/dist/collab/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/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/ingestion/website.d.ts +30 -0
- package/dist/integrations/plugin.js +9 -6
- package/dist/localization/default-messages.d.ts +59 -0
- package/dist/localization/default-messages.js +62 -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 +74 -7
- package/dist/mcp-client/routes.d.ts +1 -0
- package/dist/mcp-client/routes.js +49 -0
- package/dist/navigation/index.js +16 -5
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/onboarding/app-profile.js +11 -0
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +13 -13
- package/dist/provider-api/actions/provider-api.d.ts +11 -11
- package/dist/resources/store.js +15 -1
- package/dist/scripts/call-agent.js +45 -4
- package/dist/secrets/routes.d.ts +6 -6
- 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 +55 -17
- 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/identity-sso.js +2 -1
- package/dist/server/onboarding-html.d.ts +2 -0
- package/dist/server/onboarding-html.js +171 -62
- 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/workspace-provider-oauth.js +1 -1
- package/dist/setup-connections/onboarding.js +1 -1
- package/dist/shared/cache-control.d.ts +26 -2
- package/dist/shared/cache-control.js +43 -2
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/password-policy.d.ts +3 -0
- package/dist/shared/password-policy.js +3 -0
- package/dist/shared/sign-in-journey.d.ts +5 -2
- package/dist/shared/sign-in-journey.js +10 -4
- 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/chat/app/components/layout/Layout.tsx +1 -1
- package/dist/templates/chat/app/hooks/use-navigation-state.ts +1 -1
- package/dist/templates/chat/app/root.tsx +1 -1
- package/dist/templates/chat/app/routes/agent.tsx +7 -7
- package/dist/templates/chat/app/routes/extensions._index.tsx +1 -1
- package/dist/templates/chat/app/routes/settings.$.tsx +1 -0
- package/dist/templates/chat/app/routes/team.tsx +1 -1
- 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/address-feedback/SKILL.md +37 -6
- package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +4 -2
- 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/authentication.mdx +4 -5
- package/docs/content/skills-guide.mdx +13 -0
- package/docs/content/template-analytics-developers.mdx +1 -1
- package/docs/content/template-calendar-developers.mdx +1 -1
- package/docs/content/template-chat-developers.mdx +2 -2
- package/docs/content/template-content-developers.mdx +1 -1
- package/docs/content/template-mail-developers.mdx +1 -1
- package/docs/content/template-plan-developers.mdx +1 -1
- package/docs/content/toolkit-command-navigation.mdx +6 -6
- package/docs/content/toolkit-org-team.mdx +1 -1
- package/docs/content/toolkit-settings.mdx +8 -8
- package/docs/content/toolkit-setup-connections.mdx +1 -1
- 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/chat/app/components/layout/Layout.tsx +1 -1
- package/src/templates/chat/app/hooks/use-navigation-state.ts +1 -1
- package/src/templates/chat/app/root.tsx +1 -1
- package/src/templates/chat/app/routes/agent.tsx +7 -7
- package/src/templates/chat/app/routes/extensions._index.tsx +1 -1
- package/src/templates/chat/app/routes/settings.$.tsx +1 -0
- package/src/templates/chat/app/routes/team.tsx +1 -1
- 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/address-feedback/SKILL.md +37 -6
- package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +4 -2
- 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
- package/corpus/templates/analytics/.agents/skills/dashboard-management/references/template-catalog-and-demo.md +0 -62
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +0 -369
- package/corpus/templates/analytics/actions/list-dashboard-templates.ts +0 -47
- package/corpus/templates/analytics/actions/list-native-v2-dashboard-templates.ts +0 -34
- package/corpus/templates/analytics/app/routes/catalog.tsx +0 -240
- package/src/templates/default/actions/navigate.spec.ts +0 -53
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { agentNativePath } from "@agent-native/core/client/api-path";
|
|
2
|
+
import { oauthRedirectUri } from "@agent-native/core/client/host";
|
|
3
|
+
import { useT } from "@agent-native/core/client/i18n";
|
|
4
|
+
import {
|
|
5
|
+
IconBrandGoogleDrive,
|
|
6
|
+
IconLoader2,
|
|
7
|
+
IconPlugConnected,
|
|
8
|
+
} from "@tabler/icons-react";
|
|
9
|
+
import { useCallback, useEffect, useState } from "react";
|
|
10
|
+
|
|
11
|
+
import { Button } from "../ui/button";
|
|
12
|
+
|
|
13
|
+
interface GoogleDocsStatus {
|
|
14
|
+
configured: boolean;
|
|
15
|
+
connected: boolean;
|
|
16
|
+
error?: string;
|
|
17
|
+
message?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface GoogleDocsAuthResponse {
|
|
21
|
+
url?: string;
|
|
22
|
+
error?: string;
|
|
23
|
+
message?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type JsonReadResult<T> = { ok: true; data: T } | { ok: false; error: Error };
|
|
27
|
+
|
|
28
|
+
function endpoint(path: string): string {
|
|
29
|
+
return new URL(agentNativePath(path), window.location.origin).toString();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function readJson<T>(response: Response): Promise<JsonReadResult<T>> {
|
|
33
|
+
try {
|
|
34
|
+
return { ok: true, data: (await response.json()) as T };
|
|
35
|
+
} catch (caught) {
|
|
36
|
+
return {
|
|
37
|
+
ok: false,
|
|
38
|
+
error: new Error("The server returned an unreadable response.", {
|
|
39
|
+
cause: caught,
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function responseError(
|
|
46
|
+
response: Response,
|
|
47
|
+
data: { error?: string; message?: string },
|
|
48
|
+
fallback: string,
|
|
49
|
+
): Error {
|
|
50
|
+
return new Error(
|
|
51
|
+
data.message || data.error || `${fallback} (${response.status})`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface GoogleDriveConnectionCtaProps {
|
|
56
|
+
onConnected?: () => void;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function GoogleDriveConnectionCta({
|
|
60
|
+
onConnected,
|
|
61
|
+
}: GoogleDriveConnectionCtaProps) {
|
|
62
|
+
const t = useT();
|
|
63
|
+
const [status, setStatus] = useState<GoogleDocsStatus | null>(null);
|
|
64
|
+
const [loading, setLoading] = useState(true);
|
|
65
|
+
const [connecting, setConnecting] = useState(false);
|
|
66
|
+
const [error, setError] = useState<string | null>(null);
|
|
67
|
+
|
|
68
|
+
const refreshStatus =
|
|
69
|
+
useCallback(async (): Promise<GoogleDocsStatus | null> => {
|
|
70
|
+
try {
|
|
71
|
+
const response = await fetch(
|
|
72
|
+
endpoint("/_agent-native/google-docs/status"),
|
|
73
|
+
{ credentials: "same-origin" },
|
|
74
|
+
);
|
|
75
|
+
const result = await readJson<GoogleDocsStatus>(response);
|
|
76
|
+
if (!result.ok) throw result.error;
|
|
77
|
+
if (!response.ok) {
|
|
78
|
+
throw responseError(
|
|
79
|
+
response,
|
|
80
|
+
result.data,
|
|
81
|
+
"Could not check Google Drive",
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
setStatus(result.data);
|
|
85
|
+
setError(null);
|
|
86
|
+
return result.data;
|
|
87
|
+
} catch (caught) {
|
|
88
|
+
setStatus(null);
|
|
89
|
+
setError(caught instanceof Error ? caught.message : String(caught));
|
|
90
|
+
return null;
|
|
91
|
+
} finally {
|
|
92
|
+
setLoading(false);
|
|
93
|
+
}
|
|
94
|
+
}, []);
|
|
95
|
+
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
void refreshStatus();
|
|
98
|
+
}, [refreshStatus]);
|
|
99
|
+
|
|
100
|
+
const connect = useCallback(async () => {
|
|
101
|
+
if (connecting) return;
|
|
102
|
+
setConnecting(true);
|
|
103
|
+
setError(null);
|
|
104
|
+
const popup = window.open(
|
|
105
|
+
"about:blank",
|
|
106
|
+
"google-docs-oauth",
|
|
107
|
+
"popup,width=520,height=720",
|
|
108
|
+
);
|
|
109
|
+
try {
|
|
110
|
+
const authUrl = new URL(endpoint("/_agent-native/google-docs/auth-url"));
|
|
111
|
+
authUrl.searchParams.set(
|
|
112
|
+
"redirect_uri",
|
|
113
|
+
oauthRedirectUri("/_agent-native/google-docs/callback"),
|
|
114
|
+
);
|
|
115
|
+
authUrl.searchParams.set(
|
|
116
|
+
"return",
|
|
117
|
+
window.location.pathname + window.location.search,
|
|
118
|
+
);
|
|
119
|
+
const response = await fetch(authUrl.toString(), {
|
|
120
|
+
credentials: "same-origin",
|
|
121
|
+
});
|
|
122
|
+
const result = await readJson<GoogleDocsAuthResponse>(response);
|
|
123
|
+
if (!result.ok) throw result.error;
|
|
124
|
+
if (!response.ok || !result.data.url) {
|
|
125
|
+
throw responseError(
|
|
126
|
+
response,
|
|
127
|
+
result.data,
|
|
128
|
+
"Could not start Google OAuth",
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
if (!popup) {
|
|
132
|
+
window.location.href = result.data.url;
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
popup.location.href = result.data.url;
|
|
136
|
+
|
|
137
|
+
const deadline = Date.now() + 90_000;
|
|
138
|
+
while (Date.now() < deadline && !popup.closed) {
|
|
139
|
+
await new Promise((resolve) => window.setTimeout(resolve, 1_200));
|
|
140
|
+
const next = await refreshStatus();
|
|
141
|
+
if (next?.connected) {
|
|
142
|
+
popup.close();
|
|
143
|
+
onConnected?.();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const next = await refreshStatus();
|
|
148
|
+
if (next?.connected) onConnected?.();
|
|
149
|
+
} catch (caught) {
|
|
150
|
+
popup?.close();
|
|
151
|
+
setError(caught instanceof Error ? caught.message : String(caught));
|
|
152
|
+
} finally {
|
|
153
|
+
setConnecting(false);
|
|
154
|
+
}
|
|
155
|
+
}, [connecting, onConnected, refreshStatus]);
|
|
156
|
+
|
|
157
|
+
if (loading || status?.connected) return null;
|
|
158
|
+
|
|
159
|
+
const displayStatus = status ?? { configured: false, connected: false };
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<div className="flex items-center gap-2 rounded-lg border border-border/70 bg-muted/35 px-3 py-2 text-xs">
|
|
163
|
+
<div className="flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background">
|
|
164
|
+
{connecting ? (
|
|
165
|
+
<IconLoader2 className="size-3.5 animate-spin text-muted-foreground" />
|
|
166
|
+
) : (
|
|
167
|
+
<IconBrandGoogleDrive className="size-3.5 text-primary" />
|
|
168
|
+
)}
|
|
169
|
+
</div>
|
|
170
|
+
<div className="min-w-0 flex-1">
|
|
171
|
+
<p className="font-medium text-foreground">
|
|
172
|
+
Google Drive {/* i18n-ignore stable provider label */}
|
|
173
|
+
</p>
|
|
174
|
+
<p className="mt-0.5 text-[11px] leading-relaxed text-muted-foreground">
|
|
175
|
+
{displayStatus.configured
|
|
176
|
+
? t("home.googleSlidesReferenceConnect")
|
|
177
|
+
: t("raw.googleOAuthNotConfigured")}
|
|
178
|
+
</p>
|
|
179
|
+
{error && <p className="mt-1 text-[11px] text-destructive">{error}</p>}
|
|
180
|
+
</div>
|
|
181
|
+
{displayStatus.configured && (
|
|
182
|
+
<Button
|
|
183
|
+
type="button"
|
|
184
|
+
size="sm"
|
|
185
|
+
onClick={() => void connect()}
|
|
186
|
+
disabled={connecting}
|
|
187
|
+
aria-busy={connecting}
|
|
188
|
+
className="h-7 shrink-0 gap-1.5 rounded-md px-2.5 text-[11px] disabled:cursor-wait"
|
|
189
|
+
>
|
|
190
|
+
{connecting ? (
|
|
191
|
+
<IconLoader2 className="size-3.5 animate-spin" />
|
|
192
|
+
) : (
|
|
193
|
+
<IconPlugConnected className="size-3.5" />
|
|
194
|
+
)}
|
|
195
|
+
{connecting
|
|
196
|
+
? t("home.googleSlidesReferencePicking")
|
|
197
|
+
: t("editorExport.connectGoogle")}
|
|
198
|
+
</Button>
|
|
199
|
+
)}
|
|
200
|
+
</div>
|
|
201
|
+
);
|
|
202
|
+
}
|
|
@@ -121,23 +121,35 @@ export function GoogleSlidesReferenceImport({
|
|
|
121
121
|
|
|
122
122
|
const refreshStatus =
|
|
123
123
|
useCallback(async (): Promise<GoogleDocsStatus | null> => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
124
|
+
try {
|
|
125
|
+
const response = await fetch(
|
|
126
|
+
endpoint("/_agent-native/google-docs/status"),
|
|
127
|
+
{
|
|
128
|
+
credentials: "same-origin",
|
|
129
|
+
},
|
|
130
|
+
);
|
|
131
|
+
const result = await readJson<GoogleDocsStatus>(response);
|
|
132
|
+
if (!result.ok) throw result.error;
|
|
133
|
+
if (!response.ok) {
|
|
134
|
+
throw new Error(
|
|
135
|
+
errorFromResponse(
|
|
136
|
+
response,
|
|
137
|
+
result.data,
|
|
138
|
+
"Could not check Google Drive",
|
|
139
|
+
),
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
if (!result.data) {
|
|
143
|
+
throw new Error("Google Drive status was empty.");
|
|
144
|
+
}
|
|
145
|
+
setError(null);
|
|
136
146
|
setStatus(result.data);
|
|
137
147
|
return result.data;
|
|
148
|
+
} catch (caught) {
|
|
149
|
+
setStatus(null);
|
|
150
|
+
setError(caught instanceof Error ? caught.message : String(caught));
|
|
151
|
+
return null;
|
|
138
152
|
}
|
|
139
|
-
setStatus(null);
|
|
140
|
-
return null;
|
|
141
153
|
}, []);
|
|
142
154
|
|
|
143
155
|
useEffect(() => {
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { appBasePath } from "@agent-native/core/client/api-path";
|
|
2
2
|
import { PromptComposer } from "@agent-native/core/client/composer";
|
|
3
|
+
import { ensureEmbedAuthFetchInterceptor } from "@agent-native/core/client/host";
|
|
3
4
|
import { useT } from "@agent-native/core/client/i18n";
|
|
5
|
+
import {
|
|
6
|
+
IconBrandGoogle,
|
|
7
|
+
IconFileTypePdf,
|
|
8
|
+
IconPresentation,
|
|
9
|
+
} from "@tabler/icons-react";
|
|
4
10
|
import { useState, useEffect, useCallback, useRef } from "react";
|
|
5
11
|
import { createPortal } from "react-dom";
|
|
6
12
|
import { toast } from "sonner";
|
|
7
13
|
|
|
14
|
+
import { MAX_REFERENCE_FILE_BYTES } from "../../../shared/upload-types";
|
|
15
|
+
import { Button } from "../ui/button";
|
|
16
|
+
import { Input } from "../ui/input";
|
|
8
17
|
import { GoogleDocImportHint } from "./GoogleDocImportHint";
|
|
18
|
+
import { GoogleDriveConnectionCta } from "./GoogleDriveConnectionCta";
|
|
9
19
|
|
|
10
20
|
export interface UploadedFile {
|
|
11
21
|
path: string;
|
|
@@ -22,9 +32,11 @@ export async function uploadPromptFiles(
|
|
|
22
32
|
if (files.length === 0) return [];
|
|
23
33
|
const formData = new FormData();
|
|
24
34
|
files.forEach((file) => formData.append("files", file));
|
|
35
|
+
ensureEmbedAuthFetchInterceptor();
|
|
25
36
|
const response = await fetch(`${appBasePath()}/api/uploads`, {
|
|
26
37
|
method: "POST",
|
|
27
38
|
body: formData,
|
|
39
|
+
credentials: "include",
|
|
28
40
|
});
|
|
29
41
|
if (!response.ok) {
|
|
30
42
|
let message = "Upload failed";
|
|
@@ -61,6 +73,12 @@ export function isInsidePortaledLayer(target: EventTarget | null): boolean {
|
|
|
61
73
|
);
|
|
62
74
|
}
|
|
63
75
|
|
|
76
|
+
export type PromptImportSource = "pdf" | "pptx" | "google-slides";
|
|
77
|
+
|
|
78
|
+
export type PromptImportSelection =
|
|
79
|
+
| { kind: "pdf" | "pptx"; files: File[] }
|
|
80
|
+
| { kind: "google-slides"; url: string };
|
|
81
|
+
|
|
64
82
|
interface PromptPopoverProps {
|
|
65
83
|
open: boolean;
|
|
66
84
|
onOpenChange: (open: boolean) => void;
|
|
@@ -77,6 +95,11 @@ interface PromptPopoverProps {
|
|
|
77
95
|
initialText?: string;
|
|
78
96
|
initialTextKey?: string | number;
|
|
79
97
|
onBeforeUpload?: (prompt: string, files: File[]) => boolean | void;
|
|
98
|
+
onImport?: (
|
|
99
|
+
selection: PromptImportSelection,
|
|
100
|
+
) => Promise<boolean | void> | boolean | void;
|
|
101
|
+
importFromLabel?: string;
|
|
102
|
+
importingLabel?: string;
|
|
80
103
|
children?: React.ReactNode;
|
|
81
104
|
}
|
|
82
105
|
|
|
@@ -95,12 +118,21 @@ export default function PromptPopover({
|
|
|
95
118
|
initialText,
|
|
96
119
|
initialTextKey,
|
|
97
120
|
onBeforeUpload,
|
|
121
|
+
onImport,
|
|
122
|
+
importFromLabel,
|
|
123
|
+
importingLabel = "Importing...",
|
|
98
124
|
children,
|
|
99
125
|
}: PromptPopoverProps) {
|
|
100
126
|
const t = useT();
|
|
101
127
|
const [uploading, setUploading] = useState(false);
|
|
102
128
|
const [promptText, setPromptText] = useState("");
|
|
103
129
|
const [googleDocContext, setGoogleDocContext] = useState("");
|
|
130
|
+
const [googleSlidesUrl, setGoogleSlidesUrl] = useState("");
|
|
131
|
+
const [googleSlidesInputOpen, setGoogleSlidesInputOpen] = useState(false);
|
|
132
|
+
const [importingSource, setImportingSource] =
|
|
133
|
+
useState<PromptImportSource | null>(null);
|
|
134
|
+
const pdfInputRef = useRef<HTMLInputElement>(null);
|
|
135
|
+
const pptxInputRef = useRef<HTMLInputElement>(null);
|
|
104
136
|
const panelRef = useRef<HTMLDivElement>(null);
|
|
105
137
|
|
|
106
138
|
// Position the popover after render so we can measure its actual size
|
|
@@ -199,10 +231,48 @@ export default function PromptPopover({
|
|
|
199
231
|
[googleDocContext, onBeforeUpload, onSubmit, uploadFiles, t],
|
|
200
232
|
);
|
|
201
233
|
|
|
234
|
+
const runImport = useCallback(
|
|
235
|
+
async (selection: PromptImportSelection) => {
|
|
236
|
+
if (!onImport) return;
|
|
237
|
+
setImportingSource(selection.kind);
|
|
238
|
+
try {
|
|
239
|
+
const shouldClose = await onImport(selection);
|
|
240
|
+
if (shouldClose !== false) onOpenChange(false);
|
|
241
|
+
} catch (error) {
|
|
242
|
+
toast.error(t("raw.uploadFailed"), {
|
|
243
|
+
description:
|
|
244
|
+
error instanceof Error
|
|
245
|
+
? error.message
|
|
246
|
+
: t("raw.uploadAttachedFailed"),
|
|
247
|
+
});
|
|
248
|
+
} finally {
|
|
249
|
+
setImportingSource(null);
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
[onImport, onOpenChange, t],
|
|
253
|
+
);
|
|
254
|
+
|
|
255
|
+
const handleFileImport = useCallback(
|
|
256
|
+
(kind: "pdf" | "pptx", file: File | undefined) => {
|
|
257
|
+
if (!file) return;
|
|
258
|
+
void runImport({ kind, files: [file] });
|
|
259
|
+
},
|
|
260
|
+
[runImport],
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
const handleGoogleSlidesImport = useCallback(() => {
|
|
264
|
+
const url = googleSlidesUrl.trim();
|
|
265
|
+
if (!url) return;
|
|
266
|
+
void runImport({ kind: "google-slides", url });
|
|
267
|
+
}, [googleSlidesUrl, runImport]);
|
|
268
|
+
|
|
202
269
|
useEffect(() => {
|
|
203
270
|
if (!open) {
|
|
204
271
|
setPromptText("");
|
|
205
272
|
setGoogleDocContext("");
|
|
273
|
+
setGoogleSlidesUrl("");
|
|
274
|
+
setGoogleSlidesInputOpen(false);
|
|
275
|
+
setImportingSource(null);
|
|
206
276
|
}
|
|
207
277
|
}, [open]);
|
|
208
278
|
|
|
@@ -244,6 +314,8 @@ export default function PromptPopover({
|
|
|
244
314
|
<PromptComposer
|
|
245
315
|
autoFocus
|
|
246
316
|
attachmentsEnabled
|
|
317
|
+
maxDocumentAttachmentBytes={MAX_REFERENCE_FILE_BYTES}
|
|
318
|
+
documentAttachmentLimitLabel="Slides reference files"
|
|
247
319
|
disabled={loading || uploading}
|
|
248
320
|
placeholder={placeholder}
|
|
249
321
|
onSubmit={handleSubmit}
|
|
@@ -254,6 +326,110 @@ export default function PromptPopover({
|
|
|
254
326
|
/>
|
|
255
327
|
</div>
|
|
256
328
|
|
|
329
|
+
{onImport && importFromLabel && (
|
|
330
|
+
<div className="border-t border-border/60 px-4 pb-3 pt-2.5">
|
|
331
|
+
<div className="flex flex-wrap items-center gap-1.5">
|
|
332
|
+
<span className="mr-1 text-xs text-muted-foreground">
|
|
333
|
+
{importFromLabel}
|
|
334
|
+
</span>
|
|
335
|
+
<input
|
|
336
|
+
ref={pdfInputRef}
|
|
337
|
+
type="file"
|
|
338
|
+
accept=".pdf,application/pdf"
|
|
339
|
+
className="sr-only"
|
|
340
|
+
aria-label={t("editorToolbar.importFile")}
|
|
341
|
+
onChange={(event) => {
|
|
342
|
+
handleFileImport("pdf", event.target.files?.[0]);
|
|
343
|
+
event.target.value = "";
|
|
344
|
+
}}
|
|
345
|
+
/>
|
|
346
|
+
<input
|
|
347
|
+
ref={pptxInputRef}
|
|
348
|
+
type="file"
|
|
349
|
+
accept=".pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
350
|
+
className="sr-only"
|
|
351
|
+
aria-label={t("editorToolbar.importFile")}
|
|
352
|
+
onChange={(event) => {
|
|
353
|
+
handleFileImport("pptx", event.target.files?.[0]);
|
|
354
|
+
event.target.value = "";
|
|
355
|
+
}}
|
|
356
|
+
/>
|
|
357
|
+
<Button
|
|
358
|
+
type="button"
|
|
359
|
+
variant="ghost"
|
|
360
|
+
size="sm"
|
|
361
|
+
className="h-7 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground"
|
|
362
|
+
disabled={importingSource !== null || loading || uploading}
|
|
363
|
+
onClick={() => pdfInputRef.current?.click()}
|
|
364
|
+
>
|
|
365
|
+
<IconFileTypePdf className="size-3.5" />
|
|
366
|
+
PDF
|
|
367
|
+
</Button>
|
|
368
|
+
<Button
|
|
369
|
+
type="button"
|
|
370
|
+
variant="ghost"
|
|
371
|
+
size="sm"
|
|
372
|
+
className="h-7 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground"
|
|
373
|
+
disabled={importingSource !== null || loading || uploading}
|
|
374
|
+
onClick={() => setGoogleSlidesInputOpen((current) => !current)}
|
|
375
|
+
>
|
|
376
|
+
<IconBrandGoogle className="size-3.5" />
|
|
377
|
+
{t("home.googleSlidesReferenceTitle")}
|
|
378
|
+
</Button>
|
|
379
|
+
<Button
|
|
380
|
+
type="button"
|
|
381
|
+
variant="ghost"
|
|
382
|
+
size="sm"
|
|
383
|
+
className="h-7 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground"
|
|
384
|
+
disabled={importingSource !== null || loading || uploading}
|
|
385
|
+
onClick={() => pptxInputRef.current?.click()}
|
|
386
|
+
>
|
|
387
|
+
<IconPresentation className="size-3.5" />
|
|
388
|
+
PPT
|
|
389
|
+
</Button>
|
|
390
|
+
{importingSource && (
|
|
391
|
+
<span className="ml-auto text-xs text-muted-foreground">
|
|
392
|
+
{importingLabel}
|
|
393
|
+
</span>
|
|
394
|
+
)}
|
|
395
|
+
</div>
|
|
396
|
+
{googleSlidesInputOpen && (
|
|
397
|
+
<div className="mt-2 space-y-2">
|
|
398
|
+
<GoogleDriveConnectionCta />
|
|
399
|
+
<div className="flex gap-2">
|
|
400
|
+
<Input
|
|
401
|
+
autoFocus
|
|
402
|
+
type="url"
|
|
403
|
+
value={googleSlidesUrl}
|
|
404
|
+
placeholder={t("home.googleSlidesReferenceUrl")}
|
|
405
|
+
aria-label={t("home.googleSlidesReferenceUrl")}
|
|
406
|
+
className="h-8 text-xs"
|
|
407
|
+
disabled={importingSource !== null || loading || uploading}
|
|
408
|
+
onChange={(event) => setGoogleSlidesUrl(event.target.value)}
|
|
409
|
+
onKeyDown={(event) => {
|
|
410
|
+
if (event.key === "Enter") handleGoogleSlidesImport();
|
|
411
|
+
}}
|
|
412
|
+
/>
|
|
413
|
+
<Button
|
|
414
|
+
type="button"
|
|
415
|
+
size="sm"
|
|
416
|
+
className="h-8 shrink-0 px-3 text-xs"
|
|
417
|
+
disabled={
|
|
418
|
+
!googleSlidesUrl.trim() ||
|
|
419
|
+
importingSource !== null ||
|
|
420
|
+
loading ||
|
|
421
|
+
uploading
|
|
422
|
+
}
|
|
423
|
+
onClick={handleGoogleSlidesImport}
|
|
424
|
+
>
|
|
425
|
+
Import
|
|
426
|
+
</Button>
|
|
427
|
+
</div>
|
|
428
|
+
</div>
|
|
429
|
+
)}
|
|
430
|
+
</div>
|
|
431
|
+
)}
|
|
432
|
+
|
|
257
433
|
{children}
|
|
258
434
|
|
|
259
435
|
<GoogleDocImportHint
|