@openclaw/discord 2026.5.31-beta.2 → 2026.5.31-beta.3

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 (62) hide show
  1. package/dist/action-runtime-api.js +1 -1
  2. package/dist/{allow-list-BnkWtVpA.js → allow-list-C-MqM-B_.js} +1 -1
  3. package/dist/api.js +12 -12
  4. package/dist/{approval-handler.runtime-DSFfzXpo.js → approval-handler.runtime-DQiJ1Z0k.js} +3 -3
  5. package/dist/{audit-kgIklCyI.js → audit-eI8e8RpG.js} +3 -3
  6. package/dist/{channel-D0gX0yj6.js → channel-CEcqsGv4.js} +18 -18
  7. package/dist/{channel-actions-DDoc4V7x.js → channel-actions-BaPDAWN_.js} +2 -2
  8. package/dist/{channel-actions.runtime-CqZfnMaA.js → channel-actions.runtime-BEMDJjP1.js} +5 -5
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/{channel.setup-BNZm3eed.js → channel.setup-DbGXTREm.js} +2 -2
  11. package/dist/{components-DcLQ2JkV.js → components-CCbYVuVr.js} +66 -27
  12. package/dist/contract-api.js +2 -2
  13. package/dist/{conversation-identity-BURFgcfI.js → conversation-identity-CEP1KbK0.js} +2 -2
  14. package/dist/{directory-config-B9Jw1Q2R.js → directory-config-j1bfTue_.js} +1 -1
  15. package/dist/directory-contract-api.js +1 -1
  16. package/dist/{directory-live-CDWUg-nA.js → directory-live-BjBs64RV.js} +2 -2
  17. package/dist/{handle-action.guild-admin-Dpa-kUzu.js → handle-action.guild-admin-CqUsOA2L.js} +3 -3
  18. package/dist/index.js +1 -1
  19. package/dist/{manager.runtime-BWBENHRA.js → manager.runtime-GXQRqG8a.js} +7 -7
  20. package/dist/{message-handler-HO8BbZmQ.js → message-handler-CNU-L8ef.js} +6 -6
  21. package/dist/{message-handler.preflight-DxHBPQvD.js → message-handler.preflight-DaQIDMY6.js} +12 -12
  22. package/dist/{message-handler.process-Cq3j7A9k.js → message-handler.process-B61wYezH.js} +18 -17
  23. package/dist/{message-utils-D_3KTxh_.js → message-utils-C3eyx-ih.js} +1 -1
  24. package/dist/{outbound-adapter-BkPkILpq.js → outbound-adapter-C6Da39L-.js} +6 -6
  25. package/dist/{pluralkit-Ds9aZAM4.js → pluralkit-BEEldePl.js} +1 -1
  26. package/dist/{provider-BK8hjk_y.js → provider-CHlc1TDX.js} +32 -28
  27. package/dist/{provider-session.runtime-CYMFlLg9.js → provider-session.runtime-BO12DuAF.js} +3 -3
  28. package/dist/provider.runtime-BTiF5ENi.js +2 -0
  29. package/dist/{resolve-allowlist-common-BIf3417N.js → resolve-allowlist-common-B3p7cT8F.js} +1 -1
  30. package/dist/{resolve-channels-DK-3f_aA.js → resolve-channels-DLNfxFQP.js} +3 -3
  31. package/dist/{resolve-users-DUDPsfWt.js → resolve-users-QTyD8qgI.js} +2 -2
  32. package/dist/{runtime-Blf_d9E7.js → runtime-Dds0Ww1n.js} +8 -8
  33. package/dist/runtime-api.actions.js +2 -2
  34. package/dist/runtime-api.js +19 -19
  35. package/dist/runtime-api.lookup.js +4 -4
  36. package/dist/runtime-api.monitor-BfCA2SYy.js +6 -0
  37. package/dist/runtime-api.monitor.js +5 -5
  38. package/dist/runtime-api.send.js +5 -5
  39. package/dist/runtime-api.threads.js +3 -3
  40. package/dist/{send-BHkA8a-k.js → send-CyyRF1yd.js} +3 -3
  41. package/dist/{send.components-CUHzDapa.js → send.components-a9JQeeH5.js} +4 -4
  42. package/dist/{send.outbound-DSKZbjML.js → send.outbound-DhMLobqR.js} +3 -3
  43. package/dist/{send.receipt-CjsWpitW.js → send.receipt-Z8V6yMOY.js} +38 -11
  44. package/dist/{send.shared-Cluujl6W.js → send.shared-B3QxPnR3.js} +5 -5
  45. package/dist/{sender-identity-BFp5w0F8.js → sender-identity-CEsfDF0L.js} +1 -1
  46. package/dist/setup-plugin-api.js +1 -1
  47. package/dist/{subagent-hooks-7jAn9HT5.js → subagent-hooks-65qGV_Ft.js} +2 -2
  48. package/dist/subagent-hooks-api.js +1 -1
  49. package/dist/{system-events-BjuNA9Zs.js → system-events-NnSID6Q5.js} +2 -2
  50. package/dist/{target-resolver-BYuWNVQp.js → target-resolver-BKGK0ftO.js} +2 -2
  51. package/dist/targets-Cv797U29.js +3 -0
  52. package/dist/{thread-bindings-CKruJE91.js → thread-bindings-BesPuVYd.js} +4 -4
  53. package/dist/{thread-bindings.discord-api-BjLUwwSP.js → thread-bindings.discord-api-D8MZQPER.js} +4 -4
  54. package/dist/{thread-bindings.manager-Dji7SZHG.js → thread-bindings.manager-DbgHc5KB.js} +19 -19
  55. package/dist/{transcripts-source-O73_YIDs.js → transcripts-source-Cegx0wdw.js} +1 -1
  56. package/dist/transcripts-source-api.js +1 -1
  57. package/dist/{typing-CKW0i8du.js → typing-C7RXECnL.js} +1 -1
  58. package/npm-shrinkwrap.json +3 -3
  59. package/package.json +4 -4
  60. package/dist/provider.runtime-RfQSSM_v.js +0 -2
  61. package/dist/runtime-api.monitor-LVbgPRHA.js +0 -6
  62. package/dist/targets-BNDUOdvI.js +0 -3
