@openclaw/discord 2026.5.3 → 2026.5.4-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/action-runtime-api.js +1 -1
  2. package/dist/api.js +7 -7
  3. package/dist/{approval-handler.runtime-AZort68o.js → approval-handler.runtime-TRKg9NzZ.js} +1 -1
  4. package/dist/{approval-native-oN9__F3M.js → approval-native-DJs5M8fw.js} +1 -1
  5. package/dist/{audit-DEbWTFTt.js → audit-CdKtgVPO.js} +2 -2
  6. package/dist/{channel-actions-ChsoeB3T.js → channel-actions-BvEKvoM5.js} +1 -1
  7. package/dist/{channel-actions.runtime-BxNUYqD-.js → channel-actions.runtime-BNZAM-9-.js} +3 -3
  8. package/dist/channel-config-api.js +1 -1
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/{channel-Nf20xyAS.js → channel-wqYExrBU.js} +43 -25
  11. package/dist/{channel.setup-DHzAG9qO.js → channel.setup-C-HEMkxU.js} +1 -1
  12. package/dist/{config-schema-BmGtnfiE.js → config-schema-CC1qhiTN.js} +9 -1
  13. package/dist/contract-api.js +1 -1
  14. package/dist/{handle-action.guild-admin-B2Zzo2HU.js → handle-action.guild-admin-nTLXjfyh.js} +1 -1
  15. package/dist/{message-handler-TShaLWeQ.js → message-handler-kDvsxS8t.js} +3 -3
  16. package/dist/{message-handler.preflight-BsvNIDEw.js → message-handler.preflight-DYhlpFEl.js} +3 -3
  17. package/dist/{message-handler.process-Be2HA9AV.js → message-handler.process-B-CiOj1K.js} +12 -11
  18. package/dist/{outbound-adapter-B-mzejZP.js → outbound-adapter-FG0CgK3I.js} +3 -3
  19. package/dist/{provider-Cy1aml6b.js → provider-CnLt-Y4Z.js} +171 -63
  20. package/dist/{provider-session.runtime-CD5RUyP3.js → provider-session.runtime-7BukaDmt.js} +3 -3
  21. package/dist/provider.runtime-gtpKILBo.js +2 -0
  22. package/dist/{reply-delivery-uCiWAyIt.js → reply-delivery-QiXSsCCR.js} +61 -6
  23. package/dist/{route-resolution-Bx85WEpX.js → route-resolution-DODkzE43.js} +1 -1
  24. package/dist/{runtime-SoSwefbS.js → runtime-NObmZxWs.js} +5 -5
  25. package/dist/runtime-api.actions.js +2 -2
  26. package/dist/runtime-api.js +13 -13
  27. package/dist/runtime-api.lookup.js +1 -1
  28. package/dist/{runtime-api.monitor-srLSEVEX.js → runtime-api.monitor-B5uT6Cmc.js} +2 -2
  29. package/dist/runtime-api.monitor.js +3 -3
  30. package/dist/runtime-api.send.js +4 -4
  31. package/dist/runtime-api.threads.js +3 -3
  32. package/dist/{send-Dw6Da1m2.js → send-Rz5xnelg.js} +2 -2
  33. package/dist/{send.components-CJ8gYK3s.js → send.components-CoCE4aan.js} +2 -2
  34. package/dist/{send.outbound-6KbINW5h.js → send.outbound-DN-HfmW2.js} +1 -1
  35. package/dist/{send.shared-e9Pd_Em0.js → send.shared-BWZyuxM-.js} +1 -1
  36. package/dist/setup-plugin-api.js +1 -1
  37. package/dist/{shared-C1EMtcxR.js → shared-Ugd3DMEH.js} +1 -1
  38. package/dist/{subagent-hooks-4TZ3SJrh.js → subagent-hooks-DgpxQHUn.js} +1 -1
  39. package/dist/subagent-hooks-api.js +1 -1
  40. package/dist/{targets-B7OfGFt8.js → targets-DcNwQ9vN.js} +1 -1
  41. package/dist/test-api.js +3 -3
  42. package/dist/{thread-bindings-DLoian4S.js → thread-bindings-C7GN5ebh.js} +3 -3
  43. package/dist/{thread-bindings.discord-api-BJF6acLK.js → thread-bindings.discord-api-CfZnSqIb.js} +3 -3
  44. package/dist/{thread-bindings.manager-CWG9Gd04.js → thread-bindings.manager-BxPG0IHV.js} +2 -2
  45. package/openclaw.plugin.json +51 -1
  46. package/package.json +5 -5
  47. package/dist/provider.runtime-CbW_PYV-.js +0 -2
@@ -1,32 +1,32 @@
1
1
  import { t as normalizeDiscordToken } from "./token-BZtonk7d.js";
2
2
  import { c as resolveDiscordAccountAllowFrom, d as resolveDiscordAccountDmPolicy, f as resolveDiscordMaxLinesPerMessage, s as resolveDiscordAccount } from "./accounts-CaHGiVB4.js";
3
3
  import { a as chunkDiscordTextWithMode } from "./normalize-B-ktw-T_.js";
4
- import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-CJ8gYK3s.js";
4
+ import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-CoCE4aan.js";
5
5
  import { c as setPresence, i as unregisterGateway, r as registerGateway } from "./gateway-registry-BKG4KIVC.js";
6
6
  import { A as Button, B as Separator, C as User, D as Modal, G as BaseMessageInteractiveComponent, H as TextDisplay, M as Container, R as Row, S as Message, V as StringSelectMenu, a as MessageReactionRemoveListener, b as CommandWithSubcommands, d as Client, f as Plugin, h as RateLimitError, i as MessageReactionAddListener, l as ThreadUpdateListener, n as InteractionCreateListener, o as PresenceUpdateListener, r as MessageCreateListener, s as ReadyListener, t as discord_exports, x as Guild, y as Command } from "./discord-eZlimVfW.js";
7
- import { B as validateDiscordProxyUrl, L as DISCORD_REST_TIMEOUT_MS, N as createDiscordRestClient, R as createDiscordRequestClient, V as withValidatedDiscordProxy, z as resolveDiscordProxyFetchForAccount } from "./send.shared-e9Pd_Em0.js";
7
+ import { L as DISCORD_REST_TIMEOUT_MS, N as createDiscordRestClient, R as validateDiscordProxyUrl, z as withValidatedDiscordProxy } from "./send.shared-BWZyuxM-.js";
8
8
  import { a as summarizeDiscordResponseBody, i as isDiscordRateLimitResponseBody } from "./api-DzNBVTto.js";
