@agent-native/core 0.145.5 → 0.145.7

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 (393) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +18 -0
  3. package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  4. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +17 -1
  5. package/corpus/templates/analytics/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  6. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -0
  7. package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +22 -3
  8. package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +76 -23
  9. package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  10. package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  11. package/corpus/templates/analytics/AGENTS.md +2 -1
  12. package/corpus/templates/analytics/actions/account-deep-dive.ts +83 -47
  13. package/corpus/templates/analytics/actions/create-dashboard-folder.ts +27 -0
  14. package/corpus/templates/analytics/actions/gong-calls.ts +3 -3
  15. package/corpus/templates/analytics/actions/list-dashboard-folders.ts +26 -0
  16. package/corpus/templates/analytics/actions/list-sql-dashboards.ts +1 -0
  17. package/corpus/templates/analytics/actions/set-dashboard-folder.ts +26 -0
  18. package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +18 -3
  19. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +6 -4
  20. package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
  21. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +12 -2
  22. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +35 -20
  23. package/corpus/templates/analytics/app/global.css +17 -0
  24. package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +29 -15
  25. package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -3
  26. package/corpus/templates/analytics/app/i18n-data.ts +296 -0
  27. package/corpus/templates/analytics/app/lib/prefetch-keys.ts +23 -2
  28. package/corpus/templates/analytics/app/pages/DashboardOverview.tsx +642 -0
  29. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +66 -31
  30. package/corpus/templates/analytics/app/root.tsx +4 -0
  31. package/corpus/templates/analytics/app/routes/dashboards._index.tsx +5 -1
  32. package/corpus/templates/analytics/changelog/2026-08-07-added-a-dashboards-overview-with-personal-and-shared-folders.md +6 -0
  33. package/corpus/templates/analytics/changelog/2026-08-07-analytics-no-longer-stalls-under-bursts-of-event-ingest-key-.md +6 -0
  34. package/corpus/templates/analytics/changelog/2026-08-07-analytics-tracking-and-chat-startup-no-longer-emit-avoidable.md +6 -0
  35. package/corpus/templates/analytics/changelog/2026-08-07-dashboard-panels-now-load-custom-api-data-programs-reliably.md +6 -0
  36. package/corpus/templates/analytics/changelog/2026-08-07-gong-searches-conserve-api-quota-and-report-incomplete-coverage.md +6 -0
  37. package/corpus/templates/analytics/changelog/2026-08-07-searchable-dashboards-make-personal-and-shared-folders-easie.md +6 -0
  38. package/corpus/templates/analytics/netlify.toml +3 -0
  39. package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +112 -0
  40. package/corpus/templates/analytics/server/db/index.ts +12 -0
  41. package/corpus/templates/analytics/server/db/schema.ts +14 -0
  42. package/corpus/templates/analytics/server/jobs/analytics-rollup-backfill.ts +4 -0
  43. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +1 -0
  44. package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +85 -15
  45. package/corpus/templates/analytics/server/lib/dashboard-folders-store.ts +168 -0
  46. package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +9 -4
  47. package/corpus/templates/analytics/server/lib/dashboards-store.ts +116 -1
  48. package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +4 -8
  49. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +65 -10
  50. package/corpus/templates/analytics/server/lib/gong.ts +139 -78
  51. package/corpus/templates/analytics/server/lib/session-replay.ts +5 -5
  52. package/corpus/templates/analytics/server/plugins/db.ts +55 -15
  53. package/corpus/templates/analytics/server/plugins/session-replay-retention-jobs.ts +6 -2
  54. package/corpus/templates/analytics/server/routes/api/session-replay/retention.post.ts +65 -0
  55. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +18 -0
  56. package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  57. package/corpus/templates/assets/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  58. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -0
  59. package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +76 -23
  60. package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  61. package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  62. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +18 -0
  63. package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  64. package/corpus/templates/brain/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  65. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -0
  66. package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +76 -23
  67. package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  68. package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  69. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +18 -0
  70. package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  71. package/corpus/templates/calendar/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  72. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -0
  73. package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +76 -23
  74. package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  75. package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  76. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  77. package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  78. package/corpus/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  79. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  80. package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  81. package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  82. package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  83. package/corpus/templates/chat/.env.example +3 -0
  84. package/corpus/templates/chat/AGENTS.md +4 -0
  85. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +18 -0
  86. package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  87. package/corpus/templates/clips/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  88. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -0
  89. package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +76 -23
  90. package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  91. package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  92. package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +4 -0
  93. package/corpus/templates/clips/actions/request-transcript.ts +52 -3
  94. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -10
  95. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -0
  96. package/corpus/templates/clips/changelog/2026-08-07-screen-recordings-now-capture-tab-and-system-audio-even-when.md +6 -0
  97. package/corpus/templates/clips/changelog/2026-08-07-transcription-now-retries-transient-cloud-failures-automatic.md +6 -0
  98. package/corpus/templates/clips/server/db/schema.ts +7 -0
  99. package/corpus/templates/clips/server/plugins/db.ts +8 -0
  100. package/corpus/templates/clips/shared/recording-capture.ts +38 -0
  101. package/corpus/templates/clips/shared/transcript-failure.ts +89 -0
  102. package/corpus/templates/content/.agents/skills/actions/SKILL.md +18 -0
  103. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  104. package/corpus/templates/content/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  105. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -0
  106. package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +76 -23
  107. package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  108. package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  109. package/corpus/templates/content/.env.example +9 -3
  110. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -0
  111. package/corpus/templates/content/changelog/2026-08-07-collapsed-sidebar-utility-buttons-stay-anchored-at-the-botto.md +6 -0
  112. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  113. package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +76 -23
  114. package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  115. package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  116. package/corpus/templates/design/.agents/skills/actions/SKILL.md +18 -0
  117. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  118. package/corpus/templates/design/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  119. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -0
  120. package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +76 -23
  121. package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  122. package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  123. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +18 -0
  124. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  125. package/corpus/templates/dispatch/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  126. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -0
  127. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +76 -23
  128. package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  129. package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  130. package/corpus/templates/factory/.agents/skills/actions/SKILL.md +18 -0
  131. package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  132. package/corpus/templates/factory/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  133. package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +1 -0
  134. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +76 -23
  135. package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  136. package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  137. package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +279 -0
  138. package/corpus/templates/factory/actions/get-factory-automation-health.ts +23 -4
  139. package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +1 -1
  140. package/corpus/templates/factory/app/routes/factory.tsx +21 -3
  141. package/corpus/templates/factory/changelog/2026-08-07-factory-can-keep-builder-bot-pull-requests-moving-by-request.md +6 -0
  142. package/corpus/templates/factory/server/lib/require-factory-automation.ts +1 -0
  143. package/corpus/templates/factory/server/plugins/agent-chat.ts +4 -1
  144. package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +81 -12
  145. package/corpus/templates/factory/server/triage/github-client.ts +31 -0
  146. package/corpus/templates/factory/server/triage/pr-babysit.ts +75 -1
  147. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +18 -0
  148. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  149. package/corpus/templates/forms/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  150. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -0
  151. package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +76 -23
  152. package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  153. package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  154. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  155. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -0
  156. package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +76 -23
  157. package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  158. package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  159. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +18 -0
  160. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  161. package/corpus/templates/mail/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  162. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -0
  163. package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +76 -23
  164. package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  165. package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  166. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +18 -0
  167. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  168. package/corpus/templates/plan/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  169. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -0
  170. package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +76 -23
  171. package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  172. package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  173. package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -1
  174. package/corpus/templates/plan/changelog/2026-08-07-inline-help-icons-now-stay-visually-balanced-with-nearby-tex.md +6 -0
  175. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +18 -0
  176. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  177. package/corpus/templates/slides/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  178. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -0
  179. package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +76 -23
  180. package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  181. package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  182. package/corpus/templates/slides/.env.example +5 -0
  183. package/corpus/templates/slides/changelog/2026-08-07-fixed-generated-slides-briefly-disappearing-while-they-are-b.md +6 -0
  184. package/corpus/templates/slides/server/plugins/collab.ts +20 -8
  185. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +18 -0
  186. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  187. package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  188. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +1 -0
  189. package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +76 -23
  190. package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  191. package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  192. package/corpus/templates/tasks/.env.example +3 -0
  193. package/dist/agent/production-agent.js +24 -3
  194. package/dist/client/AgentPanel.d.ts +6 -0
  195. package/dist/client/AgentPanel.js +176 -30
  196. package/dist/client/AssistantChat.d.ts +2 -0
  197. package/dist/client/AssistantChat.js +4 -1
  198. package/dist/client/ConnectBuilderCard.js +6 -11
  199. package/dist/client/MultiTabAssistantChat.js +1 -1
  200. package/dist/client/RuntimeConfigNotice.d.ts +1 -0
  201. package/dist/client/RuntimeConfigNotice.js +94 -0
  202. package/dist/client/agent-chat/index.d.ts +1 -1
  203. package/dist/client/agent-chat/index.js +1 -1
  204. package/dist/client/agent-chat-adapter.js +85 -4
  205. package/dist/client/agent-page/AgentTabsPage.js +1 -1
  206. package/dist/client/agent-sidebar-state.d.ts +6 -0
  207. package/dist/client/agent-sidebar-state.js +25 -0
  208. package/dist/client/app-providers.js +2 -1
  209. package/dist/client/assistant-ui-recovery.js +1 -1
  210. package/dist/client/chat/index.d.ts +1 -1
  211. package/dist/client/chat/index.js +1 -1
  212. package/dist/client/chat/markdown-renderer.d.ts +2 -1
  213. package/dist/client/chat/markdown-renderer.js +48 -2
  214. package/dist/client/chat/message-components.d.ts +6 -0
  215. package/dist/client/chat/message-components.js +182 -53
  216. package/dist/client/chat/tool-call-display.d.ts +16 -4
  217. package/dist/client/chat/tool-call-display.js +225 -18
  218. package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
  219. package/dist/client/frame-protocol.d.ts +4 -0
  220. package/dist/client/i18n.js +9 -0
  221. package/dist/client/integrations/IntegrationsPanel.js +2 -5
  222. package/dist/client/onboarding/FirstRunOnboarding.js +2 -3
  223. package/dist/client/org/TeamPage.js +49 -6
  224. package/dist/client/org/hooks.d.ts +7 -2
  225. package/dist/client/org/hooks.js +11 -4
  226. package/dist/client/resources/McpConnectionSuggestion.js +2 -3
  227. package/dist/client/resources/McpIntegrationDialog.js +2 -16
  228. package/dist/client/resources/McpIntegrationLogo.d.ts +11 -0
  229. package/dist/client/resources/McpIntegrationLogo.js +14 -0
  230. package/dist/client/resources/ResourceTree.js +1 -1
  231. package/dist/client/resources/mcp-integration-logos.d.ts +1 -0
  232. package/dist/client/resources/mcp-integration-logos.js +47 -18
  233. package/dist/client/settings/useBuilderStatus.js +6 -0
  234. package/dist/client/ui/index.d.ts +1 -0
  235. package/dist/client/ui/index.js +1 -0
  236. package/dist/client/use-db-sync.js +4 -0
  237. package/dist/collab/struct-routes.d.ts +1 -1
  238. package/dist/config.d.ts +26 -3
  239. package/dist/config.js +106 -14
  240. package/dist/db/ddl-guard.d.ts +15 -2
  241. package/dist/db/ddl-guard.js +53 -5
  242. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  243. package/dist/jobs/scheduler.js +7 -0
  244. package/dist/localization/default-messages.d.ts +17 -0
  245. package/dist/localization/default-messages.js +17 -0
  246. package/dist/mcp/oauth-client-metadata.js +5 -1
  247. package/dist/mcp/oauth-route.d.ts +5 -4
  248. package/dist/mcp/oauth-route.js +25 -9
  249. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  250. package/dist/mcp/server.d.ts +1 -1
  251. package/dist/mcp/server.js +9 -10
  252. package/dist/notifications/routes.d.ts +2 -2
  253. package/dist/observability/routes.d.ts +3 -3
  254. package/dist/org/handlers.d.ts +1 -0
  255. package/dist/org/handlers.js +17 -2
  256. package/dist/provider-api/actions/custom-provider-registration.d.ts +5 -5
  257. package/dist/provider-api/actions/provider-api.d.ts +7 -7
  258. package/dist/provider-api/corpus-jobs.d.ts +12 -2
  259. package/dist/provider-api/corpus-jobs.js +31 -1
  260. package/dist/provider-api/index.d.ts +2 -0
  261. package/dist/provider-api/index.js +7 -1
  262. package/dist/secrets/routes.d.ts +3 -3
  263. package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +1 -1
  264. package/dist/server/agent-chat/recurring-jobs-runtime.js +14 -2
  265. package/dist/server/agent-chat/script-entries.js +12 -1
  266. package/dist/server/agent-chat-plugin.js +2 -2
  267. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  268. package/dist/server/auth.d.ts +1 -0
  269. package/dist/server/auth.js +85 -1
  270. package/dist/server/better-auth-instance.d.ts +9 -0
  271. package/dist/server/better-auth-instance.js +25 -11
  272. package/dist/server/core-routes-plugin.d.ts +7 -0
  273. package/dist/server/core-routes-plugin.js +51 -5
  274. package/dist/server/create-server.js +23 -2
  275. package/dist/server/db-pressure.d.ts +38 -0
  276. package/dist/server/db-pressure.js +147 -0
  277. package/dist/server/index.d.ts +1 -0
  278. package/dist/server/index.js +1 -0
  279. package/dist/server/legacy-auth-migration.d.ts +10 -0
  280. package/dist/server/legacy-auth-migration.js +37 -0
  281. package/dist/server/onboarding-html.js +206 -2
  282. package/dist/server/poll.d.ts +26 -0
  283. package/dist/server/poll.js +108 -13
  284. package/dist/server/ssr-handler.js +4 -1
  285. package/dist/server/transcribe-voice.d.ts +1 -1
  286. package/dist/shared/index.d.ts +1 -0
  287. package/dist/shared/index.js +1 -0
  288. package/dist/shared/runtime-config.d.ts +44 -0
  289. package/dist/shared/runtime-config.js +284 -0
  290. package/dist/styles/agent-native.css +48 -1
  291. package/dist/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  292. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  293. package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  294. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  295. package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  296. package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  297. package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  298. package/dist/templates/chat/.env.example +3 -0
  299. package/dist/templates/chat/AGENTS.md +4 -0
  300. package/dist/templates/default/.agents/skills/actions/SKILL.md +18 -0
  301. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  302. package/dist/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  303. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
  304. package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
  305. package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  306. package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  307. package/dist/templates/default/AGENTS.md +6 -1
  308. package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
  309. package/dist/templates/default/app/i18n/de-DE.ts +6 -0
  310. package/dist/templates/default/app/i18n/en-US.ts +6 -0
  311. package/dist/templates/default/app/i18n/es-ES.ts +6 -0
  312. package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
  313. package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
  314. package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
  315. package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
  316. package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
  317. package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
  318. package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
  319. package/dist/templates/headless/.agents/skills/actions/SKILL.md +18 -0
  320. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  321. package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
  322. package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  323. package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  324. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
  325. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  326. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  327. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
  328. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
  329. package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  330. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  331. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
  332. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
  333. package/dist/templates/workspace-core/AGENTS.md +7 -2
  334. package/dist/templates/workspace-root/AGENTS.md +5 -0
  335. package/dist/vite/client.d.ts +3 -3
  336. package/dist/vite/client.js +47 -1
  337. package/dist/vite/index.d.ts +1 -1
  338. package/docs/content/agent-native-config.mdx +240 -139
  339. package/docs/content/authentication.mdx +17 -0
  340. package/docs/content/deployment.mdx +19 -14
  341. package/docs/content/drop-in-agent.mdx +19 -2
  342. package/docs/content/environment-variables.mdx +63 -38
  343. package/docs/content/getting-started-actions.mdx +15 -6
  344. package/docs/content/getting-started-database.mdx +14 -10
  345. package/docs/content/getting-started-pages.mdx +32 -35
  346. package/docs/content/getting-started.mdx +7 -6
  347. package/package.json +1 -1
  348. package/src/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  349. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  350. package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  351. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  352. package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  353. package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  354. package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  355. package/src/templates/chat/.env.example +3 -0
  356. package/src/templates/chat/AGENTS.md +4 -0
  357. package/src/templates/default/.agents/skills/actions/SKILL.md +18 -0
  358. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  359. package/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  360. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
  361. package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
  362. package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  363. package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  364. package/src/templates/default/AGENTS.md +6 -1
  365. package/src/templates/default/app/i18n/ar-SA.ts +6 -0
  366. package/src/templates/default/app/i18n/de-DE.ts +6 -0
  367. package/src/templates/default/app/i18n/en-US.ts +6 -0
  368. package/src/templates/default/app/i18n/es-ES.ts +6 -0
  369. package/src/templates/default/app/i18n/fr-FR.ts +6 -0
  370. package/src/templates/default/app/i18n/hi-IN.ts +6 -0
  371. package/src/templates/default/app/i18n/ja-JP.ts +6 -0
  372. package/src/templates/default/app/i18n/ko-KR.ts +6 -0
  373. package/src/templates/default/app/i18n/pt-BR.ts +6 -0
  374. package/src/templates/default/app/i18n/zh-CN.ts +6 -0
  375. package/src/templates/default/app/i18n/zh-TW.ts +6 -0
  376. package/src/templates/headless/.agents/skills/actions/SKILL.md +18 -0
  377. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  378. package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
  379. package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  380. package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  381. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
  382. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  383. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  384. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
  385. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
  386. package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  387. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  388. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
  389. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
  390. package/src/templates/workspace-core/AGENTS.md +7 -2
  391. package/src/templates/workspace-root/AGENTS.md +5 -0
  392. package/corpus/templates/dispatch/app/routes/admin.apps.$appId.tsx +0 -1
  393. package/corpus/templates/dispatch/app/routes/admin.apps.tsx +0 -1
