@agent-native/core 0.131.5 → 0.131.7

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 (350) hide show
  1. package/corpus/README.md +3 -3
  2. package/corpus/core/CHANGELOG.md +70 -0
  3. package/corpus/core/docs/content/agent-native-toolkit.mdx +13 -6
  4. package/corpus/core/docs/content/cloneable-saas.mdx +5 -5
  5. package/corpus/core/docs/content/creating-templates.mdx +9 -0
  6. package/corpus/core/docs/content/deployment.mdx +18 -12
  7. package/corpus/core/docs/content/doctor.mdx +8 -1
  8. package/corpus/core/docs/content/drop-in-agent.mdx +1 -1
  9. package/corpus/core/docs/content/extensions.mdx +18 -18
  10. package/corpus/core/docs/content/faq.mdx +4 -4
  11. package/corpus/core/docs/content/key-concepts.mdx +30 -21
  12. package/corpus/core/docs/content/security.mdx +2 -2
  13. package/corpus/core/docs/content/template-brain-developers.mdx +4 -1
  14. package/corpus/core/docs/content/template-mail-developers.mdx +4 -1
  15. package/corpus/core/docs/content/what-is-agent-native.mdx +6 -6
  16. package/corpus/core/package.json +1 -1
  17. package/corpus/core/src/a2a/client.ts +449 -66
  18. package/corpus/core/src/a2a/correlation.ts +31 -0
  19. package/corpus/core/src/a2a/invoke.ts +4 -2
  20. package/corpus/core/src/a2a/types.ts +4 -0
  21. package/corpus/core/src/action.ts +3 -0
  22. package/corpus/core/src/agent/action-continuation-guidance.ts +2 -1
  23. package/corpus/core/src/agent/engine/registry.ts +98 -6
  24. package/corpus/core/src/agent/production-agent.ts +151 -18
  25. package/corpus/core/src/agent/run-loop-with-resume.ts +190 -3
  26. package/corpus/core/src/agent/run-manager.ts +117 -41
  27. package/corpus/core/src/agent/thread-debug-history.ts +86 -0
  28. package/corpus/core/src/agent/types.ts +3 -1
  29. package/corpus/core/src/cli/create.ts +11 -1
  30. package/corpus/core/src/cli/templates-meta.ts +2 -2
  31. package/corpus/core/src/client/agent-chat-adapter.ts +91 -13
  32. package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +11 -9
  33. package/corpus/core/src/client/sse-event-processor.ts +17 -3
  34. package/corpus/core/src/db/client.ts +57 -17
  35. package/corpus/core/src/guards/no-env-credentials.ts +2 -0
  36. package/corpus/core/src/integrations/adapters/slack.ts +8 -3
  37. package/corpus/core/src/localization/default-messages.ts +44 -0
  38. package/corpus/core/src/observability/traces.ts +78 -5
  39. package/corpus/core/src/scripts/call-agent.ts +294 -11
  40. package/corpus/core/src/scripts/describe-workspace-apps.ts +2 -2
  41. package/corpus/core/src/secrets/crypto.ts +156 -35
  42. package/corpus/core/src/secrets/storage.ts +64 -26
  43. package/corpus/core/src/server/agent-capabilities.ts +1 -1
  44. package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +113 -7
  45. package/corpus/core/src/server/agent-chat/context-tools.ts +2 -0
  46. package/corpus/core/src/server/agent-chat/plugin-options.ts +34 -1
  47. package/corpus/core/src/server/agent-chat/prompt-resources.ts +1 -1
  48. package/corpus/core/src/server/agent-chat-plugin.ts +91 -59
  49. package/corpus/core/src/templates/default/.agents/skills/secrets/SKILL.md +19 -7
  50. package/corpus/core/src/templates/headless/.agents/skills/secrets/SKILL.md +19 -7
  51. package/corpus/core/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +18 -7
  52. package/corpus/core/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +15 -14
  53. package/corpus/core/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +19 -7
  54. package/corpus/core/src/vite/client.ts +1 -0
  55. package/corpus/templates/analytics/.agents/skills/dashboard-ops/SKILL.md +5 -4
  56. package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +6 -4
  57. package/corpus/templates/analytics/AGENTS.md +7 -4
  58. package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +4 -3
  59. package/corpus/templates/analytics/changelog/2026-07-30-delegated-analytics-questions-now-return-a-useful-current-me.md +6 -0
  60. package/corpus/templates/analytics/changelog/2026-07-30-scheduled-dashboard-emails-complete-every-panel-without-pool.md +6 -0
  61. package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +28 -1
  62. package/corpus/templates/analytics/server/jobs/dashboard-report.ts +18 -11
  63. package/corpus/templates/analytics/server/lib/analytics-connector-catalog.ts +4 -4
  64. package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +9 -5
  65. package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +6 -2
  66. package/corpus/templates/analytics/server/lib/dashboard-panel-source-resolver.ts +11 -4
  67. package/corpus/templates/analytics/server/lib/dashboard-report-render.ts +49 -31
  68. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +16 -8
  69. package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +9 -3
  70. package/corpus/templates/analytics/server/lib/production-serverless-runtime.ts +11 -0
  71. package/corpus/templates/analytics/server/lib/real-data-actions.ts +10 -0
  72. package/corpus/templates/analytics/server/plugins/agent-chat.ts +3 -2
  73. package/corpus/templates/analytics/server/plugins/analytics-alert-jobs.ts +2 -1
  74. package/corpus/templates/analytics/server/plugins/dashboard-report-jobs.ts +2 -1
  75. package/corpus/templates/analytics/server/plugins/uptime-monitor-jobs.ts +1 -12
  76. package/corpus/templates/brain/.agents/skills/brain/RUNBOOK.md +54 -6
  77. package/corpus/templates/brain/.agents/skills/brain/SKILL.md +20 -9
  78. package/corpus/templates/brain/.agents/skills/ingestion-and-connectors/SKILL.md +33 -1
  79. package/corpus/templates/brain/AGENTS.md +3 -1
  80. package/corpus/templates/brain/README.md +4 -1
  81. package/corpus/templates/brain/actions/_schemas.ts +30 -8
  82. package/corpus/templates/brain/actions/ask-brain.ts +124 -14
  83. package/corpus/templates/brain/actions/create-source.ts +18 -2
  84. package/corpus/templates/brain/actions/enqueue-captures-distillation.ts +8 -123
  85. package/corpus/templates/brain/actions/enqueue-distillation.ts +6 -127
  86. package/corpus/templates/brain/actions/import-capture.ts +17 -5
  87. package/corpus/templates/brain/actions/import-transcript.ts +17 -5
  88. package/corpus/templates/brain/actions/update-source.ts +25 -5
  89. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +1 -1
  90. package/corpus/templates/brain/changelog/2026-07-30-blessed-resources-can-feed-cited-company-answers.md +6 -0
  91. package/corpus/templates/brain/changelog/2026-07-30-the-left-sidebar-no-longer-shows-a-blank-organization-placeh.md +6 -0
  92. package/corpus/templates/brain/server/lib/brain.ts +49 -19
  93. package/corpus/templates/brain/server/lib/distillation-queue.ts +147 -0
  94. package/corpus/templates/brain/server/lib/source-policy.ts +264 -0
  95. package/corpus/templates/brain/server/plugins/agent-chat.ts +3 -2
  96. package/corpus/templates/brain/server/routes/api/_agent-native/brain/ingest.post.ts +116 -19
  97. package/corpus/templates/clips/app/components/meetings/google-oauth-identity-notice.tsx +51 -0
  98. package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
  99. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +3 -1
  100. package/corpus/templates/clips/changelog/2026-07-30-google-calendar-warning.md +6 -0
  101. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +72 -8
  102. package/corpus/templates/content/changelog/2026-07-30-the-slash-command-hint-now-stays-on-only-the-active-empty-li.md +6 -0
  103. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +506 -11
  104. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +148 -17
  105. package/corpus/templates/design/app/components/design/canvas-interactions/design-canvas-interactions.ts +357 -0
  106. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +7 -466
  107. package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +15 -311
  108. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +19 -997
  109. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +8 -1216
  110. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +31 -38
  111. package/corpus/templates/design/package.json +0 -1
  112. package/corpus/templates/dispatch/AGENTS.md +8 -0
  113. package/corpus/templates/dispatch/DEVELOPING.md +29 -0
  114. package/corpus/templates/dispatch/actions/view-screen.ts +34 -2
  115. package/corpus/templates/dispatch/app/i18n-data.ts +457 -0
  116. package/corpus/templates/dispatch/changelog/2026-07-30-delegated-dispatch-work-continues-reliably-in-the-background.md +6 -0
  117. package/corpus/templates/dispatch/changelog/2026-07-30-find-failed-runs-across-apps.md +6 -0
  118. package/corpus/templates/dispatch/netlify.toml +3 -0
  119. package/corpus/templates/plan/actions/get-visual-plan.ts +10 -6
  120. package/corpus/templates/plan/actions/patch-visual-plan-source.ts +117 -1
  121. package/corpus/templates/plan/actions/update-visual-plan.ts +56 -14
  122. package/corpus/templates/plan/app/pages/PlansPage.tsx +1 -1
  123. package/corpus/templates/plan/changelog/2026-07-30-plan-agents-recover-with-targeted-writes.md +6 -0
  124. package/corpus/templates/plan/shared/plan-content.ts +35 -0
  125. package/corpus/templates/slides/.agents/skills/analytics-data-for-decks/SKILL.md +8 -12
  126. package/corpus/templates/slides/AGENTS.md +4 -4
  127. package/corpus/templates/slides/actions/create-deck.ts +1 -1
  128. package/corpus/templates/slides/actions/duplicate-deck.ts +19 -4
  129. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +2 -10
  130. package/corpus/templates/slides/app/components/deck/MermaidRenderer.tsx +12 -1
  131. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +30 -13
  132. package/corpus/templates/slides/app/components/editor/DeckEditorSkeleton.tsx +35 -0
  133. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +63 -56
  134. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +21 -76
  135. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1110 -292
  136. package/corpus/templates/slides/app/components/editor/SlideOverflowWarning.tsx +53 -0
  137. package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +235 -18
  138. package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +4 -1
  139. package/corpus/templates/slides/app/components/editor/canvas-interactions/index.ts +11 -0
  140. package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +129 -0
  141. package/corpus/templates/slides/app/components/editor/selection-overlay-measurement.ts +70 -0
  142. package/corpus/templates/slides/app/components/editor/slide-object-interactions.ts +519 -65
  143. package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +36 -426
  144. package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +19 -458
  145. package/corpus/templates/slides/app/context/DeckContext.tsx +179 -72
  146. package/corpus/templates/slides/app/global.css +105 -0
  147. package/corpus/templates/slides/app/i18n/en-US.ts +8 -0
  148. package/corpus/templates/slides/app/lib/deck-editor-loading.ts +26 -0
  149. package/corpus/templates/slides/app/lib/mermaid-blocks.ts +27 -0
  150. package/corpus/templates/slides/app/pages/DeckEditor.tsx +71 -38
  151. package/corpus/templates/slides/app/pages/Index.tsx +98 -41
  152. package/corpus/templates/slides/changelog/2026-07-30-deck-loading-no-longer-flashes-an-unavailable-message.md +6 -0
  153. package/corpus/templates/slides/changelog/2026-07-30-duplicating-a-deck-from-the-deck-list-now-opens-the-copy-imm.md +6 -0
  154. package/corpus/templates/slides/changelog/2026-07-30-layout-overflow-warning-is-readable-and-dismissible.md +6 -0
  155. package/corpus/templates/slides/changelog/2026-07-30-new-decks-now-start-with-an-empty-slide-list-when-no-slides-.md +6 -0
  156. package/corpus/templates/slides/changelog/2026-07-30-shared-canvas-annotations.md +6 -0
  157. package/corpus/templates/slides/changelog/2026-07-30-slide-objects-can-be-moved-as-a-group-copied-and-pasted-with.md +6 -0
  158. package/corpus/templates/slides/changelog/2026-07-30-slide-text-editing-and-object-controls-now-match-google-slides.md +6 -0
  159. package/corpus/templates/slides/changelog/2026-07-30-style-panel-now-scrolls-with-speaker-notes-open-shows-the-sl.md +6 -0
  160. package/corpus/templates/slides/changelog/2026-07-30-top-toolbar-controls-now-use-consistent-sizing-with-undo-and.md +6 -0
  161. package/corpus/templates/slides/netlify.toml +3 -1
  162. package/corpus/templates/slides/package.json +0 -1
  163. package/corpus/templates/slides/server/lib/chat-attachments.ts +18 -0
  164. package/corpus/templates/slides/server/plugins/agent-chat.ts +5 -0
  165. package/corpus/templates/slides/vite.config.ts +0 -1
  166. package/corpus/toolkit/CHANGELOG.md +13 -0
  167. package/corpus/toolkit/README.md +19 -0
  168. package/corpus/toolkit/agent-native.eject.json +38 -0
  169. package/corpus/toolkit/package.json +29 -1
  170. package/corpus/toolkit/src/canvas-annotations/CanvasCommentPins.tsx +861 -0
  171. package/corpus/toolkit/src/canvas-annotations/DrawOverlay.tsx +1233 -0
  172. package/corpus/toolkit/src/canvas-annotations/index.ts +15 -0
  173. package/corpus/toolkit/src/canvas-annotations/types.ts +14 -0
  174. package/corpus/toolkit/src/canvas-interactions/canvas-interactions.ts +933 -0
  175. package/corpus/toolkit/src/canvas-interactions/index.ts +67 -0
  176. package/corpus/toolkit/src/design-tweaks/scrub-input-utils.ts +311 -0
  177. package/corpus/toolkit/src/design-tweaks/scrub-input.tsx +491 -0
  178. package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +26 -171
  179. package/corpus/toolkit/src/index.ts +1 -0
  180. package/dist/a2a/client.d.ts +23 -0
  181. package/dist/a2a/client.d.ts.map +1 -1
  182. package/dist/a2a/client.js +309 -44
  183. package/dist/a2a/client.js.map +1 -1
  184. package/dist/a2a/correlation.d.ts +1 -0
  185. package/dist/a2a/correlation.d.ts.map +1 -1
  186. package/dist/a2a/correlation.js +27 -0
  187. package/dist/a2a/correlation.js.map +1 -1
  188. package/dist/a2a/invoke.d.ts.map +1 -1
  189. package/dist/a2a/invoke.js +4 -2
  190. package/dist/a2a/invoke.js.map +1 -1
  191. package/dist/a2a/types.d.ts +4 -0
  192. package/dist/a2a/types.d.ts.map +1 -1
  193. package/dist/a2a/types.js.map +1 -1
  194. package/dist/action.d.ts +3 -0
  195. package/dist/action.d.ts.map +1 -1
  196. package/dist/action.js.map +1 -1
  197. package/dist/agent/action-continuation-guidance.d.ts.map +1 -1
  198. package/dist/agent/action-continuation-guidance.js +2 -1
  199. package/dist/agent/action-continuation-guidance.js.map +1 -1
  200. package/dist/agent/engine/registry.d.ts.map +1 -1
  201. package/dist/agent/engine/registry.js +82 -8
  202. package/dist/agent/engine/registry.js.map +1 -1
  203. package/dist/agent/production-agent.d.ts +40 -1
  204. package/dist/agent/production-agent.d.ts.map +1 -1
  205. package/dist/agent/production-agent.js +113 -15
  206. package/dist/agent/production-agent.js.map +1 -1
  207. package/dist/agent/run-loop-with-resume.d.ts +21 -0
  208. package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
  209. package/dist/agent/run-loop-with-resume.js +163 -4
  210. package/dist/agent/run-loop-with-resume.js.map +1 -1
  211. package/dist/agent/run-manager.d.ts +16 -9
  212. package/dist/agent/run-manager.d.ts.map +1 -1
  213. package/dist/agent/run-manager.js +93 -42
  214. package/dist/agent/run-manager.js.map +1 -1
  215. package/dist/agent/thread-debug-history.d.ts +10 -0
  216. package/dist/agent/thread-debug-history.d.ts.map +1 -0
  217. package/dist/agent/thread-debug-history.js +68 -0
  218. package/dist/agent/thread-debug-history.js.map +1 -0
  219. package/dist/agent/types.d.ts +3 -1
  220. package/dist/agent/types.d.ts.map +1 -1
  221. package/dist/agent/types.js.map +1 -1
  222. package/dist/cli/create.d.ts.map +1 -1
  223. package/dist/cli/create.js +6 -1
  224. package/dist/cli/create.js.map +1 -1
  225. package/dist/cli/templates-meta.js +2 -2
  226. package/dist/cli/templates-meta.js.map +1 -1
  227. package/dist/client/agent-chat-adapter.d.ts +1 -1
  228. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  229. package/dist/client/agent-chat-adapter.js +76 -13
  230. package/dist/client/agent-chat-adapter.js.map +1 -1
  231. package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
  232. package/dist/client/resources/McpIntegrationDialog.js +1 -1
  233. package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
  234. package/dist/client/sse-event-processor.d.ts.map +1 -1
  235. package/dist/client/sse-event-processor.js +12 -3
  236. package/dist/client/sse-event-processor.js.map +1 -1
  237. package/dist/collab/routes.d.ts +1 -1
  238. package/dist/db/client.d.ts.map +1 -1
  239. package/dist/db/client.js +48 -17
  240. package/dist/db/client.js.map +1 -1
  241. package/dist/guards/no-env-credentials.d.ts.map +1 -1
  242. package/dist/guards/no-env-credentials.js +2 -0
  243. package/dist/guards/no-env-credentials.js.map +1 -1
  244. package/dist/integrations/adapters/slack.js +7 -3
  245. package/dist/integrations/adapters/slack.js.map +1 -1
  246. package/dist/localization/default-messages.d.ts +43 -0
  247. package/dist/localization/default-messages.d.ts.map +1 -1
  248. package/dist/localization/default-messages.js +43 -0
  249. package/dist/localization/default-messages.js.map +1 -1
  250. package/dist/observability/traces.d.ts +3 -1
  251. package/dist/observability/traces.d.ts.map +1 -1
  252. package/dist/observability/traces.js +73 -4
  253. package/dist/observability/traces.js.map +1 -1
  254. package/dist/progress/routes.d.ts +1 -1
  255. package/dist/provider-api/actions/custom-provider-registration.d.ts +12 -12
  256. package/dist/provider-api/actions/provider-api.d.ts +13 -13
  257. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  258. package/dist/scripts/call-agent.d.ts.map +1 -1
  259. package/dist/scripts/call-agent.js +237 -12
  260. package/dist/scripts/call-agent.js.map +1 -1
  261. package/dist/scripts/describe-workspace-apps.js +2 -2
  262. package/dist/scripts/describe-workspace-apps.js.map +1 -1
  263. package/dist/secrets/crypto.d.ts +36 -21
  264. package/dist/secrets/crypto.d.ts.map +1 -1
  265. package/dist/secrets/crypto.js +134 -33
  266. package/dist/secrets/crypto.js.map +1 -1
  267. package/dist/secrets/storage.d.ts +6 -6
  268. package/dist/secrets/storage.d.ts.map +1 -1
  269. package/dist/secrets/storage.js +43 -26
  270. package/dist/secrets/storage.js.map +1 -1
  271. package/dist/server/agent-capabilities.js +1 -1
  272. package/dist/server/agent-capabilities.js.map +1 -1
  273. package/dist/server/agent-chat/action-filters-a2a.d.ts +17 -3
  274. package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
  275. package/dist/server/agent-chat/action-filters-a2a.js +94 -3
  276. package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
  277. package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
  278. package/dist/server/agent-chat/context-tools.js +2 -0
  279. package/dist/server/agent-chat/context-tools.js.map +1 -1
  280. package/dist/server/agent-chat/plugin-options.d.ts +23 -0
  281. package/dist/server/agent-chat/plugin-options.d.ts.map +1 -1
  282. package/dist/server/agent-chat/plugin-options.js +4 -1
  283. package/dist/server/agent-chat/plugin-options.js.map +1 -1
  284. package/dist/server/agent-chat/prompt-resources.js +1 -1
  285. package/dist/server/agent-chat/prompt-resources.js.map +1 -1
  286. package/dist/server/agent-chat-plugin.d.ts +2 -1
  287. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  288. package/dist/server/agent-chat-plugin.js +79 -56
  289. package/dist/server/agent-chat-plugin.js.map +1 -1
  290. package/dist/server/realtime-token.d.ts +1 -1
  291. package/dist/templates/default/.agents/skills/secrets/SKILL.md +19 -7
  292. package/dist/templates/headless/.agents/skills/secrets/SKILL.md +19 -7
  293. package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +18 -7
  294. package/dist/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +15 -14
  295. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +19 -7
  296. package/dist/vite/client.d.ts.map +1 -1
  297. package/dist/vite/client.js +1 -0
  298. package/dist/vite/client.js.map +1 -1
  299. package/docs/content/agent-native-toolkit.mdx +13 -6
  300. package/docs/content/cloneable-saas.mdx +5 -5
  301. package/docs/content/creating-templates.mdx +9 -0
  302. package/docs/content/deployment.mdx +18 -12
  303. package/docs/content/doctor.mdx +8 -1
  304. package/docs/content/drop-in-agent.mdx +1 -1
  305. package/docs/content/extensions.mdx +18 -18
  306. package/docs/content/faq.mdx +4 -4
  307. package/docs/content/key-concepts.mdx +30 -21
  308. package/docs/content/security.mdx +2 -2
  309. package/docs/content/template-brain-developers.mdx +4 -1
  310. package/docs/content/template-mail-developers.mdx +4 -1
  311. package/docs/content/what-is-agent-native.mdx +6 -6
  312. package/package.json +3 -3
  313. package/src/a2a/client.ts +449 -66
  314. package/src/a2a/correlation.ts +31 -0
  315. package/src/a2a/invoke.ts +4 -2
  316. package/src/a2a/types.ts +4 -0
  317. package/src/action.ts +3 -0
  318. package/src/agent/action-continuation-guidance.ts +2 -1
  319. package/src/agent/engine/registry.ts +98 -6
  320. package/src/agent/production-agent.ts +151 -18
  321. package/src/agent/run-loop-with-resume.ts +190 -3
  322. package/src/agent/run-manager.ts +117 -41
  323. package/src/agent/thread-debug-history.ts +86 -0
  324. package/src/agent/types.ts +3 -1
  325. package/src/cli/create.ts +11 -1
  326. package/src/cli/templates-meta.ts +2 -2
  327. package/src/client/agent-chat-adapter.ts +91 -13
  328. package/src/client/resources/McpIntegrationDialog.tsx +11 -9
  329. package/src/client/sse-event-processor.ts +17 -3
  330. package/src/db/client.ts +57 -17
  331. package/src/guards/no-env-credentials.ts +2 -0
  332. package/src/integrations/adapters/slack.ts +8 -3
  333. package/src/localization/default-messages.ts +44 -0
  334. package/src/observability/traces.ts +78 -5
  335. package/src/scripts/call-agent.ts +294 -11
  336. package/src/scripts/describe-workspace-apps.ts +2 -2
  337. package/src/secrets/crypto.ts +156 -35
  338. package/src/secrets/storage.ts +64 -26
  339. package/src/server/agent-capabilities.ts +1 -1
  340. package/src/server/agent-chat/action-filters-a2a.ts +113 -7
  341. package/src/server/agent-chat/context-tools.ts +2 -0
  342. package/src/server/agent-chat/plugin-options.ts +34 -1
  343. package/src/server/agent-chat/prompt-resources.ts +1 -1
  344. package/src/server/agent-chat-plugin.ts +91 -59
  345. package/src/templates/default/.agents/skills/secrets/SKILL.md +19 -7
  346. package/src/templates/headless/.agents/skills/secrets/SKILL.md +19 -7
  347. package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +18 -7
  348. package/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +15 -14
  349. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +19 -7
  350. package/src/vite/client.ts +1 -0
