@openclaw/discord 2026.11.5 → 2026.11.6
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/{allow-list-BXrS8-R9.mjs → allow-list-C3j0qLDp.mjs} +1 -1
- package/dist/.setup/{api-BlBD4ism.mjs → api-DYRggUgK.mjs} +1 -1
- package/dist/.setup/{approval-handler.runtime-o2N6GRFH.mjs → approval-handler.runtime-CJHU6Mqf.mjs} +5 -5
- package/dist/.setup/{audit-5b-FXj9R.mjs → audit-Bjfvbnnr.mjs} +3 -3
- package/dist/.setup/{channel-CplVDtyZ.mjs → channel-tgjw3dY4.mjs} +17 -17
- package/dist/.setup/{channel.setup-B3MtmBQG.mjs → channel.setup-kNWMxlgu.mjs} +3 -3
- package/dist/.setup/{components-YCvQ6YLS.mjs → components-C1Phe3uw.mjs} +1 -1
- package/dist/.setup/{conversation-binding-route-kCTw8cij.mjs → conversation-binding-route-DRgyU9D1.mjs} +1 -1
- package/dist/.setup/{directory-live-DH3tpS3x.mjs → directory-live-CY2-qrHI.mjs} +5 -4
- package/dist/.setup/{discord-DGVSguhx.mjs → discord-BRVFhk09.mjs} +1 -1
- package/dist/.setup/{doctor-eujgbnpZ.mjs → doctor-RqH-6JB0.mjs} +1 -1
- package/dist/.setup/{guilds-eDq22iSM.mjs → guilds-BSnrns-F.mjs} +2 -2
- package/dist/.setup/{handle-action-CktwmzMz.mjs → handle-action-CUBLAWoe.mjs} +6 -6
- package/dist/.setup/{handle-action.guild-admin-WLQ7fRqI.mjs → handle-action.guild-admin-DRfsXqhO.mjs} +2 -2
- package/dist/.setup/{listeners-Df8lx3vK.mjs → listeners-DnHLrLIN.mjs} +1 -1
- package/dist/.setup/{live-policy-config-DiBVuaU6.mjs → live-policy-config-y0Qy36X3.mjs} +1 -1
- package/dist/.setup/{message-handler-DeoWTD-4.mjs → message-handler-DU6MT6OP.mjs} +5 -5
- package/dist/.setup/{message-handler.preflight-DKOjgF0z.mjs → message-handler.preflight-DeWZDaqq.mjs} +10 -10
- package/dist/.setup/{message-handler.preflight-pluralkit-CYZfXXb6.mjs → message-handler.preflight-pluralkit-Dhcx7Ifz.mjs} +4 -4
- package/dist/.setup/{message-handler.process-RKRgMCJy.mjs → message-handler.process-ChPzcZzt.mjs} +14 -14
- package/dist/.setup/{outbound-payload-BaZmjewa.mjs → outbound-payload-Bbblvliu.mjs} +5 -5
- package/dist/.setup/{outbound-session-route-Cgx4i9cS.mjs → outbound-session-route-DtdCvVQu.mjs} +5 -5
- package/dist/.setup/{probe-DezB-6xz.mjs → probe-CbDJojNV.mjs} +1 -1
- package/dist/.setup/{provider-D63dgDSw.mjs → provider-BUMMYLwa.mjs} +80 -26
- package/dist/.setup/{provider-session.runtime-ePktW62k.mjs → provider-session.runtime-gMiDw44d.mjs} +3 -3
- package/dist/.setup/provider.runtime-B-FGgY_6.mjs +1 -0
- package/dist/.setup/{realtime-session.runtime-rlZ3WzwC.mjs → realtime-session.runtime-BcxebrwD.mjs} +2 -2
- package/dist/.setup/{resolve-allowlist-common-Bk8Fj6Ik.mjs → resolve-allowlist-common-B-S0wRIw.mjs} +1 -1
- package/dist/.setup/{resolve-channels-Bp8frXvc.mjs → resolve-channels-g16NM6Ho.mjs} +8 -6
- package/dist/.setup/{resolve-users-Cvcj22sG.mjs → resolve-users-DAfOOXdy.mjs} +3 -3
- package/dist/.setup/{runtime-BJaCvlmq.mjs → runtime-DX2bmAau.mjs} +7 -7
- package/dist/.setup/{send-CVW7V-VZ.mjs → send-C93UORFt.mjs} +7 -7
- package/dist/.setup/{send.components-C8YXdnO_.mjs → send.components-CtLtE0yD.mjs} +6 -6
- package/dist/.setup/{send.outbound-Uzcmh3Yd.mjs → send.outbound-D58xXPgs.mjs} +5 -5
- package/dist/.setup/{send.receipt-NZDOTZBU.mjs → send.receipt-DLOV4qx6.mjs} +1 -1
- package/dist/.setup/{send.shared-a_6Oeyg1.mjs → send.shared-B_KKRrD7.mjs} +4 -4
- package/dist/.setup/{sender-identity-76HFb8eK.mjs → sender-identity-BbA7FNbr.mjs} +1 -1
- package/dist/.setup/setup-plugin-api-ty5RJrMy.mjs +2 -0
- package/dist/.setup/{shared-yDUSExm2.mjs → shared-Dv2DamaK.mjs} +2 -2
- package/dist/.setup/{subagent-hooks-CDkdHQyy.mjs → subagent-hooks-DZUGfwws.mjs} +1 -1
- package/dist/.setup/{system-events-yfWz150v.mjs → system-events-Dlzp9Jcj.mjs} +2 -2
- package/dist/.setup/{target-resolver-BOOzqxxM.mjs → target-resolver-BzaZPBm9.mjs} +2 -2
- package/dist/.setup/{thread-bindings-zce4cpu_.mjs → thread-bindings-jkFp9m4N.mjs} +2 -2
- package/dist/.setup/{thread-bindings.manager-NywKzUtc.mjs → thread-bindings.manager-CyX0Z04h.mjs} +7 -7
- package/dist/.setup/{thread-bindings.session-updates-D0j7oh8S.mjs → thread-bindings.session-updates-DzJrXc4w.mjs} +1 -1
- package/dist/.setup/{threading-DodLYDt-.mjs → threading-BbsPuT5G.mjs} +2 -2
- package/dist/.setup/{transcripts-source-ie9GBWaU.mjs → transcripts-source-DIW1fU_P.mjs} +15 -15
- package/dist/.setup/{voice-runtime-Dc8Su9Cm.mjs → voice-runtime-BmxCHhVv.mjs} +7 -7
- 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 +11 -11
- package/dist/channel-plugin-api.js +1 -1
- package/dist/runtime-api.js +19 -19
- 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-DcNkwhPW.mjs +0 -1
- package/dist/.setup/setup-plugin-api-BExhGEhL.mjs +0 -2
|
@@ -1,30 +1,30 @@
|
|
|
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-
|
|
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-
|
|
5
|
-
import { v as chunkDiscordTextWithMode } from "./send.receipt-
|
|
2
|
+
import { B as unregisterGateway, C as hasAnyChannelPermissionDiscord, N as createDiscordRestClient, y as canViewDiscordGuildChannel, z as registerGateway } from "./send.shared-B_KKRrD7.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-BRVFhk09.mjs";
|
|
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 { v as chunkDiscordTextWithMode } from "./send.receipt-DLOV4qx6.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
|
-
import { a as isDiscordRateLimitResponseBody, s as summarizeDiscordResponseBody } from "./api-
|
|
9
|
-
import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-
|
|
10
|
-
import { s as formatMention, t as sendMessageDiscord } from "./send.outbound-
|
|
8
|
+
import { a as isDiscordRateLimitResponseBody, s as summarizeDiscordResponseBody } from "./api-DYRggUgK.mjs";
|
|
9
|
+
import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-C93UORFt.mjs";
|
|
10
|
+
import { s as formatMention, t as sendMessageDiscord } from "./send.outbound-D58xXPgs.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-C1Phe3uw.mjs";
|
|
15
|
+
import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-CtLtE0yD.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-
|
|
20
|
-
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-
|
|
21
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
22
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
23
|
-
import { a as isThreadArchived, n as getThreadBindingManager } from "./thread-bindings.manager-
|
|
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-DtdCvVQu.mjs";
|
|
20
|
+
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-y0Qy36X3.mjs";
|
|
21
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-g16NM6Ho.mjs";
|
|
22
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-DAfOOXdy.mjs";
|
|
23
|
+
import { a as isThreadArchived, n as getThreadBindingManager } from "./thread-bindings.manager-CyX0Z04h.mjs";
|
|
24
24
|
import { n as resolveDiscordChannelNameSafe, r as resolveDiscordChannelTopicSafe, t as resolveDiscordChannelInfoSafe } from "./channel-access-9cyzozUP.mjs";
|
|
25
|
-
import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-
|
|
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-
|
|
27
|
-
import { t as resolveDiscordSenderIdentity } from "./sender-identity-
|
|
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-DIW1fU_P.mjs";
|
|
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";
|
|
30
30
|
import { PlatformMessageNotDispatchedError, formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -67,10 +67,10 @@ import { readChannelIngressStoreAllowFromForDmPolicy } from "openclaw/plugin-sdk
|
|
|
67
67
|
import { enqueueKeyedTask } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
68
68
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
69
69
|
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
|
|
70
|
+
import { buildChannelInboundEventContext, createChannelPartialDeliveryError, createCommandTurnContext, dispatchChannelInboundTurn, formatInboundEnvelope, hasVisibleInboundReplyDispatch, isChannelPartialDeliveryError, resolveEnvelopeFormatOptions, resolveInboundSupplementalSenderAllowed, runChannelInboundEvent } from "openclaw/plugin-sdk/channel-inbound";
|
|
70
71
|
import { clearExpiredCooldowns, ensureAuthProfileStoreAsync, formatReasoningMessage, getPreparedModelCatalogSnapshot, isProfileInCooldown, listAgentIds, loadPreparedModelCatalog, resolveAgentAvatar, resolveAgentDir, resolveDefaultModelForAgent, resolveHumanDelayConfig, resolveProfilesUnavailableReason } from "openclaw/plugin-sdk/agent-runtime";
|
|
71
72
|
import { deleteSessionEntry, getSessionEntryAsync, listSessionEntriesAsync, readSessionUpdatedAtAsync, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
72
73
|
import { enqueueRoutedSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
73
|
-
import { buildChannelInboundEventContext, createChannelPartialDeliveryError, createCommandTurnContext, dispatchChannelInboundTurn, formatInboundEnvelope, hasVisibleInboundReplyDispatch, isChannelPartialDeliveryError, resolveEnvelopeFormatOptions, resolveInboundSupplementalSenderAllowed, runChannelInboundEvent } from "openclaw/plugin-sdk/channel-inbound";
|
|
74
74
|
import { captureHttpExchangeAsync, captureWsEventAsync, resolveDebugProxySettings, resolveEffectiveDebugProxyUrl } from "openclaw/plugin-sdk/proxy-capture";
|
|
75
75
|
import { resolveRequestUrl } from "openclaw/plugin-sdk/request-url";
|
|
76
76
|
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
|
|
@@ -685,6 +685,45 @@ var DiscordInteractionListener = class {
|
|
|
685
685
|
});
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
|
+
async function isDiscordPresenceMemberAllowed(params) {
|
|
689
|
+
const { client, guildInfo } = params;
|
|
690
|
+
let channelConfig = null;
|
|
691
|
+
if (hasConfiguredDiscordChannels(guildInfo.channels)) {
|
|
692
|
+
const fetched = await client.fetchChannel(params.channelId);
|
|
693
|
+
if (!fetched) return false;
|
|
694
|
+
const channel = await resolveFetchedDiscordThreadLikeChannelContext({
|
|
695
|
+
client,
|
|
696
|
+
channel: fetched,
|
|
697
|
+
channelIdFallback: params.channelId
|
|
698
|
+
});
|
|
699
|
+
channelConfig = resolveDiscordChannelConfigWithFallback({
|
|
700
|
+
guildInfo,
|
|
701
|
+
channelId: params.channelId,
|
|
702
|
+
channelName: channel.channelName,
|
|
703
|
+
channelSlug: channel.channelSlug,
|
|
704
|
+
parentId: channel.isThreadChannel ? channel.threadParentId : channel.parentId,
|
|
705
|
+
parentName: channel.isThreadChannel ? channel.threadParentName : void 0,
|
|
706
|
+
parentSlug: channel.isThreadChannel ? channel.threadParentSlug : "",
|
|
707
|
+
scope: channel.isThreadChannel ? "thread" : "channel"
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
const sender = params.allowNameMatching ? await client.fetchUser(params.userId).then((user) => ({
|
|
711
|
+
id: user.id,
|
|
712
|
+
name: user.username,
|
|
713
|
+
tag: formatDiscordUserTag(user)
|
|
714
|
+
})) : { id: params.userId };
|
|
715
|
+
const access = (memberRoleIds) => resolveDiscordMemberAccessState({
|
|
716
|
+
channelConfig,
|
|
717
|
+
guildInfo,
|
|
718
|
+
memberRoleIds,
|
|
719
|
+
sender,
|
|
720
|
+
allowNameMatching: params.allowNameMatching
|
|
721
|
+
});
|
|
722
|
+
const { hasAccessRestrictions, memberAllowed } = access([]);
|
|
723
|
+
if (!hasAccessRestrictions || memberAllowed) return true;
|
|
724
|
+
if (!(channelConfig?.roles ?? guildInfo.roles)?.length) return false;
|
|
725
|
+
return access((await client.fetchMember(params.guildId, params.userId)).roles).memberAllowed;
|
|
726
|
+
}
|
|
688
727
|
var DiscordPresenceListener = class {
|
|
689
728
|
constructor(params) {
|
|
690
729
|
this.params = params;
|
|
@@ -787,11 +826,12 @@ var DiscordPresenceListener = class {
|
|
|
787
826
|
if (this.stopped) return;
|
|
788
827
|
const policy = await this.params.readPolicy?.();
|
|
789
828
|
const cfg = policy?.cfg ?? this.params.cfg;
|
|
790
|
-
const
|
|
829
|
+
const guildInfo = resolveDiscordGuildEntry({
|
|
791
830
|
guildId: data.guild_id,
|
|
792
831
|
guildEntries: policy ? policy.guildEntries : this.params.guildEntries
|
|
793
|
-
})
|
|
794
|
-
|
|
832
|
+
});
|
|
833
|
+
const config = guildInfo?.presenceEvents;
|
|
834
|
+
if (!guildInfo || !config || config.enabled === false) return;
|
|
795
835
|
if (config.users !== void 0 && !config.users.includes(userId)) return;
|
|
796
836
|
const route = resolveAgentRoute({
|
|
797
837
|
cfg,
|
|
@@ -851,6 +891,17 @@ var DiscordPresenceListener = class {
|
|
|
851
891
|
this.recordPresenceBaseline(data.guild_id, presenceKey, "online");
|
|
852
892
|
return;
|
|
853
893
|
}
|
|
894
|
+
if (!await isDiscordPresenceMemberAllowed({
|
|
895
|
+
client,
|
|
896
|
+
guildInfo,
|
|
897
|
+
guildId: data.guild_id,
|
|
898
|
+
channelId: presenceEvent.channelId,
|
|
899
|
+
userId,
|
|
900
|
+
allowNameMatching: policy?.allowNameMatching ?? this.params.allowNameMatching ?? false
|
|
901
|
+
})) {
|
|
902
|
+
this.recordPresenceBaseline(data.guild_id, presenceKey, "online");
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
854
905
|
if (!await canViewDiscordGuildChannel(data.guild_id, presenceEvent.channelId, userId, {
|
|
855
906
|
cfg,
|
|
856
907
|
accountId: this.params.accountId,
|
|
@@ -6045,7 +6096,7 @@ function createAgentSelectMenu(ctx) {
|
|
|
6045
6096
|
}
|
|
6046
6097
|
//#endregion
|
|
6047
6098
|
//#region extensions/discord/src/monitor/agent-components.ts
|
|
6048
|
-
const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-
|
|
6099
|
+
const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-C1Phe3uw.mjs").then((n) => n.t));
|
|
6049
6100
|
async function resolveAuthorizedComponentEntry(params) {
|
|
6050
6101
|
const entry = params.entry ?? await params.resolve(false);
|
|
6051
6102
|
if (!entry) {
|
|
@@ -7825,7 +7876,10 @@ function registerDiscordMonitorListeners(params) {
|
|
|
7825
7876
|
register(threadUpdateListener, new DiscordThreadReadyListener(threadUpdateListener), new DiscordThreadDeleteListener(params.cfg, params.accountId, params.logger));
|
|
7826
7877
|
let presenceListener;
|
|
7827
7878
|
if (params.discordConfig.intents?.presence) {
|
|
7828
|
-
presenceListener = new DiscordPresenceListener(
|
|
7879
|
+
presenceListener = new DiscordPresenceListener({
|
|
7880
|
+
...listenerOptions,
|
|
7881
|
+
allowNameMatching: isDangerousNameMatchingEnabled(params.discordConfig)
|
|
7882
|
+
});
|
|
7829
7883
|
register(presenceListener, new DiscordPresenceGuildCreateListener(presenceListener), new DiscordPresenceGuildDeleteListener(presenceListener), new DiscordPresenceReadyListener(presenceListener));
|
|
7830
7884
|
params.runtime.log?.("discord: GuildPresences intent enabled — presence listener registered");
|
|
7831
7885
|
}
|
|
@@ -7958,7 +8012,7 @@ async function monitorDiscordProvider(opts) {
|
|
|
7958
8012
|
cfg,
|
|
7959
8013
|
accountId: account.accountId
|
|
7960
8014
|
}) ?? "pairing";
|
|
7961
|
-
const discordProviderSessionRuntime = await import("./provider-session.runtime-
|
|
8015
|
+
const discordProviderSessionRuntime = await import("./provider-session.runtime-gMiDw44d.mjs");
|
|
7962
8016
|
const threadBindingIdleTimeoutMs = discordProviderSessionRuntime.resolveThreadBindingIdleTimeoutMs({
|
|
7963
8017
|
channelIdleHoursRaw: discordCfg.threadBindings?.idleHours,
|
|
7964
8018
|
sessionIdleHoursRaw: cfg.session?.threadBindings?.idleHours
|
|
@@ -8269,8 +8323,8 @@ async function monitorDiscordProvider(opts) {
|
|
|
8269
8323
|
};
|
|
8270
8324
|
let voiceManager = null;
|
|
8271
8325
|
if (voiceEnabled) {
|
|
8272
|
-
const { DiscordVoiceManager } = await import("./voice-runtime-
|
|
8273
|
-
const { DiscordVoiceGuildCreateListener, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener } = await import("./listeners-
|
|
8326
|
+
const { DiscordVoiceManager } = await import("./voice-runtime-BmxCHhVv.mjs");
|
|
8327
|
+
const { DiscordVoiceGuildCreateListener, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener } = await import("./listeners-DnHLrLIN.mjs");
|
|
8274
8328
|
voiceManager = new DiscordVoiceManager({
|
|
8275
8329
|
...monitorOptions,
|
|
8276
8330
|
scheduler
|
package/dist/.setup/{provider-session.runtime-ePktW62k.mjs → provider-session.runtime-gMiDw44d.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-CyX0Z04h.mjs";
|
|
2
|
+
import { l as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-jkFp9m4N.mjs";
|
|
3
|
+
import { t as createDiscordMessageHandler } from "./message-handler-DU6MT6OP.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-BUMMYLwa.mjs";
|
package/dist/.setup/{realtime-session.runtime-rlZ3WzwC.mjs → realtime-session.runtime-BcxebrwD.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-BUMMYLwa.mjs";
|
|
5
|
+
import { a as maybeControlDiscordVoiceAgentRun, i as logDiscordVoiceAgentControlResult, n as formatVoiceIngressPrompt, r as handleDiscordVoiceAgentControlToolCall, t as DiscordRealtimeRecording } from "./voice-runtime-BmxCHhVv.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";
|
package/dist/.setup/{resolve-allowlist-common-Bk8Fj6Ik.mjs → resolve-allowlist-common-B-S0wRIw.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as normalizeDiscordToken } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import { o as normalizeDiscordSlug } from "./allow-list-
|
|
2
|
+
import { o as normalizeDiscordSlug } from "./allow-list-C3j0qLDp.mjs";
|
|
3
3
|
//#region extensions/discord/src/resolve-allowlist-common.ts
|
|
4
4
|
function resolveDiscordAllowlistToken(token) {
|
|
5
5
|
return normalizeDiscordToken(token, "channels.discord.token");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { o as normalizeDiscordSlug, w as isDiscordThreadChannelType } from "./allow-list-
|
|
3
|
-
import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
4
|
-
import { n as listGuilds, t as listDiscordGuildChannels } from "./guilds-
|
|
5
|
-
import { n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-
|
|
2
|
+
import { a as normalizeDiscordDisplaySlug, o as normalizeDiscordSlug, w as isDiscordThreadChannelType } from "./allow-list-C3j0qLDp.mjs";
|
|
3
|
+
import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DYRggUgK.mjs";
|
|
4
|
+
import { n as listGuilds, t as listDiscordGuildChannels } from "./guilds-BSnrns-F.mjs";
|
|
5
|
+
import { n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-B-S0wRIw.mjs";
|
|
6
6
|
//#region extensions/discord/src/resolve-channels.ts
|
|
7
7
|
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveDiscordChannelAllowlist: () => resolveDiscordChannelAllowlist });
|
|
8
8
|
async function listGuildChannels(token, fetcher, guildId) {
|
|
@@ -81,8 +81,10 @@ async function resolveDiscordChannelAllowlist(params) {
|
|
|
81
81
|
const ids = channels.filter((channel) => channel.id === query);
|
|
82
82
|
if (ids.length) return ids;
|
|
83
83
|
}
|
|
84
|
-
const slug =
|
|
85
|
-
|
|
84
|
+
const slug = normalizeDiscordDisplaySlug(query);
|
|
85
|
+
if (!slug) return [];
|
|
86
|
+
const matchSlug = normalizeDiscordSlug(query) === slug ? normalizeDiscordSlug : normalizeDiscordDisplaySlug;
|
|
87
|
+
return channels.filter((channel) => matchSlug(channel.name) === slug);
|
|
86
88
|
}
|
|
87
89
|
const resolveEntry = async (input) => {
|
|
88
90
|
const parsed = parseDiscordAllowlistInput(input, "channel");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
3
|
-
import { n as listGuilds, r as searchDiscordGuildMembers } from "./guilds-
|
|
4
|
-
import { n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-
|
|
2
|
+
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DYRggUgK.mjs";
|
|
3
|
+
import { n as listGuilds, r as searchDiscordGuildMembers } from "./guilds-BSnrns-F.mjs";
|
|
4
|
+
import { n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-B-S0wRIw.mjs";
|
|
5
5
|
import { normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
//#region extensions/discord/src/resolve-users.ts
|
|
7
7
|
var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveDiscordUserAllowlist: () => resolveDiscordUserAllowlist });
|
|
@@ -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-
|
|
3
|
-
import { l as resolveDiscordChannelConfigWithFallback, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, r as isDiscordGroupAllowedByPolicy, w as isDiscordThreadChannelType, y as resolveGroupDmAllow } from "./allow-list-
|
|
4
|
-
import { f as resolveDiscordReplyReference, u as createReusableDiscordReplyReference } from "./send.receipt-
|
|
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-B_KKRrD7.mjs";
|
|
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 { f as resolveDiscordReplyReference, u as createReusableDiscordReplyReference } from "./send.receipt-DLOV4qx6.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-C93UORFt.mjs";
|
|
7
|
+
import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-D58xXPgs.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-C1Phe3uw.mjs";
|
|
10
|
+
import { r as sendDiscordComponentMessage } from "./send.components-CtLtE0yD.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";
|
|
@@ -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-
|
|
4
|
-
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-
|
|
5
|
-
import { _ as recordDiscordMessageCreateAmbiguity, h as createDiscordRetryRunner, m as classifyDiscordDeliveryFailure, n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, v as chunkDiscordTextWithMode } from "./send.receipt-
|
|
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-B_KKRrD7.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-BRVFhk09.mjs";
|
|
4
|
+
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-C3j0qLDp.mjs";
|
|
5
|
+
import { _ as recordDiscordMessageCreateAmbiguity, h as createDiscordRetryRunner, m as classifyDiscordDeliveryFailure, n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, v as chunkDiscordTextWithMode } from "./send.receipt-DLOV4qx6.mjs";
|
|
6
6
|
import { n as getDiscordEndpointRuntime, r as resolveDiscordEndpointAttachmentGuard } from "./endpoint-runtime-lf4DeLas.mjs";
|
|
7
|
-
import { o as parseDiscordHttpErrorBody } from "./api-
|
|
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-
|
|
7
|
+
import { o as parseDiscordHttpErrorBody } from "./api-DYRggUgK.mjs";
|
|
8
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BzaZPBm9.mjs";
|
|
9
|
+
import { a as prepareDiscordOutboundText, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-D58xXPgs.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";
|
|
@@ -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-B_KKRrD7.mjs";
|
|
3
|
+
import { D as editChannelMessage, f as serializePayload, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-BRVFhk09.mjs";
|
|
4
|
+
import { r as createDiscordSendResult } from "./send.receipt-DLOV4qx6.mjs";
|
|
5
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BzaZPBm9.mjs";
|
|
6
|
+
import { t as sendMessageDiscord } from "./send.outbound-D58xXPgs.mjs";
|
|
7
|
+
import { a as buildDiscordComponentMessage, u as resolveDiscordComponentAttachmentName } from "./components-C1Phe3uw.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,9 @@
|
|
|
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 createReusableDiscordReplyReference } from "./send.receipt-
|
|
5
|
-
import { a as normalizeDiscordSnowflake, i as normalizeDiscordHandleKey, s as resolveDiscordDirectoryUserId } from "./directory-live-
|
|
6
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
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-B_KKRrD7.mjs";
|
|
3
|
+
import { T as createThread, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-BRVFhk09.mjs";
|
|
4
|
+
import { n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, u as createReusableDiscordReplyReference } from "./send.receipt-DLOV4qx6.mjs";
|
|
5
|
+
import { a as normalizeDiscordSnowflake, i as normalizeDiscordHandleKey, s as resolveDiscordDirectoryUserId } from "./directory-live-CY2-qrHI.mjs";
|
|
6
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BzaZPBm9.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { ChannelType } from "discord-api-types/v10";
|
|
9
9
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as RateLimitError } from "./discord-
|
|
1
|
+
import { B as RateLimitError } from "./discord-BRVFhk09.mjs";
|
|
2
2
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
3
3
|
import { collectErrorGraphCandidates, extractErrorCode, formatErrorMessage, readErrorName } from "openclaw/plugin-sdk/error-runtime";
|
|
4
4
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { h as normalizeDiscordToken, l as resolveDiscordAccount, s as mergeDiscordAccountConfig } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import { A as getThreadMember, N as getGuild, O as getChannel, P as getGuildMember, R as RequestClient, b as getCurrentUser, d as hasDiscordV2Components, f as serializePayload, p as Embed, w as createChannelMessage, y as createUserDmChannel, z as DiscordError } from "./discord-
|
|
3
|
-
import { w as isDiscordThreadChannelType } from "./allow-list-
|
|
4
|
-
import { d as resolveDiscordReplyMessageId, h as createDiscordRetryRunner, v as chunkDiscordTextWithMode } from "./send.receipt-
|
|
2
|
+
import { A as getThreadMember, N as getGuild, O as getChannel, P as getGuildMember, R as RequestClient, b as getCurrentUser, d as hasDiscordV2Components, f as serializePayload, p as Embed, w as createChannelMessage, y as createUserDmChannel, z as DiscordError } from "./discord-BRVFhk09.mjs";
|
|
3
|
+
import { w as isDiscordThreadChannelType } from "./allow-list-C3j0qLDp.mjs";
|
|
4
|
+
import { d as resolveDiscordReplyMessageId, h as createDiscordRetryRunner, v as chunkDiscordTextWithMode } from "./send.receipt-DLOV4qx6.mjs";
|
|
5
5
|
import { t as resolveDiscordProxyFetchForAccount } from "./proxy-fetch-BzXwBAXt.mjs";
|
|
6
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
6
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BzaZPBm9.mjs";
|
|
7
7
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
8
8
|
import { normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { ChannelType, MessageFlags, PermissionFlagsBits } from "discord-api-types/v10";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as formatDiscordUserTag } from "./allow-list-
|
|
1
|
+
import { S as formatDiscordUserTag } from "./allow-list-C3j0qLDp.mjs";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/discord/src/monitor/sender-identity.ts
|
|
4
4
|
function resolveDiscordWebhookId(message) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as resolveDefaultDiscordAccountId, f as resolveDiscordAccountDisabledReason, i as listDiscordAccountIds, l as resolveDiscordAccount, p as resolveDiscordAccountDmPolicy, r as isDiscordAccountEnabledForRuntime, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-DGkdWwix.mjs";
|
|
3
3
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
4
|
-
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-
|
|
4
|
+
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-y0Qy36X3.mjs";
|
|
5
5
|
import { t as DiscordChannelConfigSchema } from "./config-schema-BNKN1cu5.mjs";
|
|
6
6
|
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Bwv8EuQ_.mjs";
|
|
7
7
|
import { r as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-B1kE4sDv.mjs";
|
|
@@ -97,7 +97,7 @@ const discordSetupContract = defineChannelSetupContract({
|
|
|
97
97
|
//#region extensions/discord/src/shared.ts
|
|
98
98
|
const DISCORD_CHANNEL = "discord";
|
|
99
99
|
const livePolicyConfigPrefixes = Object.keys(selectDiscordLivePolicyConfig({})).flatMap((key) => [`channels.discord.${key}`, `channels.discord.accounts.*.${key}`]);
|
|
100
|
-
const loadDiscordDoctorModule = createLazyRuntimeModule(() => import("./doctor-
|
|
100
|
+
const loadDiscordDoctorModule = createLazyRuntimeModule(() => import("./doctor-RqH-6JB0.mjs"));
|
|
101
101
|
const discordDoctor = {
|
|
102
102
|
dmAllowFromMode: "topOnly",
|
|
103
103
|
groupModel: "route",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { d as unbindThreadBindingsBySessionKeyAsync, o as listThreadBindingsBySessionKey, s as listThreadBindingsBySessionKeyAsync } from "./thread-bindings-
|
|
2
|
+
import { d as unbindThreadBindingsBySessionKeyAsync, o as listThreadBindingsBySessionKey, s as listThreadBindingsBySessionKeyAsync } from "./thread-bindings-jkFp9m4N.mjs";
|
|
3
3
|
import { normalizeOptionalLowercaseString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { warnPluginSdkDeprecation } from "openclaw/plugin-sdk/thread-bindings-session-runtime";
|
|
5
5
|
//#region extensions/discord/src/subagent-hooks.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as discord_exports } from "./discord-
|
|
2
|
-
import { S as formatDiscordUserTag } from "./allow-list-
|
|
1
|
+
import { t as discord_exports } from "./discord-BRVFhk09.mjs";
|
|
2
|
+
import { S as formatDiscordUserTag } from "./allow-list-C3j0qLDp.mjs";
|
|
3
3
|
//#region extensions/discord/src/monitor/system-events.ts
|
|
4
4
|
const SYSTEM_EVENT_ACTIONS = /* @__PURE__ */ new Map([
|
|
5
5
|
[discord_exports.MessageType.ChannelPinnedMessage, "pinned a message"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
|
|
3
|
-
import { a as allowFromContainsDiscordUserId } from "./send.receipt-
|
|
4
|
-
import { o as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
3
|
+
import { a as allowFromContainsDiscordUserId } from "./send.receipt-DLOV4qx6.mjs";
|
|
4
|
+
import { o as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-CY2-qrHI.mjs";
|
|
5
5
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
6
6
|
import { buildMessagingTarget } from "openclaw/plugin-sdk/channel-targets";
|
|
7
7
|
//#region extensions/discord/src/target-resolver.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
3
|
-
import { D as refreshUnboundThreadWebhookIdentity, F as resolveThreadBindingMaxAgeMs, M as resolveThreadBindingIdleTimeoutMs, N as resolveThreadBindingInactivityExpiresAt, P as resolveThreadBindingMaxAgeExpiresAt, S as ensureBindingsLoadedAsync, _ as MANAGERS_BY_ACCOUNT_ID, a as mutateBindingsForTargetSession, g as BINDINGS_BY_THREAD_ID, i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, o as resolveBindingIdsForTargetSession, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey, u as removeBindingRecordSync, w as getThreadBindingToken, x as ensureBindingsLoaded } from "./thread-bindings.session-updates-
|
|
4
|
-
import { c as resolveThreadBindingPersonaFromRecord, i as createNoopThreadBindingManager, n as getThreadBindingManager, o as resolveChannelIdForBinding, s as resolveThreadBindingPersona, t as createThreadBindingManager } from "./thread-bindings.manager-
|
|
3
|
+
import { D as refreshUnboundThreadWebhookIdentity, F as resolveThreadBindingMaxAgeMs, M as resolveThreadBindingIdleTimeoutMs, N as resolveThreadBindingInactivityExpiresAt, P as resolveThreadBindingMaxAgeExpiresAt, S as ensureBindingsLoadedAsync, _ as MANAGERS_BY_ACCOUNT_ID, a as mutateBindingsForTargetSession, g as BINDINGS_BY_THREAD_ID, i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, o as resolveBindingIdsForTargetSession, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey, u as removeBindingRecordSync, w as getThreadBindingToken, x as ensureBindingsLoaded } from "./thread-bindings.session-updates-DzJrXc4w.mjs";
|
|
4
|
+
import { c as resolveThreadBindingPersonaFromRecord, i as createNoopThreadBindingManager, n as getThreadBindingManager, o as resolveChannelIdForBinding, s as resolveThreadBindingPersona, t as createThreadBindingManager } from "./thread-bindings.manager-CyX0Z04h.mjs";
|
|
5
5
|
import { normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { runTasksWithConcurrency } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
7
7
|
import { formatThreadBindingDurationLabel as formatThreadBindingDurationLabel$1, resolveThreadBindingIdleTimeoutMsForChannel, resolveThreadBindingIntroText, resolveThreadBindingIntroText as resolveThreadBindingIntroText$1, resolveThreadBindingMaxAgeMsForChannel, resolveThreadBindingThreadName, resolveThreadBindingThreadName as resolveThreadBindingThreadName$1, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
package/dist/.setup/{thread-bindings.manager-NywKzUtc.mjs → thread-bindings.manager-CyX0Z04h.mjs}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { N as createDiscordRestClient } from "./send.shared-
|
|
3
|
-
import { O as getChannel, q as withDiscordRequestAuthority, t as discord_exports, z as DiscordError } from "./discord-
|
|
4
|
-
import { w as isDiscordThreadChannelType } from "./allow-list-
|
|
5
|
-
import { p as canFallbackDiscordWebhookSend } from "./send.receipt-
|
|
2
|
+
import { N as createDiscordRestClient } from "./send.shared-B_KKRrD7.mjs";
|
|
3
|
+
import { O as getChannel, q as withDiscordRequestAuthority, t as discord_exports, z as DiscordError } from "./discord-BRVFhk09.mjs";
|
|
4
|
+
import { w as isDiscordThreadChannelType } from "./allow-list-C3j0qLDp.mjs";
|
|
5
|
+
import { p as canFallbackDiscordWebhookSend } from "./send.receipt-DLOV4qx6.mjs";
|
|
6
6
|
import { n as resolveDiscordChannelId } from "./target-parsing-C-HyNxcE.mjs";
|
|
7
|
-
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-
|
|
8
|
-
import { t as sendMessageDiscord } from "./send.outbound-
|
|
9
|
-
import { A as resolveBindingRecordKey, C as forgetThreadBindingToken, D as refreshUnboundThreadWebhookIdentity, E as normalizeThreadBindingDurationMs, F as resolveThreadBindingMaxAgeMs, I as shouldDefaultPersist, L as toBindingRecordKey, M as resolveThreadBindingIdleTimeoutMs, O as rememberThreadBindingToken, R as toReusableWebhookKey, S as ensureBindingsLoadedAsync, T as normalizeTargetKind, _ as MANAGERS_BY_ACCOUNT_ID, b as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, c as drainThreadBindingAccountOperations, d as runThreadBindingAccountOperation, f as runThreadBindingMutation, g as BINDINGS_BY_THREAD_ID, h as updateBindingRecordSync, j as resolvePreparedThreadBindingLifecycle, k as resolveBindingIdsForSession, l as drainThreadBindingMutations, m as snapshotThreadBindingMetadata, p as shouldPersistAnyBindingState, s as commitBindingRecord, v as PERSIST_BY_ACCOUNT_ID, w as getThreadBindingToken, y as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL } from "./thread-bindings.session-updates-
|
|
7
|
+
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-C93UORFt.mjs";
|
|
8
|
+
import { t as sendMessageDiscord } from "./send.outbound-D58xXPgs.mjs";
|
|
9
|
+
import { A as resolveBindingRecordKey, C as forgetThreadBindingToken, D as refreshUnboundThreadWebhookIdentity, E as normalizeThreadBindingDurationMs, F as resolveThreadBindingMaxAgeMs, I as shouldDefaultPersist, L as toBindingRecordKey, M as resolveThreadBindingIdleTimeoutMs, O as rememberThreadBindingToken, R as toReusableWebhookKey, S as ensureBindingsLoadedAsync, T as normalizeTargetKind, _ as MANAGERS_BY_ACCOUNT_ID, b as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, c as drainThreadBindingAccountOperations, d as runThreadBindingAccountOperation, f as runThreadBindingMutation, g as BINDINGS_BY_THREAD_ID, h as updateBindingRecordSync, j as resolvePreparedThreadBindingLifecycle, k as resolveBindingIdsForSession, l as drainThreadBindingMutations, m as snapshotThreadBindingMetadata, p as shouldPersistAnyBindingState, s as commitBindingRecord, v as PERSIST_BY_ACCOUNT_ID, w as getThreadBindingToken, y as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL } from "./thread-bindings.session-updates-DzJrXc4w.mjs";
|
|
10
10
|
import { t as resolveDiscordChannelInfoSafe } from "./channel-access-9cyzozUP.mjs";
|
|
11
11
|
import { coerceErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
12
12
|
import { createSubsystemLogger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as stripUndefinedFields } from "./discord-
|
|
1
|
+
import { J as stripUndefinedFields } from "./discord-BRVFhk09.mjs";
|
|
2
2
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
3
3
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
4
4
|
import { normalizeAccountId, resolveAgentIdFromSessionKey } from "openclaw/plugin-sdk/routing";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { T as createThread, k as getChannelMessage, t as discord_exports } from "./discord-
|
|
3
|
-
import { d as resolveDiscordReplyDeliveryPlan, f as resolveDiscordReplyTarget, g as sanitizeDiscordThreadName, h as resolveDiscordThreadStarter, j as resolveDiscordMessageChannelId, m as resolveDiscordThreadParentInfo, p as resolveDiscordThreadChannel } from "./transcripts-source-
|
|
2
|
+
import { T as createThread, k as getChannelMessage, t as discord_exports } from "./discord-BRVFhk09.mjs";
|
|
3
|
+
import { d as resolveDiscordReplyDeliveryPlan, f as resolveDiscordReplyTarget, g as sanitizeDiscordThreadName, h as resolveDiscordThreadStarter, j as resolveDiscordMessageChannelId, m as resolveDiscordThreadParentInfo, p as resolveDiscordThreadChannel } from "./transcripts-source-DIW1fU_P.mjs";
|
|
4
4
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
5
5
|
import { buildAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as resolveDiscordAccount, o as listEnabledDiscordAccounts, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import { k as getChannelMessage, t as discord_exports, z as DiscordError } from "./discord-
|
|
3
|
-
import { f as resolveDiscordGuildEntry, i as normalizeDiscordAllowList, l as resolveDiscordChannelConfigWithFallback, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, r as isDiscordGroupAllowedByPolicy, t as allowListMatches, w as isDiscordThreadChannelType } from "./allow-list-
|
|
2
|
+
import { k as getChannelMessage, t as discord_exports, z as DiscordError } from "./discord-BRVFhk09.mjs";
|
|
3
|
+
import { f as resolveDiscordGuildEntry, i as normalizeDiscordAllowList, l as resolveDiscordChannelConfigWithFallback, n as hasConfiguredDiscordChannels, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState, r as isDiscordGroupAllowedByPolicy, t as allowListMatches, w as isDiscordThreadChannelType } from "./allow-list-C3j0qLDp.mjs";
|
|
4
4
|
import { i as resolveDiscordEndpointMediaGuard, n as getDiscordEndpointRuntime } from "./endpoint-runtime-lf4DeLas.mjs";
|
|
5
5
|
import { l as withAbortTimeout } from "./timeouts-cIxzatmv.mjs";
|
|
6
6
|
import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-C7rUdqUX.mjs";
|
|
@@ -10,6 +10,7 @@ import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/acco
|
|
|
10
10
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId, summarizeStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
11
|
import { ComponentType, StickerFormatType } from "discord-api-types/v10";
|
|
12
12
|
import { saveRemoteMedia } from "openclaw/plugin-sdk/media-runtime";
|
|
13
|
+
import { findCodeRegions, isInsideCode } from "openclaw/plugin-sdk/text-chunking";
|
|
13
14
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
14
15
|
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
15
16
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
@@ -134,17 +135,16 @@ function mergeHostnameList(...lists) {
|
|
|
134
135
|
const merged = lists.flatMap((list) => list ?? []).map((value) => value.trim()).filter((value) => value.length > 0);
|
|
135
136
|
return merged.length > 0 ? uniqueStrings(merged) : void 0;
|
|
136
137
|
}
|
|
137
|
-
/**
|
|
138
|
+
/** Inherit explicit host/proxy exceptions, never browser-wide private-network access. */
|
|
138
139
|
function resolveDiscordCdnPolicy(policy) {
|
|
139
140
|
if (!policy) return DISCORD_MEDIA_SSRF_POLICY;
|
|
140
|
-
const hostnameAllowlist = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.hostnameAllowlist, policy.hostnameAllowlist);
|
|
141
|
-
const allowedHostnames = mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.allowedHostnames, policy.allowedHostnames);
|
|
142
141
|
return {
|
|
143
142
|
...DISCORD_MEDIA_SSRF_POLICY,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
hostnameAllowlist: mergeHostnameList(DISCORD_MEDIA_SSRF_POLICY.hostnameAllowlist, policy.hostnameAllowlist),
|
|
144
|
+
allowedHostnames: mergeHostnameList(policy.allowedHostnames),
|
|
145
|
+
allowedOrigins: policy.allowedOrigins,
|
|
146
|
+
blockedHostnames: policy.blockedHostnames,
|
|
147
|
+
allowIpv6UniqueLocalRange: policy.allowIpv6UniqueLocalRange
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
//#endregion
|
|
@@ -362,12 +362,12 @@ function resolveDiscordMentions(text, message) {
|
|
|
362
362
|
if (!text.includes("<")) return text;
|
|
363
363
|
const mentions = message.mentionedUsers ?? [];
|
|
364
364
|
if (!Array.isArray(mentions) || mentions.length === 0) return text;
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
365
|
+
const codeRegions = findCodeRegions(text);
|
|
366
|
+
return text.replace(/<@!?(\d+)>/g, (mention, id, offset) => {
|
|
367
|
+
if (isInsideCode(offset, codeRegions)) return mention;
|
|
368
|
+
const user = mentions.find((mentionedUser) => mentionedUser.id === id);
|
|
369
|
+
return user ? `@${user.globalName || user.username || user.id}` : mention;
|
|
370
|
+
});
|
|
371
371
|
}
|
|
372
372
|
function resolveDiscordForwardedMessagesText(message) {
|
|
373
373
|
const snapshots = resolveDiscordMessageSnapshots(message);
|