@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
@@ -4,6 +4,8 @@ description: >-
4
4
  Secure coding practices for agent-native apps: input validation, SQL
5
5
  injection, XSS, secrets, data scoping, and auth. Use when writing any action,
6
6
  route, or component that touches user data or external input.
7
+ metadata:
8
+ internal: true
7
9
  ---
8
10
 
9
11
  # Security
@@ -12,6 +14,25 @@ description: >-
12
14
 
13
15
  Use the framework's security primitives everywhere. Never bypass them.
14
16
 
17
+ ## Absolute Secrets Rule
18
+
19
+ Never hardcode secret values or real private data. This applies to source code,
20
+ docs, tests, fixtures, generated prompts, screenshots, seed data, and extension
21
+ HTML just as much as production code.
22
+
23
+ Do not paste or invent real-looking API keys, bearer tokens, OAuth refresh
24
+ tokens, webhook URLs, signing secrets, private Builder/internal data, or customer
25
+ data into the repo. Examples must use obvious placeholders such as
26
+ `<OPENAI_API_KEY>`, `${keys.SLACK_WEBHOOK}`, `sk-test-example`, or
27
+ `example.customer@example.com`. Test literals should be clearly fake and must
28
+ not match real provider token formats when an `example` token will do.
29
+
30
+ Credential values enter the system only through approved runtime channels:
31
+ deployment env vars for deploy-level secrets, the encrypted `app_secrets` vault
32
+ or `saveCredential` / `resolveCredential` for user/org/workspace API keys, and
33
+ `oauth_tokens` for OAuth. Code and instructions may name the credential key
34
+ (`OPENAI_API_KEY`), but must never contain the credential value.
35
+
15
36
  ## Input Validation
16
37
 
17
38
  Use `defineAction` with a Zod `schema:` for every action. The framework validates input automatically and returns clear 400 errors for HTTP callers and structured error results for agent tool calls.
@@ -51,10 +72,27 @@ await client.execute(`SELECT * FROM users WHERE id = '${id}'`);
51
72
  - For rich text editing, use TipTap (framework dependency).
52
73
  - For rendering markdown, use `react-markdown`.
53
74
 
75
+ ## SSRF
76
+
77
+ Any server-side `fetch` of a user- or agent-controlled URL must go through the framework SSRF guard — a bare `fetch()` can be steered at cloud metadata (`169.254.169.254`), `localhost`, or internal services.
78
+
79
+ ```ts
80
+ import { ssrfSafeFetch } from "@agent-native/core/extensions/url-safety";
81
+ // Blocks private/internal targets, re-checks the resolved IP at connect time
82
+ // (DNS rebinding), and re-validates every redirect hop.
83
+ const res = await ssrfSafeFetch(userProvidedUrl, {}, { maxRedirects: 3 });
84
+ ```
85
+
86
+ For a pre-flight-only check (e.g. before a streaming or one-shot fetch), use `isBlockedExtensionUrlWithDns(url)` plus `createSsrfSafeDispatcher()` from the same module, and set `redirect: "manual"`. Never let the default `fetch` follow redirects for an untrusted URL — a public URL can 30x into the private network.
87
+
54
88
  ## Secrets
55
89
 
56
90
  - OAuth tokens go in the `oauth_tokens` store via `saveOAuthTokens()`.
57
- - Never store secrets in `settings`, `application_state`, source code, or action responses sent to the client.
91
+ - Per-user / per-org API keys go through `saveCredential` / `resolveCredential` (`@agent-native/core/credentials`) or the `app_secrets` vault. Both encrypt values at rest with AES-256-GCM (keyed by `SECRETS_ENCRYPTION_KEY`, falling back to `BETTER_AUTH_SECRET`; production refuses to start without one).
92
+ - Never hand-roll secrets into `settings`, `application_state`, source code, or action responses sent to the client. The credential / vault APIs above are the only sanctioned stores.
93
+ - Never commit real keys, tokens, webhook URLs, signing secrets, or private
94
+ Builder/customer data in examples or fixtures. Use placeholders that cannot be
95
+ mistaken for working credentials.
58
96
 
