@openclaw/discord 2026.7.2-beta.7 → 2026.8.1-beta.3
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/{account-inspect-SXiCBCgP.js → account-inspect-D5xmUpnj.js} +49 -43
- package/dist/account-inspect-api.js +1 -1
- package/dist/accounts-DNl-oCEw.js +371 -0
- package/dist/action-runtime-api.js +1 -1
- package/dist/{active-turn-thread-route-MlKWp8RD.js → active-turn-thread-route-fmHl1HNd.js} +9 -11
- package/dist/{activities-api-DTKsuDxf.js → activities-api-KCBAmWxD.js} +133 -175
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-DzKrtfah.js → allow-list-BDMimASD.js} +2 -3
- package/dist/{api-DnrK9gML.js → api-DNVbJyEy.js} +7 -2
- package/dist/api.js +18 -18
- package/dist/{approval-handler.runtime-HymvFTYn.js → approval-handler.runtime-B12RCYr8.js} +6 -6
- package/dist/{approval-message-safety-DEyKVsAw.js → approval-message-safety-XGFPbDoI.js} +89 -3
- package/dist/{audit-CjsrabP8.js → audit-Yc7eZDd6.js} +5 -5
- package/dist/{channel-actions-uXFTJX3o.js → channel-actions-Dr2QI8Bf.js} +11 -7
- package/dist/{channel-actions.runtime-CIYU90sl.js → channel-actions.runtime-CODTvo7c.js} +99 -97
- package/dist/{channel-vKa-76xY.js → channel-cXYzGc4L.js} +102 -104
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-CmcwZ_qd.js → channel.setup-CSiwnMgs.js} +16 -54
- package/dist/{outbound-session-route-H-HoyH5U.js → components-ezGKo_Yh.js} +69 -142
- package/dist/{config-schema-WHRQcY19.js → config-schema-DC5kDtQ5.js} +42 -11
- package/dist/conversation-binding-route-D6rCQ5S0.js +43 -0
- package/dist/{directory-config-D_LojtCe.js → directory-config-XyCfoqLg.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-Bw5Ephzv.js → directory-live-Df0NbFJB.js} +7 -4
- package/dist/{doctor-Bc4S1qyd.js → doctor-DYY31GrO.js} +34 -13
- package/dist/{doctor-contract-CCFMIDk9.js → doctor-contract-DsWvKIXF.js} +2 -3
- package/dist/doctor-contract-api.js +147 -2
- package/dist/{handle-action.guild-admin-D6VRRW-C.js → handle-action.guild-admin-6Tvvinsa.js} +4 -7
- package/dist/{inbound-event-delivery-CEPlt2uz.js → inbound-event-delivery-De2qxTrP.js} +4 -25
- package/dist/index.js +5 -4
- package/dist/{message-handler-CeiSulIw.js → message-handler-B61q5MOF.js} +118 -33
- package/dist/{message-handler.preflight-DibgQFf2.js → message-handler.preflight-Bzg_Hawz.js} +75 -61
- package/dist/{message-handler.process-Dnc_oz9y.js → message-handler.process--4_712Ec.js} +236 -296
- package/dist/{message-utils-BgTwT_q7.js → message-utils-BXLLnFl6.js} +34 -35
- package/dist/{model-picker-preference-primitives-D25pnCOu.js → model-picker-preference-primitives-BHT1LkR_.js} +3 -3
- package/dist/{outbound-adapter-DtE-i2OJ.js → outbound-adapter-DxHTOqiN.js} +157 -68
- package/dist/{outbound-components-C7GVyfPh.js → outbound-components-B2PL0ooH.js} +3 -3
- package/dist/owner-access-Bg41VzAf.js +107 -0
- package/dist/{pluralkit-CD4B11JB.js → pluralkit-dUl4v1X3.js} +1 -1
- package/dist/{preflight-audio-BjnQZ5yS.js → preflight-audio-DrnqFA8U.js} +22 -28
- package/dist/{probe-BeWKhjqX.js → probe-BTdtVRwU.js} +37 -13
- package/dist/probe.runtime-Dq5-PRKT.js +2 -0
- package/dist/{provider-DfQJX3z5.js → provider-DlK_ynqt.js} +1131 -2021
- package/dist/{provider-session.runtime-Bo88k0pV.js → provider-session.runtime-CvvphHvs.js} +3 -3
- package/dist/provider.runtime-CzKGRiAF.js +2 -0
- package/dist/realtime-session.runtime-ysbMG8v7.js +1351 -0
- package/dist/{resolve-allowlist-common-DHERApxi.js → resolve-allowlist-common-DIVXbD1P.js} +3 -3
- package/dist/{resolve-channels-BjepAj8b.js → resolve-channels-CGeUoIqb.js} +4 -4
- package/dist/{resolve-users-Bc28htgt.js → resolve-users-BtKxLUZv.js} +3 -3
- package/dist/{chunk-DX4jpFQP.js → retry-DNsVTeTo.js} +308 -131
- package/dist/{runtime-BmW_j_hl.js → runtime-CQovMsH3.js} +12 -15
- package/dist/{runtime-_aRC6V2s.js → runtime-D71_VFLr.js} +49 -58
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +23 -23
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-CzeTYF32.js +6 -0
- package/dist/runtime-api.monitor.js +6 -5
- package/dist/runtime-api.send.js +6 -6
- package/dist/runtime-api.threads.js +5 -6
- package/dist/sdk-runtime-37OU6_Yh.js +369 -0
- package/dist/{secret-config-contract-B1akrlyY.js → secret-config-contract-B3i6WxV5.js} +53 -25
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-CPN0xFYz.js → security-audit.runtime-BVKF9VtY.js} +1 -1
- package/dist/{send-CdkZ6zeW.js → send-rQIffSYu.js} +180 -91
- package/dist/{send.components-5uqwkjgE.js → send.components-ChK1wS7w.js} +32 -46
- package/dist/{send.outbound-D-80Ej-t.js → send.outbound-HIkgji_7.js} +57 -34
- package/dist/{send.reactions-CtlmGd_o.js → send.reactions-gmJ6yFPo.js} +14 -21
- package/dist/{send.receipt-CuwRrpFz.js → send.receipt-Cnhoautb.js} +29 -1
- package/dist/{send.shared-jpvAG_u6.js → send.shared-B3fpaLWJ.js} +112 -181
- package/dist/{sender-identity-mG_zsdox.js → sender-identity-BJtfyise.js} +1 -1
- package/dist/setup-entry.js +0 -5
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-CXF1tup1.js → shared-CaAaoksy.js} +27 -23
- package/dist/subagent-hooks-CNT2ZJTJ.js +49 -0
- package/dist/subagent-hooks-api.js +2 -6
- package/dist/subagent-progress-FPLqBY1s.js +110 -0
- package/dist/{system-events-DdUqf91B.js → system-events-Nuwoq_au.js} +2 -2
- package/dist/{target-resolver-C3s_2m0t.js → target-resolver-DIXShHaZ.js} +3 -3
- package/dist/targets-B2pf49zc.js +3 -0
- package/dist/{thread-bindings-C-M-ly7P.js → thread-bindings-VlymUnbz.js} +29 -28
- package/dist/{thread-bindings.manager-DYvSlrva.js → thread-bindings.manager-CngsgErq.js} +258 -29
- package/dist/{thread-bindings.session-updates-DAIlp7Px.js → thread-bindings.session-updates-CJb-BpPL.js} +1 -1
- package/dist/{thread-bindings.state-Cgi5uRn-.js → thread-bindings.state-D8OMdk4O.js} +3 -16
- package/dist/threading-DU6pgeGm.js +456 -0
- package/dist/transcripts-source-DeIMNbRh.js +265 -0
- package/dist/transcripts-source-api.js +7 -2
- package/dist/{typing--Mzo2kM7.js → typing-oLiS5Z13.js} +1 -1
- package/dist/voice-runtime-CjNFaynA.js +2549 -0
- package/openclaw.plugin.json +215 -25
- package/package.json +15 -11
- package/skills/discord/SKILL.md +22 -115
- package/dist/accounts-DJTf1LtA.js +0 -219
- package/dist/channel-api-CAJ0wMoV.js +0 -21
- package/dist/legacy-state-migrations-api.js +0 -138
- package/dist/manager.runtime-Bjav3pfC.js +0 -3655
- package/dist/preflight-audio.runtime-CoCXMM8r.js +0 -7
- package/dist/probe.runtime-DqFGFMbZ.js +0 -2
- package/dist/provider.runtime-Cy7XZmyh.js +0 -2
- package/dist/runtime-api.monitor-CCRubd3-.js +0 -5
- package/dist/session-binding-contract-api.js +0 -2
- package/dist/subagent-hooks-Dxy7Fmnq.js +0 -120
- package/dist/subagent-progress-DI3sYLLo.js +0 -664
- package/dist/targets-Dv_RN7vT.js +0 -3
- package/dist/thread-bindings.discord-api-BoDNqamb.js +0 -246
- package/dist/transcripts-source-DIKGsTGT.js +0 -123
- package/node_modules/p-map/index.d.ts +0 -155
- package/node_modules/p-map/index.js +0 -285
- package/node_modules/p-map/license +0 -9
- package/node_modules/p-map/package.json +0 -57
- package/node_modules/p-map/readme.md +0 -190
- package/dist/{audit-core-xwjIczO0.js → audit-core-BCX8UeFH.js} +1 -1
- package/dist/{security-audit-jGnJF__m.js → security-audit-BfJhAXZp.js} +1 -1
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import { t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-H-HoyH5U.js";
|
|
1
|
+
import { d as normalizeDiscordMessagingTarget, u as looksLikeDiscordTargetId } from "./retry-DNsVTeTo.js";
|
|
2
|
+
import { F as projectCredentialSnapshotFields, I as resolveConfiguredFromCredentialStatuses, M as PAIRING_APPROVED_MESSAGE, N as buildTokenChannelStatusSummary, O as resolveDiscordOutboundSessionRoute, c as resolveDiscordAccount, i as listDiscordStartupAccountIds, j as DEFAULT_ACCOUNT_ID, k as parseDiscordTarget, l as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-DNl-oCEw.js";
|
|
4
3
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
5
|
-
import { a as projectCredentialSnapshotFields, n as PAIRING_APPROVED_MESSAGE, o as resolveConfiguredFromCredentialStatuses, r as buildTokenChannelStatusSummary, t as DEFAULT_ACCOUNT_ID } from "./channel-api-CAJ0wMoV.js";
|
|
6
4
|
import { u as withAbortTimeout } from "./timeouts-B9cy6RvQ.js";
|
|
7
|
-
import {
|
|
8
|
-
import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-
|
|
9
|
-
import { t as discordMessageActions
|
|
5
|
+
import { _ as createChannelApproverDmTargetResolver, b as matchesApprovalRequestFilters, d as resolveDiscordRuntimeBindingConversationId, f as getDiscordExecApprovalApprovers, g as createApproverRestrictedNativeApprovalCapability, h as shouldSuppressLocalDiscordExecApprovalPrompt, m as isDiscordExecApprovalClientEnabled, o as resolveDiscordConversationRoute, p as isDiscordExecApprovalApprover, u as resolveDiscordCurrentConversationIdentity, v as createChannelNativeOriginTargetResolver, y as isChannelExecApprovalClientEnabledFromConfig } from "./approval-message-safety-XGFPbDoI.js";
|
|
6
|
+
import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-BCX8UeFH.js";
|
|
7
|
+
import { t as discordMessageActions } from "./channel-actions-Dr2QI8Bf.js";
|
|
10
8
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.js";
|
|
11
|
-
import {
|
|
12
|
-
import { n as
|
|
13
|
-
import {
|
|
9
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-D6rCQ5S0.js";
|
|
10
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CJb-BpPL.js";
|
|
11
|
+
import { n as discordOutbound } from "./outbound-adapter-DxHTOqiN.js";
|
|
12
|
+
import { a as discordSecurityAdapter, i as discordSetupContract, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-CaAaoksy.js";
|
|
14
13
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
15
14
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.js";
|
|
16
|
-
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
17
15
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
18
|
-
import {
|
|
16
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
19
17
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
18
|
+
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
20
19
|
import { createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
|
|
21
20
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
22
21
|
import { buildLegacyDmAccountAllowlistAdapter, createAccountScopedAllowlistNameResolver, createNestedAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
23
22
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
24
23
|
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
25
|
-
import { appendMatchMetadata,
|
|
24
|
+
import { appendMatchMetadata, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord as isRecord$1, readAccountStatusSnapshot, resolveEnabledConfiguredAccountId } from "openclaw/plugin-sdk/status-helpers";
|
|
26
25
|
import { resolveTargetsWithOptionalToken } from "openclaw/plugin-sdk/target-resolver-runtime";
|
|
27
26
|
import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
28
|
-
import {
|
|
27
|
+
import { doesApprovalRequestSelectChannelAccount, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
28
|
+
import { resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
|
|
29
29
|
import { resolveScopeRequireMention, resolveScopeToolsPolicy, scopeKey } from "openclaw/plugin-sdk/channel-policy";
|
|
30
30
|
import { normalizeAtHashSlug } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
31
31
|
//#region extensions/discord/src/approval-shared.ts
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}).config.execApprovals;
|
|
37
|
-
const approvers = getDiscordExecApprovalApprovers({
|
|
38
|
-
cfg: params.cfg,
|
|
39
|
-
accountId: params.accountId,
|
|
40
|
-
configOverride: params.configOverride
|
|
41
|
-
});
|
|
42
|
-
if (!doesApprovalRequestMatchChannelAccount({
|
|
43
|
-
cfg: params.cfg,
|
|
44
|
-
request: params.request,
|
|
45
|
-
channel: "discord",
|
|
46
|
-
accountId: params.accountId
|
|
47
|
-
})) return false;
|
|
48
|
-
if (!isChannelExecApprovalClientEnabledFromConfig({
|
|
32
|
+
function isDiscordApprovalAccountEligible(params) {
|
|
33
|
+
const account = resolveDiscordAccount(params);
|
|
34
|
+
const config = params.configOverride ?? account.config.execApprovals;
|
|
35
|
+
return account.enabled && isChannelExecApprovalClientEnabledFromConfig({
|
|
49
36
|
enabled: config?.enabled,
|
|
50
|
-
approverCount:
|
|
51
|
-
})
|
|
52
|
-
return matchesApprovalRequestFilters({
|
|
37
|
+
approverCount: getDiscordExecApprovalApprovers(params).length
|
|
38
|
+
}) && matchesApprovalRequestFilters({
|
|
53
39
|
request: params.request.request,
|
|
54
40
|
agentFilter: config?.agentFilter,
|
|
55
41
|
sessionFilter: config?.sessionFilter
|
|
56
42
|
});
|
|
57
43
|
}
|
|
44
|
+
function shouldHandleDiscordApprovalRequest(params) {
|
|
45
|
+
const accountId = params.accountId ?? resolveDefaultDiscordAccountId(params.cfg);
|
|
46
|
+
if (!doesApprovalRequestSelectChannelAccount({
|
|
47
|
+
...params,
|
|
48
|
+
channel: "discord",
|
|
49
|
+
defaultAccountId: resolveDefaultDiscordAccountId(params.cfg),
|
|
50
|
+
eligibleAccountIds: isDiscordApprovalAccountEligible({
|
|
51
|
+
...params,
|
|
52
|
+
accountId
|
|
53
|
+
}) ? [accountId] : []
|
|
54
|
+
})) return false;
|
|
55
|
+
return isDiscordApprovalAccountEligible(params);
|
|
56
|
+
}
|
|
58
57
|
//#endregion
|
|
59
58
|
//#region extensions/discord/src/approval-native.ts
|
|
60
59
|
function extractDiscordSessionKind(sessionKey) {
|
|
@@ -195,7 +194,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
195
194
|
request,
|
|
196
195
|
configOverride
|
|
197
196
|
}),
|
|
198
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
197
|
+
load: async () => (await import("./approval-handler.runtime-B12RCYr8.js")).discordApprovalNativeRuntime
|
|
199
198
|
})
|
|
200
199
|
});
|
|
201
200
|
}
|
|
@@ -302,22 +301,70 @@ function resolveDiscordInboundConversation(params) {
|
|
|
302
301
|
}
|
|
303
302
|
//#endregion
|
|
304
303
|
//#region extensions/discord/src/channel.loaders.ts
|
|
305
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
306
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
307
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
308
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
309
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
310
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
311
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-
|
|
304
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-XyCfoqLg.js").then((n) => n.t));
|
|
305
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-CGeUoIqb.js").then((n) => n.n));
|
|
306
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-BtKxLUZv.js").then((n) => n.n));
|
|
307
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-CngsgErq.js").then((n) => n.i));
|
|
308
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-DIXShHaZ.js").then((n) => n.r));
|
|
309
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-CzKGRiAF.js"));
|
|
310
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-Dq5-PRKT.js"));
|
|
312
311
|
async function probeDiscordStatusAccount(params) {
|
|
313
312
|
const startedAtMs = Date.now();
|
|
314
313
|
const runtime = await loadDiscordProbeRuntime();
|
|
315
314
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
316
315
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
317
316
|
}
|
|
318
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
319
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
320
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
317
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-Yc7eZDd6.js").then((n) => n.n));
|
|
318
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-rQIffSYu.js").then((n) => n.t));
|
|
319
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-Df0NbFJB.js").then((n) => n.t));
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region extensions/discord/src/conversation-route-owner.ts
|
|
322
|
+
function inspectDiscordConversationRouteOwner(params) {
|
|
323
|
+
const direct = params.conversation.kind === "direct";
|
|
324
|
+
const nativeConversationId = params.conversation.nativeChannelId ?? params.conversation.peerId;
|
|
325
|
+
const threadConversationId = direct ? void 0 : params.conversation.threadId;
|
|
326
|
+
const runtimeConversationId = threadConversationId ?? resolveDiscordRuntimeBindingConversationId({
|
|
327
|
+
isDirectMessage: direct,
|
|
328
|
+
isGroupDm: params.conversation.kind === "group",
|
|
329
|
+
userId: direct ? params.conversation.peerId : void 0,
|
|
330
|
+
channelId: nativeConversationId
|
|
331
|
+
});
|
|
332
|
+
const route = resolveDiscordConversationRoute({
|
|
333
|
+
cfg: params.cfg,
|
|
334
|
+
accountId: params.accountId,
|
|
335
|
+
guildId: params.conversation.context?.guildId,
|
|
336
|
+
memberRoleIds: params.conversation.context?.memberRoleIds,
|
|
337
|
+
peer: {
|
|
338
|
+
kind: params.conversation.kind,
|
|
339
|
+
id: params.conversation.peerId
|
|
340
|
+
},
|
|
341
|
+
parentConversationId: params.conversation.context?.parentPeerId
|
|
342
|
+
});
|
|
343
|
+
const { runtimeRoute, configuredRoute } = resolveDiscordConversationBindingRoute({
|
|
344
|
+
cfg: params.cfg,
|
|
345
|
+
route,
|
|
346
|
+
accountId: params.accountId,
|
|
347
|
+
runtimeConversationId,
|
|
348
|
+
configuredConversationId: threadConversationId ?? nativeConversationId,
|
|
349
|
+
parentConversationId: params.conversation.context?.parentPeerId,
|
|
350
|
+
touchBinding: false
|
|
351
|
+
});
|
|
352
|
+
if (!runtimeRoute.bindingOwnerAvailable && resolveThreadBindingSpawnPolicy({
|
|
353
|
+
cfg: params.cfg,
|
|
354
|
+
channel: "discord",
|
|
355
|
+
accountId: params.accountId,
|
|
356
|
+
kind: "subagent"
|
|
357
|
+
}).enabled) return { kind: "unavailable" };
|
|
358
|
+
if (runtimeRoute.pluginId) return {
|
|
359
|
+
kind: "plugin",
|
|
360
|
+
pluginId: runtimeRoute.pluginId,
|
|
361
|
+
fallbackAgentId: route.agentId
|
|
362
|
+
};
|
|
363
|
+
return {
|
|
364
|
+
kind: "agent",
|
|
365
|
+
agentId: runtimeRoute.boundAgentId ?? configuredRoute?.boundAgentId ?? route.agentId
|
|
366
|
+
};
|
|
367
|
+
}
|
|
321
368
|
//#endregion
|
|
322
369
|
//#region extensions/discord/src/group-policy.ts
|
|
323
370
|
function normalizeDiscordSlug(value) {
|
|
@@ -406,13 +453,13 @@ function readDiscordPermissionsAuditSummary(value) {
|
|
|
406
453
|
unresolvedChannels,
|
|
407
454
|
channels: Array.isArray(channelsRaw) ? channelsRaw.map((entry) => {
|
|
408
455
|
if (!isRecord$1(entry)) return null;
|
|
409
|
-
const channelId =
|
|
456
|
+
const channelId = normalizeOptionalString(entry.channelId);
|
|
410
457
|
if (!channelId) return null;
|
|
411
458
|
const ok = typeof entry.ok === "boolean" ? entry.ok : void 0;
|
|
412
|
-
const missing = Array.isArray(entry.missing) ? entry.missing.map((v) =>
|
|
413
|
-
const error =
|
|
414
|
-
const matchKey =
|
|
415
|
-
const matchSource =
|
|
459
|
+
const missing = Array.isArray(entry.missing) ? entry.missing.map((v) => normalizeOptionalString(v)).filter(Boolean) : void 0;
|
|
460
|
+
const error = normalizeOptionalString(entry.error) ?? null;
|
|
461
|
+
const matchKey = normalizeOptionalString(entry.matchKey);
|
|
462
|
+
const matchSource = normalizeOptionalString(entry.matchSource);
|
|
416
463
|
return {
|
|
417
464
|
channelId,
|
|
418
465
|
ok,
|
|
@@ -427,32 +474,10 @@ function readDiscordPermissionsAuditSummary(value) {
|
|
|
427
474
|
function collectDiscordStatusIssues(accounts) {
|
|
428
475
|
const issues = [];
|
|
429
476
|
for (const entry of accounts) {
|
|
430
|
-
const account = readAccountStatusSnapshot(entry, [
|
|
431
|
-
"healthState",
|
|
432
|
-
"application",
|
|
433
|
-
"audit"
|
|
434
|
-
]);
|
|
477
|
+
const account = readAccountStatusSnapshot(entry, ["application", "audit"]);
|
|
435
478
|
if (!account) continue;
|
|
436
479
|
const accountId = resolveEnabledConfiguredAccountId(account);
|
|
437
480
|
if (!accountId) continue;
|
|
438
|
-
const running = account.running === true;
|
|
439
|
-
const healthState = asString(account.healthState);
|
|
440
|
-
if (healthState === "stale-socket" || healthState === "stuck" || healthState === "disconnected" || healthState === "not-running") {
|
|
441
|
-
const runningLabel = running ? "running" : "not running";
|
|
442
|
-
issues.push({
|
|
443
|
-
channel: "discord",
|
|
444
|
-
accountId,
|
|
445
|
-
kind: "runtime",
|
|
446
|
-
message: `Discord gateway transport is degraded (${healthState}; account is ${runningLabel}).`,
|
|
447
|
-
fix: "Check gateway event-loop health and Discord connectivity, then restart the Discord channel or gateway if the transport does not recover."
|
|
448
|
-
});
|
|
449
|
-
} else if (running && account.connected === false) issues.push({
|
|
450
|
-
channel: "discord",
|
|
451
|
-
accountId,
|
|
452
|
-
kind: "runtime",
|
|
453
|
-
message: "Discord gateway transport is running but disconnected.",
|
|
454
|
-
fix: "Check gateway logs for Discord websocket errors and wait for reconnect; restart the Discord channel or gateway if it does not recover."
|
|
455
|
-
});
|
|
456
481
|
if (readDiscordApplicationSummary(account.application).intents?.messageContent === "disabled") issues.push({
|
|
457
482
|
channel: "discord",
|
|
458
483
|
accountId,
|
|
@@ -536,34 +561,8 @@ function startDiscordStartupProbe(params) {
|
|
|
536
561
|
function shouldTreatDiscordDeliveredTextAsVisible(params) {
|
|
537
562
|
return params.kind === "block" && typeof params.text === "string" && params.text.trim().length > 0;
|
|
538
563
|
}
|
|
539
|
-
function resolveRuntimeDiscordMessageActions() {
|
|
540
|
-
try {
|
|
541
|
-
return getDiscordRuntime().channel?.discord?.messageActions ?? null;
|
|
542
|
-
} catch {
|
|
543
|
-
return null;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
const discordMessageActions = {
|
|
547
|
-
resolveExecutionMode: (ctx) => resolveRuntimeDiscordMessageActions()?.resolveExecutionMode?.(ctx) ?? discordMessageActions$1.resolveExecutionMode?.(ctx) ?? "local",
|
|
548
|
-
describeMessageTool: (ctx) => resolveRuntimeDiscordMessageActions()?.describeMessageTool?.(ctx) ?? discordMessageActions$1.describeMessageTool?.(ctx) ?? null,
|
|
549
|
-
requiresTrustedRequesterSender: (ctx) => resolveRuntimeDiscordMessageActions()?.requiresTrustedRequesterSender?.(ctx) ?? discordMessageActions$1.requiresTrustedRequesterSender?.(ctx) ?? false,
|
|
550
|
-
extractToolSend: (ctx) => resolveRuntimeDiscordMessageActions()?.extractToolSend?.(ctx) ?? discordMessageActions$1.extractToolSend?.(ctx) ?? null,
|
|
551
|
-
prepareSendPayload: (ctx) => resolveRuntimeDiscordMessageActions()?.prepareSendPayload?.(ctx) ?? discordMessageActions$1.prepareSendPayload?.(ctx) ?? null,
|
|
552
|
-
handleAction: async (ctx) => {
|
|
553
|
-
const runtimeHandleAction = resolveRuntimeDiscordMessageActions()?.handleAction;
|
|
554
|
-
if (runtimeHandleAction) return await runtimeHandleAction(ctx);
|
|
555
|
-
if (!discordMessageActions$1.handleAction) throw new Error("Discord message actions not available");
|
|
556
|
-
return await discordMessageActions$1.handleAction(ctx);
|
|
557
|
-
}
|
|
558
|
-
};
|
|
559
|
-
function resolveDiscordStartupAccountIds(cfg) {
|
|
560
|
-
const startupAccountIds = listEnabledDiscordAccounts(cfg).filter((candidate) => resolveConfiguredFromCredentialStatuses(candidate) ?? Boolean(normalizeOptionalString(candidate.token))).map((candidate) => candidate.accountId);
|
|
561
|
-
const defaultAccountId = resolveDefaultDiscordAccountId(cfg);
|
|
562
|
-
if (!startupAccountIds.includes(defaultAccountId)) return startupAccountIds;
|
|
563
|
-
return [defaultAccountId, ...startupAccountIds.filter((candidateId) => candidateId !== defaultAccountId)];
|
|
564
|
-
}
|
|
565
564
|
function resolveDiscordStartupDelayMs(cfg, accountId) {
|
|
566
|
-
const startupIndex =
|
|
565
|
+
const startupIndex = listDiscordStartupAccountIds(cfg).findIndex((candidateId) => candidateId === accountId);
|
|
567
566
|
return startupIndex <= 0 ? 0 : startupIndex * DISCORD_ACCOUNT_STARTUP_STAGGER_MS;
|
|
568
567
|
}
|
|
569
568
|
function formatDiscordIntents(intents) {
|
|
@@ -600,10 +599,7 @@ function toConversationLifecycleBinding(binding) {
|
|
|
600
599
|
}
|
|
601
600
|
const discordPlugin = createChatChannelPlugin({
|
|
602
601
|
base: {
|
|
603
|
-
...createDiscordPluginBase({
|
|
604
|
-
setup: discordSetupAdapter,
|
|
605
|
-
setupContract: discordSetupContract
|
|
606
|
-
}),
|
|
602
|
+
...createDiscordPluginBase({ setupContract: discordSetupContract }),
|
|
607
603
|
allowlist: {
|
|
608
604
|
...buildLegacyDmAccountAllowlistAdapter({
|
|
609
605
|
channelId: "discord",
|
|
@@ -633,6 +629,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
633
629
|
"- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages."
|
|
634
630
|
] },
|
|
635
631
|
messaging: {
|
|
632
|
+
resolveConversationRouteOwner: inspectDiscordConversationRouteOwner,
|
|
636
633
|
targetPrefixes: ["discord"],
|
|
637
634
|
directTargetStyle: "user-prefixed",
|
|
638
635
|
targetIdComparison: "lowercase",
|
|
@@ -749,6 +746,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
749
746
|
},
|
|
750
747
|
conversationBindings: {
|
|
751
748
|
supportsCurrentConversationBinding: true,
|
|
749
|
+
bindingStore: "adapter",
|
|
752
750
|
defaultTopLevelPlacement,
|
|
753
751
|
createManager: async ({ cfg, accountId }) => (await loadDiscordThreadBindingsManagerModule()).createThreadBindingManager({
|
|
754
752
|
cfg,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-DC5kDtQ5.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-cXYzGc4L.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
5
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-DNl-oCEw.js";
|
|
2
|
+
import { n as inspectDiscordAccountTokenState } from "./account-inspect-D5xmUpnj.js";
|
|
3
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-CaAaoksy.js";
|
|
4
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-CGeUoIqb.js";
|
|
5
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BtKxLUZv.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -25,54 +25,17 @@ function inspectDiscordSetupAccount(params) {
|
|
|
25
25
|
const enabled = params.cfg.channels?.discord?.enabled !== false && config.enabled !== false;
|
|
26
26
|
const accountConfig = resolveDiscordAccountConfig(params.cfg, accountId);
|
|
27
27
|
const hasAccountToken = Boolean(accountConfig && Object.hasOwn(accountConfig, "token"));
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
accountId,
|
|
40
|
-
enabled,
|
|
41
|
-
token: "",
|
|
42
|
-
tokenSource: "none",
|
|
43
|
-
tokenStatus: "missing",
|
|
44
|
-
configured: false,
|
|
45
|
-
config
|
|
46
|
-
};
|
|
47
|
-
const channelToken = inspectDiscordConfiguredToken(params.cfg.channels?.discord?.token);
|
|
48
|
-
if (channelToken) return {
|
|
49
|
-
accountId,
|
|
50
|
-
enabled,
|
|
51
|
-
token: channelToken.token,
|
|
52
|
-
tokenSource: channelToken.tokenSource,
|
|
53
|
-
tokenStatus: channelToken.tokenStatus,
|
|
54
|
-
configured: true,
|
|
55
|
-
config
|
|
56
|
-
};
|
|
57
|
-
const tokenResolution = resolveDiscordToken(params.cfg, { accountId });
|
|
58
|
-
if (tokenResolution.token) return {
|
|
59
|
-
accountId,
|
|
60
|
-
enabled,
|
|
61
|
-
token: tokenResolution.token,
|
|
62
|
-
tokenSource: tokenResolution.source,
|
|
63
|
-
tokenStatus: "available",
|
|
64
|
-
configured: true,
|
|
65
|
-
config
|
|
66
|
-
};
|
|
67
|
-
return {
|
|
68
|
-
accountId,
|
|
69
|
-
enabled,
|
|
70
|
-
token: "",
|
|
71
|
-
tokenSource: "none",
|
|
72
|
-
tokenStatus: "missing",
|
|
73
|
-
configured: false,
|
|
74
|
-
config
|
|
75
|
-
};
|
|
28
|
+
return inspectDiscordAccountTokenState({
|
|
29
|
+
base: {
|
|
30
|
+
accountId,
|
|
31
|
+
enabled
|
|
32
|
+
},
|
|
33
|
+
config,
|
|
34
|
+
accountToken: accountConfig?.token,
|
|
35
|
+
hasAccountToken,
|
|
36
|
+
channelToken: params.cfg.channels?.discord?.token,
|
|
37
|
+
resolveFallbackToken: () => resolveDiscordToken(params.cfg, { accountId })
|
|
38
|
+
});
|
|
76
39
|
}
|
|
77
40
|
//#endregion
|
|
78
41
|
//#region extensions/discord/src/setup-core.ts
|
|
@@ -332,7 +295,6 @@ const discordSetupPlugin = { ...createDiscordPluginBase({
|
|
|
332
295
|
entries
|
|
333
296
|
})
|
|
334
297
|
}),
|
|
335
|
-
setup: discordSetupAdapter,
|
|
336
298
|
setupContract: discordSetupContract
|
|
337
299
|
}) };
|
|
338
300
|
//#endregion
|