@agent-native/core 0.129.2 → 0.130.1
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 +78 -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/a2a-continuation-processor.ts +481 -122
- package/corpus/core/src/integrations/a2a-continuations-store.ts +345 -14
- package/corpus/core/src/integrations/adapters/slack.ts +243 -53
- package/corpus/core/src/integrations/google-docs-poller.ts +3 -0
- package/corpus/core/src/integrations/integration-campaign-recovery.ts +4 -1
- package/corpus/core/src/integrations/plugin.ts +39 -21
- package/corpus/core/src/integrations/task-queue-stats.ts +146 -0
- package/corpus/core/src/integrations/types.ts +25 -4
- package/corpus/core/src/integrations/webhook-handler.ts +46 -16
- 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-26-slack-replies-recover-after-connected-app-updates.md +6 -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/.agents/skills/design-systems/SKILL.md +15 -0
- package/corpus/templates/slides/actions/delete-design-system.ts +145 -0
- package/corpus/templates/slides/actions/list-design-systems.ts +94 -2
- package/corpus/templates/slides/actions/patch-deck.ts +29 -17
- package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +43 -1
- package/corpus/templates/slides/app/hooks/use-design-systems.ts +2 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +7 -0
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +56 -1
- package/corpus/templates/slides/changelog/2026-07-28-delete-a-design-system-you-own-from-the-design-systems-page-.md +6 -0
- 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/collab/struct-routes.d.ts +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/a2a-continuation-processor.d.ts +5 -0
- package/dist/integrations/a2a-continuation-processor.d.ts.map +1 -1
- package/dist/integrations/a2a-continuation-processor.js +293 -79
- package/dist/integrations/a2a-continuation-processor.js.map +1 -1
- package/dist/integrations/a2a-continuations-store.d.ts +23 -1
- package/dist/integrations/a2a-continuations-store.d.ts.map +1 -1
- package/dist/integrations/a2a-continuations-store.js +249 -15
- package/dist/integrations/a2a-continuations-store.js.map +1 -1
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +155 -31
- package/dist/integrations/adapters/slack.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/integration-campaign-recovery.d.ts.map +1 -1
- package/dist/integrations/integration-campaign-recovery.js +3 -1
- package/dist/integrations/integration-campaign-recovery.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +29 -12
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/task-queue-stats.d.ts +12 -0
- package/dist/integrations/task-queue-stats.d.ts.map +1 -1
- package/dist/integrations/task-queue-stats.js +106 -0
- package/dist/integrations/task-queue-stats.js.map +1 -1
- package/dist/integrations/types.d.ts +24 -6
- package/dist/integrations/types.d.ts.map +1 -1
- package/dist/integrations/types.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +35 -14
- 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/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/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 +3 -4
- 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/secrets/routes.d.ts +9 -9
- 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/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/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/a2a-continuation-processor.ts +481 -122
- package/src/integrations/a2a-continuations-store.ts +345 -14
- package/src/integrations/adapters/slack.ts +243 -53
- package/src/integrations/google-docs-poller.ts +3 -0
- package/src/integrations/integration-campaign-recovery.ts +4 -1
- package/src/integrations/plugin.ts +39 -21
- package/src/integrations/task-queue-stats.ts +146 -0
- package/src/integrations/types.ts +25 -4
- package/src/integrations/webhook-handler.ts +46 -16
- 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
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import {
|
|
3
|
+
assertAccess,
|
|
4
|
+
resolveAccess,
|
|
5
|
+
type ShareRole,
|
|
6
|
+
} from "@agent-native/core/sharing";
|
|
7
|
+
import { desc, eq } from "drizzle-orm";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
|
|
10
|
+
import { getDb, schema } from "../server/db/index.js";
|
|
11
|
+
import { withDeckLock } from "./patch-deck.js";
|
|
12
|
+
|
|
13
|
+
function canEditDeckRole(role: "owner" | ShareRole) {
|
|
14
|
+
return role === "owner" || role === "admin" || role === "editor";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type UnlinkResult =
|
|
18
|
+
| { deckId: string; status: "unlinked" }
|
|
19
|
+
| { deckId: string; status: "skipped-no-access" };
|
|
20
|
+
|
|
21
|
+
// Runs under the same per-deck lock patch-deck/save-deck/update-slide use for
|
|
22
|
+
// all deck writes, re-reading the row inside the lock so a concurrent slide
|
|
23
|
+
// edit can't be clobbered by this read-modify-write. Decks the caller can't
|
|
24
|
+
// edit are left pointing at the deleted id rather than silently mutated —
|
|
25
|
+
// admin access on a shared design system does not imply edit access on every
|
|
26
|
+
// deck that happens to reference it.
|
|
27
|
+
function unlinkDeck(
|
|
28
|
+
deckId: string,
|
|
29
|
+
designSystemId: string,
|
|
30
|
+
): Promise<UnlinkResult> {
|
|
31
|
+
return withDeckLock(deckId, async () => {
|
|
32
|
+
const access = await resolveAccess("deck", deckId);
|
|
33
|
+
if (!access || !canEditDeckRole(access.role)) {
|
|
34
|
+
return { deckId, status: "skipped-no-access" };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const db = getDb();
|
|
38
|
+
const [deck] = await db
|
|
39
|
+
.select({
|
|
40
|
+
designSystemId: schema.decks.designSystemId,
|
|
41
|
+
data: schema.decks.data,
|
|
42
|
+
})
|
|
43
|
+
.from(schema.decks)
|
|
44
|
+
.where(eq(schema.decks.id, deckId));
|
|
45
|
+
if (!deck || deck.designSystemId !== designSystemId) {
|
|
46
|
+
return { deckId, status: "unlinked" };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const data = JSON.parse(deck.data);
|
|
50
|
+
if ("designSystemId" in data) delete data.designSystemId;
|
|
51
|
+
await db
|
|
52
|
+
.update(schema.decks)
|
|
53
|
+
.set({
|
|
54
|
+
designSystemId: null,
|
|
55
|
+
data: JSON.stringify(data),
|
|
56
|
+
updatedAt: new Date().toISOString(),
|
|
57
|
+
})
|
|
58
|
+
.where(eq(schema.decks.id, deckId));
|
|
59
|
+
return { deckId, status: "unlinked" };
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default defineAction({
|
|
64
|
+
description:
|
|
65
|
+
"Delete a design system. Requires admin access or higher. Decks linked to it that " +
|
|
66
|
+
"the caller can edit are unlinked; others keep a dangling reference (clear it with " +
|
|
67
|
+
"patch-deck's patch-deck-fields, designSystemId: null). If the deleted system was the " +
|
|
68
|
+
"caller's default, another of their design systems is promoted to default.",
|
|
69
|
+
schema: z.object({
|
|
70
|
+
id: z.string().min(1).describe("Design system ID to delete"),
|
|
71
|
+
}),
|
|
72
|
+
run: async ({ id }) => {
|
|
73
|
+
const access = await assertAccess("design-system", id, "admin");
|
|
74
|
+
|
|
75
|
+
const db = getDb();
|
|
76
|
+
|
|
77
|
+
const linkedDeckIds = (
|
|
78
|
+
await db
|
|
79
|
+
.select({ id: schema.decks.id })
|
|
80
|
+
.from(schema.decks)
|
|
81
|
+
.where(eq(schema.decks.designSystemId, id))
|
|
82
|
+
).map((row) => row.id);
|
|
83
|
+
|
|
84
|
+
// Delete the design system (and its shares) before touching linked decks.
|
|
85
|
+
// Once the row is gone, apply-design-system/create-deck's
|
|
86
|
+
// assertAccess("design-system", ...) check fails for anyone trying to
|
|
87
|
+
// attach a fresh link, shrinking the window for a deck to end up pointing
|
|
88
|
+
// at a design system we're about to remove. If this was the owner's
|
|
89
|
+
// default, promote another of their design systems in the same
|
|
90
|
+
// transaction so deck creation never silently drops to "no design
|
|
91
|
+
// system" just because the default happened to be deleted.
|
|
92
|
+
await db.transaction(async (tx) => {
|
|
93
|
+
await tx
|
|
94
|
+
.delete(schema.designSystemShares)
|
|
95
|
+
.where(eq(schema.designSystemShares.resourceId, id));
|
|
96
|
+
|
|
97
|
+
await tx
|
|
98
|
+
.delete(schema.designSystems)
|
|
99
|
+
.where(eq(schema.designSystems.id, id));
|
|
100
|
+
|
|
101
|
+
if (access.resource.isDefault) {
|
|
102
|
+
const [next] = await tx
|
|
103
|
+
.select({ id: schema.designSystems.id })
|
|
104
|
+
.from(schema.designSystems)
|
|
105
|
+
.where(
|
|
106
|
+
eq(schema.designSystems.ownerEmail, access.resource.ownerEmail),
|
|
107
|
+
)
|
|
108
|
+
.orderBy(desc(schema.designSystems.updatedAt))
|
|
109
|
+
.limit(1);
|
|
110
|
+
if (next) {
|
|
111
|
+
await tx
|
|
112
|
+
.update(schema.designSystems)
|
|
113
|
+
.set({ isDefault: true, updatedAt: new Date().toISOString() })
|
|
114
|
+
.where(eq(schema.designSystems.id, next.id));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Best-effort cleanup: the design system is already gone, so a deck we
|
|
120
|
+
// can't touch (missing access) or fail to update (write error) is left
|
|
121
|
+
// dangling rather than retried here. Both cases are reported back instead
|
|
122
|
+
// of swallowed, so the caller can decide whether to intervene.
|
|
123
|
+
const settled = await Promise.allSettled(
|
|
124
|
+
linkedDeckIds.map((deckId) => unlinkDeck(deckId, id)),
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const decksSkippedForAccess: string[] = [];
|
|
128
|
+
const decksFailedToUnlink: string[] = [];
|
|
129
|
+
settled.forEach((result, index) => {
|
|
130
|
+
const deckId = linkedDeckIds[index];
|
|
131
|
+
if (result.status === "rejected") {
|
|
132
|
+
decksFailedToUnlink.push(deckId);
|
|
133
|
+
} else if (result.value.status === "skipped-no-access") {
|
|
134
|
+
decksSkippedForAccess.push(deckId);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
return {
|
|
139
|
+
id,
|
|
140
|
+
deleted: true,
|
|
141
|
+
...(decksSkippedForAccess.length > 0 ? { decksSkippedForAccess } : {}),
|
|
142
|
+
...(decksFailedToUnlink.length > 0 ? { decksFailedToUnlink } : {}),
|
|
143
|
+
};
|
|
144
|
+
},
|
|
145
|
+
});
|
|
@@ -1,10 +1,38 @@
|
|
|
1
1
|
import { defineAction } from "@agent-native/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
getRequestOrgId,
|
|
4
|
+
getRequestUserEmail,
|
|
5
|
+
} from "@agent-native/core/server/request-context";
|
|
6
|
+
import {
|
|
7
|
+
accessFilter,
|
|
8
|
+
ROLE_RANK,
|
|
9
|
+
type ShareRole,
|
|
10
|
+
} from "@agent-native/core/sharing";
|
|
11
|
+
import { and, desc, eq, inArray, or, sql } from "drizzle-orm";
|
|
4
12
|
import { z } from "zod";
|
|
5
13
|
|
|
6
14
|
import { getDb, schema } from "../server/db/index.js";
|
|
7
15
|
|
|
16
|
+
type EffectiveRole = "owner" | ShareRole;
|
|
17
|
+
|
|
18
|
+
function canManageRole(role: EffectiveRole) {
|
|
19
|
+
return role === "owner" || role === "admin";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Mirrors the core access model (assertAccess/resolveAccess), which compares
|
|
23
|
+
// emails with `lower(column) = lowercased-input` so a share or ownership
|
|
24
|
+
// grant survives casing differences between the stored principal and the
|
|
25
|
+
// caller's session email.
|
|
26
|
+
function normalizeEmail(email: string | undefined): string | null {
|
|
27
|
+
const normalized = email?.trim().toLowerCase();
|
|
28
|
+
return normalized || null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function strongerRole(current: ShareRole | null, next: ShareRole): ShareRole {
|
|
32
|
+
if (!current || ROLE_RANK[next] > ROLE_RANK[current]) return next;
|
|
33
|
+
return current;
|
|
34
|
+
}
|
|
35
|
+
|
|
8
36
|
export default defineAction({
|
|
9
37
|
description:
|
|
10
38
|
"List all design systems accessible to the current user. " +
|
|
@@ -19,6 +47,8 @@ export default defineAction({
|
|
|
19
47
|
http: { method: "GET" },
|
|
20
48
|
run: async (args) => {
|
|
21
49
|
const db = getDb();
|
|
50
|
+
const userEmail = normalizeEmail(getRequestUserEmail());
|
|
51
|
+
const orgId = getRequestOrgId();
|
|
22
52
|
// Project only the columns this list returns. The default path returns
|
|
23
53
|
// `data`, but neither path returns the heavy `assets` blob — a bare
|
|
24
54
|
// `.select()` would load it off every row for nothing.
|
|
@@ -30,6 +60,8 @@ export default defineAction({
|
|
|
30
60
|
data: schema.designSystems.data,
|
|
31
61
|
isDefault: schema.designSystems.isDefault,
|
|
32
62
|
visibility: schema.designSystems.visibility,
|
|
63
|
+
ownerEmail: schema.designSystems.ownerEmail,
|
|
64
|
+
orgId: schema.designSystems.orgId,
|
|
33
65
|
createdAt: schema.designSystems.createdAt,
|
|
34
66
|
updatedAt: schema.designSystems.updatedAt,
|
|
35
67
|
})
|
|
@@ -41,12 +73,70 @@ export default defineAction({
|
|
|
41
73
|
return { count: 0, designSystems: [] };
|
|
42
74
|
}
|
|
43
75
|
|
|
76
|
+
// Resolve every row's role from a single batched shares query instead of
|
|
77
|
+
// calling resolveAccess() per row, which would re-load each resource and
|
|
78
|
+
// its shares (N+1) and fan out an unbounded Promise.all as the list grows.
|
|
79
|
+
const principalClauses: NonNullable<ReturnType<typeof and>>[] = [];
|
|
80
|
+
if (userEmail) {
|
|
81
|
+
principalClauses.push(
|
|
82
|
+
and(
|
|
83
|
+
eq(schema.designSystemShares.principalType, "user"),
|
|
84
|
+
sql`lower(${schema.designSystemShares.principalId}) = ${userEmail}`,
|
|
85
|
+
)!,
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
if (orgId) {
|
|
89
|
+
principalClauses.push(
|
|
90
|
+
and(
|
|
91
|
+
eq(schema.designSystemShares.principalType, "org"),
|
|
92
|
+
eq(schema.designSystemShares.principalId, orgId),
|
|
93
|
+
)!,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const shareRoleById = new Map<string, ShareRole>();
|
|
98
|
+
if (principalClauses.length > 0) {
|
|
99
|
+
const shareRows = await db
|
|
100
|
+
.select({
|
|
101
|
+
resourceId: schema.designSystemShares.resourceId,
|
|
102
|
+
role: schema.designSystemShares.role,
|
|
103
|
+
})
|
|
104
|
+
.from(schema.designSystemShares)
|
|
105
|
+
.where(
|
|
106
|
+
and(
|
|
107
|
+
inArray(
|
|
108
|
+
schema.designSystemShares.resourceId,
|
|
109
|
+
rows.map((row) => row.id),
|
|
110
|
+
),
|
|
111
|
+
or(...principalClauses),
|
|
112
|
+
),
|
|
113
|
+
);
|
|
114
|
+
for (const share of shareRows) {
|
|
115
|
+
shareRoleById.set(
|
|
116
|
+
share.resourceId,
|
|
117
|
+
strongerRole(shareRoleById.get(share.resourceId) ?? null, share.role),
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
44
122
|
const items = rows.map((row) => {
|
|
123
|
+
let role: EffectiveRole = shareRoleById.get(row.id) ?? "viewer";
|
|
124
|
+
if (
|
|
125
|
+
userEmail &&
|
|
126
|
+
normalizeEmail(row.ownerEmail) === userEmail &&
|
|
127
|
+
(!row.orgId || row.orgId === orgId)
|
|
128
|
+
) {
|
|
129
|
+
role = "owner";
|
|
130
|
+
}
|
|
131
|
+
const canManage = canManageRole(role);
|
|
132
|
+
|
|
45
133
|
if (args.compact === "true") {
|
|
46
134
|
return {
|
|
47
135
|
id: row.id,
|
|
48
136
|
title: row.title,
|
|
49
137
|
isDefault: row.isDefault,
|
|
138
|
+
accessRole: role,
|
|
139
|
+
canManage,
|
|
50
140
|
};
|
|
51
141
|
}
|
|
52
142
|
return {
|
|
@@ -56,6 +146,8 @@ export default defineAction({
|
|
|
56
146
|
data: row.data,
|
|
57
147
|
isDefault: row.isDefault,
|
|
58
148
|
visibility: row.visibility,
|
|
149
|
+
accessRole: role,
|
|
150
|
+
canManage,
|
|
59
151
|
createdAt: row.createdAt,
|
|
60
152
|
updatedAt: row.updatedAt,
|
|
61
153
|
};
|
|
@@ -289,6 +289,30 @@ export function applyOperation(deck: any, op: Operation): void {
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
+
/**
|
|
293
|
+
* Resolve the last operation in a sequence. For example, when typing a new name
|
|
294
|
+
* this will be the latest name of the deck in a sequence of keystrokes.
|
|
295
|
+
*/
|
|
296
|
+
export function resolveDeckColumnUpdates(
|
|
297
|
+
current: { title: string; designSystemId: string | null },
|
|
298
|
+
operations: Operation[],
|
|
299
|
+
): { title: string; designSystemId: string | null } {
|
|
300
|
+
const fieldOps = operations
|
|
301
|
+
.filter(
|
|
302
|
+
(op): op is z.infer<typeof PatchDeckFieldsOp> =>
|
|
303
|
+
op.op === "patch-deck-fields",
|
|
304
|
+
)
|
|
305
|
+
.reverse();
|
|
306
|
+
const titleOp = fieldOps.find((op) => typeof op.fields.title === "string");
|
|
307
|
+
const dsOp = fieldOps.find((op) => "designSystemId" in op.fields);
|
|
308
|
+
return {
|
|
309
|
+
title: titleOp?.fields.title ?? current.title,
|
|
310
|
+
designSystemId: dsOp
|
|
311
|
+
? (dsOp.fields.designSystemId ?? null)
|
|
312
|
+
: current.designSystemId,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
|
|
292
316
|
// ---------------------------------------------------------------------------
|
|
293
317
|
// Action definition
|
|
294
318
|
// ---------------------------------------------------------------------------
|
|
@@ -342,23 +366,11 @@ export default defineAction({
|
|
|
342
366
|
const now = new Date().toISOString();
|
|
343
367
|
deck.updatedAt = now;
|
|
344
368
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
);
|
|
351
|
-
const sqlTitle = titleOp?.fields.title ?? row.title;
|
|
352
|
-
|
|
353
|
-
// For patch-deck-fields ops that include designSystemId, update the
|
|
354
|
-
// SQL designSystemId column (used by list queries and sharing checks).
|
|
355
|
-
const dsOp = operations.find(
|
|
356
|
-
(op): op is z.infer<typeof PatchDeckFieldsOp> =>
|
|
357
|
-
op.op === "patch-deck-fields" && "designSystemId" in op.fields,
|
|
358
|
-
);
|
|
359
|
-
const sqlDesignSystemId = dsOp
|
|
360
|
-
? (dsOp.fields.designSystemId ?? null)
|
|
361
|
-
: row.designSystemId;
|
|
369
|
+
const { title: sqlTitle, designSystemId: sqlDesignSystemId } =
|
|
370
|
+
resolveDeckColumnUpdates(
|
|
371
|
+
{ title: row.title, designSystemId: row.designSystemId },
|
|
372
|
+
operations,
|
|
373
|
+
);
|
|
362
374
|
|
|
363
375
|
let generationRecord:
|
|
364
376
|
| {
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
+
import { useT } from "@agent-native/core/client/i18n";
|
|
1
2
|
import { ShareButton } from "@agent-native/core/client/sharing";
|
|
2
3
|
import { VisibilityBadge } from "@agent-native/toolkit/sharing";
|
|
3
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
IconDots,
|
|
6
|
+
IconPalette,
|
|
7
|
+
IconStar,
|
|
8
|
+
IconStarFilled,
|
|
9
|
+
IconTrash,
|
|
10
|
+
} from "@tabler/icons-react";
|
|
4
11
|
|
|
12
|
+
import { Button } from "@/components/ui/button";
|
|
13
|
+
import {
|
|
14
|
+
DropdownMenu,
|
|
15
|
+
DropdownMenuContent,
|
|
16
|
+
DropdownMenuItem,
|
|
17
|
+
DropdownMenuTrigger,
|
|
18
|
+
} from "@/components/ui/dropdown-menu";
|
|
5
19
|
import {
|
|
6
20
|
Tooltip,
|
|
7
21
|
TooltipContent,
|
|
@@ -16,8 +30,10 @@ interface DesignSystemCardProps {
|
|
|
16
30
|
data: DesignSystemData;
|
|
17
31
|
isDefault: boolean;
|
|
18
32
|
visibility?: "private" | "org" | "public" | null;
|
|
33
|
+
canManage?: boolean;
|
|
19
34
|
onClick: () => void;
|
|
20
35
|
onSetDefault: () => void;
|
|
36
|
+
onDelete: () => void;
|
|
21
37
|
}
|
|
22
38
|
|
|
23
39
|
function firstFontName(stack: string): string {
|
|
@@ -30,9 +46,12 @@ export function DesignSystemCard({
|
|
|
30
46
|
data,
|
|
31
47
|
isDefault,
|
|
32
48
|
visibility,
|
|
49
|
+
canManage,
|
|
33
50
|
onClick,
|
|
34
51
|
onSetDefault,
|
|
52
|
+
onDelete,
|
|
35
53
|
}: DesignSystemCardProps) {
|
|
54
|
+
const t = useT();
|
|
36
55
|
const swatchColors = [
|
|
37
56
|
{ label: "Primary", color: data.colors.primary },
|
|
38
57
|
{ label: "Secondary", color: data.colors.secondary },
|
|
@@ -93,6 +112,29 @@ export function DesignSystemCard({
|
|
|
93
112
|
resourceId={id}
|
|
94
113
|
resourceTitle={title}
|
|
95
114
|
/>
|
|
115
|
+
{canManage && (
|
|
116
|
+
<DropdownMenu modal={false}>
|
|
117
|
+
<DropdownMenuTrigger asChild>
|
|
118
|
+
<Button
|
|
119
|
+
variant="ghost"
|
|
120
|
+
size="icon"
|
|
121
|
+
aria-label={t("designSystems.moreActions")}
|
|
122
|
+
className="h-9 w-9 rounded-md bg-background/80 backdrop-blur-sm border border-border/40 hover:bg-background cursor-pointer"
|
|
123
|
+
>
|
|
124
|
+
<IconDots className="w-4 h-4 text-muted-foreground" />
|
|
125
|
+
</Button>
|
|
126
|
+
</DropdownMenuTrigger>
|
|
127
|
+
<DropdownMenuContent align="end">
|
|
128
|
+
<DropdownMenuItem
|
|
129
|
+
onClick={onDelete}
|
|
130
|
+
className="text-red-400 focus:text-red-400"
|
|
131
|
+
>
|
|
132
|
+
<IconTrash className="w-3.5 h-3.5 me-2" />
|
|
133
|
+
{t("designSystems.delete")}
|
|
134
|
+
</DropdownMenuItem>
|
|
135
|
+
</DropdownMenuContent>
|
|
136
|
+
</DropdownMenu>
|
|
137
|
+
)}
|
|
96
138
|
</div>
|
|
97
139
|
|
|
98
140
|
{/* Typography preview */}
|
|
@@ -162,6 +162,13 @@ const messages = {
|
|
|
162
162
|
designSystems: {
|
|
163
163
|
new: "New Design System",
|
|
164
164
|
setupBrand: "Set up your brand",
|
|
165
|
+
delete: "Delete",
|
|
166
|
+
cancel: "Cancel",
|
|
167
|
+
moreActions: "More actions",
|
|
168
|
+
deleteDialogTitle: "Delete design system?",
|
|
169
|
+
deleteDialogDescription:
|
|
170
|
+
"This permanently deletes the design system. Decks using it keep their current look but are no longer linked to it.",
|
|
171
|
+
deleteError: "Failed to delete design system",
|
|
165
172
|
emptyTitle: "Set up your brand identity",
|
|
166
173
|
emptyDescription:
|
|
167
174
|
"Create a design system with your brand colors, typography, and logos. Every new deck will follow your visual identity.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { callAction } from "@agent-native/core/client/hooks";
|
|
1
|
+
import { callAction, useActionMutation } from "@agent-native/core/client/hooks";
|
|
2
2
|
import { useT } from "@agent-native/core/client/i18n";
|
|
3
3
|
import {
|
|
4
4
|
useSetHeaderActions,
|
|
@@ -11,9 +11,20 @@ import {
|
|
|
11
11
|
IconRefresh,
|
|
12
12
|
} from "@tabler/icons-react";
|
|
13
13
|
import { useMemo, useState } from "react";
|
|
14
|
+
import { toast } from "sonner";
|
|
14
15
|
|
|
15
16
|
import { DesignSystemCard } from "@/components/design-system/DesignSystemCard";
|
|
16
17
|
import { DesignSystemSetup } from "@/components/design-system/DesignSystemSetup";
|
|
18
|
+
import {
|
|
19
|
+
AlertDialog,
|
|
20
|
+
AlertDialogAction,
|
|
21
|
+
AlertDialogCancel,
|
|
22
|
+
AlertDialogContent,
|
|
23
|
+
AlertDialogDescription,
|
|
24
|
+
AlertDialogFooter,
|
|
25
|
+
AlertDialogHeader,
|
|
26
|
+
AlertDialogTitle,
|
|
27
|
+
} from "@/components/ui/alert-dialog";
|
|
17
28
|
import { Button } from "@/components/ui/button";
|
|
18
29
|
import { useDesignSystems } from "@/hooks/use-design-systems";
|
|
19
30
|
|
|
@@ -25,6 +36,8 @@ export default function DesignSystems() {
|
|
|
25
36
|
const { designSystems, isLoading, error, refetch } = useDesignSystems();
|
|
26
37
|
const [showSetup, setShowSetup] = useState(false);
|
|
27
38
|
const [editingId, setEditingId] = useState<string | null>(null);
|
|
39
|
+
const [deleteId, setDeleteId] = useState<string | null>(null);
|
|
40
|
+
const deleteMutation = useActionMutation("delete-design-system");
|
|
28
41
|
|
|
29
42
|
const handleCardClick = (id: string) => {
|
|
30
43
|
setEditingId(id);
|
|
@@ -51,6 +64,21 @@ export default function DesignSystems() {
|
|
|
51
64
|
setEditingId(null);
|
|
52
65
|
};
|
|
53
66
|
|
|
67
|
+
const handleConfirmDelete = () => {
|
|
68
|
+
if (deleteId === null) return;
|
|
69
|
+
const id = deleteId;
|
|
70
|
+
setDeleteId(null);
|
|
71
|
+
deleteMutation.mutate({ id } as never, {
|
|
72
|
+
onSuccess: () => refetch(),
|
|
73
|
+
onError: (err: unknown) => {
|
|
74
|
+
void refetch();
|
|
75
|
+
toast.error(t("designSystems.deleteError"), {
|
|
76
|
+
description: err instanceof Error ? err.message : undefined,
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
54
82
|
const parseDesignData = (dataStr: string): DesignSystemData | null => {
|
|
55
83
|
try {
|
|
56
84
|
const parsed = JSON.parse(dataStr) as DesignSystemData;
|
|
@@ -172,8 +200,10 @@ export default function DesignSystems() {
|
|
|
172
200
|
data={parsed}
|
|
173
201
|
isDefault={ds.isDefault}
|
|
174
202
|
visibility={ds.visibility}
|
|
203
|
+
canManage={ds.canManage}
|
|
175
204
|
onClick={() => handleCardClick(ds.id)}
|
|
176
205
|
onSetDefault={() => handleSetDefault(ds.id)}
|
|
206
|
+
onDelete={() => setDeleteId(ds.id)}
|
|
177
207
|
/>
|
|
178
208
|
);
|
|
179
209
|
})}
|
|
@@ -182,6 +212,31 @@ export default function DesignSystems() {
|
|
|
182
212
|
)}
|
|
183
213
|
</main>
|
|
184
214
|
|
|
215
|
+
<AlertDialog
|
|
216
|
+
open={deleteId !== null}
|
|
217
|
+
onOpenChange={(open) => !open && setDeleteId(null)}
|
|
218
|
+
>
|
|
219
|
+
<AlertDialogContent>
|
|
220
|
+
<AlertDialogHeader>
|
|
221
|
+
<AlertDialogTitle>
|
|
222
|
+
{t("designSystems.deleteDialogTitle")}
|
|
223
|
+
</AlertDialogTitle>
|
|
224
|
+
<AlertDialogDescription>
|
|
225
|
+
{t("designSystems.deleteDialogDescription")}
|
|
226
|
+
</AlertDialogDescription>
|
|
227
|
+
</AlertDialogHeader>
|
|
228
|
+
<AlertDialogFooter>
|
|
229
|
+
<AlertDialogCancel>{t("designSystems.cancel")}</AlertDialogCancel>
|
|
230
|
+
<AlertDialogAction
|
|
231
|
+
onClick={handleConfirmDelete}
|
|
232
|
+
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
|
|
233
|
+
>
|
|
234
|
+
{t("designSystems.delete")}
|
|
235
|
+
</AlertDialogAction>
|
|
236
|
+
</AlertDialogFooter>
|
|
237
|
+
</AlertDialogContent>
|
|
238
|
+
</AlertDialog>
|
|
239
|
+
|
|
185
240
|
{/* Setup/Edit Dialog */}
|
|
186
241
|
<DesignSystemSetup
|
|
187
242
|
open={showSetup}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @agent-native/toolkit
|
|
2
2
|
|
|
3
|
+
## 0.10.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 279e855: Default MCP connections to personal OAuth, keep personal MCP setup available to organization members, hide unusable organization controls, and honor app preset filters in ejected UIs.
|
|
8
|
+
|
|
3
9
|
## 0.10.11
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -267,8 +267,9 @@ function ComposerPlusMenuFull({
|
|
|
267
267
|
const canCreateOrgMcp =
|
|
268
268
|
!org?.orgId || org.role === "owner" || org.role === "admin";
|
|
269
269
|
const hasOrg = !!org?.orgId;
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
// Composer connections belong to the person asking for them. Organization
|
|
271
|
+
// sharing remains an explicit choice for owners and admins in the dialog.
|
|
272
|
+
const defaultMcpScope: "user" = "user";
|
|
272
273
|
const createMcp = resources.useCreateMcpServer!();
|
|
273
274
|
const McpIntegrationDialog = resources.McpIntegrationDialog;
|
|
274
275
|
|
package/dist/action-ui.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const ACTION_CHAT_UI_DATA_CHART_RENDERER = "core.data-chart";
|
|
|
3
3
|
export declare const ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER = "core.data-insights";
|
|
4
4
|
export declare const ACTION_CHAT_UI_DATA_WIDGET_RENDERER = "core.data-widget";
|
|
5
5
|
export declare const ACTION_CHAT_UI_INLINE_EXTENSION_RENDERER = "core.inline-extension";
|
|
6
|
+
export declare const ACTION_CHAT_UI_WORKSPACE_FILE_RENDERER = "core.workspace-file";
|
|
6
7
|
export interface ActionChatUIConfig {
|
|
7
8
|
/**
|
|
8
9
|
* Exact renderer id to use in Agent-Native chat. This is native first-party
|
package/dist/action-ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-ui.d.ts","sourceRoot":"","sources":["../src/action-ui.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kCAAkC,oBAAoB,CAAC;AACpE,eAAO,MAAM,kCAAkC,oBAAoB,CAAC;AACpE,eAAO,MAAM,qCAAqC,uBAAuB,CAAC;AAC1E,eAAO,MAAM,mCAAmC,qBAAqB,CAAC;AACtE,eAAO,MAAM,wCAAwC,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"action-ui.d.ts","sourceRoot":"","sources":["../src/action-ui.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kCAAkC,oBAAoB,CAAC;AACpE,eAAO,MAAM,kCAAkC,oBAAoB,CAAC;AACpE,eAAO,MAAM,qCAAqC,uBAAuB,CAAC;AAC1E,eAAO,MAAM,mCAAmC,qBAAqB,CAAC;AACtE,eAAO,MAAM,wCAAwC,0BAA0B,CAAC;AAChF,eAAO,MAAM,sCAAsC,wBAAwB,CAAC;AAE5E,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,GACb,kBAAkB,GAAG,SAAS,CAiBhC"}
|
package/dist/action-ui.js
CHANGED
|
@@ -3,6 +3,7 @@ export const ACTION_CHAT_UI_DATA_CHART_RENDERER = "core.data-chart";
|
|
|
3
3
|
export const ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER = "core.data-insights";
|
|
4
4
|
export const ACTION_CHAT_UI_DATA_WIDGET_RENDERER = "core.data-widget";
|
|
5
5
|
export const ACTION_CHAT_UI_INLINE_EXTENSION_RENDERER = "core.inline-extension";
|
|
6
|
+
export const ACTION_CHAT_UI_WORKSPACE_FILE_RENDERER = "core.workspace-file";
|
|
6
7
|
export function normalizeActionChatUIConfig(value) {
|
|
7
8
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
8
9
|
return undefined;
|
package/dist/action-ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-ui.js","sourceRoot":"","sources":["../src/action-ui.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kCAAkC,GAAG,iBAAiB,CAAC;AACpE,MAAM,CAAC,MAAM,kCAAkC,GAAG,iBAAiB,CAAC;AACpE,MAAM,CAAC,MAAM,qCAAqC,GAAG,oBAAoB,CAAC;AAC1E,MAAM,CAAC,MAAM,mCAAmC,GAAG,kBAAkB,CAAC;AACtE,MAAM,CAAC,MAAM,wCAAwC,GAAG,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"action-ui.js","sourceRoot":"","sources":["../src/action-ui.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kCAAkC,GAAG,iBAAiB,CAAC;AACpE,MAAM,CAAC,MAAM,kCAAkC,GAAG,iBAAiB,CAAC;AACpE,MAAM,CAAC,MAAM,qCAAqC,GAAG,oBAAoB,CAAC;AAC1E,MAAM,CAAC,MAAM,mCAAmC,GAAG,kBAAkB,CAAC;AACtE,MAAM,CAAC,MAAM,wCAAwC,GAAG,uBAAuB,CAAC;AAChF,MAAM,CAAC,MAAM,sCAAsC,GAAG,qBAAqB,CAAC;AAc5E,MAAM,UAAU,2BAA2B,CACzC,KAAc;IAEd,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG,KAAgC,CAAC;IAChD,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACnE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;QAChC,GAAG,CAAC,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;YACzD,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;YACzB,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE;YACrE,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE;YACrC,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC","sourcesContent":["export const ACTION_CHAT_UI_DATA_TABLE_RENDERER = \"core.data-table\";\nexport const ACTION_CHAT_UI_DATA_CHART_RENDERER = \"core.data-chart\";\nexport const ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER = \"core.data-insights\";\nexport const ACTION_CHAT_UI_DATA_WIDGET_RENDERER = \"core.data-widget\";\nexport const ACTION_CHAT_UI_INLINE_EXTENSION_RENDERER = \"core.inline-extension\";\nexport const ACTION_CHAT_UI_WORKSPACE_FILE_RENDERER = \"core.workspace-file\";\n\nexport interface ActionChatUIConfig {\n /**\n * Exact renderer id to use in Agent-Native chat. This is native first-party\n * React UI, distinct from MCP Apps resources for external hosts.\n */\n renderer: string;\n /** Optional label for catalogs, docs, or custom renderer chrome. */\n title?: string;\n /** Optional developer-facing description for catalogs/docs. */\n description?: string;\n}\n\nexport function normalizeActionChatUIConfig(\n value: unknown,\n): ActionChatUIConfig | undefined {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return undefined;\n }\n const record = value as Record<string, unknown>;\n if (typeof record.renderer !== \"string\" || !record.renderer.trim()) {\n return undefined;\n }\n return {\n renderer: record.renderer.trim(),\n ...(typeof record.title === \"string\" && record.title.trim()\n ? { title: record.title }\n : {}),\n ...(typeof record.description === \"string\" && record.description.trim()\n ? { description: record.description }\n : {}),\n };\n}\n"]}
|
package/dist/action.d.ts
CHANGED
|
@@ -131,7 +131,11 @@ export declare class AgentActionStopError extends Error {
|
|
|
131
131
|
export declare function isAgentActionStopError(err: unknown): err is AgentActionStopError;
|
|
132
132
|
/** HTTP exposure config for an action. */
|
|
133
133
|
export interface ActionHttpConfig {
|
|
134
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Method required from direct HTTP callers. Default: "POST". Use "GET" for
|
|
136
|
+
* read-only actions. Browser action clients use the framework's frontend
|
|
137
|
+
* mutation transport and do not need to repeat this method.
|
|
138
|
+
*/
|
|
135
139
|
method?: "GET" | "POST" | "PUT" | "DELETE";
|
|
136
140
|
/** Override route path under /_agent-native/actions/. Default: action filename. */
|
|
137
141
|
path?: string;
|