@openclaw/discord 2026.9.6 → 2026.9.7

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 (150) hide show
  1. package/assets/icon.png +0 -0
  2. package/dist/.setup/{account-inspect-BwQj24ht.mjs → account-inspect-De8hOUxG.mjs} +1 -1
  3. package/dist/.setup/{accounts-CwJQoLjM.mjs → accounts-ChaMcixG.mjs} +1 -4
  4. package/dist/.setup/{activities-api-COU4-0nR.mjs → activities-api-tvbsU2e3.mjs} +38 -66
  5. package/dist/.setup/{api-CBK9zcq5.mjs → api-DVbJwZVt.mjs} +10 -2
  6. package/dist/.setup/{approval-handler.runtime-CbBktBb4.mjs → approval-handler.runtime-DxCK2Rux.mjs} +49 -125
  7. package/dist/.setup/{approval-message-updates-jf9zMaIC.mjs → approval-message-updates-BKFqavHZ.mjs} +2 -2
  8. package/dist/.setup/{audit-vKbh-LFR.mjs → audit-CLg9I71N.mjs} +5 -5
  9. package/dist/.setup/{channel-Dv4e3Jpc.mjs → channel-DxlUVU9t.mjs} +121 -227
  10. package/dist/.setup/{channel-type-DKnjV1XW.mjs → channel-type-DRCrEMss.mjs} +22 -22
  11. package/dist/.setup/{channel.setup-0NX6FFwi.mjs → channel.setup-CRo1GjV7.mjs} +6 -9
  12. package/dist/.setup/{components-yBEb75bB.mjs → components-Cq1PvIpN.mjs} +41 -69
  13. package/dist/.setup/{config-schema-CiZz-mtA.mjs → config-schema-oxELUSDx.mjs} +19 -44
  14. package/dist/.setup/{conversation-binding-route-B7qImK_b.mjs → conversation-binding-route-Caz_XuFH.mjs} +10 -5
  15. package/dist/.setup/{directory-config-BytTftz-.mjs → directory-config-esqNn0Eo.mjs} +6 -9
  16. package/dist/.setup/{directory-live--EGTH0DC.mjs → directory-live-DtKRHuGV.mjs} +6 -12
  17. package/dist/.setup/{discord-BXpHW-cu.mjs → discord-0xJYfdDD.mjs} +82 -386
  18. package/dist/.setup/{doctor-D1R-uFIu.mjs → doctor-BCl1H5tl.mjs} +21 -36
  19. package/dist/.setup/{doctor-contract-Co5vRCZ6.mjs → doctor-contract-CvvgwrrG.mjs} +41 -50
  20. package/dist/.setup/{channel-actions.runtime-leZuw01r.mjs → handle-action-CUvQWnE7.mjs} +67 -104
  21. package/dist/.setup/{handle-action.guild-admin-DcFa8NwA.mjs → handle-action.guild-admin-Df-8gVle.mjs} +62 -120
  22. package/dist/.setup/{live-policy-config-eKQ-PLdy.mjs → live-policy-config-8Pv20CHc.mjs} +2 -3
  23. package/dist/.setup/{message-handler-X6ejmbtY.mjs → message-handler-B-Jk4oDk.mjs} +18 -94
  24. package/dist/.setup/{message-handler.preflight-pluralkit-8Xji34AF.mjs → message-handler.preflight-pluralkit-CWLUBVcx.mjs} +8 -10
  25. package/dist/.setup/{message-handler.preflight-DE_POxFc.mjs → message-handler.preflight-v-__NSDq.mjs} +69 -180
  26. package/dist/.setup/{message-handler.process-CCmIVnxy.mjs → message-handler.process-BNFFuChn.mjs} +65 -86
  27. package/dist/.setup/{outbound-adapter-ClIgmu4F.mjs → outbound-adapter-BobT-kse.mjs} +105 -19
  28. package/dist/.setup/{outbound-session-route-VulUE0yV.mjs → outbound-session-route-zVGxxceg.mjs} +140 -108
  29. package/dist/.setup/{pluralkit-CdAt1G0P.mjs → pluralkit-a6_NLfH9.mjs} +1 -1
  30. package/dist/.setup/{presence-cache-dYSHPWMx.mjs → presence-cache-Di3H3DIU.mjs} +0 -4
  31. package/dist/.setup/{probe-CupW4we4.mjs → probe-LYrIHlBF.mjs} +13 -4
  32. package/dist/.setup/{provider-iOf73HW-.mjs → provider-B_G5hASF.mjs} +721 -1416
  33. package/dist/.setup/provider-session.runtime-BYlTBFD2.mjs +6 -0
  34. package/dist/.setup/provider.runtime-CUE3UxER.mjs +2 -0
  35. package/dist/.setup/{realtime-session.runtime-Dz8uVutq.mjs → realtime-session.runtime-oUd9DOcz.mjs} +41 -55
  36. package/dist/.setup/{receive-recovery-DHst8WRx.mjs → receive-recovery-CHPOsnLc.mjs} +1 -4
  37. package/dist/.setup/{resolve-allowlist-common-CwMBzbx9.mjs → resolve-allowlist-common-DPdRggu5.mjs} +4 -7
  38. package/dist/.setup/{resolve-channels-BbvsLQOZ.mjs → resolve-channels-BFPNRmVv.mjs} +21 -40
  39. package/dist/.setup/{resolve-users-ByFlR7LQ.mjs → resolve-users-0-aBuCy3.mjs} +4 -4
  40. package/dist/.setup/{retry-BEYkDy0P.mjs → retry-pz_cSha2.mjs} +3 -3
  41. package/dist/.setup/rolldown-runtime-B4FMCO8f.mjs +28 -0
  42. package/dist/.setup/{runtime-B8lJfyrA.mjs → runtime-FN000lxA.mjs} +60 -162
  43. package/dist/.setup/runtime-doctor-migrations-CshUGl36.mjs +159 -0
  44. package/dist/.setup/{runtime-DisDbixd.mjs → runtime-sUksZ--Q.mjs} +2 -5
  45. package/dist/.setup/{secret-config-contract-DFu9hfU8.mjs → secret-config-contract-uOE2J7yM.mjs} +15 -85
  46. package/dist/.setup/{security-audit-s5w50-Ly.mjs → security-audit-Cdaegq7C.mjs} +3 -1
  47. package/dist/.setup/{send-CIBzvXjS.mjs → send-CrfEI6Bs.mjs} +53 -108
  48. package/dist/.setup/{send.components-ChY21qr-.mjs → send.components-DxQAMfES.mjs} +62 -107
  49. package/dist/.setup/{send.outbound-QTyuFupn.mjs → send.outbound-BISKnb-a.mjs} +66 -140
  50. package/dist/.setup/{send.shared-VNvWfX2T.mjs → send.shared-DGFkbkQR.mjs} +10 -25
  51. package/dist/.setup/{sender-identity-0Ymgvmaj.mjs → sender-identity-B9X5Vb9R.mjs} +2 -3
  52. package/dist/.setup/setup-plugin-api-BQUBxbhe.mjs +3 -0
  53. package/dist/.setup/{shared-DHPDaMSx.mjs → shared-B3wZ4hN-.mjs} +25 -32
  54. package/dist/.setup/{subagent-hooks-CjW7r8Pe.mjs → subagent-hooks-nlUE9ow7.mjs} +5 -6
  55. package/dist/.setup/system-events-CdeZnvPV.mjs +33 -0
  56. package/dist/.setup/{target-resolver-BXpy6VT8.mjs → target-resolver-BuLapkhy.mjs} +9 -12
  57. package/dist/.setup/targets-0KUcEIYx.mjs +3 -0
  58. package/dist/.setup/{thread-bindings-CEh2dhqP.mjs → thread-bindings-D7TfgjR_.mjs} +33 -35
  59. package/dist/.setup/{thread-bindings.manager-ve-i6oqt.mjs → thread-bindings.manager-DN-NissX.mjs} +325 -233
  60. package/dist/.setup/thread-bindings.session-updates-CshfKghV.mjs +359 -0
  61. package/dist/.setup/{thread-bindings.state-BThFQEga.mjs → thread-bindings.state-g6v9zAym.mjs} +21 -62
  62. package/dist/.setup/{transcripts-source-DVegW0WI.mjs → transcripts-source-p8EV179h.mjs} +76 -235
  63. package/dist/.setup/{typing-BKZL5fGj.mjs → typing-BiHCzBRu.mjs} +2 -1
  64. package/dist/.setup/{voice-runtime-elTtjEIG.mjs → voice-runtime-B46rcwrG.mjs} +140 -244
  65. package/dist/account-inspect-api.js +1 -1
  66. package/dist/action-runtime-api.js +1 -1
  67. package/dist/activities-api.js +1 -1
  68. package/dist/api.js +18 -18
  69. package/dist/channel-config-api.js +1 -1
  70. package/dist/channel-plugin-api.js +1 -1
  71. package/dist/directory-contract-api.js +1 -1
  72. package/dist/doctor-contract-api.js +4 -4
  73. package/dist/index.js +1 -1
  74. package/dist/runtime-api.js +20 -20
  75. package/dist/secret-contract-api.js +1 -1
  76. package/dist/security-audit-contract-api.js +1 -1
  77. package/dist/setup-entry.js +1 -1
  78. package/dist/setup-plugin-api.js +1 -1
  79. package/dist/src/voice/audio-worker.runtime.js +15 -24
  80. package/dist/subagent-hooks-api.js +3 -4
  81. package/dist/transcripts-source-api.js +1 -1
  82. package/node_modules/@types/node/README.md +2 -2
  83. package/node_modules/@types/node/child_process.d.ts +1 -1
  84. package/node_modules/@types/node/crypto.d.ts +20 -8
  85. package/node_modules/@types/node/ffi.d.ts +14 -0
  86. package/node_modules/@types/node/http2.d.ts +3 -2
  87. package/node_modules/@types/node/net.d.ts +16 -4
  88. package/node_modules/@types/node/package.json +2 -17
  89. package/node_modules/@types/node/process.d.ts +1 -0
  90. package/node_modules/@types/node/quic.d.ts +39 -1
  91. package/node_modules/@types/node/stream/iter.d.ts +9 -12
  92. package/node_modules/@types/node/test/reporters.d.ts +1 -0
  93. package/node_modules/@types/node/test.d.ts +72 -0
  94. package/node_modules/@types/node/tls.d.ts +14 -10
  95. package/node_modules/@types/node/vm.d.ts +2 -1
  96. package/node_modules/@types/node/worker_threads.d.ts +4 -1
  97. package/node_modules/typebox/build/compile/code.mjs +1 -2
  98. package/node_modules/typebox/build/compile/validator.mjs +5 -1
  99. package/node_modules/typebox/build/format/iri.mjs +16 -9
  100. package/node_modules/typebox/build/guard/emit.mjs +2 -2
  101. package/node_modules/typebox/build/guard/guard.d.mts +7 -5
  102. package/node_modules/typebox/build/guard/guard.mjs +14 -9
  103. package/node_modules/typebox/build/guard/index.mjs +6 -0
  104. package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
  105. package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
  106. package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
  107. package/node_modules/typebox/build/schema/build.mjs +2 -3
  108. package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
  109. package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
  110. package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
  111. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
  112. package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
  113. package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
  114. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
  115. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
  116. package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
  117. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
  118. package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
  119. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
  120. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
  121. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
  122. package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
  123. package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
  124. package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
  125. package/node_modules/typebox/build/schema/parse.mjs +3 -0
  126. package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
  127. package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
  128. package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
  129. package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
  130. package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
  131. package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
  132. package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
  133. package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
  134. package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
  135. package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
  136. package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
  137. package/node_modules/typebox/package.json +1 -1
  138. package/node_modules/typebox/readme.md +3 -1
  139. package/openclaw.plugin.json +21 -1
  140. package/package.json +5 -5
  141. package/dist/.setup/agent-components.runtime-CEPrf2SY.mjs +0 -4
  142. package/dist/.setup/probe.runtime-DBQ_AGPe.mjs +0 -2
  143. package/dist/.setup/provider-session.runtime-DrGAYnZv.mjs +0 -6
  144. package/dist/.setup/provider.runtime-BmjW_pIw.mjs +0 -2
  145. package/dist/.setup/security-audit.runtime-DHtYenx9.mjs +0 -2
  146. package/dist/.setup/setup-plugin-api-Dvr41dyx.mjs +0 -3
  147. package/dist/.setup/system-events-B2YEEMbS.mjs +0 -34
  148. package/dist/.setup/targets-CvemhN3i.mjs +0 -3
  149. package/dist/.setup/thread-bindings.session-updates-DCQq1WZ5.mjs +0 -55
  150. /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
