@openclaw/discord 2026.11.3 → 2026.11.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 (220) hide show
  1. package/dist/.setup/{account-inspect-8cCu6uPG.mjs → account-inspect-DGkdWwix.mjs} +1 -1
  2. package/dist/.setup/{accounts-ljrzXBJi.mjs → accounts-C_25wyxC.mjs} +9 -6
  3. package/dist/.setup/{active-turn-thread-route-C4tp9noA.mjs → active-turn-thread-route-KvRTAVE3.mjs} +1 -2
  4. package/dist/.setup/{allow-list-BKqOldGy.mjs → allow-list-BXrS8-R9.mjs} +4 -152
  5. package/dist/.setup/{api-DqmMUZau.mjs → api-BlBD4ism.mjs} +10 -20
  6. package/dist/.setup/{approval-handler.runtime-D0qu1um7.mjs → approval-handler.runtime-BGYjX1t9.mjs} +80 -61
  7. package/dist/.setup/{approval-message-updates-CdurC9Ej.mjs → approval-message-updates-DKsCfxSW.mjs} +2 -2
  8. package/dist/.setup/{audit-ChorIwio.mjs → audit-5b-FXj9R.mjs} +4 -4
  9. package/dist/.setup/{channel-ZilgdF5e.mjs → channel-CWwTHWFo.mjs} +134 -202
  10. package/dist/.setup/channel-access-9cyzozUP.mjs +24 -0
  11. package/dist/.setup/channel.setup-B3MtmBQG.mjs +238 -0
  12. package/dist/.setup/{components-Du9NhD8h.mjs → components-YCvQ6YLS.mjs} +209 -430
  13. package/dist/.setup/components.base-CiS0h_XP.mjs +32 -0
  14. package/dist/.setup/{config-schema-_uBILpQf.mjs → config-schema-BNKN1cu5.mjs} +6 -7
  15. package/dist/.setup/{conversation-binding-route-8Ul1KpGF.mjs → conversation-binding-route-kCTw8cij.mjs} +2 -2
  16. package/dist/.setup/{directory-config-3iVub-3m.mjs → directory-config-Ble81PWH.mjs} +1 -1
  17. package/dist/.setup/{directory-live-BDVl2DoC.mjs → directory-live-DH3tpS3x.mjs} +52 -57
  18. package/dist/.setup/{discord-BMD-JiVS.mjs → discord-DGVSguhx.mjs} +1124 -1710
  19. package/dist/.setup/{doctor-hQKbkNKq.mjs → doctor-eujgbnpZ.mjs} +3 -5
  20. package/dist/.setup/endpoint-runtime-lf4DeLas.mjs +139 -0
  21. package/dist/.setup/guilds-eDq22iSM.mjs +22 -0
  22. package/dist/.setup/{handle-action-B1lmt4ms.mjs → handle-action-CktwmzMz.mjs} +15 -15
  23. package/dist/.setup/{handle-action.guild-admin-B6g31cwt.mjs → handle-action.guild-admin-WLQ7fRqI.mjs} +5 -5
  24. package/dist/.setup/listeners-Df8lx3vK.mjs +47 -0
  25. package/dist/.setup/{live-policy-config-C_Q966Wh.mjs → live-policy-config-DiBVuaU6.mjs} +2 -3
  26. package/dist/.setup/{message-handler-CkI3yMjL.mjs → message-handler-hhNSioxo.mjs} +154 -115
  27. package/dist/.setup/{message-handler.preflight-CEfkFV9U.mjs → message-handler.preflight-BZcZE1o-.mjs} +30 -105
  28. package/dist/.setup/{message-handler.preflight-pluralkit-D5si80_L.mjs → message-handler.preflight-pluralkit-CYZfXXb6.mjs} +9 -22
  29. package/dist/.setup/{message-handler.process-DsMtetRf.mjs → message-handler.process-B0n-mQ99.mjs} +256 -373
  30. package/dist/.setup/outbound-payload-BaZmjewa.mjs +447 -0
  31. package/dist/.setup/{outbound-session-route-BtUpGBTb.mjs → outbound-session-route-Cgx4i9cS.mjs} +139 -86
  32. package/dist/.setup/{preflight-audio-wWgsZG5F.mjs → preflight-audio-C6QtD6HX.mjs} +1 -5
  33. package/dist/.setup/{presence-cache-DCeTsL73.mjs → presence-cache-Dq-3nH7R.mjs} +1 -6
  34. package/dist/.setup/{probe-CBaoCs-c.mjs → probe-DezB-6xz.mjs} +5 -9
  35. package/dist/.setup/{provider-CI_OLfvz.mjs → provider-BN2bCIUp.mjs} +3440 -4308
  36. package/dist/.setup/{provider-session.runtime-TWOo_JZx.mjs → provider-session.runtime-Dr_5X43t.mjs} +3 -3
  37. package/dist/.setup/provider.runtime-BuJpl0Pv.mjs +1 -0
  38. package/dist/.setup/proxy-fetch-BzXwBAXt.mjs +30 -0
  39. package/dist/.setup/{realtime-session.runtime-DvfS4vJj.mjs → realtime-session.runtime-BTDWsV4d.mjs} +44 -81
  40. package/dist/.setup/{receive-recovery-CKvaG2Hf.mjs → receive-recovery-C3Ks4wAQ.mjs} +13 -27
  41. package/dist/.setup/{resolve-allowlist-common-cIjtqh2F.mjs → resolve-allowlist-common-Bk8Fj6Ik.mjs} +3 -13
  42. package/dist/.setup/{resolve-channels-Cj5i7hzj.mjs → resolve-channels-Bp8frXvc.mjs} +7 -8
  43. package/dist/.setup/{resolve-users-BQLbysRB.mjs → resolve-users-Cvcj22sG.mjs} +4 -7
  44. package/dist/.setup/{runtime-RWnuJgWB.mjs → runtime-BJaCvlmq.mjs} +196 -239
  45. package/dist/.setup/{runtime-plifsKg9.mjs → runtime-BMgTyuwg.mjs} +6 -6
  46. package/dist/.setup/{secret-config-contract-z6FhbT8E.mjs → secret-config-contract-B1kE4sDv.mjs} +4 -9
  47. package/dist/.setup/{send-da6ENJ9f.mjs → send-CVW7V-VZ.mjs} +149 -175
  48. package/dist/.setup/{send.components-CWZUuGvA.mjs → send.components-C8YXdnO_.mjs} +59 -71
  49. package/dist/.setup/{send.outbound-qZ3iK3Vq.mjs → send.outbound-Uzcmh3Yd.mjs} +76 -129
  50. package/dist/.setup/{send.receipt-C18khRYH.mjs → send.receipt-NZDOTZBU.mjs} +30 -32
  51. package/dist/.setup/{send.shared-CnlMgoqQ.mjs → send.shared-a_6Oeyg1.mjs} +38 -115
  52. package/dist/.setup/{sender-identity-DgbJykq0.mjs → sender-identity-76HFb8eK.mjs} +3 -9
  53. package/dist/.setup/setup-plugin-api-BExhGEhL.mjs +2 -0
  54. package/dist/.setup/shared-interactive-DmzaoKOM.mjs +316 -0
  55. package/dist/.setup/{shared-CY5vJM48.mjs → shared-yDUSExm2.mjs} +8 -11
  56. package/dist/.setup/{subagent-hooks-CIu2TFz3.mjs → subagent-hooks-CDkdHQyy.mjs} +1 -1
  57. package/dist/.setup/{system-events-DCOLXkwS.mjs → system-events-yfWz150v.mjs} +2 -2
  58. package/dist/.setup/{target-resolver-CApivu3G.mjs → target-resolver-BOOzqxxM.mjs} +3 -3
  59. package/dist/.setup/{thread-bindings-DcvT_JgI.mjs → thread-bindings-zce4cpu_.mjs} +12 -20
  60. package/dist/.setup/{thread-bindings.manager-5Sh7yedN.mjs → thread-bindings.manager-NywKzUtc.mjs} +22 -42
  61. package/dist/.setup/{thread-bindings.session-updates-BMdJeJMc.mjs → thread-bindings.session-updates-D0j7oh8S.mjs} +11 -18
  62. package/dist/.setup/{threading-CzjFeUSe.mjs → threading-DodLYDt-.mjs} +68 -105
  63. package/dist/.setup/{timeouts-CuNARfyw.mjs → timeouts-cIxzatmv.mjs} +1 -1
  64. package/dist/.setup/{transcripts-source-8RDQrSVb.mjs → transcripts-source-ie9GBWaU.mjs} +110 -179
  65. package/dist/.setup/{voice-runtime-BsDILmAv.mjs → voice-runtime-B7V_LTdX.mjs} +231 -452
  66. package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -0
  67. package/dist/account-inspect-api.js +1 -1
  68. package/dist/action-runtime-api.js +1 -2
  69. package/dist/activities-api.js +286 -341
  70. package/dist/api.js +16 -16
  71. package/dist/channel-config-api.js +1 -2
  72. package/dist/channel-plugin-api.js +1 -2
  73. package/dist/contract-api.js +1 -2
  74. package/dist/directory-contract-api.js +1 -1
  75. package/dist/runtime-api.js +22 -22
  76. package/dist/runtime-setter-api.js +1 -2
  77. package/dist/secret-contract-api.js +1 -2
  78. package/dist/security-audit-contract-api.js +1 -2
  79. package/dist/security-contract-api.js +1 -2
  80. package/dist/session-key-api.js +1 -2
  81. package/dist/setup-entry.js +1 -1
  82. package/dist/setup-plugin-api.js +1 -2
  83. package/dist/src/voice/audio-worker.runtime.js +56 -68
  84. package/dist/subagent-hooks-api.js +1 -1
  85. package/dist/thread-binding-api.js +1 -2
  86. package/dist/transcripts-source-api.js +1 -1
  87. package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +3339 -4021
  88. package/node_modules/@napi-rs/wasm-runtime/package.json +1 -1
  89. package/node_modules/@types/lodash/README.md +1 -1
  90. package/node_modules/@types/lodash/common/function.d.ts +2 -2
  91. package/node_modules/@types/lodash/package.json +2 -2
  92. package/node_modules/@types/node/README.md +1 -1
  93. package/node_modules/@types/node/package.json +2 -2
  94. package/node_modules/@types/node/util.d.ts +6 -3
  95. package/node_modules/discord-api-types/package.json +4 -4
  96. package/node_modules/discord-api-types/rest/v10/index.d.ts +8 -0
  97. package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
  98. package/node_modules/discord-api-types/rest/v10/index.js +8 -0
  99. package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
  100. package/node_modules/discord-api-types/rest/v10/oauth2.d.ts +26 -2
  101. package/node_modules/discord-api-types/rest/v10/oauth2.d.ts.map +1 -1
  102. package/node_modules/discord-api-types/rest/v9/index.d.ts +8 -0
  103. package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
  104. package/node_modules/discord-api-types/rest/v9/index.js +8 -0
  105. package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
  106. package/node_modules/discord-api-types/rest/v9/oauth2.d.ts +26 -2
  107. package/node_modules/discord-api-types/rest/v9/oauth2.d.ts.map +1 -1
  108. package/node_modules/typebox/build/format/duration.d.mts +2 -2
  109. package/node_modules/typebox/build/format/duration.mjs +2 -2
  110. package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
  111. package/node_modules/typebox/build/format/idn_email.mjs +1 -0
  112. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
  113. package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
  114. package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
  115. package/node_modules/typebox/build/format/ipv4.mjs +2 -2
  116. package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
  117. package/node_modules/typebox/build/format/ipv6.mjs +1 -1
  118. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  119. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  120. package/node_modules/typebox/build/schema/build.mjs +1 -0
  121. package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
  122. package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
  123. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
  124. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
  125. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
  126. package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
  127. package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
  128. package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
  129. package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
  130. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
  131. package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
  132. package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
  133. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
  134. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
  135. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
  136. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
  137. package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
  138. package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
  139. package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
  140. package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
  141. package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
  142. package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
  143. package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
  144. package/node_modules/typebox/build/system/memory/create.mjs +18 -13
  145. package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
  146. package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
  147. package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
  148. package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
  149. package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
  150. package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
  151. package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
  152. package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
  153. package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
  154. package/node_modules/typebox/build/system/memory/update.mjs +43 -16
  155. package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
  156. package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
  157. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
  158. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
  159. package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
  160. package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
  161. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
  162. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
  163. package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
  164. package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
  165. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
  166. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
  167. package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
  168. package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
  169. package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
  170. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  171. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
  172. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
  173. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
  174. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
  175. package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
  176. package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
  177. package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
  178. package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
  179. package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
  180. package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
  181. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
  182. package/node_modules/typebox/package.json +1 -1
  183. package/node_modules/typebox/readme.md +1 -1
  184. package/node_modules/undici/docs/docs/api/Interceptors.md +15 -2
  185. package/node_modules/undici/lib/dispatcher/client-h2.js +78 -3
  186. package/node_modules/undici/lib/dispatcher/pool-base.js +20 -3
  187. package/node_modules/undici/package.json +3 -3
  188. package/node_modules/undici/types/api.d.ts +1 -1
  189. package/node_modules/undici/types/utility.d.ts +4 -4
  190. package/node_modules/uuid/package.json +17 -17
  191. package/node_modules/zod/package.json +1 -1
  192. package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  193. package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  194. package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  195. package/node_modules/zod/src/v4/core/compile.ts +9 -0
  196. package/node_modules/zod/src/v4/core/schemas.ts +35 -1
  197. package/node_modules/zod/src/v4/core/util.ts +13 -0
  198. package/node_modules/zod/src/v4/core/versions.ts +1 -1
  199. package/node_modules/zod/v4/core/compile.cjs +8 -0
  200. package/node_modules/zod/v4/core/compile.js +8 -0
  201. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  202. package/node_modules/zod/v4/core/schemas.d.cts +3 -1
  203. package/node_modules/zod/v4/core/schemas.d.ts +3 -1
  204. package/node_modules/zod/v4/core/schemas.js +30 -0
  205. package/node_modules/zod/v4/core/util.cjs +15 -0
  206. package/node_modules/zod/v4/core/util.d.cts +2 -0
  207. package/node_modules/zod/v4/core/util.d.ts +2 -0
  208. package/node_modules/zod/v4/core/util.js +14 -0
  209. package/node_modules/zod/v4/core/versions.cjs +1 -1
  210. package/node_modules/zod/v4/core/versions.js +1 -1
  211. package/openclaw.plugin.json +1 -31
  212. package/package.json +8 -8
  213. package/dist/.setup/channel-access-DasWY_OV.mjs +0 -48
  214. package/dist/.setup/channel.setup-DaDQdctj.mjs +0 -249
  215. package/dist/.setup/outbound-adapter-DfAanoCO.mjs +0 -543
  216. package/dist/.setup/provider.runtime-DnionCyo.mjs +0 -2
  217. package/dist/.setup/setup-plugin-api-D1QuM187.mjs +0 -3
  218. package/dist/.setup/targets-UWWZ6gF7.mjs +0 -3
  219. package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
  220. package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
