@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,25 +1,27 @@
1
- import { c as resolveDiscordAccount, i as listDiscordStartupAccountIds, l as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-HE9-mj1L.mjs";
2
- import { C as withDiscordRequestAuthority } from "./discord-9gysrhzp.mjs";
3
- import { d as normalizeDiscordMessagingTarget, l as looksLikeDiscordTargetId, p as parseDiscordTarget, u as matchesDiscordToolContextTarget } from "./send.receipt-DVOg2Oaw.mjs";
4
- import { l as withAbortTimeout } from "./timeouts-pun7VJ02.mjs";
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 { W as withDiscordRequestAuthority } from "./discord-BGqgx-yd.mjs";
3
+ import { d as normalizeDiscordMessagingTarget, l as looksLikeDiscordTargetId, u as matchesDiscordToolContextTarget } from "./send.receipt-BAlzXd8e.mjs";
4
+ import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
5
+ import { l as withAbortTimeout } from "./timeouts-CuNARfyw.mjs";
5
6
  import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
6
- import { D as isDiscordExecApprovalClientEnabled, E as isDiscordExecApprovalApprover, O as shouldSuppressLocalDiscordExecApprovalPrompt, T as getDiscordExecApprovalApprovers, _ as resolveDiscordRuntimeBindingConversationId, f as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, v as discordMessageActions, w as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-BvBH4LC6.mjs";
7
- 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-D4wRAb5S.mjs";
7
+ import { D as isDiscordExecApprovalClientEnabled, E as isDiscordExecApprovalApprover, O as shouldSuppressLocalDiscordExecApprovalPrompt, T as getDiscordExecApprovalApprovers, _ as resolveDiscordRuntimeBindingConversationId, f as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, v as discordMessageActions, w as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-B0Hpwn3Q.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-D8OOIuKn.mjs";
8
9
  import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.mjs";
9
- import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-DicJC1Lj.mjs";
10
- import { a as discordSecurityAdapter, i as discordSetupContract, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-BoBnM5kM.mjs";
10
+ import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-DTjCBx-O.mjs";
11
+ import { a as discordSecurityAdapter, i as discordSetupContract, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-CestGDpq.mjs";
11
12
  import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-CCHGNSQw.mjs";
12
- import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-Bu_CGr_O.mjs";
13
+ import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DGSljVf6.mjs";
13
14
  import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.mjs";
14
15
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
15
16
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
16
17
  import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
17
18
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
18
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
19
19
  import { PAIRING_APPROVED_MESSAGE, buildTokenChannelStatusSummary, projectCredentialSnapshotFields, resolveConfiguredFromCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
20
+ import { asFiniteNumber, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
20
21
  import { createRuntimeConfigReader } from "openclaw/plugin-sdk/runtime-config-snapshot";
21
22
  import { createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
22
23
  import { resolveDefaultGroupPolicy, resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
24
+ import { normalizeAtHashSlug } from "openclaw/plugin-sdk/string-normalization-runtime";
23
25
  import { buildLegacyDmAccountAllowlistAdapter, createAccountScopedAllowlistNameResolver, createNestedAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
24
26
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
25
27
  import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
@@ -32,7 +34,6 @@ import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetR
32
34
  import { isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
33
35
  import { resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
34
36
  import { resolveScopeRequireMention, resolveScopeToolsPolicy, scopeKey } from "openclaw/plugin-sdk/channel-policy";
35
- import { normalizeAtHashSlug } from "openclaw/plugin-sdk/string-normalization-runtime";
36
37
  //#region extensions/discord/src/approval-shared.ts
37
38
  function isDiscordApprovalAccountEligible(params) {
38
39
  const account = resolveDiscordAccount(params);
@@ -48,7 +49,7 @@ function isDiscordApprovalAccountEligible(params) {
48
49
  }
49
50
  function shouldHandleDiscordApprovalRequest(params) {
50
51
  const accountId = params.accountId ?? resolveDefaultDiscordAccountId(params.cfg);
51
- if (!doesApprovalRequestSelectChannelAccount({
52
+ return doesApprovalRequestSelectChannelAccount({
52
53
  ...params,
53
54
  channel: "discord",
54
55
  defaultAccountId: resolveDefaultDiscordAccountId(params.cfg),
@@ -56,23 +57,26 @@ function shouldHandleDiscordApprovalRequest(params) {
56
57
  ...params,
57
58
  accountId
58
59
  }) ? [accountId] : []
59
- })) return false;
60
- return isDiscordApprovalAccountEligible(params);
60
+ }) && isDiscordApprovalAccountEligible(params);
61
61
  }
62
62
  //#endregion
63
63
  //#region extensions/discord/src/approval-native.ts
64
+ function shouldHandleCapabilityRequest({ cfg, accountId, request }) {
65
+ return shouldHandleDiscordApprovalRequest({
66
+ cfg,
67
+ accountId,
68
+ request
69
+ });
70
+ }
64
71
  function extractDiscordSessionKind(sessionKey) {
65
72
  if (!sessionKey) return null;
66
- const match = sessionKey.match(/discord:(?:[^:]+:)?(channel|group|dm|direct):/);
67
- if (!match) return null;
68
- const raw = match[1];
73
+ const raw = sessionKey.match(/discord:(?:[^:]+:)?(channel|group|dm|direct):/)?.[1];
69
74
  if (raw === "direct") return "dm";
70
75
  return raw === "channel" || raw === "group" || raw === "dm" ? raw : null;
71
76
  }
72
77
  function normalizeDiscordOriginChannelId(value) {
73
78
  if (!value) return null;
74
79
  const trimmed = value.trim();
75
- if (!trimmed) return null;
76
80
  const prefixed = trimmed.match(/^(?:channel|group):(\d+)$/i);
77
81
  if (prefixed) return prefixed[1] ?? null;
78
82
  return /^\d+$/.test(trimmed) ? trimmed : null;
@@ -84,19 +88,25 @@ function normalizeDiscordThreadId(value) {
84
88
  return /^\d+$/.test(normalized) ? normalized : void 0;
85
89
  }
86
90
  function createDiscordOriginTargetResolver() {
91
+ const resolveConversation = (request) => resolveApprovalRequestSessionConversation({
92
+ request,
93
+ channel: "discord",
94
+ bundledFallback: false
95
+ });
96
+ const resolveSessionOrigin = (request, sessionTarget) => {
97
+ const sessionConversation = resolveConversation(request);
98
+ if (extractDiscordSessionKind(request.request.sessionKey?.trim() || null) === "dm") return null;
99
+ const to = normalizeDiscordOriginChannelId(sessionTarget ? sessionTarget.to : sessionConversation?.id);
100
+ return to ? {
101
+ to,
102
+ threadId: (sessionTarget ? normalizeDiscordThreadId(sessionTarget.threadId) : void 0) ?? normalizeDiscordThreadId(sessionConversation?.threadId)
103
+ } : null;
104
+ };
87
105
  return createChannelNativeOriginTargetResolver({
88
106
  channel: "discord",
89
- shouldHandleRequest: ({ cfg, accountId, request }) => shouldHandleDiscordApprovalRequest({
90
- cfg,
91
- accountId,
92
- request
93
- }),
107
+ shouldHandleRequest: shouldHandleCapabilityRequest,
94
108
  resolveTurnSourceTarget: (request) => {
95
- const sessionConversation = resolveApprovalRequestSessionConversation({
96
- request,
97
- channel: "discord",
98
- bundledFallback: false
99
- });
109
+ const sessionConversation = resolveConversation(request);
100
110
  const sessionKind = extractDiscordSessionKind(normalizeOptionalString(request.request.sessionKey) ?? null);
101
111
  const turnSourceChannel = normalizeLowercaseStringOrEmpty(request.request.turnSourceChannel);
102
112
  const rawTurnSourceTo = normalizeOptionalString(request.request.turnSourceTo) ?? "";
@@ -109,46 +119,8 @@ function createDiscordOriginTargetResolver() {
109
119
  threadId
110
120
  } : null;
111
121
  },
112
- resolveSessionTarget: (sessionTarget, request) => {
113
- const sessionConversation = resolveApprovalRequestSessionConversation({
114
- request,
115
- channel: "discord",
116
- bundledFallback: false
117
- });
118
- if (extractDiscordSessionKind(request.request.sessionKey?.trim() || null) === "dm") return null;
119
- const targetTo = normalizeDiscordOriginChannelId(sessionTarget.to);
120
- return targetTo ? {
121
- to: targetTo,
122
- threadId: normalizeDiscordThreadId(sessionTarget.threadId) ?? normalizeDiscordThreadId(sessionConversation?.threadId)
123
- } : null;
124
- },
125
- resolveFallbackTarget: (request) => {
126
- const sessionConversation = resolveApprovalRequestSessionConversation({
127
- request,
128
- channel: "discord",
129
- bundledFallback: false
130
- });
131
- if (extractDiscordSessionKind(request.request.sessionKey?.trim() || null) === "dm") return null;
132
- const fallbackChannelId = normalizeDiscordOriginChannelId(sessionConversation?.id);
133
- return fallbackChannelId ? {
134
- to: fallbackChannelId,
135
- threadId: normalizeDiscordThreadId(sessionConversation?.threadId)
136
- } : null;
137
- }
138
- });
139
- }
140
- function createDiscordApproverDmTargetResolver() {
141
- return createChannelApproverDmTargetResolver({
142
- shouldHandleRequest: ({ cfg, accountId, request }) => shouldHandleDiscordApprovalRequest({
143
- cfg,
144
- accountId,
145
- request
146
- }),
147
- resolveApprovers: ({ cfg, accountId }) => getDiscordExecApprovalApprovers({
148
- cfg,
149
- accountId
150
- }),
151
- mapApprover: (approver) => ({ to: approver })
122
+ resolveSessionTarget: (sessionTarget, request) => resolveSessionOrigin(request, sessionTarget),
123
+ resolveFallbackTarget: (request) => resolveSessionOrigin(request)
152
124
  });
153
125
  }
154
126
  function createDiscordApprovalCapability() {
@@ -178,7 +150,14 @@ function createDiscordApprovalCapability() {
178
150
  accountId
179
151
  }).config.execApprovals?.target ?? "dm",
180
152
  resolveOriginTarget: createDiscordOriginTargetResolver(),
181
- resolveApproverDmTargets: createDiscordApproverDmTargetResolver(),
153
+ resolveApproverDmTargets: createChannelApproverDmTargetResolver({
154
+ shouldHandleRequest: shouldHandleCapabilityRequest,
155
+ resolveApprovers: ({ cfg, accountId }) => getDiscordExecApprovalApprovers({
156
+ cfg,
157
+ accountId
158
+ }),
159
+ mapApprover: (approver) => ({ to: approver })
160
+ }),
182
161
  notifyOriginWhenDmOnly: true,
183
162
  nativeRuntime: createLazyChannelApprovalNativeRuntimeAdapter({
184
163
  capabilityBoundary: true,
@@ -191,12 +170,8 @@ function createDiscordApprovalCapability() {
191
170
  cfg,
192
171
  accountId
193
172
  }),
194
- shouldHandle: ({ cfg, accountId, request }) => shouldHandleDiscordApprovalRequest({
195
- cfg,
196
- accountId,
197
- request
198
- }),
199
- load: async () => (await import("./approval-handler.runtime-DmnEa54W.mjs")).discordApprovalNativeRuntime
173
+ shouldHandle: shouldHandleCapabilityRequest,
174
+ load: async () => (await import("./approval-handler.runtime-D7FoZSn0.mjs")).discordApprovalNativeRuntime
200
175
  })
201
176
  });
202
177
  }
@@ -207,22 +182,22 @@ function getDiscordApprovalCapability() {
207
182
  }
208
183
  //#endregion
209
184
  //#region extensions/discord/src/channel.loaders.ts
210
- const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-gqsdcplU.mjs").then((n) => n.t));
211
- const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-DA6QlhZN.mjs").then((n) => n.n));
212
- const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DNrwvunm.mjs").then((n) => n.n));
213
- const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-D2-GYZ5s.mjs").then((n) => n.r));
214
- const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-CSFoPQ12.mjs").then((n) => n.r));
215
- const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-CZ51OIgD.mjs"));
216
- const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-BwSKpnZf.mjs").then((n) => n.o));
185
+ const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-3iVub-3m.mjs").then((n) => n.t));
186
+ const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-UdT38DzU.mjs").then((n) => n.n));
187
+ const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DnCsrXZ_.mjs").then((n) => n.n));
188
+ const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-CdNa6UIs.mjs").then((n) => n.r));
189
+ const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-Bse8fuTi.mjs").then((n) => n.r));
190
+ const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-BQVcM7Pg.mjs"));
191
+ const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-D3P1x4aN.mjs").then((n) => n.o));
217
192
  async function probeDiscordStatusAccount(params) {
218
193
  const startedAtMs = Date.now();
219
194
  const runtime = await loadDiscordProbeRuntime();
220
195
  const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
221
196
  return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
222
197
  }
223
- const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-BpikUwN_.mjs").then((n) => n.n));
224
- const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-CJk3VP5q.mjs").then((n) => n.t));
225
- const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-Bipr0eUJ.mjs").then((n) => n.t));
198
+ const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-zSawfbsN.mjs").then((n) => n.n));
199
+ const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-DbILKgcm.mjs").then((n) => n.t));
200
+ const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-DLygQVtW.mjs").then((n) => n.t));
226
201
  //#endregion
227
202
  //#region extensions/discord/src/conversation-route-owner.ts
228
203
  function inspectDiscordConversationRouteOwner(params) {
@@ -297,28 +272,15 @@ function resolveDiscordChannelKey(channelEntries, params) {
297
272
  if (params.groupId && channelEntries[params.groupId]) return params.groupId;
298
273
  if (channelSlug && channelEntries[channelSlug]) return channelSlug;
299
274
  if (channelSlug && channelEntries[`#${channelSlug}`]) return `#${channelSlug}`;
300
- const normalizedGroupChannel = groupChannel ? normalizeAtHashSlug(groupChannel) : void 0;
301
- return normalizedGroupChannel !== void 0 && channelEntries[normalizedGroupChannel] ? normalizedGroupChannel : void 0;
302
- }
303
- function buildDiscordPolicyTree(guilds) {
304
- const scopes = {};
305
- for (const [guildKey, guild] of Object.entries(guilds ?? {})) {
306
- scopes[guildScopeKey(guildKey)] = {
307
- requireMention: guild.requireMention,
308
- tools: guild.tools,
309
- toolsBySender: guild.toolsBySender
310
- };
311
- for (const [channelKey, channel] of Object.entries(guild.channels ?? {})) scopes[channelScopeKey(guildKey, channelKey)] = {
312
- requireMention: channel.requireMention,
313
- tools: channel.tools,
314
- toolsBySender: channel.toolsBySender
315
- };
316
- }
317
- return { scopes };
275
+ return groupChannel && channelEntries[channelSlug] ? channelSlug : void 0;
318
276
  }
319
277
  function resolveDiscordPolicyScope(params) {
320
278
  const guilds = (params.accountId ? params.cfg.channels?.discord?.accounts?.[params.accountId]?.guilds : void 0) ?? params.cfg.channels?.discord?.guilds;
321
- const tree = buildDiscordPolicyTree(guilds);
279
+ const tree = { scopes: {} };
280
+ for (const [guildKey, guild] of Object.entries(guilds ?? {})) {
281
+ tree.scopes[guildScopeKey(guildKey)] = guild;
282
+ for (const [channelKey, channel] of Object.entries(guild.channels ?? {})) tree.scopes[channelScopeKey(guildKey, channelKey)] = channel;
283
+ }
322
284
  const guildKey = resolveDiscordGuildKey(guilds, params.groupSpace);
323
285
  if (!guildKey) return {
324
286
  tree,
@@ -351,7 +313,7 @@ function isDiscordMessageContentIntentDisabled(value) {
351
313
  }
352
314
  function readDiscordPermissionsAuditSummary(value) {
353
315
  if (!isRecord$1(value)) return {};
354
- const unresolvedChannels = typeof value.unresolvedChannels === "number" && Number.isFinite(value.unresolvedChannels) ? value.unresolvedChannels : void 0;
316
+ const unresolvedChannels = asFiniteNumber(value.unresolvedChannels);
355
317
  const channelsRaw = value.channels;
356
318
  return {
357
319
  unresolvedChannels,
@@ -382,27 +344,28 @@ function collectDiscordStatusIssues(accounts) {
382
344
  if (!account) continue;
383
345
  const accountId = resolveEnabledConfiguredAccountId(account);
384
346
  if (!accountId) continue;
347
+ const scope = {
348
+ channel: "discord",
349
+ accountId
350
+ };
385
351
  if (account.groupPolicy === "allowlist" && account.guildsConfigured === 0) {
386
352
  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.`;
387
353
  issues.push({
388
- channel: "discord",
389
- accountId,
354
+ ...scope,
390
355
  kind: "config",
391
356
  message: "Discord guild messages are blocked: effective groupPolicy is \"allowlist\", but no guilds are configured.",
392
357
  fix: `${guildGuidance} Refresh channel status after the configuration reload applies.`
393
358
  });
394
359
  }
395
360
  if (isDiscordMessageContentIntentDisabled(account.application)) issues.push({
396
- channel: "discord",
397
- accountId,
361
+ ...scope,
398
362
  kind: "intent",
399
363
  message: "Message Content Intent is disabled. Bot may not see normal channel messages.",
400
364
  fix: "Enable Message Content Intent in Discord Dev Portal → Bot → Privileged Gateway Intents, or require mention-only operation."
401
365
  });
402
366
  const audit = readDiscordPermissionsAuditSummary(account.audit);
403
367
  if (audit.unresolvedChannels && audit.unresolvedChannels > 0) issues.push({
404
- channel: "discord",
405
- accountId,
368
+ ...scope,
406
369
  kind: "config",
407
370
  message: `Some configured guild channels are not numeric IDs (unresolvedChannels=${audit.unresolvedChannels}). Permission audit can only check numeric channel IDs.`,
408
371
  fix: "Use numeric channel IDs as keys in channels.discord.guilds.*.channels (then rerun channels status --probe)."
@@ -413,13 +376,9 @@ function collectDiscordStatusIssues(accounts) {
413
376
  const error = channel.error ? `: ${channel.error}` : "";
414
377
  const baseMessage = `Channel ${channel.channelId} permission check failed.${missing}${error}`;
415
378
  issues.push({
416
- channel: "discord",
417
- accountId,
379
+ ...scope,
418
380
  kind: "permissions",
419
- message: appendMatchMetadata(baseMessage, {
420
- matchKey: channel.matchKey,
421
- matchSource: channel.matchSource
422
- }),
381
+ message: appendMatchMetadata(baseMessage, channel),
423
382
  fix: "Ensure the bot role can view + send in this channel (and that channel overrides don't deny it)."
424
383
  });
425
384
  }
@@ -446,25 +405,21 @@ const discordConversationBindings = {
446
405
  persist: false,
447
406
  enableSweeper: false
448
407
  }),
449
- setIdleTimeoutBySessionKey: ({ targetSessionKey, accountId, idleTimeoutMs }) => setThreadBindingIdleTimeoutBySessionKey({
450
- targetSessionKey,
451
- accountId: accountId ?? void 0,
452
- idleTimeoutMs
408
+ setIdleTimeoutBySessionKey: (params) => setThreadBindingIdleTimeoutBySessionKey({
409
+ ...params,
410
+ accountId: params.accountId ?? void 0
453
411
  }).map(toConversationLifecycleBinding),
454
- setMaxAgeBySessionKey: ({ targetSessionKey, accountId, maxAgeMs }) => setThreadBindingMaxAgeBySessionKey({
455
- targetSessionKey,
456
- accountId: accountId ?? void 0,
457
- maxAgeMs
412
+ setMaxAgeBySessionKey: (params) => setThreadBindingMaxAgeBySessionKey({
413
+ ...params,
414
+ accountId: params.accountId ?? void 0
458
415
  }).map(toConversationLifecycleBinding),
459
- setIdleTimeoutBySessionKeyAsync: async ({ targetSessionKey, accountId, idleTimeoutMs }) => (await setThreadBindingIdleTimeoutBySessionKeyAsync({
460
- targetSessionKey,
461
- accountId: accountId ?? void 0,
462
- idleTimeoutMs
416
+ setIdleTimeoutBySessionKeyAsync: async (params) => (await setThreadBindingIdleTimeoutBySessionKeyAsync({
417
+ ...params,
418
+ accountId: params.accountId ?? void 0
463
419
  })).map(toConversationLifecycleBinding),
464
- setMaxAgeBySessionKeyAsync: async ({ targetSessionKey, accountId, maxAgeMs }) => (await setThreadBindingMaxAgeBySessionKeyAsync({
465
- targetSessionKey,
466
- accountId: accountId ?? void 0,
467
- maxAgeMs
420
+ setMaxAgeBySessionKeyAsync: async (params) => (await setThreadBindingMaxAgeBySessionKeyAsync({
421
+ ...params,
422
+ accountId: params.accountId ?? void 0
468
423
  })).map(toConversationLifecycleBinding)
469
424
  };
470
425
  //#endregion
@@ -502,48 +457,6 @@ async function sendDiscordHeartbeatTyping(params) {
502
457
  signal: params.signal
503
458
  }));
504
459
  }
505
- function startDiscordStartupProbe(params) {
506
- (async () => {
507
- try {
508
- const probe = await (await loadDiscordProbeRuntime()).probeDiscord(params.token, 2500, { includeApplication: true });
509
- if (params.abortSignal.aborted) return;
510
- params.setStatus({
511
- accountId: params.accountId,
512
- bot: probe.bot,
513
- application: probe.application
514
- });
515
- if (probe.ok) {
516
- const username = probe.bot?.username?.trim();
517
- if (username) params.log?.info?.(`[${params.accountId}] Discord bot probe resolved @${username}`);
518
- } else if (getDiscordRuntime().logging.shouldLogVerbose()) params.log?.debug?.(`[${params.accountId}] bot probe degraded: ${probe.error ?? `status ${probe.status ?? "unknown"}`}`);
519
- const messageContent = probe.application?.intents?.messageContent;
520
- if (messageContent === "disabled") params.log?.warn?.(`[${params.accountId}] Discord Message Content Intent is disabled; bot may not respond to channel messages. Enable it in Discord Dev Portal (Bot → Privileged Gateway Intents) or require mentions.`);
521
- else if (messageContent === "limited") params.log?.info?.(`[${params.accountId}] Discord Message Content Intent is limited; bots under 100 servers can use it without verification.`);
522
- } catch (err) {
523
- if (!params.abortSignal.aborted) params.setStatus({
524
- accountId: params.accountId,
525
- bot: void 0,
526
- application: void 0
527
- });
528
- if (getDiscordRuntime().logging.shouldLogVerbose()) params.log?.debug?.(`[${params.accountId}] bot probe failed: ${String(err)}`);
529
- }
530
- })();
531
- }
532
- function shouldTreatDiscordDeliveredTextAsVisible(params) {
533
- return params.kind === "block" && typeof params.text === "string" && params.text.trim().length > 0;
534
- }
535
- function resolveDiscordStartupDelayMs(cfg, accountId) {
536
- const startupIndex = listDiscordStartupAccountIds(cfg).findIndex((candidateId) => candidateId === accountId);
537
- return startupIndex <= 0 ? 0 : startupIndex * DISCORD_ACCOUNT_STARTUP_STAGGER_MS;
538
- }
539
- function formatDiscordIntents(intents) {
540
- if (!intents) return "unknown";
541
- return [
542
- `messageContent=${intents.messageContent ?? "unknown"}`,
543
- `guildMembers=${intents.guildMembers ?? "unknown"}`,
544
- `presence=${intents.presence ?? "unknown"}`
545
- ].join(" ");
546
- }
547
460
  const resolveDiscordAllowlistGroupOverrides = createNestedAllowlistOverrideResolver({
548
461
  resolveRecord: (account) => account.config.guilds,
549
462
  outerLabel: (guildKey) => `guild ${guildKey}`,
@@ -560,9 +473,10 @@ const resolveDiscordAllowlistNames = createAccountScopedAllowlistNameResolver({
560
473
  entries
561
474
  })
562
475
  });
476
+ const discordPluginBase = createDiscordPluginBase({ setupContract: discordSetupContract });
563
477
  const discordPlugin = createChatChannelPlugin({
564
478
  base: {
565
- ...createDiscordPluginBase({ setupContract: discordSetupContract }),
479
+ ...discordPluginBase,
566
480
  allowlist: {
567
481
  ...buildLegacyDmAccountAllowlistAdapter({
568
482
  channelId: "discord",
@@ -592,23 +506,15 @@ const discordPlugin = createChatChannelPlugin({
592
506
  "- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages."
593
507
  ] },
594
508
  messaging: {
509
+ directTargetStyle: discordPluginBase.messaging?.directTargetStyle,
510
+ inferTargetChatType: discordPluginBase.messaging?.inferTargetChatType,
595
511
  resolveConversationRouteOwner: inspectDiscordConversationRouteOwner,
596
512
  targetPrefixes: ["discord"],
597
- directTargetStyle: "user-prefixed",
598
513
  targetIdComparison: "lowercase",
599
514
  normalizeTarget: normalizeDiscordMessagingTarget,
600
515
  resolveInboundConversation: resolveDiscordInboundConversation,
601
516
  normalizeExplicitSessionKey: ({ sessionKey, ctx }) => normalizeExplicitDiscordSessionKey(sessionKey, ctx),
602
517
  resolveSessionTarget: ({ id }) => normalizeDiscordMessagingTarget(`channel:${id}`),
603
- inferTargetChatType: ({ to }) => {
604
- try {
605
- const parsed = parseDiscordTarget(to, { defaultKind: "channel" });
606
- if (!parsed) return;
607
- return parsed?.kind === "user" ? "direct" : "channel";
608
- } catch {
609
- return;
610
- }
611
- },
612
518
  buildCrossContextPresentation: buildDiscordCrossContextPresentation,
613
519
  resolveOutboundSessionRoute: resolveDiscordOutboundSessionRoute,
614
520
  targetResolver: {
@@ -620,8 +526,7 @@ const discordPlugin = createChatChannelPlugin({
620
526
  cfg,
621
527
  accountId
622
528
  }, defaultKind ? { defaultKind } : {});
623
- if (!resolved) return null;
624
- if (!looksLikeDiscordTargetId(resolved.normalized)) return null;
529
+ if (!resolved || !looksLikeDiscordTargetId(resolved.normalized)) return null;
625
530
  if (!looksLikeDiscordTargetId(input) && defaultKind === "channel" && resolved.kind === "user") return null;
626
531
  return {
627
532
  to: resolved.normalized,
@@ -717,7 +622,15 @@ const discordPlugin = createChatChannelPlugin({
717
622
  const botId = discordProbe.bot.id ? ` (${discordProbe.bot.id})` : "";
718
623
  lines.push({ text: `Bot: @${discordProbe.bot.username}${botId}` });
719
624
  }
720
- if (discordProbe?.application?.intents) lines.push({ text: `Intents: ${formatDiscordIntents(discordProbe.application.intents)}` });
625
+ const intents = discordProbe?.application?.intents;
626
+ if (intents) {
627
+ const summary = [
628
+ `messageContent=${intents.messageContent ?? "unknown"}`,
629
+ `guildMembers=${intents.guildMembers ?? "unknown"}`,
630
+ `presence=${intents.presence ?? "unknown"}`
631
+ ].join(" ");
632
+ lines.push({ text: `Intents: ${summary}` });
633
+ }
721
634
  return lines;
722
635
  },
723
636
  buildCapabilitiesDiagnostics: async ({ account, target, timeoutMs }) => {
@@ -729,21 +642,16 @@ const discordPlugin = createChatChannelPlugin({
729
642
  kind: parsedTarget?.kind,
730
643
  channelId: parsedTarget?.kind === "channel" ? parsedTarget.id : void 0
731
644
  } };
732
- if (!parsedTarget || parsedTarget.kind !== "channel") return {
645
+ const permissionError = (text) => ({
733
646
  details,
734
647
  lines: [{
735
- text: "Permissions: Target looks like a DM user; pass channel:<id> to audit channel permissions.",
648
+ text,
736
649
  tone: "error"
737
650
  }]
738
- };
651
+ });
652
+ if (!parsedTarget || parsedTarget.kind !== "channel") return permissionError("Permissions: Target looks like a DM user; pass channel:<id> to audit channel permissions.");
739
653
  const token = account.token?.trim();
740
- if (!token) return {
741
- details,
742
- lines: [{
743
- text: "Permissions: Discord bot token missing for permission audit.",
744
- tone: "error"
745
- }]
746
- };
654
+ if (!token) return permissionError("Permissions: Discord bot token missing for permission audit.");
747
655
  const statusCfg = { channels: { discord: { accounts: { [account.accountId]: {
748
656
  ...account.config,
749
657
  token
@@ -787,13 +695,7 @@ const discordPlugin = createChatChannelPlugin({
787
695
  channelId: parsedTarget.id,
788
696
  error: message
789
697
  };
790
- return {
791
- details,
792
- lines: [{
793
- text: `Permissions: ${message}`,
794
- tone: "error"
795
- }]
796
- };
698
+ return permissionError(`Permissions: ${message}`);
797
699
  }
798
700
  },
799
701
  auditAccount: async ({ account, timeoutMs, cfg }) => {
@@ -858,7 +760,8 @@ const discordPlugin = createChatChannelPlugin({
858
760
  const readConfig = createRuntimeConfigReader(ctx.cfg);
859
761
  const account = ctx.account;
860
762
  if (account.tokenStatus === "configured_unavailable") throw new Error(`Discord bot token configured for account "${account.accountId}" is unavailable; resolve SecretRefs against the active runtime snapshot before using this account.`);
861
- const startupDelayMs = resolveDiscordStartupDelayMs(ctx.cfg, account.accountId);
763
+ const startupIndex = listDiscordStartupAccountIds(ctx.cfg).indexOf(account.accountId);
764
+ const startupDelayMs = Math.max(0, startupIndex) * DISCORD_ACCOUNT_STARTUP_STAGGER_MS;
862
765
  if (startupDelayMs > 0) {
863
766
  ctx.log?.info(`[${account.accountId}] delaying provider startup ${Math.round(startupDelayMs / 1e3)}s to reduce Discord startup rate limits`);
864
767
  try {
@@ -868,13 +771,31 @@ const discordPlugin = createChatChannelPlugin({
868
771
  }
869
772
  }
870
773
  const token = account.token.trim();
871
- startDiscordStartupProbe({
872
- accountId: account.accountId,
873
- token,
874
- abortSignal: ctx.abortSignal,
875
- setStatus: ctx.setStatus,
876
- log: ctx.log
877
- });
774
+ (async () => {
775
+ try {
776
+ const probe = await (await loadDiscordProbeRuntime()).probeDiscord(token, 2500, { includeApplication: true });
777
+ if (ctx.abortSignal.aborted) return;
778
+ ctx.setStatus({
779
+ accountId: account.accountId,
780
+ bot: probe.bot,
781
+ application: probe.application
782
+ });
783
+ if (probe.ok) {
784
+ const username = probe.bot?.username?.trim();
785
+ if (username) ctx.log?.info?.(`[${account.accountId}] Discord bot check resolved @${username}`);
786
+ } else if (getDiscordRuntime().logging.shouldLogVerbose()) ctx.log?.debug?.(`[${account.accountId}] bot check degraded: ${probe.error ?? `status ${probe.status ?? "unknown"}`}`);
787
+ const messageContent = probe.application?.intents?.messageContent;
788
+ if (messageContent === "disabled") ctx.log?.warn?.(`[${account.accountId}] Discord Message Content Intent is disabled; bot may not respond to channel messages. Enable it in Discord Dev Portal (Bot → Privileged Gateway Intents) or require mentions.`);
789
+ else if (messageContent === "limited") ctx.log?.info?.(`[${account.accountId}] Discord Message Content Intent is limited; bots under 100 servers can use it without verification.`);
790
+ } catch (err) {
791
+ if (!ctx.abortSignal.aborted) ctx.setStatus({
792
+ accountId: account.accountId,
793
+ bot: void 0,
794
+ application: void 0
795
+ });
796
+ if (getDiscordRuntime().logging.shouldLogVerbose()) ctx.log?.debug?.(`[${account.accountId}] bot check failed: ${String(err)}`);
797
+ }
798
+ })();
878
799
  ctx.log?.info(`[${account.accountId}] starting provider`);
879
800
  let commandDeployHashStore;
880
801
  try {
@@ -945,7 +866,7 @@ const discordPlugin = createChatChannelPlugin({
945
866
  outbound: {
946
867
  ...discordOutbound,
947
868
  preferFinalAssistantVisibleText: true,
948
- shouldTreatDeliveredTextAsVisible: shouldTreatDiscordDeliveredTextAsVisible,
869
+ shouldTreatDeliveredTextAsVisible: ({ kind, text }) => kind === "block" && typeof text === "string" && text.trim().length > 0,
949
870
  shouldSuppressLocalPayloadPrompt: shouldSuppressLocalDiscordExecApprovalPrompt
950
871
  }
951
872
  });
@@ -12,10 +12,6 @@ function resolveDiscordChannelStringPropertySafe(channel, key) {
12
12
  const value = readDiscordChannelPropertySafe(channel, key);
13
13
  return typeof value === "string" ? value : void 0;
14
14
  }
15
- function resolveDiscordChannelNumberPropertySafe(channel, key) {
16
- const value = readDiscordChannelPropertySafe(channel, key);
17
- return typeof value === "number" ? value : void 0;
18
- }
19
15
  function resolveDiscordChannelStringWithAliasSafe(channel, camelKey, snakeKey) {
20
16
  return resolveDiscordChannelStringPropertySafe(channel, camelKey) ?? resolveDiscordChannelStringPropertySafe(channel, snakeKey) ?? resolveDiscordChannelStringPropertySafe(readDiscordChannelPropertySafe(channel, "rawData"), snakeKey);
21
17
  }
@@ -36,10 +32,13 @@ function resolveDiscordChannelParentSafe(channel) {
36
32
  }
37
33
  function resolveDiscordChannelInfoSafe(channel) {
38
34
  const parent = resolveDiscordChannelParentSafe(channel);
35
+ const name = resolveDiscordChannelNameSafe(channel);
36
+ const topic = resolveDiscordChannelTopicSafe(channel);
37
+ const type = readDiscordChannelPropertySafe(channel, "type");
39
38
  return {
40
- name: resolveDiscordChannelNameSafe(channel),
41
- topic: resolveDiscordChannelTopicSafe(channel),
42
- type: resolveDiscordChannelNumberPropertySafe(channel, "type"),
39
+ name,
40
+ topic,
41
+ type: typeof type === "number" ? type : void 0,
43
42
  parentId: resolveDiscordChannelParentIdSafe(channel),
44
43
  ownerId: resolveDiscordChannelStringWithAliasSafe(channel, "ownerId", "owner_id"),
45
44
  parentName: resolveDiscordChannelNameSafe(parent)