@openclaw/discord 2026.6.8-beta.2 → 2026.6.9-beta.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 (110) hide show
  1. package/dist/action-runtime-api.js +1 -1
  2. package/dist/api.js +13 -13
  3. package/dist/{approval-handler.runtime-B3gyUd-L.js → approval-handler.runtime-BprBDUQG.js} +3 -3
  4. package/dist/{audit-BlfewK04.js → audit-DuZUxGjM.js} +3 -3
  5. package/dist/{channel-b0hY1EJw.js → channel--3YhTUOb.js} +27 -19
  6. package/dist/{channel-actions-BnPHwCZ_.js → channel-actions-CoudAyAB.js} +12 -6
  7. package/dist/{channel-actions.runtime-DX5iW6ut.js → channel-actions.runtime-DdOfD3fi.js} +5 -5
  8. package/dist/channel-plugin-api.js +1 -1
  9. package/dist/{channel.setup-By5cfELZ.js → channel.setup-C-y6Jifd.js} +2 -2
  10. package/dist/{components-D-CYw0-b.js → components-CUmrNvv-.js} +1 -1
  11. package/dist/{conversation-identity-CKzQAqFF.js → conversation-identity-CN-HPn11.js} +2 -2
  12. package/dist/{directory-config-Bu7FYOsl.js → directory-config-BCt5KxcX.js} +1 -1
  13. package/dist/directory-contract-api.js +1 -1
  14. package/dist/{directory-live-LjENjK6L.js → directory-live-CE7IDmwo.js} +1 -1
  15. package/dist/{handle-action.guild-admin-BS2qnhXF.js → handle-action.guild-admin-B7SnVS0m.js} +14 -9
  16. package/dist/index.js +1 -1
  17. package/dist/{manager.runtime-BU1vkOeO.js → manager.runtime-zMVwNPAT.js} +12 -4
  18. package/dist/{message-handler-CQVkXHMN.js → message-handler-DE413Oj4.js} +6 -6
  19. package/dist/{message-handler.preflight-DAnLOeDA.js → message-handler.preflight-BuF-DsE2.js} +10 -10
  20. package/dist/{message-handler.process-Dp5NQT05.js → message-handler.process-BX8HsMfV.js} +37 -23
  21. package/dist/{message-utils-Bx993JLN.js → message-utils-s_8KDqAQ.js} +1 -1
  22. package/dist/{outbound-adapter-CmN7ao1t.js → outbound-adapter-CNievjXH.js} +6 -6
  23. package/dist/{pluralkit-SYmlmerw.js → pluralkit-BXkU9XmC.js} +1 -1
  24. package/dist/{provider-DrScDA1p.js → provider-ByZ6xxgi.js} +85 -56
  25. package/dist/{provider-session.runtime-DXTzSYOJ.js → provider-session.runtime-DMfaQ9Z6.js} +3 -3
  26. package/dist/provider.runtime-EW-G8l_U.js +2 -0
  27. package/dist/{resolve-channels-Rautpk8n.js → resolve-channels-t1URw0Qz.js} +1 -1
  28. package/dist/{resolve-users-Bw7vvtsi.js → resolve-users-Bapkb237.js} +1 -1
  29. package/dist/{runtime-C80YEJ7Z.js → runtime-C6jV3hf4.js} +24 -10
  30. package/dist/runtime-api.actions.js +2 -2
  31. package/dist/runtime-api.js +19 -19
  32. package/dist/runtime-api.lookup.js +4 -4
  33. package/dist/runtime-api.monitor-5BSxmucu.js +6 -0
  34. package/dist/runtime-api.monitor.js +4 -4
  35. package/dist/runtime-api.send.js +5 -5
  36. package/dist/runtime-api.threads.js +3 -3
  37. package/dist/{send-zGsXF-up.js → send-o-Y1DiAT.js} +3 -3
  38. package/dist/{send.components-ktzrUTkt.js → send.components-B4_oNcOh.js} +4 -4
  39. package/dist/{send.outbound-C8oC51um.js → send.outbound-DhiXV3UJ.js} +53 -10
  40. package/dist/{send.receipt-DsQWEQ2O.js → send.receipt-HXIwVvXy.js} +2 -1
  41. package/dist/{send.shared-Dvo2ZCVG.js → send.shared-DYdjs_Zh.js} +13 -5
  42. package/dist/session-binding-contract-api.js +1 -1
  43. package/dist/setup-plugin-api.js +1 -1
  44. package/dist/{subagent-hooks-kjrWDeDg.js → subagent-hooks-CbF_Z5F0.js} +2 -2
  45. package/dist/subagent-hooks-api.js +1 -1
  46. package/dist/{system-events-CvU3Aduf.js → system-events-BxTHlBbM.js} +1 -1
  47. package/dist/{target-resolver-DMPTzuo7.js → target-resolver-DpC8iueE.js} +2 -2
  48. package/dist/targets-BEIgHBHc.js +3 -0
  49. package/dist/{thread-bindings-DO32M2kW.js → thread-bindings-CEVvN75T.js} +4 -4
  50. package/dist/{thread-bindings.discord-api-304M1PMr.js → thread-bindings.discord-api-B8NfbxEB.js} +4 -4
  51. package/dist/{thread-bindings.manager-C9YT7wF2.js → thread-bindings.manager-BKfUaXGt.js} +3 -3
  52. package/dist/{transcripts-source-Chy2OrO_.js → transcripts-source-W6n_8J8g.js} +1 -1
  53. package/dist/transcripts-source-api.js +1 -1
  54. package/dist/{typing-BaivbXIG.js → typing-0-pUmlY9.js} +1 -1
  55. package/node_modules/undici/README.md +59 -18
  56. package/node_modules/undici/docs/docs/GettingStarted.md +278 -0
  57. package/node_modules/undici/docs/docs/api/Agent.md +3 -0
  58. package/node_modules/undici/docs/docs/api/BalancedPool.md +1 -1
  59. package/node_modules/undici/docs/docs/api/Client.md +44 -5
  60. package/node_modules/undici/docs/docs/api/Connector.md +1 -0
  61. package/node_modules/undici/docs/docs/api/Cookies.md +28 -1
  62. package/node_modules/undici/docs/docs/api/Dispatcher.md +22 -5
  63. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +6 -9
  64. package/node_modules/undici/docs/docs/api/Errors.md +12 -0
  65. package/node_modules/undici/docs/docs/api/EventSource.md +50 -3
  66. package/node_modules/undici/docs/docs/api/Fetch.md +5 -3
  67. package/node_modules/undici/docs/docs/api/H2CClient.md +3 -3
  68. package/node_modules/undici/docs/docs/api/MockAgent.md +1 -1
  69. package/node_modules/undici/docs/docs/api/MockCallHistory.md +1 -1
  70. package/node_modules/undici/docs/docs/api/Pool.md +4 -1
  71. package/node_modules/undici/docs/docs/api/RedirectHandler.md +4 -1
  72. package/node_modules/undici/docs/docs/api/RetryAgent.md +3 -3
  73. package/node_modules/undici/docs/docs/api/RetryHandler.md +6 -6
  74. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +1 -1
  75. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +3 -3
  76. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +1 -0
  77. package/node_modules/undici/docs/docs/api/api-lifecycle.md +4 -4
  78. package/node_modules/undici/lib/core/connect.js +29 -4
  79. package/node_modules/undici/lib/core/util.js +8 -6
  80. package/node_modules/undici/lib/dispatcher/client-h1.js +69 -2
  81. package/node_modules/undici/lib/dispatcher/client-h2.js +160 -37
  82. package/node_modules/undici/lib/dispatcher/client.js +36 -7
  83. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +1 -0
  84. package/node_modules/undici/lib/dispatcher/proxy-agent.js +2 -1
  85. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +4 -2
  86. package/node_modules/undici/lib/handler/redirect-handler.js +36 -11
  87. package/node_modules/undici/lib/interceptor/dns.js +4 -0
  88. package/node_modules/undici/lib/interceptor/redirect.js +3 -3
  89. package/node_modules/undici/lib/mock/mock-call-history.js +1 -1
  90. package/node_modules/undici/lib/mock/snapshot-agent.js +9 -1
  91. package/node_modules/undici/lib/util/cache.js +8 -2
  92. package/node_modules/undici/lib/web/cookies/parse.js +17 -25
  93. package/node_modules/undici/lib/web/eventsource/eventsource.js +7 -18
  94. package/node_modules/undici/lib/web/eventsource/util.js +32 -1
  95. package/node_modules/undici/lib/web/fetch/body.js +43 -0
  96. package/node_modules/undici/lib/web/fetch/index.js +17 -3
  97. package/node_modules/undici/lib/web/fetch/request.js +33 -3
  98. package/node_modules/undici/lib/web/websocket/receiver.js +20 -3
  99. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -1
  100. package/node_modules/undici/lib/web/websocket/websocket.js +3 -1
  101. package/node_modules/undici/package.json +1 -1
  102. package/node_modules/undici/types/client.d.ts +5 -0
  103. package/node_modules/undici/types/connector.d.ts +1 -0
  104. package/node_modules/undici/types/fetch.d.ts +5 -1
  105. package/node_modules/undici/types/interceptors.d.ts +1 -1
  106. package/npm-shrinkwrap.json +7 -7
  107. package/package.json +5 -5
  108. package/dist/provider.runtime-nb-6cRoy.js +0 -2
  109. package/dist/runtime-api.monitor-D8KNDAd5.js +0 -6
  110. package/dist/targets-CKaNidbk.js +0 -3
