@agent-native/core 0.145.5 → 0.145.6

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 (387) 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-tracking-and-chat-startup-no-longer-emit-avoidable.md +6 -0
  34. package/corpus/templates/analytics/changelog/2026-08-07-dashboard-panels-now-load-custom-api-data-programs-reliably.md +6 -0
  35. package/corpus/templates/analytics/changelog/2026-08-07-gong-searches-conserve-api-quota-and-report-incomplete-coverage.md +6 -0
  36. package/corpus/templates/analytics/changelog/2026-08-07-searchable-dashboards-make-personal-and-shared-folders-easie.md +6 -0
  37. package/corpus/templates/analytics/netlify.toml +3 -0
  38. package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +112 -0
  39. package/corpus/templates/analytics/server/db/index.ts +12 -0
  40. package/corpus/templates/analytics/server/db/schema.ts +14 -0
  41. package/corpus/templates/analytics/server/jobs/analytics-rollup-backfill.ts +4 -0
  42. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +1 -0
  43. package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +85 -15
  44. package/corpus/templates/analytics/server/lib/dashboard-folders-store.ts +168 -0
  45. package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +9 -4
  46. package/corpus/templates/analytics/server/lib/dashboards-store.ts +116 -1
  47. package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +4 -8
  48. package/corpus/templates/analytics/server/lib/gong.ts +139 -78
  49. package/corpus/templates/analytics/server/plugins/db.ts +55 -15
  50. package/corpus/templates/analytics/server/plugins/session-replay-retention-jobs.ts +6 -2
  51. package/corpus/templates/analytics/server/routes/api/session-replay/retention.post.ts +65 -0
  52. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +18 -0
  53. package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  54. package/corpus/templates/assets/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  55. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -0
  56. package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +76 -23
  57. package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  58. package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  59. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +18 -0
  60. package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  61. package/corpus/templates/brain/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  62. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -0
  63. package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +76 -23
  64. package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  65. package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  66. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +18 -0
  67. package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  68. package/corpus/templates/calendar/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  69. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -0
  70. package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +76 -23
  71. package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  72. package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  73. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  74. package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  75. package/corpus/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  76. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  77. package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  78. package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  79. package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  80. package/corpus/templates/chat/.env.example +3 -0
  81. package/corpus/templates/chat/AGENTS.md +4 -0
  82. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +18 -0
  83. package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  84. package/corpus/templates/clips/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  85. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -0
  86. package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +76 -23
  87. package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  88. package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  89. package/corpus/templates/clips/actions/lib/audio-only-transcription.ts +4 -0
  90. package/corpus/templates/clips/actions/request-transcript.ts +52 -3
  91. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -10
  92. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +1 -0
  93. package/corpus/templates/clips/changelog/2026-08-07-screen-recordings-now-capture-tab-and-system-audio-even-when.md +6 -0
  94. package/corpus/templates/clips/changelog/2026-08-07-transcription-now-retries-transient-cloud-failures-automatic.md +6 -0
  95. package/corpus/templates/clips/server/db/schema.ts +7 -0
  96. package/corpus/templates/clips/server/plugins/db.ts +8 -0
  97. package/corpus/templates/clips/shared/recording-capture.ts +38 -0
  98. package/corpus/templates/clips/shared/transcript-failure.ts +89 -0
  99. package/corpus/templates/content/.agents/skills/actions/SKILL.md +18 -0
  100. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  101. package/corpus/templates/content/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  102. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -0
  103. package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +76 -23
  104. package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  105. package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  106. package/corpus/templates/content/.env.example +9 -3
  107. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -0
  108. package/corpus/templates/content/changelog/2026-08-07-collapsed-sidebar-utility-buttons-stay-anchored-at-the-botto.md +6 -0
  109. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  110. package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +76 -23
  111. package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  112. package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  113. package/corpus/templates/design/.agents/skills/actions/SKILL.md +18 -0
  114. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  115. package/corpus/templates/design/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  116. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -0
  117. package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +76 -23
  118. package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  119. package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  120. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +18 -0
  121. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  122. package/corpus/templates/dispatch/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  123. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -0
  124. package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +76 -23
  125. package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  126. package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  127. package/corpus/templates/factory/.agents/skills/actions/SKILL.md +18 -0
  128. package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  129. package/corpus/templates/factory/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  130. package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +1 -0
  131. package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +76 -23
  132. package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  133. package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  134. package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +279 -0
  135. package/corpus/templates/factory/actions/get-factory-automation-health.ts +23 -4
  136. package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +1 -1
  137. package/corpus/templates/factory/app/routes/factory.tsx +21 -3
  138. package/corpus/templates/factory/changelog/2026-08-07-factory-can-keep-builder-bot-pull-requests-moving-by-request.md +6 -0
  139. package/corpus/templates/factory/server/lib/require-factory-automation.ts +1 -0
  140. package/corpus/templates/factory/server/plugins/agent-chat.ts +4 -1
  141. package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +81 -12
  142. package/corpus/templates/factory/server/triage/github-client.ts +31 -0
  143. package/corpus/templates/factory/server/triage/pr-babysit.ts +75 -1
  144. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +18 -0
  145. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  146. package/corpus/templates/forms/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  147. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -0
  148. package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +76 -23
  149. package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  150. package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  151. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  152. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -0
  153. package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +76 -23
  154. package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  155. package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  156. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +18 -0
  157. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  158. package/corpus/templates/mail/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  159. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -0
  160. package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +76 -23
  161. package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  162. package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  163. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +18 -0
  164. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  165. package/corpus/templates/plan/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  166. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -0
  167. package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +76 -23
  168. package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  169. package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  170. package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -1
  171. package/corpus/templates/plan/changelog/2026-08-07-inline-help-icons-now-stay-visually-balanced-with-nearby-tex.md +6 -0
  172. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +18 -0
  173. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  174. package/corpus/templates/slides/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  175. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -0
  176. package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +76 -23
  177. package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  178. package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  179. package/corpus/templates/slides/.env.example +5 -0
  180. package/corpus/templates/slides/changelog/2026-08-07-fixed-generated-slides-briefly-disappearing-while-they-are-b.md +6 -0
  181. package/corpus/templates/slides/server/plugins/collab.ts +20 -8
  182. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +18 -0
  183. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  184. package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  185. package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +1 -0
  186. package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +76 -23
  187. package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  188. package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  189. package/corpus/templates/tasks/.env.example +3 -0
  190. package/dist/agent/production-agent.js +24 -3
  191. package/dist/client/AgentPanel.d.ts +6 -0
  192. package/dist/client/AgentPanel.js +176 -30
  193. package/dist/client/AssistantChat.d.ts +2 -0
  194. package/dist/client/AssistantChat.js +4 -1
  195. package/dist/client/ConnectBuilderCard.js +6 -11
  196. package/dist/client/MultiTabAssistantChat.js +1 -1
  197. package/dist/client/RuntimeConfigNotice.d.ts +1 -0
  198. package/dist/client/RuntimeConfigNotice.js +94 -0
  199. package/dist/client/agent-chat/index.d.ts +1 -1
  200. package/dist/client/agent-chat/index.js +1 -1
  201. package/dist/client/agent-chat-adapter.js +85 -4
  202. package/dist/client/agent-page/AgentTabsPage.js +1 -1
  203. package/dist/client/agent-sidebar-state.d.ts +6 -0
  204. package/dist/client/agent-sidebar-state.js +25 -0
  205. package/dist/client/app-providers.js +2 -1
  206. package/dist/client/assistant-ui-recovery.js +1 -1
  207. package/dist/client/chat/index.d.ts +1 -1
  208. package/dist/client/chat/index.js +1 -1
  209. package/dist/client/chat/markdown-renderer.d.ts +2 -1
  210. package/dist/client/chat/markdown-renderer.js +48 -2
  211. package/dist/client/chat/message-components.d.ts +6 -0
  212. package/dist/client/chat/message-components.js +182 -53
  213. package/dist/client/chat/tool-call-display.d.ts +16 -4
  214. package/dist/client/chat/tool-call-display.js +225 -18
  215. package/dist/client/extensions/ExtensionsSidebarSection.js +1 -1
  216. package/dist/client/frame-protocol.d.ts +4 -0
  217. package/dist/client/i18n.js +9 -0
  218. package/dist/client/integrations/IntegrationsPanel.js +2 -5
  219. package/dist/client/onboarding/FirstRunOnboarding.js +2 -3
  220. package/dist/client/org/TeamPage.js +49 -6
  221. package/dist/client/org/hooks.d.ts +7 -2
  222. package/dist/client/org/hooks.js +11 -4
  223. package/dist/client/resources/McpConnectionSuggestion.js +2 -3
  224. package/dist/client/resources/McpIntegrationDialog.js +2 -16
  225. package/dist/client/resources/McpIntegrationLogo.d.ts +11 -0
  226. package/dist/client/resources/McpIntegrationLogo.js +14 -0
  227. package/dist/client/resources/ResourceTree.js +1 -1
  228. package/dist/client/resources/mcp-integration-logos.d.ts +1 -0
  229. package/dist/client/resources/mcp-integration-logos.js +47 -18
  230. package/dist/client/settings/useBuilderStatus.js +6 -0
  231. package/dist/client/ui/index.d.ts +1 -0
  232. package/dist/client/ui/index.js +1 -0
  233. package/dist/collab/routes.d.ts +1 -1
  234. package/dist/config.d.ts +26 -3
  235. package/dist/config.js +106 -14
  236. package/dist/db/ddl-guard.d.ts +15 -2
  237. package/dist/db/ddl-guard.js +53 -5
  238. package/dist/jobs/scheduler.js +7 -0
  239. package/dist/localization/default-messages.d.ts +17 -0
  240. package/dist/localization/default-messages.js +17 -0
  241. package/dist/mcp/oauth-client-metadata.js +5 -1
  242. package/dist/mcp/oauth-route.d.ts +5 -4
  243. package/dist/mcp/oauth-route.js +25 -9
  244. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  245. package/dist/mcp/server.d.ts +1 -1
  246. package/dist/mcp/server.js +9 -10
  247. package/dist/notifications/routes.d.ts +3 -3
  248. package/dist/org/handlers.d.ts +1 -0
  249. package/dist/org/handlers.js +17 -2
  250. package/dist/provider-api/actions/custom-provider-registration.d.ts +5 -5
  251. package/dist/provider-api/actions/provider-api.d.ts +7 -7
  252. package/dist/provider-api/corpus-jobs.d.ts +12 -2
  253. package/dist/provider-api/corpus-jobs.js +31 -1
  254. package/dist/provider-api/index.d.ts +2 -0
  255. package/dist/provider-api/index.js +7 -1
  256. package/dist/resources/handlers.d.ts +1 -1
  257. package/dist/secrets/routes.d.ts +3 -3
  258. package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +1 -1
  259. package/dist/server/agent-chat/recurring-jobs-runtime.js +14 -2
  260. package/dist/server/agent-chat/script-entries.js +12 -1
  261. package/dist/server/agent-chat-plugin.js +2 -2
  262. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  263. package/dist/server/auth.d.ts +1 -0
  264. package/dist/server/auth.js +85 -1
  265. package/dist/server/better-auth-instance.d.ts +9 -0
  266. package/dist/server/better-auth-instance.js +25 -11
  267. package/dist/server/core-routes-plugin.d.ts +7 -0
  268. package/dist/server/core-routes-plugin.js +51 -5
  269. package/dist/server/create-server.js +23 -2
  270. package/dist/server/db-pressure.d.ts +38 -0
  271. package/dist/server/db-pressure.js +147 -0
  272. package/dist/server/index.d.ts +1 -0
  273. package/dist/server/index.js +1 -0
  274. package/dist/server/legacy-auth-migration.d.ts +10 -0
  275. package/dist/server/legacy-auth-migration.js +37 -0
  276. package/dist/server/onboarding-html.js +206 -2
  277. package/dist/server/poll.d.ts +26 -0
  278. package/dist/server/poll.js +108 -13
  279. package/dist/server/ssr-handler.js +4 -1
  280. package/dist/shared/index.d.ts +1 -0
  281. package/dist/shared/index.js +1 -0
  282. package/dist/shared/runtime-config.d.ts +44 -0
  283. package/dist/shared/runtime-config.js +284 -0
  284. package/dist/styles/agent-native.css +48 -1
  285. package/dist/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  286. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  287. package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  288. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  289. package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  290. package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  291. package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  292. package/dist/templates/chat/.env.example +3 -0
  293. package/dist/templates/chat/AGENTS.md +4 -0
  294. package/dist/templates/default/.agents/skills/actions/SKILL.md +18 -0
  295. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  296. package/dist/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  297. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
  298. package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
  299. package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  300. package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  301. package/dist/templates/default/AGENTS.md +6 -1
  302. package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
  303. package/dist/templates/default/app/i18n/de-DE.ts +6 -0
  304. package/dist/templates/default/app/i18n/en-US.ts +6 -0
  305. package/dist/templates/default/app/i18n/es-ES.ts +6 -0
  306. package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
  307. package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
  308. package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
  309. package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
  310. package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
  311. package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
  312. package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
  313. package/dist/templates/headless/.agents/skills/actions/SKILL.md +18 -0
  314. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  315. package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
  316. package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  317. package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  318. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
  319. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  320. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  321. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
  322. package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
  323. package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  324. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  325. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
  326. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
  327. package/dist/templates/workspace-core/AGENTS.md +7 -2
  328. package/dist/templates/workspace-root/AGENTS.md +5 -0
  329. package/dist/vite/client.d.ts +3 -3
  330. package/dist/vite/client.js +47 -1
  331. package/dist/vite/index.d.ts +1 -1
  332. package/docs/content/agent-native-config.mdx +240 -139
  333. package/docs/content/authentication.mdx +17 -0
  334. package/docs/content/deployment.mdx +19 -14
  335. package/docs/content/drop-in-agent.mdx +19 -2
  336. package/docs/content/environment-variables.mdx +63 -38
  337. package/docs/content/getting-started-actions.mdx +15 -6
  338. package/docs/content/getting-started-database.mdx +14 -10
  339. package/docs/content/getting-started-pages.mdx +32 -35
  340. package/docs/content/getting-started.mdx +7 -6
  341. package/package.json +1 -1
  342. package/src/templates/chat/.agents/skills/actions/SKILL.md +18 -0
  343. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  344. package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  345. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -0
  346. package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +76 -23
  347. package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  348. package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  349. package/src/templates/chat/.env.example +3 -0
  350. package/src/templates/chat/AGENTS.md +4 -0
  351. package/src/templates/default/.agents/skills/actions/SKILL.md +18 -0
  352. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  353. package/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  354. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -0
  355. package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +76 -23
  356. package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  357. package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  358. package/src/templates/default/AGENTS.md +6 -1
  359. package/src/templates/default/app/i18n/ar-SA.ts +6 -0
  360. package/src/templates/default/app/i18n/de-DE.ts +6 -0
  361. package/src/templates/default/app/i18n/en-US.ts +6 -0
  362. package/src/templates/default/app/i18n/es-ES.ts +6 -0
  363. package/src/templates/default/app/i18n/fr-FR.ts +6 -0
  364. package/src/templates/default/app/i18n/hi-IN.ts +6 -0
  365. package/src/templates/default/app/i18n/ja-JP.ts +6 -0
  366. package/src/templates/default/app/i18n/ko-KR.ts +6 -0
  367. package/src/templates/default/app/i18n/pt-BR.ts +6 -0
  368. package/src/templates/default/app/i18n/zh-CN.ts +6 -0
  369. package/src/templates/default/app/i18n/zh-TW.ts +6 -0
  370. package/src/templates/headless/.agents/skills/actions/SKILL.md +18 -0
  371. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  372. package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +76 -23
  373. package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  374. package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  375. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +18 -0
  376. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  377. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +45 -47
  378. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -0
  379. package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +76 -23
  380. package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +2 -2
  381. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +64 -0
  382. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -0
  383. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +8 -0
  384. package/src/templates/workspace-core/AGENTS.md +7 -2
  385. package/src/templates/workspace-root/AGENTS.md +5 -0
  386. package/corpus/templates/dispatch/app/routes/admin.apps.$appId.tsx +0 -1
  387. package/corpus/templates/dispatch/app/routes/admin.apps.tsx +0 -1
