@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
@@ -14,12 +14,12 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel,
14
14
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../components/ui/tooltip.js";
15
15
  import { ThumbsFeedback } from "../observability/ThumbsFeedback.js";
16
16
  import { McpConnectionSuggestion } from "../resources/McpConnectionSuggestion.js";
17
- import { isCallAgentToolCallShadowed, shadowedCallAgentToolCallIds, } from "../tool-display.js";
17
+ import { humanizeToolName, isCallAgentToolCallShadowed, shadowedCallAgentToolCallIds, } from "../tool-display.js";
18
18
  import { cn } from "../utils.js";
19
- import { MarkdownText, renderMarkdownToClipboardHtml, } from "./markdown-renderer.js";
19
+ import { MarkdownText, renderMarkdownToClipboardHtml, SmoothMarkdownText, } from "./markdown-renderer.js";
20
20
  import { getAssistantRunDurationMs } from "./repo-helpers.js";
21
21
  import { getRunErrorMetadata, runErrorHeadline, runErrorKey, } from "./run-recovery.js";
22
- import { ToolCallFallback, ToolActivityPresentation, FilesChangedSummary, ASSISTANT_VISIBLE_TOOL_CALL_LIMIT, ChatRunningContext, ChatRunDurationContext, formatWorkedDuration, RanToolsSummary, ReasoningCell, WorkedForSummary, toolCallHasPendingApproval, } from "./tool-call-display.js";
22
+ import { ToolCallFallback, ToolActivityPresentation, ToolCallStackMotion, FilesChangedSummary, ASSISTANT_VISIBLE_TOOL_CALL_LIMIT, ChatRunningContext, ChatRunDurationContext, formatWorkedDuration, RanToolsSummary, ReasoningCell, WorkedForSummary, toolCallHasPendingApproval, } from "./tool-call-display.js";
23
23
  export { toolCallHasPendingApproval };
24
24
  // ─── Pending selection context key ───────────────────────────────────────────
25
25
  // Mirrored from AssistantChat to avoid a cross-import on a private constant.
@@ -438,6 +438,72 @@ export function messageTextFromContent(content) {
438
438
  })
439
439
  .join("\n");
440
440
  }
