@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
@@ -9,6 +9,7 @@ import { McpIntegrationDialog } from "../resources/McpIntegrationDialog.js";
9
9
  import { formatMcpServerError, useCreateMcpServer, useMcpServers, } from "../resources/use-mcp-servers.js";
10
10
  import { useBuilderConnectFlow } from "../settings/useBuilderStatus.js";
11
11
  import { cn } from "../utils.js";
12
+ import { shouldSkipFirstRunIntegrations } from "./first-run-enabled.js";
12
13
  import { useOnboarding } from "./use-onboarding.js";
13
14
  import { useOnboardingPreviewMode } from "./use-preview-mode.js";
14
15
  const BUILDER_MORE_SERVICES = [
@@ -21,7 +22,7 @@ const BUILDER_MORE_SERVICES = [
21
22
  "Browser automation",
22
23
  "Embeddings",
23
24
  ];
24
- export function FirstRunOnboarding() {
25
+ export function FirstRunOnboarding({ skipIntegrations = shouldSkipFirstRunIntegrations(), } = {}) {
25
26
  const previewMode = useOnboardingPreviewMode();
26
27
  const { firstRun, loading, error, profile, completeFirstRun } = useOnboarding({ preview: previewMode });
27
28
  const [screen, setScreen] = useState("intro");
@@ -48,7 +49,7 @@ export function FirstRunOnboarding() {
48
49
  const canCreateOrgMcp = Boolean(hasOrg &&
49
50
  (mcpServersQuery.data?.role === "owner" ||
50
51
  mcpServersQuery.data?.role === "admin"));
51
- const showTools = () => setScreen("tools");
52
+ const showTools = () => setScreen(skipIntegrations ? "ready" : "tools");
52
53
  const connectFlow = useBuilderConnectFlow({
53
54
  enabled: firstRun && !previewMode,
54
55
  trackingSource: "first_run_onboarding",
@@ -66,7 +67,7 @@ export function FirstRunOnboarding() {
66
67
  const builderCapabilities = profile.capabilities.filter((capability) => capability.builderIncluded);
67
68
  const handleBuilder = () => {
68
69
  if (previewMode) {
69
- setScreen("tools");
70
+ showTools();
70
71
  return;
71
72
  }
72
73
  if (connectFlow.hasFetchedStatus && connectFlow.configured) {
@@ -145,10 +146,10 @@ export function FirstRunOnboarding() {
145
146
  return;
146
147
  event.preventDefault();
147
148
  setScreen("manual");
148
- }, children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-sm font-semibold", children: "Use my own keys" }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "See what this app needs" })] }), _jsx(IconKey, { className: "text-muted-foreground", size: 17 })] }), _jsx(CapabilityList, { capabilities: profile.capabilities, compact: true, className: "mt-5 border-t border-border pt-3" })] })] })] }) }));
149
+ }, children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-sm font-semibold", children: "Use my own keys" }), _jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "See what this app needs" })] }), _jsx(IconKey, { className: "text-muted-foreground", size: 17 })] }), _jsx(CapabilityList, { capabilities: profile.capabilities, compact: true, className: "mt-5 border-t border-border pt-3" })] })] }), import.meta.env.DEV ? (_jsxs("p", { "data-testid": "first-run-local-provider-note", className: "mx-auto max-w-2xl text-center text-[11px] leading-5 text-muted-foreground", children: ["Or set", " ", _jsx("code", { className: "rounded bg-muted px-1", children: "ANTHROPIC_API_KEY" }), " ", "or ", _jsx("code", { className: "rounded bg-muted px-1", children: "OPENAI_API_KEY" }), " ", "in ", _jsx("code", { className: "rounded bg-muted px-1", children: ".env" }), " to make that provider available to everyone using this app.", " ", _jsxs("a", { href: "https://agent-native.com/docs/environment-variables", target: "_blank", rel: "noreferrer", className: "inline-flex items-center gap-1 text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: ["Read the setup guide", _jsx(IconExternalLink, { size: 12 })] })] })) : null] }) }));
149
150
  }
150
151
  if (screen === "manual") {
151
- return (_jsx(OnboardingShell, { profile: profile, screen: "choice", children: _jsxs("div", { className: "mx-auto flex w-full max-w-xl flex-col gap-4", children: [_jsxs("div", { children: [_jsx("button", { type: "button", className: "mb-4 text-xs text-muted-foreground hover:text-foreground", onClick: () => setScreen("choice"), children: "Back" }), _jsx("h1", { className: "text-xl font-semibold tracking-[-0.04em] sm:text-2xl", children: "Your keys" })] }), _jsxs("div", { className: "rounded-xl border border-border bg-card p-4", children: [_jsx(CapabilityList, { capabilities: profile.capabilities }), _jsxs("div", { className: "mt-5 flex flex-col-reverse gap-2 border-t border-border pt-4 sm:flex-row sm:justify-between", children: [_jsx("button", { type: "button", className: secondaryButtonClass, onClick: () => setScreen("choice"), children: "Back" }), _jsxs("button", { type: "button", className: primaryButtonClass, onClick: handleOpenSettings, children: ["Open key settings", _jsx(IconArrowRight, { size: 15 })] }), _jsx("button", { type: "button", className: secondaryButtonClass, onClick: () => setScreen("tools"), children: "Continue to tools" })] })] })] }) }));
152
+ return (_jsx(OnboardingShell, { profile: profile, screen: "choice", children: _jsxs("div", { className: "mx-auto flex w-full max-w-xl flex-col gap-4", children: [_jsxs("div", { children: [_jsx("button", { type: "button", className: "mb-4 text-xs text-muted-foreground hover:text-foreground", onClick: () => setScreen("choice"), children: "Back" }), _jsx("h1", { className: "text-xl font-semibold tracking-[-0.04em] sm:text-2xl", children: "Your keys" })] }), _jsxs("div", { className: "rounded-xl border border-border bg-card p-4", children: [_jsx(CapabilityList, { capabilities: profile.capabilities }), _jsxs("div", { className: "mt-5 flex flex-col-reverse gap-2 border-t border-border pt-4 sm:flex-row sm:justify-between", children: [_jsx("button", { type: "button", className: secondaryButtonClass, onClick: () => setScreen("choice"), children: "Back" }), _jsxs("button", { type: "button", className: primaryButtonClass, onClick: handleOpenSettings, children: ["Open key settings", _jsx(IconArrowRight, { size: 15 })] }), _jsx("button", { type: "button", className: secondaryButtonClass, onClick: () => setScreen(skipIntegrations ? "ready" : "tools"), children: skipIntegrations ? "Continue" : "Continue to tools" })] })] })] }) }));
152
153
  }
153
154
  if (screen === "tools") {
154
155
  return (_jsxs(OnboardingShell, { profile: profile, screen: "tools", footer: _jsxs("div", { "data-testid": "onboarding-tools-footer", className: "mx-auto flex w-full max-w-3xl flex-wrap items-center justify-end gap-2", children: [_jsx("button", { type: "button", className: secondaryButtonClass, onClick: handleFinish, children: "Skip for now" }), _jsxs("button", { type: "button", className: primaryButtonClass, onClick: handleFinish, children: ["Continue", _jsx(IconArrowRight, { size: 15 })] })] }), children: [_jsxs("div", { className: "mx-auto flex w-full max-w-4xl flex-col gap-5", children: [_jsxs("div", { className: "text-center", children: [_jsx("div", { className: "mx-auto flex size-11 items-center justify-center rounded-2xl bg-primary/10 text-primary", children: _jsx(IconPlugConnected, { size: 22 }) }), _jsx("h1", { className: "mt-5 text-2xl font-semibold tracking-[-0.05em] sm:text-3xl", children: "This app is an agent." }), _jsx("p", { className: "mt-3 text-sm leading-6 text-muted-foreground", children: "Search the catalog and connect what you need. The onboarding stays open while you add integrations." })] }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex flex-col gap-3 border-b border-border pb-4", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: "Agent integrations" }), _jsxs("span", { className: "text-xs text-muted-foreground", children: [mcpIntegrations.length, " of ", mcpCatalog.length] })] }), _jsxs("label", { className: "relative", children: [_jsx(IconSearch, { className: "pointer-events-none absolute start-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), _jsx("input", { value: integrationQuery, onChange: (event) => setIntegrationQuery(event.target.value), className: "h-9 w-full rounded-md border border-border bg-background pe-3 ps-8 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring", placeholder: "Search integrations", "aria-label": "Search integrations" })] }), connectError && (_jsx("p", { className: "text-xs leading-5 text-destructive", children: connectError }))] }), _jsx("div", { children: mcpIntegrations.length > 0 ? (_jsx("div", { className: "grid gap-x-8 sm:grid-cols-2", children: mcpIntegrations.map((integration) => (_jsx(McpIntegrationCard, { integration: integration, connected: connectedUrls.has(compareUrl(integration.url)), busy: connectingIntegrationId === integration.id, onConnect: connectIntegration }, integration.id))) })) : (_jsx("div", { className: "border-y border-dashed border-border px-4 py-8 text-center text-xs text-muted-foreground", children: "No integrations match." })) })] })] }), integrationDialogId && (_jsx(McpIntegrationDialog, { open: true, onOpenChange: (open) => {
@@ -159,14 +160,29 @@ export function FirstRunOnboarding() {
159
160
  if (screen === "connecting") {
160
161
  return (_jsx(OnboardingShell, { profile: profile, screen: "choice", children: _jsxs("div", { className: "mx-auto flex w-full max-w-md flex-col items-center text-center", children: [_jsx("div", { className: "flex size-10 items-center justify-center rounded-full bg-primary/10 text-primary", children: _jsx(IconLoader2, { className: "animate-spin", size: 19 }) }), _jsx("h1", { className: "mt-5 text-xl font-semibold tracking-[-0.04em]", children: "Connecting Builder.io free credits" }), _jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: "Finish the one-click connection in the new window." }), _jsxs("div", { className: "mt-7 w-full rounded-xl border border-border bg-card p-4 text-left", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx(Skeleton, { className: "h-3 w-28" }), _jsx(Skeleton, { className: "h-5 w-16 rounded-full" })] }), _jsx(Skeleton, { className: "mt-4 h-8 w-full" }), _jsxs("div", { className: "mt-3 grid grid-cols-3 gap-2", children: [_jsx(Skeleton, { className: "h-7 w-full" }), _jsx(Skeleton, { className: "h-7 w-full" }), _jsx(Skeleton, { className: "h-7 w-full" })] })] }), connectFlow.error && (_jsxs("div", { className: "mt-4 flex flex-col items-center gap-2", children: [_jsx("p", { className: "text-xs text-destructive", children: connectFlow.error }), _jsx("button", { type: "button", className: secondaryButtonClass, onClick: () => setScreen("choice"), children: "Try again" })] }))] }) }));
161
162
  }
162
- return (_jsx(OnboardingShell, { profile: profile, screen: "ready", children: _jsxs("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center text-center", children: [_jsx("div", { className: "flex size-12 items-center justify-center rounded-2xl bg-primary/10 text-primary", children: _jsx(IconCheck, { size: 20 }) }), _jsx("h1", { className: "mt-5 text-xl font-semibold tracking-[-0.04em]", children: "Your agent is ready." }), _jsx("p", { className: "mt-2 max-w-md text-sm leading-6 text-muted-foreground", children: "Start with a chat, then connect more tools whenever you need them." }), _jsx("div", { className: "mt-7 grid w-full gap-2 text-left sm:grid-cols-3", children: [
163
- ["Chat + actions", "Ask your agent to work across the app."],
164
- ["Agent integrations", "Connect tools from Settings anytime."],
165
- [
166
- "Flexible providers",
167
- "Use Builder.io free credits or your own keys.",
168
- ],
169
- ].map(([title, description]) => (_jsxs("div", { className: "rounded-xl bg-card px-4 py-4 ring-1 ring-border/70", children: [_jsx("span", { className: "flex size-7 items-center justify-center rounded-full bg-primary/10 text-primary", children: _jsx(IconCheck, { size: 14 }) }), _jsx("p", { className: "mt-3 text-sm font-medium", children: title }), _jsx("p", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: description })] }, title))) }), _jsxs("button", { type: "button", "data-testid": "first-run-open-app", className: cn(primaryButtonClass, "mt-7"), onClick: handleFinish, children: ["Open app", _jsx(IconArrowRight, { size: 15 })] })] }) }));
163
+ return (_jsx(OnboardingShell, { profile: profile, screen: "ready", children: _jsxs("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center text-center", children: [_jsx("div", { className: "flex size-12 items-center justify-center rounded-2xl bg-primary/10 text-primary", children: _jsx(IconCheck, { size: 20 }) }), _jsx("h1", { className: "mt-5 text-xl font-semibold tracking-[-0.04em]", children: "Your agent is ready." }), _jsx("p", { className: "mt-2 max-w-md text-sm leading-6 text-muted-foreground", children: "Start with a chat, then connect more tools whenever you need them." }), _jsx("div", { className: "mt-7 grid w-full gap-2 text-left sm:grid-cols-3", children: (skipIntegrations
164
+ ? [
165
+ [
166
+ "Workflow actions",
167
+ "Use the app's buttons and sidebar to run the workflow.",
168
+ ],
169
+ [
170
+ "AI sidebar",
171
+ "Ask the agent to review or refine a step in context.",
172
+ ],
173
+ [
174
+ "Flexible providers",
175
+ "Use Builder.io free credits or your own keys.",
176
+ ],
177
+ ]
178
+ : [
179
+ ["Chat + actions", "Ask your agent to work across the app."],
180
+ ["Agent integrations", "Connect tools from Settings anytime."],
181
+ [
182
+ "Flexible providers",
183
+ "Use Builder.io free credits or your own keys.",
184
+ ],
185
+ ]).map(([title, description]) => (_jsxs("div", { className: "rounded-xl bg-card px-4 py-4 ring-1 ring-border/70", children: [_jsx("span", { className: "flex size-7 items-center justify-center rounded-full bg-primary/10 text-primary", children: _jsx(IconCheck, { size: 14 }) }), _jsx("p", { className: "mt-3 text-sm font-medium", children: title }), _jsx("p", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: description })] }, title))) }), _jsxs("button", { type: "button", "data-testid": "first-run-open-app", className: cn(primaryButtonClass, "mt-7"), onClick: handleFinish, children: ["Open app", _jsx(IconArrowRight, { size: 15 })] })] }) }));
170
186
  }