@@ -2278,10 +2278,23 @@ export function createAgentChatAdapter(options) {
2278
2278
  return "completed";
2279
2279
  }
2280
2280
  let active = null;
2281
+ // "The poll failed" and "the server reports no active run" are
2282
+ // different facts. Only the second one is evidence the run is
2283
+ // gone; coercing the first into the second lets a flaky network
2284
+ // tick drive a durable abort of a run that is still working.
2285
+ let activeUnreadable = false;
2281
2286
  try {
2282
2287
  const activeRes = await fetch(`${apiUrl}/runs/active?threadId=${encodeURIComponent(threadId)}`, { signal: abortSignal });
2283
2288
  if (activeRes.ok) {
2284
- active = await activeRes.json().catch(() => null);
2289
+ active = await activeRes.json().catch(() => {
2290
+ activeUnreadable = true;
2291
+ return null;
2292
+ });
2293
+ }
2294
+ else {
2295
+ // A 5xx/404 from this route is the route failing, not the run
2296
+ // ending.
2297
+ activeUnreadable = true;
2285
2298
  }
2286
2299
  }
2287
2300
  catch (pollErr) {
@@ -2289,7 +2302,16 @@ export function createAgentChatAdapter(options) {
2289
2302
  clearActiveRun();
2290
2303
  return "completed";
2291
2304
  }
2292
- // Transient poll failure — counts as "no active run" this tick.
2305
+ activeUnreadable = true;
2306
+ }
2307
+ if (activeUnreadable) {
2308
+ // Unreadable: learn nothing, decide nothing, wait and re-ask.
2309
+ await delay(BACKGROUND_FOLLOW_POLL_INTERVAL_MS, abortSignal);
2310
+ if (abortSignal.aborted) {
2311
+ clearActiveRun();
2312
+ return "completed";
2313
+ }
2314
+ continue;
2293
2315
  }
