@agent-native/core 0.145.4 → 0.145.6

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 (398) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +18 -0
  3. package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  4. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +17 -1
  5. package/corpus/templates/analytics/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  6. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -0
  7. package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +22 -3
  8. package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +76 -23
  9. package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  10. package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  11. package/corpus/templates/analytics/AGENTS.md +2 -1
  12. package/corpus/templates/analytics/actions/account-deep-dive.ts +83 -47
  13. package/corpus/templates/analytics/actions/create-dashboard-folder.ts +27 -0
  14. package/corpus/templates/analytics/actions/gong-calls.ts +3 -3
  15. package/corpus/templates/analytics/actions/list-dashboard-folders.ts +26 -0
  16. package/corpus/templates/analytics/actions/list-sql-dashboards.ts +1 -0
  17. package/corpus/templates/analytics/actions/set-dashboard-folder.ts +26 -0
  18. package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +18 -3
  19. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +6 -4
  20. package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
  21. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +12 -2
  22. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +35 -20
  23. package/corpus/templates/analytics/app/global.css +17 -0
  24. package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +29 -15
  25. package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -3
  26. package/corpus/templates/analytics/app/i18n-data.ts +296 -0
  27. package/corpus/templates/analytics/app/lib/prefetch-keys.ts +23 -2
  28. package/corpus/templates/analytics/app/pages/DashboardOverview.tsx +642 -0
  29. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +66 -31
  30. package/corpus/templates/analytics/app/root.tsx +4 -0
  31. package/corpus/templates/analytics/app/routes/dashboards._index.tsx +5 -1
  32. package/corpus/templates/analytics/changelog/2026-08-07-added-a-dashboards-overview-with-personal-and-shared-folders.md +6 -0
  33. package/corpus/templates/analytics/changelog/2026-08-07-analytics-tracking-and-chat-startup-no-longer-emit-avoidable.md +6 -0
  34. package/corpus/templates/analytics/changelog/2026-08-07-dashboard-panels-now-load-custom-api-data-programs-reliably.md +6 -0
  35. package/corpus/templates/analytics/changelog/2026-08-07-gong-searches-conserve-api-quota-and-report-incomplete-coverage.md +6 -0
  36. package/corpus/templates/analytics/changelog/2026-08-07-searchable-dashboards-make-personal-and-shared-folders-easie.md +6 -0
  37. package/corpus/templates/analytics/netlify.toml +3 -0
  38. package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +112 -0
  39. package/corpus/templates/analytics/server/db/index.ts +12 -0
  40. package/corpus/templates/analytics/server/db/schema.ts +14 -0
  41. package/corpus/templates/analytics/server/jobs/analytics-rollup-backfill.ts +4 -0
  42. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +1 -0
  43. package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +85 -15
  44. package/corpus/templates/analytics/server/lib/dashboard-folders-store.ts +168 -0
  45. package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +9 -4
  46. package/corpus/templates/analytics/server/lib/dashboards-store.ts +116 -1
  47. package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +4 -8
  48. package/corpus/templates/analytics/server/lib/gong.ts +139 -78
  49. package/corpus/templates/analytics/server/plugins/db.ts +55 -15
  50. package/corpus/templates/analytics/server/plugins/session-replay-retention-jobs.ts +6 -2
  51. package/corpus/templates/analytics/server/routes/api/session-replay/retention.post.ts +65 -0
  52. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +18 -0
  53. package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  54. package/corpus/templates/assets/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  55. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -0
  56. package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +76 -23
  57. package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  58. package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  59. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +18 -0
  60. package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  61. package/corpus/templates/brain/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  62. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -0
  63. package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +76 -23
  64. package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  65. package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  66. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +18 -0
  67. package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  68. package/corpus/templates/calendar/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  69. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -0
  70. package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +76 -23
  71. package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  72. package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  73. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  74. package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  75. package/corpus/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  76. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  77. package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  78. package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  79. package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  80. package/corpus/templates/chat/.env.example +3 -0
  81. package/corpus/templates/chat/AGENTS.md +4 -0
  82. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +18 -0
  83. package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  84. package/corpus/templates/clips/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  85. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -0
  86. package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +76 -23
  87. package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  88. package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  89. package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +4 -0
  90. package/corpus/templates/clips/actions/request-transcript.ts +52 -3
  91. package/corpus/templates/clips/app/components/editor/editor-layout.tsx +8 -3
  92. package/corpus/templates/clips/app/components/editor/waveform.tsx +2 -1
  93. package/corpus/templates/clips/app/components/library/search-bar.tsx +1 -1
  94. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -10
  95. package/corpus/templates/clips/app/global.css +9 -0
  96. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -0
  97. package/corpus/templates/clips/changelog/2026-08-07-screen-recordings-now-capture-tab-and-system-audio-even-when.md +6 -0
  98. package/corpus/templates/clips/changelog/2026-08-07-transcription-now-retries-transient-cloud-failures-automatic.md +6 -0
  99. package/corpus/templates/clips/desktop/src-tauri/src/silence_detector.rs +10 -11
  100. package/corpus/templates/clips/server/db/schema.ts +7 -0
  101. package/corpus/templates/clips/server/plugins/db.ts +8 -0
  102. package/corpus/templates/clips/shared/recording-capture.ts +38 -0
  103. package/corpus/templates/clips/shared/transcript-failure.ts +89 -0
  104. package/corpus/templates/content/.agents/skills/actions/SKILL.md +18 -0
  105. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  106. package/corpus/templates/content/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  107. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -0
  108. package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +76 -23
  109. package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  110. package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  111. package/corpus/templates/content/.env.example +9 -3
  112. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -0
  113. package/corpus/templates/content/changelog/2026-08-07-collapsed-sidebar-utility-buttons-stay-anchored-at-the-botto.md +6 -0
  114. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  115. package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +76 -23
  116. package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  117. package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  118. package/corpus/templates/design/.agents/skills/actions/SKILL.md +18 -0
  119. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  120. package/corpus/templates/design/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  121. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -0
  122. package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +76 -23
  123. package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  124. package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  125. package/corpus/templates/design/actions/view-screen.ts +1 -0
  126. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +14 -1
  127. package/corpus/templates/design/changelog/2026-08-07-cmd-c-now-copies-selected-text-in-the-agent-panel-instead-of.md +6 -0
  128. package/corpus/templates/design/changelog/2026-08-07-real-time-voice-can-now-read-the-current-selection-and-edit-.md +6 -0
  129. package/corpus/templates/design/server/lib/reprompt-action-guard.ts +7 -3
  130. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +18 -0
  131. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  132. package/corpus/templates/dispatch/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  133. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -0
  134. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +76 -23
  135. package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  136. package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  137. package/corpus/templates/factory/.agents/skills/actions/SKILL.md +18 -0
  138. package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  139. package/corpus/templates/factory/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  140. package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +1 -0
  141. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +76 -23
  142. package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  143. package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  144. package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +279 -0
  145. package/corpus/templates/factory/actions/get-factory-automation-health.ts +23 -4
  146. package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +1 -1
  147. package/corpus/templates/factory/app/routes/factory.tsx +21 -3
  148. package/corpus/templates/factory/changelog/2026-08-07-factory-can-keep-builder-bot-pull-requests-moving-by-request.md +6 -0
  149. package/corpus/templates/factory/server/lib/require-factory-automation.ts +1 -0
  150. package/corpus/templates/factory/server/plugins/agent-chat.ts +4 -1
  151. package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +81 -12
  152. package/corpus/templates/factory/server/triage/github-client.ts +31 -0
  153. package/corpus/templates/factory/server/triage/pr-babysit.ts +75 -1
  154. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +18 -0
  155. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  156. package/corpus/templates/forms/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  157. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -0
  158. package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +76 -23
  159. package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  160. package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  161. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  162. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -0
  163. package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +76 -23
  164. package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  165. package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  166. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +18 -0
  167. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  168. package/corpus/templates/mail/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  169. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -0
  170. package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +76 -23
  171. package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  172. package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  173. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +18 -0
  174. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  175. package/corpus/templates/plan/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  176. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -0
  177. package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +76 -23
  178. package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  179. package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  180. package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -1
  181. package/corpus/templates/plan/changelog/2026-08-07-inline-help-icons-now-stay-visually-balanced-with-nearby-tex.md +6 -0
  182. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +18 -0
  183. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  184. package/corpus/templates/slides/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  185. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -0
  186. package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +76 -23
  187. package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  188. package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  189. package/corpus/templates/slides/.env.example +5 -0
  190. package/corpus/templates/slides/changelog/2026-08-07-fixed-generated-slides-briefly-disappearing-while-they-are-b.md +6 -0
  191. package/corpus/templates/slides/server/plugins/collab.ts +20 -8
  192. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +18 -0
  193. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  194. package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  195. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +1 -0
  196. package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +76 -23
  197. package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  198. package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  199. package/corpus/templates/tasks/.env.example +3 -0
  200. package/dist/agent/production-agent.js +24 -3
  201. package/dist/client/AgentPanel.d.ts +6 -0
  202. package/dist/client/AgentPanel.js +176 -30
  203. package/dist/client/AssistantChat.d.ts +2 -0
  204. package/dist/client/AssistantChat.js +4 -1
  205. package/dist/client/ConnectBuilderCard.js +6 -11
  206. package/dist/client/MultiTabAssistantChat.js +1 -1
  207. package/dist/client/RuntimeConfigNotice.d.ts +1 -0
  208. package/dist/client/RuntimeConfigNotice.js +94 -0
  209. package/dist/client/agent-chat/index.d.ts +1 -1
  210. package/dist/client/agent-chat/index.js +1 -1
  211. package/dist/client/agent-chat-adapter.js +85 -4
  212. package/dist/client/agent-page/AgentTabsPage.js +1 -1
  213. package/dist/client/agent-sidebar-state.d.ts +6 -0
  214. package/dist/client/agent-sidebar-state.js +25 -0
  215. package/dist/client/app-providers.js +2 -1
  216. package/dist/client/assistant-ui-recovery.js +1 -1
  217. package/dist/client/chat/index.d.ts +1 -1
  218. package/dist/client/chat/index.js +1 -1
  219. package/dist/client/chat/markdown-renderer.d.ts +2 -1
  220. package/dist/client/chat/markdown-renderer.js +48 -2
  221. package/dist/client/chat/message-components.d.ts +6 -0
  222. package/dist/client/chat/message-components.js +182 -53
  223. package/dist/client/chat/tool-call-display.d.ts +16 -4
  224. package/dist/client/chat/tool-call-display.js +225 -18
  225. package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
  226. package/dist/client/frame-protocol.d.ts +4 -0
  227. package/dist/client/i18n.js +9 -0
  228. package/dist/client/integrations/IntegrationsPanel.js +2 -5
  229. package/dist/client/onboarding/FirstRunOnboarding.js +2 -3
  230. package/dist/client/org/TeamPage.js +49 -6
  231. package/dist/client/org/hooks.d.ts +7 -2
  232. package/dist/client/org/hooks.js +11 -4
  233. package/dist/client/resources/McpConnectionSuggestion.js +2 -3
  234. package/dist/client/resources/McpIntegrationDialog.js +2 -16
  235. package/dist/client/resources/McpIntegrationLogo.d.ts +11 -0
  236. package/dist/client/resources/McpIntegrationLogo.js +14 -0
  237. package/dist/client/resources/ResourceTree.js +1 -1
  238. package/dist/client/resources/mcp-integration-logos.d.ts +1 -0
  239. package/dist/client/resources/mcp-integration-logos.js +47 -18
  240. package/dist/client/settings/useBuilderStatus.js +6 -0
  241. package/dist/client/ui/index.d.ts +1 -0
  242. package/dist/client/ui/index.js +1 -0
  243. package/dist/collab/struct-routes.d.ts +1 -1
  244. package/dist/config.d.ts +26 -3
  245. package/dist/config.js +106 -14
  246. package/dist/db/ddl-guard.d.ts +15 -2
  247. package/dist/db/ddl-guard.js +53 -5
  248. package/dist/jobs/scheduler.js +7 -0
  249. package/dist/localization/default-messages.d.ts +17 -0
  250. package/dist/localization/default-messages.js +17 -0
  251. package/dist/mcp/oauth-client-metadata.js +5 -1
  252. package/dist/mcp/oauth-route.d.ts +5 -4
  253. package/dist/mcp/oauth-route.js +25 -9
  254. package/dist/mcp/server.d.ts +1 -1
  255. package/dist/mcp/server.js +9 -10
  256. package/dist/notifications/routes.d.ts +3 -3
  257. package/dist/org/handlers.d.ts +1 -0
  258. package/dist/org/handlers.js +17 -2
  259. package/dist/provider-api/actions/custom-provider-registration.d.ts +9 -9
  260. package/dist/provider-api/actions/provider-api.d.ts +7 -7
  261. package/dist/provider-api/corpus-jobs.d.ts +12 -2
  262. package/dist/provider-api/corpus-jobs.js +31 -1
  263. package/dist/provider-api/index.d.ts +2 -0
  264. package/dist/provider-api/index.js +7 -1
  265. package/dist/secrets/routes.d.ts +6 -6
  266. package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +1 -1
  267. package/dist/server/agent-chat/recurring-jobs-runtime.js +14 -2
  268. package/dist/server/agent-chat/script-entries.js +12 -1
  269. package/dist/server/agent-chat-plugin.js +2 -2
  270. package/dist/server/auth.d.ts +1 -0
  271. package/dist/server/auth.js +85 -1
  272. package/dist/server/better-auth-instance.d.ts +9 -0
  273. package/dist/server/better-auth-instance.js +25 -11
  274. package/dist/server/core-routes-plugin.d.ts +7 -0
  275. package/dist/server/core-routes-plugin.js +51 -5
  276. package/dist/server/create-server.js +23 -2
  277. package/dist/server/db-pressure.d.ts +38 -0
  278. package/dist/server/db-pressure.js +147 -0
  279. package/dist/server/index.d.ts +1 -0
  280. package/dist/server/index.js +1 -0
  281. package/dist/server/legacy-auth-migration.d.ts +10 -0
  282. package/dist/server/legacy-auth-migration.js +37 -0
  283. package/dist/server/onboarding-html.js +206 -2
  284. package/dist/server/poll.d.ts +26 -0
  285. package/dist/server/poll.js +108 -13
  286. package/dist/server/realtime-voice.d.ts +2 -1
  287. package/dist/server/realtime-voice.js +38 -56
  288. package/dist/server/short-lived-token.d.ts +43 -0
  289. package/dist/server/short-lived-token.js +74 -0
  290. package/dist/server/ssr-handler.js +4 -1
  291. package/dist/shared/index.d.ts +1 -0
  292. package/dist/shared/index.js +1 -0
  293. package/dist/shared/runtime-config.d.ts +44 -0
  294. package/dist/shared/runtime-config.js +284 -0
  295. package/dist/styles/agent-native.css +48 -1
  296. package/dist/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  297. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  298. package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  299. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  300. package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  301. package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  302. package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  303. package/dist/templates/chat/.env.example +3 -0
  304. package/dist/templates/chat/AGENTS.md +4 -0
  305. package/dist/templates/default/.agents/skills/actions/SKILL.md +18 -0
  306. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  307. package/dist/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  308. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
  309. package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
  310. package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  311. package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  312. package/dist/templates/default/AGENTS.md +6 -1
  313. package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
  314. package/dist/templates/default/app/i18n/de-DE.ts +6 -0
  315. package/dist/templates/default/app/i18n/en-US.ts +6 -0
  316. package/dist/templates/default/app/i18n/es-ES.ts +6 -0
  317. package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
  318. package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
  319. package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
  320. package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
  321. package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
  322. package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
  323. package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
  324. package/dist/templates/headless/.agents/skills/actions/SKILL.md +18 -0
  325. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  326. package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
  327. package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  328. package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  329. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
  330. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  331. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  332. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
  333. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
  334. package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  335. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  336. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
  337. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
  338. package/dist/templates/workspace-core/AGENTS.md +7 -2
  339. package/dist/templates/workspace-root/AGENTS.md +5 -0
  340. package/dist/vite/client.d.ts +3 -3
  341. package/dist/vite/client.js +47 -1
  342. package/dist/vite/index.d.ts +1 -1
  343. package/docs/content/agent-native-config.mdx +240 -139
  344. package/docs/content/authentication.mdx +17 -0
  345. package/docs/content/deployment.mdx +19 -14
  346. package/docs/content/drop-in-agent.mdx +19 -2
  347. package/docs/content/environment-variables.mdx +63 -38
  348. package/docs/content/getting-started-actions.mdx +15 -6
  349. package/docs/content/getting-started-database.mdx +14 -10
  350. package/docs/content/getting-started-pages.mdx +32 -35
  351. package/docs/content/getting-started.mdx +7 -6
  352. package/package.json +2 -2
  353. package/src/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  354. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  355. package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  356. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  357. package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  358. package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  359. package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  360. package/src/templates/chat/.env.example +3 -0
  361. package/src/templates/chat/AGENTS.md +4 -0
  362. package/src/templates/default/.agents/skills/actions/SKILL.md +18 -0
  363. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  364. package/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  365. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
  366. package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
  367. package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  368. package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  369. package/src/templates/default/AGENTS.md +6 -1
  370. package/src/templates/default/app/i18n/ar-SA.ts +6 -0
  371. package/src/templates/default/app/i18n/de-DE.ts +6 -0
  372. package/src/templates/default/app/i18n/en-US.ts +6 -0
  373. package/src/templates/default/app/i18n/es-ES.ts +6 -0
  374. package/src/templates/default/app/i18n/fr-FR.ts +6 -0
  375. package/src/templates/default/app/i18n/hi-IN.ts +6 -0
  376. package/src/templates/default/app/i18n/ja-JP.ts +6 -0
  377. package/src/templates/default/app/i18n/ko-KR.ts +6 -0
  378. package/src/templates/default/app/i18n/pt-BR.ts +6 -0
  379. package/src/templates/default/app/i18n/zh-CN.ts +6 -0
  380. package/src/templates/default/app/i18n/zh-TW.ts +6 -0
  381. package/src/templates/headless/.agents/skills/actions/SKILL.md +18 -0
  382. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  383. package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
  384. package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  385. package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  386. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
  387. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  388. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  389. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
  390. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
  391. package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  392. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  393. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
  394. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
  395. package/src/templates/workspace-core/AGENTS.md +7 -2
  396. package/src/templates/workspace-root/AGENTS.md +5 -0
  397. package/corpus/templates/dispatch/app/routes/admin.apps.$appId.tsx +0 -1
  398. package/corpus/templates/dispatch/app/routes/admin.apps.tsx +0 -1
