@agent-native/core 0.128.3 → 0.129.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +91 -0
  3. package/corpus/core/docs/content/template-design-collaboration-and-full-apps.mdx +3 -1
  4. package/corpus/core/package.json +6 -3
  5. package/corpus/core/src/a2a/client.ts +18 -4
  6. package/corpus/core/src/a2a/server.ts +19 -3
  7. package/corpus/core/src/a2a/types.ts +7 -0
  8. package/corpus/core/src/action.ts +43 -16
  9. package/corpus/core/src/agent/engine/ai-sdk-engine.ts +14 -10
  10. package/corpus/core/src/agent/production-agent.ts +41 -3
  11. package/corpus/core/src/agent/thread-data-builder.ts +5 -0
  12. package/corpus/core/src/chat-threads/migrations.ts +53 -0
  13. package/corpus/core/src/cli/create.ts +4 -0
  14. package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +36 -16
  15. package/corpus/core/src/cli/skills.ts +16 -0
  16. package/corpus/core/src/client/AgentPanel.tsx +9 -5
  17. package/corpus/core/src/client/AssistantChat.tsx +138 -46
  18. package/corpus/core/src/client/MultiTabAssistantChat.tsx +16 -10
  19. package/corpus/core/src/client/agent-chat-adapter.ts +21 -3
  20. package/corpus/core/src/client/analytics.ts +159 -102
  21. package/corpus/core/src/client/chat/legacy-chart-shorthand.tsx +479 -0
  22. package/corpus/core/src/client/chat/markdown-renderer.tsx +23 -3
  23. package/corpus/core/src/client/chat/message-components.tsx +12 -5
  24. package/corpus/core/src/client/chat/runtime.ts +2 -1
  25. package/corpus/core/src/client/chat/tool-call-display.tsx +25 -2
  26. package/corpus/core/src/client/chat-model-groups.ts +3 -0
  27. package/corpus/core/src/client/client-status-requests.ts +161 -0
  28. package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +2 -2
  29. package/corpus/core/src/client/sse-event-processor.ts +15 -3
  30. package/corpus/core/src/client/use-agent-engine-configured.ts +54 -50
  31. package/corpus/core/src/client/use-chat-models.ts +16 -11
  32. package/corpus/core/src/client/use-chat-threads.ts +32 -9
  33. package/corpus/core/src/client/use-session.ts +4 -5
  34. package/corpus/core/src/db/client.ts +83 -8
  35. package/corpus/core/src/db/ensure-additive-columns.ts +31 -20
  36. package/corpus/core/src/db/migrations.ts +22 -2
  37. package/corpus/core/src/extensions/actions.ts +1 -1
  38. package/corpus/core/src/mcp/approval-store.ts +99 -0
  39. package/corpus/core/src/mcp/build-server.ts +579 -303
  40. package/corpus/core/src/mcp/embed-app.ts +1 -1
  41. package/corpus/core/src/mcp/oauth-client-metadata.ts +380 -0
  42. package/corpus/core/src/mcp/oauth-route.ts +57 -52
  43. package/corpus/core/src/mcp/screen-memory-stdio.ts +400 -378
  44. package/corpus/core/src/mcp/server.ts +29 -145
  45. package/corpus/core/src/mcp/stdio.ts +72 -80
  46. package/corpus/core/src/mcp-client/manager.ts +6 -10
  47. package/corpus/core/src/mcp-client/oauth-client.ts +127 -36
  48. package/corpus/core/src/mcp-client/oauth-routes.ts +16 -6
  49. package/corpus/core/src/mcp-client/routes.ts +6 -5
  50. package/corpus/core/src/server/agent-capabilities.ts +20 -0
  51. package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +27 -0
  52. package/corpus/core/src/server/agent-chat-plugin.ts +18 -0
  53. package/corpus/core/src/server/transcribe-voice.ts +14 -5
  54. package/corpus/core/src/templates/default/.agents/skills/security/SKILL.md +13 -2
  55. package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
  56. package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
  57. package/corpus/core/src/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
  58. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +12 -0
  59. package/corpus/templates/analytics/.agents/skills/security/SKILL.md +13 -2
  60. package/corpus/templates/analytics/actions/generate-chart.ts +2 -2
  61. package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +1 -10
  62. package/corpus/templates/analytics/app/global.css +0 -31
  63. package/corpus/templates/analytics/app/lib/sql-query.ts +46 -20
  64. package/corpus/templates/analytics/changelog/2026-07-28-analytics-dashboard-loading-states-now-use-a-simpler-standar.md +6 -0
  65. package/corpus/templates/analytics/changelog/2026-07-28-analytics-dashboards-now-load-first-party-charts-reliably-in.md +6 -0
  66. package/corpus/templates/analytics/server/lib/first-party-analytics-cache.ts +42 -16
  67. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +4 -2
  68. package/corpus/templates/analytics/shared/sql-query-limits.ts +1 -0
  69. package/corpus/templates/assets/.agents/skills/security/SKILL.md +13 -2
  70. package/corpus/templates/brain/.agents/skills/security/SKILL.md +13 -2
  71. package/corpus/templates/calendar/.agents/skills/security/SKILL.md +13 -2
  72. package/corpus/templates/chat/.agents/skills/security/SKILL.md +13 -2
  73. package/corpus/templates/clips/.agents/skills/security/SKILL.md +13 -2
  74. package/corpus/templates/clips/app/components/player/player-controls.tsx +3 -6
  75. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +6 -2
  76. package/corpus/templates/clips/app/routes/share.$shareId.tsx +3 -1
  77. package/corpus/templates/clips/changelog/2026-07-28-copied-share-links-no-longer-leave-an-unnecessary-confirmati.md +6 -0
  78. package/corpus/templates/clips/changelog/2026-07-28-playback-skip-controls-no-longer-show-overlapping-numbers.md +6 -0
  79. package/corpus/templates/clips/changelog/2026-07-28-public-clips-share-buttons-now-use-a-clean-text-only-label.md +6 -0
  80. package/corpus/templates/clips/desktop/src/app.tsx +14 -17
  81. package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +3 -1
  82. package/corpus/templates/clips/desktop/src/styles.css +13 -10
  83. package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +2 -2
  84. package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +36 -0
  85. package/corpus/templates/content/.agents/skills/security/SKILL.md +13 -2
  86. package/corpus/templates/content/actions/_builder-cms-read-client.ts +155 -34
  87. package/corpus/templates/content/actions/_builder-docs-client.ts +151 -30
  88. package/corpus/templates/content/actions/stage-builder-source-bulk-update.ts +5 -2
  89. package/corpus/templates/content/app/root.tsx +35 -14
  90. package/corpus/templates/content/changelog/2026-07-28-builder-backed-files-media-fields-now-accept-direct-file-url.md +6 -0
  91. package/corpus/templates/content/changelog/2026-07-28-builder-content-reads-now-negotiate-the-newest-mcp-protocol-.md +6 -0
  92. package/corpus/templates/content/changelog/2026-07-28-public-content-pages-load-faster-before-the-optional-ask-sid.md +6 -0
  93. package/corpus/templates/design/.agents/skills/security/SKILL.md +13 -2
  94. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +36 -16
  95. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +42 -3
  96. package/corpus/templates/design/actions/open-visual-edit.ts +2 -1
  97. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +2 -2
  98. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +14 -15
  99. package/corpus/templates/design/app/components/design/ResponsiveInteractBar.tsx +314 -0
  100. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +88 -3
  101. package/corpus/templates/design/app/components/design/keyboard-shortcuts.ts +1 -1
  102. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +7 -6
  103. package/corpus/templates/design/app/i18n-data.ts +56 -11
  104. package/corpus/templates/design/app/i18n-responsive-interact.ts +183 -0
  105. package/corpus/templates/design/app/lib/agent-chat.ts +60 -0
  106. package/corpus/templates/design/app/pages/design-editor/responsive-interact.ts +89 -0
  107. package/corpus/templates/design/changelog/2026-07-28-design-edits-can-be-applied-through-the-host-coding-agent-fr.md +6 -0
  108. package/corpus/templates/design/changelog/2026-07-28-interact-mode-can-preview-designs-in-responsive-device-sizes.md +6 -0
  109. package/corpus/templates/design/changelog/2026-07-28-interact-mode-now-opens-a-full-screen-responsive-preview-wit.md +6 -0
  110. package/corpus/templates/design/changelog/2026-07-28-show-or-hide-design-editing-chrome-with-cmd-on-apple-devices.md +2 -2
  111. package/corpus/templates/design/changelog/2026-07-28-visual-edit-now-always-shows-the-live-running-app-in-the-can.md +6 -0
  112. package/corpus/templates/dispatch/.agents/skills/security/SKILL.md +13 -2
  113. package/corpus/templates/forms/.agents/skills/security/SKILL.md +13 -2
  114. package/corpus/templates/macros/.agents/skills/security/SKILL.md +13 -2
  115. package/corpus/templates/mail/.agents/skills/security/SKILL.md +13 -2
  116. package/corpus/templates/plan/.agents/skills/security/SKILL.md +13 -2
  117. package/corpus/templates/slides/.agents/skills/security/SKILL.md +13 -2
  118. package/corpus/templates/tasks/.agents/skills/security/SKILL.md +13 -2
  119. package/corpus/toolkit/CHANGELOG.md +13 -0
  120. package/corpus/toolkit/package.json +1 -1
  121. package/corpus/toolkit/src/chat-history.css +1 -2
  122. package/corpus/toolkit/src/composer/TiptapComposer.tsx +45 -0
  123. package/dist/a2a/client.d.ts +7 -0
  124. package/dist/a2a/client.d.ts.map +1 -1
  125. package/dist/a2a/client.js +8 -3
  126. package/dist/a2a/client.js.map +1 -1
  127. package/dist/a2a/server.d.ts.map +1 -1
  128. package/dist/a2a/server.js +18 -3
  129. package/dist/a2a/server.js.map +1 -1
  130. package/dist/a2a/types.d.ts +7 -0
  131. package/dist/a2a/types.d.ts.map +1 -1
  132. package/dist/a2a/types.js.map +1 -1
  133. package/dist/action.d.ts +15 -1
  134. package/dist/action.d.ts.map +1 -1
  135. package/dist/action.js +39 -16
  136. package/dist/action.js.map +1 -1
  137. package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
  138. package/dist/agent/engine/ai-sdk-engine.js +14 -10
  139. package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
  140. package/dist/agent/production-agent.d.ts.map +1 -1
  141. package/dist/agent/production-agent.js +35 -7
  142. package/dist/agent/production-agent.js.map +1 -1
  143. package/dist/agent/thread-data-builder.d.ts +2 -0
  144. package/dist/agent/thread-data-builder.d.ts.map +1 -1
  145. package/dist/agent/thread-data-builder.js +3 -0
  146. package/dist/agent/thread-data-builder.js.map +1 -1
  147. package/dist/chat-threads/migrations.d.ts +21 -0
  148. package/dist/chat-threads/migrations.d.ts.map +1 -0
  149. package/dist/chat-threads/migrations.js +45 -0
  150. package/dist/chat-threads/migrations.js.map +1 -0
  151. package/dist/cli/create.d.ts.map +1 -1
  152. package/dist/cli/create.js +4 -0
  153. package/dist/cli/create.js.map +1 -1
  154. package/dist/cli/skills-content/design-visual-edit-skill.d.ts +1 -1
  155. package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -1
  156. package/dist/cli/skills-content/design-visual-edit-skill.js +36 -16
  157. package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -1
  158. package/dist/cli/skills.d.ts.map +1 -1
  159. package/dist/cli/skills.js +15 -0
  160. package/dist/cli/skills.js.map +1 -1
  161. package/dist/client/AgentPanel.d.ts.map +1 -1
  162. package/dist/client/AgentPanel.js +6 -5
  163. package/dist/client/AgentPanel.js.map +1 -1
  164. package/dist/client/AssistantChat.d.ts +37 -0
  165. package/dist/client/AssistantChat.d.ts.map +1 -1
  166. package/dist/client/AssistantChat.js +41 -8
  167. package/dist/client/AssistantChat.js.map +1 -1
  168. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  169. package/dist/client/MultiTabAssistantChat.js +11 -10
  170. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  171. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  172. package/dist/client/agent-chat-adapter.js +19 -3
  173. package/dist/client/agent-chat-adapter.js.map +1 -1
  174. package/dist/client/analytics.d.ts.map +1 -1
  175. package/dist/client/analytics.js +150 -101
  176. package/dist/client/analytics.js.map +1 -1
  177. package/dist/client/chat/legacy-chart-shorthand.d.ts +29 -0
  178. package/dist/client/chat/legacy-chart-shorthand.d.ts.map +1 -0
  179. package/dist/client/chat/legacy-chart-shorthand.js +330 -0
  180. package/dist/client/chat/legacy-chart-shorthand.js.map +1 -0
  181. package/dist/client/chat/markdown-renderer.d.ts.map +1 -1
  182. package/dist/client/chat/markdown-renderer.js +8 -2
  183. package/dist/client/chat/markdown-renderer.js.map +1 -1
  184. package/dist/client/chat/message-components.d.ts +2 -1
  185. package/dist/client/chat/message-components.d.ts.map +1 -1
  186. package/dist/client/chat/message-components.js +11 -4
  187. package/dist/client/chat/message-components.js.map +1 -1
  188. package/dist/client/chat/runtime.d.ts.map +1 -1
  189. package/dist/client/chat/runtime.js +2 -1
  190. package/dist/client/chat/runtime.js.map +1 -1
  191. package/dist/client/chat/tool-call-display.d.ts +4 -1
  192. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  193. package/dist/client/chat/tool-call-display.js +14 -8
  194. package/dist/client/chat/tool-call-display.js.map +1 -1
  195. package/dist/client/chat-model-groups.d.ts.map +1 -1
  196. package/dist/client/chat-model-groups.js +3 -0
  197. package/dist/client/chat-model-groups.js.map +1 -1
  198. package/dist/client/client-status-requests.d.ts +14 -0
  199. package/dist/client/client-status-requests.d.ts.map +1 -0
  200. package/dist/client/client-status-requests.js +126 -0
  201. package/dist/client/client-status-requests.js.map +1 -0
  202. package/dist/client/settings/VoiceTranscriptionSection.js +1 -1
  203. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  204. package/dist/client/sse-event-processor.d.ts +7 -0
  205. package/dist/client/sse-event-processor.d.ts.map +1 -1
  206. package/dist/client/sse-event-processor.js +8 -3
  207. package/dist/client/sse-event-processor.js.map +1 -1
  208. package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
  209. package/dist/client/use-agent-engine-configured.js +29 -43
  210. package/dist/client/use-agent-engine-configured.js.map +1 -1
  211. package/dist/client/use-chat-models.d.ts.map +1 -1
  212. package/dist/client/use-chat-models.js +11 -11
  213. package/dist/client/use-chat-models.js.map +1 -1
  214. package/dist/client/use-chat-threads.d.ts.map +1 -1
  215. package/dist/client/use-chat-threads.js +23 -7
  216. package/dist/client/use-chat-threads.js.map +1 -1
  217. package/dist/client/use-session.d.ts.map +1 -1
  218. package/dist/client/use-session.js +4 -4
  219. package/dist/client/use-session.js.map +1 -1
  220. package/dist/collab/awareness.d.ts +2 -2
  221. package/dist/collab/awareness.d.ts.map +1 -1
  222. package/dist/db/client.d.ts.map +1 -1
  223. package/dist/db/client.js +48 -4
  224. package/dist/db/client.js.map +1 -1
  225. package/dist/db/ensure-additive-columns.d.ts.map +1 -1
  226. package/dist/db/ensure-additive-columns.js +32 -21
  227. package/dist/db/ensure-additive-columns.js.map +1 -1
  228. package/dist/db/migrations.d.ts +9 -0
  229. package/dist/db/migrations.d.ts.map +1 -1
  230. package/dist/db/migrations.js +14 -3
  231. package/dist/db/migrations.js.map +1 -1
  232. package/dist/extensions/actions.js +1 -1
  233. package/dist/extensions/actions.js.map +1 -1
  234. package/dist/mcp/approval-store.d.ts +16 -0
  235. package/dist/mcp/approval-store.d.ts.map +1 -0
  236. package/dist/mcp/approval-store.js +85 -0
  237. package/dist/mcp/approval-store.js.map +1 -0
  238. package/dist/mcp/build-server.d.ts +1 -34
  239. package/dist/mcp/build-server.d.ts.map +1 -1
  240. package/dist/mcp/build-server.js +220 -23
  241. package/dist/mcp/build-server.js.map +1 -1
  242. package/dist/mcp/embed-app.js +1 -1
  243. package/dist/mcp/embed-app.js.map +1 -1
  244. package/dist/mcp/oauth-client-metadata.d.ts +15 -0
  245. package/dist/mcp/oauth-client-metadata.d.ts.map +1 -0
  246. package/dist/mcp/oauth-client-metadata.js +297 -0
  247. package/dist/mcp/oauth-client-metadata.js.map +1 -0
  248. package/dist/mcp/oauth-route.d.ts.map +1 -1
  249. package/dist/mcp/oauth-route.js +39 -53
  250. package/dist/mcp/oauth-route.js.map +1 -1
  251. package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
  252. package/dist/mcp/screen-memory-stdio.js +304 -296
  253. package/dist/mcp/screen-memory-stdio.js.map +1 -1
  254. package/dist/mcp/server.d.ts +12 -25
  255. package/dist/mcp/server.d.ts.map +1 -1
  256. package/dist/mcp/server.js +24 -133
  257. package/dist/mcp/server.js.map +1 -1
  258. package/dist/mcp/stdio.d.ts.map +1 -1
  259. package/dist/mcp/stdio.js +36 -35
  260. package/dist/mcp/stdio.js.map +1 -1
  261. package/dist/mcp-client/manager.d.ts.map +1 -1
  262. package/dist/mcp-client/manager.js +6 -6
  263. package/dist/mcp-client/manager.js.map +1 -1
  264. package/dist/mcp-client/oauth-client.d.ts +13 -17
  265. package/dist/mcp-client/oauth-client.d.ts.map +1 -1
  266. package/dist/mcp-client/oauth-client.js +74 -16
  267. package/dist/mcp-client/oauth-client.js.map +1 -1
  268. package/dist/mcp-client/oauth-routes.d.ts +2 -2
  269. package/dist/mcp-client/oauth-routes.d.ts.map +1 -1
  270. package/dist/mcp-client/oauth-routes.js +16 -6
  271. package/dist/mcp-client/oauth-routes.js.map +1 -1
  272. package/dist/mcp-client/routes.js +5 -5
  273. package/dist/mcp-client/routes.js.map +1 -1
  274. package/dist/notifications/routes.d.ts +1 -1
  275. package/dist/progress/routes.d.ts +1 -1
  276. package/dist/resources/handlers.d.ts +1 -1
  277. package/dist/secrets/routes.d.ts +9 -9
  278. package/dist/server/agent-capabilities.d.ts.map +1 -1
  279. package/dist/server/agent-capabilities.js +21 -0
  280. package/dist/server/agent-capabilities.js.map +1 -1
  281. package/dist/server/agent-chat/action-filters-a2a.d.ts +14 -0
  282. package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
  283. package/dist/server/agent-chat/action-filters-a2a.js +16 -0
  284. package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
  285. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  286. package/dist/server/agent-chat-plugin.js +11 -1
  287. package/dist/server/agent-chat-plugin.js.map +1 -1
  288. package/dist/server/transcribe-voice.js +12 -6
  289. package/dist/server/transcribe-voice.js.map +1 -1
  290. package/dist/templates/chat/.agents/skills/security/SKILL.md +13 -2
  291. package/dist/templates/default/.agents/skills/security/SKILL.md +13 -2
  292. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
  293. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
  294. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
  295. package/docs/content/template-design-collaboration-and-full-apps.mdx +3 -1
  296. package/package.json +7 -4
  297. package/src/a2a/client.ts +18 -4
  298. package/src/a2a/server.ts +19 -3
  299. package/src/a2a/types.ts +7 -0
  300. package/src/action.ts +43 -16
  301. package/src/agent/engine/ai-sdk-engine.ts +14 -10
  302. package/src/agent/production-agent.ts +41 -3
  303. package/src/agent/thread-data-builder.ts +5 -0
  304. package/src/chat-threads/migrations.ts +53 -0
  305. package/src/cli/create.ts +4 -0
  306. package/src/cli/skills-content/design-visual-edit-skill.ts +36 -16
  307. package/src/cli/skills.ts +16 -0
  308. package/src/client/AgentPanel.tsx +9 -5
  309. package/src/client/AssistantChat.tsx +138 -46
  310. package/src/client/MultiTabAssistantChat.tsx +16 -10
  311. package/src/client/agent-chat-adapter.ts +21 -3
  312. package/src/client/analytics.ts +159 -102
  313. package/src/client/chat/legacy-chart-shorthand.tsx +479 -0
  314. package/src/client/chat/markdown-renderer.tsx +23 -3
  315. package/src/client/chat/message-components.tsx +12 -5
  316. package/src/client/chat/runtime.ts +2 -1
  317. package/src/client/chat/tool-call-display.tsx +25 -2
  318. package/src/client/chat-model-groups.ts +3 -0
  319. package/src/client/client-status-requests.ts +161 -0
  320. package/src/client/settings/VoiceTranscriptionSection.tsx +2 -2
  321. package/src/client/sse-event-processor.ts +15 -3
  322. package/src/client/use-agent-engine-configured.ts +54 -50
  323. package/src/client/use-chat-models.ts +16 -11
  324. package/src/client/use-chat-threads.ts +32 -9
  325. package/src/client/use-session.ts +4 -5
  326. package/src/db/client.ts +83 -8
  327. package/src/db/ensure-additive-columns.ts +31 -20
  328. package/src/db/migrations.ts +22 -2
  329. package/src/extensions/actions.ts +1 -1
  330. package/src/mcp/approval-store.ts +99 -0
  331. package/src/mcp/build-server.ts +579 -303
  332. package/src/mcp/embed-app.ts +1 -1
  333. package/src/mcp/oauth-client-metadata.ts +380 -0
  334. package/src/mcp/oauth-route.ts +57 -52
  335. package/src/mcp/screen-memory-stdio.ts +400 -378
  336. package/src/mcp/server.ts +29 -145
  337. package/src/mcp/stdio.ts +72 -80
  338. package/src/mcp-client/manager.ts +6 -10
  339. package/src/mcp-client/oauth-client.ts +127 -36
  340. package/src/mcp-client/oauth-routes.ts +16 -6
  341. package/src/mcp-client/routes.ts +6 -5
  342. package/src/server/agent-capabilities.ts +20 -0
  343. package/src/server/agent-chat/action-filters-a2a.ts +27 -0
  344. package/src/server/agent-chat-plugin.ts +18 -0
  345. package/src/server/transcribe-voice.ts +14 -5
  346. package/src/templates/chat/.agents/skills/security/SKILL.md +13 -2
  347. package/src/templates/default/.agents/skills/security/SKILL.md +13 -2
  348. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
  349. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
  350. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
