@openclaw/discord 2026.9.5 → 2026.9.7

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 (517) hide show
  1. package/assets/icon.png +0 -0
  2. package/dist/.setup/{account-inspect-BwQj24ht.mjs → account-inspect-De8hOUxG.mjs} +1 -1
  3. package/dist/.setup/{accounts-CwJQoLjM.mjs → accounts-ChaMcixG.mjs} +1 -4
  4. package/dist/.setup/{activities-api-DBwRt5ES.mjs → activities-api-tvbsU2e3.mjs} +38 -66
  5. package/dist/.setup/{api-CBK9zcq5.mjs → api-DVbJwZVt.mjs} +10 -2
  6. package/dist/.setup/{approval-handler.runtime-Du3n5ypX.mjs → approval-handler.runtime-DxCK2Rux.mjs} +49 -125
  7. package/dist/.setup/{approval-message-updates-BN7JtScm.mjs → approval-message-updates-BKFqavHZ.mjs} +2 -2
  8. package/dist/.setup/{audit-C8uaKoa9.mjs → audit-CLg9I71N.mjs} +5 -5
  9. package/dist/.setup/{channel-ChKdlBgH.mjs → channel-DxlUVU9t.mjs} +125 -228
  10. package/dist/.setup/{channel-type-DKnjV1XW.mjs → channel-type-DRCrEMss.mjs} +22 -22
  11. package/dist/.setup/{channel.setup-BlC3-Kzz.mjs → channel.setup-CRo1GjV7.mjs} +6 -9
  12. package/dist/.setup/{components-MqMWUWnE.mjs → components-Cq1PvIpN.mjs} +42 -71
  13. package/dist/.setup/{config-schema-CiZz-mtA.mjs → config-schema-oxELUSDx.mjs} +19 -44
  14. package/dist/.setup/{conversation-binding-route-_rz33QHO.mjs → conversation-binding-route-Caz_XuFH.mjs} +14 -6
  15. package/dist/.setup/{directory-config-BytTftz-.mjs → directory-config-esqNn0Eo.mjs} +6 -9
  16. package/dist/.setup/{directory-live--EGTH0DC.mjs → directory-live-DtKRHuGV.mjs} +6 -12
  17. package/dist/.setup/{discord-BXpHW-cu.mjs → discord-0xJYfdDD.mjs} +82 -386
  18. package/dist/.setup/{doctor-DxcdkXzz.mjs → doctor-BCl1H5tl.mjs} +21 -36
  19. package/dist/.setup/{doctor-contract-Co5vRCZ6.mjs → doctor-contract-CvvgwrrG.mjs} +41 -50
  20. package/dist/.setup/{channel-actions.runtime-CJmiFfps.mjs → handle-action-CUvQWnE7.mjs} +74 -105
  21. package/dist/.setup/{handle-action.guild-admin-DAFyh_yV.mjs → handle-action.guild-admin-Df-8gVle.mjs} +63 -121
  22. package/dist/.setup/{live-policy-config-eKQ-PLdy.mjs → live-policy-config-8Pv20CHc.mjs} +2 -3
  23. package/dist/.setup/{message-handler-DnUrDpaU.mjs → message-handler-B-Jk4oDk.mjs} +18 -93
  24. package/dist/.setup/message-handler.preflight-pluralkit-CWLUBVcx.mjs +141 -0
  25. package/dist/.setup/{message-handler.preflight-CtqaF_fb.mjs → message-handler.preflight-v-__NSDq.mjs} +73 -287
  26. package/dist/.setup/{message-handler.process-Dz1xvuQU.mjs → message-handler.process-BNFFuChn.mjs} +423 -374
  27. package/dist/.setup/{outbound-adapter-C8v79z9Z.mjs → outbound-adapter-BobT-kse.mjs} +105 -19
  28. package/dist/.setup/{outbound-session-route-CqWbuMOm.mjs → outbound-session-route-zVGxxceg.mjs} +142 -109
  29. package/dist/.setup/{pluralkit-CdAt1G0P.mjs → pluralkit-a6_NLfH9.mjs} +1 -1
  30. package/dist/.setup/{preflight-audio-DrnqFA8U.mjs → preflight-audio-DHGIHEpv.mjs} +2 -1
  31. package/dist/.setup/{presence-cache-dYSHPWMx.mjs → presence-cache-Di3H3DIU.mjs} +0 -4
  32. package/dist/.setup/{probe-CupW4we4.mjs → probe-LYrIHlBF.mjs} +13 -4
  33. package/dist/.setup/{provider-72zIvN-i.mjs → provider-B_G5hASF.mjs} +1112 -1668
  34. package/dist/.setup/provider-session.runtime-BYlTBFD2.mjs +6 -0
  35. package/dist/.setup/provider.runtime-CUE3UxER.mjs +2 -0
  36. package/dist/.setup/{realtime-session.runtime-DTccTgTM.mjs → realtime-session.runtime-oUd9DOcz.mjs} +372 -345
  37. package/dist/.setup/receive-recovery-CHPOsnLc.mjs +514 -0
  38. package/dist/.setup/{resolve-allowlist-common-CwMBzbx9.mjs → resolve-allowlist-common-DPdRggu5.mjs} +4 -7
  39. package/dist/.setup/{resolve-channels-BbvsLQOZ.mjs → resolve-channels-BFPNRmVv.mjs} +21 -40
  40. package/dist/.setup/{resolve-users-ByFlR7LQ.mjs → resolve-users-0-aBuCy3.mjs} +4 -4
  41. package/dist/.setup/{retry-DBfcEgmO.mjs → retry-pz_cSha2.mjs} +81 -16
  42. package/dist/.setup/rolldown-runtime-B4FMCO8f.mjs +28 -0
  43. package/dist/.setup/{runtime-SchNfUsQ.mjs → runtime-FN000lxA.mjs} +83 -166
  44. package/dist/.setup/runtime-doctor-migrations-CshUGl36.mjs +159 -0
  45. package/dist/.setup/{runtime-BVoa7hhx.mjs → runtime-sUksZ--Q.mjs} +2 -5
  46. package/dist/.setup/{secret-config-contract-DFu9hfU8.mjs → secret-config-contract-uOE2J7yM.mjs} +15 -85
  47. package/dist/.setup/{security-audit-s5w50-Ly.mjs → security-audit-Cdaegq7C.mjs} +3 -1
  48. package/dist/.setup/{send-CKDczUNL.mjs → send-CrfEI6Bs.mjs} +73 -114
  49. package/dist/.setup/{send.components-DWQjXhPV.mjs → send.components-DxQAMfES.mjs} +62 -107
  50. package/dist/.setup/{send.outbound-D0hQ7s50.mjs → send.outbound-BISKnb-a.mjs} +79 -154
  51. package/dist/.setup/{send.shared-Zwx6BxQ5.mjs → send.shared-DGFkbkQR.mjs} +10 -25
  52. package/dist/.setup/{sender-identity-0Ymgvmaj.mjs → sender-identity-B9X5Vb9R.mjs} +2 -3
  53. package/dist/.setup/setup-plugin-api-BQUBxbhe.mjs +3 -0
  54. package/dist/.setup/{shared-CaA3Vv4n.mjs → shared-B3wZ4hN-.mjs} +25 -32
  55. package/dist/.setup/{subagent-hooks-Bired9q6.mjs → subagent-hooks-nlUE9ow7.mjs} +5 -6
  56. package/dist/.setup/system-events-CdeZnvPV.mjs +33 -0
  57. package/dist/.setup/{target-resolver-B6MrxbYv.mjs → target-resolver-BuLapkhy.mjs} +9 -12
  58. package/dist/.setup/targets-0KUcEIYx.mjs +3 -0
  59. package/dist/.setup/{thread-bindings-CK5272V3.mjs → thread-bindings-D7TfgjR_.mjs} +33 -35
  60. package/dist/.setup/thread-bindings.manager-DN-NissX.mjs +819 -0
  61. package/dist/.setup/thread-bindings.session-updates-CshfKghV.mjs +359 -0
  62. package/dist/.setup/{thread-bindings.state-BThFQEga.mjs → thread-bindings.state-g6v9zAym.mjs} +21 -62
  63. package/dist/.setup/{transcripts-source-CuWYgayu.mjs → transcripts-source-p8EV179h.mjs} +133 -238
  64. package/dist/.setup/{typing-BKZL5fGj.mjs → typing-BiHCzBRu.mjs} +2 -1
  65. package/dist/.setup/{voice-runtime-DHVQ2mFz.mjs → voice-runtime-B46rcwrG.mjs} +633 -1085
  66. package/dist/account-inspect-api.js +1 -1
  67. package/dist/action-runtime-api.js +1 -1
  68. package/dist/activities-api.js +1 -1
  69. package/dist/api.js +18 -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 +4 -4
  74. package/dist/index.js +1 -1
  75. package/dist/runtime-api.js +20 -20
  76. package/dist/secret-contract-api.js +1 -1
  77. package/dist/security-audit-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 +1056 -0
  81. package/dist/subagent-hooks-api.js +3 -4
  82. package/dist/transcripts-source-api.js +1 -1
  83. package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +8 -4
  84. package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +8 -4
  85. package/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +1 -1
  86. package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +770 -695
  87. package/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +3 -2
  88. package/node_modules/@napi-rs/wasm-runtime/package.json +1 -1
  89. package/node_modules/@tybys/wasm-util/LICENSE +21 -0
  90. package/node_modules/@tybys/wasm-util/package.json +1 -1
  91. package/node_modules/@types/node/README.md +2 -2
  92. package/node_modules/@types/node/child_process.d.ts +1 -1
  93. package/node_modules/@types/node/crypto.d.ts +20 -8
  94. package/node_modules/@types/node/ffi.d.ts +14 -0
  95. package/node_modules/@types/node/http2.d.ts +3 -2
  96. package/node_modules/@types/node/net.d.ts +16 -4
  97. package/node_modules/@types/node/package.json +2 -17
  98. package/node_modules/@types/node/process.d.ts +1 -0
  99. package/node_modules/@types/node/quic.d.ts +39 -1
  100. package/node_modules/@types/node/stream/iter.d.ts +9 -12
  101. package/node_modules/@types/node/test/reporters.d.ts +1 -0
  102. package/node_modules/@types/node/test.d.ts +72 -0
  103. package/node_modules/@types/node/tls.d.ts +14 -10
  104. package/node_modules/@types/node/vm.d.ts +2 -1
  105. package/node_modules/@types/node/web-globals/streams.d.ts +4 -0
  106. package/node_modules/@types/node/worker_threads.d.ts +4 -1
  107. package/node_modules/typebox/build/compile/code.mjs +1 -2
  108. package/node_modules/typebox/build/compile/validator.mjs +5 -1
  109. package/node_modules/typebox/build/format/iri.mjs +16 -9
  110. package/node_modules/typebox/build/guard/emit.mjs +2 -2
  111. package/node_modules/typebox/build/guard/guard.d.mts +7 -5
  112. package/node_modules/typebox/build/guard/guard.mjs +14 -9
  113. package/node_modules/typebox/build/guard/index.mjs +6 -0
  114. package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
  115. package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
  116. package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
  117. package/node_modules/typebox/build/schema/build.mjs +2 -3
  118. package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
  119. package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
  120. package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
  121. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
  122. package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
  123. package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
  124. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
  125. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
  126. package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
  127. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
  128. package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
  129. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
  130. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
  131. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
  132. package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
  133. package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
  134. package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
  135. package/node_modules/typebox/build/schema/parse.mjs +3 -0
  136. package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
  137. package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
  138. package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
  139. package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
  140. package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
  141. package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
  142. package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
  143. package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
  144. package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
  145. package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
  146. package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
  147. package/node_modules/typebox/package.json +1 -1
  148. package/node_modules/typebox/readme.md +3 -1
  149. package/node_modules/zod/README.md +2 -2
  150. package/node_modules/zod/compile.cjs +19 -0
  151. package/node_modules/zod/index.cjs +19 -0
  152. package/node_modules/zod/locales/index.cjs +19 -0
  153. package/node_modules/zod/mini/index.cjs +19 -0
  154. package/node_modules/zod/package.json +8 -7
  155. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  156. package/node_modules/zod/src/v4/classic/external.ts +2 -0
  157. package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
  158. package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
  159. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
  160. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
  161. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
  162. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
  163. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
  164. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
  165. package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
  166. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
  167. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  168. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
  169. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
  170. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
  171. package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
  172. package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
  173. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
  174. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  175. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  176. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
  177. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  178. package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
  179. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
  180. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
  181. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
  182. package/node_modules/zod/src/v4/core/api.ts +44 -28
  183. package/node_modules/zod/src/v4/core/checks.ts +62 -102
  184. package/node_modules/zod/src/v4/core/compile.ts +218 -93
  185. package/node_modules/zod/src/v4/core/core.ts +1 -3
  186. package/node_modules/zod/src/v4/core/doc.ts +6 -2
  187. package/node_modules/zod/src/v4/core/errors.ts +3 -6
  188. package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
  189. package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
  190. package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
  191. package/node_modules/zod/src/v4/core/parse.ts +37 -16
  192. package/node_modules/zod/src/v4/core/regexes.ts +14 -4
  193. package/node_modules/zod/src/v4/core/schemas.ts +296 -132
  194. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  195. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
  196. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  197. package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
  198. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  199. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  200. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  201. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
  202. package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
  203. package/node_modules/zod/src/v4/core/util.ts +218 -147
  204. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  205. package/node_modules/zod/src/v4/locales/ar.ts +2 -0
  206. package/node_modules/zod/src/v4/locales/az.ts +2 -0
  207. package/node_modules/zod/src/v4/locales/be.ts +2 -0
  208. package/node_modules/zod/src/v4/locales/bg.ts +2 -0
  209. package/node_modules/zod/src/v4/locales/bn.ts +2 -0
  210. package/node_modules/zod/src/v4/locales/ca.ts +2 -0
  211. package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
  212. package/node_modules/zod/src/v4/locales/cs.ts +2 -0
  213. package/node_modules/zod/src/v4/locales/da.ts +2 -0
  214. package/node_modules/zod/src/v4/locales/de.ts +2 -0
  215. package/node_modules/zod/src/v4/locales/el.ts +2 -0
  216. package/node_modules/zod/src/v4/locales/en.ts +2 -0
  217. package/node_modules/zod/src/v4/locales/eo.ts +2 -0
  218. package/node_modules/zod/src/v4/locales/es.ts +2 -0
  219. package/node_modules/zod/src/v4/locales/fa.ts +2 -0
  220. package/node_modules/zod/src/v4/locales/fi.ts +2 -0
  221. package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
  222. package/node_modules/zod/src/v4/locales/fr.ts +2 -0
  223. package/node_modules/zod/src/v4/locales/gu.ts +2 -0
  224. package/node_modules/zod/src/v4/locales/he.ts +2 -0
  225. package/node_modules/zod/src/v4/locales/hi.ts +2 -0
  226. package/node_modules/zod/src/v4/locales/hr.ts +2 -0
  227. package/node_modules/zod/src/v4/locales/hu.ts +2 -0
  228. package/node_modules/zod/src/v4/locales/hy.ts +2 -0
  229. package/node_modules/zod/src/v4/locales/id.ts +2 -0
  230. package/node_modules/zod/src/v4/locales/index.ts +1 -0
  231. package/node_modules/zod/src/v4/locales/is.ts +2 -0
  232. package/node_modules/zod/src/v4/locales/it.ts +2 -0
  233. package/node_modules/zod/src/v4/locales/ja.ts +2 -0
  234. package/node_modules/zod/src/v4/locales/ka.ts +2 -0
  235. package/node_modules/zod/src/v4/locales/km.ts +2 -0
  236. package/node_modules/zod/src/v4/locales/kn.ts +2 -0
  237. package/node_modules/zod/src/v4/locales/ko.ts +2 -0
  238. package/node_modules/zod/src/v4/locales/lt.ts +2 -0
  239. package/node_modules/zod/src/v4/locales/mk.ts +2 -0
  240. package/node_modules/zod/src/v4/locales/ms.ts +2 -0
  241. package/node_modules/zod/src/v4/locales/ne.ts +2 -0
  242. package/node_modules/zod/src/v4/locales/nl.ts +2 -0
  243. package/node_modules/zod/src/v4/locales/nn.ts +2 -0
  244. package/node_modules/zod/src/v4/locales/no.ts +2 -0
  245. package/node_modules/zod/src/v4/locales/ota.ts +2 -0
  246. package/node_modules/zod/src/v4/locales/pl.ts +2 -0
  247. package/node_modules/zod/src/v4/locales/ps.ts +2 -0
  248. package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
  249. package/node_modules/zod/src/v4/locales/pt.ts +2 -0
  250. package/node_modules/zod/src/v4/locales/ro.ts +2 -0
  251. package/node_modules/zod/src/v4/locales/ru.ts +2 -0
  252. package/node_modules/zod/src/v4/locales/sk.ts +2 -0
  253. package/node_modules/zod/src/v4/locales/sl.ts +2 -0
  254. package/node_modules/zod/src/v4/locales/sv.ts +2 -0
  255. package/node_modules/zod/src/v4/locales/ta.ts +2 -0
  256. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  257. package/node_modules/zod/src/v4/locales/th.ts +2 -0
  258. package/node_modules/zod/src/v4/locales/tk.ts +2 -0
  259. package/node_modules/zod/src/v4/locales/tr.ts +2 -0
  260. package/node_modules/zod/src/v4/locales/uk.ts +2 -0
  261. package/node_modules/zod/src/v4/locales/ur.ts +2 -0
  262. package/node_modules/zod/src/v4/locales/uz.ts +2 -0
  263. package/node_modules/zod/src/v4/locales/vi.ts +2 -0
  264. package/node_modules/zod/src/v4/locales/yo.ts +2 -0
  265. package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
  266. package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
  267. package/node_modules/zod/src/v4/mini/external.ts +2 -0
  268. package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
  269. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
  270. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  271. package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
  272. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  273. package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
  274. package/node_modules/zod/v3/ZodError.cjs +19 -0
  275. package/node_modules/zod/v3/errors.cjs +19 -0
  276. package/node_modules/zod/v3/external.cjs +19 -0
  277. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  278. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  279. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  280. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  281. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  282. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  283. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  284. package/node_modules/zod/v3/index.cjs +19 -0
  285. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  286. package/node_modules/zod/v3/types.cjs +19 -0
  287. package/node_modules/zod/v4/classic/checks.cjs +19 -0
  288. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  289. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  290. package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
  291. package/node_modules/zod/v4/classic/errors.cjs +19 -0
  292. package/node_modules/zod/v4/classic/external.cjs +22 -1
  293. package/node_modules/zod/v4/classic/external.d.cts +1 -1
  294. package/node_modules/zod/v4/classic/external.d.ts +1 -1
  295. package/node_modules/zod/v4/classic/external.js +1 -1
  296. package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
  297. package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
  298. package/node_modules/zod/v4/classic/in-out.cjs +19 -0
  299. package/node_modules/zod/v4/classic/index.cjs +19 -0
  300. package/node_modules/zod/v4/classic/iso.cjs +19 -0
  301. package/node_modules/zod/v4/classic/parse.cjs +19 -0
  302. package/node_modules/zod/v4/classic/schemas.cjs +100 -35
  303. package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
  304. package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
  305. package/node_modules/zod/v4/classic/schemas.js +77 -33
  306. package/node_modules/zod/v4/core/api.cjs +45 -22
  307. package/node_modules/zod/v4/core/api.d.cts +12 -6
  308. package/node_modules/zod/v4/core/api.d.ts +12 -6
  309. package/node_modules/zod/v4/core/api.js +25 -22
  310. package/node_modules/zod/v4/core/checks.cjs +51 -97
  311. package/node_modules/zod/v4/core/checks.d.cts +17 -1
  312. package/node_modules/zod/v4/core/checks.d.ts +17 -1
  313. package/node_modules/zod/v4/core/checks.js +31 -96
  314. package/node_modules/zod/v4/core/compile.cjs +173 -78
  315. package/node_modules/zod/v4/core/compile.d.cts +18 -4
  316. package/node_modules/zod/v4/core/compile.d.ts +18 -4
  317. package/node_modules/zod/v4/core/compile.js +154 -79
  318. package/node_modules/zod/v4/core/core.cjs +20 -1
  319. package/node_modules/zod/v4/core/core.js +1 -1
  320. package/node_modules/zod/v4/core/doc.cjs +26 -2
  321. package/node_modules/zod/v4/core/doc.js +7 -2
  322. package/node_modules/zod/v4/core/errors.cjs +21 -5
  323. package/node_modules/zod/v4/core/errors.js +2 -5
  324. package/node_modules/zod/v4/core/index.cjs +19 -0
  325. package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
  326. package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
  327. package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
  328. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  329. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  330. package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
  331. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  332. package/node_modules/zod/v4/core/memoizer.cjs +111 -23
  333. package/node_modules/zod/v4/core/memoizer.js +69 -23
  334. package/node_modules/zod/v4/core/parse.cjs +56 -16
  335. package/node_modules/zod/v4/core/parse.js +37 -16
  336. package/node_modules/zod/v4/core/regexes.cjs +31 -6
  337. package/node_modules/zod/v4/core/regexes.d.cts +3 -0
  338. package/node_modules/zod/v4/core/regexes.d.ts +3 -0
  339. package/node_modules/zod/v4/core/regexes.js +10 -4
  340. package/node_modules/zod/v4/core/registries.cjs +19 -0
  341. package/node_modules/zod/v4/core/schemas.cjs +302 -114
  342. package/node_modules/zod/v4/core/schemas.d.cts +28 -8
  343. package/node_modules/zod/v4/core/schemas.d.ts +28 -8
  344. package/node_modules/zod/v4/core/schemas.js +279 -113
  345. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  346. package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
  347. package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
  348. package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
  349. package/node_modules/zod/v4/core/to-json-schema.js +7 -6
  350. package/node_modules/zod/v4/core/util.cjs +177 -143
  351. package/node_modules/zod/v4/core/util.d.cts +25 -4
  352. package/node_modules/zod/v4/core/util.d.ts +25 -4
  353. package/node_modules/zod/v4/core/util.js +156 -143
  354. package/node_modules/zod/v4/core/versions.cjs +21 -2
  355. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  356. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  357. package/node_modules/zod/v4/core/versions.js +2 -2
  358. package/node_modules/zod/v4/core/visit.cjs +19 -0
  359. package/node_modules/zod/v4/index.cjs +19 -0
  360. package/node_modules/zod/v4/locales/ar.cjs +2 -0
  361. package/node_modules/zod/v4/locales/ar.js +2 -0
  362. package/node_modules/zod/v4/locales/az.cjs +2 -0
  363. package/node_modules/zod/v4/locales/az.js +2 -0
  364. package/node_modules/zod/v4/locales/be.cjs +2 -0
  365. package/node_modules/zod/v4/locales/be.js +2 -0
  366. package/node_modules/zod/v4/locales/bg.cjs +2 -0
  367. package/node_modules/zod/v4/locales/bg.js +2 -0
  368. package/node_modules/zod/v4/locales/bn.cjs +2 -0
  369. package/node_modules/zod/v4/locales/bn.js +2 -0
  370. package/node_modules/zod/v4/locales/ca.cjs +2 -0
  371. package/node_modules/zod/v4/locales/ca.js +2 -0
  372. package/node_modules/zod/v4/locales/ckb.cjs +2 -0
  373. package/node_modules/zod/v4/locales/ckb.js +2 -0
  374. package/node_modules/zod/v4/locales/cs.cjs +2 -0
  375. package/node_modules/zod/v4/locales/cs.js +2 -0
  376. package/node_modules/zod/v4/locales/da.cjs +2 -0
  377. package/node_modules/zod/v4/locales/da.js +2 -0
  378. package/node_modules/zod/v4/locales/de.cjs +2 -0
  379. package/node_modules/zod/v4/locales/de.js +2 -0
  380. package/node_modules/zod/v4/locales/el.cjs +2 -0
  381. package/node_modules/zod/v4/locales/el.js +2 -0
  382. package/node_modules/zod/v4/locales/en.cjs +2 -0
  383. package/node_modules/zod/v4/locales/en.js +2 -0
  384. package/node_modules/zod/v4/locales/eo.cjs +2 -0
  385. package/node_modules/zod/v4/locales/eo.js +2 -0
  386. package/node_modules/zod/v4/locales/es.cjs +2 -0
  387. package/node_modules/zod/v4/locales/es.js +2 -0
  388. package/node_modules/zod/v4/locales/fa.cjs +2 -0
  389. package/node_modules/zod/v4/locales/fa.js +2 -0
  390. package/node_modules/zod/v4/locales/fi.cjs +2 -0
  391. package/node_modules/zod/v4/locales/fi.js +2 -0
  392. package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
  393. package/node_modules/zod/v4/locales/fr-CA.js +2 -0
  394. package/node_modules/zod/v4/locales/fr.cjs +2 -0
  395. package/node_modules/zod/v4/locales/fr.js +2 -0
  396. package/node_modules/zod/v4/locales/gu.cjs +2 -0
  397. package/node_modules/zod/v4/locales/gu.js +2 -0
  398. package/node_modules/zod/v4/locales/he.cjs +2 -0
  399. package/node_modules/zod/v4/locales/he.js +2 -0
  400. package/node_modules/zod/v4/locales/hi.cjs +2 -0
  401. package/node_modules/zod/v4/locales/hi.js +2 -0
  402. package/node_modules/zod/v4/locales/hr.cjs +2 -0
  403. package/node_modules/zod/v4/locales/hr.js +2 -0
  404. package/node_modules/zod/v4/locales/hu.cjs +2 -0
  405. package/node_modules/zod/v4/locales/hu.js +2 -0
  406. package/node_modules/zod/v4/locales/hy.cjs +2 -0
  407. package/node_modules/zod/v4/locales/hy.js +2 -0
  408. package/node_modules/zod/v4/locales/id.cjs +2 -0
  409. package/node_modules/zod/v4/locales/id.js +2 -0
  410. package/node_modules/zod/v4/locales/index.cjs +22 -1
  411. package/node_modules/zod/v4/locales/index.d.cts +1 -0
  412. package/node_modules/zod/v4/locales/index.d.ts +1 -0
  413. package/node_modules/zod/v4/locales/index.js +1 -0
  414. package/node_modules/zod/v4/locales/is.cjs +2 -0
  415. package/node_modules/zod/v4/locales/is.js +2 -0
  416. package/node_modules/zod/v4/locales/it.cjs +2 -0
  417. package/node_modules/zod/v4/locales/it.js +2 -0
  418. package/node_modules/zod/v4/locales/ja.cjs +2 -0
  419. package/node_modules/zod/v4/locales/ja.js +2 -0
  420. package/node_modules/zod/v4/locales/ka.cjs +2 -0
  421. package/node_modules/zod/v4/locales/ka.js +2 -0
  422. package/node_modules/zod/v4/locales/km.cjs +2 -0
  423. package/node_modules/zod/v4/locales/km.js +2 -0
  424. package/node_modules/zod/v4/locales/kn.cjs +2 -0
  425. package/node_modules/zod/v4/locales/kn.js +2 -0
  426. package/node_modules/zod/v4/locales/ko.cjs +2 -0
  427. package/node_modules/zod/v4/locales/ko.js +2 -0
  428. package/node_modules/zod/v4/locales/lt.cjs +2 -0
  429. package/node_modules/zod/v4/locales/lt.js +2 -0
  430. package/node_modules/zod/v4/locales/mk.cjs +2 -0
  431. package/node_modules/zod/v4/locales/mk.js +2 -0
  432. package/node_modules/zod/v4/locales/ms.cjs +2 -0
  433. package/node_modules/zod/v4/locales/ms.js +2 -0
  434. package/node_modules/zod/v4/locales/ne.cjs +2 -0
  435. package/node_modules/zod/v4/locales/ne.js +2 -0
  436. package/node_modules/zod/v4/locales/nl.cjs +2 -0
  437. package/node_modules/zod/v4/locales/nl.js +2 -0
  438. package/node_modules/zod/v4/locales/nn.cjs +2 -0
  439. package/node_modules/zod/v4/locales/nn.js +2 -0
  440. package/node_modules/zod/v4/locales/no.cjs +2 -0
  441. package/node_modules/zod/v4/locales/no.js +2 -0
  442. package/node_modules/zod/v4/locales/ota.cjs +2 -0
  443. package/node_modules/zod/v4/locales/ota.js +2 -0
  444. package/node_modules/zod/v4/locales/pl.cjs +2 -0
  445. package/node_modules/zod/v4/locales/pl.js +2 -0
  446. package/node_modules/zod/v4/locales/ps.cjs +2 -0
  447. package/node_modules/zod/v4/locales/ps.js +2 -0
  448. package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
  449. package/node_modules/zod/v4/locales/pt-BR.js +2 -0
  450. package/node_modules/zod/v4/locales/pt.cjs +2 -0
  451. package/node_modules/zod/v4/locales/pt.js +2 -0
  452. package/node_modules/zod/v4/locales/ro.cjs +2 -0
  453. package/node_modules/zod/v4/locales/ro.js +2 -0
  454. package/node_modules/zod/v4/locales/ru.cjs +2 -0
  455. package/node_modules/zod/v4/locales/ru.js +2 -0
  456. package/node_modules/zod/v4/locales/sk.cjs +2 -0
  457. package/node_modules/zod/v4/locales/sk.js +2 -0
  458. package/node_modules/zod/v4/locales/sl.cjs +2 -0
  459. package/node_modules/zod/v4/locales/sl.js +2 -0
  460. package/node_modules/zod/v4/locales/sv.cjs +2 -0
  461. package/node_modules/zod/v4/locales/sv.js +2 -0
  462. package/node_modules/zod/v4/locales/ta.cjs +2 -0
  463. package/node_modules/zod/v4/locales/ta.js +2 -0
  464. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  465. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  466. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  467. package/node_modules/zod/v4/locales/tg.js +117 -0
  468. package/node_modules/zod/v4/locales/th.cjs +2 -0
  469. package/node_modules/zod/v4/locales/th.js +2 -0
  470. package/node_modules/zod/v4/locales/tk.cjs +2 -0
  471. package/node_modules/zod/v4/locales/tk.js +2 -0
  472. package/node_modules/zod/v4/locales/tr.cjs +2 -0
  473. package/node_modules/zod/v4/locales/tr.js +2 -0
  474. package/node_modules/zod/v4/locales/uk.cjs +2 -0
  475. package/node_modules/zod/v4/locales/uk.js +2 -0
  476. package/node_modules/zod/v4/locales/ur.cjs +2 -0
  477. package/node_modules/zod/v4/locales/ur.js +2 -0
  478. package/node_modules/zod/v4/locales/uz.cjs +2 -0
  479. package/node_modules/zod/v4/locales/uz.js +2 -0
  480. package/node_modules/zod/v4/locales/vi.cjs +2 -0
  481. package/node_modules/zod/v4/locales/vi.js +2 -0
  482. package/node_modules/zod/v4/locales/yo.cjs +2 -0
  483. package/node_modules/zod/v4/locales/yo.js +2 -0
  484. package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
  485. package/node_modules/zod/v4/locales/zh-CN.js +2 -0
  486. package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
  487. package/node_modules/zod/v4/locales/zh-TW.js +2 -0
  488. package/node_modules/zod/v4/mini/checks.cjs +19 -0
  489. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  490. package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
  491. package/node_modules/zod/v4/mini/external.cjs +22 -1
  492. package/node_modules/zod/v4/mini/external.d.cts +1 -1
  493. package/node_modules/zod/v4/mini/external.d.ts +1 -1
  494. package/node_modules/zod/v4/mini/external.js +1 -1
  495. package/node_modules/zod/v4/mini/in-out.cjs +19 -0
  496. package/node_modules/zod/v4/mini/index.cjs +19 -0
  497. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  498. package/node_modules/zod/v4/mini/parse.cjs +19 -0
  499. package/node_modules/zod/v4/mini/schemas.cjs +44 -8
  500. package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
  501. package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
  502. package/node_modules/zod/v4/mini/schemas.js +21 -6
  503. package/node_modules/zod/v4-mini/index.cjs +19 -0
  504. package/openclaw.plugin.json +21 -1
  505. package/package.json +9 -6
  506. package/dist/.setup/agent-components.runtime-CEPrf2SY.mjs +0 -4
  507. package/dist/.setup/message-handler.history-CJOsN9w5.mjs +0 -28
  508. package/dist/.setup/probe.runtime-DBQ_AGPe.mjs +0 -2
  509. package/dist/.setup/provider-session.runtime-BW7QrF5C.mjs +0 -6
  510. package/dist/.setup/provider.runtime-DuhmKdDU.mjs +0 -2
  511. package/dist/.setup/security-audit.runtime-DHtYenx9.mjs +0 -2
  512. package/dist/.setup/setup-plugin-api-CINIEBLa.mjs +0 -3
  513. package/dist/.setup/system-events-B2YEEMbS.mjs +0 -34
  514. package/dist/.setup/targets-D1mAB5yO.mjs +0 -3
  515. package/dist/.setup/thread-bindings.manager-eexkKyrG.mjs +0 -678
  516. package/dist/.setup/thread-bindings.session-updates-DCQq1WZ5.mjs +0 -55
  517. /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
