@agent-native/core 0.92.9 → 0.92.11

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 (345) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +29 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/agent/production-agent.ts +181 -15
  5. package/corpus/core/src/agent/run-manager.ts +31 -4
  6. package/corpus/core/src/agent/run-store.ts +80 -0
  7. package/corpus/core/src/cli/design-connect.ts +433 -151
  8. package/corpus/core/src/cli/skills.ts +14 -0
  9. package/corpus/core/src/client/AssistantChat.tsx +25 -0
  10. package/corpus/core/src/client/MultiTabAssistantChat.tsx +40 -6
  11. package/corpus/core/src/client/agent-chat.ts +165 -1
  12. package/corpus/core/src/client/chat/index.ts +9 -1
  13. package/corpus/core/src/client/extensions/EmbeddedExtension.tsx +38 -2
  14. package/corpus/core/src/client/index.ts +5 -0
  15. package/corpus/core/src/client/rich-markdown-editor/useCollabReconcile.ts +18 -7
  16. package/corpus/core/src/collab/awareness-store.ts +23 -12
  17. package/corpus/core/src/collab/client.ts +16 -5
  18. package/corpus/core/src/collab/index.ts +4 -0
  19. package/corpus/core/src/collab/recent-edits.ts +65 -2
  20. package/corpus/core/src/deploy/build.ts +133 -5
  21. package/corpus/core/src/index.browser.ts +1 -0
  22. package/corpus/core/src/server/agent-chat-plugin.ts +98 -11
  23. package/corpus/core/src/server/builder-design-systems.ts +30 -4
  24. package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +1 -1
  25. package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +12 -6
  26. package/corpus/templates/clips/AGENTS.md +4 -0
  27. package/corpus/templates/clips/actions/create-recording.ts +2 -0
  28. package/corpus/templates/clips/actions/lib/create-recording-schema.ts +5 -3
  29. package/corpus/templates/clips/actions/request-transcript.ts +102 -33
  30. package/corpus/templates/clips/app/components/library/library-grid.tsx +1 -0
  31. package/corpus/templates/clips/app/components/player/share-dialog.tsx +59 -19
  32. package/corpus/templates/clips/app/components/player/transcript-panel.tsx +48 -4
  33. package/corpus/templates/clips/app/components/player/video-player.tsx +17 -12
  34. package/corpus/templates/clips/app/i18n/ar-SA.ts +1 -0
  35. package/corpus/templates/clips/app/i18n/de-DE.ts +1 -0
  36. package/corpus/templates/clips/app/i18n/en-US.ts +1 -0
  37. package/corpus/templates/clips/app/i18n/es-ES.ts +1 -0
  38. package/corpus/templates/clips/app/i18n/fr-FR.ts +1 -0
  39. package/corpus/templates/clips/app/i18n/hi-IN.ts +1 -0
  40. package/corpus/templates/clips/app/i18n/ja-JP.ts +1 -0
  41. package/corpus/templates/clips/app/i18n/ko-KR.ts +1 -0
  42. package/corpus/templates/clips/app/i18n/pt-BR.ts +1 -0
  43. package/corpus/templates/clips/app/i18n/zh-CN.ts +1 -0
  44. package/corpus/templates/clips/app/i18n/zh-TW.ts +1 -0
  45. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +70 -37
  46. package/corpus/templates/clips/app/routes/record.tsx +17 -4
  47. package/corpus/templates/clips/app/routes/share.$shareId.tsx +2 -0
  48. package/corpus/templates/clips/changelog/2026-07-09-desktop-popover-sits-closer-to-the-menu-bar.md +6 -0
  49. package/corpus/templates/clips/changelog/2026-07-09-desktop-recording-optimization-progress-stays-visible-until-the-clip-opens.md +6 -0
  50. package/corpus/templates/clips/changelog/2026-07-09-fixed-large-video-file-uploads-failing-before-their-resumabl.md +6 -0
  51. package/corpus/templates/clips/changelog/2026-07-09-fixed-new-video-uploads-defaulting-to-private.md +6 -0
  52. package/corpus/templates/clips/changelog/2026-07-09-long-recordings-now-get-enough-time-to-download-their-media-.md +6 -0
  53. package/corpus/templates/clips/changelog/2026-07-09-meeting-notes-no-longer-lowers-your-microphone-volume-for-ot.md +6 -0
  54. package/corpus/templates/clips/changelog/2026-07-09-on-mobile-tapping-a-playing-clip-reveals-playback-controls-w.md +6 -0
  55. package/corpus/templates/clips/changelog/2026-07-09-regenerate-any-clip-transcript-from-its-saved-recording-or-r.md +6 -0
  56. package/corpus/templates/clips/changelog/2026-07-09-slack-previews-now-show-the-clip-length-alongside-its-descri.md +6 -0
  57. package/corpus/templates/clips/desktop/src/app.tsx +12 -2
  58. package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +8 -1
  59. package/corpus/templates/clips/desktop/src/lib/recorder.ts +8 -5
  60. package/corpus/templates/clips/desktop/src/lib/transcription-engine.ts +5 -5
  61. package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +3 -0
  62. package/corpus/templates/clips/desktop/src/styles.css +6 -3
  63. package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +29 -11
  64. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1 -1
  65. package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +103 -21
  66. package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +117 -39
  67. package/corpus/templates/clips/server/lib/slack-unfurls.ts +20 -1
  68. package/corpus/templates/clips/server/lib/streaming-upload-mode.ts +10 -4
  69. package/corpus/templates/clips/shared/recording-core.ts +12 -0
  70. package/corpus/templates/content/AGENTS.md +7 -6
  71. package/corpus/templates/content/actions/_document-flush.ts +132 -17
  72. package/corpus/templates/content/actions/_notion-action-utils.ts +15 -0
  73. package/corpus/templates/content/actions/create-and-link-notion-page.ts +2 -0
  74. package/corpus/templates/content/actions/link-notion-page.ts +2 -0
  75. package/corpus/templates/content/actions/pull-document.ts +5 -7
  76. package/corpus/templates/content/actions/pull-notion-page.ts +2 -0
  77. package/corpus/templates/content/actions/push-notion-page.ts +10 -0
  78. package/corpus/templates/content/actions/resolve-notion-sync-conflict.ts +2 -0
  79. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +88 -23
  80. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +32 -2
  81. package/corpus/templates/content/app/hooks/use-notion.ts +6 -6
  82. package/corpus/templates/content/app/i18n/zh-TW.ts +1 -0
  83. package/corpus/templates/content/app/i18n-data.ts +18 -0
  84. package/corpus/templates/content/changelog/2026-07-09-notion-conflict-choices-and-version-restores-preserve-docume.md +6 -0
  85. package/corpus/templates/content/server/lib/notion-sync.ts +80 -64
  86. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +29 -2
  87. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +86 -0
  88. package/corpus/templates/design/.agents/skills/export-handoff/SKILL.md +57 -0
  89. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +11 -0
  90. package/corpus/templates/design/AGENTS.md +45 -10
  91. package/corpus/templates/design/actions/add-localhost-screens.ts +66 -13
  92. package/corpus/templates/design/actions/apply-component-prop-edit.ts +45 -36
  93. package/corpus/templates/design/actions/apply-motion-edit.ts +25 -31
  94. package/corpus/templates/design/actions/apply-shader-fill.ts +29 -42
  95. package/corpus/templates/design/actions/detach-component-instance.ts +337 -0
  96. package/corpus/templates/design/actions/export-design-as-figma-svg.ts +219 -0
  97. package/corpus/templates/design/actions/generate-design.ts +79 -12
  98. package/corpus/templates/design/actions/generate-screens.ts +57 -12
  99. package/corpus/templates/design/actions/get-figma-styles.ts +115 -0
  100. package/corpus/templates/design/actions/go-to-main-component.ts +254 -0
  101. package/corpus/templates/design/actions/grant-localhost-write-consent.ts +4 -3
  102. package/corpus/templates/design/actions/import-design-source.ts +4 -31
  103. package/corpus/templates/design/actions/import-figma-clipboard.ts +134 -0
  104. package/corpus/templates/design/actions/import-figma-frame.ts +95 -0
  105. package/corpus/templates/design/actions/index-design-system-with-builder.ts +16 -1
  106. package/corpus/templates/design/actions/list-design-components.ts +104 -0
  107. package/corpus/templates/design/actions/list-figma-library-assets.ts +1 -24
  108. package/corpus/templates/design/actions/open-component-source.ts +2 -4
  109. package/corpus/templates/design/actions/present-design-variants.ts +412 -16
  110. package/corpus/templates/design/actions/preview-source-edit.ts +14 -1
  111. package/corpus/templates/design/actions/run-design-audit.ts +25 -3
  112. package/corpus/templates/design/actions/show-design-questions.ts +10 -0
  113. package/corpus/templates/design/actions/swap-component-instance.ts +544 -0
  114. package/corpus/templates/design/actions/take-design-screenshot.ts +45 -60
  115. package/corpus/templates/design/actions/write-local-file.ts +25 -1
  116. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +152 -0
  117. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +1077 -58
  118. package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +5 -5
  119. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +73 -21
  120. package/corpus/templates/design/app/components/design/EditPanel.tsx +16 -11
  121. package/corpus/templates/design/app/components/design/KeyboardShortcutsPanel.tsx +364 -0
  122. package/corpus/templates/design/app/components/design/LayersPanel.tsx +180 -53
  123. package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +0 -2
  124. package/corpus/templates/design/app/components/design/MotionDock.tsx +144 -21
  125. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1152 -167
  126. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +27 -5
  127. package/corpus/templates/design/app/components/design/ReviewPanel.tsx +23 -2
  128. package/corpus/templates/design/app/components/design/TokensPanel.tsx +63 -49
  129. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +1293 -54
  130. package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +7 -0
  131. package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +6 -1
  132. package/corpus/templates/design/app/components/design/bridge/motion-preview.bridge.ts +23 -6
  133. package/corpus/templates/design/app/components/design/bridge/sample.bridge.ts +7 -0
  134. package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +5 -0
  135. package/corpus/templates/design/app/components/design/code-workbench/editor/MonacoHost.tsx +14 -2
  136. package/corpus/templates/design/app/components/design/code-workbench/explorer/FileTree.tsx +37 -2
  137. package/corpus/templates/design/app/components/design/code-workbench/format/format-on-open-guard.ts +25 -0
  138. package/corpus/templates/design/app/components/design/code-workbench/format/format-on-open.ts +19 -1
  139. package/corpus/templates/design/app/components/design/code-workbench/model-registry.ts +43 -5
  140. package/corpus/templates/design/app/components/design/code-workbench/search/SearchView.tsx +27 -2
  141. package/corpus/templates/design/app/components/design/code-workbench/search/search-engine.ts +10 -1
  142. package/corpus/templates/design/app/components/design/code-workbench/store.tsx +19 -2
  143. package/corpus/templates/design/app/components/design/design-canvas/annotation-snapshot.ts +265 -0
  144. package/corpus/templates/design/app/components/design/design-canvas/annotation-submit.ts +16 -5
  145. package/corpus/templates/design/app/components/design/design-canvas/coordinate-transforms.ts +16 -2
  146. package/corpus/templates/design/app/components/design/design-canvas/embedded-frame.ts +7 -2
  147. package/corpus/templates/design/app/components/design/design-canvas/iframe-events.ts +3 -1
  148. package/corpus/templates/design/app/components/design/edit-panel/code-inspect-helpers.tsx +78 -8
  149. package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +451 -73
  150. package/corpus/templates/design/app/components/design/edit-panel/document-colors.ts +12 -4
  151. package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +398 -272
  152. package/corpus/templates/design/app/components/design/edit-panel/element-classification.ts +41 -7
  153. package/corpus/templates/design/app/components/design/edit-panel/element-identity.ts +16 -3
  154. package/corpus/templates/design/app/components/design/edit-panel/field-primitives.tsx +24 -4
  155. package/corpus/templates/design/app/components/design/edit-panel/fill-gradient-helpers.ts +222 -4
  156. package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +171 -78
  157. package/corpus/templates/design/app/components/design/edit-panel/inspector-controls.tsx +45 -5
  158. package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +299 -28
  159. package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +120 -150
  160. package/corpus/templates/design/app/components/design/edit-panel/position-helpers.ts +53 -1
  161. package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +284 -117
  162. package/corpus/templates/design/app/components/design/edit-panel/selection-helpers.ts +81 -0
  163. package/corpus/templates/design/app/components/design/edit-panel/stroke-properties.tsx +19 -14
  164. package/corpus/templates/design/app/components/design/edit-panel/style-options.ts +7 -0
  165. package/corpus/templates/design/app/components/design/edit-panel/typography-helpers.ts +155 -0
  166. package/corpus/templates/design/app/components/design/edit-panel/typography-properties.tsx +268 -46
  167. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +350 -31
  168. package/corpus/templates/design/app/components/design/inspector/ConstraintsWidget.tsx +13 -4
  169. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +233 -23
  170. package/corpus/templates/design/app/components/design/inspector/GradientEditor.tsx +72 -2
  171. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +51 -11
  172. package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +84 -11
  173. package/corpus/templates/design/app/components/design/inspector/index.ts +3 -0
  174. package/corpus/templates/design/app/components/design/keyboard-shortcuts.ts +552 -0
  175. package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +157 -0
  176. package/corpus/templates/design/app/components/design/multi-screen/frame-geometry.ts +53 -0
  177. package/corpus/templates/design/app/components/design/multi-screen/overview-layout.ts +184 -0
  178. package/corpus/templates/design/app/components/design/multi-screen/primitive-drop-target.ts +403 -26
  179. package/corpus/templates/design/app/components/design/multi-screen/types.ts +20 -1
  180. package/corpus/templates/design/app/components/design/types.ts +33 -0
  181. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +59 -7
  182. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +119 -17
  183. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +275 -63
  184. package/corpus/templates/design/app/hooks/use-question-flow.ts +14 -3
  185. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +67 -10
  186. package/corpus/templates/design/app/i18n/zh-TW.ts +91 -1
  187. package/corpus/templates/design/app/i18n-data.ts +1217 -10
  188. package/corpus/templates/design/app/i18n-keyboard-shortcuts.ts +577 -0
  189. package/corpus/templates/design/app/lib/agent-chat.ts +23 -0
  190. package/corpus/templates/design/app/lib/design-import.ts +24 -0
  191. package/corpus/templates/design/app/lib/figma-clipboard.ts +157 -0
  192. package/corpus/templates/design/app/lib/figma-svg-copy.ts +221 -0
  193. package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +143 -30
  194. package/corpus/templates/design/app/pages/design-editor/collab-sync.ts +15 -0
  195. package/corpus/templates/design/app/pages/design-editor/editor-session.ts +33 -0
  196. package/corpus/templates/design/app/pages/design-editor/editor-state.ts +38 -0
  197. package/corpus/templates/design/app/pages/design-editor/overview-annotation-context.ts +157 -0
  198. package/corpus/templates/design/app/pages/design-editor/overview-camera.ts +62 -6
  199. package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +245 -0
  200. package/corpus/templates/design/app/pages/design-editor/react-semantic-handoff.ts +586 -0
  201. package/corpus/templates/design/app/pages/design-editor/screen-auto-layout.ts +169 -0
  202. package/corpus/templates/design/app/pages/design-editor/selection-state.ts +201 -1
  203. package/corpus/templates/design/changelog/2026-07-09-added-underline-strikethrough-and-text-case-uppercase-lowerc.md +6 -0
  204. package/corpus/templates/design/changelog/2026-07-09-annotate-now-draws-across-the-all-screens-canvas-without-swi.md +6 -0
  205. package/corpus/templates/design/changelog/2026-07-09-auto-layout-children-can-now-be-dragged-into-freeform-screen.md +6 -0
  206. package/corpus/templates/design/changelog/2026-07-09-board-shapes-now-stay-visible-and-nest-correctly-across-the-.md +6 -0
  207. package/corpus/templates/design/changelog/2026-07-09-component-source-navigation-now-opens-reliably-from-the-insp.md +6 -0
  208. package/corpus/templates/design/changelog/2026-07-09-cross-screen-local-react-layer-moves-now-hand-off-exact-sour.md +6 -0
  209. package/corpus/templates/design/changelog/2026-07-09-cross-screen-moves-undo-and-redo-now-keep-both-screens-stabl.md +6 -0
  210. package/corpus/templates/design/changelog/2026-07-09-detach-a-component-instance-into-plain-editable-eleme.md +6 -0
  211. package/corpus/templates/design/changelog/2026-07-09-dragging-layers-into-auto-layout-now-respects-ignore-auto-la.md +6 -0
  212. package/corpus/templates/design/changelog/2026-07-09-drawing-annotations-sent-to-the-agent-now-include-a-rendered.md +6 -0
  213. package/corpus/templates/design/changelog/2026-07-09-editor-sidebars-now-use-figma-matched-default-widths-for-a-r.md +6 -0
  214. package/corpus/templates/design/changelog/2026-07-09-empty-frames-and-rectangles-now-expose-full-auto-layout-cont.md +6 -0
  215. package/corpus/templates/design/changelog/2026-07-09-export-any-design-screen-as-a-real-vector-svg-for-figma-with.md +6 -0
  216. package/corpus/templates/design/changelog/2026-07-09-grid-auto-layout-now-uses-true-responsive-rows-and-columns-w.md +6 -0
  217. package/corpus/templates/design/changelog/2026-07-09-hidden-and-locked-screens-now-behave-consistently-between-la.md +6 -0
  218. package/corpus/templates/design/changelog/2026-07-09-image-fills-now-preserve-valid-urls-and-layered-fit-settings.md +6 -0
  219. package/corpus/templates/design/changelog/2026-07-09-import-figma-frames-as-pixel-accurate-design-screens-via-a-s.md +6 -0
  220. package/corpus/templates/design/changelog/2026-07-09-inspect-code-now-hides-internal-styling-metadata-and-wraps-l.md +6 -0
  221. package/corpus/templates/design/changelog/2026-07-09-inspector-blur-and-shadow-effects-now-preserve-other-effects.md +6 -0
  222. package/corpus/templates/design/changelog/2026-07-09-jump-to-a-components-other-instances-from-the-inspecto.md +6 -0
  223. package/corpus/templates/design/changelog/2026-07-09-keyboard-shortcuts-are-now-discoverable-in-a-figma-style-bot.md +6 -0
  224. package/corpus/templates/design/changelog/2026-07-09-layer-selection-now-keeps-cmd-or-ctrl-toggles-and-shift-rang.md +6 -0
  225. package/corpus/templates/design/changelog/2026-07-09-layers-dropped-into-auto-layout-now-participate-correctly-in.md +6 -0
  226. package/corpus/templates/design/changelog/2026-07-09-local-live-edit-screens-now-enter-and-leave-full-view-withou.md +6 -0
  227. package/corpus/templates/design/changelog/2026-07-09-local-preview-urls-now-live-in-the-inspector-instead-of-taki.md +6 -0
  228. package/corpus/templates/design/changelog/2026-07-09-local-react-layers-can-now-be-hidden-and-locked-from-layers-.md +6 -0
  229. package/corpus/templates/design/changelog/2026-07-09-local-react-layers-now-keep-exact-source-provenance-and-supp.md +6 -0
  230. package/corpus/templates/design/changelog/2026-07-09-local-react-visual-editing-now-loads-reliably-and-shows-live.md +6 -0
  231. package/corpus/templates/design/changelog/2026-07-09-paste-from-figma-cmd-v-now-imports-exact-editable-nodes-when.md +6 -0
  232. package/corpus/templates/design/changelog/2026-07-09-pressing-escape-after-selecting-a-screen-now-reveals-page-pr.md +6 -0
  233. package/corpus/templates/design/changelog/2026-07-09-right-click-overlapping-or-nested-objects-to-choose-the-exac.md +6 -0
  234. package/corpus/templates/design/changelog/2026-07-09-scale-edge-stretch-and-center-constraints-now-preserve-layer.md +6 -0
  235. package/corpus/templates/design/changelog/2026-07-09-screen-rows-can-now-be-reordered-in-layers-with-matching-can.md +6 -0
  236. package/corpus/templates/design/changelog/2026-07-09-screen-selection-stays-responsive-in-designs-with-hundreds-o.md +6 -0
  237. package/corpus/templates/design/changelog/2026-07-09-shift-a-now-enables-auto-layout-on-a-selected-screen-with-fl.md +6 -0
  238. package/corpus/templates/design/changelog/2026-07-09-swap-a-component-instance-for-another-from-the-libra.md +6 -0
  239. package/corpus/templates/design/changelog/2026-07-10-drawing-annotations-now-stay-available-to-retry-when-the.md +6 -0
  240. package/corpus/templates/design/e2e/global-setup.ts +3 -6
  241. package/corpus/templates/design/e2e/helpers.ts +27 -6
  242. package/corpus/templates/design/server/lib/design-to-figma-svg.ts +1412 -0
  243. package/corpus/templates/design/server/lib/figma-clipboard-match.ts +196 -0
  244. package/corpus/templates/design/server/lib/figma-node-import.ts +311 -0
  245. package/corpus/templates/design/server/lib/figma-node-to-html.ts +1334 -0
  246. package/corpus/templates/design/server/lib/figma-paste-fallback.ts +64 -0
  247. package/corpus/templates/design/server/lib/playwright-runtime.ts +78 -0
  248. package/corpus/templates/design/server/plugins/db.ts +41 -0
  249. package/corpus/templates/design/server/source-workspace.ts +64 -0
  250. package/corpus/templates/design/shared/board-file.ts +13 -2
  251. package/corpus/templates/design/shared/canvas-math.ts +231 -33
  252. package/corpus/templates/design/shared/code-layer.ts +122 -8
  253. package/corpus/templates/design/shared/component-library.ts +161 -0
  254. package/corpus/templates/design/shared/db-conflict.ts +27 -0
  255. package/corpus/templates/design/shared/design-source-capabilities.ts +2 -1
  256. package/corpus/templates/design/shared/figma-url.ts +149 -0
  257. package/corpus/templates/design/shared/pen-path.ts +16 -7
  258. package/corpus/templates/design/shared/source-mode.ts +1 -0
  259. package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +7 -19
  260. package/corpus/templates/plan/changelog/2026-07-09-canvas-panning-now-keeps-zoom-fixed-even-at-the-edges.md +6 -0
  261. package/corpus/templates/slides/actions/index-design-system-with-builder.ts +16 -1
  262. package/corpus/templates/slides/app/context/DeckContext.tsx +311 -70
  263. package/corpus/templates/slides/changelog/2026-07-09-fixed-the-slide-rail-going-permanently-stale-during-a-long-a.md +6 -0
  264. package/dist/agent/production-agent.d.ts +79 -6
  265. package/dist/agent/production-agent.d.ts.map +1 -1
  266. package/dist/agent/production-agent.js +161 -14
  267. package/dist/agent/production-agent.js.map +1 -1
  268. package/dist/agent/run-manager.d.ts.map +1 -1
  269. package/dist/agent/run-manager.js +29 -5
  270. package/dist/agent/run-manager.js.map +1 -1
  271. package/dist/agent/run-store.d.ts +46 -0
  272. package/dist/agent/run-store.d.ts.map +1 -1
  273. package/dist/agent/run-store.js +61 -0
  274. package/dist/agent/run-store.js.map +1 -1
  275. package/dist/cli/design-connect.d.ts +6 -0
  276. package/dist/cli/design-connect.d.ts.map +1 -1
  277. package/dist/cli/design-connect.js +336 -139
  278. package/dist/cli/design-connect.js.map +1 -1
  279. package/dist/cli/skills.d.ts.map +1 -1
  280. package/dist/cli/skills.js +14 -0
  281. package/dist/cli/skills.js.map +1 -1
  282. package/dist/client/AssistantChat.d.ts +2 -0
  283. package/dist/client/AssistantChat.d.ts.map +1 -1
  284. package/dist/client/AssistantChat.js +19 -3
  285. package/dist/client/AssistantChat.js.map +1 -1
  286. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  287. package/dist/client/MultiTabAssistantChat.js +38 -18
  288. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  289. package/dist/client/agent-chat.d.ts +60 -0
  290. package/dist/client/agent-chat.d.ts.map +1 -1
  291. package/dist/client/agent-chat.js +122 -1
  292. package/dist/client/agent-chat.js.map +1 -1
  293. package/dist/client/chat/index.d.ts +1 -1
  294. package/dist/client/chat/index.d.ts.map +1 -1
  295. package/dist/client/chat/index.js +1 -1
  296. package/dist/client/chat/index.js.map +1 -1
  297. package/dist/client/extensions/EmbeddedExtension.d.ts +12 -0
  298. package/dist/client/extensions/EmbeddedExtension.d.ts.map +1 -1
  299. package/dist/client/extensions/EmbeddedExtension.js +36 -2
  300. package/dist/client/extensions/EmbeddedExtension.js.map +1 -1
  301. package/dist/client/index.d.ts +1 -1
  302. package/dist/client/index.d.ts.map +1 -1
  303. package/dist/client/index.js +1 -1
  304. package/dist/client/index.js.map +1 -1
  305. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -1
  306. package/dist/client/rich-markdown-editor/useCollabReconcile.js +18 -6
  307. package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -1
  308. package/dist/collab/awareness-store.d.ts +5 -0
  309. package/dist/collab/awareness-store.d.ts.map +1 -1
  310. package/dist/collab/awareness-store.js +19 -12
  311. package/dist/collab/awareness-store.js.map +1 -1
  312. package/dist/collab/awareness.d.ts +2 -2
  313. package/dist/collab/awareness.d.ts.map +1 -1
  314. package/dist/collab/client.d.ts.map +1 -1
  315. package/dist/collab/client.js +13 -5
  316. package/dist/collab/client.js.map +1 -1
  317. package/dist/collab/index.d.ts +1 -0
  318. package/dist/collab/index.d.ts.map +1 -1
  319. package/dist/collab/index.js +1 -0
  320. package/dist/collab/index.js.map +1 -1
  321. package/dist/collab/recent-edits.d.ts +3 -1
  322. package/dist/collab/recent-edits.d.ts.map +1 -1
  323. package/dist/collab/recent-edits.js +57 -2
  324. package/dist/collab/recent-edits.js.map +1 -1
  325. package/dist/collab/routes.d.ts +1 -1
  326. package/dist/deploy/build.d.ts +24 -0
  327. package/dist/deploy/build.d.ts.map +1 -1
  328. package/dist/deploy/build.js +102 -5
  329. package/dist/deploy/build.js.map +1 -1
  330. package/dist/index.browser.d.ts +1 -1
  331. package/dist/index.browser.d.ts.map +1 -1
  332. package/dist/index.browser.js +1 -1
  333. package/dist/index.browser.js.map +1 -1
  334. package/dist/notifications/routes.d.ts +1 -1
  335. package/dist/observability/routes.d.ts +5 -5
  336. package/dist/progress/routes.d.ts +1 -1
  337. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  338. package/dist/server/agent-chat-plugin.js +87 -10
  339. package/dist/server/agent-chat-plugin.js.map +1 -1
  340. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  341. package/dist/server/builder-design-systems.d.ts +15 -0
  342. package/dist/server/builder-design-systems.d.ts.map +1 -1
  343. package/dist/server/builder-design-systems.js +9 -4
  344. package/dist/server/builder-design-systems.js.map +1 -1
  345. package/package.json +1 -1
