@lawpath-tech/openclaw 2026.2.21-19 → 2026.2.21-21

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 (183) hide show
  1. package/dist/{agents-C9ij96eI.js → agents-C83RLKX2.js} +4 -4
  2. package/dist/{agents.config-PFAfbBID.js → agents.config-BVjazvnK.js} +1 -1
  3. package/dist/{agents.config-CBvMKGLh.js → agents.config-dnXbFv5H.js} +1 -1
  4. package/dist/{audio-preflight-omzaYFGD.js → audio-preflight-CLqoZYgI.js} +4 -4
  5. package/dist/{audio-preflight-CODznzqu.js → audio-preflight-Da7vejCH.js} +4 -4
  6. package/dist/{auth-choice-DH2T1E9c.js → auth-choice-BJNaxS-L.js} +1 -1
  7. package/dist/{auth-choice-CLiY8PdF.js → auth-choice-Hb6530su.js} +1 -1
  8. package/dist/{banner-CqQBBjKH.js → banner-dFAx4eE_.js} +1 -1
  9. package/dist/build-info.json +3 -3
  10. package/dist/bundled/boot-md/handler.js +6 -6
  11. package/dist/bundled/session-memory/handler.js +6 -6
  12. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  13. package/dist/{channel-options-e7Z9Smf2.js → channel-options--M8F-DHl.js} +1 -1
  14. package/dist/{channel-options-CLS27y1A.js → channel-options-D0Qjq83D.js} +1 -1
  15. package/dist/{channel-web-DHMbpU2p.js → channel-web-D8hSmcPF.js} +1 -1
  16. package/dist/{channels-cli-BDHLWbaU.js → channels-cli-6uwOEBM-.js} +4 -4
  17. package/dist/{channels-cli-CDwQerVi.js → channels-cli-BtZHPcBX.js} +4 -4
  18. package/dist/{chrome-BAv9fEiv.js → chrome-Bqbv_ZSj.js} +7 -7
  19. package/dist/{chrome-lRUqqgSD.js → chrome-CZuniMYN.js} +7 -7
  20. package/dist/{cli-BGJFLB0I.js → cli-CIImVBCM.js} +1 -1
  21. package/dist/{cli-C1nypCKP.js → cli-CijjdR37.js} +1 -1
  22. package/dist/{command-registry-pGuORBuB.js → command-registry-BtDC5Ll-.js} +9 -9
  23. package/dist/{completion-cli-Bf-Ojq_a.js → completion-cli-Bw5nZmTm.js} +2 -2
  24. package/dist/{completion-cli-C79-bpAx.js → completion-cli-CI6LWHg3.js} +1 -1
  25. package/dist/{config-cli-DLdH6zIF.js → config-cli-CgjgjWri.js} +1 -1
  26. package/dist/{config-cli-BcNHb4_E.js → config-cli-Dc0TQ1yE.js} +1 -1
  27. package/dist/{configure-BSt9S0yk.js → configure-CGqsSqXB.js} +3 -3
  28. package/dist/{configure-h1d7nrgR.js → configure-GUYUjx8A.js} +3 -3
  29. package/dist/{deliver-B2d2N8OJ.js → deliver-0ThKlzQo.js} +1 -1
  30. package/dist/{deliver-CLJRPnfx.js → deliver-CKH_FhS0.js} +1 -1
  31. package/dist/{doctor-completion-BB1f594d.js → doctor-completion-DgPc1rDZ.js} +1 -1
  32. package/dist/{doctor-completion-deY10x7w.js → doctor-completion-DipoVPSi.js} +1 -1
  33. package/dist/entry.js +1 -1
  34. package/dist/extensionAPI.js +6 -6
  35. package/dist/{gateway-cli-IziQis2t.js → gateway-cli-Ds3oN72Y.js} +8 -8
  36. package/dist/{gateway-cli-B-XwzYp2.js → gateway-cli-DuMINk2B.js} +8 -8
  37. package/dist/{health-DMrTgW8V.js → health-DQjqH1zU.js} +1 -1
  38. package/dist/{health-UmuJyu1Q.js → health-Dg0bAIKS.js} +1 -1
  39. package/dist/{hooks-cli-BparoMpt.js → hooks-cli-CEtCwdza.js} +2 -2
  40. package/dist/{hooks-cli-B6WCYLyG.js → hooks-cli-Cac2Ru8r.js} +2 -2
  41. package/dist/{image--DDZnw-F.js → image-88q3KE-C.js} +1 -1
  42. package/dist/{image-Ci28h-op.js → image-CxPjVob-.js} +1 -1
  43. package/dist/index.js +6 -6
  44. package/dist/llm-slug-generator.js +6 -6
  45. package/dist/{models-nhERae29.js → models-DnhANpnd.js} +2 -2
  46. package/dist/{models-cli-bfKNgoHD.js → models-cli-03noBf8W.js} +3 -3
  47. package/dist/{models-cli-BnbeEOCU.js → models-cli-CaP_rt4y.js} +2 -2
  48. package/dist/{onboard-D_VxXTXD.js → onboard-BMc-yUv5.js} +2 -2
  49. package/dist/{onboard-C3pJ0NU-.js → onboard-BZg2c27h.js} +2 -2
  50. package/dist/{onboard-channels-CyeyvIfw.js → onboard-channels-Lt2gG1e2.js} +1 -1
  51. package/dist/{onboard-channels-YvwszRaQ.js → onboard-channels-O6KvizE3.js} +1 -1
  52. package/dist/{onboarding-0zwx3Yv7.js → onboarding-CTgBlanm.js} +3 -3
  53. package/dist/{onboarding-D0_Q5m2W.js → onboarding-G28sv5Ms.js} +3 -3
  54. package/dist/{onboarding.finalize-CYb0_Q0z.js → onboarding.finalize-Cpt9Ymcn.js} +5 -5
  55. package/dist/{onboarding.finalize-CVeI23_g.js → onboarding.finalize-D2sylHDB.js} +6 -6
  56. package/dist/{pi-embedded-D7qD6fo-.js → pi-embedded-Dz24QZz9.js} +96 -17
  57. package/dist/{pi-embedded-CwQsXrVT.js → pi-embedded-ZvazjIyF.js} +96 -17
  58. package/dist/{pi-embedded-helpers-Cd0S0WfR.js → pi-embedded-helpers-B0Kht0I2.js} +4 -4
  59. package/dist/{pi-embedded-helpers-Ll4Lztu1.js → pi-embedded-helpers-CSE0v99A.js} +4 -4
  60. package/dist/{plugin-registry-83ThmVHf.js → plugin-registry-1pF4_jNl.js} +1 -1
  61. package/dist/{plugin-registry-D57lc9ob.js → plugin-registry-CHOacv01.js} +1 -1
  62. package/dist/plugin-sdk/{accounts-DUBJHEgi.js → accounts-BcQo4OUu.js} +1 -1
  63. package/dist/plugin-sdk/{accounts-wSu5JyDM.js → accounts-DEsAwvaZ.js} +1 -1
  64. package/dist/plugin-sdk/{accounts-Ciwy7Yxd.js → accounts-fnLsjAOi.js} +3 -3
  65. package/dist/plugin-sdk/{active-listener-Bnau4oiu.js → active-listener-CeaKSm29.js} +1 -1
  66. package/dist/plugin-sdk/{agent-scope-cT7IxdHY.js → agent-scope-D5PlT0Z0.js} +2 -2
  67. package/dist/plugin-sdk/{api-key-rotation-ElOMCP9r.js → api-key-rotation-B3O1qn0m.js} +1 -1
  68. package/dist/plugin-sdk/{audio-preflight-DtozH3sJ.js → audio-preflight-CYSy3uuZ.js} +24 -24
  69. package/dist/plugin-sdk/{bindings-CKqdifyU.js → bindings-C0XEX0yK.js} +2 -2
  70. package/dist/plugin-sdk/{channel-activity-CCnr-9bS.js → channel-activity-WgE8Z4Bb.js} +1 -1
  71. package/dist/plugin-sdk/{channel-web-XYtgc8aq.js → channel-web-Nw-bUgtV.js} +22 -22
  72. package/dist/plugin-sdk/{chrome-BO7SUTgY.js → chrome-C1xnOQsc.js} +3 -3
  73. package/dist/plugin-sdk/{chunk-DyzO7IVo.js → chunk-CQk9vawA.js} +1 -1
  74. package/dist/plugin-sdk/{command-format-DcBXOX9Z.js → command-format-DHXa0Clc.js} +1 -1
  75. package/dist/plugin-sdk/{commands-registry-BsSKPwgj.js → commands-registry-yTZdwtLj.js} +4 -4
  76. package/dist/plugin-sdk/{config-9OZuRn0C.js → config--kW4R0el.js} +9 -9
  77. package/dist/plugin-sdk/{deliver-BO_wt0wd.js → deliver-C2gjA_UH.js} +10 -10
  78. package/dist/plugin-sdk/{diagnostic-DKyVS3IK.js → diagnostic-Up1aMyxZ.js} +1 -1
  79. package/dist/plugin-sdk/{image-C31B_R8P.js → image-Bcc99tVA.js} +4 -4
  80. package/dist/plugin-sdk/{image-ops-B8aJIly2.js → image-ops-C6RLbtSJ.js} +1 -1
  81. package/dist/plugin-sdk/index.js +53 -53
  82. package/dist/plugin-sdk/{ir-CD5VqKGg.js → ir-Cwi1KVG5.js} +4 -4
  83. package/dist/plugin-sdk/{local-roots-D4PCK2jj.js → local-roots-6BSl8AoA.js} +3 -3
  84. package/dist/plugin-sdk/{login-CW17h3xU.js → login-Cau5eVVj.js} +7 -7
  85. package/dist/plugin-sdk/{login-qr-CMdk06CS.js → login-qr-CLWtfA9m.js} +9 -9
  86. package/dist/plugin-sdk/{manager-CZPPxI6R.js → manager-C3Eb_8Hz.js} +8 -8
  87. package/dist/plugin-sdk/{manifest-registry-sgHvjA6E.js → manifest-registry-DvEm2HHf.js} +1 -1
  88. package/dist/plugin-sdk/{markdown-tables-Bo-r4msS.js → markdown-tables-cJqvQe9j.js} +1 -1
  89. package/dist/plugin-sdk/{message-channel-DmB4bGFh.js → message-channel-DY9wVB2A.js} +1 -1
  90. package/dist/plugin-sdk/{model-selection-CXooYLb2.js → model-selection-BjVTBZiY.js} +4 -4
  91. package/dist/plugin-sdk/{outbound-dAcQHyyr.js → outbound-Co1QSkdS.js} +7 -7
  92. package/dist/plugin-sdk/{outbound-attachment-CCxMtk8m.js → outbound-attachment-CsmRyZPI.js} +2 -2
  93. package/dist/plugin-sdk/{pi-auth-json-C-euHc3x.js → pi-auth-json-DfEOhoTK.js} +5 -5
  94. package/dist/plugin-sdk/{pi-embedded-helpers-DU0nLxRU.js → pi-embedded-helpers-D3EACnFn.js} +17 -17
  95. package/dist/plugin-sdk/plugins/runtime/types.d.ts +2 -0
  96. package/dist/plugin-sdk/{plugins-DIzw7Ncy.js → plugins-Dyz98ZJX.js} +4 -4
  97. package/dist/plugin-sdk/{pw-ai-CYmDAwXD.js → pw-ai-smoXiGqZ.js} +8 -8
  98. package/dist/plugin-sdk/{qmd-manager-DQiT4WTr.js → qmd-manager-CUhJ7WG2.js} +4 -4
  99. package/dist/plugin-sdk/{registry-O1yza0Vh.js → registry-DL-33c9X.js} +2 -2
  100. package/dist/plugin-sdk/{replies-Bnu7HnvW.js → replies-Bkaifx0j.js} +3 -3
  101. package/dist/plugin-sdk/{reply-BSOpvBX4.js → reply-Cb54ddUA.js} +158 -79
  102. package/dist/plugin-sdk/{reply-prefix-BF0omhZE.js → reply-prefix-5vdbga0R.js} +1 -1
  103. package/dist/plugin-sdk/{resolve-outbound-target-DzZIT1V1.js → resolve-outbound-target-CP7QDN14.js} +2 -2
  104. package/dist/plugin-sdk/{resolve-route-B63ztF-V.js → resolve-route-eopifBrM.js} +3 -3
  105. package/dist/plugin-sdk/{retry-JFNwfUew.js → retry-5P3d0rYw.js} +1 -1
  106. package/dist/plugin-sdk/{runner-DztRiWhh.js → runner-DqwPn56n.js} +9 -9
  107. package/dist/plugin-sdk/{send-DEV4iiFj.js → send-C2NQjVF9.js} +10 -10
  108. package/dist/plugin-sdk/{send-D-spKwjf.js → send-D_X6p9H0.js} +10 -10
  109. package/dist/plugin-sdk/{send-CK3DCPv-.js → send-DnFB-v5n.js} +6 -6
  110. package/dist/plugin-sdk/{send-D1C2sJG1.js → send-PPtjKj-0.js} +7 -7
  111. package/dist/plugin-sdk/{send-DrYvH25B.js → send-_uj_NuFI.js} +6 -6
  112. package/dist/plugin-sdk/{session-DRJl5tKC.js → session-CZngPTYk.js} +4 -4
  113. package/dist/plugin-sdk/{skill-commands-Dv5AeOZQ.js → skill-commands-Cr54qPdy.js} +5 -5
  114. package/dist/plugin-sdk/{skills-5hEda4_Y.js → skills-Dcu4o-9l.js} +7 -7
  115. package/dist/plugin-sdk/{sqlite-DUu0dwic.js → sqlite-ulpcowfN.js} +1 -1
  116. package/dist/plugin-sdk/{store-DoRXD0QB.js → store-EUYCRBvs.js} +2 -2
  117. package/dist/plugin-sdk/{subsystem-C4Rh0kdL.js → subsystem-C9WnrKN8.js} +1 -1
  118. package/dist/plugin-sdk/{tables-C_81Ve2l.js → tables-CMdQECje.js} +1 -1
  119. package/dist/plugin-sdk/{target-errors-C638yp2-.js → target-errors-CrR2lAF7.js} +2 -2
  120. package/dist/plugin-sdk/{thinking-DexKPSsI.js → thinking-C7zYA2s9.js} +5 -5
  121. package/dist/plugin-sdk/{tokens-K9ITCatc.js → tokens-2475WU2Z.js} +1 -1
  122. package/dist/plugin-sdk/{tool-images-BvjD_HnR.js → tool-images-DCvC8yL7.js} +2 -2
  123. package/dist/plugin-sdk/{tool-loop-detection-BBRtoox8.js → tool-loop-detection-D0ADW0h2.js} +2 -2
  124. package/dist/plugin-sdk/tts/tts-core.d.ts +15 -0
  125. package/dist/plugin-sdk/tts/tts.d.ts +16 -0
  126. package/dist/plugin-sdk/web-BVkjyY4A.js +65 -0
  127. package/dist/plugin-sdk/{whatsapp-actions-D8i2vCxS.js → whatsapp-actions-DC4RRNqv.js} +21 -21
  128. package/dist/{plugins-cli-BymsOcmR.js → plugins-cli-CflNTqmB.js} +2 -2
  129. package/dist/{plugins-cli-DOWA2F0z.js → plugins-cli-DW0TLzrq.js} +2 -2
  130. package/dist/{program-T05XIetU.js → program-DUkjf6lq.js} +7 -7
  131. package/dist/{program-context-CDmctW1L.js → program-context-C0-LzXoV.js} +17 -17
  132. package/dist/{prompt-select-styled-cR4-U64b.js → prompt-select-styled-CQUE1vow.js} +4 -4
  133. package/dist/{prompt-select-styled-BbzQhWF7.js → prompt-select-styled-CWNxdPrL.js} +4 -4
  134. package/dist/{provider-auth-helpers-BbnDoytN.js → provider-auth-helpers-D39L7fZC.js} +1 -1
  135. package/dist/{provider-auth-helpers-C4RNIRyy.js → provider-auth-helpers-bYUBBkmL.js} +1 -1
  136. package/dist/{push-apns-Dli4pG4y.js → push-apns-DGIqfAg5.js} +1 -1
  137. package/dist/{push-apns-DUeNpqyF.js → push-apns-Qfohz-Hs.js} +1 -1
  138. package/dist/{pw-ai-KrN0mqVH.js → pw-ai-D-_aGzdQ.js} +1 -1
  139. package/dist/{pw-ai-C-kqYO4L.js → pw-ai-S3cpSYOy.js} +1 -1
  140. package/dist/{register.agent-aY_6enDc.js → register.agent-BEM0_4uG.js} +5 -5
  141. package/dist/{register.agent-DNAtU5WP.js → register.agent-WQgVmACk.js} +6 -6
  142. package/dist/{register.configure-CwlwOMZ3.js → register.configure-CCpFmFPt.js} +6 -6
  143. package/dist/{register.configure-C_n9kIWJ.js → register.configure-CdW3aECy.js} +6 -6
  144. package/dist/{register.maintenance-DC40nnCm.js → register.maintenance-B8RZLSOe.js} +8 -8
  145. package/dist/{register.maintenance-Dddndcoo.js → register.maintenance-CM3QEdFz.js} +7 -7
  146. package/dist/{register.message-DiR6desB.js → register.message-BRLYHuVS.js} +2 -2
  147. package/dist/{register.message-CpEf0b15.js → register.message-XYm9NyDT.js} +2 -2
  148. package/dist/{register.onboard-bOeA39xj.js → register.onboard-BzAJbRpP.js} +4 -4
  149. package/dist/{register.onboard-VzVmqpEA.js → register.onboard-EwGHFUsd.js} +4 -4
  150. package/dist/{register.setup-CNLQzxl8.js → register.setup-33shhZje.js} +4 -4
  151. package/dist/{register.setup-D6iO5Xqa.js → register.setup-DpdZyiMv.js} +4 -4
  152. package/dist/{register.status-health-sessions-CoiaeduR.js → register.status-health-sessions-C8-iqepo.js} +3 -3
  153. package/dist/{register.status-health-sessions-BtJeTZnN.js → register.status-health-sessions-CK4f2nj_.js} +3 -3
  154. package/dist/{register.subclis-CFTYYdAQ.js → register.subclis-Mn68G5tp.js} +9 -9
  155. package/dist/{reply-Bv-RvRzs.js → reply-DuVUTFfT.js} +82 -3
  156. package/dist/{run-main-EzFOCEdp.js → run-main-CNB3qjRM.js} +14 -14
  157. package/dist/{runner-ChBxge-W.js → runner-D1eXJZ8T.js} +1 -1
  158. package/dist/{runner-Dq-qfrq7.js → runner-a43IsYad.js} +1 -1
  159. package/dist/{server-node-events-B9TqPvCI.js → server-node-events-B3o3P600.js} +2 -2
  160. package/dist/{server-node-events-syk21TN6.js → server-node-events-BPFwUGbS.js} +2 -2
  161. package/dist/{session-dirs-BAcQuXpY.js → session-dirs-Cw2efkey.js} +1 -1
  162. package/dist/{session-dirs-t0YpmrIL.js → session-dirs-DsU4kvIK.js} +1 -1
  163. package/dist/{status-keCWmejk.js → status-BSJIuIlN.js} +1 -1
  164. package/dist/{status-05251w21.js → status-BhHpKHQP.js} +2 -2
  165. package/dist/{status-BqDiXxwL.js → status-C2PvVLaW.js} +1 -1
  166. package/dist/{status-B8UVm7P3.js → status-CLKmcFCC.js} +2 -2
  167. package/dist/{subagent-registry-Lm4ps45z.js → subagent-registry-Da0a_Vka.js} +82 -3
  168. package/dist/{update-cli-BTF6TXGD.js → update-cli-BW3q5tFm.js} +7 -7
  169. package/dist/{update-cli-aW6jVJIJ.js → update-cli-D4EUMrX6.js} +8 -8
  170. package/dist/{web-BYZfljIx.js → web-BTbIFuWM.js} +2 -2
  171. package/dist/{web-BjxYv-hA.js → web-C7TQSVU0.js} +1 -1
  172. package/dist/{web-DPHo2cWX.js → web-CVSol55V.js} +6 -6
  173. package/dist/{web-Cs0IP-ZO.js → web-Y49Dumye.js} +6 -6
  174. package/extensions/voice-call/package.json +2 -0
  175. package/extensions/voice-call/src/config.ts +16 -3
  176. package/extensions/voice-call/src/providers/realtime-session.ts +210 -0
  177. package/extensions/voice-call/src/providers/twilio.ts +31 -13
  178. package/extensions/voice-call/src/response-generator.ts +3 -3
  179. package/extensions/voice-call/src/telephony-audio.ts +54 -0
  180. package/extensions/voice-call/src/telephony-tts.ts +40 -2
  181. package/extensions/voice-call/src/webhook.ts +174 -8
  182. package/package.json +1 -1
  183. package/dist/plugin-sdk/web-DiLYLsml.js +0 -65