441
+ export function isMissingFinalResponseWarningText(text) {
442
+ const normalized = text.trim();
443
+ if (normalized ===
444
+ "The agent stopped without sending a final message. Ask the agent to continue or retry.") {
445
+ return true;
446
+ }
447
+ return (normalized.includes("stopped before sending a final message") ||
448
+ normalized.includes("stopped without sending a final message"));
449
+ }
450
+ function finalResponseTextFromContent(content) {
451
+ if (typeof content === "string")
452
+ return content;
453
+ if (!Array.isArray(content))
454
+ return "";
455
+ return content
456
+ .flatMap((part) => {
457
+ if (!part || typeof part !== "object")
458
+ return [];
459
+ const record = part;
460
+ if (record.type !== "text" ||
461
+ typeof record.text !== "string" ||
462
+ isMissingFinalResponseWarningText(record.text)) {
463
+ return [];
464
+ }
465
+ return [record.text];
466
+ })
467
+ .join("\n");
468
+ }
469
+ function missingFinalResponseWarningText(content) {
470
+ if (!Array.isArray(content))
471
+ return null;
472
+ for (let index = content.length - 1; index >= 0; index -= 1) {
473
+ const part = content[index];
474
+ if (part &&
475
+ typeof part === "object" &&
476
+ part.type === "text" &&
477
+ typeof part.text === "string" &&
478
+ isMissingFinalResponseWarningText(part.text)) {
479
+ return part.text;
480
+ }
481
+ }
482
+ return null;
483
+ }
484
+ export function completedAssistantToolNamesAfterLastText(content) {
485
+ let lastTextIndex = -1;
486
+ for (let index = content.length - 1; index >= 0; index -= 1) {
487
+ if (content[index]?.type === "text") {
488
+ lastTextIndex = index;
489
+ break;
490
+ }
491
+ }
492
+ const names = new Set();
493
+ for (let index = lastTextIndex + 1; index < content.length; index += 1) {
494
+ const part = content[index];
495
+ if (part?.type !== "tool-call" ||
496
+ part.activity === true ||
497
+ part.result === undefined ||
498
+ part.isError === true ||
499
+ part.outcome === "unknown" ||
500
+ isCallAgentToolCallShadowed(content, index)) {
501
+ continue;
502
+ }
503
+ names.add(humanizeToolName(part.toolName));
504
+ }
505
+ return [...names];
506
+ }
441
507
  export function latestUserMessageText(messages) {
442
508
  for (let index = messages.length - 1; index >= 0; index -= 1) {
443
509
  const message = messages[index];
@@ -507,7 +573,8 @@ export function assistantMessageHasCompletedCustomUi(content) {
507
573
  }
508
574
  hasCompletedTool = true;
509
575
  lastCompletedToolIsCustomUi =
510
- record.chatUI !== undefined ||
576
+ isAlwaysVisibleAssistantTool(record) ||
577
+ record.chatUI !== undefined ||
511
578
  record.mcpApp !== undefined ||
512
579
  toolCallHasPendingApproval(record);
513
580
  }
@@ -521,7 +588,8 @@ export function assistantMessageHasCustomUi(content) {
521
588
  return false;
522
589
  const record = part;
523
590
  return (record.type === "tool-call" &&
524
- (record.chatUI !== undefined ||
591
+ (isAlwaysVisibleAssistantTool(record) ||
592
+ record.chatUI !== undefined ||
525
593
  record.mcpApp !== undefined ||
526
594
  toolCallHasPendingApproval(record)));
527
595
  });
@@ -573,7 +641,7 @@ export function shouldShowMissingFinalResponse({ isCurrentTurnRunning, serverRun
573
641
  * still alive server-side. Requiring the shape to hold for a beat keeps the
574
642
  * notice off the screen for those gaps without hiding a real stop for long.
575
643
  */
576
- const MISSING_FINAL_RESPONSE_SETTLE_MS = 3_000;
644
+ const MISSING_FINAL_RESPONSE_SETTLE_MS = 250;
577
645
  export function useSettledFlag(active, delayMs) {
578
646
  const [settled, setSettled] = useState(false);
579
647
  useEffect(() => {
@@ -627,11 +695,16 @@ function ReasoningMessagePart() {
627
695
  return (_jsx(ReasoningCell, { text: part.text, isStreaming: isStreaming, resetKey: `message-reasoning-${partIndex}`, durationMs: durationMs, defaultOpen: partIndex === latestReasoningPartIndex, collapseWhenReplaced: partIndex < latestReasoningPartIndex }));
628
696
  }
629
697
  const ALWAYS_VISIBLE_ASSISTANT_TOOLS = new Set(["connect-builder"]);
698
+ export function isAlwaysVisibleAssistantTool(part) {
699
+ return (part.type === "tool-call" &&
700
+ typeof part.toolName === "string" &&
701
+ ALWAYS_VISIBLE_ASSISTANT_TOOLS.has(part.toolName));
702
+ }
630
703
  export function isCollapsibleAssistantWorkPart(part) {
631
704
  if (part.type === "reasoning")
632
705
  return true;
633
706
  return (part.type === "tool-call" &&
634
- !ALWAYS_VISIBLE_ASSISTANT_TOOLS.has(part.toolName ?? "") &&
707
+ !isAlwaysVisibleAssistantTool(part) &&
635
708
  part.chatUI === undefined &&
636
709
  part.mcpApp === undefined &&
637
710
  // Keep the Approve/Deny affordance outside "Worked for…" - needsApproval
@@ -705,6 +778,14 @@ export function InlineRunErrorNotice({ info, durationMs, onRetry, }) {
705
778
  : headline;
706
779
  return (_jsxs("div", { className: "my-1 w-full", children: [_jsxs("button", { type: "button", onClick: () => setOpen((v) => !v), "aria-expanded": open, className: "flex cursor-pointer items-center gap-1.5 py-0.5 text-[13px] text-muted-foreground transition-colors hover:text-foreground", children: [_jsx(IconAlertTriangle, { className: "size-3.5 shrink-0 text-amber-500" }), _jsx("span", { className: "truncate", children: label }), _jsx(IconChevronRight, { className: cn("size-3.5 shrink-0 transition-transform", open && "rotate-90") })] }), open && (_jsxs("div", { className: "mt-1 rounded-md border border-border/60 bg-background/70 p-2 text-[11px] leading-relaxed text-muted-foreground", children: [_jsx("p", { className: "whitespace-pre-wrap break-words", children: info.message }), info.errorCode && (_jsxs("div", { className: "mt-1 font-mono", children: ["code: ", info.errorCode] })), info.runId && _jsxs("div", { className: "font-mono", children: ["run: ", info.runId] }), info.details && (_jsx("pre", { className: "mt-1 max-h-28 overflow-auto whitespace-pre-wrap break-words font-mono", children: info.details })), onRetry && (_jsxs("button", { type: "button", onClick: onRetry, className: "mt-2 inline-flex h-7 cursor-pointer items-center gap-1.5 rounded-md border border-border bg-background px-2.5 text-[11px] font-medium text-foreground hover:bg-accent", children: [_jsx(IconRefresh, { className: "size-3" }), "Retry"] }))] }))] }));
707
780
  }
781
+ function AssistantCompletionProgress({ messageId, toolNames, }) {
782
+ if (toolNames.length === 0)
783
+ return null;
784
+ return (_jsx("div", { className: "my-1 w-full text-[13px] text-muted-foreground", role: "status", "aria-live": "polite", "data-testid": "assistant-completion-progress", children: _jsx(SmoothMarkdownText, { text: `The agent completed these actions: ${toolNames.join(", ")}`, streaming: true, resetKey: `assistant-completion-progress:${messageId}`, statusType: "running" }) }));
785
+ }
786
+ function MissingFinalResponseNotice({ messageId, text, animate, onRevealComplete, }) {
787
+ return (_jsx("div", { className: "my-1 w-full text-muted-foreground", role: "status", "aria-live": "polite", "data-testid": "missing-final-response", children: _jsx(SmoothMarkdownText, { text: text, streaming: animate, resetKey: `missing-final-response:${messageId}`, statusType: animate ? "running" : "complete", onRevealComplete: animate ? onRevealComplete : undefined }) }));
788
+ }
708
789
  export function AssistantMessage() {
709
790
  const [restoreState, setRestoreState] = useState("idle");
710
791
  const [restoreError, setRestoreError] = useState(null);
@@ -717,9 +798,11 @@ export function AssistantMessage() {
717
798
  const timestamp = formatMessageTimestamp(msg.createdAt);
718
799
  const isLast = thread.messages.length > 0 &&
719
800
  thread.messages[thread.messages.length - 1].id === msg.id;
801
+ const wasLiveRef = useRef(false);
720
802
  const hasRenderableContent = assistantMessageHasRenderableContent(msg);
721
803
  const hasUnresolvedTool = assistantMessageHasUnresolvedTool(msg.content);
722
- const responseConnectionText = messageTextFromContent(msg.content);
804
+ const missingWarningText = missingFinalResponseWarningText(msg.content);
805
+ const responseConnectionText = finalResponseTextFromContent(msg.content);
723
806
  const statusIsTerminal = assistantMessageStatusIsTerminal(msg);
724
807
  const hasCompletedCustomUi = assistantMessageHasCompletedCustomUi(msg.content);
725
808
  const hasCustomUi = assistantMessageHasCustomUi(msg.content);
@@ -730,23 +813,63 @@ export function AssistantMessage() {
730
813
  runError: messageRunError,
731
814
  bannerRunErrorKey: messageActions?.bannerRunErrorKey,
732
815
  });
733
- const showMissingFinalResponse = useSettledFlag(shouldShowMissingFinalResponse({
734
- isCurrentTurnRunning: isLast && chatRunning,
735
- serverRunActive: isLast && serverRunActive,
736
- statusIsTerminal,
737
- hasAssistantText: responseConnectionText.trim().length > 0,
738
- hasUnresolvedTool,
739
- hasCompletedCustomUi,
740
- }), isLast ? MISSING_FINAL_RESPONSE_SETTLE_MS : 0);
816
+ const missingFinalResponseCandidate = missingWarningText == null &&
817
+ shouldShowMissingFinalResponse({
818
+ isCurrentTurnRunning: isLast && chatRunning,
819
+ serverRunActive: isLast && serverRunActive,
820
+ statusIsTerminal,
821
+ hasAssistantText: responseConnectionText.trim().length > 0,
822
+ hasUnresolvedTool,
823
+ hasCompletedCustomUi,
824
+ });
825
+ const showMissingFinalResponse = useSettledFlag(missingFinalResponseCandidate, isLast ? MISSING_FINAL_RESPONSE_SETTLE_MS : 0);
826
+ const missingFinalResponseNoticeText = missingWarningText ??
827
+ (showMissingFinalResponse
828
+ ? "The agent stopped without sending a final message. Ask the agent to continue or retry."
829
+ : null);
830
+ const animateMissingFinalResponse = Boolean(isLast && missingFinalResponseNoticeText && wasLiveRef.current);
831
+ const missingFinalResponseAnimationKey = animateMissingFinalResponse
832
+ ? missingFinalResponseNoticeText
833
+ : null;
834
+ const [revealedMissingFinalResponseKey, setRevealedMissingFinalResponseKey] = useState(null);
835
+ useEffect(() => {
836
+ if (missingFinalResponseAnimationKey == null) {
837
+ setRevealedMissingFinalResponseKey(null);
838
+ return;
839
+ }
840
+ setRevealedMissingFinalResponseKey((current) => current === missingFinalResponseAnimationKey ? current : null);
841
+ }, [missingFinalResponseAnimationKey]);
842
+ const missingFinalResponseRevealed = missingFinalResponseAnimationKey == null ||
843
+ revealedMissingFinalResponseKey === missingFinalResponseAnimationKey;
844
+ const handleMissingFinalResponseReveal = useCallback(() => {
845
+ if (missingFinalResponseAnimationKey == null)
846
+ return;
847
+ setRevealedMissingFinalResponseKey(missingFinalResponseAnimationKey);
848
+ }, [missingFinalResponseAnimationKey]);
849
+ const completedToolNames = isLast && chatRunning && !hasCompletedCustomUi && Array.isArray(msg.content)
850
+ ? completedAssistantToolNamesAfterLastText(msg.content)
851
+ : [];
852
+ const shouldHoldCompletionFooter = isLast &&
853
+ ((missingFinalResponseCandidate && !showMissingFinalResponse) ||
854
+ (animateMissingFinalResponse && !missingFinalResponseRevealed));
741
855
  const responseConnectionContext = userMessageTextBeforeAssistant(thread.messages, msg.id);
742
- const isComplete = shouldShowAssistantMessageFooter({
743
- isLast,
744
- chatRunning,
745
- hasRenderableContent,
746
- statusIsTerminal,
747
- hasUnresolvedTool,
748
- });
856
+ const isComplete = !shouldHoldCompletionFooter &&
857
+ shouldShowAssistantMessageFooter({
858
+ isLast,
859
+ chatRunning,
860
+ hasRenderableContent,
861
+ statusIsTerminal,
862
+ hasUnresolvedTool,
863
+ });
749
864
  const cpCtx = React.useContext(CheckpointContext);
865
+ useEffect(() => {
866
+ if (isLast && chatRunning) {
867
+ wasLiveRef.current = true;
868
+ }
869
+ else if (!isLast) {
870
+ wasLiveRef.current = false;
871
+ }
872
+ }, [chatRunning, isLast]);
750
873
  // Capture live run duration when this message finishes streaming.
751
874
  const runStartedAtRef = useRef(null);
752
875
  const [capturedDurationMs, setCapturedDurationMs] = useState(null);
@@ -844,38 +967,44 @@ export function AssistantMessage() {
844
967
  });
845
968
  if (!hasRenderableContent)
846
969
  return null;
847
- return (_jsxs("div", { className: "group relative", style: { contentVisibility: isComplete ? "auto" : "visible" }, children: [_jsxs("div", { className: "w-full max-w-[95%] text-sm leading-relaxed text-foreground", children: [_jsx(MessagePrimitive.GroupedParts, { groupBy: groupAssistantWorkParts, children: ({ part, children }) => {
848
- switch (part.type) {
849
- case "group-work": {
850
- const showSummary = shouldShowAssistantWorkSummary({
851
- isLast,
852
- isComplete,
853
- hasCollapsibleWork,
854
- hasUnresolvedTool,
855
- chatRunning,
856
- });
857
- if (!showSummary)
858
- return _jsx(_Fragment, { children: children });
859
- return (_jsx(WorkedForSummary, { durationMs: capturedDurationMs ?? persistedDurationMs, defaultOpen: hasCustomUi, autoCollapse: animateCollapse && !hasCustomUi, children: children }));
860
- }
861
- case "group-ran-tools": {
862
- const toolCount = part.indices.filter((index) => msgContent?.[index]?.type === "tool-call").length;
863
- return (_jsx(RanToolsSummary, { toolCount: toolCount, children: children }));
864
- }
865
- case "text":
866
- return _jsx(MarkdownText, {});
867
- case "reasoning":
868
- return _jsx(ReasoningMessagePart, {});
869
- case "tool-call":
870
- if (shadowedToolCallIds.has(part.toolCallId))
970
+ return (_jsxs("div", { className: "group relative", style: { contentVisibility: isComplete ? "auto" : "visible" }, children: [_jsxs("div", { className: "w-full max-w-[95%] text-sm leading-relaxed text-foreground", children: [_jsx(ToolCallStackMotion, { children: _jsx(MessagePrimitive.GroupedParts, { groupBy: groupAssistantWorkParts, children: ({ part, children }) => {
971
+ switch (part.type) {
972
+ case "group-work": {
973
+ const showSummary = shouldShowAssistantWorkSummary({
974
+ isLast,
975
+ isComplete,
976
+ hasCollapsibleWork,
977
+ hasUnresolvedTool,
978
+ chatRunning,
979
+ });
980
+ if (!showSummary)
981
+ return _jsx(_Fragment, { children: children });
982
+ return (_jsx(WorkedForSummary, { durationMs: capturedDurationMs ?? persistedDurationMs, defaultOpen: hasCustomUi, autoCollapse: animateCollapse && !hasCustomUi, children: children }));
983
+ }
984
+ case "group-ran-tools": {
985
+ const toolCount = part.indices.filter((index) => msgContent?.[index]?.type === "tool-call").length;
986
+ return (_jsx(RanToolsSummary, { toolCount: toolCount, children: children }));
987
+ }
988
+ case "text":
989
+ if (missingWarningText != null &&
990
+ part.text === missingWarningText) {
991
+ return (_jsx(MissingFinalResponseNotice, { messageId: msg.id, text: part.text, animate: animateMissingFinalResponse, onRevealComplete: handleMissingFinalResponseReveal }));
992
+ }
993
+ return _jsx(MarkdownText, {});
994
+ case "reasoning":
995
+ return _jsx(ReasoningMessagePart, {});
996
+ case "tool-call":
997
+ if (shadowedToolCallIds.has(part.toolCallId))
998
+ return null;
999
+ return part.toolUI ? (_jsx(ToolActivityPresentation, { toolName: part.toolName, isRunning: part.status?.type === "running", isActiveTail: part.toolCallId === activeTailToolCallId, toolCallId: part.toolCallId, children: part.toolUI })) : (_jsx(ToolCallFallback, { ...part, isActiveTail: part.toolCallId === activeTailToolCallId }));
1000
+ default:
871
1001
  return null;
872
- return part.toolUI ? (_jsx(ToolActivityPresentation, { toolName: part.toolName, isRunning: part.status?.type === "running", isActiveTail: part.toolCallId === activeTailToolCallId, children: part.toolUI })) : (_jsx(ToolCallFallback, { ...part, isActiveTail: part.toolCallId === activeTailToolCallId }));
873
- default:
874
- return null;
875
- }
876
- } }), showInlineRunError && messageRunError && (_jsx(InlineRunErrorNotice, { info: messageRunError, durationMs: capturedDurationMs ?? persistedDurationMs, onRetry: isLast && messageRunError.recoverable
1002
+ }
1003
+ } }) }), completedToolNames.length > 0 && !showInlineRunError && (_jsx(AssistantCompletionProgress, { messageId: msg.id, toolNames: completedToolNames })), showInlineRunError && messageRunError && (_jsx(InlineRunErrorNotice, { info: messageRunError, durationMs: capturedDurationMs ?? persistedDurationMs, onRetry: isLast && messageRunError.recoverable
877
1004
  ? messageActions?.onRetryRunError
878
- : undefined })), showMissingFinalResponse && !showInlineRunError && (_jsx("p", { role: "status", className: "text-muted-foreground", children: "The agent stopped without sending a final message. Ask it to continue or retry." })), isComplete && hasCodeAgentTools && msgContent && (_jsx(FilesChangedSummary, { parts: msgContent })), isComplete && (_jsx(McpConnectionSuggestion, { text: responseConnectionText, contextText: responseConnectionContext, variant: "response" }))] }), isComplete && (_jsxs("div", { className: "mt-1 flex items-center justify-between", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [_jsx(MessageActionsMenu, { showRevert: showRestore && restoreState === "idle", onRevert: handleRestore }), isLast && (_jsx(TooltipProvider, { delayDuration: 400, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(ActionBarPrimitive.Reload, { asChild: true, children: _jsx("button", { type: "button", "aria-label": "Regenerate response", className: `flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground ${messageFooterFadeClassName} disabled:cursor-not-allowed disabled:opacity-40`, children: _jsx(IconRefresh, { className: "h-3.5 w-3.5" }) }) }) }), _jsx(TooltipContent, { side: "top", className: "text-xs", children: "Regenerate response" })] }) })), _jsx(MessageBranchPicker, {}), timestamp && (_jsx(MessageTimestamp, { timestamp: timestamp, className: messageFooterFadeClassName }))] }), showRestore && restoreState === "confirming" ? (_jsxs("div", { className: "flex items-center gap-1 text-xs", children: [_jsx("button", { onClick: handleRestore, className: "rounded-md bg-destructive px-1.5 py-0.5 text-destructive-foreground hover:bg-destructive/90", children: "Restore to here?" }), _jsx("button", { onClick: cancelRestore, className: "rounded-md px-1.5 py-0.5 text-muted-foreground hover:bg-accent", children: "Cancel" })] })) : showRestore && restoreState === "restoring" ? (_jsxs("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [_jsx(IconLoader2, { className: "h-3 w-3 animate-spin" }), "Restoring..."] })) : restoreState === "error" ? (_jsxs("span", { className: "flex items-center gap-1 text-xs text-destructive", children: [_jsx(IconAlertTriangle, { className: "h-3 w-3 shrink-0" }), _jsx("span", { className: "truncate", children: restoreError }), _jsx("button", { onClick: cancelRestore, className: "cursor-pointer rounded-md px-1.5 py-0.5 text-muted-foreground hover:bg-accent", children: "Dismiss" })] })) : (_jsx(ThumbsFeedback, { threadId: cpCtx?.threadId ?? "", runId: messageRunId ?? "", messageSeq: thread.messages.findIndex((m) => m.id === msg.id) }))] }))] }));
1005
+ : undefined })), missingWarningText == null &&
1006
+ missingFinalResponseNoticeText != null &&
1007
+ !showInlineRunError && (_jsx(MissingFinalResponseNotice, { messageId: msg.id, text: missingFinalResponseNoticeText, animate: animateMissingFinalResponse, onRevealComplete: handleMissingFinalResponseReveal })), isComplete && hasCodeAgentTools && msgContent && (_jsx(FilesChangedSummary, { parts: msgContent })), isComplete && (_jsx(McpConnectionSuggestion, { text: responseConnectionText, contextText: responseConnectionContext, variant: "response" }))] }), isComplete && (_jsxs("div", { className: "mt-1 flex items-center justify-between", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [_jsx(MessageActionsMenu, { showRevert: showRestore && restoreState === "idle", onRevert: handleRestore }), isLast && (_jsx(TooltipProvider, { delayDuration: 400, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(ActionBarPrimitive.Reload, { asChild: true, children: _jsx("button", { type: "button", "aria-label": "Regenerate response", className: `flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-muted-foreground/70 hover:bg-accent hover:text-foreground ${messageFooterFadeClassName} disabled:cursor-not-allowed disabled:opacity-40`, children: _jsx(IconRefresh, { className: "h-3.5 w-3.5" }) }) }) }), _jsx(TooltipContent, { side: "top", className: "text-xs", children: "Regenerate response" })] }) })), _jsx(MessageBranchPicker, {}), timestamp && (_jsx(MessageTimestamp, { timestamp: timestamp, className: messageFooterFadeClassName }))] }), showRestore && restoreState === "confirming" ? (_jsxs("div", { className: "flex items-center gap-1 text-xs", children: [_jsx("button", { onClick: handleRestore, className: "rounded-md bg-destructive px-1.5 py-0.5 text-destructive-foreground hover:bg-destructive/90", children: "Restore to here?" }), _jsx("button", { onClick: cancelRestore, className: "rounded-md px-1.5 py-0.5 text-muted-foreground hover:bg-accent", children: "Cancel" })] })) : showRestore && restoreState === "restoring" ? (_jsxs("span", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [_jsx(IconLoader2, { className: "h-3 w-3 animate-spin" }), "Restoring..."] })) : restoreState === "error" ? (_jsxs("span", { className: "flex items-center gap-1 text-xs text-destructive", children: [_jsx(IconAlertTriangle, { className: "h-3 w-3 shrink-0" }), _jsx("span", { className: "truncate", children: restoreError }), _jsx("button", { onClick: cancelRestore, className: "cursor-pointer rounded-md px-1.5 py-0.5 text-muted-foreground hover:bg-accent", children: "Dismiss" })] })) : (_jsx(ThumbsFeedback, { threadId: cpCtx?.threadId ?? "", runId: messageRunId ?? "", messageSeq: thread.messages.findIndex((m) => m.id === msg.id) }))] }))] }));
879
1008
  }