@@ -1,10 +1,10 @@
1
1
  ---
2
2
  name: turn-into-app
3
3
  description: >-
4
- Turn a proven thread, skill, or workflow into a runnable Agent-Native app
5
- with simple buttons, visible agent steps, preview, and deployment handoff.
6
- Use when a user invokes `/turn-into-app` or asks to make a workflow into an
7
- app.
4
+ Turn visible project context, a proven thread, skill, or workflow into a
5
+ runnable Agent-Native app with simple buttons, visible agent steps, preview,
6
+ and deployment handoff. Use when a user invokes `/turn-into-app` or asks to
7
+ make a workflow into an app.
8
8
  user-invocable: true
9
9
  scope: both
10
10
  metadata:
@@ -17,34 +17,72 @@ metadata:
17
17
 
18
18
  This is an end-to-end build skill, not a request for an app proposal.
19
19
 
20
- - With no argument, use the current thread as the source. This is the normal
21
- invocation at the end of a successful workflow.
20
+ - With no argument, choose the source in this order: visible project context,
21
+ then the current thread. A fresh Claude or ChatGPT Project is a valid source
22
+ on its first turn. Treat its visible project instructions, knowledge files,
23
+ and supplied past runs as the source; a completed thread is not required.
24
+ Treat the current turn as a request or configuration unless it contains a
25
+ concrete repeatable workflow.
22
26
  - With a named skill or local workflow, read that source and package it
