@agent-native/core 0.137.8 → 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 (422) 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/hooks/use-playback-position.ts +188 -0
  66. package/corpus/templates/clips/app/hooks/use-view-tracking.ts +6 -24
  67. package/corpus/templates/clips/app/lib/playback-position.ts +99 -0
  68. package/corpus/templates/clips/app/lib/viewer-session.ts +29 -0
  69. package/corpus/templates/clips/changelog/2026-08-05-clip-buffering-now-uses-buffering-copy-after-playback.md +6 -0
  70. package/corpus/templates/clips/changelog/2026-08-05-clips-remembers-your-playback-position-when-you-reopen-a-cli.md +6 -0
  71. package/corpus/templates/clips/learnings.defaults.md +1 -1
  72. package/corpus/templates/clips/server/db/schema.ts +18 -0
  73. package/corpus/templates/clips/server/lib/public-agent-context.ts +1 -1
  74. package/corpus/templates/clips/server/lib/video-storage.ts +1 -1
  75. package/corpus/templates/clips/server/plugins/db.ts +15 -0
  76. package/corpus/templates/clips/server/routes/api/media/index.post.ts +1 -1
  77. package/corpus/templates/content/.agents/skills/agent-native-docs/SKILL.md +23 -3
  78. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  79. package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +13 -0
  80. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +23 -2
  81. package/corpus/templates/content/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  82. package/corpus/templates/content/AGENTS.md +1 -0
  83. package/corpus/templates/content/actions/_content-database-mutation-lock.ts +41 -0
  84. package/corpus/templates/content/actions/_content-database-row-migration.ts +569 -0
  85. package/corpus/templates/content/actions/_database-source-utils.ts +82 -36
  86. package/corpus/templates/content/actions/_database-utils.ts +5 -0
  87. package/corpus/templates/content/actions/_delete-content-space.ts +25 -11
  88. package/corpus/templates/content/actions/add-database-item.ts +60 -42
  89. package/corpus/templates/content/actions/attach-content-database-source.ts +2 -0
  90. package/corpus/templates/content/actions/configure-document-property.ts +99 -104
  91. package/corpus/templates/content/actions/delete-content-database.ts +19 -7
  92. package/corpus/templates/content/actions/delete-document-property.ts +47 -58
  93. package/corpus/templates/content/actions/delete-document.ts +390 -167
  94. package/corpus/templates/content/actions/disconnect-content-database-source.ts +41 -24
  95. package/corpus/templates/content/actions/duplicate-database-item.ts +63 -31
  96. package/corpus/templates/content/actions/duplicate-database-items.ts +86 -43
  97. package/corpus/templates/content/actions/duplicate-document-property.ts +37 -14
  98. package/corpus/templates/content/actions/migrate-content-database-rows.ts +830 -0
  99. package/corpus/templates/content/actions/move-database-item.ts +14 -0
  100. package/corpus/templates/content/actions/permanently-delete-document.ts +27 -6
  101. package/corpus/templates/content/actions/remove-database-items.ts +13 -0
  102. package/corpus/templates/content/actions/reorder-document-property.ts +45 -46
  103. package/corpus/templates/content/actions/set-document-property.ts +68 -28
  104. package/corpus/templates/content/actions/submit-content-database-form.ts +49 -0
  105. package/corpus/templates/content/actions/transcribe-media.ts +1 -1
  106. package/corpus/templates/content/agent-native.json +12 -0
  107. package/corpus/templates/content/app/components/editor/image-upload.ts +2 -2
  108. package/corpus/templates/content/app/i18n-data.ts +1 -1
  109. package/corpus/templates/content/changelog/2026-08-01-content-can-reorganize-every-row-in-an-existing-database-as-.md +6 -0
  110. package/corpus/templates/content/parity/matrix.md +1 -1
  111. package/corpus/templates/content/parity/matrix.ts +4 -2
  112. package/corpus/templates/content/server/db/schema.ts +30 -0
  113. package/corpus/templates/content/server/plugins/db.ts +24 -0
  114. package/corpus/templates/content/server/plugins/onboarding.ts +2 -2
  115. package/corpus/templates/crm/.agents/skills/agent-native-docs/SKILL.md +23 -3
  116. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  117. package/corpus/templates/crm/agent-native.json +12 -0
  118. package/corpus/templates/design/.agents/skills/agent-native-docs/SKILL.md +23 -3
  119. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  120. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +23 -2
  121. package/corpus/templates/design/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  122. package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +2 -2
  123. package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +2 -2
  124. package/corpus/templates/design/actions/apply-design-token-edit.ts +1 -1
  125. package/corpus/templates/design/actions/capture-design-state.ts +1 -1
  126. package/corpus/templates/design/actions/connect-builder-app.ts +2 -2
  127. package/corpus/templates/design/actions/create-design-branch.ts +1 -1
  128. package/corpus/templates/design/actions/create-fusion-app.ts +3 -3
  129. package/corpus/templates/design/actions/deploy-design-preview.ts +1 -1
  130. package/corpus/templates/design/actions/get-component-details.ts +1 -1
  131. package/corpus/templates/design/actions/get-design-branch-diff.ts +1 -1
  132. package/corpus/templates/design/actions/index-components.ts +3 -3
  133. package/corpus/templates/design/actions/index-design-system-with-builder.ts +1 -1
  134. package/corpus/templates/design/actions/migrate-inline-design-to-app.ts +3 -3
  135. package/corpus/templates/design/actions/open-component-source.ts +1 -1
  136. package/corpus/templates/design/actions/update-design.ts +61 -0
  137. package/corpus/templates/design/agent-native.json +12 -0
  138. package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +1 -1
  139. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +1 -1
  140. package/corpus/templates/design/scripts/qa-figma-stress-import.ts +1 -1
  141. package/corpus/templates/design/server/lib/figma-node-import.ts +1 -1
  142. package/corpus/templates/design/shared/design-source-capabilities.ts +25 -9
  143. package/corpus/templates/dispatch/.agents/skills/agent-native-docs/SKILL.md +23 -3
  144. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  145. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +23 -2
  146. package/corpus/templates/dispatch/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  147. package/corpus/templates/dispatch/agent-native.json +12 -0
  148. package/corpus/templates/factory/.agents/skills/agent-native-docs/SKILL.md +23 -3
  149. package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  150. package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +23 -2
  151. package/corpus/templates/factory/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  152. package/corpus/templates/factory/agent-native.json +12 -0
  153. package/corpus/templates/forms/.agents/skills/agent-native-docs/SKILL.md +23 -3
  154. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  155. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +23 -2
  156. package/corpus/templates/forms/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  157. package/corpus/templates/forms/actions/export-responses.ts +1 -1
  158. package/corpus/templates/forms/agent-native.json +12 -0
  159. package/corpus/templates/macros/.agents/skills/agent-native-docs/SKILL.md +23 -3
  160. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  161. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +23 -2
  162. package/corpus/templates/macros/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  163. package/corpus/templates/macros/agent-native.json +12 -0
  164. package/corpus/templates/mail/.agents/skills/agent-native-docs/SKILL.md +23 -3
  165. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  166. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +23 -2
  167. package/corpus/templates/mail/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  168. package/corpus/templates/mail/agent-native.json +12 -0
  169. package/corpus/templates/mail/app/i18n/en-US.ts +1 -1
  170. package/corpus/templates/mail/server/lib/media-upload.ts +1 -1
  171. package/corpus/templates/plan/.agents/skills/agent-native-docs/SKILL.md +23 -3
  172. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  173. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +23 -2
  174. package/corpus/templates/plan/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  175. package/corpus/templates/plan/agent-native.json +12 -0
  176. package/corpus/templates/plan/server/lib/plan-assets.ts +1 -1
  177. package/corpus/templates/slides/.agents/skills/agent-native-docs/SKILL.md +23 -3
  178. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  179. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +23 -2
  180. package/corpus/templates/slides/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  181. package/corpus/templates/slides/actions/generate-image-api.ts +1 -1
  182. package/corpus/templates/slides/actions/generate-slides-ai.ts +1 -1
  183. package/corpus/templates/slides/actions/import-file.ts +2 -2
  184. package/corpus/templates/slides/actions/index-design-system-with-builder.ts +1 -1
  185. package/corpus/templates/slides/agent-native.json +12 -0
  186. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +1 -1
  187. package/corpus/templates/slides/app/i18n/en-US.ts +2 -2
  188. package/corpus/templates/slides/app/lib/deck-sorting.ts +19 -0
  189. package/corpus/templates/slides/app/lib/image-drop-to-agent.ts +1 -1
  190. package/corpus/templates/slides/app/pages/Index.tsx +7 -2
  191. package/corpus/templates/slides/changelog/2026-08-05-decks-are-now-sorted-by-most-recently-updated.md +6 -0
  192. package/corpus/templates/slides/server/handlers/assets.ts +1 -1
  193. package/corpus/templates/slides/server/handlers/uploads.ts +1 -1
  194. package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +23 -3
  195. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  196. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +23 -2
  197. package/corpus/templates/tasks/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  198. package/corpus/templates/tasks/agent-native.json +12 -0
  199. package/dist/action.d.ts +6 -0
  200. package/dist/agent/engine/builder-engine.js +2 -2
  201. package/dist/agent/engine/credential-errors.d.ts +1 -1
  202. package/dist/agent/engine/credential-errors.js +2 -2
  203. package/dist/agent/production-agent.js +3 -2
  204. package/dist/brand-kit/fig/index.js +1 -1
  205. package/dist/cli/agent.js +45 -3
  206. package/dist/cli/code-agent-executor.js +2 -1
  207. package/dist/cli/create.d.ts +9 -1
  208. package/dist/cli/create.js +94 -1
  209. package/dist/cli/doctor.d.ts +8 -11
  210. package/dist/cli/doctor.js +92 -24
  211. package/dist/cli/index.js +6 -5
  212. package/dist/client/AgentAskPopover.d.ts +3 -1
  213. package/dist/client/AgentAskPopover.js +2 -2
  214. package/dist/client/AgentPanel.js +9 -3
  215. package/dist/client/AssistantChat.js +54 -33
  216. package/dist/client/MultiTabAssistantChat.js +1 -1
  217. package/dist/client/RouteTransitionIndicator.d.ts +7 -0
  218. package/dist/client/RouteTransitionIndicator.js +31 -0
  219. package/dist/client/agent-engine-key.js +1 -1
  220. package/dist/client/app-providers.js +11 -2
  221. package/dist/client/chat/message-components.js +1 -1
  222. package/dist/client/chat/run-recovery.js +1 -1
  223. package/dist/client/chat/tool-call-display.d.ts +3 -1
  224. package/dist/client/chat/tool-call-display.js +4 -3
  225. package/dist/client/chat-model-groups.d.ts +6 -0
  226. package/dist/client/chat-model-groups.js +11 -0
  227. package/dist/client/error-format.js +1 -1
  228. package/dist/client/i18n.js +1 -1
  229. package/dist/client/onboarding/FirstRunOnboarding.d.ts +5 -1
  230. package/dist/client/onboarding/FirstRunOnboarding.js +29 -13
  231. package/dist/client/onboarding/first-run-enabled.d.ts +6 -1
  232. package/dist/client/onboarding/first-run-enabled.js +33 -3
  233. package/dist/client/onboarding/use-onboarding.js +16 -11
  234. package/dist/client/resources/mcp-integration-catalog.js +26 -0
  235. package/dist/client/resources/mcp-integration-logos.js +4 -0
  236. package/dist/client/route-warmup.js +56 -10
  237. package/dist/client/settings/AccountSettingsCard.js +78 -3
  238. package/dist/client/settings/SettingsPanel.js +1 -1
  239. package/dist/client/settings/VoiceTranscriptionSection.js +2 -2
  240. package/dist/client/settings/useBuilderStatus.js +1 -1
  241. package/dist/client/setup-connections/useBuilderConnectCardController.js +1 -1
  242. package/dist/client/ui/index.d.ts +1 -0
  243. package/dist/client/ui/index.js +1 -0
  244. package/dist/client/uploads/upload-editor-image.js +1 -1
  245. package/dist/client/use-chat-threads.js +3 -0
  246. package/dist/collab/routes.d.ts +2 -2
  247. package/dist/collab/struct-routes.d.ts +1 -1
  248. package/dist/config.d.ts +48 -0
  249. package/dist/config.js +111 -0
  250. package/dist/db/migrations.js +5 -0
  251. package/dist/eject/provider-api-definitions.d.ts +1 -1
  252. package/dist/eject/provider-api-definitions.js +1 -0
  253. package/dist/eject/remote-mcp-presets.js +1 -0
  254. package/dist/extensions/web-search-tool.js +2 -2
  255. package/dist/file-upload/actions/upload-image.js +1 -1
  256. package/dist/file-upload/registry.js +1 -1
  257. package/dist/guards/index.d.ts +3 -0
  258. package/dist/guards/index.js +2 -0
  259. package/dist/guards/no-empty-migrations.d.ts +14 -0
  260. package/dist/guards/no-empty-migrations.js +126 -0
  261. package/dist/index.browser.d.ts +1 -0
  262. package/dist/index.browser.js +3 -0
  263. package/dist/index.d.ts +1 -0
  264. package/dist/index.js +1 -0
  265. package/dist/localization/default-messages.d.ts +24 -0
  266. package/dist/localization/default-messages.js +26 -2
  267. package/dist/notifications/routes.d.ts +3 -3
  268. package/dist/onboarding/app-profile.js +1 -1
  269. package/dist/onboarding/plugin.d.ts +2 -0
  270. package/dist/onboarding/plugin.js +29 -2
  271. package/dist/provider-api/actions/custom-provider-registration.d.ts +16 -16
  272. package/dist/provider-api/actions/provider-api.d.ts +13 -13
  273. package/dist/provider-api/index.d.ts +4 -4
  274. package/dist/provider-api/index.js +35 -0
  275. package/dist/resources/handlers.d.ts +1 -1
  276. package/dist/resources/handlers.js +1 -1
  277. package/dist/scripts/docs/framework-search.d.ts +9 -0
  278. package/dist/scripts/docs/framework-search.js +239 -0
  279. package/dist/scripts/docs/index.js +1 -0
  280. package/dist/scripts/docs/search.d.ts +10 -0
  281. package/dist/scripts/docs/search.js +1 -1
  282. package/dist/scripts/docs/source-search.d.ts +10 -2
  283. package/dist/scripts/docs/source-search.js +108 -41
  284. package/dist/search-utils/index.d.ts +11 -0
  285. package/dist/search-utils/index.js +72 -0
  286. package/dist/server/action-change.d.ts +6 -0
  287. package/dist/server/action-change.js +28 -14
  288. package/dist/server/action-discovery.js +9 -0
  289. package/dist/server/action-routes.js +1 -0
  290. package/dist/server/agent-chat/browser-team-tools.js +1 -1
  291. package/dist/server/agent-chat/script-entries.js +43 -2
  292. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  293. package/dist/server/auth-login-mode.d.ts +8 -0
  294. package/dist/server/auth-login-mode.js +17 -0
  295. package/dist/server/auth.js +100 -15
  296. package/dist/server/better-auth-instance.d.ts +36 -0
  297. package/dist/server/better-auth-instance.js +25 -3
  298. package/dist/server/builder-design-systems.js +1 -1
  299. package/dist/server/core-routes-plugin.js +17 -14
  300. package/dist/server/credential-provider.js +3 -3
  301. package/dist/server/email-templates.d.ts +7 -0
  302. package/dist/server/email-templates.js +24 -0
  303. package/dist/server/email.d.ts +17 -0
  304. package/dist/server/email.js +22 -1
  305. package/dist/server/framework-request-handler.js +6 -0
  306. package/dist/server/onboarding-html.d.ts +2 -0
  307. package/dist/server/onboarding-html.js +169 -8
  308. package/dist/server/realtime-token.d.ts +1 -1
  309. package/dist/server/realtime-voice.js +1 -1
  310. package/dist/server/sentry.d.ts +1 -1
  311. package/dist/server/transcribe-voice.js +3 -3
  312. package/dist/shared/first-run-onboarding.d.ts +1 -0
  313. package/dist/shared/first-run-onboarding.js +1 -0
  314. package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +23 -3
  315. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  316. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +23 -2
  317. package/dist/templates/chat/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  318. package/dist/templates/chat/AGENTS.md +3 -0
  319. package/dist/templates/chat/DESIGN.md +28 -0
  320. package/dist/templates/chat/agent-native.json +12 -0
  321. package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +23 -3
  322. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  323. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +23 -2
  324. package/dist/templates/default/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  325. package/dist/templates/default/AGENTS.md +4 -0
  326. package/dist/templates/default/DESIGN.md +30 -0
  327. package/dist/templates/default/agent-native.json +9 -0
  328. package/dist/templates/default/app/i18n/ar-SA.ts +2 -2
  329. package/dist/templates/default/app/i18n/de-DE.ts +2 -2
  330. package/dist/templates/default/app/i18n/en-US.ts +2 -2
  331. package/dist/templates/default/app/i18n/es-ES.ts +2 -2
  332. package/dist/templates/default/app/i18n/fr-FR.ts +2 -2
  333. package/dist/templates/default/app/i18n/hi-IN.ts +2 -2
  334. package/dist/templates/default/app/i18n/ja-JP.ts +2 -2
  335. package/dist/templates/default/app/i18n/ko-KR.ts +2 -2
  336. package/dist/templates/default/app/i18n/pt-BR.ts +2 -2
  337. package/dist/templates/default/app/i18n/zh-CN.ts +2 -2
  338. package/dist/templates/default/app/i18n/zh-TW.ts +1 -1
  339. package/dist/templates/default/package.json +1 -0
  340. package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +23 -3
  341. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  342. package/dist/templates/headless/agent-native.json +9 -0
  343. package/dist/templates/headless/package.json +2 -0
  344. package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +23 -3
  345. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  346. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +23 -2
  347. package/dist/templates/workspace-core/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  348. package/dist/templates/workspace-core/AGENTS.md +3 -0
  349. package/dist/templates/workspace-core/DESIGN.md +35 -0
  350. package/dist/templates/workspace-root/AGENTS.md +3 -0
  351. package/dist/templates/workspace-root/DESIGN.md +35 -0
  352. package/dist/templates/workspace-root/agent-native.json +9 -0
  353. package/dist/templates/workspace-root/package.json +3 -0
  354. package/dist/transcription/builder-transcription.js +1 -1
  355. package/dist/user-profile/actions/change-password.d.ts +8 -0
  356. package/dist/user-profile/actions/change-password.js +24 -0
  357. package/dist/user-profile/actions/get-auth-methods.d.ts +6 -0
  358. package/dist/user-profile/actions/get-auth-methods.js +23 -0
  359. package/dist/user-profile/actions/set-password.d.ts +7 -0
  360. package/dist/user-profile/actions/set-password.js +23 -0
  361. package/dist/vite/client.d.ts +8 -1
  362. package/dist/vite/client.js +63 -12
  363. package/dist/vite/index.d.ts +1 -0
  364. package/dist/vite/index.js +1 -0
  365. package/docs/AGENTS.md +7 -2
  366. package/docs/SKILL.md +7 -5
  367. package/docs/content/agent-native-config.mdx +165 -0
  368. package/docs/content/agent-native-toolkit.mdx +1 -1
  369. package/docs/content/deployment.mdx +7 -2
  370. package/docs/content/doctor.mdx +21 -13
  371. package/docs/content/environment-variables.mdx +158 -0
  372. package/docs/content/file-uploads.mdx +1 -1
  373. package/docs/content/getting-started.mdx +1 -1
  374. package/docs/content/key-concepts.mdx +1 -1
  375. package/docs/content/multi-app-workspace.mdx +1 -1
  376. package/docs/content/template-clips-ai-and-editing.mdx +6 -6
  377. package/docs/content/template-clips-developers.mdx +3 -3
  378. package/docs/content/toolkit-settings.mdx +1 -1
  379. package/docs/content/voice-input.mdx +4 -4
  380. package/package.json +6 -2
  381. package/src/eject/provider-api-definitions.ts +1 -0
  382. package/src/eject/remote-mcp-presets.ts +1 -0
  383. package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +23 -3
  384. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  385. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +23 -2
  386. package/src/templates/chat/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  387. package/src/templates/chat/AGENTS.md +3 -0
  388. package/src/templates/chat/DESIGN.md +28 -0
  389. package/src/templates/chat/agent-native.json +12 -0
  390. package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +23 -3
  391. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  392. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +23 -2
  393. package/src/templates/default/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  394. package/src/templates/default/AGENTS.md +4 -0
  395. package/src/templates/default/DESIGN.md +30 -0
  396. package/src/templates/default/agent-native.json +9 -0
  397. package/src/templates/default/app/i18n/ar-SA.ts +2 -2
  398. package/src/templates/default/app/i18n/de-DE.ts +2 -2
  399. package/src/templates/default/app/i18n/en-US.ts +2 -2
  400. package/src/templates/default/app/i18n/es-ES.ts +2 -2
  401. package/src/templates/default/app/i18n/fr-FR.ts +2 -2
  402. package/src/templates/default/app/i18n/hi-IN.ts +2 -2
  403. package/src/templates/default/app/i18n/ja-JP.ts +2 -2
  404. package/src/templates/default/app/i18n/ko-KR.ts +2 -2
  405. package/src/templates/default/app/i18n/pt-BR.ts +2 -2
  406. package/src/templates/default/app/i18n/zh-CN.ts +2 -2
  407. package/src/templates/default/app/i18n/zh-TW.ts +1 -1
  408. package/src/templates/default/package.json +1 -0
  409. package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +23 -3
  410. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  411. package/src/templates/headless/agent-native.json +9 -0
  412. package/src/templates/headless/package.json +2 -0
  413. package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +23 -3
  414. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +16 -0
  415. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +23 -2
  416. package/src/templates/workspace-core/.agents/skills/frontend-design/references/visual-direction.md +99 -0
  417. package/src/templates/workspace-core/AGENTS.md +3 -0
  418. package/src/templates/workspace-core/DESIGN.md +35 -0
  419. package/src/templates/workspace-root/AGENTS.md +3 -0
  420. package/src/templates/workspace-root/DESIGN.md +35 -0
  421. package/src/templates/workspace-root/agent-native.json +9 -0
  422. package/src/templates/workspace-root/package.json +3 -0
