@openclaw/discord 2026.10.2 → 2026.10.5-beta.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 (246) hide show
  1. package/dist/.setup/account-inspect-8cCu6uPG.mjs +31 -0
  2. package/dist/.setup/{accounts-HE9-mj1L.mjs → accounts-ljrzXBJi.mjs} +47 -45
  3. package/dist/.setup/{allow-list-vxkG9_JD.mjs → allow-list-B_ToXtew.mjs} +34 -101
  4. package/dist/.setup/{api-DlNUkDqj.mjs → api-CtmE1OUN.mjs} +25 -31
  5. package/dist/.setup/{approval-handler.runtime-DmnEa54W.mjs → approval-handler.runtime-D7FoZSn0.mjs} +30 -53
  6. package/dist/.setup/{approval-message-updates-B0jdSqOj.mjs → approval-message-updates-CIGByUcE.mjs} +2 -2
  7. package/dist/.setup/{audit-BpikUwN_.mjs → audit-zSawfbsN.mjs} +5 -8
  8. package/dist/.setup/{channel-Dr-AUnGt.mjs → channel-DI7DMzu0.mjs} +136 -215
  9. package/dist/.setup/{channel-access-BRp3Y-rF.mjs → channel-access-DasWY_OV.mjs} +6 -7
  10. package/dist/.setup/{channel.setup-BmNvkidb.mjs → channel.setup-DdFVN1mr.mjs} +35 -64
  11. package/dist/.setup/{components-DLJR0xU-.mjs → components-HN9052L1.mjs} +123 -146
  12. package/dist/.setup/{config-schema-BQWfnSCx.mjs → config-schema-_uBILpQf.mjs} +7 -3
  13. package/dist/.setup/{conversation-binding-route-DicJC1Lj.mjs → conversation-binding-route-DTjCBx-O.mjs} +1 -1
  14. package/dist/.setup/{directory-config-gqsdcplU.mjs → directory-config-3iVub-3m.mjs} +1 -1
  15. package/dist/.setup/{directory-live-Bipr0eUJ.mjs → directory-live-DLygQVtW.mjs} +18 -22
  16. package/dist/.setup/{discord-9gysrhzp.mjs → discord-BGqgx-yd.mjs} +686 -854
  17. package/dist/.setup/{doctor-B2bskDcF.mjs → doctor-DSrNJ7m2.mjs} +36 -47
  18. package/dist/.setup/{doctor-contract-Bg3NPAMw.mjs → doctor-contract-Bwv8EuQ_.mjs} +7 -16
  19. package/dist/.setup/{handle-action-UmkjXBfo.mjs → handle-action-CXH1h1tq.mjs} +25 -38
  20. package/dist/.setup/{handle-action.guild-admin-CB4sc9VV.mjs → handle-action.guild-admin-CHKW6PIs.mjs} +25 -31
  21. package/dist/.setup/{live-policy-config-VxexfRKo.mjs → live-policy-config-BPoB3eQi.mjs} +1 -1
  22. package/dist/.setup/{message-handler-BK69A-NB.mjs → message-handler-Ii_etru1.mjs} +9 -14
  23. package/dist/.setup/{message-handler.preflight-DFpsh90H.mjs → message-handler.preflight-C7YuSRl_.mjs} +79 -128
  24. package/dist/.setup/{message-handler.preflight-pluralkit-BXGGVmpe.mjs → message-handler.preflight-pluralkit-C3iAG--b.mjs} +6 -6
  25. package/dist/.setup/{message-handler.process-TKoqcqIP.mjs → message-handler.process-ClgWYH6o.mjs} +234 -206
  26. package/dist/.setup/{outbound-adapter-D4wRAb5S.mjs → outbound-adapter-D8OOIuKn.mjs} +73 -112
  27. package/dist/.setup/{outbound-session-route-BvBH4LC6.mjs → outbound-session-route-B0Hpwn3Q.mjs} +57 -115
  28. package/dist/.setup/output-activity-uBpMSX75.mjs +11 -0
  29. package/dist/.setup/{pluralkit-a6_NLfH9.mjs → pluralkit-B64dfq_j.mjs} +3 -1
  30. package/dist/.setup/{preflight-audio-DHGIHEpv.mjs → preflight-audio-wWgsZG5F.mjs} +1 -5
  31. package/dist/.setup/{presence-cache-Dg3_dADn.mjs → presence-cache-DCeTsL73.mjs} +3 -6
  32. package/dist/.setup/{probe-BwSKpnZf.mjs → probe-D3P1x4aN.mjs} +10 -18
  33. package/dist/.setup/{provider-YP8gN9_o.mjs → provider-D9EzOfG8.mjs} +2990 -3903
  34. package/dist/.setup/{provider-session.runtime-D1gkPxHT.mjs → provider-session.runtime-CsnRvddI.mjs} +5 -5
  35. package/dist/.setup/provider.runtime-BQVcM7Pg.mjs +2 -0
  36. package/dist/.setup/{realtime-session.runtime-BKUQBy1u.mjs → realtime-session.runtime-CxGBk8H-.mjs} +69 -98
  37. package/dist/.setup/{receive-recovery-DgkX7Qvi.mjs → receive-recovery-eVmK2_hl.mjs} +2 -12
  38. package/dist/.setup/resolve-allowlist-common-DNSsUQRF.mjs +66 -0
  39. package/dist/.setup/resolve-channels-UdT38DzU.mjs +173 -0
  40. package/dist/.setup/{resolve-users-DNrwvunm.mjs → resolve-users-DnCsrXZ_.mjs} +12 -41
  41. package/dist/.setup/{runtime-CESTexGn.mjs → runtime-CRTkKU1G.mjs} +202 -313
  42. package/dist/.setup/{runtime-DPcmPST9.mjs → runtime-DPm3gZXk.mjs} +2 -2
  43. package/dist/.setup/{secret-config-contract-uOE2J7yM.mjs → secret-config-contract-CIsH7R3B.mjs} +9 -18
  44. package/dist/.setup/{security-audit-D42cp5N7.mjs → security-audit-BFT84Uny.mjs} +1 -2
  45. package/dist/.setup/security-contract-DNyyjTZZ.mjs +19 -0
  46. package/dist/.setup/{send-CJk3VP5q.mjs → send-DbILKgcm.mjs} +184 -241
  47. package/dist/.setup/{send.components-dPljuV24.mjs → send.components-FxOS3CeP.mjs} +47 -63
  48. package/dist/.setup/{send.outbound-rOboMO_6.mjs → send.outbound-_jx4Xpd3.mjs} +178 -202
  49. package/dist/.setup/{send.receipt-DVOg2Oaw.mjs → send.receipt-BAlzXd8e.mjs} +33 -109
  50. package/dist/.setup/{send.shared-C4CN24D9.mjs → send.shared-CjQ4jbMA.mjs} +97 -153
  51. package/dist/.setup/{sender-identity-AHpUNr72.mjs → sender-identity-BNBvGt1l.mjs} +1 -1
  52. package/dist/.setup/setup-plugin-api-xfOFmxHP.mjs +3 -0
  53. package/dist/.setup/{shared-BoBnM5kM.mjs → shared-CestGDpq.mjs} +30 -20
  54. package/dist/.setup/{subagent-hooks-HH8Uy9cx.mjs → subagent-hooks-CME7dSGf.mjs} +5 -10
  55. package/dist/.setup/{system-events-Cwxaww8i.mjs → system-events-BwwSDCw4.mjs} +2 -2
  56. package/dist/.setup/target-parsing-C-HyNxcE.mjs +48 -0
  57. package/dist/.setup/{target-resolver-CSFoPQ12.mjs → target-resolver-Bse8fuTi.mjs} +11 -27
  58. package/dist/.setup/targets-DZJjkzwv.mjs +3 -0
  59. package/dist/.setup/{thread-bindings-DjQCkmsd.mjs → thread-bindings-0hPTSK14.mjs} +61 -52
  60. package/dist/.setup/{thread-bindings.manager-D2-GYZ5s.mjs → thread-bindings.manager-CdNa6UIs.mjs} +138 -211
  61. package/dist/.setup/{thread-bindings.session-updates-Bu_CGr_O.mjs → thread-bindings.session-updates-DGSljVf6.mjs} +60 -99
  62. package/dist/.setup/threading-BKe3E3tp.mjs +246 -0
  63. package/dist/.setup/{timeouts-pun7VJ02.mjs → timeouts-CuNARfyw.mjs} +10 -18
  64. package/dist/.setup/{transcripts-source-CaZQnGRH.mjs → transcripts-source-0qQYVu2H.mjs} +50 -368
  65. package/dist/.setup/{voice-runtime-DDymtIw8.mjs → voice-runtime-QlZJ4sHv.mjs} +166 -322
  66. package/dist/account-inspect-api.js +1 -1
  67. package/dist/action-runtime-api.js +1 -1
  68. package/dist/activities-api.js +77 -120
  69. package/dist/api.js +19 -18
  70. package/dist/channel-config-api.js +1 -1
  71. package/dist/channel-plugin-api.js +1 -1
  72. package/dist/directory-contract-api.js +1 -1
  73. package/dist/doctor-contract-api.js +1 -1
  74. package/dist/runtime-api.js +21 -20
  75. package/dist/secret-contract-api.js +1 -1
  76. package/dist/security-audit-contract-api.js +1 -1
  77. package/dist/security-contract-api.js +1 -1
  78. package/dist/setup-entry.js +1 -1
  79. package/dist/setup-plugin-api.js +1 -1
  80. package/dist/src/voice/audio-worker.runtime.js +38 -57
  81. package/dist/subagent-hooks-api.js +1 -1
  82. package/dist/transcripts-source-api.js +1 -1
  83. package/node_modules/@types/node/README.md +1 -1
  84. package/node_modules/@types/node/crypto.d.ts +2 -2
  85. package/node_modules/@types/node/dgram.d.ts +1 -1
  86. package/node_modules/@types/node/package.json +2 -2
  87. package/node_modules/@types/node/zlib.d.ts +6 -0
  88. package/node_modules/@types/ws/README.md +1 -1
  89. package/node_modules/@types/ws/index.d.mts +4 -0
  90. package/node_modules/@types/ws/index.d.ts +4 -0
  91. package/node_modules/@types/ws/package.json +3 -3
  92. package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts +21 -0
  93. package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts.map +1 -1
  94. package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts +21 -0
  95. package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts.map +1 -1
  96. package/node_modules/discord-api-types/globals.d.ts +6 -0
  97. package/node_modules/discord-api-types/globals.d.ts.map +1 -1
  98. package/node_modules/discord-api-types/globals.js +6 -0
  99. package/node_modules/discord-api-types/globals.js.map +1 -1
  100. package/node_modules/discord-api-types/package.json +3 -3
  101. package/node_modules/discord-api-types/payloads/index.mjs +1 -0
  102. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts +207 -0
  103. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts.map +1 -0
  104. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js +25 -0
  105. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js.map +1 -0
  106. package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts +1 -1
  107. package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts.map +1 -1
  108. package/node_modules/discord-api-types/payloads/v10/guild.d.ts +27 -23
  109. package/node_modules/discord-api-types/payloads/v10/guild.d.ts.map +1 -1
  110. package/node_modules/discord-api-types/payloads/v10/guild.js +26 -22
  111. package/node_modules/discord-api-types/payloads/v10/guild.js.map +1 -1
  112. package/node_modules/discord-api-types/payloads/v10/index.d.ts +1 -0
  113. package/node_modules/discord-api-types/payloads/v10/index.d.ts.map +1 -1
  114. package/node_modules/discord-api-types/payloads/v10/index.js +1 -0
  115. package/node_modules/discord-api-types/payloads/v10/index.js.map +1 -1
  116. package/node_modules/discord-api-types/payloads/v10/index.mjs +1 -0
  117. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts +207 -0
  118. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts.map +1 -0
  119. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js +25 -0
  120. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js.map +1 -0
  121. package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts +1 -1
  122. package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts.map +1 -1
  123. package/node_modules/discord-api-types/payloads/v9/guild.d.ts +27 -23
  124. package/node_modules/discord-api-types/payloads/v9/guild.d.ts.map +1 -1
  125. package/node_modules/discord-api-types/payloads/v9/guild.js +26 -22
  126. package/node_modules/discord-api-types/payloads/v9/guild.js.map +1 -1
  127. package/node_modules/discord-api-types/payloads/v9/index.d.ts +1 -0
  128. package/node_modules/discord-api-types/payloads/v9/index.d.ts.map +1 -1
  129. package/node_modules/discord-api-types/payloads/v9/index.js +1 -0
  130. package/node_modules/discord-api-types/payloads/v9/index.js.map +1 -1
  131. package/node_modules/discord-api-types/payloads/v9/index.mjs +1 -0
  132. package/node_modules/discord-api-types/rest/common.d.ts +2 -0
  133. package/node_modules/discord-api-types/rest/common.d.ts.map +1 -1
  134. package/node_modules/discord-api-types/rest/common.js +2 -0
  135. package/node_modules/discord-api-types/rest/common.js.map +1 -1
  136. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts +70 -0
  137. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts.map +1 -0
  138. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js +3 -0
  139. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js.map +1 -0
  140. package/node_modules/discord-api-types/rest/v10/index.d.ts +1 -0
  141. package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
  142. package/node_modules/discord-api-types/rest/v10/index.js +29 -0
  143. package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
  144. package/node_modules/discord-api-types/rest/v10/interactions.d.ts +4 -2
  145. package/node_modules/discord-api-types/rest/v10/interactions.d.ts.map +1 -1
  146. package/node_modules/discord-api-types/rest/v10/user.d.ts +2 -2
  147. package/node_modules/discord-api-types/rest/v10/user.d.ts.map +1 -1
  148. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts +70 -0
  149. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts.map +1 -0
  150. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js +3 -0
  151. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js.map +1 -0
  152. package/node_modules/discord-api-types/rest/v9/index.d.ts +1 -0
  153. package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
  154. package/node_modules/discord-api-types/rest/v9/index.js +29 -0
  155. package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
  156. package/node_modules/discord-api-types/rest/v9/interactions.d.ts +4 -2
  157. package/node_modules/discord-api-types/rest/v9/interactions.d.ts.map +1 -1
  158. package/node_modules/discord-api-types/rest/v9/user.d.ts +2 -2
  159. package/node_modules/discord-api-types/rest/v9/user.d.ts.map +1 -1
  160. package/node_modules/discord-api-types/v10.mjs +1 -0
  161. package/node_modules/discord-api-types/v9.mjs +1 -0
  162. package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -1
  163. package/node_modules/micromark/dev/lib/compile.js +14 -4
  164. package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -1
  165. package/node_modules/micromark/dev/lib/create-tokenizer.js +7 -6
  166. package/node_modules/micromark/dev/lib/initialize/document.js +25 -21
  167. package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -1
  168. package/node_modules/micromark/dev/lib/initialize/text.js +10 -6
  169. package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -1
  170. package/node_modules/micromark/dev/lib/preprocess.js +19 -21
  171. package/node_modules/micromark/lib/compile.d.ts.map +1 -1
  172. package/node_modules/micromark/lib/compile.js +37 -29
  173. package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -1
  174. package/node_modules/micromark/lib/create-tokenizer.js +37 -35
  175. package/node_modules/micromark/lib/initialize/document.js +21 -13
  176. package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -1
  177. package/node_modules/micromark/lib/initialize/text.js +7 -3
  178. package/node_modules/micromark/lib/preprocess.d.ts.map +1 -1
  179. package/node_modules/micromark/lib/preprocess.js +16 -19
  180. package/node_modules/micromark/package.json +2 -15
  181. package/node_modules/micromark-core-commonmark/dev/lib/attention.js +18 -24
  182. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -1
  183. package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +1 -43
  184. package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +19 -43
  185. package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +2 -6
  186. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -1
  187. package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +2 -53
  188. package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +14 -12
  189. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -1
  190. package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +14 -5
  191. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -1
  192. package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +14 -5
  193. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
  194. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
  195. package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
  196. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -1
  197. package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +8 -5
  198. package/node_modules/micromark-core-commonmark/lib/attention.js +14 -24
  199. package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -1
  200. package/node_modules/micromark-core-commonmark/lib/code-fenced.js +1 -39
  201. package/node_modules/micromark-core-commonmark/lib/code-indented.js +11 -29
  202. package/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -6
  203. package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -1
  204. package/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -51
  205. package/node_modules/micromark-core-commonmark/lib/label-end.js +11 -10
  206. package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -1
  207. package/node_modules/micromark-core-commonmark/lib/label-start-image.js +11 -3
  208. package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -1
  209. package/node_modules/micromark-core-commonmark/lib/label-start-link.js +11 -3
  210. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
  211. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
  212. package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
  213. package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -1
  214. package/node_modules/micromark-core-commonmark/lib/setext-underline.js +7 -5
  215. package/node_modules/micromark-core-commonmark/package.json +4 -16
  216. package/node_modules/micromark-factory-space/dev/index.d.ts +24 -1
  217. package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -1
  218. package/node_modules/micromark-factory-space/dev/index.js +58 -3
  219. package/node_modules/micromark-factory-space/index.d.ts +24 -1
  220. package/node_modules/micromark-factory-space/index.d.ts.map +1 -1
  221. package/node_modules/micromark-factory-space/index.js +55 -3
  222. package/node_modules/micromark-factory-space/package.json +1 -10
  223. package/node_modules/micromark-factory-space/readme.md +25 -25
  224. package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
  225. package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
  226. package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
  227. package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
  228. package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
  229. package/node_modules/micromark-util-edit-map/index.js +225 -0
  230. package/node_modules/micromark-util-edit-map/license +22 -0
  231. package/node_modules/micromark-util-edit-map/package.json +48 -0
  232. package/node_modules/micromark-util-edit-map/readme.md +234 -0
  233. package/node_modules/micromark-util-types/index.d.ts +6 -3
  234. package/node_modules/micromark-util-types/package.json +2 -36
  235. package/node_modules/ws/lib/websocket.js +17 -3
  236. package/node_modules/ws/package.json +1 -1
  237. package/openclaw.plugin.json +3 -6
  238. package/package.json +7 -12
  239. package/dist/.setup/account-inspect-DsER5ILV.mjs +0 -45
  240. package/dist/.setup/provider.runtime-CZ51OIgD.mjs +0 -2
  241. package/dist/.setup/resolve-allowlist-common-BUyU3C-T.mjs +0 -27
  242. package/dist/.setup/resolve-channels-DA6QlhZN.mjs +0 -246
  243. package/dist/.setup/security-contract-DSHk7I2w.mjs +0 -26
  244. package/dist/.setup/setup-plugin-api-BVlCz3fm.mjs +0 -3
  245. package/dist/.setup/targets-bqXQENmX.mjs +0 -3
  246. package/dist/control-ui/2afbdab1d3aa65a789d8a3eba666f4b1ec5df07073538fe30d6cf32093a1fb2d/index.js +0 -1
