@openclaw/discord 2026.8.2 → 2026.9.1

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.
Files changed (57) hide show
  1. package/dist/action-runtime-api.js +1 -1
  2. package/dist/{activities-api-CkKcHUB6.js → activities-api-E-segZn6.js} +20 -8
  3. package/dist/activities-api.js +1 -1
  4. package/dist/api.js +12 -12
  5. package/dist/{approval-handler.runtime-DZM6Kt1Z.js → approval-handler.runtime-CW5k3mSa.js} +16 -10
  6. package/dist/{audit-DIbQA4VT.js → audit-B9rydv5a.js} +4 -4
  7. package/dist/{channel-CarzU3bg.js → channel-D93LnbTE.js} +20 -16
  8. package/dist/{channel-actions.runtime-B2wMqeVK.js → channel-actions.runtime-DMFv4doE.js} +7 -7
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/{channel.setup-z_ewMVa9.js → channel.setup-DTL7kPOM.js} +3 -3
  11. package/dist/{components-gvRA0oaI.js → components-DmXYIQ26.js} +83 -141
  12. package/dist/{conversation-binding-route-DPpBRpYI.js → conversation-binding-route-24afmvEC.js} +1 -1
  13. package/dist/{directory-config-AA8wQx0D.js → directory-config-BD4YL7wT.js} +1 -1
  14. package/dist/directory-contract-api.js +1 -1
  15. package/dist/{directory-live-D_kFz_Fj.js → directory-live-BrFVc1Ds.js} +1 -1
  16. package/dist/{doctor-QQTOkBfW.js → doctor-BUB41_lr.js} +2 -2
  17. package/dist/{handle-action.guild-admin-Cc88ZGon.js → handle-action.guild-admin-B0egstYq.js} +2 -2
  18. package/dist/index.js +1 -1
  19. package/dist/{message-handler-CAeEpqWo.js → message-handler-Qdw9c0j4.js} +5 -5
  20. package/dist/{message-handler.preflight-CoKoE3dY.js → message-handler.preflight-Dxi2yBfR.js} +21 -24
  21. package/dist/{message-handler.process-cdIJ_fDT.js → message-handler.process-BYDjtxZJ.js} +37 -45
  22. package/dist/{message-text-C0K4-fkg.js → message-text-BRVqYm-t.js} +1 -1
  23. package/dist/{outbound-adapter-Ch0At5Ra.js → outbound-adapter-DEhthWTk.js} +25 -52
  24. package/dist/{outbound-components-Bnt_7x7r.js → outbound-components-DehyxvA4.js} +3 -3
  25. package/dist/{outbound-session-route-CzzerX2K.js → outbound-session-route-BFGRF9fE.js} +3 -3
  26. package/dist/{pluralkit-B3cUVI7i.js → pluralkit-XmmAHoV6.js} +1 -1
  27. package/dist/{provider-CjI8BSzS.js → provider-DuDtKbF8.js} +21 -21
  28. package/dist/{provider-session.runtime-DdKRMcE9.js → provider-session.runtime-BA2BPyZ4.js} +3 -3
  29. package/dist/provider.runtime-Db8YwZBv.js +2 -0
  30. package/dist/{realtime-session.runtime-37IC-p5K.js → realtime-session.runtime-DgSbX6ay.js} +66 -122
  31. package/dist/{resolve-channels-BexR2eUn.js → resolve-channels-CYseD5Uw.js} +1 -1
  32. package/dist/{resolve-users-BtXBCH5W.js → resolve-users-DrmhDrqm.js} +1 -1
  33. package/dist/{retry-t5RcEsPk.js → retry-BNCxiyyR.js} +8 -3
  34. package/dist/{runtime-DydyfxST.js → runtime-BbWNtfyq.js} +7 -7
  35. package/dist/{runtime-BNlDfLwS.js → runtime-DB7Fb6AU.js} +1 -1
  36. package/dist/runtime-api.js +15 -15
  37. package/dist/{send-mTKSBdmZ.js → send-BnTEIeLE.js} +60 -56
  38. package/dist/{send.components-nsPnc7kK.js → send.components-BWVEcjRP.js} +4 -4
  39. package/dist/{send.outbound-CaOs9Zy1.js → send.outbound-b5xwHTlL.js} +4 -5
  40. package/dist/{send.shared-BJHt0Vyf.js → send.shared-5vxBTagO.js} +2 -2
  41. package/dist/setup-plugin-api.js +1 -1
  42. package/dist/{shared-BNesVA4P.js → shared-BSJWHEMA.js} +1 -1
  43. package/dist/{subagent-hooks-IeZVPLGj.js → subagent-hooks-IzQKX4RQ.js} +2 -2
  44. package/dist/subagent-hooks-api.js +1 -1
  45. package/dist/{system-events-Be5EJI3b.js → system-events-BOiDS8b3.js} +1 -1
  46. package/dist/{target-resolver-C0MnwEki.js → target-resolver-BVI8xSSC.js} +2 -2
  47. package/dist/targets-DbxVbq8k.js +3 -0
  48. package/dist/{thread-bindings-wECUSIIG.js → thread-bindings-D7mcaXQC.js} +3 -3
  49. package/dist/{thread-bindings.manager-B-3UHCc1.js → thread-bindings.manager-B1oySiVc.js} +12 -6
  50. package/dist/{threading-te5ADPQI.js → threading-OQnL-0Zx.js} +3 -3
  51. package/dist/{transcripts-source-DkUhR7YK.js → transcripts-source-D8lH7AkN.js} +1 -1
  52. package/dist/transcripts-source-api.js +1 -1
  53. package/dist/{typing-DAwJF5VT.js → typing-C9q0AQMb.js} +1 -1
  54. package/dist/{voice-runtime-COyYYTDD.js → voice-runtime-Dfhjh1tV.js} +75 -87
  55. package/package.json +5 -4
  56. package/dist/provider.runtime-Bo1WbLLr.js +0 -2
  57. package/dist/targets-DQSye1Rv.js +0 -3
@@ -1,27 +1,27 @@
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";
1
+ import { A as ThreadDeleteListener, C as InteractionCreateListener, D as PresenceUpdateListener, E as MessageReactionRemoveListener, G as Message, H as Command, K as User, L as RateLimitError, N as Client, O as ReadyListener, P as Plugin, Q as Modal, S as GuildDeleteListener, T as MessageReactionAddListener, U as CommandWithSubcommands, W as Guild, b as discord_exports, dt as Separator, ft as StringSelectMenu, gt as BaseMessageInteractiveComponent, j as ThreadUpdateListener, lt as Row, o as chunkDiscordTextWithMode, pt as TextDisplay, q as hasDiscordV2Components, rt as Container, tt as Button, w as MessageCreateListener, x as GuildCreateListener } from "./retry-BNCxiyyR.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-DmXYIQ26.js";
3
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";
4
+ import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-BWVEcjRP.js";
5
5
  import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
