@openclaw/discord 2026.8.1-beta.3 → 2026.8.2

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 (290) hide show
  1. package/dist/account-inspect-BY-ve3yH.js +45 -0
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{accounts-DNl-oCEw.js → accounts-CwJQoLjM.js} +87 -162
  4. package/dist/action-runtime-api.js +1 -1
  5. package/dist/{activities-api-KCBAmWxD.js → activities-api-CkKcHUB6.js} +14 -12
  6. package/dist/activities-api.js +1 -1
  7. package/dist/{allow-list-BDMimASD.js → allow-list-C2JuH-R0.js} +10 -6
  8. package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
  9. package/dist/api.js +18 -18
  10. package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-DZM6Kt1Z.js} +30 -106
  11. package/dist/{audit-Yc7eZDd6.js → audit-DIbQA4VT.js} +8 -7
  12. package/dist/{channel-cXYzGc4L.js → channel-CarzU3bg.js} +25 -25
  13. package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-B2wMqeVK.js} +60 -57
  14. package/dist/channel-config-api.js +1 -1
  15. package/dist/channel-plugin-api.js +1 -1
  16. package/dist/channel-type-CVLZyGYS.js +7 -0
  17. package/dist/{channel.setup-CSiwnMgs.js → channel.setup-z_ewMVa9.js} +18 -18
  18. package/dist/{components-ezGKo_Yh.js → components-gvRA0oaI.js} +33 -29
  19. package/dist/{config-schema-DC5kDtQ5.js → config-schema-B797-Spt.js} +21 -14
  20. package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-DPpBRpYI.js} +1 -1
  21. package/dist/{directory-config-XyCfoqLg.js → directory-config-AA8wQx0D.js} +2 -2
  22. package/dist/directory-contract-api.js +1 -1
  23. package/dist/{directory-live-Df0NbFJB.js → directory-live-D_kFz_Fj.js} +4 -4
  24. package/dist/{doctor-DYY31GrO.js → doctor-QQTOkBfW.js} +5 -5
  25. package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
  26. package/dist/doctor-contract-api.js +4 -3
  27. package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-Cc88ZGon.js} +9 -5
  28. package/dist/index.js +1 -1
  29. package/dist/ingress-identity-BCzfPPYM.js +60 -0
  30. package/dist/{message-handler-B61q5MOF.js → message-handler-CAeEpqWo.js} +14 -10
  31. package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-CoKoE3dY.js} +32 -91
  32. package/dist/{message-handler.process--4_712Ec.js → message-handler.process-cdIJ_fDT.js} +99 -123
  33. package/dist/{message-utils-BXLLnFl6.js → message-text-C0K4-fkg.js} +41 -34
  34. package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-Ch0At5Ra.js} +85 -78
  35. package/dist/{outbound-components-B2PL0ooH.js → outbound-components-Bnt_7x7r.js} +5 -4
  36. package/dist/outbound-session-route-CzzerX2K.js +668 -0
  37. package/dist/{owner-access-Bg41VzAf.js → owner-access-yc1sX7Gx.js} +7 -6
  38. package/dist/{pluralkit-dUl4v1X3.js → pluralkit-B3cUVI7i.js} +2 -2
  39. package/dist/{probe-BTdtVRwU.js → probe-3ovFAp3b.js} +3 -3
  40. package/dist/{probe.runtime-Dq5-PRKT.js → probe.runtime-BckHn3cJ.js} +1 -1
  41. package/dist/{provider-DlK_ynqt.js → provider-CjI8BSzS.js} +511 -342
  42. package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-DdKRMcE9.js} +3 -3
  43. package/dist/provider.runtime-Bo1WbLLr.js +2 -0
  44. package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-37IC-p5K.js} +110 -126
  45. package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
  46. package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-BexR2eUn.js} +6 -5
  47. package/dist/{resolve-users-BtKxLUZv.js → resolve-users-BtXBCH5W.js} +5 -4
  48. package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
  49. package/dist/{retry-DNsVTeTo.js → retry-t5RcEsPk.js} +237 -15
  50. package/dist/{runtime-CQovMsH3.js → runtime-BNlDfLwS.js} +2 -2
  51. package/dist/{runtime-D71_VFLr.js → runtime-DydyfxST.js} +182 -131
  52. package/dist/runtime-api.js +19 -26
  53. package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
  54. package/dist/secret-contract-api.js +1 -1
  55. package/dist/{security-audit-BfJhAXZp.js → security-audit-DKfK-iPY.js} +10 -11
  56. package/dist/security-audit-contract-api.js +1 -1
  57. package/dist/{security-audit.runtime-BVKF9VtY.js → security-audit.runtime-sKZyKgpx.js} +1 -1
  58. package/dist/{send-rQIffSYu.js → send-mTKSBdmZ.js} +149 -58
  59. package/dist/{send.components-ChK1wS7w.js → send.components-nsPnc7kK.js} +29 -30
  60. package/dist/{send.outbound-HIkgji_7.js → send.outbound-CaOs9Zy1.js} +87 -84
  61. package/dist/{send.shared-B3fpaLWJ.js → send.shared-BJHt0Vyf.js} +55 -33
  62. package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
  63. package/dist/setup-plugin-api.js +1 -1
  64. package/dist/{shared-CaAaoksy.js → shared-BNesVA4P.js} +43 -18
  65. package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-IeZVPLGj.js} +2 -2
  66. package/dist/subagent-hooks-api.js +1 -6
  67. package/dist/{system-events-Nuwoq_au.js → system-events-Be5EJI3b.js} +2 -2
  68. package/dist/{target-resolver-DIXShHaZ.js → target-resolver-C0MnwEki.js} +6 -5
  69. package/dist/targets-DQSye1Rv.js +3 -0
  70. package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-wECUSIIG.js} +6 -6
  71. package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-B-3UHCc1.js} +31 -32
  72. package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
  73. package/dist/{threading-DU6pgeGm.js → threading-te5ADPQI.js} +51 -27
  74. package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
  75. package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-DkUhR7YK.js} +9 -4
  76. package/dist/transcripts-source-api.js +1 -1
  77. package/dist/{typing-oLiS5Z13.js → typing-DAwJF5VT.js} +2 -2
  78. package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-COyYYTDD.js} +418 -74
  79. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
  80. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
  81. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
  82. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
  83. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
  84. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
  85. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/README.md +19 -19
  86. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v1.js +7 -3
  87. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v7.js +5 -2
  88. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v1.js +7 -3
  89. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v7.js +5 -2
  90. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/package.json +4 -3
  91. package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
  92. package/node_modules/@discordjs/voice/node_modules/@types/node/child_process.d.ts +0 -1
  93. package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +6 -6
  94. package/node_modules/@discordjs/voice/node_modules/@types/node/dns/promises.d.ts +5 -5
  95. package/node_modules/@discordjs/voice/node_modules/@types/node/dns.d.ts +5 -5
  96. package/node_modules/@discordjs/voice/node_modules/@types/node/fs.d.ts +7 -0
  97. package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +30 -0
  98. package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +4 -4
  99. package/node_modules/@discordjs/voice/node_modules/@types/node/os.d.ts +30 -30
  100. package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
  101. package/node_modules/@discordjs/voice/node_modules/@types/node/perf_hooks.d.ts +2 -1
  102. package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +42 -43
  103. package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +1049 -84
  104. package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +14 -1
  105. package/node_modules/@discordjs/voice/node_modules/@types/node/stream/iter.d.ts +3 -2
  106. package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +61 -0
  107. package/node_modules/@discordjs/voice/node_modules/@types/node/v8.d.ts +20 -23
  108. package/node_modules/discord-api-types/CHANGELOG.md +8 -0
  109. package/node_modules/discord-api-types/package.json +4 -4
  110. package/node_modules/discord-api-types/payloads/v10/channel.d.ts +2 -2
  111. package/node_modules/discord-api-types/payloads/v10/channel.d.ts.map +1 -1
  112. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts +4 -0
  113. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts.map +1 -1
  114. package/node_modules/discord-api-types/payloads/v10/gateway.js.map +1 -1
  115. package/node_modules/discord-api-types/payloads/v10/message.d.ts +4 -1
  116. package/node_modules/discord-api-types/payloads/v10/message.d.ts.map +1 -1
  117. package/node_modules/discord-api-types/payloads/v10/message.js +1 -0
  118. package/node_modules/discord-api-types/payloads/v10/message.js.map +1 -1
  119. package/node_modules/discord-api-types/payloads/v9/channel.d.ts +2 -2
  120. package/node_modules/discord-api-types/payloads/v9/channel.d.ts.map +1 -1
  121. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts +4 -0
  122. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts.map +1 -1
  123. package/node_modules/discord-api-types/payloads/v9/gateway.js.map +1 -1
  124. package/node_modules/discord-api-types/payloads/v9/message.d.ts +4 -1
  125. package/node_modules/discord-api-types/payloads/v9/message.d.ts.map +1 -1
  126. package/node_modules/discord-api-types/payloads/v9/message.js +1 -0
  127. package/node_modules/discord-api-types/payloads/v9/message.js.map +1 -1
  128. package/node_modules/typebox/build/format/date.d.mts +1 -1
  129. package/node_modules/typebox/build/format/date.mjs +1 -1
  130. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  131. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  132. package/node_modules/typebox/build/format/email.d.mts +1 -1
  133. package/node_modules/typebox/build/format/email.mjs +2 -2
  134. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  135. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  136. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  137. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  138. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  139. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  140. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  141. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  142. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  143. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  144. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  145. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  146. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +41 -0
  147. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  148. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  149. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  150. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  151. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  152. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  153. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  154. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  155. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  156. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  157. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  158. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  159. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  160. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  161. package/node_modules/typebox/build/format/iri.mjs +26 -8
  162. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  163. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  164. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  165. package/node_modules/typebox/build/format/regex.mjs +2 -6
  166. package/node_modules/typebox/build/format/time.d.mts +2 -2
  167. package/node_modules/typebox/build/format/time.mjs +19 -14
  168. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  169. package/node_modules/typebox/build/format/uri.mjs +3 -130
  170. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  171. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  172. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  173. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  174. package/node_modules/typebox/build/format/url.d.mts +3 -3
  175. package/node_modules/typebox/build/format/url.mjs +4 -5
  176. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  177. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  178. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  179. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  180. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  181. package/node_modules/typebox/build/guard/string.mjs +7 -7
  182. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  183. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  184. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  185. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  186. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  187. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  188. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  189. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  190. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  191. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  192. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  193. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  194. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  195. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  196. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  197. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  198. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  199. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  200. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  201. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  202. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  203. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  204. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  205. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  206. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  207. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  208. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  209. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  210. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  211. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  212. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  213. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  214. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  215. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  216. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  217. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  218. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  219. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  220. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  221. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  222. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  223. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  224. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  225. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  226. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  227. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  228. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  229. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  230. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  231. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  232. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  233. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  234. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  235. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  236. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  237. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  238. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  239. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  240. package/node_modules/typebox/package.json +27 -27
  241. package/node_modules/typebox/readme.md +79 -82
  242. package/node_modules/undici/docs/docs/api/Client.md +21 -8
  243. package/node_modules/undici/lib/api/readable.js +33 -43
  244. package/node_modules/undici/lib/core/connect.js +16 -2
  245. package/node_modules/undici/lib/core/symbols.js +1 -0
  246. package/node_modules/undici/lib/dispatcher/client-h1.js +3 -3
  247. package/node_modules/undici/lib/dispatcher/client-h2.js +179 -10
  248. package/node_modules/undici/lib/dispatcher/client.js +74 -29
  249. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +28 -6
  250. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +15 -1
  251. package/node_modules/undici/lib/handler/retry-handler.js +7 -2
  252. package/node_modules/undici/lib/interceptor/cache.js +5 -2
  253. package/node_modules/undici/lib/interceptor/deduplicate.js +1 -1
  254. package/node_modules/undici/lib/mock/mock-utils.js +213 -24
  255. package/node_modules/undici/lib/util/cache.js +2 -4
  256. package/node_modules/undici/lib/web/websocket/websocket.js +22 -0
  257. package/node_modules/undici/package.json +1 -1
  258. package/node_modules/undici/types/client.d.ts +40 -0
  259. package/node_modules/ws/lib/permessage-deflate.js +3 -1
  260. package/node_modules/ws/package.json +1 -1
  261. package/openclaw.plugin.json +14 -6
  262. package/package.json +8 -8
  263. package/skills/discord/SKILL.md +1 -1
  264. package/dist/account-inspect-D5xmUpnj.js +0 -89
  265. package/dist/approval-message-safety-XGFPbDoI.js +0 -226
  266. package/dist/audit-core-BCX8UeFH.js +0 -105
  267. package/dist/channel-actions-Dr2QI8Bf.js +0 -212
  268. package/dist/inbound-event-delivery-De2qxTrP.js +0 -39
  269. package/dist/provider.runtime-CzKGRiAF.js +0 -2
  270. package/dist/runtime-api.actions.js +0 -3
  271. package/dist/runtime-api.lookup.js +0 -7
  272. package/dist/runtime-api.monitor-CzeTYF32.js +0 -6
  273. package/dist/runtime-api.monitor.js +0 -9
  274. package/dist/runtime-api.send.js +0 -7
  275. package/dist/runtime-api.threads.js +0 -5
  276. package/dist/sdk-runtime-37OU6_Yh.js +0 -369
  277. package/dist/send.reactions-gmJ6yFPo.js +0 -78
  278. package/dist/send.receipt-Cnhoautb.js +0 -76
  279. package/dist/subagent-progress-FPLqBY1s.js +0 -110
  280. package/dist/targets-B2pf49zc.js +0 -3
  281. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  282. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  283. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  284. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  285. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  286. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  287. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  288. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  289. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  290. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
