@agent-native/core 0.37.3 → 0.38.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 (377) hide show
  1. package/README.md +19 -6
  2. package/dist/action.d.ts +60 -2
  3. package/dist/action.d.ts.map +1 -1
  4. package/dist/action.js +6 -2
  5. package/dist/action.js.map +1 -1
  6. package/dist/agent/production-agent.d.ts +12 -6
  7. package/dist/agent/production-agent.d.ts.map +1 -1
  8. package/dist/agent/production-agent.js +161 -11
  9. package/dist/agent/production-agent.js.map +1 -1
  10. package/dist/agent/types.d.ts +2 -0
  11. package/dist/agent/types.d.ts.map +1 -1
  12. package/dist/agent/types.js.map +1 -1
  13. package/dist/catalog.json +2 -2
  14. package/dist/cli/connect.d.ts.map +1 -1
  15. package/dist/cli/connect.js +15 -0
  16. package/dist/cli/connect.js.map +1 -1
  17. package/dist/cli/index.js +10 -6
  18. package/dist/cli/index.js.map +1 -1
  19. package/dist/cli/plan-publish-store.d.ts +52 -0
  20. package/dist/cli/plan-publish-store.d.ts.map +1 -0
  21. package/dist/cli/plan-publish-store.js +103 -0
  22. package/dist/cli/plan-publish-store.js.map +1 -0
  23. package/dist/cli/skills.d.ts +29 -4
  24. package/dist/cli/skills.d.ts.map +1 -1
  25. package/dist/cli/skills.js +851 -275
  26. package/dist/cli/skills.js.map +1 -1
  27. package/dist/cli/templates-meta.js +12 -12
  28. package/dist/cli/templates-meta.js.map +1 -1
  29. package/dist/client/AssistantChat.d.ts +3 -1
  30. package/dist/client/AssistantChat.d.ts.map +1 -1
  31. package/dist/client/AssistantChat.js +65 -15
  32. package/dist/client/AssistantChat.js.map +1 -1
  33. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  34. package/dist/client/MultiTabAssistantChat.js +20 -2
  35. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  36. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  37. package/dist/client/agent-chat-adapter.js +12 -0
  38. package/dist/client/agent-chat-adapter.js.map +1 -1
  39. package/dist/client/agent-engine-key.d.ts +24 -0
  40. package/dist/client/agent-engine-key.d.ts.map +1 -0
  41. package/dist/client/agent-engine-key.js +49 -0
  42. package/dist/client/agent-engine-key.js.map +1 -0
  43. package/dist/client/analytics.d.ts.map +1 -1
  44. package/dist/client/analytics.js +34 -0
  45. package/dist/client/analytics.js.map +1 -1
  46. package/dist/client/blocks/BlockView.d.ts +26 -0
  47. package/dist/client/blocks/BlockView.d.ts.map +1 -0
  48. package/dist/client/blocks/BlockView.js +24 -0
  49. package/dist/client/blocks/BlockView.js.map +1 -0
  50. package/dist/client/blocks/SchemaBlockEditor.d.ts +25 -0
  51. package/dist/client/blocks/SchemaBlockEditor.d.ts.map +1 -0
  52. package/dist/client/blocks/SchemaBlockEditor.js +72 -0
  53. package/dist/client/blocks/SchemaBlockEditor.js.map +1 -0
  54. package/dist/client/blocks/agent.d.ts +30 -0
  55. package/dist/client/blocks/agent.d.ts.map +1 -0
  56. package/dist/client/blocks/agent.js +61 -0
  57. package/dist/client/blocks/agent.js.map +1 -0
  58. package/dist/client/blocks/index.d.ts +34 -0
  59. package/dist/client/blocks/index.d.ts.map +1 -0
  60. package/dist/client/blocks/index.js +42 -0
  61. package/dist/client/blocks/index.js.map +1 -0
  62. package/dist/client/blocks/library/checklist.config.d.ts +36 -0
  63. package/dist/client/blocks/library/checklist.config.d.ts.map +1 -0
  64. package/dist/client/blocks/library/checklist.config.js +25 -0
  65. package/dist/client/blocks/library/checklist.config.js.map +1 -0
  66. package/dist/client/blocks/library/checklist.d.ts +26 -0
  67. package/dist/client/blocks/library/checklist.d.ts.map +1 -0
  68. package/dist/client/blocks/library/checklist.js +76 -0
  69. package/dist/client/blocks/library/checklist.js.map +1 -0
  70. package/dist/client/blocks/library/code-tabs.config.d.ts +36 -0
  71. package/dist/client/blocks/library/code-tabs.config.d.ts.map +1 -0
  72. package/dist/client/blocks/library/code-tabs.config.js +30 -0
  73. package/dist/client/blocks/library/code-tabs.config.js.map +1 -0
  74. package/dist/client/blocks/library/code-tabs.d.ts +3 -0
  75. package/dist/client/blocks/library/code-tabs.d.ts.map +1 -0
  76. package/dist/client/blocks/library/code-tabs.js +165 -0
  77. package/dist/client/blocks/library/code-tabs.js.map +1 -0
  78. package/dist/client/blocks/library/html.config.d.ts +37 -0
  79. package/dist/client/blocks/library/html.config.d.ts.map +1 -0
  80. package/dist/client/blocks/library/html.config.js +46 -0
  81. package/dist/client/blocks/library/html.config.js.map +1 -0
  82. package/dist/client/blocks/library/html.d.ts +21 -0
  83. package/dist/client/blocks/library/html.d.ts.map +1 -0
  84. package/dist/client/blocks/library/html.js +69 -0
  85. package/dist/client/blocks/library/html.js.map +1 -0
  86. package/dist/client/blocks/library/table.config.d.ts +30 -0
  87. package/dist/client/blocks/library/table.config.d.ts.map +1 -0
  88. package/dist/client/blocks/library/table.config.js +22 -0
  89. package/dist/client/blocks/library/table.config.js.map +1 -0
  90. package/dist/client/blocks/library/table.d.ts +8 -0
  91. package/dist/client/blocks/library/table.d.ts.map +1 -0
  92. package/dist/client/blocks/library/table.js +107 -0
  93. package/dist/client/blocks/library/table.js.map +1 -0
  94. package/dist/client/blocks/library/tabs.config.d.ts +56 -0
  95. package/dist/client/blocks/library/tabs.config.d.ts.map +1 -0
  96. package/dist/client/blocks/library/tabs.config.js +36 -0
  97. package/dist/client/blocks/library/tabs.config.js.map +1 -0
  98. package/dist/client/blocks/library/tabs.d.ts +20 -0
  99. package/dist/client/blocks/library/tabs.d.ts.map +1 -0
  100. package/dist/client/blocks/library/tabs.js +123 -0
  101. package/dist/client/blocks/library/tabs.js.map +1 -0
  102. package/dist/client/blocks/mdx.d.ts +74 -0
  103. package/dist/client/blocks/mdx.d.ts.map +1 -0
  104. package/dist/client/blocks/mdx.js +205 -0
  105. package/dist/client/blocks/mdx.js.map +1 -0
  106. package/dist/client/blocks/provider.d.ts +25 -0
  107. package/dist/client/blocks/provider.d.ts.map +1 -0
  108. package/dist/client/blocks/provider.js +19 -0
  109. package/dist/client/blocks/provider.js.map +1 -0
  110. package/dist/client/blocks/registry.d.ts +24 -0
  111. package/dist/client/blocks/registry.d.ts.map +1 -0
  112. package/dist/client/blocks/registry.js +50 -0
  113. package/dist/client/blocks/registry.js.map +1 -0
  114. package/dist/client/blocks/schema-form/introspect.d.ts +31 -0
  115. package/dist/client/blocks/schema-form/introspect.d.ts.map +1 -0
  116. package/dist/client/blocks/schema-form/introspect.js +164 -0
  117. package/dist/client/blocks/schema-form/introspect.js.map +1 -0
  118. package/dist/client/blocks/server.d.ts +22 -0
  119. package/dist/client/blocks/server.d.ts.map +1 -0
  120. package/dist/client/blocks/server.js +25 -0
  121. package/dist/client/blocks/server.js.map +1 -0
  122. package/dist/client/blocks/types.d.ts +212 -0
  123. package/dist/client/blocks/types.d.ts.map +1 -0
  124. package/dist/client/blocks/types.js +5 -0
  125. package/dist/client/blocks/types.js.map +1 -0
  126. package/dist/client/composer/ComposerPlusMenu.js +10 -1
  127. package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
  128. package/dist/client/guided-questions.d.ts +68 -0
  129. package/dist/client/guided-questions.d.ts.map +1 -1
  130. package/dist/client/guided-questions.js +158 -3
  131. package/dist/client/guided-questions.js.map +1 -1
  132. package/dist/client/index.d.ts +5 -1
  133. package/dist/client/index.d.ts.map +1 -1
  134. package/dist/client/index.js +15 -1
  135. package/dist/client/index.js.map +1 -1
  136. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts +37 -0
  137. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts.map +1 -0
  138. package/dist/client/rich-markdown-editor/BubbleToolbar.js +161 -0
  139. package/dist/client/rich-markdown-editor/BubbleToolbar.js.map +1 -0
  140. package/dist/client/rich-markdown-editor/ImageExtension.d.ts +63 -0
  141. package/dist/client/rich-markdown-editor/ImageExtension.d.ts.map +1 -0
  142. package/dist/client/rich-markdown-editor/ImageExtension.js +242 -0
  143. package/dist/client/rich-markdown-editor/ImageExtension.js.map +1 -0
  144. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts +51 -0
  145. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts.map +1 -0
  146. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js +37 -0
  147. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js.map +1 -0
  148. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +61 -0
  149. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +1 -0
  150. package/dist/client/rich-markdown-editor/SharedRichEditor.js +121 -0
  151. package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +1 -0
  152. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts +36 -0
  153. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts.map +1 -0
  154. package/dist/client/rich-markdown-editor/SlashCommandMenu.js +193 -0
  155. package/dist/client/rich-markdown-editor/SlashCommandMenu.js.map +1 -0
  156. package/dist/client/rich-markdown-editor/extensions.d.ts +166 -0
  157. package/dist/client/rich-markdown-editor/extensions.d.ts.map +1 -0
  158. package/dist/client/rich-markdown-editor/extensions.js +222 -0
  159. package/dist/client/rich-markdown-editor/extensions.js.map +1 -0
  160. package/dist/client/rich-markdown-editor/index.d.ts +9 -0
  161. package/dist/client/rich-markdown-editor/index.d.ts.map +1 -0
  162. package/dist/client/rich-markdown-editor/index.js +9 -0
  163. package/dist/client/rich-markdown-editor/index.js.map +1 -0
  164. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts +18 -0
  165. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts.map +1 -0
  166. package/dist/client/rich-markdown-editor/uploadEditorImage.js +57 -0
  167. package/dist/client/rich-markdown-editor/uploadEditorImage.js.map +1 -0
  168. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts +91 -0
  169. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +1 -0
  170. package/dist/client/rich-markdown-editor/useCollabReconcile.js +342 -0
  171. package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +1 -0
  172. package/dist/client/track.d.ts +25 -0
  173. package/dist/client/track.d.ts.map +1 -0
  174. package/dist/client/track.js +53 -0
  175. package/dist/client/track.js.map +1 -0
  176. package/dist/client/use-action.d.ts.map +1 -1
  177. package/dist/client/use-action.js +6 -0
  178. package/dist/client/use-action.js.map +1 -1
  179. package/dist/client/use-session.d.ts +3 -2
  180. package/dist/client/use-session.d.ts.map +1 -1
  181. package/dist/client/use-session.js +3 -2
  182. package/dist/client/use-session.js.map +1 -1
  183. package/dist/deploy/build.d.ts +5 -0
  184. package/dist/deploy/build.d.ts.map +1 -1
  185. package/dist/deploy/build.js +67 -1
  186. package/dist/deploy/build.js.map +1 -1
  187. package/dist/extensions/schema.d.ts +1 -1
  188. package/dist/mcp/build-server.d.ts.map +1 -1
  189. package/dist/mcp/build-server.js +9 -2
  190. package/dist/mcp/build-server.js.map +1 -1
  191. package/dist/mcp/server.d.ts +1 -1
  192. package/dist/mcp/server.d.ts.map +1 -1
  193. package/dist/mcp/server.js +35 -2
  194. package/dist/mcp/server.js.map +1 -1
  195. package/dist/provider-api/index.d.ts +1 -1
  196. package/dist/provider-api/index.d.ts.map +1 -1
  197. package/dist/scripts/docs/search.d.ts.map +1 -1
  198. package/dist/scripts/docs/search.js +5 -2
  199. package/dist/scripts/docs/search.js.map +1 -1
  200. package/dist/scripts/runner.d.ts.map +1 -1
  201. package/dist/scripts/runner.js +16 -3
  202. package/dist/scripts/runner.js.map +1 -1
  203. package/dist/server/action-discovery.d.ts.map +1 -1
  204. package/dist/server/action-discovery.js +2 -0
  205. package/dist/server/action-discovery.js.map +1 -1
  206. package/dist/server/action-routes.d.ts.map +1 -1
  207. package/dist/server/action-routes.js +30 -4
  208. package/dist/server/action-routes.js.map +1 -1
  209. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  210. package/dist/server/agent-chat-plugin.js +65 -19
  211. package/dist/server/agent-chat-plugin.js.map +1 -1
  212. package/dist/server/agent-teams.d.ts.map +1 -1
  213. package/dist/server/agent-teams.js +8 -1
  214. package/dist/server/agent-teams.js.map +1 -1
  215. package/dist/server/agents-bundle.d.ts +27 -1
  216. package/dist/server/agents-bundle.d.ts.map +1 -1
  217. package/dist/server/agents-bundle.js +41 -3
  218. package/dist/server/agents-bundle.js.map +1 -1
  219. package/dist/server/auth.d.ts.map +1 -1
  220. package/dist/server/auth.js +76 -3
  221. package/dist/server/auth.js.map +1 -1
  222. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  223. package/dist/server/core-routes-plugin.js +60 -0
  224. package/dist/server/core-routes-plugin.js.map +1 -1
  225. package/dist/server/onboarding-html.d.ts.map +1 -1
  226. package/dist/server/onboarding-html.js +160 -22
  227. package/dist/server/onboarding-html.js.map +1 -1
  228. package/dist/server/sentry.d.ts.map +1 -1
  229. package/dist/server/sentry.js +6 -0
  230. package/dist/server/sentry.js.map +1 -1
  231. package/dist/server/social-og-image.d.ts +2 -1
  232. package/dist/server/social-og-image.d.ts.map +1 -1
  233. package/dist/server/social-og-image.js +24 -4
  234. package/dist/server/social-og-image.js.map +1 -1
  235. package/dist/sharing/schema.d.ts +1 -1
  236. package/dist/styles/agent-native.css +1 -0
  237. package/dist/styles/rich-markdown-editor.css +439 -0
  238. package/dist/templates/default/.agents/skills/actions/SKILL.md +4 -1
  239. package/dist/templates/default/.agents/skills/security/SKILL.md +13 -4
  240. package/dist/templates/default/.agents/skills/storing-data/SKILL.md +15 -3
  241. package/dist/templates/default/AGENTS.md +1 -0
  242. package/dist/templates/default/DEVELOPING.md +2 -0
  243. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +10 -3
  244. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +98 -10
  245. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +45 -3
  246. package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +2 -0
  247. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +37 -4
  248. package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +9 -4
  249. package/dist/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +2 -0
  250. package/dist/templates/workspace-core/.agents/skills/client-methods/SKILL.md +106 -0
  251. package/dist/templates/workspace-core/.agents/skills/client-methods/references/legacy-client-fetch-audit-2026-06-03.md +53 -0
  252. package/dist/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +2 -0
  253. package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +62 -61
  254. package/dist/templates/workspace-core/.agents/skills/context-xray/SKILL.md +47 -0
  255. package/dist/templates/workspace-core/.agents/skills/create-skill/SKILL.md +28 -0
  256. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +52 -1
  257. package/dist/templates/workspace-core/.agents/skills/extension-points/SKILL.md +2 -0
  258. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +95 -433
  259. package/dist/templates/workspace-core/.agents/skills/extensions/references/api.md +285 -0
  260. package/dist/templates/workspace-core/.agents/skills/extensions/references/examples.md +259 -0
  261. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +398 -0
  262. package/dist/templates/workspace-core/.agents/skills/external-agents/references/mcp-apps-embedding.md +157 -0
  263. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +17 -0
  264. package/dist/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +13 -2
  265. package/dist/templates/workspace-core/.agents/skills/mvp-followup/SKILL.md +51 -0
  266. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +14 -4
  267. package/dist/templates/workspace-core/.agents/skills/onboarding/SKILL.md +13 -1
  268. package/dist/templates/workspace-core/.agents/skills/portability/SKILL.md +27 -5
  269. package/dist/templates/workspace-core/.agents/skills/qa/SKILL.md +24 -8
  270. package/dist/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +53 -7
  271. package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +43 -10
  272. package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +2 -0
  273. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +43 -14
  274. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +50 -1
  275. package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +4 -2
  276. package/dist/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +11 -1
  277. package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +15 -0
  278. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +5 -1
  279. package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +48 -19
  280. package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +7 -3
  281. package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +13 -6
  282. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +236 -0
  283. package/dist/templates/workspace-core/AGENTS.md +5 -1
  284. package/dist/templates/workspace-root/AGENTS.md +5 -2
  285. package/dist/tracking/route.d.ts +43 -0
  286. package/dist/tracking/route.d.ts.map +1 -0
  287. package/dist/tracking/route.js +85 -0
  288. package/dist/tracking/route.js.map +1 -0
  289. package/dist/vite/client.d.ts.map +1 -1
  290. package/dist/vite/client.js +15 -0
  291. package/dist/vite/client.js.map +1 -1
  292. package/docs/content/a2a-protocol.md +18 -4
  293. package/docs/content/actions.md +87 -0
  294. package/docs/content/agent-mentions.md +2 -1
  295. package/docs/content/authentication.md +2 -1
  296. package/docs/content/client.md +64 -13
  297. package/docs/content/cloneable-saas.md +1 -1
  298. package/docs/content/code-agents-ui.md +17 -11
  299. package/docs/content/context-awareness.md +23 -28
  300. package/docs/content/creating-templates.md +1 -1
  301. package/docs/content/drop-in-agent.md +2 -0
  302. package/docs/content/getting-started.md +2 -2
  303. package/docs/content/key-concepts.md +2 -2
  304. package/docs/content/messaging.md +57 -15
  305. package/docs/content/migration-workbench.md +1 -1
  306. package/docs/content/multi-app-workspace.md +1 -1
  307. package/docs/content/multi-tenancy.md +17 -15
  308. package/docs/content/real-time-collaboration.md +1 -1
  309. package/docs/content/recurring-jobs.md +1 -1
  310. package/docs/content/security.md +2 -2
  311. package/docs/content/server.md +4 -4
  312. package/docs/content/skills-guide.md +30 -0
  313. package/docs/content/template-analytics.md +2 -2
  314. package/docs/content/template-assets.md +17 -1
  315. package/docs/content/template-brain.md +2 -2
  316. package/docs/content/template-calendar.md +1 -1
  317. package/docs/content/template-clips.md +3 -3
  318. package/docs/content/template-content.md +2 -2
  319. package/docs/content/template-design.md +2 -2
  320. package/docs/content/template-dispatch.md +3 -3
  321. package/docs/content/template-forms.md +14 -2
  322. package/docs/content/template-mail.md +1 -3
  323. package/docs/content/template-plan.md +118 -0
  324. package/docs/content/template-slides.md +5 -4
  325. package/docs/content/template-starter.md +4 -4
  326. package/docs/content/template-videos.md +6 -11
  327. package/docs/content/tracking.md +21 -1
  328. package/docs/content/visual-plans.md +72 -0
  329. package/docs/content/workspace.md +9 -9
  330. package/package.json +26 -11
  331. package/src/templates/default/.agents/skills/actions/SKILL.md +4 -1
  332. package/src/templates/default/.agents/skills/security/SKILL.md +13 -4
  333. package/src/templates/default/.agents/skills/storing-data/SKILL.md +15 -3
  334. package/src/templates/default/AGENTS.md +1 -0
  335. package/src/templates/default/DEVELOPING.md +2 -0
  336. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +10 -3
  337. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +98 -10
  338. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +45 -3
  339. package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +2 -0
  340. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +37 -4
  341. package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +9 -4
  342. package/src/templates/workspace-core/.agents/skills/capture-learnings/SKILL.md +2 -0
  343. package/src/templates/workspace-core/.agents/skills/client-methods/SKILL.md +106 -0
  344. package/src/templates/workspace-core/.agents/skills/client-methods/references/legacy-client-fetch-audit-2026-06-03.md +53 -0
  345. package/src/templates/workspace-core/.agents/skills/client-side-routing/SKILL.md +2 -0
  346. package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +62 -61
  347. package/src/templates/workspace-core/.agents/skills/context-xray/SKILL.md +47 -0
  348. package/src/templates/workspace-core/.agents/skills/create-skill/SKILL.md +28 -0
  349. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +52 -1
  350. package/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +2 -0
  351. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +95 -433
  352. package/src/templates/workspace-core/.agents/skills/extensions/references/api.md +285 -0
  353. package/src/templates/workspace-core/.agents/skills/extensions/references/examples.md +259 -0
  354. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +398 -0
  355. package/src/templates/workspace-core/.agents/skills/external-agents/references/mcp-apps-embedding.md +157 -0
  356. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +17 -0
  357. package/src/templates/workspace-core/.agents/skills/integration-webhooks/SKILL.md +13 -2
  358. package/src/templates/workspace-core/.agents/skills/mvp-followup/SKILL.md +51 -0
  359. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +14 -4
  360. package/src/templates/workspace-core/.agents/skills/onboarding/SKILL.md +13 -1
  361. package/src/templates/workspace-core/.agents/skills/portability/SKILL.md +27 -5
  362. package/src/templates/workspace-core/.agents/skills/qa/SKILL.md +24 -8
  363. package/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +53 -7
  364. package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +43 -10
  365. package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +2 -0
  366. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +43 -14
  367. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +50 -1
  368. package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +4 -2
  369. package/src/templates/workspace-core/.agents/skills/server-plugins/SKILL.md +11 -1
  370. package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +15 -0
  371. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +5 -1
  372. package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +48 -19
  373. package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +7 -3
  374. package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +13 -6
  375. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +236 -0
  376. package/src/templates/workspace-core/AGENTS.md +5 -1
  377. package/src/templates/workspace-root/AGENTS.md +5 -2
