@openclaw/discord 2026.11.1 → 2026.11.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/.setup/{account-inspect-X_Xlr42B.mjs → account-inspect-8cCu6uPG.mjs} +3 -2
- package/dist/.setup/{accounts-C18HNgge.mjs → accounts-ljrzXBJi.mjs} +8 -4
- package/dist/.setup/{active-turn-thread-route-BAc_Xik-.mjs → active-turn-thread-route-C4tp9noA.mjs} +2 -1
- package/dist/.setup/{allow-list-D1ZGfhXh.mjs → allow-list-BKqOldGy.mjs} +11 -6
- package/dist/.setup/{api-Bth1wKF9.mjs → api-DqmMUZau.mjs} +5 -3
- package/dist/.setup/{approval-handler.runtime-krznjTz9.mjs → approval-handler.runtime-D0qu1um7.mjs} +9 -8
- package/dist/.setup/{approval-message-updates-Cks-MSCJ.mjs → approval-message-updates-CdurC9Ej.mjs} +4 -3
- package/dist/.setup/{audit-Dw_rAZIz.mjs → audit-ChorIwio.mjs} +7 -6
- package/dist/.setup/{channel-DwvRHJL0.mjs → channel-ZilgdF5e.mjs} +41 -33
- package/dist/.setup/{channel-access-BPrWoEXM.mjs → channel-access-DasWY_OV.mjs} +2 -1
- package/dist/.setup/{channel.setup-BHjvtK1U.mjs → channel.setup-DaDQdctj.mjs} +12 -8
- package/dist/.setup/{command-deploy-store-DPWiBMks.mjs → command-deploy-store-DFkBTViB.mjs} +2 -1
- package/dist/.setup/{command-owners-BzlhNBxA.mjs → command-owners-C7rUdqUX.mjs} +2 -1
- package/dist/.setup/{components-BvOWSPxr.mjs → components-Du9NhD8h.mjs} +20 -11
- package/dist/.setup/{config-schema-Coyq5wOr.mjs → config-schema-_uBILpQf.mjs} +5 -3
- package/dist/.setup/{conversation-binding-route-DOPUZNYo.mjs → conversation-binding-route-8Ul1KpGF.mjs} +3 -2
- package/dist/.setup/{directory-config-CIqVnQtn.mjs → directory-config-3iVub-3m.mjs} +4 -3
- package/dist/.setup/{directory-live-DUuPEWub.mjs → directory-live-BDVl2DoC.mjs} +15 -14
- package/dist/.setup/{discord-eFlHX1Gn.mjs → discord-BMD-JiVS.mjs} +68 -35
- package/dist/.setup/{doctor-contract-Dstl3cMg.mjs → doctor-contract-Bwv8EuQ_.mjs} +3 -2
- package/dist/.setup/{doctor-Cg_N6ZOI.mjs → doctor-hQKbkNKq.mjs} +9 -8
- package/dist/.setup/{handle-action-DXY91jF-.mjs → handle-action-B1lmt4ms.mjs} +11 -10
- package/dist/.setup/{handle-action.guild-admin-BvBCfhXF.mjs → handle-action.guild-admin-B6g31cwt.mjs} +4 -3
- package/dist/.setup/{live-policy-config-DO1Fk2hp.mjs → live-policy-config-C_Q966Wh.mjs} +5 -3
- package/dist/.setup/{message-handler-TR7l1P3P.mjs → message-handler-CkI3yMjL.mjs} +16 -11
- package/dist/.setup/{message-handler.preflight-DxGb4zsm.mjs → message-handler.preflight-CEfkFV9U.mjs} +28 -20
- package/dist/.setup/{message-handler.preflight-pluralkit-BTE5JebL.mjs → message-handler.preflight-pluralkit-D5si80_L.mjs} +14 -10
- package/dist/.setup/{message-handler.process-DVHZKc2e.mjs → message-handler.process-DsMtetRf.mjs} +47 -33
- package/dist/.setup/{outbound-adapter-DWyAWBFh.mjs → outbound-adapter-DfAanoCO.mjs} +19 -13
- package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-BtUpGBTb.mjs} +32 -21
- package/dist/.setup/{output-activity-CDgs2s3O.mjs → output-activity-uBpMSX75.mjs} +2 -1
- package/dist/.setup/{pluralkit-DcXbHTpQ.mjs → pluralkit-B64dfq_j.mjs} +3 -2
- package/dist/.setup/{preflight-audio-CwtPIsvk.mjs → preflight-audio-wWgsZG5F.mjs} +2 -1
- package/dist/.setup/{presence-cache-CgutE4NN.mjs → presence-cache-DCeTsL73.mjs} +2 -1
- package/dist/.setup/{probe-DNge7OEP.mjs → probe-CBaoCs-c.mjs} +6 -5
- package/dist/.setup/{provider-C61K7HHq.mjs → provider-CI_OLfvz.mjs} +209 -119
- package/dist/.setup/{provider-session.runtime-D87e36ut.mjs → provider-session.runtime-TWOo_JZx.mjs} +3 -3
- package/dist/.setup/provider.runtime-DnionCyo.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-D1YHKwbc.mjs → realtime-session.runtime-DvfS4vJj.mjs} +23 -14
- package/dist/.setup/{receive-recovery-C77CVdGM.mjs → receive-recovery-CKvaG2Hf.mjs} +6 -3
- package/dist/.setup/{resolve-allowlist-common-CI77288n.mjs → resolve-allowlist-common-cIjtqh2F.mjs} +7 -5
- package/dist/.setup/{resolve-channels-DYc6-xgV.mjs → resolve-channels-Cj5i7hzj.mjs} +10 -7
- package/dist/.setup/{resolve-users-BQT7XWF2.mjs → resolve-users-BQLbysRB.mjs} +5 -4
- package/dist/.setup/{rolldown-runtime-nwUcYXjP.mjs → rolldown-runtime-B4FMCO8f.mjs} +2 -1
- package/dist/.setup/{runtime-DcBvHOm1.mjs → runtime-DgnVQ7zW.mjs} +2 -1
- package/dist/.setup/{runtime-CI0UJqeS.mjs → runtime-RWnuJgWB.mjs} +35 -23
- package/dist/.setup/{runtime-doctor-migrations-BpV1jKk0.mjs → runtime-doctor-migrations-BPV-R4G9.mjs} +9 -5
- package/dist/.setup/{runtime-CcijhTJT.mjs → runtime-plifsKg9.mjs} +6 -4
- package/dist/.setup/{secret-config-contract-B7UlqVYr.mjs → secret-config-contract-z6FhbT8E.mjs} +2 -1
- package/dist/.setup/{security-audit-CTwisG7c.mjs → security-audit-BFT84Uny.mjs} +4 -3
- package/dist/.setup/{security-contract-D-o0iWDk.mjs → security-contract-DNyyjTZZ.mjs} +2 -1
- package/dist/.setup/{security-doctor-4s7omTZd.mjs → security-doctor-nGgPm65L.mjs} +2 -1
- package/dist/.setup/{send-Cbq-IVsS.mjs → send-da6ENJ9f.mjs} +28 -18
- package/dist/.setup/{send.components-BV6ucNpJ.mjs → send.components-CWZUuGvA.mjs} +15 -10
- package/dist/.setup/{send.outbound-CGhBhzjQ.mjs → send.outbound-qZ3iK3Vq.mjs} +13 -9
- package/dist/.setup/{send.receipt-Dw-_r5Bx.mjs → send.receipt-C18khRYH.mjs} +16 -9
- package/dist/.setup/{send.shared-D4MioxW_.mjs → send.shared-CnlMgoqQ.mjs} +23 -14
- package/dist/.setup/{sender-identity-DrN5c4ec.mjs → sender-identity-DgbJykq0.mjs} +3 -2
- package/dist/.setup/{session-contract-Bq71MS78.mjs → session-contract-BO5tlIdl.mjs} +2 -1
- package/dist/.setup/{session-key-normalization-Cfvze5hd.mjs → session-key-normalization-CCHGNSQw.mjs} +2 -1
- package/dist/.setup/setup-plugin-api-D1QuM187.mjs +3 -0
- package/dist/.setup/{shared-_o59Fvrr.mjs → shared-CY5vJM48.mjs} +19 -15
- package/dist/.setup/{subagent-hooks-mQbDkvuD.mjs → subagent-hooks-CIu2TFz3.mjs} +4 -3
- package/dist/.setup/{system-events-2zc2eGfF.mjs → system-events-DCOLXkwS.mjs} +4 -3
- package/dist/.setup/{target-parsing-BiuhcK9Q.mjs → target-parsing-C-HyNxcE.mjs} +2 -1
- package/dist/.setup/{target-resolver-CAHeVfmZ.mjs → target-resolver-CApivu3G.mjs} +7 -6
- package/dist/.setup/targets-UWWZ6gF7.mjs +3 -0
- package/dist/.setup/{thread-binding-api-Drd4Zu-5.mjs → thread-binding-api-BDZJD4na.mjs} +2 -1
- package/dist/.setup/{thread-bindings-Dg7X_ZXP.mjs → thread-bindings-DcvT_JgI.mjs} +11 -8
- package/dist/.setup/{thread-bindings.manager-DCDYksah.mjs → thread-bindings.manager-5Sh7yedN.mjs} +20 -15
- package/dist/.setup/{thread-bindings.session-updates-C76plLS3.mjs → thread-bindings.session-updates-BMdJeJMc.mjs} +9 -5
- package/dist/.setup/{threading-BKn_OF3K.mjs → threading-CzjFeUSe.mjs} +9 -6
- package/dist/.setup/{timeouts-DTrUsJ_W.mjs → timeouts-CuNARfyw.mjs} +2 -1
- package/dist/.setup/{transcripts-source-BSorJ4AS.mjs → transcripts-source-8RDQrSVb.mjs} +32 -19
- package/dist/.setup/{typing-DAv4S2fI.mjs → typing-CNlSKY5S.mjs} +3 -2
- package/dist/.setup/{voice-runtime-B5m2Ryg8.mjs → voice-runtime-BsDILmAv.mjs} +55 -33
- package/dist/account-inspect-api.js +3 -2
- package/dist/action-runtime-api.js +2 -1
- package/dist/activities-api.js +20 -13
- package/dist/api.js +22 -21
- package/dist/channel-config-api.js +2 -1
- package/dist/channel-plugin-api.js +2 -1
- package/dist/contract-api.js +2 -1
- package/dist/directory-contract-api.js +3 -2
- package/dist/doctor-contract-api.js +7 -5
- package/dist/index.js +2 -1
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/security-audit-contract-api.js +2 -1
- package/dist/security-contract-api.js +2 -1
- package/dist/session-key-api.js +2 -1
- package/dist/setup-entry.js +3 -2
- package/dist/setup-plugin-api.js +2 -1
- package/dist/src/voice/audio-worker.runtime.js +14 -8
- package/dist/subagent-hooks-api.js +3 -2
- package/dist/thread-binding-api.js +2 -1
- package/dist/transcripts-source-api.js +3 -2
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-xk5CVdoI.mjs +0 -1
- package/dist/.setup/setup-plugin-api-DGfQO4Ec.mjs +0 -2
- package/dist/.setup/targets-BaklhOqq.mjs +0 -3
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId } from "./accounts-
|
|
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-
|
|
3
|
-
import { Q as Message, pt as getChannelMessage, t as discord_exports } from "./discord-
|
|
4
|
-
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
5
|
-
import { b as resolveDiscordRuntimeBindingConversationId, g as resolveDiscordEffectiveRoute, h as resolveDiscordConversationRoute, p as buildDiscordRoutePeer, v as resolveDiscordConversationIdentity } from "./outbound-session-route-
|
|
6
|
-
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-
|
|
7
|
-
import { n as resolveDiscordChannelInfoSafe, r as resolveDiscordChannelNameSafe } from "./channel-access-
|
|
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-
|
|
10
|
-
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-
|
|
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-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId } from "./accounts-ljrzXBJi.mjs";
|
|
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-BKqOldGy.mjs";
|
|
3
|
+
import { Q as Message, pt as getChannelMessage, t as discord_exports } from "./discord-BMD-JiVS.mjs";
|
|
4
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-CuNARfyw.mjs";
|
|
5
|
+
import { b as resolveDiscordRuntimeBindingConversationId, g as resolveDiscordEffectiveRoute, h as resolveDiscordConversationRoute, p as buildDiscordRoutePeer, v as resolveDiscordConversationIdentity } from "./outbound-session-route-BtUpGBTb.mjs";
|
|
6
|
+
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-8Ul1KpGF.mjs";
|
|
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-CI_OLfvz.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-8RDQrSVb.mjs";
|
|
10
|
+
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-DgbJykq0.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-D5si80_L.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";
|
|
@@ -24,9 +24,9 @@ import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
|
|
|
24
24
|
import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
|
|
25
25
|
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-da6ENJ9f.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)");
|
|
@@ -108,7 +108,8 @@ async function resolveDiscordDmPreflightAccess(params) {
|
|
|
108
108
|
});
|
|
109
109
|
return null;
|
|
110
110
|
}
|
|
111
|
-
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region extensions/discord/src/monitor/message-handler.hydration.ts
|
|
112
113
|
function shouldHydrateDiscordMessagePayload(message) {
|
|
113
114
|
let currentText;
|
|
114
115
|
try {
|
|
@@ -180,7 +181,8 @@ async function hydrateDiscordMessageIfNeeded(params) {
|
|
|
180
181
|
})
|
|
181
182
|
};
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-channel-context.ts
|
|
184
186
|
function resolveDiscordPreflightChannelContext(params) {
|
|
185
187
|
const threadName = params.threadChannel?.name;
|
|
186
188
|
const displayChannelName = threadName ?? params.channelName;
|
|
@@ -203,7 +205,8 @@ function resolveDiscordPreflightChannelContext(params) {
|
|
|
203
205
|
}) : null
|
|
204
206
|
};
|
|
205
207
|
}
|
|
206
|
-
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-history.ts
|
|
207
210
|
function buildDiscordPreflightHistoryEntry(params) {
|
|
208
211
|
const textForHistory = resolveDiscordMessageHistoryText(params.message, { includeForwarded: true });
|
|
209
212
|
return params.isGuildMessage && params.historyLimit > 0 && textForHistory ? {
|
|
@@ -215,7 +218,8 @@ function buildDiscordPreflightHistoryEntry(params) {
|
|
|
215
218
|
senderProvenance: createDiscordHistorySenderProvenance(params)
|
|
216
219
|
} : void 0;
|
|
217
220
|
}
|
|
218
|
-
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-logging.ts
|
|
219
223
|
function logDiscordPreflightChannelConfig(params) {
|
|
220
224
|
if (!shouldLogVerbose()) return;
|
|
221
225
|
const channelConfigSummary = params.channelConfig ? `allowed=${params.channelConfig.allowed} enabled=${params.channelConfig.enabled ?? "unset"} requireMention=${params.channelConfig.requireMention ?? "unset"} ignoreOtherMentions=${params.channelConfig.ignoreOtherMentions ?? "unset"} matchKey=${params.channelConfig.matchKey ?? "none"} matchSource=${params.channelConfig.matchSource ?? "none"} users=${params.channelConfig.users?.length ?? 0} roles=${params.channelConfig.roles?.length ?? 0} skills=${params.channelConfig.skills?.length ?? 0}` : "none";
|
|
@@ -225,7 +229,8 @@ function logDiscordPreflightInboundSummary(params) {
|
|
|
225
229
|
if (!shouldLogVerbose()) return;
|
|
226
230
|
logVerbose(`discord: inbound id=${params.messageId} guild=${params.guildId ?? "dm"} channel=${params.channelId} mention=${params.wasMentioned ? "yes" : "no"} type=${params.isDirectMessage ? "dm" : params.isGroupDm ? "group-dm" : "guild"} content=${params.hasContent ? "yes" : "no"}`);
|
|
227
231
|
}
|
|
228
|
-
|
|
232
|
+
//#endregion
|
|
233
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-thread.ts
|
|
229
234
|
async function resolveDiscordPreflightThreadContext(params) {
|
|
230
235
|
const { resolveDiscordThreadChannel, resolveDiscordThreadParentInfo } = await loadDiscordThreadingRuntime();
|
|
231
236
|
const earlyThreadChannel = resolveDiscordThreadChannel(params);
|
|
@@ -243,7 +248,8 @@ async function resolveDiscordPreflightThreadContext(params) {
|
|
|
243
248
|
earlyThreadParentType: parentInfo.type
|
|
244
249
|
};
|
|
245
250
|
}
|
|
246
|
-
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region extensions/discord/src/monitor/message-handler.routing-preflight.ts
|
|
247
253
|
const loadConversationRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
|
|
248
254
|
async function resolveDiscordPreflightRoute(params) {
|
|
249
255
|
const conversationRuntime = await loadConversationRuntime();
|
|
@@ -295,7 +301,8 @@ async function resolveDiscordPreflightRoute(params) {
|
|
|
295
301
|
baseSessionKey: effectiveRoute.sessionKey
|
|
296
302
|
};
|
|
297
303
|
}
|
|
298
|
-
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region extensions/discord/src/monitor/message-handler.preflight.ts
|
|
299
306
|
const DISCORD_HISTORY_MEDIA_MAX_ATTACHMENTS = 4;
|
|
300
307
|
const DISCORD_HISTORY_MEDIA_MAX_BYTES = 10485760;
|
|
301
308
|
const DISCORD_HISTORY_MEDIA_IDLE_TIMEOUT_MS = 1e3;
|
|
@@ -885,4 +892,5 @@ async function preflightDiscordMessage(params) {
|
|
|
885
892
|
canDetectMention
|
|
886
893
|
};
|
|
887
894
|
}
|
|
895
|
+
//#endregion
|
|
888
896
|
export { preflightDiscordMessage, shouldIgnoreBoundThreadWebhookMessage };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as isDiscordThreadChannelType } from "./allow-list-
|
|
2
|
-
import { D as resolveDiscordMessageStickers } from "./transcripts-source-
|
|
1
|
+
import { A as isDiscordThreadChannelType } from "./allow-list-BKqOldGy.mjs";
|
|
2
|
+
import { D as resolveDiscordMessageStickers } from "./transcripts-source-8RDQrSVb.mjs";
|
|
3
3
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
4
4
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { findCodeRegions, isInsideCode } from "openclaw/plugin-sdk/text-chunking";
|
|
7
7
|
import { filterSupplementalContextItems } from "openclaw/plugin-sdk/security-runtime";
|
|
8
8
|
import { implicitMentionKindWhen, matchesMentionWithExplicit, normalizeMentionText } from "openclaw/plugin-sdk/channel-inbound";
|
|
9
|
-
|
|
9
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-helpers.ts
|
|
10
10
|
const DISCORD_BOUND_THREAD_SYSTEM_PREFIXES = [
|
|
11
11
|
"⚙️",
|
|
12
12
|
"🤖",
|
|
@@ -80,7 +80,8 @@ function shouldIgnoreBoundThreadWebhookMessage(params) {
|
|
|
80
80
|
const threadId = normalizeOptionalString(params.threadId) ?? "";
|
|
81
81
|
return Boolean(threadId && params.threadBinding);
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region extensions/discord/src/monitor/message-handler.history.ts
|
|
84
85
|
function createDiscordHistorySenderProvenance(params) {
|
|
85
86
|
return Object.freeze({
|
|
86
87
|
id: params.sender.id,
|
|
@@ -108,12 +109,14 @@ function filterDiscordHistoryEntriesForContext(params) {
|
|
|
108
109
|
function resolveDiscordHistoryMediaIds(message) {
|
|
109
110
|
return [...(message.attachments ?? []).map((attachment) => `attachment:${attachment.id}`), ...resolveDiscordMessageStickers(message).map((sticker) => `sticker:${sticker.id}`)];
|
|
110
111
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
const
|
|
115
|
-
const
|
|
116
|
-
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-runtime.ts
|
|
114
|
+
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-B64dfq_j.mjs").then((n) => n.n));
|
|
115
|
+
const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-wWgsZG5F.mjs"));
|
|
116
|
+
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-DCOLXkwS.mjs"));
|
|
117
|
+
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-CzjFeUSe.mjs").then((n) => n.t));
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-pluralkit.ts
|
|
117
120
|
async function resolveDiscordPreflightPluralKitInfo(params) {
|
|
118
121
|
if (!params.config?.enabled || !params.webhookId) return null;
|
|
119
122
|
try {
|
|
@@ -129,4 +132,5 @@ async function resolveDiscordPreflightPluralKitInfo(params) {
|
|
|
129
132
|
return null;
|
|
130
133
|
}
|
|
131
134
|
}
|
|
135
|
+
//#endregion
|
|
132
136
|
export { createDiscordHistorySenderProvenance as a, hasRawDiscordUserMention as c, matchesActiveDiscordMentionPatterns as d, resolveDiscordMentionState as f, loadSystemEventsRuntime as i, isBoundThreadBotSystemMessage as l, shouldIgnoreBoundThreadWebhookMessage as m, loadDiscordThreadingRuntime as n, filterDiscordHistoryEntriesForContext as o, resolveInjectedBoundThreadLookupRecord as p, loadPreflightAudioRuntime as r, resolveDiscordHistoryMediaIds as s, resolveDiscordPreflightPluralKitInfo as t, isDiscordThreadChannelMessage as u };
|
package/dist/.setup/{message-handler.process-DVHZKc2e.mjs → message-handler.process-DsMtetRf.mjs}
RENAMED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { m as resolveDiscordMaxLinesPerMessage } from "./accounts-
|
|
2
|
-
import { i as normalizeDiscordAllowList, o as normalizeDiscordSlug, w as resolveTimestampMs } from "./allow-list-
|
|
3
|
-
import { F as createDiscordRuntimeAccountContext, O as resolveDiscordMessageFlags, P as createDiscordRestClient, u as resolveDiscordTargetChannelId } from "./send.shared-
|
|
4
|
-
import { G as withDiscordRequestAuthority, Q as Message, W as captureDiscordRequestAuthority, dt as editChannelMessage, t as discord_exports, ut as deleteChannelMessage, vt as getGuildMember } from "./discord-
|
|
5
|
-
import { v as chunkDiscordTextWithMode } from "./send.receipt-
|
|
6
|
-
import { n as resolveDiscordChannelId } from "./target-parsing-
|
|
7
|
-
import { a as removeReactionDiscord, r as reactMessageDiscord } from "./send-
|
|
8
|
-
import { o as discordTextHasBroadcastMention } from "./send.outbound-
|
|
9
|
-
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
10
|
-
import "./targets-
|
|
11
|
-
import { C as discordInboundEventDelivery, p as buildDiscordRoutePeer, v as resolveDiscordConversationIdentity } from "./outbound-session-route-
|
|
12
|
-
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-
|
|
13
|
-
import { T as createDiscordSupplementalContextAccessChecker, c as formatDiscordReplySkip, d as buildGuildLabel, f as resolveReplyContext, l as sanitizeDiscordFrontChannelReplyPayloads, o as deliverDiscordReply, s as formatDiscordReplyDeliveryFailure, u as buildDirectLabel, w as buildDiscordInboundAccessContext } from "./provider-
|
|
14
|
-
import { D as resolveDiscordMessageStickers, b as resolveDiscordMessageText, h as resolveDiscordThreadStarter, k as resolveDiscordReferencedReplyMessageId, v as resolveDiscordMessageHistoryText, w as resolveReferencedReplyMediaList, x as formatDiscordMediaText } from "./transcripts-source-
|
|
15
|
-
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-
|
|
16
|
-
import { n as resolveDiscordAutoThreadReplyPlan } from "./threading-
|
|
17
|
-
import { t as beginDiscordActiveTurnThreadRoute } from "./active-turn-thread-route-
|
|
18
|
-
import { a as createDiscordHistorySenderProvenance, l as isBoundThreadBotSystemMessage, m as shouldIgnoreBoundThreadWebhookMessage, o as filterDiscordHistoryEntriesForContext, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo } from "./message-handler.preflight-pluralkit-
|
|
19
|
-
import { t as sendTyping } from "./typing-
|
|
1
|
+
import { m as resolveDiscordMaxLinesPerMessage } from "./accounts-ljrzXBJi.mjs";
|
|
2
|
+
import { i as normalizeDiscordAllowList, o as normalizeDiscordSlug, w as resolveTimestampMs } from "./allow-list-BKqOldGy.mjs";
|
|
3
|
+
import { F as createDiscordRuntimeAccountContext, O as resolveDiscordMessageFlags, P as createDiscordRestClient, u as resolveDiscordTargetChannelId } from "./send.shared-CnlMgoqQ.mjs";
|
|
4
|
+
import { G as withDiscordRequestAuthority, Q as Message, W as captureDiscordRequestAuthority, dt as editChannelMessage, t as discord_exports, ut as deleteChannelMessage, vt as getGuildMember } from "./discord-BMD-JiVS.mjs";
|
|
5
|
+
import { v as chunkDiscordTextWithMode } from "./send.receipt-C18khRYH.mjs";
|
|
6
|
+
import { n as resolveDiscordChannelId } from "./target-parsing-C-HyNxcE.mjs";
|
|
7
|
+
import { a as removeReactionDiscord, r as reactMessageDiscord } from "./send-da6ENJ9f.mjs";
|
|
8
|
+
import { o as discordTextHasBroadcastMention } from "./send.outbound-qZ3iK3Vq.mjs";
|
|
9
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-CuNARfyw.mjs";
|
|
10
|
+
import "./targets-UWWZ6gF7.mjs";
|
|
11
|
+
import { C as discordInboundEventDelivery, p as buildDiscordRoutePeer, v as resolveDiscordConversationIdentity } from "./outbound-session-route-BtUpGBTb.mjs";
|
|
12
|
+
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-DfAanoCO.mjs";
|
|
13
|
+
import { T as createDiscordSupplementalContextAccessChecker, c as formatDiscordReplySkip, d as buildGuildLabel, f as resolveReplyContext, l as sanitizeDiscordFrontChannelReplyPayloads, o as deliverDiscordReply, s as formatDiscordReplyDeliveryFailure, u as buildDirectLabel, w as buildDiscordInboundAccessContext } from "./provider-CI_OLfvz.mjs";
|
|
14
|
+
import { D as resolveDiscordMessageStickers, b as resolveDiscordMessageText, h as resolveDiscordThreadStarter, k as resolveDiscordReferencedReplyMessageId, v as resolveDiscordMessageHistoryText, w as resolveReferencedReplyMediaList, x as formatDiscordMediaText } from "./transcripts-source-8RDQrSVb.mjs";
|
|
15
|
+
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-DgbJykq0.mjs";
|
|
16
|
+
import { n as resolveDiscordAutoThreadReplyPlan } from "./threading-CzjFeUSe.mjs";
|
|
17
|
+
import { t as beginDiscordActiveTurnThreadRoute } from "./active-turn-thread-route-C4tp9noA.mjs";
|
|
18
|
+
import { a as createDiscordHistorySenderProvenance, l as isBoundThreadBotSystemMessage, m as shouldIgnoreBoundThreadWebhookMessage, o as filterDiscordHistoryEntriesForContext, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo } from "./message-handler.preflight-pluralkit-D5si80_L.mjs";
|
|
19
|
+
import { t as sendTyping } from "./typing-CNlSKY5S.mjs";
|
|
20
20
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
21
21
|
import { danger, logVerbose, shouldLogVerbose, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
22
22
|
import { buildAgentSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
@@ -44,7 +44,7 @@ import { buildHistoryContextFromEntries, buildInboundHistoryFromEntries, createC
|
|
|
44
44
|
import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
45
45
|
import { formatAudioTranscriptForAgent } from "openclaw/plugin-sdk/media-understanding-runtime";
|
|
46
46
|
import { createStatusReactionController, logAckFailure, logTypingFailure, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
|
|
47
|
-
|
|
47
|
+
//#region extensions/discord/src/monitor/message-handler.recent-history.ts
|
|
48
48
|
/** Fetch a physical recent window, never walking older pages to refill filtered rows. */
|
|
49
49
|
async function recoverDiscordChannelHistory(params) {
|
|
50
50
|
const { ctx, isCurrent } = params;
|
|
@@ -151,7 +151,8 @@ async function recoverDiscordChannelHistory(params) {
|
|
|
151
151
|
return [];
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region extensions/discord/src/monitor/message-handler.retry.ts
|
|
155
156
|
const REPLY_SESSION_INIT_CONFLICT_MESSAGE_RE = /^reply session initialization conflicted for \S+$/u;
|
|
156
157
|
const DISCORD_SESSION_CONFLICT_FAILURE_TEXT = "⚠️ Couldn't process this message because the session stayed busy. Please try again in a moment.";
|
|
157
158
|
async function completeDiscordSessionConflict(error, sourceReplyDeliveryMode, deliver, onDeliveryError) {
|
|
@@ -173,7 +174,8 @@ function removeDiscordReplayHistoryEntry(historyMap, historyKey, messageId) {
|
|
|
173
174
|
if (!history) return;
|
|
174
175
|
for (let index = history.length - 1; index >= 0; index -= 1) if (history[index]?.messageId === messageId) history.splice(index, 1);
|
|
175
176
|
}
|
|
176
|
-
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region extensions/discord/src/monitor/message-handler.context.ts
|
|
177
179
|
function normalizeDiscordDmOwnerEntry(entry) {
|
|
178
180
|
const candidate = normalizeDiscordAllowList([entry], [
|
|
179
181
|
"discord:",
|
|
@@ -584,7 +586,8 @@ async function buildDiscordMessageProcessContext(params) {
|
|
|
584
586
|
replyPlan
|
|
585
587
|
};
|
|
586
588
|
}
|
|
587
|
-
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region extensions/discord/src/monitor/message-handler.process-progress.ts
|
|
588
591
|
async function createDiscordMessageProgressRuntime(params) {
|
|
589
592
|
const { ctx, draftPreview } = params;
|
|
590
593
|
const { cfg, route, abortSignal } = ctx;
|
|
@@ -680,7 +683,8 @@ async function createDiscordMessageProgressRuntime(params) {
|
|
|
680
683
|
}
|
|
681
684
|
} };
|
|
682
685
|
}
|
|
683
|
-
|
|
686
|
+
//#endregion
|
|
687
|
+
//#region extensions/discord/src/monitor/ack-reactions.ts
|
|
684
688
|
function createDiscordAckReactionContext(params) {
|
|
685
689
|
return {
|
|
686
690
|
rest: params.rest,
|
|
@@ -712,7 +716,8 @@ function queueInitialDiscordAckReaction(params) {
|
|
|
712
716
|
});
|
|
713
717
|
});
|
|
714
718
|
}
|
|
715
|
-
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region extensions/discord/src/monitor/message-handler.process-reactions.ts
|
|
716
721
|
function createDiscordMessageReactionRuntime(params) {
|
|
717
722
|
const { ctx } = params;
|
|
718
723
|
const { cfg, accountId, token, ackReactionScope, message, messageChannelId, isGuildMessage, isDirectMessage, isGroupDm, canDetectMention, effectiveWasMentioned, shouldBypassMention, route } = ctx;
|
|
@@ -840,7 +845,8 @@ function createDiscordMessageReactionRuntime(params) {
|
|
|
840
845
|
finish
|
|
841
846
|
};
|
|
842
847
|
}
|
|
843
|
-
|
|
848
|
+
//#endregion
|
|
849
|
+
//#region extensions/discord/src/draft-stream.ts
|
|
844
850
|
/** Discord messages cap at 2000 characters. */
|
|
845
851
|
const DISCORD_STREAM_MAX_CHARS = 2e3;
|
|
846
852
|
const DEFAULT_THROTTLE_MS = 1200;
|
|
@@ -977,11 +983,13 @@ function createDiscordDraftStream(params) {
|
|
|
977
983
|
forceNewMessage: lifecycle.reset
|
|
978
984
|
};
|
|
979
985
|
}
|
|
980
|
-
|
|
986
|
+
//#endregion
|
|
987
|
+
//#region extensions/discord/src/preview-streaming.ts
|
|
981
988
|
function resolveDiscordPreviewStreamMode(params = {}) {
|
|
982
989
|
return resolveChannelPreviewStreamMode(params, "progress");
|
|
983
990
|
}
|
|
984
|
-
|
|
991
|
+
//#endregion
|
|
992
|
+
//#region extensions/discord/src/monitor/message-handler.progress-continuation.ts
|
|
985
993
|
/** The registry owns task settlement; Discord keeps the confirmed transport and its cleanup. */
|
|
986
994
|
function retainDiscordProgressDraft(params) {
|
|
987
995
|
let retired = false;
|
|
@@ -1040,7 +1048,8 @@ function retainDiscordProgressDraft(params) {
|
|
|
1040
1048
|
}
|
|
1041
1049
|
};
|
|
1042
1050
|
}
|
|
1043
|
-
|
|
1051
|
+
//#endregion
|
|
1052
|
+
//#region extensions/discord/src/monitor/message-handler.draft-preview.ts
|
|
1044
1053
|
function createDiscordDraftPreviewController(params) {
|
|
1045
1054
|
const runInChannelScope = AsyncLocalStorage.snapshot();
|
|
1046
1055
|
const assertChannelAuthority = captureDiscordRequestAuthority();
|
|
@@ -1312,7 +1321,8 @@ function isEmptyDiscordProgressLine(line) {
|
|
|
1312
1321
|
function shouldStartDiscordProgressDraftNow(line) {
|
|
1313
1322
|
return typeof line === "object" && line?.kind === "patch" && Boolean(line.detail);
|
|
1314
1323
|
}
|
|
1315
|
-
|
|
1324
|
+
//#endregion
|
|
1325
|
+
//#region extensions/discord/src/monitor/reply-typing-feedback.ts
|
|
1316
1326
|
const DISCORD_REPLY_TYPING_MAX_DURATION_MS = 12e5;
|
|
1317
1327
|
function createDiscordReplyTypingFeedback(params) {
|
|
1318
1328
|
const rest = params.rest ?? createDiscordRestClient(params).rest;
|
|
@@ -1333,7 +1343,8 @@ function createDiscordReplyTypingFeedback(params) {
|
|
|
1333
1343
|
maxDurationMs: params.maxDurationMs ?? DISCORD_REPLY_TYPING_MAX_DURATION_MS
|
|
1334
1344
|
});
|
|
1335
1345
|
}
|
|
1336
|
-
|
|
1346
|
+
//#endregion
|
|
1347
|
+
//#region extensions/discord/src/monitor/message-handler.process-reply-runtime.ts
|
|
1337
1348
|
function formatDiscordGroupThreadReply(text, participant) {
|
|
1338
1349
|
return `**${participant.name.replace(/[\\`*_{}[\]()<>#!|]/g, "\\$&").replace(/\s+/g, " ")}**\n${text}`;
|
|
1339
1350
|
}
|
|
@@ -1463,7 +1474,8 @@ function createDiscordMessageReplyRuntime(params) {
|
|
|
1463
1474
|
resolvedBlockStreamingEnabled: resolveChannelStreamingBlockEnabled(discordConfig)
|
|
1464
1475
|
};
|
|
1465
1476
|
}
|
|
1466
|
-
|
|
1477
|
+
//#endregion
|
|
1478
|
+
//#region extensions/discord/src/monitor/message-handler.process-thread-route.ts
|
|
1467
1479
|
function createDiscordMessageActiveThreadRoute(params) {
|
|
1468
1480
|
let adoptedThreadId;
|
|
1469
1481
|
let threadReplyDelivered = false;
|
|
@@ -1498,7 +1510,8 @@ function createDiscordMessageActiveThreadRoute(params) {
|
|
|
1498
1510
|
})
|
|
1499
1511
|
};
|
|
1500
1512
|
}
|
|
1501
|
-
|
|
1513
|
+
//#endregion
|
|
1514
|
+
//#region extensions/discord/src/monitor/message-handler.process.ts
|
|
1502
1515
|
const TARGETED_ONLY_ALLOWED_MENTIONS = { parse: [AllowedMentionsTypes.User, AllowedMentionsTypes.Role] };
|
|
1503
1516
|
function isFallbackOnlyToolWarningFinal(payload) {
|
|
1504
1517
|
if (payload.isError !== true || !isReplyPayloadNonTerminalToolErrorWarning(payload)) return false;
|
|
@@ -1865,4 +1878,5 @@ async function processDiscordMessage(ctx, observer) {
|
|
|
1865
1878
|
logVerbose(`discord: delivered ${finalCount} reply${finalCount === 1 ? "" : "ies"} to ${replyPlan.replyTarget}`);
|
|
1866
1879
|
}
|
|
1867
1880
|
}
|
|
1881
|
+
//#endregion
|
|
1868
1882
|
export { processDiscordMessage };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import { d as normalizeDiscordMessagingTarget, f as normalizeDiscordOutboundTarget, g as hasDiscordMessageCreateAmbiguity, i as toDiscordOutboundDeliveryResult, n as createDiscordSendReceiptFromResults, p as canFallbackDiscordWebhookSend, s as resolveDiscordReplyReference, t as createDiscordSendReceipt, v as chunkDiscordTextWithMode } from "./send.receipt-
|
|
3
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
4
|
-
import { C as discordInboundEventDelivery, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, w as notifyDiscordInboundEventOutboundPayloadSuccess, y as resolveDiscordCurrentConversationIdentity } from "./outbound-session-route-
|
|
1
|
+
import { t as createDiscordActionGate } from "./accounts-ljrzXBJi.mjs";
|
|
2
|
+
import { d as normalizeDiscordMessagingTarget, f as normalizeDiscordOutboundTarget, g as hasDiscordMessageCreateAmbiguity, i as toDiscordOutboundDeliveryResult, n as createDiscordSendReceiptFromResults, p as canFallbackDiscordWebhookSend, s as resolveDiscordReplyReference, t as createDiscordSendReceipt, v as chunkDiscordTextWithMode } from "./send.receipt-C18khRYH.mjs";
|
|
3
|
+
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
4
|
+
import { C as discordInboundEventDelivery, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, w as notifyDiscordInboundEventOutboundPayloadSuccess, y as resolveDiscordCurrentConversationIdentity } from "./outbound-session-route-BtUpGBTb.mjs";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
7
7
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -11,7 +11,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
11
11
|
import { createReplyToFanout, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
12
12
|
import { attachChannelToResult, createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
13
13
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
14
|
-
|
|
14
|
+
//#region extensions/discord/src/channel.conversation.ts
|
|
15
15
|
function resolveDiscordAttachedOutboundTarget(params) {
|
|
16
16
|
if (params.threadId == null) return params.to;
|
|
17
17
|
const threadId = normalizeOptionalStringifiedId(params.threadId) ?? "";
|
|
@@ -100,7 +100,8 @@ function resolveDiscordInboundConversation(params) {
|
|
|
100
100
|
});
|
|
101
101
|
return conversationId ? { conversationId } : null;
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region extensions/discord/src/media-detection.ts
|
|
104
105
|
const DISCORD_VIDEO_MEDIA_EXTENSIONS = [
|
|
105
106
|
".avi",
|
|
106
107
|
".m4v",
|
|
@@ -125,7 +126,8 @@ function isLikelyDiscordVideoMedia(mediaUrl) {
|
|
|
125
126
|
const normalized = normalizeLowercaseStringOrEmpty(path);
|
|
126
127
|
return DISCORD_VIDEO_MEDIA_EXTENSIONS.some((ext) => normalized.endsWith(ext));
|
|
127
128
|
}
|
|
128
|
-
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region extensions/discord/src/outbound-approval.ts
|
|
129
131
|
function normalizeDiscordApprovalPayload(payload) {
|
|
130
132
|
if (!asOptionalRecord(payload.channelData)?.execApproval || !payload.text) return payload;
|
|
131
133
|
return {
|
|
@@ -133,8 +135,9 @@ function normalizeDiscordApprovalPayload(payload) {
|
|
|
133
135
|
text: payload.text.replace(/@everyone/gi, "@everyone").replace(/@here/gi, "@here").replace(/<@/g, "<@").replace(/<#/g, "<#")
|
|
134
136
|
};
|
|
135
137
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region extensions/discord/src/outbound-send-context.ts
|
|
140
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-da6ENJ9f.mjs").then((n) => n.t));
|
|
138
141
|
function resolveDiscordFormattingOptions(ctx) {
|
|
139
142
|
const formatting = ctx.formatting;
|
|
140
143
|
return {
|
|
@@ -162,7 +165,8 @@ async function createDiscordPayloadSendContext(ctx) {
|
|
|
162
165
|
sendVoice: resolveOutboundSendDep(ctx.deps, "discordVoice") ?? runtime.sendVoiceMessageDiscord
|
|
163
166
|
};
|
|
164
167
|
}
|
|
165
|
-
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region extensions/discord/src/outbound-payload.ts
|
|
166
170
|
const log$1 = createSubsystemLogger("discord/outbound");
|
|
167
171
|
function createDiscordUnknownPayloadResult(target) {
|
|
168
172
|
return {
|
|
@@ -324,12 +328,13 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
324
328
|
}
|
|
325
329
|
}));
|
|
326
330
|
}
|
|
327
|
-
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region extensions/discord/src/outbound-adapter.ts
|
|
328
333
|
const DISCORD_TEXT_CHUNK_LIMIT = 2e3;
|
|
329
334
|
const DISCORD_PRECHUNK_MAX_LINES = Number.MAX_SAFE_INTEGER;
|
|
330
335
|
const log = createSubsystemLogger("discord/outbound");
|
|
331
|
-
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-
|
|
332
|
-
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-
|
|
336
|
+
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-DcvT_JgI.mjs").then((n) => n.i));
|
|
337
|
+
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-CWZUuGvA.mjs").then((n) => n.i));
|
|
333
338
|
function resolveDiscordDeliveryOptions(params) {
|
|
334
339
|
return {
|
|
335
340
|
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
@@ -534,4 +539,5 @@ const discordOutbound = {
|
|
|
534
539
|
await manager.touchThread({ threadId });
|
|
535
540
|
}
|
|
536
541
|
};
|
|
542
|
+
//#endregion
|
|
537
543
|
export { normalizeDiscordAcpConversationId as a, resolveDiscordInboundConversation as c, matchDiscordAcpConversation as i, discordOutbound as n, resolveDiscordAttachedOutboundTarget as o, buildDiscordCrossContextPresentation as r, resolveDiscordCommandConversation as s, DISCORD_TEXT_CHUNK_LIMIT as t };
|
package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-BtUpGBTb.mjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { A as isDiscordThreadChannelType } from "./allow-list-
|
|
4
|
-
import { d as normalizeDiscordMessagingTarget, u as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
5
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
6
|
-
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-
|
|
7
|
-
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-
|
|
1
|
+
import { i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-ljrzXBJi.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-8cCu6uPG.mjs";
|
|
3
|
+
import { A as isDiscordThreadChannelType } from "./allow-list-BKqOldGy.mjs";
|
|
4
|
+
import { d as normalizeDiscordMessagingTarget, u as matchesDiscordToolContextTarget } from "./send.receipt-C18khRYH.mjs";
|
|
5
|
+
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
6
|
+
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-Du9NhD8h.mjs";
|
|
7
|
+
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-C7rUdqUX.mjs";
|
|
8
8
|
import { createLazyRuntimeMethod, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
10
10
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -20,7 +20,7 @@ import { getExecApprovalReplyMetadata, isChannelExecApprovalClientEnabledFromCon
|
|
|
20
20
|
import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
21
21
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
22
22
|
import { createInboundEventDeliveryCorrelation } from "openclaw/plugin-sdk/inbound-event-delivery";
|
|
23
|
-
|
|
23
|
+
//#region extensions/discord/src/exec-approvals.ts
|
|
24
24
|
function normalizeDiscordApproverId(value) {
|
|
25
25
|
const trimmed = String(value).trim();
|
|
26
26
|
if (!trimmed) return;
|
|
@@ -65,7 +65,8 @@ function shouldSuppressLocalDiscordExecApprovalPrompt(params) {
|
|
|
65
65
|
sessionFilter: config?.sessionFilter
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region extensions/discord/src/audit-core.ts
|
|
69
70
|
const REQUIRED_TEXT_CHANNEL_PERMISSIONS = ["ViewChannel", "SendMessages"];
|
|
70
71
|
const REQUIRED_THREAD_CHANNEL_PERMISSIONS = ["ViewChannel", "SendMessagesInThreads"];
|
|
71
72
|
const REQUIRED_VOICE_CHANNEL_PERMISSIONS = [
|
|
@@ -140,7 +141,8 @@ async function auditDiscordChannelPermissionsWithFetcher(params) {
|
|
|
140
141
|
elapsedMs: Date.now() - started
|
|
141
142
|
};
|
|
142
143
|
}
|
|
143
|
-
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region extensions/discord/src/inbound-event-delivery.ts
|
|
144
146
|
const DISCORD_INBOUND_EVENT_DELIVERY_KEY = "__openclawInboundEventDelivery";
|
|
145
147
|
function normalizeDiscordDeliveryTarget(value) {
|
|
146
148
|
return value.trim().replace(/^discord:/iu, "").replace(/^channel:/iu, "").toLowerCase();
|
|
@@ -177,7 +179,8 @@ function notifyDiscordInboundEventOutboundPayloadSuccess(params) {
|
|
|
177
179
|
accountId: params.accountId
|
|
178
180
|
});
|
|
179
181
|
}
|
|
180
|
-
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region extensions/discord/src/trusted-requester-actions.ts
|
|
181
184
|
const trustedRequesterGuildAdminActions = /* @__PURE__ */ new Set([
|
|
182
185
|
"emoji-upload",
|
|
183
186
|
"sticker-upload",
|
|
@@ -198,7 +201,8 @@ const trustedRequesterGuildAdminActions = /* @__PURE__ */ new Set([
|
|
|
198
201
|
function isTrustedRequesterGuildAdminAction(action) {
|
|
199
202
|
return trustedRequesterGuildAdminActions.has(action);
|
|
200
203
|
}
|
|
201
|
-
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region extensions/discord/src/channel-actions.ts
|
|
202
206
|
const localExecutionActions = /* @__PURE__ */ new Set([
|
|
203
207
|
"send",
|
|
204
208
|
"poll",
|
|
@@ -219,7 +223,7 @@ function resolveDiscordThreadReplyTarget(args) {
|
|
|
219
223
|
const target = threadId !== void 0 ? `channel:${threadId}` : normalizeOptionalString(args.channelId) ?? normalizeOptionalString(args.to) ?? normalizeOptionalString(args.target);
|
|
220
224
|
return target ? normalizeDiscordMessagingTarget(target) : void 0;
|
|
221
225
|
}
|
|
222
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-
|
|
226
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-B1lmt4ms.mjs"));
|
|
223
227
|
const discordActionGroups = [
|
|
224
228
|
{
|
|
225
229
|
gate: "polls",
|
|
@@ -454,7 +458,8 @@ const discordMessageActions = {
|
|
|
454
458
|
...sessionKey ? { sessionKey } : {}
|
|
455
459
|
})
|
|
456
460
|
};
|
|
457
|
-
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region extensions/discord/src/conversation-identity.ts
|
|
458
463
|
function normalizeDiscordTarget(raw, defaultKind) {
|
|
459
464
|
return parseDiscordTarget(normalizeOptionalString(raw) ?? "", { defaultKind })?.normalized;
|
|
460
465
|
}
|
|
@@ -483,7 +488,8 @@ function resolveDiscordCurrentConversationIdentity(params) {
|
|
|
483
488
|
if (target) return target;
|
|
484
489
|
}
|
|
485
490
|
}
|
|
486
|
-
|
|
491
|
+
//#endregion
|
|
492
|
+
//#region extensions/discord/src/monitor/route-resolution.ts
|
|
487
493
|
function buildDiscordRoutePeer(params) {
|
|
488
494
|
return {
|
|
489
495
|
kind: params.isGroupDm ? "group" : params.isDirectMessage ? "direct" : "channel",
|
|
@@ -563,7 +569,8 @@ function shouldIgnoreStaleDiscordRouteBinding(params) {
|
|
|
563
569
|
if (!bound || !routed || bound.rest !== routed.rest) return false;
|
|
564
570
|
return bound.agentId !== params.route.agentId;
|
|
565
571
|
}
|
|
566
|
-
|
|
572
|
+
//#endregion
|
|
573
|
+
//#region extensions/discord/src/channel-policy-state.ts
|
|
567
574
|
const channelPolicyBindings = resolveGlobalMap(Symbol.for("openclaw.discord.channel-policy-bindings"), "close-and-restart");
|
|
568
575
|
function setDiscordChannelPolicyBindings(accountId, bindings) {
|
|
569
576
|
channelPolicyBindings.set(normalizeAccountId(accountId), [...bindings]);
|
|
@@ -577,7 +584,8 @@ function getDiscordChannelPolicyBinding(accountId, guildKey, channelKey) {
|
|
|
577
584
|
function findDiscordChannelPolicyKey(accountId, guildKey, channelId) {
|
|
578
585
|
return listBindings(accountId, guildKey).find((binding) => binding.channelId === channelId)?.channelKey;
|
|
579
586
|
}
|
|
580
|
-
|
|
587
|
+
//#endregion
|
|
588
|
+
//#region extensions/discord/src/approval-message-safety.ts
|
|
581
589
|
const DISCORD_APPROVAL_ALLOWED_MENTIONS = { parse: [] };
|
|
582
590
|
const DISCORD_MARKDOWN_META_CHARACTERS = /* @__PURE__ */ new Set([
|
|
583
591
|
"\\",
|
|
@@ -620,7 +628,8 @@ function formatDiscordApprovalDisplayValue(value, maxChars = 200) {
|
|
|
620
628
|
}
|
|
621
629
|
return escaped;
|
|
622
630
|
}
|
|
623
|
-
|
|
631
|
+
//#endregion
|
|
632
|
+
//#region extensions/discord/src/outbound-components.ts
|
|
624
633
|
const DISCORD_MESSAGE_COMPONENT_LIMIT = 40;
|
|
625
634
|
const DISCORD_TEXT_DISPLAY_LIMIT = 2e3;
|
|
626
635
|
const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
@@ -650,8 +659,8 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
650
659
|
}
|
|
651
660
|
}
|
|
652
661
|
};
|
|
653
|
-
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-
|
|
654
|
-
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-
|
|
662
|
+
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-CWZUuGvA.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
|
|
663
|
+
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-Du9NhD8h.mjs").then((n) => n.a));
|
|
655
664
|
function addPayloadTextFallback(spec, payload) {
|
|
656
665
|
return spec.text ? spec : {
|
|
657
666
|
...spec,
|
|
@@ -706,7 +715,8 @@ async function resolveDiscordComponentSpec(payload) {
|
|
|
706
715
|
const interactiveSpec = (await loadDiscordSharedInteractive()).buildDiscordInteractiveComponents(payload.interactive);
|
|
707
716
|
return interactiveSpec ? addPayloadTextFallback(interactiveSpec, payload) : void 0;
|
|
708
717
|
}
|
|
709
|
-
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region extensions/discord/src/outbound-session-route.ts
|
|
710
720
|
function resolveDiscordOutboundSessionRoute(params) {
|
|
711
721
|
const parsed = parseDiscordTarget(params.target, { defaultKind: resolveDiscordOutboundTargetKindHint(params) });
|
|
712
722
|
if (!parsed) return null;
|
|
@@ -746,4 +756,5 @@ function resolveDiscordOutboundTargetKindHint(params) {
|
|
|
746
756
|
if (resolvedKind === "group" || resolvedKind === "channel") return "channel";
|
|
747
757
|
return /^(user:|discord:|@|<@!?)/i.test(params.target.trim()) ? "user" : "channel";
|
|
748
758
|
}
|
|
759
|
+
//#endregion
|
|
749
760
|
export { isDiscordExecApprovalClientEnabled as A, discordInboundEventDelivery as C, resolveRequiredDiscordChannelPermissions as D, collectDiscordAuditChannelIdsForAccount as E, getDiscordExecApprovalApprovers as O, isTrustedRequesterGuildAdminAction as S, auditDiscordChannelPermissionsWithFetcher as T, shouldIgnoreStaleDiscordRouteBinding as _, resolveDiscordComponentSpec as a, resolveDiscordRuntimeBindingConversationId as b, formatDiscordApprovalDisplayValue as c, setDiscordChannelPolicyBindings as d, buildDiscordConversationRouteContext as f, resolveDiscordEffectiveRoute as g, resolveDiscordConversationRoute as h, isDiscordComponentSpecWithinMessageLimit as i, shouldSuppressLocalDiscordExecApprovalPrompt as j, isDiscordExecApprovalApprover as k, findDiscordChannelPolicyKey as l, resolveDiscordBoundConversationRoute 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, getDiscordChannelPolicyBinding as u, resolveDiscordConversationIdentity as v, notifyDiscordInboundEventOutboundPayloadSuccess as w, discordMessageActions as x, resolveDiscordCurrentConversationIdentity as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
//#region extensions/discord/src/voice/output-activity.ts
|
|
2
2
|
function resolveDiscordOutputAudioDelta(previous, sourceAudioBytes) {
|
|
3
3
|
const sinkAudioBytes = Math.floor((previous.sourceAudioBytes + sourceAudioBytes) / 2) * 8 - previous.sinkAudioBytes;
|
|
4
4
|
return {
|
|
@@ -7,4 +7,5 @@ function resolveDiscordOutputAudioDelta(previous, sourceAudioBytes) {
|
|
|
7
7
|
sinkAudioBytes
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
+
//#endregion
|
|
10
11
|
export { resolveDiscordOutputAudioDelta as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
3
3
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
4
4
|
import { readProviderJsonObjectResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
5
5
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
6
|
-
|
|
6
|
+
//#region extensions/discord/src/pluralkit.ts
|
|
7
7
|
var pluralkit_exports = /* @__PURE__ */ __exportAll({ fetchPluralKitMessageInfo: () => fetchPluralKitMessageInfo });
|
|
8
8
|
const PLURALKIT_API_BASE = "https://api.pluralkit.me/v2";
|
|
9
9
|
const PLURALKIT_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
@@ -41,4 +41,5 @@ async function fetchPluralKitMessageInfo(params) {
|
|
|
41
41
|
timeout.cleanup();
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
//#endregion
|
|
44
45
|
export { pluralkit_exports as n, fetchPluralKitMessageInfo as t };
|