@@ -1,165 +1,266 @@
1
1
  ---
2
2
  title: "Agent-Native app configuration"
3
- description: "Configure public app defaults with agent-native.json or a typed agent-native.config.ts file."
4
- search: "agent-native.json agent-native.config.ts onboarding first-run Builder BYOK integrations configuration"
3
+ description: "Configure public Agent-Native app defaults with agent-native.ts, its typed aliases, or agent-native.json compatibility."
4
+ search: "agent-native.ts agent-native.config.ts agent-native.config.mts agent-native.json onboarding runtime readiness configuration"
5
5
  ---
6
6
 
7
7
  # Agent-Native app configuration
8
8
 
9
- Use app configuration for committed, non-secret defaults that should travel
10
- with the app. Use environment variables for deployment values, credentials,
11
- and local machine controls. The framework reads `agent-native.json` from the
12
- app root when the `agentNative()` Vite preset runs.
9
+ Use `agent-native.ts` for new shared Agent-Native configuration. It is a typed,
10
+ mode-aware source for committed, non-secret app defaults. The framework also
11
+ accepts `agent-native.mts`, `agent-native.config.ts`, and
12
+ `agent-native.config.mts` as filename aliases, and continues to read
13
+ `agent-native.json` for compatibility.
13
14
 
14
- The file is an additive app manifest. Existing feature-owned sections such as
15
- `doctor`, `apps`, and local-file declarations can stay in the same file; the
16
- onboarding reader only consumes the `version` and `onboarding` fields described
17
- here.
15
+ The resolved configuration is serialized into the browser bundle. Treat every
16
+ value in these files as public. Put credentials and deployment-specific values
17
+ in the environment or the scoped secret store instead.
18
18
 