@@ -0,0 +1,398 @@
1
+ ---
2
+ name: external-agents
3
+ description: >-
4
+ Connect external agents and MCP hosts (Claude, Claude Desktop, Claude Code,
5
+ ChatGPT custom MCP apps, Codex, Cursor, Claude Cowork, VS Code GitHub
6
+ Copilot, Goose, Postman, MCPJam) to an agent-native app over MCP, and
7
+ round-trip artifacts back into the UI with MCP Apps and deep links. Use when
8
+ adding an action's `link` builder or `mcpApp`, wiring the
9
+ `/_agent-native/open` route, exposing an "ingest" action to MCP/A2A, or
10
+ scaffolding apps from an external agent.
11
+ metadata:
12
+ internal: true
13
+ ---
14
+
15
+ # External Agents (MCP bridge + deep links)
16
+
17
+ ## Rule
18
+
19
+ An agent-native app is reachable by any MCP-compatible host (Claude, Claude
20
+ Desktop, Claude Code, ChatGPT custom MCP apps, Codex, Cursor, Cowork, VS Code
21
+ GitHub Copilot, Goose, Postman, MCPJam, and future standard clients). Keep
22
+ setup simple: for workspace or cross-app access, add one remote MCP connector:
23
+ `https://dispatch.agent-native.com/_agent-native/mcp`. Dispatch's Agents page
24
+ controls whether that single connector reaches all apps or only selected apps,
25
+ and Dispatch filters `list_apps`, `ask_app`, and `open_app` to the granted set.
26
+ For a deliberately isolated app, add that app directly at
27
+ `https://<app>.agent-native.com/_agent-native/mcp` or
28
+ `https://<your-host>/_agent-native/mcp`.
29
+
30
+ OAuth-capable hosts should use the standard remote MCP OAuth flow. Claude
31
+ connectors and Claude Code `/mcp` authentication discover the protected
32
+ resource, open the Agent-Native authorization page, and store their own tokens.
33
+ ChatGPT custom MCP connectors use the same URL: choose OAuth, scan/discover
34
+ tools, sign in, and approve the scopes. Local stdio proxying and older clients
35
+ can still use `npx @agent-native/core connect <url>`, which mints a per-user,
36
+ scoped, revocable token from a logged-in browser session; no shared secret is
37
+ copied.
38
+
39
+ Claude and ChatGPT can cache custom connector tool/resource metadata. After
40
+ changing MCP App metadata or the shared `embedApp()` shell, validate with a
41
+ fresh tool call; if the host still behaves like the old descriptor, reconnect
42
+ the Claude connector or rescan/review the ChatGPT connector.
43
+
44
+ Once connected, every action that produces or lists a navigable resource SHOULD
45
+ return a deep link from a `link` builder, so the external agent can surface an
46
+ **"Open in <app> →"** link that drops the user back into the running UI at the
47
+ right view and record. Actions can also declare `mcpApp` so hosts that support
48
+ MCP Apps render an inline interactive preview. The link is a pure pointer —
49
+ the record-focusing write is always scoped to the **browser session**, never
50
+ the agent's token.
51
+
52
+ ## Why
53
+
54
+ External agents are great at producing artifacts (a draft, an event, a
55
+ dashboard) but they live in a terminal, chat host, or another app. Without a
56
+ bridge, the user gets a wall of JSON and has to go find the thing. MCP Apps
57
+ give compatible hosts an inline review/edit surface; the deep-link bridge
58
+ closes the loop everywhere else by handing the user a single link that opens
59
+ the real app focused on exactly what was produced. It reuses the existing
60
+ `navigate` / `application_state` contract the UI already drains every 2s (see
61
+ **context-awareness**) — we never invent a second navigation mechanism.
62
+
63
+ ## How
64
+
65
+ ### 1. Connect to hosted apps
66
+
67
+ Use one connector for normal workspace access:
68
+
69
+ ```text
70
+ https://dispatch.agent-native.com/_agent-native/mcp
71
+ ```
72
+
73
+ Then open Dispatch → Agents to choose whether the gateway exposes every app or
74
+ only selected app IDs. External agents call `list_apps` to see the granted set,
75
+ `ask_app` to route a natural-language task over A2A to a granted app, and
76
+ `open_app` to return a deep link or inline app preview.
77
+
78
+ Use a direct app URL only when you intentionally want one isolated app:
79
+
80
+ ```text
81
+ https://mail.agent-native.com/_agent-native/mcp
82
+ https://<your-app>.agent-native.com/_agent-native/mcp
83
+ ```
84
+
85
+ Claude / Claude Desktop: add a custom connector with the URL, click Connect,
86
+ then sign in and approve `mcp:read`, `mcp:write`, and `mcp:apps`. Claude Code:
87
+ add the same remote HTTP URL, restart if needed, run `/mcp`, and choose
88
+ Authenticate. ChatGPT: create a custom MCP connector/app, paste the same URL,
89
+ choose OAuth, scan/discover tools, then sign in and approve scopes. Each host
90
+ stores its own OAuth tokens; MCP App iframes never receive raw tokens because
91
+ the host mediates tool and resource calls over the authenticated MCP
92
+ connection.
93
+
94
+ For local stdio proxying, Codex/Cowork compatibility, or clients without
95
+ remote MCP OAuth, use the hosted connect fallback:
96
+
97
+ ```bash
98
+ npx @agent-native/core connect https://dispatch.agent-native.com
99
+ # or, for an isolated app:
100
+ npx @agent-native/core connect https://mail.agent-native.com
101
+ ```
102
+
103
+ The command opens the app in the browser, the user clicks **Authorize**, and a
104
+ per-user, scoped, revocable token is written to the selected client config. The
105
+ no-CLI equivalent is `https://<app>/_agent-native/mcp/connect`, which shows
106
+ the copyable MCP URL, Claude / ChatGPT / Cursor / Claude Code / Codex / Other
107
+ steps, and static-token fallback for clients that need it.
108
+
109
+ Re-running `agent-native connect <url> --client claude-code` over an older
110
+ Claude bearer-token entry is the migration path: the CLI replaces
111
+ `Authorization` headers with URL-only OAuth config and tells the user to
112
+ authenticate from `/mcp`.
113
+
114
+ Under the hood: a logged-in browser session mints an `A2A_SECRET`-signed JWT
115
+ carrying the caller's `sub` + `org_domain` and a unique `jti`, so tool runs
116
+ stay tenant-scoped via `runWithRequestContext`. The existing
117
+ `/_agent-native/mcp` endpoint accepts it like any bearer — no new endpoint.
118
+ The same Connect page lists and revokes minted tokens by `jti`; treat them
119
+ like personal access tokens. Nothing exposes the deployment's shared secret.
120
+
121
+ ### 1a. Generic cross-app verbs + scaffolding
122
+
123
+ Once connected, on top of the per-action tools the MCP server also exposes a
124
+ stable verb set (see `packages/core/src/mcp/builtin-tools.ts`) so an external
125
+ agent has a predictable surface without guessing per-app action names:
126
+
127
+ - `list_apps` — workspace apps + their URLs / running state.
128
+ - `open_app({ app, view?, path?, params?, embed? })` — returns a deep link or
129
+ direct same-origin app route (no user-data side effects); surfaces as an
130
+ "Open …" link and, with `embed: true`, an inline full-app MCP App in capable
131
+ hosts.
132
+ - `ask_app({ app, message })` — routes a natural-language task to that app's
133
+ in-app agent (delegates to the existing `ask-agent` meta-tool).
134
+ - `create_workspace_app({ name, template })` — scaffolds + boots a new app via
135
+ the workspace path (rejects non-allow-listed templates), returns its running
136
+ URL + deep link.
137
+ - `list_templates` — the allow-listed templates only.
138
+
139
+ A same-named template action overrides a builtin (template-over-core
140
+ precedence). Disable the set with `MCPConfig.builtinCrossAppTools: false`.
141
+
142
+ The advertised `tools/list` and `resources/list` catalogs are intentionally
143
+ tiny by default for ChatGPT/Claude-style app hosts, including OAuth MCP Apps
144
+ callers and generic authenticated remote HTTP/static-token callers. The model
145
+ sees the generic app-facing verbs (`list_apps`, `open_app`, `ask_app`, and
146
+ app-only `create_embed_session`) and routes UI through
147
+ `open_app({ embed: true })`. Stdio/code clients that explicitly identify as
148
+ developer clients keep the full connected action surface, and
149
+ `publicAgent.expose` remains the opt-in for safe read/ingest tools outside the
150
+ compact MCP Apps catalog. Do not rely on action-specific `mcpApp` resources
151
+ appearing in ChatGPT/Claude discovery by default; use `open_app` for the
152
+ first-class app embed path. If a specific
153
+ action truly must remain visible in that compact app-host catalog, set
154
+ `mcpApp.compactCatalog: true` as a rare escape hatch.
155
+
156
+ ### 1b. Fast-path expectations for MCP Apps hosts
157
+
158
+ Keep ChatGPT/Claude paths short. For a known app-facing intent, the external
159
+ agent should call the specific action that creates or opens the thing, then let
160
+ the MCP App launch the route. Do **not** route simple UI handoffs
161
+ through `ask_app`, broad `list_resources`, or generic app-agent delegation just
162
+ to find a screen.
163
+
164
+ Expected shape:
165
+
166
+ - Email draft: `manage_draft` → inline Mail compose route. The widget calls
167
+ `create_embed_session` itself.
168
+ - Dashboard/filter/search: `open_app({ path, embed: true })` or the dashboard
169
+ action with `mcpApp` → inline full app/dashboard route.
170
+ - Calendar invite: `manage-event-draft` → inline Calendar event draft route.
171
+ - Forms/content/slides/design/clips: create/search action with `mcpApp` →
172
+ inline editor/player route.
173
+
174
+ `list_apps` is fine when the model genuinely needs to choose among granted
175
+ apps. `resources/list`/`resources/read` are host plumbing for MCP Apps UI
176
+ resources; they are not a planning strategy. If a host/model repeatedly calls
177
+ large discovery tools before obvious app-facing actions, tighten action names,
178
+ descriptions, `mcpApp` metadata, or compact-catalog filtering until the direct
179
+ path is obvious.
180
+
181
+ ### 2. Add a `link` builder to an action
182
+
183
+ `defineAction` accepts an optional `link` builder. When set, every MCP/A2A
184
+ result for that tool auto-appends a markdown `[label →](absoluteUrl)` block and
185
+ a structured `_meta["agent-native/openLink"] = { label, view, webUrl,
186
+ desktopUrl }`; `tools/list` adds
187
+ `annotations["agent-native/producesOpenLink"]` plus a description suffix so the
188
+ external agent knows the tool yields an openable link.
189
+
190
+ Real example — mail's `manage-draft` (`templates/mail/actions/manage-draft.ts`):
191
+
192
+ ```ts
193
+ import { buildDeepLink } from "@agent-native/core/server";
194
+
195
+ function composeDeepLink(draft: Record<string, string>): string {
196
+ return buildDeepLink({
197
+ app: "mail",
198
+ view: "inbox",
199
+ compose: encodeComposeDraft(draft), // base64url JSON → compose-<id> draft
200
+ });
201
+ }
202
+
203
+ export default defineAction({
204
+ // ...schema, run...
205
+ link: ({ result }) => {
206
+ if (!result || typeof result !== "object") return null;
207
+ const draft = (result as { draft?: Record<string, string> }).draft;
208
+ const id = (result as { id?: string }).id;
209
+ if (!draft || !id) return null;
210
+ return { url: composeDeepLink(draft), label: "Open draft in Mail", view: "inbox" };
211
+ },
212
+ });
213
+ ```
214
+
215
+ List/search actions point at a record-focused view the same way — mail's
216
+ `list-emails` returns
217
+ `{ url: buildDeepLink({ app: "mail", view: "inbox", params: { label, search } }), label: "Open list in Mail" }`.
218
+
219
+ **The `link` contract:** pure, synchronous, **no I/O, no awaits**. It runs
220
+ best-effort — a throw, `null`, or `undefined` is swallowed and **never** fails
221
+ the tool call. It only reads the call's `args` and `result`; it must not query
222
+ the DB, read app-state, or call other actions.
223
+
224
+ ### 2a. Optional MCP Apps UI
225
+
226
+ For hosts that support the MCP Apps extension, an action can also advertise an
227
+ inline UI resource with `mcpApp`. This is a progressive enhancement for flows
228
+ where the external agent should hand the user an interactive surface instead of
229
+ only text — for example reviewing an email draft, editing a calendar invite, or
230
+ choosing between generated dashboard variants.
231
+
232
+ Use the real React app with `embedApp()` whenever the user needs UI. The mental
233
+ model is simple: the action's `link` target is also the MCP App embed target.
234
+ Expose the operation as a normal action/tool, return a focused deep link with
235
+ `link`, and add `mcpApp.resource = embedApp(...)` so capable hosts load that
236
+ same route inline instead of opening a new tab. Keep the `link` fallback even
237
+ when adding `mcpApp` — non-UI clients still need the "Open in … →" link.
238
+
239
+ ```ts
240
+ import { embedApp } from "@agent-native/core";
241
+
242
+ export default defineAction({
243
+ // ...schema, run, link...
244
+ mcpApp: {
245
+ resource: embedApp({
246
+ title: "Review draft",
247
+ description: "Open the generated draft in the real Mail compose UI.",
248
+ iframeTitle: "Agent-Native Mail",
249
+ openLabel: "Open in Mail",
250
+ }),
251
+ },
252
+ });
253
+ ```
254
+
255
+ Do not hand-write one-off plain HTML MCP Apps for product UI; if the action
256
+ needs a custom surface, add or reuse a real app route/component first and embed
257
+ that route. For known first-party handoffs, prefer a direct action with
258
+ `mcpApp` (e.g. Mail `manage-draft`, Calendar `manage-event-draft`) over letting
259
+ the model hunt through screens; `open_app({ path, embed: true })` is the
260
+ generic escape hatch for full dashboards, filtered inboxes, analyses, or
261
+ extension pages.
262
+
263
+ The host bridges (Claude transplant vs. ChatGPT `window.openai`), embed start
264
+ tickets, extension-page `srcDoc` rendering inside chat embeds, host sizing
265
+ (`embedApp({ height })`), `sendToAgentChat`, `_meta.ui.domain` rules, and
266
+ ngrok/prod testing caveats are documented in
267
+ **`references/mcp-apps-embedding.md`**. Read it before changing the
268
+ `embedApp()` shell, the `ui://` resource, or any host-bridge behavior.
269
+
270
+ ### 3. The `/_agent-native/open` route
271
+
272
+ `buildDeepLink(...)` returns the app-relative path
273
+ `/_agent-native/open?app=…&view=…&<recordId>=…`. The MCP layer turns that into
274
+ an absolute web URL (`toAbsoluteOpenUrl`, using the request origin) and a
275
+ desktop `agentnative://open?…` URL (`toDesktopOpenUrl`). When the user clicks
276
+ it in any browser or inline webview, `GET /_agent-native/open`
277
+ (`createOpenRouteHandler`, mounted by the core routes plugin, gated by
278
+ `disableOpenRoute`, customizable via `resolveOpenPath`):
279
+
280
+ 1. Resolves the **browser** session via `getSession` (the auth guard bypasses
281
+ the exact path `/_agent-native/open`).
282
+ 2. If unauthenticated, serves the configured login HTML **at the same URL**
283
+ (`getConfiguredLoginHtml`); the form's success handler reloads
284
+ `window.location`, re-entering the route authenticated — no `?next=`
285
+ plumbing.
286
+ 3. Writes the existing one-shot `navigate` application-state command (payload =
287
+ every non-reserved query param + `view`) scoped to the browser session's
288
+ email with `requestSource: "deep-link"`, and decodes a `compose` base64url
289
+ draft into a `compose-<id>` key.
290
+ 4. 302-redirects to a safe same-origin relative path (`to=`, else `/<view>`,
291
+ else `resolveOpenPath`), forwarding `f_*` filter params so lists/dashboards
292
+ open pre-filtered before the `navigate` command is even drained.
293
+
294
+ Cross-origin, scheme-relative `//host`, and control-char redirects are rejected
295
+ (open-redirect guard). **Identity rule:** the link carries no privileged
296
+ state — it is just `view` + record ids + filters. The record-focusing
297
+ `navigate` write is scoped to whoever is logged into the browser, never the
298
+ external agent's MCP token. See **context-awareness** for the
299
+ `navigate`/`application_state` contract this bridges to.
300
+
301
+ ### 4. "Ingest" actions for external agents
302
+
303
+ An action an external agent reads to pull live app state into its own context
304
+ must be: `http: { method: "GET" }` + `readOnly: true` +
305
+ `publicAgent: { expose: true, readOnly: true, requiresAuth: true }`. GET +
306
+ `readOnly` keeps it side-effect-free and out of the screen-refresh change event;
307
+ `publicAgent` is the explicit opt-in (public web routes never imply public
308
+ MCP/A2A exposure). Design/content ingest actions MUST read **live** state
309
+ (e.g. the Yjs document) — not the stale DB snapshot column — so the external
310
+ agent sees what the user actually has on screen.
311
+
312
+ ### 5. Advanced: local development & manual setup
313
+
314
+ The hosted `connect` flow above is the recommended path. For local dev, run
315
+ the app (`pnpm dev` / `agent-native dev`) then point a local agent at it:
316
+
317
+ ```bash
318
+ agent-native mcp install --client claude-code|claude-code-cli|codex|cowork \
319
+ [--app <id>] [--scope user|project]
320
+ ```
321
+
322
+ It provisions a token (random `ACCESS_TOKEN` into the workspace `.env` for
323
+ local dev, or a `signA2AToken` JWT for a detected hosted origin) and writes an
324
+ idempotent stdio server entry — `.mcp.json` / `~/.claude.json` for Claude Code,
325
+ the `[mcp_servers.*]` block in `~/.codex/config.toml` for Codex, the
326
+ Claude-Code JSON shape for Cowork. The entry runs `agent-native mcp serve
327
+ --app <id>`, by default a **thin stdio proxy** to the running local app's
328
+ `/_agent-native/mcp` (live registry + HMR + correct deep links stay the single
329
+ source of truth; `--standalone` builds the registry in-process). Companion
330
+ subcommands: `mcp uninstall`, `mcp status`, `mcp token [--rotate]`. You can
331
+ also hand-write an `http` `.mcp.json` entry with a token you supply yourself —
332
+ the unmanaged equivalent of what `connect` writes.
333
+
334
+ **Dev vs production tool surface:** in plain local dev
335
+ (`NODE_ENV=development` and `AGENT_MODE !== "production"`) the MCP `tools/list`
336
+ deliberately exposes only the generic builtins plus actions with
337
+ `publicAgent.requiresAuth === false` — per-app ingest (`requiresAuth: true`)
338
+ and mutating actions are filtered out (`filterPublicAgentActions`). The full
339
+ surface appears when authenticated as a real caller: a deployed /
340
+ `AGENT_MODE=production` app, or a local app reached through `connect` /
341
+ `agent-native mcp install` (which provisions an identity-bearing token). A
342
+ sparse `tools/list` means you are hitting an unauthenticated dev endpoint —
343
+ connect or present a token rather than assuming the action is missing.
344
+
345
+ ## Do
346
+
347
+ - Do connect local/fallback clients to Dispatch with
348
+ `npx @agent-native/core connect https://dispatch.agent-native.com`; use a
349
+ direct app URL only when the host should be isolated to one app.
350
+ - Do add a `link` builder to any action that produces or lists a navigable
351
+ resource (draft, event, dashboard, document).
352
+ - Do add `mcpApp` when a UI-capable MCP host should render an inline review or
353
+ edit surface, while keeping the `link` fallback.
354
+ - Do use `embedApp()` / `open_app({ embed: true })` when the right UI is the
355
+ existing React app at a specific route, including full app routes and focused
356
+ component routes like an Analytics chart embed.
357
+ - Do test real ChatGPT/Claude web behavior with a fresh inline render after any
358
+ resource-shell or host-bridge change; old frames are not proof that a new
359
+ shell is still broken.
360
+ - Do build the URL with `buildDeepLink(...)` — it is the single source of truth
361
+ for the open-route format.
362
+ - Do keep `link` pure and synchronous; return `null` when there's nothing to
363
+ open.
364
+ - Do keep `link` and `mcpApp` metadata pure and synchronous; use `embedApp()`
365
+ so the user sees the shared React UI.
366
+ - Do make external-agent read/ingest actions GET + `readOnly` + `publicAgent`,
367
+ and read live (Yjs) state, not the stale DB column.
368
+ - Do let the open route resolve the browser session; pass record ids as deep-
369
+ link params and let the UI focus them via the polled `navigate` command.
370
+
371
+ ## Don't
372
+
373
+ - Don't copy a deployment's shared `ACCESS_TOKEN` / `A2A_SECRET` into a client
374
+ config when `connect` can mint a per-user, revocable token instead.
375
+ - Don't hand-format the `/_agent-native/open` URL — always go through
376
+ `buildDeepLink`.
377
+ - Don't do I/O, awaits, DB reads, or app-state reads inside a `link` builder.
378
+ - Don't replace deep links with MCP Apps; non-UI clients still need the link.
379
+ - Don't hand-write product UI in `mcpApp.resource.html`; use a real React
380
+ route/component and embed it with `embedApp()`.
381
+ - Don't test Claude full-app embeds against raw Vite dev modules and conclude
382
+ production is broken; use `agent-native start`, a preview deploy, or prod.
383
+ - Don't scope the `navigate` write to the agent token, or pass privileged
384
+ state through the deep link — it's a pure pointer.
385
+ - Don't invent a new navigation mechanism; bridge to the existing
386
+ `navigate`/`application_state` contract.
387
+ - Don't widen the public template allow-list when scaffolding an app from an
388
+ external agent — the allow-list in `packages/shared-app-config/templates.ts`
389
+ is authoritative and guarded.
390
+
391
+ ## Related Skills
392
+
393
+ - **actions** — defining actions, `publicAgent`, GET/`readOnly`
394
+ - **context-awareness** — the `navigate` / `application_state` contract the
395
+ open route bridges to
396
+ - **a2a-protocol** — the `ask-agent` meta-tool and JSON-RPC peer calls
397
+ - **adding-a-feature** — the four-area checklist (add a `link` builder when a
398
+ feature produces a navigable resource)
@@ -0,0 +1,157 @@
1
+ # MCP Apps Embedding Internals
2
+
3
+ Deep-dive reference for the optional MCP Apps UI surface — the `mcpApp` action
4
+ field, `embedApp()`, the host bridges (Claude / ChatGPT), embed start tickets,
5
+ extension-page rendering inside chat embeds, and host sizing. For the common
6
+ case (adding a `link` builder, connecting hosts, ingest actions, the
7
+ `/_agent-native/open` route), see `../SKILL.md`. This file is the expansion of
8
+ that skill's "Optional MCP Apps UI" section.
9
+
10
+ ## Optional MCP Apps UI
11
+
12
+ For hosts that support the MCP Apps extension, an action can also advertise an
13
+ inline UI resource with `mcpApp`. This is a progressive enhancement for flows
14
+ where the external agent should hand the user an interactive surface instead of
15
+ only text — for example reviewing an email draft, editing a calendar invite, or
16
+ choosing between generated dashboard variants.
17
+
18
+ Use the real React app with `embedApp()` whenever the user needs UI. The mental
19
+ model is simple: the action's `link` target is also the MCP App embed target.
20
+ Expose the operation as a normal action/tool, return a focused deep link with
21
+ `link`, and add `mcpApp.resource = embedApp(...)` so capable hosts load that
22
+ same route inline instead of opening a new tab.
23
+
24
+ `embedApp()` supports both host bridges. Standard MCP Apps hosts use the
25
+ `ui/*` bridge; ChatGPT uses the `window.openai` compatibility bridge, reading
26
+ `toolInput` / `toolOutput` / `toolResponseMetadata` and calling
27
+ `create_embed_session` through `window.openai.callTool(...)`. Do not build a
28
+ ChatGPT-only HTML surface. Keep the action result and `link` target focused so
29
+ both bridges land on the same real app route.
30
+
31
+ That means full-app embeds can do anything the route can do once opened:
32
+ review or edit an email draft, show a filtered inbox/search, open a calendar
33
+ event or event draft, load an extension page, inspect a full analytics
34
+ dashboard or saved analysis, continue a deck in the Slides editor, or open a
35
+ Design project/editor. Prefer URL/deep-link params and the existing
36
+ `/_agent-native/open` navigation/app-state bridge over inventing a second
37
+ state protocol for MCP Apps.
38
+
39
+ On rare occasions the right target is a focused app route that renders one
40
+ shared React component instead of the whole app shell. Analytics' `/chart`
41
+ route is the model: it takes a compact `SqlPanel` payload in the URL and
42
+ renders the same chart component the dashboard uses. This is still an app
43
+ embed, not a plain HTML MCP App. Expose or call it through a normal action /
44
+ `open_app({ path, embed: true })`, keep the URL deterministic, and let
45
+ `embedApp()` render that route inline.
46
+
47
+ Do not hand-write one-off plain HTML MCP Apps for product UI; if the action
48
+ needs a custom surface, add or reuse a real app route/component first and embed
49
+ that route.
50
+
51
+ ```ts
52
+ import { embedApp } from "@agent-native/core";
53
+
54
+ export default defineAction({
55
+ // ...schema, run, link...
56
+ mcpApp: {
57
+ resource: embedApp({
58
+ title: "Review draft",
59
+ description: "Open the generated draft in the real Mail compose UI.",
60
+ iframeTitle: "Agent-Native Mail",
61
+ openLabel: "Open in Mail",
62
+ }),
63
+ },
64
+ });
65
+ ```
66
+
67
+ The MCP server advertises extension `io.modelcontextprotocol/ui`, adds
68
+ `_meta.ui.resourceUri` plus the legacy-compatible `_meta["ui/resourceUri"]` to
69
+ `tools/list`, and also emits ChatGPT Apps SDK compatibility metadata
70
+ (`openai/outputTemplate`, widget CSP/description/accessibility). It exposes the
71
+ HTML through `resources/list`, `resources/templates/list`, and `resources/read`
72
+ using MIME `text/html;profile=mcp-app`. The stdio proxy forwards those resource
73
+ handlers from the live app, so local desktop/CLI clients see the same resources
74
+ as HTTP clients.
75
+
76
+ Keep the existing `link` builder even when adding `mcpApp`. CLI-only clients,
77
+ older hosts, and any host that does not render MCP Apps will ignore the UI
78
+ metadata and still need the "Open in … →" link. `embedApp()` uses that link as
79
+ its launch target. Same-app `open_app({ embed: true })` mints the
80
+ `/_agent-native/embed/start` ticket during the original tool call so production
81
+ hosts do not need the iframe to make a second app-only helper call; custom
82
+ actions can return `embedStartUrl` for the same fast path. The MCP layer keeps
83
+ that ticket-bearing URL in hidden metadata and strips it from model-visible
84
+ structured content and normal open-link metadata. Otherwise the resource falls
85
+ back to the app-only `create_embed_session` helper. The embed start route
86
+ exchanges a one-time SQL ticket, then launches the real app route with a
87
+ short-lived browser session. Standard hosts navigate the MCP App frame
88
+ directly. Claude web uses a single-frame transplant path that fetches the
89
+ signed app HTML and hydrates it inside Claude's MCP App iframe because Claude
90
+ does not reliably allow app-owned child iframes or external frame navigation.
91
+ ChatGPT web uses a controlled route iframe for stable `window.openai` host APIs
92
+ and bounded height control. You can force the
93
+ single-frame transplant path in other hosts with `embedMode: "transplant"` or
94
+ `frame: "transplant"` when debugging host module loading, or force the nested
95
+ diagnostic iframe with `embedMode: "iframe"` /
96
+ `renderMode: "iframe"` / `nested: true` when debugging host behavior. Pass
97
+ additional `frameDomains` only for a custom MCP App that truly embeds a
98
+ third-party frame. `open_app({ app, path, embed: true })` is the generic
99
+ escape hatch for routes like full dashboards, filtered inboxes, calendar
100
+ drafts, analyses, or extension pages, and should be used liberally when the
101
+ full app is the clearest review/edit surface.
102
+
103
+ Do not set standard `_meta.ui.domain` to an app URL. That field is
104
+ host-specific: Claude validates hash subdomains such as
105
+ `{hash}.claudemcpcontent.com`, while ChatGPT has its own widget-domain
106
+ metadata. Let hosts choose their default sandbox origin unless you are emitting
107
+ a host-specific value on purpose. `embedApp()` may still emit
108
+ `openai/widgetDomain` for ChatGPT compatibility.
109
+
110
+ Extension pages are a special case inside MCP chat embeds. The normal app uses
111
+ `/_agent-native/extensions/:id/render` as a sandboxed child iframe, but MCP
112
+ chat hosts add another ancestor frame and can block that route via
113
+ `frame-ancestors` / `X-Frame-Options`. In MCP chat bridge mode the framework
114
+ renders the extension document as sandboxed `srcDoc` inside the existing app
115
+ route iframe instead; keep `sandbox="allow-scripts allow-forms"` and do not add
116
+ `allow-same-origin`.
117
+
118
+ For Dispatch, keep the single connector path first-class: the `open_app`
119
+ resource CSP should include the exact origins of apps granted through Dispatch,
120
+ not broad sources like `https:`. This lets Claude's transplant path fetch the
121
+ signed target app HTML while keeping the connector's resource surface narrow.
122
+
123
+ Host sizing rule: the MCP resource shell owns a bounded inline height and the
124
+ embedded route should scroll internally. `embedApp({ height })` defaults to a
125
+ `560px` shell, clamps to `320-900px`, and subtracts `44px` for the wrapper bar
126
+ before sizing the route viewport. Do not re-enable host SDK auto-resize for
127
+ full-app route embeds; Claude and ChatGPT can otherwise measure the whole
128
+ document and create a huge chat iframe. After changing the shell or `ui://`
129
+ resource version, verify with a fresh tool call because old conversation frames
130
+ keep the behavior they were rendered with.
131
+
132
+ Inside embedded routes, `sendToAgentChat({ submit: true })` posts
133
+ `agentNative.submitChat`; MCP App hosts receive that as model context plus a
134
+ visible `ui/message` turn, so an inline preview can intentionally continue the
135
+ Claude/ChatGPT conversation. Hidden context stays in model context; do not put
136
+ internal app-state file instructions into the visible prompt. `submit: false`
137
+ stays local as a prefill/review path.
138
+
139
+ When testing Claude through ngrok, use a production build (`agent-native build`
140
+ then `agent-native start`) or a deployed preview/production URL. Claude's
141
+ transplant path works with production asset chunks; raw Vite dev modules such
142
+ as `/app/root.tsx` can be app-auth protected and fail dynamic imports from the
143
+ Claude resource origin.
144
+
145
+ For known first-party handoffs, prefer a direct action with `mcpApp` over
146
+ letting the model hunt through screens. Examples: Mail `manage-draft` for email
147
+ drafts, Analytics `open-traffic-dashboard` for the first-party traffic
148
+ dashboard, Calendar `manage-event-draft` for invite drafts, and create/search
149
+ actions for Forms, Content, Clips, Slides, and Design. The action should return
150
+ concise structured content plus the link; it should not dump large catalogs or
151
+ HTML.
152
+
153
+ Compatibility target: build to the standard once, not per-client shims. MCP
154
+ Apps-capable hosts should include Claude/Claude Desktop/Claude Code, ChatGPT
155
+ custom MCP apps, VS Code GitHub Copilot, Goose, Postman, MCPJam, Cursor, and
156
+ any future host that follows the extension negotiation. Host support varies by
157
+ plan, release channel, and client version, so keep the deep link fallback.
@@ -8,6 +8,8 @@ description: >-
8
8
  creative, polished UI that avoids generic AI aesthetics.
