@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
|
@@ -206,6 +206,9 @@ export const embeddedWheelBridgeScript: string = `"use strict";
|
|
|
206
206
|
if (e.data.type === "embedded-canvas-gesture-mode") {
|
|
207
207
|
wheelEnabled = !!e.data.wheelEnabled;
|
|
208
208
|
spaceKeyForwardingEnabled = !!e.data.spaceKeyForwardingEnabled;
|
|
209
|
+
if (typeof e.data.editingSafetyEnabled === "boolean") {
|
|
210
|
+
editingSafetyEnabled = e.data.editingSafetyEnabled;
|
|
211
|
+
}
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
214
|
function cancelActivePan() {
|
|
@@ -401,7 +401,24 @@ export const hitTestBridgeScript: string = `"use strict";
|
|
|
401
401
|
}
|
|
402
402
|
cursor = parent;
|
|
403
403
|
}
|
|
404
|
-
|
|
404
|
+
var absoluteTarget = absolutePrimitiveContainerTargetForPoint(
|
|
405
|
+
clientX,
|
|
406
|
+
clientY
|
|
407
|
+
);
|
|
408
|
+
if (absoluteTarget) return absoluteTarget;
|
|
409
|
+
var blockCursor = hit;
|
|
410
|
+
while (blockCursor) {
|
|
411
|
+
if (isContainerDropTarget(blockCursor)) {
|
|
412
|
+
return {
|
|
413
|
+
anchor: blockCursor,
|
|
414
|
+
placement: "inside",
|
|
415
|
+
axis: "y",
|
|
416
|
+
dropMode: "flow-insert"
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
blockCursor = blockCursor.parentElement;
|
|
420
|
+
}
|
|
421
|
+
return null;
|
|
405
422
|
}
|
|
406
423
|
function showInsertionGuideFor(target) {
|
|
407
424
|
if (!target || !target.anchor) {
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
// AUTO-GENERATED by bridge/codegen.ts — do not edit manually.
|
|
2
|
+
// Run: pnpm exec tsx app/components/design/bridge/codegen.ts
|
|
3
|
+
|
|
4
|
+
/** Compiled IIFE string for source-location.bridge.ts — inject into an iframe via srcdoc or a <script> tag. */
|
|
5
|
+
export const sourceLocationBridgeScript: string = `"use strict";
|
|
6
|
+
(() => {
|
|
7
|
+
// app/components/design/bridge/source-location.bridge.ts
|
|
8
|
+
(function() {
|
|
9
|
+
var FIBER_KEY_PREFIXES = [
|
|
10
|
+
"__reactFiber$",
|
|
11
|
+
"__reactInternalInstance$",
|
|
12
|
+
"__reactInternalFiberCurrent$",
|
|
13
|
+
"__reactInternalFiber$"
|
|
14
|
+
];
|
|
15
|
+
var NOISE_SEGMENTS = {
|
|
16
|
+
node_modules: true,
|
|
17
|
+
dist: true,
|
|
18
|
+
build: true,
|
|
19
|
+
".next": true,
|
|
20
|
+
public: true
|
|
21
|
+
};
|
|
22
|
+
function isNoisePath(path) {
|
|
23
|
+
var segments = path.split("/");
|
|
24
|
+
for (var i = 0; i < segments.length; i += 1) {
|
|
25
|
+
if (NOISE_SEGMENTS[segments[i]]) return true;
|
|
26
|
+
if (segments[i] === "_next" && segments[i + 1] === "static") return true;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
function resolveFrameUrl(rawUrl) {
|
|
31
|
+
if (rawUrl.indexOf("webpack-internal:///") === 0) {
|
|
32
|
+
var wPath = rawUrl.slice("webpack-internal:///".length).replace(/^\\.\\//, "");
|
|
33
|
+
return wPath || null;
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
var url = new URL(rawUrl);
|
|
37
|
+
var path = decodeURIComponent(url.pathname);
|
|
38
|
+
if (path.indexOf("/@fs/") === 0) {
|
|
39
|
+
path = path.slice("/@fs".length);
|
|
40
|
+
} else if (url.protocol !== "file:") {
|
|
41
|
+
path = path.replace(/^\\/+/, "");
|
|
42
|
+
}
|
|
43
|
+
return path || null;
|
|
44
|
+
} catch (_err) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
var STACK_FRAME_RE = /^\\s*at\\s+(?:([^\\s(]+)\\s+\\()?([^()\\s][^()]*?):(\\d+):(\\d+)\\)?\\s*$/;
|
|
49
|
+
function parseStackFrame(line) {
|
|
50
|
+
var match = STACK_FRAME_RE.exec(line);
|
|
51
|
+
if (!match) return null;
|
|
52
|
+
var functionName = match[1];
|
|
53
|
+
var rawUrl = match[2];
|
|
54
|
+
var sourceFile = resolveFrameUrl(rawUrl);
|
|
55
|
+
if (!sourceFile || isNoisePath(sourceFile)) return null;
|
|
56
|
+
var lineNumber = Number(match[3]);
|
|
57
|
+
var column = Number(match[4]);
|
|
58
|
+
if (!isFinite(lineNumber) || !isFinite(column)) return null;
|
|
59
|
+
return {
|
|
60
|
+
sourceFile,
|
|
61
|
+
line: lineNumber,
|
|
62
|
+
column,
|
|
63
|
+
functionName: functionName || void 0
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function extractFromDebugStack(stack) {
|
|
67
|
+
var lines = stack.split("\\n");
|
|
68
|
+
for (var i = 0; i < lines.length; i += 1) {
|
|
69
|
+
var parsed = parseStackFrame(lines[i]);
|
|
70
|
+
if (parsed) return parsed;
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
function getFiberFromDom(node) {
|
|
75
|
+
var keys = Object.keys(node);
|
|
76
|
+
for (var i = 0; i < keys.length; i += 1) {
|
|
77
|
+
for (var j = 0; j < FIBER_KEY_PREFIXES.length; j += 1) {
|
|
78
|
+
if (keys[i].indexOf(FIBER_KEY_PREFIXES[j]) === 0) {
|
|
79
|
+
return node[keys[i]];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
function findNearestFiber(el) {
|
|
86
|
+
var node = el;
|
|
87
|
+
var attempts = 0;
|
|
88
|
+
while (node && attempts < 8) {
|
|
89
|
+
var fiber = getFiberFromDom(node);
|
|
90
|
+
if (fiber) return fiber;
|
|
91
|
+
node = node.parentElement;
|
|
92
|
+
attempts += 1;
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
function debugSourceOf(fiber) {
|
|
97
|
+
var source = fiber._debugSource || fiber._debugInfo && fiber._debugInfo.source || fiber.stateNode && fiber.stateNode._debugSource || fiber.elementType && fiber.elementType._debugSource;
|
|
98
|
+
if (source && source.fileName) {
|
|
99
|
+
return {
|
|
100
|
+
sourceFile: source.fileName,
|
|
101
|
+
line: source.lineNumber,
|
|
102
|
+
column: source.columnNumber
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
var stack = fiber._debugStack && fiber._debugStack.stack || fiber._debugInfo && fiber._debugInfo.stack || fiber.stateNode && fiber.stateNode._debugStack && fiber.stateNode._debugStack.stack;
|
|
106
|
+
if (stack) {
|
|
107
|
+
var parsed = extractFromDebugStack(String(stack));
|
|
108
|
+
if (parsed) {
|
|
109
|
+
return {
|
|
110
|
+
sourceFile: parsed.sourceFile,
|
|
111
|
+
line: parsed.line,
|
|
112
|
+
column: parsed.column
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
function hasStructuredDebugSource(fiber) {
|
|
119
|
+
return !!(fiber._debugSource || fiber._debugInfo && fiber._debugInfo.source || fiber.stateNode && fiber.stateNode._debugSource || fiber.elementType && fiber.elementType._debugSource);
|
|
120
|
+
}
|
|
121
|
+
function isComponentFiber(fiber) {
|
|
122
|
+
return typeof fiber.type === "function";
|
|
123
|
+
}
|
|
124
|
+
function componentNameOf(fiber) {
|
|
125
|
+
var type = fiber.type;
|
|
126
|
+
return type && (type.displayName || type.name) || void 0;
|
|
127
|
+
}
|
|
128
|
+
function resolveFromDataAttributes(el) {
|
|
129
|
+
var sourceFile = el.getAttribute("data-source-file");
|
|
130
|
+
var lineAttr = el.getAttribute("data-source-line");
|
|
131
|
+
var columnAttr = el.getAttribute("data-source-column");
|
|
132
|
+
var component = el.getAttribute("data-component-name");
|
|
133
|
+
var dataLoc = el.getAttribute("data-loc");
|
|
134
|
+
if (!sourceFile && dataLoc) {
|
|
135
|
+
var lastColon = dataLoc.lastIndexOf(":");
|
|
136
|
+
var lastPart = lastColon >= 0 ? dataLoc.slice(lastColon + 1) : "";
|
|
137
|
+
if (lastColon >= 0 && /^\\d+$/.test(lastPart)) {
|
|
138
|
+
var before = dataLoc.slice(0, lastColon);
|
|
139
|
+
var prevColon = before.lastIndexOf(":");
|
|
140
|
+
var prevPart = prevColon >= 0 ? before.slice(prevColon + 1) : "";
|
|
141
|
+
var hasColumn = /^\\d+$/.test(prevPart);
|
|
142
|
+
sourceFile = hasColumn ? before.slice(0, prevColon) : before;
|
|
143
|
+
lineAttr = hasColumn ? prevPart : lastPart;
|
|
144
|
+
columnAttr = hasColumn ? lastPart : columnAttr;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (!sourceFile || !lineAttr) return null;
|
|
148
|
+
var line = Number(lineAttr);
|
|
149
|
+
if (!isFinite(line)) return null;
|
|
150
|
+
var column = columnAttr ? Number(columnAttr) : void 0;
|
|
151
|
+
return {
|
|
152
|
+
status: "resolved",
|
|
153
|
+
framework: "html",
|
|
154
|
+
method: "data-attribute",
|
|
155
|
+
sourceFile,
|
|
156
|
+
line,
|
|
157
|
+
column: isFinite(column) ? column : void 0,
|
|
158
|
+
componentName: component || void 0
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function resolveFromFiber(el) {
|
|
162
|
+
var leafFiber = findNearestFiber(el);
|
|
163
|
+
if (!leafFiber) return { status: "unavailable", reason: "not-framework" };
|
|
164
|
+
var elementSource = null;
|
|
165
|
+
var elementMethod = null;
|
|
166
|
+
var componentFiber = null;
|
|
167
|
+
var current = leafFiber;
|
|
168
|
+
var depth = 0;
|
|
169
|
+
while (current && depth < 12) {
|
|
170
|
+
if (!elementSource) {
|
|
171
|
+
var hasStructured = hasStructuredDebugSource(current);
|
|
172
|
+
var found = debugSourceOf(current);
|
|
173
|
+
if (found) {
|
|
174
|
+
elementSource = found;
|
|
175
|
+
elementMethod = hasStructured ? "debug-source" : "debug-stack";
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (!componentFiber && current !== leafFiber && isComponentFiber(current)) {
|
|
179
|
+
componentFiber = current;
|
|
180
|
+
}
|
|
181
|
+
if (elementSource && componentFiber) break;
|
|
182
|
+
current = current.return || current.parent || current._debugOwner;
|
|
183
|
+
depth += 1;
|
|
184
|
+
}
|
|
185
|
+
if (!elementSource || !elementMethod) {
|
|
186
|
+
return { status: "unavailable", reason: "no-debug-info" };
|
|
187
|
+
}
|
|
188
|
+
var result = {
|
|
189
|
+
status: "resolved",
|
|
190
|
+
framework: "react",
|
|
191
|
+
method: elementMethod,
|
|
192
|
+
sourceFile: elementSource.sourceFile,
|
|
193
|
+
line: elementSource.line,
|
|
194
|
+
column: elementSource.column
|
|
195
|
+
};
|
|
196
|
+
if (componentFiber) {
|
|
197
|
+
result.componentName = componentNameOf(componentFiber);
|
|
198
|
+
var ownerSource = debugSourceOf(componentFiber);
|
|
199
|
+
if (ownerSource) {
|
|
200
|
+
result.ownerSourceFile = ownerSource.sourceFile;
|
|
201
|
+
result.ownerLine = ownerSource.line;
|
|
202
|
+
result.ownerColumn = ownerSource.column;
|
|
203
|
+
result.ownerComponentName = result.componentName;
|
|
204
|
+
result.ownerMethod = hasStructuredDebugSource(componentFiber) ? "debug-source" : "debug-stack";
|
|
205
|
+
}
|
|
206
|
+
if (typeof componentFiber.key === "string" && componentFiber.key) {
|
|
207
|
+
result.ownerKey = componentFiber.key;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return result;
|
|
211
|
+
}
|
|
212
|
+
function parseFrameworkDataLoc(value) {
|
|
213
|
+
var lastColon = value.lastIndexOf(":");
|
|
214
|
+
if (lastColon < 0) return null;
|
|
215
|
+
var lastPart = value.slice(lastColon + 1);
|
|
216
|
+
if (!/^\\d+$/.test(lastPart)) return null;
|
|
217
|
+
var beforeLast = value.slice(0, lastColon);
|
|
218
|
+
var previousColon = beforeLast.lastIndexOf(":");
|
|
219
|
+
var previousPart = previousColon >= 0 ? beforeLast.slice(previousColon + 1) : "";
|
|
220
|
+
var hasColumn = /^\\d+$/.test(previousPart);
|
|
221
|
+
var sourceFile = (hasColumn ? beforeLast.slice(0, previousColon) : beforeLast).trim();
|
|
222
|
+
var line = Number(hasColumn ? previousPart : lastPart);
|
|
223
|
+
var column = hasColumn ? Number(lastPart) : void 0;
|
|
224
|
+
if (!sourceFile || !isFinite(line)) return null;
|
|
225
|
+
if (column !== void 0 && !isFinite(column)) return null;
|
|
226
|
+
return { sourceFile, line, column };
|
|
227
|
+
}
|
|
228
|
+
function resolveFromVue(el) {
|
|
229
|
+
var node = el;
|
|
230
|
+
var sawVue = false;
|
|
231
|
+
for (var depth = 0; node && depth < 8; depth += 1) {
|
|
232
|
+
var vnode = node.__vnode;
|
|
233
|
+
var component = node.__vueParentComponent;
|
|
234
|
+
if (vnode || component) sawVue = true;
|
|
235
|
+
var inspector = vnode && vnode.props && typeof vnode.props.__v_inspector === "string" ? vnode.props.__v_inspector : null;
|
|
236
|
+
if (inspector) {
|
|
237
|
+
var parsed = parseFrameworkDataLoc(inspector);
|
|
238
|
+
if (parsed) {
|
|
239
|
+
var type = component && component.type || vnode && vnode.type;
|
|
240
|
+
return {
|
|
241
|
+
status: "resolved",
|
|
242
|
+
framework: "vue",
|
|
243
|
+
method: "vue-inspector",
|
|
244
|
+
sourceFile: parsed.sourceFile,
|
|
245
|
+
line: parsed.line,
|
|
246
|
+
column: parsed.column,
|
|
247
|
+
componentName: type && (type.name || type.__name || type.displayName)
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
node = node.parentElement;
|
|
252
|
+
}
|
|
253
|
+
return sawVue ? { status: "unavailable", reason: "no-debug-info" } : null;
|
|
254
|
+
}
|
|
255
|
+
function resolveFromSvelte(el) {
|
|
256
|
+
var node = el;
|
|
257
|
+
var sawSvelte = false;
|
|
258
|
+
for (var depth = 0; node && depth < 8; depth += 1) {
|
|
259
|
+
var meta = node.__svelte_meta;
|
|
260
|
+
if (meta) sawSvelte = true;
|
|
261
|
+
var loc = meta && meta.loc;
|
|
262
|
+
var sourceFile = loc && (loc.file || loc.filename);
|
|
263
|
+
var line = loc && Number(loc.line);
|
|
264
|
+
var column = loc && Number(loc.column);
|
|
265
|
+
if (sourceFile && isFinite(line)) {
|
|
266
|
+
return {
|
|
267
|
+
status: "resolved",
|
|
268
|
+
framework: "svelte",
|
|
269
|
+
method: "svelte-meta",
|
|
270
|
+
sourceFile: String(sourceFile),
|
|
271
|
+
line,
|
|
272
|
+
column: isFinite(column) ? column : void 0,
|
|
273
|
+
componentName: typeof meta.component === "string" ? meta.component : typeof meta.name === "string" ? meta.name : void 0
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
node = node.parentElement;
|
|
277
|
+
}
|
|
278
|
+
return sawSvelte ? { status: "unavailable", reason: "no-debug-info" } : null;
|
|
279
|
+
}
|
|
280
|
+
function resolveFromFramework(el) {
|
|
281
|
+
var react = resolveFromFiber(el);
|
|
282
|
+
if (react.status === "resolved" || react.reason === "no-debug-info") {
|
|
283
|
+
return react;
|
|
284
|
+
}
|
|
285
|
+
var vue = resolveFromVue(el);
|
|
286
|
+
if (vue) return vue;
|
|
287
|
+
var svelte = resolveFromSvelte(el);
|
|
288
|
+
if (svelte) return svelte;
|
|
289
|
+
return { status: "unavailable", reason: "not-framework" };
|
|
290
|
+
}
|
|
291
|
+
function resolveSourceLocation(el) {
|
|
292
|
+
var fromAttributes = resolveFromDataAttributes(el);
|
|
293
|
+
if (!fromAttributes) return resolveFromFramework(el);
|
|
294
|
+
var fromFiber = resolveFromFiber(el);
|
|
295
|
+
if (fromAttributes.status === "resolved" && fromFiber.status === "resolved") {
|
|
296
|
+
if (fromFiber.ownerSourceFile) {
|
|
297
|
+
fromAttributes.ownerSourceFile = fromFiber.ownerSourceFile;
|
|
298
|
+
fromAttributes.ownerLine = fromFiber.ownerLine;
|
|
299
|
+
fromAttributes.ownerColumn = fromFiber.ownerColumn;
|
|
300
|
+
fromAttributes.ownerComponentName = fromFiber.ownerComponentName;
|
|
301
|
+
fromAttributes.ownerMethod = fromFiber.ownerMethod;
|
|
302
|
+
}
|
|
303
|
+
if (fromFiber.ownerKey) fromAttributes.ownerKey = fromFiber.ownerKey;
|
|
304
|
+
if (!fromAttributes.componentName) {
|
|
305
|
+
fromAttributes.componentName = fromFiber.componentName;
|
|
306
|
+
}
|
|
307
|
+
fromAttributes.framework = fromFiber.framework;
|
|
308
|
+
}
|
|
309
|
+
return fromAttributes;
|
|
310
|
+
}
|
|
311
|
+
function findTarget(nodeId, selector) {
|
|
312
|
+
if (nodeId) {
|
|
313
|
+
var byId = document.querySelector(
|
|
314
|
+
'[data-agent-native-node-id="' + nodeId.replace(/"/g, '\\\\"') + '"]'
|
|
315
|
+
);
|
|
316
|
+
if (byId) return byId;
|
|
317
|
+
}
|
|
318
|
+
if (selector) {
|
|
319
|
+
try {
|
|
320
|
+
return document.querySelector(selector);
|
|
321
|
+
} catch (_err) {
|
|
322
|
+
return null;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
window.addEventListener("message", function(e) {
|
|
328
|
+
if (e.source !== window.parent) return;
|
|
329
|
+
if (!e.data || e.data.type !== "agent-native:source-location-request")
|
|
330
|
+
return;
|
|
331
|
+
var correlationId = e.data.correlationId || "";
|
|
332
|
+
var target = findTarget(e.data.nodeId, e.data.selector);
|
|
333
|
+
var result = target ? resolveSourceLocation(target) : { status: "unavailable", reason: "element-not-found" };
|
|
334
|
+
try {
|
|
335
|
+
window.parent.postMessage(
|
|
336
|
+
{
|
|
337
|
+
type: "agent-native:source-location-result",
|
|
338
|
+
correlationId,
|
|
339
|
+
result
|
|
340
|
+
},
|
|
341
|
+
"*"
|
|
342
|
+
);
|
|
343
|
+
} catch (_err) {
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
})();
|
|
347
|
+
})();
|
|
348
|
+
`;
|
|
@@ -5,10 +5,6 @@ import {
|
|
|
5
5
|
seedFromText,
|
|
6
6
|
} from "@agent-native/core/collab";
|
|
7
7
|
import { buildDeepLink } from "@agent-native/core/server";
|
|
8
|
-
import {
|
|
9
|
-
getRequestOrgId,
|
|
10
|
-
getRequestUserEmail,
|
|
11
|
-
} from "@agent-native/core/server/request-context";
|
|
12
8
|
import { assertAccess } from "@agent-native/core/sharing";
|
|
13
9
|
import { and, desc, eq, isNull } from "drizzle-orm";
|
|
14
10
|
import { nanoid } from "nanoid";
|
|
@@ -19,6 +15,7 @@ import {
|
|
|
19
15
|
mutateDesignData,
|
|
20
16
|
type DesignDataRecord,
|
|
21
17
|
} from "../server/lib/design-data-mutation.js";
|
|
18
|
+
import { resolveLocalhostConnectionScope } from "../server/lib/localhost-connection.js";
|
|
22
19
|
import {
|
|
23
20
|
mergeCanvasFramePlacements,
|
|
24
21
|
parseCanvasFrameGeometryById,
|
|
@@ -366,9 +363,7 @@ export default defineAction({
|
|
|
366
363
|
gap,
|
|
367
364
|
}) => {
|
|
368
365
|
await assertAccess("design", designId, "editor");
|
|
369
|
-
const ownerEmail =
|
|
370
|
-
if (!ownerEmail) throw new Error("no authenticated user");
|
|
371
|
-
const orgId = getRequestOrgId() ?? null;
|
|
366
|
+
const { ownerEmail, orgId } = await resolveLocalhostConnectionScope();
|
|
372
367
|
const db = getDb();
|
|
373
368
|
|
|
374
369
|
const connectionClauses = [
|
|
@@ -355,6 +355,11 @@ const targetSchema = z
|
|
|
355
355
|
.object({
|
|
356
356
|
line: z.number().int().positive(),
|
|
357
357
|
column: z.number().int().positive(),
|
|
358
|
+
// Without this the deterministic writer cannot tell a React 19
|
|
359
|
+
// owner-stack line from an authored one and would seek to it.
|
|
360
|
+
positionPrecision: z
|
|
361
|
+
.enum(["authored", "transformed", "unknown"])
|
|
362
|
+
.optional(),
|
|
358
363
|
runtimeMultiplicity: z.number().int().positive().optional(),
|
|
359
364
|
scope: z
|
|
360
365
|
.enum([
|
|
@@ -693,6 +698,7 @@ export default defineAction({
|
|
|
693
698
|
sourceAnchor?: {
|
|
694
699
|
line: number;
|
|
695
700
|
column: number;
|
|
701
|
+
positionPrecision?: "authored" | "transformed" | "unknown";
|
|
696
702
|
runtimeMultiplicity?: number;
|
|
697
703
|
scope?:
|
|
698
704
|
| "single-instance"
|
|
@@ -714,7 +720,7 @@ export default defineAction({
|
|
|
714
720
|
status: "conflict" as const,
|
|
715
721
|
changed: false,
|
|
716
722
|
message:
|
|
717
|
-
"Local visual edits require designId, connectionId, path, and
|
|
723
|
+
"Local visual edits require designId, connectionId, path, and a complete sourceAnchor from the live selection.",
|
|
718
724
|
},
|
|
719
725
|
persisted: false,
|
|
720
726
|
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
|
|
3
3
|
import { defineAction } from "@agent-native/core";
|
|
4
|
-
import {
|
|
5
|
-
getRequestOrgId,
|
|
6
|
-
getRequestUserEmail,
|
|
7
|
-
} from "@agent-native/core/server/request-context";
|
|
8
4
|
import { and, eq, isNull, sql } from "drizzle-orm";
|
|
9
5
|
import { z } from "zod";
|
|
10
6
|
|
|
11
7
|
import { getDb, schema } from "../server/db/index.js";
|
|
8
|
+
import { resolveLocalhostConnectionScope } from "../server/lib/localhost-connection.js";
|
|
12
9
|
import {
|
|
13
10
|
DESIGN_BRIDGE_OPERATIONS,
|
|
14
11
|
makeLocalhostRouteId,
|
|
@@ -156,9 +153,7 @@ export default defineAction({
|
|
|
156
153
|
.default("connected"),
|
|
157
154
|
}),
|
|
158
155
|
run: async (args) => {
|
|
159
|
-
const ownerEmail =
|
|
160
|
-
if (!ownerEmail) throw new Error("no authenticated user");
|
|
161
|
-
const orgId = getRequestOrgId() ?? null;
|
|
156
|
+
const { ownerEmail, orgId } = await resolveLocalhostConnectionScope();
|
|
162
157
|
|
|
163
158
|
const now = new Date().toISOString();
|
|
164
159
|
const db = getDb();
|
|
@@ -231,8 +226,9 @@ export default defineAction({
|
|
|
231
226
|
);
|
|
232
227
|
}
|
|
233
228
|
|
|
234
|
-
// Token for a new row: explicit, else existing, else mint. The
|
|
235
|
-
//
|
|
229
|
+
// Token for a new row: explicit, else existing, else mint. The account or
|
|
230
|
+
// trusted local-CLI principal owning the row is what lets the bridge skip a
|
|
231
|
+
// separate browser sign-in without making the token ambient.
|
|
236
232
|
const explicitToken = args.bridgeToken?.trim() || undefined;
|
|
237
233
|
const nextBridgeToken =
|
|
238
234
|
explicitToken ||
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
type SourceWorkspaceFile,
|
|
46
46
|
} from "../server/source-workspace.js";
|
|
47
47
|
import { resolveSourceCapabilities } from "../shared/capability-resolver.js";
|
|
48
|
-
import {
|
|
48
|
+
import { resolveCodeLayerTarget } from "../shared/code-layer.js";
|
|
49
49
|
import type { CodeLayerNode, CodeLayerSource } from "../shared/code-layer.js";
|
|
50
50
|
import { agentSelectionDescriptor } from "../shared/collab-selection.js";
|
|
51
51
|
import {
|
|
@@ -333,22 +333,25 @@ export default defineAction({
|
|
|
333
333
|
filename: file.filename,
|
|
334
334
|
};
|
|
335
335
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
);
|
|
336
|
+
// The shared resolver, not a local `.find()`: it refuses an ambiguous match
|
|
337
|
+
// instead of annotating whichever repeated instance came first, and names
|
|
338
|
+
// the count. The old "Element not found" read the same whether the target
|
|
339
|
+
// was absent, ambiguous, or never supplied.
|
|
340
|
+
const { projection, resolution } = resolveCodeLayerTarget(
|
|
341
|
+
html,
|
|
342
|
+
{ nodeId, selector },
|
|
343
|
+
{ source: codeLayerSource },
|
|
344
|
+
);
|
|
346
345
|
|
|
347
|
-
if (!node) {
|
|
346
|
+
if (resolution.status !== "resolved" || !resolution.node) {
|
|
348
347
|
throw new Error(
|
|
349
|
-
|
|
348
|
+
`${resolution.message ?? "Target did not resolve to a single code layer node."} ` +
|
|
349
|
+
`Searched ${projection.nodes.length} projection nodes for ` +
|
|
350
|
+
`${nodeId ? `nodeId "${nodeId}"` : `selector "${selector ?? ""}"`}. ` +
|
|
351
|
+
`Run get-code-layer-projection to list current node ids and selectors.`,
|
|
350
352
|
);
|
|
351
353
|
}
|
|
354
|
+
const node = resolution.node;
|
|
352
355
|
|
|
353
356
|
// ── Build annotations ─────────────────────────────────────────────────────
|
|
354
357
|
const componentName = normalizeComponentName(name);
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { defineAction } from "@agent-native/core";
|
|
2
|
-
import {
|
|
3
|
-
getRequestOrgId,
|
|
4
|
-
getRequestUserEmail,
|
|
5
|
-
} from "@agent-native/core/server/request-context";
|
|
6
2
|
import { assertAccess } from "@agent-native/core/sharing";
|
|
7
3
|
import { and, eq, isNull } from "drizzle-orm";
|
|
8
4
|
import { nanoid } from "nanoid";
|
|
9
5
|
import { z } from "zod";
|
|
10
6
|
|
|
11
7
|
import { getDb, schema } from "../server/db/index.js";
|
|
8
|
+
import { resolveLocalhostConnectionScope } from "../server/lib/localhost-connection.js";
|
|
12
9
|
|
|
13
10
|
/** Grant expiry: 8 hours from mint time. */
|
|
14
11
|
const GRANT_TTL_MS = 8 * 60 * 60 * 1000;
|
|
@@ -40,9 +37,7 @@ export default defineAction({
|
|
|
40
37
|
run: async ({ designId, connectionId }) => {
|
|
41
38
|
await assertAccess("design", designId, "editor");
|
|
42
39
|
|
|
43
|
-
const ownerEmail =
|
|
44
|
-
if (!ownerEmail) throw new Error("no authenticated user");
|
|
45
|
-
const orgId = getRequestOrgId() ?? null;
|
|
40
|
+
const { ownerEmail, orgId } = await resolveLocalhostConnectionScope();
|
|
46
41
|
|
|
47
42
|
const db = getDb();
|
|
48
43
|
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { defineAction } from "@agent-native/core";
|
|
2
|
-
import {
|
|
3
|
-
getRequestOrgId,
|
|
4
|
-
getRequestUserEmail,
|
|
5
|
-
} from "@agent-native/core/server/request-context";
|
|
2
|
+
import { getRequestUserEmail } from "@agent-native/core/server/request-context";
|
|
6
3
|
import { resolveAccess } from "@agent-native/core/sharing";
|
|
7
4
|
import { and, eq, isNull } from "drizzle-orm";
|
|
8
5
|
import { z } from "zod";
|
|
9
6
|
|
|
10
7
|
import { getDb, schema } from "../server/db/index.js";
|
|
8
|
+
import { resolveLocalhostConnectionScope } from "../server/lib/localhost-connection.js";
|
|
11
9
|
import { resolveSourceCapabilities } from "../shared/capability-resolver.js";
|
|
12
10
|
import { DESIGN_CAPABILITY_NAMES } from "../shared/design-source-capabilities.js";
|
|
13
11
|
import "../server/db/index.js"; // ensure registerShareableResource runs
|
|
@@ -57,9 +55,8 @@ export default defineAction({
|
|
|
57
55
|
typeof rawData === "string" ? JSON.parse(rawData) : {};
|
|
58
56
|
const connectionId = designConnectionIdFromData(rawDesignData);
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (connectionId && ownerEmail) {
|
|
58
|
+
if (connectionId && getRequestUserEmail()) {
|
|
59
|
+
const { ownerEmail, orgId } = await resolveLocalhostConnectionScope();
|
|
63
60
|
const [conn] = await db
|
|
64
61
|
.select({
|
|
65
62
|
capabilities: schema.designLocalhostConnections.capabilities,
|