6
6
  import { a as isDiscordRateLimitResponseBody, o as summarizeDiscordResponseBody } from "./api-BfmEP6wp.js";
7
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";
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-5vxBTagO.js";
9
+ import { a as formatMention, t as sendMessageDiscord } from "./send.outbound-b5xwHTlL.js";
10
10
  import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
11
- import { n as getDiscordActivitiesRuntime } from "./runtime-BNlDfLwS.js";
11
+ import { n as getDiscordActivitiesRuntime } from "./runtime-DB7Fb6AU.js";
12
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-mTKSBdmZ.js";
14
+ import { _ as readMessagesDiscord, s as sendVoiceMessageDiscord } from "./send-BnTEIeLE.js";
15
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";
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-BFGRF9fE.js";
17
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";
18
+ import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-CYseD5Uw.js";
19
+ import { t as resolveDiscordUserAllowlist } from "./resolve-users-DrmhDrqm.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-B1oySiVc.js";
21
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 { m as resolveDiscordChannelInfo, u as resolveDiscordMessageStickers } from "./message-text-C0K4-fkg.js";
24
- import { i as resolveDiscordThreadParentInfo } from "./threading-te5ADPQI.js";
23
+ import { m as resolveDiscordChannelInfo, u as resolveDiscordMessageStickers } from "./message-text-BRVqYm-t.js";
24
+ import { i as resolveDiscordThreadParentInfo } from "./threading-OQnL-0Zx.js";
25
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";
@@ -1493,7 +1493,7 @@ async function dispatchDiscordNativeAgentReply(params) {
1493
1493
  deliver: async (payload) => {
1494
1494
  if (params.suppressReplies) return {
1495
1495
  visibleReplySent: false,
1496
- suppression: { reason: "no_visible_result" }
1496
+ suppression: { reason: "channel_transform" }
1497
1497
  };
1498
1498
  const payloadDelivered = await deliverDiscordInteractionReply({
1499
1499
  interaction: params.interaction,
@@ -1516,7 +1516,7 @@ async function dispatchDiscordNativeAgentReply(params) {
1516
1516
  };
1517
1517
  },
1518
1518
  onDelivered: (payload, info, result) => {
1519
- if (params.suppressReplies && info.kind === "final" && result?.suppression?.reason === "no_visible_result" && payload.text?.trim()) hiddenFinalReply = payload;
1519
+ if (params.suppressReplies && info.kind === "final" && result?.suppression?.reason === "channel_transform" && payload.text?.trim()) hiddenFinalReply = payload;
1520
1520
  if (info.kind === "final" && result?.visibleReplySent !== void 0 && (result.visibleReplySent || finalReplyOutcome !== "failed")) finalReplyOutcome = result.visibleReplySent ? "accepted" : "suppressed";
1521
1521
  },
1522
1522
  onError: (err, info) => {
@@ -6500,7 +6500,7 @@ async function runDiscordGatewayLifecycle(params) {
6500
6500
  gatewayEmitter?.removeListener(DISCORD_GATEWAY_TRANSPORT_ACTIVITY_EVENT, onGatewayTransportActivity);
6501
6501
  if (params.voiceManager) {
6502
6502
  await params.voiceManager.destroy();
6503
- const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-DkUhR7YK.js").then((n) => n.n);
6503
+ const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-D8lH7AkN.js").then((n) => n.n);
6504
6504
  setDiscordTranscriptsVoiceManager({
6505
6505
  accountId: params.accountId,
6506
6506
  manager: null
@@ -6515,7 +6515,7 @@ async function runDiscordGatewayLifecycle(params) {
6515
6515
  let discordVoiceRuntimePromise;
6516
6516
  let discordProviderSessionRuntimePromise;
6517
6517
  async function loadDiscordVoiceRuntime() {
6518
- const promise = discordVoiceRuntimePromise ?? import("./voice-runtime-COyYYTDD.js").then((n) => n.t);
6518
+ const promise = discordVoiceRuntimePromise ?? import("./voice-runtime-Dfhjh1tV.js").then((n) => n.t);
6519
6519
  discordVoiceRuntimePromise = promise;
6520
6520
  try {
6521
6521
  return await promise;
@@ -6525,7 +6525,7 @@ async function loadDiscordVoiceRuntime() {
6525
6525
  }
6526
6526
  }
6527
6527
  async function loadDiscordProviderSessionRuntime() {
6528
- const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-DdKRMcE9.js");
6528
+ const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-BA2BPyZ4.js");
6529
6529
  discordProviderSessionRuntimePromise = promise;
6530
6530
  try {
6531
6531
  return await promise;
@@ -8342,7 +8342,7 @@ async function deliverDiscordReply(params) {
8342
8342
  //#endregion
8343
8343
  //#region extensions/discord/src/monitor/agent-components.dispatch.ts
8344
8344
  const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("./agent-components.runtime-CEPrf2SY.js"));
8345
- const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-DAwJF5VT.js").then((n) => n.n));
8345
+ const loadTypingRuntime = createLazyRuntimeModule(() => import("./typing-C9q0AQMb.js").then((n) => n.n));
8346
8346
  function buildDiscordComponentConversationLabel(params) {
8347
8347
  if (params.interactionCtx.isDirectMessage) return buildDirectLabel(params.interactionCtx.user);
8348
8348
  if (params.interactionCtx.isGroupDm) return `Group DM #${params.channelCtx.channelName ?? params.interactionCtx.channelId} channel id:${params.interactionCtx.channelId}`;
@@ -8749,7 +8749,7 @@ async function dispatchPluginDiscordInteractiveEvent(params) {
8749
8749
  }
8750
8750
  //#endregion
8751
8751
  //#region extensions/discord/src/monitor/agent-components.handlers.ts
8752
- const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-gvRA0oaI.js").then((n) => n.t));
8752
+ const loadComponentsRuntime = createLazyRuntimeModule(() => import("./components-DmXYIQ26.js").then((n) => n.t));
8753
8753
  async function handleDiscordComponentEvent(params) {
8754
8754
  const parsed = parseDiscordComponentData(params.data, resolveInteractionCustomId(params.interaction));
8755
8755
  if (!parsed) {
@@ -10292,7 +10292,7 @@ async function monitorDiscordProvider(opts = {}) {
10292
10292
  runtime,
10293
10293
  botUserId
10294
10294
  });
10295
- const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-DkUhR7YK.js").then((n) => n.n);
10295
+ const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-D8lH7AkN.js").then((n) => n.n);
10296
10296
  setDiscordTranscriptsVoiceManager({
10297
10297
  accountId: account.accountId,
10298
10298
  manager: voiceManager
@@ -1,6 +1,6 @@
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";
1
+ import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-B1oySiVc.js";
2
+ import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-D7mcaXQC.js";
3
+ import { t as createDiscordMessageHandler } from "./message-handler-Qdw9c0j4.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 };
@@ -0,0 +1,2 @@
1
+ import { t as monitorDiscordProvider } from "./provider-DuDtKbF8.js";
2
+ export { monitorDiscordProvider };
@@ -1,11 +1,12 @@
1
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";
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-Dfhjh1tV.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";
6
6
  import { sliceUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
7
+ import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
7
8
  import { assertSecretOwnerAvailable, isSecretOwnerAvailable } from "openclaw/plugin-sdk/channel-secret-owner-runtime";
8
- import { REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, REALTIME_VOICE_AGENT_CONTROL_TOOL, REALTIME_VOICE_AGENT_CONTROL_TOOL_NAME, REALTIME_VOICE_AUDIO_FORMAT_PCM16_24KHZ, buildRealtimeVoiceSessionInstructions, buildRealtimeVoiceSpeakExactMessage, canonicalizeRealtimeVoiceProviderId, classifyRealtimeVoiceConsultToolCall, classifySkippableRealtimeVoiceConsultTranscript, controlRealtimeVoiceAgentRun, createRealtimeVoiceAgentTalkbackQueue, createRealtimeVoiceSessionHarness, createRealtimeVoiceTurnContextTracker, isRealtimeVoiceWakeNameRequired, matchRealtimeVoiceActivationName, matchRealtimeVoiceConsultQuestions, parseRealtimeVoiceAgentControlToolArgs, realtimeVoiceAudioDurationMs, resolveConfiguredRealtimeVoiceProvider, resolveRealtimeVoiceAgentConsultTools, resolveRealtimeVoiceBargeIn, resolveRealtimeVoiceInterruptResponseOnInputAudio, resolveRealtimeVoiceMinBargeInAudioEndMs, resolveRealtimeVoiceSessionPolicy } from "openclaw/plugin-sdk/realtime-voice";
9
+ import { REALTIME_VOICE_AGENT_CONSULT_TOOL_NAME, REALTIME_VOICE_AGENT_CONTROL_TOOL, REALTIME_VOICE_AGENT_CONTROL_TOOL_NAME, REALTIME_VOICE_AUDIO_FORMAT_PCM16_24KHZ, buildRealtimeVoiceAgentErrorProviderResult, buildRealtimeVoiceSessionInstructions, buildRealtimeVoiceSpeakExactMessage, canonicalizeRealtimeVoiceProviderId, classifyRealtimeVoiceConsultToolCall, classifySkippableRealtimeVoiceConsultTranscript, controlRealtimeVoiceAgentRun, createRealtimeVoiceAgentTalkbackQueue, createRealtimeVoiceSessionHarness, createRealtimeVoiceTurnContextTracker, isRealtimeVoiceWakeNameRequired, matchRealtimeVoiceActivationName, matchRealtimeVoiceConsultQuestions, parseRealtimeVoiceAgentControlToolArgs, realtimeVoiceAudioDurationMs, resolveConfiguredRealtimeVoiceProvider, resolveRealtimeVoiceAgentConsultTools, resolveRealtimeVoiceBargeIn, resolveRealtimeVoiceInterruptResponseOnInputAudio, resolveRealtimeVoiceMinBargeInAudioEndMs, resolveRealtimeVoiceSessionPolicy } from "openclaw/plugin-sdk/realtime-voice";
9
10
  import { PassThrough, pipeline } from "node:stream";
10
11
  //#region extensions/discord/src/voice/realtime-transcript.ts
11
12
  function mergeRealtimePartialTranscript(previous, next) {
@@ -264,9 +265,14 @@ const DISCORD_REALTIME_TALKBACK_DEBOUNCE_MS = 350;
264
265
  const DISCORD_REALTIME_FALLBACK_TEXT = "I hit an error while checking that. Please try again.";
265
266
  const DISCORD_REALTIME_FORCED_CONSULT_FALLBACK_DELAY_MS = 200;
266
267
  const DISCORD_REALTIME_FORCED_CONSULT_REASON = "provider_final_transcript_without_openclaw_agent_consult";
268
+ const CANCELLED_CONSULT_RESULT = {
269
+ status: "cancelled",
270
+ message: "OpenClaw cancelled this consult before completion. Do not restart it."
271
+ };
267
272
  var DiscordRealtimeConsults = class {
268
273
  constructor(params) {
269
274
  this.params = params;
275
+ this.providerDeliveries = /* @__PURE__ */ new Map();
270
276
  this.talkback = this.createTalkbackQueue();
271
277
  }
272
278
  close() {
@@ -308,10 +314,7 @@ var DiscordRealtimeConsults = class {
308
314
  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)}`);
309
315
  const nativeConsult = this.params.harness.forcedConsults.recordNativeConsult(event.args, callId);
310
316
  if (nativeConsult.kind === "already_delivered" && this.params.harness.forcedConsults.isCancelled(nativeConsult.handle)) {
311
- await this.submitTerminalRealtimeToolResult(callId, session, {
312
- status: "cancelled",
313
- message: "OpenClaw cancelled this consult before completion. Do not restart it."
314
- });
317
+ await this.submitTerminalRealtimeToolResult(callId, session, CANCELLED_CONSULT_RESULT);
315
318
  return;
316
319
  }
317
320
  const pendingConsult = nativeConsult.kind === "pending" ? nativeConsult.handle : void 0;
@@ -342,24 +345,14 @@ var DiscordRealtimeConsults = class {
342
345
  await session.submitToolResult(callId, { error: "No Discord speaker context available" });
343
346
  return;
344
347
  }
345
- const promise = this.runAgentTurn({
348
+ const result = await this.trackAgentProxyConsult(recent, this.runAgentTurn({
346
349
  context,
347
350
  message: consultMessage
348
- });
349
- if (recent) this.setRecentAgentProxyConsultPromise(recent, promise);
350
- let text;
351
- try {
352
- text = await promise;
353
- } catch (error) {
354
- if (providerEpoch !== this.params.providerEpoch()) return;
355
- const message = formatErrorMessage(error);
356
- logger$2.warn(`discord voice: realtime consult failed call=${callId || "unknown"}: ${message}`);
357
- await session.submitToolResult(callId, { error: message });
358
- return;
359
- }
351
+ }));
360
352
  if (providerEpoch !== this.params.providerEpoch()) return;
361
- logger$2.info(`discord voice: realtime consult answer (${text.length} chars) voiceSession=${this.params.entry.voiceSessionKey} supervisorSession=${this.params.entry.route.sessionKey} agent=${this.params.entry.route.agentId} speaker=${context.speakerLabel} owner=${context.senderIsOwner}: ${formatVoiceLogPreview(text)}`);
362
- await session.submitToolResult(callId, { text });
353
+ if ("text" in result) logger$2.info(`discord voice: realtime consult answer (${result.text.length} chars) voiceSession=${this.params.entry.voiceSessionKey} supervisorSession=${this.params.entry.route.sessionKey} agent=${this.params.entry.route.agentId} speaker=${context.speakerLabel} owner=${context.senderIsOwner}: ${formatVoiceLogPreview(result.text)}`);
354
+ else if ("error" in result) logger$2.warn(`discord voice: realtime consult failed call=${callId}: ${result.error}`);
355
+ await this.submitAgentProxyConsultResult(callId, session, result);
363
356
  }
364
357
  async handleAcceptedTranscript(acceptedText, forcedSpeakerContext, providerEpoch) {
365
358
  const usesRealtimeAgentHandoff = this.params.usesRealtimeAgentHandoff();
@@ -487,23 +480,17 @@ var DiscordRealtimeConsults = class {
487
480
  logger$2.debug(`discord voice: realtime forced agent consult reason=${DISCORD_REALTIME_FORCED_CONSULT_REASON} consultPolicy=${this.params.consultPolicy()} wakeNamePolicy=${this.params.wakeNamePolicy()} requireWakeName=${this.params.isWakeNameRequired()} voiceSession=${this.params.entry.voiceSessionKey} supervisorSession=${this.params.entry.route.sessionKey} agent=${this.params.entry.route.agentId} speaker=${context.speakerLabel}`);
488
481
  if (this.params.playback.hasInterruptibleOutputAudio()) logger$2.info(`discord voice: realtime forced agent consult preserving active playback guild=${this.params.entry.guildId} channel=${this.params.entry.channelId} outputAudioMs=${this.params.playback.outputAudioMs()} outputActive=${this.params.playback.isOutputAudioActive()} playbackChunks=${this.params.harness.outputActivity.snapshot().chunks}`);
489
482
  state.handledByForcedPlayback = true;
490
- try {
491
- const promise = this.runAgentTurn({
492
- context,
493
- message: question
494
- });
495
- this.setRecentAgentProxyConsultPromise(pending, promise);
496
- const text = await promise;
497
- await state.providerDelivery;
498
- if (state.providerEpoch !== this.params.providerEpoch()) return;
499
- logger$2.info(`discord voice: realtime forced agent consult answer (${text.length} chars) elapsedMs=${Date.now() - startedAt} voiceSession=${this.params.entry.voiceSessionKey} supervisorSession=${this.params.entry.route.sessionKey} agent=${this.params.entry.route.agentId}: ${formatVoiceLogPreview(text)}`);
500
- if (text.trim() && state.handledByForcedPlayback) this.params.playback.enqueueExactSpeechMessage(text);
501
- } catch (error) {
502
- await state.providerDelivery;
503
- if (state.providerEpoch !== this.params.providerEpoch()) return;
504
- logger$2.warn(`discord voice: realtime forced agent consult failed elapsedMs=${Date.now() - startedAt}: ${formatErrorMessage(error)}`);
505
- if (state.handledByForcedPlayback) this.params.playback.enqueueExactSpeechMessage(DISCORD_REALTIME_FALLBACK_TEXT);
506
- }
483
+ const result = await this.trackAgentProxyConsult(pending, this.runAgentTurn({
484
+ context,
485
+ message: question
486
+ }));
487
+ const deliveries = this.providerDeliveries.get(state);
488
+ await Promise.all(Array.from(deliveries ?? [], (delivery) => delivery.promise));
489
+ if (state.providerEpoch !== this.params.providerEpoch() || "status" in result) return;
490
+ if ("text" in result) logger$2.info(`discord voice: realtime forced agent consult answer (${result.text.length} chars) elapsedMs=${Date.now() - startedAt} voiceSession=${this.params.entry.voiceSessionKey} supervisorSession=${this.params.entry.route.sessionKey} agent=${this.params.entry.route.agentId}: ${formatVoiceLogPreview(result.text)}`);
491
+ else logger$2.warn(`discord voice: realtime forced agent consult failed elapsedMs=${Date.now() - startedAt}: ${result.error}`);
492
+ const text = "text" in result ? result.text : DISCORD_REALTIME_FALLBACK_TEXT;
493
+ if (text.trim() && state.handledByForcedPlayback) this.params.playback.enqueueExactSpeechMessage(text);
507
494
  }
508
495
  rememberRecentAgentProxyConsultContext(question, context, options = {}) {
509
496
  const handle = this.params.harness.forcedConsults.prepare(question, {
@@ -517,26 +504,19 @@ var DiscordRealtimeConsults = class {
517
504
  if (options.started) this.params.harness.forcedConsults.markStarted(handle);
518
505
  return handle;
519
506
  }
520
- setRecentAgentProxyConsultPromise(recent, promise) {
521
- const state = recent.context;
522
- if (!state) return;
523
- this.params.harness.forcedConsults.markStarted(recent);
524
- state.promise = promise;
525
- promise.then((text) => {
526
- if (state.providerEpoch !== this.params.providerEpoch()) return;
527
- state.result = {
528
- status: "fulfilled",
529
- text
530
- };
531
- this.params.harness.forcedConsults.markDelivered(recent);
532
- }).catch((error) => {
533
- if (state.providerEpoch !== this.params.providerEpoch()) return;
534
- state.result = {
535
- status: "rejected",
536
- error: formatErrorMessage(error)
537
- };
538
- this.params.harness.forcedConsults.markDelivered(recent);
507
+ trackAgentProxyConsult(recent, promise) {
508
+ const state = recent?.context;
509
+ if (recent) this.params.harness.forcedConsults.markStarted(recent);
510
+ const tracked = promise.then((text) => ({ text }), buildRealtimeVoiceAgentErrorProviderResult).then((result) => {
511
+ if (recent && state && state.providerEpoch === this.params.providerEpoch()) {
512
+ state.result = result;
513
+ if ("status" in result) this.params.harness.forcedConsults.markCancelled(recent);
514
+ else this.params.harness.forcedConsults.markDelivered(recent);
515
+ }
516
+ return result;
539
517
  });
518
+ if (state) state.promise = tracked;
519
+ return tracked;
540
520
  }
541
521
  findRecentAgentProxyConsultContext(consultMessage) {
542
522
  return this.params.harness.forcedConsults.findRecent(consultMessage);
@@ -552,80 +532,44 @@ var DiscordRealtimeConsults = class {
552
532
  const state = recent.context;
553
533
  if (!state) return false;
554
534
  if (state.providerEpoch !== this.params.providerEpoch()) return true;
555
- const providerOwnsDelivery = Boolean(state.handledByForcedPlayback && state.promise && !state.result && session.bridge.supportsToolResultSuppression === false);
556
- let resolveProviderDelivery;
557
- if (providerOwnsDelivery) state.providerDelivery = new Promise((resolve) => {
558
- resolveProviderDelivery = resolve;
559
- state.settleProviderDelivery = resolve;
560
- });
561
- const submitAlreadyDelivered = async () => {
562
- if (state.providerEpoch !== this.params.providerEpoch()) return;
563
- await this.submitTerminalRealtimeToolResult(callId, session, {
564
- status: "already_delivered",
565
- message: "OpenClaw already delivered this answer to Discord voice. Do not repeat it."
566
- });
567
- };
568
- const submitResult = async (result) => {
569
- if (state.providerEpoch !== this.params.providerEpoch()) return;
570
- if (state.handledByForcedPlayback && !providerOwnsDelivery) {
571
- await submitAlreadyDelivered();
572
- return;
573
- }
574
- if (result.status === "fulfilled") {
575
- await session.submitToolResult(callId, { text: result.text });
576
- return;
577
- }
578
- await session.submitToolResult(callId, { error: result.error });
579
- };
580
- if (state.result) {
581
- logger$2.info(`discord voice: realtime consult reused recent agent result call=${callId || "unknown"} speaker=${state.speaker.speakerLabel} owner=${state.speaker.senderIsOwner}`);
582
- await submitResult(state.result);
583
- return true;
584
- }
585
- if (!state.promise) return false;
586
- logger$2.info(`discord voice: realtime consult joined in-flight agent result call=${callId || "unknown"} speaker=${state.speaker.speakerLabel} owner=${state.speaker.senderIsOwner}`);
587
- if (state.handledByForcedPlayback && !providerOwnsDelivery) {
588
- await state.promise.catch(() => void 0);
589
- if (state.providerEpoch !== this.params.providerEpoch()) return true;
590
- await submitAlreadyDelivered();
591
- return true;
535
+ const pendingResult = state.result ?? state.promise;
536
+ if (!pendingResult) return false;
537
+ const providerDelivery = state.handledByForcedPlayback && !state.result && session.bridge.supportsToolResultSuppression === false ? createDeferred() : void 0;
538
+ if (providerDelivery) {
539
+ const deliveries = this.providerDeliveries.get(state) ?? /* @__PURE__ */ new Set();
540
+ deliveries.add(providerDelivery);
541
+ this.providerDeliveries.set(state, deliveries);
592
542
  }
593
- let result;
543
+ logger$2.info(`discord voice: realtime consult ${state.result ? "reused recent" : "joined in-flight"} agent result call=${callId} speaker=${state.speaker.speakerLabel} owner=${state.speaker.senderIsOwner}`);
594
544
  try {
595
- result = {
596
- status: "fulfilled",
597
- text: await state.promise
598
- };
599
- } catch (error) {
600
- result = {
601
- status: "rejected",
602
- error: formatErrorMessage(error)
603
- };
604
- }
605
- if (state.providerEpoch !== this.params.providerEpoch()) return true;
606
- try {
607
- await submitResult(result);
608
- if (providerOwnsDelivery) {
609
- state.handledByForcedPlayback = false;
610
- state.settleProviderDelivery = void 0;
611
- resolveProviderDelivery?.();
545
+ const result = await pendingResult;
546
+ if (state.providerEpoch !== this.params.providerEpoch()) return true;
547
+ await this.submitAgentProxyConsultResult(callId, session, result, Boolean(state.handledByForcedPlayback && !providerDelivery));
548
+ if (providerDelivery && state.providerEpoch === this.params.providerEpoch()) state.handledByForcedPlayback = false;
549
+ } finally {
550
+ if (providerDelivery) {
551
+ providerDelivery.resolve();
552
+ const deliveries = this.providerDeliveries.get(state);
553
+ deliveries?.delete(providerDelivery);
554
+ if (deliveries?.size === 0) this.providerDeliveries.delete(state);
612
555
  }
613
- } catch (error) {
614
- state.settleProviderDelivery = void 0;
615
- resolveProviderDelivery?.();
616
- throw error;
617
556
  }
618
557
  return true;
619
558
  }
559
+ async submitAgentProxyConsultResult(callId, session, result, alreadyDelivered = false) {
560
+ if ("status" in result) await this.submitTerminalRealtimeToolResult(callId, session, CANCELLED_CONSULT_RESULT);
561
+ else if (alreadyDelivered) await this.submitTerminalRealtimeToolResult(callId, session, {
562
+ status: "already_delivered",
563
+ message: "OpenClaw already delivered this answer to Discord voice. Do not repeat it."
564
+ });
565
+ else await session.submitToolResult(callId, result);
566
+ }
620
567
  clearProviderConsultState() {
621
- for (const handle of this.params.harness.forcedConsults.handles()) {
622
- const state = handle.context;
623
- if (!state) continue;
568
+ for (const [state, deliveries] of this.providerDeliveries) {
624
569
  state.handledByForcedPlayback = false;
625
- state.settleProviderDelivery?.();
626
- state.settleProviderDelivery = void 0;
627
- state.providerDelivery = void 0;
570
+ for (const delivery of deliveries) delivery.resolve();
628
571
  }
572
+ this.providerDeliveries.clear();
629
573
  this.params.harness.forcedConsults.clear();
630
574
  }
631
575
  };
@@ -1,4 +1,4 @@
1
- import { on as __exportAll } from "./retry-t5RcEsPk.js";
1
+ import { sn as __exportAll } from "./retry-BNCxiyyR.js";
2
2
  import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BfmEP6wp.js";
3
3
  import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.js";
4
4
  import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
@@ -1,4 +1,4 @@
1
- import { on as __exportAll } from "./retry-t5RcEsPk.js";
1
+ import { sn as __exportAll } from "./retry-BNCxiyyR.js";
2
2
  import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BfmEP6wp.js";
3
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";
@@ -3254,7 +3254,7 @@ function createDiscordSendReceiptFromResults(params) {
3254
3254
  };
3255
3255
  }
3256
3256
  function createDiscordSendReceipt(params) {
3257
- const results = params.platformMessageIds.map((messageId) => messageId.trim()).filter((messageId) => messageId && messageId !== "unknown").map((messageId, index) => {
3257
+ const results = params.platformMessageIds.map((messageId) => messageId.trim()).filter(Boolean).map((messageId, index) => {
3258
3258
  const result = {
3259
3259
  channel: "discord",
3260
3260
  messageId
@@ -3283,7 +3283,7 @@ function createDiscordSendReceipt(params) {
3283
3283
  });
3284
3284
  }
3285
3285
  function createDiscordSendResult(params) {
3286
- const messageId = params.result.id || "unknown";
3286
+ const messageId = params.result.id ?? "";
3287
3287
  const channelId = params.result.channel_id ?? params.fallbackChannelId;
3288
3288
  const receiptParams = {
3289
3289
  platformMessageIds: params.result.platformMessageIds?.length ? params.result.platformMessageIds : [messageId],
@@ -3559,6 +3559,11 @@ function recordDiscordMessageCreateAmbiguity(error) {
3559
3559
  function hasDiscordMessageCreateAmbiguity(error) {
3560
3560
  return collectErrorGraphCandidates(error, (current) => [current.cause, current.error]).some((candidate) => candidate !== null && typeof candidate === "object" && ambiguousDiscordMessageCreates.has(candidate));
3561
3561
  }
3562
+ function canFallbackDiscordWebhookSend(error) {
3563
+ if (hasDiscordMessageCreateAmbiguity(error)) return false;
3564
+ const failure = classifyDiscordDeliveryFailure(error);
3565
+ return failure === "rejected" || failure === "pre-connect";
3566
+ }
3562
3567
  function hasDiscordRateLimitRejection(error) {
3563
3568
  return error instanceof RateLimitError || collectErrorGraphCandidates(error, (current) => [current.cause, current.error]).some((candidate) => readDiscordErrorStatus(candidate) === 429);
3564
3569
  }
@@ -3623,4 +3628,4 @@ function createDiscordRetryRunner(params) {
3623
3628
  };
3624
3629
  }
3625
3630
  //#endregion
3626
- export { TextInput as $, listGuildRoles as $t, ThreadUpdateListener as A, getChannel as At, readRetryAfter as B, addGuildMemberRole as Bt, MessageCreateListener as C, listMessageReactionUsers as Ct, ReadyListener as D, deleteChannelMessage as Dt, PresenceUpdateListener as E, deleteChannel as Et, DiscordError as F, listChannelPins as Ft, User as G, createGuildSticker as Gt, CommandWithSubcommands as H, createGuildChannel as Ht, RateLimitError as I, pinChannelMessage as It, Embed as J, getGuildMember as Jt, hasDiscordV2Components as K, deleteChannelPermission as Kt, isUnknownDiscordVoiceStateError as L, searchGuildMessages as Lt, Client as M, getThreadMember as Mt, Plugin as N, listChannelArchivedThreads as Nt, ResumedListener as O, editChannel as Ot, RequestClient as P, listChannelMessages as Pt, RadioGroup as Q, listGuildEmojis as Qt, readDiscordCode as R, sendChannelTyping as Rt, InteractionCreateListener as S, deleteOwnMessageReaction as St, MessageReactionRemoveListener as T, createThread as Tt, Guild as U, createGuildEmoji as Ut, Command as V, createGuildBan as Vt, Message as W, createGuildScheduledEvent as Wt, Label as X, listGuildActiveThreads as Xt, CheckboxGroup as Y, getGuildVoiceState as Yt, Modal as Z, listGuildChannels as Zt, parseDiscordTarget as _, stripUndefinedFields as _t, chunkDiscordTextWithMode as a, timeoutGuildMember as an, MediaGallery as at, GuildCreateListener as b, getCurrentUser as bt, createDiscordSendResult as c, Row as ct, resolveDiscordReplyMessageId as d, StringSelectMenu as dt, listGuildScheduledEvents as en, Button as et, resolveDiscordReplyReference as f, TextDisplay as ft, normalizeDiscordOutboundTarget as g, parseCustomId as gt, normalizeDiscordMessagingTarget as h, BaseMessageInteractiveComponent as ht, recordDiscordMessageCreateAmbiguity as i, removeGuildMemberRole as in, LinkButton as it, VoiceStateUpdateListener as j, getChannelMessage as jt, ThreadDeleteListener as k, editChannelMessage as kt, toDiscordOutboundDeliveryResult as l, Section as lt, looksLikeDiscordTargetId as m, UserSelectMenu as mt, createDiscordRetryRunner as n, putChannelPermission as nn, Container as nt, createDiscordSendReceipt as o, __exportAll as on, MentionableSelectMenu as ot, allowFromContainsDiscordUserId as p, Thumbnail as pt, serializePayload as q, getGuild as qt, hasDiscordMessageCreateAmbiguity as r, removeGuildMember as rn, File as rt, createDiscordSendReceiptFromResults as s, RoleSelectMenu as st, classifyDiscordDeliveryFailure as t, moveGuildChannels as tn, ChannelSelectMenu as tt, createReusableDiscordReplyReference as u, Separator as ut, resolveDiscordChannelId as v, createChannelWebhook as vt, MessageReactionAddListener as w, createChannelMessage as wt, GuildDeleteListener as x, createOwnMessageReaction as xt, discord_exports as y, createUserDmChannel as yt, readDiscordMessage as z, unpinChannelMessage as zt };
3631
+ export { RadioGroup as $, listGuildEmojis as $t, ThreadDeleteListener as A, editChannelMessage as At, readDiscordMessage as B, unpinChannelMessage as Bt, InteractionCreateListener as C, deleteOwnMessageReaction as Ct, PresenceUpdateListener as D, deleteChannel as Dt, MessageReactionRemoveListener as E, createThread as Et, RequestClient as F, listChannelMessages as Ft, Message as G, createGuildScheduledEvent as Gt, Command as H, createGuildBan as Ht, DiscordError as I, listChannelPins as It, serializePayload as J, getGuild as Jt, User as K, createGuildSticker as Kt, RateLimitError as L, pinChannelMessage as Lt, VoiceStateUpdateListener as M, getChannelMessage as Mt, Client as N, getThreadMember as Nt, ReadyListener as O, deleteChannelMessage as Ot, Plugin as P, listChannelArchivedThreads as Pt, Modal as Q, listGuildChannels as Qt, isUnknownDiscordVoiceStateError as R, searchGuildMessages as Rt, GuildDeleteListener as S, createOwnMessageReaction as St, MessageReactionAddListener as T, createChannelMessage as Tt, CommandWithSubcommands as U, createGuildChannel as Ut, readRetryAfter as V, addGuildMemberRole as Vt, Guild as W, createGuildEmoji as Wt, CheckboxGroup as X, getGuildVoiceState as Xt, Embed as Y, getGuildMember as Yt, Label as Z, listGuildActiveThreads as Zt, normalizeDiscordOutboundTarget as _, parseCustomId as _t, recordDiscordMessageCreateAmbiguity as a, removeGuildMemberRole as an, LinkButton as at, discord_exports as b, createUserDmChannel as bt, createDiscordSendReceiptFromResults as c, RoleSelectMenu as ct, createReusableDiscordReplyReference as d, Separator as dt, listGuildRoles as en, TextInput as et, resolveDiscordReplyMessageId as f, StringSelectMenu as ft, normalizeDiscordMessagingTarget as g, BaseMessageInteractiveComponent as gt, looksLikeDiscordTargetId as h, UserSelectMenu as ht, hasDiscordMessageCreateAmbiguity as i, removeGuildMember as in, File as it, ThreadUpdateListener as j, getChannel as jt, ResumedListener as k, editChannel as kt, createDiscordSendResult as l, Row as lt, allowFromContainsDiscordUserId as m, Thumbnail as mt, classifyDiscordDeliveryFailure as n, moveGuildChannels as nn, ChannelSelectMenu as nt, chunkDiscordTextWithMode as o, timeoutGuildMember as on, MediaGallery as ot, resolveDiscordReplyReference as p, TextDisplay as pt, hasDiscordV2Components as q, deleteChannelPermission as qt, createDiscordRetryRunner as r, putChannelPermission as rn, Container as rt, createDiscordSendReceipt as s, __exportAll as sn, MentionableSelectMenu as st, canFallbackDiscordWebhookSend as t, listGuildScheduledEvents as tn, Button as tt, toDiscordOutboundDeliveryResult as u, Section as ut, parseDiscordTarget as v, stripUndefinedFields as vt, MessageCreateListener as w, listMessageReactionUsers as wt, GuildCreateListener as x, getCurrentUser as xt, resolveDiscordChannelId as y, createChannelWebhook as yt, readDiscordCode as z, sendChannelTyping as zt };
@@ -1,14 +1,14 @@
1
- import { f as resolveDiscordReplyReference, u as createReusableDiscordReplyReference, v as resolveDiscordChannelId } from "./retry-t5RcEsPk.js";
2
- import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-gvRA0oaI.js";
1
+ import { d as createReusableDiscordReplyReference, p as resolveDiscordReplyReference, y as resolveDiscordChannelId } from "./retry-BNCxiyyR.js";
2
+ import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-DmXYIQ26.js";
3
3
  import { o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, t as createDiscordActionGate } from "./accounts-CwJQoLjM.js";
4
- import { r as sendDiscordComponentMessage } from "./send.components-nsPnc7kK.js";
4
+ import { r as sendDiscordComponentMessage } from "./send.components-BWVEcjRP.js";
5
5
  import { a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, n as isDiscordGroupAllowedByPolicy, v as resolveGroupDmAllow } from "./allow-list-C2JuH-R0.js";
6
- import { F as createDiscordRuntimeAccountContext, T as hasAnyGuildPermissionDiscord, U as getGateway, d as resolveDiscordTargetChannelId, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-BJHt0Vyf.js";
7
- import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-CaOs9Zy1.js";
6
+ import { F as createDiscordRuntimeAccountContext, T as hasAnyGuildPermissionDiscord, U as getGateway, d as resolveDiscordTargetChannelId, v as canManageGuildMemberRoleDiscord, w as hasAnyChannelPermissionDiscord, x as fetchChannelPermissionsDiscord, y as canManageGuildRoleDiscord } from "./send.shared-5vxBTagO.js";
7
+ import { r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-b5xwHTlL.js";
8
8
  import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
9
9
  import { n as getPresence } from "./presence-cache-z1N8MbJ3.js";
10
- import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-mTKSBdmZ.js";
11
- import "./targets-DQSye1Rv.js";
10
+ import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, l as DiscordThreadInitialMessageError, m as listPinsDiscord, n as fetchReactionsDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchGuildInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-BnTEIeLE.js";
11
+ import "./targets-DbxVbq8k.js";
12
12
  import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
13
13
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
14
14
  import { asBoolean, isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,5 +1,5 @@
1
1
  import { c as resolveDiscordAccount, g as selectDiscordActivitiesRuntimeConfig, n as isDiscordAccountEnabledForRuntime, r as listDiscordAccountIds } from "./accounts-CwJQoLjM.js";
2
- import { z as resolveDiscordProxyFetchForAccount } from "./send.shared-BJHt0Vyf.js";
2
+ import { z as resolveDiscordProxyFetchForAccount } from "./send.shared-5vxBTagO.js";
3
3
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/discord/src/activities/config.ts
5
5
  function resolveDiscordActivitiesConfig(account, env = process.env) {
@@ -1,23 +1,23 @@
1
- import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-nsPnc7kK.js";
1
+ import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-BWVEcjRP.js";
2
2
  import { r as setDiscordRuntime } from "./runtime-DgnVQ7zW.js";
3
- import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-D_kFz_Fj.js";
3
+ import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-BrFVc1Ds.js";
4
4
  import { _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as resolveGroupDmAllow, y as shouldEmitDiscordReactionNotification } from "./allow-list-C2JuH-R0.js";
5
- import { C as hasAllGuildPermissionsDiscord, G as unregisterGateway, H as clearGateways, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, U as getGateway, W as registerGateway, _ as DiscordSendError, x as fetchChannelPermissionsDiscord } from "./send.shared-BJHt0Vyf.js";
6
- import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-CaOs9Zy1.js";
5
+ import { C as hasAllGuildPermissionsDiscord, G as unregisterGateway, H as clearGateways, S as fetchMemberGuildPermissionsDiscord, T as hasAnyGuildPermissionDiscord, U as getGateway, W as registerGateway, _ as DiscordSendError, x as fetchChannelPermissionsDiscord } from "./send.shared-5vxBTagO.js";
6
+ import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-b5xwHTlL.js";
7
7
  import { i as setPresence, n as getPresence, r as presenceCacheSize, t as clearPresences } from "./presence-cache-z1N8MbJ3.js";
8
- import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-mTKSBdmZ.js";
8
+ import { A as listScheduledEventsDiscord, B as moveChannelDiscord, C as fetchChannelInfoDiscord, D as fetchVoiceStatusDiscord, E as fetchRoleInfoDiscord, F as uploadEmojiDiscord, H as setChannelPermissionDiscord, I as uploadStickerDiscord, L as createChannelDiscord, M as resolveEventCoverImage, N as timeoutMemberDiscord, O as kickMemberDiscord, P as listGuildEmojisDiscord, R as deleteChannelDiscord, S as createScheduledEventDiscord, T as fetchMemberInfoDiscord, V as removeChannelPermissionDiscord, _ as readMessagesDiscord, a as removeReactionDiscord, b as addRoleDiscord, c as sendWebhookMessageDiscord, d as deleteMessageDiscord, f as editMessageDiscord, g as pinMessageDiscord, h as listThreadsDiscord, i as removeOwnReactionsDiscord, j as removeRoleDiscord, k as listGuildChannelsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as editChannelDiscord } from "./send-BnTEIeLE.js";
9
9
  import { a as isAbortError, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, l as runDiscordTaskWithTimeout, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, o as normalizeDiscordInboundWorkerTimeoutMs, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, s as normalizeDiscordListenerTimeoutMs, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-D86uWLt_.js";
10
- import { c as readDiscordChannelMoveParams, i as requiredGuildPermissionForModerationAction, l as readDiscordParentIdParam, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-DydyfxST.js";
11
- import { p as discordMessageActions, t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-CzzerX2K.js";
10
+ import { c as readDiscordChannelMoveParams, i as requiredGuildPermissionForModerationAction, l as readDiscordParentIdParam, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-BbWNtfyq.js";
11
+ import { p as discordMessageActions, t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-BFGRF9fE.js";
12
12
  import { C as resolveThreadBindingMaxAgeExpiresAt, S as resolveThreadBindingInactivityExpiresAt, w as resolveThreadBindingMaxAgeMs, x as resolveThreadBindingIdleTimeoutMs } from "./thread-bindings.state-D8OMdk4O.js";
13
13
  import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-CC7HoQvt.js";
14
- import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BexR2eUn.js";
15
- import { t as resolveDiscordUserAllowlist } from "./resolve-users-BtXBCH5W.js";
16
- import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-B-3UHCc1.js";
17
- import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-wECUSIIG.js";
14
+ import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-CYseD5Uw.js";
15
+ import { t as resolveDiscordUserAllowlist } from "./resolve-users-DrmhDrqm.js";
16
+ import { _ as resolveThreadBindingThreadName, g as resolveThreadBindingIntroText, h as formatThreadBindingDurationLabel, m as resolveThreadBindingPersonaFromRecord, n as createThreadBindingManager, p as resolveThreadBindingPersona, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-B1oySiVc.js";
17
+ import { a as reconcileAcpThreadBindingsOnStartup, c as resolveDiscordThreadBindingMaxAgeMs, i as listThreadBindingsForAccount, l as resolveThreadBindingsEnabled, n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey, s as resolveDiscordThreadBindingIdleTimeoutMs } from "./thread-bindings-D7mcaXQC.js";
18
18
  import { i as probeDiscord, n as fetchDiscordApplicationSummary, o as resolveDiscordPrivilegedIntentsFromFlags, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-3ovFAp3b.js";
19
- import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-DIbQA4VT.js";
20
- import { d as resolveDiscordGatewayIntents, f as waitForDiscordGatewayPluginRegistration, p as createDiscordNativeCommand, t as monitorDiscordProvider, u as createDiscordGatewayPlugin, y as registerDiscordListener } from "./provider-CjI8BSzS.js";
21
- import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-te5ADPQI.js";
22
- import { t as createDiscordMessageHandler } from "./message-handler-CAeEpqWo.js";
19
+ import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-B9rydv5a.js";
20
+ import { d as resolveDiscordGatewayIntents, f as waitForDiscordGatewayPluginRegistration, p as createDiscordNativeCommand, t as monitorDiscordProvider, u as createDiscordGatewayPlugin, y as registerDiscordListener } from "./provider-DuDtKbF8.js";
21
+ import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-OQnL-0Zx.js";
22
+ import { t as createDiscordMessageHandler } from "./message-handler-Qdw9c0j4.js";
23
23
  export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DiscordSendError, addRoleDiscord, allowListMatches, auditDiscordChannelPermissions, autoBindSpawnedDiscordSubagent, banMemberDiscord, clearGateways, clearPresences, collectDiscordAuditChannelIds, createChannelDiscord, createDiscordGatewayPlugin, createDiscordMessageHandler, createDiscordNativeCommand, createNoopThreadBindingManager, createScheduledEventDiscord, createThreadBindingManager, createThreadDiscord, deleteChannelDiscord, deleteMessageDiscord, discordMessageActions, editChannelDiscord, editDiscordComponentMessage, editMessageDiscord, fetchChannelInfoDiscord, fetchChannelPermissionsDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchMemberGuildPermissionsDiscord, fetchMemberInfoDiscord, fetchMessageDiscord, fetchReactionsDiscord, fetchRoleInfoDiscord, fetchVoiceStatusDiscord, formatThreadBindingDurationLabel, getGateway, getPresence, getThreadBindingManager, handleDiscordAction, hasAllGuildPermissionsDiscord, hasAnyGuildPermissionDiscord, isAbortError, isDiscordGroupAllowedByPolicy, isDiscordModerationAction, kickMemberDiscord, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadBindingsBySessionKey, listThreadBindingsForAccount, listThreadsDiscord, monitorDiscordProvider, moveChannelDiscord, normalizeDiscordAllowList, normalizeDiscordInboundWorkerTimeoutMs, normalizeDiscordListenerTimeoutMs, normalizeDiscordSlug, parseApplicationIdFromToken, pinMessageDiscord, presenceCacheSize, probeDiscord, reactMessageDiscord, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, readMessagesDiscord, reconcileAcpThreadBindingsOnStartup, registerBuiltDiscordComponentMessage, registerDiscordListener, registerGateway, removeChannelPermissionDiscord, removeOwnReactionsDiscord, removeReactionDiscord, removeRoleDiscord, requiredGuildPermissionForModerationAction, resolveDiscordChannelAllowlist, resolveDiscordChannelConfig, resolveDiscordChannelConfigWithFallback, resolveDiscordCommandAuthorized, resolveDiscordGatewayIntents, resolveDiscordGuildEntry, resolveDiscordOutboundSessionRoute, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordReplyTarget, resolveDiscordShouldRequireMention, resolveDiscordThreadBindingIdleTimeoutMs, resolveDiscordThreadBindingMaxAgeMs, resolveDiscordUserAllowlist, resolveEventCoverImage, resolveGroupDmAllow, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingInactivityExpiresAt, resolveThreadBindingIntroText, resolveThreadBindingMaxAgeExpiresAt, resolveThreadBindingMaxAgeMs, resolveThreadBindingPersona, resolveThreadBindingPersonaFromRecord, resolveThreadBindingThreadName, resolveThreadBindingsEnabled, runDiscordTaskWithTimeout, sanitizeDiscordThreadName, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, setDiscordRuntime, setPresence, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, shouldEmitDiscordReactionNotification, timeoutMemberDiscord, unbindThreadBindingsBySessionKey, unpinMessageDiscord, unregisterGateway, uploadEmojiDiscord, uploadStickerDiscord, waitForDiscordGatewayPluginRegistration };