2294
2316
  const activeRunId = active?.active === true && active.runId
2295
2317
  ? String(active.runId)
@@ -2405,10 +2427,67 @@ export function createAgentChatAdapter(options) {
2405
2427
  });
2406
2428
  return "completed";
2407
2429
  }
2408
- const activeProgressAt = typeof active?.lastProgressAt === "number" &&
2430
+ // Progress read from the PRE-attach snapshot first...
2431
+ const snapshotProgressAt = typeof active?.lastProgressAt === "number" &&
2409
2432
  Number.isFinite(active.lastProgressAt)
2410
2433
  ? active.lastProgressAt
2411
2434
  : null;
2435
+ const snapshotSaysStalled = lastObservedServerProgressAt !== null &&
2436
+ (snapshotProgressAt === null ||
2437
+ snapshotProgressAt <= lastObservedServerProgressAt);
2438
+ // ...and re-read ONLY when that snapshot would condemn the run.
2439
+ //
2440
+ // `active` was fetched at the top of this iteration and the attach
2441
+ // above blocked for its whole duration, so judging progress from
2442
+ // it asks "did the server advance before we started listening?" —
2443
+ // never the question. A run that streamed text and a complete
2444
+ // tool-argument payload DURING the attach still looked frozen, and
2445
+ // the client durably aborted it. Measured fleet-wide: 23 of 24
2446
+ // client-watchdog kills landed on runs that had made
2447
+ // server-authoritative progress within the previous 90 seconds.
2448
+ //
2449
+ // Re-reading only on the condemning path keeps the extra request
2450
+ // off the healthy path entirely: a run already observed to be
2451
+ // advancing needs no second opinion.
2452
+ let activeProgressAt = snapshotProgressAt;
2453
+ // Set when the second opinion could not be obtained. The
2454
+ // snapshot is NOT a safe fallback here: it is precisely the
2455
+ // value that condemns the run, so falling back to it turns a
2456
+ // network blip into a kill.
2457
+ let secondOpinionUnreadable = false;
2458
+ if (snapshotSaysStalled) {
2459
+ try {
2460
+ const freshRes = await fetch(`${apiUrl}/runs/active?threadId=${encodeURIComponent(threadId)}`, { signal: abortSignal });
2461
+ if (!freshRes.ok) {
2462
+ // The route failing is not the run ending.
2463
+ secondOpinionUnreadable = true;
2464
+ }
2465
+ else {
2466
+ const fresh = await freshRes.json().catch(() => {
2467
+ secondOpinionUnreadable = true;
2468
+ return null;
2469
+ });
2470
+ const freshProgressAt = typeof fresh?.lastProgressAt === "number" &&
2471
+ Number.isFinite(fresh.lastProgressAt)
2472
+ ? fresh.lastProgressAt
2473
+ : null;
2474
+ if (freshProgressAt !== null) {
2475
+ activeProgressAt =
2476
+ snapshotProgressAt === null
2477
+ ? freshProgressAt
2478
+ : Math.max(snapshotProgressAt, freshProgressAt);
2479
+ }
2480
+ }
2481
+ }
2482
+ catch (refetchErr) {
2483
+ if (refetchErr instanceof Error &&
2484
+ refetchErr.name === "AbortError") {
2485
+ clearActiveRun();
2486
+ return "completed";
2487
+ }
2488
+ secondOpinionUnreadable = true;
2489
+ }
2490
+ }
2412
2491
  const runChanged = activeRunId !== lastObservedActiveRunId;
