@openclaw/discord 2026.11.1 → 2026.11.3
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-X_Xlr42B.mjs → account-inspect-8cCu6uPG.mjs} +3 -2
- package/dist/.setup/{accounts-C18HNgge.mjs → accounts-ljrzXBJi.mjs} +8 -4
- package/dist/.setup/{active-turn-thread-route-BAc_Xik-.mjs → active-turn-thread-route-C4tp9noA.mjs} +2 -1
- package/dist/.setup/{allow-list-D1ZGfhXh.mjs → allow-list-BKqOldGy.mjs} +11 -6
- package/dist/.setup/{api-Bth1wKF9.mjs → api-DqmMUZau.mjs} +5 -3
- package/dist/.setup/{approval-handler.runtime-krznjTz9.mjs → approval-handler.runtime-D0qu1um7.mjs} +9 -8
- package/dist/.setup/{approval-message-updates-Cks-MSCJ.mjs → approval-message-updates-CdurC9Ej.mjs} +4 -3
- package/dist/.setup/{audit-Dw_rAZIz.mjs → audit-ChorIwio.mjs} +7 -6
- package/dist/.setup/{channel-DwvRHJL0.mjs → channel-ZilgdF5e.mjs} +41 -33
- package/dist/.setup/{channel-access-BPrWoEXM.mjs → channel-access-DasWY_OV.mjs} +2 -1
- package/dist/.setup/{channel.setup-BHjvtK1U.mjs → channel.setup-DaDQdctj.mjs} +12 -8
- 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-BvOWSPxr.mjs → components-Du9NhD8h.mjs} +20 -11
- package/dist/.setup/{config-schema-Coyq5wOr.mjs → config-schema-_uBILpQf.mjs} +5 -3
- package/dist/.setup/{conversation-binding-route-DOPUZNYo.mjs → conversation-binding-route-8Ul1KpGF.mjs} +3 -2
- package/dist/.setup/{directory-config-CIqVnQtn.mjs → directory-config-3iVub-3m.mjs} +4 -3
- package/dist/.setup/{directory-live-DUuPEWub.mjs → directory-live-BDVl2DoC.mjs} +15 -14
- package/dist/.setup/{discord-eFlHX1Gn.mjs → discord-BMD-JiVS.mjs} +68 -35
- package/dist/.setup/{doctor-contract-Dstl3cMg.mjs → doctor-contract-Bwv8EuQ_.mjs} +3 -2
- package/dist/.setup/{doctor-Cg_N6ZOI.mjs → doctor-hQKbkNKq.mjs} +9 -8
- package/dist/.setup/{handle-action-DXY91jF-.mjs → handle-action-B1lmt4ms.mjs} +11 -10
- package/dist/.setup/{handle-action.guild-admin-BvBCfhXF.mjs → handle-action.guild-admin-B6g31cwt.mjs} +4 -3
- package/dist/.setup/{live-policy-config-DO1Fk2hp.mjs → live-policy-config-C_Q966Wh.mjs} +5 -3
- package/dist/.setup/{message-handler-TR7l1P3P.mjs → message-handler-CkI3yMjL.mjs} +16 -11
- package/dist/.setup/{message-handler.preflight-DxGb4zsm.mjs → message-handler.preflight-CEfkFV9U.mjs} +28 -20
- package/dist/.setup/{message-handler.preflight-pluralkit-BTE5JebL.mjs → message-handler.preflight-pluralkit-D5si80_L.mjs} +14 -10
- package/dist/.setup/{message-handler.process-DVHZKc2e.mjs → message-handler.process-DsMtetRf.mjs} +47 -33
- package/dist/.setup/{outbound-adapter-DWyAWBFh.mjs → outbound-adapter-DfAanoCO.mjs} +19 -13
- package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-BtUpGBTb.mjs} +32 -21
- 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-CwtPIsvk.mjs → preflight-audio-wWgsZG5F.mjs} +2 -1
- package/dist/.setup/{presence-cache-CgutE4NN.mjs → presence-cache-DCeTsL73.mjs} +2 -1
- package/dist/.setup/{probe-DNge7OEP.mjs → probe-CBaoCs-c.mjs} +6 -5
- package/dist/.setup/{provider-C61K7HHq.mjs → provider-CI_OLfvz.mjs} +209 -119
- package/dist/.setup/{provider-session.runtime-D87e36ut.mjs → provider-session.runtime-TWOo_JZx.mjs} +3 -3
- package/dist/.setup/provider.runtime-DnionCyo.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-D1YHKwbc.mjs → realtime-session.runtime-DvfS4vJj.mjs} +23 -14
- package/dist/.setup/{receive-recovery-C77CVdGM.mjs → receive-recovery-CKvaG2Hf.mjs} +6 -3
- package/dist/.setup/{resolve-allowlist-common-CI77288n.mjs → resolve-allowlist-common-cIjtqh2F.mjs} +7 -5
- package/dist/.setup/{resolve-channels-DYc6-xgV.mjs → resolve-channels-Cj5i7hzj.mjs} +10 -7
- package/dist/.setup/{resolve-users-BQT7XWF2.mjs → resolve-users-BQLbysRB.mjs} +5 -4
- package/dist/.setup/{rolldown-runtime-nwUcYXjP.mjs → rolldown-runtime-B4FMCO8f.mjs} +2 -1
- package/dist/.setup/{runtime-DcBvHOm1.mjs → runtime-DgnVQ7zW.mjs} +2 -1
- package/dist/.setup/{runtime-CI0UJqeS.mjs → runtime-RWnuJgWB.mjs} +35 -23
- package/dist/.setup/{runtime-doctor-migrations-BpV1jKk0.mjs → runtime-doctor-migrations-BPV-R4G9.mjs} +9 -5
- package/dist/.setup/{runtime-CcijhTJT.mjs → runtime-plifsKg9.mjs} +6 -4
- package/dist/.setup/{secret-config-contract-B7UlqVYr.mjs → secret-config-contract-z6FhbT8E.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-Cbq-IVsS.mjs → send-da6ENJ9f.mjs} +28 -18
- package/dist/.setup/{send.components-BV6ucNpJ.mjs → send.components-CWZUuGvA.mjs} +15 -10
- package/dist/.setup/{send.outbound-CGhBhzjQ.mjs → send.outbound-qZ3iK3Vq.mjs} +13 -9
- package/dist/.setup/{send.receipt-Dw-_r5Bx.mjs → send.receipt-C18khRYH.mjs} +16 -9
- package/dist/.setup/{send.shared-D4MioxW_.mjs → send.shared-CnlMgoqQ.mjs} +23 -14
- package/dist/.setup/{sender-identity-DrN5c4ec.mjs → sender-identity-DgbJykq0.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-D1QuM187.mjs +3 -0
- package/dist/.setup/{shared-_o59Fvrr.mjs → shared-CY5vJM48.mjs} +19 -15
- package/dist/.setup/{subagent-hooks-mQbDkvuD.mjs → subagent-hooks-CIu2TFz3.mjs} +4 -3
- package/dist/.setup/{system-events-2zc2eGfF.mjs → system-events-DCOLXkwS.mjs} +4 -3
- package/dist/.setup/{target-parsing-BiuhcK9Q.mjs → target-parsing-C-HyNxcE.mjs} +2 -1
- package/dist/.setup/{target-resolver-CAHeVfmZ.mjs → target-resolver-CApivu3G.mjs} +7 -6
- package/dist/.setup/targets-UWWZ6gF7.mjs +3 -0
- package/dist/.setup/{thread-binding-api-Drd4Zu-5.mjs → thread-binding-api-BDZJD4na.mjs} +2 -1
- package/dist/.setup/{thread-bindings-Dg7X_ZXP.mjs → thread-bindings-DcvT_JgI.mjs} +11 -8
- package/dist/.setup/{thread-bindings.manager-DCDYksah.mjs → thread-bindings.manager-5Sh7yedN.mjs} +20 -15
- package/dist/.setup/{thread-bindings.session-updates-C76plLS3.mjs → thread-bindings.session-updates-BMdJeJMc.mjs} +9 -5
- package/dist/.setup/{threading-BKn_OF3K.mjs → threading-CzjFeUSe.mjs} +9 -6
- package/dist/.setup/{timeouts-DTrUsJ_W.mjs → timeouts-CuNARfyw.mjs} +2 -1
- package/dist/.setup/{transcripts-source-BSorJ4AS.mjs → transcripts-source-8RDQrSVb.mjs} +32 -19
- package/dist/.setup/{typing-DAv4S2fI.mjs → typing-CNlSKY5S.mjs} +3 -2
- package/dist/.setup/{voice-runtime-B5m2Ryg8.mjs → voice-runtime-BsDILmAv.mjs} +55 -33
- package/dist/account-inspect-api.js +3 -2
- package/dist/action-runtime-api.js +2 -1
- package/dist/activities-api.js +20 -13
- package/dist/api.js +22 -21
- package/dist/channel-config-api.js +2 -1
- package/dist/channel-plugin-api.js +2 -1
- package/dist/contract-api.js +2 -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 +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/security-audit-contract-api.js +2 -1
- package/dist/security-contract-api.js +2 -1
- package/dist/session-key-api.js +2 -1
- package/dist/setup-entry.js +3 -2
- package/dist/setup-plugin-api.js +2 -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 +2 -1
- package/dist/transcripts-source-api.js +3 -2
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-xk5CVdoI.mjs +0 -1
- package/dist/.setup/setup-plugin-api-DGfQO4Ec.mjs +0 -2
- package/dist/.setup/targets-BaklhOqq.mjs +0 -3
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
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 { A as isDiscordThreadChannelType, D as getDiscordEndpointRuntime, E as assertDiscordEndpointGatewayUrl, 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 resolveTimestampMs, x as formatDiscordReactionEmoji, y as resolveGroupDmAllow } from "./allow-list-
|
|
3
|
-
import { B as validateDiscordProxyUrl, C as hasAnyChannelPermissionDiscord, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, y as canViewDiscordGuildChannel } from "./send.shared-
|
|
4
|
-
import { i as setPresence, t as clearPresences } from "./presence-cache-
|
|
5
|
-
import { $ as User, A as StringSelectMenu, D as Row, F as Plugin, K as hasDiscordV2Components, P as Client, Q as Message, R as RateLimitError, X as CommandWithSubcommands, Y as Command, Z as Guild, a as MessageCreateListener, c as PresenceUpdateListener, d as ThreadUpdateListener, et as BaseMessageInteractiveComponent, h as Modal, i as InteractionCreateListener, j as TextDisplay, k as Separator, l as ReadyListener, n as GuildCreateListener, o as MessageReactionAddListener, r as GuildDeleteListener, s as MessageReactionRemoveListener, t as discord_exports, u as ThreadDeleteListener, x as Container, y as Button } from "./discord-
|
|
6
|
-
import { v as chunkDiscordTextWithMode } from "./send.receipt-
|
|
7
|
-
import { a as isDiscordRateLimitResponseBody, s as summarizeDiscordResponseBody } from "./api-
|
|
8
|
-
import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-
|
|
9
|
-
import { s as formatMention, t as sendMessageDiscord } from "./send.outbound-
|
|
10
|
-
import { l as withAbortTimeout } from "./timeouts-
|
|
11
|
-
import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, d as buildDiscordComponentMessage, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-
|
|
12
|
-
import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-
|
|
13
|
-
import { t as getDiscordRuntime } from "./runtime-
|
|
14
|
-
import { n as getDiscordActivitiesRuntime } from "./runtime-
|
|
15
|
-
import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-
|
|
16
|
-
import { A as isDiscordExecApprovalClientEnabled, O as getDiscordExecApprovalApprovers, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, d as setDiscordChannelPolicyBindings, f as buildDiscordConversationRouteContext, g as resolveDiscordEffectiveRoute, m as resolveDiscordBoundConversationRoute, n as DISCORD_PRESENTATION_CAPABILITIES, p as buildDiscordRoutePeer, r as buildDiscordPresentationPayload, s as DISCORD_APPROVAL_ALLOWED_MENTIONS, v as resolveDiscordConversationIdentity } from "./outbound-session-route-
|
|
17
|
-
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-
|
|
18
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
19
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
20
|
-
import { a as isThreadArchived, n as getThreadBindingManager } from "./thread-bindings.manager-
|
|
21
|
-
import { n as resolveDiscordChannelInfoSafe, o as resolveDiscordChannelTopicSafe, r as resolveDiscordChannelNameSafe } from "./channel-access-
|
|
22
|
-
import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-
|
|
23
|
-
import { O as resolveDiscordReferencedReplyMessage, a as authorizeDiscordVoiceIngress, c as resolveDiscordVoiceEnabled, i as setDiscordTranscriptsVoiceManager, k as resolveDiscordReferencedReplyMessageId, l as resolveDiscordThreadLikeChannelContext, o as resolveDiscordVoiceAccess, u as resolveFetchedDiscordThreadLikeChannelContext } from "./transcripts-source-
|
|
24
|
-
import { t as resolveDiscordSenderIdentity } from "./sender-identity-
|
|
25
|
-
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-ljrzXBJi.mjs";
|
|
2
|
+
import { A as isDiscordThreadChannelType, D as getDiscordEndpointRuntime, E as assertDiscordEndpointGatewayUrl, 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 resolveTimestampMs, x as formatDiscordReactionEmoji, y as resolveGroupDmAllow } from "./allow-list-BKqOldGy.mjs";
|
|
3
|
+
import { B as validateDiscordProxyUrl, C as hasAnyChannelPermissionDiscord, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, y as canViewDiscordGuildChannel } from "./send.shared-CnlMgoqQ.mjs";
|
|
4
|
+
import { i as setPresence, t as clearPresences } from "./presence-cache-DCeTsL73.mjs";
|
|
5
|
+
import { $ as User, A as StringSelectMenu, D as Row, F as Plugin, K as hasDiscordV2Components, P as Client, Q as Message, R as RateLimitError, X as CommandWithSubcommands, Y as Command, Z as Guild, a as MessageCreateListener, c as PresenceUpdateListener, d as ThreadUpdateListener, et as BaseMessageInteractiveComponent, h as Modal, i as InteractionCreateListener, j as TextDisplay, k as Separator, l as ReadyListener, n as GuildCreateListener, o as MessageReactionAddListener, r as GuildDeleteListener, s as MessageReactionRemoveListener, t as discord_exports, u as ThreadDeleteListener, x as Container, y as Button } from "./discord-BMD-JiVS.mjs";
|
|
6
|
+
import { v as chunkDiscordTextWithMode } from "./send.receipt-C18khRYH.mjs";
|
|
7
|
+
import { a as isDiscordRateLimitResponseBody, s as summarizeDiscordResponseBody } from "./api-DqmMUZau.mjs";
|
|
8
|
+
import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-da6ENJ9f.mjs";
|
|
9
|
+
import { s as formatMention, t as sendMessageDiscord } from "./send.outbound-qZ3iK3Vq.mjs";
|
|
10
|
+
import { l as withAbortTimeout } from "./timeouts-CuNARfyw.mjs";
|
|
11
|
+
import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, d as buildDiscordComponentMessage, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-Du9NhD8h.mjs";
|
|
12
|
+
import { a as registerDiscordComponentEntries, o as resolveDiscordComponentEntryWithPersistence, s as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-CWZUuGvA.mjs";
|
|
13
|
+
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
14
|
+
import { n as getDiscordActivitiesRuntime } from "./runtime-plifsKg9.mjs";
|
|
15
|
+
import { t as resolveDiscordCommandOwnerAllowFrom } from "./command-owners-C7rUdqUX.mjs";
|
|
16
|
+
import { A as isDiscordExecApprovalClientEnabled, O as getDiscordExecApprovalApprovers, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, d as setDiscordChannelPolicyBindings, f as buildDiscordConversationRouteContext, g as resolveDiscordEffectiveRoute, m as resolveDiscordBoundConversationRoute, n as DISCORD_PRESENTATION_CAPABILITIES, p as buildDiscordRoutePeer, r as buildDiscordPresentationPayload, s as DISCORD_APPROVAL_ALLOWED_MENTIONS, v as resolveDiscordConversationIdentity } from "./outbound-session-route-BtUpGBTb.mjs";
|
|
17
|
+
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-C_Q966Wh.mjs";
|
|
18
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-Cj5i7hzj.mjs";
|
|
19
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BQLbysRB.mjs";
|
|
20
|
+
import { a as isThreadArchived, n as getThreadBindingManager } from "./thread-bindings.manager-5Sh7yedN.mjs";
|
|
21
|
+
import { n as resolveDiscordChannelInfoSafe, o as resolveDiscordChannelTopicSafe, r as resolveDiscordChannelNameSafe } from "./channel-access-DasWY_OV.mjs";
|
|
22
|
+
import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-CBaoCs-c.mjs";
|
|
23
|
+
import { O as resolveDiscordReferencedReplyMessage, a as authorizeDiscordVoiceIngress, c as resolveDiscordVoiceEnabled, i as setDiscordTranscriptsVoiceManager, k as resolveDiscordReferencedReplyMessageId, l as resolveDiscordThreadLikeChannelContext, o as resolveDiscordVoiceAccess, u as resolveFetchedDiscordThreadLikeChannelContext } from "./transcripts-source-8RDQrSVb.mjs";
|
|
24
|
+
import { t as resolveDiscordSenderIdentity } from "./sender-identity-DgbJykq0.mjs";
|
|
25
|
+
import { n as hasDiscordApprovalControl, t as discordApprovalMessageUpdates } from "./approval-message-updates-CdurC9Ej.mjs";
|
|
26
26
|
import { createRequire } from "node:module";
|
|
27
27
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
28
28
|
import { PlatformMessageNotDispatchedError, formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -90,7 +90,7 @@ import { createChannelInteractiveDispatcher } from "openclaw/plugin-sdk/plugin-r
|
|
|
90
90
|
import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
|
|
91
91
|
import { Agent } from "node:https";
|
|
92
92
|
import { reportChannelRoomJoin } from "openclaw/plugin-sdk/channel-join-intro-runtime";
|
|
93
|
-
|
|
93
|
+
//#region extensions/discord/src/monitor/listeners.queue.ts
|
|
94
94
|
const DISCORD_SLOW_LISTENER_THRESHOLD_MS = 3e4;
|
|
95
95
|
const discordEventQueueLog = createSubsystemLogger("discord/event-queue");
|
|
96
96
|
function formatListenerContextValue(value) {
|
|
@@ -144,7 +144,8 @@ async function runDiscordListenerWithSlowLog(params) {
|
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region extensions/discord/src/monitor/presence-events.ts
|
|
148
149
|
const DISCORD_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
149
150
|
function isDiscordOnlineStatus(status) {
|
|
150
151
|
return status === "online" || status === "idle" || status === "dnd";
|
|
@@ -171,7 +172,8 @@ function resolveDiscordOnlinePresenceEvent(params) {
|
|
|
171
172
|
text: lines.join("\n")
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
|
-
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region extensions/discord/src/monitor/presence-cooldown-store.ts
|
|
175
177
|
const DISCORD_PRESENCE_COOLDOWN_MAX_ENTRIES = 25e3;
|
|
176
178
|
function openDiscordPresenceCooldownStore() {
|
|
177
179
|
return getDiscordRuntime().state.openKeyedStore({
|
|
@@ -181,7 +183,8 @@ function openDiscordPresenceCooldownStore() {
|
|
|
181
183
|
defaultTtlMs: DISCORD_PRESENCE_GREETING_COOLDOWN_MS
|
|
182
184
|
});
|
|
183
185
|
}
|
|
184
|
-
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region extensions/discord/src/monitor/presence-emission-gate.ts
|
|
185
188
|
const DISCORD_PRESENCE_RECONNECT_SUPPRESS_MS = 3e5;
|
|
186
189
|
const DISCORD_PRESENCE_BURST_LIMIT = 8;
|
|
187
190
|
const DISCORD_PRESENCE_BURST_WINDOW_MS = 6e4;
|
|
@@ -259,7 +262,8 @@ var DiscordPresenceEmissionGate = class {
|
|
|
259
262
|
if (state.reservations.length === 0 && !state.logged) this.burstByGuild.delete(guildId);
|
|
260
263
|
}
|
|
261
264
|
};
|
|
262
|
-
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region extensions/discord/src/monitor/presence-transition-cache.ts
|
|
263
267
|
const DEFAULT_PRESENCE_BASELINE_MAX_ENTRIES = 75e3;
|
|
264
268
|
var DiscordPresenceBaselineCache = class {
|
|
265
269
|
constructor(maxEntries = DEFAULT_PRESENCE_BASELINE_MAX_ENTRIES) {
|
|
@@ -304,7 +308,8 @@ var DiscordPresenceBaselineCache = class {
|
|
|
304
308
|
return evictedScope;
|
|
305
309
|
}
|
|
306
310
|
};
|
|
307
|
-
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region extensions/discord/src/monitor/thread-session-close.ts
|
|
308
313
|
/**
|
|
309
314
|
* Closes every session entry in the store whose key contains {@link threadId}.
|
|
310
315
|
* The explicit lifecycle deletion archives the old transcript and guarantees
|
|
@@ -334,7 +339,8 @@ async function closeDiscordThreadSessions(params) {
|
|
|
334
339
|
}
|
|
335
340
|
return resetCount;
|
|
336
341
|
}
|
|
337
|
-
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region extensions/discord/src/monitor/dm-command-auth.ts
|
|
338
344
|
const DISCORD_CHANNEL_ID = "discord";
|
|
339
345
|
function createDiscordDmIngressSubject(sender) {
|
|
340
346
|
return {
|
|
@@ -441,7 +447,8 @@ async function resolveDiscordTextCommandAccess(params) {
|
|
|
441
447
|
}
|
|
442
448
|
});
|
|
443
449
|
}
|
|
444
|
-
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region extensions/discord/src/monitor/listeners.reactions.ts
|
|
445
452
|
var DiscordReactionListener = class extends MessageReactionAddListener {
|
|
446
453
|
constructor(params) {
|
|
447
454
|
super();
|
|
@@ -708,7 +715,8 @@ async function handleDiscordReactionEvent(params) {
|
|
|
708
715
|
params.logger.error(danger(`discord reaction handler failed: ${String(err)}`));
|
|
709
716
|
}
|
|
710
717
|
}
|
|
711
|
-
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region extensions/discord/src/monitor/listeners.ts
|
|
712
720
|
function registerDiscordListener(listeners, listener) {
|
|
713
721
|
if (listeners.some((existing) => existing.constructor === listener.constructor)) return false;
|
|
714
722
|
listeners.push(listener);
|
|
@@ -1105,7 +1113,8 @@ var DiscordThreadDeleteListener = class extends ThreadDeleteListener {
|
|
|
1105
1113
|
});
|
|
1106
1114
|
}
|
|
1107
1115
|
};
|
|
1108
|
-
|
|
1116
|
+
//#endregion
|
|
1117
|
+
//#region extensions/discord/src/internal/gateway-dispatch.ts
|
|
1109
1118
|
function dispatchVoiceGatewayEvent(client, payload) {
|
|
1110
1119
|
const guildId = readGuildId(payload.d);
|
|
1111
1120
|
if (!guildId) return;
|
|
@@ -1155,7 +1164,8 @@ function createReactionDispatchData(client, data) {
|
|
|
1155
1164
|
function readGuildId(data) {
|
|
1156
1165
|
return data && typeof data === "object" && typeof data.guild_id === "string" ? data.guild_id : void 0;
|
|
1157
1166
|
}
|
|
1158
|
-
|
|
1167
|
+
//#endregion
|
|
1168
|
+
//#region extensions/discord/src/monitor/provider.allowlist.ts
|
|
1159
1169
|
function formatResolutionLogDetails(base, details) {
|
|
1160
1170
|
const nonEmpty = details.map((value) => value?.trim()).filter((value) => Boolean(value));
|
|
1161
1171
|
return nonEmpty.length > 0 ? `${base} (${nonEmpty.join("; ")})` : base;
|
|
@@ -1378,7 +1388,8 @@ async function resolveDiscordAllowlistConfig(params) {
|
|
|
1378
1388
|
allowFrom
|
|
1379
1389
|
};
|
|
1380
1390
|
}
|
|
1381
|
-
|
|
1391
|
+
//#endregion
|
|
1392
|
+
//#region extensions/discord/src/network-config.ts
|
|
1382
1393
|
const DISCORD_DNS_HOSTS = [
|
|
1383
1394
|
"discord.com",
|
|
1384
1395
|
"discord.gg",
|
|
@@ -1432,7 +1443,8 @@ function createDiscordEndpointDnsLookup(endpointHostname) {
|
|
|
1432
1443
|
});
|
|
1433
1444
|
};
|
|
1434
1445
|
}
|
|
1435
|
-
|
|
1446
|
+
//#endregion
|
|
1447
|
+
//#region extensions/discord/src/monitor/rest-fetch.ts
|
|
1436
1448
|
const discordDnsLookup$1 = createDiscordDnsLookup();
|
|
1437
1449
|
function createEnvProxyDiscordRestDispatcher(runtime) {
|
|
1438
1450
|
const envProxyOptions = resolveEnvHttpProxyAgentOptions();
|
|
@@ -1474,7 +1486,8 @@ function resolveDiscordRestFetch(proxyUrl, runtime) {
|
|
|
1474
1486
|
}
|
|
1475
1487
|
return createDiscordRestFetchWithDispatcher(createEnvProxyDiscordRestDispatcher(runtime) ?? createHttp1Agent({ connect: { lookup: discordDnsLookup$1 } }));
|
|
1476
1488
|
}
|
|
1477
|
-
|
|
1489
|
+
//#endregion
|
|
1490
|
+
//#region extensions/discord/src/monitor/live-policy.ts
|
|
1478
1491
|
/** One reader belongs to one admitted account; transport and lifetime remain its startup owners. */
|
|
1479
1492
|
function createDiscordLivePolicyReader(params) {
|
|
1480
1493
|
const readConfig = params.readConfig ?? createRuntimeConfigReader(params.cfg);
|
|
@@ -1572,7 +1585,8 @@ function createDiscordLivePolicyReader(params) {
|
|
|
1572
1585
|
}
|
|
1573
1586
|
};
|
|
1574
1587
|
}
|
|
1575
|
-
|
|
1588
|
+
//#endregion
|
|
1589
|
+
//#region extensions/discord/src/monitor/dm-command-decision.ts
|
|
1576
1590
|
async function handleDiscordDmCommandDecision(params) {
|
|
1577
1591
|
if (params.senderAccess.decision === "allow") return true;
|
|
1578
1592
|
if (params.senderAccess.decision === "pairing") {
|
|
@@ -1601,7 +1615,8 @@ async function handleDiscordDmCommandDecision(params) {
|
|
|
1601
1615
|
await params.onUnauthorized();
|
|
1602
1616
|
return false;
|
|
1603
1617
|
}
|
|
1604
|
-
|
|
1618
|
+
//#endregion
|
|
1619
|
+
//#region extensions/discord/src/monitor/live-policy-interaction.ts
|
|
1605
1620
|
const INTERACTION_POLICY_WAIT_MS = 1e3;
|
|
1606
1621
|
async function readDiscordInteractionPolicy(readPolicy) {
|
|
1607
1622
|
const timeout = /* @__PURE__ */ new Error("Discord interaction access policy resolution timed out");
|
|
@@ -1612,7 +1627,8 @@ async function readDiscordInteractionPolicy(readPolicy) {
|
|
|
1612
1627
|
return null;
|
|
1613
1628
|
}
|
|
1614
1629
|
}
|
|
1615
|
-
|
|
1630
|
+
//#endregion
|
|
1631
|
+
//#region extensions/discord/src/monitor/native-command-reply.ts
|
|
1616
1632
|
const DISCORD_EMPTY_VISIBLE_REPLY_WARNING = "⚠️ Command produced no visible reply.";
|
|
1617
1633
|
/** Retain visible component text, not interaction IDs or option values. */
|
|
1618
1634
|
function formatDiscordCommandComponents(components) {
|
|
@@ -1753,7 +1769,8 @@ async function deliverDiscordInteractionReply(params) {
|
|
|
1753
1769
|
if (payloadDelivered && params.onDelivered) await params.onDelivered(deliveredText?.filter(Boolean).join("\n") ?? "");
|
|
1754
1770
|
return payloadDelivered;
|
|
1755
1771
|
}
|
|
1756
|
-
|
|
1772
|
+
//#endregion
|
|
1773
|
+
//#region extensions/discord/src/monitor/native-command-agent-reply.ts
|
|
1757
1774
|
async function dispatchDiscordNativeAgentReply(params) {
|
|
1758
1775
|
const blockStreamingEnabled = resolveChannelStreamingBlockEnabled(params.discordConfig);
|
|
1759
1776
|
let didReply = false;
|
|
@@ -1829,11 +1846,13 @@ async function dispatchDiscordNativeAgentReply(params) {
|
|
|
1829
1846
|
}));
|
|
1830
1847
|
return dispatchResult;
|
|
1831
1848
|
}
|
|
1832
|
-
|
|
1849
|
+
//#endregion
|
|
1850
|
+
//#region extensions/discord/src/monitor/commands.ts
|
|
1833
1851
|
function resolveDiscordSlashCommandConfig(raw) {
|
|
1834
1852
|
return { ephemeral: raw?.ephemeral !== false };
|
|
1835
1853
|
}
|
|
1836
|
-
|
|
1854
|
+
//#endregion
|
|
1855
|
+
//#region extensions/discord/src/monitor/native-command-arg-ui.ts
|
|
1837
1856
|
const DISCORD_COMMAND_ARG_CUSTOM_ID_KEY = "cmdarg";
|
|
1838
1857
|
function buildDiscordCommandArgCustomId(params) {
|
|
1839
1858
|
return [
|
|
@@ -1945,7 +1964,8 @@ function createDiscordCommandArgFallbackButton$1(params) {
|
|
|
1945
1964
|
style: ButtonStyle.Primary
|
|
1946
1965
|
});
|
|
1947
1966
|
}
|
|
1948
|
-
|
|
1967
|
+
//#endregion
|
|
1968
|
+
//#region extensions/discord/src/monitor/inbound-context.ts
|
|
1949
1969
|
function createDiscordSupplementalContextAccessChecker(params) {
|
|
1950
1970
|
const userAllowList = params.channelConfig?.users ?? params.guildInfo?.users ?? [];
|
|
1951
1971
|
const roleAllowList = params.channelConfig?.roles ?? params.guildInfo?.roles ?? [];
|
|
@@ -1984,7 +2004,8 @@ function buildDiscordInboundAccessContext(params) {
|
|
|
1984
2004
|
ownerAllowFrom: resolveDiscordOwnerAllowFrom(params)
|
|
1985
2005
|
};
|
|
1986
2006
|
}
|
|
1987
|
-
|
|
2007
|
+
//#endregion
|
|
2008
|
+
//#region extensions/discord/src/monitor/native-command-context.ts
|
|
1988
2009
|
async function buildDiscordNativeCommandContext(params) {
|
|
1989
2010
|
const conversationLabel = params.isDirectMessage ? params.user.globalName ?? params.user.username : params.channelId;
|
|
1990
2011
|
const { groupSystemPrompt, ownerAllowFrom, channelStructuredContext } = buildDiscordInboundAccessContext(params);
|
|
@@ -2118,7 +2139,8 @@ async function buildDiscordNativeInteractionContext(params) {
|
|
|
2118
2139
|
...targets
|
|
2119
2140
|
};
|
|
2120
2141
|
}
|
|
2121
|
-
|
|
2142
|
+
//#endregion
|
|
2143
|
+
//#region extensions/discord/src/monitor/native-command-route.ts
|
|
2122
2144
|
function resolveDiscordNativeInteractionRouteState(params) {
|
|
2123
2145
|
const route = resolveDiscordBoundConversationRoute(params);
|
|
2124
2146
|
const configuredRoute = params.threadBinding == null ? resolveConfiguredBindingRoute({
|
|
@@ -2145,7 +2167,8 @@ function resolveDiscordNativeInteractionRouteState(params) {
|
|
|
2145
2167
|
configuredBinding
|
|
2146
2168
|
};
|
|
2147
2169
|
}
|
|
2148
|
-
|
|
2170
|
+
//#endregion
|
|
2171
|
+
//#region extensions/discord/src/monitor/native-interaction-channel-context.ts
|
|
2149
2172
|
async function resolveDiscordNativeInteractionChannelContext(interaction, channelIdFallback) {
|
|
2150
2173
|
const { channel, client, guild, rawData } = interaction;
|
|
2151
2174
|
const hasGuild = Boolean(guild);
|
|
@@ -2168,7 +2191,8 @@ async function resolveDiscordNativeInteractionChannelContext(interaction, channe
|
|
|
2168
2191
|
threadParentSlug: hasGuild ? channelContext.threadParentSlug : ""
|
|
2169
2192
|
};
|
|
2170
2193
|
}
|
|
2171
|
-
|
|
2194
|
+
//#endregion
|
|
2195
|
+
//#region extensions/discord/src/monitor/native-command-auth.ts
|
|
2172
2196
|
function resolveDiscordNativePolicyReader(params) {
|
|
2173
2197
|
return params.readPolicy ?? createDiscordLivePolicyReader({
|
|
2174
2198
|
...params,
|
|
@@ -2454,7 +2478,8 @@ async function resolveDiscordNativeAutocompleteAuthorized(params) {
|
|
|
2454
2478
|
}
|
|
2455
2479
|
return params.isPolicyCurrent?.() !== false;
|
|
2456
2480
|
}
|
|
2457
|
-
|
|
2481
|
+
//#endregion
|
|
2482
|
+
//#region extensions/discord/src/monitor/native-command-bypass.ts
|
|
2458
2483
|
function shouldBypassConfiguredAcpEnsure(commandName) {
|
|
2459
2484
|
const command = commandName.trim().toLowerCase();
|
|
2460
2485
|
return command === "acp" || command === "status";
|
|
@@ -2463,7 +2488,8 @@ function shouldBypassConfiguredAcpGuildGuards(commandName) {
|
|
|
2463
2488
|
const command = commandName.trim().toLowerCase();
|
|
2464
2489
|
return command === "new" || command === "reset";
|
|
2465
2490
|
}
|
|
2466
|
-
|
|
2491
|
+
//#endregion
|
|
2492
|
+
//#region extensions/discord/src/monitor/model-picker-preference-primitives.ts
|
|
2467
2493
|
function splitDiscordModelRef(modelRef) {
|
|
2468
2494
|
const trimmed = modelRef.trim();
|
|
2469
2495
|
const slashIndex = trimmed.indexOf("/");
|
|
@@ -2504,7 +2530,8 @@ function preferenceTimestampMs(value) {
|
|
|
2504
2530
|
const parsed = typeof value === "string" ? Date.parse(value) : NaN;
|
|
2505
2531
|
return Number.isFinite(parsed) ? parsed : 0;
|
|
2506
2532
|
}
|
|
2507
|
-
|
|
2533
|
+
//#endregion
|
|
2534
|
+
//#region extensions/discord/src/monitor/model-picker-preferences.ts
|
|
2508
2535
|
const DEFAULT_RECENT_LIMIT = 5;
|
|
2509
2536
|
const PREFERENCE_MAX_ENTRIES = 2e3;
|
|
2510
2537
|
let lastPreferenceTimestampMs = 0;
|
|
@@ -2586,7 +2613,8 @@ async function recordDiscordModelPickerRecentModel(params) {
|
|
|
2586
2613
|
await Promise.all(scopedEntries.slice(limit).map((entry) => store.delete(entry.key)));
|
|
2587
2614
|
} catch {}
|
|
2588
2615
|
}
|
|
2589
|
-
|
|
2616
|
+
//#endregion
|
|
2617
|
+
//#region extensions/discord/src/monitor/model-picker.state.ts
|
|
2590
2618
|
const DISCORD_MODEL_PICKER_CUSTOM_ID_KEY = "mdlpk";
|
|
2591
2619
|
const DISCORD_CUSTOM_ID_MAX_CHARS = 100;
|
|
2592
2620
|
const DISCORD_COMPONENT_MAX_SELECT_OPTIONS = 25;
|
|
@@ -2836,7 +2864,8 @@ function getDiscordModelPickerRecentModelRefs(data, quickModels) {
|
|
|
2836
2864
|
const defaultModelRef = `${data.resolvedDefault.provider}/${data.resolvedDefault.model}`;
|
|
2837
2865
|
return [defaultModelRef, ...quickModels.filter((modelRef) => modelRef !== defaultModelRef)];
|
|
2838
2866
|
}
|
|
2839
|
-
|
|
2867
|
+
//#endregion
|
|
2868
|
+
//#region extensions/discord/src/monitor/model-picker.view.ts
|
|
2840
2869
|
const DISCORD_MODEL_PICKER_PAGE_INDICATOR_CUSTOM_ID = "mdlpk:nav-indicator";
|
|
2841
2870
|
function parseCurrentModelRef(raw) {
|
|
2842
2871
|
const match = raw?.trim().match(/^([^/]+)\/(.+)$/u);
|
|
@@ -3205,7 +3234,8 @@ function renderDiscordModelPickerRecentsView(params) {
|
|
|
3205
3234
|
trailingRows: [backRow]
|
|
3206
3235
|
});
|
|
3207
3236
|
}
|
|
3208
|
-
|
|
3237
|
+
//#endregion
|
|
3238
|
+
//#region extensions/discord/src/monitor/native-command-model-picker-apply.ts
|
|
3209
3239
|
async function applyDiscordModelPickerSelection(params) {
|
|
3210
3240
|
const failureNotice = `❌ Failed to apply ${params.resolvedModelRef}. Try /model ${params.resolvedModelRef} directly.`;
|
|
3211
3241
|
try {
|
|
@@ -3265,7 +3295,8 @@ async function applyDiscordModelPickerSelection(params) {
|
|
|
3265
3295
|
};
|
|
3266
3296
|
}
|
|
3267
3297
|
}
|
|
3268
|
-
|
|
3298
|
+
//#endregion
|
|
3299
|
+
//#region extensions/discord/src/monitor/native-command-model-picker-ui.ts
|
|
3269
3300
|
function createDiscordModelPickerSessionReader(params, readConsistency) {
|
|
3270
3301
|
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.route.agentId });
|
|
3271
3302
|
return (sessionKey = params.route.sessionKey) => getSessionEntryAsync({
|
|
@@ -3429,7 +3460,8 @@ async function replyWithDiscordModelPickerProviders(params) {
|
|
|
3429
3460
|
replyText: formatDiscordCommandComponents(rendered.components)
|
|
3430
3461
|
});
|
|
3431
3462
|
}
|
|
3432
|
-
|
|
3463
|
+
//#endregion
|
|
3464
|
+
//#region extensions/discord/src/monitor/native-command-model-picker-interaction.ts
|
|
3433
3465
|
function resolveModelPickerSelectionValue(interaction) {
|
|
3434
3466
|
return normalizeOptionalString(interaction.values?.[0]) ?? null;
|
|
3435
3467
|
}
|
|
@@ -3790,7 +3822,8 @@ function createDiscordModelPickerFallbackSelect$1(params) {
|
|
|
3790
3822
|
}
|
|
3791
3823
|
}();
|
|
3792
3824
|
}
|
|
3793
|
-
|
|
3825
|
+
//#endregion
|
|
3826
|
+
//#region extensions/discord/src/monitor/native-command-status.ts
|
|
3794
3827
|
async function maybeDeliverDiscordDirectStatus(params) {
|
|
3795
3828
|
if (params.suppressReplies || params.commandName !== "status") return null;
|
|
3796
3829
|
const statusReply = await params.resolveDirectStatusReplyForSession({
|
|
@@ -3829,7 +3862,8 @@ async function maybeDeliverDiscordDirectStatus(params) {
|
|
|
3829
3862
|
effectiveRoute: params.effectiveRoute
|
|
3830
3863
|
};
|
|
3831
3864
|
}
|
|
3832
|
-
|
|
3865
|
+
//#endregion
|
|
3866
|
+
//#region extensions/discord/src/monitor/native-command.args.ts
|
|
3833
3867
|
function readDiscordCommandArgs(interaction, definitions) {
|
|
3834
3868
|
if (!definitions || definitions.length === 0) return;
|
|
3835
3869
|
const values = {};
|
|
@@ -3852,7 +3886,8 @@ function createNativeCommandDefinition(command) {
|
|
|
3852
3886
|
scope: "native"
|
|
3853
3887
|
};
|
|
3854
3888
|
}
|
|
3855
|
-
|
|
3889
|
+
//#endregion
|
|
3890
|
+
//#region extensions/discord/src/monitor/native-command.options.ts
|
|
3856
3891
|
const log$1 = createSubsystemLogger("discord/native-command");
|
|
3857
3892
|
const DISCORD_COMMAND_DESCRIPTION_MAX = 100;
|
|
3858
3893
|
function truncateDiscordCommandDescription(params) {
|
|
@@ -3929,7 +3964,8 @@ function buildDiscordCommandOptions(params) {
|
|
|
3929
3964
|
});
|
|
3930
3965
|
});
|
|
3931
3966
|
}
|
|
3932
|
-
|
|
3967
|
+
//#endregion
|
|
3968
|
+
//#region extensions/discord/src/monitor/native-command.ts
|
|
3933
3969
|
const log = createSubsystemLogger("discord/native-command");
|
|
3934
3970
|
const NON_PLUGIN_COMMAND_DISPATCH = Object.freeze({ kind: "non-plugin" });
|
|
3935
3971
|
function createDiscordNativeCommand(params) {
|
|
@@ -4381,7 +4417,8 @@ function bindDiscordCommandControl(createControl) {
|
|
|
4381
4417
|
const createDiscordCommandArgFallbackButton = bindDiscordCommandControl(createDiscordCommandArgFallbackButton$1);
|
|
4382
4418
|
const createDiscordModelPickerFallbackButton = bindDiscordCommandControl(createDiscordModelPickerFallbackButton$1);
|
|
4383
4419
|
const createDiscordModelPickerFallbackSelect = bindDiscordCommandControl(createDiscordModelPickerFallbackSelect$1);
|
|
4384
|
-
|
|
4420
|
+
//#endregion
|
|
4421
|
+
//#region extensions/discord/src/internal/gateway-close-codes.ts
|
|
4385
4422
|
const fatalGatewayCloseCodes = /* @__PURE__ */ new Set([
|
|
4386
4423
|
GatewayCloseCodes.AuthenticationFailed,
|
|
4387
4424
|
GatewayCloseCodes.InvalidShard,
|
|
@@ -4402,7 +4439,8 @@ function isFatalGatewayCloseCode(code) {
|
|
|
4402
4439
|
function canResumeAfterGatewayClose(code) {
|
|
4403
4440
|
return !nonResumableGatewayCloseCodes.has(code);
|
|
4404
4441
|
}
|
|
4405
|
-
|
|
4442
|
+
//#endregion
|
|
4443
|
+
//#region extensions/discord/src/internal/gateway-identify-limiter.ts
|
|
4406
4444
|
const IDENTIFY_WINDOW_MS = 5e3;
|
|
4407
4445
|
var GatewayIdentifyLimiter = class {
|
|
4408
4446
|
async wait() {
|
|
@@ -4419,7 +4457,8 @@ var GatewayIdentifyLimiter = class {
|
|
|
4419
4457
|
}
|
|
4420
4458
|
};
|
|
4421
4459
|
const sharedGatewayIdentifyLimiter = new GatewayIdentifyLimiter();
|
|
4422
|
-
|
|
4460
|
+
//#endregion
|
|
4461
|
+
//#region extensions/discord/src/internal/gateway-lifecycle.ts
|
|
4423
4462
|
var GatewayHeartbeatTimers = class {
|
|
4424
4463
|
start(params) {
|
|
4425
4464
|
this.stop();
|
|
@@ -4469,7 +4508,8 @@ var GatewayReconnectTimer = class {
|
|
|
4469
4508
|
this.timeout.unref?.();
|
|
4470
4509
|
}
|
|
4471
4510
|
};
|
|
4472
|
-
|
|
4511
|
+
//#endregion
|
|
4512
|
+
//#region extensions/discord/src/internal/gateway-payload.ts
|
|
4473
4513
|
function ensureGatewayParams(url) {
|
|
4474
4514
|
const parsed = new URL(url);
|
|
4475
4515
|
parsed.searchParams.set("v", parsed.searchParams.get("v") ?? "10");
|
|
@@ -4484,7 +4524,8 @@ function decodeGatewayMessage(incoming) {
|
|
|
4484
4524
|
return null;
|
|
4485
4525
|
}
|
|
4486
4526
|
}
|
|
4487
|
-
|
|
4527
|
+
//#endregion
|
|
4528
|
+
//#region extensions/discord/src/internal/gateway-rate-limit.ts
|
|
4488
4529
|
const GATEWAY_SEND_LIMIT = 120;
|
|
4489
4530
|
const GATEWAY_SEND_WINDOW_MS = 6e4;
|
|
4490
4531
|
const GATEWAY_SEND_QUEUE_LIMIT = GATEWAY_SEND_LIMIT;
|
|
@@ -4582,7 +4623,8 @@ var GatewaySendLimiter = class {
|
|
|
4582
4623
|
this.scheduleFlush();
|
|
4583
4624
|
}
|
|
4584
4625
|
};
|
|
4585
|
-
|
|
4626
|
+
//#endregion
|
|
4627
|
+
//#region extensions/discord/src/internal/gateway-voice-state-cache.ts
|
|
4586
4628
|
var DiscordGatewayVoiceStateCache = class {
|
|
4587
4629
|
constructor() {
|
|
4588
4630
|
this.statesByGuild = /* @__PURE__ */ new Map();
|
|
@@ -4658,10 +4700,12 @@ var DiscordGatewayVoiceStateCache = class {
|
|
|
4658
4700
|
}
|
|
4659
4701
|
}
|
|
4660
4702
|
};
|
|
4661
|
-
|
|
4703
|
+
//#endregion
|
|
4704
|
+
//#region extensions/discord/src/internal/ws-runtime.ts
|
|
4662
4705
|
const require = createRequire(import.meta.url);
|
|
4663
4706
|
const WebSocket = require(path.join(path.dirname(require.resolve("ws/package.json")), "index.js"));
|
|
4664
|
-
|
|
4707
|
+
//#endregion
|
|
4708
|
+
//#region extensions/discord/src/internal/gateway.ts
|
|
4665
4709
|
const GatewayIntents = GatewayIntentBits;
|
|
4666
4710
|
const READY_STATE_OPEN = 1;
|
|
4667
4711
|
const DEFAULT_GATEWAY_URL = "wss://gateway.discord.gg/";
|
|
@@ -4965,7 +5009,8 @@ var GatewayPlugin = class extends Plugin {
|
|
|
4965
5009
|
return this.outboundLimiter.getStatus();
|
|
4966
5010
|
}
|
|
4967
5011
|
};
|
|
4968
|
-
|
|
5012
|
+
//#endregion
|
|
5013
|
+
//#region extensions/discord/src/monitor/gateway-supervisor.ts
|
|
4969
5014
|
var DiscordGatewayLifecycleError = class extends Error {
|
|
4970
5015
|
constructor(event) {
|
|
4971
5016
|
super(`discord gateway ${event.type}: ${event.message}`, { cause: event.err instanceof Error ? event.err : void 0 });
|
|
@@ -5082,7 +5127,8 @@ function createDiscordGatewaySupervisor(params) {
|
|
|
5082
5127
|
}
|
|
5083
5128
|
};
|
|
5084
5129
|
}
|
|
5085
|
-
|
|
5130
|
+
//#endregion
|
|
5131
|
+
//#region extensions/discord/src/gateway-logging.ts
|
|
5086
5132
|
const INFO_DEBUG_MARKERS = [
|
|
5087
5133
|
"Gateway websocket closed",
|
|
5088
5134
|
"Gateway reconnect scheduled in",
|
|
@@ -5121,7 +5167,8 @@ function attachDiscordGatewayLogging(params) {
|
|
|
5121
5167
|
emitter.removeListener("metrics", onGatewayMetrics);
|
|
5122
5168
|
};
|
|
5123
5169
|
}
|
|
5124
|
-
|
|
5170
|
+
//#endregion
|
|
5171
|
+
//#region extensions/discord/src/monitor.gateway.ts
|
|
5125
5172
|
async function waitForDiscordGatewayStop(params) {
|
|
5126
5173
|
const { gateway, abortSignal } = params;
|
|
5127
5174
|
return await new Promise((resolve, reject) => {
|
|
@@ -5155,9 +5202,11 @@ async function waitForDiscordGatewayStop(params) {
|
|
|
5155
5202
|
params.registerForceStop?.(finishReject);
|
|
5156
5203
|
});
|
|
5157
5204
|
}
|
|
5158
|
-
|
|
5205
|
+
//#endregion
|
|
5206
|
+
//#region extensions/discord/src/monitor/gateway-handle.ts
|
|
5159
5207
|
const DISCORD_GATEWAY_TRANSPORT_ACTIVITY_EVENT = "openclaw:discord-gateway-transport-activity";
|
|
5160
|
-
|
|
5208
|
+
//#endregion
|
|
5209
|
+
//#region extensions/discord/src/monitor/status.ts
|
|
5161
5210
|
/** READY proves a prior terminal failure was repaired, so the account is restartable again. */
|
|
5162
5211
|
function createDiscordReadyStatusPatch(at = Date.now()) {
|
|
5163
5212
|
return channelReadyPatch({
|
|
@@ -5166,7 +5215,8 @@ function createDiscordReadyStatusPatch(at = Date.now()) {
|
|
|
5166
5215
|
lastDisconnect: null
|
|
5167
5216
|
});
|
|
5168
5217
|
}
|
|
5169
|
-
|
|
5218
|
+
//#endregion
|
|
5219
|
+
//#region extensions/discord/src/monitor/provider.lifecycle.ts
|
|
5170
5220
|
const DEFAULT_DISCORD_GATEWAY_READY_TIMEOUT_MS = 15e3;
|
|
5171
5221
|
const DEFAULT_DISCORD_GATEWAY_RUNTIME_READY_TIMEOUT_MS = 3e4;
|
|
5172
5222
|
const MAX_DISCORD_GATEWAY_READY_TIMEOUT_MS = 12e4;
|
|
@@ -5505,13 +5555,14 @@ async function runDiscordGatewayLifecycle(params) {
|
|
|
5505
5555
|
}
|
|
5506
5556
|
}
|
|
5507
5557
|
}
|
|
5508
|
-
|
|
5558
|
+
//#endregion
|
|
5559
|
+
//#region extensions/discord/src/monitor/provider-runtime.ts
|
|
5509
5560
|
const discordProviderRuntime = {
|
|
5510
5561
|
probeDiscordApplicationId,
|
|
5511
5562
|
createDiscordNativeCommand,
|
|
5512
5563
|
runDiscordGatewayLifecycle,
|
|
5513
|
-
loadDiscordVoiceRuntime: () => import("./voice-runtime-
|
|
5514
|
-
loadDiscordProviderSessionRuntime: () => import("./provider-session.runtime-
|
|
5564
|
+
loadDiscordVoiceRuntime: () => import("./voice-runtime-BsDILmAv.mjs").then((n) => n.t),
|
|
5565
|
+
loadDiscordProviderSessionRuntime: () => import("./provider-session.runtime-TWOo_JZx.mjs"),
|
|
5515
5566
|
createClient: (...args) => new Client(...args),
|
|
5516
5567
|
resolveDiscordAccount,
|
|
5517
5568
|
resolveNativeCommandsEnabled,
|
|
@@ -5521,7 +5572,8 @@ const discordProviderRuntime = {
|
|
|
5521
5572
|
isVerbose,
|
|
5522
5573
|
shouldLogVerbose
|
|
5523
5574
|
};
|
|
5524
|
-
|
|
5575
|
+
//#endregion
|
|
5576
|
+
//#region extensions/discord/src/monitor/provider.acp.ts
|
|
5525
5577
|
const DISCORD_ACP_STATUS_PROBE_TIMEOUT_MS = 8e3;
|
|
5526
5578
|
const DISCORD_ACP_STALE_RUNNING_ACTIVITY_MS = 12e4;
|
|
5527
5579
|
function classifyAcpStatusProbeError(params) {
|
|
@@ -5594,7 +5646,8 @@ async function probeDiscordAcpBindingHealth(params) {
|
|
|
5594
5646
|
};
|
|
5595
5647
|
return { status: "healthy" };
|
|
5596
5648
|
}
|
|
5597
|
-
|
|
5649
|
+
//#endregion
|
|
5650
|
+
//#region extensions/discord/src/monitor/provider.cleanup.ts
|
|
5598
5651
|
async function cleanupDiscordProviderStartup(params) {
|
|
5599
5652
|
try {
|
|
5600
5653
|
const listenersStopped = params.stopMonitorListeners?.();
|
|
@@ -5616,7 +5669,8 @@ async function cleanupDiscordProviderStartup(params) {
|
|
|
5616
5669
|
if (!params.lifecycleStarted) await params.threadBindings.stop();
|
|
5617
5670
|
}
|
|
5618
5671
|
}
|
|
5619
|
-
|
|
5672
|
+
//#endregion
|
|
5673
|
+
//#region extensions/discord/src/voice/session.ts
|
|
5620
5674
|
const MIN_SEGMENT_SECONDS = .35;
|
|
5621
5675
|
const CAPTURE_FINALIZE_GRACE_MS = 2e3;
|
|
5622
5676
|
const VOICE_CONNECT_READY_TIMEOUT_MS = 3e4;
|
|
@@ -5639,7 +5693,8 @@ function logVoiceVerbose(message) {
|
|
|
5639
5693
|
function isVoiceChannel(type) {
|
|
5640
5694
|
return type === discord_exports.ChannelType.GuildVoice || type === discord_exports.ChannelType.GuildStageVoice;
|
|
5641
5695
|
}
|
|
5642
|
-
|
|
5696
|
+
//#endregion
|
|
5697
|
+
//#region extensions/discord/src/voice/command.ts
|
|
5643
5698
|
const VOICE_CHANNEL_TYPES = [ChannelType.GuildVoice, ChannelType.GuildStageVoice];
|
|
5644
5699
|
const DISCORD_VOICE_COMMAND_SPEC = {
|
|
5645
5700
|
name: "vc",
|
|
@@ -5804,7 +5859,8 @@ function createDiscordVoiceCommand(startupParams) {
|
|
|
5804
5859
|
}
|
|
5805
5860
|
}();
|
|
5806
5861
|
}
|
|
5807
|
-
|
|
5862
|
+
//#endregion
|
|
5863
|
+
//#region extensions/discord/src/monitor/provider.commands.ts
|
|
5808
5864
|
const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
|
|
5809
5865
|
async function resolveDiscordProviderCommandSpecs(params) {
|
|
5810
5866
|
const listSkillCommands = params.prepareSkillCommandsForAgents ?? prepareSkillCommandsForAgents;
|
|
@@ -5856,7 +5912,8 @@ async function resolveDiscordProviderCommandSpecs(params) {
|
|
|
5856
5912
|
commandSpecs
|
|
5857
5913
|
};
|
|
5858
5914
|
}
|
|
5859
|
-
|
|
5915
|
+
//#endregion
|
|
5916
|
+
//#region extensions/discord/src/monitor/provider.deploy-errors.ts
|
|
5860
5917
|
const DISCORD_DEPLOY_REJECTED_ENTRY_LIMIT = 3;
|
|
5861
5918
|
function attachDiscordDeployRequestBody(err, body) {
|
|
5862
5919
|
if (!err || typeof err !== "object" || body === void 0) return;
|
|
@@ -6004,7 +6061,8 @@ function isDiscordDeployDailyCreateLimit(err) {
|
|
|
6004
6061
|
const rawCode = parseStrictNonNegativeInteger(readDiscordDeployObjectField(deployErr.rawBody, "code"));
|
|
6005
6062
|
return (discordCode === 30034 || rawCode === 30034) && /daily application command creates/i.test(formatErrorMessage$1(err));
|
|
6006
6063
|
}
|
|
6007
|
-
|
|
6064
|
+
//#endregion
|
|
6065
|
+
//#region extensions/discord/src/monitor/provider.startup-log.ts
|
|
6008
6066
|
function formatDiscordStartupGatewayState(gateway) {
|
|
6009
6067
|
if (!gateway) return "gateway=missing";
|
|
6010
6068
|
const reconnectAttempts = gateway.reconnectAttempts;
|
|
@@ -6016,7 +6074,8 @@ function logDiscordStartupPhase(params) {
|
|
|
6016
6074
|
const suffix = [params.details, formatDiscordStartupGatewayState(params.gateway)].filter((value) => Boolean(value)).join(" ");
|
|
6017
6075
|
params.runtime.log?.(`discord startup [${params.accountId}] ${params.phase} ${elapsedMs}ms${suffix ? ` ${suffix}` : ""}`);
|
|
6018
6076
|
}
|
|
6019
|
-
|
|
6077
|
+
//#endregion
|
|
6078
|
+
//#region extensions/discord/src/monitor/provider.deploy.ts
|
|
6020
6079
|
function readDeployRequestBody(data) {
|
|
6021
6080
|
return data && typeof data === "object" && "body" in data ? data.body : void 0;
|
|
6022
6081
|
}
|
|
@@ -6126,7 +6185,8 @@ function runDiscordCommandDeployInBackground(params) {
|
|
|
6126
6185
|
params.runtime.log?.(warn(`[${params.accountId}] slash command deploy failed in background (message send/receive unaffected): ${formatErrorMessage$1(err)}`));
|
|
6127
6186
|
});
|
|
6128
6187
|
}
|
|
6129
|
-
|
|
6188
|
+
//#endregion
|
|
6189
|
+
//#region extensions/discord/src/monitor/agent-components-reply.ts
|
|
6130
6190
|
async function replySilently(interaction, params, onError) {
|
|
6131
6191
|
try {
|
|
6132
6192
|
await interaction.reply(params);
|
|
@@ -6134,7 +6194,8 @@ async function replySilently(interaction, params, onError) {
|
|
|
6134
6194
|
onError?.(error);
|
|
6135
6195
|
}
|
|
6136
6196
|
}
|
|
6137
|
-
|
|
6197
|
+
//#endregion
|
|
6198
|
+
//#region extensions/discord/src/activities/interaction.ts
|
|
6138
6199
|
const REGISTRATION_WIDGET_ID = "AAAAAAAAAAAAAAAAAAAAAA";
|
|
6139
6200
|
const PENDING_LAUNCH_WRITE_BUDGET_MS = 250;
|
|
6140
6201
|
var DiscordActivityButton = class extends Button {
|
|
@@ -6186,7 +6247,8 @@ function createDiscordActivityButton(ctx, applicationId) {
|
|
|
6186
6247
|
if (!runtime.resolveAccount(ctx.accountId, ctx.cfg)) return null;
|
|
6187
6248
|
return new DiscordActivityButton(ctx);
|
|
6188
6249
|
}
|
|
6189
|
-
|
|
6250
|
+
//#endregion
|
|
6251
|
+
//#region extensions/discord/src/monitor/agent-components-context.ts
|
|
6190
6252
|
function resolveAgentComponentRoute(params) {
|
|
6191
6253
|
return resolveAgentRoute({
|
|
6192
6254
|
cfg: params.ctx.cfg,
|
|
@@ -6267,7 +6329,8 @@ async function resolveComponentInteractionContext(params) {
|
|
|
6267
6329
|
memberRoleIds: Array.isArray(interaction.rawData.member?.roles) ? interaction.rawData.member.roles.slice() : []
|
|
6268
6330
|
};
|
|
6269
6331
|
}
|
|
6270
|
-
|
|
6332
|
+
//#endregion
|
|
6333
|
+
//#region extensions/discord/src/monitor/agent-components-data.ts
|
|
6271
6334
|
function readParsedId(data, key) {
|
|
6272
6335
|
if (!data || typeof data !== "object") return;
|
|
6273
6336
|
return key in data ? data[key] : data[key === "cid" ? "componentId" : "modalId"];
|
|
@@ -6360,7 +6423,8 @@ function formatModalSubmissionText(entry, interaction) {
|
|
|
6360
6423
|
});
|
|
6361
6424
|
return [title, ...lines.length > 0 ? lines : ["- (no values)"]].join("\n");
|
|
6362
6425
|
}
|
|
6363
|
-
|
|
6426
|
+
//#endregion
|
|
6427
|
+
//#region extensions/discord/src/monitor/agent-components-live-policy.ts
|
|
6364
6428
|
async function resolveAgentComponentPolicyContext(params) {
|
|
6365
6429
|
if (!params.ctx.readPolicy) return params.ctx;
|
|
6366
6430
|
try {
|
|
@@ -6380,7 +6444,8 @@ async function resolveAgentComponentPolicyContext(params) {
|
|
|
6380
6444
|
throw error;
|
|
6381
6445
|
}
|
|
6382
6446
|
}
|
|
6383
|
-
|
|
6447
|
+
//#endregion
|
|
6448
|
+
//#region extensions/discord/src/monitor/agent-components-dm-auth.ts
|
|
6384
6449
|
async function ensureDmComponentAuthorized(params) {
|
|
6385
6450
|
const { ctx, interaction, user, componentLabel } = params;
|
|
6386
6451
|
const dmPolicy = ctx.dmPolicy ?? "pairing";
|
|
@@ -6481,7 +6546,8 @@ async function resolveInteractionContextWithDmAuth(params) {
|
|
|
6481
6546
|
})) return null;
|
|
6482
6547
|
return interactionCtx;
|
|
6483
6548
|
}
|
|
6484
|
-
|
|
6549
|
+
//#endregion
|
|
6550
|
+
//#region extensions/discord/src/monitor/agent-components-guild-auth.ts
|
|
6485
6551
|
function resolveComponentGuildContext(params) {
|
|
6486
6552
|
const guildInfo = resolveDiscordGuildEntry({
|
|
6487
6553
|
guild: params.interaction.guild ?? void 0,
|
|
@@ -6653,7 +6719,8 @@ async function resolveComponentCommandAuthorized(params) {
|
|
|
6653
6719
|
modeWhenAccessGroupsOff: "configured"
|
|
6654
6720
|
});
|
|
6655
6721
|
}
|
|
6656
|
-
|
|
6722
|
+
//#endregion
|
|
6723
|
+
//#region extensions/discord/src/monitor/reply-context.ts
|
|
6657
6724
|
function resolveReplyContext(message, resolveDiscordMessageText) {
|
|
6658
6725
|
const id = resolveDiscordReferencedReplyMessageId(message);
|
|
6659
6726
|
if (!id) return null;
|
|
@@ -6690,7 +6757,8 @@ function buildGuildLabel(params) {
|
|
|
6690
6757
|
const { guild, channelName, channelId } = params;
|
|
6691
6758
|
return `${guild?.name ?? "Guild"} #${channelName} channel id:${channelId}`;
|
|
6692
6759
|
}
|
|
6693
|
-
|
|
6760
|
+
//#endregion
|
|
6761
|
+
//#region extensions/discord/src/monitor/reply-safety.ts
|
|
6694
6762
|
const DISCORD_INTERNAL_CHANNEL_LINE_RE = /^(?:>\s*)?(?:analysis|commentary|thinking|reasoning)\s*[:=]/i;
|
|
6695
6763
|
function hasNonEmptyRecord(value) {
|
|
6696
6764
|
return Boolean(value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0);
|
|
@@ -6740,7 +6808,8 @@ function sanitizeDiscordFrontChannelReplyPayloads(payloads, options = {}) {
|
|
|
6740
6808
|
}
|
|
6741
6809
|
return safePayloads;
|
|
6742
6810
|
}
|
|
6743
|
-
|
|
6811
|
+
//#endregion
|
|
6812
|
+
//#region extensions/discord/src/monitor/reply-delivery.ts
|
|
6744
6813
|
function formatDiscordReplyContext(target, sessionKey) {
|
|
6745
6814
|
return `target=${target}${sessionKey ? ` session=${sessionKey}` : ""}`;
|
|
6746
6815
|
}
|
|
@@ -6850,9 +6919,10 @@ async function deliverDiscordReply(params) {
|
|
|
6850
6919
|
if (send.status === "partial_failed") throw createChannelPartialDeliveryError(send.error, deliveryResult);
|
|
6851
6920
|
return deliveryResult;
|
|
6852
6921
|
}
|
|
6853
|
-
|
|
6922
|
+
//#endregion
|
|
6923
|
+
//#region extensions/discord/src/monitor/agent-components.dispatch.ts
|
|
6854
6924
|
const loadReplyRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/reply-runtime"));
|
|
6855
|
-
const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-
|
|
6925
|
+
const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-CNlSKY5S.mjs").then((n) => n.n));
|
|
6856
6926
|
function buildDiscordComponentConversationLabel(params) {
|
|
6857
6927
|
if (params.interactionCtx.isDirectMessage) return buildDirectLabel(params.interactionCtx.user);
|
|
6858
6928
|
if (params.interactionCtx.isGroupDm) return `Group DM #${params.channelCtx.channelName ?? params.interactionCtx.channelId} channel id:${params.interactionCtx.channelId}`;
|
|
@@ -7096,7 +7166,8 @@ async function dispatchDiscordComponentEvent(params) {
|
|
|
7096
7166
|
}
|
|
7097
7167
|
});
|
|
7098
7168
|
}
|
|
7099
|
-
|
|
7169
|
+
//#endregion
|
|
7170
|
+
//#region extensions/discord/src/interactive-dispatch.ts
|
|
7100
7171
|
const dispatchDiscordInteractive = createChannelInteractiveDispatcher({
|
|
7101
7172
|
channel: "discord",
|
|
7102
7173
|
interactiveKey: "interaction"
|
|
@@ -7107,7 +7178,8 @@ async function dispatchDiscordPluginInteractiveHandler(params) {
|
|
|
7107
7178
|
dedupeId: params.interactionId
|
|
7108
7179
|
});
|
|
7109
7180
|
}
|
|
7110
|
-
|
|
7181
|
+
//#endregion
|
|
7182
|
+
//#region extensions/discord/src/monitor/agent-components.plugin-interactive.ts
|
|
7111
7183
|
const loadConversationRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-runtime"));
|
|
7112
7184
|
async function dispatchPluginDiscordInteractiveEvent(params) {
|
|
7113
7185
|
const normalizedConversationId = params.interactionCtx.rawGuildId || params.channelCtx.channelType === ChannelType.GroupDM ? `channel:${params.interactionCtx.channelId}` : `user:${params.interactionCtx.userId}`;
|
|
@@ -7219,8 +7291,9 @@ async function dispatchPluginDiscordInteractiveEvent(params) {
|
|
|
7219
7291
|
}
|
|
7220
7292
|
return "unmatched";
|
|
7221
7293
|
}
|
|
7222
|
-
|
|
7223
|
-
|
|
7294
|
+
//#endregion
|
|
7295
|
+
//#region extensions/discord/src/monitor/agent-components.handlers.ts
|
|
7296
|
+
const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-Du9NhD8h.mjs").then((n) => n.t));
|
|
7224
7297
|
async function resolveAuthorizedComponentEntry(params) {
|
|
7225
7298
|
const entry = params.entry ?? await params.resolve(false);
|
|
7226
7299
|
if (!entry) {
|
|
@@ -7412,7 +7485,8 @@ function createDiscordComponentModal(ctx) {
|
|
|
7412
7485
|
}
|
|
7413
7486
|
}();
|
|
7414
7487
|
}
|
|
7415
|
-
|
|
7488
|
+
//#endregion
|
|
7489
|
+
//#region extensions/discord/src/monitor/agent-components.system-controls.ts
|
|
7416
7490
|
const AGENT_BUTTON_KEY = "agent";
|
|
7417
7491
|
const AGENT_SELECT_KEY = "agentsel";
|
|
7418
7492
|
async function runAgentSystemControlInteraction(params) {
|
|
@@ -7498,7 +7572,8 @@ function createAgentSelectMenu(ctx) {
|
|
|
7498
7572
|
}
|
|
7499
7573
|
}();
|
|
7500
7574
|
}
|
|
7501
|
-
|
|
7575
|
+
//#endregion
|
|
7576
|
+
//#region extensions/discord/src/monitor/agent-components.wildcard-controls.ts
|
|
7502
7577
|
const SELECT_CONTROLS = [
|
|
7503
7578
|
{
|
|
7504
7579
|
type: ComponentType.StringSelect,
|
|
@@ -7580,10 +7655,12 @@ function createDiscordComponentButton(ctx, handlers) {
|
|
|
7580
7655
|
}();
|
|
7581
7656
|
}
|
|
7582
7657
|
const discordComponentControlFactories = [createDiscordComponentButton, ...SELECT_CONTROLS.map((spec) => (ctx, handlers) => createDiscordComponentSelectControl(spec, ctx, handlers))];
|
|
7583
|
-
|
|
7658
|
+
//#endregion
|
|
7659
|
+
//#region extensions/discord/src/monitor/agent-components.ts
|
|
7584
7660
|
const createAgentComponentControls = [createAgentComponentButton, createAgentSelectMenu];
|
|
7585
7661
|
const createDiscordComponentControls = discordComponentControlFactories.map((createControl) => (ctx) => createControl(ctx, discordComponentControlHandlers));
|
|
7586
|
-
|
|
7662
|
+
//#endregion
|
|
7663
|
+
//#region extensions/discord/src/monitor/exec-approvals.ts
|
|
7587
7664
|
function resolveTerminalLabel(approval) {
|
|
7588
7665
|
if (approval.status === "allowed") return approval.decision === "allow-always" ? "Allowed always" : "Allowed once";
|
|
7589
7666
|
if (approval.status === "denied") return "Denied";
|
|
@@ -7706,7 +7783,8 @@ function createDiscordExecApprovalButtonContext(params) {
|
|
|
7706
7783
|
}
|
|
7707
7784
|
};
|
|
7708
7785
|
}
|
|
7709
|
-
|
|
7786
|
+
//#endregion
|
|
7787
|
+
//#region extensions/discord/src/monitor/questions.ts
|
|
7710
7788
|
var QuestionButton = class extends Button {
|
|
7711
7789
|
constructor(ctx) {
|
|
7712
7790
|
super();
|
|
@@ -7767,7 +7845,8 @@ function createDiscordQuestionButton(params) {
|
|
|
7767
7845
|
})))
|
|
7768
7846
|
});
|
|
7769
7847
|
}
|
|
7770
|
-
|
|
7848
|
+
//#endregion
|
|
7849
|
+
//#region extensions/discord/src/monitor/provider.interactions.ts
|
|
7771
7850
|
function createDiscordProviderInteractionSurface(params) {
|
|
7772
7851
|
const createNativeCommand = params.createNativeCommand ?? createDiscordNativeCommand;
|
|
7773
7852
|
const accountContext = {
|
|
@@ -7854,7 +7933,8 @@ function createDiscordProviderInteractionSurface(params) {
|
|
|
7854
7933
|
modals
|
|
7855
7934
|
};
|
|
7856
7935
|
}
|
|
7857
|
-
|
|
7936
|
+
//#endregion
|
|
7937
|
+
//#region extensions/discord/src/internal/voice.ts
|
|
7858
7938
|
var VoicePlugin = class extends Plugin {
|
|
7859
7939
|
constructor(..._args) {
|
|
7860
7940
|
super(..._args);
|
|
@@ -7889,7 +7969,8 @@ var VoicePlugin = class extends Plugin {
|
|
|
7889
7969
|
};
|
|
7890
7970
|
}
|
|
7891
7971
|
};
|
|
7892
|
-
|
|
7972
|
+
//#endregion
|
|
7973
|
+
//#region extensions/discord/src/monitor/presence.ts
|
|
7893
7974
|
const DEFAULT_CUSTOM_ACTIVITY_TYPE = 4;
|
|
7894
7975
|
const CUSTOM_STATUS_NAME = "Custom Status";
|
|
7895
7976
|
function resolveDiscordPresenceUpdate(config) {
|
|
@@ -7918,7 +7999,8 @@ function resolveDiscordPresenceUpdate(config) {
|
|
|
7918
7999
|
afk: false
|
|
7919
8000
|
};
|
|
7920
8001
|
}
|
|
7921
|
-
|
|
8002
|
+
//#endregion
|
|
8003
|
+
//#region extensions/discord/src/monitor/auto-presence.ts
|
|
7922
8004
|
const DEFAULT_INTERVAL_MS = 3e4;
|
|
7923
8005
|
const DEFAULT_MIN_UPDATE_INTERVAL_MS = 15e3;
|
|
7924
8006
|
const MIN_INTERVAL_MS = 5e3;
|
|
@@ -8037,7 +8119,8 @@ function createDiscordAutoPresenceController(params) {
|
|
|
8037
8119
|
stop: () => scheduler.stop()
|
|
8038
8120
|
};
|
|
8039
8121
|
}
|
|
8040
|
-
|
|
8122
|
+
//#endregion
|
|
8123
|
+
//#region extensions/discord/src/monitor/gateway-metadata.ts
|
|
8041
8124
|
const DISCORD_GATEWAY_BOT_URL = "https://discord.com/api/v10/gateway/bot";
|
|
8042
8125
|
const DISCORD_API_HOST = "discord.com";
|
|
8043
8126
|
const DEFAULT_DISCORD_GATEWAY_URL = "wss://gateway.discord.gg/";
|
|
@@ -8205,7 +8288,8 @@ async function fetchDiscordGatewayMetadataGuarded(input, init, options) {
|
|
|
8205
8288
|
}).catch(() => {});
|
|
8206
8289
|
return response;
|
|
8207
8290
|
}
|
|
8208
|
-
|
|
8291
|
+
//#endregion
|
|
8292
|
+
//#region extensions/discord/src/monitor/gateway-plugin.ts
|
|
8209
8293
|
const DISCORD_GATEWAY_POLICY_VIOLATION_CLOSE_CODE = 1008;
|
|
8210
8294
|
const DISCORD_GATEWAY_WS_RECEIVER_LIMIT_CODE = "WS_ERR_TOO_MANY_BUFFERED_PARTS";
|
|
8211
8295
|
const DISCORD_GATEWAY_CLOSE_REASON_LOG_MAX_CHARS = 240;
|
|
@@ -8435,7 +8519,8 @@ function createDiscordGatewayPlugin(params) {
|
|
|
8435
8519
|
...wsAgent ? { wsAgent } : {}
|
|
8436
8520
|
});
|
|
8437
8521
|
}
|
|
8438
|
-
|
|
8522
|
+
//#endregion
|
|
8523
|
+
//#region extensions/discord/src/monitor/message-handler.preflight-channel-access.ts
|
|
8439
8524
|
function resolveDiscordPreflightChannelAccess(params) {
|
|
8440
8525
|
if (params.isGuildMessage && params.channelConfig?.enabled === false) {
|
|
8441
8526
|
logDebug(`[discord-preflight] drop: channel disabled`);
|
|
@@ -8480,7 +8565,8 @@ function resolveDiscordPreflightChannelAccess(params) {
|
|
|
8480
8565
|
}
|
|
8481
8566
|
return true;
|
|
8482
8567
|
}
|
|
8483
|
-
|
|
8568
|
+
//#endregion
|
|
8569
|
+
//#region extensions/discord/src/monitor/listeners.guild-join.ts
|
|
8484
8570
|
const DISCORD_GUILD_JOIN_INTRO_MAX_AGE_MS = 3e5;
|
|
8485
8571
|
var DiscordGuildJoinIntroductionListener = class extends GuildCreateListener {
|
|
8486
8572
|
constructor(params) {
|
|
@@ -8604,7 +8690,8 @@ var DiscordGuildJoinIntroductionListener = class extends GuildCreateListener {
|
|
|
8604
8690
|
await Promise.allSettled(this.pendingReports);
|
|
8605
8691
|
}
|
|
8606
8692
|
};
|
|
8607
|
-
|
|
8693
|
+
//#endregion
|
|
8694
|
+
//#region extensions/discord/src/monitor/provider.startup.ts
|
|
8608
8695
|
async function createDiscordMonitorClient(params) {
|
|
8609
8696
|
let autoPresenceController = null;
|
|
8610
8697
|
const constructorPlugins = [createDiscordGatewayPlugin(params)];
|
|
@@ -8759,13 +8846,15 @@ function registerDiscordMonitorListeners(params) {
|
|
|
8759
8846
|
}
|
|
8760
8847
|
};
|
|
8761
8848
|
}
|
|
8762
|
-
|
|
8849
|
+
//#endregion
|
|
8850
|
+
//#region extensions/discord/src/monitor/startup-status.ts
|
|
8763
8851
|
function formatDiscordStartupStatusMessage(params) {
|
|
8764
8852
|
const identitySuffix = params.botIdentity ? ` as ${params.botIdentity}` : "";
|
|
8765
8853
|
if (params.gatewayReady) return `logged in to discord${identitySuffix}`;
|
|
8766
8854
|
return `discord client initialized${identitySuffix}; awaiting gateway readiness`;
|
|
8767
8855
|
}
|
|
8768
|
-
|
|
8856
|
+
//#endregion
|
|
8857
|
+
//#region extensions/discord/src/monitor/provider.ts
|
|
8769
8858
|
const DEFAULT_DISCORD_MEDIA_MAX_MB = 100;
|
|
8770
8859
|
const DISCORD_DISALLOWED_INTENTS_CODE = GatewayCloseCodes$1.DisallowedIntents;
|
|
8771
8860
|
function formatThreadBindingDurationForConfigLabel(durationMs) {
|
|
@@ -9145,4 +9234,5 @@ async function monitorDiscordProvider(opts) {
|
|
|
9145
9234
|
});
|
|
9146
9235
|
}
|
|
9147
9236
|
}
|
|
9237
|
+
//#endregion
|
|
9148
9238
|
export { resolveDiscordDmCommandAccess as A, buildDiscordGroupSystemPrompt as C, createDiscordLivePolicyReader as D, handleDiscordDmCommandDecision as E, mapGatewayDispatchData as O, createDiscordNativeCommand as S, createDiscordSupplementalContextAccessChecker 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, resolveDiscordTextCommandAccess as j, registerDiscordListener 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, buildDiscordInboundAccessContext as w, resolveVoiceTimeoutMs as x, logVoiceVerbose as y };
|