23
27
  immediately, even at the beginning of a thread. For example,
24
28
  `/turn-into-app /some-skill` means “turn `/some-skill` into an app.”
25
29
  - With an attachment or path, read the supplied artifact as the source.
26
30
  - Do not ask the user to restate context that is already in the thread.
27
- - When invoked from an Agent-Native app, keep the current thread as the source
28
- and use the available workspace/coding-agent handoff when the current runtime
29
- cannot edit files. Do not claim the app exists without an actual path and
30
- verification result.
31
+ - When invoked from an Agent-Native app, use its visible project context first,
32
+ then the current thread, and use the available workspace/coding-agent
33
+ handoff when the current runtime cannot edit files. Do not claim the app
34
+ exists without an actual path and verification result.
31
35
 
32
36
  ## Source support
33
37
 
34
- Supported source paths today are the current Codex thread, a named skill, or a
35
- local workflow/transcript supplied as a path or attachment. An exported
36
- ChatGPT or Claude transcript can use the same local-file path today.
38
+ Supported source paths today are visible Claude or ChatGPT Project context, the
39
+ current Codex or host thread, a named skill, or a local workflow/transcript
40
+ supplied as a path or attachment. An exported ChatGPT or Claude transcript can
41
+ use the same local-file path today.
37
42
 
