@openclaw/discord 2026.8.1-beta.2 → 2026.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/dist/{account-inspect-CqzrH14k.js → account-inspect-BDfKyuvL.js} +1 -1
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{accounts-DJTf1LtA.js → accounts-CfQ-vSyf.js} +34 -1
  4. package/dist/action-runtime-api.js +1 -1
  5. package/dist/{activities-api-DS7vpdtp.js → activities-api-Dl-TOyOX.js} +134 -175
  6. package/dist/activities-api.js +1 -1
  7. package/dist/api.js +17 -17
  8. package/dist/{approval-handler.runtime-B6yEV79q.js → approval-handler.runtime-q4Zqo44V.js} +29 -106
  9. package/dist/{audit-Db-rlntl.js → audit-DgrvFPGt.js} +5 -5
  10. package/dist/{channel-CnnbJSt5.js → channel-BsQUalPw.js} +72 -50
  11. package/dist/{channel-actions.runtime-CLKrx6tr.js → channel-actions.runtime-UMGGIfSy.js} +31 -45
  12. package/dist/channel-config-api.js +1 -1
  13. package/dist/channel-plugin-api.js +1 -1
  14. package/dist/channel-type-CVLZyGYS.js +7 -0
  15. package/dist/{channel.setup-BFAO-V1P.js → channel.setup-rPs4dsk_.js} +5 -5
  16. package/dist/{outbound-session-route-DxLkrgKQ.js → components-Dk35LTf_.js} +34 -76
  17. package/dist/{config-schema-BgEskFAs.js → config-schema-CxPqtVI1.js} +46 -14
  18. package/dist/conversation-binding-route-BjvX4e35.js +43 -0
  19. package/dist/{directory-config-BVX7Cflc.js → directory-config-B7DY_pNG.js} +2 -2
  20. package/dist/directory-contract-api.js +1 -1
  21. package/dist/{directory-live-DGIGxpIo.js → directory-live-DuAXKkan.js} +3 -3
  22. package/dist/doctor-contract-api.js +2 -2
  23. package/dist/{doctor-BzC-TLnB.js → doctor-zQTtn6hm.js} +33 -12
  24. package/dist/{handle-action.guild-admin-BNVTUISF.js → handle-action.guild-admin-DZewwLr1.js} +9 -5
  25. package/dist/index.js +3 -4
  26. package/dist/ingress-identity-CzZKcPK8.js +60 -0
  27. package/dist/{message-handler-Unk_f10F.js → message-handler-C5By3yl5.js} +82 -6
  28. package/dist/{message-handler.preflight-C9zecxR9.js → message-handler.preflight-DrszWuHw.js} +44 -118
  29. package/dist/{message-handler.process-DWQ6UHHu.js → message-handler.process-DyFPDLCt.js} +205 -235
  30. package/dist/{message-utils-BSCPVgy0.js → message-text-Ca8M6TU8.js} +43 -42
  31. package/dist/{outbound-adapter-D9nRivT1.js → outbound-adapter-Dif8p481.js} +118 -91
  32. package/dist/{outbound-components-cTzwBJ60.js → outbound-components-wjv7yyAj.js} +5 -4
  33. package/dist/outbound-session-route-Bn4uXaoE.js +665 -0
  34. package/dist/owner-access-UlYi9t0M.js +107 -0
  35. package/dist/{pluralkit-DdiJ9KMK.js → pluralkit-9EuEN4UD.js} +1 -1
  36. package/dist/{probe-Bl-k5_Ku.js → probe-n6ZXxK8V.js} +1 -1
  37. package/dist/{probe.runtime-M9fREKvp.js → probe.runtime-CN4bdPfZ.js} +1 -1
  38. package/dist/{provider-DvSNb-2v.js → provider-LXiOcJrH.js} +887 -1350
  39. package/dist/{provider-session.runtime-BUEqD0rA.js → provider-session.runtime-DSNe7r2W.js} +3 -3
  40. package/dist/provider.runtime-DiInaDXO.js +2 -0
  41. package/dist/{realtime-session.runtime-C7wen-aF.js → realtime-session.runtime-DOViOIjY.js} +129 -134
  42. package/dist/{resolve-allowlist-common-D04lpEzb.js → resolve-allowlist-common-BLoYaxEG.js} +2 -2
  43. package/dist/{resolve-channels-Dm7jEeg6.js → resolve-channels-D2yl_2CN.js} +5 -4
  44. package/dist/{resolve-users-bktrCUUU.js → resolve-users-BLxfqajZ.js} +2 -2
  45. package/dist/{retry-CLpJcXXf.js → retry-DqHCW6PV.js} +187 -19
  46. package/dist/{runtime-DGsSyDTS.js → runtime-BYamRVPN.js} +89 -86
  47. package/dist/{runtime-DoHjckYm.js → runtime-DrxVBTtp.js} +9 -10
  48. package/dist/runtime-api.js +19 -25
  49. package/dist/{sdk-runtime-QpY8PvCh.js → sdk-runtime-6tfgYDjY.js} +57 -89
  50. package/dist/{secret-config-contract-B1akrlyY.js → secret-config-contract-B3i6WxV5.js} +53 -25
  51. package/dist/secret-contract-api.js +1 -1
  52. package/dist/{security-audit-jGnJF__m.js → security-audit-DKfK-iPY.js} +11 -12
  53. package/dist/security-audit-contract-api.js +1 -1
  54. package/dist/{security-audit.runtime-CPN0xFYz.js → security-audit.runtime-sKZyKgpx.js} +1 -1
  55. package/dist/{send-B7Q6Oc1I.js → send-UJHiAm4C.js} +82 -19
  56. package/dist/{send.components-iJyFXw9L.js → send.components-CrBJpGT_.js} +22 -39
  57. package/dist/{send.outbound-DS5tHwfR.js → send.outbound-D7JYmfm9.js} +77 -78
  58. package/dist/{send.shared-BmwFjW6T.js → send.shared-DZJ1akvQ.js} +136 -121
  59. package/dist/{sender-identity-QtalnCYv.js → sender-identity-BJtfyise.js} +1 -1
  60. package/dist/setup-plugin-api.js +1 -1
  61. package/dist/{shared-BIXIX6uJ.js → shared-Dii2HTn7.js} +41 -14
  62. package/dist/subagent-hooks-JyGrtQIl.js +49 -0
  63. package/dist/subagent-hooks-api.js +1 -6
  64. package/dist/{system-events-CTqDf6_s.js → system-events-BEmcj4xJ.js} +2 -2
  65. package/dist/{target-resolver-maOKSqO0.js → target-resolver-V-IYae6s.js} +3 -3
  66. package/dist/targets-CQp53cGj.js +3 -0
  67. package/dist/{thread-bindings-3L8p82GV.js → thread-bindings-DvYP79fy.js} +28 -26
  68. package/dist/{thread-bindings.manager-DCIH6WDC.js → thread-bindings.manager-Clm77DBM.js} +11 -14
  69. package/dist/{thread-bindings.session-updates-bJ2KQFY6.js → thread-bindings.session-updates-CJb-BpPL.js} +1 -1
  70. package/dist/{thread-bindings.state-aeV8HNgV.js → thread-bindings.state-D8OMdk4O.js} +1 -1
  71. package/dist/threading-CXuu_7o9.js +478 -0
  72. package/dist/transcripts-source-BLEMH_yi.js +270 -0
  73. package/dist/transcripts-source-api.js +7 -2
  74. package/dist/{typing-CS-nNVoe.js → typing-B9snnwMe.js} +1 -1
  75. package/dist/{voice-runtime-BEdqNcST.js → voice-runtime-DY6_o73o.js} +250 -150
  76. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/README.md +19 -19
  77. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v1.js +7 -3
  78. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v7.js +5 -2
  79. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v1.js +7 -3
  80. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v7.js +5 -2
  81. package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/package.json +4 -3
  82. package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
  83. package/node_modules/@discordjs/voice/node_modules/@types/node/child_process.d.ts +0 -1
  84. package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +6 -6
  85. package/node_modules/@discordjs/voice/node_modules/@types/node/dns/promises.d.ts +5 -5
  86. package/node_modules/@discordjs/voice/node_modules/@types/node/dns.d.ts +5 -5
  87. package/node_modules/@discordjs/voice/node_modules/@types/node/fs.d.ts +7 -0
  88. package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +30 -0
  89. package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +4 -4
  90. package/node_modules/@discordjs/voice/node_modules/@types/node/os.d.ts +30 -30
  91. package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
  92. package/node_modules/@discordjs/voice/node_modules/@types/node/perf_hooks.d.ts +2 -1
  93. package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +42 -43
  94. package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +1049 -84
  95. package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +14 -1
  96. package/node_modules/@discordjs/voice/node_modules/@types/node/stream/iter.d.ts +3 -2
  97. package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +61 -0
  98. package/node_modules/@discordjs/voice/node_modules/@types/node/v8.d.ts +20 -23
  99. package/node_modules/discord-api-types/CHANGELOG.md +8 -0
  100. package/node_modules/discord-api-types/package.json +4 -4
  101. package/node_modules/discord-api-types/payloads/v10/channel.d.ts +2 -2
  102. package/node_modules/discord-api-types/payloads/v10/channel.d.ts.map +1 -1
  103. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts +4 -0
  104. package/node_modules/discord-api-types/payloads/v10/gateway.d.ts.map +1 -1
  105. package/node_modules/discord-api-types/payloads/v10/gateway.js.map +1 -1
  106. package/node_modules/discord-api-types/payloads/v10/message.d.ts +4 -1
  107. package/node_modules/discord-api-types/payloads/v10/message.d.ts.map +1 -1
  108. package/node_modules/discord-api-types/payloads/v10/message.js +1 -0
  109. package/node_modules/discord-api-types/payloads/v10/message.js.map +1 -1
  110. package/node_modules/discord-api-types/payloads/v9/channel.d.ts +2 -2
  111. package/node_modules/discord-api-types/payloads/v9/channel.d.ts.map +1 -1
  112. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts +4 -0
  113. package/node_modules/discord-api-types/payloads/v9/gateway.d.ts.map +1 -1
  114. package/node_modules/discord-api-types/payloads/v9/gateway.js.map +1 -1
  115. package/node_modules/discord-api-types/payloads/v9/message.d.ts +4 -1
  116. package/node_modules/discord-api-types/payloads/v9/message.d.ts.map +1 -1
  117. package/node_modules/discord-api-types/payloads/v9/message.js +1 -0
  118. package/node_modules/discord-api-types/payloads/v9/message.js.map +1 -1
  119. package/node_modules/typebox/build/format/date.d.mts +1 -1
  120. package/node_modules/typebox/build/format/date.mjs +1 -1
  121. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  122. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  123. package/node_modules/typebox/build/format/email.d.mts +1 -1
  124. package/node_modules/typebox/build/format/email.mjs +2 -2
  125. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  126. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  127. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  128. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  129. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  130. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  131. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  132. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  133. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  134. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  135. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  136. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  137. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
  138. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  139. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  140. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  141. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  142. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  143. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  144. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  145. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  146. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  147. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  148. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  149. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  150. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  151. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  152. package/node_modules/typebox/build/format/iri.mjs +26 -8
  153. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  154. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  155. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  156. package/node_modules/typebox/build/format/regex.mjs +2 -6
  157. package/node_modules/typebox/build/format/time.d.mts +2 -2
  158. package/node_modules/typebox/build/format/time.mjs +19 -14
  159. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  160. package/node_modules/typebox/build/format/uri.mjs +3 -130
  161. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  162. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  163. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  164. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  165. package/node_modules/typebox/build/format/url.d.mts +3 -3
  166. package/node_modules/typebox/build/format/url.mjs +4 -5
  167. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  168. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  169. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  170. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  171. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  172. package/node_modules/typebox/build/guard/string.mjs +7 -7
  173. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  174. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  175. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  176. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  177. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  178. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  179. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  180. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  181. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  182. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  183. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  184. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  185. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  186. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  187. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  188. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  189. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  190. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  191. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  192. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  193. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  194. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  195. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  196. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  197. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  198. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  199. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  200. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  201. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  202. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  203. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  204. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  205. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  206. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  207. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  208. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  209. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  210. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  211. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  212. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  213. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  214. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  215. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  216. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  217. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  218. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  219. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  220. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  221. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  222. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  223. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  224. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  225. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  226. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  227. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  228. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  229. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  230. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  231. package/node_modules/typebox/package.json +27 -27
  232. package/node_modules/typebox/readme.md +79 -82
  233. package/node_modules/undici/docs/docs/api/Client.md +21 -8
  234. package/node_modules/undici/lib/api/readable.js +33 -43
  235. package/node_modules/undici/lib/core/connect.js +16 -2
  236. package/node_modules/undici/lib/core/symbols.js +1 -0
  237. package/node_modules/undici/lib/dispatcher/client-h1.js +3 -3
  238. package/node_modules/undici/lib/dispatcher/client-h2.js +179 -10
  239. package/node_modules/undici/lib/dispatcher/client.js +74 -29
  240. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +28 -6
  241. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +15 -1
  242. package/node_modules/undici/lib/handler/retry-handler.js +7 -2
  243. package/node_modules/undici/lib/interceptor/cache.js +5 -2
  244. package/node_modules/undici/lib/interceptor/deduplicate.js +1 -1
  245. package/node_modules/undici/lib/mock/mock-utils.js +213 -24
  246. package/node_modules/undici/lib/util/cache.js +2 -4
  247. package/node_modules/undici/lib/web/websocket/websocket.js +22 -0
  248. package/node_modules/undici/package.json +1 -1
  249. package/node_modules/undici/types/client.d.ts +40 -0
  250. package/node_modules/ws/lib/permessage-deflate.js +3 -1
  251. package/node_modules/ws/package.json +1 -1
  252. package/openclaw.plugin.json +24 -10
  253. package/package.json +8 -10
  254. package/skills/discord/SKILL.md +1 -1
  255. package/dist/approval-message-safety-AcIxvrf3.js +0 -140
  256. package/dist/audit-core-xwjIczO0.js +0 -105
  257. package/dist/channel-actions-5s_hjYKd.js +0 -208
  258. package/dist/channel-api-CAJ0wMoV.js +0 -21
  259. package/dist/inbound-event-delivery-De2qxTrP.js +0 -39
  260. package/dist/provider.runtime-C9PnJZbZ.js +0 -2
  261. package/dist/runtime-api.actions.js +0 -3
  262. package/dist/runtime-api.lookup.js +0 -7
  263. package/dist/runtime-api.monitor-CHxrFPnW.js +0 -5
  264. package/dist/runtime-api.monitor.js +0 -8
  265. package/dist/runtime-api.send.js +0 -7
  266. package/dist/runtime-api.threads.js +0 -5
  267. package/dist/send.reactions-BAn0iiVQ.js +0 -78
  268. package/dist/send.receipt-IPI1p-SP.js +0 -66
  269. package/dist/subagent-hooks-CTt5KCJr.js +0 -120
  270. package/dist/subagent-progress-DhaE_h8a.js +0 -109
  271. package/dist/targets-yUFTHoAx.js +0 -3
  272. package/dist/transcripts-source-CfFMexGt.js +0 -123
  273. package/node_modules/p-map/index.d.ts +0 -155
  274. package/node_modules/p-map/index.js +0 -285
  275. package/node_modules/p-map/license +0 -9
  276. package/node_modules/p-map/package.json +0 -57
  277. package/node_modules/p-map/readme.md +0 -190
  278. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  279. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  280. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  281. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  282. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  283. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  284. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  285. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  286. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  287. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
  288. package/dist/{allow-list-DnxIlPP2.js → allow-list-BDMimASD.js} +1 -1
  289. package/dist/{doctor-contract-DLa-BTiU.js → doctor-contract-DsWvKIXF.js} +1 -1
