@openclaw/discord 2026.8.1 → 2026.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-inspect-BY-ve3yH.js +45 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-CfQ-vSyf.js → accounts-CwJQoLjM.js} +89 -45
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-Dl-TOyOX.js → activities-api-CkKcHUB6.js} +14 -13
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-BDMimASD.js → allow-list-C2JuH-R0.js} +10 -6
- package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
- package/dist/api.js +17 -17
- package/dist/{approval-handler.runtime-q4Zqo44V.js → approval-handler.runtime-DZM6Kt1Z.js} +8 -7
- package/dist/{audit-DgrvFPGt.js → audit-DIbQA4VT.js} +8 -7
- package/dist/{channel-BsQUalPw.js → channel-CarzU3bg.js} +24 -22
- package/dist/{channel-actions.runtime-UMGGIfSy.js → channel-actions.runtime-B2wMqeVK.js} +13 -11
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-rPs4dsk_.js → channel.setup-z_ewMVa9.js} +18 -18
- package/dist/{components-Dk35LTf_.js → components-gvRA0oaI.js} +1 -1
- package/dist/{config-schema-CxPqtVI1.js → config-schema-B797-Spt.js} +5 -4
- package/dist/{conversation-binding-route-BjvX4e35.js → conversation-binding-route-DPpBRpYI.js} +1 -1
- package/dist/{directory-config-B7DY_pNG.js → directory-config-AA8wQx0D.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DuAXKkan.js → directory-live-D_kFz_Fj.js} +4 -4
- package/dist/{doctor-zQTtn6hm.js → doctor-QQTOkBfW.js} +5 -5
- package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
- package/dist/doctor-contract-api.js +3 -2
- package/dist/{handle-action.guild-admin-DZewwLr1.js → handle-action.guild-admin-Cc88ZGon.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{ingress-identity-CzZKcPK8.js → ingress-identity-BCzfPPYM.js} +1 -1
- package/dist/{message-handler-C5By3yl5.js → message-handler-CAeEpqWo.js} +14 -10
- package/dist/{message-handler.preflight-DrszWuHw.js → message-handler.preflight-CoKoE3dY.js} +24 -19
- package/dist/{message-handler.process-DyFPDLCt.js → message-handler.process-cdIJ_fDT.js} +56 -74
- package/dist/{message-text-Ca8M6TU8.js → message-text-C0K4-fkg.js} +9 -4
- package/dist/{outbound-adapter-Dif8p481.js → outbound-adapter-Ch0At5Ra.js} +34 -24
- package/dist/{outbound-components-wjv7yyAj.js → outbound-components-Bnt_7x7r.js} +3 -3
- package/dist/{outbound-session-route-Bn4uXaoE.js → outbound-session-route-CzzerX2K.js} +10 -7
- package/dist/{owner-access-UlYi9t0M.js → owner-access-yc1sX7Gx.js} +7 -6
- package/dist/{pluralkit-9EuEN4UD.js → pluralkit-B3cUVI7i.js} +2 -2
- package/dist/{probe-n6ZXxK8V.js → probe-3ovFAp3b.js} +3 -3
- package/dist/{probe.runtime-CN4bdPfZ.js → probe.runtime-BckHn3cJ.js} +1 -1
- package/dist/{provider-LXiOcJrH.js → provider-CjI8BSzS.js} +97 -76
- package/dist/{provider-session.runtime-DSNe7r2W.js → provider-session.runtime-DdKRMcE9.js} +3 -3
- package/dist/provider.runtime-Bo1WbLLr.js +2 -0
- package/dist/{realtime-session.runtime-DOViOIjY.js → realtime-session.runtime-37IC-p5K.js} +5 -5
- package/dist/{resolve-allowlist-common-BLoYaxEG.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
- package/dist/{resolve-channels-D2yl_2CN.js → resolve-channels-BexR2eUn.js} +4 -4
- package/dist/{resolve-users-BLxfqajZ.js → resolve-users-BtXBCH5W.js} +5 -4
- package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
- package/dist/{retry-DqHCW6PV.js → retry-t5RcEsPk.js} +37 -29
- package/dist/{runtime-DrxVBTtp.js → runtime-BNlDfLwS.js} +2 -2
- package/dist/{runtime-BYamRVPN.js → runtime-DydyfxST.js} +126 -92
- package/dist/runtime-api.js +19 -19
- package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-UJHiAm4C.js → send-mTKSBdmZ.js} +76 -48
- package/dist/{send.components-CrBJpGT_.js → send.components-nsPnc7kK.js} +20 -14
- package/dist/{send.outbound-D7JYmfm9.js → send.outbound-CaOs9Zy1.js} +34 -20
- package/dist/{send.shared-DZJ1akvQ.js → send.shared-BJHt0Vyf.js} +24 -17
- package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-Dii2HTn7.js → shared-BNesVA4P.js} +17 -14
- package/dist/{subagent-hooks-JyGrtQIl.js → subagent-hooks-IeZVPLGj.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-BEmcj4xJ.js → system-events-Be5EJI3b.js} +2 -2
- package/dist/{target-resolver-V-IYae6s.js → target-resolver-C0MnwEki.js} +6 -5
- package/dist/targets-DQSye1Rv.js +3 -0
- package/dist/{thread-bindings-DvYP79fy.js → thread-bindings-wECUSIIG.js} +6 -5
- package/dist/{thread-bindings.manager-Clm77DBM.js → thread-bindings.manager-B-3UHCc1.js} +28 -25
- package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
- package/dist/{threading-CXuu_7o9.js → threading-te5ADPQI.js} +8 -6
- package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
- package/dist/{transcripts-source-BLEMH_yi.js → transcripts-source-DkUhR7YK.js} +3 -3
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-B9snnwMe.js → typing-DAwJF5VT.js} +2 -2
- package/dist/{voice-runtime-DY6_o73o.js → voice-runtime-COyYYTDD.js} +348 -14
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +2 -2
- package/package.json +5 -5
- package/dist/account-inspect-BDfKyuvL.js +0 -89
- package/dist/provider.runtime-DiInaDXO.js +0 -2
- package/dist/sdk-runtime-6tfgYDjY.js +0 -338
- package/dist/targets-CQp53cGj.js +0 -3
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Dt as deleteChannelMessage, a as chunkDiscordTextWithMode, kt as editChannelMessage, v as resolveDiscordChannelId, wt as createChannelMessage, y as discord_exports } from "./retry-
|
|
2
|
-
import { p as resolveDiscordMaxLinesPerMessage } from "./accounts-
|
|
3
|
-
import { C as resolveTimestampMs, a as normalizeDiscordSlug, r as normalizeDiscordAllowList } from "./allow-list-
|
|
4
|
-
import { F as createDiscordRuntimeAccountContext, P as createDiscordRestClient, d as resolveDiscordTargetChannelId, k as resolveDiscordMessageFlags } from "./send.shared-
|
|
5
|
-
import { i as discordTextHasBroadcastMention } from "./send.outbound-
|
|
6
|
-
import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-
|
|
7
|
-
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
8
|
-
import "./targets-
|
|
9
|
-
import { a as buildDiscordRoutePeer, h as discordInboundEventDelivery, u as resolveDiscordConversationIdentity } from "./outbound-session-route-
|
|
10
|
-
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-
|
|
11
|
-
import { a as formatDiscordReplySkip, c as buildGuildLabel, g as createDiscordSupplementalContextAccessChecker, h as buildDiscordInboundAccessContext, i as formatDiscordReplyDeliveryFailure, l as resolveReplyContext, o as sanitizeDiscordFrontChannelReplyPayloads, r as deliverDiscordReply, s as buildDirectLabel } from "./provider-
|
|
12
|
-
import { a as formatDiscordMediaText, c as resolveReferencedReplyMediaList, i as resolveDiscordMessageText, u as resolveDiscordMessageStickers } from "./message-text-
|
|
13
|
-
import { a as resolveDiscordThreadStarter, n as resolveDiscordAutoThreadReplyPlan } from "./threading-
|
|
14
|
-
import { n as resolveDiscordWebhookId } from "./sender-identity-
|
|
1
|
+
import { Dt as deleteChannelMessage, a as chunkDiscordTextWithMode, kt as editChannelMessage, v as resolveDiscordChannelId, wt as createChannelMessage, y as discord_exports } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { p as resolveDiscordMaxLinesPerMessage } from "./accounts-CwJQoLjM.js";
|
|
3
|
+
import { C as resolveTimestampMs, a as normalizeDiscordSlug, r as normalizeDiscordAllowList } from "./allow-list-C2JuH-R0.js";
|
|
4
|
+
import { F as createDiscordRuntimeAccountContext, P as createDiscordRestClient, d as resolveDiscordTargetChannelId, k as resolveDiscordMessageFlags } from "./send.shared-BJHt0Vyf.js";
|
|
5
|
+
import { i as discordTextHasBroadcastMention } from "./send.outbound-CaOs9Zy1.js";
|
|
6
|
+
import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-mTKSBdmZ.js";
|
|
7
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-D86uWLt_.js";
|
|
8
|
+
import "./targets-DQSye1Rv.js";
|
|
9
|
+
import { a as buildDiscordRoutePeer, h as discordInboundEventDelivery, u as resolveDiscordConversationIdentity } from "./outbound-session-route-CzzerX2K.js";
|
|
10
|
+
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-Ch0At5Ra.js";
|
|
11
|
+
import { a as formatDiscordReplySkip, c as buildGuildLabel, g as createDiscordSupplementalContextAccessChecker, h as buildDiscordInboundAccessContext, i as formatDiscordReplyDeliveryFailure, l as resolveReplyContext, o as sanitizeDiscordFrontChannelReplyPayloads, r as deliverDiscordReply, s as buildDirectLabel } from "./provider-CjI8BSzS.js";
|
|
12
|
+
import { a as formatDiscordMediaText, c as resolveReferencedReplyMediaList, i as resolveDiscordMessageText, u as resolveDiscordMessageStickers } from "./message-text-C0K4-fkg.js";
|
|
13
|
+
import { a as resolveDiscordThreadStarter, n as resolveDiscordAutoThreadReplyPlan } from "./threading-te5ADPQI.js";
|
|
14
|
+
import { n as resolveDiscordWebhookId } from "./sender-identity-Dt0imZyY.js";
|
|
15
15
|
import { t as beginDiscordActiveTurnThreadRoute } from "./active-turn-thread-route-fmHl1HNd.js";
|
|
16
16
|
import { n as filterDiscordHistoryEntriesForContext, t as createDiscordHistorySenderProvenance } from "./message-handler.history-CJOsN9w5.js";
|
|
17
|
-
import { t as sendTyping } from "./typing-
|
|
17
|
+
import { t as sendTyping } from "./typing-DAwJF5VT.js";
|
|
18
18
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
19
19
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
20
20
|
import { buildAgentSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
@@ -24,7 +24,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
24
24
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
25
25
|
import { resolveChunkMode } from "openclaw/plugin-sdk/reply-chunking";
|
|
26
26
|
import { convertMarkdownTables, stripInlineDirectiveTagsForDelivery, stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
27
|
-
import { bindIngressLifecycleToReplyOptions,
|
|
27
|
+
import { bindIngressLifecycleToReplyOptions, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createFinalizableDraftStreamControlsForState, createTypingCallbacks, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, resolveChannelDraftStreamingChunking, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewCommandText, resolveChannelStreamingProgressNarration, resolveTranscriptBackedChannelFinalText } from "openclaw/plugin-sdk/channel-outbound";
|
|
28
28
|
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
|
|
29
29
|
import { evaluateSupplementalContextVisibility } from "openclaw/plugin-sdk/security-runtime";
|
|
30
30
|
import { resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/conversation-runtime";
|
|
@@ -37,7 +37,7 @@ import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
|
37
37
|
import { buildHistoryContextFromEntries, buildInboundHistoryFromEntries, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
38
38
|
import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
39
39
|
import { formatAudioTranscriptForAgent } from "openclaw/plugin-sdk/media-understanding-runtime";
|
|
40
|
-
import {
|
|
40
|
+
import { createStatusReactionController, logAckFailure, logTypingFailure, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
|
|
41
41
|
import { readLatestAssistantTextByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
42
42
|
//#region extensions/discord/src/monitor/message-handler.retry.ts
|
|
43
43
|
const REPLY_SESSION_INIT_CONFLICT_MESSAGE_RE = /^reply session initialization conflicted for \S+$/u;
|
|
@@ -116,10 +116,11 @@ async function buildDiscordMessageProcessContext(params) {
|
|
|
116
116
|
channel: "discord",
|
|
117
117
|
accountId
|
|
118
118
|
});
|
|
119
|
+
const allowNameMatching = isDangerousNameMatchingEnabled(discordConfig);
|
|
119
120
|
const isSupplementalContextSenderAllowed = createDiscordSupplementalContextAccessChecker({
|
|
120
121
|
channelConfig,
|
|
121
122
|
guildInfo,
|
|
122
|
-
allowNameMatching
|
|
123
|
+
allowNameMatching,
|
|
123
124
|
isGuild: isGuildMessage
|
|
124
125
|
});
|
|
125
126
|
const storePath = resolveStorePath(cfg.session?.store, { agentId: route.agentId });
|
|
@@ -202,17 +203,19 @@ async function buildDiscordMessageProcessContext(params) {
|
|
|
202
203
|
parentType: threadParentType,
|
|
203
204
|
resolveTimestampMs
|
|
204
205
|
});
|
|
205
|
-
if (starter?.text)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
206
|
+
if (starter?.text) {
|
|
207
|
+
if (evaluateSupplementalContextVisibility({
|
|
208
|
+
mode: contextVisibilityMode,
|
|
209
|
+
kind: "thread",
|
|
210
|
+
senderAllowed: isSupplementalContextSenderAllowed({
|
|
211
|
+
id: starter.authorId,
|
|
212
|
+
name: starter.authorName ?? starter.author,
|
|
213
|
+
tag: starter.authorTag,
|
|
214
|
+
memberRoleIds: starter.memberRoleIds
|
|
215
|
+
})
|
|
216
|
+
}).include) threadStarterBody = starter.text;
|
|
217
|
+
else logVerbose(`discord: drop thread starter context (mode=${contextVisibilityMode})`);
|
|
218
|
+
}
|
|
216
219
|
}
|
|
217
220
|
const parentName = threadParentName ?? "parent";
|
|
218
221
|
threadLabel = threadName ? `Discord thread #${normalizeDiscordSlug(parentName)} › ${threadName}` : `Discord thread #${normalizeDiscordSlug(parentName)}`;
|
|
@@ -650,15 +653,13 @@ function createDiscordMessageReactionRuntime(params) {
|
|
|
650
653
|
messageId: message.id,
|
|
651
654
|
reactionContext: ackReactionContext
|
|
652
655
|
});
|
|
653
|
-
const statusReactionTiming = DEFAULT_TIMING;
|
|
654
656
|
let statusReactionTarget = `${messageChannelId}/${message.id}`;
|
|
655
657
|
let statusReactionsActive = statusReactionsEnabled;
|
|
656
658
|
let statusReactions = createStatusReactionController({
|
|
657
659
|
enabled: statusReactionsEnabled,
|
|
658
660
|
adapter: discordAdapter,
|
|
659
661
|
initialEmoji: ackReaction,
|
|
660
|
-
|
|
661
|
-
timing: statusReactionTiming,
|
|
662
|
+
presentation: "acknowledgement",
|
|
662
663
|
onError: (err) => {
|
|
663
664
|
logAckFailure({
|
|
664
665
|
log: logVerbose,
|
|
@@ -711,8 +712,7 @@ function createDiscordMessageReactionRuntime(params) {
|
|
|
711
712
|
reactionContext: ackReactionContext
|
|
712
713
|
}),
|
|
713
714
|
initialEmoji: emoji,
|
|
714
|
-
|
|
715
|
-
timing: statusReactionTiming,
|
|
715
|
+
presentation: "acknowledgement",
|
|
716
716
|
onError: (err) => {
|
|
717
717
|
logAckFailure({
|
|
718
718
|
log: logVerbose,
|
|
@@ -859,6 +859,7 @@ function createDiscordDraftStream(params) {
|
|
|
859
859
|
};
|
|
860
860
|
const { loop, update, stop, discardPending, seal } = createFinalizableDraftStreamControlsForState({
|
|
861
861
|
throttleMs,
|
|
862
|
+
coalesceInFlight: true,
|
|
862
863
|
state: streamState,
|
|
863
864
|
sendOrEditStreamMessage
|
|
864
865
|
});
|
|
@@ -990,24 +991,17 @@ function createDiscordDraftPreviewController(params) {
|
|
|
990
991
|
let progressDraftStartedBeforeFinal = false;
|
|
991
992
|
let progressDraftCollapsed = false;
|
|
992
993
|
let progressNarratorLifecycle;
|
|
993
|
-
const previewToolProgressEnabled = Boolean(draftStream) && resolveChannelStreamingPreviewToolProgress(params.discordConfig, true, discordStreamMode);
|
|
994
994
|
const narrationProgressEnabled = Boolean(draftStream) && discordStreamMode === "progress" && resolveChannelStreamingProgressNarration(params.discordConfig);
|
|
995
995
|
const narrationHideCommandText = narrationProgressEnabled && resolveChannelStreamingPreviewCommandText(params.discordConfig) === "status";
|
|
996
|
-
const suppressDefaultToolProgressMessages = Boolean(draftStream) && resolveChannelStreamingSuppressDefaultToolProgressMessages(params.discordConfig, {
|
|
997
|
-
draftStreamActive: true,
|
|
998
|
-
previewToolProgressEnabled
|
|
999
|
-
});
|
|
1000
996
|
const progressSeed = `${params.accountId}:${params.deliverChannelId}`;
|
|
1001
997
|
const progressDraft = createChannelProgressDraftCompositor({
|
|
998
|
+
presentation: discordStreamMode === "progress" ? "summary" : void 0,
|
|
1002
999
|
entry: params.discordConfig,
|
|
1003
1000
|
mode: discordStreamMode,
|
|
1004
1001
|
active: Boolean(draftStream),
|
|
1005
1002
|
seed: progressSeed,
|
|
1006
1003
|
reasoningLinePrefix: "🧠 ",
|
|
1007
|
-
commentaryLinePrefix: "💬 ",
|
|
1008
|
-
reasoningGate: previewToolProgressEnabled,
|
|
1009
1004
|
commentaryItalics: false,
|
|
1010
|
-
buildProgressEventLine: (input, options) => input.event === "tool" || input.event === "item" || input.event === "command-output" ? buildChannelProgressDraftLineForEntry(params.discordConfig, input, options) : buildChannelProgressDraftLine(input, options),
|
|
1011
1005
|
update: async (previewText, options) => {
|
|
1012
1006
|
if (!draftStream) return false;
|
|
1013
1007
|
lastPartialText = previewText;
|
|
@@ -1040,10 +1034,6 @@ function createDiscordDraftPreviewController(params) {
|
|
|
1040
1034
|
}
|
|
1041
1035
|
resetProgressState();
|
|
1042
1036
|
};
|
|
1043
|
-
const pushPreambleHeadline = async (text, options) => {
|
|
1044
|
-
if (discordStreamMode === "progress") return await progressDraft.pushPreambleHeadline(text, options);
|
|
1045
|
-
return false;
|
|
1046
|
-
};
|
|
1047
1037
|
const beginNewProgressTurn = (options) => {
|
|
1048
1038
|
const beganNewTurn = progressDraft.beginNewTurn(options);
|
|
1049
1039
|
if (beganNewTurn) {
|
|
@@ -1060,11 +1050,10 @@ function createDiscordDraftPreviewController(params) {
|
|
|
1060
1050
|
};
|
|
1061
1051
|
return {
|
|
1062
1052
|
draftStream,
|
|
1063
|
-
previewToolProgressEnabled,
|
|
1064
1053
|
narrationProgressEnabled,
|
|
1065
1054
|
narrationHideCommandText,
|
|
1066
1055
|
commentaryProgressEnabled: progressDraft.commentaryProgressEnabled,
|
|
1067
|
-
suppressDefaultToolProgressMessages,
|
|
1056
|
+
suppressDefaultToolProgressMessages: progressDraft.suppressDefaultToolProgressMessages,
|
|
1068
1057
|
get isProgressMode() {
|
|
1069
1058
|
return discordStreamMode === "progress";
|
|
1070
1059
|
},
|
|
@@ -1115,31 +1104,18 @@ function createDiscordDraftPreviewController(params) {
|
|
|
1115
1104
|
disableBlockStreamingForDraft: draftStream ? true : void 0,
|
|
1116
1105
|
pushToolEvent: progressDraft.pushToolEvent,
|
|
1117
1106
|
pushItemEvent: progressDraft.pushItemEvent,
|
|
1118
|
-
pushApprovalEvent: progressDraft.pushApprovalEvent,
|
|
1107
|
+
pushApprovalEvent: progressDraft.pushApprovalEvent.bind(progressDraft),
|
|
1119
1108
|
pushCommandOutputEvent: progressDraft.pushCommandOutputEvent,
|
|
1120
1109
|
pushPatchEvent: progressDraft.pushPatchEvent,
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
async pushPlanProgress(steps, options) {
|
|
1125
|
-
return await progressDraft.pushPlanProgress(steps, options);
|
|
1126
|
-
},
|
|
1127
|
-
async pushReasoningProgress(text, options) {
|
|
1128
|
-
return await progressDraft.pushReasoningProgress(text, options);
|
|
1129
|
-
},
|
|
1130
|
-
async pushNarrationProgress(text) {
|
|
1131
|
-
return await progressDraft.pushNarrationProgress(text);
|
|
1132
|
-
},
|
|
1133
|
-
pushPreambleHeadline,
|
|
1110
|
+
pushPlanProgress: progressDraft.pushPlanProgress.bind(progressDraft),
|
|
1111
|
+
pushReasoningProgress: progressDraft.pushReasoningProgress.bind(progressDraft),
|
|
1112
|
+
pushNarrationProgress: progressDraft.pushNarrationProgress.bind(progressDraft),
|
|
1134
1113
|
async pushPreambleItemEvent(payload) {
|
|
1135
|
-
const headlineAccepted = await pushPreambleHeadline(payload.progressText, { itemId: payload.itemId });
|
|
1114
|
+
const headlineAccepted = await progressDraft.pushPreambleHeadline(payload.progressText, { itemId: payload.itemId });
|
|
1136
1115
|
if (!progressDraft.commentaryProgressEnabled) return headlineAccepted;
|
|
1137
1116
|
const commentaryAccepted = await progressDraft.pushCommentaryProgress(payload.progressText, { itemId: payload.itemId });
|
|
1138
1117
|
return headlineAccepted || commentaryAccepted;
|
|
1139
1118
|
},
|
|
1140
|
-
async pushCommentaryProgress(text, options) {
|
|
1141
|
-
return await progressDraft.pushCommentaryProgress(text, options);
|
|
1142
|
-
},
|
|
1143
1119
|
resolvePreviewFinalText(text) {
|
|
1144
1120
|
if (typeof text !== "string") return;
|
|
1145
1121
|
const formatted = convertMarkdownTables(stripInlineDirectiveTagsForDelivery(text).text, params.tableMode);
|
|
@@ -1236,7 +1212,7 @@ function shouldStartDiscordProgressDraftNow(line) {
|
|
|
1236
1212
|
}
|
|
1237
1213
|
//#endregion
|
|
1238
1214
|
//#region extensions/discord/src/monitor/reply-typing-feedback.ts
|
|
1239
|
-
const DISCORD_REPLY_TYPING_MAX_DURATION_MS =
|
|
1215
|
+
const DISCORD_REPLY_TYPING_MAX_DURATION_MS = 12e5;
|
|
1240
1216
|
function createDiscordReplyTypingFeedback(params) {
|
|
1241
1217
|
const rest = params.rest ?? createDiscordRestClient({
|
|
1242
1218
|
cfg: params.cfg,
|
|
@@ -1569,8 +1545,9 @@ async function processDiscordMessageInner(ctx, observer) {
|
|
|
1569
1545
|
const raw = (payload.text ?? "").trim();
|
|
1570
1546
|
const body = raw.startsWith("Reasoning:\n") ? raw.slice(11).trim() : raw;
|
|
1571
1547
|
if (!body) return { visibleReplySent: false };
|
|
1548
|
+
const chunkLimit = Math.max(256, Math.min(textLimit, 2e3) - 8);
|
|
1572
1549
|
const chunks = chunkDiscordTextWithMode(body, {
|
|
1573
|
-
maxChars:
|
|
1550
|
+
maxChars: chunkLimit,
|
|
1574
1551
|
maxLines: maxLinesPerMessage,
|
|
1575
1552
|
chunkMode
|
|
1576
1553
|
});
|
|
@@ -1598,7 +1575,8 @@ async function processDiscordMessageInner(ctx, observer) {
|
|
|
1598
1575
|
mediaLocalRoots,
|
|
1599
1576
|
kind: "block",
|
|
1600
1577
|
bindPendingFinalDelivery: info.bindPendingFinalDelivery,
|
|
1601
|
-
onPlatformSendDispatch: info.onPlatformSendDispatch
|
|
1578
|
+
onPlatformSendDispatch: info.onPlatformSendDispatch,
|
|
1579
|
+
assertPlatformSendAuthorized: info.assertPlatformSendAuthorized
|
|
1602
1580
|
});
|
|
1603
1581
|
if (result.visibleReplySent) replyReference.markSent();
|
|
1604
1582
|
return result;
|
|
@@ -1615,10 +1593,11 @@ async function processDiscordMessageInner(ctx, observer) {
|
|
|
1615
1593
|
finalText: payload.text,
|
|
1616
1594
|
resolveCandidateText: resolveCurrentTurnTranscriptFinalText
|
|
1617
1595
|
}) : payload.text;
|
|
1618
|
-
const
|
|
1596
|
+
const effectivePayload = finalText !== payload.text ? {
|
|
1619
1597
|
...payload,
|
|
1620
1598
|
text: finalText
|
|
1621
|
-
} : payload
|
|
1599
|
+
} : payload;
|
|
1600
|
+
const [deliverablePayload] = sanitizeDiscordFrontChannelReplyPayloads([effectivePayload], { kind: info.kind });
|
|
1622
1601
|
if (!deliverablePayload) {
|
|
1623
1602
|
logVerbose(formatDiscordReplySkip({
|
|
1624
1603
|
kind: info.kind,
|
|
@@ -1698,7 +1677,8 @@ async function processDiscordMessageInner(ctx, observer) {
|
|
|
1698
1677
|
allowedMentions,
|
|
1699
1678
|
kind: info.kind,
|
|
1700
1679
|
bindPendingFinalDelivery: info.bindPendingFinalDelivery,
|
|
1701
|
-
onPlatformSendDispatch: info.onPlatformSendDispatch
|
|
1680
|
+
onPlatformSendDispatch: info.onPlatformSendDispatch,
|
|
1681
|
+
assertPlatformSendAuthorized: info.assertPlatformSendAuthorized
|
|
1702
1682
|
})).visibleReplySent;
|
|
1703
1683
|
},
|
|
1704
1684
|
onNormalDelivered: () => {
|
|
@@ -1737,7 +1717,8 @@ async function processDiscordMessageInner(ctx, observer) {
|
|
|
1737
1717
|
mediaLocalRoots,
|
|
1738
1718
|
kind: info.kind,
|
|
1739
1719
|
bindPendingFinalDelivery: info.bindPendingFinalDelivery,
|
|
1740
|
-
onPlatformSendDispatch: info.onPlatformSendDispatch
|
|
1720
|
+
onPlatformSendDispatch: info.onPlatformSendDispatch,
|
|
1721
|
+
assertPlatformSendAuthorized: info.assertPlatformSendAuthorized
|
|
1741
1722
|
});
|
|
1742
1723
|
if (!result.visibleReplySent) return result;
|
|
1743
1724
|
replyReference.markSent();
|
|
@@ -1857,7 +1838,8 @@ async function processDiscordMessageInner(ctx, observer) {
|
|
|
1857
1838
|
dispatchError = true;
|
|
1858
1839
|
if (await completeDiscordSessionConflict(err, (payload, info) => deliverDiscordPayload(payload, {
|
|
1859
1840
|
...info,
|
|
1860
|
-
onPlatformSendDispatch: () => Promise.resolve()
|
|
1841
|
+
onPlatformSendDispatch: () => Promise.resolve(),
|
|
1842
|
+
assertPlatformSendAuthorized: () => void 0
|
|
1861
1843
|
}), onDiscordDeliveryError)) return;
|
|
1862
1844
|
throw err;
|
|
1863
1845
|
} finally {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as resolveDiscordChannelInfoSafe } from "./thread-bindings.manager-
|
|
1
|
+
import { c as resolveDiscordChannelInfoSafe } from "./thread-bindings.manager-B-3UHCc1.js";
|
|
2
2
|
import { ComponentType, StickerFormatType } from "discord-api-types/v10";
|
|
3
3
|
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -11,8 +11,8 @@ import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound"
|
|
|
11
11
|
const discordChannelInfoCacheState = { entries: /* @__PURE__ */ new Map() };
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region extensions/discord/src/monitor/message-channel-info.ts
|
|
14
|
-
const DISCORD_CHANNEL_INFO_CACHE_TTL_MS =
|
|
15
|
-
const DISCORD_CHANNEL_INFO_NEGATIVE_CACHE_TTL_MS =
|
|
14
|
+
const DISCORD_CHANNEL_INFO_CACHE_TTL_MS = 3e5;
|
|
15
|
+
const DISCORD_CHANNEL_INFO_NEGATIVE_CACHE_TTL_MS = 3e4;
|
|
16
16
|
const DISCORD_CHANNEL_INFO_CACHE_MAX_ENTRIES = 1e3;
|
|
17
17
|
function resolveDiscordChannelInfoCacheExpiresAt(ttlMs, nowMs) {
|
|
18
18
|
return resolveExpiresAtMsFromDurationMs(ttlMs, { nowMs });
|
|
@@ -131,6 +131,11 @@ function resolveDiscordReferencedReplyMessage(message) {
|
|
|
131
131
|
const referenceType = message.messageReference?.type;
|
|
132
132
|
return Number(referenceType) === FORWARD_MESSAGE_REFERENCE_TYPE ? null : message.referencedMessage ?? null;
|
|
133
133
|
}
|
|
134
|
+
function resolveDiscordReferencedReplyMessageId(message) {
|
|
135
|
+
const referenceType = message.messageReference?.type;
|
|
136
|
+
if (Number(referenceType) === FORWARD_MESSAGE_REFERENCE_TYPE) return null;
|
|
137
|
+
return normalizeOptionalString(message.messageReference?.message_id) ?? normalizeOptionalString(message.referencedMessage?.id) ?? null;
|
|
138
|
+
}
|
|
134
139
|
function formatDiscordSnapshotAuthor(author) {
|
|
135
140
|
if (!author) return;
|
|
136
141
|
const globalName = normalizeOptionalString(author.global_name) ?? void 0;
|
|
@@ -563,4 +568,4 @@ function resolveDiscordSnapshotMessageText(snapshot) {
|
|
|
563
568
|
return [content || embedText || componentText, attachmentText].filter(Boolean).join("\n");
|
|
564
569
|
}
|
|
565
570
|
//#endregion
|
|
566
|
-
export { formatDiscordMediaText as a, resolveReferencedReplyMediaList as c,
|
|
571
|
+
export { formatDiscordMediaText as a, resolveReferencedReplyMediaList as c, resolveDiscordReferencedReplyMessage as d, resolveDiscordReferencedReplyMessageId as f, resolveDiscordMessageChannelId as h, resolveDiscordMessageText as i, hasDiscordMessageStickers as l, resolveDiscordChannelInfo as m, resolveDiscordForwardedMessagesTextFromSnapshots as n, resolveForwardedMediaList as o, resolveDiscordCdnPolicy as p, resolveDiscordMessageHistoryText as r, resolveMediaList as s, resolveDiscordEmbedText as t, resolveDiscordMessageStickers as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as chunkDiscordTextWithMode, f as resolveDiscordReplyReference, g as normalizeDiscordOutboundTarget, l as toDiscordOutboundDeliveryResult, o as createDiscordSendReceipt, r as hasDiscordMessageCreateAmbiguity, s as createDiscordSendReceiptFromResults } from "./retry-
|
|
2
|
-
import { t as createDiscordActionGate } from "./accounts-
|
|
3
|
-
import { g as notifyDiscordInboundEventOutboundPayloadSuccess, h as discordInboundEventDelivery, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-
|
|
4
|
-
import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
1
|
+
import { a as chunkDiscordTextWithMode, f as resolveDiscordReplyReference, g as normalizeDiscordOutboundTarget, l as toDiscordOutboundDeliveryResult, o as createDiscordSendReceipt, r as hasDiscordMessageCreateAmbiguity, s as createDiscordSendReceiptFromResults } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { t as createDiscordActionGate } from "./accounts-CwJQoLjM.js";
|
|
3
|
+
import { g as notifyDiscordInboundEventOutboundPayloadSuccess, h as discordInboundEventDelivery, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-CzzerX2K.js";
|
|
4
|
+
import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-Bnt_7x7r.js";
|
|
5
5
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { getReplyPayloadTtsSupplement, resolvePayloadMediaUrls, sendPayloadMediaSequenceOrFallback, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -33,7 +33,8 @@ function normalizeMediaPathForExtension(mediaUrl) {
|
|
|
33
33
|
}
|
|
34
34
|
} catch {
|
|
35
35
|
const withoutHash = trimmed.split("#", 1)[0] ?? trimmed;
|
|
36
|
-
|
|
36
|
+
const withoutQuery = withoutHash.split("?", 1)[0] ?? withoutHash;
|
|
37
|
+
return normalizeLowercaseStringOrEmpty(withoutQuery);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
function isLikelyDiscordVideoMedia(mediaUrl) {
|
|
@@ -59,7 +60,7 @@ function normalizeDiscordApprovalPayload(payload) {
|
|
|
59
60
|
}
|
|
60
61
|
//#endregion
|
|
61
62
|
//#region extensions/discord/src/outbound-send-context.ts
|
|
62
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
63
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-mTKSBdmZ.js").then((n) => n.t));
|
|
63
64
|
function resolveDiscordOutboundTarget(params) {
|
|
64
65
|
if (params.threadId == null) return params.to;
|
|
65
66
|
const threadId = normalizeOptionalStringifiedId(params.threadId) ?? "";
|
|
@@ -113,7 +114,8 @@ function resolveDiscordDeliveryOptions(ctx, sendContext, reply = sendContext.res
|
|
|
113
114
|
accountId: ctx.accountId ?? void 0,
|
|
114
115
|
silent: ctx.silent ?? void 0,
|
|
115
116
|
cfg: ctx.cfg,
|
|
116
|
-
onPlatformSendDispatch: ctx.onPlatformSendDispatch
|
|
117
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
118
|
+
assertPlatformSendAuthorized: ctx.assertDirectAdapterHandoff
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
function resolveDiscordFormattedDeliveryOptions(ctx, sendContext, reply = sendContext.resolveReply()) {
|
|
@@ -278,8 +280,8 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
278
280
|
//#region extensions/discord/src/outbound-adapter.ts
|
|
279
281
|
const DISCORD_TEXT_CHUNK_LIMIT = 2e3;
|
|
280
282
|
const log = createSubsystemLogger("discord/outbound");
|
|
281
|
-
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-
|
|
282
|
-
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-
|
|
283
|
+
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-wECUSIIG.js").then((n) => n.t));
|
|
284
|
+
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-nsPnc7kK.js").then((n) => n.i));
|
|
283
285
|
function resolveDiscordWebhookIdentity(params) {
|
|
284
286
|
const usernameRaw = normalizeOptionalString(params.identity?.name);
|
|
285
287
|
const fallbackUsername = normalizeOptionalString(params.binding.label) ?? params.binding.agentId;
|
|
@@ -311,7 +313,8 @@ async function maybeSendDiscordWebhookText(params) {
|
|
|
311
313
|
replyTo: params.replyToId ?? void 0,
|
|
312
314
|
username: persona.username,
|
|
313
315
|
avatarUrl: persona.avatarUrl,
|
|
314
|
-
onPlatformSendDispatch: params.onPlatformSendDispatch
|
|
316
|
+
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
317
|
+
assertPlatformSendAuthorized: params.assertPlatformSendAuthorized
|
|
315
318
|
});
|
|
316
319
|
}
|
|
317
320
|
async function resolveDiscordOutboundMessageSend(params) {
|
|
@@ -337,7 +340,8 @@ async function resolveDiscordOutboundMessageSend(params) {
|
|
|
337
340
|
onDeliveryResult: params.onDeliveryResult ? async (result) => {
|
|
338
341
|
await params.onDeliveryResult?.(attachChannelToResult("discord", toDiscordOutboundDeliveryResult(result)));
|
|
339
342
|
} : void 0,
|
|
340
|
-
onPlatformSendDispatch: params.onPlatformSendDispatch
|
|
343
|
+
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
344
|
+
assertPlatformSendAuthorized: params.assertDirectAdapterHandoff
|
|
341
345
|
}
|
|
342
346
|
};
|
|
343
347
|
}
|
|
@@ -388,7 +392,8 @@ const discordOutbound = {
|
|
|
388
392
|
onPlatformSendDispatch: ctx.onPlatformSendDispatch ? async () => {
|
|
389
393
|
webhookSelected = true;
|
|
390
394
|
await ctx.onPlatformSendDispatch?.();
|
|
391
|
-
} : void 0
|
|
395
|
+
} : void 0,
|
|
396
|
+
assertPlatformSendAuthorized: ctx.assertDirectAdapterHandoff
|
|
392
397
|
});
|
|
393
398
|
if (webhookResult) return toDiscordOutboundDeliveryResult(webhookResult);
|
|
394
399
|
} catch (error) {
|
|
@@ -401,16 +406,20 @@ const discordOutbound = {
|
|
|
401
406
|
},
|
|
402
407
|
sendMedia: async (ctx) => {
|
|
403
408
|
const { send, target, options } = await resolveDiscordOutboundMessageSend(ctx);
|
|
404
|
-
if (ctx.audioAsVoice && ctx.mediaUrl)
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
409
|
+
if (ctx.audioAsVoice && ctx.mediaUrl) {
|
|
410
|
+
const sendVoice = resolveOutboundSendDep(ctx.deps, "discordVoice") ?? (await loadDiscordSendRuntime()).sendVoiceMessageDiscord;
|
|
411
|
+
return toDiscordOutboundDeliveryResult(await sendVoice(target, ctx.mediaUrl, {
|
|
412
|
+
cfg: ctx.cfg,
|
|
413
|
+
reply: options.reply,
|
|
414
|
+
accountId: ctx.accountId ?? void 0,
|
|
415
|
+
silent: ctx.silent ?? void 0,
|
|
416
|
+
mediaAccess: ctx.mediaAccess,
|
|
417
|
+
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
418
|
+
mediaReadFile: ctx.mediaReadFile,
|
|
419
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
420
|
+
assertPlatformSendAuthorized: ctx.assertDirectAdapterHandoff
|
|
421
|
+
}));
|
|
422
|
+
}
|
|
414
423
|
const mediaOptions = {
|
|
415
424
|
...options,
|
|
416
425
|
mediaUrl: ctx.mediaUrl,
|
|
@@ -435,7 +444,7 @@ const discordOutbound = {
|
|
|
435
444
|
}
|
|
436
445
|
return toDiscordOutboundDeliveryResult(await send(target, ctx.text, mediaOptions));
|
|
437
446
|
},
|
|
438
|
-
sendPoll: async ({ cfg, to, poll, content, accountId, threadId, silent, sessionKey, inboundEventKind, onPlatformSendDispatch }) => {
|
|
447
|
+
sendPoll: async ({ cfg, to, poll, content, accountId, threadId, silent, sessionKey, inboundEventKind, onPlatformSendDispatch, assertDirectAdapterHandoff }) => {
|
|
439
448
|
if (!createDiscordActionGate({
|
|
440
449
|
cfg,
|
|
441
450
|
accountId
|
|
@@ -450,7 +459,8 @@ const discordOutbound = {
|
|
|
450
459
|
threadId: threadId ?? void 0,
|
|
451
460
|
silent: silent ?? void 0,
|
|
452
461
|
cfg,
|
|
453
|
-
onPlatformSendDispatch
|
|
462
|
+
onPlatformSendDispatch,
|
|
463
|
+
assertPlatformSendAuthorized: assertDirectAdapterHandoff
|
|
454
464
|
});
|
|
455
465
|
discordInboundEventDelivery.notify({
|
|
456
466
|
sessionKey,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as readDiscordComponentSpec } from "./components-
|
|
1
|
+
import { h as readDiscordComponentSpec } from "./components-gvRA0oaI.js";
|
|
2
2
|
import { resolveAskUserQuestionOptionIndices } from "openclaw/plugin-sdk/reply-payload";
|
|
3
3
|
import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
4
4
|
//#region extensions/discord/src/outbound-components.ts
|
|
@@ -31,11 +31,11 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-
|
|
34
|
+
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-nsPnc7kK.js").then((n) => n.i), "sendDiscordComponentMessage");
|
|
35
35
|
async function sendDiscordComponentMessageLazy(...args) {
|
|
36
36
|
return await (await loadDiscordComponentSend())(...args);
|
|
37
37
|
}
|
|
38
|
-
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-
|
|
38
|
+
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-gvRA0oaI.js").then((n) => n.a));
|
|
39
39
|
function addPayloadTextFallback(spec, payload) {
|
|
40
40
|
return spec.text ? spec : {
|
|
41
41
|
...spec,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as parseDiscordTarget, h as normalizeDiscordMessagingTarget } from "./retry-
|
|
2
|
-
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-
|
|
3
|
-
import { c as resolveDiscordAccount, r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-
|
|
4
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
1
|
+
import { _ as parseDiscordTarget, h as normalizeDiscordMessagingTarget } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-gvRA0oaI.js";
|
|
3
|
+
import { c as resolveDiscordAccount, r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-CwJQoLjM.js";
|
|
4
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
|
|
5
5
|
import { ChannelType } from "discord-api-types/v10";
|
|
6
6
|
import { Type } from "typebox";
|
|
7
7
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -43,8 +43,9 @@ function getDiscordExecApprovalApprovers(params) {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
function isDiscordExecApprovalClientEnabled(params) {
|
|
46
|
+
const config = params.configOverride ?? resolveDiscordAccount(params).config.execApprovals;
|
|
46
47
|
return isChannelExecApprovalClientEnabledFromConfig({
|
|
47
|
-
enabled:
|
|
48
|
+
enabled: config?.enabled,
|
|
48
49
|
approverCount: getDiscordExecApprovalApprovers({
|
|
49
50
|
cfg: params.cfg,
|
|
50
51
|
accountId: params.accountId,
|
|
@@ -201,7 +202,9 @@ function withDiscordInboundEventDeliveryMetadata(payload, params) {
|
|
|
201
202
|
};
|
|
202
203
|
}
|
|
203
204
|
function notifyDiscordInboundEventOutboundPayloadSuccess(params) {
|
|
204
|
-
const
|
|
205
|
+
const channelData = asOptionalRecord(params.payload.channelData);
|
|
206
|
+
const discordData = asOptionalRecord(channelData?.discord);
|
|
207
|
+
const metadata = asOptionalRecord(discordData?.[DISCORD_INBOUND_EVENT_DELIVERY_KEY]);
|
|
205
208
|
if (!metadata) return;
|
|
206
209
|
discordInboundEventDelivery.notify({
|
|
207
210
|
sessionKey: normalizeOptionalString(metadata.sessionKey),
|
|
@@ -262,7 +265,7 @@ function matchesCurrentDiscordThread(params) {
|
|
|
262
265
|
if (!requestedTarget) return false;
|
|
263
266
|
return [params.toolContext.currentChannelId, params.toolContext.currentMessagingTarget].some((currentTarget) => currentTarget !== void 0 && normalizeDiscordMessagingTarget(currentTarget) === requestedTarget);
|
|
264
267
|
}
|
|
265
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./channel-actions.runtime-
|
|
268
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./channel-actions.runtime-B2wMqeVK.js"));
|
|
266
269
|
function listDiscoverableDiscordAccounts(cfg) {
|
|
267
270
|
return listDiscordAccountIds(cfg).map((accountId) => inspectDiscordAccount({
|
|
268
271
|
cfg,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
2
|
-
import { c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordCommandOwnerAllowFrom, f as resolveDiscordGuildEntry, n as isDiscordGroupAllowedByPolicy, p as resolveDiscordMemberAccessState, r as normalizeDiscordAllowList, t as allowListMatches } from "./allow-list-
|
|
1
|
+
import { l as resolveDiscordAccountAllowFrom } from "./accounts-CwJQoLjM.js";
|
|
2
|
+
import { c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordCommandOwnerAllowFrom, f as resolveDiscordGuildEntry, n as isDiscordGroupAllowedByPolicy, p as resolveDiscordMemberAccessState, r as normalizeDiscordAllowList, t as allowListMatches } from "./allow-list-C2JuH-R0.js";
|
|
3
3
|
import { resolveCommandAuthorizedFromAuthorizers } from "openclaw/plugin-sdk/command-auth-native";
|
|
4
4
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
5
5
|
//#region extensions/discord/src/voice/access.ts
|
|
@@ -9,11 +9,12 @@ async function authorizeDiscordVoiceIngress(params) {
|
|
|
9
9
|
groupPolicy: params.discordConfig.groupPolicy,
|
|
10
10
|
defaultGroupPolicy: params.cfg.channels?.defaults?.groupPolicy
|
|
11
11
|
}).groupPolicy;
|
|
12
|
+
const guild = params.guild ?? {
|
|
13
|
+
id: params.guildId,
|
|
14
|
+
...params.guildName ? { name: params.guildName } : {}
|
|
15
|
+
};
|
|
12
16
|
const guildInfo = resolveDiscordGuildEntry({
|
|
13
|
-
guild
|
|
14
|
-
id: params.guildId,
|
|
15
|
-
...params.guildName ? { name: params.guildName } : {}
|
|
16
|
-
},
|
|
17
|
+
guild,
|
|
17
18
|
guildId: params.guildId,
|
|
18
19
|
guildEntries: params.discordConfig.guilds
|
|
19
20
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { on as __exportAll } from "./retry-
|
|
1
|
+
import { on as __exportAll } from "./retry-t5RcEsPk.js";
|
|
2
2
|
import { readProviderJsonObjectResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
3
3
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
4
4
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
5
5
|
//#region extensions/discord/src/pluralkit.ts
|
|
6
6
|
var pluralkit_exports = /* @__PURE__ */ __exportAll({ fetchPluralKitMessageInfo: () => fetchPluralKitMessageInfo });
|
|
7
7
|
const PLURALKIT_API_BASE = "https://api.pluralkit.me/v2";
|
|
8
|
-
const PLURALKIT_ERROR_BODY_LIMIT_BYTES =
|
|
8
|
+
const PLURALKIT_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
9
9
|
const PLURALKIT_LOOKUP_TIMEOUT_MS = 1e4;
|
|
10
10
|
async function fetchPluralKitMessageInfo(params) {
|
|
11
11
|
if (!params.config?.enabled) return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { m as normalizeDiscordToken } from "./accounts-
|
|
2
|
-
import { n as DiscordApiError, r as fetchDiscord } from "./api-
|
|
1
|
+
import { m as normalizeDiscordToken } from "./accounts-CwJQoLjM.js";
|
|
2
|
+
import { n as DiscordApiError, r as fetchDiscord } from "./api-BfmEP6wp.js";
|
|
3
3
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
@@ -7,7 +7,7 @@ import { fetchWithTimeout, runChannelProbe } from "openclaw/plugin-sdk/text-util
|
|
|
7
7
|
//#region extensions/discord/src/probe.ts
|
|
8
8
|
const DISCORD_API_BASE = "https://discord.com/api/v10";
|
|
9
9
|
const DISCORD_PROBE_GET_ME_LABEL = "discord.probe.getMe";
|
|
10
|
-
const DISCORD_PROBE_JSON_MAX_BYTES =
|
|
10
|
+
const DISCORD_PROBE_JSON_MAX_BYTES = 16777216;
|
|
11
11
|
const DISCORD_PROBE_COMPLETION_RESERVE_MAX_MS = 25;
|
|
12
12
|
const DISCORD_APP_FLAG_GATEWAY_PRESENCE = 4096;
|
|
13
13
|
const DISCORD_APP_FLAG_GATEWAY_PRESENCE_LIMITED = 8192;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as probeDiscordApplicationId, i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
1
|
+
import { a as probeDiscordApplicationId, i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-3ovFAp3b.js";
|
|
2
2
|
export { fetchDiscordApplicationId, fetchDiscordApplicationSummary, parseApplicationIdFromToken, probeDiscord, probeDiscordApplicationId, resolveDiscordPrivilegedIntentsFromFlags };
|