@openclaw/discord 2026.5.27 → 2026.5.28-beta.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/action-runtime-api.js +1 -1
- package/dist/{api-Kq7vtaSO.js → api-ChQJ1kfZ.js} +2 -5
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-BDxD97LJ.js → approval-handler.runtime-CIZiiFBd.js} +5 -18
- package/dist/{audit-BdUjE2tr.js → audit-D6BXQsYY.js} +3 -3
- package/dist/{channel-9YoMy5Jf.js → channel--B_psO5e.js} +16 -16
- package/dist/{channel-actions-DZfkB0nd.js → channel-actions-BOH34yJ5.js} +2 -2
- package/dist/{channel-actions.runtime-suaDJHH0.js → channel-actions.runtime-B1RCm1JP.js} +10 -13
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-B-kHacpx.js → channel.setup-COYdCbY_.js} +3 -3
- package/dist/{components-Dlc81IU5.js → components-DX5Baphr.js} +61 -20
- package/dist/{config-schema-CTzLsQlB.js → config-schema-3tZYNVTM.js} +13 -1
- package/dist/contract-api.js +2 -2
- package/dist/{conversation-identity-DAEgiGDV.js → conversation-identity-Dugx5WfH.js} +2 -2
- package/dist/{directory-config-Cgp0csDd.js → directory-config-CcjUkNgK.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-C-ECRrM8.js → directory-live-NOtxlJZ3.js} +2 -2
- package/dist/{doctor-Q80i7GdG.js → doctor-Dy7sI1sL.js} +1 -1
- package/dist/{handle-action.guild-admin-DWFTAcfd.js → handle-action.guild-admin-wC9VaAdl.js} +11 -8
- package/dist/index.js +1 -1
- package/dist/{manager.runtime-D6V2SPKr.js → manager.runtime-Bwgq6hJW.js} +4 -5
- package/dist/{message-handler-B5-UG_oD.js → message-handler-DhqxKFLP.js} +9 -9
- package/dist/{message-handler.preflight-Ddww-wnF.js → message-handler.preflight-BC8QmsWW.js} +10 -10
- package/dist/{message-handler.process-HWGh2NOP.js → message-handler.process-DE1an2G4.js} +85 -17
- package/dist/{message-utils-4w0_DPFE.js → message-utils-BlvuUPP4.js} +1 -1
- package/dist/{outbound-adapter-DYUYRaBd.js → outbound-adapter-BGrOFkR8.js} +9 -7
- package/dist/{pluralkit-BS1MuvYs.js → pluralkit-Cq_PUr06.js} +1 -1
- package/dist/{probe-DfIM7zSY.js → probe-CSBPZIYV.js} +1 -1
- package/dist/{probe.runtime-DoXDN3rt.js → probe.runtime-BhWW0223.js} +1 -1
- package/dist/{provider-CO6pih5z.js → provider-DIVQuJTw.js} +99 -44
- package/dist/{provider-session.runtime-BD5XLPI8.js → provider-session.runtime-C7jT_K-7.js} +3 -3
- package/dist/provider.runtime-BtnupyG-.js +2 -0
- package/dist/{resolve-allowlist-common-QzX-w4-_.js → resolve-allowlist-common-CzfIcLSO.js} +1 -1
- package/dist/{resolve-channels-pD06YNCU.js → resolve-channels-CQ13aBCV.js} +3 -3
- package/dist/{resolve-users-BiWLqNNO.js → resolve-users-Bj4Y4uWR.js} +3 -3
- package/dist/retry-after-CSukypPP.js +21 -0
- package/dist/{runtime-xSazIM0F.js → runtime-DA70ebm-.js} +26 -23
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +19 -19
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-P-emTjcx.js +5 -0
- package/dist/runtime-api.monitor.js +4 -4
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +3 -3
- package/dist/{send-BzXZ8iUI.js → send-3r8QQkTY.js} +7 -7
- package/dist/{send.components-AK8K4TwB.js → send.components-2qRLUwBn.js} +6 -6
- package/dist/{send.outbound-ZrMnBa8C.js → send.outbound-LjX_KYiO.js} +3 -3
- package/dist/{send.receipt-BzfsP3Bb.js → send.receipt-Bo_43DQZ.js} +64 -35
- package/dist/{send.shared-ehnDGwXx.js → send.shared-CXctTF1I.js} +2 -2
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-ToNRC7ax.js → shared-D3NkInmq.js} +2 -2
- package/dist/{subagent-hooks-Di_2iXU8.js → subagent-hooks-DoWTMQyQ.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-DbqKnNPF.js → system-events-DV85gUxb.js} +1 -1
- package/dist/{target-resolver-DXPvq5-L.js → target-resolver-DVpZI7ZL.js} +2 -2
- package/dist/targets-0WHF7kV0.js +3 -0
- package/dist/{thread-bindings-Bw40FTRZ.js → thread-bindings-Cm3GqlNC.js} +4 -4
- package/dist/{thread-bindings.discord-api-irWYI8YX.js → thread-bindings.discord-api-JrJXT7L0.js} +4 -4
- package/dist/{thread-bindings.manager-LoYZzlss.js → thread-bindings.manager-DqJuGG-r.js} +3 -3
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{transcripts-source-CwahHAYt.js → transcripts-source-lEfSvSRD.js} +1 -1
- package/dist/{typing-Cv09OhaY.js → typing-DlT_14RX.js} +1 -1
- package/npm-shrinkwrap.json +3 -49
- package/openclaw.plugin.json +35 -1
- package/package.json +5 -7
- package/dist/inbound-context-B5EsqsSr.js +0 -48
- package/dist/provider.runtime-pUGk7VR5.js +0 -2
- package/dist/runtime-api.monitor-BjgSsR6H.js +0 -5
- package/dist/targets-BBVHRaeO.js +0 -3
- package/dist/test-api.js +0 -45
- package/node_modules/agent-base/LICENSE +0 -22
- package/node_modules/agent-base/README.md +0 -69
- package/node_modules/agent-base/dist/helpers.d.ts +0 -10
- package/node_modules/agent-base/dist/helpers.d.ts.map +0 -1
- package/node_modules/agent-base/dist/helpers.js +0 -37
- package/node_modules/agent-base/dist/helpers.js.map +0 -1
- package/node_modules/agent-base/dist/index.d.ts +0 -37
- package/node_modules/agent-base/dist/index.d.ts.map +0 -1
- package/node_modules/agent-base/dist/index.js +0 -146
- package/node_modules/agent-base/dist/index.js.map +0 -1
- package/node_modules/agent-base/package.json +0 -46
- package/node_modules/debug/LICENSE +0 -20
- package/node_modules/debug/README.md +0 -481
- package/node_modules/debug/package.json +0 -64
- package/node_modules/debug/src/browser.js +0 -272
- package/node_modules/debug/src/common.js +0 -292
- package/node_modules/debug/src/index.js +0 -10
- package/node_modules/debug/src/node.js +0 -263
- package/node_modules/https-proxy-agent/LICENSE +0 -22
- package/node_modules/https-proxy-agent/README.md +0 -70
- package/node_modules/https-proxy-agent/dist/index.d.ts +0 -43
- package/node_modules/https-proxy-agent/dist/index.d.ts.map +0 -1
- package/node_modules/https-proxy-agent/dist/index.js +0 -150
- package/node_modules/https-proxy-agent/dist/index.js.map +0 -1
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +0 -12
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +0 -1
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +0 -94
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +0 -1
- package/node_modules/https-proxy-agent/package.json +0 -50
- package/node_modules/ms/index.js +0 -162
- package/node_modules/ms/license.md +0 -21
- package/node_modules/ms/package.json +0 -38
- package/node_modules/ms/readme.md +0 -59
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, _ as VoiceStateUpdateListener, c as discord_exports, h as ResumedListener, jt as getGuildVoiceState, m as ReadyListener } from "./send.receipt-
|
|
1
|
+
import { Ht as parseDiscordTarget, _ as VoiceStateUpdateListener, c as discord_exports, h as ResumedListener, jt as getGuildVoiceState, m as ReadyListener } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { c as resolveDiscordAccountAllowFrom } from "./accounts-dXTfmnSZ.js";
|
|
3
3
|
import { a as normalizeDiscordSlug, b as formatDiscordUserTag, m as resolveDiscordOwnerAccess } from "./allow-list-BnkWtVpA.js";
|
|
4
|
-
import { i as formatMention } from "./send.outbound-
|
|
4
|
+
import { i as formatMention } from "./send.outbound-LjX_KYiO.js";
|
|
5
5
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
6
|
-
import { o as authorizeDiscordVoiceIngress, u as resolveDiscordVoiceEnabled } from "./provider-
|
|
7
|
-
import { t as buildDiscordGroupSystemPrompt } from "./inbound-context-B5EsqsSr.js";
|
|
6
|
+
import { f as buildDiscordGroupSystemPrompt, o as authorizeDiscordVoiceIngress, u as resolveDiscordVoiceEnabled } from "./provider-DIVQuJTw.js";
|
|
8
7
|
import { createRequire } from "node:module";
|
|
9
8
|
import { asBoolean, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
9
|
import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|
@@ -1537,7 +1536,7 @@ function buildProviderConfigs(realtimeConfig) {
|
|
|
1537
1536
|
function buildProviderConfigOverrides(realtimeConfig) {
|
|
1538
1537
|
const overrides = {
|
|
1539
1538
|
...realtimeConfig?.model ? { model: realtimeConfig.model } : {},
|
|
1540
|
-
...realtimeConfig?.voice ? { voice: realtimeConfig.voice } : {},
|
|
1539
|
+
...realtimeConfig?.speakerVoice ? { voice: realtimeConfig.speakerVoice } : realtimeConfig?.speakerVoiceId ? { voice: realtimeConfig.speakerVoiceId } : realtimeConfig?.voice ? { voice: realtimeConfig.voice } : {},
|
|
1541
1540
|
...typeof realtimeConfig?.minBargeInAudioEndMs === "number" ? { minBargeInAudioEndMs: realtimeConfig.minBargeInAudioEndMs } : {}
|
|
1542
1541
|
};
|
|
1543
1542
|
return Object.keys(overrides).length > 0 ? overrides : void 0;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as createDiscordRestClient } from "./send.shared-
|
|
2
|
-
import { d as resolveDiscordChannelNameSafe, l as resolveDiscordChannelIdSafe, p as resolveDiscordChannelParentSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-
|
|
1
|
+
import { I as createDiscordRestClient } from "./send.shared-CXctTF1I.js";
|
|
2
|
+
import { d as resolveDiscordChannelNameSafe, l as resolveDiscordChannelIdSafe, p as resolveDiscordChannelParentSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-JrJXT7L0.js";
|
|
3
3
|
import { a as mergeAbortSignals } from "./timeouts-l_PsHQvX.js";
|
|
4
|
-
import { c as hasDiscordMessageStickers, d as resolveDiscordMessageChannelId, r as resolveDiscordMessageText } from "./message-utils-
|
|
5
|
-
import { t as sendTyping } from "./typing-
|
|
4
|
+
import { c as hasDiscordMessageStickers, d as resolveDiscordMessageChannelId, r as resolveDiscordMessageText } from "./message-utils-BlvuUPP4.js";
|
|
5
|
+
import { t as sendTyping } from "./typing-DlT_14RX.js";
|
|
6
6
|
import { danger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
7
7
|
import { createChannelRunQueue } from "openclaw/plugin-sdk/channel-outbound";
|
|
8
8
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
@@ -121,7 +121,7 @@ function applyImplicitReplyBatchGate(ctx, replyToMode, isBatched) {
|
|
|
121
121
|
//#region extensions/discord/src/monitor/message-run-queue.ts
|
|
122
122
|
let messageProcessRuntimePromise;
|
|
123
123
|
async function loadMessageProcessRuntime() {
|
|
124
|
-
messageProcessRuntimePromise ??= import("./message-handler.process-
|
|
124
|
+
messageProcessRuntimePromise ??= import("./message-handler.process-DE1an2G4.js");
|
|
125
125
|
return await messageProcessRuntimePromise;
|
|
126
126
|
}
|
|
127
127
|
async function processDiscordQueuedMessage(params) {
|
|
@@ -152,7 +152,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
152
152
|
setStatus: params.setStatus,
|
|
153
153
|
abortSignal: params.abortSignal,
|
|
154
154
|
onError: (error) => {
|
|
155
|
-
params.runtime.error
|
|
155
|
+
params.runtime.error(danger(`discord message run failed: ${String(error)}`));
|
|
156
156
|
}
|
|
157
157
|
});
|
|
158
158
|
return {
|
|
@@ -173,7 +173,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
173
173
|
//#region extensions/discord/src/monitor/message-handler.ts
|
|
174
174
|
let messagePreflightRuntimePromise;
|
|
175
175
|
async function loadMessagePreflightRuntime() {
|
|
176
|
-
messagePreflightRuntimePromise ??= import("./message-handler.preflight-
|
|
176
|
+
messagePreflightRuntimePromise ??= import("./message-handler.preflight-BC8QmsWW.js");
|
|
177
177
|
return await messagePreflightRuntimePromise;
|
|
178
178
|
}
|
|
179
179
|
function isNonEmptyString(value) {
|
|
@@ -348,7 +348,7 @@ function createDiscordMessageHandler(params) {
|
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
350
|
onError: (err) => {
|
|
351
|
-
params.runtime.error
|
|
351
|
+
params.runtime.error(danger(`discord debounce flush failed: ${String(err)}`));
|
|
352
352
|
}
|
|
353
353
|
});
|
|
354
354
|
const handler = async (data, client, options) => {
|
|
@@ -371,7 +371,7 @@ function createDiscordMessageHandler(params) {
|
|
|
371
371
|
replayKey: replayKey ?? void 0
|
|
372
372
|
});
|
|
373
373
|
} catch (err) {
|
|
374
|
-
params.runtime.error
|
|
374
|
+
params.runtime.error(danger(`handler failed: ${String(err)}`));
|
|
375
375
|
}
|
|
376
376
|
};
|
|
377
377
|
handler.deactivate = messageRunQueue.deactivate;
|
package/dist/{message-handler.preflight-Ddww-wnF.js → message-handler.preflight-BC8QmsWW.js}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as discord_exports, k as Message, mt as getChannelMessage } from "./send.receipt-
|
|
1
|
+
import { c as discord_exports, k as Message, mt as getChannelMessage } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { o as resolveDefaultDiscordAccountId } from "./accounts-dXTfmnSZ.js";
|
|
3
3
|
import { S as resolveTimestampMs, _ as resolveGroupDmAllow, a as normalizeDiscordSlug, b as formatDiscordUserTag, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, f as resolveDiscordMemberAccessState, g as resolveDiscordShouldRequireMention, i as normalizeDiscordDisplaySlug, n as isDiscordGroupAllowedByPolicy, x as resolveDiscordSystemLocation } from "./allow-list-BnkWtVpA.js";
|
|
4
|
-
import { t as resolveDiscordConversationIdentity } from "./conversation-identity-
|
|
4
|
+
import { t as resolveDiscordConversationIdentity } from "./conversation-identity-Dugx5WfH.js";
|
|
5
5
|
import { l as isRecentlyUnboundThreadWebhookMessage } from "./thread-bindings.state-BsOnj5NX.js";
|
|
6
|
-
import { d as resolveDiscordChannelNameSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-
|
|
7
|
-
import "./thread-bindings-
|
|
8
|
-
import {
|
|
9
|
-
import { d as resolveDiscordMessageChannelId, l as resolveDiscordMessageStickers, o as resolveMediaList, r as resolveDiscordMessageText, u as resolveDiscordChannelInfo } from "./message-utils-
|
|
6
|
+
import { d as resolveDiscordChannelNameSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-JrJXT7L0.js";
|
|
7
|
+
import "./thread-bindings-Cm3GqlNC.js";
|
|
8
|
+
import { D as resolveDiscordTextCommandAccess, E as resolveDiscordDmCommandAccess, _ as resolveDiscordEffectiveRoute, g as resolveDiscordConversationRoute, h as buildDiscordRoutePeer, v as shouldIgnoreStaleDiscordRouteBinding, y as handleDiscordDmCommandDecision } from "./provider-DIVQuJTw.js";
|
|
9
|
+
import { d as resolveDiscordMessageChannelId, l as resolveDiscordMessageStickers, o as resolveMediaList, r as resolveDiscordMessageText, u as resolveDiscordChannelInfo } from "./message-utils-BlvuUPP4.js";
|
|
10
10
|
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-BFp5w0F8.js";
|
|
11
11
|
import { normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { getChildLogger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -28,7 +28,7 @@ async function loadConversationRuntime$1() {
|
|
|
28
28
|
return await conversationRuntimePromise$1;
|
|
29
29
|
}
|
|
30
30
|
async function loadDiscordSendRuntime() {
|
|
31
|
-
discordSendRuntimePromise ??= import("./send-
|
|
31
|
+
discordSendRuntimePromise ??= import("./send-3r8QQkTY.js").then((n) => n.t);
|
|
32
32
|
return await discordSendRuntimePromise;
|
|
33
33
|
}
|
|
34
34
|
async function resolveDiscordDmPreflightAccess(params) {
|
|
@@ -423,7 +423,7 @@ let preflightAudioRuntimePromise;
|
|
|
423
423
|
let systemEventsRuntimePromise;
|
|
424
424
|
let discordThreadingRuntimePromise;
|
|
425
425
|
async function loadPluralKitRuntime() {
|
|
426
|
-
pluralkitRuntimePromise ??= import("./pluralkit-
|
|
426
|
+
pluralkitRuntimePromise ??= import("./pluralkit-Cq_PUr06.js").then((n) => n.n);
|
|
427
427
|
return await pluralkitRuntimePromise;
|
|
428
428
|
}
|
|
429
429
|
async function loadPreflightAudioRuntime() {
|
|
@@ -431,11 +431,11 @@ async function loadPreflightAudioRuntime() {
|
|
|
431
431
|
return await preflightAudioRuntimePromise;
|
|
432
432
|
}
|
|
433
433
|
async function loadSystemEventsRuntime() {
|
|
434
|
-
systemEventsRuntimePromise ??= import("./system-events-
|
|
434
|
+
systemEventsRuntimePromise ??= import("./system-events-DV85gUxb.js");
|
|
435
435
|
return await systemEventsRuntimePromise;
|
|
436
436
|
}
|
|
437
437
|
async function loadDiscordThreadingRuntime() {
|
|
438
|
-
discordThreadingRuntimePromise ??= import("./provider-
|
|
438
|
+
discordThreadingRuntimePromise ??= import("./provider-DIVQuJTw.js").then((n) => n.x);
|
|
439
439
|
return await discordThreadingRuntimePromise;
|
|
440
440
|
}
|
|
441
441
|
function isPreflightAborted(abortSignal) {
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { Ut as resolveDiscordChannelId, c as discord_exports, ft as editChannelMessage, s as chunkDiscordTextWithMode, st as createChannelMessage, ut as deleteChannelMessage } from "./send.receipt-
|
|
1
|
+
import { Ut as resolveDiscordChannelId, c as discord_exports, ft as editChannelMessage, s as chunkDiscordTextWithMode, st as createChannelMessage, ut as deleteChannelMessage } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { f as resolveDiscordMaxLinesPerMessage } from "./accounts-dXTfmnSZ.js";
|
|
3
|
-
import { I as createDiscordRestClient, L as createDiscordRuntimeAccountContext, _ as resolveDiscordMessageFlags, d as resolveDiscordTargetChannelId } from "./send.shared-
|
|
3
|
+
import { I as createDiscordRestClient, L as createDiscordRuntimeAccountContext, _ as resolveDiscordMessageFlags, d as resolveDiscordTargetChannelId } from "./send.shared-CXctTF1I.js";
|
|
4
4
|
import { S as resolveTimestampMs, a as normalizeDiscordSlug, r as normalizeDiscordAllowList } from "./allow-list-BnkWtVpA.js";
|
|
5
|
-
import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-
|
|
6
|
-
import "./targets-
|
|
7
|
-
import { t as resolveDiscordConversationIdentity } from "./conversation-identity-
|
|
5
|
+
import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-3r8QQkTY.js";
|
|
6
|
+
import "./targets-0WHF7kV0.js";
|
|
7
|
+
import { t as resolveDiscordConversationIdentity } from "./conversation-identity-Dugx5WfH.js";
|
|
8
8
|
import { t as beginDiscordInboundEventDeliveryCorrelation } from "./inbound-event-delivery-CEPlt2uz.js";
|
|
9
|
-
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-
|
|
9
|
+
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-BGrOFkR8.js";
|
|
10
10
|
import { t as resolveDiscordPreviewStreamMode } from "./preview-streaming-DXT8oJdo.js";
|
|
11
11
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-l_PsHQvX.js";
|
|
12
|
-
import { a as resolveReplyContext, i as buildGuildLabel, n as deliverDiscordReply,
|
|
13
|
-
import { a as resolveForwardedMediaList, o as resolveMediaList, r as resolveDiscordMessageText, s as resolveReferencedReplyMediaList } from "./message-utils-
|
|
14
|
-
import { t as sendTyping } from "./typing-
|
|
15
|
-
import { n as buildDiscordInboundAccessContext, r as createDiscordSupplementalContextAccessChecker } from "./inbound-context-B5EsqsSr.js";
|
|
12
|
+
import { S as resolveDiscordAutoThreadReplyPlan, a as resolveReplyContext, i as buildGuildLabel, m as createDiscordSupplementalContextAccessChecker, n as deliverDiscordReply, p as buildDiscordInboundAccessContext, r as buildDirectLabel, w as resolveDiscordThreadStarter } from "./provider-DIVQuJTw.js";
|
|
13
|
+
import { a as resolveForwardedMediaList, o as resolveMediaList, r as resolveDiscordMessageText, s as resolveReferencedReplyMediaList } from "./message-utils-BlvuUPP4.js";
|
|
14
|
+
import { t as sendTyping } from "./typing-DlT_14RX.js";
|
|
16
15
|
import { buildAgentSessionKey, normalizeAccountId, resolveAccountEntry, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
17
16
|
import { MessageFlags } from "discord-api-types/v10";
|
|
18
17
|
import path from "node:path";
|
|
@@ -24,7 +23,7 @@ import { danger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtim
|
|
|
24
23
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
25
24
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
26
25
|
import { convertMarkdownTables, stripInlineDirectiveTagsForDelivery, stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
27
|
-
import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftGate, createFinalizableDraftLifecycle, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, normalizeChannelProgressDraftLineIdentity, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelProgressDraftMaxLines, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewChunk, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages, resolveTranscriptBackedChannelFinalText } from "openclaw/plugin-sdk/channel-outbound";
|
|
26
|
+
import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftGate, createFinalizableDraftLifecycle, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, normalizeChannelProgressDraftLineIdentity, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelProgressDraftMaxLines, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewChunk, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingProgressCommentary, resolveChannelStreamingSuppressDefaultToolProgressMessages, resolveTranscriptBackedChannelFinalText } from "openclaw/plugin-sdk/channel-outbound";
|
|
28
27
|
import { recordInboundSession, resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/conversation-runtime";
|
|
29
28
|
import { EmbeddedBlockChunker, formatReasoningMessage, resolveAckReaction, resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
30
29
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -251,7 +250,7 @@ async function buildDiscordMessageProcessContext(params) {
|
|
|
251
250
|
}) : void 0;
|
|
252
251
|
const effectiveTo = autoThreadContext?.To ?? dmConversationTarget ?? replyTarget;
|
|
253
252
|
if (!effectiveTo) {
|
|
254
|
-
runtime.error
|
|
253
|
+
runtime.error(danger("discord: missing reply target"));
|
|
255
254
|
return null;
|
|
256
255
|
}
|
|
257
256
|
const lastRouteTo = dmConversationTarget ?? effectiveTo;
|
|
@@ -514,12 +513,27 @@ function createDiscordDraftStream(params) {
|
|
|
514
513
|
lastSentText = "";
|
|
515
514
|
loop.resetPending();
|
|
516
515
|
};
|
|
516
|
+
const deleteCurrentMessage = async () => {
|
|
517
|
+
loop.resetPending();
|
|
518
|
+
await loop.waitForInFlight();
|
|
519
|
+
const messageId = streamMessageId;
|
|
520
|
+
streamMessageId = void 0;
|
|
521
|
+
lastSentText = "";
|
|
522
|
+
loop.resetThrottleWindow();
|
|
523
|
+
if (!isValidStreamMessageId(messageId)) return;
|
|
524
|
+
try {
|
|
525
|
+
await deleteStreamMessage(messageId);
|
|
526
|
+
} catch (err) {
|
|
527
|
+
params.warn?.(`discord stream preview cleanup failed: ${formatErrorMessage(err)}`);
|
|
528
|
+
}
|
|
529
|
+
};
|
|
517
530
|
params.log?.(`discord stream preview ready (maxChars=${maxChars}, throttleMs=${throttleMs})`);
|
|
518
531
|
return {
|
|
519
532
|
update,
|
|
520
533
|
flush: loop.flush,
|
|
521
534
|
messageId: () => streamMessageId,
|
|
522
535
|
clear,
|
|
536
|
+
deleteCurrentMessage,
|
|
523
537
|
discardPending,
|
|
524
538
|
seal,
|
|
525
539
|
stop,
|
|
@@ -554,6 +568,7 @@ function createDiscordDraftPreviewController(params) {
|
|
|
554
568
|
let finalReplyStarted = false;
|
|
555
569
|
let finalReplyDelivered = false;
|
|
556
570
|
const previewToolProgressEnabled = Boolean(draftStream) && resolveChannelStreamingPreviewToolProgress(params.discordConfig);
|
|
571
|
+
const commentaryProgressEnabled = Boolean(draftStream) && resolveChannelStreamingProgressCommentary(params.discordConfig);
|
|
557
572
|
const suppressDefaultToolProgressMessages = Boolean(draftStream) && resolveChannelStreamingSuppressDefaultToolProgressMessages(params.discordConfig, {
|
|
558
573
|
draftStreamActive: true,
|
|
559
574
|
previewToolProgressEnabled
|
|
@@ -579,6 +594,24 @@ function createDiscordDraftPreviewController(params) {
|
|
|
579
594
|
if (options?.flush) await draftStream.flush();
|
|
580
595
|
};
|
|
581
596
|
const progressDraftGate = createChannelProgressDraftGate({ onStart: () => renderProgressDraft({ flush: true }) });
|
|
597
|
+
const clearProgressDraftLine = async (lineId) => {
|
|
598
|
+
const nextLines = previewToolProgressLines.filter((line) => typeof line !== "object" || line.id?.trim() !== lineId);
|
|
599
|
+
if (nextLines.length === previewToolProgressLines.length) return;
|
|
600
|
+
previewToolProgressLines = nextLines;
|
|
601
|
+
if (!progressDraftGate.hasStarted) return;
|
|
602
|
+
if (formatChannelProgressDraftText({
|
|
603
|
+
entry: params.discordConfig,
|
|
604
|
+
lines: previewToolProgressLines,
|
|
605
|
+
seed: progressSeed
|
|
606
|
+
})) {
|
|
607
|
+
await renderProgressDraft();
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
lastPartialText = "";
|
|
611
|
+
draftText = "";
|
|
612
|
+
hasStreamedMessage = false;
|
|
613
|
+
if (draftStream?.messageId()) await draftStream.deleteCurrentMessage();
|
|
614
|
+
};
|
|
582
615
|
const resetProgressState = () => {
|
|
583
616
|
lastPartialText = "";
|
|
584
617
|
draftText = "";
|
|
@@ -598,6 +631,7 @@ function createDiscordDraftPreviewController(params) {
|
|
|
598
631
|
return {
|
|
599
632
|
draftStream,
|
|
600
633
|
previewToolProgressEnabled,
|
|
634
|
+
commentaryProgressEnabled,
|
|
601
635
|
suppressDefaultToolProgressMessages,
|
|
602
636
|
get isProgressMode() {
|
|
603
637
|
return discordStreamMode === "progress";
|
|
@@ -653,10 +687,10 @@ function createDiscordDraftPreviewController(params) {
|
|
|
653
687
|
else await progressDraftGate.noteWork();
|
|
654
688
|
if (alreadyStarted && progressDraftGate.hasStarted) await renderProgressDraft();
|
|
655
689
|
},
|
|
656
|
-
async pushReasoningProgress(text) {
|
|
690
|
+
async pushReasoningProgress(text, options) {
|
|
657
691
|
if (!draftStream || discordStreamMode !== "progress" || !text) return;
|
|
658
692
|
if (finalReplyDelivered) return;
|
|
659
|
-
reasoningProgressRawText = mergeReasoningProgressText(reasoningProgressRawText, text);
|
|
693
|
+
reasoningProgressRawText = mergeReasoningProgressText(reasoningProgressRawText, text, { snapshot: options?.snapshot === true });
|
|
660
694
|
const normalized = normalizeReasoningProgressLine(reasoningProgressRawText);
|
|
661
695
|
if (!normalized) return;
|
|
662
696
|
if (previewToolProgressEnabled && !previewToolProgressSuppressed) {
|
|
@@ -671,6 +705,27 @@ function createDiscordDraftPreviewController(params) {
|
|
|
671
705
|
await progressDraftGate.noteWork();
|
|
672
706
|
if (alreadyStarted && progressDraftGate.hasStarted) await renderProgressDraft();
|
|
673
707
|
},
|
|
708
|
+
async pushCommentaryProgress(text, options) {
|
|
709
|
+
if (!draftStream || discordStreamMode !== "progress" || !commentaryProgressEnabled) return;
|
|
710
|
+
if (finalReplyStarted || finalReplyDelivered) return;
|
|
711
|
+
const itemId = options?.itemId?.trim();
|
|
712
|
+
if (!text && !itemId) return;
|
|
713
|
+
const normalized = normalizeCommentaryProgressText(text ?? "");
|
|
714
|
+
const lineId = itemId ? `commentary:${itemId}` : normalized ? `commentary:${normalized}` : "";
|
|
715
|
+
if (!normalized) {
|
|
716
|
+
if (lineId) await clearProgressDraftLine(lineId);
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
previewToolProgressLines = mergeChannelProgressDraftLine(previewToolProgressLines, {
|
|
720
|
+
id: lineId,
|
|
721
|
+
kind: "item",
|
|
722
|
+
text: normalized,
|
|
723
|
+
label: "Commentary",
|
|
724
|
+
prefix: false
|
|
725
|
+
}, { maxLines: resolveChannelProgressDraftMaxLines(params.discordConfig) });
|
|
726
|
+
await progressDraftGate.startNow();
|
|
727
|
+
await renderProgressDraft();
|
|
728
|
+
},
|
|
674
729
|
resolvePreviewFinalText(text) {
|
|
675
730
|
if (typeof text !== "string") return;
|
|
676
731
|
const formatted = convertMarkdownTables(stripInlineDirectiveTagsForDelivery(text).text, params.tableMode);
|
|
@@ -759,12 +814,21 @@ function createDiscordDraftPreviewController(params) {
|
|
|
759
814
|
function normalizeReasoningProgressLine(text) {
|
|
760
815
|
return text.replace(/^\s*(?:>\s*)?(?:Reasoning:|Thinking\.{0,3})\s*/i, "").replace(/\s+/g, " ").trim();
|
|
761
816
|
}
|
|
762
|
-
function
|
|
817
|
+
function normalizeCommentaryProgressText(text) {
|
|
818
|
+
const cleaned = stripInlineDirectiveTagsForDelivery(text).text.trim();
|
|
819
|
+
if (!cleaned || isSilentCommentaryProgressText(cleaned)) return "";
|
|
820
|
+
return cleaned.split(/\r?\n/u).map((line) => line.replace(/\s+/g, " ").trim()).filter(Boolean).map((line) => `_${line}_`).join("\n");
|
|
821
|
+
}
|
|
822
|
+
function isSilentCommentaryProgressText(text) {
|
|
823
|
+
const normalized = text.replace(/^[\s*_`~]+|[\s*_`~]+$/gu, "").trim();
|
|
824
|
+
return /^NO_REPLY$/iu.test(normalized);
|
|
825
|
+
}
|
|
826
|
+
function mergeReasoningProgressText(current, incoming, options) {
|
|
763
827
|
if (!current) return incoming;
|
|
764
828
|
const normalizedCurrent = normalizeReasoningProgressLine(current);
|
|
765
829
|
const normalizedIncoming = normalizeReasoningProgressLine(incoming);
|
|
766
830
|
if (!normalizedIncoming || normalizedIncoming === normalizedCurrent) return current;
|
|
767
|
-
if (isReasoningSnapshotText(incoming) || normalizedIncoming.startsWith(normalizedCurrent)) return incoming;
|
|
831
|
+
if (options?.snapshot === true || isReasoningSnapshotText(incoming) || normalizedIncoming.startsWith(normalizedCurrent)) return incoming;
|
|
768
832
|
return `${current}${incoming}`;
|
|
769
833
|
}
|
|
770
834
|
function isReasoningSnapshotText(text) {
|
|
@@ -1373,7 +1437,7 @@ async function processDiscordMessage(ctx, observer) {
|
|
|
1373
1437
|
onReasoningStream: async (payload) => {
|
|
1374
1438
|
await statusReactions.setThinking();
|
|
1375
1439
|
const formattedText = payload?.text ? formatReasoningMessage(payload.text) : void 0;
|
|
1376
|
-
await draftPreview.pushReasoningProgress(formattedText);
|
|
1440
|
+
await draftPreview.pushReasoningProgress(formattedText, { snapshot: payload?.isReasoningSnapshot === true });
|
|
1377
1441
|
},
|
|
1378
1442
|
onToolStart: async (payload) => {
|
|
1379
1443
|
if (isProcessAborted(abortSignal)) return;
|
|
@@ -1387,6 +1451,10 @@ async function processDiscordMessage(ctx, observer) {
|
|
|
1387
1451
|
}, payload.detailMode ? { detailMode: payload.detailMode } : void 0), { toolName: payload.name });
|
|
1388
1452
|
},
|
|
1389
1453
|
onItemEvent: async (payload) => {
|
|
1454
|
+
if (payload.kind === "preamble") {
|
|
1455
|
+
if (draftPreview.commentaryProgressEnabled && payload.progressText) await draftPreview.pushCommentaryProgress(payload.progressText, { itemId: payload.itemId });
|
|
1456
|
+
return;
|
|
1457
|
+
}
|
|
1390
1458
|
await draftPreview.pushToolProgress(buildChannelProgressDraftLineForEntry(discordConfig, {
|
|
1391
1459
|
event: "item",
|
|
1392
1460
|
itemId: payload.itemId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-
|
|
1
|
+
import { u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-JrJXT7L0.js";
|
|
2
2
|
import { a as mergeAbortSignals } from "./timeouts-l_PsHQvX.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";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as normalizeDiscordOutboundTarget, s as chunkDiscordTextWithMode, t as createDiscordSendReceipt, x as DiscordError } from "./send.receipt-
|
|
1
|
+
import { o as normalizeDiscordOutboundTarget, s as chunkDiscordTextWithMode, t as createDiscordSendReceipt, x as DiscordError } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
|
|
3
|
-
import { d as readDiscordComponentSpec } from "./components-
|
|
3
|
+
import { d as readDiscordComponentSpec } from "./components-DX5Baphr.js";
|
|
4
4
|
import { n as notifyDiscordInboundEventOutboundPayloadSuccess } from "./inbound-event-delivery-CEPlt2uz.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { resolvePayloadMediaUrls, sendPayloadMediaSequenceOrFallback, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -24,7 +24,9 @@ function getDiscordDeliveryRetryAfterMs(err) {
|
|
|
24
24
|
if ("retryAfter" in err && typeof err.retryAfter === "number" && Number.isFinite(err.retryAfter)) return err.retryAfter * 1e3;
|
|
25
25
|
const retryAfterRaw = err.headers?.["retry-after"];
|
|
26
26
|
if (!retryAfterRaw) return;
|
|
27
|
-
const
|
|
27
|
+
const trimmedRetryAfter = retryAfterRaw.trim();
|
|
28
|
+
if (!/^\d+(?:\.\d+)?$/.test(trimmedRetryAfter)) return;
|
|
29
|
+
const retryAfterMs = Number(trimmedRetryAfter) * 1e3;
|
|
28
30
|
return Number.isFinite(retryAfterMs) ? retryAfterMs : void 0;
|
|
29
31
|
}
|
|
30
32
|
async function withDiscordDeliveryRetry(params) {
|
|
@@ -84,11 +86,11 @@ function normalizeDiscordApprovalPayload(payload) {
|
|
|
84
86
|
let discordComponentSendPromise;
|
|
85
87
|
let discordSharedInteractivePromise;
|
|
86
88
|
async function sendDiscordComponentMessageLazy(...args) {
|
|
87
|
-
discordComponentSendPromise ??= import("./send.components-
|
|
89
|
+
discordComponentSendPromise ??= import("./send.components-2qRLUwBn.js").then((n) => n.i).then((module) => module.sendDiscordComponentMessage);
|
|
88
90
|
return await (await discordComponentSendPromise)(...args);
|
|
89
91
|
}
|
|
90
92
|
function loadDiscordSharedInteractive() {
|
|
91
|
-
discordSharedInteractivePromise ??= import("./components-
|
|
93
|
+
discordSharedInteractivePromise ??= import("./components-DX5Baphr.js").then((n) => n.a);
|
|
92
94
|
return discordSharedInteractivePromise;
|
|
93
95
|
}
|
|
94
96
|
function addPayloadTextFallback(spec, payload) {
|
|
@@ -123,7 +125,7 @@ async function resolveDiscordComponentSpec(payload) {
|
|
|
123
125
|
//#region extensions/discord/src/outbound-send-context.ts
|
|
124
126
|
let discordSendRuntimePromise;
|
|
125
127
|
async function loadDiscordSendRuntime() {
|
|
126
|
-
discordSendRuntimePromise ??= import("./send-
|
|
128
|
+
discordSendRuntimePromise ??= import("./send-3r8QQkTY.js").then((n) => n.t);
|
|
127
129
|
return await discordSendRuntimePromise;
|
|
128
130
|
}
|
|
129
131
|
function resolveDiscordOutboundTarget(params) {
|
|
@@ -313,7 +315,7 @@ function stripDiscordInternalRuntimeScaffolding(text) {
|
|
|
313
315
|
}
|
|
314
316
|
let discordThreadBindingsPromise;
|
|
315
317
|
function loadDiscordThreadBindings() {
|
|
316
|
-
discordThreadBindingsPromise ??= import("./thread-bindings-
|
|
318
|
+
discordThreadBindingsPromise ??= import("./thread-bindings-Cm3GqlNC.js").then((n) => n.t);
|
|
317
319
|
return discordThreadBindingsPromise;
|
|
318
320
|
}
|
|
319
321
|
function resolveDiscordWebhookIdentity(params) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-Bo_43DQZ.js";
|
|
2
2
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
3
3
|
//#region extensions/discord/src/pluralkit.ts
|
|
4
4
|
var pluralkit_exports = /* @__PURE__ */ __exportAll({ fetchPluralKitMessageInfo: () => fetchPluralKitMessageInfo });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as normalizeDiscordToken } from "./accounts-dXTfmnSZ.js";
|
|
2
|
-
import { n as fetchDiscord, t as DiscordApiError } from "./api-
|
|
2
|
+
import { n as fetchDiscord, t as DiscordApiError } from "./api-ChQJ1kfZ.js";
|
|
3
3
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
import { fetchWithTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
1
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-CSBPZIYV.js";
|
|
2
2
|
export { fetchDiscordApplicationId, fetchDiscordApplicationSummary, parseApplicationIdFromToken, probeDiscord, resolveDiscordPrivilegedIntentsFromFlags };
|