@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.
- package/assets/icon.png +0 -0
- package/dist/.setup/{account-inspect-BwQj24ht.mjs → account-inspect-De8hOUxG.mjs} +1 -1
- package/dist/.setup/{accounts-CwJQoLjM.mjs → accounts-ChaMcixG.mjs} +1 -4
- package/dist/.setup/{activities-api-DBwRt5ES.mjs → activities-api-tvbsU2e3.mjs} +38 -66
- package/dist/.setup/{api-CBK9zcq5.mjs → api-DVbJwZVt.mjs} +10 -2
- package/dist/.setup/{approval-handler.runtime-Du3n5ypX.mjs → approval-handler.runtime-DxCK2Rux.mjs} +49 -125
- package/dist/.setup/{approval-message-updates-BN7JtScm.mjs → approval-message-updates-BKFqavHZ.mjs} +2 -2
- package/dist/.setup/{audit-C8uaKoa9.mjs → audit-CLg9I71N.mjs} +5 -5
- package/dist/.setup/{channel-ChKdlBgH.mjs → channel-DxlUVU9t.mjs} +125 -228
- package/dist/.setup/{channel-type-DKnjV1XW.mjs → channel-type-DRCrEMss.mjs} +22 -22
- package/dist/.setup/{channel.setup-BlC3-Kzz.mjs → channel.setup-CRo1GjV7.mjs} +6 -9
- package/dist/.setup/{components-MqMWUWnE.mjs → components-Cq1PvIpN.mjs} +42 -71
- package/dist/.setup/{config-schema-CiZz-mtA.mjs → config-schema-oxELUSDx.mjs} +19 -44
- package/dist/.setup/{conversation-binding-route-_rz33QHO.mjs → conversation-binding-route-Caz_XuFH.mjs} +14 -6
- package/dist/.setup/{directory-config-BytTftz-.mjs → directory-config-esqNn0Eo.mjs} +6 -9
- package/dist/.setup/{directory-live--EGTH0DC.mjs → directory-live-DtKRHuGV.mjs} +6 -12
- package/dist/.setup/{discord-BXpHW-cu.mjs → discord-0xJYfdDD.mjs} +82 -386
- package/dist/.setup/{doctor-DxcdkXzz.mjs → doctor-BCl1H5tl.mjs} +21 -36
- package/dist/.setup/{doctor-contract-Co5vRCZ6.mjs → doctor-contract-CvvgwrrG.mjs} +41 -50
- package/dist/.setup/{channel-actions.runtime-CJmiFfps.mjs → handle-action-CUvQWnE7.mjs} +74 -105
- package/dist/.setup/{handle-action.guild-admin-DAFyh_yV.mjs → handle-action.guild-admin-Df-8gVle.mjs} +63 -121
- package/dist/.setup/{live-policy-config-eKQ-PLdy.mjs → live-policy-config-8Pv20CHc.mjs} +2 -3
- package/dist/.setup/{message-handler-DnUrDpaU.mjs → message-handler-B-Jk4oDk.mjs} +18 -93
- package/dist/.setup/message-handler.preflight-pluralkit-CWLUBVcx.mjs +141 -0
- package/dist/.setup/{message-handler.preflight-CtqaF_fb.mjs → message-handler.preflight-v-__NSDq.mjs} +73 -287
- package/dist/.setup/{message-handler.process-Dz1xvuQU.mjs → message-handler.process-BNFFuChn.mjs} +423 -374
- package/dist/.setup/{outbound-adapter-C8v79z9Z.mjs → outbound-adapter-BobT-kse.mjs} +105 -19
- package/dist/.setup/{outbound-session-route-CqWbuMOm.mjs → outbound-session-route-zVGxxceg.mjs} +142 -109
- package/dist/.setup/{pluralkit-CdAt1G0P.mjs → pluralkit-a6_NLfH9.mjs} +1 -1
- package/dist/.setup/{preflight-audio-DrnqFA8U.mjs → preflight-audio-DHGIHEpv.mjs} +2 -1
- package/dist/.setup/{presence-cache-dYSHPWMx.mjs → presence-cache-Di3H3DIU.mjs} +0 -4
- package/dist/.setup/{probe-CupW4we4.mjs → probe-LYrIHlBF.mjs} +13 -4
- package/dist/.setup/{provider-72zIvN-i.mjs → provider-B_G5hASF.mjs} +1112 -1668
- package/dist/.setup/provider-session.runtime-BYlTBFD2.mjs +6 -0
- package/dist/.setup/provider.runtime-CUE3UxER.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-DTccTgTM.mjs → realtime-session.runtime-oUd9DOcz.mjs} +372 -345
- package/dist/.setup/receive-recovery-CHPOsnLc.mjs +514 -0
- package/dist/.setup/{resolve-allowlist-common-CwMBzbx9.mjs → resolve-allowlist-common-DPdRggu5.mjs} +4 -7
- package/dist/.setup/{resolve-channels-BbvsLQOZ.mjs → resolve-channels-BFPNRmVv.mjs} +21 -40
- package/dist/.setup/{resolve-users-ByFlR7LQ.mjs → resolve-users-0-aBuCy3.mjs} +4 -4
- package/dist/.setup/{retry-DBfcEgmO.mjs → retry-pz_cSha2.mjs} +81 -16
- package/dist/.setup/rolldown-runtime-B4FMCO8f.mjs +28 -0
- package/dist/.setup/{runtime-SchNfUsQ.mjs → runtime-FN000lxA.mjs} +83 -166
- package/dist/.setup/runtime-doctor-migrations-CshUGl36.mjs +159 -0
- package/dist/.setup/{runtime-BVoa7hhx.mjs → runtime-sUksZ--Q.mjs} +2 -5
- package/dist/.setup/{secret-config-contract-DFu9hfU8.mjs → secret-config-contract-uOE2J7yM.mjs} +15 -85
- package/dist/.setup/{security-audit-s5w50-Ly.mjs → security-audit-Cdaegq7C.mjs} +3 -1
- package/dist/.setup/{send-CKDczUNL.mjs → send-CrfEI6Bs.mjs} +73 -114
- package/dist/.setup/{send.components-DWQjXhPV.mjs → send.components-DxQAMfES.mjs} +62 -107
- package/dist/.setup/{send.outbound-D0hQ7s50.mjs → send.outbound-BISKnb-a.mjs} +79 -154
- package/dist/.setup/{send.shared-Zwx6BxQ5.mjs → send.shared-DGFkbkQR.mjs} +10 -25
- package/dist/.setup/{sender-identity-0Ymgvmaj.mjs → sender-identity-B9X5Vb9R.mjs} +2 -3
- package/dist/.setup/setup-plugin-api-BQUBxbhe.mjs +3 -0
- package/dist/.setup/{shared-CaA3Vv4n.mjs → shared-B3wZ4hN-.mjs} +25 -32
- package/dist/.setup/{subagent-hooks-Bired9q6.mjs → subagent-hooks-nlUE9ow7.mjs} +5 -6
- package/dist/.setup/system-events-CdeZnvPV.mjs +33 -0
- package/dist/.setup/{target-resolver-B6MrxbYv.mjs → target-resolver-BuLapkhy.mjs} +9 -12
- package/dist/.setup/targets-0KUcEIYx.mjs +3 -0
- package/dist/.setup/{thread-bindings-CK5272V3.mjs → thread-bindings-D7TfgjR_.mjs} +33 -35
- package/dist/.setup/thread-bindings.manager-DN-NissX.mjs +819 -0
- package/dist/.setup/thread-bindings.session-updates-CshfKghV.mjs +359 -0
- package/dist/.setup/{thread-bindings.state-BThFQEga.mjs → thread-bindings.state-g6v9zAym.mjs} +21 -62
- package/dist/.setup/{transcripts-source-CuWYgayu.mjs → transcripts-source-p8EV179h.mjs} +133 -238
- package/dist/.setup/{typing-BKZL5fGj.mjs → typing-BiHCzBRu.mjs} +2 -1
- package/dist/.setup/{voice-runtime-DHVQ2mFz.mjs → voice-runtime-B46rcwrG.mjs} +633 -1085
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +1 -1
- package/dist/api.js +18 -18
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +4 -4
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +20 -20
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +1056 -0
- package/dist/subagent-hooks-api.js +3 -4
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +8 -4
- package/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +8 -4
- package/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +1 -1
- package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +770 -695
- package/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +3 -2
- package/node_modules/@napi-rs/wasm-runtime/package.json +1 -1
- package/node_modules/@tybys/wasm-util/LICENSE +21 -0
- package/node_modules/@tybys/wasm-util/package.json +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +20 -8
- package/node_modules/@types/node/ffi.d.ts +14 -0
- package/node_modules/@types/node/http2.d.ts +3 -2
- package/node_modules/@types/node/net.d.ts +16 -4
- package/node_modules/@types/node/package.json +2 -17
- package/node_modules/@types/node/process.d.ts +1 -0
- package/node_modules/@types/node/quic.d.ts +39 -1
- package/node_modules/@types/node/stream/iter.d.ts +9 -12
- package/node_modules/@types/node/test/reporters.d.ts +1 -0
- package/node_modules/@types/node/test.d.ts +72 -0
- package/node_modules/@types/node/tls.d.ts +14 -10
- package/node_modules/@types/node/vm.d.ts +2 -1
- package/node_modules/@types/node/web-globals/streams.d.ts +4 -0
- package/node_modules/@types/node/worker_threads.d.ts +4 -1
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v4/classic/external.ts +2 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
- package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
- package/node_modules/zod/src/v4/core/api.ts +44 -28
- package/node_modules/zod/src/v4/core/checks.ts +62 -102
- package/node_modules/zod/src/v4/core/compile.ts +218 -93
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/doc.ts +6 -2
- package/node_modules/zod/src/v4/core/errors.ts +3 -6
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
- package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
- package/node_modules/zod/src/v4/core/parse.ts +37 -16
- package/node_modules/zod/src/v4/core/regexes.ts +14 -4
- package/node_modules/zod/src/v4/core/schemas.ts +296 -132
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
- package/node_modules/zod/src/v4/core/util.ts +218 -147
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/locales/ar.ts +2 -0
- package/node_modules/zod/src/v4/locales/az.ts +2 -0
- package/node_modules/zod/src/v4/locales/be.ts +2 -0
- package/node_modules/zod/src/v4/locales/bg.ts +2 -0
- package/node_modules/zod/src/v4/locales/bn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ca.ts +2 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
- package/node_modules/zod/src/v4/locales/cs.ts +2 -0
- package/node_modules/zod/src/v4/locales/da.ts +2 -0
- package/node_modules/zod/src/v4/locales/de.ts +2 -0
- package/node_modules/zod/src/v4/locales/el.ts +2 -0
- package/node_modules/zod/src/v4/locales/en.ts +2 -0
- package/node_modules/zod/src/v4/locales/eo.ts +2 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +2 -0
- package/node_modules/zod/src/v4/locales/fi.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr.ts +2 -0
- package/node_modules/zod/src/v4/locales/gu.ts +2 -0
- package/node_modules/zod/src/v4/locales/he.ts +2 -0
- package/node_modules/zod/src/v4/locales/hi.ts +2 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +2 -0
- package/node_modules/zod/src/v4/locales/hy.ts +2 -0
- package/node_modules/zod/src/v4/locales/id.ts +2 -0
- package/node_modules/zod/src/v4/locales/index.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +2 -0
- package/node_modules/zod/src/v4/locales/it.ts +2 -0
- package/node_modules/zod/src/v4/locales/ja.ts +2 -0
- package/node_modules/zod/src/v4/locales/ka.ts +2 -0
- package/node_modules/zod/src/v4/locales/km.ts +2 -0
- package/node_modules/zod/src/v4/locales/kn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ko.ts +2 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ms.ts +2 -0
- package/node_modules/zod/src/v4/locales/ne.ts +2 -0
- package/node_modules/zod/src/v4/locales/nl.ts +2 -0
- package/node_modules/zod/src/v4/locales/nn.ts +2 -0
- package/node_modules/zod/src/v4/locales/no.ts +2 -0
- package/node_modules/zod/src/v4/locales/ota.ts +2 -0
- package/node_modules/zod/src/v4/locales/pl.ts +2 -0
- package/node_modules/zod/src/v4/locales/ps.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt.ts +2 -0
- package/node_modules/zod/src/v4/locales/ro.ts +2 -0
- package/node_modules/zod/src/v4/locales/ru.ts +2 -0
- package/node_modules/zod/src/v4/locales/sk.ts +2 -0
- package/node_modules/zod/src/v4/locales/sl.ts +2 -0
- package/node_modules/zod/src/v4/locales/sv.ts +2 -0
- package/node_modules/zod/src/v4/locales/ta.ts +2 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +2 -0
- package/node_modules/zod/src/v4/locales/tk.ts +2 -0
- package/node_modules/zod/src/v4/locales/tr.ts +2 -0
- package/node_modules/zod/src/v4/locales/uk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ur.ts +2 -0
- package/node_modules/zod/src/v4/locales/uz.ts +2 -0
- package/node_modules/zod/src/v4/locales/vi.ts +2 -0
- package/node_modules/zod/src/v4/locales/yo.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
- package/node_modules/zod/src/v4/mini/external.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +19 -0
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.d.cts +1 -1
- package/node_modules/zod/v4/classic/external.d.ts +1 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -35
- package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
- package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
- package/node_modules/zod/v4/classic/schemas.js +77 -33
- package/node_modules/zod/v4/core/api.cjs +45 -22
- package/node_modules/zod/v4/core/api.d.cts +12 -6
- package/node_modules/zod/v4/core/api.d.ts +12 -6
- package/node_modules/zod/v4/core/api.js +25 -22
- package/node_modules/zod/v4/core/checks.cjs +51 -97
- package/node_modules/zod/v4/core/checks.d.cts +17 -1
- package/node_modules/zod/v4/core/checks.d.ts +17 -1
- package/node_modules/zod/v4/core/checks.js +31 -96
- package/node_modules/zod/v4/core/compile.cjs +173 -78
- package/node_modules/zod/v4/core/compile.d.cts +18 -4
- package/node_modules/zod/v4/core/compile.d.ts +18 -4
- package/node_modules/zod/v4/core/compile.js +154 -79
- package/node_modules/zod/v4/core/core.cjs +20 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +111 -23
- package/node_modules/zod/v4/core/memoizer.js +69 -23
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +31 -6
- package/node_modules/zod/v4/core/regexes.d.cts +3 -0
- package/node_modules/zod/v4/core/regexes.d.ts +3 -0
- package/node_modules/zod/v4/core/regexes.js +10 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +302 -114
- package/node_modules/zod/v4/core/schemas.d.cts +28 -8
- package/node_modules/zod/v4/core/schemas.d.ts +28 -8
- package/node_modules/zod/v4/core/schemas.js +279 -113
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
- package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.js +7 -6
- package/node_modules/zod/v4/core/util.cjs +177 -143
- package/node_modules/zod/v4/core/util.d.cts +25 -4
- package/node_modules/zod/v4/core/util.d.ts +25 -4
- package/node_modules/zod/v4/core/util.js +156 -143
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +19 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +2 -0
- package/node_modules/zod/v4/locales/ar.js +2 -0
- package/node_modules/zod/v4/locales/az.cjs +2 -0
- package/node_modules/zod/v4/locales/az.js +2 -0
- package/node_modules/zod/v4/locales/be.cjs +2 -0
- package/node_modules/zod/v4/locales/be.js +2 -0
- package/node_modules/zod/v4/locales/bg.cjs +2 -0
- package/node_modules/zod/v4/locales/bg.js +2 -0
- package/node_modules/zod/v4/locales/bn.cjs +2 -0
- package/node_modules/zod/v4/locales/bn.js +2 -0
- package/node_modules/zod/v4/locales/ca.cjs +2 -0
- package/node_modules/zod/v4/locales/ca.js +2 -0
- package/node_modules/zod/v4/locales/ckb.cjs +2 -0
- package/node_modules/zod/v4/locales/ckb.js +2 -0
- package/node_modules/zod/v4/locales/cs.cjs +2 -0
- package/node_modules/zod/v4/locales/cs.js +2 -0
- package/node_modules/zod/v4/locales/da.cjs +2 -0
- package/node_modules/zod/v4/locales/da.js +2 -0
- package/node_modules/zod/v4/locales/de.cjs +2 -0
- package/node_modules/zod/v4/locales/de.js +2 -0
- package/node_modules/zod/v4/locales/el.cjs +2 -0
- package/node_modules/zod/v4/locales/el.js +2 -0
- package/node_modules/zod/v4/locales/en.cjs +2 -0
- package/node_modules/zod/v4/locales/en.js +2 -0
- package/node_modules/zod/v4/locales/eo.cjs +2 -0
- package/node_modules/zod/v4/locales/eo.js +2 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +2 -0
- package/node_modules/zod/v4/locales/fa.js +2 -0
- package/node_modules/zod/v4/locales/fi.cjs +2 -0
- package/node_modules/zod/v4/locales/fi.js +2 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
- package/node_modules/zod/v4/locales/fr-CA.js +2 -0
- package/node_modules/zod/v4/locales/fr.cjs +2 -0
- package/node_modules/zod/v4/locales/fr.js +2 -0
- package/node_modules/zod/v4/locales/gu.cjs +2 -0
- package/node_modules/zod/v4/locales/gu.js +2 -0
- package/node_modules/zod/v4/locales/he.cjs +2 -0
- package/node_modules/zod/v4/locales/he.js +2 -0
- package/node_modules/zod/v4/locales/hi.cjs +2 -0
- package/node_modules/zod/v4/locales/hi.js +2 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +2 -0
- package/node_modules/zod/v4/locales/hu.js +2 -0
- package/node_modules/zod/v4/locales/hy.cjs +2 -0
- package/node_modules/zod/v4/locales/hy.js +2 -0
- package/node_modules/zod/v4/locales/id.cjs +2 -0
- package/node_modules/zod/v4/locales/id.js +2 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.d.cts +1 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +2 -0
- package/node_modules/zod/v4/locales/is.js +2 -0
- package/node_modules/zod/v4/locales/it.cjs +2 -0
- package/node_modules/zod/v4/locales/it.js +2 -0
- package/node_modules/zod/v4/locales/ja.cjs +2 -0
- package/node_modules/zod/v4/locales/ja.js +2 -0
- package/node_modules/zod/v4/locales/ka.cjs +2 -0
- package/node_modules/zod/v4/locales/ka.js +2 -0
- package/node_modules/zod/v4/locales/km.cjs +2 -0
- package/node_modules/zod/v4/locales/km.js +2 -0
- package/node_modules/zod/v4/locales/kn.cjs +2 -0
- package/node_modules/zod/v4/locales/kn.js +2 -0
- package/node_modules/zod/v4/locales/ko.cjs +2 -0
- package/node_modules/zod/v4/locales/ko.js +2 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +2 -0
- package/node_modules/zod/v4/locales/mk.js +2 -0
- package/node_modules/zod/v4/locales/ms.cjs +2 -0
- package/node_modules/zod/v4/locales/ms.js +2 -0
- package/node_modules/zod/v4/locales/ne.cjs +2 -0
- package/node_modules/zod/v4/locales/ne.js +2 -0
- package/node_modules/zod/v4/locales/nl.cjs +2 -0
- package/node_modules/zod/v4/locales/nl.js +2 -0
- package/node_modules/zod/v4/locales/nn.cjs +2 -0
- package/node_modules/zod/v4/locales/nn.js +2 -0
- package/node_modules/zod/v4/locales/no.cjs +2 -0
- package/node_modules/zod/v4/locales/no.js +2 -0
- package/node_modules/zod/v4/locales/ota.cjs +2 -0
- package/node_modules/zod/v4/locales/ota.js +2 -0
- package/node_modules/zod/v4/locales/pl.cjs +2 -0
- package/node_modules/zod/v4/locales/pl.js +2 -0
- package/node_modules/zod/v4/locales/ps.cjs +2 -0
- package/node_modules/zod/v4/locales/ps.js +2 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
- package/node_modules/zod/v4/locales/pt-BR.js +2 -0
- package/node_modules/zod/v4/locales/pt.cjs +2 -0
- package/node_modules/zod/v4/locales/pt.js +2 -0
- package/node_modules/zod/v4/locales/ro.cjs +2 -0
- package/node_modules/zod/v4/locales/ro.js +2 -0
- package/node_modules/zod/v4/locales/ru.cjs +2 -0
- package/node_modules/zod/v4/locales/ru.js +2 -0
- package/node_modules/zod/v4/locales/sk.cjs +2 -0
- package/node_modules/zod/v4/locales/sk.js +2 -0
- package/node_modules/zod/v4/locales/sl.cjs +2 -0
- package/node_modules/zod/v4/locales/sl.js +2 -0
- package/node_modules/zod/v4/locales/sv.cjs +2 -0
- package/node_modules/zod/v4/locales/sv.js +2 -0
- package/node_modules/zod/v4/locales/ta.cjs +2 -0
- package/node_modules/zod/v4/locales/ta.js +2 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +2 -0
- package/node_modules/zod/v4/locales/th.js +2 -0
- package/node_modules/zod/v4/locales/tk.cjs +2 -0
- package/node_modules/zod/v4/locales/tk.js +2 -0
- package/node_modules/zod/v4/locales/tr.cjs +2 -0
- package/node_modules/zod/v4/locales/tr.js +2 -0
- package/node_modules/zod/v4/locales/uk.cjs +2 -0
- package/node_modules/zod/v4/locales/uk.js +2 -0
- package/node_modules/zod/v4/locales/ur.cjs +2 -0
- package/node_modules/zod/v4/locales/ur.js +2 -0
- package/node_modules/zod/v4/locales/uz.cjs +2 -0
- package/node_modules/zod/v4/locales/uz.js +2 -0
- package/node_modules/zod/v4/locales/vi.cjs +2 -0
- package/node_modules/zod/v4/locales/vi.js +2 -0
- package/node_modules/zod/v4/locales/yo.cjs +2 -0
- package/node_modules/zod/v4/locales/yo.js +2 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-CN.js +2 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-TW.js +2 -0
- package/node_modules/zod/v4/mini/checks.cjs +19 -0
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.d.cts +1 -1
- package/node_modules/zod/v4/mini/external.d.ts +1 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +44 -8
- package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
- package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
- package/node_modules/zod/v4/mini/schemas.js +21 -6
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/openclaw.plugin.json +21 -1
- package/package.json +9 -6
- package/dist/.setup/agent-components.runtime-CEPrf2SY.mjs +0 -4
- package/dist/.setup/message-handler.history-CJOsN9w5.mjs +0 -28
- package/dist/.setup/probe.runtime-DBQ_AGPe.mjs +0 -2
- package/dist/.setup/provider-session.runtime-BW7QrF5C.mjs +0 -6
- package/dist/.setup/provider.runtime-DuhmKdDU.mjs +0 -2
- package/dist/.setup/security-audit.runtime-DHtYenx9.mjs +0 -2
- package/dist/.setup/setup-plugin-api-CINIEBLa.mjs +0 -3
- package/dist/.setup/system-events-B2YEEMbS.mjs +0 -34
- package/dist/.setup/targets-D1mAB5yO.mjs +0 -3
- package/dist/.setup/thread-bindings.manager-eexkKyrG.mjs +0 -678
- package/dist/.setup/thread-bindings.session-updates-DCQq1WZ5.mjs +0 -55
- /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-
|
|
2
|
-
import {
|
|
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) {
|
package/dist/.setup/{secret-config-contract-DFu9hfU8.mjs → secret-config-contract-uOE2J7yM.mjs}
RENAMED
|
@@ -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
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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 = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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 = {
|
|
79
|
-
|
|
80
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
759
|
-
|
|
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
|
|
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:
|
|
999
|
+
raw: identifier
|
|
1041
1000
|
},
|
|
1042
1001
|
count: reaction.count,
|
|
1043
1002
|
users: users.map((user) => ({
|