38
- ChatGPT shared-conversation import and Claude web conversation/project import
39
- are **coming soon**. Do not claim private web access, invent an importer, add
40
- fake OAuth, or scrape a logged-in page without an explicit supported adapter.
41
- If a user gives one of those URLs before an adapter exists, ask for an export or
42
- transcript instead and treat it as imported source material.
43
+ Claude and ChatGPT Project context is supported only when the host supplies it
44
+ to the model in the current context. The MCP connector does not read hidden
45
+ project chats, private URLs, account settings, or credentials. Do not claim
46
+ private web access, invent an importer, add fake OAuth, or scrape a logged-in
47
+ page. If the needed context is not visible, ask for an export, transcript, or
48
+ attachment and treat that artifact as imported source material.
43
49
 
44
50
  Deliver a fresh app in a new directory, implement the repeatable workflow with
45
51
  buttons and agent handoffs, start its dev server, verify the main path, and
46
52
  continue through build/deployment handoff. Do not stop at a plan.
47
53
 
54
+ ## Fresh project context mode
55
+
56
+ When the source is a fresh Claude or ChatGPT Project, build a short source brief
57
+ before creating the app. Read the host-provided context in this order:
58
+
59
+ 1. Project instructions and configuration: goal, audience, constraints, output
60
+ standards, approved tools, and integration expectations. Treat these as
61
+ product configuration, not as a transcript.
62
+ 2. Knowledge files and attachments: read the relevant files fully, preserve
63
+ their provenance, and reduce them to bounded references, IDs, URLs, or
64
+ summaries for the new app. Do not copy secrets or large raw payloads into
65
+ prompts or SQL.
66
+ 3. Past runs or examples that are actually visible in the context: select at
67
+ most 1-3 successful, representative runs. Extract repeatable decisions and
68
+ review criteria. Treat one-off answers and private data as examples, not as
69
+ product behavior. If no runs are supplied, proceed from the instructions
70
+ and knowledge files and say that examples were not available.
71
+ 4. The current turn: use it for the requested app boundary, target workspace,
72
+ naming, and any explicit corrections.
73
+
74
+ Record the brief with these headings before handoff: source and provenance,
75
+ project goal, configuration and constraints, knowledge sources, repeatable
76
+ workflow, inputs and outputs, judgment and review points, representative runs,
77
+ integrations and permissions, and unknowns. This is the compact contract for
78
+ the app. It keeps the new app useful without pretending that hidden Project
79
+ history was imported. See [the fresh Project reference](references/fresh-project.md)
80
+ for the host setup and brief template.
81
+
82
+ If the visible Project context has no concrete repeatable job, ask for one
83
+ focused clarification or a representative artifact. Do not fall back to a
84
+ generic “what app do you want to make?” builder.
85
+
48
86
  ## Source selection guard
49
87
 
50
88
  The generated app must implement the concrete workflow found in the source. It
@@ -151,6 +189,14 @@ pnpm exec agent-native add-app <slug> --template=chat
151
189
  Do not use `create` for an existing workspace; it scaffolds a new standalone
152
190
  workspace rather than adding an app to the current one.
153
191
 
192
+ When the source came from a fresh external Project and the target is a Builder
193
+ workspace, prefer the available Dispatch MCP workspace handoff after writing
194
+ the source brief. Call `start-workspace-app-creation` with a concise prompt,
195
+ the inferred app id, and the brief's repeatable workflow. Pass selected
196
+ workspace resource IDs when they are available, rather than pasting entire
197
+ knowledge files. Continue from the returned workspace path or Builder handoff
198
+ and report the actual verification result.
199
+
154
200
  Use a first-party template only when it materially fits the workflow. Keep the
155
201
  new app independent from the source thread's working tree unless the user
156
202
  explicitly asks to extend an existing app.
@@ -167,13 +213,20 @@ should make the repeated path obvious without hiding the agent's judgment:
167
213
  - Give each important repeated moment a clear button, such as “Analyze,”
168
214
  “Suggest options,” “Draft,” “Review,” or “Publish.” Use the source's actual
169
215
  vocabulary when it is clear.
