@openclaw/discord 2026.10.10 → 2026.10.33
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-BAoEELJJ.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-BMpMAeQL.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-DVe7Y3Jf.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-Dty_Ossy.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-fL1j1NiR.mjs → message-handler-CkI3yMjL.mjs} +20 -14
- package/dist/.setup/{message-handler.preflight-DkjwNZAd.mjs → message-handler.preflight-CEfkFV9U.mjs} +28 -20
- package/dist/.setup/{message-handler.preflight-pluralkit-DR4BnvMU.mjs → message-handler.preflight-pluralkit-D5si80_L.mjs} +14 -10
- package/dist/.setup/{message-handler.process-ClOwIPDK.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-BBDuE14w.mjs → provider-CI_OLfvz.mjs} +209 -119
- package/dist/.setup/{provider-session.runtime-D8hMXXqJ.mjs → provider-session.runtime-TWOo_JZx.mjs} +3 -3
- package/dist/.setup/provider.runtime-DnionCyo.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-cetognkp.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-BdbCvqnM.mjs → secret-config-contract-z6FhbT8E.mjs} +3 -2
- 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-Bp0sxD5R.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-l0UfrE6x.mjs → threading-CzjFeUSe.mjs} +9 -6
- package/dist/.setup/{timeouts-DTrUsJ_W.mjs → timeouts-CuNARfyw.mjs} +2 -1
- package/dist/.setup/{transcripts-source-CGgOaWcu.mjs → transcripts-source-8RDQrSVb.mjs} +38 -26
- package/dist/.setup/{typing-DAv4S2fI.mjs → typing-CNlSKY5S.mjs} +3 -2
- package/dist/.setup/{voice-runtime-DY1EwDfi.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-BQ1z4Aq1.mjs +0 -1
- package/dist/.setup/setup-plugin-api-B4J6wmL1.mjs +0 -2
- package/dist/.setup/targets-BaklhOqq.mjs +0 -3
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as getDiscordEndpointRuntime, k as resolveDiscordEndpointMediaGuard } from "./allow-list-
|
|
2
|
-
import { t as getDiscordRuntime } from "./runtime-
|
|
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-
|
|
1
|
+
import { D as getDiscordEndpointRuntime, k as resolveDiscordEndpointMediaGuard } from "./allow-list-BKqOldGy.mjs";
|
|
2
|
+
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
3
|
+
import { D as createDiscordLivePolicyReader, O as mapGatewayDispatchData } from "./provider-CI_OLfvz.mjs";
|
|
4
|
+
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-8RDQrSVb.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";
|
|
@@ -15,7 +15,7 @@ import { DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, createChannelIngressError, createCh
|
|
|
15
15
|
import { fanInChannelIngressLifecycles } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
16
16
|
import { createDeferred } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
17
17
|
import { createChannelInboundDebouncer, resolveInboundDebounceMs, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
|
|
18
|
-
|
|
18
|
+
//#region extensions/discord/src/monitor/ingress.ts
|
|
19
19
|
const DISCORD_INGRESS_PAYLOAD_VERSION = 1;
|
|
20
20
|
const DISCORD_INGRESS_DRAIN_INTERVAL_MS = 1e3;
|
|
21
21
|
const DiscordIngressPayloadError = createChannelIngressError("DiscordIngressPayloadError");
|
|
@@ -117,7 +117,8 @@ function createDiscordIngressMonitor(params) {
|
|
|
117
117
|
stop: monitor.stop
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region extensions/discord/src/monitor/message-avatar.ts
|
|
121
122
|
const DISCORD_AVATAR_MAX_BYTES = 262144;
|
|
122
123
|
const DISCORD_AVATAR_CACHE_MAX_ENTRIES = 128;
|
|
123
124
|
const DISCORD_GUILD_ICON_TTL_MS = 3e5;
|
|
@@ -192,8 +193,9 @@ function createDiscordAvatarResolver() {
|
|
|
192
193
|
return guildIcon?.hash ? resolveSavedAvatar(`${params.conversationId}\0${guildIcon.hash}`, discordAvatarUrl("icons", params.guildId, guildIcon.hash), endpointRuntime) : void 0;
|
|
193
194
|
} };
|
|
194
195
|
}
|
|
195
|
-
|
|
196
|
-
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region extensions/discord/src/monitor/message-run-queue.ts
|
|
198
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-DsMtetRf.mjs"));
|
|
197
199
|
async function processDiscordQueuedMessage(params) {
|
|
198
200
|
const abortSignal = params.job.context.abortSignal && params.lifecycleSignal ? AbortSignal.any([params.job.context.abortSignal, params.lifecycleSignal]) : params.job.context.abortSignal ?? params.lifecycleSignal;
|
|
199
201
|
try {
|
|
@@ -252,7 +254,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
252
254
|
};
|
|
253
255
|
if (!lifecycleActive) {
|
|
254
256
|
cleanupSkipped();
|
|
255
|
-
return;
|
|
257
|
+
return pending;
|
|
256
258
|
}
|
|
257
259
|
skippedCleanup.add(cleanupSkipped);
|
|
258
260
|
runQueue.enqueue(job.context.message.id, async ({ lifecycleSignal }) => {
|
|
@@ -267,6 +269,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
267
269
|
settlePending();
|
|
268
270
|
}
|
|
269
271
|
});
|
|
272
|
+
return pending;
|
|
270
273
|
},
|
|
271
274
|
async deactivate() {
|
|
272
275
|
runQueue.deactivate();
|
|
@@ -275,8 +278,9 @@ function createDiscordMessageRunQueue(params) {
|
|
|
275
278
|
}
|
|
276
279
|
};
|
|
277
280
|
}
|
|
278
|
-
|
|
279
|
-
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region extensions/discord/src/monitor/message-dispatcher.ts
|
|
283
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-CEfkFV9U.mjs"));
|
|
280
284
|
function createDiscordMessageDispatcher(params) {
|
|
281
285
|
const readPolicy = params.readPolicy ?? createDiscordLivePolicyReader({
|
|
282
286
|
...params,
|
|
@@ -375,7 +379,7 @@ function createDiscordMessageDispatcher(params) {
|
|
|
375
379
|
await ingress.settle();
|
|
376
380
|
return;
|
|
377
381
|
}
|
|
378
|
-
messageRunQueue.enqueue({
|
|
382
|
+
await messageRunQueue.enqueue({
|
|
379
383
|
context: ctx,
|
|
380
384
|
ingressSettlement: ingress
|
|
381
385
|
});
|
|
@@ -448,12 +452,13 @@ function createDiscordMessageDispatcher(params) {
|
|
|
448
452
|
for (const key of pendingKeys) debouncer.cancelKey(key);
|
|
449
453
|
pendingDebounceEntries.clear();
|
|
450
454
|
await Promise.allSettled(pendingCancellationSettlements);
|
|
451
|
-
await debouncer.drain();
|
|
452
455
|
await messageRunQueue.deactivate();
|
|
456
|
+
await debouncer.drain();
|
|
453
457
|
};
|
|
454
458
|
return handler;
|
|
455
459
|
}
|
|
456
|
-
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region extensions/discord/src/monitor/message-handler.ts
|
|
457
462
|
function createDiscordMessageHandler(params) {
|
|
458
463
|
const dispatcher = createDiscordMessageDispatcher(params);
|
|
459
464
|
const ingress = (params.testing?.createIngressMonitor ?? createDiscordIngressMonitor)({
|
|
@@ -484,4 +489,5 @@ function createDiscordMessageHandler(params) {
|
|
|
484
489
|
};
|
|
485
490
|
return handler;
|
|
486
491
|
}
|
|
492
|
+
//#endregion
|
|
487
493
|
export { createDiscordMessageHandler as t };
|
|
@@ -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-ClOwIPDK.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 };
|