@agent-native/core 0.80.7 → 0.80.9

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.
Files changed (302) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +18 -0
  3. package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +6 -0
  4. package/corpus/core/docs/content/locales/de-DE/template-design.mdx +8 -0
  5. package/corpus/core/docs/content/locales/es-ES/template-design.mdx +10 -2
  6. package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +10 -2
  7. package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +7 -0
  8. package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +7 -0
  9. package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +7 -0
  10. package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +9 -2
  11. package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +6 -0
  12. package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +6 -0
  13. package/corpus/core/docs/content/template-design.mdx +9 -2
  14. package/corpus/core/package.json +1 -1
  15. package/corpus/core/src/cli/mcp.ts +10 -0
  16. package/corpus/core/src/cli/skills.ts +58 -12
  17. package/corpus/core/src/client/AssistantChat.tsx +70 -27
  18. package/corpus/core/src/client/analytics.ts +3 -1
  19. package/corpus/core/src/client/error-format.ts +25 -0
  20. package/corpus/core/src/client/extensions/ExtensionViewer.tsx +13 -11
  21. package/corpus/core/src/client/guided-questions.tsx +32 -4
  22. package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +33 -1
  23. package/corpus/core/src/client/resources/BuiltinCapabilityDetail.tsx +8 -0
  24. package/corpus/core/src/client/resources/use-builtin-capabilities.ts +4 -2
  25. package/corpus/core/src/client/session-replay.ts +34 -0
  26. package/corpus/core/src/client/sharing/ShareButton.tsx +106 -21
  27. package/corpus/core/src/coding-tools/index.ts +1 -1
  28. package/corpus/core/src/mcp/index.ts +2 -0
  29. package/corpus/core/src/mcp/screen-memory-stdio.ts +290 -0
  30. package/corpus/core/src/mcp-client/builtin-capabilities.ts +13 -1
  31. package/corpus/core/src/mcp-client/index.ts +9 -0
  32. package/corpus/core/src/mcp-client/screen-memory-local.ts +461 -0
  33. package/corpus/core/src/onboarding/types.ts +7 -0
  34. package/corpus/core/src/server/agent-chat-plugin.ts +25 -0
  35. package/corpus/core/src/server/agents-bundle.ts +35 -7
  36. package/corpus/core/src/styles/agent-native.css +5 -0
  37. package/corpus/core/src/templates/default/app/global.css +35 -35
  38. package/corpus/templates/analytics/AGENTS.md +6 -0
  39. package/corpus/templates/analytics/actions/github-repo-files.ts +9 -0
  40. package/corpus/templates/analytics/app/components/layout/Layout.tsx +4 -4
  41. package/corpus/templates/analytics/app/global.css +144 -40
  42. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +1 -1
  43. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +1 -1
  44. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
  45. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +4 -4
  46. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +9 -9
  47. package/corpus/templates/analytics/changelog/2026-06-29-agents-can-search-and-read-connected-github-repositories-whe.md +6 -0
  48. package/corpus/templates/analytics/changelog/2026-06-29-sessions-and-explorer-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
  49. package/corpus/templates/assets/app/components/layout/Layout.tsx +3 -1
  50. package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +1 -1
  51. package/corpus/templates/assets/app/global.css +99 -35
  52. package/corpus/templates/assets/app/routes/asset.$id.tsx +2 -2
  53. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +4 -4
  54. package/corpus/templates/assets/app/routes/library.tsx +4 -4
  55. package/corpus/templates/assets/changelog/2026-06-29-asset-library-and-detail-layouts-adapt-when-the-agent-sidebar.md +6 -0
  56. package/corpus/templates/brain/app/components/layout/Layout.tsx +1 -1
  57. package/corpus/templates/brain/app/global.css +63 -35
  58. package/corpus/templates/brain/app/routes/search.tsx +1 -1
  59. package/corpus/templates/brain/app/routes/settings.tsx +1 -1
  60. package/corpus/templates/brain/app/routes/sources.tsx +2 -2
  61. package/corpus/templates/brain/changelog/2026-06-29-search-settings-and-source-layouts-adapt-when-the-agent-sidebar.md +6 -0
  62. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +4 -4
  63. package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +3 -2
  64. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +4 -2
  65. package/corpus/templates/calendar/app/global.css +69 -35
  66. package/corpus/templates/calendar/changelog/2026-06-29-event-and-find-time-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
  67. package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -1
  68. package/corpus/templates/chat/app/global.css +35 -35
  69. package/corpus/templates/chat/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  70. package/corpus/templates/clips/AGENTS.md +13 -0
  71. package/corpus/templates/clips/actions/get-screen-memory-status.ts +12 -0
  72. package/corpus/templates/clips/actions/query-screen-memory-context.ts +29 -0
  73. package/corpus/templates/clips/actions/view-screen.ts +2 -2
  74. package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
  75. package/corpus/templates/clips/app/global.css +47 -35
  76. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +3 -3
  77. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +45 -18
  78. package/corpus/templates/clips/changelog/2026-06-29-meeting-detail-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  79. package/corpus/templates/clips/changelog/2026-06-29-screen-memory-keeps-a-local-rolling-screen-buffer-for-agent-context.md +5 -0
  80. package/corpus/templates/clips/changelog/2026-06-29-video-chat-is-easier-to-find-on-recording-pages-and-s3-setup.md +6 -0
  81. package/corpus/templates/clips/chrome-extension/src/styles.css +39 -39
  82. package/corpus/templates/clips/desktop/src/app.tsx +290 -1
  83. package/corpus/templates/clips/desktop/src/shared/config.ts +83 -0
  84. package/corpus/templates/clips/desktop/src/styles.css +67 -52
  85. package/corpus/templates/clips/desktop/src-tauri/src/config.rs +50 -0
  86. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +17 -0
  87. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +13 -13
  88. package/corpus/templates/clips/desktop/src-tauri/src/screen_memory.rs +990 -0
  89. package/corpus/templates/clips/server/plugins/onboarding.ts +2 -0
  90. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +69 -16
  91. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +3 -3
  92. package/corpus/templates/content/app/components/layout/Layout.tsx +1 -1
  93. package/corpus/templates/content/app/global.css +29 -15
  94. package/corpus/templates/content/changelog/2026-06-29-database-gallery-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  95. package/corpus/templates/content/changelog/2026-06-29-read-only-pages-no-longer-try-to-autosave-or-open-editor-onl.md +6 -0
  96. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +25 -20
  97. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +8 -0
  98. package/corpus/templates/design/.agents/skills/export-handoff/SKILL.md +8 -0
  99. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +13 -0
  100. package/corpus/templates/design/AGENTS.md +24 -14
  101. package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1054 -0
  102. package/corpus/templates/design/actions/apply-visual-edit.ts +24 -4
  103. package/corpus/templates/design/actions/edit-design.ts +6 -3
  104. package/corpus/templates/design/actions/export-coding-handoff.ts +12 -4
  105. package/corpus/templates/design/actions/generate-design.ts +6 -21
  106. package/corpus/templates/design/actions/generate-screens.ts +48 -5
  107. package/corpus/templates/design/actions/get-design.ts +1 -0
  108. package/corpus/templates/design/actions/present-design-variants.ts +355 -30
  109. package/corpus/templates/design/actions/update-design.ts +47 -10
  110. package/corpus/templates/design/actions/update-file.ts +33 -8
  111. package/corpus/templates/design/actions/view-screen.ts +89 -31
  112. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +389 -71
  113. package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +1 -1
  114. package/corpus/templates/design/app/components/design/EditPanel.tsx +596 -95
  115. package/corpus/templates/design/app/components/design/LayersPanel.tsx +428 -221
  116. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1197 -228
  117. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +94 -217
  118. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +28 -14
  119. package/corpus/templates/design/app/components/design/index.ts +0 -1
  120. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +228 -170
  121. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +140 -13
  122. package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +39 -8
  123. package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +4 -2
  124. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +75 -5
  125. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +37 -12
  126. package/corpus/templates/design/app/components/design/inspector/index.ts +1 -0
  127. package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +17 -4
  128. package/corpus/templates/design/app/components/design/types.ts +9 -0
  129. package/corpus/templates/design/app/components/layout/Layout.tsx +23 -5
  130. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +448 -259
  131. package/corpus/templates/design/app/global.css +77 -49
  132. package/corpus/templates/design/app/hooks/use-question-flow.ts +2 -2
  133. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +8 -1
  134. package/corpus/templates/design/app/i18n/zh-TW.ts +4 -0
  135. package/corpus/templates/design/app/i18n-data.ts +55 -3
  136. package/corpus/templates/design/app/pages/DesignEditor.tsx +2783 -658
  137. package/corpus/templates/design/app/root.tsx +1 -1
  138. package/corpus/templates/design/changelog/2026-06-29-agent-edits-to-a-design-are-no-longer-occasionally-dropped-o.md +6 -0
  139. package/corpus/templates/design/changelog/2026-06-29-box-shadow-and-gradient-colors-keep-named-css-colors-like-re.md +6 -0
  140. package/corpus/templates/design/changelog/2026-06-29-containers-no-longer-block-selecting-nested-elements-and-nor.md +6 -0
  141. package/corpus/templates/design/changelog/2026-06-29-cut-cmd-ctrl-x-now-removes-the-selected-element-to-the-clipb.md +6 -0
  142. package/corpus/templates/design/changelog/2026-06-29-deleting-with-multiple-layers-selected-in-the-layers-panel-n.md +6 -0
  143. package/corpus/templates/design/changelog/2026-06-29-design-agents-now-generate-and-refine-variants-from-stronger.md +6 -0
  144. package/corpus/templates/design/changelog/2026-06-29-design-inspector-controls-now-match-figmas-softer-dark-chrome.md +6 -0
  145. package/corpus/templates/design/changelog/2026-06-29-design-questions-now-appear-as-a-cleaner-canvas-intake-with-.md +6 -0
  146. package/corpus/templates/design/changelog/2026-06-29-design-variant-directions-now-appear-as-board-screens-with-chat-buttons.md +5 -0
  147. package/corpus/templates/design/changelog/2026-06-29-duplicating-a-screen-now-gives-the-copy-its-own-layer-ids-so.md +6 -0
  148. package/corpus/templates/design/changelog/2026-06-29-element-selection-no-longer-snaps-back-to-the-previous-layer.md +6 -0
  149. package/corpus/templates/design/changelog/2026-06-29-frame-resize-measurements-now-stay-beside-the-cursor-while-d.md +6 -0
  150. package/corpus/templates/design/changelog/2026-06-29-hiding-and-re-showing-a-gradient-fill-now-preserves-each-sto.md +6 -0
  151. package/corpus/templates/design/changelog/2026-06-29-inspector-number-fields-have-cleaner-tooltips-and-draggable-.md +6 -0
  152. package/corpus/templates/design/changelog/2026-06-29-layer-locking-layer-nesting-generated-question-intake-and-im.md +6 -0
  153. package/corpus/templates/design/changelog/2026-06-29-layer-names-in-the-sidebar-can-scroll-horizontally-instead-o.md +6 -0
  154. package/corpus/templates/design/changelog/2026-06-29-layer-nesting-in-the-sidebar-now-uses-tighter-spacing-so-nam.md +6 -0
  155. package/corpus/templates/design/changelog/2026-06-29-layers-no-longer-repeat-document-wrapper-rows-when-a-screen-.md +6 -0
  156. package/corpus/templates/design/changelog/2026-06-29-overview-previews-now-keep-element-hover-and-selection-tied-.md +6 -0
  157. package/corpus/templates/design/changelog/2026-06-29-picking-a-design-direction-now-submits-to-the-agent-right-aw.md +6 -0
  158. package/corpus/templates/design/changelog/2026-06-29-pressing-escape-now-cancels-a-stuck-screen-drag-in-the-overv.md +6 -0
  159. package/corpus/templates/design/changelog/2026-06-29-screen-overview-is-easier-to-find-and-named-screens-open-dir.md +6 -0
  160. package/corpus/templates/design/changelog/2026-06-29-screen-overview-only-highlights-screens-when-the-frame-or-ti.md +6 -0
  161. package/corpus/templates/design/changelog/2026-06-29-screen-overview-previews-now-resize-to-match-the-selected-de.md +6 -0
  162. package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-now-uses-a-pointer-cursor-instead-.md +6 -0
  163. package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-outlines-now-stay-locked-to-the-se.md +6 -0
  164. package/corpus/templates/design/changelog/2026-06-29-screen-overview-zoom-now-reports-real-screen-scale-separatel.md +6 -0
  165. package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-feels-smoother-and-selection-outline.md +6 -0
  166. package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-now-stays-on-the-overview-canvas-ins.md +6 -0
  167. package/corpus/templates/design/changelog/2026-06-29-selecting-a-nested-layer-from-all-screens-now-keeps-you-in-a.md +6 -0
  168. package/corpus/templates/design/changelog/2026-06-29-share-now-groups-link-sharing-exports-and-agent-handoff.md +6 -0
  169. package/corpus/templates/design/changelog/2026-06-29-style-changes-that-set-several-properties-at-once-fixed-size.md +6 -0
  170. package/corpus/templates/design/changelog/2026-06-29-the-design-editor-loading-skeleton-now-uses-a-softer-charcoa.md +6 -0
  171. package/corpus/templates/design/changelog/2026-06-29-the-device-preview-menu-now-sits-next-to-the-preview-button-.md +6 -0
  172. package/corpus/templates/design/changelog/2026-06-29-the-editor-no-longer-crashes-when-a-screen-ends-up-with-dupl.md +6 -0
  173. package/corpus/templates/design/changelog/2026-06-29-the-inspector-stays-read-only-while-an-empty-design-is-still.md +6 -0
  174. package/corpus/templates/design/changelog/2026-06-29-the-missing-design-view-now-matches-the-rest-of-the-editor-c.md +6 -0
  175. package/corpus/templates/design/changelog/2026-06-29-the-pen-tool-icon-and-tool-option-menus-better-match-the-edi.md +6 -0
  176. package/corpus/templates/design/changelog/2026-06-29-typography-controls-now-keep-the-font-name-visible-and-move-.md +6 -0
  177. package/corpus/templates/design/e2e/README.md +4 -3
  178. package/corpus/templates/design/e2e/global-setup.ts +24 -23
  179. package/corpus/templates/design/e2e/helpers.ts +122 -11
  180. package/corpus/templates/design/playwright.config.ts +19 -4
  181. package/corpus/templates/design/server/lib/coding-handoff.ts +126 -2
  182. package/corpus/templates/design/server/plugins/core-routes.ts +1 -2
  183. package/corpus/templates/design/server/routes/api/design-handoff/[id].zip.get.ts +86 -0
  184. package/corpus/templates/design/shared/code-layer.ts +125 -22
  185. package/corpus/templates/design/shared/color-utils.ts +159 -0
  186. package/corpus/templates/design/shared/generation-session.ts +42 -0
  187. package/corpus/templates/dispatch/app/global.css +79 -35
  188. package/corpus/templates/dispatch/app/routes/integrations.tsx +8 -7
  189. package/corpus/templates/dispatch/changelog/2026-06-29-integration-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  190. package/corpus/templates/forms/app/components/layout/Layout.tsx +6 -2
  191. package/corpus/templates/forms/app/global.css +64 -35
  192. package/corpus/templates/forms/app/pages/FormsListPage.tsx +2 -2
  193. package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +3 -3
  194. package/corpus/templates/forms/changelog/2026-06-29-form-list-and-insight-layouts-adapt-when-the-agent-sidebar.md +6 -0
  195. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +3 -1
  196. package/corpus/templates/macros/app/global.css +25 -9
  197. package/corpus/templates/macros/changelog/2026-06-29-macro-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  198. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -2
  199. package/corpus/templates/mail/app/global.css +42 -36
  200. package/corpus/templates/mail/app/pages/InboxPage.tsx +1 -1
  201. package/corpus/templates/mail/changelog/2026-06-29-the-contact-panel-now-adapts-to-the-available-mail-pane-width.md +6 -0
  202. package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -1
  203. package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +6 -7
  204. package/corpus/templates/plan/app/global.css +74 -42
  205. package/corpus/templates/plan/changelog/2026-06-29-plan-document-blocks-adapt-to-the-available-document-width.md +6 -0
  206. package/corpus/templates/plan/changelog/2026-06-29-plan-titles-and-summaries-can-be-edited-inline-without-focus.md +6 -0
  207. package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -1
  208. package/corpus/templates/slides/app/global.css +49 -33
  209. package/corpus/templates/slides/changelog/2026-06-29-slide-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  210. package/corpus/templates/videos/app/components/layout/Layout.tsx +3 -1
  211. package/corpus/templates/videos/app/global.css +35 -35
  212. package/corpus/templates/videos/changelog/2026-06-29-video-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  213. package/dist/cli/mcp.d.ts.map +1 -1
  214. package/dist/cli/mcp.js +10 -0
  215. package/dist/cli/mcp.js.map +1 -1
  216. package/dist/cli/skills.d.ts.map +1 -1
  217. package/dist/cli/skills.js +58 -12
  218. package/dist/cli/skills.js.map +1 -1
  219. package/dist/client/AssistantChat.d.ts.map +1 -1
  220. package/dist/client/AssistantChat.js +54 -24
  221. package/dist/client/AssistantChat.js.map +1 -1
  222. package/dist/client/analytics.d.ts.map +1 -1
  223. package/dist/client/analytics.js +2 -1
  224. package/dist/client/analytics.js.map +1 -1
  225. package/dist/client/error-format.d.ts.map +1 -1
  226. package/dist/client/error-format.js +17 -0
  227. package/dist/client/error-format.js.map +1 -1
  228. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  229. package/dist/client/extensions/ExtensionViewer.js +3 -4
  230. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  231. package/dist/client/guided-questions.d.ts +4 -0
  232. package/dist/client/guided-questions.d.ts.map +1 -1
  233. package/dist/client/guided-questions.js +16 -7
  234. package/dist/client/guided-questions.js.map +1 -1
  235. package/dist/client/onboarding/OnboardingPanel.js +26 -1
  236. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  237. package/dist/client/resources/BuiltinCapabilityDetail.d.ts.map +1 -1
  238. package/dist/client/resources/BuiltinCapabilityDetail.js +1 -1
  239. package/dist/client/resources/BuiltinCapabilityDetail.js.map +1 -1
  240. package/dist/client/resources/use-builtin-capabilities.d.ts +1 -1
  241. package/dist/client/resources/use-builtin-capabilities.d.ts.map +1 -1
  242. package/dist/client/resources/use-builtin-capabilities.js +2 -1
  243. package/dist/client/resources/use-builtin-capabilities.js.map +1 -1
  244. package/dist/client/session-replay.d.ts.map +1 -1
  245. package/dist/client/session-replay.js +31 -0
  246. package/dist/client/session-replay.js.map +1 -1
  247. package/dist/client/sharing/ShareButton.d.ts +14 -0
  248. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  249. package/dist/client/sharing/ShareButton.js +36 -7
  250. package/dist/client/sharing/ShareButton.js.map +1 -1
  251. package/dist/coding-tools/index.js +1 -1
  252. package/dist/coding-tools/index.js.map +1 -1
  253. package/dist/collab/routes.d.ts +1 -1
  254. package/dist/mcp/index.d.ts +2 -0
  255. package/dist/mcp/index.d.ts.map +1 -1
  256. package/dist/mcp/index.js +1 -0
  257. package/dist/mcp/index.js.map +1 -1
  258. package/dist/mcp/screen-memory-stdio.d.ts +6 -0
  259. package/dist/mcp/screen-memory-stdio.d.ts.map +1 -0
  260. package/dist/mcp/screen-memory-stdio.js +213 -0
  261. package/dist/mcp/screen-memory-stdio.js.map +1 -0
  262. package/dist/mcp-client/builtin-capabilities.d.ts +1 -1
  263. package/dist/mcp-client/builtin-capabilities.d.ts.map +1 -1
  264. package/dist/mcp-client/builtin-capabilities.js +10 -0
  265. package/dist/mcp-client/builtin-capabilities.js.map +1 -1
  266. package/dist/mcp-client/index.d.ts +1 -0
  267. package/dist/mcp-client/index.d.ts.map +1 -1
  268. package/dist/mcp-client/index.js +1 -0
  269. package/dist/mcp-client/index.js.map +1 -1
  270. package/dist/mcp-client/screen-memory-local.d.ts +61 -0
  271. package/dist/mcp-client/screen-memory-local.d.ts.map +1 -0
  272. package/dist/mcp-client/screen-memory-local.js +336 -0
  273. package/dist/mcp-client/screen-memory-local.js.map +1 -0
  274. package/dist/onboarding/types.d.ts +7 -0
  275. package/dist/onboarding/types.d.ts.map +1 -1
  276. package/dist/onboarding/types.js.map +1 -1
  277. package/dist/resources/handlers.d.ts +2 -2
  278. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  279. package/dist/server/agent-chat-plugin.js +26 -0
  280. package/dist/server/agent-chat-plugin.js.map +1 -1
  281. package/dist/server/agents-bundle.d.ts.map +1 -1
  282. package/dist/server/agents-bundle.js +22 -7
  283. package/dist/server/agents-bundle.js.map +1 -1
  284. package/dist/server/transcribe-voice.d.ts +1 -1
  285. package/dist/styles/agent-native.css +5 -0
  286. package/dist/templates/default/app/global.css +35 -35
  287. package/docs/content/locales/ar-SA/template-design.mdx +6 -0
  288. package/docs/content/locales/de-DE/template-design.mdx +8 -0
  289. package/docs/content/locales/es-ES/template-design.mdx +10 -2
  290. package/docs/content/locales/fr-FR/template-design.mdx +10 -2
  291. package/docs/content/locales/hi-IN/template-design.mdx +7 -0
  292. package/docs/content/locales/ja-JP/template-design.mdx +7 -0
  293. package/docs/content/locales/ko-KR/template-design.mdx +7 -0
  294. package/docs/content/locales/pt-BR/template-design.mdx +9 -2
  295. package/docs/content/locales/zh-CN/template-design.mdx +6 -0
  296. package/docs/content/locales/zh-TW/template-design.mdx +6 -0
  297. package/docs/content/template-design.mdx +9 -2
  298. package/package.json +1 -1
  299. package/src/templates/default/app/global.css +35 -35
  300. package/corpus/templates/design/app/components/design/VariantGrid.tsx +0 -189
  301. package/corpus/templates/design/app/components/design/VariantHandoffCard.tsx +0 -115
  302. package/corpus/templates/design/app/hooks/use-variant-flow.ts +0 -258