@@ -1,18 +1,17 @@
1
- import { E as getDiscordEndpointRuntime, O as resolveDiscordEndpointMediaGuard } from "./channel-type-DKnjV1XW.mjs";
1
+ import { D as getDiscordEndpointRuntime, k as resolveDiscordEndpointMediaGuard } from "./channel-type-DRCrEMss.mjs";
2
2
  import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
3
- import { a as resolveDiscordChannelParentSafe, n as resolveDiscordChannelInfoSafe, r as resolveDiscordChannelNameSafe, t as resolveDiscordChannelIdSafe } from "./channel-access-C12aDZ0p.mjs";
4
- import { A as resolveDiscordReferencedReplyMessageId, D as hasDiscordMessageStickers, E as resolveDiscordCdnPolicy, M as resolveDiscordMessageChannelId, x as resolveDiscordMessageText } from "./transcripts-source-DVegW0WI.mjs";
5
- import { v as createDiscordLivePolicyReader, y as mapGatewayDispatchData } from "./provider-iOf73HW-.mjs";
3
+ import { A as resolveDiscordMessageChannelId, O as resolveDiscordReferencedReplyMessageId, T as hasDiscordMessageStickers, w as resolveDiscordCdnPolicy, y as resolveDiscordMessageText } from "./transcripts-source-p8EV179h.mjs";
4
+ import { D as createDiscordLivePolicyReader, O as mapGatewayDispatchData } from "./provider-B_G5hASF.mjs";
6
5
  import { logDebug } from "openclaw/plugin-sdk/logging-core";
