@openclaw/discord 2026.10.5-beta.4 → 2026.10.10-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/{approval-handler.runtime-D7FoZSn0.mjs → approval-handler.runtime-BvF8oUpa.mjs} +9 -9
- package/dist/.setup/{approval-message-updates-CIGByUcE.mjs → approval-message-updates-wbUqLtLI.mjs} +2 -2
- package/dist/.setup/{audit-zSawfbsN.mjs → audit-UwzCdDJk.mjs} +3 -3
- package/dist/.setup/{channel-DI7DMzu0.mjs → channel-BlvyeRAu.mjs} +72 -49
- package/dist/.setup/{channel.setup-DdFVN1mr.mjs → channel.setup-By7wNopw.mjs} +1 -1
- package/dist/.setup/{components-HN9052L1.mjs → components-C_cuoW1q.mjs} +1 -1
- package/dist/.setup/conversation-binding-route-fdYsXexV.mjs +68 -0
- package/dist/.setup/{discord-BGqgx-yd.mjs → discord-Cl2OPTZ6.mjs} +18 -14
- package/dist/.setup/{doctor-DSrNJ7m2.mjs → doctor-94GSI6lY.mjs} +2 -2
- package/dist/.setup/{handle-action-CXH1h1tq.mjs → handle-action-0-FZD3Am.mjs} +7 -7
- package/dist/.setup/{handle-action.guild-admin-CHKW6PIs.mjs → handle-action.guild-admin-DfAWANBE.mjs} +2 -2
- package/dist/.setup/{message-handler-Ii_etru1.mjs → message-handler-CtR2w7W_.mjs} +4 -4
- package/dist/.setup/{message-handler.preflight-C7YuSRl_.mjs → message-handler.preflight-BqUw7LWb.mjs} +11 -10
- package/dist/.setup/{message-handler.preflight-pluralkit-C3iAG--b.mjs → message-handler.preflight-pluralkit-BU9I_X-b.mjs} +4 -6
- package/dist/.setup/{message-handler.process-ClgWYH6o.mjs → message-handler.process-BZeWmSNC.mjs} +40 -50
- package/dist/.setup/{outbound-adapter-D8OOIuKn.mjs → outbound-adapter-DBwgKemw.mjs} +5 -5
- package/dist/.setup/{outbound-session-route-B0Hpwn3Q.mjs → outbound-session-route-CsHHPxsQ.mjs} +23 -6
- package/dist/.setup/{provider-D9EzOfG8.mjs → provider-DUTsZJHz.mjs} +229 -204
- package/dist/.setup/{provider-session.runtime-CsnRvddI.mjs → provider-session.runtime-Ucr3XodI.mjs} +3 -3
- package/dist/.setup/provider.runtime-J8NuMCNs.mjs +1 -0
- package/dist/.setup/{realtime-session.runtime-CxGBk8H-.mjs → realtime-session.runtime-bNnPOKP_.mjs} +161 -150
- package/dist/.setup/{receive-recovery-eVmK2_hl.mjs → receive-recovery-CKvaG2Hf.mjs} +4 -25
- package/dist/.setup/{runtime-DPm3gZXk.mjs → runtime-Cg5pIBm_.mjs} +1 -1
- package/dist/.setup/{runtime-CRTkKU1G.mjs → runtime-DE6W14G3.mjs} +7 -7
- package/dist/.setup/{send-DbILKgcm.mjs → send-yR1hfybW.mjs} +26 -12
- package/dist/.setup/{send.components-FxOS3CeP.mjs → send.components--dxMjc2O.mjs} +5 -5
- package/dist/.setup/{send.outbound-_jx4Xpd3.mjs → send.outbound-B5vQwgUK.mjs} +10 -4
- package/dist/.setup/{send.receipt-BAlzXd8e.mjs → send.receipt-eE3zLTDH.mjs} +3 -9
- package/dist/.setup/{send.shared-CjQ4jbMA.mjs → send.shared-iGf1rqAm.mjs} +4 -3
- package/dist/.setup/setup-plugin-api-DVpA_yqS.mjs +2 -0
- package/dist/.setup/{shared-CestGDpq.mjs → shared-DgzLizSt.mjs} +1 -1
- package/dist/.setup/{subagent-hooks-CME7dSGf.mjs → subagent-hooks-tBtaqWkD.mjs} +21 -12
- package/dist/.setup/{system-events-BwwSDCw4.mjs → system-events-DGsxf-l9.mjs} +1 -1
- package/dist/.setup/{target-resolver-Bse8fuTi.mjs → target-resolver-BFOKmBni.mjs} +1 -1
- package/dist/.setup/{targets-DZJjkzwv.mjs → targets-UbCpek5o.mjs} +1 -1
- package/dist/.setup/{thread-bindings-0hPTSK14.mjs → thread-bindings-Dsc3zsrI.mjs} +29 -7
- package/dist/.setup/{thread-bindings.manager-CdNa6UIs.mjs → thread-bindings.manager-BMpmKLQh.mjs} +63 -19
- package/dist/.setup/{thread-bindings.session-updates-DGSljVf6.mjs → thread-bindings.session-updates-BMdJeJMc.mjs} +39 -122
- package/dist/.setup/{threading-BKe3E3tp.mjs → threading-Cg_QRc8s.mjs} +2 -2
- package/dist/.setup/{transcripts-source-0qQYVu2H.mjs → transcripts-source-fRvFsZng.mjs} +11 -16
- package/dist/.setup/{voice-runtime-QlZJ4sHv.mjs → voice-runtime-DHDNu0fz.mjs} +73 -120
- package/dist/action-runtime-api.js +1 -2
- package/dist/activities-api.js +3 -3
- package/dist/api.js +11 -11
- package/dist/channel-config-api.js +1 -2
- package/dist/channel-plugin-api.js +1 -2
- package/dist/contract-api.js +1 -2
- package/dist/runtime-api.js +15 -15
- package/dist/runtime-setter-api.js +1 -2
- package/dist/secret-contract-api.js +1 -2
- package/dist/security-audit-contract-api.js +1 -2
- package/dist/security-contract-api.js +1 -2
- package/dist/session-key-api.js +1 -2
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -2
- package/dist/src/voice/audio-worker.runtime.js +8 -11
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/thread-binding-api.js +1 -2
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/mdast-util-from-markdown/dev/lib/index.js +152 -45
- package/node_modules/mdast-util-from-markdown/dev/lib/types.d.ts +26 -0
- package/node_modules/mdast-util-from-markdown/lib/index.js +133 -40
- package/node_modules/mdast-util-from-markdown/lib/types.d.ts +26 -0
- package/node_modules/mdast-util-from-markdown/package.json +6 -7
- package/node_modules/mdast-util-from-markdown/readme.md +15 -1
- package/node_modules/typebox/build/value/clean/from_object.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/package.json +6 -6
- package/dist/.setup/conversation-binding-route-DTjCBx-O.mjs +0 -51
- package/dist/.setup/provider.runtime-BQVcM7Pg.mjs +0 -2
- package/dist/.setup/setup-plugin-api-xfOFmxHP.mjs +0 -3
package/dist/.setup/{approval-handler.runtime-D7FoZSn0.mjs → approval-handler.runtime-BvF8oUpa.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { D as createDiscordMessageNonce, N as createDiscordClient } from "./send.shared-
|
|
2
|
-
import { D as Row,
|
|
3
|
-
import { y as findGraphemeChunkEnd } from "./send.receipt-
|
|
4
|
-
import { s as buildExecApprovalCustomId } from "./components-
|
|
5
|
-
import {
|
|
6
|
-
import { a as shouldHandleDiscordApprovalRequest } from "./channel-
|
|
7
|
-
import { t as discordApprovalMessageUpdates } from "./approval-message-updates-
|
|
1
|
+
import { D as createDiscordMessageNonce, N as createDiscordClient } from "./send.shared-iGf1rqAm.mjs";
|
|
2
|
+
import { D as Row, ct as createChannelMessage, dt as editChannelMessage, j as TextDisplay, k as Separator, q as serializePayload, rt as createUserDmChannel, ut as deleteChannelMessage, x as Container, xt as stripUndefinedFields, y as Button } from "./discord-Cl2OPTZ6.mjs";
|
|
3
|
+
import { y as findGraphemeChunkEnd } from "./send.receipt-eE3zLTDH.mjs";
|
|
4
|
+
import { s as buildExecApprovalCustomId } from "./components-C_cuoW1q.mjs";
|
|
5
|
+
import { A as isDiscordExecApprovalClientEnabled, c as formatDiscordApprovalDisplayValue, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-CsHHPxsQ.mjs";
|
|
6
|
+
import { a as shouldHandleDiscordApprovalRequest } from "./channel-BlvyeRAu.mjs";
|
|
7
|
+
import { t as discordApprovalMessageUpdates } from "./approval-message-updates-wbUqLtLI.mjs";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { ButtonStyle } from "discord-api-types/v10";
|
|
10
10
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
11
|
-
import {
|
|
11
|
+
import { createChannelApprovalNativeRuntimeAdapterAsync } from "openclaw/plugin-sdk/approval-handler-runtime";
|
|
12
12
|
import { formatChannelApprovalResolvedLabel } from "openclaw/plugin-sdk/approval-runtime";
|
|
13
13
|
//#region extensions/discord/src/approval-handler.runtime.ts
|
|
14
14
|
function resolveHandlerContext(params) {
|
|
@@ -97,7 +97,7 @@ function buildTerminalApprovalResult(params) {
|
|
|
97
97
|
payload: createApprovalContainer(params.view)
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
const discordApprovalNativeRuntime =
|
|
100
|
+
const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapterAsync({
|
|
101
101
|
eventKinds: [
|
|
102
102
|
"exec",
|
|
103
103
|
"plugin",
|
package/dist/.setup/{approval-message-updates-CIGByUcE.mjs → approval-message-updates-wbUqLtLI.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as parseExecApprovalData } from "./components-
|
|
1
|
+
import { tt as parseCustomId } from "./discord-Cl2OPTZ6.mjs";
|
|
2
|
+
import { c as parseExecApprovalData } from "./components-C_cuoW1q.mjs";
|
|
3
3
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
4
4
|
//#region extensions/discord/src/approval-message-updates.ts
|
|
5
5
|
const discordApprovalMessageUpdates = new KeyedAsyncQueue();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-8cCu6uPG.mjs";
|
|
3
|
-
import { b as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
4
|
-
import "./send-
|
|
5
|
-
import {
|
|
3
|
+
import { b as fetchChannelPermissionsDiscord } from "./send.shared-iGf1rqAm.mjs";
|
|
4
|
+
import "./send-yR1hfybW.mjs";
|
|
5
|
+
import { E as collectDiscordAuditChannelIdsForAccount, T as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-CsHHPxsQ.mjs";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-ljrzXBJi.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { d as normalizeDiscordMessagingTarget, l as looksLikeDiscordTargetId, u as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
2
|
+
import { G as withDiscordRequestAuthority } from "./discord-Cl2OPTZ6.mjs";
|
|
3
|
+
import { d as normalizeDiscordMessagingTarget, l as looksLikeDiscordTargetId, u as matchesDiscordToolContextTarget } from "./send.receipt-eE3zLTDH.mjs";
|
|
4
4
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
5
5
|
import { l as withAbortTimeout } from "./timeouts-CuNARfyw.mjs";
|
|
6
6
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { a as normalizeDiscordAcpConversationId, c as resolveDiscordInboundConversation, i as matchDiscordAcpConversation, n as discordOutbound, o as resolveDiscordAttachedOutboundTarget, r as buildDiscordCrossContextPresentation, s as resolveDiscordCommandConversation } from "./outbound-adapter-
|
|
7
|
+
import { A as isDiscordExecApprovalClientEnabled, D as resolveRequiredDiscordChannelPermissions, O as getDiscordExecApprovalApprovers, b as resolveDiscordRuntimeBindingConversationId, h as resolveDiscordConversationRoute, j as shouldSuppressLocalDiscordExecApprovalPrompt, k as isDiscordExecApprovalApprover, l as findDiscordChannelPolicyKey, t as resolveDiscordOutboundSessionRoute, u as getDiscordChannelPolicyBinding, x as discordMessageActions } from "./outbound-session-route-CsHHPxsQ.mjs";
|
|
8
|
+
import { a as normalizeDiscordAcpConversationId, c as resolveDiscordInboundConversation, i as matchDiscordAcpConversation, n as discordOutbound, o as resolveDiscordAttachedOutboundTarget, r as buildDiscordCrossContextPresentation, s as resolveDiscordCommandConversation } from "./outbound-adapter-DBwgKemw.mjs";
|
|
9
9
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.mjs";
|
|
10
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
11
|
-
import { a as discordSecurityAdapter, i as discordSetupContract, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-
|
|
10
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-fdYsXexV.mjs";
|
|
11
|
+
import { a as discordSecurityAdapter, i as discordSetupContract, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-DgzLizSt.mjs";
|
|
12
12
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-CCHGNSQw.mjs";
|
|
13
|
-
import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
13
|
+
import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-BMdJeJMc.mjs";
|
|
14
14
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.mjs";
|
|
15
15
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
16
16
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -29,8 +29,8 @@ import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter } from
|
|
|
29
29
|
import { appendMatchMetadata, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord as isRecord$1, readAccountStatusSnapshot, resolveEnabledConfiguredAccountId } from "openclaw/plugin-sdk/status-helpers";
|
|
30
30
|
import { resolveTargetsWithOptionalToken } from "openclaw/plugin-sdk/target-resolver-runtime";
|
|
31
31
|
import { createApproverRestrictedNativeApprovalCapability } from "openclaw/plugin-sdk/approval-delivery-runtime";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
32
|
+
import { createLazyChannelApprovalNativeRuntimeAdapterAsync } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
33
|
+
import { createChannelApproverDmTargetResolverAsync, createChannelNativeOriginTargetResolverAsync, doesApprovalRequestSelectChannelAccountAsync, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
34
34
|
import { isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
|
|
35
35
|
import { resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
|
|
36
36
|
import { resolveScopeRequireMention, resolveScopeToolsPolicy, scopeKey } from "openclaw/plugin-sdk/channel-policy";
|
|
@@ -47,9 +47,9 @@ function isDiscordApprovalAccountEligible(params) {
|
|
|
47
47
|
sessionFilter: config?.sessionFilter
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function shouldHandleDiscordApprovalRequest(params) {
|
|
50
|
+
async function shouldHandleDiscordApprovalRequest(params) {
|
|
51
51
|
const accountId = params.accountId ?? resolveDefaultDiscordAccountId(params.cfg);
|
|
52
|
-
return
|
|
52
|
+
return await doesApprovalRequestSelectChannelAccountAsync({
|
|
53
53
|
...params,
|
|
54
54
|
channel: "discord",
|
|
55
55
|
defaultAccountId: resolveDefaultDiscordAccountId(params.cfg),
|
|
@@ -61,13 +61,6 @@ function shouldHandleDiscordApprovalRequest(params) {
|
|
|
61
61
|
}
|
|
62
62
|
//#endregion
|
|
63
63
|
//#region extensions/discord/src/approval-native.ts
|
|
64
|
-
function shouldHandleCapabilityRequest({ cfg, accountId, request }) {
|
|
65
|
-
return shouldHandleDiscordApprovalRequest({
|
|
66
|
-
cfg,
|
|
67
|
-
accountId,
|
|
68
|
-
request
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
64
|
function extractDiscordSessionKind(sessionKey) {
|
|
72
65
|
if (!sessionKey) return null;
|
|
73
66
|
const raw = sessionKey.match(/discord:(?:[^:]+:)?(channel|group|dm|direct):/)?.[1];
|
|
@@ -102,9 +95,9 @@ function createDiscordOriginTargetResolver() {
|
|
|
102
95
|
threadId: (sessionTarget ? normalizeDiscordThreadId(sessionTarget.threadId) : void 0) ?? normalizeDiscordThreadId(sessionConversation?.threadId)
|
|
103
96
|
} : null;
|
|
104
97
|
};
|
|
105
|
-
return
|
|
98
|
+
return createChannelNativeOriginTargetResolverAsync({
|
|
106
99
|
channel: "discord",
|
|
107
|
-
shouldHandleRequest:
|
|
100
|
+
shouldHandleRequest: shouldHandleDiscordApprovalRequest,
|
|
108
101
|
resolveTurnSourceTarget: (request) => {
|
|
109
102
|
const sessionConversation = resolveConversation(request);
|
|
110
103
|
const sessionKind = extractDiscordSessionKind(normalizeOptionalString(request.request.sessionKey) ?? null);
|
|
@@ -150,8 +143,8 @@ function createDiscordApprovalCapability() {
|
|
|
150
143
|
accountId
|
|
151
144
|
}).config.execApprovals?.target ?? "dm",
|
|
152
145
|
resolveOriginTarget: createDiscordOriginTargetResolver(),
|
|
153
|
-
resolveApproverDmTargets:
|
|
154
|
-
shouldHandleRequest:
|
|
146
|
+
resolveApproverDmTargets: createChannelApproverDmTargetResolverAsync({
|
|
147
|
+
shouldHandleRequest: shouldHandleDiscordApprovalRequest,
|
|
155
148
|
resolveApprovers: ({ cfg, accountId }) => getDiscordExecApprovalApprovers({
|
|
156
149
|
cfg,
|
|
157
150
|
accountId
|
|
@@ -159,7 +152,7 @@ function createDiscordApprovalCapability() {
|
|
|
159
152
|
mapApprover: (approver) => ({ to: approver })
|
|
160
153
|
}),
|
|
161
154
|
notifyOriginWhenDmOnly: true,
|
|
162
|
-
|
|
155
|
+
nativeRuntimeAsync: createLazyChannelApprovalNativeRuntimeAdapterAsync({
|
|
163
156
|
capabilityBoundary: true,
|
|
164
157
|
eventKinds: [
|
|
165
158
|
"exec",
|
|
@@ -170,8 +163,8 @@ function createDiscordApprovalCapability() {
|
|
|
170
163
|
cfg,
|
|
171
164
|
accountId
|
|
172
165
|
}),
|
|
173
|
-
shouldHandle:
|
|
174
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
166
|
+
shouldHandle: shouldHandleDiscordApprovalRequest,
|
|
167
|
+
load: async () => (await import("./approval-handler.runtime-BvF8oUpa.mjs")).discordApprovalNativeRuntime
|
|
175
168
|
})
|
|
176
169
|
});
|
|
177
170
|
}
|
|
@@ -185,9 +178,9 @@ function getDiscordApprovalCapability() {
|
|
|
185
178
|
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-3iVub-3m.mjs").then((n) => n.t));
|
|
186
179
|
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-UdT38DzU.mjs").then((n) => n.n));
|
|
187
180
|
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DnCsrXZ_.mjs").then((n) => n.n));
|
|
188
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
189
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
190
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
181
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-BMpmKLQh.mjs").then((n) => n.r));
|
|
182
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BFOKmBni.mjs").then((n) => n.r));
|
|
183
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-J8NuMCNs.mjs"));
|
|
191
184
|
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-D3P1x4aN.mjs").then((n) => n.o));
|
|
192
185
|
async function probeDiscordStatusAccount(params) {
|
|
193
186
|
const startedAtMs = Date.now();
|
|
@@ -195,12 +188,12 @@ async function probeDiscordStatusAccount(params) {
|
|
|
195
188
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
196
189
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
197
190
|
}
|
|
198
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
199
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
191
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-UwzCdDJk.mjs").then((n) => n.n));
|
|
192
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-yR1hfybW.mjs").then((n) => n.t));
|
|
200
193
|
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-DLygQVtW.mjs").then((n) => n.t));
|
|
201
194
|
//#endregion
|
|
202
195
|
//#region extensions/discord/src/conversation-route-owner.ts
|
|
203
|
-
function
|
|
196
|
+
function prepareDiscordConversationRouteOwner(params) {
|
|
204
197
|
const accountId = normalizeAccountId(params.accountId);
|
|
205
198
|
if (params.cfg.channels?.discord?.enabled === false || !listDiscordAccountIds(params.cfg).some((id) => normalizeAccountId(id) === accountId) || resolveDiscordAccountConfig(params.cfg, accountId)?.enabled === false) return null;
|
|
206
199
|
const direct = params.conversation.kind === "direct";
|
|
@@ -224,7 +217,7 @@ function inspectDiscordConversationRouteOwner(params) {
|
|
|
224
217
|
},
|
|
225
218
|
parentConversationId: params.conversation.context?.parentPeerId
|
|
226
219
|
});
|
|
227
|
-
const
|
|
220
|
+
const input = {
|
|
228
221
|
cfg: params.cfg,
|
|
229
222
|
resolveRoute: route,
|
|
230
223
|
accountId,
|
|
@@ -232,23 +225,47 @@ function inspectDiscordConversationRouteOwner(params) {
|
|
|
232
225
|
configuredConversationId: threadConversationId ?? nativeConversationId,
|
|
233
226
|
parentConversationId: params.conversation.context?.parentPeerId,
|
|
234
227
|
touchBinding: false
|
|
235
|
-
});
|
|
236
|
-
if (!runtimeRoute.bindingOwnerAvailable && resolveThreadBindingSpawnPolicy({
|
|
237
|
-
cfg: params.cfg,
|
|
238
|
-
channel: "discord",
|
|
239
|
-
accountId,
|
|
240
|
-
kind: "subagent"
|
|
241
|
-
}).enabled) return { kind: "unavailable" };
|
|
242
|
-
if (runtimeRoute.pluginId) return {
|
|
243
|
-
kind: "plugin",
|
|
244
|
-
pluginId: runtimeRoute.pluginId,
|
|
245
|
-
fallbackAgentId: runtimeRoute.route.agentId
|
|
246
228
|
};
|
|
247
229
|
return {
|
|
248
|
-
|
|
249
|
-
|
|
230
|
+
conversation: {
|
|
231
|
+
channel: "discord",
|
|
232
|
+
accountId,
|
|
233
|
+
conversationId: runtimeConversationId,
|
|
234
|
+
parentConversationId: params.conversation.context?.parentPeerId
|
|
235
|
+
},
|
|
236
|
+
resolve(inspection) {
|
|
237
|
+
const { runtimeRoute, configuredRoute } = resolveDiscordConversationBindingRoute({
|
|
238
|
+
...input,
|
|
239
|
+
inspection
|
|
240
|
+
});
|
|
241
|
+
if (!runtimeRoute.bindingOwnerAvailable && resolveThreadBindingSpawnPolicy({
|
|
242
|
+
cfg: params.cfg,
|
|
243
|
+
channel: "discord",
|
|
244
|
+
accountId,
|
|
245
|
+
kind: "subagent"
|
|
246
|
+
}).enabled) return { kind: "unavailable" };
|
|
247
|
+
if (runtimeRoute.pluginId) return {
|
|
248
|
+
kind: "plugin",
|
|
249
|
+
pluginId: runtimeRoute.pluginId,
|
|
250
|
+
fallbackAgentId: runtimeRoute.route.agentId
|
|
251
|
+
};
|
|
252
|
+
return {
|
|
253
|
+
kind: "agent",
|
|
254
|
+
agentId: runtimeRoute.boundAgentId ?? configuredRoute?.boundAgentId ?? runtimeRoute.route.agentId
|
|
255
|
+
};
|
|
256
|
+
}
|
|
250
257
|
};
|
|
251
258
|
}
|
|
259
|
+
async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBindings) {
|
|
260
|
+
const prepared = inputs.map(prepareDiscordConversationRouteOwner);
|
|
261
|
+
const inspect = await inspectBindings(prepared.flatMap((item) => item ? [item.conversation] : []));
|
|
262
|
+
let index = 0;
|
|
263
|
+
return prepared.map((item) => {
|
|
264
|
+
if (!item) return () => null;
|
|
265
|
+
const position = index++;
|
|
266
|
+
return () => item.resolve(inspect()[position]);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
252
269
|
//#endregion
|
|
253
270
|
//#region extensions/discord/src/group-policy.ts
|
|
254
271
|
const guildScopeKey = (guildKey) => scopeKey(["guild", guildKey]);
|
|
@@ -286,7 +303,13 @@ function resolveDiscordPolicyScope(params) {
|
|
|
286
303
|
tree,
|
|
287
304
|
path: []
|
|
288
305
|
};
|
|
289
|
-
const
|
|
306
|
+
const channels = guilds?.[guildKey]?.channels;
|
|
307
|
+
let channelKey = resolveDiscordChannelKey(channels, params);
|
|
308
|
+
if (channelKey !== params.groupId) {
|
|
309
|
+
const boundKey = params.groupId ? findDiscordChannelPolicyKey(params.accountId, guildKey, params.groupId) : void 0;
|
|
310
|
+
if (boundKey !== void 0 && channels?.[boundKey]) channelKey = boundKey;
|
|
311
|
+
else if (channelKey !== void 0 && getDiscordChannelPolicyBinding(params.accountId, guildKey, channelKey) !== void 0) channelKey = void 0;
|
|
312
|
+
}
|
|
290
313
|
return {
|
|
291
314
|
tree,
|
|
292
315
|
path: [guildScopeKey(guildKey), ...channelKey !== void 0 ? [channelScopeKey(guildKey, channelKey)] : []]
|
|
@@ -379,7 +402,7 @@ function collectDiscordStatusIssues(accounts) {
|
|
|
379
402
|
...scope,
|
|
380
403
|
kind: "permissions",
|
|
381
404
|
message: appendMatchMetadata(baseMessage, channel),
|
|
382
|
-
fix: "
|
|
405
|
+
fix: "Check that the bot role can view + send in this channel (and that channel overrides don't deny it)."
|
|
383
406
|
});
|
|
384
407
|
}
|
|
385
408
|
}
|
|
@@ -501,14 +524,14 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
501
524
|
},
|
|
502
525
|
mentions: { stripPatterns: () => ["<@!?\\d+>"] },
|
|
503
526
|
agentPrompt: { messageToolHints: () => [
|
|
504
|
-
"- Discord mentions: use
|
|
527
|
+
"- 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.",
|
|
505
528
|
"- Discord components: set `components` when sending messages to include buttons, selects, or v2 containers.",
|
|
506
529
|
"- Forms: add `components.modal` (title, fields). OpenClaw adds a trigger button and routes submissions as new messages."
|
|
507
530
|
] },
|
|
508
531
|
messaging: {
|
|
509
532
|
directTargetStyle: discordPluginBase.messaging?.directTargetStyle,
|
|
510
533
|
inferTargetChatType: discordPluginBase.messaging?.inferTargetChatType,
|
|
511
|
-
|
|
534
|
+
prepareConversationRouteOwnersAsync: prepareDiscordConversationRouteOwnersAsync,
|
|
512
535
|
targetPrefixes: ["discord"],
|
|
513
536
|
targetIdComparison: "lowercase",
|
|
514
537
|
normalizeTarget: normalizeDiscordMessagingTarget,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as resolveDefaultDiscordAccountId, g as resolveDiscordToken, n as inspectDiscordAccountConfig, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-ljrzXBJi.mjs";
|
|
2
|
-
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
2
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-DgzLizSt.mjs";
|
|
3
3
|
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-UdT38DzU.mjs";
|
|
4
4
|
import { t as resolveDiscordUserAllowlist } from "./resolve-users-DnCsrXZ_.mjs";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { A as StringSelectMenu, C as LinkButton, D as Row, E as RoleSelectMenu, M as Thumbnail, N as UserSelectMenu, O as Section, S as File, T as MentionableSelectMenu, _ as TextInput, b as ChannelSelectMenu,
|
|
2
|
+
import { A as StringSelectMenu, C as LinkButton, D as Row, E as RoleSelectMenu, M as Thumbnail, N as UserSelectMenu, O as Section, S as File, T as MentionableSelectMenu, _ as TextInput, b as ChannelSelectMenu, g as RadioGroup, h as Modal, j as TextDisplay, k as Separator, m as Label, p as CheckboxGroup, tt as parseCustomId, v as AnySelectMenu, w as MediaGallery, x as Container, xt as stripUndefinedFields, y as Button } from "./discord-Cl2OPTZ6.mjs";
|
|
3
3
|
import { asBoolean, asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { ButtonStyle, MessageFlags, TextInputStyle } from "discord-api-types/v10";
|
|
5
5
|
import { resolveAskUserQuestionOptionIndex } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { _ as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-CsHHPxsQ.mjs";
|
|
2
|
+
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
3
|
+
import { inspectRuntimeConversationBindingRoute, resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRouteAsync } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
4
|
+
//#region extensions/discord/src/monitor/conversation-binding-route.ts
|
|
5
|
+
function prepareDiscordBindingRoute(params) {
|
|
6
|
+
let baseRoute;
|
|
7
|
+
return {
|
|
8
|
+
input: {
|
|
9
|
+
resolveRoute: (selection) => {
|
|
10
|
+
baseRoute = params.resolveRoute(selection);
|
|
11
|
+
return baseRoute;
|
|
12
|
+
},
|
|
13
|
+
touchBinding: params.touchBinding,
|
|
14
|
+
conversation: {
|
|
15
|
+
channel: "discord",
|
|
16
|
+
accountId: params.accountId,
|
|
17
|
+
conversationId: params.runtimeConversationId,
|
|
18
|
+
parentConversationId: params.parentConversationId
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
getBaseRoute: () => baseRoute
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function resolveDiscordConversationBindingRoute(params) {
|
|
25
|
+
const prepared = prepareDiscordBindingRoute(params);
|
|
26
|
+
return applyDiscordBindingRoute(params, inspectRuntimeConversationBindingRoute({
|
|
27
|
+
...prepared.input,
|
|
28
|
+
inspection: params.inspection
|
|
29
|
+
}), prepared.getBaseRoute());
|
|
30
|
+
}
|
|
31
|
+
async function resolveDiscordConversationBindingRouteAsync(params) {
|
|
32
|
+
const prepared = prepareDiscordBindingRoute(params);
|
|
33
|
+
return applyDiscordBindingRoute(params, await resolveRuntimeConversationBindingRouteAsync(prepared.input), prepared.getBaseRoute());
|
|
34
|
+
}
|
|
35
|
+
function applyDiscordBindingRoute(params, resolvedRuntimeRoute, baseRoute) {
|
|
36
|
+
let runtimeRoute = resolvedRuntimeRoute;
|
|
37
|
+
const route = baseRoute ?? runtimeRoute.route;
|
|
38
|
+
if (shouldIgnoreStaleDiscordRouteBinding({
|
|
39
|
+
bindingRecord: runtimeRoute.bindingRecord,
|
|
40
|
+
route
|
|
41
|
+
})) {
|
|
42
|
+
logVerbose(`discord: ignoring stale route binding for conversation ${params.runtimeConversationId} (${runtimeRoute.bindingRecord?.targetSessionKey} -> ${route.sessionKey})`);
|
|
43
|
+
runtimeRoute = {
|
|
44
|
+
bindingOwnerAvailable: true,
|
|
45
|
+
bindingRecord: null,
|
|
46
|
+
route: {
|
|
47
|
+
...runtimeRoute.route,
|
|
48
|
+
...route
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const configuredRoute = runtimeRoute.bindingRecord ? null : resolveConfiguredBindingRoute({
|
|
53
|
+
cfg: params.cfg,
|
|
54
|
+
route: runtimeRoute.route,
|
|
55
|
+
conversation: {
|
|
56
|
+
channel: "discord",
|
|
57
|
+
accountId: params.accountId,
|
|
58
|
+
conversationId: params.configuredConversationId,
|
|
59
|
+
parentConversationId: params.parentConversationId
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
runtimeRoute,
|
|
64
|
+
configuredRoute
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { resolveDiscordConversationBindingRouteAsync as n, resolveDiscordConversationBindingRoute as t };
|
|
@@ -526,21 +526,17 @@ var DiscordEntityCache = class {
|
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
async fetchCached(key, fetcher) {
|
|
529
|
-
const
|
|
530
|
-
const now = asDateTimestampMs(rawNow);
|
|
529
|
+
const now = Date.now();
|
|
531
530
|
const cached = this.entries.get(key);
|
|
532
|
-
if (cached &&
|
|
531
|
+
if (cached && cached.expiresAt > now) return cached.value;
|
|
533
532
|
if (cached) this.entries.delete(key);
|
|
534
533
|
const value = await fetcher();
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
});
|
|
542
|
-
if (this.entries.size > DEFAULT_MAX_ENTRIES) this.entries.delete(this.entries.keys().next().value);
|
|
543
|
-
}
|
|
534
|
+
this.maybeSweepExpired(now);
|
|
535
|
+
this.entries.set(key, {
|
|
536
|
+
expiresAt: now + DEFAULT_REST_CACHE_TTL_MS,
|
|
537
|
+
value
|
|
538
|
+
});
|
|
539
|
+
if (this.entries.size > DEFAULT_MAX_ENTRIES) this.entries.delete(this.entries.keys().next().value);
|
|
544
540
|
return value;
|
|
545
541
|
}
|
|
546
542
|
maybeSweepExpired(now) {
|
|
@@ -1232,6 +1228,7 @@ function serializeRequestBody(data, headers) {
|
|
|
1232
1228
|
}
|
|
1233
1229
|
//#endregion
|
|
1234
1230
|
//#region extensions/discord/src/internal/rest-errors.ts
|
|
1231
|
+
const DISCORD_UNKNOWN_MESSAGE = 10008;
|
|
1235
1232
|
const DISCORD_UNKNOWN_VOICE_STATE = 10065;
|
|
1236
1233
|
const DISCORD_ERROR_BODY_MAX_DEPTH = 64;
|
|
1237
1234
|
const DISCORD_ERROR_BODY_MAX_NODES = 1e4;
|
|
@@ -1321,8 +1318,14 @@ function readDiscordMessage(body, fallback) {
|
|
|
1321
1318
|
const value = asOptionalObjectRecord(body)?.message;
|
|
1322
1319
|
return typeof value === "string" && value.trim() ? value : fallback;
|
|
1323
1320
|
}
|
|
1321
|
+
function readErrorDiscordCode(err) {
|
|
1322
|
+
return parseStrictNonNegativeInteger$1(asOptionalObjectRecord(err)?.discordCode);
|
|
1323
|
+
}
|
|
1324
|
+
function isUnknownDiscordMessageError(err) {
|
|
1325
|
+
return readErrorDiscordCode(err) === DISCORD_UNKNOWN_MESSAGE;
|
|
1326
|
+
}
|
|
1324
1327
|
function isUnknownDiscordVoiceStateError(err) {
|
|
1325
|
-
return
|
|
1328
|
+
return readErrorDiscordCode(err) === DISCORD_UNKNOWN_VOICE_STATE || /unknown voice state/i.test(formatErrorMessage(err));
|
|
1326
1329
|
}
|
|
1327
1330
|
function readRetryAfter(body, response, fallbackSeconds = 0) {
|
|
1328
1331
|
return parseDiscordRetryAfterBodySeconds(asOptionalObjectRecord(body)?.retry_after) ?? parseRetryAfterHeaderSeconds(response.headers.get("Retry-After")) ?? fallbackSeconds;
|
|
@@ -2370,6 +2373,7 @@ var discord_exports = /* @__PURE__ */ __exportAll({
|
|
|
2370
2373
|
getThreadMember: () => getThreadMember,
|
|
2371
2374
|
getUser: () => getUser,
|
|
2372
2375
|
hasDiscordV2Components: () => hasDiscordV2Components,
|
|
2376
|
+
isUnknownDiscordMessageError: () => isUnknownDiscordMessageError,
|
|
2373
2377
|
isUnknownDiscordVoiceStateError: () => isUnknownDiscordVoiceStateError,
|
|
2374
2378
|
listGuildEmojis: () => listGuildEmojis,
|
|
2375
2379
|
listMessageReactionUsers: () => listMessageReactionUsers,
|
|
@@ -2383,4 +2387,4 @@ var discord_exports = /* @__PURE__ */ __exportAll({
|
|
|
2383
2387
|
import * as import_discord_api_types_v10 from "discord-api-types/v10";
|
|
2384
2388
|
__reExport(discord_exports, import_discord_api_types_v10);
|
|
2385
2389
|
//#endregion
|
|
2386
|
-
export {
|
|
2390
|
+
export { User as $, StringSelectMenu as A, isUnknownDiscordVoiceStateError as B, LinkButton as C, Row as D, RoleSelectMenu as E, Plugin as F, withDiscordRequestAuthority as G, readDiscordMessage as H, RequestClient as I, Embed as J, hasDiscordV2Components as K, DiscordError as L, Thumbnail as M, UserSelectMenu as N, Section as O, Client as P, Message as Q, RateLimitError as R, File as S, MentionableSelectMenu as T, readRetryAfter as U, readDiscordCode as V, captureDiscordRequestAuthority as W, CommandWithSubcommands as X, Command as Y, Guild as Z, TextInput as _, getGuild as _t, MessageCreateListener as a, createOwnMessageReaction as at, ChannelSelectMenu as b, listGuildEmojis as bt, PresenceUpdateListener as c, createChannelMessage as ct, ThreadUpdateListener as d, editChannelMessage as dt, BaseMessageInteractiveComponent as et, VoiceStateUpdateListener as f, getChannel as ft, RadioGroup as g, unpinChannelMessage as gt, Modal as h, pinChannelMessage as ht, InteractionCreateListener as i, getCurrentUser as it, TextDisplay as j, Separator as k, ReadyListener as l, createThread as lt, Label as m, getThreadMember as mt, GuildCreateListener as n, createChannelWebhook as nt, MessageReactionAddListener as o, deleteOwnMessageReaction as ot, CheckboxGroup as p, getChannelMessage as pt, serializePayload as q, GuildDeleteListener as r, createUserDmChannel as rt, MessageReactionRemoveListener as s, listMessageReactionUsers as st, discord_exports as t, parseCustomId as tt, ThreadDeleteListener as u, deleteChannelMessage as ut, AnySelectMenu as v, getGuildMember as vt, MediaGallery as w, Container as x, stripUndefinedFields as xt, Button as y, getGuildVoiceState as yt, isUnknownDiscordMessageError as z };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { c as resolveDefaultDiscordAccountId } from "./accounts-ljrzXBJi.mjs";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-8cCu6uPG.mjs";
|
|
3
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
3
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-DgzLizSt.mjs";
|
|
4
4
|
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BPV-R4G9.mjs";
|
|
5
5
|
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Bwv8EuQ_.mjs";
|
|
6
6
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.mjs";
|
|
7
|
-
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
7
|
+
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-fRvFsZng.mjs";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
10
10
|
//#region extensions/discord/src/doctor.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
1
|
+
import { G as withDiscordRequestAuthority } from "./discord-Cl2OPTZ6.mjs";
|
|
2
|
+
import { u as matchesDiscordToolContextTarget } from "./send.receipt-eE3zLTDH.mjs";
|
|
3
3
|
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
4
|
-
import "./targets-
|
|
5
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
6
|
-
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-
|
|
4
|
+
import "./targets-UbCpek5o.mjs";
|
|
5
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-DE6W14G3.mjs";
|
|
6
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-C_cuoW1q.mjs";
|
|
7
7
|
import "../action-runtime-api.js";
|
|
8
|
-
import {
|
|
9
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
8
|
+
import { C as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-CsHHPxsQ.mjs";
|
|
9
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-DfAWANBE.mjs";
|
|
10
10
|
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-C4tp9noA.mjs";
|
|
11
11
|
import { asOptionalRecord, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-DE6W14G3.mjs";
|
|
2
2
|
import "../action-runtime-api.js";
|
|
3
|
-
import {
|
|
3
|
+
import { S as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-CsHHPxsQ.mjs";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
6
6
|
import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/param-readers";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { D as getDiscordEndpointRuntime, k as resolveDiscordEndpointMediaGuard } from "./allow-list-B_ToXtew.mjs";
|
|
2
2
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
3
|
-
import { D as createDiscordLivePolicyReader, O as mapGatewayDispatchData } from "./provider-
|
|
4
|
-
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-
|
|
3
|
+
import { D as createDiscordLivePolicyReader, O as mapGatewayDispatchData } from "./provider-DUTsZJHz.mjs";
|
|
4
|
+
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-fRvFsZng.mjs";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
7
7
|
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -195,7 +195,7 @@ function createDiscordAvatarResolver() {
|
|
|
195
195
|
}
|
|
196
196
|
//#endregion
|
|
197
197
|
//#region extensions/discord/src/monitor/message-run-queue.ts
|
|
198
|
-
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-
|
|
198
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-BZeWmSNC.mjs"));
|
|
199
199
|
async function processDiscordQueuedMessage(params) {
|
|
200
200
|
const abortSignal = params.job.context.abortSignal && params.lifecycleSignal ? AbortSignal.any([params.job.context.abortSignal, params.lifecycleSignal]) : params.job.context.abortSignal ?? params.lifecycleSignal;
|
|
201
201
|
try {
|
|
@@ -279,7 +279,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
279
279
|
}
|
|
280
280
|
//#endregion
|
|
281
281
|
//#region extensions/discord/src/monitor/message-dispatcher.ts
|
|
282
|
-
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-
|
|
282
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-BqUw7LWb.mjs"));
|
|
283
283
|
function createDiscordMessageDispatcher(params) {
|
|
284
284
|
const readPolicy = params.readPolicy ?? createDiscordLivePolicyReader({
|
|
285
285
|
...params,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { c as resolveDefaultDiscordAccountId } from "./accounts-ljrzXBJi.mjs";
|
|
2
2
|
import { C as resolveDiscordSystemLocation, S as formatDiscordUserTag, a as normalizeDiscordDisplaySlug, f as resolveDiscordGuildEntry, h as resolveDiscordMentionPolicy, l as resolveDiscordChannelConfigWithFallback, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, w as resolveTimestampMs } from "./allow-list-B_ToXtew.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { Q as Message, pt as getChannelMessage, t as discord_exports } from "./discord-Cl2OPTZ6.mjs";
|
|
4
4
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-CuNARfyw.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { b as resolveDiscordRuntimeBindingConversationId, g as resolveDiscordEffectiveRoute, h as resolveDiscordConversationRoute, p as buildDiscordRoutePeer, v as resolveDiscordConversationIdentity } from "./outbound-session-route-CsHHPxsQ.mjs";
|
|
6
|
+
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-fdYsXexV.mjs";
|
|
7
7
|
import { n as resolveDiscordChannelInfoSafe, r as resolveDiscordChannelNameSafe } from "./channel-access-DasWY_OV.mjs";
|
|
8
|
-
import { A as resolveDiscordDmCommandAccess, E as handleDiscordDmCommandDecision, j as resolveDiscordTextCommandAccess, n as resolveDiscordPreflightChannelAccess } from "./provider-
|
|
9
|
-
import { A as resolveDiscordChannelInfo, C as resolveMediaList, D as resolveDiscordMessageStickers, O as resolveDiscordReferencedReplyMessage, S as resolveForwardedMediaList, _ as resolveDiscordMessageBatch, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, v as resolveDiscordMessageHistoryText, y as resolveDiscordMessageMentionDocuments } from "./transcripts-source-
|
|
8
|
+
import { A as resolveDiscordDmCommandAccess, E as handleDiscordDmCommandDecision, j as resolveDiscordTextCommandAccess, n as resolveDiscordPreflightChannelAccess } from "./provider-DUTsZJHz.mjs";
|
|
9
|
+
import { A as resolveDiscordChannelInfo, C as resolveMediaList, D as resolveDiscordMessageStickers, O as resolveDiscordReferencedReplyMessage, S as resolveForwardedMediaList, _ as resolveDiscordMessageBatch, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, v as resolveDiscordMessageHistoryText, y as resolveDiscordMessageMentionDocuments } from "./transcripts-source-fRvFsZng.mjs";
|
|
10
10
|
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-BNBvGt1l.mjs";
|
|
11
|
-
import { a as createDiscordHistorySenderProvenance, c as hasRawDiscordUserMention, d as matchesActiveDiscordMentionPatterns, f as resolveDiscordMentionState, i as loadSystemEventsRuntime, l as isBoundThreadBotSystemMessage, m as shouldIgnoreBoundThreadWebhookMessage, n as loadDiscordThreadingRuntime, p as resolveInjectedBoundThreadLookupRecord, r as loadPreflightAudioRuntime, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo, u as isDiscordThreadChannelMessage } from "./message-handler.preflight-pluralkit-
|
|
11
|
+
import { a as createDiscordHistorySenderProvenance, c as hasRawDiscordUserMention, d as matchesActiveDiscordMentionPatterns, f as resolveDiscordMentionState, i as loadSystemEventsRuntime, l as isBoundThreadBotSystemMessage, m as shouldIgnoreBoundThreadWebhookMessage, n as loadDiscordThreadingRuntime, p as resolveInjectedBoundThreadLookupRecord, r as loadPreflightAudioRuntime, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo, u as isDiscordThreadChannelMessage } from "./message-handler.preflight-pluralkit-BU9I_X-b.mjs";
|
|
12
12
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
13
13
|
import { getChildLogger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
14
14
|
import { MessageReferenceType, MessageType } from "discord-api-types/v10";
|
|
@@ -26,7 +26,7 @@ import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
|
|
26
26
|
import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
27
27
|
//#region extensions/discord/src/monitor/message-handler.dm-preflight.ts
|
|
28
28
|
const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
|
|
29
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
29
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-yR1hfybW.mjs").then((n) => n.t));
|
|
30
30
|
async function resolveDiscordDmPreflightAccess(params) {
|
|
31
31
|
if (params.dmPolicy === "disabled") {
|
|
32
32
|
logVerbose("discord: drop dm (dmPolicy: disabled)");
|
|
@@ -36,7 +36,7 @@ async function resolveDiscordDmPreflightAccess(params) {
|
|
|
36
36
|
isDirectMessage: true,
|
|
37
37
|
userId: params.author.id
|
|
38
38
|
}) ?? `user:${params.author.id}`;
|
|
39
|
-
const directBindingRecord = (await loadConversationRuntime$1()).getSessionBindingService().
|
|
39
|
+
const directBindingRecord = await (await loadConversationRuntime$1()).getSessionBindingService().resolveByConversationAsync({
|
|
40
40
|
channel: "discord",
|
|
41
41
|
accountId: params.preflight.accountId,
|
|
42
42
|
conversationId: directBindingConversationId
|
|
@@ -273,13 +273,14 @@ async function resolveDiscordPreflightRoute(params) {
|
|
|
273
273
|
userId: params.author.id,
|
|
274
274
|
channelId: params.messageChannelId
|
|
275
275
|
});
|
|
276
|
-
const { runtimeRoute, configuredRoute } =
|
|
276
|
+
const { runtimeRoute, configuredRoute } = await resolveDiscordConversationBindingRouteAsync({
|
|
277
277
|
cfg: params.preflight.cfg,
|
|
278
278
|
resolveRoute: route,
|
|
279
279
|
accountId: params.preflight.accountId,
|
|
280
280
|
runtimeConversationId: bindingConversationId,
|
|
281
281
|
configuredConversationId: params.messageChannelId,
|
|
282
|
-
parentConversationId: params.earlyThreadParentId
|
|
282
|
+
parentConversationId: params.earlyThreadParentId,
|
|
283
|
+
touchBinding: false
|
|
283
284
|
});
|
|
284
285
|
const configuredBinding = configuredRoute?.bindingResolution ?? null;
|
|
285
286
|
const threadBinding = runtimeRoute.bindingRecord ?? configuredBinding?.record;
|