@runtypelabs/persona 4.28.2 → 4.29.1

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 (145) hide show
  1. package/dist/animations/glyph-cycle.d.cts +1 -1
  2. package/dist/animations/glyph-cycle.d.ts +1 -1
  3. package/dist/animations/wipe.d.cts +1 -1
  4. package/dist/animations/wipe.d.ts +1 -1
  5. package/dist/approval-ui.cjs +3 -3
  6. package/dist/approval-ui.d.cts +1 -1
  7. package/dist/approval-ui.d.ts +1 -1
  8. package/dist/approval-ui.js +3 -3
  9. package/dist/artifacts-ui.d.cts +2 -2
  10. package/dist/artifacts-ui.d.ts +2 -2
  11. package/dist/chunk-B1-_pp-Y.js +4 -0
  12. package/dist/{chunk-DrYAfpvk.js → chunk-BcLIgi1h.js} +1 -1
  13. package/dist/chunk-BkW8s3fj.js +2 -0
  14. package/dist/chunk-Bm2-bemv.js +1 -0
  15. package/dist/chunk-BvhTpG6k.js +1 -0
  16. package/dist/chunk-Csks3Qw1.js +1 -0
  17. package/dist/chunk-D5B629Mj.js +1 -0
  18. package/dist/chunk-DGlFKA0r.js +9 -0
  19. package/dist/chunk-DO9_WSpy.js +1 -0
  20. package/dist/chunk-DTDHeUsG.js +1 -0
  21. package/dist/chunk-DjFpGFGA.js +1 -0
  22. package/dist/{chunk-dRBlrLd7.js → chunk-DtmtfIkd.js} +1 -1
  23. package/dist/chunk-lA5CJCgK.js +1 -0
  24. package/dist/client-history.js +1 -1
  25. package/dist/client-stream.js +1 -1
  26. package/dist/codegen.cjs +1 -1
  27. package/dist/codegen.js +1 -1
  28. package/dist/{composer-input-C39npJaz.d.cts → composer-input-B0P4OtNi.d.cts} +1 -1
  29. package/dist/{composer-input-C39npJaz.d.ts → composer-input-B0P4OtNi.d.ts} +1 -1
  30. package/dist/{context-mention-manager-DLCB1l9E.d.cts → context-mention-manager-DmLI_RM6.d.cts} +1 -1
  31. package/dist/{context-mention-manager-DLCB1l9E.d.ts → context-mention-manager-DmLI_RM6.d.ts} +1 -1
  32. package/dist/context-mentions-inline.d.cts +2 -2
  33. package/dist/context-mentions-inline.d.ts +2 -2
  34. package/dist/context-mentions.d.cts +3 -3
  35. package/dist/context-mentions.d.ts +3 -3
  36. package/dist/{defaults-DiAgWHXy.d.cts → defaults-DVo1wbZs.d.cts} +1 -1
  37. package/dist/{defaults-DiAgWHXy.d.ts → defaults-DVo1wbZs.d.ts} +1 -1
  38. package/dist/event-stream-view.d.cts +1 -1
  39. package/dist/event-stream-view.d.ts +1 -1
  40. package/dist/{fallback-speech-engine-C5_PUZjH.d.cts → fallback-speech-engine-BMnlmKnY.d.cts} +1 -1
  41. package/dist/{fallback-speech-engine-C5_PUZjH.d.ts → fallback-speech-engine-BMnlmKnY.d.ts} +1 -1
  42. package/dist/forms-ui.d.cts +2 -2
  43. package/dist/forms-ui.d.ts +2 -2
  44. package/dist/history-view.d.cts +1 -1
  45. package/dist/history-view.d.ts +1 -1
  46. package/dist/index.cjs +50 -49
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +7 -7
  49. package/dist/index.d.ts +7 -7
  50. package/dist/index.global.js +2 -3
  51. package/dist/index.global.js.map +1 -1
  52. package/dist/index.js +38 -37
  53. package/dist/index.js.map +1 -1
  54. package/dist/{markdown-parsers-loader-BBdyIEU7.d.cts → markdown-parsers-loader-CeovcyYf.d.cts} +1 -1
  55. package/dist/{markdown-parsers-loader-BBdyIEU7.d.ts → markdown-parsers-loader-CeovcyYf.d.ts} +1 -1
  56. package/dist/{preview-Chjb0bmI.d.cts → preview-Bkb4UrQC.d.cts} +2 -2
  57. package/dist/{preview-Chjb0bmI.d.ts → preview-Bkb4UrQC.d.ts} +2 -2
  58. package/dist/session-actions.js +1 -1
  59. package/dist/{session-a_qIp4xp.d.ts → session-iLyKipoM.d.cts} +28 -10
  60. package/dist/{session-a_qIp4xp.d.cts → session-iLyKipoM.d.ts} +28 -10
  61. package/dist/session-reconnect.cjs +1 -1
  62. package/dist/session-reconnect.d.cts +8 -2
  63. package/dist/session-reconnect.d.ts +8 -2
  64. package/dist/session-reconnect.js +1 -1
  65. package/dist/smart-dom-reader.d.cts +1 -1
  66. package/dist/smart-dom-reader.d.ts +1 -1
  67. package/dist/theme-editor-preview.cjs +61 -60
  68. package/dist/theme-editor-preview.d.cts +1 -1
  69. package/dist/theme-editor-preview.d.ts +1 -1
  70. package/dist/theme-editor-preview.js +40 -40
  71. package/dist/theme-editor.d.cts +2 -2
  72. package/dist/theme-editor.d.ts +2 -2
  73. package/dist/theme-reference.d.cts +2 -2
  74. package/dist/theme-reference.d.ts +2 -2
  75. package/dist/{types-BdO1jNRm.d.cts → types-BuDirJkQ.d.cts} +200 -23
  76. package/dist/{types-BdO1jNRm.d.ts → types-BuDirJkQ.d.ts} +200 -23
  77. package/dist/voice-client-tools.cjs +1 -0
  78. package/dist/voice-client-tools.d.cts +13 -0
  79. package/dist/voice-client-tools.d.ts +13 -0
  80. package/dist/voice-client-tools.js +1 -0
  81. package/dist/voice-runtime.cjs +3 -3
  82. package/dist/voice-runtime.d.cts +15 -5
  83. package/dist/voice-runtime.d.ts +15 -5
  84. package/dist/voice-runtime.js +5 -5
  85. package/dist/voice-worklet-player.d.cts +2 -2
  86. package/dist/voice-worklet-player.d.ts +2 -2
  87. package/dist/{webmcp-runtime-entry-B6bpVWSa.d.ts → webmcp-runtime-entry-CXLjRt1k.d.cts} +26 -5
  88. package/dist/{webmcp-runtime-entry-B6bpVWSa.d.cts → webmcp-runtime-entry-CXLjRt1k.d.ts} +26 -5
  89. package/dist/webmcp-runtime.cjs +2 -1
  90. package/dist/webmcp-runtime.d.cts +1 -1
  91. package/dist/webmcp-runtime.d.ts +1 -1
  92. package/dist/webmcp-runtime.js +2 -1
  93. package/dist/widget.css +1 -1
  94. package/package.json +6 -1
  95. package/src/client-approve.test.ts +17 -1
  96. package/src/client-resume.ts +15 -3
  97. package/src/client.interrupt.test.ts +21 -0
  98. package/src/client.ts +61 -4
  99. package/src/client.voice-tools.test.ts +65 -0
  100. package/src/components/activity-row.ts +3 -2
  101. package/src/components/approval-actions.test.ts +8 -0
  102. package/src/components/approval-actions.ts +6 -2
  103. package/src/components/approval-bubble.test.ts +14 -0
  104. package/src/components/approval-bubble.ts +8 -1
  105. package/src/components/tool-bubble.ts +8 -5
  106. package/src/generated/runtype-openapi-contract.ts +39 -1
  107. package/src/index-core.ts +11 -0
  108. package/src/index-global.ts +6 -0
  109. package/src/resume-dedupe-local-only.test.ts +273 -0
  110. package/src/runtime/persist-state.test.ts +86 -0
  111. package/src/session-actions.ts +20 -6
  112. package/src/session-reconnect.ts +18 -1
  113. package/src/session.restored-browser-tools.test.ts +272 -0
  114. package/src/session.test.ts +26 -0
  115. package/src/session.ts +185 -31
  116. package/src/session.voice.test.ts +212 -0
  117. package/src/styles/widget.css +4 -2
  118. package/src/types.ts +178 -22
  119. package/src/ui.restored-browser-tools.test.ts +128 -0
  120. package/src/ui.ts +32 -18
  121. package/src/utils/formatting.test.ts +9 -1
  122. package/src/utils/formatting.ts +4 -0
  123. package/src/utils/local-only-message.ts +15 -0
  124. package/src/utils/restored-browser-state.ts +50 -0
  125. package/src/utils/storage.ts +12 -1
  126. package/src/utils/voice-prior-tool-results.ts +37 -0
  127. package/src/voice/runtype-voice-provider.ts +94 -7
  128. package/src/voice/session-voice-wiring.ts +27 -3
  129. package/src/voice/voice-client-tools-session.ts +116 -0
  130. package/src/voice/voice-delegation.ts +19 -3
  131. package/src/voice/voice.test.ts +396 -0
  132. package/src/voice-client-tools-bundle.test.ts +37 -0
  133. package/src/voice-client-tools-loader.ts +24 -0
  134. package/src/voice-client-tools.ts +9 -0
  135. package/src/webmcp-bridge.test.ts +152 -1
  136. package/src/webmcp-bridge.ts +5 -6
  137. package/src/webmcp-polyfill.integration.test.ts +5 -1
  138. package/src/webmcp-runtime-entry.ts +151 -26
  139. package/dist/chunk-B6zZsT6F.js +0 -1
  140. package/dist/chunk-CztSjKHK.js +0 -9
  141. package/dist/chunk-DbhxjyOB.js +0 -4
  142. package/dist/chunk-DsdqLStH.js +0 -1
  143. package/dist/chunk-GIqbL2Eg.js +0 -1
  144. package/dist/chunk-HUOUif-P.js +0 -1
  145. package/dist/chunk-UlcxdHef.js +0 -1