9
9
  import { n as formatDiscordUserTag, t as formatDiscordReactionEmoji } from "./format-D8TsaXxW.js";
10
10
  import { _ as resolveGroupDmAllow, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, f as resolveDiscordMemberAccessState, i as normalizeDiscordDisplaySlug, l as resolveDiscordChannelPolicyCommandAuthorizer, m as resolveDiscordOwnerAccess, n as isDiscordGroupAllowedByPolicy, o as resolveDiscordAllowListMatch, r as normalizeDiscordAllowList, v as shouldEmitDiscordReactionNotification } from "./allow-list-ek-1hMKN.js";
11
11
  import { t as formatMention } from "./mentions-BPZUaFk7.js";
12
12
  import { _ as parseDiscordModalCustomIdForInteraction, g as parseDiscordModalCustomId, h as parseDiscordComponentCustomIdForInteraction, m as parseDiscordComponentCustomId } from "./components-D5LnN7ZQ.js";
13
13
  import { i as isDiscordExecApprovalClientEnabled, n as getDiscordExecApprovalApprovers } from "./approval-shared-GfJeMdLu.js";
14
- import "./approval-native-oN9__F3M.js";
14
+ import "./approval-native-DJs5M8fw.js";
15
15
  import { t as resolveDiscordConversationIdentity } from "./conversation-identity-BN9wSmxJ.js";
16
16
  import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-VAqom3Dn.js";
17
17
  import { t as resolveDiscordUserAllowlist } from "./resolve-users-DPJkRKx1.js";
18
- import { a as isThreadArchived, d as formatThreadBindingDurationLabel } from "./thread-bindings.discord-api-BJF6acLK.js";
18
+ import { a as isThreadArchived, d as formatThreadBindingDurationLabel } from "./thread-bindings.discord-api-CfZnSqIb.js";
19
19
  import { i as resolveDiscordChannelParentIdSafe, n as resolveDiscordChannelInfoSafe, o as resolveDiscordChannelTopicSafe, r as resolveDiscordChannelNameSafe, t as resolveDiscordChannelIdSafe } from "./channel-access-ewDxhd9q.js";
