@agent-native/core 0.9.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/README.md +4 -4
  2. package/dist/a2a/caller-auth.d.ts +12 -0
  3. package/dist/a2a/caller-auth.d.ts.map +1 -0
  4. package/dist/a2a/caller-auth.js +54 -0
  5. package/dist/a2a/caller-auth.js.map +1 -0
  6. package/dist/action.d.ts +17 -0
  7. package/dist/action.d.ts.map +1 -1
  8. package/dist/action.js +22 -0
  9. package/dist/action.js.map +1 -1
  10. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  11. package/dist/agent/engine/builder-engine.js +5 -4
  12. package/dist/agent/engine/builder-engine.js.map +1 -1
  13. package/dist/agent/engine/registry.d.ts +6 -3
  14. package/dist/agent/engine/registry.d.ts.map +1 -1
  15. package/dist/agent/engine/registry.js +8 -17
  16. package/dist/agent/engine/registry.js.map +1 -1
  17. package/dist/agent/production-agent.d.ts +1 -1
  18. package/dist/agent/production-agent.d.ts.map +1 -1
  19. package/dist/agent/production-agent.js +60 -30
  20. package/dist/agent/production-agent.js.map +1 -1
  21. package/dist/agent/run-manager.d.ts.map +1 -1
  22. package/dist/agent/run-manager.js +12 -3
  23. package/dist/agent/run-manager.js.map +1 -1
  24. package/dist/agent/thread-data-builder.d.ts +12 -0
  25. package/dist/agent/thread-data-builder.d.ts.map +1 -1
  26. package/dist/agent/thread-data-builder.js +96 -0
  27. package/dist/agent/thread-data-builder.js.map +1 -1
  28. package/dist/cli/create.d.ts.map +1 -1
  29. package/dist/cli/create.js +16 -10
  30. package/dist/cli/create.js.map +1 -1
  31. package/dist/client/AgentPanel.d.ts.map +1 -1
  32. package/dist/client/AgentPanel.js +8 -22
  33. package/dist/client/AgentPanel.js.map +1 -1
  34. package/dist/client/AssistantChat.d.ts.map +1 -1
  35. package/dist/client/AssistantChat.js +130 -34
  36. package/dist/client/AssistantChat.js.map +1 -1
  37. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  38. package/dist/client/agent-chat-adapter.js +21 -7
  39. package/dist/client/agent-chat-adapter.js.map +1 -1
  40. package/dist/client/agent-sidebar-state.d.ts +3 -0
  41. package/dist/client/agent-sidebar-state.d.ts.map +1 -0
  42. package/dist/client/agent-sidebar-state.js +24 -0
  43. package/dist/client/agent-sidebar-state.js.map +1 -0
  44. package/dist/client/analytics.d.ts +25 -0
  45. package/dist/client/analytics.d.ts.map +1 -1
  46. package/dist/client/analytics.js +40 -0
  47. package/dist/client/analytics.js.map +1 -1
  48. package/dist/client/components/ui/dropdown-menu.d.ts +28 -0
  49. package/dist/client/components/ui/dropdown-menu.d.ts.map +1 -0
  50. package/dist/client/components/ui/dropdown-menu.js +34 -0
  51. package/dist/client/components/ui/dropdown-menu.js.map +1 -0
  52. package/dist/client/components/ui/tooltip.d.ts +2 -1
  53. package/dist/client/components/ui/tooltip.d.ts.map +1 -1
  54. package/dist/client/components/ui/tooltip.js +9 -2
  55. package/dist/client/components/ui/tooltip.js.map +1 -1
  56. package/dist/client/composer/ComposerPlusMenu.d.ts.map +1 -1
  57. package/dist/client/composer/ComposerPlusMenu.js +41 -8
  58. package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
  59. package/dist/client/composer/PromptComposer.d.ts.map +1 -1
  60. package/dist/client/composer/PromptComposer.js +30 -0
  61. package/dist/client/composer/PromptComposer.js.map +1 -1
  62. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  63. package/dist/client/composer/TiptapComposer.js +27 -2
  64. package/dist/client/composer/TiptapComposer.js.map +1 -1
  65. package/dist/client/dev-overlay/DevOverlay.d.ts.map +1 -1
  66. package/dist/client/dev-overlay/DevOverlay.js +4 -4
  67. package/dist/client/dev-overlay/DevOverlay.js.map +1 -1
  68. package/dist/client/error-format.d.ts.map +1 -1
  69. package/dist/client/error-format.js +6 -0
  70. package/dist/client/error-format.js.map +1 -1
  71. package/dist/client/extensions/EmbeddedExtension.d.ts.map +1 -1
  72. package/dist/client/extensions/EmbeddedExtension.js +16 -4
  73. package/dist/client/extensions/EmbeddedExtension.js.map +1 -1
  74. package/dist/client/extensions/ExtensionEditor.d.ts.map +1 -1
  75. package/dist/client/extensions/ExtensionEditor.js +6 -6
  76. package/dist/client/extensions/ExtensionEditor.js.map +1 -1
  77. package/dist/client/extensions/ExtensionSlot.d.ts.map +1 -1
  78. package/dist/client/extensions/ExtensionSlot.js +15 -2
  79. package/dist/client/extensions/ExtensionSlot.js.map +1 -1
  80. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  81. package/dist/client/extensions/ExtensionViewer.js +41 -19
  82. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  83. package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
  84. package/dist/client/extensions/ExtensionsListPage.js +2 -2
  85. package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
  86. package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
  87. package/dist/client/extensions/ExtensionsSidebarSection.js +52 -63
  88. package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
  89. package/dist/client/extensions/iframe-bridge.d.ts.map +1 -1
  90. package/dist/client/extensions/iframe-bridge.js +5 -8
  91. package/dist/client/extensions/iframe-bridge.js.map +1 -1
  92. package/dist/client/index.d.ts +1 -1
  93. package/dist/client/index.d.ts.map +1 -1
  94. package/dist/client/index.js +1 -1
  95. package/dist/client/index.js.map +1 -1
  96. package/dist/client/notifications/NotificationsBell.d.ts.map +1 -1
  97. package/dist/client/notifications/NotificationsBell.js +42 -6
  98. package/dist/client/notifications/NotificationsBell.js.map +1 -1
  99. package/dist/client/org/InvitationBanner.d.ts.map +1 -1
  100. package/dist/client/org/InvitationBanner.js +5 -5
  101. package/dist/client/org/InvitationBanner.js.map +1 -1
  102. package/dist/client/org/OrgSwitcher.d.ts +7 -1
  103. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  104. package/dist/client/org/OrgSwitcher.js +8 -3
  105. package/dist/client/org/OrgSwitcher.js.map +1 -1
  106. package/dist/client/org/TeamPage.d.ts.map +1 -1
  107. package/dist/client/org/TeamPage.js +156 -22
  108. package/dist/client/org/TeamPage.js.map +1 -1
  109. package/dist/client/org/hooks.d.ts +29 -1
  110. package/dist/client/org/hooks.d.ts.map +1 -1
  111. package/dist/client/org/hooks.js +39 -2
  112. package/dist/client/org/hooks.js.map +1 -1
  113. package/dist/client/org/index.d.ts +2 -1
  114. package/dist/client/org/index.d.ts.map +1 -1
  115. package/dist/client/org/index.js +1 -1
  116. package/dist/client/org/index.js.map +1 -1
  117. package/dist/client/resources/ResourceTree.d.ts.map +1 -1
  118. package/dist/client/resources/ResourceTree.js +11 -3
  119. package/dist/client/resources/ResourceTree.js.map +1 -1
  120. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  121. package/dist/client/resources/ResourcesPanel.js +62 -12
  122. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  123. package/dist/client/resources/use-mcp-servers.d.ts +2 -0
  124. package/dist/client/resources/use-mcp-servers.d.ts.map +1 -1
  125. package/dist/client/resources/use-mcp-servers.js +59 -3
  126. package/dist/client/resources/use-mcp-servers.js.map +1 -1
  127. package/dist/client/settings/SecretsSection.d.ts.map +1 -1
  128. package/dist/client/settings/SecretsSection.js +9 -0
  129. package/dist/client/settings/SecretsSection.js.map +1 -1
  130. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  131. package/dist/client/settings/SettingsPanel.js +50 -12
  132. package/dist/client/settings/SettingsPanel.js.map +1 -1
  133. package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -1
  134. package/dist/client/settings/VoiceTranscriptionSection.js +13 -30
  135. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -1
  136. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
  137. package/dist/client/settings/useBuilderStatus.js +27 -1
  138. package/dist/client/settings/useBuilderStatus.js.map +1 -1
  139. package/dist/client/sharing/ShareButton.d.ts +4 -0
  140. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  141. package/dist/client/sharing/ShareButton.js +5 -1
  142. package/dist/client/sharing/ShareButton.js.map +1 -1
  143. package/dist/client/sse-event-processor.d.ts +1 -1
  144. package/dist/client/sse-event-processor.d.ts.map +1 -1
  145. package/dist/client/sse-event-processor.js +14 -7
  146. package/dist/client/sse-event-processor.js.map +1 -1
  147. package/dist/client/use-db-sync.d.ts.map +1 -1
  148. package/dist/client/use-db-sync.js +100 -19
  149. package/dist/client/use-db-sync.js.map +1 -1
  150. package/dist/deploy/build.d.ts.map +1 -1
  151. package/dist/deploy/build.js +25 -49
  152. package/dist/deploy/build.js.map +1 -1
  153. package/dist/deploy/route-discovery.d.ts.map +1 -1
  154. package/dist/deploy/route-discovery.js +1 -0
  155. package/dist/deploy/route-discovery.js.map +1 -1
  156. package/dist/deploy/workspace-core.d.ts +1 -1
  157. package/dist/deploy/workspace-core.d.ts.map +1 -1
  158. package/dist/deploy/workspace-core.js +1 -0
  159. package/dist/deploy/workspace-core.js.map +1 -1
  160. package/dist/extensions/actions.d.ts.map +1 -1
  161. package/dist/extensions/actions.js +17 -3
  162. package/dist/extensions/actions.js.map +1 -1
  163. package/dist/extensions/routes.js +1 -1
  164. package/dist/extensions/routes.js.map +1 -1
  165. package/dist/extensions/schema.d.ts +14 -14
  166. package/dist/extensions/schema.d.ts.map +1 -1
  167. package/dist/extensions/schema.js +4 -4
  168. package/dist/extensions/schema.js.map +1 -1
  169. package/dist/extensions/store.d.ts.map +1 -1
  170. package/dist/extensions/store.js +23 -0
  171. package/dist/extensions/store.js.map +1 -1
  172. package/dist/extensions/theme.d.ts +8 -1
  173. package/dist/extensions/theme.d.ts.map +1 -1
  174. package/dist/extensions/theme.js +43 -34
  175. package/dist/extensions/theme.js.map +1 -1
  176. package/dist/index.browser.d.ts +1 -1
  177. package/dist/index.browser.d.ts.map +1 -1
  178. package/dist/index.browser.js +1 -1
  179. package/dist/index.browser.js.map +1 -1
  180. package/dist/index.d.ts +1 -1
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.js +1 -1
  183. package/dist/index.js.map +1 -1
  184. package/dist/mcp-client/routes.d.ts +1 -0
  185. package/dist/mcp-client/routes.d.ts.map +1 -1
  186. package/dist/mcp-client/routes.js +28 -1
  187. package/dist/mcp-client/routes.js.map +1 -1
  188. package/dist/org/accept-pending.d.ts.map +1 -1
  189. package/dist/org/accept-pending.js +5 -3
  190. package/dist/org/accept-pending.js.map +1 -1
  191. package/dist/org/free-email-providers.d.ts +18 -0
  192. package/dist/org/free-email-providers.d.ts.map +1 -0
  193. package/dist/org/free-email-providers.js +124 -0
  194. package/dist/org/free-email-providers.js.map +1 -0
  195. package/dist/org/handlers.d.ts +29 -5
  196. package/dist/org/handlers.d.ts.map +1 -1
  197. package/dist/org/handlers.js +178 -37
  198. package/dist/org/handlers.js.map +1 -1
  199. package/dist/org/index.d.ts +2 -1
  200. package/dist/org/index.d.ts.map +1 -1
  201. package/dist/org/index.js +2 -1
  202. package/dist/org/index.js.map +1 -1
  203. package/dist/org/migrations.d.ts.map +1 -1
  204. package/dist/org/migrations.js +4 -0
  205. package/dist/org/migrations.js.map +1 -1
  206. package/dist/org/plugin.d.ts.map +1 -1
  207. package/dist/org/plugin.js +13 -4
  208. package/dist/org/plugin.js.map +1 -1
  209. package/dist/org/schema.d.ts +19 -0
  210. package/dist/org/schema.d.ts.map +1 -1
  211. package/dist/org/schema.js +1 -0
  212. package/dist/org/schema.js.map +1 -1
  213. package/dist/org/types.d.ts +1 -0
  214. package/dist/org/types.d.ts.map +1 -1
  215. package/dist/org/types.js.map +1 -1
  216. package/dist/resources/metadata.d.ts +1 -0
  217. package/dist/resources/metadata.d.ts.map +1 -1
  218. package/dist/resources/metadata.js +13 -3
  219. package/dist/resources/metadata.js.map +1 -1
  220. package/dist/resources/store.d.ts.map +1 -1
  221. package/dist/resources/store.js +44 -6
  222. package/dist/resources/store.js.map +1 -1
  223. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  224. package/dist/server/agent-chat-plugin.js +115 -113
  225. package/dist/server/agent-chat-plugin.js.map +1 -1
  226. package/dist/server/auth.d.ts.map +1 -1
  227. package/dist/server/auth.js +33 -0
  228. package/dist/server/auth.js.map +1 -1
  229. package/dist/server/builder-browser.d.ts.map +1 -1
  230. package/dist/server/builder-browser.js +169 -68
  231. package/dist/server/builder-browser.js.map +1 -1
  232. package/dist/server/credential-provider.d.ts +2 -2
  233. package/dist/server/credential-provider.d.ts.map +1 -1
  234. package/dist/server/credential-provider.js +31 -12
  235. package/dist/server/credential-provider.js.map +1 -1
  236. package/dist/server/framework-request-handler.d.ts.map +1 -1
  237. package/dist/server/framework-request-handler.js +31 -0
  238. package/dist/server/framework-request-handler.js.map +1 -1
  239. package/dist/server/google-oauth.d.ts.map +1 -1
  240. package/dist/server/google-oauth.js +10 -3
  241. package/dist/server/google-oauth.js.map +1 -1
  242. package/dist/server/google-realtime-session.d.ts.map +1 -1
  243. package/dist/server/google-realtime-session.js +19 -6
  244. package/dist/server/google-realtime-session.js.map +1 -1
  245. package/dist/server/index.d.ts +2 -0
  246. package/dist/server/index.d.ts.map +1 -1
  247. package/dist/server/index.js +2 -0
  248. package/dist/server/index.js.map +1 -1
  249. package/dist/server/onboarding-html.d.ts.map +1 -1
  250. package/dist/server/onboarding-html.js +45 -6
  251. package/dist/server/onboarding-html.js.map +1 -1
  252. package/dist/server/request-context.d.ts +17 -0
  253. package/dist/server/request-context.d.ts.map +1 -1
  254. package/dist/server/request-context.js +40 -1
  255. package/dist/server/request-context.js.map +1 -1
  256. package/dist/server/sentry-plugin.d.ts +11 -0
  257. package/dist/server/sentry-plugin.d.ts.map +1 -0
  258. package/dist/server/sentry-plugin.js +116 -0
  259. package/dist/server/sentry-plugin.js.map +1 -0
  260. package/dist/server/sentry.d.ts +92 -0
  261. package/dist/server/sentry.d.ts.map +1 -0
  262. package/dist/server/sentry.js +287 -0
  263. package/dist/server/sentry.js.map +1 -0
  264. package/dist/server/transcribe-voice.d.ts +2 -4
  265. package/dist/server/transcribe-voice.d.ts.map +1 -1
  266. package/dist/server/transcribe-voice.js +4 -16
  267. package/dist/server/transcribe-voice.js.map +1 -1
  268. package/dist/server/voice-providers-status.d.ts.map +1 -1
  269. package/dist/server/voice-providers-status.js +19 -35
  270. package/dist/server/voice-providers-status.js.map +1 -1
  271. package/dist/styles/agent-native.css +15 -0
  272. package/docs/content/cloneable-saas.md +7 -9
  273. package/docs/content/deployment.md +6 -2
  274. package/docs/content/dispatch.md +1 -1
  275. package/docs/content/extensions.md +177 -142
  276. package/docs/content/faq.md +2 -2
  277. package/docs/content/getting-started.md +13 -11
  278. package/docs/content/multi-app-workspace.md +2 -2
  279. package/docs/content/observability.md +47 -0
  280. package/docs/content/pure-agent-apps.md +1 -1
  281. package/docs/content/template-clips.md +3 -3
  282. package/docs/content/template-design.md +3 -3
  283. package/docs/content/template-dispatch.md +1 -1
  284. package/docs/content/template-forms.md +1 -1
  285. package/docs/content/template-mail.md +1 -1
  286. package/docs/content/what-is-agent-native.md +4 -4
  287. package/docs/content/workspace.md +1 -1
  288. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantChat.d.ts","sourceRoot":"","sources":["../../src/client/AssistantChat.tsx"],"names":[],"mappings":"AACA,OAAO,KAQN,MAAM,OAAO,CAAC;AA6Bf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAq0DrE,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,6DAA6D;IAC7D,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,4CAA4C;IAC5C,SAAS,IAAI,OAAO,CAAC;IACrB,+BAA+B;IAC/B,aAAa,IAAI,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE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FAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,uDAAuD;IACvD,eAAe,CAAC,EAAE,KAAK,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC,CAAC;IACH,uDAAuD;IACvD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,kEAAkE;IAClE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IACnD,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAEjD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,QAI9C;AAqCD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAosC7B,eAAO,MAAM,aAAa,gGA4DxB,CAAC"}