9
9
  license: Complete terms in LICENSE.txt
10
10
  source: https://github.com/anthropics/skills/blob/main/skills/frontend-design/SKILL.md
11
+ metadata:
12
+ internal: true
11
13
  ---
12
14
 
13
15
  # Frontend Design
@@ -28,6 +30,19 @@ Before coding, decide:
28
30
 
29
31
  Then implement working code that is cohesive, accessible, responsive, and polished in small details: typography, spacing, copy, motion, empty states, loading states, focus states, and error states.
30
32
 
33
+ ## Minimalism And Progressive Disclosure
34
+
35
+ Default to Apple/Linear-level restraint: make the primary workflow obvious, then remove everything that does not help that workflow right now. A polished UI often has fewer visible controls, fewer borders, fewer labels, and fewer explanatory surfaces than the first reasonable implementation.
36
+
37
+ - **Start by subtracting**: Before adding a visible control, banner, toolbar row, card, or explanatory block, ask what can be removed, merged, renamed, or moved into an existing affordance.
38
+ - **One primary action**: Each surface should have one dominant next action. Secondary actions belong in menus, popovers, command palettes, disclosure rows, or contextual hover/focus states unless they are used constantly.
39
+ - **Progressively disclose rare work**: Advanced options, diagnostics, metadata, settings, import/export, destructive actions, and inspection tools should stay tucked away until requested. Prefer small icon triggers with tooltips, popovers, drawers, or detail panels over permanent chrome.
40
+ - **Keep chrome quiet**: Avoid new always-visible bars, badges, callouts, helper text, and counters unless they prevent mistakes or are central to repeated use. Status can often be a dot, ring, muted count, or tooltip.
41
+ - **Favor content over containers**: Do not wrap every section in a card. Use whitespace, alignment, typography, dividers, and full-width bands before adding boxes.
42
+ - **Design for repeated use**: Production app UI should feel calm after the hundredth use. If a control shouts, animates, explains itself, or occupies a full row for an occasional action, hide or compress it.
43
+ - **Make absence intentional**: Empty states should be sparse and action-oriented. Do not fill blank space with marketing copy, decorative art, or lists of features just because the screen feels empty.
44
+ - **Use familiar primitives**: Icon buttons need clear tooltips. Menus, popovers, tabs, switches, and segmented controls should carry complexity instead of exposing every option at once.
45
+
31
46
  ## Aesthetic Guidelines
