@openclaw/discord 2026.10.10 → 2026.11.5-beta.1
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-X_Xlr42B.mjs → account-inspect-CSz5Qodj.mjs} +1 -1
- package/dist/.setup/{accounts-C18HNgge.mjs → accounts-DtjvhJUj.mjs} +9 -6
- package/dist/.setup/{active-turn-thread-route-BAc_Xik-.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
- package/dist/.setup/{allow-list-D1ZGfhXh.mjs → allow-list-DahA0Jxh.mjs} +3 -150
- package/dist/.setup/{api-Bth1wKF9.mjs → api-Bp0HI4q3.mjs} +10 -20
- package/dist/.setup/{approval-handler.runtime-BAoEELJJ.mjs → approval-handler.runtime-Cy53ugTf.mjs} +80 -61
- package/dist/.setup/{approval-message-updates-Cks-MSCJ.mjs → approval-message-updates-DqOXxPss.mjs} +2 -2
- package/dist/.setup/{audit-Dw_rAZIz.mjs → audit-DoPKOfQE.mjs} +4 -4
- package/dist/.setup/{channel-BMpMAeQL.mjs → channel-Ds6iuNdy.mjs} +134 -201
- package/dist/.setup/channel-access-DhJhVrdZ.mjs +23 -0
- package/dist/.setup/channel.setup-BLt9dkIG.mjs +235 -0
- package/dist/.setup/{components-BvOWSPxr.mjs → components-WTfUxead.mjs} +208 -426
- package/dist/.setup/components.base-C5sAPHe4.mjs +31 -0
- package/dist/.setup/{config-schema-Coyq5wOr.mjs → config-schema-GX2yDgIH.mjs} +6 -7
- package/dist/.setup/{conversation-binding-route-DOPUZNYo.mjs → conversation-binding-route-CZdm-X5A.mjs} +2 -2
- package/dist/.setup/{directory-config-CIqVnQtn.mjs → directory-config-BXJuh9-J.mjs} +1 -1
- package/dist/.setup/{directory-live-DUuPEWub.mjs → directory-live-CEopeb8Q.mjs} +55 -62
- package/dist/.setup/{discord-eFlHX1Gn.mjs → discord-r79VFjJp.mjs} +1087 -1664
- package/dist/.setup/{doctor-Dty_Ossy.mjs → doctor-UfLW8nye.mjs} +3 -5
- package/dist/.setup/endpoint-runtime-BM3x-m6O.mjs +138 -0
- package/dist/.setup/guilds-DQucP5Tn.mjs +21 -0
- package/dist/.setup/{handle-action-DXY91jF-.mjs → handle-action-BarHOi-v.mjs} +15 -15
- package/dist/.setup/{handle-action.guild-admin-BvBCfhXF.mjs → handle-action.guild-admin-oRUb8p_O.mjs} +5 -5
- package/dist/.setup/listeners-CHgTENFu.mjs +46 -0
- package/dist/.setup/{live-policy-config-DO1Fk2hp.mjs → live-policy-config-EKp4O6zx.mjs} +2 -3
- package/dist/.setup/{message-handler-fL1j1NiR.mjs → message-handler-DUeT8Asf.mjs} +154 -113
- package/dist/.setup/{message-handler.preflight-DkjwNZAd.mjs → message-handler.preflight-C6TNtKW0.mjs} +30 -104
- package/dist/.setup/{message-handler.preflight-pluralkit-DR4BnvMU.mjs → message-handler.preflight-pluralkit-6E9TFmmN.mjs} +9 -22
- package/dist/.setup/{message-handler.process-ClOwIPDK.mjs → message-handler.process-D8_oQ5Cp.mjs} +256 -367
- package/dist/.setup/outbound-payload-DUsrFICb.mjs +445 -0
- package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-Cb8cv4Oi.mjs} +138 -86
- package/dist/.setup/{preflight-audio-CwtPIsvk.mjs → preflight-audio-r4BbaJxh.mjs} +1 -5
- package/dist/.setup/{presence-cache-CgutE4NN.mjs → presence-cache-B3xj3b0l.mjs} +1 -6
- package/dist/.setup/{probe-DNge7OEP.mjs → probe-BUmJyH35.mjs} +5 -9
- package/dist/.setup/{provider-BBDuE14w.mjs → provider-Dm2ERSxe.mjs} +3600 -4454
- package/dist/.setup/{provider-session.runtime-D8hMXXqJ.mjs → provider-session.runtime-DCIqDsIg.mjs} +3 -3
- package/dist/.setup/provider.runtime-DmxPGoUg.mjs +1 -0
- package/dist/.setup/proxy-fetch-B8cK6FLQ.mjs +29 -0
- package/dist/.setup/{realtime-session.runtime-cetognkp.mjs → realtime-session.runtime-WJL6NdwK.mjs} +43 -81
- package/dist/.setup/{receive-recovery-C77CVdGM.mjs → receive-recovery-DV_v5ROf.mjs} +13 -27
- package/dist/.setup/{resolve-allowlist-common-CI77288n.mjs → resolve-allowlist-common-C37fgnYG.mjs} +3 -12
- package/dist/.setup/{resolve-channels-DYc6-xgV.mjs → resolve-channels-CwpnQ7C2.mjs} +5 -4
- package/dist/.setup/{resolve-users-BQT7XWF2.mjs → resolve-users-D6jSwe8R.mjs} +4 -7
- package/dist/.setup/{runtime-CcijhTJT.mjs → runtime-B-PgPsGR.mjs} +6 -6
- package/dist/.setup/{runtime-CI0UJqeS.mjs → runtime-DhOMlnYS.mjs} +196 -235
- package/dist/.setup/{secret-config-contract-BdbCvqnM.mjs → secret-config-contract-CP6teHec.mjs} +4 -9
- package/dist/.setup/{send-Cbq-IVsS.mjs → send-DnLL6XoO.mjs} +149 -174
- package/dist/.setup/{send.components-BV6ucNpJ.mjs → send.components-xB43CksK.mjs} +61 -71
- package/dist/.setup/{send.outbound-CGhBhzjQ.mjs → send.outbound-B11X6TOE.mjs} +75 -129
- package/dist/.setup/{send.receipt-Dw-_r5Bx.mjs → send.receipt-CMteCIZS.mjs} +29 -31
- package/dist/.setup/{send.shared-D4MioxW_.mjs → send.shared-BcLLZBul.mjs} +38 -112
- package/dist/.setup/{sender-identity-DrN5c4ec.mjs → sender-identity-CGNpdJmb.mjs} +3 -9
- package/dist/.setup/setup-plugin-api-C6AMx3hu.mjs +2 -0
- package/dist/.setup/{shared-Bp0sxD5R.mjs → shared-BEYw16he.mjs} +8 -10
- package/dist/.setup/shared-interactive-DKBw4SNV.mjs +311 -0
- package/dist/.setup/{subagent-hooks-mQbDkvuD.mjs → subagent-hooks-DlYElpXa.mjs} +1 -1
- package/dist/.setup/{system-events-2zc2eGfF.mjs → system-events--Pk6y9aP.mjs} +2 -2
- package/dist/.setup/{target-resolver-CAHeVfmZ.mjs → target-resolver-Bo9EpGp_.mjs} +3 -3
- package/dist/.setup/{thread-bindings-Dg7X_ZXP.mjs → thread-bindings-BF-hr-bg.mjs} +12 -20
- package/dist/.setup/{thread-bindings.manager-DCDYksah.mjs → thread-bindings.manager-CQCkha5r.mjs} +22 -42
- package/dist/.setup/{thread-bindings.session-updates-C76plLS3.mjs → thread-bindings.session-updates-C2gJAj_I.mjs} +11 -18
- package/dist/.setup/{threading-l0UfrE6x.mjs → threading-HA9C2wYR.mjs} +68 -104
- package/dist/.setup/{timeouts-DTrUsJ_W.mjs → timeouts-CT9hnmo4.mjs} +1 -1
- package/dist/.setup/{transcripts-source-CGgOaWcu.mjs → transcripts-source-DzpzETZR.mjs} +102 -172
- package/dist/.setup/{voice-runtime-DY1EwDfi.mjs → voice-runtime-Bo_nsVvX.mjs} +231 -448
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +285 -337
- package/dist/api.js +16 -16
- package/dist/assets/embedded-app-sdk.mjs +1 -1
- 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/runtime-api.js +22 -22
- package/dist/secret-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 +56 -68
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +2 -3
- 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-BPrWoEXM.mjs +0 -47
- package/dist/.setup/channel.setup-DVe7Y3Jf.mjs +0 -245
- package/dist/.setup/outbound-adapter-DWyAWBFh.mjs +0 -537
- package/dist/.setup/provider.runtime-BQ1z4Aq1.mjs +0 -1
- package/dist/.setup/setup-plugin-api-B4J6wmL1.mjs +0 -2
- package/dist/.setup/targets-BaklhOqq.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-DtjvhJUj.mjs";
|
|
2
|
+
import { q as withDiscordRequestAuthority } from "./discord-r79VFjJp.mjs";
|
|
3
|
+
import { c as normalizeDiscordMessagingTarget, o as looksLikeDiscordTargetId, s as matchesDiscordToolContextTarget } from "./send.receipt-CMteCIZS.mjs";
|
|
4
4
|
import { t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
5
|
-
import { l as withAbortTimeout } from "./timeouts-
|
|
5
|
+
import { l as withAbortTimeout } from "./timeouts-CT9hnmo4.mjs";
|
|
6
6
|
import { t as getDiscordRuntime } from "./runtime-DcBvHOm1.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-Cb8cv4Oi.mjs";
|
|
8
|
+
import { a as resolveDiscordInboundConversation, i as resolveDiscordCommandConversation, n as discordOutbound, r as resolveDiscordAttachedOutboundTarget } from "./outbound-payload-DUsrFICb.mjs";
|
|
9
9
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DPWiBMks.mjs";
|
|
10
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
11
|
-
import {
|
|
10
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-CZdm-X5A.mjs";
|
|
11
|
+
import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupContract, t as createDiscordPluginBase } from "./shared-BEYw16he.mjs";
|
|
12
12
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-Cfvze5hd.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-C2gJAj_I.mjs";
|
|
14
14
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-Drd4Zu-5.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
|
// extensions/discord/src/approval-shared.ts
|
|
38
36
|
function isDiscordApprovalAccountEligible(params) {
|
|
39
37
|
const account = resolveDiscordAccount(params);
|
|
@@ -115,8 +113,8 @@ function createDiscordOriginTargetResolver() {
|
|
|
115
113
|
resolveFallbackTarget: (request) => resolveSessionOrigin(request)
|
|
116
114
|
});
|
|
117
115
|
}
|
|
118
|
-
function
|
|
119
|
-
return
|
|
116
|
+
function getDiscordApprovalCapability() {
|
|
117
|
+
return createApproverRestrictedNativeApprovalCapabilityAsync({
|
|
120
118
|
channel: "discord",
|
|
121
119
|
channelLabel: "Discord",
|
|
122
120
|
describeExecApprovalSetup: ({ accountId }) => {
|
|
@@ -133,7 +131,7 @@ function createDiscordApprovalCapability() {
|
|
|
133
131
|
accountId,
|
|
134
132
|
senderId
|
|
135
133
|
}),
|
|
136
|
-
isNativeDeliveryEnabled: ({ cfg, accountId }) => isDiscordExecApprovalClientEnabled({
|
|
134
|
+
isNativeDeliveryEnabled: async ({ cfg, accountId }) => isDiscordExecApprovalClientEnabled({
|
|
137
135
|
cfg,
|
|
138
136
|
accountId
|
|
139
137
|
}),
|
|
@@ -163,98 +161,91 @@ function createDiscordApprovalCapability() {
|
|
|
163
161
|
accountId
|
|
164
162
|
}),
|
|
165
163
|
shouldHandle: shouldHandleDiscordApprovalRequest,
|
|
166
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
164
|
+
load: async () => (await import("./approval-handler.runtime-Cy53ugTf.mjs")).discordApprovalNativeRuntime
|
|
167
165
|
})
|
|
168
166
|
});
|
|
169
167
|
}
|
|
170
|
-
let cachedDiscordApprovalCapability;
|
|
171
|
-
function getDiscordApprovalCapability() {
|
|
172
|
-
cachedDiscordApprovalCapability ??= createDiscordApprovalCapability();
|
|
173
|
-
return cachedDiscordApprovalCapability;
|
|
174
|
-
}
|
|
175
168
|
// extensions/discord/src/channel.loaders.ts
|
|
176
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
177
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
178
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
179
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
180
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
181
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
182
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-
|
|
169
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-BXJuh9-J.mjs").then((n) => n.t));
|
|
170
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-CwpnQ7C2.mjs").then((n) => n.n));
|
|
171
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-D6jSwe8R.mjs").then((n) => n.n));
|
|
172
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-CQCkha5r.mjs").then((n) => n.r));
|
|
173
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-Bo9EpGp_.mjs").then((n) => n.r));
|
|
174
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-DmxPGoUg.mjs"));
|
|
175
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-BUmJyH35.mjs").then((n) => n.o));
|
|
183
176
|
async function probeDiscordStatusAccount(params) {
|
|
184
177
|
const startedAtMs = Date.now();
|
|
185
178
|
const runtime = await loadDiscordProbeRuntime();
|
|
186
179
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
187
180
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
188
181
|
}
|
|
189
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
190
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
191
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
182
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-DoPKOfQE.mjs").then((n) => n.n));
|
|
183
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-DnLL6XoO.mjs").then((n) => n.t));
|
|
184
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-CEopeb8Q.mjs").then((n) => n.t));
|
|
192
185
|
// extensions/discord/src/conversation-route-owner.ts
|
|
193
|
-
function
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
guildId: params.conversation.context?.guildId,
|
|
210
|
-
memberRoleIds: params.conversation.context?.memberRoleIds,
|
|
211
|
-
peer: {
|
|
212
|
-
kind: params.conversation.kind,
|
|
213
|
-
id: params.conversation.peerId
|
|
214
|
-
},
|
|
215
|
-
parentConversationId: params.conversation.context?.parentPeerId
|
|
216
|
-
});
|
|
217
|
-
const input = {
|
|
218
|
-
cfg: params.cfg,
|
|
219
|
-
resolveRoute: route,
|
|
220
|
-
accountId,
|
|
221
|
-
runtimeConversationId,
|
|
222
|
-
configuredConversationId: threadConversationId ?? nativeConversationId,
|
|
223
|
-
parentConversationId: params.conversation.context?.parentPeerId,
|
|
224
|
-
touchBinding: false
|
|
225
|
-
};
|
|
226
|
-
return {
|
|
227
|
-
conversation: {
|
|
228
|
-
channel: "discord",
|
|
186
|
+
async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBindings) {
|
|
187
|
+
const prepared = inputs.map((params) => {
|
|
188
|
+
const accountId = normalizeAccountId(params.accountId);
|
|
189
|
+
if (params.cfg.channels?.discord?.enabled === false || !listDiscordAccountIds(params.cfg).some((id) => normalizeAccountId(id) === accountId) || resolveDiscordAccountConfig(params.cfg, accountId)?.enabled === false) return null;
|
|
190
|
+
const direct = params.conversation.kind === "direct";
|
|
191
|
+
const nativeConversationId = params.conversation.nativeChannelId ?? params.conversation.peerId;
|
|
192
|
+
const threadConversationId = direct ? void 0 : params.conversation.threadId;
|
|
193
|
+
const runtimeConversationId = threadConversationId ?? resolveDiscordRuntimeBindingConversationId({
|
|
194
|
+
isDirectMessage: direct,
|
|
195
|
+
isGroupDm: params.conversation.kind === "group",
|
|
196
|
+
userId: direct ? params.conversation.peerId : void 0,
|
|
197
|
+
channelId: nativeConversationId
|
|
198
|
+
});
|
|
199
|
+
const route = ({ boundAgentId }) => resolveDiscordConversationRoute({
|
|
200
|
+
cfg: params.cfg,
|
|
201
|
+
defaultAgentId: boundAgentId,
|
|
229
202
|
accountId,
|
|
230
|
-
|
|
203
|
+
guildId: params.conversation.context?.guildId,
|
|
204
|
+
memberRoleIds: params.conversation.context?.memberRoleIds,
|
|
205
|
+
peer: {
|
|
206
|
+
kind: params.conversation.kind,
|
|
207
|
+
id: params.conversation.peerId
|
|
208
|
+
},
|
|
231
209
|
parentConversationId: params.conversation.context?.parentPeerId
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
210
|
+
});
|
|
211
|
+
const input = {
|
|
212
|
+
cfg: params.cfg,
|
|
213
|
+
resolveRoute: route,
|
|
214
|
+
accountId,
|
|
215
|
+
runtimeConversationId,
|
|
216
|
+
configuredConversationId: threadConversationId ?? nativeConversationId,
|
|
217
|
+
parentConversationId: params.conversation.context?.parentPeerId
|
|
218
|
+
};
|
|
219
|
+
return {
|
|
220
|
+
conversation: {
|
|
240
221
|
channel: "discord",
|
|
241
222
|
accountId,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
223
|
+
conversationId: runtimeConversationId,
|
|
224
|
+
parentConversationId: params.conversation.context?.parentPeerId
|
|
225
|
+
},
|
|
226
|
+
resolve(inspection) {
|
|
227
|
+
const { runtimeRoute, configuredRoute } = resolveDiscordConversationBindingRoute({
|
|
228
|
+
...input,
|
|
229
|
+
inspection
|
|
230
|
+
});
|
|
231
|
+
if (!runtimeRoute.bindingOwnerAvailable && resolveThreadBindingSpawnPolicy({
|
|
232
|
+
cfg: params.cfg,
|
|
233
|
+
channel: "discord",
|
|
234
|
+
accountId,
|
|
235
|
+
kind: "subagent"
|
|
236
|
+
}).enabled) return { kind: "unavailable" };
|
|
237
|
+
if (runtimeRoute.pluginId) return {
|
|
238
|
+
kind: "plugin",
|
|
239
|
+
pluginId: runtimeRoute.pluginId,
|
|
240
|
+
fallbackAgentId: runtimeRoute.route.agentId
|
|
241
|
+
};
|
|
242
|
+
return {
|
|
243
|
+
kind: "agent",
|
|
244
|
+
agentId: runtimeRoute.boundAgentId ?? configuredRoute?.boundAgentId ?? runtimeRoute.route.agentId
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
});
|
|
258
249
|
const inspect = await inspectBindings(prepared.flatMap((item) => item ? [item.conversation] : []));
|
|
259
250
|
let index = 0;
|
|
260
251
|
return prepared.map((item) => {
|
|
@@ -263,68 +254,6 @@ async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBinding
|
|
|
263
254
|
return () => item.resolve(inspect()[position]);
|
|
264
255
|
});
|
|
265
256
|
}
|
|
266
|
-
// extensions/discord/src/group-policy.ts
|
|
267
|
-
const guildScopeKey = (guildKey) => scopeKey(["guild", guildKey]);
|
|
268
|
-
const channelScopeKey = (guildKey, channelKey) => scopeKey(["guild", guildKey], ["channel", channelKey]);
|
|
269
|
-
function resolveDiscordGuildKey(guilds, groupSpace) {
|
|
270
|
-
if (!guilds || Object.keys(guilds).length === 0) return;
|
|
271
|
-
const space = normalizeOptionalString(groupSpace) ?? "";
|
|
272
|
-
if (space && guilds[space]) return space;
|
|
273
|
-
const normalized = normalizeAtHashSlug(space);
|
|
274
|
-
if (normalized && guilds[normalized]) return normalized;
|
|
275
|
-
if (normalized) {
|
|
276
|
-
const match = Object.entries(guilds).find(([, entry]) => normalizeAtHashSlug(entry?.slug ?? void 0) === normalized);
|
|
277
|
-
if (match) return match[0];
|
|
278
|
-
}
|
|
279
|
-
return guilds["*"] ? "*" : void 0;
|
|
280
|
-
}
|
|
281
|
-
function resolveDiscordChannelKey(channelEntries, params) {
|
|
282
|
-
if (!channelEntries || Object.keys(channelEntries).length === 0) return;
|
|
283
|
-
const groupChannel = params.groupChannel;
|
|
284
|
-
const channelSlug = normalizeAtHashSlug(groupChannel);
|
|
285
|
-
if (params.groupId && channelEntries[params.groupId]) return params.groupId;
|
|
286
|
-
if (channelSlug && channelEntries[channelSlug]) return channelSlug;
|
|
287
|
-
if (channelSlug && channelEntries[`#${channelSlug}`]) return `#${channelSlug}`;
|
|
288
|
-
return groupChannel && channelEntries[channelSlug] ? channelSlug : void 0;
|
|
289
|
-
}
|
|
290
|
-
function resolveDiscordPolicyScope(params) {
|
|
291
|
-
const guilds = (params.accountId ? params.cfg.channels?.discord?.accounts?.[params.accountId]?.guilds : void 0) ?? params.cfg.channels?.discord?.guilds;
|
|
292
|
-
const tree = { scopes: {} };
|
|
293
|
-
for (const [guildKey, guild] of Object.entries(guilds ?? {})) {
|
|
294
|
-
tree.scopes[guildScopeKey(guildKey)] = guild;
|
|
295
|
-
for (const [channelKey, channel] of Object.entries(guild.channels ?? {})) tree.scopes[channelScopeKey(guildKey, channelKey)] = channel;
|
|
296
|
-
}
|
|
297
|
-
const guildKey = resolveDiscordGuildKey(guilds, params.groupSpace);
|
|
298
|
-
if (!guildKey) return {
|
|
299
|
-
tree,
|
|
300
|
-
path: []
|
|
301
|
-
};
|
|
302
|
-
const channels = guilds?.[guildKey]?.channels;
|
|
303
|
-
let channelKey = resolveDiscordChannelKey(channels, params);
|
|
304
|
-
if (channelKey !== params.groupId) {
|
|
305
|
-
const boundKey = params.groupId ? findDiscordChannelPolicyKey(params.accountId, guildKey, params.groupId) : void 0;
|
|
306
|
-
if (boundKey !== void 0 && channels?.[boundKey]) channelKey = boundKey;
|
|
307
|
-
else if (channelKey !== void 0 && getDiscordChannelPolicyBinding(params.accountId, guildKey, channelKey) !== void 0) channelKey = void 0;
|
|
308
|
-
}
|
|
309
|
-
return {
|
|
310
|
-
tree,
|
|
311
|
-
path: [guildScopeKey(guildKey), ...channelKey !== void 0 ? [channelScopeKey(guildKey, channelKey)] : []]
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
function resolveDiscordGroupRequireMention(params) {
|
|
315
|
-
return resolveScopeRequireMention(resolveDiscordPolicyScope(params));
|
|
316
|
-
}
|
|
317
|
-
function resolveDiscordGroupToolPolicy(params) {
|
|
318
|
-
const scope = resolveDiscordPolicyScope(params);
|
|
319
|
-
return resolveScopeToolsPolicy({
|
|
320
|
-
...scope,
|
|
321
|
-
senderPolicyMode: params.senderPolicyMode,
|
|
322
|
-
senderId: params.senderId,
|
|
323
|
-
senderName: params.senderName,
|
|
324
|
-
senderUsername: params.senderUsername,
|
|
325
|
-
senderE164: params.senderE164
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
257
|
// extensions/discord/src/status-issues.ts
|
|
329
258
|
function isDiscordMessageContentIntentDisabled(value) {
|
|
330
259
|
return isRecord$1(value) && isRecord$1(value.intents) && value.intents.messageContent === "disabled";
|
|
@@ -362,43 +291,23 @@ function collectDiscordStatusIssues(accounts) {
|
|
|
362
291
|
if (!account) continue;
|
|
363
292
|
const accountId = resolveEnabledConfiguredAccountId(account);
|
|
364
293
|
if (!accountId) continue;
|
|
365
|
-
const
|
|
294
|
+
const addIssue = (kind, message, fix) => issues.push({
|
|
366
295
|
channel: "discord",
|
|
367
|
-
accountId
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
issues.push({
|
|
372
|
-
...scope,
|
|
373
|
-
kind: "config",
|
|
374
|
-
message: "Discord guild messages are blocked: effective groupPolicy is \"allowlist\", but no guilds are configured.",
|
|
375
|
-
fix: `${guildGuidance} Refresh channel status after the configuration reload applies.`
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
if (isDiscordMessageContentIntentDisabled(account.application)) issues.push({
|
|
379
|
-
...scope,
|
|
380
|
-
kind: "intent",
|
|
381
|
-
message: "Message Content Intent is disabled. Bot may not see normal channel messages.",
|
|
382
|
-
fix: "Enable Message Content Intent in Discord Dev Portal → Bot → Privileged Gateway Intents, or require mention-only operation."
|
|
296
|
+
accountId,
|
|
297
|
+
kind,
|
|
298
|
+
message,
|
|
299
|
+
fix
|
|
383
300
|
});
|
|
301
|
+
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.`);
|
|
302
|
+
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.");
|
|
384
303
|
const audit = readDiscordPermissionsAuditSummary(account.audit);
|
|
385
|
-
if (audit.unresolvedChannels && audit.unresolvedChannels > 0)
|
|
386
|
-
...scope,
|
|
387
|
-
kind: "config",
|
|
388
|
-
message: `Some configured guild channels are not numeric IDs (unresolvedChannels=${audit.unresolvedChannels}). Permission audit can only check numeric channel IDs.`,
|
|
389
|
-
fix: "Use numeric channel IDs as keys in channels.discord.guilds.*.channels (then rerun channels status --probe)."
|
|
390
|
-
});
|
|
304
|
+
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).");
|
|
391
305
|
for (const channel of audit.channels ?? []) {
|
|
392
306
|
if (channel.ok === true) continue;
|
|
393
307
|
const missing = channel.missing?.length ? ` missing ${channel.missing.join(", ")}` : "";
|
|
394
308
|
const error = channel.error ? `: ${channel.error}` : "";
|
|
395
309
|
const baseMessage = `Channel ${channel.channelId} permission check failed.${missing}${error}`;
|
|
396
|
-
|
|
397
|
-
...scope,
|
|
398
|
-
kind: "permissions",
|
|
399
|
-
message: appendMatchMetadata(baseMessage, channel),
|
|
400
|
-
fix: "Check that the bot role can view + send in this channel (and that channel overrides don't deny it)."
|
|
401
|
-
});
|
|
310
|
+
addIssue("permissions", appendMatchMetadata(baseMessage, channel), "Check that the bot role can view + send in this channel (and that channel overrides don't deny it).");
|
|
402
311
|
}
|
|
403
312
|
}
|
|
404
313
|
return issues;
|
|
@@ -407,9 +316,9 @@ function collectDiscordStatusIssues(accounts) {
|
|
|
407
316
|
function toConversationLifecycleBinding(binding) {
|
|
408
317
|
return {
|
|
409
318
|
boundAt: binding.boundAt,
|
|
410
|
-
lastActivityAt:
|
|
411
|
-
idleTimeoutMs:
|
|
412
|
-
maxAgeMs:
|
|
319
|
+
lastActivityAt: binding.lastActivityAt ?? binding.boundAt,
|
|
320
|
+
idleTimeoutMs: binding.idleTimeoutMs,
|
|
321
|
+
maxAgeMs: binding.maxAgeMs
|
|
413
322
|
};
|
|
414
323
|
}
|
|
415
324
|
const discordConversationBindings = {
|
|
@@ -516,11 +425,14 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
516
425
|
resolveToolPolicy: resolveDiscordGroupToolPolicy
|
|
517
426
|
},
|
|
518
427
|
mentions: { stripPatterns: () => ["<@!?\\d+>"] },
|
|
519
|
-
agentPrompt: {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
428
|
+
agentPrompt: {
|
|
429
|
+
questionInputMode: "buttons",
|
|
430
|
+
messageToolHints: () => [
|
|
431
|
+
"- 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.",
|
|
432
|
+
"- Discord components: set `components` when sending messages to include buttons, selects, or v2 containers.",
|
|
433
|
+
"- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages."
|
|
434
|
+
]
|
|
435
|
+
},
|
|
524
436
|
messaging: {
|
|
525
437
|
directTargetStyle: discordPluginBase.messaging?.directTargetStyle,
|
|
526
438
|
inferTargetChatType: discordPluginBase.messaging?.inferTargetChatType,
|
|
@@ -531,7 +443,18 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
531
443
|
resolveInboundConversation: resolveDiscordInboundConversation,
|
|
532
444
|
normalizeExplicitSessionKey: ({ sessionKey, ctx }) => normalizeExplicitDiscordSessionKey(sessionKey, ctx),
|
|
533
445
|
resolveSessionTarget: ({ id }) => normalizeDiscordMessagingTarget(`channel:${id}`),
|
|
534
|
-
buildCrossContextPresentation:
|
|
446
|
+
buildCrossContextPresentation: ({ originLabel, message }) => {
|
|
447
|
+
return {
|
|
448
|
+
tone: "neutral",
|
|
449
|
+
blocks: [...message.trim() ? [{
|
|
450
|
+
type: "text",
|
|
451
|
+
text: message
|
|
452
|
+
}, { type: "divider" }] : [], {
|
|
453
|
+
type: "context",
|
|
454
|
+
text: `From ${originLabel}`
|
|
455
|
+
}]
|
|
456
|
+
};
|
|
457
|
+
},
|
|
535
458
|
resolveOutboundSessionRoute: resolveDiscordOutboundSessionRoute,
|
|
536
459
|
targetResolver: {
|
|
537
460
|
looksLikeId: looksLikeDiscordTargetId,
|
|
@@ -604,12 +527,22 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
604
527
|
} },
|
|
605
528
|
actions: discordMessageActions,
|
|
606
529
|
bindings: {
|
|
607
|
-
compileConfiguredBinding: ({ conversationId }) =>
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
530
|
+
compileConfiguredBinding: ({ conversationId }) => {
|
|
531
|
+
const normalized = conversationId.trim();
|
|
532
|
+
return normalized ? { conversationId: normalized } : null;
|
|
533
|
+
},
|
|
534
|
+
matchInboundConversation: ({ compiledBinding, conversationId, parentConversationId }) => {
|
|
535
|
+
const bindingConversationId = compiledBinding.conversationId;
|
|
536
|
+
if (bindingConversationId === conversationId) return {
|
|
537
|
+
conversationId,
|
|
538
|
+
matchPriority: 2
|
|
539
|
+
};
|
|
540
|
+
if (parentConversationId && parentConversationId !== conversationId && bindingConversationId === parentConversationId) return {
|
|
541
|
+
conversationId: parentConversationId,
|
|
542
|
+
matchPriority: 1
|
|
543
|
+
};
|
|
544
|
+
return null;
|
|
545
|
+
},
|
|
613
546
|
resolveCommandConversation: resolveDiscordCommandConversation
|
|
614
547
|
},
|
|
615
548
|
conversationBindings: discordConversationBindings,
|
|
@@ -651,7 +584,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
651
584
|
},
|
|
652
585
|
buildCapabilitiesDiagnostics: async ({ account, target, timeoutMs }) => {
|
|
653
586
|
if (!target?.trim()) return;
|
|
654
|
-
const parsedTarget = parseDiscordTarget(target
|
|
587
|
+
const parsedTarget = parseDiscordTarget(target, { defaultKind: "channel" });
|
|
655
588
|
const details = { target: {
|
|
656
589
|
raw: target,
|
|
657
590
|
normalized: parsedTarget?.normalized,
|
|
@@ -819,7 +752,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
819
752
|
} catch (error) {
|
|
820
753
|
ctx.log?.warn?.(`[${account.accountId}] Discord command deploy cache unavailable; continuing without persistence: ${formatErrorMessage(error)}`);
|
|
821
754
|
}
|
|
822
|
-
|
|
755
|
+
await (await loadDiscordProviderRuntime()).monitorDiscordProvider({
|
|
823
756
|
scheduler: ctx.scheduler,
|
|
824
757
|
token,
|
|
825
758
|
accountId: account.accountId,
|
|
@@ -886,4 +819,4 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
886
819
|
shouldSuppressLocalPayloadPrompt: shouldSuppressLocalDiscordExecApprovalPrompt
|
|
887
820
|
}
|
|
888
821
|
});
|
|
889
|
-
export {
|
|
822
|
+
export { collectDiscordStatusIssues as n, shouldHandleDiscordApprovalRequest as r, discordPlugin as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { asOptionalObjectRecord, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
// 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
|
+
export { resolveDiscordChannelNameSafe as n, resolveDiscordChannelTopicSafe as r, resolveDiscordChannelInfoSafe as t };
|