@agent-native/core 0.128.4 → 0.129.1

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 (351) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +90 -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/message-components.tsx +12 -5
  22. package/corpus/core/src/client/chat/runtime.ts +2 -1
  23. package/corpus/core/src/client/chat/tool-call-display.tsx +25 -2
  24. package/corpus/core/src/client/chat-model-groups.ts +3 -0
  25. package/corpus/core/src/client/client-status-requests.ts +161 -0
  26. package/corpus/core/src/client/org/OrgSwitcher.tsx +4 -4
  27. package/corpus/core/src/client/settings/VoiceTranscriptionSection.tsx +2 -2
  28. package/corpus/core/src/client/sse-event-processor.ts +15 -3
  29. package/corpus/core/src/client/use-agent-engine-configured.ts +54 -50
  30. package/corpus/core/src/client/use-chat-models.ts +16 -11
  31. package/corpus/core/src/client/use-chat-threads.ts +32 -9
  32. package/corpus/core/src/client/use-session.ts +4 -5
  33. package/corpus/core/src/db/client.ts +83 -8
  34. package/corpus/core/src/db/ensure-additive-columns.ts +31 -20
  35. package/corpus/core/src/db/migrations.ts +22 -2
  36. package/corpus/core/src/mcp/approval-store.ts +99 -0
  37. package/corpus/core/src/mcp/build-server.ts +579 -303
  38. package/corpus/core/src/mcp/embed-app.ts +1 -1
  39. package/corpus/core/src/mcp/oauth-client-metadata.ts +380 -0
  40. package/corpus/core/src/mcp/oauth-route.ts +57 -52
  41. package/corpus/core/src/mcp/screen-memory-stdio.ts +400 -378
  42. package/corpus/core/src/mcp/server.ts +29 -145
  43. package/corpus/core/src/mcp/stdio.ts +72 -80
  44. package/corpus/core/src/mcp-client/manager.ts +6 -10
  45. package/corpus/core/src/mcp-client/oauth-client.ts +127 -36
  46. package/corpus/core/src/mcp-client/oauth-routes.ts +16 -6
  47. package/corpus/core/src/mcp-client/routes.ts +6 -5
  48. package/corpus/core/src/server/agent-capabilities.ts +20 -0
  49. package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +27 -0
  50. package/corpus/core/src/server/agent-chat-plugin.ts +18 -0
  51. package/corpus/core/src/server/transcribe-voice.ts +14 -5
  52. package/corpus/core/src/templates/default/.agents/skills/security/SKILL.md +13 -2
  53. package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
  54. package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
  55. package/corpus/core/src/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
  56. package/corpus/templates/analytics/.agents/skills/security/SKILL.md +13 -2
  57. package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +1 -10
  58. package/corpus/templates/analytics/app/global.css +0 -31
  59. package/corpus/templates/analytics/app/lib/sql-query.ts +46 -20
  60. package/corpus/templates/analytics/changelog/2026-07-28-analytics-dashboard-loading-states-now-use-a-simpler-standar.md +6 -0
  61. package/corpus/templates/analytics/changelog/2026-07-28-analytics-dashboards-now-load-first-party-charts-reliably-in.md +6 -0
  62. package/corpus/templates/analytics/server/lib/first-party-analytics-cache.ts +42 -16
  63. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +4 -2
  64. package/corpus/templates/analytics/shared/sql-query-limits.ts +1 -0
  65. package/corpus/templates/assets/.agents/skills/security/SKILL.md +13 -2
  66. package/corpus/templates/brain/.agents/skills/security/SKILL.md +13 -2
  67. package/corpus/templates/calendar/.agents/skills/security/SKILL.md +13 -2
  68. package/corpus/templates/chat/.agents/skills/security/SKILL.md +13 -2
  69. package/corpus/templates/chat/README.md +0 -2
  70. package/corpus/templates/clips/.agents/skills/security/SKILL.md +13 -2
  71. package/corpus/templates/clips/app/components/player/player-controls.tsx +3 -6
  72. package/corpus/templates/clips/app/components/player/recording-views-badge.tsx +6 -2
  73. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +25 -10
  74. package/corpus/templates/clips/app/components/sharing/viewed-by-popover.tsx +28 -6
  75. package/corpus/templates/clips/app/lib/use-visible-avatar-url.ts +34 -0
  76. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +6 -2
  77. package/corpus/templates/clips/app/routes/share.$shareId.tsx +3 -1
  78. package/corpus/templates/clips/changelog/2026-07-28-copied-share-links-no-longer-leave-an-unnecessary-confirmati.md +6 -0
  79. package/corpus/templates/clips/changelog/2026-07-28-playback-skip-controls-no-longer-show-overlapping-numbers.md +6 -0
  80. package/corpus/templates/clips/changelog/2026-07-28-profile-avatars-now-appear-in-viewer-and-share-access-lists.md +6 -0
  81. package/corpus/templates/clips/changelog/2026-07-28-public-clips-share-buttons-now-use-a-clean-text-only-label.md +6 -0
  82. package/corpus/templates/clips/desktop/src/app.tsx +14 -17
  83. package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +3 -1
  84. package/corpus/templates/clips/desktop/src/styles.css +13 -10
  85. package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +2 -2
  86. package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +36 -0
  87. package/corpus/templates/content/.agents/skills/security/SKILL.md +13 -2
  88. package/corpus/templates/content/actions/_builder-cms-read-client.ts +155 -34
  89. package/corpus/templates/content/actions/_builder-docs-client.ts +151 -30
  90. package/corpus/templates/content/actions/stage-builder-source-bulk-update.ts +5 -2
  91. package/corpus/templates/content/app/root.tsx +35 -14
  92. package/corpus/templates/content/changelog/2026-07-28-builder-backed-files-media-fields-now-accept-direct-file-url.md +6 -0
  93. package/corpus/templates/content/changelog/2026-07-28-builder-content-reads-now-negotiate-the-newest-mcp-protocol-.md +6 -0
  94. package/corpus/templates/content/changelog/2026-07-28-public-content-pages-load-faster-before-the-optional-ask-sid.md +6 -0
  95. package/corpus/templates/design/.agents/skills/security/SKILL.md +13 -2
  96. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +36 -16
  97. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +42 -3
  98. package/corpus/templates/design/actions/open-visual-edit.ts +2 -1
  99. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +2 -2
  100. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +14 -15
  101. package/corpus/templates/design/app/components/design/ResponsiveInteractBar.tsx +314 -0
  102. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +88 -3
  103. package/corpus/templates/design/app/components/design/keyboard-shortcuts.ts +1 -1
  104. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +7 -6
  105. package/corpus/templates/design/app/i18n-data.ts +56 -11
  106. package/corpus/templates/design/app/i18n-responsive-interact.ts +183 -0
  107. package/corpus/templates/design/app/lib/agent-chat.ts +60 -0
  108. package/corpus/templates/design/app/pages/design-editor/responsive-interact.ts +89 -0
  109. package/corpus/templates/design/changelog/2026-07-28-design-edits-can-be-applied-through-the-host-coding-agent-fr.md +6 -0
  110. package/corpus/templates/design/changelog/2026-07-28-interact-mode-can-preview-designs-in-responsive-device-sizes.md +6 -0
  111. package/corpus/templates/design/changelog/2026-07-28-interact-mode-now-opens-a-full-screen-responsive-preview-wit.md +6 -0
  112. package/corpus/templates/design/changelog/2026-07-28-show-or-hide-design-editing-chrome-with-cmd-on-apple-devices.md +2 -2
  113. package/corpus/templates/design/changelog/2026-07-28-visual-edit-now-always-shows-the-live-running-app-in-the-can.md +6 -0
  114. package/corpus/templates/dispatch/.agents/skills/security/SKILL.md +13 -2
  115. package/corpus/templates/forms/.agents/skills/security/SKILL.md +13 -2
  116. package/corpus/templates/macros/.agents/skills/security/SKILL.md +13 -2
  117. package/corpus/templates/mail/.agents/skills/security/SKILL.md +13 -2
  118. package/corpus/templates/plan/.agents/skills/security/SKILL.md +13 -2
  119. package/corpus/templates/slides/.agents/skills/security/SKILL.md +13 -2
  120. package/corpus/templates/tasks/.agents/skills/security/SKILL.md +13 -2
  121. package/corpus/toolkit/CHANGELOG.md +13 -0
  122. package/corpus/toolkit/package.json +1 -1
  123. package/corpus/toolkit/src/chat-history.css +1 -2
  124. package/corpus/toolkit/src/composer/TiptapComposer.tsx +45 -0
  125. package/dist/a2a/client.d.ts +7 -0
  126. package/dist/a2a/client.d.ts.map +1 -1
  127. package/dist/a2a/client.js +8 -3
  128. package/dist/a2a/client.js.map +1 -1
  129. package/dist/a2a/server.d.ts.map +1 -1
  130. package/dist/a2a/server.js +18 -3
  131. package/dist/a2a/server.js.map +1 -1
  132. package/dist/a2a/types.d.ts +7 -0
  133. package/dist/a2a/types.d.ts.map +1 -1
  134. package/dist/a2a/types.js.map +1 -1
  135. package/dist/action.d.ts +15 -1
  136. package/dist/action.d.ts.map +1 -1
  137. package/dist/action.js +39 -16
  138. package/dist/action.js.map +1 -1
  139. package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
  140. package/dist/agent/engine/ai-sdk-engine.js +14 -10
  141. package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
  142. package/dist/agent/production-agent.d.ts.map +1 -1
  143. package/dist/agent/production-agent.js +35 -7
  144. package/dist/agent/production-agent.js.map +1 -1
  145. package/dist/agent/thread-data-builder.d.ts +2 -0
  146. package/dist/agent/thread-data-builder.d.ts.map +1 -1
  147. package/dist/agent/thread-data-builder.js +3 -0
  148. package/dist/agent/thread-data-builder.js.map +1 -1
  149. package/dist/chat-threads/migrations.d.ts +21 -0
  150. package/dist/chat-threads/migrations.d.ts.map +1 -0
  151. package/dist/chat-threads/migrations.js +45 -0
  152. package/dist/chat-threads/migrations.js.map +1 -0
  153. package/dist/cli/create.d.ts.map +1 -1
  154. package/dist/cli/create.js +4 -0
  155. package/dist/cli/create.js.map +1 -1
  156. package/dist/cli/skills-content/design-visual-edit-skill.d.ts +1 -1
  157. package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -1
  158. package/dist/cli/skills-content/design-visual-edit-skill.js +36 -16
  159. package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -1
  160. package/dist/cli/skills.d.ts.map +1 -1
  161. package/dist/cli/skills.js +15 -0
  162. package/dist/cli/skills.js.map +1 -1
  163. package/dist/client/AgentPanel.d.ts.map +1 -1
  164. package/dist/client/AgentPanel.js +6 -5
  165. package/dist/client/AgentPanel.js.map +1 -1
  166. package/dist/client/AssistantChat.d.ts +37 -0
  167. package/dist/client/AssistantChat.d.ts.map +1 -1
  168. package/dist/client/AssistantChat.js +41 -8
  169. package/dist/client/AssistantChat.js.map +1 -1
  170. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  171. package/dist/client/MultiTabAssistantChat.js +11 -10
  172. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  173. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  174. package/dist/client/agent-chat-adapter.js +19 -3
  175. package/dist/client/agent-chat-adapter.js.map +1 -1
  176. package/dist/client/analytics.d.ts.map +1 -1
  177. package/dist/client/analytics.js +150 -101
  178. package/dist/client/analytics.js.map +1 -1
  179. package/dist/client/chat/message-components.d.ts +2 -1
  180. package/dist/client/chat/message-components.d.ts.map +1 -1
  181. package/dist/client/chat/message-components.js +11 -4
  182. package/dist/client/chat/message-components.js.map +1 -1
  183. package/dist/client/chat/runtime.d.ts.map +1 -1
  184. package/dist/client/chat/runtime.js +2 -1
  185. package/dist/client/chat/runtime.js.map +1 -1
  186. package/dist/client/chat/tool-call-display.d.ts +4 -1
  187. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  188. package/dist/client/chat/tool-call-display.js +14 -8
  189. package/dist/client/chat/tool-call-display.js.map +1 -1
  190. package/dist/client/chat-model-groups.d.ts.map +1 -1
  191. package/dist/client/chat-model-groups.js +3 -0
  192. package/dist/client/chat-model-groups.js.map +1 -1
  193. package/dist/client/client-status-requests.d.ts +14 -0
  194. package/dist/client/client-status-requests.d.ts.map +1 -0
  195. package/dist/client/client-status-requests.js +126 -0
  196. package/dist/client/client-status-requests.js.map +1 -0
  197. package/dist/client/org/OrgSwitcher.js +2 -2
  198. package/dist/client/org/OrgSwitcher.js.map +1 -1
  199. package/dist/client/settings/VoiceTranscriptionSection.js +1 -1
  200. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  201. package/dist/client/sse-event-processor.d.ts +7 -0
  202. package/dist/client/sse-event-processor.d.ts.map +1 -1
  203. package/dist/client/sse-event-processor.js +8 -3
  204. package/dist/client/sse-event-processor.js.map +1 -1
  205. package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
  206. package/dist/client/use-agent-engine-configured.js +29 -43
  207. package/dist/client/use-agent-engine-configured.js.map +1 -1
  208. package/dist/client/use-chat-models.d.ts.map +1 -1
  209. package/dist/client/use-chat-models.js +11 -11
  210. package/dist/client/use-chat-models.js.map +1 -1
  211. package/dist/client/use-chat-threads.d.ts.map +1 -1
  212. package/dist/client/use-chat-threads.js +23 -7
  213. package/dist/client/use-chat-threads.js.map +1 -1
  214. package/dist/client/use-session.d.ts.map +1 -1
  215. package/dist/client/use-session.js +4 -4
  216. package/dist/client/use-session.js.map +1 -1
  217. package/dist/collab/awareness.d.ts +2 -2
  218. package/dist/collab/awareness.d.ts.map +1 -1
  219. package/dist/db/client.d.ts.map +1 -1
  220. package/dist/db/client.js +48 -4
  221. package/dist/db/client.js.map +1 -1
  222. package/dist/db/ensure-additive-columns.d.ts.map +1 -1
  223. package/dist/db/ensure-additive-columns.js +32 -21
  224. package/dist/db/ensure-additive-columns.js.map +1 -1
  225. package/dist/db/migrations.d.ts +9 -0
  226. package/dist/db/migrations.d.ts.map +1 -1
  227. package/dist/db/migrations.js +14 -3
  228. package/dist/db/migrations.js.map +1 -1
  229. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  230. package/dist/mcp/approval-store.d.ts +16 -0
  231. package/dist/mcp/approval-store.d.ts.map +1 -0
  232. package/dist/mcp/approval-store.js +85 -0
  233. package/dist/mcp/approval-store.js.map +1 -0
  234. package/dist/mcp/build-server.d.ts +1 -34
  235. package/dist/mcp/build-server.d.ts.map +1 -1
  236. package/dist/mcp/build-server.js +220 -23
  237. package/dist/mcp/build-server.js.map +1 -1
  238. package/dist/mcp/embed-app.js +1 -1
  239. package/dist/mcp/embed-app.js.map +1 -1
  240. package/dist/mcp/oauth-client-metadata.d.ts +15 -0
  241. package/dist/mcp/oauth-client-metadata.d.ts.map +1 -0
  242. package/dist/mcp/oauth-client-metadata.js +297 -0
  243. package/dist/mcp/oauth-client-metadata.js.map +1 -0
  244. package/dist/mcp/oauth-route.d.ts.map +1 -1
  245. package/dist/mcp/oauth-route.js +39 -53
  246. package/dist/mcp/oauth-route.js.map +1 -1
  247. package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
  248. package/dist/mcp/screen-memory-stdio.js +304 -296
  249. package/dist/mcp/screen-memory-stdio.js.map +1 -1
  250. package/dist/mcp/server.d.ts +12 -25
  251. package/dist/mcp/server.d.ts.map +1 -1
  252. package/dist/mcp/server.js +24 -133
  253. package/dist/mcp/server.js.map +1 -1
  254. package/dist/mcp/stdio.d.ts.map +1 -1
  255. package/dist/mcp/stdio.js +36 -35
  256. package/dist/mcp/stdio.js.map +1 -1
  257. package/dist/mcp-client/manager.d.ts.map +1 -1
  258. package/dist/mcp-client/manager.js +6 -6
  259. package/dist/mcp-client/manager.js.map +1 -1
  260. package/dist/mcp-client/oauth-client.d.ts +13 -17
  261. package/dist/mcp-client/oauth-client.d.ts.map +1 -1
  262. package/dist/mcp-client/oauth-client.js +74 -16
  263. package/dist/mcp-client/oauth-client.js.map +1 -1
  264. package/dist/mcp-client/oauth-routes.d.ts +2 -2
  265. package/dist/mcp-client/oauth-routes.d.ts.map +1 -1
  266. package/dist/mcp-client/oauth-routes.js +16 -6
  267. package/dist/mcp-client/oauth-routes.js.map +1 -1
  268. package/dist/mcp-client/routes.js +5 -5
  269. package/dist/mcp-client/routes.js.map +1 -1
  270. package/dist/observability/routes.d.ts +3 -3
  271. package/dist/progress/routes.d.ts +1 -1
  272. package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
  273. package/dist/provider-api/actions/provider-api.d.ts +8 -8
  274. package/dist/resources/handlers.d.ts +1 -1
  275. package/dist/secrets/routes.d.ts +9 -9
  276. package/dist/server/agent-capabilities.d.ts.map +1 -1
  277. package/dist/server/agent-capabilities.js +21 -0
  278. package/dist/server/agent-capabilities.js.map +1 -1
  279. package/dist/server/agent-chat/action-filters-a2a.d.ts +14 -0
  280. package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
  281. package/dist/server/agent-chat/action-filters-a2a.js +16 -0
  282. package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
  283. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  284. package/dist/server/agent-chat-plugin.js +11 -1
  285. package/dist/server/agent-chat-plugin.js.map +1 -1
  286. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  287. package/dist/server/realtime-token.d.ts +1 -1
  288. package/dist/server/transcribe-voice.d.ts +1 -1
  289. package/dist/server/transcribe-voice.js +12 -6
  290. package/dist/server/transcribe-voice.js.map +1 -1
  291. package/dist/templates/chat/.agents/skills/security/SKILL.md +13 -2
  292. package/dist/templates/chat/README.md +0 -2
  293. package/dist/templates/default/.agents/skills/security/SKILL.md +13 -2
  294. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
  295. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
  296. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
  297. package/docs/content/template-design-collaboration-and-full-apps.mdx +3 -1
  298. package/package.json +7 -4
  299. package/src/a2a/client.ts +18 -4
  300. package/src/a2a/server.ts +19 -3
  301. package/src/a2a/types.ts +7 -0
  302. package/src/action.ts +43 -16
  303. package/src/agent/engine/ai-sdk-engine.ts +14 -10
  304. package/src/agent/production-agent.ts +41 -3
  305. package/src/agent/thread-data-builder.ts +5 -0
  306. package/src/chat-threads/migrations.ts +53 -0
  307. package/src/cli/create.ts +4 -0
  308. package/src/cli/skills-content/design-visual-edit-skill.ts +36 -16
  309. package/src/cli/skills.ts +16 -0
  310. package/src/client/AgentPanel.tsx +9 -5
  311. package/src/client/AssistantChat.tsx +138 -46
  312. package/src/client/MultiTabAssistantChat.tsx +16 -10
  313. package/src/client/agent-chat-adapter.ts +21 -3
  314. package/src/client/analytics.ts +159 -102
  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/org/OrgSwitcher.tsx +4 -4
  321. package/src/client/settings/VoiceTranscriptionSection.tsx +2 -2
  322. package/src/client/sse-event-processor.ts +15 -3
  323. package/src/client/use-agent-engine-configured.ts +54 -50
  324. package/src/client/use-chat-models.ts +16 -11
  325. package/src/client/use-chat-threads.ts +32 -9
  326. package/src/client/use-session.ts +4 -5
  327. package/src/db/client.ts +83 -8
  328. package/src/db/ensure-additive-columns.ts +31 -20
  329. package/src/db/migrations.ts +22 -2
  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/chat/README.md +0 -2
  348. package/src/templates/default/.agents/skills/security/SKILL.md +13 -2
  349. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +5 -2
  350. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +18 -0
  351. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +13 -2