@@ -8,6 +8,7 @@ import {
8
8
  keyboardShortcutLabels,
9
9
  } from "./i18n-keyboard-shortcuts";
10
10
  import { motionDockOverrides } from "./i18n-motion";
11
+ import { responsiveInteractOverrides } from "./i18n-responsive-interact";
11
12
  import { designTemplateFeatureOverrides } from "./i18n-template-feature";
12
13
  import zhTW from "./i18n/zh-TW";
13
14
 
@@ -467,6 +468,18 @@ const enUS = {
467
468
  "Responsive edits affect this breakpoint and smaller sizes by default. Change the scope beside the breakpoint control.",
468
469
  },
469
470
  },
471
+ responsiveInteract: {
472
+ device: "Device",
473
+ width: "Width",
474
+ widthAbbreviation: "W",
475
+ height: "Height",
476
+ heightAbbreviation: "H",
477
+ zoom: "Zoom",
478
+ zoomIn: "Zoom in",
479
+ zoomOut: "Zoom out",
480
+ zoomToPreset: "Zoom to {{percent}}%",
481
+ exit: "Exit full-screen preview",
482
+ },
470
483
  screenDeletion: {
471
484
  titleOne: "Delete this screen?",
472
485
  titleMany: "Delete {{count}} screens?",
@@ -951,7 +964,9 @@ const enUS = {
951
964
  copyPrompt: "Copy prompt to your agent",
952
965
  abortPreview: "Abort preview and interact",
953
966
  agentMessage: "Apply the pending visual style edits to the source.",
954
- sentToast: "Style edits sent to the Design agent",
967
+ sentToast: "Design updates sent to the agent",
968
+ agentHandoffFailedToast:
969
+ "Could not reach the agent. The preview was kept so you can retry or copy the prompt.",
955
970
  verifiedToast: "Source and runtime structure verified",
956
971
  conflictToast:
957
972
  "The reloaded runtime did not match the pending structure edit. The preview is still undoable; retry after resolving the source conflict.",
@@ -11140,7 +11155,9 @@ const designPendingVisualStyleOverrides = {
11140
11155
  copyPrompt: "將提示複製給您的代理",
11141
11156
  abortPreview: "中止預覽並互動",
11142
11157
  agentMessage: "將待處理的視覺樣式編輯套用到來源。",
11143
- sentToast: "樣式編輯已傳送給 Design 代理",
11158
+ sentToast: "設計更新已傳送給代理",
11159
+ agentHandoffFailedToast:
11160
+ "無法連線到代理。預覽已保留,您可以重試或複製提示。",
11144
11161
  verifiedToast: "已驗證來源與執行階段結構",
11145
11162
  conflictToast:
11146
11163
  "重新載入的執行階段與待處理的結構編輯不符。預覽仍可復原;請解決來源衝突後重試。",
@@ -11171,7 +11188,9 @@ const designPendingVisualStyleOverrides = {
11171
11188
  copyPrompt: "将提示复制给你的代理",
11172
11189
  abortPreview: "中止预览并互动",
11173
11190
  agentMessage: "将待处理的视觉样式编辑应用到源文件。",
11174
- sentToast: "样式编辑已发送给 Design 代理",
11191
+ sentToast: "设计更新已发送给代理",
11192
+ agentHandoffFailedToast:
11193
+ "无法连接到代理。预览已保留,你可以重试或复制提示。",
11175
11194
  verifiedToast: "已验证源文件和运行时结构",
11176
11195
  conflictToast:
11177
11196
  "重新加载的运行时与待处理的结构编辑不匹配。预览仍可撤销;请解决源文件冲突后重试。",
@@ -11203,7 +11222,9 @@ const designPendingVisualStyleOverrides = {
11203
11222
  abortPreview: "Cancelar vista previa e interactuar",
11204
11223
  agentMessage:
11205
11224
  "Aplica las ediciones visuales de estilo pendientes al código fuente.",
11206
- sentToast: "Ediciones de estilo enviadas al agente de Design",
11225
+ sentToast: "Actualizaciones de diseño enviadas al agente",
11226
+ agentHandoffFailedToast:
11227
+ "No se pudo contactar con el agente. Se conservó la vista previa para que puedas reintentar o copiar el prompt.",
11207
11228
  verifiedToast: "Código y estructura del runtime verificados",
11208
11229
  conflictToast:
11209
11230
  "El runtime recargado no coincide con la edición estructural pendiente. La vista previa aún se puede deshacer; resuelve el conflicto y vuelve a intentarlo.",
@@ -11236,7 +11257,9 @@ const designPendingVisualStyleOverrides = {
11236
11257
  abortPreview: "Annuler l’aperçu et interagir",
11237
11258
  agentMessage:
11238
11259
  "Appliquez les modifications visuelles de style en attente à la source.",
11239
- sentToast: "Modifications de style envoyées à l’agent Design",
11260
+ sentToast: "Mises à jour du design envoyées à l’agent",
11261
+ agentHandoffFailedToast:
11262
+ "Impossible de joindre l’agent. L’aperçu a été conservé pour réessayer ou copier le prompt.",
11240
11263
  verifiedToast: "Source et structure du runtime vérifiées",
11241
11264
  conflictToast:
11242
11265
  "Le runtime rechargé ne correspond pas à la modification de structure en attente. L’aperçu reste annulable ; résolvez le conflit puis réessayez.",
@@ -11269,7 +11292,9 @@ const designPendingVisualStyleOverrides = {
11269
11292
  abortPreview: "Vorschau abbrechen und interagieren",
11270
11293
  agentMessage:
11271
11294
  "Wende die ausstehenden visuellen Stiländerungen auf die Quelle an.",
11272
- sentToast: "Stiländerungen an den Design-Agent gesendet",
11295
+ sentToast: "Design-Updates an den Agenten gesendet",
11296
+ agentHandoffFailedToast:
11297
+ "Der Agent konnte nicht erreicht werden. Die Vorschau wurde beibehalten, damit du es erneut versuchen oder den Prompt kopieren kannst.",
11273
11298
  verifiedToast: "Quelle und Laufzeitstruktur überprüft",
11274
11299
  conflictToast:
11275
11300
  "Die neu geladene Laufzeit stimmt nicht mit der ausstehenden Strukturänderung überein. Die Vorschau kann weiterhin rückgängig gemacht werden; löse den Konflikt und versuche es erneut.",
@@ -11302,7 +11327,9 @@ const designPendingVisualStyleOverrides = {
11302
11327
  abortPreview: "プレビューを中止して操作",
11303
11328
  agentMessage:
11304
11329
  "保留中のビジュアルスタイル編集をソースに適用してください。",
11305
- sentToast: "スタイル編集を Design エージェントに送信しました",
11330
+ sentToast: "デザイン更新をエージェントに送信しました",
11331
+ agentHandoffFailedToast:
11332
+ "エージェントに接続できませんでした。再試行またはプロンプトのコピーができるよう、プレビューは保持されています。",
11306
11333
  verifiedToast: "ソースとランタイム構造を検証しました",
11307
11334
  conflictToast:
11308
11335
  "再読み込みしたランタイムが保留中の構造編集と一致しません。プレビューは元に戻せます。ソースの競合を解決して再試行してください。",
@@ -11334,7 +11361,9 @@ const designPendingVisualStyleOverrides = {
11334
11361
  copyPrompt: "에이전트에 프롬프트 복사",
11335
11362
  abortPreview: "미리보기를 중단하고 상호작용",
11336
11363
  agentMessage: "보류 중인 시각 스타일 편집을 소스에 적용하세요.",
11337
- sentToast: "스타일 편집을 Design 에이전트로 보냈습니다",
11364
+ sentToast: "디자인 업데이트를 에이전트로 보냈습니다",
11365
+ agentHandoffFailedToast:
11366
+ "에이전트에 연결할 수 없습니다. 다시 시도하거나 프롬프트를 복사할 수 있도록 미리보기를 유지했습니다.",
11338
11367
  verifiedToast: "소스와 런타임 구조를 확인했습니다",
11339
11368
  conflictToast:
11340
11369
  "다시 로드된 런타임이 보류 중인 구조 편집과 일치하지 않습니다. 미리보기는 계속 실행 취소할 수 있으니 소스 충돌을 해결한 뒤 다시 시도하세요.",
@@ -11367,7 +11396,9 @@ const designPendingVisualStyleOverrides = {
11367
11396
  abortPreview: "Cancelar prévia e interagir",
11368
11397
  agentMessage:
11369
11398
  "Aplique as edições visuais de estilo pendentes à origem.",
11370
- sentToast: "Edições de estilo enviadas ao agente Design",
11399
+ sentToast: "Atualizações de design enviadas ao agente",
11400
+ agentHandoffFailedToast:
11401
+ "Não foi possível acessar o agente. A prévia foi mantida para você tentar novamente ou copiar o prompt.",
11371
11402
  verifiedToast: "Origem e estrutura do runtime verificadas",
11372
11403
  conflictToast:
11373
11404
  "O runtime recarregado não corresponde à edição estrutural pendente. A prévia ainda pode ser desfeita; resolva o conflito e tente novamente.",
@@ -11399,7 +11430,9 @@ const designPendingVisualStyleOverrides = {
11399
11430
  copyPrompt: "Prompt अपने agent को कॉपी करें",
11400
11431
  abortPreview: "Preview रोकें और interact करें",
11401
11432
  agentMessage: "लंबित visual style edits को source पर लागू करें।",
11402
- sentToast: "Style edits Design agent को भेजे गए",
11433
+ sentToast: "Design updates agent को भेजे गए",
11434
+ agentHandoffFailedToast:
11435
+ "Agent तक नहीं पहुंच सके। Retry या prompt कॉपी करने के लिए preview रखा गया है।",
11403
11436
  verifiedToast: "Source और runtime structure सत्यापित हैं",
11404
11437
  conflictToast:
11405
11438
  "Reload हुआ runtime pending structure edit से मेल नहीं खाता। Preview अभी भी undo किया जा सकता है; source conflict हल करके फिर कोशिश करें।",
@@ -11430,7 +11463,9 @@ const designPendingVisualStyleOverrides = {
11430
11463
  copyPrompt: "نسخ الموجه إلى وكيلك",
11431
11464
  abortPreview: "إلغاء المعاينة والتفاعل",
11432
11465
  agentMessage: "طبّق تعديلات النمط المرئية المعلقة على المصدر.",
11433
- sentToast: "تم إرسال تعديلات النمط إلى وكيل Design",
11466
+ sentToast: "تم إرسال تحديثات التصميم إلى الوكيل",
11467
+ agentHandoffFailedToast:
11468
+ "تعذر الوصول إلى الوكيل. تم الاحتفاظ بالمعاينة لتتمكن من إعادة المحاولة أو نسخ الموجه.",
11434
11469
  verifiedToast: "تم التحقق من المصدر وبنية وقت التشغيل",
11435
11470
  conflictToast:
11436
11471
  "لا يطابق وقت التشغيل المعاد تحميله تعديل البنية المعلق. لا تزال المعاينة قابلة للتراجع؛ عالج تعارض المصدر ثم أعد المحاولة.",
@@ -15064,6 +15099,7 @@ export const messagesByLocale = {
15064
15099
  designAddLocalhostScreenOverrides["zh-TW"],
15065
15100
  designFillStylesComingSoonOverrides["zh-TW"],
15066
15101
  breakpointBarOverrides["zh-TW"],
15102
+ responsiveInteractOverrides["zh-TW"],
15067
15103
  motionDockOverrides["zh-TW"],
15068
15104
  ),
15069
15105
  ),
@@ -15092,6 +15128,7 @@ export const messagesByLocale = {
15092
15128
  designInteractionStatesOverrides["zh-CN"],
15093
15129
  designMotionAndBreakpointOverrides["zh-CN"],
15094
15130
  breakpointBarOverrides["zh-CN"],
15131
+ responsiveInteractOverrides["zh-CN"],
15095
15132
  motionDockOverrides["zh-CN"],
15096
15133
  designRuntimeIdentityAndBridgeOverrides["zh-CN"],
15097
15134
  designComponentInstanceOverrides["zh-CN"],
@@ -15170,6 +15207,7 @@ export const messagesByLocale = {
15170
15207
  designInteractionStatesOverrides["es-ES"],
15171
15208
  designMotionAndBreakpointOverrides["es-ES"],
15172
15209
  breakpointBarOverrides["es-ES"],
15210
+ responsiveInteractOverrides["es-ES"],
15173
15211
  motionDockOverrides["es-ES"],
15174
15212
  designRuntimeIdentityAndBridgeOverrides["es-ES"],
15175
15213
  designComponentInstanceOverrides["es-ES"],
@@ -15250,6 +15288,7 @@ export const messagesByLocale = {
15250
15288
  designInteractionStatesOverrides["fr-FR"],
15251
15289
  designMotionAndBreakpointOverrides["fr-FR"],
15252
15290
  breakpointBarOverrides["fr-FR"],
15291
+ responsiveInteractOverrides["fr-FR"],
15253
15292
  motionDockOverrides["fr-FR"],
15254
15293
  designRuntimeIdentityAndBridgeOverrides["fr-FR"],
15255
15294
  designComponentInstanceOverrides["fr-FR"],
@@ -15330,6 +15369,7 @@ export const messagesByLocale = {
15330
15369
  designInteractionStatesOverrides["de-DE"],
15331
15370
  designMotionAndBreakpointOverrides["de-DE"],
15332
15371
  breakpointBarOverrides["de-DE"],
15372
+ responsiveInteractOverrides["de-DE"],
15333
15373
  motionDockOverrides["de-DE"],
15334
15374
  designRuntimeIdentityAndBridgeOverrides["de-DE"],
15335
15375
  designComponentInstanceOverrides["de-DE"],
@@ -15410,6 +15450,7 @@ export const messagesByLocale = {
15410
15450
  designInteractionStatesOverrides["ja-JP"],
15411
15451
  designMotionAndBreakpointOverrides["ja-JP"],
15412
15452
  breakpointBarOverrides["ja-JP"],
15453
+ responsiveInteractOverrides["ja-JP"],
15413
15454
  motionDockOverrides["ja-JP"],
15414
15455
  designRuntimeIdentityAndBridgeOverrides["ja-JP"],
15415
15456
  designComponentInstanceOverrides["ja-JP"],
@@ -15491,6 +15532,7 @@ export const messagesByLocale = {
15491
15532
  designInteractionStatesOverrides["ko-KR"],
15492
15533
  designMotionAndBreakpointOverrides["ko-KR"],
15493
15534
  breakpointBarOverrides["ko-KR"],
15535
+ responsiveInteractOverrides["ko-KR"],
15494
15536
  motionDockOverrides["ko-KR"],
15495
15537
  designRuntimeIdentityAndBridgeOverrides["ko-KR"],
15496
15538
  designComponentInstanceOverrides["ko-KR"],
@@ -15570,6 +15612,7 @@ export const messagesByLocale = {
15570
15612
  designInteractionStatesOverrides["pt-BR"],
15571
15613
  designMotionAndBreakpointOverrides["pt-BR"],
15572
15614
  breakpointBarOverrides["pt-BR"],
15615
+ responsiveInteractOverrides["pt-BR"],
15573
15616
  motionDockOverrides["pt-BR"],
15574
15617
  designRuntimeIdentityAndBridgeOverrides["pt-BR"],
15575
15618
  designComponentInstanceOverrides["pt-BR"],
@@ -15650,6 +15693,7 @@ export const messagesByLocale = {
15650
15693
  designInteractionStatesOverrides["hi-IN"],
15651
15694
  designMotionAndBreakpointOverrides["hi-IN"],
15652
15695
  breakpointBarOverrides["hi-IN"],
15696
+ responsiveInteractOverrides["hi-IN"],
15653
15697
  motionDockOverrides["hi-IN"],
15654
15698
  designRuntimeIdentityAndBridgeOverrides["hi-IN"],
15655
15699
  designComponentInstanceOverrides["hi-IN"],
@@ -15730,6 +15774,7 @@ export const messagesByLocale = {
15730
15774
  designInteractionStatesOverrides["ar-SA"],
15731
15775
  designMotionAndBreakpointOverrides["ar-SA"],
15732
15776
  breakpointBarOverrides["ar-SA"],
15777
+ responsiveInteractOverrides["ar-SA"],
15733
15778
  motionDockOverrides["ar-SA"],
15734
15779
  designRuntimeIdentityAndBridgeOverrides["ar-SA"],
15735
15780
  designComponentInstanceOverrides["ar-SA"],
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Localized strings for ResponsiveInteractBar — the full-screen Interact
3
+ * mode's device/zoom chrome bar.
4
+ * Used in: app/components/design/ResponsiveInteractBar.tsx.
5
+ */
6
+ export const responsiveInteractOverrides = {
7
+ "en-US": {
8
+ designEditor: {
9
+ responsiveInteract: {
10
+ device: "Device",
11
+ width: "Width",
12
+ widthAbbreviation: "W",
13
+ height: "Height",
14
+ heightAbbreviation: "H",
15
+ zoom: "Zoom",
16
+ zoomIn: "Zoom in",
17
+ zoomOut: "Zoom out",
18
+ zoomToPreset: "Zoom to {{percent}}%",
19
+ exit: "Exit full-screen preview",
20
+ },
21
+ },
22
+ },
23
+ "zh-CN": {
24
+ designEditor: {
25
+ responsiveInteract: {
26
+ device: "设备",
27
+ width: "宽度",
28
+ widthAbbreviation: "宽",
29
+ height: "高度",
30
+ heightAbbreviation: "高",
31
+ zoom: "缩放",
32
+ zoomIn: "放大",
33
+ zoomOut: "缩小",
34
+ zoomToPreset: "缩放至 {{percent}}%",
35
+ exit: "退出全屏预览",
36
+ },
37
+ },
38
+ },
39
+ "zh-TW": {
40
+ designEditor: {
41
+ responsiveInteract: {
42
+ device: "裝置",
43
+ width: "寬度",
44
+ widthAbbreviation: "寬",
45
+ height: "高度",
46
+ heightAbbreviation: "高",
47
+ zoom: "縮放",
48
+ zoomIn: "放大",
49
+ zoomOut: "縮小",
50
+ zoomToPreset: "縮放至 {{percent}}%",
51
+ exit: "結束全螢幕預覽",
52
+ },
53
+ },
54
+ },
55
+ "es-ES": {
56
+ designEditor: {
57
+ responsiveInteract: {
58
+ device: "Dispositivo",
59
+ width: "Ancho",
60
+ widthAbbreviation: "A",
61
+ height: "Alto",
62
+ heightAbbreviation: "Al",
63
+ zoom: "Zoom",
64
+ zoomIn: "Acercar",
65
+ zoomOut: "Alejar",
66
+ zoomToPreset: "Zoom al {{percent}}%",
67
+ exit: "Salir de la vista previa a pantalla completa",
68
+ },
69
+ },
70
+ },
71
+ "fr-FR": {
72
+ designEditor: {
73
+ responsiveInteract: {
74
+ device: "Appareil",
75
+ width: "Largeur",
76
+ widthAbbreviation: "L",
77
+ height: "Hauteur",
78
+ heightAbbreviation: "H",
79
+ zoom: "Zoom",
80
+ zoomIn: "Zoomer",
81
+ zoomOut: "Dézoomer",
82
+ zoomToPreset: "Zoom à {{percent}} %",
83
+ exit: "Quitter l'aperçu plein écran",
84
+ },
85
+ },
86
+ },
87
+ "de-DE": {
88
+ designEditor: {
89
+ responsiveInteract: {
90
+ device: "Gerät",
91
+ width: "Breite",
92
+ widthAbbreviation: "B",
93
+ height: "Höhe",
94
+ heightAbbreviation: "H",
95
+ zoom: "Zoom",
96
+ zoomIn: "Vergrößern",
97
+ zoomOut: "Verkleinern",
98
+ zoomToPreset: "Auf {{percent}}% zoomen",
99
+ exit: "Vollbildvorschau verlassen",
100
+ },
101
+ },
102
+ },
103
+ "ja-JP": {
104
+ designEditor: {
105
+ responsiveInteract: {
106
+ device: "デバイス",
107
+ width: "幅",
108
+ widthAbbreviation: "幅",
109
+ height: "高さ",
110
+ heightAbbreviation: "高",
111
+ zoom: "ズーム",
112
+ zoomIn: "拡大",
113
+ zoomOut: "縮小",
114
+ zoomToPreset: "{{percent}}% にズーム",
115
+ exit: "全画面プレビューを終了",
116
+ },
117
+ },
118
+ },
119
+ "ko-KR": {
120
+ designEditor: {
121
+ responsiveInteract: {
122
+ device: "기기",
123
+ width: "너비",
124
+ widthAbbreviation: "너비",
125
+ height: "높이",
126
+ heightAbbreviation: "높이",
127
+ zoom: "확대/축소",
128
+ zoomIn: "확대",
129
+ zoomOut: "축소",
130
+ zoomToPreset: "{{percent}}%로 확대/축소",
131
+ exit: "전체 화면 미리보기 종료",
132
+ },
133
+ },
134
+ },
135
+ "pt-BR": {
136
+ designEditor: {
137
+ responsiveInteract: {
138
+ device: "Dispositivo",
139
+ width: "Largura",
140
+ widthAbbreviation: "L",
141
+ height: "Altura",
142
+ heightAbbreviation: "A",
143
+ zoom: "Zoom",
144
+ zoomIn: "Aumentar zoom",
145
+ zoomOut: "Diminuir zoom",
146
+ zoomToPreset: "Zoom para {{percent}}%",
147
+ exit: "Sair da visualização em tela cheia",
148
+ },
149
+ },
150
+ },
151
+ "hi-IN": {
152
+ designEditor: {
153
+ responsiveInteract: {
154
+ device: "डिवाइस",
155
+ width: "चौड़ाई",
156
+ widthAbbreviation: "चौ",
157
+ height: "ऊंचाई",
158
+ heightAbbreviation: "ऊं",
159
+ zoom: "ज़ूम",
160
+ zoomIn: "ज़ूम इन करें",
161
+ zoomOut: "ज़ूम आउट करें",
162
+ zoomToPreset: "{{percent}}% पर ज़ूम करें",
163
+ exit: "फ़ुल-स्क्रीन पूर्वावलोकन से बाहर निकलें",
164
+ },
165
+ },
166
+ },
167
+ "ar-SA": {
168
+ designEditor: {
169
+ responsiveInteract: {
170
+ device: "الجهاز",
171
+ width: "العرض",
172
+ widthAbbreviation: "ع",
173
+ height: "الارتفاع",
174
+ heightAbbreviation: "ر",
175
+ zoom: "التكبير",
176
+ zoomIn: "تكبير",
177
+ zoomOut: "تصغير",
178
+ zoomToPreset: "تكبير إلى {{percent}}%",
179
+ exit: "الخروج من المعاينة بملء الشاشة",
180
+ },
181
+ },
182
+ },
183
+ };
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  sendToAgentChat,
3
3
  sendToAgentChatAndConfirm,
4
+ sendMcpAppHostMessage,
4
5
  type AgentChatMessage,
5
6
  type SendToAgentChatAndConfirmResult,
6
7
  } from "@agent-native/core/client/agent-chat";
@@ -34,3 +35,62 @@ export function sendToDesignAgentChatAndConfirm(
34
35
  options,
35
36
  );
36
37
  }
38
+
39
+ export interface DesignSourceHandoffResult {
40
+ target: "host" | "local";
41
+ delivered: boolean;
42
+ reason?: string;
43
+ tabId?: string;
44
+ }
45
+
46
+ const DEFAULT_HOST_HANDOFF_TIMEOUT_MS = 15_000;
47
+
48
+ /**
49
+ * Pending localhost source edits belong in the coding host when Design is
50
+ * running as an MCP App. Ordinary Design pages have no host bridge, so they
51
+ * keep the existing local Design-agent path.
52
+ *
53
+ * A rejected host request never falls through to the local agent: the host may
54
+ * have accepted the turn even when its acknowledgement was lost, and a second
55
+ * source-writing turn would be unsafe.
56
+ */
57
+ export async function sendDesignSourceHandoffAndConfirm(
58
+ opts: AgentChatMessage,
59
+ options?: { timeoutMs?: number },
60
+ ): Promise<DesignSourceHandoffResult> {
61
+ const hostDelivery = sendMcpAppHostMessage({
62
+ message: opts.message,
63
+ context: opts.context,
64
+ mode: opts.mode,
65
+ requestMode: opts.requestMode,
66
+ });
67
+ if (hostDelivery !== false) {
68
+ let timeoutId: ReturnType<typeof setTimeout> | undefined;
69
+ const outcome = await Promise.race([
70
+ hostDelivery
71
+ .then((delivered) =>
72
+ delivered
73
+ ? ({ delivered: true } as const)
74
+ : ({ delivered: false, reason: "host-rejected" } as const),
75
+ )
76
+ .catch(() => ({ delivered: false, reason: "host-rejected" })),
77
+ new Promise<{ delivered: false; reason: string }>((resolve) => {
78
+ timeoutId = setTimeout(
79
+ () => resolve({ delivered: false, reason: "host-timeout" }),
80
+ Math.max(100, options?.timeoutMs ?? DEFAULT_HOST_HANDOFF_TIMEOUT_MS),
81
+ );
82
+ }),
83
+ ]);
84
+ if (timeoutId !== undefined) clearTimeout(timeoutId);
85
+ return {
86
+ target: "host",
87
+ ...outcome,
88
+ };
89
+ }
90
+
91
+ const localDelivery = await sendToDesignAgentChatAndConfirm(opts, options);
92
+ return {
93
+ target: "local",
94
+ ...localDelivery,
95
+ };
96
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Pure data/logic for the full-screen Interact mode's device chrome bar
3
+ * (ResponsiveInteractBar). Modeled on builder-internal's
4
+ * ResponsiveEditingMode/responsive-device-presets, adapted to this app's
5
+ * shadcn chrome. Kept separate from DEVICE_FRAME_VIEWPORTS in
6
+ * components/design/types.ts — that record is a fixed 3-category decorative
7
+ * frame (desktop/tablet/mobile chrome border) used elsewhere in the editor,
8
+ * not a device-simulation preset list with named devices and exact W×H.
9
+ */
10
+
11
+ export type InteractDeviceCategory = "phone" | "tablet" | "desktop" | "custom";
12
+
13
+ export interface InteractDevicePreset {
14
+ name: string;
15
+ width: number;
16
+ height: number;
17
+ category: InteractDeviceCategory;
18
+ }
19
+
20
+ /** Preset name used whenever the user types a width/height directly. */
21
+ export const INTERACT_CUSTOM_DEVICE_NAME = "Custom";
22
+
23
+ /** Must track ResponsiveInteractBar's `h-12`; the zoom-to-fit math subtracts
24
+ * it from the viewport to size the device box. */
25
+ export const RESPONSIVE_INTERACT_BAR_HEIGHT = 48;
26
+
27
+ export const INTERACT_DEVICE_PRESETS: InteractDevicePreset[] = [
28
+ { name: "iPhone SE", category: "phone", width: 320, height: 568 }, // i18n-ignore: stable device preset name.
29
+ { name: "iPhone 17", category: "phone", width: 402, height: 874 }, // i18n-ignore: stable device preset name.
30
+ { name: "iPhone 17 Pro Max", category: "phone", width: 440, height: 956 }, // i18n-ignore: stable device preset name.
31
+ { name: "Android Compact", category: "phone", width: 412, height: 917 }, // i18n-ignore: stable device preset name.
32
+ {
33
+ name: 'iPad Pro 11" Portrait',
34
+ category: "tablet",
35
+ width: 834,
36
+ height: 1194,
37
+ },
38
+ {
39
+ name: 'iPad Pro 11" Landscape',
40
+ category: "tablet",
41
+ width: 1194,
42
+ height: 834,
43
+ },
44
+ { name: 'MacBook Air 13"', category: "desktop", width: 1440, height: 900 },
45
+ {
46
+ name: INTERACT_CUSTOM_DEVICE_NAME,
47
+ category: "custom",
48
+ width: 402,
49
+ height: 874,
50
+ },
51
+ ];
52
+
53
+ export const DEFAULT_INTERACT_DEVICE_PRESET = INTERACT_DEVICE_PRESETS[1]!;
54
+
55
+ export function findInteractDevicePreset(
56
+ name: string,
57
+ ): InteractDevicePreset | undefined {
58
+ return INTERACT_DEVICE_PRESETS.find((preset) => preset.name === name);
59
+ }
60
+
61
+ /**
62
+ * Auto-fit zoom for the full-screen device box, ported from
63
+ * builder-internal's ResponsiveEditingMode effect (~lines 155-174): only
64
+ * zooms DOWN so the device fits the available chrome area, never zooms in
65
+ * past 100% just because there's extra room. Steps to the nearest 5 and
66
+ * clamps to [minZoom, 100] so the result always lands on a clean number.
67
+ */
68
+ export function computeInteractZoomToFit(params: {
69
+ availableWidth: number;
70
+ availableHeight: number;
71
+ deviceWidth: number;
72
+ deviceHeight: number;
73
+ minZoom?: number;
74
+ }): number {
75
+ const {
76
+ availableWidth,
77
+ availableHeight,
78
+ deviceWidth,
79
+ deviceHeight,
80
+ minZoom = 10,
81
+ } = params;
82
+ if (deviceWidth <= 0 || deviceHeight <= 0) return 100;
83
+ const widthScale = availableWidth / deviceWidth;
84
+ const heightScale = availableHeight / deviceHeight;
85
+ const optimalZoom = Math.min(widthScale, heightScale) * 100;
86
+ if (optimalZoom >= 100) return 100;
87
+ const stepped = Math.floor(optimalZoom / 5) * 5;
88
+ return Math.max(minZoom, Math.min(100, stepped));
89
+ }
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-07-28
4
+ ---
5
+
6
+ Design edits can be applied through the host coding agent from an inline MCP canvas
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: added
3
+ date: 2026-07-28
4
+ ---
5
+
6
+ Interact mode can preview designs in responsive device sizes
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: added
3
+ date: 2026-07-28
4
+ ---
5
+
6
+ Interact mode now opens a full-screen responsive preview with device presets, editable width/height, and zoom-to-fit
@@ -1,6 +1,6 @@
1
1
  ---
2
- type: fixed
2
+ type: improved
3
3
  date: 2026-07-28
4
4
  ---
5
5
 
6
- Show or hide Design editing chrome from Cmd+K, the canvas menu, or Cmd/Ctrl+Shift+\.
6
+ Show or hide Design editing chrome from Cmd+K, the canvas menu, or Figma's Shift+\ shortcut.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-07-28
4
+ ---
5
+
6
+ Visual edit now always shows the live running app in the canvas instead of a frozen HTML snapshot
@@ -163,7 +163,9 @@ private UI after the shell loads. See the `authentication` skill and
163
163
  proves *someone* is signed in. To restrict an operation to some teammates, set
164
164
  `authorize` on the `defineAction`. It wraps `run`, so it applies at every
165
165
  dispatch site (agent tool, HTTP, frontend, MCP, A2A, CLI) — unlike
166
- `needsApproval`, which is honoured only in the agent loop.
166
+ `needsApproval`, which is honored by the agent loop and MCP 2026 hosts that
167
+ support elicitation, but is not an authorization boundary for every dispatch
168
+ site.
167
169
 
168
170
  ```ts
169
171
  import { coachAccess } from "../lib/access.js"; // defineAppRoles(...)
@@ -203,7 +205,16 @@ export default defineAction({
203
205
  });
204
206
  ```
205
207
 
206
- When the gate is truthy and the call is not yet approved, the loop emits an `approval_required` event and **stops the turn — `run()` never executes**. The human approves via the chat UI's Approve affordance, which re-issues the turn with the call's stable `approvalKey`; only then does the action run. A predicate gates conditionally (e.g. only external recipients) and **fails closed** — a throw is treated as "approval required".
208
+ When the gate is truthy and the call is not yet approved, the agent loop emits
209
+ an `approval_required` event and **stops the turn — `run()` never executes**.
210
+ The human approves via the chat UI's Approve affordance, which re-issues the
211
+ turn with the call's stable `approvalKey`; only then does the action run. MCP
212
+ 2026 hosts receive an `input_required` approval request bound to the exact
213
+ caller, action, and arguments. The signed response state is backed by a durable,
214
+ single-use grant, so denial, expiry, replay, missing host support, or invalid
215
+ state fails closed before `run()`. A predicate gates conditionally (e.g. only
216
+ external recipients) and **fails closed** — a throw is treated as "approval
217
+ required".
207
218
 
208
219
  Rules:
209
220
 
@@ -163,7 +163,9 @@ private UI after the shell loads. See the `authentication` skill and
163
163
  proves *someone* is signed in. To restrict an operation to some teammates, set
164
164
  `authorize` on the `defineAction`. It wraps `run`, so it applies at every
165
165
  dispatch site (agent tool, HTTP, frontend, MCP, A2A, CLI) — unlike
166
- `needsApproval`, which is honoured only in the agent loop.
166
+ `needsApproval`, which is honored by the agent loop and MCP 2026 hosts that
167
+ support elicitation, but is not an authorization boundary for every dispatch
168
+ site.
167
169
 
168
170
  ```ts
169
171
  import { coachAccess } from "../lib/access.js"; // defineAppRoles(...)
@@ -203,7 +205,16 @@ export default defineAction({
203
205
  });
204
206
  ```
205
207
 
206
- When the gate is truthy and the call is not yet approved, the loop emits an `approval_required` event and **stops the turn — `run()` never executes**. The human approves via the chat UI's Approve affordance, which re-issues the turn with the call's stable `approvalKey`; only then does the action run. A predicate gates conditionally (e.g. only external recipients) and **fails closed** — a throw is treated as "approval required".
208
+ When the gate is truthy and the call is not yet approved, the agent loop emits
209
+ an `approval_required` event and **stops the turn — `run()` never executes**.
210
+ The human approves via the chat UI's Approve affordance, which re-issues the
211
+ turn with the call's stable `approvalKey`; only then does the action run. MCP
212
+ 2026 hosts receive an `input_required` approval request bound to the exact
213
+ caller, action, and arguments. The signed response state is backed by a durable,
214
+ single-use grant, so denial, expiry, replay, missing host support, or invalid
215
+ state fails closed before `run()`. A predicate gates conditionally (e.g. only
216
+ external recipients) and **fails closed** — a throw is treated as "approval
217
+ required".
207
218
 
208
219
  Rules:
209
220