@agent-native/core 0.137.7 → 0.138.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/agent-native.eject.json +2 -0
  2. package/corpus/README.md +1 -1
  3. package/corpus/templates/analytics/.agents/skills/agent-native-docs/SKILL.md +23 -3
  4. package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  5. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +15 -0
  6. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +23 -2
  7. package/corpus/templates/analytics/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  8. package/corpus/templates/analytics/AGENTS.md +2 -2
  9. package/corpus/templates/analytics/actions/get-first-party-analytics-health.ts +65 -0
  10. package/corpus/templates/analytics/actions/provider-api-catalog.ts +3 -6
  11. package/corpus/templates/analytics/actions/provider-api-docs.ts +3 -6
  12. package/corpus/templates/analytics/actions/provider-api-request.ts +3 -6
  13. package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +3 -3
  14. package/corpus/templates/analytics/agent-native.json +12 -0
  15. package/corpus/templates/analytics/app/i18n-data.ts +162 -0
  16. package/corpus/templates/analytics/app/pages/DataSources.tsx +126 -1
  17. package/corpus/templates/analytics/changelog/2026-08-05-analytics-now-flags-neon-pressure-and-guides-high-volume-tra.md +6 -0
  18. package/corpus/templates/analytics/changelog/2026-08-05-first-party-analytics-uses-compact-rollups-for-faster-usage-.md +6 -0
  19. package/corpus/templates/analytics/server/db/schema.ts +52 -0
  20. package/corpus/templates/analytics/server/lib/credential-keys.ts +3 -0
  21. package/corpus/templates/analytics/server/lib/first-party-analytics-health.ts +397 -0
  22. package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +182 -0
  23. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +86 -15
  24. package/corpus/templates/analytics/server/lib/provider-api.ts +20 -1
  25. package/corpus/templates/analytics/server/lib/replay-storage.ts +1 -1
  26. package/corpus/templates/analytics/server/plugins/agent-chat.ts +1 -0
  27. package/corpus/templates/analytics/server/plugins/db.ts +60 -0
  28. package/corpus/templates/assets/.agents/skills/agent-native-docs/SKILL.md +23 -3
  29. package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  30. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +23 -2
  31. package/corpus/templates/assets/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  32. package/corpus/templates/assets/agent-native.json +12 -0
  33. package/corpus/templates/assets/server/lib/generation.ts +8 -8
  34. package/corpus/templates/assets/server/lib/storage.ts +1 -1
  35. package/corpus/templates/assets/server/plugins/onboarding.ts +1 -1
  36. package/corpus/templates/brain/.agents/skills/agent-native-docs/SKILL.md +23 -3
  37. package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  38. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +23 -2
  39. package/corpus/templates/brain/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  40. package/corpus/templates/brain/agent-native.json +12 -0
  41. package/corpus/templates/calendar/.agents/skills/agent-native-docs/SKILL.md +23 -3
  42. package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  43. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +23 -2
  44. package/corpus/templates/calendar/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  45. package/corpus/templates/calendar/agent-native.json +12 -0
  46. package/corpus/templates/chat/.agents/skills/agent-native-docs/SKILL.md +23 -3
  47. package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  48. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +23 -2
  49. package/corpus/templates/chat/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  50. package/corpus/templates/chat/AGENTS.md +3 -0
  51. package/corpus/templates/chat/DESIGN.md +28 -0
  52. package/corpus/templates/chat/agent-native.json +12 -0
  53. package/corpus/templates/clips/.agents/skills/agent-native-docs/SKILL.md +23 -3
  54. package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  55. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +23 -2
  56. package/corpus/templates/clips/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  57. package/corpus/templates/clips/actions/cleanup-transcript.ts +2 -2
  58. package/corpus/templates/clips/actions/delete-recording-permanent.ts +3 -0
  59. package/corpus/templates/clips/actions/get-playback-position.ts +68 -0
  60. package/corpus/templates/clips/actions/import-loom-recording.ts +2 -2
  61. package/corpus/templates/clips/actions/save-playback-position.ts +80 -0
  62. package/corpus/templates/clips/actions/set-thumbnail.ts +1 -1
  63. package/corpus/templates/clips/agent-native.json +12 -0
  64. package/corpus/templates/clips/app/components/player/video-player.tsx +54 -5
  65. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +65 -18
  66. package/corpus/templates/clips/app/hooks/use-playback-position.ts +188 -0
  67. package/corpus/templates/clips/app/hooks/use-view-tracking.ts +6 -24
  68. package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
  69. package/corpus/templates/clips/app/lib/playback-position.ts +99 -0
  70. package/corpus/templates/clips/app/lib/viewer-session.ts +29 -0
  71. package/corpus/templates/clips/changelog/2026-08-05-clip-buffering-now-uses-buffering-copy-after-playback.md +6 -0
  72. package/corpus/templates/clips/changelog/2026-08-05-clips-remembers-your-playback-position-when-you-reopen-a-cli.md +6 -0
  73. package/corpus/templates/clips/desktop/package.json +1 -0
  74. package/corpus/templates/clips/desktop/src/app.tsx +70 -6
  75. package/corpus/templates/clips/desktop/src/components/AlertDialog.tsx +131 -0
  76. package/corpus/templates/clips/desktop/src/styles.css +129 -0
  77. package/corpus/templates/clips/learnings.defaults.md +1 -1
  78. package/corpus/templates/clips/server/db/schema.ts +18 -0
  79. package/corpus/templates/clips/server/lib/public-agent-context.ts +1 -1
  80. package/corpus/templates/clips/server/lib/video-storage.ts +1 -1
  81. package/corpus/templates/clips/server/plugins/db.ts +15 -0
  82. package/corpus/templates/clips/server/routes/api/media/index.post.ts +1 -1
  83. package/corpus/templates/content/.agents/skills/agent-native-docs/SKILL.md +23 -3
  84. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  85. package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +13 -0
  86. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +23 -2
  87. package/corpus/templates/content/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  88. package/corpus/templates/content/AGENTS.md +1 -0
  89. package/corpus/templates/content/actions/_content-database-mutation-lock.ts +41 -0
  90. package/corpus/templates/content/actions/_content-database-row-migration.ts +569 -0
  91. package/corpus/templates/content/actions/_database-source-utils.ts +82 -36
  92. package/corpus/templates/content/actions/_database-utils.ts +5 -0
  93. package/corpus/templates/content/actions/_delete-content-space.ts +25 -11
  94. package/corpus/templates/content/actions/add-database-item.ts +60 -42
  95. package/corpus/templates/content/actions/attach-content-database-source.ts +2 -0
  96. package/corpus/templates/content/actions/configure-document-property.ts +99 -104
  97. package/corpus/templates/content/actions/delete-content-database.ts +19 -7
  98. package/corpus/templates/content/actions/delete-document-property.ts +47 -58
  99. package/corpus/templates/content/actions/delete-document.ts +390 -167
  100. package/corpus/templates/content/actions/disconnect-content-database-source.ts +41 -24
  101. package/corpus/templates/content/actions/duplicate-database-item.ts +63 -31
  102. package/corpus/templates/content/actions/duplicate-database-items.ts +86 -43
  103. package/corpus/templates/content/actions/duplicate-document-property.ts +37 -14
  104. package/corpus/templates/content/actions/migrate-content-database-rows.ts +830 -0
  105. package/corpus/templates/content/actions/move-database-item.ts +14 -0
  106. package/corpus/templates/content/actions/permanently-delete-document.ts +27 -6
  107. package/corpus/templates/content/actions/remove-database-items.ts +13 -0
  108. package/corpus/templates/content/actions/reorder-document-property.ts +45 -46
  109. package/corpus/templates/content/actions/set-document-property.ts +68 -28
  110. package/corpus/templates/content/actions/submit-content-database-form.ts +49 -0
  111. package/corpus/templates/content/actions/transcribe-media.ts +1 -1
  112. package/corpus/templates/content/agent-native.json +12 -0
  113. package/corpus/templates/content/app/components/editor/image-upload.ts +2 -2
  114. package/corpus/templates/content/app/i18n-data.ts +1 -1
  115. package/corpus/templates/content/changelog/2026-08-01-content-can-reorganize-every-row-in-an-existing-database-as-.md +6 -0
  116. package/corpus/templates/content/parity/matrix.md +1 -1
  117. package/corpus/templates/content/parity/matrix.ts +4 -2
  118. package/corpus/templates/content/server/db/schema.ts +30 -0
  119. package/corpus/templates/content/server/plugins/db.ts +24 -0
  120. package/corpus/templates/content/server/plugins/onboarding.ts +2 -2
  121. package/corpus/templates/crm/.agents/skills/agent-native-docs/SKILL.md +23 -3
  122. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  123. package/corpus/templates/crm/agent-native.json +12 -0
  124. package/corpus/templates/design/.agents/skills/agent-native-docs/SKILL.md +23 -3
  125. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  126. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +2 -0
  127. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +23 -2
  128. package/corpus/templates/design/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  129. package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +2 -2
  130. package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +2 -2
  131. package/corpus/templates/design/actions/apply-design-token-edit.ts +1 -1
  132. package/corpus/templates/design/actions/capture-design-state.ts +1 -1
  133. package/corpus/templates/design/actions/connect-builder-app.ts +2 -2
  134. package/corpus/templates/design/actions/create-design-branch.ts +1 -1
  135. package/corpus/templates/design/actions/create-fusion-app.ts +3 -3
  136. package/corpus/templates/design/actions/deploy-design-preview.ts +1 -1
  137. package/corpus/templates/design/actions/generate-design.ts +3 -2
  138. package/corpus/templates/design/actions/get-component-details.ts +1 -1
  139. package/corpus/templates/design/actions/get-design-branch-diff.ts +1 -1
  140. package/corpus/templates/design/actions/index-components.ts +3 -3
  141. package/corpus/templates/design/actions/index-design-system-with-builder.ts +1 -1
  142. package/corpus/templates/design/actions/migrate-inline-design-to-app.ts +3 -3
  143. package/corpus/templates/design/actions/open-component-source.ts +1 -1
  144. package/corpus/templates/design/actions/update-design.ts +96 -14
  145. package/corpus/templates/design/agent-native.json +12 -0
  146. package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +7 -2
  147. package/corpus/templates/design/app/components/design/FigmaHydrationDialog.tsx +11 -2
  148. package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +1 -1
  149. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +8 -1
  150. package/corpus/templates/design/app/i18n-data.ts +53 -22
  151. package/corpus/templates/design/app/lib/design-file-upload.ts +2 -3
  152. package/corpus/templates/design/app/lib/upload-limits.ts +4 -0
  153. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +1 -1
  154. package/corpus/templates/design/changelog/2026-08-05-chat-attachments-now-warn-before-upload-when-they-exceed-the.md +6 -0
  155. package/corpus/templates/design/changelog/2026-08-05-figma-fig-uploads-now-show-a-clear-4-mb-limit-up-front-inste.md +6 -0
  156. package/corpus/templates/design/scripts/qa-figma-stress-import.ts +1 -1
  157. package/corpus/templates/design/server/handlers/import-design-file.ts +9 -5
  158. package/corpus/templates/design/server/handlers/uploads.ts +13 -9
  159. package/corpus/templates/design/server/lib/fig-file-limits.ts +2 -1
  160. package/corpus/templates/design/server/lib/figma-image-hydration.ts +1 -1
  161. package/corpus/templates/design/server/lib/figma-node-import.ts +1 -1
  162. package/corpus/templates/design/server/lib/request-body-limits.ts +11 -0
  163. package/corpus/templates/design/shared/canvas-frames.ts +81 -0
  164. package/corpus/templates/design/shared/design-source-capabilities.ts +25 -9
  165. package/corpus/templates/dispatch/.agents/skills/agent-native-docs/SKILL.md +23 -3
  166. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  167. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +23 -2
  168. package/corpus/templates/dispatch/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  169. package/corpus/templates/dispatch/agent-native.json +12 -0
  170. package/corpus/templates/factory/.agents/skills/agent-native-docs/SKILL.md +23 -3
  171. package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  172. package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +23 -2
  173. package/corpus/templates/factory/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  174. package/corpus/templates/factory/agent-native.json +12 -0
  175. package/corpus/templates/forms/.agents/skills/agent-native-docs/SKILL.md +23 -3
  176. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  177. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +23 -2
  178. package/corpus/templates/forms/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  179. package/corpus/templates/forms/actions/export-responses.ts +1 -1
  180. package/corpus/templates/forms/agent-native.json +12 -0
  181. package/corpus/templates/macros/.agents/skills/agent-native-docs/SKILL.md +23 -3
  182. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  183. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +23 -2
  184. package/corpus/templates/macros/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  185. package/corpus/templates/macros/agent-native.json +12 -0
  186. package/corpus/templates/mail/.agents/skills/agent-native-docs/SKILL.md +23 -3
  187. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  188. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +23 -2
  189. package/corpus/templates/mail/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  190. package/corpus/templates/mail/agent-native.json +12 -0
  191. package/corpus/templates/mail/app/i18n/en-US.ts +1 -1
  192. package/corpus/templates/mail/server/lib/media-upload.ts +1 -1
  193. package/corpus/templates/plan/.agents/skills/agent-native-docs/SKILL.md +23 -3
  194. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  195. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +23 -2
  196. package/corpus/templates/plan/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  197. package/corpus/templates/plan/agent-native.json +12 -0
  198. package/corpus/templates/plan/server/lib/plan-assets.ts +1 -1
  199. package/corpus/templates/slides/.agents/skills/agent-native-docs/SKILL.md +23 -3
  200. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  201. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +23 -2
  202. package/corpus/templates/slides/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  203. package/corpus/templates/slides/actions/generate-image-api.ts +1 -1
  204. package/corpus/templates/slides/actions/generate-slides-ai.ts +1 -1
  205. package/corpus/templates/slides/actions/import-file.ts +2 -2
  206. package/corpus/templates/slides/actions/index-design-system-with-builder.ts +1 -1
  207. package/corpus/templates/slides/agent-native.json +12 -0
  208. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +1 -1
  209. package/corpus/templates/slides/app/i18n/en-US.ts +2 -2
  210. package/corpus/templates/slides/app/lib/deck-sorting.ts +19 -0
  211. package/corpus/templates/slides/app/lib/image-drop-to-agent.ts +1 -1
  212. package/corpus/templates/slides/app/pages/Index.tsx +7 -2
  213. package/corpus/templates/slides/changelog/2026-08-05-decks-are-now-sorted-by-most-recently-updated.md +6 -0
  214. package/corpus/templates/slides/server/handlers/assets.ts +1 -1
  215. package/corpus/templates/slides/server/handlers/uploads.ts +1 -1
  216. package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +23 -3
  217. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  218. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +23 -2
  219. package/corpus/templates/tasks/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  220. package/corpus/templates/tasks/agent-native.json +12 -0
  221. package/dist/action.d.ts +6 -0
  222. package/dist/agent/engine/builder-engine.js +2 -2
  223. package/dist/agent/engine/credential-errors.d.ts +1 -1
  224. package/dist/agent/engine/credential-errors.js +2 -2
  225. package/dist/agent/production-agent.js +3 -2
  226. package/dist/brand-kit/fig/index.js +1 -1
  227. package/dist/cli/agent.js +45 -3
  228. package/dist/cli/code-agent-executor.js +2 -1
  229. package/dist/cli/create.d.ts +9 -1
  230. package/dist/cli/create.js +94 -1
  231. package/dist/cli/doctor.d.ts +8 -11
  232. package/dist/cli/doctor.js +92 -24
  233. package/dist/cli/index.js +6 -5
  234. package/dist/client/AgentAskPopover.d.ts +3 -1
  235. package/dist/client/AgentAskPopover.js +2 -2
  236. package/dist/client/AgentPanel.js +9 -3
  237. package/dist/client/AssistantChat.js +54 -33
  238. package/dist/client/MultiTabAssistantChat.js +1 -1
  239. package/dist/client/RouteTransitionIndicator.d.ts +7 -0
  240. package/dist/client/RouteTransitionIndicator.js +31 -0
  241. package/dist/client/agent-engine-key.js +1 -1
  242. package/dist/client/app-providers.js +11 -2
  243. package/dist/client/chat/message-components.js +1 -1
  244. package/dist/client/chat/run-recovery.js +1 -1
  245. package/dist/client/chat/tool-call-display.d.ts +3 -1
  246. package/dist/client/chat/tool-call-display.js +4 -3
  247. package/dist/client/chat-model-groups.d.ts +6 -0
  248. package/dist/client/chat-model-groups.js +11 -0
  249. package/dist/client/error-format.js +1 -1
  250. package/dist/client/i18n.js +1 -1
  251. package/dist/client/onboarding/FirstRunOnboarding.d.ts +5 -1
  252. package/dist/client/onboarding/FirstRunOnboarding.js +29 -13
  253. package/dist/client/onboarding/first-run-enabled.d.ts +6 -1
  254. package/dist/client/onboarding/first-run-enabled.js +33 -3
  255. package/dist/client/onboarding/use-onboarding.js +16 -11
  256. package/dist/client/require-session.js +13 -4
  257. package/dist/client/resources/mcp-integration-catalog.js +26 -0
  258. package/dist/client/resources/mcp-integration-logos.js +4 -0
  259. package/dist/client/route-warmup.js +56 -10
  260. package/dist/client/settings/AccountSettingsCard.js +78 -3
  261. package/dist/client/settings/SettingsPanel.js +1 -1
  262. package/dist/client/settings/VoiceTranscriptionSection.js +2 -2
  263. package/dist/client/settings/useBuilderStatus.js +1 -1
  264. package/dist/client/setup-connections/useBuilderConnectCardController.js +1 -1
  265. package/dist/client/ui/index.d.ts +1 -0
  266. package/dist/client/ui/index.js +1 -0
  267. package/dist/client/uploads/upload-editor-image.js +1 -1
  268. package/dist/client/use-chat-threads.js +3 -0
  269. package/dist/client/use-session.d.ts +11 -0
  270. package/dist/client/use-session.js +34 -6
  271. package/dist/collab/routes.d.ts +2 -2
  272. package/dist/config.d.ts +48 -0
  273. package/dist/config.js +111 -0
  274. package/dist/db/migrations.js +5 -0
  275. package/dist/eject/provider-api-definitions.d.ts +1 -1
  276. package/dist/eject/provider-api-definitions.js +1 -0
  277. package/dist/eject/remote-mcp-presets.js +1 -0
  278. package/dist/extensions/web-search-tool.js +2 -2
  279. package/dist/file-upload/actions/upload-image.js +1 -1
  280. package/dist/file-upload/registry.js +1 -1
  281. package/dist/guards/index.d.ts +3 -0
  282. package/dist/guards/index.js +2 -0
  283. package/dist/guards/no-empty-migrations.d.ts +14 -0
  284. package/dist/guards/no-empty-migrations.js +126 -0
  285. package/dist/index.browser.d.ts +1 -0
  286. package/dist/index.browser.js +3 -0
  287. package/dist/index.d.ts +1 -0
  288. package/dist/index.js +1 -0
  289. package/dist/localization/default-messages.d.ts +24 -0
  290. package/dist/localization/default-messages.js +26 -2
  291. package/dist/notifications/routes.d.ts +6 -6
  292. package/dist/onboarding/app-profile.js +1 -1
  293. package/dist/onboarding/plugin.d.ts +2 -0
  294. package/dist/onboarding/plugin.js +29 -2
  295. package/dist/progress/routes.d.ts +1 -1
  296. package/dist/provider-api/actions/custom-provider-registration.d.ts +16 -16
  297. package/dist/provider-api/actions/provider-api.d.ts +13 -13
  298. package/dist/provider-api/index.d.ts +4 -4
  299. package/dist/provider-api/index.js +35 -0
  300. package/dist/resources/handlers.d.ts +1 -1
  301. package/dist/resources/handlers.js +1 -1
  302. package/dist/scripts/docs/framework-search.d.ts +9 -0
  303. package/dist/scripts/docs/framework-search.js +239 -0
  304. package/dist/scripts/docs/index.js +1 -0
  305. package/dist/scripts/docs/search.d.ts +10 -0
  306. package/dist/scripts/docs/search.js +1 -1
  307. package/dist/scripts/docs/source-search.d.ts +10 -2
  308. package/dist/scripts/docs/source-search.js +108 -41
  309. package/dist/search-utils/index.d.ts +11 -0
  310. package/dist/search-utils/index.js +72 -0
  311. package/dist/server/action-change.d.ts +6 -0
  312. package/dist/server/action-change.js +28 -14
  313. package/dist/server/action-discovery.js +9 -0
  314. package/dist/server/action-routes.js +1 -0
  315. package/dist/server/agent-chat/browser-team-tools.js +1 -1
  316. package/dist/server/agent-chat/script-entries.js +43 -2
  317. package/dist/server/auth-login-mode.d.ts +8 -0
  318. package/dist/server/auth-login-mode.js +17 -0
  319. package/dist/server/auth.js +100 -15
  320. package/dist/server/better-auth-instance.d.ts +36 -0
  321. package/dist/server/better-auth-instance.js +25 -3
  322. package/dist/server/builder-design-systems.js +1 -1
  323. package/dist/server/core-routes-plugin.js +17 -14
  324. package/dist/server/credential-provider.js +3 -3
  325. package/dist/server/email-templates.d.ts +7 -0
  326. package/dist/server/email-templates.js +24 -0
  327. package/dist/server/email.d.ts +17 -0
  328. package/dist/server/email.js +22 -1
  329. package/dist/server/framework-request-handler.js +6 -0
  330. package/dist/server/onboarding-html.d.ts +2 -0
  331. package/dist/server/onboarding-html.js +169 -8
  332. package/dist/server/realtime-token.d.ts +1 -1
  333. package/dist/server/realtime-voice.js +1 -1
  334. package/dist/server/sentry.d.ts +1 -1
  335. package/dist/server/transcribe-voice.js +3 -3
  336. package/dist/shared/first-run-onboarding.d.ts +1 -0
  337. package/dist/shared/first-run-onboarding.js +1 -0
  338. package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +23 -3
  339. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  340. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +23 -2
  341. package/dist/templates/chat/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  342. package/dist/templates/chat/AGENTS.md +3 -0
  343. package/dist/templates/chat/DESIGN.md +28 -0
  344. package/dist/templates/chat/agent-native.json +12 -0
  345. package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +23 -3
  346. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  347. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +23 -2
  348. package/dist/templates/default/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  349. package/dist/templates/default/AGENTS.md +4 -0
  350. package/dist/templates/default/DESIGN.md +30 -0
  351. package/dist/templates/default/agent-native.json +9 -0
  352. package/dist/templates/default/app/i18n/ar-SA.ts +2 -2
  353. package/dist/templates/default/app/i18n/de-DE.ts +2 -2
  354. package/dist/templates/default/app/i18n/en-US.ts +2 -2
  355. package/dist/templates/default/app/i18n/es-ES.ts +2 -2
  356. package/dist/templates/default/app/i18n/fr-FR.ts +2 -2
  357. package/dist/templates/default/app/i18n/hi-IN.ts +2 -2
  358. package/dist/templates/default/app/i18n/ja-JP.ts +2 -2
  359. package/dist/templates/default/app/i18n/ko-KR.ts +2 -2
  360. package/dist/templates/default/app/i18n/pt-BR.ts +2 -2
  361. package/dist/templates/default/app/i18n/zh-CN.ts +2 -2
  362. package/dist/templates/default/app/i18n/zh-TW.ts +1 -1
  363. package/dist/templates/default/package.json +1 -0
  364. package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +23 -3
  365. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  366. package/dist/templates/headless/agent-native.json +9 -0
  367. package/dist/templates/headless/package.json +2 -0
  368. package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +23 -3
  369. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  370. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +23 -2
  371. package/dist/templates/workspace-core/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  372. package/dist/templates/workspace-core/AGENTS.md +3 -0
  373. package/dist/templates/workspace-core/DESIGN.md +35 -0
  374. package/dist/templates/workspace-root/AGENTS.md +3 -0
  375. package/dist/templates/workspace-root/DESIGN.md +35 -0
  376. package/dist/templates/workspace-root/agent-native.json +9 -0
  377. package/dist/templates/workspace-root/package.json +3 -0
  378. package/dist/transcription/builder-transcription.js +1 -1
  379. package/dist/user-profile/actions/change-password.d.ts +8 -0
  380. package/dist/user-profile/actions/change-password.js +24 -0
  381. package/dist/user-profile/actions/get-auth-methods.d.ts +6 -0
  382. package/dist/user-profile/actions/get-auth-methods.js +23 -0
  383. package/dist/user-profile/actions/set-password.d.ts +7 -0
  384. package/dist/user-profile/actions/set-password.js +23 -0
  385. package/dist/vite/client.d.ts +8 -1
  386. package/dist/vite/client.js +63 -12
  387. package/dist/vite/index.d.ts +1 -0
  388. package/dist/vite/index.js +1 -0
  389. package/docs/AGENTS.md +7 -2
  390. package/docs/SKILL.md +7 -5
  391. package/docs/content/agent-native-config.mdx +165 -0
  392. package/docs/content/agent-native-toolkit.mdx +1 -1
  393. package/docs/content/deployment.mdx +7 -2
  394. package/docs/content/doctor.mdx +21 -13
  395. package/docs/content/environment-variables.mdx +158 -0
  396. package/docs/content/file-uploads.mdx +1 -1
  397. package/docs/content/getting-started.mdx +1 -1
  398. package/docs/content/key-concepts.mdx +1 -1
  399. package/docs/content/multi-app-workspace.mdx +1 -1
  400. package/docs/content/template-clips-ai-and-editing.mdx +6 -6
  401. package/docs/content/template-clips-developers.mdx +3 -3
  402. package/docs/content/toolkit-settings.mdx +1 -1
  403. package/docs/content/voice-input.mdx +4 -4
  404. package/package.json +6 -2
  405. package/src/eject/provider-api-definitions.ts +1 -0
  406. package/src/eject/remote-mcp-presets.ts +1 -0
  407. package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +23 -3
  408. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  409. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +23 -2
  410. package/src/templates/chat/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  411. package/src/templates/chat/AGENTS.md +3 -0
  412. package/src/templates/chat/DESIGN.md +28 -0
  413. package/src/templates/chat/agent-native.json +12 -0
  414. package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +23 -3
  415. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  416. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +23 -2
  417. package/src/templates/default/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  418. package/src/templates/default/AGENTS.md +4 -0
  419. package/src/templates/default/DESIGN.md +30 -0
  420. package/src/templates/default/agent-native.json +9 -0
  421. package/src/templates/default/app/i18n/ar-SA.ts +2 -2
  422. package/src/templates/default/app/i18n/de-DE.ts +2 -2
  423. package/src/templates/default/app/i18n/en-US.ts +2 -2
  424. package/src/templates/default/app/i18n/es-ES.ts +2 -2
  425. package/src/templates/default/app/i18n/fr-FR.ts +2 -2
  426. package/src/templates/default/app/i18n/hi-IN.ts +2 -2
  427. package/src/templates/default/app/i18n/ja-JP.ts +2 -2
  428. package/src/templates/default/app/i18n/ko-KR.ts +2 -2
  429. package/src/templates/default/app/i18n/pt-BR.ts +2 -2
  430. package/src/templates/default/app/i18n/zh-CN.ts +2 -2
  431. package/src/templates/default/app/i18n/zh-TW.ts +1 -1
  432. package/src/templates/default/package.json +1 -0
  433. package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +23 -3
  434. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  435. package/src/templates/headless/agent-native.json +9 -0
  436. package/src/templates/headless/package.json +2 -0
  437. package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +23 -3
  438. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  439. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +23 -2
  440. package/src/templates/workspace-core/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  441. package/src/templates/workspace-core/AGENTS.md +3 -0
  442. package/src/templates/workspace-core/DESIGN.md +35 -0
  443. package/src/templates/workspace-root/AGENTS.md +3 -0
  444. package/src/templates/workspace-root/DESIGN.md +35 -0
  445. package/src/templates/workspace-root/agent-native.json +9 -0
  446. package/src/templates/workspace-root/package.json +3 -0
