@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
package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-Cb8cv4Oi.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-CSz5Qodj.mjs";
|
|
3
|
+
import { w as isDiscordThreadChannelType } from "./allow-list-DahA0Jxh.mjs";
|
|
4
|
+
import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-CMteCIZS.mjs";
|
|
5
5
|
import { t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-WTfUxead.mjs";
|
|
7
7
|
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-BzlhNBxA.mjs";
|
|
8
8
|
import { createLazyRuntimeMethod, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -13,13 +13,15 @@ import { asNonArrayRecord, asOptionalRecord, isRecord, normalizeOptionalLowercas
|
|
|
13
13
|
import { createUnionActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
14
14
|
import { ChannelType } from "discord-api-types/v10";
|
|
15
15
|
import { resolveAskUserQuestionOptionIndices } from "openclaw/plugin-sdk/reply-payload";
|
|
16
|
-
import { Type } from "typebox";
|
|
17
16
|
import { resolveGlobalMap } from "openclaw/plugin-sdk/global-singleton";
|
|
17
|
+
import { Type } from "typebox";
|
|
18
|
+
import { normalizeAtHashSlug } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
18
19
|
import { buildThreadAwareOutboundSessionRoute } from "openclaw/plugin-sdk/channel-core";
|
|
19
20
|
import { getExecApprovalReplyMetadata, isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
|
|
20
21
|
import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
21
22
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
22
23
|
import { createInboundEventDeliveryCorrelation } from "openclaw/plugin-sdk/inbound-event-delivery";
|
|
24
|
+
import { resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
|
|
23
25
|
// extensions/discord/src/exec-approvals.ts
|
|
24
26
|
function normalizeDiscordApproverId(value) {
|
|
25
27
|
const trimmed = String(value).trim();
|
|
@@ -209,17 +211,7 @@ const localExecutionActions = /* @__PURE__ */ new Set([
|
|
|
209
211
|
"sticker-upload",
|
|
210
212
|
"event-create"
|
|
211
213
|
]);
|
|
212
|
-
|
|
213
|
-
if (normalizeOptionalString(args.target) || normalizeOptionalString(args.to) || normalizeOptionalString(args.channelId)) return;
|
|
214
|
-
const threadId = normalizeOptionalString(args.threadId);
|
|
215
|
-
return threadId ? normalizeDiscordMessagingTarget(`channel:${threadId}`) : void 0;
|
|
216
|
-
}
|
|
217
|
-
function resolveDiscordThreadReplyTarget(args) {
|
|
218
|
-
const threadId = normalizeOptionalString(args.threadId);
|
|
219
|
-
const target = threadId !== void 0 ? `channel:${threadId}` : normalizeOptionalString(args.channelId) ?? normalizeOptionalString(args.to) ?? normalizeOptionalString(args.target);
|
|
220
|
-
return target ? normalizeDiscordMessagingTarget(target) : void 0;
|
|
221
|
-
}
|
|
222
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-DXY91jF-.mjs"));
|
|
214
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-BarHOi-v.mjs"));
|
|
223
215
|
const discordActionGroups = [
|
|
224
216
|
{
|
|
225
217
|
gate: "polls",
|
|
@@ -330,47 +322,6 @@ const discordActionGroups = [
|
|
|
330
322
|
defaultEnabled: false
|
|
331
323
|
}
|
|
332
324
|
];
|
|
333
|
-
function describeDiscordMessageTool({ cfg, accountId }) {
|
|
334
|
-
const accounts = (accountId ? [accountId] : listDiscordAccountIds(cfg)).map((id) => inspectDiscordAccount({
|
|
335
|
-
cfg,
|
|
336
|
-
accountId: id
|
|
337
|
-
})).filter((account) => account.enabled && account.configured);
|
|
338
|
-
if (accounts.length === 0) return {
|
|
339
|
-
actions: [],
|
|
340
|
-
capabilities: [],
|
|
341
|
-
schema: null
|
|
342
|
-
};
|
|
343
|
-
const isEnabled = createUnionActionGate(accounts, (account) => createDiscordActionGate({
|
|
344
|
-
cfg,
|
|
345
|
-
accountId: account.accountId
|
|
346
|
-
}));
|
|
347
|
-
const actions = /* @__PURE__ */ new Set(["send"]);
|
|
348
|
-
for (const group of discordActionGroups) if (isEnabled(group.gate, group.defaultEnabled ?? true)) for (const action of group.actions) actions.add(action);
|
|
349
|
-
const schema = [];
|
|
350
|
-
if (actions.has("react")) schema.push({
|
|
351
|
-
actions: ["react", "reactions"],
|
|
352
|
-
properties: { emoji: Type.Optional(Type.String({ description: `Unicode emoji or custom name:id (also <:name:id> / <a:name:id>).${actions.has("emoji-list") ? " Use action:\"emoji-list\" for server emojis." : ""}` })) }
|
|
353
|
-
});
|
|
354
|
-
schema.push({
|
|
355
|
-
actions: ["send"],
|
|
356
|
-
visibility: "all-configured",
|
|
357
|
-
properties: { components: Type.Optional(Type.Object({
|
|
358
|
-
blocks: Type.Optional(Type.Array(Type.Unknown(), { description: "Discord Components V2 blocks such as text, buttons, selects, media, containers, and separators." })),
|
|
359
|
-
modal: Type.Optional(Type.Object({}, {
|
|
360
|
-
additionalProperties: true,
|
|
361
|
-
description: "Optional Discord modal triggered by generated components."
|
|
362
|
-
}))
|
|
363
|
-
}, {
|
|
364
|
-
additionalProperties: true,
|
|
365
|
-
description: "Discord Components V2 payload for send actions. Accepts the same object consumed by the Discord components adapter."
|
|
366
|
-
})) }
|
|
367
|
-
});
|
|
368
|
-
return {
|
|
369
|
-
actions: Array.from(actions),
|
|
370
|
-
capabilities: ["presentation"],
|
|
371
|
-
schema
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
325
|
const discordMessageActions = {
|
|
375
326
|
providerOwnedReadGates: true,
|
|
376
327
|
readAuthorityActions: [
|
|
@@ -396,14 +347,60 @@ const discordMessageActions = {
|
|
|
396
347
|
"unpin"
|
|
397
348
|
],
|
|
398
349
|
resolveExecutionMode: ({ action }) => localExecutionActions.has(action) ? "local" : "gateway",
|
|
399
|
-
describeMessageTool:
|
|
350
|
+
describeMessageTool: ({ cfg, accountId }) => {
|
|
351
|
+
const accounts = (accountId ? [accountId] : listDiscordAccountIds(cfg)).map((id) => inspectDiscordAccount({
|
|
352
|
+
cfg,
|
|
353
|
+
accountId: id
|
|
354
|
+
})).filter((account) => account.enabled && account.configured);
|
|
355
|
+
if (accounts.length === 0) return {
|
|
356
|
+
actions: [],
|
|
357
|
+
capabilities: [],
|
|
358
|
+
schema: null
|
|
359
|
+
};
|
|
360
|
+
const isEnabled = createUnionActionGate(accounts, (account) => createDiscordActionGate({
|
|
361
|
+
cfg,
|
|
362
|
+
accountId: account.accountId
|
|
363
|
+
}));
|
|
364
|
+
const actions = /* @__PURE__ */ new Set(["send"]);
|
|
365
|
+
for (const group of discordActionGroups) if (isEnabled(group.gate, group.defaultEnabled ?? true)) for (const action of group.actions) actions.add(action);
|
|
366
|
+
const schema = [];
|
|
367
|
+
if (actions.has("react")) schema.push({
|
|
368
|
+
actions: ["react", "reactions"],
|
|
369
|
+
properties: { emoji: Type.Optional(Type.String({ description: `Unicode emoji or custom name:id (also <:name:id> / <a:name:id>).${actions.has("emoji-list") ? " Use action:\"emoji-list\" for server emojis." : ""}` })) }
|
|
370
|
+
});
|
|
371
|
+
schema.push({
|
|
372
|
+
actions: ["send"],
|
|
373
|
+
visibility: "all-configured",
|
|
374
|
+
properties: { components: Type.Optional(Type.Object({
|
|
375
|
+
blocks: Type.Optional(Type.Array(Type.Unknown(), { description: "Discord Components V2 blocks such as text, buttons, selects, media, containers, and separators." })),
|
|
376
|
+
modal: Type.Optional(Type.Object({}, {
|
|
377
|
+
additionalProperties: true,
|
|
378
|
+
description: "Optional Discord modal triggered by generated components."
|
|
379
|
+
}))
|
|
380
|
+
}, {
|
|
381
|
+
additionalProperties: true,
|
|
382
|
+
description: "Discord Components V2 payload for send actions. Accepts the same object consumed by the Discord components adapter."
|
|
383
|
+
})) }
|
|
384
|
+
});
|
|
385
|
+
return {
|
|
386
|
+
actions: Array.from(actions),
|
|
387
|
+
capabilities: ["presentation"],
|
|
388
|
+
schema
|
|
389
|
+
};
|
|
390
|
+
},
|
|
400
391
|
supportsAction: ({ action }) => action !== "poll",
|
|
401
392
|
messageActionTargetAliases: { "thread-reply": {
|
|
402
393
|
aliases: ["threadId"],
|
|
403
394
|
deliveryTargetAliases: ["threadId"],
|
|
404
|
-
resolveDeliveryTarget: ({ args }) =>
|
|
395
|
+
resolveDeliveryTarget: ({ args }) => {
|
|
396
|
+
if (normalizeOptionalString(args.target) || normalizeOptionalString(args.to) || normalizeOptionalString(args.channelId)) return;
|
|
397
|
+
const threadId = normalizeOptionalString(args.threadId);
|
|
398
|
+
return threadId ? normalizeDiscordMessagingTarget(`channel:${threadId}`) : void 0;
|
|
399
|
+
},
|
|
405
400
|
matchesCurrentConversation: ({ args, toolContext }) => {
|
|
406
|
-
const
|
|
401
|
+
const threadId = normalizeOptionalString(args.threadId);
|
|
402
|
+
const rawTarget = threadId !== void 0 ? `channel:${threadId}` : normalizeOptionalString(args.channelId) ?? normalizeOptionalString(args.to) ?? normalizeOptionalString(args.target);
|
|
403
|
+
const target = rawTarget ? normalizeDiscordMessagingTarget(rawTarget) : void 0;
|
|
407
404
|
return target ? matchesDiscordToolContextTarget({
|
|
408
405
|
target,
|
|
409
406
|
toolContext
|
|
@@ -456,7 +453,7 @@ const discordMessageActions = {
|
|
|
456
453
|
};
|
|
457
454
|
// extensions/discord/src/conversation-identity.ts
|
|
458
455
|
function normalizeDiscordTarget(raw, defaultKind) {
|
|
459
|
-
return parseDiscordTarget(
|
|
456
|
+
return parseDiscordTarget(raw ?? "", { defaultKind })?.normalized;
|
|
460
457
|
}
|
|
461
458
|
function buildDiscordConversationIdentity(kind, rawId) {
|
|
462
459
|
const trimmed = normalizeOptionalString(rawId);
|
|
@@ -523,16 +520,6 @@ function resolveDiscordConversationRoute(params) {
|
|
|
523
520
|
});
|
|
524
521
|
}
|
|
525
522
|
}
|
|
526
|
-
function resolveDiscordBoundConversationRoute(params) {
|
|
527
|
-
const route = resolveDiscordConversationRoute({
|
|
528
|
-
...params,
|
|
529
|
-
peer: buildDiscordRoutePeer(params)
|
|
530
|
-
});
|
|
531
|
-
return resolveDiscordEffectiveRoute({
|
|
532
|
-
...params,
|
|
533
|
-
route
|
|
534
|
-
});
|
|
535
|
-
}
|
|
536
523
|
function resolveDiscordEffectiveRoute(params) {
|
|
537
524
|
const boundSessionKey = params.boundSessionKey?.trim();
|
|
538
525
|
if (!boundSessionKey) return params.configuredRoute?.route ?? params.route;
|
|
@@ -564,18 +551,83 @@ function shouldIgnoreStaleDiscordRouteBinding(params) {
|
|
|
564
551
|
return bound.agentId !== params.route.agentId;
|
|
565
552
|
}
|
|
566
553
|
// extensions/discord/src/channel-policy-state.ts
|
|
567
|
-
const
|
|
568
|
-
function
|
|
569
|
-
|
|
554
|
+
const policyBindings = resolveGlobalMap(Symbol.for("openclaw.discord.policy-bindings"), "close-and-restart");
|
|
555
|
+
function setDiscordPolicyBindings(accountId, bindings, guilds = /* @__PURE__ */ new Map()) {
|
|
556
|
+
policyBindings.set(normalizeAccountId(accountId), {
|
|
557
|
+
channels: bindings,
|
|
558
|
+
guilds
|
|
559
|
+
});
|
|
570
560
|
}
|
|
571
|
-
function
|
|
572
|
-
return
|
|
561
|
+
function findDiscordGuildPolicyKey(accountId, guildId) {
|
|
562
|
+
return policyBindings.get(normalizeAccountId(accountId))?.guilds.get(guildId);
|
|
573
563
|
}
|
|
574
564
|
function getDiscordChannelPolicyBinding(accountId, guildKey, channelKey) {
|
|
575
|
-
return
|
|
565
|
+
return policyBindings.get(normalizeAccountId(accountId))?.channels.find((binding) => binding.guildKey === guildKey && binding.channelKey === channelKey)?.channelId;
|
|
576
566
|
}
|
|
577
567
|
function findDiscordChannelPolicyKey(accountId, guildKey, channelId) {
|
|
578
|
-
return
|
|
568
|
+
return policyBindings.get(normalizeAccountId(accountId))?.channels.find((binding) => binding.guildKey === guildKey && binding.channelId === channelId)?.channelKey;
|
|
569
|
+
}
|
|
570
|
+
// extensions/discord/src/group-policy.ts
|
|
571
|
+
function resolveDiscordGuildKey(guilds, groupSpace, accountId) {
|
|
572
|
+
if (!guilds || Object.keys(guilds).length === 0) return;
|
|
573
|
+
const space = normalizeOptionalString(groupSpace) ?? "";
|
|
574
|
+
if (space && guilds[space]) return space;
|
|
575
|
+
const boundKey = findDiscordGuildPolicyKey(accountId, space);
|
|
576
|
+
if (boundKey !== void 0 && guilds[boundKey]) return boundKey;
|
|
577
|
+
const normalized = normalizeAtHashSlug(space);
|
|
578
|
+
if (normalized && guilds[normalized]) return normalized;
|
|
579
|
+
if (normalized) {
|
|
580
|
+
const match = Object.entries(guilds).find(([, entry]) => normalizeAtHashSlug(entry?.slug ?? void 0) === normalized);
|
|
581
|
+
if (match) return match[0];
|
|
582
|
+
}
|
|
583
|
+
return guilds["*"] ? "*" : void 0;
|
|
584
|
+
}
|
|
585
|
+
function resolveDiscordChannelKey(channelEntries, params) {
|
|
586
|
+
if (!channelEntries || Object.keys(channelEntries).length === 0) return;
|
|
587
|
+
const groupChannel = params.groupChannel;
|
|
588
|
+
const channelSlug = normalizeAtHashSlug(groupChannel);
|
|
589
|
+
if (params.groupId && channelEntries[params.groupId]) return params.groupId;
|
|
590
|
+
if (channelSlug && channelEntries[channelSlug]) return channelSlug;
|
|
591
|
+
if (channelSlug && channelEntries[`#${channelSlug}`]) return `#${channelSlug}`;
|
|
592
|
+
return groupChannel && channelEntries[channelSlug] ? channelSlug : void 0;
|
|
593
|
+
}
|
|
594
|
+
function resolveDiscordPolicyScope(params) {
|
|
595
|
+
const guilds = (params.accountId ? resolveDiscordAccountConfig(params.cfg, params.accountId)?.guilds : void 0) ?? params.cfg.channels?.discord?.guilds;
|
|
596
|
+
const guildKey = resolveDiscordGuildKey(guilds, params.groupSpace, params.accountId);
|
|
597
|
+
const guild = guildKey ? guilds?.[guildKey] : void 0;
|
|
598
|
+
if (!guildKey || !guild) return {
|
|
599
|
+
tree: { scopes: {} },
|
|
600
|
+
path: []
|
|
601
|
+
};
|
|
602
|
+
const channels = guild.channels;
|
|
603
|
+
let channelKey = resolveDiscordChannelKey(channels, params);
|
|
604
|
+
if (channelKey !== params.groupId) {
|
|
605
|
+
const boundKey = params.groupId ? findDiscordChannelPolicyKey(params.accountId, guildKey, params.groupId) : void 0;
|
|
606
|
+
if (boundKey !== void 0 && channels?.[boundKey]) channelKey = boundKey;
|
|
607
|
+
else if (channelKey !== void 0 && getDiscordChannelPolicyBinding(params.accountId, guildKey, channelKey) !== void 0) channelKey = void 0;
|
|
608
|
+
}
|
|
609
|
+
const channel = channelKey !== void 0 ? channels?.[channelKey] : void 0;
|
|
610
|
+
return {
|
|
611
|
+
tree: { scopes: {
|
|
612
|
+
guild,
|
|
613
|
+
...channel ? { channel } : {}
|
|
614
|
+
} },
|
|
615
|
+
path: channel ? ["guild", "channel"] : ["guild"]
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
function resolveDiscordGroupRequireMention(params) {
|
|
619
|
+
return resolveScopeRequireMention(resolveDiscordPolicyScope(params));
|
|
620
|
+
}
|
|
621
|
+
function resolveDiscordGroupToolPolicy(params) {
|
|
622
|
+
const scope = resolveDiscordPolicyScope(params);
|
|
623
|
+
return resolveScopeToolsPolicy({
|
|
624
|
+
...scope,
|
|
625
|
+
senderPolicyMode: params.senderPolicyMode,
|
|
626
|
+
senderId: params.senderId,
|
|
627
|
+
senderName: params.senderName,
|
|
628
|
+
senderUsername: params.senderUsername,
|
|
629
|
+
senderE164: params.senderE164
|
|
630
|
+
});
|
|
579
631
|
}
|
|
580
632
|
// extensions/discord/src/approval-message-safety.ts
|
|
581
633
|
const DISCORD_APPROVAL_ALLOWED_MENTIONS = { parse: [] };
|
|
@@ -609,14 +661,14 @@ function escapeDiscordApprovalDisplayCharacter(character) {
|
|
|
609
661
|
return DISCORD_MARKDOWN_META_CHARACTERS.has(character) ? `\\${character}` : character;
|
|
610
662
|
}
|
|
611
663
|
/** Keep opaque approval metadata bounded, single-line, and inert in Discord Markdown. */
|
|
612
|
-
function formatDiscordApprovalDisplayValue(value
|
|
613
|
-
const limit =
|
|
664
|
+
function formatDiscordApprovalDisplayValue(value) {
|
|
665
|
+
const limit = 200;
|
|
614
666
|
let escaped = "";
|
|
615
667
|
let bounded = "";
|
|
616
668
|
for (const character of value) {
|
|
617
669
|
escaped += escapeDiscordApprovalDisplayCharacter(character);
|
|
618
|
-
if (escaped.length <=
|
|
619
|
-
if (escaped.length > limit) return
|
|
670
|
+
if (escaped.length <= 197) bounded = escaped;
|
|
671
|
+
if (escaped.length > limit) return `${bounded}...`;
|
|
620
672
|
}
|
|
621
673
|
return escaped;
|
|
622
674
|
}
|
|
@@ -650,8 +702,8 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
650
702
|
}
|
|
651
703
|
}
|
|
652
704
|
};
|
|
653
|
-
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-
|
|
654
|
-
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./
|
|
705
|
+
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-xB43CksK.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
|
|
706
|
+
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./shared-interactive-DKBw4SNV.mjs").then((n) => n.r));
|
|
655
707
|
function addPayloadTextFallback(spec, payload) {
|
|
656
708
|
return spec.text ? spec : {
|
|
657
709
|
...spec,
|
|
@@ -746,4 +798,4 @@ function resolveDiscordOutboundTargetKindHint(params) {
|
|
|
746
798
|
if (resolvedKind === "group" || resolvedKind === "channel") return "channel";
|
|
747
799
|
return /^(user:|discord:|@|<@!?)/i.test(params.target.trim()) ? "user" : "channel";
|
|
748
800
|
}
|
|
749
|
-
export {
|
|
801
|
+
export { shouldSuppressLocalDiscordExecApprovalPrompt as A, notifyDiscordInboundEventOutboundPayloadSuccess as C, getDiscordExecApprovalApprovers as D, resolveRequiredDiscordChannelPermissions as E, isDiscordExecApprovalApprover as O, discordInboundEventDelivery as S, collectDiscordAuditChannelIdsForAccount as T, resolveDiscordConversationIdentity as _, resolveDiscordComponentSpec as a, discordMessageActions as b, formatDiscordApprovalDisplayValue as c, setDiscordPolicyBindings as d, buildDiscordConversationRouteContext as f, shouldIgnoreStaleDiscordRouteBinding as g, resolveDiscordEffectiveRoute as h, isDiscordComponentSpecWithinMessageLimit as i, isDiscordExecApprovalClientEnabled as k, resolveDiscordGroupRequireMention as l, resolveDiscordConversationRoute as m, DISCORD_PRESENTATION_CAPABILITIES as n, sendDiscordComponentMessageLazy as o, buildDiscordRoutePeer as p, buildDiscordPresentationPayload as r, DISCORD_APPROVAL_ALLOWED_MENTIONS as s, resolveDiscordOutboundSessionRoute as t, resolveDiscordGroupToolPolicy as u, resolveDiscordCurrentConversationIdentity as v, auditDiscordChannelPermissionsWithFetcher as w, isTrustedRequesterGuildAdminAction as x, resolveDiscordRuntimeBindingConversationId as y };
|
|
@@ -33,10 +33,7 @@ async function resolveDiscordPreflightAudioMentionContext(params) {
|
|
|
33
33
|
const needsPreflightTranscription = hasAudioAttachment && !hasTypedText && (params.isDirectMessage || params.shouldRequireMention && params.mentionRegexes.length > 0);
|
|
34
34
|
let transcript;
|
|
35
35
|
if (needsPreflightTranscription) {
|
|
36
|
-
if (params.abortSignal?.aborted) return {
|
|
37
|
-
hasAudioAttachment,
|
|
38
|
-
hasTypedText
|
|
39
|
-
};
|
|
36
|
+
if (params.abortSignal?.aborted) return { hasTypedText };
|
|
40
37
|
const media = audioAttachments.flatMap((attachment) => {
|
|
41
38
|
const url = normalizeOptionalString(attachment.url);
|
|
42
39
|
return url ? [{
|
|
@@ -54,7 +51,6 @@ async function resolveDiscordPreflightAudioMentionContext(params) {
|
|
|
54
51
|
});
|
|
55
52
|
}
|
|
56
53
|
return {
|
|
57
|
-
hasAudioAttachment,
|
|
58
54
|
hasTypedText,
|
|
59
55
|
transcript
|
|
60
56
|
};
|
|
@@ -27,9 +27,4 @@ function clearPresences(accountId) {
|
|
|
27
27
|
}
|
|
28
28
|
presenceCache.clear();
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
let total = 0;
|
|
32
|
-
for (const accountCache of presenceCache.values()) total += accountCache.size;
|
|
33
|
-
return total;
|
|
34
|
-
}
|
|
35
|
-
export { setPresence as i, getPresence as n, presenceCacheSize as r, clearPresences as t };
|
|
30
|
+
export { getPresence as n, setPresence as r, clearPresences as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
-
import { h as normalizeDiscordToken } from "./accounts-
|
|
3
|
-
import {
|
|
4
|
-
import { n as DiscordApiError, r as fetchDiscord } from "./api-
|
|
2
|
+
import { h as normalizeDiscordToken } from "./accounts-DtjvhJUj.mjs";
|
|
3
|
+
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
4
|
+
import { n as DiscordApiError, r as fetchDiscord } from "./api-Bp0HI4q3.mjs";
|
|
5
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
6
6
|
import { ApplicationFlags } from "discord-api-types/v10";
|
|
7
7
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
@@ -122,12 +122,8 @@ function parseApplicationIdFromToken(token) {
|
|
|
122
122
|
if (!normalized) return;
|
|
123
123
|
const firstDot = normalized.indexOf(".");
|
|
124
124
|
if (firstDot <= 0) return;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return /^\d+$/.test(decoded) ? decoded : void 0;
|
|
128
|
-
} catch {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
125
|
+
const decoded = Buffer.from(normalized.slice(0, firstDot), "base64").toString("utf-8");
|
|
126
|
+
return /^\d+$/.test(decoded) ? decoded : void 0;
|
|
131
127
|
}
|
|
132
128
|
async function probeDiscordApplicationId(token, timeoutMs, fetcher = fetch) {
|
|
133
129
|
const normalized = normalizeDiscordToken(token, "channels.discord.token");
|