@@ -1,11 +1,13 @@
1
- import { Ut as __exportAll, _ as DiscordError, ct as createThread, dt as editChannel, mt as getChannelMessage, t as discord_exports } from "./discord-BXpHW-cu.mjs";
2
- import { E as getDiscordEndpointRuntime, O as resolveDiscordEndpointMediaGuard, f as resolveDiscordGuildEntry, i as normalizeDiscordAllowList, l as resolveDiscordChannelConfigWithFallback, n as allowListMatches, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, r as isDiscordGroupAllowedByPolicy, t as isDiscordThreadChannelType } from "./channel-type-DKnjV1XW.mjs";
3
- import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount, l as resolveDiscordAccountAllowFrom } from "./accounts-CwJQoLjM.mjs";
1
+ import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
+ import { _ as DiscordError, ft as editChannel, ht as getChannelMessage, lt as createThread, t as discord_exports } from "./discord-0xJYfdDD.mjs";
3
+ import { D as getDiscordEndpointRuntime, f as resolveDiscordGuildEntry, i as normalizeDiscordAllowList, k as resolveDiscordEndpointMediaGuard, l as resolveDiscordChannelConfigWithFallback, n as allowListMatches, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, r as isDiscordGroupAllowedByPolicy, t as isDiscordThreadChannelType } from "./channel-type-DRCrEMss.mjs";
4
+ import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount, l as resolveDiscordAccountAllowFrom } from "./accounts-ChaMcixG.mjs";
4
5
  import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-D78sAoOz.mjs";
