@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
@@ -0,0 +1,159 @@
1
+ import { n as __reExport, t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
+ //#region packages/normalization-core/src/record-coerce.ts
3
+ /** Type guard for non-array object records at browser-safe boundaries. */
4
+ function isRecord(value) {
5
+ return value !== null && typeof value === "object" && !Array.isArray(value);
6
+ }
7
+ /** Returns a non-array record or null. */
8
+ function asNullableRecord(value) {
9
+ return isRecord(value) ? value : null;
10
+ }
11
+ //#endregion
12
+ //#region src/config/channel-config-normalization.ts
13
+ /** Applies one channel-specific doctor migration to every object-shaped account. */
14
+ function normalizeChannelAccounts(params) {
15
+ const rawAccounts = asNullableRecord(params.entry.accounts);
16
+ if (!rawAccounts) return {
17
+ entry: params.entry,
18
+ changed: false
19
+ };
20
+ let changed = false;
21
+ const accounts = { ...rawAccounts };
22
+ for (const [accountId, value] of Object.entries(rawAccounts)) {
23
+ const account = asNullableRecord(value);
24
+ if (!account) continue;
25
+ const normalized = params.normalizeAccount({
26
+ account,
27
+ accountId,
28
+ pathPrefix: `${params.pathPrefix}.accounts.${accountId}`,
29
+ changes: params.changes
30
+ });
31
+ if (normalized.changed) {
32
+ accounts[accountId] = normalized.entry;
33
+ changed = true;
34
+ }
35
+ }
36
+ return changed ? {
37
+ entry: {
38
+ ...params.entry,
39
+ accounts
40
+ },
41
+ changed: true
42
+ } : {
43
+ entry: params.entry,
44
+ changed: false
45
+ };
46
+ }
47
+ /** Applies the same channel-specific doctor migration at root and account scope. */
48
+ function normalizeChannelConfigEntries(params) {
49
+ const changes = params.changes ?? [];
50
+ const channels = params.cfg.channels;
51
+ const entry = asNullableRecord(channels?.[params.channelId]);
52
+ if (!entry) return {
53
+ config: params.cfg,
54
+ changes
55
+ };
56
+ const channelPath = `channels.${params.channelId}`;
57
+ const root = params.normalizeEntry({
58
+ entry,
59
+ pathPrefix: channelPath,
60
+ changes
61
+ });
62
+ const accounts = normalizeChannelAccounts({
63
+ entry: root.entry,
64
+ pathPrefix: channelPath,
65
+ changes,
66
+ normalizeAccount: (accountParams) => params.normalizeEntry({
67
+ entry: accountParams.account,
68
+ accountId: accountParams.accountId,
69
+ pathPrefix: accountParams.pathPrefix,
70
+ changes: accountParams.changes
71
+ })
72
+ });
73
+ if (!root.changed && !accounts.changed) return {
74
+ config: params.cfg,
75
+ changes
76
+ };
77
+ return {
78
+ config: {
79
+ ...params.cfg,
80
+ channels: {
81
+ ...channels,
82
+ [params.channelId]: accounts.entry
83
+ }
84
+ },
85
+ changes
86
+ };
87
+ }
88
+ //#endregion
89
+ //#region src/plugin-sdk/legacy-webhook-listener-migration.ts
90
+ /** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
91
+ function createLegacyWebhookListenerDoctorContract(params) {
92
+ const portKey = params.portKey ?? "webhookPort";
93
+ const hostKey = params.hostKey === void 0 ? "webhookHost" : params.hostKey;
94
+ const source = (entry) => params.webhookKey ? asNullableRecord(entry[params.webhookKey]) : entry;
95
+ const hasLegacy = (value) => {
96
+ const entry = asNullableRecord(value);
97
+ const listener = entry && source(entry);
98
+ return Boolean(listener && (Object.hasOwn(listener, portKey) || hostKey && Object.hasOwn(listener, hostKey)));
99
+ };
100
+ const prefix = `channels.${params.channelKey}`;
101
+ return {
102
+ legacyConfigRules: [{
103
+ path: ["channels", params.channelKey],
104
+ message: `${prefix} webhook listeners moved to Gateway routes. Run "openclaw doctor --fix" to preserve explicitly configured listener settings as legacyWebhook.`,
105
+ match: (value) => {
106
+ const accounts = asNullableRecord(asNullableRecord(value)?.accounts);
107
+ return hasLegacy(value) || Object.values(accounts ?? {}).some(hasLegacy);
108
+ }
109
+ }],
110
+ normalizeCompatibilityConfig: ({ cfg }) => {
111
+ const root = asNullableRecord(asNullableRecord(cfg.channels)?.[params.channelKey]);
112
+ const inherited = root && source(root);
113
+ const canonicalRoot = asNullableRecord(root?.legacyWebhook);
114
+ return normalizeChannelConfigEntries({
115
+ cfg,
116
+ channelId: params.channelKey,
117
+ normalizeEntry: ({ entry, accountId, pathPrefix, changes }) => {
118
+ const listener = source(entry);
119
+ if (!listener || !hasLegacy(entry)) return {
120
+ entry,
121
+ changed: false
122
+ };
123
+ const next = { ...entry };
124
+ const port = Object.hasOwn(listener, portKey) ? listener[portKey] : (accountId ? canonicalRoot?.port ?? inherited?.[portKey] : void 0) ?? params.defaultPort;
125
+ const inheritedHost = accountId ? canonicalRoot ? canonicalRoot.host : (hostKey ? inherited?.[hostKey] : void 0) ?? params.defaultHost : params.defaultHost;
126
+ const host = hostKey ? listener[hostKey] ?? inheritedHost : inheritedHost;
127
+ const legacyPath = [pathPrefix, params.webhookKey].filter(Boolean).join(".");
128
+ if (Object.hasOwn(entry, "legacyWebhook")) changes.push(`Removed ${legacyPath} legacy listener keys; ${pathPrefix}.legacyWebhook is already configured.`);
129
+ else if (accountId && root?.legacyWebhook === false) changes.push(`Removed ${legacyPath} legacy listener keys; ${prefix}.legacyWebhook: false keeps this account's inherited listener disabled.`);
130
+ else {
131
+ next.legacyWebhook = {
132
+ port,
133
+ ...host !== void 0 ? { host } : {}
134
+ };
135
+ changes.push(`Moved ${legacyPath} listener settings to ${pathPrefix}.legacyWebhook. Point the external callback or reverse proxy at the Gateway port and webhook path, verify delivery, then set legacyWebhook: false to disable legacy forwarding.`);
136
+ }
137
+ const updated = params.webhookKey ? { ...listener } : next;
138
+ delete updated[portKey];
139
+ if (hostKey) delete updated[hostKey];
140
+ if (params.webhookKey) {
141
+ if (Object.keys(updated).length) next[params.webhookKey] = updated;
142
+ else delete next[params.webhookKey];
143
+ }
144
+ return {
145
+ entry: next,
146
+ changed: true
147
+ };
148
+ }
149
+ });
150
+ }
151
+ };
152
+ }
153
+ //#endregion
154
+ //#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
155
+ var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
156
+ import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
157
+ __reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
158
+ //#endregion
159
+ export { runtime_doctor_migrations_exports as t };
@@ -1,5 +1,5 @@
1
- import { c as resolveDiscordAccount, g as selectDiscordActivitiesRuntimeConfig, n as isDiscordAccountEnabledForRuntime, r as listDiscordAccountIds } from "./accounts-CwJQoLjM.mjs";
2
- import { z as resolveDiscordProxyFetchForAccount } from "./send.shared-Zwx6BxQ5.mjs";
1
+ import { c as resolveDiscordAccount, g as selectDiscordActivitiesRuntimeConfig, n as isDiscordAccountEnabledForRuntime, r as listDiscordAccountIds } from "./accounts-ChaMcixG.mjs";
2
+ import { R as resolveDiscordProxyFetchForAccount } from "./send.shared-DGFkbkQR.mjs";
3
3
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/discord/src/activities/config.ts
5
5
  function resolveDiscordActivitiesConfig(account, env = process.env) {
@@ -65,9 +65,6 @@ var DiscordActivitiesRuntime = class {
65
65
  hasEnabledAccounts(cfg = this.currentConfig()) {
66
66
  return listDiscordAccountIds(cfg).some((accountId) => this.resolveAccount(accountId, cfg) !== null);
67
67
  }
68
- isAccountEnabled(accountId, cfg = this.currentConfig()) {
69
- return this.resolveAccount(accountId, cfg) !== null;
70
- }
71
68
  };
72
69
  let activeRuntime;
73
70
  function setDiscordActivitiesRuntime(runtime) {
@@ -1,98 +1,28 @@
1
1
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
2
- import { collectNestedChannelFieldAssignments, collectSimpleChannelFieldAssignments, getChannelSurface, hasConfiguredSecretInputValue, isBaseFieldActiveForChannelSurface, isEnabledFlag, isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
2
+ import { collectNestedChannelFieldAssignments, collectSimpleChannelFieldAssignments, createChannelSecretTargetRegistryEntries, getChannelSurface, hasConfiguredSecretInputValue, isBaseFieldActiveForChannelSurface, isEnabledFlag, isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
3
3
  import { collectNestedChannelTtsAssignments } from "openclaw/plugin-sdk/channel-secret-tts-runtime";
4
4
  //#region extensions/discord/src/secret-config-contract.ts
5
- function createVoiceProviderSecretTarget(params) {
6
- const path = `${params.scope === "account" ? "channels.discord.accounts.*" : "channels.discord"}.voice.${params.providerPath}.providers.*.apiKey`;
7
- return {
8
- id: path,
9
- targetType: path,
10
- configFile: "openclaw.json",
11
- pathPattern: path,
12
- secretShape: "secret_input",
13
- expectedResolvedValue: "string",
14
- includeInPlan: true,
15
- includeInConfigure: true,
16
- includeInAudit: true,
17
- providerIdPathSegmentIndex: path.split(".").length - 2
18
- };
19
- }
20
5
  function discordRealtimeVoiceSecretOwnerId(accountId, providerId) {
21
6
  return `discord:voice:realtime:${normalizeAccountId(accountId)}:${providerId}`;
22
7
  }
23
8
  function isRealtimeVoiceActive(value) {
24
9
  return isRecord(value) && isEnabledFlag(value) && value.mode !== "stt-tts";
25
10
  }
26
- const secretTargetRegistryEntries = [
27
- {
28
- id: "channels.discord.accounts.*.pluralkit.token",
29
- targetType: "channels.discord.accounts.*.pluralkit.token",
30
- configFile: "openclaw.json",
31
- pathPattern: "channels.discord.accounts.*.pluralkit.token",
32
- secretShape: "secret_input",
33
- expectedResolvedValue: "string",
34
- includeInPlan: true,
35
- includeInConfigure: true,
36
- includeInAudit: true
37
- },
38
- {
39
- id: "channels.discord.accounts.*.token",
40
- targetType: "channels.discord.accounts.*.token",
41
- configFile: "openclaw.json",
42
- pathPattern: "channels.discord.accounts.*.token",
43
- secretShape: "secret_input",
44
- expectedResolvedValue: "string",
45
- includeInPlan: true,
46
- includeInConfigure: true,
47
- includeInAudit: true
48
- },
49
- createVoiceProviderSecretTarget({
50
- providerPath: "realtime",
51
- scope: "account"
52
- }),
53
- createVoiceProviderSecretTarget({
54
- providerPath: "tts",
55
- scope: "account"
56
- }),
57
- createVoiceProviderSecretTarget({
58
- providerPath: "tts.personas.*",
59
- scope: "account"
60
- }),
61
- {
62
- id: "channels.discord.pluralkit.token",
63
- targetType: "channels.discord.pluralkit.token",
64
- configFile: "openclaw.json",
65
- pathPattern: "channels.discord.pluralkit.token",
66
- secretShape: "secret_input",
67
- expectedResolvedValue: "string",
68
- includeInPlan: true,
69
- includeInConfigure: true,
70
- includeInAudit: true
71
- },
72
- {
73
- id: "channels.discord.token",
74
- targetType: "channels.discord.token",
75
- configFile: "openclaw.json",
76
- pathPattern: "channels.discord.token",
77
- secretShape: "secret_input",
78
- expectedResolvedValue: "string",
79
- includeInPlan: true,
80
- includeInConfigure: true,
81
- includeInAudit: true
82
- },
83
- createVoiceProviderSecretTarget({
84
- providerPath: "realtime",
85
- scope: "channel"
86
- }),
87
- createVoiceProviderSecretTarget({
88
- providerPath: "tts",
89
- scope: "channel"
90
- }),
91
- createVoiceProviderSecretTarget({
92
- providerPath: "tts.personas.*",
93
- scope: "channel"
94
- })
11
+ const secretPaths = [
12
+ "pluralkit.token",
13
+ "token",
14
+ "voice.realtime.providers.*.apiKey",
15
+ "voice.tts.providers.*.apiKey",
16
+ "voice.tts.personas.*.providers.*.apiKey"
95
17
  ];
18
+ const secretTargetRegistryEntries = createChannelSecretTargetRegistryEntries({
19
+ channelKey: "discord",
20
+ account: secretPaths,
21
+ channel: secretPaths
22
+ }).map((entry) => {
23
+ if (entry.pathPattern.endsWith(".providers.*.apiKey")) entry.providerIdPathSegmentIndex = entry.pathPattern.split(".").length - 2;
24
+ return entry;
25
+ });
96
26
  function collectRuntimeConfigAssignments(params) {
97
27
  const resolved = getChannelSurface(params.config, "discord");
98
28
  if (!resolved) return;
@@ -1,3 +1,4 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
1
2
  import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.mjs";
2
3
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
4
  import { readChannelAllowFromStore } from "openclaw/plugin-sdk/conversation-runtime";
@@ -5,6 +6,7 @@ import { coerceNativeSetting, normalizeAllowFromList } from "openclaw/plugin-sdk
5
6
  import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
6
7
  import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
7
8
  //#region extensions/discord/src/security-audit.ts
9
+ var security_audit_exports = /* @__PURE__ */ __exportAll({ collectDiscordSecurityAuditFindings: () => collectDiscordSecurityAuditFindings });
8
10
  function isWildcardEntry(value) {
9
11
  return String(value).trim() === "*";
10
12
  }
@@ -143,4 +145,4 @@ async function collectDiscordSecurityAuditFindings(params) {
143
145
  return findings;
144
146
  }
145
147
  //#endregion
146
- export { collectDiscordSecurityAuditFindings as t };
148
+ export { security_audit_exports as n, collectDiscordSecurityAuditFindings as t };
@@ -1,58 +1,62 @@
1
- import { At as getGuild, Bt as removeGuildMember, C as withDiscordRequestAuthority, Ct as addGuildMemberRole, Dt as createGuildScheduledEvent, Et as createGuildEmoji, Ft as listGuildEmojis, Ht as timeoutGuildMember, It as listGuildRoles, Lt as listGuildScheduledEvents, Mt as getGuildVoiceState, Nt as listGuildActiveThreads, Ot as createGuildSticker, Pt as listGuildChannels, Rt as moveGuildChannels, S as readRetryAfter, St as unpinChannelMessage, Tt as createGuildChannel, Ut as __exportAll, Vt as removeGuildMemberRole, _ as DiscordError, _t as listChannelMessages, at as deleteOwnMessageReaction, b as readDiscordCode, bt as searchGuildMessages, ct as createThread, dt as editChannel, ft as editChannelMessage, gt as listChannelArchivedThreads, it as createOwnMessageReaction, jt as getGuildMember, kt as deleteChannelPermission, lt as deleteChannel, mt as getChannelMessage, ot as listMessageReactionUsers, pt as getChannel, ut as deleteChannelMessage, v as RateLimitError, vt as listChannelPins, wt as createGuildBan, x as readDiscordMessage, xt as sendChannelTyping, y as isUnknownDiscordVoiceStateError, yt as pinChannelMessage, zt as putChannelPermission } from "./discord-BXpHW-cu.mjs";
2
- import { D as resolveDiscordEndpointAttachmentGuard, E as getDiscordEndpointRuntime, w as parseDiscordRetryAfterBodySeconds } from "./channel-type-DKnjV1XW.mjs";
3
- import { a as recordDiscordMessageCreateAmbiguity, c as createDiscordSendReceiptFromResults, d as createReusableDiscordReplyReference, f as resolveDiscordReplyMessageId, l as createDiscordSendResult, n as classifyDiscordDeliveryFailure, o as chunkDiscordTextWithMode, r as createDiscordRetryRunner } from "./retry-DBfcEgmO.mjs";
4
- import { C as hasAllGuildPermissionsDiscord, I as resolveDiscordClientAccountContext, K as parseAndResolveChannelRecipient, L as resolveDiscordRest, M as resolveDiscordSuppressEmbeds, N as createDiscordClient, O as createDiscordMessageNonce, R as DISCORD_REST_TIMEOUT_MS, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, _ as DiscordSendError, b as canViewDiscordGuildChannel, g as DISCORD_MAX_STICKER_BYTES, h as DISCORD_MAX_EVENT_COVER_BYTES, i as formatReactionEmoji, k as resolveDiscordMessageFlags, l as resolveChannelId, m as DISCORD_MAX_EMOJI_BYTES, n as buildDiscordTextChunks, o as normalizeEmojiName, p as sendDiscordText, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-Zwx6BxQ5.mjs";
5
- import { i as prepareDiscordOutboundText, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-D0hQ7s50.mjs";
1
+ import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
+ import { At as deleteChannelPermission, Bt as putChannelPermission, C as withDiscordRequestAuthority, Ct as unpinChannelMessage, Dt as createGuildEmoji, Et as createGuildChannel, Ft as listGuildChannels, Ht as removeGuildMemberRole, It as listGuildEmojis, Lt as listGuildRoles, Mt as getGuildMember, Nt as getGuildVoiceState, Ot as createGuildScheduledEvent, Pt as listGuildActiveThreads, Rt as listGuildScheduledEvents, S as readRetryAfter, St as sendChannelTyping, Tt as createGuildBan, Ut as timeoutGuildMember, Vt as removeGuildMember, _ as DiscordError, _t as listChannelArchivedThreads, at as createOwnMessageReaction, b as readDiscordCode, bt as pinChannelMessage, dt as deleteChannelMessage, ft as editChannel, ht as getChannelMessage, jt as getGuild, kt as createGuildSticker, lt as createThread, mt as getChannel, ot as deleteOwnMessageReaction, pt as editChannelMessage, st as listMessageReactionUsers, tt as stripUndefinedFields, ut as deleteChannel, v as RateLimitError, vt as listChannelMessages, wt as addGuildMemberRole, x as readDiscordMessage, xt as searchGuildMessages, y as isUnknownDiscordVoiceStateError, yt as listChannelPins, zt as moveGuildChannels } from "./discord-0xJYfdDD.mjs";
3
+ import { D as getDiscordEndpointRuntime, O as resolveDiscordEndpointAttachmentGuard, T as parseDiscordRetryAfterBodySeconds } from "./channel-type-DRCrEMss.mjs";
4
+ import { o as parseDiscordHttpErrorBody } from "./api-DVbJwZVt.mjs";
5
+ import { a as recordDiscordMessageCreateAmbiguity, f as createReusableDiscordReplyReference, l as createDiscordSendReceiptFromResults, n as classifyDiscordDeliveryFailure, o as chunkDiscordTextWithMode, p as resolveDiscordReplyMessageId, r as createDiscordRetryRunner, u as createDiscordSendResult } from "./retry-pz_cSha2.mjs";
6
+ import { C as hasAnyChannelPermissionDiscord, D as createDiscordMessageNonce, F as resolveDiscordClientAccountContext, G as parseAndResolveChannelRecipient, I as resolveDiscordRest, L as DISCORD_REST_TIMEOUT_MS, M as createDiscordClient, O as resolveDiscordMessageFlags, S as hasAllGuildPermissionsDiscord, _ as canManageGuildMemberRoleDiscord, a as normalizeEmojiName, b as fetchChannelPermissionsDiscord, c as resolveChannelId, f as sendDiscordText, g as DiscordSendError, h as DISCORD_MAX_STICKER_BYTES, j as resolveDiscordSuppressEmbeds, m as DISCORD_MAX_EVENT_COVER_BYTES, n as buildDiscordTextChunks, o as normalizeReactionEmoji, p as DISCORD_MAX_EMOJI_BYTES, r as buildReactionIdentifier, t as buildDiscordSendError, v as canManageGuildRoleDiscord, w as hasAnyGuildPermissionDiscord, x as fetchMemberGuildPermissionsDiscord, y as canViewDiscordGuildChannel } from "./send.shared-DGFkbkQR.mjs";
7
+ import { i as prepareDiscordOutboundText, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-BISKnb-a.mjs";
6
8
  import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-D86uWLt_.mjs";
7
9
  import fs from "node:fs/promises";
8
10
  import { ChannelType } from "discord-api-types/v10";
9
11
  import crypto from "node:crypto";
10
- import { parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
11
12
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
13
+ import { parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
12
14
  import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
13
15
  import { formatErrorMessage as formatErrorMessage$1 } from "openclaw/plugin-sdk/error-runtime";
14
16
  import { readProviderJsonResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
15
17
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
16
18
  import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
17
19
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
18
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
19
20
  import { recordOutboundMessageIdentity } from "openclaw/plugin-sdk/channel-outbound";
20
21
  import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, buildOutboundMediaLoadOptions, extensionForMime, maxBytesForKind, parseFfprobeCodecAndSampleRate, runFfmpeg, runFfprobe, unlinkIfExists } from "openclaw/plugin-sdk/media-runtime";
21
22
  import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
23
+ import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
22
24
  import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
23
25
  import path from "node:path";
24
- import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
25
26
  import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
26
27
  //#region extensions/discord/src/send.channels.ts
27
28
  async function createChannelDiscord(payload, opts) {
28
29
  const rest = resolveDiscordRest(opts);
29
- const body = { name: payload.name };
30
- if (payload.type !== void 0) body.type = payload.type;
31
- if (payload.parentId) body.parent_id = payload.parentId;
32
- if (payload.topic) body.topic = payload.topic;
33
- if (payload.position !== void 0) body.position = payload.position;
34
- if (payload.nsfw !== void 0) body.nsfw = payload.nsfw;
30
+ const body = stripUndefinedFields({
31
+ name: payload.name,
32
+ type: payload.type,
33
+ parent_id: payload.parentId || void 0,
34
+ topic: payload.topic || void 0,
35
+ position: payload.position,
36
+ nsfw: payload.nsfw
37
+ });
35
38
  return await createGuildChannel(rest, payload.guildId, { body });
36
39
  }
37
40
  async function editChannelDiscord(payload, opts) {
38
41
  const rest = resolveDiscordRest(opts);
39
- const body = {};
40
- if (payload.name !== void 0) body.name = payload.name;
41
- if (payload.topic !== void 0) body.topic = payload.topic;
42
- if (payload.position !== void 0) body.position = payload.position;
43
- if (payload.parentId !== void 0) body.parent_id = payload.parentId;
44
- if (payload.nsfw !== void 0) body.nsfw = payload.nsfw;
45
- if (payload.rateLimitPerUser !== void 0) body.rate_limit_per_user = payload.rateLimitPerUser;
46
- if (payload.archived !== void 0) body.archived = payload.archived;
47
- if (payload.locked !== void 0) body.locked = payload.locked;
48
- if (payload.autoArchiveDuration !== void 0) body.auto_archive_duration = payload.autoArchiveDuration;
49
- if (payload.availableTags !== void 0) body.available_tags = payload.availableTags.map((t) => ({
50
- ...t.id !== void 0 && { id: t.id },
51
- name: t.name,
52
- ...t.moderated !== void 0 && { moderated: t.moderated },
53
- ...t.emoji_id !== void 0 && { emoji_id: t.emoji_id },
54
- ...t.emoji_name !== void 0 && { emoji_name: t.emoji_name }
55
- }));
42
+ const body = stripUndefinedFields({
43
+ name: payload.name,
44
+ topic: payload.topic,
45
+ position: payload.position,
46
+ parent_id: payload.parentId,
47
+ nsfw: payload.nsfw,
48
+ rate_limit_per_user: payload.rateLimitPerUser,
49
+ archived: payload.archived,
50
+ locked: payload.locked,
51
+ auto_archive_duration: payload.autoArchiveDuration,
52
+ available_tags: payload.availableTags === void 0 ? void 0 : payload.availableTags.map((tag) => stripUndefinedFields({
53
+ id: tag.id,
54
+ name: tag.name,
55
+ moderated: tag.moderated,
56
+ emoji_id: tag.emoji_id,
57
+ emoji_name: tag.emoji_name
58
+ }))
59
+ });
56
60
  return await editChannel(rest, payload.channelId, { body });
57
61
  }
58
62
  async function deleteChannelDiscord(channelId, opts) {
@@ -75,9 +79,11 @@ async function moveChannelDiscord(payload, opts) {
75
79
  }
76
80
  async function setChannelPermissionDiscord(payload, opts) {
77
81
  const rest = resolveDiscordRest(opts);
78
- const body = { type: payload.targetType };
79
- if (payload.allow !== void 0) body.allow = payload.allow;
80
- if (payload.deny !== void 0) body.deny = payload.deny;
82
+ const body = stripUndefinedFields({
83
+ type: payload.targetType,
84
+ allow: payload.allow,
85
+ deny: payload.deny
86
+ });
81
87
  await putChannelPermission(rest, payload.channelId, payload.targetId, { body });
82
88
  return { ok: true };
83
89
  }
@@ -302,7 +308,8 @@ async function editMessageDiscord(channelId, messageId, payload, opts) {
302
308
  const rest = resolveDiscordRest(opts);
303
309
  return await editChannelMessage(rest, channelId, messageId, { body: {
304
310
  content: payload.content,
305
- ...payload.flags !== void 0 ? { flags: payload.flags } : {}
311
+ ...payload.flags !== void 0 ? { flags: payload.flags } : {},
312
+ ...payload.allowedMentions ? { allowed_mentions: payload.allowedMentions } : {}
306
313
  } });
307
314
  }
308
315
  async function deleteMessageDiscord(channelId, messageId, opts) {
@@ -325,6 +332,7 @@ async function listPinsDiscord(channelId, opts) {
325
332
  return await listChannelPins(rest, channelId);
326
333
  }
327
334
  async function createThreadDiscord(channelId, payload, opts) {
335
+ const assertCreateAllowed = opts.assertCreateAllowed;
328
336
  const { rest, request } = createDiscordClient(opts);
329
337
  const body = { name: payload.name };
330
338
  if (!payload.messageId && payload.type !== void 0) body.type = payload.type;
@@ -342,11 +350,14 @@ async function createThreadDiscord(channelId, payload, opts) {
342
350
  if (payload.appliedTags?.length) body.applied_tags = payload.appliedTags;
343
351
  }
344
352
  if (!payload.messageId && !isForumLike && body.type === void 0) body.type = ChannelType.PublicThread;
345
- const thread = await createThread(rest, channelId, { body }, payload.messageId);
353
+ const thread = await withDiscordRequestAuthority(assertCreateAllowed, () => {
354
+ assertCreateAllowed?.();
355
+ return createThread(rest, channelId, { body }, payload.messageId);
356
+ });
346
357
  const followupChunks = isForumLike ? initialMessageChunks.slice(1) : initialMessageChunks;
358
+ const deliveredMessageIds = isForumLike ? [resolveDiscordThreadStarterMessageId(thread)] : [];
359
+ let deliveredChunkCount = isForumLike ? 1 : 0;
347
360
  if (followupChunks.length && "id" in thread) {
348
- const deliveredMessageIds = isForumLike ? [resolveDiscordThreadStarterMessageId(thread)] : [];
349
- let deliveredChunkCount = isForumLike ? 1 : 0;
350
361
  const firstFollowupChunkIndex = isForumLike ? 1 : 0;
351
362
  for (const [followupIndex, content] of followupChunks.entries()) {
352
363
  let chunkMayHaveDelivered = false;
@@ -383,7 +394,16 @@ async function createThreadDiscord(channelId, payload, opts) {
383
394
  }
384
395
  }
385
396
  }
386
- return thread;
397
+ return deliveredChunkCount > 0 ? {
398
+ ...thread,
399
+ initialMessageDelivery: {
400
+ status: "delivered",
401
+ starterMessageDelivered: isForumLike,
402
+ deliveredChunkCount,
403
+ deliveredMessageIds,
404
+ totalChunkCount: initialMessageChunks.length
405
+ }
406
+ } : thread;
387
407
  }
388
408
  async function listThreadsDiscord(payload, opts) {
389
409
  const rest = resolveDiscordRest(opts);
@@ -420,23 +440,16 @@ async function searchMessagesDiscord(query, opts) {
420
440
  //#region extensions/discord/src/send.webhook.ts
421
441
  const DISCORD_WEBHOOK_ERROR_BODY_LIMIT_BYTES = 8192;
422
442
  const DISCORD_WEBHOOK_TIMEOUT_MS = DISCORD_REST_TIMEOUT_MS;
423
- function coerceWebhookErrorBody(raw) {
424
- if (!raw) return;
425
- try {
426
- return JSON.parse(raw);
427
- } catch {
428
- return { message: truncateUtf16Safe(raw, 200) };
429
- }
430
- }
431
443
  function throwIfWebhookDeadlineExpired(signal) {
432
444
  if (!signal?.aborted) return;
433
445
  throw signal.reason instanceof Error ? signal.reason : /* @__PURE__ */ new Error("Discord webhook send timed out");
434
446
  }
435
447
  async function throwWebhookResponseError(response, signal) {
436
- const parsed = coerceWebhookErrorBody(await readResponseTextLimited(response, DISCORD_WEBHOOK_ERROR_BODY_LIMIT_BYTES, { chunkTimeoutMs: DISCORD_WEBHOOK_TIMEOUT_MS }).catch(() => {
448
+ const raw = await readResponseTextLimited(response, DISCORD_WEBHOOK_ERROR_BODY_LIMIT_BYTES, { chunkTimeoutMs: DISCORD_WEBHOOK_TIMEOUT_MS }).catch(() => {
437
449
  throwIfWebhookDeadlineExpired(signal);
438
450
  return "";
439
- }));
451
+ });
452
+ const parsed = parseDiscordHttpErrorBody(raw);
440
453
  if (response.status === 429) throw new RateLimitError(response, {
441
454
  message: readDiscordMessage(parsed, "Rate limited"),
442
455
  retry_after: readRetryAfter(parsed, response, 1),
@@ -551,17 +564,6 @@ async function sendWebhookMessageDiscord(text, opts) {
551
564
  }
552
565
  //#endregion
553
566
  //#region extensions/discord/src/voice-message.ts
554
- /**
555
- * Discord Voice Message Support
556
- *
557
- * Implements sending voice messages via Discord's API.
558
- * Voice messages require:
559
- * - OGG/Opus format audio
560
- * - Waveform data (base64 encoded, up to 256 samples, 0-255 values)
561
- * - Duration in seconds
562
- * - Message flag 8192 (IS_VOICE_MESSAGE)
563
- * - No other content (text, embeds, etc.)
564
- */
565
567
  const DISCORD_VOICE_MESSAGE_FLAG = 8192;
566
568
  const WAVEFORM_SAMPLES = 256;
567
569
  const DISCORD_OPUS_SAMPLE_RATE_HZ = 48e3;
@@ -581,12 +583,6 @@ async function runFfmpegToOutput(params) {
581
583
  }
582
584
  });
583
585
  }
584
- function createRateLimitError(response, body) {
585
- return new RateLimitError(response, body);
586
- }
587
- /**
588
- * Get audio duration using ffprobe
589
- */
590
586
  async function getAudioDuration(filePath) {
591
587
  try {
592
588
  const stdout = await runFfprobe([
@@ -606,10 +602,6 @@ async function getAudioDuration(filePath) {
606
602
  throw new Error(`Failed to get audio duration: ${errMessage}`, { cause: err });
607
603
  }
608
604
  }
609
- /**
610
- * Generate waveform data from audio file using ffmpeg
611
- * Returns base64 encoded byte array of amplitude samples (0-255)
612
- */
613
605
  async function generateWaveform(filePath) {
614
606
  try {
615
607
  return await generateWaveformFromPcm(filePath);
@@ -617,9 +609,6 @@ async function generateWaveform(filePath) {
617
609
  return generatePlaceholderWaveform();
618
610
  }
619
611
  }
620
- /**
621
- * Generate waveform by extracting raw PCM data and sampling amplitudes
622
- */
623
612
  async function generateWaveformFromPcm(filePath) {
624
613
  const tempDir = resolvePreferredOpenClawTmpDir();
625
614
  const tempPcm = path.join(tempDir, `waveform-${crypto.randomUUID()}.raw`);
@@ -667,9 +656,6 @@ async function generateWaveformFromPcm(filePath) {
667
656
  await unlinkIfExists(tempPcm);
668
657
  }
669
658
  }
670
- /**
671
- * Generate a placeholder waveform (for when audio processing fails)
672
- */
673
659
  function generatePlaceholderWaveform() {
674
660
  const waveform = [];
675
661
  for (let i = 0; i < WAVEFORM_SAMPLES; i++) {
@@ -746,17 +732,10 @@ async function getVoiceMessageMetadata(filePath) {
746
732
  await waveform;
747
733
  }
748
734
  }
749
- function coerceDiscordErrorBody(raw) {
750
- if (!raw) return;
751
- try {
752
- return JSON.parse(raw);
753
- } catch {
754
- return { message: truncateUtf16Safe(raw, 200) };
755
- }
756
- }
757
735
  async function createVoiceRequestError(response, fallbackMessage) {
758
- const parsed = coerceDiscordErrorBody(await readResponseTextLimited(response, DISCORD_VOICE_ERROR_BODY_LIMIT_BYTES).catch(() => ""));
759
- if (response.status === 429) throw createRateLimitError(response, {
736
+ const raw = await readResponseTextLimited(response, DISCORD_VOICE_ERROR_BODY_LIMIT_BYTES).catch(() => "");
737
+ const parsed = parseDiscordHttpErrorBody(raw);
738
+ if (response.status === 429) throw new RateLimitError(response, {
760
739
  message: readDiscordMessage(parsed, "You are being rate limited."),
761
740
  retry_after: readRetryAfter(parsed, response, 1),
762
741
  global: parsed && typeof parsed === "object" && "global" in parsed ? Boolean(parsed.global) : false
@@ -822,14 +801,6 @@ async function uploadVoiceAttachment(params) {
822
801
  await release();
823
802
  }
824
803
  }
825
- /**
826
- * Send a voice message to Discord
827
- *
828
- * This follows Discord's voice message protocol:
829
- * 1. Request upload URL from Discord
830
- * 2. Upload the OGG file to the provided URL
831
- * 3. Send the message with flag 8192 and attachment metadata
832
- */
833
804
  async function sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, replyTo, request, silent, token, onPlatformSendDispatch, assertPlatformSendAuthorized) {
834
805
  const filename = "voice-message.ogg";
835
806
  const fileSize = audioBuffer.byteLength;
@@ -889,14 +860,6 @@ async function sendDiscordVoiceMessage(rest, channelId, audioBuffer, metadata, r
889
860
  }
890
861
  //#endregion
891
862
  //#region extensions/discord/src/send.voice.ts
892
- function toDiscordSendResult(result, fallbackChannelId, reply) {
893
- return createDiscordSendResult({
894
- result,
895
- fallbackChannelId,
896
- kind: "voice",
897
- reply
898
- });
899
- }
900
863
  async function withMaterializedVoiceMessageInput(mediaUrl, opts, run) {
901
864
  const media = await loadWebMediaRaw(mediaUrl, buildOutboundMediaLoadOptions({
902
865
  maxBytes: maxBytesForKind("audio"),
@@ -912,16 +875,7 @@ async function withMaterializedVoiceMessageInput(mediaUrl, opts, run) {
912
875
  prefix: "voice-src-"
913
876
  }, async (workspace) => await run(await workspace.write(`input${ext}`, media.buffer)));
914
877
  }
915
- /**
916
- * Send a voice message to Discord.
917
- *
918
- * Voice messages are a special Discord feature that displays audio with a waveform
919
- * visualization. They require OGG/Opus format and cannot include text content.
920
- *
921
- * @param to - Recipient (user ID for DM or channel ID)
922
- * @param audioPath - Path to local audio file (will be converted to OGG/Opus if needed)
923
- * @param opts - Send options
924
- */
878
+ /** Discord voice messages require OGG/Opus audio with a waveform and cannot include text. */
925
879
  async function sendVoiceMessageDiscord(to, audioPath, opts) {
926
880
  return await withDiscordRequestAuthority(opts.assertPlatformSendAuthorized, () => sendVoiceMessageDiscordInternal(to, audioPath, opts));
927
881
  }
@@ -955,7 +909,12 @@ async function sendVoiceMessageDiscordInternal(to, audioPath, opts) {
955
909
  accountId: accountInfo.accountId,
956
910
  direction: "outbound"
957
911
  });
958
- return toDiscordSendResult(result, channelId, opts.reply);
912
+ return createDiscordSendResult({
913
+ result,
914
+ fallbackChannelId: channelId,
915
+ kind: "voice",
916
+ reply: opts.reply
917
+ });
959
918
  } catch (err) {
960
919
  if (channelId && rest && token) throw await buildDiscordSendError(err, {
961
920
  channelId,
@@ -1037,7 +996,7 @@ async function fetchReactionsDiscord(channelId, messageId, opts) {
1037
996
  emoji: {
1038
997
  id: reaction.emoji.id ?? null,
1039
998
  name: reaction.emoji.name ?? null,
1040
- raw: formatReactionEmoji(reaction.emoji)
999
+ raw: identifier
1041
1000
  },
1042
1001
  count: reaction.count,
1043
1002
  users: users.map((user) => ({