@agent-native/core 0.80.8 → 0.80.10

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 (359) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +19 -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/design-connect.ts +28 -2
  16. package/corpus/core/src/cli/mcp.ts +10 -0
  17. package/corpus/core/src/cli/skills.ts +103 -36
  18. package/corpus/core/src/client/error-format.ts +25 -0
  19. package/corpus/core/src/client/extensions/ExtensionViewer.tsx +13 -11
  20. package/corpus/core/src/client/guided-questions.tsx +32 -4
  21. package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +33 -1
  22. package/corpus/core/src/client/resources/BuiltinCapabilityDetail.tsx +8 -0
  23. package/corpus/core/src/client/resources/use-builtin-capabilities.ts +4 -2
  24. package/corpus/core/src/client/session-replay.ts +34 -0
  25. package/corpus/core/src/client/sharing/ShareButton.tsx +106 -21
  26. package/corpus/core/src/coding-tools/index.ts +1 -1
  27. package/corpus/core/src/mcp/index.ts +2 -0
  28. package/corpus/core/src/mcp/screen-memory-stdio.ts +290 -0
  29. package/corpus/core/src/mcp-client/builtin-capabilities.ts +13 -1
  30. package/corpus/core/src/mcp-client/index.ts +9 -0
  31. package/corpus/core/src/mcp-client/screen-memory-local.ts +461 -0
  32. package/corpus/core/src/onboarding/types.ts +7 -0
  33. package/corpus/core/src/server/agent-chat-plugin.ts +25 -0
  34. package/corpus/core/src/server/agents-bundle.ts +35 -7
  35. package/corpus/core/src/styles/agent-native.css +5 -0
  36. package/corpus/core/src/templates/default/app/global.css +35 -35
  37. package/corpus/templates/analytics/AGENTS.md +6 -0
  38. package/corpus/templates/analytics/actions/github-repo-files.ts +9 -0
  39. package/corpus/templates/analytics/app/components/layout/Layout.tsx +4 -4
  40. package/corpus/templates/analytics/app/global.css +144 -40
  41. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +1 -1
  42. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +1 -1
  43. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
  44. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +4 -4
  45. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +9 -9
  46. package/corpus/templates/analytics/changelog/2026-06-29-agents-can-search-and-read-connected-github-repositories-whe.md +6 -0
  47. package/corpus/templates/analytics/changelog/2026-06-29-sessions-and-explorer-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
  48. package/corpus/templates/assets/app/components/layout/Layout.tsx +3 -1
  49. package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +1 -1
  50. package/corpus/templates/assets/app/global.css +99 -35
  51. package/corpus/templates/assets/app/routes/asset.$id.tsx +2 -2
  52. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +4 -4
  53. package/corpus/templates/assets/app/routes/library.tsx +4 -4
  54. package/corpus/templates/assets/changelog/2026-06-29-asset-library-and-detail-layouts-adapt-when-the-agent-sidebar.md +6 -0
  55. package/corpus/templates/brain/app/components/layout/Layout.tsx +1 -1
  56. package/corpus/templates/brain/app/global.css +63 -35
  57. package/corpus/templates/brain/app/routes/search.tsx +1 -1
  58. package/corpus/templates/brain/app/routes/settings.tsx +1 -1
  59. package/corpus/templates/brain/app/routes/sources.tsx +2 -2
  60. package/corpus/templates/brain/changelog/2026-06-29-search-settings-and-source-layouts-adapt-when-the-agent-sidebar.md +6 -0
  61. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +4 -4
  62. package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +3 -2
  63. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +4 -2
  64. package/corpus/templates/calendar/app/global.css +69 -35
  65. package/corpus/templates/calendar/changelog/2026-06-29-event-and-find-time-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
  66. package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -1
  67. package/corpus/templates/chat/app/global.css +35 -35
  68. package/corpus/templates/chat/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  69. package/corpus/templates/clips/AGENTS.md +13 -0
  70. package/corpus/templates/clips/actions/get-screen-memory-status.ts +12 -0
  71. package/corpus/templates/clips/actions/query-screen-memory-context.ts +29 -0
  72. package/corpus/templates/clips/actions/view-screen.ts +2 -2
  73. package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
  74. package/corpus/templates/clips/app/global.css +47 -35
  75. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +3 -3
  76. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +45 -18
  77. package/corpus/templates/clips/changelog/2026-06-29-meeting-detail-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  78. package/corpus/templates/clips/changelog/2026-06-29-screen-memory-keeps-a-local-rolling-screen-buffer-for-agent-context.md +5 -0
  79. package/corpus/templates/clips/changelog/2026-06-29-video-chat-is-easier-to-find-on-recording-pages-and-s3-setup.md +6 -0
  80. package/corpus/templates/clips/chrome-extension/src/styles.css +39 -39
  81. package/corpus/templates/clips/desktop/src/app.tsx +290 -1
  82. package/corpus/templates/clips/desktop/src/shared/config.ts +83 -0
  83. package/corpus/templates/clips/desktop/src/styles.css +67 -52
  84. package/corpus/templates/clips/desktop/src-tauri/src/config.rs +50 -0
  85. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +17 -0
  86. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +13 -13
  87. package/corpus/templates/clips/desktop/src-tauri/src/screen_memory.rs +990 -0
  88. package/corpus/templates/clips/server/plugins/onboarding.ts +2 -0
  89. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +3 -3
  90. package/corpus/templates/content/app/components/layout/Layout.tsx +1 -1
  91. package/corpus/templates/content/app/global.css +29 -15
  92. package/corpus/templates/content/changelog/2026-06-29-database-gallery-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  93. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +25 -20
  94. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +8 -0
  95. package/corpus/templates/design/.agents/skills/export-handoff/SKILL.md +8 -0
  96. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +13 -0
  97. package/corpus/templates/design/AGENTS.md +20 -12
  98. package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1054 -0
  99. package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +717 -0
  100. package/corpus/templates/design/actions/add-breakpoint.ts +143 -0
  101. package/corpus/templates/design/actions/add-localhost-screens.ts +5 -0
  102. package/corpus/templates/design/actions/apply-a11y-fix.ts +317 -0
  103. package/corpus/templates/design/actions/apply-component-prop-edit.ts +433 -0
  104. package/corpus/templates/design/actions/apply-design-state.ts +200 -0
  105. package/corpus/templates/design/actions/apply-design-token-edit.ts +202 -0
  106. package/corpus/templates/design/actions/apply-motion-edit.ts +450 -0
  107. package/corpus/templates/design/actions/apply-shader-fill.ts +404 -0
  108. package/corpus/templates/design/actions/apply-visual-edit.ts +214 -8
  109. package/corpus/templates/design/actions/capture-design-state.ts +224 -0
  110. package/corpus/templates/design/actions/connect-builder-app.ts +162 -0
  111. package/corpus/templates/design/actions/create-component.ts +447 -0
  112. package/corpus/templates/design/actions/create-design-branch.ts +263 -0
  113. package/corpus/templates/design/actions/create-design-state.ts +162 -0
  114. package/corpus/templates/design/actions/delete-design-state.ts +55 -0
  115. package/corpus/templates/design/actions/deploy-design-preview.ts +275 -0
  116. package/corpus/templates/design/actions/export-coding-handoff.ts +12 -4
  117. package/corpus/templates/design/actions/generate-design.ts +6 -21
  118. package/corpus/templates/design/actions/generate-screens.ts +43 -2
  119. package/corpus/templates/design/actions/get-component-details.ts +242 -0
  120. package/corpus/templates/design/actions/get-design-branch-diff.ts +362 -0
  121. package/corpus/templates/design/actions/get-design-review.ts +314 -0
  122. package/corpus/templates/design/actions/get-design-surface-index.ts +582 -0
  123. package/corpus/templates/design/actions/get-design.ts +1 -0
  124. package/corpus/templates/design/actions/get-motion-timeline.ts +99 -0
  125. package/corpus/templates/design/actions/index-components.ts +258 -0
  126. package/corpus/templates/design/actions/index-design-tokens.ts +273 -0
  127. package/corpus/templates/design/actions/list-design-extensions.ts +309 -0
  128. package/corpus/templates/design/actions/list-design-source-capabilities.ts +153 -0
  129. package/corpus/templates/design/actions/list-design-states.ts +72 -0
  130. package/corpus/templates/design/actions/migrate-inline-design-to-app.ts +298 -0
  131. package/corpus/templates/design/actions/open-component-source.ts +237 -0
  132. package/corpus/templates/design/actions/present-design-variants.ts +355 -30
  133. package/corpus/templates/design/actions/preview-component-prop-edit.ts +254 -0
  134. package/corpus/templates/design/actions/preview-design-token-edit.ts +113 -0
  135. package/corpus/templates/design/actions/preview-shader-fill.ts +189 -0
  136. package/corpus/templates/design/actions/remove-breakpoint.ts +103 -0
  137. package/corpus/templates/design/actions/remove-motion-timeline.ts +196 -0
  138. package/corpus/templates/design/actions/run-design-audit.ts +421 -0
  139. package/corpus/templates/design/actions/run-design-extension-action.ts +284 -0
  140. package/corpus/templates/design/actions/set-active-breakpoint.ts +39 -0
  141. package/corpus/templates/design/actions/view-screen.ts +75 -31
  142. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +1738 -135
  143. package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +1 -1
  144. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +632 -43
  145. package/corpus/templates/design/app/components/design/DrawOverlay.tsx +1 -1
  146. package/corpus/templates/design/app/components/design/EditPanel.tsx +1873 -132
  147. package/corpus/templates/design/app/components/design/LayersPanel.tsx +384 -219
  148. package/corpus/templates/design/app/components/design/LocalSourceEditBanner.tsx +157 -0
  149. package/corpus/templates/design/app/components/design/MotionDock.tsx +1062 -0
  150. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +2103 -295
  151. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +83 -206
  152. package/corpus/templates/design/app/components/design/ReviewPanel.tsx +759 -0
  153. package/corpus/templates/design/app/components/design/StatesPanel.tsx +579 -0
  154. package/corpus/templates/design/app/components/design/TokensPanel.tsx +573 -0
  155. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +1 -1
  156. package/corpus/templates/design/app/components/design/canvas-primitive-style.ts +241 -0
  157. package/corpus/templates/design/app/components/design/index.ts +16 -1
  158. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +238 -137
  159. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +188 -14
  160. package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +24 -5
  161. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +57 -1
  162. package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +145 -0
  163. package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +42 -12
  164. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +37 -12
  165. package/corpus/templates/design/app/components/design/inspector/index.ts +1 -0
  166. package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +12 -5
  167. package/corpus/templates/design/app/components/design/types.ts +9 -0
  168. package/corpus/templates/design/app/components/layout/Layout.tsx +23 -5
  169. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +1 -1
  170. package/corpus/templates/design/app/global.css +77 -49
  171. package/corpus/templates/design/app/hooks/use-question-flow.ts +2 -2
  172. package/corpus/templates/design/app/hooks/useAgentEditRequest.ts +131 -0
  173. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +11 -2
  174. package/corpus/templates/design/app/i18n/zh-TW.ts +34 -0
  175. package/corpus/templates/design/app/i18n-data.ts +314 -3
  176. package/corpus/templates/design/app/pages/DesignEditor.tsx +4929 -892
  177. package/corpus/templates/design/app/root.tsx +1 -1
  178. package/corpus/templates/design/changelog/2026-06-29-added-a-review-panel-in-the-design-editor-s-inspector-with-a.md +6 -0
  179. package/corpus/templates/design/changelog/2026-06-29-containers-no-longer-block-selecting-nested-elements-and-nor.md +6 -0
  180. package/corpus/templates/design/changelog/2026-06-29-copying-and-pasting-layers-no-longer-shows-success-notificat.md +6 -0
  181. package/corpus/templates/design/changelog/2026-06-29-design-agents-now-generate-and-refine-variants-from-stronger.md +6 -0
  182. package/corpus/templates/design/changelog/2026-06-29-design-inspector-controls-now-match-figmas-softer-dark-chrome.md +6 -0
  183. package/corpus/templates/design/changelog/2026-06-29-design-questions-now-appear-as-a-cleaner-canvas-intake-with-.md +6 -0
  184. package/corpus/templates/design/changelog/2026-06-29-design-variant-directions-now-appear-as-board-screens-with-chat-buttons.md +5 -0
  185. package/corpus/templates/design/changelog/2026-06-29-device-presets-in-all-screens-view-resize-the-selected-previ.md +6 -0
  186. package/corpus/templates/design/changelog/2026-06-29-element-selection-no-longer-snaps-back-to-the-previous-layer.md +6 -0
  187. package/corpus/templates/design/changelog/2026-06-29-frame-resize-measurements-now-stay-beside-the-cursor-while-d.md +6 -0
  188. package/corpus/templates/design/changelog/2026-06-29-inspector-number-fields-have-cleaner-tooltips-and-draggable-.md +6 -0
  189. package/corpus/templates/design/changelog/2026-06-29-layer-and-canvas-drags-keep-the-layer-list-stable-while-chan.md +6 -0
  190. package/corpus/templates/design/changelog/2026-06-29-layer-locking-layer-nesting-generated-question-intake-and-im.md +6 -0
  191. package/corpus/templates/design/changelog/2026-06-29-layer-moves-can-be-undone-and-redone-without-flashing-the-ca.md +6 -0
  192. package/corpus/templates/design/changelog/2026-06-29-layer-names-in-the-sidebar-can-scroll-horizontally-instead-o.md +6 -0
  193. package/corpus/templates/design/changelog/2026-06-29-layer-nesting-in-the-sidebar-now-uses-tighter-spacing-so-nam.md +6 -0
  194. package/corpus/templates/design/changelog/2026-06-29-layers-no-longer-repeat-document-wrapper-rows-when-a-screen-.md +6 -0
  195. package/corpus/templates/design/changelog/2026-06-29-overview-previews-now-keep-element-hover-and-selection-tied-.md +6 -0
  196. package/corpus/templates/design/changelog/2026-06-29-pressing-escape-now-cancels-a-stuck-screen-drag-in-the-overv.md +6 -0
  197. package/corpus/templates/design/changelog/2026-06-29-screen-overview-is-easier-to-find-and-named-screens-open-dir.md +6 -0
  198. package/corpus/templates/design/changelog/2026-06-29-screen-overview-only-highlights-screens-when-the-frame-or-ti.md +6 -0
  199. package/corpus/templates/design/changelog/2026-06-29-screen-overview-previews-now-resize-to-match-the-selected-de.md +6 -0
  200. package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-now-uses-a-pointer-cursor-instead-.md +6 -0
  201. package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-outlines-now-stay-locked-to-the-se.md +6 -0
  202. package/corpus/templates/design/changelog/2026-06-29-screen-overview-zoom-now-reports-real-screen-scale-separatel.md +6 -0
  203. package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-feels-smoother-and-selection-outline.md +6 -0
  204. package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-now-stays-on-the-overview-canvas-ins.md +6 -0
  205. package/corpus/templates/design/changelog/2026-06-29-screen-previews-use-a-single-blue-hover-border-in-all-screen.md +6 -0
  206. package/corpus/templates/design/changelog/2026-06-29-selected-containers-show-draggable-padding-and-gap-guides-on.md +6 -0
  207. package/corpus/templates/design/changelog/2026-06-29-selecting-a-nested-layer-from-all-screens-now-keeps-you-in-a.md +6 -0
  208. package/corpus/templates/design/changelog/2026-06-29-share-now-groups-link-sharing-exports-and-agent-handoff.md +6 -0
  209. package/corpus/templates/design/changelog/2026-06-29-the-design-editor-adds-a-studio-layer-with-tokens-respon.md +6 -0
  210. package/corpus/templates/design/changelog/2026-06-29-the-design-editor-loading-skeleton-now-uses-a-softer-charcoa.md +6 -0
  211. package/corpus/templates/design/changelog/2026-06-29-the-device-preview-menu-now-sits-next-to-the-preview-button-.md +6 -0
  212. package/corpus/templates/design/changelog/2026-06-29-the-inspector-stays-read-only-while-an-empty-design-is-still.md +6 -0
  213. package/corpus/templates/design/changelog/2026-06-29-the-missing-design-view-now-matches-the-rest-of-the-editor-c.md +6 -0
  214. package/corpus/templates/design/changelog/2026-06-29-the-pen-tool-icon-and-tool-option-menus-better-match-the-edi.md +6 -0
  215. package/corpus/templates/design/changelog/2026-06-29-typography-controls-now-keep-the-font-name-visible-and-move-.md +6 -0
  216. package/corpus/templates/design/changelog/2026-06-30-accessibility-findings-now-offer-a-one-click-fix.md +6 -0
  217. package/corpus/templates/design/changelog/2026-06-30-component-instances-now-have-editable-props-in-the-inspe.md +6 -0
  218. package/corpus/templates/design/changelog/2026-06-30-inspect-code-now-shows-the-elements-opening-tag-at-a-gla.md +6 -0
  219. package/corpus/templates/design/changelog/2026-06-30-shader-fill-presets-can-now-be-applied-to-an-element.md +6 -0
  220. package/corpus/templates/design/changelog/2026-06-30-the-motion-timeline-can-now-add-a-track-to-any-element-a.md +6 -0
  221. package/corpus/templates/design/changelog/2026-06-30-visual-editor-selection-layer-paint-and-drawing-controls-are-more-reliable.md +6 -0
  222. package/corpus/templates/design/e2e/README.md +3 -3
  223. package/corpus/templates/design/e2e/global-setup.ts +11 -22
  224. package/corpus/templates/design/e2e/helpers.ts +128 -11
  225. package/corpus/templates/design/playwright.config.ts +9 -3
  226. package/corpus/templates/design/server/db/schema.ts +123 -0
  227. package/corpus/templates/design/server/lib/coding-handoff.ts +126 -2
  228. package/corpus/templates/design/server/plugins/core-routes.ts +1 -2
  229. package/corpus/templates/design/server/plugins/db.ts +90 -0
  230. package/corpus/templates/design/server/routes/api/design-handoff/[id].zip.get.ts +86 -0
  231. package/corpus/templates/design/shared/builder-app.ts +297 -0
  232. package/corpus/templates/design/shared/capability-resolver.ts +123 -0
  233. package/corpus/templates/design/shared/capture-sanitize.ts +70 -0
  234. package/corpus/templates/design/shared/code-layer.ts +1141 -93
  235. package/corpus/templates/design/shared/component-model.ts +239 -0
  236. package/corpus/templates/design/shared/design-review.ts +275 -0
  237. package/corpus/templates/design/shared/design-source-capabilities.ts +286 -0
  238. package/corpus/templates/design/shared/design-state.ts +112 -0
  239. package/corpus/templates/design/shared/design-surface-index.ts +258 -0
  240. package/corpus/templates/design/shared/generation-session.ts +41 -0
  241. package/corpus/templates/design/shared/motion-compiler.ts +278 -0
  242. package/corpus/templates/design/shared/motion-timeline.ts +193 -0
  243. package/corpus/templates/design/shared/responsive-classes.ts +452 -0
  244. package/corpus/templates/design/shared/shader-fill.ts +323 -0
  245. package/corpus/templates/design/shared/source-mode.ts +245 -0
  246. package/corpus/templates/dispatch/app/global.css +79 -35
  247. package/corpus/templates/dispatch/app/routes/integrations.tsx +8 -7
  248. package/corpus/templates/dispatch/changelog/2026-06-29-integration-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  249. package/corpus/templates/forms/app/components/layout/Layout.tsx +6 -2
  250. package/corpus/templates/forms/app/global.css +64 -35
  251. package/corpus/templates/forms/app/pages/FormsListPage.tsx +2 -2
  252. package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +3 -3
  253. package/corpus/templates/forms/changelog/2026-06-29-form-list-and-insight-layouts-adapt-when-the-agent-sidebar.md +6 -0
  254. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +3 -1
  255. package/corpus/templates/macros/app/global.css +25 -9
  256. package/corpus/templates/macros/changelog/2026-06-29-macro-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  257. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -2
  258. package/corpus/templates/mail/app/global.css +42 -36
  259. package/corpus/templates/mail/app/pages/InboxPage.tsx +1 -1
  260. package/corpus/templates/mail/changelog/2026-06-29-the-contact-panel-now-adapts-to-the-available-mail-pane-width.md +6 -0
  261. package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -1
  262. package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +6 -2
  263. package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +6 -7
  264. package/corpus/templates/plan/app/global.css +74 -42
  265. package/corpus/templates/plan/changelog/2026-06-29-plan-canvases-open-without-an-initial-pan-and-zoom-flicker.md +6 -0
  266. package/corpus/templates/plan/changelog/2026-06-29-plan-document-blocks-adapt-to-the-available-document-width.md +6 -0
  267. package/corpus/templates/plan/changelog/2026-06-29-plan-titles-and-summaries-can-be-edited-inline-without-focus.md +6 -0
  268. package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -1
  269. package/corpus/templates/slides/app/global.css +49 -33
  270. package/corpus/templates/slides/changelog/2026-06-29-slide-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  271. package/corpus/templates/videos/app/components/layout/Layout.tsx +3 -1
  272. package/corpus/templates/videos/app/global.css +35 -35
  273. package/corpus/templates/videos/changelog/2026-06-29-video-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  274. package/dist/cli/design-connect.d.ts.map +1 -1
  275. package/dist/cli/design-connect.js +28 -2
  276. package/dist/cli/design-connect.js.map +1 -1
  277. package/dist/cli/mcp.d.ts.map +1 -1
  278. package/dist/cli/mcp.js +10 -0
  279. package/dist/cli/mcp.js.map +1 -1
  280. package/dist/cli/skills.d.ts.map +1 -1
  281. package/dist/cli/skills.js +95 -33
  282. package/dist/cli/skills.js.map +1 -1
  283. package/dist/client/error-format.d.ts.map +1 -1
  284. package/dist/client/error-format.js +17 -0
  285. package/dist/client/error-format.js.map +1 -1
  286. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  287. package/dist/client/extensions/ExtensionViewer.js +3 -4
  288. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  289. package/dist/client/guided-questions.d.ts +4 -0
  290. package/dist/client/guided-questions.d.ts.map +1 -1
  291. package/dist/client/guided-questions.js +16 -7
  292. package/dist/client/guided-questions.js.map +1 -1
  293. package/dist/client/onboarding/OnboardingPanel.js +26 -1
  294. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  295. package/dist/client/resources/BuiltinCapabilityDetail.d.ts.map +1 -1
  296. package/dist/client/resources/BuiltinCapabilityDetail.js +1 -1
  297. package/dist/client/resources/BuiltinCapabilityDetail.js.map +1 -1
  298. package/dist/client/resources/use-builtin-capabilities.d.ts +1 -1
  299. package/dist/client/resources/use-builtin-capabilities.d.ts.map +1 -1
  300. package/dist/client/resources/use-builtin-capabilities.js +2 -1
  301. package/dist/client/resources/use-builtin-capabilities.js.map +1 -1
  302. package/dist/client/session-replay.d.ts.map +1 -1
  303. package/dist/client/session-replay.js +31 -0
  304. package/dist/client/session-replay.js.map +1 -1
  305. package/dist/client/sharing/ShareButton.d.ts +14 -0
  306. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  307. package/dist/client/sharing/ShareButton.js +36 -7
  308. package/dist/client/sharing/ShareButton.js.map +1 -1
  309. package/dist/coding-tools/index.js +1 -1
  310. package/dist/coding-tools/index.js.map +1 -1
  311. package/dist/mcp/index.d.ts +2 -0
  312. package/dist/mcp/index.d.ts.map +1 -1
  313. package/dist/mcp/index.js +1 -0
  314. package/dist/mcp/index.js.map +1 -1
  315. package/dist/mcp/screen-memory-stdio.d.ts +6 -0
  316. package/dist/mcp/screen-memory-stdio.d.ts.map +1 -0
  317. package/dist/mcp/screen-memory-stdio.js +213 -0
  318. package/dist/mcp/screen-memory-stdio.js.map +1 -0
  319. package/dist/mcp-client/builtin-capabilities.d.ts +1 -1
  320. package/dist/mcp-client/builtin-capabilities.d.ts.map +1 -1
  321. package/dist/mcp-client/builtin-capabilities.js +10 -0
  322. package/dist/mcp-client/builtin-capabilities.js.map +1 -1
  323. package/dist/mcp-client/index.d.ts +1 -0
  324. package/dist/mcp-client/index.d.ts.map +1 -1
  325. package/dist/mcp-client/index.js +1 -0
  326. package/dist/mcp-client/index.js.map +1 -1
  327. package/dist/mcp-client/screen-memory-local.d.ts +61 -0
  328. package/dist/mcp-client/screen-memory-local.d.ts.map +1 -0
  329. package/dist/mcp-client/screen-memory-local.js +336 -0
  330. package/dist/mcp-client/screen-memory-local.js.map +1 -0
  331. package/dist/observability/routes.d.ts +3 -3
  332. package/dist/onboarding/types.d.ts +7 -0
  333. package/dist/onboarding/types.d.ts.map +1 -1
  334. package/dist/onboarding/types.js.map +1 -1
  335. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  336. package/dist/server/agent-chat-plugin.js +26 -0
  337. package/dist/server/agent-chat-plugin.js.map +1 -1
  338. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  339. package/dist/server/agents-bundle.d.ts.map +1 -1
  340. package/dist/server/agents-bundle.js +22 -7
  341. package/dist/server/agents-bundle.js.map +1 -1
  342. package/dist/styles/agent-native.css +5 -0
  343. package/dist/templates/default/app/global.css +35 -35
  344. package/docs/content/locales/ar-SA/template-design.mdx +6 -0
  345. package/docs/content/locales/de-DE/template-design.mdx +8 -0
  346. package/docs/content/locales/es-ES/template-design.mdx +10 -2
  347. package/docs/content/locales/fr-FR/template-design.mdx +10 -2
  348. package/docs/content/locales/hi-IN/template-design.mdx +7 -0
  349. package/docs/content/locales/ja-JP/template-design.mdx +7 -0
  350. package/docs/content/locales/ko-KR/template-design.mdx +7 -0
  351. package/docs/content/locales/pt-BR/template-design.mdx +9 -2
  352. package/docs/content/locales/zh-CN/template-design.mdx +6 -0
  353. package/docs/content/locales/zh-TW/template-design.mdx +6 -0
  354. package/docs/content/template-design.mdx +9 -2
  355. package/package.json +1 -1
  356. package/src/templates/default/app/global.css +35 -35
  357. package/corpus/templates/design/app/components/design/VariantGrid.tsx +0 -189
  358. package/corpus/templates/design/app/components/design/VariantHandoffCard.tsx +0 -115
  359. package/corpus/templates/design/app/hooks/use-variant-flow.ts +0 -342
