@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,246 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
- import { A as isDiscordThreadChannelType, o as normalizeDiscordSlug } from "./allow-list-vxkG9_JD.mjs";
3
- import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DlNUkDqj.mjs";
4
- import { n as resolveDiscordAllowlistToken, r as listGuilds, t as filterDiscordGuilds } from "./resolve-allowlist-common-BUyU3C-T.mjs";
5
- //#region extensions/discord/src/resolve-channels.ts
6
- var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveDiscordChannelAllowlist: () => resolveDiscordChannelAllowlist });
7
- function parseDiscordChannelInput(raw) {
8
- const trimmed = raw.trim();
9
- if (!trimmed) return {};
10
- const mention = trimmed.match(/^<#(\d+)>$/);
11
- if (mention) return { channelId: mention[1] };
12
- const channelPrefix = trimmed.match(/^(?:channel:|discord:)?(\d+)$/i);
13
- if (channelPrefix) return { channelId: channelPrefix[1] };
14
- const guildPrefix = trimmed.match(/^(?:guild:|server:)?(\d+)$/i);
15
- if (guildPrefix) return {
16
- guildId: guildPrefix[1],
17
- guildOnly: true
18
- };
19
- const split = trimmed.includes("/") ? trimmed.split("/") : trimmed.split("#");
20
- if (split.length >= 2) {
21
- const guild = split[0]?.trim();
22
- const channel = split.slice(1).join("#").trim();
23
- if (!channel) return guild ? {
24
- guild: guild.trim(),
25
- guildOnly: true
26
- } : {};
27
- if (guild && /^\d+$/.test(guild)) {
28
- if (/^\d+$/.test(channel)) return {
29
- guildId: guild,
30
- channelId: channel
31
- };
32
- return {
33
- guildId: guild,
34
- channel
35
- };
36
- }
37
- return {
38
- guild,
39
- channel
40
- };
41
- }
42
- return {
43
- guild: trimmed,
44
- guildOnly: true
45
- };
46
- }
47
- async function listGuildChannels(token, fetcher, guildId) {
48
- return (await fetchDiscord(`/guilds/${guildId}/channels`, token, fetcher, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS })).map((channel) => {
49
- const archived = channel.thread_metadata?.archived;
50
- return {
51
- id: typeof channel.id === "string" ? channel.id : "",
52
- name: typeof channel.name === "string" ? channel.name : "",
53
- guildId,
54
- type: channel.type,
55
- archived
56
- };
57
- }).filter((channel) => Boolean(channel.id) && Boolean(channel.name));
58
- }
59
- async function fetchChannel(token, fetcher, channelId) {
60
- let raw;
61
- try {
62
- raw = await fetchDiscord(`/channels/${channelId}`, token, fetcher, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
63
- } catch (err) {
64
- if (err instanceof DiscordApiError && err.status === 403) return { status: "forbidden" };
65
- if (err instanceof DiscordApiError && err.status === 404) return { status: "not-found" };
66
- throw err;
67
- }
68
- if (!raw || typeof raw.guild_id !== "string" || typeof raw.id !== "string") return { status: "invalid" };
69
- return {
70
- status: "found",
71
- channel: {
72
- id: raw.id,
73
- name: typeof raw.name === "string" ? raw.name : "",
74
- guildId: raw.guild_id,
75
- type: raw.type
76
- }
77
- };
78
- }
79
- function preferActiveMatch(candidates) {
80
- if (candidates.length === 0) return;
81
- const scored = candidates.map((channel) => {
82
- const isThread = isDiscordThreadChannelType(channel.type);
83
- return {
84
- channel,
85
- score: (Boolean(channel.archived) ? 0 : 2) + (isThread ? 0 : 1)
86
- };
87
- });
88
- scored.sort((a, b) => b.score - a.score);
89
- return scored[0]?.channel ?? candidates[0];
90
- }
91
- function resolvedChannelResult(input, channel, guildName) {
92
- return {
93
- input,
94
- resolved: true,
95
- guildId: channel.guildId,
96
- guildName,
97
- channelId: channel.id,
98
- channelName: channel.name,
99
- archived: channel.archived
100
- };
101
- }
102
- async function resolveDiscordChannelAllowlist(params) {
103
- const token = resolveDiscordAllowlistToken(params.token);
104
- if (!token) return params.entries.map((input) => ({
105
- input,
106
- resolved: false
107
- }));
108
- const fetcher = params.fetcher ?? fetch;
109
- const guilds = await listGuilds(token, fetcher, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
110
- const channelsByGuild = /* @__PURE__ */ new Map();
111
- const getChannels = (guildId) => {
112
- const existing = channelsByGuild.get(guildId);
113
- if (existing) return existing;
114
- const promise = listGuildChannels(token, fetcher, guildId);
115
- channelsByGuild.set(guildId, promise);
116
- return promise;
117
- };
118
- const results = [];
119
- for (const input of params.entries) {
120
- const parsed = parseDiscordChannelInput(input);
121
- if (parsed.guildOnly) {
122
- const guild = filterDiscordGuilds(guilds, {
123
- guildId: parsed.guildId,
124
- guildName: parsed.guild
125
- })[0];
126
- if (guild) results.push({
127
- input,
128
- resolved: true,
129
- guildId: guild.id,
130
- guildName: guild.name
131
- });
132
- else results.push({
133
- input,
134
- resolved: false,
135
- guildId: parsed.guildId,
136
- guildName: parsed.guild
137
- });
138
- continue;
139
- }
140
- if (parsed.channelId) {
141
- const channelId = parsed.channelId;
142
- const result = await fetchChannel(token, fetcher, channelId);
143
- if (result.status === "found") {
144
- const channel = result.channel;
145
- if (parsed.guildId && parsed.guildId !== channel.guildId) {
146
- const expectedGuild = guilds.find((entry) => entry.id === parsed.guildId);
147
- const actualGuild = guilds.find((entry) => entry.id === channel.guildId);
148
- results.push({
149
- input,
150
- resolved: false,
151
- guildId: parsed.guildId,
152
- guildName: expectedGuild?.name,
153
- channelId,
154
- channelName: channel.name,
155
- note: actualGuild?.name ? `channel belongs to guild ${actualGuild.name}` : "channel belongs to a different guild"
156
- });
157
- continue;
158
- }
159
- const guild = guilds.find((entry) => entry.id === channel.guildId);
160
- results.push(resolvedChannelResult(input, channel, guild?.name));
161
- continue;
162
- }
163
- if (result.status === "not-found" && parsed.guildId) {
164
- const guild = guilds.find((entry) => entry.id === parsed.guildId);
165
- if (guild) {
166
- const match = preferActiveMatch((await getChannels(guild.id)).filter((channel) => normalizeDiscordSlug(channel.name) === normalizeDiscordSlug(channelId)));
167
- if (match) {
168
- results.push(resolvedChannelResult(input, match, guild.name));
169
- continue;
170
- }
171
- }
172
- }
173
- results.push({
174
- input,
175
- resolved: false,
176
- guildId: parsed.guildId,
177
- channelId
178
- });
179
- continue;
180
- }
181
- if (parsed.guildId || parsed.guild) {
182
- const guild = filterDiscordGuilds(guilds, {
183
- guildId: parsed.guildId,
184
- guildName: parsed.guild
185
- })[0];
186
- const channelQuery = parsed.channel?.trim();
187
- if (!guild || !channelQuery) {
188
- results.push({
189
- input,
190
- resolved: false,
191
- guildId: parsed.guildId,
192
- guildName: parsed.guild,
193
- channelName: channelQuery ?? parsed.channel
194
- });
195
- continue;
196
- }
197
- const channels = await getChannels(guild.id);
198
- const normalizedChannelQuery = normalizeDiscordSlug(channelQuery);
199
- const isNumericId = /^\d+$/.test(channelQuery);
200
- let matches = channels.filter((channel) => isNumericId ? channel.id === channelQuery : normalizeDiscordSlug(channel.name) === normalizedChannelQuery);
201
- if (isNumericId && matches.length === 0) matches = channels.filter((channel) => normalizeDiscordSlug(channel.name) === normalizedChannelQuery);
202
- const match = preferActiveMatch(matches);
203
- if (match) results.push(resolvedChannelResult(input, match, guild.name));
204
- else results.push({
205
- input,
206
- resolved: false,
207
- guildId: guild.id,
208
- guildName: guild.name,
209
- channelName: parsed.channel,
210
- note: `channel not found in guild ${guild.name}`
211
- });
212
- continue;
213
- }
214
- const channelName = input.trim().replace(/^#/, "");
215
- if (!channelName) {
216
- results.push({
217
- input,
218
- resolved: false,
219
- channelName
220
- });
221
- continue;
222
- }
223
- const candidates = [];
224
- for (const guild of guilds) {
225
- const channels = await getChannels(guild.id);
226
- for (const channel of channels) if (normalizeDiscordSlug(channel.name) === normalizeDiscordSlug(channelName)) candidates.push(channel);
227
- }
228
- const match = preferActiveMatch(candidates);
229
- if (match) {
230
- const guild = guilds.find((entry) => entry.id === match.guildId);
231
- results.push({
232
- ...resolvedChannelResult(input, match, guild?.name),
233
- note: candidates.length > 1 && guild?.name ? `matched multiple; chose ${guild.name}` : void 0
234
- });
235
- continue;
236
- }
237
- results.push({
238
- input,
239
- resolved: false,
240
- channelName
241
- });
242
- }
243
- return results;
244
- }
245
- //#endregion
246
- export { resolve_channels_exports as n, resolveDiscordChannelAllowlist as t };
@@ -1,26 +0,0 @@
1
- import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
2
- //#region extensions/discord/src/security-contract.ts
3
- const unsupportedSecretRefSurfacePatterns = ["channels.discord.threadBindings.webhookToken", "channels.discord.accounts.*.threadBindings.webhookToken"];
4
- function collectUnsupportedSecretRefConfigCandidates(raw) {
5
- if (!isRecord(raw)) return [];
6
- if (!isRecord(raw.channels) || !isRecord(raw.channels.discord)) return [];
7
- const candidates = [];
8
- const discord = raw.channels.discord;
9
- const threadBindings = isRecord(discord.threadBindings) ? discord.threadBindings : null;
10
- if (threadBindings) candidates.push({
11
- path: "channels.discord.threadBindings.webhookToken",
12
- value: threadBindings.webhookToken
13
- });
14
- const accounts = isRecord(discord.accounts) ? discord.accounts : null;
15
- if (!accounts) return candidates;
16
- for (const [accountId, account] of Object.entries(accounts)) {
17
- if (!isRecord(account) || !isRecord(account.threadBindings)) continue;
18
- candidates.push({
19
- path: `channels.discord.accounts.${accountId}.threadBindings.webhookToken`,
20
- value: account.threadBindings.webhookToken
21
- });
22
- }
23
- return candidates;
24
- }
25
- //#endregion
26
- export { unsupportedSecretRefSurfacePatterns as n, collectUnsupportedSecretRefConfigCandidates as t };
@@ -1,3 +0,0 @@
1
- import { t as discordSetupPlugin } from "./channel.setup-BmNvkidb.mjs";
2
- import "../setup-plugin-api.js";
3
- export { discordSetupPlugin };
@@ -1,3 +0,0 @@
1
- import "./send.receipt-DVOg2Oaw.mjs";
2
- import "./target-resolver-CSFoPQ12.mjs";
3
- export {};
@@ -1 +0,0 @@
1
- function l(i){return(o,s)=>{let e=document.createElement("a");e.className="plugin-session-header-link",e.target="_blank",e.rel="noopener noreferrer",e.dataset.linkReaderExternal="";let d=!1,a=()=>{d=!0,e.removeAttribute("href"),e.remove()},p=n=>{if(d)return;let t=n.presented&&!n.signal.aborted&&n.props.session?i(n.props.session):void 0,r=t?URL.parse(t.url):null;if(!t||!r||r.protocol!=="https:"&&r.protocol!=="http:"){e.removeAttribute("href"),e.remove();return}e.href=r.href,e.textContent=`${t.label} \u2197`,e.parentNode!==o&&o.append(e)};return s.signal.addEventListener("abort",a,{once:!0}),p(s),{update:p,dispose(){s.signal.removeEventListener("abort",a),a()}}}}var b={id:"discord",activate(i){return i.ui.registerAccessory({id:"conversation-origin",placement:"session-header",mount:l(({conversationLink:o})=>o&&URL.parse(o.url)?.hostname==="discord.com"?o:void 0)})}};export{b as default};