170
- - Put deterministic reads, writes, approvals, and publishing in `actions/`
171
- with `defineAction`. The UI and agent must call the same action surface.
216
+ - Put deterministic reads, writes, approvals, provider fetches, and publishing
217
+ in focused `actions/` with `defineAction`. The UI and agent must call the
218
+ same action surface.
219
+ - If a workflow is framed as research, analysis, generation, recommendation,
220
+ or synthesis, start it in the AgentSidebar and let the agent orchestrate
221
+ those actions. Do not hide an AI-shaped multi-step workflow behind one
222
+ opaque action just because the implementation is deterministic.
172
223
  - Use application state for the current screen, selected item, and focused
173
224
  object so the agent can see where the user is.
174
- - Use `sendToAgentChat({ message, context, submit: true })` for intentional
175
- button-triggered agent work. Use `submit: false` when the user should review
176
- or edit the proposed prompt first.
225
+ - Use `sendToAgentChat({ message, context, submit: true, openSidebar: true })`
226
+ for intentional button-triggered agent work. Use `submit: false` when the
227
+ user should review or edit the proposed prompt in the AgentSidebar first.
228
+ Keep follow-up and revision prompts in that same thread; do not add a second
229
+ freeform textbox beside the result.
177
230
  - Pass IDs, URLs, and bounded summaries in context. Do not paste large provider
178
231
  dumps into prompts, call an LLM directly from the browser, or invent fake
179
232
  progress.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Turn Into App"
3
- short_description: "Turn a thread or skill into a runnable app"
4
- default_prompt: "Scan the current thread, turn the workflow into a new Agent-Native app with clear buttons, run it locally, verify it, and complete the deployment handoff."
3
+ short_description: "Turn project context or a workflow into a runnable app"
4
+ default_prompt: "Use the visible project context first, then any supplied workflow. Turn the instructions, knowledge files, and selected successful runs into a new Agent-Native app with clear buttons, run it locally, verify it, and complete the deployment handoff."
@@ -0,0 +1,64 @@
1
+ # Fresh Project source guide
2
+
3
+ Use this guide when `/turn-into-app` is invoked in a new Claude or ChatGPT
4
+ Project rather than after a completed thread.
5
+
6
+ ## What the host can provide
7
+
8
+ The source is whatever the host put in the model's current context:
9
+
10
+ - Project instructions: the job, audience, constraints, quality bar, and
11
+ approved tools or integrations.
12
+ - Knowledge files and attachments: reference material, templates, examples,
13
+ and links that the app should use.
14
+ - Past runs: only conversations or outputs the host actually supplied. They
15
+ are examples and evaluation material, not an automatic import of every
16
+ private Project conversation.
17
+ - The current request: the app boundary, target workspace, name, and explicit
18
+ corrections.
19
+
20
+ Do not infer hidden system prompts, account settings, private history, API keys,
21
+ or credentials. The Dispatch MCP connector can start a workspace app creation,
22
+ but it cannot unlock or scrape private Project content.
23
+
24
+ ## Source brief
25
+
26
+ Write a compact brief before starting the app:
27
+
28
+ ```text
29
+ Source: host-provided Claude/ChatGPT Project context
30
+ Provenance: project instructions, selected knowledge files, and visible runs
31
+ Project goal:
32
+ Configuration and constraints:
33
+ Knowledge sources:
34
+ Repeatable workflow:
35
+ Inputs and outputs:
36
+ Judgment and review points:
37
+ Representative runs: none, or 1-3 selected examples
38
+ Integrations and permissions:
39
+ Unknowns and follow-up:
40
+ ```
41
+
42
+ Keep source references bounded. Prefer a file name, URL, resource ID, or short
43
+ summary over a large pasted document. Do not put secrets or raw customer data
44
+ in the brief.
45
+
46
+ ## Fresh-box setup
47
+
48
+ Install the exported `turn-into-app` skill in the host when the host supports
49
+ skills. For a ChatGPT Project or any host that exposes only the MCP connector,
50
+ also place the skill instructions or this reference in the Project
51
+ instructions/knowledge files. Then add and authenticate the Dispatch MCP
52
+ connector from the packaged `adapters/chatgpt-mcp/connector.json`.
53
+
54
+ In a new Project chat, say:
55
+
56
+ ```text
57
+ Turn this project into an app. Use the visible Project instructions,
58
+ knowledge files, and any selected successful runs as the source. Create the
59
+ app in the connected Agent-Native workspace, keep the source brief bounded,
60
+ and report the real path and verification result.
61
+ ```
62
+
63
+ If the host does not show the Project instructions or files to the model, stop
64
+ and request an export or attachment. Do not claim that the Project was read.
@@ -15,6 +15,10 @@ const requireFromThisFile = createRequire(import.meta.url);
15
15
  let cachedFfmpegStaticPath: string | null | undefined;
16
16
 
17
17
  export type AudioOnlyExtractionErrorCode =
18
+ // The stored recording has no audio stream at all — a measurement of the
19
+ // file, distinct from "we looked and found no speech". Kept separate so the
20
+ // message can say so instead of blaming the recording.
21
+ | "NO_AUDIO_SAVED"
18
22
  | "NO_AUDIO_TRACK"
19
23
  | "NO_SPEECH_DETECTED"
20
24
  | "FFMPEG_UNAVAILABLE"
@@ -54,6 +54,11 @@ import {
54
54
  } from "../server/lib/recordings.js";
55
55
  import { isBuilderCreditsExhaustedMessage } from "../shared/builder-credits.js";
56
56
  import { normalizeLoomShareUrl } from "../shared/loom.js";