@@ -1,4 +1,4 @@
1
- import { h as discord_exports } from "./retry-CLpJcXXf.js";
1
+ import { y as discord_exports } from "./retry-DqHCW6PV.js";
2
2
  import { createRequire } from "node:module";
3
3
  import fs from "node:fs/promises";
4
4
  import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
@@ -99,29 +99,6 @@ function buildWavBuffer(pcm) {
99
99
  header.writeUInt32LE(pcm.length, 40);
100
100
  return Buffer.concat([header, pcm]);
101
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
102
  function createDiscordOpusEncodeStream() {
126
103
  return new DiscordOpusEncodeStream();
127
104
  }
@@ -185,99 +162,92 @@ function createDiscordOpusPlaybackStream(input) {
185
162
  }
186
163
  var DiscordOpusEncodeStream = class extends Transform {
187
164
  #buffer = Buffer.alloc(0);
188
- #encoder = null;
189
- #encoderPromise = null;
165
+ #encoder;
190
166
  constructor() {
191
167
  super({ readableObjectMode: true });
192
168
  }
193
- async #getEncoder() {
194
- if (!this.#encoderPromise) this.#encoderPromise = createEncoder({
169
+ _construct(done) {
170
+ createEncoder({
195
171
  application: Application.Audio,
196
172
  channels: CHANNELS,
197
173
  sampleRate: SAMPLE_RATE
198
- });
199
- if (!this.#encoder) this.#encoder = await this.#encoderPromise;
200
- return this.#encoder;
174
+ }).then((encoder) => {
175
+ this.#encoder = encoder;
176
+ done();
177
+ }, (err) => done(err instanceof Error ? err : new Error(formatErrorMessage(err))));
201
178
  }
202
179
  _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)));