@@ -5458,6 +5458,43 @@ async function openaiTTS(params) {
5458
5458
  clearTimeout(timeout);
5459
5459
  }
5460
5460
  }
5461
+ /**
5462
+ * Streaming variant of openaiTTS. Returns the response body as a ReadableStream
5463
+ * so callers can process PCM chunks as they arrive instead of buffering the entire response.
5464
+ */
5465
+ async function openaiTTSStream(params) {
5466
+ const { text, apiKey, model, voice, responseFormat, timeoutMs } = params;
5467
+ if (!isValidOpenAIModel(model)) throw new Error(`Invalid model: ${model}`);
5468
+ if (!isValidOpenAIVoice(voice)) throw new Error(`Invalid voice: ${voice}`);
5469
+ const controller = new AbortController();
5470
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
5471
+ const response = await fetch(`${getOpenAITtsBaseUrl()}/audio/speech`, {
5472
+ method: "POST",
5473
+ headers: {
5474
+ Authorization: `Bearer ${apiKey}`,
5475
+ "Content-Type": "application/json"
5476
+ },
5477
+ body: JSON.stringify({
5478
+ model,
5479
+ input: text,
5480
+ voice,
5481
+ response_format: responseFormat
5482
+ }),
5483
+ signal: controller.signal
5484
+ });
5485
+ if (!response.ok) {
5486
+ clearTimeout(timeout);
5487
+ throw new Error(`OpenAI TTS API error (${response.status})`);
5488
+ }
5489
+ if (!response.body) {
5490
+ clearTimeout(timeout);
5491
+ throw new Error("OpenAI TTS response has no body");
5492
+ }
5493
+ return {
5494
+ body: response.body,
5495
+ cleanup: () => clearTimeout(timeout)
5496
+ };
5497
+ }
5461
5498
  function inferEdgeExtension(outputFormat) {
5462
5499
  const normalized = outputFormat.toLowerCase();
5463
5500
  if (normalized.includes("webm")) return ".webm";
@@ -5983,6 +6020,45 @@ async function textToSpeechTelephony(params) {
5983
6020
  error: `TTS conversion failed: ${errors.join("; ") || "no providers available"}`
5984
6021
  };
5985
6022
  }