57
+ import {
58
+ isRetryableTranscriptFailure,
59
+ transcriptFailureMessage,
60
+ type TranscriptFailureCode,
61
+ } from "../shared/transcript-failure.js";
57
62
  import {
58
63
  buildCaptionSegmentsFromText,
59
64
  normalizeTranscriptSegments,
@@ -221,6 +226,13 @@ export function recordingMediaFetchTimeoutMs(
221
226
  const MAX_AUTO_TRANSCRIPT_RETRIES = 2;
222
227
  const AUTO_TRANSCRIPT_RETRY_BACKOFF_MS = [5_000, 20_000];
223
228
 
229
+ /** The typed code an error already carries, if any. */
230
+ function transcriptFailureCodeFor(err: unknown): TranscriptFailureCode | null {
231
+ return err instanceof AudioOnlyExtractionError
232
+ ? (err.code as TranscriptFailureCode)
233
+ : null;
234
+ }
235
+
224
236
  function isTransientTranscriptionError(err: unknown): boolean {
225
237
  if (isTransientExtractionError(err)) return true;
226
238
  if (err instanceof Error) {
@@ -641,7 +653,13 @@ async function failAudioOnlyPreparation({
641
653
  });
642
654
  if (preserved) return preserved;
643
655
 
644
- const transient = isTransientTranscriptionError(err);
656
+ // The code decides retryability. `isTransientTranscriptionError` stays as the
657
+ // fallback for errors that carry no code yet — it reads regexes over prose,
658
+ // which is why a reworded message could once change whether a clip retried.
659
+ const failureCode = transcriptFailureCodeFor(err);
660
+ const transient = failureCode
661
+ ? isRetryableTranscriptFailure(failureCode)
662
+ : isTransientTranscriptionError(err);
645
663
  const nextRetryCount = currentRetryCount + 1;
646
664
 
647
665
  await upsertTranscriptRow(db, {
@@ -649,6 +667,7 @@ async function failAudioOnlyPreparation({
649
667
  ownerEmail,
650
668
  status: "failed",
651
669
  failureReason: reason,
670
+ failureCode: failureCode ?? "UNKNOWN",
652
671
  segmentsJson: "[]",
653
672
  fullText: "",
654
673
  now,
@@ -1136,9 +1155,12 @@ const requestTranscriptAction = defineAction({
1136
1155
  const videoUrl = rec.videoUrl;
1137
1156
  if (!videoUrl) throw new Error("Recording has no videoUrl");
1138
1157
  if (rec.hasAudio === false) {
1158
+ // NOT "no speech was detected" — this is a measurement of the stored
1159
+ // file, and blaming the recording sent people hunting for a microphone
1160
+ // problem when the screen-share simply never included audio.
1139
1161
  throw new AudioOnlyExtractionError(
1140
- "NO_AUDIO_TRACK",
1141
- "No speech was detected because this recording was saved without audio.",
1162
+ "NO_AUDIO_SAVED",
1163
+ transcriptFailureMessage("NO_AUDIO_SAVED"),
1142
1164
  );
1143
1165
  }
1144
1166
  audioMediaPromise ??= (async () => {
@@ -1464,14 +1486,33 @@ const requestTranscriptAction = defineAction({
1464
1486
  const reason = builderError
1465
1487
  ? "No native transcript was captured, and Builder transcription could not finish. Retry transcription or check Builder connection and recording audio."
1466
1488
  : "No transcript was captured by native speech recognition, and Builder transcription is not configured.";
1489
+ // A cloud failure gets the SAME transient-retry treatment the audio-only
1490
+ // path already has (see `failAudioOnlyPreparation`). This branch classified
1491
+ // the error, logged it, and then fell through with no retry scheduled and
1492
+ // no `retryCount` written — so the one path users report as "it works if I
1493
+ // retry" was the one path that never retried itself. Production bears that
1494
+ // out: `retry_count` averages 0.0 on these rows, while 12 of them say
1495
+ // `fetch failed` and 11 say `timed out after 45` — textbook transient.
1496
+ const cloudTransient = builderError
1497
+ ? isTransientTranscriptionError(new Error(builderError))
1498
+ : false;
1499
+ const cloudNextRetryCount = currentRetryCount + 1;
1467
1500
  await upsertTranscriptRow(db, {
1468
1501
  recordingId: args.recordingId,
1469
1502
  ownerEmail,
1470
1503
  status: "failed",
1471
1504
  failureReason: reason,
1505
+ failureCode: builderError ? "CLOUD_FAILED" : "CLOUD_UNCONFIGURED",
1472
1506
  now,
1507
+ ...(cloudTransient ? { retryCount: cloudNextRetryCount } : {}),
1473
1508
  });
1474
1509
  await writeAppState("refresh-signal", { ts: Date.now() });
1510
+ if (cloudTransient) {
1511
+ scheduleAutoTranscriptRetry({
1512
+ recordingId: args.recordingId,
1513
+ nextRetryCount: cloudNextRetryCount,
1514
+ });
1515
+ }
1475
1516
  console.warn(`[clips] ${reason}`);
1476
1517
  return {
1477
1518
  recordingId: args.recordingId,
@@ -1488,6 +1529,11 @@ async function upsertTranscriptRow(
1488
1529
  ownerEmail: string;
1489
1530
  status: "pending" | "ready" | "failed";
1490
1531
  failureReason: string | null;
1532
+ /**
1533
+ * Machine-readable cause. This is what decides retryability; the prose in
1534
+ * `failureReason` is rendered from it and is for humans only.
1535
+ */
1536
+ failureCode?: TranscriptFailureCode | null;
1491
1537
  language?: string;
1492
1538
  segmentsJson?: string;
1493
1539
  fullText?: string;
@@ -1523,6 +1569,8 @@ async function upsertTranscriptRow(
1523
1569
  ownerEmail: row.ownerEmail,
1524
1570
  status: row.status,
1525
1571
  failureReason: row.failureReason,
1572
+ // Cleared on success so a recovered row does not keep a stale cause.
1573
+ failureCode: row.status === "failed" ? (row.failureCode ?? null) : null,
1526
1574
  ...(row.language ? { language: row.language } : {}),
1527
1575
  ...(row.segmentsJson ? { segmentsJson: row.segmentsJson } : {}),
1528
1576
  ...(row.fullText !== undefined ? { fullText: row.fullText } : {}),
@@ -1539,6 +1587,7 @@ async function upsertTranscriptRow(
1539
1587
  fullText: row.fullText ?? "",
1540
1588
  status: row.status,
1541
1589
  failureReason: row.failureReason,
1590
+ failureCode: row.status === "failed" ? (row.failureCode ?? null) : null,
1542
1591
  retryCount: retryCount ?? 0,
1543
1592
  createdAt: row.now,
1544
1593
  updatedAt,
@@ -10,6 +10,7 @@ import {
10
10
  } from "@shared/media-device-selection";
11
11
  import {
12
12
  SCREEN_CAPTURE_FRAME_RATE,
13
+ screenCaptureDisplayOptions,
13
14
  screenCaptureVideoConstraints,
14
15
  } from "@shared/recording-capture";
15
16
  import {
@@ -888,16 +889,8 @@ export class RecorderEngine {
888
889
  const displaySurface = normalizeDisplaySurfaceForRuntime(
889
890
  this.opts.displaySurface ?? "window",
890
891
  );
891
- const displayOptions: ExtendedDisplayMediaOptions = {
892
- video: screenCaptureVideoConstraints(displaySurface),
893
- audio: wantsMic,
894
- // Let "Browser tab" open the tab picker. preferCurrentTab turns it
895
- // into a current-tab shortcut, which makes choosing another tab harder.
896
- selfBrowserSurface:
897
- displaySurface === "browser" ? "include" : "exclude",
898
- surfaceSwitching: "include",
899
- systemAudio: wantsMic ? "include" : "exclude",
900
- };
892
+ const displayOptions: ExtendedDisplayMediaOptions =
893
+ screenCaptureDisplayOptions(displaySurface);
901
894
 
902
895
  if (wantsMic || wantsDisplay) {
903
896
  this.audioMixCtx?.close().catch(() => {});
@@ -1473,6 +1473,7 @@ export default function RecordingPage() {
1473
1473
  >
1474
1474
  <span>{t(item.labelKey)}</span>
1475
1475
  {item.tooltipKey ? (
1476
+ // guard:allow-large-help-icon - menu item tooltip icon
1476
1477
  <IconHelpCircle
1477
1478
  aria-hidden="true"
1478
1479
  className="h-3.5 w-3.5 shrink-0 text-muted-foreground/70"
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-08-07
4
+ ---
5
+
6
+ Screen recordings now capture tab and system audio even when the microphone is off, so transcripts are generated instead of failing with a misleading no-speech message.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-08-07
4
+ ---
5
+
6
+ Transcription now retries transient cloud failures automatically, and failure messages say what actually went wrong instead of blaming the recording.
@@ -246,6 +246,13 @@ export const recordingTranscripts = table("recording_transcripts", {
246
246
  .notNull()
247
247
  .default("pending"),
248
248
  failureReason: text("failure_reason"),
249
+ // The MACHINE-READABLE reason, and the one that decides retryability — see
250
+ // shared/transcript-failure.ts. `failureReason` above is prose rendered from
251
+ // this and is for humans only; production accumulated 39 distinct strings
252
+ // for what turned out to be a handful of conditions, and retryability was
253
+ // being re-derived by regex over that prose. Nullable for rows written
254
+ // before this column existed.
255
+ failureCode: text("failure_code"),
249
256
  // Count of automatic retries already attempted after a transient failure
250
257
  // (ffmpeg timeout, transient provider/network error). Bounds the
251
258
  // fire-and-forget auto-retry pass in request-transcript.ts so a repeatedly
@@ -1146,6 +1146,14 @@ const migrations = runMigrations(
1146
1146
  expires_at INTEGER NOT NULL
1147
1147
  )`,
1148
1148
  },
1149
+ {
1150
+ version: 64,
1151
+ name: "recording-transcripts-failure-code",
1152
+ // Additive. Existing rows keep failure_code NULL and their prose; new
1153
+ // failures record a code that owns retryability instead of having it
1154
+ // re-derived by regex over the message.
1155
+ sql: `ALTER TABLE recording_transcripts ADD COLUMN failure_code TEXT`,
1156
+ },
1149
1157
  ],
1150
1158
  { table: "clips_migrations" },
1151
1159
  );
@@ -35,3 +35,41 @@ export function screenCaptureVideoConstraints(
35
35
  displaySurface,
36
36
  };
37
37
  }
38
+
39
+ export type ScreenCaptureDisplayOptions = {
40
+ video: ScreenCaptureVideoConstraints;
41
+ audio: boolean;
42
+ selfBrowserSurface: "include" | "exclude";
43
+ surfaceSwitching: "include" | "exclude";
44
+ systemAudio: "include" | "exclude";
45
+ };
46
+
47
+ /**
48
+ * The `getDisplayMedia` options for a screen recording.
49
+ *
50
+ * Screen/tab audio is requested ALWAYS, and deliberately does not depend on
51
+ * whether the microphone is on. They are two different sources, and one toggle
52
+ * used to govern both: with the mic off, Chrome was never even offered the
53
+ * "share tab audio" checkbox, so a screen recording of a call or a demo
54
+ * captured zero audio tracks. Measured in production, 345 recordings landed
55
+ * with `has_audio = false` — 95 over a minute, 17 over five — and each was told
56
+ * "No speech was detected because this recording was saved without audio",
57
+ * blaming the recording for a capture setting. That was 64% of recent
58
+ * transcript failures. The Chrome extension always requested display audio and
59
+ * never had the problem.
60
+ *
61
+ * Declining the checkbox is still respected; the user simply gets the choice.
62
+ */
63
+ export function screenCaptureDisplayOptions(
64
+ displaySurface: ScreenCaptureSurface,
65
+ ): ScreenCaptureDisplayOptions {
66
+ return {
67
+ video: screenCaptureVideoConstraints(displaySurface),
68
+ audio: true,
69
+ // Let "Browser tab" open the tab picker. preferCurrentTab turns it into a
70
+ // current-tab shortcut, which makes choosing another tab harder.
71
+ selfBrowserSurface: displaySurface === "browser" ? "include" : "exclude",
72
+ surfaceSwitching: "include",
73
+ systemAudio: "include",
74
+ };
75
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * One vocabulary for why a transcript did not happen.
3
+ *
4
+ * Production accumulated **39 distinct `failure_reason` strings** across 1100
5
+ * failed rows, introduced on five separate dates across four files and three
6
+ * capture surfaces. No commit ever owned the terminal-failure vocabulary, so
7
+ * every fix added its own sentence. Two of those strings were the same
8
+ * condition renamed ("backup transcription" → "Builder transcription"), which
9
+ * silently forked every downstream count.
10
+ *
11
+ * Worse, a typed code already existed (`AudioOnlyExtractionErrorCode`), was
12
+ * thrown, and was discarded at the persistence boundary — after which
13
+ * retryability was re-derived by running regexes over the English prose. A
14
+ * message reworded for clarity could therefore change whether a transcript
15
+ * retried.
16
+ *
17
+ * So: the CODE is the record, prose is rendered from it, and retryability is a
18
+ * property of the code. Adding a failure mode means adding one entry here, not
19
+ * a new sentence at a call site.
20
+ */
21
+
22
+ /** Why a transcript ended in `failed`. Persisted; do not renumber or reword. */
23
+ export type TranscriptFailureCode =
24
+ // --- audio extraction (mirrors AudioOnlyExtractionErrorCode) ---
25
+ | "NO_AUDIO_TRACK"
26
+ | "NO_SPEECH_DETECTED"
27
+ | "FFMPEG_UNAVAILABLE"
28
+ | "EXTRACTION_FAILED"
29
+ | "TIMEOUT"
30
+ // --- transcript level ---
31
+ /** The recording itself was saved with no audio stream at all. */
32
+ | "NO_AUDIO_SAVED"
33
+ /** Cloud transcription was attempted and threw. */
34
+ | "CLOUD_FAILED"
35
+ /** No cloud provider is connected for this owner. */
36
+ | "CLOUD_UNCONFIGURED"
37
+ /** Anything not yet classified. Prose is preserved; never retried blindly. */
38
+ | "UNKNOWN";
39
+
40
+ /**
41
+ * Codes worth retrying automatically.
42
+ *
43
+ * Retrying anything else wastes a media fetch and an ffmpeg run to reach the
44
+ * same answer — `NO_AUDIO_SAVED` in particular is a measurement of the stored
45
+ * file, so no number of retries will find audio that was never captured.
46
+ */
47
+ const RETRYABLE: ReadonlySet<TranscriptFailureCode> = new Set([
48
+ "TIMEOUT",
49
+ "EXTRACTION_FAILED",
50
+ "CLOUD_FAILED",
51
+ ]);
52
+
53
+ export function isRetryableTranscriptFailure(
54
+ code: TranscriptFailureCode | null | undefined,
55
+ ): boolean {
56
+ return code != null && RETRYABLE.has(code);
57
+ }
58
+
59
+ /**
60
+ * The sentence shown to a person, derived from the code.
61
+ *
62
+ * Each says what happened and what the reader can do about it. None of them
63
+ * blames the recording for a capture setting — "no speech was detected" on a
64
+ * recording saved without audio was the single most common transcript failure
65
+ * in production, and it sent people looking for a microphone problem when the
66
+ * screen-share simply never included audio.
67
+ */
68
+ export function transcriptFailureMessage(code: TranscriptFailureCode): string {
69
+ switch (code) {
70
+ case "NO_AUDIO_SAVED":
71
+ return "This recording has no audio track, so there was nothing to transcribe. Screen recordings only capture audio when you share tab or system audio, or record with a microphone.";
72
+ case "NO_AUDIO_TRACK":
73
+ return "The saved media has no audio stream, so there was nothing to transcribe.";
74
+ case "NO_SPEECH_DETECTED":
75
+ return "Audio was captured but no speech was found in it.";
76
+ case "FFMPEG_UNAVAILABLE":
77
+ return "Audio could not be prepared for transcription because ffmpeg is unavailable on the server.";
78
+ case "EXTRACTION_FAILED":
79
+ return "Audio could not be prepared for transcription. Retrying usually works.";
80
+ case "TIMEOUT":
81
+ return "Transcription timed out before it finished. Retrying usually works.";
82
+ case "CLOUD_FAILED":
83
+ return "No transcript was captured locally, and cloud transcription could not finish. Retrying usually works; if it persists, check the recording's audio and the Builder connection.";
84
+ case "CLOUD_UNCONFIGURED":
85
+ return "No transcript was captured locally, and no cloud transcription provider is connected. Connect Builder in Settings to transcribe automatically.";
86
+ case "UNKNOWN":
87
+ return "Transcription did not finish.";
88
+ }
89
+ }
@@ -20,6 +20,24 @@ Before creating any custom REST/API route for app data, inspect `actions/` and t
20
20
 
21
21
  **Stop trigger:** the moment you are about to create a file under `server/routes/api/` — or add server middleware to guard one — stop and check it against the exception list in *When You Still Need Custom `/api/` Routes* below. If it is not on that list, write a `defineAction` instead. This applies even when you already started the route; abandoning a half-written action to hand-roll routes is the exact failure this rule exists to prevent.
22
22
 
23
+ ## Keep actions deterministic and composable
24
+
25
+ An action may call a provider API, validate or normalize data, and persist
26
+ records without being an AI feature. Keep those operations deterministic,
27
+ focused, and independently useful to the agent. Do not put LLM calls or a
28
+ second model runtime in ordinary actions. The only narrow exception is the
29
+ `completeText()` text-in/text-out escape hatch described in
30
+ `delegate-to-agent`; it must not own tools, chat history, run state, side
31
+ effects, or user steering.
32
+
33
+ When a workflow is framed as research, analysis, generation, recommendation,
34
+ or synthesis, or spans several provider calls and writes, route the user into
35
+ the AgentSidebar and let the agent orchestrate focused actions. Do not hide an
36
+ AI-shaped workflow behind one opaque `generate-*` or `create-*` action just
37
+ because its implementation is deterministic. A visible user-initiated run
38
+ should use `sendToAgentChat({ openSidebar: true })`, and its follow-ups should
39
+ continue in the same thread rather than a separate freeform input.
40
+
23
41
  ## Why
24
42
 
25
43
  Actions give the agent callable tools with structured input/output, AND they give the frontend a typed client contract through hooks. One implementation serves both the agent and the UI. They keep the agent's chat context clean, they're reusable, and they can be tested independently.
@@ -56,6 +56,11 @@ The repeated app shell has two distinct navigation surfaces:
56
56
  labeled as local, preview, or analyze. For original/generated review, stack
57
57
  the source above the result by default and use side-by-side only for short,
58
58
  highly scannable content.
59
+ - Deterministic implementation does not make an AI-shaped experience
60
+ deterministic. If the user expects research, analysis, generation,
61
+ recommendation, synthesis, visible progress, or steering, route the button
62
+ to the AgentSidebar and let the agent call focused actions. Keep revisions in
63
+ the same thread instead of adding a second freeform prompt box.
59
64
  - Standalone apps with `AgentSidebar` must resolve one assistant-ui runtime
60
65
  context. Match direct assistant-ui pins to the installed core/toolkit peer
61
66
  graph, use Vite dedupe/aliases when linked dependencies can split contexts,