@@ -0,0 +1,1054 @@
1
+ # Code-Native Design Studio - Canonical Implementation Plan
2
+
3
+ ## Goal
4
+
5
+ Turn the Design template into a Figma-class editor where code is the source of
6
+ truth. Components, tokens, motion, states, accessibility review, branches/diffs,
7
+ assets, shaders, and plugins should all round-trip through real source when the
8
+ current source can safely support it.
9
+
10
+ The editor should stay minimal and Figma-esque:
11
+
12
+ - left pages/layers
13
+ - central canvas
14
+ - right contextual inspector
15
+ - one bottom dock for timeline/review work
16
+ - no permanent chrome for every new capability
17
+
18
+ This document is the converged plan from the Claude visual plan, the Codex
19
+ architecture plan, the cross-reviews, and the supplied screenshots.
20
+
21
+ ## Visual Source Of Truth
22
+
23
+ Primary visual direction:
24
+
25
+ - https://plan.agent-native.com/plans/plan-88dc4a09fb0c46bc
26
+
27
+ Supporting guardrail plan:
28
+
29
+ - https://plan.agent-native.com/plans/plan-b51dc200d7394583
30
+
31
+ Screenshot acceptance references:
32
+
33
+ - `/Users/steve/Desktop/Screenshot 2026-06-29 at 2.48.01 PM.png`
34
+ - workbench and motion dock
35
+ - `/Users/steve/Desktop/Screenshot 2026-06-29 at 2.48.06 PM.png`
36
+ - tokens/design-system and states/responsive panels
37
+ - `/Users/steve/Desktop/Screenshot 2026-06-29 at 2.48.09 PM.png`
38
+ - review/a11y/diff and extensions/shaders/assets panels
39
+
40
+ ## Core Decision: Runtime Tiers
41
+
42
+ Design already has three source types:
43
+
44
+ - `inline`
45
+ - `localhost`
46
+ - `fusion`
47
+
48
+ Do not add a new `builder-app` source type. Builder-backed hosted work should
49
+ fill in the existing `fusion` source mode.
50
+
51
+ The product model has two capability tiers:
52
+
53
+ ### Tier A: Inline / Alpine
54
+
55
+ This is the zero-setup tier. A design is a SQL-backed HTML/CSS/Tailwind/Alpine
56
+ document rendered in a sandboxed iframe.
57
+
58
+ Inline mode supports features that only need:
59
+
60
+ - rendered DOM
61
+ - the design document's own HTML/CSS
62
+ - SQL-backed design data
63
+ - existing visual-edit and tweak paths
64
+
65
+ ### Tier B: Real App
66
+
67
+ This is the full-fidelity tier. A design is backed by a real React/TypeScript app
68
+ through either:
69
+
70
+ - `localhost`: a local dev server connected through `design connect`
71
+ - `fusion`: a future hosted/Builder-backed source using the existing source mode
72
+
73
+ Real app mode supports features that need:
74
+
75
+ - module graph
76
+ - TypeScript prop types
77
+ - component exports
78
+ - cva/tailwind-variants/Storybook metadata
79
+ - real routes
80
+ - server/API data
81
+ - git branches
82
+ - deploy previews
83
+ - source-file writes
84
+
85
+ The current repo has Builder handoff and branch creation paths through
86
+ `connect-builder` / `runBuilderAgent()`. It does not currently have first-party
87
+ durable container infra for this feature. Treat "our own container infra" as a
88
+ future option, not an implementation dependency for the first real-app lane.
89
+
90
+ ## One-Line Product Rule
91
+
92
+ If a feature only needs the rendered DOM or the design's own HTML/CSS/SQL, it
93
+ ships in inline mode. If it needs the module graph, TypeScript, a real build,
94
+ real data, git, or deploy, it is a real-app feature behind a "Make it real" CTA.
95
+
96
+ ## Feature Tiering
97
+
98
+ | Capability | Inline / Alpine | Real App: localhost / fusion |
99
+ | -------------------------------------------------------------------- | --------------- | ---------------------------- |
100
+ | Static layout editing | yes | yes |
101
+ | Basic layers and selection | yes | yes |
102
+ | CSS variable tokens and style presets | yes | yes |
103
+ | Tokens parsed and written to `globals.css`, Tailwind, or token files | CTA | yes |
104
+ | Lightweight annotated component regions | yes | yes |
105
+ | Full React components, prop controls, cva/Storybook variants | CTA | yes |
106
+ | Jump to component source | CTA | yes |
107
+ | Simple CSS keyframe motion | yes | yes |
108
+ | Full CSS-first multi-layer timeline | yes | yes |
109
+ | `motion/react` or source-code motion round-trip | CTA | yes |
110
+ | Simple responsive frames | yes | yes |
111
+ | Real app states, fixtures, route captures, auth-aware captures | CTA | yes |
112
+ | Basic accessibility audit over rendered DOM | yes | yes |
113
+ | Semantic accessibility source fixes | CTA | yes |
114
+ | `design_versions` visual diff | yes | yes |
115
+ | Real branch, PR, preview deploy, deploy, rollback | CTA | yes |
116
+ | Asset library | yes | yes |
117
+ | Shader preview | yes | yes |
118
+ | Shader apply/export to source | gated | gated, later |
119
+ | Extensions that call design actions | yes | yes |
120
+ | Plugins needing app APIs/build/source | CTA | yes |
121
+
122
+ ## Make It Real
123
+
124
+ When a user reaches for a gated real-app feature in inline mode, show a compact
125
+ CTA in the relevant panel instead of dead controls.
126
+
127
+ Example CTA:
128
+
129
+ > Make this a real app to unlock components, props, data states, branches, and
130
+ > deploys.
131
+
132
+ The CTA should appear only at the moment of need:
133
+
134
+ - full component controls
135
+ - jump to source
136
+ - tokens-as-code
137
+ - data fixtures and live captures
138
+ - branches/diffs/deploys
139
+ - source-code motion round-trip
140
+ - semantic accessibility fixes
141
+
142
+ ### Make-It-Real Flow
143
+
144
+ 1. Connect Builder, using the existing `connect-builder` card/tooling.
145
+ 2. Generate or migrate the inline design into a real React app.
146
+ 3. Preserve the original inline design as a version/snapshot.
147
+ 4. Use `fusion` as the hosted source descriptor for Builder-backed work.
148
+ 5. Point the editor at the running real app source.
149
+ 6. Unlock real-app capabilities based on explicit source capabilities.
150
+ 7. Let the user review code/visual diffs and deploy through the real-app path.
151
+
152
+ Important grounding:
153
+
154
+ - Builder credentials belong in Vault/scoped credential storage.
155
+ - Builder branch/cloud-agent paths exist through `runBuilderAgent()`.
156
+ - Internal Docker/durable container sandboxing is currently a blueprint/TODO,
157
+ not a prerequisite for this plan.
158
+
159
+ ## Existing Seams To Reuse
160
+
161
+ Do not build a parallel design model.
162
+
163
+ Reuse:
164
+
165
+ - `templates/design/shared/source-mode.ts`
166
+ - source types: `inline`, `localhost`, `fusion`
167
+ - bridge operations: `select`, `resolveNodeToFile`, `readFile`, `applyEdit`,
168
+ `writeFile`, `captureSnapshot`, `captureState`
169
+ - `templates/design/shared/code-layer.ts`
170
+ - nodes, selectors, source spans, stable ids, style capabilities
171
+ - `templates/design/actions/get-code-layer-projection.ts`
172
+ - current projection entrypoint
173
+ - `templates/design/actions/apply-visual-edit.ts`
174
+ - deterministic HTML edit path for inline/design files
175
+ - `templates/design/actions/apply-tweaks.ts`
176
+ - existing persisted CSS-var tweak path
177
+ - `templates/design/shared/resolve-tweaks.ts`
178
+ - tweak selection to CSS variable resolution
179
+ - `packages/core/src/server/design-token-utils.ts`
180
+ - CSS variable, Tailwind, CSS/SCSS, JSON/theme, static HTML, GitHub, and upload
181
+ token parsing
182
+ - `packages/core/src/brand-kit/types.ts`
183
+ - shared token/design-system shape
184
+ - `templates/design/app/pages/DesignEditor.tsx`
185
+ - editor orchestration, file saves, tweak persistence, canvas state
186
+ - `templates/design/app/components/design/DesignCanvas.tsx`
187
+ - iframe bridge, selection, style preview, canvas messages
188
+ - `templates/design/app/components/design/EditPanel.tsx`
189
+ - right inspector surface
190
+ - `templates/design/app/components/design/DesignExtensionsPanel.tsx`
191
+ - extension slot surface
192
+ - `templates/design/server/db/schema.ts`
193
+ - designs, design systems, files, versions, localhost connections
194
+ - `design_versions`
195
+ - version diff and make-it-real snapshot foundation
196
+
197
+ ## Capability Gates
198
+
199
+ Add a thin capability matrix first. This must not become a large framework
200
+ project.
201
+
202
+ The UI should never infer write capability from `sourceType` alone. It should
203
+ ask the source/capability layer whether the current operation is available.
204
+
205
+ Recommended capability names:
206
+
207
+ - `select`
208
+ - `resolveNodeToFile`
209
+ - `readFile`
210
+ - `applyEdit`
211
+ - `writeFile`
212
+ - `captureSnapshot`
213
+ - `captureState`
214
+ - `indexComponents`
215
+ - `indexTokens`
216
+ - `writeTokens`
217
+ - `previewMotion`
218
+ - `writeMotion`
219
+ - `previewA11yFix`
220
+ - `applyA11yFix`
221
+ - `branch`
222
+ - `deployPreview`
223
+ - `deploy`
224
+
225
+ Behavior:
226
+
227
+ - Unsupported controls are disabled, read-only, or replaced by a make-it-real
228
+ CTA.
229
+ - Preview controls can be available without write controls.
230
+ - Real-app writes require bridge/source hardening.
231
+ - Inline tokens and inline CSS motion do not require localhost/fusion file-write
232
+ hardening.
233
+
234
+ ## Surface Index Strategy
235
+
236
+ Do not start by building a large `design_surface_indexes` cache table.
237
+
238
+ Start with a lazy typed aggregation layer over existing data:
239
+
240
+ - code-layer projection
241
+ - tweak definitions and selections
242
+ - token parser output
243
+ - selected node metadata
244
+ - motion timeline metadata
245
+ - state/capture rows
246
+ - review findings
247
+ - source capabilities
248
+
249
+ Only add cache tables when a specific feature proves it needs:
250
+
251
+ - cross-source consistency
252
+ - expensive repeated parsing
253
+ - stale/fresh status
254
+ - incremental rebuilds
255
+ - multi-user review durability
256
+
257
+ This avoids "build the framework first" while preserving the eventual spine.
258
+
259
+ ## Data Model
260
+
261
+ All schema changes must be additive. Do not drop, rename, truncate, or
262
+ destructively alter existing columns.
263
+
264
+ ### Early Data
265
+
266
+ Avoid new cache tables until needed. The first lanes can use:
267
+
268
+ - `designs.data.tweakSelections`
269
+ - `design_files.content`
270
+ - `design_versions`
271
+ - existing design/source metadata
272
+ - app state
273
+
274
+ ### Additive Tables When Needed
275
+
276
+ #### `component_index`
277
+
278
+ Real-app only. One row per discovered component/export/story group.
279
+
280
+ Fields:
281
+
282
+ - `id`
283
+ - `design_id`
284
+ - `source_ref`
285
+ - `name`
286
+ - `file_path`
287
+ - `export_name`
288
+ - `props`
289
+ - `variants`
290
+ - `stories`
291
+ - `source_span`
292
+ - `runtime_selectors`
293
+ - `created_at`
294
+ - `updated_at`
295
+
296
+ #### `motion_timeline`
297
+
298
+ Many per design. Scope by design plus source/screen/file/target context.
299
+
300
+ Fields:
301
+
302
+ - `id`
303
+ - `design_id`
304
+ - `source_type`
305
+ - `source_ref`
306
+ - `screen_id`
307
+ - `file_id`
308
+ - `file_path`
309
+ - `target_node_id`
310
+ - `selector`
311
+ - `tracks`
312
+ - `duration_ms`
313
+ - `default_ease`
314
+ - `compiled_hash`
315
+ - `created_at`
316
+ - `updated_at`
317
+
318
+ Notes:
319
+
320
+ - CSS is runtime truth.
321
+ - Timeline JSON is edit metadata.
322
+ - `compiled_hash` helps detect drift between metadata and managed CSS.
323
+ - A timeline can contain multiple target tracks.
324
+ - Do not use one row per design; that is too coarse.
325
+
326
+ #### `design_state`
327
+
328
+ States, fixtures, and captures.
329
+
330
+ Fields:
331
+
332
+ - `id`
333
+ - `design_id`
334
+ - `source_ref`
335
+ - `name`
336
+ - `kind`: `state`, `fixture`, or `capture`
337
+ - `breakpoint`
338
+ - `route`
339
+ - `data`
340
+ - `preview_ref`
341
+ - `created_at`
342
+ - `updated_at`
343
+
344
+ #### `design_review_snapshot`
345
+
346
+ Only add when review findings need durable snapshots beyond `design_versions`.
347
+
348
+ Fields:
349
+
350
+ - `id`
351
+ - `design_id`
352
+ - `base_version_id`
353
+ - `compare_version_id`
354
+ - `source_ref`
355
+ - `a11y_findings`
356
+ - `visual_diff`
357
+ - `status`
358
+ - `created_at`
359
+ - `updated_at`
360
+
361
+ ## UI Acceptance Criteria
362
+
363
+ ### Workbench
364
+
365
+ Follow the workbench screenshot.
366
+
367
+ Requirements:
368
+
369
+ - small app title
370
+ - segmented `Edit / Interact / Annotate`
371
+ - device dropdown
372
+ - zoom dropdown
373
+ - avatar and Share button
374
+ - searchable left layers rail
375
+ - `Screens` and `Layers` groups
376
+ - component rows marked with small accent diamond
377
+ - centered real app/design frame
378
+ - selected component has crisp accent outline
379
+ - small component/source tag on canvas
380
+ - right inspector keeps compact `Design / Tweaks / Extensions` tabs
381
+ - component details appear contextually inside Design
382
+ - bottom canvas toolbar stays compact
383
+ - Motion opens from a small bottom control
384
+
385
+ ### Motion Dock
386
+
387
+ Follow the motion screenshot.
388
+
389
+ Requirements:
390
+
391
+ - docked timeline on the same editor surface
392
+ - canvas remains visible above timeline
393
+ - animated layer rows
394
+ - property tracks
395
+ - time ruler
396
+ - diamond keyframes
397
+ - play/scrub controls
398
+ - auto-keyframe control
399
+ - primary `Write to CSS` action
400
+ - compact Motion/Keyframe inspector section
401
+ - no separate motion app/screen
402
+
403
+ ### Tokens Panel
404
+
405
+ Follow the tokens screenshot.
406
+
407
+ Requirements:
408
+
409
+ - friendly token names
410
+ - color swatches
411
+ - CSS variable names
412
+ - type scale rows
413
+ - radius input
414
+ - source chip such as `globals.css`
415
+ - single primary `New token` action
416
+ - calm gray row fills
417
+ - dense spacing
418
+ - understated labels
419
+
420
+ ### States And Responsive Panel
421
+
422
+ Follow the states screenshot.
423
+
424
+ Requirements:
425
+
426
+ - breakpoint segmented control: Auto, Desktop, Tablet, Mobile
427
+ - selectable state rows: Default, Logged out, Empty cart, Loading, Error
428
+ - fixture rows
429
+ - `Capture from running app` action
430
+ - real-app CTA when capture is unavailable
431
+
432
+ ### Review Panel
433
+
434
+ Follow the review screenshot.
435
+
436
+ Requirements:
437
+
438
+ - accessibility findings and visual diff in one compact panel
439
+ - severity dots
440
+ - concise issue text
441
+ - detail line
442
+ - optional gated Fix button
443
+ - diff rows with before/after values
444
+ - primary `Review changes` action
445
+
446
+ ### Extensions, Shaders, Assets Panel
447
+
448
+ Follow the extensions screenshot.
449
+
450
+ Requirements:
451
+
452
+ - extension list: Asset library, Shader fills, Token auditor, Motion presets
453
+ - selected extension controls inline
454
+ - agent/help text
455
+ - `Add extension` action
456
+ - shader preview before shader apply
457
+ - shader apply gated on runtime/write/fallback/diff proof
458
+
459
+ ## Actions
460
+
461
+ Every user-facing operation should have an action contract so the UI and agent
462
+ stay in parity.
463
+
464
+ Use `useActionQuery` / `useActionMutation` in UI. Do not create pass-through
465
+ REST routes for normal app operations.
466
+
467
+ ### Foundation
468
+
469
+ - `get-design-source-capabilities`
470
+ - read-only
471
+ - returns operation availability and reasons
472
+ - `get-design-surface-context`
473
+ - read-only
474
+ - lazy aggregate of current selection, source capabilities, code-layer data,
475
+ tokens, motion, state, and review summary
476
+
477
+ ### Tokens
478
+
479
+ - `index-design-tokens`
480
+ - read-only
481
+ - parses inline CSS vars and real-app token sources when available
482
+ - `preview-design-token-edit`
483
+ - preview-only
484
+ - updates canvas without committing source
485
+ - `apply-design-token-edit`
486
+ - inline: persists through existing tweak/CSS-var path
487
+ - real app: writes source only when `writeTokens` is available
488
+ - `create-design-token`
489
+ - gated by source capability
490
+
491
+ ### Motion
492
+
493
+ - `get-motion-timeline`
494
+ - read-only
495
+ - returns timeline data for selected design/source/screen/target
496
+ - `preview-motion-frame`
497
+ - preview-only
498
+ - may be implemented as client-to-iframe bridge messages
499
+ - `apply-motion-edit`
500
+ - atomic write action
501
+ - inline: updates managed CSS/design file through existing design-file path
502
+ - real app: updates source only when `writeMotion` is available
503
+ - `remove-motion-timeline`
504
+ - atomic removal of metadata and managed CSS block
505
+
506
+ ### Components
507
+
508
+ - `index-components`
509
+ - real-app capable only
510
+ - static AST/cva/Storybook first; dev transform later if needed
511
+ - `get-component-details`
512
+ - read-only
513
+ - returns file/export/props/variants/stories/instances
514
+ - `preview-component-prop-edit`
515
+ - preview-only
516
+ - `apply-component-prop-edit`
517
+ - real-app write only
518
+ - `open-component-source`
519
+ - uses `resolveNodeToFile` where available
520
+
521
+ ### States And Captures
522
+
523
+ - `list-design-states`
524
+ - read-only
525
+ - `create-design-state`
526
+ - adds manual inline state/fixture
527
+ - `capture-design-state`
528
+ - real app only when `captureState` is available
529
+ - `apply-design-state`
530
+ - selects state for preview and updates app state
531
+ - `delete-design-state`
532
+ - deletes user-authored state/capture
533
+
534
+ ### Review
535
+
536
+ - `run-design-audit`
537
+ - read-only first
538
+ - contrast, tap target, roles/names, alt, focus/reduced-motion hints
539
+ - `get-design-review`
540
+ - read-only
541
+ - returns findings and visual diff
542
+ - `preview-a11y-fix`
543
+ - preview-only
544
+ - `apply-a11y-fix`
545
+ - gated; real app for semantic source fixes
546
+ - `create-design-review-snapshot`
547
+ - optional durable snapshot
548
+
549
+ ### Make It Real / Builder / Branches
550
+
551
+ - `connect-builder-app`
552
+ - wrapper or app-specific flow around existing Builder connect surfaces
553
+ - `migrate-inline-design-to-fusion`
554
+ - generates/migrates inline design into a hosted real app source
555
+ - `get-design-branch-diff`
556
+ - real app only
557
+ - `deploy-design-preview`
558
+ - real app only
559
+
560
+ Do not depend on first-party internal container infra in early implementation.
561
+ Use existing Builder-hosted branch/cloud-agent paths first.
562
+
563
+ ### Extensions, Assets, Shaders
564
+
565
+ - `list-design-extensions`
566
+ - `run-design-extension-action`
567
+ - `insert-design-asset`
568
+ - `preview-shader-fill`
569
+ - `apply-shader-fill`
570
+
571
+ `apply-shader-fill` stays disabled until runtime rendering, fallback generation,
572
+ source write, and diff proof are all available.
573
+
574
+ ## Application State
575
+
576
+ Expose enough state for the agent to act without asking what the user is
577
+ looking at.
578
+
579
+ Recommended shape:
580
+
581
+ ```ts
582
+ type DesignNavigationState = {
583
+ view: "design-editor" | "design-overview" | "design-review";
584
+ designId: string;
585
+ sourceType: "inline" | "localhost" | "fusion";
586
+ screenId?: string;
587
+ fileId?: string;
588
+ route?: string;
589
+ mode: "edit" | "interact" | "annotate";
590
+ selectedNodeIds: string[];
591
+ selectedComponentId?: string;
592
+ selectedTokenId?: string;
593
+ selectedStateId?: string;
594
+ inspectorTab: "design" | "tweaks" | "extensions";
595
+ inspectorSection?:
596
+ | "component"
597
+ | "tokens"
598
+ | "motion"
599
+ | "states"
600
+ | "review"
601
+ | "extension"
602
+ | "make-real";
603
+ dock?: {
604
+ kind: "motion" | "review" | null;
605
+ open: boolean;
606
+ };
607
+ motion?: {
608
+ timelineId?: string;
609
+ playheadMs: number;
610
+ selectedTrackId?: string;
611
+ selectedKeyframeId?: string;
612
+ previewing: boolean;
613
+ };
614
+ breakpoint?: "auto" | "desktop" | "tablet" | "mobile";
615
+ sourceCapabilities: string[];
616
+ };
617
+ ```
618
+
619
+ Update:
620
+
621
+ - `navigate`
622
+ - `view-screen`
623
+ - editor route state writes
624
+ - selected layer/node state
625
+ - selected component/token/state
626
+ - active breakpoint
627
+ - open dock
628
+ - motion playhead and selected keyframe
629
+ - current capability matrix
630
+
631
+ `view-screen` should return:
632
+
633
+ - selected component/source metadata
634
+ - token context
635
+ - motion context
636
+ - selected state/capture/breakpoint
637
+ - source capabilities
638
+ - open panel/dock
639
+ - review summary
640
+ - make-it-real CTA availability
641
+
642
+ ## Agent Instructions And Skills
643
+
644
+ Update `templates/design/AGENTS.md` with:
645
+
646
+ - runtime tier rules
647
+ - capability gate rules
648
+ - action names and arguments
649
+ - make-it-real routing
650
+ - screenshot visual acceptance criteria
651
+ - motion preview/apply discipline
652
+ - shader gating
653
+ - `fusion` as the hosted/Builder-backed future source mode
654
+
655
+ Consider a dedicated skill:
656
+
657
+ - `.agents/skills/design-studio/SKILL.md`
658
+
659
+ The skill should teach agents:
660
+
661
+ - inspect capabilities before offering writes
662
+ - choose inline vs real-app behavior
663
+ - preview before apply
664
+ - use token, motion, component, state, and review actions
665
+ - offer make-it-real CTAs when a capability is gated
666
+ - preserve minimal editor chrome
667
+
668
+ ## Implementation Phases
669
+
670
+ ### Phase 0: Capability Gates And Visual Primitives
671
+
672
+ Goal: add the thin source capability layer and align the editor shell with the
673
+ screenshot direction.
674
+
675
+ Work:
676
+
677
+ - add `get-design-source-capabilities`
678
+ - add UI helpers for enabled/disabled/read-only/CTA states
679
+ - normalize source capability checks around `source-mode.ts`
680
+ - add or refine shared compact panel primitives:
681
+ - row
682
+ - segmented control
683
+ - swatch row
684
+ - severity row
685
+ - property group
686
+ - inspector CTA card
687
+ - align editor shell with screenshots
688
+
689
+ Do not:
690
+
691
+ - harden localhost/fusion file writes yet
692
+ - build a large surface-index cache table
693
+ - block Tier-A tokens/motion on real-app work
694
+
695
+ Exit criteria:
696
+
697
+ - UI can explain why a control is available, read-only, or gated.
698
+ - Editor shell can host Tokens, States, Review, Extensions, and Motion without
699
+ new permanent chrome.
700
+
701
+ ### Phase 1: Tier-A Tokens And Inline Motion
702
+
703
+ Goal: ship the first cheap user-visible win without waiting for real-app writes.
704
+
705
+ Work:
706
+
707
+ - Tokens panel as a first-class face on the existing Tweaks/CSS-var path.
708
+ - Token parsing for inline design CSS variables.
709
+ - Token preview and apply through existing persisted tweak/design-file paths.
710
+ - CSS-first Motion dock for inline documents.
711
+ - Managed `<style data-agent-native-motion>` block.
712
+ - Preview-only motion scrub messages.
713
+ - Atomic inline `apply-motion-edit`.
714
+
715
+ Exit criteria:
716
+
717
+ - User can edit a token in inline mode and see it persist.
718
+ - User can add/scrub/write simple multi-layer CSS keyframes in inline mode.
719
+ - No localhost/fusion `readFile/applyEdit/writeFile` hardening required.
720
+
721
+ ### Phase 2: Make-It-Real CTA Boundary
722
+
723
+ Goal: teach the product boundary early.
724
+
725
+ Work:
726
+
727
+ - show CTA cards in gated real-app controls
728
+ - connect CTA to existing Builder connect/handoff surfaces
729
+ - preserve original inline design/version before any migration
730
+ - use `fusion` for hosted/Builder-backed source descriptors
731
+
732
+ Exit criteria:
733
+
734
+ - Inline users understand why full components, data captures, source token
735
+ writes, branches, and deploys require a real app.
736
+ - CTA is contextual, not permanent chrome.
737
+
738
+ ### Phase 3: Components For Real Apps
739
+
740
+ Goal: unlock the main Figma-competitor component story where it can be true.
741
+
742
+ Work:
743
+
744
+ - add lightweight inline component annotations only as hints:
745
+ - `data-agent-native-component`
746
+ - `data-agent-native-prop-*`
747
+ - do not gold-plate Alpine components
748
+ - add real-app component indexing:
749
+ - TypeScript props
750
+ - cva/tailwind-variants
751
+ - Storybook where present
752
+ - config overrides
753
+ - mark component instances in code-layer projection
754
+ - accent outline component instances
755
+ - add contextual component inspector section
756
+ - support jump to source through `resolveNodeToFile`
757
+
758
+ Exit criteria:
759
+
760
+ - Real app component instance selection shows source, props, variants, and state
761
+ controls.
762
+ - Inline mode shows only lightweight region hints plus make-it-real CTA.
763
+
764
+ ### Phase 4: Real-App Token Writes And Bridge Hardening
765
+
766
+ Goal: make tokens-as-code real.
767
+
768
+ Work:
769
+
770
+ - harden source file write path for real-app mode:
771
+ - `readFile`
772
+ - `applyEdit`
773
+ - `writeFile`
774
+ - preview diff
775
+ - permission/session grant
776
+ - rollback proof
777
+ - parse `globals.css`, Tailwind theme conventions, and token/theme files
778
+ - write token edits to source only when `writeTokens` is available
779
+
780
+ Exit criteria:
781
+
782
+ - Real app token edits patch source files safely.
783
+ - Inline token edits continue using the cheaper existing path.
784
+
785
+ ### Phase 5: Real-App Motion Writes
786
+
787
+ Goal: extend CSS-first motion to source files.
788
+
789
+ Work:
790
+
791
+ - scope `motion_timeline` by design/source/screen/file/target
792
+ - compile deterministic managed CSS
793
+ - compose transform tracks safely
794
+ - add `compiled_hash` drift detection
795
+ - write source CSS only when `writeMotion` is available
796
+ - keep `motion/react` as later optional adapter
797
+
798
+ Exit criteria:
799
+
800
+ - Inline and real app share one mental model: managed CSS keyframes.
801
+ - Source-file motion writes are atomic and diffable.
802
+
803
+ ### Phase 6: States, Responsive, And Captures
804
+
805
+ Goal: make states and responsive contexts first-class.
806
+
807
+ Work:
808
+
809
+ - breakpoint selector: Auto, Desktop, Tablet, Mobile
810
+ - inline state snapshots
811
+ - design fixtures
812
+ - real-app captures through `captureState` where available
813
+ - selected state/breakpoint in app state
814
+
815
+ Exit criteria:
816
+
817
+ - Inline mode supports manual design states and breakpoint previews.
818
+ - Real app mode captures route/app state into selectable contexts.
819
+
820
+ ### Phase 7: Accessibility And Review
821
+
822
+ Goal: ship read-only review first, fixes later.
823
+
824
+ Work:
825
+
826
+ - contrast checks
827
+ - tap target checks
828
+ - basic roles/names/alt/focus/reduced-motion hints
829
+ - review panel
830
+ - visual diff over `design_versions`
831
+ - optional durable review snapshot
832
+ - gated fix actions
833
+
834
+ Exit criteria:
835
+
836
+ - Review panel shows accessibility issues and visual diffs.
837
+ - Fix buttons are read-only/gated until source writes are safe.
838
+
839
+ ### Phase 8: Branches, Preview, Deploy
840
+
841
+ Goal: connect visual editing to real app shipping.
842
+
843
+ Work:
844
+
845
+ - Builder-hosted branch workflow first
846
+ - branch diff
847
+ - preview deploy
848
+ - deploy
849
+ - rollback/revert
850
+ - later: internal durable container infra if needed
851
+
852
+ Exit criteria:
853
+
854
+ - Real app edits can become reviewable branch/deploy work.
855
+ - The plan does not depend on unbuilt internal container infrastructure.
856
+
857
+ ### Phase 9: Extensions, Assets, Shaders
858
+
859
+ Goal: keep advanced lanes powerful but contained.
860
+
861
+ Work:
862
+
863
+ - selection-aware asset insertion
864
+ - inline extension panels
865
+ - token auditor extension
866
+ - motion presets extension
867
+ - shader preview
868
+ - shader apply only after:
869
+ - runtime render works
870
+ - CSS fallback exists
871
+ - source write exists
872
+ - diff/rollback proof exists
873
+
874
+ Exit criteria:
875
+
876
+ - Extensions do not add permanent chrome.
877
+ - Shaders are preview-first and safely gated.
878
+
879
+ ## Parallel Workstreams
880
+
881
+ Run these in parallel when implementation starts:
882
+
883
+ 1. Visual shell and panel primitives.
884
+ 2. Capability gates and app-state/view-screen updates.
885
+ 3. Tier-A tokens on Tweaks/CSS vars.
886
+ 4. Inline CSS-first motion dock.
887
+ 5. Make-it-real CTA and Builder/fusion handoff.
888
+ 6. Real-app component index.
889
+ 7. Real-app source-write hardening.
890
+ 8. States/captures.
891
+ 9. Review/a11y/diff.
892
+ 10. Extensions/assets/shader gating.
893
+
894
+ Keep write scopes disjoint when using parallel workers.
895
+
896
+ ## Verification
897
+
898
+ ### Docs/Contract
899
+
900
+ - `sourceType` remains `inline | localhost | fusion`.
901
+ - Capability names are documented in `AGENTS.md`.
902
+ - Agent actions are documented with arguments and safe usage.
903
+ - Make-it-real boundary is documented.
904
+
905
+ ### UI
906
+
907
+ Use Playwright/screenshot checks for:
908
+
909
+ - workbench component-selected state
910
+ - motion dock open state
911
+ - tokens panel
912
+ - states panel
913
+ - review panel
914
+ - extensions panel
915
+ - inline make-it-real CTA
916
+
917
+ ### Actions
918
+
919
+ Test:
920
+
921
+ - capability gate returns expected availability
922
+ - token preview/apply in inline mode
923
+ - motion preview does not persist
924
+ - motion apply persists managed CSS
925
+ - component index handles representative React/cva fixture
926
+ - capture state respects source capabilities
927
+ - a11y audit returns stable findings
928
+
929
+ ### Agent Parity
930
+
931
+ Verify the agent can:
932
+
933
+ - inspect selected component/token/motion/state via `view-screen`
934
+ - refresh surface context
935
+ - apply an inline token edit
936
+ - create/apply inline motion
937
+ - explain gated real-app features
938
+ - trigger make-it-real flow
939
+ - run review and summarize findings
940
+
941
+ ### Real-App Smoke
942
+
943
+ When real-app support lands:
944
+
945
+ - connect Builder or localhost
946
+ - index a React component
947
+ - select instance on canvas
948
+ - show props and source
949
+ - preview prop edit
950
+ - apply safe source edit
951
+ - parse and write token source
952
+ - capture route/app state
953
+ - generate visual/code diff
954
+ - deploy preview
955
+
956
+ ### Inline Smoke
957
+
958
+ - edit layout
959
+ - edit CSS variable token
960
+ - add simple keyframe motion
961
+ - switch responsive frame
962
+ - run basic a11y scan
963
+ - see CTA for full component/source features
964
+
965
+ ## Risks
966
+
967
+ ### Bridge Hardening Blocks Cheap Wins
968
+
969
+ Mitigation:
970
+
971
+ - capability gates first
972
+ - bridge hardening with real-app lane
973
+ - inline tokens/motion use existing design-file paths
974
+
975
+ ### Surface Index Becomes Framework-First Work
976
+
977
+ Mitigation:
978
+
979
+ - lazy aggregation first
980
+ - cache tables only after real performance/freshness need
981
+
982
+ ### Split Motion Source Of Truth
983
+
984
+ Mitigation:
985
+
986
+ - CSS is runtime truth
987
+ - JSON is edit metadata
988
+ - atomic apply
989
+ - `compiled_hash`
990
+ - diff/rollback proof
991
+
992
+ ### Alpine Components Become A Time Sink
993
+
994
+ Mitigation:
995
+
996
+ - keep inline components as lightweight annotated regions
997
+ - real component intelligence is real-app only
998
+
999
+ ### Overclaiming Real-App Writes
1000
+
1001
+ Mitigation:
1002
+
1003
+ - explicit source capabilities
1004
+ - preview/apply split
1005
+ - disabled/read-only/CTA states
1006
+ - no inferred writes from source type
1007
+
1008
+ ### Inspector Sprawl
1009
+
1010
+ Mitigation:
1011
+
1012
+ - contextual sections
1013
+ - one bottom dock
1014
+ - extension panels
1015
+ - no new permanent tabs without evidence
1016
+
1017
+ ### Shader Prematurity
1018
+
1019
+ Mitigation:
1020
+
1021
+ - preview first
1022
+ - apply later behind runtime/source/fallback/diff gates
1023
+
1024
+ ## Initial Milestone
1025
+
1026
+ The first milestone should not be full React component editing. That requires too
1027
+ much unbuilt real-app plumbing.
1028
+
1029
+ The first milestone is:
1030
+
1031
+ > In an inline design, open the screenshot-aligned Tokens panel, edit a friendly
1032
+ > CSS variable token through the existing Tweaks path, open the Motion dock, add
1033
+ > a simple multi-layer CSS keyframe animation, preview it by scrubbing, and write
1034
+ > it into the design document with a visible proof.
1035
+
1036
+ This proves the thesis cheaply:
1037
+
1038
+ - visual edit becomes durable CSS/design data
1039
+ - editor shell matches the visual direction
1040
+ - capability gates and CTAs establish honest product boundaries
1041
+ - the future real-app path is visible without blocking the first win
1042
+
1043
+ ## Canonical Execution Order
1044
+
1045
+ 1. Capability gates and screenshot-aligned UI primitives.
1046
+ 2. Tier-A Tokens panel on existing Tweaks/CSS-var path.
1047
+ 3. Tier-A CSS-first Motion dock and inline managed keyframes.
1048
+ 4. Make-it-real CTAs and Builder/fusion handoff framing.
1049
+ 5. Real-app component indexing and component inspector.
1050
+ 6. Real-app source-write hardening for tokens and motion.
1051
+ 7. States, responsive contexts, and captures.
1052
+ 8. Read-only accessibility and visual diff review.
1053
+ 9. Branch, preview, deploy, and rollback.
1054
+ 10. Assets, shaders, plugins as gated extension lanes.