7
6
  import { GatewayDispatchEvents } from "discord-api-types/v10";
8
7
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
9
8
  import { normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
10
9
  import { createRuntimeConfigReader } from "openclaw/plugin-sdk/runtime-config-snapshot";
11
10
  import { danger } from "openclaw/plugin-sdk/runtime-env";
12
- import { resolveBatchedReplyThreadingPolicy } from "openclaw/plugin-sdk/reply-reference";
13
11
  import { DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, createChannelIngressError, createChannelIngressMonitor, createChannelRunQueue } from "openclaw/plugin-sdk/channel-outbound";
14
12
  import { saveRemoteMedia } from "openclaw/plugin-sdk/media-runtime";
15
13
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
14
+ import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
16
15
  import { createChannelInboundDebouncer, resolveInboundDebounceMs, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
17
16
  import { fanInChannelIngressLifecycles } from "openclaw/plugin-sdk/channel-ingress-runtime";
18
17
  //#region extensions/discord/src/monitor/ingress.ts
@@ -117,62 +116,6 @@ function createDiscordIngressMonitor(params) {
117
116
  };
118
117
  }
119
118
  //#endregion
120
- //#region extensions/discord/src/monitor/inbound-job.ts
121
- function buildDiscordInboundJob(ctx, options) {
122
- const { runtime, buildContext, abortSignal, isPolicyCurrent, guildHistories, client, turnAdoptionLifecycle, threadBindings, discordRestFetch, message, data, threadChannel, ...payload } = ctx;
123
- const sanitizedMessage = sanitizeDiscordInboundMessage(message);
124
- return {
125
- payload: {
126
- ...payload,
127
- message: sanitizedMessage,
128
- data: {
129
- ...data,
130
- message: sanitizedMessage
131
- },
132
- threadChannel: normalizeDiscordThreadChannel(threadChannel)
133
- },
134
- runtime: {
135
- runtime,
136
- buildContext,
137
- abortSignal,
138
- isPolicyCurrent,
139
- guildHistories,
140
- client,
141
- turnAdoptionLifecycle,
142
- threadBindings,
143
- discordRestFetch
144
- },
145
- ingressSettlement: options?.ingressSettlement
146
- };
147
- }
148
- function materializeDiscordInboundJob(job, abortSignal) {
149
- return {
150
- ...job.payload,
151
- ...job.runtime,
152
- abortSignal: abortSignal ?? job.runtime.abortSignal
153
- };
154
- }
155
- function sanitizeDiscordInboundMessage(message) {
156
- const descriptors = Object.getOwnPropertyDescriptors(message);
157
- delete descriptors.channel;
158
- return Object.create(Object.getPrototypeOf(message), descriptors);
159
- }
160
- function normalizeDiscordThreadChannel(threadChannel) {
161
- if (!threadChannel) return null;
162
- const channelInfo = resolveDiscordChannelInfoSafe(threadChannel);
163
- const parent = resolveDiscordChannelParentSafe(threadChannel);
164
- return {
165
- id: threadChannel.id,
166
- name: channelInfo.name,
167
- parentId: channelInfo.parentId,
168
- parent: parent ? {
169
- id: resolveDiscordChannelIdSafe(parent),
170
- name: resolveDiscordChannelNameSafe(parent)
171
- } : void 0,
172
- ownerId: channelInfo.ownerId
173
- };
174
- }
175
- //#endregion
176
119
  //#region extensions/discord/src/monitor/message-avatar.ts
177
120
  const DISCORD_AVATAR_MAX_BYTES = 262144;
178
121
  const DISCORD_AVATAR_CACHE_MAX_ENTRIES = 128;
@@ -180,11 +123,7 @@ const DISCORD_GUILD_ICON_TTL_MS = 3e5;
180
123
  function setBoundedEntry(map, key, value) {
181
124
  map.delete(key);
182
125
  map.set(key, value);
183
- while (map.size > DISCORD_AVATAR_CACHE_MAX_ENTRIES) {
184
- const oldest = map.keys().next().value;
185
- if (oldest === void 0) break;
186
- map.delete(oldest);
187
- }
126
+ pruneMapToMaxSize(map, DISCORD_AVATAR_CACHE_MAX_ENTRIES);
188
127
  }
189
128
  function discordAvatarUrl(owner, id, hash) {
190
129
  return `https://cdn.discordapp.com/${owner}/${id}/${hash}.png?size=128`;
@@ -253,19 +192,15 @@ function createDiscordAvatarResolver() {
253
192
  } };
254
193
  }