@@ -1,6 +1,6 @@
1
- import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-CngsgErq.js";
2
- import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-VlymUnbz.js";
3
- import { t as createDiscordMessageHandler } from "./message-handler-B61q5MOF.js";
1
+ import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-B-3UHCc1.js";
2
+ import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-wECUSIIG.js";
3
+ import { t as createDiscordMessageHandler } from "./message-handler-CAeEpqWo.js";
4
4
  import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
5
5
  import { getAcpSessionManager, isAcpRuntimeError } from "openclaw/plugin-sdk/acp-runtime";
6
6
  export { createDiscordMessageHandler, createNoopThreadBindingManager, createThreadBindingManager, getAcpSessionManager, isAcpRuntimeError, reconcileAcpThreadBindingsOnStartup, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled };
@@ -0,0 +1,2 @@
1
+ import { t as monitorDiscordProvider } from "./provider-CjI8BSzS.js";
2
+ export { monitorDiscordProvider };
@@ -1,5 +1,5 @@
1
- import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-B3i6WxV5.js";
2
- import { S as formatVoiceLogPreview, b as formatVoiceIngressPrompt, h as createDiscordOpusEncodeStream, m as convertRealtimePcm24kMonoToDiscordPcm48kStereo, p as convertDiscordPcm48kStereoToRealtimePcm24kMono, t as loadDiscordVoiceSdk, u as logVoiceVerbose, x as maybeControlDiscordVoiceAgentRun } from "./sdk-runtime-37OU6_Yh.js";
1
+ import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-DFu9hfU8.js";
2
+ import { a as convertRealtimePcm24kMonoToDiscordPcm48kStereo, c as maybeControlDiscordVoiceAgentRun, i as convertDiscordPcm48kStereoToRealtimePcm24kMono, l as formatVoiceLogPreview, n as loadDiscordVoiceSdk, o as createDiscordOpusEncodeStream, r as logVoiceVerbose, s as formatVoiceIngressPrompt } from "./voice-runtime-COyYYTDD.js";
3
3
  import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
