@openclaw/discord 2026.11.5-beta.1 → 2026.11.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-inspect-CSz5Qodj.mjs → account-inspect-DGkdWwix.mjs} +3 -2
- package/dist/.setup/{accounts-DtjvhJUj.mjs → accounts-C_25wyxC.mjs} +8 -4
- package/dist/.setup/{active-turn-thread-route-DkPnk2x8.mjs → active-turn-thread-route-KvRTAVE3.mjs} +2 -1
- package/dist/.setup/{allow-list-DahA0Jxh.mjs → allow-list-BXrS8-R9.mjs} +8 -4
- package/dist/.setup/{api-Bp0HI4q3.mjs → api-BlBD4ism.mjs} +6 -4
- package/dist/.setup/{approval-handler.runtime-Cy53ugTf.mjs → approval-handler.runtime-BGYjX1t9.mjs} +10 -9
- package/dist/.setup/{approval-message-updates-DqOXxPss.mjs → approval-message-updates-DKsCfxSW.mjs} +4 -3
- package/dist/.setup/{audit-DoPKOfQE.mjs → audit-5b-FXj9R.mjs} +7 -6
- package/dist/.setup/{channel-Ds6iuNdy.mjs → channel-CWwTHWFo.mjs} +39 -32
- package/dist/.setup/{channel-access-DhJhVrdZ.mjs → channel-access-9cyzozUP.mjs} +2 -1
- package/dist/.setup/{channel.setup-BLt9dkIG.mjs → channel.setup-B3MtmBQG.mjs} +10 -7
- package/dist/.setup/{command-deploy-store-DPWiBMks.mjs → command-deploy-store-DFkBTViB.mjs} +2 -1
- package/dist/.setup/{command-owners-BzlhNBxA.mjs → command-owners-C7rUdqUX.mjs} +2 -1
- package/dist/.setup/{components-WTfUxead.mjs → components-YCvQ6YLS.mjs} +16 -10
- package/dist/.setup/{components.base-C5sAPHe4.mjs → components.base-CiS0h_XP.mjs} +2 -1
- package/dist/.setup/{config-schema-GX2yDgIH.mjs → config-schema-BNKN1cu5.mjs} +5 -3
- package/dist/.setup/{conversation-binding-route-CZdm-X5A.mjs → conversation-binding-route-kCTw8cij.mjs} +3 -2
- package/dist/.setup/{directory-config-BXJuh9-J.mjs → directory-config-Ble81PWH.mjs} +4 -3
- package/dist/.setup/{directory-live-CEopeb8Q.mjs → directory-live-DH3tpS3x.mjs} +11 -8
- package/dist/.setup/{discord-r79VFjJp.mjs → discord-DGVSguhx.mjs} +52 -28
- package/dist/.setup/{doctor-contract-Dstl3cMg.mjs → doctor-contract-Bwv8EuQ_.mjs} +3 -2
- package/dist/.setup/{doctor-UfLW8nye.mjs → doctor-eujgbnpZ.mjs} +8 -7
- package/dist/.setup/{endpoint-runtime-BM3x-m6O.mjs → endpoint-runtime-lf4DeLas.mjs} +2 -1
- package/dist/.setup/{guilds-DQucP5Tn.mjs → guilds-eDq22iSM.mjs} +4 -3
- package/dist/.setup/{handle-action-BarHOi-v.mjs → handle-action-CktwmzMz.mjs} +11 -10
- package/dist/.setup/{handle-action.guild-admin-oRUb8p_O.mjs → handle-action.guild-admin-WLQ7fRqI.mjs} +4 -3
- package/dist/.setup/{listeners-CHgTENFu.mjs → listeners-Df8lx3vK.mjs} +3 -2
- package/dist/.setup/{live-policy-config-EKp4O6zx.mjs → live-policy-config-DiBVuaU6.mjs} +5 -3
- package/dist/.setup/{message-handler-DUeT8Asf.mjs → message-handler-hhNSioxo.mjs} +15 -11
- package/dist/.setup/{message-handler.preflight-C6TNtKW0.mjs → message-handler.preflight-BZcZE1o-.mjs} +26 -19
- package/dist/.setup/{message-handler.preflight-pluralkit-6E9TFmmN.mjs → message-handler.preflight-pluralkit-CYZfXXb6.mjs} +14 -10
- package/dist/.setup/{message-handler.process-D8_oQ5Cp.mjs → message-handler.process-B0n-mQ99.mjs} +34 -26
- package/dist/.setup/{outbound-payload-DUsrFICb.mjs → outbound-payload-BaZmjewa.mjs} +11 -9
- package/dist/.setup/{outbound-session-route-Cb8cv4Oi.mjs → outbound-session-route-Cgx4i9cS.mjs} +34 -22
- package/dist/.setup/{output-activity-CDgs2s3O.mjs → output-activity-uBpMSX75.mjs} +2 -1
- package/dist/.setup/{pluralkit-DcXbHTpQ.mjs → pluralkit-B64dfq_j.mjs} +3 -2
- package/dist/.setup/{preflight-audio-r4BbaJxh.mjs → preflight-audio-C6QtD6HX.mjs} +2 -1
- package/dist/.setup/{presence-cache-B3xj3b0l.mjs → presence-cache-Dq-3nH7R.mjs} +2 -1
- package/dist/.setup/{probe-BUmJyH35.mjs → probe-DezB-6xz.mjs} +6 -5
- package/dist/.setup/{provider-Dm2ERSxe.mjs → provider-BN2bCIUp.mjs} +185 -109
- package/dist/.setup/{provider-session.runtime-DCIqDsIg.mjs → provider-session.runtime-Dr_5X43t.mjs} +3 -3
- package/dist/.setup/provider.runtime-BuJpl0Pv.mjs +1 -0
- package/dist/.setup/{proxy-fetch-B8cK6FLQ.mjs → proxy-fetch-BzXwBAXt.mjs} +2 -1
- package/dist/.setup/{realtime-session.runtime-WJL6NdwK.mjs → realtime-session.runtime-BTDWsV4d.mjs} +25 -15
- package/dist/.setup/{receive-recovery-DV_v5ROf.mjs → receive-recovery-C3Ks4wAQ.mjs} +6 -3
- package/dist/.setup/{resolve-allowlist-common-C37fgnYG.mjs → resolve-allowlist-common-Bk8Fj6Ik.mjs} +4 -3
- package/dist/.setup/{resolve-channels-CwpnQ7C2.mjs → resolve-channels-Bp8frXvc.mjs} +7 -6
- package/dist/.setup/{resolve-users-D6jSwe8R.mjs → resolve-users-Cvcj22sG.mjs} +6 -5
- package/dist/.setup/{rolldown-runtime-nwUcYXjP.mjs → rolldown-runtime-B4FMCO8f.mjs} +2 -1
- package/dist/.setup/{runtime-DhOMlnYS.mjs → runtime-BJaCvlmq.mjs} +26 -18
- package/dist/.setup/{runtime-B-PgPsGR.mjs → runtime-BMgTyuwg.mjs} +6 -4
- package/dist/.setup/{runtime-DcBvHOm1.mjs → runtime-DgnVQ7zW.mjs} +2 -1
- package/dist/.setup/{runtime-doctor-migrations-BpV1jKk0.mjs → runtime-doctor-migrations-BPV-R4G9.mjs} +9 -5
- package/dist/.setup/{secret-config-contract-CP6teHec.mjs → secret-config-contract-B1kE4sDv.mjs} +2 -1
- package/dist/.setup/{security-audit-CTwisG7c.mjs → security-audit-BFT84Uny.mjs} +4 -3
- package/dist/.setup/{security-contract-D-o0iWDk.mjs → security-contract-DNyyjTZZ.mjs} +2 -1
- package/dist/.setup/{security-doctor-4s7omTZd.mjs → security-doctor-nGgPm65L.mjs} +2 -1
- package/dist/.setup/{send-DnLL6XoO.mjs → send-CVW7V-VZ.mjs} +28 -19
- package/dist/.setup/{send.components-xB43CksK.mjs → send.components-C8YXdnO_.mjs} +14 -11
- package/dist/.setup/{send.outbound-B11X6TOE.mjs → send.outbound-Uzcmh3Yd.mjs} +16 -11
- package/dist/.setup/{send.receipt-CMteCIZS.mjs → send.receipt-NZDOTZBU.mjs} +16 -9
- package/dist/.setup/{send.shared-BcLLZBul.mjs → send.shared-a_6Oeyg1.mjs} +18 -12
- package/dist/.setup/{sender-identity-CGNpdJmb.mjs → sender-identity-76HFb8eK.mjs} +3 -2
- package/dist/.setup/{session-contract-Bq71MS78.mjs → session-contract-BO5tlIdl.mjs} +2 -1
- package/dist/.setup/{session-key-normalization-Cfvze5hd.mjs → session-key-normalization-CCHGNSQw.mjs} +2 -1
- package/dist/.setup/setup-plugin-api-BExhGEhL.mjs +2 -0
- package/dist/.setup/{shared-interactive-DKBw4SNV.mjs → shared-interactive-DmzaoKOM.mjs} +12 -7
- package/dist/.setup/{shared-BEYw16he.mjs → shared-yDUSExm2.mjs} +17 -14
- package/dist/.setup/{subagent-hooks-DlYElpXa.mjs → subagent-hooks-CDkdHQyy.mjs} +4 -3
- package/dist/.setup/{system-events--Pk6y9aP.mjs → system-events-yfWz150v.mjs} +4 -3
- package/dist/.setup/{target-parsing-BiuhcK9Q.mjs → target-parsing-C-HyNxcE.mjs} +2 -1
- package/dist/.setup/{target-resolver-Bo9EpGp_.mjs → target-resolver-BOOzqxxM.mjs} +7 -6
- package/dist/.setup/{thread-binding-api-Drd4Zu-5.mjs → thread-binding-api-BDZJD4na.mjs} +2 -1
- package/dist/.setup/{thread-bindings-BF-hr-bg.mjs → thread-bindings-zce4cpu_.mjs} +10 -7
- package/dist/.setup/{thread-bindings.manager-CQCkha5r.mjs → thread-bindings.manager-NywKzUtc.mjs} +20 -15
- package/dist/.setup/{thread-bindings.session-updates-C2gJAj_I.mjs → thread-bindings.session-updates-D0j7oh8S.mjs} +10 -6
- package/dist/.setup/{threading-HA9C2wYR.mjs → threading-DodLYDt-.mjs} +7 -5
- package/dist/.setup/{timeouts-CT9hnmo4.mjs → timeouts-cIxzatmv.mjs} +2 -1
- package/dist/.setup/{transcripts-source-DzpzETZR.mjs → transcripts-source-ie9GBWaU.mjs} +33 -20
- package/dist/.setup/{typing-DAv4S2fI.mjs → typing-CNlSKY5S.mjs} +3 -2
- package/dist/.setup/{voice-runtime-Bo_nsVvX.mjs → voice-runtime-B7V_LTdX.mjs} +46 -28
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +3 -2
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +13 -9
- package/dist/api.js +22 -21
- package/dist/assets/embedded-app-sdk.mjs +1 -1
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/directory-contract-api.js +3 -2
- package/dist/doctor-contract-api.js +7 -5
- package/dist/index.js +2 -1
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-entry.js +3 -2
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +14 -8
- package/dist/subagent-hooks-api.js +3 -2
- package/dist/thread-binding-api.js +1 -1
- package/dist/transcripts-source-api.js +3 -2
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +3 -2
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +3 -2
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-DmxPGoUg.mjs +0 -1
- package/dist/.setup/setup-plugin-api-C6AMx3hu.mjs +0 -2
|
@@ -1,31 +1,31 @@
|
|
|
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-
|
|
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-
|
|
6
|
-
import { n as getDiscordEndpointRuntime, t as assertDiscordEndpointGatewayUrl } from "./endpoint-runtime-
|
|
7
|
-
import { n as validateDiscordProxyUrl, r as withValidatedDiscordProxy } from "./proxy-fetch-
|
|
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-
|
|
11
|
-
import { l as withAbortTimeout } from "./timeouts-
|
|
12
|
-
import { r as setPresence, t as clearPresences } from "./presence-cache-
|
|
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-
|
|
14
|
-
import { a as buildDiscordComponentMessage } from "./components-
|
|
15
|
-
import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-
|
|
16
|
-
import { t as getDiscordRuntime } from "./runtime-
|
|
17
|
-
import { n as getDiscordActivitiesRuntime } from "./runtime-
|
|
18
|
-
import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-
|
|
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-
|
|
24
|
-
import { n as resolveDiscordChannelNameSafe, r as resolveDiscordChannelTopicSafe, t as resolveDiscordChannelInfoSafe } from "./channel-access-
|
|
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-
|
|
28
|
-
import { n as hasDiscordApprovalControl, t as discordApprovalMessageUpdates } from "./approval-message-updates-
|
|
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-a_6Oeyg1.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-DGVSguhx.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-BXrS8-R9.mjs";
|
|
5
|
+
import { v as chunkDiscordTextWithMode } from "./send.receipt-NZDOTZBU.mjs";
|
|
6
|
+
import { n as getDiscordEndpointRuntime, t as assertDiscordEndpointGatewayUrl } from "./endpoint-runtime-lf4DeLas.mjs";
|
|
7
|
+
import { n as validateDiscordProxyUrl, r as withValidatedDiscordProxy } from "./proxy-fetch-BzXwBAXt.mjs";
|
|
8
|
+
import { a as isDiscordRateLimitResponseBody, s as summarizeDiscordResponseBody } from "./api-BlBD4ism.mjs";
|
|
9
|
+
import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-CVW7V-VZ.mjs";
|
|
10
|
+
import { s as formatMention, t as sendMessageDiscord } from "./send.outbound-Uzcmh3Yd.mjs";
|
|
11
|
+
import { l as withAbortTimeout } from "./timeouts-cIxzatmv.mjs";
|
|
12
|
+
import { r as setPresence, t as clearPresences } from "./presence-cache-Dq-3nH7R.mjs";
|
|
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-YCvQ6YLS.mjs";
|
|
15
|
+
import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-C8YXdnO_.mjs";
|
|
16
|
+
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
17
|
+
import { n as getDiscordActivitiesRuntime } from "./runtime-BMgTyuwg.mjs";
|
|
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-Cgx4i9cS.mjs";
|
|
20
|
+
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-DiBVuaU6.mjs";
|
|
21
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-Bp8frXvc.mjs";
|
|
22
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-Cvcj22sG.mjs";
|
|
23
|
+
import { a as isThreadArchived, n as getThreadBindingManager } from "./thread-bindings.manager-NywKzUtc.mjs";
|
|
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-DezB-6xz.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-ie9GBWaU.mjs";
|
|
27
|
+
import { t as resolveDiscordSenderIdentity } from "./sender-identity-76HFb8eK.mjs";
|
|
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";
|
|
31
31
|
import { createNonExitingRuntime, createSubsystemLogger, danger, formatDurationSeconds, logVerbose, shouldLogVerbose, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -94,7 +94,7 @@ import { inspect } from "node:util";
|
|
|
94
94
|
import { channelReadyPatch, createTransportActivityStatusPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
95
95
|
import { Agent } from "node:https";
|
|
96
96
|
import { reportChannelRoomJoin } from "openclaw/plugin-sdk/channel-join-intro-runtime";
|
|
97
|
-
|
|
97
|
+
//#region extensions/discord/src/monitor/listeners.queue.ts
|
|
98
98
|
const DISCORD_SLOW_LISTENER_THRESHOLD_MS = 3e4;
|
|
99
99
|
const discordEventQueueLog = createSubsystemLogger("discord/event-queue");
|
|
100
100
|
async function runDiscordListenerWithSlowLog(params) {
|
|
@@ -126,7 +126,8 @@ async function runDiscordListenerWithSlowLog(params) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region extensions/discord/src/monitor/presence-events.ts
|
|
130
131
|
const DISCORD_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
131
132
|
function isDiscordOnlineStatus(status) {
|
|
132
133
|
return status === "online" || status === "idle" || status === "dnd";
|
|
@@ -153,7 +154,8 @@ function resolveDiscordOnlinePresenceEvent(params) {
|
|
|
153
154
|
text: lines.join("\n")
|
|
154
155
|
};
|
|
155
156
|
}
|
|
156
|
-
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region extensions/discord/src/monitor/presence-cooldown-store.ts
|
|
157
159
|
const DISCORD_PRESENCE_COOLDOWN_MAX_ENTRIES = 25e3;
|
|
158
160
|
function openDiscordPresenceCooldownStore() {
|
|
159
161
|
return getDiscordRuntime().state.openKeyedStore({
|
|
@@ -163,7 +165,8 @@ function openDiscordPresenceCooldownStore() {
|
|
|
163
165
|
defaultTtlMs: DISCORD_PRESENCE_GREETING_COOLDOWN_MS
|
|
164
166
|
});
|
|
165
167
|
}
|
|
166
|
-
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region extensions/discord/src/monitor/presence-emission-gate.ts
|
|
167
170
|
const DISCORD_PRESENCE_RECONNECT_SUPPRESS_MS = 3e5;
|
|
168
171
|
const DISCORD_PRESENCE_BURST_LIMIT = 8;
|
|
169
172
|
const DISCORD_PRESENCE_BURST_WINDOW_MS = 6e4;
|
|
@@ -237,7 +240,8 @@ var DiscordPresenceEmissionGate = class {
|
|
|
237
240
|
if (state.reservations.length === 0 && !state.logged) this.burstByGuild.delete(guildId);
|
|
238
241
|
}
|
|
239
242
|
};
|
|
240
|
-
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region extensions/discord/src/monitor/presence-transition-cache.ts
|
|
241
245
|
const DEFAULT_PRESENCE_BASELINE_MAX_ENTRIES = 75e3;
|
|
242
246
|
var DiscordPresenceBaselineCache = class {
|
|
243
247
|
constructor(maxEntries = DEFAULT_PRESENCE_BASELINE_MAX_ENTRIES) {
|
|
@@ -279,7 +283,8 @@ var DiscordPresenceBaselineCache = class {
|
|
|
279
283
|
return evictedScope;
|
|
280
284
|
}
|
|
281
285
|
};
|
|
282
|
-
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region extensions/discord/src/monitor/thread-session-close.ts
|
|
283
288
|
/**
|
|
284
289
|
* Closes every session entry in the store whose key contains {@link threadId}.
|
|
285
290
|
* The explicit lifecycle deletion archives the old transcript and guarantees
|
|
@@ -309,7 +314,8 @@ async function closeDiscordThreadSessions(params) {
|
|
|
309
314
|
}
|
|
310
315
|
return resetCount;
|
|
311
316
|
}
|
|
312
|
-
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region extensions/discord/src/monitor/dm-command-auth.ts
|
|
313
319
|
const DISCORD_CHANNEL_ID = "discord";
|
|
314
320
|
function createDiscordDmIngressSubject(sender) {
|
|
315
321
|
return {
|
|
@@ -411,7 +417,8 @@ async function resolveDiscordTextCommandAccess(params) {
|
|
|
411
417
|
}
|
|
412
418
|
});
|
|
413
419
|
}
|
|
414
|
-
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region extensions/discord/src/monitor/listeners.reactions.ts
|
|
415
422
|
var DiscordReactionListener = class {
|
|
416
423
|
constructor(params) {
|
|
417
424
|
this.params = params;
|
|
@@ -642,7 +649,8 @@ async function runDiscordReactionHandler(params) {
|
|
|
642
649
|
eventParams.logger.error(danger(`discord reaction handler failed: ${String(err)}`));
|
|
643
650
|
}
|
|
644
651
|
}
|
|
645
|
-
|
|
652
|
+
//#endregion
|
|
653
|
+
//#region extensions/discord/src/monitor/listeners.ts
|
|
646
654
|
function registerDiscordListener(listeners, listener) {
|
|
647
655
|
if (listeners.some((existing) => existing.constructor === listener.constructor)) return false;
|
|
648
656
|
listeners.push(listener);
|
|
@@ -1015,7 +1023,8 @@ var DiscordThreadDeleteListener = class {
|
|
|
1015
1023
|
});
|
|
1016
1024
|
}
|
|
1017
1025
|
};
|
|
1018
|
-
|
|
1026
|
+
//#endregion
|
|
1027
|
+
//#region extensions/discord/src/internal/gateway-dispatch.ts
|
|
1019
1028
|
function mapGatewayDispatchData(client, type, data) {
|
|
1020
1029
|
if (type === GatewayDispatchEvents.MessageCreate) return createMessageDispatchData(client, data);
|
|
1021
1030
|
if (type === GatewayDispatchEvents.MessageReactionAdd || type === GatewayDispatchEvents.MessageReactionRemove) return createReactionDispatchData(client, data);
|
|
@@ -1055,7 +1064,8 @@ function createReactionDispatchData(client, data) {
|
|
|
1055
1064
|
})
|
|
1056
1065
|
};
|
|
1057
1066
|
}
|
|
1058
|
-
|
|
1067
|
+
//#endregion
|
|
1068
|
+
//#region extensions/discord/src/monitor/provider.allowlist.ts
|
|
1059
1069
|
function formatResolutionLogDetails(base, details) {
|
|
1060
1070
|
const nonEmpty = details.map((value) => value?.trim()).filter((value) => Boolean(value));
|
|
1061
1071
|
return nonEmpty.length > 0 ? `${base} (${nonEmpty.join("; ")})` : base;
|
|
@@ -1254,7 +1264,8 @@ async function resolveDiscordAllowlistConfig(params) {
|
|
|
1254
1264
|
allowFrom
|
|
1255
1265
|
};
|
|
1256
1266
|
}
|
|
1257
|
-
|
|
1267
|
+
//#endregion
|
|
1268
|
+
//#region extensions/discord/src/network-config.ts
|
|
1258
1269
|
const DISCORD_DNS_HOSTS = [
|
|
1259
1270
|
"discord.com",
|
|
1260
1271
|
"discord.gg",
|
|
@@ -1304,7 +1315,8 @@ function createDiscordEndpointDnsLookup(endpointHostname) {
|
|
|
1304
1315
|
});
|
|
1305
1316
|
};
|
|
1306
1317
|
}
|
|
1307
|
-
|
|
1318
|
+
//#endregion
|
|
1319
|
+
//#region extensions/discord/src/monitor/rest-fetch.ts
|
|
1308
1320
|
const discordDnsLookup$1 = createDiscordDnsLookup();
|
|
1309
1321
|
function createDiscordRestFetchWithDispatcher(dispatcher) {
|
|
1310
1322
|
return wrapFetchWithAbortSignal(((input, init) => fetchWithRuntimeDispatcher(input, {
|
|
@@ -1343,7 +1355,8 @@ function resolveDiscordRestFetch(proxyUrl, runtime) {
|
|
|
1343
1355
|
}
|
|
1344
1356
|
return createDiscordRestFetchWithDispatcher(dispatcher ?? createHttp1Agent({ connect: { lookup: discordDnsLookup$1 } }));
|
|
1345
1357
|
}
|
|
1346
|
-
|
|
1358
|
+
//#endregion
|
|
1359
|
+
//#region extensions/discord/src/monitor/live-policy.ts
|
|
1347
1360
|
/** One reader belongs to one admitted account; transport and lifetime remain its startup owners. */
|
|
1348
1361
|
function createDiscordLivePolicyReader(params) {
|
|
1349
1362
|
const readConfig = params.readConfig ?? createRuntimeConfigReader(params.cfg);
|
|
@@ -1441,7 +1454,8 @@ function createDiscordLivePolicyReader(params) {
|
|
|
1441
1454
|
}
|
|
1442
1455
|
};
|
|
1443
1456
|
}
|
|
1444
|
-
|
|
1457
|
+
//#endregion
|
|
1458
|
+
//#region extensions/discord/src/monitor/dm-command-decision.ts
|
|
1445
1459
|
async function handleDiscordDmCommandDecision(params) {
|
|
1446
1460
|
if (params.senderAccess.decision === "pairing") {
|
|
1447
1461
|
const result = await createChannelPairingChallengeIssuer({
|
|
@@ -1467,7 +1481,8 @@ async function handleDiscordDmCommandDecision(params) {
|
|
|
1467
1481
|
}
|
|
1468
1482
|
await params.onUnauthorized();
|
|
1469
1483
|
}
|
|
1470
|
-
|
|
1484
|
+
//#endregion
|
|
1485
|
+
//#region extensions/discord/src/monitor/live-policy-interaction.ts
|
|
1471
1486
|
const INTERACTION_POLICY_WAIT_MS = 1e3;
|
|
1472
1487
|
async function readDiscordInteractionPolicy(readPolicy) {
|
|
1473
1488
|
const timeout = /* @__PURE__ */ new Error("Discord interaction access policy resolution timed out");
|
|
@@ -1478,7 +1493,8 @@ async function readDiscordInteractionPolicy(readPolicy) {
|
|
|
1478
1493
|
return null;
|
|
1479
1494
|
}
|
|
1480
1495
|
}
|
|
1481
|
-
|
|
1496
|
+
//#endregion
|
|
1497
|
+
//#region extensions/discord/src/monitor/native-command-reply.ts
|
|
1482
1498
|
const DISCORD_EMPTY_VISIBLE_REPLY_WARNING = "⚠️ Command produced no visible reply.";
|
|
1483
1499
|
/** Retain visible component text, not interaction IDs or option values. */
|
|
1484
1500
|
function formatDiscordCommandComponents(components) {
|
|
@@ -1619,7 +1635,8 @@ async function deliverDiscordInteractionReply(params) {
|
|
|
1619
1635
|
if (payloadDelivered && params.onDelivered) await params.onDelivered(deliveredText?.filter(Boolean).join("\n") ?? "");
|
|
1620
1636
|
return payloadDelivered;
|
|
1621
1637
|
}
|
|
1622
|
-
|
|
1638
|
+
//#endregion
|
|
1639
|
+
//#region extensions/discord/src/monitor/native-command-agent-reply.ts
|
|
1623
1640
|
async function dispatchDiscordNativeAgentReply(params) {
|
|
1624
1641
|
const blockStreamingEnabled = resolveChannelStreamingBlockEnabled(params.discordConfig);
|
|
1625
1642
|
let didReply = false;
|
|
@@ -1695,11 +1712,13 @@ async function dispatchDiscordNativeAgentReply(params) {
|
|
|
1695
1712
|
}));
|
|
1696
1713
|
return dispatchResult;
|
|
1697
1714
|
}
|
|
1698
|
-
|
|
1715
|
+
//#endregion
|
|
1716
|
+
//#region extensions/discord/src/monitor/commands.ts
|
|
1699
1717
|
function resolveDiscordSlashCommandConfig(raw) {
|
|
1700
1718
|
return { ephemeral: raw?.ephemeral !== false };
|
|
1701
1719
|
}
|
|
1702
|
-
|
|
1720
|
+
//#endregion
|
|
1721
|
+
//#region extensions/discord/src/monitor/native-command-arg-ui.ts
|
|
1703
1722
|
const DISCORD_COMMAND_ARG_CUSTOM_ID_KEY = "cmdarg";
|
|
1704
1723
|
function parseDiscordCommandArgData(data) {
|
|
1705
1724
|
if (!data || typeof data !== "object") return null;
|
|
@@ -1792,7 +1811,8 @@ function createDiscordCommandArgFallbackButton$1(params) {
|
|
|
1792
1811
|
}
|
|
1793
1812
|
};
|
|
1794
1813
|
}
|
|
1795
|
-
|
|
1814
|
+
//#endregion
|
|
1815
|
+
//#region extensions/discord/src/monitor/inbound-context.ts
|
|
1796
1816
|
function createDiscordSupplementalContextAccessChecker(params) {
|
|
1797
1817
|
const userAllowList = params.channelConfig?.users ?? params.guildInfo?.users ?? [];
|
|
1798
1818
|
const roleAllowList = params.channelConfig?.roles ?? params.guildInfo?.roles ?? [];
|
|
@@ -1841,7 +1861,8 @@ function buildDiscordInboundAccessContext(params) {
|
|
|
1841
1861
|
ownerAllowFrom: resolveDiscordOwnerAllowFrom(params)
|
|
1842
1862
|
};
|
|
1843
1863
|
}
|
|
1844
|
-
|
|
1864
|
+
//#endregion
|
|
1865
|
+
//#region extensions/discord/src/monitor/native-command-context.ts
|
|
1845
1866
|
async function buildDiscordNativeInteractionContext(params) {
|
|
1846
1867
|
const { interaction, route, boundSessionKey, sessionPrefix, channelContext, ...context } = params;
|
|
1847
1868
|
const targets = resolveNativeCommandSessionTargets({
|
|
@@ -1978,7 +1999,8 @@ async function buildDiscordNativeInteractionContext(params) {
|
|
|
1978
1999
|
...targets
|
|
1979
2000
|
};
|
|
1980
2001
|
}
|
|
1981
|
-
|
|
2002
|
+
//#endregion
|
|
2003
|
+
//#region extensions/discord/src/monitor/native-command-route.ts
|
|
1982
2004
|
function resolveDiscordNativeInteractionRouteState(params) {
|
|
1983
2005
|
const { channelContext, interaction } = params;
|
|
1984
2006
|
const conversationId = params.conversationId ?? channelContext.rawChannelId;
|
|
@@ -2020,7 +2042,8 @@ function resolveDiscordNativeInteractionRouteState(params) {
|
|
|
2020
2042
|
configuredBinding
|
|
2021
2043
|
};
|
|
2022
2044
|
}
|
|
2023
|
-
|
|
2045
|
+
//#endregion
|
|
2046
|
+
//#region extensions/discord/src/monitor/native-interaction-channel-context.ts
|
|
2024
2047
|
async function resolveDiscordNativeInteractionChannelContext(interaction, channelIdFallback) {
|
|
2025
2048
|
const { channel, client, guild, rawData } = interaction;
|
|
2026
2049
|
const hasGuild = Boolean(guild);
|
|
@@ -2043,7 +2066,8 @@ async function resolveDiscordNativeInteractionChannelContext(interaction, channe
|
|
|
2043
2066
|
threadParentSlug: hasGuild ? channelContext.threadParentSlug : ""
|
|
2044
2067
|
};
|
|
2045
2068
|
}
|
|
2046
|
-
|
|
2069
|
+
//#endregion
|
|
2070
|
+
//#region extensions/discord/src/monitor/native-command-auth.ts
|
|
2047
2071
|
function resolveDiscordNativePolicyReader(params) {
|
|
2048
2072
|
return params.readPolicy ?? createDiscordLivePolicyReader({
|
|
2049
2073
|
...params,
|
|
@@ -2324,7 +2348,8 @@ async function resolveDiscordNativeAutocompleteAuthorized(params) {
|
|
|
2324
2348
|
}
|
|
2325
2349
|
return params.isPolicyCurrent?.() !== false;
|
|
2326
2350
|
}
|
|
2327
|
-
|
|
2351
|
+
//#endregion
|
|
2352
|
+
//#region extensions/discord/src/monitor/native-command-bypass.ts
|
|
2328
2353
|
function shouldBypassConfiguredAcpEnsure(commandName) {
|
|
2329
2354
|
const command = commandName.trim().toLowerCase();
|
|
2330
2355
|
return command === "acp" || command === "status";
|
|
@@ -2333,7 +2358,8 @@ function shouldBypassConfiguredAcpGuildGuards(commandName) {
|
|
|
2333
2358
|
const command = commandName.trim().toLowerCase();
|
|
2334
2359
|
return command === "new" || command === "reset";
|
|
2335
2360
|
}
|
|
2336
|
-
|
|
2361
|
+
//#endregion
|
|
2362
|
+
//#region extensions/discord/src/monitor/model-picker-preference-primitives.ts
|
|
2337
2363
|
function splitDiscordModelRef(modelRef) {
|
|
2338
2364
|
const trimmed = modelRef.trim();
|
|
2339
2365
|
const slashIndex = trimmed.indexOf("/");
|
|
@@ -2361,7 +2387,8 @@ function preferenceTimestampMs(value) {
|
|
|
2361
2387
|
const parsed = typeof value === "string" ? Date.parse(value) : NaN;
|
|
2362
2388
|
return Number.isFinite(parsed) ? parsed : 0;
|
|
2363
2389
|
}
|
|
2364
|
-
|
|
2390
|
+
//#endregion
|
|
2391
|
+
//#region extensions/discord/src/monitor/model-picker-preferences.ts
|
|
2365
2392
|
const RECENT_LIMIT = 5;
|
|
2366
2393
|
const PREFERENCE_MAX_ENTRIES = 2e3;
|
|
2367
2394
|
let lastPreferenceTimestampMs = 0;
|
|
@@ -2440,7 +2467,8 @@ async function recordDiscordModelPickerRecentModel(params) {
|
|
|
2440
2467
|
await Promise.all(expired.map((entry) => store.delete(entry.key)));
|
|
2441
2468
|
} catch {}
|
|
2442
2469
|
}
|
|
2443
|
-
|
|
2470
|
+
//#endregion
|
|
2471
|
+
//#region extensions/discord/src/monitor/model-picker.state.ts
|
|
2444
2472
|
const DISCORD_MODEL_PICKER_CUSTOM_ID_KEY = "mdlpk";
|
|
2445
2473
|
const DISCORD_CUSTOM_ID_MAX_CHARS = 100;
|
|
2446
2474
|
const DISCORD_COMPONENT_MAX_SELECT_OPTIONS = 25;
|
|
@@ -2690,7 +2718,8 @@ function getDiscordModelPickerRecentModelRefs(data, quickModels) {
|
|
|
2690
2718
|
const defaultModelRef = `${data.resolvedDefault.provider}/${data.resolvedDefault.model}`;
|
|
2691
2719
|
return [defaultModelRef, ...quickModels.filter((modelRef) => modelRef !== defaultModelRef)];
|
|
2692
2720
|
}
|
|
2693
|
-
|
|
2721
|
+
//#endregion
|
|
2722
|
+
//#region extensions/discord/src/monitor/model-picker.view.ts
|
|
2694
2723
|
const DISCORD_MODEL_PICKER_PAGE_INDICATOR_CUSTOM_ID = "mdlpk:nav-indicator";
|
|
2695
2724
|
function parseCurrentModelRef(raw) {
|
|
2696
2725
|
const match = raw?.trim().match(/^([^/]+)\/(.+)$/u);
|
|
@@ -3077,7 +3106,8 @@ function renderDiscordModelPickerRecentsView(params) {
|
|
|
3077
3106
|
trailingRows: [backRow]
|
|
3078
3107
|
});
|
|
3079
3108
|
}
|
|
3080
|
-
|
|
3109
|
+
//#endregion
|
|
3110
|
+
//#region extensions/discord/src/monitor/native-command-model-picker-ui.ts
|
|
3081
3111
|
function createDiscordModelPickerSessionReader(params, readConsistency) {
|
|
3082
3112
|
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.route.agentId });
|
|
3083
3113
|
return (sessionKey = params.route.sessionKey) => getSessionEntryAsync({
|
|
@@ -3238,7 +3268,8 @@ async function replyWithDiscordModelPickerProviders(params) {
|
|
|
3238
3268
|
replyText: formatDiscordCommandComponents(rendered.components)
|
|
3239
3269
|
});
|
|
3240
3270
|
}
|
|
3241
|
-
|
|
3271
|
+
//#endregion
|
|
3272
|
+
//#region extensions/discord/src/monitor/native-command-model-picker-interaction.ts
|
|
3242
3273
|
function resolveModelPickerSelectionValue(interaction) {
|
|
3243
3274
|
return normalizeOptionalString(interaction.values?.[0]) ?? null;
|
|
3244
3275
|
}
|
|
@@ -3601,7 +3632,8 @@ function createDiscordModelPickerFallbackSelect$1(params) {
|
|
|
3601
3632
|
}
|
|
3602
3633
|
};
|
|
3603
3634
|
}
|
|
3604
|
-
|
|
3635
|
+
//#endregion
|
|
3636
|
+
//#region extensions/discord/src/monitor/native-command.options.ts
|
|
3605
3637
|
const DISCORD_COMMAND_DESCRIPTION_MAX = 100;
|
|
3606
3638
|
function truncateDiscordCommandDescription(params) {
|
|
3607
3639
|
return truncateUtf16Safe(params.value, DISCORD_COMMAND_DESCRIPTION_MAX);
|
|
@@ -3667,7 +3699,8 @@ function buildDiscordCommandOptions(params) {
|
|
|
3667
3699
|
});
|
|
3668
3700
|
});
|
|
3669
3701
|
}
|
|
3670
|
-
|
|
3702
|
+
//#endregion
|
|
3703
|
+
//#region extensions/discord/src/monitor/native-command.ts
|
|
3671
3704
|
const log = createSubsystemLogger("discord/native-command");
|
|
3672
3705
|
const NON_PLUGIN_COMMAND_DISPATCH = Object.freeze({ kind: "non-plugin" });
|
|
3673
3706
|
function createNativeCommandDefinition(command) {
|
|
@@ -4134,7 +4167,8 @@ function bindDiscordCommandControl(createControl) {
|
|
|
4134
4167
|
const createDiscordCommandArgFallbackButton = bindDiscordCommandControl(createDiscordCommandArgFallbackButton$1);
|
|
4135
4168
|
const createDiscordModelPickerFallbackButton = bindDiscordCommandControl(createDiscordModelPickerFallbackButton$1);
|
|
4136
4169
|
const createDiscordModelPickerFallbackSelect = bindDiscordCommandControl(createDiscordModelPickerFallbackSelect$1);
|
|
4137
|
-
|
|
4170
|
+
//#endregion
|
|
4171
|
+
//#region extensions/discord/src/monitor/agent-components-reply.ts
|
|
4138
4172
|
async function replySilently(interaction, params, onError) {
|
|
4139
4173
|
try {
|
|
4140
4174
|
await interaction.reply(params);
|
|
@@ -4142,7 +4176,8 @@ async function replySilently(interaction, params, onError) {
|
|
|
4142
4176
|
onError?.(error);
|
|
4143
4177
|
}
|
|
4144
4178
|
}
|
|
4145
|
-
|
|
4179
|
+
//#endregion
|
|
4180
|
+
//#region extensions/discord/src/activities/interaction.ts
|
|
4146
4181
|
const REGISTRATION_WIDGET_ID = "AAAAAAAAAAAAAAAAAAAAAA";
|
|
4147
4182
|
const PENDING_LAUNCH_WRITE_BUDGET_MS = 250;
|
|
4148
4183
|
function createActivityButton(ctx) {
|
|
@@ -4192,7 +4227,8 @@ function createDiscordActivityButton(ctx, applicationId) {
|
|
|
4192
4227
|
if (!runtime.resolveAccount(ctx.accountId, ctx.cfg)) return null;
|
|
4193
4228
|
return createActivityButton(ctx);
|
|
4194
4229
|
}
|
|
4195
|
-
|
|
4230
|
+
//#endregion
|
|
4231
|
+
//#region extensions/discord/src/internal/gateway-close-codes.ts
|
|
4196
4232
|
const fatalGatewayCloseCodes = /* @__PURE__ */ new Set([
|
|
4197
4233
|
GatewayCloseCodes.AuthenticationFailed,
|
|
4198
4234
|
GatewayCloseCodes.InvalidShard,
|
|
@@ -4213,7 +4249,8 @@ function isFatalGatewayCloseCode(code) {
|
|
|
4213
4249
|
function canResumeAfterGatewayClose(code) {
|
|
4214
4250
|
return !nonResumableGatewayCloseCodes.has(code);
|
|
4215
4251
|
}
|
|
4216
|
-
|
|
4252
|
+
//#endregion
|
|
4253
|
+
//#region extensions/discord/src/internal/gateway-identify-limiter.ts
|
|
4217
4254
|
const IDENTIFY_WINDOW_MS = 5e3;
|
|
4218
4255
|
var GatewayIdentifyLimiter = class {
|
|
4219
4256
|
async wait() {
|
|
@@ -4230,7 +4267,8 @@ var GatewayIdentifyLimiter = class {
|
|
|
4230
4267
|
}
|
|
4231
4268
|
};
|
|
4232
4269
|
const sharedGatewayIdentifyLimiter = new GatewayIdentifyLimiter();
|
|
4233
|
-
|
|
4270
|
+
//#endregion
|
|
4271
|
+
//#region extensions/discord/src/internal/gateway-payload.ts
|
|
4234
4272
|
function ensureGatewayParams(url) {
|
|
4235
4273
|
const parsed = new URL(url);
|
|
4236
4274
|
parsed.searchParams.set("v", parsed.searchParams.get("v") ?? "10");
|
|
@@ -4245,7 +4283,8 @@ function decodeGatewayMessage(incoming) {
|
|
|
4245
4283
|
return null;
|
|
4246
4284
|
}
|
|
4247
4285
|
}
|
|
4248
|
-
|
|
4286
|
+
//#endregion
|
|
4287
|
+
//#region extensions/discord/src/internal/gateway-rate-limit.ts
|
|
4249
4288
|
const GATEWAY_SEND_LIMIT = 120;
|
|
4250
4289
|
const GATEWAY_SEND_WINDOW_MS = 6e4;
|
|
4251
4290
|
const GATEWAY_SEND_QUEUE_LIMIT = GATEWAY_SEND_LIMIT;
|
|
@@ -4331,7 +4370,8 @@ var GatewaySendLimiter = class {
|
|
|
4331
4370
|
this.scheduleFlush();
|
|
4332
4371
|
}
|
|
4333
4372
|
};
|
|
4334
|
-
|
|
4373
|
+
//#endregion
|
|
4374
|
+
//#region extensions/discord/src/internal/gateway-voice-state-cache.ts
|
|
4335
4375
|
var DiscordGatewayVoiceStateCache = class {
|
|
4336
4376
|
constructor() {
|
|
4337
4377
|
this.statesByGuild = /* @__PURE__ */ new Map();
|
|
@@ -4404,7 +4444,8 @@ var DiscordGatewayVoiceStateCache = class {
|
|
|
4404
4444
|
}
|
|
4405
4445
|
}
|
|
4406
4446
|
};
|
|
4407
|
-
|
|
4447
|
+
//#endregion
|
|
4448
|
+
//#region extensions/discord/src/internal/gateway.ts
|
|
4408
4449
|
const GatewayIntents = GatewayIntentBits;
|
|
4409
4450
|
const READY_STATE_OPEN = 1;
|
|
4410
4451
|
const DEFAULT_GATEWAY_URL = "wss://gateway.discord.gg/";
|
|
@@ -4722,7 +4763,8 @@ var GatewayPlugin = class {
|
|
|
4722
4763
|
}, true);
|
|
4723
4764
|
}
|
|
4724
4765
|
};
|
|
4725
|
-
|
|
4766
|
+
//#endregion
|
|
4767
|
+
//#region extensions/discord/src/voice/session.ts
|
|
4726
4768
|
const MIN_SEGMENT_SECONDS = .35;
|
|
4727
4769
|
const CAPTURE_FINALIZE_GRACE_MS = 2e3;
|
|
4728
4770
|
const VOICE_CONNECT_READY_TIMEOUT_MS = 3e4;
|
|
@@ -4739,7 +4781,8 @@ function logVoiceVerbose(message) {
|
|
|
4739
4781
|
function isVoiceChannel(type) {
|
|
4740
4782
|
return type === discord_exports.ChannelType.GuildVoice || type === discord_exports.ChannelType.GuildStageVoice;
|
|
4741
4783
|
}
|
|
4742
|
-
|
|
4784
|
+
//#endregion
|
|
4785
|
+
//#region extensions/discord/src/voice/command.ts
|
|
4743
4786
|
const VOICE_CHANNEL_TYPES = [ChannelType.GuildVoice, ChannelType.GuildStageVoice];
|
|
4744
4787
|
const DISCORD_VOICE_COMMAND_SPEC = {
|
|
4745
4788
|
name: "vc",
|
|
@@ -4904,7 +4947,8 @@ function createDiscordVoiceCommand(startupParams) {
|
|
|
4904
4947
|
}
|
|
4905
4948
|
}();
|
|
4906
4949
|
}
|
|
4907
|
-
|
|
4950
|
+
//#endregion
|
|
4951
|
+
//#region extensions/discord/src/monitor/agent-components-context.ts
|
|
4908
4952
|
function resolveAgentComponentRoute(params) {
|
|
4909
4953
|
return resolveAgentRoute({
|
|
4910
4954
|
cfg: params.ctx.cfg,
|
|
@@ -4985,7 +5029,8 @@ async function resolveComponentInteractionContext(params) {
|
|
|
4985
5029
|
memberRoleIds: Array.isArray(interaction.rawData.member?.roles) ? interaction.rawData.member.roles.slice() : []
|
|
4986
5030
|
};
|
|
4987
5031
|
}
|
|
4988
|
-
|
|
5032
|
+
//#endregion
|
|
5033
|
+
//#region extensions/discord/src/monitor/agent-components-data.ts
|
|
4989
5034
|
function readParsedId(data, key) {
|
|
4990
5035
|
if (!data || typeof data !== "object") return;
|
|
4991
5036
|
return key in data ? data[key] : data[key === "cid" ? "componentId" : "modalId"];
|
|
@@ -5072,7 +5117,8 @@ function formatModalSubmissionText(entry, interaction) {
|
|
|
5072
5117
|
});
|
|
5073
5118
|
return [title, ...lines.length > 0 ? lines : ["- (no values)"]].join("\n");
|
|
5074
5119
|
}
|
|
5075
|
-
|
|
5120
|
+
//#endregion
|
|
5121
|
+
//#region extensions/discord/src/monitor/agent-components-live-policy.ts
|
|
5076
5122
|
async function resolveAgentComponentPolicyContext(params) {
|
|
5077
5123
|
if (!params.ctx.readPolicy) return params.ctx;
|
|
5078
5124
|
try {
|
|
@@ -5092,7 +5138,8 @@ async function resolveAgentComponentPolicyContext(params) {
|
|
|
5092
5138
|
throw error;
|
|
5093
5139
|
}
|
|
5094
5140
|
}
|
|
5095
|
-
|
|
5141
|
+
//#endregion
|
|
5142
|
+
//#region extensions/discord/src/monitor/agent-components-dm-auth.ts
|
|
5096
5143
|
async function ensureDmComponentAuthorized(params) {
|
|
5097
5144
|
const { ctx, interaction, user, componentLabel } = params;
|
|
5098
5145
|
const dmPolicy = ctx.dmPolicy ?? "pairing";
|
|
@@ -5193,7 +5240,8 @@ async function resolveInteractionContextWithDmAuth(params) {
|
|
|
5193
5240
|
})) return null;
|
|
5194
5241
|
return interactionCtx;
|
|
5195
5242
|
}
|
|
5196
|
-
|
|
5243
|
+
//#endregion
|
|
5244
|
+
//#region extensions/discord/src/monitor/agent-components-guild-auth.ts
|
|
5197
5245
|
function resolveComponentGuildContext(params) {
|
|
5198
5246
|
const guildInfo = resolveDiscordGuildEntry({
|
|
5199
5247
|
guild: params.interaction.guild ?? void 0,
|
|
@@ -5361,7 +5409,8 @@ async function resolveAuthorizedComponentInteraction(params) {
|
|
|
5361
5409
|
commandAuthorized
|
|
5362
5410
|
};
|
|
5363
5411
|
}
|
|
5364
|
-
|
|
5412
|
+
//#endregion
|
|
5413
|
+
//#region extensions/discord/src/monitor/reply-context.ts
|
|
5365
5414
|
function resolveReplyContext(message, resolveDiscordMessageText) {
|
|
5366
5415
|
const id = resolveDiscordReferencedReplyMessageId(message);
|
|
5367
5416
|
if (!id) return null;
|
|
@@ -5392,7 +5441,8 @@ function buildGuildLabel(params) {
|
|
|
5392
5441
|
const { guild, channelName, channelId } = params;
|
|
5393
5442
|
return `${guild?.name ?? "Guild"} #${channelName} channel id:${channelId}`;
|
|
5394
5443
|
}
|
|
5395
|
-
|
|
5444
|
+
//#endregion
|
|
5445
|
+
//#region extensions/discord/src/monitor/reply-safety.ts
|
|
5396
5446
|
const DISCORD_INTERNAL_CHANNEL_LINE_RE = /^(?:>\s*)?(?:analysis|commentary|thinking|reasoning)\s*[:=]/i;
|
|
5397
5447
|
function hasNonEmptyRecord(value) {
|
|
5398
5448
|
return Boolean(value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0);
|
|
@@ -5439,7 +5489,8 @@ function sanitizeDiscordFrontChannelReplyPayloads(payloads, options = {}) {
|
|
|
5439
5489
|
}
|
|
5440
5490
|
return safePayloads;
|
|
5441
5491
|
}
|
|
5442
|
-
|
|
5492
|
+
//#endregion
|
|
5493
|
+
//#region extensions/discord/src/monitor/reply-delivery.ts
|
|
5443
5494
|
function formatDiscordReplyContext(target, sessionKey) {
|
|
5444
5495
|
return `target=${target}${sessionKey ? ` session=${sessionKey}` : ""}`;
|
|
5445
5496
|
}
|
|
@@ -5549,9 +5600,10 @@ async function deliverDiscordReply(params) {
|
|
|
5549
5600
|
if (send.status === "partial_failed") throw createChannelPartialDeliveryError(send.error, deliveryResult);
|
|
5550
5601
|
return deliveryResult;
|
|
5551
5602
|
}
|
|
5552
|
-
|
|
5603
|
+
//#endregion
|
|
5604
|
+
//#region extensions/discord/src/monitor/agent-components.dispatch.ts
|
|
5553
5605
|
const loadReplyRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/reply-runtime"));
|
|
5554
|
-
const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-
|
|
5606
|
+
const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-CNlSKY5S.mjs").then((n) => n.n));
|
|
5555
5607
|
function buildDiscordComponentConversationLabel(params) {
|
|
5556
5608
|
if (params.interactionCtx.isDirectMessage) return buildDirectLabel(params.interactionCtx.user);
|
|
5557
5609
|
if (params.interactionCtx.isGroupDm) return `Group DM #${params.channelCtx.channelName ?? params.interactionCtx.channelId} channel id:${params.interactionCtx.channelId}`;
|
|
@@ -5785,7 +5837,8 @@ async function dispatchDiscordComponentEvent(params) {
|
|
|
5785
5837
|
}
|
|
5786
5838
|
});
|
|
5787
5839
|
}
|
|
5788
|
-
|
|
5840
|
+
//#endregion
|
|
5841
|
+
//#region extensions/discord/src/interactive-dispatch.ts
|
|
5789
5842
|
const dispatchDiscordInteractive = createChannelInteractiveDispatcher({
|
|
5790
5843
|
channel: "discord",
|
|
5791
5844
|
interactiveKey: "interaction"
|
|
@@ -5796,7 +5849,8 @@ async function dispatchDiscordPluginInteractiveHandler(params) {
|
|
|
5796
5849
|
dedupeId: params.interactionId
|
|
5797
5850
|
});
|
|
5798
5851
|
}
|
|
5799
|
-
|
|
5852
|
+
//#endregion
|
|
5853
|
+
//#region extensions/discord/src/monitor/agent-components.plugin-interactive.ts
|
|
5800
5854
|
const loadConversationRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-runtime"));
|
|
5801
5855
|
async function dispatchPluginDiscordInteractiveEvent(params) {
|
|
5802
5856
|
const normalizedConversationId = params.interactionCtx.rawGuildId || params.channelCtx.channelType === ChannelType.GroupDM ? `channel:${params.interactionCtx.channelId}` : `user:${params.interactionCtx.userId}`;
|
|
@@ -5908,7 +5962,8 @@ async function dispatchPluginDiscordInteractiveEvent(params) {
|
|
|
5908
5962
|
}
|
|
5909
5963
|
return "unmatched";
|
|
5910
5964
|
}
|
|
5911
|
-
|
|
5965
|
+
//#endregion
|
|
5966
|
+
//#region extensions/discord/src/monitor/agent-components.system-controls.ts
|
|
5912
5967
|
const AGENT_BUTTON_KEY = "agent";
|
|
5913
5968
|
const AGENT_SELECT_KEY = "agentsel";
|
|
5914
5969
|
async function runAgentSystemControlInteraction(params) {
|
|
@@ -5988,8 +6043,9 @@ function createAgentSelectMenu(ctx) {
|
|
|
5988
6043
|
}
|
|
5989
6044
|
};
|
|
5990
6045
|
}
|
|
5991
|
-
|
|
5992
|
-
|
|
6046
|
+
//#endregion
|
|
6047
|
+
//#region extensions/discord/src/monitor/agent-components.ts
|
|
6048
|
+
const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-YCvQ6YLS.mjs").then((n) => n.t));
|
|
5993
6049
|
async function resolveAuthorizedComponentEntry(params) {
|
|
5994
6050
|
const entry = params.entry ?? await params.resolve(false);
|
|
5995
6051
|
if (!entry) {
|
|
@@ -6243,7 +6299,8 @@ function createDiscordComponentButton(ctx) {
|
|
|
6243
6299
|
}
|
|
6244
6300
|
const createAgentComponentControls = [createAgentComponentButton, createAgentSelectMenu];
|
|
6245
6301
|
const createDiscordComponentControls = [createDiscordComponentButton, ...SELECT_CONTROLS.map((spec) => (ctx) => createDiscordComponentSelectControl(spec, ctx))];
|
|
6246
|
-
|
|
6302
|
+
//#endregion
|
|
6303
|
+
//#region extensions/discord/src/monitor/exec-approvals.ts
|
|
6247
6304
|
function resolveTerminalLabel(approval) {
|
|
6248
6305
|
if (approval.status === "allowed" || approval.status === "denied") return formatApprovalDecisionLabel(approval.decision);
|
|
6249
6306
|
return approval.status === "expired" ? "Expired" : "Cancelled";
|
|
@@ -6372,7 +6429,8 @@ function createDiscordExecApprovalButtonContext(params) {
|
|
|
6372
6429
|
}
|
|
6373
6430
|
};
|
|
6374
6431
|
}
|
|
6375
|
-
|
|
6432
|
+
//#endregion
|
|
6433
|
+
//#region extensions/discord/src/monitor/gateway-supervisor.ts
|
|
6376
6434
|
var DiscordGatewayLifecycleError = class extends Error {
|
|
6377
6435
|
constructor(event) {
|
|
6378
6436
|
super(`discord gateway ${event.type}: ${event.message}`, { cause: event.err instanceof Error ? event.err : void 0 });
|
|
@@ -6478,7 +6536,8 @@ function createDiscordGatewaySupervisor(params) {
|
|
|
6478
6536
|
}
|
|
6479
6537
|
};
|
|
6480
6538
|
}
|
|
6481
|
-
|
|
6539
|
+
//#endregion
|
|
6540
|
+
//#region extensions/discord/src/monitor/provider.commands.ts
|
|
6482
6541
|
const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
|
|
6483
6542
|
async function resolveDiscordProviderCommandSpecs(params) {
|
|
6484
6543
|
const maxDiscordCommands = 100;
|
|
@@ -6524,7 +6583,8 @@ async function resolveDiscordProviderCommandSpecs(params) {
|
|
|
6524
6583
|
if (params.nativeEnabled && commandSpecs.length > maxDiscordCommands) params.runtime.log?.(warn(`${commandSpecs.length} commands exceed the ${maxDiscordCommands}-command Discord limit; some commands may fail to deploy.`));
|
|
6525
6584
|
return { commandSpecs };
|
|
6526
6585
|
}
|
|
6527
|
-
|
|
6586
|
+
//#endregion
|
|
6587
|
+
//#region extensions/discord/src/monitor/provider.deploy-errors.ts
|
|
6528
6588
|
const DISCORD_DEPLOY_REJECTED_ENTRY_LIMIT = 3;
|
|
6529
6589
|
function stringifyDiscordDeployField(value, depth = 2) {
|
|
6530
6590
|
try {
|
|
@@ -6633,7 +6693,8 @@ function formatDiscordDeployErrorDetails(err) {
|
|
|
6633
6693
|
function isDiscordDeployDailyCreateLimit(err) {
|
|
6634
6694
|
return err instanceof DiscordError && err.discordCode === 30034 && /daily application command creates/i.test(err.message);
|
|
6635
6695
|
}
|
|
6636
|
-
|
|
6696
|
+
//#endregion
|
|
6697
|
+
//#region extensions/discord/src/monitor/provider.deploy.ts
|
|
6637
6698
|
function runDiscordCommandDeployInBackground(params) {
|
|
6638
6699
|
if (!params.enabled) return;
|
|
6639
6700
|
async function deployDiscordCommands() {
|
|
@@ -6657,9 +6718,11 @@ function runDiscordCommandDeployInBackground(params) {
|
|
|
6657
6718
|
params.runtime.log?.(warn(`[${params.accountId}] slash command deploy failed in background (message send/receive unaffected): ${formatErrorMessage$1(err)}`));
|
|
6658
6719
|
});
|
|
6659
6720
|
}
|
|
6660
|
-
|
|
6721
|
+
//#endregion
|
|
6722
|
+
//#region extensions/discord/src/monitor/gateway-handle.ts
|
|
6661
6723
|
const DISCORD_GATEWAY_TRANSPORT_ACTIVITY_EVENT = "openclaw:discord-gateway-transport-activity";
|
|
6662
|
-
|
|
6724
|
+
//#endregion
|
|
6725
|
+
//#region extensions/discord/src/monitor/status.ts
|
|
6663
6726
|
/** READY proves a prior terminal failure was repaired, so the account is restartable again. */
|
|
6664
6727
|
function createDiscordReadyStatusPatch(at = Date.now()) {
|
|
6665
6728
|
return channelReadyPatch({
|
|
@@ -6668,7 +6731,8 @@ function createDiscordReadyStatusPatch(at = Date.now()) {
|
|
|
6668
6731
|
lastDisconnect: null
|
|
6669
6732
|
});
|
|
6670
6733
|
}
|
|
6671
|
-
|
|
6734
|
+
//#endregion
|
|
6735
|
+
//#region extensions/discord/src/monitor/provider.lifecycle.ts
|
|
6672
6736
|
const DEFAULT_DISCORD_GATEWAY_READY_TIMEOUT_MS = 15e3;
|
|
6673
6737
|
const DEFAULT_DISCORD_GATEWAY_RUNTIME_READY_TIMEOUT_MS = 3e4;
|
|
6674
6738
|
const MAX_DISCORD_GATEWAY_READY_TIMEOUT_MS = 12e4;
|
|
@@ -6957,7 +7021,8 @@ async function runDiscordGatewayLifecycle(params) {
|
|
|
6957
7021
|
}
|
|
6958
7022
|
}
|
|
6959
7023
|
}
|
|
6960
|
-
|
|
7024
|
+
//#endregion
|
|
7025
|
+
//#region extensions/discord/src/internal/voice.ts
|
|
6961
7026
|
var VoicePlugin = class {
|
|
6962
7027
|
constructor() {
|
|
6963
7028
|
this.id = "voice";
|
|
@@ -6991,7 +7056,8 @@ var VoicePlugin = class {
|
|
|
6991
7056
|
};
|
|
6992
7057
|
}
|
|
6993
7058
|
};
|
|
6994
|
-
|
|
7059
|
+
//#endregion
|
|
7060
|
+
//#region extensions/discord/src/monitor/presence.ts
|
|
6995
7061
|
const DEFAULT_CUSTOM_ACTIVITY_TYPE = 4;
|
|
6996
7062
|
const CUSTOM_STATUS_NAME = "Custom Status";
|
|
6997
7063
|
function resolveDiscordPresenceUpdate(config) {
|
|
@@ -7020,7 +7086,8 @@ function resolveDiscordPresenceUpdate(config) {
|
|
|
7020
7086
|
afk: false
|
|
7021
7087
|
};
|
|
7022
7088
|
}
|
|
7023
|
-
|
|
7089
|
+
//#endregion
|
|
7090
|
+
//#region extensions/discord/src/monitor/auto-presence.ts
|
|
7024
7091
|
const DEFAULT_INTERVAL_MS = 3e4;
|
|
7025
7092
|
const DEFAULT_MIN_UPDATE_INTERVAL_MS = 15e3;
|
|
7026
7093
|
const MIN_INTERVAL_MS = 5e3;
|
|
@@ -7113,7 +7180,8 @@ function createDiscordAutoPresenceController(params) {
|
|
|
7113
7180
|
stop: () => scheduler.stop()
|
|
7114
7181
|
};
|
|
7115
7182
|
}
|
|
7116
|
-
|
|
7183
|
+
//#endregion
|
|
7184
|
+
//#region extensions/discord/src/monitor/gateway-metadata.ts
|
|
7117
7185
|
const DISCORD_GATEWAY_BOT_URL = "https://discord.com/api/v10/gateway/bot";
|
|
7118
7186
|
const DISCORD_API_HOST = "discord.com";
|
|
7119
7187
|
const DEFAULT_DISCORD_GATEWAY_URL = "wss://gateway.discord.gg/";
|
|
@@ -7266,7 +7334,8 @@ async function fetchDiscordGatewayMetadataGuarded(input, init, options) {
|
|
|
7266
7334
|
}).catch(() => {});
|
|
7267
7335
|
return response;
|
|
7268
7336
|
}
|
|
7269
|
-
|
|
7337
|
+
//#endregion
|
|
7338
|
+
//#region extensions/discord/src/monitor/gateway-plugin.ts
|
|
7270
7339
|
const DISCORD_GATEWAY_POLICY_VIOLATION_CLOSE_CODE = 1008;
|
|
7271
7340
|
const DISCORD_GATEWAY_WS_RECEIVER_LIMIT_CODE = "WS_ERR_TOO_MANY_BUFFERED_PARTS";
|
|
7272
7341
|
const DISCORD_GATEWAY_CLOSE_REASON_LOG_MAX_CHARS = 240;
|
|
@@ -7471,7 +7540,8 @@ function waitForDiscordGatewayPluginRegistration(plugin) {
|
|
|
7471
7540
|
if (typeof plugin !== "object" || plugin === null) return;
|
|
7472
7541
|
return registrationPromises.get(plugin);
|
|
7473
7542
|
}
|
|
7474
|
-
|
|
7543
|
+
//#endregion
|
|
7544
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-channel-access.ts
|
|
7475
7545
|
function resolveDiscordPreflightChannelAccess(params) {
|
|
7476
7546
|
if (params.isGuildMessage && params.channelConfig?.enabled === false) {
|
|
7477
7547
|
logVerbose(`Blocked discord channel ${params.messageChannelId} (channel disabled, ${params.channelMatchMeta})`);
|
|
@@ -7503,7 +7573,8 @@ function resolveDiscordPreflightChannelAccess(params) {
|
|
|
7503
7573
|
}
|
|
7504
7574
|
return true;
|
|
7505
7575
|
}
|
|
7506
|
-
|
|
7576
|
+
//#endregion
|
|
7577
|
+
//#region extensions/discord/src/monitor/listeners.guild-join.ts
|
|
7507
7578
|
const DISCORD_GUILD_JOIN_INTRO_MAX_AGE_MS = 3e5;
|
|
7508
7579
|
var DiscordGuildJoinIntroductionListener = class extends GuildCreateListener {
|
|
7509
7580
|
constructor(params) {
|
|
@@ -7627,7 +7698,8 @@ var DiscordGuildJoinIntroductionListener = class extends GuildCreateListener {
|
|
|
7627
7698
|
await Promise.allSettled(this.pendingReports);
|
|
7628
7699
|
}
|
|
7629
7700
|
};
|
|
7630
|
-
|
|
7701
|
+
//#endregion
|
|
7702
|
+
//#region extensions/discord/src/monitor/provider.startup.ts
|
|
7631
7703
|
async function createDiscordMonitorClient(params) {
|
|
7632
7704
|
let autoPresenceController = null;
|
|
7633
7705
|
const gateway = createDiscordGatewayPlugin(params);
|
|
@@ -7766,7 +7838,8 @@ function registerDiscordMonitorListeners(params) {
|
|
|
7766
7838
|
}
|
|
7767
7839
|
};
|
|
7768
7840
|
}
|
|
7769
|
-
|
|
7841
|
+
//#endregion
|
|
7842
|
+
//#region extensions/discord/src/monitor/questions.ts
|
|
7770
7843
|
function createDiscordQuestionButton(params) {
|
|
7771
7844
|
const authContext = params.authContext ?? {
|
|
7772
7845
|
cfg: params.cfg,
|
|
@@ -7816,13 +7889,15 @@ function createDiscordQuestionButton(params) {
|
|
|
7816
7889
|
}
|
|
7817
7890
|
};
|
|
7818
7891
|
}
|
|
7819
|
-
|
|
7892
|
+
//#endregion
|
|
7893
|
+
//#region extensions/discord/src/monitor/startup-status.ts
|
|
7820
7894
|
function formatDiscordStartupStatusMessage(params) {
|
|
7821
7895
|
const identitySuffix = params.botIdentity ? ` as ${params.botIdentity}` : "";
|
|
7822
7896
|
if (params.gatewayReady) return `logged in to discord${identitySuffix}`;
|
|
7823
7897
|
return `discord client initialized${identitySuffix}; awaiting gateway readiness`;
|
|
7824
7898
|
}
|
|
7825
|
-
|
|
7899
|
+
//#endregion
|
|
7900
|
+
//#region extensions/discord/src/monitor/provider.ts
|
|
7826
7901
|
const DEFAULT_DISCORD_MEDIA_MAX_MB = 100;
|
|
7827
7902
|
const DISCORD_ACP_STATUS_PROBE_TIMEOUT_MS = 8e3;
|
|
7828
7903
|
const DISCORD_ACP_STALE_RUNNING_ACTIVITY_MS = 12e4;
|
|
@@ -7883,7 +7958,7 @@ async function monitorDiscordProvider(opts) {
|
|
|
7883
7958
|
cfg,
|
|
7884
7959
|
accountId: account.accountId
|
|
7885
7960
|
}) ?? "pairing";
|
|
7886
|
-
const discordProviderSessionRuntime = await import("./provider-session.runtime-
|
|
7961
|
+
const discordProviderSessionRuntime = await import("./provider-session.runtime-Dr_5X43t.mjs");
|
|
7887
7962
|
const threadBindingIdleTimeoutMs = discordProviderSessionRuntime.resolveThreadBindingIdleTimeoutMs({
|
|
7888
7963
|
channelIdleHoursRaw: discordCfg.threadBindings?.idleHours,
|
|
7889
7964
|
sessionIdleHoursRaw: cfg.session?.threadBindings?.idleHours
|
|
@@ -8194,8 +8269,8 @@ async function monitorDiscordProvider(opts) {
|
|
|
8194
8269
|
};
|
|
8195
8270
|
let voiceManager = null;
|
|
8196
8271
|
if (voiceEnabled) {
|
|
8197
|
-
const { DiscordVoiceManager } = await import("./voice-runtime-
|
|
8198
|
-
const { DiscordVoiceGuildCreateListener, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener } = await import("./listeners-
|
|
8272
|
+
const { DiscordVoiceManager } = await import("./voice-runtime-B7V_LTdX.mjs");
|
|
8273
|
+
const { DiscordVoiceGuildCreateListener, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener } = await import("./listeners-Df8lx3vK.mjs");
|
|
8199
8274
|
voiceManager = new DiscordVoiceManager({
|
|
8200
8275
|
...monitorOptions,
|
|
8201
8276
|
scheduler
|
|
@@ -8291,4 +8366,5 @@ async function monitorDiscordProvider(opts) {
|
|
|
8291
8366
|
}
|
|
8292
8367
|
}
|
|
8293
8368
|
}
|
|
8369
|
+
//#endregion
|
|
8294
8370
|
export { resolveDiscordTextCommandAccess as A, buildDiscordInboundAccessContext as C, createMessageDispatchData as D, createDiscordLivePolicyReader as E, registerDiscordListener as O, buildDiscordGroupSystemPrompt as S, handleDiscordDmCommandDecision as T, isDiscordRealtimeVoiceMode as _, waitForDiscordGatewayPluginRegistration as a, resolveDiscordVoiceMode as b, formatDiscordReplySkip as c, buildGuildLabel as d, resolveReplyContext as f, VOICE_RECONNECT_GRACE_MS as g, VOICE_CONNECT_READY_TIMEOUT_MS as h, resolveDiscordGatewayIntents as i, resolveDiscordDmCommandAccess as k, sanitizeDiscordFrontChannelReplyPayloads as l, MIN_SEGMENT_SECONDS as m, resolveDiscordPreflightChannelAccess as n, deliverDiscordReply as o, CAPTURE_FINALIZE_GRACE_MS as p, createDiscordGatewayPlugin as r, formatDiscordReplyDeliveryFailure as s, monitorDiscordProvider as t, buildDirectLabel as u, isVoiceChannel as v, createDiscordSupplementalContextAccessChecker as w, createDiscordNativeCommand as x, logVoiceVerbose as y };
|