32
47
 
33
48
  - **Typography**: Use the product's existing type system first. For net-new public pages, choose characterful but readable type and keep sizing appropriate to the surface.
@@ -72,6 +87,8 @@ Avoid:
72
87
  - Custom reimplementations of shadcn primitives.
73
88
  - Raw color overrides on shared components when semantic tokens or variants would work.
74
89
  - New always-visible controls for rare actions. Prefer menus, popovers, sheets, tabs, collapsibles, or advanced sections.
90
+ - Full-width banners, persistent helper rows, decorative cards, or explanatory chrome for status that could be a compact affordance.
91
+ - Treating progressive disclosure as optional. If a control is not part of the main daily workflow, hide it until context, hover, focus, or explicit user intent makes it relevant.
75
92
  - UI cards nested inside other cards.
76
93
  - Text or icons that resize or shift fixed-format UI on hover/loading.
77
94
 
@@ -5,6 +5,8 @@ description: >-
5
5
  Telegram, WhatsApp, email, etc.) on serverless hosts. Use when adding a new
6
6
  integration adapter, debugging dropped messages, or wiring long-running agent
7
7
  work into a webhook handler.
8
+ metadata:
9
+ internal: true
8
10
  ---
9
11
 
10
12
  # Integration Webhooks
@@ -155,14 +157,16 @@ prevents the same task from being processed twice.
155
157
  label: "MyPlatform",