19
- ## The onboarding contract
19
+ ## File location and loading
20
20
 
21
- The shared first-run surface has three supported modes:
21
+ Put one configuration file at the app root, alongside `package.json` and the
22
+ app's Vite configuration. In a workspace, each app has its own root and its own
23
+ configuration file. The Vite preset reads from the current app root, not from
24
+ `server/plugins/` or a workspace-wide directory.
22
25
 
23
- | Mode | Local or hosted result |
24
- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
25
- | `off` | No shared first-run surface. This is the default for ordinary apps. |
26
- | `connect` | Show Connect Builder or Add your own keys, then go straight to the app. The generic integrations catalog is omitted. |
27
- | `connect-and-integrations` | Show Connect Builder or Add your own keys, followed by the generic integrations catalog. Use this for a hosted app that should expose its integration setup. |
26
+ For new apps, create `agent-native.ts`:
28
27
 
29
- A turn-into-app result normally commits a mode map so `pnpm dev` is useful
30
- immediately while a production build has the hosted setup path:
28
+ ```ts filename="agent-native.ts"
29
+ import { defineAgentNativeConfig } from "@agent-native/core/config";
31
30
 
32
- ```json filename="agent-native.json"
33
- {
34
- "version": 1,
35
- "onboarding": {
36
- "firstRun": {
37
- "development": "connect",
38
- "production": "connect-and-integrations"
39
- }
40
- }
41
- }
31
+ export default defineAgentNativeConfig(({ command, mode, isBuild }) => {
32
+ const hosted = mode === "production";
33
+
34
+ return {
35
+ version: 1,
36
+ onboarding: {
37
+ firstRun:
38
+ command === "serve"
39
+ ? "connect"
40
+ : hosted
41
+ ? "connect-and-integrations"
42
+ : "connect",
43
+ },
44
+ runtime: {
45
+ auth: { enabled: true },
46
+ database: { required: hosted },
47
+ environment: {
48
+ required: ["PUBLIC_API_ORIGIN"],
49
+ },
50
+ },
51
+ diagnostics: {
52
+ failOnBuild: isBuild && hosted,
53
+ },
54
+ };
55
+ });
42
56
  ```
43
57
 
44
- An ordinary app can omit `onboarding` or make the default explicit:
58
+ This example shows the complete shared option surface. Local `vite serve`
59
+ uses the Connect setup path, a production build includes the integrations
60
+ catalog, production requires auth and a persistent database, and the app
61
+ declares an additional environment variable by name. Replace
62
+ `PUBLIC_API_ORIGIN` with a real non-secret requirement for the app, or remove
63
+ the `required` list when there is no such requirement.
64
+
65
+ The factory receives this context:
66
+
67
+ | Property | Values or meaning |
68
+ | --------- | ----------------------------------------------------------------------- |
69
+ | `command` | Vite's `"serve"` or `"build"` command. |
70
+ | `mode` | The exact Vite mode, such as `development`, `production`, or `staging`. |
71
+ | `isDev` | `true` for `serve`. |
72
+ | `isBuild` | `true` for `build`. |
73
+
74
+ Export the config as the default export. The loader also accepts a named
75
+ `agentNativeConfig` export for compatibility, but the default export is the
76
+ recommended form.
77
+
78
+ ## Supported options
79
+
80
+ These are the only shared options read from the typed config and the shared
81
+ configuration portion of `agent-native.json`:
82
+
83
+ | Option | Type | Effect |
84
+ | ------------------------------ | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
85
+ | `version` | `1` | Optional schema version. If provided, it must be `1`. |
86
+ | `onboarding.firstRun` | `"off"`, `"connect"`, `"connect-and-integrations"`, or a mode map | Chooses the first-run Agent Sidebar setup. `off` hides it. `connect` shows Builder/BYOK setup without the generic integrations catalog. `connect-and-integrations` includes that catalog. |
87
+ | `runtime.auth.enabled` | `boolean` | Declares whether the app expects the framework or a custom authentication layer. |
88
+ | `runtime.database.required` | `boolean` | Declares whether production needs a persistent remote SQL database. |
89
+ | `runtime.environment.required` | `string[]` | Declares additional required environment variable names. Names must match `[A-Za-z_][A-Za-z0-9_]*`; values do not belong in the config. |
90
+ | `diagnostics.failOnBuild` | `boolean` | When `true`, a production Vite build throws on runtime configuration issues. When absent or `false`, it reports them without failing the build. |
91
+
92
+ ### Mode maps for onboarding
93
+
94
+ `firstRun` can be one mode string, or a
95
+ `Partial<Record<string, "off" | "connect" | "connect-and-integrations">> &
96
+ { default?: "off" | "connect" | "connect-and-integrations" }` map keyed by
97
+ exact Vite modes. The resolver checks the exact `mode` first. If there is no
98
+ exact match, it checks `development` for `serve` or `production` for `build`,
99
+ then `default`, and finally falls back to `off`:
100
+
101
+ ```ts filename="agent-native.ts"
102
+ import { defineAgentNativeConfig } from "@agent-native/core/config";
45
103
 