@@ -30,23 +30,25 @@ being rebuilt in slightly different ways every time.
30
30
  />
31
31
  </WireframeBlock>
32
32
 
33
- <Diagram id="doc-block-toolkits-boundary" title="How kits fit" summary={"The framework runtime supplies durable guarantees. Toolkit turns those guarantees into reusable product systems. Apps add domain-specific data, routes, and visual identity."}>
33
+ <Diagram id="doc-block-toolkits-boundary" title="How the three layers fit" summary={"Core is the framework foundation. Toolkit is optional reusable infrastructure and UI. Templates are optional apps built on Core, often using Toolkit."}>
34
34
 
35
35
  ```html
36
36
  <div class="diagram-row">
37
37
  <div class="diagram-card">
38
- <span class="diagram-pill accent">Runtime</span><br />
39
- actions, SQL, auth, app state, access checks, realtime transport
38
+ <span class="diagram-pill accent">Core</span><br />
39
+ framework runtime: actions, SQL, auth, app state, access checks, live sync
40
40
  </div>
41
41
  <div class="diagram-arrow diagram-muted" aria-hidden="true">&rarr;</div>
42
42
  <div class="diagram-card">
43
43
  <span class="diagram-pill accent">Toolkit</span><br />
44
- collaboration, sharing, setup, review, history, observability
44
+ optional reusable pieces: collaboration, sharing, setup, review, history,
45
+ observability
45
46
  </div>
46
47
  <div class="diagram-arrow diagram-muted" aria-hidden="true">&rarr;</div>
47
48
  <div class="diagram-card">
48
- <span class="diagram-pill accent">Apps</span><br />
49
- domain schema, routes, actions, branding, specialized workflows
49
+ <span class="diagram-pill accent">Templates</span><br />
50
+ optional apps: domain schema, routes, actions, branding, specialized
51
+ workflows
50
52
  </div>
51
53
  </div>
52
54
  ```
