@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
|
@@ -243,12 +243,11 @@ function resolveDiscordAllowListNameMatch(list, candidate) {
|
|
|
243
243
|
return null;
|
|
244
244
|
}
|
|
245
245
|
function allowListMatches(list, candidate, params) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
return false;
|
|
246
|
+
return resolveDiscordAllowListMatch({
|
|
247
|
+
allowList: list,
|
|
248
|
+
candidate,
|
|
249
|
+
allowNameMatching: params?.allowNameMatching
|
|
250
|
+
}).allowed;
|
|
252
251
|
}
|
|
253
252
|
function resolveDiscordAllowListMatch(params) {
|
|
254
253
|
const { allowList, candidate } = params;
|
|
@@ -414,6 +413,7 @@ function resolveDiscordChannelConfigEntry(entry) {
|
|
|
414
413
|
return {
|
|
415
414
|
allowed: entry.enabled !== false,
|
|
416
415
|
requireMention: entry.requireMention,
|
|
416
|
+
requireMentionInBotThreads: entry.requireMentionInBotThreads,
|
|
417
417
|
ignoreOtherMentions: entry.ignoreOtherMentions,
|
|
418
418
|
skills: entry.skills,
|
|
419
419
|
enabled: entry.enabled,
|
|
@@ -427,15 +427,12 @@ function resolveDiscordChannelConfigEntry(entry) {
|
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
429
|
function resolveDiscordChannelConfig(params) {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
name: channelName,
|
|
436
|
-
slug: channelSlug
|
|
430
|
+
return resolveDiscordChannelConfigWithFallback({
|
|
431
|
+
guildInfo: params.guildInfo,
|
|
432
|
+
channelId: params.channelId,
|
|
433
|
+
channelName: params.channelName,
|
|
434
|
+
channelSlug: params.channelSlug
|
|
437
435
|
});
|
|
438
|
-
return resolveChannelMatchConfig(match, resolveDiscordChannelConfigEntry) ?? { allowed: false };
|
|
439
436
|
}
|
|
440
437
|
function resolveDiscordChannelConfigWithFallback(params) {
|
|
441
438
|
const { guildInfo, channelId, channelName, channelSlug, parentId, parentName, parentSlug, scope } = params;
|
|
@@ -454,17 +451,20 @@ function resolveDiscordChannelConfigWithFallback(params) {
|
|
|
454
451
|
} : void 0);
|
|
455
452
|
return resolveChannelMatchConfig(match, resolveDiscordChannelConfigEntry) ?? { allowed: false };
|
|
456
453
|
}
|
|
454
|
+
/** Boolean runtime API retained for plugins built against OpenClaw 2026.9.6. */
|
|
457
455
|
function resolveDiscordShouldRequireMention(params) {
|
|
458
|
-
|
|
459
|
-
if (params.isAutoThreadOwnedByBot ?? isDiscordAutoThreadOwnedByBot(params)) return false;
|
|
460
|
-
return params.channelConfig?.requireMention ?? params.guildInfo?.requireMention ?? true;
|
|
456
|
+
return resolveDiscordMentionPolicy(params).requireMention;
|
|
461
457
|
}
|
|
462
|
-
function
|
|
463
|
-
if (!params.isThread) return false;
|
|
464
|
-
if (!params.channelConfig?.autoThread) return false;
|
|
458
|
+
function resolveDiscordMentionPolicy(params) {
|
|
465
459
|
const botId = params.botId?.trim();
|
|
466
460
|
const threadOwnerId = params.threadOwnerId?.trim();
|
|
467
|
-
|
|
461
|
+
const isBotOwnedThread = Boolean(params.isGuildMessage && (params.isAutoThreadOwnedByBot === true || params.isThread && botId && threadOwnerId === botId));
|
|
462
|
+
const isAutoThreadOwnedByBot = params.isAutoThreadOwnedByBot ?? (isBotOwnedThread && params.channelConfig?.autoThread);
|
|
463
|
+
const requireMentionInBotThreads = isBotOwnedThread ? params.channelConfig?.requireMentionInBotThreads ?? params.guildInfo?.requireMentionInBotThreads : void 0;
|
|
464
|
+
return {
|
|
465
|
+
requireMention: requireMentionInBotThreads ?? (params.isGuildMessage && !isAutoThreadOwnedByBot ? params.channelConfig?.requireMention ?? params.guildInfo?.requireMention ?? true : false),
|
|
466
|
+
allowedImplicitMentionKinds: requireMentionInBotThreads === true ? ["native"] : void 0
|
|
467
|
+
};
|
|
468
468
|
}
|
|
469
469
|
function isDiscordGroupAllowedByPolicy(params) {
|
|
470
470
|
if (params.groupPolicy === "allowlist" && !params.guildAllowlisted) return false;
|
|
@@ -531,4 +531,4 @@ function isDiscordThreadChannelType(channelType) {
|
|
|
531
531
|
return channelType === ChannelType.AnnouncementThread || channelType === ChannelType.PublicThread || channelType === ChannelType.PrivateThread;
|
|
532
532
|
}
|
|
533
533
|
//#endregion
|
|
534
|
-
export {
|
|
534
|
+
export { resolveDiscordSystemLocation as C, getDiscordEndpointRuntime as D, assertDiscordEndpointGatewayUrl as E, resolveDiscordEndpointAttachmentGuard as O, formatDiscordUserTag as S, parseDiscordRetryAfterBodySeconds as T, resolveDiscordOwnerAllowFrom as _, normalizeDiscordDisplaySlug as a, shouldEmitDiscordReactionNotification as b, resolveDiscordChannelConfig as c, resolveDiscordCommandAuthorized as d, resolveDiscordGuildEntry as f, resolveDiscordOwnerAccess as g, resolveDiscordMentionPolicy as h, normalizeDiscordAllowList as i, resolveDiscordEndpointMediaGuard as k, resolveDiscordChannelConfigWithFallback as l, resolveDiscordMemberAllowed as m, allowListMatches as n, normalizeDiscordSlug as o, resolveDiscordMemberAccessState as p, isDiscordGroupAllowedByPolicy as r, resolveDiscordAllowListMatch as s, isDiscordThreadChannelType as t, resolveDiscordChannelPolicyCommandAuthorizer as u, resolveDiscordShouldRequireMention as v, resolveTimestampMs as w, formatDiscordReactionEmoji as x, resolveGroupDmAllow as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as inspectDiscordAccountTokenState, h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-
|
|
2
|
-
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
3
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
4
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { _ as inspectDiscordAccountTokenState, h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-ChaMcixG.mjs";
|
|
2
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-B3wZ4hN-.mjs";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BFPNRmVv.mjs";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-0-aBuCy3.mjs";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -9,11 +9,8 @@ import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSect
|
|
|
9
9
|
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
10
10
|
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
11
11
|
//#region extensions/discord/src/setup-account-state.ts
|
|
12
|
-
function resolveDefaultDiscordSetupAccountId(cfg) {
|
|
13
|
-
return resolveDefaultDiscordAccountId(cfg);
|
|
14
|
-
}
|
|
15
12
|
function resolveDiscordSetupAccountConfig(params) {
|
|
16
|
-
const accountId = normalizeAccountId(params.accountId ??
|
|
13
|
+
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultDiscordAccountId(params.cfg));
|
|
17
14
|
return {
|
|
18
15
|
accountId,
|
|
19
16
|
config: mergeDiscordAccountConfig(params.cfg, accountId)
|
|
@@ -213,7 +210,7 @@ async function resolveDiscordAllowFromEntries(params) {
|
|
|
213
210
|
async function promptDiscordAllowFrom(params) {
|
|
214
211
|
const accountId = resolveSetupAccountId({
|
|
215
212
|
accountId: params.accountId,
|
|
216
|
-
defaultAccountId:
|
|
213
|
+
defaultAccountId: resolveDefaultDiscordAccountId(params.cfg)
|
|
217
214
|
});
|
|
218
215
|
const account = resolveDiscordSetupAccountConfig({
|
|
219
216
|
cfg: params.cfg,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { B as Container, F as RadioGroup, G as RoleSelectMenu, H as LinkButton, I as TextInput, J as Separator, K as Row, L as AnySelectMenu, M as CheckboxGroup, N as Label, P as Modal, Q as UserSelectMenu, R as Button, U as MediaGallery, V as File, W as MentionableSelectMenu, X as TextDisplay, Y as StringSelectMenu, Z as Thumbnail, et as parseCustomId, q as Section, z as ChannelSelectMenu } from "./discord-0xJYfdDD.mjs";
|
|
2
3
|
import { ButtonStyle, MessageFlags, TextInputStyle } from "discord-api-types/v10";
|
|
3
4
|
import crypto from "node:crypto";
|
|
4
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -103,29 +104,23 @@ function parseDiscordModalCustomId(id) {
|
|
|
103
104
|
function isDiscordComponentWildcardRegistrationId(id) {
|
|
104
105
|
return /^__openclaw_discord_component_[a-z_]+_wildcard__$/.test(id);
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
+
function parseDiscordCustomIdForInteraction(id, key) {
|
|
107
108
|
if (id === "*" || isDiscordComponentWildcardRegistrationId(id)) return {
|
|
108
109
|
key: "*",
|
|
109
110
|
data: {}
|
|
110
111
|
};
|
|
111
112
|
const parsed = parseCustomId(id);
|
|
112
|
-
if (parsed.key !==
|
|
113
|
+
if (parsed.key !== key) return parsed;
|
|
113
114
|
return {
|
|
114
115
|
key: "*",
|
|
115
116
|
data: decodeParsedCustomIdData(parsed.data)
|
|
116
117
|
};
|
|
117
118
|
}
|
|
119
|
+
function parseDiscordComponentCustomIdForInteraction(id) {
|
|
120
|
+
return parseDiscordCustomIdForInteraction(id, DISCORD_COMPONENT_CUSTOM_ID_KEY);
|
|
121
|
+
}
|
|
118
122
|
function parseDiscordModalCustomIdForInteraction(id) {
|
|
119
|
-
|
|
120
|
-
key: "*",
|
|
121
|
-
data: {}
|
|
122
|
-
};
|
|
123
|
-
const parsed = parseCustomId(id);
|
|
124
|
-
if (parsed.key !== "ocmodal") return parsed;
|
|
125
|
-
return {
|
|
126
|
-
key: "*",
|
|
127
|
-
data: decodeParsedCustomIdData(parsed.data)
|
|
128
|
-
};
|
|
123
|
+
return parseDiscordCustomIdForInteraction(id, DISCORD_MODAL_CUSTOM_ID_KEY);
|
|
129
124
|
}
|
|
130
125
|
//#endregion
|
|
131
126
|
//#region extensions/discord/src/components.parse.ts
|
|
@@ -174,19 +169,15 @@ function normalizeModalFieldName(value, index) {
|
|
|
174
169
|
if (trimmed) return trimmed;
|
|
175
170
|
return `field_${index + 1}`;
|
|
176
171
|
}
|
|
177
|
-
function
|
|
172
|
+
function readAttachmentName(value, label, filenameLabel = "a filename") {
|
|
178
173
|
const trimmed = value.trim();
|
|
179
174
|
if (!trimmed.startsWith("attachment://")) throw new Error(`${label} must start with "${DISCORD_COMPONENT_ATTACHMENT_PREFIX}"`);
|
|
180
175
|
const attachmentName = trimmed.slice(13).trim();
|
|
181
|
-
if (!attachmentName) throw new Error(`${label} must include
|
|
182
|
-
return
|
|
176
|
+
if (!attachmentName) throw new Error(`${label} must include ${filenameLabel}`);
|
|
177
|
+
return attachmentName;
|
|
183
178
|
}
|
|
184
179
|
function resolveDiscordComponentAttachmentName(value) {
|
|
185
|
-
|
|
186
|
-
if (!trimmed.startsWith("attachment://")) throw new Error(`Attachment reference must start with "${DISCORD_COMPONENT_ATTACHMENT_PREFIX}"`);
|
|
187
|
-
const attachmentName = trimmed.slice(13).trim();
|
|
188
|
-
if (!attachmentName) throw new Error("Attachment reference must include a filename");
|
|
189
|
-
return attachmentName;
|
|
180
|
+
return readAttachmentName(value, "Attachment reference");
|
|
190
181
|
}
|
|
191
182
|
function mapButtonStyle(style) {
|
|
192
183
|
switch (normalizeLowercaseStringOrEmpty(style ?? "primary")) {
|
|
@@ -200,10 +191,6 @@ function mapButtonStyle(style) {
|
|
|
200
191
|
function mapTextInputStyle(style) {
|
|
201
192
|
return style === "paragraph" ? TextInputStyle.Paragraph : TextInputStyle.Short;
|
|
202
193
|
}
|
|
203
|
-
function normalizeBlockType(raw) {
|
|
204
|
-
const lowered = normalizeLowercaseStringOrEmpty(raw);
|
|
205
|
-
return BLOCK_ALIASES.get(lowered) ?? lowered;
|
|
206
|
-
}
|
|
207
194
|
function parseSelectOptions(raw, label) {
|
|
208
195
|
if (raw === void 0) return;
|
|
209
196
|
if (!Array.isArray(raw)) throw new Error(`${label} must be an array`);
|
|
@@ -313,7 +300,8 @@ function parseModalField(raw, label, index) {
|
|
|
313
300
|
}
|
|
314
301
|
function parseComponentBlock(raw, label) {
|
|
315
302
|
const obj = requireObject(raw, label);
|
|
316
|
-
|
|
303
|
+
const typeRaw = normalizeLowercaseStringOrEmpty(readRequiredString(obj.type, `${label}.type`));
|
|
304
|
+
switch (BLOCK_ALIASES.get(typeRaw) ?? typeRaw) {
|
|
317
305
|
case "text": return {
|
|
318
306
|
type: "text",
|
|
319
307
|
text: readRequiredString(obj.text, `${label}.text`, false)
|
|
@@ -384,11 +372,14 @@ function parseComponentBlock(raw, label) {
|
|
|
384
372
|
})
|
|
385
373
|
};
|
|
386
374
|
}
|
|
387
|
-
case "file":
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
375
|
+
case "file": {
|
|
376
|
+
const file = readRequiredString(obj.file, `${label}.file`);
|
|
377
|
+
return {
|
|
378
|
+
type: "file",
|
|
379
|
+
file: `${DISCORD_COMPONENT_ATTACHMENT_PREFIX}${readAttachmentName(file, `${label}.file`, "an attachment filename")}`,
|
|
380
|
+
spoiler: typeof obj.spoiler === "boolean" ? obj.spoiler : void 0
|
|
381
|
+
};
|
|
382
|
+
}
|
|
392
383
|
default: throw new Error(`${label}.type must be a supported component block`);
|
|
393
384
|
}
|
|
394
385
|
}
|
|
@@ -564,9 +555,6 @@ function createSelectComponent(params) {
|
|
|
564
555
|
}
|
|
565
556
|
};
|
|
566
557
|
}
|
|
567
|
-
function isSelectComponent(component) {
|
|
568
|
-
return component instanceof StringSelectMenu || component instanceof UserSelectMenu || component instanceof RoleSelectMenu || component instanceof MentionableSelectMenu || component instanceof ChannelSelectMenu;
|
|
569
|
-
}
|
|
570
558
|
function buildDiscordComponentMessage(params) {
|
|
571
559
|
const entries = [];
|
|
572
560
|
const consumptionGroupId = createShortId("grp_");
|
|
@@ -674,12 +662,8 @@ function buildDiscordComponentMessage(params) {
|
|
|
674
662
|
});
|
|
675
663
|
if (entry) addEntry(entry);
|
|
676
664
|
const lastChild = containerChildren.at(-1);
|
|
677
|
-
if (lastChild instanceof Row)
|
|
678
|
-
|
|
679
|
-
const hasSelect = row.components.some((entryLocal) => isSelectComponent(entryLocal));
|
|
680
|
-
if (row.components.length < 5 && !hasSelect) row.addComponent(component);
|
|
681
|
-
else containerChildren.push(new Row([component]));
|
|
682
|
-
} else containerChildren.push(new Row([component]));
|
|
665
|
+
if (lastChild instanceof Row && lastChild.components.length < 5 && !lastChild.components.some((child) => child instanceof AnySelectMenu)) lastChild.addComponent(component);
|
|
666
|
+
else containerChildren.push(new Row([component]));
|
|
683
667
|
}
|
|
684
668
|
if (containerChildren.length === 0) throw new Error("components must include at least one block, text, or modal trigger");
|
|
685
669
|
const container = new Container(containerChildren, params.spec.container);
|
|
@@ -697,7 +681,6 @@ function buildDiscordComponentMessageFlags(components) {
|
|
|
697
681
|
}
|
|
698
682
|
//#endregion
|
|
699
683
|
//#region extensions/discord/src/components.modal.ts
|
|
700
|
-
const ModalBase = Modal ?? function ModalFallback() {};
|
|
701
684
|
function createModalFieldComponent(field) {
|
|
702
685
|
if (field.type === "text") {
|
|
703
686
|
class DynamicTextInput extends TextInput {
|
|
@@ -746,7 +729,7 @@ function createModalFieldComponent(field) {
|
|
|
746
729
|
}
|
|
747
730
|
return new DynamicRadioGroup();
|
|
748
731
|
}
|
|
749
|
-
var DiscordFormModal = class extends
|
|
732
|
+
var DiscordFormModal = class extends Modal {
|
|
750
733
|
constructor(params) {
|
|
751
734
|
super();
|
|
752
735
|
this.customIdParser = parseDiscordModalCustomIdForInteraction;
|
|
@@ -857,9 +840,6 @@ var shared_interactive_exports = /* @__PURE__ */ __exportAll({
|
|
|
857
840
|
buildDiscordInteractiveComponents: () => buildDiscordInteractiveComponents,
|
|
858
841
|
buildDiscordPresentationComponents: () => buildDiscordPresentationComponents
|
|
859
842
|
});
|
|
860
|
-
function resolveDiscordInteractiveButtonStyle(style) {
|
|
861
|
-
return style ?? "secondary";
|
|
862
|
-
}
|
|
863
843
|
function resolveDiscordSelectOptionValue(option) {
|
|
864
844
|
return resolveMessagePresentationActionValue(resolveMessagePresentationOptionAction(option));
|
|
865
845
|
}
|
|
@@ -874,15 +854,17 @@ const DISCORD_INTERACTIVE_BUTTON_ROW_SIZE = 5;
|
|
|
874
854
|
function buildDiscordButtonComponent(button, options) {
|
|
875
855
|
const action = resolveMessagePresentationButtonAction(button);
|
|
876
856
|
if (!action) return;
|
|
857
|
+
const component = {
|
|
858
|
+
label: button.label,
|
|
859
|
+
style: button.style ?? "secondary",
|
|
860
|
+
...button.disabled === true ? { disabled: true } : {}
|
|
861
|
+
};
|
|
877
862
|
if (action.type === "approval") {
|
|
878
863
|
const internalCustomId = buildDiscordApprovalCustomId(action);
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
internalCustomId,
|
|
884
|
-
...button.disabled === true ? { disabled: true } : {}
|
|
885
|
-
};
|
|
864
|
+
return internalCustomId ? {
|
|
865
|
+
...component,
|
|
866
|
+
internalCustomId
|
|
867
|
+
} : void 0;
|
|
886
868
|
}
|
|
887
869
|
if (action.type === "question") {
|
|
888
870
|
if ("intent" in action) return;
|
|
@@ -897,30 +879,19 @@ function buildDiscordButtonComponent(button, options) {
|
|
|
897
879
|
optionIndex
|
|
898
880
|
});
|
|
899
881
|
return internalCustomId ? {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
internalCustomId,
|
|
903
|
-
...button.disabled === true ? { disabled: true } : {}
|
|
882
|
+
...component,
|
|
883
|
+
internalCustomId
|
|
904
884
|
} : void 0;
|
|
905
885
|
}
|
|
906
|
-
if (action.type === "web-app" && action.widgetId && isValidDiscordActivityWidgetId(action.widgetId))
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
};
|
|
913
|
-
if (action.type === "web-app" && !action.url) return;
|
|
914
|
-
const component = {
|
|
915
|
-
label: button.label,
|
|
916
|
-
style: action.type === "url" || action.type === "web-app" ? "link" : resolveDiscordInteractiveButtonStyle(button.style)
|
|
917
|
-
};
|
|
918
|
-
if (action.type === "url" || action.type === "web-app") component.url = action.url;
|
|
919
|
-
else {
|
|
886
|
+
if (action.type === "web-app" && action.widgetId && isValidDiscordActivityWidgetId(action.widgetId)) component.internalCustomId = buildDiscordActivityCustomId(action.widgetId);
|
|
887
|
+
else if (action.type === "url" || action.type === "web-app") {
|
|
888
|
+
if (action.type === "web-app" && !action.url) return;
|
|
889
|
+
component.style = "link";
|
|
890
|
+
component.url = action.url;
|
|
891
|
+
} else {
|
|
920
892
|
component.callbackData = action.type === "command" ? action.command : action.value;
|
|
921
893
|
if (button.action?.type === "command" || button.action?.type === "callback") component.callbackDataKind = button.action.type;
|
|
922
894
|
}
|
|
923
|
-
if (button.disabled === true) component.disabled = true;
|
|
924
895
|
if (button.reusable === true) component.reusable = true;
|
|
925
896
|
return component;
|
|
926
897
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-CshUGl36.mjs";
|
|
1
2
|
import { normalizeLegacyDmAliases } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
2
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
4
|
import { buildSecretInputSchema, registerSensitiveConfigSchema } from "openclaw/plugin-sdk/secret-input";
|
|
4
5
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
5
|
-
import
|
|
6
|
-
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema, ProviderCommandsSchema, TtsConfigSchema, buildChannelAccountSchemaParts, buildChannelAllowBotsSchema, buildChannelConfigSchema, buildChannelExecApprovalsSchema, buildChannelReactionShape, buildGroupEntrySchema, requireAllowlistAllowFrom, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
7
|
-
import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
6
|
+
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema, ProviderCommandsSchema, TtsConfigSchema, buildChannelAccountSchemaParts, buildChannelAllowBotsSchema, buildChannelConfigSchema, buildChannelExecApprovalsSchema, buildChannelReactionShape, buildGroupEntrySchema, refineChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-schema";
|
|
8
7
|
import { z } from "zod";
|
|
9
8
|
//#region extensions/discord/src/config-ui-hints.ts
|
|
10
9
|
const discordChannelConfigUiHints = {
|
|
@@ -40,6 +39,14 @@ const discordChannelConfigUiHints = {
|
|
|
40
39
|
label: "Discord Guild Join Introduction",
|
|
41
40
|
help: "Post one brief, room-specific introduction when the bot joins an allowed Discord guild (default: true). Account settings override the channel-wide setting."
|
|
42
41
|
},
|
|
42
|
+
"guilds.*.requireMentionInBotThreads": {
|
|
43
|
+
label: "Require Mention in Bot-Created Threads",
|
|
44
|
+
help: "Override mention gating only in threads owned by this bot. False allows unmentioned follow-ups; true requires a mention even with autoThread enabled. Omitted preserves existing behavior. Sender and channel access rules still apply."
|
|
45
|
+
},
|
|
46
|
+
"guilds.*.channels.*.requireMentionInBotThreads": {
|
|
47
|
+
label: "Require Mention in Bot-Created Threads",
|
|
48
|
+
help: "Override the guild setting for this channel. Applies only when Discord identifies this bot as the thread owner; unknown or other owners keep ordinary mention rules. Unmentioned messages require Message Content Intent."
|
|
49
|
+
},
|
|
43
50
|
proxy: {
|
|
44
51
|
label: "Discord Proxy URL",
|
|
45
52
|
help: "Proxy URL for Discord gateway + API requests (app-id lookup and allowlist resolution). Set per account via channels.discord.accounts.<id>.proxy."
|
|
@@ -275,7 +282,7 @@ const discordChannelConfigUiHints = {
|
|
|
275
282
|
},
|
|
276
283
|
allowBots: {
|
|
277
284
|
label: "Discord Allow Bot Messages",
|
|
278
|
-
help: "Allow bot-authored messages
|
|
285
|
+
help: "Allow bot-authored messages through normal Discord mention and access rules (default: true). Set false to disable bot-triggered turns, or \"mentions\" to require a bot mention. Accessible bot messages remain available as conversation context."
|
|
279
286
|
},
|
|
280
287
|
botLoopProtection: {
|
|
281
288
|
label: "Discord Bot Loop Protection",
|
|
@@ -326,42 +333,6 @@ const discordChannelConfigUiHints = {
|
|
|
326
333
|
};
|
|
327
334
|
//#endregion
|
|
328
335
|
//#region extensions/discord/src/config-schema.ts
|
|
329
|
-
const dmPolicySdk = channelConfigSchema;
|
|
330
|
-
function refineDiscordDmPolicyForHost(params) {
|
|
331
|
-
if (dmPolicySdk.refineChannelDmPolicy) {
|
|
332
|
-
dmPolicySdk.refineChannelDmPolicy({
|
|
333
|
-
channelId: "discord",
|
|
334
|
-
...params
|
|
335
|
-
});
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
const { value, accountId, ctx } = params;
|
|
339
|
-
const account = accountId === void 0 ? value : value.accounts?.[accountId];
|
|
340
|
-
if (!account) return;
|
|
341
|
-
const policy = account.dmPolicy ?? value.dmPolicy;
|
|
342
|
-
const allowFrom = account.allowFrom ?? value.allowFrom;
|
|
343
|
-
const owner = accountId === void 0 ? "channels.discord" : "channels.discord.accounts.*";
|
|
344
|
-
const inherited = accountId === void 0 ? "" : " (or channels.discord.allowFrom)";
|
|
345
|
-
const path = accountId === void 0 ? ["allowFrom"] : [
|
|
346
|
-
"accounts",
|
|
347
|
-
accountId,
|
|
348
|
-
"allowFrom"
|
|
349
|
-
];
|
|
350
|
-
requireOpenAllowFrom({
|
|
351
|
-
policy,
|
|
352
|
-
allowFrom,
|
|
353
|
-
ctx,
|
|
354
|
-
path,
|
|
355
|
-
message: `${owner}.dmPolicy="${policy}" requires ${owner}.allowFrom${inherited} to include "*"`
|
|
356
|
-
});
|
|
357
|
-
requireAllowlistAllowFrom({
|
|
358
|
-
policy,
|
|
359
|
-
allowFrom,
|
|
360
|
-
ctx,
|
|
361
|
-
path,
|
|
362
|
-
message: `${owner}.dmPolicy="${policy}" requires ${owner}.allowFrom${inherited} to contain at least one sender ID`
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
336
|
const SecretInputSchema = buildSecretInputSchema();
|
|
366
337
|
const DiscordPreviewStreamingConfigSchema = ChannelPreviewStreamingConfigSchema.extend({ progress: ChannelStreamingProgressSchema.optional() }).strict();
|
|
367
338
|
const DiscordIdSchema = z.union([z.string(), z.number()]).transform((value, ctx) => {
|
|
@@ -394,6 +365,7 @@ const DiscordPresenceEventsSchema = z.object({
|
|
|
394
365
|
}).strict();
|
|
395
366
|
const DiscordThreadSchema = z.object({ inheritParent: z.boolean().optional() }).strict();
|
|
396
367
|
const DiscordGuildChannelSchema = buildGroupEntrySchema({
|
|
368
|
+
requireMentionInBotThreads: z.boolean().optional(),
|
|
397
369
|
ignoreOtherMentions: z.boolean().optional(),
|
|
398
370
|
users: DiscordIdListSchema.optional(),
|
|
399
371
|
roles: DiscordIdListSchema.optional(),
|
|
@@ -416,6 +388,7 @@ const DiscordGuildChannelSchema = buildGroupEntrySchema({
|
|
|
416
388
|
]).optional()
|
|
417
389
|
}, { omit: ["allowFrom"] });
|
|
418
390
|
const DiscordGuildSchema = buildGroupEntrySchema({
|
|
391
|
+
requireMentionInBotThreads: z.boolean().optional(),
|
|
419
392
|
slug: z.string().optional(),
|
|
420
393
|
ignoreOtherMentions: z.boolean().optional(),
|
|
421
394
|
...buildChannelReactionShape({ notificationModes: [
|
|
@@ -633,14 +606,14 @@ const DiscordAccountSchemaBase = z.object({
|
|
|
633
606
|
});
|
|
634
607
|
});
|
|
635
608
|
function normalizeShippedDiscordDmAliases(value) {
|
|
636
|
-
const entry = asObjectRecord(value);
|
|
609
|
+
const entry = (0, runtime_doctor_migrations_exports.asObjectRecord)(value);
|
|
637
610
|
if (!entry) return value;
|
|
638
611
|
const updated = normalizeLegacyDmAliases({
|
|
639
612
|
entry,
|
|
640
613
|
pathPrefix: "channels.discord",
|
|
641
614
|
changes: []
|
|
642
615
|
}).entry;
|
|
643
|
-
const dm = asObjectRecord(updated.dm);
|
|
616
|
+
const dm = (0, runtime_doctor_migrations_exports.asObjectRecord)(updated.dm);
|
|
644
617
|
if (!dm || dm.policy === void 0 && dm.allowFrom === void 0) return updated;
|
|
645
618
|
const { policy: _policy, allowFrom: _allowFrom, ...retainedDm } = dm;
|
|
646
619
|
const { dm: _dm, ...rest } = updated;
|
|
@@ -655,14 +628,16 @@ const DiscordConfigSchemaBase = DiscordAccountSchemaBase.safeExtend({
|
|
|
655
628
|
accounts: z.record(z.string(), DiscordAccountSchema.optional()).optional(),
|
|
656
629
|
defaultAccount: z.string().optional()
|
|
657
630
|
}).superRefine((value, ctx) => {
|
|
658
|
-
|
|
631
|
+
refineChannelDmPolicy({
|
|
632
|
+
channelId: "discord",
|
|
659
633
|
value,
|
|
660
634
|
ctx
|
|
661
635
|
});
|
|
662
636
|
if (!value.accounts) return;
|
|
663
637
|
for (const [accountId, account] of Object.entries(value.accounts)) {
|
|
664
638
|
if (!account) continue;
|
|
665
|
-
|
|
639
|
+
refineChannelDmPolicy({
|
|
640
|
+
channelId: "discord",
|
|
666
641
|
value,
|
|
667
642
|
accountId,
|
|
668
643
|
ctx
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { m as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-
|
|
1
|
+
import { m as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-zVGxxceg.mjs";
|
|
2
2
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
3
3
|
import { resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
4
4
|
//#region extensions/discord/src/monitor/conversation-binding-route.ts
|
|
5
5
|
function resolveDiscordConversationBindingRoute(params) {
|
|
6
|
+
let baseRoute;
|
|
6
7
|
let runtimeRoute = resolveRuntimeConversationBindingRoute({
|
|
7
|
-
|
|
8
|
+
resolveRoute: (selection) => {
|
|
9
|
+
baseRoute = params.resolveRoute(selection);
|
|
10
|
+
return baseRoute;
|
|
11
|
+
},
|
|
8
12
|
touchBinding: params.touchBinding,
|
|
9
13
|
conversation: {
|
|
10
14
|
channel: "discord",
|
|
@@ -13,20 +17,24 @@ function resolveDiscordConversationBindingRoute(params) {
|
|
|
13
17
|
parentConversationId: params.parentConversationId
|
|
14
18
|
}
|
|
15
19
|
});
|
|
20
|
+
const route = baseRoute ?? runtimeRoute.route;
|
|
16
21
|
if (shouldIgnoreStaleDiscordRouteBinding({
|
|
17
22
|
bindingRecord: runtimeRoute.bindingRecord,
|
|
18
|
-
route
|
|
23
|
+
route
|
|
19
24
|
})) {
|
|
20
|
-
logVerbose(`discord: ignoring stale route binding for conversation ${params.runtimeConversationId} (${runtimeRoute.bindingRecord?.targetSessionKey} -> ${
|
|
25
|
+
logVerbose(`discord: ignoring stale route binding for conversation ${params.runtimeConversationId} (${runtimeRoute.bindingRecord?.targetSessionKey} -> ${route.sessionKey})`);
|
|
21
26
|
runtimeRoute = {
|
|
22
27
|
bindingOwnerAvailable: true,
|
|
23
28
|
bindingRecord: null,
|
|
24
|
-
route:
|
|
29
|
+
route: {
|
|
30
|
+
...runtimeRoute.route,
|
|
31
|
+
...route
|
|
32
|
+
}
|
|
25
33
|
};
|
|
26
34
|
}
|
|
27
35
|
const configuredRoute = runtimeRoute.bindingRecord ? null : resolveConfiguredBindingRoute({
|
|
28
36
|
cfg: params.cfg,
|
|
29
|
-
route:
|
|
37
|
+
route: runtimeRoute.route,
|
|
30
38
|
conversation: {
|
|
31
39
|
channel: "discord",
|
|
32
40
|
accountId: params.accountId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-ChaMcixG.mjs";
|
|
3
3
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
5
5
|
//#region extensions/discord/src/directory-config.ts
|
|
@@ -9,20 +9,17 @@ var directory_config_exports = /* @__PURE__ */ __exportAll({
|
|
|
9
9
|
});
|
|
10
10
|
function resolveDiscordDirectoryConfigAccount(cfg, accountId) {
|
|
11
11
|
const resolvedAccountId = normalizeAccountId(accountId ?? resolveDefaultDiscordAccountId(cfg));
|
|
12
|
-
const config = mergeDiscordAccountConfig(cfg, resolvedAccountId);
|
|
13
12
|
return {
|
|
14
|
-
|
|
15
|
-
config,
|
|
13
|
+
config: mergeDiscordAccountConfig(cfg, resolvedAccountId),
|
|
16
14
|
allowFrom: resolveDiscordAccountAllowFrom({
|
|
17
15
|
cfg,
|
|
18
16
|
accountId: resolvedAccountId
|
|
19
|
-
}) ?? []
|
|
20
|
-
dm: config.dm
|
|
17
|
+
}) ?? []
|
|
21
18
|
};
|
|
22
19
|
}
|
|
23
20
|
const listDiscordDirectoryPeersFromConfig = createResolvedDirectoryEntriesLister({
|
|
24
21
|
kind: "user",
|
|
25
|
-
resolveAccount:
|
|
22
|
+
resolveAccount: resolveDiscordDirectoryConfigAccount,
|
|
26
23
|
resolveSources: (account) => {
|
|
27
24
|
const guildUsers = Object.values(account.config.guilds ?? {}).flatMap((guild) => (guild.users ?? []).concat(Object.values(guild.channels ?? {}).flatMap((channel) => channel.users ?? [])));
|
|
28
25
|
return [
|
|
@@ -38,7 +35,7 @@ const listDiscordDirectoryPeersFromConfig = createResolvedDirectoryEntriesLister
|
|
|
38
35
|
});
|
|
39
36
|
const listDiscordDirectoryGroupsFromConfig = createResolvedDirectoryEntriesLister({
|
|
40
37
|
kind: "group",
|
|
41
|
-
resolveAccount:
|
|
38
|
+
resolveAccount: resolveDiscordDirectoryConfigAccount,
|
|
42
39
|
resolveSources: (account) => Object.values(account.config.guilds ?? {}).map((guild) => Object.keys(guild.channels ?? {})),
|
|
43
40
|
normalizeId: (raw) => {
|
|
44
41
|
const cleaned = (raw.match(/^<#(\d+)>$/)?.[1] ?? raw).replace(/^(discord|channel|group):/i, "").trim();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as normalizeDiscordSlug } from "./channel-type-
|
|
3
|
-
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-
|
|
4
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { o as normalizeDiscordSlug } from "./channel-type-DRCrEMss.mjs";
|
|
3
|
+
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-ChaMcixG.mjs";
|
|
4
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DVbJwZVt.mjs";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
//#region extensions/discord/src/directory-cache-state.ts
|
|
@@ -70,12 +70,6 @@ var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
|
70
70
|
listDiscordDirectoryGroupsLive: () => listDiscordDirectoryGroupsLive,
|
|
71
71
|
listDiscordDirectoryPeersLive: () => listDiscordDirectoryPeersLive
|
|
72
72
|
});
|
|
73
|
-
function normalizeQuery(value) {
|
|
74
|
-
return normalizeOptionalLowercaseString(value) ?? "";
|
|
75
|
-
}
|
|
76
|
-
function buildUserRank(user) {
|
|
77
|
-
return user.bot ? 0 : 1;
|
|
78
|
-
}
|
|
79
73
|
function resolveDiscordDirectoryAccess(params) {
|
|
80
74
|
const account = resolveDiscordAccount({
|
|
81
75
|
cfg: params.cfg,
|
|
@@ -85,7 +79,7 @@ function resolveDiscordDirectoryAccess(params) {
|
|
|
85
79
|
if (!token) return null;
|
|
86
80
|
return {
|
|
87
81
|
token,
|
|
88
|
-
query:
|
|
82
|
+
query: normalizeOptionalLowercaseString(params.query) ?? "",
|
|
89
83
|
accountId: account.accountId
|
|
90
84
|
};
|
|
91
85
|
}
|
|
@@ -152,7 +146,7 @@ async function listDiscordDirectoryPeersLive(params) {
|
|
|
152
146
|
id: `user:${user.id}`,
|
|
153
147
|
name: name || void 0,
|
|
154
148
|
handle: user.username ? `@${user.username}` : void 0,
|
|
155
|
-
rank:
|
|
149
|
+
rank: user.bot ? 0 : 1,
|
|
156
150
|
raw: member
|
|
157
151
|
});
|
|
158
152
|
if (rows.length >= limit) return rows;
|