46
- ```json filename="agent-native.json"
47
- {
48
- "version": 1,
49
- "onboarding": {
50
- "firstRun": "off"
51
- }
52
- }
104
+ export default defineAgentNativeConfig({
105
+ version: 1,
106
+ onboarding: {
107
+ firstRun: {
108
+ development: "connect",
109
+ staging: "connect",
110
+ production: "connect-and-integrations",
111
+ default: "off",
112
+ },
113
+ },
114
+ });
53
115
  ```
54
116
 
55
- First-party templates use `off` while running locally and
56
- `connect-and-integrations` for a production build. The
57
- `/turn-into-app` skill deliberately changes only the local value to `connect`
58
- so a newly generated workflow is immediately testable without putting the
59
- hosted integration catalog in front of the user.
117
+ ## Runtime readiness defaults
60
118
 
61
- The environment map uses the exact Vite `mode` first, then falls back to
62
- `development` for `vite dev`, `production` for `vite build`, and finally
63
- `default` or `off`. This lets a project add a named mode such as `staging`
64
- without making the app depend on a new environment variable.
119
+ The runtime diagnostics check runs for production configuration. If an option
120
+ is absent, the framework uses these defaults:
65
121
 
66
- ## Typed dynamic configuration
122
+ | Omitted option | Default | Production behavior |
123
+ | ------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
124
+ | `runtime.auth.enabled` | `true` | Checks that authentication is usable. `AUTH_DISABLED` is treated as false when unset. A standalone deployment needs `BETTER_AUTH_SECRET`; a workspace runtime can derive it from its existing `A2A_SECRET`. |
125
+ | `runtime.database.required` | `true` | Requires a persistent remote SQL URL. Local SQLite and other local database fallbacks are reported as unsuitable for production. |
126
+ | `runtime.environment.required` | `[]` | No app-specific environment names are checked unless the app declares them. |
127
+ | `diagnostics.failOnBuild` | `false` | Production build diagnostics warn instead of throwing. Set `true` for a deliberate build gate. |
67
128
 