@@ -70,6 +72,11 @@ being rebuilt in slightly different ways every time.
70
72
 
71
73
  </Diagram>
72
74
 
75
+ Core is the framework. Toolkit is an optional shelf of reusable pieces for the
76
+ framework. Templates are optional apps built on Core; they can use Toolkit and
77
+ can be forked and used as complete starting points. An app can also use Core
78
+ directly without adopting Toolkit or a template.
79
+
73
80
  ## Catalog {#catalog}
74
81
 
75
82
  | Area | Start here | What it covers |
@@ -216,28 +216,28 @@ The path from "I want my own SaaS" to "I have my own SaaS" is short:
216
216
 
217
217
  1. **Pick an example app.** Use the CLI picker, or browse the docs and pick one to start from.
218
218
  2. **Brand it.** Change the name, colors, logo, and copy. Most example apps expose this in a single config file.
219
- 3. **Customize it.** Ask the agent to add the column you need, change how the inbox groups, connect to your internal API, add a new view. The agent edits the code; you review the diff.
219
+ 3. **Customize it.** Make source changes in your own repository and development workflow. An agent can help when its frame is intentionally granted workspace and write tooling; otherwise the embedded agent operates the resulting app through its actions, data, and configured integrations.
220
220
  4. **Ship it.** Run the deploy command. You now have your own production SaaS at your own domain.
