@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
|
@@ -4,6 +4,10 @@ import { and, gte, inArray, lte } from "drizzle-orm";
|
|
|
4
4
|
|
|
5
5
|
import { getDb, schema } from "../db/index.js";
|
|
6
6
|
import { hasCredential } from "./credentials.js";
|
|
7
|
+
import {
|
|
8
|
+
getFirstPartyAnalyticsBackend,
|
|
9
|
+
getFirstPartyAnalyticsBigQueryMetrics,
|
|
10
|
+
} from "./first-party-analytics-backend.js";
|
|
7
11
|
import type { AnalyticsScope } from "./first-party-analytics.js";
|
|
8
12
|
|
|
9
13
|
export const FIRST_PARTY_ANALYTICS_PRESSURE_THRESHOLDS = {
|
|
@@ -320,19 +324,30 @@ export async function getFirstPartyAnalyticsHealth(
|
|
|
320
324
|
const rollups = schema.analyticsEventDailyRollups;
|
|
321
325
|
const pressure = schema.analyticsQueryPressureDaily;
|
|
322
326
|
const db = getDb() as any;
|
|
327
|
+
const backend = await getFirstPartyAnalyticsBackend(scope);
|
|
328
|
+
|
|
329
|
+
const rollupRowsPromise =
|
|
330
|
+
backend.sink === "bigquery"
|
|
331
|
+
? getFirstPartyAnalyticsBigQueryMetrics(scope, backend.table).then(
|
|
332
|
+
(metrics) => [metrics],
|
|
333
|
+
)
|
|
334
|
+
: db
|
|
335
|
+
.select({
|
|
336
|
+
eventCount: sql<number>`coalesce(sum(${rollups.eventCount}), 0)`,
|
|
337
|
+
dailyRollupRows: sql<number>`count(*)`,
|
|
338
|
+
firstEventDate: sql<string | null>`min(${rollups.eventDate})`,
|
|
339
|
+
lastEventDate: sql<string | null>`max(${rollups.eventDate})`,
|
|
340
|
+
})
|
|
341
|
+
.from(rollups)
|
|
342
|
+
.where(
|
|
343
|
+
and(
|
|
344
|
+
inArray(rollups.tenantKey, keys),
|
|
345
|
+
lte(rollups.eventDate, today),
|
|
346
|
+
),
|
|
347
|
+
);
|
|
323
348
|
|
|
324
349
|
const [rollupRows, pressureRows, externalBackends] = await Promise.all([
|
|
325
|
-
|
|
326
|
-
.select({
|
|
327
|
-
eventCount: sql<number>`coalesce(sum(${rollups.eventCount}), 0)`,
|
|
328
|
-
dailyRollupRows: sql<number>`count(*)`,
|
|
329
|
-
firstEventDate: sql<string | null>`min(${rollups.eventDate})`,
|
|
330
|
-
lastEventDate: sql<string | null>`max(${rollups.eventDate})`,
|
|
331
|
-
})
|
|
332
|
-
.from(rollups)
|
|
333
|
-
.where(
|
|
334
|
-
and(inArray(rollups.tenantKey, keys), lte(rollups.eventDate, today)),
|
|
335
|
-
),
|
|
350
|
+
rollupRowsPromise,
|
|
336
351
|
db
|
|
337
352
|
.select({
|
|
338
353
|
queryClass: pressure.queryClass,
|
|
@@ -409,11 +424,15 @@ export async function getFirstPartyAnalyticsHealth(
|
|
|
409
424
|
FIRST_PARTY_ANALYTICS_PRESSURE_THRESHOLDS.recommendEventCount / 4 ||
|
|
410
425
|
slowQueryCount24h > 0;
|
|
411
426
|
const status: FirstPartyAnalyticsHealthStatus =
|
|
412
|
-
|
|
413
|
-
?
|
|
414
|
-
: hasMonitorSignal
|
|
427
|
+
backend.sink === "bigquery"
|
|
428
|
+
? slowQueryCount24h > 0 || timeoutCount24h > 0
|
|
415
429
|
? "monitor"
|
|
416
|
-
: "healthy"
|
|
430
|
+
: "healthy"
|
|
431
|
+
: reasons.length > 0
|
|
432
|
+
? "recommend_bigquery"
|
|
433
|
+
: hasMonitorSignal
|
|
434
|
+
? "monitor"
|
|
435
|
+
: "healthy";
|
|
417
436
|
|
|
418
437
|
return {
|
|
419
438
|
status,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getDbExec } from "@agent-native/core/db";
|
|
2
|
+
import { runWithRequestContext } from "@agent-native/core/server";
|
|
2
3
|
import { and, eq, isNull, or } from "drizzle-orm";
|
|
3
4
|
|
|
4
5
|
import { FIRST_PARTY_ANALYTICS_QUERY_TIMEOUT_MS } from "../../shared/dashboard-report-timeouts.js";
|
|
@@ -8,6 +9,12 @@ import {
|
|
|
8
9
|
ingestAnalyticsExceptionEvents,
|
|
9
10
|
type DerivedExceptionFields,
|
|
10
11
|
} from "./error-capture.js";
|
|
12
|
+
import {
|
|
13
|
+
getFirstPartyAnalyticsBackend,
|
|
14
|
+
getFirstPartyAnalyticsTable,
|
|
15
|
+
insertFirstPartyAnalyticsRows,
|
|
16
|
+
queryFirstPartyAnalyticsInBigQuery,
|
|
17
|
+
} from "./first-party-analytics-backend.js";
|
|
11
18
|
import {
|
|
12
19
|
firstPartyCacheKey,
|
|
13
20
|
withFirstPartyCache,
|
|
@@ -504,11 +511,33 @@ export async function recordAnalyticsEvents(
|
|
|
504
511
|
};
|
|
505
512
|
});
|
|
506
513
|
|
|
507
|
-
|
|
514
|
+
const backend = await getFirstPartyAnalyticsBackend({
|
|
515
|
+
userEmail: key.ownerEmail,
|
|
516
|
+
orgId: key.orgId ?? null,
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
if (rows.length && (backend.sink === "dual" || backend.sink === "bigquery")) {
|
|
520
|
+
try {
|
|
521
|
+
await runWithRequestContext(
|
|
522
|
+
{
|
|
523
|
+
userEmail: key.ownerEmail,
|
|
524
|
+
orgId: key.orgId ?? undefined,
|
|
525
|
+
},
|
|
526
|
+
() => insertFirstPartyAnalyticsRows(rows, backend.table),
|
|
527
|
+
);
|
|
528
|
+
} catch (error) {
|
|
529
|
+
if (backend.sink === "bigquery") throw error;
|
|
530
|
+
// Dual-write mode keeps Postgres as the recoverable source until the
|
|
531
|
+
// backfill has completed. A BigQuery outage must not lose live events.
|
|
532
|
+
console.error(
|
|
533
|
+
"[first-party-analytics] BigQuery dual-write failed; retaining Postgres event:",
|
|
534
|
+
error,
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
if (rows.length && backend.sink !== "bigquery") {
|
|
508
540
|
await db.transaction(async (tx: any) => {
|
|
509
|
-
// Raw events and incremental rollups share this transaction. The
|
|
510
|
-
// historical boot backfill is disabled, so no global cross-request lock
|
|
511
|
-
// is needed to coordinate a second writer.
|
|
512
541
|
await tx.insert(schema.analyticsEvents).values(rows);
|
|
513
542
|
await tx
|
|
514
543
|
.update(schema.analyticsPublicKeys)
|
|
@@ -517,6 +546,12 @@ export async function recordAnalyticsEvents(
|
|
|
517
546
|
await upsertFirstPartyAnalyticsRollups(rows, tx);
|
|
518
547
|
});
|
|
519
548
|
}
|
|
549
|
+
if (rows.length && backend.sink === "bigquery") {
|
|
550
|
+
await db
|
|
551
|
+
.update(schema.analyticsPublicKeys)
|
|
552
|
+
.set({ lastUsedAt: receivedAt })
|
|
553
|
+
.where(eq(schema.analyticsPublicKeys.id, key.id));
|
|
554
|
+
}
|
|
520
555
|
|
|
521
556
|
// Fork captured exceptions into the dedicated error-capture tables. This is
|
|
522
557
|
// best-effort: a malformed `$exception` payload must never reject the whole
|
|
@@ -973,6 +1008,24 @@ export async function queryFirstPartyAnalytics(
|
|
|
973
1008
|
options: AnalyticsQueryOptions = {},
|
|
974
1009
|
): Promise<AnalyticsQueryResult> {
|
|
975
1010
|
validateFirstPartyAnalyticsSql(sql);
|
|
1011
|
+
const backend = await getFirstPartyAnalyticsBackend(scope);
|
|
1012
|
+
if (backend.sink === "bigquery") {
|
|
1013
|
+
const usesSessionRecordings = /\bsession_recordings\b/i.test(sql);
|
|
1014
|
+
const usesEventTables =
|
|
1015
|
+
/\banalytics_events\b|\banalytics_event_daily_rollups\b|\banalytics_user_days\b/i.test(
|
|
1016
|
+
sql,
|
|
1017
|
+
);
|
|
1018
|
+
if (usesSessionRecordings && usesEventTables) {
|
|
1019
|
+
throw new Error(
|
|
1020
|
+
"Cross-backend joins are not supported; query first-party event tables in BigQuery and session_recordings in the Analytics SQL store separately.",
|
|
1021
|
+
);
|
|
1022
|
+
}
|
|
1023
|
+
if (!usesSessionRecordings) {
|
|
1024
|
+
const table = await getFirstPartyAnalyticsTable(backend.table);
|
|
1025
|
+
const scoped = scopedAnalyticsSql(sql, scope);
|
|
1026
|
+
return queryFirstPartyAnalyticsInBigQuery(scoped.sql, scoped.args, table);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
976
1029
|
const scoped = scopedAnalyticsSql(sql, scope);
|
|
977
1030
|
const wrappedSql = `SELECT * FROM (${scoped.sql}) AS first_party_analytics_query LIMIT ${MAX_QUERY_ROWS}`;
|
|
978
1031
|
const timeoutMs = Math.max(
|
|
@@ -10,6 +10,7 @@ export const NATIVE_V2_DASHBOARD_IDS = [
|
|
|
10
10
|
"account-engagement-v2",
|
|
11
11
|
"cross-sell-v2",
|
|
12
12
|
"win-loss-v2",
|
|
13
|
+
"on-demand-billing-v2",
|
|
13
14
|
] as const;
|
|
14
15
|
|
|
15
16
|
export type NativeV2DashboardId = (typeof NATIVE_V2_DASHBOARD_IDS)[number];
|
|
@@ -29,7 +30,16 @@ export type NativeV2BindingKey =
|
|
|
29
30
|
| "win_loss.summary"
|
|
30
31
|
| "win_loss.reasons"
|
|
31
32
|
| "win_loss.evidence"
|
|
32
|
-
| "win_loss.alerts"
|
|
33
|
+
| "win_loss.alerts"
|
|
34
|
+
| "billing.visual_views.summary"
|
|
35
|
+
| "billing.visual_views.trend"
|
|
36
|
+
| "billing.visual_views.overage"
|
|
37
|
+
| "billing.visual_views.growth"
|
|
38
|
+
| "billing.visual_views.insights"
|
|
39
|
+
| "billing.agent_credits.summary"
|
|
40
|
+
| "billing.agent_credits.trend"
|
|
41
|
+
| "billing.agent_credits.overage"
|
|
42
|
+
| "billing.agent_credits.insights";
|
|
33
43
|
|
|
34
44
|
export interface NativeV2Binding {
|
|
35
45
|
programId: string;
|
|
@@ -387,6 +397,222 @@ export const nativeV2DashboardManifests: readonly NativeV2DashboardManifest[] =
|
|
|
387
397
|
}),
|
|
388
398
|
],
|
|
389
399
|
},
|
|
400
|
+
{
|
|
401
|
+
id: "on-demand-billing-v2",
|
|
402
|
+
name: "On Demand Billing v2",
|
|
403
|
+
description:
|
|
404
|
+
"Native on-demand billing dashboard for Visual Views and Agent Credits: usage, rollover, overage, growth signals, and billing insights.",
|
|
405
|
+
category: "Operations",
|
|
406
|
+
tags: [
|
|
407
|
+
"native",
|
|
408
|
+
"v2",
|
|
409
|
+
"billing",
|
|
410
|
+
"on-demand",
|
|
411
|
+
"visual-views",
|
|
412
|
+
"agent-credits",
|
|
413
|
+
],
|
|
414
|
+
requiredBindings: [
|
|
415
|
+
"billing.visual_views.summary",
|
|
416
|
+
"billing.visual_views.trend",
|
|
417
|
+
"billing.visual_views.overage",
|
|
418
|
+
"billing.visual_views.growth",
|
|
419
|
+
"billing.visual_views.insights",
|
|
420
|
+
"billing.agent_credits.summary",
|
|
421
|
+
"billing.agent_credits.trend",
|
|
422
|
+
"billing.agent_credits.overage",
|
|
423
|
+
"billing.agent_credits.insights",
|
|
424
|
+
],
|
|
425
|
+
panels: [
|
|
426
|
+
section(
|
|
427
|
+
"billing-visual-views-overview",
|
|
428
|
+
"Visual Views",
|
|
429
|
+
"Visual Views / Overview",
|
|
430
|
+
),
|
|
431
|
+
boundPanel({
|
|
432
|
+
id: "billing-visual-views-summary",
|
|
433
|
+
title: "Visual Views summary",
|
|
434
|
+
bindingKey: "billing.visual_views.summary",
|
|
435
|
+
chartType: "metric",
|
|
436
|
+
width: 1,
|
|
437
|
+
tab: "Visual Views / Overview",
|
|
438
|
+
config: {
|
|
439
|
+
yKey: "value",
|
|
440
|
+
yFormatter: "number",
|
|
441
|
+
description:
|
|
442
|
+
"Current Visual Views usage or contracted allowance, as emitted by the bound program.",
|
|
443
|
+
},
|
|
444
|
+
requiredColumns: ["value"],
|
|
445
|
+
}),
|
|
446
|
+
boundPanel({
|
|
447
|
+
id: "billing-visual-views-trend",
|
|
448
|
+
title: "Usage over time",
|
|
449
|
+
bindingKey: "billing.visual_views.trend",
|
|
450
|
+
chartType: "area",
|
|
451
|
+
width: 3,
|
|
452
|
+
tab: "Visual Views / Overview",
|
|
453
|
+
config: {
|
|
454
|
+
xKey: "month",
|
|
455
|
+
yKeys: ["actual", "contracted", "rollover"],
|
|
456
|
+
yFormatter: "number",
|
|
457
|
+
legend: true,
|
|
458
|
+
},
|
|
459
|
+
requiredColumns: ["month", "actual", "contracted", "rollover"],
|
|
460
|
+
}),
|
|
461
|
+
boundPanel({
|
|
462
|
+
id: "billing-visual-views-insights",
|
|
463
|
+
title: "Billing insights",
|
|
464
|
+
bindingKey: "billing.visual_views.insights",
|
|
465
|
+
chartType: "callout",
|
|
466
|
+
width: 3,
|
|
467
|
+
tab: "Visual Views / Overview",
|
|
468
|
+
requiredColumns: ["severity", "message"],
|
|
469
|
+
}),
|
|
470
|
+
boundPanel({
|
|
471
|
+
id: "billing-visual-views-overage",
|
|
472
|
+
title: "Overage and rollover",
|
|
473
|
+
bindingKey: "billing.visual_views.overage",
|
|
474
|
+
chartType: "table",
|
|
475
|
+
width: 3,
|
|
476
|
+
tab: "Visual Views / Overage",
|
|
477
|
+
config: {
|
|
478
|
+
columns: [
|
|
479
|
+
{ key: "company_name", label: "Company" },
|
|
480
|
+
{ key: "month", label: "Month", format: "date" },
|
|
481
|
+
{ key: "actual", label: "Actual", format: "number" },
|
|
482
|
+
{ key: "contracted", label: "Contracted", format: "number" },
|
|
483
|
+
{ key: "rollover", label: "Rollover", format: "number" },
|
|
484
|
+
{
|
|
485
|
+
key: "newAllowance",
|
|
486
|
+
label: "New allowance",
|
|
487
|
+
format: "number",
|
|
488
|
+
},
|
|
489
|
+
{ key: "overage", label: "Overage", format: "number" },
|
|
490
|
+
{
|
|
491
|
+
key: "overageRate",
|
|
492
|
+
label: "Overage rate",
|
|
493
|
+
format: "currency",
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
key: "overageBilled",
|
|
497
|
+
label: "Overage billed",
|
|
498
|
+
format: "currency",
|
|
499
|
+
},
|
|
500
|
+
],
|
|
501
|
+
limit: 100,
|
|
502
|
+
},
|
|
503
|
+
requiredColumns: [
|
|
504
|
+
"company_name",
|
|
505
|
+
"month",
|
|
506
|
+
"actual",
|
|
507
|
+
"contracted",
|
|
508
|
+
"rollover",
|
|
509
|
+
"newAllowance",
|
|
510
|
+
"overage",
|
|
511
|
+
"overageRate",
|
|
512
|
+
"overageBilled",
|
|
513
|
+
],
|
|
514
|
+
}),
|
|
515
|
+
boundPanel({
|
|
516
|
+
id: "billing-visual-views-growth",
|
|
517
|
+
title: "High growth companies",
|
|
518
|
+
bindingKey: "billing.visual_views.growth",
|
|
519
|
+
chartType: "table",
|
|
520
|
+
width: 3,
|
|
521
|
+
tab: "Visual Views / Growth",
|
|
522
|
+
config: { limit: 100 },
|
|
523
|
+
requiredColumns: [],
|
|
524
|
+
}),
|
|
525
|
+
section(
|
|
526
|
+
"billing-agent-credits-overview",
|
|
527
|
+
"Agent Credits",
|
|
528
|
+
"Agent Credits / Overview",
|
|
529
|
+
),
|
|
530
|
+
boundPanel({
|
|
531
|
+
id: "billing-agent-credits-summary",
|
|
532
|
+
title: "Agent Credits summary",
|
|
533
|
+
bindingKey: "billing.agent_credits.summary",
|
|
534
|
+
chartType: "metric",
|
|
535
|
+
width: 1,
|
|
536
|
+
tab: "Agent Credits / Overview",
|
|
537
|
+
config: {
|
|
538
|
+
yKey: "value",
|
|
539
|
+
yFormatter: "number",
|
|
540
|
+
description:
|
|
541
|
+
"Current Agent Credits usage or contracted allowance, as emitted by the bound program.",
|
|
542
|
+
},
|
|
543
|
+
requiredColumns: ["value"],
|
|
544
|
+
}),
|
|
545
|
+
boundPanel({
|
|
546
|
+
id: "billing-agent-credits-trend",
|
|
547
|
+
title: "Credits over time",
|
|
548
|
+
bindingKey: "billing.agent_credits.trend",
|
|
549
|
+
chartType: "area",
|
|
550
|
+
width: 3,
|
|
551
|
+
tab: "Agent Credits / Overview",
|
|
552
|
+
config: {
|
|
553
|
+
xKey: "month",
|
|
554
|
+
yKeys: ["actual", "contracted", "rollover"],
|
|
555
|
+
yFormatter: "number",
|
|
556
|
+
legend: true,
|
|
557
|
+
},
|
|
558
|
+
requiredColumns: ["month", "actual", "contracted", "rollover"],
|
|
559
|
+
}),
|
|
560
|
+
boundPanel({
|
|
561
|
+
id: "billing-agent-credits-insights",
|
|
562
|
+
title: "Billing insights",
|
|
563
|
+
bindingKey: "billing.agent_credits.insights",
|
|
564
|
+
chartType: "callout",
|
|
565
|
+
width: 3,
|
|
566
|
+
tab: "Agent Credits / Overview",
|
|
567
|
+
requiredColumns: ["severity", "message"],
|
|
568
|
+
}),
|
|
569
|
+
boundPanel({
|
|
570
|
+
id: "billing-agent-credits-overage",
|
|
571
|
+
title: "Overage and rollover",
|
|
572
|
+
bindingKey: "billing.agent_credits.overage",
|
|
573
|
+
chartType: "table",
|
|
574
|
+
width: 3,
|
|
575
|
+
tab: "Agent Credits / Overage",
|
|
576
|
+
config: {
|
|
577
|
+
columns: [
|
|
578
|
+
{ key: "company_name", label: "Company" },
|
|
579
|
+
{ key: "month", label: "Month", format: "date" },
|
|
580
|
+
{ key: "actual", label: "Actual", format: "number" },
|
|
581
|
+
{ key: "contracted", label: "Contracted", format: "number" },
|
|
582
|
+
{ key: "rollover", label: "Rollover", format: "number" },
|
|
583
|
+
{
|
|
584
|
+
key: "newAllowance",
|
|
585
|
+
label: "New allowance",
|
|
586
|
+
format: "number",
|
|
587
|
+
},
|
|
588
|
+
{ key: "overage", label: "Overage", format: "number" },
|
|
589
|
+
{
|
|
590
|
+
key: "overageRate",
|
|
591
|
+
label: "Overage rate",
|
|
592
|
+
format: "currency",
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
key: "overageBilled",
|
|
596
|
+
label: "Overage billed",
|
|
597
|
+
format: "currency",
|
|
598
|
+
},
|
|
599
|
+
],
|
|
600
|
+
limit: 100,
|
|
601
|
+
},
|
|
602
|
+
requiredColumns: [
|
|
603
|
+
"company_name",
|
|
604
|
+
"month",
|
|
605
|
+
"actual",
|
|
606
|
+
"contracted",
|
|
607
|
+
"rollover",
|
|
608
|
+
"newAllowance",
|
|
609
|
+
"overage",
|
|
610
|
+
"overageRate",
|
|
611
|
+
"overageBilled",
|
|
612
|
+
],
|
|
613
|
+
}),
|
|
614
|
+
],
|
|
615
|
+
},
|
|
390
616
|
] as const;
|
|
391
617
|
|
|
392
618
|
export function getNativeV2DashboardManifest(
|
|
@@ -65,7 +65,7 @@ export const CORPUS_REDUCTION_ACTIONS = new Set(["run-code"]);
|
|
|
65
65
|
// hasDataQueryAttempt, but they should stop the guard from steering a
|
|
66
66
|
// template-clone turn into "connect a missing source". Deliberately limited
|
|
67
67
|
// to read/inspection actions: update-dashboard/mutate-dashboard/
|
|
68
|
-
// compose-dashboard/
|
|
68
|
+
// compose-dashboard/create-extension/
|
|
69
69
|
// update-extension can all author brand-new SQL or extension content, so
|
|
70
70
|
// calling one of those alone is not proof the turn actually inspected a
|
|
71
71
|
// template rather than inventing it from scratch. If the tool run also
|
|
@@ -74,7 +74,6 @@ export const CORPUS_REDUCTION_ACTIONS = new Set(["run-code"]);
|
|
|
74
74
|
export const DASHBOARD_CONSTRUCTION_ACTIONS = new Set([
|
|
75
75
|
"get-sql-dashboard",
|
|
76
76
|
"list-sql-dashboards",
|
|
77
|
-
"list-dashboard-templates",
|
|
78
77
|
"list-extensions",
|
|
79
78
|
"get-extension",
|
|
80
79
|
]);
|
|
@@ -88,7 +87,6 @@ export const DASHBOARD_MUTATION_ACTIONS = new Set([
|
|
|
88
87
|
"mutate-dashboard",
|
|
89
88
|
"update-dashboard",
|
|
90
89
|
"compose-dashboard",
|
|
91
|
-
"install-dashboard-template",
|
|
92
90
|
"create-extension",
|
|
93
91
|
"update-extension",
|
|
94
92
|
]);
|
|
@@ -10,6 +10,7 @@ import actionsRegistry from "../../.generated/actions-registry.js";
|
|
|
10
10
|
import { INITIAL_TOOL_NAMES } from "../lib/agent-chat-plan-mode";
|
|
11
11
|
import { ANALYTICS_CONNECTOR_CATALOG } from "../lib/analytics-connector-catalog";
|
|
12
12
|
import { credentialProviderConfigs } from "../lib/credential-keys";
|
|
13
|
+
import { isProductionServerlessRuntime } from "../lib/production-serverless-runtime.js";
|
|
13
14
|
import {
|
|
14
15
|
draftClaimsAnalyticsMetrics,
|
|
15
16
|
failedDataQueryAttemptMessage,
|
|
@@ -53,7 +54,6 @@ function hasSuccessfulDashboardSave(
|
|
|
53
54
|
"update-dashboard",
|
|
54
55
|
"mutate-dashboard",
|
|
55
56
|
"compose-dashboard",
|
|
56
|
-
"install-dashboard-template",
|
|
57
57
|
]);
|
|
58
58
|
return (toolResults ?? []).some((result) => {
|
|
59
59
|
if (result.isError) return false;
|
|
@@ -737,9 +737,8 @@ export function realDataFinalGuard(
|
|
|
737
737
|
'This is a dashboard construction/template-clone request. Resolve the named template\'s id (use `list-sql-dashboards` if you only have a title) and call `get-sql-dashboard` with `includeConfig: true` first. If its panels are `chartType: "extension"`, use `get-extension` then `create-extension` to clone/adapt it, then `update-dashboard` to save the new dashboard. Do not invent SQL panels for an extension-backed template. Ask one clarifying filter question if needed. Only run a data-source query before presenting numbers or authoring invented SQL.',
|
|
738
738
|
fallbackMessage:
|
|
739
739
|
"I need to inspect the template dashboard (and its extension, if it uses one) before creating the new one. Tell me the template dashboard name, or confirm the org/account filter, and I'll clone it without inventing metrics.",
|
|
740
|
-
//
|
|
741
|
-
//
|
|
742
|
-
// the lookup/inspection tools this message asks for.
|
|
740
|
+
// Expand the tool surface so a corrective retry can always reach the
|
|
741
|
+
// lookup/inspection tools this message asks for.
|
|
743
742
|
expandToolSurface: true,
|
|
744
743
|
};
|
|
745
744
|
}
|
|
@@ -883,6 +882,10 @@ export async function searchDashboardMentions(query: string, event?: any) {
|
|
|
883
882
|
|
|
884
883
|
export default createAgentChatPlugin({
|
|
885
884
|
appId: "analytics",
|
|
885
|
+
// Resource prompt hydration performs additive schema checks. Keep that
|
|
886
|
+
// work out of production serverless cold starts; it is not needed for the
|
|
887
|
+
// dashboard's domain prompt and can contend with the request's DB queries.
|
|
888
|
+
leanPrompt: isProductionServerlessRuntime(),
|
|
886
889
|
actions: loadActionsFromStaticRegistry(actionsRegistry),
|
|
887
890
|
initialToolNames: INITIAL_TOOL_NAMES,
|
|
888
891
|
corpusTools: "lazy",
|
|
@@ -13,6 +13,7 @@ function platformSchedulerOwnsBackfill(): boolean {
|
|
|
13
13
|
return (
|
|
14
14
|
process.env.NETLIFY === "true" ||
|
|
15
15
|
Boolean(process.env.NETLIFY_FUNCTION_NAME) ||
|
|
16
|
+
process.env.NITRO_PRESET === "netlify" ||
|
|
16
17
|
globalThis.__AGENT_NATIVE_ANALYTICS_ROLLUP_BACKFILL_SCHEDULED_RUNTIME__ ===
|
|
17
18
|
true
|
|
18
19
|
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
deferMigration,
|
|
3
2
|
ensureAdditiveColumns,
|
|
4
3
|
getDbExec,
|
|
5
4
|
runMigrations,
|
|
@@ -10,8 +9,7 @@ import { isInBackgroundFunctionRuntime } from "@agent-native/core/server";
|
|
|
10
9
|
// startup so the dashboard / analysis share actions know where to dispatch.
|
|
11
10
|
import "../db/index.js";
|
|
12
11
|
import * as schema from "../db/schema.js";
|
|
13
|
-
import {
|
|
14
|
-
import { repairPersistedFirstPartyDashboardQueries } from "../lib/first-party-dashboard-repair.js";
|
|
12
|
+
import { isProductionServerlessRuntime } from "../lib/production-serverless-runtime.js";
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
* Every Drizzle table exported from schema.ts. Filters out type-only and
|
|
@@ -1407,11 +1405,9 @@ const runAnalyticsMigrations = runMigrations(
|
|
|
1407
1405
|
version: 134,
|
|
1408
1406
|
name: "analytics-rollups-historical-backfill-repair",
|
|
1409
1407
|
sql: {},
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
}
|
|
1414
|
-
},
|
|
1408
|
+
// The historical rebuild is an out-of-band job. Do not defer this
|
|
1409
|
+
// marker until it completes: a pending named migration is retried by
|
|
1410
|
+
// every cold start and turns a recoverable backfill into a boot blocker.
|
|
1415
1411
|
},
|
|
1416
1412
|
{
|
|
1417
1413
|
version: 135,
|
|
@@ -1421,6 +1417,28 @@ const runAnalyticsMigrations = runMigrations(
|
|
|
1421
1417
|
ALTER TABLE analytics_rollup_backfill_state ADD COLUMN IF NOT EXISTS lease_expires_at TEXT;
|
|
1422
1418
|
`,
|
|
1423
1419
|
},
|
|
1420
|
+
{
|
|
1421
|
+
version: 136,
|
|
1422
|
+
name: "analytics-events-backfill-cursor-indexes",
|
|
1423
|
+
sql: {
|
|
1424
|
+
postgres: `CREATE INDEX CONCURRENTLY IF NOT EXISTS analytics_events_org_received_id_idx ON analytics_events (org_id, received_at, id); CREATE INDEX CONCURRENTLY IF NOT EXISTS analytics_events_owner_received_id_idx ON analytics_events (owner_email, received_at, id) WHERE org_id IS NULL`,
|
|
1425
|
+
sqlite: `CREATE INDEX IF NOT EXISTS analytics_events_org_received_id_idx ON analytics_events (org_id, received_at, id); CREATE INDEX IF NOT EXISTS analytics_events_owner_received_id_idx ON analytics_events (owner_email, received_at, id) WHERE org_id IS NULL`,
|
|
1426
|
+
},
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
version: 137,
|
|
1430
|
+
name: "dashboard-name-locks",
|
|
1431
|
+
sql: {
|
|
1432
|
+
postgres: `CREATE TABLE IF NOT EXISTS dashboard_name_locks (
|
|
1433
|
+
name_key TEXT PRIMARY KEY,
|
|
1434
|
+
created_at TEXT NOT NULL DEFAULT (now()::text)
|
|
1435
|
+
)`,
|
|
1436
|
+
sqlite: `CREATE TABLE IF NOT EXISTS dashboard_name_locks (
|
|
1437
|
+
name_key TEXT PRIMARY KEY,
|
|
1438
|
+
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
1439
|
+
)`,
|
|
1440
|
+
},
|
|
1441
|
+
},
|
|
1424
1442
|
],
|
|
1425
1443
|
{ table: "analytics_migrations" },
|
|
1426
1444
|
);
|
|
@@ -1452,18 +1470,34 @@ export default async (nitroApp: any): Promise<void> => {
|
|
|
1452
1470
|
);
|
|
1453
1471
|
return;
|
|
1454
1472
|
}
|
|
1473
|
+
const isNetlifyServerlessRuntime =
|
|
1474
|
+
isProductionServerlessRuntime() ||
|
|
1475
|
+
process.env.NETLIFY === "true" ||
|
|
1476
|
+
Boolean(process.env.NETLIFY_FUNCTION_NAME) ||
|
|
1477
|
+
Boolean(process.env.AWS_LAMBDA_FUNCTION_NAME) ||
|
|
1478
|
+
Boolean(process.env.LAMBDA_TASK_ROOT);
|
|
1479
|
+
if (
|
|
1480
|
+
isNetlifyServerlessRuntime &&
|
|
1481
|
+
process.env.ANALYTICS_SKIP_BOOT_MIGRATIONS === "1"
|
|
1482
|
+
) {
|
|
1483
|
+
console.info(
|
|
1484
|
+
"[db] Skipping Analytics migrations in production serverless runtime by explicit incident flag",
|
|
1485
|
+
);
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
|
+
// The schema must exist before the first query. Measured cost on this
|
|
1489
|
+
// database (180 tables): ~5.5s for the version check alone, which is why the
|
|
1490
|
+
// serverless runtime skips this entirely via ANALYTICS_SKIP_BOOT_MIGRATIONS
|
|
1491
|
+
// above rather than paying it on every cold start.
|
|
1492
|
+
// guard:allow-boot-data-work — schema must exist before the first query
|
|
1455
1493
|
await runAnalyticsMigrations(nitroApp);
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
}
|
|
1462
|
-
} catch (err) {
|
|
1463
|
-
console.warn(
|
|
1464
|
-
"[db] Failed to repair canonical first-party dashboard queries (non-fatal):",
|
|
1465
|
-
err instanceof Error ? err.message : err,
|
|
1494
|
+
if (isNetlifyServerlessRuntime) {
|
|
1495
|
+
// The migration list is authoritative; repeating repair and schema
|
|
1496
|
+
// introspection on every function cold start only adds pool pressure.
|
|
1497
|
+
console.info(
|
|
1498
|
+
"[db] Skipping post-migration schema convergence in production serverless runtime",
|
|
1466
1499
|
);
|
|
1500
|
+
return;
|
|
1467
1501
|
}
|
|
1468
1502
|
try {
|
|
1469
1503
|
const summary = await ensureAdditiveColumns({
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
name: asset-generation
|
|
3
3
|
description: >-
|
|
4
4
|
Use Assets for brand-safe image or video generation, human picker UI,
|
|
5
|
-
search/list/export actions, and cross-app asset selection.
|
|
5
|
+
search/list/export actions, and cross-app asset selection. Use when a visual
|
|
6
|
+
needs to be generated, refined, found, or handed off to another app.
|
|
6
7
|
metadata:
|
|
7
8
|
visibility: both
|
|
8
9
|
---
|
|
@@ -14,6 +15,24 @@ metadata:
|
|
|
14
15
|
Use the Assets app when a workflow needs reusable brand media, a human picker,
|
|
15
16
|
or generated image/video assets that another app can reference by ID and URL.
|
|
16
17
|
|
|
18
|
+
## Visual authority and brief
|
|
19
|
+
|
|
20
|
+
Assets produces media; it does not invent a replacement brand language. Before
|
|
21
|
+
generating, resolve the user's explicit subject, audience, message, format, and
|
|
22
|
+
must-preserve constraints, then the active library, preset, or linked design
|
|
23
|
+
system and its custom instructions, then approved Creative Context references.
|
|
24
|
+
Impeccable-inspired guidance is a quality lens for composition, hierarchy,
|
|
25
|
+
restraint, and finish — never a reason to override those sources.
|
|
26
|
+
|
|
27
|
+
Compile the request into a short art-direction brief: visual role, subject,
|
|
28
|
+
composition and crop, palette or material treatment, lighting or medium,
|
|
29
|
+
exact visible text if any, semantic constraints, and exclusions. Classify the
|
|
30
|
+
slot as `produce` (new media), `direct` (an existing approved asset), or
|
|
31
|
+
`semantic` (a UI/icon/diagram the caller should build with its own primitives).
|
|
32
|
+
Do not generate a decorative photo where the caller needs a semantic graphic.
|
|
33
|
+
If brand context is missing, make the result clearly exploratory rather than
|
|
34
|
+
claiming a brand match.
|
|
35
|
+
|
|
17
36
|
## Choose The Path
|
|
18
37
|
|
|
19
38
|
- Use `generate-asset` when a person should get newly generated, on-brand image
|
|
@@ -27,8 +46,9 @@ or generated image/video assets that another app can reference by ID and URL.
|
|
|
27
46
|
Pass `mediaType: "image"` by default, or `mediaType: "video"` for video
|
|
28
47
|
libraries.
|
|
29
48
|
- Use unattended actions when the agent already knows what to do:
|
|
30
|
-
`search-assets`, `list-assets`, `
|
|
31
|
-
`generate-video`, `refresh-generation-run`, and
|
|
49
|
+
`search-assets`, `list-assets`, `import-style-from-url`, `generate-image`,
|
|
50
|
+
`generate-image-batch`, `generate-video`, `refresh-generation-run`, and
|
|
51
|
+
`export-asset`.
|
|
32
52
|
- In chat, consume composer `@` references as structured generation inputs:
|
|
33
53
|
`brand-kit` maps to `libraryId`, `preset` maps to `presetId`, and
|
|
34
54
|
`media-type` chooses image generation versus video generation. If no mention
|
|
@@ -75,7 +95,9 @@ or generated image/video assets that another app can reference by ID and URL.
|
|
|
75
95
|
6. Let the server choose a small deterministic reference set unless the user
|
|
76
96
|
named exact assets. Canonical style anchors come from
|
|
77
97
|
`assetLibraries.settings.canonicalStyleAssetIds` and
|
|
78
|
-
`assets.metadata.isStyleAnchor
|
|
98
|
+
`assets.metadata.isStyleAnchor`; they must remain subordinate to explicit
|
|
99
|
+
library, preset, and per-run constraints rather than introducing a second
|
|
100
|
+
visual language.
|
|
79
101
|
7. Pass `tier: "fast"` for exploration, `tier: "best"` for final/high-value
|
|
80
102
|
output, or `tier: "auto"` when there is no clear preference.
|
|
81
103
|
- Model/ratio compatibility: Gemini image models accept any `aspectRatio`, but
|
|
@@ -94,10 +116,16 @@ or generated image/video assets that another app can reference by ID and URL.
|
|
|
94
116
|
when they want a chat preloaded with the session context.
|
|
95
117
|
|
|
96
118
|
For short vague prompts, enhance conservatively with library style context while
|
|
97
|
-
preserving the user's original prompt in run metadata.
|
|
98
|
-
`
|
|
99
|
-
|
|
100
|
-
|
|
119
|
+
preserving the user's original prompt in run metadata. If a public website is
|
|
120
|
+
the style source, call `import-style-from-url` first so the library keeps the
|
|
121
|
+
hydrated browser-derived design brief. Use `analyze-collection-style` when a
|
|
122
|
+
collection needs upgraded vision brand analysis from image references before
|
|
123
|
+
generation. Brand QA scoring and best-of-N selection are deferred.
|
|
124
|
+
|
|
125
|
+
Generation success confirms a run and its provenance, not visual quality or
|
|
126
|
+
brand match. Report the selected library, preset, style anchors, and whether
|
|
127
|
+
the result used an Assets-grounded or fallback path. Claim a quality evaluator
|
|
128
|
+
only when one actually ran.
|
|
101
129
|
|
|
102
130
|
## Video Workflows
|
|
103
131
|
|