@@ -1,4 +1,4 @@
1
- import { T as AgentWidgetConfig, mt as AgentWidgetMessage } from "./types-BdO1jNRm.cjs";
1
+ import { T as AgentWidgetConfig, mt as AgentWidgetMessage } from "./types-BuDirJkQ.cjs";
2
2
  import { Marked } from "marked";
3
3
  import DOMPurify from "dompurify";
4
4
  //#region src/components/registry.d.ts
@@ -1,4 +1,4 @@
1
- import { T as AgentWidgetConfig, mt as AgentWidgetMessage } from "./types-BdO1jNRm.js";
1
+ import { T as AgentWidgetConfig, mt as AgentWidgetMessage } from "./types-BuDirJkQ.js";
2
2
  import { Marked } from "marked";
3
3
  import DOMPurify from "dompurify";
4
4
  //#region src/components/registry.d.ts
@@ -1,5 +1,5 @@
1
- import { T as AgentWidgetConfig, mt as AgentWidgetMessage, pa as PersonaTheme, ua as DeepPartial } from "./types-BdO1jNRm.cjs";
2
- import { Kn as AgentWidgetController } from "./session-a_qIp4xp.cjs";
1
+ import { Sa as DeepPartial, T as AgentWidgetConfig, Ta as PersonaTheme, mt as AgentWidgetMessage } from "./types-BuDirJkQ.cjs";
2
+ import { Kn as AgentWidgetController } from "./session-iLyKipoM.cjs";
3
3
  //#region src/theme-editor/preview-utils.d.ts