@@ -0,0 +1,314 @@
1
+ import { useT } from "@agent-native/core/client/i18n";
2
+ import {
3
+ IconAspectRatio,
4
+ IconChevronDown,
5
+ IconDeviceLaptop,
6
+ IconDeviceMobile,
7
+ IconDeviceTablet,
8
+ IconX,
9
+ } from "@tabler/icons-react";
10
+ import { useState } from "react";
11
+
12
+ import { Button } from "@/components/ui/button";
13
+ import { Input } from "@/components/ui/input";
14
+ import {
15
+ Popover,
16
+ PopoverContent,
17
+ PopoverTrigger,
18
+ } from "@/components/ui/popover";
19
+ import {
20
+ Select,
21
+ SelectContent,
22
+ SelectItem,
23
+ SelectTrigger,
24
+ SelectValue,
25
+ } from "@/components/ui/select";
26
+ import { Separator } from "@/components/ui/separator";
27
+ import {
28
+ Tooltip,
29
+ TooltipContent,
30
+ TooltipTrigger,
31
+ } from "@/components/ui/tooltip";
32
+ import { cn } from "@/lib/utils";
33
+ import {
34
+ clampZoom,
35
+ getNextZoomStepDown,
36
+ getNextZoomStepUp,
37
+ } from "@/pages/design-editor/overview-camera";
38
+ import {
39
+ INTERACT_DEVICE_PRESETS,
40
+ type InteractDeviceCategory,
41
+ } from "@/pages/design-editor/responsive-interact";
42
+
43
+ /** Reference-bar zoom range (matches builder-internal's ResponsiveEditingMode
44
+ * clamp(zoom, 10, 200)) — deliberately narrower than the general canvas zoom
45
+ * range, since this scales a literal device box rather than a free canvas. */
46
+ const INTERACT_ZOOM_MIN = 10;
47
+ const INTERACT_ZOOM_MAX = 200;
48
+ const ZOOM_PRESET_BUTTONS = [50, 75, 100] as const;
49
+
50
+ function DeviceCategoryIcon({
51
+ category,
52
+ className,
53
+ }: {
54
+ category: InteractDeviceCategory;
55
+ className?: string;
56
+ }) {
57
+ switch (category) {
58
+ case "phone":
59
+ return <IconDeviceMobile className={className} />;
60
+ case "tablet":
61
+ return <IconDeviceTablet className={className} />;
62
+ case "desktop":
63
+ return <IconDeviceLaptop className={className} />;
64
+ case "custom":
65
+ return <IconAspectRatio className={className} />;
66
+ }
67
+ }
68
+
69
+ function DimensionInput({
70
+ value,
71
+ onChange,
72
+ label,
73
+ ariaLabel,
74
+ }: {
75
+ value: number;
76
+ onChange: (value: number) => void;
77
+ label: string;
78
+ ariaLabel: string;
79
+ }) {
80
+ return (
81
+ <div className="relative flex items-center">
82
+ <span className="pointer-events-none absolute left-2 !text-[11px] text-muted-foreground">
83
+ {label}
84
+ </span>
85
+ <Input
86
+ type="number"
87
+ min={1}
88
+ value={value}
89
+ onChange={(event) => {
90
+ const next = Number.parseInt(event.target.value, 10);
91
+ if (Number.isFinite(next) && next > 0) onChange(next);
92
+ }}
93
+ aria-label={ariaLabel}
94
+ className="h-7 w-[74px] rounded-md !pl-6 !text-[12px] tabular-nums"
95
+ />
96
+ </div>
97
+ );
98
+ }
99
+
100
+ export interface ResponsiveInteractBarProps {
101
+ deviceName: string;
102
+ width: number;
103
+ height: number;
104
+ zoom: number;
105
+ onDeviceChange: (name: string) => void;
106
+ onWidthChange: (width: number) => void;
107
+ onHeightChange: (height: number) => void;
108
+ onZoomChange: (zoom: number) => void;
109
+ onClose: () => void;
110
+ className?: string;
111
+ }
112
+
113
+ /**
114
+ * Full-screen Interact mode's top chrome bar: device preset + editable W/H
115
+ * (typing switches the preset to "Custom", same as builder-internal's
116
+ * ResponsiveEditingMode) and a zoom popover. Ported to this app's shadcn
117
+ * primitives — see templates/design's frontend rules for why this isn't MUI.
118
+ */
119
+ export function ResponsiveInteractBar({
120
+ deviceName,
121
+ width,
122
+ height,
123
+ zoom,
124
+ onDeviceChange,
125
+ onWidthChange,
126
+ onHeightChange,
127
+ onZoomChange,
128
+ onClose,
129
+ className,
130
+ }: ResponsiveInteractBarProps) {
131
+ const t = useT();
132
+ const [zoomOpen, setZoomOpen] = useState(false);
133
+ const [zoomDraft, setZoomDraft] = useState(String(zoom));
134
+
135
+ const commitZoomDraft = () => {
136
+ const parsed = Number.parseFloat(zoomDraft);
137
+ if (Number.isFinite(parsed)) {
138
+ onZoomChange(clampZoom(parsed, INTERACT_ZOOM_MIN, INTERACT_ZOOM_MAX));
139
+ } else {
140
+ setZoomDraft(String(zoom));
141
+ }
142
+ };
143
+
144
+ return (
145
+ <div
146
+ className={cn(
147
+ "flex h-12 shrink-0 items-center justify-between gap-2 border-b border-border bg-[var(--design-editor-panel-bg)] px-3",
148
+ className,
149
+ )}
150
+ >
151
+ <div className="flex min-w-0 flex-1 items-center gap-2">
152
+ <Select value={deviceName} onValueChange={onDeviceChange}>
153
+ <SelectTrigger
154
+ className="h-8 w-44 gap-1.5 rounded-md !text-[12px]"
155
+ aria-label={t("designEditor.responsiveInteract.device")}
156
+ >
157
+ <SelectValue />
158
+ </SelectTrigger>
159
+ <SelectContent className="z-[100030]">
160
+ {INTERACT_DEVICE_PRESETS.map((preset) => (
161
+ <SelectItem
162
+ key={preset.name}
163
+ value={preset.name}
164
+ className="!text-[12px]"
165
+ >
166
+ <span className="flex w-full items-center gap-2">
167
+ <DeviceCategoryIcon
168
+ category={preset.category}
169
+ className="size-3.5 shrink-0 text-muted-foreground"
170
+ />
171
+ <span className="flex-1 truncate">{preset.name}</span>
172
+ {preset.category !== "custom" ? (
173
+ <span className="shrink-0 tabular-nums text-muted-foreground/60">
174
+ {preset.width}×{preset.height}
175
+ </span>
176
+ ) : null}
177
+ </span>
178
+ </SelectItem>
179
+ ))}
180
+ </SelectContent>
181
+ </Select>
182
+ </div>
183
+
184
+ <div className="flex shrink-0 items-center gap-1.5">
185
+ <DimensionInput
186
+ value={width}
187
+ onChange={onWidthChange}
188
+ label={t("designEditor.responsiveInteract.widthAbbreviation")}
189
+ ariaLabel={t("designEditor.responsiveInteract.width")}
190
+ />
191
+ <DimensionInput
192
+ value={height}
193
+ onChange={onHeightChange}
194
+ label={t("designEditor.responsiveInteract.heightAbbreviation")}
195
+ ariaLabel={t("designEditor.responsiveInteract.height")}
196
+ />
197
+ </div>
198
+
199
+ <div className="flex min-w-0 flex-1 items-center justify-end gap-1">
200
+ <Popover
201
+ open={zoomOpen}
202
+ onOpenChange={(open) => {
203
+ setZoomOpen(open);
204
+ if (open) setZoomDraft(String(zoom));
205
+ }}
206
+ >
207
+ <PopoverTrigger asChild>
208
+ <Button
209
+ variant="ghost"
210
+ size="sm"
211
+ className="h-7 cursor-pointer gap-0.5 rounded-md px-2 !text-[12px] tabular-nums text-muted-foreground hover:text-foreground"
212
+ >
213
+ {zoom}%
214
+ <IconChevronDown className="size-3 opacity-60" />
215
+ </Button>
216
+ </PopoverTrigger>
217
+ <PopoverContent
218
+ align="end"
219
+ className="z-[100030] w-44 space-y-1.5 p-2"
220
+ >
221
+ <Input
222
+ autoFocus
223
+ type="number"
224
+ value={zoomDraft}
225
+ onChange={(event) => setZoomDraft(event.target.value)}
226
+ onFocus={(event) => event.currentTarget.select()}
227
+ onKeyDown={(event) => {
228
+ if (event.key === "Enter") {
229
+ event.preventDefault();
230
+ commitZoomDraft();
231
+ } else if (event.key === "Escape") {
232
+ event.preventDefault();
233
+ setZoomDraft(String(zoom));
234
+ }
235
+ }}
236
+ onBlur={commitZoomDraft}
237
+ aria-label={t("designEditor.responsiveInteract.zoom")}
238
+ className="h-7 !text-[12px] tabular-nums"
239
+ />
240
+ <Separator />
241
+ <Button
242
+ variant="ghost"
243
+ size="sm"
244
+ disabled={zoom >= INTERACT_ZOOM_MAX}
245
+ onClick={() => {
246
+ onZoomChange(
247
+ getNextZoomStepUp(zoom, {
248
+ min: INTERACT_ZOOM_MIN,
249
+ max: INTERACT_ZOOM_MAX,
250
+ }),
251
+ );
252
+ setZoomOpen(false);
253
+ }}
254
+ className="h-7 w-full cursor-pointer justify-start rounded-md px-2 !text-[12px]"
255
+ >
256
+ {t("designEditor.responsiveInteract.zoomIn")}
257
+ </Button>
258
+ <Button
259
+ variant="ghost"
260
+ size="sm"
261
+ disabled={zoom <= INTERACT_ZOOM_MIN}
262
+ onClick={() => {
263
+ onZoomChange(
264
+ getNextZoomStepDown(zoom, {
265
+ min: INTERACT_ZOOM_MIN,
266
+ max: INTERACT_ZOOM_MAX,
267
+ }),
268
+ );
269
+ setZoomOpen(false);
270
+ }}
271
+ className="h-7 w-full cursor-pointer justify-start rounded-md px-2 !text-[12px]"
272
+ >
273
+ {t("designEditor.responsiveInteract.zoomOut")}
274
+ </Button>
275
+ <Separator />
276
+ {ZOOM_PRESET_BUTTONS.map((preset) => (
277
+ <Button
278
+ key={preset}
279
+ variant="ghost"
280
+ size="sm"
281
+ onClick={() => {
282
+ onZoomChange(preset);
283
+ setZoomOpen(false);
284
+ }}
285
+ className="h-7 w-full cursor-pointer justify-start rounded-md px-2 !text-[12px]"
286
+ >
287
+ {t("designEditor.responsiveInteract.zoomToPreset", {
288
+ percent: preset,
289
+ })}
290
+ </Button>
291
+ ))}
292
+ </PopoverContent>
293
+ </Popover>
294
+
295
+ <Tooltip>
296
+ <TooltipTrigger asChild>
297
+ <Button
298
+ variant="ghost"
299
+ size="icon"
300
+ onClick={onClose}
301
+ aria-label={t("designEditor.responsiveInteract.exit")}
302
+ className="size-7 cursor-pointer rounded-md text-muted-foreground hover:text-foreground"
303
+ >
304
+ <IconX className="size-4" />
305
+ </Button>
306
+ </TooltipTrigger>
307
+ <TooltipContent side="bottom">
308
+ {t("designEditor.responsiveInteract.exit")}
309
+ </TooltipContent>
310
+ </Tooltip>
311
+ </div>
312
+ </div>
313
+ );
314
+ }
@@ -4646,6 +4646,11 @@ declare var __SELECTED_LAYER_DRAG_PRIORITY__: boolean;
4646
4646
  return true;
