@agent-native/core 0.6.1 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (473) hide show
  1. package/README.md +43 -3
  2. package/dist/agent/production-agent.d.ts.map +1 -1
  3. package/dist/agent/production-agent.js +154 -4
  4. package/dist/agent/production-agent.js.map +1 -1
  5. package/dist/agent/types.d.ts +1 -1
  6. package/dist/agent/types.d.ts.map +1 -1
  7. package/dist/cli/create-workspace.d.ts +8 -0
  8. package/dist/cli/create-workspace.d.ts.map +1 -0
  9. package/dist/cli/create-workspace.js +18 -0
  10. package/dist/cli/create-workspace.js.map +1 -0
  11. package/dist/cli/create.d.ts +35 -7
  12. package/dist/cli/create.d.ts.map +1 -1
  13. package/dist/cli/create.js +444 -251
  14. package/dist/cli/create.js.map +1 -1
  15. package/dist/cli/index.js +59 -5
  16. package/dist/cli/index.js.map +1 -1
  17. package/dist/cli/workspacify.d.ts +18 -0
  18. package/dist/cli/workspacify.d.ts.map +1 -0
  19. package/dist/cli/workspacify.js +74 -0
  20. package/dist/cli/workspacify.js.map +1 -0
  21. package/dist/client/AgentPanel.d.ts +1 -1
  22. package/dist/client/AgentPanel.d.ts.map +1 -1
  23. package/dist/client/AgentPanel.js +63 -225
  24. package/dist/client/AgentPanel.js.map +1 -1
  25. package/dist/client/components/CodeRequiredDialog.d.ts.map +1 -1
  26. package/dist/client/components/CodeRequiredDialog.js +86 -5
  27. package/dist/client/components/CodeRequiredDialog.js.map +1 -1
  28. package/dist/client/composer/MentionPopover.d.ts.map +1 -1
  29. package/dist/client/composer/MentionPopover.js +15 -2
  30. package/dist/client/composer/MentionPopover.js.map +1 -1
  31. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  32. package/dist/client/composer/TiptapComposer.js +3 -1
  33. package/dist/client/composer/TiptapComposer.js.map +1 -1
  34. package/dist/client/composer/types.d.ts +1 -1
  35. package/dist/client/composer/types.d.ts.map +1 -1
  36. package/dist/client/integrations/IntegrationsPanel.d.ts.map +1 -1
  37. package/dist/client/integrations/IntegrationsPanel.js +22 -9
  38. package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
  39. package/dist/client/onboarding/OnboardingBanner.d.ts +13 -0
  40. package/dist/client/onboarding/OnboardingBanner.d.ts.map +1 -0
  41. package/dist/client/onboarding/OnboardingBanner.js +36 -0
  42. package/dist/client/onboarding/OnboardingBanner.js.map +1 -0
  43. package/dist/client/onboarding/OnboardingPanel.d.ts +16 -0
  44. package/dist/client/onboarding/OnboardingPanel.d.ts.map +1 -0
  45. package/dist/client/onboarding/OnboardingPanel.js +360 -0
  46. package/dist/client/onboarding/OnboardingPanel.js.map +1 -0
  47. package/dist/client/onboarding/SetupButton.d.ts +10 -0
  48. package/dist/client/onboarding/SetupButton.d.ts.map +1 -0
  49. package/dist/client/onboarding/SetupButton.js +26 -0
  50. package/dist/client/onboarding/SetupButton.js.map +1 -0
  51. package/dist/client/onboarding/index.d.ts +12 -0
  52. package/dist/client/onboarding/index.d.ts.map +1 -0
  53. package/dist/client/onboarding/index.js +11 -0
  54. package/dist/client/onboarding/index.js.map +1 -0
  55. package/dist/client/onboarding/use-onboarding.d.ts +34 -0
  56. package/dist/client/onboarding/use-onboarding.d.ts.map +1 -0
  57. package/dist/client/onboarding/use-onboarding.js +101 -0
  58. package/dist/client/onboarding/use-onboarding.js.map +1 -0
  59. package/dist/client/org/TeamPage.d.ts +6 -1
  60. package/dist/client/org/TeamPage.d.ts.map +1 -1
  61. package/dist/client/org/TeamPage.js +85 -14
  62. package/dist/client/org/TeamPage.js.map +1 -1
  63. package/dist/client/resources/ResourceEditor.d.ts.map +1 -1
  64. package/dist/client/resources/ResourceEditor.js +48 -77
  65. package/dist/client/resources/ResourceEditor.js.map +1 -1
  66. package/dist/client/resources/ResourceTree.d.ts.map +1 -1
  67. package/dist/client/resources/ResourceTree.js +16 -3
  68. package/dist/client/resources/ResourceTree.js.map +1 -1
  69. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  70. package/dist/client/resources/ResourcesPanel.js +135 -9
  71. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  72. package/dist/client/resources/use-resources.d.ts +5 -0
  73. package/dist/client/resources/use-resources.d.ts.map +1 -1
  74. package/dist/client/resources/use-resources.js.map +1 -1
  75. package/dist/client/settings/AgentsSection.d.ts +2 -0
  76. package/dist/client/settings/AgentsSection.d.ts.map +1 -0
  77. package/dist/client/settings/AgentsSection.js +198 -0
  78. package/dist/client/settings/AgentsSection.js.map +1 -0
  79. package/dist/client/settings/BackgroundAgentSection.d.ts +2 -0
  80. package/dist/client/settings/BackgroundAgentSection.d.ts.map +1 -0
  81. package/dist/client/settings/BackgroundAgentSection.js +46 -0
  82. package/dist/client/settings/BackgroundAgentSection.js.map +1 -0
  83. package/dist/client/settings/BrowserSection.d.ts +2 -0
  84. package/dist/client/settings/BrowserSection.d.ts.map +1 -0
  85. package/dist/client/settings/BrowserSection.js +10 -0
  86. package/dist/client/settings/BrowserSection.js.map +1 -0
  87. package/dist/client/settings/ComingSoonSection.d.ts +13 -0
  88. package/dist/client/settings/ComingSoonSection.d.ts.map +1 -0
  89. package/dist/client/settings/ComingSoonSection.js +9 -0
  90. package/dist/client/settings/ComingSoonSection.js.map +1 -0
  91. package/dist/client/settings/LLMSection.d.ts +2 -0
  92. package/dist/client/settings/LLMSection.d.ts.map +1 -0
  93. package/dist/client/settings/LLMSection.js +64 -0
  94. package/dist/client/settings/LLMSection.js.map +1 -0
  95. package/dist/client/settings/SettingsPanel.d.ts +8 -0
  96. package/dist/client/settings/SettingsPanel.d.ts.map +1 -0
  97. package/dist/client/settings/SettingsPanel.js +118 -0
  98. package/dist/client/settings/SettingsPanel.js.map +1 -0
  99. package/dist/client/settings/SettingsSection.d.ts +19 -0
  100. package/dist/client/settings/SettingsSection.d.ts.map +1 -0
  101. package/dist/client/settings/SettingsSection.js +10 -0
  102. package/dist/client/settings/SettingsSection.js.map +1 -0
  103. package/dist/client/settings/index.d.ts +3 -0
  104. package/dist/client/settings/index.d.ts.map +1 -0
  105. package/dist/client/settings/index.js +3 -0
  106. package/dist/client/settings/index.js.map +1 -0
  107. package/dist/client/settings/useBuilderStatus.d.ts +22 -0
  108. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -0
  109. package/dist/client/settings/useBuilderStatus.js +41 -0
  110. package/dist/client/settings/useBuilderStatus.js.map +1 -0
  111. package/dist/deploy/build.js +198 -54
  112. package/dist/deploy/build.js.map +1 -1
  113. package/dist/deploy/route-discovery.d.ts +5 -0
  114. package/dist/deploy/route-discovery.d.ts.map +1 -1
  115. package/dist/deploy/route-discovery.js +38 -7
  116. package/dist/deploy/route-discovery.js.map +1 -1
  117. package/dist/deploy/workspace-core.d.ts +28 -0
  118. package/dist/deploy/workspace-core.d.ts.map +1 -0
  119. package/dist/deploy/workspace-core.js +223 -0
  120. package/dist/deploy/workspace-core.js.map +1 -0
  121. package/dist/deploy/workspace-deploy.d.ts +11 -0
  122. package/dist/deploy/workspace-deploy.d.ts.map +1 -0
  123. package/dist/deploy/workspace-deploy.js +148 -0
  124. package/dist/deploy/workspace-deploy.js.map +1 -0
  125. package/dist/file-upload/builder.d.ts +11 -0
  126. package/dist/file-upload/builder.d.ts.map +1 -0
  127. package/dist/file-upload/builder.js +53 -0
  128. package/dist/file-upload/builder.js.map +1 -0
  129. package/dist/file-upload/index.d.ts +4 -0
  130. package/dist/file-upload/index.d.ts.map +1 -0
  131. package/dist/file-upload/index.js +3 -0
  132. package/dist/file-upload/index.js.map +1 -0
  133. package/dist/file-upload/registry.d.ts +23 -0
  134. package/dist/file-upload/registry.d.ts.map +1 -0
  135. package/dist/file-upload/registry.js +52 -0
  136. package/dist/file-upload/registry.js.map +1 -0
  137. package/dist/file-upload/types.d.ts +37 -0
  138. package/dist/file-upload/types.d.ts.map +1 -0
  139. package/dist/file-upload/types.js +10 -0
  140. package/dist/file-upload/types.js.map +1 -0
  141. package/dist/integrations/adapters/google-docs.d.ts +89 -0
  142. package/dist/integrations/adapters/google-docs.d.ts.map +1 -0
  143. package/dist/integrations/adapters/google-docs.js +261 -0
  144. package/dist/integrations/adapters/google-docs.js.map +1 -0
  145. package/dist/integrations/adapters/slack.d.ts.map +1 -1
  146. package/dist/integrations/adapters/slack.js +34 -0
  147. package/dist/integrations/adapters/slack.js.map +1 -1
  148. package/dist/integrations/adapters/telegram.d.ts.map +1 -1
  149. package/dist/integrations/adapters/telegram.js +32 -0
  150. package/dist/integrations/adapters/telegram.js.map +1 -1
  151. package/dist/integrations/google-docs-poller.d.ts +54 -0
  152. package/dist/integrations/google-docs-poller.d.ts.map +1 -0
  153. package/dist/integrations/google-docs-poller.js +442 -0
  154. package/dist/integrations/google-docs-poller.js.map +1 -0
  155. package/dist/integrations/index.d.ts +2 -0
  156. package/dist/integrations/index.d.ts.map +1 -1
  157. package/dist/integrations/index.js +3 -0
  158. package/dist/integrations/index.js.map +1 -1
  159. package/dist/integrations/plugin.d.ts.map +1 -1
  160. package/dist/integrations/plugin.js +49 -2
  161. package/dist/integrations/plugin.js.map +1 -1
  162. package/dist/integrations/types.d.ts +33 -0
  163. package/dist/integrations/types.d.ts.map +1 -1
  164. package/dist/integrations/webhook-handler.d.ts +10 -1
  165. package/dist/integrations/webhook-handler.d.ts.map +1 -1
  166. package/dist/integrations/webhook-handler.js +13 -3
  167. package/dist/integrations/webhook-handler.js.map +1 -1
  168. package/dist/jobs/scheduler.d.ts +3 -0
  169. package/dist/jobs/scheduler.d.ts.map +1 -1
  170. package/dist/jobs/scheduler.js +81 -60
  171. package/dist/jobs/scheduler.js.map +1 -1
  172. package/dist/jobs/tools.d.ts.map +1 -1
  173. package/dist/jobs/tools.js +20 -3
  174. package/dist/jobs/tools.js.map +1 -1
  175. package/dist/mcp-client/config.d.ts +46 -0
  176. package/dist/mcp-client/config.d.ts.map +1 -0
  177. package/dist/mcp-client/config.js +152 -0
  178. package/dist/mcp-client/config.js.map +1 -0
  179. package/dist/mcp-client/index.d.ts +17 -0
  180. package/dist/mcp-client/index.d.ts.map +1 -0
  181. package/dist/mcp-client/index.js +53 -0
  182. package/dist/mcp-client/index.js.map +1 -0
  183. package/dist/mcp-client/manager.d.ts +76 -0
  184. package/dist/mcp-client/manager.d.ts.map +1 -0
  185. package/dist/mcp-client/manager.js +212 -0
  186. package/dist/mcp-client/manager.js.map +1 -0
  187. package/dist/oauth-tokens/store.d.ts.map +1 -1
  188. package/dist/oauth-tokens/store.js +3 -1
  189. package/dist/oauth-tokens/store.js.map +1 -1
  190. package/dist/onboarding/default-steps.d.ts +10 -0
  191. package/dist/onboarding/default-steps.d.ts.map +1 -0
  192. package/dist/onboarding/default-steps.js +164 -0
  193. package/dist/onboarding/default-steps.js.map +1 -0
  194. package/dist/onboarding/index.d.ts +12 -0
  195. package/dist/onboarding/index.d.ts.map +1 -0
  196. package/dist/onboarding/index.js +11 -0
  197. package/dist/onboarding/index.js.map +1 -0
  198. package/dist/onboarding/plugin.d.ts +19 -0
  199. package/dist/onboarding/plugin.d.ts.map +1 -0
  200. package/dist/onboarding/plugin.js +147 -0
  201. package/dist/onboarding/plugin.js.map +1 -0
  202. package/dist/onboarding/registry.d.ts +24 -0
  203. package/dist/onboarding/registry.d.ts.map +1 -0
  204. package/dist/onboarding/registry.js +40 -0
  205. package/dist/onboarding/registry.js.map +1 -0
  206. package/dist/onboarding/types.d.ts +71 -0
  207. package/dist/onboarding/types.d.ts.map +1 -0
  208. package/dist/onboarding/types.js +10 -0
  209. package/dist/onboarding/types.js.map +1 -0
  210. package/dist/resources/agents.d.ts +4 -0
  211. package/dist/resources/agents.d.ts.map +1 -0
  212. package/dist/resources/agents.js +44 -0
  213. package/dist/resources/agents.js.map +1 -0
  214. package/dist/resources/handlers.d.ts +17 -0
  215. package/dist/resources/handlers.d.ts.map +1 -1
  216. package/dist/resources/handlers.js +49 -12
  217. package/dist/resources/handlers.js.map +1 -1
  218. package/dist/resources/metadata.d.ts +48 -0
  219. package/dist/resources/metadata.d.ts.map +1 -0
  220. package/dist/resources/metadata.js +150 -0
  221. package/dist/resources/metadata.js.map +1 -0
  222. package/dist/resources/script-helpers.d.ts.map +1 -1
  223. package/dist/resources/script-helpers.js +3 -2
  224. package/dist/resources/script-helpers.js.map +1 -1
  225. package/dist/resources/store.d.ts.map +1 -1
  226. package/dist/resources/store.js +32 -17
  227. package/dist/resources/store.js.map +1 -1
  228. package/dist/scripts/call-agent.d.ts.map +1 -1
  229. package/dist/scripts/call-agent.js +3 -2
  230. package/dist/scripts/call-agent.js.map +1 -1
  231. package/dist/scripts/chat/search-chats.d.ts.map +1 -1
  232. package/dist/scripts/chat/search-chats.js +2 -1
  233. package/dist/scripts/chat/search-chats.js.map +1 -1
  234. package/dist/scripts/core-scripts.d.ts.map +1 -1
  235. package/dist/scripts/core-scripts.js +2 -0
  236. package/dist/scripts/core-scripts.js.map +1 -1
  237. package/dist/scripts/db/scoping.d.ts.map +1 -1
  238. package/dist/scripts/db/scoping.js +3 -2
  239. package/dist/scripts/db/scoping.js.map +1 -1
  240. package/dist/scripts/docs/index.d.ts +2 -0
  241. package/dist/scripts/docs/index.d.ts.map +1 -0
  242. package/dist/scripts/docs/index.js +4 -0
  243. package/dist/scripts/docs/index.js.map +1 -0
  244. package/dist/scripts/docs/search.d.ts +13 -0
  245. package/dist/scripts/docs/search.d.ts.map +1 -0
  246. package/dist/scripts/docs/search.js +130 -0
  247. package/dist/scripts/docs/search.js.map +1 -0
  248. package/dist/scripts/resources/delete-memory.d.ts +7 -0
  249. package/dist/scripts/resources/delete-memory.d.ts.map +1 -0
  250. package/dist/scripts/resources/delete-memory.js +49 -0
  251. package/dist/scripts/resources/delete-memory.js.map +1 -0
  252. package/dist/scripts/resources/delete.d.ts.map +1 -1
  253. package/dist/scripts/resources/delete.js +2 -1
  254. package/dist/scripts/resources/delete.js.map +1 -1
  255. package/dist/scripts/resources/index.d.ts.map +1 -1
  256. package/dist/scripts/resources/index.js +2 -0
  257. package/dist/scripts/resources/index.js.map +1 -1
  258. package/dist/scripts/resources/list.d.ts.map +1 -1
  259. package/dist/scripts/resources/list.js +2 -1
  260. package/dist/scripts/resources/list.js.map +1 -1
  261. package/dist/scripts/resources/migrate-learnings.d.ts.map +1 -1
  262. package/dist/scripts/resources/migrate-learnings.js +2 -1
  263. package/dist/scripts/resources/migrate-learnings.js.map +1 -1
  264. package/dist/scripts/resources/read.d.ts.map +1 -1
  265. package/dist/scripts/resources/read.js +2 -1
  266. package/dist/scripts/resources/read.js.map +1 -1
  267. package/dist/scripts/resources/save-memory.d.ts +9 -0
  268. package/dist/scripts/resources/save-memory.d.ts.map +1 -0
  269. package/dist/scripts/resources/save-memory.js +78 -0
  270. package/dist/scripts/resources/save-memory.js.map +1 -0
  271. package/dist/scripts/resources/write.d.ts.map +1 -1
  272. package/dist/scripts/resources/write.js +2 -1
  273. package/dist/scripts/resources/write.js.map +1 -1
  274. package/dist/scripts/utils.d.ts +10 -1
  275. package/dist/scripts/utils.d.ts.map +1 -1
  276. package/dist/scripts/utils.js +45 -2
  277. package/dist/scripts/utils.js.map +1 -1
  278. package/dist/server/action-discovery.d.ts +5 -0
  279. package/dist/server/action-discovery.d.ts.map +1 -1
  280. package/dist/server/action-discovery.js +51 -20
  281. package/dist/server/action-discovery.js.map +1 -1
  282. package/dist/server/action-routes.d.ts.map +1 -1
  283. package/dist/server/action-routes.js +63 -57
  284. package/dist/server/action-routes.js.map +1 -1
  285. package/dist/server/agent-chat-plugin.d.ts +3 -0
  286. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  287. package/dist/server/agent-chat-plugin.js +363 -48
  288. package/dist/server/agent-chat-plugin.js.map +1 -1
  289. package/dist/server/agent-discovery.d.ts.map +1 -1
  290. package/dist/server/agent-discovery.js +11 -23
  291. package/dist/server/agent-discovery.js.map +1 -1
  292. package/dist/server/agent-teams.d.ts.map +1 -1
  293. package/dist/server/agent-teams.js +2 -1
  294. package/dist/server/agent-teams.js.map +1 -1
  295. package/dist/server/agents-bundle.d.ts +33 -5
  296. package/dist/server/agents-bundle.d.ts.map +1 -1
  297. package/dist/server/agents-bundle.js +108 -64
  298. package/dist/server/agents-bundle.js.map +1 -1
  299. package/dist/server/auth.d.ts +1 -0
  300. package/dist/server/auth.d.ts.map +1 -1
  301. package/dist/server/auth.js +172 -60
  302. package/dist/server/auth.js.map +1 -1
  303. package/dist/server/better-auth-instance.d.ts.map +1 -1
  304. package/dist/server/better-auth-instance.js +202 -6
  305. package/dist/server/better-auth-instance.js.map +1 -1
  306. package/dist/server/builder-browser.d.ts +40 -0
  307. package/dist/server/builder-browser.d.ts.map +1 -0
  308. package/dist/server/builder-browser.js +166 -0
  309. package/dist/server/builder-browser.js.map +1 -0
  310. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  311. package/dist/server/core-routes-plugin.js +152 -6
  312. package/dist/server/core-routes-plugin.js.map +1 -1
  313. package/dist/server/credential-provider.d.ts +37 -0
  314. package/dist/server/credential-provider.d.ts.map +1 -0
  315. package/dist/server/credential-provider.js +49 -0
  316. package/dist/server/credential-provider.js.map +1 -0
  317. package/dist/server/framework-request-handler.d.ts.map +1 -1
  318. package/dist/server/framework-request-handler.js +42 -3
  319. package/dist/server/framework-request-handler.js.map +1 -1
  320. package/dist/server/google-auth-plugin.js +1 -1
  321. package/dist/server/google-oauth.d.ts +1 -1
  322. package/dist/server/google-oauth.d.ts.map +1 -1
  323. package/dist/server/google-oauth.js +15 -10
  324. package/dist/server/google-oauth.js.map +1 -1
  325. package/dist/server/index.d.ts +3 -0
  326. package/dist/server/index.d.ts.map +1 -1
  327. package/dist/server/index.js +3 -0
  328. package/dist/server/index.js.map +1 -1
  329. package/dist/server/oauth-helpers.d.ts +1 -0
  330. package/dist/server/oauth-helpers.d.ts.map +1 -1
  331. package/dist/server/oauth-helpers.js +5 -4
  332. package/dist/server/oauth-helpers.js.map +1 -1
  333. package/dist/server/onboarding-html.d.ts.map +1 -1
  334. package/dist/server/onboarding-html.js +94 -3
  335. package/dist/server/onboarding-html.js.map +1 -1
  336. package/dist/server/request-context.d.ts +20 -0
  337. package/dist/server/request-context.d.ts.map +1 -0
  338. package/dist/server/request-context.js +41 -0
  339. package/dist/server/request-context.js.map +1 -0
  340. package/dist/templates/default/.agents/skills/actions/SKILL.md +2 -1
  341. package/dist/templates/default/.agents/skills/security/SKILL.md +145 -40
  342. package/dist/templates/default/.agents/skills/storing-data/SKILL.md +7 -1
  343. package/dist/templates/default/_gitignore +1 -0
  344. package/dist/templates/default/app/root.tsx +4 -1
  345. package/dist/templates/workspace-core/AGENTS.md +62 -0
  346. package/dist/templates/workspace-core/actions/company-directory.ts +38 -0
  347. package/dist/templates/workspace-core/package.json +39 -0
  348. package/dist/templates/workspace-core/skills/company-policies/SKILL.md +42 -0
  349. package/dist/templates/workspace-core/src/client/AuthenticatedLayout.tsx +37 -0
  350. package/dist/templates/workspace-core/src/client/index.ts +26 -0
  351. package/dist/templates/workspace-core/src/credentials.ts +29 -0
  352. package/dist/templates/workspace-core/src/index.ts +21 -0
  353. package/dist/templates/workspace-core/src/server/agent-chat-plugin.ts +30 -0
  354. package/dist/templates/workspace-core/src/server/auth-plugin.ts +35 -0
  355. package/dist/templates/workspace-core/src/server/index.ts +22 -0
  356. package/dist/templates/workspace-core/tailwind.preset.ts +34 -0
  357. package/dist/templates/workspace-core/tsconfig.json +9 -0
  358. package/dist/templates/workspace-root/.env.example +37 -0
  359. package/dist/templates/workspace-root/README.md +62 -0
  360. package/dist/templates/workspace-root/_gitignore +23 -0
  361. package/dist/templates/workspace-root/package.json +18 -0
  362. package/dist/templates/workspace-root/pnpm-workspace.yaml +3 -0
  363. package/dist/templates/workspace-root/tsconfig.base.json +21 -0
  364. package/dist/vite/agents-bundle-plugin.d.ts.map +1 -1
  365. package/dist/vite/agents-bundle-plugin.js +65 -15
  366. package/dist/vite/agents-bundle-plugin.js.map +1 -1
  367. package/dist/vite/client.d.ts +16 -0
  368. package/dist/vite/client.d.ts.map +1 -1
  369. package/dist/vite/client.js +75 -0
  370. package/dist/vite/client.js.map +1 -1
  371. package/docs/content/a2a-protocol.md +223 -0
  372. package/docs/content/actions.md +129 -0
  373. package/docs/content/agent-mentions.md +171 -0
  374. package/docs/content/authentication.md +155 -0
  375. package/docs/content/cli-adapters.md +244 -0
  376. package/docs/content/client.md +175 -0
  377. package/docs/content/context-awareness.md +168 -0
  378. package/docs/content/creating-templates.md +311 -0
  379. package/docs/content/database.md +82 -0
  380. package/docs/content/deployment.md +180 -0
  381. package/docs/content/enterprise-workspace.md +235 -0
  382. package/docs/content/faq.md +101 -0
  383. package/docs/content/file-uploads.md +102 -0
  384. package/docs/content/frames.md +47 -0
  385. package/docs/content/getting-started.md +104 -0
  386. package/docs/content/integrations.md +198 -0
  387. package/docs/content/key-concepts.md +246 -0
  388. package/docs/content/mcp-clients.md +110 -0
  389. package/docs/content/mcp-protocol.md +168 -0
  390. package/docs/content/onboarding.md +107 -0
  391. package/docs/content/real-time-collaboration.md +185 -0
  392. package/docs/content/resources.md +277 -0
  393. package/docs/content/security.md +158 -0
  394. package/docs/content/server.md +200 -0
  395. package/docs/content/skills-guide.md +107 -0
  396. package/docs/content/what-is-agent-native.md +100 -0
  397. package/docs/content/workspace-management.md +224 -0
  398. package/package.json +12 -2
  399. package/src/templates/default/.agents/skills/actions/SKILL.md +2 -1
  400. package/src/templates/default/.agents/skills/security/SKILL.md +145 -40
  401. package/src/templates/default/.agents/skills/storing-data/SKILL.md +7 -1
  402. package/src/templates/default/_gitignore +1 -0
  403. package/src/templates/default/app/root.tsx +4 -1
  404. package/src/templates/workspace-core/AGENTS.md +62 -0
  405. package/src/templates/workspace-core/actions/company-directory.ts +38 -0
  406. package/src/templates/workspace-core/package.json +39 -0
  407. package/src/templates/workspace-core/skills/company-policies/SKILL.md +42 -0
  408. package/src/templates/workspace-core/src/client/AuthenticatedLayout.tsx +37 -0
  409. package/src/templates/workspace-core/src/client/index.ts +26 -0
  410. package/src/templates/workspace-core/src/credentials.ts +29 -0
  411. package/src/templates/workspace-core/src/index.ts +21 -0
  412. package/src/templates/workspace-core/src/server/agent-chat-plugin.ts +30 -0
  413. package/src/templates/workspace-core/src/server/auth-plugin.ts +35 -0
  414. package/src/templates/workspace-core/src/server/index.ts +22 -0
  415. package/src/templates/workspace-core/tailwind.preset.ts +34 -0
  416. package/src/templates/workspace-core/tsconfig.json +9 -0
  417. package/src/templates/workspace-root/.env.example +37 -0
  418. package/src/templates/workspace-root/README.md +62 -0
  419. package/src/templates/workspace-root/_gitignore +23 -0
  420. package/src/templates/workspace-root/package.json +18 -0
  421. package/src/templates/workspace-root/pnpm-workspace.yaml +3 -0
  422. package/src/templates/workspace-root/tsconfig.base.json +21 -0
  423. package/dist/templates/templates/default/.agents/skills/actions/SKILL.md +0 -142
  424. package/dist/templates/templates/default/.agents/skills/agent-engines/SKILL.md +0 -127
  425. package/dist/templates/templates/default/.agents/skills/capture-learnings/SKILL.md +0 -50
  426. package/dist/templates/templates/default/.agents/skills/create-skill/SKILL.md +0 -167
  427. package/dist/templates/templates/default/.agents/skills/delegate-to-agent/SKILL.md +0 -90
  428. package/dist/templates/templates/default/.agents/skills/frontend-design/SKILL.md +0 -69
  429. package/dist/templates/templates/default/.agents/skills/real-time-collab/SKILL.md +0 -183
  430. package/dist/templates/templates/default/.agents/skills/real-time-sync/SKILL.md +0 -112
  431. package/dist/templates/templates/default/.agents/skills/security/SKILL.md +0 -108
  432. package/dist/templates/templates/default/.agents/skills/self-modifying-code/SKILL.md +0 -79
  433. package/dist/templates/templates/default/.agents/skills/storing-data/SKILL.md +0 -110
  434. package/dist/templates/templates/default/.claude/settings.json +0 -100
  435. package/dist/templates/templates/default/.env.example +0 -5
  436. package/dist/templates/templates/default/.ignore +0 -0
  437. package/dist/templates/templates/default/.prettierrc +0 -5
  438. package/dist/templates/templates/default/AGENTS.md +0 -110
  439. package/dist/templates/templates/default/DEVELOPING.md +0 -117
  440. package/dist/templates/templates/default/_gitignore +0 -37
  441. package/dist/templates/templates/default/actions/hello.ts +0 -20
  442. package/dist/templates/templates/default/actions/navigate.ts +0 -53
  443. package/dist/templates/templates/default/actions/run.ts +0 -2
  444. package/dist/templates/templates/default/actions/view-screen.ts +0 -39
  445. package/dist/templates/templates/default/app/entry.client.tsx +0 -4
  446. package/dist/templates/templates/default/app/entry.server.tsx +0 -56
  447. package/dist/templates/templates/default/app/global.css +0 -95
  448. package/dist/templates/templates/default/app/lib/utils.ts +0 -1
  449. package/dist/templates/templates/default/app/root.tsx +0 -107
  450. package/dist/templates/templates/default/app/routes/_index.tsx +0 -62
  451. package/dist/templates/templates/default/app/routes.ts +0 -4
  452. package/dist/templates/templates/default/app/vite-env.d.ts +0 -6
  453. package/dist/templates/templates/default/components.json +0 -20
  454. package/dist/templates/templates/default/data/.gitkeep +0 -0
  455. package/dist/templates/templates/default/data/sync-config.json +0 -1
  456. package/dist/templates/templates/default/learnings.defaults.md +0 -5
  457. package/dist/templates/templates/default/learnings.md +0 -0
  458. package/dist/templates/templates/default/package.json +0 -46
  459. package/dist/templates/templates/default/postcss.config.js +0 -6
  460. package/dist/templates/templates/default/public/icon-180.svg +0 -4
  461. package/dist/templates/templates/default/public/icon-192.svg +0 -4
  462. package/dist/templates/templates/default/public/icon-512.svg +0 -4
  463. package/dist/templates/templates/default/public/manifest.json +0 -13
  464. package/dist/templates/templates/default/react-router.config.ts +0 -6
  465. package/dist/templates/templates/default/server/middleware/auth.ts +0 -15
  466. package/dist/templates/templates/default/server/plugins/.gitkeep +0 -0
  467. package/dist/templates/templates/default/server/routes/[...page].get.ts +0 -5
  468. package/dist/templates/templates/default/server/routes/api/hello.get.ts +0 -5
  469. package/dist/templates/templates/default/shared/api.ts +0 -6
  470. package/dist/templates/templates/default/ssr-entry.ts +0 -20
  471. package/dist/templates/templates/default/tailwind.config.ts +0 -7
  472. package/dist/templates/templates/default/tsconfig.json +0 -11
  473. package/dist/templates/templates/default/vite.config.ts +0 -6
