@agent-native/core 0.106.3 → 0.107.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 (292) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +23 -0
  3. package/corpus/core/docs/content/integrations.mdx +597 -0
  4. package/corpus/core/docs/content/locales/ar-SA/mcp-clients.mdx +19 -1
  5. package/corpus/core/docs/content/locales/de-DE/mcp-clients.mdx +22 -1
  6. package/corpus/core/docs/content/locales/es-ES/mcp-clients.mdx +23 -1
  7. package/corpus/core/docs/content/locales/fr-FR/mcp-clients.mdx +23 -1
  8. package/corpus/core/docs/content/locales/hi-IN/mcp-clients.mdx +22 -1
  9. package/corpus/core/docs/content/locales/ja-JP/mcp-clients.mdx +21 -1
  10. package/corpus/core/docs/content/locales/ko-KR/mcp-clients.mdx +20 -1
  11. package/corpus/core/docs/content/locales/pt-BR/mcp-clients.mdx +22 -1
  12. package/corpus/core/docs/content/locales/zh-CN/mcp-clients.mdx +17 -1
  13. package/corpus/core/docs/content/locales/zh-TW/mcp-clients.mdx +17 -1
  14. package/corpus/core/docs/content/mcp-clients.mdx +51 -1
  15. package/corpus/core/docs/content/organizations-teams-permissions.mdx +413 -0
  16. package/corpus/core/package.json +1 -1
  17. package/corpus/core/src/agent/production-agent.ts +19 -0
  18. package/corpus/core/src/agent/run-store.ts +98 -2
  19. package/corpus/core/src/client/AssistantChat.tsx +26 -1
  20. package/corpus/core/src/client/CommandMenu.tsx +5 -0
  21. package/corpus/core/src/client/active-run-state.ts +34 -0
  22. package/corpus/core/src/client/agent-chat-adapter.ts +4 -0
  23. package/corpus/core/src/client/chat/message-components.tsx +41 -0
  24. package/corpus/core/src/client/composer/TiptapComposer.tsx +45 -8
  25. package/corpus/core/src/client/integrations/IntegrationsPanel.tsx +30 -11
  26. package/corpus/core/src/client/resources/McpConnectionSuggestion.tsx +270 -0
  27. package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +177 -40
  28. package/corpus/core/src/client/resources/mcp-integration-catalog.ts +478 -4
  29. package/corpus/core/src/client/resources/mcp-integration-logos.ts +108 -0
  30. package/corpus/core/src/client/sharing/ShareButton.tsx +30 -9
  31. package/corpus/core/src/client/use-agent-chat-home-handoff.ts +2 -2
  32. package/corpus/core/src/deploy/build.ts +32 -0
  33. package/corpus/core/src/extensions/html-shell.ts +33 -1
  34. package/corpus/core/src/ingestion/office.ts +1 -2
  35. package/corpus/core/src/ingestion/pptx.ts +2 -4
  36. package/corpus/core/src/localization/default-messages.ts +129 -1
  37. package/corpus/core/src/mcp/actions/call-mcp-tool.ts +1 -0
  38. package/corpus/core/src/secrets/register-framework-secrets.ts +28 -0
  39. package/corpus/core/src/server/agent-chat-plugin.ts +29 -1
  40. package/corpus/core/src/server/index.ts +4 -0
  41. package/corpus/core/src/server/org-admin.ts +28 -0
  42. package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +9 -0
  43. package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/references/api.md +31 -0
  44. package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +9 -0
  45. package/corpus/core/src/vite/client.ts +24 -0
  46. package/corpus/templates/analytics/.agents/skills/creative-context/SKILL.md +64 -0
  47. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +29 -21
  48. package/corpus/templates/analytics/AGENTS.md +13 -0
  49. package/corpus/templates/analytics/actions/clone-creative-context-dashboard.ts +86 -0
  50. package/corpus/templates/analytics/actions/dashboard-mutation-api.ts +1 -1
  51. package/corpus/templates/analytics/actions/update-dashboard.ts +6 -2
  52. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +35 -7
  53. package/corpus/templates/analytics/app/components/layout/Layout.tsx +3 -3
  54. package/corpus/templates/analytics/app/i18n/zh-TW.ts +1 -0
  55. package/corpus/templates/analytics/app/i18n-data.ts +1 -0
  56. package/corpus/templates/analytics/app/pages/Ask.tsx +8 -4
  57. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +11 -1
  58. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/extension-slot.ts +11 -0
  59. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +86 -0
  60. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +6 -0
  61. package/corpus/templates/analytics/app/routes/agent.tsx +7 -1
  62. package/corpus/templates/analytics/changelog/2026-07-17-dashboard-extension-boxes.md +6 -0
  63. package/corpus/templates/analytics/changelog/2026-07-17-library-now-flags-published-dashboards-with-newer-versions-a.md +6 -0
  64. package/corpus/templates/analytics/changelog/2026-07-17-resources-can-be-added-to-creative-context-from-their-action.md +6 -0
  65. package/corpus/templates/analytics/changelog/2026-07-17-you-can-add-exact-approved-artifact-versions-to-governed-cre.md +6 -0
  66. package/corpus/templates/analytics/package.json +1 -0
  67. package/corpus/templates/analytics/server/lib/agent-readable-resource-context.ts +8 -0
  68. package/corpus/templates/analytics/server/lib/native-creative-context.ts +158 -0
  69. package/corpus/templates/analytics/server/plugins/agent-chat.ts +1 -0
  70. package/corpus/templates/analytics/server/plugins/creative-context.ts +10 -0
  71. package/corpus/templates/assets/.agents/skills/creative-context/SKILL.md +12 -3
  72. package/corpus/templates/assets/AGENTS.md +5 -0
  73. package/corpus/templates/assets/actions/clone-creative-context-asset.ts +74 -0
  74. package/corpus/templates/assets/app/hooks/use-navigation-state.ts +2 -1
  75. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +308 -178
  76. package/corpus/templates/assets/app/routes/library.tsx +5 -11
  77. package/corpus/templates/assets/changelog/2026-07-17-library-now-flags-published-assets-with-newer-versions-and-l.md +6 -0
  78. package/corpus/templates/assets/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  79. package/corpus/templates/assets/changelog/2026-07-17-you-can-add-exact-approved-artifact-versions-to-governed-cre.md +6 -0
  80. package/corpus/templates/assets/server/lib/native-creative-context.ts +198 -0
  81. package/corpus/templates/assets/server/plugins/creative-context.ts +4 -0
  82. package/corpus/templates/brain/actions/provider-api-request.ts +1 -0
  83. package/corpus/templates/brain/app/hooks/use-navigation-state.ts +6 -1
  84. package/corpus/templates/brain/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  85. package/corpus/templates/calendar/actions/provider-api-request.ts +1 -0
  86. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +1 -1
  87. package/corpus/templates/calendar/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  88. package/corpus/templates/chat/app/hooks/use-navigation-state.ts +4 -1
  89. package/corpus/templates/chat/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  90. package/corpus/templates/clips/actions/get-recording-insights.ts +7 -4
  91. package/corpus/templates/clips/actions/list-recordings.ts +48 -0
  92. package/corpus/templates/clips/actions/list-viewers.ts +2 -1
  93. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +3 -1
  94. package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
  95. package/corpus/templates/clips/app/components/player/share-dialog.tsx +1 -3
  96. package/corpus/templates/clips/app/hooks/use-desktop-promo.ts +11 -6
  97. package/corpus/templates/clips/app/hooks/use-view-tracking.ts +6 -1
  98. package/corpus/templates/clips/app/lib/ffmpeg-export.ts +4 -2
  99. package/corpus/templates/clips/app/routes/share.$shareId.tsx +21 -3
  100. package/corpus/templates/clips/changelog/2026-07-17-dictation-keeps-sentence-spacing-and-no-longer-crashes-when-.md +6 -0
  101. package/corpus/templates/clips/changelog/2026-07-17-shared-clips-now-preserve-editor-access-and-show-editor-insi.md +6 -0
  102. package/corpus/templates/clips/changelog/2026-07-17-stitching-clips-no-longer-fails-when-editor-media-metadata-i.md +6 -0
  103. package/corpus/templates/clips/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  104. package/corpus/templates/clips/server/routes/api/public-recording.get.ts +14 -8
  105. package/corpus/templates/clips/shared/view-analytics.ts +4 -0
  106. package/corpus/templates/content/.agents/skills/creative-context/SKILL.md +12 -3
  107. package/corpus/templates/content/AGENTS.md +5 -0
  108. package/corpus/templates/content/actions/_content-space-access.ts +45 -2
  109. package/corpus/templates/content/actions/clone-creative-context-document.ts +61 -0
  110. package/corpus/templates/content/actions/create-content-database.ts +41 -7
  111. package/corpus/templates/content/actions/provider-api-request.ts +1 -0
  112. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +21 -0
  113. package/corpus/templates/content/app/components/layout/Layout.tsx +1 -1
  114. package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +29 -0
  115. package/corpus/templates/content/app/root.tsx +1 -10
  116. package/corpus/templates/content/changelog/2026-07-17-creating-a-database-now-completes-reliably-in-hosted-workspa.md +6 -0
  117. package/corpus/templates/content/changelog/2026-07-17-library-now-flags-published-documents-with-newer-versions-an.md +6 -0
  118. package/corpus/templates/content/changelog/2026-07-17-resources-can-be-added-to-creative-context-from-their-action.md +6 -0
  119. package/corpus/templates/content/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  120. package/corpus/templates/content/changelog/2026-07-17-you-can-add-exact-approved-artifact-versions-to-governed-cre.md +6 -0
  121. package/corpus/templates/content/parity/matrix.md +1 -1
  122. package/corpus/templates/content/parity/matrix.ts +1 -0
  123. package/corpus/templates/content/server/lib/native-creative-context.ts +191 -0
  124. package/corpus/templates/content/server/plugins/creative-context.ts +8 -1
  125. package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +11 -3
  126. package/corpus/templates/design/AGENTS.md +5 -0
  127. package/corpus/templates/design/actions/clone-creative-context-design-native.ts +111 -0
  128. package/corpus/templates/design/actions/provider-api-request.ts +1 -0
  129. package/corpus/templates/design/app/pages/Index.tsx +44 -0
  130. package/corpus/templates/design/app/pages/design-editor/types.ts +1 -0
  131. package/corpus/templates/design/changelog/2026-07-17-library-now-flags-published-designs-with-newer-versions-and-.md +6 -0
  132. package/corpus/templates/design/changelog/2026-07-17-resources-can-be-added-to-creative-context-from-their-action.md +6 -0
  133. package/corpus/templates/design/changelog/2026-07-17-you-can-add-exact-approved-artifact-versions-to-governed-cre.md +6 -0
  134. package/corpus/templates/design/server/lib/native-creative-context.ts +265 -0
  135. package/corpus/templates/design/server/plugins/creative-context.ts +8 -1
  136. package/corpus/templates/dispatch/actions/provider-api-request.ts +1 -0
  137. package/corpus/templates/dispatch/app/hooks/use-navigation-state.ts +4 -1
  138. package/corpus/templates/dispatch/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  139. package/corpus/templates/forms/app/components/layout/Layout.tsx +2 -4
  140. package/corpus/templates/forms/app/components/ui/popover.tsx +25 -1
  141. package/corpus/templates/forms/app/hooks/use-navigation-state.ts +6 -1
  142. package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +13 -10
  143. package/corpus/templates/forms/app/root.tsx +6 -1
  144. package/corpus/templates/forms/changelog/2026-07-17-form-builder-popovers-stay-within-the-viewport.md +6 -0
  145. package/corpus/templates/forms/changelog/2026-07-17-form-editor-loading-matches-current-sidebar-free-layout.md +6 -0
  146. package/corpus/templates/forms/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  147. package/corpus/templates/mail/actions/provider-api-request.ts +1 -0
  148. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +1 -1
  149. package/corpus/templates/mail/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  150. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +14 -3
  151. package/corpus/templates/plan/app/hooks/use-navigation-state.ts +8 -1
  152. package/corpus/templates/plan/app/root.tsx +0 -2
  153. package/corpus/templates/plan/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  154. package/corpus/templates/slides/.agents/skills/creative-context/SKILL.md +11 -3
  155. package/corpus/templates/slides/AGENTS.md +5 -0
  156. package/corpus/templates/slides/actions/clone-creative-context-deck.ts +96 -0
  157. package/corpus/templates/slides/actions/extract-pdf.ts +3 -2
  158. package/corpus/templates/slides/actions/import-file.ts +3 -2
  159. package/corpus/templates/slides/actions/provider-api-request.ts +1 -0
  160. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +27 -0
  161. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +21 -0
  162. package/corpus/templates/slides/app/components/layout/Layout.tsx +1 -1
  163. package/corpus/templates/slides/app/context/DeckContext.tsx +23 -23
  164. package/corpus/templates/slides/changelog/2026-07-17-duplicated-slides-now-stay-in-the-deck.md +6 -0
  165. package/corpus/templates/slides/changelog/2026-07-17-library-now-flags-published-decks-with-newer-versions-and-le.md +6 -0
  166. package/corpus/templates/slides/changelog/2026-07-17-pdf-and-powerpoint-imports-now-work-reliably-in-hosted-decks.md +6 -0
  167. package/corpus/templates/slides/changelog/2026-07-17-resources-can-be-added-to-creative-context-from-their-action.md +6 -0
  168. package/corpus/templates/slides/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  169. package/corpus/templates/slides/changelog/2026-07-17-you-can-add-exact-approved-artifact-versions-to-governed-cre.md +6 -0
  170. package/corpus/templates/slides/server/lib/native-creative-context.ts +288 -0
  171. package/corpus/templates/slides/server/plugins/creative-context.ts +4 -0
  172. package/corpus/templates/tasks/app/components/layout/Layout.tsx +2 -13
  173. package/corpus/templates/tasks/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it.md +6 -0
  174. package/dist/agent/production-agent.d.ts.map +1 -1
  175. package/dist/agent/production-agent.js +13 -1
  176. package/dist/agent/production-agent.js.map +1 -1
  177. package/dist/agent/run-store.d.ts +17 -0
  178. package/dist/agent/run-store.d.ts.map +1 -1
  179. package/dist/agent/run-store.js +84 -2
  180. package/dist/agent/run-store.js.map +1 -1
  181. package/dist/client/AssistantChat.d.ts.map +1 -1
  182. package/dist/client/AssistantChat.js +18 -3
  183. package/dist/client/AssistantChat.js.map +1 -1
  184. package/dist/client/CommandMenu.d.ts.map +1 -1
  185. package/dist/client/CommandMenu.js +4 -0
  186. package/dist/client/CommandMenu.js.map +1 -1
  187. package/dist/client/active-run-state.d.ts +7 -0
  188. package/dist/client/active-run-state.d.ts.map +1 -1
  189. package/dist/client/active-run-state.js +28 -0
  190. package/dist/client/active-run-state.js.map +1 -1
  191. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  192. package/dist/client/agent-chat-adapter.js +4 -1
  193. package/dist/client/agent-chat-adapter.js.map +1 -1
  194. package/dist/client/chat/message-components.d.ts.map +1 -1
  195. package/dist/client/chat/message-components.js +35 -1
  196. package/dist/client/chat/message-components.js.map +1 -1
  197. package/dist/client/composer/TiptapComposer.d.ts +7 -0
  198. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  199. package/dist/client/composer/TiptapComposer.js +37 -8
  200. package/dist/client/composer/TiptapComposer.js.map +1 -1
  201. package/dist/client/integrations/IntegrationsPanel.d.ts.map +1 -1
  202. package/dist/client/integrations/IntegrationsPanel.js +3 -2
  203. package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
  204. package/dist/client/resources/McpConnectionSuggestion.d.ts +9 -0
  205. package/dist/client/resources/McpConnectionSuggestion.d.ts.map +1 -0
  206. package/dist/client/resources/McpConnectionSuggestion.js +134 -0
  207. package/dist/client/resources/McpConnectionSuggestion.js.map +1 -0
  208. package/dist/client/resources/McpIntegrationDialog.d.ts +2 -1
  209. package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
  210. package/dist/client/resources/McpIntegrationDialog.js +51 -21
  211. package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
  212. package/dist/client/resources/mcp-integration-catalog.d.ts +15 -0
  213. package/dist/client/resources/mcp-integration-catalog.d.ts.map +1 -1
  214. package/dist/client/resources/mcp-integration-catalog.js +420 -4
  215. package/dist/client/resources/mcp-integration-catalog.js.map +1 -1
  216. package/dist/client/resources/mcp-integration-logos.d.ts +2 -0
  217. package/dist/client/resources/mcp-integration-logos.d.ts.map +1 -0
  218. package/dist/client/resources/mcp-integration-logos.js +109 -0
  219. package/dist/client/resources/mcp-integration-logos.js.map +1 -0
  220. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  221. package/dist/client/sharing/ShareButton.js +15 -12
  222. package/dist/client/sharing/ShareButton.js.map +1 -1
  223. package/dist/client/use-agent-chat-home-handoff.d.ts +1 -1
  224. package/dist/client/use-agent-chat-home-handoff.d.ts.map +1 -1
  225. package/dist/client/use-agent-chat-home-handoff.js +1 -1
  226. package/dist/client/use-agent-chat-home-handoff.js.map +1 -1
  227. package/dist/collab/routes.d.ts +1 -1
  228. package/dist/collab/struct-routes.d.ts +1 -1
  229. package/dist/deploy/build.d.ts.map +1 -1
  230. package/dist/deploy/build.js +23 -0
  231. package/dist/deploy/build.js.map +1 -1
  232. package/dist/extensions/html-shell.d.ts.map +1 -1
  233. package/dist/extensions/html-shell.js +33 -1
  234. package/dist/extensions/html-shell.js.map +1 -1
  235. package/dist/ingestion/office.d.ts.map +1 -1
  236. package/dist/ingestion/office.js +1 -2
  237. package/dist/ingestion/office.js.map +1 -1
  238. package/dist/ingestion/pptx.js +2 -4
  239. package/dist/ingestion/pptx.js.map +1 -1
  240. package/dist/localization/default-messages.d.ts +100 -0
  241. package/dist/localization/default-messages.d.ts.map +1 -1
  242. package/dist/localization/default-messages.js +101 -1
  243. package/dist/localization/default-messages.js.map +1 -1
  244. package/dist/mcp/actions/call-mcp-tool.js +1 -0
  245. package/dist/mcp/actions/call-mcp-tool.js.map +1 -1
  246. package/dist/notifications/routes.d.ts +1 -1
  247. package/dist/observability/routes.d.ts +5 -5
  248. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  249. package/dist/resources/handlers.d.ts +1 -1
  250. package/dist/secrets/register-framework-secrets.d.ts.map +1 -1
  251. package/dist/secrets/register-framework-secrets.js +25 -0
  252. package/dist/secrets/register-framework-secrets.js.map +1 -1
  253. package/dist/secrets/routes.d.ts +9 -9
  254. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  255. package/dist/server/agent-chat-plugin.js +23 -1
  256. package/dist/server/agent-chat-plugin.js.map +1 -1
  257. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  258. package/dist/server/index.d.ts +1 -0
  259. package/dist/server/index.d.ts.map +1 -1
  260. package/dist/server/index.js +1 -0
  261. package/dist/server/index.js.map +1 -1
  262. package/dist/server/org-admin.d.ts +3 -0
  263. package/dist/server/org-admin.d.ts.map +1 -0
  264. package/dist/server/org-admin.js +24 -0
  265. package/dist/server/org-admin.js.map +1 -0
  266. package/dist/templates/chat/app/hooks/use-navigation-state.ts +4 -1
  267. package/dist/templates/chat/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  268. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +9 -0
  269. package/dist/templates/workspace-core/.agents/skills/extensions/references/api.md +31 -0
  270. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +9 -0
  271. package/dist/vite/client.d.ts.map +1 -1
  272. package/dist/vite/client.js +20 -0
  273. package/dist/vite/client.js.map +1 -1
  274. package/docs/content/integrations.mdx +597 -0
  275. package/docs/content/locales/ar-SA/mcp-clients.mdx +19 -1
  276. package/docs/content/locales/de-DE/mcp-clients.mdx +22 -1
  277. package/docs/content/locales/es-ES/mcp-clients.mdx +23 -1
  278. package/docs/content/locales/fr-FR/mcp-clients.mdx +23 -1
  279. package/docs/content/locales/hi-IN/mcp-clients.mdx +22 -1
  280. package/docs/content/locales/ja-JP/mcp-clients.mdx +21 -1
  281. package/docs/content/locales/ko-KR/mcp-clients.mdx +20 -1
  282. package/docs/content/locales/pt-BR/mcp-clients.mdx +22 -1
  283. package/docs/content/locales/zh-CN/mcp-clients.mdx +17 -1
  284. package/docs/content/locales/zh-TW/mcp-clients.mdx +17 -1
  285. package/docs/content/mcp-clients.mdx +51 -1
  286. package/docs/content/organizations-teams-permissions.mdx +413 -0
  287. package/package.json +1 -1
  288. package/src/templates/chat/app/hooks/use-navigation-state.ts +4 -1
  289. package/src/templates/chat/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
  290. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +9 -0
  291. package/src/templates/workspace-core/.agents/skills/extensions/references/api.md +31 -0
  292. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +9 -0