@@ -109,6 +109,8 @@ const markdownStyles = `
109
109
  * below tells the user the context is attached and lets them clear it.
110
110
  */
111
111
  const PENDING_SELECTION_KEY = "pending-selection-context";
112
+ const ACTIVE_RUN_CLEAR_TIMEOUT_MS = 5_000;
113
+ const ACTIVE_RUN_POLL_INTERVAL_MS = 150;
112
114
  function clearPendingSelection() {
113
115
  fetch(agentNativePath(`/_agent-native/application-state/${PENDING_SELECTION_KEY}`), {
114
116
  method: "DELETE",
@@ -119,6 +121,29 @@ function clearPendingSelection() {
119
121
  window.dispatchEvent(new CustomEvent("agent-panel:selection-cleared"));
120
122
  }
121
123
  }
124
+ async function waitForThreadRunToClear(apiUrl, threadId) {
125
+ if (!threadId)
126
+ return;
127
+ const deadline = Date.now() + ACTIVE_RUN_CLEAR_TIMEOUT_MS;
128
+ while (Date.now() < deadline) {
129
+ try {
130
+ const res = await fetch(`${apiUrl}/runs/active?threadId=${encodeURIComponent(threadId)}`);
131
+ if (res.ok) {
132
+ const info = await res.json();
133
+ const heartbeatAt = typeof info?.heartbeatAt === "number" ? info.heartbeatAt : null;
134
+ const stale = info?.status === "running" &&
135
+ heartbeatAt != null &&
136
+ Date.now() - heartbeatAt > 5000;
137
+ if (!info?.active || info?.status !== "running" || stale)
138
+ return;
139
+ }
140
+ }
141
+ catch {
142
+ // Transient poll failure — try again until the short grace period ends.
143
+ }
144
+ await new Promise((resolve) => window.setTimeout(resolve, ACTIVE_RUN_POLL_INTERVAL_MS));
145
+ }
146
+ }
122
147
  function SelectionAttachedPill() {
123
148
  const [length, setLength] = useState(null);
124
149
  useEffect(() => {
@@ -741,19 +766,17 @@ function ThinkingIndicator({ label = "Thinking" } = {}) {
741
766
  // Renders a single row with left-aligned copy and a right-aligned action.
742
767
  // Click opens the Builder CLI-auth popup via the shared
743
768
  // `useBuilderConnectFlow` hook (which owns the synchronous window.open,
744
- // the 2s status poll, and the focus-refresh). On success we reload so the
745
- // enclosing card re-evaluates `missingApiKey` against the fresh credentials.
769
+ // the 2s status poll, and the focus-refresh). On success the hook broadcasts
770
+ // a config-change event and this card clears its local `missingApiKey` gate
771
+ // so the user can start chatting without a full-page reload.
746
772
  //
747
773
  // Desktop note: when this component runs inside the Electron shell, the
748
774
  // window.open call is intercepted by the main process's webview popup handler,
749
775
  // which opens the flow in an Electron BrowserWindow that shares the webview's
750
776
  // session. See packages/desktop-app/src/main/index.ts.
751
- function BuilderConnectCta({ variant = "primary", }) {
777
+ function BuilderConnectCta({ variant = "primary", onConnected, }) {
752
778
  const { configured, orgName, connecting, error, start } = useBuilderConnectFlow({
753
- onConnected: () => {
754
- // Reload so the enclosing card re-evaluates `missingApiKey`.
755
- window.setTimeout(() => window.location.reload(), 300);
756
- },
779
+ onConnected,
757
780
  });
758
781
  const containerClass = variant === "compact"
759
782
  ? "rounded-md border border-border px-3 py-2.5"
@@ -764,8 +787,25 @@ function BuilderConnectCta({ variant = "primary", }) {
764
787
  return (_jsxs("div", { className: containerClass, children: [_jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "text-xs font-medium text-foreground", children: "Connect Builder.io" }), _jsx("p", { className: "text-[11px] text-muted-foreground mt-0.5 max-w-[220px]", children: "Free credits for LLM, hosting, and more \u2014 no API key needed" }), error && _jsx("p", { className: "mt-1 text-[10px] text-destructive", children: error })] }), _jsx("button", { type: "button", onClick: start, disabled: connecting, className: "ml-auto inline-flex items-center gap-1 shrink-0 rounded-md bg-foreground px-3 py-1.5 text-[11px] font-medium no-underline text-background hover:opacity-90 disabled:opacity-60 disabled:cursor-wait", "aria-busy": connecting, children: connecting ? (_jsxs(_Fragment, { children: [_jsx(IconLoader2, { size: 10, className: "animate-spin" }), "Waiting\u2026"] })) : (_jsxs(_Fragment, { children: ["Connect", _jsx(IconExternalLink, { size: 10 })] })) })] }));
765
788
  }
766
789
  // ─── Builder Setup Card ─────────────────────────────────────────────────────
767
- function BuilderSetupCard() {
768
- return (_jsxs("div", { className: "mx-4 my-6 rounded-lg border border-border bg-card p-5", children: [_jsxs("div", { className: "flex items-center gap-3 mb-3", children: [_jsx("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-muted", children: _jsx(IconMessage, { className: "h-4.5 w-4.5 text-muted-foreground" }) }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-medium text-foreground", children: "Connect Builder.io" }), _jsx("p", { className: "mt-0.5 text-[11px] text-muted-foreground", children: "Use the hosted agent without adding a separate model provider key." })] })] }), _jsx("div", { className: "space-y-3", children: _jsx(BuilderConnectCta, {}) })] }));
790
+ function BuilderSetupCard({ onConnected, bouncePulse, }) {
791
+ const openSettings = useCallback(() => {
792
+ window.dispatchEvent(new CustomEvent("agent-panel:open-settings"));
793
+ }, []);
794
+ const cardRef = useRef(null);
795
+ // Replay the bounce keyframe each time bouncePulse increments. Toggling the
796
+ // class off-then-on (with a forced reflow) restarts the animation even when
797
+ // the value changes back-to-back.
798
+ useEffect(() => {
799
+ if (!bouncePulse)
800
+ return;
801
+ const el = cardRef.current;
802
+ if (!el)
803
+ return;
804
+ el.classList.remove("animate-bounce-once");
805
+ void el.offsetWidth;
806
+ el.classList.add("animate-bounce-once");
807
+ }, [bouncePulse]);
808
+ return (_jsxs("div", { ref: cardRef, className: "mx-4 my-6 rounded-lg border border-border bg-card p-5", children: [_jsxs("div", { className: "flex items-center gap-3 mb-3", children: [_jsx("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-muted", children: _jsx(IconMessage, { className: "h-4.5 w-4.5 text-muted-foreground" }) }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-medium text-foreground", children: "Connect an LLM" }), _jsx("p", { className: "mt-0.5 text-[11px] text-muted-foreground", children: "Use the hosted agent without adding a separate model provider key." })] })] }), _jsxs("div", { className: "space-y-3", children: [_jsx(BuilderConnectCta, { onConnected: onConnected }), _jsx("div", { className: "text-center", children: _jsx("button", { type: "button", onClick: openSettings, className: "text-[11px] text-muted-foreground underline-offset-2 hover:text-foreground hover:underline", children: "Or add your own API key" }) })] })] }));
769
809
  }
770
810
  function getLoopLimitMetadata(message) {
771
811
  const meta = message?.metadata;
@@ -949,8 +989,17 @@ function ensureMessageMetadata(repo) {
949
989
  if (!msg.metadata) {
950
990
  msg.metadata = {};
951
991
  }
952
- if (msg.role === "assistant" && !msg.status) {
953
- msg.status = { type: "complete", reason: "stop" };
992
+ if (msg.role === "assistant") {
993
+ const statusType = msg.status && typeof msg.status === "object"
994
+ ? msg.status.type
995
+ : undefined;
996
+ const isTerminal = statusType === "complete" || statusType === "incomplete";
997
+ if (!isTerminal) {
998
+ const runError = msg.metadata?.custom?.runError ?? msg.metadata?.runError;
999
+ msg.status = runError
1000
+ ? { type: "incomplete", reason: "error" }
1001
+ : { type: "complete", reason: "stop" };
1002
+ }
954
1003
  }
955
1004
  }
956
1005
  return repo;
@@ -965,6 +1014,9 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
965
1014
  const isRuntimeRunning = thread.isRunning;
966
1015
  const messages = thread.messages;
967
1016
  const [missingApiKey, setMissingApiKey] = useState(false);
1017
+ // Increments each time the user clicks the (disabled) composer while no LLM
1018
+ // is connected — `BuilderSetupCard` watches this to replay a one-shot bounce.
1019
+ const [missingKeyBouncePulse, setMissingKeyBouncePulse] = useState(0);
968
1020
  const [authError, setAuthError] = useState(null);
969
1021
  const [queuedMessages, setQueuedMessages] = useState([]);
970
1022
  // Tracks the JSON of the last queue we successfully persisted so the
@@ -975,6 +1027,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
975
1027
  const [loopLimitInfo, setLoopLimitInfo] = useState(null);
976
1028
  const [runErrorInfo, setRunErrorInfo] = useState(null);
977
1029
  const [dismissedRunErrorKey, setDismissedRunErrorKey] = useState(null);
1030
+ const userStoppedRunRef = useRef(null);
978
1031
  const [isReconnecting, setIsReconnecting] = useState(false);
979
1032
  const [reconnectContent, setReconnectContent] = useState([]);
980
1033
  // When stop is clicked during reconnect, keep content visible (don't wipe it)
@@ -1358,6 +1411,9 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1358
1411
  window.addEventListener("agent-chat:missing-api-key", handler);
1359
1412
  return () => window.removeEventListener("agent-chat:missing-api-key", handler);
1360
1413
  }, []);
1414
+ const handleBuilderConnected = useCallback(() => {
1415
+ setMissingApiKey(false);
1416
+ }, []);
1361
1417
  // Check on mount and whenever SettingsPanel dispatches
1362
1418
  // `agent-engine:configured-changed` so the gate flips live without reload.
1363
1419
  useEffect(() => {
@@ -1427,6 +1483,12 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1427
1483
  return;
1428
1484
  if (!detail?.message)
1429
1485
  return;
1486
+ const stopped = userStoppedRunRef.current;
1487
+ if (stopped &&
1488
+ Date.now() - stopped.at < 10_000 &&
1489
+ (!stopped.runId || !detail.runId || stopped.runId === detail.runId)) {
1490
+ return;
1491
+ }
1430
1492
  setRunErrorInfo({
1431
1493
  message: detail.message,
1432
1494
  ...(detail.details ? { details: detail.details } : {}),
@@ -1446,23 +1508,30 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1446
1508
  setQueuedMessages(rest);
1447
1509
  // Small delay to let the runtime settle after completion
1448
1510
  setTimeout(() => {
1449
- const content = [{ type: "text", text: next.text }];
1450
- if (next.images) {
1451
- for (const img of next.images) {
1452
- content.push({ type: "image", image: img });
1511
+ void (async () => {
1512
+ // In serverless/cross-isolate deployments the client can receive the
1513
+ // terminal SSE event a beat before SQL has marked the previous run
1514
+ // complete. Starting the queued turn during that window can reconnect
1515
+ // to the old run and replay the old answer under the new prompt.
1516
+ await waitForThreadRunToClear(apiUrl, threadId);
1517
+ const content = [{ type: "text", text: next.text }];
1518
+ if (next.images) {
1519
+ for (const img of next.images) {
1520
+ content.push({ type: "image", image: img });
1521
+ }
1453
1522
  }
1454
- }
1455
- threadRuntime.append({
1456
- role: "user",
1457
- content,
1458
- ...(next.references && next.references.length > 0
1459
- ? { runConfig: { custom: { references: next.references } } }
1460
- : {}),
1461
- });
1523
+ threadRuntime.append({
1524
+ role: "user",
1525
+ content,
1526
+ ...(next.references && next.references.length > 0
1527
+ ? { runConfig: { custom: { references: next.references } } }
1528
+ : {}),
1529
+ });
1530
+ })();
1462
1531
  }, 100);
1463
1532
  }
1464
1533
  wasRunningRef.current = isRunning;
1465
- }, [isRunning, queuedMessages, threadRuntime]);
1534
+ }, [apiUrl, isRunning, queuedMessages, threadId, threadRuntime]);
1466
1535
  // Clear frozen reconnect content + forceStopped only on the false→true
1467
1536
  // transition of isRuntimeRunning (i.e. a NEW run is actually starting).
1468
1537
  // Reacting to "isRuntimeRunning is currently true" would clear the
@@ -1497,6 +1566,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1497
1566
  setLoopLimitInfo(null);
1498
1567
  setRunErrorInfo(null);
1499
1568
  setDismissedRunErrorKey(null);
1569
+ userStoppedRunRef.current = null;
1500
1570
  // Selection context attached via Cmd+I is one-shot — clear it as soon
1501
1571
  // as the user actually sends a message so it can't be re-used.
1502
1572
  clearPendingSelection();
@@ -1564,23 +1634,34 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1564
1634
  setShowScrollToBottom(false);
1565
1635
  }
1566
1636
  }, []);
1637
+ const scrollToBottomAfterPaint = useCallback(() => {
1638
+ scrollToBottom();
1639
+ requestAnimationFrame(() => {
1640
+ scrollToBottom();
1641
+ requestAnimationFrame(scrollToBottom);
1642
+ });
1643
+ setTimeout(scrollToBottom, 80);
1644
+ }, [scrollToBottom]);
1567
1645
  // Scroll to bottom when a restored thread finishes loading
1568
1646
  const wasRestoringRef = useRef(isRestoring);
1569
1647
  useEffect(() => {
1570
1648
  if (wasRestoringRef.current && !isRestoring) {
1571
- requestAnimationFrame(() => {
1572
- scrollToBottom();
1573
- });
1649
+ scrollToBottomAfterPaint();
1574
1650
  }
1575
1651
  wasRestoringRef.current = isRestoring;
1576
- }, [isRestoring, scrollToBottom]);
1652
+ }, [isRestoring, scrollToBottomAfterPaint]);
1577
1653
  // Auto-scroll on new messages or queued messages (only if near bottom)
1578
1654
  useEffect(() => {
1579
1655
  const el = scrollRef.current;
1580
1656
  if (el && isNearBottomRef.current) {
1581
- el.scrollTop = el.scrollHeight;
1657
+ scrollToBottomAfterPaint();
1658
+ }
1659
+ }, [messages, queuedMessages, scrollToBottomAfterPaint]);
1660
+ useEffect(() => {
1661
+ if (!isRunning && isNearBottomRef.current) {
1662
+ scrollToBottomAfterPaint();
1582
1663
  }
1583
- }, [messages, queuedMessages]);
1664
+ }, [isRunning, scrollToBottomAfterPaint]);
1584
1665
  // Continuous auto-scroll while streaming (only if near bottom)
1585
1666
  useEffect(() => {
1586
1667
  if (!isRunning)
@@ -1626,7 +1707,12 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1626
1707
  : null;
1627
1708
  const shouldShowRunError = !!visibleRunError &&
1628
1709
  !showRunningInUI &&
1629
- visibleRunErrorKey !== dismissedRunErrorKey;
1710
+ visibleRunErrorKey !== dismissedRunErrorKey &&
1711
+ !(userStoppedRunRef.current &&
1712
+ Date.now() - userStoppedRunRef.current.at < 10_000 &&
1713
+ (!userStoppedRunRef.current.runId ||
1714
+ !visibleRunError.runId ||
1715
+ userStoppedRunRef.current.runId === visibleRunError.runId));
1630
1716
  return (_jsx(CheckpointContext.Provider, { value: checkpointCtx, children: _jsx(MessageActionsContext.Provider, { value: messageActionsCtx, children: _jsx(ChatRunningContext.Provider, { value: isRunning, children: _jsxs("div", { className: cn("flex flex-1 flex-col h-full min-h-0 text-foreground", className), children: [showHeader && (_jsxs("div", { className: "flex h-11 shrink-0 items-center justify-between border-b border-border px-4", children: [_jsx("span", { className: "text-[13px] font-medium text-muted-foreground", children: "Agent" }), _jsx("div", { className: "flex items-center gap-1", children: onSwitchToCli && (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { onClick: onSwitchToCli, "aria-label": "Switch to CLI", className: "flex items-center gap-1 text-[12px] text-muted-foreground hover:text-foreground px-2 py-1 rounded-md hover:bg-accent", children: [_jsx(IconTerminal, { className: "h-3.5 w-3.5" }), "CLI"] }) }), _jsx(TooltipContent, { children: "Switch to CLI" })] }) })) })] })), _jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto overflow-x-hidden min-h-0", children: authError ? (_jsxs("div", { className: "flex flex-col items-center justify-center h-full px-4 gap-3", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-destructive/10", children: _jsx(IconLock, { className: "h-5 w-5 text-destructive" }) }), _jsxs("div", { className: "text-center max-w-[280px]", children: [_jsx("p", { className: "text-sm font-medium text-foreground mb-1", children: authError.sessionExpired
1631
1717
  ? "Session expired"
1632
1718
  : "Authentication required" }), _jsx("p", { className: "text-xs text-muted-foreground leading-relaxed", children: authError.sessionExpired
@@ -1647,7 +1733,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1647
1733
  }, className: "text-xs text-destructive hover:text-destructive/80 px-3 py-1.5 rounded-md border border-destructive/30 hover:bg-destructive/10", children: "Log out" })), _jsx("button", { onClick: () => {
1648
1734
  setAuthError(null);
1649
1735
  window.location.reload();
1650
- }, className: "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md border border-border hover:bg-accent", children: "Retry" })] })] })) : missingApiKey && messages.length === 0 ? (_jsx("div", { className: "flex flex-col items-center justify-center h-full px-2", children: _jsx(BuilderSetupCard, {}) })) : isRestoring ? (_jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "flex justify-end", children: _jsx("div", { className: "h-8 w-32 rounded-lg bg-muted animate-pulse" }) }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("div", { className: "h-4 w-48 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-64 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-40 rounded bg-muted animate-pulse" })] })] })) : messages.length === 0 && !isReconnecting ? (_jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-16 px-4 h-full", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-muted", children: _jsx(IconMessage, { className: "h-5 w-5 text-muted-foreground" }) }), _jsx("p", { className: "text-sm text-muted-foreground text-center max-w-[240px]", children: emptyStateText ?? "How can I help you?" }), suggestions && suggestions.length > 0 && (_jsx("div", { className: "flex flex-col gap-1.5 w-full max-w-[280px]", children: suggestions.map((suggestion) => (_jsx("button", { onClick: () => {
1736
+ }, className: "text-xs text-muted-foreground hover:text-foreground px-3 py-1.5 rounded-md border border-border hover:bg-accent", children: "Retry" })] })] })) : missingApiKey && messages.length === 0 ? (_jsx("div", { className: "flex flex-col items-center justify-center h-full px-2", children: _jsx(BuilderSetupCard, { onConnected: handleBuilderConnected, bouncePulse: missingKeyBouncePulse }) })) : isRestoring ? (_jsxs("div", { className: "flex flex-col gap-3 p-4", children: [_jsx("div", { className: "flex justify-end", children: _jsx("div", { className: "h-8 w-32 rounded-lg bg-muted animate-pulse" }) }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("div", { className: "h-4 w-48 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-64 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-4 w-40 rounded bg-muted animate-pulse" })] })] })) : messages.length === 0 && !isReconnecting ? (_jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-16 px-4 h-full", children: [_jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-muted", children: _jsx(IconMessage, { className: "h-5 w-5 text-muted-foreground" }) }), _jsx("p", { className: "text-sm text-muted-foreground text-center max-w-[240px]", children: emptyStateText ?? "How can I help you?" }), suggestions && suggestions.length > 0 && (_jsx("div", { className: "flex flex-col gap-1.5 w-full max-w-[280px]", children: suggestions.map((suggestion) => (_jsx("button", { onClick: () => {
1651
1737
  threadRuntime.append({
1652
1738
  role: "user",
1653
1739
  content: [{ type: "text", text: suggestion }],
@@ -1655,7 +1741,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1655
1741
  }, className: "w-full rounded-lg border border-border px-3 py-2 text-left text-[13px] text-muted-foreground hover:bg-accent hover:text-foreground", children: suggestion }, suggestion))) }))] })) : (_jsxs("div", { className: "agent-thread-content flex flex-col gap-4 px-4 py-4", children: [_jsx(ThreadPrimitive.Messages, { components: {
1656
1742
  UserMessage,
1657
1743
  AssistantMessage,
1658
- } }), missingApiKey && _jsx(BuilderSetupCard, {}), visibleLoopLimit && !showRunningInUI && (_jsx(LoopLimitContinueCard, { info: visibleLoopLimit, onContinue: () => {
1744
+ } }), missingApiKey && (_jsx(BuilderSetupCard, { onConnected: handleBuilderConnected, bouncePulse: missingKeyBouncePulse })), visibleLoopLimit && !showRunningInUI && (_jsx(LoopLimitContinueCard, { info: visibleLoopLimit, onContinue: () => {
1659
1745
  setShowContinue(false);
1660
1746
  setLoopLimitInfo(null);
1661
1747
  addToQueue("Continue from where you left off.");
@@ -1678,7 +1764,9 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1678
1764
  .replace(/<context>[\s\S]*?<\/context>\n?/g, "")
1679
1765
  .trim();
1680
1766
  return (_jsx("div", { className: "flex justify-end group", children: _jsxs("div", { className: "relative max-w-[85%] rounded-lg bg-accent/50 text-foreground/60 px-3 py-2 text-sm leading-relaxed whitespace-pre-wrap break-words", children: [_jsxs("div", { className: "flex items-center gap-1.5 text-[10px] text-muted-foreground mb-1 font-medium uppercase tracking-wide", children: [_jsx(IconClock, { className: "h-3 w-3" }), "Queued"] }), displayText, msg.images && msg.images.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-1.5 mt-1.5", children: msg.images.map((img, j) => (_jsx("img", { src: img, alt: "", className: "h-12 w-12 rounded object-cover border border-border/50" }, j))) })), _jsx("button", { type: "button", onClick: () => setQueuedMessages((prev) => prev.filter((m) => m.id !== msg.id)), "aria-label": "Remove from queue", className: "absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full border border-border bg-background text-muted-foreground opacity-0 group-hover:opacity-100 focus-visible:opacity-100 hover:text-foreground hover:bg-accent shadow-sm", children: _jsx(IconX, { className: "h-3 w-3" }) })] }) }, msg.id));
1681
- })] })) }), showScrollToBottom && (_jsx("div", { className: "shrink-0 flex justify-center -mb-1", children: _jsx("button", { type: "button", onClick: scrollToBottom, className: "flex h-7 w-7 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent", "aria-label": "Scroll to bottom", children: _jsx(IconChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) }) })), composerSlot, _jsx(SelectionAttachedPill, {}), _jsx("div", { className: "agent-composer-area shrink-0 px-3 py-2", children: _jsxs(ComposerPrimitive.Root, { className: cn("flex flex-col rounded-lg border border-input bg-background focus-within:ring-1 focus-within:ring-ring", execMode === "plan" &&
1767
+ })] })) }), showScrollToBottom && (_jsx("div", { className: "shrink-0 flex justify-center -mb-1", children: _jsx("button", { type: "button", onClick: scrollToBottom, className: "flex h-7 w-7 items-center justify-center rounded-full border border-border bg-background shadow-sm hover:bg-accent", "aria-label": "Scroll to bottom", children: _jsx(IconChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) }) })), composerSlot, _jsx(SelectionAttachedPill, {}), _jsx("div", { className: cn("agent-composer-area shrink-0 px-3 py-2", missingApiKey && "cursor-pointer opacity-70"), onClick: missingApiKey
1768
+ ? () => setMissingKeyBouncePulse((p) => p + 1)
1769
+ : undefined, children: _jsxs(ComposerPrimitive.Root, { className: cn("flex flex-col rounded-lg border border-input bg-background focus-within:ring-1 focus-within:ring-ring", execMode === "plan" &&
1682
1770
  "border-amber-500/50 bg-amber-500/[0.03] focus-within:ring-amber-500/30"), children: [_jsx(ComposerAttachmentPreviewStrip, {}), _jsx(TiptapComposer, { focusRef: tiptapRef, disabled: missingApiKey, placeholder: missingApiKey
1683
1771
  ? "Connect an AI engine above to start chatting…"
1684
1772
  : isRunning
@@ -1694,6 +1782,14 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
1694
1782
  setForceStopped(true);
1695
1783
  const activeRun = getActiveRun();
1696
1784
  const runIdToAbort = reconnectRunIdRef.current ?? activeRun?.runId;
1785
+ userStoppedRunRef.current = {
1786
+ at: Date.now(),
1787
+ ...(runIdToAbort
1788
+ ? { runId: runIdToAbort }
1789
+ : {}),
1790
+ };
1791
+ setRunErrorInfo(null);
1792
+ setDismissedRunErrorKey(null);
1697
1793
  if (runIdToAbort) {
1698
1794
  fetch(`${apiUrl}/runs/${encodeURIComponent(runIdToAbort)}/abort`, { method: "POST" }).catch(() => { });
1699
1795
  }