59
97
  ## User Credentials Are Per-User Data — Never `process.env`
60
98
 
@@ -65,6 +103,8 @@ import { resolveCredential } from "@agent-native/core/credentials";
65
103
  const apiKey = await resolveCredential("OPENAI_API_KEY", { userEmail, orgId });
66
104
  ```
67
105
 
106
+ Values are encrypted at rest (AES-256-GCM, shared `secrets/crypto.ts`): `saveCredential` encrypts on write and `resolveCredential` decrypts on read, with a transparent fallback for legacy plaintext rows. The agent's raw `db-query` / `db-exec` tools also cannot read credential rows — they are excluded from the scoped `settings` view. To encrypt pre-existing rows in place, run `pnpm action db-migrate-encrypt-credentials` (idempotent, non-destructive; needs the same `SECRETS_ENCRYPTION_KEY` / `BETTER_AUTH_SECRET` as the app).
107
+
68
108
  On 2026-04-29 the previous one-arg `resolveCredential(key)` form fell back to `process.env[key]` and an unscoped global `settings` row, so every signed-in user inherited the deployment's credentials. Two guards now block this in CI (`pnpm prep`):
69
109
 
70
110
  - `scripts/guard-no-env-credentials.mjs` — bans `process.env.<KEY>` reads in `packages/core/src/credentials/`, `secrets/`, `vault/`, and `templates/*/server/{lib,routes/api}/credential*` paths, except for an explicit allowlist of deploy-level vars (`DATABASE_URL`, `BETTER_AUTH_SECRET`, `NETLIFY_*`, etc.). Per-line opt-out: `// guard:allow-env-credential — <reason>`.
@@ -82,6 +122,9 @@ Two more CI guards (also wired into `pnpm prep`) target the 2026-04 cross-tenant
82
122
  ## Auth
83
123
 
84
124
  - All actions are protected by the auth guard automatically.
125
+ - Prefer actions for normal app data. Do not hand-write `/api/*` routes for
126
+ CRUD, data queries, or action re-exports just to add auth; action endpoints
127
+ already get auth and request context.
85
128
  - If you must create custom `/api/` routes, always call `getSession(event)` and reject requests without a session:
86
129
 
87
130
  ```ts
@@ -138,6 +181,8 @@ export default defineEventHandler(async (event) => {
138
181
 
139
182
  In production, the framework automatically restricts all agent SQL queries to the current user's data using temporary views. This is enforced at the SQL level — the agent cannot bypass it.
140
183
 
184
+ The `db-query` / `db-exec` tools (and the extension SQL bridge, which shares the same path) reject schema-qualified table references like `public.<table>` or `main.<table>` — a qualified name resolves to the base table and would skip the temp view. Use bare table names; scoping is applied automatically.
185
+
141
186
  ### Per-User Scoping (`owner_email`)
142
187
 
143
188
  Every template table with user data **must** have an `owner_email` text column:
@@ -180,6 +225,10 @@ Run `pnpm action db-check-scoping` to verify. Use `--require-org` for multi-org
180
225
  - [ ] New action uses `defineAction` with a Zod `schema:`
181
226
  - [ ] No SQL string concatenation with user input
182
227
  - [ ] No `dangerouslySetInnerHTML` with user content
228
+ - [ ] Server-side fetches of user/agent URLs use `ssrfSafeFetch`, not bare `fetch`
229
+ - [ ] Secrets stored via `saveCredential` / the vault (encrypted), never raw in `settings` or responses
230
+ - [ ] No hardcoded API keys, tokens, webhook URLs, signing secrets, real
231
+ credential-looking strings, private Builder/internal data, or customer data
183
232
  - [ ] New env vars in `.env` only, not committed
184
233
  - [ ] New user-data tables have `owner_email` column
185
234
  - [ ] Custom routes call `getSession` and reject unauthenticated requests
@@ -4,6 +4,8 @@ description: >-
4
4
  How the agent can modify the app's own source code. Use when the agent needs
5
5
  to edit components, routes, styles, or scripts, when designing UI for agent
6
6
  editability, or when deciding what the agent should and shouldn't modify.
7
+ metadata:
8
+ internal: true
7
9
  ---
8
10
 
9
11
  # Self-Modifying Code
@@ -74,6 +76,6 @@ el.dataset.selectedId = selectedItem?.id || "";
74
76
  ## Related Skills
75
77
 
76
78
  - **storing-data** — Tier 1 modifications (data files) are the safest and most common
77
- - **scripts** — The agent can create or modify scripts to add new capabilities
79
+ - **actions** — The agent can create or modify actions to add new capabilities
78
80
  - **delegate-to-agent** — Self-modification requests come through the agent chat
79
- - **real-time-sync** — Database writes trigger poll events to update the UI
81
+ - **real-time-sync** — Database writes trigger change events to update the UI
@@ -4,6 +4,8 @@ description: >-
4
4
  Framework server plugins and the `/_agent-native/` route namespace. Use when
5
5
  adding a custom server plugin, deciding whether to create an `/api/` route vs
6
6
  an action, or debugging auto-mounted framework routes.
7
+ metadata:
8
+ internal: true
7
9
  ---
8
10
 
9
11
  # Server Plugins & Framework Routes
@@ -29,9 +31,12 @@ All framework-level routes live under `/_agent-native/` to avoid collisions with
29
31
  ### Hard rule
30
32
 
31
33
  - **ALL framework routes go under `/_agent-native/`.**
32
- - Templates own `/api/*` for their domain routes.
34
+ - Templates own `/api/*` only for route-only domain concerns such as uploads,
35
+ streaming, webhooks, OAuth callbacks, or non-JSON protocols.
33
36
  - Never put framework routes under `/api/`.
34
37
  - Never put template routes under `/_agent-native/` — that namespace is reserved.
38
+ - Never create `/api/*` routes that only wrap, proxy, or re-export actions. Use
39
+ the existing `/_agent-native/actions/:name` endpoint or the React action hooks.
35
40
 
36
41
  ### Auto-mounted framework routes
37
42
 
@@ -64,6 +69,11 @@ For standard CRUD and data operations, use `defineAction` in `actions/` — the
64
69
  - Webhooks from external services
65
70
  - OAuth callbacks
66
71
 
72
+ Before adding a route, inspect the existing action files. Reuse the action if
73
+ it already encodes the business rule, or add a new action if the operation
74
+ should be available to both the agent and the UI. A route whose implementation
75
+ mostly calls an action is usually the wrong abstraction.
76
+
67
77
  The Nitro Vite plugin handles both `/api/` and `/_agent-native/` prefixes via file-based routing in `server/routes/`.
68
78
 
69
79
  ## Related Skills
@@ -5,6 +5,8 @@ description: >-
5
5
  components, forms, dialogs, menus, charts, sidebars, themes, registries, or
6
6
  any project with a components.json file.
7
7
  source: https://ui.shadcn.com/docs/skills
8
+ metadata:
9
+ internal: true
8
10
  ---
9
11
 
10
12
  # shadcn/ui
@@ -57,6 +59,19 @@ This skill keeps shadcn/ui work project-aware. Components are source files in th
57
59
  - Do not add manual `z-index` to overlay primitives unless you are fixing a verified stacking bug.
58
60
  - Add custom colors as CSS variables in the existing Tailwind CSS file reported by shadcn info. For Tailwind v4, register variables with `@theme inline`.
59
61
 
62
+ ## Transitions And Motion
63
+
64
+ shadcn's built-in component animations are the right level of polish — keep them. The goal is a snappy, clean UI, not a motionless one. Match shadcn's motion vocabulary; don't strip it and don't pile on decorative custom animation.
65
+
66
+ - **Never remove or override a shadcn component's default animation.** `data-[state=open]:animate-in`, `data-[state=closed]:animate-out`, `fade-in/out`, `zoom-in/out`, `slide-in-from-*`, accordion height, the `tailwindcss-animate` utilities — these ship for a reason. Leave them as-is.
67
+ - **Custom transitions are fine when they communicate a state change and match shadcn's feel.** Reuse the same vocabulary: short durations (~120–200ms), `ease-out`, opacity/transform only, gated on `data-[state=...]`. Examples that are good and welcome:
68
+ - A portaled custom popover/tooltip/sheet that fades + scales/slides in on `data-[state=delayed-open]` / `data-[state=closed]`, mirroring Radix's own content animation.
69
+ - A list row or toast that fades/slides in on mount and out on dismiss.
70
+ - A chevron/caret `rotate` on expand, a subtle `opacity`/`color` hover on an icon button, skeleton shimmer, a progress/height transition on a collapsible.
71
+ - Continuous, product-defining motion where it _is_ the experience (e.g. a multi-stage booking flow's stage transitions) — fine, and framer-motion is acceptable there.
72
+ - **Avoid decorative, attention-seeking, or slow motion:** hand-rolled `duration-700` hero fade-ins, parallax, bouncing/spring entrances on ordinary content, animated gradients, staggered cascades on long lists, anything that delays the user seeing or acting on content. If an animation makes the UI feel slower, cut it.
73
+ - Rule of thumb: if the motion clarifies what just changed and is over in well under a quarter-second, it's polish; if it's there to look impressive, it's bloat.
74
+
60
75
  ## Icons
61
76
 
62
77
  - Agent-native apps use `@tabler/icons-react`. Do not add `lucide-react` because a registry example used it.
@@ -5,6 +5,8 @@ description: >-
5
5
  (dashboards, documents, forms, decks, etc.). Use when making a resource
6
6
  table ownable, wiring list/read/update access checks, or dropping the
7
7
  standard share dialog into a template.
8
+ metadata:
9
+ internal: true
8
10
  ---
9
11
 
10
12
  # Sharing — Private by Default, Explicit Share
@@ -187,7 +189,9 @@ The framework auto-mounts these actions in every template — no per-template bo
187
189
  | `list-resource-shares` | `resourceType, resourceId` | Current visibility + all share grants. |
188
190
  | `set-resource-visibility` | `resourceType, resourceId, visibility` | Change to `private` / `org` / `public`. |
189
191
 
190
- Both the agent and the UI call these via the same endpoints.
192
+ Both the agent and the UI use these same actions. The agent calls them as tools;
193
+ UI code should use `ShareButton` / `ShareDialog` or the action client hooks
194
+ instead of hand-writing route calls.
191
195
 
192
196
  ## Migration pattern for existing tables
193
197
 
@@ -4,30 +4,52 @@ description: >-
4
4
  How to store application data in agent-native apps. All data lives in SQL.
5
5
  Use when adding data models, deciding where to store data, or reading/writing
6
6
  application data.
7
+ metadata:
8
+ internal: true
7
9
  ---
8
10
 
9
11
  # Storing Data — SQL is the Source of Truth
10
12
 
11
13
  ## Rule
12
14
 
13
- All application data lives in **SQL** (SQLite locally, cloud database in production). The agent and UI share the same database. There is no filesystem dependency for data.
15
+ All application data lives in **SQL** (SQLite locally, persistent database in production). The agent and UI share the same database. Do not store durable app data in the filesystem.
14
16
 
15
17
  ## How It Works
16
18
 
17
- Agent-native apps use SQLite via Drizzle ORM + `@libsql/client`. This works locally out of the box and upgrades seamlessly to cloud databases (Turso, Neon, Supabase, D1) by setting `DATABASE_URL`. **Local and production behave identically.**
19
+ Agent-native apps use Drizzle ORM over the configured SQL backend. Local development works out of the box with a SQLite file at `data/app.db`; production and shared preview deploys need a persistent `DATABASE_URL` because container/serverless filesystems can reset. The code should behave the same across backends, but the local SQLite file is not durable once deployed.
20
+
21
+ For app code, use Drizzle's schema/query DSL by default. Raw SQL is an escape hatch for additive migrations, health checks, or one-off maintenance, not the normal way to build features.
18
22
 
19
23
  ### Core SQL Stores (auto-created, available in all templates)
20
24
 
21
25
  | Store | Purpose | Access |
22
26
  | ------------------- | ---------------------------------------------------- | ------------------------------------------ |
23
27
  | `application_state` | Ephemeral UI state (compose windows, navigation) | `readAppState()` / `writeAppState()` |
24
- | `settings` | Persistent KV config (preferences, app settings) | `getSetting()` / `setSetting()` |
28
+ | `settings` | Persistent KV config (preferences, app settings) | `getSetting()` / `putSetting()` |
25
29
  | `oauth_tokens` | OAuth credentials | `@agent-native/core/oauth-tokens` |
26
30
  | `sessions` | Auth sessions | `@agent-native/core/server` |
27
31
 
28
32
  ### Domain Data (per-template)
29
33
 
30
- Define schema with Drizzle ORM in `server/db/schema.ts`. Get a database instance with `const db = getDb()` from `server/db/index.ts`. All queries are async.
34
+ Define schema with the framework Drizzle helpers in `server/db/schema.ts`. Get a database instance with `const db = getDb()` from `server/db/index.ts`. All queries are async.
35
+
36
+ ```ts
37
+ import { eq } from "drizzle-orm";
38
+ import { table, text, integer, now } from "@agent-native/core/db/schema";
39
+
40
+ export const tasks = table("tasks", {
41
+ id: text("id").primaryKey(),
42
+ title: text("title").notNull(),
43
+ completed: integer("completed", { mode: "boolean" })
44
+ .notNull()
45
+ .default(false),
46
+ createdAt: text("created_at").notNull().default(now()),
47
+ });
48
+
49
+ const rows = await db.select().from(tasks).where(eq(tasks.id, taskId));
50
+ ```
51
+
52
+ Never import `sqliteTable` / `pgTable` or column helpers from `drizzle-orm/sqlite-core` or `drizzle-orm/pg-core` in app templates. Use `@agent-native/core/db/schema` so the same schema can run against SQLite, Postgres, libSQL/Turso, D1, and other supported backends.
31
53
 
32
54
  | Template | Tables |
33
55
  | ------------ | --------------------------------------------- |
@@ -40,15 +62,15 @@ Define schema with Drizzle ORM in `server/db/schema.ts`. Get a database instance
40
62
 
41
63
  ### Agent Access
42
64
 
43
- The agent uses actions to read/write the database:
65
+ The agent uses app-specific actions to read/write the database. Core DB scripts are for inspection and maintenance, not for implementing normal product behavior:
44
66
 
45
67
  - `pnpm action db-schema` — Show all tables, columns, types
46
68
  - `pnpm action db-query --sql "SELECT * FROM forms"` — Run SELECT queries
47
- - `pnpm action db-exec --sql "INSERT INTO ..."` — Run INSERT / UPDATE / DELETE / REPLACE. Use for short columns, multi-column writes, computed updates. For several related writes, prefer `--statements '[{"sql":"...","args":[...]}]'` so they run sequentially in one transaction. Schema changes are blocked; use reviewed additive migrations/startup code instead.
69
+ - `pnpm action db-exec --sql "UPDATE ..."` — Last-resort ad-hoc maintenance for short columns, multi-column writes, or computed updates when no domain action exists. For several related writes, prefer `--statements '[{"sql":"...","args":[...]}]'` so they run sequentially in one transaction. Schema changes are blocked; use reviewed additive migrations/startup code instead.
48
70
  - `pnpm action db-patch --table <t> --column <c> --where "<clause>" --find "<old>" --replace "<new>"` — **Surgical search/replace on a large text column.** Sends the diff instead of re-transmitting the whole value, so it's dramatically more token-efficient than `db-exec UPDATE` when editing multi-kilobyte documents, slide HTML, dashboard/form JSON, etc. Targets exactly one row per call — narrow `--where` by primary key. Supports `--edits '[{find,replace},...]'` for batch edits and `--all` to replace every occurrence.
49
- - App-specific actions for domain operations (auto-exposed as HTTP endpoints) — **always prefer these over raw SQL when one exists.** They encode business rules, and for editor-backed tables (documents, slides) they also push live Yjs updates to open collaborative editors. `db-patch` is the generic fallback for tables without a dedicated edit action.
71
+ - App-specific actions for domain operations — **always prefer these over raw SQL when one exists.** They encode business rules, power the client action hooks, and for editor-backed tables (documents, slides) also push live Yjs updates to open collaborative editors. `db-patch` is the generic fallback for tables without a dedicated edit action.
50
72
 
51
- **How to choose between `db-exec UPDATE` and `db-patch`:**
73
+ **For one-off maintenance, how to choose between `db-exec UPDATE` and `db-patch`:**
52
74
 
53
75
  | Scenario | Use |
54
76
  | -------------------------------------------------------------- | ------------ |
@@ -65,27 +87,29 @@ All of these honor the per-user / per-org data scoping — you can't read or wri
65
87
 
66
88
  ### Frontend Access
67
89
 
68
- The frontend calls actions via their auto-mounted HTTP endpoints using React Query hooks:
90
+ The frontend calls actions using React Query hooks from the client API. The framework owns the HTTP transport behind these hooks, so components should not call action routes with raw `fetch`.
69
91
 
70
92
  ```ts
71
93
  import { useActionQuery, useActionMutation } from "@agent-native/core/client";
72
94
 
73
- // Read data (calls GET /_agent-native/actions/list-meals)
74
- const { data } = useActionQuery<Meal[]>("list-meals", { date: "2025-01-01" });
95
+ // Read data
96
+ const { data } = useActionQuery("list-meals", { date: "2025-01-01" });
75
97
 
76
- // Write data (calls POST /_agent-native/actions/log-meal)
77
- const { mutate } = useActionMutation<Meal>("log-meal");
98
+ // Write data
99
+ const { mutate } = useActionMutation("log-meal");
78
100
  ```
79
101
 
80
102
  Actions are the **preferred way** for the frontend to access data. You rarely need custom `/api/` routes — only for file uploads, streaming, webhooks, or OAuth callbacks.
81
103
 
82
- ### Cloud Deployment
104
+ ### Production / Cloud Deployment
105
+
106
+ Local SQLite works out of the box for development. To deploy to production or any environment where data must survive restarts:
83
107
 
84
- Local SQLite works out of the box. To deploy to production with a cloud database:
108
+ 1. Set `DATABASE_URL` to a persistent SQL database.
109
+ 2. Set `DATABASE_AUTH_TOKEN` only when the provider requires a separate token, such as Turso/libSQL.
110
+ 3. No code changes should be needed when the schema and queries stay portable.
85
111
 
86
- 1. Set `DATABASE_URL` (e.g. `libsql://your-db.turso.io`)
87
- 2. Set `DATABASE_AUTH_TOKEN` for auth
88
- 3. No code changes needed — `@libsql/client` handles both local and remote
112
+ Turso is one valid option, not the required option. Common choices include Neon or Supabase Postgres, Turso/libSQL, plain Postgres, durable SQLite, Cloudflare D1 bindings, and managed platform SQL environments when available.
89
113
 
90
114
  ### Real-time Sync
91
115
 
@@ -94,6 +118,8 @@ Polling streams database changes to the UI. When the agent writes to the databas
94
118
  ## Do
95
119
 
96
120
  - Use Drizzle ORM for structured domain data (forms, bookings, documents)
121
+ - Use Drizzle query builder methods (`select`, `insert`, `update`, `delete`) and portable operators from `drizzle-orm` (`eq`, `and`, `or`, `inArray`, `desc`, etc.) for app reads/writes
122
+ - Use framework schema helpers from `@agent-native/core/db/schema`, not dialect-specific Drizzle imports
97
123
  - Use the `settings` store for app configuration and user preferences
98
124
  - Use `application-state` for ephemeral UI state that the agent and UI share
99
125
  - Use `oauth-tokens` for OAuth credentials
@@ -107,6 +133,8 @@ Polling streams database changes to the UI. When the agent writes to the databas
107
133
  - Don't store app state in localStorage, sessionStorage, or cookies (except for UI-only preferences like sidebar width)
108
134
  - Don't keep state only in memory (server variables, global stores)
109
135
  - Don't use Redis or any external state store for app data
136
+ - Don't implement product features with raw SQL or `getDbExec()` when Drizzle can express the query
137
+ - Don't write SQLite-only or Postgres-only SQL in app code
110
138
  - Don't interpolate user input directly into SQL queries — use Drizzle ORM's query builder
111
139
 
112
140
  ## Security
@@ -128,5 +156,6 @@ When adding a new data model or feature, also consider what navigation and selec
128
156
 
129
157
  - **context-awareness** — How to expose navigation and selection state via application-state
130
158
  - **real-time-sync** — Set up polling so the UI updates when the database changes
131
- - **actions** — Create actions with `defineAction` to query the database (auto-exposed as HTTP endpoints)
159
+ - **actions** — Create actions with `defineAction` to query the database
160
+ - **client-methods** — Keep route details behind named client helpers/hooks
132
161
  - **self-modifying-code** — The agent can also modify the app's source code
@@ -4,6 +4,8 @@ description: >-
4
4
  Server-side analytics tracking with pluggable providers. Use when adding
5
5
  analytics events, registering custom tracking providers, or configuring
6
6
  built-in providers (PostHog, Mixpanel, Amplitude, Webhook).
7
+ metadata:
8
+ internal: true
7
9
  ---
8
10
 
9
11
  # Tracking
@@ -28,7 +30,7 @@ Fire an analytics event.
28
30
  ```ts
29
31
  import { track } from "@agent-native/core/tracking";
30
32
 
31
- track("meal.logged", { mealName: "Salad", calories: 350 }, { userId: "owner@example.com" });
33
+ track("meal.logged", { mealName: "Salad", calories: 350 }, { userId: "user@example.com" });
32
34
  ```
33
35
 
34
36
  ### `identify(userId, traits?)`
@@ -38,7 +40,7 @@ Identify a user with traits. Forwarded to providers that support it.
38
40
  ```ts
39
41
  import { identify } from "@agent-native/core/tracking";
40
42
 
41
- identify("owner@example.com", { plan: "pro", company: "Example Co" });
43
+ identify("user@example.com", { plan: "pro", company: "ExampleCo" });
42
44
  ```
43
45
 
44
46
  ### `registerTrackingProvider(provider)`
@@ -90,6 +92,7 @@ Template roots call `configureTracking()` once during app startup. That installs
90
92
  - Fires on initial load, `history.pushState`, `history.replaceState`, and `popstate`
91
93
  - De-dupes repeated events for the same URL
92
94
  - Includes `url`, `path`, `hostname`, `referrer`, `title`, `navigation_type`, `app`, and inferred `template`
95
+ - Includes LLM connection context on browser events when known: `llm_connection` (`builder`, `anthropic`, `openai`, etc.), `llm_engine`, `llm_model`, `llm_connection_source`, and `llm_connection_configured`
93
96
  - Does not send first-party events from localhost/local dev
94
97
 
95
98
  ### Visitor identity (`anonymousId` + `sessionId`)
@@ -106,7 +109,8 @@ Other framework-level baseline events:
106
109
 
107
110
  - `session status` from `useSession()`, with `signed_in`
108
111
  - `signup` from Better Auth user creation, with `auth_provider` and `auth_user_id`
109
- - `builder connect started`, `builder connect succeeded`, `builder connect failed`, `builder disconnect succeeded`, and `builder disconnect failed` from the Builder connection routes
112
+ - `builder connect clicked` and `builder connect popup blocked` from browser Connect Builder CTAs
113
+ - `builder connect started`, `builder connect succeeded`, `builder connect failed`, `builder disconnect succeeded`, and `builder disconnect failed` from the Builder connection routes, with LLM connection context when resolvable
110
114
 
111
115
  For new lifecycle events, call `track()` server-side when the server is the source of truth, and `trackEvent()` client-side only for browser interactions.
112
116
 
@@ -6,6 +6,8 @@ description: >-
6
6
  Voice Transcription settings section. Covers transcription-source routing,
7
7
  cleanup routing, Google realtime gating, and the voice transcription
8
8
  application-state keys.
9
+ metadata:
10
+ internal: true
9
11
  ---
10
12
 
11
13
  # Voice Transcription
@@ -36,8 +38,8 @@ that renders `TiptapComposer`.
36
38
  Settings must keep these as separate choices:
37
39
 
38
40
  - **Live transcription source**: `mac-native`, `google-realtime`, or `batch`.
39
- - **AI cleanup**: independent off/on toggle. Cleanup uses Builder Gemini first
40
- when hosted Gemini is configured, then BYOK Gemini (`GEMINI_API_KEY`).
41
+ - **AI cleanup**: independent off/on toggle. Cleanup uses managed Gemini first
42
+ when a managed AI services connection is configured, then BYOK Gemini (`GEMINI_API_KEY`).
41
43
  Gemini cleanup/title/summary generation is not a live STT source.
42
44
 
43
45
  `application_state["voice-transcription-prefs"]` stores
@@ -49,8 +51,8 @@ is still written for old clients and batch provider preferences:
49
51
  | `mac-native` | Native macOS/Tauri speech path; web clients normalize to browser-native where needed | No |
50
52
  | `google-realtime` | Dedicated WebSocket → Google Speech-to-Text gRPC `StreamingRecognize` path | `GOOGLE_APPLICATION_CREDENTIALS` |
51
53
  | `batch` | Upload audio after stop through the existing batch route | Builder/Gemini/Groq/OpenAI depending on fallback |
52
- | `auto` provider | Existing batch fallback chain | Any configured batch provider |
53
- | `builder-gemini` | Builder Gemini Flash-Lite batch/cleanup preference | hosted Gemini provider connected |
54
+ | `auto` provider | Browser SpeechRecognition when supported; server batch fallback chain otherwise | No key needed in browsers that support SpeechRecognition |
55
+ | `builder-gemini` | Managed Gemini Flash-Lite batch/cleanup preference | Managed AI services account connected |
54
56
  | `gemini` | Direct Google Gemini BYOK batch/cleanup preference | `GEMINI_API_KEY` |
55
57
  | `groq` | Groq Whisper batch preference | `GROQ_API_KEY` |
56
58
  | `openai` | OpenAI Whisper batch preference | `OPENAI_API_KEY` |
@@ -58,13 +60,18 @@ is still written for old clients and batch provider preferences:
58
60
 
59
61
  Default behavior:
60
62
 
61
- - The shared web settings/composer default to Batch / `auto`.
63
+ - The shared web settings/composer default to Batch / `auto`. In `auto` mode,
64
+ `useVoiceDictation` uses `startBrowser()` (Web Speech API, no key required,
65
+ incremental streaming) when the browser supports `SpeechRecognition`. It only
66
+ falls back to the MediaRecorder → server upload path when `SpeechRecognition`
67
+ is not available (e.g. Firefox). This means dictation works out of the box in
68
+ Chrome, Edge, and Safari without any API key configuration.
62
69
  - Dedicated macOS Tauri-native surfaces may save `mac-native`, but do not
63
70
  assume the shared React settings default to it.
64
71
  - Old stored `builder` values are treated as `builder-gemini`.
65
72
  - Old stored `browser` values are treated as `mac-native`.
66
73
  - Saved `google-realtime` preferences must never hit `/_agent-native/transcribe-voice`. They go through the dedicated session bridge `POST /_agent-native/transcribe-stream/session`, which mints an opaque ai-services websocket session and keeps the Google service-account JSON off the client.
67
- - In the current bridge, the Google option is only actually ready when both the user's `GOOGLE_APPLICATION_CREDENTIALS` secret exists and Builder is connected, because the framework mints the managed ai-services session with Builder auth before streaming begins.
74
+ - In the current bridge, the Google option is only actually ready when both the user's `GOOGLE_APPLICATION_CREDENTIALS` secret exists and a managed AI services connection is configured, because the framework mints the managed ai-services session before streaming begins.
68
75
 
69
76
  ## Where the pieces live
70
77