255
194
  //#endregion
256
- //#region extensions/discord/src/monitor/message-handler.batch-gate.ts
257
- function applyImplicitReplyBatchGate(ctx, replyToMode, isBatched) {
258
- const replyThreading = resolveBatchedReplyThreadingPolicy(replyToMode, isBatched);
259
- if (!replyThreading) return;
260
- ctx.ReplyThreading = replyThreading;
261
- }
262
- //#endregion
263
195
  //#region extensions/discord/src/monitor/message-run-queue.ts
264
- const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-CCmIVnxy.mjs"));
196
+ const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-BNFFuChn.mjs"));
265
197
  async function processDiscordQueuedMessage(params) {
266
- const abortSignal = params.job.runtime.abortSignal && params.lifecycleSignal ? AbortSignal.any([params.job.runtime.abortSignal, params.lifecycleSignal]) : params.job.runtime.abortSignal ?? params.lifecycleSignal;
198
+ const abortSignal = params.job.context.abortSignal && params.lifecycleSignal ? AbortSignal.any([params.job.context.abortSignal, params.lifecycleSignal]) : params.job.context.abortSignal ?? params.lifecycleSignal;
267
199
  try {
268
- await (params.testing?.processDiscordMessage ?? (await loadMessageProcessRuntime()).processDiscordMessage)(materializeDiscordInboundJob(params.job, abortSignal));
200
+ await (params.testing?.processDiscordMessage ?? (await loadMessageProcessRuntime()).processDiscordMessage)({
201
+ ...params.job.context,
202
+ abortSignal
203
+ });
269
204
  if (abortSignal?.aborted) await params.job.ingressSettlement?.cancel();
270
205
  else await params.job.ingressSettlement?.settle();
271
206
  } catch (error) {
@@ -274,9 +209,6 @@ async function processDiscordQueuedMessage(params) {
274
209
  throw error;
275
210
  }
276
211
  }
277
- async function cleanupSkippedDiscordQueuedMessage(params) {
278
- await params.job.ingressSettlement?.cancel();
279
- }
280
212
  function createDiscordMessageRunQueue(params) {
281
213
  const skippedCleanup = /* @__PURE__ */ new Set();
282
214
  const runQueue = createChannelRunQueue({
@@ -312,7 +244,7 @@ function createDiscordMessageRunQueue(params) {
312
244
  };
313
245
  const cleanupSkipped = async () => {
314
246
  try {
315
- await cleanupSkippedDiscordQueuedMessage({ job });
247
+ await job.ingressSettlement?.cancel();
316
248
  } catch (error) {
317
249
  try {
318
250
  params.runtime.error(danger(`discord queued message cleanup failed: ${String(error)}`));
@@ -326,7 +258,7 @@ function createDiscordMessageRunQueue(params) {
326
258
  return;
327
259
  }
328
260
  skippedCleanup.add(cleanupSkipped);
329
- runQueue.enqueue(job.payload.message.id, async ({ lifecycleSignal }) => {
261
+ runQueue.enqueue(job.context.message.id, async ({ lifecycleSignal }) => {
330
262
  skippedCleanup.delete(cleanupSkipped);
331
263
  try {
332
264
  await processDiscordQueuedMessage({
@@ -348,10 +280,7 @@ function createDiscordMessageRunQueue(params) {
348
280
  }
349
281
  //#endregion
350
282
  //#region extensions/discord/src/monitor/message-dispatcher.ts
351
- const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-DE_POxFc.mjs"));
352
- function isNonEmptyString(value) {
353
- return typeof value === "string" && value.length > 0;
354
- }
283
+ const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-v-__NSDq.mjs"));
355
284
  function createDiscordMessageDispatcher(params) {
356
285
  const readPolicy = params.readPolicy ?? createDiscordLivePolicyReader({
357
286
  ...params,
@@ -450,15 +379,10 @@ function createDiscordMessageDispatcher(params) {
450
379
  await ingress.settle();
451
380
  return;
452
381
  }
453
- applyImplicitReplyBatchGate(ctx, params.replyToMode, entries.length > 1);
454
- const ids = entries.map((entry) => entry.data.message?.id).filter(isNonEmptyString);
455
- if (entries.length > 1 && ids.length > 0) {
456
- const ctxBatch = ctx;
457
- ctxBatch.MessageSids = ids;
458
- ctxBatch.MessageSidFirst = ids[0];
459
- ctxBatch.MessageSidLast = ids[ids.length - 1];
460
- }
461
- messageRunQueue.enqueue(buildDiscordInboundJob(ctx, { ingressSettlement: ingress }));
382
+ messageRunQueue.enqueue({
383
+ context: ctx,
384
+ ingressSettlement: ingress
385
+ });
462
386
  } catch (error) {
463
387
  if (abortSignal?.aborted) {
464
388
  await ingress.cancel();
@@ -1,5 +1,5 @@
1
- import { t as isDiscordThreadChannelType } from "./channel-type-DKnjV1XW.mjs";
2
- import { O as resolveDiscordMessageStickers } from "./transcripts-source-DVegW0WI.mjs";
1
+ import { t as isDiscordThreadChannelType } from "./channel-type-DRCrEMss.mjs";
2
+ import { E as resolveDiscordMessageStickers } from "./transcripts-source-p8EV179h.mjs";
3
3
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
5
5
  import { findCodeRegions, isInsideCode } from "openclaw/plugin-sdk/text-chunking";
@@ -75,17 +75,15 @@ function matchesActiveDiscordMentionPatterns(text, mentionRegexes) {
75
75
  return false;
76
76
  }
77
77
  function resolvePreflightMentionRequirement(params) {
78
- if (!params.shouldRequireMention) return false;
79
- return !params.bypassMentionRequirement;
78
+ return params.shouldRequireMention && !params.bypassMentionRequirement;
80
79
  }
81
80
  function shouldIgnoreBoundThreadWebhookMessage(params) {
82
81
  const webhookId = normalizeOptionalString(params.webhookId) ?? "";
83
82
  if (!webhookId) return false;
84
83
  const boundWebhookId = normalizeOptionalString(params.threadBinding?.webhookId) ?? normalizeOptionalString(params.threadBinding?.metadata?.webhookId) ?? "";
85
84
  if (boundWebhookId && webhookId === boundWebhookId) return true;
86
- if (!(normalizeOptionalString(params.threadId) ?? "")) return false;
87
- if (params.threadBinding) return true;
88
- return false;
85
+ const threadId = normalizeOptionalString(params.threadId) ?? "";
86
+ return Boolean(threadId && params.threadBinding);
89
87
  }
90
88
  //#endregion
91
89
  //#region extensions/discord/src/monitor/message-handler.history.ts
@@ -118,10 +116,10 @@ function resolveDiscordHistoryMediaIds(message) {
118
116
  }
119
117
  //#endregion
120
118
  //#region extensions/discord/src/monitor/message-handler.preflight-runtime.ts
121
- const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-CdAt1G0P.mjs").then((n) => n.n));
119
+ const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-a6_NLfH9.mjs").then((n) => n.n));
122
120
  const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-DHGIHEpv.mjs"));
123
- const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-B2YEEMbS.mjs"));
124
- const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./transcripts-source-DVegW0WI.mjs").then((n) => n.p));
121
+ const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-CdeZnvPV.mjs"));
122
+ const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./transcripts-source-p8EV179h.mjs").then((n) => n.d));
125
123
  //#endregion
126
124
  //#region extensions/discord/src/monitor/message-handler.preflight-pluralkit.ts
127
125
  async function resolveDiscordPreflightPluralKitInfo(params) {