@agent-native/core 0.95.1 → 0.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +64 -0
- package/corpus/core/docs/content/audit-log.mdx +2 -1
- package/corpus/core/docs/content/automations.mdx +7 -7
- package/corpus/core/docs/content/creating-templates.mdx +1 -1
- package/corpus/core/docs/content/internationalization.mdx +2 -1
- package/corpus/core/docs/content/locales/ar-SA/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/ar-SA/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/ar-SA/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/ar-SA/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/package-lifecycle.mdx +19 -0
- package/corpus/core/docs/content/locales/ar-SA/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/ar-SA/security.mdx +8 -0
- package/corpus/core/docs/content/locales/de-DE/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/de-DE/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/de-DE/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/de-DE/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/package-lifecycle.mdx +22 -0
- package/corpus/core/docs/content/locales/de-DE/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/de-DE/security.mdx +8 -0
- package/corpus/core/docs/content/locales/es-ES/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/es-ES/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/es-ES/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/es-ES/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/package-lifecycle.mdx +22 -0
- package/corpus/core/docs/content/locales/es-ES/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/es-ES/security.mdx +8 -0
- package/corpus/core/docs/content/locales/fr-FR/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/fr-FR/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/fr-FR/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/fr-FR/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/package-lifecycle.mdx +21 -0
- package/corpus/core/docs/content/locales/fr-FR/sandbox-adapters.mdx +19 -8
- package/corpus/core/docs/content/locales/fr-FR/security.mdx +8 -0
- package/corpus/core/docs/content/locales/hi-IN/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/hi-IN/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/hi-IN/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/hi-IN/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/package-lifecycle.mdx +20 -0
- package/corpus/core/docs/content/locales/hi-IN/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/hi-IN/security.mdx +8 -0
- package/corpus/core/docs/content/locales/ja-JP/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/ja-JP/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/ja-JP/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/ja-JP/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/package-lifecycle.mdx +21 -0
- package/corpus/core/docs/content/locales/ja-JP/sandbox-adapters.mdx +17 -6
- package/corpus/core/docs/content/locales/ja-JP/security.mdx +8 -0
- package/corpus/core/docs/content/locales/ko-KR/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/ko-KR/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/ko-KR/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/ko-KR/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/package-lifecycle.mdx +20 -0
- package/corpus/core/docs/content/locales/ko-KR/sandbox-adapters.mdx +17 -6
- package/corpus/core/docs/content/locales/ko-KR/security.mdx +8 -0
- package/corpus/core/docs/content/locales/pt-BR/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/pt-BR/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/pt-BR/getting-started.mdx +7 -1
- package/corpus/core/docs/content/locales/pt-BR/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/package-lifecycle.mdx +21 -0
- package/corpus/core/docs/content/locales/pt-BR/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/pt-BR/security.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-CN/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/zh-CN/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/zh-CN/getting-started.mdx +6 -4
- package/corpus/core/docs/content/locales/zh-CN/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/package-lifecycle.mdx +19 -0
- package/corpus/core/docs/content/locales/zh-CN/sandbox-adapters.mdx +17 -6
- package/corpus/core/docs/content/locales/zh-CN/security.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-TW/audit-log.mdx +2 -1
- package/corpus/core/docs/content/locales/zh-TW/automations.mdx +7 -7
- package/corpus/core/docs/content/locales/zh-TW/getting-started.mdx +6 -4
- package/corpus/core/docs/content/locales/zh-TW/internationalization.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/package-lifecycle.mdx +19 -0
- package/corpus/core/docs/content/locales/zh-TW/sandbox-adapters.mdx +18 -7
- package/corpus/core/docs/content/locales/zh-TW/security.mdx +8 -0
- package/corpus/core/docs/content/package-lifecycle.mdx +51 -0
- package/corpus/core/docs/content/sandbox-adapters.mdx +16 -5
- package/corpus/core/package.json +11 -2
- package/corpus/core/src/a2a/auth-policy.ts +33 -0
- package/corpus/core/src/a2a/client.ts +11 -1
- package/corpus/core/src/agent/durable-background.ts +15 -7
- package/corpus/core/src/agent/production-agent.ts +87 -27
- package/corpus/core/src/agent/run-store.ts +13 -4
- package/corpus/core/src/agent/thread-data-builder.ts +7 -5
- package/corpus/core/src/audit/actions/export-audit-events.ts +162 -0
- package/corpus/core/src/audit/store.ts +8 -3
- package/corpus/core/src/audit/types.ts +3 -0
- package/corpus/core/src/chat-threads/store.ts +20 -1
- package/corpus/core/src/cli/code-agent-executor.ts +1 -0
- package/corpus/core/src/cli/code-agent-runs.ts +14 -0
- package/corpus/core/src/cli/doctor.ts +396 -0
- package/corpus/core/src/cli/index.ts +56 -0
- package/corpus/core/src/cli/info.ts +3 -3
- package/corpus/core/src/cli/package-lifecycle.ts +821 -0
- package/corpus/core/src/client/AgentPanel.tsx +32 -25
- package/corpus/core/src/client/AssistantChat.tsx +36 -20
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +141 -90
- package/corpus/core/src/client/agent-chat-adapter.ts +9 -9
- package/corpus/core/src/client/chat/ChatHistoryList.tsx +404 -0
- package/corpus/core/src/client/chat/index.ts +6 -0
- package/corpus/core/src/client/chat/tool-call-display.tsx +37 -3
- package/corpus/core/src/client/code-agent-chat-adapter.ts +72 -4
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +52 -11
- package/corpus/core/src/client/composer/TiptapComposer.tsx +157 -20
- package/corpus/core/src/client/composer/VoiceButton.tsx +28 -0
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +5 -0
- package/corpus/core/src/client/conversation/code-agent-transcript.ts +4 -5
- package/corpus/core/src/client/guided-questions.tsx +2 -1
- package/corpus/core/src/client/index.ts +11 -0
- package/corpus/core/src/client/use-chat-threads.ts +10 -1
- package/corpus/core/src/client/voice-provider-status.ts +44 -0
- package/corpus/core/src/code-agents/transcript-normalizer.ts +76 -0
- package/corpus/core/src/deploy/build.ts +12 -11
- package/corpus/core/src/guards/db-tool-scoping.ts +129 -0
- package/corpus/core/src/guards/index.ts +23 -0
- package/corpus/core/src/guards/no-drizzle-push.ts +116 -0
- package/corpus/core/src/guards/no-env-credentials.ts +229 -0
- package/corpus/core/src/guards/no-env-mutation.ts +114 -0
- package/corpus/core/src/guards/no-localhost-fallback.ts +124 -0
- package/corpus/core/src/guards/no-unscoped-credentials.ts +227 -0
- package/corpus/core/src/guards/no-unscoped-queries.ts +834 -0
- package/corpus/core/src/guards/scan-utils.ts +105 -0
- package/corpus/core/src/guards/types.ts +30 -0
- package/corpus/core/src/integrations/a2a-continuation-processor.ts +35 -5
- package/corpus/core/src/integrations/adapters/slack.ts +74 -21
- package/corpus/core/src/integrations/webhook-handler.ts +14 -0
- package/corpus/core/src/localization/default-messages.ts +6 -0
- package/corpus/core/src/observability/hosted-model-experiment.ts +118 -0
- package/corpus/core/src/observability/routes.ts +17 -0
- package/corpus/core/src/observability/store.ts +4 -1
- package/corpus/core/src/observability/traces.ts +41 -2
- package/corpus/core/src/org/accept-pending.ts +9 -1
- package/corpus/core/src/org/migrations.ts +41 -0
- package/corpus/core/src/package-lifecycle/index.ts +1 -0
- package/corpus/core/src/package-lifecycle/manifest.ts +120 -0
- package/corpus/core/src/provider-api/custom-registry.ts +56 -0
- package/corpus/core/src/provider-api/index.ts +2 -0
- package/corpus/core/src/scripts/agent-engines/list-agent-engines.ts +19 -1
- package/corpus/core/src/scripts/call-agent.ts +53 -3
- package/corpus/core/src/scripts/chat/search-chats.ts +11 -8
- package/corpus/core/src/secrets/register-framework-secrets.ts +1 -1
- package/corpus/core/src/secrets/storage.ts +47 -27
- package/corpus/core/src/server/action-discovery.ts +4 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +95 -18
- package/corpus/core/src/server/core-routes-plugin.ts +45 -14
- package/corpus/core/src/server/csrf.ts +24 -5
- package/corpus/core/src/server/framework-request-handler.ts +34 -0
- package/corpus/core/src/server/google-realtime-session.ts +1 -36
- package/corpus/core/src/server/poll.ts +24 -2
- package/corpus/core/src/server/realtime-voice.ts +80 -24
- package/corpus/core/src/server/request-origin.ts +63 -0
- package/corpus/core/src/server/transcribe-voice.ts +1 -50
- package/corpus/core/src/server/voice-providers-status.ts +4 -3
- package/corpus/core/src/shared/cache-control.ts +2 -8
- package/corpus/core/src/styles/agent-native.css +1 -0
- package/corpus/core/src/styles/chat-history-list.css +313 -0
- package/corpus/core/src/templates/default/package.json +2 -2
- package/corpus/core/src/templates/headless/package.json +0 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/audit-log/SKILL.md +3 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +8 -4
- package/corpus/core/src/templates/workspace-core/package.json +0 -1
- package/corpus/core/src/templates/workspace-root/package.json +0 -1
- package/corpus/core/src/triggers/actions.ts +11 -3
- package/corpus/core/src/triggers/types.ts +7 -1
- package/corpus/core/src/vite/client.ts +1 -0
- package/corpus/templates/analytics/AGENTS.md +7 -0
- package/corpus/templates/analytics/actions/bigquery.ts +26 -2
- package/corpus/templates/analytics/actions/compose-dashboard.ts +65 -37
- package/corpus/templates/analytics/actions/data-source-status.ts +18 -0
- package/corpus/templates/analytics/actions/mutate-dashboard.ts +73 -24
- package/corpus/templates/analytics/actions/reorder-dashboard-panels.ts +16 -13
- package/corpus/templates/analytics/actions/update-dashboard.ts +53 -42
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +5 -4
- package/corpus/templates/analytics/app/global.css +10 -0
- package/corpus/templates/analytics/app/pages/Ask.tsx +25 -2
- package/corpus/templates/analytics/changelog/2026-07-10-analytics-answers-simple-time-bounded-metrics-without-unnece.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-analytics-chat-reliably-uses-connected-data-sources-across-s.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-chat-threads-now-stay-clear-of-top-actions-and-fade-smoothly.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-context-chips-can-now-be-selected-and-removed-one-at-a-time-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-dashboard-edits-from-the-agent-and-the-ui-at-the-same-time-n.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-the-ask-composer-no-longer-carries-dashboard-or-panel-contex.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-the-ask-section-stays-highlighted-while-its-chat-history-is-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-timed-out-bigquery-jobs-are-now-cancelled-so-they-stop-consu.md +6 -0
- package/corpus/templates/analytics/package.json +1 -2
- package/corpus/templates/analytics/server/lib/bigquery.ts +91 -14
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +154 -11
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +82 -7
- package/corpus/templates/assets/package.json +1 -2
- package/corpus/templates/brain/package.json +1 -2
- package/corpus/templates/calendar/package.json +1 -2
- package/corpus/templates/chat/package.json +1 -2
- package/corpus/templates/clips/changelog/2026-07-10-atomic-view-tracking.md +6 -0
- package/corpus/templates/clips/chrome-extension/package.json +3 -2
- package/corpus/templates/clips/desktop/package.json +6 -4
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +26 -13
- package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +4 -1
- package/corpus/templates/clips/package.json +1 -2
- package/corpus/templates/clips/server/db/schema.ts +29 -17
- package/corpus/templates/clips/server/plugins/db.ts +8 -0
- package/corpus/templates/clips/server/routes/api/view-event.post.ts +260 -105
- package/corpus/templates/content/.agents/skills/notion-integration/SKILL.md +16 -0
- package/corpus/templates/content/AGENTS.md +72 -62
- package/corpus/templates/content/actions/_content-database-source-adapters.ts +84 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +206 -96
- package/corpus/templates/content/actions/_notion-database-source-adapter.ts +216 -0
- package/corpus/templates/content/actions/_position-utils.ts +76 -0
- package/corpus/templates/content/actions/_property-utils.ts +31 -20
- package/corpus/templates/content/actions/add-database-item.ts +52 -39
- package/corpus/templates/content/actions/attach-content-database-source.ts +95 -11
- package/corpus/templates/content/actions/change-content-database-source-role.ts +24 -1
- package/corpus/templates/content/actions/configure-document-property.ts +36 -27
- package/corpus/templates/content/actions/create-content-database.ts +40 -30
- package/corpus/templates/content/actions/create-document.ts +39 -32
- package/corpus/templates/content/actions/duplicate-document-property.ts +37 -28
- package/corpus/templates/content/actions/list-notion-database-sources.ts +80 -0
- package/corpus/templates/content/actions/move-document.ts +64 -48
- package/corpus/templates/content/actions/refresh-content-database-source.ts +42 -3
- package/corpus/templates/content/actions/share-local-file-document.ts +36 -27
- package/corpus/templates/content/actions/suggest-source-join-key.ts +39 -16
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +89 -23
- package/corpus/templates/content/app/components/editor/database/settings.tsx +1 -1
- package/corpus/templates/content/app/hooks/use-content-database.ts +18 -1
- package/corpus/templates/content/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/content/app/i18n-data.ts +40 -0
- package/corpus/templates/content/changelog/2026-07-10-failed-row-creation-and-source-attach-now-show-an-error-inst.md +6 -0
- package/corpus/templates/content/changelog/2026-07-10-items-added-at-the-same-time-no-longer-end-up-with-identical.md +6 -0
- package/corpus/templates/content/changelog/2026-07-10-notion-databases-can-add-read-only-details-to-content-tables.md +6 -0
- package/corpus/templates/content/package.json +1 -2
- package/corpus/templates/content/parity/matrix.md +25 -25
- package/corpus/templates/content/parity/matrix.ts +1 -0
- package/corpus/templates/content/server/routes/api/documents/[id]/move.patch.ts +43 -26
- package/corpus/templates/content/shared/api.ts +16 -1
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +8 -4
- package/corpus/templates/design/AGENTS.md +12 -2
- package/corpus/templates/design/DEVELOPING.md +10 -6
- package/corpus/templates/design/actions/apply-visual-edit.ts +191 -6
- package/corpus/templates/design/actions/duplicate-design.ts +31 -25
- package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +5 -1
- package/corpus/templates/design/changelog/2026-07-10-duplicating-a-design-can-no-longer-produce-a-copy-with-missi.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-local-visual-edits-can-now-save-safe-leaf-text-class-and.md +6 -0
- package/corpus/templates/design/package.json +1 -1
- package/corpus/templates/design/shared/local-jsx-visual-edit.ts +388 -0
- package/corpus/templates/dispatch/package.json +1 -2
- package/corpus/templates/forms/actions/patch-form-fields.ts +82 -44
- package/corpus/templates/forms/changelog/2026-07-10-simultaneous-edits-to-different-form-fields-no-longer-overwr.md +6 -0
- package/corpus/templates/forms/package.json +1 -2
- package/corpus/templates/macros/package.json +1 -2
- package/corpus/templates/mail/app/components/email/EmailThread.tsx +3 -1
- package/corpus/templates/mail/changelog/2026-07-10-fixed-calendar-rsvp-buttons-in-emails-firing-duplicate-respo.md +6 -0
- package/corpus/templates/mail/package.json +1 -2
- package/corpus/templates/plan/actions/restore-plan-version.ts +126 -96
- package/corpus/templates/plan/changelog/2026-07-10-restoring-a-plan-version-can-no-longer-leave-a-plan-half-res.md +6 -0
- package/corpus/templates/plan/package.json +1 -2
- package/corpus/templates/plan/server/plans.ts +9 -2
- package/corpus/templates/slides/actions/list-decks.ts +28 -0
- package/corpus/templates/slides/app/components/deck/MermaidRenderer.tsx +41 -26
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +4 -8
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +2 -4
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +4 -8
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +5 -12
- package/corpus/templates/slides/app/components/editor/HistoryPanel.tsx +3 -6
- package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +3 -6
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +2 -5
- package/corpus/templates/slides/app/context/DeckContext.tsx +47 -4
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +11 -30
- package/corpus/templates/slides/app/pages/Index.tsx +2 -3
- package/corpus/templates/slides/app/root.tsx +0 -5
- package/corpus/templates/slides/changelog/2026-07-10-deck-lists-load-much-faster-and-no-longer-re-download-slide-.md +6 -0
- package/corpus/templates/slides/package.json +1 -2
- package/dist/a2a/auth-policy.d.ts +19 -0
- package/dist/a2a/auth-policy.d.ts.map +1 -1
- package/dist/a2a/auth-policy.js +32 -0
- package/dist/a2a/auth-policy.js.map +1 -1
- package/dist/a2a/client.d.ts +7 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +2 -1
- package/dist/a2a/client.js.map +1 -1
- package/dist/agent/durable-background.d.ts +8 -5
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +15 -8
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/production-agent.d.ts +6 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +63 -26
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +9 -4
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts +1 -0
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +6 -5
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/audit/actions/export-audit-events.d.ts +27 -0
- package/dist/audit/actions/export-audit-events.d.ts.map +1 -0
- package/dist/audit/actions/export-audit-events.js +144 -0
- package/dist/audit/actions/export-audit-events.js.map +1 -0
- package/dist/audit/store.d.ts +1 -0
- package/dist/audit/store.d.ts.map +1 -1
- package/dist/audit/store.js +8 -3
- package/dist/audit/store.js.map +1 -1
- package/dist/audit/types.d.ts +3 -0
- package/dist/audit/types.d.ts.map +1 -1
- package/dist/audit/types.js.map +1 -1
- package/dist/chat-threads/store.d.ts +10 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +6 -0
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +1 -0
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/code-agent-runs.d.ts +12 -0
- package/dist/cli/code-agent-runs.d.ts.map +1 -1
- package/dist/cli/code-agent-runs.js +1 -0
- package/dist/cli/code-agent-runs.js.map +1 -1
- package/dist/cli/doctor.d.ts +83 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +277 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/index.js +50 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/info.js +3 -3
- package/dist/cli/info.js.map +1 -1
- package/dist/cli/package-lifecycle.d.ts +50 -0
- package/dist/cli/package-lifecycle.d.ts.map +1 -0
- package/dist/cli/package-lifecycle.js +560 -0
- package/dist/cli/package-lifecycle.js.map +1 -0
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +3 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +11 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +7 -4
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +83 -10
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.js +7 -3
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/chat/ChatHistoryList.d.ts +88 -0
- package/dist/client/chat/ChatHistoryList.d.ts.map +1 -0
- package/dist/client/chat/ChatHistoryList.js +83 -0
- package/dist/client/chat/ChatHistoryList.js.map +1 -0
- package/dist/client/chat/index.d.ts +1 -0
- package/dist/client/chat/index.d.ts.map +1 -1
- package/dist/client/chat/index.js +1 -0
- package/dist/client/chat/index.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +13 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +10 -2
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/code-agent-chat-adapter.d.ts +17 -1
- package/dist/client/code-agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/code-agent-chat-adapter.js +47 -3
- package/dist/client/code-agent-chat-adapter.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +11 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +5 -3
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +25 -2
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +96 -5
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +21 -1
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +5 -0
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/conversation/code-agent-transcript.d.ts +2 -0
- package/dist/client/conversation/code-agent-transcript.d.ts.map +1 -1
- package/dist/client/conversation/code-agent-transcript.js +3 -5
- package/dist/client/conversation/code-agent-transcript.js.map +1 -1
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +2 -1
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +9 -1
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/client/voice-provider-status.d.ts +10 -0
- package/dist/client/voice-provider-status.d.ts.map +1 -0
- package/dist/client/voice-provider-status.js +32 -0
- package/dist/client/voice-provider-status.js.map +1 -0
- package/dist/code-agents/transcript-normalizer.d.ts +29 -0
- package/dist/code-agents/transcript-normalizer.d.ts.map +1 -1
- package/dist/code-agents/transcript-normalizer.js +55 -0
- package/dist/code-agents/transcript-normalizer.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +13 -11
- package/dist/deploy/build.js.map +1 -1
- package/dist/guards/db-tool-scoping.d.ts +38 -0
- package/dist/guards/db-tool-scoping.d.ts.map +1 -0
- package/dist/guards/db-tool-scoping.js +114 -0
- package/dist/guards/db-tool-scoping.js.map +1 -0
- package/dist/guards/index.d.ts +23 -0
- package/dist/guards/index.d.ts.map +1 -0
- package/dist/guards/index.js +19 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/guards/no-drizzle-push.d.ts +14 -0
- package/dist/guards/no-drizzle-push.d.ts.map +1 -0
- package/dist/guards/no-drizzle-push.js +97 -0
- package/dist/guards/no-drizzle-push.js.map +1 -0
- package/dist/guards/no-env-credentials.d.ts +36 -0
- package/dist/guards/no-env-credentials.d.ts.map +1 -0
- package/dist/guards/no-env-credentials.js +204 -0
- package/dist/guards/no-env-credentials.js.map +1 -0
- package/dist/guards/no-env-mutation.d.ts +23 -0
- package/dist/guards/no-env-mutation.d.ts.map +1 -0
- package/dist/guards/no-env-mutation.js +90 -0
- package/dist/guards/no-env-mutation.js.map +1 -0
- package/dist/guards/no-localhost-fallback.d.ts +30 -0
- package/dist/guards/no-localhost-fallback.d.ts.map +1 -0
- package/dist/guards/no-localhost-fallback.js +105 -0
- package/dist/guards/no-localhost-fallback.js.map +1 -0
- package/dist/guards/no-unscoped-credentials.d.ts +28 -0
- package/dist/guards/no-unscoped-credentials.d.ts.map +1 -0
- package/dist/guards/no-unscoped-credentials.js +199 -0
- package/dist/guards/no-unscoped-credentials.js.map +1 -0
- package/dist/guards/no-unscoped-queries.d.ts +32 -0
- package/dist/guards/no-unscoped-queries.d.ts.map +1 -0
- package/dist/guards/no-unscoped-queries.js +720 -0
- package/dist/guards/no-unscoped-queries.js.map +1 -0
- package/dist/guards/scan-utils.d.ts +28 -0
- package/dist/guards/scan-utils.d.ts.map +1 -0
- package/dist/guards/scan-utils.js +92 -0
- package/dist/guards/scan-utils.js.map +1 -0
- package/dist/guards/types.d.ts +28 -0
- package/dist/guards/types.d.ts.map +1 -0
- package/dist/guards/types.js +11 -0
- package/dist/guards/types.js.map +1 -0
- package/dist/integrations/a2a-continuation-processor.d.ts.map +1 -1
- package/dist/integrations/a2a-continuation-processor.js +25 -5
- package/dist/integrations/a2a-continuation-processor.js.map +1 -1
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +55 -21
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +11 -0
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +5 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +5 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/hosted-model-experiment.d.ts +39 -0
- package/dist/observability/hosted-model-experiment.d.ts.map +1 -0
- package/dist/observability/hosted-model-experiment.js +90 -0
- package/dist/observability/hosted-model-experiment.js.map +1 -0
- package/dist/observability/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts.map +1 -1
- package/dist/observability/routes.js +16 -0
- package/dist/observability/routes.js.map +1 -1
- package/dist/observability/store.d.ts.map +1 -1
- package/dist/observability/store.js +4 -1
- package/dist/observability/store.js.map +1 -1
- package/dist/observability/traces.d.ts +6 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +28 -2
- package/dist/observability/traces.js.map +1 -1
- package/dist/org/accept-pending.d.ts.map +1 -1
- package/dist/org/accept-pending.js +9 -1
- package/dist/org/accept-pending.js.map +1 -1
- package/dist/org/migrations.d.ts +7 -2
- package/dist/org/migrations.d.ts.map +1 -1
- package/dist/org/migrations.js +41 -0
- package/dist/org/migrations.js.map +1 -1
- package/dist/package-lifecycle/index.d.ts +2 -0
- package/dist/package-lifecycle/index.d.ts.map +1 -0
- package/dist/package-lifecycle/index.js +2 -0
- package/dist/package-lifecycle/index.js.map +1 -0
- package/dist/package-lifecycle/manifest.d.ts +24 -0
- package/dist/package-lifecycle/manifest.d.ts.map +1 -0
- package/dist/package-lifecycle/manifest.js +81 -0
- package/dist/package-lifecycle/manifest.js.map +1 -0
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/custom-registry.d.ts +32 -1
- package/dist/provider-api/custom-registry.d.ts.map +1 -1
- package/dist/provider-api/custom-registry.js +41 -1
- package/dist/provider-api/custom-registry.js.map +1 -1
- package/dist/provider-api/index.d.ts +1 -1
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +1 -1
- package/dist/provider-api/index.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.d.ts.map +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.js +19 -1
- package/dist/scripts/agent-engines/list-agent-engines.js.map +1 -1
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +43 -3
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/scripts/chat/search-chats.d.ts +1 -1
- package/dist/scripts/chat/search-chats.d.ts.map +1 -1
- package/dist/scripts/chat/search-chats.js +11 -8
- package/dist/scripts/chat/search-chats.js.map +1 -1
- package/dist/secrets/register-framework-secrets.js +1 -1
- package/dist/secrets/register-framework-secrets.js.map +1 -1
- package/dist/secrets/storage.d.ts.map +1 -1
- package/dist/secrets/storage.js +45 -27
- package/dist/secrets/storage.js.map +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +4 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +11 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +74 -19
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/core-routes-plugin.d.ts +3 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +36 -12
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/csrf.js +18 -5
- package/dist/server/csrf.js.map +1 -1
- package/dist/server/framework-request-handler.d.ts.map +1 -1
- package/dist/server/framework-request-handler.js +34 -0
- package/dist/server/framework-request-handler.js.map +1 -1
- package/dist/server/google-realtime-session.d.ts.map +1 -1
- package/dist/server/google-realtime-session.js +2 -34
- package/dist/server/google-realtime-session.js.map +1 -1
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +24 -2
- package/dist/server/poll.js.map +1 -1
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +64 -21
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/request-origin.d.ts +10 -0
- package/dist/server/request-origin.d.ts.map +1 -0
- package/dist/server/request-origin.js +60 -0
- package/dist/server/request-origin.js.map +1 -0
- package/dist/server/transcribe-voice.d.ts.map +1 -1
- package/dist/server/transcribe-voice.js +2 -48
- package/dist/server/transcribe-voice.js.map +1 -1
- package/dist/server/voice-providers-status.d.ts.map +1 -1
- package/dist/server/voice-providers-status.js +2 -3
- package/dist/server/voice-providers-status.js.map +1 -1
- package/dist/shared/cache-control.d.ts +4 -6
- package/dist/shared/cache-control.d.ts.map +1 -1
- package/dist/shared/cache-control.js +2 -7
- package/dist/shared/cache-control.js.map +1 -1
- package/dist/styles/agent-native.css +1 -0
- package/dist/styles/chat-history-list.css +313 -0
- package/dist/templates/default/package.json +2 -2
- package/dist/templates/headless/package.json +0 -1
- package/dist/templates/workspace-core/.agents/skills/audit-log/SKILL.md +3 -0
- package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -1
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +8 -4
- package/dist/templates/workspace-core/package.json +0 -1
- package/dist/templates/workspace-root/package.json +0 -1
- package/dist/triggers/actions.d.ts.map +1 -1
- package/dist/triggers/actions.js +8 -3
- package/dist/triggers/actions.js.map +1 -1
- package/dist/triggers/types.d.ts +7 -1
- package/dist/triggers/types.d.ts.map +1 -1
- package/dist/triggers/types.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +1 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/audit-log.mdx +2 -1
- package/docs/content/automations.mdx +7 -7
- package/docs/content/creating-templates.mdx +1 -1
- package/docs/content/internationalization.mdx +2 -1
- package/docs/content/locales/ar-SA/audit-log.mdx +2 -1
- package/docs/content/locales/ar-SA/automations.mdx +7 -7
- package/docs/content/locales/ar-SA/getting-started.mdx +7 -1
- package/docs/content/locales/ar-SA/internationalization.mdx +1 -1
- package/docs/content/locales/ar-SA/package-lifecycle.mdx +19 -0
- package/docs/content/locales/ar-SA/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/ar-SA/security.mdx +8 -0
- package/docs/content/locales/de-DE/audit-log.mdx +2 -1
- package/docs/content/locales/de-DE/automations.mdx +7 -7
- package/docs/content/locales/de-DE/getting-started.mdx +7 -1
- package/docs/content/locales/de-DE/internationalization.mdx +1 -1
- package/docs/content/locales/de-DE/package-lifecycle.mdx +22 -0
- package/docs/content/locales/de-DE/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/de-DE/security.mdx +8 -0
- package/docs/content/locales/es-ES/audit-log.mdx +2 -1
- package/docs/content/locales/es-ES/automations.mdx +7 -7
- package/docs/content/locales/es-ES/getting-started.mdx +7 -1
- package/docs/content/locales/es-ES/internationalization.mdx +1 -1
- package/docs/content/locales/es-ES/package-lifecycle.mdx +22 -0
- package/docs/content/locales/es-ES/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/es-ES/security.mdx +8 -0
- package/docs/content/locales/fr-FR/audit-log.mdx +2 -1
- package/docs/content/locales/fr-FR/automations.mdx +7 -7
- package/docs/content/locales/fr-FR/getting-started.mdx +7 -1
- package/docs/content/locales/fr-FR/internationalization.mdx +1 -1
- package/docs/content/locales/fr-FR/package-lifecycle.mdx +21 -0
- package/docs/content/locales/fr-FR/sandbox-adapters.mdx +19 -8
- package/docs/content/locales/fr-FR/security.mdx +8 -0
- package/docs/content/locales/hi-IN/audit-log.mdx +2 -1
- package/docs/content/locales/hi-IN/automations.mdx +7 -7
- package/docs/content/locales/hi-IN/getting-started.mdx +7 -1
- package/docs/content/locales/hi-IN/internationalization.mdx +1 -1
- package/docs/content/locales/hi-IN/package-lifecycle.mdx +20 -0
- package/docs/content/locales/hi-IN/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/hi-IN/security.mdx +8 -0
- package/docs/content/locales/ja-JP/audit-log.mdx +2 -1
- package/docs/content/locales/ja-JP/automations.mdx +7 -7
- package/docs/content/locales/ja-JP/getting-started.mdx +7 -1
- package/docs/content/locales/ja-JP/internationalization.mdx +1 -1
- package/docs/content/locales/ja-JP/package-lifecycle.mdx +21 -0
- package/docs/content/locales/ja-JP/sandbox-adapters.mdx +17 -6
- package/docs/content/locales/ja-JP/security.mdx +8 -0
- package/docs/content/locales/ko-KR/audit-log.mdx +2 -1
- package/docs/content/locales/ko-KR/automations.mdx +7 -7
- package/docs/content/locales/ko-KR/getting-started.mdx +7 -1
- package/docs/content/locales/ko-KR/internationalization.mdx +1 -1
- package/docs/content/locales/ko-KR/package-lifecycle.mdx +20 -0
- package/docs/content/locales/ko-KR/sandbox-adapters.mdx +17 -6
- package/docs/content/locales/ko-KR/security.mdx +8 -0
- package/docs/content/locales/pt-BR/audit-log.mdx +2 -1
- package/docs/content/locales/pt-BR/automations.mdx +7 -7
- package/docs/content/locales/pt-BR/getting-started.mdx +7 -1
- package/docs/content/locales/pt-BR/internationalization.mdx +1 -1
- package/docs/content/locales/pt-BR/package-lifecycle.mdx +21 -0
- package/docs/content/locales/pt-BR/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/pt-BR/security.mdx +8 -0
- package/docs/content/locales/zh-CN/audit-log.mdx +2 -1
- package/docs/content/locales/zh-CN/automations.mdx +7 -7
- package/docs/content/locales/zh-CN/getting-started.mdx +6 -4
- package/docs/content/locales/zh-CN/internationalization.mdx +1 -1
- package/docs/content/locales/zh-CN/package-lifecycle.mdx +19 -0
- package/docs/content/locales/zh-CN/sandbox-adapters.mdx +17 -6
- package/docs/content/locales/zh-CN/security.mdx +8 -0
- package/docs/content/locales/zh-TW/audit-log.mdx +2 -1
- package/docs/content/locales/zh-TW/automations.mdx +7 -7
- package/docs/content/locales/zh-TW/getting-started.mdx +6 -4
- package/docs/content/locales/zh-TW/internationalization.mdx +1 -1
- package/docs/content/locales/zh-TW/package-lifecycle.mdx +19 -0
- package/docs/content/locales/zh-TW/sandbox-adapters.mdx +18 -7
- package/docs/content/locales/zh-TW/security.mdx +8 -0
- package/docs/content/package-lifecycle.mdx +51 -0
- package/docs/content/sandbox-adapters.mdx +16 -5
- package/package.json +12 -3
- package/src/templates/default/package.json +2 -2
- package/src/templates/headless/package.json +0 -1
- package/src/templates/workspace-core/.agents/skills/audit-log/SKILL.md +3 -0
- package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +1 -1
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +8 -4
- package/src/templates/workspace-core/package.json +0 -1
- package/src/templates/workspace-root/package.json +0 -1
- package/corpus/templates/slides/app/components/ui/toast.tsx +0 -1
- package/corpus/templates/slides/app/components/ui/toaster.tsx +0 -1
- package/corpus/templates/slides/app/hooks/use-toast.ts +0 -1
|
@@ -77,6 +77,9 @@ SQL to the caller — they never leak another tenant's rows:
|
|
|
77
77
|
(`agent` | `human` | `system`), `status`, `threadId`/`turnId`, `action`,
|
|
78
78
|
`sinceMs`, `limit`.
|
|
79
79
|
- `get-audit-event` — one event by id, with its redacted input payload.
|
|
80
|
+
- `export-audit-events` — bulk CSV/NDJSON export (same filters minus `limit`,
|
|
81
|
+
plus `format` and `maxRows`) for offline/compliance pulls; itself audited
|
|
82
|
+
via `onRead`.
|
|
80
83
|
|
|
81
84
|
Call them from the UI with `useActionQuery` to build an activity feed or a
|
|
82
85
|
"who changed this" line — never hand-write a fetch to the audit table.
|
|
@@ -61,7 +61,7 @@ Use the web-request tool with ${keys.SLACK_WEBHOOK}.
|
|
|
61
61
|
| `triggerType` | `"schedule" \| "event"` | How the automation fires |
|
|
62
62
|
| `event` | `string?` | Event name to subscribe to (event triggers) |
|
|
63
63
|
| `condition` | `string?` | Natural-language condition evaluated before dispatch |
|
|
64
|
-
| `mode` | `"agentic"
|
|
64
|
+
| `mode` | `"agentic"` | Full agent loop (only supported mode; `"deterministic"` was removed — never implemented, rejected at define time) |
|
|
65
65
|
| `model` | `string?` | Override the model for this trigger's agent loop |
|
|
66
66
|
| `domain` | `string?` | Grouping tag (mail, calendar, clips, etc.) |
|
|
67
67
|
| `createdBy` | `string?` | Owner email |
|
|
@@ -126,6 +126,26 @@ The agent loop reads active experiments via `resolveActiveExperimentConfig()` an
|
|
|
126
126
|
|
|
127
127
|
Compute results with `POST /_agent-native/observability/experiments/:id/results`.
|
|
128
128
|
|
|
129
|
+
#### First-party hosted default-model rollout
|
|
130
|
+
|
|
131
|
+
First-party apps on `agent-native.com` automatically run the July 2026
|
|
132
|
+
default-model experiment for authenticated users on the Builder engine:
|
|
133
|
+
|
|
134
|
+
- 80% `claude-sonnet-5`
|
|
135
|
+
- 20% `gpt-5-6-luna`
|
|
136
|
+
- Assignment is sticky by normalized user email and shared across templates.
|
|
137
|
+
- The rollout applies only when the user, app, and deployment have not selected
|
|
138
|
+
a model. Explicit model choices and BYO provider engines always win.
|
|
139
|
+
- Set `AGENT_NATIVE_HOSTED_MODEL_EXPERIMENT=off` for an emergency rollback, or
|
|
140
|
+
`true` to exercise the rollout on a non-first-party preview.
|
|
141
|
+
- `$ai_generation` tracking includes `experiment_id`,
|
|
142
|
+
`experiment_variant`, and `model_selection_source` for central analysis.
|
|
143
|
+
|
|
144
|
+
In production, experiment management routes require the caller's email in the
|
|
145
|
+
comma-separated `AGENT_NATIVE_EXPERIMENT_ADMIN_EMAILS` allowlist. This gate is
|
|
146
|
+
separate from normal app/org admin roles because an experiment affects every
|
|
147
|
+
user in that deployment.
|
|
148
|
+
|
|
129
149
|
### 5. Dashboard
|
|
130
150
|
|
|
131
151
|
`ObservabilityDashboard` is a React component with 5 tabs:
|
package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md
CHANGED
|
@@ -41,9 +41,13 @@ shared agent sidebar.
|
|
|
41
41
|
## Realtime speech mode
|
|
42
42
|
|
|
43
43
|
Realtime speech mode is a full-duplex OpenAI Realtime WebRTC session, separate
|
|
44
|
-
from the dictation providers below. It
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
from the dictation providers below. It prefers the authenticated user's
|
|
45
|
+
complete Builder connection and the Builder-managed metered gateway. A scoped
|
|
46
|
+
`OPENAI_API_KEY` is the fallback when Builder is not connected. The server owns
|
|
47
|
+
the `gpt-realtime-2.1` session configuration and keeps credentials out of
|
|
48
|
+
browser code. If neither provider is configured, show **Connect Builder** as
|
|
49
|
+
the primary microphone-popover action and OpenAI key setup as the secondary
|
|
50
|
+
action before requesting microphone permission.
|
|
47
51
|
|
|
48
52
|
- Starting voice mode collapses the chat into a persistent bottom-end speech
|
|
49
53
|
orb. The orb stays visible above the chat even when the chat opens
|
|
@@ -169,7 +173,7 @@ client.
|
|
|
169
173
|
|
|
170
174
|
Templates can:
|
|
171
175
|
- **Disable the mic**: pass `voiceEnabled={false}` to `TiptapComposer`.
|
|
172
|
-
- **Replace the button**: wrap `TiptapComposer` and render your own `extraActionButton
|
|
176
|
+
- **Replace the button**: wrap `TiptapComposer` and render your own `extraActionButton`; the framework mic stays immediately before the primary send/stop control. Use `stopButton` for an active-run control so the disabled send button becomes stop when the draft is empty and returns when the user types.
|
|
173
177
|
- **Pre-register provider keys as `required: true`**: call `registerRequiredSecret(...)` from your own server plugin when a template needs a specific BYOK provider in onboarding.
|
|
174
178
|
|
|
175
179
|
## Don'ts
|
|
@@ -107,6 +107,14 @@ async function handleDefine(
|
|
|
107
107
|
return `Error: An automation named "${name}" already exists. Use a different name or delete the existing one first.`;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
if (args.mode === "deterministic") {
|
|
111
|
+
return (
|
|
112
|
+
"Error: Deterministic mode was removed — it was never implemented and " +
|
|
113
|
+
"automations that set it never fired. Create the automation without " +
|
|
114
|
+
"mode (agentic), and describe the exact fixed steps in the automation body."
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
const triggerType = args.trigger_type === "schedule" ? "schedule" : "event";
|
|
111
119
|
const meta: TriggerFrontmatter = {
|
|
112
120
|
schedule: args.schedule || "",
|
|
@@ -114,7 +122,7 @@ async function handleDefine(
|
|
|
114
122
|
triggerType,
|
|
115
123
|
event: args.event || undefined,
|
|
116
124
|
condition: args.condition || undefined,
|
|
117
|
-
mode:
|
|
125
|
+
mode: "agentic",
|
|
118
126
|
domain: args.domain || undefined,
|
|
119
127
|
createdBy: owner,
|
|
120
128
|
runAs: "creator",
|
|
@@ -268,8 +276,8 @@ export function createAutomationToolEntries(
|
|
|
268
276
|
mode: {
|
|
269
277
|
type: "string",
|
|
270
278
|
description:
|
|
271
|
-
'"agentic" (full agent loop, can use tools)
|
|
272
|
-
enum: ["agentic"
|
|
279
|
+
'"agentic" (full agent loop, can use tools) — the only supported mode. Used by define.',
|
|
280
|
+
enum: ["agentic"],
|
|
273
281
|
},
|
|
274
282
|
domain: {
|
|
275
283
|
type: "string",
|
|
@@ -15,7 +15,13 @@ export interface TriggerFrontmatter {
|
|
|
15
15
|
event?: string;
|
|
16
16
|
/** Natural-language condition evaluated by Haiku before dispatch. */
|
|
17
17
|
condition?: string;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* "agentic" = full runAgentLoop; the only mode `manage-automations` will
|
|
20
|
+
* define/update going forward. "deterministic" was removed from the
|
|
21
|
+
* advertised surface (never implemented) and is legacy-only: rows created
|
|
22
|
+
* before the removal may still carry it, and the dispatcher's
|
|
23
|
+
* warn-and-skip branch keeps them inert by design — do not make them fire.
|
|
24
|
+
*/
|
|
19
25
|
mode: "agentic" | "deterministic";
|
|
20
26
|
/** Domain tag for filtering in per-template UIs. */
|
|
21
27
|
domain?: string;
|
|
@@ -20,6 +20,13 @@ details live in `.agents/skills/`.
|
|
|
20
20
|
status) and the injected `<data-dictionary>` to learn what exists and which
|
|
21
21
|
table/columns/join paths to use. Don't fan out blind queries when the catalog
|
|
22
22
|
already answers where a fact lives.
|
|
23
|
+
- Simple time-bounded metric fast path: when the data dictionary or a known
|
|
24
|
+
canonical source already identifies the metric, run one bounded aggregate.
|
|
25
|
+
Once that query returns a valid result, answer immediately with the source,
|
|
26
|
+
time window, row count, and only necessary caveats. Do not schema-discover,
|
|
27
|
+
retry, enrich, or add breakdowns unless the query fails or its result
|
|
28
|
+
conflicts with the known metric definition. This never waives the real-data
|
|
29
|
+
requirement: do not answer from a guess, stale value, or unverified result.
|
|
23
30
|
- Clarify-first for ambiguous ad-hoc work: when the metric definition, date
|
|
24
31
|
range, or grain is ambiguous and a wrong guess would change the numbers, use
|
|
25
32
|
the `ask-question` clarifying tool (multiple-choice) before computing. Ask at
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentActionStopError, defineAction } from "@agent-native/core";
|
|
2
|
+
import type { ActionRunContext } from "@agent-native/core/action";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
|
|
4
5
|
import { runQuery } from "../server/lib/bigquery";
|
|
@@ -49,6 +50,23 @@ function stopForBigQueryNotConfigured(message: string): never {
|
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
function stopForBigQueryCancellation(): never {
|
|
54
|
+
const message =
|
|
55
|
+
"The BigQuery query was cancelled because the agent run ended before it could finish.";
|
|
56
|
+
throw new AgentActionStopError(message, {
|
|
57
|
+
errorCode: "run_cancelled",
|
|
58
|
+
toolResult: JSON.stringify(
|
|
59
|
+
{
|
|
60
|
+
error: "run_cancelled",
|
|
61
|
+
message,
|
|
62
|
+
recoverable: false,
|
|
63
|
+
},
|
|
64
|
+
null,
|
|
65
|
+
2,
|
|
66
|
+
),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
52
70
|
export default defineAction({
|
|
53
71
|
description:
|
|
54
72
|
"Query the user-configured BigQuery data warehouse. Use this when the user asks for warehouse SQL, BigQuery, or a data-dictionary metric/table that lives in BigQuery. If the user names a provider action such as Jira or Pylon, use that provider action first and do not use BigQuery unless the user explicitly asks for a warehouse copy. Pass standard SQL via the `sql` arg. Do NOT use `db-query` for warehouse data (it only reaches the app's own SQL database). If a query fails with a schema or SQL error (unknown dataset/table/column, syntax), treat it as a normal debugging signal: inspect the real schema with `search-bigquery-schema` (or query INFORMATION_SCHEMA), correct the query based on the error, and run it again — a few corrective attempts are expected. Surface the error to the user only if it still fails after a few attempts or is non-recoverable (missing credentials, permission, quota). Never rerun identical failing SQL, and never substitute made-up numbers for data you could not query.",
|
|
@@ -57,10 +75,16 @@ export default defineAction({
|
|
|
57
75
|
}),
|
|
58
76
|
readOnly: true,
|
|
59
77
|
toolCallable: true,
|
|
60
|
-
run: async (args) => {
|
|
78
|
+
run: async (args, context?: ActionRunContext) => {
|
|
61
79
|
try {
|
|
62
|
-
return await runQuery(args.sql);
|
|
80
|
+
return await runQuery(args.sql, { signal: context?.signal });
|
|
63
81
|
} catch (err) {
|
|
82
|
+
// A run cancellation is terminal for this invocation. Returning it as a
|
|
83
|
+
// recoverable SQL error would invite the agent to retry work after the
|
|
84
|
+
// parent run has already ended. Normalize the provider's AbortError so
|
|
85
|
+
// the generic tool-error path cannot record it as a warehouse failure.
|
|
86
|
+
if (context?.signal?.aborted) stopForBigQueryCancellation();
|
|
87
|
+
|
|
64
88
|
const msg = err instanceof Error ? err.message : String(err);
|
|
65
89
|
if (
|
|
66
90
|
/GOOGLE_APPLICATION_CREDENTIALS_JSON not configured/i.test(msg) ||
|
|
@@ -11,7 +11,11 @@ import {
|
|
|
11
11
|
} from "@agent-native/core/server";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
getDashboard,
|
|
16
|
+
upsertDashboard,
|
|
17
|
+
upsertDashboardWithRetry,
|
|
18
|
+
} from "../server/lib/dashboards-store";
|
|
15
19
|
import { validateFirstPartyAnalyticsSql } from "../server/lib/first-party-analytics.js";
|
|
16
20
|
import {
|
|
17
21
|
buildFirstPartyDashboardFilters,
|
|
@@ -235,61 +239,85 @@ export default defineAction({
|
|
|
235
239
|
? (existing.config.name as string)
|
|
236
240
|
: args.dashboardId);
|
|
237
241
|
|
|
242
|
+
function withFilters(
|
|
243
|
+
config: Record<string, unknown>,
|
|
244
|
+
): Record<string, unknown> {
|
|
245
|
+
return composedPanels.some((panel) =>
|
|
246
|
+
usesFirstPartyDashboardFilters(panel.sql),
|
|
247
|
+
)
|
|
248
|
+
? withFirstPartyDashboardFilters(config)
|
|
249
|
+
: config;
|
|
250
|
+
}
|
|
251
|
+
|
|
238
252
|
let finalConfig: Record<string, unknown>;
|
|
239
253
|
let appendedCount = composedPanels.length;
|
|
240
254
|
let skippedExistingIds: string[] = [];
|
|
241
255
|
|
|
242
256
|
if (existing && !args.overwrite) {
|
|
243
257
|
// Append: preserve existing panels + order, add only new panel ids.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
258
|
+
// Recomputed on every retry attempt from the freshest existing config —
|
|
259
|
+
// via upsertDashboardWithRetry — so a panel a concurrent writer just
|
|
260
|
+
// added is never silently dropped by this merge.
|
|
261
|
+
const saved = await upsertDashboardWithRetry(
|
|
262
|
+
args.dashboardId,
|
|
263
|
+
ctx,
|
|
264
|
+
(freshExisting) => {
|
|
265
|
+
const existingConfig = freshExisting.config as Record<
|
|
266
|
+
string,
|
|
267
|
+
unknown
|
|
268
|
+
>;
|
|
269
|
+
const existingPanels = Array.isArray(existingConfig.panels)
|
|
270
|
+
? (existingConfig.panels as Array<Record<string, unknown>>)
|
|
271
|
+
: [];
|
|
272
|
+
const existingIds = new Set(
|
|
273
|
+
existingPanels
|
|
274
|
+
.map((p) => (typeof p?.id === "string" ? p.id : null))
|
|
275
|
+
.filter((id): id is string => !!id),
|
|
276
|
+
);
|
|
277
|
+
const toAppend: ComposedPanel[] = [];
|
|
278
|
+
const skipped: string[] = [];
|
|
279
|
+
for (const panel of composedPanels) {
|
|
280
|
+
if (existingIds.has(panel.id)) {
|
|
281
|
+
skipped.push(panel.id);
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
toAppend.push(panel);
|
|
285
|
+
existingIds.add(panel.id);
|
|
286
|
+
}
|
|
287
|
+
appendedCount = toAppend.length;
|
|
288
|
+
skippedExistingIds = skipped;
|
|
289
|
+
const merged = withFilters({
|
|
290
|
+
...existingConfig,
|
|
291
|
+
name:
|
|
292
|
+
typeof existingConfig.name === "string" &&
|
|
293
|
+
existingConfig.name.trim()
|
|
294
|
+
? existingConfig.name
|
|
295
|
+
: dashboardName,
|
|
296
|
+
panels: [...existingPanels, ...toAppend],
|
|
297
|
+
});
|
|
298
|
+
return { kind: "sql" as const, body: merged };
|
|
299
|
+
},
|
|
252
300
|
);
|
|
253
|
-
|
|
254
|
-
for (const panel of composedPanels) {
|
|
255
|
-
if (existingIds.has(panel.id)) {
|
|
256
|
-
skippedExistingIds.push(panel.id);
|
|
257
|
-
continue;
|
|
258
|
-
}
|
|
259
|
-
toAppend.push(panel);
|
|
260
|
-
existingIds.add(panel.id);
|
|
261
|
-
}
|
|
262
|
-
appendedCount = toAppend.length;
|
|
263
|
-
finalConfig = {
|
|
264
|
-
...existingConfig,
|
|
265
|
-
name:
|
|
266
|
-
typeof existingConfig.name === "string" && existingConfig.name.trim()
|
|
267
|
-
? existingConfig.name
|
|
268
|
-
: dashboardName,
|
|
269
|
-
panels: [...existingPanels, ...toAppend],
|
|
270
|
-
};
|
|
301
|
+
finalConfig = saved.config as Record<string, unknown>;
|
|
271
302
|
} else {
|
|
272
303
|
// Create or overwrite: a fresh config with exactly the composed panels.
|
|
273
|
-
|
|
304
|
+
// No prior state can be lost here — create has none, and
|
|
305
|
+
// `overwrite: true` is an explicit full-replace request rather than a
|
|
306
|
+
// read-modify-write, so it saves unconditionally like update-dashboard's
|
|
307
|
+
// full-config replace mode.
|
|
308
|
+
finalConfig = withFilters({
|
|
274
309
|
name: dashboardName,
|
|
275
310
|
description:
|
|
276
311
|
"First-party analytics dashboard composed from the metric catalog.",
|
|
277
312
|
panels: composedPanels,
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
if (
|
|
282
|
-
composedPanels.some((panel) => usesFirstPartyDashboardFilters(panel.sql))
|
|
283
|
-
) {
|
|
284
|
-
finalConfig = withFirstPartyDashboardFilters(finalConfig);
|
|
313
|
+
});
|
|
314
|
+
await upsertDashboard(args.dashboardId, "sql", finalConfig, ctx);
|
|
285
315
|
}
|
|
286
316
|
|
|
287
317
|
const panelCount = Array.isArray(finalConfig.panels)
|
|
288
318
|
? (finalConfig.panels as unknown[]).length
|
|
289
319
|
: 0;
|
|
290
320
|
|
|
291
|
-
// Single atomic save through the same store path update-dashboard uses.
|
|
292
|
-
await upsertDashboard(args.dashboardId, "sql", finalConfig, ctx);
|
|
293
321
|
await syncToCollab(args.dashboardId, finalConfig);
|
|
294
322
|
|
|
295
323
|
const parts: string[] = [];
|
|
@@ -190,7 +190,25 @@ export default defineAction({
|
|
|
190
190
|
workspaceConnection,
|
|
191
191
|
};
|
|
192
192
|
});
|
|
193
|
+
const configuredDataSources = providers
|
|
194
|
+
.filter((provider) => provider.configured)
|
|
195
|
+
.map((provider) => ({
|
|
196
|
+
provider: provider.provider,
|
|
197
|
+
label: provider.label,
|
|
198
|
+
via:
|
|
199
|
+
provider.configuredKeys.length > 0 &&
|
|
200
|
+
provider.workspaceConnection.grantState === "connected"
|
|
201
|
+
? "credentials-and-workspace"
|
|
202
|
+
: provider.workspaceConnection.grantState === "connected"
|
|
203
|
+
? "workspace"
|
|
204
|
+
: "credentials",
|
|
205
|
+
}));
|
|
193
206
|
return {
|
|
207
|
+
// Keep a compact, explicit summary first so models do not infer source
|
|
208
|
+
// availability from the much larger per-credential list below.
|
|
209
|
+
hasConfiguredDataSources: configuredDataSources.length > 0,
|
|
210
|
+
configuredDataSourceCount: configuredDataSources.length,
|
|
211
|
+
configuredDataSources,
|
|
194
212
|
credentials: results,
|
|
195
213
|
providers,
|
|
196
214
|
total: results.length,
|
|
@@ -11,13 +11,18 @@ import {
|
|
|
11
11
|
} from "@agent-native/core/server";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
getDashboard,
|
|
16
|
+
upsertDashboardWithRetry,
|
|
17
|
+
type DashboardRecord,
|
|
18
|
+
} from "../server/lib/dashboards-store";
|
|
15
19
|
import {
|
|
16
20
|
applyDashboardMutationOperations,
|
|
17
21
|
DASHBOARD_MUTATION_API_TYPES,
|
|
18
22
|
DASHBOARD_MUTATION_EXAMPLES,
|
|
19
23
|
parseDashboardMutationScript,
|
|
20
24
|
type DashboardMutationOperation,
|
|
25
|
+
type DashboardMutationResult,
|
|
21
26
|
} from "./dashboard-mutation-api";
|
|
22
27
|
import { compactDashboardResult } from "./dashboard-panel-order";
|
|
23
28
|
import { validateDashboardConfig, validatePanelSql } from "./update-dashboard";
|
|
@@ -260,33 +265,77 @@ export default defineAction({
|
|
|
260
265
|
|
|
261
266
|
const scope = resolveScope();
|
|
262
267
|
const ctx = { email: scope.email, orgId: scope.orgId };
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
|
|
269
|
+
// Recomputes the mutation from whatever dashboard state is passed in.
|
|
270
|
+
// `operations` sourced from `args.operations` are already concrete panel
|
|
271
|
+
// ids, safe to replay verbatim; `args.code` is re-parsed against `existing`
|
|
272
|
+
// every time because selectors like `panelsMatching(...)` resolve against
|
|
273
|
+
// the config at parse time, so a retry must re-resolve them against the
|
|
274
|
+
// fresh state, not reuse ids resolved from a now-stale config.
|
|
275
|
+
function computeMutation(
|
|
276
|
+
existing: Pick<DashboardRecord, "kind" | "config">,
|
|
277
|
+
) {
|
|
278
|
+
if (existing.kind !== "sql") {
|
|
279
|
+
throw new Error(
|
|
280
|
+
`mutate-dashboard only supports SQL dashboards; "${dashboardId}" is ${existing.kind}.`,
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
const nextRoot = cloneConfig(existing.config as Record<string, unknown>);
|
|
284
|
+
const nextOperations = args.operations
|
|
285
|
+
? (args.operations as DashboardMutationOperation[])
|
|
286
|
+
: parseDashboardMutationScript(nextRoot, args.code!);
|
|
287
|
+
const nextMutation = applyDashboardMutationOperations(
|
|
288
|
+
nextRoot,
|
|
289
|
+
nextOperations,
|
|
272
290
|
);
|
|
291
|
+
const validation = validateDashboardConfig(nextRoot);
|
|
292
|
+
if (validation) throw new Error(validation);
|
|
293
|
+
return { nextRoot, nextOperations, nextMutation };
|
|
273
294
|
}
|
|
274
295
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
296
|
+
// Assigned inside `computeMutation`'s caller (directly for dry-run, inside
|
|
297
|
+
// the retry callback for a real save); always assigned at least once
|
|
298
|
+
// before use below, since `upsertDashboardWithRetry` only resolves after
|
|
299
|
+
// its callback has run.
|
|
300
|
+
let root: Record<string, unknown>;
|
|
301
|
+
let operations!: DashboardMutationOperation[];
|
|
302
|
+
let mutation!: DashboardMutationResult;
|
|
280
303
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
304
|
+
if (args.dryRun === true) {
|
|
305
|
+
const existing = await getDashboard(dashboardId, ctx);
|
|
306
|
+
if (!existing) {
|
|
307
|
+
throw new Error(
|
|
308
|
+
`dashboard "${dashboardId}" not found (or you don't have access).`,
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
const computed = computeMutation(existing);
|
|
312
|
+
root = computed.nextRoot;
|
|
313
|
+
operations = computed.nextOperations;
|
|
314
|
+
mutation = computed.nextMutation;
|
|
315
|
+
if (operations.some(mutationCanChangePanelSql)) {
|
|
316
|
+
const sqlError = await validatePanelSql(root);
|
|
317
|
+
if (sqlError) throw new Error(sqlError);
|
|
318
|
+
}
|
|
319
|
+
} else {
|
|
320
|
+
const saved = await upsertDashboardWithRetry(
|
|
321
|
+
dashboardId,
|
|
322
|
+
ctx,
|
|
323
|
+
async (existing) => {
|
|
324
|
+
const computed = computeMutation(existing);
|
|
325
|
+
if (computed.nextOperations.some(mutationCanChangePanelSql)) {
|
|
326
|
+
const sqlError = await validatePanelSql(computed.nextRoot);
|
|
327
|
+
if (sqlError) throw new Error(sqlError);
|
|
328
|
+
}
|
|
329
|
+
root = computed.nextRoot;
|
|
330
|
+
operations = computed.nextOperations;
|
|
331
|
+
mutation = computed.nextMutation;
|
|
332
|
+
return { kind: "sql" as const, body: computed.nextRoot };
|
|
333
|
+
},
|
|
334
|
+
);
|
|
335
|
+
// Use the persisted config as the source of truth for the response —
|
|
336
|
+
// structurally identical to the winning attempt's `root`, but reflects
|
|
337
|
+
// exactly what was saved.
|
|
338
|
+
root = saved.config as Record<string, unknown>;
|
|
290
339
|
await syncToCollab(dashboardId, root);
|
|
291
340
|
}
|
|
292
341
|
|
|
@@ -11,10 +11,11 @@ import {
|
|
|
11
11
|
} from "@agent-native/core/server";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
|
-
import {
|
|
14
|
+
import { upsertDashboardWithRetry } from "../server/lib/dashboards-store";
|
|
15
15
|
import {
|
|
16
16
|
compactDashboardResult,
|
|
17
17
|
movePanelsById,
|
|
18
|
+
type PanelOrderResult,
|
|
18
19
|
type PanelOrderTarget,
|
|
19
20
|
} from "./dashboard-panel-order";
|
|
20
21
|
|
|
@@ -155,20 +156,22 @@ export default defineAction({
|
|
|
155
156
|
const dashboardId = resolveDashboardId(args);
|
|
156
157
|
const scope = resolveScope();
|
|
157
158
|
const ctx = { email: scope.email, orgId: scope.orgId };
|
|
158
|
-
const existing = await getDashboard(dashboardId, ctx);
|
|
159
|
-
if (!existing) {
|
|
160
|
-
throw new Error(
|
|
161
|
-
`dashboard "${dashboardId}" not found (or you don't have access).`,
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
159
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
// Recomputed on every attempt from whichever dashboard state
|
|
161
|
+
// `upsertDashboardWithRetry` hands us, so a retry after a concurrent
|
|
162
|
+
// writer's save re-applies this move against their fresh panel order
|
|
163
|
+
// instead of silently discarding it.
|
|
164
|
+
let orderResult!: PanelOrderResult;
|
|
165
|
+
const saved = await upsertDashboardWithRetry(
|
|
166
|
+
dashboardId,
|
|
167
|
+
ctx,
|
|
168
|
+
(existing) => {
|
|
169
|
+
const root = existing.config as Record<string, unknown>;
|
|
170
|
+
orderResult = movePanelsById(root, args.panelIds, resolveTarget(args));
|
|
171
|
+
return { kind: existing.kind, body: root };
|
|
172
|
+
},
|
|
170
173
|
);
|
|
171
|
-
|
|
174
|
+
const root = saved.config as Record<string, unknown>;
|
|
172
175
|
await syncToCollab(dashboardId, root);
|
|
173
176
|
|
|
174
177
|
const compact = compactDashboardResult(root, orderResult.movedPanelIds);
|