@agent-native/core 0.97.0 → 0.98.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/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +32 -0
- package/corpus/core/docs/content/authentication.mdx +3 -3
- package/corpus/core/docs/content/doctor.mdx +170 -0
- package/corpus/core/docs/content/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/security.mdx +2 -0
- package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/security.mdx +2 -0
- package/corpus/core/docs/content/locales/es-ES/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/security.mdx +2 -0
- package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/security.mdx +2 -0
- package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/security.mdx +2 -0
- package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/security.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/security.mdx +2 -0
- package/corpus/core/docs/content/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/security.mdx +2 -0
- package/corpus/core/package.json +5 -1
- package/corpus/core/scripts/finalize-build.mjs +63 -3
- package/corpus/core/scripts/materialize-source-corpus.mjs +101 -15
- package/corpus/core/src/action.ts +42 -0
- package/corpus/core/src/agent/engine/builder-engine.ts +3 -0
- package/corpus/core/src/agent/engine/context-directives-transform.ts +69 -0
- package/corpus/core/src/agent/engine/continuation-dispatch-retry.ts +168 -0
- package/corpus/core/src/agent/engine/tool-call-journal-seed.ts +85 -0
- package/corpus/core/src/agent/production-agent.ts +129 -244
- package/corpus/core/src/cli/doctor.ts +9 -3
- package/corpus/core/src/cli/plan-local.ts +10 -2
- package/corpus/core/src/cli/skills-content/assets-skill.ts +83 -0
- package/corpus/core/src/cli/skills-content/canvas.ts +153 -0
- package/corpus/core/src/cli/skills-content/connection.ts +52 -0
- package/corpus/core/src/cli/skills-content/content-skill.ts +109 -0
- package/corpus/core/src/cli/skills-content/design-exploration-skill.ts +118 -0
- package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +228 -0
- package/corpus/core/src/cli/skills-content/document-quality.ts +196 -0
- package/corpus/core/src/cli/skills-content/exemplar.ts +69 -0
- package/corpus/core/src/cli/skills-content/help.ts +77 -0
- package/corpus/core/src/cli/skills-content/index.ts +22 -0
- package/corpus/core/src/cli/skills-content/local-files.ts +95 -0
- package/corpus/core/src/cli/skills-content/plan-setup-auth.ts +80 -0
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +470 -0
- package/corpus/core/src/cli/skills-content/visual-recap-skill.ts +547 -0
- package/corpus/core/src/cli/skills-content/visualize-repo-skill.ts +93 -0
- package/corpus/core/src/cli/skills-content/wireframe.ts +349 -0
- package/corpus/core/src/cli/skills.ts +27 -2733
- package/corpus/core/src/client/AgentPanel.tsx +6 -5
- package/corpus/core/src/client/CommandMenu.tsx +16 -5
- package/corpus/core/src/client/FeedbackButton.tsx +2 -2
- package/corpus/core/src/client/app-providers.tsx +18 -5
- package/corpus/core/src/client/chat/tool-call-display.tsx +3 -3
- package/corpus/core/src/client/composer/PastedTextChip.tsx +1 -1
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +143 -45
- package/corpus/core/src/client/composer/TiptapComposer.tsx +1 -1
- package/corpus/core/src/client/composer/VoiceButton.tsx +21 -5
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +107 -10
- package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +5 -2
- package/corpus/core/src/client/extensions/ExtensionEditor.tsx +37 -4
- package/corpus/core/src/client/extensions/ExtensionQueryErrorState.tsx +47 -0
- package/corpus/core/src/client/extensions/ExtensionSlot.tsx +39 -10
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +44 -6
- package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +12 -3
- package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +49 -11
- package/corpus/core/src/client/index.ts +0 -13
- package/corpus/core/src/client/progress/RunsTray.tsx +10 -3
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +7 -0
- package/corpus/core/src/client/settings/useBuilderStatus.ts +6 -0
- package/corpus/core/src/client/tool-cells/EditCell.tsx +19 -16
- package/corpus/core/src/client/tool-cells/FilesChangedSummary.tsx +26 -23
- package/corpus/core/src/client/tool-cells/WriteCell.tsx +19 -16
- package/corpus/core/src/client/visual-style-controls.tsx +1 -1
- package/corpus/core/src/deploy/build.ts +36 -14
- package/corpus/core/src/integrations/google-docs-poller.ts +23 -2
- package/corpus/core/src/integrations/plugin.ts +10 -0
- package/corpus/core/src/integrations/webhook-handler.ts +27 -2
- package/corpus/core/src/jobs/scheduler.ts +28 -2
- package/corpus/core/src/localization/default-messages.ts +8 -1
- package/corpus/core/src/mcp/oauth-token.ts +6 -1
- package/corpus/core/src/observability/routes.ts +36 -0
- package/corpus/core/src/observability/sentiment.ts +261 -0
- package/corpus/core/src/observability/store.ts +23 -0
- package/corpus/core/src/observability/traces.ts +49 -63
- package/corpus/core/src/observability/tracking-identity.ts +55 -0
- package/corpus/core/src/observability/types.ts +13 -0
- package/corpus/core/src/secrets/storage.ts +67 -3
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +199 -0
- package/corpus/core/src/server/agent-chat/browser-team-tools.ts +510 -0
- package/corpus/core/src/server/agent-chat/context-tools.ts +595 -0
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +470 -0
- package/corpus/core/src/server/agent-chat/lazy-fs.ts +11 -0
- package/corpus/core/src/server/agent-chat/mcp-glue.ts +91 -0
- package/corpus/core/src/server/agent-chat/plugin-options.ts +350 -0
- package/corpus/core/src/server/agent-chat/process-run-failure.ts +62 -0
- package/corpus/core/src/server/agent-chat/prompt-resources.ts +688 -0
- package/corpus/core/src/server/agent-chat/recurring-jobs-runtime.ts +80 -0
- package/corpus/core/src/server/agent-chat/request-surface.ts +71 -0
- package/corpus/core/src/server/agent-chat/run-code-tools.ts +67 -0
- package/corpus/core/src/server/agent-chat/script-entries.ts +779 -0
- package/corpus/core/src/server/agent-chat/shared-thread.ts +301 -0
- package/corpus/core/src/server/agent-chat/skill-frontmatter.ts +41 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +364 -4182
- package/corpus/core/src/server/agent-teams.ts +26 -3
- package/corpus/core/src/server/auth.ts +55 -57
- package/corpus/core/src/server/credential-provider.ts +22 -25
- package/corpus/core/src/server/edge.ts +1 -0
- package/corpus/core/src/server/onboarding-html.ts +1 -16
- package/corpus/core/src/server/realtime-voice.ts +40 -5
- package/corpus/core/src/server/request-origin.ts +6 -2
- package/corpus/core/src/server/ssr-handler.ts +55 -2
- package/corpus/core/src/sharing/access.ts +155 -11
- package/corpus/core/src/sharing/registry.ts +7 -0
- package/corpus/core/src/styles/agent-native.css +15 -14
- package/corpus/core/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/corpus/core/src/templates/workspace-core/src/server/index.ts +4 -2
- package/corpus/core/src/testing.ts +26 -0
- package/corpus/core/src/triggers/dispatcher.ts +23 -2
- package/corpus/core/src/vite/client.ts +126 -2
- package/corpus/core/tsconfig.cli.json +1 -1
- package/corpus/core/tsconfig.json +5 -1
- package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +2 -2
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/analytics/AGENTS.md +19 -6
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +79 -43
- package/corpus/templates/analytics/actions/list-explorer-dashboards.ts +3 -3
- package/corpus/templates/analytics/actions/list-sql-dashboards.ts +8 -3
- package/corpus/templates/analytics/actions/rename-analysis.ts +8 -2
- package/corpus/templates/analytics/actions/rename-dashboard.ts +8 -7
- package/corpus/templates/analytics/actions/view-screen.ts +4 -23
- package/corpus/templates/analytics/app/components/ResourceLoadError.tsx +42 -0
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +85 -70
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +107 -89
- package/corpus/templates/analytics/app/components/layout/SidebarLoadError.tsx +24 -0
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -5
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/analytics/app/i18n-data.ts +40 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +6 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +36 -20
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +34 -20
- package/corpus/templates/analytics/app/pages/adhoc/explorer/use-explorer-config.ts +42 -41
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +43 -36
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +11 -2
- package/corpus/templates/analytics/app/root.tsx +13 -1
- package/corpus/templates/analytics/app/routes/_index.tsx +14 -2
- package/corpus/templates/analytics/changelog/2026-07-03-agent-llm-observability-dashboard.md +1 -1
- package/corpus/templates/analytics/changelog/2026-07-11-agent-feedback-sentiment-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-chats-now-start-faster-by-loading-metric-definitio.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-command-and-sql-previews-now-respond-without-lag.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-command-search-now-reports-loading-failures-and-lets-you-ret.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-dashboard-navigation-now-loads-faster-and-reports-request-fa.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-inferred-message-sentiment-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-microphone-settings-from-realtime-voice-mode-now-open-the-vo.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-more-dashboard-edit-paths-are-now-safe-against-simultaneous-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-renaming-a-dashboard-is-now-safe-against-simultaneous-agent-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-renaming-an-analysis-is-now-safe-against-simultaneous-edits.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-workspace-mounted-analytics-now-opens-ask-reliably-and-route.md +6 -0
- package/corpus/templates/analytics/docs/schemas/first-party-analytics.md +37 -3
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +339 -1
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +1 -24
- package/corpus/templates/analytics/server/lib/dashboard-seeds.ts +0 -5
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +289 -20
- package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +106 -34
- package/corpus/templates/analytics/server/lib/demo-dashboards.ts +4 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +11 -39
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +30 -4
- package/corpus/templates/assets/app/routes/library.tsx +49 -5
- package/corpus/templates/assets/changelog/2026-07-11-library-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/calendar/.env.example +5 -0
- package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +2 -2
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/calendar/app/i18n-data.ts +20 -0
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +37 -1
- package/corpus/templates/calendar/app/pages/BookingsList.tsx +20 -3
- package/corpus/templates/calendar/changelog/2026-07-11-booking-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-11-event-cards-give-subtle-press-feedback-and-smoother-hover.md +6 -0
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/clips/actions/decline-invite.ts +8 -0
- package/corpus/templates/clips/app/components/library/folder-tree.tsx +209 -187
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +2 -2
- package/corpus/templates/clips/app/components/player/reactions-tray.tsx +17 -5
- package/corpus/templates/clips/app/components/player/scrubber.tsx +5 -3
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +2 -2
- package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +119 -95
- package/corpus/templates/clips/app/global.css +45 -0
- package/corpus/templates/clips/app/root.tsx +4 -0
- package/corpus/templates/clips/app/routes/_app.notifications.tsx +23 -2
- package/corpus/templates/clips/app/routes/_app.trash.tsx +24 -2
- package/corpus/templates/clips/changelog/2026-07-11-controls-and-folders-now-move-more-smoothly.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-declining-an-invitation-now-requires-being-its-recipient.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-recording-overlays-are-lighter-weight-and-no-longer-cause-pa.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-workspace-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.css +34 -5
- package/corpus/templates/clips/chrome-extension/src/styles.css +2 -2
- package/corpus/templates/clips/desktop/src/styles.css +71 -26
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/content/actions/move-document.ts +34 -18
- package/corpus/templates/content/app/components/QueryErrorState.tsx +39 -0
- package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +1 -1
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +225 -1435
- package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +368 -0
- package/corpus/templates/content/app/components/editor/database/ListView.tsx +353 -0
- package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +580 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -2
- package/corpus/templates/content/app/global.css +19 -19
- package/corpus/templates/content/app/root.tsx +2 -2
- package/corpus/templates/content/app/routes/_app._index.tsx +11 -1
- package/corpus/templates/content/changelog/2026-07-11-document-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-editor-toggle-feedback-now-feels-more-responsive.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-moving-documents-at-the-same-time-no-longer-scrambles-their-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-public-document-chats-now-start-faster-while-keeping-full-do.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-reopening-a-comment-now-uses-consistent-permissions-everywhe.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-sidebar-resizing-now-tracks-your-cursor-instantly-instead-of.md +6 -0
- package/corpus/templates/content/server/lib/public-documents.ts +47 -10
- package/corpus/templates/content/server/routes/api/comments/[id].patch.ts +24 -24
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/design/app/components/QueryErrorState.tsx +24 -0
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +1 -1
- package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +5 -2
- package/corpus/templates/design/app/components/design/EditPanel.tsx +326 -319
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +198 -193
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +11 -4
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +1 -1
- package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/design/app/pages/DesignSystems.tsx +7 -1
- package/corpus/templates/design/app/pages/Index.tsx +14 -2
- package/corpus/templates/design/app/pages/Present.tsx +16 -3
- package/corpus/templates/design/app/pages/Templates.tsx +10 -4
- package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +484 -0
- package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +378 -0
- package/corpus/templates/design/app/pages/design-editor/design-data-geometry-utils.ts +138 -0
- package/corpus/templates/design/app/pages/design-editor/dom-utils.ts +15 -0
- package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +180 -0
- package/corpus/templates/design/app/pages/design-editor/html-layer-positioning.ts +226 -0
- package/corpus/templates/design/app/pages/design-editor/png-export-render.ts +348 -0
- package/corpus/templates/design/app/pages/design-editor/screen-command-utils.ts +160 -0
- package/corpus/templates/design/app/pages/design-editor/text-edit-utils.ts +238 -0
- package/corpus/templates/design/app/pages/design-editor/tool-state.ts +23 -1
- package/corpus/templates/design/app/pages/design-editor/types.ts +25 -0
- package/corpus/templates/design/app/root.tsx +10 -1
- package/corpus/templates/design/changelog/2026-07-11-canvas-context-menus-now-open-without-motion-jitter.md +6 -0
- package/corpus/templates/design/changelog/2026-07-11-design-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/design/changelog/2026-07-11-inspector-tooltips-appear-instantly-as-you-sweep-across-icon.md +6 -0
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/dispatch/app/i18n/zh-TW.ts +10 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +123 -0
- package/corpus/templates/dispatch/app/routes/integrations.tsx +163 -144
- package/corpus/templates/dispatch/changelog/2026-07-11-dispatch-mcp-connections-now-start-with-safer-app-access-and.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-11-overview-and-chat-now-share-a-cleaner-more-stable-flow.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-11-query-errors-now-show-a-retry-option.md +6 -0
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +3 -3
- package/corpus/templates/forms/app/root.tsx +34 -8
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/macros/app/components/DailyProgress.tsx +25 -5
- package/corpus/templates/macros/app/components/QueryErrorState.tsx +31 -0
- package/corpus/templates/macros/app/components/WeightTracker.tsx +5 -1
- package/corpus/templates/macros/app/components/ui/button.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/progress.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/tabs.tsx +1 -1
- package/corpus/templates/macros/app/i18n/ar-SA.ts +2 -0
- package/corpus/templates/macros/app/i18n/de-DE.ts +2 -0
- package/corpus/templates/macros/app/i18n/en-US.ts +2 -0
- package/corpus/templates/macros/app/i18n/es-ES.ts +2 -0
- package/corpus/templates/macros/app/i18n/fr-FR.ts +2 -0
- package/corpus/templates/macros/app/i18n/hi-IN.ts +2 -0
- package/corpus/templates/macros/app/i18n/ja-JP.ts +2 -0
- package/corpus/templates/macros/app/i18n/ko-KR.ts +2 -0
- package/corpus/templates/macros/app/i18n/pt-BR.ts +2 -0
- package/corpus/templates/macros/app/i18n/zh-CN.ts +2 -0
- package/corpus/templates/macros/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/macros/app/routes/_index.tsx +22 -12
- package/corpus/templates/macros/app/routes/analytics.tsx +31 -10
- package/corpus/templates/macros/changelog/2026-07-11-daily-tracking-now-loads-and-updates-more-quickly.md +6 -0
- package/corpus/templates/macros/changelog/2026-07-11-data-load-failures-now-show-a-clear-error-with-a-retry-actio.md +6 -0
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/mail/.env.example +16 -11
- package/corpus/templates/mail/actions/list-emails.ts +39 -35
- package/corpus/templates/mail/app/components/email/ComposeModal.tsx +58 -6
- package/corpus/templates/mail/app/components/email/EmailListItem.tsx +35 -2
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +113 -104
- package/corpus/templates/mail/app/root.tsx +8 -10
- package/corpus/templates/mail/changelog/2026-07-11-compose-and-navigation-motion-now-feel-faster-and-smoother.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-11-swipe-to-archive-or-snooze-now-responds-to-quick-flicks-not-.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-11-the-assistant-now-sees-the-same-inbox-you-do-snoozed-mail-st.md +6 -0
- package/corpus/templates/mail/server/handlers/emails.ts +25 -69
- package/corpus/templates/mail/server/lib/list-inbox-emails.ts +169 -0
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/plan/.env.example +4 -0
- package/corpus/templates/plan/actions/create-plan-design.ts +89 -81
- package/corpus/templates/plan/actions/create-prototype-plan.ts +72 -59
- package/corpus/templates/plan/actions/create-ui-plan.ts +70 -55
- package/corpus/templates/plan/actions/create-visual-plan.ts +65 -51
- package/corpus/templates/plan/actions/update-local-plan-folder.ts +43 -30
- package/corpus/templates/plan/actions/update-visual-plan.ts +81 -64
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +17 -0
- package/corpus/templates/plan/app/components/ui/tabs.tsx +1 -1
- package/corpus/templates/plan/app/i18n/ar-SA.ts +10 -0
- package/corpus/templates/plan/app/i18n/de-DE.ts +10 -0
- package/corpus/templates/plan/app/i18n/en-US.ts +10 -0
- package/corpus/templates/plan/app/i18n/es-ES.ts +10 -0
- package/corpus/templates/plan/app/i18n/fr-FR.ts +10 -0
- package/corpus/templates/plan/app/i18n/hi-IN.ts +10 -0
- package/corpus/templates/plan/app/i18n/ja-JP.ts +10 -0
- package/corpus/templates/plan/app/i18n/ko-KR.ts +10 -0
- package/corpus/templates/plan/app/i18n/pt-BR.ts +10 -0
- package/corpus/templates/plan/app/i18n/zh-CN.ts +10 -0
- package/corpus/templates/plan/app/i18n/zh-TW.ts +10 -0
- package/corpus/templates/plan/app/lib/plan-local-bridge.ts +80 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +152 -4
- package/corpus/templates/plan/app/root.tsx +11 -0
- package/corpus/templates/plan/changelog/2026-07-11-local-plans-now-explain-and-recover-from-browser-permission-.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-edits-now-save-atomically-and-can-no-longer-partially-a.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-lists-now-show-a-clear-error-with-a-retry-action-when-t.md +6 -0
- package/corpus/templates/plan/shared/plan-content.ts +546 -260
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/slides/actions/delete-slide-comment.ts +49 -0
- package/corpus/templates/slides/actions/update-slide-comment.ts +93 -0
- package/corpus/templates/slides/actions/view-screen.ts +14 -6
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +33 -10
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +2 -2
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +4 -2
- package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +4 -3
- package/corpus/templates/slides/app/context/DeckContext.tsx +9 -0
- package/corpus/templates/slides/app/i18n/ar-SA.ts +6 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +6 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +6 -0
- package/corpus/templates/slides/app/i18n/es-ES.ts +6 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +6 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +6 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +6 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +6 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +6 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +5 -0
- package/corpus/templates/slides/app/i18n/zh-TW.ts +5 -0
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +23 -2
- package/corpus/templates/slides/app/pages/Index.tsx +29 -1
- package/corpus/templates/slides/changelog/2026-07-11-comment-load-failures-now-show-a-retry-action-instead-of-say.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-comment-pins-now-clear-with-a-faster-smoother-confirmation.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-deck-and-design-system-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-editor-toggles-and-toolbar-menus-now-animate-smoothly.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-the-assistant-can-now-resolve-reopen-and-delete-slide-commen.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-viewing-slides-no-longer-loads-every-deck-s-full-contents-in.md +6 -0
- package/corpus/templates/slides/server/routes/api/comments/[id].delete.ts +29 -48
- package/corpus/templates/slides/server/routes/api/comments/[id].patch.ts +29 -65
- package/dist/action.d.ts +23 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +13 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +3 -0
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/context-directives-transform.d.ts +25 -0
- package/dist/agent/engine/context-directives-transform.d.ts.map +1 -0
- package/dist/agent/engine/context-directives-transform.js +53 -0
- package/dist/agent/engine/context-directives-transform.js.map +1 -0
- package/dist/agent/engine/continuation-dispatch-retry.d.ts +40 -0
- package/dist/agent/engine/continuation-dispatch-retry.d.ts.map +1 -0
- package/dist/agent/engine/continuation-dispatch-retry.js +109 -0
- package/dist/agent/engine/continuation-dispatch-retry.js.map +1 -0
- package/dist/agent/engine/tool-call-journal-seed.d.ts +46 -0
- package/dist/agent/engine/tool-call-journal-seed.d.ts.map +1 -0
- package/dist/agent/engine/tool-call-journal-seed.js +60 -0
- package/dist/agent/engine/tool-call-journal-seed.js.map +1 -0
- package/dist/agent/production-agent.d.ts +7 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +102 -222
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +7 -3
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +8 -2
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/skills-content/assets-skill.d.ts +2 -0
- package/dist/cli/skills-content/assets-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/assets-skill.js +84 -0
- package/dist/cli/skills-content/assets-skill.js.map +1 -0
- package/dist/cli/skills-content/canvas.d.ts +4 -0
- package/dist/cli/skills-content/canvas.d.ts.map +1 -0
- package/dist/cli/skills-content/canvas.js +152 -0
- package/dist/cli/skills-content/canvas.js.map +1 -0
- package/dist/cli/skills-content/connection.d.ts +2 -0
- package/dist/cli/skills-content/connection.d.ts.map +1 -0
- package/dist/cli/skills-content/connection.js +53 -0
- package/dist/cli/skills-content/connection.js.map +1 -0
- package/dist/cli/skills-content/content-skill.d.ts +2 -0
- package/dist/cli/skills-content/content-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/content-skill.js +110 -0
- package/dist/cli/skills-content/content-skill.js.map +1 -0
- package/dist/cli/skills-content/design-exploration-skill.d.ts +2 -0
- package/dist/cli/skills-content/design-exploration-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/design-exploration-skill.js +119 -0
- package/dist/cli/skills-content/design-exploration-skill.js.map +1 -0
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts +2 -0
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/design-visual-edit-skill.js +229 -0
- package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -0
- package/dist/cli/skills-content/document-quality.d.ts +4 -0
- package/dist/cli/skills-content/document-quality.d.ts.map +1 -0
- package/dist/cli/skills-content/document-quality.js +195 -0
- package/dist/cli/skills-content/document-quality.js.map +1 -0
- package/dist/cli/skills-content/exemplar.d.ts +4 -0
- package/dist/cli/skills-content/exemplar.d.ts.map +1 -0
- package/dist/cli/skills-content/exemplar.js +68 -0
- package/dist/cli/skills-content/exemplar.js.map +1 -0
- package/dist/cli/skills-content/help.d.ts +2 -0
- package/dist/cli/skills-content/help.d.ts.map +1 -0
- package/dist/cli/skills-content/help.js +78 -0
- package/dist/cli/skills-content/help.js.map +1 -0
- package/dist/cli/skills-content/index.d.ts +23 -0
- package/dist/cli/skills-content/index.d.ts.map +1 -0
- package/dist/cli/skills-content/index.js +23 -0
- package/dist/cli/skills-content/index.js.map +1 -0
- package/dist/cli/skills-content/local-files.d.ts +2 -0
- package/dist/cli/skills-content/local-files.d.ts.map +1 -0
- package/dist/cli/skills-content/local-files.js +96 -0
- package/dist/cli/skills-content/local-files.js.map +1 -0
- package/dist/cli/skills-content/plan-setup-auth.d.ts +9 -0
- package/dist/cli/skills-content/plan-setup-auth.d.ts.map +1 -0
- package/dist/cli/skills-content/plan-setup-auth.js +81 -0
- package/dist/cli/skills-content/plan-setup-auth.js.map +1 -0
- package/dist/cli/skills-content/visual-plan-skill.d.ts +2 -0
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visual-plan-skill.js +471 -0
- package/dist/cli/skills-content/visual-plan-skill.js.map +1 -0
- package/dist/cli/skills-content/visual-recap-skill.d.ts +2 -0
- package/dist/cli/skills-content/visual-recap-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visual-recap-skill.js +548 -0
- package/dist/cli/skills-content/visual-recap-skill.js.map +1 -0
- package/dist/cli/skills-content/visualize-repo-skill.d.ts +2 -0
- package/dist/cli/skills-content/visualize-repo-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visualize-repo-skill.js +94 -0
- package/dist/cli/skills-content/visualize-repo-skill.js.map +1 -0
- package/dist/cli/skills-content/wireframe.d.ts +4 -0
- package/dist/cli/skills-content/wireframe.d.ts.map +1 -0
- package/dist/cli/skills-content/wireframe.js +347 -0
- package/dist/cli/skills-content/wireframe.js.map +1 -0
- package/dist/cli/skills.d.ts +2 -10
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +2 -2710
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +4 -2
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +15 -3
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/FeedbackButton.js +2 -2
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/app-providers.d.ts +13 -5
- package/dist/client/app-providers.d.ts.map +1 -1
- package/dist/client/app-providers.js +9 -6
- package/dist/client/app-providers.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +4 -0
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +3 -3
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/composer/PastedTextChip.js +1 -1
- package/dist/client/composer/PastedTextChip.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +3 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +35 -14
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/client/composer/TiptapComposer.js +1 -1
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts +2 -0
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +9 -3
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts +5 -0
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +91 -12
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.js +4 -1
- package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
- package/dist/client/extensions/ExtensionEditor.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionEditor.js +15 -5
- package/dist/client/extensions/ExtensionEditor.js.map +1 -1
- package/dist/client/extensions/ExtensionQueryErrorState.d.ts +8 -0
- package/dist/client/extensions/ExtensionQueryErrorState.d.ts.map +1 -0
- package/dist/client/extensions/ExtensionQueryErrorState.js +11 -0
- package/dist/client/extensions/ExtensionQueryErrorState.js.map +1 -0
- package/dist/client/extensions/ExtensionSlot.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionSlot.js +17 -7
- package/dist/client/extensions/ExtensionSlot.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +17 -7
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.js +5 -3
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js +21 -8
- package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
- package/dist/client/index.d.ts +0 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +0 -5
- package/dist/client/index.js.map +1 -1
- package/dist/client/progress/RunsTray.d.ts.map +1 -1
- package/dist/client/progress/RunsTray.js +7 -3
- package/dist/client/progress/RunsTray.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js +4 -0
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +2 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +4 -0
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/tool-cells/EditCell.d.ts.map +1 -1
- package/dist/client/tool-cells/EditCell.js +2 -1
- package/dist/client/tool-cells/EditCell.js.map +1 -1
- package/dist/client/tool-cells/FilesChangedSummary.d.ts.map +1 -1
- package/dist/client/tool-cells/FilesChangedSummary.js +2 -1
- package/dist/client/tool-cells/FilesChangedSummary.js.map +1 -1
- package/dist/client/tool-cells/WriteCell.d.ts.map +1 -1
- package/dist/client/tool-cells/WriteCell.js +2 -1
- package/dist/client/tool-cells/WriteCell.js.map +1 -1
- package/dist/client/visual-style-controls.js +1 -1
- package/dist/client/visual-style-controls.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +36 -14
- package/dist/deploy/build.js.map +1 -1
- package/dist/integrations/google-docs-poller.d.ts +7 -0
- package/dist/integrations/google-docs-poller.d.ts.map +1 -1
- package/dist/integrations/google-docs-poller.js +13 -3
- package/dist/integrations/google-docs-poller.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +10 -0
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts +11 -0
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +16 -4
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/jobs/scheduler.d.ts +12 -0
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +13 -3
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +7 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +8 -1
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp/oauth-token.d.ts +1 -1
- package/dist/mcp/oauth-token.d.ts.map +1 -1
- package/dist/mcp/oauth-token.js +6 -1
- package/dist/mcp/oauth-token.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts.map +1 -1
- package/dist/observability/routes.js +32 -0
- package/dist/observability/routes.js.map +1 -1
- package/dist/observability/sentiment.d.ts +42 -0
- package/dist/observability/sentiment.d.ts.map +1 -0
- package/dist/observability/sentiment.js +196 -0
- package/dist/observability/sentiment.js.map +1 -0
- package/dist/observability/store.d.ts +5 -0
- package/dist/observability/store.d.ts.map +1 -1
- package/dist/observability/store.js +17 -0
- package/dist/observability/store.js.map +1 -1
- package/dist/observability/traces.d.ts +2 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +42 -57
- package/dist/observability/traces.js.map +1 -1
- package/dist/observability/tracking-identity.d.ts +3 -0
- package/dist/observability/tracking-identity.d.ts.map +1 -0
- package/dist/observability/tracking-identity.js +51 -0
- package/dist/observability/tracking-identity.js.map +1 -0
- package/dist/observability/types.d.ts +10 -0
- package/dist/observability/types.d.ts.map +1 -1
- package/dist/observability/types.js +3 -0
- package/dist/observability/types.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/storage.d.ts +6 -0
- package/dist/secrets/storage.d.ts.map +1 -1
- package/dist/secrets/storage.js +61 -3
- package/dist/secrets/storage.js.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.d.ts +50 -0
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -0
- package/dist/server/agent-chat/action-filters-a2a.js +127 -0
- package/dist/server/agent-chat/action-filters-a2a.js.map +1 -0
- package/dist/server/agent-chat/browser-team-tools.d.ts +21 -0
- package/dist/server/agent-chat/browser-team-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/browser-team-tools.js +417 -0
- package/dist/server/agent-chat/browser-team-tools.js.map +1 -0
- package/dist/server/agent-chat/context-tools.d.ts +33 -0
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/context-tools.js +520 -0
- package/dist/server/agent-chat/context-tools.js.map +1 -0
- package/dist/server/agent-chat/framework-prompts.d.ts +65 -0
- package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -0
- package/dist/server/agent-chat/framework-prompts.js +403 -0
- package/dist/server/agent-chat/framework-prompts.js.map +1 -0
- package/dist/server/agent-chat/lazy-fs.d.ts +2 -0
- package/dist/server/agent-chat/lazy-fs.d.ts.map +1 -0
- package/dist/server/agent-chat/lazy-fs.js +11 -0
- package/dist/server/agent-chat/lazy-fs.js.map +1 -0
- package/dist/server/agent-chat/mcp-glue.d.ts +9 -0
- package/dist/server/agent-chat/mcp-glue.d.ts.map +1 -0
- package/dist/server/agent-chat/mcp-glue.js +63 -0
- package/dist/server/agent-chat/mcp-glue.js.map +1 -0
- package/dist/server/agent-chat/plugin-options.d.ts +322 -0
- package/dist/server/agent-chat/plugin-options.d.ts.map +1 -0
- package/dist/server/agent-chat/plugin-options.js +2 -0
- package/dist/server/agent-chat/plugin-options.js.map +1 -0
- package/dist/server/agent-chat/process-run-failure.d.ts +12 -0
- package/dist/server/agent-chat/process-run-failure.d.ts.map +1 -0
- package/dist/server/agent-chat/process-run-failure.js +24 -0
- package/dist/server/agent-chat/process-run-failure.js.map +1 -0
- package/dist/server/agent-chat/prompt-resources.d.ts +28 -0
- package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -0
- package/dist/server/agent-chat/prompt-resources.js +514 -0
- package/dist/server/agent-chat/prompt-resources.js.map +1 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +5 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts.map +1 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.js +53 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.js.map +1 -0
- package/dist/server/agent-chat/request-surface.d.ts +8 -0
- package/dist/server/agent-chat/request-surface.d.ts.map +1 -0
- package/dist/server/agent-chat/request-surface.js +56 -0
- package/dist/server/agent-chat/request-surface.js.map +1 -0
- package/dist/server/agent-chat/run-code-tools.d.ts +17 -0
- package/dist/server/agent-chat/run-code-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/run-code-tools.js +55 -0
- package/dist/server/agent-chat/run-code-tools.js.map +1 -0
- package/dist/server/agent-chat/script-entries.d.ts +47 -0
- package/dist/server/agent-chat/script-entries.d.ts.map +1 -0
- package/dist/server/agent-chat/script-entries.js +633 -0
- package/dist/server/agent-chat/script-entries.js.map +1 -0
- package/dist/server/agent-chat/shared-thread.d.ts +33 -0
- package/dist/server/agent-chat/shared-thread.d.ts.map +1 -0
- package/dist/server/agent-chat/shared-thread.js +242 -0
- package/dist/server/agent-chat/shared-thread.js.map +1 -0
- package/dist/server/agent-chat/skill-frontmatter.d.ts +7 -0
- package/dist/server/agent-chat/skill-frontmatter.d.ts.map +1 -0
- package/dist/server/agent-chat/skill-frontmatter.js +26 -0
- package/dist/server/agent-chat/skill-frontmatter.js.map +1 -0
- package/dist/server/agent-chat-plugin.d.ts +45 -486
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +173 -3005
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-teams.d.ts +10 -0
- package/dist/server/agent-teams.d.ts.map +1 -1
- package/dist/server/agent-teams.js +13 -3
- package/dist/server/agent-teams.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +50 -52
- package/dist/server/auth.js.map +1 -1
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +22 -21
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/edge.d.ts +1 -0
- package/dist/server/edge.d.ts.map +1 -1
- package/dist/server/edge.js +1 -0
- package/dist/server/edge.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +1 -16
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/realtime-voice.d.ts +3 -0
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +29 -5
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/request-origin.d.ts.map +1 -1
- package/dist/server/request-origin.js +6 -3
- package/dist/server/request-origin.js.map +1 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +47 -2
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/sharing/access.d.ts +63 -3
- package/dist/sharing/access.d.ts.map +1 -1
- package/dist/sharing/access.js +53 -15
- package/dist/sharing/access.js.map +1 -1
- package/dist/sharing/registry.d.ts +7 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/styles/agent-native.css +15 -14
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
- package/dist/templates/default/app/i18n/de-DE.ts +6 -0
- package/dist/templates/default/app/i18n/en-US.ts +6 -0
- package/dist/templates/default/app/i18n/es-ES.ts +6 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
- package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/dist/templates/workspace-core/src/server/index.ts +4 -2
- package/dist/testing.d.ts +16 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +16 -0
- package/dist/testing.js.map +1 -0
- package/dist/triggers/dispatcher.d.ts +7 -0
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +13 -3
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/vite/client.d.ts +16 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +105 -2
- package/dist/vite/client.js.map +1 -1
- package/docs/content/authentication.mdx +3 -3
- package/docs/content/doctor.mdx +170 -0
- package/docs/content/external-agents.mdx +8 -7
- package/docs/content/locales/ar-SA/authentication.mdx +2 -2
- package/docs/content/locales/ar-SA/external-agents.mdx +8 -7
- package/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ar-SA/security.mdx +2 -0
- package/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/docs/content/locales/de-DE/external-agents.mdx +8 -7
- package/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
- package/docs/content/locales/de-DE/security.mdx +2 -0
- package/docs/content/locales/es-ES/authentication.mdx +2 -2
- package/docs/content/locales/es-ES/external-agents.mdx +8 -7
- package/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
- package/docs/content/locales/es-ES/security.mdx +2 -0
- package/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/docs/content/locales/fr-FR/external-agents.mdx +8 -7
- package/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/fr-FR/security.mdx +2 -0
- package/docs/content/locales/hi-IN/authentication.mdx +2 -2
- package/docs/content/locales/hi-IN/external-agents.mdx +8 -7
- package/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
- package/docs/content/locales/hi-IN/security.mdx +2 -0
- package/docs/content/locales/ja-JP/authentication.mdx +2 -2
- package/docs/content/locales/ja-JP/external-agents.mdx +8 -7
- package/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ja-JP/security.mdx +2 -0
- package/docs/content/locales/ko-KR/authentication.mdx +2 -2
- package/docs/content/locales/ko-KR/external-agents.mdx +8 -7
- package/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ko-KR/security.mdx +2 -0
- package/docs/content/locales/pt-BR/authentication.mdx +2 -2
- package/docs/content/locales/pt-BR/external-agents.mdx +8 -7
- package/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/pt-BR/security.mdx +2 -0
- package/docs/content/locales/zh-CN/authentication.mdx +2 -2
- package/docs/content/locales/zh-CN/external-agents.mdx +8 -7
- package/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
- package/docs/content/locales/zh-CN/security.mdx +2 -0
- package/docs/content/locales/zh-TW/authentication.mdx +2 -2
- package/docs/content/locales/zh-TW/external-agents.mdx +8 -7
- package/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
- package/docs/content/locales/zh-TW/security.mdx +2 -0
- package/docs/content/mcp-protocol.mdx +1 -1
- package/docs/content/security.mdx +2 -0
- package/package.json +6 -2
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/src/templates/default/app/i18n/en-US.ts +6 -0
- package/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/src/templates/workspace-core/src/server/index.ts +4 -2
- package/corpus/core/src/client/ProductionAgentPanel.tsx +0 -9
- package/corpus/core/src/client/auth-redirect-url.ts +0 -23
- package/corpus/core/src/client/useProductionAgent.ts +0 -253
- package/corpus/core/src/shared/auth-redirect-url.ts +0 -1
- package/corpus/templates/analytics/app/pages/Index.tsx +0 -16
- package/corpus/templates/analytics/seeds/dashboards/agent-observability-llm.json +0 -173
- package/dist/client/ProductionAgentPanel.d.ts +0 -6
- package/dist/client/ProductionAgentPanel.d.ts.map +0 -1
- package/dist/client/ProductionAgentPanel.js +0 -6
- package/dist/client/ProductionAgentPanel.js.map +0 -1
- package/dist/client/auth-redirect-url.d.ts +0 -2
- package/dist/client/auth-redirect-url.d.ts.map +0 -1
- package/dist/client/auth-redirect-url.js +0 -19
- package/dist/client/auth-redirect-url.js.map +0 -1
- package/dist/client/useProductionAgent.d.ts +0 -24
- package/dist/client/useProductionAgent.d.ts.map +0 -1
- package/dist/client/useProductionAgent.js +0 -179
- package/dist/client/useProductionAgent.js.map +0 -1
- package/dist/shared/auth-redirect-url.d.ts +0 -2
- package/dist/shared/auth-redirect-url.d.ts.map +0 -1
- package/dist/shared/auth-redirect-url.js +0 -2
- package/dist/shared/auth-redirect-url.js.map +0 -1
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboards + analyses store — SQL first, legacy settings-KV as
|
|
3
|
+
* read-only fallback. Writes always go to SQL.
|
|
4
|
+
*
|
|
5
|
+
* Lazy migration: when a record is fetched by id and exists only in the
|
|
6
|
+
* legacy settings store, it is copied into SQL on the fly using the
|
|
7
|
+
* settings key as the source of truth for `ownerEmail` / `orgId` /
|
|
8
|
+
* `visibility`, then returned. Subsequent reads hit SQL directly.
|
|
9
|
+
*
|
|
10
|
+
* - `u:<email>:dashboard-{id}` → kind='explorer', owner=email, visibility='private'
|
|
11
|
+
* - `u:<email>:sql-dashboard-{id}` → kind='sql', owner=email, visibility='private'
|
|
12
|
+
* - `o:<orgId>:sql-dashboard-{id}` → kind='sql', owner=caller, visibility='org'
|
|
13
|
+
* - `adhoc-analysis-{id}` → owner=caller, legacy visibility from its source key
|
|
14
|
+
*/
|
|
15
|
+
import { isPostgres } from "@agent-native/core/db";
|
|
1
16
|
import { recordChange } from "@agent-native/core/server";
|
|
2
17
|
import {
|
|
3
18
|
getAllSettings,
|
|
@@ -13,21 +28,7 @@ import {
|
|
|
13
28
|
resolveAccess,
|
|
14
29
|
type ShareRole,
|
|
15
30
|
} from "@agent-native/core/sharing";
|
|
16
|
-
|
|
17
|
-
* Dashboards + analyses store — SQL first, legacy settings-KV as
|
|
18
|
-
* read-only fallback. Writes always go to SQL.
|
|
19
|
-
*
|
|
20
|
-
* Lazy migration: when a record is fetched by id and exists only in the
|
|
21
|
-
* legacy settings store, it is copied into SQL on the fly using the
|
|
22
|
-
* settings key as the source of truth for `ownerEmail` / `orgId` /
|
|
23
|
-
* `visibility`, then returned. Subsequent reads hit SQL directly.
|
|
24
|
-
*
|
|
25
|
-
* - `u:<email>:dashboard-{id}` → kind='explorer', owner=email, visibility='private'
|
|
26
|
-
* - `u:<email>:sql-dashboard-{id}` → kind='sql', owner=email, visibility='private'
|
|
27
|
-
* - `o:<orgId>:sql-dashboard-{id}` → kind='sql', owner=caller, visibility='org'
|
|
28
|
-
* - `adhoc-analysis-{id}` → owner=caller, legacy visibility from its source key
|
|
29
|
-
*/
|
|
30
|
-
import { and, desc, eq, isNotNull, isNull } from "drizzle-orm";
|
|
31
|
+
import { and, desc, eq, isNotNull, isNull, sql } from "drizzle-orm";
|
|
31
32
|
|
|
32
33
|
import { getDb, schema } from "../db/index.js";
|
|
33
34
|
|
|
@@ -56,6 +57,22 @@ export interface DashboardRecord {
|
|
|
56
57
|
canManage?: boolean;
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
/** Metadata-only dashboard row for navigation and picker surfaces. */
|
|
61
|
+
export interface DashboardSummaryRecord {
|
|
62
|
+
id: string;
|
|
63
|
+
kind: DashboardKind;
|
|
64
|
+
name: string;
|
|
65
|
+
parentId: string | null;
|
|
66
|
+
ownerEmail: string;
|
|
67
|
+
orgId: string | null;
|
|
68
|
+
visibility: "private" | "org" | "public";
|
|
69
|
+
createdAt: string;
|
|
70
|
+
updatedAt: string;
|
|
71
|
+
archivedAt: string | null;
|
|
72
|
+
hiddenAt: string | null;
|
|
73
|
+
hiddenBy: string | null;
|
|
74
|
+
}
|
|
75
|
+
|
|
59
76
|
export interface DashboardRevisionRecord {
|
|
60
77
|
id: string;
|
|
61
78
|
dashboardId: string;
|
|
@@ -168,6 +185,19 @@ export class DashboardConflictError extends Error {
|
|
|
168
185
|
}
|
|
169
186
|
}
|
|
170
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Thrown when a fenced `upsertAnalysis` write (an `expectedUpdatedAt` was
|
|
190
|
+
* supplied) loses its compare-and-swap because another writer changed the
|
|
191
|
+
* row first. Callers should re-read the analysis and re-apply their mutation
|
|
192
|
+
* against the fresh record — see `upsertAnalysisWithRetry`.
|
|
193
|
+
*/
|
|
194
|
+
export class AnalysisConflictError extends Error {
|
|
195
|
+
constructor(id: string) {
|
|
196
|
+
super(`Analysis "${id}" changed between read and write.`);
|
|
197
|
+
this.name = "AnalysisConflictError";
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
171
201
|
function changeScope(
|
|
172
202
|
ownerEmail: string,
|
|
173
203
|
orgId: string | null,
|
|
@@ -465,6 +495,125 @@ export async function listDashboards(
|
|
|
465
495
|
return out;
|
|
466
496
|
}
|
|
467
497
|
|
|
498
|
+
/**
|
|
499
|
+
* List dashboard metadata without transferring or parsing each dashboard's
|
|
500
|
+
* potentially very large panel config. This is the list-path counterpart to
|
|
501
|
+
* `getDashboard`, which remains the full-config detail read.
|
|
502
|
+
*
|
|
503
|
+
* Legacy settings rows are surfaced directly instead of being migrated during
|
|
504
|
+
* the read. Opening one by id still performs the existing lazy migration, but
|
|
505
|
+
* navigation no longer turns an ordinary list into N sequential writes.
|
|
506
|
+
*/
|
|
507
|
+
export async function listDashboardSummaries(
|
|
508
|
+
ctx: AccessCtx,
|
|
509
|
+
filter?: {
|
|
510
|
+
kind?: DashboardKind;
|
|
511
|
+
archived?: DashboardArchiveFilter;
|
|
512
|
+
hidden?: DashboardHiddenFilter;
|
|
513
|
+
},
|
|
514
|
+
): Promise<DashboardSummaryRecord[]> {
|
|
515
|
+
const db = getDb() as any;
|
|
516
|
+
const archived = filter?.archived ?? "active";
|
|
517
|
+
const hidden = filter?.hidden ?? "visible";
|
|
518
|
+
const conditions: any[] = [
|
|
519
|
+
accessFilter(schema.dashboards, schema.dashboardShares, {
|
|
520
|
+
userEmail: ctx.email,
|
|
521
|
+
orgId: ctx.orgId ?? undefined,
|
|
522
|
+
}),
|
|
523
|
+
];
|
|
524
|
+
if (filter?.kind) conditions.push(eq(schema.dashboards.kind, filter.kind));
|
|
525
|
+
if (archived === "active")
|
|
526
|
+
conditions.push(isNull(schema.dashboards.archivedAt));
|
|
527
|
+
else if (archived === "archived")
|
|
528
|
+
conditions.push(isNotNull(schema.dashboards.archivedAt));
|
|
529
|
+
if (hidden === "visible") conditions.push(isNull(schema.dashboards.hiddenAt));
|
|
530
|
+
else if (hidden === "hidden")
|
|
531
|
+
conditions.push(isNotNull(schema.dashboards.hiddenAt));
|
|
532
|
+
const where = conditions.length === 1 ? conditions[0] : and(...conditions);
|
|
533
|
+
const parentId = isPostgres()
|
|
534
|
+
? sql<string | null>`(${schema.dashboards.config}::jsonb ->> 'parentId')`
|
|
535
|
+
: sql<
|
|
536
|
+
string | null
|
|
537
|
+
>`json_extract(${schema.dashboards.config}, '$.parentId')`;
|
|
538
|
+
const rows = await db
|
|
539
|
+
.select({
|
|
540
|
+
id: schema.dashboards.id,
|
|
541
|
+
kind: schema.dashboards.kind,
|
|
542
|
+
name: schema.dashboards.title,
|
|
543
|
+
parentId,
|
|
544
|
+
ownerEmail: schema.dashboards.ownerEmail,
|
|
545
|
+
orgId: schema.dashboards.orgId,
|
|
546
|
+
visibility: schema.dashboards.visibility,
|
|
547
|
+
createdAt: schema.dashboards.createdAt,
|
|
548
|
+
updatedAt: schema.dashboards.updatedAt,
|
|
549
|
+
archivedAt: schema.dashboards.archivedAt,
|
|
550
|
+
hiddenAt: schema.dashboards.hiddenAt,
|
|
551
|
+
hiddenBy: schema.dashboards.hiddenBy,
|
|
552
|
+
})
|
|
553
|
+
.from(schema.dashboards)
|
|
554
|
+
.where(where);
|
|
555
|
+
const out: DashboardSummaryRecord[] = rows.map((row: any) => ({
|
|
556
|
+
...row,
|
|
557
|
+
parentId: typeof row.parentId === "string" ? row.parentId : null,
|
|
558
|
+
orgId: row.orgId ?? null,
|
|
559
|
+
archivedAt: row.archivedAt ?? null,
|
|
560
|
+
hiddenAt: row.hiddenAt ?? null,
|
|
561
|
+
hiddenBy: row.hiddenBy ?? null,
|
|
562
|
+
}));
|
|
563
|
+
const seen = new Set(out.map((row) => row.id));
|
|
564
|
+
|
|
565
|
+
if (archived === "archived" || hidden === "hidden") return out;
|
|
566
|
+
try {
|
|
567
|
+
const all = await getAllSettings();
|
|
568
|
+
for (const [key, value] of Object.entries(all)) {
|
|
569
|
+
let id: string | null = null;
|
|
570
|
+
let kind: DashboardKind | null = null;
|
|
571
|
+
let orgId: string | null = null;
|
|
572
|
+
let visibility: DashboardSummaryRecord["visibility"] = "private";
|
|
573
|
+
if (ctx.orgId && key.startsWith(`o:${ctx.orgId}:${SQL_PREFIX}`)) {
|
|
574
|
+
id = key.slice(`o:${ctx.orgId}:${SQL_PREFIX}`.length);
|
|
575
|
+
kind = "sql";
|
|
576
|
+
orgId = ctx.orgId;
|
|
577
|
+
visibility = "org";
|
|
578
|
+
} else if (ctx.email && key.startsWith(`u:${ctx.email}:${SQL_PREFIX}`)) {
|
|
579
|
+
id = key.slice(`u:${ctx.email}:${SQL_PREFIX}`.length);
|
|
580
|
+
kind = "sql";
|
|
581
|
+
} else if (
|
|
582
|
+
ctx.email &&
|
|
583
|
+
key.startsWith(`u:${ctx.email}:${EXPLORER_PREFIX}`)
|
|
584
|
+
) {
|
|
585
|
+
id = key.slice(`u:${ctx.email}:${EXPLORER_PREFIX}`.length);
|
|
586
|
+
kind = "explorer";
|
|
587
|
+
}
|
|
588
|
+
if (!id || !kind || seen.has(id)) continue;
|
|
589
|
+
if (filter?.kind && filter.kind !== kind) continue;
|
|
590
|
+
seen.add(id);
|
|
591
|
+
const config = value as Record<string, unknown>;
|
|
592
|
+
const { title } = configFromSettings(config);
|
|
593
|
+
const createdAt =
|
|
594
|
+
typeof config.createdAt === "string" ? config.createdAt : nowIso();
|
|
595
|
+
out.push({
|
|
596
|
+
id,
|
|
597
|
+
kind,
|
|
598
|
+
name: title,
|
|
599
|
+
parentId: typeof config.parentId === "string" ? config.parentId : null,
|
|
600
|
+
ownerEmail: ctx.email,
|
|
601
|
+
orgId,
|
|
602
|
+
visibility,
|
|
603
|
+
createdAt,
|
|
604
|
+
updatedAt:
|
|
605
|
+
typeof config.updatedAt === "string" ? config.updatedAt : createdAt,
|
|
606
|
+
archivedAt: null,
|
|
607
|
+
hiddenAt: null,
|
|
608
|
+
hiddenBy: null,
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
} catch {
|
|
612
|
+
// Legacy scan is best-effort.
|
|
613
|
+
}
|
|
614
|
+
return out;
|
|
615
|
+
}
|
|
616
|
+
|
|
468
617
|
async function pruneDashboardRevisions(
|
|
469
618
|
db: any,
|
|
470
619
|
dashboardId: string,
|
|
@@ -1247,6 +1396,21 @@ async function snapshotAnalysisRevision(
|
|
|
1247
1396
|
await pruneAnalysisRevisions(db, analysis.id);
|
|
1248
1397
|
}
|
|
1249
1398
|
|
|
1399
|
+
/**
|
|
1400
|
+
* Upsert an analysis. On create, caller becomes owner and visibility defaults
|
|
1401
|
+
* to `private`. On update, `assertAccess` requires `editor`.
|
|
1402
|
+
*
|
|
1403
|
+
* `expectedUpdatedAt` fences the update against concurrent writers: pass the
|
|
1404
|
+
* `updatedAt` observed by an earlier `getAnalysis` call and the UPDATE only
|
|
1405
|
+
* applies `WHERE id = ? AND updated_at = ?`. If another writer already saved
|
|
1406
|
+
* in between, the fenced UPDATE affects zero rows and this throws
|
|
1407
|
+
* `AnalysisConflictError` instead of silently clobbering their write. Omit it
|
|
1408
|
+
* (the default) to keep the prior unconditional last-write-wins behavior,
|
|
1409
|
+
* which existing callers (legacy migration, revision restore, and
|
|
1410
|
+
* `save-analysis`'s create/re-run path) still rely on. See
|
|
1411
|
+
* `upsertAnalysisWithRetry` for the read-modify-write pattern that recomputes
|
|
1412
|
+
* the patch from fresh state on a lost race.
|
|
1413
|
+
*/
|
|
1250
1414
|
export async function upsertAnalysis(
|
|
1251
1415
|
id: string,
|
|
1252
1416
|
body: {
|
|
@@ -1259,8 +1423,17 @@ export async function upsertAnalysis(
|
|
|
1259
1423
|
resultData?: Record<string, unknown> | null;
|
|
1260
1424
|
},
|
|
1261
1425
|
ctx: AccessCtx,
|
|
1426
|
+
expectedUpdatedAt?: string,
|
|
1262
1427
|
): Promise<AnalysisRecord> {
|
|
1263
1428
|
const existing = await getAnalysis(id, ctx);
|
|
1429
|
+
if (!existing && expectedUpdatedAt !== undefined) {
|
|
1430
|
+
// A fence was supplied against a specific prior version, but the row is
|
|
1431
|
+
// gone (deleted, or a legacy key that failed to migrate) by the time we
|
|
1432
|
+
// looked. Treat this as a conflict rather than silently creating a fresh
|
|
1433
|
+
// row — the caller's mutation was computed against state that no longer
|
|
1434
|
+
// exists.
|
|
1435
|
+
throw new AnalysisConflictError(id);
|
|
1436
|
+
}
|
|
1264
1437
|
const db = getDb() as any;
|
|
1265
1438
|
if (existing) {
|
|
1266
1439
|
await assertAccess("analysis", id, "editor", {
|
|
@@ -1305,11 +1478,36 @@ export async function upsertAnalysis(
|
|
|
1305
1478
|
JSON.stringify(existing.dataSources) ||
|
|
1306
1479
|
next.resultMarkdown !== existing.resultMarkdown ||
|
|
1307
1480
|
JSON.stringify(next.resultData) !== JSON.stringify(existing.resultData);
|
|
1308
|
-
if (
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
.
|
|
1312
|
-
|
|
1481
|
+
if (expectedUpdatedAt !== undefined) {
|
|
1482
|
+
// Fenced write. Snapshot the revision only after we know this exact
|
|
1483
|
+
// write actually landed — otherwise a lost race would record a
|
|
1484
|
+
// revision for a save that never happened.
|
|
1485
|
+
const updateResult = await db
|
|
1486
|
+
.update(schema.analyses)
|
|
1487
|
+
.set(patch)
|
|
1488
|
+
.where(
|
|
1489
|
+
and(
|
|
1490
|
+
eq(schema.analyses.id, id),
|
|
1491
|
+
eq(schema.analyses.updatedAt, expectedUpdatedAt),
|
|
1492
|
+
),
|
|
1493
|
+
);
|
|
1494
|
+
const affected = affectedRowCount(updateResult);
|
|
1495
|
+
if (affected === undefined) {
|
|
1496
|
+
throw new Error(
|
|
1497
|
+
"The database driver did not report an affected-row count for the fenced analysis update.",
|
|
1498
|
+
);
|
|
1499
|
+
}
|
|
1500
|
+
if (affected === 0) {
|
|
1501
|
+
throw new AnalysisConflictError(id);
|
|
1502
|
+
}
|
|
1503
|
+
if (changed) await snapshotAnalysisRevision(db, existing, ctx);
|
|
1504
|
+
} else {
|
|
1505
|
+
if (changed) await snapshotAnalysisRevision(db, existing, ctx);
|
|
1506
|
+
await db
|
|
1507
|
+
.update(schema.analyses)
|
|
1508
|
+
.set(patch)
|
|
1509
|
+
.where(eq(schema.analyses.id, id));
|
|
1510
|
+
}
|
|
1313
1511
|
} else {
|
|
1314
1512
|
await db.insert(schema.analyses).values({
|
|
1315
1513
|
id,
|
|
@@ -1337,6 +1535,77 @@ export async function upsertAnalysis(
|
|
|
1337
1535
|
return rowToAnalysis(row);
|
|
1338
1536
|
}
|
|
1339
1537
|
|
|
1538
|
+
/** Max attempts (first try + retries) for `upsertAnalysisWithRetry`. */
|
|
1539
|
+
export const ANALYSIS_SAVE_MAX_ATTEMPTS = 3;
|
|
1540
|
+
|
|
1541
|
+
/**
|
|
1542
|
+
* Read-modify-write helper for action call sites that fetch an analysis,
|
|
1543
|
+
* mutate its fields in memory, then save it back. Fences every save with the
|
|
1544
|
+
* `updatedAt` of the record `mutate` was given, so a concurrent writer (e.g.
|
|
1545
|
+
* `save-analysis` re-running with fresh results while someone renames it)
|
|
1546
|
+
* never gets silently clobbered.
|
|
1547
|
+
*
|
|
1548
|
+
* `mutate` is invoked with the freshest `AnalysisRecord` on every attempt —
|
|
1549
|
+
* re-fetched from `getAnalysis` each time — and must recompute the body patch
|
|
1550
|
+
* to save FROM THAT RECORD, not from a closure over an earlier read; only
|
|
1551
|
+
* then does a retry actually merge both writers' changes instead of
|
|
1552
|
+
* re-deriving the same stale result. `mutate` may throw a non-conflict error
|
|
1553
|
+
* (e.g. validation) to abort immediately without retrying.
|
|
1554
|
+
*
|
|
1555
|
+
* On a lost race, this re-reads and re-invokes `mutate` up to `maxAttempts`
|
|
1556
|
+
* times before failing loud with a clear error so callers never silently
|
|
1557
|
+
* drop a write or loop forever.
|
|
1558
|
+
*/
|
|
1559
|
+
export async function upsertAnalysisWithRetry(
|
|
1560
|
+
id: string,
|
|
1561
|
+
ctx: AccessCtx,
|
|
1562
|
+
mutate: (existing: AnalysisRecord) =>
|
|
1563
|
+
| {
|
|
1564
|
+
name?: string;
|
|
1565
|
+
description?: string;
|
|
1566
|
+
question?: string;
|
|
1567
|
+
instructions?: string;
|
|
1568
|
+
dataSources?: string[];
|
|
1569
|
+
resultMarkdown?: string;
|
|
1570
|
+
resultData?: Record<string, unknown> | null;
|
|
1571
|
+
}
|
|
1572
|
+
| Promise<{
|
|
1573
|
+
name?: string;
|
|
1574
|
+
description?: string;
|
|
1575
|
+
question?: string;
|
|
1576
|
+
instructions?: string;
|
|
1577
|
+
dataSources?: string[];
|
|
1578
|
+
resultMarkdown?: string;
|
|
1579
|
+
resultData?: Record<string, unknown> | null;
|
|
1580
|
+
}>,
|
|
1581
|
+
maxAttempts: number = ANALYSIS_SAVE_MAX_ATTEMPTS,
|
|
1582
|
+
): Promise<AnalysisRecord> {
|
|
1583
|
+
let lastConflict: unknown;
|
|
1584
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
1585
|
+
const existing = await getAnalysis(id, ctx);
|
|
1586
|
+
if (!existing) {
|
|
1587
|
+
throw new Error(`analysis "${id}" not found (or you don't have access).`);
|
|
1588
|
+
}
|
|
1589
|
+
const body = await mutate(existing);
|
|
1590
|
+
try {
|
|
1591
|
+
return await upsertAnalysis(id, body, ctx, existing.updatedAt);
|
|
1592
|
+
} catch (err) {
|
|
1593
|
+
if (err instanceof AnalysisConflictError) {
|
|
1594
|
+
lastConflict = err;
|
|
1595
|
+
continue;
|
|
1596
|
+
}
|
|
1597
|
+
throw err;
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
const finalError = new Error(
|
|
1601
|
+
`Could not save analysis "${id}" after ${maxAttempts} attempt(s); it kept changing concurrently. Re-read the analysis and try again.`,
|
|
1602
|
+
);
|
|
1603
|
+
if (lastConflict !== undefined) {
|
|
1604
|
+
(finalError as Error & { cause?: unknown }).cause = lastConflict;
|
|
1605
|
+
}
|
|
1606
|
+
throw finalError;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1340
1609
|
export async function listAnalysisRevisions(
|
|
1341
1610
|
analysisId: string,
|
|
1342
1611
|
ctx: AccessCtx,
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
type DictionaryEntry = Record<string, unknown>;
|
|
2
2
|
|
|
3
3
|
const MAX_INJECTED_ENTRIES = 40;
|
|
4
|
+
// Per-field caps above bound a single entry to ~3-3.5K chars, so 40 entries
|
|
5
|
+
// could still swell to ~130K chars riding every chat request even though the
|
|
6
|
+
// entry count is capped. Bound the whole rendered block too, and truncate at
|
|
7
|
+
// entry boundaries (never mid-entry) once it's hit.
|
|
8
|
+
const MAX_DICTIONARY_CONTEXT_CHARS = 10_000;
|
|
4
9
|
|
|
5
10
|
function compact(value: unknown, max = 240): string {
|
|
6
11
|
const text = String(value ?? "")
|
|
@@ -97,6 +102,76 @@ function renderOmittedDictionaryEntries(omitted: number): string[] {
|
|
|
97
102
|
];
|
|
98
103
|
}
|
|
99
104
|
|
|
105
|
+
function renderedTextLength(lines: string[]): number {
|
|
106
|
+
// +1 per line approximates the join("\n") separators without materializing
|
|
107
|
+
// the joined string on every entry (entry counts are small, so this stays
|
|
108
|
+
// cheap even though it's O(n) per call).
|
|
109
|
+
return lines.reduce((total, line) => total + line.length + 1, 0);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
type TrustLabel = "approved/canonical" | "unreviewed/human" | "ai-suggestion";
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Render one trust-tier group into `lines`, respecting both the per-tier
|
|
116
|
+
* count budget already applied by `takeWithinBudget` and the shared total
|
|
117
|
+
* character budget tracked in `state`. Entries are never split mid-render:
|
|
118
|
+
* once adding the next whole entry would exceed the char budget, rendering
|
|
119
|
+
* stops at that entry boundary and everything remaining (in this group and
|
|
120
|
+
* any group processed after it) is counted as omitted.
|
|
121
|
+
*/
|
|
122
|
+
function renderGroupWithinBudget(
|
|
123
|
+
lines: string[],
|
|
124
|
+
title: string,
|
|
125
|
+
groupEntries: DictionaryEntry[],
|
|
126
|
+
trustLabel: TrustLabel,
|
|
127
|
+
renderedCount: number,
|
|
128
|
+
state: { charBudgetExceeded: boolean; anyEntryRendered: boolean },
|
|
129
|
+
): { renderedCount: number; omitted: number } {
|
|
130
|
+
if (!groupEntries.length) return { renderedCount, omitted: 0 };
|
|
131
|
+
|
|
132
|
+
const budgeted = takeWithinBudget(groupEntries, renderedCount);
|
|
133
|
+
let omitted = budgeted.omitted;
|
|
134
|
+
const bodyLines: string[] = [];
|
|
135
|
+
let includedFromGroup = 0;
|
|
136
|
+
|
|
137
|
+
for (const entry of budgeted.entries) {
|
|
138
|
+
if (state.charBudgetExceeded) {
|
|
139
|
+
omitted += 1;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const entryLines = renderEntry(entry, trustLabel);
|
|
144
|
+
const headerAddition = includedFromGroup === 0 ? title.length + 1 : 0;
|
|
145
|
+
const prospectiveTotal =
|
|
146
|
+
renderedTextLength(lines) +
|
|
147
|
+
headerAddition +
|
|
148
|
+
renderedTextLength(bodyLines) +
|
|
149
|
+
renderedTextLength(entryLines);
|
|
150
|
+
|
|
151
|
+
// Always keep at least one entry across the whole dictionary render so a
|
|
152
|
+
// single oversized entry can't produce an empty block; every entry after
|
|
153
|
+
// that respects the char budget at its boundary.
|
|
154
|
+
if (
|
|
155
|
+
prospectiveTotal > MAX_DICTIONARY_CONTEXT_CHARS &&
|
|
156
|
+
state.anyEntryRendered
|
|
157
|
+
) {
|
|
158
|
+
state.charBudgetExceeded = true;
|
|
159
|
+
omitted += 1;
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
bodyLines.push(...entryLines);
|
|
164
|
+
includedFromGroup += 1;
|
|
165
|
+
state.anyEntryRendered = true;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (includedFromGroup > 0) {
|
|
169
|
+
lines.push(title, ...bodyLines, "");
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return { renderedCount: budgeted.renderedCount, omitted };
|
|
173
|
+
}
|
|
174
|
+
|
|
100
175
|
/**
|
|
101
176
|
* Render data-dictionary entries as compact prompt context.
|
|
102
177
|
*
|
|
@@ -127,6 +202,7 @@ export function renderDataDictionary(entries: DictionaryEntry[]): string {
|
|
|
127
202
|
const includeAiSuggestions = approved.length + humanUnreviewed.length === 0;
|
|
128
203
|
let renderedCount = 0;
|
|
129
204
|
let omittedEntries = 0;
|
|
205
|
+
const budgetState = { charBudgetExceeded: false, anyEntryRendered: false };
|
|
130
206
|
|
|
131
207
|
const lines: string[] = [
|
|
132
208
|
"<data-dictionary>",
|
|
@@ -136,43 +212,39 @@ export function renderDataDictionary(entries: DictionaryEntry[]): string {
|
|
|
136
212
|
"",
|
|
137
213
|
];
|
|
138
214
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
}
|
|
215
|
+
const approvedResult = renderGroupWithinBudget(
|
|
216
|
+
lines,
|
|
217
|
+
"## Approved canonical entries",
|
|
218
|
+
approved,
|
|
219
|
+
"approved/canonical",
|
|
220
|
+
renderedCount,
|
|
221
|
+
budgetState,
|
|
222
|
+
);
|
|
223
|
+
renderedCount = approvedResult.renderedCount;
|
|
224
|
+
omittedEntries += approvedResult.omitted;
|
|
151
225
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
}
|
|
226
|
+
const humanResult = renderGroupWithinBudget(
|
|
227
|
+
lines,
|
|
228
|
+
"## Unreviewed human-authored entries",
|
|
229
|
+
humanUnreviewed,
|
|
230
|
+
"unreviewed/human",
|
|
231
|
+
renderedCount,
|
|
232
|
+
budgetState,
|
|
233
|
+
);
|
|
234
|
+
renderedCount = humanResult.renderedCount;
|
|
235
|
+
omittedEntries += humanResult.omitted;
|
|
164
236
|
|
|
165
237
|
if (includeAiSuggestions && aiSuggestions.length) {
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
238
|
+
const aiResult = renderGroupWithinBudget(
|
|
239
|
+
lines,
|
|
240
|
+
"## AI-generated suggestions",
|
|
241
|
+
aiSuggestions,
|
|
242
|
+
"ai-suggestion",
|
|
243
|
+
renderedCount,
|
|
244
|
+
budgetState,
|
|
245
|
+
);
|
|
246
|
+
renderedCount = aiResult.renderedCount;
|
|
247
|
+
omittedEntries += aiResult.omitted;
|
|
176
248
|
} else if (aiSuggestions.length) {
|
|
177
249
|
lines.push(
|
|
178
250
|
`${aiSuggestions.length} AI-generated unapproved suggestion${
|
|
@@ -265,7 +265,10 @@ export async function ensureDemoDashboardsForUser(
|
|
|
265
265
|
throw new Error(`Demo dashboard seed not found: ${demo.seedId}`);
|
|
266
266
|
const config = applyDemoMetadata(seed, demo.id);
|
|
267
267
|
const row = await upsertDashboard(dashboardId, "sql", config, privateCtx);
|
|
268
|
-
|
|
268
|
+
// SQL is the source of truth and collab state can seed lazily. Do not
|
|
269
|
+
// hold first-open installation (and the whole app shell) behind a remote
|
|
270
|
+
// collab read/write that may be slow or temporarily unavailable.
|
|
271
|
+
void syncToCollab(dashboardId, config);
|
|
269
272
|
archivedAt = row.archivedAt;
|
|
270
273
|
created = !existing;
|
|
271
274
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getOrgContext } from "@agent-native/core/org";
|
|
2
2
|
import {
|
|
3
3
|
createAgentChatPlugin,
|
|
4
|
-
getRequestRunContext,
|
|
5
4
|
loadActionsFromStaticRegistry,
|
|
6
5
|
type AgentLoopFinalResponseGuardContext,
|
|
7
6
|
} from "@agent-native/core/server";
|
|
@@ -11,7 +10,6 @@ import {
|
|
|
11
10
|
applyAnalyticsPlanModePolicy,
|
|
12
11
|
INITIAL_TOOL_NAMES,
|
|
13
12
|
} from "../lib/agent-chat-plan-mode";
|
|
14
|
-
import { renderDataDictionary } from "../lib/data-dictionary-context";
|
|
15
13
|
import {
|
|
16
14
|
failedDataQueryAttemptMessage,
|
|
17
15
|
hasExplicitPartialDisclosure,
|
|
@@ -26,12 +24,6 @@ import {
|
|
|
26
24
|
needsCorpusWorkflowForCoverageSensitiveRequest,
|
|
27
25
|
needsSourceRecordBodyWorkflowForCoverageSensitiveRequest,
|
|
28
26
|
} from "../lib/real-data-actions";
|
|
29
|
-
import {
|
|
30
|
-
listScopedSettingRecords,
|
|
31
|
-
resolveSettingsScope,
|
|
32
|
-
} from "../lib/scoped-settings";
|
|
33
|
-
|
|
34
|
-
const DATA_DICT_PREFIX = "data-dict-";
|
|
35
27
|
const ANALYTICS_BACKGROUND_RUN_SOFT_TIMEOUT_MS = 13 * 60_000;
|
|
36
28
|
|
|
37
29
|
export const SIMPLE_TIME_BOUNDED_METRIC_FAST_PATH_GUIDANCE =
|
|
@@ -46,6 +38,12 @@ export function analyticsSourceGuidanceOpening(): string {
|
|
|
46
38
|
);
|
|
47
39
|
}
|
|
48
40
|
|
|
41
|
+
export function analyticsDataDictionaryRoutingContext(): string {
|
|
42
|
+
return `<data-dictionary-routing>
|
|
43
|
+
Data-dictionary definitions are available on demand instead of being embedded in every chat request. Before writing SQL or making a metric-definition claim, call \`list-data-dictionary\` with a focused \`search\` or \`department\` filter. If the user asks what definitions exist and no useful filter is available, call it without filters. Treat approved entries as canonical, verify unreviewed human entries when stakes are high, and treat AI-generated unapproved entries as suggestions only. If no matching definition exists, inspect the configured source schema or ask the user instead of guessing.
|
|
44
|
+
</data-dictionary-routing>`;
|
|
45
|
+
}
|
|
46
|
+
|
|
49
47
|
export {
|
|
50
48
|
applyAnalyticsPlanModePolicy,
|
|
51
49
|
INITIAL_TOOL_NAMES,
|
|
@@ -231,10 +229,10 @@ export default createAgentChatPlugin({
|
|
|
231
229
|
const ctx = await getOrgContext(event);
|
|
232
230
|
return ctx.orgId;
|
|
233
231
|
},
|
|
234
|
-
extraContext: async (
|
|
235
|
-
// Always inject source guidance
|
|
236
|
-
//
|
|
237
|
-
//
|
|
232
|
+
extraContext: async () => {
|
|
233
|
+
// Always inject compact source-routing guidance. Dictionary definitions
|
|
234
|
+
// stay behind list-data-dictionary so prompt assembly does not read and
|
|
235
|
+
// render every organization metric before the model request starts.
|
|
238
236
|
const sourceGuidance =
|
|
239
237
|
analyticsSourceGuidanceOpening() +
|
|
240
238
|
"DASHBOARD CREATION RULE — You may create dashboards, analyses, SQL panels, or other resources only when the user explicitly asks you to (e.g. 'build me a dashboard for...', 'create a new analysis', 'add a chart for...'). Never create any resource proactively during research, trend analysis, or answering questions. If you think a dashboard would be useful, suggest it and wait for explicit confirmation before creating anything. Never add new items to the sidebar or modify existing dashboards without an explicit user directive. " +
|
|
@@ -268,33 +266,7 @@ export default createAgentChatPlugin({
|
|
|
268
266
|
"Do not also create a same-named dashboard or saved analysis unless the user explicitly asked for multiple artifacts; saved analyses appear in the sidebar and should not be used for throwaway notes or scratch summaries.\n" +
|
|
269
267
|
"</analytics-artifact-guidance>";
|
|
270
268
|
|
|
271
|
-
|
|
272
|
-
// + render. That settings read + synchronous render is the heaviest, most
|
|
273
|
-
// hang-prone part of worker setup on a cold bg-fn instance, and it runs
|
|
274
|
-
// EAGERLY while the system prompt is built (before any pre-send timeout can
|
|
275
|
-
// arm), so a stall here is what kept the analytics worker from ever claiming
|
|
276
|
-
// its run. The agent can still pull dictionary entries on demand via
|
|
277
|
-
// `list-data-dictionary` / `search-bigquery-schema`; the static guidance is
|
|
278
|
-
// what it needs to know they exist. Foreground requests keep the full dict.
|
|
279
|
-
if (getRequestRunContext()?.isBackgroundWorker) {
|
|
280
|
-
return `${sourceGuidance}\n\n${artifactGuidance}`;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
try {
|
|
284
|
-
const scope = await resolveSettingsScope(event);
|
|
285
|
-
const all = await listScopedSettingRecords(scope, DATA_DICT_PREFIX);
|
|
286
|
-
const entries = Object.values(all) as Array<Record<string, unknown>>;
|
|
287
|
-
const dict = renderDataDictionary(entries);
|
|
288
|
-
return dict
|
|
289
|
-
? `${sourceGuidance}\n\n${artifactGuidance}\n\n${dict}`
|
|
290
|
-
: `${sourceGuidance}\n\n${artifactGuidance}`;
|
|
291
|
-
} catch (err) {
|
|
292
|
-
console.warn(
|
|
293
|
-
"[analytics] data dictionary context failed:",
|
|
294
|
-
err instanceof Error ? err.message : err,
|
|
295
|
-
);
|
|
296
|
-
return `${sourceGuidance}\n\n${artifactGuidance}`;
|
|
297
|
-
}
|
|
269
|
+
return `${sourceGuidance}\n\n${artifactGuidance}\n\n${analyticsDataDictionaryRoutingContext()}`;
|
|
298
270
|
},
|
|
299
271
|
mentionProviders: {
|
|
300
272
|
dashboards: {
|
|
@@ -48,7 +48,7 @@ Default to Apple/Linear-level restraint: make the primary workflow obvious, then
|
|
|
48
48
|
|
|
49
49
|
- **Typography**: Use the product's existing type system first. For net-new public pages, choose characterful but readable type and keep sizing appropriate to the surface.
|
|
50
50
|
- **Color and theme**: Use semantic tokens and CSS variables. Avoid one-note palettes and default purple/blue gradients unless the brand demands them.
|
|
51
|
-
- **Motion**: Prefer purposeful transitions and small state changes. Use CSS transitions/keyframes unless the app already uses a motion library.
|
|
51
|
+
- **Motion**: Prefer purposeful transitions and small state changes. Use CSS transitions/keyframes unless the app already uses a motion library. Never `transition-all` — list the properties that actually change (e.g. `transition-[opacity,transform]`). Use the shared easing tokens defined in `packages/core/src/styles/agent-native.css` instead of hand-typing curves: `var(--ease-drawer)` (260ms, drawers/app chrome), `var(--ease-collapse)` (200ms, expand/collapse), `var(--ease-out-strong)` (snappy entrances) — in Tailwind, `ease-[var(--ease-collapse)]`. Enter/exit with ease-out, never `ease-in`. Overlays that zoom in must set the Radix origin var (e.g. `origin-[--radix-popover-content-transform-origin]`). Animate `transform`/`opacity`, not width/height/padding/box-shadow. Gate looping or large-movement animations with `motion-reduce:`. Command palettes and keyboard-triggered actions get no animation.
|
|
52
52
|
- **Composition**: Match the workflow. Operational apps should be dense and scannable; marketing or portfolio pages can be more immersive.
|
|
53
53
|
- **Visual assets**: Websites, games, and object-focused pages need real or generated media when images help users understand the subject.
|
|
54
54
|
- **Responsive fit**: Text must not overflow buttons, cards, tabs, sidebars, or fixed-format tools. Use stable dimensions for boards, grids, toolbars, and counters.
|