156
158
  getRequiredEnvKeys: () => [
157
159
  { name: "MYPLATFORM_TOKEN", label: "MyPlatform Bot Token", scope: "global" },
160
+ { name: "MYPLATFORM_SIGNING_SECRET", label: "MyPlatform Signing Secret", scope: "global" },
158
161
  ],
159
162
  async handleVerification(event) {
160
163
  // Platform-specific challenge response, if any
161
164
  return { handled: false };
162
165
  },
163
166
  async verifyWebhook(event) {
164
- // HMAC / signing-secret check return false on mismatch
165
- return true;
167
+ // Verify HMAC/signature with a server-side secret and constant-time comparison.
168
+ // Never leave this as a permissive stub in production.
169
+ return verifyMyPlatformSignature(event);
166
170
  },
167
171
  async parseIncomingMessage(event) {
168
172
  // Map raw payload → IncomingMessage, or null to ignore
@@ -192,6 +196,13 @@ prevents the same task from being processed twice.
192
196
  `${baseUrl}/_agent-native/integrations/<platform>/webhook`. For platforms
193
197
  with a registration API (Telegram), implement `POST /:platform/setup`.
194
198
 
199
+ Never hardcode bot tokens, signing secrets, verification tokens, webhook URLs,
200
+ channel/customer identifiers, or copied platform payloads with real private data
201
+ inside the adapter, tests, docs, prompts, or fixtures. `getRequiredEnvKeys()`
202
+ declares credential names only. Values come from deployment configuration,
203
+ registered secrets, OAuth, or scoped credential stores, and tests should use
204
+ obvious fake placeholders.
205
+
195
206
  The adapter is **only** responsible for:
196
207
 
197
208
  - platform-specific verification (signatures, challenges)