@@ -75,8 +75,10 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
75
75
  user: "user";
76
76
  }>>;
77
77
  }, z.core.$strip>>, {
78
+ id?: undefined;
79
+ provider?: undefined;
78
80
  deleted?: undefined;
79
- message?: undefined;
81
+ found?: undefined;
80
82
  providers: {
81
83
  id: string;
82
84
  label: string;
@@ -87,47 +89,45 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
87
89
  updatedAt: number;
88
90
  }[];
89
91
  count: number;
90
- provider?: undefined;
91
- found?: undefined;
92
92
  registered?: undefined;
93
- id?: undefined;
94
93
  label?: undefined;
94
+ message?: undefined;
95
95
  } | {
96
+ id?: undefined;
96
97
  deleted?: undefined;
97
- count?: undefined;
98
- message?: undefined;
99
98
  providers?: undefined;
99
+ count?: undefined;
100
100
  found: boolean;
101
101
  provider: import("../custom-registry.js").CustomProviderConfig;
102
102
  registered?: undefined;
103
- id?: undefined;
104
103
  label?: undefined;
104
+ message?: undefined;
105
105
  } | {
106
+ provider?: undefined;
106
107
  deleted?: undefined;
107
- count?: undefined;
108
- message?: undefined;
109
108
  providers?: undefined;
110
- provider?: undefined;
109
+ count?: undefined;
111
110
  found: boolean;
112
111
  id: string;
113
112
  registered?: undefined;
114
113
  label?: undefined;
115
- } | {
116
- count?: undefined;
117
114
  message?: undefined;
118
- providers?: undefined;
115
+ } | {
119
116
  provider?: undefined;
120
117
  found?: undefined;
118
+ providers?: undefined;
119
+ count?: undefined;
121
120
  deleted: boolean;
122
121
  id: string;
123
122
  registered?: undefined;
124
123
  label?: undefined;
124
+ message?: undefined;
125
125
  } | {
126
- deleted?: undefined;
127
- count?: undefined;
128
- providers?: undefined;
129
126
  provider?: undefined;
127
+ deleted?: undefined;
130
128
  found?: undefined;
129
+ providers?: undefined;
130
+ count?: undefined;
131
131
  registered: boolean;
132
132
  id: string;
133
133
  label: string;
@@ -144,7 +144,7 @@ export declare function createProviderApiCatalogAction<TSchema extends ZodTypeAn
144
144
  provider: z.ZodOptional<ZodTypeAny<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
145
145
  }, z.core.$strip>>, {
146
146
  providers: unknown[] | {
147
- id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
147
+ id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "fullstory" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
148
148
  label: string;
149
149
  defaultBaseUrl: string;
150
150
  requiresConnectionId: boolean;
@@ -246,7 +246,7 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
246
246
  provider?: unknown;
247
247
  }, {
248
248
  providers: unknown[] | {
249
- id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
249
+ id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "fullstory" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
250
250
  label: string;
251
251
  defaultBaseUrl: string;
252
252
  requiresConnectionId: boolean;
@@ -314,6 +314,8 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
314
314
  id?: undefined;
315
315
  provider?: undefined;
316
316
  deleted?: undefined;
317
+ found?: undefined;
318
+ message?: undefined;
317
319
  providers: {
318
320
  id: string;
319
321
  label: string;
@@ -324,46 +326,44 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
324
326
  updatedAt: number;
325
327
  }[];
326
328
  count: number;
327
- found?: undefined;
328
329
  registered?: undefined;
329
330
  label?: undefined;
330
- message?: undefined;
331
331
  } | {
332
332
  id?: undefined;
333
- deleted?: undefined;
334
333
  count?: undefined;
334
+ deleted?: undefined;
335
+ message?: undefined;
335
336
  providers?: undefined;
336
337
  found: boolean;
337
338
  provider: import("../custom-registry.js").CustomProviderConfig;
338
339
  registered?: undefined;
339
340
  label?: undefined;
340
- message?: undefined;
341
341
  } | {
342
+ count?: undefined;
342
343
  provider?: undefined;
343
344
  deleted?: undefined;
344
- count?: undefined;
345
+ message?: undefined;
345
346
  providers?: undefined;
346
347
  found: boolean;
347
348
  id: string;
348
349
  registered?: undefined;
349
350
  label?: undefined;
350
- message?: undefined;
351
351
  } | {
352
- provider?: undefined;
353
352
  count?: undefined;
354
- providers?: undefined;
353
+ provider?: undefined;
355
354
  found?: undefined;
355
+ message?: undefined;
356
+ providers?: undefined;
356
357
  deleted: boolean;
357
358
  id: string;
358
359
  registered?: undefined;
359
360
  label?: undefined;
360
- message?: undefined;
361
361
  } | {
362
+ count?: undefined;
362
363
  provider?: undefined;
363
364
  deleted?: undefined;
364
- count?: undefined;
365
- providers?: undefined;
366
365
  found?: undefined;
366
+ providers?: undefined;
367
367
  registered: boolean;
368
368
  id: string;
369
369
  label: string;
@@ -4,7 +4,7 @@ import { type WebContentSearchOptions, type WebExtractMode, type WebResponseMode
4
4
  import type { CustomProviderConfig } from "./custom-registry.js";
5
5
  export type { CustomProviderConfig, CustomProviderScope, CustomProviderAuthKind, UpsertCustomProviderArgs, } from "./custom-registry.js";
6
6
  export { upsertCustomProvider, deleteCustomProvider, listCustomProviders, getCustomProvider, validateCustomBaseUrl, assertCanMutateCustomProviderScope, CustomProviderAuthError, } from "./custom-registry.js";
7
- export declare const PROVIDER_API_IDS: readonly ["amplitude", "apollo", "bigquery", "clay", "commonroom", "dataforseo", "ga4", "gcloud", "github", "figma", "gmail", "gong", "google_calendar", "google_drive", "google_slides", "granola", "grafana", "hubspot", "salesforce", "jira", "mixpanel", "notion", "posthog", "prometheus", "pylon", "sentry", "slack", "stripe", "twitter"];
7
+ export declare const PROVIDER_API_IDS: readonly ["amplitude", "apollo", "bigquery", "clay", "commonroom", "dataforseo", "ga4", "gcloud", "github", "figma", "fullstory", "gmail", "gong", "google_calendar", "google_drive", "google_slides", "granola", "grafana", "hubspot", "salesforce", "jira", "mixpanel", "notion", "posthog", "prometheus", "pylon", "sentry", "slack", "stripe", "twitter"];
8
8
  export type ProviderApiId = (typeof PROVIDER_API_IDS)[number];
9
9
  export type ProviderApiMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD";
10
10
  /** Cursor-pagination config for fetchAllPages. */
@@ -422,7 +422,7 @@ export declare function listProviderApiCatalog(provider?: ProviderApiId | string
422
422
  providerIds?: readonly (ProviderApiId | string)[];
423
423
  providerOverrides?: readonly ProviderApiConfig[];
424
424
  }): {
425
- id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
425
+ id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "fullstory" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
426
426
  label: string;
427
427
  defaultBaseUrl: string;
428
428
  requiresConnectionId: boolean;
@@ -444,7 +444,7 @@ export declare function createProviderApiRuntime(options: ProviderApiRuntimeOpti
444
444
  export declare function fetchProviderApiDocs(options: ProviderApiDocsOptions, runtime?: ProviderApiRuntimeOptions): Promise<{
445
445
  provider: string;
446
446
  catalog: {
447
- id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
447
+ id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "fullstory" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
448
448
  label: string;
449
449
  defaultBaseUrl: string;
450
450
  requiresConnectionId: boolean;
@@ -484,7 +484,7 @@ export declare function fetchProviderApiDocs(options: ProviderApiDocsOptions, ru
484
484
  guidance?: undefined;
485
485
  provider: string;
486
486
  catalog: {
487
- id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
487
+ id: "amplitude" | "apollo" | "bigquery" | "clay" | "commonroom" | "dataforseo" | "figma" | "fullstory" | "ga4" | "gcloud" | "github" | "gmail" | "gong" | "google_calendar" | "google_drive" | "google_slides" | "grafana" | "granola" | "hubspot" | "jira" | "mixpanel" | "notion" | "posthog" | "prometheus" | "pylon" | "salesforce" | "sentry" | "slack" | "stripe" | "twitter";
488
488
  label: string;
489
489
  defaultBaseUrl: string;
490
490
  requiresConnectionId: boolean;
@@ -22,6 +22,7 @@ export const PROVIDER_API_IDS = [
22
22
  "gcloud",
23
23
  "github",
24
24
  "figma",
25
+ "fullstory",
25
26
  "gmail",
26
27
  "gong",
27
28
  "google_calendar",
@@ -393,6 +394,40 @@ const PROVIDER_CONFIGS = {
393
394
  "The REST API cannot create arbitrary canvas frames or layers. Use Figma's official OAuth MCP write tools when connected, or export a Design selection as Figma-compatible SVG for visual handoff.",
394
395
  ],
395
396
  },
397
+ fullstory: {
398
+ id: "fullstory",
399
+ label: "FullStory Server API",
400
+ defaultBaseUrl: "https://api.fullstory.com",
401
+ auth: {
402
+ type: "basic-raw",
403
+ key: "FULLSTORY_API_KEY",
404
+ },
405
+ credentialKeys: ["FULLSTORY_API_KEY"],
406
+ docsUrls: [
407
+ "https://developer.fullstory.com/server/authentication/",
408
+ "https://developer.fullstory.com/server/sessions/introduction/",
409
+ "https://developer.fullstory.com/server/sessions/get-session-events/",
410
+ ],
411
+ allowedHostSuffixes: ["fullstory.com"],
412
+ templateUses: ["analytics"],
413
+ examples: [
414
+ {
415
+ label: "List sessions for a user",
416
+ method: "GET",
417
+ path: "/sessions/v2",
418
+ query: { email: "<user-email>", limit: 20 },
419
+ },
420
+ {
421
+ label: "Get session events",
422
+ method: "GET",
423
+ path: "/v2/sessions/{sessionId}/events",
424
+ },
425
+ ],
426
+ notes: [
427
+ "FullStory Server API uses Basic <API_KEY> authentication. Architect access is required for user-data reads and exports.",
428
+ "Use the connected FullStory MCP for natural-language metrics, session replay, screenshots, and accessibility trees; this API fallback is for structured reads and event payloads.",
429
+ ],
430
+ },
396
431
  gmail: {
397
432
  id: "gmail",
398
433
  label: "Gmail API",
@@ -48,8 +48,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
48
48
  }>;
49
49
  /** DELETE /_agent-native/resources/:id — delete a resource */
50
50
  export declare function handleDeleteResource(event: any): Promise<{
51
- ok?: undefined;
52
51
  error: string;
52
+ ok?: undefined;
53
53
  } | {
54
54
  error?: undefined;
55
55
  ok: boolean;
@@ -532,7 +532,7 @@ export async function handleUploadResource(event) {
532
532
  }
533
533
  setResponseStatus(event, 503);
534
534
  return {
535
- error: "File storage is not configured. Connect Builder.io or register an S3/R2/GCS file upload provider before uploading binary resources.",
535
+ error: "File storage is not configured. Connect Builder.io (free tier available) or register an S3/R2/GCS file upload provider before uploading binary resources.",
536
536
  storageSetupRequired: true,
537
537
  };
538
538
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Core script: framework-search
3
+ *
4
+ * Search the version-matched framework docs and readable source together.
5
+ * This is intentionally bounded and read-only so every app chat can use the
6
+ * same fallback when a question is not answered by the docs alone.
7
+ */
8
+ export default function frameworkSearchScript(args: string[]): Promise<void>;
9
+ //# sourceMappingURL=framework-search.d.ts.map
@@ -0,0 +1,239 @@
1
+ /**
2
+ * Core script: framework-search
3
+ *
4
+ * Search the version-matched framework docs and readable source together.
5
+ * This is intentionally bounded and read-only so every app chat can use the
6
+ * same fallback when a question is not answered by the docs alone.
7
+ */
8
+ import fs from "node:fs";
9
+ import { createTextMatcher, } from "../../search-utils/index.js";
10
+ import { parseArgs } from "../utils.js";
11
+ import { loadAllDocs } from "./search.js";
12
+ import { listSourceFiles } from "./source-search.js";
13
+ const DEFAULT_LIMIT = 30;
14
+ const MAX_LIMIT = 50;
15
+ const MAX_SNIPPETS_PER_RESULT = 3;
16
+ function parseScope(value) {
17
+ if (!value)
18
+ return { value: "all" };
19
+ if (value === "all" || value === "docs" || value === "source") {
20
+ return { value };
21
+ }
22
+ return { error: `Invalid scope "${value}". Use all, docs, or source.` };
23
+ }
24
+ function parseMode(value) {
25
+ if (!value)
26
+ return { value: "substring" };
27
+ if (value === "substring" ||
28
+ value === "glob" ||
29
+ value === "sql-like" ||
30
+ value === "regex") {
31
+ return { value };
32
+ }
33
+ return {
34
+ error: `Invalid mode "${value}". Use substring, glob, sql-like, or regex.`,
35
+ };
36
+ }
37
+ function parseLimit(value) {
38
+ if (!value)
39
+ return { value: DEFAULT_LIMIT };
40
+ const parsed = Number(value);
41
+ if (!Number.isInteger(parsed) || parsed < 1) {
42
+ return { error: "Limit must be a positive integer." };
43
+ }
44
+ return { value: Math.min(parsed, MAX_LIMIT) };
45
+ }
46
+ function docsAsEntries(docs) {
47
+ return docs.map((doc) => ({
48
+ kind: "doc",
49
+ path: `docs/${doc.slug}`,
50
+ title: doc.title,
51
+ body: `${doc.title}\n${doc.description}\n${doc.body}`,
52
+ }));
53
+ }
54
+ function sourceAsEntries(files) {
55
+ const entries = [];
56
+ let unreadable = 0;
57
+ for (const file of files) {
58
+ try {
59
+ entries.push({
60
+ kind: "source",
61
+ path: file.relativePath,
62
+ body: fs.readFileSync(file.absolutePath, "utf-8"),
63
+ file,
64
+ });
65
+ }
66
+ catch {
67
+ unreadable += 1;
68
+ }
69
+ }
70
+ return { entries, unreadable };
71
+ }
72
+ function snippetsForEntry(entry, matcher, pathMatch) {
73
+ const snippets = [];
74
+ const lines = entry.body.split(/\r?\n/);
75
+ for (let index = 0; index < lines.length; index += 1) {
76
+ if (!matcher.matches(lines[index]))
77
+ continue;
78
+ const line = lines[index].trim();
79
+ if (!line)
80
+ continue;
81
+ snippets.push(`${index + 1}: ${line.slice(0, 260)}`);
82
+ if (snippets.length >= MAX_SNIPPETS_PER_RESULT)
83
+ break;
84
+ }
85
+ if (snippets.length === 0 && pathMatch) {
86
+ const firstLine = lines.find((line) => line.trim());
87
+ if (firstLine)
88
+ snippets.push(`1: ${firstLine.trim().slice(0, 260)}`);
89
+ }
90
+ return snippets;
91
+ }
92
+ function pathMatches(path, filter) {
93
+ if (!filter)
94
+ return { matches: true };
95
+ const matcher = createTextMatcher(filter, "glob");
96
+ return { matches: matcher.matches(path), error: matcher.error };
97
+ }
98
+ async function searchFramework(options) {
99
+ const [docs, sourceResult] = await Promise.all([
100
+ options.scope === "source" ? Promise.resolve([]) : loadAllDocs(),
101
+ options.scope === "docs"
102
+ ? Promise.resolve({ entries: [], unreadable: 0 })
103
+ : Promise.resolve(sourceAsEntries(listSourceFiles())),
104
+ ]);
105
+ const entries = [
106
+ ...(options.scope === "source" ? [] : docsAsEntries(docs)),
107
+ ...(options.scope === "docs" ? [] : sourceResult.entries),
108
+ ];
109
+ const matcher = createTextMatcher(options.pattern, options.mode);
110
+ if (matcher.error) {
111
+ return { hits: [], total: 0, unreadable: 0 };
112
+ }
113
+ const hits = [];
114
+ for (const entry of entries) {
115
+ const pathResult = pathMatches(entry.path, options.pathFilter);
116
+ if (pathResult.error)
117
+ continue;
118
+ if (!pathResult.matches)
119
+ continue;
120
+ const pathMatch = matcher.matches(entry.path);
121
+ const contentMatch = matcher.matches(entry.body);
122
+ if (!pathMatch && !contentMatch)
123
+ continue;
124
+ const snippets = snippetsForEntry(entry, matcher, pathMatch);
125
+ hits.push({ entry, pathMatch, snippets });
126
+ }
127
+ // Keep the result deterministic and favor docs titles and exact path hits.
128
+ hits.sort((a, b) => {
129
+ const aScore = (a.pathMatch ? 2 : 0) + (a.entry.kind === "doc" ? 1 : 0);
130
+ const bScore = (b.pathMatch ? 2 : 0) + (b.entry.kind === "doc" ? 1 : 0);
131
+ return bScore - aScore || a.entry.path.localeCompare(b.entry.path);
132
+ });
133
+ return {
134
+ hits: hits.slice(0, options.limit),
135
+ total: hits.length,
136
+ unreadable: sourceResult.unreadable,
137
+ };
138
+ }
139
+ function printHelp() {
140
+ console.log(`Usage: pnpm action framework-search [options]
141
+
142
+ Options:
143
+ --pattern <text> Text, wildcard, SQL-like, or regex pattern to search
144
+ --query <text> Alias for --pattern
145
+ --scope <scope> all, docs, or source (default: all)
146
+ --mode <mode> substring, glob, sql-like, or regex (default: substring)
147
+ --path <glob> Optional glob to limit matching paths
148
+ --limit <number> Maximum files to return (default: ${DEFAULT_LIMIT}, max: ${MAX_LIMIT})
149
+ --list List the searchable docs and source roots
150
+ --help Show this help message`);
151
+ }
152
+ export default async function frameworkSearchScript(args) {
153
+ const parsed = parseArgs(args);
154
+ if (parsed.help === "true") {
155
+ printHelp();
156
+ return;
157
+ }
158
+ const scopeResult = parseScope(parsed.scope);
159
+ if (scopeResult.error) {
160
+ console.log(scopeResult.error);
161
+ return;
162
+ }
163
+ const scope = scopeResult.value;
164
+ const modeResult = parseMode(parsed.mode);
165
+ if (modeResult.error) {
166
+ console.log(modeResult.error);
167
+ return;
168
+ }
169
+ const mode = modeResult.value;
170
+ const limitResult = parseLimit(parsed.limit);
171
+ if (limitResult.error) {
172
+ console.log(limitResult.error);
173
+ return;
174
+ }
175
+ const limit = limitResult.value;
176
+ if (parsed.list === "true") {
177
+ const [docs, sourceFiles] = await Promise.all([
178
+ scope === "source" ? Promise.resolve([]) : loadAllDocs(),
179
+ scope === "docs"
180
+ ? Promise.resolve([])
181
+ : Promise.resolve(listSourceFiles()),
182
+ ]);
183
+ console.log(JSON.stringify({
184
+ docs: docs.map((doc) => ({ slug: doc.slug, title: doc.title })),
185
+ source: {
186
+ files: sourceFiles.length,
187
+ roots: Array.from(new Set(sourceFiles.map((file) => file.relativePath.split("/")[0]))),
188
+ },
189
+ }, null, 2));
190
+ return;
191
+ }
192
+ const pattern = parsed.pattern ?? parsed.query;
193
+ if (!pattern) {
194
+ printHelp();
195
+ return;
196
+ }
197
+ const matcher = createTextMatcher(pattern, mode);
198
+ if (matcher.error) {
199
+ console.log(matcher.error);
200
+ return;
201
+ }
202
+ if (parsed.path) {
203
+ const pathMatcher = createTextMatcher(parsed.path, "glob");
204
+ if (pathMatcher.error) {
205
+ console.log(pathMatcher.error);
206
+ return;
207
+ }
208
+ }
209
+ const result = await searchFramework({
210
+ pattern,
211
+ mode,
212
+ scope,
213
+ pathFilter: parsed.path,
214
+ limit,
215
+ });
216
+ if (result.total === 0) {
217
+ console.log(`No matches in the indexed ${scope} corpus for ${JSON.stringify(pattern)}.`);
218
+ console.log("The search covers version-matched framework docs, runtime-visible skills, and readable Core, Toolkit, and first-party template source. A miss is not proof that an implementation is absent if the relevant package source is not published in this app.");
219
+ if (result.unreadable > 0) {
220
+ console.log(`Skipped ${result.unreadable} unreadable source file(s).`);
221
+ }
222
+ return;
223
+ }
224
+ console.log(`Found ${result.total} matching file(s) in ${scope} using ${mode} mode for ${JSON.stringify(pattern)}:\n`);
225
+ for (const hit of result.hits) {
226
+ const label = hit.entry.kind === "doc" ? "doc" : "source";
227
+ console.log(`[${label}] ${hit.entry.path}${hit.entry.title ? ` - ${hit.entry.title}` : ""}`);
228
+ for (const snippet of hit.snippets)
229
+ console.log(` ${snippet}`);
230
+ console.log("");
231
+ }
232
+ if (result.total > result.hits.length) {
233
+ console.log(`Showing ${result.hits.length} of ${result.total} matching files. Refine --path, --pattern, or --limit for more targeted evidence.`);
234
+ }
235
+ if (result.unreadable > 0) {
236
+ console.log(`Skipped ${result.unreadable} unreadable source file(s).`);
237
+ }
238
+ }
239
+ //# sourceMappingURL=framework-search.js.map
@@ -1,4 +1,5 @@
1
1
  export const coreDocsScripts = {
2
+ "framework-search": (args) => import("./framework-search.js").then((m) => m.default(args)),
2
3
  "docs-search": (args) => import("./search.js").then((m) => m.default(args)),
3
4
  "source-search": (args) => import("./source-search.js").then((m) => m.default(args)),
4
5
  };
@@ -9,5 +9,15 @@
9
9
  * pnpm action docs-search --slug authentication
10
10
  * pnpm action docs-search --list
11
11
  */
12
+ interface DocMeta {
13
+ slug: string;
14
+ title: string;
15
+ description: string;
16
+ }
17
+ export interface DocFull extends DocMeta {
18
+ body: string;
19
+ }
20
+ export declare function loadAllDocs(): Promise<DocFull[]>;
12
21
  export default function docsSearchScript(args: string[]): Promise<void>;
22
+ export {};
13
23
  //# sourceMappingURL=search.d.ts.map
@@ -164,7 +164,7 @@ async function loadAgentBundleDocs() {
164
164
  return [];
165
165
  }
166
166
  }
167
- async function loadAllDocs() {
167
+ export async function loadAllDocs() {
168
168
  return [...loadFilesystemDocs(), ...(await loadAgentBundleDocs())];
169
169
  }
170
170
  async function searchDocs(query) {
@@ -1,15 +1,22 @@
1
1
  /**
2
2
  * Core script: source-search
3
3
  *
4
- * Search and read the packaged Agent Native first-party template corpus.
5
- * The corpus is generated into @agent-native/core/corpus during package build.
4
+ * Search and read version-matched framework source.
5
+ * First-party templates are generated into @agent-native/core/corpus during
6
+ * package build; Core and Toolkit source are read from their installed roots.
6
7
  *
7
8
  * Usage:
8
9
  * pnpm action source-search --query "defineAction"
9
10
  * pnpm action source-search --path templates/chat/actions/hello.ts
11
+ * pnpm action source-search --path core/src/action.ts
10
12
  * pnpm action source-search --path templates/plan/AGENTS.md
11
13
  * pnpm action source-search --list
12
14
  */
15
+ export interface SourceFile {
16
+ relativePath: string;
17
+ absolutePath: string;
18
+ visibilityRoot?: string;
19
+ }
13
20
  /**
14
21
  * The corpus is a sibling of the package root, so a bundled serverless deploy
15
22
  * never carries it. Callers register this tool conditionally: advertising a
@@ -17,5 +24,6 @@
17
24
  * and reads to it like the code genuinely does not exist.
18
25
  */
19
26
  export declare function hasSourceCorpus(): boolean;
27
+ export declare function listSourceFiles(): SourceFile[];
20
28
  export default function sourceSearchScript(args: string[]): Promise<void>;
21
29
  //# sourceMappingURL=source-search.d.ts.map