4
4
  declare const DEVICE_DIMENSIONS: Record<string, {
5
5
  w: number;
@@ -1,5 +1,5 @@
1
- import { T as AgentWidgetConfig, mt as AgentWidgetMessage, pa as PersonaTheme, ua as DeepPartial } from "./types-BdO1jNRm.js";
2
- import { Kn as AgentWidgetController } from "./session-a_qIp4xp.js";
1
+ import { Sa as DeepPartial, T as AgentWidgetConfig, Ta as PersonaTheme, mt as AgentWidgetMessage } from "./types-BuDirJkQ.js";
2
+ import { Kn as AgentWidgetController } from "./session-iLyKipoM.js";
3
3
  //#region src/theme-editor/preview-utils.d.ts
4
4
  declare const DEVICE_DIMENSIONS: Record<string, {
5
5
  w: number;
@@ -1 +1 @@
1
- var e=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},t,n=e((()=>{t=()=>({content:[{type:`text`,text:`Suggestions shown to the user.`}]})}));async function r(e,t,n,r){let i=`approval-${t.id}`,a=`approval-error-${t.id}`,o={};e.s.approvalTokens.set(i,o);let s={...t,status:n,resolvedAt:Date.now()},c=e.s.messages.find(e=>e.id===i),l={id:i,role:`assistant`,content:``,createdAt:c?.createdAt??(/* @__PURE__ */ new Date()).toISOString(),...c?.sequence===void 0?{}:{sequence:c.sequence},streaming:!1,variant:`approval`,approval:s};e.s.upsertMessage(l),e.s.abortController?.abort(),e.s.abortController=new AbortController,e.setStreaming(!0);let u=e.s.config.approval,d=u&&typeof u==`object`?u.onDecision:void 0;try{let c;if(c=d?await d({approvalId:t.id,executionId:t.executionId,agentId:t.agentId,toolName:t.toolName},n,r):await e.s.client.resolveApproval({agentId:t.agentId,executionId:t.executionId,approvalId:t.id},n),c){let r=null;if(c instanceof Response){if(!c.ok){let n=await c.json().catch(()=>null),r=n?.message??n?.error??`Approval request failed: ${c.status}`,u=n?.code===`APPROVAL_ALREADY_RESOLVED`||c.status===404&&/no paused execution/i.test(String(n?.error)),d=e.s.messages.find(e=>e.id===i);throw e.s.approvalTokens.get(i)===o&&d?.approval?.resolvedAt===s.resolvedAt&&(e.s.upsertMessage({...l,approval:u?{...s,status:`timeout`}:t}),u&&e.settleApprovalPausedToolCall(i),e.s.upsertMessage({id:a,role:`assistant`,content:r,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()})),Error(r)}r=c.body}else c instanceof ReadableStream&&(r=c);e.s.approvalTokens.get(i)===o&&e.s.messages.some(e=>e.id===a)&&(e.s.messages=e.s.messages.filter(e=>e.id!==a),e.s.callbacks.onMessagesChanged([...e.s.messages])),r?await e.s.connectStream(r,{allowReentry:!0}):(n===`denied`&&(e.settleApprovalPausedToolCall(i),e.appendMessage({id:`denial-${t.id}`,role:`assistant`,content:`Tool execution was denied by user.`,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()})),e.setStreaming(!1),e.s.abortController=null)}else e.setStreaming(!1),e.s.abortController=null}catch(t){let n=t instanceof Error&&(t.name===`AbortError`||t.message.includes(`aborted`)||t.message.includes(`abort`));e.setStreaming(!1),e.s.abortController=null,n||e.s.callbacks.onError?.(t instanceof Error?t:Error(String(t)))}finally{e.s.approvalTokens.get(i)===o&&e.s.approvalTokens.delete(i)}}async function i(e,t,n){if(e.s.messages.find(e=>e.id===t.id)?.agentMetadata?.askUserQuestionAnswered===!0)return;let r=t.agentMetadata?.executionId,i=t.toolCall?.name;if(!r||!i){e.s.callbacks.onError?.(/* @__PURE__ */ Error(`resolveAskUserQuestion: message is missing executionId or toolCall.name`));return}let a=typeof n==`string`?void 0:n;if(a===void 0&&typeof n==`string`){let e=t.toolCall?.args,r=Array.isArray(e?.questions)?e.questions:[];if(r.length===1){let e=typeof r[0]?.question==`string`?r[0].question:``;e&&(a={[e]:n})}}e.s.markAskUserQuestionResolved(t,a),e.s.abortController?.abort(),e.s.abortController=new AbortController,e.setStreaming(!0);let o=t.toolCall.id,s=t.toolCall?.args,c=Array.isArray(s?.questions)?s.questions:[];if(c.length===0){let t=typeof n==`string`?n:Object.entries(n).map(([e,t])=>`${e}: ${Array.isArray(t)?t.join(`, `):t}`).join(` | `);e.appendMessage({id:`ask-user-answer-${o}`,role:`user`,content:t,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()})}else{let t=a??{};c.forEach((n,r)=>{let i=typeof n?.question==`string`?n.question:``;if(!i)return;let a=t[i],s=Array.isArray(a)?a.join(`, `):typeof a==`string`?a:``;e.appendMessage({id:`ask-user-q-${o}-${r}`,role:`assistant`,content:i,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()}),e.appendMessage({id:`ask-user-a-${o}-${r}`,role:`user`,content:s||`*Skipped*`,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()})})}try{let t=await e.s.client.resumeFlow(r,{[i]:n},{after:e.resumeAfter(r)});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.error??`Resume failed: ${t.status}`)}t.body?await e.s.connectStream(t.body,{allowReentry:!0}):(e.setStreaming(!1),e.s.abortController=null)}catch(t){let n=t instanceof Error&&(t.name===`AbortError`||t.message.includes(`aborted`)||t.message.includes(`abort`));e.setStreaming(!1),e.s.abortController=null,n||e.s.callbacks.onError?.(t instanceof Error?t:Error(String(t)))}}function a(e,t){let n=[e.s.messages.find(e=>e.id===t.id)?.toolCall?.startedAt,t.toolCall?.startedAt];for(let e of n)if(typeof e==`number`&&Number.isFinite(e))return e;return Date.now()}function o(e,t){return t.toolCall?.name===`suggest_replies`&&(e.s.messages.find(e=>e.id===t.id)??t).agentMetadata?.suggestRepliesResolved===!0}function s(e,t){let n=a(e,t);return e.s.upsertMessage({...t,streaming:!0,agentMetadata:{...t.agentMetadata,awaitingLocalTool:!1},toolCall:t.toolCall?{...t.toolCall,status:`running`,startedAt:n,completedAt:void 0,duration:void 0,durationMs:void 0}:t.toolCall}),n}function c(e,t,n,r,i=Date.now(),a){e.s.messages.some(e=>e.id===t.id)&&e.s.upsertMessage({...t,streaming:!1,agentMetadata:{...t.agentMetadata,awaitingLocalTool:!1,...a},toolCall:t.toolCall?{...t.toolCall,status:`complete`,result:n,startedAt:r,completedAt:i,duration:void 0,durationMs:Math.max(0,i-r)}:t.toolCall})}async function l(e,n,r){let i=[],a=new AbortController;e.s.webMcpResolveControllers.add(a),e.setStreaming(!0);let l=async r=>{let l=r.toolCall?.name,u=r.toolCall?.id;if(!l||!u)return null;let d=`${n}:${u}`;if(e.s.webMcpInflightKeys.has(d)||e.s.webMcpResolvedKeys.has(d)||o(e,r))return null;e.s.webMcpInflightKeys.add(d),i.push(d);let m=s(e,r),h=r.agentMetadata?.webMcpToolCallId??l;if(l===`suggest_replies`)return{dedupeKey:d,resumeKey:h,output:t(),toolMessage:r,startedAt:m,completedAt:Date.now()};let g=e.s.client.executeWebMcpToolCall(l,r.toolCall?.args,a.signal),_;if(!g)_={isError:!0,content:[{type:`text`,text:`WebMCP not enabled on this widget.`}]};else try{_=await g}catch(t){let n=t instanceof Error&&(t.name===`AbortError`||t.message.includes(`aborted`)||t.message.includes(`abort`));return n||e.s.callbacks.onError?.(t instanceof Error?t:Error(String(t))),c(e,r,f(n?`Aborted by cancel()`:p(t)),m),e.s.webMcpInflightKeys.delete(d),null}return a.signal.aborted?(c(e,r,f(`Aborted by cancel()`),m),e.s.webMcpInflightKeys.delete(d),null):{dedupeKey:d,resumeKey:h,output:_,toolMessage:r,startedAt:m,completedAt:Date.now()}},u;if(e.s.config.webmcp?.execution===`sequential`){u=[];for(let e of r)u.push(await l(e))}else u=await Promise.all(r.map(l));let d=[];try{if(d=u.filter(e=>e!==null),d.length===0)return;let t={};for(let e of d)t[e.resumeKey]=e.output;let r=await e.s.client.resumeFlow(n,t,{signal:a.signal,after:e.resumeAfter(n)});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??`Resume failed: ${r.status}`)}let i=d[0].dedupeKey;for(let t of d){e.s.webMcpResolvedKeys.add(t.dedupeKey);let n=t.toolMessage.toolCall?.name,r=t.toolMessage.agentMetadata?.webMcpToolCallId;c(e,t.toolMessage,t.output,t.startedAt,t.completedAt,{...n===`suggest_replies`?{suggestRepliesResolved:!0}:{},...n&&r?{clientToolAnswer:{toolCallId:r,toolName:n,args:t.toolMessage.toolCall?.args,result:t.output,batch:i}}:{}})}r.body&&await e.s.connectStream(r.body,{allowReentry:!0})}catch(t){if(!(t instanceof Error&&(t.name===`AbortError`||t.message.includes(`aborted`)||t.message.includes(`abort`))))e.s.callbacks.onError?.(t instanceof Error?t:Error(String(t)));else for(let t of d)c(e,t.toolMessage,f(`Aborted by cancel()`),t.startedAt)}finally{for(let t of i)e.s.webMcpInflightKeys.delete(t);e.s.webMcpResolveControllers.delete(a),e.s.webMcpResolveControllers.size===0&&!e.s.abortController&&e.setStreaming(!1)}}async function u(e,t){let n=t.agentMetadata?.executionId,r=t.toolCall?.name,i=t.toolCall?.id;if(!n){e.s.callbacks.onError?.(/* @__PURE__ */ Error(`WebMCP await missing executionId: dispatch left paused.`));return}if(!r)return;if(!i){let t=`${n}:__no_tool_id__:${r}`;if(e.s.webMcpInflightKeys.has(t)||e.s.webMcpResolvedKeys.has(t))return;e.s.webMcpInflightKeys.add(t);try{await d(e,n,r,{isError:!0,content:[{type:`text`,text:`WebMCP await missing toolCall.id: cannot execute the page tool.`}]}),e.s.webMcpResolvedKeys.add(t)}catch(t){e.s.callbacks.onError?.(t instanceof Error?t:Error(String(t)))}finally{e.s.webMcpInflightKeys.delete(t)}return}let a=`${n}:${i}`;if(!(e.s.webMcpInflightKeys.has(a)||e.s.webMcpResolvedKeys.has(a)||o(e,t)))return l(e,n,[t])}async function d(e,t,n,r,i){let a=await e.s.client.resumeFlow(t,{[n]:r},{signal:i?.signal,after:e.resumeAfter(t)});if(!a.ok){let e=await a.json().catch(()=>null);throw Error(e?.error??`Resume failed: ${a.status}`)}i?.onHttpOk?.(),a.body?await e.s.connectStream(a.body,{allowReentry:!0}):e.s.webMcpResolveControllers.size===0&&(e.setStreaming(!1),e.s.abortController=null)}var f,p;e((()=>{n(),f=e=>({isError:!0,content:[{type:`text`,text:e}]}),p=(e,t=`WebMCP tool execution failed.`)=>e instanceof Error&&e.message?e.message:typeof e==`string`&&e?e:t}))();export{r as resolveApproval,i as resolveAskUserQuestion,u as resolveWebMcpToolCall,l as resolveWebMcpToolCallBatch};
1
+ var e=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}};function t(){return`ast_${Date.now().toString(36)}_${Math.random().toString(36).substring(2,10)}`}var n=e((()=>{})),r,i=e((()=>{r=()=>({content:[{type:`text`,text:`Suggestions shown to the user.`}]})}));async function a(e,n,r,i){let a=`approval-${n.id}`,o=`approval-error-${n.id}`,s=t(),c={};e.s.approvalTokens.set(a,c);let l={...n,status:r,resolvedAt:Date.now()},u=e.s.messages.find(e=>e.id===a),d={id:a,role:`assistant`,content:``,createdAt:u?.createdAt??(/* @__PURE__ */ new Date()).toISOString(),...u?.sequence===void 0?{}:{sequence:u.sequence},streaming:!1,variant:`approval`,approval:l};e.s.upsertMessage(d),e.s.abortController?.abort(),e.s.abortController=new AbortController,e.setStreaming(!0);let f=e.s.config.approval,p=f&&typeof f==`object`?f.onDecision:void 0;try{let t;if(t=p?await p({approvalId:n.id,executionId:n.executionId,agentId:n.agentId,toolName:n.toolName},r,i):await e.s.client.resolveApproval({agentId:n.agentId,executionId:n.executionId,approvalId:n.id},r,{assistantMessageId:s}),t){let i=null;if(t instanceof Response){if(!t.ok){let r=await t.json().catch(()=>null),i=r?.message??r?.error??`Approval request failed: ${t.status}`,s=r?.code===`APPROVAL_ALREADY_RESOLVED`||t.status===404&&/no paused execution/i.test(String(r?.error)),u=e.s.messages.find(e=>e.id===a);throw e.s.approvalTokens.get(a)===c&&u?.approval?.resolvedAt===l.resolvedAt&&(e.s.upsertMessage({...d,approval:s?{...l,status:`timeout`}:n}),s&&e.settleApprovalPausedToolCall(a),e.s.upsertMessage({id:o,role:`assistant`,content:i,localOnly:!0,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()})),Error(i)}i=t.body}else t instanceof ReadableStream&&(i=t);e.s.approvalTokens.get(a)===c&&e.s.messages.some(e=>e.id===o)&&(e.s.messages=e.s.messages.filter(e=>e.id!==o),e.s.callbacks.onMessagesChanged([...e.s.messages])),i?await e.s.connectStream(i,{allowReentry:!0,assistantMessageId:s}):(r===`denied`&&(e.settleApprovalPausedToolCall(a),e.appendMessage({id:`denial-${n.id}`,role:`assistant`,content:`Tool execution was denied by user.`,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()})),e.setStreaming(!1),e.s.abortController=null)}else e.setStreaming(!1),e.s.abortController=null}catch(t){let n=t instanceof Error&&(t.name===`AbortError`||t.message.includes(`aborted`)||t.message.includes(`abort`));e.setStreaming(!1),e.s.abortController=null,n||e.s.callbacks.onError?.(t instanceof Error?t:Error(String(t)))}finally{e.s.approvalTokens.get(a)===c&&e.s.approvalTokens.delete(a)}}async function o(e,n,r){if(e.s.messages.find(e=>e.id===n.id)?.agentMetadata?.askUserQuestionAnswered===!0)return;let i=n.agentMetadata?.executionId,a=n.toolCall?.name;if(!i||!a){e.s.callbacks.onError?.(/* @__PURE__ */ Error(`resolveAskUserQuestion: message is missing executionId or toolCall.name`));return}let o=typeof r==`string`?void 0:r;if(o===void 0&&typeof r==`string`){let e=n.toolCall?.args,t=Array.isArray(e?.questions)?e.questions:[];if(t.length===1){let e=typeof t[0]?.question==`string`?t[0].question:``;e&&(o={[e]:r})}}e.s.markAskUserQuestionResolved(n,o),e.s.abortController?.abort(),e.s.abortController=new AbortController,e.setStreaming(!0);let s=n.toolCall.id,c=n.toolCall?.args,l=Array.isArray(c?.questions)?c.questions:[];if(l.length===0){let t=typeof r==`string`?r:Object.entries(r).map(([e,t])=>`${e}: ${Array.isArray(t)?t.join(`, `):t}`).join(` | `);e.appendMessage({id:`ask-user-answer-${s}`,role:`user`,content:t,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()})}else{let t=o??{};l.forEach((n,r)=>{let i=typeof n?.question==`string`?n.question:``;if(!i)return;let a=t[i],o=Array.isArray(a)?a.join(`, `):typeof a==`string`?a:``;e.appendMessage({id:`ask-user-q-${s}-${r}`,role:`assistant`,content:i,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()}),e.appendMessage({id:`ask-user-a-${s}-${r}`,role:`user`,content:o||`*Skipped*`,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()})})}try{let n=t(),o=await e.s.client.resumeFlow(i,{[a]:r},{after:e.resumeAfter(i),assistantMessageId:n});if(!o.ok){let e=await o.json().catch(()=>null);throw Error(e?.error??`Resume failed: ${o.status}`)}o.body?await e.s.connectStream(o.body,{allowReentry:!0,assistantMessageId:n}):(e.setStreaming(!1),e.s.abortController=null)}catch(t){let n=t instanceof Error&&(t.name===`AbortError`||t.message.includes(`aborted`)||t.message.includes(`abort`));e.setStreaming(!1),e.s.abortController=null,n||e.s.callbacks.onError?.(t instanceof Error?t:Error(String(t)))}}function s(e,t){let n=[e.s.messages.find(e=>e.id===t.id)?.toolCall?.startedAt,t.toolCall?.startedAt];for(let e of n)if(typeof e==`number`&&Number.isFinite(e))return e;return Date.now()}function c(e,t){return t.toolCall?.name===`suggest_replies`&&(e.s.messages.find(e=>e.id===t.id)??t).agentMetadata?.suggestRepliesResolved===!0}function l(e,t){let n=s(e,t);return e.s.upsertMessage({...t,streaming:!0,agentMetadata:{...t.agentMetadata,awaitingLocalTool:!1},toolCall:t.toolCall?{...t.toolCall,status:`running`,startedAt:n,completedAt:void 0,duration:void 0,durationMs:void 0}:t.toolCall}),n}function u(e,t,n,r,i=Date.now(),a){e.s.messages.some(e=>e.id===t.id)&&e.s.upsertMessage({...t,streaming:!1,agentMetadata:{...t.agentMetadata,awaitingLocalTool:!1,...a},toolCall:t.toolCall?{...t.toolCall,status:`complete`,result:n,startedAt:r,completedAt:i,duration:void 0,durationMs:Math.max(0,i-r)}:t.toolCall})}async function d(e,n,i){let a=[],o=new AbortController;e.s.webMcpResolveControllers.add(o),e.setStreaming(!0);let s=async t=>{let i=t.toolCall?.name,s=t.toolCall?.id;if(!i||!s)return null;let d=`${n}:${s}`;if(e.s.webMcpInflightKeys.has(d)||e.s.webMcpResolvedKeys.has(d)||c(e,t))return null;e.s.webMcpInflightKeys.add(d),a.push(d);let f=l(e,t),p=t.agentMetadata?.webMcpToolCallId??i;if(i===`suggest_replies`)return{dedupeKey:d,resumeKey:p,output:r(),toolMessage:t,startedAt:f,completedAt:Date.now()};let g=e.s.client.executeWebMcpToolCall(i,t.toolCall?.args,o.signal),_;if(!g)_={isError:!0,content:[{type:`text`,text:`WebMCP not enabled on this widget.`}]};else try{_=await g}catch(n){let r=n instanceof Error&&(n.name===`AbortError`||n.message.includes(`aborted`)||n.message.includes(`abort`));return r||e.s.callbacks.onError?.(n instanceof Error?n:Error(String(n))),u(e,t,m(r?`Aborted by cancel()`:h(n)),f),e.s.webMcpInflightKeys.delete(d),null}return o.signal.aborted?(u(e,t,m(`Aborted by cancel()`),f),e.s.webMcpInflightKeys.delete(d),null):{dedupeKey:d,resumeKey:p,output:_,toolMessage:t,startedAt:f,completedAt:Date.now()}},d;if(e.s.config.webmcp?.execution===`sequential`){d=[];for(let e of i)d.push(await s(e))}else d=await Promise.all(i.map(s));let f=[];try{if(f=d.filter(e=>e!==null),f.length===0)return;let r={};for(let e of f)r[e.resumeKey]=e.output;let i=t(),a=await e.s.client.resumeFlow(n,r,{signal:o.signal,after:e.resumeAfter(n),assistantMessageId:i});if(!a.ok){let e=await a.json().catch(()=>null);throw Error(e?.error??`Resume failed: ${a.status}`)}let s=f[0].dedupeKey;for(let t of f){e.s.webMcpResolvedKeys.add(t.dedupeKey);let n=t.toolMessage.toolCall?.name,r=t.toolMessage.agentMetadata?.webMcpToolCallId;u(e,t.toolMessage,t.output,t.startedAt,t.completedAt,{...n===`suggest_replies`?{suggestRepliesResolved:!0}:{},...n&&r?{clientToolAnswer:{toolCallId:r,toolName:n,args:t.toolMessage.toolCall?.args,result:t.output,batch:s}}:{}})}a.body&&await e.s.connectStream(a.body,{allowReentry:!0,assistantMessageId:i})}catch(t){if(!(t instanceof Error&&(t.name===`AbortError`||t.message.includes(`aborted`)||t.message.includes(`abort`))))e.s.callbacks.onError?.(t instanceof Error?t:Error(String(t)));else for(let t of f)u(e,t.toolMessage,m(`Aborted by cancel()`),t.startedAt)}finally{for(let t of a)e.s.webMcpInflightKeys.delete(t);e.s.webMcpResolveControllers.delete(o),e.s.webMcpResolveControllers.size===0&&!e.s.abortController&&e.setStreaming(!1)}}async function f(e,t){let n=t.agentMetadata?.executionId,r=t.toolCall?.name,i=t.toolCall?.id;if(!n){e.s.callbacks.onError?.(/* @__PURE__ */ Error(`WebMCP await missing executionId: dispatch left paused.`));return}if(!r)return;if(!i){let t=`${n}:__no_tool_id__:${r}`;if(e.s.webMcpInflightKeys.has(t)||e.s.webMcpResolvedKeys.has(t))return;e.s.webMcpInflightKeys.add(t);try{await p(e,n,r,{isError:!0,content:[{type:`text`,text:`WebMCP await missing toolCall.id: cannot execute the page tool.`}]}),e.s.webMcpResolvedKeys.add(t)}catch(t){e.s.callbacks.onError?.(t instanceof Error?t:Error(String(t)))}finally{e.s.webMcpInflightKeys.delete(t)}return}let a=`${n}:${i}`;if(!(e.s.webMcpInflightKeys.has(a)||e.s.webMcpResolvedKeys.has(a)||c(e,t)))return d(e,n,[t])}async function p(e,n,r,i,a){let o=t(),s=await e.s.client.resumeFlow(n,{[r]:i},{signal:a?.signal,after:e.resumeAfter(n),assistantMessageId:o});if(!s.ok){let e=await s.json().catch(()=>null);throw Error(e?.error??`Resume failed: ${s.status}`)}a?.onHttpOk?.(),s.body?await e.s.connectStream(s.body,{allowReentry:!0,assistantMessageId:o}):e.s.webMcpResolveControllers.size===0&&(e.setStreaming(!1),e.s.abortController=null)}var m,h;e((()=>{n(),i(),m=e=>({isError:!0,content:[{type:`text`,text:e}]}),h=(e,t=`WebMCP tool execution failed.`)=>e instanceof Error&&e.message?e.message:typeof e==`string`&&e?e:t}))();export{a as resolveApproval,o as resolveAskUserQuestion,f as resolveWebMcpToolCall,d as resolveWebMcpToolCallBatch};
@@ -1,9 +1,9 @@
1
- import { $n as ComposerResubmitOptions, Ar as LoadingIndicatorRenderContext, D as AgentWidgetContentSegment, Dr as InjectMessageOptions, E as AgentWidgetConfigPatch, Er as InjectComponentDirectiveOptions, Hr as PersonaArtifactManualUpsert, I as AgentWidgetContextMentionRef, Ir as PersonaArtifactDisplayMode, J as AgentWidgetEvent, Jt as AgentWidgetSuggestion, Kr as PreparedClientSession, Kt as AgentWidgetStreamParser, Lr as PersonaArtifactDisplayModeInput, Lt as AgentWidgetStateSnapshot, M as AgentWidgetContextMentionItem, Or as InjectSystemMessageOptions, Qn as ComposerQuote, Rt as AgentWidgetStorageAdapter, Si as WidgetHistoryInternals, T as AgentWidgetConfig, Ti as WidgetPreferenceSlice, Tn as ClientToolDefinition, Tr as InjectAssistantMessageOptions, U as AgentWidgetControllerEventMap, Vr as PersonaArtifactKind, Wr as PersonaArtifactRecord, Xn as ComposerOptionsPayload, Xr as ResumableHandle, Y as AgentWidgetFeatureFlags, Z as AgentWidgetHeaderLayoutConfig, Zi as RuntypeExecutionStreamEvent, _i as VoiceTranscriptMetadata, _n as AskUserQuestionPayload, _r as HistoryDisplayProjection, _t as AgentWidgetMessageLayoutConfig, ai as TextContentPart, ar as ContentPart, b as AgentWidgetAttachmentAdapter, bi as WebMcpToolResult, br as HistoryReturnSurface, ct as AgentWidgetMarkdownConfig, d as AgentWidgetActionParser, di as VoiceMetrics, ei as SpeechCallbacks, er as ComposerState, g as AgentWidgetArtifactsFeature, gi as VoiceStatus, gr as HistoryConversationSummary, gt as AgentWidgetMessageFeedback, h as AgentWidgetApprovalDecisionOptions, hi as VoiceSessionBridge, hr as HistoryConversationPatch, ht as AgentWidgetMessageActionsConfig, ii as StreamAnimationPlugin, ji as HistoryListResult, jr as MessageContent, k as AgentWidgetContextMentionCommandContext, ka as AgentWidgetPlugin, kr as InjectUserMessageOptions, l as AgentWidgetActionHandler, lt as AgentWidgetMarkdownOptions, ma as PersonaThemePlugin, mi as VoiceResult, mr as HistoryConversationPage, mt as AgentWidgetMessage, n as AgentExecutionState, ni as SpeechRequest, oi as VoiceConfig, p as AgentWidgetApproval, pa as PersonaTheme, pi as VoiceProvider, pr as HistoryConversationDetail, q as AgentWidgetDockConfig, qr as ReadAloudState, rt as AgentWidgetInitOptions, sn as AgentWidgetWebMcpConfig, ti as SpeechEngine, ua as DeepPartial, ut as AgentWidgetMarkdownRendererOverrides, vi as WebMcpConfirmHandler, vr as HistoryIdentityStatus, wn as ClientSession, wr as ImageContentPart, x as AgentWidgetAttachmentsConfig, xn as ClientFeedbackRequest, xr as HistoryScope, yi as WebMcpConfirmInfo, z as AgentWidgetContextMentionSource } from "./types-BdO1jNRm.js";
2
- import "./markdown-parsers-loader-BBdyIEU7.js";
3
- import { t as MentionSubmitBundle } from "./context-mention-manager-DLCB1l9E.js";
4
- import { t as WebMcpBridge$1 } from "./webmcp-runtime-entry-B6bpVWSa.js";
5
- import "./fallback-speech-engine-C5_PUZjH.js";
6
- import "./defaults-DiAgWHXy.js";
1
+ import { $n as ComposerOptionsPayload, $r as ResumableHandle, Ai as WebMcpConfirmHandler, Ar as InjectMessageOptions, Br as PersonaArtifactDisplayModeInput, Cr as HistoryReturnSurface, D as AgentWidgetContentSegment, Di as VoiceSessionBridge, Dr as ImageContentPart, E as AgentWidgetConfigPatch, Ea as PersonaThemePlugin, Ei as VoiceResult, En as ClientToolDefinition, Gr as PersonaArtifactManualUpsert, I as AgentWidgetContextMentionRef, J as AgentWidgetEvent, Jt as AgentWidgetSuggestion, Kt as AgentWidgetStreamParser, Li as WidgetPreferenceSlice, Lt as AgentWidgetStateSnapshot, M as AgentWidgetContextMentionItem, Mi as WebMcpToolResult, Mr as InjectUserMessageOptions, Nr as LoadingIndicatorRenderContext, Oi as VoiceStatus, Or as InjectAssistantMessageOptions, Pi as WidgetHistoryInternals, Pr as MessageContent, Rt as AgentWidgetStorageAdapter, Sa as DeepPartial, Si as VoiceMetrics, T as AgentWidgetConfig, Ta as PersonaTheme, Ti as VoiceProvider, U as AgentWidgetControllerEventMap, Ui as HistoryListResult, Va as AgentWidgetPlugin, Wr as PersonaArtifactKind, Xr as ReadAloudState, Y as AgentWidgetFeatureFlags, Yr as PreparedClientSession, Z as AgentWidgetHeaderLayoutConfig, _n as AskUserQuestionPayload, _r as HistoryConversationPage, _t as AgentWidgetMessageLayoutConfig, ai as SpeechRequest, b as AgentWidgetAttachmentAdapter, br as HistoryDisplayProjection, ci as TextContentPart, cr as ContentPart, ct as AgentWidgetMarkdownConfig, d as AgentWidgetActionParser, fi as VoiceClientTools, g as AgentWidgetArtifactsFeature, gi as VoiceConfig, gr as HistoryConversationDetail, gt as AgentWidgetMessageFeedback, h as AgentWidgetApprovalDecisionOptions, ht as AgentWidgetMessageActionsConfig, ii as SpeechEngine, ji as WebMcpConfirmInfo, jr as InjectSystemMessageOptions, k as AgentWidgetContextMentionCommandContext, ki as VoiceTranscriptMetadata, kr as InjectComponentDirectiveOptions, l as AgentWidgetActionHandler, la as RuntypeExecutionStreamEvent, lt as AgentWidgetMarkdownOptions, mt as AgentWidgetMessage, n as AgentExecutionState, nr as ComposerResubmitOptions, p as AgentWidgetApproval, q as AgentWidgetDockConfig, qr as PersonaArtifactRecord, ri as SpeechCallbacks, rr as ComposerState, rt as AgentWidgetInitOptions, si as StreamAnimationPlugin, sn as AgentWidgetWebMcpConfig, tr as ComposerQuote, ut as AgentWidgetMarkdownRendererOverrides, vr as HistoryConversationPatch, wi as VoicePriorToolResult, wn as ClientSession, wr as HistoryScope, x as AgentWidgetAttachmentsConfig, xn as ClientFeedbackRequest, xr as HistoryIdentityStatus, yr as HistoryConversationSummary, z as AgentWidgetContextMentionSource, zr as PersonaArtifactDisplayMode } from "./types-BuDirJkQ.cjs";
2
+ import "./markdown-parsers-loader-CeovcyYf.cjs";
3
+ import { t as MentionSubmitBundle } from "./context-mention-manager-DmLI_RM6.cjs";
4
+ import { t as WebMcpBridge$1 } from "./webmcp-runtime-entry-CXLjRt1k.cjs";
5
+ import "./fallback-speech-engine-BMnlmKnY.cjs";
6
+ import "./defaults-DVo1wbZs.cjs";
7
7
  import { IconNode as IconNode$1 } from "lucide";
