@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
package/corpus/templates/design/app/components/design/code-workbench/workspace/localhost-provider.ts
CHANGED
|
@@ -53,6 +53,40 @@ interface WriteLocalFileResponse {
|
|
|
53
53
|
versionHash?: string;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
const LOCAL_READ_TIMEOUT_MS = 15_000;
|
|
57
|
+
|
|
58
|
+
export class LocalWorkspaceTimeoutError extends Error {
|
|
59
|
+
constructor(operation: "list" | "read") {
|
|
60
|
+
super(
|
|
61
|
+
operation === "list"
|
|
62
|
+
? "Local files took too long to load. Check the local connection and try again." /* i18n-ignore */
|
|
63
|
+
: "This local file took too long to load. Check the local connection and try again." /* i18n-ignore */,
|
|
64
|
+
);
|
|
65
|
+
this.name = "LocalWorkspaceTimeoutError";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export async function withLocalReadTimeout<T>(
|
|
70
|
+
operation: "list" | "read",
|
|
71
|
+
request: Promise<T>,
|
|
72
|
+
timeoutMs = LOCAL_READ_TIMEOUT_MS,
|
|
73
|
+
): Promise<T> {
|
|
74
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
75
|
+
try {
|
|
76
|
+
return await Promise.race([
|
|
77
|
+
request,
|
|
78
|
+
new Promise<never>((_resolve, reject) => {
|
|
79
|
+
timer = setTimeout(
|
|
80
|
+
() => reject(new LocalWorkspaceTimeoutError(operation)),
|
|
81
|
+
timeoutMs,
|
|
82
|
+
);
|
|
83
|
+
}),
|
|
84
|
+
]);
|
|
85
|
+
} finally {
|
|
86
|
+
if (timer) clearTimeout(timer);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
56
90
|
/** Detect the write-local-file action's grant-related error messages. */
|
|
57
91
|
function isWriteConsentError(error: unknown): boolean {
|
|
58
92
|
if (!(error instanceof Error)) return false;
|
|
@@ -103,10 +137,13 @@ export function createLocalhostProvider(
|
|
|
103
137
|
};
|
|
104
138
|
|
|
105
139
|
async function listFiles(): Promise<WorkspaceFileEntry[]> {
|
|
106
|
-
const response = await
|
|
107
|
-
"list
|
|
108
|
-
|
|
109
|
-
|
|
140
|
+
const response = await withLocalReadTimeout(
|
|
141
|
+
"list",
|
|
142
|
+
callAction<ListLocalFilesResponse>(
|
|
143
|
+
"list-local-files",
|
|
144
|
+
{ designId, connectionId },
|
|
145
|
+
{ method: "GET" },
|
|
146
|
+
),
|
|
110
147
|
);
|
|
111
148
|
return response.files.map((file) => ({
|
|
112
149
|
path: file.path,
|
|
@@ -116,10 +153,13 @@ export function createLocalhostProvider(
|
|
|
116
153
|
}
|
|
117
154
|
|
|
118
155
|
async function readFile(path: string): Promise<WorkspaceReadResult> {
|
|
119
|
-
const response = await
|
|
120
|
-
"read
|
|
121
|
-
|
|
122
|
-
|
|
156
|
+
const response = await withLocalReadTimeout(
|
|
157
|
+
"read",
|
|
158
|
+
callAction<ReadLocalFileResponse>(
|
|
159
|
+
"read-local-file",
|
|
160
|
+
{ designId, connectionId, path },
|
|
161
|
+
{ method: "GET" },
|
|
162
|
+
),
|
|
123
163
|
);
|
|
124
164
|
return {
|
|
125
165
|
content: response.content,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { injectDocumentMarkup } from "@agent-native/core/shared";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Content-size reporter injected into every canvas iframe (primary + each
|
|
3
5
|
* breakpoint) so a frame can grow to fit its own content instead of inheriting
|
|
@@ -108,17 +110,5 @@ export const CONTENT_SIZE_REPORT_MESSAGE_TYPE = "agent-native:content-size";
|
|
|
108
110
|
/** Appends the reporter + full-height guard, mirroring appendHitTestResponder's
|
|
109
111
|
* marker handling so it runs regardless of document structure. */
|
|
110
112
|
export function appendContentSizeReporter(html: string): string {
|
|
111
|
-
|
|
112
|
-
return html.replace(
|
|
113
|
-
"</body>", // i18n-ignore generated iframe HTML marker
|
|
114
|
-
CONTENT_SIZE_REPORT_BRIDGE + "</body>", // i18n-ignore generated iframe HTML injection
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
if (html.includes("</html>")) {
|
|
118
|
-
return html.replace(
|
|
119
|
-
"</html>", // i18n-ignore generated iframe HTML marker
|
|
120
|
-
CONTENT_SIZE_REPORT_BRIDGE + "</html>", // i18n-ignore generated iframe HTML injection
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
return html + CONTENT_SIZE_REPORT_BRIDGE;
|
|
113
|
+
return injectDocumentMarkup(html, CONTENT_SIZE_REPORT_BRIDGE);
|
|
124
114
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { injectDocumentMarkup } from "@agent-native/core/shared";
|
|
2
|
+
|
|
1
3
|
const TRANSPARENT_EMBEDDED_FRAME_STYLE =
|
|
2
4
|
"<style data-agent-native-transparent-frame>html,body{background:transparent!important;}body{background-color:transparent!important;}</style>";
|
|
3
5
|
|
|
@@ -37,8 +39,8 @@ export function embeddedContentOffsetStyle(x: number, y: number): string {
|
|
|
37
39
|
|
|
38
40
|
function injectEmbeddedFrameStyle(content: string, style: string): string {
|
|
39
41
|
if (!style) return content;
|
|
40
|
-
if (/<\/head
|
|
41
|
-
return content
|
|
42
|
+
if (/<\/head\s*>/i.test(content)) {
|
|
43
|
+
return injectDocumentMarkup(content, style, { target: "head" });
|
|
42
44
|
}
|
|
43
45
|
if (/<body\b/i.test(content)) {
|
|
44
46
|
return content.replace(/<body\b/i, `${style}<body`);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { injectDocumentMarkup } from "@agent-native/core/shared";
|
|
2
|
+
|
|
1
3
|
import { hitTestBridgeScript } from "../../../../.generated/bridge/hit-test.generated";
|
|
2
4
|
|
|
3
5
|
export const LIGHTWEIGHT_HIT_TEST_BRIDGE_SCRIPT = `
|
|
@@ -7,17 +9,5 @@ ${hitTestBridgeScript}
|
|
|
7
9
|
`;
|
|
8
10
|
|
|
9
11
|
export function appendHitTestResponder(html: string): string {
|
|
10
|
-
|
|
11
|
-
return html.replace(
|
|
12
|
-
"</body>", // i18n-ignore generated iframe HTML marker
|
|
13
|
-
LIGHTWEIGHT_HIT_TEST_BRIDGE_SCRIPT + "</body>", // i18n-ignore generated iframe HTML injection
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
if (html.includes("</html>")) {
|
|
17
|
-
return html.replace(
|
|
18
|
-
"</html>", // i18n-ignore generated iframe HTML marker
|
|
19
|
-
LIGHTWEIGHT_HIT_TEST_BRIDGE_SCRIPT + "</html>", // i18n-ignore generated iframe HTML injection
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
return html + LIGHTWEIGHT_HIT_TEST_BRIDGE_SCRIPT;
|
|
12
|
+
return injectDocumentMarkup(html, LIGHTWEIGHT_HIT_TEST_BRIDGE_SCRIPT);
|
|
23
13
|
}
|
|
@@ -40,7 +40,9 @@ export function inspectorObjectTitle(element: ElementInfo): string {
|
|
|
40
40
|
export function componentNameForElementInfo(
|
|
41
41
|
element: ElementInfo | null | undefined,
|
|
42
42
|
): string {
|
|
43
|
-
|
|
43
|
+
const explicitName = element?.componentName?.trim();
|
|
44
|
+
if (explicitName) return explicitName;
|
|
45
|
+
return element?.provenance?.component?.trim() ?? "";
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export function elementIsComponentSelection(
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { ElementProvenance } from "@shared/source-mode";
|
|
2
|
+
|
|
3
|
+
export interface InspectCodeSourceLocation {
|
|
4
|
+
/**
|
|
5
|
+
* Path exactly as reported by the runtime. This can be project-relative on
|
|
6
|
+
* ordinary Vite URLs, so it must not automatically become a vscode:// link.
|
|
7
|
+
*/
|
|
8
|
+
filePath: string;
|
|
9
|
+
/** Absolute paths are safe to expose through the local-editor deep link. */
|
|
10
|
+
absolutePath?: string;
|
|
11
|
+
line?: number;
|
|
12
|
+
column?: number;
|
|
13
|
+
componentName?: string;
|
|
14
|
+
method?: ElementProvenance["method"];
|
|
15
|
+
owner?: {
|
|
16
|
+
filePath: string;
|
|
17
|
+
line?: number;
|
|
18
|
+
column?: number;
|
|
19
|
+
componentName?: string;
|
|
20
|
+
key?: string;
|
|
21
|
+
method?: ElementProvenance["ownerMethod"];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface InspectableElement {
|
|
26
|
+
tagName: string;
|
|
27
|
+
id?: string;
|
|
28
|
+
classes: string[];
|
|
29
|
+
provenance?: ElementProvenance;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function isAbsoluteSourcePath(filePath: string): boolean {
|
|
33
|
+
return (
|
|
34
|
+
filePath.startsWith("/") ||
|
|
35
|
+
filePath.startsWith("\\\\") ||
|
|
36
|
+
/^[A-Za-z]:[\\/]/.test(filePath)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Preserve the live bridge's compiler/debug provenance for the inspector.
|
|
42
|
+
* A missing file remains unavailable; a React 19 debug-stack line remains
|
|
43
|
+
* explicitly labelled as runtime-transformed instead of being presented as an
|
|
44
|
+
* authored JSX position.
|
|
45
|
+
*/
|
|
46
|
+
export function inspectCodeSourceLocation(
|
|
47
|
+
provenance: ElementProvenance | null | undefined,
|
|
48
|
+
): InspectCodeSourceLocation | null {
|
|
49
|
+
if (!provenance) return null;
|
|
50
|
+
const filePath = provenance.sourceFile?.trim();
|
|
51
|
+
if (!filePath) return null;
|
|
52
|
+
|
|
53
|
+
const ownerFilePath = provenance.ownerSourceFile?.trim();
|
|
54
|
+
return {
|
|
55
|
+
filePath,
|
|
56
|
+
...(isAbsoluteSourcePath(filePath) ? { absolutePath: filePath } : {}),
|
|
57
|
+
...(provenance.line ? { line: provenance.line } : {}),
|
|
58
|
+
...(provenance.column ? { column: provenance.column } : {}),
|
|
59
|
+
...(provenance.component ? { componentName: provenance.component } : {}),
|
|
60
|
+
...(provenance.method ? { method: provenance.method } : {}),
|
|
61
|
+
...(ownerFilePath
|
|
62
|
+
? {
|
|
63
|
+
owner: {
|
|
64
|
+
filePath: ownerFilePath,
|
|
65
|
+
...(provenance.ownerLine ? { line: provenance.ownerLine } : {}),
|
|
66
|
+
...(provenance.ownerColumn
|
|
67
|
+
? { column: provenance.ownerColumn }
|
|
68
|
+
: {}),
|
|
69
|
+
...(provenance.ownerComponentName
|
|
70
|
+
? { componentName: provenance.ownerComponentName }
|
|
71
|
+
: {}),
|
|
72
|
+
...(provenance.ownerKey ? { key: provenance.ownerKey } : {}),
|
|
73
|
+
...(provenance.ownerMethod
|
|
74
|
+
? { method: provenance.ownerMethod }
|
|
75
|
+
: {}),
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
: {}),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function inspectCodeDataForElement(
|
|
83
|
+
element: InspectableElement,
|
|
84
|
+
html: string | null | undefined,
|
|
85
|
+
) {
|
|
86
|
+
return {
|
|
87
|
+
html,
|
|
88
|
+
tagName: element.tagName,
|
|
89
|
+
id: element.id,
|
|
90
|
+
classes: element.classes,
|
|
91
|
+
sourceLocation: inspectCodeSourceLocation(element.provenance),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { injectDocumentMarkup } from "@agent-native/core/shared";
|
|
2
|
+
|
|
1
3
|
import type { FrameGeometry } from "./types";
|
|
2
4
|
|
|
3
5
|
export function hasBoardSurfaceContent(html: string | undefined) {
|
|
@@ -322,8 +324,8 @@ export function getBoardSurfaceStaticPreviewContent(args: {
|
|
|
322
324
|
const offsetX = -args.logicalGeometry.x;
|
|
323
325
|
const offsetY = -args.logicalGeometry.y;
|
|
324
326
|
const style = `<style data-agent-native-board-static-preview>*,*::before,*::after{animation:none!important;animation-delay:0s!important;transition:none!important;caret-color:transparent!important;}html{width:${viewportWidth}px!important;height:${viewportHeight}px!important;overflow:hidden!important;}body{margin:0!important;width:${width}px!important;height:${height}px!important;overflow:visible!important;transform:scale(${scale})!important;transform-origin:0 0!important;}body>[data-agent-native-node-id]{translate:${offsetX}px ${offsetY}px!important;}</style>`;
|
|
325
|
-
if (/<\/head
|
|
326
|
-
return renderHtml
|
|
327
|
+
if (/<\/head\s*>/i.test(renderHtml)) {
|
|
328
|
+
return injectDocumentMarkup(renderHtml, style, { target: "head" });
|
|
327
329
|
}
|
|
328
330
|
if (/<body\b/i.test(renderHtml)) {
|
|
329
331
|
return renderHtml.replace(/<body\b/i, `${style}<body`);
|
|
@@ -28,6 +28,41 @@ export function isPortableStyleSnapshot(
|
|
|
28
28
|
return snapshot.version === 1 && Array.isArray(snapshot.nodes);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
export function captureCrossScreenSourceHtmlSnapshot(
|
|
32
|
+
sourceDocument: Document | null,
|
|
33
|
+
sourceNodeId: string | undefined,
|
|
34
|
+
): string | undefined {
|
|
35
|
+
if (!sourceDocument || !sourceNodeId) return undefined;
|
|
36
|
+
const matches = sourceDocument.querySelectorAll(
|
|
37
|
+
`[data-agent-native-node-id="${CSS.escape(sourceNodeId)}"]`,
|
|
38
|
+
);
|
|
39
|
+
if (matches.length !== 1) return undefined;
|
|
40
|
+
return matches.item(0)?.outerHTML;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function validateCrossScreenSourceHtmlSnapshot(
|
|
44
|
+
snapshot: string,
|
|
45
|
+
sourceNodeId: string,
|
|
46
|
+
): string | undefined {
|
|
47
|
+
if (typeof document === "undefined") return undefined;
|
|
48
|
+
const template = document.createElement("template");
|
|
49
|
+
template.innerHTML = snapshot.trim();
|
|
50
|
+
const meaningfulNodes = Array.from(template.content.childNodes).filter(
|
|
51
|
+
(node) => node.nodeType !== Node.TEXT_NODE || node.textContent?.trim(),
|
|
52
|
+
);
|
|
53
|
+
if (
|
|
54
|
+
meaningfulNodes.length !== 1 ||
|
|
55
|
+
meaningfulNodes[0]?.nodeType !== Node.ELEMENT_NODE
|
|
56
|
+
) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
const root = meaningfulNodes[0] as Element;
|
|
60
|
+
if (root.getAttribute("data-agent-native-node-id") !== sourceNodeId) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
return root.outerHTML;
|
|
64
|
+
}
|
|
65
|
+
|
|
31
66
|
export function isCrossScreenDropPlacement(
|
|
32
67
|
value: unknown,
|
|
33
68
|
): value is CrossScreenDropPlacement {
|
|
@@ -19,6 +19,30 @@ export function isBreakpointSelectionTarget(screen: {
|
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Whether the screen's own frame-level SelectionBox (corner/rotate handles +
|
|
24
|
+
* outline sized to the whole screen) should be suppressed because a MORE
|
|
25
|
+
* specific target already owns the selection chrome — either one of the
|
|
26
|
+
* screen's breakpoint sub-frames (existing BP-DEEP v2 case), or a specific
|
|
27
|
+
* element inside the screen (Layers-panel row, in-canvas click resolving to
|
|
28
|
+
* a node). The editor-chrome bridge inside the iframe already renders a
|
|
29
|
+
* correctly-fitted outline + resize handles for that element; drawing the
|
|
30
|
+
* frame-sized box on top of it is wrong, not just redundant — it always
|
|
31
|
+
* spans the whole screen regardless of what's actually selected.
|
|
32
|
+
*/
|
|
33
|
+
export function shouldSuppressFrameSelectionBox(
|
|
34
|
+
screen: {
|
|
35
|
+
id: string;
|
|
36
|
+
breakpointWidths?: number[];
|
|
37
|
+
activeBreakpointWidth?: number;
|
|
38
|
+
},
|
|
39
|
+
selectedElementScreenId: string | null | undefined,
|
|
40
|
+
): boolean {
|
|
41
|
+
return (
|
|
42
|
+
isBreakpointSelectionTarget(screen) || selectedElementScreenId === screen.id
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
22
46
|
export function getActiveScreenIframeId(screen: {
|
|
23
47
|
id: string;
|
|
24
48
|
activeBreakpointWidth?: number;
|
|
@@ -124,6 +124,13 @@ export interface MultiScreenCanvasProps {
|
|
|
124
124
|
zoom: number;
|
|
125
125
|
activeId?: string | null;
|
|
126
126
|
selectedScreenIds?: string[];
|
|
127
|
+
/** Screen id whose active selection is a specific element INSIDE the
|
|
128
|
+
* screen (a Layers-panel row, an in-canvas click) rather than the screen
|
|
129
|
+
* frame itself. The frame's own SelectionBox is suppressed for this
|
|
130
|
+
* screen — the iframe's editor-chrome bridge already draws a tightly
|
|
131
|
+
* fitted outline + resize handles around the real element, so drawing the
|
|
132
|
+
* frame-sized box on top of it would be wrong, not just redundant. */
|
|
133
|
+
selectedElementScreenId?: string | null;
|
|
127
134
|
/** Hidden screen/file rows retain geometry but do not render or participate
|
|
128
135
|
* in overview hit testing, fit, or selection until shown again. */
|
|
129
136
|
hiddenScreenIds?: ReadonlySet<string> | readonly string[];
|
|
@@ -294,6 +301,8 @@ export interface MultiScreenCanvasProps {
|
|
|
294
301
|
targetLocalPoint?: Point;
|
|
295
302
|
/** Pointer offset from the dragged element's top-left in source iframe px. */
|
|
296
303
|
sourcePointerOffset?: Point;
|
|
304
|
+
/** Host-captured HTML for a board root, including its current DOM subtree. */
|
|
305
|
+
sourceHtmlSnapshot?: string;
|
|
297
306
|
/** Portable computed styles captured in the source iframe before the move. */
|
|
298
307
|
styleSnapshot?: PortableStyleSnapshot;
|
|
299
308
|
}) => void;
|
|
@@ -19,6 +19,23 @@ export interface RuntimeStructureMoveRequest {
|
|
|
19
19
|
placement: "before" | "after" | "inside";
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Insert NEW markup into a live screen's running DOM. Unlike
|
|
24
|
+
* RuntimeStructureMoveRequest there is no subject in the running app yet —
|
|
25
|
+
* the html is the subject, already positioned by the host.
|
|
26
|
+
*/
|
|
27
|
+
export interface RuntimeStructureInsertRequest {
|
|
28
|
+
requestId: number;
|
|
29
|
+
html: string;
|
|
30
|
+
anchor: {
|
|
31
|
+
selector: string;
|
|
32
|
+
sourceId?: string | null;
|
|
33
|
+
/** Hit-test-minted id, live-DOM only. The only handle on an id-less anchor. */
|
|
34
|
+
pendingNodeId?: string | null;
|
|
35
|
+
};
|
|
36
|
+
placement: "before" | "after" | "inside";
|
|
37
|
+
}
|
|
38
|
+
|
|
22
39
|
export interface RuntimeVerificationRequest {
|
|
23
40
|
requestId: number;
|
|
24
41
|
}
|
|
@@ -52,6 +69,18 @@ export interface ElementInfo {
|
|
|
52
69
|
*/
|
|
53
70
|
pendingNodeId?: string;
|
|
54
71
|
selector?: string;
|
|
72
|
+
/**
|
|
73
|
+
* The `selector` / `sourceId` the canvas bridge originally reported, kept
|
|
74
|
+
* verbatim when the host canonicalizes the selection onto its own source
|
|
75
|
+
* projection (canonicalElementInfoForCodeLayerNode). For a live/localhost
|
|
76
|
+
* screen the two are DIFFERENT node-id namespaces — the running document
|
|
77
|
+
* carries the ids the bridge assigned there, the fetched source snapshot
|
|
78
|
+
* carries the ones ensureCodeLayerNodeIdsInHtml stamped — so the canonical
|
|
79
|
+
* selector cannot address the live DOM. Any host-initiated mutation of the
|
|
80
|
+
* running document (currently only delete) must target these instead.
|
|
81
|
+
*/
|
|
82
|
+
runtimeSelector?: string;
|
|
83
|
+
runtimeSourceId?: string;
|
|
55
84
|
classes: string[];
|
|
56
85
|
computedStyles: Record<string, string>;
|
|
57
86
|
/**
|
|
@@ -20,6 +20,10 @@ import { useLocation } from "react-router";
|
|
|
20
20
|
|
|
21
21
|
import { useNavigationState } from "@/hooks/use-navigation-state";
|
|
22
22
|
import { DESIGN_CHAT_STORAGE_KEY } from "@/lib/agent-chat";
|
|
23
|
+
import {
|
|
24
|
+
designEditorRoute,
|
|
25
|
+
isDesignEditorRoute,
|
|
26
|
+
} from "@/lib/design-editor-route";
|
|
23
27
|
import { cn } from "@/lib/utils";
|
|
24
28
|
|
|
25
29
|
import {
|
|
@@ -48,7 +52,7 @@ const BARE_PREFIXES = ["/present/"];
|
|
|
48
52
|
* DesignEditor mode/zoom/device, shared ExtensionViewer / ExtensionsListPage
|
|
49
53
|
* chrome). The editor owns its agent surface inside its Figma-style left rail.
|
|
50
54
|
*/
|
|
51
|
-
const EDITOR_PREFIXES = ["/design/", "/extensions"];
|
|
55
|
+
const EDITOR_PREFIXES = ["/design/", "/visual-edit/", "/extensions"];
|
|
52
56
|
|
|
53
57
|
export function Layout({ children }: LayoutProps) {
|
|
54
58
|
const location = useLocation();
|
|
@@ -59,7 +63,7 @@ export function Layout({ children }: LayoutProps) {
|
|
|
59
63
|
useNavigationState(hasSession);
|
|
60
64
|
const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false);
|
|
61
65
|
const openMobileSidebar = useCallback(() => setMobileSidebarOpen(true), []);
|
|
62
|
-
const isDesignEditor = location.pathname
|
|
66
|
+
const isDesignEditor = isDesignEditorRoute(location.pathname);
|
|
63
67
|
const showMobileTopBar = !isDesignEditor;
|
|
64
68
|
const browserTabId = getBrowserTabId();
|
|
65
69
|
const {
|
|
@@ -72,8 +76,7 @@ export function Layout({ children }: LayoutProps) {
|
|
|
72
76
|
// (which we already short-circuit as BARE). Anywhere else (list,
|
|
73
77
|
// design-systems, settings) leaves scope null so general chats keep working.
|
|
74
78
|
const designScope = useMemo(() => {
|
|
75
|
-
const
|
|
76
|
-
const designId = match?.[1];
|
|
79
|
+
const designId = designEditorRoute(location.pathname)?.designId;
|
|
77
80
|
if (!designId) return null;
|
|
78
81
|
return { type: "design" as const, id: designId };
|
|
79
82
|
}, [location.pathname]);
|
|
@@ -54,6 +54,7 @@ export interface DesignEditorCommand {
|
|
|
54
54
|
designId: string;
|
|
55
55
|
editorView?: "single" | "overview";
|
|
56
56
|
viewMode?: "single" | "overview";
|
|
57
|
+
mode?: "edit" | "annotate" | "interact";
|
|
57
58
|
inspectorTab?: "design" | "comments" | "tweaks" | "code" | "extensions";
|
|
58
59
|
inspector?: "design" | "comments" | "tweaks" | "code" | "extensions";
|
|
59
60
|
leftPanel?:
|
|
@@ -165,6 +166,7 @@ export function editorPathFromCommand(cmd: NavigationState): string | null {
|
|
|
165
166
|
const params = new URLSearchParams();
|
|
166
167
|
const editorView = normalizeEditorView(cmd.editorView);
|
|
167
168
|
if (editorView) params.set("view", editorView);
|
|
169
|
+
if (editorView === "single") params.set("mode", "interact");
|
|
168
170
|
const inspectorTab = normalizeInspectorTab(cmd.inspectorTab ?? cmd.inspector);
|
|
169
171
|
if (inspectorTab) params.set("inspector", inspectorTab);
|
|
170
172
|
const leftPanel = normalizeLeftPanel(cmd.leftPanel ?? cmd.panel);
|
|
@@ -200,6 +202,7 @@ export function editorCommandFromNavigate(
|
|
|
200
202
|
path,
|
|
201
203
|
};
|
|
202
204
|
if (editorView) command.editorView = editorView;
|
|
205
|
+
if (editorView === "single") command.mode = "interact";
|
|
203
206
|
if (inspectorTab) command.inspectorTab = inspectorTab;
|
|
204
207
|
if (leftPanel) command.leftPanel = leftPanel;
|
|
205
208
|
if (cmd.fileId) command.fileId = cmd.fileId;
|