171
187
  function OnboardingShell({ profile, screen, footer, children, }) {
172
188
  return (_jsxs("div", { className: "fixed inset-0 z-[100] flex h-full min-h-0 flex-col bg-background text-foreground", "data-onboarding-screen": screen, role: "dialog", "aria-modal": "true", "aria-label": `${profile?.appName ?? "Your app"} setup`, children: [_jsx("div", { className: "h-0.5 shrink-0 bg-muted", "data-testid": "onboarding-progress", children: _jsx("div", { className: "h-full bg-primary transition-[width] duration-200", style: {
@@ -1,2 +1,7 @@
1
- export declare function isFirstRunOnboardingEnabled(env?: Record<string, string | boolean | undefined>): boolean;
1
+ import type { AgentNativeConfig, AgentNativeFirstRunOnboardingMode } from "../../config.js";
2
+ type FirstRunOnboardingEnv = Record<string, string | boolean | undefined>;
3
+ export declare function isFirstRunOnboardingEnabled(env?: FirstRunOnboardingEnv, config?: AgentNativeConfig): boolean;
4
+ export declare function shouldSkipFirstRunIntegrations(env?: FirstRunOnboardingEnv, config?: AgentNativeConfig): boolean;
5
+ export declare function resolveFirstRunOnboardingMode(env?: FirstRunOnboardingEnv, config?: AgentNativeConfig): AgentNativeFirstRunOnboardingMode;
6
+ export {};
2
7
  //# sourceMappingURL=first-run-enabled.d.ts.map
@@ -1,9 +1,39 @@
1
1
  const FIRST_RUN_ONBOARDING_ENV_KEY = "VITE_AGENT_NATIVE_FIRST_RUN_ONBOARDING";
2
- export function isFirstRunOnboardingEnabled(env = (import.meta.env ??
3
- {})) {
4
- const value = env[FIRST_RUN_ONBOARDING_ENV_KEY];
2
+ const FIRST_RUN_ONBOARDING_SKIP_INTEGRATIONS_ENV_KEY = "VITE_AGENT_NATIVE_FIRST_RUN_ONBOARDING_SKIP_INTEGRATIONS";
3
+ function isEnabled(value) {
5
4
  return (value === true ||
6
5
  (typeof value === "string" &&
7
6
  ["1", "true"].includes(value.trim().toLowerCase())));
8
7
  }
8
+ export function isFirstRunOnboardingEnabled(env = (import.meta.env ?? {}), config = injectedAgentNativeConfig()) {
9
+ return resolveFirstRunOnboardingMode(env, config) !== "off";
10
+ }
11
+ export function shouldSkipFirstRunIntegrations(env = (import.meta.env ?? {}), config = injectedAgentNativeConfig()) {
12
+ if (env[FIRST_RUN_ONBOARDING_SKIP_INTEGRATIONS_ENV_KEY] !== undefined) {
13
+ return isEnabled(env[FIRST_RUN_ONBOARDING_SKIP_INTEGRATIONS_ENV_KEY]);
14
+ }
15
+ return resolveFirstRunOnboardingMode(env, config) === "connect";
16
+ }
17
+ export function resolveFirstRunOnboardingMode(env = (import.meta.env ?? {}), config = injectedAgentNativeConfig()) {
18
+ const envOnboarding = env[FIRST_RUN_ONBOARDING_ENV_KEY];
19
+ if (envOnboarding !== undefined) {
20
+ if (!isEnabled(envOnboarding))
21
+ return "off";
22
+ return isEnabled(env[FIRST_RUN_ONBOARDING_SKIP_INTEGRATIONS_ENV_KEY])
23
+ ? "connect"
24
+ : "connect-and-integrations";
25
+ }
26
+ const configured = config.onboarding?.firstRun;
27
+ if (configured === "connect" || configured === "connect-and-integrations") {
28
+ return isEnabled(env[FIRST_RUN_ONBOARDING_SKIP_INTEGRATIONS_ENV_KEY])
29
+ ? "connect"
30
+ : configured;
31
+ }
32
+ return "off";
33
+ }
34
+ function injectedAgentNativeConfig() {
35
+ return typeof __AGENT_NATIVE_APP_CONFIG__ === "undefined"
36
+ ? {}
37
+ : __AGENT_NATIVE_APP_CONFIG__;
38
+ }
9
39
  //# sourceMappingURL=first-run-enabled.js.map
@@ -1,13 +1,5 @@
1
1
  import { useCallback, useEffect, useRef, useState } from "react";
2
- import { FIRST_RUN_ONBOARDING_COOKIE } from "../../shared/first-run-onboarding.js";
3
2
  import { agentNativePath } from "../api-path.js";
4
- function hasFirstRunCookie() {
5
- if (typeof document === "undefined")
6
- return false;
7
- return document.cookie
8
- .split(";")
9
- .some((part) => part.trim().startsWith(`${FIRST_RUN_ONBOARDING_COOKIE}=`));
10
- }
11
3
  export function useOnboarding(options = {}) {
12
4
  const preview = options.preview === true;
13
5
  const [steps, setSteps] = useState([]);
@@ -15,20 +7,23 @@ export function useOnboarding(options = {}) {
15
7
  const [loading, setLoading] = useState(true);
16
8
  const [error, setError] = useState(null);
17
9
  const [dismissed, setDismissed] = useState(false);
18
- const [firstRun, setFirstRun] = useState(() => preview || hasFirstRunCookie());
10
+ const [firstRun, setFirstRun] = useState(preview);
19
11
  const mountedRef = useRef(true);
20
12
  useEffect(() => {
21
- setFirstRun(preview || hasFirstRunCookie());
13
+ setFirstRun(preview);
22
14
  }, [preview]);
23
15
  const fetchAll = useCallback(async () => {
24
16
  try {
25
17
  const stepsUrl = agentNativePath(preview
26
18
  ? "/_agent-native/onboarding/steps?preview=1"
27
19
  : "/_agent-native/onboarding/steps");
28
- const [stepsRes, dismissRes, profileRes] = await Promise.all([
20
+ const [stepsRes, dismissRes, profileRes, firstRunRes] = await Promise.all([
29
21
  fetch(stepsUrl),
30
22
  fetch(agentNativePath("/_agent-native/onboarding/dismissed")),
31
23
  fetch(agentNativePath("/_agent-native/onboarding/profile")),
24
+ preview
25
+ ? Promise.resolve(null)
26
+ : fetch(agentNativePath("/_agent-native/onboarding/first-run/status")),
32
27
  ]);
33
28
  if (!mountedRef.current)
34
29
  return;
@@ -41,6 +36,16 @@ export function useOnboarding(options = {}) {
41
36
  throw new Error(`profile: ${profileRes.status}`);
42
37
  }
43
38
  setProfile((await profileRes.json()));
39
+ if (preview) {
40
+ setFirstRun(true);
41
+ }
42
+ else {
43
+ if (!firstRunRes || !firstRunRes.ok) {
44
+ throw new Error(`first-run status: ${firstRunRes?.status ?? 500}`);
45
+ }
46
+ const firstRunData = (await firstRunRes.json());
47
+ setFirstRun(firstRunData.firstRun === true);
48
+ }
44
49
  if (dismissRes.ok) {
45
50
  const d = (await dismissRes.json());
46
51
  setDismissed(!!d.dismissed);
@@ -1,4 +1,4 @@
1
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  * Client-side session gate for an authenticated app shell.
4
4
  *
@@ -70,12 +70,12 @@ export function RequireSession({ children, fallback, redirect = true, signedOut,
70
70
  return (_jsx(ResolvedSessionGate, { fallback: fallback, redirect: redirect, signedOut: signedOut, children: children }));
71
71
  }
72
72
  function ResolvedSessionGate({ children, fallback, redirect = true, signedOut, }) {
73
- const { session, isLoading } = useSession();
73
+ const { session, status, retry } = useSession();
74
74
  // Guard against firing the redirect more than once (effect re-runs, React
75
75
  // StrictMode double-invoke) — a second navigation while the first is in
76
76
  // flight is harmless but noisy.
77
77
  const redirectedRef = useRef(false);
78
- const mustRedirect = !isLoading && !session && redirect;
78
+ const mustRedirect = status === "unauthenticated" && redirect;
79
79
  useEffect(() => {
80
80
  if (!mustRedirect)
81
81
  return;
@@ -97,8 +97,14 @@ function ResolvedSessionGate({ children, fallback, redirect = true, signedOut, }
97
97
  }, [mustRedirect]);
98
98
  // Still resolving, or redirect already in flight: show the loading fallback
99
99
  // rather than flashing app chrome the visitor can't use.
100
- if (isLoading)
100
+ if (status === "loading")
101
101
  return _jsx(_Fragment, { children: fallback ?? _jsx(DefaultSpinner, {}) });
102
+ // Unreadable is not signed-out. Redirecting here would bounce a signed-in
103
+ // user to the sign-in page over a transient 5xx, and rendering the spinner
104
+ // would strand them on a screen that never resolves.
105
+ if (status === "unavailable") {
106
+ return _jsx(SessionUnavailableNotice, { retry: retry });
107
+ }
102
108
  if (!session) {
103
109
  if (redirect)
104
110
  return _jsx(_Fragment, { children: fallback ?? _jsx(DefaultSpinner, {}) });
@@ -106,4 +112,7 @@ function ResolvedSessionGate({ children, fallback, redirect = true, signedOut, }
106
112
  }
107
113
  return _jsx(_Fragment, { children: children });
108
114
  }
115
+ function SessionUnavailableNotice({ retry }) {
116
+ return (_jsxs("div", { className: "flex h-screen w-full flex-col items-center justify-center gap-4 px-6 text-center", children: [_jsx("p", { className: "max-w-md text-sm text-muted-foreground", children: "We couldn't reach the server to confirm you're signed in. This is usually temporary." }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "button", onClick: retry, className: "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground", children: "Try again" }), _jsx("button", { type: "button", onClick: () => window.location.reload(), className: "rounded-md border border-border px-3 py-1.5 text-sm font-medium", children: "Reload page" })] })] }));
117
+ }
109
118
  //# sourceMappingURL=require-session.js.map
@@ -37,6 +37,32 @@ export const DEFAULT_MCP_INTEGRATIONS = [
37
37
  headerPlaceholder: "Authorization: Bearer <sentry-token>",
38
38
  keywords: ["errors", "monitoring", "debugging", "issues"],
39
39
  },
40
+ {
41
+ id: "fullstory",
42
+ name: "FullStory",
43
+ provider: "fullstory",
44
+ description: "Read behavioral analytics and inspect session replays.",
45
+ descriptionKey: "mcpIntegrations.catalog.fullstory.description",
46
+ useCase: "product analytics, session replay, qualitative behavior, user research",
47
+ useCaseKey: "mcpIntegrations.catalog.fullstory.useCase",
48
+ url: "https://api.fullstory.com/mcp/fullstory",
49
+ authMode: "oauth",
50
+ connectionMode: "oauth",
51
+ availability: "ready",
52
+ verification: "preflight-only",
53
+ logoUrl: mcpIntegrationLogo("fullstory"),
54
+ docsUrl: "https://developer.fullstory.com/mcp/introduction/",
55
+ setupNoteKey: "mcpIntegrations.catalog.fullstory.setupNote",
56
+ keywords: [
57
+ "product analytics",
58
+ "session replay",
59
+ "behavior",
60
+ "user research",
61
+ "sessions",
62
+ "prompts",
63
+ "screenshots",
64
+ ],
65
+ },
40
66
  {
41
67
  id: "notion",
42
68
  name: "Notion",
@@ -19,6 +19,10 @@ const LOGOS = {
19
19
  mime: "image/svg+xml",
20
20
  data: "PHN2ZyBmaWxsPSIjMzYyRDU5IiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+U2VudHJ5PC90aXRsZT48cGF0aCBkPSJNMTMuOTEgMi41MDVjLS44NzMtMS40NDgtMi45NzItMS40NDgtMy44NDQgMEw2LjkwNCA3LjkyYTE1LjQ3OCAxNS40NzggMCAwIDEgOC41MyAxMi44MTFoLTIuMjIxQTEzLjMwMSAxMy4zMDEgMCAwIDAgNS43ODQgOS44MTRsLTIuOTI2IDUuMDZhNy42NSA3LjY1IDAgMCAxIDQuNDM1IDUuODQ4SDIuMTk0YS4zNjUuMzY1IDAgMCAxLS4yOTgtLjUzNGwxLjQxMy0yLjQwMmE1LjE2IDUuMTYgMCAwIDAtMS42MTQtLjkxM0wuMjk2IDE5LjI3NWEyLjE4MiAyLjE4MiAwIDAgMCAuODEyIDIuOTk5IDIuMjQgMi4yNCAwIDAgMCAxLjA4Ni4yODhoNi45ODNhOS4zMjIgOS4zMjIgMCAwIDAtMy44NDUtOC4zMThsMS4xMS0xLjkyMmExMS40NyAxMS40NyAwIDAgMSA0Ljk1IDEwLjI0aDUuOTE1YTE3LjI0MiAxNy4yNDIgMCAwIDAtNy44ODUtMTUuMjhsMi4yNDQtMy44NDVhLjM3LjM3IDAgMCAxIC41MDQtLjEzYy4yNTUuMTQgOS43NSAxNi43MDggOS45MjggMTYuOWEuMzY1LjM2NSAwIDAgMS0uMzI3LjU0M2gtMi4yODdjLjAyOS42MTIuMDI5IDEuMjIzIDAgMS44MzFoMi4yOTdhMi4yMDYgMi4yMDYgMCAwIDAgMS45MjItMy4zMXoiLz48L3N2Zz4=",
21
21
  },
22
+ fullstory: {
23
+ mime: "image/svg+xml",
24
+ data: "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiIGZpbGw9IiMyZjgwZWQiLz48cGF0aCBkPSJNNyAxMmMxLjgtMyA0LTQuNSA1LTQuNXMzLjIgMS41IDUgNC41Yy0xLjggMy00IDQuNS01IDQuNVM4LjggMTUgNyAxMloiIGZpbGw9IiNmZmYiLz48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIyIiBmaWxsPSIjMmY4MGVkIi8+PC9zdmc+",
25
+ },
22
26
  notion: {
23
27
  mime: "image/svg+xml",
24
28
  data: "PHN2ZyBmaWxsPSIjMDAwMDAwIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+Tm90aW9uPC90aXRsZT48cGF0aCBkPSJNNC40NTkgNC4yMDhjLjc0Ni42MDYgMS4wMjYuNTYgMi40MjguNDY2bDEzLjIxNS0uNzkzYy4yOCAwIC4wNDctLjI4LS4wNDYtLjMyNkwxNy44NiAxLjk2OGMtLjQyLS4zMjYtLjk4MS0uNy0yLjA1NS0uNjA3TDMuMDEgMi4yOTVjLS40NjYuMDQ2LS41Ni4yOC0uMzc0LjQ2NnptLjc5MyAzLjA4djEzLjkwNGMwIC43NDcuMzczIDEuMDI3IDEuMjE0Ljk4bDE0LjUyMy0uODRjLjg0MS0uMDQ2LjkzNS0uNTYuOTM1LTEuMTY3VjYuMzU0YzAtLjYwNi0uMjMzLS45MzMtLjc0OC0uODg3bC0xNS4xNzcuODg3Yy0uNTYuMDQ3LS43NDcuMzI3LS43NDcuOTMzem0xNC4zMzcuNzQ1Yy4wOTMuNDIgMCAuODQtLjQyLjg4OGwtLjcuMTR2MTAuMjY0Yy0uNjA4LjMyNy0xLjE2OC41MTQtMS42MzUuNTE0LS43NDggMC0uOTM1LS4yMzQtMS40OTUtLjkzM2wtNC41NzctNy4xODZ2Ni45NTJMMTIuMjEgMTlzMCAuODQtMS4xNjguODRsLTMuMjIyLjE4NmMtLjA5My0uMTg2IDAtLjY1My4zMjctLjc0NmwuODQtLjIzM1Y5Ljg1NEw3LjgyMiA5Ljc2Yy0uMDk0LS40Mi4xNC0xLjAyNi43OTMtMS4wNzNsMy40NTYtLjIzMyA0Ljc2NCA3LjI3OXYtNi40NGwtMS4yMTUtLjEzOWMtLjA5My0uNTE0LjI4LS44ODcuNzQ3LS45MzN6TTEuOTM2IDEuMDM1bDEzLjMxLS45OGMxLjYzNC0uMTQgMi4wNTUtLjA0NyAzLjA4Mi43bDQuMjQ5IDIuOTg2Yy43LjUxMy45MzQuNjUzLjkzNCAxLjIxM3YxNi4zNzhjMCAxLjAyNi0uMzczIDEuNjM0LTEuNjggMS43MjZsLTE1LjQ1OC45MzRjLS45OC4wNDctMS40NDgtLjA5My0xLjk2Mi0uNzQ3bC0zLjEyOS00LjA2Yy0uNTYtLjc0Ny0uNzkzLTEuMzA2LS43OTMtMS45NlYyLjY2N2MwLS44MzkuMzc0LTEuNTQgMS40NDctMS42MzJ6Ii8+PC9zdmc+",
@@ -292,7 +292,7 @@ export function AgentNativeRouteWarmup({ config, }) {
292
292
  if (resolved.strategy === "off") {
293
293
  return;
294
294
  }
295
- // Legacy SPA builds still mount the AgentPanel but do not expose React
295
+ // Legacy SPA builds still mount AppProviders but do not expose React
296
296
  // Router framework `.data` endpoints or a route asset manifest. Only warm
297
297
  // route data/modules when that manifest is present; otherwise this would
298
298
  // generate noisy `/<path>.data` 404s for apps that cannot serve them.
@@ -314,28 +314,69 @@ export function AgentNativeRouteWarmup({ config, }) {
314
314
  seedExistingModulepreloads();
315
315
  const queue = [];
316
316
  const queuedDataRoutes = new Set();
317
+ const dataRetryAttempts = new Map();
318
+ const retryTimers = new Set();
317
319
  const observedLinks = new WeakSet();
318
320
  let active = 0;
319
321
  let stopped = false;
320
322
  let scheduleTimer;
323
+ const scheduleDataRetry = (dataUrl, href) => {
324
+ if (stopped)
325
+ return;
326
+ const attempt = (dataRetryAttempts.get(dataUrl) ?? 0) + 1;
327
+ if (attempt > 3) {
328
+ queuedDataRoutes.delete(dataUrl);
329
+ return;
330
+ }
331
+ dataRetryAttempts.set(dataUrl, attempt);
332
+ const timer = window.setTimeout(() => {
333
+ retryTimers.delete(timer);
334
+ if (stopped)
335
+ return;
336
+ queuedDataRoutes.delete(dataUrl);
337
+ warmedDataRoutes.delete(dataUrl);
338
+ warmHref(href);
339
+ }, 500 * 2 ** (attempt - 1));
340
+ retryTimers.add(timer);
341
+ };
321
342
  const pump = () => {
322
343
  if (stopped || !warmData)
323
344
  return;
324
345
  while (active < resolved.maxConcurrent && queue.length > 0) {
325
- const href = queue.shift();
326
- if (!href)
346
+ const item = queue.shift();
347
+ if (!item)
327
348
  continue;
328
349
  active += 1;
329
350
  window
330
- .fetch(href, { credentials: "same-origin", cache: "force-cache" })
331
- .catch(() => { })
351
+ .fetch(item.dataUrl, {
352
+ credentials: "same-origin",
353
+ cache: "force-cache",
354
+ })
355
+ .then((response) => {
356
+ if (response.ok) {
357
+ dataRetryAttempts.delete(item.dataUrl);
358
+ return;
359
+ }
360
+ warmedDataRoutes.delete(item.dataUrl);
361
+ if (response.status >= 500 || response.status === 429) {
362
+ scheduleDataRetry(item.dataUrl, item.href);
363
+ }
364
+ else {
365
+ queuedDataRoutes.delete(item.dataUrl);
366
+ dataRetryAttempts.delete(item.dataUrl);
367
+ }
368
+ })
369
+ .catch(() => {
370
+ warmedDataRoutes.delete(item.dataUrl);
371
+ scheduleDataRetry(item.dataUrl, item.href);
372
+ })
332
373
  .finally(() => {
333
374
  active -= 1;
334
375
  window.setTimeout(pump, 50);
335
376
  });
336
377
  }
337
378
  };
338
- const warmHref = (href) => {
379
+ function warmHref(href) {
339
380
  if (warmModules)
340
381
  warmRouteAssetsForHref(href);
341
382
  if (!warmData)
@@ -347,9 +388,9 @@ export function AgentNativeRouteWarmup({ config, }) {
347
388
  if (queuedDataRoutes.has(dataUrl))
348
389
  return;
349
390
  queuedDataRoutes.add(dataUrl);
350
- queue.push(dataUrl);
391
+ queue.push({ dataUrl, href });
351
392
  pump();
352
- };
393
+ }
353
394
  const viewportObserver = typeof IntersectionObserver === "undefined"
354
395
  ? null
355
396
  : new IntersectionObserver((entries) => {
@@ -415,12 +456,14 @@ export function AgentNativeRouteWarmup({ config, }) {
415
456
  };
416
457
  schedule();
417
458
  const observer = new MutationObserver(schedule);
418
- // The render-warmup selector is configurable, so it may depend on class or
419
- // custom data attributes. Watch all attribute changes and debounce rescans.
459
+ // Route links are added by hydration/navigation and can opt into a mode
460
+ // after render. Avoid watching every attribute: scroll-driven style/class
461
+ // changes otherwise rescan the entire document while a page is settling.
420
462
  observer.observe(document.documentElement, {
421
463
  subtree: true,
422
464
  childList: true,
423
465
  attributes: true,
466
+ attributeFilter: [PREFETCH_ATTR, "href"],
424
467
  });
425
468
  document.addEventListener("pointerover", warmFromIntent, {
426
469
  capture: true,
@@ -435,6 +478,9 @@ export function AgentNativeRouteWarmup({ config, }) {
435
478
  stopped = true;
436
479
  if (scheduleTimer !== undefined)
437
480
  window.clearTimeout(scheduleTimer);
481
+ for (const timer of retryTimers)
482
+ window.clearTimeout(timer);
483
+ retryTimers.clear();
438
484
  observer.disconnect();
439
485
  viewportObserver?.disconnect();
440
486
  document.removeEventListener("pointerover", warmFromIntent, true);
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ActionButton, Avatar, Surface, TextField, } from "@agent-native/toolkit/design-system";
3
- import { IconCamera, IconCheck } from "@tabler/icons-react";
3
+ import { IconCamera, IconCheck, IconLock } from "@tabler/icons-react";
4
4
  import { useEffect, useRef, useState } from "react";
5
5
  import { useT } from "../i18n.js";
6
6
  import { useActionMutation, useActionQuery } from "../use-action.js";
@@ -16,6 +16,81 @@ function profileInitials(name) {
16
16
  .map((part) => part[0]?.toUpperCase())
17
17
  .join("") || "?");
18
18
  }
19
+ function PasswordSettings() {
20
+ const t = useT();
21
+ const { session } = useSession();
22
+ const authMethods = useActionQuery("get-auth-methods", undefined, { enabled: !!session?.email });
23
+ const setPassword = useActionMutation("set-password");
24
+ const changePassword = useActionMutation("change-password");
25
+ const [currentPassword, setCurrentPassword] = useState("");
26
+ const [newPassword, setNewPassword] = useState("");
27
+ const [confirmPassword, setConfirmPassword] = useState("");
28
+ const [validationError, setValidationError] = useState(null);
29
+ const [saved, setSaved] = useState(false);
30
+ const mutation = authMethods.data?.hasPassword ? changePassword : setPassword;
31
+ const error = validationError
32
+ ? validationError === "length"
33
+ ? t("settings.passwordMinLength")
34
+ : t("settings.passwordMismatch")
35
+ : mutation.error
36
+ ? t("settings.passwordSaveError")
37
+ : undefined;
38
+ const clearStatus = () => {
39
+ setSaved(false);
40
+ setValidationError(null);
41
+ setPassword.reset();
42
+ changePassword.reset();
43
+ };
44
+ const submit = () => {
45
+ setSaved(false);
46
+ setValidationError(null);
47
+ if (newPassword.length < 8) {
48
+ setValidationError("length");
49
+ return;
50
+ }
51
+ if (newPassword !== confirmPassword) {
52
+ setValidationError("mismatch");
53
+ return;
54
+ }
55
+ const onSuccess = () => {
56
+ setCurrentPassword("");
57
+ setNewPassword("");
58
+ setConfirmPassword("");
59
+ setSaved(true);
60
+ void authMethods.refetch();
61
+ };
62
+ if (authMethods.data?.hasPassword) {
63
+ changePassword.mutate({ currentPassword, newPassword }, { onSuccess });
64
+ }
65
+ else {
66
+ setPassword.mutate({ newPassword }, { onSuccess });
67
+ }
68
+ };
69
+ const isPending = setPassword.isPending || changePassword.isPending;
70
+ const isLoading = authMethods.isLoading;
71
+ const hasPassword = authMethods.data?.hasPassword ?? false;
72
+ if (!session?.email)
73
+ return null;
74
+ return (_jsxs("div", { className: "space-y-3 border-t border-border/60 pt-3", children: [_jsxs("div", { className: "flex items-start gap-2", children: [_jsx(IconLock, { className: "mt-0.5 size-4 text-muted-foreground" }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-medium", children: hasPassword
75
+ ? t("settings.passwordChange")
76
+ : t("settings.passwordTitle") }), _jsx("p", { className: "text-xs leading-5 text-muted-foreground", children: t("settings.passwordDescription") })] })] }), isLoading ? (_jsx("p", { className: "text-xs text-muted-foreground", children: t("settings.passwordStatusLoading") })) : authMethods.error ? (_jsx("p", { className: "text-xs text-destructive", children: t("settings.passwordSaveError") })) : (_jsxs(_Fragment, { children: [hasPassword && (_jsx(TextField, { id: "agent-native-current-password", type: "password", label: t("settings.passwordCurrentLabel"), value: currentPassword, onChange: (value) => {
77
+ clearStatus();
78
+ setCurrentPassword(value);
79
+ }, placeholder: t("settings.passwordPlaceholder"), autoComplete: "current-password", disabled: isPending })), _jsx(TextField, { id: "agent-native-new-password", type: "password", label: t("settings.passwordNewLabel"), value: newPassword, onChange: (value) => {
80
+ clearStatus();
81
+ setNewPassword(value);
82
+ }, placeholder: t("settings.passwordPlaceholder"), autoComplete: hasPassword ? "new-password" : "new-password", disabled: isPending, invalid: !!error }), _jsx(TextField, { id: "agent-native-confirm-password", type: "password", label: t("settings.passwordConfirmLabel"), value: confirmPassword, onChange: (value) => {
83
+ clearStatus();
84
+ setConfirmPassword(value);
85
+ }, placeholder: t("settings.passwordPlaceholder"), autoComplete: "new-password", disabled: isPending, invalid: !!error, errorMessage: error }), _jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("div", { className: "min-h-4 text-xs", children: saved && (_jsxs("p", { className: "flex items-center gap-1 text-primary", children: [_jsx(IconCheck, { className: "size-3" }), t("settings.passwordSaved")] })) }), _jsx(ActionButton, { type: "button", intent: "primary", emphasis: "solid", size: "compact", pending: isPending, disabled: isPending ||
86
+ !newPassword ||
87
+ !confirmPassword ||
88
+ (hasPassword && !currentPassword), onPress: submit, children: isPending
89
+ ? t("settings.passwordSaving")
90
+ : hasPassword
91
+ ? t("settings.passwordChange")
92
+ : t("settings.passwordAdd") })] })] }))] }));
93
+ }
19
94
  export function AccountSettingsForm({ compact = false, }) {
20
95
  const t = useT();
21
96
  const { session, isLoading } = useSession();
@@ -74,6 +149,6 @@ export function AccountSettingsForm({ compact = false, }) {
74
149
  }
75
150
  export function AccountSettingsCard({ className }) {
76
151
  const t = useT();
77
- return (_jsxs(Surface, { as: "section", id: "account", elevation: "low", padding: "none", className: cn("mx-auto w-full max-w-2xl scroll-mt-4 rounded-lg border border-border bg-card p-5 text-card-foreground shadow-sm", className), children: [_jsxs("div", { className: "space-y-1", children: [_jsx("h2", { className: "text-base font-semibold", children: t("settings.profileTitle") }), _jsx("p", { className: "text-sm leading-6 text-muted-foreground", children: t("settings.profileDescription") })] }), _jsx("div", { className: "mt-5", children: _jsx(AccountSettingsForm, {}) })] }));
152
+ return (_jsxs(Surface, { as: "section", id: "account", elevation: "low", padding: "none", className: cn("mx-auto w-full max-w-2xl scroll-mt-4 rounded-lg border border-border bg-card p-5 text-card-foreground shadow-sm", className), children: [_jsxs("div", { className: "space-y-1", children: [_jsx("h2", { className: "text-base font-semibold", children: t("settings.profileTitle") }), _jsx("p", { className: "text-sm leading-6 text-muted-foreground", children: t("settings.profileDescription") })] }), _jsxs("div", { className: "mt-5", children: [_jsx(AccountSettingsForm, {}), _jsx(PasswordSettings, {})] })] }));
78
153
  }
79
154
  //# sourceMappingURL=AccountSettingsCard.js.map
@@ -31,7 +31,7 @@ import { settingsSectionDomId, useSettingsPanelController, } from "./useSettings
31
31
  import { VoiceTranscriptionSection } from "./VoiceTranscriptionSection.js";
32
32
  const Button = React.forwardRef(({ className, ...props }, ref) => (_jsx(ToolkitButton, { ref: ref, variant: "ghost", className: cn("h-auto p-0 hover:bg-transparent hover:text-inherit active:scale-100 [&_svg]:!size-auto", className), ...props })));
33
33
  Button.displayName = "SettingsPrimitiveButton";
34
- const ManageButton = React.forwardRef(({ children = "Manage", className, ...props }, ref) => (_jsxs(Button, { ref: ref, type: "button", intent: "neutral", emphasis: "outline", className: cn("inline-flex items-center gap-1 rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground hover:bg-accent/40", className), ...props, children: [children, _jsx(IconChevronDown, { size: 14 })] })));
34
+ const ManageButton = React.forwardRef(({ children = "Manage", className, ...props }, ref) => (_jsx(Button, { ref: ref, type: "button", intent: "neutral", emphasis: "outline", className: cn("inline-flex items-center gap-1 rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground hover:bg-accent/40", className), ...props, children: children })));
35
35
  ManageButton.displayName = "SettingsManageButton";
36
36
  const IntegrationsPanel = lazy(() => import("../integrations/IntegrationsPanel.js").then((m) => ({
37
37
  default: m.IntegrationsPanel,
@@ -282,7 +282,7 @@ export function VoiceTranscriptionSection({ compact = false, } = {}) {
282
282
  return (_jsxs("div", { className: "space-y-2", children: [_jsxs("div", { className: "rounded-md border border-border bg-background p-2", children: [_jsx("div", { className: "mb-2 flex items-start justify-between gap-3 px-0.5", children: _jsxs("div", { children: [_jsx("div", { className: "text-[11px] font-medium text-foreground", children: "Live transcription" }), _jsx("p", { className: "mt-0.5 text-[10px] text-muted-foreground", children: "Choose where real-time words come from. Batch still runs after recording stops." })] }) }), _jsxs("div", { className: "space-y-2", children: [_jsx(ProviderOption, { id: "mac-native", selected: transcriptionMode === "mac-native", onSelect: () => chooseSource("mac-native"), title: "Mac Native", subtitle: "Free and fast in the macOS Tauri app. Web clients use the existing browser-native path when available.", rightSlot: _jsx("span", { className: "text-[10px] text-muted-foreground", children: "Tauri default" }) }), _jsx(ProviderOption, { id: "google-realtime", selected: transcriptionMode === "google-realtime", onSelect: () => chooseSource("google-realtime"), disabled: !googleRealtimeReady, title: "Google Realtime", subtitle: googleRealtimeReady
283
283
  ? "BYOK only for v1. Streams live partials and finals through Google Speech-to-Text."
284
284
  : googleRealtimeConfigured
285
- ? "Google credentials are set. Connect Builder completely to mint the managed realtime session."
285
+ ? "Google credentials are set. Connect Builder completely (free tier available) to mint the managed realtime session."
286
286
  : "BYOK only for v1. Configure Google service account before selecting this source.", rightSlot: googleRealtimeReady ? (_jsxs("span", { className: "flex items-center gap-1 text-[10px] text-green-500", children: [_jsx(IconCheck, { size: 10 }), "Ready"] })) : googleRealtimeConfigured ? (_jsx("button", { type: "button", onClick: (e) => {
287
287
  e.stopPropagation();
288
288
  openBuilderConnect();
@@ -295,7 +295,7 @@ export function VoiceTranscriptionSection({ compact = false, } = {}) {
295
295
  : geminiConfigured
296
296
  ? "Gemini key set"
297
297
  : "Needs key" }))] })] }), _jsxs("div", { className: "rounded-md border border-border bg-background", children: [_jsxs("button", { type: "button", onClick: () => setShowAdvanced((v) => !v), className: "w-full flex items-center justify-between gap-2 px-2.5 py-2 cursor-pointer", children: [_jsxs("span", { className: "text-[11px] font-medium text-foreground inline-flex items-center gap-1", children: [showAdvanced ? (_jsx(IconChevronDown, { size: 12 })) : (_jsx(IconChevronRight, { size: 12, className: "rtl:-scale-x-100" })), "Add API keys"] }), _jsx("span", { className: "text-[10px] text-muted-foreground", children: "Google STT \u00B7 Gemini \u00B7 Groq \u00B7 OpenAI" })] }), showAdvanced && (_jsxs("div", { className: "px-2 pb-2 space-y-2", children: [_jsx(ProviderOption, { id: "google-service-account", selected: transcriptionMode === "google-realtime", onSelect: () => chooseSource("google-realtime"), disabled: !googleRealtimeReady, title: "Google Speech-to-Text service account", subtitle: googleRealtimeConfigured
298
- ? "Service-account JSON is set. Connect Builder to mint the managed realtime WebSocket session."
298
+ ? "Service-account JSON is set. Connect Builder (free tier available) to mint the managed realtime WebSocket session."
299
299
  : "Service-account JSON for the dedicated realtime WebSocket to Google StreamingRecognize.", rightSlot: googleRealtimeConfigured ===
300
300
  null ? null : googleRealtimeReady ? (_jsxs("span", { className: "flex items-center gap-1 text-[10px] text-green-500", children: [_jsx(IconCheck, { size: 10 }), "Ready"] })) : googleRealtimeConfigured ? (_jsx("button", { type: "button", onClick: (e) => {
301
301
  e.stopPropagation();
@@ -583,7 +583,7 @@ export function useBuilderConnectFlow(opts = {}) {
583
583
  stopPoll();
584
584
  connectStartedAtRef.current = null;
585
585
  setConnecting(false);
586
- setError("Couldn't open Builder from this chat host. Open this app in a browser tab and try Connect Builder again.");
586
+ setError("Couldn't open Builder from this chat host. Open this app in a browser tab and try Connect Builder (free tier available) again.");
587
587
  })();
588
588
  }
589
589
  else {
@@ -1,7 +1,7 @@
1
1
  import { useCallback } from "react";
2
2
  import { useBuilderConnectFlow } from "../settings/useBuilderStatus.js";
3
3
  const DEFAULT_TITLE = "Builder connect";
4
- const DEFAULT_DESCRIPTION = "Connect Builder for managed model access, browser automation, and workspace identity.";
4
+ const DEFAULT_DESCRIPTION = "Connect Builder for managed model access, browser automation, and workspace identity. Free tier available.";
5
5
  const DEFAULT_TRACKING_SOURCE = "setup_connections_page";
6
6
  export function useBuilderConnectCardController({ title = DEFAULT_TITLE, description = DEFAULT_DESCRIPTION, trackingSource = DEFAULT_TRACKING_SOURCE, onConnected, } = {}) {
7
7
  const handleConnected = useCallback(({ orgName }) => onConnected?.(orgName), [onConnected]);
@@ -11,6 +11,7 @@ export { getClientSurface, type ClientSurface } from "../client-surface.js";
11
11
  export { ErrorBoundary } from "../ErrorBoundary.js";
12
12
  export { ClientOnly } from "../ClientOnly.js";
13
13
  export { DefaultSpinner } from "../DefaultSpinner.js";
14
+ export { RouteTransitionIndicator, ROUTE_TRANSITION_INDICATOR_DELAY_MS, } from "../RouteTransitionIndicator.js";
14
15
  export { getThemeInitScript, themeInitScript, type ThemePreference, } from "../theme.js";
15
16
  export { APPEARANCE_PRESETS, applyAppearance, getStoredAppearance, useAppearance, useAppearanceSync, type AppearancePresetId, } from "../appearance.js";
16
17
  export { AppearancePicker, type AppearancePickerProps, } from "../AppearancePicker.js";
@@ -11,6 +11,7 @@ export { getClientSurface } from "../client-surface.js";
11
11
  export { ErrorBoundary } from "../ErrorBoundary.js";
12
12
  export { ClientOnly } from "../ClientOnly.js";
13
13
  export { DefaultSpinner } from "../DefaultSpinner.js";
14
+ export { RouteTransitionIndicator, ROUTE_TRANSITION_INDICATOR_DELAY_MS, } from "../RouteTransitionIndicator.js";
14
15
  export { getThemeInitScript, themeInitScript, } from "../theme.js";
15
16
  export { APPEARANCE_PRESETS, applyAppearance, getStoredAppearance, useAppearance, useAppearanceSync, } from "../appearance.js";
16
17
  export { AppearancePicker, } from "../AppearancePicker.js";
@@ -48,7 +48,7 @@ export const uploadEditorImage = async (file) => {
48
48
  });
49
49
  if (!result || typeof result.url !== "string" || !result.url) {
50
50
  throw new Error(result?.error ||
51
- "Image upload failed. Connect Builder.io in Settings → File uploads, then try again.");
51
+ "Image upload failed. Connect Builder.io (free tier available) in Settings → File uploads, then try again.");
52
52
  }
53
53
  // Use the filename (sans extension) as a reasonable default alt text.
54
54
  const alt = file.name ? file.name.replace(/\.[^./\\]+$/, "") : "";