@@ -0,0 +1,82 @@
1
+ ---
2
+ title: "Database"
3
+ description: "Connect any SQL database to your agent-native app — SQLite for local dev, Postgres for production."
4
+ ---
5
+
6
+ # Database
7
+
8
+ Agent-native apps use [Drizzle ORM](https://orm.drizzle.team) and support any SQL database. By default, apps use SQLite with a local file — set `DATABASE_URL` to connect a production database.
9
+
10
+ ## Default: SQLite {#default-sqlite}
11
+
12
+ When `DATABASE_URL` is not set, the app creates a SQLite database at `data/app.db`. This is great for local development — no setup required.
13
+
14
+ ## Connecting a Production Database {#production}
15
+
16
+ Set `DATABASE_URL` in your `.env` file to connect a hosted database:
17
+
18
+ ```bash
19
+ # Neon Postgres
20
+ DATABASE_URL=postgres://user:pass@ep-cool-name-123456.us-east-2.aws.neon.tech/mydb?sslmode=require
21
+
22
+ # Supabase Postgres
23
+ DATABASE_URL=postgres://postgres.xxxx:pass@aws-0-us-east-1.pooler.supabase.com:6543/postgres
24
+
25
+ # Plain Postgres
26
+ DATABASE_URL=postgres://user:pass@localhost:5432/mydb
27
+
28
+ # Turso (libSQL)
29
+ DATABASE_URL=libsql://my-db-org.turso.io
30
+ TURSO_AUTH_TOKEN=your-token
31
+ ```
32
+
33
+ The framework auto-detects the dialect from the URL and configures Drizzle accordingly.
34
+
35
+ ## Builder.io Managed Database {#builder-managed}
36
+
37
+ When connected to Builder.io, your app can use a managed database that is provisioned and scaled automatically. This is the simplest path to production — no connection strings or database admin required. Coming soon.
38
+
39
+ ## Dialect-Agnostic Schema {#schema}
40
+
41
+ All SQL must work on both SQLite and Postgres. Never use SQLite-only syntax (`INSERT OR REPLACE`, `AUTOINCREMENT`, `datetime('now')`) or Postgres-only syntax.
42
+
43
+ Use the framework's schema helpers from `@agent-native/core/db/schema`:
44
+
45
+ ```ts
46
+ import { table, text, integer, real, now } from "@agent-native/core/db/schema";
47
+
48
+ export const tasks = table("tasks", {
49
+ id: text("id").primaryKey(),
50
+ title: text("title").notNull(),
51
+ priority: integer("priority").notNull().default(0),
52
+ weight: real("weight"),
53
+ done: integer("done", { mode: "boolean" }).notNull().default(false),
54
+ ownerEmail: text("owner_email").notNull(),
55
+ createdAt: text("created_at").notNull().default(now()),
56
+ });
57
+ ```
58
+
59
+ | Helper | Purpose |
60
+ | --------- | --------------------------------------------------------------- |
61
+ | `table` | Define a table — delegates to `pgTable` or `sqliteTable` |
62
+ | `text` | Text column, supports `{ enum: [...] }` |
63
+ | `integer` | Integer column, `{ mode: "boolean" }` maps to Postgres boolean |
64
+ | `real` | Float column — `real` on SQLite, `double precision` on Postgres |
65
+ | `now` | Dialect-agnostic current timestamp for `.default(now())` |
66
+
67
+ Never import from `drizzle-orm/sqlite-core` or `drizzle-orm/pg-core` directly. Always use `@agent-native/core/db/schema`.
68
+
69
+ ## Raw SQL Helpers {#raw-sql}
70
+
71
+ For cases where you need raw SQL outside of Drizzle queries:
72
+
73
+ - `getDbExec()` — auto-converts `?` params to `$1` for Postgres
74
+ - `isPostgres()` — runtime dialect check
75
+ - `intType()` — returns the correct integer type for the current dialect
76
+
77
+ ## Environment Variables {#environment-variables}
78
+
79
+ | Variable | Purpose |
80
+ | ------------------ | ------------------------------------------------- |
81
+ | `DATABASE_URL` | Database connection string (unset = local SQLite) |
82
+ | `TURSO_AUTH_TOKEN` | Auth token for Turso (libSQL) databases |
@@ -0,0 +1,180 @@
1
+ ---
2
+ title: "Deployment"
3
+ description: "Deploy agent-native apps to any platform with Nitro presets — Node.js, Vercel, Netlify, Cloudflare, AWS, and more."
4
+ ---
5
+
6
+ # Deployment
7
+
8
+ Agent-native apps use [Nitro](https://nitro.build) under the hood, which means you can deploy to any platform with zero config changes — just set a preset.
9
+
10
+ ## Workspace Deploy: One Origin, Many Apps {#workspace-deploy}
11
+
12
+ If your project is a [workspace](/docs/enterprise-workspace), you can ship every app in it to a single origin with one command:
13
+
14
+ ```bash
15
+ agent-native deploy
16
+ # https://your-agents.com/mail/* → apps/mail
17
+ # https://your-agents.com/calendar/* → apps/calendar
18
+ # https://your-agents.com/forms/* → apps/forms
19
+ ```
20
+
21
+ Each app is built with `APP_BASE_PATH=/<name>`, packaged into `dist/<name>/`, and fronted by a generated dispatcher worker at `dist/_worker.js`. A `_routes.json` manifest tells Cloudflare Pages which paths are dynamic.
22
+
23
+ Same-origin deploy gives you two big wins for free:
24
+
25
+ - **Shared login session** — log into any app, every app is logged in.
26
+ - **Zero-config cross-app A2A** — tagging `@calendar` from mail is a same-origin fetch; no CORS, no JWT signing between siblings.
27
+
28
+ Publish the output with:
29
+
30
+ ```bash
31
+ wrangler pages deploy dist
32
+ ```
33
+
34
+ Only need to deploy to Cloudflare Pages? That's the out-of-the-box target. Other targets stay per-app (see below) — or file an issue if you want another unified preset.
35
+
36
+ Per-app independent deploy is still supported — just `cd apps/<name> && agent-native build` like a standalone scaffold.
37
+
38
+ ## How It Works {#how-it-works}
39
+
40
+ When you run `agent-native build`, Nitro builds both the client SPA and the server API into `.output/`:
41
+
42
+ ```text
43
+ .output/
44
+ public/ # Built SPA (static assets)
45
+ server/
46
+ index.mjs # Server entry point
47
+ chunks/ # Server code chunks
48
+ ```
49
+
50
+ The output is self-contained — copy `.output/` to any environment and run it.
51
+
52
+ ## Setting the Preset {#setting-the-preset}
53
+
54
+ By default, Nitro builds for Node.js. To target a different platform, set the preset in your `vite.config.ts`:
55
+
56
+ ```ts
57
+ import { defineConfig } from "@agent-native/core/vite";
58
+
59
+ export default defineConfig({
60
+ nitro: {
61
+ preset: "vercel",
62
+ },
63
+ });
64
+ ```
65
+
66
+ Or use the `NITRO_PRESET` environment variable at build time:
67
+
68
+ ```bash
69
+ NITRO_PRESET=netlify agent-native build
70
+ ```
71
+
72
+ ## Node.js (Default) {#nodejs}
73
+
74
+ The default preset. Build and run:
75
+
76
+ ```bash
77
+ agent-native build
78
+ node .output/server/index.mjs
79
+ ```
80
+
81
+ Set `PORT` to configure the listen port (default: `3000`).
82
+
83
+ ### Docker {#docker}
84
+
85
+ ```dockerfile
86
+ FROM node:20-slim AS build
87
+ WORKDIR /app
88
+ COPY package.json pnpm-lock.yaml ./
89
+ RUN corepack enable && pnpm install --frozen-lockfile
90
+ COPY . .
91
+ RUN pnpm build
92
+
93
+ FROM node:20-slim
94
+ WORKDIR /app
95
+ COPY --from=build /app/.output .output
96
+ COPY --from=build /app/data data
97
+ ENV PORT=3000
98
+ EXPOSE 3000
99
+ CMD ["node", ".output/server/index.mjs"]
100
+ ```
101
+
102
+ ## Vercel {#vercel}
103
+
104
+ ```ts
105
+ // vite.config.ts
106
+ export default defineConfig({
107
+ nitro: { preset: "vercel" },
108
+ });
109
+ ```
110
+
111
+ Deploy via the Vercel CLI or git push:
112
+
113
+ ```bash
114
+ vercel deploy
115
+ ```
116
+
117
+ ## Netlify {#netlify}
118
+
119
+ ```ts
120
+ // vite.config.ts
121
+ export default defineConfig({
122
+ nitro: { preset: "netlify" },
123
+ });
124
+ ```
125
+
126
+ Deploy via the Netlify CLI or git push:
127
+
128
+ ```bash
129
+ netlify deploy --prod
130
+ ```
131
+
132
+ ## Cloudflare Pages {#cloudflare-pages}
133
+
134
+ ```ts
135
+ // vite.config.ts
136
+ export default defineConfig({
137
+ nitro: { preset: "cloudflare_pages" },
138
+ });
139
+ ```
140
+
141
+ ## AWS Lambda {#aws-lambda}
142
+
143
+ ```ts
144
+ // vite.config.ts
145
+ export default defineConfig({
146
+ nitro: { preset: "aws_lambda" },
147
+ });
148
+ ```
149
+
150
+ ## Deno Deploy {#deno-deploy}
151
+
152
+ ```ts
153
+ // vite.config.ts
154
+ export default defineConfig({
155
+ nitro: { preset: "deno_deploy" },
156
+ });
157
+ ```
158
+
159
+ ## Environment Variables {#environment-variables}
160
+
161
+ | Variable | Description |
162
+ | ------------------- | -------------------------------------------------------------------------------------------------------------------- |
163
+ | `PORT` | Server port (Node.js only) |
164
+ | `NITRO_PRESET` | Override build preset at build time |
165
+ | `ACCESS_TOKEN` | Enable auth gating for production mode |
166
+ | `ANTHROPIC_API_KEY` | API key for embedded production agent |
167
+ | `FILE_SYNC_ENABLED` | Enable file sync for multi-instance |
168
+ | `APP_BASE_PATH` | Mount the app under a prefix (e.g. `/mail`). Set automatically by `agent-native deploy`; leave unset for standalone. |
169
+
170
+ Inside a workspace, the root `.env` is loaded into every app automatically, so shared keys like `ANTHROPIC_API_KEY` and `A2A_SECRET` only need to be set once. Per-app `apps/<name>/.env` wins on conflict.
171
+
172
+ ## File Sync in Production {#file-sync}
173
+
174
+ By default, agent-native apps store state in local files. For multi-instance deployments (e.g., serverless or load-balanced), enable file sync to keep instances in sync:
175
+
176
+ ```bash
177
+ FILE_SYNC_ENABLED=true
178
+ ```
179
+
180
+ See [File Sync](/docs/file-sync) for adapter configuration (Firestore, Supabase, Convex).
@@ -0,0 +1,235 @@
1
+ ---
2
+ title: "Enterprise Workspace"
3
+ description: "Host many agent-native apps in one monorepo with shared auth, RBAC, skills, instructions, components, and credentials."
4
+ ---
5
+
6
+ # Enterprise Workspace
7
+
8
+ When vibe-coding an internal tool takes an afternoon, you don't stop at one. A team ends up with a CRM, a support inbox, a dashboard, a recruiting tracker, an ops console — ten small apps, each scaffolded independently. That's great until you need to change something in all of them.
9
+
10
+ At that point every app has its own `AGENTS.md`, its own auth plugin, its own copy-pasted layout component, its own hard-coded Slack token, its own idea of what an "organization" is. A compliance rule change means ten PRs. Rotating an API key means ten redeployments. A brand refresh means ten different headers drifting out of sync. The thing that made it easy to build them is now making it hard to manage them.
11
+
12
+ The **enterprise workspace** pattern is how agent-native solves this. You host all your apps in one monorepo alongside a private **workspace core** package. The core owns everything cross-cutting — auth, RBAC, agent skills, `AGENTS.md`, React components, design tokens, shared credentials, shared actions. Each app shrinks down to the handful of screens that make it unique. Change the core once; every app inherits the change on the next dev reload.
13
+
14
+ ## What gets shared {#what-gets-shared}
15
+
16
+ Anything every app in your org should agree on lives in the workspace core:
17
+
18
+ | Shared thing | Where it lives in the core |
19
+ | ----------------------------- | ---------------------------------------------------------------------------- |
20
+ | Auth (login, session, social) | `src/server/auth-plugin.ts` |
21
+ | Org / RBAC rules | Better Auth organizations, optionally wrapped in `src/server/auth-plugin.ts` |
22
+ | Agent chat system prompt | `src/server/agent-chat-plugin.ts` |
23
+ | Enterprise agent instructions | `AGENTS.md` |
24
+ | Agent skills | `skills/<skill-name>/SKILL.md` |
25
+ | Shared agent actions | `actions/*.ts` |
26
+ | Shared React components | `src/client/*.tsx` (e.g. `AuthenticatedLayout`) |
27
+ | Design tokens / brand | `tailwind.preset.ts` |
28
+ | Shared API credentials | `src/credentials.ts` → `resolveCompanyCredential()` |
29
+
30
+ Each individual app becomes _just a set of screens_ — routes, dashboards, views, domain-specific actions. Everything else is inherited. If you're building ten tools for the same org, nine of them are 80% the same package, and the workspace core is where that 80% lives.
31
+
32
+ ## Getting started {#getting-started}
33
+
34
+ Workspace is the default shape of an agent-native project. Scaffold one with:
35
+
36
+ ```bash
37
+ pnpm dlx @agent-native/core create my-company-platform
38
+ ```
39
+
40
+ The CLI shows a multi-select picker of every first-party template. Pick as many as you want — Mail + Calendar + Forms, for example — and they all get scaffolded into the same workspace sharing auth, brand, and agent config.
41
+
42
+ You get a pnpm monorepo with the private core package, a root `package.json` that wires up workspace discovery, a shared `.env`, and one sub-directory per app you picked:
43
+
44
+ ```text
45
+ my-company-platform/
46
+ ├── package.json # declares agent-native.workspaceCore
47
+ ├── pnpm-workspace.yaml # packages: ["packages/*", "apps/*"]
48
+ ├── .env.example # shared ANTHROPIC_API_KEY, BUILDER_PRIVATE_KEY,
49
+ │ # A2A_SECRET, DATABASE_URL, ...
50
+ ├── packages/
51
+ │ └── core-module/ # @my-company-platform/core-module
52
+ │ ├── src/
53
+ │ │ ├── server/ # auth / agent-chat plugin overrides
54
+ │ │ ├── client/ # shared React components
55
+ │ │ └── credentials.ts # resolveCompanyCredential()
56
+ │ ├── actions/ # shared agent-callable actions
57
+ │ ├── skills/ # shared agent skills
58
+ │ ├── AGENTS.md # enterprise-wide instructions
59
+ │ └── tailwind.preset.ts # brand tokens
60
+ └── apps/
61
+ ├── mail/
62
+ ├── calendar/
63
+ └── forms/
64
+ ```
65
+
66
+ Then boot it:
67
+
68
+ ```bash
69
+ cd my-company-platform
70
+ cp .env.example .env # fill in ANTHROPIC_API_KEY, BETTER_AUTH_SECRET, ...
71
+ pnpm install
72
+ pnpm dev # runs every app
73
+ ```
74
+
75
+ Every app renders through `<AuthenticatedLayout>` from the core. Every agent chat already sees the shared `AGENTS.md` and skills. Every app already knows how to log in and can call shared actions. You didn't wire any of that up — the framework auto-discovered the core via the `agent-native.workspaceCore` field in the root `package.json`:
76
+
77
+ ```json
78
+ {
79
+ "name": "my-company-platform",
80
+ "agent-native": {
81
+ "workspaceCore": "@my-company-platform/core-module"
82
+ }
83
+ }
84
+ ```
85
+
86
+ ## Adding another app {#adding-a-new-app}
87
+
88
+ From anywhere inside the workspace:
89
+
90
+ ```bash
91
+ agent-native add-app
92
+ ```
93
+
94
+ The CLI shows the template picker again with apps you've already installed filtered out. Pick one or more and they get scaffolded under `apps/`. Non-interactive variant:
95
+
96
+ ```bash
97
+ agent-native add-app crm --template content
98
+ ```
99
+
100
+ Any first-party template works as a workspace app — the CLI runs a small **workspacify** transform on the template that adds the workspace core as a dep and resolves `workspace:*` references. No parallel "workspace-app" scaffold to maintain.
101
+
102
+ ```bash
103
+ pnpm install # at the workspace root
104
+ pnpm --filter crm dev
105
+ ```
106
+
107
+ That's it. The new app has the same login as every other app in the workspace, the same agent instructions, the same brand, the same actions, the same shared credentials. All you add is the domain-specific screens.
108
+
109
+ ## What you override where {#layering}
110
+
111
+ Agent-native apps inside a workspace resolve cross-cutting behavior from three places, in this order:
112
+
113
+ 1. **App local** — files inside `apps/<name>/` (highest priority)
114
+ 2. **Workspace core** — files inside `packages/core-module/` (the shared mid-layer)
115
+ 3. **Framework default** — `@agent-native/core` (lowest)
116
+
117
+ The merge happens by file name. If an app provides a local file that also exists upstream, the local one wins. If it doesn't, the workspace core's version applies. If the core doesn't provide one either, the framework default kicks in. This applies to plugins, skills, actions, and `AGENTS.md`.
118
+
119
+ When one app needs something different, drop a local file:
120
+
121
+ | Thing to override | File to create inside the app |
122
+ | ----------------------------- | --------------------------------------------------- |
123
+ | Auth plugin | `apps/<name>/server/plugins/auth.ts` |
124
+ | Agent-chat plugin | `apps/<name>/server/plugins/agent-chat.ts` |
125
+ | A specific skill | `apps/<name>/.agents/skills/<skill-name>/SKILL.md` |
126
+ | A specific action | `apps/<name>/actions/<action-name>.ts` |
127
+ | Additional agent instructions | `apps/<name>/AGENTS.md` (merges with workspace one) |
128
+
129
+ No wiring, no config. Create the file and it takes over.
130
+
131
+ ## Editing shared behavior {#editing-shared-behavior}
132
+
133
+ Everything cross-cutting lives in `packages/core-module/`. Change `src/server/auth-plugin.ts` and every app in the workspace picks it up on the next dev reload. Add a new file to `skills/` and every app's agent instantly has access to the new skill. Add an action to `actions/` and every app's agent can call it.
134
+
135
+ Because the core is a `workspace:*` dependency, pnpm symlinks it into each app's `node_modules/`. You never build or publish it — the apps bundle whatever they need from it at build time.
136
+
137
+ ## Authentication and RBAC {#auth-and-rbac}
138
+
139
+ Every agent-native app already ships with [Better Auth](/docs/authentication) and its organizations plugin — users, organizations, members, and the `owner` / `admin` / `member` roles are all first-class, shared across every template. In a workspace, you get that for free in every app, backed by the same database.
140
+
141
+ For enterprise-specific rules (allow-list domains, SSO enforcement, extra role checks), wrap the framework auth plugin in `src/server/auth-plugin.ts` and re-export it. Every app in the workspace now enforces those rules.
142
+
143
+ Active organization flows automatically: `session.orgId` → `AGENT_ORG_ID` → SQL row scoping, so data tagged with `org_id` is invisible to other orgs even to the agent. See [Security & Data Scoping](/docs/security) for the full model.
144
+
145
+ ## Shared environment variables {#shared-env}
146
+
147
+ The workspace root `.env` is loaded into every app automatically. Put shared keys once at the root — `ANTHROPIC_API_KEY`, `A2A_SECRET`, `BETTER_AUTH_SECRET`, `DATABASE_URL`, `BUILDER_PRIVATE_KEY`, etc. — and every app picks them up. Per-app overrides go in `apps/<name>/.env` and win on conflict.
148
+
149
+ ```text
150
+ my-company-platform/
151
+ ├── .env # shared: ANTHROPIC_API_KEY=... , A2A_SECRET=... , ...
152
+ └── apps/
153
+ └── mail/
154
+ └── .env # optional overrides just for mail
155
+ ```
156
+
157
+ A few onboarding flows are workspace-aware out of the box:
158
+
159
+ - **Builder `/cli-auth`**: clicking "Connect Builder" from any app writes `BUILDER_PRIVATE_KEY` and friends to the **workspace root** `.env`, so every app gains browser access at once.
160
+ - **Env-vars settings route** (`POST /_agent-native/env-vars`): when inside a workspace, defaults to writing the workspace root `.env`. Pass `scope: "app"` in the body to override one app.
161
+
162
+ ## Shared credentials {#shared-credentials}
163
+
164
+ Rotate a third-party API key in one place and every app picks it up:
165
+
166
+ ```ts
167
+ import { resolveCompanyCredential } from "@my-company-platform/core-module/credentials";
168
+
169
+ const slackToken = await resolveCompanyCredential("SLACK_BOT_TOKEN");
170
+ ```
171
+
172
+ Under the hood this wraps `@agent-native/core`'s `resolveCredential()`, which checks `process.env` first and then falls back to the shared `settings` table. Apps in the same workspace point at the same `DATABASE_URL` by default, so storing a credential in settings once makes it available to every app — no per-app config.
173
+
174
+ ## Shared design tokens {#design-tokens}
175
+
176
+ The core exports a Tailwind preset. Each app's `tailwind.config.ts` extends it:
177
+
178
+ ```ts
179
+ import preset from "@my-company-platform/core-module/tailwind";
180
+
181
+ export default {
182
+ presets: [preset],
183
+ content: ["./app/**/*.{ts,tsx}"],
184
+ };
185
+ ```
186
+
187
+ Brand colors, typography, spacing scales, and any shared component classes live in one file. Update it in the core and every app rebrands on the next build. Shared React components in `src/client/` pick up the same tokens automatically.
188
+
189
+ ## Deployment {#deployment}
190
+
191
+ You have two options: **unified deploy** (the default for workspaces) or per-app independent deploy.
192
+
193
+ ### Unified deploy (recommended)
194
+
195
+ One command builds every app in the workspace and ships them behind a single origin, one path per app:
196
+
197
+ ```bash
198
+ agent-native deploy
199
+ # https://your-agents.com/mail/* → apps/mail
200
+ # https://your-agents.com/calendar/* → apps/calendar
201
+ # https://your-agents.com/forms/* → apps/forms
202
+ ```
203
+
204
+ Each app is built with `APP_BASE_PATH=/<name>` and emitted into `dist/<name>/`. A dispatcher worker at `dist/_worker.js` routes each path to the matching app, and a `_routes.json` manifest tells Cloudflare Pages which paths to treat as dynamic.
205
+
206
+ Being on the **same origin** is where the real payoff lives:
207
+
208
+ - **Shared login session.** Better Auth sets its cookie on the apex domain, so logging into any app logs you into every app. No cross-domain SSO dance.
209
+ - **Zero-config cross-app A2A.** `@mail` tagging `@calendar` becomes a same-origin fetch — no CORS, no JWT signing between siblings. External A2A still uses JWT as today.
210
+ - **One DNS record, one cert, one CDN cache.**
211
+
212
+ Publish the `dist/` output:
213
+
214
+ ```bash
215
+ wrangler pages deploy dist
216
+ ```
217
+
218
+ ### Per-app independent deploy
219
+
220
+ Prefer each app on its own domain (`mail.company.com`, `calendar.company.com`)? Every app in the workspace is still an independent deployable — `cd apps/mail && agent-native build` behaves exactly like a standalone scaffold. Cross-app A2A then goes through the standard JWT-signed path with a shared `A2A_SECRET`.
221
+
222
+ ### Shared database, shared credentials
223
+
224
+ Whatever you pick, point every app at the same `DATABASE_URL` for cross-app state out of the box: one set of user accounts, one set of organizations, one set of shared settings. If each app has its own database, the workspace pattern still works — you just lose that shared-state story.
225
+
226
+ The workspace core itself is never built or deployed standalone. It's a `workspace:*` dep that pnpm symlinks into each app's `node_modules/`, so every app transparently bundles whatever it needs from the core at build time.
227
+
228
+ ## Out of scope (for now) {#out-of-scope}
229
+
230
+ The workspace pattern is intentionally narrow. A few things it deliberately doesn't handle yet:
231
+
232
+ - **Cross-domain SSO.** The unified `agent-native deploy` flow solves the common case (one origin, many apps at `/mail`, `/calendar`, …). If you need `mail.company.com` and `calendar.company.com` on _different_ domains to share a session, that requires a shared cookie domain or a central auth app with OAuth redirects — both supported by the underlying stack but neither scaffolded out of the box.
233
+ - **Encrypted credential vault.** Shared credentials live in the `settings` table as plain text today. Rotate responsibly.
234
+ - **Publishing the core to private npm.** The core is `workspace:*` only; multi-repo sharing via a private registry is doable but not scaffolded.
235
+ - **Opinionated component library.** The core is where _you_ put shared components. The framework doesn't force shadcn/ui or any other system into that slot.
@@ -0,0 +1,101 @@
1
+ ---
2
+ title: "FAQ"
3
+ description: "Frequently asked questions about agent-native apps, development, architecture, and templates."
4
+ ---
5
+
6
+ # FAQ
7
+
8
+ Frequently asked questions about agent-native apps, development, and the framework.
9
+
10
+ ## General {#general}
11
+
12
+ ### What is agent-native? {#what-is-agent-native}
13
+
14
+ Agent-native is a framework for building apps where the AI agent and the UI are equal partners. They share the same database, the same state, and they always stay in sync. Everything the UI can do, the agent can do — and vice versa. See [What Is Agent-Native?](/docs/what-is-agent-native) for the full explanation.
15
+
16
+ ### How is this different from adding AI to an existing app? {#how-is-this-different}
17
+
18
+ Most apps bolt AI on as an afterthought — an autocomplete here, a chat sidebar there. The AI can't actually _do_ things in the app. In an agent-native app, the agent is a first-class citizen. It can create emails, schedule events, build forms, generate slides, and modify the app's own code. The architecture is designed for this from the ground up.
19
+
20
+ ### Do I need to know AI/ML? {#do-i-need-to-know-ai}
21
+
22
+ No. You don't train models, fine-tune, or deal with embeddings. You build a regular web app with React, TypeScript, and SQL. The framework handles the agent integration — routing messages, running actions, syncing state. You write standard web code and the agent just works.
23
+
24
+ ### Is this open source? {#is-this-open-source}
25
+
26
+ Yes. The framework and all templates are open source. You can run everything locally, self-host, or use Builder.io's cloud for managed hosting, collaboration, and team features.
27
+
28
+ ## Development {#development}
29
+
30
+ ### Which AI coding tools work with agent-native? {#which-ai-tools-work}
31
+
32
+ Any AI coding tool that reads project instructions. The framework uses AGENTS.md as the universal standard and auto-creates symlinks for specific tools:
33
+
34
+ - **Claude Code** — reads CLAUDE.md (symlinked from AGENTS.md)
35
+ - **Cursor** — reads .cursorrules (symlinked from AGENTS.md)
36
+ - **Windsurf** — reads .windsurfrules (symlinked from AGENTS.md)
37
+ - **Codex, Gemini, and others** — work via the embedded agent panel
38
+ - **Builder.io** — cloud-hosted agent with visual editing and collaboration
39
+
40
+ ### Can I use my own database? {#can-i-use-my-own-database}
41
+
42
+ Yes. Set `DATABASE_URL` and the framework auto-detects your database. Supported databases include SQLite, Postgres (Neon, Supabase, plain), Turso (libSQL), and Cloudflare D1. All SQL is dialect-agnostic via Drizzle ORM — the same code works everywhere.
43
+
44
+ ### Where can I deploy? {#where-can-i-deploy}
45
+
46
+ Anywhere. The server runs on Nitro, which compiles to any deployment target: Node.js, Cloudflare Workers/Pages, Netlify, Vercel, Deno Deploy, AWS Lambda, and Bun. You can also use Builder.io's hosting for managed deployments. See the [Deployment guide](/docs/deployment).
47
+
48
+ ### Can I migrate an existing app to agent-native? {#can-i-use-existing-code}
49
+
50
+ You can, but agent-native works best when built from the ground up. The architecture — shared database, polling sync, actions, application state — needs to be integrated throughout. Starting from a template and customizing it is the recommended path. Think of it like the shift from desktop-first to mobile-first: you _can_ retrofit, but building native is better.
51
+
52
+ ## Architecture {#architecture}
53
+
54
+ ### Why polling instead of WebSockets? {#why-polling-not-websockets}
55
+
56
+ Polling works in every deployment environment — including serverless, edge, and container platforms where persistent connections aren't available. The framework polls every 2 seconds using a lightweight version counter. When changes are detected, React Query caches are invalidated and components re-render. It's simple, reliable, and universal. SSE is also supported as an alternative.
57
+
58
+ ### Why can't the UI call an LLM directly? {#why-no-inline-llm-calls}
59
+
60
+ AI is non-deterministic — you need conversation flow to give feedback and iterate, not one-shot buttons. The agent has your full codebase, instructions, skills, and conversation history. An inline LLM call has none of that. Plus, routing everything through the agent means the app can be driven from Slack, Telegram, or another agent via [A2A](/docs/a2a-protocol) — not just the UI.
61
+
62
+ ### Why is this a framework and not a library? {#why-framework-not-library}
63
+
64
+ The shared database, polling sync, actions system, and application state all need to work together as a cohesive architecture. A library could give you pieces, but agent-native requires that the agent and UI are wired together from the ground up. Multiple agents need to be able to communicate, the UI needs to react to agent changes instantly, and the agent needs to understand what the user is looking at. That's an architecture, not a utility.
65
+
66
+ ## Agent Capabilities {#agent-capabilities}
67
+
68
+ ### Can the agent really modify the app's own code? {#can-the-agent-modify-code}
69
+
70
+ Yes, and it's a feature. The agent can safely edit components, routes, styles, and actions. You ask "add a cohort analysis chart" and the agent builds it. You ask "connect to our Stripe account" and the agent writes the integration.
71
+
72
+ ### Can agents talk to each other? {#can-agents-talk-to-each-other}
73
+
74
+ Yes, via the [A2A (Agent-to-Agent) protocol](/docs/a2a-protocol). Every agent-native app automatically gets an A2A endpoint. From the mail app, you can tag the analytics agent to query data. An agent discovers what other agents are available, calls them over the protocol, and shows results in the UI. No configuration needed — the agent card is auto-generated from your template's actions.
75
+
76
+ ### What can the agent see in the app? {#what-can-the-agent-see}
77
+
78
+ The agent always knows what the user is currently viewing. The UI writes navigation state to the database on every route change — which view is open, which item is selected. The agent reads this via the `view-screen` action before taking action. If an email is open, the agent knows which email. If a slide is selected, the agent knows which slide. See [Context Awareness](/docs/context-awareness).
79
+
80
+ ## Templates {#templates}
81
+
82
+ ### What templates are available? {#what-templates-are-available}
83
+
84
+ The framework ships with production-ready templates that you can use as daily drivers:
85
+
86
+ - **[Mail](/templates/mail)** — full-featured email client (like Superhuman)
87
+ - **[Calendar](/templates/calendar)** — Google Calendar + Calendly-style meeting links
88
+ - **[Content](/templates/content)** — Notion-style documents
89
+ - **[Slides](/templates/slides)** — presentation builder
90
+ - **[Video](/templates/video)** — video composition with Remotion
91
+ - **[Analytics](/templates/analytics)** — data platform (like Amplitude/Mixpanel)
92
+
93
+ Each template is a complete app with UI, agent actions, database schema, and AI instructions. See all [Templates](/templates).
94
+
95
+ ### Can I customize templates? {#can-i-customize-templates}
96
+
97
+ That's the whole point. Fork a template and customize it by asking the agent. "Add a priority field to forms." "Connect to our Salesforce instance." "Change the color scheme to match our brand." The agent modifies the code, and your app evolves over time.
98
+
99
+ ### Can I build from scratch without a template? {#can-i-build-from-scratch}
100
+
101
+ Yes. Run `npx @agent-native/core create my-app` without the `--template` flag. You get the framework scaffolding — React frontend, Nitro backend, agent panel, database — but no domain-specific code. See [Getting Started](/docs).