@@ -1,9 +1,10 @@
1
- import { t as createDiscordActionGate } from "./accounts-HE9-mj1L.mjs";
2
- import { b as chunkDiscordTextWithMode, d as normalizeDiscordMessagingTarget, f as normalizeDiscordOutboundTarget, h as canFallbackDiscordWebhookSend, i as toDiscordOutboundDeliveryResult, n as createDiscordSendReceiptFromResults, p as parseDiscordTarget, s as resolveDiscordReplyReference, t as createDiscordSendReceipt, v as hasDiscordMessageCreateAmbiguity } from "./send.receipt-DVOg2Oaw.mjs";
3
- import { a as resolveDiscordComponentSpec, b as discordInboundEventDelivery, c as formatDiscordApprovalDisplayValue, g as resolveDiscordCurrentConversationIdentity, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, x as notifyDiscordInboundEventOutboundPayloadSuccess } from "./outbound-session-route-BvBH4LC6.mjs";
1
+ import { t as createDiscordActionGate } from "./accounts-ljrzXBJi.mjs";
2
+ import { d as normalizeDiscordMessagingTarget, f as normalizeDiscordOutboundTarget, g as hasDiscordMessageCreateAmbiguity, i as toDiscordOutboundDeliveryResult, n as createDiscordSendReceiptFromResults, p as canFallbackDiscordWebhookSend, s as resolveDiscordReplyReference, t as createDiscordSendReceipt, v as chunkDiscordTextWithMode } from "./send.receipt-BAlzXd8e.mjs";
3
+ import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
4
+ import { a as resolveDiscordComponentSpec, b as discordInboundEventDelivery, c as formatDiscordApprovalDisplayValue, g as resolveDiscordCurrentConversationIdentity, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, x as notifyDiscordInboundEventOutboundPayloadSuccess } from "./outbound-session-route-B0Hpwn3Q.mjs";
4
5
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
5
6
  import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