221
221
 
222
- Steps 2–4 typically take days, not months. Step 3 is open-ended your customized SaaS evolves over time, in plain English, by talking to the agent.
222
+ Steps 2–4 typically take days, not months. Step 3 is open-ended because the app is yours to evolve, while the embedded agent remains available to operate the deployed product and can assist with source changes when code access is explicitly enabled.
223
223
 
224
224
  ## Why this is practical {#why}
225
225
 
226
226
  A separate-codebase-per-user model breaks down at scale: every user maintaining their own inbox sounds like a maintenance nightmare. Two framework decisions make it work:
227
227
 
228
- 1. **The agent does the maintenance.** You don't write code to add a column or wire a new integration you ask the agent. So "your own customized inbox" is a feature, not a burden.
228
+ 1. **The app keeps the framework contract.** Your source owns the domain behavior, while Core keeps actions, SQL, state, and sync consistent as the app evolves.
229
229
  2. **Per-user customization without per-user code.** Skills, memory, instructions, connected MCP servers, and sub-agents all live in SQL. Every user gets their own customization layer; the shared codebase hosts all of them at once.
230
230
 
231
231
  The result: Claude-Code-level flexibility for each user, with normal SaaS deployment economics.
232
232
 
233
- <Diagram id="doc-block-bhg7mw" title="Why per-user customization scales" summary={"Two ideas keep the start-from-a-working-app model practical: the agent does the maintenance, and per-user customization lives in SQL — not in per-user code."}>
233
+ <Diagram id="doc-block-bhg7mw" title="Why per-user customization scales" summary={"Two ideas keep the start-from-a-working-app model practical: the app keeps the framework contract, and per-user customization lives in SQL — not in per-user code."}>
234
234
 
235
235
  ```html
236
236
  <div class="diagram-why">
237
237
  <div class="diagram-panel" data-rough>
238
238
  <strong>Shared codebase</strong
239
239
  ><small class="diagram-muted">one app, deployed once</small>
240
- <div class="diagram-pill accent">agent does the maintenance</div>
240
+ <div class="diagram-pill accent">app keeps the framework contract</div>
241
241
  </div>
242
242
  <div class="diagram-arrow diagram-muted" aria-hidden="true">&harr;</div>
243
243
  <div class="diagram-panel" data-rough>
@@ -14,6 +14,15 @@ shadcn-style primitives, toast/mobile hooks, date pickers, and simple app shell
14
14
  slots. Keep template-specific variants local when they encode product behavior
15
15
  or visual identity.
16
16
 
17
+ Keep the three layers in mind when deciding where a capability belongs:
18
+
19
+ - **Core - the framework:** the required runtime and data contract every app can use.
20
+ - **Toolkit - optional reusable pieces:** shared UI and product systems that apps can adopt, compose, or fork.
21
+ - **Templates - optional apps:** complete domain products built on Core, commonly using Toolkit, that people can fork and use as starting points.
22
+
23
+ Toolkit and Templates are optional. A template is not the framework itself, and
24
+ Toolkit does not replace Core.
25
+
17
26
  A good template:
18
27
 
19
28
  - Solves one workflow end-to-end, with useful seed data or an empty-state flow.
@@ -536,14 +536,16 @@ Database connection variables (`DATABASE_URL`, `DATABASE_AUTH_TOKEN`, per-app `<
536
536
 
537
537
  These must be set before promoting an app to a real prod deploy. Missing values either fail-closed (the framework refuses to start / refuses to handle requests) or fall back to weaker behavior with a loud warning.
538
538
 