8
8
  import "marked";
9
9
  //#region src/components/message-bubble.d.ts
@@ -675,6 +675,12 @@ type DispatchOptions = {
675
675
  * answer.
676
676
  */
677
677
  voiceSpoken?: boolean;
678
+ /**
679
+ * Client-token only: page tools the voice server already ran for this
680
+ * delegated turn, sent as `voice.priorToolResults` with `voiceSpoken`.
681
+ * Proxy/agent payloads carry them as replayed tool rows instead.
682
+ */
683
+ voicePriorToolResults?: VoicePriorToolResult[];
678
684
  };
679
685
  type SSEHandler = (event: AgentWidgetEvent) => void;
680
686
  type SSEEventCallback = (eventType: string, payload: unknown) => void;
@@ -736,6 +742,12 @@ declare class AgentWidgetClient {
736
742
  * session that it should fall back to the legacy local-tool resume path,
737
743
  * if any).
738
744
  */
745
+ /**
746
+ * WebMCP access for a Runtype voice call's fast tier: the same per-turn
747
+ * snapshot `clientTools[]` carries, registry change notifications, and the
748
+ * voice execute path. `null` when WebMCP is not enabled.
749
+ */
750
+ getVoiceClientTools(): VoiceClientTools | null;
739
751
  executeWebMcpToolCall(wireToolName: string, args: unknown, signal?: AbortSignal): Promise<WebMcpToolResult> | null;