20
20
  import { r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-DmHUl6wI.js";
21
21
  import { o as raceWithTimeout, s as withAbortTimeout } from "./timeouts-C7jeTtGs.js";
22
22
  import { c as resolveDiscordChannelInfo } from "./message-utils-Dmgu-7fC.js";
23
23
  import { i as resolveDiscordThreadParentInfo } from "./threading-Bi95Nz8h.js";
24
- import { c as resolveDiscordDmAccessGroupEntries, i as resolveDiscordEffectiveRoute, n as resolveDiscordBoundConversationRoute, o as handleDiscordDmCommandDecision, s as resolveDiscordDmCommandAccess } from "./route-resolution-Bx85WEpX.js";
24
+ import { c as resolveDiscordDmAccessGroupEntries, i as resolveDiscordEffectiveRoute, n as resolveDiscordBoundConversationRoute, o as handleDiscordDmCommandDecision, s as resolveDiscordDmCommandAccess } from "./route-resolution-DODkzE43.js";
25
25
  import { t as resolveDiscordSenderIdentity } from "./sender-identity-BiSDAk2P.js";
26
26
  import { n as buildDiscordInboundAccessContext, t as buildDiscordGroupSystemPrompt } from "./inbound-context-e_oBBJtF.js";
27
27
  import { n as resolveDiscordVoiceEnabled, t as authorizeDiscordVoiceIngress } from "./access-B9ujuUtS.js";
28
- import { n as buildDirectLabel, r as buildGuildLabel, t as deliverDiscordReply } from "./reply-delivery-uCiWAyIt.js";
29
- import "./approval-handler.runtime-AZort68o.js";
28
+ import { n as buildDirectLabel, r as buildGuildLabel, t as deliverDiscordReply } from "./reply-delivery-QiXSsCCR.js";
29
+ import "./approval-handler.runtime-TRKg9NzZ.js";
30
30
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
31
31
  import { chunkItems, logDebug, logError, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, summarizeStringEntries, withTimeout } from "openclaw/plugin-sdk/text-runtime";
32
32
  import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
@@ -77,13 +77,15 @@ import { normalizeProviderId } from "openclaw/plugin-sdk/provider-model-shared";
77
77
  import { createConnectedChannelStatusPatch, createTransportActivityStatusPatch } from "openclaw/plugin-sdk/gateway-runtime";
78
78
  import { EventEmitter } from "node:events";
79
79
  import * as ws from "ws";
80
+ import { Agent } from "node:https";
80
81
  import * as httpsProxyAgent from "https-proxy-agent";
81
82
  import { captureHttpExchange, captureWsEvent, resolveDebugProxySettings, resolveEffectiveDebugProxyUrl } from "openclaw/plugin-sdk/proxy-capture";
83
+ import * as dns from "node:dns";
82
84
  import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
83
85
  import { runInboundReplyTurn } from "openclaw/plugin-sdk/inbound-reply-dispatch";
84
86
  import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
85
87
  import { resolveRequestUrl } from "openclaw/plugin-sdk/request-url";
86
- import { ProxyAgent, fetch as fetch$1 } from "undici";
88
+ import { Agent as Agent$1, ProxyAgent, fetch as fetch$1 } from "undici";
87
89
  //#region extensions/discord/src/monitor/listeners.queue.ts
88
90
  const DISCORD_SLOW_LISTENER_THRESHOLD_MS = 3e4;
89
91
  const discordEventQueueLog = createSubsystemLogger("discord/event-queue");
@@ -2828,6 +2830,27 @@ function buildDiscordCommandOptions(params) {
2828
2830
  //#endregion
2829
2831
  //#region extensions/discord/src/monitor/native-command.ts
2830
2832
  const log = createSubsystemLogger("discord/native-command");
2833
+ function resolveDiscordCommandOwnerAllowFrom(cfg) {
2834
+ const raw = cfg.commands?.ownerAllowFrom;
2835
+ if (!Array.isArray(raw) || raw.length === 0) return;
2836
+ const entries = [];
2837
+ for (const entry of raw) {
2838
+ const trimmed = normalizeOptionalString(String(entry ?? "")) ?? "";
2839
+ if (!trimmed) continue;
2840
+ const separatorIndex = trimmed.indexOf(":");
2841
+ if (separatorIndex > 0) {
2842
+ const prefix = trimmed.slice(0, separatorIndex).toLowerCase();
2843
+ if (prefix === "discord") {
2844
+ const remainder = normalizeOptionalString(trimmed.slice(separatorIndex + 1)) ?? "";
2845
+ if (remainder) entries.push(remainder);
2846
+ continue;
2847
+ }
2848
+ if (prefix !== "user" && prefix !== "pk") continue;
2849
+ }
2850
+ entries.push(trimmed);
2851
+ }
2852
+ return entries.length > 0 ? entries : void 0;
2853
+ }
2831
2854
  function createDiscordNativeCommand(params) {
2832
2855
  const { command, cfg, discordConfig, accountId, sessionPrefix, ephemeralDefault, threadBindings } = params;
2833
2856
  const fallbackCommandDefinition = createNativeCommandDefinition(command);
@@ -2931,7 +2954,8 @@ async function dispatchDiscordCommandInteraction(params) {
2931
2954
  cfg,
2932
2955
  accountId
2933
2956
  }) ?? [];
2934
- const { ownerAllowList, ownerAllowed: ownerOk } = resolveDiscordOwnerAccess({
2957
+ const commandOwnerAllowFrom = resolveDiscordCommandOwnerAllowFrom(cfg);
2958
+ const { ownerAllowList: discordOwnerAllowList, ownerAllowed: discordOwnerOk } = resolveDiscordOwnerAccess({
2935
2959
  allowFrom: configuredDmAllowFrom,
2936
2960
  sender: {
2937
2961
  id: sender.id,
@@ -2940,6 +2964,19 @@ async function dispatchDiscordCommandInteraction(params) {
2940
2964
  },
2941
2965
  allowNameMatching
2942
2966
  });
2967
+ const { ownerAllowed: commandOwnerOk } = resolveDiscordOwnerAccess({
2968
+ allowFrom: commandOwnerAllowFrom,
2969
+ sender: {
2970
+ id: sender.id,
2971
+ name: sender.name,
2972
+ tag: sender.tag
2973
+ },
2974
+ allowNameMatching
2975
+ });
2976
+ const commandOwnerAllowAll = commandOwnerAllowFrom?.includes("*") === true;
2977
+ const senderIsCommandOwner = commandOwnerOk || commandOwnerAllowAll;
2978
+ const ownerAllowListConfigured = discordOwnerAllowList != null;
2979
+ const ownerOk = discordOwnerOk;
2943
2980
  const commandsAllowFromAccess = resolveDiscordNativeCommandAllowlistAccess({
2944
2981
  cfg,
2945
2982
  accountId,
@@ -3081,7 +3118,7 @@ async function dispatchDiscordCommandInteraction(params) {
3081
3118
  memberRoleIds,
3082
3119
  sender,
3083
3120
  allowNameMatching,
3084
- ownerAllowListConfigured: ownerAllowList != null,
3121
+ ownerAllowListConfigured,
3085
3122
  ownerAllowed: ownerOk
3086
3123
  });
3087
3124
  if (!commandAuthorized && !await canBypassConfiguredAcpGuildGuards()) {
@@ -3146,6 +3183,7 @@ async function dispatchDiscordCommandInteraction(params) {
3146
3183
  channel: "discord",
3147
3184
  channelId,
3148
3185
  isAuthorizedSender: commandAuthorized,
3186
+ senderIsOwner: senderIsCommandOwner,
3149
3187
  sessionKey: effectiveRoute.sessionKey,
3150
3188
  commandBody: prompt,
3151
3189
  config: cfg,
@@ -3230,7 +3268,7 @@ async function dispatchDiscordCommandInteraction(params) {
3230
3268
  commandTargetSessionKey,
3231
3269
  channel: "discord",
3232
3270
  senderId: sender.id,
3233
- senderIsOwner: ownerOk,
3271
+ senderIsOwner: senderIsCommandOwner,
3234
3272
  isAuthorizedSender: commandAuthorized,
3235
3273
  isGroup: isGuild || isGroupDm,
3236
3274
  defaultGroupActivation: () => !isGuild ? "always" : channelConfig?.requireMention === false ? "always" : "mention",
@@ -4086,6 +4124,60 @@ function createDiscordAutoPresenceController(params) {
4086
4124
  };
4087
4125
  }
4088
4126
  //#endregion
4127
+ //#region extensions/discord/src/network-config.ts
4128
+ const DISCORD_DNS_HOSTS = [
4129
+ "discord.com",
4130
+ "discord.gg",
4131
+ "gateway.discord.gg"
4132
+ ];
4133
+ function normalizeHostname(hostname) {
4134
+ return hostname.trim().toLowerCase();
4135
+ }
4136
+ function isDiscordTransportHostname(hostname) {
4137
+ const normalized = normalizeHostname(hostname);
4138
+ if (!normalized) return false;
4139
+ return DISCORD_DNS_HOSTS.some((target) => normalized === target || normalized.endsWith(`.${target}`));
4140
+ }
4141
+ function reorderLookupAddresses(addresses) {
4142
+ if (!Array.isArray(addresses) || addresses.length < 2) return addresses;
4143
+ const ipv4 = addresses.filter((entry) => entry.family === 4);
4144
+ const ipv6 = addresses.filter((entry) => entry.family === 6);
4145
+ if (ipv4.length === 0) return ipv6;
4146
+ if (ipv6.length === 0) return ipv4;
4147
+ return [...ipv4, ...ipv6];
4148
+ }
4149
+ function createDiscordDnsLookup() {
4150
+ return (hostname, options, callback) => {
4151
+ if (!isDiscordTransportHostname(hostname)) return dns.lookup(hostname, options, callback);
4152
+ const lookupOptions = typeof options === "number" ? { family: options } : options === void 0 ? {} : { ...options };
4153
+ if (lookupOptions.family === 4 || lookupOptions.family === 6) return dns.lookup(hostname, lookupOptions, callback);
4154
+ dns.lookup(hostname, {
4155
+ ...lookupOptions,
4156
+ all: true
4157
+ }, (err, addresses) => {
4158
+ if (err) {
4159
+ callback(err, "", 4);
4160
+ return;
4161
+ }
4162
+ if (!Array.isArray(addresses)) {
4163
+ callback(/* @__PURE__ */ new Error("Expected all lookup addresses to be an array"), "", 4);
4164
+ return;
4165
+ }
4166
+ const reordered = reorderLookupAddresses(addresses);
4167
+ if (lookupOptions.all === true) {
4168
+ callback(null, reordered);
4169
+ return;
4170
+ }
4171
+ const first = reordered[0];
4172
+ if (!first) {
4173
+ callback(/* @__PURE__ */ new Error("No Discord DNS addresses resolved"), "", 4);
4174
+ return;
4175
+ }
4176
+ callback(null, first.address, first.family);
4177
+ });
4178
+ };
4179
+ }
4180
+ //#endregion
4089
4181
  //#region extensions/discord/src/monitor/gateway-handle.ts
4090
4182
  const DISCORD_GATEWAY_TRANSPORT_ACTIVITY_EVENT = "openclaw:discord-gateway-transport-activity";
4091
4183
  //#endregion
@@ -4280,6 +4372,7 @@ async function fetchDiscordGatewayMetadataDirect(input, init, capture) {
4280
4372
  //#endregion
4281
4373
  //#region extensions/discord/src/monitor/gateway-plugin.ts
4282
4374
  const DISCORD_GATEWAY_HANDSHAKE_TIMEOUT_MS = 3e4;
4375
+ const discordDnsLookup$1 = createDiscordDnsLookup();
4283
4376
  const registrationPromises = /* @__PURE__ */ new WeakMap();
4284
4377
  function assignGatewayClient(plugin, client) {
4285
4378
  plugin.client = client;
@@ -4415,7 +4508,7 @@ function createDiscordGatewayPlugin(params) {
4415
4508
  env: process.env
4416
4509
  });
4417
4510
  let fetchImpl = createDiscordGatewayMetadataFetch(debugProxySettings.enabled);
4418
- let wsAgent;
4511
+ let wsAgent = new Agent({ lookup: discordDnsLookup$1 });
4419
4512
  if (proxy) try {
4420
4513
  validateDiscordProxyUrl(proxy);
4421
4514
  wsAgent = new (params.__testing?.HttpsProxyAgentCtor ?? httpsProxyAgent.HttpsProxyAgent)(proxy);
@@ -7411,6 +7504,7 @@ const MAX_DISCORD_GATEWAY_READY_TIMEOUT_MS = 12e4;
7411
7504
  const DISCORD_GATEWAY_READY_TIMEOUT_ENV = "OPENCLAW_DISCORD_READY_TIMEOUT_MS";
7412
7505
  const DISCORD_GATEWAY_RUNTIME_READY_TIMEOUT_ENV = "OPENCLAW_DISCORD_RUNTIME_READY_TIMEOUT_MS";
7413
7506
  const DISCORD_GATEWAY_READY_POLL_MS = 250;
7507
+ const DISCORD_GATEWAY_READY_RETRY_BACKOFF_MS = 2e3;
7414
7508
  const DISCORD_GATEWAY_STARTUP_DISCONNECT_DRAIN_TIMEOUT_MS = 5e3;
7415
7509
  const DISCORD_GATEWAY_STARTUP_TERMINATE_CLOSE_TIMEOUT_MS = 1e3;
7416
7510
  const DISCORD_GATEWAY_TRANSPORT_ACTIVITY_STATUS_MIN_INTERVAL_MS = 3e4;
@@ -7645,27 +7739,36 @@ async function waitForGatewayReady(params) {
7645
7739
  }
7646
7740
  return "stopped";
7647
7741
  };
7648
- if (await waitUntilReady() !== "timeout") return;
7649
- if (!params.gateway) throw new Error(`discord gateway did not reach READY within ${params.readyTimeoutMs}ms`);
7650
- const restartAt = Date.now();
7651
- params.runtime.error?.(danger(`discord: gateway was not ready after ${params.readyTimeoutMs}ms; restarting gateway`));
7652
- params.pushStatus?.({
7653
- connected: false,
7654
- lastEventAt: restartAt,
7655
- lastDisconnect: {
7656
- at: restartAt,
7657
- error: "startup-not-ready"
7658
- },
7659
- lastError: "startup-not-ready"
7660
- });
7661
- if (params.abortSignal?.aborted) return;
7662
- await params.beforeRestart?.();
7663
- await restartGatewayAfterReadyTimeout({
7664
- gateway: params.gateway,
7665
- abortSignal: params.abortSignal,
7666
- runtime: params.runtime
7667
- });
7668
- if (await waitUntilReady() === "timeout") throw new Error(`discord gateway did not reach READY within ${params.readyTimeoutMs}ms after restart`);
7742
+ if (!params.gateway) {
7743
+ if (await waitUntilReady() === "timeout") throw new Error(`discord gateway did not reach READY within ${params.readyTimeoutMs}ms`);
7744
+ return;
7745
+ }
7746
+ let attempt = 0;
7747
+ while (!params.abortSignal?.aborted) {
7748
+ if (await waitUntilReady() !== "timeout") return;
7749
+ attempt += 1;
7750
+ const restartAt = Date.now();
7751
+ params.runtime.error?.(danger(`discord: gateway READY wait timed out after ${params.readyTimeoutMs}ms; reconnecting with backoff (attempt ${attempt})`));
7752
+ params.pushStatus?.({
7753
+ connected: false,
7754
+ lastEventAt: restartAt,
7755
+ lastDisconnect: {
7756
+ at: restartAt,
7757
+ error: "startup-not-ready"
7758
+ },
7759
+ lastError: "startup-not-ready"
7760
+ });
7761
+ await params.beforeRestart?.();
7762
+ await restartGatewayAfterReadyTimeout({
7763
+ gateway: params.gateway,
7764
+ abortSignal: params.abortSignal,
7765
+ runtime: params.runtime
7766
+ });
7767
+ if (params.abortSignal?.aborted) return;
7768
+ await new Promise((resolve) => {
7769
+ setTimeout(resolve, DISCORD_GATEWAY_READY_RETRY_BACKOFF_MS).unref?.();
7770
+ });
7771
+ }
7669
7772
  }
7670
7773
  async function runDiscordGatewayLifecycle(params) {
7671
7774
  const gateway = params.gateway;
@@ -7855,7 +7958,8 @@ async function createDiscordMonitorClient(params) {
7855
7958
  requestOptions: {
7856
7959
  timeout: DISCORD_REST_TIMEOUT_MS,
7857
7960
  runtimeProfile: "persistent",
7858
- maxQueueSize: 1e3
7961
+ maxQueueSize: 1e3,
7962
+ ...params.restFetch ? { fetch: params.restFetch } : {}
7859
7963
  },
7860
7964
  eventQueue: eventQueueOpts
7861
7965
  }, {
@@ -7865,12 +7969,6 @@ async function createDiscordMonitorClient(params) {
7865
7969
  modals: params.modals
7866
7970
  }, constructorPlugins);
7867
7971
  if (voicePlugin) registerLatePlugin(client, voicePlugin);
7868
- if (params.proxyFetch) client.rest = createDiscordRequestClient(params.token, {
7869
- fetch: params.proxyFetch,
7870
- timeout: DISCORD_REST_TIMEOUT_MS,
7871
- runtimeProfile: "persistent",
7872
- maxQueueSize: 1e3
7873
- });
7874
7972
  const gateway = client.getPlugin("gateway");
7875
7973
  await waitForDiscordGatewayPluginRegistration(gateway);
7876
7974
  const gatewaySupervisor = params.createGatewaySupervisor({
@@ -7969,28 +8067,39 @@ function shouldRegisterDiscordReactionListeners(params) {
7969
8067
  }
7970
8068
  //#endregion
7971
8069
  //#region extensions/discord/src/monitor/rest-fetch.ts
8070
+ const discordDnsLookup = createDiscordDnsLookup();
8071
+ function createDiscordRestFetchWithDispatcher(dispatcher) {
8072
+ return wrapFetchWithAbortSignal(((input, init) => fetch$1(input, {
8073
+ ...init,
8074
+ dispatcher
8075
+ }).then((response) => {
8076
+ captureHttpExchange({
8077
+ url: resolveRequestUrl(input),
8078
+ method: init?.method ?? "GET",
8079
+ requestHeaders: init?.headers,
8080
+ requestBody: init?.body ?? null,
8081
+ response,
8082
+ flowId: randomUUID(),
8083
+ meta: { subsystem: "discord-rest" }
8084
+ });
8085
+ return response;
8086
+ })));
8087
+ }
7972
8088
  function resolveDiscordRestFetch(proxyUrl, runtime) {
7973
- const fetcher = withValidatedDiscordProxy(resolveEffectiveDebugProxyUrl(proxyUrl), runtime, (proxy) => {
7974
- const agent = new ProxyAgent(proxy);
7975
- return wrapFetchWithAbortSignal(((input, init) => fetch$1(input, {
7976
- ...init,
7977
- dispatcher: agent
7978
- }).then((response) => {
7979
- captureHttpExchange({
7980
- url: resolveRequestUrl(input),
7981
- method: init?.method ?? "GET",
7982
- requestHeaders: init?.headers,
7983
- requestBody: init?.body ?? null,
7984
- response,
7985
- flowId: randomUUID(),
7986
- meta: { subsystem: "discord-rest" }
7987
- });
7988
- return response;
8089
+ const effectiveProxyUrl = resolveEffectiveDebugProxyUrl(proxyUrl);
8090
+ if (effectiveProxyUrl) {
8091
+ const fetcher = withValidatedDiscordProxy(effectiveProxyUrl, runtime, (proxy) => createDiscordRestFetchWithDispatcher(new ProxyAgent({
8092
+ uri: proxy,
8093
+ allowH2: false
7989
8094
  })));
7990
- });
7991
- if (!fetcher) return fetch;
7992
- runtime.log?.("discord: rest proxy enabled");
7993
- return fetcher;
8095
+ if (!fetcher) return fetch;
8096
+ runtime.log?.("discord: rest proxy enabled");
8097
+ return fetcher;
8098
+ }
8099
+ return createDiscordRestFetchWithDispatcher(new Agent$1({
8100
+ allowH2: false,
8101
+ connect: { lookup: discordDnsLookup }
8102
+ }));
7994
8103
  }
7995
8104
  //#endregion
7996
8105
  //#region extensions/discord/src/monitor/startup-status.ts
@@ -8035,7 +8144,7 @@ async function loadDiscordVoiceRuntime() {
8035
8144
  }
8036
8145
  }
8037
8146
  async function loadDiscordProviderSessionRuntime() {
8038
- const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-CD5RUyP3.js");
8147
+ const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-7BukaDmt.js");
8039
8148
  discordProviderSessionRuntimePromise = promise;
8040
8149
  try {
8041
8150
  return await promise;
@@ -8063,7 +8172,6 @@ async function monitorDiscordProvider(opts = {}) {
8063
8172
  const discordRootThreadBindings = cfg.channels?.discord?.threadBindings;
8064
8173
  const discordAccountThreadBindings = cfg.channels?.discord?.accounts?.[account.accountId]?.threadBindings;
8065
8174
  const discordRestFetch = resolveDiscordRestFetch(rawDiscordCfg.proxy, runtime);
8066
- const discordProxyFetch = resolveDiscordProxyFetchForAccount(account, cfg, runtime);
8067
8175
  const dmConfig = rawDiscordCfg.dm;
8068
8176
  const configuredDmAllowFrom = resolveDiscordAccountAllowFrom({
8069
8177
  cfg,
@@ -8240,7 +8348,7 @@ async function monitorDiscordProvider(opts = {}) {
8240
8348
  accountId: account.accountId,
8241
8349
  applicationId,
8242
8350
  token,
8243
- proxyFetch: discordProxyFetch,
8351
+ restFetch: discordRestFetch,
8244
8352
  commands,
8245
8353
  components,
8246
8354
  modals,
@@ -1,6 +1,6 @@
1
- import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-DLoian4S.js";
2
- import { n as createNoopThreadBindingManager, r as createThreadBindingManager } from "./thread-bindings.manager-CWG9Gd04.js";
3
- import { t as createDiscordMessageHandler } from "./message-handler-TShaLWeQ.js";
1
+ import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-C7GN5ebh.js";
2
+ import { n as createNoopThreadBindingManager, r as createThreadBindingManager } from "./thread-bindings.manager-BxPG0IHV.js";
3
+ import { t as createDiscordMessageHandler } from "./message-handler-kDvsxS8t.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-CnLt-Y4Z.js";
2
+ export { monitorDiscordProvider };
@@ -1,8 +1,9 @@
1
1
  import { i as resolveTimestampMs } from "./format-D8TsaXxW.js";
2
- import { s as sendVoiceMessageDiscord } from "./send-Dw6Da1m2.js";
3
- import { t as sendMessageDiscord } from "./send.outbound-6KbINW5h.js";
2
+ import { s as sendVoiceMessageDiscord } from "./send-Rz5xnelg.js";
3
+ import { t as sendMessageDiscord } from "./send.outbound-DN-HfmW2.js";
4
4
  import { t as resolveDiscordSenderIdentity } from "./sender-identity-BiSDAk2P.js";
5
- import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
5
+ import { normalizeOptionalString, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-runtime";
6
+ import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
6
7
  import { buildOutboundSessionContext, deliverOutboundPayloads } from "openclaw/plugin-sdk/outbound-runtime";
7
8
  import { resolveAgentAvatar } from "openclaw/plugin-sdk/agent-runtime";
8
9
  //#region extensions/discord/src/monitor/reply-context.ts
@@ -41,6 +42,58 @@ function buildGuildLabel(params) {
41
42
  return `${guild?.name ?? "Guild"} #${channelName} channel id:${channelId}`;
42
43
  }
43
44
  //#endregion
45
+ //#region extensions/discord/src/monitor/reply-safety.ts
46
+ const DISCORD_INTERNAL_TRACE_LINE_RE = /^(?:>\s*)?(?:📊|🛠️|📖|📝|🔍|🔎|⚙️)\s*(?:Session Status|Exec|Read|Edit|Write|Patch|Search|Open|Click|Find|Screenshot|Update Plan|Tool Call|Tool Result|Function Call|Shell|Command)\s*:/i;
47
+ const DISCORD_INTERNAL_CHANNEL_LINE_RE = /^(?:>\s*)?(?:analysis|commentary|tool[-_ ]?call|tool[-_ ]?result|function[-_ ]?call|thinking|reasoning)\s*[:=]/i;
48
+ function hasNonEmptyRecord(value) {
49
+ return Boolean(value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0);
50
+ }
51
+ function hasInteractiveOrPresentationBlocks(value) {
52
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
53
+ const record = value;
54
+ if (typeof record.title === "string" && record.title.trim().length > 0) return true;
55
+ return Array.isArray(record.blocks) && record.blocks.length > 0;
56
+ }
57
+ function hasNonTextReplyPayloadContent(payload) {
58
+ return payload.audioAsVoice === true || hasNonEmptyRecord(payload.channelData) || hasInteractiveOrPresentationBlocks(payload.interactive) || hasInteractiveOrPresentationBlocks(payload.presentation);
59
+ }
60
+ function stripDiscordInternalTraceLines(text) {
61
+ let inFence = false;
62
+ const kept = [];
63
+ for (const line of text.split(/\r?\n/)) {
64
+ if (/^\s*```/.test(line)) {
65
+ inFence = !inFence;
66
+ kept.push(line);
67
+ continue;
68
+ }
69
+ if (!inFence) {
70
+ const trimmed = line.trim();
71
+ if (DISCORD_INTERNAL_TRACE_LINE_RE.test(trimmed) || DISCORD_INTERNAL_CHANNEL_LINE_RE.test(trimmed)) continue;
72
+ }
73
+ kept.push(line);
74
+ }
75
+ return kept.join("\n");
76
+ }
77
+ function collapseExcessBlankLines(text) {
78
+ return text.replace(/[ \t]+\n/g, "\n").replace(/\n{3,}/g, "\n\n");
79
+ }
80
+ function sanitizeDiscordFrontChannelText(text) {
81
+ return collapseExcessBlankLines(stripDiscordInternalTraceLines(sanitizeAssistantVisibleText(text))).trim();
82
+ }
83
+ function sanitizeDiscordFrontChannelReplyPayloads(payloads) {
84
+ const safePayloads = [];
85
+ for (const payload of payloads) {
86
+ const safeText = typeof payload.text === "string" ? sanitizeDiscordFrontChannelText(payload.text) : payload.text;
87
+ const nextPayload = safeText === payload.text ? payload : {
88
+ ...payload,
89
+ text: safeText || void 0
90
+ };
91
+ if (!resolveSendableOutboundReplyParts(nextPayload).hasContent && !hasNonTextReplyPayloadContent(nextPayload)) continue;
92
+ safePayloads.push(nextPayload);
93
+ }
94
+ return safePayloads;
95
+ }
96
+ //#endregion
44
97
  //#region extensions/discord/src/monitor/reply-delivery.ts
45
98
  function resolveTargetChannelId(target) {
46
99
  if (!target.startsWith("channel:")) return;
@@ -102,12 +155,14 @@ function resolveDiscordDeliveryOptions(params) {
102
155
  async function deliverDiscordReply(params) {
103
156
  params.runtime;
104
157
  const delivery = resolveDiscordDeliveryOptions(params);
105
- await deliverOutboundPayloads({
158
+ const payloads = sanitizeDiscordFrontChannelReplyPayloads(params.replies);
159
+ if (payloads.length === 0) return;
160
+ if ((await deliverOutboundPayloads({
106
161
  cfg: params.cfg,
107
162
  channel: "discord",
108
163
  to: delivery.to,
109
164
  accountId: params.accountId,
110
- payloads: params.replies,
165
+ payloads,
111
166
  replyToId: normalizeOptionalString(params.replyToId),
112
167
  replyToMode: delivery.replyToMode,
113
168
  formatting: delivery.formatting,
@@ -125,7 +180,7 @@ async function deliverDiscordReply(params) {
125
180
  agentId: delivery.agentId,
126
181
  requesterAccountId: params.accountId
127
182
  })
128
- });
183
+ })).length === 0) throw new Error(`discord final reply produced no delivered message for ${delivery.to}`);
129
184
  }
130
185
  //#endregion
131
186
  export { resolveReplyContext as i, buildDirectLabel as n, buildGuildLabel as r, deliverDiscordReply as t };
@@ -1,4 +1,4 @@
1
- import { w as canViewDiscordGuildChannel } from "./send.shared-e9Pd_Em0.js";
1
+ import { w as canViewDiscordGuildChannel } from "./send.shared-BWZyuxM-.js";
2
2
  import { o as resolveDiscordAllowListMatch, r as normalizeDiscordAllowList } from "./allow-list-ek-1hMKN.js";
3
3
  import { deriveLastRoutePolicy, isAcpSessionKey, isSubagentSessionKey, parseAgentSessionKey, resolveAgentIdFromSessionKey, resolveAgentRoute } from "openclaw/plugin-sdk/routing";
4
4
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
@@ -1,12 +1,12 @@
1
1
  import { o as resolveDefaultDiscordAccountId, t as createDiscordActionGate } from "./accounts-CaHGiVB4.js";
2
2
  import { s as resolveDiscordChannelId } from "./normalize-B-ktw-T_.js";
3
- import { c as jsonResult, d as readNumberParam, f as readReactionParams, g as withNormalizedTimestamp, h as resolvePollMaxSelections, l as parseAvailableTags, m as readStringParam, p as readStringArrayParam, r as sendDiscordComponentMessage, s as assertMediaNotDataUrl, u as readBooleanParam } from "./send.components-CJ8gYK3s.js";
3
+ import { c as jsonResult, d as readNumberParam, f as readReactionParams, g as withNormalizedTimestamp, h as resolvePollMaxSelections, l as parseAvailableTags, m as readStringParam, p as readStringArrayParam, r as sendDiscordComponentMessage, s as assertMediaNotDataUrl, u as readBooleanParam } from "./send.components-CoCE4aan.js";
4
4
  import { n as getGateway, o as getPresence } from "./gateway-registry-BKG4KIVC.js";
5
- import { O as hasAnyGuildPermissionDiscord, P as createDiscordRuntimeAccountContext, T as fetchChannelPermissionsDiscord, d as resolveDiscordTargetChannelId } from "./send.shared-e9Pd_Em0.js";
6
- import { A as removeRoleDiscord, B as removeChannelPermissionDiscord, C as fetchChannelInfoDiscord, D as kickMemberDiscord, E as fetchVoiceStatusDiscord, F as uploadStickerDiscord, I as createChannelDiscord, L as deleteChannelDiscord, M as timeoutMemberDiscord, N as listGuildEmojisDiscord, O as listGuildChannelsDiscord, P as uploadEmojiDiscord, R as editChannelDiscord, S as createScheduledEventDiscord, T as fetchRoleInfoDiscord, V as setChannelPermissionDiscord, _ 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 resolveEventCoverImage, k as listScheduledEventsDiscord, 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 fetchMemberInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as moveChannelDiscord } from "./send-Dw6Da1m2.js";
7
- import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-6KbINW5h.js";
5
+ import { O as hasAnyGuildPermissionDiscord, P as createDiscordRuntimeAccountContext, T as fetchChannelPermissionsDiscord, d as resolveDiscordTargetChannelId } from "./send.shared-BWZyuxM-.js";
6
+ import { A as removeRoleDiscord, B as removeChannelPermissionDiscord, C as fetchChannelInfoDiscord, D as kickMemberDiscord, E as fetchVoiceStatusDiscord, F as uploadStickerDiscord, I as createChannelDiscord, L as deleteChannelDiscord, M as timeoutMemberDiscord, N as listGuildEmojisDiscord, O as listGuildChannelsDiscord, P as uploadEmojiDiscord, R as editChannelDiscord, S as createScheduledEventDiscord, T as fetchRoleInfoDiscord, V as setChannelPermissionDiscord, _ 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 resolveEventCoverImage, k as listScheduledEventsDiscord, 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 fetchMemberInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as moveChannelDiscord } from "./send-Rz5xnelg.js";
7
+ import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DN-HfmW2.js";
8
8
  import { c as readDiscordComponentSpec } from "./components-D5LnN7ZQ.js";
9
- import "./targets-B7OfGFt8.js";
9
+ import "./targets-DcNwQ9vN.js";
10
10
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
11
11
  import { PermissionFlagsBits } from "discord-api-types/v10";
12
12
  //#region extensions/discord/src/actions/runtime.shared.ts
@@ -1,3 +1,3 @@
1
- import { a as readDiscordChannelCreateParams, c as readDiscordParentIdParam, i as requiredGuildPermissionForModerationAction, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-SoSwefbS.js";
2
- import { t as discordMessageActions } from "./channel-actions-ChsoeB3T.js";
1
+ import { a as readDiscordChannelCreateParams, c as readDiscordParentIdParam, i as requiredGuildPermissionForModerationAction, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-NObmZxWs.js";
2
+ import { t as discordMessageActions } from "./channel-actions-BvEKvoM5.js";
3
3
  export { discordMessageActions, handleDiscordAction, isDiscordModerationAction, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, requiredGuildPermissionForModerationAction };
@@ -1,31 +1,31 @@
1
1
  import { t as resolveDiscordOutboundSessionRoute } from "./outbound-session-route-uHGLDP-Y.js";
2
- import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-CJ8gYK3s.js";
2
+ import { n as registerBuiltDiscordComponentMessage, r as sendDiscordComponentMessage, t as editDiscordComponentMessage } from "./send.components-CoCE4aan.js";
3
3
  import { a as clearPresences, c as setPresence, i as unregisterGateway, n as getGateway, o as getPresence, r as registerGateway, s as presenceCacheSize, t as clearGateways } from "./gateway-registry-BKG4KIVC.js";
4
- import { C as DiscordSendError, D as hasAllGuildPermissionsDiscord, E as fetchMemberGuildPermissionsDiscord, O as hasAnyGuildPermissionDiscord, T as fetchChannelPermissionsDiscord } from "./send.shared-e9Pd_Em0.js";
4
+ import { C as DiscordSendError, D as hasAllGuildPermissionsDiscord, E as fetchMemberGuildPermissionsDiscord, O as hasAnyGuildPermissionDiscord, T as fetchChannelPermissionsDiscord } from "./send.shared-BWZyuxM-.js";
5
5
  import { _ as resolveGroupDmAllow, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, g as resolveDiscordShouldRequireMention, n as isDiscordGroupAllowedByPolicy, r as normalizeDiscordAllowList, s as resolveDiscordChannelConfig, t as allowListMatches, u as resolveDiscordCommandAuthorized, v as shouldEmitDiscordReactionNotification } from "./allow-list-ek-1hMKN.js";
6
6
  import { n as listDiscordDirectoryGroupsLive, r as listDiscordDirectoryPeersLive } from "./directory-live-DJ0V5asB.js";
7
- import { A as removeRoleDiscord, B as removeChannelPermissionDiscord, C as fetchChannelInfoDiscord, D as kickMemberDiscord, E as fetchVoiceStatusDiscord, F as uploadStickerDiscord, I as createChannelDiscord, L as deleteChannelDiscord, M as timeoutMemberDiscord, N as listGuildEmojisDiscord, O as listGuildChannelsDiscord, P as uploadEmojiDiscord, R as editChannelDiscord, S as createScheduledEventDiscord, T as fetchRoleInfoDiscord, V as setChannelPermissionDiscord, _ 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 resolveEventCoverImage, k as listScheduledEventsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchMemberInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as moveChannelDiscord } from "./send-Dw6Da1m2.js";
8
- import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-6KbINW5h.js";
9
- import { a as readDiscordChannelCreateParams, c as readDiscordParentIdParam, i as requiredGuildPermissionForModerationAction, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-SoSwefbS.js";
7
+ import { A as removeRoleDiscord, B as removeChannelPermissionDiscord, C as fetchChannelInfoDiscord, D as kickMemberDiscord, E as fetchVoiceStatusDiscord, F as uploadStickerDiscord, I as createChannelDiscord, L as deleteChannelDiscord, M as timeoutMemberDiscord, N as listGuildEmojisDiscord, O as listGuildChannelsDiscord, P as uploadEmojiDiscord, R as editChannelDiscord, S as createScheduledEventDiscord, T as fetchRoleInfoDiscord, V as setChannelPermissionDiscord, _ 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 resolveEventCoverImage, k as listScheduledEventsDiscord, m as listPinsDiscord, n as fetchReactionsDiscord, o as sendTypingDiscord, p as fetchMessageDiscord, r as reactMessageDiscord, s as sendVoiceMessageDiscord, u as createThreadDiscord, v as searchMessagesDiscord, w as fetchMemberInfoDiscord, x as banMemberDiscord, y as unpinMessageDiscord, z as moveChannelDiscord } from "./send-Rz5xnelg.js";
8
+ import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DN-HfmW2.js";
9
+ import { a as readDiscordChannelCreateParams, c as readDiscordParentIdParam, i as requiredGuildPermissionForModerationAction, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-NObmZxWs.js";
10
10
  import { r as setDiscordRuntime } from "./runtime-K9RT6Egn.js";
11
- import { t as discordMessageActions } from "./channel-actions-ChsoeB3T.js";
11
+ import { t as discordMessageActions } from "./channel-actions-BvEKvoM5.js";
12
12
  import { C as resolveThreadBindingMaxAgeMs, S as resolveThreadBindingMaxAgeExpiresAt, b as resolveThreadBindingIdleTimeoutMs, l as isRecentlyUnboundThreadWebhookMessage, x as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-Dzu1gCE7.js";
13
13
  import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-TTP020qQ.js";
14
14
  import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-VAqom3Dn.js";
15
15
  import { t as resolveDiscordUserAllowlist } from "./resolve-users-DPJkRKx1.js";
16
- import { d as formatThreadBindingDurationLabel, l as resolveThreadBindingPersona, m as resolveThreadBindingThreadName, p as resolveThreadBindingIntroText, u as resolveThreadBindingPersonaFromRecord } from "./thread-bindings.discord-api-BJF6acLK.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-DLoian4S.js";
18
- import { i as getThreadBindingManager, n as createNoopThreadBindingManager, r as createThreadBindingManager, t as __testing } from "./thread-bindings.manager-CWG9Gd04.js";
16
+ import { d as formatThreadBindingDurationLabel, l as resolveThreadBindingPersona, m as resolveThreadBindingThreadName, p as resolveThreadBindingIntroText, u as resolveThreadBindingPersonaFromRecord } from "./thread-bindings.discord-api-CfZnSqIb.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-C7GN5ebh.js";
18
+ import { i as getThreadBindingManager, n as createNoopThreadBindingManager, r as createThreadBindingManager, t as __testing } from "./thread-bindings.manager-BxPG0IHV.js";
19
19
  import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-DmHUl6wI.js";
20
20
  import { a as mergeAbortSignals, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-C7jeTtGs.js";
21
21
  import "./runtime-api.actions.js";
22
- import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-DEbWTFTt.js";
22
+ import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-CdKtgVPO.js";
23
23
  import "./runtime-api.lookup.js";
24
- import { a as createDiscordNativeCommand, i as waitForDiscordGatewayPluginRegistration, n as createDiscordGatewayPlugin, o as registerDiscordListener, r as resolveDiscordGatewayIntents, t as monitorDiscordProvider } from "./provider-Cy1aml6b.js";
24
+ import { a as createDiscordNativeCommand, i as waitForDiscordGatewayPluginRegistration, n as createDiscordGatewayPlugin, o as registerDiscordListener, r as resolveDiscordGatewayIntents, t as monitorDiscordProvider } from "./provider-CnLt-Y4Z.js";
25
25
  import { i as buildDiscordMediaPayload } from "./message-utils-Dmgu-7fC.js";
26
26
  import { o as sanitizeDiscordThreadName, r as resolveDiscordReplyTarget } from "./threading-Bi95Nz8h.js";
27
- import { t as createDiscordMessageHandler } from "./message-handler-TShaLWeQ.js";
28
- import "./runtime-api.monitor-srLSEVEX.js";
27
+ import { t as createDiscordMessageHandler } from "./message-handler-kDvsxS8t.js";
28
+ import "./runtime-api.monitor-B5uT6Cmc.js";
29
29
  import "./runtime-api.send.js";
30
30
  import "./runtime-api.threads.js";
31
31
  export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DiscordSendError, __testing, addRoleDiscord, allowListMatches, auditDiscordChannelPermissions, autoBindSpawnedDiscordSubagent, banMemberDiscord, buildDiscordMediaPayload, 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, isDiscordGroupAllowedByPolicy, isDiscordModerationAction, isRecentlyUnboundThreadWebhookMessage, kickMemberDiscord, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, listGuildChannelsDiscord, listGuildEmojisDiscord, listPinsDiscord, listScheduledEventsDiscord, listThreadBindingsBySessionKey, listThreadBindingsForAccount, listThreadsDiscord, mergeAbortSignals, monitorDiscordProvider, moveChannelDiscord, normalizeDiscordAllowList, 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, sanitizeDiscordThreadName, searchMessagesDiscord, sendDiscordComponentMessage, sendMessageDiscord, sendPollDiscord, sendStickerDiscord, sendTypingDiscord, sendVoiceMessageDiscord, sendWebhookMessageDiscord, setChannelPermissionDiscord, setDiscordRuntime, setPresence, setThreadBindingIdleTimeoutBySessionKey, setThreadBindingMaxAgeBySessionKey, shouldEmitDiscordReactionNotification, timeoutMemberDiscord, unbindThreadBindingsBySessionKey, unpinMessageDiscord, unregisterGateway, uploadEmojiDiscord, uploadStickerDiscord, waitForDiscordGatewayPluginRegistration };
@@ -3,5 +3,5 @@ import { r as setDiscordRuntime } from "./runtime-K9RT6Egn.js";
3
3
  import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-VAqom3Dn.js";
4
4
  import { t as resolveDiscordUserAllowlist } from "./resolve-users-DPJkRKx1.js";
5
5
  import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-DmHUl6wI.js";
6
- import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-DEbWTFTt.js";
6
+ import { r as collectDiscordAuditChannelIds, t as auditDiscordChannelPermissions } from "./audit-CdKtgVPO.js";
7
7
  export { auditDiscordChannelPermissions, collectDiscordAuditChannelIds, fetchDiscordApplicationId, fetchDiscordApplicationSummary, listDiscordDirectoryGroupsLive, listDiscordDirectoryPeersLive, parseApplicationIdFromToken, probeDiscord, resolveDiscordChannelAllowlist, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordUserAllowlist, setDiscordRuntime };
@@ -1,6 +1,6 @@
1
1
  import "./allow-list-ek-1hMKN.js";
2
- import "./provider-Cy1aml6b.js";
2
+ import "./provider-CnLt-Y4Z.js";
3
3
  import "./message-utils-Dmgu-7fC.js";
4
4
  import "./threading-Bi95Nz8h.js";
5
- import "./message-handler-TShaLWeQ.js";
5
+ import "./message-handler-kDvsxS8t.js";
6
6
  export {};