@@ -395,10 +395,10 @@ const optionComparisonOmittedFields = new Set([
395
395
  "name_localized"
396
396
  ]);
397
397
  const nullableLocalizationFields = new Set(["description_localizations", "name_localizations"]);
398
- function stableComparableObject(value, path = []) {
398
+ function stableComparableObject(value, pathValue = []) {
399
399
  if (Array.isArray(value)) {
400
- const normalized = value.map((entry) => stableComparableObject(entry, path));
401
- const key = path.at(-1);
400
+ const normalized = value.map((entry) => stableComparableObject(entry, pathValue));
401
+ const key = pathValue.at(-1);
402
402
  if (key && unorderedCommandArrayFields.has(key) && normalized.every((entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean")) return normalized.toSorted((left, right) => String(left).localeCompare(String(right)));
403
403
  return normalized;
404
404
  }
@@ -406,13 +406,13 @@ function stableComparableObject(value, path = []) {
406
406
  return Object.fromEntries(Object.entries(value).filter(([key, entry]) => {
407
407
  if (entry === void 0) return false;
408
408
  if (entry === null && nullableLocalizationFields.has(key)) return false;
409
- if (path.includes("options") && optionComparisonOmittedFields.has(key)) return false;
409
+ if (pathValue.includes("options") && optionComparisonOmittedFields.has(key)) return false;
410
410
  if ((key === "required" || key === "autocomplete") && entry === false) return false;
411
411
  return true;
412
- }).toSorted(([a], [b]) => a.localeCompare(b)).map(([key, entry]) => [key, shouldNormalizeDescriptionValue(path, key, entry) ? normalizeDescriptionForComparison(entry) : stableComparableObject(entry, [...path, key])]));
412
+ }).toSorted(([a], [b]) => a.localeCompare(b)).map(([key, entry]) => [key, shouldNormalizeDescriptionValue(pathValue, key, entry) ? normalizeDescriptionForComparison(entry) : stableComparableObject(entry, [...pathValue, key])]));
413
413
  }
414
- function shouldNormalizeDescriptionValue(path, key, entry) {
415
- return typeof entry === "string" && (key === "description" || path.at(-1) === "description_localizations");
414
+ function shouldNormalizeDescriptionValue(pathLocal, key, entry) {
415
+ return typeof entry === "string" && (key === "description" || pathLocal.at(-1) === "description_localizations");
416
416
  }
417
417
  /**
418
418
  * Normalize a Discord command description for equality comparison.
@@ -1096,10 +1096,16 @@ function channelFactory(clientForTest, channelData, _partial) {
1096
1096
  //#endregion
1097
1097
  //#region extensions/discord/src/internal/entity-cache.ts
1098
1098
  const DEFAULT_REST_CACHE_TTL_MS = 3e4;
1099
+ const DEFAULT_MAX_ENTRIES = 5e3;
1100
+ const DEFAULT_SWEEP_INTERVAL_MS = 3e4;
1099
1101
  var DiscordEntityCache = class {
1100
1102
  constructor(params) {
1101
1103
  this.params = params;
1102
1104
  this.entries = /* @__PURE__ */ new Map();
1105
+ this.lastSweepAt = 0;
1106
+ }
1107
+ get size() {
1108
+ return this.entries.size;
1103
1109
  }
1104
1110
  async fetchUser(id) {
1105
1111
  return await this.fetchCached(`user:${id}`, async () => {
@@ -1157,13 +1163,34 @@ var DiscordEntityCache = class {
1157
1163
  const value = await fetcher();
1158
1164
  if (ttl > 0) {
1159
1165
  const expiresAt = resolveExpiresAtMsFromDurationMs(ttl, { nowMs: rawNow });
1160
- if (expiresAt !== void 0) this.entries.set(key, {
1161
- expiresAt,
1162
- value
1163
- });
1166
+ if (expiresAt !== void 0) {
1167
+ if (now !== void 0) this.maybeSweepExpired(now);
1168
+ this.entries.set(key, {
1169
+ expiresAt,
1170
+ value
1171
+ });
1172
+ this.enforceMaxEntries();
1173
+ }
1164
1174
  }
1165
1175
  return value;
1166
1176
  }
1177
+ maybeSweepExpired(now) {
1178
+ const interval = this.params.sweepIntervalMs ?? DEFAULT_SWEEP_INTERVAL_MS;
1179
+ if (now - this.lastSweepAt < interval) return;
1180
+ this.lastSweepAt = now;
1181
+ for (const [key, entry] of this.entries) if (entry.expiresAt <= now) this.entries.delete(key);
1182
+ }
1183
+ enforceMaxEntries() {
1184
+ const max = this.params.maxEntries ?? DEFAULT_MAX_ENTRIES;
1185
+ if (this.entries.size <= max) return;
1186
+ const toRemove = this.entries.size - max;
1187
+ let removed = 0;
1188
+ for (const key of this.entries.keys()) {
1189
+ if (removed >= toRemove) break;
1190
+ this.entries.delete(key);
1191
+ removed += 1;
1192
+ }
1193
+ }
1167
1194
  get rest() {
1168
1195
  return typeof this.params.rest === "function" ? this.params.rest() : this.params.rest;
1169
1196
  }
@@ -1,6 +1,6 @@
1
- import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-CjsWpitW.js";
1
+ import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { a as mergeDiscordAccountConfig, p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
3
- import { t as parseAndResolveDiscordTarget } from "./target-resolver-BYuWNVQp.js";
3
+ import { t as parseAndResolveDiscordTarget } from "./target-resolver-BKGK0ftO.js";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
6
6
  import { ChannelType, MessageFlags, PermissionFlagsBits } from "discord-api-types/v10";
@@ -255,12 +255,12 @@ async function fetchBotUserId(rest) {
255
255
  return me.id;
256
256
  }
257
257
  function resolveMemberGuildPermissionBits(params) {
258
- const rolesById = new Map((params.guild.roles ?? []).map((role) => [role.id, role]));
259
- const everyoneRole = rolesById.get(params.guild.id);
258
+ const rolesByIdLocal = new Map((params.guild.roles ?? []).map((role) => [role.id, role]));
259
+ const everyoneRole = rolesByIdLocal.get(params.guild.id);
260
260
  let permissions = 0n;
261
261
  if (everyoneRole?.permissions) permissions = addPermissionBits(permissions, everyoneRole.permissions);
262
262
  for (const roleId of params.member.roles ?? []) {
263
- const role = rolesById.get(roleId);
263
+ const role = rolesByIdLocal.get(roleId);
264
264
  if (role?.permissions) permissions = addPermissionBits(permissions, role.permissions);
265
265
  }
266
266
  return permissions;
@@ -1,4 +1,4 @@
1
- import { b as formatDiscordUserTag } from "./allow-list-BnkWtVpA.js";
1
+ import { b as formatDiscordUserTag } from "./allow-list-C-MqM-B_.js";
2
2
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  //#region extensions/discord/src/monitor/sender-identity.ts
4
4
  function resolveDiscordWebhookId(message) {
@@ -1,2 +1,2 @@
1
- import { t as discordSetupPlugin } from "./channel.setup-BNZm3eed.js";
1
+ import { t as discordSetupPlugin } from "./channel.setup-DbGXTREm.js";
2
2
  export { discordSetupPlugin };
@@ -1,6 +1,6 @@
1
- import { Wt as __exportAll } from "./send.receipt-CjsWpitW.js";
1
+ import { Wt as __exportAll } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
3
- import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-CKruJE91.js";
3
+ import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-BesPuVYd.js";
4
4
  import { normalizeOptionalLowercaseString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { formatThreadBindingDisabledError, formatThreadBindingSpawnDisabledError, resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
6
6
  //#region extensions/discord/src/subagent-hooks.ts
@@ -1,7 +1,7 @@
1
1
  //#region extensions/discord/subagent-hooks-api.ts
2
2
  let discordSubagentHooksPromise = null;
3
3
  function loadDiscordSubagentHooksModule() {
4
- discordSubagentHooksPromise ??= import("./subagent-hooks-7jAn9HT5.js").then((n) => n.i);
4
+ discordSubagentHooksPromise ??= import("./subagent-hooks-65qGV_Ft.js").then((n) => n.i);
5
5
  return discordSubagentHooksPromise;
6
6
  }
7
7
  function registerDiscordSubagentHooks(api) {
@@ -1,5 +1,5 @@
1
- import { c as discord_exports } from "./send.receipt-CjsWpitW.js";
2
- import { b as formatDiscordUserTag } from "./allow-list-BnkWtVpA.js";
1
+ import { c as discord_exports } from "./send.receipt-Z8V6yMOY.js";
2
+ import { b as formatDiscordUserTag } from "./allow-list-C-MqM-B_.js";
3
3
  //#region extensions/discord/src/monitor/system-events.ts
4
4
  function resolveDiscordSystemEvent(message, location) {
5
5
  switch (message.type) {
@@ -1,6 +1,6 @@
1
- import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-CjsWpitW.js";
1
+ import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { c as resolveDiscordAccountAllowFrom, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
3
- import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-CDWUg-nA.js";
3
+ import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-BjBs64RV.js";
4
4
  import { buildMessagingTarget } from "openclaw/plugin-sdk/channel-targets";
5
5
  //#region extensions/discord/src/send-target-parsing.ts
6
6
  const parseDiscordSendTarget = (raw, options = {}) => parseDiscordTarget(raw, options);
@@ -0,0 +1,3 @@
1
+ import "./send.receipt-Z8V6yMOY.js";
2
+ import "./target-resolver-BKGK0ftO.js";
3
+ export {};
@@ -1,9 +1,9 @@
1
- import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-CjsWpitW.js";
2
- import "./targets-BNDUOdvI.js";
1
+ import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-Z8V6yMOY.js";
2
+ import "./targets-Cv797U29.js";
3
3
  import { C as resolveThreadBindingMaxAgeMs$1, O as shouldPersistBindingMutations, S as resolveThreadBindingMaxAgeExpiresAt, T as saveBindingsToDisk, b as resolveThreadBindingIdleTimeoutMs$1, c as getThreadBindingToken, f as normalizeThreadId, g as removeBindingRecord, l as isRecentlyUnboundThreadWebhookMessage, n as MANAGERS_BY_ACCOUNT_ID, p as rememberRecentUnboundWebhookEcho, t as BINDINGS_BY_THREAD_ID, x as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-DYp4FVEB.js";
4
4
  import { n as setThreadBindingMaxAgeBySessionKey, r as resolveBindingIdsForTargetSession, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DoDFvU_h.js";
5
- import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, s as resolveChannelIdForBinding, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-BjLUwwSP.js";
6
- import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-Dji7SZHG.js";
5
+ import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, s as resolveChannelIdForBinding, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-D8MZQPER.js";
6
+ import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-DbgHc5KB.js";
7
7
  import { normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
9
9
  import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
@@ -1,7 +1,7 @@
1
- import { Ut as resolveDiscordChannelId, pt as getChannel, tt as createChannelWebhook } from "./send.receipt-CjsWpitW.js";
2
- import { I as createDiscordRestClient } from "./send.shared-Cluujl6W.js";
3
- import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-BHkA8a-k.js";
4
- import { t as sendMessageDiscord } from "./send.outbound-DSKZbjML.js";
1
+ import { Ut as resolveDiscordChannelId, pt as getChannel, tt as createChannelWebhook } from "./send.receipt-Z8V6yMOY.js";
2
+ import { I as createDiscordRestClient } from "./send.shared-B3QxPnR3.js";
3
+ import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-CyyRF1yd.js";
4
+ import { t as sendMessageDiscord } from "./send.outbound-DhMLobqR.js";
5
5
  import { i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, k as toReusableWebhookKey, m as rememberReusableWebhook, t as BINDINGS_BY_THREAD_ID } from "./thread-bindings.state-DYp4FVEB.js";
6
6
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { ChannelType } from "discord-api-types/v10";
@@ -1,7 +1,7 @@
1
- import { Ut as resolveDiscordChannelId, Wt as __exportAll, pt as getChannel } from "./send.receipt-CjsWpitW.js";
2
- import { I as createDiscordRestClient } from "./send.shared-Cluujl6W.js";
1
+ import { Ut as resolveDiscordChannelId, Wt as __exportAll, pt as getChannel } from "./send.receipt-Z8V6yMOY.js";
2
+ import { I as createDiscordRestClient } from "./send.shared-B3QxPnR3.js";
3
3
  import { A as DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS, C as resolveThreadBindingMaxAgeMs$1, D as shouldDefaultPersist, E as setBindingRecord, M as THREAD_BINDINGS_SWEEP_INTERVAL_MS, S as resolveThreadBindingMaxAgeExpiresAt, T as saveBindingsToDisk, _ as resetThreadBindingsForTests, a as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, b as resolveThreadBindingIdleTimeoutMs$1, c as getThreadBindingToken, d as normalizeThreadBindingDurationMs, f as normalizeThreadId, g as removeBindingRecord, h as rememberThreadBindingToken, n as MANAGERS_BY_ACCOUNT_ID, o as ensureBindingsLoaded, p as rememberRecentUnboundWebhookEcho, r as PERSIST_BY_ACCOUNT_ID, s as forgetThreadBindingToken, t as BINDINGS_BY_THREAD_ID, u as normalizeTargetKind, v as resolveBindingIdsForSession, w as resolveThreadBindingsPath, x as resolveThreadBindingInactivityExpiresAt, y as resolveBindingRecordKey } from "./thread-bindings.state-DYp4FVEB.js";
4
- import { a as isThreadArchived, b as resolveThreadBindingThreadName, c as summarizeDiscordError, i as isDiscordThreadGoneError, n as createWebhookForChannel, o as maybeSendBindingMessage, r as findReusableWebhook, s as resolveChannelIdForBinding, t as createThreadForBinding, v as resolveThreadBindingFarewellText } from "./thread-bindings.discord-api-BjLUwwSP.js";
4
+ import { a as isThreadArchived, b as resolveThreadBindingThreadName, c as summarizeDiscordError, i as isDiscordThreadGoneError, n as createWebhookForChannel, o as maybeSendBindingMessage, r as findReusableWebhook, s as resolveChannelIdForBinding, t as createThreadForBinding, v as resolveThreadBindingFarewellText } from "./thread-bindings.discord-api-D8MZQPER.js";
5
5
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { normalizeAccountId, resolveAgentIdFromSessionKey } from "openclaw/plugin-sdk/routing";
7
7
  import { getRuntimeConfigSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
@@ -327,13 +327,13 @@ function createThreadBindingManager(params) {
327
327
  threadId: touchParams.threadId
328
328
  });
329
329
  if (!key) return null;
330
- const existing = BINDINGS_BY_THREAD_ID.get(key);
331
- if (!existing || existing.accountId !== accountId) return null;
330
+ const existingResult = BINDINGS_BY_THREAD_ID.get(key);
331
+ if (!existingResult || existingResult.accountId !== accountId) return null;
332
332
  const now = Date.now();
333
333
  const at = typeof touchParams.at === "number" && Number.isFinite(touchParams.at) ? Math.max(0, Math.floor(touchParams.at)) : now;
334
334
  const nextRecord = {
335
- ...existing,
336
- lastActivityAt: Math.max(existing.lastActivityAt || 0, at)
335
+ ...existingResult,
336
+ lastActivityAt: Math.max(existingResult.lastActivityAt || 0, at)
337
337
  };
338
338
  setBindingRecord(nextRecord);
339
339
  if (touchParams.persist ?? persist) saveBindingsToDisk({ minIntervalMs: THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS });
@@ -368,12 +368,12 @@ function createThreadBindingManager(params) {
368
368
  channelId: bindParams.channelId
369
369
  }) ?? "";
370
370
  if (!channelId) return null;
371
- const existing = manager.getByThreadId(threadId);
371
+ const existingValue = manager.getByThreadId(threadId);
372
372
  const targetSessionKey = normalizeOptionalString(bindParams.targetSessionKey) ?? "";
373
373
  if (!targetSessionKey) return null;
374
374
  const targetKind = normalizeTargetKind(bindParams.targetKind, targetSessionKey);
375
- let webhookId = normalizeOptionalString(bindParams.webhookId) ?? normalizeOptionalString(existing?.webhookId) ?? "";
376
- let webhookToken = normalizeOptionalString(bindParams.webhookToken) ?? normalizeOptionalString(existing?.webhookToken) ?? "";
375
+ let webhookId = normalizeOptionalString(bindParams.webhookId) ?? normalizeOptionalString(existingValue?.webhookId) ?? "";
376
+ let webhookToken = normalizeOptionalString(bindParams.webhookToken) ?? normalizeOptionalString(existingValue?.webhookToken) ?? "";
377
377
  if (!directConversationBinding && (!webhookId || !webhookToken)) {
378
378
  const cachedWebhook = findReusableWebhook({
379
379
  accountId,
@@ -399,19 +399,19 @@ function createThreadBindingManager(params) {
399
399
  threadId,
400
400
  targetKind,
401
401
  targetSessionKey,
402
- agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(existing?.agentId) ?? resolveAgentIdFromSessionKey(targetSessionKey),
403
- label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(existing?.label),
402
+ agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(existingValue?.agentId) ?? resolveAgentIdFromSessionKey(targetSessionKey),
403
+ label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(existingValue?.label),
404
404
  webhookId: webhookId || void 0,
405
405
  webhookToken: webhookToken || void 0,
406
- boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(existing?.boundBy) ?? "system",
406
+ boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(existingValue?.boundBy) ?? "system",
407
407
  boundAt: now,
408
408
  lastActivityAt: now,
409
- idleTimeoutMs: typeof existing?.idleTimeoutMs === "number" ? existing.idleTimeoutMs : idleTimeoutMs,
410
- maxAgeMs: typeof existing?.maxAgeMs === "number" ? existing.maxAgeMs : maxAgeMs,
409
+ idleTimeoutMs: typeof existingValue?.idleTimeoutMs === "number" ? existingValue.idleTimeoutMs : idleTimeoutMs,
410
+ maxAgeMs: typeof existingValue?.maxAgeMs === "number" ? existingValue.maxAgeMs : maxAgeMs,
411
411
  metadata: bindParams.metadata && typeof bindParams.metadata === "object" ? {
412
- ...existing?.metadata,
412
+ ...existingValue?.metadata,
413
413
  ...bindParams.metadata
414
- } : existing?.metadata ? { ...existing.metadata } : void 0
414
+ } : existingValue?.metadata ? { ...existingValue.metadata } : void 0
415
415
  };
416
416
  setBindingRecord(record);
417
417
  if (persist) saveBindingsToDisk();
@@ -429,8 +429,8 @@ function createThreadBindingManager(params) {
429
429
  threadId: unbindParams.threadId
430
430
  });
431
431
  if (!bindingKey) return null;
432
- const existing = BINDINGS_BY_THREAD_ID.get(bindingKey);
433
- if (!existing || existing.accountId !== accountId) return null;
432
+ const existingLocal = BINDINGS_BY_THREAD_ID.get(bindingKey);
433
+ if (!existingLocal || existingLocal.accountId !== accountId) return null;
434
434
  const removed = removeBindingRecord(bindingKey);
435
435
  if (!removed) return null;
436
436
  rememberRecentUnboundWebhookEcho(removed);
@@ -1,4 +1,4 @@
1
- import { Wt as __exportAll } from "./send.receipt-CjsWpitW.js";
1
+ import { Wt as __exportAll } from "./send.receipt-Z8V6yMOY.js";
2
2
  //#region extensions/discord/src/voice/transcripts-source.ts
3
3
  var transcripts_source_exports = /* @__PURE__ */ __exportAll({
4
4
  discordVoiceTranscriptsSourceProvider: () => discordVoiceTranscriptsSourceProvider,
@@ -1,2 +1,2 @@
1
- import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-O73_YIDs.js";
1
+ import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-Cegx0wdw.js";
2
2
  export { discordVoiceTranscriptsSourceProvider };
@@ -1,4 +1,4 @@
1
- import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-CjsWpitW.js";
1
+ import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-Z8V6yMOY.js";
2
2
  import { o as raceWithTimeout } from "./timeouts-CEJ3--Uw.js";
3
3
  //#region extensions/discord/src/monitor/typing.ts
4
4
  var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/discord",
3
- "version": "2026.5.31-beta.2",
3
+ "version": "2026.5.31-beta.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/discord",
9
- "version": "2026.5.31-beta.2",
9
+ "version": "2026.5.31-beta.3",
10
10
  "dependencies": {
11
11
  "@discordjs/voice": "0.19.2",
12
12
  "discord-api-types": "0.38.48",
@@ -16,7 +16,7 @@
16
16
  "ws": "8.21.0"
17
17
  },
18
18
  "peerDependencies": {
19
- "openclaw": ">=2026.5.31-beta.2"
19
+ "openclaw": ">=2026.5.31-beta.3"
20
20
  },
21
21
  "peerDependenciesMeta": {
22
22
  "openclaw": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/discord",
3
- "version": "2026.5.31-beta.2",
3
+ "version": "2026.5.31-beta.3",
4
4
  "description": "OpenClaw Discord channel plugin for channels, DMs, commands, and app events.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "ws": "8.21.0"
17
17
  },
18
18
  "peerDependencies": {
19
- "openclaw": ">=2026.5.31-beta.2"
19
+ "openclaw": ">=2026.5.31-beta.3"
20
20
  },
21
21
  "peerDependenciesMeta": {
22
22
  "openclaw": {
@@ -63,10 +63,10 @@
63
63
  "allowInvalidConfigRecovery": true
64
64
  },
65
65
  "compat": {
66
- "pluginApi": ">=2026.5.31-beta.2"
66
+ "pluginApi": ">=2026.5.31-beta.3"
67
67
  },
68
68
  "build": {
69
- "openclawVersion": "2026.5.31-beta.2"
69
+ "openclawVersion": "2026.5.31-beta.3"
70
70
  },
71
71
  "release": {
72
72
  "publishToClawHub": true,
@@ -1,2 +0,0 @@
1
- import { t as monitorDiscordProvider } from "./provider-BK8hjk_y.js";
2
- export { monitorDiscordProvider };
@@ -1,6 +0,0 @@
1
- import "./allow-list-BnkWtVpA.js";
2
- import "./timeouts-CEJ3--Uw.js";
3
- import "./provider-BK8hjk_y.js";
4
- import "./message-utils-D_3KTxh_.js";
5
- import "./message-handler-HO8BbZmQ.js";
6
- export {};
@@ -1,3 +0,0 @@
1
- import "./send.receipt-CjsWpitW.js";
2
- import "./target-resolver-BYuWNVQp.js";
3
- export {};