180
+ try {
181
+ this.#buffer = this.#buffer.length > 0 ? Buffer.concat([this.#buffer, chunk]) : Buffer.from(chunk);
182
+ while (this.#buffer.length >= DISCORD_OPUS_FRAME_BYTES) {
183
+ const frame = this.#buffer.subarray(0, DISCORD_OPUS_FRAME_BYTES);
184
+ this.#buffer = this.#buffer.subarray(DISCORD_OPUS_FRAME_BYTES);
185
+ this.#encodeFrame(frame);
215
186
  }
216
- })();
187
+ done();
188
+ } catch (err) {
189
+ done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
190
+ }
217
191
  }
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)));
192
+ _flush(done) {
193
+ try {
194
+ if (this.#buffer.length > 0) {
195
+ const frame = Buffer.alloc(DISCORD_OPUS_FRAME_BYTES);
196
+ this.#buffer.copy(frame);
197
+ this.#buffer = Buffer.alloc(0);
198
+ this.#encodeFrame(frame);
232
199
  }
233
- })();
200
+ done();
201
+ } catch (err) {
202
+ done(err instanceof Error ? err : new Error(formatErrorMessage(err)));
203
+ }
234
204
  }
235
205
  _destroy(err, done) {
236
- this.#freeEncoder();
206
+ this.#encoder?.free();
207
+ this.#buffer = Buffer.alloc(0);
237
208
  done(err);
238
209
  }
239
- #freeEncoder() {
240
- this.#encoder?.free();
241
- this.#encoder = null;
210
+ #encodeFrame(frame) {
211
+ this.push(Buffer.from(this.#encoder.encode(frame, { frameSize: DISCORD_OPUS_FRAME_SIZE })));
242
212
  }
243
213
  };