4647
4647
  }
4648
4648
  if (/^Arrow/.test(key || "")) return !e.altKey;
4649
+ // Figma's Shift+\ "Minimize UI" chord. Use the physical code because
4650
+ // Shift+\ produces "|" on US keyboard layouts.
4651
+ if (!primary && !e.altKey && e.shiftKey && e.code === "Backslash") {
4652
+ return true;
4653
+ }
4649
4654
  if (primary) {
4650
4655
  return (
4651
4656
  [
@@ -4686,9 +4691,6 @@ declare var __SELECTED_LAYER_DRAG_PRIORITY__: boolean;
4686
4691
  // shortcuts the host has no bare-primary binding for — are left
4687
4692
  // alone (see useDesignHotkeys.ts: both require event.shiftKey).
4688
4693
  (e.shiftKey && (normalized === "h" || normalized === "l")) ||
4689
- // Cmd/Ctrl+Shift+\ — minimize UI (onToggleUi). Keep the Shift gate
4690
- // here so the iframe never intercepts a desktop host's bare Cmd/Ctrl+\.
4691
- (e.shiftKey && normalized === "\\") ||
4692
4694
  // Cmd/Ctrl+Alt+B detach instance / Cmd/Ctrl+Alt+K create component
4693
4695
  // (onDetachInstance / onCreateComponent). Gated on altKey so bare
4694
4696
  // Cmd+B is left alone — the host has no bare-primary binding for it.
@@ -12157,6 +12159,89 @@ declare var __SELECTED_LAYER_DRAG_PRIORITY__: boolean;
12157
12159
  // bounding the per-frame cost regardless of the incoming event rate.
12158
12160
  window.addEventListener("scroll", scheduleRefreshOverlays, true);
12159
12161
  window.addEventListener("resize", scheduleRefreshOverlays);
12162
+
12163
+ // Document-level native-interaction net for the z-index race: the shield
12164
+ // (z-index 99990) only wins pointer dispatch when nothing in the previewed
12165
+ // app paints above it, and real running apps routinely do — portalled
12166
+ // modals/toasts/menus at 99999+/2147483647, or any node appended to <body>
12167
+ // after the shield at an equal z-index. When that happens the app element
12168
+ // is the real e.target, not the shield, so none of the shield-bound
12169
+ // listeners above ever see the event. `document` is still an ancestor of
12170
+ // that element regardless of paint order, so a capture listener here still
12171
+ // sees every such event. Registered LAST among this file's own
12172
+ // document-level listeners (all of which sit above this line) so this net
12173
+ // can never preempt them via stopImmediatePropagation — e.g. the
12174
+ // click-away-commits-text-edit pointerdown listener above must still run
12175
+ // first. `activeDragCancel` is truthy for the file's mouse-event-driven
12176
+ // drags (move/resize/rotate/spacing/reorder), whose own document-level
12177
+ // mousemove/mouseup listeners are attached later still (on the mousedown
12178
+ // that starts the drag) and would otherwise be the same kind of race
12179
+ // victim; deferring to them while a drag owns input avoids that.
12180
+ function isNativeInteractionNetExempt(target: Element | null): boolean {
12181
+ return (
12182
+ isOverlayElement(target) ||
12183
+ isEditorTypingTarget(target) ||
12184
+ !!activeDragCancel
12185
+ );
12186
+ }
12187
+
12188
+ function interceptNativeInteractionNet(e: Event): void {
12189
+ if (readOnly) return;
12190
+ var target =
12191
+ e.target && (e.target as Element).nodeType === 1
12192
+ ? (e.target as Element)
12193
+ : null;
12194
+ if (isNativeInteractionNetExempt(target)) return;
12195
+ stopNativeInteraction(e);
12196
+ }
12197
+
12198
+ [
12199
+ "click",
12200
+ "auxclick",
12201
+ "dblclick",
12202
+ "mousedown",
12203
+ "mouseup",
12204
+ "pointerdown",
12205
+ "pointerup",
12206
+ "submit",
12207
+ ].forEach(function (type) {
12208
+ document.addEventListener(type, interceptNativeInteractionNet, true);
12209
+ });
12210
+
12211
+ // Enter/Space activate a focused native control (link, button, or a
12212
+ // role="button"/"link") through the keydown event's default action, which
12213
+ // is dispatched straight to the focused element regardless of z-index —
12214
+ // neither the shield nor the net above (both pointer-target-based) can see
12215
+ // it. Scoped to just these two keys and only when the target is itself
12216
+ // such a control: the file already has many other keydown handlers (move/
12217
+ // resize/rotate/reorder/escape, the plain-paste hotkey) that a blanket
12218
+ // keydown block would break.
12219
+ function isFocusedActivationTarget(target: Element | null): boolean {
12220
+ return !!(
12221
+ target &&
12222
+ target.closest &&
12223
+ target.closest(
12224
+ 'a[href], button, summary, input[type="submit"], input[type="button"], input[type="reset"], input[type="image"], [role="button"], [role="link"]',
12225
+ )
12226
+ );
12227
+ }
12228
+
12229
+ document.addEventListener(
12230
+ "keydown",
12231
+ function (e: KeyboardEvent) {
12232
+ if (readOnly) return;
12233
+ if (e.key !== "Enter" && !(e.key === " " && e.code === "Space")) return;
12234
+ var target =
12235
+ e.target && (e.target as Element).nodeType === 1
12236
+ ? (e.target as Element)
12237
+ : null;
12238
+ if (isNativeInteractionNetExempt(target)) return;
12239
+ if (!isFocusedActivationTarget(target)) return;
12240
+ stopNativeInteraction(e);
12241
+ },
12242
+ true,
12243
+ );
12244
+
12160
12245
  applyEditorChromeScale();
12161
12246
 
12162
12247
  if (
@@ -142,7 +142,7 @@ export const DESIGN_SHORTCUTS: readonly DesignShortcutDefinition[] = [
142
142
  shortcut({
143
143
  id: "toggle-ui",
144
144
  category: "view",
145
- bindings: ["$mod+shift+\\"],
145
+ bindings: ["shift+\\"],
146
146
  labelKey: "designEditor.keyboardShortcuts.commands.toggleUi",
147
147
  handler: "onToggleUi",
148
148
  }),
@@ -203,8 +203,8 @@ export interface UseDesignHotkeysProps {
203
203
  * modifiers held) or SHIFT_TOOL_SHORTCUTS (which has no "a" entry).
204
204
  */
205
205
  onAddAutoLayout?: DesignHotkeyHandler;
206
- /** Figma's Cmd/Ctrl+Shift+\ "Minimize UI" shortcut, applied here to the
207
- * full Design chrome (left rail, right panel, and bottom toolbar). */
206
+ /** Figma's Shift+\ "Minimize UI" shortcut, applied here to the full Design
207
+ * chrome (left rail, right panel, and bottom toolbar). */
208
208
  onToggleUi?: DesignHotkeyHandler;
209
209
  /** Figma's Shift+C — toggle Show/Hide comments (comment pins). */
210
210
  onToggleComments?: DesignHotkeyHandler;
@@ -725,13 +725,14 @@ export function handleDesignHotkey(
725
725
  return run(props.onAddAutoLayout);
726
726
  }
727
727
 
728
- // Figma's "Minimize UI" chord avoids the bare Cmd+\ shortcut that desktop
729
- // coding hosts can reserve for closing their focused pane.
728
+ // Figma's Shift+\ "Minimize UI" chord avoids the bare Cmd+\ shortcut that
729
+ // desktop coding hosts can reserve for closing their focused pane. Use the
730
+ // physical key code because Shift+\ produces "|" on US keyboard layouts.
730
731
  if (
731
- isPlatformPrimaryModifier(event) &&
732
+ !primary &&
732
733
  !event.altKey &&
733
734
  event.shiftKey &&
734
- key === "\\"
735
+ event.code === "Backslash"
735
736
  ) {
736
737
  return run(props.onToggleUi);
737
738
  }