@@ -0,0 +1,413 @@
1
+ ---
2
+ title: "Organizations, Teams & Permissions"
3
+ description: "A practical guide to organization context, team roles, resource sharing, RBAC, and the environment variables used by Agent Native apps."
4
+ ---
5
+
6
+ # Organizations, Teams & Permissions
7
+
8
+ If you are building an app for more than one person, start here. Agent Native
9
+ has several scopes that are easy to conflate:
10
+
11
+ | Scope | What it identifies | Where it appears |
12
+ | ---------------- | -------------------------------------------------------------------- | ------------------------------------------------------- |
13
+ | **User** | The signed-in person | `session.email`, `ctx.userEmail` |
14
+ | **Organization** | The team or tenant the person is currently using | `session.orgId`, `session.orgRole`, `ctx.orgId` |
15
+ | **Resource** | A document, dashboard, design, or other app row | `owner_email`, `org_id`, `visibility`, and share grants |
16
+ | **Workspace** | A deployment shape containing multiple apps and shared configuration | `AGENT_NATIVE_WORKSPACE`, shared `.env`, app base paths |
17
+
18
+ An organization is the team boundary for application data. A workspace is a
19
+ deployment and customization concept; it is not a replacement for an
20
+ organization and it does not grant access to application rows by itself.
21
+
22
+ ## The access model in one minute
23
+
24
+ The framework resolves a request in this order:
25
+
26
+ 1. Authentication identifies the user.
27
+ 2. The org module resolves the user's active organization and membership role.
28
+ 3. SQL and resource access helpers scope reads and writes to that identity.
29
+
30
+ ```text
31
+ Better Auth session
32
+ -> active organization: orgId + orgRole
33
+ -> request context: userEmail + orgId
34
+ -> scoped SQL / resource access
35
+ ```
36
+
37
+ The same context is used by the UI, actions, custom server routes, and the
38
+ agent. Hiding a button in React is useful UX, but it is not authorization. The
39
+ server-side action or access guard must enforce the rule.
40
+
41
+ ## Organizations and teams
42
+
43
+ Every scaffold includes the framework's own `org/` module. It is backed by
44
+ `organizations`, `org_members`, and `org_invitations`; it is not Better Auth's
45
+ organization plugin. The built-in flow supports:
46
+
47
+ - Creating an organization. The creator becomes the `owner`.
48
+ - Inviting people as `member` or `admin` and accepting invitations.
49
+ - Switching the active organization when a user belongs to more than one.
50
+ - Joining by an allowed email domain when the organization enables that policy.
51
+ - Renaming an organization, managing members, and managing cross-app A2A
52
+ settings from the team surface.
53
+
54
+ The framework mounts the server surface under `/_agent-native/org/*`. The main
55
+ routes are:
56
+
57
+ | Route | Purpose |
58
+ | ------------------------------------------------ | ------------------------------------------------------------ |
59
+ | `GET /_agent-native/org/me` | Active org, memberships, pending invites, and domain matches |
60
+ | `POST /_agent-native/org` | Create an organization |
61
+ | `PATCH /_agent-native/org` | Rename the active organization |
62
+ | `PUT /_agent-native/org/switch` | Switch the active organization |
63
+ | `GET /_agent-native/org/members` | List members in the active organization |
64
+ | `DELETE /_agent-native/org/members/:email` | Remove a member |
65
+ | `PUT /_agent-native/org/members/:email/role` | Change a member's role |
66
+ | `POST /_agent-native/org/invitations` | Invite one or more people |
67
+ | `POST /_agent-native/org/invitations/:id/accept` | Accept an invitation |
68
+ | `POST /_agent-native/org/join-by-domain` | Join an organization matched by email domain |
69
+ | `PUT /_agent-native/org/domain` | Set or clear the allowed email domain |
70
+ | `PUT /_agent-native/org/a2a-secret` | Set or regenerate the active org's A2A secret |
71
+
72
+ Use the shared UI and hooks instead of recreating this flow in each app:
73
+
74
+ ```tsx
75
+ import {
76
+ OrgSwitcher,
77
+ RequireActiveOrg,
78
+ TeamPage,
79
+ useOrgRole,
80
+ } from "@agent-native/core/client/org-team";
81
+
82
+ export function AppShell() {
83
+ return <OrgSwitcher />;
84
+ }
85
+
86
+ export function TeamSettings() {
87
+ return (
88
+ <RequireActiveOrg>
89
+ <TeamPage />
90
+ </RequireActiveOrg>
91
+ );
92
+ }
93
+
94
+ export function InviteButton() {
95
+ const { canInviteMembers } = useOrgRole();
96
+ return canInviteMembers ? <button>Invite members</button> : null;
97
+ }
98
+ ```
99
+
100
+ On the server, import the org helpers from `@agent-native/core/org-team`.
101
+ `getOrgContext(event)` returns the resolved `{ email, orgId, orgName, role }`.
102
+ For actions, the second `run` argument is the simpler path for the identity
103
+ needed by most app code:
104
+
105
+ ```ts
106
+ export default defineAction({
107
+ description: "Create a project in the active organization.",
108
+ schema: z.object({ name: z.string().min(1) }),
109
+ run: async ({ name }, ctx) => {
110
+ if (!ctx?.userEmail) throw new Error("Authentication required");
111
+
112
+ await db.insert(projects).values({
113
+ id: crypto.randomUUID(),
114
+ name,
115
+ ownerEmail: ctx.userEmail,
116
+ orgId: ctx.orgId,
117
+ });
118
+
119
+ return { ok: true };
120
+ },
121
+ });
122
+ ```
123
+
124
+ The active organization is selected from the user's memberships. For a user
125
+ with several memberships, the framework honors the `active-org-id` user
126
+ setting. If a signed-in user has no membership, the framework creates a
127
+ personal organization by default. Set `AUTO_CREATE_DEFAULT_ORG=0` when an app
128
+ must require an explicit invite or organization-creation step.
129
+
130
+ ## Organization roles (membership RBAC)
131
+
132
+ Organization roles answer: **what may this person do to the team itself?**
133
+
134
+ | Role | Meaning | Typical capabilities |
135
+ | -------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
136
+ | `owner` | Full control of the organization | Manage the organization, members, admins, domain policy, and org-level A2A settings |
137
+ | `admin` | Team administrator | Invite/remove members and manage ordinary member roles; admins cannot change the owner's role, only the owner manages admin-to-admin transitions, and the shared client domain helper is owner-only |
138
+ | `member` | Regular team member | Use resources that the app shares with the organization; cannot manage membership |
139
+
140
+ The shared role helpers are deliberately small and composable:
141
+
142
+ ```ts
143
+ import {
144
+ canInviteOrgMembers,
145
+ canManageOrg,
146
+ canManageOrgDomain,
147
+ orgRoleAtLeast,
148
+ } from "@agent-native/core/org-team";
149
+
150
+ if (!orgRoleAtLeast(role, "admin")) {
151
+ throw new Error("Organization admin role required");
152
+ }
153
+ ```
154
+
155
+ The same helpers are available from
156
+ `@agent-native/core/client/org-team` for presentation logic. Treat those
157
+ client checks as progressive disclosure only; repeat the authorization check
158
+ in the server action or route that changes org state.
159
+
160
+ ## Resource permissions (sharing RBAC)
161
+
162
+ Organization roles and resource roles are different systems:
163
+
164
+ - **Organization role** controls team administration.
165
+ - **Resource role** controls access to one document, dashboard, or other
166
+ shareable row.
167
+
168
+ Shareable resources use three layers together:
169
+
170
+ 1. `owner_email` identifies the creator.
171
+ 2. `org_id` and `visibility` define the resource's tenant and coarse visibility.
172
+ 3. A companion shares table grants a user or organization `viewer`, `editor`,
173
+ or `admin` access.
174
+
175
+ | Resource role | Access |
176
+ | ------------- | ------------------------------ |
177
+ | `viewer` | Read |
178
+ | `editor` | Read and write |
179
+ | `admin` | Read, write, and manage shares |
180
+
181
+ `admin` on a resource does not transfer ownership. The resource owner remains
182
+ separate from every share grant.
183
+
184
+ For new tenant-aware tables, use `ownableColumns()` and the access helpers:
185
+
186
+ ```ts
187
+ import { table, text, ownableColumns } from "@agent-native/core/db/schema";
188
+ import { accessFilter, assertAccess } from "@agent-native/core/sharing";
189
+
190
+ export const projects = table("projects", {
191
+ id: text("id").primaryKey(),
192
+ name: text("name").notNull(),
193
+ ...ownableColumns(), // owner_email + org_id + visibility
194
+ });
195
+
196
+ const visibleProjects = await db
197
+ .select()
198
+ .from(projects)
199
+ .where(accessFilter(projects, projectShares));
200
+
201
+ await assertAccess("project", projectId, "editor");
202
+ ```
203
+
204
+ Use these helpers consistently:
205
+
206
+ - `accessFilter(table, sharesTable)` for list/read queries.
207
+ - `resolveAccess(resourceType, resourceId)` when the action needs to inspect
208
+ the effective access role.
209
+ - `assertAccess(resourceType, resourceId, minRole)` at the top of a write or
210
+ single-record action.
211
+
212
+ The framework's SQL agent tools are scoped as well, but direct Drizzle queries
213
+ in actions and custom routes still need the access helpers. Run
214
+ `pnpm action db-check-scoping` and `pnpm guards` while developing to catch
215
+ missing ownership or unscoped query paths.
216
+
217
+ ## Environment variables: what belongs where
218
+
219
+ Environment variables configure the deployment. They are not a database for
220
+ user or team state.
221
+
222
+ | Store | Use it for | Do not use it for |
223
+ | ------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
224
+ | Server/deploy environment | One value shared by the whole app instance, such as `DATABASE_URL`, auth signing keys, or an A2A secret | A user's API key or a team's mutable setting |
225
+ | `VITE_*` build-time environment | Non-secret values that must be embedded in browser code | Secrets; anything with `VITE_` can be public |
226
+ | Encrypted credential/vault APIs | Per-user and per-organization provider keys, OAuth tokens, and app secrets | Deployment bootstrapping that must exist before the database is available |
227
+ | SQL application state/settings | App state, preferences, and references | Raw credentials, tokens, or large file payloads |
228
+
229
+ For local development, put deploy-level values in a gitignored `.env`. In a
230
+ workspace, the root `.env` is shared by apps and `apps/<name>/.env` overrides it
231
+ for that app. Never commit real values.
232
+
233
+ ## How environment files are loaded {#env-loading}
234
+
235
+ There is not one central environment schema. The effective contract is split
236
+ between dotenv loading, Vite's browser exposure, secret registration, and the
237
+ feature that consumes each value. For the framework's dotenv loader, the
238
+ effective precedence is:
239
+
240
+ 1. Values already present in the shell.
241
+ 2. The app's `.env.local`.
242
+ 3. The app's `.env`.
243
+ 4. The workspace root `.env.local`.
244
+ 5. The workspace root `.env`.
245
+
246
+ Workspace files only fill keys the app has not already defined. This lets a
247
+ workspace keep shared defaults in one place while an app or shell overrides a
248
+ value deliberately. `VITE_*` values are an additional build-time contract:
249
+ Vite embeds them in browser code, so treat every `VITE_*` value as public even
250
+ when it came from a private `.env` file.
251
+
252
+ ## Framework environment variables
253
+
254
+ There is no single useful list of every environment variable in an app: each
255
+ template and provider adds its own integration settings. The table below is the
256
+ framework-level set developers most often need. Feature-specific variables stay
257
+ on the page for the feature that owns them.
258
+
259
+ ### Database and public URL
260
+
261
+ | Variable | What it does |
262
+ | --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
263
+ | `APP_NAME` | Names the current app and enables prefixed lookups such as `MAIL_DATABASE_URL` when the app name is `mail`. |
264
+ | `DATABASE_URL` | Persistent SQL connection. Unset uses local SQLite; `pglite:./data/pglite` opts into local Postgres semantics. |
265
+ | `DATABASE_AUTH_TOKEN` | Separate auth token for providers such as Turso/libSQL. |
266
+ | `<APP_NAME>_DATABASE_URL` | Per-app database override in a multi-app workspace; it wins over `DATABASE_URL` and `NETLIFY_DATABASE_URL`. |
267
+ | `<APP_NAME>_DATABASE_AUTH_TOKEN` | Per-app auth-token override; it wins over `DATABASE_AUTH_TOKEN` and `NETLIFY_DATABASE_AUTH_TOKEN`. |
268
+ | `NETLIFY_DATABASE_URL` | Netlify-managed database fallback when no app-prefixed or generic `DATABASE_URL` is set. |
269
+ | `NETLIFY_DATABASE_AUTH_TOKEN` | Netlify-managed database auth-token fallback. |
270
+ | `<APP_NAME>_DATABASE_URL_UNPOOLED` | Per-app direct connection used for migrations where the provider exposes a pooled and unpooled endpoint. |
271
+ | `DATABASE_URL_UNPOOLED` / `NETLIFY_DATABASE_URL_UNPOOLED` | Generic or Netlify direct migration connection fallback. The app-prefixed value wins when present. |
272
+ | `ALLOW_DRIZZLE_PUSH_ON_NEON` | Set to `1` only for an intentional local schema push against Neon. Do not set it in CI or production. |
273
+ | `APP_URL` | Canonical app/workspace origin used for generated links and callbacks. |
274
+ | `WORKSPACE_OAUTH_ORIGIN` / `VITE_WORKSPACE_OAUTH_ORIGIN` | Workspace OAuth origin, used when the workspace gateway and app origin differ. |
275
+ | `BETTER_AUTH_URL` / `VITE_BETTER_AUTH_URL` | Explicit public auth origin for session and OAuth URL construction; `APP_URL` and request/platform origins can provide fallbacks. |
276
+ | `WEBHOOK_BASE_URL` | Optional callback origin when webhook self-callbacks should use a stable custom domain instead of the deploy preview URL. |
277
+ | `URL` / `DEPLOY_URL` / `DEPLOY_PRIME_URL` | Platform-provided public URL fallbacks, especially for Netlify previews and deploys. |
278
+ | `VERCEL_PROJECT_PRODUCTION_URL` / `VERCEL_URL` | Vercel's production and deployment-hostname fallbacks. |
279
+ | `PORT` | Node server port. |
280
+ | `APP_BASE_PATH` / `VITE_APP_BASE_PATH` | Mounts an app under a path such as `/mail`; the `VITE_*` form preserves that path in browser code. |
281
+ | `NITRO_PRESET` | Selects the deployment/build target, such as `netlify`, `vercel`, or `cloudflare_pages`. |
282
+
283
+ ### Authentication, cookies, and org defaults
284
+
285
+ | Variable | What it does |
286
+ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
287
+ | `BETTER_AUTH_SECRET` | Production session-signing secret and fallback key material. Generate a fresh 32+ character value. |
288
+ | `OAUTH_STATE_SECRET` | Dedicated HMAC key for OAuth state envelopes; falls back to `BETTER_AUTH_SECRET` when unset. |
289
+ | `SECRETS_ENCRYPTION_KEY` | AES-256-GCM key for encrypted credentials and vault rows; falls back to `BETTER_AUTH_SECRET`. |
290
+ | `AUTH_DISABLED` | Local/demo escape hatch that makes every request one shared user. Never use it with real production users. |
291
+ | `AUTH_SKIP_EMAIL_VERIFICATION` | Set to `1` for QA/preview signup without email verification. |
292
+ | `AGENT_NATIVE_DISABLE_AUTO_DEV_ACCOUNT` | Set to `1` to disable localhost's automatic throwaway account. |
293
+ | `AUTH_MODE` | Controls CLI/agent identity resolution such as `pnpm action`; it is not a browser login bypass. |
294
+ | `COOKIE_DOMAIN` | Shares cookies across same-database subdomains when explicitly configured. |
295
+ | `AGENT_NATIVE_SHARE_COOKIE_DOMAIN` | Set to `1` with `COOKIE_DOMAIN` when intentionally sharing one auth database across first-party subdomains. |
296
+ | `AGENT_NATIVE_WORKSPACE` | Enables the shared workspace session realm for a multi-app workspace. |
297
+ | `VITE_AGENT_NATIVE_WORKSPACE` | Build-time/browser equivalent of `AGENT_NATIVE_WORKSPACE`. |
298
+ | `AUTO_CREATE_DEFAULT_ORG` | Defaults to enabled; set to `0` to stop creating a personal organization for users with no membership. |
299
+
300
+ ### OAuth providers
301
+
302
+ | Variable | What it does |
303
+ | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
304
+ | `GOOGLE_SIGN_IN_CLIENT_ID` / `GOOGLE_SIGN_IN_CLIENT_SECRET` | Preferred low-scope Google OAuth client for signing users in. |
305
+ | `GOOGLE_CLIENT_ID` / `GOOGLE_CLIENT_SECRET` | Google OAuth fallback and client credentials for Google API integrations such as Calendar. |
306
+ | `GITHUB_CLIENT_ID` / `GITHUB_CLIENT_SECRET` | Enable GitHub sign-in. |
307
+ | `GOOGLE_AUTH_MODE` | Chooses Google sign-in UX: `auto`, `popup`, or `redirect`; defaults to `auto`. |
308
+
309
+ ### Agent providers and runtime
310
+
311
+ | Variable | What it does |
312
+ | ------------------------------ | -------------------------------------------------------------------------------------------------------- |
313
+ | `AGENT_ENGINE` | Explicitly selects the agent engine, for example a built-in provider or `codex-cli`. |
314
+ | `AGENT_ENGINE_PREFER_BYO_KEY` | Set to `true` to prefer a user's stored provider key over the managed Builder engine. |
315
+ | `ANTHROPIC_API_KEY` | Deploy-level Anthropic fallback for the agent. In multi-tenant hosted apps, prefer per-user credentials. |
316
+ | `OPENAI_API_KEY` | Deploy-level OpenAI provider key. |
317
+ | `GOOGLE_GENERATIVE_AI_API_KEY` | Deploy-level Google Gemini provider key. |
318
+ | `OPENROUTER_API_KEY` | Deploy-level OpenRouter provider key. |
319
+ | `GROQ_API_KEY` | Deploy-level Groq provider key. |
320
+ | `MISTRAL_API_KEY` | Deploy-level Mistral provider key. |
321
+ | `COHERE_API_KEY` | Deploy-level Cohere provider key. |
322
+ | `AGENT_MAX_ITERATIONS` | Default maximum agent loop iterations; app settings can override it where supported. |
323
+ | `AGENT_MAX_OUTPUT_TOKENS` | Default output-token limit for the agent. |
324
+ | `AGENT_PROD_CODE_EXECUTION` | Production code execution mode: `off`, `sandboxed`, or `trusted`. The default is `off`. |
325
+
326
+ ### Optional framework integrations
327
+
328
+ These values enable optional capabilities. When a user or organization has a
329
+ scoped credential in the app's secret or credential settings, that scoped value
330
+ can take precedence over the deploy environment.
331
+
332
+ | Variable | What it does |
333
+ | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
334
+ | `BRAVE_SEARCH_API_KEY` / `TAVILY_API_KEY` / `EXA_API_KEY` / `FIRECRAWL_API_KEY` | Enable the corresponding web-search BYOK provider. The search tool tries configured providers before the managed Builder fallback. |
335
+ | `GITHUB_TOKEN` | Workspace-level GitHub API fallback for repository and PR operations. |
336
+ | `RESEND_API_KEY` | Enables Resend email delivery. |
337
+ | `SENDGRID_API_KEY` / `EMAIL_FROM` | Enables SendGrid email delivery and supplies its sender address. Production email requires Resend or SendGrid; SendGrid also requires a sender. |
338
+ | `SENTRY_SERVER_DSN` / `SENTRY_CLIENT_DSN` / `SENTRY_DSN` | Optional Sentry error reporting for Nitro, browser, or both. No DSN means that surface is disabled. |
339
+ | `VITE_SENTRY_CLIENT_DSN` | Build-time browser Sentry DSN; runtime `SENTRY_CLIENT_DSN` or shared `SENTRY_DSN` can also configure SSR apps. |
340
+ | `SENTRY_ENVIRONMENT` / `SENTRY_SERVER_TRACES_SAMPLE_RATE` | Label Sentry events and opt into server performance traces (`0`–`1`; default `0`). |
341
+ | `POSTHOG_API_KEY` / `POSTHOG_HOST` | Configure PostHog tracking and its optional host. |
342
+ | `MIXPANEL_TOKEN` / `AMPLITUDE_API_KEY` | Configure Mixpanel or Amplitude tracking. |
343
+ | `AGENT_NATIVE_ANALYTICS_PUBLIC_KEY` / `VITE_AGENT_NATIVE_ANALYTICS_PUBLIC_KEY` | Public write key for first-party analytics ingestion; the `VITE_*` form is for browser builds. |
344
+ | `AGENT_NATIVE_ANALYTICS_ENDPOINT` / `VITE_AGENT_NATIVE_ANALYTICS_ENDPOINT` | Override the first-party analytics ingestion endpoint for server or browser events. |
345
+ | `TRACKING_WEBHOOK_URL` / `TRACKING_WEBHOOK_AUTH` | Send tracking events to a webhook and optionally provide its `Authorization` header value. |
346
+ | `AGENT_NATIVE_ALLOW_UNVERIFIED_WEBHOOKS` | Set to `1` only for local development while configuring webhook signing secrets. Never set it in production. |
347
+
348
+ Template-specific variables belong with the template that owns the feature and
349
+ its `.env.example` or feature docs. Start with [Messaging](/docs/messaging),
350
+ [Tracking](/docs/tracking), [Observability](/docs/observability), or the
351
+ template's development guide when a variable is not in this framework-level
352
+ map.
353
+
354
+ ### MCP, A2A, and CLI identity
355
+
356
+ | Variable | What it does |
357
+ | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
358
+ | `A2A_SECRET` | Shared signing secret for production cross-app A2A and queued integration dispatch. Use the same value across sibling apps. |
359
+ | `ACCESS_TOKEN` | One static bearer fallback for MCP clients that cannot use OAuth. It is not browser authentication. |
360
+ | `ACCESS_TOKENS` | Comma-separated static bearer fallbacks for MCP clients. |
361
+ | `MCP_OAUTH_ACCESS_TOKEN_TTL` | Lifetime for MCP OAuth access tokens; defaults to `30d`. |
362
+ | `AGENT_USER_EMAIL` | CLI-only user identity fallback when no request context exists. It does not impersonate browser requests. |
363
+ | `AGENT_USER_NAME` | CLI-only display-name fallback. |
364
+ | `AGENT_ORG_ID` | CLI-only active-org fallback when no request context exists. It does not override a browser session. |
365
+ | `AGENT_USER_TIMEZONE` | CLI/agent timezone fallback. |
366
+
367
+ `A2A_SECRET` is deployment-wide signing material. The organization-level
368
+ `organizations.a2a_secret` is a separate, UI-managed secret used when an org
369
+ delegates between separately deployed apps by organization domain. Do not copy
370
+ the org-level secret into `.env`; manage it from the organization settings
371
+ surface.
372
+
373
+ ### Workspace route visibility
374
+
375
+ These are generated automatically by the workspace deploy/dev commands in most
376
+ projects. Configure them directly only when you are building the workspace
377
+ runtime yourself:
378
+
379
+ | Variable | What it does |
380
+ | -------------------------------------------- | ------------------------------------------------------------------ |
381
+ | `AGENT_NATIVE_WORKSPACE_APP_ID` | Identifies the current app inside a multi-app workspace. |
382
+ | `AGENT_NATIVE_WORKSPACE_APP_AUDIENCE` | Sets the app audience, usually `internal` or `public`. |
383
+ | `AGENT_NATIVE_WORKSPACE_APP_PUBLIC_PATHS` | JSON array of public route prefixes. |
384
+ | `AGENT_NATIVE_WORKSPACE_APP_PROTECTED_PATHS` | JSON array of route prefixes that remain authenticated. |
385
+ | `WORKSPACE_ORG_NAME` | Optional organization name used by workspace bootstrap tooling. |
386
+ | `WORKSPACE_ORG_DOMAIN` | Optional allowed email domain used by workspace bootstrap tooling. |
387
+ | `WORKSPACE_OWNER_EMAIL` | Optional owner identity used by workspace bootstrap tooling. |
388
+
389
+ ## A practical setup sequence
390
+
391
+ For a new team app, configure in this order:
392
+
393
+ 1. Set `DATABASE_URL` if the app will be shared or deployed.
394
+ 2. Set `BETTER_AUTH_SECRET` and an explicit public URL such as `APP_URL` or
395
+ `BETTER_AUTH_URL` before production.
396
+ 3. Render `OrgSwitcher` and `TeamPage` from the shared org/team kit.
397
+ 4. Add `...ownableColumns()` to tenant-aware tables.
398
+ 5. Use `ctx.orgId` when creating rows and `accessFilter` / `assertAccess` when
399
+ reading or mutating them.
400
+ 6. Put provider credentials in the encrypted credential/vault surface when
401
+ they vary by user or organization; keep env keys for deploy-level defaults.
402
+ 7. Add `A2A_SECRET` to every production app that delegates to a sibling app or
403
+ processes signed integration tasks.
404
+
405
+ ## Related docs
406
+
407
+ - [**Authentication**](/docs/authentication) — sessions, OAuth, cookies, and auth flags
408
+ - [**Multi-Tenancy**](/docs/multi-tenancy) — org switching and tenant isolation
409
+ - [**Security — Data Scoping**](/docs/security#data-scoping) — SQL scoping and access guards
410
+ - [**Sharing & Privacy**](/docs/sharing) — resource visibility and share roles
411
+ - [**Database**](/docs/database) — schema and connection details
412
+ - [**Deployment**](/docs/deployment#environment-variables) — production and provider environment
413
+ - [**Org & Team Kit**](/docs/toolkit-org-team) — reusable UI components and hooks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.106.3",
3
+ "version": "0.107.1",
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": {
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  appBasePath,
3
+ isAgentChatHomeHandoffActive,
3
4
  appPath,
4
5
  markAgentChatHomeHandoff,
5
6
  useAgentRouteState,
@@ -34,7 +35,9 @@ export function useNavigationState() {
34
35
  isChatPath(location.pathname) &&
35
36
  !isChatPath(pathnameFromPath(path))
36
37
  ) {
37
- markAgentChatHomeHandoff("chat");
38
+ if (isAgentChatHomeHandoffActive("chat")) {
39
+ markAgentChatHomeHandoff("chat");
40
+ }
38
41
  }
39
42
  },
40
43
  });
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-07-17
4
+ ---
5
+
6
+ The agent chat sidebar stays closed until you open it or start a chat handoff.
@@ -87,6 +87,15 @@ Extensions have full access to app data via helpers injected into the iframe
87
87
  (full signatures in `references/api.md`):
