@openclaw/discord 2026.11.6 → 2026.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{approval-handler.runtime-CJHU6Mqf.mjs → approval-handler.runtime-eKrSqVPF.mjs} +5 -5
- package/dist/.setup/{audit-Bjfvbnnr.mjs → audit-DZLJ0my1.mjs} +3 -3
- package/dist/.setup/{channel-tgjw3dY4.mjs → channel-COE1KIJz.mjs} +21 -16
- package/dist/.setup/{channel.setup-kNWMxlgu.mjs → channel.setup-B4SQu9Qg.mjs} +1 -1
- package/dist/.setup/{components-C1Phe3uw.mjs → components-Cy4hDa6J.mjs} +1 -1
- package/dist/.setup/{conversation-binding-route-DRgyU9D1.mjs → conversation-binding-route-Cy_QeEBm.mjs} +1 -1
- package/dist/.setup/{directory-live-CY2-qrHI.mjs → directory-live-DOVK9G9P.mjs} +3 -57
- package/dist/.setup/{discord-BRVFhk09.mjs → discord-KsHAulAQ.mjs} +65 -20
- package/dist/.setup/{doctor-RqH-6JB0.mjs → doctor-CQescbAS.mjs} +1 -1
- package/dist/.setup/{handle-action-CUBLAWoe.mjs → handle-action-BfSo0qkY.mjs} +7 -6
- package/dist/.setup/{handle-action.guild-admin-DRfsXqhO.mjs → handle-action.guild-admin-BOzk0kPz.mjs} +6 -3
- package/dist/.setup/{listeners-DnHLrLIN.mjs → listeners-C0-BvUVA.mjs} +1 -1
- package/dist/.setup/{message-handler-DU6MT6OP.mjs → message-handler-h8xpc_1a.mjs} +5 -5
- package/dist/.setup/{message-handler.preflight-DeWZDaqq.mjs → message-handler.preflight-CO1JNXKw.mjs} +7 -7
- package/dist/.setup/{message-handler.preflight-pluralkit-Dhcx7Ifz.mjs → message-handler.preflight-pluralkit-C4FSmp6X.mjs} +3 -3
- package/dist/.setup/{message-handler.process-ChPzcZzt.mjs → message-handler.process-IPQv14En.mjs} +13 -14
- package/dist/.setup/{outbound-payload-Bbblvliu.mjs → outbound-payload-Pz-zEQnX.mjs} +5 -5
- package/dist/.setup/{outbound-session-route-DtdCvVQu.mjs → outbound-session-route-CpweCkxm.mjs} +4 -4
- package/dist/.setup/{provider-BUMMYLwa.mjs → provider-D9dwCcy8.mjs} +66 -63
- package/dist/.setup/{provider-session.runtime-gMiDw44d.mjs → provider-session.runtime-pCvFOgHs.mjs} +3 -3
- package/dist/.setup/provider.runtime-DTEY_Gvi.mjs +1 -0
- package/dist/.setup/{realtime-session.runtime-BcxebrwD.mjs → realtime-session.runtime-CP8Opnfr.mjs} +5 -3
- package/dist/.setup/{runtime-DX2bmAau.mjs → runtime-BRcmFvOV.mjs} +40 -28
- package/dist/.setup/{send-C93UORFt.mjs → send-DXPqEgjA.mjs} +7 -6
- package/dist/.setup/{send.components-CtLtE0yD.mjs → send.components-MUCtA6qV.mjs} +6 -6
- package/dist/.setup/{send.outbound-D58xXPgs.mjs → send.outbound-70KlFdzN.mjs} +4 -5
- package/dist/.setup/{send.receipt-DLOV4qx6.mjs → send.receipt-DkCkAjRL.mjs} +58 -2
- package/dist/.setup/{send.shared-B_KKRrD7.mjs → send.shared-BXWCIkfx.mjs} +6 -5
- package/dist/.setup/setup-plugin-api-Dj04bzEC.mjs +2 -0
- package/dist/.setup/{shared-Dv2DamaK.mjs → shared-G2-0EUo3.mjs} +1 -1
- package/dist/.setup/{subagent-hooks-DZUGfwws.mjs → subagent-hooks-BUvQ4Oj4.mjs} +1 -1
- package/dist/.setup/{system-events-Dlzp9Jcj.mjs → system-events-CYFu0Vp4.mjs} +1 -1
- package/dist/.setup/{target-resolver-BzaZPBm9.mjs → target-resolver-54k9fO6u.mjs} +2 -2
- package/dist/.setup/{thread-bindings-jkFp9m4N.mjs → thread-bindings-BiO6_GA2.mjs} +2 -2
- package/dist/.setup/{thread-bindings.manager-CyX0Z04h.mjs → thread-bindings.manager-CadGpkjc.mjs} +6 -6
- package/dist/.setup/{thread-bindings.session-updates-DzJrXc4w.mjs → thread-bindings.session-updates-B4iJqhAn.mjs} +1 -1
- package/dist/.setup/{threading-BbsPuT5G.mjs → threading-Bem-g91c.mjs} +2 -2
- package/dist/.setup/{transcripts-source-DIW1fU_P.mjs → transcripts-source-DUL7GRxU.mjs} +1 -1
- package/dist/.setup/{voice-runtime-BmxCHhVv.mjs → voice-runtime-D0TWfWJO.mjs} +9 -8
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +1 -1
- package/dist/api.js +9 -9
- package/dist/channel-plugin-api.js +1 -1
- package/dist/runtime-api.js +15 -15
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-B-FGgY_6.mjs +0 -1
- package/dist/.setup/setup-plugin-api-ty5RJrMy.mjs +0 -2
package/dist/.setup/{outbound-session-route-DtdCvVQu.mjs → outbound-session-route-CpweCkxm.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-C_25wyxC.mjs";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-DGkdWwix.mjs";
|
|
3
3
|
import { w as isDiscordThreadChannelType } from "./allow-list-C3j0qLDp.mjs";
|
|
4
|
-
import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
4
|
+
import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-DkCkAjRL.mjs";
|
|
5
5
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
6
|
-
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-
|
|
6
|
+
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-Cy4hDa6J.mjs";
|
|
7
7
|
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-C7rUdqUX.mjs";
|
|
8
8
|
import { createLazyRuntimeMethod, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -215,7 +215,7 @@ const localExecutionActions = /* @__PURE__ */ new Set([
|
|
|
215
215
|
"sticker-upload",
|
|
216
216
|
"event-create"
|
|
217
217
|
]);
|
|
218
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-
|
|
218
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-BfSo0qkY.mjs"));
|
|
219
219
|
const discordActionGroups = [
|
|
220
220
|
{
|
|
221
221
|
gate: "polls",
|
|
@@ -712,7 +712,7 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
714
|
};
|
|
715
|
-
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-
|
|
715
|
+
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-MUCtA6qV.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
|
|
716
716
|
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./shared-interactive-DmzaoKOM.mjs").then((n) => n.r));
|
|
717
717
|
function addPayloadTextFallback(spec, payload) {
|
|
718
718
|
return spec.text ? spec : {
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { g as resolveDiscordToken, h as normalizeDiscordToken, l as resolveDiscordAccount, m as resolveDiscordMaxLinesPerMessage, p as resolveDiscordAccountDmPolicy, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import { B as unregisterGateway, C as hasAnyChannelPermissionDiscord, N as createDiscordRestClient, y as canViewDiscordGuildChannel, z as registerGateway } from "./send.shared-
|
|
3
|
-
import { B as RateLimitError, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, _ as Command, d as hasDiscordV2Components, g as User, h as Message, l as Client, m as Guild, n as GuildCreateListener, o as Modal, r as ReadyListener, t as discord_exports, u as asSerializableComponent, v as CommandWithSubcommands, z as DiscordError } from "./discord-
|
|
2
|
+
import { B as unregisterGateway, C as hasAnyChannelPermissionDiscord, N as createDiscordRestClient, y as canViewDiscordGuildChannel, z as registerGateway } from "./send.shared-BXWCIkfx.mjs";
|
|
3
|
+
import { B as RateLimitError, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, _ as Command, d as hasDiscordV2Components, g as User, h as Message, l as Client, m as Guild, n as GuildCreateListener, o as Modal, r as ReadyListener, t as discord_exports, u as asSerializableComponent, v as CommandWithSubcommands, z as DiscordError } from "./discord-KsHAulAQ.mjs";
|
|
4
4
|
import { S as formatDiscordUserTag, _ as resolveDiscordOwnerAllowFrom, a as normalizeDiscordDisplaySlug, b as shouldEmitDiscordReactionNotification, c as resolveDiscordChannelConfig, f as resolveDiscordGuildEntry, g as resolveDiscordOwnerAccess, i as normalizeDiscordAllowList, l as resolveDiscordChannelConfigWithFallback, m as resolveDiscordMemberAllowed, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, r as isDiscordGroupAllowedByPolicy, s as resolveDiscordAllowListMatch, u as resolveDiscordChannelPolicyCommandAuthorizer, w as isDiscordThreadChannelType, x as formatDiscordReactionEmoji, y as resolveGroupDmAllow } from "./allow-list-C3j0qLDp.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { S as chunkDiscordTextWithMode } from "./send.receipt-DkCkAjRL.mjs";
|
|
6
6
|
import { n as getDiscordEndpointRuntime, t as assertDiscordEndpointGatewayUrl } from "./endpoint-runtime-lf4DeLas.mjs";
|
|
7
7
|
import { n as validateDiscordProxyUrl, r as withValidatedDiscordProxy } from "./proxy-fetch-BzXwBAXt.mjs";
|
|
8
8
|
import { a as isDiscordRateLimitResponseBody, s as summarizeDiscordResponseBody } from "./api-DYRggUgK.mjs";
|
|
9
|
-
import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-
|
|
10
|
-
import { s as formatMention, t as sendMessageDiscord } from "./send.outbound-
|
|
9
|
+
import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-DXPqEgjA.mjs";
|
|
10
|
+
import { s as formatMention, t as sendMessageDiscord } from "./send.outbound-70KlFdzN.mjs";
|
|
11
11
|
import { l as withAbortTimeout } from "./timeouts-cIxzatmv.mjs";
|
|
12
12
|
import { r as setPresence, t as clearPresences } from "./presence-cache-Dq-3nH7R.mjs";
|
|
13
13
|
import { _ as parseDiscordModalCustomId, a as DISCORD_APPROVAL_DECISIONS, b as encodeCustomIdComponent, g as parseDiscordComponentCustomIdForInteraction, h as parseDiscordComponentCustomId, i as parseDiscordQuestionData, m as parseDiscordActivityCustomIdForInteraction, s as parseExecApprovalData, u as buildDiscordActivityCustomId, v as parseDiscordModalCustomIdForInteraction, y as decodeCustomIdComponent } from "./shared-interactive-DmzaoKOM.mjs";
|
|
14
|
-
import { a as buildDiscordComponentMessage } from "./components-
|
|
15
|
-
import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-
|
|
14
|
+
import { a as buildDiscordComponentMessage } from "./components-Cy4hDa6J.mjs";
|
|
15
|
+
import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-MUCtA6qV.mjs";
|
|
16
16
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
17
17
|
import { n as getDiscordActivitiesRuntime } from "./runtime-BMgTyuwg.mjs";
|
|
18
18
|
import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-C7rUdqUX.mjs";
|
|
19
|
-
import { D as getDiscordExecApprovalApprovers, _ as resolveDiscordConversationIdentity, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, d as setDiscordPolicyBindings, f as buildDiscordConversationRouteContext, h as resolveDiscordEffectiveRoute, k as isDiscordExecApprovalClientEnabled, m as resolveDiscordConversationRoute, n as DISCORD_PRESENTATION_CAPABILITIES, p as buildDiscordRoutePeer, r as buildDiscordPresentationPayload, s as DISCORD_APPROVAL_ALLOWED_MENTIONS, u as resolveDiscordGroupToolPolicy } from "./outbound-session-route-
|
|
19
|
+
import { D as getDiscordExecApprovalApprovers, _ as resolveDiscordConversationIdentity, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, d as setDiscordPolicyBindings, f as buildDiscordConversationRouteContext, h as resolveDiscordEffectiveRoute, k as isDiscordExecApprovalClientEnabled, m as resolveDiscordConversationRoute, n as DISCORD_PRESENTATION_CAPABILITIES, p as buildDiscordRoutePeer, r as buildDiscordPresentationPayload, s as DISCORD_APPROVAL_ALLOWED_MENTIONS, u as resolveDiscordGroupToolPolicy } from "./outbound-session-route-CpweCkxm.mjs";
|
|
20
20
|
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-y0Qy36X3.mjs";
|
|
21
21
|
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-g16NM6Ho.mjs";
|
|
22
22
|
import { t as resolveDiscordUserAllowlist } from "./resolve-users-DAfOOXdy.mjs";
|
|
23
|
-
import { a as isThreadArchived, n as getThreadBindingManager } from "./thread-bindings.manager-
|
|
23
|
+
import { a as isThreadArchived, n as getThreadBindingManager } from "./thread-bindings.manager-CadGpkjc.mjs";
|
|
24
24
|
import { n as resolveDiscordChannelNameSafe, r as resolveDiscordChannelTopicSafe, t as resolveDiscordChannelInfoSafe } from "./channel-access-9cyzozUP.mjs";
|
|
25
25
|
import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-CbDJojNV.mjs";
|
|
26
|
-
import { O as resolveDiscordReferencedReplyMessage, a as resolveDiscordVoiceEnabled, i as setDiscordTranscriptsVoiceManager, k as resolveDiscordReferencedReplyMessageId, l as resolveDiscordThreadLikeChannelContext, o as authorizeDiscordVoiceIngress, s as resolveDiscordVoiceAccess, u as resolveFetchedDiscordThreadLikeChannelContext } from "./transcripts-source-
|
|
26
|
+
import { O as resolveDiscordReferencedReplyMessage, a as resolveDiscordVoiceEnabled, i as setDiscordTranscriptsVoiceManager, k as resolveDiscordReferencedReplyMessageId, l as resolveDiscordThreadLikeChannelContext, o as authorizeDiscordVoiceIngress, s as resolveDiscordVoiceAccess, u as resolveFetchedDiscordThreadLikeChannelContext } from "./transcripts-source-DUL7GRxU.mjs";
|
|
27
27
|
import { t as resolveDiscordSenderIdentity } from "./sender-identity-BbA7FNbr.mjs";
|
|
28
28
|
import { n as hasDiscordApprovalControl, t as discordApprovalMessageUpdates } from "./approval-message-updates-DKsCfxSW.mjs";
|
|
29
29
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -34,7 +34,8 @@ import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|
|
34
34
|
import { asFiniteNumber, asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, parseFiniteNumber, readNonBlankString, summarizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
35
35
|
import { captureRuntimeConfigAsyncReader, createRuntimeConfigReader, getRuntimeConfigSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
36
36
|
import { ApplicationCommandOptionType, ButtonStyle, ChannelType, ComponentType, GatewayCloseCodes, GatewayCloseCodes as GatewayCloseCodes$1, GatewayDispatchEvents, GatewayIntentBits, GatewayOpcodes, PermissionFlagsBits } from "discord-api-types/v10";
|
|
37
|
-
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
|
|
37
|
+
import { buildOutboundMediaLoadOptions, getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
|
|
38
|
+
import { resolveOutboundMediaAccessForConfig } from "openclaw/plugin-sdk/outbound-media";
|
|
38
39
|
import { hasOutboundReplyContent, resolveSendableOutboundReplyParts, resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
|
|
39
40
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
40
41
|
import { MAX_TIMER_TIMEOUT_MS, asDateTimestampMs, asSafeIntegerInRange, parseStrictInteger, parseStrictPositiveInteger, resolvePromptHistoryLimit } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -68,7 +69,7 @@ import { enqueueKeyedTask } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
|
68
69
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
69
70
|
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
|
|
70
71
|
import { buildChannelInboundEventContext, createChannelPartialDeliveryError, createCommandTurnContext, dispatchChannelInboundTurn, formatInboundEnvelope, hasVisibleInboundReplyDispatch, isChannelPartialDeliveryError, resolveEnvelopeFormatOptions, resolveInboundSupplementalSenderAllowed, runChannelInboundEvent } from "openclaw/plugin-sdk/channel-inbound";
|
|
71
|
-
import { clearExpiredCooldowns, ensureAuthProfileStoreAsync, formatReasoningMessage, getPreparedModelCatalogSnapshot, isProfileInCooldown, listAgentIds,
|
|
72
|
+
import { clearExpiredCooldowns, ensureAuthProfileStoreAsync, formatReasoningMessage, getPreparedModelCatalogSnapshot, isProfileInCooldown, listAgentIds, resolveAgentAvatar, resolveAgentDir, resolveDefaultModelForAgent, resolveHumanDelayConfig, resolveProfilesUnavailableReason } from "openclaw/plugin-sdk/agent-runtime";
|
|
72
73
|
import { deleteSessionEntry, getSessionEntryAsync, listSessionEntriesAsync, readSessionUpdatedAtAsync, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
73
74
|
import { enqueueRoutedSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
74
75
|
import { captureHttpExchangeAsync, captureWsEventAsync, resolveDebugProxySettings, resolveEffectiveDebugProxyUrl } from "openclaw/plugin-sdk/proxy-capture";
|
|
@@ -1563,7 +1564,8 @@ function resolveDiscordInteractionReplyOptions(params) {
|
|
|
1563
1564
|
return {
|
|
1564
1565
|
textLimit: resolveTextChunkLimit(params.cfg, "discord", params.accountId, { fallbackLimit: 2e3 }),
|
|
1565
1566
|
maxLinesPerMessage: resolveDiscordMaxLinesPerMessage(params),
|
|
1566
|
-
chunkMode: resolveChunkMode(params.cfg, "discord", params.accountId)
|
|
1567
|
+
chunkMode: resolveChunkMode(params.cfg, "discord", params.accountId),
|
|
1568
|
+
mediaAccess: resolveOutboundMediaAccessForConfig(params.cfg)
|
|
1567
1569
|
};
|
|
1568
1570
|
}
|
|
1569
1571
|
function isDiscordUnknownInteraction(error) {
|
|
@@ -1664,7 +1666,10 @@ async function deliverDiscordInteractionReply(params) {
|
|
|
1664
1666
|
}
|
|
1665
1667
|
};
|
|
1666
1668
|
const files = reply.hasMedia ? await Promise.all(reply.mediaUrls.map(async (url) => {
|
|
1667
|
-
const loaded = await loadWebMedia(url, {
|
|
1669
|
+
const loaded = await loadWebMedia(url, {
|
|
1670
|
+
localRoots: params.mediaLocalRoots,
|
|
1671
|
+
ssrfPolicy: buildOutboundMediaLoadOptions({ mediaAccess: params.mediaAccess }).ssrfPolicy
|
|
1672
|
+
});
|
|
1668
1673
|
return {
|
|
1669
1674
|
name: loaded.fileName ?? "upload",
|
|
1670
1675
|
data: loaded.buffer,
|
|
@@ -4003,31 +4008,24 @@ async function dispatchDiscordCommandInteraction(params) {
|
|
|
4003
4008
|
if (!authority.isAllowed()) return reject("You are not authorized to use this command.", true);
|
|
4004
4009
|
const isGuild = Boolean(interaction.guild);
|
|
4005
4010
|
const channelId = rawChannelId || "unknown";
|
|
4006
|
-
const
|
|
4007
|
-
const menuModelContext = menuNeedsModelContext && bindingReadiness?.ok !== false ? await resolveDiscordNativeChoiceContext({
|
|
4011
|
+
const menuModelContext = !(commandArgs?.raw && !commandArgs.values) && command.args?.some((arg) => typeof arg.choices === "function" && commandArgs?.values?.[arg.name] == null) && bindingReadiness?.ok !== false ? await resolveDiscordNativeChoiceContext({
|
|
4008
4012
|
interaction,
|
|
4009
4013
|
cfg,
|
|
4010
4014
|
accountId,
|
|
4011
4015
|
threadBindings,
|
|
4012
4016
|
route: effectiveRoute
|
|
4013
4017
|
}) : null;
|
|
4014
|
-
const menuModelCatalog = command.key === "think" && menuNeedsModelContext ? await loadPreparedModelCatalog({
|
|
4015
|
-
config: cfg,
|
|
4016
|
-
...menuModelContext?.agentId ? {
|
|
4017
|
-
agentId: menuModelContext.agentId,
|
|
4018
|
-
agentDir: resolveAgentDir(cfg, menuModelContext.agentId)
|
|
4019
|
-
} : {},
|
|
4020
|
-
readOnly: true
|
|
4021
|
-
}) : void 0;
|
|
4022
4018
|
const menu = command.key === "verbose" && bindingReadiness?.ok === false ? null : await resolveCommandArgMenuAsync({
|
|
4023
4019
|
command,
|
|
4024
4020
|
args: commandArgs,
|
|
4025
4021
|
cfg,
|
|
4026
|
-
session: command.key === "verbose"
|
|
4022
|
+
session: command.key === "verbose" || command.key === "think" ? {
|
|
4023
|
+
agentId: menuModelContext?.agentId ?? effectiveRoute.agentId,
|
|
4024
|
+
sessionKey: effectiveRoute.sessionKey
|
|
4025
|
+
} : void 0,
|
|
4027
4026
|
provider: menuModelContext?.provider,
|
|
4028
4027
|
model: menuModelContext?.model,
|
|
4029
|
-
agentRuntime: menuModelContext?.agentRuntime
|
|
4030
|
-
catalog: menuModelCatalog
|
|
4028
|
+
agentRuntime: menuModelContext?.agentRuntime
|
|
4031
4029
|
});
|
|
4032
4030
|
if (policy?.isCurrent() === false) return reject("Access policy changed. Try this interaction again.", true);
|
|
4033
4031
|
if (menu) {
|
|
@@ -4222,7 +4220,7 @@ const createDiscordModelPickerFallbackSelect = bindDiscordCommandControl(createD
|
|
|
4222
4220
|
//#region extensions/discord/src/monitor/agent-components-reply.ts
|
|
4223
4221
|
async function replySilently(interaction, params, onError) {
|
|
4224
4222
|
try {
|
|
4225
|
-
await interaction.reply(params);
|
|
4223
|
+
await interaction[interaction.responseState === "deferred-update" ? "followUp" : "reply"](params);
|
|
4226
4224
|
} catch (error) {
|
|
4227
4225
|
onError?.(error);
|
|
4228
4226
|
}
|
|
@@ -4304,17 +4302,21 @@ function canResumeAfterGatewayClose(code) {
|
|
|
4304
4302
|
//#region extensions/discord/src/internal/gateway-identify-limiter.ts
|
|
4305
4303
|
const IDENTIFY_WINDOW_MS = 5e3;
|
|
4306
4304
|
var GatewayIdentifyLimiter = class {
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4305
|
+
constructor() {
|
|
4306
|
+
this.nextAllowedAt = 0;
|
|
4307
|
+
}
|
|
4308
|
+
async schedule(identify) {
|
|
4309
|
+
for (;;) {
|
|
4310
|
+
const waitMs = this.nextAllowedAt - performance.now();
|
|
4311
|
+
if (waitMs <= 0) break;
|
|
4312
|
+
await new Promise((resolve) => {
|
|
4313
|
+
setTimeout(resolve, waitMs).unref();
|
|
4314
|
+
});
|
|
4315
|
+
}
|
|
4316
|
+
if (identify()) this.nextAllowedAt = performance.now() + IDENTIFY_WINDOW_MS;
|
|
4315
4317
|
}
|
|
4316
4318
|
reset() {
|
|
4317
|
-
this.nextAllowedAt =
|
|
4319
|
+
this.nextAllowedAt = 0;
|
|
4318
4320
|
}
|
|
4319
4321
|
};
|
|
4320
4322
|
const sharedGatewayIdentifyLimiter = new GatewayIdentifyLimiter();
|
|
@@ -4704,29 +4706,30 @@ var GatewayPlugin = class {
|
|
|
4704
4706
|
d: this.sequence
|
|
4705
4707
|
}, true);
|
|
4706
4708
|
}
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
return;
|
|
4717
|
-
}
|
|
4718
|
-
this.send({
|
|
4719
|
-
op: GatewayOpcodes.Identify,
|
|
4720
|
-
d: {
|
|
4721
|
-
token: this.client?.options.token ?? "",
|
|
4722
|
-
intents: this.options.intents ?? 0,
|
|
4723
|
-
properties: {
|
|
4724
|
-
os: process.platform,
|
|
4725
|
-
browser: "openclaw",
|
|
4726
|
-
device: "openclaw"
|
|
4727
|
-
}
|
|
4709
|
+
identifyWithConcurrency(socket) {
|
|
4710
|
+
return sharedGatewayIdentifyLimiter.schedule(() => {
|
|
4711
|
+
if (socket !== this.ws) return false;
|
|
4712
|
+
if (socket.readyState !== READY_STATE_OPEN) {
|
|
4713
|
+
this.scheduleReconnect({
|
|
4714
|
+
reason: "identify",
|
|
4715
|
+
preferResume: false
|
|
4716
|
+
});
|
|
4717
|
+
return false;
|
|
4728
4718
|
}
|
|
4729
|
-
|
|
4719
|
+
this.send({
|
|
4720
|
+
op: GatewayOpcodes.Identify,
|
|
4721
|
+
d: {
|
|
4722
|
+
token: this.client?.options.token ?? "",
|
|
4723
|
+
intents: this.options.intents ?? 0,
|
|
4724
|
+
properties: {
|
|
4725
|
+
os: process.platform,
|
|
4726
|
+
browser: "openclaw",
|
|
4727
|
+
device: "openclaw"
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
}, true);
|
|
4731
|
+
return true;
|
|
4732
|
+
});
|
|
4730
4733
|
}
|
|
4731
4734
|
send(payload, skipRateLimit = false) {
|
|
4732
4735
|
if (!this.ws || this.ws.readyState !== READY_STATE_OPEN) throw new Error("Discord gateway socket is not open");
|
|
@@ -6096,7 +6099,7 @@ function createAgentSelectMenu(ctx) {
|
|
|
6096
6099
|
}
|
|
6097
6100
|
//#endregion
|
|
6098
6101
|
//#region extensions/discord/src/monitor/agent-components.ts
|
|
6099
|
-
const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-
|
|
6102
|
+
const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-Cy4hDa6J.mjs").then((n) => n.t));
|
|
6100
6103
|
async function resolveAuthorizedComponentEntry(params) {
|
|
6101
6104
|
const entry = params.entry ?? await params.resolve(false);
|
|
6102
6105
|
if (!entry) {
|
|
@@ -8012,7 +8015,7 @@ async function monitorDiscordProvider(opts) {
|
|
|
8012
8015
|
cfg,
|
|
8013
8016
|
accountId: account.accountId
|
|
8014
8017
|
}) ?? "pairing";
|
|
8015
|
-
const discordProviderSessionRuntime = await import("./provider-session.runtime-
|
|
8018
|
+
const discordProviderSessionRuntime = await import("./provider-session.runtime-pCvFOgHs.mjs");
|
|
8016
8019
|
const threadBindingIdleTimeoutMs = discordProviderSessionRuntime.resolveThreadBindingIdleTimeoutMs({
|
|
8017
8020
|
channelIdleHoursRaw: discordCfg.threadBindings?.idleHours,
|
|
8018
8021
|
sessionIdleHoursRaw: cfg.session?.threadBindings?.idleHours
|
|
@@ -8323,8 +8326,8 @@ async function monitorDiscordProvider(opts) {
|
|
|
8323
8326
|
};
|
|
8324
8327
|
let voiceManager = null;
|
|
8325
8328
|
if (voiceEnabled) {
|
|
8326
|
-
const { DiscordVoiceManager } = await import("./voice-runtime-
|
|
8327
|
-
const { DiscordVoiceGuildCreateListener, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener } = await import("./listeners-
|
|
8329
|
+
const { DiscordVoiceManager } = await import("./voice-runtime-D0TWfWJO.mjs");
|
|
8330
|
+
const { DiscordVoiceGuildCreateListener, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener } = await import("./listeners-C0-BvUVA.mjs");
|
|
8328
8331
|
voiceManager = new DiscordVoiceManager({
|
|
8329
8332
|
...monitorOptions,
|
|
8330
8333
|
scheduler
|
package/dist/.setup/{provider-session.runtime-gMiDw44d.mjs → provider-session.runtime-pCvFOgHs.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as createNoopThreadBindingManager, t as createThreadBindingManager } from "./thread-bindings.manager-
|
|
2
|
-
import { l as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-
|
|
3
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
1
|
+
import { i as createNoopThreadBindingManager, t as createThreadBindingManager } from "./thread-bindings.manager-CadGpkjc.mjs";
|
|
2
|
+
import { l as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-BiO6_GA2.mjs";
|
|
3
|
+
import { t as createDiscordMessageHandler } from "./message-handler-h8xpc_1a.mjs";
|
|
4
4
|
import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
5
|
import { getAcpSessionManager, isAcpRuntimeError, rethrowIncognitoSessionError } from "openclaw/plugin-sdk/acp-runtime";
|
|
6
6
|
export { createDiscordMessageHandler, createNoopThreadBindingManager, createThreadBindingManager, getAcpSessionManager, isAcpRuntimeError, reconcileAcpThreadBindingsOnStartup, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled, rethrowIncognitoSessionError };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as monitorDiscordProvider } from "./provider-D9dwCcy8.mjs";
|
package/dist/.setup/{realtime-session.runtime-BcxebrwD.mjs → realtime-session.runtime-CP8Opnfr.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as setDiscordAudioOutputStatus, h as restoreDiscordAudioError, l as createDiscordPcmToRealtimeConverter, m as getDiscordAudioOutputStatus, p as DiscordAudioOutputStatus } from "./receive-recovery-C3Ks4wAQ.mjs";
|
|
2
2
|
import { t as resolveDiscordOutputAudioDelta } from "./output-activity-uBpMSX75.mjs";
|
|
3
3
|
import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-B1kE4sDv.mjs";
|
|
4
|
-
import { y as logVoiceVerbose } from "./provider-
|
|
5
|
-
import { a as maybeControlDiscordVoiceAgentRun, i as logDiscordVoiceAgentControlResult, n as formatVoiceIngressPrompt, r as handleDiscordVoiceAgentControlToolCall, t as DiscordRealtimeRecording } from "./voice-runtime-
|
|
4
|
+
import { y as logVoiceVerbose } from "./provider-D9dwCcy8.mjs";
|
|
5
|
+
import { a as maybeControlDiscordVoiceAgentRun, i as logDiscordVoiceAgentControlResult, n as formatVoiceIngressPrompt, r as handleDiscordVoiceAgentControlToolCall, t as DiscordRealtimeRecording } from "./voice-runtime-D0TWfWJO.mjs";
|
|
6
6
|
import { MessageChannel } from "node:worker_threads";
|
|
7
7
|
import { formatErrorMessage, readErrorName, toErrorObject, toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
8
8
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -1319,6 +1319,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1319
1319
|
this.inputOpen = true;
|
|
1320
1320
|
this.activeOperations = 0;
|
|
1321
1321
|
this.outputEnabled = true;
|
|
1322
|
+
this.interruptResponseOnInputAudio = false;
|
|
1322
1323
|
this.inputIdleListeners = /* @__PURE__ */ new Set();
|
|
1323
1324
|
this.lastActivityAt = Date.now();
|
|
1324
1325
|
this.outputEnabled = !params.standby;
|
|
@@ -1414,6 +1415,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1414
1415
|
this.selection = selection;
|
|
1415
1416
|
const capabilities = resolved.capabilities;
|
|
1416
1417
|
this.policy = sessionPolicy;
|
|
1418
|
+
this.interruptResponseOnInputAudio = interruptResponseOnInputAudio;
|
|
1417
1419
|
const { toolPolicy, consultPolicy, autoRespondToAudio } = sessionPolicy;
|
|
1418
1420
|
const usesRealtimeAgentHandoff = this.params.mode === "bidi" || toolPolicy !== "none";
|
|
1419
1421
|
const onReady = () => {
|
|
@@ -1656,7 +1658,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1656
1658
|
}
|
|
1657
1659
|
}
|
|
1658
1660
|
canReceiveDuringPlayback() {
|
|
1659
|
-
return this.bridge?.bridge.outputAudioMode === "continuous" || this.playback.isBargeInEnabled();
|
|
1661
|
+
return this.bridge?.bridge.outputAudioMode === "continuous" || this.interruptResponseOnInputAudio || this.playback.isBargeInEnabled();
|
|
1660
1662
|
}
|
|
1661
1663
|
get realtimeConfig() {
|
|
1662
1664
|
return this.params.discordConfig.voice?.realtime;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, t as createDiscordActionGate } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import { C as hasAnyChannelPermissionDiscord, P as createDiscordRuntimeAccountContext, R as getGateway, _ as canManageGuildMemberRoleDiscord, b as fetchChannelPermissionsDiscord, n as buildDiscordTextChunks, u as resolveDiscordTargetChannelId, v as canManageGuildRoleDiscord, w as hasAnyGuildPermissionDiscord, y as canViewDiscordGuildChannel } from "./send.shared-
|
|
2
|
+
import { C as hasAnyChannelPermissionDiscord, P as createDiscordRuntimeAccountContext, R as getGateway, _ as canManageGuildMemberRoleDiscord, b as fetchChannelPermissionsDiscord, n as buildDiscordTextChunks, u as resolveDiscordTargetChannelId, v as canManageGuildRoleDiscord, w as hasAnyGuildPermissionDiscord, y as canViewDiscordGuildChannel } from "./send.shared-BXWCIkfx.mjs";
|
|
3
3
|
import { l as resolveDiscordChannelConfigWithFallback, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, r as isDiscordGroupAllowedByPolicy, w as isDiscordThreadChannelType, y as resolveGroupDmAllow } from "./allow-list-C3j0qLDp.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { g as resolveDiscordReplyReference, m as createReusableDiscordReplyReference } from "./send.receipt-DkCkAjRL.mjs";
|
|
5
5
|
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
6
|
-
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-
|
|
7
|
-
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
6
|
+
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-DXPqEgjA.mjs";
|
|
7
|
+
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-70KlFdzN.mjs";
|
|
8
8
|
import { n as getPresence } from "./presence-cache-Dq-3nH7R.mjs";
|
|
9
|
-
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-
|
|
10
|
-
import { r as sendDiscordComponentMessage } from "./send.components-
|
|
9
|
+
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-Cy4hDa6J.mjs";
|
|
10
|
+
import { r as sendDiscordComponentMessage } from "./send.components-MUCtA6qV.mjs";
|
|
11
11
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
12
12
|
import { asBoolean, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
13
|
import { assertMediaNotDataUrl, jsonResult, parseAvailableTags, readNonNegativeIntegerParam, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -116,6 +116,7 @@ function readDiscordChannelCreateParams(params) {
|
|
|
116
116
|
}
|
|
117
117
|
function readDiscordChannelEditParams(params) {
|
|
118
118
|
const parentId = readDiscordParentIdParam(params);
|
|
119
|
+
const appliedTags = readStringArrayParam(params, "appliedTags", { allowEmpty: true });
|
|
119
120
|
return {
|
|
120
121
|
channelId: readStringParam(params, "channelId", { required: true }),
|
|
121
122
|
name: readStringParam(params, "name"),
|
|
@@ -127,7 +128,8 @@ function readDiscordChannelEditParams(params) {
|
|
|
127
128
|
archived: asBoolean(params.archived),
|
|
128
129
|
locked: asBoolean(params.locked),
|
|
129
130
|
autoArchiveDuration: readDiscordAutoArchiveDurationParam(params, "autoArchiveDuration"),
|
|
130
|
-
availableTags: parseAvailableTags(params.availableTags)
|
|
131
|
+
availableTags: parseAvailableTags(params.availableTags),
|
|
132
|
+
appliedTags
|
|
131
133
|
};
|
|
132
134
|
}
|
|
133
135
|
function readDiscordChannelMoveParams(params) {
|
|
@@ -295,7 +297,10 @@ function createDiscordMessagingActionContext(params) {
|
|
|
295
297
|
const withOpts = (extra) => createDiscordActionOptions({
|
|
296
298
|
cfg: params.cfg,
|
|
297
299
|
accountId,
|
|
298
|
-
extra
|
|
300
|
+
extra: {
|
|
301
|
+
...params.options?.callerSignal ? { callerSignal: params.options.callerSignal } : {},
|
|
302
|
+
...extra
|
|
303
|
+
}
|
|
299
304
|
});
|
|
300
305
|
const resolvedReactionAccountId = accountId ?? resolveDefaultDiscordAccountId(params.cfg);
|
|
301
306
|
const isCurrentReadTarget = (channelId) => {
|
|
@@ -481,13 +486,15 @@ function createDiscordMessagingActionContext(params) {
|
|
|
481
486
|
} catch {
|
|
482
487
|
return (await resolveDiscordTargetChannelId(target, {
|
|
483
488
|
cfg: params.cfg,
|
|
484
|
-
accountId: resolvedReactionAccountId
|
|
489
|
+
accountId: resolvedReactionAccountId,
|
|
490
|
+
...params.options?.callerSignal ? { callerSignal: params.options.callerSignal } : {}
|
|
485
491
|
})).channelId;
|
|
486
492
|
}
|
|
487
493
|
},
|
|
488
494
|
withOpts,
|
|
489
495
|
withReactionRuntimeOptions: (extra) => ({
|
|
490
496
|
...reactionRuntimeOptions,
|
|
497
|
+
...params.options?.callerSignal ? { callerSignal: params.options.callerSignal } : {},
|
|
491
498
|
...extra
|
|
492
499
|
}),
|
|
493
500
|
normalizeMessage: (message) => {
|
|
@@ -498,6 +505,14 @@ function createDiscordMessagingActionContext(params) {
|
|
|
498
505
|
}
|
|
499
506
|
//#endregion
|
|
500
507
|
//#region extensions/discord/src/actions/runtime.guild.ts
|
|
508
|
+
/** Options for permission and metadata lookups that run before an action's own send options. */
|
|
509
|
+
function guildActionOptions(params) {
|
|
510
|
+
return createDiscordActionOptions({
|
|
511
|
+
cfg: params.cfg,
|
|
512
|
+
accountId: params.accountId,
|
|
513
|
+
...params.callerSignal ? { extra: { callerSignal: params.callerSignal } } : {}
|
|
514
|
+
});
|
|
515
|
+
}
|
|
501
516
|
const expressionPermissions = [PermissionFlagsBits.ManageGuildExpressions, PermissionFlagsBits.CreateGuildExpressions];
|
|
502
517
|
const channelGuard = {
|
|
503
518
|
gate: "channels",
|
|
@@ -565,20 +580,14 @@ async function resolveGuildIdForGuildAdminAction(params) {
|
|
|
565
580
|
if (guildId) return guildId;
|
|
566
581
|
const channelLikeId = readStringParam(params.values, "channelId") ?? readStringParam(params.values, "categoryId");
|
|
567
582
|
if (!channelLikeId) return;
|
|
568
|
-
const channel = await fetchChannelInfoDiscord(channelLikeId,
|
|
569
|
-
cfg: params.cfg,
|
|
570
|
-
accountId: params.accountId
|
|
571
|
-
}));
|
|
583
|
+
const channel = await fetchChannelInfoDiscord(channelLikeId, guildActionOptions(params));
|
|
572
584
|
return "guild_id" in channel ? channel.guild_id : void 0;
|
|
573
585
|
}
|
|
574
586
|
async function resolveGuildAdminActionPermissions(params) {
|
|
575
587
|
if (params.action !== "channelEdit") return params.guard.permissions;
|
|
576
588
|
const channelId = readStringParam(params.values, "channelId");
|
|
577
589
|
if (!channelId) return params.guard.permissions;
|
|
578
|
-
const channel = await fetchChannelInfoDiscord(channelId,
|
|
579
|
-
cfg: params.cfg,
|
|
580
|
-
accountId: params.accountId
|
|
581
|
-
}));
|
|
590
|
+
const channel = await fetchChannelInfoDiscord(channelId, guildActionOptions(params));
|
|
582
591
|
const channelType = "type" in channel ? channel.type : void 0;
|
|
583
592
|
if (!isDiscordThreadChannelType(channelType)) return params.guard.permissions;
|
|
584
593
|
const edit = readDiscordChannelEditParams(params.values);
|
|
@@ -594,10 +603,7 @@ async function verifySenderGuildAdminPermission(params) {
|
|
|
594
603
|
});
|
|
595
604
|
const guildId = await resolveGuildIdForGuildAdminAction(params);
|
|
596
605
|
if (!guildId) throw new Error(`Guild id required to authorize Discord guild action: ${params.action}`);
|
|
597
|
-
const actionOptions =
|
|
598
|
-
cfg: params.cfg,
|
|
599
|
-
accountId: params.accountId
|
|
600
|
-
});
|
|
606
|
+
const actionOptions = guildActionOptions(params);
|
|
601
607
|
const targetChannelId = guard?.permissionScope === "channel" || params.action === "eventCreate" ? readStringParam(params.values, params.action === "categoryEdit" || params.action === "categoryDelete" ? "categoryId" : "channelId") : void 0;
|
|
602
608
|
const hasPermission = targetChannelId ? await hasAnyChannelPermissionDiscord(guildId, targetChannelId, senderUserId, requiredPermissions, actionOptions) : await hasAnyGuildPermissionDiscord(guildId, senderUserId, requiredPermissions, actionOptions);
|
|
603
609
|
const requiresCurrentThreadAccess = params.action === "channelEdit" && requiredPermissions.includes(PermissionFlagsBits.SendMessages);
|
|
@@ -626,7 +632,8 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
626
632
|
action,
|
|
627
633
|
values: params,
|
|
628
634
|
accountId,
|
|
629
|
-
cfg
|
|
635
|
+
cfg,
|
|
636
|
+
...options?.callerSignal ? { callerSignal: options.callerSignal } : {}
|
|
630
637
|
});
|
|
631
638
|
const readTargetGate = createDiscordMessagingActionContext({
|
|
632
639
|
action,
|
|
@@ -637,12 +644,14 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
637
644
|
});
|
|
638
645
|
const withOpts = () => createDiscordActionOptions({
|
|
639
646
|
cfg,
|
|
640
|
-
accountId
|
|
647
|
+
accountId,
|
|
648
|
+
...options?.callerSignal ? { extra: { callerSignal: options.callerSignal } } : {}
|
|
641
649
|
});
|
|
642
650
|
const mediaPolicyOptions = {
|
|
643
651
|
mediaAccess: options?.mediaAccess,
|
|
644
652
|
mediaLocalRoots: options?.mediaLocalRoots,
|
|
645
|
-
mediaReadFile: options?.mediaReadFile
|
|
653
|
+
mediaReadFile: options?.mediaReadFile,
|
|
654
|
+
...options?.callerSignal ? { callerSignal: options.callerSignal } : {}
|
|
646
655
|
};
|
|
647
656
|
const readRequiredString = (key) => readStringParam(params, key, { required: true });
|
|
648
657
|
const readMetadataGuildId = async (guildId = readRequiredString("guildId")) => {
|
|
@@ -668,9 +677,10 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
668
677
|
});
|
|
669
678
|
}
|
|
670
679
|
const effectiveAccountId = accountId ?? resolveDefaultDiscordAccountId(cfg);
|
|
671
|
-
const member = await fetchMemberInfoDiscord(guildId, userId,
|
|
680
|
+
const member = await fetchMemberInfoDiscord(guildId, userId, guildActionOptions({
|
|
672
681
|
cfg,
|
|
673
|
-
accountId: effectiveAccountId
|
|
682
|
+
accountId: effectiveAccountId,
|
|
683
|
+
...options?.callerSignal ? { callerSignal: options.callerSignal } : {}
|
|
674
684
|
}));
|
|
675
685
|
const presence = getPresence(effectiveAccountId, userId);
|
|
676
686
|
const activities = presence?.activities;
|
|
@@ -700,7 +710,8 @@ async function handleDiscordGuildAction(action, params, isActionEnabled, cfg, op
|
|
|
700
710
|
const guildId = await resolveGuildIdForGuildAdminAction({
|
|
701
711
|
values: params,
|
|
702
712
|
accountId,
|
|
703
|
-
cfg
|
|
713
|
+
cfg,
|
|
714
|
+
...options?.callerSignal ? { callerSignal: options.callerSignal } : {}
|
|
704
715
|
});
|
|
705
716
|
if (!guildId) throw new Error("Discord emoji listing requires guildId or a server channel.");
|
|
706
717
|
await readMetadataGuildId(guildId);
|
|
@@ -1385,7 +1396,8 @@ async function handleDiscordAction(params, cfg, options) {
|
|
|
1385
1396
|
const senderUserId = readStringParam(params, "senderUserId");
|
|
1386
1397
|
const withOpts = () => createDiscordActionOptions({
|
|
1387
1398
|
cfg,
|
|
1388
|
-
accountId
|
|
1399
|
+
accountId,
|
|
1400
|
+
...options?.callerSignal ? { extra: { callerSignal: options.callerSignal } } : {}
|
|
1389
1401
|
});
|
|
1390
1402
|
if (!await (senderUserId ? hasAnyGuildPermissionDiscord(command.guildId, senderUserId, [requiredGuildPermissionForModerationAction(command.action)], withOpts()) : true)) throw new Error("Sender does not have required permissions for this moderation action.");
|
|
1391
1403
|
const target = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { C as hasAnyChannelPermissionDiscord, D as createDiscordMessageNonce, F as resolveDiscordClientAccountContext, I as resolveDiscordRest, M as createDiscordClient, O as resolveDiscordMessageFlags, S as hasAllGuildPermissionsDiscord, _ as canManageGuildMemberRoleDiscord, a as normalizeEmojiName, b as fetchChannelPermissionsDiscord, c as resolveChannelId, d as sendDiscordChunks, g as DiscordSendError, h as DISCORD_MAX_STICKER_BYTES, j as resolveDiscordSuppressEmbeds, m as DISCORD_MAX_EVENT_COVER_BYTES, n as buildDiscordTextChunks, o as normalizeReactionEmoji, p as DISCORD_MAX_EMOJI_BYTES, r as buildReactionIdentifier, t as buildDiscordSendError, v as canManageGuildRoleDiscord, w as hasAnyGuildPermissionDiscord, x as fetchMemberGuildPermissionsDiscord, y as canViewDiscordGuildChannel } from "./send.shared-
|
|
3
|
-
import { B as RateLimitError, C as listMessageReactionUsers, D as editChannelMessage, E as deleteChannelMessage, F as getGuildVoiceState, G as readRetryAfter, H as isUnknownDiscordVoiceStateError, I as listGuildEmojis, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, M as unpinChannelMessage, N as getGuild, O as getChannel, P as getGuildMember, S as deleteOwnMessageReaction, T as createThread, U as readDiscordCode, V as isUnknownDiscordMessageError, W as readDiscordMessage, j as pinChannelMessage, k as getChannelMessage, q as withDiscordRequestAuthority, w as createChannelMessage, x as createOwnMessageReaction, z as DiscordError } from "./discord-
|
|
2
|
+
import { C as hasAnyChannelPermissionDiscord, D as createDiscordMessageNonce, F as resolveDiscordClientAccountContext, I as resolveDiscordRest, M as createDiscordClient, O as resolveDiscordMessageFlags, S as hasAllGuildPermissionsDiscord, _ as canManageGuildMemberRoleDiscord, a as normalizeEmojiName, b as fetchChannelPermissionsDiscord, c as resolveChannelId, d as sendDiscordChunks, g as DiscordSendError, h as DISCORD_MAX_STICKER_BYTES, j as resolveDiscordSuppressEmbeds, m as DISCORD_MAX_EVENT_COVER_BYTES, n as buildDiscordTextChunks, o as normalizeReactionEmoji, p as DISCORD_MAX_EMOJI_BYTES, r as buildReactionIdentifier, t as buildDiscordSendError, v as canManageGuildRoleDiscord, w as hasAnyGuildPermissionDiscord, x as fetchMemberGuildPermissionsDiscord, y as canViewDiscordGuildChannel } from "./send.shared-BXWCIkfx.mjs";
|
|
3
|
+
import { B as RateLimitError, C as listMessageReactionUsers, D as editChannelMessage, E as deleteChannelMessage, F as getGuildVoiceState, G as readRetryAfter, H as isUnknownDiscordVoiceStateError, I as listGuildEmojis, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, M as unpinChannelMessage, N as getGuild, O as getChannel, P as getGuildMember, S as deleteOwnMessageReaction, T as createThread, U as readDiscordCode, V as isUnknownDiscordMessageError, W as readDiscordMessage, j as pinChannelMessage, k as getChannelMessage, q as withDiscordRequestAuthority, w as createChannelMessage, x as createOwnMessageReaction, z as DiscordError } from "./discord-KsHAulAQ.mjs";
|
|
4
4
|
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-C3j0qLDp.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { S as chunkDiscordTextWithMode, n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, v as classifyDiscordDeliveryFailure, x as recordDiscordMessageCreateAmbiguity, y as createDiscordRetryRunner } from "./send.receipt-DkCkAjRL.mjs";
|
|
6
6
|
import { n as getDiscordEndpointRuntime, r as resolveDiscordEndpointAttachmentGuard } from "./endpoint-runtime-lf4DeLas.mjs";
|
|
7
7
|
import { o as parseDiscordHttpErrorBody } from "./api-DYRggUgK.mjs";
|
|
8
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
9
|
-
import { a as prepareDiscordOutboundText, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-
|
|
8
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-54k9fO6u.mjs";
|
|
9
|
+
import { a as prepareDiscordOutboundText, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-70KlFdzN.mjs";
|
|
10
10
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-cIxzatmv.mjs";
|
|
11
11
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
12
12
|
import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
@@ -51,7 +51,8 @@ async function editChannelDiscord(payload, opts) {
|
|
|
51
51
|
archived: payload.archived,
|
|
52
52
|
locked: payload.locked,
|
|
53
53
|
auto_archive_duration: payload.autoArchiveDuration,
|
|
54
|
-
available_tags: payload.availableTags
|
|
54
|
+
available_tags: payload.availableTags,
|
|
55
|
+
applied_tags: payload.appliedTags
|
|
55
56
|
});
|
|
56
57
|
return await rest.patch(Routes.channel(payload.channelId), { body });
|
|
57
58
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { D as createDiscordMessageNonce, M as createDiscordClient, T as SUPPRESS_NOTIFICATIONS_FLAG, c as resolveChannelId, l as resolveDiscordChannel, t as buildDiscordSendError } from "./send.shared-
|
|
3
|
-
import { D as editChannelMessage, f as serializePayload, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-
|
|
4
|
-
import { r as createDiscordSendResult } from "./send.receipt-
|
|
5
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
6
|
-
import { t as sendMessageDiscord } from "./send.outbound-
|
|
7
|
-
import { a as buildDiscordComponentMessage, u as resolveDiscordComponentAttachmentName } from "./components-
|
|
2
|
+
import { D as createDiscordMessageNonce, M as createDiscordClient, T as SUPPRESS_NOTIFICATIONS_FLAG, c as resolveChannelId, l as resolveDiscordChannel, t as buildDiscordSendError } from "./send.shared-BXWCIkfx.mjs";
|
|
3
|
+
import { D as editChannelMessage, f as serializePayload, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-KsHAulAQ.mjs";
|
|
4
|
+
import { r as createDiscordSendResult } from "./send.receipt-DkCkAjRL.mjs";
|
|
5
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-54k9fO6u.mjs";
|
|
6
|
+
import { t as sendMessageDiscord } from "./send.outbound-70KlFdzN.mjs";
|
|
7
|
+
import { a as buildDiscordComponentMessage, u as resolveDiscordComponentAttachmentName } from "./components-Cy4hDa6J.mjs";
|
|
8
8
|
import { n as getOptionalDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
9
9
|
import { hasNonEmptyString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import { ChannelType } from "discord-api-types/v10";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { A as resolveDiscordSendEmbeds, D as createDiscordMessageNonce, E as buildDiscordMessageRequest, M as createDiscordClient, O as resolveDiscordMessageFlags, c as resolveChannelId, d as sendDiscordChunks, f as sendDiscordMedia, i as normalizeDiscordPollInput, j as resolveDiscordSuppressEmbeds, k as resolveDiscordSendComponents, l as resolveDiscordChannel, n as buildDiscordTextChunks, s as normalizeStickerIds, t as buildDiscordSendError } from "./send.shared-
|
|
3
|
-
import { T as createThread, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-
|
|
4
|
-
import { n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, u as
|
|
5
|
-
import {
|
|
6
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BzaZPBm9.mjs";
|
|
2
|
+
import { A as resolveDiscordSendEmbeds, D as createDiscordMessageNonce, E as buildDiscordMessageRequest, M as createDiscordClient, O as resolveDiscordMessageFlags, c as resolveChannelId, d as sendDiscordChunks, f as sendDiscordMedia, i as normalizeDiscordPollInput, j as resolveDiscordSuppressEmbeds, k as resolveDiscordSendComponents, l as resolveDiscordChannel, n as buildDiscordTextChunks, s as normalizeStickerIds, t as buildDiscordSendError } from "./send.shared-BXWCIkfx.mjs";
|
|
3
|
+
import { T as createThread, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-KsHAulAQ.mjs";
|
|
4
|
+
import { d as normalizeDiscordSnowflake, m as createReusableDiscordReplyReference, n as createDiscordSendReceiptFromResults, p as resolveDiscordDirectoryUserId, r as createDiscordSendResult, u as normalizeDiscordHandleKey } from "./send.receipt-DkCkAjRL.mjs";
|
|
5
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-54k9fO6u.mjs";
|
|
7
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
7
|
import { ChannelType } from "discord-api-types/v10";
|
|
9
8
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|