@@ -92,7 +92,7 @@ function DbSyncSetup() {
92
92
  const qc = useQueryClient();
93
93
  useDbSync({
94
94
  queryClient: qc,
95
- queryKeys: ["designs", "design-systems", "design-files", "design-variants"],
95
+ queryKeys: ["designs", "design-systems", "design-files"],
96
96
  ignoreSource: getBrowserTabId(),
97
97
  });
98
98
  return null;
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Agent edits to a design are no longer occasionally dropped or corrupted when local and agent changes overlap.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Box-shadow and gradient colors keep named CSS colors (like red or navy) when edited, instead of resetting to black; the eyedropper now updates the selected gradient stop instead of replacing the whole gradient.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Containers no longer block selecting nested elements, and normal flow hides unavailable alignment and gap controls.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Cut (Cmd/Ctrl+X) now removes the selected element to the clipboard; pasting repeatedly cascades the copies instead of stacking them exactly on top.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Deleting with multiple layers selected in the Layers panel now removes all of them, not just the focused one.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Design agents now generate and refine variants from stronger product-grounded design guidance.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Design inspector controls now match Figma's softer dark chrome more closely.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Design questions now appear as a cleaner canvas intake with a chat waiting note.
@@ -0,0 +1,5 @@
1
+ ---
2
+ type: improved
3
+ ---
4
+
5
+ Design variant directions now appear as regular overview-board screens with one-click chat buttons for choosing which screen to keep.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Duplicating a screen now gives the copy its own layer ids, so selecting a layer in one screen no longer affects the other.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Element selection no longer snaps back to the previous layer after selecting or pressing Escape.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Frame resize measurements now stay beside the cursor while dragging.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Hiding and re-showing a gradient fill now preserves each stop's opacity instead of flattening them.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Inspector number fields have cleaner tooltips and draggable scrub handles.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Layer locking, layer nesting, generated-question intake, and image-fill visibility behave more reliably in the visual editor.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Layer names in the sidebar can scroll horizontally instead of truncating at deep nesting.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Layer nesting in the sidebar now uses tighter spacing so names stay readable.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Layers no longer repeat document wrapper rows when a screen contains malformed HTML.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Overview previews now keep element hover and selection tied to the correct screen.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Picking a design direction now submits to the agent right away and reliably saves, instead of leaving the message sitting unsent in the chat box or firing twice on a double-click.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Pressing Escape now cancels a stuck screen drag in the overview canvas.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Screen overview is easier to find and named screens open directly in full-screen edit mode.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Screen overview only highlights screens when the frame or title is directly hovered.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Screen overview previews now resize to match the selected device.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Design selection now uses a pointer cursor instead of the move cursor.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Screen overview selection outlines now stay locked to screens while selecting or resizing.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Screen overview zoom now reports real screen scale separately from focused-screen zoom.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Screen overview zooming feels much faster and smoother, in-screen elements can be selected directly, and selection chrome stays crisp above overlapping layers.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Screen overview zooming now stays on the overview canvas instead of opening a screen automatically.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Selecting a nested layer from All screens now keeps you in All screens view.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Share now groups link sharing, exports, and agent handoff in one tabbed menu.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Style changes that set several properties at once (fixed-size text, constraints, padding, flip, stroke position) now all save reliably instead of dropping all but the last property.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ The design editor loading skeleton now uses a softer charcoal canvas while designs load.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ The device preview menu now sits beside collaborators in the inspector sidebar.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ The editor no longer crashes when a screen ends up with duplicate or malformed layer ids (e.g. from a bad agent edit); the layer tree is now resilient to it.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ The inspector stays read-only while an empty design is still generating.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ The missing-design view is cleaner and matches the rest of the editor chrome.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ The Pen tool icon and tool option menus better match the editor chrome.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-06-29
4
+ ---
5
+
6
+ Typography controls now keep the font name visible and move text box sizing into a details popover.
@@ -10,6 +10,7 @@ resizing, moving/reparenting, the layers panel, and the iframe bridge.
10
10
  pnpm e2e # headless
11
11
  pnpm e2e:headed # watch it drive a real browser
12
12
  pnpm e2e:ui # Playwright UI mode
13
+ E2E_BROWSER_CHANNEL=chrome pnpm e2e # run the suite in installed Google Chrome
13
14
  ```
14
15
 
15
16
  - `playwright.config.ts` starts its own dev server on **:9333** backed by a
@@ -32,12 +33,12 @@ action endpoints. Both `.auth/` files are gitignored.
32
33
 
33
34
  ## Why the editor needs special handling (the hard-won bits)
34
35
 
35
- The design renders inside a `sandbox="allow-scripts"` iframe with **no
36
- `allow-same-origin`**, and a pointer-capturing shield overlay sits on top. So:
36
+ The design renders inside a sandboxed iframe, and a pointer-capturing shield
37
+ overlay sits on top. So:
37
38
 
38
39
  | Symptom | Wrong approach | Right approach |
39
40
  | ----------------------------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
40
- | Can't read iframe DOM | `iframe.contentDocument` → `null` | `page.frameLocator('iframe').locator(...)` — CDP targets the frame directly |
41
+ | Reaching into iframe DOM | parent-document locators | `page.frameLocator('iframe').locator(...)` — Playwright targets the frame directly and stays stable across sandbox/overlay changes |
41
42
  | Clicks "intercepted by `<div data-agent-native-edit-overlay="shield">`" | normal click (actionability fails) | `.click({ force: true })` — the shield is _meant_ to get the event and drive selection |
42
43
  | Asserting an edit happened | reading iframe state | listen for the bridge's parent `postMessage`s: `element-select`, `element-hover`, `visual-style-change`, `visual-structure-change` (see `installBridge`/`waitForBridge`) |
43
44
  | `page.screenshot()` hangs forever | `page.screenshot()` | `cdpScreenshot()` — CDP `Page.captureScreenshot`, no stability wait (the page never idles; the agent-chat panel polls) |
@@ -18,6 +18,7 @@ export const SEED_TITLE = "E2E Seed Design";
18
18
  const AUTH_DIR = path.join(import.meta.dirname, ".auth");
19
19
  const STATE_PATH = path.join(AUTH_DIR, "state.json");
20
20
  const SEED_PATH = path.join(AUTH_DIR, "seed.json");
21
+ const BROWSER_CHANNEL = process.env.E2E_BROWSER_CHANNEL;
21
22
 
22
23
  /**
23
24
  * Fixture HTML with distinct, text-identifiable elements. Plain inline styles
@@ -33,13 +34,22 @@ export const FIXTURE_HTML = `<!doctype html>
33
34
  </head>
34
35
  <body style="margin:0;font-family:system-ui,sans-serif;background:#0f1115;color:#f4f4f5">
35
36
  <main style="max-width:720px;margin:0 auto;padding:48px 32px;display:flex;flex-direction:column;gap:24px">
36
- <h1 style="font-size:40px;font-weight:800;margin:0">E2E Hero Heading</h1>
37
+ <h1 style="font-size:40px;font-weight:800;margin:0;color:#f4f4f5">E2E Hero Heading</h1>
37
38
  <p style="font-size:18px;line-height:1.6;margin:0;color:#a1a1aa">First fixture paragraph for selection tests.</p>
38
39
  <p style="font-size:18px;line-height:1.6;margin:0;color:#a1a1aa">Second fixture paragraph for selection tests.</p>
39
40
  <div style="display:flex;flex-direction:row;gap:16px">
40
41
  <button style="padding:14px 28px;border-radius:10px;border:0;background:#6366f1;color:#fff;font-size:16px">Alpha Button</button>
41
42
  <button style="padding:14px 28px;border-radius:10px;border:0;background:#22c55e;color:#06240f;font-size:16px">Beta Button</button>
42
43
  </div>
44
+ <div style="padding:8px;border:1px solid #27272a;border-radius:12px">
45
+ <div style="padding:8px;border:1px solid #3f3f46;border-radius:10px">
46
+ <div style="padding:8px;border:1px solid #52525b;border-radius:8px">
47
+ <div style="padding:8px;border:1px solid #71717a;border-radius:6px">
48
+ <button style="padding:10px 18px;border-radius:8px;border:0;background:#f59e0b;color:#111827;font-size:14px">Deep Layer Button</button>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </div>
43
53
  <section style="margin-top:16px;padding:24px;border-radius:14px;background:#1a1d24">
44
54
  <h2 style="font-size:24px;margin:0 0 8px">Fixture Card Title</h2>
45
55
  <p style="margin:0;color:#a1a1aa">Card body text inside a nested container.</p>
@@ -72,28 +82,25 @@ export default async function globalSetup(config: FullConfig) {
72
82
  "http://127.0.0.1:9333";
73
83
  await mkdir(AUTH_DIR, { recursive: true });
74
84
 
75
- const browser = await chromium.launch();
85
+ const browser = await chromium.launch(
86
+ BROWSER_CHANNEL ? { channel: BROWSER_CHANNEL } : {},
87
+ );
76
88
  const context = await browser.newContext();
77
89
  const page = await context.newPage();
78
90
 
79
91
  try {
80
- await page.goto(`${baseURL}/`, { waitUntil: "domcontentloaded" });
92
+ await page.goto(`${baseURL}/_agent-native/sign-in`, {
93
+ waitUntil: "domcontentloaded",
94
+ });
81
95
 
82
96
  const isSignIn = async () => /sign in/i.test(await page.title());
83
97
 
84
98
  if (await isSignIn()) {
85
99
  // Try to create the account; if it already exists, fall back to sign in.
86
- await page.getByRole("textbox", { name: "Email" }).fill(E2E_EMAIL);
87
- await page
88
- .getByRole("textbox", { name: "Password", exact: true })
89
- .fill(E2E_PASSWORD);
90
- const confirm = page.getByRole("textbox", { name: "Confirm password" });
91
- if (await confirm.count()) await confirm.fill(E2E_PASSWORD);
92
- await page
93
- .locator("#signup-form")
94
- .getByRole("button", { name: "Create account" })
95
- .click()
96
- .catch(() => {});
100
+ await page.locator("#s-email").fill(E2E_EMAIL);
101
+ await page.locator("#s-pass").fill(E2E_PASSWORD);
102
+ await page.locator("#s-pass2").fill(E2E_PASSWORD);
103
+ await page.locator("#signup-form button[type='submit']").click();
97
104
  await page.waitForTimeout(2500);
98
105
 
99
106
  if (await isSignIn()) {
@@ -103,15 +110,9 @@ export default async function globalSetup(config: FullConfig) {
103
110
  .first()
104
111
  .click()
105
112
  .catch(() => {});
106
- await page.getByRole("textbox", { name: "Email" }).fill(E2E_EMAIL);
107
- await page
108
- .getByRole("textbox", { name: "Password", exact: true })
109
- .fill(E2E_PASSWORD);
110
- await page
111
- .getByRole("button", { name: /sign in/i })
112
- .last()
113
- .click()
114
- .catch(() => {});
113
+ await page.locator("#l-email").fill(E2E_EMAIL);
114
+ await page.locator("#l-pass").fill(E2E_PASSWORD);
115
+ await page.locator("#login-form button[type='submit']").click();
115
116
  await page.waitForTimeout(2500);
116
117
  }
117
118
  }
@@ -26,7 +26,7 @@ export async function readSeedDesignId(): Promise<string> {
26
26
  }
27
27
 
28
28
  export function designFrame(page: Page): FrameLocator {
29
- return page.frameLocator("iframe");
29
+ return page.frameLocator("iframe[data-design-preview-iframe]");
30
30
  }
31
31
 
32
32
  /** Open the editor for a design and wait for the toolbar + iframe to be ready. */
@@ -35,7 +35,16 @@ export async function gotoEditor(page: Page, designId: string): Promise<void> {
35
35
  await expect(
36
36
  page.getByRole("button", { name: "Move", exact: true }),
37
37
  ).toBeVisible({ timeout: 30_000 });
38
- await expect(page.locator("iframe").first()).toBeVisible();
38
+ await waitForDesignBridgeReady(page);
39
+ }
40
+
41
+ async function waitForDesignBridgeReady(page: Page): Promise<void> {
42
+ await expect(
43
+ page.locator("iframe[data-design-preview-iframe]"),
44
+ ).toBeVisible();
45
+ await expect(
46
+ designFrame(page).locator('[data-agent-native-edit-overlay="shield"]'),
47
+ ).toBeVisible({ timeout: 10_000 });
39
48
  // Wait for the iframe bridge to stamp at least one selectable node.
40
49
  await expect
41
50
  .poll(
@@ -48,14 +57,43 @@ export async function gotoEditor(page: Page, designId: string): Promise<void> {
48
57
  .toBeGreaterThan(0);
49
58
  }
50
59
 
60
+ export async function enterDirectMode(page: Page): Promise<void> {
61
+ const fullView = page.getByRole("button", { name: "Full view", exact: true });
62
+ const fullViewVisible = await fullView
63
+ .first()
64
+ .waitFor({ state: "visible", timeout: 5_000 })
65
+ .then(() => true)
66
+ .catch(() => false);
67
+ if (fullViewVisible) {
68
+ await fullView.first().click();
69
+ await expect(fullView).toHaveCount(0);
70
+ }
71
+ await expect
72
+ .poll(
73
+ async () =>
74
+ (await page.locator("iframe[data-design-preview-iframe]").boundingBox())
75
+ ?.width ?? 0,
76
+ { timeout: 10_000 },
77
+ )
78
+ .toBeGreaterThan(600);
79
+ await waitForDesignBridgeReady(page);
80
+ }
81
+
51
82
  /** Start capturing bridge postMessages on the parent window. */
52
83
  export async function installBridge(page: Page): Promise<void> {
53
84
  await page.evaluate(() => {
54
- (window as any).__bridge = [];
85
+ const win = window as any;
86
+ if (!Array.isArray(win.__bridge)) win.__bridge = [];
87
+ if (win.__bridgeInstalled) return;
88
+ win.__bridgeInstalled = true;
55
89
  window.addEventListener("message", (e: MessageEvent) => {
56
90
  const t = (e.data as any)?.type;
57
- if (typeof t === "string" && /^(element-|visual-)/.test(t)) {
58
- (window as any).__bridge.push(e.data);
91
+ if (
92
+ typeof t === "string" &&
93
+ (/^(element-|visual-)/.test(t) || t === "text-content-change")
94
+ ) {
95
+ if (!Array.isArray(win.__bridge)) win.__bridge = [];
96
+ win.__bridge.push(e.data);
59
97
  }
60
98
  });
61
99
  });
@@ -73,7 +111,9 @@ export async function waitForBridge(
73
111
  ): Promise<any> {
74
112
  const handle = await page.waitForFunction(
75
113
  (t) =>
76
- ((window as any).__bridge ?? []).find((m: any) => m.type === t) ?? null,
114
+ [...((window as any).__bridge ?? [])]
115
+ .reverse()
116
+ .find((m: any) => m.type === t) ?? null,
77
117
  type,
78
118
  { timeout },
79
119
  );
@@ -86,14 +126,85 @@ export async function waitForBridge(
86
126
  * shield overlay (which is what actually drives selection).
87
127
  */
88
128
  export async function selectByText(page: Page, text: string): Promise<any> {
129
+ await enterDirectMode(page);
89
130
  await installBridge(page);
90
131
  await page.evaluate(() => ((window as any).__bridge = []));
132
+ const target = designFrame(page).getByText(text, { exact: false }).first();
133
+ await target.waitFor({ state: "visible", timeout: 8_000 });
134
+ const box = await target.boundingBox();
135
+ if (!box) throw new Error(`no bounding box for "${text}"`);
136
+ await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2);
137
+ let sel: any;
138
+ try {
139
+ sel = await waitForBridge(page, "element-select", 2_000);
140
+ } catch {
141
+ await page.evaluate(() => ((window as any).__bridge = []));
142
+ await dispatchShieldClickByText(page, text);
143
+ sel = await waitForBridge(page, "element-select");
144
+ }
145
+ const payload = sel?.payload ?? sel;
146
+ expect(String(payload?.textContent ?? "")).toContain(text);
147
+ return payload;
148
+ }
149
+
150
+ async function dispatchShieldClickByText(
151
+ page: Page,
152
+ text: string,
153
+ ): Promise<void> {
91
154
  await designFrame(page)
92
- .getByText(text, { exact: false })
93
- .first()
94
- .click({ force: true, timeout: 8_000 });
95
- const sel = await waitForBridge(page, "element-select");
96
- return sel?.payload ?? sel;
155
+ .locator("body")
156
+ .evaluate((_, targetText) => {
157
+ const normalizeText = (element: HTMLElement) =>
158
+ (element.textContent ?? "").replace(/\s+/g, " ").trim();
159
+ const isVisible = (element: HTMLElement) => {
160
+ const rect = element.getBoundingClientRect();
161
+ const styles = window.getComputedStyle(element);
162
+ return (
163
+ rect.width > 0 &&
164
+ rect.height > 0 &&
165
+ styles.display !== "none" &&
166
+ styles.visibility !== "hidden"
167
+ );
168
+ };
169
+ const shield = document.querySelector<HTMLElement>(
170
+ '[data-agent-native-edit-overlay="shield"]',
171
+ );
172
+ const leafCandidates = Array.from(
173
+ document.querySelectorAll<HTMLElement>(
174
+ "h1, h2, h3, h4, h5, h6, p, button, a, label, span, input, textarea",
175
+ ),
176
+ ).filter(isVisible);
177
+ const nodeCandidates = Array.from(
178
+ document.querySelectorAll<HTMLElement>("[data-agent-native-node-id]"),
179
+ ).filter(isVisible);
180
+ const target =
181
+ nodeCandidates.find(
182
+ (element) => normalizeText(element) === targetText,
183
+ ) ??
184
+ leafCandidates.find(
185
+ (element) => normalizeText(element) === targetText,
186
+ ) ??
187
+ nodeCandidates.find((element) =>
188
+ normalizeText(element).includes(targetText),
189
+ ) ??
190
+ leafCandidates.find((element) =>
191
+ normalizeText(element).includes(targetText),
192
+ );
193
+ if (!shield || !target) {
194
+ throw new Error(`unable to dispatch selection for "${targetText}"`);
195
+ }
196
+ const rect = target.getBoundingClientRect();
197
+ shield.dispatchEvent(
198
+ new MouseEvent("click", {
199
+ bubbles: true,
200
+ cancelable: true,
201
+ view: window,
202
+ clientX: rect.left + rect.width / 2,
203
+ clientY: rect.top + rect.height / 2,
204
+ detail: 1,
205
+ }),
206
+ );
207
+ }, text);
97
208
  }
98
209
 
99
210
  /** Number of inputs in the right-hand inspector (proxy for "inspector populated"). */