88
88
 
89
89
  - `appAction(name, params)` — call any app action
90
+ - `agentNative.mcp.listTools(serverId?)` and
91
+ `agentNative.mcp.callTool(serverId, toolName, arguments)` — inspect and call
92
+ connected remote MCP tools through the host app's authenticated, scoped
93
+ action surface. The iframe never receives MCP credentials.
94
+ - `agentNative.providerApi.catalog(params)` and `agentNative.providerApi.docs(params)`
95
+ — discover provider APIs and their contracts using existing OAuth workspace
96
+ connections. Arbitrary `providerApi.request` is intentionally not exposed to
97
+ extensions because it could turn a shared extension into an authenticated
98
+ write proxy; use `agentNative.mcp.callTool` or an explicit app action instead.
90
99
  - `appFetch(path, options)` — call allowed framework endpoints under
91
100
  `/_agent-native/*`
92
101
  - `dbQuery(sql, args)` — read from SQL
@@ -37,6 +37,37 @@ auto-mounted at `/_agent-native/actions/:name`.
37
37
  </div>
38
38
  ```
39
39
 
40
+ ### Connected MCP and provider APIs
41
+
42
+ The host injects connector helpers that reuse the current user's or
43
+ organization's server-side grants. OAuth tokens, refresh tokens, client
44
+ secrets, and remote server URLs stay in the parent/runtime and are never
45
+ serialized into the iframe.
46
+
47
+ ```javascript
48
+ const tools = await agentNative.mcp.listTools();
49
+ const linearTools = await agentNative.mcp.listTools("org_linear");
50
+ const result = await agentNative.mcp.callTool("org_linear", "list_issues", {
51
+ project: "<PROJECT_ID>",
52
+ });
53
+ ```
54
+
55
+ For regular provider connectors, use the shared provider API actions when the
56
+ template exposes them:
57
+
58
+ ```javascript
59
+ const catalog = await agentNative.providerApi.catalog({ provider: "github" });
60
+ const docs = await agentNative.providerApi.docs({ provider: "github" });
61
+ ```
62
+
63
+ These helpers are also available as
64
+ `agentNative.connectors.mcp` and `agentNative.connectors.providerApi`. They
65
+ are action-backed, so the host enforces authentication, app grants, provider
66
+ allow-lists, audit behavior, and any local-file `permissions.appActions`
67
+ declarations. Extensions can discover provider APIs and use connected MCP tools,
68
+ but they cannot issue arbitrary provider requests. Use a purpose-built app action
69
+ for a bounded operation instead.
70
+
40
71
  ### `appFetch(path, options)` — Call allowed framework endpoints
41
72
 
42
73
  General-purpose fetch to allowed framework endpoints (for example,
@@ -114,6 +114,15 @@ payload. Key-only providers should remain in the normal scoped secrets flow
114
114
  until their upstream OAuth app, scopes, refresh behavior, and identity mapping
115
115
  have been implemented and configured.
116
116
 
117
+ Extensions can consume both classes of connection through the same host-side
118
+ action bridge. Use `agentNative.mcp.listTools()` / `callTool()` for connected
119
+ remote MCP servers, and `agentNative.providerApi.catalog()` / `docs()` to
120
+ discover template-owned provider API actions. The bridge
121
+ preserves the current user's or organization's access scope and never exposes
122
+ MCP URLs, OAuth tokens, refresh tokens, or client secrets to the iframe. Local
123
+ file extensions must declare the corresponding action names in
124
+ `permissions.appActions`.
125
+
117
126
  ## How
118
127
 
119
128
  ### 1. Connect to hosted apps