@@ -10,7 +10,7 @@ import {
10
10
  } from "@agent-native/core/client";
11
11
  import type { QuestionFlowQuestion } from "@shared/api";
12
12
  import { IconCheck, IconPalette, IconUpload, IconX } from "@tabler/icons-react";
13
- import { useCallback, useEffect, useMemo, useState } from "react";
13
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
14
14
 
15
15
  import { Button } from "@/components/ui/button";
16
16
  import { Slider } from "@/components/ui/slider";
@@ -39,6 +39,15 @@ export function QuestionFlow({
39
39
  const t = useT();
40
40
  const guidedQuestions = questions as GuidedQuestion[];
41
41
  const [answers, setAnswers] = useState<Record<string, unknown>>({});
42
+ // Guards against a rapid double-click (or two events firing within the
43
+ // same React batch) triggering onSubmit/onSkip twice before the parent
44
+ // hook clears the persisted question payload and this component unmounts.
45
+ // Both handlers post a message to the agent chat, so firing twice would
46
+ // duplicate the turn. A ref is required (not just state) because the gate
47
+ // must be visible synchronously to a second click handled in the same
48
+ // task, before React has flushed the re-render that disables the button.
49
+ const respondedRef = useRef(false);
50
+ const [responded, setResponded] = useState(false);
42
51
  const questionsFingerprint = useMemo(
43
52
  () => questionFlowFingerprint(guidedQuestions),
44
53
  [guidedQuestions],
@@ -46,6 +55,8 @@ export function QuestionFlow({
46
55
 
47
56
  useEffect(() => {
48
57
  setAnswers({});
58
+ respondedRef.current = false;
59
+ setResponded(false);
49
60
  }, [questionsFingerprint]);
50
61
 
51
62
  const setAnswer = useCallback((id: string, value: unknown) => {
@@ -98,8 +109,13 @@ export function QuestionFlow({
98
109
  <Button
99
110
  type="button"
100
111
  size="sm"
101
- onClick={() => onSubmit(normalizeGuidedAnswers(answers))}
102
- disabled={!allRequiredAnswered}
112
+ onClick={() => {
113
+ if (respondedRef.current) return;
114
+ respondedRef.current = true;
115
+ setResponded(true);
116
+ onSubmit(normalizeGuidedAnswers(answers));
117
+ }}
118
+ disabled={responded || !allRequiredAnswered}
103
119
  className="h-8 cursor-pointer rounded-md bg-[var(--design-editor-accent-color)] px-3 text-[12px] text-[var(--design-editor-accent-contrast-color)] shadow-none hover:bg-[var(--design-editor-accent-hover-color)] hover:text-[var(--design-editor-accent-contrast-color)] focus-visible:ring-[var(--design-editor-accent-color)]"
104
120
  >
105
121
  {submitLabel ?? t("questionFlow.continue")}
@@ -108,8 +124,14 @@ export function QuestionFlow({
108
124
  type="button"
109
125
  variant="ghost"
110
126
  size="sm"
111
- onClick={onSkip}
112
- className="h-8 cursor-pointer rounded-md px-3 text-[12px] text-muted-foreground hover:bg-[var(--design-editor-layer-hover-color)] hover:text-foreground"
127
+ onClick={() => {
128
+ if (respondedRef.current) return;
129
+ respondedRef.current = true;
130
+ setResponded(true);
131
+ onSkip();
132
+ }}
133
+ disabled={responded}
134
+ className="h-8 cursor-pointer rounded-md px-3 text-[12px] text-muted-foreground hover:bg-[var(--design-editor-layer-hover-color)] hover:text-foreground disabled:cursor-not-allowed disabled:opacity-60"
113
135
  >
114
136
  {skipLabel ?? t("questionFlow.skip")}
115
137
  </Button>
@@ -31,7 +31,7 @@ import {
31
31
  IconShieldCheck,
32
32
  IconTool,
33
33
  } from "@tabler/icons-react";
34
- import { useState } from "react";
34
+ import { useEffect, useRef, useState } from "react";
35
35
 
36
36
  import { Badge } from "@/components/ui/badge";
37
37
  import { Button } from "@/components/ui/button";
@@ -194,6 +194,21 @@ function FindingRow({
194
194
  const applyFix = useActionMutation("apply-a11y-fix");
195
195
  const [fixStatus, setFixStatus] = useState<FixStatus>("idle");
196
196
 
197
+ // `finding.id` is stable across audit runs (`"category:node-id"`), so a
198
+ // parent refetch that still includes the same id — e.g. the fix didn't
199
+ // fully resolve the issue and a fresh audit re-detected it — reuses this
200
+ // same row instance. Without this, a stale "Fixed" checkmark would keep
201
+ // showing even though the finding is live again. Only reset when a
202
+ // genuinely new `finding` object arrives (a fresh audit pass), not on our
203
+ // own optimistic `setFixStatus` calls, which don't touch the prop.
204
+ const lastFindingRef = useRef(finding);
205
+ useEffect(() => {
206
+ if (lastFindingRef.current !== finding) {
207
+ lastFindingRef.current = finding;
208
+ setFixStatus("idle");
209
+ }
210
+ }, [finding]);
211
+
197
212
  // A Fix affordance is shown only when (a) the finding maps to a deterministic
198
213
  // inline edit and (b) a design source is available to write to. Everything
199
214
  // else stays informational.
@@ -248,7 +263,13 @@ function FindingRow({
248
263
  tabIndex={onClick ? 0 : undefined}
249
264
  onClick={() => onClick?.(finding)}
250
265
  onKeyDown={(e) => {
251
- if (e.key === "Enter" || e.key === " ") onClick?.(finding);
266
+ if (e.key === "Enter" || e.key === " ") {
267
+ // This is a `role="button"` div, not a native <button>, so the
268
+ // browser's default Space behavior (page scroll) isn't suppressed
269
+ // automatically — prevent it before activating.
270
+ e.preventDefault();
271
+ onClick?.(finding);
272
+ }
252
273
  }}
253
274
  aria-label={finding.message}
254
275
  >
@@ -108,10 +108,14 @@ export interface TokensPanelProps {
108
108
  // ---------------------------------------------------------------------------
109
109
 
110
110
  /** True when the value looks like an opaque colour we can render as a swatch. */
111
- function isColorValue(value: string): boolean {
111
+ export function isColorValue(value: string): boolean {
112
112
  const v = value.trim();
113
113
  return (
114
- /^#[0-9a-fA-F]{3,8}$/.test(v) ||
114
+ // Valid CSS hex-color lengths are exactly 3, 4, 6, or 8 digits (#rgb,
115
+ // #rgba, #rrggbb, #rrggbbaa) — a bare `{3,8}` range also matched
116
+ // malformed 5- and 7-digit strings, which render as a blank swatch
117
+ // instead of falling back to the neutral type icon.
118
+ /^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(v) ||
115
119
  /^rgba?\(/.test(v) ||
116
120
  /^hsla?\(/.test(v) ||
117
121
  /^oklch\(/.test(v) ||
@@ -119,6 +123,18 @@ function isColorValue(value: string): boolean {
119
123
  );
120
124
  }
121
125
 
126
+ /**
127
+ * Normalizes user-typed CSS custom-property input for the manual "Add one
128
+ * token" flow: trims surrounding whitespace first, then ensures a `--`
129
+ * prefix. Trimming before the prefix check matters — a leading space (e.g.
130
+ * pasted input) would otherwise fail `startsWith("--")` and produce a
131
+ * doubled-up, server-rejected name like `-- --foo`.
132
+ */
133
+ export function normalizeCssVarName(raw: string): string {
134
+ const trimmed = raw.trim();
135
+ return trimmed.startsWith("--") ? trimmed : `--${trimmed}`;
136
+ }
137
+
122
138
  /** Type label + icon for a section header. */
123
139
  function typeLabel(type: DesignToken["type"]): {
124
140
  label: string;
@@ -146,7 +162,6 @@ function typeLabel(type: DesignToken["type"]): {
146
162
 
147
163
  interface TokenRowProps {
148
164
  token: DesignToken;
149
- onEdit: (cssVar: string, value: string) => void;
150
165
  editing: boolean;
151
166
  editDraft: string;
152
167
  onDraftChange: (v: string) => void;
@@ -272,7 +287,6 @@ interface TokenGroupSectionProps {
272
287
  onDraftChange: (v: string) => void;
273
288
  onCommit: () => void;
274
289
  onCancelEdit: () => void;
275
- onEdit: (cssVar: string, value: string) => void;
276
290
  }
277
291
 
278
292
  function TokenGroupSection({
@@ -283,7 +297,6 @@ function TokenGroupSection({
283
297
  onDraftChange,
284
298
  onCommit,
285
299
  onCancelEdit,
286
- onEdit,
287
300
  }: TokenGroupSectionProps) {
288
301
  const [collapsed, setCollapsed] = useState(false);
289
302
  const { label, Icon } = typeLabel(group.type);
@@ -321,7 +334,6 @@ function TokenGroupSection({
321
334
  onCommit={onCommit}
322
335
  onStartEdit={() => onStartEdit(token.cssVar, token.value)}
323
336
  onCancelEdit={onCancelEdit}
324
- onEdit={onEdit}
325
337
  />
326
338
  ))}
327
339
  </div>
@@ -364,12 +376,12 @@ function NewTokenPopover({
364
376
  const t = useT();
365
377
 
366
378
  const handleAdd = () => {
367
- const cleanVar = cssVar.startsWith("--") ? cssVar : `--${cssVar}`;
368
- onAdd(cleanVar, value);
379
+ onAdd(normalizeCssVarName(cssVar), value.trim());
369
380
  setOpen(false);
370
381
  setMode("menu");
371
382
  setCssVar("--my-token");
372
383
  setValue("#000000");
384
+ setText("");
373
385
  };
374
386
 
375
387
  const runImport = async (
@@ -394,8 +406,14 @@ function NewTokenPopover({
394
406
  const closeOrReset = (nextOpen: boolean) => {
395
407
  setOpen(nextOpen);
396
408
  if (!nextOpen) {
409
+ // Reset every draft field, not just mode/status, so reopening the
410
+ // popover after a dismissed (uncommitted) edit always starts fresh
411
+ // instead of silently resurrecting a stale cssVar/value/text draft.
397
412
  setMode("menu");
398
413
  setStatus(null);
414
+ setCssVar("--my-token");
415
+ setValue("#000000");
416
+ setText("");
399
417
  }
400
418
  };
401
419
 
@@ -487,7 +505,7 @@ function NewTokenPopover({
487
505
  type="button"
488
506
  className="h-7 w-full cursor-pointer !text-[11px]"
489
507
  onClick={handleAdd}
490
- disabled={!cssVar || !value}
508
+ disabled={!cssVar.trim() || !value.trim()}
491
509
  >
492
510
  {t("designEditor.tokens.add")}
493
511
  </Button>
@@ -650,6 +668,15 @@ export function TokensPanel({ designId, onTokensApplied }: TokensPanelProps) {
650
668
  const applyMutation = useActionMutation("apply-design-token-edit");
651
669
  const importMutation = useActionMutation("import-design-tokens");
652
670
 
671
+ // This panel is reused across designs (the editor route swaps `designId`
672
+ // in place rather than remounting), so an apply/import mutation kicked off
673
+ // for one design can resolve after the user has already switched to
674
+ // another. Track the latest `designId` in a ref so a stale response can
675
+ // detect that and skip pushing its (now wrong-design) resolved CSS vars
676
+ // into the currently active design via `onTokensApplied`.
677
+ const designIdRef = useRef(designId);
678
+ designIdRef.current = designId;
679
+
653
680
  // ------------------------------------------------------------------
654
681
  // Local edit state
655
682
  // ------------------------------------------------------------------
@@ -666,18 +693,14 @@ export function TokensPanel({ designId, onTokensApplied }: TokensPanelProps) {
666
693
  setEditDraft("");
667
694
  };
668
695
 
669
- const commitEdit = () => {
670
- if (!editingKey || !editDraft.trim()) {
671
- cancelEdit();
672
- return;
673
- }
674
- const cssVar = editingKey;
675
- const value = editDraft.trim();
676
- cancelEdit();
696
+ /** Shared apply path for both inline row edits and "Add one token". */
697
+ const applyTokenEdit = (cssVar: string, value: string) => {
698
+ const requestDesignId = designId;
677
699
  applyMutation.mutate(
678
700
  { designId, edits: [{ cssVar, value }] },
679
701
  {
680
702
  onSuccess: (result) => {
703
+ if (designIdRef.current !== requestDesignId) return;
681
704
  void refetch();
682
705
  const r = result as { resolvedCssVars?: Record<string, string> };
683
706
  if (r?.resolvedCssVars && onTokensApplied) {
@@ -688,22 +711,26 @@ export function TokensPanel({ designId, onTokensApplied }: TokensPanelProps) {
688
711
  );
689
712
  };
690
713
 
714
+ const commitEdit = () => {
715
+ if (!editingKey || !editDraft.trim()) {
716
+ cancelEdit();
717
+ return;
718
+ }
719
+ const cssVar = editingKey;
720
+ const value = editDraft.trim();
721
+ cancelEdit();
722
+ applyTokenEdit(cssVar, value);
723
+ };
724
+
691
725
  const handleNewToken = (cssVar: string, value: string) => {
692
- applyMutation.mutate(
693
- { designId, edits: [{ cssVar, value }] },
694
- {
695
- onSuccess: (result) => {
696
- void refetch();
697
- const r = result as { resolvedCssVars?: Record<string, string> };
698
- if (r?.resolvedCssVars && onTokensApplied) {
699
- onTokensApplied(r.resolvedCssVars);
700
- }
701
- },
702
- },
703
- );
726
+ applyTokenEdit(cssVar, value);
704
727
  };
705
728
 
706
- const handleImportSuccess = (result: ImportDesignTokensResult) => {
729
+ const handleImportSuccess = (
730
+ result: ImportDesignTokensResult,
731
+ requestDesignId: string,
732
+ ) => {
733
+ if (designIdRef.current !== requestDesignId) return result;
707
734
  void refetch();
708
735
  if (result.resolvedCssVars && onTokensApplied) {
709
736
  onTokensApplied(result.resolvedCssVars);
@@ -712,29 +739,32 @@ export function TokensPanel({ designId, onTokensApplied }: TokensPanelProps) {
712
739
  };
713
740
 
714
741
  const importFiles = async (files: TokenImportFile[]) => {
742
+ const requestDesignId = designId;
715
743
  const result = (await importMutation.mutateAsync({
716
744
  designId,
717
745
  source: "files",
718
746
  files,
719
747
  })) as ImportDesignTokensResult;
720
- return handleImportSuccess(result);
748
+ return handleImportSuccess(result, requestDesignId);
721
749
  };
722
750
 
723
751
  const importText = async (text: string) => {
752
+ const requestDesignId = designId;
724
753
  const result = (await importMutation.mutateAsync({
725
754
  designId,
726
755
  source: "paste",
727
756
  text,
728
757
  })) as ImportDesignTokensResult;
729
- return handleImportSuccess(result);
758
+ return handleImportSuccess(result, requestDesignId);
730
759
  };
731
760
 
732
761
  const importCurrentDesign = async () => {
762
+ const requestDesignId = designId;
733
763
  const result = (await importMutation.mutateAsync({
734
764
  designId,
735
765
  source: "current-design",
736
766
  })) as ImportDesignTokensResult;
737
- return handleImportSuccess(result);
767
+ return handleImportSuccess(result, requestDesignId);
738
768
  };
739
769
 
740
770
  // ------------------------------------------------------------------
@@ -821,22 +851,6 @@ export function TokensPanel({ designId, onTokensApplied }: TokensPanelProps) {
821
851
  onDraftChange={setEditDraft}
822
852
  onCommit={commitEdit}
823
853
  onCancelEdit={cancelEdit}
824
- onEdit={(cssVar, value) =>
825
- applyMutation.mutate(
826
- { designId, edits: [{ cssVar, value }] },
827
- {
828
- onSuccess: (result) => {
829
- void refetch();
830
- const r = result as {
831
- resolvedCssVars?: Record<string, string>;
832
- };
833
- if (r?.resolvedCssVars && onTokensApplied) {
834
- onTokensApplied(r.resolvedCssVars);
835
- }
836
- },
837
- },
838
- )
839
- }
840
854
  />
841
855
  ))}
842
856
  </div>