@openclaw/discord 2026.6.9-beta.1 → 2026.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-runtime-api.js +1 -1
- package/dist/{api-BmXlcjYW.js → api-4GFMoWu0.js} +4 -1
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-BprBDUQG.js → approval-handler.runtime-20qhf0uH.js} +3 -3
- package/dist/{audit-DuZUxGjM.js → audit-CCffO6o7.js} +3 -3
- package/dist/{channel-actions-CoudAyAB.js → channel-actions-DDT9kJXw.js} +2 -2
- package/dist/{channel-actions.runtime-DdOfD3fi.js → channel-actions.runtime-CfMUtfAv.js} +5 -5
- package/dist/{channel--3YhTUOb.js → channel-fEBKaO2Q.js} +15 -15
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-C-y6Jifd.js → channel.setup-DRJiHe7I.js} +2 -3
- package/dist/{components-CUmrNvv-.js → components-CXEorOhu.js} +1 -1
- package/dist/{conversation-identity-CN-HPn11.js → conversation-identity-BvlP-djn.js} +2 -2
- package/dist/{directory-config-BCt5KxcX.js → directory-config-Bg8bulWB.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-CE7IDmwo.js → directory-live-BAJw6kS2.js} +2 -2
- package/dist/{handle-action.guild-admin-B7SnVS0m.js → handle-action.guild-admin-RxnJFLgU.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{manager.runtime-zMVwNPAT.js → manager.runtime-Bh5X0o8P.js} +3 -3
- package/dist/{message-handler-DE413Oj4.js → message-handler-Dg3DRD0e.js} +6 -6
- package/dist/{message-handler.preflight-BuF-DsE2.js → message-handler.preflight-CcexCYuy.js} +10 -10
- package/dist/{message-handler.process-BX8HsMfV.js → message-handler.process-CN8bVDxj.js} +10 -32
- package/dist/{message-utils-s_8KDqAQ.js → message-utils-ConlUKCU.js} +1 -1
- package/dist/{outbound-adapter-CNievjXH.js → outbound-adapter-XuMiR77A.js} +6 -6
- package/dist/{pluralkit-BXkU9XmC.js → pluralkit-o6s-EP9g.js} +4 -2
- package/dist/{probe-2MdGjUAf.js → probe-CxnDikWm.js} +5 -2
- package/dist/{probe.runtime-J927koKG.js → probe.runtime-DLFkSDVB.js} +1 -1
- package/dist/{provider-ByZ6xxgi.js → provider-4VG5CvC-.js} +32 -32
- package/dist/{provider-session.runtime-DMfaQ9Z6.js → provider-session.runtime-ChdHgGCo.js} +3 -3
- package/dist/provider.runtime-B4QuZl_o.js +2 -0
- package/dist/{resolve-allowlist-common-B3p7cT8F.js → resolve-allowlist-common-BDpBb8dF.js} +1 -1
- package/dist/{resolve-channels-t1URw0Qz.js → resolve-channels-DpM2v0Am.js} +3 -3
- package/dist/{resolve-users-Bapkb237.js → resolve-users-Dl6np4pH.js} +3 -3
- package/dist/{runtime-C6jV3hf4.js → runtime-CkdyyjTb.js} +7 -7
- 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-9pShEBWs.js +6 -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-o-Y1DiAT.js → send-CIhsDMqs.js} +8 -5
- package/dist/{send.components-B4_oNcOh.js → send.components-DxoGyTkn.js} +4 -4
- package/dist/{send.outbound-DhiXV3UJ.js → send.outbound-DaUyYuZa.js} +3 -3
- package/dist/{send.receipt-HXIwVvXy.js → send.receipt-De_2iEWU.js} +0 -23
- package/dist/{send.shared-DYdjs_Zh.js → send.shared-gtgBGDuV.js} +2 -2
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{subagent-hooks-CbF_Z5F0.js → subagent-hooks-DPCipg2M.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-BxTHlBbM.js → system-events-4vmuyaBF.js} +1 -1
- package/dist/{target-resolver-DpC8iueE.js → target-resolver-CVrOhQyC.js} +2 -2
- package/dist/targets-CRGgRKs7.js +3 -0
- package/dist/{thread-bindings-CEVvN75T.js → thread-bindings-D2SBj6F8.js} +4 -4
- package/dist/{thread-bindings.discord-api-B8NfbxEB.js → thread-bindings.discord-api-C7STOVXm.js} +4 -4
- package/dist/{thread-bindings.manager-BKfUaXGt.js → thread-bindings.manager-CN4MIGoJ.js} +3 -3
- package/dist/{transcripts-source-W6n_8J8g.js → transcripts-source-39NBdNeE.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-0-pUmlY9.js → typing-CxIYS3vQ.js} +1 -1
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
- package/dist/provider.runtime-EW-G8l_U.js +0 -2
- package/dist/runtime-api.monitor-5BSxmucu.js +0 -6
- package/dist/targets-BEIgHBHc.js +0 -3
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { $ as BaseMessageInteractiveComponent, A as User, B as Container, D as CommandWithSubcommands, E as Command, F as Modal, J as Separator, K as Row, O as Guild, R as Button, S as RateLimitError, Wt as __exportAll, X as TextDisplay, Y as StringSelectMenu, c as discord_exports, ct as createThread, d as MessageReactionAddListener, dt as editChannel, f as MessageReactionRemoveListener, g as ThreadUpdateListener, k as Message, l as InteractionCreateListener, m as ReadyListener, mt as getChannelMessage, p as PresenceUpdateListener, s as chunkDiscordTextWithMode, u as MessageCreateListener, v as Client, y as Plugin } from "./send.receipt-
|
|
1
|
+
import { $ as BaseMessageInteractiveComponent, A as User, B as Container, D as CommandWithSubcommands, E as Command, F as Modal, J as Separator, K as Row, O as Guild, R as Button, S as RateLimitError, Wt as __exportAll, X as TextDisplay, Y as StringSelectMenu, c as discord_exports, ct as createThread, d as MessageReactionAddListener, dt as editChannel, f as MessageReactionRemoveListener, g as ThreadUpdateListener, k as Message, l as InteractionCreateListener, m as ReadyListener, mt as getChannelMessage, p as PresenceUpdateListener, s as chunkDiscordTextWithMode, u as MessageCreateListener, v as Client, y as Plugin } from "./send.receipt-De_2iEWU.js";
|
|
2
2
|
import { c as resolveDiscordAccountAllowFrom, d as resolveDiscordAccountDmPolicy, f as resolveDiscordMaxLinesPerMessage, p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { _ as parseDiscordComponentCustomId, b as parseDiscordModalCustomIdForInteraction, v as parseDiscordComponentCustomIdForInteraction, y as parseDiscordModalCustomId } from "./components-
|
|
4
|
-
import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-
|
|
3
|
+
import { _ as parseDiscordComponentCustomId, b as parseDiscordModalCustomIdForInteraction, v as parseDiscordComponentCustomIdForInteraction, y as parseDiscordModalCustomId } from "./components-CXEorOhu.js";
|
|
4
|
+
import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-DxoGyTkn.js";
|
|
5
5
|
import { c as setPresence, i as unregisterGateway, r as registerGateway } from "./gateway-registry-DPxmW0Db.js";
|
|
6
|
-
import { B as DISCORD_REST_TIMEOUT_MS, D as canViewDiscordGuildChannel, H as withValidatedDiscordProxy, I as createDiscordRestClient, V as validateDiscordProxyUrl } from "./send.shared-
|
|
7
|
-
import { a as summarizeDiscordResponseBody, i as isDiscordRateLimitResponseBody } from "./api-
|
|
6
|
+
import { B as DISCORD_REST_TIMEOUT_MS, D as canViewDiscordGuildChannel, H as withValidatedDiscordProxy, I as createDiscordRestClient, V as validateDiscordProxyUrl } from "./send.shared-gtgBGDuV.js";
|
|
7
|
+
import { a as summarizeDiscordResponseBody, i as isDiscordRateLimitResponseBody } from "./api-4GFMoWu0.js";
|
|
8
8
|
import { S as resolveTimestampMs, _ as resolveGroupDmAllow, a as normalizeDiscordSlug, b as formatDiscordUserTag, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, f as resolveDiscordMemberAccessState, h as resolveDiscordOwnerAllowFrom, i as normalizeDiscordDisplaySlug, l as resolveDiscordChannelPolicyCommandAuthorizer, m as resolveDiscordOwnerAccess, n as isDiscordGroupAllowedByPolicy, o as resolveDiscordAllowListMatch, p as resolveDiscordMemberAllowed, r as normalizeDiscordAllowList, v as shouldEmitDiscordReactionNotification, y as formatDiscordReactionEmoji } from "./allow-list-C-MqM-B_.js";
|
|
9
|
-
import { s as sendVoiceMessageDiscord } from "./send-
|
|
10
|
-
import { o as formatMention, t as sendMessageDiscord } from "./send.outbound-
|
|
9
|
+
import { s as sendVoiceMessageDiscord } from "./send-CIhsDMqs.js";
|
|
10
|
+
import { o as formatMention, t as sendMessageDiscord } from "./send.outbound-DaUyYuZa.js";
|
|
11
11
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
12
|
-
import { a as getDiscordExecApprovalApprovers, s as isDiscordExecApprovalClientEnabled, t as resolveDiscordConversationIdentity } from "./conversation-identity-
|
|
12
|
+
import { a as getDiscordExecApprovalApprovers, s as isDiscordExecApprovalClientEnabled, t as resolveDiscordConversationIdentity } from "./conversation-identity-BvlP-djn.js";
|
|
13
13
|
import { d as withAbortTimeout, l as raceWithTimeout } from "./timeouts-C5TBc_9x.js";
|
|
14
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
15
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
16
|
-
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-
|
|
17
|
-
import { r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
18
|
-
import { d as resolveDiscordMessageChannelId, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText, u as resolveDiscordChannelInfo } from "./message-utils-
|
|
14
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-DpM2v0Am.js";
|
|
15
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-Dl6np4pH.js";
|
|
16
|
+
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-C7STOVXm.js";
|
|
17
|
+
import { r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-CxnDikWm.js";
|
|
18
|
+
import { d as resolveDiscordMessageChannelId, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText, u as resolveDiscordChannelInfo } from "./message-utils-ConlUKCU.js";
|
|
19
19
|
import { t as resolveDiscordSenderIdentity } from "./sender-identity-CEsfDF0L.js";
|
|
20
|
-
import "./approval-handler.runtime-
|
|
20
|
+
import "./approval-handler.runtime-20qhf0uH.js";
|
|
21
21
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
22
22
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId, normalizeStringEntries, normalizeStringEntriesLower, summarizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
23
23
|
import { buildAgentSessionKey, deriveLastRoutePolicy, isAcpSessionKey, isSubagentSessionKey, parseAgentSessionKey, resolveAgentIdFromSessionKey, resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|
@@ -46,7 +46,7 @@ import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel
|
|
|
46
46
|
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
47
47
|
import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, canonicalizeAllowlistWithResolvedIds, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
|
|
48
48
|
import { buildPairingReply, upsertChannelPairingRequest, upsertChannelPairingRequest as upsertChannelPairingRequest$1 } from "openclaw/plugin-sdk/conversation-runtime";
|
|
49
|
-
import { clearExpiredCooldowns, ensureAuthProfileStore, isProfileInCooldown, resolveAgentAvatar, resolveDefaultModelForAgent, resolveHumanDelayConfig, resolveProfilesUnavailableReason } from "openclaw/plugin-sdk/agent-runtime";
|
|
49
|
+
import { clearExpiredCooldowns, ensureAuthProfileStore, formatReasoningMessage, isProfileInCooldown, resolveAgentAvatar, resolveDefaultModelForAgent, resolveHumanDelayConfig, resolveProfilesUnavailableReason } from "openclaw/plugin-sdk/agent-runtime";
|
|
50
50
|
import { truncateUtf16Safe, withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
51
51
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
52
52
|
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
|
|
@@ -5294,16 +5294,6 @@ var GatewayPlugin = class extends Plugin {
|
|
|
5294
5294
|
getRateLimitStatus() {
|
|
5295
5295
|
return this.outboundLimiter.getStatus();
|
|
5296
5296
|
}
|
|
5297
|
-
getIntentsInfo() {
|
|
5298
|
-
return {
|
|
5299
|
-
intents: this.options.intents ?? 0,
|
|
5300
|
-
hasGuilds: this.hasIntent(GatewayIntentBits.Guilds),
|
|
5301
|
-
hasGuildMembers: this.hasIntent(GatewayIntentBits.GuildMembers),
|
|
5302
|
-
hasGuildPresences: this.hasIntent(GatewayIntentBits.GuildPresences),
|
|
5303
|
-
hasGuildMessages: this.hasIntent(GatewayIntentBits.GuildMessages),
|
|
5304
|
-
hasMessageContent: this.hasIntent(GatewayIntentBits.MessageContent)
|
|
5305
|
-
};
|
|
5306
|
-
}
|
|
5307
5297
|
hasIntent(intent) {
|
|
5308
5298
|
return Boolean((this.options.intents ?? 0) & intent);
|
|
5309
5299
|
}
|
|
@@ -7905,10 +7895,20 @@ function resolveDiscordDeliveryOptions(params) {
|
|
|
7905
7895
|
}
|
|
7906
7896
|
};
|
|
7907
7897
|
}
|
|
7898
|
+
function formatDiscordReasoningPayload(payload) {
|
|
7899
|
+
if (payload.isReasoning !== true) return payload;
|
|
7900
|
+
const text = typeof payload.text === "string" ? payload.text.trim() : "";
|
|
7901
|
+
const nextPayload = {
|
|
7902
|
+
...payload,
|
|
7903
|
+
text: formatReasoningMessage(text)
|
|
7904
|
+
};
|
|
7905
|
+
delete nextPayload.isReasoning;
|
|
7906
|
+
return nextPayload;
|
|
7907
|
+
}
|
|
7908
7908
|
async function deliverDiscordReply(params) {
|
|
7909
7909
|
params.runtime;
|
|
7910
7910
|
const delivery = resolveDiscordDeliveryOptions(params);
|
|
7911
|
-
const payloads = sanitizeDiscordFrontChannelReplyPayloads(params.replies, { kind: params.kind });
|
|
7911
|
+
const payloads = sanitizeDiscordFrontChannelReplyPayloads(params.replies, { kind: params.kind }).map(formatDiscordReasoningPayload);
|
|
7912
7912
|
if (payloads.length === 0) return;
|
|
7913
7913
|
const send = await sendDurableMessageBatch({
|
|
7914
7914
|
cfg: params.cfg,
|
|
@@ -7946,7 +7946,7 @@ async function loadConversationRuntime$1() {
|
|
|
7946
7946
|
return await conversationRuntimePromise$1;
|
|
7947
7947
|
}
|
|
7948
7948
|
async function loadTypingRuntime() {
|
|
7949
|
-
typingRuntimePromise ??= import("./typing-
|
|
7949
|
+
typingRuntimePromise ??= import("./typing-CxIYS3vQ.js").then((n) => n.n);
|
|
7950
7950
|
return await typingRuntimePromise;
|
|
7951
7951
|
}
|
|
7952
7952
|
function buildDiscordComponentConversationLabel(params) {
|
|
@@ -8367,7 +8367,7 @@ async function dispatchPluginDiscordInteractiveEvent(params) {
|
|
|
8367
8367
|
//#region extensions/discord/src/monitor/agent-components.handlers.ts
|
|
8368
8368
|
let componentsRuntimePromise;
|
|
8369
8369
|
async function loadComponentsRuntime() {
|
|
8370
|
-
componentsRuntimePromise ??= import("./components-
|
|
8370
|
+
componentsRuntimePromise ??= import("./components-CXEorOhu.js").then((n) => n.t);
|
|
8371
8371
|
return await componentsRuntimePromise;
|
|
8372
8372
|
}
|
|
8373
8373
|
async function handleDiscordComponentEvent(params) {
|
|
@@ -9585,7 +9585,7 @@ async function runDiscordGatewayLifecycle(params) {
|
|
|
9585
9585
|
gatewayEmitter?.removeListener(DISCORD_GATEWAY_TRANSPORT_ACTIVITY_EVENT, onGatewayTransportActivity);
|
|
9586
9586
|
if (params.voiceManager) {
|
|
9587
9587
|
await params.voiceManager.destroy();
|
|
9588
|
-
const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-
|
|
9588
|
+
const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-39NBdNeE.js").then((n) => n.n);
|
|
9589
9589
|
setDiscordTranscriptsVoiceManager({
|
|
9590
9590
|
accountId: params.accountId,
|
|
9591
9591
|
manager: null
|
|
@@ -9863,7 +9863,7 @@ function logDiscordStartupPhase(params) {
|
|
|
9863
9863
|
});
|
|
9864
9864
|
}
|
|
9865
9865
|
async function loadDiscordVoiceRuntime() {
|
|
9866
|
-
const promise = discordVoiceRuntimePromise ?? import("./manager.runtime-
|
|
9866
|
+
const promise = discordVoiceRuntimePromise ?? import("./manager.runtime-Bh5X0o8P.js");
|
|
9867
9867
|
discordVoiceRuntimePromise = promise;
|
|
9868
9868
|
try {
|
|
9869
9869
|
return await promise;
|
|
@@ -9873,7 +9873,7 @@ async function loadDiscordVoiceRuntime() {
|
|
|
9873
9873
|
}
|
|
9874
9874
|
}
|
|
9875
9875
|
async function loadDiscordProviderSessionRuntime() {
|
|
9876
|
-
const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-
|
|
9876
|
+
const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-ChdHgGCo.js");
|
|
9877
9877
|
discordProviderSessionRuntimePromise = promise;
|
|
9878
9878
|
try {
|
|
9879
9879
|
return await promise;
|
|
@@ -10143,7 +10143,7 @@ async function monitorDiscordProvider(opts = {}) {
|
|
|
10143
10143
|
runtime,
|
|
10144
10144
|
botUserId
|
|
10145
10145
|
});
|
|
10146
|
-
const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-
|
|
10146
|
+
const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-39NBdNeE.js").then((n) => n.n);
|
|
10147
10147
|
setDiscordTranscriptsVoiceManager({
|
|
10148
10148
|
accountId: account.accountId,
|
|
10149
10149
|
manager: voiceManager
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-
|
|
2
|
-
import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
3
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
1
|
+
import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-D2SBj6F8.js";
|
|
2
|
+
import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-CN4MIGoJ.js";
|
|
3
|
+
import { t as createDiscordMessageHandler } from "./message-handler-Dg3DRD0e.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,5 +1,5 @@
|
|
|
1
1
|
import { p as normalizeDiscordToken } from "./accounts-P19jm1lf.js";
|
|
2
|
-
import { n as fetchDiscord } from "./api-
|
|
2
|
+
import { n as fetchDiscord } from "./api-4GFMoWu0.js";
|
|
3
3
|
import { a as normalizeDiscordSlug } from "./allow-list-C-MqM-B_.js";
|
|
4
4
|
//#region extensions/discord/src/guilds.ts
|
|
5
5
|
async function listGuilds(token, fetcher) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
2
|
-
import { n as fetchDiscord, t as DiscordApiError } from "./api-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-De_2iEWU.js";
|
|
2
|
+
import { n as fetchDiscord, t as DiscordApiError } from "./api-4GFMoWu0.js";
|
|
3
3
|
import { a as normalizeDiscordSlug } from "./allow-list-C-MqM-B_.js";
|
|
4
|
-
import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-
|
|
4
|
+
import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-BDpBb8dF.js";
|
|
5
5
|
//#region extensions/discord/src/resolve-channels.ts
|
|
6
6
|
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveDiscordChannelAllowlist: () => resolveDiscordChannelAllowlist });
|
|
7
7
|
function parseDiscordChannelInput(raw) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
2
|
-
import { n as fetchDiscord } from "./api-
|
|
3
|
-
import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-De_2iEWU.js";
|
|
2
|
+
import { n as fetchDiscord } from "./api-4GFMoWu0.js";
|
|
3
|
+
import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-BDpBb8dF.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/discord/src/resolve-users.ts
|
|
6
6
|
var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveDiscordUserAllowlist: () => resolveDiscordUserAllowlist });
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Ut as resolveDiscordChannelId } from "./send.receipt-
|
|
1
|
+
import { Ut as resolveDiscordChannelId } from "./send.receipt-De_2iEWU.js";
|
|
2
2
|
import { a as mergeDiscordAccountConfig, o as resolveDefaultDiscordAccountId, t as createDiscordActionGate } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { d as readDiscordComponentSpec } from "./components-
|
|
4
|
-
import { _ as withNormalizedTimestamp, c as jsonResult, d as readNonNegativeIntegerParam, f as readPositiveIntegerParam, g as resolvePollMaxSelections, h as readStringParam, l as parseAvailableTags, m as readStringArrayParam, p as readReactionParams, r as sendDiscordComponentMessage, s as assertMediaNotDataUrl, u as readBooleanParam } from "./send.components-
|
|
3
|
+
import { d as readDiscordComponentSpec } from "./components-CXEorOhu.js";
|
|
4
|
+
import { _ as withNormalizedTimestamp, c as jsonResult, d as readNonNegativeIntegerParam, f as readPositiveIntegerParam, g as resolvePollMaxSelections, h as readStringParam, l as parseAvailableTags, m as readStringArrayParam, p as readReactionParams, r as sendDiscordComponentMessage, s as assertMediaNotDataUrl, u as readBooleanParam } from "./send.components-DxoGyTkn.js";
|
|
5
5
|
import { n as getGateway, o as getPresence } from "./gateway-registry-DPxmW0Db.js";
|
|
6
|
-
import { E as canManageGuildRoleDiscord, L as createDiscordRuntimeAccountContext, M as hasAnyGuildPermissionDiscord, N as isThreadChannelType$1, O as fetchChannelPermissionsDiscord, T as canManageGuildMemberRoleDiscord, d as resolveDiscordTargetChannelId, j as hasAnyChannelPermissionDiscord } from "./send.shared-
|
|
6
|
+
import { E as canManageGuildRoleDiscord, L as createDiscordRuntimeAccountContext, M as hasAnyGuildPermissionDiscord, N as isThreadChannelType$1, O as fetchChannelPermissionsDiscord, T as canManageGuildMemberRoleDiscord, d as resolveDiscordTargetChannelId, j as hasAnyChannelPermissionDiscord } from "./send.shared-gtgBGDuV.js";
|
|
7
7
|
import { a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, n as isDiscordGroupAllowedByPolicy } from "./allow-list-C-MqM-B_.js";
|
|
8
|
-
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-
|
|
9
|
-
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
10
|
-
import "./targets-
|
|
8
|
+
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-CIhsDMqs.js";
|
|
9
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DaUyYuZa.js";
|
|
10
|
+
import "./targets-CRGgRKs7.js";
|
|
11
11
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
|
|
13
13
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -1,3 +1,3 @@
|
|
|
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-
|
|
2
|
-
import { t as discordMessageActions } from "./channel-actions-
|
|
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-CkdyyjTb.js";
|
|
2
|
+
import { t as discordMessageActions } from "./channel-actions-DDT9kJXw.js";
|
|
3
3
|
export { discordMessageActions, handleDiscordAction, isDiscordModerationAction, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, requiredGuildPermissionForModerationAction };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { x as resolveDiscordOutboundSessionRoute } from "./components-
|
|
2
|
-
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-
|
|
1
|
+
import { x as resolveDiscordOutboundSessionRoute } from "./components-CXEorOhu.js";
|
|
2
|
+
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-DxoGyTkn.js";
|
|
3
3
|
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";
|
|
4
|
-
import { A as hasAllGuildPermissionsDiscord, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, k as fetchMemberGuildPermissionsDiscord, w as DiscordSendError } from "./send.shared-
|
|
5
|
-
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
4
|
+
import { A as hasAllGuildPermissionsDiscord, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, k as fetchMemberGuildPermissionsDiscord, w as DiscordSendError } from "./send.shared-gtgBGDuV.js";
|
|
5
|
+
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-BAJw6kS2.js";
|
|
6
6
|
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";
|
|
7
|
-
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-
|
|
8
|
-
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
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-
|
|
7
|
+
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-CIhsDMqs.js";
|
|
8
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DaUyYuZa.js";
|
|
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-CkdyyjTb.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-DDT9kJXw.js";
|
|
12
12
|
import { C as resolveThreadBindingIdleTimeoutMs, E as resolveThreadBindingMaxAgeMs, T as resolveThreadBindingMaxAgeExpiresAt, d as isRecentlyUnboundThreadWebhookMessage, w as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-iSWjCYjB.js";
|
|
13
13
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-Chs3HgGa.js";
|
|
14
14
|
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";
|
|
15
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
16
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
17
|
-
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-
|
|
18
|
-
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-
|
|
19
|
-
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
20
|
-
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
15
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-DpM2v0Am.js";
|
|
16
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-Dl6np4pH.js";
|
|
17
|
+
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-C7STOVXm.js";
|
|
18
|
+
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-D2SBj6F8.js";
|
|
19
|
+
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-CN4MIGoJ.js";
|
|
20
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-CxnDikWm.js";
|
|
21
21
|
import "./runtime-api.actions.js";
|
|
22
|
-
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-
|
|
22
|
+
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-CCffO6o7.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-4VG5CvC-.js";
|
|
25
|
+
import { i as buildDiscordMediaPayload } from "./message-utils-ConlUKCU.js";
|
|
26
|
+
import { t as createDiscordMessageHandler } from "./message-handler-Dg3DRD0e.js";
|
|
27
|
+
import "./runtime-api.monitor-9pShEBWs.js";
|
|
28
28
|
import "./runtime-api.send.js";
|
|
29
29
|
import "./runtime-api.threads.js";
|
|
30
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,7 +1,7 @@
|
|
|
1
|
-
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
1
|
+
import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-BAJw6kS2.js";
|
|
2
2
|
import { r as setDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
3
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
4
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
5
|
-
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
6
|
-
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-DpM2v0Am.js";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-Dl6np4pH.js";
|
|
5
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-CxnDikWm.js";
|
|
6
|
+
import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-CCffO6o7.js";
|
|
7
7
|
export { auditDiscordChannelPermissions, collectDiscordAuditChannelIds, fetchDiscordApplicationId, fetchDiscordApplicationSummary, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, parseApplicationIdFromToken, probeDiscord, resolveDiscordChannelAllowlist, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordUserAllowlist, setDiscordRuntime };
|
|
@@ -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
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-
|
|
5
|
-
import { i as buildDiscordMediaPayload } from "./message-utils-
|
|
6
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
7
|
-
import "./runtime-api.monitor-
|
|
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-4VG5CvC-.js";
|
|
5
|
+
import { i as buildDiscordMediaPayload } from "./message-utils-ConlUKCU.js";
|
|
6
|
+
import { t as createDiscordMessageHandler } from "./message-handler-Dg3DRD0e.js";
|
|
7
|
+
import "./runtime-api.monitor-9pShEBWs.js";
|
|
8
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 };
|
package/dist/runtime-api.send.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { x as resolveDiscordOutboundSessionRoute } from "./components-
|
|
2
|
-
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-
|
|
3
|
-
import { A as hasAllGuildPermissionsDiscord, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, k as fetchMemberGuildPermissionsDiscord, w as DiscordSendError } from "./send.shared-
|
|
4
|
-
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-
|
|
5
|
-
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
1
|
+
import { x as resolveDiscordOutboundSessionRoute } from "./components-CXEorOhu.js";
|
|
2
|
+
import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-DxoGyTkn.js";
|
|
3
|
+
import { A as hasAllGuildPermissionsDiscord, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, k as fetchMemberGuildPermissionsDiscord, w as DiscordSendError } from "./send.shared-gtgBGDuV.js";
|
|
4
|
+
import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-CIhsDMqs.js";
|
|
5
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DaUyYuZa.js";
|
|
6
6
|
export { DiscordSendError, addRoleDiscord, banMemberDiscord, createChannelDiscord, createScheduledEventDiscord, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, kickMemberDiscord, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadsDiscord, moveChannelDiscord, pinMessageDiscord, reactMessageDiscord, readMessagesDiscord, registerBuiltDiscordComponentMessage, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, resolveDiscordOutboundSessionRoute, resolveEventCoverImage, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, timeoutMemberDiscord, unpinMessageDiscord, uploadEmojiDiscord, uploadStickerDiscord };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as resolveThreadBindingIdleTimeoutMs, E as resolveThreadBindingMaxAgeMs, T as resolveThreadBindingMaxAgeExpiresAt, d as isRecentlyUnboundThreadWebhookMessage, w as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-iSWjCYjB.js";
|
|
2
2
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-Chs3HgGa.js";
|
|
3
|
-
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-
|
|
4
|
-
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-
|
|
5
|
-
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
3
|
+
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-C7STOVXm.js";
|
|
4
|
+
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-D2SBj6F8.js";
|
|
5
|
+
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-CN4MIGoJ.js";
|
|
6
6
|
export { testing as __testing, testing, autoBindSpawnedDiscordSubagent, createNoopThreadBindingManager, createThreadBindingManager, formatThreadBindingDurationLabel, getThreadBindingManager, isRecentlyUnboundThreadWebhookMessage, listThreadBindingsBySessionKey, listThreadBindingsForAccount, reconcileAcpThreadBindingsOnStartup, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, unbindThreadBindingsBySessionKey };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { At as getGuildMember, Bt as removeGuildMemberRole, C as readDiscordCode, Ct as createGuildBan, Dt as createGuildSticker, Et as createGuildScheduledEvent, Ft as listGuildRoles, It as listGuildScheduledEvents, Lt as moveGuildChannels, Mt as listGuildActiveThreads, Nt as listGuildChannels, Ot as deleteChannelPermission, Pt as listGuildEmojis, Rt as putChannelPermission, S as RateLimitError, St as addGuildMemberRole, T as readRetryAfter, Tt as createGuildEmoji, Vt as timeoutGuildMember, Wt as __exportAll, _t as listChannelPins, at as deleteOwnMessageReaction, bt as sendChannelTyping, ct as createThread, dt as editChannel, ft as editChannelMessage, gt as listChannelMessages, ht as listChannelArchivedThreads, it as createOwnMessageReaction, jt as getGuildVoiceState, kt as getGuild, lt as deleteChannel, mt as getChannelMessage, n as createDiscordSendResult, ot as listMessageReactionUsers, pt as getChannel, st as createChannelMessage, ut as deleteChannelMessage, vt as pinChannelMessage, w as readDiscordMessage, wt as createGuildChannel, x as DiscordError, xt as unpinChannelMessage, yt as searchGuildMessages, zt as removeGuildMember } from "./send.receipt-
|
|
1
|
+
import { At as getGuildMember, Bt as removeGuildMemberRole, C as readDiscordCode, Ct as createGuildBan, Dt as createGuildSticker, Et as createGuildScheduledEvent, Ft as listGuildRoles, It as listGuildScheduledEvents, Lt as moveGuildChannels, Mt as listGuildActiveThreads, Nt as listGuildChannels, Ot as deleteChannelPermission, Pt as listGuildEmojis, Rt as putChannelPermission, S as RateLimitError, St as addGuildMemberRole, T as readRetryAfter, Tt as createGuildEmoji, Vt as timeoutGuildMember, Wt as __exportAll, _t as listChannelPins, at as deleteOwnMessageReaction, bt as sendChannelTyping, ct as createThread, dt as editChannel, ft as editChannelMessage, gt as listChannelMessages, ht as listChannelArchivedThreads, it as createOwnMessageReaction, jt as getGuildVoiceState, kt as getGuild, lt as deleteChannel, mt as getChannelMessage, n as createDiscordSendResult, ot as listMessageReactionUsers, pt as getChannel, st as createChannelMessage, ut as deleteChannelMessage, vt as pinChannelMessage, w as readDiscordMessage, wt as createGuildChannel, x as DiscordError, xt as unpinChannelMessage, yt as searchGuildMessages, zt as removeGuildMember } from "./send.receipt-De_2iEWU.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { A as hasAllGuildPermissionsDiscord, C as DISCORD_MAX_STICKER_BYTES, D as canViewDiscordGuildChannel, E as canManageGuildRoleDiscord, F as createDiscordClient, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, P as parseAndResolveChannelRecipient, R as resolveDiscordClientAccountContext, S as DISCORD_MAX_EVENT_COVER_BYTES, T as canManageGuildMemberRoleDiscord, i as formatReactionEmoji, j as hasAnyChannelPermissionDiscord, k as fetchMemberGuildPermissionsDiscord, l as resolveChannelId, o as normalizeEmojiName, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, w as DiscordSendError, x as DISCORD_MAX_EMOJI_BYTES, z as resolveDiscordRest } from "./send.shared-
|
|
4
|
-
import { n as sendPollDiscord, r as sendStickerDiscord, s as rewriteDiscordKnownMentions, t as sendMessageDiscord } from "./send.outbound-
|
|
3
|
+
import { A as hasAllGuildPermissionsDiscord, C as DISCORD_MAX_STICKER_BYTES, D as canViewDiscordGuildChannel, E as canManageGuildRoleDiscord, F as createDiscordClient, M as hasAnyGuildPermissionDiscord, O as fetchChannelPermissionsDiscord, P as parseAndResolveChannelRecipient, R as resolveDiscordClientAccountContext, S as DISCORD_MAX_EVENT_COVER_BYTES, T as canManageGuildMemberRoleDiscord, i as formatReactionEmoji, j as hasAnyChannelPermissionDiscord, k as fetchMemberGuildPermissionsDiscord, l as resolveChannelId, o as normalizeEmojiName, r as buildReactionIdentifier, s as normalizeReactionEmoji, t as buildDiscordSendError, w as DiscordSendError, x as DISCORD_MAX_EMOJI_BYTES, z as resolveDiscordRest } from "./send.shared-gtgBGDuV.js";
|
|
4
|
+
import { n as sendPollDiscord, r as sendStickerDiscord, s as rewriteDiscordKnownMentions, t as sendMessageDiscord } from "./send.outbound-DaUyYuZa.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { ChannelType } from "discord-api-types/v10";
|
|
7
7
|
import { parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -12,6 +12,7 @@ import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, extensionForMime, maxBytesForKind
|
|
|
12
12
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
13
13
|
import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
|
|
14
14
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
15
|
+
import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
15
16
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
16
17
|
import fs from "node:fs/promises";
|
|
17
18
|
import { resolvePreferredOpenClawTmpDir, tempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
@@ -294,6 +295,7 @@ async function searchMessagesDiscord(query, opts) {
|
|
|
294
295
|
}
|
|
295
296
|
//#endregion
|
|
296
297
|
//#region extensions/discord/src/send.webhook.ts
|
|
298
|
+
const DISCORD_WEBHOOK_ERROR_BODY_LIMIT_BYTES = 8 * 1024;
|
|
297
299
|
function resolveWebhookExecutionUrl(params) {
|
|
298
300
|
const baseUrl = new URL(`https://discord.com/api/v10/webhooks/${encodeURIComponent(params.webhookId)}/${encodeURIComponent(params.webhookToken)}`);
|
|
299
301
|
baseUrl.searchParams.set("wait", params.wait === false ? "false" : "true");
|
|
@@ -309,7 +311,7 @@ function coerceWebhookErrorBody(raw) {
|
|
|
309
311
|
}
|
|
310
312
|
}
|
|
311
313
|
async function throwWebhookResponseError(response) {
|
|
312
|
-
const parsed = coerceWebhookErrorBody(await response
|
|
314
|
+
const parsed = coerceWebhookErrorBody(await readResponseTextLimited(response, DISCORD_WEBHOOK_ERROR_BODY_LIMIT_BYTES).catch(() => ""));
|
|
313
315
|
if (response.status === 429) throw new RateLimitError(response, {
|
|
314
316
|
message: readDiscordMessage(parsed, "Rate limited"),
|
|
315
317
|
retry_after: readRetryAfter(parsed, response, 1),
|
|
@@ -383,6 +385,7 @@ async function sendWebhookMessageDiscord(text, opts) {
|
|
|
383
385
|
const DISCORD_VOICE_MESSAGE_FLAG = 8192;
|
|
384
386
|
const WAVEFORM_SAMPLES = 256;
|
|
385
387
|
const DISCORD_OPUS_SAMPLE_RATE_HZ = 48e3;
|
|
388
|
+
const DISCORD_VOICE_ERROR_BODY_LIMIT_BYTES = 8 * 1024;
|
|
386
389
|
const DISCORD_VOICE_UPLOAD_SSRF_POLICY = {
|
|
387
390
|
allowRfc2544BenchmarkRange: true,
|
|
388
391
|
allowIpv6UniqueLocalRange: true
|
|
@@ -566,7 +569,7 @@ function coerceDiscordErrorBody(raw) {
|
|
|
566
569
|
}
|
|
567
570
|
}
|
|
568
571
|
async function createVoiceRequestError(response, fallbackMessage) {
|
|
569
|
-
const parsed = coerceDiscordErrorBody(await response
|
|
572
|
+
const parsed = coerceDiscordErrorBody(await readResponseTextLimited(response, DISCORD_VOICE_ERROR_BODY_LIMIT_BYTES).catch(() => ""));
|
|
570
573
|
if (response.status === 429) throw createRateLimitError(response, {
|
|
571
574
|
message: readDiscordMessage(parsed, "You are being rate limited."),
|
|
572
575
|
retry_after: readRetryAfter(parsed, response, 1),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Wt as __exportAll, ft as editChannelMessage, j as serializePayload, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll, ft as editChannelMessage, j as serializePayload, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-De_2iEWU.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
3
|
import "./config-api-JiPdJeb0.js";
|
|
4
4
|
import "./channel-api-CAJ0wMoV.js";
|
|
5
|
-
import { c as buildDiscordComponentMessage, f as resolveDiscordComponentAttachmentName, l as buildDiscordComponentMessageFlags } from "./components-
|
|
6
|
-
import { F as createDiscordClient, P as parseAndResolveChannelRecipient, b as stripUndefinedFields, h as SUPPRESS_NOTIFICATIONS_FLAG, l as resolveChannelId, m as toDiscordFileBlob, t as buildDiscordSendError, u as resolveDiscordChannelType } from "./send.shared-
|
|
7
|
-
import { t as sendMessageDiscord } from "./send.outbound-
|
|
5
|
+
import { c as buildDiscordComponentMessage, f as resolveDiscordComponentAttachmentName, l as buildDiscordComponentMessageFlags } from "./components-CXEorOhu.js";
|
|
6
|
+
import { F as createDiscordClient, P as parseAndResolveChannelRecipient, b as stripUndefinedFields, h as SUPPRESS_NOTIFICATIONS_FLAG, l as resolveChannelId, m as toDiscordFileBlob, t as buildDiscordSendError, u as resolveDiscordChannelType } from "./send.shared-gtgBGDuV.js";
|
|
7
|
+
import { t as sendMessageDiscord } from "./send.outbound-DaUyYuZa.js";
|
|
8
8
|
import { n as getOptionalDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
9
9
|
import "openclaw/plugin-sdk/account-id";
|
|
10
10
|
import "openclaw/plugin-sdk/secret-input";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ct as createThread, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-
|
|
1
|
+
import { ct as createThread, n as createDiscordSendResult, st as createChannelMessage } from "./send.receipt-De_2iEWU.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { F as createDiscordClient, P as parseAndResolveChannelRecipient, _ as resolveDiscordMessageFlags, a as normalizeDiscordPollInput, c as normalizeStickerIds, f as sendDiscordMedia, g as buildDiscordMessageRequest, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannelType, v as resolveDiscordSendComponents, y as resolveDiscordSendEmbeds } from "./send.shared-
|
|
4
|
-
import { a as resolveDiscordDirectoryUserId } from "./directory-live-
|
|
3
|
+
import { F as createDiscordClient, P as parseAndResolveChannelRecipient, _ as resolveDiscordMessageFlags, a as normalizeDiscordPollInput, c as normalizeStickerIds, f as sendDiscordMedia, g as buildDiscordMessageRequest, l as resolveChannelId, n as buildDiscordTextChunks, p as sendDiscordText, t as buildDiscordSendError, u as resolveDiscordChannelType, v as resolveDiscordSendComponents, y as resolveDiscordSendEmbeds } from "./send.shared-gtgBGDuV.js";
|
|
4
|
+
import { a as resolveDiscordDirectoryUserId } from "./directory-live-BAJw6kS2.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { ChannelType } from "discord-api-types/v10";
|
|
7
7
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -679,12 +679,6 @@ var Row = class extends BaseComponent {
|
|
|
679
679
|
addComponent(component) {
|
|
680
680
|
this.components.push(component);
|
|
681
681
|
}
|
|
682
|
-
removeComponent(component) {
|
|
683
|
-
this.components = this.components.filter((entry) => entry !== component);
|
|
684
|
-
}
|
|
685
|
-
removeAllComponents() {
|
|
686
|
-
this.components = [];
|
|
687
|
-
}
|
|
688
682
|
serialize() {
|
|
689
683
|
return {
|
|
690
684
|
type: this.type,
|
|
@@ -1441,9 +1435,6 @@ var Command = class extends BaseCommand {
|
|
|
1441
1435
|
async autocomplete(interaction) {
|
|
1442
1436
|
throw new Error(`The ${interaction.rawData?.data?.name ?? this.name} command does not support autocomplete`);
|
|
1443
1437
|
}
|
|
1444
|
-
async preCheck(interaction) {
|
|
1445
|
-
return Boolean(interaction) || true;
|
|
1446
|
-
}
|
|
1447
1438
|
serializeOptions() {
|
|
1448
1439
|
return this.options?.map((option) => {
|
|
1449
1440
|
if (typeof option.autocomplete === "function") {
|
|
@@ -1720,9 +1711,6 @@ var BaseInteraction = class {
|
|
|
1720
1711
|
this.response.recordReplyEdit();
|
|
1721
1712
|
return result;
|
|
1722
1713
|
}
|
|
1723
|
-
async deleteReply() {
|
|
1724
|
-
return await deleteWebhookMessage(this.client.rest, this.client.options.clientId, this.token, "@original");
|
|
1725
|
-
}
|
|
1726
1714
|
async fetchReply() {
|
|
1727
1715
|
return await getWebhookMessage(this.client.rest, this.client.options.clientId, this.token, "@original");
|
|
1728
1716
|
}
|
|
@@ -1764,11 +1752,6 @@ var BaseComponentInteraction = class extends BaseInteraction {
|
|
|
1764
1752
|
async showModal(modal) {
|
|
1765
1753
|
return await this.callback(InteractionResponseType.Modal, modal.serialize());
|
|
1766
1754
|
}
|
|
1767
|
-
async editAndWaitForComponent(payload, message = this.message, timeoutMs = 3e5) {
|
|
1768
|
-
if (!message) return null;
|
|
1769
|
-
const editedMessage = await message.edit(payload);
|
|
1770
|
-
return await this.client.componentHandler.waitForMessageComponent(editedMessage, timeoutMs);
|
|
1771
|
-
}
|
|
1772
1755
|
};
|
|
1773
1756
|
var ButtonInteraction = class extends BaseComponentInteraction {};
|
|
1774
1757
|
var StringSelectMenuInteraction = class extends BaseComponentInteraction {};
|
|
@@ -2756,15 +2739,9 @@ var Client = class {
|
|
|
2756
2739
|
async fetchMember(guildId, userId) {
|
|
2757
2740
|
return await this.entityCache.fetchMember(guildId, userId);
|
|
2758
2741
|
}
|
|
2759
|
-
async getDiscordCommands() {
|
|
2760
|
-
return await this.commandDeployer.getCommands();
|
|
2761
|
-
}
|
|
2762
2742
|
async deployCommands(options = {}) {
|
|
2763
2743
|
return await this.commandDeployer.deploy(options);
|
|
2764
2744
|
}
|
|
2765
|
-
async reconcileCommands() {
|
|
2766
|
-
return await this.deployCommands({ mode: "reconcile" });
|
|
2767
|
-
}
|
|
2768
2745
|
async handleInteraction(rawData, _ctx) {
|
|
2769
2746
|
await dispatchInteraction(this, rawData);
|
|
2770
2747
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-
|
|
1
|
+
import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-De_2iEWU.js";
|
|
2
2
|
import { a as mergeDiscordAccountConfig, p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
3
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-CVrOhQyC.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { ChannelType, MessageFlags, PermissionFlagsBits } from "discord-api-types/v10";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as testing, n as createThreadBindingManager } from "./thread-bindings.manager-
|
|
1
|
+
import { i as testing, n as createThreadBindingManager } from "./thread-bindings.manager-CN4MIGoJ.js";
|
|
2
2
|
export { createThreadBindingManager, testing as discordThreadBindingTesting };
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { t as discordSetupPlugin } from "./channel.setup-DRJiHe7I.js";
|
|
2
2
|
export { discordSetupPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-De_2iEWU.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-
|
|
3
|
+
import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-D2SBj6F8.js";
|
|
4
4
|
import { normalizeOptionalLowercaseString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { formatThreadBindingDisabledError, formatThreadBindingSpawnDisabledError, resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
|
|
6
6
|
//#region extensions/discord/src/subagent-hooks.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region extensions/discord/subagent-hooks-api.ts
|
|
2
2
|
let discordSubagentHooksPromise = null;
|
|
3
3
|
function loadDiscordSubagentHooksModule() {
|
|
4
|
-
discordSubagentHooksPromise ??= import("./subagent-hooks-
|
|
4
|
+
discordSubagentHooksPromise ??= import("./subagent-hooks-DPCipg2M.js").then((n) => n.i);
|
|
5
5
|
return discordSubagentHooksPromise;
|
|
6
6
|
}
|
|
7
7
|
function registerDiscordSubagentHooks(api) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as discord_exports } from "./send.receipt-
|
|
1
|
+
import { c as discord_exports } from "./send.receipt-De_2iEWU.js";
|
|
2
2
|
import { b as formatDiscordUserTag } from "./allow-list-C-MqM-B_.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/system-events.ts
|
|
4
4
|
function resolveDiscordSystemEvent(message, location) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-
|
|
1
|
+
import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-De_2iEWU.js";
|
|
2
2
|
import { c as resolveDiscordAccountAllowFrom, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
3
|
+
import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-BAJw6kS2.js";
|
|
4
4
|
import { buildMessagingTarget } from "openclaw/plugin-sdk/channel-targets";
|
|
5
5
|
//#region extensions/discord/src/send-target-parsing.ts
|
|
6
6
|
const parseDiscordSendTarget = (raw, options = {}) => parseDiscordTarget(raw, options);
|