@openclaw/discord 2026.8.1 → 2026.8.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/account-inspect-BY-ve3yH.js +45 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-CfQ-vSyf.js → accounts-CwJQoLjM.js} +89 -45
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-Dl-TOyOX.js → activities-api-CkKcHUB6.js} +14 -13
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-BDMimASD.js → allow-list-C2JuH-R0.js} +10 -6
- package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
- package/dist/api.js +17 -17
- package/dist/{approval-handler.runtime-q4Zqo44V.js → approval-handler.runtime-DZM6Kt1Z.js} +8 -7
- package/dist/{audit-DgrvFPGt.js → audit-DIbQA4VT.js} +8 -7
- package/dist/{channel-BsQUalPw.js → channel-CarzU3bg.js} +24 -22
- package/dist/{channel-actions.runtime-UMGGIfSy.js → channel-actions.runtime-B2wMqeVK.js} +13 -11
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-rPs4dsk_.js → channel.setup-z_ewMVa9.js} +18 -18
- package/dist/{components-Dk35LTf_.js → components-gvRA0oaI.js} +1 -1
- package/dist/{config-schema-CxPqtVI1.js → config-schema-B797-Spt.js} +5 -4
- package/dist/{conversation-binding-route-BjvX4e35.js → conversation-binding-route-DPpBRpYI.js} +1 -1
- package/dist/{directory-config-B7DY_pNG.js → directory-config-AA8wQx0D.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DuAXKkan.js → directory-live-D_kFz_Fj.js} +4 -4
- package/dist/{doctor-zQTtn6hm.js → doctor-QQTOkBfW.js} +5 -5
- package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
- package/dist/doctor-contract-api.js +3 -2
- package/dist/{handle-action.guild-admin-DZewwLr1.js → handle-action.guild-admin-Cc88ZGon.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{ingress-identity-CzZKcPK8.js → ingress-identity-BCzfPPYM.js} +1 -1
- package/dist/{message-handler-C5By3yl5.js → message-handler-CAeEpqWo.js} +14 -10
- package/dist/{message-handler.preflight-DrszWuHw.js → message-handler.preflight-CoKoE3dY.js} +24 -19
- package/dist/{message-handler.process-DyFPDLCt.js → message-handler.process-cdIJ_fDT.js} +56 -74
- package/dist/{message-text-Ca8M6TU8.js → message-text-C0K4-fkg.js} +9 -4
- package/dist/{outbound-adapter-Dif8p481.js → outbound-adapter-Ch0At5Ra.js} +34 -24
- package/dist/{outbound-components-wjv7yyAj.js → outbound-components-Bnt_7x7r.js} +3 -3
- package/dist/{outbound-session-route-Bn4uXaoE.js → outbound-session-route-CzzerX2K.js} +10 -7
- package/dist/{owner-access-UlYi9t0M.js → owner-access-yc1sX7Gx.js} +7 -6
- package/dist/{pluralkit-9EuEN4UD.js → pluralkit-B3cUVI7i.js} +2 -2
- package/dist/{probe-n6ZXxK8V.js → probe-3ovFAp3b.js} +3 -3
- package/dist/{probe.runtime-CN4bdPfZ.js → probe.runtime-BckHn3cJ.js} +1 -1
- package/dist/{provider-LXiOcJrH.js → provider-CjI8BSzS.js} +97 -76
- package/dist/{provider-session.runtime-DSNe7r2W.js → provider-session.runtime-DdKRMcE9.js} +3 -3
- package/dist/provider.runtime-Bo1WbLLr.js +2 -0
- package/dist/{realtime-session.runtime-DOViOIjY.js → realtime-session.runtime-37IC-p5K.js} +5 -5
- package/dist/{resolve-allowlist-common-BLoYaxEG.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
- package/dist/{resolve-channels-D2yl_2CN.js → resolve-channels-BexR2eUn.js} +4 -4
- package/dist/{resolve-users-BLxfqajZ.js → resolve-users-BtXBCH5W.js} +5 -4
- package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
- package/dist/{retry-DqHCW6PV.js → retry-t5RcEsPk.js} +37 -29
- package/dist/{runtime-DrxVBTtp.js → runtime-BNlDfLwS.js} +2 -2
- package/dist/{runtime-BYamRVPN.js → runtime-DydyfxST.js} +126 -92
- package/dist/runtime-api.js +19 -19
- package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-UJHiAm4C.js → send-mTKSBdmZ.js} +76 -48
- package/dist/{send.components-CrBJpGT_.js → send.components-nsPnc7kK.js} +20 -14
- package/dist/{send.outbound-D7JYmfm9.js → send.outbound-CaOs9Zy1.js} +34 -20
- package/dist/{send.shared-DZJ1akvQ.js → send.shared-BJHt0Vyf.js} +24 -17
- package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-Dii2HTn7.js → shared-BNesVA4P.js} +17 -14
- package/dist/{subagent-hooks-JyGrtQIl.js → subagent-hooks-IeZVPLGj.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-BEmcj4xJ.js → system-events-Be5EJI3b.js} +2 -2
- package/dist/{target-resolver-V-IYae6s.js → target-resolver-C0MnwEki.js} +6 -5
- package/dist/targets-DQSye1Rv.js +3 -0
- package/dist/{thread-bindings-DvYP79fy.js → thread-bindings-wECUSIIG.js} +6 -5
- package/dist/{thread-bindings.manager-Clm77DBM.js → thread-bindings.manager-B-3UHCc1.js} +28 -25
- package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
- package/dist/{threading-CXuu_7o9.js → threading-te5ADPQI.js} +8 -6
- package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
- package/dist/{transcripts-source-BLEMH_yi.js → transcripts-source-DkUhR7YK.js} +3 -3
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-B9snnwMe.js → typing-DAwJF5VT.js} +2 -2
- package/dist/{voice-runtime-DY6_o73o.js → voice-runtime-COyYYTDD.js} +348 -14
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +2 -2
- package/package.json +5 -5
- package/dist/account-inspect-BDfKyuvL.js +0 -89
- package/dist/provider.runtime-DiInaDXO.js +0 -2
- package/dist/sdk-runtime-6tfgYDjY.js +0 -338
- package/dist/targets-CQp53cGj.js +0 -3
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { A as ThreadUpdateListener, C as MessageCreateListener, D as ReadyListener, E as PresenceUpdateListener, G as User, H as CommandWithSubcommands, I as RateLimitError, K as hasDiscordV2Components, M as Client, N as Plugin, S as InteractionCreateListener, T as MessageReactionRemoveListener, U as Guild, V as Command, W as Message, Z as Modal, a as chunkDiscordTextWithMode, b as GuildCreateListener, ct as Row, dt as StringSelectMenu, et as Button, ft as TextDisplay, ht as BaseMessageInteractiveComponent, k as ThreadDeleteListener, nt as Container, ut as Separator, w as MessageReactionAddListener, x as GuildDeleteListener, y as discord_exports } from "./retry-
|
|
2
|
-
import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-
|
|
3
|
-
import { c as resolveDiscordAccount, f as resolveDiscordAccountDmPolicy, l as resolveDiscordAccountAllowFrom, m as normalizeDiscordToken, p as resolveDiscordMaxLinesPerMessage } from "./accounts-
|
|
4
|
-
import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-
|
|
1
|
+
import { A as ThreadUpdateListener, C as MessageCreateListener, D as ReadyListener, E as PresenceUpdateListener, G as User, H as CommandWithSubcommands, I as RateLimitError, K as hasDiscordV2Components, M as Client, N as Plugin, S as InteractionCreateListener, T as MessageReactionRemoveListener, U as Guild, V as Command, W as Message, Z as Modal, a as chunkDiscordTextWithMode, b as GuildCreateListener, ct as Row, dt as StringSelectMenu, et as Button, ft as TextDisplay, ht as BaseMessageInteractiveComponent, k as ThreadDeleteListener, nt as Container, ut as Separator, w as MessageReactionAddListener, x as GuildDeleteListener, y as discord_exports } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { C as parseDiscordActivityCustomIdForInteraction, D as parseDiscordModalCustomIdForInteraction, E as parseDiscordModalCustomId, O as decodeCustomIdComponent, T as parseDiscordComponentCustomIdForInteraction, c as parseExecApprovalData, k as encodeCustomIdComponent, o as parseDiscordQuestionData, w as parseDiscordComponentCustomId, y as buildDiscordActivityCustomId } from "./components-gvRA0oaI.js";
|
|
3
|
+
import { c as resolveDiscordAccount, f as resolveDiscordAccountDmPolicy, l as resolveDiscordAccountAllowFrom, m as normalizeDiscordToken, p as resolveDiscordMaxLinesPerMessage } from "./accounts-CwJQoLjM.js";
|
|
4
|
+
import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-nsPnc7kK.js";
|
|
5
5
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
6
|
-
import { a as isDiscordRateLimitResponseBody, o as summarizeDiscordResponseBody } from "./api-
|
|
7
|
-
import { C as resolveTimestampMs, a as normalizeDiscordSlug, b as formatDiscordReactionEmoji, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordCommandOwnerAllowFrom, f as resolveDiscordGuildEntry, g as resolveDiscordOwnerAllowFrom, h as resolveDiscordOwnerAccess, i as normalizeDiscordDisplaySlug, l as resolveDiscordChannelPolicyCommandAuthorizer, m as resolveDiscordMemberAllowed, n as isDiscordGroupAllowedByPolicy, o as resolveDiscordAllowListMatch, p as resolveDiscordMemberAccessState, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, v as resolveGroupDmAllow, x as formatDiscordUserTag, y as shouldEmitDiscordReactionNotification } from "./allow-list-
|
|
8
|
-
import { B as validateDiscordProxyUrl, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, b as canViewDiscordGuildChannel, w as hasAnyChannelPermissionDiscord } from "./send.shared-
|
|
9
|
-
import { a as formatMention, t as sendMessageDiscord } from "./send.outbound-
|
|
6
|
+
import { a as isDiscordRateLimitResponseBody, o as summarizeDiscordResponseBody } from "./api-BfmEP6wp.js";
|
|
7
|
+
import { C as resolveTimestampMs, a as normalizeDiscordSlug, b as formatDiscordReactionEmoji, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordCommandOwnerAllowFrom, f as resolveDiscordGuildEntry, g as resolveDiscordOwnerAllowFrom, h as resolveDiscordOwnerAccess, i as normalizeDiscordDisplaySlug, l as resolveDiscordChannelPolicyCommandAuthorizer, m as resolveDiscordMemberAllowed, n as isDiscordGroupAllowedByPolicy, o as resolveDiscordAllowListMatch, p as resolveDiscordMemberAccessState, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, v as resolveGroupDmAllow, x as formatDiscordUserTag, y as shouldEmitDiscordReactionNotification } from "./allow-list-C2JuH-R0.js";
|
|
8
|
+
import { B as validateDiscordProxyUrl, G as unregisterGateway, P as createDiscordRestClient, R as DISCORD_REST_TIMEOUT_MS, V as withValidatedDiscordProxy, W as registerGateway, b as canViewDiscordGuildChannel, w as hasAnyChannelPermissionDiscord } from "./send.shared-BJHt0Vyf.js";
|
|
9
|
+
import { a as formatMention, t as sendMessageDiscord } from "./send.outbound-CaOs9Zy1.js";
|
|
10
10
|
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
11
|
-
import { n as getDiscordActivitiesRuntime } from "./runtime-
|
|
12
|
-
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-
|
|
11
|
+
import { n as getDiscordActivitiesRuntime } from "./runtime-BNlDfLwS.js";
|
|
12
|
+
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-yc1sX7Gx.js";
|
|
13
13
|
import { i as setPresence, t as clearPresences } from "./presence-cache-z1N8MbJ3.js";
|
|
14
|
-
import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-
|
|
15
|
-
import { c as raceWithTimeout, u as withAbortTimeout } from "./timeouts-
|
|
16
|
-
import { S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, c as resolveDiscordEffectiveRoute, i as buildDiscordConversationRouteContext, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, o as resolveDiscordBoundConversationRoute, r as formatDiscordApprovalDisplayValue, u as resolveDiscordConversationIdentity } from "./outbound-session-route-
|
|
17
|
-
import { t as discordIngressIdentity } from "./ingress-identity-
|
|
18
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
19
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
20
|
-
import { a as isThreadArchived, c as resolveDiscordChannelInfoSafe, f as resolveDiscordChannelTopicSafe, h as formatThreadBindingDurationLabel, l as resolveDiscordChannelNameSafe, r as getThreadBindingManager, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-
|
|
21
|
-
import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-
|
|
14
|
+
import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-mTKSBdmZ.js";
|
|
15
|
+
import { c as raceWithTimeout, u as withAbortTimeout } from "./timeouts-D86uWLt_.js";
|
|
16
|
+
import { S as isDiscordExecApprovalClientEnabled, b as getDiscordExecApprovalApprovers, c as resolveDiscordEffectiveRoute, i as buildDiscordConversationRouteContext, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, o as resolveDiscordBoundConversationRoute, r as formatDiscordApprovalDisplayValue, u as resolveDiscordConversationIdentity } from "./outbound-session-route-CzzerX2K.js";
|
|
17
|
+
import { t as discordIngressIdentity } from "./ingress-identity-BCzfPPYM.js";
|
|
18
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BexR2eUn.js";
|
|
19
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BtXBCH5W.js";
|
|
20
|
+
import { a as isThreadArchived, c as resolveDiscordChannelInfoSafe, f as resolveDiscordChannelTopicSafe, h as formatThreadBindingDurationLabel, l as resolveDiscordChannelNameSafe, r as getThreadBindingManager, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-B-3UHCc1.js";
|
|
21
|
+
import { a as probeDiscordApplicationId, r as parseApplicationIdFromToken } from "./probe-3ovFAp3b.js";
|
|
22
22
|
import { i as sanitizeRecentModels, n as normalizeModelRef, r as preferenceTimestampMs, t as buildPreferenceModelKey } from "./model-picker-preference-primitives-BHT1LkR_.js";
|
|
23
|
-
import {
|
|
24
|
-
import { i as resolveDiscordThreadParentInfo } from "./threading-
|
|
25
|
-
import { t as resolveDiscordSenderIdentity } from "./sender-identity-
|
|
23
|
+
import { m as resolveDiscordChannelInfo, u as resolveDiscordMessageStickers } from "./message-text-C0K4-fkg.js";
|
|
24
|
+
import { i as resolveDiscordThreadParentInfo } from "./threading-te5ADPQI.js";
|
|
25
|
+
import { t as resolveDiscordSenderIdentity } from "./sender-identity-Dt0imZyY.js";
|
|
26
26
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
27
27
|
import { ApplicationCommandOptionType, ButtonStyle, ChannelType, ComponentType, GatewayCloseCodes, GatewayCloseCodes as GatewayCloseCodes$1, GatewayDispatchEvents, GatewayIntentBits, GatewayOpcodes, PermissionFlagsBits } from "discord-api-types/v10";
|
|
28
28
|
import { Type } from "typebox";
|
|
@@ -144,7 +144,7 @@ async function runDiscordListenerWithSlowLog(params) {
|
|
|
144
144
|
}
|
|
145
145
|
//#endregion
|
|
146
146
|
//#region extensions/discord/src/monitor/presence-events.ts
|
|
147
|
-
const DISCORD_PRESENCE_GREETING_COOLDOWN_MS =
|
|
147
|
+
const DISCORD_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
148
148
|
function isDiscordOnlineStatus(status) {
|
|
149
149
|
return status === "online" || status === "idle" || status === "dnd";
|
|
150
150
|
}
|
|
@@ -183,9 +183,9 @@ function openDiscordPresenceCooldownStore() {
|
|
|
183
183
|
}
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region extensions/discord/src/monitor/presence-emission-gate.ts
|
|
186
|
-
const DISCORD_PRESENCE_RECONNECT_SUPPRESS_MS =
|
|
186
|
+
const DISCORD_PRESENCE_RECONNECT_SUPPRESS_MS = 3e5;
|
|
187
187
|
const DISCORD_PRESENCE_BURST_LIMIT = 8;
|
|
188
|
-
const DISCORD_PRESENCE_BURST_WINDOW_MS =
|
|
188
|
+
const DISCORD_PRESENCE_BURST_WINDOW_MS = 6e4;
|
|
189
189
|
function resolveDiscordPresenceGateOptions(config) {
|
|
190
190
|
return {
|
|
191
191
|
reconnectSuppressMs: config?.reconnectSuppressSeconds !== void 0 ? config.reconnectSuppressSeconds * 1e3 : DISCORD_PRESENCE_RECONNECT_SUPPRESS_MS,
|
|
@@ -808,7 +808,7 @@ async function handleDiscordReactionEvent(params) {
|
|
|
808
808
|
};
|
|
809
809
|
const emitReaction = (text, parentPeerId) => {
|
|
810
810
|
const { contextKey } = resolveReactionBase();
|
|
811
|
-
|
|
811
|
+
const route = resolveAgentRoute({
|
|
812
812
|
cfg: params.cfg,
|
|
813
813
|
channel: "discord",
|
|
814
814
|
accountId: params.accountId,
|
|
@@ -822,7 +822,8 @@ async function handleDiscordReactionEvent(params) {
|
|
|
822
822
|
kind: "channel",
|
|
823
823
|
id: parentPeerId
|
|
824
824
|
} : void 0
|
|
825
|
-
})
|
|
825
|
+
});
|
|
826
|
+
enqueueRoutedSystemEvent(text, route, { contextKey });
|
|
826
827
|
};
|
|
827
828
|
const shouldNotifyReaction = (options) => shouldEmitDiscordReactionNotification({
|
|
828
829
|
mode: options.mode,
|
|
@@ -1664,7 +1665,7 @@ function buildDiscordCommandArgMenu(params) {
|
|
|
1664
1665
|
const commandLabel = command.nativeName ?? command.key;
|
|
1665
1666
|
const userId = interaction.user?.id ?? "";
|
|
1666
1667
|
const rows = chunkItems(menu.choices, 4).map((choices) => {
|
|
1667
|
-
|
|
1668
|
+
const buttons = choices.map((choice) => new DiscordCommandArgButton({
|
|
1668
1669
|
label: choice.label,
|
|
1669
1670
|
customId: buildDiscordCommandArgCustomId({
|
|
1670
1671
|
command: commandLabel,
|
|
@@ -1675,7 +1676,8 @@ function buildDiscordCommandArgMenu(params) {
|
|
|
1675
1676
|
ctx: params.ctx,
|
|
1676
1677
|
safeInteractionCall: params.safeInteractionCall,
|
|
1677
1678
|
dispatchCommandInteraction: params.dispatchCommandInteraction
|
|
1678
|
-
}))
|
|
1679
|
+
}));
|
|
1680
|
+
return new Row(buttons);
|
|
1679
1681
|
});
|
|
1680
1682
|
return {
|
|
1681
1683
|
content: formatCommandArgMenuTitle({
|
|
@@ -2580,7 +2582,7 @@ function buildBucketSelectRow(params) {
|
|
|
2580
2582
|
value: bucket.id,
|
|
2581
2583
|
default: bucket.id === params.currentBucketId
|
|
2582
2584
|
}));
|
|
2583
|
-
|
|
2585
|
+
const select = createModelSelect({
|
|
2584
2586
|
customId: buildDiscordModelPickerCustomId({
|
|
2585
2587
|
command: params.command,
|
|
2586
2588
|
action: "bucket",
|
|
@@ -2595,7 +2597,8 @@ function buildBucketSelectRow(params) {
|
|
|
2595
2597
|
}),
|
|
2596
2598
|
options,
|
|
2597
2599
|
placeholder: params.view === "providers" ? "Filter providers by letter range" : "Filter models by letter range"
|
|
2598
|
-
})
|
|
2600
|
+
});
|
|
2601
|
+
return new Row([select]);
|
|
2599
2602
|
}
|
|
2600
2603
|
function getRuntimeChoices(params) {
|
|
2601
2604
|
const choices = params.data.runtimeChoicesByProvider?.get(normalizeProviderId(params.provider));
|
|
@@ -3021,7 +3024,7 @@ function formatRecentsButtonLabel(modelRef, suffix) {
|
|
|
3021
3024
|
const maxLen = 80;
|
|
3022
3025
|
const label = suffix ? `${modelRef} ${suffix}` : modelRef;
|
|
3023
3026
|
if (label.length <= maxLen) return label;
|
|
3024
|
-
return suffix ? `${sliceUtf16Safe(modelRef, 0, maxLen - suffix.length - 2)}… ${suffix}` : `${sliceUtf16Safe(modelRef, 0,
|
|
3027
|
+
return suffix ? `${sliceUtf16Safe(modelRef, 0, maxLen - suffix.length - 2)}… ${suffix}` : `${sliceUtf16Safe(modelRef, 0, 79)}…`;
|
|
3025
3028
|
}
|
|
3026
3029
|
function createModelRefToken(modelRef) {
|
|
3027
3030
|
const parsed = parseCurrentModelRef(modelRef);
|
|
@@ -3262,12 +3265,13 @@ function resolveDiscordModelPickerCurrentModel(params) {
|
|
|
3262
3265
|
const fallback = `${params.data.resolvedDefault.provider}/${params.data.resolvedDefault.model}`;
|
|
3263
3266
|
try {
|
|
3264
3267
|
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.route.agentId });
|
|
3268
|
+
const sessionEntry = getSessionEntry({
|
|
3269
|
+
storePath,
|
|
3270
|
+
sessionKey: params.route.sessionKey,
|
|
3271
|
+
readConsistency: "latest"
|
|
3272
|
+
});
|
|
3265
3273
|
const override = resolveStoredModelOverride({
|
|
3266
|
-
sessionEntry
|
|
3267
|
-
storePath,
|
|
3268
|
-
sessionKey: params.route.sessionKey,
|
|
3269
|
-
readConsistency: "latest"
|
|
3270
|
-
}),
|
|
3274
|
+
sessionEntry,
|
|
3271
3275
|
loadSessionEntry: (sessionKey) => getSessionEntry({
|
|
3272
3276
|
storePath,
|
|
3273
3277
|
sessionKey,
|
|
@@ -3286,8 +3290,9 @@ function resolveDiscordModelPickerCurrentModel(params) {
|
|
|
3286
3290
|
}
|
|
3287
3291
|
function resolveDiscordModelPickerCurrentRuntime(params) {
|
|
3288
3292
|
try {
|
|
3293
|
+
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.route.agentId });
|
|
3289
3294
|
const sessionRuntime = normalizeOptionalString(getSessionEntry({
|
|
3290
|
-
storePath
|
|
3295
|
+
storePath,
|
|
3291
3296
|
sessionKey: params.route.sessionKey,
|
|
3292
3297
|
readConsistency: "latest"
|
|
3293
3298
|
})?.agentRuntimeOverride);
|
|
@@ -3943,7 +3948,8 @@ function buildDiscordCommandOptions(params) {
|
|
|
3943
3948
|
await interaction.respond([]);
|
|
3944
3949
|
return;
|
|
3945
3950
|
}
|
|
3946
|
-
const
|
|
3951
|
+
const focused = interaction.options.getFocused();
|
|
3952
|
+
const focusValue = normalizeLowercaseStringOrEmpty(focused?.value);
|
|
3947
3953
|
const context = typeof arg.choices === "function" && resolveChoiceContext ? await resolveChoiceContext(interaction) : null;
|
|
3948
3954
|
const currentCfg = resolveConfig?.() ?? cfg;
|
|
3949
3955
|
const choiceCatalog = command.key === "think" ? getPreparedModelCatalogSnapshot({
|
|
@@ -4826,7 +4832,7 @@ const READY_STATE_OPEN = 1;
|
|
|
4826
4832
|
const DEFAULT_GATEWAY_URL = "wss://gateway.discord.gg/";
|
|
4827
4833
|
const DISCORD_GATEWAY_PAYLOAD_LIMIT_BYTES = 4096;
|
|
4828
4834
|
const DISCORD_GATEWAY_WS_CLIENT_OPTIONS = Object.freeze({
|
|
4829
|
-
maxPayload:
|
|
4835
|
+
maxPayload: 16777216,
|
|
4830
4836
|
handshakeTimeout: 3e4
|
|
4831
4837
|
});
|
|
4832
4838
|
const INVALID_SESSION_MIN_DELAY_MS = 1e3;
|
|
@@ -5011,12 +5017,10 @@ var GatewayPlugin = class extends Plugin {
|
|
|
5011
5017
|
minDelayMs: INVALID_SESSION_MIN_DELAY_MS + Math.floor(Math.random() * INVALID_SESSION_JITTER_MS)
|
|
5012
5018
|
});
|
|
5013
5019
|
break;
|
|
5014
|
-
case GatewayOpcodes.Reconnect:
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
});
|
|
5019
|
-
break;
|
|
5020
|
+
case GatewayOpcodes.Reconnect: this.scheduleReconnect({
|
|
5021
|
+
reason: "reconnect-opcode",
|
|
5022
|
+
preferResume: true
|
|
5023
|
+
});
|
|
5020
5024
|
}
|
|
5021
5025
|
}
|
|
5022
5026
|
startHeartbeat(intervalMs) {
|
|
@@ -5458,7 +5462,7 @@ const DEFAULT_DISCORD_GATEWAY_URL = "wss://gateway.discord.gg/";
|
|
|
5458
5462
|
const DEFAULT_DISCORD_GATEWAY_INFO_TIMEOUT_MS = 3e4;
|
|
5459
5463
|
const MAX_DISCORD_GATEWAY_INFO_TIMEOUT_MS = 12e4;
|
|
5460
5464
|
const DISCORD_GATEWAY_INFO_TIMEOUT_ENV = "OPENCLAW_DISCORD_GATEWAY_INFO_TIMEOUT_MS";
|
|
5461
|
-
const DISCORD_GATEWAY_METADATA_MAX_BYTES =
|
|
5465
|
+
const DISCORD_GATEWAY_METADATA_MAX_BYTES = 4194304;
|
|
5462
5466
|
const DISCORD_GATEWAY_METADATA_FALLBACK_LOG_INTERVAL_MS = 6e4;
|
|
5463
5467
|
const discordGatewayBotInfoSchema = Type.Object({
|
|
5464
5468
|
url: Type.String({ minLength: 1 }),
|
|
@@ -6496,7 +6500,7 @@ async function runDiscordGatewayLifecycle(params) {
|
|
|
6496
6500
|
gatewayEmitter?.removeListener(DISCORD_GATEWAY_TRANSPORT_ACTIVITY_EVENT, onGatewayTransportActivity);
|
|
6497
6501
|
if (params.voiceManager) {
|
|
6498
6502
|
await params.voiceManager.destroy();
|
|
6499
|
-
const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-
|
|
6503
|
+
const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-DkUhR7YK.js").then((n) => n.n);
|
|
6500
6504
|
setDiscordTranscriptsVoiceManager({
|
|
6501
6505
|
accountId: params.accountId,
|
|
6502
6506
|
manager: null
|
|
@@ -6511,7 +6515,7 @@ async function runDiscordGatewayLifecycle(params) {
|
|
|
6511
6515
|
let discordVoiceRuntimePromise;
|
|
6512
6516
|
let discordProviderSessionRuntimePromise;
|
|
6513
6517
|
async function loadDiscordVoiceRuntime() {
|
|
6514
|
-
const promise = discordVoiceRuntimePromise ?? import("./voice-runtime-
|
|
6518
|
+
const promise = discordVoiceRuntimePromise ?? import("./voice-runtime-COyYYTDD.js").then((n) => n.t);
|
|
6515
6519
|
discordVoiceRuntimePromise = promise;
|
|
6516
6520
|
try {
|
|
6517
6521
|
return await promise;
|
|
@@ -6521,7 +6525,7 @@ async function loadDiscordVoiceRuntime() {
|
|
|
6521
6525
|
}
|
|
6522
6526
|
}
|
|
6523
6527
|
async function loadDiscordProviderSessionRuntime() {
|
|
6524
|
-
const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-
|
|
6528
|
+
const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-DdKRMcE9.js");
|
|
6525
6529
|
discordProviderSessionRuntimePromise = promise;
|
|
6526
6530
|
try {
|
|
6527
6531
|
return await promise;
|
|
@@ -6548,11 +6552,15 @@ const discordProviderRuntime = {
|
|
|
6548
6552
|
//#endregion
|
|
6549
6553
|
//#region extensions/discord/src/monitor/provider.acp.ts
|
|
6550
6554
|
const DISCORD_ACP_STATUS_PROBE_TIMEOUT_MS = 8e3;
|
|
6551
|
-
const DISCORD_ACP_STALE_RUNNING_ACTIVITY_MS =
|
|
6555
|
+
const DISCORD_ACP_STALE_RUNNING_ACTIVITY_MS = 12e4;
|
|
6552
6556
|
function isLegacyMissingSessionError(message) {
|
|
6553
6557
|
return message.includes("Session is not ACP-enabled") || message.includes("ACP session metadata missing");
|
|
6554
6558
|
}
|
|
6555
6559
|
function classifyAcpStatusProbeError(params) {
|
|
6560
|
+
if (params.isAcpRuntimeError(params.error) && ["SESSION_OWNER_MIGRATION_REQUIRED", "SESSION_OWNER_UNSUPPORTED"].includes(params.error.detailCode ?? "")) return {
|
|
6561
|
+
status: "uncertain",
|
|
6562
|
+
reason: formatErrorMessage$1(params.error)
|
|
6563
|
+
};
|
|
6556
6564
|
if (params.isAcpRuntimeError(params.error) && params.error.code === "ACP_SESSION_INIT_FAILED") return {
|
|
6557
6565
|
status: "stale",
|
|
6558
6566
|
reason: "session-init-failed"
|
|
@@ -6580,18 +6588,20 @@ async function probeDiscordAcpBindingHealth(params) {
|
|
|
6580
6588
|
const { getAcpSessionManager, isAcpRuntimeError } = params.providerSessionRuntime;
|
|
6581
6589
|
const manager = getAcpSessionManager();
|
|
6582
6590
|
const statusProbeAbortController = new AbortController();
|
|
6591
|
+
const statusPromise = manager.getSessionStatus({
|
|
6592
|
+
cfg: params.cfg,
|
|
6593
|
+
sessionKey: params.sessionKey,
|
|
6594
|
+
agentId: params.agentId,
|
|
6595
|
+
signal: statusProbeAbortController.signal
|
|
6596
|
+
}).then((status) => ({
|
|
6597
|
+
kind: "status",
|
|
6598
|
+
status
|
|
6599
|
+
})).catch((error) => ({
|
|
6600
|
+
kind: "error",
|
|
6601
|
+
error
|
|
6602
|
+
}));
|
|
6583
6603
|
const result = await raceWithTimeout({
|
|
6584
|
-
promise:
|
|
6585
|
-
cfg: params.cfg,
|
|
6586
|
-
sessionKey: params.sessionKey,
|
|
6587
|
-
signal: statusProbeAbortController.signal
|
|
6588
|
-
}).then((status) => ({
|
|
6589
|
-
kind: "status",
|
|
6590
|
-
status
|
|
6591
|
-
})).catch((error) => ({
|
|
6592
|
-
kind: "error",
|
|
6593
|
-
error
|
|
6594
|
-
})),
|
|
6604
|
+
promise: statusPromise,
|
|
6595
6605
|
timeoutMs: DISCORD_ACP_STATUS_PROBE_TIMEOUT_MS,
|
|
6596
6606
|
onTimeout: () => ({ kind: "timeout" })
|
|
6597
6607
|
});
|
|
@@ -6762,7 +6772,8 @@ async function resolveGuildEntriesByChannelAllowlist(params) {
|
|
|
6762
6772
|
};
|
|
6763
6773
|
}
|
|
6764
6774
|
}
|
|
6765
|
-
|
|
6775
|
+
const mapping = [...mappingByTarget.values()].map((group) => formatDiscordChannelResolvedGroup(group));
|
|
6776
|
+
summarizeMapping("discord channels", mapping, unresolved, params.runtime);
|
|
6766
6777
|
return nextGuilds;
|
|
6767
6778
|
} catch (err) {
|
|
6768
6779
|
params.runtime.log?.(`discord channel resolve failed; using config entries. ${formatErrorMessage$1(err)}`);
|
|
@@ -6773,11 +6784,12 @@ async function resolveAllowFromByUserAllowlist(params) {
|
|
|
6773
6784
|
const allowEntries = normalizeStringEntries(params.allowFrom).filter((entry) => entry !== "*");
|
|
6774
6785
|
if (allowEntries.length === 0) return params.allowFrom;
|
|
6775
6786
|
try {
|
|
6776
|
-
const
|
|
6787
|
+
const resolvedUsers = await resolveDiscordUserAllowlist({
|
|
6777
6788
|
token: params.token,
|
|
6778
6789
|
entries: allowEntries,
|
|
6779
6790
|
fetcher: params.fetcher
|
|
6780
|
-
})
|
|
6791
|
+
});
|
|
6792
|
+
const { resolvedMap, mapping, unresolved } = buildAllowlistResolutionSummary(resolvedUsers, {
|
|
6781
6793
|
formatResolved: formatDiscordUserResolved,
|
|
6782
6794
|
formatUnresolved: formatDiscordUserUnresolved
|
|
6783
6795
|
});
|
|
@@ -6806,11 +6818,12 @@ async function resolveGuildEntriesByUserAllowlist(params) {
|
|
|
6806
6818
|
const userEntries = collectGuildUserEntries(params.guildEntries);
|
|
6807
6819
|
if (userEntries.size === 0) return params.guildEntries;
|
|
6808
6820
|
try {
|
|
6809
|
-
const
|
|
6821
|
+
const resolvedUsers = await resolveDiscordUserAllowlist({
|
|
6810
6822
|
token: params.token,
|
|
6811
6823
|
entries: Array.from(userEntries),
|
|
6812
6824
|
fetcher: params.fetcher
|
|
6813
|
-
})
|
|
6825
|
+
});
|
|
6826
|
+
const { resolvedMap, mapping, unresolved } = buildAllowlistResolutionSummary(resolvedUsers, {
|
|
6814
6827
|
formatResolved: formatDiscordUserResolved,
|
|
6815
6828
|
formatUnresolved: formatDiscordUserUnresolved
|
|
6816
6829
|
});
|
|
@@ -7185,7 +7198,7 @@ function logDiscordResolvedConfig(params) {
|
|
|
7185
7198
|
limit: 4,
|
|
7186
7199
|
emptyText: "any"
|
|
7187
7200
|
});
|
|
7188
|
-
logVerbose(`discord: config dm=${params.dmEnabled ? "on" : "off"} dmPolicy=${params.dmPolicy} allowFrom=${allowFromSummary} groupDm=${params.groupDmEnabled ? "on" : "off"} groupDmChannels=${groupDmChannelSummary} groupPolicy=${params.groupPolicy} guilds=${guildSummary} historyLimit=${params.historyLimit} mediaMaxMb=${Math.round(params.mediaMaxBytes /
|
|
7201
|
+
logVerbose(`discord: config dm=${params.dmEnabled ? "on" : "off"} dmPolicy=${params.dmPolicy} allowFrom=${allowFromSummary} groupDm=${params.groupDmEnabled ? "on" : "off"} groupDmChannels=${groupDmChannelSummary} groupPolicy=${params.groupPolicy} guilds=${guildSummary} historyLimit=${params.historyLimit} mediaMaxMb=${Math.round(params.mediaMaxBytes / 1048576)} native=${params.nativeEnabled ? "on" : "off"} nativeSkills=${params.nativeSkillsEnabled ? "on" : "off"} accessGroups=${params.useAccessGroups ? "on" : "off"} threadBindings=${params.threadBindingsEnabled ? "on" : "off"} threadIdleTimeout=${formatThreadBindingDurationForConfigLabel(params.threadBindingIdleTimeoutMs)} threadMaxAge=${formatThreadBindingDurationForConfigLabel(params.threadBindingMaxAgeMs)}`);
|
|
7189
7202
|
}
|
|
7190
7203
|
//#endregion
|
|
7191
7204
|
//#region extensions/discord/src/monitor/provider.deploy-errors.ts
|
|
@@ -8173,7 +8186,9 @@ function stripDiscordInternalChannelLines(text) {
|
|
|
8173
8186
|
return kept.join("\n");
|
|
8174
8187
|
}
|
|
8175
8188
|
function sanitizeDiscordFrontChannelText(text) {
|
|
8176
|
-
|
|
8189
|
+
const withoutToolCallBlocks = stripPlainTextToolCallBlocks(text, { resolveProtectedRanges: findCodeRegions });
|
|
8190
|
+
const withoutAssistantScaffolding = sanitizeAssistantVisibleText(withoutToolCallBlocks);
|
|
8191
|
+
return collapseExcessBlankLines(stripDiscordInternalChannelLines(stripPlainTextToolCallBlocks(withoutAssistantScaffolding, { resolveProtectedRanges: findCodeRegions }))).trim();
|
|
8177
8192
|
}
|
|
8178
8193
|
function sanitizeDiscordFrontChannelReplyPayloads(payloads, options = {}) {
|
|
8179
8194
|
const preserveVerboseToolProgress = options.kind === "tool";
|
|
@@ -8212,7 +8227,8 @@ function resolveBoundThreadBinding(params) {
|
|
|
8212
8227
|
}
|
|
8213
8228
|
function resolveBindingIdentity(cfg, binding) {
|
|
8214
8229
|
if (!binding) return;
|
|
8215
|
-
const
|
|
8230
|
+
const displayName = `🤖 ${binding.label?.trim() || binding.agentId}`.trim() || "🤖 agent";
|
|
8231
|
+
const identity = { name: truncateUtf16Safe(displayName, 80) };
|
|
8216
8232
|
try {
|
|
8217
8233
|
const avatar = resolveAgentAvatar(cfg, binding.agentId);
|
|
8218
8234
|
if (avatar.kind === "remote") identity.avatarUrl = avatar.url;
|
|
@@ -8287,6 +8303,7 @@ async function deliverDiscordReply(params) {
|
|
|
8287
8303
|
threadId: delivery.threadId,
|
|
8288
8304
|
identity: delivery.identity,
|
|
8289
8305
|
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
8306
|
+
assertDirectAdapterHandoff: params.assertPlatformSendAuthorized,
|
|
8290
8307
|
deps: createDiscordDeliveryDeps({
|
|
8291
8308
|
cfg: params.cfg,
|
|
8292
8309
|
token: params.token,
|
|
@@ -8325,7 +8342,7 @@ async function deliverDiscordReply(params) {
|
|
|
8325
8342
|
//#endregion
|
|
8326
8343
|
//#region extensions/discord/src/monitor/agent-components.dispatch.ts
|
|
8327
8344
|
const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("./agent-components.runtime-CEPrf2SY.js"));
|
|
8328
|
-
const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-
|
|
8345
|
+
const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-DAwJF5VT.js").then((n) => n.n));
|
|
8329
8346
|
function buildDiscordComponentConversationLabel(params) {
|
|
8330
8347
|
if (params.interactionCtx.isDirectMessage) return buildDirectLabel(params.interactionCtx.user);
|
|
8331
8348
|
if (params.interactionCtx.isGroupDm) return `Group DM #${params.channelCtx.channelName ?? params.interactionCtx.channelId} channel id:${params.interactionCtx.channelId}`;
|
|
@@ -8566,7 +8583,8 @@ async function dispatchDiscordComponentEvent(params) {
|
|
|
8566
8583
|
mediaLocalRoots,
|
|
8567
8584
|
kind: info.kind,
|
|
8568
8585
|
bindPendingFinalDelivery: info.bindPendingFinalDelivery,
|
|
8569
|
-
onPlatformSendDispatch: info.onPlatformSendDispatch
|
|
8586
|
+
onPlatformSendDispatch: info.onPlatformSendDispatch,
|
|
8587
|
+
assertPlatformSendAuthorized: info.assertPlatformSendAuthorized
|
|
8570
8588
|
});
|
|
8571
8589
|
if (result.visibleReplySent) replyReference.markSent();
|
|
8572
8590
|
return result;
|
|
@@ -8731,7 +8749,7 @@ async function dispatchPluginDiscordInteractiveEvent(params) {
|
|
|
8731
8749
|
}
|
|
8732
8750
|
//#endregion
|
|
8733
8751
|
//#region extensions/discord/src/monitor/agent-components.handlers.ts
|
|
8734
|
-
const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-
|
|
8752
|
+
const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-gvRA0oaI.js").then((n) => n.t));
|
|
8735
8753
|
async function handleDiscordComponentEvent(params) {
|
|
8736
8754
|
const parsed = parseDiscordComponentData(params.data, resolveInteractionCustomId(params.interaction));
|
|
8737
8755
|
if (!parsed) {
|
|
@@ -8873,8 +8891,9 @@ async function handleDiscordModalTrigger(params) {
|
|
|
8873
8891
|
await replyUnavailableComponentInteraction(params.interaction, "This form has expired.");
|
|
8874
8892
|
return;
|
|
8875
8893
|
}
|
|
8894
|
+
const resolvedModalId = consumed.modalId ?? modalId;
|
|
8876
8895
|
const modalEntry = await resolveDiscordModalEntryWithPersistence({
|
|
8877
|
-
id:
|
|
8896
|
+
id: resolvedModalId,
|
|
8878
8897
|
consume: false
|
|
8879
8898
|
});
|
|
8880
8899
|
if (!modalEntry) {
|
|
@@ -9648,7 +9667,7 @@ function resolveDiscordPreflightChannelAccess(params) {
|
|
|
9648
9667
|
}
|
|
9649
9668
|
//#endregion
|
|
9650
9669
|
//#region extensions/discord/src/monitor/listeners.guild-join.ts
|
|
9651
|
-
const DISCORD_GUILD_JOIN_INTRO_MAX_AGE_MS =
|
|
9670
|
+
const DISCORD_GUILD_JOIN_INTRO_MAX_AGE_MS = 3e5;
|
|
9652
9671
|
var DiscordGuildJoinIntroductionListener = class extends GuildCreateListener {
|
|
9653
9672
|
constructor(params) {
|
|
9654
9673
|
super();
|
|
@@ -10010,8 +10029,9 @@ async function monitorDiscordProvider(opts = {}) {
|
|
|
10010
10029
|
});
|
|
10011
10030
|
let guildEntries = rawDiscordCfg.guilds;
|
|
10012
10031
|
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
10032
|
+
const providerConfigPresent = cfg.channels?.discord !== void 0;
|
|
10013
10033
|
const { groupPolicy, providerMissingFallbackApplied } = resolveOpenProviderRuntimeGroupPolicy({
|
|
10014
|
-
providerConfigPresent
|
|
10034
|
+
providerConfigPresent,
|
|
10015
10035
|
groupPolicy: rawDiscordCfg.groupPolicy,
|
|
10016
10036
|
defaultGroupPolicy
|
|
10017
10037
|
});
|
|
@@ -10158,6 +10178,7 @@ async function monitorDiscordProvider(opts = {}) {
|
|
|
10158
10178
|
const probe = await probeDiscordAcpBindingHealth({
|
|
10159
10179
|
cfg,
|
|
10160
10180
|
sessionKey,
|
|
10181
|
+
agentId: session.agentId,
|
|
10161
10182
|
storedState: session.acp?.state,
|
|
10162
10183
|
lastActivityAt: session.acp?.lastActivityAt,
|
|
10163
10184
|
providerSessionRuntime: discordProviderSessionRuntime
|
|
@@ -10271,7 +10292,7 @@ async function monitorDiscordProvider(opts = {}) {
|
|
|
10271
10292
|
runtime,
|
|
10272
10293
|
botUserId
|
|
10273
10294
|
});
|
|
10274
|
-
const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-
|
|
10295
|
+
const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-DkUhR7YK.js").then((n) => n.n);
|
|
10275
10296
|
setDiscordTranscriptsVoiceManager({
|
|
10276
10297
|
accountId: account.accountId,
|
|
10277
10298
|
manager: voiceManager
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
2
|
-
import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-
|
|
3
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
1
|
+
import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-B-3UHCc1.js";
|
|
2
|
+
import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-wECUSIIG.js";
|
|
3
|
+
import { t as createDiscordMessageHandler } from "./message-handler-CAeEpqWo.js";
|
|
4
4
|
import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
5
|
import { getAcpSessionManager, isAcpRuntimeError } from "openclaw/plugin-sdk/acp-runtime";
|
|
6
6
|
export { createDiscordMessageHandler, createNoopThreadBindingManager, createThreadBindingManager, getAcpSessionManager, isAcpRuntimeError, reconcileAcpThreadBindingsOnStartup, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-
|
|
2
|
-
import {
|
|
1
|
+
import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-DFu9hfU8.js";
|
|
2
|
+
import { a as convertRealtimePcm24kMonoToDiscordPcm48kStereo, c as maybeControlDiscordVoiceAgentRun, i as convertDiscordPcm48kStereoToRealtimePcm24kMono, l as formatVoiceLogPreview, n as loadDiscordVoiceSdk, o as createDiscordOpusEncodeStream, r as logVoiceVerbose, s as formatVoiceIngressPrompt } from "./voice-runtime-COyYYTDD.js";
|
|
3
3
|
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
5
5
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -11,7 +11,8 @@ import { PassThrough, pipeline } from "node:stream";
|
|
|
11
11
|
function mergeRealtimePartialTranscript(previous, next) {
|
|
12
12
|
const trimmed = next.trim();
|
|
13
13
|
if (!trimmed) return previous;
|
|
14
|
-
|
|
14
|
+
const merged = trimmed.startsWith(previous) ? trimmed : `${previous}${next}`;
|
|
15
|
+
return sliceUtf16Safe(merged, -240);
|
|
15
16
|
}
|
|
16
17
|
//#endregion
|
|
17
18
|
//#region extensions/discord/src/voice/realtime-turns.ts
|
|
@@ -302,7 +303,6 @@ var DiscordRealtimeConsults = class {
|
|
|
302
303
|
logger$2.warn(`discord voice: realtime consult rejected malformed args call=${callId || "unknown"}: ${outcome.error}`);
|
|
303
304
|
await session.submitToolResult(callId, { error: outcome.error });
|
|
304
305
|
return;
|
|
305
|
-
case "consult": break;
|
|
306
306
|
}
|
|
307
307
|
const consultMessage = outcome.message;
|
|
308
308
|
logger$2.info(`discord voice: realtime consult requested call=${callId || "unknown"} voiceSession=${this.params.entry.voiceSessionKey} supervisorSession=${this.params.entry.route.sessionKey} agent=${this.params.entry.route.agentId} question=${formatVoiceLogPreview(consultMessage)}`);
|
|
@@ -635,7 +635,7 @@ const logger$1 = createSubsystemLogger("discord/voice");
|
|
|
635
635
|
const DISCORD_REALTIME_CONTROL_SPEECH_DEDUPE_MS = 5e3;
|
|
636
636
|
const DISCORD_REALTIME_OUTPUT_PLAYBACK_WATCHDOG_MARGIN_MS = 3e3;
|
|
637
637
|
const DISCORD_REALTIME_MAX_RETAINED_EXACT_SPEECH_MESSAGES = 32;
|
|
638
|
-
const DISCORD_REALTIME_MAX_RETAINED_EXACT_SPEECH_BYTES =
|
|
638
|
+
const DISCORD_REALTIME_MAX_RETAINED_EXACT_SPEECH_BYTES = 32768;
|
|
639
639
|
const DISCORD_REALTIME_WAKE_ACKS = [
|
|
640
640
|
"Yeah.",
|
|
641
641
|
"Mm-hmm.",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as normalizeDiscordToken } from "./accounts-
|
|
2
|
-
import { r as fetchDiscord } from "./api-
|
|
3
|
-
import { a as normalizeDiscordSlug } from "./allow-list-
|
|
1
|
+
import { m as normalizeDiscordToken } from "./accounts-CwJQoLjM.js";
|
|
2
|
+
import { r as fetchDiscord } from "./api-BfmEP6wp.js";
|
|
3
|
+
import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.js";
|
|
4
4
|
//#region extensions/discord/src/guilds.ts
|
|
5
5
|
async function listGuilds(token, fetcher, options) {
|
|
6
6
|
return (await fetchDiscord("/users/@me/guilds", token, fetcher, options)).filter((guild) => typeof guild.id === "string" && typeof guild.name === "string").map((guild) => ({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { on as __exportAll } from "./retry-
|
|
2
|
-
import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
3
|
-
import { a as normalizeDiscordSlug } from "./allow-list-
|
|
1
|
+
import { on as __exportAll } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BfmEP6wp.js";
|
|
3
|
+
import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.js";
|
|
4
4
|
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
5
|
-
import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-
|
|
5
|
+
import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-BJ5UZNNT.js";
|
|
6
6
|
//#region extensions/discord/src/resolve-channels.ts
|
|
7
7
|
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveDiscordChannelAllowlist: () => resolveDiscordChannelAllowlist });
|
|
8
8
|
function parseDiscordChannelInput(raw) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { on as __exportAll } from "./retry-
|
|
2
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
3
|
-
import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-
|
|
1
|
+
import { on as __exportAll } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BfmEP6wp.js";
|
|
3
|
+
import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-BJ5UZNNT.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/discord/src/resolve-users.ts
|
|
6
6
|
var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveDiscordUserAllowlist: () => resolveDiscordUserAllowlist });
|
|
@@ -74,7 +74,8 @@ async function resolveDiscordUserAllowlist(params) {
|
|
|
74
74
|
});
|
|
75
75
|
continue;
|
|
76
76
|
}
|
|
77
|
-
const
|
|
77
|
+
const allGuilds = await getGuilds();
|
|
78
|
+
const guildList = filterDiscordGuilds(allGuilds, {
|
|
78
79
|
guildId: parsed.guildId,
|
|
79
80
|
guildName: parsed.guildName?.trim()
|
|
80
81
|
});
|
|
@@ -3,7 +3,8 @@ import { asFiniteNumberInRange, parseStrictFiniteNumber } from "openclaw/plugin-
|
|
|
3
3
|
const RETRY_AFTER_BODY_SECONDS_RE = /^(?:\d+\.?\d*|\.\d+)$/;
|
|
4
4
|
const MAX_SAFE_RETRY_AFTER_SECONDS = Number.MAX_SAFE_INTEGER / 1e3;
|
|
5
5
|
function parseDiscordRetryAfterBodySeconds(value) {
|
|
6
|
-
|
|
6
|
+
const seconds = typeof value === "number" ? value : typeof value === "string" && RETRY_AFTER_BODY_SECONDS_RE.test(value.trim()) ? parseStrictFiniteNumber(value.trim()) : void 0;
|
|
7
|
+
return asFiniteNumberInRange(seconds, {
|
|
7
8
|
min: 0,
|
|
8
9
|
max: MAX_SAFE_RETRY_AFTER_SECONDS
|
|
9
10
|
});
|