@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,7 +0,0 @@
1
- import { r as setDiscordRuntime } from "./runtime-DgnVQ7zW.js";
2
- import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-Df0NbFJB.js";
3
- import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-CGeUoIqb.js";
4
- import { t as resolveDiscordUserAllowlist } from "./resolve-users-BtKxLUZv.js";
5
- import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-BTdtVRwU.js";
6
- import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-Yc7eZDd6.js";
7
- export { auditDiscordChannelPermissions, collectDiscordAuditChannelIds, fetchDiscordApplicationId, fetchDiscordApplicationSummary, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, parseApplicationIdFromToken, probeDiscord, resolveDiscordChannelAllowlist, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordUserAllowlist, setDiscordRuntime };
@@ -1,6 +0,0 @@
1
- import "./allow-list-BDMimASD.js";
2
- import "./timeouts-B9cy6RvQ.js";
3
- import "./provider-DlK_ynqt.js";
4
- import "./threading-DU6pgeGm.js";
5
- import "./message-handler-B61q5MOF.js";
6
- export {};
@@ -1,9 +0,0 @@
1
- import { _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as resolveGroupDmAllow, y as shouldEmitDiscordReactionNotification } from "./allow-list-BDMimASD.js";
2
- import { G as registerGateway, K as unregisterGateway, U as clearGateways, W as getGateway } from "./send.shared-B3fpaLWJ.js";
3
- import { i as setPresence, n as getPresence, r as presenceCacheSize, t as clearPresences } from "./presence-cache-z1N8MbJ3.js";
4
- import { a as isAbortError, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, l as runDiscordTaskWithTimeout, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, o as normalizeDiscordInboundWorkerTimeoutMs, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, s as normalizeDiscordListenerTimeoutMs, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
5
- import { d as waitForDiscordGatewayPluginRegistration, f as createDiscordNativeCommand, l as createDiscordGatewayPlugin, t as monitorDiscordProvider, u as resolveDiscordGatewayIntents, v as registerDiscordListener } from "./provider-DlK_ynqt.js";
6
- import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-DU6pgeGm.js";
7
- import { t as createDiscordMessageHandler } from "./message-handler-B61q5MOF.js";
8
- import "./runtime-api.monitor-CzeTYF32.js";
9
- export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, allowListMatches, clearGateways, clearPresences, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, getGateway, getPresence, isAbortError, isDiscordGroupAllowedByPolicy, monitorDiscordProvider, normalizeDiscordAllowList, normalizeDiscordInboundWorkerTimeoutMs, normalizeDiscordListenerTimeoutMs, normalizeDiscordSlug, presenceCacheSize, registerDiscordListener, registerGateway, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveGroupDmAllow, runDiscordTaskWithTimeout, sanitizeDiscordThreadName, setPresence, shouldEmitDiscordReactionNotification, unregisterGateway, waitForDiscordGatewayPluginRegistration };
@@ -1,7 +0,0 @@
1
- import { O as resolveDiscordOutboundSessionRoute } from "./accounts-DNl-oCEw.js";
2
- import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-ChK1wS7w.js";
3
- import { C as hasAllGuildPermissionsDiscord, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, _ as DiscordSendError, x as fetchChannelPermissionsDiscord } from "./send.shared-B3fpaLWJ.js";
4
- import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-HIkgji_7.js";
5
- import { A as listGuildEmojisDiscord, C as fetchVoiceStatusDiscord, D as removeRoleDiscord, E as listScheduledEventsDiscord, F as editChannelDiscord, I as moveChannelDiscord, L as removeChannelPermissionDiscord, M as uploadStickerDiscord, N as createChannelDiscord, O as resolveEventCoverImage, P as deleteChannelDiscord, R as setChannelPermissionDiscord, S as fetchRoleInfoDiscord, T as listGuildChannelsDiscord, _ as banMemberDiscord, c as editMessageDiscord, d as listThreadsDiscord, f as pinMessageDiscord, g as addRoleDiscord, h as unpinMessageDiscord, i as sendWebhookMessageDiscord, j as uploadEmojiDiscord, k as timeoutMemberDiscord, l as fetchMessageDiscord, m as searchMessagesDiscord, n as sendTypingDiscord, o as createThreadDiscord, p as readMessagesDiscord, r as sendVoiceMessageDiscord, s as deleteMessageDiscord, u as listPinsDiscord, v as createScheduledEventDiscord, w as kickMemberDiscord, x as fetchMemberInfoDiscord, y as fetchChannelInfoDiscord } from "./send-rQIffSYu.js";
6
- import { i as removeReactionDiscord, n as reactMessageDiscord, r as removeOwnReactionsDiscord, t as fetchReactionsDiscord } from "./send.reactions-gmJ6yFPo.js";
7
- export { DiscordSendError, addRoleDiscord, banMemberDiscord, createChannelDiscord, createScheduledEventDiscord, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, kickMemberDiscord, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadsDiscord, moveChannelDiscord, pinMessageDiscord, reactMessageDiscord, readMessagesDiscord, registerBuiltDiscordComponentMessage, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, resolveDiscordOutboundSessionRoute, resolveEventCoverImage, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, timeoutMemberDiscord, unpinMessageDiscord, uploadEmojiDiscord, uploadStickerDiscord };
@@ -1,5 +0,0 @@
1
- import { C as resolveThreadBindingMaxAgeExpiresAt, S as resolveThreadBindingInactivityExpiresAt, w as resolveThreadBindingMaxAgeMs, x as resolveThreadBindingIdleTimeoutMs } from "./thread-bindings.state-D8OMdk4O.js";
2
- import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CJb-BpPL.js";
3
- import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-CngsgErq.js";
4
- import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-VlymUnbz.js";
5
- export { autoBindSpawnedDiscordSubagent, createNoopThreadBindingManager, createThreadBindingManager, formatThreadBindingDurationLabel, getThreadBindingManager, listThreadBindingsBySessionKey, listThreadBindingsForAccount, reconcileAcpThreadBindingsOnStartup, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, unbindThreadBindingsBySessionKey };
@@ -1,369 +0,0 @@
1
- import { p as discord_exports } from "./retry-DNsVTeTo.js";
2
- import { createRequire } from "node:module";
3
- import fs from "node:fs/promises";
4
- import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
5
- import { logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
6
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
7
- import { resolveFfmpegBin } from "openclaw/plugin-sdk/media-runtime";
8
- import { resolvePreferredOpenClawTmpDir, tempWorkspace } from "openclaw/plugin-sdk/temp-path";
9
- import { controlRealtimeVoiceAgentRun, resamplePcm, shouldAutoControlRealtimeVoiceAgentText } from "openclaw/plugin-sdk/realtime-voice";
10
- import { spawn } from "node:child_process";
11
- import { Transform } from "node:stream";
12
- import { StringDecoder } from "node:string_decoder";
13
- import { Application, createDecoder, createEncoder } from "libopus-wasm";
14
- //#region extensions/discord/src/voice/log-preview.ts
15
- const DISCORD_VOICE_LOG_PREVIEW_CHARS = 500;
16
- function formatVoiceLogPreview(text) {
17
- const oneLine = text.replace(/\s+/g, " ").trim();
18
- if (oneLine.length <= DISCORD_VOICE_LOG_PREVIEW_CHARS) return oneLine;
19
- return `${truncateUtf16Safe(oneLine, DISCORD_VOICE_LOG_PREVIEW_CHARS)}...`;
20
- }
21
- //#endregion
22
- //#region extensions/discord/src/voice/agent-control.ts
23
- async function maybeControlDiscordVoiceAgentRun(params) {
24
- if (!shouldAutoControlRealtimeVoiceAgentText(params.text)) return { handled: false };
25
- const result = await controlRealtimeVoiceAgentRun({
26
- sessionKey: params.entry.route.sessionKey,
27
- text: params.text
28
- });
29
- if (!result.active) return {
30
- handled: false,
31
- result
32
- };
33
- return {
34
- handled: true,
35
- result,
36
- ...result.speak && !result.suppress ? { speakText: result.message } : {}
37
- };
38
- }
39
- //#endregion
40
- //#region extensions/discord/src/voice/prompt.ts
41
- const DISCORD_VOICE_SPOKEN_OUTPUT_CONTRACT = [
42
- "You are OpenClaw's Discord voice interface in a live voice channel.",
43
- "Discord voice reply requirements:",
44
- "- Return only the concise text that should be spoken aloud in the voice channel.",
45
- "- Treat the transcript as speech-to-text from a live conversation; repair obvious transcription artifacts and ignore repeated partial fragments caused by voice buffering.",
46
- "- If the transcript is garbled, incomplete, or missing the user's intent, ask one brief clarifying question instead of guessing.",
47
- "- If the request needs deeper reasoning, current information, or tools, use the available tools before answering.",
48
- "- Do not call the tts tool; Discord voice will synthesize and play the returned text.",
49
- "- Do not reply with NO_REPLY unless no spoken response is appropriate.",
50
- "- Keep the response brief, natural, and conversational. Prefer one to three short sentences.",
51
- "- Avoid markdown tables, code fences, citations, and visual formatting unless the user explicitly asks for something that cannot be spoken naturally."
52
- ].join("\n");
53
- function formatVoiceIngressPrompt(transcript, speakerLabel) {
54
- const cleanedTranscript = transcript.trim();
55
- const cleanedLabel = speakerLabel?.trim();
56
- const voiceInput = cleanedLabel ? [`Voice transcript from speaker "${cleanedLabel}":`, cleanedTranscript].join("\n") : cleanedTranscript;
57
- return [DISCORD_VOICE_SPOKEN_OUTPUT_CONTRACT, voiceInput].join("\n\n");
58
- }
59
- //#endregion
60
- //#region extensions/discord/src/voice/audio.ts
61
- const SAMPLE_RATE = 48e3;
62
- const CHANNELS = 2;
63
- const BIT_DEPTH = 16;
64
- const FFMPEG_ERROR_OUTPUT_BYTES = 8192;
65
- const DISCORD_OPUS_FRAME_SIZE = 960;
66
- const DISCORD_OPUS_FRAME_BYTES = DISCORD_OPUS_FRAME_SIZE * CHANNELS * (BIT_DEPTH / 8);
67
- const FFMPEG_PCM_ARGUMENTS = [
68
- "-analyzeduration",
69
- "0",
70
- "-loglevel",
71
- "error",
72
- "-vn",
73
- "-sn",
74
- "-dn",
75
- "-f",
76
- "s16le",
77
- "-ar",
78
- String(SAMPLE_RATE),
79
- "-ac",
80
- String(CHANNELS)
81
- ];
82
- let warnedOpusMissing = false;
83
- function buildWavBuffer(pcm) {
84
- const blockAlign = CHANNELS * BIT_DEPTH / 8;
85
- const byteRate = SAMPLE_RATE * blockAlign;
86
- const header = Buffer.alloc(44);
87
- header.write("RIFF", 0);
88
- header.writeUInt32LE(36 + pcm.length, 4);
89
- header.write("WAVE", 8);
90
- header.write("fmt ", 12);
91
- header.writeUInt32LE(16, 16);
92
- header.writeUInt16LE(1, 20);
93
- header.writeUInt16LE(CHANNELS, 22);
94
- header.writeUInt32LE(SAMPLE_RATE, 24);
95
- header.writeUInt32LE(byteRate, 28);
96
- header.writeUInt16LE(blockAlign, 32);
97
- header.writeUInt16LE(BIT_DEPTH, 34);
98
- header.write("data", 36);
99
- header.writeUInt32LE(pcm.length, 40);
100
- return Buffer.concat([header, pcm]);
101
- }
102
- async function createOpusDecoder(params) {
103
- let decoder;
104
- try {
105
- decoder = await createDecoder({
106
- channels: CHANNELS,
107
- sampleRate: SAMPLE_RATE
108
- });
109
- } catch (err) {
110
- const failure = formatErrorMessage(err);
111
- if (!warnedOpusMissing) {
112
- warnedOpusMissing = true;
113
- params.onWarn(`discord voice: no usable opus decoder available (libopus-wasm: ${failure}); cannot decode voice audio`);
114
- }
115
- return null;
116
- }
117
- return {
118
- name: "libopus-wasm",
119
- decoder: {
120
- decode: (buffer) => pcmInt16ToBuffer(decoder.decode(buffer, { maxFrameSize: DISCORD_OPUS_FRAME_SIZE })),
121
- free: () => decoder.free()
122
- }
123
- };
124
- }
125
- function createDiscordOpusEncodeStream() {
126
- return new DiscordOpusEncodeStream();
127
- }
128
- function createDiscordOpusPlaybackStream(input) {
129
- const inputSource = typeof input === "string" ? input : "pipe:0";
130
- const ffmpeg = spawn(resolveFfmpegBin(), [
131
- "-i",
132
- inputSource,
133
- ...FFMPEG_PCM_ARGUMENTS,
134
- "pipe:1"
135
- ], {
136
- stdio: [
137
- "pipe",
138
- "pipe",
139
- "pipe"
140
- ],
141
- windowsHide: true
142
- });
143
- const opusStream = createDiscordOpusEncodeStream();
144
- const stderr = Buffer.alloc(FFMPEG_ERROR_OUTPUT_BYTES);
145
- let stderrBytes = 0;
146
- let ffmpegClosed = false;
147
- const killFfmpeg = (signal = "SIGTERM") => {
148
- if (!ffmpegClosed && !ffmpeg.killed) ffmpeg.kill(signal);
149
- };
150
- ffmpeg.stderr.on("data", (chunk) => {
151
- if (stderrBytes < FFMPEG_ERROR_OUTPUT_BYTES) stderrBytes += chunk.copy(stderr, stderrBytes, 0, FFMPEG_ERROR_OUTPUT_BYTES - stderrBytes);
152
- });
153
- ffmpeg.once("error", (err) => {
154
- opusStream.destroy(err);
155
- });
156
- ffmpeg.once("close", (code, signal) => {
157
- ffmpegClosed = true;
158
- if (code && code !== 0) {
159
- const stderrText = new StringDecoder("utf8").write(stderr.subarray(0, stderrBytes)).trim();
160
- const suffix = stderrText ? `: ${stderrText}` : "";
161
- opusStream.destroy(/* @__PURE__ */ new Error(`ffmpeg exited with code ${code}${suffix}`));
162
- return;
163
- }
164
- if (signal) opusStream.destroy(/* @__PURE__ */ new Error(`ffmpeg exited with signal ${signal}`));
165
- });
166
- for (const readable of [ffmpeg.stdout, ffmpeg.stderr]) readable.on("error", (err) => {
167
- killFfmpeg("SIGKILL");
168
- opusStream.destroy(err);
169
- });
170
- ffmpeg.stdin.on("error", (err) => {
171
- if (err.code !== "EPIPE") opusStream.destroy(err);
172
- });
173
- ffmpeg.stdout.pipe(opusStream);
174
- opusStream.once("close", () => {
175
- if (!opusStream.readableEnded) killFfmpeg();
176
- });
177
- if (typeof input !== "string") {
178
- input.on("error", (err) => {
179
- ffmpeg.stdin.destroy(err);
180
- opusStream.destroy(err);
181
- });
182
- input.pipe(ffmpeg.stdin);
183
- } else ffmpeg.stdin.end();
184
- return opusStream;
185
- }
186
- var DiscordOpusEncodeStream = class extends Transform {
187
- #buffer = Buffer.alloc(0);
188
- #encoder = null;
189
- #encoderPromise = null;
190
- constructor() {
191
- super({ readableObjectMode: true });
192
- }
193
- async #getEncoder() {
194
- if (!this.#encoderPromise) this.#encoderPromise = createEncoder({
195
- application: Application.Audio,
196
- channels: CHANNELS,
197
- sampleRate: SAMPLE_RATE
198
- });
199
- if (!this.#encoder) this.#encoder = await this.#encoderPromise;
200
- return this.#encoder;
201
- }
202
- _transform(chunk, _encoding, done) {
203
- (async () => {
204
- try {
205
- const encoder = await this.#getEncoder();
206
- this.#buffer = this.#buffer.length > 0 ? Buffer.concat([this.#buffer, chunk]) : Buffer.from(chunk);
207
- while (this.#buffer.length >= DISCORD_OPUS_FRAME_BYTES) {
208
- const frame = this.#buffer.subarray(0, DISCORD_OPUS_FRAME_BYTES);
209
- this.#buffer = this.#buffer.subarray(DISCORD_OPUS_FRAME_BYTES);
210
- this.push(Buffer.from(encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE })));
211
- }
212
- done();
213
- } catch (err) {
214
- done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
215
- }
216
- })();
217
- }
218
- _final(done) {
219
- (async () => {
220
- try {
221
- if (this.#buffer.length > 0) {
222
- const encoder = await this.#getEncoder();
223
- const frame = Buffer.alloc(DISCORD_OPUS_FRAME_BYTES);
224
- this.#buffer.copy(frame);
225
- this.#buffer = Buffer.alloc(0);
226
- this.push(Buffer.from(encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE })));
227
- }
228
- this.#freeEncoder();
229
- done();
230
- } catch (err) {
231
- done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
232
- }
233
- })();
234
- }
235
- _destroy(err, done) {
236
- this.#freeEncoder();
237
- done(err);
238
- }
239
- #freeEncoder() {
240
- this.#encoder?.free();
241
- this.#encoder = null;
242
- }
243
- };
244
- function pcmInt16ToBuffer(pcm) {
245
- return Buffer.from(pcm.buffer, pcm.byteOffset, pcm.byteLength);
246
- }
247
- async function decodeOpusStream(stream, params) {
248
- const selected = await createOpusDecoder({ onWarn: params.onWarn });
249
- if (!selected) return Buffer.alloc(0);
250
- params.onVerbose(`opus decoder: ${selected.name}`);
251
- const chunks = [];
252
- try {
253
- for await (const chunk of stream) {
254
- if (!chunk || !(chunk instanceof Buffer) || chunk.length === 0) continue;
255
- const decoded = await selected.decoder.decode(chunk);
256
- if (decoded && decoded.length > 0) chunks.push(Buffer.from(decoded));
257
- }
258
- } catch (err) {
259
- params.onError?.(err);
260
- if (shouldLogVerbose()) logVerbose(`discord voice: opus decode failed: ${formatErrorMessage(err)}`);
261
- } finally {
262
- await selected.decoder.free?.();
263
- }
264
- return chunks.length > 0 ? Buffer.concat(chunks) : Buffer.alloc(0);
265
- }
266
- async function decodeOpusStreamChunks(stream, params) {
267
- const selected = await createOpusDecoder({ onWarn: params.onWarn });
268
- if (!selected) return;
269
- params.onVerbose(`opus decoder: ${selected.name}`);
270
- try {
271
- for await (const chunk of stream) {
272
- if (!chunk || !(chunk instanceof Buffer) || chunk.length === 0) continue;
273
- const decoded = await selected.decoder.decode(chunk);
274
- if (decoded && decoded.length > 0) params.onChunk(Buffer.from(decoded));
275
- }
276
- } catch (err) {
277
- params.onError?.(err);
278
- if (shouldLogVerbose()) logVerbose(`discord voice: opus decode failed: ${formatErrorMessage(err)}`);
279
- } finally {
280
- await selected.decoder.free?.();
281
- }
282
- }
283
- function convertDiscordPcm48kStereoToRealtimePcm24kMono(pcm) {
284
- const frameCount = Math.floor(pcm.length / 4);
285
- if (frameCount === 0) return Buffer.alloc(0);
286
- const mono48k = Buffer.alloc(frameCount * 2);
287
- for (let frame = 0; frame < frameCount; frame += 1) {
288
- const offset = frame * 4;
289
- const left = pcm.readInt16LE(offset);
290
- const right = pcm.readInt16LE(offset + 2);
291
- mono48k.writeInt16LE(Math.round((left + right) / 2), frame * 2);
292
- }
293
- return resamplePcm(mono48k, SAMPLE_RATE, 24e3);
294
- }
295
- function convertRealtimePcm24kMonoToDiscordPcm48kStereo(pcm) {
296
- const mono48k = resamplePcm(pcm, 24e3, SAMPLE_RATE);
297
- const sampleCount = Math.floor(mono48k.length / 2);
298
- if (sampleCount === 0) return Buffer.alloc(0);
299
- const stereo = Buffer.alloc(sampleCount * 4);
300
- for (let sampleIndex = 0; sampleIndex < sampleCount; sampleIndex += 1) {
301
- const sample = mono48k.readInt16LE(sampleIndex * 2);
302
- const offset = sampleIndex * 4;
303
- stereo.writeInt16LE(sample, offset);
304
- stereo.writeInt16LE(sample, offset + 2);
305
- }
306
- return stereo;
307
- }
308
- function estimateDurationSeconds(pcm) {
309
- const bytesPerSample = BIT_DEPTH / 8 * CHANNELS;
310
- return pcm.length / (bytesPerSample * SAMPLE_RATE);
311
- }
312
- async function writeVoiceWavFile(pcm) {
313
- const workspace = await tempWorkspace({
314
- rootDir: resolvePreferredOpenClawTmpDir(),
315
- prefix: "discord-voice-"
316
- });
317
- scheduleTempCleanup(workspace.dir);
318
- const wav = buildWavBuffer(pcm);
319
- return {
320
- path: await workspace.write("segment.wav", wav),
321
- durationSeconds: estimateDurationSeconds(pcm)
322
- };
323
- }
324
- function scheduleTempCleanup(tempDir, delayMs = 1800 * 1e3) {
325
- setTimeout(() => {
326
- fs.rm(tempDir, {
327
- recursive: true,
328
- force: true
329
- }).catch((err) => {
330
- if (shouldLogVerbose()) logVerbose(`discord voice: temp cleanup failed for ${tempDir}: ${formatErrorMessage(err)}`);
331
- });
332
- }, delayMs).unref();
333
- }
334
- //#endregion
335
- //#region extensions/discord/src/voice/session.ts
336
- const MIN_SEGMENT_SECONDS = .35;
337
- const CAPTURE_FINALIZE_GRACE_MS = 2e3;
338
- const VOICE_CONNECT_READY_TIMEOUT_MS = 3e4;
339
- const VOICE_RECONNECT_GRACE_MS = 15e3;
340
- const PLAYBACK_READY_TIMEOUT_MS = 6e4;
341
- const SPEAKING_READY_TIMEOUT_MS = 6e4;
342
- function resolveVoiceTimeoutMs(value, fallbackMs) {
343
- if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return fallbackMs;
344
- return Math.floor(value);
345
- }
346
- function resolveDiscordVoiceMode(voice) {
347
- const mode = voice?.mode;
348
- if (mode === "stt-tts" || mode === "bidi") return mode;
349
- return "agent-proxy";
350
- }
351
- function isDiscordRealtimeVoiceMode(mode) {
352
- return mode === "agent-proxy" || mode === "bidi";
353
- }
354
- function logVoiceVerbose(message) {
355
- logVerbose(`discord voice: ${message}`);
356
- }
357
- function isVoiceChannel(type) {
358
- return type === discord_exports.ChannelType.GuildVoice || type === discord_exports.ChannelType.GuildStageVoice;
359
- }
360
- //#endregion
361
- //#region extensions/discord/src/voice/sdk-runtime.ts
362
- let cachedDiscordVoiceSdk = null;
363
- function loadDiscordVoiceSdk() {
364
- if (cachedDiscordVoiceSdk) return cachedDiscordVoiceSdk;
365
- cachedDiscordVoiceSdk = createRequire(import.meta.url)("@discordjs/voice");
366
- return cachedDiscordVoiceSdk;
367
- }
368
- //#endregion
369
- export { formatVoiceLogPreview as S, decodeOpusStream as _, SPEAKING_READY_TIMEOUT_MS as a, formatVoiceIngressPrompt as b, isDiscordRealtimeVoiceMode as c, resolveDiscordVoiceMode as d, resolveVoiceTimeoutMs as f, createDiscordOpusPlaybackStream as g, createDiscordOpusEncodeStream as h, PLAYBACK_READY_TIMEOUT_MS as i, isVoiceChannel as l, convertRealtimePcm24kMonoToDiscordPcm48kStereo as m, CAPTURE_FINALIZE_GRACE_MS as n, VOICE_CONNECT_READY_TIMEOUT_MS as o, convertDiscordPcm48kStereoToRealtimePcm24kMono as p, MIN_SEGMENT_SECONDS as r, VOICE_RECONNECT_GRACE_MS as s, loadDiscordVoiceSdk as t, logVoiceVerbose as u, decodeOpusStreamChunks as v, maybeControlDiscordVoiceAgentRun as x, writeVoiceWavFile as y };
@@ -1,78 +0,0 @@
1
- import { Tt as getChannelMessage, _t as listMessageReactionUsers, gt as deleteOwnMessageReaction, ht as createOwnMessageReaction } from "./retry-DNsVTeTo.js";
2
- import { P as createDiscordClient, i as formatReactionEmoji, r as buildReactionIdentifier, s as normalizeReactionEmoji } from "./send.shared-B3fpaLWJ.js";
3
- import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
4
- //#region extensions/discord/src/send.reactions.ts
5
- function createDiscordReactionRuntimeClient(opts) {
6
- return createDiscordClient(opts);
7
- }
8
- function resolveDiscordReactionClient(opts) {
9
- if (!opts.cfg) throw new Error("Discord reactions requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.");
10
- const cfg = requireRuntimeConfig(opts.cfg, "Discord reactions");
11
- return createDiscordClient({
12
- ...opts,
13
- cfg
14
- });
15
- }
16
- function isDiscordReactionRuntimeContext(opts) {
17
- return Boolean(opts.rest && opts.cfg && opts.accountId);
18
- }
19
- async function reactMessageDiscord(channelId, messageId, emoji, opts) {
20
- const { rest, request } = isDiscordReactionRuntimeContext(opts) ? createDiscordReactionRuntimeClient(opts) : resolveDiscordReactionClient(opts);
21
- const encoded = normalizeReactionEmoji(emoji);
22
- await request(() => createOwnMessageReaction(rest, channelId, messageId, encoded), "react");
23
- return { ok: true };
24
- }
25
- async function removeReactionDiscord(channelId, messageId, emoji, opts) {
26
- const { rest, request } = isDiscordReactionRuntimeContext(opts) ? createDiscordReactionRuntimeClient(opts) : resolveDiscordReactionClient(opts);
27
- const encoded = normalizeReactionEmoji(emoji);
28
- await request(() => deleteOwnMessageReaction(rest, channelId, messageId, encoded), "reaction-remove");
29
- return { ok: true };
30
- }
31
- async function removeOwnReactionsDiscord(channelId, messageId, opts) {
32
- const { rest, request } = isDiscordReactionRuntimeContext(opts) ? createDiscordReactionRuntimeClient(opts) : resolveDiscordReactionClient(opts);
33
- const message = await request(() => getChannelMessage(rest, channelId, messageId), "reaction-list");
34
- const identifiers = /* @__PURE__ */ new Set();
35
- for (const reaction of message.reactions ?? []) {
36
- const identifier = reaction.me ? buildReactionIdentifier(reaction.emoji) : void 0;
37
- if (identifier) identifiers.add(identifier);
38
- }
39
- if (identifiers.size === 0) return {
40
- ok: true,
41
- removed: []
42
- };
43
- const removed = Array.from(identifiers);
44
- await Promise.all(removed.map((identifier) => request(() => deleteOwnMessageReaction(rest, channelId, messageId, normalizeReactionEmoji(identifier)), "reaction-remove")));
45
- return {
46
- ok: true,
47
- removed
48
- };
49
- }
50
- async function fetchReactionsDiscord(channelId, messageId, opts) {
51
- const { rest, request } = isDiscordReactionRuntimeContext(opts) ? createDiscordReactionRuntimeClient(opts) : resolveDiscordReactionClient(opts);
52
- const reactions = (await request(() => getChannelMessage(rest, channelId, messageId), "reaction-list")).reactions ?? [];
53
- if (reactions.length === 0) return [];
54
- const limit = typeof opts.limit === "number" && Number.isFinite(opts.limit) ? Math.min(Math.max(Math.floor(opts.limit), 1), 100) : 100;
55
- const summaries = [];
56
- for (const reaction of reactions) {
57
- const identifier = buildReactionIdentifier(reaction.emoji);
58
- if (!identifier) continue;
59
- const encoded = encodeURIComponent(identifier);
60
- const users = await request(() => listMessageReactionUsers(rest, channelId, messageId, encoded, { limit }), "reaction-users");
61
- summaries.push({
62
- emoji: {
63
- id: reaction.emoji.id ?? null,
64
- name: reaction.emoji.name ?? null,
65
- raw: formatReactionEmoji(reaction.emoji)
66
- },
67
- count: reaction.count,
68
- users: users.map((user) => ({
69
- id: user.id,
70
- username: user.username,
71
- tag: user.username && user.discriminator ? `${user.username}#${user.discriminator}` : user.username
72
- }))
73
- });
74
- }
75
- return summaries;
76
- }
77
- //#endregion
78
- export { removeReactionDiscord as i, reactMessageDiscord as n, removeOwnReactionsDiscord as r, fetchReactionsDiscord as t };
@@ -1,76 +0,0 @@
1
- import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
2
- import { attachChannelToResults } from "openclaw/plugin-sdk/channel-send-result";
3
- //#region extensions/discord/src/send.receipt.ts
4
- function toDiscordOutboundDeliveryResult(result) {
5
- const { channelId, ...delivery } = result;
6
- return {
7
- ...delivery,
8
- target: {
9
- kind: "channel",
10
- id: channelId
11
- }
12
- };
13
- }
14
- function createDiscordSendReceiptFromResults(params) {
15
- const receipt = createMessageReceiptFromOutboundResults({
16
- results: attachChannelToResults("discord", params.results),
17
- threadId: params.threadId
18
- });
19
- return {
20
- ...receipt,
21
- parts: receipt.parts.map(({ platformMessageId, kind, threadId, replyToId, raw }, index) => ({
22
- platformMessageId,
23
- kind,
24
- index,
25
- threadId,
26
- replyToId,
27
- raw
28
- }))
29
- };
30
- }
31
- function createDiscordSendReceipt(params) {
32
- return createMessageReceiptFromOutboundResults({
33
- results: params.platformMessageIds.map((messageId) => messageId.trim()).filter((messageId) => messageId && messageId !== "unknown").map((messageId, index) => {
34
- const result = {
35
- channel: "discord",
36
- messageId
37
- };
38
- if (params.channelId) result.channelId = params.channelId;
39
- if (params.reply?.scope === "first" && index === 0) {
40
- const rawResult = {
41
- channel: "discord",
42
- messageId
43
- };
44
- if (params.channelId) rawResult.channelId = params.channelId;
45
- result.receipt = createMessageReceiptFromOutboundResults({
46
- results: [rawResult],
47
- kind: params.kind,
48
- threadId: params.threadId,
49
- replyToId: params.reply.messageId
50
- });
51
- }
52
- return result;
53
- }),
54
- kind: params.kind,
55
- threadId: params.threadId,
56
- replyToId: params.reply?.scope === "all" ? params.reply.messageId : void 0
57
- });
58
- }
59
- function createDiscordSendResult(params) {
60
- const messageId = params.result.id || "unknown";
61
- const channelId = params.result.channel_id ?? params.fallbackChannelId;
62
- const receiptParams = {
63
- platformMessageIds: params.result.platformMessageIds?.length ? params.result.platformMessageIds : [messageId],
64
- channelId,
65
- kind: params.kind
66
- };
67
- if (params.threadId != null) receiptParams.threadId = String(params.threadId);
68
- if (params.reply) receiptParams.reply = params.reply;
69
- return {
70
- messageId,
71
- channelId,
72
- receipt: createDiscordSendReceipt(receiptParams)
73
- };
74
- }
75
- //#endregion
76
- export { toDiscordOutboundDeliveryResult as i, createDiscordSendReceiptFromResults as n, createDiscordSendResult as r, createDiscordSendReceipt as t };