2413
2492
  const serverProgressAdvanced = activeProgressAt !== null &&
2414
2493
  lastObservedServerProgressAt !== null &&
@@ -2436,7 +2515,9 @@ export function createAgentChatAdapter(options) {
2436
2515
  // existing timeout below.
2437
2516
  const awaitingRedispatch = active?.awaitingRedispatch === true;
2438
2517
  const madeProgress = runChanged || serverProgressAdvanced;
2439
- if (madeProgress || awaitingRedispatch) {
2518
+ if (madeProgress ||
2519
+ awaitingRedispatch ||
2520
+ secondOpinionUnreadable) {
2440
2521
  // Only server-authoritative progress resets the idle window:
2441
2522
  // a successor run or a newer lastProgressAt timestamp. Raw
2442
2523
  // sequence advancement is not enough — keepalives and retry
@@ -182,7 +182,7 @@ function CopyField({ label, value, docsHref, docsLabel }) {
182
182
  setCopied(false);
183
183
  }
184
184
  };
185
- return (_jsxs("div", { className: "flex min-w-0 items-center gap-2 rounded-md border border-border bg-muted/20 p-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70", children: [label, docsHref && (_jsx("a", { href: docsHref, target: "_blank", rel: "noopener noreferrer", "aria-label": docsLabel ?? `Open ${label} documentation`, title: docsLabel ?? `Open ${label} documentation`, className: "inline-flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground", children: _jsx(IconHelpCircle, { className: "size-3" }) }))] }), _jsx("code", { className: "mt-1 block truncate text-xs text-foreground", children: value })] }), _jsx("button", { type: "button", onClick: () => void copy(), className: "shrink-0 cursor-pointer rounded-md border border-border bg-background px-2.5 py-1.5 text-[11px] font-medium text-foreground hover:bg-accent", children: copied ? "Copied" : "Copy" })] }));
185
+ return (_jsxs("div", { className: "flex min-w-0 items-center gap-2 rounded-md border border-border bg-muted/20 p-2", children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/70", children: [label, docsHref && (_jsx("a", { href: docsHref, target: "_blank", rel: "noopener noreferrer", "aria-label": docsLabel ?? `Open ${label} documentation`, title: docsLabel ?? `Open ${label} documentation`, className: "inline-flex size-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground", children: _jsx(IconHelpCircle, { className: "size-2.5" }) }))] }), _jsx("code", { className: "mt-1 block truncate text-xs text-foreground", children: value })] }), _jsx("button", { type: "button", onClick: () => void copy(), className: "shrink-0 cursor-pointer rounded-md border border-border bg-background px-2.5 py-1.5 text-[11px] font-medium text-foreground hover:bg-accent", children: copied ? "Copied" : "Copy" })] }));
186
186
  }
187
187
  function AccessTab({ appName: appNameProp, }) {
188
188
  const [urls, setUrls] = useState(null);
@@ -2,6 +2,9 @@ export { hasChatThreadDeepLink } from "./chat-thread-url.js";
2
2
  export declare const SIDEBAR_OPEN_KEY = "agent-native-sidebar-open";
3
3
  export declare const SIDEBAR_STATE_CHANGE_EVENT = "agent-panel:state-change";
4
4
  export declare const SIDEBAR_URL_CHANGE_EVENT = "agent-panel:url-change";
5
+ export declare const AGENT_SIDEBAR_MIN_WIDTH = 280;
6
+ export declare const AGENT_SIDEBAR_DEFAULT_MAX_WIDTH = 700;
7
+ export declare const AGENT_SIDEBAR_WIDE_WIDTH_RATIO = 0.75;
5
8
  export type AgentSidebarStateSource = "app" | "frame";
6
9
  export type AgentSidebarStateMode = "app" | "code";
7
10
  export interface AgentSidebarStateChangeDetail {
@@ -12,6 +15,9 @@ export interface AgentSidebarStateChangeDetail {
12
15
  /** Frame protocol mode: "code" is parent-owned, "app" is app-owned. */
13
16
  mode: AgentSidebarStateMode;
14
17
  }
18
+ export declare function getAgentSidebarWideWidth(viewportWidth?: number): number;
19
+ export declare function getAgentSidebarMaxWidth(viewportWidth?: number): number;
20
+ export declare function clampAgentSidebarWidth(width: number, viewportWidth?: number): number;
15
21
  export declare function getAgentSidebarOpenPreferenceKey(storageKey?: string | null): string;
16
22
  export declare function dispatchAgentSidebarStateChange(detail: AgentSidebarStateChangeDetail): void;
17
23
  export declare function setAgentSidebarOpenPreference(open: boolean, storageKey?: string | null): void;
@@ -4,7 +4,32 @@ export { hasChatThreadDeepLink } from "./chat-thread-url.js";
4
4
  export const SIDEBAR_OPEN_KEY = "agent-native-sidebar-open";
5
5
  export const SIDEBAR_STATE_CHANGE_EVENT = "agent-panel:state-change";
6
6
  export const SIDEBAR_URL_CHANGE_EVENT = "agent-panel:url-change";
7
+ export const AGENT_SIDEBAR_MIN_WIDTH = 280;
8
+ export const AGENT_SIDEBAR_DEFAULT_MAX_WIDTH = 700;
9
+ export const AGENT_SIDEBAR_WIDE_WIDTH_RATIO = 0.75;
7
10
  const HISTORY_PATCHED_KEY = "__agentNativeSidebarHistoryPatched";
11
+ function resolveViewportWidth(viewportWidth) {
12
+ const resolved = viewportWidth ??
13
+ (typeof window === "undefined"
14
+ ? AGENT_SIDEBAR_DEFAULT_MAX_WIDTH
15
+ : window.innerWidth);
16
+ if (!Number.isFinite(resolved)) {
17
+ throw new TypeError("Agent sidebar viewport width must be finite");
18
+ }
19
+ return Math.max(0, resolved);
20
+ }
21
+ export function getAgentSidebarWideWidth(viewportWidth) {
22
+ return Math.max(AGENT_SIDEBAR_MIN_WIDTH, Math.round(resolveViewportWidth(viewportWidth) * AGENT_SIDEBAR_WIDE_WIDTH_RATIO));
23
+ }
24
+ export function getAgentSidebarMaxWidth(viewportWidth) {
25
+ return Math.max(AGENT_SIDEBAR_DEFAULT_MAX_WIDTH, getAgentSidebarWideWidth(viewportWidth));
26
+ }
27
+ export function clampAgentSidebarWidth(width, viewportWidth) {
28
+ if (!Number.isFinite(width)) {
29
+ throw new TypeError("Agent sidebar width must be finite");
30
+ }
31
+ return Math.min(getAgentSidebarMaxWidth(viewportWidth), Math.max(AGENT_SIDEBAR_MIN_WIDTH, width));
32
+ }
8
33
  export function getAgentSidebarOpenPreferenceKey(storageKey) {
9
34
  const suffix = storageKey?.trim();
10
35
  return suffix ? `agent-native.${suffix}.sidebar-open` : SIDEBAR_OPEN_KEY;
@@ -59,6 +59,7 @@ import { AgentNativeI18nProvider, } from "./i18n.js";
59
59
  import { RequireSession } from "./require-session.js";
60
60
  import { AgentNativeRouteWarmup } from "./route-warmup.js";
61
61
  import { RouteTransitionIndicator } from "./RouteTransitionIndicator.js";
62
+ import { RuntimeConfigNotice } from "./RuntimeConfigNotice.js";
62
63
  const DEFAULT_TOASTER = _jsx(Toaster, { richColors: true, position: "bottom-left" });
63
64
  function RoutedAppEnhancements() {
64
65
  const isInRouter = useInRouterContext();
@@ -68,7 +69,7 @@ function RoutedAppEnhancements() {
68
69
  }
69
70
  function ProvidersInner({ queryClient, defaultTheme = "system", themeAttribute = "class", tooltipDelayDuration, toaster = DEFAULT_TOASTER, disableThemeTransitions = true, i18n, children, }) {
70
71
  const localizedChildren = i18n === false ? (children) : (_jsx(AgentNativeI18nProvider, { ...(i18n ?? {}), children: children }));
71
- return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemeProvider, { attribute: themeAttribute, defaultTheme: defaultTheme, enableSystem: true, disableTransitionOnChange: disableThemeTransitions, children: _jsxs(TooltipProvider, { delayDuration: tooltipDelayDuration, children: [localizedChildren, _jsx(RoutedAppEnhancements, {}), toaster] }) }) }));
72
+ return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(ThemeProvider, { attribute: themeAttribute, defaultTheme: defaultTheme, enableSystem: true, disableTransitionOnChange: disableThemeTransitions, children: _jsxs(TooltipProvider, { delayDuration: tooltipDelayDuration, children: [localizedChildren, _jsx(RuntimeConfigNotice, {}), _jsx(RoutedAppEnhancements, {}), toaster] }) }) }));
72
73
  }