6
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
7
+ import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
7
8
  import { getReplyPayloadTtsSupplement, resolvePayloadMediaUrls, sendPayloadMediaSequenceOrFallback, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
8
9
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
9
10
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
@@ -54,9 +55,7 @@ function resolveDiscordConversationIdFromTargets(targets) {
54
55
  }
55
56
  }
56
57
  function parseDiscordParentChannelFromSessionKey(raw) {
57
- const sessionKey = normalizeLowercaseStringOrEmpty(raw);
58
- if (!sessionKey) return;
59
- const match = sessionKey.match(/(?:^|:)channel:([^:]+)$/);
58
+ const match = normalizeLowercaseStringOrEmpty(raw).match(/(?:^|:)channel:([^:]+)$/);
60
59
  return match?.[1] ? `channel:${match[1]}` : void 0;
61
60
  }
62
61
  function resolveDiscordCommandConversation(params) {
@@ -111,46 +110,34 @@ const DISCORD_VIDEO_MEDIA_EXTENSIONS = [
111
110
  ".mp4",
112
111
  ".webm"
113
112
  ];
114
- function normalizeMediaPathForExtension(mediaUrl) {
113
+ function isLikelyDiscordVideoMedia(mediaUrl) {
115
114
  const trimmed = mediaUrl.trim();
116
- if (!trimmed) return "";
115
+ if (!trimmed) return false;
116
+ let path;
117
117
  try {
118
- const parsed = new URL(trimmed);
119
- const fileName = parsed.pathname.slice(parsed.pathname.lastIndexOf("/") + 1);
118
+ const { pathname } = new URL(trimmed);
119
+ path = pathname.slice(pathname.lastIndexOf("/") + 1);
120
120
  try {
121
- return normalizeLowercaseStringOrEmpty(decodeURIComponent(fileName));
122
- } catch {
123
- return normalizeLowercaseStringOrEmpty(fileName);
124
- }
121
+ path = decodeURIComponent(path);
122
+ } catch {}
125
123
  } catch {
126
- const withoutHash = trimmed.split("#", 1)[0] ?? trimmed;
127
- const withoutQuery = withoutHash.split("?", 1)[0] ?? withoutHash;
128
- return normalizeLowercaseStringOrEmpty(withoutQuery);
124
+ path = trimmed.split(/[?#]/, 1)[0] ?? trimmed;
129
125
  }
130
- }
131
- function isLikelyDiscordVideoMedia(mediaUrl) {
132
- const normalized = normalizeMediaPathForExtension(mediaUrl);
126
+ const normalized = normalizeLowercaseStringOrEmpty(path);
133
127
  return DISCORD_VIDEO_MEDIA_EXTENSIONS.some((ext) => normalized.endsWith(ext));
134
128
  }
135
129
  //#endregion
136
130
  //#region extensions/discord/src/outbound-approval.ts
137
- function hasApprovalChannelData(payload) {
138
- const channelData = payload.channelData;
139
- if (!channelData || typeof channelData !== "object" || Array.isArray(channelData)) return false;
140
- return Boolean(channelData.execApproval);
141
- }
142
- function neutralizeDiscordApprovalMentions(value) {
143
- return value.replace(/@everyone/gi, "@​everyone").replace(/@here/gi, "@​here").replace(/<@/g, "<@​").replace(/<#/g, "<#​");
144
- }
145
131
  function normalizeDiscordApprovalPayload(payload) {
146
- return hasApprovalChannelData(payload) && payload.text ? {
132
+ if (!asOptionalRecord(payload.channelData)?.execApproval || !payload.text) return payload;
133
+ return {
147
134
  ...payload,
148
- text: neutralizeDiscordApprovalMentions(payload.text)
149
- } : payload;
135
+ text: payload.text.replace(/@everyone/gi, "@​everyone").replace(/@here/gi, "@​here").replace(/<@/g, "<@​").replace(/<#/g, "<#​")
136
+ };
150
137
  }
151
138
  //#endregion
152
139
  //#region extensions/discord/src/outbound-send-context.ts
153
- const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-CJk3VP5q.mjs").then((n) => n.t));
140
+ const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-DbILKgcm.mjs").then((n) => n.t));
154
141
  function resolveDiscordFormattingOptions(ctx) {
155
142
  const formatting = ctx.formatting;
156
143
  return {
@@ -192,39 +179,33 @@ function createDiscordUnknownPayloadResult(target) {
192
179
  })
193
180
  };
194
181
  }
195
- function resolveDiscordDeliveryOptions$1(ctx, sendContext, reply = sendContext.resolveReply()) {
196
- return {
182
+ async function sendDiscordOutboundPayload(params) {
183
+ const ctx = params.ctx;
184
+ const payload = normalizeDiscordApprovalPayload({
185
+ ...ctx.payload,
186
+ text: ctx.payload.text ?? ""
187
+ });
188
+ const mediaUrls = resolvePayloadMediaUrls(payload);
189
+ const sendContext = await createDiscordPayloadSendContext(ctx);
190
+ const deliveryOptions = (reply = sendContext.resolveReply()) => ({
197
191
  reply,
198
192
  accountId: ctx.accountId ?? void 0,
199
193
  silent: ctx.silent ?? void 0,
200
194
  cfg: ctx.cfg,
201
195
  onPlatformSendDispatch: ctx.onPlatformSendDispatch,
202
196
  assertPlatformSendAuthorized: ctx.assertDirectAdapterHandoff
203
- };
204
- }
205
- function resolveDiscordFormattedDeliveryOptions(ctx, sendContext, reply = sendContext.resolveReply()) {
206
- return {
207
- ...resolveDiscordDeliveryOptions$1(ctx, sendContext, reply),
197
+ });
198
+ const formattedDeliveryOptions = (reply = sendContext.resolveReply()) => ({
199
+ ...deliveryOptions(reply),
208
200
  ...sendContext.formatting
209
- };
210
- }
211
- function resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl) {
212
- return {
201
+ });
202
+ const mediaDeliveryOptions = (mediaUrl) => ({
213
203
  mediaUrl,
214
204
  mediaAccess: ctx.mediaAccess,
215
205
  mediaLocalRoots: ctx.mediaLocalRoots,
216
206
  mediaReadFile: ctx.mediaReadFile,
217
- ...resolveDiscordFormattedDeliveryOptions(ctx, sendContext)
218
- };
219
- }
220
- async function sendDiscordOutboundPayload(params) {
221
- const ctx = params.ctx;
222
- const payload = normalizeDiscordApprovalPayload({
223
- ...ctx.payload,
224
- text: ctx.payload.text ?? ""
207
+ ...formattedDeliveryOptions()
225
208
  });
226
- const mediaUrls = resolvePayloadMediaUrls(payload);
227
- const sendContext = await createDiscordPayloadSendContext(ctx);
228
209
  const payloadContext = {
229
210
  ...ctx,
230
211
  payload
@@ -261,7 +242,7 @@ async function sendDiscordOutboundPayload(params) {
261
242
  try {
262
243
  const voiceUrl = expectDefined(mediaUrls.at(0), "non-empty Discord voice media URLs");
263
244
  lastResult = await sendContext.sendVoice(sendContext.target, voiceUrl, {
264
- ...resolveDiscordDeliveryOptions$1(ctx, sendContext, voiceReply),
245
+ ...deliveryOptions(voiceReply),
265
246
  mediaAccess: ctx.mediaAccess,
266
247
  mediaLocalRoots: ctx.mediaLocalRoots,
267
248
  mediaReadFile: ctx.mediaReadFile
@@ -276,23 +257,23 @@ async function sendDiscordOutboundPayload(params) {
276
257
  log$1.warn("discord voice send failed; continuing without voice", { error: err });
277
258
  if (fallbackText) await sendContext.send(sendContext.target, fallbackText, {
278
259
  verbose: false,
279
- ...resolveDiscordFormattedDeliveryOptions(ctx, sendContext, voiceReply),
260
+ ...formattedDeliveryOptions(voiceReply),
280
261
  onDeliveryResult
281
262
  });
282
263
  voiceFailure = { error: err };
283
264
  }
284
265
  if (!voiceFailure) {
285
- await payloadContext.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(lastResult)));
266
+ await onDeliveryResult(lastResult);
286
267
  if (payload.text?.trim()) lastResult = await sendContext.send(sendContext.target, payload.text, {
287
268
  verbose: false,
288
- ...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
269
+ ...formattedDeliveryOptions(),
289
270
  onDeliveryResult
290
271
  });
291
272
  }
292
273
  for (const mediaUrl of mediaUrls.slice(1)) try {
293
274
  lastResult = await sendContext.send(sendContext.target, "", {
294
275
  verbose: false,
295
- ...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
276
+ ...mediaDeliveryOptions(mediaUrl),
296
277
  onDeliveryResult
297
278
  });
298
279
  } catch (err) {
@@ -302,59 +283,46 @@ async function sendDiscordOutboundPayload(params) {
302
283
  if (voiceFailure) throw voiceFailure.error;
303
284
  return completeDelivery(lastResult);
304
285
  }
305
- const discordData = payload.channelData?.discord && typeof payload.channelData.discord === "object" && !Array.isArray(payload.channelData.discord) ? payload.channelData.discord : {};
286
+ const discordData = asOptionalRecord(payload.channelData?.discord) ?? {};
306
287
  const filename = normalizeOptionalString(discordData.filename);
307
288
  const componentSpec = await resolveDiscordComponentSpec(payload);
308
- if (!componentSpec) {
309
- const nativeComponents = Array.isArray(discordData.components) ? discordData.components : void 0;
310
- const embeds = Array.isArray(discordData.embeds) ? discordData.embeds : void 0;
311
- if (nativeComponents || embeds?.length || filename) return completeDelivery(await sendPayloadMediaSequenceOrFallback({
312
- text: payload.text ?? "",
313
- mediaUrls,
314
- fallbackResult: createDiscordUnknownPayloadResult(sendContext.target),
315
- sendNoMedia: async () => await sendContext.send(sendContext.target, payload.text ?? "", {
316
- verbose: false,
317
- components: nativeComponents,
318
- embeds,
319
- filename,
320
- ...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
321
- onDeliveryResult
322
- }),
323
- send: async ({ text, mediaUrl, isFirst }) => await sendContext.send(sendContext.target, text, {
324
- verbose: false,
325
- ...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
326
- components: isFirst ? nativeComponents : void 0,
327
- embeds: isFirst ? embeds : void 0,
328
- filename: isFirst ? filename : void 0,
329
- onDeliveryResult
330
- })
331
- }));
332
- return completeResult(await sendTextMediaPayload({
333
- channel: "discord",
334
- ctx: payloadContext,
335
- adapter: params.fallbackAdapter
336
- }));
337
- }
289
+ const nativeComponents = !componentSpec && Array.isArray(discordData.components) ? discordData.components : void 0;
290
+ const embeds = !componentSpec && Array.isArray(discordData.embeds) ? discordData.embeds : void 0;
291
+ if (!componentSpec && !nativeComponents && !embeds?.length && !filename) return completeResult(await sendTextMediaPayload({
292
+ channel: "discord",
293
+ ctx: payloadContext,
294
+ adapter: params.fallbackAdapter
295
+ }));
338
296
  return completeDelivery(await sendPayloadMediaSequenceOrFallback({
339
297
  text: payload.text ?? "",
340
298
  mediaUrls,
341
299
  fallbackResult: createDiscordUnknownPayloadResult(sendContext.target),
342
- sendNoMedia: async () => {
343
- return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
344
- ...resolveDiscordFormattedDeliveryOptions(ctx, sendContext),
345
- filename,
346
- onDeliveryResult
347
- });
348
- },
300
+ sendNoMedia: async () => componentSpec ? await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
301
+ ...formattedDeliveryOptions(),
302
+ filename,
303
+ onDeliveryResult
304
+ }) : await sendContext.send(sendContext.target, payload.text ?? "", {
305
+ verbose: false,
306
+ components: nativeComponents,
307
+ embeds,
308
+ filename,
309
+ ...formattedDeliveryOptions(),
310
+ onDeliveryResult
311
+ }),
349
312
  send: async ({ text, mediaUrl, isFirst }) => {
350
- if (isFirst) return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
351
- ...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
313
+ if (componentSpec && isFirst) return await sendDiscordComponentMessageLazy(sendContext.target, componentSpec, {
314
+ ...mediaDeliveryOptions(mediaUrl),
352
315
  filename,
353
316
  onDeliveryResult
354
317
  });
355
318
  return await sendContext.send(sendContext.target, text, {
356
319
  verbose: false,
357
- ...resolveDiscordMediaDeliveryOptions(ctx, sendContext, mediaUrl),
320
+ ...mediaDeliveryOptions(mediaUrl),
321
+ ...!componentSpec ? {
322
+ components: isFirst ? nativeComponents : void 0,
323
+ embeds: isFirst ? embeds : void 0,
324
+ filename: isFirst ? filename : void 0
325
+ } : {},
358
326
  onDeliveryResult
359
327
  });
360
328
  }
@@ -365,8 +333,8 @@ async function sendDiscordOutboundPayload(params) {
365
333
  const DISCORD_TEXT_CHUNK_LIMIT = 2e3;
366
334
  const DISCORD_PRECHUNK_MAX_LINES = Number.MAX_SAFE_INTEGER;
367
335
  const log = createSubsystemLogger("discord/outbound");
368
- const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-DjQCkmsd.mjs").then((n) => n.i));
369
- const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-dPljuV24.mjs").then((n) => n.i));
336
+ const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-0hPTSK14.mjs").then((n) => n.i));
337
+ const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-FxOS3CeP.mjs").then((n) => n.i));
370
338
  function resolveDiscordDeliveryOptions(params) {
371
339
  return {
372
340
  onPlatformSendDispatch: params.onPlatformSendDispatch,
@@ -401,24 +369,17 @@ async function maybeSendDiscordWebhookText(params) {
401
369
  }
402
370
  async function resolveDiscordOutboundMessageSend(params) {
403
371
  const send = resolveOutboundSendDep(params.deps, "discord") ?? (await loadDiscordSendRuntime()).sendMessageDiscord;
404
- const reply = resolveDiscordReplyReference({
405
- replyToId: params.replyToId,
406
- replyToIdSource: params.replyToIdSource,
407
- replyToMode: params.replyToMode
408
- });
372
+ const reply = resolveDiscordReplyReference(params);
409
373
  return {
410
374
  send,
411
- target: resolveDiscordAttachedOutboundTarget({
412
- to: params.to,
413
- threadId: params.threadId
414
- }),
375
+ target: resolveDiscordAttachedOutboundTarget(params),
415
376
  options: {
416
377
  verbose: false,
417
378
  reply,
418
379
  accountId: params.accountId ?? void 0,
419
380
  silent: params.silent ?? void 0,
420
381
  cfg: params.cfg,
421
- ...resolveDiscordFormattingOptions({ formatting: params.formatting }),
382
+ ...resolveDiscordFormattingOptions(params),
422
383
  ...resolveDiscordDeliveryOptions(params)
423
384
  }
424
385
  };
@@ -1,13 +1,14 @@
1
- import { c as resolveDiscordAccount, r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-HE9-mj1L.mjs";
2
- import { t as inspectDiscordAccount } from "./account-inspect-DsER5ILV.mjs";
3
- import { A as isDiscordThreadChannelType } from "./allow-list-vxkG9_JD.mjs";
4
- import { d as normalizeDiscordMessagingTarget, p as parseDiscordTarget, u as matchesDiscordToolContextTarget } from "./send.receipt-DVOg2Oaw.mjs";
5
- import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-DLJR0xU-.mjs";
1
+ import { i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-ljrzXBJi.mjs";
2
+ import { t as inspectDiscordAccount } from "./account-inspect-8cCu6uPG.mjs";
3
+ import { A as isDiscordThreadChannelType } from "./allow-list-B_ToXtew.mjs";
4
+ import { d as normalizeDiscordMessagingTarget, u as matchesDiscordToolContextTarget } from "./send.receipt-BAlzXd8e.mjs";
5
+ import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
6
+ import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-HN9052L1.mjs";
6
7
  import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-D78sAoOz.mjs";
7
8
  import { createLazyRuntimeMethod, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
8
9
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
9
- import { asOptionalRecord, isRecord, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
10
10
  import { buildOutboundBaseSessionKey, deriveLastRoutePolicy, isAcpSessionKey, isSubagentSessionKey, parseAgentSessionKey, resolveAgentIdFromSessionKey, resolveAgentRoute } from "openclaw/plugin-sdk/routing";
11
+ import { asNonArrayRecord, asOptionalRecord, isRecord, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
11
12
  import { createUnionActionGate } from "openclaw/plugin-sdk/channel-actions";
12
13
  import { ChannelType } from "discord-api-types/v10";
13
14
  import { resolveAskUserQuestionOptionIndices } from "openclaw/plugin-sdk/reply-payload";
@@ -19,7 +20,7 @@ import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
19
20
  import { createInboundEventDeliveryCorrelation } from "openclaw/plugin-sdk/inbound-event-delivery";
20
21
  //#region extensions/discord/src/exec-approvals.ts
21
22
  function normalizeDiscordApproverId(value) {
22
- const trimmed = value.trim();
23
+ const trimmed = String(value).trim();
23
24
  if (!trimmed) return;
24
25
  if (/^\d+$/.test(trimmed)) return trimmed;
25
26
  try {
@@ -29,37 +30,26 @@ function normalizeDiscordApproverId(value) {
29
30
  return;
30
31
  }
31
32
  }
32
- function resolveDiscordOwnerApprovers(cfg) {
33
- return resolveApprovalApprovers({
34
- explicit: resolveDiscordCommandOwnerEntries(cfg),
35
- normalizeApprover: (value) => normalizeDiscordApproverId(String(value))
36
- });
37
- }
38
33
  function getDiscordExecApprovalApprovers(params) {
39
34
  return resolveApprovalApprovers({
40
- explicit: params.configOverride?.approvers ?? resolveDiscordAccount(params).config.execApprovals?.approvers ?? resolveDiscordOwnerApprovers(params.cfg),
41
- normalizeApprover: (value) => normalizeDiscordApproverId(String(value))
35
+ explicit: params.configOverride?.approvers ?? resolveDiscordAccount(params).config.execApprovals?.approvers ?? resolveApprovalApprovers({
36
+ explicit: resolveDiscordCommandOwnerEntries(params.cfg),
37
+ normalizeApprover: normalizeDiscordApproverId
38
+ }),
39
+ normalizeApprover: normalizeDiscordApproverId
42
40
  });
43
41
  }
44
42
  function isDiscordExecApprovalClientEnabled(params) {
45
43
  const config = params.configOverride ?? resolveDiscordAccount(params).config.execApprovals;
46
44
  return isChannelExecApprovalClientEnabledFromConfig({
47
45
  enabled: config?.enabled,
48
- approverCount: getDiscordExecApprovalApprovers({
49
- cfg: params.cfg,
50
- accountId: params.accountId,
51
- configOverride: params.configOverride
52
- }).length
46
+ approverCount: getDiscordExecApprovalApprovers(params).length
53
47
  });
54
48
  }
55
49
  function isDiscordExecApprovalApprover(params) {
56
50
  const senderId = params.senderId?.trim();
57
51
  if (!senderId) return false;
58
- return getDiscordExecApprovalApprovers({
59
- cfg: params.cfg,
60
- accountId: params.accountId,
61
- configOverride: params.configOverride
62
- }).includes(senderId);
52
+ return getDiscordExecApprovalApprovers(params).includes(senderId);
63
53
  }
64
54
  function shouldSuppressLocalDiscordExecApprovalPrompt(params) {
65
55
  const metadata = getExecApprovalReplyMetadata(params.payload);
@@ -89,57 +79,35 @@ function resolveRequiredDiscordChannelPermissions(channelType) {
89
79
  if (channelType === ChannelType.GuildVoice || channelType === ChannelType.GuildStageVoice) return [...REQUIRED_VOICE_CHANNEL_PERMISSIONS];
90
80
  return [...REQUIRED_TEXT_CHANNEL_PERMISSIONS];
91
81
  }
92
- function listConfiguredGuildChannelKeys(guilds) {
93
- if (!guilds) return [];
82
+ function collectDiscordAuditChannelIdsForAccount(config) {
94
83
  const ids = /* @__PURE__ */ new Set();
95
- for (const entry of Object.values(guilds)) {
84
+ for (const entry of Object.values(config.guilds ?? {})) {
96
85
  if (!entry || typeof entry !== "object") continue;
97
86
  const channelsRaw = entry.channels;
98
87
  if (!isRecord(channelsRaw)) continue;
99
88
  for (const [key, value] of Object.entries(channelsRaw)) {
100
89
  const channelId = normalizeOptionalString(key) ?? "";
101
- if (!channelId) continue;
102
- if (channelId === "*") continue;
103
- if (value?.enabled === false) continue;
90
+ if (!channelId || channelId === "*" || value?.enabled === false) continue;
104
91
  ids.add(channelId);
105
92
  }
106
93
  }
107
- return [...ids].toSorted((a, b) => a.localeCompare(b));
108
- }
109
- function collectDiscordAuditChannelIdsForGuilds(guilds) {
110
- const keys = listConfiguredGuildChannelKeys(guilds);
111
- const channelIds = keys.filter((key) => /^\d+$/.test(key));
112
- return {
113
- channelIds,
114
- unresolvedChannels: keys.length - channelIds.length
115
- };
116
- }
117
- function collectDiscordAuditChannelIdsForAccount(config) {
118
- const collected = collectDiscordAuditChannelIdsForGuilds(config.guilds);
119
- const channelIds = new Set(collected.channelIds);
120
- let unresolvedVoiceChannels = 0;
94
+ const channelIds = new Set([...ids].filter((key) => /^\d+$/.test(key)));
95
+ let unresolvedChannels = ids.size - channelIds.size;
121
96
  for (const entry of config.voice?.autoJoin ?? []) {
122
97
  const channelId = normalizeOptionalString(entry?.channelId) ?? "";
123
98
  if (/^\d+$/.test(channelId)) channelIds.add(channelId);
124
- else if (channelId) unresolvedVoiceChannels++;
99
+ else if (channelId) unresolvedChannels++;
125
100
  }
126
101
  return {
127
102
  channelIds: [...channelIds].toSorted((a, b) => a.localeCompare(b)),
128
- unresolvedChannels: collected.unresolvedChannels + unresolvedVoiceChannels
103
+ unresolvedChannels
129
104
  };
130
105
  }
131
106
  async function auditDiscordChannelPermissionsWithFetcher(params) {
132
107
  const started = Date.now();
133
108
  const token = normalizeOptionalString(params.token) ?? "";
134
- if (!token || params.channelIds.length === 0) return {
135
- ok: true,
136
- checkedChannels: 0,
137
- unresolvedChannels: 0,
138
- channels: [],
139
- elapsedMs: Date.now() - started
140
- };
141
109
  const channels = [];
142
- for (const channelId of params.channelIds) try {
110
+ for (const channelId of token ? params.channelIds : []) try {
143
111
  const perms = await params.fetchChannelPermissions(channelId, {
144
112
  cfg: params.cfg,
145
113
  token,
@@ -243,9 +211,6 @@ const localExecutionActions = /* @__PURE__ */ new Set([
243
211
  "sticker-upload",
244
212
  "event-create"
245
213
  ]);
246
- function resolveDiscordActionExecutionMode({ action }) {
247
- return localExecutionActions.has(action) ? "local" : "gateway";
248
- }
249
214
  function resolveDiscordThreadReplyDeliveryAlias(args) {
250
215
  if (normalizeOptionalString(args.target) || normalizeOptionalString(args.to) || normalizeOptionalString(args.channelId)) return;
251
216
  const threadId = normalizeOptionalString(args.threadId);
@@ -256,7 +221,7 @@ function resolveDiscordThreadReplyTarget(args) {
256
221
  const target = threadId !== void 0 ? `channel:${threadId}` : normalizeOptionalString(args.channelId) ?? normalizeOptionalString(args.to) ?? normalizeOptionalString(args.target);
257
222
  return target ? normalizeDiscordMessagingTarget(target) : void 0;
258
223
  }
259
- const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-UmkjXBfo.mjs"));
224
+ const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-CXH1h1tq.mjs"));
260
225
  const discordActionGroups = [
261
226
  {
262
227
  gate: "polls",
@@ -388,7 +353,7 @@ function describeDiscordMessageTool({ cfg, accountId }) {
388
353
  actions: ["react", "reactions"],
389
354
  properties: { emoji: Type.Optional(Type.String({ description: `Unicode emoji or custom name:id (also <:name:id> / <a:name:id>).${actions.has("emoji-list") ? " Use action:\"emoji-list\" for server emojis." : ""}` })) }
390
355
  });
391
- if (actions.has("send")) schema.push({
356
+ schema.push({
392
357
  actions: ["send"],
393
358
  visibility: "all-configured",
394
359
  properties: { components: Type.Optional(Type.Object({
@@ -432,7 +397,7 @@ const discordMessageActions = {
432
397
  "pin",
433
398
  "unpin"
434
399
  ],
435
- resolveExecutionMode: resolveDiscordActionExecutionMode,
400
+ resolveExecutionMode: ({ action }) => localExecutionActions.has(action) ? "local" : "gateway",
436
401
  describeMessageTool: describeDiscordMessageTool,
437
402
  supportsAction: ({ action }) => action !== "poll",
438
403
  messageActionTargetAliases: { "thread-reply": {
@@ -471,7 +436,7 @@ const discordMessageActions = {
471
436
  if ((componentSpec || nativeComponents) && embeds?.length) return null;
472
437
  const filename = normalizeOptionalString(ctx.params.filename);
473
438
  if (!componentSpec && !nativeComponents && !embeds?.length && !filename) return payloadWithDeliveryMetadata;
474
- const discordData = payloadWithDeliveryMetadata.channelData?.discord && typeof payloadWithDeliveryMetadata.channelData.discord === "object" && !Array.isArray(payloadWithDeliveryMetadata.channelData.discord) ? payloadWithDeliveryMetadata.channelData.discord : {};
439
+ const discordData = asNonArrayRecord(payloadWithDeliveryMetadata.channelData?.discord);
475
440
  return {
476
441
  ...payloadWithDeliveryMetadata,
477
442
  channelData: {
@@ -494,9 +459,7 @@ const discordMessageActions = {
494
459
  //#endregion
495
460
  //#region extensions/discord/src/conversation-identity.ts
496
461
  function normalizeDiscordTarget(raw, defaultKind) {
497
- const trimmed = normalizeOptionalString(raw);
498
- if (!trimmed) return;
499
- return parseDiscordTarget(trimmed, { defaultKind })?.normalized;
462
+ return parseDiscordTarget(normalizeOptionalString(raw) ?? "", { defaultKind })?.normalized;
500
463
  }
501
464
  function buildDiscordConversationIdentity(kind, rawId) {
502
465
  const trimmed = normalizeOptionalString(rawId);
@@ -565,23 +528,13 @@ function resolveDiscordConversationRoute(params) {
565
528
  }
566
529
  }
567
530
  function resolveDiscordBoundConversationRoute(params) {
531
+ const route = resolveDiscordConversationRoute({
532
+ ...params,
533
+ peer: buildDiscordRoutePeer(params)
534
+ });
568
535
  return resolveDiscordEffectiveRoute({
569
- route: resolveDiscordConversationRoute({
570
- cfg: params.cfg,
571
- accountId: params.accountId,
572
- guildId: params.guildId,
573
- memberRoleIds: params.memberRoleIds,
574
- peer: buildDiscordRoutePeer({
575
- isDirectMessage: params.isDirectMessage,
576
- isGroupDm: params.isGroupDm,
577
- directUserId: params.directUserId,
578
- conversationId: params.conversationId
579
- }),
580
- parentConversationId: params.parentConversationId
581
- }),
582
- boundSessionKey: params.boundSessionKey,
583
- configuredRoute: params.configuredRoute,
584
- matchedBy: params.matchedBy
536
+ ...params,
537
+ route
585
538
  });
586
539
  }
587
540
  function resolveDiscordEffectiveRoute(params) {
@@ -649,16 +602,14 @@ function escapeDiscordApprovalDisplayCharacter(character) {
649
602
  /** Keep opaque approval metadata bounded, single-line, and inert in Discord Markdown. */
650
603
  function formatDiscordApprovalDisplayValue(value, maxChars = 200) {
651
604
  const limit = Number.isFinite(maxChars) ? Math.max(0, Math.trunc(maxChars)) : 200;
652
- const escapedParts = Array.from(value, escapeDiscordApprovalDisplayCharacter);
653
- const escaped = escapedParts.join("");
654
- if (escaped.length <= limit) return escaped;
655
- if (limit <= 3) return ".".repeat(limit);
605
+ let escaped = "";
656
606
  let bounded = "";
657
- for (const part of escapedParts) {
658
- if (bounded.length + part.length > limit - 3) break;
659
- bounded += part;
607
+ for (const character of value) {
608
+ escaped += escapeDiscordApprovalDisplayCharacter(character);
609
+ if (escaped.length <= limit - 3) bounded = escaped;
610
+ if (escaped.length > limit) return limit <= 3 ? ".".repeat(limit) : `${bounded}...`;
660
611
  }
661
- return `${bounded}...`;
612
+ return escaped;
662
613
  }
663
614
  //#endregion
664
615
  //#region extensions/discord/src/outbound-components.ts
@@ -691,39 +642,33 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
691
642
  }
692
643
  }
693
644
  };
694
- const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-dPljuV24.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
695
- const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-DLJR0xU-.mjs").then((n) => n.a));
645
+ const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-FxOS3CeP.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
646
+ const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-HN9052L1.mjs").then((n) => n.a));
696
647
  function addPayloadTextFallback(spec, payload) {
697
648
  return spec.text ? spec : {
698
649
  ...spec,
699
650
  text: payload.text?.trim() ? payload.text : void 0
700
651
  };
701
652
  }
702
- function countDiscordComponentBlock(block) {
703
- if (block.type === "section") return 1 + (block.texts?.length ? block.texts.length : block.text ? 1 : 0) + (block.accessory ? 1 : 0);
704
- if (block.type === "actions") return 1 + (block.buttons?.length ?? (block.select ? 1 : 0));
705
- return 1;
706
- }
707
- function countDiscordMessageComponents(params) {
708
- const blocks = params.spec.blocks ?? [];
709
- let count = 1 + (params.spec.text ? 1 : 0);
710
- for (const block of blocks) count += countDiscordComponentBlock(block);
711
- if (params.spec.modal) {
653
+ function isDiscordComponentSpecWithinMessageLimit(params) {
654
+ const spec = addPayloadTextFallback(params.spec, { text: params.fallbackText });
655
+ if (spec.text && Array.from(spec.text).length > DISCORD_TEXT_DISPLAY_LIMIT) return false;
656
+ const includesMedia = params.includesMedia === true;
657
+ const blocks = spec.blocks ?? [];
658
+ let count = 1 + (spec.text ? 1 : 0);
659
+ for (const block of blocks) if (block.type === "section") {
660
+ const textCount = block.texts?.length ? block.texts.length : block.text ? 1 : 0;
661
+ count += 1 + textCount + (block.accessory ? 1 : 0);
662
+ } else if (block.type === "actions") count += 1 + (block.buttons?.length ?? (block.select ? 1 : 0));
663
+ else count += 1;
664
+ if (spec.modal) {
712
665
  const lastBlock = blocks.at(-1);
713
666
  const triggerFitsLastRow = lastBlock?.type === "actions" && !lastBlock.select && (lastBlock.buttons?.length ?? 0) < 5;
714
667
  count += triggerFitsLastRow ? 1 : 2;
715
668
  }
716
669
  const hasFileBlock = blocks.some((block) => block.type === "file");
717
- if (params.includesMedia && !hasFileBlock) count += 1;
718
- return count;
719
- }
720
- function isDiscordComponentSpecWithinMessageLimit(params) {
721
- const countedSpec = addPayloadTextFallback(params.spec, { text: params.fallbackText });
722
- if (countedSpec.text && Array.from(countedSpec.text).length > DISCORD_TEXT_DISPLAY_LIMIT) return false;
723
- return countDiscordMessageComponents({
724
- spec: countedSpec,
725
- includesMedia: params.includesMedia === true
726
- }) <= DISCORD_MESSAGE_COMPONENT_LIMIT;
670
+ if (includesMedia && !hasFileBlock) count += 1;
671
+ return count <= DISCORD_MESSAGE_COMPONENT_LIMIT;
727
672
  }
728
673
  async function buildDiscordPresentationPayload(params) {
729
674
  const componentSpec = (await loadDiscordSharedInteractive()).buildDiscordPresentationComponents(params.presentation, { questionOptionIndices: resolveAskUserQuestionOptionIndices(params.payload) });
@@ -792,10 +737,7 @@ function resolveDiscordOutboundTargetKindHint(params) {
792
737
  const resolvedKind = params.resolvedTarget?.kind;
793
738
  if (resolvedKind === "user") return "user";
794
739
  if (resolvedKind === "group" || resolvedKind === "channel") return "channel";
795
- const target = params.target.trim();
796
- if (/^channel:/i.test(target)) return "channel";
797
- if (/^(user:|discord:|@|<@!?)/i.test(target)) return "user";
798
- return "channel";
740
+ return /^(user:|discord:|@|<@!?)/i.test(params.target.trim()) ? "user" : "channel";
799
741
  }
800
742
  //#endregion
801
743
  export { collectDiscordAuditChannelIdsForAccount as C, isDiscordExecApprovalClientEnabled as D, isDiscordExecApprovalApprover as E, shouldSuppressLocalDiscordExecApprovalPrompt as O, auditDiscordChannelPermissionsWithFetcher as S, getDiscordExecApprovalApprovers as T, resolveDiscordRuntimeBindingConversationId as _, resolveDiscordComponentSpec as a, discordInboundEventDelivery as b, formatDiscordApprovalDisplayValue as c, resolveDiscordBoundConversationRoute as d, resolveDiscordConversationRoute as f, resolveDiscordCurrentConversationIdentity as g, resolveDiscordConversationIdentity as h, isDiscordComponentSpecWithinMessageLimit as i, buildDiscordConversationRouteContext as l, shouldIgnoreStaleDiscordRouteBinding as m, DISCORD_PRESENTATION_CAPABILITIES as n, sendDiscordComponentMessageLazy as o, resolveDiscordEffectiveRoute as p, buildDiscordPresentationPayload as r, DISCORD_APPROVAL_ALLOWED_MENTIONS as s, resolveDiscordOutboundSessionRoute as t, buildDiscordRoutePeer as u, discordMessageActions as v, resolveRequiredDiscordChannelPermissions as w, notifyDiscordInboundEventOutboundPayloadSuccess as x, isTrustedRequesterGuildAdminAction as y };
@@ -0,0 +1,11 @@
1
+ //#region extensions/discord/src/voice/output-activity.ts
2
+ function resolveDiscordOutputAudioDelta(previous, sourceAudioBytes) {
3
+ const sinkAudioBytes = Math.floor((previous.sourceAudioBytes + sourceAudioBytes) / 2) * 8 - previous.sinkAudioBytes;
4
+ return {
5
+ audioMs: sinkAudioBytes / 192,
6
+ sourceAudioBytes,
7
+ sinkAudioBytes
8
+ };
9
+ }
10
+ //#endregion
11
+ export { resolveDiscordOutputAudioDelta as t };
@@ -1,5 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
2
  import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
3
+ import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
3
4
  import { readProviderJsonObjectResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
4
5
  import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
5
6
  //#region extensions/discord/src/pluralkit.ts
@@ -31,7 +32,8 @@ async function fetchPluralKitMessageInfo(params) {
31
32
  }
32
33
  if (!res.ok) {
33
34
  const text = await readResponseTextLimited(res, PLURALKIT_ERROR_BODY_LIMIT_BYTES).catch(() => "");
34
- const detail = text.trim() ? `: ${text.trim()}` : "";
35
+ const redacted = text.trim() ? redactToolPayloadText(text.trim()) : "";
36
+ const detail = redacted ? `: ${redacted}` : "";
35
37
  throw new Error(`PluralKit API failed (${res.status})${detail}`);
36
38
  }
37
39
  return await readProviderJsonObjectResponse(res, "PluralKit message");