@@ -1,9 +1,9 @@
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-BKqOldGy.mjs";
4
- import { d as normalizeDiscordMessagingTarget, u as matchesDiscordToolContextTarget } from "./send.receipt-C18khRYH.mjs";
1
+ import { d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-C_25wyxC.mjs";
2
+ import { t as inspectDiscordAccount } from "./account-inspect-DGkdWwix.mjs";
3
+ import { w as isDiscordThreadChannelType } from "./allow-list-BXrS8-R9.mjs";
4
+ import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-NZDOTZBU.mjs";
5
5
  import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
6
- import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-Du9NhD8h.mjs";
6
+ import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-YCvQ6YLS.mjs";
7
7
  import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-C7rUdqUX.mjs";
8
8
  import { createLazyRuntimeMethod, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
9
9
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
@@ -13,13 +13,15 @@ import { asNonArrayRecord, asOptionalRecord, isRecord, normalizeOptionalLowercas
13
13
  import { createUnionActionGate } from "openclaw/plugin-sdk/channel-actions";
14
14
  import { ChannelType } from "discord-api-types/v10";
15
15
  import { resolveAskUserQuestionOptionIndices } from "openclaw/plugin-sdk/reply-payload";
16
- import { Type } from "typebox";
17
16
  import { resolveGlobalMap } from "openclaw/plugin-sdk/global-singleton";
17
+ import { Type } from "typebox";
18
+ import { normalizeAtHashSlug } from "openclaw/plugin-sdk/string-normalization-runtime";
18
19
  import { buildThreadAwareOutboundSessionRoute } from "openclaw/plugin-sdk/channel-core";
19
20
  import { getExecApprovalReplyMetadata, isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
20
21
  import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
21
22
  import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
22
23
  import { createInboundEventDeliveryCorrelation } from "openclaw/plugin-sdk/inbound-event-delivery";
24
+ import { resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
23
25
  //#region extensions/discord/src/exec-approvals.ts
24
26
  function normalizeDiscordApproverId(value) {
25
27
  const trimmed = String(value).trim();
@@ -213,17 +215,7 @@ const localExecutionActions = /* @__PURE__ */ new Set([
213
215
  "sticker-upload",
214
216
  "event-create"
215
217
  ]);
216
- function resolveDiscordThreadReplyDeliveryAlias(args) {
217
- if (normalizeOptionalString(args.target) || normalizeOptionalString(args.to) || normalizeOptionalString(args.channelId)) return;
218
- const threadId = normalizeOptionalString(args.threadId);
219
- return threadId ? normalizeDiscordMessagingTarget(`channel:${threadId}`) : void 0;
220
- }
221
- function resolveDiscordThreadReplyTarget(args) {
222
- const threadId = normalizeOptionalString(args.threadId);
223
- const target = threadId !== void 0 ? `channel:${threadId}` : normalizeOptionalString(args.channelId) ?? normalizeOptionalString(args.to) ?? normalizeOptionalString(args.target);
224
- return target ? normalizeDiscordMessagingTarget(target) : void 0;
225
- }
226
- const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-B1lmt4ms.mjs"));
218
+ const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-CktwmzMz.mjs"));
227
219
  const discordActionGroups = [
228
220
  {
229
221
  gate: "polls",
@@ -334,47 +326,6 @@ const discordActionGroups = [
334
326
  defaultEnabled: false
335
327
  }
336
328
  ];
337
- function describeDiscordMessageTool({ cfg, accountId }) {
338
- const accounts = (accountId ? [accountId] : listDiscordAccountIds(cfg)).map((id) => inspectDiscordAccount({
339
- cfg,
340
- accountId: id
341
- })).filter((account) => account.enabled && account.configured);
342
- if (accounts.length === 0) return {
343
- actions: [],
344
- capabilities: [],
345
- schema: null
346
- };
347
- const isEnabled = createUnionActionGate(accounts, (account) => createDiscordActionGate({
348
- cfg,
349
- accountId: account.accountId
350
- }));
351
- const actions = /* @__PURE__ */ new Set(["send"]);
352
- for (const group of discordActionGroups) if (isEnabled(group.gate, group.defaultEnabled ?? true)) for (const action of group.actions) actions.add(action);
353
- const schema = [];
354
- if (actions.has("react")) schema.push({
355
- actions: ["react", "reactions"],
356
- 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." : ""}` })) }
357
- });
358
- schema.push({
359
- actions: ["send"],
360
- visibility: "all-configured",
361
- properties: { components: Type.Optional(Type.Object({
362
- blocks: Type.Optional(Type.Array(Type.Unknown(), { description: "Discord Components V2 blocks such as text, buttons, selects, media, containers, and separators." })),
363
- modal: Type.Optional(Type.Object({}, {
364
- additionalProperties: true,
365
- description: "Optional Discord modal triggered by generated components."
366
- }))
367
- }, {
368
- additionalProperties: true,
369
- description: "Discord Components V2 payload for send actions. Accepts the same object consumed by the Discord components adapter."
370
- })) }
371
- });
372
- return {
373
- actions: Array.from(actions),
374
- capabilities: ["presentation"],
375
- schema
376
- };
377
- }
378
329
  const discordMessageActions = {
379
330
  providerOwnedReadGates: true,
380
331
  readAuthorityActions: [
@@ -400,14 +351,60 @@ const discordMessageActions = {
400
351
  "unpin"
401
352
  ],
402
353
  resolveExecutionMode: ({ action }) => localExecutionActions.has(action) ? "local" : "gateway",
403
- describeMessageTool: describeDiscordMessageTool,
354
+ describeMessageTool: ({ cfg, accountId }) => {
355
+ const accounts = (accountId ? [accountId] : listDiscordAccountIds(cfg)).map((id) => inspectDiscordAccount({
356
+ cfg,
357
+ accountId: id
358
+ })).filter((account) => account.enabled && account.configured);
359
+ if (accounts.length === 0) return {
360
+ actions: [],
361
+ capabilities: [],
362
+ schema: null
363
+ };
364
+ const isEnabled = createUnionActionGate(accounts, (account) => createDiscordActionGate({
365
+ cfg,
366
+ accountId: account.accountId
367
+ }));
368
+ const actions = /* @__PURE__ */ new Set(["send"]);
369
+ for (const group of discordActionGroups) if (isEnabled(group.gate, group.defaultEnabled ?? true)) for (const action of group.actions) actions.add(action);
370
+ const schema = [];
371
+ if (actions.has("react")) schema.push({
372
+ actions: ["react", "reactions"],
373
+ 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." : ""}` })) }
374
+ });
375
+ schema.push({
376
+ actions: ["send"],
377
+ visibility: "all-configured",
378
+ properties: { components: Type.Optional(Type.Object({
379
+ blocks: Type.Optional(Type.Array(Type.Unknown(), { description: "Discord Components V2 blocks such as text, buttons, selects, media, containers, and separators." })),
380
+ modal: Type.Optional(Type.Object({}, {
381
+ additionalProperties: true,
382
+ description: "Optional Discord modal triggered by generated components."
383
+ }))
384
+ }, {
385
+ additionalProperties: true,
386
+ description: "Discord Components V2 payload for send actions. Accepts the same object consumed by the Discord components adapter."
387
+ })) }
388
+ });
389
+ return {
390
+ actions: Array.from(actions),
391
+ capabilities: ["presentation"],
392
+ schema
393
+ };
394
+ },
404
395
  supportsAction: ({ action }) => action !== "poll",
405
396
  messageActionTargetAliases: { "thread-reply": {
406
397
  aliases: ["threadId"],
407
398
  deliveryTargetAliases: ["threadId"],
408
- resolveDeliveryTarget: ({ args }) => resolveDiscordThreadReplyDeliveryAlias(args),
399
+ resolveDeliveryTarget: ({ args }) => {
400
+ if (normalizeOptionalString(args.target) || normalizeOptionalString(args.to) || normalizeOptionalString(args.channelId)) return;
401
+ const threadId = normalizeOptionalString(args.threadId);
402
+ return threadId ? normalizeDiscordMessagingTarget(`channel:${threadId}`) : void 0;
403
+ },
409
404
  matchesCurrentConversation: ({ args, toolContext }) => {
410
- const target = resolveDiscordThreadReplyTarget(args);
405
+ const threadId = normalizeOptionalString(args.threadId);
406
+ const rawTarget = threadId !== void 0 ? `channel:${threadId}` : normalizeOptionalString(args.channelId) ?? normalizeOptionalString(args.to) ?? normalizeOptionalString(args.target);
407
+ const target = rawTarget ? normalizeDiscordMessagingTarget(rawTarget) : void 0;
411
408
  return target ? matchesDiscordToolContextTarget({
412
409
  target,
413
410
  toolContext
@@ -461,7 +458,7 @@ const discordMessageActions = {
461
458
  //#endregion
462
459
  //#region extensions/discord/src/conversation-identity.ts
463
460
  function normalizeDiscordTarget(raw, defaultKind) {
464
- return parseDiscordTarget(normalizeOptionalString(raw) ?? "", { defaultKind })?.normalized;
461
+ return parseDiscordTarget(raw ?? "", { defaultKind })?.normalized;
465
462
  }
466
463
  function buildDiscordConversationIdentity(kind, rawId) {
467
464
  const trimmed = normalizeOptionalString(rawId);
@@ -529,16 +526,6 @@ function resolveDiscordConversationRoute(params) {
529
526
  });
530
527
  }
531
528
  }
532
- function resolveDiscordBoundConversationRoute(params) {
533
- const route = resolveDiscordConversationRoute({
534
- ...params,
535
- peer: buildDiscordRoutePeer(params)
536
- });
537
- return resolveDiscordEffectiveRoute({
538
- ...params,
539
- route
540
- });
541
- }
542
529
  function resolveDiscordEffectiveRoute(params) {
543
530
  const boundSessionKey = params.boundSessionKey?.trim();
544
531
  if (!boundSessionKey) return params.configuredRoute?.route ?? params.route;
@@ -571,18 +558,84 @@ function shouldIgnoreStaleDiscordRouteBinding(params) {
571
558
  }
572
559
  //#endregion
573
560
  //#region extensions/discord/src/channel-policy-state.ts
574
- const channelPolicyBindings = resolveGlobalMap(Symbol.for("openclaw.discord.channel-policy-bindings"), "close-and-restart");
575
- function setDiscordChannelPolicyBindings(accountId, bindings) {
576
- channelPolicyBindings.set(normalizeAccountId(accountId), [...bindings]);
561
+ const policyBindings = resolveGlobalMap(Symbol.for("openclaw.discord.policy-bindings"), "close-and-restart");
562
+ function setDiscordPolicyBindings(accountId, bindings, guilds = /* @__PURE__ */ new Map()) {
563
+ policyBindings.set(normalizeAccountId(accountId), {
564
+ channels: bindings,
565
+ guilds
566
+ });
577
567
  }
578
- function listBindings(accountId, guildKey) {
579
- return (channelPolicyBindings.get(normalizeAccountId(accountId)) ?? []).filter((binding) => binding.guildKey === guildKey);
568
+ function findDiscordGuildPolicyKey(accountId, guildId) {
569
+ return policyBindings.get(normalizeAccountId(accountId))?.guilds.get(guildId);
580
570
  }
581
571
  function getDiscordChannelPolicyBinding(accountId, guildKey, channelKey) {
582
- return listBindings(accountId, guildKey).find((binding) => binding.channelKey === channelKey)?.channelId;
572
+ return policyBindings.get(normalizeAccountId(accountId))?.channels.find((binding) => binding.guildKey === guildKey && binding.channelKey === channelKey)?.channelId;
583
573
  }
584
574
  function findDiscordChannelPolicyKey(accountId, guildKey, channelId) {
585
- return listBindings(accountId, guildKey).find((binding) => binding.channelId === channelId)?.channelKey;
575
+ return policyBindings.get(normalizeAccountId(accountId))?.channels.find((binding) => binding.guildKey === guildKey && binding.channelId === channelId)?.channelKey;
576
+ }
577
+ //#endregion
578
+ //#region extensions/discord/src/group-policy.ts
579
+ function resolveDiscordGuildKey(guilds, groupSpace, accountId) {
580
+ if (!guilds || Object.keys(guilds).length === 0) return;
581
+ const space = normalizeOptionalString(groupSpace) ?? "";
582
+ if (space && guilds[space]) return space;
583
+ const boundKey = findDiscordGuildPolicyKey(accountId, space);
584
+ if (boundKey !== void 0 && guilds[boundKey]) return boundKey;
585
+ const normalized = normalizeAtHashSlug(space);
586
+ if (normalized && guilds[normalized]) return normalized;
587
+ if (normalized) {
588
+ const match = Object.entries(guilds).find(([, entry]) => normalizeAtHashSlug(entry?.slug ?? void 0) === normalized);
589
+ if (match) return match[0];
590
+ }
591
+ return guilds["*"] ? "*" : void 0;
592
+ }
593
+ function resolveDiscordChannelKey(channelEntries, params) {
594
+ if (!channelEntries || Object.keys(channelEntries).length === 0) return;
595
+ const groupChannel = params.groupChannel;
596
+ const channelSlug = normalizeAtHashSlug(groupChannel);
597
+ if (params.groupId && channelEntries[params.groupId]) return params.groupId;
598
+ if (channelSlug && channelEntries[channelSlug]) return channelSlug;
599
+ if (channelSlug && channelEntries[`#${channelSlug}`]) return `#${channelSlug}`;
600
+ return groupChannel && channelEntries[channelSlug] ? channelSlug : void 0;
601
+ }
602
+ function resolveDiscordPolicyScope(params) {
603
+ const guilds = (params.accountId ? resolveDiscordAccountConfig(params.cfg, params.accountId)?.guilds : void 0) ?? params.cfg.channels?.discord?.guilds;
604
+ const guildKey = resolveDiscordGuildKey(guilds, params.groupSpace, params.accountId);
605
+ const guild = guildKey ? guilds?.[guildKey] : void 0;
606
+ if (!guildKey || !guild) return {
607
+ tree: { scopes: {} },
608
+ path: []
609
+ };
610
+ const channels = guild.channels;
611
+ let channelKey = resolveDiscordChannelKey(channels, params);
612
+ if (channelKey !== params.groupId) {
613
+ const boundKey = params.groupId ? findDiscordChannelPolicyKey(params.accountId, guildKey, params.groupId) : void 0;
614
+ if (boundKey !== void 0 && channels?.[boundKey]) channelKey = boundKey;
615
+ else if (channelKey !== void 0 && getDiscordChannelPolicyBinding(params.accountId, guildKey, channelKey) !== void 0) channelKey = void 0;
616
+ }
617
+ const channel = channelKey !== void 0 ? channels?.[channelKey] : void 0;
618
+ return {
619
+ tree: { scopes: {
620
+ guild,
621
+ ...channel ? { channel } : {}
622
+ } },
623
+ path: channel ? ["guild", "channel"] : ["guild"]
624
+ };
625
+ }
626
+ function resolveDiscordGroupRequireMention(params) {
627
+ return resolveScopeRequireMention(resolveDiscordPolicyScope(params));
628
+ }
629
+ function resolveDiscordGroupToolPolicy(params) {
630
+ const scope = resolveDiscordPolicyScope(params);
631
+ return resolveScopeToolsPolicy({
632
+ ...scope,
633
+ senderPolicyMode: params.senderPolicyMode,
634
+ senderId: params.senderId,
635
+ senderName: params.senderName,
636
+ senderUsername: params.senderUsername,
637
+ senderE164: params.senderE164
638
+ });
586
639
  }
587
640
  //#endregion
588
641
  //#region extensions/discord/src/approval-message-safety.ts
@@ -617,14 +670,14 @@ function escapeDiscordApprovalDisplayCharacter(character) {
617
670
  return DISCORD_MARKDOWN_META_CHARACTERS.has(character) ? `\\${character}` : character;
618
671
  }
619
672
  /** Keep opaque approval metadata bounded, single-line, and inert in Discord Markdown. */
620
- function formatDiscordApprovalDisplayValue(value, maxChars = 200) {
621
- const limit = Number.isFinite(maxChars) ? Math.max(0, Math.trunc(maxChars)) : 200;
673
+ function formatDiscordApprovalDisplayValue(value) {
674
+ const limit = 200;
622
675
  let escaped = "";
623
676
  let bounded = "";
624
677
  for (const character of value) {
625
678
  escaped += escapeDiscordApprovalDisplayCharacter(character);
626
- if (escaped.length <= limit - 3) bounded = escaped;
627
- if (escaped.length > limit) return limit <= 3 ? ".".repeat(limit) : `${bounded}...`;
679
+ if (escaped.length <= 197) bounded = escaped;
680
+ if (escaped.length > limit) return `${bounded}...`;
628
681
  }
629
682
  return escaped;
630
683
  }
@@ -659,8 +712,8 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
659
712
  }
660
713
  }
661
714
  };
662
- const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-CWZUuGvA.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
663
- const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-Du9NhD8h.mjs").then((n) => n.a));
715
+ const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-C8YXdnO_.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
716
+ const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./shared-interactive-DmzaoKOM.mjs").then((n) => n.r));
664
717
  function addPayloadTextFallback(spec, payload) {
665
718
  return spec.text ? spec : {
666
719
  ...spec,
@@ -757,4 +810,4 @@ function resolveDiscordOutboundTargetKindHint(params) {
757
810
  return /^(user:|discord:|@|<@!?)/i.test(params.target.trim()) ? "user" : "channel";
758
811
  }
759
812
  //#endregion
760
- export { isDiscordExecApprovalClientEnabled as A, discordInboundEventDelivery as C, resolveRequiredDiscordChannelPermissions as D, collectDiscordAuditChannelIdsForAccount as E, getDiscordExecApprovalApprovers as O, isTrustedRequesterGuildAdminAction as S, auditDiscordChannelPermissionsWithFetcher as T, shouldIgnoreStaleDiscordRouteBinding as _, resolveDiscordComponentSpec as a, resolveDiscordRuntimeBindingConversationId as b, formatDiscordApprovalDisplayValue as c, setDiscordChannelPolicyBindings as d, buildDiscordConversationRouteContext as f, resolveDiscordEffectiveRoute as g, resolveDiscordConversationRoute as h, isDiscordComponentSpecWithinMessageLimit as i, shouldSuppressLocalDiscordExecApprovalPrompt as j, isDiscordExecApprovalApprover as k, findDiscordChannelPolicyKey as l, resolveDiscordBoundConversationRoute as m, DISCORD_PRESENTATION_CAPABILITIES as n, sendDiscordComponentMessageLazy as o, buildDiscordRoutePeer as p, buildDiscordPresentationPayload as r, DISCORD_APPROVAL_ALLOWED_MENTIONS as s, resolveDiscordOutboundSessionRoute as t, getDiscordChannelPolicyBinding as u, resolveDiscordConversationIdentity as v, notifyDiscordInboundEventOutboundPayloadSuccess as w, discordMessageActions as x, resolveDiscordCurrentConversationIdentity as y };
813
+ export { shouldSuppressLocalDiscordExecApprovalPrompt as A, notifyDiscordInboundEventOutboundPayloadSuccess as C, getDiscordExecApprovalApprovers as D, resolveRequiredDiscordChannelPermissions as E, isDiscordExecApprovalApprover as O, discordInboundEventDelivery as S, collectDiscordAuditChannelIdsForAccount as T, resolveDiscordConversationIdentity as _, resolveDiscordComponentSpec as a, discordMessageActions as b, formatDiscordApprovalDisplayValue as c, setDiscordPolicyBindings as d, buildDiscordConversationRouteContext as f, shouldIgnoreStaleDiscordRouteBinding as g, resolveDiscordEffectiveRoute as h, isDiscordComponentSpecWithinMessageLimit as i, isDiscordExecApprovalClientEnabled as k, resolveDiscordGroupRequireMention as l, resolveDiscordConversationRoute as m, DISCORD_PRESENTATION_CAPABILITIES as n, sendDiscordComponentMessageLazy as o, buildDiscordRoutePeer as p, buildDiscordPresentationPayload as r, DISCORD_APPROVAL_ALLOWED_MENTIONS as s, resolveDiscordOutboundSessionRoute as t, resolveDiscordGroupToolPolicy as u, resolveDiscordCurrentConversationIdentity as v, auditDiscordChannelPermissionsWithFetcher as w, isTrustedRequesterGuildAdminAction as x, resolveDiscordRuntimeBindingConversationId as y };
@@ -33,10 +33,7 @@ async function resolveDiscordPreflightAudioMentionContext(params) {
33
33
  const needsPreflightTranscription = hasAudioAttachment && !hasTypedText && (params.isDirectMessage || params.shouldRequireMention && params.mentionRegexes.length > 0);
34
34
  let transcript;
35
35
  if (needsPreflightTranscription) {
36
- if (params.abortSignal?.aborted) return {
37
- hasAudioAttachment,
38
- hasTypedText
39
- };
36
+ if (params.abortSignal?.aborted) return { hasTypedText };
40
37
  const media = audioAttachments.flatMap((attachment) => {
41
38
  const url = normalizeOptionalString(attachment.url);
42
39
  return url ? [{
@@ -54,7 +51,6 @@ async function resolveDiscordPreflightAudioMentionContext(params) {
54
51
  });
55
52
  }
56
53
  return {
57
- hasAudioAttachment,
58
54
  hasTypedText,
59
55
  transcript
60
56
  };
@@ -27,10 +27,5 @@ function clearPresences(accountId) {
27
27
  }
28
28
  presenceCache.clear();
29
29
  }
30
- function presenceCacheSize() {
31
- let total = 0;
32
- for (const accountCache of presenceCache.values()) total += accountCache.size;
33
- return total;
34
- }
35
30
  //#endregion
36
- export { setPresence as i, getPresence as n, presenceCacheSize as r, clearPresences as t };
31
+ export { getPresence as n, setPresence as r, clearPresences as t };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
- import { h as normalizeDiscordToken } from "./accounts-ljrzXBJi.mjs";
3
- import { D as getDiscordEndpointRuntime } from "./allow-list-BKqOldGy.mjs";
4
- import { n as DiscordApiError, r as fetchDiscord } from "./api-DqmMUZau.mjs";
2
+ import { h as normalizeDiscordToken } from "./accounts-C_25wyxC.mjs";
3
+ import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-lf4DeLas.mjs";
4
+ import { n as DiscordApiError, r as fetchDiscord } from "./api-BlBD4ism.mjs";
5
5
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
6
6
  import { ApplicationFlags } from "discord-api-types/v10";
7
7
  import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
@@ -122,12 +122,8 @@ function parseApplicationIdFromToken(token) {
122
122
  if (!normalized) return;
123
123
  const firstDot = normalized.indexOf(".");
124
124
  if (firstDot <= 0) return;
125
- try {
126
- const decoded = Buffer.from(normalized.slice(0, firstDot), "base64").toString("utf-8");
127
- return /^\d+$/.test(decoded) ? decoded : void 0;
128
- } catch {
129
- return;
130
- }
125
+ const decoded = Buffer.from(normalized.slice(0, firstDot), "base64").toString("utf-8");
126
+ return /^\d+$/.test(decoded) ? decoded : void 0;
131
127
  }
132
128
  async function probeDiscordApplicationId(token, timeoutMs, fetcher = fetch) {
133
129
  const normalized = normalizeDiscordToken(token, "channels.discord.token");