@openclaw/discord 2026.11.3 → 2026.11.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-inspect-8cCu6uPG.mjs → account-inspect-DGkdWwix.mjs} +1 -1
- package/dist/.setup/{accounts-ljrzXBJi.mjs → accounts-C_25wyxC.mjs} +9 -6
- package/dist/.setup/{active-turn-thread-route-C4tp9noA.mjs → active-turn-thread-route-KvRTAVE3.mjs} +1 -2
- package/dist/.setup/{allow-list-BKqOldGy.mjs → allow-list-BXrS8-R9.mjs} +4 -152
- package/dist/.setup/{api-DqmMUZau.mjs → api-BlBD4ism.mjs} +10 -20
- package/dist/.setup/{approval-handler.runtime-D0qu1um7.mjs → approval-handler.runtime-BGYjX1t9.mjs} +80 -61
- package/dist/.setup/{approval-message-updates-CdurC9Ej.mjs → approval-message-updates-DKsCfxSW.mjs} +2 -2
- package/dist/.setup/{audit-ChorIwio.mjs → audit-5b-FXj9R.mjs} +4 -4
- package/dist/.setup/{channel-ZilgdF5e.mjs → channel-CWwTHWFo.mjs} +134 -202
- package/dist/.setup/channel-access-9cyzozUP.mjs +24 -0
- package/dist/.setup/channel.setup-B3MtmBQG.mjs +238 -0
- package/dist/.setup/{components-Du9NhD8h.mjs → components-YCvQ6YLS.mjs} +209 -430
- package/dist/.setup/components.base-CiS0h_XP.mjs +32 -0
- package/dist/.setup/{config-schema-_uBILpQf.mjs → config-schema-BNKN1cu5.mjs} +6 -7
- package/dist/.setup/{conversation-binding-route-8Ul1KpGF.mjs → conversation-binding-route-kCTw8cij.mjs} +2 -2
- package/dist/.setup/{directory-config-3iVub-3m.mjs → directory-config-Ble81PWH.mjs} +1 -1
- package/dist/.setup/{directory-live-BDVl2DoC.mjs → directory-live-DH3tpS3x.mjs} +52 -57
- package/dist/.setup/{discord-BMD-JiVS.mjs → discord-DGVSguhx.mjs} +1124 -1710
- package/dist/.setup/{doctor-hQKbkNKq.mjs → doctor-eujgbnpZ.mjs} +3 -5
- package/dist/.setup/endpoint-runtime-lf4DeLas.mjs +139 -0
- package/dist/.setup/guilds-eDq22iSM.mjs +22 -0
- package/dist/.setup/{handle-action-B1lmt4ms.mjs → handle-action-CktwmzMz.mjs} +15 -15
- package/dist/.setup/{handle-action.guild-admin-B6g31cwt.mjs → handle-action.guild-admin-WLQ7fRqI.mjs} +5 -5
- package/dist/.setup/listeners-Df8lx3vK.mjs +47 -0
- package/dist/.setup/{live-policy-config-C_Q966Wh.mjs → live-policy-config-DiBVuaU6.mjs} +2 -3
- package/dist/.setup/{message-handler-CkI3yMjL.mjs → message-handler-hhNSioxo.mjs} +154 -115
- package/dist/.setup/{message-handler.preflight-CEfkFV9U.mjs → message-handler.preflight-BZcZE1o-.mjs} +30 -105
- package/dist/.setup/{message-handler.preflight-pluralkit-D5si80_L.mjs → message-handler.preflight-pluralkit-CYZfXXb6.mjs} +9 -22
- package/dist/.setup/{message-handler.process-DsMtetRf.mjs → message-handler.process-B0n-mQ99.mjs} +256 -373
- package/dist/.setup/outbound-payload-BaZmjewa.mjs +447 -0
- package/dist/.setup/{outbound-session-route-BtUpGBTb.mjs → outbound-session-route-Cgx4i9cS.mjs} +139 -86
- package/dist/.setup/{preflight-audio-wWgsZG5F.mjs → preflight-audio-C6QtD6HX.mjs} +1 -5
- package/dist/.setup/{presence-cache-DCeTsL73.mjs → presence-cache-Dq-3nH7R.mjs} +1 -6
- package/dist/.setup/{probe-CBaoCs-c.mjs → probe-DezB-6xz.mjs} +5 -9
- package/dist/.setup/{provider-CI_OLfvz.mjs → provider-BN2bCIUp.mjs} +3440 -4308
- package/dist/.setup/{provider-session.runtime-TWOo_JZx.mjs → provider-session.runtime-Dr_5X43t.mjs} +3 -3
- package/dist/.setup/provider.runtime-BuJpl0Pv.mjs +1 -0
- package/dist/.setup/proxy-fetch-BzXwBAXt.mjs +30 -0
- package/dist/.setup/{realtime-session.runtime-DvfS4vJj.mjs → realtime-session.runtime-BTDWsV4d.mjs} +44 -81
- package/dist/.setup/{receive-recovery-CKvaG2Hf.mjs → receive-recovery-C3Ks4wAQ.mjs} +13 -27
- package/dist/.setup/{resolve-allowlist-common-cIjtqh2F.mjs → resolve-allowlist-common-Bk8Fj6Ik.mjs} +3 -13
- package/dist/.setup/{resolve-channels-Cj5i7hzj.mjs → resolve-channels-Bp8frXvc.mjs} +7 -8
- package/dist/.setup/{resolve-users-BQLbysRB.mjs → resolve-users-Cvcj22sG.mjs} +4 -7
- package/dist/.setup/{runtime-RWnuJgWB.mjs → runtime-BJaCvlmq.mjs} +196 -239
- package/dist/.setup/{runtime-plifsKg9.mjs → runtime-BMgTyuwg.mjs} +6 -6
- package/dist/.setup/{secret-config-contract-z6FhbT8E.mjs → secret-config-contract-B1kE4sDv.mjs} +4 -9
- package/dist/.setup/{send-da6ENJ9f.mjs → send-CVW7V-VZ.mjs} +149 -175
- package/dist/.setup/{send.components-CWZUuGvA.mjs → send.components-C8YXdnO_.mjs} +59 -71
- package/dist/.setup/{send.outbound-qZ3iK3Vq.mjs → send.outbound-Uzcmh3Yd.mjs} +76 -129
- package/dist/.setup/{send.receipt-C18khRYH.mjs → send.receipt-NZDOTZBU.mjs} +30 -32
- package/dist/.setup/{send.shared-CnlMgoqQ.mjs → send.shared-a_6Oeyg1.mjs} +38 -115
- package/dist/.setup/{sender-identity-DgbJykq0.mjs → sender-identity-76HFb8eK.mjs} +3 -9
- package/dist/.setup/setup-plugin-api-BExhGEhL.mjs +2 -0
- package/dist/.setup/shared-interactive-DmzaoKOM.mjs +316 -0
- package/dist/.setup/{shared-CY5vJM48.mjs → shared-yDUSExm2.mjs} +8 -11
- package/dist/.setup/{subagent-hooks-CIu2TFz3.mjs → subagent-hooks-CDkdHQyy.mjs} +1 -1
- package/dist/.setup/{system-events-DCOLXkwS.mjs → system-events-yfWz150v.mjs} +2 -2
- package/dist/.setup/{target-resolver-CApivu3G.mjs → target-resolver-BOOzqxxM.mjs} +3 -3
- package/dist/.setup/{thread-bindings-DcvT_JgI.mjs → thread-bindings-zce4cpu_.mjs} +12 -20
- package/dist/.setup/{thread-bindings.manager-5Sh7yedN.mjs → thread-bindings.manager-NywKzUtc.mjs} +22 -42
- package/dist/.setup/{thread-bindings.session-updates-BMdJeJMc.mjs → thread-bindings.session-updates-D0j7oh8S.mjs} +11 -18
- package/dist/.setup/{threading-CzjFeUSe.mjs → threading-DodLYDt-.mjs} +68 -105
- package/dist/.setup/{timeouts-CuNARfyw.mjs → timeouts-cIxzatmv.mjs} +1 -1
- package/dist/.setup/{transcripts-source-8RDQrSVb.mjs → transcripts-source-ie9GBWaU.mjs} +110 -179
- package/dist/.setup/{voice-runtime-BsDILmAv.mjs → voice-runtime-B7V_LTdX.mjs} +231 -452
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -2
- package/dist/activities-api.js +286 -341
- package/dist/api.js +16 -16
- package/dist/channel-config-api.js +1 -2
- package/dist/channel-plugin-api.js +1 -2
- package/dist/contract-api.js +1 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +1 -2
- package/dist/secret-contract-api.js +1 -2
- package/dist/security-audit-contract-api.js +1 -2
- package/dist/security-contract-api.js +1 -2
- package/dist/session-key-api.js +1 -2
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -2
- package/dist/src/voice/audio-worker.runtime.js +56 -68
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/thread-binding-api.js +1 -2
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +3339 -4021
- package/node_modules/@napi-rs/wasm-runtime/package.json +1 -1
- package/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@types/lodash/common/function.d.ts +2 -2
- package/node_modules/@types/lodash/package.json +2 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/discord-api-types/package.json +4 -4
- package/node_modules/discord-api-types/rest/v10/index.d.ts +8 -0
- package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/index.js +8 -0
- package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/oauth2.d.ts +26 -2
- package/node_modules/discord-api-types/rest/v10/oauth2.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.d.ts +8 -0
- package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.js +8 -0
- package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v9/oauth2.d.ts +26 -2
- package/node_modules/discord-api-types/rest/v9/oauth2.d.ts.map +1 -1
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/node_modules/undici/docs/docs/api/Interceptors.md +15 -2
- package/node_modules/undici/lib/dispatcher/client-h2.js +78 -3
- package/node_modules/undici/lib/dispatcher/pool-base.js +20 -3
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/api.d.ts +1 -1
- package/node_modules/undici/types/utility.d.ts +4 -4
- package/node_modules/uuid/package.json +17 -17
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/openclaw.plugin.json +1 -31
- package/package.json +8 -8
- package/dist/.setup/channel-access-DasWY_OV.mjs +0 -48
- package/dist/.setup/channel.setup-DaDQdctj.mjs +0 -249
- package/dist/.setup/outbound-adapter-DfAanoCO.mjs +0 -543
- package/dist/.setup/provider.runtime-DnionCyo.mjs +0 -2
- package/dist/.setup/setup-plugin-api-D1QuM187.mjs +0 -3
- package/dist/.setup/targets-UWWZ6gF7.mjs +0 -3
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
|
|
2
|
+
import { q as withDiscordRequestAuthority } from "./discord-DGVSguhx.mjs";
|
|
3
|
+
import { c as normalizeDiscordMessagingTarget, o as looksLikeDiscordTargetId, s as matchesDiscordToolContextTarget } from "./send.receipt-NZDOTZBU.mjs";
|
|
4
4
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
5
|
-
import { l as withAbortTimeout } from "./timeouts-
|
|
5
|
+
import { l as withAbortTimeout } from "./timeouts-cIxzatmv.mjs";
|
|
6
6
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
7
|
-
import { A as
|
|
8
|
-
import { a as
|
|
7
|
+
import { A as shouldSuppressLocalDiscordExecApprovalPrompt, D as getDiscordExecApprovalApprovers, E as resolveRequiredDiscordChannelPermissions, O as isDiscordExecApprovalApprover, b as discordMessageActions, k as isDiscordExecApprovalClientEnabled, l as resolveDiscordGroupRequireMention, m as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, u as resolveDiscordGroupToolPolicy, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-Cgx4i9cS.mjs";
|
|
8
|
+
import { a as resolveDiscordInboundConversation, i as resolveDiscordCommandConversation, n as discordOutbound, r as resolveDiscordAttachedOutboundTarget } from "./outbound-payload-BaZmjewa.mjs";
|
|
9
9
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.mjs";
|
|
10
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
11
|
-
import {
|
|
10
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-kCTw8cij.mjs";
|
|
11
|
+
import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupContract, t as createDiscordPluginBase } from "./shared-yDUSExm2.mjs";
|
|
12
12
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-CCHGNSQw.mjs";
|
|
13
|
-
import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
13
|
+
import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-D0j7oh8S.mjs";
|
|
14
14
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.mjs";
|
|
15
15
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
16
16
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -21,19 +21,17 @@ import { asFiniteNumber, normalizeLowercaseStringOrEmpty, normalizeOptionalStrin
|
|
|
21
21
|
import { createRuntimeConfigReader } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
22
22
|
import { createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
|
|
23
23
|
import { resolveDefaultGroupPolicy, resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
24
|
-
import { normalizeAtHashSlug } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
25
24
|
import { buildLegacyDmAccountAllowlistAdapter, createAccountScopedAllowlistNameResolver, createNestedAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
26
25
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
27
26
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
28
27
|
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
29
28
|
import { appendMatchMetadata, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord as isRecord$1, readAccountStatusSnapshot, resolveEnabledConfiguredAccountId } from "openclaw/plugin-sdk/status-helpers";
|
|
30
29
|
import { resolveTargetsWithOptionalToken } from "openclaw/plugin-sdk/target-resolver-runtime";
|
|
31
|
-
import {
|
|
30
|
+
import { createApproverRestrictedNativeApprovalCapabilityAsync } from "openclaw/plugin-sdk/approval-delivery-runtime";
|
|
32
31
|
import { createLazyChannelApprovalNativeRuntimeAdapterAsync } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
33
32
|
import { createChannelApproverDmTargetResolverAsync, createChannelNativeOriginTargetResolverAsync, doesApprovalRequestSelectChannelAccountAsync, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
34
33
|
import { isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
|
|
35
34
|
import { resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
|
|
36
|
-
import { resolveScopeRequireMention, resolveScopeToolsPolicy, scopeKey } from "openclaw/plugin-sdk/channel-policy";
|
|
37
35
|
//#region extensions/discord/src/approval-shared.ts
|
|
38
36
|
function isDiscordApprovalAccountEligible(params) {
|
|
39
37
|
const account = resolveDiscordAccount(params);
|
|
@@ -116,8 +114,8 @@ function createDiscordOriginTargetResolver() {
|
|
|
116
114
|
resolveFallbackTarget: (request) => resolveSessionOrigin(request)
|
|
117
115
|
});
|
|
118
116
|
}
|
|
119
|
-
function
|
|
120
|
-
return
|
|
117
|
+
function getDiscordApprovalCapability() {
|
|
118
|
+
return createApproverRestrictedNativeApprovalCapabilityAsync({
|
|
121
119
|
channel: "discord",
|
|
122
120
|
channelLabel: "Discord",
|
|
123
121
|
describeExecApprovalSetup: ({ accountId }) => {
|
|
@@ -134,7 +132,7 @@ function createDiscordApprovalCapability() {
|
|
|
134
132
|
accountId,
|
|
135
133
|
senderId
|
|
136
134
|
}),
|
|
137
|
-
isNativeDeliveryEnabled: ({ cfg, accountId }) => isDiscordExecApprovalClientEnabled({
|
|
135
|
+
isNativeDeliveryEnabled: async ({ cfg, accountId }) => isDiscordExecApprovalClientEnabled({
|
|
138
136
|
cfg,
|
|
139
137
|
accountId
|
|
140
138
|
}),
|
|
@@ -164,100 +162,93 @@ function createDiscordApprovalCapability() {
|
|
|
164
162
|
accountId
|
|
165
163
|
}),
|
|
166
164
|
shouldHandle: shouldHandleDiscordApprovalRequest,
|
|
167
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
165
|
+
load: async () => (await import("./approval-handler.runtime-BGYjX1t9.mjs")).discordApprovalNativeRuntime
|
|
168
166
|
})
|
|
169
167
|
});
|
|
170
168
|
}
|
|
171
|
-
let cachedDiscordApprovalCapability;
|
|
172
|
-
function getDiscordApprovalCapability() {
|
|
173
|
-
cachedDiscordApprovalCapability ??= createDiscordApprovalCapability();
|
|
174
|
-
return cachedDiscordApprovalCapability;
|
|
175
|
-
}
|
|
176
169
|
//#endregion
|
|
177
170
|
//#region extensions/discord/src/channel.loaders.ts
|
|
178
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
179
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
180
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
181
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
182
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
183
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
184
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-
|
|
171
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-Ble81PWH.mjs").then((n) => n.t));
|
|
172
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-Bp8frXvc.mjs").then((n) => n.n));
|
|
173
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-Cvcj22sG.mjs").then((n) => n.n));
|
|
174
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-NywKzUtc.mjs").then((n) => n.r));
|
|
175
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BOOzqxxM.mjs").then((n) => n.r));
|
|
176
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-BuJpl0Pv.mjs"));
|
|
177
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-DezB-6xz.mjs").then((n) => n.o));
|
|
185
178
|
async function probeDiscordStatusAccount(params) {
|
|
186
179
|
const startedAtMs = Date.now();
|
|
187
180
|
const runtime = await loadDiscordProbeRuntime();
|
|
188
181
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
189
182
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
190
183
|
}
|
|
191
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
192
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
193
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
184
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-5b-FXj9R.mjs").then((n) => n.n));
|
|
185
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-CVW7V-VZ.mjs").then((n) => n.t));
|
|
186
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-DH3tpS3x.mjs").then((n) => n.t));
|
|
194
187
|
//#endregion
|
|
195
188
|
//#region extensions/discord/src/conversation-route-owner.ts
|
|
196
|
-
function
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
guildId: params.conversation.context?.guildId,
|
|
213
|
-
memberRoleIds: params.conversation.context?.memberRoleIds,
|
|
214
|
-
peer: {
|
|
215
|
-
kind: params.conversation.kind,
|
|
216
|
-
id: params.conversation.peerId
|
|
217
|
-
},
|
|
218
|
-
parentConversationId: params.conversation.context?.parentPeerId
|
|
219
|
-
});
|
|
220
|
-
const input = {
|
|
221
|
-
cfg: params.cfg,
|
|
222
|
-
resolveRoute: route,
|
|
223
|
-
accountId,
|
|
224
|
-
runtimeConversationId,
|
|
225
|
-
configuredConversationId: threadConversationId ?? nativeConversationId,
|
|
226
|
-
parentConversationId: params.conversation.context?.parentPeerId,
|
|
227
|
-
touchBinding: false
|
|
228
|
-
};
|
|
229
|
-
return {
|
|
230
|
-
conversation: {
|
|
231
|
-
channel: "discord",
|
|
189
|
+
async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBindings) {
|
|
190
|
+
const prepared = inputs.map((params) => {
|
|
191
|
+
const accountId = normalizeAccountId(params.accountId);
|
|
192
|
+
if (params.cfg.channels?.discord?.enabled === false || !listDiscordAccountIds(params.cfg).some((id) => normalizeAccountId(id) === accountId) || resolveDiscordAccountConfig(params.cfg, accountId)?.enabled === false) return null;
|
|
193
|
+
const direct = params.conversation.kind === "direct";
|
|
194
|
+
const nativeConversationId = params.conversation.nativeChannelId ?? params.conversation.peerId;
|
|
195
|
+
const threadConversationId = direct ? void 0 : params.conversation.threadId;
|
|
196
|
+
const runtimeConversationId = threadConversationId ?? resolveDiscordRuntimeBindingConversationId({
|
|
197
|
+
isDirectMessage: direct,
|
|
198
|
+
isGroupDm: params.conversation.kind === "group",
|
|
199
|
+
userId: direct ? params.conversation.peerId : void 0,
|
|
200
|
+
channelId: nativeConversationId
|
|
201
|
+
});
|
|
202
|
+
const route = ({ boundAgentId }) => resolveDiscordConversationRoute({
|
|
203
|
+
cfg: params.cfg,
|
|
204
|
+
defaultAgentId: boundAgentId,
|
|
232
205
|
accountId,
|
|
233
|
-
|
|
206
|
+
guildId: params.conversation.context?.guildId,
|
|
207
|
+
memberRoleIds: params.conversation.context?.memberRoleIds,
|
|
208
|
+
peer: {
|
|
209
|
+
kind: params.conversation.kind,
|
|
210
|
+
id: params.conversation.peerId
|
|
211
|
+
},
|
|
234
212
|
parentConversationId: params.conversation.context?.parentPeerId
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
213
|
+
});
|
|
214
|
+
const input = {
|
|
215
|
+
cfg: params.cfg,
|
|
216
|
+
resolveRoute: route,
|
|
217
|
+
accountId,
|
|
218
|
+
runtimeConversationId,
|
|
219
|
+
configuredConversationId: threadConversationId ?? nativeConversationId,
|
|
220
|
+
parentConversationId: params.conversation.context?.parentPeerId
|
|
221
|
+
};
|
|
222
|
+
return {
|
|
223
|
+
conversation: {
|
|
243
224
|
channel: "discord",
|
|
244
225
|
accountId,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
226
|
+
conversationId: runtimeConversationId,
|
|
227
|
+
parentConversationId: params.conversation.context?.parentPeerId
|
|
228
|
+
},
|
|
229
|
+
resolve(inspection) {
|
|
230
|
+
const { runtimeRoute, configuredRoute } = resolveDiscordConversationBindingRoute({
|
|
231
|
+
...input,
|
|
232
|
+
inspection
|
|
233
|
+
});
|
|
234
|
+
if (!runtimeRoute.bindingOwnerAvailable && resolveThreadBindingSpawnPolicy({
|
|
235
|
+
cfg: params.cfg,
|
|
236
|
+
channel: "discord",
|
|
237
|
+
accountId,
|
|
238
|
+
kind: "subagent"
|
|
239
|
+
}).enabled) return { kind: "unavailable" };
|
|
240
|
+
if (runtimeRoute.pluginId) return {
|
|
241
|
+
kind: "plugin",
|
|
242
|
+
pluginId: runtimeRoute.pluginId,
|
|
243
|
+
fallbackAgentId: runtimeRoute.route.agentId
|
|
244
|
+
};
|
|
245
|
+
return {
|
|
246
|
+
kind: "agent",
|
|
247
|
+
agentId: runtimeRoute.boundAgentId ?? configuredRoute?.boundAgentId ?? runtimeRoute.route.agentId
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
});
|
|
261
252
|
const inspect = await inspectBindings(prepared.flatMap((item) => item ? [item.conversation] : []));
|
|
262
253
|
let index = 0;
|
|
263
254
|
return prepared.map((item) => {
|
|
@@ -267,69 +258,6 @@ async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBinding
|
|
|
267
258
|
});
|
|
268
259
|
}
|
|
269
260
|
//#endregion
|
|
270
|
-
//#region extensions/discord/src/group-policy.ts
|
|
271
|
-
const guildScopeKey = (guildKey) => scopeKey(["guild", guildKey]);
|
|
272
|
-
const channelScopeKey = (guildKey, channelKey) => scopeKey(["guild", guildKey], ["channel", channelKey]);
|
|
273
|
-
function resolveDiscordGuildKey(guilds, groupSpace) {
|
|
274
|
-
if (!guilds || Object.keys(guilds).length === 0) return;
|
|
275
|
-
const space = normalizeOptionalString(groupSpace) ?? "";
|
|
276
|
-
if (space && guilds[space]) return space;
|
|
277
|
-
const normalized = normalizeAtHashSlug(space);
|
|
278
|
-
if (normalized && guilds[normalized]) return normalized;
|
|
279
|
-
if (normalized) {
|
|
280
|
-
const match = Object.entries(guilds).find(([, entry]) => normalizeAtHashSlug(entry?.slug ?? void 0) === normalized);
|
|
281
|
-
if (match) return match[0];
|
|
282
|
-
}
|
|
283
|
-
return guilds["*"] ? "*" : void 0;
|
|
284
|
-
}
|
|
285
|
-
function resolveDiscordChannelKey(channelEntries, params) {
|
|
286
|
-
if (!channelEntries || Object.keys(channelEntries).length === 0) return;
|
|
287
|
-
const groupChannel = params.groupChannel;
|
|
288
|
-
const channelSlug = normalizeAtHashSlug(groupChannel);
|
|
289
|
-
if (params.groupId && channelEntries[params.groupId]) return params.groupId;
|
|
290
|
-
if (channelSlug && channelEntries[channelSlug]) return channelSlug;
|
|
291
|
-
if (channelSlug && channelEntries[`#${channelSlug}`]) return `#${channelSlug}`;
|
|
292
|
-
return groupChannel && channelEntries[channelSlug] ? channelSlug : void 0;
|
|
293
|
-
}
|
|
294
|
-
function resolveDiscordPolicyScope(params) {
|
|
295
|
-
const guilds = (params.accountId ? params.cfg.channels?.discord?.accounts?.[params.accountId]?.guilds : void 0) ?? params.cfg.channels?.discord?.guilds;
|
|
296
|
-
const tree = { scopes: {} };
|
|
297
|
-
for (const [guildKey, guild] of Object.entries(guilds ?? {})) {
|
|
298
|
-
tree.scopes[guildScopeKey(guildKey)] = guild;
|
|
299
|
-
for (const [channelKey, channel] of Object.entries(guild.channels ?? {})) tree.scopes[channelScopeKey(guildKey, channelKey)] = channel;
|
|
300
|
-
}
|
|
301
|
-
const guildKey = resolveDiscordGuildKey(guilds, params.groupSpace);
|
|
302
|
-
if (!guildKey) return {
|
|
303
|
-
tree,
|
|
304
|
-
path: []
|
|
305
|
-
};
|
|
306
|
-
const channels = guilds?.[guildKey]?.channels;
|
|
307
|
-
let channelKey = resolveDiscordChannelKey(channels, params);
|
|
308
|
-
if (channelKey !== params.groupId) {
|
|
309
|
-
const boundKey = params.groupId ? findDiscordChannelPolicyKey(params.accountId, guildKey, params.groupId) : void 0;
|
|
310
|
-
if (boundKey !== void 0 && channels?.[boundKey]) channelKey = boundKey;
|
|
311
|
-
else if (channelKey !== void 0 && getDiscordChannelPolicyBinding(params.accountId, guildKey, channelKey) !== void 0) channelKey = void 0;
|
|
312
|
-
}
|
|
313
|
-
return {
|
|
314
|
-
tree,
|
|
315
|
-
path: [guildScopeKey(guildKey), ...channelKey !== void 0 ? [channelScopeKey(guildKey, channelKey)] : []]
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
function resolveDiscordGroupRequireMention(params) {
|
|
319
|
-
return resolveScopeRequireMention(resolveDiscordPolicyScope(params));
|
|
320
|
-
}
|
|
321
|
-
function resolveDiscordGroupToolPolicy(params) {
|
|
322
|
-
const scope = resolveDiscordPolicyScope(params);
|
|
323
|
-
return resolveScopeToolsPolicy({
|
|
324
|
-
...scope,
|
|
325
|
-
senderPolicyMode: params.senderPolicyMode,
|
|
326
|
-
senderId: params.senderId,
|
|
327
|
-
senderName: params.senderName,
|
|
328
|
-
senderUsername: params.senderUsername,
|
|
329
|
-
senderE164: params.senderE164
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
//#endregion
|
|
333
261
|
//#region extensions/discord/src/status-issues.ts
|
|
334
262
|
function isDiscordMessageContentIntentDisabled(value) {
|
|
335
263
|
return isRecord$1(value) && isRecord$1(value.intents) && value.intents.messageContent === "disabled";
|
|
@@ -367,43 +295,23 @@ function collectDiscordStatusIssues(accounts) {
|
|
|
367
295
|
if (!account) continue;
|
|
368
296
|
const accountId = resolveEnabledConfiguredAccountId(account);
|
|
369
297
|
if (!accountId) continue;
|
|
370
|
-
const
|
|
298
|
+
const addIssue = (kind, message, fix) => issues.push({
|
|
371
299
|
channel: "discord",
|
|
372
|
-
accountId
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
issues.push({
|
|
377
|
-
...scope,
|
|
378
|
-
kind: "config",
|
|
379
|
-
message: "Discord guild messages are blocked: effective groupPolicy is \"allowlist\", but no guilds are configured.",
|
|
380
|
-
fix: `${guildGuidance} Refresh channel status after the configuration reload applies.`
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
if (isDiscordMessageContentIntentDisabled(account.application)) issues.push({
|
|
384
|
-
...scope,
|
|
385
|
-
kind: "intent",
|
|
386
|
-
message: "Message Content Intent is disabled. Bot may not see normal channel messages.",
|
|
387
|
-
fix: "Enable Message Content Intent in Discord Dev Portal → Bot → Privileged Gateway Intents, or require mention-only operation."
|
|
300
|
+
accountId,
|
|
301
|
+
kind,
|
|
302
|
+
message,
|
|
303
|
+
fix
|
|
388
304
|
});
|
|
305
|
+
if (account.groupPolicy === "allowlist" && account.guildsConfigured === 0) addIssue("config", "Discord guild messages are blocked: effective groupPolicy is \"allowlist\", but no guilds are configured.", `${accountId === "default" ? "Add your server under channels.discord.guilds. If channels.discord.accounts.default.guilds is set, add it there instead." : `Add your server under channels.discord.accounts.${accountId}.guilds.`} Refresh channel status after the configuration reload applies.`);
|
|
306
|
+
if (isDiscordMessageContentIntentDisabled(account.application)) addIssue("intent", "Message Content Intent is disabled. Bot may not see normal channel messages.", "Enable Message Content Intent in Discord Dev Portal → Bot → Privileged Gateway Intents, or require mention-only operation.");
|
|
389
307
|
const audit = readDiscordPermissionsAuditSummary(account.audit);
|
|
390
|
-
if (audit.unresolvedChannels && audit.unresolvedChannels > 0)
|
|
391
|
-
...scope,
|
|
392
|
-
kind: "config",
|
|
393
|
-
message: `Some configured guild channels are not numeric IDs (unresolvedChannels=${audit.unresolvedChannels}). Permission audit can only check numeric channel IDs.`,
|
|
394
|
-
fix: "Use numeric channel IDs as keys in channels.discord.guilds.*.channels (then rerun channels status --probe)."
|
|
395
|
-
});
|
|
308
|
+
if (audit.unresolvedChannels && audit.unresolvedChannels > 0) addIssue("config", `Some configured guild channels are not numeric IDs (unresolvedChannels=${audit.unresolvedChannels}). Permission audit can only check numeric channel IDs.`, "Use numeric channel IDs as keys in channels.discord.guilds.*.channels (then rerun channels status --probe).");
|
|
396
309
|
for (const channel of audit.channels ?? []) {
|
|
397
310
|
if (channel.ok === true) continue;
|
|
398
311
|
const missing = channel.missing?.length ? ` missing ${channel.missing.join(", ")}` : "";
|
|
399
312
|
const error = channel.error ? `: ${channel.error}` : "";
|
|
400
313
|
const baseMessage = `Channel ${channel.channelId} permission check failed.${missing}${error}`;
|
|
401
|
-
|
|
402
|
-
...scope,
|
|
403
|
-
kind: "permissions",
|
|
404
|
-
message: appendMatchMetadata(baseMessage, channel),
|
|
405
|
-
fix: "Check that the bot role can view + send in this channel (and that channel overrides don't deny it)."
|
|
406
|
-
});
|
|
314
|
+
addIssue("permissions", appendMatchMetadata(baseMessage, channel), "Check that the bot role can view + send in this channel (and that channel overrides don't deny it).");
|
|
407
315
|
}
|
|
408
316
|
}
|
|
409
317
|
return issues;
|
|
@@ -413,9 +321,9 @@ function collectDiscordStatusIssues(accounts) {
|
|
|
413
321
|
function toConversationLifecycleBinding(binding) {
|
|
414
322
|
return {
|
|
415
323
|
boundAt: binding.boundAt,
|
|
416
|
-
lastActivityAt:
|
|
417
|
-
idleTimeoutMs:
|
|
418
|
-
maxAgeMs:
|
|
324
|
+
lastActivityAt: binding.lastActivityAt ?? binding.boundAt,
|
|
325
|
+
idleTimeoutMs: binding.idleTimeoutMs,
|
|
326
|
+
maxAgeMs: binding.maxAgeMs
|
|
419
327
|
};
|
|
420
328
|
}
|
|
421
329
|
const discordConversationBindings = {
|
|
@@ -523,11 +431,14 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
523
431
|
resolveToolPolicy: resolveDiscordGroupToolPolicy
|
|
524
432
|
},
|
|
525
433
|
mentions: { stripPatterns: () => ["<@!?\\d+>"] },
|
|
526
|
-
agentPrompt: {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
434
|
+
agentPrompt: {
|
|
435
|
+
questionInputMode: "buttons",
|
|
436
|
+
messageToolHints: () => [
|
|
437
|
+
"- Discord mentions: use supported mention syntax: users `<@USER_ID>`, channels `<#CHANNEL_ID>`, and roles `<@&ROLE_ID>`. Plain `@name` text only pings when a configured `mentionAliases` entry rewrites it; do not use the legacy `<@!USER_ID>` nickname form.",
|
|
438
|
+
"- Discord components: set `components` when sending messages to include buttons, selects, or v2 containers.",
|
|
439
|
+
"- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages."
|
|
440
|
+
]
|
|
441
|
+
},
|
|
531
442
|
messaging: {
|
|
532
443
|
directTargetStyle: discordPluginBase.messaging?.directTargetStyle,
|
|
533
444
|
inferTargetChatType: discordPluginBase.messaging?.inferTargetChatType,
|
|
@@ -538,7 +449,18 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
538
449
|
resolveInboundConversation: resolveDiscordInboundConversation,
|
|
539
450
|
normalizeExplicitSessionKey: ({ sessionKey, ctx }) => normalizeExplicitDiscordSessionKey(sessionKey, ctx),
|
|
540
451
|
resolveSessionTarget: ({ id }) => normalizeDiscordMessagingTarget(`channel:${id}`),
|
|
541
|
-
buildCrossContextPresentation:
|
|
452
|
+
buildCrossContextPresentation: ({ originLabel, message }) => {
|
|
453
|
+
return {
|
|
454
|
+
tone: "neutral",
|
|
455
|
+
blocks: [...message.trim() ? [{
|
|
456
|
+
type: "text",
|
|
457
|
+
text: message
|
|
458
|
+
}, { type: "divider" }] : [], {
|
|
459
|
+
type: "context",
|
|
460
|
+
text: `From ${originLabel}`
|
|
461
|
+
}]
|
|
462
|
+
};
|
|
463
|
+
},
|
|
542
464
|
resolveOutboundSessionRoute: resolveDiscordOutboundSessionRoute,
|
|
543
465
|
targetResolver: {
|
|
544
466
|
looksLikeId: looksLikeDiscordTargetId,
|
|
@@ -611,12 +533,22 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
611
533
|
} },
|
|
612
534
|
actions: discordMessageActions,
|
|
613
535
|
bindings: {
|
|
614
|
-
compileConfiguredBinding: ({ conversationId }) =>
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
536
|
+
compileConfiguredBinding: ({ conversationId }) => {
|
|
537
|
+
const normalized = conversationId.trim();
|
|
538
|
+
return normalized ? { conversationId: normalized } : null;
|
|
539
|
+
},
|
|
540
|
+
matchInboundConversation: ({ compiledBinding, conversationId, parentConversationId }) => {
|
|
541
|
+
const bindingConversationId = compiledBinding.conversationId;
|
|
542
|
+
if (bindingConversationId === conversationId) return {
|
|
543
|
+
conversationId,
|
|
544
|
+
matchPriority: 2
|
|
545
|
+
};
|
|
546
|
+
if (parentConversationId && parentConversationId !== conversationId && bindingConversationId === parentConversationId) return {
|
|
547
|
+
conversationId: parentConversationId,
|
|
548
|
+
matchPriority: 1
|
|
549
|
+
};
|
|
550
|
+
return null;
|
|
551
|
+
},
|
|
620
552
|
resolveCommandConversation: resolveDiscordCommandConversation
|
|
621
553
|
},
|
|
622
554
|
conversationBindings: discordConversationBindings,
|
|
@@ -658,7 +590,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
658
590
|
},
|
|
659
591
|
buildCapabilitiesDiagnostics: async ({ account, target, timeoutMs }) => {
|
|
660
592
|
if (!target?.trim()) return;
|
|
661
|
-
const parsedTarget = parseDiscordTarget(target
|
|
593
|
+
const parsedTarget = parseDiscordTarget(target, { defaultKind: "channel" });
|
|
662
594
|
const details = { target: {
|
|
663
595
|
raw: target,
|
|
664
596
|
normalized: parsedTarget?.normalized,
|
|
@@ -826,7 +758,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
826
758
|
} catch (error) {
|
|
827
759
|
ctx.log?.warn?.(`[${account.accountId}] Discord command deploy cache unavailable; continuing without persistence: ${formatErrorMessage(error)}`);
|
|
828
760
|
}
|
|
829
|
-
|
|
761
|
+
await (await loadDiscordProviderRuntime()).monitorDiscordProvider({
|
|
830
762
|
scheduler: ctx.scheduler,
|
|
831
763
|
token,
|
|
832
764
|
accountId: account.accountId,
|
|
@@ -894,4 +826,4 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
894
826
|
}
|
|
895
827
|
});
|
|
896
828
|
//#endregion
|
|
897
|
-
export {
|
|
829
|
+
export { collectDiscordStatusIssues as n, shouldHandleDiscordApprovalRequest as r, discordPlugin as t };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { asOptionalObjectRecord, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
//#region extensions/discord/src/monitor/channel-access.ts
|
|
3
|
+
function resolveDiscordChannelNameSafe(channel) {
|
|
4
|
+
return readStringField(asOptionalObjectRecord(channel), "name");
|
|
5
|
+
}
|
|
6
|
+
function resolveDiscordChannelTopicSafe(channel) {
|
|
7
|
+
return readStringField(asOptionalObjectRecord(channel), "topic");
|
|
8
|
+
}
|
|
9
|
+
function resolveDiscordChannelInfoSafe(channel) {
|
|
10
|
+
const record = asOptionalObjectRecord(channel);
|
|
11
|
+
const raw = asOptionalObjectRecord(record?.rawData);
|
|
12
|
+
const readAlias = (camel, snake) => readStringField(record, camel) ?? readStringField(record, snake) ?? readStringField(raw, snake);
|
|
13
|
+
return {
|
|
14
|
+
id: readStringField(record, "id"),
|
|
15
|
+
name: readStringField(record, "name"),
|
|
16
|
+
topic: readStringField(record, "topic"),
|
|
17
|
+
type: typeof record?.type === "number" ? record.type : void 0,
|
|
18
|
+
parentId: readAlias("parentId", "parent_id"),
|
|
19
|
+
ownerId: readAlias("ownerId", "owner_id"),
|
|
20
|
+
parentName: readStringField(asOptionalObjectRecord(record?.parent), "name")
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { resolveDiscordChannelNameSafe as n, resolveDiscordChannelTopicSafe as r, resolveDiscordChannelInfoSafe as t };
|