73
74
  export function AppProviders({ queryClient, isPublicPath = false, clientOnlyFallback, sessionBypass = false, defaultTheme, themeAttribute, tooltipDelayDuration, toaster, disableThemeTransitions, i18n, children, }) {
74
75
  const fallback = clientOnlyFallback ?? _jsx(DefaultSpinner, {});
@@ -115,7 +115,7 @@ export class AssistantUiStaleIndexErrorBoundary extends React.Component {
115
115
  this.state.recovery.retryCount > MAX_ASSISTANT_UI_RECOVERABLE_RETRIES) {
116
116
  throw this.state.error;
117
117
  }
118
- return this.props.fallback ?? null;
118
+ return this.props.fallback === undefined ? (_jsx(AssistantUiRecoverableRenderFallback, {})) : (this.props.fallback);
119
119
  }
120
120
  const fragmentKey = this.props.remountOnResetKey === false
121
121
  ? String(this.state.retryToken)
@@ -11,7 +11,7 @@ export * from "./runtime.js";
11
11
  export { sendToAgentChat, sendToAgentChatAndConfirm, reportAgentChatSubmitResult, AGENT_CHAT_SUBMIT_RESULT_EVENT, type AgentChatMessage, type AgentChatSubmitResult, type SendToAgentChatAndConfirmResult, } from "../agent-chat.js";