244
214
  function pcmInt16ToBuffer(pcm) {
245
215
  return Buffer.from(pcm.buffer, pcm.byteOffset, pcm.byteLength);
246
216
  }
247
217
  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
218
  const chunks = [];
219
+ await decodeOpusStreamChunks(stream, {
220
+ ...params,
221
+ onChunk: (chunk) => chunks.push(chunk)
222
+ });
223
+ return Buffer.concat(chunks);
224
+ }
225
+ async function decodeOpusStreamChunks(stream, params) {
226
+ let decoder;
252
227
  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
- }
228
+ decoder = await createDecoder({
229
+ channels: CHANNELS,
230
+ sampleRate: SAMPLE_RATE
231
+ });
258
232
  } catch (err) {
259
- params.onError?.(err);
260
- if (shouldLogVerbose()) logVerbose(`discord voice: opus decode failed: ${formatErrorMessage(err)}`);
261
- } finally {
262
- await selected.decoder.free?.();
233
+ if (!warnedOpusMissing) {
234
+ warnedOpusMissing = true;
235
+ params.onWarn(`discord voice: no usable opus decoder available (libopus-wasm: ${formatErrorMessage(err)}); cannot decode voice audio`);
236
+ }
237
+ return;
263
238
  }
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}`);
239
+ params.onVerbose("opus decoder: libopus-wasm");
270
240
  try {
271
241
  for await (const chunk of stream) {
272
242
  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));
243
+ const decoded = decoder.decode(chunk, { maxFrameSize: DISCORD_OPUS_FRAME_SIZE });
244
+ if (decoded.length > 0) params.onChunk(pcmInt16ToBuffer(decoded));
275
245
  }
276
246
  } catch (err) {
277
247
  params.onError?.(err);
278
248
  if (shouldLogVerbose()) logVerbose(`discord voice: opus decode failed: ${formatErrorMessage(err)}`);
279
249
  } finally {
280
- await selected.decoder.free?.();
250
+ decoder.free();
281
251
  }
282
252
  }
283
253
  function convertDiscordPcm48kStereoToRealtimePcm24kMono(pcm) {
@@ -314,11 +284,10 @@ async function writeVoiceWavFile(pcm) {
314
284
  rootDir: resolvePreferredOpenClawTmpDir(),
315
285
  prefix: "discord-voice-"
316
286
  });
317
- const wav = buildWavBuffer(pcm);
318
- const filePath = await workspace.write("segment.wav", wav);
319
287
  scheduleTempCleanup(workspace.dir);
288
+ const wav = buildWavBuffer(pcm);
320
289
  return {
321
- path: filePath,
290
+ path: await workspace.write("segment.wav", wav),
322
291
  durationSeconds: estimateDurationSeconds(pcm)
323
292
  };
324
293
  }
@@ -339,7 +308,6 @@ const CAPTURE_FINALIZE_GRACE_MS = 2e3;
339
308
  const VOICE_CONNECT_READY_TIMEOUT_MS = 3e4;
340
309
  const VOICE_RECONNECT_GRACE_MS = 15e3;
341
310
  const PLAYBACK_READY_TIMEOUT_MS = 6e4;
342
- const SPEAKING_READY_TIMEOUT_MS = 6e4;
343
311
  function resolveVoiceTimeoutMs(value, fallbackMs) {
344
312
  if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return fallbackMs;
345
313
  return Math.floor(value);
@@ -367,4 +335,4 @@ function loadDiscordVoiceSdk() {
367
335
  return cachedDiscordVoiceSdk;
368
336
  }
369
337
  //#endregion
370
- 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 };
338
+ export { decodeOpusStreamChunks as _, VOICE_CONNECT_READY_TIMEOUT_MS as a, maybeControlDiscordVoiceAgentRun as b, isVoiceChannel as c, resolveVoiceTimeoutMs as d, convertDiscordPcm48kStereoToRealtimePcm24kMono as f, decodeOpusStream as g, createDiscordOpusPlaybackStream as h, PLAYBACK_READY_TIMEOUT_MS as i, logVoiceVerbose as l, createDiscordOpusEncodeStream as m, CAPTURE_FINALIZE_GRACE_MS as n, VOICE_RECONNECT_GRACE_MS as o, convertRealtimePcm24kMonoToDiscordPcm48kStereo as p, MIN_SEGMENT_SECONDS as r, isDiscordRealtimeVoiceMode as s, loadDiscordVoiceSdk as t, resolveDiscordVoiceMode as u, writeVoiceWavFile as v, formatVoiceLogPreview as x, formatVoiceIngressPrompt as y };
@@ -1,6 +1,28 @@
1
+ import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
1
2
  import { collectNestedChannelFieldAssignments, collectSimpleChannelFieldAssignments, getChannelSurface, hasConfiguredSecretInputValue, isBaseFieldActiveForChannelSurface, isEnabledFlag, isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
2
3
  import { collectNestedChannelTtsAssignments } from "openclaw/plugin-sdk/channel-secret-tts-runtime";
3
4
  //#region extensions/discord/src/secret-config-contract.ts
5
+ function createVoiceProviderSecretTarget(params) {
6
+ const path = `${params.scope === "account" ? "channels.discord.accounts.*" : "channels.discord"}.voice.${params.capability}.providers.*.apiKey`;
7
+ return {
8
+ id: path,
9
+ targetType: path,
10
+ configFile: "openclaw.json",
11
+ pathPattern: path,
12
+ secretShape: "secret_input",
13
+ expectedResolvedValue: "string",
14
+ includeInPlan: true,
15
+ includeInConfigure: true,
16
+ includeInAudit: true,
17
+ providerIdPathSegmentIndex: params.scope === "account" ? 7 : 5
18
+ };
19
+ }
20
+ function discordRealtimeVoiceSecretOwnerId(accountId, providerId) {
21
+ return `discord:voice:realtime:${normalizeAccountId(accountId)}:${providerId}`;
22
+ }
23
+ function isRealtimeVoiceActive(value) {
24
+ return isRecord(value) && isEnabledFlag(value) && value.mode !== "stt-tts";
25
+ }
4
26
  const secretTargetRegistryEntries = [
5
27
  {
6
28
  id: "channels.discord.accounts.*.pluralkit.token",
@@ -24,18 +46,14 @@ const secretTargetRegistryEntries = [
24
46
  includeInConfigure: true,
25
47
  includeInAudit: true
26
48
  },
27
- {
28
- id: "channels.discord.accounts.*.voice.tts.providers.*.apiKey",
29
- targetType: "channels.discord.accounts.*.voice.tts.providers.*.apiKey",
30
- configFile: "openclaw.json",
31
- pathPattern: "channels.discord.accounts.*.voice.tts.providers.*.apiKey",
32
- secretShape: "secret_input",
33
- expectedResolvedValue: "string",
34
- includeInPlan: true,
35
- includeInConfigure: true,
36
- includeInAudit: true,
37
- providerIdPathSegmentIndex: 6
38
- },
49
+ createVoiceProviderSecretTarget({
50
+ capability: "realtime",
51
+ scope: "account"
52
+ }),
53
+ createVoiceProviderSecretTarget({
54
+ capability: "tts",
55
+ scope: "account"
56
+ }),
39
57
  {
40
58
  id: "channels.discord.pluralkit.token",
41
59
  targetType: "channels.discord.pluralkit.token",
@@ -58,18 +76,14 @@ const secretTargetRegistryEntries = [
58
76
  includeInConfigure: true,
59
77
  includeInAudit: true
60
78
  },
61
- {
62
- id: "channels.discord.voice.tts.providers.*.apiKey",
63
- targetType: "channels.discord.voice.tts.providers.*.apiKey",
64
- configFile: "openclaw.json",
65
- pathPattern: "channels.discord.voice.tts.providers.*.apiKey",
66
- secretShape: "secret_input",
67
- expectedResolvedValue: "string",
68
- includeInPlan: true,
69
- includeInConfigure: true,
70
- includeInAudit: true,
71
- providerIdPathSegmentIndex: 4
72
- }
79
+ createVoiceProviderSecretTarget({
80
+ capability: "realtime",
81
+ scope: "channel"
82
+ }),
83
+ createVoiceProviderSecretTarget({
84
+ capability: "tts",
85
+ scope: "channel"
86
+ })
73
87
  ];
74
88
  function collectRuntimeConfigAssignments(params) {
75
89
  const resolved = getChannelSurface(params.config, "discord");
@@ -116,6 +130,20 @@ function collectRuntimeConfigAssignments(params) {
116
130
  accountActive: ({ account, enabled }) => enabled && isRecord(account.voice) && isEnabledFlag(account.voice),
117
131
  accountInactiveReason: "Discord account is disabled or voice is disabled for this account."
118
132
  });
133
+ collectNestedChannelTtsAssignments({
134
+ channelKey: "discord",
135
+ nestedKey: "voice",
136
+ providerBlockKey: "realtime",
137
+ ownerId: ({ accountId, providerId }) => discordRealtimeVoiceSecretOwnerId(accountId, providerId),
138
+ channel: discord,
139
+ surface,
140
+ defaults: params.defaults,
141
+ context: params.context,
142
+ topLevelActive: isBaseFieldActiveForChannelSurface(surface, "voice") && isRealtimeVoiceActive(discord.voice),
143
+ topInactiveReason: "no enabled Discord surface uses this top-level realtime voice config, voice is disabled, or voice mode is stt-tts.",
144
+ accountActive: ({ account, enabled }) => enabled && isRealtimeVoiceActive(account.voice),
145
+ accountInactiveReason: "Discord account is disabled, voice is disabled, or voice mode is stt-tts for this account."
146
+ });
119
147
  }
120
148
  //#endregion
121
- export { secretTargetRegistryEntries as n, collectRuntimeConfigAssignments as t };
149
+ export { discordRealtimeVoiceSecretOwnerId as n, secretTargetRegistryEntries as r, collectRuntimeConfigAssignments as t };
@@ -1,2 +1,2 @@
1
- import { n as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-B1akrlyY.js";
1
+ import { r as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-B3i6WxV5.js";
2
2
  export { collectRuntimeConfigAssignments, secretTargetRegistryEntries };
@@ -1,7 +1,7 @@
1
1
  import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.js";
2
2
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
- import { coerceNativeSetting, normalizeAllowFromList } from "openclaw/plugin-sdk/channel-policy";
4
3
  import { readChannelAllowFromStore } from "openclaw/plugin-sdk/conversation-runtime";
4
+ import { coerceNativeSetting, normalizeAllowFromList } from "openclaw/plugin-sdk/channel-policy";
5
5
  import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
6
6
  import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
7
7
  //#region extensions/discord/src/security-audit.ts
@@ -32,12 +32,8 @@ function listBroadMemberTargetPaths(params) {
32
32
  }
33
33
  function addDiscordNameBasedEntries(params) {
34
34
  if (!Array.isArray(params.values)) return;
35
- for (const value of params.values) {
36
- if (!isDiscordMutableAllowEntry(String(value))) continue;
37
- const text = normalizeOptionalString(String(value)) ?? "";
38
- if (!text) continue;
39
- params.target.add(`${params.source}:${text}`);
40
- }
35
+ const entries = new Set(params.values.map((value) => String(value).trim()).filter(isDiscordMutableAllowEntry));
36
+ if (entries.size > 0) params.target.set(params.source, entries.size);
41
37
  }
42
38
  async function collectDiscordSecurityAuditFindings(params) {
43
39
  const findings = [];
@@ -45,7 +41,7 @@ async function collectDiscordSecurityAuditFindings(params) {
45
41
  const accountId = normalizeOptionalString(params.accountId) ?? params.account.accountId ?? "default";
46
42
  const dangerousNameMatchingEnabled = isDangerousNameMatchingEnabled(discordCfg);
47
43
  const storeAllowFrom = await readChannelAllowFromStore("discord", process.env, accountId).catch(() => []);
48
- const discordNameBasedAllowEntries = /* @__PURE__ */ new Set();
44
+ const discordNameBasedAllowEntries = /* @__PURE__ */ new Map();
49
45
  const discordPathPrefix = params.orderedAccountIds.length > 1 || params.hasExplicitAccountPath ? `channels.discord.accounts.${accountId}` : "channels.discord";
50
46
  if ((discordCfg.groupPolicy ?? params.cfg.channels?.defaults?.groupPolicy ?? "allowlist") === "allowlist") {
51
47
  const broadMemberPaths = listBroadMemberTargetPaths({
@@ -73,7 +69,7 @@ async function collectDiscordSecurityAuditFindings(params) {
73
69
  addDiscordNameBasedEntries({
74
70
  target: discordNameBasedAllowEntries,
75
71
  values: storeAllowFrom,
76
- source: "~/.openclaw/credentials/discord-allowFrom.json"
72
+ source: "Discord pairing store"
77
73
  });
78
74
  const guildEntries = discordCfg.guilds ?? {};
79
75
  for (const [guildKey, guildValue] of Object.entries(guildEntries)) {
@@ -96,13 +92,16 @@ async function collectDiscordSecurityAuditFindings(params) {
96
92
  }
97
93
  }
98
94
  if (discordNameBasedAllowEntries.size > 0) {
99
- const examples = Array.from(discordNameBasedAllowEntries).slice(0, 5);
100
- const more = discordNameBasedAllowEntries.size > examples.length ? ` (+${discordNameBasedAllowEntries.size - examples.length} more)` : "";
95
+ const counts = Array.from(discordNameBasedAllowEntries);
96
+ const entryCount = counts.reduce((total, [, count]) => total + count, 0);
97
+ const sources = counts.slice(0, 5).map(([source, count]) => `${source} (${count})`);
98
+ const more = counts.length > sources.length ? ` (+${counts.length - sources.length} more sources)` : "";
99
+ const summary = `Found ${entryCount} name/tag entries: ${sources.join(", ")}${more}.`;
101
100
  findings.push({
102
101
  checkId: "channels.discord.allowFrom.name_based_entries",
103
102
  severity: dangerousNameMatchingEnabled ? "info" : "warn",
104
103
  title: dangerousNameMatchingEnabled ? "Discord allowlist uses break-glass name/tag matching" : "Discord allowlist contains name or tag entries",
105
- detail: dangerousNameMatchingEnabled ? `Discord name/tag allowlist matching is explicitly enabled via dangerouslyAllowNameMatching. This mutable-identity mode is operator-selected break-glass behavior and out-of-scope for vulnerability reports by itself. Found: ${examples.join(", ")}${more}.` : `Discord name/tag allowlist matching uses normalized slugs and can collide across users. Found: ${examples.join(", ")}${more}.`,
104
+ detail: dangerousNameMatchingEnabled ? "Discord name/tag allowlist matching is explicitly enabled via dangerouslyAllowNameMatching. This mutable-identity mode is operator-selected break-glass behavior and out-of-scope for vulnerability reports by itself. " + summary : "Discord name/tag allowlist matching uses normalized slugs and can collide across users. " + summary,
106
105
  remediation: dangerousNameMatchingEnabled ? "Prefer stable Discord IDs (or <@id>/user:<id>/pk:<id>), then disable dangerouslyAllowNameMatching." : "Prefer stable Discord IDs (or <@id>/user:<id>/pk:<id>) in channels.discord.allowFrom and channels.discord.guilds.*.users, or explicitly opt in with dangerouslyAllowNameMatching=true if you accept the risk."
107
106
  });
108
107
  }
@@ -1,2 +1,2 @@
1
- import { t as collectDiscordSecurityAuditFindings } from "./security-audit-jGnJF__m.js";
1
+ import { t as collectDiscordSecurityAuditFindings } from "./security-audit-DKfK-iPY.js";
2
2
  export { collectDiscordSecurityAuditFindings };
@@ -1,2 +1,2 @@
1
- import { t as collectDiscordSecurityAuditFindings } from "./security-audit-jGnJF__m.js";
1
+ import { t as collectDiscordSecurityAuditFindings } from "./security-audit-DKfK-iPY.js";
2
2
  export { collectDiscordSecurityAuditFindings };
@@ -1,12 +1,8 @@
1
- import { $t as removeGuildMemberRole, At as listChannelPins, Bt as createGuildSticker, Ct as editChannel, Et as getChannelMessage, F as readDiscordMessage, Ft as addGuildMemberRole, Gt as listGuildActiveThreads, Ht as getGuild, I as readRetryAfter, It as createGuildBan, Jt as listGuildRoles, Kt as listGuildChannels, Lt as createGuildChannel, M as RateLimitError, Mt as searchGuildMessages, N as isUnknownDiscordVoiceStateError, Nt as sendChannelTyping, Ot as listChannelArchivedThreads, P as readDiscordCode, Pt as unpinChannelMessage, Qt as removeGuildMember, Rt as createGuildEmoji, St as deleteChannelMessage, Tt as getChannel, Ut as getGuildMember, Vt as deleteChannelPermission, Wt as getGuildVoiceState, Xt as moveGuildChannels, Yt as listGuildScheduledEvents, Zt as putChannelPermission, bt as createThread, en as timeoutGuildMember, i as recordDiscordMessageCreateAmbiguity, j as DiscordError, jt as pinChannelMessage, kt as listChannelMessages, n as createDiscordRetryRunner, qt as listGuildEmojis, t as classifyDiscordDeliveryFailure, tn as __exportAll, wt as editChannelMessage, xt as deleteChannel, zt as createGuildScheduledEvent } from "./retry-CLpJcXXf.js";
2
- import { s as resolveDiscordAccount } from "./accounts-DJTf1LtA.js";
1
+ import { $t as listGuildRoles, At as getChannel, B as readRetryAfter, Bt as addGuildMemberRole, Ct as listMessageReactionUsers, Dt as deleteChannelMessage, Et as deleteChannel, F as DiscordError, Ft as listChannelPins, Gt as createGuildSticker, Ht as createGuildChannel, I as RateLimitError, It as pinChannelMessage, Jt as getGuildMember, Kt as deleteChannelPermission, L as isUnknownDiscordVoiceStateError, Lt as searchGuildMessages, Nt as listChannelArchivedThreads, Ot as editChannel, Pt as listChannelMessages, Qt as listGuildEmojis, R as readDiscordCode, Rt as sendChannelTyping, St as deleteOwnMessageReaction, Tt as createThread, Ut as createGuildEmoji, Vt as createGuildBan, Wt as createGuildScheduledEvent, Xt as listGuildActiveThreads, Yt as getGuildVoiceState, Zt as listGuildChannels, an as timeoutGuildMember, c as createDiscordSendResult, en as listGuildScheduledEvents, i as recordDiscordMessageCreateAmbiguity, in as removeGuildMemberRole, jt as getChannelMessage, kt as editChannelMessage, n as createDiscordRetryRunner, nn as putChannelPermission, on as __exportAll, qt as getGuild, rn as removeGuildMember, t as classifyDiscordDeliveryFailure, tn as moveGuildChannels, xt as createOwnMessageReaction, z as readDiscordMessage, zt as unpinChannelMessage } from "./retry-DqHCW6PV.js";
3
2
  import { t as parseDiscordRetryAfterBodySeconds } from "./retry-after-DdLPmPoa.js";
4
- import { A as hasAllGuildPermissionsDiscord, C as DISCORD_MAX_STICKER_BYTES, D as canViewDiscordGuildChannel, E as canManageGuildRoleDiscord, L as resolveDiscordClientAccountContext, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, P as createDiscordClient, R as resolveDiscordRest, S as DISCORD_MAX_EVENT_COVER_BYTES, T as canManageGuildMemberRoleDiscord, W as parseAndResolveChannelRecipient, _ as resolveDiscordMessageFlags, b as resolveDiscordSuppressEmbeds, g as createDiscordMessageNonce, j as hasAnyChannelPermissionDiscord, k as fetchMemberGuildPermissionsDiscord, l as resolveChannelId, n as buildDiscordTextChunks, o as normalizeEmojiName, p as sendDiscordText, t as buildDiscordSendError, w as DiscordSendError, x as DISCORD_MAX_EMOJI_BYTES, z as DISCORD_REST_TIMEOUT_MS } from "./send.shared-BmwFjW6T.js";
5
- import { n as sendPollDiscord, o as rewriteDiscordKnownMentions, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DS5tHwfR.js";
6
- import { r as createDiscordSendResult } from "./send.receipt-IPI1p-SP.js";
3
+ import { C as hasAllGuildPermissionsDiscord, I as resolveDiscordClientAccountContext, K as parseAndResolveChannelRecipient, L as resolveDiscordRest, M as resolveDiscordSuppressEmbeds, N as createDiscordClient, O as createDiscordMessageNonce, R as DISCORD_REST_TIMEOUT_MS, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, _ as DiscordSendError, b as canViewDiscordGuildChannel, g as DISCORD_MAX_STICKER_BYTES, h as DISCORD_MAX_EVENT_COVER_BYTES, i as formatReactionEmoji, k as resolveDiscordMessageFlags, l as resolveChannelId, m as DISCORD_MAX_EMOJI_BYTES, n as buildDiscordTextChunks, o as normalizeEmojiName, p as sendDiscordText, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-DZJ1akvQ.js";
4
+ import { n as sendPollDiscord, o as rewriteDiscordKnownMentions, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-D7JYmfm9.js";
7
5
  import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-B9cy6RvQ.js";
8
- import { i as removeReactionDiscord, n as reactMessageDiscord, r as removeOwnReactionsDiscord, t as fetchReactionsDiscord } from "./send.reactions-BAn0iiVQ.js";
9
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
10
6
  import fs from "node:fs/promises";
11
7
  import { ChannelType } from "discord-api-types/v10";
12
8
  import crypto from "node:crypto";
@@ -15,9 +11,10 @@ import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
15
11
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
16
12
  import { readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
17
13
  import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
18
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
14
+ import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
19
15
  import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
20
16
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
17
+ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
21
18
  import { recordOutboundMessageIdentity } from "openclaw/plugin-sdk/channel-outbound";
22
19
  import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, buildOutboundMediaLoadOptions, extensionForMime, maxBytesForKind, parseFfprobeCodecAndSampleRate, runFfmpeg, runFfprobe, unlinkIfExists } from "openclaw/plugin-sdk/media-runtime";
23
20
  import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
@@ -534,8 +531,8 @@ async function runFfmpegToOutput(params) {
534
531
  }
535
532
  });
536
533
  }
537
- function createRateLimitError(response, body, request) {
538
- return new RateLimitError(response, body, request ?? new Request("https://discord.com/api/v10/channels/voice/messages", { method: "POST" }));
534
+ function createRateLimitError(response, body) {
535
+ return new RateLimitError(response, body);
539
536
  }
540
537
  /**
541
538
  * Get audio duration using ffprobe
@@ -763,7 +760,7 @@ async function uploadVoiceAttachment(params) {
763
760
  * 2. Upload the OGG file to the provided URL
764
761
  * 3. Send the message with flag 8192 and attachment metadata
765
762
  */
766
- async function sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, replyTo, request, silent, token) {
763
+ async function sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, replyTo, request, silent, token, onPlatformSendDispatch) {
767
764
  const filename = "voice-message.ogg";
768
765
  const fileSize = audioBuffer.byteLength;
769
766
  const botToken = token;
@@ -803,6 +800,7 @@ async function sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, r
803
800
  let messageCreateMayHaveCommitted = false;
804
801
  try {
805
802
  return await request(async () => {
803
+ await onPlatformSendDispatch?.();
806
804
  try {
807
805
  return await rest.post(`/channels/${channelId}/messages`, { body: messagePayload });
808
806
  } catch (error) {
@@ -859,10 +857,6 @@ async function sendVoiceMessageDiscord(to, audioPath, opts) {
859
857
  let rest;
860
858
  let channelId;
861
859
  try {
862
- const accountInfo = resolveDiscordAccount({
863
- cfg,
864
- accountId: opts.accountId
865
- });
866
860
  const client = createDiscordClient({
867
861
  ...opts,
868
862
  cfg
@@ -870,15 +864,15 @@ async function sendVoiceMessageDiscord(to, audioPath, opts) {
870
864
  token = client.token;
871
865
  rest = client.rest;
872
866
  const request = client.request;
873
- const recipient = await parseAndResolveChannelRecipient(to, cfg, opts.accountId);
867
+ const accountInfo = client.account;
868
+ const recipient = await parseAndResolveChannelRecipient(to, cfg, accountInfo.accountId);
874
869
  channelId = (await resolveChannelId(rest, recipient, request)).channelId;
875
870
  const ogg = await ensureOggOpus(localInputPath);
876
871
  oggPath = ogg.path;
877
872
  oggCleanup = ogg.cleanup;
878
873
  const metadata = await getVoiceMessageMetadata(oggPath);
879
874
  const audioBuffer = await fs.readFile(oggPath);
880
- await opts.onPlatformSendDispatch?.();
881
- const result = await sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, opts.reply?.messageId, request, opts.silent, token);
875
+ const result = await sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, opts.reply?.messageId, request, opts.silent, token, opts.onPlatformSendDispatch);
882
876
  recordChannelActivity({
883
877
  channel: "discord",
884
878
  accountId: accountInfo.accountId,
@@ -909,6 +903,75 @@ async function sendTypingDiscord(channelId, opts) {
909
903
  };
910
904
  }
911
905
  //#endregion
906
+ //#region extensions/discord/src/send.reactions.ts
907
+ function resolveDiscordReactionClient(opts) {
908
+ if (opts.rest && opts.cfg && opts.accountId) return createDiscordClient(opts);
909
+ 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.");
910
+ const cfg = requireRuntimeConfig(opts.cfg, "Discord reactions");
911
+ return createDiscordClient({
912
+ ...opts,
913
+ cfg
914
+ });
915
+ }
916
+ async function reactMessageDiscord(channelId, messageId, emoji, opts) {
917
+ const { rest, request } = resolveDiscordReactionClient(opts);
918
+ const encoded = normalizeReactionEmoji(emoji);
919
+ await request(() => createOwnMessageReaction(rest, channelId, messageId, encoded), "react");
920
+ return { ok: true };
921
+ }
922
+ async function removeReactionDiscord(channelId, messageId, emoji, opts) {
923
+ const { rest, request } = resolveDiscordReactionClient(opts);
924
+ const encoded = normalizeReactionEmoji(emoji);
925
+ await request(() => deleteOwnMessageReaction(rest, channelId, messageId, encoded), "reaction-remove");
926
+ return { ok: true };
927
+ }
928
+ async function removeOwnReactionsDiscord(channelId, messageId, opts) {
929
+ const { rest, request } = resolveDiscordReactionClient(opts);
930
+ const message = await request(() => getChannelMessage(rest, channelId, messageId), "reaction-list");
931
+ const identifiers = /* @__PURE__ */ new Set();
932
+ for (const reaction of message.reactions ?? []) {
933
+ const identifier = reaction.me ? buildReactionIdentifier(reaction.emoji) : void 0;
934
+ if (identifier) identifiers.add(identifier);
935
+ }
936
+ if (identifiers.size === 0) return {
937
+ ok: true,
938
+ removed: []
939
+ };
940
+ const removed = Array.from(identifiers);
941
+ await Promise.all(removed.map((identifier) => request(() => deleteOwnMessageReaction(rest, channelId, messageId, normalizeReactionEmoji(identifier)), "reaction-remove")));
942
+ return {
943
+ ok: true,
944
+ removed
945
+ };
946
+ }
947
+ async function fetchReactionsDiscord(channelId, messageId, opts) {
948
+ const { rest, request } = resolveDiscordReactionClient(opts);
949
+ const reactions = (await request(() => getChannelMessage(rest, channelId, messageId), "reaction-list")).reactions ?? [];
950
+ if (reactions.length === 0) return [];
951
+ const limit = typeof opts.limit === "number" && Number.isFinite(opts.limit) ? Math.min(Math.max(Math.floor(opts.limit), 1), 100) : 100;
952
+ const summaries = [];
953
+ for (const reaction of reactions) {
954
+ const identifier = buildReactionIdentifier(reaction.emoji);
955
+ if (!identifier) continue;
956
+ const encoded = encodeURIComponent(identifier);
957
+ const users = await request(() => listMessageReactionUsers(rest, channelId, messageId, encoded, { limit }), "reaction-users");
958
+ summaries.push({
959
+ emoji: {
960
+ id: reaction.emoji.id ?? null,
961
+ name: reaction.emoji.name ?? null,
962
+ raw: formatReactionEmoji(reaction.emoji)
963
+ },
964
+ count: reaction.count,
965
+ users: users.map((user) => ({
966
+ id: user.id,
967
+ username: user.username,
968
+ tag: user.username && user.discriminator ? `${user.username}#${user.discriminator}` : user.username
969
+ }))
970
+ });
971
+ }
972
+ return summaries;
973
+ }
974
+ //#endregion
912
975
  //#region extensions/discord/src/send.ts