@@ -1,18 +1,18 @@
1
- import { Ut as resolveDiscordChannelId, c as discord_exports, ft as editChannelMessage, s as chunkDiscordTextWithMode, st as createChannelMessage, ut as deleteChannelMessage } from "./send.receipt-DsQWEQ2O.js";
1
+ import { Ut as resolveDiscordChannelId, c as discord_exports, ft as editChannelMessage, s as chunkDiscordTextWithMode, st as createChannelMessage, ut as deleteChannelMessage } from "./send.receipt-HXIwVvXy.js";
2
2
  import { f as resolveDiscordMaxLinesPerMessage, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
3
- import { I as createDiscordRestClient, L as createDiscordRuntimeAccountContext, _ as resolveDiscordMessageFlags, d as resolveDiscordTargetChannelId } from "./send.shared-Dvo2ZCVG.js";
3
+ import { I as createDiscordRestClient, L as createDiscordRuntimeAccountContext, _ as resolveDiscordMessageFlags, d as resolveDiscordTargetChannelId } from "./send.shared-DYdjs_Zh.js";
4
4
  import { S as resolveTimestampMs, a as normalizeDiscordSlug, r as normalizeDiscordAllowList } from "./allow-list-C-MqM-B_.js";
5
- import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-zGsXF-up.js";
6
- import { a as discordTextHasTargetedMention, i as discordTextHasBroadcastMention, s as rewriteDiscordKnownMentions } from "./send.outbound-C8oC51um.js";
7
- import "./targets-CKaNidbk.js";
8
- import { t as resolveDiscordConversationIdentity } from "./conversation-identity-CKzQAqFF.js";
5
+ import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-o-Y1DiAT.js";
6
+ import { a as discordTextHasTargetedMention, i as discordTextHasBroadcastMention, s as rewriteDiscordKnownMentions } from "./send.outbound-DhiXV3UJ.js";
7
+ import "./targets-BEIgHBHc.js";
8
+ import { t as resolveDiscordConversationIdentity } from "./conversation-identity-CN-HPn11.js";
9
9
  import { t as beginDiscordInboundEventDeliveryCorrelation } from "./inbound-event-delivery-CEPlt2uz.js";
10
- import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-CmN7ao1t.js";
11
- import { t as resolveDiscordPreviewStreamMode } from "./preview-streaming-DXT8oJdo.js";
12
10
  import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-C5TBc_9x.js";
13
- import { C as resolveDiscordAutoThreadReplyPlan, T as resolveDiscordThreadStarter, a as buildGuildLabel, h as createDiscordSupplementalContextAccessChecker, i as buildDirectLabel, m as buildDiscordInboundAccessContext, n as deliverDiscordReply, o as resolveReplyContext, r as sanitizeDiscordFrontChannelReplyPayloads } from "./provider-DrScDA1p.js";
14
- import { a as resolveForwardedMediaList, o as resolveMediaList, r as resolveDiscordMessageText, s as resolveReferencedReplyMediaList } from "./message-utils-Bx993JLN.js";
15
- import { n as createDiscordReplyTypingFeedback } from "./message-handler-CQVkXHMN.js";
11
+ import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-CNievjXH.js";
12
+ import { t as resolveDiscordPreviewStreamMode } from "./preview-streaming-DXT8oJdo.js";
13
+ import { C as resolveDiscordAutoThreadReplyPlan, T as resolveDiscordThreadStarter, a as buildGuildLabel, h as createDiscordSupplementalContextAccessChecker, i as buildDirectLabel, m as buildDiscordInboundAccessContext, n as deliverDiscordReply, o as resolveReplyContext, r as sanitizeDiscordFrontChannelReplyPayloads } from "./provider-ByZ6xxgi.js";
14
+ import { a as resolveForwardedMediaList, o as resolveMediaList, r as resolveDiscordMessageText, s as resolveReferencedReplyMediaList } from "./message-utils-s_8KDqAQ.js";
15
+ import { n as createDiscordReplyTypingFeedback } from "./message-handler-DE413Oj4.js";
16
16
  import { buildAgentSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
17
17
  import { MessageFlags } from "discord-api-types/v10";
18
18
  import path from "node:path";
@@ -536,8 +536,7 @@ function createDiscordDraftPreviewController(params) {
536
536
  const discordStreamMode = resolveDiscordPreviewStreamMode(params.discordConfig);
537
537
  const draftMaxChars = Math.min(params.textLimit, 2e3);
538
538
  const accountBlockStreamingEnabled = resolveChannelStreamingBlockEnabled(params.discordConfig) ?? params.cfg.agents?.defaults?.blockStreamingDefault === "on";
539
- const canStreamProgressDraftForToolOnlySource = params.sourceRepliesAreToolOnly && discordStreamMode === "progress";
540
- const draftStream = (!params.sourceRepliesAreToolOnly || canStreamProgressDraftForToolOnlySource) && discordStreamMode !== "off" && !accountBlockStreamingEnabled ? createDiscordDraftStream({
539
+ const draftStream = !params.sourceRepliesAreToolOnly && discordStreamMode !== "off" && !accountBlockStreamingEnabled ? createDiscordDraftStream({
541
540
  rest: params.deliveryRest,
542
541
  channelId: params.deliverChannelId,
543
542
  maxChars: draftMaxChars,
@@ -921,14 +920,20 @@ async function processDiscordMessageInner(ctx, observer) {
921
920
  statusReactionsActive = true;
922
921
  statusReactions.setQueued();
923
922
  };
924
- queueInitialDiscordAckReaction({
925
- enabled: statusReactionsEnabled,
926
- shouldSendAckReaction,
927
- ackReaction,
928
- statusReactions,
929
- reactionAdapter: discordAdapter,
930
- target: `${messageChannelId}/${message.id}`
931
- });
923
+ let initialAckReactionQueued = false;
924
+ const queueInitialAckReactionAfterRecord = () => {
925
+ if (initialAckReactionQueued) return;
926
+ initialAckReactionQueued = true;
927
+ if (statusReactionsEnabled) statusReactionsActive = true;
928
+ queueInitialDiscordAckReaction({
929
+ enabled: statusReactionsEnabled,
930
+ shouldSendAckReaction,
931
+ ackReaction,
932
+ statusReactions,
933
+ reactionAdapter: discordAdapter,
934
+ target: `${messageChannelId}/${message.id}`
935
+ });
936
+ };
932
937
  const processContext = await buildDiscordMessageProcessContext({
933
938
  ctx,
934
939
  text,
@@ -1307,6 +1312,7 @@ async function processDiscordMessageInner(ctx, observer) {
1307
1312
  storePath: turn.storePath,
1308
1313
  ctxPayload,
1309
1314
  recordInboundSession,
1315
+ afterRecord: queueInitialAckReactionAfterRecord,
1310
1316
  dispatchReplyWithBufferedBlockDispatcher,
1311
1317
  dispatcherOptions: {
1312
1318
  ...replyPipeline,
@@ -1332,13 +1338,14 @@ async function processDiscordMessageInner(ctx, observer) {
1332
1338
  sourceReplyDeliveryMode,
1333
1339
  queuedDeliveryCorrelations: isRoomEvent ? [{ begin: beginDeliveryCorrelation }] : void 0,
1334
1340
  suppressTyping: isRoomEvent ? true : void 0,
1335
- allowProgressCallbacksWhenSourceDeliverySuppressed: sourceRepliesAreToolOnly && draftPreview.draftStream && draftPreview.isProgressMode ? true : void 0,
1341
+ allowProgressCallbacksWhenSourceDeliverySuppressed: sourceRepliesAreToolOnly && statusReactionsExplicitlyEnabled ? true : void 0,
1336
1342
  disableBlockStreaming: sourceRepliesAreToolOnly ? true : draftPreview.disableBlockStreamingForDraft ?? (typeof resolvedBlockStreamingEnabled === "boolean" ? !resolvedBlockStreamingEnabled : void 0),
1337
1343
  onPartialReply: draftPreview.draftStream && !draftPreview.isProgressMode ? (payload) => draftPreview.updateFromPartial(payload.text) : void 0,
1338
1344
  onAssistantMessageStart: draftPreview.draftStream ? () => draftPreview.handleAssistantMessageBoundary() : void 0,
1339
1345
  onReasoningEnd: draftPreview.draftStream ? () => draftPreview.handleAssistantMessageBoundary() : void 0,
1340
1346
  onModelSelected,
1341
- suppressDefaultToolProgressMessages: draftPreview.suppressDefaultToolProgressMessages ? true : void 0,
1347
+ suppressDefaultToolProgressMessages: sourceRepliesAreToolOnly && statusReactionsExplicitlyEnabled || draftPreview.suppressDefaultToolProgressMessages ? true : void 0,
1348
+ allowToolLifecycleWhenProgressHidden: statusReactionsEnabled ? true : void 0,
1342
1349
  commentaryProgressEnabled: draftPreview.isProgressMode ? draftPreview.commentaryProgressEnabled : void 0,
1343
1350
  onVerboseProgressVisibility: (isActive) => {
1344
1351
  verboseProgressActive = isActive;
@@ -1353,6 +1360,8 @@ async function processDiscordMessageInner(ctx, observer) {
1353
1360
  await statusReactions.setTool(payload.name);
1354
1361
  await draftPreview.pushToolProgress(buildChannelProgressDraftLineForEntry(discordConfig, {
1355
1362
  event: "tool",
1363
+ itemId: payload.itemId,
1364
+ toolCallId: payload.toolCallId,
1356
1365
  name: payload.name,
1357
1366
  phase: payload.phase,
1358
1367
  args: payload.args
@@ -1367,6 +1376,7 @@ async function processDiscordMessageInner(ctx, observer) {
1367
1376
  await draftPreview.pushToolProgress(buildChannelProgressDraftLineForEntry(discordConfig, {
1368
1377
  event: "item",
1369
1378
  itemId: payload.itemId,
1379
+ toolCallId: payload.toolCallId,
1370
1380
  itemKind: payload.kind,
1371
1381
  title: payload.title,
1372
1382
  name: payload.name,
@@ -1402,6 +1412,8 @@ async function processDiscordMessageInner(ctx, observer) {
1402
1412
  if (payload.phase !== "end") return;
1403
1413
  await draftPreview.pushToolProgress(buildChannelProgressDraftLine({
1404
1414
  event: "command-output",
1415
+ itemId: payload.itemId,
1416
+ toolCallId: payload.toolCallId,
1405
1417
  phase: payload.phase,
1406
1418
  title: payload.title,
1407
1419
  name: payload.name,
@@ -1413,6 +1425,8 @@ async function processDiscordMessageInner(ctx, observer) {
1413
1425
  if (payload.phase !== "end") return;
1414
1426
  await draftPreview.pushToolProgress(buildChannelProgressDraftLine({
1415
1427
  event: "patch",
1428
+ itemId: payload.itemId,
1429
+ toolCallId: payload.toolCallId,
1416
1430
  phase: payload.phase,
1417
1431
  title: payload.title,
1418
1432
  name: payload.name,
@@ -1,5 +1,5 @@
1
- import { u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-304M1PMr.js";
2
1
  import { o as mergeAbortSignals } from "./timeouts-C5TBc_9x.js";
2
+ import { u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-B8NfbxEB.js";
3
3
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { ComponentType, StickerFormatType } from "discord-api-types/v10";
5
5
  import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
@@ -1,6 +1,6 @@
1
- import { o as normalizeDiscordOutboundTarget, s as chunkDiscordTextWithMode, t as createDiscordSendReceipt, x as DiscordError } from "./send.receipt-DsQWEQ2O.js";
1
+ import { o as normalizeDiscordOutboundTarget, s as chunkDiscordTextWithMode, t as createDiscordSendReceipt, x as DiscordError } from "./send.receipt-HXIwVvXy.js";
2
2
  import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
3
- import { d as readDiscordComponentSpec } from "./components-D-CYw0-b.js";
3
+ import { d as readDiscordComponentSpec } from "./components-CUmrNvv-.js";
4
4
  import { t as parseDiscordRetryAfterBodySeconds } from "./retry-after-D5_VmM-_.js";
5
5
  import { n as notifyDiscordInboundEventOutboundPayloadSuccess } from "./inbound-event-delivery-CEPlt2uz.js";
6
6
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -86,11 +86,11 @@ function normalizeDiscordApprovalPayload(payload) {
86
86
  let discordComponentSendPromise;
87
87
  let discordSharedInteractivePromise;
88
88
  async function sendDiscordComponentMessageLazy(...args) {
89
- discordComponentSendPromise ??= import("./send.components-ktzrUTkt.js").then((n) => n.i).then((module) => module.sendDiscordComponentMessage);
89
+ discordComponentSendPromise ??= import("./send.components-B4_oNcOh.js").then((n) => n.i).then((module) => module.sendDiscordComponentMessage);
90
90
  return await (await discordComponentSendPromise)(...args);
91
91
  }
92
92
  function loadDiscordSharedInteractive() {
93
- discordSharedInteractivePromise ??= import("./components-D-CYw0-b.js").then((n) => n.a);
93
+ discordSharedInteractivePromise ??= import("./components-CUmrNvv-.js").then((n) => n.a);
94
94
  return discordSharedInteractivePromise;
95
95
  }
96
96
  function addPayloadTextFallback(spec, payload) {
@@ -125,7 +125,7 @@ async function resolveDiscordComponentSpec(payload) {
125
125
  //#region extensions/discord/src/outbound-send-context.ts
126
126
  let discordSendRuntimePromise;
127
127
  async function loadDiscordSendRuntime() {
128
- discordSendRuntimePromise ??= import("./send-zGsXF-up.js").then((n) => n.t);
128
+ discordSendRuntimePromise ??= import("./send-o-Y1DiAT.js").then((n) => n.t);
129
129
  return await discordSendRuntimePromise;
130
130
  }
131
131
  function resolveDiscordOutboundTarget(params) {
@@ -280,7 +280,7 @@ function stripDiscordInternalRuntimeScaffolding(text) {
280
280
  }
281
281
  let discordThreadBindingsPromise;
282
282
  function loadDiscordThreadBindings() {
283
- discordThreadBindingsPromise ??= import("./thread-bindings-DO32M2kW.js").then((n) => n.t);
283
+ discordThreadBindingsPromise ??= import("./thread-bindings-CEVvN75T.js").then((n) => n.t);
284
284
  return discordThreadBindingsPromise;
285
285
  }
286
286
  function resolveDiscordWebhookIdentity(params) {
@@ -1,4 +1,4 @@
1
- import { Wt as __exportAll } from "./send.receipt-DsQWEQ2O.js";
1
+ import { Wt as __exportAll } from "./send.receipt-HXIwVvXy.js";
2
2
  import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
3
3
  //#region extensions/discord/src/pluralkit.ts
4
4
  var pluralkit_exports = /* @__PURE__ */ __exportAll({ fetchPluralKitMessageInfo: () => fetchPluralKitMessageInfo });
@@ -1,27 +1,27 @@
1
- import { $ as BaseMessageInteractiveComponent, A as User, B as Container, D as CommandWithSubcommands, E as Command, F as Modal, J as Separator, K as Row, O as Guild, R as Button, S as RateLimitError, Wt as __exportAll, X as TextDisplay, Y as StringSelectMenu, c as discord_exports, ct as createThread, d as MessageReactionAddListener, dt as editChannel, f as MessageReactionRemoveListener, g as ThreadUpdateListener, k as Message, l as InteractionCreateListener, m as ReadyListener, mt as getChannelMessage, p as PresenceUpdateListener, s as chunkDiscordTextWithMode, u as MessageCreateListener, v as Client, y as Plugin } from "./send.receipt-DsQWEQ2O.js";
1
+ import { $ as BaseMessageInteractiveComponent, A as User, B as Container, D as CommandWithSubcommands, E as Command, F as Modal, J as Separator, K as Row, O as Guild, R as Button, S as RateLimitError, Wt as __exportAll, X as TextDisplay, Y as StringSelectMenu, c as discord_exports, ct as createThread, d as MessageReactionAddListener, dt as editChannel, f as MessageReactionRemoveListener, g as ThreadUpdateListener, k as Message, l as InteractionCreateListener, m as ReadyListener, mt as getChannelMessage, p as PresenceUpdateListener, s as chunkDiscordTextWithMode, u as MessageCreateListener, v as Client, y as Plugin } from "./send.receipt-HXIwVvXy.js";
2
2
  import { c as resolveDiscordAccountAllowFrom, d as resolveDiscordAccountDmPolicy, f as resolveDiscordMaxLinesPerMessage, p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
3
- import { _ as parseDiscordComponentCustomId, b as parseDiscordModalCustomIdForInteraction, v as parseDiscordComponentCustomIdForInteraction, y as parseDiscordModalCustomId } from "./components-D-CYw0-b.js";
4
- import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-ktzrUTkt.js";
3
+ import { _ as parseDiscordComponentCustomId, b as parseDiscordModalCustomIdForInteraction, v as parseDiscordComponentCustomIdForInteraction, y as parseDiscordModalCustomId } from "./components-CUmrNvv-.js";
4
+ import { a as resolveDiscordComponentEntryWithPersistence, o as resolveDiscordModalEntryWithPersistence, t as editDiscordComponentMessage } from "./send.components-B4_oNcOh.js";
5
5
  import { c as setPresence, i as unregisterGateway, r as registerGateway } from "./gateway-registry-DPxmW0Db.js";
6
- import { B as DISCORD_REST_TIMEOUT_MS, D as canViewDiscordGuildChannel, H as withValidatedDiscordProxy, I as createDiscordRestClient, V as validateDiscordProxyUrl } from "./send.shared-Dvo2ZCVG.js";
6
+ import { B as DISCORD_REST_TIMEOUT_MS, D as canViewDiscordGuildChannel, H as withValidatedDiscordProxy, I as createDiscordRestClient, V as validateDiscordProxyUrl } from "./send.shared-DYdjs_Zh.js";
7
7
  import { a as summarizeDiscordResponseBody, i as isDiscordRateLimitResponseBody } from "./api-BmXlcjYW.js";
8
8
  import { S as resolveTimestampMs, _ as resolveGroupDmAllow, a as normalizeDiscordSlug, b as formatDiscordUserTag, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, f as resolveDiscordMemberAccessState, h as resolveDiscordOwnerAllowFrom, i as normalizeDiscordDisplaySlug, l as resolveDiscordChannelPolicyCommandAuthorizer, m as resolveDiscordOwnerAccess, n as isDiscordGroupAllowedByPolicy, o as resolveDiscordAllowListMatch, p as resolveDiscordMemberAllowed, r as normalizeDiscordAllowList, v as shouldEmitDiscordReactionNotification, y as formatDiscordReactionEmoji } from "./allow-list-C-MqM-B_.js";
9
- import { s as sendVoiceMessageDiscord } from "./send-zGsXF-up.js";
10
- import { o as formatMention, t as sendMessageDiscord } from "./send.outbound-C8oC51um.js";
9
+ import { s as sendVoiceMessageDiscord } from "./send-o-Y1DiAT.js";
10
+ import { o as formatMention, t as sendMessageDiscord } from "./send.outbound-DhiXV3UJ.js";
11
11
  import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
12
- import { a as getDiscordExecApprovalApprovers, s as isDiscordExecApprovalClientEnabled, t as resolveDiscordConversationIdentity } from "./conversation-identity-CKzQAqFF.js";
13
- import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-Rautpk8n.js";
14
- import { t as resolveDiscordUserAllowlist } from "./resolve-users-Bw7vvtsi.js";
15
- import { _ as formatThreadBindingDurationLabel, a as isThreadArchived, d as resolveDiscordChannelNameSafe, f as resolveDiscordChannelParentIdSafe, l as resolveDiscordChannelIdSafe, m as resolveDiscordChannelTopicSafe, p as resolveDiscordChannelParentSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-304M1PMr.js";
16
- import { r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-2MdGjUAf.js";
12
+ import { a as getDiscordExecApprovalApprovers, s as isDiscordExecApprovalClientEnabled, t as resolveDiscordConversationIdentity } from "./conversation-identity-CN-HPn11.js";
17
13
  import { d as withAbortTimeout, l as raceWithTimeout } from "./timeouts-C5TBc_9x.js";
18
- import { d as resolveDiscordMessageChannelId, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText, u as resolveDiscordChannelInfo } from "./message-utils-Bx993JLN.js";
14
+ import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-t1URw0Qz.js";
15
+ import { t as resolveDiscordUserAllowlist } from "./resolve-users-Bapkb237.js";
16
+ import { _ as formatThreadBindingDurationLabel, a as isThreadArchived, d as resolveDiscordChannelNameSafe, f as resolveDiscordChannelParentIdSafe, l as resolveDiscordChannelIdSafe, m as resolveDiscordChannelTopicSafe, p as resolveDiscordChannelParentSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-B8NfbxEB.js";
17
+ import { r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-2MdGjUAf.js";
18
+ import { d as resolveDiscordMessageChannelId, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText, u as resolveDiscordChannelInfo } from "./message-utils-s_8KDqAQ.js";
19
19
  import { t as resolveDiscordSenderIdentity } from "./sender-identity-CEsfDF0L.js";
20
- import "./approval-handler.runtime-B3gyUd-L.js";
20
+ import "./approval-handler.runtime-BprBDUQG.js";
21
21
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
22
22
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId, normalizeStringEntries, normalizeStringEntriesLower, summarizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
23
23
  import { buildAgentSessionKey, deriveLastRoutePolicy, isAcpSessionKey, isSubagentSessionKey, parseAgentSessionKey, resolveAgentIdFromSessionKey, resolveAgentRoute } from "openclaw/plugin-sdk/routing";
24
- import { getRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
24
+ import { getRuntimeConfig, getRuntimeConfigSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
25
25
  import { ApplicationCommandOptionType, ButtonStyle, ChannelType, ComponentType, GatewayCloseCodes, GatewayCloseCodes as GatewayCloseCodes$1, GatewayDispatchEvents, GatewayIntentBits, GatewayOpcodes } from "discord-api-types/v10";
26
26
  import { MAX_DATE_TIMESTAMP_MS, asDateTimestampMs, parseFiniteNumber, parseStrictFiniteNumber, parseStrictInteger, parseStrictNonNegativeInteger, parseStrictPositiveInteger, resolveDateTimestampMs, resolveTimestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
27
27
  import { createHash, randomUUID } from "node:crypto";
@@ -56,7 +56,7 @@ import { createChannelIngressResolver, defineStableChannelIngressIdentity, readC
56
56
  import { applyModelOverrideToSessionEntry, resolveChannelModelOverride } from "openclaw/plugin-sdk/model-session-runtime";
57
57
  import { completeWithPreparedSimpleCompletionModel, extractAssistantText, prepareSimpleCompletionModelForAgent } from "openclaw/plugin-sdk/simple-completion-runtime";
58
58
  import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
59
- import { getSessionEntry, loadSessionStore, readSessionUpdatedAt as readSessionUpdatedAt$1, resolveStorePath, resolveStorePath as resolveStorePath$1, updateSessionStore } from "openclaw/plugin-sdk/session-store-runtime";
59
+ import { getSessionEntry, listSessionEntries, loadSessionStore, patchSessionEntry, readSessionUpdatedAt as readSessionUpdatedAt$1, resolveStorePath, resolveStorePath as resolveStorePath$1 } from "openclaw/plugin-sdk/session-store-runtime";
60
60
  import { formatInboundEnvelope, resolveEnvelopeFormatOptions, runChannelInboundEvent } from "openclaw/plugin-sdk/channel-inbound";
61
61
  import { buildCommandTextFromArgs, findCommandByNativeName, formatCommandArgMenuTitle, listChatCommands, listNativeCommandSpecsForConfig, listSkillCommandsForAgents, resolveCommandAuthorizedFromAuthorizers, resolveNativeCommandSessionTargets, resolveStoredModelOverride, serializeCommandArgs } from "openclaw/plugin-sdk/command-auth-native";
62
62
  import { buildCommandTextFromArgs as buildCommandTextFromArgs$1, findCommandByNativeName as findCommandByNativeName$1, parseCommandArgs, resolveCommandArgChoices, resolveCommandArgMenu, serializeCommandArgs as serializeCommandArgs$1 } from "openclaw/plugin-sdk/native-command-registry";
@@ -660,6 +660,17 @@ async function maybeCreateDiscordAutoThread(params) {
660
660
  const messageChannelId = resolveTrimmedDiscordMessageChannelId(params);
661
661
  if (!messageChannelId) return;
662
662
  try {
663
+ try {
664
+ const existingThreadId = (await getChannelMessage(params.client.rest, messageChannelId, params.message.id))?.thread?.id;
665
+ if (existingThreadId) {
666
+ logVerbose(`discord: autoThread reusing existing thread ${existingThreadId} on ${messageChannelId}/${params.message.id}`);
667
+ return existingThreadId;
668
+ }
669
+ } catch {}
670
+ if (params.message.author?.bot) {
671
+ logVerbose(`discord: autoThread skipped for bot-authored message ${messageChannelId}/${params.message.id}`);
672
+ return;
673
+ }
663
674
  const rawThreadSource = params.baseText || params.combinedBody || "Thread";
664
675
  const threadName = sanitizeDiscordThreadName(rawThreadSource, params.message.id);
665
676
  const archiveDuration = params.channelConfig?.autoArchiveDuration ? Number(params.channelConfig.autoArchiveDuration) : 60;
@@ -1210,15 +1221,25 @@ async function closeDiscordThreadSessions(params) {
1210
1221
  }
1211
1222
  const storePath = resolveStorePath(cfg.session?.store, { agentId: accountId });
1212
1223
  let resetCount = 0;
1213
- await updateSessionStore(storePath, (store) => {
1214
- for (const [key, entry] of Object.entries(store)) {
1215
- if (!entry || !sessionKeyContainsThreadId(key)) continue;
1216
- if (entry.updatedAt === 0) continue;
1217
- entry.updatedAt = 0;
1218
- resetCount += 1;
1219
- }
1220
- return resetCount;
1221
- });
1224
+ for (const { sessionKey, entry } of listSessionEntries({ storePath })) {
1225
+ if (!sessionKeyContainsThreadId(sessionKey) || entry.updatedAt === 0) continue;
1226
+ let resetEntry = false;
1227
+ await patchSessionEntry({
1228
+ storePath,
1229
+ sessionKey,
1230
+ replaceEntry: true,
1231
+ update: (current) => {
1232
+ if (current.updatedAt === 0) return null;
1233
+ if (current.updatedAt !== entry.updatedAt || current.sessionId !== entry.sessionId) return null;
1234
+ resetEntry = true;
1235
+ return {
1236
+ ...current,
1237
+ updatedAt: 0
1238
+ };
1239
+ }
1240
+ });
1241
+ if (resetEntry) resetCount += 1;
1242
+ }
1222
1243
  return resetCount;
1223
1244
  }
1224
1245
  //#endregion
@@ -3297,32 +3318,37 @@ function toDiscordModelPickerMessagePayload(view) {
3297
3318
  async function persistDiscordModelPickerOverride(params) {
3298
3319
  const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.route.agentId });
3299
3320
  let persisted = false;
3300
- await updateSessionStore(storePath, (store) => {
3301
- const entry = store[params.route.sessionKey] ?? {
3321
+ await patchSessionEntry({
3322
+ storePath,
3323
+ sessionKey: params.route.sessionKey,
3324
+ fallbackEntry: {
3302
3325
  sessionId: randomUUID(),
3303
3326
  updatedAt: Date.now()
3304
- };
3305
- store[params.route.sessionKey] = entry;
3306
- persisted = applyModelOverrideToSessionEntry({
3307
- entry,
3308
- selection: {
3309
- provider: params.provider,
3310
- model: params.model,
3311
- isDefault: params.isDefault
3312
- },
3313
- markLiveSwitchPending: true
3314
- }).updated || persisted;
3315
- const runtime = params.runtime?.trim();
3316
- if (runtime && runtime !== "auto" && runtime !== "default") {
3317
- if (entry.agentRuntimeOverride !== runtime) {
3318
- entry.agentRuntimeOverride = runtime;
3327
+ },
3328
+ replaceEntry: true,
3329
+ update: (entry) => {
3330
+ persisted = applyModelOverrideToSessionEntry({
3331
+ entry,
3332
+ selection: {
3333
+ provider: params.provider,
3334
+ model: params.model,
3335
+ isDefault: params.isDefault
3336
+ },
3337
+ markLiveSwitchPending: true
3338
+ }).updated || persisted;
3339
+ const runtime = params.runtime?.trim();
3340
+ if (runtime && runtime !== "auto" && runtime !== "default") {
3341
+ if (entry.agentRuntimeOverride !== runtime) {
3342
+ entry.agentRuntimeOverride = runtime;
3343
+ delete entry.agentHarnessId;
3344
+ persisted = true;
3345
+ }
3346
+ } else if (runtime && entry.agentRuntimeOverride) {
3347
+ delete entry.agentRuntimeOverride;
3319
3348
  delete entry.agentHarnessId;
3320
3349
  persisted = true;
3321
3350
  }
3322
- } else if (runtime && entry.agentRuntimeOverride) {
3323
- delete entry.agentRuntimeOverride;
3324
- delete entry.agentHarnessId;
3325
- persisted = true;
3351
+ return entry;
3326
3352
  }
3327
3353
  });
3328
3354
  return persisted;
@@ -4146,7 +4172,7 @@ function resolveDiscordCommandLogLabel(command) {
4146
4172
  return command.key;
4147
4173
  }
4148
4174
  function buildDiscordCommandOptions(params) {
4149
- const { command, cfg, authorizeChoiceContext, resolveChoiceContext } = params;
4175
+ const { command, cfg, resolveConfig, authorizeChoiceContext, resolveChoiceContext } = params;
4150
4176
  const commandLabel = resolveDiscordCommandLogLabel(command);
4151
4177
  const args = command.args;
4152
4178
  if (!args || args.length === 0) return;
@@ -4185,7 +4211,7 @@ function buildDiscordCommandOptions(params) {
4185
4211
  const choices = resolveCommandArgChoices({
4186
4212
  command,
4187
4213
  arg,
4188
- cfg,
4214
+ cfg: resolveConfig?.() ?? cfg,
4189
4215
  provider: context?.provider,
4190
4216
  model: context?.model
4191
4217
  });
@@ -4221,19 +4247,21 @@ function createDiscordNativeCommand(params) {
4221
4247
  const pluginCommandMatch = nativeCommandRuntime.matchPluginCommand(`/${command.name}`);
4222
4248
  const commandDefinition = pluginCommandMatch !== null ? fallbackCommandDefinition : findCommandByNativeName$1(command.name, "discord", { includeBundledChannelFallback: false }) ?? fallbackCommandDefinition;
4223
4249
  const argDefinitions = commandDefinition.args ?? command.args;
4250
+ const resolveCurrentConfig = () => getRuntimeConfigSnapshot() ?? cfg;
4224
4251
  const commandOptions = buildDiscordCommandOptions({
4225
4252
  command: commandDefinition,
4226
4253
  cfg,
4254
+ resolveConfig: resolveCurrentConfig,
4227
4255
  authorizeChoiceContext: async (interaction) => await resolveDiscordNativeAutocompleteAuthorized({
4228
4256
  interaction,
4229
- cfg,
4257
+ cfg: resolveCurrentConfig(),
4230
4258
  discordConfig,
4231
4259
  accountId,
4232
4260
  skipCommandOwnerAllowFrom: pluginCommandMatch !== null
4233
4261
  }),
4234
4262
  resolveChoiceContext: async (interaction) => resolveDiscordNativeChoiceContext({
4235
4263
  interaction,
4236
- cfg,
4264
+ cfg: resolveCurrentConfig(),
4237
4265
  accountId,
4238
4266
  threadBindings
4239
4267
  })
@@ -4284,7 +4312,8 @@ function createDiscordNativeCommand(params) {
4284
4312
  }();
4285
4313
  }
4286
4314
  async function dispatchDiscordCommandInteraction(params) {
4287
- const { interaction, prompt, command, commandArgs, cfg, discordConfig, accountId, sessionPrefix, preferFollowUp, threadBindings, responseEphemeral, suppressReplies } = params;
4315
+ const { interaction, prompt, command, commandArgs, cfg: inputConfig, discordConfig, accountId, sessionPrefix, preferFollowUp, threadBindings, responseEphemeral, suppressReplies } = params;
4316
+ const cfg = getRuntimeConfigSnapshot() ?? inputConfig;
4288
4317
  const commandName = command.nativeName ?? command.key;
4289
4318
  const respond = async (content, options) => {
4290
4319
  const ephemeral = options?.ephemeral ?? responseEphemeral;
@@ -7917,7 +7946,7 @@ async function loadConversationRuntime$1() {
7917
7946
  return await conversationRuntimePromise$1;
7918
7947
  }
7919
7948
  async function loadTypingRuntime() {
7920
- typingRuntimePromise ??= import("./typing-BaivbXIG.js").then((n) => n.n);
7949
+ typingRuntimePromise ??= import("./typing-0-pUmlY9.js").then((n) => n.n);
7921
7950
  return await typingRuntimePromise;
7922
7951
  }
7923
7952
  function buildDiscordComponentConversationLabel(params) {
@@ -8338,7 +8367,7 @@ async function dispatchPluginDiscordInteractiveEvent(params) {
8338
8367
  //#region extensions/discord/src/monitor/agent-components.handlers.ts
8339
8368
  let componentsRuntimePromise;
8340
8369
  async function loadComponentsRuntime() {
8341
- componentsRuntimePromise ??= import("./components-D-CYw0-b.js").then((n) => n.t);
8370
+ componentsRuntimePromise ??= import("./components-CUmrNvv-.js").then((n) => n.t);
8342
8371
  return await componentsRuntimePromise;
8343
8372
  }
8344
8373
  async function handleDiscordComponentEvent(params) {
@@ -9556,7 +9585,7 @@ async function runDiscordGatewayLifecycle(params) {
9556
9585
  gatewayEmitter?.removeListener(DISCORD_GATEWAY_TRANSPORT_ACTIVITY_EVENT, onGatewayTransportActivity);
9557
9586
  if (params.voiceManager) {
9558
9587
  await params.voiceManager.destroy();
9559
- const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-Chy2OrO_.js").then((n) => n.n);
9588
+ const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-W6n_8J8g.js").then((n) => n.n);
9560
9589
  setDiscordTranscriptsVoiceManager({
9561
9590
  accountId: params.accountId,
9562
9591
  manager: null
@@ -9834,7 +9863,7 @@ function logDiscordStartupPhase(params) {
9834
9863
  });
9835
9864
  }
9836
9865
  async function loadDiscordVoiceRuntime() {
9837
- const promise = discordVoiceRuntimePromise ?? import("./manager.runtime-BU1vkOeO.js");
9866
+ const promise = discordVoiceRuntimePromise ?? import("./manager.runtime-zMVwNPAT.js");
9838
9867
  discordVoiceRuntimePromise = promise;
9839
9868
  try {
9840
9869
  return await promise;
@@ -9844,7 +9873,7 @@ async function loadDiscordVoiceRuntime() {
9844
9873
  }
9845
9874
  }
9846
9875
  async function loadDiscordProviderSessionRuntime() {
9847
- const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-DXTzSYOJ.js");
9876
+ const promise = discordProviderSessionRuntimePromise ?? import("./provider-session.runtime-DMfaQ9Z6.js");
9848
9877
  discordProviderSessionRuntimePromise = promise;
9849
9878
  try {
9850
9879
  return await promise;
@@ -10114,7 +10143,7 @@ async function monitorDiscordProvider(opts = {}) {
10114
10143
  runtime,
10115
10144
  botUserId
10116
10145
  });
10117
- const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-Chy2OrO_.js").then((n) => n.n);
10146
+ const { setDiscordTranscriptsVoiceManager } = await import("./transcripts-source-W6n_8J8g.js").then((n) => n.n);
10118
10147
  setDiscordTranscriptsVoiceManager({
10119
10148
  accountId: account.accountId,
10120
10149
  manager: voiceManager
@@ -1,6 +1,6 @@
1
- import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-DO32M2kW.js";
2
- import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-C9YT7wF2.js";
3
- import { t as createDiscordMessageHandler } from "./message-handler-CQVkXHMN.js";
1
+ import { a as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-CEVvN75T.js";
2
+ import { n as createThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-BKfUaXGt.js";
3
+ import { t as createDiscordMessageHandler } from "./message-handler-DE413Oj4.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-ByZ6xxgi.js";
2
+ export { monitorDiscordProvider };
@@ -1,4 +1,4 @@
1
- import { Wt as __exportAll } from "./send.receipt-DsQWEQ2O.js";
1
+ import { Wt as __exportAll } from "./send.receipt-HXIwVvXy.js";
2
2
  import { n as fetchDiscord, t as DiscordApiError } from "./api-BmXlcjYW.js";
3
3
  import { a as normalizeDiscordSlug } from "./allow-list-C-MqM-B_.js";
4
4
  import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-B3p7cT8F.js";
@@ -1,4 +1,4 @@
1
- import { Wt as __exportAll } from "./send.receipt-DsQWEQ2O.js";
1
+ import { Wt as __exportAll } from "./send.receipt-HXIwVvXy.js";
2
2
  import { n as fetchDiscord } from "./api-BmXlcjYW.js";
3
3
  import { i as listGuilds, n as filterDiscordGuilds, r as resolveDiscordAllowlistToken, t as buildDiscordUnresolvedResults } from "./resolve-allowlist-common-B3p7cT8F.js";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,13 +1,13 @@
1
- import { Ut as resolveDiscordChannelId } from "./send.receipt-DsQWEQ2O.js";
1
+ import { Ut as resolveDiscordChannelId } from "./send.receipt-HXIwVvXy.js";
2
2
  import { a as mergeDiscordAccountConfig, o as resolveDefaultDiscordAccountId, t as createDiscordActionGate } from "./accounts-P19jm1lf.js";
3
- import { d as readDiscordComponentSpec } from "./components-D-CYw0-b.js";
4
- import { _ as withNormalizedTimestamp, c as jsonResult, d as readNonNegativeIntegerParam, f as readPositiveIntegerParam, g as resolvePollMaxSelections, h as readStringParam, l as parseAvailableTags, m as readStringArrayParam, p as readReactionParams, r as sendDiscordComponentMessage, s as assertMediaNotDataUrl, u as readBooleanParam } from "./send.components-ktzrUTkt.js";
3
+ import { d as readDiscordComponentSpec } from "./components-CUmrNvv-.js";
4
+ import { _ as withNormalizedTimestamp, c as jsonResult, d as readNonNegativeIntegerParam, f as readPositiveIntegerParam, g as resolvePollMaxSelections, h as readStringParam, l as parseAvailableTags, m as readStringArrayParam, p as readReactionParams, r as sendDiscordComponentMessage, s as assertMediaNotDataUrl, u as readBooleanParam } from "./send.components-B4_oNcOh.js";
5
5
  import { n as getGateway, o as getPresence } from "./gateway-registry-DPxmW0Db.js";
6
- import { E as canManageGuildRoleDiscord, L as createDiscordRuntimeAccountContext, M as hasAnyGuildPermissionDiscord, N as isThreadChannelType$1, O as fetchChannelPermissionsDiscord, T as canManageGuildMemberRoleDiscord, d as resolveDiscordTargetChannelId, j as hasAnyChannelPermissionDiscord } from "./send.shared-Dvo2ZCVG.js";
6
+ import { E as canManageGuildRoleDiscord, L as createDiscordRuntimeAccountContext, M as hasAnyGuildPermissionDiscord, N as isThreadChannelType$1, O as fetchChannelPermissionsDiscord, T as canManageGuildMemberRoleDiscord, d as resolveDiscordTargetChannelId, j as hasAnyChannelPermissionDiscord } from "./send.shared-DYdjs_Zh.js";
7
7
  import { a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, n as isDiscordGroupAllowedByPolicy } from "./allow-list-C-MqM-B_.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, 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-zGsXF-up.js";
9
- import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-C8oC51um.js";
10
- import "./targets-CKaNidbk.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, 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-o-Y1DiAT.js";
9
+ import { n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-DhiXV3UJ.js";
10
+ import "./targets-BEIgHBHc.js";
11
11
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
12
12
  import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
13
13
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
@@ -639,14 +639,28 @@ async function handleDiscordMessageManagementAction(ctx) {
639
639
  }
640
640
  case "searchMessages": {
641
641
  if (!ctx.isActionEnabled("search")) throw new Error("Discord search is disabled.");
642
- const guildId = readStringParam(ctx.params, "guildId", { required: true });
643
- const content = readStringParam(ctx.params, "content", { required: true });
642
+ let guildId = readStringParam(ctx.params, "guildId");
643
+ const content = readStringParam(ctx.params, "content") ?? readStringParam(ctx.params, "query");
644
+ if (!content) throw new Error("Discord search requires content or query text.");
644
645
  const channelId = readStringParam(ctx.params, "channelId");
645
646
  const channelIds = readStringArrayParam(ctx.params, "channelIds");
647
+ if (!guildId) {
648
+ const rawInferChannelId = channelId ?? channelIds?.[0];
649
+ if (rawInferChannelId) try {
650
+ const inferChannelId = discordMessagingActionRuntime.resolveDiscordChannelId(rawInferChannelId);
651
+ const channelInfo = await discordMessagingActionRuntime.fetchChannelInfoDiscord(inferChannelId, ctx.withOpts());
652
+ if (channelInfo && typeof channelInfo === "object") {
653
+ const record = channelInfo;
654
+ const resolved = record.guild_id ?? record.guildId;
655
+ if (typeof resolved === "string" && resolved.trim()) guildId = resolved.trim();
656
+ }
657
+ } catch {}
658
+ }
659
+ if (!guildId) throw new Error("Discord search requires guildId. Provide guildId explicitly, or provide channelId so the guild can be resolved from the channel.");
646
660
  const authorId = readStringParam(ctx.params, "authorId");
647
661
  const authorIds = readStringArrayParam(ctx.params, "authorIds");
648
662
  const limit = readPositiveIntegerParam(ctx.params, "limit");
649
- const channelIdList = [...channelIds ?? [], ...channelId ? [channelId] : []];
663
+ const channelIdList = [...(channelIds ?? []).map((id) => discordMessagingActionRuntime.resolveDiscordChannelId(id)), ...channelId ? [discordMessagingActionRuntime.resolveDiscordChannelId(channelId)] : []];
650
664
  if (channelIdList.length > 0) for (const targetChannelId of channelIdList) await ctx.assertReadTargetAllowed({
651
665
  guildId,
652
666
  channelId: targetChannelId
@@ -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-C80YEJ7Z.js";
2
- import { t as discordMessageActions } from "./channel-actions-BnPHwCZ_.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-C6jV3hf4.js";
2
+ import { t as discordMessageActions } from "./channel-actions-CoudAyAB.js";
3
3
  export { discordMessageActions, handleDiscordAction, isDiscordModerationAction, readDiscordChannelCreateParams, readDiscordChannelEditParams, readDiscordChannelMoveParams, readDiscordModerationCommand, readDiscordParentIdParam, requiredGuildPermissionForModerationAction };