4
4
  import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
5
5
  import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
@@ -11,7 +11,8 @@ import { PassThrough, pipeline } from "node:stream";
11
11
  function mergeRealtimePartialTranscript(previous, next) {
12
12
  const trimmed = next.trim();
13
13
  if (!trimmed) return previous;
14
- return sliceUtf16Safe(trimmed.startsWith(previous) ? trimmed : `${previous}${next}`, -240);
14
+ const merged = trimmed.startsWith(previous) ? trimmed : `${previous}${next}`;
15
+ return sliceUtf16Safe(merged, -240);
15
16
  }
16
17
  //#endregion
17
18
  //#region extensions/discord/src/voice/realtime-turns.ts
@@ -39,6 +40,7 @@ var DiscordRealtimeTurns = class {
39
40
  ...context,
40
41
  userId
41
42
  }, {
43
+ transcripts: this.params.entry.transcripts,
42
44
  inputDiscordBytes: 0,
43
45
  inputRealtimeBytes: 0,
44
46
  inputChunks: 0,
@@ -185,12 +187,13 @@ var DiscordRealtimeTurns = class {
185
187
  transcriptAttributionFromTurn(turn) {
186
188
  return turn ? {
187
189
  context: turn.context,
188
- startedAt: turn.startedAt
190
+ startedAt: turn.startedAt,
191
+ transcripts: turn.transcripts
189
192
  } : void 0;
190
193
  }
191
194
  recordTranscriptUtterance(text, attribution, providerEpoch) {
192
- const transcripts = this.params.entry.transcripts;
193
- if (!transcripts || !attribution) return;
195
+ const transcripts = attribution?.transcripts;
196
+ if (!transcripts || !attribution || this.params.entry.transcripts !== transcripts) return;
194
197
  const context = attribution.context;
195
198
  const utterance = {
196
199
  sessionId: transcripts.sessionId,
@@ -209,7 +212,7 @@ var DiscordRealtimeTurns = class {
209
212
  }
210
213
  };
211
214
  Promise.resolve().then(() => {
212
- if (providerEpoch !== this.params.providerEpoch()) return;
215
+ if (providerEpoch !== this.params.providerEpoch() || this.params.entry.transcripts !== transcripts) return;
213
216
  return transcripts.onUtterance(utterance);
214
217
  }).catch((error) => {
215
218
  logger$3.warn(`discord voice: realtime transcripts utterance failed: ${formatErrorMessage(error)}`);
@@ -226,6 +229,7 @@ var DiscordRealtimeTurns = class {
226
229
  if (expiresAt === void 0) return;
227
230
  this.pendingWakeNameFollowup = {
228
231
  context,
232
+ transcripts: turn?.transcripts,
229
233
  startedAt: turn?.startedAt ?? Date.now(),
230
234
  expiresAt
231
235
  };
@@ -242,7 +246,8 @@ var DiscordRealtimeTurns = class {
242
246
  if (currentTurn) this.consumePendingSpeakerContext();
243
247
  return {
244
248
  context: pending.context,
245
- startedAt: pending.startedAt
249
+ startedAt: pending.startedAt,
250
+ transcripts: pending.transcripts
246
251
  };
247
252
  }
248
253
  rememberIgnoredWakeNameSpeakerContext(context) {
@@ -298,7 +303,6 @@ var DiscordRealtimeConsults = class {
298
303
  logger$2.warn(`discord voice: realtime consult rejected malformed args call=${callId || "unknown"}: ${outcome.error}`);
299
304
  await session.submitToolResult(callId, { error: outcome.error });
300
305
  return;
301
- case "consult": break;
302
306
  }
303
307
  const consultMessage = outcome.message;
304
308
  logger$2.info(`discord voice: realtime consult requested call=${callId || "unknown"} voiceSession=${this.params.entry.voiceSessionKey} supervisorSession=${this.params.entry.route.sessionKey} agent=${this.params.entry.route.agentId} question=${formatVoiceLogPreview(consultMessage)}`);
@@ -604,11 +608,11 @@ var DiscordRealtimeConsults = class {
604
608
  if (providerOwnsDelivery) {
605
609
  state.handledByForcedPlayback = false;
606
610
  state.settleProviderDelivery = void 0;
607
- resolveProviderDelivery?.(true);
611
+ resolveProviderDelivery?.();
608
612
  }
609
613
  } catch (error) {
610
614
  state.settleProviderDelivery = void 0;
611
- resolveProviderDelivery?.(false);
615
+ resolveProviderDelivery?.();
612
616
  throw error;
613
617
  }
614
618
  return true;
@@ -618,7 +622,7 @@ var DiscordRealtimeConsults = class {
618
622
  const state = handle.context;
619
623
  if (!state) continue;
620
624
  state.handledByForcedPlayback = false;
621
- state.settleProviderDelivery?.(false);
625
+ state.settleProviderDelivery?.();
622
626
  state.settleProviderDelivery = void 0;
623
627
  state.providerDelivery = void 0;
624
628
  }
@@ -629,10 +633,9 @@ var DiscordRealtimeConsults = class {
629
633
  //#region extensions/discord/src/voice/realtime-playback.ts
630
634
  const logger$1 = createSubsystemLogger("discord/voice");
631
635
  const DISCORD_REALTIME_CONTROL_SPEECH_DEDUPE_MS = 5e3;
632
- const DISCORD_REALTIME_OUTPUT_PLAYBACK_WATCHDOG_MARGIN_MS = 1500;
636
+ const DISCORD_REALTIME_OUTPUT_PLAYBACK_WATCHDOG_MARGIN_MS = 3e3;
633
637
  const DISCORD_REALTIME_MAX_RETAINED_EXACT_SPEECH_MESSAGES = 32;
634
- const DISCORD_REALTIME_MAX_RETAINED_EXACT_SPEECH_BYTES = 32 * 1024;
635
- const DISCORD_REALTIME_CANCELLATION_RACE_DETAIL = "Cancellation failed: no active response found";
638
+ const DISCORD_REALTIME_MAX_RETAINED_EXACT_SPEECH_BYTES = 32768;
636
639
  const DISCORD_REALTIME_WAKE_ACKS = [
637
640
  "Yeah.",
638
641
  "Mm-hmm.",
@@ -641,9 +644,7 @@ const DISCORD_REALTIME_WAKE_ACKS = [
641
644
  ];
642
645
  const DISCORD_RAW_PCM_FRAME_BYTES = 3840;
643
646
  const DISCORD_REALTIME_OUTPUT_PREROLL_FRAMES = 25;
644
- function isRealtimeResponseCancellationRace(event) {
645
- return event.direction === "server" && event.type === "error" && event.detail === DISCORD_REALTIME_CANCELLATION_RACE_DETAIL;
646
- }
647
+ const DISCORD_REALTIME_MAX_PENDING_OUTPUT_BYTES = DISCORD_RAW_PCM_FRAME_BYTES * 6e3;
647
648
  function normalizeControlSpeechText(text) {
648
649
  return text.toLowerCase().replace(/\s+/g, " ").trim();
649
650
  }
@@ -651,8 +652,8 @@ var DiscordRealtimePlayback = class {
651
652
  constructor(params) {
652
653
  this.params = params;
653
654
  this.outputStream = null;
654
- this.outputPacedBuffer = Buffer.alloc(0);
655
- this.playbackState = { status: "idle" };
655
+ this.outputPacedBuffers = [];
656
+ this.outputPacedBytes = 0;
656
657
  this.queuedExactSpeechMessages = [];
657
658
  this.exactSpeechState = { status: "idle" };
658
659
  this.wakeNameAckIndex = 0;
@@ -667,7 +668,6 @@ var DiscordRealtimePlayback = class {
667
668
  this.params.entry.player.on(voiceSdk.AudioPlayerStatus.Idle, this.playerIdleHandler);
668
669
  }
669
670
  close() {
670
- this.playbackState = { status: "idle" };
671
671
  this.queuedExactSpeechMessages = [];
672
672
  this.exactSpeechState = { status: "idle" };
673
673
  this.clearOutputAudio("session-close");
@@ -702,7 +702,7 @@ var DiscordRealtimePlayback = class {
702
702
  }
703
703
  sendOutputAudio(realtimePcm24kMono) {
704
704
  this.params.markProviderGenerationObserved();
705
- if (this.params.stopped() || this.playbackState.status === "backpressured") return;
705
+ if (this.params.stopped()) return;
706
706
  const discordPcm = convertRealtimePcm24kMonoToDiscordPcm48kStereo(realtimePcm24kMono);
707
707
  if (discordPcm.length === 0) return;
708
708
  this.params.bridge()?.setMediaTimestamp(this.outputAudioMs());
@@ -740,19 +740,10 @@ var DiscordRealtimePlayback = class {
740
740
  this.completeExactSpeechResponse(reason);
741
741
  return;
742
742
  }
743
- stream.end();
744
- }
745
- handleProviderEvent(event) {
746
- if (!(this.playbackState.status === "backpressured" && isRealtimeResponseCancellationRace(event))) return;
747
- const outputBackpressured = this.playbackState.status === "backpressured";
748
- if (outputBackpressured) this.playbackState = { status: "idle" };
749
- if (this.exactSpeechState.status === "active" && (outputBackpressured || !this.exactSpeechState.audioStarted)) this.completeExactSpeechResponse(event.type);
750
- this.finishOutputAudioStream(event.type, { playBuffered: false });
743
+ if (!this.outputDrainHandler) stream.end();
751
744
  }
752
745
  handleResponseDone(outcome) {
753
- const outputBackpressured = this.playbackState.status === "backpressured";
754
- if (outputBackpressured) this.playbackState = { status: "idle" };
755
- if (this.exactSpeechState.status === "active" && (outputBackpressured || !this.exactSpeechState.audioStarted)) this.completeExactSpeechResponse(outcome.status);
746
+ if (this.exactSpeechState.status === "active" && !this.exactSpeechState.audioStarted) this.completeExactSpeechResponse(outcome.status);
756
747
  this.finishOutputAudioStream(outcome.status, { playBuffered: outcome.status === "completed" });
757
748
  }
758
749
  enqueueExactSpeechMessage(text) {
@@ -761,11 +752,7 @@ var DiscordRealtimePlayback = class {
761
752
  const retainedBytes = this.queuedExactSpeechMessages.reduce((total, message) => total + Buffer.byteLength(message, "utf8"), 0) + Buffer.byteLength(this.exactSpeechState.status === "active" ? this.exactSpeechState.message : "", "utf8");
762
753
  const incomingBytes = Buffer.byteLength(text, "utf8");
763
754
  if (retainedMessages >= DISCORD_REALTIME_MAX_RETAINED_EXACT_SPEECH_MESSAGES || retainedBytes + incomingBytes > DISCORD_REALTIME_MAX_RETAINED_EXACT_SPEECH_BYTES) {
764
- this.params.stopTerminally();
765
- this.queuedExactSpeechMessages = [];
766
- this.exactSpeechState = { status: "idle" };
767
- this.clearOutputAudio("exact-speech-overflow");
768
- this.params.onTerminalError(/* @__PURE__ */ new Error(`Discord realtime exact speech overflow: retained=${retainedMessages} retainedBytes=${retainedBytes} incomingBytes=${incomingBytes}`));
755
+ this.stopAfterOverflow("exact-speech-overflow", /* @__PURE__ */ new Error(`Discord realtime exact speech overflow: retained=${retainedMessages} retainedBytes=${retainedBytes} incomingBytes=${incomingBytes}`));
769
756
  return;
770
757
  }
771
758
  if (!this.params.bridgeReady() || this.exactSpeechState.status === "active" || this.hasInterruptibleOutputAudio()) {
@@ -845,84 +832,83 @@ var DiscordRealtimePlayback = class {
845
832
  currentOutputStream() {
846
833
  return this.outputStream;
847
834
  }
835
+ stopAfterOverflow(reason, error) {
836
+ this.params.stopTerminally();
837
+ this.queuedExactSpeechMessages = [];
838
+ this.exactSpeechState = { status: "idle" };
839
+ this.clearOutputAudio(reason);
840
+ this.params.onTerminalError(error);
841
+ }
848
842
  ensureOutputStream() {
849
843
  if (this.outputStream && !this.outputStream.destroyed && !this.outputStream.writableEnded) return this.outputStream;
850
844
  const stream = new PassThrough({ highWaterMark: DISCORD_RAW_PCM_FRAME_BYTES * 128 });
851
845
  this.outputStream = stream;
852
- this.playbackState = {
853
- status: "buffering",
854
- stream
855
- };
856
- this.outputPacedBuffer = Buffer.alloc(0);
846
+ this.outputPacedBuffers = [];
847
+ this.outputPacedBytes = 0;
857
848
  this.params.harness.outputActivity.markStreamOpened();
858
849
  stream.once("close", () => {
859
- if (this.params.harness.outputActivity.snapshot().playbackStarted) return;
860
- this.handleOutputStreamClosed(stream, "stream-close");
850
+ if (this.outputStream !== stream || this.params.harness.outputActivity.snapshot().playbackStarted) return;
851
+ this.resetOutputStream("stream-close");
852
+ this.completeExactSpeechResponse("stream-close");
861
853
  });
862
854
  return stream;
863
855
  }
864
- handleOutputStreamClosed(stream, reason) {
865
- if (this.outputStream !== stream) return;
866
- this.logOutputAudioStopped(reason);
867
- this.clearOutputPlaybackWatchdog();
868
- this.outputStream = null;
869
- if (this.playbackState.status !== "backpressured") this.playbackState = { status: "idle" };
870
- this.outputPacedBuffer = Buffer.alloc(0);
871
- this.params.harness.outputActivity.reset();
872
- this.completeExactSpeechResponse(reason);
873
- }
874
856
  queueOutputAudio(stream, discordPcm) {
875
- if (this.playbackState.status === "playing") {
876
- if (!stream.write(discordPcm)) this.handleOutputBackpressure(stream);
857
+ const pendingBytes = this.outputPacedBytes + stream.writableLength + stream.readableLength;
858
+ if (discordPcm.length > DISCORD_REALTIME_MAX_PENDING_OUTPUT_BYTES - pendingBytes) {
859
+ this.stopAfterOverflow("output-audio-overflow", /* @__PURE__ */ new Error(`Discord realtime audio playback overflow: pendingBytes=${pendingBytes} incomingBytes=${discordPcm.length}`));
877
860
  return;
878
861
  }
879
- this.outputPacedBuffer = this.outputPacedBuffer.length > 0 ? Buffer.concat([this.outputPacedBuffer, discordPcm]) : discordPcm;
880
- if (this.outputPacedBuffer.length >= DISCORD_RAW_PCM_FRAME_BYTES * DISCORD_REALTIME_OUTPUT_PREROLL_FRAMES) this.startOutputPlayback(stream);
881
- }
882
- handleOutputBackpressure(stream) {
883
- if (this.playbackState.status === "backpressured" || this.outputStream !== stream) return;
884
- const token = Symbol("output-backpressure");
885
- this.playbackState = {
886
- status: "backpressured",
887
- stream,
888
- token
862
+ if (this.params.harness.outputActivity.snapshot().playbackStarted && !this.outputDrainHandler) {
863
+ if (!stream.write(discordPcm)) this.waitForOutputDrain(stream);
864
+ return;
865
+ }
866
+ this.outputPacedBuffers.push(discordPcm);
867
+ this.outputPacedBytes += discordPcm.length;
868
+ if (!this.outputDrainHandler && this.outputPacedBytes >= DISCORD_RAW_PCM_FRAME_BYTES * DISCORD_REALTIME_OUTPUT_PREROLL_FRAMES) this.startOutputPlayback(stream);
869
+ }
870
+ waitForOutputDrain(stream) {
871
+ if (this.outputDrainHandler || this.outputStream !== stream) return;
872
+ logger$1.info(`discord voice: realtime audio playback buffering guild=${this.params.entry.guildId} channel=${this.params.entry.channelId} bufferedBytes=${stream.writableLength + stream.readableLength}`);
873
+ this.outputDrainHandler = () => {
874
+ if (this.params.stopped() || this.outputStream !== stream || stream.destroyed) return;
875
+ this.outputDrainHandler = void 0;
876
+ let refreshWatchdog = this.params.harness.outputActivity.snapshot().streamEnding;
877
+ while (this.outputPacedBuffers.length > 0) {
878
+ const buffered = this.outputPacedBuffers.shift();
879
+ if (!buffered) break;
880
+ this.outputPacedBytes -= buffered.length;
881
+ const writable = stream.write(buffered);
882
+ if (refreshWatchdog) {
883
+ this.scheduleOutputPlaybackWatchdog("output-drain", stream);
884
+ refreshWatchdog = false;
885
+ }
886
+ if (!writable) {
887
+ this.waitForOutputDrain(stream);
888
+ return;
889
+ }
890
+ }
891
+ if (this.params.harness.outputActivity.snapshot().streamEnding) stream.end();
889
892
  };
890
- const bufferedBytes = stream.writableLength + stream.readableLength;
891
- logger$1.warn(`discord voice: realtime audio playback backpressured guild=${this.params.entry.guildId} channel=${this.params.entry.channelId} bufferedBytes=${bufferedBytes}`);
892
- this.clearOutputAudio("output-backpressure");
893
- queueMicrotask(() => {
894
- if (this.params.stopped() || this.playbackState.status !== "backpressured" || this.playbackState.token !== token) return;
895
- this.params.harness.handleBargeIn({
896
- audioPlaybackActive: true,
897
- force: true
898
- }, () => {});
899
- });
893
+ stream.once("drain", this.outputDrainHandler);
900
894
  }
901
895
  startOutputPlayback(stream) {
902
896
  if (this.params.harness.outputActivity.snapshot().playbackStarted || stream.destroyed) return;
903
897
  const voiceSdk = loadDiscordVoiceSdk();
904
898
  const opusStream = createDiscordOpusEncodeStream();
905
- opusStream.on("error", (err) => {
906
- logger$1.warn(`discord voice: realtime opus encode failed guild=${this.params.entry.guildId} channel=${this.params.entry.channelId}: ${formatErrorMessage(err)}`);
907
- this.resetOutputStream("opus-encode-error");
908
- });
909
- opusStream.once("close", () => this.handleOutputStreamClosed(stream, "stream-close"));
910
899
  pipeline(stream, opusStream, (err) => {
911
- if (!err) return;
900
+ if (!err || this.outputStream !== stream) return;
912
901
  logger$1.warn(`discord voice: realtime output pipeline failed guild=${this.params.entry.guildId} channel=${this.params.entry.channelId}: ${formatErrorMessage(err)}`);
913
- this.resetOutputStream("output-pipeline-error");
902
+ this.clearOutputAudio("output-pipeline-error");
903
+ this.completeExactSpeechResponse("output-pipeline-error");
914
904
  });
915
- if (this.outputPacedBuffer.length > 0) {
916
- stream.write(this.outputPacedBuffer);
917
- this.outputPacedBuffer = Buffer.alloc(0);
918
- }
905
+ const buffered = Buffer.concat(this.outputPacedBuffers, this.outputPacedBytes);
906
+ this.outputPacedBuffers = [];
907
+ this.outputPacedBytes = 0;
908
+ if (buffered.length > 0 && !stream.write(buffered)) this.waitForOutputDrain(stream);
919
909
  const resource = voiceSdk.createAudioResource(opusStream, { inputType: voiceSdk.StreamType.Opus });
920
910
  this.params.entry.player.play(resource);
921
911
  this.params.harness.outputActivity.markPlaybackStarted();
922
- this.playbackState = {
923
- status: "playing",
924
- stream
925
- };
926
912
  const realtimeConfig = this.params.realtimeConfig();
927
913
  logger$1.info(`discord voice: realtime audio playback started guild=${this.params.entry.guildId} channel=${this.params.entry.channelId} mode=${this.params.mode} model=${realtimeConfig?.model ?? "provider-default"} voice=${realtimeConfig?.speakerVoice ?? realtimeConfig?.speakerVoiceId ?? "provider-default"}`);
928
914
  }
@@ -931,15 +917,22 @@ var DiscordRealtimePlayback = class {
931
917
  this.clearOutputPlaybackWatchdog();
932
918
  this.logOutputAudioStopped(reason);
933
919
  this.outputStream = null;
934
- if (this.playbackState.status !== "backpressured") this.playbackState = { status: "idle" };
935
- this.outputPacedBuffer = Buffer.alloc(0);
920
+ this.outputPacedBuffers = [];
921
+ this.outputPacedBytes = 0;
922
+ if (this.outputDrainHandler) {
923
+ stream?.off("drain", this.outputDrainHandler);
924
+ this.outputDrainHandler = void 0;
925
+ }
936
926
  this.params.harness.outputActivity.reset();
937
927
  stream?.end();
938
928
  stream?.destroy();
939
929
  }
940
930
  scheduleOutputPlaybackWatchdog(reason, stream) {
941
931
  this.clearOutputPlaybackWatchdog();
942
- const timeoutMs = this.params.harness.outputActivity.playbackWatchdogDelayMs({ marginMs: DISCORD_REALTIME_OUTPUT_PLAYBACK_WATCHDOG_MARGIN_MS });
932
+ const timeoutMs = this.params.harness.outputActivity.playbackWatchdogDelayMs({
933
+ marginMs: DISCORD_REALTIME_OUTPUT_PLAYBACK_WATCHDOG_MARGIN_MS,
934
+ minMs: DISCORD_REALTIME_OUTPUT_PLAYBACK_WATCHDOG_MARGIN_MS
935
+ });
943
936
  if (timeoutMs === void 0) return;
944
937
  this.outputPlaybackWatchdog = setTimeout(() => {
945
938
  this.outputPlaybackWatchdog = void 0;
@@ -1029,7 +1022,6 @@ var DiscordRealtimeVoiceSession = class {
1029
1022
  status: "inactive",
1030
1023
  generation: 0
1031
1024
  };
1032
- this.nextLifecycleGeneration = 0;
1033
1025
  this.consultToolPolicy = "safe-read-only";
1034
1026
  this.consultPolicy = "auto";
1035
1027
  this.wakeNamePolicy = "never";
@@ -1072,7 +1064,7 @@ var DiscordRealtimeVoiceSession = class {
1072
1064
  providerId: () => this.realtimeProviderId,
1073
1065
  realtimeConfig: () => this.realtimeConfig,
1074
1066
  stopTerminally: () => {
1075
- this.stopLifecycle("exact-speech overflow");
1067
+ this.lifecycle.status = "stopped";
1076
1068
  this.consults.close();
1077
1069
  },
1078
1070
  stopped: () => this.isStopped(),
@@ -1111,11 +1103,10 @@ var DiscordRealtimeVoiceSession = class {
1111
1103
  });
1112
1104
  }
1113
1105
  async connect() {
1114
- const lifecycleGeneration = ++this.nextLifecycleGeneration;
1106
+ const lifecycleGeneration = this.lifecycle.generation + 1;
1115
1107
  this.lifecycle = {
1116
1108
  status: "starting",
1117
- generation: lifecycleGeneration,
1118
- instance: this
1109
+ generation: lifecycleGeneration
1119
1110
  };
1120
1111
  const configuredProviderId = this.realtimeConfig?.provider?.trim();
1121
1112
  if (configuredProviderId) {
@@ -1168,6 +1159,10 @@ var DiscordRealtimeVoiceSession = class {
1168
1159
  toolPolicy,
1169
1160
  consultPolicy
1170
1161
  });
1162
+ const onReady = () => {
1163
+ this.markProviderGenerationObserved();
1164
+ if (this.markLifecycleReady(lifecycleGeneration)) this.playback.drainQueuedExactSpeechMessages("provider-ready");
1165
+ };
1171
1166
  this.bridge = this.harness.createBridge({
1172
1167
  provider: resolved.provider,
1173
1168
  cfg: this.params.cfg,
@@ -1202,11 +1197,11 @@ var DiscordRealtimeVoiceSession = class {
1202
1197
  this.markProviderGenerationObserved();
1203
1198
  return this.consults.handleToolCall(event, session);
1204
1199
  },
1205
- onReady: () => {
1206
- this.markProviderGenerationObserved();
1207
- if (this.markLifecycleReady(lifecycleGeneration)) this.playback.drainQueuedExactSpeechMessages("provider-ready");
1200
+ onReady,
1201
+ onEvent: (event) => {
1202
+ this.handleBridgeEvent(event);
1203
+ if (event.direction === "client" && event.type === "session.reconnect.ready") onReady();
1208
1204
  },
1209
- onEvent: (event) => this.handleBridgeEvent(event),
1210
1205
  onResponseDone: (outcome) => {
1211
1206
  this.markProviderGenerationObserved();
1212
1207
  this.playback.handleResponseDone(outcome);
@@ -1215,10 +1210,16 @@ var DiscordRealtimeVoiceSession = class {
1215
1210
  },
1216
1211
  onError: (error) => this.logRealtimeError(formatErrorMessage(error)),
1217
1212
  onClose: (reason) => {
1218
- this.flushSuppressedRealtimeErrors();
1219
- logVoiceVerbose(`realtime closed: ${reason}`);
1213
+ if (!this.isStopped()) {
1214
+ this.lifecycle.status = "stopped";
1215
+ this.params.onTerminalError(/* @__PURE__ */ new Error(`Realtime provider closed unexpectedly: ${reason}`));
1216
+ }
1220
1217
  }
1221
1218
  });
1219
+ if (this.isStopped()) {
1220
+ this.close();
1221
+ return;
1222
+ }
1222
1223
  const resolvedModel = readProviderConfigString(resolved.providerConfig, "model") ?? resolved.provider.defaultModel;
1223
1224
  const resolvedVoice = readProviderConfigString(resolved.providerConfig, "voice");
1224
1225
  const humanParticipantCount = this.humanParticipantCount();
@@ -1234,7 +1235,7 @@ var DiscordRealtimeVoiceSession = class {
1234
1235
  logger.info(`discord voice: realtime bridge ready mode=${this.params.mode} provider=${resolved.provider.id} model=${resolvedModel ?? "default"} voice=${resolvedVoice ?? "default"}`);
1235
1236
  }
1236
1237
  close() {
1237
- this.stopLifecycle("session close");
1238
+ this.lifecycle.status = "stopped";
1238
1239
  this.providerContinuityEpoch += 1;
1239
1240
  this.flushSuppressedRealtimeErrors();
1240
1241
  this.consults.close();
@@ -1266,21 +1267,9 @@ var DiscordRealtimeVoiceSession = class {
1266
1267
  }
1267
1268
  markLifecycleReady(generation) {
1268
1269
  if (this.lifecycle.status !== "starting" && this.lifecycle.status !== "active" || this.lifecycle.generation !== generation) return false;
1269
- this.lifecycle = {
1270
- status: "active",
1271
- generation,
1272
- instance: this
1273
- };
1270
+ this.lifecycle.status = "active";
1274
1271
  return true;
1275
1272
  }
1276
- stopLifecycle(reason) {
1277
- const generation = this.lifecycle.generation;
1278
- this.lifecycle = {
1279
- status: "stopped",
1280
- generation,
1281
- reason
1282
- };
1283
- }
1284
1273
  humanParticipantCount() {
1285
1274
  return this.params.getHumanParticipantCount?.() ?? 0;
1286
1275
  }
@@ -1293,7 +1282,6 @@ var DiscordRealtimeVoiceSession = class {
1293
1282
  if (event.direction === "client" && event.type === "session.continuity.reset") this.resetProviderContinuity(event.type);
1294
1283
  if (event.direction === "server" && event.type === "input_audio_buffer.speech_started") this.turns.resetPartialWakeNameTracking();
1295
1284
  if (shouldLogRealtimeVerboseEvent(event)) logVoiceVerbose(`realtime ${event.direction}:${event.type}${detail}`);
1296
- this.playback.handleProviderEvent(event);
1297
1285
  const interruptionLog = formatRealtimeInterruptionLog(event);
1298
1286
  if (interruptionLog) logger.info(interruptionLog);
1299
1287
  const lifecycleLog = formatRealtimeLifecycleLog(event);
@@ -1305,11 +1293,7 @@ var DiscordRealtimeVoiceSession = class {
1305
1293
  resetProviderContinuity(reason) {
1306
1294
  if (!this.providerGenerationObserved) return;
1307
1295
  this.providerGenerationObserved = false;
1308
- if (this.lifecycle.status === "active") this.lifecycle = {
1309
- status: "starting",
1310
- generation: this.lifecycle.generation,
1311
- instance: this
1312
- };
1296
+ if (this.lifecycle.status === "active") this.lifecycle.status = "starting";
1313
1297
  this.providerContinuityEpoch += 1;
1314
1298
  this.consults.resetProviderContinuity();
1315
1299
  this.turns.resetProviderContinuity();
@@ -1,6 +1,6 @@
1
- import { m as normalizeDiscordToken } from "./accounts-DNl-oCEw.js";
2
- import { r as fetchDiscord } from "./api-DNVbJyEy.js";
3
- import { a as normalizeDiscordSlug } from "./allow-list-BDMimASD.js";
1
+ import { m as normalizeDiscordToken } from "./accounts-CwJQoLjM.js";
2
+ import { r as fetchDiscord } from "./api-BfmEP6wp.js";
3
+ import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.js";
4
4
  //#region extensions/discord/src/guilds.ts
5
5
  async function listGuilds(token, fetcher, options) {
6
6
  return (await fetchDiscord("/users/@me/guilds", token, fetcher, options)).filter((guild) => typeof guild.id === "string" && typeof guild.name === "string").map((guild) => ({
@@ -1,7 +1,8 @@
1
- import { en as __exportAll } from "./retry-DNsVTeTo.js";
2
- import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DNVbJyEy.js";
3
- import { a as normalizeDiscordSlug } from "./allow-list-BDMimASD.js";
4
- import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-DIVXbD1P.js";
1
+ import { on as __exportAll } from "./retry-t5RcEsPk.js";
2
+ import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BfmEP6wp.js";
3
+ import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.js";
4
+ import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
5
+ import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-BJ5UZNNT.js";
5
6
  //#region extensions/discord/src/resolve-channels.ts
6
7
  var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveDiscordChannelAllowlist: () => resolveDiscordChannelAllowlist });
7
8
  function parseDiscordChannelInput(raw) {
@@ -79,7 +80,7 @@ async function fetchChannel(token, fetcher, channelId) {
79
80
  function preferActiveMatch(candidates) {
80
81
  if (candidates.length === 0) return;
81
82
  const scored = candidates.map((channel) => {
82
- const isThread = channel.type === 11 || channel.type === 12;
83
+ const isThread = isDiscordThreadChannelType(channel.type);
83
84
  return {
84
85
  channel,
85
86
  score: (Boolean(channel.archived) ? 0 : 2) + (isThread ? 0 : 1)
@@ -1,6 +1,6 @@
1
- import { en as __exportAll } from "./retry-DNsVTeTo.js";
2
- import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DNVbJyEy.js";
3
- import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-DIVXbD1P.js";
1
+ import { on as __exportAll } from "./retry-t5RcEsPk.js";
2
+ import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BfmEP6wp.js";
3
+ import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-BJ5UZNNT.js";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/discord/src/resolve-users.ts
6
6
  var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveDiscordUserAllowlist: () => resolveDiscordUserAllowlist });
@@ -74,7 +74,8 @@ async function resolveDiscordUserAllowlist(params) {
74
74
  });
75
75
  continue;
76
76
  }
77
- const guildList = filterDiscordGuilds(await getGuilds(), {
77
+ const allGuilds = await getGuilds();
78
+ const guildList = filterDiscordGuilds(allGuilds, {
78
79
  guildId: parsed.guildId,
79
80
  guildName: parsed.guildName?.trim()
80
81
  });
@@ -3,7 +3,8 @@ import { asFiniteNumberInRange, parseStrictFiniteNumber } from "openclaw/plugin-
3
3
  const RETRY_AFTER_BODY_SECONDS_RE = /^(?:\d+\.?\d*|\.\d+)$/;
4
4
  const MAX_SAFE_RETRY_AFTER_SECONDS = Number.MAX_SAFE_INTEGER / 1e3;
5
5
  function parseDiscordRetryAfterBodySeconds(value) {
6
- return asFiniteNumberInRange(typeof value === "number" ? value : typeof value === "string" && RETRY_AFTER_BODY_SECONDS_RE.test(value.trim()) ? parseStrictFiniteNumber(value.trim()) : void 0, {
6
+ const seconds = typeof value === "number" ? value : typeof value === "string" && RETRY_AFTER_BODY_SECONDS_RE.test(value.trim()) ? parseStrictFiniteNumber(value.trim()) : void 0;
7
+ return asFiniteNumberInRange(seconds, {
7
8
  min: 0,
8
9
  max: MAX_SAFE_RETRY_AFTER_SECONDS
9
10
  });