880
1009
  // ─── RunningActivityStatus / ThinkingIndicator ────────────────────────────────
881
1010
  export function RunningActivityStatus({ label }) {
@@ -7,6 +7,15 @@ import { FilesChangedSummary } from "../tool-cells/index.js";
7
7
  export declare const ChatRunningContext: React.Context<boolean>;
8
8
  export declare const ChatRunDurationContext: React.Context<number | null>;
9
9
  export declare const ASSISTANT_VISIBLE_TOOL_CALL_LIMIT = 3;
10
+ /**
11
+ * Keeps the visible tool stack spatially continuous as streaming calls change
12
+ * which rows belong to the collapsed history bucket. The rendered data stays
13
+ * untouched; this only animates the DOM's before/after positions.
14
+ */
15
+ export declare function ToolCallStackMotion({ children, className, }: {
16
+ children: React.ReactNode;
17
+ className?: string;
18
+ }): React.JSX.Element;
10
19
  /**
11
20
  * Human-in-the-loop approval bridge. `AssistantChatInner` provides a value that
12
21
  * re-issues the turn approving a specific paused tool call (opt-in
@@ -38,10 +47,11 @@ export declare function toolCallHasPendingApproval(part: {
38
47
  } | null;
39
48
  }): boolean;
40
49
  export declare const TOOL_LONG_RUNNING_HINT_DELAY_MS = 45000;
41
- export declare function ToolActivityPresentation({ toolName, isRunning, isActiveTail, suppressLongRunningHint, children, }: {
50
+ export declare function ToolActivityPresentation({ toolName, isRunning, isActiveTail, toolCallId, suppressLongRunningHint, children, }: {
42
51
  toolName: string;
43
52
  isRunning: boolean;
44
53
  isActiveTail: boolean;
54
+ toolCallId?: string;
45
55
  suppressLongRunningHint?: boolean;
46
56
  children: React.ReactNode;
47
57
  }): React.JSX.Element;
@@ -59,8 +69,9 @@ export declare function AnimatedCollapse({ open, children, }: {
59
69
  open: boolean;
60
70
  children: React.ReactNode;
61
71
  }): React.JSX.Element | null;
62
- export declare function ToolCallDisplay({ toolName, argsText, args, result, mcpApp, chatUI, isRunning, outcome, structuredMeta, approval, repeatCount, isLatestRunning, isActiveTail, }: {
72
+ export declare function ToolCallDisplay({ toolName, toolCallId, argsText, args, result, mcpApp, chatUI, isRunning, outcome, structuredMeta, approval, repeatCount, isLatestRunning, isActiveTail, }: {
63
73
  toolName: string;
74
+ toolCallId?: string;
64
75
  argsText?: string;
65
76
  args: Record<string, unknown>;
66
77
  result?: string;
@@ -80,7 +91,7 @@ export declare function ToolCallDisplay({ toolName, argsText, args, result, mcpA
80
91
  /** @deprecated Use isActiveTail. */
81
92
  isLatestRunning?: boolean;
82
93
  }): React.JSX.Element;
83
- export declare function ToolCallFallback({ toolName, args, argsText, result, ...rest }: ToolCallMessagePartProps & {
94
+ export declare function ToolCallFallback({ toolName, toolCallId, args, argsText, result, ...rest }: ToolCallMessagePartProps & {
84
95
  mcpApp?: AgentMcpAppPayload;
85
96
  chatUI?: ActionChatUIConfig;
86
97
  structuredMeta?: Record<string, unknown>;
@@ -126,8 +137,9 @@ export declare function WorkedForSummary({ durationMs, defaultOpen, autoCollapse
126
137
  autoCollapse?: boolean;
127
138
  children: React.ReactNode;
128
139
  }): React.JSX.Element;
129
- export declare function RanToolsSummary({ toolCount, children, }: {
140
+ export declare function RanToolsSummary({ toolCount, motionKey, children, }: {
130
141
  toolCount: number;
142
+ motionKey?: string;
131
143
  children: React.ReactNode;
132
144
  }): React.JSX.Element;
133
145
  export { FilesChangedSummary };