@agent-native/core 0.129.2 → 0.130.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 +72 -0
- package/corpus/core/docs/content/cloneable-saas.mdx +114 -0
- package/corpus/core/docs/content/creating-templates.mdx +28 -2
- package/corpus/core/docs/content/syncing-template-changes.mdx +7 -0
- package/corpus/core/docs/content/template-clips-developers.mdx +12 -5
- package/corpus/core/docs/content/template-dispatch-developers.mdx +1 -1
- package/corpus/core/docs/content/template-dispatch.mdx +1 -1
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/action-ui.ts +1 -0
- package/corpus/core/src/action.ts +5 -1
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +15 -5
- package/corpus/core/src/agent/harness/runner.ts +5 -0
- package/corpus/core/src/agent/production-agent.ts +33 -0
- package/corpus/core/src/agent/run-loop-with-resume.ts +5 -0
- package/corpus/core/src/agent/run-manager.ts +126 -1
- package/corpus/core/src/agent/thread-data-builder.ts +47 -2
- package/corpus/core/src/agent/types.ts +2 -0
- package/corpus/core/src/chat-threads/store.ts +4 -5
- package/corpus/core/src/cli/create.ts +1139 -65
- package/corpus/core/src/cli/design-connect.ts +3 -7
- package/corpus/core/src/cli/index.ts +5 -3
- package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +83 -47
- package/corpus/core/src/client/AssistantChat.tsx +27 -16
- package/corpus/core/src/client/agent-chat-adapter.ts +24 -0
- package/corpus/core/src/client/blocks/library/wireframe-kit.tsx +17 -2
- package/corpus/core/src/client/chat/index.ts +1 -0
- package/corpus/core/src/client/chat/message-components.tsx +104 -1
- package/corpus/core/src/client/chat/run-recovery.tsx +15 -3
- package/corpus/core/src/client/chat/widgets/DataTableWidget.tsx +10 -29
- package/corpus/core/src/client/chat/widgets/WorkspaceFileWidget.tsx +71 -0
- package/corpus/core/src/client/chat/widgets/builtin-tool-renderers.tsx +22 -0
- package/corpus/core/src/client/chat/widgets/workspace-file-result.ts +49 -0
- package/corpus/core/src/client/embed-auth.ts +2 -0
- package/corpus/core/src/client/org/InvitationBanner.tsx +14 -1
- package/corpus/core/src/client/org/OrgSwitcher.tsx +23 -0
- package/corpus/core/src/client/org/TeamPage.tsx +130 -0
- package/corpus/core/src/client/org/WorkspaceNotice.tsx +85 -0
- package/corpus/core/src/client/org/hooks.ts +14 -0
- package/corpus/core/src/client/org/index.ts +2 -0
- package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +27 -40
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +134 -51
- package/corpus/core/src/client/resources/mcp-integration-catalog.ts +7 -0
- package/corpus/core/src/client/resources/use-resources.ts +6 -0
- package/corpus/core/src/client/use-action.ts +3 -1
- package/corpus/core/src/client/widgets/index.ts +1 -0
- package/corpus/core/src/coding-tools/run-code.ts +2 -1
- package/corpus/core/src/db/client.ts +28 -4
- package/corpus/core/src/deploy/build.ts +31 -3
- package/corpus/core/src/eject/remote-mcp-presets.ts +1 -1
- package/corpus/core/src/index.browser.ts +1 -0
- package/corpus/core/src/index.ts +1 -0
- package/corpus/core/src/integrations/google-docs-poller.ts +3 -0
- package/corpus/core/src/integrations/webhook-handler.ts +28 -11
- package/corpus/core/src/jobs/scheduler.ts +4 -0
- package/corpus/core/src/localization/default-messages.ts +3 -2
- package/corpus/core/src/observability/traces.ts +48 -12
- package/corpus/core/src/org/handlers.ts +52 -1
- package/corpus/core/src/org/migrations.ts +4 -0
- package/corpus/core/src/org/plugin.ts +14 -0
- package/corpus/core/src/org/schema.ts +1 -0
- package/corpus/core/src/org/types.ts +8 -0
- package/corpus/core/src/org/workspace-url.ts +74 -0
- package/corpus/core/src/resources/handlers.ts +35 -5
- package/corpus/core/src/scripts/runner.ts +183 -5
- package/corpus/core/src/server/action-routes.ts +32 -2
- package/corpus/core/src/server/agent-chat-plugin.ts +29 -0
- package/corpus/core/src/server/agent-teams.ts +10 -1
- package/corpus/core/src/server/auth.ts +33 -7
- package/corpus/core/src/server/embed-route.ts +9 -0
- package/corpus/core/src/server/embed-session.ts +62 -3
- package/corpus/core/src/server/open-route.ts +20 -6
- package/corpus/core/src/server/prompts/framework-core-compact.ts +1 -1
- package/corpus/core/src/server/prompts/framework-core.ts +1 -0
- package/corpus/core/src/server/request-context.ts +36 -1
- package/corpus/core/src/shared/embed-auth.ts +1 -0
- package/corpus/core/src/shared/html-document.ts +115 -0
- package/corpus/core/src/shared/index.ts +1 -0
- package/corpus/core/src/sharing/access.ts +8 -1
- package/corpus/core/src/sharing/registry.ts +11 -2
- package/corpus/core/src/workspace-files/actions.ts +100 -0
- package/corpus/core/src/workspace-files/tool.ts +4 -0
- package/corpus/templates/analytics/.agents/skills/analysis-workspace/SKILL.md +4 -0
- package/corpus/templates/analytics/.agents/skills/hubspot/SKILL.md +9 -1
- package/corpus/templates/analytics/AGENTS.md +17 -24
- package/corpus/templates/analytics/actions/data-source-status.ts +11 -1
- package/corpus/templates/analytics/app/i18n-data.ts +34 -0
- package/corpus/templates/analytics/app/lib/data-source-status.ts +86 -0
- package/corpus/templates/analytics/app/lib/native-mcp-exclusions.ts +9 -0
- package/corpus/templates/analytics/app/pages/DataSources.tsx +184 -20
- package/corpus/templates/analytics/changelog/2026-07-28-native-analytics-data-sources-no-longer-show-duplicate-mc.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-exports-now-appear-in-chat-with-a-direct-download-instead-of.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-queued-chat-prompts-no-longer-resend-after-analytics-navigat.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-scheduled-dashboard-emails-load-every-panel-reliably-without.md +6 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +6 -3
- package/corpus/templates/analytics/server/lib/credential-keys.ts +1 -1
- package/corpus/templates/analytics/server/lib/hubspot.ts +1 -1
- package/corpus/templates/analytics/server/lib/provider-credentials.ts +55 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +123 -27
- package/corpus/templates/analytics/server/routes/[...page].get.ts +2 -7
- package/corpus/templates/analytics/vite.config.ts +7 -0
- package/corpus/templates/brain/actions/list-connection-providers.ts +100 -2
- package/corpus/templates/brain/app/lib/brain.ts +10 -0
- package/corpus/templates/brain/app/routes/sources.tsx +15 -4
- package/corpus/templates/brain/changelog/2026-07-29-brain-automatically-retries-failed-source-syncs-and-guides-y.md +6 -0
- package/corpus/templates/brain/jobs/process-ingest-queue.ts +13 -0
- package/corpus/templates/brain/server/jobs/sync-sources.ts +27 -22
- package/corpus/templates/brain/server/plugins/agent-chat.ts +2 -1
- package/corpus/templates/brain/server/routes/api/brain/queue/run.post.ts +7 -1
- package/corpus/templates/clips/AGENTS.md +1 -1
- package/corpus/templates/clips/actions/create-recording-agent-link.ts +11 -1
- package/corpus/templates/clips/actions/update-comment.ts +68 -0
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +0 -1
- package/corpus/templates/clips/app/components/player/comments-panel.tsx +221 -65
- package/corpus/templates/clips/app/components/player/video-player.tsx +101 -27
- package/corpus/templates/clips/app/i18n/en-US.ts +2 -1
- package/corpus/templates/clips/app/routes/bug-report.done.tsx +48 -27
- package/corpus/templates/clips/app/routes/bug-report.tsx +43 -4
- package/corpus/templates/clips/app/routes/record.tsx +2 -0
- package/corpus/templates/clips/changelog/2026-07-29-clip-playback-now-recovers-instead-of-getting-stuck-when-a-b.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-29-comments-can-now-be-edited-after-posting.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-29-download-actions-now-use-a-shorter-clearer-label.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-29-embedded-bug-reports-now-return-a-temporary-agent-readable.md +6 -0
- package/corpus/templates/clips/shared/bug-report.ts +99 -0
- package/corpus/templates/content/actions/_content-database-personal-view.ts +7 -1
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +5 -2
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +20 -8
- package/corpus/templates/content/changelog/2026-07-29-missing-databases-no-longer-trigger-repeated-personal-view-e.md +6 -0
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +83 -47
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +474 -55
- package/corpus/templates/design/.generated/bridge/embedded-wheel.generated.ts +3 -0
- package/corpus/templates/design/.generated/bridge/hit-test.generated.ts +18 -1
- package/corpus/templates/design/.generated/bridge/source-location.generated.ts +348 -0
- package/corpus/templates/design/actions/add-localhost-screens.ts +2 -7
- package/corpus/templates/design/actions/apply-visual-edit.ts +7 -1
- package/corpus/templates/design/actions/connect-localhost.ts +5 -9
- package/corpus/templates/design/actions/create-component.ts +16 -13
- package/corpus/templates/design/actions/grant-localhost-write-consent.ts +2 -7
- package/corpus/templates/design/actions/list-design-source-capabilities.ts +4 -7
- package/corpus/templates/design/actions/list-local-files.ts +26 -50
- package/corpus/templates/design/actions/list-localhost-connections.ts +2 -7
- package/corpus/templates/design/actions/migrate-board-objects-to-file.ts +2 -2
- package/corpus/templates/design/actions/open-visual-edit.ts +234 -135
- package/corpus/templates/design/actions/read-local-file.ts +26 -50
- package/corpus/templates/design/actions/request-localhost-write-consent.ts +2 -7
- package/corpus/templates/design/actions/write-local-file.ts +31 -73
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +307 -133
- package/corpus/templates/design/app/components/design/EditPanel.tsx +94 -22
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +137 -60
- package/corpus/templates/design/app/components/design/ResponsiveInteractBar.tsx +75 -14
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +755 -97
- package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +8 -0
- package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +24 -1
- package/corpus/templates/design/app/components/design/bridge/source-location.bridge.ts +530 -0
- package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbenchLoader.tsx +278 -0
- package/corpus/templates/design/app/components/design/code-workbench/editor/MonacoHost.tsx +32 -12
- package/corpus/templates/design/app/components/design/code-workbench/editor/monaco-setup.ts +14 -3
- package/corpus/templates/design/app/components/design/code-workbench/explorer/ExplorerView.tsx +87 -24
- package/corpus/templates/design/app/components/design/code-workbench/explorer/FileTree.tsx +36 -0
- package/corpus/templates/design/app/components/design/code-workbench/store.tsx +2 -1
- package/corpus/templates/design/app/components/design/code-workbench/workspace/localhost-provider.ts +48 -8
- package/corpus/templates/design/app/components/design/design-canvas/content-size-report.ts +3 -13
- package/corpus/templates/design/app/components/design/design-canvas/embedded-frame.ts +4 -2
- package/corpus/templates/design/app/components/design/design-canvas/hit-test.ts +3 -13
- package/corpus/templates/design/app/components/design/edit-panel/element-classification.ts +3 -1
- package/corpus/templates/design/app/components/design/edit-panel/inspect-code-source.ts +93 -0
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +4 -2
- package/corpus/templates/design/app/components/design/multi-screen/cross-screen-drop.ts +35 -0
- package/corpus/templates/design/app/components/design/multi-screen/iframe-targeting.ts +24 -0
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +9 -0
- package/corpus/templates/design/app/components/design/types.ts +29 -0
- package/corpus/templates/design/app/components/layout/Layout.tsx +7 -4
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +153 -46
- package/corpus/templates/design/app/i18n-responsive-interact.ts +12 -12
- package/corpus/templates/design/app/lib/design-editor-route.ts +23 -0
- package/corpus/templates/design/app/pages/VisualEdit.tsx +19 -6
- package/corpus/templates/design/app/pages/design-editor/action-error.ts +19 -0
- package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +29 -0
- package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +6 -0
- package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +277 -15
- package/corpus/templates/design/app/pages/design-editor/editor-state.ts +75 -9
- package/corpus/templates/design/app/pages/design-editor/layer-state-scope.ts +28 -0
- package/corpus/templates/design/app/pages/design-editor/live-screen-layer-drop.ts +41 -0
- package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +496 -41
- package/corpus/templates/design/app/pages/design-editor/pending-live-edit-unload-guard.ts +27 -0
- package/corpus/templates/design/app/pages/design-editor/pending-structure-verification.ts +10 -0
- package/corpus/templates/design/app/pages/design-editor/react-semantic-handoff.ts +168 -9
- package/corpus/templates/design/app/pages/design-editor/responsive-interact.ts +41 -3
- package/corpus/templates/design/app/pages/design-editor/screen-command-utils.ts +5 -0
- package/corpus/templates/design/app/pages/design-editor/selection-state.ts +42 -13
- package/corpus/templates/design/app/pages/design-editor/source-location.ts +180 -0
- package/corpus/templates/design/app/pages/design-editor/tool-state.ts +17 -0
- package/corpus/templates/design/app/public-routes.ts +1 -0
- package/corpus/templates/design/app/routes/visual-edit.$id.tsx +15 -0
- package/corpus/templates/design/changelog/2026-06-29-screen-overview-is-easier-to-find-and-named-screens-open-dir.md +1 -1
- package/corpus/templates/design/changelog/2026-07-28-deleting-a-selected-element-now-removes-it-from-the-live-pre.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-deleting-an-element-on-a-connected-localhost-screen-now-queu.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-interact-mode-now-shows-a-responsive-device-preview-with-pre.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-layer-hide-and-lock-now-apply-to-the-live-preview-instead-of.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-layers-panel-selections-on-a-connected-localhost-screen-can-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-locked-layers-now-show-a-subtle-dashed-outline-in-the-live-p.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-the-apply-design-updates-button-now-counts-pending-live-text.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-the-design-canvas-no-longer-stalls-on-a-render-loop-while-a-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-visual-edit-on-a-local-dev-server-no-longer-requires-signing.md +6 -0
- package/corpus/templates/design/changelog/2026-07-28-visual-edits-on-a-react-19-app-no-longer-report-a-source-lin.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-an-edit-that-cannot-be-written-to-source-now-names-the-reaso.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-applying-a-primitive-dropped-onto-a-connected-localhost-scre.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-changing-a-style-in-the-inspector-now-updates-a-connected-lo.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-choosing-edit-or-annotate-from-a-focused-screen-now-returns-.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-concurrent-source-edits-now-return-a-clear-conflict-response.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-creating-a-component-from-an-element-that-repeats-in-the-sou.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-deleting-an-element-you-just-dropped-onto-a-live-screen-no-l.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-dragging-a-layer-across-screens-no-longer-dies-when-the-poin.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-dragging-an-element-from-a-stored-screen-into-a-live-localho.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-drawing-a-box-on-the-canvas-and-dragging-it-into-a-connected.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-fixed-a-loading-screen-flicker-when-reopening-designs-with-a.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-interact-mode-has-edit-and-annotate-buttons-again-so-you-can.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-layer-groups-can-be-dropped-onto-live-localhost-screens.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-localhost-source-errors-now-say-what-actually-went-wrong-whi.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-opening-or-refreshing-a-live-localhost-screen-in-single-scre.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-redo-after-undoing-a-drop-onto-a-live-screen-puts-the-elemen.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-shapes-can-be-drawn-directly-onto-live-localhost-screens.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-shapes-drawn-on-the-canvas-board-now-appear-immediately-inst.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-style-edits-on-a-running-localhost-screen-now-preview-live-a.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-the-apply-design-updates-control-now-appears-as-a-clean-conn.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-visual-edits-on-a-mapped-component-instance-now-tell-the-age.md +6 -0
- package/corpus/templates/design/server/lib/design-data-access.ts +21 -7
- package/corpus/templates/design/server/lib/localhost-connection.ts +240 -0
- package/corpus/templates/design/server/routes/[...page].get.ts +2 -5
- package/corpus/templates/design/server/source-workspace.ts +2 -0
- package/corpus/templates/design/shared/code-layer.ts +43 -0
- package/corpus/templates/design/shared/html-content.ts +26 -0
- package/corpus/templates/design/shared/html-integrity.ts +21 -1
- package/corpus/templates/design/shared/local-jsx-visual-edit.ts +15 -0
- package/corpus/templates/design/shared/source-mode.ts +76 -0
- package/corpus/templates/dispatch/changelog/2026-07-29-workspace-members-without-admin-access-now-see-a-clear-permi.md +6 -0
- package/corpus/templates/dispatch/server/lib/usage-metrics.ts +2 -1
- package/corpus/templates/plan/app/lib/plan-annotation-runtime.ts +3 -4
- package/corpus/templates/plan/server/routes/[...page].get.ts +2 -5
- package/corpus/templates/slides/actions/patch-deck.ts +29 -17
- package/corpus/toolkit/CHANGELOG.md +6 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +3 -2
- package/dist/action-ui.d.ts +1 -0
- package/dist/action-ui.d.ts.map +1 -1
- package/dist/action-ui.js +1 -0
- package/dist/action-ui.js.map +1 -1
- package/dist/action.d.ts +5 -1
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +13 -5
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/harness/runner.d.ts.map +1 -1
- package/dist/agent/harness/runner.js +5 -0
- package/dist/agent/harness/runner.js.map +1 -1
- package/dist/agent/production-agent.d.ts +16 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +18 -1
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +6 -0
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/agent/run-manager.d.ts +14 -0
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +91 -1
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts +3 -0
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +35 -3
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/agent/types.d.ts +2 -0
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +4 -6
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/create.d.ts +66 -6
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +765 -66
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +2 -7
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/index.js +5 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.js +83 -47
- package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +16 -9
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +21 -0
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.d.ts +2 -0
- package/dist/client/blocks/library/wireframe-kit.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.js +8 -2
- package/dist/client/blocks/library/wireframe-kit.js.map +1 -1
- package/dist/client/chat/index.d.ts +1 -1
- package/dist/client/chat/index.d.ts.map +1 -1
- package/dist/client/chat/index.js +1 -1
- package/dist/client/chat/index.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +17 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +24 -2
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/run-recovery.d.ts +6 -0
- package/dist/client/chat/run-recovery.d.ts.map +1 -1
- package/dist/client/chat/run-recovery.js +13 -3
- package/dist/client/chat/run-recovery.js.map +1 -1
- package/dist/client/chat/widgets/DataTableWidget.d.ts.map +1 -1
- package/dist/client/chat/widgets/DataTableWidget.js +2 -3
- package/dist/client/chat/widgets/DataTableWidget.js.map +1 -1
- package/dist/client/chat/widgets/WorkspaceFileWidget.d.ts +5 -0
- package/dist/client/chat/widgets/WorkspaceFileWidget.d.ts.map +1 -0
- package/dist/client/chat/widgets/WorkspaceFileWidget.js +34 -0
- package/dist/client/chat/widgets/WorkspaceFileWidget.js.map +1 -0
- package/dist/client/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.js +13 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -1
- package/dist/client/chat/widgets/workspace-file-result.d.ts +12 -0
- package/dist/client/chat/widgets/workspace-file-result.d.ts.map +1 -0
- package/dist/client/chat/widgets/workspace-file-result.js +34 -0
- package/dist/client/chat/widgets/workspace-file-result.js.map +1 -0
- package/dist/client/embed-auth.d.ts.map +1 -1
- package/dist/client/embed-auth.js +2 -1
- package/dist/client/embed-auth.js.map +1 -1
- package/dist/client/org/InvitationBanner.d.ts +5 -2
- package/dist/client/org/InvitationBanner.d.ts.map +1 -1
- package/dist/client/org/InvitationBanner.js +9 -2
- package/dist/client/org/InvitationBanner.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +3 -2
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/org/TeamPage.d.ts.map +1 -1
- package/dist/client/org/TeamPage.js +27 -3
- package/dist/client/org/TeamPage.js.map +1 -1
- package/dist/client/org/WorkspaceNotice.d.ts +18 -0
- package/dist/client/org/WorkspaceNotice.d.ts.map +1 -0
- package/dist/client/org/WorkspaceNotice.js +56 -0
- package/dist/client/org/WorkspaceNotice.js.map +1 -0
- package/dist/client/org/hooks.d.ts +1 -0
- package/dist/client/org/hooks.d.ts.map +1 -1
- package/dist/client/org/hooks.js +12 -0
- package/dist/client/org/hooks.js.map +1 -1
- package/dist/client/org/index.d.ts +2 -1
- package/dist/client/org/index.d.ts.map +1 -1
- package/dist/client/org/index.js +2 -1
- package/dist/client/org/index.js.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.js +8 -12
- package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts +3 -0
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +49 -20
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/resources/mcp-integration-catalog.d.ts +1 -0
- package/dist/client/resources/mcp-integration-catalog.d.ts.map +1 -1
- package/dist/client/resources/mcp-integration-catalog.js +3 -0
- package/dist/client/resources/mcp-integration-catalog.js.map +1 -1
- package/dist/client/resources/use-resources.d.ts +1 -0
- package/dist/client/resources/use-resources.d.ts.map +1 -1
- package/dist/client/resources/use-resources.js +3 -0
- package/dist/client/resources/use-resources.js.map +1 -1
- package/dist/client/use-action.d.ts +3 -1
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +3 -1
- package/dist/client/use-action.js.map +1 -1
- package/dist/client/widgets/index.d.ts +1 -1
- package/dist/client/widgets/index.d.ts.map +1 -1
- package/dist/client/widgets/index.js +1 -1
- package/dist/client/widgets/index.js.map +1 -1
- package/dist/coding-tools/run-code.js +2 -1
- package/dist/coding-tools/run-code.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/db/client.d.ts +1 -0
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +24 -3
- package/dist/db/client.js.map +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +25 -3
- package/dist/deploy/build.js.map +1 -1
- package/dist/eject/remote-mcp-presets.js +1 -1
- package/dist/eject/remote-mcp-presets.js.map +1 -1
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/google-docs-poller.d.ts.map +1 -1
- package/dist/integrations/google-docs-poller.js +4 -1
- package/dist/integrations/google-docs-poller.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +23 -11
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/jobs/scheduler.js +4 -0
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +3 -2
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +3 -2
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +27 -7
- package/dist/observability/traces.js.map +1 -1
- package/dist/org/handlers.d.ts +15 -0
- package/dist/org/handlers.d.ts.map +1 -1
- package/dist/org/handlers.js +45 -1
- package/dist/org/handlers.js.map +1 -1
- package/dist/org/migrations.d.ts.map +1 -1
- package/dist/org/migrations.js +4 -0
- package/dist/org/migrations.js.map +1 -1
- package/dist/org/plugin.d.ts +1 -0
- package/dist/org/plugin.d.ts.map +1 -1
- package/dist/org/plugin.js +10 -1
- package/dist/org/plugin.js.map +1 -1
- package/dist/org/schema.d.ts +19 -0
- package/dist/org/schema.d.ts.map +1 -1
- package/dist/org/schema.js +1 -0
- package/dist/org/schema.js.map +1 -1
- package/dist/org/types.d.ts +8 -0
- package/dist/org/types.d.ts.map +1 -1
- package/dist/org/types.js.map +1 -1
- package/dist/org/workspace-url.d.ts +32 -0
- package/dist/org/workspace-url.d.ts.map +1 -0
- package/dist/org/workspace-url.js +63 -0
- package/dist/org/workspace-url.js.map +1 -0
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +11 -11
- package/dist/provider-api/actions/provider-api.d.ts +7 -7
- package/dist/resources/handlers.d.ts +2 -3
- package/dist/resources/handlers.d.ts.map +1 -1
- package/dist/resources/handlers.js +25 -5
- package/dist/resources/handlers.js.map +1 -1
- package/dist/scripts/runner.d.ts +17 -0
- package/dist/scripts/runner.d.ts.map +1 -1
- package/dist/scripts/runner.js +130 -5
- package/dist/scripts/runner.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +24 -2
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +26 -1
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-teams.d.ts.map +1 -1
- package/dist/server/agent-teams.js +10 -1
- package/dist/server/agent-teams.js.map +1 -1
- package/dist/server/auth.d.ts +22 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +33 -7
- package/dist/server/auth.js.map +1 -1
- package/dist/server/embed-route.d.ts.map +1 -1
- package/dist/server/embed-route.js +6 -1
- package/dist/server/embed-route.js.map +1 -1
- package/dist/server/embed-session.d.ts +7 -0
- package/dist/server/embed-session.d.ts.map +1 -1
- package/dist/server/embed-session.js +46 -4
- package/dist/server/embed-session.js.map +1 -1
- package/dist/server/open-route.d.ts.map +1 -1
- package/dist/server/open-route.js +17 -7
- package/dist/server/open-route.js.map +1 -1
- package/dist/server/prompts/framework-core-compact.js +1 -1
- package/dist/server/prompts/framework-core-compact.js.map +1 -1
- package/dist/server/prompts/framework-core.d.ts.map +1 -1
- package/dist/server/prompts/framework-core.js +1 -0
- package/dist/server/prompts/framework-core.js.map +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/request-context.d.ts +26 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-context.js +18 -1
- package/dist/server/request-context.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/embed-auth.d.ts +1 -0
- package/dist/shared/embed-auth.d.ts.map +1 -1
- package/dist/shared/embed-auth.js +1 -0
- package/dist/shared/embed-auth.js.map +1 -1
- package/dist/shared/html-document.d.ts +12 -0
- package/dist/shared/html-document.d.ts.map +1 -0
- package/dist/shared/html-document.js +92 -0
- package/dist/shared/html-document.js.map +1 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +1 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/sharing/access.d.ts +1 -0
- package/dist/sharing/access.d.ts.map +1 -1
- package/dist/sharing/access.js +8 -2
- package/dist/sharing/access.js.map +1 -1
- package/dist/sharing/registry.d.ts +3 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/workspace-files/actions.d.ts +28 -0
- package/dist/workspace-files/actions.d.ts.map +1 -0
- package/dist/workspace-files/actions.js +75 -0
- package/dist/workspace-files/actions.js.map +1 -0
- package/dist/workspace-files/tool.d.ts.map +1 -1
- package/dist/workspace-files/tool.js +4 -0
- package/dist/workspace-files/tool.js.map +1 -1
- package/docs/content/cloneable-saas.mdx +114 -0
- package/docs/content/creating-templates.mdx +28 -2
- package/docs/content/syncing-template-changes.mdx +7 -0
- package/docs/content/template-clips-developers.mdx +12 -5
- package/docs/content/template-dispatch-developers.mdx +1 -1
- package/docs/content/template-dispatch.mdx +1 -1
- package/package.json +2 -2
- package/src/action-ui.ts +1 -0
- package/src/action.ts +5 -1
- package/src/agent/engine/ai-sdk-engine.ts +15 -5
- package/src/agent/harness/runner.ts +5 -0
- package/src/agent/production-agent.ts +33 -0
- package/src/agent/run-loop-with-resume.ts +5 -0
- package/src/agent/run-manager.ts +126 -1
- package/src/agent/thread-data-builder.ts +47 -2
- package/src/agent/types.ts +2 -0
- package/src/chat-threads/store.ts +4 -5
- package/src/cli/create.ts +1139 -65
- package/src/cli/design-connect.ts +3 -7
- package/src/cli/index.ts +5 -3
- package/src/cli/skills-content/design-visual-edit-skill.ts +83 -47
- package/src/client/AssistantChat.tsx +27 -16
- package/src/client/agent-chat-adapter.ts +24 -0
- package/src/client/blocks/library/wireframe-kit.tsx +17 -2
- package/src/client/chat/index.ts +1 -0
- package/src/client/chat/message-components.tsx +104 -1
- package/src/client/chat/run-recovery.tsx +15 -3
- package/src/client/chat/widgets/DataTableWidget.tsx +10 -29
- package/src/client/chat/widgets/WorkspaceFileWidget.tsx +71 -0
- package/src/client/chat/widgets/builtin-tool-renderers.tsx +22 -0
- package/src/client/chat/widgets/workspace-file-result.ts +49 -0
- package/src/client/embed-auth.ts +2 -0
- package/src/client/org/InvitationBanner.tsx +14 -1
- package/src/client/org/OrgSwitcher.tsx +23 -0
- package/src/client/org/TeamPage.tsx +130 -0
- package/src/client/org/WorkspaceNotice.tsx +85 -0
- package/src/client/org/hooks.ts +14 -0
- package/src/client/org/index.ts +2 -0
- package/src/client/resources/McpIntegrationDialog.tsx +27 -40
- package/src/client/resources/ResourcesPanel.tsx +134 -51
- package/src/client/resources/mcp-integration-catalog.ts +7 -0
- package/src/client/resources/use-resources.ts +6 -0
- package/src/client/use-action.ts +3 -1
- package/src/client/widgets/index.ts +1 -0
- package/src/coding-tools/run-code.ts +2 -1
- package/src/db/client.ts +28 -4
- package/src/deploy/build.ts +31 -3
- package/src/eject/remote-mcp-presets.ts +1 -1
- package/src/index.browser.ts +1 -0
- package/src/index.ts +1 -0
- package/src/integrations/google-docs-poller.ts +3 -0
- package/src/integrations/webhook-handler.ts +28 -11
- package/src/jobs/scheduler.ts +4 -0
- package/src/localization/default-messages.ts +3 -2
- package/src/observability/traces.ts +48 -12
- package/src/org/handlers.ts +52 -1
- package/src/org/migrations.ts +4 -0
- package/src/org/plugin.ts +14 -0
- package/src/org/schema.ts +1 -0
- package/src/org/types.ts +8 -0
- package/src/org/workspace-url.ts +74 -0
- package/src/resources/handlers.ts +35 -5
- package/src/scripts/runner.ts +183 -5
- package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +2 -1
- package/src/server/action-routes.ts +32 -2
- package/src/server/agent-chat-plugin.ts +29 -0
- package/src/server/agent-teams.ts +10 -1
- package/src/server/auth.ts +33 -7
- package/src/server/embed-route.ts +9 -0
- package/src/server/embed-session.ts +62 -3
- package/src/server/open-route.ts +20 -6
- package/src/server/prompts/framework-core-compact.ts +1 -1
- package/src/server/prompts/framework-core.ts +1 -0
- package/src/server/request-context.ts +36 -1
- package/src/shared/embed-auth.ts +1 -0
- package/src/shared/html-document.ts +115 -0
- package/src/shared/index.ts +1 -0
- package/src/sharing/access.ts +8 -1
- package/src/sharing/registry.ts +11 -2
- package/src/workspace-files/actions.ts +100 -0
- package/src/workspace-files/tool.ts +4 -0
- package/corpus/templates/design/changelog/2026-07-28-interact-mode-can-preview-designs-in-responsive-device-sizes.md +0 -6
- package/corpus/templates/design/changelog/2026-07-28-interact-mode-now-opens-a-full-screen-responsive-preview-wit.md +0 -6
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from "@agent-native/core/client/hooks";
|
|
12
12
|
import { oauthRedirectUri } from "@agent-native/core/client/host";
|
|
13
13
|
import { useT } from "@agent-native/core/client/i18n";
|
|
14
|
+
import { useOrgRole } from "@agent-native/core/client/org";
|
|
14
15
|
import {
|
|
15
16
|
IconCheck,
|
|
16
17
|
IconChevronDown,
|
|
@@ -33,6 +34,7 @@ import {
|
|
|
33
34
|
} from "@tabler/icons-react";
|
|
34
35
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
35
36
|
import { useEffect, useState } from "react";
|
|
37
|
+
import { Link, useSearchParams } from "react-router";
|
|
36
38
|
|
|
37
39
|
import {
|
|
38
40
|
AlertDialog,
|
|
@@ -68,11 +70,17 @@ import {
|
|
|
68
70
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
69
71
|
import { getIdToken } from "@/lib/auth";
|
|
70
72
|
import {
|
|
73
|
+
dataSourceOAuthReturnPath,
|
|
74
|
+
focusedDataSourceFromSearchParams,
|
|
71
75
|
getOptionalCredentialKeys,
|
|
72
76
|
getSharedConnectionStatus,
|
|
73
77
|
getGoogleDriveConnection,
|
|
78
|
+
isWorkspaceOAuthSource,
|
|
74
79
|
isSourceReady,
|
|
75
80
|
isSourceLocallyConfigured,
|
|
81
|
+
shouldOfferWorkspaceOAuthReconnect,
|
|
82
|
+
shouldShowWorkspaceOAuthAdminNotice,
|
|
83
|
+
shouldShowWorkspaceOAuthSetup,
|
|
76
84
|
credentialRowsFromStatus,
|
|
77
85
|
type DataSourceStatusResponse,
|
|
78
86
|
type EnvKeyStatus,
|
|
@@ -432,27 +440,30 @@ function GitHubOAuthView({
|
|
|
432
440
|
);
|
|
433
441
|
}
|
|
434
442
|
|
|
443
|
+
function startWorkspaceOAuth(provider: string, returnPath: string): void {
|
|
444
|
+
const params = new URLSearchParams({
|
|
445
|
+
appId: "analytics",
|
|
446
|
+
return: returnPath,
|
|
447
|
+
});
|
|
448
|
+
window.location.assign(
|
|
449
|
+
agentNativePath(
|
|
450
|
+
`/_agent-native/connections/oauth/${provider}/start?${params.toString()}`,
|
|
451
|
+
),
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
|
|
435
455
|
function WorkspaceOAuthView({
|
|
436
456
|
provider,
|
|
437
457
|
label,
|
|
438
458
|
connected,
|
|
459
|
+
returnPath = "/data-sources",
|
|
439
460
|
}: {
|
|
440
461
|
provider: string;
|
|
441
462
|
label: string;
|
|
442
463
|
connected: boolean;
|
|
464
|
+
returnPath?: string;
|
|
443
465
|
}) {
|
|
444
466
|
const t = useT();
|
|
445
|
-
const connect = () => {
|
|
446
|
-
const params = new URLSearchParams({
|
|
447
|
-
appId: "analytics",
|
|
448
|
-
return: "/data-sources",
|
|
449
|
-
});
|
|
450
|
-
window.location.assign(
|
|
451
|
-
agentNativePath(
|
|
452
|
-
`/_agent-native/connections/oauth/${provider}/start?${params.toString()}`,
|
|
453
|
-
),
|
|
454
|
-
);
|
|
455
|
-
};
|
|
456
467
|
|
|
457
468
|
return (
|
|
458
469
|
<div className="space-y-3 rounded-md border border-border/50 bg-muted/20 p-3">
|
|
@@ -471,7 +482,7 @@ function WorkspaceOAuthView({
|
|
|
471
482
|
<Button
|
|
472
483
|
size="sm"
|
|
473
484
|
variant={connected ? "outline" : "default"}
|
|
474
|
-
onClick={
|
|
485
|
+
onClick={() => startWorkspaceOAuth(provider, returnPath)}
|
|
475
486
|
className="shrink-0 text-xs"
|
|
476
487
|
>
|
|
477
488
|
{connected ? t("dataSources.reconnect") : t("dataSources.connect")}
|
|
@@ -574,10 +585,16 @@ function SharedConnectionStatusRow({
|
|
|
574
585
|
|
|
575
586
|
function WorkspaceReadyView({
|
|
576
587
|
source,
|
|
588
|
+
sharedConnectionStatus,
|
|
589
|
+
canManageOrg,
|
|
590
|
+
oauthReturnPath,
|
|
577
591
|
onSaved,
|
|
578
592
|
onAddLocalCredentials,
|
|
579
593
|
}: {
|
|
580
594
|
source: DataSource;
|
|
595
|
+
sharedConnectionStatus: SharedConnectionStatus | null;
|
|
596
|
+
canManageOrg: boolean;
|
|
597
|
+
oauthReturnPath: string;
|
|
581
598
|
onSaved: () => void;
|
|
582
599
|
onAddLocalCredentials: () => void;
|
|
583
600
|
}) {
|
|
@@ -594,6 +611,12 @@ function WorkspaceReadyView({
|
|
|
594
611
|
onSaved();
|
|
595
612
|
},
|
|
596
613
|
});
|
|
614
|
+
const canReconnect = shouldOfferWorkspaceOAuthReconnect(
|
|
615
|
+
source,
|
|
616
|
+
sharedConnectionStatus,
|
|
617
|
+
canManageOrg,
|
|
618
|
+
testResult?.ok === false,
|
|
619
|
+
);
|
|
597
620
|
|
|
598
621
|
return (
|
|
599
622
|
<div className="space-y-3">
|
|
@@ -628,6 +651,16 @@ function WorkspaceReadyView({
|
|
|
628
651
|
>
|
|
629
652
|
{t("dataSources.addLocalCredentials")}
|
|
630
653
|
</Button>
|
|
654
|
+
{canReconnect && (
|
|
655
|
+
<Button
|
|
656
|
+
size="sm"
|
|
657
|
+
variant="outline"
|
|
658
|
+
onClick={() => startWorkspaceOAuth(source.id, oauthReturnPath)}
|
|
659
|
+
className="text-xs"
|
|
660
|
+
>
|
|
661
|
+
{t("dataSources.reconnect")}
|
|
662
|
+
</Button>
|
|
663
|
+
)}
|
|
631
664
|
{source.docsUrl && (
|
|
632
665
|
<a
|
|
633
666
|
href={source.docsUrl}
|
|
@@ -1101,6 +1134,12 @@ function DataSourceCard({
|
|
|
1101
1134
|
envStatus,
|
|
1102
1135
|
isStatusLoading,
|
|
1103
1136
|
statusUnknown,
|
|
1137
|
+
canManageOrg,
|
|
1138
|
+
orgLoaded,
|
|
1139
|
+
hasOrg,
|
|
1140
|
+
focused,
|
|
1141
|
+
oauthReturnPath,
|
|
1142
|
+
showAskContinuation,
|
|
1104
1143
|
onSaved,
|
|
1105
1144
|
}: {
|
|
1106
1145
|
source: DataSource;
|
|
@@ -1110,10 +1149,16 @@ function DataSourceCard({
|
|
|
1110
1149
|
envStatus: EnvKeyStatus[];
|
|
1111
1150
|
isStatusLoading: boolean;
|
|
1112
1151
|
statusUnknown: boolean;
|
|
1152
|
+
canManageOrg: boolean;
|
|
1153
|
+
orgLoaded: boolean;
|
|
1154
|
+
hasOrg: boolean;
|
|
1155
|
+
focused: boolean;
|
|
1156
|
+
oauthReturnPath: string;
|
|
1157
|
+
showAskContinuation: boolean;
|
|
1113
1158
|
onSaved: () => void;
|
|
1114
1159
|
}) {
|
|
1115
1160
|
const t = useT();
|
|
1116
|
-
const [expanded, setExpanded] = useState(
|
|
1161
|
+
const [expanded, setExpanded] = useState(focused);
|
|
1117
1162
|
const [currentStep, setCurrentStep] = useState(0);
|
|
1118
1163
|
const [inputValues, setInputValues] = useState<Record<string, string>>({});
|
|
1119
1164
|
const [showLocalCredentials, setShowLocalCredentials] = useState(false);
|
|
@@ -1138,12 +1183,26 @@ function DataSourceCard({
|
|
|
1138
1183
|
const readyViaWorkspace = sharedConnectionStatus?.kind === "ready";
|
|
1139
1184
|
const showCredentialSetup =
|
|
1140
1185
|
!locallyConfigured && (!readyViaWorkspace || showLocalCredentials);
|
|
1186
|
+
const preferWorkspaceSetup =
|
|
1187
|
+
isWorkspaceOAuthSource(source) &&
|
|
1188
|
+
!locallyConfigured &&
|
|
1189
|
+
!readyViaWorkspace &&
|
|
1190
|
+
!showLocalCredentials;
|
|
1191
|
+
const workspaceRoleLoading =
|
|
1192
|
+
isWorkspaceOAuthSource(source) && !ready && !orgLoaded;
|
|
1141
1193
|
// An unreadable status cannot tell this source apart from an unconfigured
|
|
1142
1194
|
// one, so the setup walkthrough would be guessing.
|
|
1143
1195
|
const showUnknownStatus = statusUnknown && !ready && !showLocalCredentials;
|
|
1144
1196
|
|
|
1197
|
+
useEffect(() => {
|
|
1198
|
+
if (focused) setExpanded(true);
|
|
1199
|
+
}, [focused]);
|
|
1200
|
+
|
|
1145
1201
|
return (
|
|
1146
|
-
<Card
|
|
1202
|
+
<Card
|
|
1203
|
+
id={`data-source-${source.id}`}
|
|
1204
|
+
className="data-source-card bg-card border-border/50"
|
|
1205
|
+
>
|
|
1147
1206
|
<button
|
|
1148
1207
|
onClick={() => setExpanded(!expanded)}
|
|
1149
1208
|
className="w-full rounded-t-lg text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring/50"
|
|
@@ -1220,6 +1279,17 @@ function DataSourceCard({
|
|
|
1220
1279
|
|
|
1221
1280
|
{expanded && !showUnknownStatus && (
|
|
1222
1281
|
<CardContent className="border-t border-border/50 px-5 py-4">
|
|
1282
|
+
{focused && ready && showAskContinuation && (
|
|
1283
|
+
<div className="mb-4 flex flex-wrap items-center justify-between gap-3 rounded-md border border-emerald-500/30 bg-emerald-500/10 p-3">
|
|
1284
|
+
<span className="flex items-center gap-2 text-xs font-medium text-emerald-600 dark:text-emerald-400">
|
|
1285
|
+
<IconCheck className="h-3.5 w-3.5" />
|
|
1286
|
+
{t("dataSources.connectionSuccessful")}
|
|
1287
|
+
</span>
|
|
1288
|
+
<Button asChild size="sm" className="text-xs">
|
|
1289
|
+
<Link to="/ask">{t("navigation.ask")}</Link>
|
|
1290
|
+
</Button>
|
|
1291
|
+
</div>
|
|
1292
|
+
)}
|
|
1223
1293
|
{source.id === "github" && (
|
|
1224
1294
|
<div className="mb-4">
|
|
1225
1295
|
<GitHubOAuthView
|
|
@@ -1228,20 +1298,50 @@ function DataSourceCard({
|
|
|
1228
1298
|
/>
|
|
1229
1299
|
</div>
|
|
1230
1300
|
)}
|
|
1231
|
-
{(
|
|
1232
|
-
source
|
|
1301
|
+
{shouldShowWorkspaceOAuthSetup(
|
|
1302
|
+
source,
|
|
1303
|
+
sharedConnectionStatus,
|
|
1304
|
+
canManageOrg,
|
|
1233
1305
|
) && (
|
|
1234
1306
|
<div className="mb-4">
|
|
1235
1307
|
<WorkspaceOAuthView
|
|
1236
1308
|
provider={source.id}
|
|
1237
1309
|
label={source.name}
|
|
1238
|
-
connected={
|
|
1310
|
+
connected={sharedConnectionStatus?.kind === "needs_grant"}
|
|
1311
|
+
returnPath={oauthReturnPath}
|
|
1239
1312
|
/>
|
|
1240
1313
|
</div>
|
|
1241
1314
|
)}
|
|
1242
|
-
{
|
|
1243
|
-
|
|
1315
|
+
{shouldShowWorkspaceOAuthAdminNotice(
|
|
1316
|
+
source,
|
|
1317
|
+
ready,
|
|
1318
|
+
canManageOrg,
|
|
1319
|
+
orgLoaded,
|
|
1320
|
+
hasOrg,
|
|
1321
|
+
) && (
|
|
1322
|
+
<div className="mb-4 rounded-md border border-border/50 bg-muted/20 p-3">
|
|
1323
|
+
<div className="flex items-start gap-3">
|
|
1324
|
+
<div className="flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-background text-muted-foreground">
|
|
1325
|
+
<IconPlugConnected className="h-4 w-4" />
|
|
1326
|
+
</div>
|
|
1327
|
+
<div className="min-w-0 space-y-1">
|
|
1328
|
+
<p className="text-xs font-medium text-foreground">
|
|
1329
|
+
{t("dataSources.workspaceAdminRequiredTitle")}
|
|
1330
|
+
</p>
|
|
1331
|
+
<p className="text-xs text-muted-foreground">
|
|
1332
|
+
{t("dataSources.workspaceAdminRequiredDescription", {
|
|
1333
|
+
name: source.name,
|
|
1334
|
+
})}
|
|
1335
|
+
</p>
|
|
1336
|
+
</div>
|
|
1337
|
+
</div>
|
|
1338
|
+
</div>
|
|
1244
1339
|
)}
|
|
1340
|
+
{sharedConnectionStatus &&
|
|
1341
|
+
sharedConnectionStatus.kind !== "needs_credentials" &&
|
|
1342
|
+
sharedConnectionStatus.kind !== "needs_grant" && (
|
|
1343
|
+
<SharedConnectionStatusRow status={sharedConnectionStatus} />
|
|
1344
|
+
)}
|
|
1245
1345
|
{locallyConfigured ? (
|
|
1246
1346
|
<ConnectedView
|
|
1247
1347
|
source={source}
|
|
@@ -1251,9 +1351,23 @@ function DataSourceCard({
|
|
|
1251
1351
|
) : readyViaWorkspace && !showCredentialSetup ? (
|
|
1252
1352
|
<WorkspaceReadyView
|
|
1253
1353
|
source={source}
|
|
1354
|
+
sharedConnectionStatus={sharedConnectionStatus}
|
|
1355
|
+
canManageOrg={canManageOrg}
|
|
1356
|
+
oauthReturnPath={oauthReturnPath}
|
|
1254
1357
|
onSaved={onSaved}
|
|
1255
1358
|
onAddLocalCredentials={() => setShowLocalCredentials(true)}
|
|
1256
1359
|
/>
|
|
1360
|
+
) : workspaceRoleLoading ? (
|
|
1361
|
+
<Skeleton className="h-9 w-full rounded-md" />
|
|
1362
|
+
) : preferWorkspaceSetup ? (
|
|
1363
|
+
<Button
|
|
1364
|
+
size="sm"
|
|
1365
|
+
variant="ghost"
|
|
1366
|
+
onClick={() => setShowLocalCredentials(true)}
|
|
1367
|
+
className="text-xs"
|
|
1368
|
+
>
|
|
1369
|
+
{t("dataSources.addLocalCredentials")}
|
|
1370
|
+
</Button>
|
|
1257
1371
|
) : (
|
|
1258
1372
|
<>
|
|
1259
1373
|
{/* Step progress */}
|
|
@@ -1726,8 +1840,34 @@ function FirstPartyAnalyticsCard() {
|
|
|
1726
1840
|
|
|
1727
1841
|
export default function DataSources() {
|
|
1728
1842
|
const t = useT();
|
|
1843
|
+
const { canManageOrg, isLoading: isOrgRoleLoading, org } = useOrgRole();
|
|
1844
|
+
const [searchParams] = useSearchParams();
|
|
1729
1845
|
const queryClient = useQueryClient();
|
|
1730
|
-
const
|
|
1846
|
+
const focusedSourceResolution =
|
|
1847
|
+
focusedDataSourceFromSearchParams(searchParams);
|
|
1848
|
+
const focusedSource =
|
|
1849
|
+
focusedSourceResolution.status === "found"
|
|
1850
|
+
? focusedSourceResolution.source
|
|
1851
|
+
: undefined;
|
|
1852
|
+
const unknownFocusedSourceId =
|
|
1853
|
+
focusedSourceResolution.status === "unknown"
|
|
1854
|
+
? focusedSourceResolution.requestedId
|
|
1855
|
+
: null;
|
|
1856
|
+
const focusedSourceId = focusedSource?.id ?? "";
|
|
1857
|
+
const showAskContinuation = searchParams.get("returnTo") === "ask";
|
|
1858
|
+
const [search, setSearch] = useState(() => focusedSource?.name ?? "");
|
|
1859
|
+
const oauthReturnPath = dataSourceOAuthReturnPath(
|
|
1860
|
+
focusedSource,
|
|
1861
|
+
showAskContinuation,
|
|
1862
|
+
);
|
|
1863
|
+
|
|
1864
|
+
useEffect(() => {
|
|
1865
|
+
if (focusedSource) {
|
|
1866
|
+
setSearch(focusedSource.name);
|
|
1867
|
+
} else if (unknownFocusedSourceId) {
|
|
1868
|
+
setSearch("");
|
|
1869
|
+
}
|
|
1870
|
+
}, [focusedSource, unknownFocusedSourceId]);
|
|
1731
1871
|
|
|
1732
1872
|
const {
|
|
1733
1873
|
data: rawStatusData,
|
|
@@ -1798,6 +1938,18 @@ export default function DataSources() {
|
|
|
1798
1938
|
|
|
1799
1939
|
<GoogleSheetsExportCard statusData={statusData} />
|
|
1800
1940
|
|
|
1941
|
+
{unknownFocusedSourceId && (
|
|
1942
|
+
<div
|
|
1943
|
+
role="status"
|
|
1944
|
+
className="flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 p-3 text-sm text-amber-700 dark:text-amber-300"
|
|
1945
|
+
>
|
|
1946
|
+
<IconAlertCircle className="mt-0.5 h-4 w-4 shrink-0" />
|
|
1947
|
+
<span>
|
|
1948
|
+
{t("dataSources.noMatch", { search: unknownFocusedSourceId })}
|
|
1949
|
+
</span>
|
|
1950
|
+
</div>
|
|
1951
|
+
)}
|
|
1952
|
+
|
|
1801
1953
|
{/* Search bar + Add Data Source */}
|
|
1802
1954
|
<div className="data-sources-toolbar">
|
|
1803
1955
|
<div className="relative min-w-0 flex-1">
|
|
@@ -1836,6 +1988,12 @@ export default function DataSources() {
|
|
|
1836
1988
|
envStatus={envStatus}
|
|
1837
1989
|
isStatusLoading={isStatusLoading}
|
|
1838
1990
|
statusUnknown={statusUnknown}
|
|
1991
|
+
canManageOrg={canManageOrg}
|
|
1992
|
+
orgLoaded={!isOrgRoleLoading}
|
|
1993
|
+
hasOrg={Boolean(org?.orgId)}
|
|
1994
|
+
focused={source.id === focusedSourceId}
|
|
1995
|
+
oauthReturnPath={oauthReturnPath}
|
|
1996
|
+
showAskContinuation={showAskContinuation}
|
|
1839
1997
|
onSaved={handleSaved}
|
|
1840
1998
|
/>
|
|
1841
1999
|
))}
|
|
@@ -1874,6 +2032,12 @@ export default function DataSources() {
|
|
|
1874
2032
|
envStatus={envStatus}
|
|
1875
2033
|
isStatusLoading={isStatusLoading}
|
|
1876
2034
|
statusUnknown={statusUnknown}
|
|
2035
|
+
canManageOrg={canManageOrg}
|
|
2036
|
+
orgLoaded={!isOrgRoleLoading}
|
|
2037
|
+
hasOrg={Boolean(org?.orgId)}
|
|
2038
|
+
focused={source.id === focusedSourceId}
|
|
2039
|
+
oauthReturnPath={oauthReturnPath}
|
|
2040
|
+
showAskContinuation={showAskContinuation}
|
|
1877
2041
|
onSaved={handleSaved}
|
|
1878
2042
|
/>
|
|
1879
2043
|
))}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: fixed
|
|
3
|
+
date: 2026-07-28
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Native Analytics data sources no longer show duplicate MCP setup callouts; missing sources now open a focused organization OAuth flow that returns to Ask, and connected HubSpot OAuth works across native questions and dashboards.
|
|
@@ -76,7 +76,8 @@ function emitBackgroundWorker(token: string) {
|
|
|
76
76
|
cpSync(SERVER_DIR, dest, { recursive: true });
|
|
77
77
|
rmSync(path.join(dest, "server.mjs"), { force: true });
|
|
78
78
|
|
|
79
|
-
const source = `globalThis.
|
|
79
|
+
const source = `globalThis.__AGENT_NATIVE_BACKGROUND_RUNTIME__ = true;
|
|
80
|
+
globalThis.__AGENT_NATIVE_DASHBOARD_REPORT_SCHEDULED_RUNTIME__ = true;
|
|
80
81
|
|
|
81
82
|
const CRON_TOKEN = ${JSON.stringify(token)};
|
|
82
83
|
const ROUTE_PATH = ${JSON.stringify(ROUTE_PATH)};
|
|
@@ -192,7 +193,8 @@ function emitAlertBackgroundWorker(token: string) {
|
|
|
192
193
|
cpSync(SERVER_DIR, dest, { recursive: true });
|
|
193
194
|
rmSync(path.join(dest, "server.mjs"), { force: true });
|
|
194
195
|
|
|
195
|
-
const source = `globalThis.
|
|
196
|
+
const source = `globalThis.__AGENT_NATIVE_BACKGROUND_RUNTIME__ = true;
|
|
197
|
+
globalThis.__AGENT_NATIVE_ANALYTICS_ALERT_SCHEDULED_RUNTIME__ = true;
|
|
196
198
|
|
|
197
199
|
const CRON_TOKEN = ${JSON.stringify(token)};
|
|
198
200
|
const ROUTE_PATH = ${JSON.stringify(ALERT_ROUTE_PATH)};
|
|
@@ -308,7 +310,8 @@ function emitUptimeBackgroundWorker(token: string) {
|
|
|
308
310
|
cpSync(SERVER_DIR, dest, { recursive: true });
|
|
309
311
|
rmSync(path.join(dest, "server.mjs"), { force: true });
|
|
310
312
|
|
|
311
|
-
const source = `globalThis.
|
|
313
|
+
const source = `globalThis.__AGENT_NATIVE_BACKGROUND_RUNTIME__ = true;
|
|
314
|
+
globalThis.__AGENT_NATIVE_UPTIME_MONITOR_SCHEDULED_RUNTIME__ = true;
|
|
312
315
|
|
|
313
316
|
const CRON_TOKEN = ${JSON.stringify(token)};
|
|
314
317
|
const ROUTE_PATH = ${JSON.stringify(UPTIME_ROUTE_PATH)};
|
|
@@ -39,7 +39,7 @@ async function getToken(): Promise<string> {
|
|
|
39
39
|
});
|
|
40
40
|
if (!credential) {
|
|
41
41
|
throw new Error(
|
|
42
|
-
"
|
|
42
|
+
"HubSpot is not connected for Analytics. Connect it in Data Sources, then retry.",
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
return credential.value;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isProviderApiId,
|
|
3
|
+
resolveProviderApiOAuthAccessToken,
|
|
4
|
+
} from "@agent-native/core/provider-api";
|
|
1
5
|
import type { SecretRef } from "@agent-native/core/secrets";
|
|
2
6
|
import type { WorkspaceConnectionCredentialResolution } from "@agent-native/core/workspace-connections";
|
|
3
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
resolveWorkspaceConnectionCredentialForApp,
|
|
9
|
+
resolveWorkspaceConnectionForApp,
|
|
10
|
+
} from "@agent-native/core/workspace-connections";
|
|
4
11
|
|
|
5
12
|
import { resolveCredential, type CredentialContext } from "./credentials";
|
|
6
13
|
|
|
@@ -153,6 +160,49 @@ async function resolveViaCoreHelper({
|
|
|
153
160
|
return null;
|
|
154
161
|
}
|
|
155
162
|
|
|
163
|
+
async function resolveWorkspaceOAuthProviderCredential(
|
|
164
|
+
options: ResolveProviderCredentialOptions,
|
|
165
|
+
): Promise<AnalyticsProviderCredential | null> {
|
|
166
|
+
if (options.workspaceConnection === false) return null;
|
|
167
|
+
const provider = options.provider.trim().toLowerCase();
|
|
168
|
+
if (!isProviderApiId(provider)) return null;
|
|
169
|
+
|
|
170
|
+
const requestedConnectionId = options.connectionId?.trim() || undefined;
|
|
171
|
+
const resolvedConnection = await resolveWorkspaceConnectionForApp({
|
|
172
|
+
appId: ANALYTICS_APP_ID,
|
|
173
|
+
provider,
|
|
174
|
+
connectionId: requestedConnectionId,
|
|
175
|
+
requireConnected: true,
|
|
176
|
+
});
|
|
177
|
+
if (
|
|
178
|
+
!resolvedConnection.available ||
|
|
179
|
+
resolvedConnection.connection?.config.credentialMode !== "oauth"
|
|
180
|
+
) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const oauth = await resolveProviderApiOAuthAccessToken(
|
|
185
|
+
{
|
|
186
|
+
provider,
|
|
187
|
+
connectionId: resolvedConnection.connection.id,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
appId: ANALYTICS_APP_ID,
|
|
191
|
+
providerIds: [provider],
|
|
192
|
+
getCredentialContext: () => options.ctx,
|
|
193
|
+
},
|
|
194
|
+
);
|
|
195
|
+
return {
|
|
196
|
+
value: oauth.accessToken,
|
|
197
|
+
key: `${normalizeKey(provider)}_OAUTH_TOKEN`,
|
|
198
|
+
provider,
|
|
199
|
+
source: "workspace_connection",
|
|
200
|
+
connectionId: oauth.connectionId ?? resolvedConnection.connection.id,
|
|
201
|
+
connectionLabel:
|
|
202
|
+
oauth.connectionLabel ?? resolvedConnection.connection.label,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
156
206
|
export async function resolveWorkspaceConnectionProviderCredential(
|
|
157
207
|
options: ResolveProviderCredentialOptions,
|
|
158
208
|
): Promise<AnalyticsProviderCredential | null> {
|
|
@@ -220,6 +270,10 @@ export async function resolveAnalyticsProviderCredential(
|
|
|
220
270
|
options: ResolveProviderCredentialOptions,
|
|
221
271
|
): Promise<AnalyticsProviderCredential | null> {
|
|
222
272
|
const keys = uniqueKeys(options.keys);
|
|
273
|
+
const oauthCredential =
|
|
274
|
+
await resolveWorkspaceOAuthProviderCredential(options);
|
|
275
|
+
if (oauthCredential) return oauthCredential;
|
|
276
|
+
|
|
223
277
|
const workspaceCredential =
|
|
224
278
|
await resolveWorkspaceConnectionProviderCredential({ ...options, keys });
|
|
225
279
|
if (workspaceCredential) return workspaceCredential;
|