6023
+ /**
6024
+ * Streaming variant of textToSpeechTelephony.
6025
+ * Returns a ReadableStream of PCM audio chunks for incremental processing.
6026
+ * Only supports OpenAI provider (PCM format required for streaming).
6027
+ */
6028
+ async function textToSpeechTelephonyStream(params) {
6029
+ const config = resolveTtsConfig(params.cfg);
6030
+ if ((config.provider ?? "openai") !== "openai") return {
6031
+ success: false,
6032
+ error: "Streaming TTS only supported for OpenAI"
6033
+ };
6034
+ const apiKey = resolveTtsApiKey(config, "openai");
6035
+ if (!apiKey) return {
6036
+ success: false,
6037
+ error: "No OpenAI API key for streaming TTS"
6038
+ };
6039
+ try {
6040
+ const output = TELEPHONY_OUTPUT.openai;
6041
+ const result = await openaiTTSStream({
6042
+ text: params.text,
6043
+ apiKey,
6044
+ model: config.openai.model,
6045
+ voice: config.openai.voice,
6046
+ responseFormat: "pcm",
6047
+ timeoutMs: config.timeoutMs
6048
+ });
6049
+ return {
6050
+ success: true,
6051
+ stream: result.body,
6052
+ sampleRate: output.sampleRate,
6053
+ cleanup: result.cleanup
6054
+ };
6055
+ } catch (err) {
6056
+ return {
6057
+ success: false,
6058
+ error: err instanceof Error ? err.message : String(err)
6059
+ };
6060
+ }
6061
+ }
5986
6062
  async function maybeApplyTtsToPayload(params) {
5987
6063
  const config = resolveTtsConfig(params.cfg);
5988
6064
  const prefsPath = resolveTtsPrefsPath(config);
@@ -22295,7 +22371,7 @@ async function runWithImageModelFallback(params) {
22295
22371
  function createDefaultDeps() {
22296
22372
  return {
22297
22373
  sendMessageWhatsApp: async (...args) => {
22298
- const { sendMessageWhatsApp } = await import("./web-BYZfljIx.js");
22374
+ const { sendMessageWhatsApp } = await import("./web-BTbIFuWM.js");
22299
22375
  return await sendMessageWhatsApp(...args);
22300
22376
  },
22301
22377
  sendMessageTelegram: async (...args) => {
@@ -40919,7 +40995,7 @@ function loadWebLoginQr() {
40919
40995
  return webLoginQrPromise;
40920
40996
  }
40921
40997
  function loadWebChannel() {
40922
- webChannelPromise ??= import("./web-BYZfljIx.js");
40998
+ webChannelPromise ??= import("./web-BTbIFuWM.js");
40923
40999
  return webChannelPromise;
40924
41000
  }
40925
41001
  function loadWhatsAppActions() {
@@ -40932,7 +41008,10 @@ function createPluginRuntime() {
40932
41008
  config: createRuntimeConfig(),
40933
41009
  system: createRuntimeSystem(),
40934
41010
  media: createRuntimeMedia(),
40935
- tts: { textToSpeechTelephony },
41011
+ tts: {
41012
+ textToSpeechTelephony,
41013
+ textToSpeechTelephonyStream
41014
+ },
40936
41015
  tools: createRuntimeTools(),
40937
41016
  channel: createRuntimeChannel(),
40938
41017
  logging: createRuntimeLogging(),
@@ -13,7 +13,7 @@ import "./client-B5QR5Bi9.js";
13
13
  import "./call-D6ajQjvV.js";
14
14
  import "./message-channel-CVHJDItx.js";
15
15
  import "./pairing-token-Byh6drgn.js";
16
- import "./subagent-registry-Lm4ps45z.js";
16
+ import "./subagent-registry-Da0a_Vka.js";
17
17
  import "./sessions-BJnLP6OJ.js";
18
18
  import "./tokens-ANnYrShl.js";
19
19
  import "./plugins-DStDwRz0.js";
@@ -101,9 +101,9 @@ import { t as ensureOpenClawCliOnPath } from "./path-env-Co_fin1B.js";
101
101
  import "./catalog-Da8o-cxw.js";
102
102
  import "./note-DDecZomM.js";
103
103
  import "./plugin-auto-enable-shgsXVP6.js";
104
- import { t as ensurePluginRegistryLoaded } from "./plugin-registry-83ThmVHf.js";
104
+ import { t as ensurePluginRegistryLoaded } from "./plugin-registry-1pF4_jNl.js";
105
105
  import { t as assertSupportedRuntime } from "./runtime-guard-Cs_ClFhP.js";
106
- import { t as emitCliBanner } from "./banner-CqQBBjKH.js";
106
+ import { t as emitCliBanner } from "./banner-dFAx4eE_.js";
107
107
  import "./doctor-config-flow-B_6xrNyC.js";
108
108
  import { n as ensureConfigReady } from "./config-guard-MnZY2U8S.js";
109
109
  import process$1 from "node:process";
@@ -118,7 +118,7 @@ const routeHealth = {
118
118
  const verbose = getVerboseFlag(argv, { includeDebug: true });
119
119
  const timeoutMs = getPositiveIntFlagValue(argv, "--timeout");
120
120
  if (timeoutMs === null) return false;
121
- const { healthCommand } = await import("./health-UmuJyu1Q.js").then((n) => n.i);
121
+ const { healthCommand } = await import("./health-Dg0bAIKS.js").then((n) => n.i);
122
122
  await healthCommand({
123
123
  json,
124
124
  timeoutMs,
@@ -138,7 +138,7 @@ const routeStatus = {
138
138
  const verbose = getVerboseFlag(argv, { includeDebug: true });
139
139
  const timeoutMs = getPositiveIntFlagValue(argv, "--timeout");
140
140
  if (timeoutMs === null) return false;
141
- const { statusCommand } = await import("./status-05251w21.js").then((n) => n.t);
141
+ const { statusCommand } = await import("./status-BhHpKHQP.js").then((n) => n.t);
142
142
  await statusCommand({
143
143
  json,
144
144
  deep,
@@ -172,7 +172,7 @@ const routeAgentsList = {
172
172
  run: async (argv) => {
173
173
  const json = hasFlag(argv, "--json");
174
174
  const bindings = hasFlag(argv, "--bindings");
175
- const { agentsListCommand } = await import("./agents-C9ij96eI.js").then((n) => n.t);
175
+ const { agentsListCommand } = await import("./agents-C83RLKX2.js").then((n) => n.t);
176
176
  await agentsListCommand({
177
177
  json,
178
178
  bindings
@@ -243,7 +243,7 @@ const routes = [
243
243
  const pathArg = getCommandPositionals(argv)[2];
244
244
  if (!pathArg) return false;
245
245
  const json = hasFlag(argv, "--json");
246
- const { runConfigGet } = await import("./config-cli-DLdH6zIF.js");
246
+ const { runConfigGet } = await import("./config-cli-CgjgjWri.js");
247
247
  await runConfigGet({
248
248
  path: pathArg,
249
249
  json
@@ -256,7 +256,7 @@ const routes = [
256
256
  run: async (argv) => {
257
257
  const pathArg = getCommandPositionals(argv)[2];
258
258
  if (!pathArg) return false;
259
- const { runConfigUnset } = await import("./config-cli-DLdH6zIF.js");
259
+ const { runConfigUnset } = await import("./config-cli-CgjgjWri.js");
260
260
  await runConfigUnset({ path: pathArg });
261
261
  return true;
262
262
  }
@@ -270,7 +270,7 @@ const routes = [
270
270
  const local = hasFlag(argv, "--local");
271
271
  const json = hasFlag(argv, "--json");
272
272
  const plain = hasFlag(argv, "--plain");
273
- const { modelsListCommand } = await import("./models-nhERae29.js").then((n) => n.t);
273
+ const { modelsListCommand } = await import("./models-DnhANpnd.js").then((n) => n.t);
274
274
  await modelsListCommand({
275
275
  all,
276
276
  local,
@@ -301,7 +301,7 @@ const routes = [
301
301
  const plain = hasFlag(argv, "--plain");
302
302
  const check = hasFlag(argv, "--check");
303
303
  const probe = hasFlag(argv, "--probe");
304
- const { modelsStatusCommand } = await import("./models-nhERae29.js").then((n) => n.t);
304
+ const { modelsStatusCommand } = await import("./models-DnhANpnd.js").then((n) => n.t);
305
305
  await modelsStatusCommand({
306
306
  json,
307
307
  plain,
@@ -379,7 +379,7 @@ async function runCli(argv = process$1.argv) {
379
379
  assertSupportedRuntime();
380
380
  if (await tryRouteCli(normalizedArgv)) return;
381
381
  enableConsoleCapture();
382
- const { buildProgram } = await import("./program-T05XIetU.js");
382
+ const { buildProgram } = await import("./program-DUkjf6lq.js");
383
383
  const program = buildProgram();
384
384
  installUnhandledRejectionHandler();
385
385
  process$1.on("uncaughtException", (error) => {
@@ -392,10 +392,10 @@ async function runCli(argv = process$1.argv) {
392
392
  const { getProgramContext } = await import("./program-context-5q-A0wbP.js").then((n) => n.n);
393
393
  const ctx = getProgramContext(program);
394
394
  if (ctx) {
395
- const { registerCoreCliByName } = await import("./command-registry-pGuORBuB.js").then((n) => n.t);
395
+ const { registerCoreCliByName } = await import("./command-registry-BtDC5Ll-.js").then((n) => n.t);
396
396
  await registerCoreCliByName(program, ctx, primary, parseArgv);
397
397
  }
398
- const { registerSubCliByName } = await import("./register.subclis-CFTYYdAQ.js").then((n) => n.a);
398
+ const { registerSubCliByName } = await import("./register.subclis-Mn68G5tp.js").then((n) => n.a);
399
399
  await registerSubCliByName(program, primary);
400
400
  }
401
401
  if (!shouldSkipPluginCommandRegistration({
@@ -403,7 +403,7 @@ async function runCli(argv = process$1.argv) {
403
403
  primary,
404
404
  hasBuiltinPrimary: primary !== null && program.commands.some((command) => command.name() === primary)
405
405
  })) {
406
- const { registerPluginCliCommands } = await import("./cli-BGJFLB0I.js");
406
+ const { registerPluginCliCommands } = await import("./cli-CIImVBCM.js");
407
407
  const { loadConfig } = await import("./config-P-vz8Nlc.js").then((n) => n.t);
408
408
  registerPluginCliCommands(program, loadConfig());
409
409
  }
@@ -4,7 +4,7 @@ import { t as normalizeChatType } from "./chat-type-C_KiWNAH.js";
4
4
  import { _ as kindFromMime, d as detectMime, h as isAudioFileName, p as getFileExtension } from "./image-ops-BGmpOcey.js";
5
5
  import { A as normalizeProviderId, L as normalizeGoogleModelId, i as resolveApiKeyForProvider, r as requireApiKey, y as resolveOpenClawAgentDir } from "./model-auth-vtNH8C4P.js";
6
6
  import { d as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, f as isInboundPathAllowed, m as resolveIMessageAttachmentRoots, n as loadConfig, p as mergeInboundPathRoots } from "./config-Du_-inxH.js";
7
- import { S as ensureOpenClawModelsJson, t as describeImageWithModel } from "./image-Ci28h-op.js";
7
+ import { S as ensureOpenClawModelsJson, t as describeImageWithModel } from "./image-CxPjVob-.js";
8
8
  import { n as collectProviderApiKeysForExecution, r as executeWithApiKeyRotation, t as parseGeminiAuth } from "./gemini-auth-A2JaRMHH.js";
9
9
  import { n as fetchWithTimeout } from "./fetch-timeout-DL3f_O53.js";
10
10
  import { i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, r as MediaFetchError } from "./local-roots-JqlMsAYY.js";
@@ -4,7 +4,7 @@ import { G as resolveOpenClawAgentDir, T as resolveApiKeyForProvider, c as norma
4
4
  import { t as normalizeChatType } from "./chat-type-DFDuk3FY.js";
5
5
  import { _ as kindFromMime, d as detectMime, h as isAudioFileName, p as getFileExtension } from "./image-ops-BfqdVNxh.js";
6
6
  import { d as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, f as isInboundPathAllowed, m as resolveIMessageAttachmentRoots, n as loadConfig, p as mergeInboundPathRoots } from "./config-KL7847B1.js";
7
- import { S as ensureOpenClawModelsJson, t as describeImageWithModel } from "./image--DDZnw-F.js";
7
+ import { S as ensureOpenClawModelsJson, t as describeImageWithModel } from "./image-88q3KE-C.js";
8
8
  import { n as collectProviderApiKeysForExecution, r as executeWithApiKeyRotation, t as parseGeminiAuth } from "./gemini-auth-BF6ZCNOV.js";
9
9
  import { n as fetchWithTimeout } from "./fetch-timeout-BheTNyes.js";
10
10
  import { i as fetchRemoteMedia, n as getDefaultMediaLocalRoots, o as fetchWithSsrFGuard, r as MediaFetchError } from "./local-roots-C4BHj9W8.js";
@@ -1,7 +1,7 @@
1
1
  import "./paths-B4BZAPZh.js";
2
2
  import "./utils-BlC2Fskb.js";
3
3
  import "./thinking-EAliFiVK.js";
4
- import { At as agentCommand, C as loadSessionEntry, It as resolveOutboundTarget, Rt as createOutboundSendDeps, T as resolveGatewaySessionStoreTarget, dt as requestHeartbeatNow, vr as enqueueSystemEvent, w as pruneLegacyStoreKeys } from "./reply-Bv-RvRzs.js";
4
+ import { At as agentCommand, C as loadSessionEntry, It as resolveOutboundTarget, Rt as createOutboundSendDeps, T as resolveGatewaySessionStoreTarget, dt as requestHeartbeatNow, vr as enqueueSystemEvent, w as pruneLegacyStoreKeys } from "./reply-DuVUTFfT.js";
5
5
  import { c as normalizeMainKey } from "./session-key-DCt45XZa.js";
6
6
  import "./registry-Dygi7Azw.js";
7
7
  import { f as defaultRuntime } from "./subsystem-8bY95KEB.js";
@@ -102,7 +102,7 @@ import "./control-service-D8pPAw9I.js";
102
102
  import "./stagger-B6VQyn1F.js";
103
103
  import "./channel-selection-ZfFyXtQ1.js";
104
104
  import "./pi-tools.policy-DZSlTC8Z.js";
105
- import { c as parseMessageWithAttachments, l as formatForLog, r as registerApnsToken, s as normalizeRpcAttachmentsToChatAttachments } from "./push-apns-Dli4pG4y.js";
105
+ import { c as parseMessageWithAttachments, l as formatForLog, r as registerApnsToken, s as normalizeRpcAttachmentsToChatAttachments } from "./push-apns-DGIqfAg5.js";
106
106
  import { randomUUID } from "node:crypto";
107
107
 
108
108
  //#region src/gateway/server-node-events.ts
@@ -14,7 +14,7 @@ import "./client-B5QR5Bi9.js";
14
14
  import "./call-D6ajQjvV.js";
15
15
  import "./message-channel-CVHJDItx.js";
16
16
  import "./pairing-token-Byh6drgn.js";
17
- import { C as agentCommand, D as createOutboundSendDeps, bn as enqueueSystemEvent, cn as requestHeartbeatNow, ct as resolveOutboundTarget } from "./subagent-registry-Lm4ps45z.js";
17
+ import { C as agentCommand, D as createOutboundSendDeps, bn as enqueueSystemEvent, cn as requestHeartbeatNow, ct as resolveOutboundTarget } from "./subagent-registry-Da0a_Vka.js";
18
18
  import { d as updateSessionStore } from "./sessions-BJnLP6OJ.js";
19
19
  import "./tokens-ANnYrShl.js";
20
20
  import { r as normalizeChannelId } from "./plugins-DStDwRz0.js";
@@ -98,7 +98,7 @@ import "./onboard-helpers-LjsmkHmj.js";
98
98
  import "./prompt-style-DwCXob2h.js";
99
99
  import "./pairing-labels-D2jdEFFZ.js";
100
100
  import "./pi-tools.policy-BQwEWAuL.js";
101
- import { c as parseMessageWithAttachments, l as formatForLog, r as registerApnsToken, s as normalizeRpcAttachmentsToChatAttachments } from "./push-apns-DUeNpqyF.js";
101
+ import { c as parseMessageWithAttachments, l as formatForLog, r as registerApnsToken, s as normalizeRpcAttachmentsToChatAttachments } from "./push-apns-Qfohz-Hs.js";
102
102
  import { randomUUID } from "node:crypto";
103
103
 
104
104
  //#region src/gateway/server-node-events.ts
@@ -1,5 +1,5 @@
1
1
  import { h as pathExists } from "./utils-BlC2Fskb.js";
2
- import { K as trimLogTail } from "./reply-Bv-RvRzs.js";
2
+ import { K as trimLogTail } from "./reply-DuVUTFfT.js";
3
3
  import { t as runCommandWithTimeout } from "./exec-BmMB8-Xs.js";
4
4
  import { n as resolveControlUiDistIndexHealth, r as resolveControlUiDistIndexPathForRoot } from "./control-ui-assets-d_j0Pdnj.js";
5
5
  import { c as DEFAULT_PACKAGE_CHANNEL, f as isBetaTag, l as DEV_BRANCH, n as compareSemverStrings, o as detectPackageManager$1, p as isStableTag, u as channelToNpmTag } from "./update-check-B-fJT8wY.js";
@@ -1,6 +1,6 @@
1
1
  import { nt as pathExists } from "./entry.js";
2
2
  import { t as runCommandWithTimeout } from "./exec-CBKBIMpA.js";
3
- import { bt as trimLogTail } from "./subagent-registry-Lm4ps45z.js";
3
+ import { bt as trimLogTail } from "./subagent-registry-Da0a_Vka.js";
4
4
  import { n as resolveControlUiDistIndexHealth, r as resolveControlUiDistIndexPathForRoot } from "./control-ui-assets-Yp3N6NZ_.js";
5
5
  import { c as DEFAULT_PACKAGE_CHANNEL, f as isBetaTag, l as DEV_BRANCH, n as compareSemverStrings, o as detectPackageManager$1, p as isStableTag, u as channelToNpmTag } from "./update-check-DfBZVR4k.js";
6
6
  import os from "node:os";
@@ -1,7 +1,7 @@
1
1
  import { o as createSubsystemLogger } from "./entry.js";
2
2
  import { D as resolveDefaultAgentWorkspaceDir, c as resolveAgentWorkspaceDir, l as resolveDefaultAgentId } from "./agent-scope-BVNQDedk.js";
3
3
  import { i as loadConfig } from "./config-P-vz8Nlc.js";
4
- import { g as loadOpenClawPlugins, h as createPluginLoaderLogger } from "./subagent-registry-Lm4ps45z.js";
4
+ import { g as loadOpenClawPlugins, h as createPluginLoaderLogger } from "./subagent-registry-Da0a_Vka.js";
5
5
 
6
6
  //#region src/plugins/status.ts
7
7
  const log = createSubsystemLogger("plugins");
@@ -9,7 +9,7 @@ import { c as resolveAgentWorkspaceDir } from "./agent-scope-BVNQDedk.js";
9
9
  import { t as buildWorkspaceSkillStatus } from "./skills-status-C7F1IVPW.js";
10
10
  import { H as VERSION, i as loadConfig, o as readConfigFileSnapshot } from "./config-P-vz8Nlc.js";
11
11
  import { n as callGateway, t as buildGatewayConnectionDetails } from "./call-D6ajQjvV.js";
12
- import { $ as sha256HexPrefix, Cn as peekSystemEvents, an as buildChannelAccountSnapshot, en as loadProviderUsageSummary, in as buildChannelSummary, on as formatChannelAllowFrom, tn as formatUsageReportLines, vt as readRestartSentinel, yt as summarizeRestartSentinel } from "./subagent-registry-Lm4ps45z.js";
12
+ import { $ as sha256HexPrefix, Cn as peekSystemEvents, an as buildChannelAccountSnapshot, en as loadProviderUsageSummary, in as buildChannelSummary, on as formatChannelAllowFrom, tn as formatUsageReportLines, vt as readRestartSentinel, yt as summarizeRestartSentinel } from "./subagent-registry-Da0a_Vka.js";
13
13
  import { F as resolveMainSessionKey, j as resolveFreshSessionTotalTokens, o as loadSessionStore } from "./sessions-BJnLP6OJ.js";
14
14
  import { n as listChannelPlugins } from "./plugins-DStDwRz0.js";
15
15
  import { o as getTailnetHostname, s as readTailscaleStatusJson } from "./tailscale-BxzsxqAY.js";
@@ -29,7 +29,7 @@ import { t as formatRuntimeStatusWithDetails } from "./runtime-status-D6c3G7my.j
29
29
  import { t as readLastGatewayErrorLine } from "./diagnostics-CqEodocN.js";
30
30
  import { t as renderTable } from "./table-C9BoE_4p.js";
31
31
  import { a as resolveGatewayProbeAuth$1, c as probeGateway, t as runSecurityAudit } from "./audit-BvgdsYnk.js";
32
- import { o as resolveHeartbeatSummaryForAgent, t as formatHealthChannelLines } from "./health-UmuJyu1Q.js";
32
+ import { o as resolveHeartbeatSummaryForAgent, t as formatHealthChannelLines } from "./health-Dg0bAIKS.js";
33
33
  import { g as resolveUpdateChannelDisplay, i as formatGitInstallLabel, m as normalizeUpdateChannel, t as checkUpdateStatus } from "./update-check-DfBZVR4k.js";
34
34
  import { t as resolveNodeService } from "./node-service-B1F4gM4E.js";
35
35
  import { n as redactSecrets, t as formatGatewayAuthUsed } from "./format-B0yJsjEo.js";
@@ -1,4 +1,4 @@
1
- import { gt as loadOpenClawPlugins, ht as createPluginLoaderLogger } from "./reply-Bv-RvRzs.js";
1
+ import { gt as loadOpenClawPlugins, ht as createPluginLoaderLogger } from "./reply-DuVUTFfT.js";
2
2
  import { t as createSubsystemLogger } from "./subsystem-8bY95KEB.js";
3
3
  import { D as resolveDefaultAgentWorkspaceDir, c as resolveAgentWorkspaceDir, l as resolveDefaultAgentId } from "./agent-scope-D9N91YsQ.js";
4
4
  import { i as loadConfig } from "./config-QHTlq7kZ.js";
@@ -1,6 +1,6 @@
1
1
  import { u as resolveGatewayPort } from "./paths-B4BZAPZh.js";
2
2
  import { B as theme, k as info, z as isRich } from "./utils-BlC2Fskb.js";
3
- import { E as resolveSessionModelRef, G as summarizeRestartSentinel, W as readRestartSentinel, a as buildChannelSummary, b as listAgentsForGateway, bt as loadProviderUsageSummary, o as buildChannelAccountSnapshot, qt as sha256HexPrefix, s as formatChannelAllowFrom, ur as lookupContextTokens, xr as peekSystemEvents, xt as formatUsageReportLines, y as classifySessionKey } from "./reply-Bv-RvRzs.js";
3
+ import { E as resolveSessionModelRef, G as summarizeRestartSentinel, W as readRestartSentinel, a as buildChannelSummary, b as listAgentsForGateway, bt as loadProviderUsageSummary, o as buildChannelAccountSnapshot, qt as sha256HexPrefix, s as formatChannelAllowFrom, ur as lookupContextTokens, xr as peekSystemEvents, xt as formatUsageReportLines, y as classifySessionKey } from "./reply-DuVUTFfT.js";
4
4
  import { S as parseAgentSessionKey } from "./session-key-DCt45XZa.js";
5
5
  import { t as resolveOpenClawPackageRoot } from "./openclaw-root-CQJwyH9q.js";
6
6
  import { n as runExec } from "./exec-BmMB8-Xs.js";
@@ -28,7 +28,7 @@ import { t as formatRuntimeStatusWithDetails } from "./runtime-status-BHt4ST_m.j
28
28
  import { t as readLastGatewayErrorLine } from "./diagnostics-CSOaBA1c.js";
29
29
  import { t as renderTable } from "./table-i7J9YlN5.js";
30
30
  import { a as resolveGatewayProbeAuth$1, c as probeGateway, t as runSecurityAudit } from "./audit-IXHzDiVd.js";
31
- import { a as resolveHeartbeatSummaryForAgent, t as formatHealthChannelLines } from "./health-DMrTgW8V.js";
31
+ import { a as resolveHeartbeatSummaryForAgent, t as formatHealthChannelLines } from "./health-DQjqH1zU.js";
32
32
  import { g as resolveUpdateChannelDisplay, i as formatGitInstallLabel, m as normalizeUpdateChannel, t as checkUpdateStatus } from "./update-check-B-fJT8wY.js";
33
33
  import { t as resolveNodeService } from "./node-service-Da4wpz30.js";
34
34
  import { n as redactSecrets, t as formatGatewayAuthUsed } from "./format-DNqZrSx7.js";
@@ -2563,6 +2563,43 @@ async function openaiTTS(params) {
2563
2563
  clearTimeout(timeout);
2564
2564
  }
2565
2565
  }
2566
+ /**
2567
+ * Streaming variant of openaiTTS. Returns the response body as a ReadableStream
2568
+ * so callers can process PCM chunks as they arrive instead of buffering the entire response.
2569
+ */
2570
+ async function openaiTTSStream(params) {
2571
+ const { text, apiKey, model, voice, responseFormat, timeoutMs } = params;
2572
+ if (!isValidOpenAIModel(model)) throw new Error(`Invalid model: ${model}`);
2573
+ if (!isValidOpenAIVoice(voice)) throw new Error(`Invalid voice: ${voice}`);
2574
+ const controller = new AbortController();
2575
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
2576
+ const response = await fetch(`${getOpenAITtsBaseUrl()}/audio/speech`, {
2577
+ method: "POST",
2578
+ headers: {
2579
+ Authorization: `Bearer ${apiKey}`,
2580
+ "Content-Type": "application/json"
2581
+ },
2582
+ body: JSON.stringify({
2583
+ model,
2584
+ input: text,
2585
+ voice,
2586
+ response_format: responseFormat
2587
+ }),
2588
+ signal: controller.signal
2589
+ });
2590
+ if (!response.ok) {
2591
+ clearTimeout(timeout);
2592
+ throw new Error(`OpenAI TTS API error (${response.status})`);
2593
+ }
2594
+ if (!response.body) {
2595
+ clearTimeout(timeout);
2596
+ throw new Error("OpenAI TTS response has no body");
2597
+ }
2598
+ return {
2599
+ body: response.body,
2600
+ cleanup: () => clearTimeout(timeout)
2601
+ };
2602
+ }
2566
2603
  function inferEdgeExtension(outputFormat) {
2567
2604
  const normalized = outputFormat.toLowerCase();
2568
2605
  if (normalized.includes("webm")) return ".webm";
@@ -3088,6 +3125,45 @@ async function textToSpeechTelephony(params) {
3088
3125
  error: `TTS conversion failed: ${errors.join("; ") || "no providers available"}`
3089
3126
  };
3090
3127
  }
3128
+ /**
3129
+ * Streaming variant of textToSpeechTelephony.
3130
+ * Returns a ReadableStream of PCM audio chunks for incremental processing.
3131
+ * Only supports OpenAI provider (PCM format required for streaming).
3132
+ */
3133
+ async function textToSpeechTelephonyStream(params) {
3134
+ const config = resolveTtsConfig(params.cfg);
3135
+ if ((config.provider ?? "openai") !== "openai") return {
3136
+ success: false,
3137
+ error: "Streaming TTS only supported for OpenAI"
3138
+ };
3139
+ const apiKey = resolveTtsApiKey(config, "openai");
3140
+ if (!apiKey) return {
3141
+ success: false,
3142
+ error: "No OpenAI API key for streaming TTS"
3143
+ };
3144
+ try {
3145
+ const output = TELEPHONY_OUTPUT.openai;
3146
+ const result = await openaiTTSStream({
3147
+ text: params.text,
3148
+ apiKey,
3149
+ model: config.openai.model,
3150
+ voice: config.openai.voice,
3151
+ responseFormat: "pcm",
3152
+ timeoutMs: config.timeoutMs
3153
+ });
3154
+ return {
3155
+ success: true,
3156
+ stream: result.body,
3157
+ sampleRate: output.sampleRate,
3158
+ cleanup: result.cleanup
3159
+ };
3160
+ } catch (err) {
3161
+ return {
3162
+ success: false,
3163
+ error: err instanceof Error ? err.message : String(err)
3164
+ };
3165
+ }
3166
+ }
3091
3167
  async function maybeApplyTtsToPayload(params) {
3092
3168
  const config = resolveTtsConfig(params.cfg);
3093
3169
  const prefsPath = resolveTtsPrefsPath(config);
@@ -44109,7 +44185,7 @@ function isVoiceChannelType(type) {
44109
44185
  function createDefaultDeps() {
44110
44186
  return {
44111
44187
  sendMessageWhatsApp: async (...args) => {
44112
- const { sendMessageWhatsApp } = await import("./web-BjxYv-hA.js");
44188
+ const { sendMessageWhatsApp } = await import("./web-C7TQSVU0.js");
44113
44189
  return await sendMessageWhatsApp(...args);
44114
44190
  },
44115
44191
  sendMessageTelegram: async (...args) => {
@@ -59486,7 +59562,7 @@ function loadWebLoginQr() {
59486
59562
  return webLoginQrPromise;
59487
59563
  }
59488
59564
  function loadWebChannel() {
59489
- webChannelPromise ??= import("./web-BjxYv-hA.js");
59565
+ webChannelPromise ??= import("./web-C7TQSVU0.js");
59490
59566
  return webChannelPromise;
59491
59567
  }
59492
59568
  function loadWhatsAppActions() {
@@ -59499,7 +59575,10 @@ function createPluginRuntime() {
59499
59575
  config: createRuntimeConfig(),
59500
59576
  system: createRuntimeSystem(),
59501
59577
  media: createRuntimeMedia(),
59502
- tts: { textToSpeechTelephony },
59578
+ tts: {
59579
+ textToSpeechTelephony,
59580
+ textToSpeechTelephonyStream
59581
+ },
59503
59582
  tools: createRuntimeTools(),
59504
59583
  channel: createRuntimeChannel(),
59505
59584
  logging: createRuntimeLogging(),
@@ -1,7 +1,7 @@
1
1
  import { g as resolveStateDir, u as resolveGatewayPort } from "./paths-B4BZAPZh.js";
2
2
  import { B as theme, h as pathExists } from "./utils-BlC2Fskb.js";
3
3
  import "./thinking-EAliFiVK.js";
4
- import { K as trimLogTail } from "./reply-Bv-RvRzs.js";
4
+ import { K as trimLogTail } from "./reply-DuVUTFfT.js";
5
5
  import { t as resolveOpenClawPackageRoot } from "./openclaw-root-CQJwyH9q.js";
6
6
  import "./registry-Dygi7Azw.js";
7
7
  import { f as defaultRuntime } from "./subsystem-8bY95KEB.js";
@@ -106,7 +106,7 @@ import { c as resolveGatewayLaunchAgentLabel, d as resolveGatewaySystemdServiceN
106
106
  import "./channel-selection-ZfFyXtQ1.js";
107
107
  import "./pi-tools.policy-DZSlTC8Z.js";
108
108
  import { r as parseSemver } from "./runtime-guard-BYGIYhEa.js";
109
- import "./program-context-CDmctW1L.js";
109
+ import "./program-context-C0-LzXoV.js";
110
110
  import "./catalog-C7TxlaHu.js";
111
111
  import "./skills-status-CcVQgk7_.js";
112
112
  import { n as inheritOptionFromParent } from "./command-options-BtDai3oC.js";
@@ -117,7 +117,7 @@ import "./npm-registry-spec-DVXqd4Pf.js";
117
117
  import "./skill-scanner-CMBwwxis.js";
118
118
  import "./installs-B9skpWIo.js";
119
119
  import "./channels-status-issues-BD8w_e2b.js";
120
- import { r as installCompletion } from "./completion-cli-C79-bpAx.js";
120
+ import { r as installCompletion } from "./completion-cli-CI6LWHg3.js";
121
121
  import "./daemon-runtime-CcJb-H5N.js";
122
122
  import "./systemd-Dq5fANx0.js";
123
123
  import { t as resolveGatewayService } from "./service-CJGWS46r.js";
@@ -126,19 +126,19 @@ import "./systemd-hints-Bjz2gm-v.js";
126
126
  import { a as terminateStaleGatewayPids, i as renderRestartDiagnostics, o as waitForGatewayHealthyRestart, r as runDaemonRestart, s as runDaemonInstall } from "./daemon-cli-D8yeYXMW.js";
127
127
  import "./diagnostics-CSOaBA1c.js";
128
128
  import { t as renderTable } from "./table-i7J9YlN5.js";
129
- import "./health-DMrTgW8V.js";
129
+ import "./health-DQjqH1zU.js";
130
130
  import "./control-ui-assets-d_j0Pdnj.js";
131
131
  import { a as resolveNpmChannelTag, c as DEFAULT_PACKAGE_CHANNEL, d as formatUpdateChannelLabel, g as resolveUpdateChannelDisplay, h as resolveEffectiveUpdateChannel, m as normalizeUpdateChannel, n as compareSemverStrings, r as fetchNpmTagVersion, s as DEFAULT_GIT_CHANNEL, t as checkUpdateStatus, u as channelToNpmTag } from "./update-check-B-fJT8wY.js";
132
132
  import "./dm-policy-shared-Dhee-_og.js";
133
133
  import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, t as formatUpdateAvailableHint } from "./status.update-CCXdXTvr.js";
134
- import { a as detectGlobalInstallManagerForRoot, c as readPackageName, i as detectGlobalInstallManagerByPresence, l as readPackageVersion, n as runGatewayUpdate, o as globalInstallArgs, r as cleanupGlobalRenameDirs, s as resolveGlobalPackageRoot } from "./session-dirs-BAcQuXpY.js";
134
+ import { a as detectGlobalInstallManagerForRoot, c as readPackageName, i as detectGlobalInstallManagerByPresence, l as readPackageVersion, n as runGatewayUpdate, o as globalInstallArgs, r as cleanupGlobalRenameDirs, s as resolveGlobalPackageRoot } from "./session-dirs-Cw2efkey.js";
135
135
  import "./logging-DNqMaj3H.js";
136
136
  import { n as updateNpmInstalledPlugins, t as syncPluginsForUpdateChannel } from "./update-BS8h2lwA.js";
137
137
  import "./doctor-config-flow-BMdUHcYg.js";
138
138
  import "./systemd-linger-zXWRcQMp.js";
139
139
  import "./health-format-D6i_RyWd.js";
140
- import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-BbzQhWF7.js";
141
- import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-BB1f594d.js";
140
+ import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-CWNxdPrL.js";
141
+ import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-DgPc1rDZ.js";
142
142
  import os from "node:os";
143
143
  import path from "node:path";
144
144
  import fs from "node:fs/promises";
@@ -16,7 +16,7 @@ import "./client-B5QR5Bi9.js";
16
16
  import "./call-D6ajQjvV.js";
17
17
  import "./message-channel-CVHJDItx.js";
18
18
  import "./pairing-token-Byh6drgn.js";
19
- import { bt as trimLogTail } from "./subagent-registry-Lm4ps45z.js";
19
+ import { bt as trimLogTail } from "./subagent-registry-Da0a_Vka.js";
20
20
  import "./sessions-BJnLP6OJ.js";
21
21
  import "./tokens-ANnYrShl.js";
22
22
  import "./plugins-DStDwRz0.js";
@@ -111,10 +111,10 @@ import "./npm-registry-spec-DkaZNHAW.js";
111
111
  import "./skill-scanner-Cb7mXGIR.js";
112
112
  import "./installs-DDy4Ij7L.js";
113
113
  import "./channels-status-issues-DsKlgViM.js";
114
- import "./register.subclis-CFTYYdAQ.js";
115
- import "./command-registry-pGuORBuB.js";
114
+ import "./register.subclis-Mn68G5tp.js";
115
+ import "./command-registry-BtDC5Ll-.js";
116
116
  import "./program-context-5q-A0wbP.js";
117
- import { r as installCompletion } from "./completion-cli-Bf-Ojq_a.js";
117
+ import { r as installCompletion } from "./completion-cli-Bw5nZmTm.js";
118
118
  import "./daemon-runtime-Rig_aj9Q.js";
119
119
  import { r as parseSemver } from "./runtime-guard-Cs_ClFhP.js";
120
120
  import "./systemd-BrybH4HV.js";
@@ -124,19 +124,19 @@ import "./systemd-hints-C73_IlRM.js";
124
124
  import { a as terminateStaleGatewayPids, i as renderRestartDiagnostics, o as waitForGatewayHealthyRestart, r as runDaemonRestart, s as runDaemonInstall } from "./daemon-cli-C-NToqLz.js";
125
125
  import "./diagnostics-CqEodocN.js";
126
126
  import { t as renderTable } from "./table-C9BoE_4p.js";
127
- import "./health-UmuJyu1Q.js";
127
+ import "./health-Dg0bAIKS.js";
128
128
  import "./control-ui-assets-Yp3N6NZ_.js";
129
129
  import { a as resolveNpmChannelTag, c as DEFAULT_PACKAGE_CHANNEL, d as formatUpdateChannelLabel, g as resolveUpdateChannelDisplay, h as resolveEffectiveUpdateChannel, m as normalizeUpdateChannel, n as compareSemverStrings, r as fetchNpmTagVersion, s as DEFAULT_GIT_CHANNEL, t as checkUpdateStatus, u as channelToNpmTag } from "./update-check-DfBZVR4k.js";
130
130
  import "./dm-policy-shared-Do8DPXRK.js";
131
131
  import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, t as formatUpdateAvailableHint } from "./status.update-BL8rMB1W.js";
132
- import { a as detectGlobalInstallManagerForRoot, c as readPackageName, i as detectGlobalInstallManagerByPresence, l as readPackageVersion, n as runGatewayUpdate, o as globalInstallArgs, r as cleanupGlobalRenameDirs, s as resolveGlobalPackageRoot } from "./session-dirs-t0YpmrIL.js";
132
+ import { a as detectGlobalInstallManagerForRoot, c as readPackageName, i as detectGlobalInstallManagerByPresence, l as readPackageVersion, n as runGatewayUpdate, o as globalInstallArgs, r as cleanupGlobalRenameDirs, s as resolveGlobalPackageRoot } from "./session-dirs-DsU4kvIK.js";
133
133
  import "./logging-PVQxLC6I.js";
134
134
  import { n as updateNpmInstalledPlugins, t as syncPluginsForUpdateChannel } from "./update-ChO83Ek6.js";
135
135
  import "./doctor-config-flow-B_6xrNyC.js";
136
136
  import "./systemd-linger-B8oXYjfA.js";
137
137
  import "./health-format-DkjSgkDx.js";
138
- import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-cR4-U64b.js";
139
- import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-deY10x7w.js";
138
+ import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-CQUE1vow.js";
139
+ import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-DipoVPSi.js";
140
140
  import { spawn, spawnSync } from "node:child_process";
141
141
  import os from "node:os";
142
142
  import path from "node:path";
@@ -1,7 +1,7 @@
1
1
  import "./paths-B4BZAPZh.js";
2
2
  import "./utils-BlC2Fskb.js";
3
3
  import "./thinking-EAliFiVK.js";
4
- import "./reply-Bv-RvRzs.js";
4
+ import "./reply-DuVUTFfT.js";
5
5
  import "./registry-Dygi7Azw.js";
6
6
  import "./subsystem-8bY95KEB.js";
7
7
  import "./exec-BmMB8-Xs.js";
@@ -101,7 +101,7 @@ import "./control-service-D8pPAw9I.js";
101
101
  import "./stagger-B6VQyn1F.js";
102
102
  import "./channel-selection-ZfFyXtQ1.js";
103
103
  import "./pi-tools.policy-DZSlTC8Z.js";
104
- import { n as monitorWebInbox, t as monitorWebChannel } from "./channel-web-DHMbpU2p.js";
104
+ import { n as monitorWebInbox, t as monitorWebChannel } from "./channel-web-D8hSmcPF.js";
105
105
  import { n as sendMessageWhatsApp } from "./outbound-ZEBWBkDi.js";
106
106
  import { i as waitForWaConnection, t as createWaSocket } from "./session-DD2Ku-SR.js";
107
107
  import { t as loginWeb } from "./login-DN07rdvL.js";
@@ -15,7 +15,7 @@ import "./client-B5QR5Bi9.js";
15
15
  import "./call-D6ajQjvV.js";
16
16
  import "./message-channel-CVHJDItx.js";
17
17
  import "./pairing-token-Byh6drgn.js";
18
- import { $t as parseActivationCommand, B as dispatchReplyWithBufferedBlockDispatcher, Bn as shouldComputeCommandAuthorized, F as resolveMentionGating, Fn as resolveInboundDebounceMs, G as createDedupeCache, I as DEFAULT_GROUP_HISTORY_LIMIT, In as formatInboundEnvelope, K as getReplyFromConfig, L as buildHistoryContextFromEntries, Ln as resolveEnvelopeFormatOptions, P as buildPairingReply, Pn as createInboundDebouncer, Qt as normalizeGroupActivation, R as recordPendingHistoryEntryIfEnabled, S as sleepWithAbort, Un as buildMentionRegexes, Wn as normalizeMentionText, bn as enqueueSystemEvent, x as computeBackoff, z as shouldAckReactionForWhatsApp, zn as hasControlCommand } from "./subagent-registry-Lm4ps45z.js";
18
+ import { $t as parseActivationCommand, B as dispatchReplyWithBufferedBlockDispatcher, Bn as shouldComputeCommandAuthorized, F as resolveMentionGating, Fn as resolveInboundDebounceMs, G as createDedupeCache, I as DEFAULT_GROUP_HISTORY_LIMIT, In as formatInboundEnvelope, K as getReplyFromConfig, L as buildHistoryContextFromEntries, Ln as resolveEnvelopeFormatOptions, P as buildPairingReply, Pn as createInboundDebouncer, Qt as normalizeGroupActivation, R as recordPendingHistoryEntryIfEnabled, S as sleepWithAbort, Un as buildMentionRegexes, Wn as normalizeMentionText, bn as enqueueSystemEvent, x as computeBackoff, z as shouldAckReactionForWhatsApp, zn as hasControlCommand } from "./subagent-registry-Da0a_Vka.js";
19
19
  import { B as resolveGroupSessionKey, c as recordSessionMetaFromInbound, o as loadSessionStore, s as readSessionUpdatedAt, u as updateLastRoute } from "./sessions-BJnLP6OJ.js";
20
20
  import "./tokens-ANnYrShl.js";
21
21
  import "./plugins-DStDwRz0.js";