913
976
  var send_exports = /* @__PURE__ */ __exportAll({
914
977
  DiscordSendError: () => DiscordSendError,
@@ -966,4 +1029,4 @@ var send_exports = /* @__PURE__ */ __exportAll({
966
1029
  uploadStickerDiscord: () => uploadStickerDiscord
967
1030
  });
968
1031
  //#endregion
969
- export { listGuildEmojisDiscord as A, fetchVoiceStatusDiscord as C, removeRoleDiscord as D, listScheduledEventsDiscord as E, editChannelDiscord as F, moveChannelDiscord as I, removeChannelPermissionDiscord as L, uploadStickerDiscord as M, createChannelDiscord as N, resolveEventCoverImage as O, deleteChannelDiscord as P, setChannelPermissionDiscord as R, fetchRoleInfoDiscord as S, listGuildChannelsDiscord as T, banMemberDiscord as _, DiscordThreadInitialMessageError as a, fetchGuildInfoDiscord as b, editMessageDiscord as c, listThreadsDiscord as d, pinMessageDiscord as f, addRoleDiscord as g, unpinMessageDiscord as h, sendWebhookMessageDiscord as i, uploadEmojiDiscord as j, timeoutMemberDiscord as k, fetchMessageDiscord as l, searchMessagesDiscord as m, sendTypingDiscord as n, createThreadDiscord as o, readMessagesDiscord as p, sendVoiceMessageDiscord as r, deleteMessageDiscord as s, send_exports as t, listPinsDiscord as u, createScheduledEventDiscord as v, kickMemberDiscord as w, fetchMemberInfoDiscord as x, fetchChannelInfoDiscord as y };
1032
+ export { listScheduledEventsDiscord as A, moveChannelDiscord as B, fetchChannelInfoDiscord as C, fetchVoiceStatusDiscord as D, fetchRoleInfoDiscord as E, uploadEmojiDiscord as F, setChannelPermissionDiscord as H, uploadStickerDiscord as I, createChannelDiscord as L, resolveEventCoverImage as M, timeoutMemberDiscord as N, kickMemberDiscord as O, listGuildEmojisDiscord as P, deleteChannelDiscord as R, createScheduledEventDiscord as S, fetchMemberInfoDiscord as T, removeChannelPermissionDiscord as V, readMessagesDiscord as _, removeReactionDiscord as a, addRoleDiscord as b, sendWebhookMessageDiscord as c, deleteMessageDiscord as d, editMessageDiscord as f, pinMessageDiscord as g, listThreadsDiscord as h, removeOwnReactionsDiscord as i, removeRoleDiscord as j, listGuildChannelsDiscord as k, DiscordThreadInitialMessageError as l, listPinsDiscord as m, fetchReactionsDiscord as n, sendTypingDiscord as o, fetchMessageDiscord as p, reactMessageDiscord as r, sendVoiceMessageDiscord as s, send_exports as t, createThreadDiscord as u, searchMessagesDiscord as v, fetchGuildInfoDiscord as w, banMemberDiscord as x, unpinMessageDiscord as y, editChannelDiscord as z };