68
- When a static JSON map is not enough, add `agent-native.config.ts`. It returns
69
- the same serializable shape and can use the Vite command and mode:
129
+ `BETTER_AUTH_URL` is optional when the public origin can be inferred from
130
+ `APP_URL`, known template or request context, or hosting metadata such as
131
+ Netlify or Vercel. Set it when that inference is not correct. The database
132
+ check accepts the app-prefixed database URL, `DATABASE_URL`, or
133
+ `NETLIFY_DATABASE_URL`, according to the runtime environment.
70
134
 
71
- ```ts filename="agent-native.config.ts"
135
+ Local development keeps its zero-setup fallbacks. Production diagnostics
136
+ report missing or weak auth secrets, auth disabled in production, invalid
137
+ public auth URLs, missing or local database URLs, and missing app-declared
138
+ environment variables. The redacted report is available at
139
+ `/_agent-native/ping?configuration=1`. The shared shell can show the report and
140
+ offer a **Copy prompt for AI** action; that prompt includes variable names and
141
+ guidance, never secret values.
142
+
143
+ For example, this is a useful readiness declaration when an app uses the
144
+ framework's normal auth and database contracts:
145
+
146
+ ```ts filename="agent-native.ts"
72
147
  import { defineAgentNativeConfig } from "@agent-native/core/config";
73
148
 