5
6
  import { a as resolveDiscordChannelParentSafe, i as resolveDiscordChannelParentIdSafe, n as resolveDiscordChannelInfoSafe, r as resolveDiscordChannelNameSafe, t as resolveDiscordChannelIdSafe } from "./channel-access-C12aDZ0p.mjs";
6
7
  import { ComponentType, StickerFormatType } from "discord-api-types/v10";
7
8
  import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
8
9
  import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
10
+ import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
9
11
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
10
12
  import { buildAgentSessionKey } from "openclaw/plugin-sdk/routing";
11
13
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId, summarizeStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -27,11 +29,8 @@ const discordChannelInfoCacheState = { entries: /* @__PURE__ */ new Map() };
27
29
  const DISCORD_CHANNEL_INFO_CACHE_TTL_MS = 3e5;
28
30
  const DISCORD_CHANNEL_INFO_NEGATIVE_CACHE_TTL_MS = 3e4;
29
31
  const DISCORD_CHANNEL_INFO_CACHE_MAX_ENTRIES = 1e3;
30
- function resolveDiscordChannelInfoCacheExpiresAt(ttlMs, nowMs) {
31
- return resolveExpiresAtMsFromDurationMs(ttlMs, { nowMs });
32
- }
33
32
  function cacheDiscordChannelInfo(channelId, value, ttlMs, nowMs) {
34
- const expiresAt = resolveDiscordChannelInfoCacheExpiresAt(ttlMs, nowMs);
33
+ const expiresAt = resolveExpiresAtMsFromDurationMs(ttlMs, { nowMs });
35
34
  if (expiresAt !== void 0) {
36
35
  discordChannelInfoCacheState.entries.set(channelId, {
37
36
  value,
@@ -264,18 +263,24 @@ const AUDIO_ATTACHMENT_EXTENSIONS = /* @__PURE__ */ new Set([
264
263
  ".wav"
265
264
  ]);
266
265
  const DISCORD_STICKER_ASSET_BASE_URL = "https://media.discordapp.net/stickers";
267
- function createDiscordMediaOperation(abortSignal) {
266
+ function createDiscordMediaOperation(maxBytes, options) {
268
267
  return {
268
+ ...options,
269
+ ssrfPolicy: resolveDiscordCdnPolicy(options?.ssrfPolicy),
269
270
  endpointRuntime: getDiscordEndpointRuntime() ?? null,
270
- abortSignal
271
+ maxBytes,
272
+ out: []
271
273
  };
272
274
  }
273
275
  function isDiscordAudioAttachmentFileName(fileName) {
274
276
  const ext = getFileExtension(fileName);
275
277
  return Boolean(ext && AUDIO_ATTACHMENT_EXTENSIONS.has(ext));
276
278
  }
277
- function hasDiscordVoiceAttachmentFields(attachment) {
278
- return typeof attachment.duration_secs === "number" || typeof attachment.waveform === "string";
279
+ function isDiscordVoiceWaveform(attachment) {
280
+ return typeof attachment.waveform === "string";
281
+ }
282
+ function isDiscordVoiceDurationOnly(attachment) {
283
+ return typeof attachment.duration_secs === "number" && !isDiscordVoiceWaveform(attachment);
279
284
  }
280
285
  const NON_DEFINITIVE_MEDIA_TYPES = /* @__PURE__ */ new Set([
281
286
  "application/octet-stream",
@@ -297,128 +302,54 @@ function resolveDiscordMediaClassification(params) {
297
302
  fetchedContentType: params.fetchedContentType
298
303
  });
299
304
  const mime = normalizeMimeType(contentType);
300
- const audioKind = mime?.startsWith("audio/") || hasDiscordVoiceAttachmentFields(params.attachment) || isDiscordAudioAttachmentFileName(params.attachment.filename ?? params.attachment.url) && !isDefinitiveMediaType(contentType) ? "audio" : void 0;
305
+ const definitiveVisual = mime?.startsWith("video/") === true || mime?.startsWith("image/") === true;
306
+ const audioKind = mime?.startsWith("audio/") || isDiscordVoiceWaveform(params.attachment) || !definitiveVisual && (isDiscordVoiceDurationOnly(params.attachment) || isDiscordAudioAttachmentFileName(params.attachment.filename ?? params.attachment.url) && !isDefinitiveMediaType(contentType)) ? "audio" : void 0;
301
307
  const kind = audioKind ?? (!isDefinitiveMediaType(contentType) ? isImageAttachment(params.attachment) ? "image" : "document" : void 0);
302
308
  return {
303
309
  contentType: audioKind && !mime?.startsWith("audio/") || kind && !isDefinitiveMediaType(contentType) ? void 0 : contentType,
304
310
  ...kind ? { kind } : {}
305
311
  };
306
312
  }
307
- async function resolveMediaList(message, maxBytes, options) {
308
- const out = [];
309
- const resolvedSsrFPolicy = resolveDiscordCdnPolicy(options?.ssrfPolicy);
310
- const operation = createDiscordMediaOperation(options?.abortSignal);
313
+ async function resolveMessageMedia(message, operation, errorPrefix) {
311
314
  await appendResolvedMediaFromAttachments({
315
+ ...operation,
312
316
  attachments: message.attachments ?? [],
313
- maxBytes,
314
- out,
315
- errorPrefix: "discord: failed to download attachment",
316
- fetchImpl: options?.fetchImpl,
317
- ssrfPolicy: resolvedSsrFPolicy,
318
- readIdleTimeoutMs: options?.readIdleTimeoutMs,
319
- totalTimeoutMs: options?.totalTimeoutMs,
320
- ...operation
317
+ errorPrefix: `${errorPrefix} attachment`
321
318
  });
322
319
  await appendResolvedMediaFromStickers({
320
+ ...operation,
323
321
  stickers: resolveDiscordMessageStickers(message),
324
- maxBytes,
325
- out,
326
- errorPrefix: "discord: failed to download sticker",
327
- fetchImpl: options?.fetchImpl,
328
- ssrfPolicy: resolvedSsrFPolicy,
329
- readIdleTimeoutMs: options?.readIdleTimeoutMs,
330
- totalTimeoutMs: options?.totalTimeoutMs,
331
- ...operation
322
+ errorPrefix: `${errorPrefix} sticker`
332
323
  });
333
- return out;
324
+ return operation.out;
325
+ }
326
+ async function resolveMediaList(message, maxBytes, options) {
327
+ return resolveMessageMedia(message, createDiscordMediaOperation(maxBytes, options), "discord: failed to download");
334
328
  }
335
329
  async function resolveForwardedMediaList(message, maxBytes, options) {
336
330
  const snapshots = resolveDiscordMessageSnapshots(message);
337
- const out = [];
338
- const resolvedSsrFPolicy = resolveDiscordCdnPolicy(options?.ssrfPolicy);
339
- const operation = createDiscordMediaOperation(options?.abortSignal);
331
+ const operation = createDiscordMediaOperation(maxBytes, options);
340
332
  if (snapshots.length > 0) {
341
333
  for (const snapshot of snapshots) {
342
334
  await appendResolvedMediaFromAttachments({
335
+ ...operation,
343
336
  attachments: snapshot.message?.attachments,
344
- maxBytes,
345
- out,
346
- errorPrefix: "discord: failed to download forwarded attachment",
347
- fetchImpl: options?.fetchImpl,
348
- ssrfPolicy: resolvedSsrFPolicy,
349
- readIdleTimeoutMs: options?.readIdleTimeoutMs,
350
- totalTimeoutMs: options?.totalTimeoutMs,
351
- ...operation
337
+ errorPrefix: "discord: failed to download forwarded attachment"
352
338
  });
353
339
  await appendResolvedMediaFromStickers({
340
+ ...operation,
354
341
  stickers: snapshot.message ? resolveDiscordSnapshotStickers(snapshot.message) : [],
355
- maxBytes,
356
- out,
357
- errorPrefix: "discord: failed to download forwarded sticker",
358
- fetchImpl: options?.fetchImpl,
359
- ssrfPolicy: resolvedSsrFPolicy,
360
- readIdleTimeoutMs: options?.readIdleTimeoutMs,
361
- totalTimeoutMs: options?.totalTimeoutMs,
362
- ...operation
342
+ errorPrefix: "discord: failed to download forwarded sticker"
363
343
  });
364
344
  }
365
- return out;
345
+ return operation.out;
366
346
  }
367
347
  const referencedForward = resolveDiscordReferencedForwardMessage(message);
368
- if (!referencedForward) return out;
369
- await appendResolvedMediaFromAttachments({
370
- attachments: referencedForward.attachments,
371
- maxBytes,
372
- out,
373
- errorPrefix: "discord: failed to download forwarded attachment",
374
- fetchImpl: options?.fetchImpl,
375
- ssrfPolicy: resolvedSsrFPolicy,
376
- readIdleTimeoutMs: options?.readIdleTimeoutMs,
377
- totalTimeoutMs: options?.totalTimeoutMs,
378
- ...operation
379
- });
380
- await appendResolvedMediaFromStickers({
381
- stickers: resolveDiscordMessageStickers(referencedForward),
382
- maxBytes,
383
- out,
384
- errorPrefix: "discord: failed to download forwarded sticker",
385
- fetchImpl: options?.fetchImpl,
386
- ssrfPolicy: resolvedSsrFPolicy,
387
- readIdleTimeoutMs: options?.readIdleTimeoutMs,
388
- totalTimeoutMs: options?.totalTimeoutMs,
389
- ...operation
390
- });
391
- return out;
348
+ return referencedForward ? resolveMessageMedia(referencedForward, operation, "discord: failed to download forwarded") : operation.out;
392
349
  }
393
350
  async function resolveReferencedReplyMediaList(message, maxBytes, options) {
394
351
  const referencedReply = resolveDiscordReferencedReplyMessage(message);
395
- const out = [];
396
- if (!referencedReply) return out;
397
- const resolvedSsrFPolicy = resolveDiscordCdnPolicy(options?.ssrfPolicy);
398
- const operation = createDiscordMediaOperation(options?.abortSignal);
399
- await appendResolvedMediaFromAttachments({
400
- attachments: referencedReply.attachments,
401
- maxBytes,
402
- out,
403
- errorPrefix: "discord: failed to download referenced reply attachment",
404
- fetchImpl: options?.fetchImpl,
405
- ssrfPolicy: resolvedSsrFPolicy,
406
- readIdleTimeoutMs: options?.readIdleTimeoutMs,
407
- totalTimeoutMs: options?.totalTimeoutMs,
408
- ...operation
409
- });
410
- await appendResolvedMediaFromStickers({
411
- stickers: resolveDiscordMessageStickers(referencedReply),
412
- maxBytes,
413
- out,
414
- errorPrefix: "discord: failed to download referenced reply sticker",
415
- fetchImpl: options?.fetchImpl,
416
- ssrfPolicy: resolvedSsrFPolicy,
417
- readIdleTimeoutMs: options?.readIdleTimeoutMs,
418
- totalTimeoutMs: options?.totalTimeoutMs,
419
- ...operation
420
- });
421
- return out;
352
+ return referencedReply ? resolveMessageMedia(referencedReply, createDiscordMediaOperation(maxBytes, options), "discord: failed to download referenced reply") : [];
422
353
  }
423
354
  async function fetchDiscordMedia(params) {
424
355
  const endpointGuard = resolveDiscordEndpointMediaGuard(params.url, params.endpointRuntime);
@@ -581,14 +512,9 @@ function isImageAttachment(attachment) {
581
512
  if (!name) return false;
582
513
  return /\.(avif|bmp|gif|heic|heif|jpe?g|png|tiff?|webp)$/.test(name);
583
514
  }
584
- function resolveDiscordTextMediaFacts(params) {
585
- return [...(params.attachments ?? []).map((attachment) => {
586
- return resolveDiscordMediaClassification({ attachment });
587
- }), ...(params.stickers ?? []).map(() => ({ kind: "sticker" }))];
588
- }
589
515
  /** Renders native Discord media only for transcript surfaces that cannot carry facts. */
590
516
  function formatDiscordMediaText(params) {
591
- return formatMediaPlaceholderText(resolveDiscordTextMediaFacts(params));
517
+ return formatMediaPlaceholderText([...(params.attachments ?? []).map((attachment) => resolveDiscordMediaClassification({ attachment })), ...(params.stickers ?? []).map(() => ({ kind: "sticker" }))]);
592
518
  }
593
519
  //#endregion
594
520
  //#region extensions/discord/src/monitor/message-text.ts
@@ -598,10 +524,7 @@ function resolveDiscordEmbedText(embeds) {
598
524
  function resolveDiscordMessageText(message, options) {
599
525
  const baseText = resolveDiscordMentions(resolveDiscordMessageMentionDocuments(message).map((text) => normalizeOptionalString(text)).filter(Boolean).join("\n") || normalizeOptionalString(options?.fallbackText) || "", message);
600
526
  if (!options?.includeForwarded) return baseText;
601
- const forwardedText = resolveDiscordForwardedMessagesText(message);
602
- if (!forwardedText) return baseText;
603
- if (!baseText) return forwardedText;
604
- return `${baseText}\n${forwardedText}`;
527
+ return [baseText, resolveDiscordForwardedMessagesText(message)].filter(Boolean).join("\n");
605
528
  }
606
529
  function resolveDiscordMessageMentionDocuments(message) {
607
530
  const content = typeof message.content === "string" ? message.content : "";
@@ -667,10 +590,7 @@ function resolveDiscordForwardedMessagesText(message) {
667
590
  if (snapshots.length > 0) return resolveDiscordForwardedMessagesTextFromSnapshots(snapshots);
668
591
  const referencedForward = resolveDiscordReferencedForwardMessage(message);
669
592
  if (!referencedForward) return "";
670
- const referencedText = resolveDiscordMessageHistoryText(referencedForward);
671
- if (!referencedText) return "";
672
- const authorLabel = formatDiscordSnapshotAuthor(referencedForward.author);
673
- return `${authorLabel ? `[Forwarded message from ${authorLabel}]` : "[Forwarded message]"}\n${referencedText}`;
593
+ return formatDiscordForwardedMessageBlock(resolveDiscordMessageHistoryText(referencedForward), referencedForward.author);
674
594
  }
675
595
  function resolveDiscordMessageComponents(message) {
676
596
  const components = message.components;
@@ -698,15 +618,11 @@ function collectDiscordTextDisplayDocuments(value, parts) {
698
618
  collectDiscordTextDisplayDocuments(component.component, parts);
699
619
  }
700
620
  function resolveDiscordForwardedMessagesTextFromSnapshots(snapshots) {
701
- const forwardedBlocks = normalizeDiscordMessageSnapshots(snapshots).map((snapshot) => buildDiscordForwardedMessageBlock(snapshot.message)).filter((entry) => Boolean(entry));
702
- if (forwardedBlocks.length === 0) return "";
703
- return forwardedBlocks.join("\n\n");
621
+ return snapshots.map(({ message }) => message ? formatDiscordForwardedMessageBlock(resolveDiscordRawMessageText(message), message.author) : "").filter(Boolean).join("\n\n");
704
622
  }
705
- function buildDiscordForwardedMessageBlock(snapshotMessage) {
706
- if (!snapshotMessage) return null;
707
- const text = resolveDiscordRawMessageText(snapshotMessage);
708
- if (!text) return null;
709
- const authorLabel = formatDiscordSnapshotAuthor(snapshotMessage.author);
623
+ function formatDiscordForwardedMessageBlock(text, author) {
624
+ if (!text) return "";
625
+ const authorLabel = formatDiscordSnapshotAuthor(author);
710
626
  return `${authorLabel ? `[Forwarded message from ${authorLabel}]` : "[Forwarded message]"}\n${text}`;
711
627
  }
712
628
  /** Single owner for raw Discord message payloads (REST fetches and forwarded snapshots). */
@@ -716,7 +632,7 @@ function resolveDiscordRawMessageText(message) {
716
632
  attachments: message.attachments ?? void 0,
717
633
  stickers: resolveDiscordSnapshotStickers(message)
718
634
  });
719
- return [content || resolveDiscordEmbedText(message.embeds) || extractDiscordComponentsV2Text(message.components) || resolveDiscordForwardedMessagesTextFromSnapshots(message.message_snapshots), mediaText].filter(Boolean).join("\n");
635
+ return [content || resolveDiscordEmbedText(message.embeds) || extractDiscordComponentsV2Text(message.components) || resolveDiscordForwardedMessagesTextFromSnapshots(normalizeDiscordMessageSnapshots(message.message_snapshots)), mediaText].filter(Boolean).join("\n");
720
636
  }
721
637
  //#endregion
722
638
  //#region extensions/discord/src/monitor/threading.cache.ts
@@ -746,9 +662,6 @@ function setCachedThreadStarter(key, value, now) {
746
662
  }
747
663
  //#endregion
748
664
  //#region extensions/discord/src/monitor/threading.starter.ts
749
- function isDiscordForumParentType(parentType) {
750
- return parentType === discord_exports.ChannelType.GuildForum || parentType === discord_exports.ChannelType.GuildMedia;
751
- }
752
665
  const IN_FLIGHT_DISCORD_THREAD_STARTERS = /* @__PURE__ */ new Map();
753
666
  function resolveDiscordThreadChannel(params) {
754
667
  if (!params.isGuildMessage) return null;
@@ -783,7 +696,7 @@ async function resolveDiscordThreadParentInfo(params) {
783
696
  };
784
697
  }
785
698
  async function resolveDiscordThreadStarter(params) {
786
- const messageChannelId = resolveDiscordThreadStarterMessageChannelId(params);
699
+ const messageChannelId = params.parentType === discord_exports.ChannelType.GuildForum || params.parentType === discord_exports.ChannelType.GuildMedia ? params.channel.id : params.parentId;
787
700
  if (!messageChannelId) return null;
788
701
  const cacheKey = `${params.accountId}:${params.channel.id}:${messageChannelId}`;
789
702
  const cached = getCachedThreadStarter(cacheKey, Date.now());
@@ -803,11 +716,7 @@ async function resolveDiscordThreadStarterUncached(params, cacheKey, messageChan
803
716
  setCachedThreadStarter(cacheKey, { kind: "miss" }, Date.now());
804
717
  };
805
718
  try {
806
- const starter = await fetchDiscordThreadStarterMessage({
807
- client: params.client,
808
- messageChannelId,
809
- threadId: params.channel.id
810
- });
719
+ const starter = await getChannelMessage(params.client.rest, messageChannelId, params.channel.id);
811
720
  if (!starter) {
812
721
  cacheMiss();
813
722
  return null;
@@ -826,80 +735,53 @@ async function resolveDiscordThreadStarterUncached(params, cacheKey, messageChan
826
735
  }, Date.now());
827
736
  return payload;
828
737
  } catch (error) {
829
- if (isDiscordThreadStarterNegativeCacheError(error)) cacheMiss();
738
+ if (error instanceof DiscordError && (error.status === 403 || error.status === 404)) cacheMiss();
830
739
  return null;
831
740
  }
832
741
  }
833
- function isDiscordThreadStarterNegativeCacheError(error) {
834
- return error instanceof DiscordError && (error.status === 403 || error.status === 404);
835
- }
836
- function resolveDiscordThreadStarterMessageChannelId(params) {
837
- return isDiscordForumParentType(params.parentType) ? params.channel.id : params.parentId;
838
- }
839
- async function fetchDiscordThreadStarterMessage(params) {
840
- const starter = await getChannelMessage(params.client.rest, params.messageChannelId, params.threadId);
841
- return starter ? starter : null;
842
- }
843
742
  function buildDiscordThreadStarterPayload(params) {
844
743
  const text = resolveDiscordRawMessageText(params.starter);
845
744
  if (!text) return null;
745
+ const starter = params.starter;
746
+ const authorTag = resolveDiscordThreadStarterAuthorTag(starter.author);
846
747
  return {
847
748
  text,
848
- ...resolveDiscordThreadStarterIdentity(params.starter),
849
- timestamp: params.resolveTimestampMs(params.starter.timestamp) ?? void 0
850
- };
851
- }
852
- function resolveDiscordThreadStarterIdentity(starter) {
853
- return {
854
- author: resolveDiscordThreadStarterAuthor(starter),
749
+ author: starter.member?.nick ?? starter.member?.displayName ?? authorTag ?? starter.author?.username ?? starter.author?.id ?? "Unknown",
855
750
  authorId: starter.author?.id ?? void 0,
856
751
  authorName: starter.author?.username ?? void 0,
857
- authorTag: resolveDiscordThreadStarterAuthorTag(starter.author),
858
- memberRoleIds: resolveDiscordThreadStarterRoleIds(starter.member)
752
+ authorTag,
753
+ memberRoleIds: Array.isArray(starter.member?.roles) ? starter.member.roles : void 0,
754
+ timestamp: params.resolveTimestampMs(starter.timestamp) ?? void 0
859
755
  };
860
756
  }
861
- function resolveDiscordThreadStarterAuthor(starter) {
862
- return starter.member?.nick ?? starter.member?.displayName ?? resolveDiscordThreadStarterAuthorTag(starter.author) ?? starter.author?.username ?? starter.author?.id ?? "Unknown";
863
- }
864
757
  function resolveDiscordThreadStarterAuthorTag(author) {
865
758
  if (!author?.username || !author.discriminator) return;
866
759
  if (author.discriminator !== "0") return `${author.username}#${author.discriminator}`;
867
760
  return author.username;
868
761
  }
869
- function resolveDiscordThreadStarterRoleIds(member) {
870
- return Array.isArray(member?.roles) ? member.roles : void 0;
871
- }
872
762
  function resolveDiscordReplyTarget(opts) {
873
- if (opts.replyToMode === "off") return;
874
- const replyToId = normalizeOptionalString(opts.replyToId);
875
- if (!replyToId) return;
876
- if (opts.replyToMode === "all") return replyToId;
877
- return opts.hasReplied ? void 0 : replyToId;
763
+ return createReplyReferencePlanner({
764
+ replyToMode: opts.replyToMode,
765
+ startId: opts.replyToId,
766
+ hasReplied: opts.hasReplied
767
+ }).peek();
878
768
  }
879
769
  function sanitizeDiscordThreadName(rawName, fallbackId) {
880
770
  const baseSource = rawName.replace(/<@!?\d+>/g, "").replace(/<@&\d+>/g, "").replace(/<#\d+>/g, "").replace(/\s+/g, " ").trim() || `Thread ${fallbackId}`;
881
- const base = truncateUtf16Safe(baseSource, 80);
882
- return truncateUtf16Safe(base, 100) || `Thread ${fallbackId}`;
771
+ return truncateUtf16Safe(baseSource, 80) || `Thread ${fallbackId}`;
883
772
  }
884
773
  function resolveDiscordReplyDeliveryPlan(params) {
885
- const originalReplyTarget = params.replyTarget;
886
- let deliverTarget = originalReplyTarget;
887
- let replyTarget = originalReplyTarget;
888
- if (params.createdThreadId) {
889
- deliverTarget = `channel:${params.createdThreadId}`;
890
- replyTarget = deliverTarget;
891
- }
892
- const allowReference = deliverTarget === originalReplyTarget;
893
- const replyReference = createReplyReferencePlanner({
894
- replyToMode: allowReference ? params.replyToMode : "off",
895
- existingId: params.threadChannel ? params.messageId : void 0,
896
- startId: params.messageId,
897
- allowReference
898
- });
774
+ const deliverTarget = params.createdThreadId ? `channel:${params.createdThreadId}` : params.replyTarget;
775
+ const allowReference = deliverTarget === params.replyTarget;
899
776
  return {
900
777
  deliverTarget,
901
- replyTarget,
902
- replyReference
778
+ replyTarget: deliverTarget,
779
+ replyReference: createReplyReferencePlanner({
780
+ replyToMode: allowReference ? params.replyToMode : "off",
781
+ existingId: params.threadChannel ? params.messageId : void 0,
782
+ startId: params.messageId,
783
+ allowReference
784
+ })
903
785
  };
904
786
  }
905
787
  //#endregion
@@ -935,20 +817,8 @@ async function resolveDiscordAutoThreadReplyPlan(params) {
935
817
  const messageChannelId = resolveTrimmedDiscordMessageChannelId(params);
936
818
  const originalReplyTarget = `channel:${params.threadChannel?.id ?? (messageChannelId || "unknown")}`;
937
819
  const createdThreadId = await maybeCreateDiscordAutoThread({
938
- client: params.client,
939
- message: params.message,
940
- messageChannelId: messageChannelId || void 0,
941
- channel: params.channel,
942
- isGuildMessage: params.isGuildMessage,
943
- channelConfig: params.channelConfig,
944
- threadChannel: params.threadChannel,
945
- channelType: params.channelType,
946
- channelName: params.channelName,
947
- channelDescription: params.channelDescription,
948
- baseText: params.baseText,
949
- combinedBody: params.combinedBody,
950
- cfg: params.cfg,
951
- agentId: params.agentId
820
+ ...params,
821
+ messageChannelId: messageChannelId || void 0
952
822
  });
953
823
  const deliveryPlan = resolveDiscordReplyDeliveryPlan({
954
824
  replyTarget: originalReplyTarget,
@@ -978,7 +848,7 @@ async function maybeCreateDiscordAutoThread(params) {
978
848
  if (params.channelType === discord_exports.ChannelType.GuildForum || params.channelType === discord_exports.ChannelType.GuildMedia || params.channelType === discord_exports.ChannelType.GuildVoice || params.channelType === discord_exports.ChannelType.GuildStageVoice) return;
979
849
  const messageChannelId = resolveTrimmedDiscordMessageChannelId(params);
980
850
  if (!messageChannelId) return;
981
- try {
851
+ const findExistingThread = async () => {
982
852
  try {
983
853
  const existingThreadId = (await getChannelMessage(params.client.rest, messageChannelId, params.message.id))?.thread?.id;
984
854
  if (existingThreadId) {
@@ -986,6 +856,10 @@ async function maybeCreateDiscordAutoThread(params) {
986
856
  return existingThreadId;
987
857
  }
988
858
  } catch {}
859
+ };
860
+ try {
861
+ const existingThreadId = await findExistingThread();
862
+ if (existingThreadId) return existingThreadId;
989
863
  if (params.message.author?.bot) {
990
864
  logVerbose(`discord: autoThread skipped for bot-authored message ${messageChannelId}/${params.message.id}`);
991
865
  return;
@@ -1022,14 +896,7 @@ async function maybeCreateDiscordAutoThread(params) {
1022
896
  return createdId || void 0;
1023
897
  } catch (err) {
1024
898
  logVerbose(`discord: autoThread creation failed for ${messageChannelId}/${params.message.id}: ${String(err)}`);
1025
- try {
1026
- const existingThreadId = (await getChannelMessage(params.client.rest, messageChannelId, params.message.id))?.thread?.id || "";
1027
- if (existingThreadId) {
1028
- logVerbose(`discord: autoThread reusing existing thread ${existingThreadId} on ${messageChannelId}/${params.message.id}`);
1029
- return existingThreadId;
1030
- }
1031
- } catch {}
1032
- return;
899
+ return findExistingThread();
1033
900
  }
1034
901
  }
1035
902
  function resolveDiscordThreadTitleModelRef(params) {
@@ -1278,35 +1145,15 @@ function resolveDiscordVoiceEnabled(voice) {
1278
1145
  if (voice?.enabled !== void 0) return voice.enabled;
1279
1146
  return voice !== void 0;
1280
1147
  }
1281
- function buildProviderConfigs(realtimeConfig) {
1282
- const configs = realtimeConfig?.providers;
1283
- return configs && Object.keys(configs).length > 0 ? { ...configs } : void 0;
1284
- }
1285
- function buildProviderConfigOverrides(realtimeConfig) {
1286
- const overrides = {
1287
- ...realtimeConfig?.model ? { model: realtimeConfig.model } : {},
1288
- ...realtimeConfig?.speakerVoice ? { voice: realtimeConfig.speakerVoice } : realtimeConfig?.speakerVoiceId ? { voice: realtimeConfig.speakerVoiceId } : {},
1289
- ...typeof realtimeConfig?.minBargeInAudioEndMs === "number" ? { minBargeInAudioEndMs: realtimeConfig.minBargeInAudioEndMs } : {}
1290
- };
1291
- return Object.keys(overrides).length > 0 ? overrides : void 0;
1292
- }
1293
1148
  //#endregion
1294
1149
  //#region extensions/discord/src/voice/transcripts-source.ts
1295
- const DISCORD_TRANSCRIPTS_STATE_KEY = Symbol.for("openclaw.discordTranscriptsState");
1296
- let discordTranscriptsState;
1297
- function resolveDiscordTranscriptsGlobalState() {
1298
- if (!discordTranscriptsState) {
1299
- const globalStore = globalThis;
1300
- discordTranscriptsState = globalStore[DISCORD_TRANSCRIPTS_STATE_KEY] ?? {
1301
- managersByAccountId: /* @__PURE__ */ new Map(),
1302
- captures: /* @__PURE__ */ new Map(),
1303
- managerWaiters: /* @__PURE__ */ new Set()
1304
- };
1305
- globalStore[DISCORD_TRANSCRIPTS_STATE_KEY] = discordTranscriptsState;
1306
- }
1307
- return discordTranscriptsState;
1308
- }
1309
- const TRANSCRIPTS_STATE = resolveDiscordTranscriptsGlobalState();
1150
+ const TRANSCRIPTS_STATE = resolveGlobalSingleton(Symbol.for("openclaw.discordTranscriptsState"), () => ({
1151
+ managersByAccountId: /* @__PURE__ */ new Map(),
1152
+ captures: /* @__PURE__ */ new Map(),
1153
+ managerWaiters: /* @__PURE__ */ new Set(),
1154
+ captureEpochReaders: /* @__PURE__ */ new Map(),
1155
+ nextRecordingEpoch: 0n
1156
+ }));
1310
1157
  const managersByAccountId = TRANSCRIPTS_STATE.managersByAccountId;
1311
1158
  const captures = TRANSCRIPTS_STATE.captures;
1312
1159
  const managerWaiters = TRANSCRIPTS_STATE.managerWaiters;
@@ -1318,6 +1165,47 @@ function captureKey(source) {
1318
1165
  source.channelId
1319
1166
  ]);
1320
1167
  }
1168
+ function publishCaptureEpoch(key) {
1169
+ const capture = captures.get(key);
1170
+ for (const reader of TRANSCRIPTS_STATE.captureEpochReaders.get(key) ?? []) {
1171
+ const currentManager = managersByAccountId.get(reader.source.accountId) === reader.manager;
1172
+ Atomics.store(reader.clock, 0, currentManager ? capture?.recordingEpoch ?? 0n : 0n);
1173
+ }
1174
+ }
1175
+ function publishAccountCaptureEpochs(accountId) {
1176
+ for (const [key, readers] of TRANSCRIPTS_STATE.captureEpochReaders) if ([...readers].some((reader) => reader.source.accountId === accountId)) publishCaptureEpoch(key);
1177
+ }
1178
+ /** Registration changes publish synchronously, before callbacks or transport awaits.
1179
+ * A worker stamps each raw packet; delayed decode can resolve only that same lease. */
1180
+ function bindDiscordCaptureReceipts(source, manager) {
1181
+ const key = captureKey(source);
1182
+ const state = new SharedArrayBuffer(8);
1183
+ const reader = {
1184
+ source,
1185
+ manager,
1186
+ clock: new BigInt64Array(state)
1187
+ };
1188
+ const readers = TRANSCRIPTS_STATE.captureEpochReaders.get(key) ?? /* @__PURE__ */ new Set();
1189
+ readers.add(reader);
1190
+ TRANSCRIPTS_STATE.captureEpochReaders.set(key, readers);
1191
+ publishCaptureEpoch(key);
1192
+ let closed = false;
1193
+ return {
1194
+ state,
1195
+ resolve(epoch) {
1196
+ if (closed || epoch === 0n) return;
1197
+ const capture = captures.get(key);
1198
+ return capture?.recordingEpoch === epoch ? capture : void 0;
1199
+ },
1200
+ close() {
1201
+ if (closed) return;
1202
+ closed = true;
1203
+ Atomics.store(reader.clock, 0, 0n);
1204
+ readers.delete(reader);
1205
+ if (readers.size === 0) TRANSCRIPTS_STATE.captureEpochReaders.delete(key);
1206
+ }
1207
+ };
1208
+ }
1321
1209
  function notifyCaptureRetired(capture) {
1322
1210
  if (!capture?.onStatus) return;
1323
1211
  try {
@@ -1352,11 +1240,14 @@ function setDiscordTranscriptsVoiceManager(params) {
1352
1240
  if (params.manager) {
1353
1241
  const manager = params.manager;
1354
1242
  managersByAccountId.set(params.accountId, manager);
1243
+ publishAccountCaptureEpochs(params.accountId);
1355
1244
  for (const capture of captures.values()) if (capture.started && capture.source.accountId === params.accountId) manager.startTranscriptsCapture(capture.source).then((result) => {
1356
1245
  if (!result.ok && resolveDiscordTranscriptsCapture(capture.source, manager)?.subscriptionToken === capture.subscriptionToken) logger.warn(`discord voice: transcripts reattach failed: ${result.message}`);
1357
1246
  }).catch((error) => logger.warn(`discord voice: transcripts reattach failed: ${formatErrorMessage(error)}`));
1358
- } else if (managersByAccountId.get(params.accountId) === params.expectedManager) managersByAccountId.delete(params.accountId);
1359
- else return;
1247
+ } else if (managersByAccountId.get(params.accountId) === params.expectedManager) {
1248
+ managersByAccountId.delete(params.accountId);
1249
+ publishAccountCaptureEpochs(params.accountId);
1250
+ } else return;
1360
1251
  for (const waiter of managerWaiters) if (!waiter.accountId || waiter.accountId === params.accountId) waiter.resolve();
1361
1252
  }
1362
1253
  const resolveDiscordTranscriptsAccountId = ({ cfg, source }) => {
@@ -1622,6 +1513,7 @@ const discordVoiceTranscriptsSourceProvider = {
1622
1513
  const previous = captures.get(key);
1623
1514
  const capture = {
1624
1515
  source,
1516
+ recordingEpoch: ++TRANSCRIPTS_STATE.nextRecordingEpoch,
1625
1517
  subscriptionToken: previous?.started ? previous.subscriptionToken : Symbol("discord-transcripts-subscription"),
1626
1518
  started: false,
1627
1519
  onStatus: request.onStatus,
@@ -1637,6 +1529,7 @@ const discordVoiceTranscriptsSourceProvider = {
1637
1529
  }
1638
1530
  };
1639
1531
  captures.set(key, capture);
1532
+ publishCaptureEpoch(key);
1640
1533
  notifyCaptureRetired(previous);
1641
1534
  try {
1642
1535
  let channelName = previous?.channelName;
@@ -1671,6 +1564,7 @@ const discordVoiceTranscriptsSourceProvider = {
1671
1564
  } finally {
1672
1565
  if (!capture.started && captures.get(key) === capture) {
1673
1566
  captures.delete(key);
1567
+ publishCaptureEpoch(key);
1674
1568
  notifyCaptureRetired(capture);
1675
1569
  await manager.stopTranscriptsCapture(source);
1676
1570
  }
@@ -1700,6 +1594,7 @@ const discordVoiceTranscriptsSourceProvider = {
1700
1594
  error: "Transcripts session is not active in this voice channel."
1701
1595
  };
1702
1596
  captures.delete(key);
1597
+ publishCaptureEpoch(key);
1703
1598
  notifyCaptureRetired(capture);
1704
1599
  await managersByAccountId.get(accountId)?.stopTranscriptsCapture(source);
1705
1600
  return {
@@ -1723,4 +1618,4 @@ const discordVoiceTranscriptsSourceProvider = {
1723
1618
  }
1724
1619
  };
1725
1620
  //#endregion
1726
- export { resolveDiscordChannelInfo as A, resolveMediaList as C, resolveDiscordMessageStickers as D, hasDiscordMessageStickers as E, resolveDiscordReferencedReplyMessage as O, resolveForwardedMediaList as S, resolveDiscordCdnPolicy as T, resolveDiscordMessageBatch as _, buildProviderConfigs as a, resolveDiscordMessageText as b, resolveDiscordVoiceAccess as c, resolveFetchedDiscordThreadLikeChannelContext as d, threading_exports as f, sanitizeDiscordThreadName as g, resolveDiscordThreadStarter as h, buildProviderConfigOverrides as i, resolveDiscordMessageChannelId as j, resolveDiscordReferencedReplyMessageId as k, resolveDiscordVoiceAccessTarget as l, resolveDiscordReplyTarget as m, resolveDiscordTranscriptsCapture as n, resolveDiscordVoiceEnabled as o, resolveDiscordAutoThreadReplyPlan as p, setDiscordTranscriptsVoiceManager as r, authorizeDiscordVoiceIngress as s, discordVoiceTranscriptsSourceProvider as t, resolveDiscordThreadLikeChannelContext as u, resolveDiscordMessageHistoryText as v, resolveReferencedReplyMediaList as w, formatDiscordMediaText as x, resolveDiscordMessageMentionDocuments as y };
1621
+ export { resolveDiscordMessageChannelId as A, resolveReferencedReplyMediaList as C, resolveDiscordReferencedReplyMessage as D, resolveDiscordMessageStickers as E, resolveDiscordReferencedReplyMessageId as O, resolveMediaList as S, hasDiscordMessageStickers as T, resolveDiscordMessageHistoryText as _, resolveDiscordVoiceEnabled as a, formatDiscordMediaText as b, resolveDiscordVoiceAccessTarget as c, threading_exports as d, resolveDiscordAutoThreadReplyPlan as f, resolveDiscordMessageBatch as g, sanitizeDiscordThreadName as h, setDiscordTranscriptsVoiceManager as i, resolveDiscordChannelInfo as k, resolveDiscordThreadLikeChannelContext as l, resolveDiscordThreadStarter as m, discordVoiceTranscriptsSourceProvider as n, authorizeDiscordVoiceIngress as o, resolveDiscordReplyTarget as p, resolveDiscordTranscriptsCapture as r, resolveDiscordVoiceAccess as s, bindDiscordCaptureReceipts as t, resolveFetchedDiscordThreadLikeChannelContext as u, resolveDiscordMessageMentionDocuments as v, resolveDiscordCdnPolicy as w, resolveForwardedMediaList as x, resolveDiscordMessageText as y };
@@ -1,4 +1,5 @@
1
- import { Ut as __exportAll, xt as sendChannelTyping } from "./discord-BXpHW-cu.mjs";
1
+ import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
+ import { St as sendChannelTyping } from "./discord-0xJYfdDD.mjs";
2
3
  import { c as raceWithTimeout } from "./timeouts-D86uWLt_.mjs";
3
4
  //#region extensions/discord/src/monitor/typing.ts
4
5
  var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });