@agent-native/core 0.129.1 → 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 +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/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/mcp/build-server.ts +20 -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/desktop/src-tauri/src/native_screen.rs +1 -1
- package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +21 -1
- 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/collab/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/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/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +10 -1
- package/dist/mcp/build-server.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/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/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-engine-api-key-route.d.ts +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/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/mcp/build-server.ts +20 -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,27 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
export function preventPendingLiveEditUnload(event: BeforeUnloadEvent): void {
|
|
4
|
+
event.preventDefault();
|
|
5
|
+
event.returnValue = "";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Pending localhost edits live in the iframe preview and its in-memory
|
|
10
|
+
* undo/redo stacks. A hard reload cannot restore that complete session safely,
|
|
11
|
+
* so keep the native browser confirmation attached only while those edits
|
|
12
|
+
* exist. Clearing the pending state after Apply or explicit discard removes
|
|
13
|
+
* the listener on the next render.
|
|
14
|
+
*/
|
|
15
|
+
export function usePendingLiveEditUnloadGuard(hasPendingEdits: boolean): void {
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!hasPendingEdits) return;
|
|
18
|
+
window.addEventListener("beforeunload", preventPendingLiveEditUnload, {
|
|
19
|
+
capture: true,
|
|
20
|
+
});
|
|
21
|
+
return () => {
|
|
22
|
+
window.removeEventListener("beforeunload", preventPendingLiveEditUnload, {
|
|
23
|
+
capture: true,
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
}, [hasPendingEdits]);
|
|
27
|
+
}
|
|
@@ -5,6 +5,7 @@ import type { PendingLiveStructureEdit } from "./pending-edits";
|
|
|
5
5
|
|
|
6
6
|
export type RuntimeStructureVerificationFailure =
|
|
7
7
|
| "missing-subject"
|
|
8
|
+
| "subject-still-present"
|
|
8
9
|
| "missing-anchor"
|
|
9
10
|
| "wrong-parent"
|
|
10
11
|
| "wrong-order"
|
|
@@ -30,6 +31,15 @@ export function verifyPendingStructureRuntime(
|
|
|
30
31
|
edit.selector,
|
|
31
32
|
edit.sourceId ?? undefined,
|
|
32
33
|
);
|
|
34
|
+
// A removal proves itself by ABSENCE. Running it through the anchor/order
|
|
35
|
+
// checks below would report "missing-subject" for the exact outcome it
|
|
36
|
+
// asked for, and the apply flow would sit in awaiting-runtime until it
|
|
37
|
+
// timed out on a source write that actually succeeded.
|
|
38
|
+
if (edit.removed) {
|
|
39
|
+
return subject
|
|
40
|
+
? { ok: false, failure: "subject-still-present" }
|
|
41
|
+
: { ok: true };
|
|
42
|
+
}
|
|
33
43
|
if (!subject) return { ok: false, failure: "missing-subject" };
|
|
34
44
|
const anchor = resolveCodeLayerNodeFromBridge(
|
|
35
45
|
projection,
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
* coding agent, which can inspect the surrounding program before editing it.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import {
|
|
11
|
+
type ElementProvenanceMethod,
|
|
12
|
+
sourcePositionPrecision,
|
|
13
|
+
type SourcePositionPrecision,
|
|
14
|
+
} from "@shared/source-mode";
|
|
15
|
+
|
|
10
16
|
export type ReactSourceScope =
|
|
11
17
|
| "single-instance"
|
|
12
18
|
| "repeated-render"
|
|
@@ -20,19 +26,65 @@ export interface ReactSourceAnchor {
|
|
|
20
26
|
sourceFile?: string;
|
|
21
27
|
line?: number;
|
|
22
28
|
column?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Tier that produced line/column. On React 19 it is `debug-stack`, whose
|
|
31
|
+
* position is the dev server's TRANSFORMED output, not the authored JSX —
|
|
32
|
+
* see `sourcePositionPrecision`. Absent means the tier was never reported.
|
|
33
|
+
*/
|
|
34
|
+
method?: ElementProvenanceMethod;
|
|
23
35
|
component?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Where the nearest enclosing component was INSTANTIATED (`<Card …>` in the
|
|
38
|
+
* parent), as opposed to `sourceFile`/`line`/`column` above, which are the
|
|
39
|
+
* element's own authoring site. For a mapped instance this is the only
|
|
40
|
+
* location that names the call site the agent has to edit.
|
|
41
|
+
*/
|
|
42
|
+
ownerRelPath?: string;
|
|
43
|
+
ownerSourceFile?: string;
|
|
44
|
+
ownerLine?: number;
|
|
45
|
+
ownerColumn?: number;
|
|
46
|
+
ownerComponent?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Tier that produced ownerLine/ownerColumn. Distinct from `method`: a
|
|
49
|
+
* source-plugin element carries an authored position while its owner site
|
|
50
|
+
* comes from the transformed React 19 owner stack.
|
|
51
|
+
*/
|
|
52
|
+
ownerMethod?: ElementProvenanceMethod;
|
|
53
|
+
/**
|
|
54
|
+
* React key of the nearest component instance. `.map()`-produced siblings
|
|
55
|
+
* share one authored call site, so line/column plus runtimeMultiplicity says
|
|
56
|
+
* "one of N instances" while this says WHICH one.
|
|
57
|
+
*/
|
|
58
|
+
ownerKey?: string;
|
|
24
59
|
runtimeMultiplicity?: number;
|
|
25
60
|
reason?: string;
|
|
26
61
|
scope?: ReactSourceScope;
|
|
27
62
|
}
|
|
28
63
|
|
|
64
|
+
/**
|
|
65
|
+
* An anchor with a complete, path-safe location. "Exact" here means every
|
|
66
|
+
* field is present and validated — NOT that line/column are the authored JSX
|
|
67
|
+
* coordinates. `positionPrecision` is the field that says which.
|
|
68
|
+
*/
|
|
29
69
|
export interface ExactReactSourceAnchor {
|
|
30
70
|
id: string;
|
|
31
71
|
relPath: string;
|
|
32
72
|
sourceFile: string;
|
|
33
73
|
line: number;
|
|
34
74
|
column: number;
|
|
75
|
+
/** "transformed" = the dev server's line, approximate against the source. */
|
|
76
|
+
positionPrecision: SourcePositionPrecision;
|
|
77
|
+
method?: ElementProvenanceMethod;
|
|
35
78
|
component?: string;
|
|
79
|
+
ownerRelPath?: string;
|
|
80
|
+
ownerSourceFile?: string;
|
|
81
|
+
ownerLine?: number;
|
|
82
|
+
ownerColumn?: number;
|
|
83
|
+
ownerComponent?: string;
|
|
84
|
+
ownerMethod?: ElementProvenanceMethod;
|
|
85
|
+
/** Precision of ownerLine/ownerColumn; absent when there is no owner site. */
|
|
86
|
+
ownerPositionPrecision?: SourcePositionPrecision;
|
|
87
|
+
ownerKey?: string;
|
|
36
88
|
runtimeMultiplicity: number;
|
|
37
89
|
reason?: string;
|
|
38
90
|
scope: ReactSourceScope;
|
|
@@ -175,6 +227,7 @@ export interface BuildRuntimeReactLayerStateHandoffInput {
|
|
|
175
227
|
export type RuntimeStructureMoveExecutionMode =
|
|
176
228
|
| "source-edit"
|
|
177
229
|
| "screen-bridge"
|
|
230
|
+
| "screen-bridge-insert"
|
|
178
231
|
| "semantic-handoff";
|
|
179
232
|
|
|
180
233
|
export function resolveRuntimeStructureMoveExecutionMode(input: {
|
|
@@ -182,7 +235,37 @@ export function resolveRuntimeStructureMoveExecutionMode(input: {
|
|
|
182
235
|
targetRuntimeOnly: boolean;
|
|
183
236
|
sourceScreenId: string;
|
|
184
237
|
targetScreenId: string;
|
|
238
|
+
/**
|
|
239
|
+
* The DESTINATION screen renders a live localhost app. Node-level
|
|
240
|
+
* `runtimeOnly` cannot stand in for this: a live drop anchor usually has no
|
|
241
|
+
* stored layer owner at all, so both `runtimeOnly` flags read false and the
|
|
242
|
+
* move looks like an ordinary source edit — except the destination's stored
|
|
243
|
+
* "content" is the bridge URL, so that edit writes an HTML document over the
|
|
244
|
+
* URL and never reaches the running DOM.
|
|
245
|
+
*/
|
|
246
|
+
targetScreenIsLive?: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* The SUBJECT comes off the board surface, whose primitives are loose markup
|
|
249
|
+
* with no screen of their own. Only that route may be reinterpreted as an
|
|
250
|
+
* insert: dropping a real screen's element into a live app is a MOVE, and
|
|
251
|
+
* turning it into an insert would duplicate the element while leaving the
|
|
252
|
+
* original in its source screen.
|
|
253
|
+
*/
|
|
254
|
+
sourceScreenIsBoard?: boolean;
|
|
185
255
|
}): RuntimeStructureMoveExecutionMode {
|
|
256
|
+
if (
|
|
257
|
+
input.targetScreenIsLive &&
|
|
258
|
+
input.sourceScreenIsBoard &&
|
|
259
|
+
input.sourceScreenId !== input.targetScreenId &&
|
|
260
|
+
!input.subjectRuntimeOnly
|
|
261
|
+
) {
|
|
262
|
+
return "screen-bridge-insert";
|
|
263
|
+
}
|
|
264
|
+
// A live destination has no editable stored document, so any other move into
|
|
265
|
+
// one belongs to the coding agent — never to the stored-source path, which
|
|
266
|
+
// would write an HTML document over the destination's bridge URL.
|
|
267
|
+
if (input.targetScreenIsLive && input.sourceScreenId !== input.targetScreenId)
|
|
268
|
+
return "semantic-handoff";
|
|
186
269
|
if (!input.subjectRuntimeOnly && !input.targetRuntimeOnly)
|
|
187
270
|
return "source-edit";
|
|
188
271
|
if (
|
|
@@ -219,19 +302,68 @@ function safeRelativePath(value: string | undefined): string | null {
|
|
|
219
302
|
return normalized;
|
|
220
303
|
}
|
|
221
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Owner-site fields, path-redacted exactly like the element location. The
|
|
307
|
+
* owner position carries its OWN precision: a source-plugin element has an
|
|
308
|
+
* authored `method` while its owner line comes from the transformed React 19
|
|
309
|
+
* owner stack, so reusing `positionPrecision` here would overstate it.
|
|
310
|
+
* `ownerComponent`/`ownerKey` survive an unsafe owner path — they are not
|
|
311
|
+
* locations, and the key is what separates `.map()` siblings.
|
|
312
|
+
*/
|
|
313
|
+
function ownerAnchorFields(anchor: ReactSourceAnchor) {
|
|
314
|
+
const ownerPath =
|
|
315
|
+
safeRelativePath(anchor.ownerRelPath) ??
|
|
316
|
+
safeRelativePath(anchor.ownerSourceFile);
|
|
317
|
+
const hasOwnerPosition =
|
|
318
|
+
!!ownerPath &&
|
|
319
|
+
Number.isInteger(anchor.ownerLine) &&
|
|
320
|
+
(anchor.ownerLine ?? 0) > 0;
|
|
321
|
+
return {
|
|
322
|
+
...(hasOwnerPosition
|
|
323
|
+
? {
|
|
324
|
+
ownerRelPath: ownerPath,
|
|
325
|
+
ownerSourceFile:
|
|
326
|
+
safeRelativePath(anchor.ownerSourceFile) ?? ownerPath,
|
|
327
|
+
ownerLine: anchor.ownerLine!,
|
|
328
|
+
ownerPositionPrecision: sourcePositionPrecision(anchor.ownerMethod),
|
|
329
|
+
...(Number.isInteger(anchor.ownerColumn) &&
|
|
330
|
+
(anchor.ownerColumn ?? 0) > 0
|
|
331
|
+
? { ownerColumn: anchor.ownerColumn }
|
|
332
|
+
: {}),
|
|
333
|
+
...(anchor.ownerMethod ? { ownerMethod: anchor.ownerMethod } : {}),
|
|
334
|
+
}
|
|
335
|
+
: {}),
|
|
336
|
+
...(bounded(anchor.ownerComponent, MAX_COMPONENT_LENGTH)
|
|
337
|
+
? { ownerComponent: bounded(anchor.ownerComponent, MAX_COMPONENT_LENGTH) }
|
|
338
|
+
: {}),
|
|
339
|
+
...(bounded(anchor.ownerKey, MAX_ID_LENGTH)
|
|
340
|
+
? { ownerKey: bounded(anchor.ownerKey, MAX_ID_LENGTH) }
|
|
341
|
+
: {}),
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/** What prompt serialization emits: the anchor plus its honest precision. */
|
|
346
|
+
export type RedactedReactSourceAnchor = ReactSourceAnchor & {
|
|
347
|
+
positionPrecision: SourcePositionPrecision;
|
|
348
|
+
};
|
|
349
|
+
|
|
222
350
|
/**
|
|
223
351
|
* Bound an optional live-preview anchor for prompt serialization. Absolute
|
|
224
352
|
* Fiber paths are replaced by the bridge-safe relPath when available, or
|
|
225
353
|
* omitted when no safe project-relative path has been resolved yet.
|
|
354
|
+
*
|
|
355
|
+
* `positionPrecision` always ships with the coordinates: a reader that sees
|
|
356
|
+
* `line` without it would take a React 19 stack line for the authored one.
|
|
226
357
|
*/
|
|
227
358
|
export function redactReactSourceAnchor(
|
|
228
359
|
anchor: ReactSourceAnchor | undefined,
|
|
229
|
-
):
|
|
360
|
+
): RedactedReactSourceAnchor | undefined {
|
|
230
361
|
if (!anchor) return undefined;
|
|
231
362
|
const relPath = safeRelativePath(anchor.relPath);
|
|
232
363
|
const sourceFile = safeRelativePath(anchor.sourceFile);
|
|
233
364
|
const canonicalPath = relPath ?? sourceFile;
|
|
234
365
|
return {
|
|
366
|
+
positionPrecision: sourcePositionPrecision(anchor.method),
|
|
235
367
|
...(bounded(anchor.id, MAX_ID_LENGTH)
|
|
236
368
|
? { id: bounded(anchor.id, MAX_ID_LENGTH) }
|
|
237
369
|
: {}),
|
|
@@ -247,9 +379,11 @@ export function redactReactSourceAnchor(
|
|
|
247
379
|
...(Number.isInteger(anchor.column) && (anchor.column ?? 0) > 0
|
|
248
380
|
? { column: anchor.column }
|
|
249
381
|
: {}),
|
|
382
|
+
...(anchor.method ? { method: anchor.method } : {}),
|
|
250
383
|
...(bounded(anchor.component, MAX_COMPONENT_LENGTH)
|
|
251
384
|
? { component: bounded(anchor.component, MAX_COMPONENT_LENGTH) }
|
|
252
385
|
: {}),
|
|
386
|
+
...ownerAnchorFields(anchor),
|
|
253
387
|
...(Number.isInteger(anchor.runtimeMultiplicity) &&
|
|
254
388
|
(anchor.runtimeMultiplicity ?? 0) > 0
|
|
255
389
|
? { runtimeMultiplicity: anchor.runtimeMultiplicity }
|
|
@@ -307,9 +441,12 @@ function exactAnchor(
|
|
|
307
441
|
sourceFile: sourceFile ?? canonicalPath,
|
|
308
442
|
line: anchor.line!,
|
|
309
443
|
column: anchor.column!,
|
|
444
|
+
positionPrecision: sourcePositionPrecision(anchor.method),
|
|
445
|
+
...(anchor.method ? { method: anchor.method } : {}),
|
|
310
446
|
...(bounded(anchor.component, MAX_COMPONENT_LENGTH)
|
|
311
447
|
? { component: bounded(anchor.component, MAX_COMPONENT_LENGTH) }
|
|
312
448
|
: {}),
|
|
449
|
+
...ownerAnchorFields(anchor),
|
|
313
450
|
runtimeMultiplicity:
|
|
314
451
|
Number.isInteger(anchor.runtimeMultiplicity) &&
|
|
315
452
|
(anchor.runtimeMultiplicity ?? 0) > 0
|
|
@@ -392,8 +529,11 @@ export function buildReactSemanticHandoff(
|
|
|
392
529
|
input.runtimeRelationship.targetAnchorId,
|
|
393
530
|
MAX_ID_LENGTH,
|
|
394
531
|
);
|
|
532
|
+
// An insert's subject is new markup, not an existing runtime node, so it has
|
|
533
|
+
// no source anchor to reference. Every other operation acts on something
|
|
534
|
+
// that already exists in the program and must name it.
|
|
395
535
|
if (
|
|
396
|
-
subjectAnchorIds.length === 0 ||
|
|
536
|
+
(input.operation !== "insert" && subjectAnchorIds.length === 0) ||
|
|
397
537
|
subjectAnchorIds.some((id) => !id || !anchorIds.has(id)) ||
|
|
398
538
|
(targetAnchorId !== undefined && !anchorIds.has(targetAnchorId))
|
|
399
539
|
) {
|
|
@@ -498,10 +638,29 @@ export function buildReactSemanticHandoff(
|
|
|
498
638
|
},
|
|
499
639
|
instructions: [
|
|
500
640
|
"Read every target file and verify each source anchor against the surrounding React control flow before editing.",
|
|
641
|
+
// React 19's only tier is the owner stack, so this branch is the norm
|
|
642
|
+
// on a modern dev server, not an edge case.
|
|
643
|
+
...(sourceAnchors.some(
|
|
644
|
+
(anchor) =>
|
|
645
|
+
anchor.positionPrecision !== "authored" ||
|
|
646
|
+
(anchor.ownerPositionPrecision !== undefined &&
|
|
647
|
+
anchor.ownerPositionPrecision !== "authored"),
|
|
648
|
+
)
|
|
649
|
+
? [
|
|
650
|
+
`Do not trust line/column on any anchor whose positionPrecision is not "authored", nor ownerLine/ownerColumn whose ownerPositionPrecision is not "authored" — the two tiers are reported separately and can differ on the same anchor. A "transformed" position is the dev server's own output coordinates (React 19 exposes only an owner stack), and an "unknown" one never reported its tier; on those, treat the file and component as the reliable part and locate the element by its JSX shape, then re-derive the real line from the file you read.`,
|
|
651
|
+
]
|
|
652
|
+
: []),
|
|
501
653
|
"Use semantic source edits; do not apply a generic AST reparent, group, or wrapper transform.",
|
|
502
654
|
"Obtain human write consent and write through the local bridge with expectedVersionHash from the corresponding read and requireExpectedVersionHash: true.",
|
|
503
655
|
"If a version hash conflicts, re-read the source and re-plan instead of overwriting it.",
|
|
504
656
|
"Keep the live preview pending until HMR renders and confirms the intended runtime relationship.",
|
|
657
|
+
...(sourceAnchors.some(
|
|
658
|
+
(anchor) => anchor.ownerKey || anchor.ownerRelPath,
|
|
659
|
+
)
|
|
660
|
+
? [
|
|
661
|
+
"An anchor's ownerRelPath/ownerLine is where the enclosing component was INSTANTIATED — for a mapped instance, the `.map()` call site — while relPath/line is the element's own JSX inside that component; edit whichever one the change actually belongs to. ownerKey is the React key of the selected instance, not a third location: its siblings share that one call site, so decide whether the change belongs to the data behind that key or to every instance rendered from it.",
|
|
662
|
+
]
|
|
663
|
+
: []),
|
|
505
664
|
],
|
|
506
665
|
},
|
|
507
666
|
};
|
|
@@ -509,7 +668,7 @@ export function buildReactSemanticHandoff(
|
|
|
509
668
|
|
|
510
669
|
/** Build the safe coding-agent packet for a runtime Layers-panel move that a
|
|
511
670
|
* screen-scoped StructureMove bridge cannot execute. Both runtime endpoints
|
|
512
|
-
* must already have
|
|
671
|
+
* must already have complete compiler provenance; the generic builder rejects
|
|
513
672
|
* either missing/unsafe anchor rather than guessing from a selector. */
|
|
514
673
|
export function buildRuntimeReactStructureMoveHandoff(
|
|
515
674
|
input: BuildRuntimeReactStructureMoveHandoffInput,
|
|
@@ -529,8 +688,8 @@ export function buildRuntimeReactStructureMoveHandoff(
|
|
|
529
688
|
operation,
|
|
530
689
|
desiredChange:
|
|
531
690
|
input.placement === "inside"
|
|
532
|
-
? `Move the runtime React subject from screen "${sourceScreenId}" inside the
|
|
533
|
-
: `Move the runtime React subject from screen "${sourceScreenId}" ${input.placement} the
|
|
691
|
+
? `Move the runtime React subject from screen "${sourceScreenId}" inside the target anchor in screen "${targetScreenId}" while preserving the intended visual order and behavior.`
|
|
692
|
+
: `Move the runtime React subject from screen "${sourceScreenId}" ${input.placement} the target anchor in screen "${targetScreenId}" while preserving the intended visual order and behavior.`,
|
|
534
693
|
sourceAnchors: [subjectAnchor, targetAnchor],
|
|
535
694
|
runtimeRelationship: {
|
|
536
695
|
kind: input.placement,
|
|
@@ -541,14 +700,14 @@ export function buildRuntimeReactStructureMoveHandoff(
|
|
|
541
700
|
screenId: targetScreenId,
|
|
542
701
|
sourceScreenId,
|
|
543
702
|
targetScreenId,
|
|
544
|
-
description: `Runtime React ${operation} from screen "${sourceScreenId}" to screen "${targetScreenId}" with placement "${input.placement}". Verify both
|
|
703
|
+
description: `Runtime React ${operation} from screen "${sourceScreenId}" to screen "${targetScreenId}" with placement "${input.placement}". Verify both source anchors and their surrounding control flow before editing either file.`,
|
|
545
704
|
},
|
|
546
705
|
versionHashes: [],
|
|
547
706
|
});
|
|
548
707
|
}
|
|
549
708
|
|
|
550
709
|
/** Build the safe coding-agent packet for a runtime-only layer state toggle.
|
|
551
|
-
* The
|
|
710
|
+
* The JSX host element receives durable source metadata which survives
|
|
552
711
|
* HMR and is preserved by the runtime Layers snapshot. This is deliberately a
|
|
553
712
|
* semantic handoff: compiler provenance identifies the opening element, but no
|
|
554
713
|
* generic AST transform is authorized to mutate the source. */
|
|
@@ -566,8 +725,8 @@ export function buildRuntimeReactLayerStateHandoff(
|
|
|
566
725
|
const attributeName = `data-agent-native-${input.state}`;
|
|
567
726
|
const subjectAnchor = { ...input.subjectAnchor, id: "subject" };
|
|
568
727
|
const desiredChange = input.enabled
|
|
569
|
-
? `Set ${attributeName}="true" on the
|
|
570
|
-
: `Remove the ${attributeName} attribute from the
|
|
728
|
+
? `Set ${attributeName}="true" on the JSX host element for this runtime layer. Keep it as durable source metadata; do not replace it with a transient DOM mutation, CSS-only workaround, or wrapper.`
|
|
729
|
+
: `Remove the ${attributeName} attribute from the JSX host element for this runtime layer. Do not replace it with a transient DOM mutation, CSS-only workaround, or wrapper.`;
|
|
571
730
|
|
|
572
731
|
return buildReactSemanticHandoff({
|
|
573
732
|
operation: "set-layer-state",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Pure data/logic for the
|
|
2
|
+
* Pure data/logic for the responsive Interact mode's device chrome bar
|
|
3
3
|
* (ResponsiveInteractBar). Modeled on builder-internal's
|
|
4
4
|
* ResponsiveEditingMode/responsive-device-presets, adapted to this app's
|
|
5
5
|
* shadcn chrome. Kept separate from DEVICE_FRAME_VIEWPORTS in
|
|
@@ -50,7 +50,9 @@ export const INTERACT_DEVICE_PRESETS: InteractDevicePreset[] = [
|
|
|
50
50
|
},
|
|
51
51
|
];
|
|
52
52
|
|
|
53
|
-
export const DEFAULT_INTERACT_DEVICE_PRESET = INTERACT_DEVICE_PRESETS
|
|
53
|
+
export const DEFAULT_INTERACT_DEVICE_PRESET = INTERACT_DEVICE_PRESETS.find(
|
|
54
|
+
(preset) => preset.category === "desktop",
|
|
55
|
+
)!;
|
|
54
56
|
|
|
55
57
|
export function findInteractDevicePreset(
|
|
56
58
|
name: string,
|
|
@@ -58,8 +60,44 @@ export function findInteractDevicePreset(
|
|
|
58
60
|
return INTERACT_DEVICE_PRESETS.find((preset) => preset.name === name);
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
export function resolveInteractDeviceForScreen(screen?: {
|
|
64
|
+
width?: number | null;
|
|
65
|
+
height?: number | null;
|
|
66
|
+
}): InteractDevicePreset {
|
|
67
|
+
const width =
|
|
68
|
+
typeof screen?.width === "number" &&
|
|
69
|
+
Number.isFinite(screen.width) &&
|
|
70
|
+
screen.width > 0
|
|
71
|
+
? Math.round(screen.width)
|
|
72
|
+
: DEFAULT_INTERACT_DEVICE_PRESET.width;
|
|
73
|
+
const height =
|
|
74
|
+
typeof screen?.height === "number" &&
|
|
75
|
+
Number.isFinite(screen.height) &&
|
|
76
|
+
screen.height > 0
|
|
77
|
+
? Math.round(screen.height)
|
|
78
|
+
: DEFAULT_INTERACT_DEVICE_PRESET.height;
|
|
79
|
+
const preset = INTERACT_DEVICE_PRESETS.find(
|
|
80
|
+
(candidate) =>
|
|
81
|
+
candidate.category !== "custom" &&
|
|
82
|
+
candidate.width === width &&
|
|
83
|
+
candidate.height === height,
|
|
84
|
+
);
|
|
85
|
+
return (
|
|
86
|
+
preset ?? {
|
|
87
|
+
name: INTERACT_CUSTOM_DEVICE_NAME,
|
|
88
|
+
category: "custom",
|
|
89
|
+
width,
|
|
90
|
+
height,
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function formatInteractZoom(zoom: number): string {
|
|
96
|
+
return Number.isFinite(zoom) ? zoom.toFixed(1) : "100.0";
|
|
97
|
+
}
|
|
98
|
+
|
|
61
99
|
/**
|
|
62
|
-
* Auto-fit zoom for the
|
|
100
|
+
* Auto-fit zoom for the responsive device box, ported from
|
|
63
101
|
* builder-internal's ResponsiveEditingMode effect (~lines 155-174): only
|
|
64
102
|
* zooms DOWN so the device fits the available chrome area, never zooms in
|
|
65
103
|
* past 100% just because there's extra room. Steps to the nearest 5 and
|
|
@@ -42,6 +42,10 @@ export function designEditorCommandFromSearchParams(
|
|
|
42
42
|
const rawZoom = searchParams.get("zoom");
|
|
43
43
|
const zoom = rawZoom !== null ? Number(rawZoom) : NaN;
|
|
44
44
|
const tool = normalizeDesignTool(searchParams.get("tool"));
|
|
45
|
+
// `single` is the URL spelling for the responsive Interact surface. There
|
|
46
|
+
// is no focused editing view, so even an older URL without mode=interact
|
|
47
|
+
// must enter Interact directly instead of reviving the removed Full view.
|
|
48
|
+
const mode = editorView === "single" ? "interact" : undefined;
|
|
45
49
|
if (
|
|
46
50
|
editorView !== "overview" &&
|
|
47
51
|
editorView !== "single" &&
|
|
@@ -76,6 +80,7 @@ export function designEditorCommandFromSearchParams(
|
|
|
76
80
|
command.zoom = FOCUSED_SCREEN_ZOOM;
|
|
77
81
|
}
|
|
78
82
|
if (tool) command.tool = tool;
|
|
83
|
+
if (mode) command.mode = mode;
|
|
79
84
|
return command;
|
|
80
85
|
}
|
|
81
86
|
|
|
@@ -148,6 +148,38 @@ export function isScreenRootElementInfo(info: ElementInfo | null | undefined) {
|
|
|
148
148
|
return tagName === "BODY" || tagName === "HTML";
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Whether a plain Delete in overview mode targets an ELEMENT inside a screen
|
|
153
|
+
* rather than the screen frames themselves. MultiScreenCanvas keeps the owning
|
|
154
|
+
* screen in its `selectedIds` while an element inside it is selected (frame
|
|
155
|
+
* z-order and "topmost screen" depend on that), so Delete reaches the editor as
|
|
156
|
+
* "delete these screens" even when the real selection is one node. The more
|
|
157
|
+
* specific target wins — the same precedence shouldSuppressFrameSelectionBox
|
|
158
|
+
* already applies to the selection chrome.
|
|
159
|
+
*
|
|
160
|
+
* Layer ids are filtered the way getSelectedLayerSnapshots filters its
|
|
161
|
+
* candidates: a screen's own file-id row and the `__`-prefixed pseudo rows are
|
|
162
|
+
* screen/frame selections, not element selections.
|
|
163
|
+
*/
|
|
164
|
+
export function overviewDeleteTargetsElement(args: {
|
|
165
|
+
selectedElement: ElementInfo | null | undefined;
|
|
166
|
+
selectedLayerIds: readonly string[];
|
|
167
|
+
fileIds: readonly string[];
|
|
168
|
+
}): boolean {
|
|
169
|
+
const fileIds = new Set(args.fileIds);
|
|
170
|
+
if (
|
|
171
|
+
args.selectedLayerIds.some(
|
|
172
|
+
(layerId) =>
|
|
173
|
+
layerId && !layerId.startsWith("__") && !fileIds.has(layerId),
|
|
174
|
+
)
|
|
175
|
+
) {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
return Boolean(
|
|
179
|
+
args.selectedElement && !isScreenRootElementInfo(args.selectedElement),
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
151
183
|
export function shouldMirrorSelectedElementToAgentChat(
|
|
152
184
|
info: ElementInfo | null | undefined,
|
|
153
185
|
): info is ElementInfo {
|
|
@@ -307,24 +339,21 @@ export function getSidebarCodeLayerSelectionState(args: {
|
|
|
307
339
|
overviewSelectedScreenIds: string[];
|
|
308
340
|
screenFileIds?: string[];
|
|
309
341
|
}) {
|
|
310
|
-
const {
|
|
311
|
-
currentViewMode,
|
|
312
|
-
ownerFileId,
|
|
313
|
-
overviewSelectedScreenIds,
|
|
314
|
-
screenFileIds,
|
|
315
|
-
} = args;
|
|
342
|
+
const { ownerFileId, overviewSelectedScreenIds, screenFileIds } = args;
|
|
316
343
|
const ownerScreenId =
|
|
317
344
|
ownerFileId && (!screenFileIds || screenFileIds.includes(ownerFileId))
|
|
318
345
|
? ownerFileId
|
|
319
346
|
: null;
|
|
320
347
|
return {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
348
|
+
// Layer selection is an editing action, so it always targets the infinite
|
|
349
|
+
// canvas. Keeping `single` here let the Layers rail turn Interact into the
|
|
350
|
+
// removed focused Edit view when the handler subsequently set mode=edit.
|
|
351
|
+
viewMode: "overview" as const,
|
|
352
|
+
overviewSelectedScreenIds: ownerScreenId
|
|
353
|
+
? [ownerScreenId]
|
|
354
|
+
: ownerFileId
|
|
355
|
+
? []
|
|
356
|
+
: overviewSelectedScreenIds,
|
|
328
357
|
};
|
|
329
358
|
}
|
|
330
359
|
|