539
- | Variable | Description |
540
- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
541
- | `BETTER_AUTH_SECRET` | 32+ char random string. Signs session cookies AND is the fallback HMAC for `OAUTH_STATE_SECRET` and `SECRETS_ENCRYPTION_KEY`. Hard-required: the framework throws on startup if missing in production. |
542
- | `BETTER_AUTH_URL` | Public origin of this app (e.g. `https://mail.example.com`). Used for cookie domain and OAuth redirect construction. |
543
- | `ANTHROPIC_API_KEY` | API key for the embedded production agent. **In multi-tenant deploys**, the framework refuses to fall back to this when the user has no per-user key — bring-your-own-key is required. Single-tenant self-hosted installs use it as a global key. |
544
- | `OAUTH_STATE_SECRET` | Dedicated HMAC key for OAuth state envelopes (Google, Atlassian, Zoom). Falls back to `BETTER_AUTH_SECRET` when unset, but a dedicated value is recommended so rotating one doesn't invalidate the other. Generate via `openssl rand -hex 32`. |
545
- | `A2A_SECRET` | Shared HMAC for inter-app A2A JSON-RPC. Without it, every A2A endpoint and the `/_agent-native/integrations/process-task` self-fire endpoint return 503 in production. |
546
- | `SECRETS_ENCRYPTION_KEY` | AES-256-GCM key for the encrypted-at-rest secrets vault. Falls back to `BETTER_AUTH_SECRET`. Hard-fails in production when both are unset. |
539
+ | Variable | Description |
540
+ | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
541
+ | `BETTER_AUTH_SECRET` | 32+ char random string. Signs session cookies and is the fallback for `OAUTH_STATE_SECRET` and app-local encrypted values. It is also a legacy read candidate for existing shared vault ciphertext. Hard-required: the framework throws on startup if missing in production. |
542
+ | `BETTER_AUTH_URL` | Public origin of this app (e.g. `https://mail.example.com`). Used for cookie domain and OAuth redirect construction. |
543
+ | `ANTHROPIC_API_KEY` | API key for the embedded production agent. **In multi-tenant deploys**, the framework refuses to fall back to this when the user has no per-user key — bring-your-own-key is required. Single-tenant self-hosted installs use it as a global key. |
544
+ | `OAUTH_STATE_SECRET` | Dedicated HMAC key for OAuth state envelopes (Google, Atlassian, Zoom). Falls back to `BETTER_AUTH_SECRET` when unset, but a dedicated value is recommended so rotating one doesn't invalidate the other. Generate via `openssl rand -hex 32`. |
545
+ | `A2A_SECRET` | Shared HMAC for inter-app A2A JSON-RPC. Without it, every A2A endpoint and the `/_agent-native/integrations/process-task` self-fire endpoint return 503 in production. When no dedicated workspace vault key is set, shared vault ciphertext uses a purpose-derived key from this value, so rotating it also rotates the vault key. |
546
+ | `WORKSPACE_SECRETS_ENCRYPTION_KEY` | Preferred stable AES-256-GCM key for the shared encrypted-at-rest secrets vault. Set the same value in every app that reads the vault. It is separate from app-local OAuth/credential encryption, so A2A trust can rotate without stranding vault rows. Existing A2A-, Better Auth-, and app-key ciphertext is migrated on successful reads. |
547
+ | `WORKSPACE_SECRETS_ENCRYPTION_KEY_PREVIOUS` | Optional previous workspace vault key used only during a rotation window. Deploy it alongside the new `WORKSPACE_SECRETS_ENCRYPTION_KEY`, let successful reads re-encrypt rows, then remove it after migration. |
548
+ | `SECRETS_ENCRYPTION_KEY` | Legacy combined key for app-local encryption and the shared vault. It remains supported, but new multi-app deployments should use `WORKSPACE_SECRETS_ENCRYPTION_KEY` for the shared vault so changing workspace encryption does not change app-local OAuth ciphertext. |
547
549
 
548
550
  ### Auth & Identity {#env-auth}
549
551
 
@@ -563,13 +565,13 @@ Inside a workspace, the root `.env` is loaded into every app automatically, so s
563
565
 
564
566
  ### Generating Strong Secrets {#env-generate-secrets}
565
567
 
566
- For any secret marked "32+ char random" (`BETTER_AUTH_SECRET`, `OAUTH_STATE_SECRET`, `A2A_SECRET`, `SECRETS_ENCRYPTION_KEY`, `AGENT_NATIVE_BUILDER_RELAY_SECRET`), generate fresh values with:
568
+ For any secret marked "32+ char random" (`BETTER_AUTH_SECRET`, `OAUTH_STATE_SECRET`, `A2A_SECRET`, `WORKSPACE_SECRETS_ENCRYPTION_KEY`, `SECRETS_ENCRYPTION_KEY`, `AGENT_NATIVE_BUILDER_RELAY_SECRET`), generate fresh values with:
567
569
 
568
570
  ```bash
569
571
  openssl rand -hex 32
570
572
  ```
571
573
 
572
- Rotate them by replacing the env var on every instance and redeploying — sessions / OAuth state envelopes signed under the old key become invalid, so users may need to sign in again.
574
+ Rotate signing/session keys by replacing the env var on every instance and redeploying — sessions / OAuth state envelopes signed under the old key become invalid, so users may need to sign in again. Rotate `WORKSPACE_SECRETS_ENCRYPTION_KEY` with the `..._PREVIOUS` window described above so encrypted vault rows remain readable while they migrate.
573
575
 
574
576
  ## Production Agent Tools {#production-agent-tools}
575
577
 
@@ -628,13 +630,17 @@ The `run-code` sandbox is process-level isolation, not an OS container. It strip
628
630
 
629
631
  ## Updating UI in Production {#updating-ui-in-production}
630
632
 
631
- One of agent-native's core features is that the agent can modify your app's source code components, routes, styles, actions. During local development this works seamlessly because the agent has full filesystem access.
633
+ The ordinary deployed app agent works through app toolsactions, database,
634
+ MCP, and configured integrations — rather than receiving ambient access to the
635
+ app's source code. Source changes belong in the repository's development
636
+ workflow. An embedded, local, or Builder frame can edit the repository when
637
+ that frame is intentionally granted workspace and write tooling.
632
638
 
