@openclaw/discord 2026.11.7 → 2026.11.9
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-DGkdWwix.mjs → account-inspect-CSz5Qodj.mjs} +2 -3
- package/dist/.setup/{accounts-C_25wyxC.mjs → accounts-DtjvhJUj.mjs} +4 -8
- package/dist/.setup/{active-turn-thread-route-KvRTAVE3.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
- package/dist/.setup/{allow-list-C3j0qLDp.mjs → allow-list-CkqpzPvP.mjs} +4 -8
- package/dist/.setup/{api-DYRggUgK.mjs → api-C4j_kC-2.mjs} +4 -6
- package/dist/.setup/{approval-handler.runtime-BN4W1r0o.mjs → approval-handler.runtime-bB4eKcGl.mjs} +9 -10
- package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs} +3 -4
- package/dist/.setup/{audit-BL6EoUun.mjs → audit-D1UISAXW.mjs} +6 -7
- package/dist/.setup/{channel-access-9cyzozUP.mjs → channel-access-DhJhVrdZ.mjs} +1 -2
- package/dist/.setup/{channel-DdI2l55_.mjs → channel-i4V5w1Nh.mjs} +35 -41
- package/dist/.setup/{channel.setup-kNWMxlgu.mjs → channel.setup-BrGEJ0Ia.mjs} +7 -10
- package/dist/.setup/{command-deploy-store-DFkBTViB.mjs → command-deploy-store-DPWiBMks.mjs} +1 -2
- package/dist/.setup/{command-owners-C7rUdqUX.mjs → command-owners-BzlhNBxA.mjs} +1 -2
- package/dist/.setup/{components-C1Phe3uw.mjs → components-DeCLO9w0.mjs} +10 -16
- package/dist/.setup/{components.base-CiS0h_XP.mjs → components.base-C5sAPHe4.mjs} +1 -2
- package/dist/.setup/{config-schema-BNKN1cu5.mjs → config-schema-GX2yDgIH.mjs} +3 -5
- package/dist/.setup/{conversation-binding-route-K_jFbvi5.mjs → conversation-binding-route-CHCfhsCl.mjs} +2 -3
- package/dist/.setup/{directory-config-Ble81PWH.mjs → directory-config-BXJuh9-J.mjs} +3 -4
- package/dist/.setup/{directory-live-CY2-qrHI.mjs → directory-live-dzJ14-DT.mjs} +9 -64
- package/dist/.setup/{discord-BRVFhk09.mjs → discord-BGkLzt2b.mjs} +93 -72
- package/dist/.setup/{doctor-RqH-6JB0.mjs → doctor-DBBXoP9w.mjs} +7 -8
- package/dist/.setup/{doctor-contract-Bwv8EuQ_.mjs → doctor-contract-Dstl3cMg.mjs} +2 -3
- package/dist/.setup/{endpoint-runtime-lf4DeLas.mjs → endpoint-runtime-BM3x-m6O.mjs} +1 -2
- package/dist/.setup/{guilds-BSnrns-F.mjs → guilds-DYBhgnfq.mjs} +3 -4
- package/dist/.setup/{handle-action-uD87h2FK.mjs → handle-action-Dx2N-4A6.mjs} +11 -11
- package/dist/.setup/{handle-action.guild-admin-CqBx_3mG.mjs → handle-action.guild-admin-CGzsE3bM.mjs} +7 -5
- package/dist/.setup/{listeners-DnHLrLIN.mjs → listeners-DHjDOlXW.mjs} +2 -3
- package/dist/.setup/{live-policy-config-y0Qy36X3.mjs → live-policy-config-DjIHWFla.mjs} +3 -5
- package/dist/.setup/{message-handler-CWL_u0X8.mjs → message-handler-OqhwO2Il.mjs} +11 -15
- package/dist/.setup/{message-handler.preflight-83tpEdBG.mjs → message-handler.preflight-DaqozzfW.mjs} +20 -43
- package/dist/.setup/{message-handler.preflight-pluralkit-Dhcx7Ifz.mjs → message-handler.preflight-pluralkit-CPWdqrEU.mjs} +10 -14
- package/dist/.setup/{message-handler.process-BC-wNZwK.mjs → message-handler.process-C6ETXKq2.mjs} +26 -34
- package/dist/.setup/{outbound-payload-CK3_bDvK.mjs → outbound-payload-DOFjmMNE.mjs} +9 -11
- package/dist/.setup/{outbound-session-route-Ay_DnOOl.mjs → outbound-session-route-CzL157kC.mjs} +22 -34
- package/dist/.setup/{output-activity-uBpMSX75.mjs → output-activity-CDgs2s3O.mjs} +1 -2
- package/dist/.setup/{pluralkit-B64dfq_j.mjs → pluralkit-DcXbHTpQ.mjs} +2 -3
- package/dist/.setup/{preflight-audio-C6QtD6HX.mjs → preflight-audio-r4BbaJxh.mjs} +1 -2
- package/dist/.setup/{presence-cache-Dq-3nH7R.mjs → presence-cache-B3xj3b0l.mjs} +1 -2
- package/dist/.setup/{probe-CbDJojNV.mjs → probe-CfGMZwFD.mjs} +5 -6
- package/dist/.setup/{provider-CRb3Myky.mjs → provider-BcSZ6vqo.mjs} +110 -186
- package/dist/.setup/{provider-session.runtime-3cZpps3H.mjs → provider-session.runtime-CxGNqH7Q.mjs} +3 -3
- package/dist/.setup/provider.runtime-DPhNybGw.mjs +1 -0
- package/dist/.setup/{proxy-fetch-BzXwBAXt.mjs → proxy-fetch-B8cK6FLQ.mjs} +1 -2
- package/dist/.setup/{realtime-session.runtime-BRYpjS9P.mjs → realtime-session.runtime-Carw2Z1J.mjs} +15 -25
- package/dist/.setup/{receive-recovery-C3Ks4wAQ.mjs → receive-recovery-DV_v5ROf.mjs} +3 -6
- package/dist/.setup/{resolve-allowlist-common-B-S0wRIw.mjs → resolve-allowlist-common-CYdqBUgV.mjs} +3 -4
- package/dist/.setup/{resolve-channels-g16NM6Ho.mjs → resolve-channels-BNnyfCR8.mjs} +6 -7
- package/dist/.setup/{resolve-users-DAfOOXdy.mjs → resolve-users-CDMAGrzv.mjs} +5 -6
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime-BMgTyuwg.mjs → runtime-B-PgPsGR.mjs} +4 -6
- package/dist/.setup/{runtime--HZ9r3tF.mjs → runtime-BJxDx_zr.mjs} +49 -47
- package/dist/.setup/{runtime-DgnVQ7zW.mjs → runtime-DcBvHOm1.mjs} +1 -2
- package/dist/.setup/{runtime-doctor-migrations-BPV-R4G9.mjs → runtime-doctor-migrations-BpV1jKk0.mjs} +5 -9
- package/dist/.setup/{secret-config-contract-B1kE4sDv.mjs → secret-config-contract-CP6teHec.mjs} +1 -2
- package/dist/.setup/{security-audit-BFT84Uny.mjs → security-audit-CTwisG7c.mjs} +3 -4
- package/dist/.setup/{security-contract-DNyyjTZZ.mjs → security-contract-D-o0iWDk.mjs} +1 -2
- package/dist/.setup/{security-doctor-nGgPm65L.mjs → security-doctor-4s7omTZd.mjs} +1 -2
- package/dist/.setup/{send-CtvwfZQ2.mjs → send-BQtMCED2.mjs} +19 -28
- package/dist/.setup/{send.components-CtLtE0yD.mjs → send.components-BTjOU5BX.mjs} +11 -14
- package/dist/.setup/{send.outbound-D58xXPgs.mjs → send.outbound-izfb48w-.mjs} +10 -16
- package/dist/.setup/{send.receipt-DLOV4qx6.mjs → send.receipt-D0vpuJMr.mjs} +64 -17
- package/dist/.setup/{send.shared-B_KKRrD7.mjs → send.shared-BVJkIe93.mjs} +15 -20
- package/dist/.setup/{sender-identity-BbA7FNbr.mjs → sender-identity-Dt5ELjRN.mjs} +2 -3
- package/dist/.setup/{session-contract-BO5tlIdl.mjs → session-contract-Bq71MS78.mjs} +1 -2
- package/dist/.setup/{session-key-normalization-CCHGNSQw.mjs → session-key-normalization-Cfvze5hd.mjs} +1 -2
- package/dist/.setup/setup-plugin-api-DCiNtEra.mjs +2 -0
- package/dist/.setup/{shared-Dv2DamaK.mjs → shared-djlPz0hY.mjs} +14 -17
- package/dist/.setup/{shared-interactive-DmzaoKOM.mjs → shared-interactive-DKBw4SNV.mjs} +7 -12
- package/dist/.setup/{subagent-hooks-yT45eTyz.mjs → subagent-hooks-BTmMGFYh.mjs} +3 -4
- package/dist/.setup/{system-events-Dlzp9Jcj.mjs → system-events-LN3PXCia.mjs} +3 -4
- package/dist/.setup/{target-parsing-C-HyNxcE.mjs → target-parsing-BiuhcK9Q.mjs} +1 -2
- package/dist/.setup/{target-resolver-BzaZPBm9.mjs → target-resolver-C98DQ-sp.mjs} +6 -7
- package/dist/.setup/{thread-binding-api-BDZJD4na.mjs → thread-binding-api-Drd4Zu-5.mjs} +1 -2
- package/dist/.setup/{thread-bindings-DRWhgKCc.mjs → thread-bindings-ESkVljSW.mjs} +7 -10
- package/dist/.setup/{thread-bindings.manager-CWJKirn1.mjs → thread-bindings.manager-BG7MMT7H.mjs} +15 -20
- package/dist/.setup/{thread-bindings.session-updates-DzJrXc4w.mjs → thread-bindings.session-updates-Ddn14oJa.mjs} +6 -10
- package/dist/.setup/{threading-BbsPuT5G.mjs → threading-BzxVQcv8.mjs} +5 -7
- package/dist/.setup/{timeouts-cIxzatmv.mjs → timeouts-CT9hnmo4.mjs} +1 -2
- package/dist/.setup/{transcripts-source-DIW1fU_P.mjs → transcripts-source-a1btN-pC.mjs} +20 -33
- package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
- package/dist/.setup/{voice-runtime-oJ6BZs5D.mjs → voice-runtime-BI76hQQH.mjs} +28 -46
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +2 -3
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +9 -13
- package/dist/api.js +21 -22
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/directory-contract-api.js +2 -3
- package/dist/doctor-contract-api.js +5 -7
- package/dist/index.js +1 -2
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-entry.js +2 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +8 -14
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/transcripts-source-api.js +2 -3
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-tmkt3QOg.mjs +0 -1
- package/dist/.setup/setup-plugin-api-ty5RJrMy.mjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as normalizeDiscordAllowList } from "./allow-list-
|
|
1
|
+
import { i as normalizeDiscordAllowList } from "./allow-list-CkqpzPvP.mjs";
|
|
2
2
|
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
3
|
-
|
|
3
|
+
// extensions/discord/src/monitor/ingress-identity.ts
|
|
4
4
|
const DISCORD_ALLOW_LIST_PREFIXES = [
|
|
5
5
|
"discord:",
|
|
6
6
|
"user:",
|
|
@@ -54,8 +54,7 @@ const discordIngressIdentity = defineStableChannelIngressIdentity({
|
|
|
54
54
|
sensitivity: "pii"
|
|
55
55
|
}))
|
|
56
56
|
});
|
|
57
|
-
|
|
58
|
-
//#region extensions/discord/src/live-policy-config.ts
|
|
57
|
+
// extensions/discord/src/live-policy-config.ts
|
|
59
58
|
/** Account policy consumed at inbound admission, without replacing the transport. */
|
|
60
59
|
function selectDiscordLivePolicyConfig(config) {
|
|
61
60
|
return {
|
|
@@ -68,5 +67,4 @@ function selectDiscordLivePolicyConfig(config) {
|
|
|
68
67
|
dangerouslyAllowNameMatching: config.dangerouslyAllowNameMatching
|
|
69
68
|
};
|
|
70
69
|
}
|
|
71
|
-
//#endregion
|
|
72
70
|
export { discordIngressIdentity as n, selectDiscordLivePolicyConfig as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { q as withDiscordRequestAuthority } from "./discord-
|
|
2
|
-
import { i as resolveDiscordEndpointMediaGuard, n as getDiscordEndpointRuntime } from "./endpoint-runtime-
|
|
3
|
-
import { t as getDiscordRuntime } from "./runtime-
|
|
4
|
-
import { D as createMessageDispatchData, E as createDiscordLivePolicyReader } from "./provider-
|
|
5
|
-
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-
|
|
1
|
+
import { q as withDiscordRequestAuthority } from "./discord-BGkLzt2b.mjs";
|
|
2
|
+
import { i as resolveDiscordEndpointMediaGuard, n as getDiscordEndpointRuntime } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
3
|
+
import { t as getDiscordRuntime } from "./runtime-DcBvHOm1.mjs";
|
|
4
|
+
import { D as createMessageDispatchData, E as createDiscordLivePolicyReader } from "./provider-BcSZ6vqo.mjs";
|
|
5
|
+
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-a1btN-pC.mjs";
|
|
6
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
8
8
|
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -17,7 +17,7 @@ import { DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, createChannelIngressError, createCh
|
|
|
17
17
|
import { racePromiseWithAbortSignal } from "openclaw/plugin-sdk/time-runtime";
|
|
18
18
|
import { fanInChannelIngressLifecycles, prepareChannelIngressEvent } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
19
19
|
import { createChannelInboundDebouncer, resolveInboundDebounceMs, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
|
|
20
|
-
|
|
20
|
+
// extensions/discord/src/monitor/ingress.ts
|
|
21
21
|
const DISCORD_INGRESS_PAYLOAD_VERSION = 1;
|
|
22
22
|
const DISCORD_INGRESS_DRAIN_INTERVAL_MS = 1e3;
|
|
23
23
|
const DiscordIngressPayloadError = createChannelIngressError("DiscordIngressPayloadError");
|
|
@@ -139,8 +139,7 @@ function createDiscordIngressMonitor(params) {
|
|
|
139
139
|
stop: monitor.stop
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
//#region extensions/discord/src/monitor/message-avatar.ts
|
|
142
|
+
// extensions/discord/src/monitor/message-avatar.ts
|
|
144
143
|
const DISCORD_AVATAR_MAX_BYTES = 262144;
|
|
145
144
|
const DISCORD_AVATAR_CACHE_MAX_ENTRIES = 128;
|
|
146
145
|
const DISCORD_GUILD_ICON_TTL_MS = 3e5;
|
|
@@ -215,10 +214,9 @@ function createDiscordAvatarResolver() {
|
|
|
215
214
|
return guildIcon?.hash ? resolveSavedAvatar(`${params.conversationId}\0${guildIcon.hash}`, discordAvatarUrl("icons", params.guildId, guildIcon.hash), endpointRuntime) : void 0;
|
|
216
215
|
} };
|
|
217
216
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-BC-wNZwK.mjs"));
|
|
217
|
+
// extensions/discord/src/monitor/message-dispatcher.ts
|
|
218
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-DaqozzfW.mjs"));
|
|
219
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-C6ETXKq2.mjs"));
|
|
222
220
|
function createDiscordMessageDispatcher(params) {
|
|
223
221
|
const readPolicy = params.readPolicy ?? createDiscordLivePolicyReader({
|
|
224
222
|
...params,
|
|
@@ -495,8 +493,7 @@ function createDiscordMessageDispatcher(params) {
|
|
|
495
493
|
};
|
|
496
494
|
return handler;
|
|
497
495
|
}
|
|
498
|
-
|
|
499
|
-
//#region extensions/discord/src/monitor/message-handler.ts
|
|
496
|
+
// extensions/discord/src/monitor/message-handler.ts
|
|
500
497
|
function createDiscordMessageHandler(params) {
|
|
501
498
|
const dispatcher = createDiscordMessageDispatcher(params);
|
|
502
499
|
const ingress = createDiscordIngressMonitor({
|
|
@@ -528,5 +525,4 @@ function createDiscordMessageHandler(params) {
|
|
|
528
525
|
};
|
|
529
526
|
return handler;
|
|
530
527
|
}
|
|
531
|
-
//#endregion
|
|
532
528
|
export { createDiscordMessageHandler as t };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { h as Message, k as getChannelMessage, t as discord_exports } from "./discord-
|
|
3
|
-
import { S as formatDiscordUserTag, a as normalizeDiscordDisplaySlug, f as resolveDiscordGuildEntry, h as resolveDiscordMentionPolicy, l as resolveDiscordChannelConfigWithFallback, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState } from "./allow-list-
|
|
4
|
-
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
5
|
-
import {
|
|
6
|
-
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-
|
|
7
|
-
import { n as resolveDiscordChannelNameSafe } from "./channel-access-
|
|
8
|
-
import { A as resolveDiscordTextCommandAccess, T as handleDiscordDmCommandDecision, k as resolveDiscordDmCommandAccess, 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, n as loadDiscordThreadingRuntime, p as shouldIgnoreBoundThreadWebhookMessage, r as loadPreflightAudioRuntime, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo, u as isDiscordThreadChannelMessage } from "./message-handler.preflight-pluralkit-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { h as Message, k as getChannelMessage, t as discord_exports } from "./discord-BGkLzt2b.mjs";
|
|
3
|
+
import { S as formatDiscordUserTag, a as normalizeDiscordDisplaySlug, f as resolveDiscordGuildEntry, h as resolveDiscordMentionPolicy, l as resolveDiscordChannelConfigWithFallback, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState } from "./allow-list-CkqpzPvP.mjs";
|
|
4
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-CT9hnmo4.mjs";
|
|
5
|
+
import { h as resolveDiscordEffectiveRoute, m as resolveDiscordConversationRoute, p as buildDiscordRoutePeer, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-CzL157kC.mjs";
|
|
6
|
+
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-CHCfhsCl.mjs";
|
|
7
|
+
import { n as resolveDiscordChannelNameSafe } from "./channel-access-DhJhVrdZ.mjs";
|
|
8
|
+
import { A as resolveDiscordTextCommandAccess, T as handleDiscordDmCommandDecision, k as resolveDiscordDmCommandAccess, n as resolveDiscordPreflightChannelAccess } from "./provider-BcSZ6vqo.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-a1btN-pC.mjs";
|
|
10
|
+
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-Dt5ELjRN.mjs";
|
|
11
|
+
import { a as createDiscordHistorySenderProvenance, c as hasRawDiscordUserMention, d as matchesActiveDiscordMentionPatterns, f as resolveDiscordMentionState, i as loadSystemEventsRuntime, l as isBoundThreadBotSystemMessage, n as loadDiscordThreadingRuntime, p as shouldIgnoreBoundThreadWebhookMessage, r as loadPreflightAudioRuntime, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo, u as isDiscordThreadChannelMessage } from "./message-handler.preflight-pluralkit-CPWdqrEU.mjs";
|
|
12
12
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
13
13
|
import { getChildLogger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
14
14
|
import { MessageReferenceType, MessageType } from "discord-api-types/v10";
|
|
@@ -24,23 +24,14 @@ 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
|
+
// 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-BQtMCED2.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)");
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
-
const directBindingConversationId = resolveDiscordConversationIdentity({
|
|
36
|
-
isDirectMessage: true,
|
|
37
|
-
userId: params.author.id
|
|
38
|
-
}) ?? `user:${params.author.id}`;
|
|
39
|
-
const directBindingRecord = await (await loadConversationRuntime$1()).getSessionBindingService().resolveByConversationAsync({
|
|
40
|
-
channel: "discord",
|
|
41
|
-
accountId: params.preflight.accountId,
|
|
42
|
-
conversationId: directBindingConversationId
|
|
43
|
-
});
|
|
44
35
|
const resolveChannelIngress = async (contextBinding, conversation) => await resolveDiscordDmCommandAccess({
|
|
45
36
|
accountId: params.resolvedAccountId,
|
|
46
37
|
dmPolicy: params.dmPolicy,
|
|
@@ -63,18 +54,11 @@ async function resolveDiscordDmPreflightAccess(params) {
|
|
|
63
54
|
});
|
|
64
55
|
const dmAccess = await resolveChannelIngress();
|
|
65
56
|
if (params.preflight.isPolicyCurrent?.() === false) return null;
|
|
66
|
-
const commandAuthorized = dmAccess.senderAccess.allowed && dmAccess.commandAccess.authorized
|
|
57
|
+
const commandAuthorized = dmAccess.senderAccess.allowed && dmAccess.commandAccess.authorized;
|
|
67
58
|
if (dmAccess.senderAccess.decision === "allow") return {
|
|
68
59
|
commandAuthorized,
|
|
69
60
|
resolveChannelIngress
|
|
70
61
|
};
|
|
71
|
-
if (directBindingRecord) {
|
|
72
|
-
logVerbose(`discord: allow bound DM conversation ${directBindingConversationId} despite dmPolicy=${params.dmPolicy}`);
|
|
73
|
-
return {
|
|
74
|
-
commandAuthorized,
|
|
75
|
-
resolveChannelIngress
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
62
|
await handleDiscordDmCommandDecision({
|
|
79
63
|
senderAccess: dmAccess.senderAccess,
|
|
80
64
|
accountId: params.resolvedAccountId,
|
|
@@ -108,8 +92,7 @@ async function resolveDiscordDmPreflightAccess(params) {
|
|
|
108
92
|
});
|
|
109
93
|
return null;
|
|
110
94
|
}
|
|
111
|
-
|
|
112
|
-
//#region extensions/discord/src/monitor/message-handler.hydration.ts
|
|
95
|
+
// extensions/discord/src/monitor/message-handler.hydration.ts
|
|
113
96
|
function shouldHydrateDiscordMessagePayload(message) {
|
|
114
97
|
let currentText;
|
|
115
98
|
try {
|
|
@@ -180,8 +163,7 @@ async function hydrateDiscordMessageIfNeeded(params) {
|
|
|
180
163
|
})
|
|
181
164
|
};
|
|
182
165
|
}
|
|
183
|
-
|
|
184
|
-
//#region extensions/discord/src/monitor/message-handler.preflight-channel-context.ts
|
|
166
|
+
// extensions/discord/src/monitor/message-handler.preflight-channel-context.ts
|
|
185
167
|
function resolveDiscordPreflightChannelContext(params) {
|
|
186
168
|
const threadName = params.threadChannel?.name;
|
|
187
169
|
const displayChannelName = threadName ?? params.channelName;
|
|
@@ -204,8 +186,7 @@ function resolveDiscordPreflightChannelContext(params) {
|
|
|
204
186
|
}) : null
|
|
205
187
|
};
|
|
206
188
|
}
|
|
207
|
-
|
|
208
|
-
//#region extensions/discord/src/monitor/message-handler.preflight-history.ts
|
|
189
|
+
// extensions/discord/src/monitor/message-handler.preflight-history.ts
|
|
209
190
|
function buildDiscordPreflightHistoryEntry(params) {
|
|
210
191
|
const textForHistory = resolveDiscordMessageHistoryText(params.message, { includeForwarded: true });
|
|
211
192
|
return params.isGuildMessage && params.historyLimit > 0 && textForHistory ? {
|
|
@@ -217,8 +198,7 @@ function buildDiscordPreflightHistoryEntry(params) {
|
|
|
217
198
|
senderProvenance: createDiscordHistorySenderProvenance(params)
|
|
218
199
|
} : void 0;
|
|
219
200
|
}
|
|
220
|
-
|
|
221
|
-
//#region extensions/discord/src/monitor/message-handler.preflight-thread.ts
|
|
201
|
+
// extensions/discord/src/monitor/message-handler.preflight-thread.ts
|
|
222
202
|
async function resolveDiscordPreflightThreadContext(params) {
|
|
223
203
|
const { resolveDiscordThreadChannel, resolveDiscordThreadParentInfo } = await loadDiscordThreadingRuntime();
|
|
224
204
|
const earlyThreadChannel = resolveDiscordThreadChannel(params);
|
|
@@ -236,8 +216,7 @@ async function resolveDiscordPreflightThreadContext(params) {
|
|
|
236
216
|
earlyThreadParentType: parentInfo.type
|
|
237
217
|
};
|
|
238
218
|
}
|
|
239
|
-
|
|
240
|
-
//#region extensions/discord/src/monitor/message-handler.routing-preflight.ts
|
|
219
|
+
// extensions/discord/src/monitor/message-handler.routing-preflight.ts
|
|
241
220
|
const loadConversationRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
|
|
242
221
|
async function resolveDiscordPreflightRoute(params) {
|
|
243
222
|
const conversationRuntime = await loadConversationRuntime();
|
|
@@ -287,8 +266,7 @@ async function resolveDiscordPreflightRoute(params) {
|
|
|
287
266
|
baseSessionKey: effectiveRoute.sessionKey
|
|
288
267
|
};
|
|
289
268
|
}
|
|
290
|
-
|
|
291
|
-
//#region extensions/discord/src/monitor/message-handler.preflight.ts
|
|
269
|
+
// extensions/discord/src/monitor/message-handler.preflight.ts
|
|
292
270
|
const DISCORD_HISTORY_MEDIA_MAX_ATTACHMENTS = 4;
|
|
293
271
|
const DISCORD_HISTORY_MEDIA_MAX_BYTES = 10485760;
|
|
294
272
|
const DISCORD_HISTORY_MEDIA_IDLE_TIMEOUT_MS = 1e3;
|
|
@@ -817,5 +795,4 @@ async function preflightDiscordMessage(params) {
|
|
|
817
795
|
canDetectMention
|
|
818
796
|
};
|
|
819
797
|
}
|
|
820
|
-
//#endregion
|
|
821
798
|
export { preflightDiscordMessage };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { w as isDiscordThreadChannelType } from "./allow-list-
|
|
2
|
-
import { D as resolveDiscordMessageStickers } from "./transcripts-source-
|
|
1
|
+
import { w as isDiscordThreadChannelType } from "./allow-list-CkqpzPvP.mjs";
|
|
2
|
+
import { D as resolveDiscordMessageStickers } from "./transcripts-source-a1btN-pC.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
|
+
// extensions/discord/src/monitor/message-handler.preflight-helpers.ts
|
|
10
10
|
const DISCORD_BOUND_THREAD_SYSTEM_PREFIXES = [
|
|
11
11
|
"⚙️",
|
|
12
12
|
"🤖",
|
|
@@ -74,8 +74,7 @@ function shouldIgnoreBoundThreadWebhookMessage(params) {
|
|
|
74
74
|
const threadId = normalizeOptionalString(params.threadId) ?? "";
|
|
75
75
|
return Boolean(threadId && params.threadBinding);
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
//#region extensions/discord/src/monitor/message-handler.history.ts
|
|
77
|
+
// extensions/discord/src/monitor/message-handler.history.ts
|
|
79
78
|
function createDiscordHistorySenderProvenance(params) {
|
|
80
79
|
return Object.freeze({
|
|
81
80
|
id: params.sender.id,
|
|
@@ -96,14 +95,12 @@ function filterDiscordHistoryEntriesForContext(params) {
|
|
|
96
95
|
function resolveDiscordHistoryMediaIds(message) {
|
|
97
96
|
return [...(message.attachments ?? []).map((attachment) => `attachment:${attachment.id}`), ...resolveDiscordMessageStickers(message).map((sticker) => `sticker:${sticker.id}`)];
|
|
98
97
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region extensions/discord/src/monitor/message-handler.preflight-pluralkit.ts
|
|
98
|
+
// extensions/discord/src/monitor/message-handler.preflight-runtime.ts
|
|
99
|
+
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-DcXbHTpQ.mjs").then((n) => n.n));
|
|
100
|
+
const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-r4BbaJxh.mjs"));
|
|
101
|
+
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-LN3PXCia.mjs"));
|
|
102
|
+
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-BzxVQcv8.mjs").then((n) => n.t));
|
|
103
|
+
// extensions/discord/src/monitor/message-handler.preflight-pluralkit.ts
|
|
107
104
|
async function resolveDiscordPreflightPluralKitInfo(params) {
|
|
108
105
|
if (!params.config?.enabled || !params.webhookId) return null;
|
|
109
106
|
try {
|
|
@@ -119,5 +116,4 @@ async function resolveDiscordPreflightPluralKitInfo(params) {
|
|
|
119
116
|
return null;
|
|
120
117
|
}
|
|
121
118
|
}
|
|
122
|
-
//#endregion
|
|
123
119
|
export { createDiscordHistorySenderProvenance as a, hasRawDiscordUserMention as c, matchesActiveDiscordMentionPatterns as d, resolveDiscordMentionState as f, loadSystemEventsRuntime as i, isBoundThreadBotSystemMessage as l, loadDiscordThreadingRuntime as n, filterDiscordHistoryEntriesForContext as o, shouldIgnoreBoundThreadWebhookMessage as p, loadPreflightAudioRuntime as r, resolveDiscordHistoryMediaIds as s, resolveDiscordPreflightPluralKitInfo as t, isDiscordThreadChannelMessage as u };
|
package/dist/.setup/{message-handler.process-BC-wNZwK.mjs → message-handler.process-C6ETXKq2.mjs}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { m as resolveDiscordMaxLinesPerMessage } from "./accounts-
|
|
2
|
-
import { N as createDiscordRestClient, O as resolveDiscordMessageFlags, P as createDiscordRuntimeAccountContext, u as resolveDiscordTargetChannelId } from "./send.shared-
|
|
3
|
-
import { D as editChannelMessage, E as deleteChannelMessage, K as captureDiscordRequestAuthority, P as getGuildMember, h as Message, q as withDiscordRequestAuthority, t as discord_exports } from "./discord-
|
|
4
|
-
import { i as normalizeDiscordAllowList, o as normalizeDiscordSlug } from "./allow-list-
|
|
5
|
-
import {
|
|
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 { S as discordInboundEventDelivery, _ as resolveDiscordConversationIdentity, p as buildDiscordRoutePeer } from "./outbound-session-route-
|
|
11
|
-
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-payload-
|
|
12
|
-
import { C as buildDiscordInboundAccessContext, c as formatDiscordReplySkip, d as buildGuildLabel, f as resolveReplyContext, l as sanitizeDiscordFrontChannelReplyPayloads, o as deliverDiscordReply, s as formatDiscordReplyDeliveryFailure, u as buildDirectLabel, w as createDiscordSupplementalContextAccessChecker } from "./provider-
|
|
13
|
-
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-
|
|
14
|
-
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-
|
|
15
|
-
import { n as resolveDiscordAutoThreadReplyPlan } from "./threading-
|
|
16
|
-
import { t as beginDiscordActiveTurnThreadRoute } from "./active-turn-thread-route-
|
|
17
|
-
import { a as createDiscordHistorySenderProvenance, l as isBoundThreadBotSystemMessage, o as filterDiscordHistoryEntriesForContext, p as shouldIgnoreBoundThreadWebhookMessage, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo } from "./message-handler.preflight-pluralkit-
|
|
18
|
-
import { t as sendTyping } from "./typing-
|
|
1
|
+
import { m as resolveDiscordMaxLinesPerMessage } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { N as createDiscordRestClient, O as resolveDiscordMessageFlags, P as createDiscordRuntimeAccountContext, u as resolveDiscordTargetChannelId } from "./send.shared-BVJkIe93.mjs";
|
|
3
|
+
import { D as editChannelMessage, E as deleteChannelMessage, K as captureDiscordRequestAuthority, P as getGuildMember, h as Message, q as withDiscordRequestAuthority, t as discord_exports } from "./discord-BGkLzt2b.mjs";
|
|
4
|
+
import { i as normalizeDiscordAllowList, o as normalizeDiscordSlug } from "./allow-list-CkqpzPvP.mjs";
|
|
5
|
+
import { S as chunkDiscordTextWithMode, y as createDiscordRetryRunner } from "./send.receipt-D0vpuJMr.mjs";
|
|
6
|
+
import { n as resolveDiscordChannelId } from "./target-parsing-BiuhcK9Q.mjs";
|
|
7
|
+
import { a as removeReactionDiscord, r as reactMessageDiscord } from "./send-BQtMCED2.mjs";
|
|
8
|
+
import { o as discordTextHasBroadcastMention } from "./send.outbound-izfb48w-.mjs";
|
|
9
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-CT9hnmo4.mjs";
|
|
10
|
+
import { S as discordInboundEventDelivery, _ as resolveDiscordConversationIdentity, p as buildDiscordRoutePeer } from "./outbound-session-route-CzL157kC.mjs";
|
|
11
|
+
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-payload-DOFjmMNE.mjs";
|
|
12
|
+
import { C as buildDiscordInboundAccessContext, c as formatDiscordReplySkip, d as buildGuildLabel, f as resolveReplyContext, l as sanitizeDiscordFrontChannelReplyPayloads, o as deliverDiscordReply, s as formatDiscordReplyDeliveryFailure, u as buildDirectLabel, w as createDiscordSupplementalContextAccessChecker } from "./provider-BcSZ6vqo.mjs";
|
|
13
|
+
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-a1btN-pC.mjs";
|
|
14
|
+
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-Dt5ELjRN.mjs";
|
|
15
|
+
import { n as resolveDiscordAutoThreadReplyPlan } from "./threading-BzxVQcv8.mjs";
|
|
16
|
+
import { t as beginDiscordActiveTurnThreadRoute } from "./active-turn-thread-route-DkPnk2x8.mjs";
|
|
17
|
+
import { a as createDiscordHistorySenderProvenance, l as isBoundThreadBotSystemMessage, o as filterDiscordHistoryEntriesForContext, p as shouldIgnoreBoundThreadWebhookMessage, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo } from "./message-handler.preflight-pluralkit-CPWdqrEU.mjs";
|
|
18
|
+
import { t as sendTyping } from "./typing-DAv4S2fI.mjs";
|
|
19
19
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
20
20
|
import { danger, logVerbose, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
21
21
|
import { buildAgentSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
@@ -43,7 +43,7 @@ import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context
|
|
|
43
43
|
import { formatAudioTranscriptForAgent } from "openclaw/plugin-sdk/media-understanding-runtime";
|
|
44
44
|
import { isReplySessionInitConflictError } from "openclaw/plugin-sdk/reply-runtime";
|
|
45
45
|
import { createStatusReactionController, logAckFailure, logTypingFailure, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
|
|
46
|
-
|
|
46
|
+
// extensions/discord/src/monitor/message-handler.recent-history.ts
|
|
47
47
|
/** Fetch a physical recent window, never walking older pages to refill filtered rows. */
|
|
48
48
|
async function recoverDiscordChannelHistory(params) {
|
|
49
49
|
const { ctx, isCurrent } = params;
|
|
@@ -150,8 +150,7 @@ async function recoverDiscordChannelHistory(params) {
|
|
|
150
150
|
return [];
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
|
|
154
|
-
//#region extensions/discord/src/monitor/message-handler.retry.ts
|
|
153
|
+
// extensions/discord/src/monitor/message-handler.retry.ts
|
|
155
154
|
const DISCORD_SESSION_CONFLICT_FAILURE_TEXT = "⚠️ Couldn't process this message because the session stayed busy. Please try again in a moment.";
|
|
156
155
|
async function completeDiscordSessionConflict(error, sourceReplyDeliveryMode, deliver, onDeliveryError) {
|
|
157
156
|
if (!isReplySessionInitConflictError(error)) return;
|
|
@@ -171,8 +170,7 @@ function removeDiscordReplayHistoryEntry(historyMap, historyKey, messageId) {
|
|
|
171
170
|
if (!history) return;
|
|
172
171
|
for (let index = history.length - 1; index >= 0; index -= 1) if (history[index]?.messageId === messageId) history.splice(index, 1);
|
|
173
172
|
}
|
|
174
|
-
|
|
175
|
-
//#region extensions/discord/src/monitor/message-handler.context.ts
|
|
173
|
+
// extensions/discord/src/monitor/message-handler.context.ts
|
|
176
174
|
function normalizeDiscordDmOwnerEntry(entry) {
|
|
177
175
|
const candidate = normalizeDiscordAllowList([entry], [
|
|
178
176
|
"discord:",
|
|
@@ -585,8 +583,7 @@ async function buildDiscordMessageProcessContext(params) {
|
|
|
585
583
|
replyPlan
|
|
586
584
|
};
|
|
587
585
|
}
|
|
588
|
-
|
|
589
|
-
//#region extensions/discord/src/monitor/message-handler.process-reactions.ts
|
|
586
|
+
// extensions/discord/src/monitor/message-handler.process-reactions.ts
|
|
590
587
|
function createDiscordMessageReactionRuntime(params) {
|
|
591
588
|
const { ctx } = params;
|
|
592
589
|
const { cfg, accountId, token, ackReactionScope, message, messageChannelId, isGuildMessage, isDirectMessage, isGroupDm, canDetectMention, effectiveWasMentioned, shouldBypassMention, route } = ctx;
|
|
@@ -715,8 +712,7 @@ function createDiscordMessageReactionRuntime(params) {
|
|
|
715
712
|
finish
|
|
716
713
|
};
|
|
717
714
|
}
|
|
718
|
-
|
|
719
|
-
//#region extensions/discord/src/draft-stream.ts
|
|
715
|
+
// extensions/discord/src/draft-stream.ts
|
|
720
716
|
/** Discord messages cap at 2000 characters. */
|
|
721
717
|
const DISCORD_STREAM_MAX_CHARS = 2e3;
|
|
722
718
|
const DEFAULT_THROTTLE_MS = 1200;
|
|
@@ -854,8 +850,7 @@ function createDiscordDraftStream(params) {
|
|
|
854
850
|
forceNewMessage: lifecycle.reset
|
|
855
851
|
};
|
|
856
852
|
}
|
|
857
|
-
|
|
858
|
-
//#region extensions/discord/src/monitor/message-handler.draft-preview.ts
|
|
853
|
+
// extensions/discord/src/monitor/message-handler.draft-preview.ts
|
|
859
854
|
function createDiscordDraftPreviewController(params) {
|
|
860
855
|
const runInChannelScope = AsyncLocalStorage.snapshot();
|
|
861
856
|
const assertChannelAuthority = captureDiscordRequestAuthority();
|
|
@@ -1170,8 +1165,7 @@ function isEmptyDiscordProgressLine(line) {
|
|
|
1170
1165
|
function shouldStartDiscordProgressDraftNow(line) {
|
|
1171
1166
|
return typeof line === "object" && line?.kind === "patch" && Boolean(line.detail);
|
|
1172
1167
|
}
|
|
1173
|
-
|
|
1174
|
-
//#region extensions/discord/src/monitor/message-handler.process-reply-runtime.ts
|
|
1168
|
+
// extensions/discord/src/monitor/message-handler.process-reply-runtime.ts
|
|
1175
1169
|
function formatDiscordGroupThreadReply(text, participant) {
|
|
1176
1170
|
return `**${participant.name.replace(/[\\`*_{}[\]()<>#!|]/g, "\\$&").replace(/\s+/g, " ")}**\n${text}`;
|
|
1177
1171
|
}
|
|
@@ -1306,8 +1300,7 @@ function createDiscordMessageReplyRuntime(params) {
|
|
|
1306
1300
|
resolvedBlockStreamingEnabled: resolveChannelStreamingBlockEnabled(discordConfig)
|
|
1307
1301
|
};
|
|
1308
1302
|
}
|
|
1309
|
-
|
|
1310
|
-
//#region extensions/discord/src/monitor/message-handler.process.ts
|
|
1303
|
+
// extensions/discord/src/monitor/message-handler.process.ts
|
|
1311
1304
|
const TARGETED_ONLY_ALLOWED_MENTIONS = { parse: [AllowedMentionsTypes.User, AllowedMentionsTypes.Role] };
|
|
1312
1305
|
function isFallbackOnlyToolWarningFinal(payload) {
|
|
1313
1306
|
if (payload.isError !== true || !isReplyPayloadNonTerminalToolErrorWarning(payload)) return false;
|
|
@@ -1761,5 +1754,4 @@ async function processDiscordMessage(ctx) {
|
|
|
1761
1754
|
});
|
|
1762
1755
|
}
|
|
1763
1756
|
}
|
|
1764
|
-
//#endregion
|
|
1765
1757
|
export { processDiscordMessage };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import {
|
|
3
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
4
|
-
import { C as notifyDiscordInboundEventOutboundPayloadSuccess, S as discordInboundEventDelivery, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, v as resolveDiscordCurrentConversationIdentity } from "./outbound-session-route-
|
|
1
|
+
import { t as createDiscordActionGate } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { S as chunkDiscordTextWithMode, _ as canFallbackDiscordWebhookSend, b as hasDiscordMessageCreateAmbiguity, c as normalizeDiscordMessagingTarget, g as resolveDiscordReplyReference, i as toDiscordOutboundDeliveryResult, l as normalizeDiscordOutboundTarget, n as createDiscordSendReceiptFromResults, t as createDiscordSendReceipt } from "./send.receipt-D0vpuJMr.mjs";
|
|
3
|
+
import { t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
4
|
+
import { C as notifyDiscordInboundEventOutboundPayloadSuccess, S as discordInboundEventDelivery, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, v as resolveDiscordCurrentConversationIdentity } from "./outbound-session-route-CzL157kC.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
|
+
// 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) ?? "";
|
|
@@ -72,9 +72,8 @@ function resolveDiscordInboundConversation(params) {
|
|
|
72
72
|
});
|
|
73
73
|
return conversationId ? { conversationId } : null;
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-CtvwfZQ2.mjs").then((n) => n.t));
|
|
75
|
+
// extensions/discord/src/outbound-payload.ts
|
|
76
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-BQtMCED2.mjs").then((n) => n.t));
|
|
78
77
|
function resolveDiscordDeliveryOptions(ctx) {
|
|
79
78
|
return {
|
|
80
79
|
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
@@ -162,8 +161,8 @@ const DISCORD_VIDEO_MEDIA_EXTENSIONS = [
|
|
|
162
161
|
".webm"
|
|
163
162
|
];
|
|
164
163
|
const log = createSubsystemLogger("discord/outbound");
|
|
165
|
-
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-
|
|
166
|
-
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-
|
|
164
|
+
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-ESkVljSW.mjs").then((n) => n.i));
|
|
165
|
+
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-BTjOU5BX.mjs").then((n) => n.i));
|
|
167
166
|
const discordOutbound = {
|
|
168
167
|
deliveryMode: "direct",
|
|
169
168
|
chunker: (text, limit, ctx) => chunkDiscordTextWithMode(text, {
|
|
@@ -443,5 +442,4 @@ const discordOutbound = {
|
|
|
443
442
|
await manager.touchThread({ threadId });
|
|
444
443
|
}
|
|
445
444
|
};
|
|
446
|
-
//#endregion
|
|
447
445
|
export { resolveDiscordInboundConversation as a, resolveDiscordCommandConversation as i, discordOutbound as n, resolveDiscordAttachedOutboundTarget as r, DISCORD_TEXT_CHUNK_LIMIT as t };
|
package/dist/.setup/{outbound-session-route-Ay_DnOOl.mjs → outbound-session-route-CzL157kC.mjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { w as isDiscordThreadChannelType } from "./allow-list-
|
|
4
|
-
import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
5
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
6
|
-
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-
|
|
7
|
-
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-
|
|
1
|
+
import { d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-CSz5Qodj.mjs";
|
|
3
|
+
import { w as isDiscordThreadChannelType } from "./allow-list-CkqpzPvP.mjs";
|
|
4
|
+
import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-D0vpuJMr.mjs";
|
|
5
|
+
import { t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
6
|
+
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-DeCLO9w0.mjs";
|
|
7
|
+
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-BzlhNBxA.mjs";
|
|
8
8
|
import { createLazyRuntimeMethod, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
10
10
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -22,7 +22,7 @@ import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runt
|
|
|
22
22
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
23
23
|
import { createInboundEventDeliveryCorrelation } from "openclaw/plugin-sdk/inbound-event-delivery";
|
|
24
24
|
import { resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
|
|
25
|
-
|
|
25
|
+
// extensions/discord/src/exec-approvals.ts
|
|
26
26
|
function normalizeDiscordApproverId(value) {
|
|
27
27
|
const trimmed = String(value).trim();
|
|
28
28
|
if (!trimmed) return;
|
|
@@ -67,8 +67,7 @@ function shouldSuppressLocalDiscordExecApprovalPrompt(params) {
|
|
|
67
67
|
sessionFilter: config?.sessionFilter
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
//#region extensions/discord/src/audit-core.ts
|
|
70
|
+
// extensions/discord/src/audit-core.ts
|
|
72
71
|
const REQUIRED_TEXT_CHANNEL_PERMISSIONS = ["ViewChannel", "SendMessages"];
|
|
73
72
|
const REQUIRED_THREAD_CHANNEL_PERMISSIONS = ["ViewChannel", "SendMessagesInThreads"];
|
|
74
73
|
const REQUIRED_VOICE_CHANNEL_PERMISSIONS = [
|
|
@@ -143,8 +142,7 @@ async function auditDiscordChannelPermissionsWithFetcher(params) {
|
|
|
143
142
|
elapsedMs: Date.now() - started
|
|
144
143
|
};
|
|
145
144
|
}
|
|
146
|
-
|
|
147
|
-
//#region extensions/discord/src/inbound-event-delivery.ts
|
|
145
|
+
// extensions/discord/src/inbound-event-delivery.ts
|
|
148
146
|
const DISCORD_INBOUND_EVENT_DELIVERY_KEY = "__openclawInboundEventDelivery";
|
|
149
147
|
function normalizeDiscordDeliveryTarget(value) {
|
|
150
148
|
return value.trim().replace(/^discord:/iu, "").replace(/^channel:/iu, "").toLowerCase();
|
|
@@ -181,8 +179,7 @@ function notifyDiscordInboundEventOutboundPayloadSuccess(params) {
|
|
|
181
179
|
accountId: params.accountId
|
|
182
180
|
});
|
|
183
181
|
}
|
|
184
|
-
|
|
185
|
-
//#region extensions/discord/src/trusted-requester-actions.ts
|
|
182
|
+
// extensions/discord/src/trusted-requester-actions.ts
|
|
186
183
|
const trustedRequesterGuildAdminActions = /* @__PURE__ */ new Set([
|
|
187
184
|
"emoji-upload",
|
|
188
185
|
"sticker-upload",
|
|
@@ -203,8 +200,7 @@ const trustedRequesterGuildAdminActions = /* @__PURE__ */ new Set([
|
|
|
203
200
|
function isTrustedRequesterGuildAdminAction(action) {
|
|
204
201
|
return trustedRequesterGuildAdminActions.has(action);
|
|
205
202
|
}
|
|
206
|
-
|
|
207
|
-
//#region extensions/discord/src/channel-actions.ts
|
|
203
|
+
// extensions/discord/src/channel-actions.ts
|
|
208
204
|
const localExecutionActions = /* @__PURE__ */ new Set([
|
|
209
205
|
"send",
|
|
210
206
|
"poll",
|
|
@@ -215,7 +211,7 @@ const localExecutionActions = /* @__PURE__ */ new Set([
|
|
|
215
211
|
"sticker-upload",
|
|
216
212
|
"event-create"
|
|
217
213
|
]);
|
|
218
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-
|
|
214
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-Dx2N-4A6.mjs"));
|
|
219
215
|
const discordActionGroups = [
|
|
220
216
|
{
|
|
221
217
|
gate: "polls",
|
|
@@ -455,8 +451,7 @@ const discordMessageActions = {
|
|
|
455
451
|
...sessionKey ? { sessionKey } : {}
|
|
456
452
|
})
|
|
457
453
|
};
|
|
458
|
-
|
|
459
|
-
//#region extensions/discord/src/conversation-identity.ts
|
|
454
|
+
// extensions/discord/src/conversation-identity.ts
|
|
460
455
|
function normalizeDiscordTarget(raw, defaultKind) {
|
|
461
456
|
return parseDiscordTarget(raw ?? "", { defaultKind })?.normalized;
|
|
462
457
|
}
|
|
@@ -485,8 +480,7 @@ function resolveDiscordCurrentConversationIdentity(params) {
|
|
|
485
480
|
if (target) return target;
|
|
486
481
|
}
|
|
487
482
|
}
|
|
488
|
-
|
|
489
|
-
//#region extensions/discord/src/monitor/route-resolution.ts
|
|
483
|
+
// extensions/discord/src/monitor/route-resolution.ts
|
|
490
484
|
function buildDiscordRoutePeer(params) {
|
|
491
485
|
return {
|
|
492
486
|
kind: params.isGroupDm ? "group" : params.isDirectMessage ? "direct" : "channel",
|
|
@@ -556,8 +550,7 @@ function shouldIgnoreStaleDiscordRouteBinding(params) {
|
|
|
556
550
|
if (!bound || !routed || bound.rest !== routed.rest) return false;
|
|
557
551
|
return bound.agentId !== params.route.agentId;
|
|
558
552
|
}
|
|
559
|
-
|
|
560
|
-
//#region extensions/discord/src/channel-policy-state.ts
|
|
553
|
+
// extensions/discord/src/channel-policy-state.ts
|
|
561
554
|
const policyBindings = resolveGlobalMap(Symbol.for("openclaw.discord.policy-bindings"), "close-and-restart");
|
|
562
555
|
function setDiscordPolicyBindings(accountId, bindings, guilds = /* @__PURE__ */ new Map()) {
|
|
563
556
|
policyBindings.set(normalizeAccountId(accountId), {
|
|
@@ -574,8 +567,7 @@ function getDiscordChannelPolicyBinding(accountId, guildKey, channelKey) {
|
|
|
574
567
|
function findDiscordChannelPolicyKey(accountId, guildKey, channelId) {
|
|
575
568
|
return policyBindings.get(normalizeAccountId(accountId))?.channels.find((binding) => binding.guildKey === guildKey && binding.channelId === channelId)?.channelKey;
|
|
576
569
|
}
|
|
577
|
-
|
|
578
|
-
//#region extensions/discord/src/group-policy.ts
|
|
570
|
+
// extensions/discord/src/group-policy.ts
|
|
579
571
|
function resolveDiscordGuildKey(guilds, groupSpace, accountId) {
|
|
580
572
|
if (!guilds || Object.keys(guilds).length === 0) return;
|
|
581
573
|
const space = normalizeOptionalString(groupSpace) ?? "";
|
|
@@ -637,8 +629,7 @@ function resolveDiscordGroupToolPolicy(params) {
|
|
|
637
629
|
senderE164: params.senderE164
|
|
638
630
|
});
|
|
639
631
|
}
|
|
640
|
-
|
|
641
|
-
//#region extensions/discord/src/approval-message-safety.ts
|
|
632
|
+
// extensions/discord/src/approval-message-safety.ts
|
|
642
633
|
const DISCORD_APPROVAL_ALLOWED_MENTIONS = { parse: [] };
|
|
643
634
|
const DISCORD_MARKDOWN_META_CHARACTERS = /* @__PURE__ */ new Set([
|
|
644
635
|
"\\",
|
|
@@ -681,8 +672,7 @@ function formatDiscordApprovalDisplayValue(value) {
|
|
|
681
672
|
}
|
|
682
673
|
return escaped;
|
|
683
674
|
}
|
|
684
|
-
|
|
685
|
-
//#region extensions/discord/src/outbound-components.ts
|
|
675
|
+
// extensions/discord/src/outbound-components.ts
|
|
686
676
|
const DISCORD_MESSAGE_COMPONENT_LIMIT = 40;
|
|
687
677
|
const DISCORD_TEXT_DISPLAY_LIMIT = 2e3;
|
|
688
678
|
const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
@@ -712,8 +702,8 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
712
702
|
}
|
|
713
703
|
}
|
|
714
704
|
};
|
|
715
|
-
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-
|
|
716
|
-
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./shared-interactive-
|
|
705
|
+
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-BTjOU5BX.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
|
|
706
|
+
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./shared-interactive-DKBw4SNV.mjs").then((n) => n.r));
|
|
717
707
|
function addPayloadTextFallback(spec, payload) {
|
|
718
708
|
return spec.text ? spec : {
|
|
719
709
|
...spec,
|
|
@@ -768,8 +758,7 @@ async function resolveDiscordComponentSpec(payload) {
|
|
|
768
758
|
const interactiveSpec = (await loadDiscordSharedInteractive()).buildDiscordInteractiveComponents(payload.interactive);
|
|
769
759
|
return interactiveSpec ? addPayloadTextFallback(interactiveSpec, payload) : void 0;
|
|
770
760
|
}
|
|
771
|
-
|
|
772
|
-
//#region extensions/discord/src/outbound-session-route.ts
|
|
761
|
+
// extensions/discord/src/outbound-session-route.ts
|
|
773
762
|
function resolveDiscordOutboundSessionRoute(params) {
|
|
774
763
|
const parsed = parseDiscordTarget(params.target, { defaultKind: resolveDiscordOutboundTargetKindHint(params) });
|
|
775
764
|
if (!parsed) return null;
|
|
@@ -809,5 +798,4 @@ function resolveDiscordOutboundTargetKindHint(params) {
|
|
|
809
798
|
if (resolvedKind === "group" || resolvedKind === "channel") return "channel";
|
|
810
799
|
return /^(user:|discord:|@|<@!?)/i.test(params.target.trim()) ? "user" : "channel";
|
|
811
800
|
}
|
|
812
|
-
//#endregion
|
|
813
801
|
export { shouldSuppressLocalDiscordExecApprovalPrompt as A, notifyDiscordInboundEventOutboundPayloadSuccess as C, getDiscordExecApprovalApprovers as D, resolveRequiredDiscordChannelPermissions as E, isDiscordExecApprovalApprover as O, discordInboundEventDelivery as S, collectDiscordAuditChannelIdsForAccount as T, resolveDiscordConversationIdentity as _, resolveDiscordComponentSpec as a, discordMessageActions as b, formatDiscordApprovalDisplayValue as c, setDiscordPolicyBindings as d, buildDiscordConversationRouteContext as f, shouldIgnoreStaleDiscordRouteBinding as g, resolveDiscordEffectiveRoute as h, isDiscordComponentSpecWithinMessageLimit as i, isDiscordExecApprovalClientEnabled as k, resolveDiscordGroupRequireMention as l, resolveDiscordConversationRoute as m, DISCORD_PRESENTATION_CAPABILITIES as n, sendDiscordComponentMessageLazy as o, buildDiscordRoutePeer as p, buildDiscordPresentationPayload as r, DISCORD_APPROVAL_ALLOWED_MENTIONS as s, resolveDiscordOutboundSessionRoute as t, resolveDiscordGroupToolPolicy as u, resolveDiscordCurrentConversationIdentity as v, auditDiscordChannelPermissionsWithFetcher as w, isTrustedRequesterGuildAdminAction as x, resolveDiscordRuntimeBindingConversationId as y };
|