740
752
  /**
741
753
  * Get the current SSE event callback (used to preserve across client recreation)
@@ -946,11 +958,14 @@ declare class AgentWidgetClient {
946
958
  agentId: string;
947
959
  executionId: string;
948
960
  approvalId: string;
949
- }, decision: 'approved' | 'denied'): Promise<Response>;
961
+ }, decision: 'approved' | 'denied', options?: {
962
+ assistantMessageId?: string;
963
+ }): Promise<Response>;
950
964
  resumeFlow(executionId: string, toolOutputs: Record<string, unknown>, options?: {
951
965
  streamResponse?: boolean;
952
966
  signal?: AbortSignal;
953
967
  after?: string;
968
+ assistantMessageId?: string;
954
969
  }): Promise<Response>;
955
970
  }
956
971
  //#endregion
@@ -2611,10 +2626,13 @@ declare class AgentWidgetSession {
2611
2626
  * Internal (voice client delegation): this is the delegated voice turn.
2612
2627
  * `userMessageId` names an existing transcript bubble to submit as the
2613
2628
  * turn's user message instead of appending a new one, so the spoken
2614
- * request appears (and is sent) exactly once.
2629
+ * request appears (and is sent) exactly once. `priorToolResults`: page
2630
+ * tools the voice server already ran for this turn, recorded once as
2631
+ * completed tool rows after the request (see voicePriorToolRows).
2615
2632
  */
2616
2633
  voiceTurn?: {
2617
- userMessageId?: string;
2634
+ userMessageId?: string | null;
2635
+ priorToolResults?: unknown;
2618
2636
  };
2619
2637
  }): Promise<void>;
2620
2638
  /**
@@ -2687,7 +2705,7 @@ declare class AgentWidgetSession {
2687
2705
  * bridge Promise parked in `requestWebMcpApproval`. No-op if already
2688
2706
  * resolved (double-click, re-render).
2689
2707
  */
