@agent-native/core 0.37.2 → 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 -0
  24. package/dist/cli/skills.d.ts.map +1 -1
  25. package/dist/cli/skills.js +1349 -544
  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,72 @@
1
+ ---
2
+ title: "Visual Plans"
3
+ description: "Turn your coding agent's plans into interactive, reviewable documents with /visual-plan. Install authenticates once; reviewers you share with edit as a guest, sign in only to save or share."
4
+ ---
5
+
6
+ # Visual Plans
7
+
8
+ `/visual-plan` is a coding-agent skill that turns the plan your agent would normally write in Markdown into a **structured visual document**: an optional pan/zoom wireframe canvas on top and a Notion-like technical document below, with diagrams, mockups, prototype options, annotations, and comments you can react to before any code changes.
9
+
10
+ There are two ways into Plans:
11
+
12
+ - **From your coding agent (CLI)** — one command installs the skill, registers the hosted Plans connector, and authenticates it.
13
+ - **In the browser** — anyone you share with can open the editor and create or edit as a **guest, with no sign-up**. They sign in only when they want to save or share.
14
+
15
+ ## Coding agent setup {#install}
16
+
17
+ Install with the Agent-Native CLI. The command installs the skill instructions, registers the hosted Plans MCP connector, **and authenticates it in the same step**, so your first tool call does not hit an OAuth wall:
18
+
19
+ ```bash
20
+ agent-native skills add visual-plan
21
+ ```
22
+
23
+ Authentication is a one-time browser sign-in at setup — this is intended, and it is what lets the agent persist and share the plans it generates. This also installs the companion commands `/ui-plan`, `/visual-questions`, and `/visualize-plan` (see [Invoking the skill](#invoke)).
24
+
25
+ What the auth step does depends on your client:
26
+
27
+ - **OAuth-capable hosts** (Claude Code) get a URL-only MCP entry plus a prompt to run `/mcp` and choose **Authenticate**.
28
+ - **Codex / Cowork** run a short browser device-code flow: the CLI prints a code, opens the verification page, and writes the connector once you approve.
29
+ - In a **non-interactive shell or CI**, the auth step is skipped and the exact command to run later is printed for you.
30
+
31
+ Pass `--no-connect` to register the connector without authenticating, then run `agent-native connect https://plan.agent-native.com` whenever you are ready:
32
+
33
+ ```bash
34
+ agent-native skills add visual-plan --no-connect
35
+ ```
36
+
37
+ ## Invoking the skill {#invoke}
38
+
39
+ Once installed, use the slash command that fits the work:
40
+
41
+ - `/visual-plan` — the canonical command for any rich plan (architecture, backend, refactors, UI).
42
+ - `/ui-plan` — UI-first work that should start with the screens.
43
+ - `/visual-questions` — a short visual intake form before planning.
44
+ - `/visualize-plan` — turn an existing Codex, Claude Code, Markdown, or pasted plan into a visual companion.
45
+
46
+ The agent gates hard: it only builds a polished visual plan when a wrong direction would be costly, and skips it for trivial, unambiguous work. Each command generates a plan and opens the editor.
47
+
48
+ ## Editing in the browser as a guest {#guest}
49
+
50
+ People you share a plan with do not need to install anything. They open the Plans editor and **create and edit with no sign-up** — they work as a guest. Signing in is only required when someone wants to **save or share** their own work.
51
+
52
+ When a guest signs in, the plans they created as a guest are **claimed** into their account, so nothing they built is lost.
53
+
54
+ Plan prose edits inline: click into any text section, type, format with the rich editor toolbar or slash menu, and Plans autosaves the underlying markdown. Review annotation mode temporarily turns text sections read-only so clicks can pin feedback; leave review mode to keep editing prose.
55
+
56
+ ## Sharing and commenting {#sharing}
57
+
58
+ Sharing and commenting are the workflows that need an account:
59
+
60
+ - **Viewing** a public or shared plan works for anyone with the link — no account required.
61
+ - **Commenting** on a shared plan requires an agent-native account.
62
+ - **Sharing** a plan (publishing it to a link, private sharing, reviewer access, cross-device or team review) requires signing in. Google sign-in appears when the standard Google OAuth env vars are configured.
63
+
64
+ The hosted Plans connector lives at `https://plan.agent-native.com/_agent-native/mcp`. Never put shared secrets in skill files.
65
+
66
+ ## Local mode (advanced, offline) {#local}
67
+
68
+ For fully offline, no-account use, you can run the Plans app locally and sync your plans to your repo as MDX. This local mode is a separate, advanced path — not the default hosted flow — and is best when you need everything to stay on your machine and in version control.
69
+
70
+ ## Recovering from auth errors {#auth-errors}
71
+
72
+ If a Plans tool ever returns `needs auth`, `Unauthorized`, or `Session terminated`, do not keep retrying it. Authenticate the connector with `agent-native connect https://plan.agent-native.com` (or re-run `/mcp` → **Authenticate** in an OAuth-capable host), then continue once the connector is available.
@@ -290,15 +290,15 @@ The resource system also seeds a personal `LEARNINGS.md` for compatibility with
290
290
 
291
291
  **Where it fits.**
292
292
 
293
- | Surface | Scope | Written by | Read when |
294
- | ------------------ | ------------------ | ------------------------------------ | -------------------------------------- |
295
- | `AGENTS.md` | Shared | Humans / agent on request | Every turn |
296
- | `LEARNINGS.md` | Shared | Humans / agent on request | Every turn |
297
- | `memory/MEMORY.md` | Personal | Agent / humans | Every turn |
298
- | `instructions/…` | Shared | Humans / agent on request | Every turn |
299
- | `skills/…` | Shared | Humans / agent on request | On demand (`/slash` command) |
300
- | `context/…` | Shared | Humans / agent on request | Indexed every turn, read when relevant |
301
- | `mcp-servers/…` | Workspace / shared | Humans via Dispatch or app workspace | MCP config refresh |
293
+ | Surface | Scope | Written by | Read when |
294
+ | ------------------ | ------------------ | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
295
+ | `AGENTS.md` | Shared | Humans / agent on request | Every turn |
296
+ | `LEARNINGS.md` | Shared | Humans / agent on request | Every turn (Shared copy only — a personal `LEARNINGS.md` is seeded for back-compat but isn't preloaded; put personal context in `memory/MEMORY.md`) |
297
+ | `memory/MEMORY.md` | Personal | Agent / humans | Every turn |
298
+ | `instructions/…` | Shared | Humans / agent on request | Every turn |
299
+ | `skills/…` | Shared | Humans / agent on request | On demand (`/slash` command) |
300
+ | `context/…` | Shared | Humans / agent on request | Indexed every turn, read when relevant |
301
+ | `mcp-servers/…` | Workspace / shared | Humans via Dispatch or app workspace | MCP config refresh |
302
302
 
303
303
  Users can edit these memory files directly in the Workspace tab — they're regular resources. Delete lines the agent got wrong, keep personal preferences in `memory/MEMORY.md`, or promote team-wide rules into `AGENTS.md`.
304
304
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.37.2",
3
+ "version": "0.38.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -41,6 +41,8 @@
41
41
  "./db/schema": "./dist/db/schema.js",
42
42
  "./db/drizzle-config": "./dist/db/drizzle-config.js",
43
43
  "./client": "./dist/client/index.js",
44
+ "./blocks": "./dist/client/blocks/index.js",
45
+ "./blocks/server": "./dist/client/blocks/server.js",
44
46
  "./client/AgentPanel": "./dist/client/AgentPanel.js",
45
47
  "./client/application-state": "./dist/client/application-state.js",
46
48
  "./client/api-path": "./dist/client/api-path.js",
@@ -120,7 +122,7 @@
120
122
  "dev": "tsc --watch",
121
123
  "typecheck": "tsc --noEmit",
122
124
  "test": "vitest --run src",
123
- "prepack": "npm run build && cp ../../README.md ./README.md",
125
+ "prepack": "tsx ../../scripts/sync-workspace-core-skills.ts --check && npm run build && cp ../../README.md ./README.md",
124
126
  "prepublishOnly": "npm run build"
125
127
  },
126
128
  "dependencies": {
@@ -151,12 +153,23 @@
151
153
  "@tabler/icons-react": "^3",
152
154
  "@tailwindcss/typography": "^0.5.19",
153
155
  "@tanstack/react-table": "^8.21.3",
154
- "@tiptap/core": "^3.22.2",
155
- "@tiptap/extension-link": "^3.22.2",
156
- "@tiptap/extension-placeholder": "^3.22.2",
157
- "@tiptap/pm": "^3.22.2",
158
- "@tiptap/react": "^3.22.2",
159
- "@tiptap/starter-kit": "^3.22.2",
156
+ "@tiptap/core": "^3.26.0",
157
+ "@tiptap/extension-code-block-lowlight": "^3.26.0",
158
+ "@tiptap/extension-collaboration": "^3.26.0",
159
+ "@tiptap/extension-collaboration-caret": "^3.26.0",
160
+ "@tiptap/extension-image": "^3.26.0",
161
+ "@tiptap/extension-link": "^3.26.0",
162
+ "@tiptap/extension-placeholder": "^3.26.0",
163
+ "@tiptap/extension-table": "^3.26.0",
164
+ "@tiptap/extension-table-cell": "^3.26.0",
165
+ "@tiptap/extension-table-header": "^3.26.0",
166
+ "@tiptap/extension-table-row": "^3.26.0",
167
+ "@tiptap/extension-task-item": "^3.26.0",
168
+ "@tiptap/extension-task-list": "^3.26.0",
169
+ "@tiptap/pm": "^3.26.0",
170
+ "@tiptap/react": "^3.26.0",
171
+ "@tiptap/starter-kit": "^3.26.0",
172
+ "@tiptap/y-tiptap": "^3.0.4",
160
173
  "@uiw/react-codemirror": "^4.25.10",
161
174
  "better-auth": "1.6.0",
162
175
  "better-sqlite3": "^12.8.0",
@@ -167,10 +180,12 @@
167
180
  "drizzle-orm": "^0.45.2",
168
181
  "fzstd": "^0.1.1",
169
182
  "h3": "^2.0.1-rc.20",
183
+ "highlight.js": "^11.11.1",
170
184
  "isbot": "^5",
171
185
  "jiti": "^2.6.1",
172
186
  "jose": "^6.2.2",
173
187
  "kiwi-schema": "^0.5.0",
188
+ "lowlight": "^3.3.0",
174
189
  "minimatch": "^10.0.0",
175
190
  "nanoid": "^5.1.9",
176
191
  "nitro": "3.0.260415-beta",
@@ -186,7 +201,7 @@
186
201
  "tiptap-markdown": "^0.9.0",
187
202
  "tw-animate-css": "1.4.0",
188
203
  "y-protocols": "^1.0.7",
189
- "yjs": "^13.6.30",
204
+ "yjs": "^13.6.31",
190
205
  "zod": "^4.3.6"
191
206
  },
192
207
  "peerDependencies": {
@@ -327,8 +342,8 @@
327
342
  "express": "^5.2.1",
328
343
  "node-pty": "^1.1.0",
329
344
  "playwright": "^1.60.0",
330
- "react": "^19.2.5",
331
- "react-dom": "19.2.5",
345
+ "react": "^19.2.7",
346
+ "react-dom": "^19.2.7",
332
347
  "react-router": "^7.16.0",
333
348
  "tailwindcss": "catalog:",
334
349
  "typescript": "^6.0.3",
@@ -171,6 +171,7 @@ Older actions use a bare async function export with `parseArgs`:
171
171
  import { parseArgs, loadEnv, fail } from "@agent-native/core";
172
172
 
173
173
  export default async function myAction(args: string[]) {
174
+ // Only for deploy-level runtime config. User/org credentials use secrets/OAuth.
174
175
  loadEnv();
175
176
  const parsed = parseArgs(args);
176
177
  // ...
@@ -185,7 +186,9 @@ This still works but is not auto-exposed as HTTP. Prefer `defineAction` for all
185
186
  - **Return structured data.** Return objects/arrays, not `JSON.stringify()`.
186
187
  - **Use `http: { method: "GET" }`** for read-only actions. Default is POST.
187
188
  - **Use `http: false`** for agent-only actions (`navigate`, `view-screen`).
188
- - **Use `loadEnv()`** if the action needs environment variables (API keys, etc.).
189
+ - **Use `loadEnv()`** only for deploy-level configuration. User/org/workspace
190
+ credentials belong in the encrypted secrets/credential/OAuth stores, never as
191
+ hardcoded literals, shared env fallbacks, logs, or action responses.
189
192
  - **Use `fail()`** for user-friendly error messages (exits with message, no stack trace).
190
193
  - **Import from `@agent-native/core`** — Don't redefine `parseArgs()` or other utilities locally.
191
194
 
@@ -82,9 +82,16 @@ new Function(userInput); // NEVER
82
82
 
83
83
  ## Secrets Management
84
84
 
85
+ Never hardcode credential values or real private data. Source, docs, tests,
86
+ fixtures, prompts, screenshots, seed data, application state, action responses,
87
+ and generated app/extension content may name credential keys, but must never
88
+ contain API key values, tokens, webhook URLs, signing secrets, private
89
+ Builder/internal data, or customer data.
90
+
85
91
  | Secret type | Where to store | Why |
86
- |-------------|---------------|-----|
87
- | API keys (OpenAI, Stripe, etc.) | `.env` file (gitignored) | Never committed, server-side only |
92
+ |-------------|----------------|-----|
93
+ | User/org/workspace API keys, service tokens, webhook secrets | Secrets registry / `app_secrets` vault or `saveCredential` / `resolveCredential` | Encrypted, scoped, never sent to the client |
94
+ | Deploy-only infrastructure secrets | Deployment env vars (`.env` only for local dev) | Server-side runtime configuration |
88
95
  | OAuth tokens (Google, GitHub) | `oauth_tokens` store | Per-user, per-provider, server-side |
89
96
  | App configuration | `settings` store | OK for non-secret config (themes, preferences) |
90
97
  | Session tokens | Framework handles | Automatic via Better Auth |
@@ -94,6 +101,8 @@ new Function(userInput); // NEVER
94
101
  - Never return secrets in action responses — they may appear in agent chat or client UI
95
102
  - Never log secrets (tokens, keys, passwords)
96
103
  - Never commit `.env` files — they're gitignored by default
104
+ - Use env vars only for deploy-level secrets. User/org/workspace credentials
105
+ must use the encrypted secrets/credential/OAuth stores.
97
106
  - Access env vars via `process.env` in actions/server code, never send them to the client
98
107
 
99
108
  ## Auth Patterns
@@ -193,7 +202,7 @@ A2A_SECRET=your-shared-secret-at-least-32-chars
193
202
  ```
194
203
 
195
204
  **How it works:**
196
- 1. App A signs a JWT with `A2A_SECRET` containing `sub: "steve@builder.io"`
205
+ 1. App A signs a JWT with `A2A_SECRET` containing `sub: "user@example.com"`
197
206
  2. App B receives the call, verifies the JWT signature
198
207
  3. App B sets `AGENT_USER_EMAIL` from the verified `sub` claim
199
208
  4. Data scoping applies — App B only shows steve's data
@@ -206,7 +215,7 @@ Without `A2A_SECRET`, A2A calls are unauthenticated (fine for local dev, not pro
206
215
  2. **Always use `defineAction` with a Zod `schema:`** for input validation on user-facing actions.
207
216
  3. **Never concatenate user input into SQL** — use parameterized queries or Drizzle ORM.
208
217
  4. **Never use `dangerouslySetInnerHTML`** or `innerHTML` with user-controlled content.
209
- 5. **Never store secrets outside `.env` or `oauth_tokens`** — no settings, no source code, no responses.
218
+ 5. **Never hardcode or expose secrets** — no settings, application state, source code, fixtures, logs, or responses. Use the secrets registry / vault, scoped credentials, OAuth stores, or deploy-level env vars as appropriate.
210
219
  6. **Never bypass scoping** — don't raw-query tables without going through `db-query`/`db-exec`.
211
220
  7. **Never create unprotected routes that modify data** — use `defineAction` or check `getSession()`.
212
221
  8. **Don't hardcode emails** — use `AGENT_USER_EMAIL` environment variable.
@@ -16,7 +16,7 @@ There are three storage layers, each for a different kind of data:
16
16
 
17
17
  ### 1. Settings — app configuration
18
18
 
19
- Key-value store for persistent config that the user or agent can change. Theme, preferences, integration API keys, availability schedules.
19
+ Key-value store for persistent non-secret config that the user or agent can change. Theme, preferences, integration settings, availability schedules.
20
20
 
21
21
  ```ts
22
22
  import { getSetting, putSetting } from "@agent-native/core/settings";
@@ -88,6 +88,15 @@ const tokens = await getOAuthTokens("google", "user@gmail.com");
88
88
  const accounts = await listOAuthAccounts("google");
89
89
  ```
90
90
 
91
+ ### 5. Secrets / Credentials — encrypted values
92
+
93
+ For API keys, service tokens, webhook secrets, and user/org/workspace
94
+ credentials. Register user-facing secrets with the secrets registry and read
95
+ them server-side with `readAppSecret`, or use `saveCredential` /
96
+ `resolveCredential` for scoped credential lookup. Never store these values in
97
+ settings, application state, source code, docs, examples, logs, or action
98
+ responses.
99
+
91
100
  ## Which Layer to Use
92
101
 
93
102
  | Data | Layer | Why |
@@ -96,6 +105,7 @@ const accounts = await listOAuthAccounts("google");
96
105
  | What the user sees on screen | Application State | Ephemeral, real-time sync, agent ↔ UI bridge |
97
106
  | Compose drafts, wizard steps | Application State | Temporary, deleted when done |
98
107
  | Domain records (forms, bookings) | Drizzle table | Needs schema, queries, relationships |
108
+ | API keys, service tokens, webhook secrets | Secrets / credentials | Encrypted and scoped; never client-readable |
99
109
  | OAuth refresh tokens | OAuth Tokens | Secure, per-provider, per-account |
100
110
 
101
111
  ## Environment Variables
@@ -107,10 +117,12 @@ Infrastructure config stays in `.env` — these differ per deployment:
107
117
  - `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` — OAuth app credentials
108
118
  - `ACCESS_TOKEN` — production auth token
109
119
 
110
- Everything else (user settings, tokens, app state) goes in SQL.
120
+ Everything else (user settings, app state, domain data) goes in SQL through the
121
+ appropriate store. User/org/workspace credential values go in the encrypted
122
+ secrets/credential stores, not plain settings rows.
111
123
 
112
124
  ## Security Rules
113
125
 
114
- - **Never store API keys or secrets in Settings or Application State** — use `.env` for API keys (gitignored) and the `oauth_tokens` store for OAuth credentials. Settings and application state are readable by the client.
126
+ - **Never store API keys or secrets in Settings or Application State** — use the secrets registry / vault or `saveCredential` / `resolveCredential` for API keys and service tokens, deploy env vars only for deploy-level secrets, and `oauth_tokens` for OAuth credentials. Settings and application state are readable by the client.
115
127
  - **Every Drizzle table with user data must have `owner_email`** — the framework auto-scopes queries in production so users only see their own data. Run `pnpm action db-check-scoping` to verify. See the `security` skill for the full model.
116
128
  - **Never return secrets in action responses** — action responses may be visible in the agent chat or sent to the client. Keep credentials server-side only.
@@ -11,6 +11,7 @@ This is an **@agent-native/core** application -- the AI agent and UI share state
11
11
  3. **Actions for app operations** -- `pnpm action <name>` dispatches to callable action files in `actions/`; `defineAction` also auto-exposes those operations at `/_agent-native/actions/:name` for the UI. Do not create custom REST routes that re-export actions.
12
12
  4. **Live sync keeps the UI current** -- Database writes stream over `/_agent-native/events` first, with `/_agent-native/poll` as the fallback. **When you (the agent) write data, the UI must reflect the change without a manual refresh.** This is non-negotiable. Use `useActionQuery` / `useActionMutation` for action-backed data (preferred). If you use raw `useQuery`, fold `useChangeVersions([<source>, "action"])` into the key for targeted refreshes. See the `real-time-sync` and `adding-a-feature` skills.
13
13
  5. **Agent can update code** -- The agent can modify this app's source code directly.
14
+ 6. **No hardcoded secrets or private data** -- Never put API keys, tokens, webhook URLs, signing secrets, private Builder/internal data, customer data, or credential-looking literals in source, docs, tests, fixtures, prompts, screenshots, application state, action responses, or generated content. Use secrets/OAuth/runtime configuration and obvious placeholders in examples.
14
15
 
15
16
  ### Database Code
16
17
 
@@ -120,6 +120,8 @@ agentChat.submit("Generate something");
120
120
 
121
121
  Local development defaults to a SQLite file at `data/app.db`. That local file is for development; containers, previews, and serverless deploys can reset their filesystem. For production/cloud deployment, set `DATABASE_URL` to point to a persistent SQL database. Turso is optional, not required; common choices include Neon, Supabase, Turso/libSQL, plain Postgres, durable SQLite, D1 bindings, and Builder.io-managed environments when available.
122
122
 
123
+ Real credential values belong only in local `.env` files, deployment configuration, or registered secrets/settings UI. Never commit, document, log, return, paste, or include real keys, tokens, webhook URLs, signing secrets, or private data in examples; use empty values or obvious placeholders.
124
+
123
125
  When adding app data, define tables with `@agent-native/core/db/schema` helpers and use Drizzle's query builder for reads/writes. Do not import dialect-specific schema helpers from `drizzle-orm/sqlite-core` or `drizzle-orm/pg-core`, and do not write raw SQL in normal actions or handlers when Drizzle can express the query. Raw SQL belongs in additive migrations, health checks, or carefully scoped maintenance.
124
126
 
125
127
  | Variable | Required | Description |
@@ -4,6 +4,8 @@ description: >-
4
4
  How agents call other agents via the A2A (agent-to-agent) JSON-RPC protocol.
5
5
  Use when enabling inter-agent communication, exposing agent skills to other
6
6
  agents, or calling external agents from scripts.
7
+ metadata:
8
+ internal: true
7
9
  ---
8
10
 
9
11
  # A2A Protocol (Agent-to-Agent)
@@ -175,10 +177,15 @@ submitted → working → completed
175
177
 
176
178
  A2A uses bearer token auth. The server reads the token from the environment variable specified by `apiKeyEnv`:
177
179
 
178
- - Set `A2A_API_KEY=my-secret-token` in the server's environment
179
- - Callers pass it as `Authorization: Bearer my-secret-token`
180
+ - Set `A2A_API_KEY=<A2A_API_KEY_VALUE>` in the server's deployment environment
181
+ - Callers pass it as `Authorization: Bearer <A2A_API_KEY_VALUE>`
180
182
  - The agent card endpoint (`/.well-known/agent-card.json`) is public — no auth needed for discovery
181
183
 
184
+ Never hardcode the bearer token in source, docs, prompts, app state, action
185
+ descriptions, client bundles, or examples. A2A tokens are deploy-level secrets
186
+ unless a specific app designs a scoped credential flow; read them from secure
187
+ runtime configuration and never log or return them.
188
+
182
189
  ## Message Parts
183
190
 
184
191
  Messages contain typed parts:
@@ -247,5 +254,5 @@ import type {
247
254
  ## Related Skills
248
255
 
249
256
  - **delegate-to-agent** — For work the local agent handles. Use A2A when the work goes to a different agent.
250
- - **scripts** — A2A calls typically happen in scripts
257
+ - **actions** — A2A calls typically happen inside actions
251
258
  - **storing-data** — Results from A2A calls are stored in SQL like any other data
@@ -2,20 +2,45 @@
2
2
  name: actions
3
3
  description: >-
4
4
  How to create and run agent actions. Actions are the single source of truth
5
- for app operations — the agent calls them as tools, the frontend calls them
6
- as HTTP endpoints. Use when creating a new action, adding an API integration,
7
- or wiring up frontend data fetching.
5
+ for app operations — the agent calls them as tools and frontend code calls
6
+ them through client hooks. Use when creating a new action, adding an API
7
+ integration, or wiring up frontend data fetching.
8
+ metadata:
9
+ internal: true
8
10
  ---
9
11
 
10
12
  # Agent Actions
11
13
 
12
14
  ## Rule
13
15
 
14
- Actions in `actions/` are the **single source of truth** for app operations. The agent calls them as tools, and the framework auto-exposes them as HTTP endpoints at `/_agent-native/actions/:name`. The frontend calls those endpoints using React Query hooks. No duplicate `/api/` routes needed.
16
+ Actions in `actions/` are the **single source of truth** for app operations. The agent calls them as tools, and the frontend calls them through `useActionQuery` / `useActionMutation`. The framework owns the HTTP transport behind those hooks. No duplicate `/api/` routes needed.
17
+
18
+ Before creating any custom REST/API route for app data, inspect `actions/` and the action table in `AGENTS.md`. If an action already exists, call it directly from the agent or with `useActionQuery` / `useActionMutation` from the UI. If the capability is missing, create or update a `defineAction`. Do not add `/api/*`, `server/routes/*`, or other pass-through endpoints whose main job is to call, repackage, or re-export an action.
15
19
 
16
20
  ## Why
17
21
 
18
- Actions give the agent callable tools with structured input/output, AND they give the frontend type-safe HTTP endpoints automatically. One implementation serves both the agent and the UI. They keep the agent's chat context clean, they're reusable, and they can be tested independently.
22
+ Actions give the agent callable tools with structured input/output, AND they give the frontend a typed client contract through hooks. One implementation serves both the agent and the UI. They keep the agent's chat context clean, they're reusable, and they can be tested independently.
23
+
24
+ ## Keep the Action Surface Small and Orthogonal
25
+
26
+ Every agent-exposed action is a tool in the model's context window. There is a real cost to each one: more tools means more for the model to read, disambiguate, and choose between, which degrades tool-selection quality. Treat the action list like an API you have to maintain — add the fewest, most orthogonal actions that cover the capability, not one per UI affordance.
27
+
28
+ - **Prefer one CRUD-style `update` over N per-field actions.** A single `update-<thing>` that takes a patch of optional fields beats `update-<thing>-name`, `update-<thing>-order`, `update-<thing>-color`, … The agent (and the UI) pass only the fields that change. Same for `create`/`delete` — one orthogonal action per resource, not one per code path.
29
+ - **Reach for a generic query / escape hatch before minting a new read action.** If the agent needs more or different data, do not add `get-<thing>-by-x`, `list-<thing>-filtered-by-y`, etc. For provider data, expose the shared `provider-api-catalog` / `provider-api-docs` / `provider-api-request` trio (see `templates/dispatch/actions/`) so the agent can hit any endpoint or filter without a new action each time. For app data in dev, the `db-query` tool already answers arbitrary read questions.
30
+ - **Hide UI-only or purely programmatic actions from the model with `agentTool: false`.** An action that only the frontend or an HTTP/cron caller needs should not spend a slot in the model's tool list. `agentTool: false` keeps it callable from `useActionMutation` / `callAction` / `/_agent-native/actions/<name>` while removing it from every agent tool surface (in-app assistant, MCP, A2A).
31
+ - **`agentTool: false` is NOT `toolCallable: false`.** They are different switches:
32
+ - `agentTool: false` → hidden from the **model entirely** (it is no longer a tool the agent can see or call). Still frontend/HTTP-callable.
33
+ - `toolCallable: false` → only blocks the **sandboxed extension ("tools") iframe bridge** (`appAction(...)`). The action stays fully visible to the model, the UI, the CLI, MCP, and A2A. Use it for high-blast-radius operations (account/org/auth changes), not for trimming the tool list.
34
+ - **Remove or hide stale actions.** When the UI stops using an action, delete it or set `agentTool: false` — do not leave it exposed to the model as dead tool weight. The advisory audit below helps you spot these.
35
+
36
+ ### Audit Script (Advisory)
37
+
38
+ `pnpm actions:audit [template ...]` (or `node scripts/audit-template-actions.mjs`) statically scans a template's `actions/` and prints two kinds of suggestions:
39
+
40
+ 1. **Likely UI-dead** — HTTP-exposed mutating actions whose name is never referenced under `app/` (candidates to delete or mark `agentTool: false`).
41
+ 2. **Likely redundant clusters** — groups like `update-foo-name` / `update-foo-order` that could collapse into one orthogonal `update-foo`.
42
+
43
+ It is **advisory only**: it always exits 0, never fails CI, and uses conservative heuristics, so expect some false positives (e.g. an action the agent calls but the UI doesn't). Use it as a prompt to review, not a gate.
19
44
 
20
45
  ## How to Create an Action
21
46
 
@@ -45,14 +70,59 @@ export default defineAction({
45
70
 
46
71
  The `schema` field accepts a Zod schema (or any Standard Schema-compatible library). It provides runtime validation with clear error messages (400 for HTTP, error result for agent), full TypeScript type inference for `run()` args, and auto-generated JSON Schema for the agent's tool definition. `zod` is a dependency of all templates.
47
72
 
73
+ When an action reads or writes app data, use Drizzle's query builder and portable operators from `drizzle-orm`. Do not use raw SQL, `getDbExec()`, or dialect-specific schema imports in normal actions unless there is a documented reason Drizzle cannot express the query.
74
+
75
+ When an action calls an external service, never hardcode API keys, bearer
76
+ tokens, webhook URLs, signing secrets, OAuth refresh tokens, private
77
+ Builder/internal data, or customer data. Read user/org/workspace credentials
78
+ from `readAppSecret`, `resolveCredential`, OAuth token helpers, or the provider
79
+ API credential adapter. Use `process.env` only for explicitly deploy-level
80
+ configuration, and keep examples to obvious placeholders.
81
+
48
82
  Tips:
49
83
  - Use `.describe()` for parameter descriptions
50
84
  - Use `.optional()` for optional params
51
- - Use `z.coerce.number()` / `z.coerce.boolean()` for params that arrive as strings from HTTP
85
+ - Use `z.coerce.number()` for numeric params that arrive as strings from HTTP.
86
+ For booleans, use an explicit string parser/helper instead of
87
+ `z.coerce.boolean()` because JavaScript treats any non-empty string,
88
+ including `"false"`, as truthy.
52
89
  - Use `z.enum(["draft", "published"])` for constrained values
53
90
 
54
91
  The legacy `parameters` field (plain JSON Schema object) still works as a fallback but does not provide runtime validation or type inference.
55
92
 
93
+ ## Decision Order
94
+
95
+ When you need app data or a mutation:
96
+
97
+ 1. **Use an existing action** if one already performs the operation.
98
+ 2. **Create or extend a `defineAction`** when the agent and UI both need a new operation.
99
+ 3. **Create a custom route only for route-only concerns** such as uploads, streaming, webhooks, OAuth callbacks, or a non-JSON protocol.
100
+
101
+ Do not build an umbrella REST API to make actions "easier" to call. Actions are already callable by agents, CLIs, React hooks, HTTP, MCP/A2A exposure, and external hosts through the framework.
102
+
103
+ ## Flexible Provider APIs
104
+
105
+ For provider integrations used in ad hoc analysis, querying, reporting, or
106
+ cross-source research, do not hardcode every provider endpoint as a separate
107
+ rigid action. Expose the shared provider API action trio instead:
108
+
109
+ - `provider-api-catalog`: lists provider base URLs, auth style, credential keys,
110
+ docs/spec URLs, placeholders, and examples without exposing secrets.
111
+ - `provider-api-docs`: fetches registered provider docs/spec URLs when the
112
+ exact endpoint, filter operator, payload shape, or pagination contract is
113
+ uncertain.
114
+ - `provider-api-request`: makes a constrained authenticated HTTP request to the
115
+ provider host, injects configured credentials, blocks private/internal URLs,
116
+ and redacts secrets.
117
+
118
+ Use `@agent-native/core/provider-api` as the shared substrate. A template should
119
+ only add a thin credential adapter when it has app-specific credential lookup
120
+ rules. Keep `provider-api-request` `http: false` unless you have a separate UI
121
+ permission model for arbitrary provider writes. Specific actions such as
122
+ `hubspot-deals`, `search-emails`, or `sync-source` are convenience shortcuts,
123
+ not capability limits; agents should fall back to the provider API trio when a
124
+ question requires an endpoint or filter that the shortcut does not model.
125
+
56
126
  ### The `http` Option
57
127
 
58
128
  Controls how the action is exposed as an HTTP endpoint:
@@ -99,7 +169,7 @@ run: async (args) => {
99
169
 
100
170
  ## Frontend Hooks
101
171
 
102
- The frontend calls action endpoints using React Query hooks from `@agent-native/core/client`:
172
+ The frontend calls actions using React Query hooks from `@agent-native/core/client`. Components should not hand-write `fetch("/_agent-native/actions/...")`; add or reuse a client hook/helper instead. Use `callAction` from the same package for imperative cases that do not fit a hook, such as debounced search, prefetching, or non-React event handlers.
103
173
 
104
174
  ### `useActionQuery` — for GET actions
105
175
 
@@ -135,6 +205,17 @@ function AddMealButton() {
135
205
 
136
206
  Mutations automatically invalidate all `["action"]` query keys on success, so GET queries refetch.
137
207
 
208
+ ### `callAction` — for imperative client code
209
+
210
+ ```ts
211
+ import { callAction } from "@agent-native/core/client";
212
+
213
+ const people = await callAction("search-people", { query }, { method: "GET" });
214
+ ```
215
+
216
+ Prefer hooks in React data flows. Use `callAction` when a hook would be awkward;
217
+ do not hand-write action route fetches in components.
218
+
138
219
  ## How to Run (Agent)
139
220
 
140
221
  ```bash
@@ -161,7 +242,7 @@ Most operations should be actions. You only need custom routes in `server/routes
161
242
  - **Webhooks** — external services POST to a specific URL
162
243
  - **OAuth callbacks** — redirect-based flows that need specific URL patterns
163
244
 
164
- If it's a standard CRUD operation or data query, use an action instead.
245
+ If it's a standard CRUD operation, data query, or a wrapper around an action, use the action instead.
165
246
 
166
247
  ## Legacy Pattern (bare export)
167
248
 
@@ -185,9 +266,15 @@ This still works but is not auto-exposed as HTTP. Prefer `defineAction` for all
185
266
  - **Return structured data.** Return objects/arrays, not `JSON.stringify()`.
186
267
  - **Use `http: { method: "GET" }`** for read-only actions. Default is POST.
187
268
  - **Use `http: false`** for agent-only actions (`navigate`, `view-screen`).
188
- - **Use `loadEnv()`** if the action needs environment variables (API keys, etc.).
269
+ - **Use `agentTool: false`** for UI-only / programmatic actions that should NOT be a tool in the model's context window. It stays frontend/HTTP-callable but is hidden from the agent. Distinct from `toolCallable: false`, which only blocks the sandboxed extension iframe bridge.
270
+ - **Document reusable actions.** If a new action should be called by agents outside one narrow screen, update `AGENTS.md` with when to use it, important args, and which return fields to preserve.
271
+ - **Promote workflow-heavy actions to skills.** If the action is part of a provider-backed, cross-app, MCP/A2A, or multi-step workflow, create or update a skill in `.agents/skills/` and add app-skill visibility (`internal`, `exported`, or `both`) when it should ship through a marketplace.
272
+ - **Use `loadEnv()`** only for deploy-level configuration. User/org/workspace
273
+ credentials belong in the encrypted secrets/credential/OAuth stores, never as
274
+ hardcoded literals or shared env fallbacks.
189
275
  - **Use `fail()`** for user-friendly error messages (exits with message, no stack trace).
190
276
  - **Import from `@agent-native/core`** — Don't redefine `parseArgs()` or other utilities locally.
277
+ - **Do not re-export actions as REST.** The mounted `/_agent-native/actions/:name` endpoint is the REST surface; duplicating it under `/api/*` creates drift and hides the operation from agents.
191
278
 
192
279
  ## Common Patterns
193
280
 
@@ -260,5 +347,6 @@ export default defineAction({
260
347
 
261
348
  - **storing-data** — Actions read/write data in SQL
262
349
  - **delegate-to-agent** — The agent invokes actions via `pnpm action <name>`
263
- - **real-time-sync** — Database writes from actions trigger poll events to update the UI
350
+ - **real-time-sync** — Database writes from actions trigger change events to update the UI
264
351
  - **adding-a-feature** — Actions are area 2 of the four-area checklist
352
+ - **client-methods** — Client code uses named helpers/hooks instead of raw REST calls