@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,16 +1,16 @@
1
- import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-ljrzXBJi.mjs";
2
- import { G as withDiscordRequestAuthority } from "./discord-BMD-JiVS.mjs";
3
- import { d as normalizeDiscordMessagingTarget, l as looksLikeDiscordTargetId, u as matchesDiscordToolContextTarget } from "./send.receipt-C18khRYH.mjs";
1
+ import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
2
+ import { q as withDiscordRequestAuthority } from "./discord-DGVSguhx.mjs";
3
+ import { c as normalizeDiscordMessagingTarget, o as looksLikeDiscordTargetId, s as matchesDiscordToolContextTarget } from "./send.receipt-NZDOTZBU.mjs";
4
4
  import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
5
- import { l as withAbortTimeout } from "./timeouts-CuNARfyw.mjs";
5
+ import { l as withAbortTimeout } from "./timeouts-cIxzatmv.mjs";
6
6
  import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
7
- import { A as isDiscordExecApprovalClientEnabled, D as resolveRequiredDiscordChannelPermissions, O as getDiscordExecApprovalApprovers, b as resolveDiscordRuntimeBindingConversationId, h as resolveDiscordConversationRoute, j as shouldSuppressLocalDiscordExecApprovalPrompt, k as isDiscordExecApprovalApprover, l as findDiscordChannelPolicyKey, t as resolveDiscordOutboundSessionRoute, u as getDiscordChannelPolicyBinding, x as discordMessageActions } from "./outbound-session-route-BtUpGBTb.mjs";
8
- import { a as normalizeDiscordAcpConversationId, c as resolveDiscordInboundConversation, i as matchDiscordAcpConversation, n as discordOutbound, o as resolveDiscordAttachedOutboundTarget, r as buildDiscordCrossContextPresentation, s as resolveDiscordCommandConversation } from "./outbound-adapter-DfAanoCO.mjs";
7
+ import { A as shouldSuppressLocalDiscordExecApprovalPrompt, D as getDiscordExecApprovalApprovers, E as resolveRequiredDiscordChannelPermissions, O as isDiscordExecApprovalApprover, b as discordMessageActions, k as isDiscordExecApprovalClientEnabled, l as resolveDiscordGroupRequireMention, m as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, u as resolveDiscordGroupToolPolicy, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-Cgx4i9cS.mjs";
8
+ import { a as resolveDiscordInboundConversation, i as resolveDiscordCommandConversation, n as discordOutbound, r as resolveDiscordAttachedOutboundTarget } from "./outbound-payload-BaZmjewa.mjs";
9
9
  import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.mjs";
10
- import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-8Ul1KpGF.mjs";
11
- import { a as discordSecurityAdapter, i as discordSetupContract, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-CY5vJM48.mjs";
10
+ import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-kCTw8cij.mjs";
11
+ import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupContract, t as createDiscordPluginBase } from "./shared-yDUSExm2.mjs";
12
12
  import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-CCHGNSQw.mjs";
13
- import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-BMdJeJMc.mjs";
13
+ import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-D0j7oh8S.mjs";
14
14
  import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.mjs";
15
15
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
16
16
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
@@ -21,19 +21,17 @@ import { asFiniteNumber, normalizeLowercaseStringOrEmpty, normalizeOptionalStrin
21
21
  import { createRuntimeConfigReader } from "openclaw/plugin-sdk/runtime-config-snapshot";
22
22
  import { createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
23
23
  import { resolveDefaultGroupPolicy, resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
24
- import { normalizeAtHashSlug } from "openclaw/plugin-sdk/string-normalization-runtime";
25
24
  import { buildLegacyDmAccountAllowlistAdapter, createAccountScopedAllowlistNameResolver, createNestedAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
26
25
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
27
26
  import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
28
27
  import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter } from "openclaw/plugin-sdk/directory-runtime";
29
28
  import { appendMatchMetadata, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord as isRecord$1, readAccountStatusSnapshot, resolveEnabledConfiguredAccountId } from "openclaw/plugin-sdk/status-helpers";
30
29
  import { resolveTargetsWithOptionalToken } from "openclaw/plugin-sdk/target-resolver-runtime";
31
- import { createApproverRestrictedNativeApprovalCapability } from "openclaw/plugin-sdk/approval-delivery-runtime";
30
+ import { createApproverRestrictedNativeApprovalCapabilityAsync } from "openclaw/plugin-sdk/approval-delivery-runtime";
32
31
  import { createLazyChannelApprovalNativeRuntimeAdapterAsync } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
33
32
  import { createChannelApproverDmTargetResolverAsync, createChannelNativeOriginTargetResolverAsync, doesApprovalRequestSelectChannelAccountAsync, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
34
33
  import { isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
35
34
  import { resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
36
- import { resolveScopeRequireMention, resolveScopeToolsPolicy, scopeKey } from "openclaw/plugin-sdk/channel-policy";
37
35
  //#region extensions/discord/src/approval-shared.ts
38
36
  function isDiscordApprovalAccountEligible(params) {
39
37
  const account = resolveDiscordAccount(params);
@@ -116,8 +114,8 @@ function createDiscordOriginTargetResolver() {
116
114
  resolveFallbackTarget: (request) => resolveSessionOrigin(request)
117
115
  });
118
116
  }
119
- function createDiscordApprovalCapability() {
120
- return createApproverRestrictedNativeApprovalCapability({
117
+ function getDiscordApprovalCapability() {
118
+ return createApproverRestrictedNativeApprovalCapabilityAsync({
121
119
  channel: "discord",
122
120
  channelLabel: "Discord",
123
121
  describeExecApprovalSetup: ({ accountId }) => {
@@ -134,7 +132,7 @@ function createDiscordApprovalCapability() {
134
132
  accountId,
135
133
  senderId
136
134
  }),
137
- isNativeDeliveryEnabled: ({ cfg, accountId }) => isDiscordExecApprovalClientEnabled({
135
+ isNativeDeliveryEnabled: async ({ cfg, accountId }) => isDiscordExecApprovalClientEnabled({
138
136
  cfg,
139
137
  accountId
140
138
  }),
@@ -164,100 +162,93 @@ function createDiscordApprovalCapability() {
164
162
  accountId
165
163
  }),
166
164
  shouldHandle: shouldHandleDiscordApprovalRequest,
167
- load: async () => (await import("./approval-handler.runtime-D0qu1um7.mjs")).discordApprovalNativeRuntime
165
+ load: async () => (await import("./approval-handler.runtime-BGYjX1t9.mjs")).discordApprovalNativeRuntime
168
166
  })
169
167
  });
170
168
  }
171
- let cachedDiscordApprovalCapability;
172
- function getDiscordApprovalCapability() {
173
- cachedDiscordApprovalCapability ??= createDiscordApprovalCapability();
174
- return cachedDiscordApprovalCapability;
175
- }
176
169
  //#endregion
177
170
  //#region extensions/discord/src/channel.loaders.ts
178
- const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-3iVub-3m.mjs").then((n) => n.t));
179
- const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-Cj5i7hzj.mjs").then((n) => n.n));
180
- const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-BQLbysRB.mjs").then((n) => n.n));
181
- const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-5Sh7yedN.mjs").then((n) => n.r));
182
- const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-CApivu3G.mjs").then((n) => n.r));
183
- const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-DnionCyo.mjs"));
184
- const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-CBaoCs-c.mjs").then((n) => n.o));
171
+ const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-Ble81PWH.mjs").then((n) => n.t));
172
+ const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-Bp8frXvc.mjs").then((n) => n.n));
173
+ const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-Cvcj22sG.mjs").then((n) => n.n));
174
+ const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-NywKzUtc.mjs").then((n) => n.r));
175
+ const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BOOzqxxM.mjs").then((n) => n.r));
176
+ const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-BuJpl0Pv.mjs"));
177
+ const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-DezB-6xz.mjs").then((n) => n.o));
185
178
  async function probeDiscordStatusAccount(params) {
186
179
  const startedAtMs = Date.now();
187
180
  const runtime = await loadDiscordProbeRuntime();
188
181
  const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
189
182
  return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
190
183
  }
191
- const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-ChorIwio.mjs").then((n) => n.n));
192
- const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-da6ENJ9f.mjs").then((n) => n.t));
193
- const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-BDVl2DoC.mjs").then((n) => n.t));
184
+ const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-5b-FXj9R.mjs").then((n) => n.n));
185
+ const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-CVW7V-VZ.mjs").then((n) => n.t));
186
+ const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-DH3tpS3x.mjs").then((n) => n.t));
194
187
  //#endregion
195
188
  //#region extensions/discord/src/conversation-route-owner.ts
196
- function prepareDiscordConversationRouteOwner(params) {
197
- const accountId = normalizeAccountId(params.accountId);
198
- if (params.cfg.channels?.discord?.enabled === false || !listDiscordAccountIds(params.cfg).some((id) => normalizeAccountId(id) === accountId) || resolveDiscordAccountConfig(params.cfg, accountId)?.enabled === false) return null;
199
- const direct = params.conversation.kind === "direct";
200
- const nativeConversationId = params.conversation.nativeChannelId ?? params.conversation.peerId;
201
- const threadConversationId = direct ? void 0 : params.conversation.threadId;
202
- const runtimeConversationId = threadConversationId ?? resolveDiscordRuntimeBindingConversationId({
203
- isDirectMessage: direct,
204
- isGroupDm: params.conversation.kind === "group",
205
- userId: direct ? params.conversation.peerId : void 0,
206
- channelId: nativeConversationId
207
- });
208
- const route = ({ boundAgentId }) => resolveDiscordConversationRoute({
209
- cfg: params.cfg,
210
- defaultAgentId: boundAgentId,
211
- accountId,
212
- guildId: params.conversation.context?.guildId,
213
- memberRoleIds: params.conversation.context?.memberRoleIds,
214
- peer: {
215
- kind: params.conversation.kind,
216
- id: params.conversation.peerId
217
- },
218
- parentConversationId: params.conversation.context?.parentPeerId
219
- });
220
- const input = {
221
- cfg: params.cfg,
222
- resolveRoute: route,
223
- accountId,
224
- runtimeConversationId,
225
- configuredConversationId: threadConversationId ?? nativeConversationId,
226
- parentConversationId: params.conversation.context?.parentPeerId,
227
- touchBinding: false
228
- };
229
- return {
230
- conversation: {
231
- channel: "discord",
189
+ async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBindings) {
190
+ const prepared = inputs.map((params) => {
191
+ const accountId = normalizeAccountId(params.accountId);
192
+ if (params.cfg.channels?.discord?.enabled === false || !listDiscordAccountIds(params.cfg).some((id) => normalizeAccountId(id) === accountId) || resolveDiscordAccountConfig(params.cfg, accountId)?.enabled === false) return null;
193
+ const direct = params.conversation.kind === "direct";
194
+ const nativeConversationId = params.conversation.nativeChannelId ?? params.conversation.peerId;
195
+ const threadConversationId = direct ? void 0 : params.conversation.threadId;
196
+ const runtimeConversationId = threadConversationId ?? resolveDiscordRuntimeBindingConversationId({
197
+ isDirectMessage: direct,
198
+ isGroupDm: params.conversation.kind === "group",
199
+ userId: direct ? params.conversation.peerId : void 0,
200
+ channelId: nativeConversationId
201
+ });
202
+ const route = ({ boundAgentId }) => resolveDiscordConversationRoute({
203
+ cfg: params.cfg,
204
+ defaultAgentId: boundAgentId,
232
205
  accountId,
233
- conversationId: runtimeConversationId,
206
+ guildId: params.conversation.context?.guildId,
207
+ memberRoleIds: params.conversation.context?.memberRoleIds,
208
+ peer: {
209
+ kind: params.conversation.kind,
210
+ id: params.conversation.peerId
211
+ },
234
212
  parentConversationId: params.conversation.context?.parentPeerId
235
- },
236
- resolve(inspection) {
237
- const { runtimeRoute, configuredRoute } = resolveDiscordConversationBindingRoute({
238
- ...input,
239
- inspection
240
- });
241
- if (!runtimeRoute.bindingOwnerAvailable && resolveThreadBindingSpawnPolicy({
242
- cfg: params.cfg,
213
+ });
214
+ const input = {
215
+ cfg: params.cfg,
216
+ resolveRoute: route,
217
+ accountId,
218
+ runtimeConversationId,
219
+ configuredConversationId: threadConversationId ?? nativeConversationId,
220
+ parentConversationId: params.conversation.context?.parentPeerId
221
+ };
222
+ return {
223
+ conversation: {
243
224
  channel: "discord",
244
225
  accountId,
245
- kind: "subagent"
246
- }).enabled) return { kind: "unavailable" };
247
- if (runtimeRoute.pluginId) return {
248
- kind: "plugin",
249
- pluginId: runtimeRoute.pluginId,
250
- fallbackAgentId: runtimeRoute.route.agentId
251
- };
252
- return {
253
- kind: "agent",
254
- agentId: runtimeRoute.boundAgentId ?? configuredRoute?.boundAgentId ?? runtimeRoute.route.agentId
255
- };
256
- }
257
- };
258
- }
259
- async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBindings) {
260
- const prepared = inputs.map(prepareDiscordConversationRouteOwner);
226
+ conversationId: runtimeConversationId,
227
+ parentConversationId: params.conversation.context?.parentPeerId
228
+ },
229
+ resolve(inspection) {
230
+ const { runtimeRoute, configuredRoute } = resolveDiscordConversationBindingRoute({
231
+ ...input,
232
+ inspection
233
+ });
234
+ if (!runtimeRoute.bindingOwnerAvailable && resolveThreadBindingSpawnPolicy({
235
+ cfg: params.cfg,
236
+ channel: "discord",
237
+ accountId,
238
+ kind: "subagent"
239
+ }).enabled) return { kind: "unavailable" };
240
+ if (runtimeRoute.pluginId) return {
241
+ kind: "plugin",
242
+ pluginId: runtimeRoute.pluginId,
243
+ fallbackAgentId: runtimeRoute.route.agentId
244
+ };
245
+ return {
246
+ kind: "agent",
247
+ agentId: runtimeRoute.boundAgentId ?? configuredRoute?.boundAgentId ?? runtimeRoute.route.agentId
248
+ };
249
+ }
250
+ };
251
+ });
261
252
  const inspect = await inspectBindings(prepared.flatMap((item) => item ? [item.conversation] : []));
262
253
  let index = 0;
263
254
  return prepared.map((item) => {
@@ -267,69 +258,6 @@ async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBinding
267
258
  });
268
259
  }
269
260
  //#endregion
270
- //#region extensions/discord/src/group-policy.ts
271
- const guildScopeKey = (guildKey) => scopeKey(["guild", guildKey]);
272
- const channelScopeKey = (guildKey, channelKey) => scopeKey(["guild", guildKey], ["channel", channelKey]);
273
- function resolveDiscordGuildKey(guilds, groupSpace) {
274
- if (!guilds || Object.keys(guilds).length === 0) return;
275
- const space = normalizeOptionalString(groupSpace) ?? "";
276
- if (space && guilds[space]) return space;
277
- const normalized = normalizeAtHashSlug(space);
278
- if (normalized && guilds[normalized]) return normalized;
279
- if (normalized) {
280
- const match = Object.entries(guilds).find(([, entry]) => normalizeAtHashSlug(entry?.slug ?? void 0) === normalized);
281
- if (match) return match[0];
282
- }
283
- return guilds["*"] ? "*" : void 0;
284
- }
285
- function resolveDiscordChannelKey(channelEntries, params) {
286
- if (!channelEntries || Object.keys(channelEntries).length === 0) return;
287
- const groupChannel = params.groupChannel;
288
- const channelSlug = normalizeAtHashSlug(groupChannel);
289
- if (params.groupId && channelEntries[params.groupId]) return params.groupId;
290
- if (channelSlug && channelEntries[channelSlug]) return channelSlug;
291
- if (channelSlug && channelEntries[`#${channelSlug}`]) return `#${channelSlug}`;
292
- return groupChannel && channelEntries[channelSlug] ? channelSlug : void 0;
293
- }
294
- function resolveDiscordPolicyScope(params) {
295
- const guilds = (params.accountId ? params.cfg.channels?.discord?.accounts?.[params.accountId]?.guilds : void 0) ?? params.cfg.channels?.discord?.guilds;
296
- const tree = { scopes: {} };
297
- for (const [guildKey, guild] of Object.entries(guilds ?? {})) {
298
- tree.scopes[guildScopeKey(guildKey)] = guild;
299
- for (const [channelKey, channel] of Object.entries(guild.channels ?? {})) tree.scopes[channelScopeKey(guildKey, channelKey)] = channel;
300
- }
301
- const guildKey = resolveDiscordGuildKey(guilds, params.groupSpace);
302
- if (!guildKey) return {
303
- tree,
304
- path: []
305
- };
306
- const channels = guilds?.[guildKey]?.channels;
307
- let channelKey = resolveDiscordChannelKey(channels, params);
308
- if (channelKey !== params.groupId) {
309
- const boundKey = params.groupId ? findDiscordChannelPolicyKey(params.accountId, guildKey, params.groupId) : void 0;
310
- if (boundKey !== void 0 && channels?.[boundKey]) channelKey = boundKey;
311
- else if (channelKey !== void 0 && getDiscordChannelPolicyBinding(params.accountId, guildKey, channelKey) !== void 0) channelKey = void 0;
312
- }
313
- return {
314
- tree,
315
- path: [guildScopeKey(guildKey), ...channelKey !== void 0 ? [channelScopeKey(guildKey, channelKey)] : []]
316
- };
317
- }
318
- function resolveDiscordGroupRequireMention(params) {
319
- return resolveScopeRequireMention(resolveDiscordPolicyScope(params));
320
- }
321
- function resolveDiscordGroupToolPolicy(params) {
322
- const scope = resolveDiscordPolicyScope(params);
323
- return resolveScopeToolsPolicy({
324
- ...scope,
325
- senderPolicyMode: params.senderPolicyMode,
326
- senderId: params.senderId,
327
- senderName: params.senderName,
328
- senderUsername: params.senderUsername,
329
- senderE164: params.senderE164
330
- });
331
- }
332
- //#endregion
333
261
  //#region extensions/discord/src/status-issues.ts
334
262
  function isDiscordMessageContentIntentDisabled(value) {
335
263
  return isRecord$1(value) && isRecord$1(value.intents) && value.intents.messageContent === "disabled";
@@ -367,43 +295,23 @@ function collectDiscordStatusIssues(accounts) {
367
295
  if (!account) continue;
368
296
  const accountId = resolveEnabledConfiguredAccountId(account);
369
297
  if (!accountId) continue;
370
- const scope = {
298
+ const addIssue = (kind, message, fix) => issues.push({
371
299
  channel: "discord",
372
- accountId
373
- };
374
- if (account.groupPolicy === "allowlist" && account.guildsConfigured === 0) {
375
- const guildGuidance = accountId === "default" ? "Add your server under channels.discord.guilds. If channels.discord.accounts.default.guilds is set, add it there instead." : `Add your server under channels.discord.accounts.${accountId}.guilds.`;
376
- issues.push({
377
- ...scope,
378
- kind: "config",
379
- message: "Discord guild messages are blocked: effective groupPolicy is \"allowlist\", but no guilds are configured.",
380
- fix: `${guildGuidance} Refresh channel status after the configuration reload applies.`
381
- });
382
- }
383
- if (isDiscordMessageContentIntentDisabled(account.application)) issues.push({
384
- ...scope,
385
- kind: "intent",
386
- message: "Message Content Intent is disabled. Bot may not see normal channel messages.",
387
- fix: "Enable Message Content Intent in Discord Dev Portal → Bot → Privileged Gateway Intents, or require mention-only operation."
300
+ accountId,
301
+ kind,
302
+ message,
303
+ fix
388
304
  });
305
+ if (account.groupPolicy === "allowlist" && account.guildsConfigured === 0) addIssue("config", "Discord guild messages are blocked: effective groupPolicy is \"allowlist\", but no guilds are configured.", `${accountId === "default" ? "Add your server under channels.discord.guilds. If channels.discord.accounts.default.guilds is set, add it there instead." : `Add your server under channels.discord.accounts.${accountId}.guilds.`} Refresh channel status after the configuration reload applies.`);
306
+ if (isDiscordMessageContentIntentDisabled(account.application)) addIssue("intent", "Message Content Intent is disabled. Bot may not see normal channel messages.", "Enable Message Content Intent in Discord Dev Portal → Bot → Privileged Gateway Intents, or require mention-only operation.");
389
307
  const audit = readDiscordPermissionsAuditSummary(account.audit);
390
- if (audit.unresolvedChannels && audit.unresolvedChannels > 0) issues.push({
391
- ...scope,
392
- kind: "config",
393
- message: `Some configured guild channels are not numeric IDs (unresolvedChannels=${audit.unresolvedChannels}). Permission audit can only check numeric channel IDs.`,
394
- fix: "Use numeric channel IDs as keys in channels.discord.guilds.*.channels (then rerun channels status --probe)."
395
- });
308
+ if (audit.unresolvedChannels && audit.unresolvedChannels > 0) addIssue("config", `Some configured guild channels are not numeric IDs (unresolvedChannels=${audit.unresolvedChannels}). Permission audit can only check numeric channel IDs.`, "Use numeric channel IDs as keys in channels.discord.guilds.*.channels (then rerun channels status --probe).");
396
309
  for (const channel of audit.channels ?? []) {
397
310
  if (channel.ok === true) continue;
398
311
  const missing = channel.missing?.length ? ` missing ${channel.missing.join(", ")}` : "";
399
312
  const error = channel.error ? `: ${channel.error}` : "";
400
313
  const baseMessage = `Channel ${channel.channelId} permission check failed.${missing}${error}`;
401
- issues.push({
402
- ...scope,
403
- kind: "permissions",
404
- message: appendMatchMetadata(baseMessage, channel),
405
- fix: "Check that the bot role can view + send in this channel (and that channel overrides don't deny it)."
406
- });
314
+ addIssue("permissions", appendMatchMetadata(baseMessage, channel), "Check that the bot role can view + send in this channel (and that channel overrides don't deny it).");
407
315
  }
408
316
  }
409
317
  return issues;
@@ -413,9 +321,9 @@ function collectDiscordStatusIssues(accounts) {
413
321
  function toConversationLifecycleBinding(binding) {
414
322
  return {
415
323
  boundAt: binding.boundAt,
416
- lastActivityAt: typeof binding.lastActivityAt === "number" ? binding.lastActivityAt : binding.boundAt,
417
- idleTimeoutMs: typeof binding.idleTimeoutMs === "number" ? binding.idleTimeoutMs : void 0,
418
- maxAgeMs: typeof binding.maxAgeMs === "number" ? binding.maxAgeMs : void 0
324
+ lastActivityAt: binding.lastActivityAt ?? binding.boundAt,
325
+ idleTimeoutMs: binding.idleTimeoutMs,
326
+ maxAgeMs: binding.maxAgeMs
419
327
  };
420
328
  }
421
329
  const discordConversationBindings = {
@@ -523,11 +431,14 @@ const discordPlugin = createChatChannelPlugin({
523
431
  resolveToolPolicy: resolveDiscordGroupToolPolicy
524
432
  },
525
433
  mentions: { stripPatterns: () => ["<@!?\\d+>"] },
526
- agentPrompt: { messageToolHints: () => [
527
- "- Discord mentions: use supported mention syntax: users `<@USER_ID>`, channels `<#CHANNEL_ID>`, and roles `<@&ROLE_ID>`. Plain `@name` text only pings when a configured `mentionAliases` entry rewrites it; do not use the legacy `<@!USER_ID>` nickname form.",
528
- "- Discord components: set `components` when sending messages to include buttons, selects, or v2 containers.",
529
- "- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages."
530
- ] },
434
+ agentPrompt: {
435
+ questionInputMode: "buttons",
436
+ messageToolHints: () => [
437
+ "- Discord mentions: use supported mention syntax: users `<@USER_ID>`, channels `<#CHANNEL_ID>`, and roles `<@&ROLE_ID>`. Plain `@name` text only pings when a configured `mentionAliases` entry rewrites it; do not use the legacy `<@!USER_ID>` nickname form.",
438
+ "- Discord components: set `components` when sending messages to include buttons, selects, or v2 containers.",
439
+ "- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages."
440
+ ]
441
+ },
531
442
  messaging: {
532
443
  directTargetStyle: discordPluginBase.messaging?.directTargetStyle,
533
444
  inferTargetChatType: discordPluginBase.messaging?.inferTargetChatType,
@@ -538,7 +449,18 @@ const discordPlugin = createChatChannelPlugin({
538
449
  resolveInboundConversation: resolveDiscordInboundConversation,
539
450
  normalizeExplicitSessionKey: ({ sessionKey, ctx }) => normalizeExplicitDiscordSessionKey(sessionKey, ctx),
540
451
  resolveSessionTarget: ({ id }) => normalizeDiscordMessagingTarget(`channel:${id}`),
541
- buildCrossContextPresentation: buildDiscordCrossContextPresentation,
452
+ buildCrossContextPresentation: ({ originLabel, message }) => {
453
+ return {
454
+ tone: "neutral",
455
+ blocks: [...message.trim() ? [{
456
+ type: "text",
457
+ text: message
458
+ }, { type: "divider" }] : [], {
459
+ type: "context",
460
+ text: `From ${originLabel}`
461
+ }]
462
+ };
463
+ },
542
464
  resolveOutboundSessionRoute: resolveDiscordOutboundSessionRoute,
543
465
  targetResolver: {
544
466
  looksLikeId: looksLikeDiscordTargetId,
@@ -611,12 +533,22 @@ const discordPlugin = createChatChannelPlugin({
611
533
  } },
612
534
  actions: discordMessageActions,
613
535
  bindings: {
614
- compileConfiguredBinding: ({ conversationId }) => normalizeDiscordAcpConversationId(conversationId),
615
- matchInboundConversation: ({ compiledBinding, conversationId, parentConversationId }) => matchDiscordAcpConversation({
616
- bindingConversationId: compiledBinding.conversationId,
617
- conversationId,
618
- parentConversationId
619
- }),
536
+ compileConfiguredBinding: ({ conversationId }) => {
537
+ const normalized = conversationId.trim();
538
+ return normalized ? { conversationId: normalized } : null;
539
+ },
540
+ matchInboundConversation: ({ compiledBinding, conversationId, parentConversationId }) => {
541
+ const bindingConversationId = compiledBinding.conversationId;
542
+ if (bindingConversationId === conversationId) return {
543
+ conversationId,
544
+ matchPriority: 2
545
+ };
546
+ if (parentConversationId && parentConversationId !== conversationId && bindingConversationId === parentConversationId) return {
547
+ conversationId: parentConversationId,
548
+ matchPriority: 1
549
+ };
550
+ return null;
551
+ },
620
552
  resolveCommandConversation: resolveDiscordCommandConversation
621
553
  },
622
554
  conversationBindings: discordConversationBindings,
@@ -658,7 +590,7 @@ const discordPlugin = createChatChannelPlugin({
658
590
  },
659
591
  buildCapabilitiesDiagnostics: async ({ account, target, timeoutMs }) => {
660
592
  if (!target?.trim()) return;
661
- const parsedTarget = parseDiscordTarget(target.trim(), { defaultKind: "channel" });
593
+ const parsedTarget = parseDiscordTarget(target, { defaultKind: "channel" });
662
594
  const details = { target: {
663
595
  raw: target,
664
596
  normalized: parsedTarget?.normalized,
@@ -826,7 +758,7 @@ const discordPlugin = createChatChannelPlugin({
826
758
  } catch (error) {
827
759
  ctx.log?.warn?.(`[${account.accountId}] Discord command deploy cache unavailable; continuing without persistence: ${formatErrorMessage(error)}`);
828
760
  }
829
- return (await loadDiscordProviderRuntime()).monitorDiscordProvider({
761
+ await (await loadDiscordProviderRuntime()).monitorDiscordProvider({
830
762
  scheduler: ctx.scheduler,
831
763
  token,
832
764
  accountId: account.accountId,
@@ -894,4 +826,4 @@ const discordPlugin = createChatChannelPlugin({
894
826
  }
895
827
  });
896
828
  //#endregion
897
- export { shouldHandleDiscordApprovalRequest as a, resolveDiscordGroupToolPolicy as i, collectDiscordStatusIssues as n, resolveDiscordGroupRequireMention as r, discordPlugin as t };
829
+ export { collectDiscordStatusIssues as n, shouldHandleDiscordApprovalRequest as r, discordPlugin as t };
@@ -0,0 +1,24 @@
1
+ import { asOptionalObjectRecord, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
2
+ //#region extensions/discord/src/monitor/channel-access.ts
3
+ function resolveDiscordChannelNameSafe(channel) {
4
+ return readStringField(asOptionalObjectRecord(channel), "name");
5
+ }
6
+ function resolveDiscordChannelTopicSafe(channel) {
7
+ return readStringField(asOptionalObjectRecord(channel), "topic");
8
+ }
9
+ function resolveDiscordChannelInfoSafe(channel) {
10
+ const record = asOptionalObjectRecord(channel);
11
+ const raw = asOptionalObjectRecord(record?.rawData);
12
+ const readAlias = (camel, snake) => readStringField(record, camel) ?? readStringField(record, snake) ?? readStringField(raw, snake);
13
+ return {
14
+ id: readStringField(record, "id"),
15
+ name: readStringField(record, "name"),
16
+ topic: readStringField(record, "topic"),
17
+ type: typeof record?.type === "number" ? record.type : void 0,
18
+ parentId: readAlias("parentId", "parent_id"),
19
+ ownerId: readAlias("ownerId", "owner_id"),
20
+ parentName: readStringField(asOptionalObjectRecord(record?.parent), "name")
21
+ };
22
+ }
23
+ //#endregion
24
+ export { resolveDiscordChannelNameSafe as n, resolveDiscordChannelTopicSafe as r, resolveDiscordChannelInfoSafe as t };