2690
- resolveWebMcpApproval(approvalMessageId: string, decision: "approved" | "denied"): void;
2708
+ resolveWebMcpApproval(approvalMessageId: string, decision: "approved" | "denied" | "timeout"): void;
2691
2709
  /**
2692
2710
  * Resolve a tool approval request (approve or deny).
2693
2711
  * Updates the approval message status, calls the API (or custom onDecision),
@@ -1,9 +1,9 @@
1
- import { $n as ComposerResubmitOptions, Ar as LoadingIndicatorRenderContext, D as AgentWidgetContentSegment, Dr as InjectMessageOptions, E as AgentWidgetConfigPatch, Er as InjectComponentDirectiveOptions, Hr as PersonaArtifactManualUpsert, I as AgentWidgetContextMentionRef, Ir as PersonaArtifactDisplayMode, J as AgentWidgetEvent, Jt as AgentWidgetSuggestion, Kr as PreparedClientSession, Kt as AgentWidgetStreamParser, Lr as PersonaArtifactDisplayModeInput, Lt as AgentWidgetStateSnapshot, M as AgentWidgetContextMentionItem, Or as InjectSystemMessageOptions, Qn as ComposerQuote, Rt as AgentWidgetStorageAdapter, Si as WidgetHistoryInternals, T as AgentWidgetConfig, Ti as WidgetPreferenceSlice, Tn as ClientToolDefinition, Tr as InjectAssistantMessageOptions, U as AgentWidgetControllerEventMap, Vr as PersonaArtifactKind, Wr as PersonaArtifactRecord, Xn as ComposerOptionsPayload, Xr as ResumableHandle, Y as AgentWidgetFeatureFlags, Z as AgentWidgetHeaderLayoutConfig, Zi as RuntypeExecutionStreamEvent, _i as VoiceTranscriptMetadata, _n as AskUserQuestionPayload, _r as HistoryDisplayProjection, _t as AgentWidgetMessageLayoutConfig, ai as TextContentPart, ar as ContentPart, b as AgentWidgetAttachmentAdapter, bi as WebMcpToolResult, br as HistoryReturnSurface, ct as AgentWidgetMarkdownConfig, d as AgentWidgetActionParser, di as VoiceMetrics, ei as SpeechCallbacks, er as ComposerState, g as AgentWidgetArtifactsFeature, gi as VoiceStatus, gr as HistoryConversationSummary, gt as AgentWidgetMessageFeedback, h as AgentWidgetApprovalDecisionOptions, hi as VoiceSessionBridge, hr as HistoryConversationPatch, ht as AgentWidgetMessageActionsConfig, ii as StreamAnimationPlugin, ji as HistoryListResult, jr as MessageContent, k as AgentWidgetContextMentionCommandContext, ka as AgentWidgetPlugin, kr as InjectUserMessageOptions, l as AgentWidgetActionHandler, lt as AgentWidgetMarkdownOptions, ma as PersonaThemePlugin, mi as VoiceResult, mr as HistoryConversationPage, mt as AgentWidgetMessage, n as AgentExecutionState, ni as SpeechRequest, oi as VoiceConfig, p as AgentWidgetApproval, pa as PersonaTheme, pi as VoiceProvider, pr as HistoryConversationDetail, q as AgentWidgetDockConfig, qr as ReadAloudState, rt as AgentWidgetInitOptions, sn as AgentWidgetWebMcpConfig, ti as SpeechEngine, ua as DeepPartial, ut as AgentWidgetMarkdownRendererOverrides, vi as WebMcpConfirmHandler, vr as HistoryIdentityStatus, wn as ClientSession, wr as ImageContentPart, x as AgentWidgetAttachmentsConfig, xn as ClientFeedbackRequest, xr as HistoryScope, yi as WebMcpConfirmInfo, z as AgentWidgetContextMentionSource } from "./types-BdO1jNRm.cjs";
2
- import "./markdown-parsers-loader-BBdyIEU7.cjs";
3
- import { t as MentionSubmitBundle } from "./context-mention-manager-DLCB1l9E.cjs";
4
- import { t as WebMcpBridge$1 } from "./webmcp-runtime-entry-B6bpVWSa.cjs";
5
- import "./fallback-speech-engine-C5_PUZjH.cjs";
6
- import "./defaults-DiAgWHXy.cjs";
1
+ import { $n as ComposerOptionsPayload, $r as ResumableHandle, Ai as WebMcpConfirmHandler, Ar as InjectMessageOptions, Br as PersonaArtifactDisplayModeInput, Cr as HistoryReturnSurface, D as AgentWidgetContentSegment, Di as VoiceSessionBridge, Dr as ImageContentPart, E as AgentWidgetConfigPatch, Ea as PersonaThemePlugin, Ei as VoiceResult, En as ClientToolDefinition, Gr as PersonaArtifactManualUpsert, I as AgentWidgetContextMentionRef, J as AgentWidgetEvent, Jt as AgentWidgetSuggestion, Kt as AgentWidgetStreamParser, Li as WidgetPreferenceSlice, Lt as AgentWidgetStateSnapshot, M as AgentWidgetContextMentionItem, Mi as WebMcpToolResult, Mr as InjectUserMessageOptions, Nr as LoadingIndicatorRenderContext, Oi as VoiceStatus, Or as InjectAssistantMessageOptions, Pi as WidgetHistoryInternals, Pr as MessageContent, Rt as AgentWidgetStorageAdapter, Sa as DeepPartial, Si as VoiceMetrics, T as AgentWidgetConfig, Ta as PersonaTheme, Ti as VoiceProvider, U as AgentWidgetControllerEventMap, Ui as HistoryListResult, Va as AgentWidgetPlugin, Wr as PersonaArtifactKind, Xr as ReadAloudState, Y as AgentWidgetFeatureFlags, Yr as PreparedClientSession, Z as AgentWidgetHeaderLayoutConfig, _n as AskUserQuestionPayload, _r as HistoryConversationPage, _t as AgentWidgetMessageLayoutConfig, ai as SpeechRequest, b as AgentWidgetAttachmentAdapter, br as HistoryDisplayProjection, ci as TextContentPart, cr as ContentPart, ct as AgentWidgetMarkdownConfig, d as AgentWidgetActionParser, fi as VoiceClientTools, g as AgentWidgetArtifactsFeature, gi as VoiceConfig, gr as HistoryConversationDetail, gt as AgentWidgetMessageFeedback, h as AgentWidgetApprovalDecisionOptions, ht as AgentWidgetMessageActionsConfig, ii as SpeechEngine, ji as WebMcpConfirmInfo, jr as InjectSystemMessageOptions, k as AgentWidgetContextMentionCommandContext, ki as VoiceTranscriptMetadata, kr as InjectComponentDirectiveOptions, l as AgentWidgetActionHandler, la as RuntypeExecutionStreamEvent, lt as AgentWidgetMarkdownOptions, mt as AgentWidgetMessage, n as AgentExecutionState, nr as ComposerResubmitOptions, p as AgentWidgetApproval, q as AgentWidgetDockConfig, qr as PersonaArtifactRecord, ri as SpeechCallbacks, rr as ComposerState, rt as AgentWidgetInitOptions, si as StreamAnimationPlugin, sn as AgentWidgetWebMcpConfig, tr as ComposerQuote, ut as AgentWidgetMarkdownRendererOverrides, vr as HistoryConversationPatch, wi as VoicePriorToolResult, wn as ClientSession, wr as HistoryScope, x as AgentWidgetAttachmentsConfig, xn as ClientFeedbackRequest, xr as HistoryIdentityStatus, yr as HistoryConversationSummary, z as AgentWidgetContextMentionSource, zr as PersonaArtifactDisplayMode } from "./types-BuDirJkQ.js";
2
+ import "./markdown-parsers-loader-CeovcyYf.js";
3
+ import { t as MentionSubmitBundle } from "./context-mention-manager-DmLI_RM6.js";
4
+ import { t as WebMcpBridge$1 } from "./webmcp-runtime-entry-CXLjRt1k.js";
5
+ import "./fallback-speech-engine-BMnlmKnY.js";
6
+ import "./defaults-DVo1wbZs.js";
7
7
  import { IconNode as IconNode$1 } from "lucide";
8
8
  import "marked";
9
9
  //#region src/components/message-bubble.d.ts
@@ -675,6 +675,12 @@ type DispatchOptions = {
675
675
  * answer.
676
676
  */
677
677
  voiceSpoken?: boolean;
678
+ /**
679
+ * Client-token only: page tools the voice server already ran for this
680
+ * delegated turn, sent as `voice.priorToolResults` with `voiceSpoken`.
681
+ * Proxy/agent payloads carry them as replayed tool rows instead.
682
+ */
683
+ voicePriorToolResults?: VoicePriorToolResult[];
678
684
  };
679
685
  type SSEHandler = (event: AgentWidgetEvent) => void;
680
686
  type SSEEventCallback = (eventType: string, payload: unknown) => void;
@@ -736,6 +742,12 @@ declare class AgentWidgetClient {
736
742
  * session that it should fall back to the legacy local-tool resume path,
737
743
  * if any).
738
744
  */
745
+ /**
746
+ * WebMCP access for a Runtype voice call's fast tier: the same per-turn
747
+ * snapshot `clientTools[]` carries, registry change notifications, and the
748
+ * voice execute path. `null` when WebMCP is not enabled.
749
+ */
750
+ getVoiceClientTools(): VoiceClientTools | null;
739
751
  executeWebMcpToolCall(wireToolName: string, args: unknown, signal?: AbortSignal): Promise<WebMcpToolResult> | null;