12
12
  export { useAgentChatGenerating } from "../use-agent-chat.js";
13
13
  export { useSendToAgentChat } from "../use-send-to-agent-chat.js";
14
- export { requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, type AgentSidebarStateChangeDetail, type AgentSidebarStateMode, type AgentSidebarStateSource, } from "../agent-sidebar-state.js";
14
+ export { AGENT_SIDEBAR_DEFAULT_MAX_WIDTH, AGENT_SIDEBAR_MIN_WIDTH, AGENT_SIDEBAR_WIDE_WIDTH_RATIO, clampAgentSidebarWidth, getAgentSidebarMaxWidth, getAgentSidebarWideWidth, requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, type AgentSidebarStateChangeDetail, type AgentSidebarStateMode, type AgentSidebarStateSource, } from "../agent-sidebar-state.js";
15
15
  export { clearReservedToolRenderersForTests, clearToolRenderersForTests, registerActionChatRenderer, registerFallbackToolRenderer, registerReservedActionChatRenderer, registerReservedFallbackToolRenderer, registerReservedToolRenderer, registerToolRenderer, resolveToolRenderer, type ActionChatRendererRegistration, type ToolRendererComponent, type ToolRendererContext, type ToolRendererMatch, type ToolRendererProps, type ToolRendererRegistration, } from "./tool-render-registry.js";
16
16
  export { ACTION_CHAT_UI_DATA_CHART_RENDERER, ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER, ACTION_CHAT_UI_DATA_TABLE_RENDERER, ACTION_CHAT_UI_DATA_WIDGET_RENDERER, ACTION_CHAT_UI_INLINE_EXTENSION_RENDERER, ACTION_CHAT_UI_WORKSPACE_FILE_RENDERER, type ActionChatUIConfig, } from "../../action-ui.js";