@@ -2,10 +2,11 @@ import { EventEmitter } from "events";
2
2
  import fs from "fs";
3
3
  import { createRequire, syncBuiltinESMExports } from "module";
4
4
  import path from "path";
5
- import { fileURLToPath } from "url";
5
+ import { fileURLToPath, pathToFileURL } from "url";
6
6
  import { renderDesignSystemThemeCss, } from "@agent-native/toolkit/design-system/theme";
7
7
  import { mergePendingChangelog, parsePendingEntry, } from "../changelog/parse.js";
8
8
  import { getViteDevRecoveryScript } from "../client/vite-dev-recovery-script.js";
9
+ import { mergeAgentNativeConfigs, normalizeAgentNativeConfig, resolveAgentNativeConfig, } from "../config.js";
9
10
  import { writeAgentNativeNitroPresetMarker } from "../deploy/nitro-preset.js";
10
11
  import { findWorkspaceRoot } from "../scripts/utils.js";
11
12
  import { verifyEmbedSessionToken } from "../server/embed-session.js";
@@ -820,8 +821,8 @@ function getReactRouterAliases(cwd) {
820
821
  function getAssistantUiAliases(cwd) {
821
822
  try {
822
823
  const appRequire = createRequire(path.join(cwd, "package.json"));
823
- const coreViteEntry = appRequire.resolve("@agent-native/core/vite");
824
- const coreRequire = createRequire(coreViteEntry);
824
+ const assistantUiEntry = appRequire.resolve("@assistant-ui/react");
825
+ const assistantUiRequire = createRequire(assistantUiEntry);
825
826
  return [
826
827
  // A linked framework checkout can otherwise resolve the assistant-ui
827
828
  // imports in core's source graph from the checkout's React 19.2.7 peer
@@ -830,27 +831,27 @@ function getAssistantUiAliases(cwd) {
830
831
  // to the consuming app's installed peer graph explicitly.
831
832
  {
832
833
  find: /^@assistant-ui\/react$/,
833
- replacement: coreRequire.resolve("@assistant-ui/react"),
834
+ replacement: assistantUiRequire.resolve("@assistant-ui/react"),
834
835
  },
835
836
  {
836
837
  find: /^@assistant-ui\/core$/,
837
- replacement: coreRequire.resolve("@assistant-ui/core"),
838
+ replacement: assistantUiRequire.resolve("@assistant-ui/core"),
838
839
  },
839
840
  {
840
841
  find: /^@assistant-ui\/store$/,
841
- replacement: coreRequire.resolve("@assistant-ui/store"),
842
+ replacement: assistantUiRequire.resolve("@assistant-ui/store"),
842
843
  },
843
844
  {
844
845
  find: /^@assistant-ui\/tap$/,
845
- replacement: coreRequire.resolve("@assistant-ui/tap"),
846
+ replacement: assistantUiRequire.resolve("@assistant-ui/tap"),
846
847
  },
847
848
  {
848
849
  find: /^assistant-stream$/,
849
- replacement: coreRequire.resolve("assistant-stream"),
850
+ replacement: assistantUiRequire.resolve("assistant-stream"),
850
851
  },
851
852
  {
852
853
  find: /^assistant-stream\/utils$/,
853
- replacement: coreRequire.resolve("assistant-stream/utils"),
854
+ replacement: assistantUiRequire.resolve("assistant-stream/utils"),
854
855
  },
855
856
  ];
856
857
  }
@@ -2608,8 +2609,54 @@ function resolveAgentNativeTemplate(cwd) {
2608
2609
  ?.trim()
2609
2610
  .toLowerCase() ?? "");
2610
2611
  }
2611
- function createAgentNativeConfig(options = {}, command, userConfig = {}) {
2612
+ function createAgentNativeConfigContext(command, mode) {
2613
+ const resolvedCommand = command === "build" ? "build" : "serve";
2614
+ return {
2615
+ command: resolvedCommand,
2616
+ mode,
2617
+ isDev: resolvedCommand === "serve",
2618
+ isBuild: resolvedCommand === "build",
2619
+ };
2620
+ }
2621
+ function readAgentNativeJsonConfig(cwd) {
2622
+ const configPath = path.join(cwd, "agent-native.json");
2623
+ if (!fs.existsSync(configPath))
2624
+ return {};
2625
+ let parsed;
2626
+ try {
2627
+ parsed = JSON.parse(fs.readFileSync(configPath, "utf8"));
2628
+ }
2629
+ catch (error) {
2630
+ throw new Error(`Could not read ${configPath}: ${error instanceof Error ? error.message : String(error)}`);
2631
+ }
2632
+ return normalizeAgentNativeConfig(parsed, configPath);
2633
+ }
2634
+ async function loadAgentNativeConfigFile(cwd) {
2635
+ const candidates = ["agent-native.config.ts", "agent-native.config.mts"];
2636
+ const configPath = candidates
2637
+ .map((filename) => path.join(cwd, filename))
2638
+ .find((candidate) => fs.existsSync(candidate));
2639
+ if (!configPath)
2640
+ return undefined;
2641
+ try {
2642
+ const module = (await import(pathToFileURL(configPath).href));
2643
+ const config = module.default ?? module.agentNativeConfig;
2644
+ if (typeof config !== "object" && typeof config !== "function") {
2645
+ throw new Error("the default export must be an object or function");
2646
+ }
2647
+ return config;
2648
+ }
2649
+ catch (error) {
2650
+ throw new Error(`Could not load ${configPath}: ${error instanceof Error ? error.message : String(error)}`);
2651
+ }
2652
+ }
2653
+ function createAgentNativeConfig(options = {}, command, userConfig = {}, mode = process.env.NODE_ENV === "production" ? "production" : "development", projectConfig) {
2612
2654
  const cwd = process.cwd();
2655
+ const configContext = createAgentNativeConfigContext(command, mode);
2656
+ const projectConfigInput = projectConfig ?? options.agentNativeConfig;
2657
+ const appConfig = resolveAgentNativeConfig(mergeAgentNativeConfigs(readAgentNativeJsonConfig(cwd), projectConfigInput
2658
+ ? resolveAgentNativeConfig(projectConfigInput, configContext)
2659
+ : {}), configContext);
2613
2660
  const buildId = process.env.DEPLOY_ID?.trim() ||
2614
2661
  process.env.COMMIT_REF?.trim() ||
2615
2662
  process.env.VERCEL_GIT_COMMIT_SHA?.trim() ||
@@ -2688,6 +2735,7 @@ function createAgentNativeConfig(options = {}, command, userConfig = {}) {
2688
2735
  ...(options.define ?? {}),
2689
2736
  __AGENT_NATIVE_BUILD_ID__: JSON.stringify(buildId),
2690
2737
  __AGENT_NATIVE_CLIENT_COMPATIBILITY_VERSION__: JSON.stringify(options.clientCompatibilityVersion?.trim() || ""),
2738
+ __AGENT_NATIVE_APP_CONFIG__: JSON.stringify(appConfig),
2691
2739
  __AGENT_NATIVE_BUILD_GA_MEASUREMENT_ID__: JSON.stringify(process.env.GA_MEASUREMENT_ID?.trim() || ""),
2692
2740
  "process.env.AGENT_NATIVE_BUILD_GA_MEASUREMENT_ID": JSON.stringify(process.env.GA_MEASUREMENT_ID?.trim() || ""),
2693
2741
  __AGENT_NATIVE_BUILD_GTM_CONTAINER_ID__: JSON.stringify(process.env.GTM_CONTAINER_ID?.trim() || ""),
@@ -2917,8 +2965,11 @@ export function agentNative(options = {}) {
2917
2965
  {
2918
2966
  name: "agent-native-config",
2919
2967
  enforce: "pre",
2920
- config(config, env) {
2921
- return createAgentNativeConfig(options, env.command, config);
2968
+ async config(config, env) {
2969
+ const projectConfig = options.agentNativeConfig === undefined
2970
+ ? await loadAgentNativeConfigFile(process.cwd())
2971
+ : undefined;
2972
+ return createAgentNativeConfig(options, env.command, config, env.mode, projectConfig);
2922
2973
  },
2923
2974
  },
2924
2975
  ...createAgentNativePlugins(options, {
@@ -1,4 +1,5 @@
1
1
  export { agentNative, defineConfig, type AgentNativeVitePluginOptions, type ClientConfigOptions, type NitroOptions, } from "./client.js";
2
+ export { defineAgentNativeConfig, type AgentNativeConfig, type AgentNativeConfigContext, type AgentNativeConfigFactory, type AgentNativeConfigInput, type AgentNativeFirstRunOnboardingMode, type AgentNativeFirstRunOnboardingSetting, } from "../config.js";
2
3
  export type { AgentNativeRouteWarmupConfigInput, AgentNativeRouteWarmupResolvedConfig, AgentNativeRouteWarmupStrategy, } from "../shared/route-warmup-config.js";
3
4
  export { actionTypesPlugin, generateActionRegistryForProject, } from "./action-types-plugin.js";
4
5
  export { agentsBundlePlugin } from "./agents-bundle-plugin.js";
@@ -1,4 +1,5 @@
1
1
  export { agentNative, defineConfig, } from "./client.js";
2
+ export { defineAgentNativeConfig, } from "../config.js";
2
3
  export { actionTypesPlugin, generateActionRegistryForProject, } from "./action-types-plugin.js";
3
4
  export { agentsBundlePlugin } from "./agents-bundle-plugin.js";
4
5
  export { createAgentWebVitePlugin, } from "./agent-web-plugin.js";
package/docs/AGENTS.md CHANGED
@@ -21,6 +21,9 @@ version installed in the app.
21
21
  From a generated app root:
22
22
 
23
23
  ```bash
24
+ pnpm action framework-search --pattern "defineAction"
25
+ pnpm action framework-search --pattern "templates/*/actions/*.ts" --mode glob --scope source
26
+ pnpm action framework-search --pattern "Agent(?:Panel|Sidebar)" --mode regex --scope source
24
27
  pnpm action docs-search --list
25
28
  pnpm action docs-search --query "actions"
26
29
  pnpm action docs-search --slug actions
@@ -30,8 +33,10 @@ pnpm action source-search --path templates/plan/AGENTS.md
30
33
  pnpm action source-search --path templates/chat/actions/hello.ts
31
34
  ```
32
35
 
33
- The built-in app agent also has read-only `docs-search` and `source-search`
34
- tools with the same options.
36
+ The built-in app agent also has a read-only `framework-search` tool for one
37
+ bounded search across docs and readable Core, Toolkit, and first-party
38
+ template source. Use `docs-search` and `source-search` for focused reads after
39
+ it identifies the relevant page or file.
35
40
 
36
41
  If the action runner is unavailable, search the package files directly:
37
42
 
package/docs/SKILL.md CHANGED
@@ -14,14 +14,16 @@ examples or template patterns matter, inspect the packaged source corpus too.
14
14
  ## How
15
15
 
16
16
  1. Start from the generated app root.
17
- 2. Search with `pnpm action docs-search --query "<feature>"`.
18
- 3. Read a specific page with `pnpm action docs-search --slug <slug>`.
19
- 4. Search source examples with `pnpm action source-search --query "<pattern>"`
17
+ 2. Start cross-corpus discovery with `pnpm action framework-search --pattern "<feature>"`.
18
+ 3. Use `--scope docs` or `--scope source` and `--mode glob`, `--mode sql-like`,
19
+ or `--mode regex` when the question needs a narrower pattern.
20
+ 4. Read a specific page with `pnpm action docs-search --slug <slug>`.
21
+ 5. Search source examples with `pnpm action source-search --query "<pattern>"`
20
22
  or read a file with `pnpm action source-search --path <path>`.
21
- 5. If the action runner is unavailable, search
23
+ 6. If the action runner is unavailable, search
22
24
  `node_modules/@agent-native/core/docs` directly with `rg`.
23
25
  Search `node_modules/@agent-native/core/corpus` for source examples.
24
- 6. For app-specific rules, also read the app's own `AGENTS.md` and any relevant
26
+ 7. For app-specific rules, also read the app's own `AGENTS.md` and any relevant
25
27
  `.agents/skills/<name>/SKILL.md`.
26
28
 
27
29
  ## Useful Slugs
@@ -0,0 +1,165 @@
1
+ ---
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"
5
+ ---
6
+
7
+ # Agent-Native app configuration
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.
13
+
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.
18
+
19
+ ## The onboarding contract
20
+
21
+ The shared first-run surface has three supported modes:
22
+
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. |
28
+
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:
31
+
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
+ }
42
+ ```
43
+
44
+ An ordinary app can omit `onboarding` or make the default explicit:
45
+
46
+ ```json filename="agent-native.json"
47
+ {
48
+ "version": 1,
49
+ "onboarding": {
50
+ "firstRun": "off"
51
+ }
52
+ }
53
+ ```
54
+
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.
60
+
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.
65
+
66
+ ## Typed dynamic configuration
67
+
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:
70
+
71
+ ```ts filename="agent-native.config.ts"
72
+ import { defineAgentNativeConfig } from "@agent-native/core/config";
73
+
74
+ export default defineAgentNativeConfig(({ command, mode }) => ({
75
+ version: 1,
76
+ onboarding: {
77
+ firstRun:
78
+ command === "serve" || mode === "preview"
79
+ ? "connect"
80
+ : "connect-and-integrations",
81
+ },
82
+ }));
83
+ ```
84
+
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.
@@ -97,7 +97,7 @@ directly without adopting Toolkit or a template.
97
97
  | [Collaboration](/docs/toolkit-collaboration) | Realtime editing, presence, live cursors, recent-edit highlights, collaborative undo. |
98
98
  | [Settings](/docs/toolkit-settings) | Standard settings pages and tabs so app settings and agent/provider settings live in one predictable place. |
99
99
  | [Org & Team](/docs/toolkit-org-team) | Team pages, org switching, invites, org domains, roles, and app switching. |
100
- | [Setup & Connections](/docs/toolkit-setup-connections) | Onboarding, secrets, workspace connections, OAuth/provider readiness, and Builder connect. |
100
+ | [Setup & Connections](/docs/toolkit-setup-connections) | Onboarding, secrets, workspace connections, OAuth/provider readiness, and Builder connect (free tier available). |
101
101
  | [Command & Navigation](/docs/toolkit-command-navigation) | Command menu, deep links, standard app routes, sidebar and shell patterns. |
102
102
  | [Resources](/docs/toolkit-resources) | Resource trees, editors, file picker/search, attachments, and local file mode. |
103
103
  | [Agent UX](/docs/toolkit-agent-ux) | Composer, model picker, context chips, approvals, run recovery, and the runs tray. |
@@ -517,6 +517,11 @@ Three things to keep in mind:
517
517
 
518
518
  ## Environment Variables {#environment-variables}
519
519
 
520
+ For the repository-wide reference, including template, provider, local, and CI
521
+ variables, see [Environment Variables](/docs/environment-variables). The tables
522
+ below remain the authoritative deployment guide for production values and
523
+ hosting behavior.
524
+
520
525
  ### Build / Runtime {#env-runtime}
521
526
 
522
527
  | Variable | Description |
@@ -640,11 +645,11 @@ In a standard production deployment with [production code execution](#production
640
645
 
641
646
  ### Builder.io: Visual Editing in Production {#builderio}
642
647
 
643
- [Builder.io](https://www.builder.io?utm_source=agent-native&utm_medium=docs&utm_campaign=framework&utm_content=deployment) is a separate managed code-capable workflow where an agent can modify your app's UI in production. Connect your repo to Builder.io and prompt for UI changes directly — no redeploy needed.
648
+ [Builder.io](https://www.builder.io?utm_source=agent-native&utm_medium=docs&utm_campaign=framework&utm_content=deployment) is a separate managed code-capable workflow where an agent can modify your app's UI in production. Connect your repo to Builder.io (free tier available) and prompt for UI changes directly — no redeploy needed.
644
649
 
645
650
  **How it works:**
646
651
 
647
- 1. Connect your agent-native repo to Builder.io
652
+ 1. Connect your agent-native repo to Builder.io (free tier available)
648
653
  2. Builder.io provides a cloud frame with the agent, visual editing, and real-time collaboration
649
654
  3. Prompt the agent to make UI changes — it edits your components, routes, and styles live
650
655
  4. Changes are committed back to your repo
@@ -1,18 +1,20 @@
1
1
  ---
2
2
  title: "Doctor (Code Checks)"
3
- description: "agent-native doctor scans a generated app's source for the framework's security and architecture invariants — the same code-safety guards this monorepo enforces on itself, ported to run against a single app root."
3
+ description: "agent-native doctor scans generated app and workspace source for the framework's security and architecture invariants — the portable code-safety guards shared outside the monorepo CI suite."
4
4
  ---
5
5
 
6
6
  # Doctor (Code Checks)
7
7
 
8
- Generated apps contain source code that can be changed through the repository's
8
+ Generated apps and workspaces contain source code that can be changed through the repository's
9
9
  development workflow, including by an agent frame intentionally granted
10
10
  workspace and write tooling. `agent-native doctor` is the automated check for that: it
11
11
  scans app source for the framework's security-critical code-safety invariants —
12
12
  the same class of check that lives in this framework's own CI as
13
- `scripts/guard-*.mjs` — ported to run against a single generated app instead of
14
- the framework's multi-template monorepo layout. It's read-only: doctor never
15
- edits your code, it only reports.
13
+ `scripts/guard-*.mjs` — ported to run against generated projects instead of
14
+ the framework's multi-template monorepo layout. A workspace-root run scans each
15
+ `apps/<name>` project and the workspace's `packages/shared` package when present,
16
+ prefixing findings with the project path. It's read-only: doctor never edits
17
+ your code, it only reports.
16
18
 
17
19
  ## Quick start {#quick-start}
18
20
 
@@ -20,12 +22,17 @@ edits your code, it only reports.
20
22
  agent-native doctor
21
23
  ```
22
24
 
23
- Every scaffolded app also gets a `pnpm doctor` script that runs the same command:
25
+ Every scaffolded app and workspace gets the collision-free
26
+ `pnpm agent-native:doctor` command. When a template does not already define its
27
+ own `doctor` script, the CLI also adds the shorter `pnpm doctor` alias:
24
28
 
25
29
  ```bash
26
30
  pnpm doctor
27
31
  ```
28
32
 
33
+ The full framework-repository `pnpm guards` suite remains a monorepo check;
34
+ generated projects use this version-matched portable Doctor surface instead.
35
+
29
36
  A clean run:
30
37
 
31
38
  ```
@@ -83,7 +90,7 @@ installed.
83
90
  agent-native doctor Scan app source for security-critical guard violations
84
91
  agent-native doctor --json Machine-readable report: { ok, findings, guardsRun, strict }
85
92
  agent-native doctor --only <guard,guard> Run only the named guard(s)
86
- agent-native doctor --strict Escalate findings to a hard failure when used by `agent-native build --strict`
93
+ agent-native doctor --strict Keep the build gate explicit when invoked by `agent-native build`
87
94
  agent-native doctor --cwd <dir> Run against a project root other than the current directory
88
95
  agent-native doctor --fix Not implemented in this version
89
96
  agent-native doctor --help Show this help
@@ -97,16 +104,16 @@ Exit codes: **`0`** clean, **`1`** findings present, **`2`** usage or execution
97
104
 
98
105
  ## The build hook {#build-hook}
99
106
 
100
- `agent-native build` always runs doctor as a pre-step before the real build. It's **warn-only by default**: findings print to stderr prefixed `[doctor]`, and the build continues. It only turns findings into a hard failure `process.exit(1)` before the build runs when:
107
+ `agent-native build` always runs doctor as a pre-step before the real build. It is a **hard gate by default**: findings print to stderr prefixed `[doctor]`, and the build exits before publishing. A project using `agent-native build` can explicitly opt out with `failOnBuild: false`, but `--strict` always keeps the gate enabled. Community templates that use another build command receive a strict `prebuild` hook instead:
101
108
 
102
- - `agent-native build --strict` was passed, or
103
- - `agent-native.json` sets `{ "doctor": { "failOnBuild": true } }`.
109
+ - `agent-native.json` sets `{ "doctor": { "failOnBuild": false } }` only when that exception has been reviewed.
104
110
 
105
- If the doctor pre-step itself throws — an unreadable file, a bug in a guard — the build step catches it, logs a warning, and continues. A doctor bug never blocks a deploy on its own.
111
+ If the doctor pre-step itself throws — for example, because a source file is unreadable or a guard crashes — the build is blocked. A partial security scan must never look like a clean result.
106
112
 
107
113
  ## Per-app configuration {#config}
108
114
 
109
- `agent-native.json`'s optional `"doctor"` key. Every field is optional with an empty/false default, so a fresh app runs every v1 guard with zero config:
115
+ `agent-native.json`'s optional `"doctor"` key. A fresh app runs every v1 guard
116
+ with zero config and fails builds on findings by default:
110
117
 
111
118
  ```json
112
119
  {
@@ -124,7 +131,7 @@ If the doctor pre-step itself throws — an unreadable file, a bug in a guard
124
131
  | ----------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
125
132
  | `disabledGuards` | `string[]` | Guard names (from the table above) to skip — excluded from the default run and from the build hook. An explicit `--only` list overrides this and runs even a disabled guard. |
126
133
  | `dbToolScopingDenylist` | `Record<table, reason>` | Bare table name (the SQL name, not template-prefixed) → reviewer-readable reason. Used only by `db-tool-scoping`. A denylist entry with no matching table in `server/db/schema.ts` itself becomes a finding — "stale … entry — remove it." |
127
- | `failOnBuild` | `boolean` | See [The build hook](#build-hook). Default `false`. |
134
+ | `failOnBuild` | `boolean` | See [The build hook](#build-hook). Default `true`; set `false` only for a reviewed exception. |
128
135
 
129
136
  ## Opt-out markers {#opt-out}
130
137
 
@@ -174,6 +181,7 @@ The actual `--json` payload also carries a `strict` field reflecting whether `--
174
181
  "explicit-collab-access",
175
182
  "migration-manifest"
176
183
  ],
184
+ "workspaceApps": ["apps/mail", "apps/tasks"],
177
185
  "strict": false
178
186
  }
179
187
  ```