740
752
  /**
741
753
  * Get the current SSE event callback (used to preserve across client recreation)
@@ -946,11 +958,14 @@ declare class AgentWidgetClient {
946
958
  agentId: string;
947
959
  executionId: string;
948
960
  approvalId: string;
949
- }, decision: 'approved' | 'denied'): Promise<Response>;
961
+ }, decision: 'approved' | 'denied', options?: {
962
+ assistantMessageId?: string;
963
+ }): Promise<Response>;
950
964
  resumeFlow(executionId: string, toolOutputs: Record<string, unknown>, options?: {
951
965
  streamResponse?: boolean;
952
966
  signal?: AbortSignal;
953
967
  after?: string;
968
+ assistantMessageId?: string;
954
969
  }): Promise<Response>;
955
970
  }
956
971
  //#endregion
@@ -2611,10 +2626,13 @@ declare class AgentWidgetSession {
2611
2626
  * Internal (voice client delegation): this is the delegated voice turn.
2612
2627
  * `userMessageId` names an existing transcript bubble to submit as the
2613
2628
  * turn's user message instead of appending a new one, so the spoken
2614
- * request appears (and is sent) exactly once.
2629
+ * request appears (and is sent) exactly once. `priorToolResults`: page
2630
+ * tools the voice server already ran for this turn, recorded once as
2631
+ * completed tool rows after the request (see voicePriorToolRows).
2615
2632
  */
2616
2633
  voiceTurn?: {
2617
- userMessageId?: string;
2634
+ userMessageId?: string | null;
2635
+ priorToolResults?: unknown;
2618
2636
  };
2619
2637
  }): Promise<void>;
2620
2638
  /**
@@ -2687,7 +2705,7 @@ declare class AgentWidgetSession {
2687
2705
  * bridge Promise parked in `requestWebMcpApproval`. No-op if already
2688
2706
  * resolved (double-click, re-render).
2689
2707
  */
2690
- resolveWebMcpApproval(approvalMessageId: string, decision: "approved" | "denied"): void;
2708
+ resolveWebMcpApproval(approvalMessageId: string, decision: "approved" | "denied" | "timeout"): void;
2691
2709
  /**
2692
2710
  * Resolve a tool approval request (approve or deny).
2693
2711
  * Updates the approval message status, calls the API (or custom onDecision),
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=[1e3,2e3,4e3,8e3,8e3];function t(t){let n=0,r=null,i=null,a=!1,o=()=>{if(i&&=(clearTimeout(i),null),r){let e=r;r=null,e()}},s=()=>{let e=t.getStatus();(e===`resuming`||e===`paused`)&&o()},c=()=>{(typeof document>`u`||document.visibilityState!==`hidden`)&&s()},l=()=>{s()},u=()=>{a||=(typeof document<`u`&&document.addEventListener(`visibilitychange`,c),typeof window<`u`&&window.addEventListener(`online`,l),!0)},d=()=>{a&&=(typeof document<`u`&&document.removeEventListener(`visibilitychange`,c),typeof window<`u`&&window.removeEventListener(`online`,l),!1)},f=e=>new Promise(t=>{r=t,i=setTimeout(()=>{i=null,r=null,t()},e)}),p=()=>{let e=t.getResumable();t.clearResumable(),t.setReconnecting(!1),n=0,d(),t.setAbortController(null);let r=!1;for(let e of t.getMessages())e.streaming&&(e.streaming=!1,r=!0);let i=t.buildErrorContent(`Connection lost and the response could not be resumed.`);i?t.appendMessage({id:`reconnect-failed-${e?.executionId??t.nextSequence()}`,role:`assistant`,content:i,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:t.nextSequence()}):r&&t.notifyMessagesChanged(),t.setStreaming(!1),t.setStatus(`idle`),t.onError(/* @__PURE__ */ Error(`Durable session reconnect failed.`))},m=async()=>{let r=t.config.reconnect?.backoffMs??e,i=t.config.reconnect?.maxAttempts??r.length,a=t.config.reconnectStream;if(!a)t.setReconnecting(!1);else{for(;t.getResumable()&&n<i;){n+=1,t.setStatus(`resuming`);let e=t.getResumable(),o=e.lastEventId,s=new AbortController;t.setAbortController(s),t.emitReconnect({phase:`resuming`,handle:e,attempt:n});let c=null;try{let t=await a({executionId:e.executionId,after:e.lastEventId,signal:s.signal});t&&t.ok&&t.body&&(c=t.body)}catch{c=null}if(s.signal.aborted)return;if(c){let r=t.getMessages().find(t=>t.id===e.assistantMessageId)?.content,i=typeof r==`string`?r:``;try{await t.resumeConnect(c,e.assistantMessageId,i)}catch{}if(s.signal.aborted)return;if(!t.getResumable()){t.setReconnecting(!1),n=0,d(),t.emitReconnect({phase:`resumed`,handle:e});return}t.getResumable().lastEventId!==o&&(n=0)}if(t.getResumable()&&n<i&&(t.setStatus(`paused`),await f(r[Math.min(n-1,r.length-1)]??1e3),s.signal.aborted))return}t.getResumable()&&p()}};return{begin(){n=0,u(),m()},teardown(){i&&=(clearTimeout(i),null),r=null,n=0,d()},wake:o}}exports.createReconnectController=t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=[1e3,2e3,4e3,8e3,8e3];function t(t){let n=0,r=null,i=null,a=!1,o=()=>{if(i&&=(clearTimeout(i),null),r){let e=r;r=null,e()}},s=()=>{let e=t.getStatus();(e===`resuming`||e===`paused`)&&o()},c=()=>{(typeof document>`u`||document.visibilityState!==`hidden`)&&s()},l=()=>{s()},u=()=>{a||=(typeof document<`u`&&document.addEventListener(`visibilitychange`,c),typeof window<`u`&&window.addEventListener(`online`,l),!0)},d=()=>{a&&=(typeof document<`u`&&document.removeEventListener(`visibilitychange`,c),typeof window<`u`&&window.removeEventListener(`online`,l),!1)},f=e=>new Promise(t=>{r=t,i=setTimeout(()=>{i=null,r=null,t()},e)}),p=()=>{let e=t.getResumable();t.clearResumable(),t.setReconnecting(!1),n=0,d(),t.setAbortController(null);let r=!1;for(let e of t.getMessages())e.streaming&&(e.streaming=!1,r=!0);let i=t.buildErrorContent(`Connection lost and the response could not be resumed.`);i?t.appendMessage({id:`reconnect-failed-${e?.executionId??t.nextSequence()}`,role:`assistant`,content:i,localOnly:!0,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:t.nextSequence()}):r&&t.notifyMessagesChanged(),t.setStreaming(!1),t.setStatus(`idle`),t.onError(/* @__PURE__ */ Error(`Durable session reconnect failed.`))},m=async()=>{let r=t.config.reconnect?.backoffMs??e,i=t.config.reconnect?.maxAttempts??r.length,a=t.config.reconnectStream;if(!a)t.setReconnecting(!1);else{for(;t.getResumable()&&n<i;){n+=1,t.setStatus(`resuming`);let e=t.getResumable(),o=e.lastEventId,s=new AbortController;t.setAbortController(s),t.emitReconnect({phase:`resuming`,handle:e,attempt:n});let c=null;try{let t=await a({executionId:e.executionId,after:e.lastEventId,signal:s.signal});t&&t.ok&&t.body&&(c=t.body)}catch{c=null}if(s.signal.aborted)return;if(c){let r=t.getMessages().find(t=>t.id===e.assistantMessageId)?.content,i=typeof r==`string`?r:``;try{await t.resumeConnect(c,e.assistantMessageId,i)}catch{}if(s.signal.aborted)return;if(!t.getResumable()){t.setReconnecting(!1),n=0,d(),t.emitReconnect({phase:`resumed`,handle:e});return}t.getResumable().lastEventId!==o&&(n=0)}if(c&&t.getResumable()&&t.settleParked(e.executionId)){n=0,d();return}if(t.getResumable()&&n<i&&(t.setStatus(`paused`),await f(r[Math.min(n-1,r.length-1)]??1e3),s.signal.aborted))return}t.getResumable()&&p()}};return{begin(){n=0,u(),m()},teardown(){i&&=(clearTimeout(i),null),r=null,n=0,d()},wake:o}}exports.createReconnectController=t;
@@ -1,5 +1,5 @@
1
- import { T as AgentWidgetConfig, Xr as ResumableHandle, mt as AgentWidgetMessage } from "./types-BdO1jNRm.cjs";
2
- import { n as AgentWidgetSessionStatus } from "./session-a_qIp4xp.cjs";
1
+ import { $r as ResumableHandle, T as AgentWidgetConfig, mt as AgentWidgetMessage } from "./types-BuDirJkQ.cjs";
2
+ import { n as AgentWidgetSessionStatus } from "./session-iLyKipoM.cjs";
3
3
  //#region src/session-reconnect.d.ts
4
4
  /**
5
5
  * The narrow surface the reconnect loop needs from the owning session. The
@@ -21,6 +21,12 @@ export interface ReconnectHost {
21
21
  /** Pipe a resumed SSE body through the session, filling the same bubble. */
22
22
  resumeConnect(body: ReadableStream<Uint8Array>, assistantMessageId: string, seedContent: string): Promise<void>;
