@openclaw/discord 2026.6.5 → 2026.6.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +2 -2
- package/dist/{channel-rVB2j2W5.js → channel-DlHZQ7hD.js} +2 -2
- package/dist/{channel-actions-BaPDAWN_.js → channel-actions-DQxnmgig.js} +4 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -7
- package/dist/{manager.runtime-DyYIi2by.js → manager.runtime-DXu3zRnz.js} +1 -1
- package/dist/{message-handler-BVIAmV5J.js → message-handler-CE08Iece.js} +5 -5
- package/dist/{message-handler.preflight-BwvDbPNH.js → message-handler.preflight-Cfk3y-JG.js} +12 -3
- package/dist/{message-handler.process-fTJCmd5o.js → message-handler.process-crWGZPOR.js} +9 -20
- package/dist/{message-utils-ZTGvA2L8.js → message-utils-C7h3boE6.js} +1 -1
- package/dist/{provider-BzydhoOf.js → provider-M0xrcgNL.js} +5 -5
- package/dist/{provider-session.runtime-CXhifSRN.js → provider-session.runtime-BreV_iSI.js} +1 -1
- package/dist/provider.runtime-gcRpnvqY.js +2 -0
- package/dist/runtime-api.actions.js +1 -1
- package/dist/runtime-api.js +7 -7
- package/dist/runtime-api.monitor-DHdsCQ8T.js +6 -0
- package/dist/runtime-api.monitor.js +6 -6
- package/dist/session-binding-contract-api.js +2 -0
- package/dist/timeouts-C5TBc_9x.js +106 -0
- package/dist/timeouts.js +1 -1
- package/dist/{typing-C7RXECnL.js → typing-B6jd22UG.js} +1 -1
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
- package/dist/provider.runtime-_cUqt2ma.js +0 -2
- package/dist/runtime-api.monitor-DuIuN9Ro.js +0 -6
- package/dist/timeouts-CEJ3--Uw.js +0 -55
package/dist/api.js
CHANGED
|
@@ -6,7 +6,7 @@ import { n as fetchDiscord, r as requestDiscord, t as DiscordApiError } from "./
|
|
|
6
6
|
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-BKGK0ftO.js";
|
|
7
7
|
import "./targets-Cv797U29.js";
|
|
8
8
|
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-CEP1KbK0.js";
|
|
9
|
-
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-
|
|
9
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-DlHZQ7hD.js";
|
|
10
10
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
11
11
|
import { t as discordSetupPlugin } from "./channel.setup-BX7g7pL-.js";
|
|
12
12
|
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-nBcp0iGm.js";
|
|
@@ -15,7 +15,7 @@ import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPee
|
|
|
15
15
|
import { t as fetchPluralKitMessageInfo } from "./pluralkit-BEEldePl.js";
|
|
16
16
|
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-2MdGjUAf.js";
|
|
17
17
|
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-Bh_65L5C.js";
|
|
18
|
-
import {
|
|
18
|
+
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, o as mergeAbortSignals, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-C5TBc_9x.js";
|
|
19
19
|
import { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
20
20
|
//#region extensions/discord/api.ts
|
|
21
21
|
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-BEMDJjP1.js")).handleDiscordMessageAction(...args);
|
|
@@ -5,7 +5,7 @@ import { x as resolveDiscordOutboundSessionRoute } from "./components-CCbYVuVr.j
|
|
|
5
5
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
6
6
|
import { c as shouldSuppressLocalDiscordExecApprovalPrompt, n as resolveDiscordCurrentConversationIdentity, r as getDiscordApprovalCapability } from "./conversation-identity-CEP1KbK0.js";
|
|
7
7
|
import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-xwjIczO0.js";
|
|
8
|
-
import { t as discordMessageActions$1 } from "./channel-actions-
|
|
8
|
+
import { t as discordMessageActions$1 } from "./channel-actions-DQxnmgig.js";
|
|
9
9
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DeMxmcXB.js";
|
|
10
10
|
import { n as discordOutbound } from "./outbound-adapter-Bt6-9M13.js";
|
|
11
11
|
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-D11J9bXI.js";
|
|
@@ -131,7 +131,7 @@ const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./re
|
|
|
131
131
|
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-CRc4hYr1.js").then((n) => n.a));
|
|
132
132
|
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BKGK0ftO.js").then((n) => n.r));
|
|
133
133
|
async function loadDiscordProviderRuntime() {
|
|
134
|
-
discordProviderRuntimePromise ??= import("./provider.runtime-
|
|
134
|
+
discordProviderRuntimePromise ??= import("./provider.runtime-gcRpnvqY.js");
|
|
135
135
|
return await discordProviderRuntimePromise;
|
|
136
136
|
}
|
|
137
137
|
async function loadDiscordProbeRuntime() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-DlHZQ7hD.js";
|
|
2
2
|
export { discordPlugin };
|
package/dist/contract-api.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-CU7lnZTF.js";
|
|
2
|
-
import { n as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-BjM-1hr9.js";
|
|
3
|
-
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DSHk7I2w.js";
|
|
4
1
|
import { t as deriveLegacySessionChatType } from "./session-contract-BO5tlIdl.js";
|
|
5
|
-
|
|
6
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-j1bfTue_.js";
|
|
7
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-Bh_65L5C.js";
|
|
8
|
-
export { collectDiscordSecurityAuditFindings, collectRuntimeConfigAssignments, collectUnsupportedSecretRefConfigCandidates, createThreadBindingManager, deriveLegacySessionChatType, testing as discordThreadBindingTesting, legacyConfigRules, listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig, normalizeCompatibilityConfig, secretTargetRegistryEntries, unsupportedSecretRefSurfacePatterns };
|
|
2
|
+
export { deriveLegacySessionChatType };
|
|
@@ -3,7 +3,7 @@ import { c as resolveDiscordAccountAllowFrom } from "./accounts-P19jm1lf.js";
|
|
|
3
3
|
import { a as normalizeDiscordSlug, b as formatDiscordUserTag, m as resolveDiscordOwnerAccess } from "./allow-list-C-MqM-B_.js";
|
|
4
4
|
import { o as formatMention } from "./send.outbound-DhMLobqR.js";
|
|
5
5
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
6
|
-
import { d as resolveDiscordVoiceEnabled, p as buildDiscordGroupSystemPrompt, s as authorizeDiscordVoiceIngress } from "./provider-
|
|
6
|
+
import { d as resolveDiscordVoiceEnabled, p as buildDiscordGroupSystemPrompt, s as authorizeDiscordVoiceIngress } from "./provider-M0xrcgNL.js";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import { asBoolean, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { I as createDiscordRestClient } from "./send.shared-B3QxPnR3.js";
|
|
2
2
|
import { d as resolveDiscordChannelNameSafe, l as resolveDiscordChannelIdSafe, p as resolveDiscordChannelParentSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-CfDs1lWu.js";
|
|
3
|
-
import {
|
|
4
|
-
import { c as hasDiscordMessageStickers, d as resolveDiscordMessageChannelId, r as resolveDiscordMessageText } from "./message-utils-
|
|
5
|
-
import { t as sendTyping } from "./typing-
|
|
3
|
+
import { o as mergeAbortSignals } from "./timeouts-C5TBc_9x.js";
|
|
4
|
+
import { c as hasDiscordMessageStickers, d as resolveDiscordMessageChannelId, r as resolveDiscordMessageText } from "./message-utils-C7h3boE6.js";
|
|
5
|
+
import { t as sendTyping } from "./typing-B6jd22UG.js";
|
|
6
6
|
import { danger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
7
7
|
import { createChannelRunQueue, createTypingCallbacks, resolveChannelMessageSourceReplyDeliveryMode } from "openclaw/plugin-sdk/channel-outbound";
|
|
8
8
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
@@ -178,7 +178,7 @@ function resolveDiscordAcceptedTypingPrestart(ctx) {
|
|
|
178
178
|
//#region extensions/discord/src/monitor/message-run-queue.ts
|
|
179
179
|
let messageProcessRuntimePromise;
|
|
180
180
|
async function loadMessageProcessRuntime() {
|
|
181
|
-
messageProcessRuntimePromise ??= import("./message-handler.process-
|
|
181
|
+
messageProcessRuntimePromise ??= import("./message-handler.process-crWGZPOR.js");
|
|
182
182
|
return await messageProcessRuntimePromise;
|
|
183
183
|
}
|
|
184
184
|
async function processDiscordQueuedMessage(params) {
|
|
@@ -307,7 +307,7 @@ function createDiscordReplyTypingFeedback(params) {
|
|
|
307
307
|
//#region extensions/discord/src/monitor/message-handler.ts
|
|
308
308
|
let messagePreflightRuntimePromise;
|
|
309
309
|
async function loadMessagePreflightRuntime() {
|
|
310
|
-
messagePreflightRuntimePromise ??= import("./message-handler.preflight-
|
|
310
|
+
messagePreflightRuntimePromise ??= import("./message-handler.preflight-Cfk3y-JG.js");
|
|
311
311
|
return await messagePreflightRuntimePromise;
|
|
312
312
|
}
|
|
313
313
|
function isNonEmptyString(value) {
|
package/dist/{message-handler.preflight-BwvDbPNH.js → message-handler.preflight-Cfk3y-JG.js}
RENAMED
|
@@ -5,10 +5,11 @@ import { t as resolveDiscordConversationIdentity } from "./conversation-identity
|
|
|
5
5
|
import { d as isRecentlyUnboundThreadWebhookMessage } from "./thread-bindings.state-CVLF7gJH.js";
|
|
6
6
|
import { d as resolveDiscordChannelNameSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-CfDs1lWu.js";
|
|
7
7
|
import "./thread-bindings-Tfr_vFxk.js";
|
|
8
|
-
import { D as resolveDiscordDmCommandAccess, O as resolveDiscordTextCommandAccess, _ as resolveDiscordConversationRoute, b as handleDiscordDmCommandDecision, g as buildDiscordRoutePeer, v as resolveDiscordEffectiveRoute, y as shouldIgnoreStaleDiscordRouteBinding } from "./provider-
|
|
9
|
-
import { d as resolveDiscordMessageChannelId, l as resolveDiscordMessageStickers, o as resolveMediaList, r as resolveDiscordMessageText, u as resolveDiscordChannelInfo } from "./message-utils-
|
|
8
|
+
import { D as resolveDiscordDmCommandAccess, O as resolveDiscordTextCommandAccess, _ as resolveDiscordConversationRoute, b as handleDiscordDmCommandDecision, g as buildDiscordRoutePeer, v as resolveDiscordEffectiveRoute, y as shouldIgnoreStaleDiscordRouteBinding } from "./provider-M0xrcgNL.js";
|
|
9
|
+
import { d as resolveDiscordMessageChannelId, l as resolveDiscordMessageStickers, o as resolveMediaList, r as resolveDiscordMessageText, u as resolveDiscordChannelInfo } from "./message-utils-C7h3boE6.js";
|
|
10
10
|
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-CEsfDF0L.js";
|
|
11
11
|
import { normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
|
+
import { MessageReferenceType, MessageType } from "discord-api-types/v10";
|
|
12
13
|
import { getChildLogger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
13
14
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
14
15
|
import { formatAllowlistMatchMeta } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -189,6 +190,7 @@ function copyRuntimeMessageFields(source, target) {
|
|
|
189
190
|
if (channelDescriptor) Object.defineProperty(target, "channel", channelDescriptor);
|
|
190
191
|
}
|
|
191
192
|
function shouldHydrateDiscordMessage(params) {
|
|
193
|
+
if (hasMissingReferencedMessagePayload(params.message)) return true;
|
|
192
194
|
let currentText;
|
|
193
195
|
try {
|
|
194
196
|
currentText = resolveDiscordMessageText(params.message, { includeForwarded: true });
|
|
@@ -199,6 +201,13 @@ function shouldHydrateDiscordMessage(params) {
|
|
|
199
201
|
if ((params.message.mentionedUsers?.length ?? 0) > 0 || (params.message.mentionedRoles?.length ?? 0) > 0 || params.message.mentionedEveryone) return false;
|
|
200
202
|
return /<@!?\d+>|<@&\d+>|@everyone|@here/u.test(currentText);
|
|
201
203
|
}
|
|
204
|
+
function hasMissingReferencedMessagePayload(message) {
|
|
205
|
+
const reference = message.messageReference;
|
|
206
|
+
if (!reference?.message_id) return false;
|
|
207
|
+
if (reference.type != null && reference.type !== MessageReferenceType.Default) return false;
|
|
208
|
+
if (message.type != null && message.type !== MessageType.Reply) return false;
|
|
209
|
+
return !Object.hasOwn(readMessageRawData(message), "referenced_message");
|
|
210
|
+
}
|
|
202
211
|
async function hydrateDiscordMessageIfNeeded(params) {
|
|
203
212
|
params.channelInfo;
|
|
204
213
|
if (!shouldHydrateDiscordMessage({ message: params.message })) return params.message;
|
|
@@ -438,7 +447,7 @@ async function loadSystemEventsRuntime() {
|
|
|
438
447
|
return await systemEventsRuntimePromise;
|
|
439
448
|
}
|
|
440
449
|
async function loadDiscordThreadingRuntime() {
|
|
441
|
-
discordThreadingRuntimePromise ??= import("./provider-
|
|
450
|
+
discordThreadingRuntimePromise ??= import("./provider-M0xrcgNL.js").then((n) => n.S);
|
|
442
451
|
return await discordThreadingRuntimePromise;
|
|
443
452
|
}
|
|
444
453
|
function isPreflightAborted(abortSignal) {
|
|
@@ -9,22 +9,22 @@ import { t as resolveDiscordConversationIdentity } from "./conversation-identity
|
|
|
9
9
|
import { t as beginDiscordInboundEventDeliveryCorrelation } from "./inbound-event-delivery-CEPlt2uz.js";
|
|
10
10
|
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-Bt6-9M13.js";
|
|
11
11
|
import { t as resolveDiscordPreviewStreamMode } from "./preview-streaming-DXT8oJdo.js";
|
|
12
|
-
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
13
|
-
import { C as resolveDiscordAutoThreadReplyPlan, T as resolveDiscordThreadStarter, a as buildGuildLabel, h as createDiscordSupplementalContextAccessChecker, i as buildDirectLabel, m as buildDiscordInboundAccessContext, n as deliverDiscordReply, o as resolveReplyContext, r as sanitizeDiscordFrontChannelReplyPayloads } from "./provider-
|
|
14
|
-
import { a as resolveForwardedMediaList, o as resolveMediaList, r as resolveDiscordMessageText, s as resolveReferencedReplyMediaList } from "./message-utils-
|
|
15
|
-
import { n as createDiscordReplyTypingFeedback } from "./message-handler-
|
|
16
|
-
import { buildAgentSessionKey,
|
|
12
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-C5TBc_9x.js";
|
|
13
|
+
import { C as resolveDiscordAutoThreadReplyPlan, T as resolveDiscordThreadStarter, a as buildGuildLabel, h as createDiscordSupplementalContextAccessChecker, i as buildDirectLabel, m as buildDiscordInboundAccessContext, n as deliverDiscordReply, o as resolveReplyContext, r as sanitizeDiscordFrontChannelReplyPayloads } from "./provider-M0xrcgNL.js";
|
|
14
|
+
import { a as resolveForwardedMediaList, o as resolveMediaList, r as resolveDiscordMessageText, s as resolveReferencedReplyMediaList } from "./message-utils-C7h3boE6.js";
|
|
15
|
+
import { n as createDiscordReplyTypingFeedback } from "./message-handler-CE08Iece.js";
|
|
16
|
+
import { buildAgentSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
17
17
|
import { MessageFlags } from "discord-api-types/v10";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { evaluateSupplementalContextVisibility } from "openclaw/plugin-sdk/security-runtime";
|
|
20
20
|
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
|
|
21
21
|
import { buildTtsSupplementMediaPayload, getReplyPayloadTtsSupplement, isReplyPayloadNonTerminalToolErrorWarning, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
22
|
-
import { resolveChunkMode
|
|
22
|
+
import { resolveChunkMode } from "openclaw/plugin-sdk/reply-chunking";
|
|
23
23
|
import { danger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
24
24
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
25
25
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
26
26
|
import { convertMarkdownTables, stripInlineDirectiveTagsForDelivery, stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
27
|
-
import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createFinalizableDraftLifecycle, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelStreamingBlockEnabled,
|
|
27
|
+
import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createFinalizableDraftLifecycle, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, resolveChannelDraftStreamingChunking, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages, resolveTranscriptBackedChannelFinalText } from "openclaw/plugin-sdk/channel-outbound";
|
|
28
28
|
import { recordInboundSession, resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/conversation-runtime";
|
|
29
29
|
import { EmbeddedBlockChunker, resolveAckReaction, resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
30
30
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -409,20 +409,8 @@ async function buildDiscordMessageProcessContext(params) {
|
|
|
409
409
|
}
|
|
410
410
|
//#endregion
|
|
411
411
|
//#region extensions/discord/src/draft-chunking.ts
|
|
412
|
-
const DEFAULT_DISCORD_DRAFT_STREAM_MIN = 200;
|
|
413
|
-
const DEFAULT_DISCORD_DRAFT_STREAM_MAX = 800;
|
|
414
412
|
function resolveDiscordDraftStreamingChunking(cfg, accountId) {
|
|
415
|
-
|
|
416
|
-
const normalizedAccountId = normalizeAccountId(accountId);
|
|
417
|
-
const draftCfg = resolveChannelStreamingPreviewChunk(resolveAccountEntry(cfg?.channels?.discord?.accounts, normalizedAccountId)) ?? resolveChannelStreamingPreviewChunk(cfg?.channels?.discord);
|
|
418
|
-
const maxRequested = Math.max(1, Math.floor(draftCfg?.maxChars ?? DEFAULT_DISCORD_DRAFT_STREAM_MAX));
|
|
419
|
-
const maxChars = Math.max(1, Math.min(maxRequested, textLimit));
|
|
420
|
-
const minRequested = Math.max(1, Math.floor(draftCfg?.minChars ?? DEFAULT_DISCORD_DRAFT_STREAM_MIN));
|
|
421
|
-
return {
|
|
422
|
-
minChars: Math.min(minRequested, maxChars),
|
|
423
|
-
maxChars,
|
|
424
|
-
breakPreference: draftCfg?.breakPreference === "newline" || draftCfg?.breakPreference === "sentence" ? draftCfg.breakPreference : "paragraph"
|
|
425
|
-
};
|
|
413
|
+
return resolveChannelDraftStreamingChunking(cfg, "discord", accountId, { fallbackLimit: DISCORD_TEXT_CHUNK_LIMIT });
|
|
426
414
|
}
|
|
427
415
|
//#endregion
|
|
428
416
|
//#region extensions/discord/src/draft-stream.ts
|
|
@@ -1350,6 +1338,7 @@ async function processDiscordMessageInner(ctx, observer) {
|
|
|
1350
1338
|
onReasoningEnd: draftPreview.draftStream ? () => draftPreview.handleAssistantMessageBoundary() : void 0,
|
|
1351
1339
|
onModelSelected,
|
|
1352
1340
|
suppressDefaultToolProgressMessages: draftPreview.suppressDefaultToolProgressMessages ? true : void 0,
|
|
1341
|
+
commentaryProgressEnabled: draftPreview.isProgressMode ? draftPreview.commentaryProgressEnabled : void 0,
|
|
1353
1342
|
onReasoningStream: async (payload) => {
|
|
1354
1343
|
await statusReactions.setThinking();
|
|
1355
1344
|
await draftPreview.pushReasoningProgress(payload?.text, { snapshot: payload?.isReasoningSnapshot === true });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-CfDs1lWu.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as mergeAbortSignals } from "./timeouts-C5TBc_9x.js";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { ComponentType, StickerFormatType } from "discord-api-types/v10";
|
|
5
5
|
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -14,8 +14,8 @@ import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-DLNfxFQP
|
|
|
14
14
|
import { t as resolveDiscordUserAllowlist } from "./resolve-users-QTyD8qgI.js";
|
|
15
15
|
import { _ as formatThreadBindingDurationLabel, a as isThreadArchived, d as resolveDiscordChannelNameSafe, f as resolveDiscordChannelParentIdSafe, l as resolveDiscordChannelIdSafe, m as resolveDiscordChannelTopicSafe, p as resolveDiscordChannelParentSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-CfDs1lWu.js";
|
|
16
16
|
import { r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-2MdGjUAf.js";
|
|
17
|
-
import {
|
|
18
|
-
import { d as resolveDiscordMessageChannelId, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText, u as resolveDiscordChannelInfo } from "./message-utils-
|
|
17
|
+
import { d as withAbortTimeout, l as raceWithTimeout } from "./timeouts-C5TBc_9x.js";
|
|
18
|
+
import { d as resolveDiscordMessageChannelId, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText, u as resolveDiscordChannelInfo } from "./message-utils-C7h3boE6.js";
|
|
19
19
|
import { t as resolveDiscordSenderIdentity } from "./sender-identity-CEsfDF0L.js";
|
|
20
20
|
import "./approval-handler.runtime-DQiJ1Z0k.js";
|
|
21
21
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -7916,7 +7916,7 @@ async function loadConversationRuntime$1() {
|
|
|
7916
7916
|
return await conversationRuntimePromise$1;
|
|
7917
7917
|
}
|
|
7918
7918
|
async function loadTypingRuntime() {
|
|
7919
|
-
typingRuntimePromise ??= import("./typing-
|
|
7919
|
+
typingRuntimePromise ??= import("./typing-B6jd22UG.js").then((n) => n.n);
|
|
7920
7920
|
return await typingRuntimePromise;
|
|
7921
7921
|
}
|
|
7922
7922
|
function buildDiscordComponentConversationLabel(params) {
|
|
@@ -9833,7 +9833,7 @@ function logDiscordStartupPhase(params) {
|
|
|
9833
9833
|
});
|
|
9834
9834
|
}
|
|
9835
9835
|
async function loadDiscordVoiceRuntime() {
|
|
9836
|
-
const promise = discordVoiceRuntimePromise ?? import("./manager.runtime-
|
|
9836
|
+
const promise = discordVoiceRuntimePromise ?? import("./manager.runtime-DXu3zRnz.js");
|
|
9837
9837
|
discordVoiceRuntimePromise = promise;
|
|
9838
9838
|
try {
|
|
9839
9839
|
return await promise;
|
|
@@ -9843,7 +9843,7 @@ async function loadDiscordVoiceRuntime() {
|
|
|
9843
9843
|
}
|
|
9844
9844
|
}
|
|
9845
9845
|
async function loadDiscordProviderSessionRuntime() {
|
|
9846
|
-
const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-
|
|
9846
|
+
const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-BreV_iSI.js");
|
|
9847
9847
|
discordProviderSessionRuntimePromise = promise;
|
|
9848
9848
|
try {
|
|
9849
9849
|
return await promise;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-Tfr_vFxk.js";
|
|
2
2
|
import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-CRc4hYr1.js";
|
|
3
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
3
|
+
import { t as createDiscordMessageHandler } from "./message-handler-CE08Iece.js";
|
|
4
4
|
import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
5
|
import { getAcpSessionManager, isAcpRuntimeError } from "openclaw/plugin-sdk/acp-runtime";
|
|
6
6
|
export { createDiscordMessageHandler, createNoopThreadBindingManager, createThreadBindingManager, getAcpSessionManager, isAcpRuntimeError, reconcileAcpThreadBindingsOnStartup, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as readDiscordChannelCreateParams, c as readDiscordParentIdParam, i as requiredGuildPermissionForModerationAction, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-Dds0Ww1n.js";
|
|
2
|
-
import { t as discordMessageActions } from "./channel-actions-
|
|
2
|
+
import { t as discordMessageActions } from "./channel-actions-DQxnmgig.js";
|
|
3
3
|
export { discordMessageActions, handleDiscordAction, isDiscordModerationAction, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, requiredGuildPermissionForModerationAction };
|
package/dist/runtime-api.js
CHANGED
|
@@ -8,7 +8,7 @@ import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchCha
|
|
|
8
8
|
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DhMLobqR.js";
|
|
9
9
|
import { a as readDiscordChannelCreateParams, c as readDiscordParentIdParam, i as requiredGuildPermissionForModerationAction, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-Dds0Ww1n.js";
|
|
10
10
|
import { r as setDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
11
|
-
import { t as discordMessageActions } from "./channel-actions-
|
|
11
|
+
import { t as discordMessageActions } from "./channel-actions-DQxnmgig.js";
|
|
12
12
|
import { C as resolveThreadBindingIdleTimeoutMs, E as resolveThreadBindingMaxAgeMs, T as resolveThreadBindingMaxAgeExpiresAt, d as isRecentlyUnboundThreadWebhookMessage, w as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-CVLF7gJH.js";
|
|
13
13
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DeMxmcXB.js";
|
|
14
14
|
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-DLNfxFQP.js";
|
|
@@ -17,14 +17,14 @@ import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadN
|
|
|
17
17
|
import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-Tfr_vFxk.js";
|
|
18
18
|
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-CRc4hYr1.js";
|
|
19
19
|
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-2MdGjUAf.js";
|
|
20
|
-
import { a as
|
|
20
|
+
import { a as isAbortError, c as normalizeDiscordListenerTimeoutMs, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, o as mergeAbortSignals, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, s as normalizeDiscordInboundWorkerTimeoutMs, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, u as runDiscordTaskWithTimeout } from "./timeouts-C5TBc_9x.js";
|
|
21
21
|
import "./runtime-api.actions.js";
|
|
22
22
|
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-eI8e8RpG.js";
|
|
23
23
|
import "./runtime-api.lookup.js";
|
|
24
|
-
import { E as sanitizeDiscordThreadName, c as createDiscordGatewayPlugin, f as createDiscordNativeCommand, l as resolveDiscordGatewayIntents, t as monitorDiscordProvider, u as waitForDiscordGatewayPluginRegistration, w as resolveDiscordReplyTarget, x as registerDiscordListener } from "./provider-
|
|
25
|
-
import { i as buildDiscordMediaPayload } from "./message-utils-
|
|
26
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
27
|
-
import "./runtime-api.monitor-
|
|
24
|
+
import { E as sanitizeDiscordThreadName, c as createDiscordGatewayPlugin, f as createDiscordNativeCommand, l as resolveDiscordGatewayIntents, t as monitorDiscordProvider, u as waitForDiscordGatewayPluginRegistration, w as resolveDiscordReplyTarget, x as registerDiscordListener } from "./provider-M0xrcgNL.js";
|
|
25
|
+
import { i as buildDiscordMediaPayload } from "./message-utils-C7h3boE6.js";
|
|
26
|
+
import { t as createDiscordMessageHandler } from "./message-handler-CE08Iece.js";
|
|
27
|
+
import "./runtime-api.monitor-DHdsCQ8T.js";
|
|
28
28
|
import "./runtime-api.send.js";
|
|
29
29
|
import "./runtime-api.threads.js";
|
|
30
|
-
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DiscordSendError, testing as __testing, testing, addRoleDiscord, allowListMatches, auditDiscordChannelPermissions, autoBindSpawnedDiscordSubagent, banMemberDiscord, buildDiscordMediaPayload, clearGateways, clearPresences, collectDiscordAuditChannelIds, createChannelDiscord, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, createNoopThreadBindingManager, createScheduledEventDiscord, createThreadBindingManager, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, discordMessageActions, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, formatThreadBindingDurationLabel, getGateway, getPresence, getThreadBindingManager, handleDiscordAction, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, isDiscordGroupAllowedByPolicy, isDiscordModerationAction, isRecentlyUnboundThreadWebhookMessage, kickMemberDiscord, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadBindingsBySessionKey, listThreadBindingsForAccount, listThreadsDiscord, mergeAbortSignals, monitorDiscordProvider, moveChannelDiscord, normalizeDiscordAllowList, normalizeDiscordSlug, parseApplicationIdFromToken, pinMessageDiscord, presenceCacheSize, probeDiscord, reactMessageDiscord, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, readMessagesDiscord, reconcileAcpThreadBindingsOnStartup, registerBuiltDiscordComponentMessage, registerDiscordListener, registerGateway, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, requiredGuildPermissionForModerationAction, resolveDiscordChannelAllowlist, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordOutboundSessionRoute, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveDiscordUserAllowlist, resolveEventCoverImage, resolveGroupDmAllow, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, sanitizeDiscordThreadName, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, setDiscordRuntime, setPresence, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, shouldEmitDiscordReactionNotification, timeoutMemberDiscord, unbindThreadBindingsBySessionKey, unpinMessageDiscord, unregisterGateway, uploadEmojiDiscord, uploadStickerDiscord, waitForDiscordGatewayPluginRegistration };
|
|
30
|
+
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DiscordSendError, testing as __testing, testing, addRoleDiscord, allowListMatches, auditDiscordChannelPermissions, autoBindSpawnedDiscordSubagent, banMemberDiscord, buildDiscordMediaPayload, clearGateways, clearPresences, collectDiscordAuditChannelIds, createChannelDiscord, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, createNoopThreadBindingManager, createScheduledEventDiscord, createThreadBindingManager, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, discordMessageActions, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, formatThreadBindingDurationLabel, getGateway, getPresence, getThreadBindingManager, handleDiscordAction, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, isAbortError, isDiscordGroupAllowedByPolicy, isDiscordModerationAction, isRecentlyUnboundThreadWebhookMessage, kickMemberDiscord, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadBindingsBySessionKey, listThreadBindingsForAccount, listThreadsDiscord, mergeAbortSignals, monitorDiscordProvider, moveChannelDiscord, normalizeDiscordAllowList, normalizeDiscordInboundWorkerTimeoutMs, normalizeDiscordListenerTimeoutMs, normalizeDiscordSlug, parseApplicationIdFromToken, pinMessageDiscord, presenceCacheSize, probeDiscord, reactMessageDiscord, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, readMessagesDiscord, reconcileAcpThreadBindingsOnStartup, registerBuiltDiscordComponentMessage, registerDiscordListener, registerGateway, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, requiredGuildPermissionForModerationAction, resolveDiscordChannelAllowlist, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordOutboundSessionRoute, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveDiscordUserAllowlist, resolveEventCoverImage, resolveGroupDmAllow, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, runDiscordTaskWithTimeout, sanitizeDiscordThreadName, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, setDiscordRuntime, setPresence, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, shouldEmitDiscordReactionNotification, timeoutMemberDiscord, unbindThreadBindingsBySessionKey, unpinMessageDiscord, unregisterGateway, uploadEmojiDiscord, uploadStickerDiscord, waitForDiscordGatewayPluginRegistration };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as clearPresences, c as setPresence, i as unregisterGateway, n as getGateway, o as getPresence, r as registerGateway, s as presenceCacheSize, t as clearGateways } from "./gateway-registry-DPxmW0Db.js";
|
|
2
2
|
import { _ as resolveGroupDmAllow, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, g as resolveDiscordShouldRequireMention, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as shouldEmitDiscordReactionNotification } from "./allow-list-C-MqM-B_.js";
|
|
3
|
-
import { a as
|
|
4
|
-
import { E as sanitizeDiscordThreadName, c as createDiscordGatewayPlugin, f as createDiscordNativeCommand, l as resolveDiscordGatewayIntents, t as monitorDiscordProvider, u as waitForDiscordGatewayPluginRegistration, w as resolveDiscordReplyTarget, x as registerDiscordListener } from "./provider-
|
|
5
|
-
import { i as buildDiscordMediaPayload } from "./message-utils-
|
|
6
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
7
|
-
import "./runtime-api.monitor-
|
|
8
|
-
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, allowListMatches, buildDiscordMediaPayload, clearGateways, clearPresences, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, getGateway, getPresence, isDiscordGroupAllowedByPolicy, mergeAbortSignals, monitorDiscordProvider, normalizeDiscordAllowList, normalizeDiscordSlug, presenceCacheSize, registerDiscordListener, registerGateway, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveGroupDmAllow, sanitizeDiscordThreadName, setPresence, shouldEmitDiscordReactionNotification, unregisterGateway, waitForDiscordGatewayPluginRegistration };
|
|
3
|
+
import { a as isAbortError, c as normalizeDiscordListenerTimeoutMs, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, o as mergeAbortSignals, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, s as normalizeDiscordInboundWorkerTimeoutMs, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, u as runDiscordTaskWithTimeout } from "./timeouts-C5TBc_9x.js";
|
|
4
|
+
import { E as sanitizeDiscordThreadName, c as createDiscordGatewayPlugin, f as createDiscordNativeCommand, l as resolveDiscordGatewayIntents, t as monitorDiscordProvider, u as waitForDiscordGatewayPluginRegistration, w as resolveDiscordReplyTarget, x as registerDiscordListener } from "./provider-M0xrcgNL.js";
|
|
5
|
+
import { i as buildDiscordMediaPayload } from "./message-utils-C7h3boE6.js";
|
|
6
|
+
import { t as createDiscordMessageHandler } from "./message-handler-CE08Iece.js";
|
|
7
|
+
import "./runtime-api.monitor-DHdsCQ8T.js";
|
|
8
|
+
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, allowListMatches, buildDiscordMediaPayload, clearGateways, clearPresences, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, getGateway, getPresence, isAbortError, isDiscordGroupAllowedByPolicy, mergeAbortSignals, monitorDiscordProvider, normalizeDiscordAllowList, normalizeDiscordInboundWorkerTimeoutMs, normalizeDiscordListenerTimeoutMs, normalizeDiscordSlug, presenceCacheSize, registerDiscordListener, registerGateway, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveGroupDmAllow, runDiscordTaskWithTimeout, sanitizeDiscordThreadName, setPresence, shouldEmitDiscordReactionNotification, unregisterGateway, waitForDiscordGatewayPluginRegistration };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
2
|
+
//#region extensions/discord/src/monitor/timeouts.ts
|
|
3
|
+
const DISCORD_DEFAULT_LISTENER_TIMEOUT_MS = 12e4;
|
|
4
|
+
const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS = 30 * 6e4;
|
|
5
|
+
const DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS = 6e4;
|
|
6
|
+
const DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS = 12e4;
|
|
7
|
+
/** @deprecated Discord listener timeouts are compatibility-only. */
|
|
8
|
+
function normalizeDiscordListenerTimeoutMs(raw) {
|
|
9
|
+
if (!Number.isFinite(raw) || (raw ?? 0) <= 0) return DISCORD_DEFAULT_LISTENER_TIMEOUT_MS;
|
|
10
|
+
return resolveTimerTimeoutMs(raw, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, 1e3);
|
|
11
|
+
}
|
|
12
|
+
/** @deprecated Discord no longer applies channel-owned inbound run timeouts. */
|
|
13
|
+
function normalizeDiscordInboundWorkerTimeoutMs(raw) {
|
|
14
|
+
if (raw === 0) return;
|
|
15
|
+
if (typeof raw !== "number" || !Number.isFinite(raw) || raw < 0) return DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS;
|
|
16
|
+
return resolveTimerTimeoutMs(raw, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, 1);
|
|
17
|
+
}
|
|
18
|
+
/** @deprecated Compatibility helper for old Discord timeout integrations. */
|
|
19
|
+
function isAbortError(error) {
|
|
20
|
+
if (typeof error !== "object" || error === null) return false;
|
|
21
|
+
return "name" in error && String(error.name) === "AbortError";
|
|
22
|
+
}
|
|
23
|
+
function mergeAbortSignals(signals) {
|
|
24
|
+
const activeSignals = signals.filter((signal) => Boolean(signal));
|
|
25
|
+
if (activeSignals.length === 0) return;
|
|
26
|
+
if (activeSignals.length === 1) return activeSignals[0];
|
|
27
|
+
if (typeof AbortSignal.any === "function") return AbortSignal.any(activeSignals);
|
|
28
|
+
const fallbackController = new AbortController();
|
|
29
|
+
for (const signal of activeSignals) if (signal.aborted) {
|
|
30
|
+
fallbackController.abort();
|
|
31
|
+
return fallbackController.signal;
|
|
32
|
+
}
|
|
33
|
+
const abortFallback = () => {
|
|
34
|
+
fallbackController.abort();
|
|
35
|
+
for (const signal of activeSignals) signal.removeEventListener("abort", abortFallback);
|
|
36
|
+
};
|
|
37
|
+
for (const signal of activeSignals) signal.addEventListener("abort", abortFallback, { once: true });
|
|
38
|
+
return fallbackController.signal;
|
|
39
|
+
}
|
|
40
|
+
/** @deprecated Discord no longer uses this for channel-owned message run timeouts. */
|
|
41
|
+
async function runDiscordTaskWithTimeout(params) {
|
|
42
|
+
const timeoutMs = params.timeoutMs === void 0 ? void 0 : resolveTimerTimeoutMs(params.timeoutMs, 0, 0);
|
|
43
|
+
const timeoutAbortController = timeoutMs ? new AbortController() : void 0;
|
|
44
|
+
const mergedAbortSignal = mergeAbortSignals([...params.abortSignals ?? [], timeoutAbortController?.signal]);
|
|
45
|
+
let timedOut = false;
|
|
46
|
+
let timeoutHandle = null;
|
|
47
|
+
const runPromise = params.run(mergedAbortSignal).catch((error) => {
|
|
48
|
+
if (!timedOut) throw error;
|
|
49
|
+
if (timeoutAbortController?.signal.aborted && isAbortError(error)) {
|
|
50
|
+
params.onAbortAfterTimeout?.();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
params.onErrorAfterTimeout?.(error);
|
|
54
|
+
});
|
|
55
|
+
try {
|
|
56
|
+
if (!timeoutMs) {
|
|
57
|
+
await runPromise;
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
61
|
+
timeoutHandle = setTimeout(() => resolve("timeout"), timeoutMs);
|
|
62
|
+
timeoutHandle.unref?.();
|
|
63
|
+
});
|
|
64
|
+
if (await Promise.race([runPromise.then(() => "completed"), timeoutPromise]) === "timeout") {
|
|
65
|
+
timedOut = true;
|
|
66
|
+
timeoutAbortController?.abort();
|
|
67
|
+
await params.onTimeout(timeoutMs);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
} finally {
|
|
72
|
+
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function raceWithTimeout(params) {
|
|
76
|
+
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 1);
|
|
77
|
+
let timeoutTimer;
|
|
78
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
79
|
+
timeoutTimer = setTimeout(() => resolve(params.onTimeout()), timeoutMs);
|
|
80
|
+
timeoutTimer.unref?.();
|
|
81
|
+
});
|
|
82
|
+
try {
|
|
83
|
+
return await Promise.race([params.promise, timeoutPromise]);
|
|
84
|
+
} finally {
|
|
85
|
+
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function withAbortTimeout(params) {
|
|
89
|
+
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 1);
|
|
90
|
+
const controller = new AbortController();
|
|
91
|
+
let timeoutTimer;
|
|
92
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
93
|
+
timeoutTimer = setTimeout(() => {
|
|
94
|
+
controller.abort();
|
|
95
|
+
reject(params.createTimeoutError());
|
|
96
|
+
}, timeoutMs);
|
|
97
|
+
timeoutTimer.unref?.();
|
|
98
|
+
});
|
|
99
|
+
try {
|
|
100
|
+
return await Promise.race([params.run(controller.signal), timeoutPromise]);
|
|
101
|
+
} finally {
|
|
102
|
+
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { isAbortError as a, normalizeDiscordListenerTimeoutMs as c, withAbortTimeout as d, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS as i, raceWithTimeout as l, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS as n, mergeAbortSignals as o, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS as r, normalizeDiscordInboundWorkerTimeoutMs as s, DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS as t, runDiscordTaskWithTimeout as u };
|
package/dist/timeouts.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
1
|
+
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-C5TBc_9x.js";
|
|
2
2
|
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-Z8V6yMOY.js";
|
|
2
|
-
import {
|
|
2
|
+
import { l as raceWithTimeout } from "./timeouts-C5TBc_9x.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/typing.ts
|
|
4
4
|
var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
|
|
5
5
|
const DISCORD_TYPING_START_TIMEOUT_MS = 5e3;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/discord",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.6-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/discord",
|
|
9
|
-
"version": "2026.6.
|
|
9
|
+
"version": "2026.6.6-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@discordjs/voice": "0.19.2",
|
|
12
12
|
"discord-api-types": "0.38.48",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"ws": "8.21.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"openclaw": ">=2026.6.
|
|
19
|
+
"openclaw": ">=2026.6.6-beta.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/discord",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.6-beta.1",
|
|
4
4
|
"description": "OpenClaw Discord channel plugin for channels, DMs, commands, and app events.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"ws": "8.21.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"openclaw": ">=2026.6.
|
|
19
|
+
"openclaw": ">=2026.6.6-beta.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"openclaw": {
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"allowInvalidConfigRecovery": true
|
|
64
64
|
},
|
|
65
65
|
"compat": {
|
|
66
|
-
"pluginApi": ">=2026.6.
|
|
66
|
+
"pluginApi": ">=2026.6.6-beta.1"
|
|
67
67
|
},
|
|
68
68
|
"build": {
|
|
69
|
-
"openclawVersion": "2026.6.
|
|
69
|
+
"openclawVersion": "2026.6.6-beta.1"
|
|
70
70
|
},
|
|
71
71
|
"release": {
|
|
72
72
|
"publishToClawHub": true,
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
2
|
-
//#region extensions/discord/src/monitor/timeouts.ts
|
|
3
|
-
const DISCORD_DEFAULT_LISTENER_TIMEOUT_MS = 12e4;
|
|
4
|
-
const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS = 30 * 6e4;
|
|
5
|
-
const DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS = 6e4;
|
|
6
|
-
const DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS = 12e4;
|
|
7
|
-
function mergeAbortSignals(signals) {
|
|
8
|
-
const activeSignals = signals.filter((signal) => Boolean(signal));
|
|
9
|
-
if (activeSignals.length === 0) return;
|
|
10
|
-
if (activeSignals.length === 1) return activeSignals[0];
|
|
11
|
-
if (typeof AbortSignal.any === "function") return AbortSignal.any(activeSignals);
|
|
12
|
-
const fallbackController = new AbortController();
|
|
13
|
-
for (const signal of activeSignals) if (signal.aborted) {
|
|
14
|
-
fallbackController.abort();
|
|
15
|
-
return fallbackController.signal;
|
|
16
|
-
}
|
|
17
|
-
const abortFallback = () => {
|
|
18
|
-
fallbackController.abort();
|
|
19
|
-
for (const signal of activeSignals) signal.removeEventListener("abort", abortFallback);
|
|
20
|
-
};
|
|
21
|
-
for (const signal of activeSignals) signal.addEventListener("abort", abortFallback, { once: true });
|
|
22
|
-
return fallbackController.signal;
|
|
23
|
-
}
|
|
24
|
-
async function raceWithTimeout(params) {
|
|
25
|
-
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 1);
|
|
26
|
-
let timeoutTimer;
|
|
27
|
-
const timeoutPromise = new Promise((resolve) => {
|
|
28
|
-
timeoutTimer = setTimeout(() => resolve(params.onTimeout()), timeoutMs);
|
|
29
|
-
timeoutTimer.unref?.();
|
|
30
|
-
});
|
|
31
|
-
try {
|
|
32
|
-
return await Promise.race([params.promise, timeoutPromise]);
|
|
33
|
-
} finally {
|
|
34
|
-
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async function withAbortTimeout(params) {
|
|
38
|
-
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 1);
|
|
39
|
-
const controller = new AbortController();
|
|
40
|
-
let timeoutTimer;
|
|
41
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
42
|
-
timeoutTimer = setTimeout(() => {
|
|
43
|
-
controller.abort();
|
|
44
|
-
reject(params.createTimeoutError());
|
|
45
|
-
}, timeoutMs);
|
|
46
|
-
timeoutTimer.unref?.();
|
|
47
|
-
});
|
|
48
|
-
try {
|
|
49
|
-
return await Promise.race([params.run(controller.signal), timeoutPromise]);
|
|
50
|
-
} finally {
|
|
51
|
-
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { mergeAbortSignals as a, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS as i, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS as n, raceWithTimeout as o, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS as r, withAbortTimeout as s, DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS as t };
|