17
17
  export { DATA_CHART_WIDGET, DATA_INSIGHTS_WIDGET, DATA_TABLE_WIDGET, createDataChartWidgetResult, createDataInsightsWidgetResult, createDataTableWidgetResult, dataChartWidgetResultSchema, dataChartWidgetSchema, dataInsightsWidgetResultSchema, dataTableWidgetResultSchema, dataTableWidgetSchema, dataWidgetResultSchema, isDataChartWidget, isDataTableWidget, isDataWidgetResult, normalizeDataWidgetKind, normalizeDataWidgetResult, type DataChartSeriesDefinition, type DataChartWidget, type DataChartWidgetResult, type DataChartWidgetResultInput, type DataInsightsWidgetResult, type DataInsightsWidgetResultInput, type DataTableColumn, type DataTableWidget, type DataTableWidgetResult, type DataTableWidgetResultInput, type DataWidgetDisplay, type DataWidgetKind, type DataWidgetResult, type DataWidgetResultMetadata, } from "./widgets/data-widget-types.js";
@@ -11,7 +11,7 @@ export * from "./runtime.js";
11
11
  export { sendToAgentChat, sendToAgentChatAndConfirm, reportAgentChatSubmitResult, AGENT_CHAT_SUBMIT_RESULT_EVENT, } from "../agent-chat.js";
12
12
  export { useAgentChatGenerating } from "../use-agent-chat.js";
13
13
  export { useSendToAgentChat } from "../use-send-to-agent-chat.js";
14
- export { requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, } from "../agent-sidebar-state.js";
14
+ export { AGENT_SIDEBAR_DEFAULT_MAX_WIDTH, AGENT_SIDEBAR_MIN_WIDTH, AGENT_SIDEBAR_WIDE_WIDTH_RATIO, clampAgentSidebarWidth, getAgentSidebarMaxWidth, getAgentSidebarWideWidth, requestAgentSidebarOpen, SIDEBAR_STATE_CHANGE_EVENT, setAgentSidebarOpenPreference, } from "../agent-sidebar-state.js";
15
15
  export { clearReservedToolRenderersForTests, clearToolRenderersForTests, registerActionChatRenderer, registerFallbackToolRenderer, registerReservedActionChatRenderer, registerReservedFallbackToolRenderer, registerReservedToolRenderer, registerToolRenderer, resolveToolRenderer, } from "./tool-render-registry.js";
16
16
  export { ACTION_CHAT_UI_DATA_CHART_RENDERER, ACTION_CHAT_UI_DATA_INSIGHTS_RENDERER, ACTION_CHAT_UI_DATA_TABLE_RENDERER, ACTION_CHAT_UI_DATA_WIDGET_RENDERER, ACTION_CHAT_UI_INLINE_EXTENSION_RENDERER, ACTION_CHAT_UI_WORKSPACE_FILE_RENDERER, } from "../../action-ui.js";
17
17
  export { DATA_CHART_WIDGET, DATA_INSIGHTS_WIDGET, DATA_TABLE_WIDGET, createDataChartWidgetResult, createDataInsightsWidgetResult, createDataTableWidgetResult, dataChartWidgetResultSchema, dataChartWidgetSchema, dataInsightsWidgetResultSchema, dataTableWidgetResultSchema, dataTableWidgetSchema, dataWidgetResultSchema, isDataChartWidget, isDataTableWidget, isDataWidgetResult, normalizeDataWidgetKind, normalizeDataWidgetResult, } from "./widgets/data-widget-types.js";
@@ -39,11 +39,12 @@ export declare function useMarkdownReady(): boolean;
39
39
  export declare const MemoizedMarkdownBlock: React.MemoExoticComponent<({ blockText, }: {
40
40
  blockText: string;
41
41
  }) => React.JSX.Element | null>;