23
23
  appendMessage(message: AgentWidgetMessage): void;
24
+ /**
25
+ * After an attempt that did not finish the run: if the run is parked on an
26
+ * await (or a reload-interrupted page tool), settle the session quietly and
27
+ * return true so the loop stops; return false for an ordinary drop.
28
+ */
29
+ settleParked(executionId: string): boolean;
24
30
  nextSequence(): number;
25
31
  emitReconnect(event: {
26
32
  phase: "paused" | "resuming" | "resumed";
@@ -1,5 +1,5 @@
1
- import { T as AgentWidgetConfig, Xr as ResumableHandle, mt as AgentWidgetMessage } from "./types-BdO1jNRm.js";
2
- import { n as AgentWidgetSessionStatus } from "./session-a_qIp4xp.js";
1
+ import { $r as ResumableHandle, T as AgentWidgetConfig, mt as AgentWidgetMessage } from "./types-BuDirJkQ.js";
2
+ import { n as AgentWidgetSessionStatus } from "./session-iLyKipoM.js";
3
3
  //#region src/session-reconnect.d.ts
4
4
  /**
5
5
  * The narrow surface the reconnect loop needs from the owning session. The
@@ -21,6 +21,12 @@ export interface ReconnectHost {
21
21
  /** Pipe a resumed SSE body through the session, filling the same bubble. */
22
22
  resumeConnect(body: ReadableStream<Uint8Array>, assistantMessageId: string, seedContent: string): Promise<void>;
23
23
  appendMessage(message: AgentWidgetMessage): void;
24
+ /**
25
+ * After an attempt that did not finish the run: if the run is parked on an
26
+ * await (or a reload-interrupted page tool), settle the session quietly and
27
+ * return true so the loop stops; return false for an ordinary drop.
28
+ */
29
+ settleParked(executionId: string): boolean;
24
30
  nextSequence(): number;
25
31
  emitReconnect(event: {
26
32
  phase: "paused" | "resuming" | "resumed";
@@ -1 +1 @@
1
- var e=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}};function t(e){let t=0,r=null,i=null,a=!1,o=()=>{if(i&&=(clearTimeout(i),null),r){let e=r;r=null,e()}},s=()=>{let t=e.getStatus();(t===`resuming`||t===`paused`)&&o()},c=()=>{(typeof document>`u`||document.visibilityState!==`hidden`)&&s()},l=()=>{s()},u=()=>{a||=(typeof document<`u`&&document.addEventListener(`visibilitychange`,c),typeof window<`u`&&window.addEventListener(`online`,l),!0)},d=()=>{a&&=(typeof document<`u`&&document.removeEventListener(`visibilitychange`,c),typeof window<`u`&&window.removeEventListener(`online`,l),!1)},f=e=>new Promise(t=>{r=t,i=setTimeout(()=>{i=null,r=null,t()},e)}),p=()=>{let n=e.getResumable();e.clearResumable(),e.setReconnecting(!1),t=0,d(),e.setAbortController(null);let r=!1;for(let t of e.getMessages())t.streaming&&(t.streaming=!1,r=!0);let i=e.buildErrorContent(`Connection lost and the response could not be resumed.`);i?e.appendMessage({id:`reconnect-failed-${n?.executionId??e.nextSequence()}`,role:`assistant`,content:i,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()}):r&&e.notifyMessagesChanged(),e.setStreaming(!1),e.setStatus(`idle`),e.onError(/* @__PURE__ */ Error(`Durable session reconnect failed.`))},m=async()=>{let r=e.config.reconnect?.backoffMs??n,i=e.config.reconnect?.maxAttempts??r.length,a=e.config.reconnectStream;if(!a)e.setReconnecting(!1);else{for(;e.getResumable()&&t<i;){t+=1,e.setStatus(`resuming`);let n=e.getResumable(),o=n.lastEventId,s=new AbortController;e.setAbortController(s),e.emitReconnect({phase:`resuming`,handle:n,attempt:t});let c=null;try{let e=await a({executionId:n.executionId,after:n.lastEventId,signal:s.signal});e&&e.ok&&e.body&&(c=e.body)}catch{c=null}if(s.signal.aborted)return;if(c){let r=e.getMessages().find(e=>e.id===n.assistantMessageId)?.content,i=typeof r==`string`?r:``;try{await e.resumeConnect(c,n.assistantMessageId,i)}catch{}if(s.signal.aborted)return;if(!e.getResumable()){e.setReconnecting(!1),t=0,d(),e.emitReconnect({phase:`resumed`,handle:n});return}e.getResumable().lastEventId!==o&&(t=0)}if(e.getResumable()&&t<i&&(e.setStatus(`paused`),await f(r[Math.min(t-1,r.length-1)]??1e3),s.signal.aborted))return}e.getResumable()&&p()}};return{begin(){t=0,u(),m()},teardown(){i&&=(clearTimeout(i),null),r=null,t=0,d()},wake:o}}var n;e((()=>{n=[1e3,2e3,4e3,8e3,8e3]}))();export{t as createReconnectController};
1
+ var e=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},t,n=e((()=>{t=`reconnect-failed-`}));function r(e){let n=0,r=null,a=null,o=!1,s=()=>{if(a&&=(clearTimeout(a),null),r){let e=r;r=null,e()}},c=()=>{let t=e.getStatus();(t===`resuming`||t===`paused`)&&s()},l=()=>{(typeof document>`u`||document.visibilityState!==`hidden`)&&c()},u=()=>{c()},d=()=>{o||=(typeof document<`u`&&document.addEventListener(`visibilitychange`,l),typeof window<`u`&&window.addEventListener(`online`,u),!0)},f=()=>{o&&=(typeof document<`u`&&document.removeEventListener(`visibilitychange`,l),typeof window<`u`&&window.removeEventListener(`online`,u),!1)},p=e=>new Promise(t=>{r=t,a=setTimeout(()=>{a=null,r=null,t()},e)}),m=()=>{let r=e.getResumable();e.clearResumable(),e.setReconnecting(!1),n=0,f(),e.setAbortController(null);let i=!1;for(let t of e.getMessages())t.streaming&&(t.streaming=!1,i=!0);let a=e.buildErrorContent(`Connection lost and the response could not be resumed.`);a?e.appendMessage({id:`${t}${r?.executionId??e.nextSequence()}`,role:`assistant`,content:a,localOnly:!0,createdAt:(/* @__PURE__ */ new Date()).toISOString(),streaming:!1,sequence:e.nextSequence()}):i&&e.notifyMessagesChanged(),e.setStreaming(!1),e.setStatus(`idle`),e.onError(/* @__PURE__ */ Error(`Durable session reconnect failed.`))},h=async()=>{let t=e.config.reconnect?.backoffMs??i,r=e.config.reconnect?.maxAttempts??t.length,a=e.config.reconnectStream;if(!a)e.setReconnecting(!1);else{for(;e.getResumable()&&n<r;){n+=1,e.setStatus(`resuming`);let i=e.getResumable(),o=i.lastEventId,s=new AbortController;e.setAbortController(s),e.emitReconnect({phase:`resuming`,handle:i,attempt:n});let c=null;try{let e=await a({executionId:i.executionId,after:i.lastEventId,signal:s.signal});e&&e.ok&&e.body&&(c=e.body)}catch{c=null}if(s.signal.aborted)return;if(c){let t=e.getMessages().find(e=>e.id===i.assistantMessageId)?.content,r=typeof t==`string`?t:``;try{await e.resumeConnect(c,i.assistantMessageId,r)}catch{}if(s.signal.aborted)return;if(!e.getResumable()){e.setReconnecting(!1),n=0,f(),e.emitReconnect({phase:`resumed`,handle:i});return}e.getResumable().lastEventId!==o&&(n=0)}if(c&&e.getResumable()&&e.settleParked(i.executionId)){n=0,f();return}if(e.getResumable()&&n<r&&(e.setStatus(`paused`),await p(t[Math.min(n-1,t.length-1)]??1e3),s.signal.aborted))return}e.getResumable()&&m()}};return{begin(){n=0,d(),h()},teardown(){a&&=(clearTimeout(a),null),r=null,n=0,f()},wake:s}}var i;e((()=>{n(),i=[1e3,2e3,4e3,8e3,8e3]}))();export{r as createReconnectController};
@@ -1,4 +1,4 @@
1
- import { M as AgentWidgetContextMentionItem, V as AgentWidgetContextProvider, z as AgentWidgetContextMentionSource } from "./types-BdO1jNRm.cjs";
1
+ import { M as AgentWidgetContextMentionItem, V as AgentWidgetContextProvider, z as AgentWidgetContextMentionSource } from "./types-BuDirJkQ.cjs";
2
2
  import { r as EnrichedPageElement } from "./dom-context-DHTabIn7.cjs";
3
3
  //#region src/vendor/smart-dom-reader/index.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { M as AgentWidgetContextMentionItem, V as AgentWidgetContextProvider, z as AgentWidgetContextMentionSource } from "./types-BdO1jNRm.js";
1
+ import { M as AgentWidgetContextMentionItem, V as AgentWidgetContextProvider, z as AgentWidgetContextMentionSource } from "./types-BuDirJkQ.js";
2
2
  import { r as EnrichedPageElement } from "./dom-context-DHTabIn7.js";
3
3
  //#region src/vendor/smart-dom-reader/index.d.ts
4
4
  /**