633
639
  In a standard production deployment with [production code execution](#production-code-execution) left off, the agent has access to app tools (actions, database, MCP) but not the filesystem. This means the agent can read and write data, run actions, and interact with external services — but it can't edit your React components or add new routes on a deployed instance.
634
640
 
635
641
  ### Builder.io: Visual Editing in Production {#builderio}
636
642
 
637
- [Builder.io](https://www.builder.io?utm_source=agent-native&utm_medium=docs&utm_campaign=framework&utm_content=deployment) solves this by providing a managed cloud environment where the agent retains the ability to modify your app's UI in production. Connect your repo to Builder.io and prompt for UI changes directly — no redeploy needed.
643
+ [Builder.io](https://www.builder.io?utm_source=agent-native&utm_medium=docs&utm_campaign=framework&utm_content=deployment) is a separate managed code-capable workflow where an agent can modify your app's UI in production. Connect your repo to Builder.io and prompt for UI changes directly — no redeploy needed.
638
644
 
639
645
  **How it works:**
640
646
 
@@ -5,7 +5,14 @@ description: "agent-native doctor scans a generated app's source for the framewo
5
5
 
6
6
  # Doctor (Code Checks)
7
7
 
8
- The agent can write this app's own source code. `agent-native doctor` is the automated check for that: it scans app source for the framework's security-critical code-safety invariants — the same class of check that lives in this framework's own CI as `scripts/guard-*.mjs` — ported to run against a single generated app instead of the framework's multi-template monorepo layout. It's read-only: doctor never edits your code, it only reports.
8
+ Generated apps contain source code that can be changed through the repository's
9
+ development workflow, including by an agent frame intentionally granted
10
+ workspace and write tooling. `agent-native doctor` is the automated check for that: it
11
+ scans app source for the framework's security-critical code-safety invariants —
12
+ the same class of check that lives in this framework's own CI as
13
+ `scripts/guard-*.mjs` — ported to run against a single generated app instead of
14
+ the framework's multi-template monorepo layout. It's read-only: doctor never
15
+ edits your code, it only reports.
9
16
 
10
17
  ## Quick start {#quick-start}
11
18
 
@@ -209,7 +209,7 @@ import { sendToAgentChat } from "@agent-native/core/client/agent-chat";
209
209
  - **`newTab`** — create a separate chat thread for this prompt.
210
210
  - **`background`** — with `newTab`, run without focusing the new thread. The hidden run is tracked in `RunsTray`.
211
211
  - **`openSidebar`** — set to `false` for background/silent sends. Default opens the sidebar so the user sees the response.
212
- - **`type`** — `"content"` (default) keeps the work in the embedded app agent. `"code"` routes to the code-editing frame (for agent-written code changes, see [Frames](/docs/frames)).
212
+ - **`type`** — `"content"` (default) keeps the work in the embedded app agent, which operates through app tools unless its frame is intentionally granted workspace and write tooling. `"code"` routes to a separate code-capable frame (for repository source changes, see [Frames](/docs/frames)).
213
213
 
214
214
  `sendToAgentChat` returns a stable `tabId` you can use to track the chat run.
215
215
 
@@ -30,9 +30,11 @@ The framing matters: an extension isn't a generic "do whatever you want" sandbox
30
30
  its own page or inside a named [slot](#slots) exposed by the template. It
31
31
  cannot inject elements into arbitrary native components — for example, beside
32
32
  every attendee in Calendar — unless the template exposes a slot there. For
33
- deeper customization, ask the agent to edit the template's source code. Full
34
- code customization is a core Agent Native capability; extensions are the
35
- fast, no-deploy layer.
33
+ deeper customization, change the template in your own repository and
34
+ development workflow. An embedded, development, or Builder frame may assist
35
+ when it is intentionally granted workspace and write tooling; otherwise the
36
+ embedded app agent works through app tools. Extensions remain the fast,
37
+ no-deploy layer for runtime customization.
36
38
 
37
39
  </Callout>
38
40
 
@@ -652,13 +654,11 @@ Extensions are private to the user who created them by default. To share:
652
654
 
653
655
  Shared extensions have their own URLs and plug into the same share dialog as documents, decks, and dashboards. Slot installs are always personal — sharing an extension means others _can_ install it; it doesn't auto-pin it to their UI.
654
656
 
655
- ## Should I use an extension or edit the app code? {#vs-app-code}
657
+ ## Should I use an extension or the app source workflow? {#vs-app-code}
656
658
 
657
- The framework lets the agent edit the app's source code directly — components,
658
- routes, styles, and business logic. Use this question when either path could
659
- solve the request:
659
+ Use this question when either path could solve the request:
660
660
 
661
- - **Start with app code** for product behavior, native UI, layout, routes,
661
+ - **Use the source workflow** for product behavior, native UI, layout, routes,
662
662
  business logic, or anything that should be reused across dashboards or users.
663
663
  - **Use a custom block only when the app opts in** and the user explicitly wants
664
664
  a bespoke, one-off visualization or interaction in an existing extension
@@ -669,19 +669,19 @@ solve the request:
669
669
  source-change workflow. Keep the original block in place until the code
670
670
  change is reviewed and deployed.
671
671
 
672
- | | Extension | App code edit |
673
- | --------------------- | ------------------------------ | ------------------------------ |
674
- | **Created by** | Agent (or user) at runtime | Agent editing source files |
675
- | **Stored in** | The database | The git repository |
676
- | **Requires a build** | No | Yes |
677
- | **Requires a deploy** | No | Yes |
678
- | **Scope** | One user (or shared with org) | The entire product, every user |
679
- | **Best for** | Explicit one-off custom blocks | Durable product behavior |
672
+ | | Extension | App source workflow |
673
+ | --------------------- | ------------------------------ | ---------------------------------------- |
674
+ | **Created by** | Agent (or user) at runtime | User or intentionally code-enabled agent |
675
+ | **Stored in** | The database | The git repository |
676
+ | **Requires a build** | No | Yes |
677
+ | **Requires a deploy** | No | Yes |
678
+ | **Scope** | One user (or shared with org) | The entire product, every user |
679
+ | **Best for** | Explicit one-off custom blocks | Durable product behavior |
680
680
 
681
- Rule of thumb: **default to app code.** In an app that explicitly enables
681
+ Rule of thumb: **use an extension for runtime customization.** In an app that explicitly enables
682
682
  extensions, a one-off custom visualization on a dashboard can be a Custom
683
683
  Block; a new pie, multi-bar, or line chart type that should be available across
684
- dashboards belongs in the template code.
684
+ dashboards belongs in the template source and normal development workflow.
685
685
 
686
686
  If what you actually need is a cached, refreshable data source for an existing chart or table — not a new interactive widget — see [Data Programs](/docs/data-programs) instead; it shares this page's sandbox and security posture but has no UI of its own.
687
687
 
@@ -26,7 +26,7 @@ Agent-native is for people who want a real app and an AI agent to work from the
26
26
 
27
27
  ### How is this different from adding AI to an existing app? {#how-is-this-different}
28
28
 
29
- Most apps bolt AI on as an afterthought that can't actually _do_ things in the app. In an agent-native app the agent is a first-class citizen that shares the same actions, database, and state as the UI, so it can do anything the buttons can — and modify the app's own code. See [What Is Agent-Native?](/docs/what-is-agent-native#the-ladder).
29
+ Most apps bolt AI on as an afterthought that can't actually _do_ things in the app. In an agent-native app the agent is a first-class citizen that shares the same actions, database, and state as the UI, so it can do anything the buttons can. See [What Is Agent-Native?](/docs/what-is-agent-native#the-ladder).
30
30
 
31
31
  <Diagram id="doc-block-1s6b04" title="Bolted-on AI vs. agent-native" summary="A bolted-on chat sidebar lives in its own world. An agent-native agent shares the same actions, database, and state as the UI.">
32
32
 
@@ -126,7 +126,7 @@ The framework ships with production-ready templates including [Chat](/docs/templ
126
126
 
127
127
  ### Can I customize templates? {#can-i-customize-templates}
128
128
 
129
- That's the whole point. Start from 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.
129
+ That's the whole point. Start from a template and customize it in your own repository and development workflow. "Add a priority field to forms." "Connect to our Salesforce instance." "Change the color scheme to match our brand." An agent can edit the source when its frame is intentionally granted workspace and write tooling; otherwise the embedded agent operates the resulting app through its actions and data surface.
130
130
 
131
131
  ### Can I build something the templates don't cover? {#build-from-scratch}
132
132
 
@@ -138,9 +138,9 @@ Yes — install a skill into a coding agent you already use with one command and
138
138
 
139
139
  ## Agent capabilities {#agent-capabilities}
140
140
 
141
- ### Can the agent really modify the app's own code? {#can-the-agent-modify-code}
141
+ ### Does the embedded agent edit the app's source code? {#can-the-agent-modify-code}
142
142
 
143
- 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. Everything is normal Git-tracked code, so bad changes are easy to revert.
143
+ Not by default. The embedded agent normally works through actions, SQL-backed state, and configured integrations. It can edit components, routes, styles, or actions only when its frame is intentionally granted repository workspace and write tooling. Otherwise use your normal development workflow or a separate code-capable development/Builder frame. For runtime customization without source changes, use [Extensions](/docs/extensions).
144
144
 
145
145
  ### Can users talk to the agent from outside the app? {#external-channels}
146
146
 
@@ -1,19 +1,31 @@
1
1
  ---
2
2
  title: "Key Concepts"
3
- description: "How agent-native apps work: actions first, SQL database, app-agent loop, optional UI, polling sync, external-agent entry points, context awareness, and portability."
3
+ description: "How agent-native apps work across three layers: the Core framework, optional Toolkit building blocks, and optional Templates, plus the shared actions, SQL database, app-agent loop, and portability contract."
4
4
  ---
5
5
 
6
6
  # Key Concepts
7
7
 
8
8
  How agent-native apps work under the hood — the principles and the architecture. This page is the contract; for the vision and the case for building this way, see [What Is Agent-Native?](/docs/what-is-agent-native).
9
9
 
10
+ ## The three layers {#three-layers}
11
+
12
+ Agent Native is a framework, not a single template. It has three layers:
13
+
14
+ | Layer | What it is |
15
+ | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16
+ | **Core - the framework** | The foundational runtime contract: actions, SQL and Drizzle helpers, auth, application state, agent execution, access checks, routing, and live sync. Every app can use Core directly. |
17
+ | **Toolkit - optional reusable pieces for the framework** | Shared app-building UI and product systems such as primitives, editors, sharing, collaboration, settings, and agent UX. Apps can use, compose, or fork the pieces they need. |
18
+ | **Templates - optional apps built on Core** | Complete, domain-specific apps with routes, schema, actions, instructions, and visual identity. First-party and custom templates commonly use Toolkit, and can be forked and used as starting points. |
19
+
20
+ Core is the foundation. Toolkit and Templates are optional: a template can use Toolkit, but Toolkit is not required to build an app on Core.
21
+
10
22
  ## The architecture {#the-architecture}
11
23
 
12
- Every agent-native app is three things working together:
24
+ At runtime, every agent-native app is three things working together:
13
25
 
14
- - **Agent** — Autonomous AI that reads data, writes data, runs actions, and modifies code. Customizable with skills and instructions.
26
+ - **Agent** — Autonomous AI that reads data, writes data, runs actions, and uses configured tools. It can also modify source when its frame is intentionally granted workspace and write tooling. Customizable with skills and instructions.
15
27
  - **Application** — The product surface around the agent. This may start as chat, add native inline results, grow into a small control plane, or become a full React UI with dashboards, flows, and visualizations.
16
- - **Computer** — Database, browser, code execution. Agents work directly with SQL and built-in tools; MCP servers are optional add-ons, not the foundation.
28
+ - **Computer** — Database, browser, and configured tool runtimes. Agents work through the app's action and data surface; MCP servers are optional add-ons, not the foundation.
17
29
 
18
30
  <Diagram id="doc-block-t1f7pj" title="Agent, application, and computer" summary="Three layers working together over one shared SQL store. The agent and the application both read and write the same data.">
19
31
 
@@ -23,7 +35,7 @@ Every agent-native app is three things working together:
23
35
  <div class="diagram-card">
24
36
  <span class="diagram-pill accent">Agent</span
25
37
  ><small class="diagram-muted"
26
- >reads + writes data, runs actions, modifies code</small
38
+ >reads + writes data, runs actions, uses configured tools</small
27
39
  >
28
40
  </div>
29
41
  <div class="diagram-card">
@@ -114,14 +126,13 @@ a `customer-research` skill might tell the agent which sources to inspect and
114
126
  how to summarize evidence, while `search-crm` and `create-brief` actions fetch
115
127
  and write the actual data.
116
128
 
117
- Six rules govern the architecture:
129
+ Five rules govern the architecture:
118
130
 
119
131
  1. **Data lives in SQL** — all app state lives in the database via Drizzle ORM
120
132
  2. **All AI goes through the agent** — no inline LLM calls
121
133
  3. **Actions for agent operations** — complex work runs as actions
122
134
  4. **Live sync keeps the UI in sync** — database changes stream over SSE with polling as the universal fallback
123
- 5. **The agent can modify code** — the app evolves as you use it
124
- 6. **Application state in SQL** — ephemeral UI state lives in the database, readable by both agent and UI
135
+ 5. **Application state in SQL** — ephemeral UI state lives in the database, readable by both agent and UI
125
136
 
126
137
  ## The four-area checklist {#four-area-checklist}
127
138
 
@@ -267,8 +278,8 @@ sendToAgentChat({
267
278
  Why not call an LLM inline?
268
279
 
269
280
  - **AI is non-deterministic.** You need conversation flow to give feedback and iterate — not one-shot buttons.
270
- - **Context matters.** The agent has your full codebase, instructions, skills, and history. An inline call has none of that.
271
- - **The agent can do more.** It can run actions, browse the web, modify code, and chain multiple steps together.
281
+ - **Context matters.** The agent has the app's instructions, skills, and history. An inline call has none of that.
282
+ - **The agent can do more.** It can run actions, browse the web, and chain multiple steps together.
272
283
  - **External execution.** Because everything goes through the agent and actions, any app can be driven from Slack, Telegram, scheduled jobs, scripts, or another agent via [A2A](/docs/a2a-protocol).
273
284
 
274
285
  ## Actions system {#actions-system}
@@ -397,17 +408,15 @@ Implement a domain operation once as an action; the framework exposes it to ever
397
408
 
398
409
  For the full protocol/surface matrix (MCP server and OAuth, MCP Apps, A2A, deep links, native chat widgets, Generative UI, AgentChatRuntime connectors, Agent Web, and the adapter horizon for ACP and A2UI), and for choosing a product shape — chat, inline UI, full app pages, embedded sidecar, automation, or external-agent access — see [Agent Surfaces](/docs/agent-surfaces).
399
410
 
400
- ## Agent modifies code {#agent-modifies-code}
401
-
402
- This is a feature, not a bug. The agent can safely edit the app's source code: components, routes, styles, actions.
403
-
404
- There's no shared codebase to break. You own the app, and the agent evolves it for you over time:
411
+ ## App code and customization {#agent-modifies-code}
405
412
 
406
- 1. Start from a template (e.g. the analytics template)
407
- 2. Customize it by asking the agent
408
- 3. "Add a new chart type for cohort analysis" — the agent builds it
409
- 4. "Connect to our Stripe account" the agent writes the integration
410
- 5. Your app keeps improving without manual development
413
+ The framework does not grant the embedded agent ambient access to an app's
414
+ source code. In a deployed app, the agent normally works through actions,
415
+ SQL-backed state, and configured integrations. It can edit components, routes,
416
+ styles, and actions when its frame is intentionally granted workspace and write
417
+ tooling. Templates are complete apps that you can fork and customize in your
418
+ own repository and development workflow either way. For runtime customization
419
+ without source changes, use [Extensions](/docs/extensions).
411
420
 
412
421
  ## Portable by default {#hosting-agnostic}
413
422
 
@@ -430,7 +439,7 @@ These sit on top of the same contract and have their own deep dives:
430
439
 
431
440
  ## What you get for free {#what-you-get-for-free}
432
441
 
433
- Adopting the framework is valuable mostly because of what you stop having to build. The moment your app follows the six rules, you inherit:
442
+ Adopting the framework is valuable mostly because of what you stop having to build. The moment your app follows the five rules, you inherit:
434
443
 
435
444
  - **One action = every surface.** Every action defined with `defineAction()` is simultaneously an agent tool, a typesafe frontend hook (`useActionQuery` / `useActionMutation`), a framework-owned HTTP transport, a CLI command, an MCP tool for external clients, and an A2A tool for other agent-native apps. Optional `link` and `mcpApp` metadata add deep links and MCP Apps UI without a second implementation.
436
445
  - **A full set of agent resources per user.** Skills, shared `LEARNINGS.md`, personal `memory/MEMORY.md`, `AGENTS.md`, custom sub-agents, scheduled jobs, connected MCP servers — all SQL-backed, no dev-box required. See [Agent Resources](/docs/agent-resources).
@@ -320,7 +320,7 @@ pnpm action db-check-scoping --require-org # Also require org_id
320
320
  | OAuth tokens (Google, GitHub) | `oauth_tokens` store via `saveOAuthTokens()` |
321
321
  | Session tokens | Automatic (Better Auth handles this) |
322
322
 
323
- Per-user/per-org credentials and the vault are encrypted at rest with AES-256-GCM. For a per-user/per-org credential, the key precedence is `<APP_NAME>_SECRETS_ENCRYPTION_KEY` (app-scoped — useful in a multi-app workspace where apps shouldn't share one key) → `SECRETS_ENCRYPTION_KEY` → `BETTER_AUTH_SECRET`; production refuses to start without one of these set. The shared workspace vault (`app_secrets`, meant to decrypt the same in sibling apps) checks `SECRETS_ENCRYPTION_KEY` / `BETTER_AUTH_SECRET` first, then on a hosted workspace deploy falls back further to material derived from `A2A_SECRET`, and only then to the app-scoped key as a last resort. To encrypt any pre-existing plaintext credential rows in place, run `pnpm action db-migrate-encrypt-credentials` (idempotent, non-destructive).
323
+ Per-user/per-org credentials and the vault are encrypted at rest with AES-256-GCM. For a per-user/per-org credential, the key precedence is `<APP_NAME>_SECRETS_ENCRYPTION_KEY` (app-scoped — useful in a multi-app workspace where apps shouldn't share one key) → `SECRETS_ENCRYPTION_KEY` → `BETTER_AUTH_SECRET`; production refuses to start without one of these set. The shared workspace vault (`app_secrets`, meant to decrypt the same in sibling apps) prefers `WORKSPACE_SECRETS_ENCRYPTION_KEY`, then the legacy combined `SECRETS_ENCRYPTION_KEY`, then material derived from `A2A_SECRET`, with `BETTER_AUTH_SECRET` and the app-scoped key retained as compatibility candidates. Successful fallback reads compare-and-swap re-encrypt the shared column under the preferred key. During a workspace-key rotation, set `WORKSPACE_SECRETS_ENCRYPTION_KEY_PREVIOUS` to the old value until reads have migrated existing rows. To encrypt any pre-existing plaintext credential rows in place, run `pnpm action db-migrate-encrypt-credentials` (idempotent, non-destructive).
324
324
 
325
325
  Never store secrets in `settings`, `application_state`, source code, or action responses. Use the credential / vault APIs above — they handle both encryption and per-user scoping.
326
326
 
@@ -365,7 +365,7 @@ Google Docs Pub/Sub push notifications don't go through that generic adapter gat
365
365
  - [ ] `BETTER_AUTH_SECRET` set to a random 32+ char string (`openssl rand -hex 32`), unless this is a hosted workspace deploy deriving it from `A2A_SECRET`
366
366
  - [ ] `OAUTH_STATE_SECRET` set to a separate random 32+ char string (don't reuse `BETTER_AUTH_SECRET`) — see [OAuth State Signing](#oauth-state)
367
367
  - [ ] `A2A_SECRET` set on every app that calls or receives A2A traffic — see [A2A Identity Verification](#a2a-identity)
368
- - [ ] `SECRETS_ENCRYPTION_KEY` set (or rely on the `BETTER_AUTH_SECRET` fallback) — see [Secrets Management](#secrets)
368
+ - [ ] `WORKSPACE_SECRETS_ENCRYPTION_KEY` set consistently for multi-app shared vaults; app-local encryption still has `SECRETS_ENCRYPTION_KEY` / `BETTER_AUTH_SECRET` fallbacks — see [Secrets Management](#secrets)
369
369
  - [ ] `AUTH_SKIP_EMAIL_VERIFICATION` is **not** set in production (or set only on QA preview deploys)
370
370
 
371
371
  ### Webhook secrets (set the ones for integrations you use)
@@ -366,7 +366,10 @@ Brain follows the agent-native four-area contract — change behavior by editing
366
366
  - `templates/brain/AGENTS.md` — top-level agent guide. Update when you add major features.
367
367
  - `templates/brain/server/db/schema.ts` — data model. Additive migrations only.
368
368
 
369
- Ask the agent to make changes for you it can edit its own source. See [Self-Modifying Code](/docs/key-concepts#agent-modifies-code).
369
+ Make these changes in the repository's development workflow. The embedded app
370
+ agent can edit source when its frame is intentionally granted workspace and
371
+ write tooling; otherwise it operates the resulting app through its actions and
372
+ data surface. See [Key Concepts](/docs/key-concepts#agent-modifies-code).
370
373
 
371
374
  ## What's next
372
375
 
@@ -343,7 +343,10 @@ Mail is yours to change. Everything important lives in a handful of places — s
343
343
 
344
344
  **Changing keyboard shortcuts.** Keybind handlers live in `templates/mail/app/components/email/` — search for `useHotkeys` or `addEventListener("keydown"` to find where each key is wired.
345
345
 
346
- Ask the agent to make any of these changes for you. The agent can edit its own source — see [Self-Modifying Code](/docs/key-concepts#agent-modifies-code).
346
+ Make these changes in the repository's development workflow. The embedded app
347
+ agent can edit source when its frame is intentionally granted workspace and
348
+ write tooling; otherwise it operates the resulting app through its actions and
349
+ data surface. See [Key Concepts](/docs/key-concepts#agent-modifies-code).
347
350
 
348
351
  ## What's next
349
352
 
@@ -313,11 +313,11 @@ See [Agent Resources](/docs/agent-resources) for the full concept.
313
313
 
314
314
  ## Whole-team development {#whole-team-development}
315
315
 
316
- Agent-native isn't just for developers. Because the agent can edit the app's own code, evolving an app stops being a developer-only activity:
316
+ Agent-native isn't just for developers. The embedded agent gives the whole team a shared way to operate the app, while source-code changes remain part of the app's normal development workflow and can be delegated to a frame intentionally granted workspace and write tooling:
317
317
 
318
- - **Designers** update designs directly in the running app through the agent
319
- - **Product managers** add functionality and update flows by describing them
320
- - **QA** tests the app and asks the agent to fix what's broken
318
+ - **Designers** update app data and workflows directly through the agent
319
+ - **Product managers** configure workflows and describe changes for the development team
320
+ - **QA** tests the app and reports what's broken through the agent
321
321
  - **Anyone on the team** contributes through natural language
322
322
 
323
323
  The vision: fewer handoffs, one person doing the work of a small team.
@@ -329,10 +329,10 @@ Agent-native apps follow a start-from-a-working-app model. You start from a **te
329
329
  1. Pick a template on [agent-native.com/templates](/templates)
330
330
  2. Use it immediately as a hosted app (e.g. mail.agent-native.com)
331
331
  3. Create your own app from the template when you want to customize — "connect our Stripe account," "add a cohort chart"
332
- 4. The agent modifies the code to match your needs
332
+ 4. Customize the source in your own repository and development workflow
333
333
  5. Deploy your app to your own domain — or stay on agent-native.com
334
334
 
335
- Because it's _your_ app, not shared infrastructure, the agent can safely evolve the code. Your app keeps improving as you use it. See [Templates](/docs/cloneable-saas) for the full story.
335
+ Because it's _your_ app, not shared infrastructure, you own its source and can evolve it without changing the shared framework. The embedded agent operates the deployed app through its actions and data surface by default, and can modify source when its frame is explicitly code-enabled. See [Templates](/docs/cloneable-saas) for the full story.
336
336
 
337
337
  Not ready to start from a whole template? You can also try agent-native by adding a **skill** to a coding agent you already use — install the Plans skill with `npx @agent-native/core@latest skills add visual-plan`. See the [Skills Guide](/docs/skills-guide#app-backed-skills).
338
338
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.131.5",
3
+ "version": "0.131.7",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -395,8 +395,8 @@
395
395
  "y-protocols": "^1.0.7",
396
396
  "yjs": "^13.6.31",
397
397
  "zod": "^4.3.6",
398
- "@agent-native/recap-cli": "0.5.1",
399
- "@agent-native/toolkit": "^0.11.1"
398
+ "@agent-native/toolkit": "^0.12.0",
399
+ "@agent-native/recap-cli": "0.5.1"
400
400
  },
401
401
  "devDependencies": {
402
402
  "@ai-sdk/anthropic": "^3.0.71",