42
- export declare function SmoothMarkdownText({ text, streaming, resetKey, statusType, }: {
42
+ export declare function SmoothMarkdownText({ text, streaming, resetKey, statusType, onRevealComplete, }: {
43
43
  text: string;
44
44
  streaming: boolean;
45
45
  resetKey: string;
46
46
  statusType?: string;
47
+ onRevealComplete?: () => void;
47
48
  }): React.JSX.Element;
48
49
  export declare function MarkdownText(): React.JSX.Element;
49
50
  export {};
@@ -236,11 +236,38 @@ function sliceGraphemes(targetText, graphemes, count) {
236
236
  return "";
237
237
  return graphemes.slice(0, count).join("");
238
238
  }
239
+ // Grouped message parts are rebuilt as tool calls arrive. A text part can
240
+ // therefore be unmounted and mounted again even though its identity did not
241
+ // change. Keep the reveal cursor outside that subtree so a structural update
242
+ // continues from the current cursor instead of replaying the opening sentence.
243
+ const smoothStreamingTextCache = new Map();
244
+ function cachedStreamingText(resetKey, targetText) {
245
+ const cached = smoothStreamingTextCache.get(resetKey);
246
+ if (!cached)
247
+ return undefined;
248
+ if (!targetText.startsWith(cached.targetText) ||
249
+ !targetText.startsWith(cached.visibleText)) {
250
+ return undefined;
251
+ }
252
+ return cached.visibleText;
253
+ }
254
+ function rememberStreamingText(resetKey, targetText, visibleText) {
255
+ smoothStreamingTextCache.delete(resetKey);
256
+ smoothStreamingTextCache.set(resetKey, { targetText, visibleText });
257
+ if (smoothStreamingTextCache.size <= 128)
258
+ return;
259
+ const oldestKey = smoothStreamingTextCache.keys().next().value;
260
+ if (oldestKey !== undefined)
261
+ smoothStreamingTextCache.delete(oldestKey);
262
+ }
239
263
  export function useSmoothStreamingText(targetText, streaming, resetKey) {
240
264
  const prefersReducedMotion = usePrefersReducedMotion();
241
265
  const [visibleText, setVisibleText] = useState(() => {
242
266
  if (!streaming || prefersReducedMotion)
243
267
  return targetText;
268
+ const cachedText = cachedStreamingText(resetKey, targetText);
269
+ if (cachedText !== undefined)
270
+ return cachedText;
244
271
  const graphemes = splitStreamingTextGraphemes(targetText);
245
272
  return sliceGraphemes(targetText, graphemes, initialSmoothStreamingGraphemeCount(graphemes));
246
273
  });
@@ -252,7 +279,13 @@ export function useSmoothStreamingText(targetText, streaming, resetKey) {
252
279
  const lastCommitAtRef = useRef(0);
253
280
  const pauseUntilRef = useRef(0);
254
281
  const resetKeyRef = useRef(resetKey);
282
+ const cacheKeyRef = useRef(resetKey);
283
+ const cacheStreamingRef = useRef(streaming);
284
+ const cacheReducedMotionRef = useRef(prefersReducedMotion);
255
285
  const stepRef = useRef(() => { });
286
+ cacheKeyRef.current = resetKey;
287
+ cacheStreamingRef.current = streaming;
288
+ cacheReducedMotionRef.current = prefersReducedMotion;
256
289
  const commitVisibleCount = useCallback((nextCount) => {
257
290
  const graphemes = targetGraphemesRef.current;
258
291
  const boundedCount = Math.max(0, Math.min(nextCount, graphemes.length));
@@ -262,6 +295,9 @@ export function useSmoothStreamingText(targetText, streaming, resetKey) {
262
295
  visibleTextRef.current = nextText;
263
296
  setVisibleText(nextText);
264
297
  }
298
+ if (cacheStreamingRef.current && !cacheReducedMotionRef.current) {
299
+ rememberStreamingText(cacheKeyRef.current, targetTextRef.current, nextText);
300
+ }
265
301
  }, []);
266
302
  const cancelFrame = useCallback(() => {
267
303
  if (frameRef.current != null &&
@@ -353,6 +389,11 @@ export function useSmoothStreamingText(targetText, streaming, resetKey) {
353
389
  commitVisibleCount,
354
390
  scheduleFrame,
355
391
  ]);
392
+ useEffect(() => {
393
+ if (!streaming || prefersReducedMotion)
394
+ return;
395
+ rememberStreamingText(resetKey, targetText, visibleText);
396
+ }, [prefersReducedMotion, resetKey, streaming, targetText, visibleText]);
356
397
  // When the tab returns from background, rAF has been paused and the backlog
357
398
  // may be tens of thousands of characters. Animating from where we left off
358
399
  // would replay minutes of content at the normal rate — instead jump the
@@ -405,12 +446,17 @@ export const MemoizedMarkdownBlock = React.memo(function MemoizedMarkdownBlock({
405
446
  return (_jsx(ReactMarkdown, { remarkPlugins: [gfm], components: markdownComponents, urlTransform: markdownUrlTransform, children: wrapLegacyChartShorthandLines(blockText) }));
406
447
  });
407
448
  // ─── SmoothMarkdownText ────────────────────────────────────────────────────────
408
- export function SmoothMarkdownText({ text, streaming, resetKey, statusType = "complete", }) {
449
+ export function SmoothMarkdownText({ text, streaming, resetKey, statusType = "complete", onRevealComplete, }) {
409
450
  const mdReady = useMarkdownReady();
410
451
  const visibleText = useSmoothStreamingText(text, streaming, resetKey);
411
452
  const isVisuallyStreaming = streaming && visibleText !== text;
412
453
  const ReactMarkdown = markdownModule?.default;
413
454
  const gfm = remarkGfmFn;
455
+ useEffect(() => {
456
+ if (!onRevealComplete || !streaming || visibleText !== text)
457
+ return;
458
+ onRevealComplete();
459
+ }, [onRevealComplete, streaming, text, visibleText]);
414
460
  // Block-memoized rendering: during streaming split the visible text into
415
461
  // stable completed blocks + an in-progress tail. Only the tail re-renders
416
462
  // on every commit; completed blocks are React.memo'd and skipped.
@@ -429,5 +475,5 @@ export function MarkdownText() {
429
475
  const lastMessage = thread.messages[thread.messages.length - 1];
430
476
  const isLastAssistantMessage = message.role === "assistant" && lastMessage?.id === message.id;
431
477
  const statusType = textPart.status?.type ?? message.status?.type ?? "complete";
432
- return (_jsx(SmoothMarkdownText, { text: textPart.text, streaming: textStreaming && isLastAssistantMessage, resetKey: `${message.id}:${statusType}`, statusType: statusType }));
478
+ return (_jsx(SmoothMarkdownText, { text: textPart.text, streaming: textStreaming && isLastAssistantMessage, resetKey: message.id, statusType: statusType }));
433
479
  }
@@ -56,6 +56,8 @@ export declare function MessageActionsMenu({ showRevert, onRevert, }?: {
56
56
  }): React.JSX.Element;
57
57
  export declare function UserMessage(): React.JSX.Element | null;
58
58
  export declare function messageTextFromContent(content: unknown): string;
59
+ export declare function isMissingFinalResponseWarningText(text: string): boolean;
60
+ export declare function completedAssistantToolNamesAfterLastText(content: readonly ContentPart[]): string[];
59
61
  export declare function latestUserMessageText(messages: readonly unknown[]): string;
60
62
  export declare function userMessageTextBeforeAssistant(messages: readonly unknown[], assistantMessageId: string): string;
61
63
  export declare function assistantMessageHasUnresolvedTool(content: unknown): boolean;
@@ -95,6 +97,10 @@ export declare function shouldShowAssistantWorkSummary({ isLast, isComplete, has
95
97
  hasUnresolvedTool: boolean;
96
98
  chatRunning: boolean;
97
99
  }): boolean;
100
+ export declare function isAlwaysVisibleAssistantTool(part: {
101
+ type?: unknown;
102
+ toolName?: unknown;
103
+ }): boolean;
98
104
  export declare function isCollapsibleAssistantWorkPart(part: {
99
105
  type?: string;
100
106
  toolName?: string;