74
- export default defineAgentNativeConfig(({ command, mode }) => ({
75
- version: 1,
76
- onboarding: {
77
- firstRun:
78
- command === "serve" || mode === "preview"
79
- ? "connect"
80
- : "connect-and-integrations",
149
+ export default defineAgentNativeConfig({
150
+ runtime: {
151
+ auth: { enabled: true },
152
+ database: { required: true },
153
+ environment: { required: ["PUBLIC_API_ORIGIN"] },
154
+ },
155
+ diagnostics: { failOnBuild: true },
156
+ });
157
+ ```
158
+
159
+ Set the actual deployment values outside the repository. For example, provide
160
+ `BETTER_AUTH_SECRET`, `DATABASE_URL`, and `PUBLIC_API_ORIGIN` in Netlify,
161
+ Vercel, another deployment environment, or the appropriate scoped secret
162
+ store. Do not replace those placeholders with literal values in
163
+ `agent-native.ts`.
164
+
165
+ `diagnostics.failOnBuild` is for runtime configuration diagnostics. It is not
166
+ the same setting as the separate `doctor.failOnBuild` option documented in the
167
+ [Doctor guide](/docs/doctor).
168
+
169
+ ## Precedence and merge behavior
170
+
171
+ For a Vite app, the effective shared configuration follows this order:
172
+
173
+ 1. Framework defaults. First-run onboarding defaults to `off`; auth and a
174
+ persistent database default to required in production diagnostics.
175
+ 2. `agent-native.json` at the app root.
176
+ 3. The automatically loaded typed file, if present. The loader checks these
177
+ candidates in order: `agent-native.ts`, `agent-native.mts`,
178
+ `agent-native.config.ts`, `agent-native.config.mts`.
179
+ 4. An explicit `agentNativeConfig` passed to `agentNative()` or the legacy
180
+ `defineConfig()` wrapper. Supplying this option skips automatic typed-file
181
+ loading, while the explicit value still overlays `agent-native.json`.
182
+ 5. For onboarding only, the legacy public Vite variables
183
+ `VITE_AGENT_NATIVE_FIRST_RUN_ONBOARDING` and
184
+ `VITE_AGENT_NATIVE_FIRST_RUN_ONBOARDING_SKIP_INTEGRATIONS` can override the
185
+ resolved onboarding mode. Use the config file for new work.
186
+
187
+ Use only one of the four typed filenames. If more than one exists, the first
188
+ candidate in the loader's order wins, with `agent-native.ts` preferred for new
189
+ apps. The names are aliases, not four layers that are merged together.
190
+
191
+ The JSON and typed sources are merged by supported nested section:
192
+
193
+ - Nested objects such as `runtime.auth`, `runtime.database`,
194
+ `runtime.environment`, and `diagnostics` are deep-merged.
195
+ - Scalar values from the higher-precedence source replace lower-precedence
196
+ values.
197
+ - `runtime.environment.required` arrays are combined in base-then-override
198
+ order and de-duplicated.
199
+ - `onboarding.firstRun` is one setting. If the higher-precedence source
200
+ supplies it, it replaces the lower-precedence string or mode map as a whole.
201
+
202
+ For example, JSON can provide `runtime.auth.enabled` and
203
+ `NOTION_API_KEY`, while `agent-native.ts` adds `runtime.database.required` and
204
+ `GOOGLE_CLIENT_ID`. The result keeps the auth setting, adds the database
205
+ setting, and checks both environment names.
206
+
207
+ ## What is safe to commit
208
+
209
+ Safe committed values are public product defaults:
210
+
211
+ - `version`, onboarding modes, and mode names;
212
+ - `true`/`false` readiness and diagnostics decisions;
213
+ - environment variable names in `runtime.environment.required`;
214
+ - deterministic logic based on the Vite context.
215
+
216
+ Do not commit these values to either config format:
217
+
218
+ - API keys, OAuth client secrets, access tokens, signing keys, or passwords;
219
+ - `BETTER_AUTH_SECRET`, `A2A_SECRET`, database URLs, or credential-bearing
220
+ connection strings;
221
+ - secret values read from `.env` and copied into source;
222
+ - deployment-specific host, port, base-path, or auth-bypass values when they
223
+ vary by environment.
224
+
225
+ Even a value that is not a secret should stay in deployment configuration when
226
+ it changes between targets. `agent-native.ts` should describe the app's
227
+ public shape, not become a second environment-variable file.
228
+
229
+ ## `agent-native.json` compatibility
230
+
231
+ `agent-native.json` remains supported for fixed JSON configuration and for
232
+ other app-manifest sections already owned by the framework, such as `doctor`,
233
+ `apps`, and local-file declarations. Do not delete those sections just to add
234
+ typed shared configuration.
235
+
236
+ Use JSON when a scaffold, editor, or other tool needs a portable file that it
237
+ can read and write without evaluating TypeScript, or when the value is a fixed
238
+ default that never depends on the Vite command or mode:
239
+
240
+ ```json filename="agent-native.json"
241
+ {
242
+ "version": 1,
243
+ "onboarding": {
244
+ "firstRun": "connect"
81
245
  },
82
- }));
246
+ "runtime": {
247
+ "auth": { "enabled": true },
248
+ "database": { "required": true },
249
+ "environment": { "required": ["PUBLIC_API_ORIGIN"] }
250
+ },
251
+ "diagnostics": {
252
+ "failOnBuild": true
253
+ }
254
+ }
83
255
  ```
84
256
 
85
- The preset loads `agent-native.config.ts` or `agent-native.config.mts`
86
- automatically on the supported Node runtime. The TypeScript file takes
87
- precedence over the JSON app defaults. An explicit `agentNative({
88
- agentNativeConfig })` option takes precedence over both when an app needs to
89
- compose configuration in its Vite config.
90
-
91
- The resolved config is serialized into the browser bundle. Keep it public:
92
- never put API keys, tokens, database URLs, auth secrets, `AUTH_DISABLED`, or
93
- other credentials in either config file.
94
-
95
- ## Precedence and compatibility
96
-
97
- For a Vite app, the effective value is resolved in this order:
98
-
99
- 1. An explicit `agentNativeConfig` passed to `agentNative()` or `defineConfig()`.
100
- 2. The optional typed `agent-native.config.ts` or `.mts` file.
101
- 3. `agent-native.json`.
102
- 4. Framework defaults, which are `off` for first-run onboarding.
103
- 5. The legacy `VITE_AGENT_NATIVE_FIRST_RUN_ONBOARDING` flags can still
104
- override the resolved public config for older apps, but new apps should not
105
- add them. They are public browser flags and remain documented only for
106
- migration.
107
-
108
- The development Connect Builder card explains the deployment-level
109
- `ANTHROPIC_API_KEY` and `OPENAI_API_KEY` fallback and links to the
110
- [environment-variable reference](/docs/environment-variables). A key in the
111
- deployment environment is not a substitute for user- or organization-scoped
112
- credentials in a hosted multi-user app. See [Onboarding & API Keys](/docs/onboarding)
113
- and [Security](/docs/security) for the credential boundary.
114
-
115
- ## What belongs in config versus `.env`
116
-
117
- Good config candidates are public defaults that describe the product's shape:
118
-
119
- - first-run onboarding mode and other setup presentation defaults;
120
- - the app's default MCP catalog visibility or preset filters, once expressed
121
- through the shared config contract;
122
- - route warmup, public design tokens, and other build-time UX choices already
123
- passed to the `agentNative()` Vite preset;
124
- - non-secret app identity and default navigation metadata, if the framework
125
- later gives those values a shared runtime consumer.
126
-
127
- Keep these in environment variables or the secret store:
128
-
129
- - API keys, OAuth secrets, signing keys, database URLs, and provider tokens;
130
- - `APP_URL`, `APP_BASE_PATH`, deployment preset, port, and host-specific
131
- values that change between deploy targets;
132
- - `AUTH_DISABLED`, test switches, CI controls, and local machine paths;
133
- - runtime flags whose safe value depends on the hosting environment rather than
134
- the app's product contract.
135
-
136
- The complete inventory is [Environment Variables](/docs/environment-variables).
137
- That reference is intentionally broader than the config surface and is the
138
- source to consult before adding a new environment variable.
139
-
140
- ## Environment audit and next candidates
141
-
142
- The current config surface intentionally starts with onboarding, where a
143
- committed app default is more useful than a deployment flag. The next good
144
- public candidates are:
145
-
146
- | Candidate | Why it belongs in app config | Status |
147
- | ----------------------------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
148
- | MCP catalog visibility and preset filters | Describes which setup choices the app offers, not a secret or host policy. | A good next addition; currently keep using the `agentNative()` option. |
149
- | Route warmup strategy | A product-level loading preference that can be reviewed with the app. | A good next addition; currently keep using the `agentNative()` option. |
150
- | Default navigation or app identity | Makes generated apps open on the right domain route and name. | Add only after a shared runtime consumer exists. |
151
- | Design-system theme | Can vary intentionally per app, but is a larger structured object. | Keep in `vite.config.ts` or app code until the schema is stable. |
152
-
153
- Do not move `DATABASE_URL`, `APP_URL`, `PORT`, `NITRO_PRESET`, auth switches,
154
- provider keys, OAuth secrets, signing keys, telemetry endpoints, or security
155
- flags into this file. They vary by deploy target, affect trust boundaries, or
156
- must remain outside the browser bundle. This split keeps config useful for
157
- scaffolders without turning it into a second environment-variable system.
158
-
159
- ## Why there are two formats
160
-
161
- `agent-native.json` is portable, inspectable, and easy for scaffolders and
162
- other tools to write. `agent-native.config.ts` follows the typed-config pattern
163
- used by frameworks such as Next.js while keeping the browser contract
164
- serializable. Prefer JSON for a fixed app default and TypeScript when the
165
- default genuinely depends on the Vite command or mode.
257
+ For new app-owned configuration, prefer `agent-native.ts` when the app needs
258
+ types, a mode-aware factory, or a clear place to evolve public defaults. Keep
259
+ `agent-native.json` when portability or existing manifest sections are the
260
+ reason to use it. Both formats accept the same shared options shown above.
261
+
262
+ For deployment variables, credentials, and the exhaustive variable inventory,
263
+ see [Environment Variables](/docs/environment-variables). A deployment-level
264
+ key is not a substitute for user- or organization-scoped credentials in a
265
+ hosted multi-user app. See [Authentication](/docs/authentication) and
266
+ [Security](/docs/security) for those boundaries.
@@ -102,6 +102,23 @@ A few flags tune this; full details are in the [Environment Variables](#environm
102
102
 
103
103
  </Callout>
104
104
 
105
+ ## Local development sign-in {#local-development-sign-in}
106
+
107
+ On a loopback development server, the shared sign-in page puts **Continue as
108
+ local dev** first. It creates or reuses the real Better Auth development
109
+ account and session, so this is the same authenticated path used elsewhere.
110
+
111
+ Choose **Show full sign in options** to reveal normal signup, password, magic
112
+ link, and social-provider options. If the local session cannot be created, the
113
+ page reveals those options automatically so you can continue with standard
114
+ authentication.
115
+
116
+ This convenience is available only when the browser connects through
117
+ `localhost`, `127.0.0.0/8`, or `::1` in development or test. It is disabled for
118
+ deploy previews and hosted production. It is not an authentication bypass.
119
+ Set `AGENT_NATIVE_DISABLE_AUTO_DEV_ACCOUNT=1` to opt out and show the normal
120
+ sign-in page in local development.
121
+
105
122
  ## Better Auth (Default) {#better-auth}
106
123
 
107
124
  By default, Better Auth powers authentication. When outbound email is ready,
@@ -585,20 +585,25 @@ hosting behavior.
585
585
 
586
586
  Database connection variables (`DATABASE_URL`, `DATABASE_AUTH_TOKEN`, per-app `<APP_NAME>_DATABASE_URL`) live in [Database](/docs/database#production).
587
587
 
588
- ### Required in Production {#env-required-prod}
589
-
590
- 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.
591
-
592
- | Variable | Description |
593
- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
594
- | `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. |
595
- | `BETTER_AUTH_URL` | Public origin of this app (e.g. `https://mail.example.com`). Used for cookie domain and OAuth redirect construction. |
596
- | `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. |
597
- | `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`. |
598
- | `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. |
599
- | `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. |
600
- | `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. |
601
- | `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. |
588
+ ### Production-sensitive configuration {#env-required-prod}
589
+
590
+ These settings cover production-sensitive behavior. A standalone app using the
591
+ framework auth needs a stable `BETTER_AUTH_SECRET` and a persistent database;
592
+ the public auth URL is inferred from the request, known template, or hosting
593
+ platform when it is unset. Workspace and A2A settings are conditional on those
594
+ features. Missing values either fail-closed or fall back to weaker behavior
595
+ with a loud warning.
596
+
597
+ | Variable | Description |
598
+ | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
599
+ | `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. |
600
+ | `BETTER_AUTH_URL` | Optional public origin override for this app (e.g. `https://mail.example.com`). The framework infers it from request, known-template, and hosting-platform context when unset. |
601
+ | `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. |
602
+ | `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`. |
603
+ | `A2A_SECRET` | Shared HMAC for inter-app A2A JSON-RPC and signed background handoffs. Required for hosted workspace deploys and A2A features; without it, those endpoints fail closed 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. |
604
+ | `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. |
605
+ | `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. |
606
+ | `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. |
602
607
 
603
608
  ### Auth & Identity {#env-auth}
604
609
 
@@ -184,7 +184,7 @@ Full props: `AgentPanelProps` in `@agent-native/core/client`.
184
184
 
185
185
  ## Programmatic messages: `sendToAgentChat()` {#send}
186
186
 
187
- A button that hands work off to the agent (instead of running an inline `llm()` call — the anti-pattern from the [ladder](/docs/what-is-agent-native#the-ladder)):
187
+ A button that hands work off to the agent (instead of running an inline `llm()` call — the anti-pattern from the [ladder](/docs/what-is-agent-native#the-ladder)). For visible, user-initiated AI work, open the sidebar explicitly so the user can see, steer, and continue the same thread:
188
188
 
189
189
  ```tsx
190
190
  import { sendToAgentChat } from "@agent-native/core/client/agent-chat";
@@ -194,6 +194,7 @@ import { sendToAgentChat } from "@agent-native/core/client/agent-chat";
194
194
  message: "Generate a chart showing signups by source",
195
195
  context: `Dashboard ID: ${dashboardId}, date range: last 30 days`,
196
196
  submit: true,
197
+ openSidebar: true,
197
198
  })
198
199
  }
199
200
  >
@@ -208,7 +209,7 @@ import { sendToAgentChat } from "@agent-native/core/client/agent-chat";
208
209
  - **`submit`** — `true` to auto-run, `false` to prefill but wait. Omit to use the project default.
209
210
  - **`newTab`** — create a separate chat thread for this prompt.
210
211
  - **`background`** — with `newTab`, run without focusing the new thread. The hidden run is tracked in `RunsTray`.
211
- - **`openSidebar`** — set to `false` for background/silent sends. Default opens the sidebar so the user sees the response.
212
+ - **`openSidebar`** — use `true` for visible user-initiated AI work. Set to `false` only for explicitly silent background or system-initiated sends. The default opens the sidebar so the user sees the response.
212
213
  - **`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
214
 
214
215
  `sendToAgentChat` returns a stable `tabId` you can use to track the chat run.
@@ -229,6 +230,11 @@ sendToAgentChat({
229
230
  This is still a full agent run with tools, actions, thread state, and run
230
231
  tracking. It simply does not steal focus from the user's current sidebar state.
231
232
 
233
+ Keep follow-up and revision prompts in the existing sidebar thread. Do not add
234
+ a second freeform input beside the generated result. A small local form or
235
+ popover is appropriate for structured values the UI must validate, but the
236
+ conversation itself belongs in the AgentSidebar composer.
237
+
232
238
  When the same route is embedded as an MCP App, submitted
233
239
  `sendToAgentChat()` calls are forwarded to the host chat where supported; see
234
240
  [Client](/docs/client#sendtoagentchat) for the MCP App bridge behavior.
@@ -265,6 +271,16 @@ and avoid posting directly to `/_agent-native/agent-chat` from product UI. If a
265
271
  named helper is missing for a real custom surface, add that helper first so
266
272
  client code does not learn a second, ad hoc transport.
267
273
 
274
+ ## Choosing agent chat versus an action {#agent-or-action}
275
+
276
+ Use `useActionQuery` or `useActionMutation` directly for deterministic local
277
+ operations such as CRUD, validation, provider reads, and persistence. If the
278
+ user experiences the workflow as research, analysis, generation,
279
+ recommendation, synthesis, or other multi-step reasoning, start it with
280
+ `sendToAgentChat({ openSidebar: true })` and let the agent orchestrate focused
281
+ actions. Deterministic implementation alone is not a reason to hide an
282
+ AI-shaped workflow inside one opaque action.
283
+
268
284
  ## Typesafe actions from the UI: `useActionMutation()` {#use-action-mutation}
269
285
 
270
286
  When the UI needs to run the same operation an agent tool would run — rung 3 of the [ladder](/docs/what-is-agent-native#rung-three) — use `useActionMutation`:
@@ -324,6 +340,7 @@ export default function Root() {
324
340
  message: "Summarize this thread",
325
341
  context: `Thread id: ${threadId}`,
326
342
  submit: true,
343
+ openSidebar: true,
327
344
  })
328
345
  }
329
346
  >