@openclaw/discord 2026.9.1-beta.1 → 2026.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/account-inspect-BY-ve3yH.js +45 -0
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{accounts-CfQ-vSyf.js → accounts-CwJQoLjM.js} +89 -45
  4. package/dist/action-runtime-api.js +1 -1
  5. package/dist/{activities-api-q-9PaaHH.js → activities-api-E-segZn6.js} +30 -17
  6. package/dist/activities-api.js +1 -1
  7. package/dist/{allow-list-BDMimASD.js → allow-list-C2JuH-R0.js} +10 -6
  8. package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
  9. package/dist/api.js +18 -18
  10. package/dist/{approval-handler.runtime-B7qhK3fR.js → approval-handler.runtime-CW5k3mSa.js} +19 -12
  11. package/dist/{audit-CBEv_ERu.js → audit-B9rydv5a.js} +8 -7
  12. package/dist/{channel-Dx1tMTfx.js → channel-D93LnbTE.js} +29 -23
  13. package/dist/{channel-actions.runtime-CLWWu9nC.js → channel-actions.runtime-DMFv4doE.js} +16 -13
  14. package/dist/channel-config-api.js +1 -1
  15. package/dist/channel-plugin-api.js +1 -1
  16. package/dist/{channel.setup-DOzXS2Pk.js → channel.setup-DTL7kPOM.js} +18 -18
  17. package/dist/{components-B9V5o361.js → components-DmXYIQ26.js} +111 -149
  18. package/dist/{config-schema-BR13IAx6.js → config-schema-B797-Spt.js} +19 -12
  19. package/dist/{conversation-binding-route-DJYrY2TQ.js → conversation-binding-route-24afmvEC.js} +1 -1
  20. package/dist/{directory-config-BK6eqekJ.js → directory-config-BD4YL7wT.js} +2 -2
  21. package/dist/directory-contract-api.js +1 -1
  22. package/dist/{directory-live-DSAJSrJk.js → directory-live-BrFVc1Ds.js} +4 -4
  23. package/dist/{doctor-Cm7Y1pJ2.js → doctor-BUB41_lr.js} +5 -5
  24. package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
  25. package/dist/doctor-contract-api.js +3 -2
  26. package/dist/{handle-action.guild-admin-BdwCRHmm.js → handle-action.guild-admin-B0egstYq.js} +2 -2
  27. package/dist/index.js +1 -1
  28. package/dist/ingress-identity-BCzfPPYM.js +60 -0
  29. package/dist/{message-handler-BXpWZyni.js → message-handler-Qdw9c0j4.js} +14 -10
  30. package/dist/{message-handler.preflight-Ba5LAY_X.js → message-handler.preflight-Dxi2yBfR.js} +41 -101
  31. package/dist/{message-handler.process-3HEzmemS.js → message-handler.process-BYDjtxZJ.js} +83 -109
  32. package/dist/{message-text-aiwO5R2F.js → message-text-BRVqYm-t.js} +11 -6
  33. package/dist/{outbound-adapter-BE4jSq2d.js → outbound-adapter-DEhthWTk.js} +52 -67
  34. package/dist/{outbound-components-oLpg8Qzb.js → outbound-components-DehyxvA4.js} +5 -4
  35. package/dist/{outbound-session-route-Cg15ZFJd.js → outbound-session-route-BFGRF9fE.js} +55 -12
  36. package/dist/{owner-access-UlYi9t0M.js → owner-access-yc1sX7Gx.js} +7 -6
  37. package/dist/{pluralkit-Tiyl70dx.js → pluralkit-XmmAHoV6.js} +2 -2
  38. package/dist/{probe-n6ZXxK8V.js → probe-3ovFAp3b.js} +3 -3
  39. package/dist/{probe.runtime-CN4bdPfZ.js → probe.runtime-BckHn3cJ.js} +1 -1
  40. package/dist/{provider-B11xwilq.js → provider-DuDtKbF8.js} +294 -131
  41. package/dist/{provider-session.runtime-B9xe-Qaf.js → provider-session.runtime-BA2BPyZ4.js} +3 -3
  42. package/dist/provider.runtime-Db8YwZBv.js +2 -0
  43. package/dist/{realtime-session.runtime-CU8IQUS-.js → realtime-session.runtime-DgSbX6ay.js} +103 -163
  44. package/dist/{resolve-allowlist-common-BLoYaxEG.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
  45. package/dist/{resolve-channels-C2sT_n67.js → resolve-channels-CYseD5Uw.js} +4 -4
  46. package/dist/{resolve-users-CzpjLwjy.js → resolve-users-DrmhDrqm.js} +5 -4
  47. package/dist/{retry-Cv4jCU5Z.js → retry-BNCxiyyR.js} +120 -32
  48. package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
  49. package/dist/{runtime-BHrTlFkf.js → runtime-BbWNtfyq.js} +127 -93
  50. package/dist/{runtime-CY4PRMF-.js → runtime-DB7Fb6AU.js} +2 -2
  51. package/dist/runtime-api.js +19 -19
  52. package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
  53. package/dist/secret-contract-api.js +1 -1
  54. package/dist/{security-audit-BfJhAXZp.js → security-audit-DKfK-iPY.js} +10 -11
  55. package/dist/security-audit-contract-api.js +1 -1
  56. package/dist/{security-audit.runtime-BVKF9VtY.js → security-audit.runtime-sKZyKgpx.js} +1 -1
  57. package/dist/{send-C49MFF9j.js → send-BnTEIeLE.js} +132 -100
  58. package/dist/{send.components-DKKAw5VX.js → send.components-BWVEcjRP.js} +21 -15
  59. package/dist/{send.outbound-zam0TrZx.js → send.outbound-b5xwHTlL.js} +35 -22
  60. package/dist/{send.shared-JjljcV4O.js → send.shared-5vxBTagO.js} +25 -18
  61. package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
  62. package/dist/setup-plugin-api.js +1 -1
  63. package/dist/{shared-_5EcP4jW.js → shared-BSJWHEMA.js} +20 -14
  64. package/dist/{subagent-hooks-DQzvOptn.js → subagent-hooks-IzQKX4RQ.js} +2 -2
  65. package/dist/subagent-hooks-api.js +1 -1
  66. package/dist/{system-events-C7yxaHWP.js → system-events-BOiDS8b3.js} +2 -2
  67. package/dist/{target-resolver-vxIh6O3-.js → target-resolver-BVI8xSSC.js} +6 -5
  68. package/dist/targets-DbxVbq8k.js +3 -0
  69. package/dist/{thread-bindings-DW5F9vat.js → thread-bindings-D7mcaXQC.js} +6 -5
  70. package/dist/{thread-bindings.manager-ByOtwjo_.js → thread-bindings.manager-B1oySiVc.js} +37 -28
  71. package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
  72. package/dist/{threading-agH1T_6s.js → threading-OQnL-0Zx.js} +8 -6
  73. package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
  74. package/dist/{transcripts-source-BR11iHA4.js → transcripts-source-D8lH7AkN.js} +9 -4
  75. package/dist/transcripts-source-api.js +1 -1
  76. package/dist/{typing-Dc_YMY2e.js → typing-C9q0AQMb.js} +2 -2
  77. package/dist/{voice-runtime-DIeaa8fJ.js → voice-runtime-Dfhjh1tV.js} +433 -93
  78. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
  79. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
  80. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
  81. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
  82. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
  83. package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
  84. package/node_modules/typebox/build/format/email.mjs +1 -1
  85. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
  86. package/node_modules/typebox/package.json +1 -1
  87. package/openclaw.plugin.json +14 -6
  88. package/package.json +6 -5
  89. package/skills/discord/SKILL.md +1 -1
  90. package/dist/account-inspect-BDfKyuvL.js +0 -89
  91. package/dist/provider.runtime-DiYaHvOz.js +0 -2
  92. package/dist/sdk-runtime-4geQHtXc.js +0 -338
  93. package/dist/targets-CtTKvntJ.js +0 -3
@@ -1,18 +1,18 @@
1
- import { At as getChannel, on as __exportAll, v as resolveDiscordChannelId, vt as createChannelWebhook } from "./retry-Cv4jCU5Z.js";
2
- import { P as createDiscordRestClient } from "./send.shared-JjljcV4O.js";
3
- import { t as sendMessageDiscord } from "./send.outbound-zam0TrZx.js";
1
+ import { jt as getChannel, sn as __exportAll, t as canFallbackDiscordWebhookSend, y as resolveDiscordChannelId, yt as createChannelWebhook } from "./retry-BNCxiyyR.js";
2
+ import { P as createDiscordRestClient } from "./send.shared-5vxBTagO.js";
3
+ import { t as sendMessageDiscord } from "./send.outbound-b5xwHTlL.js";
4
4
  import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
5
- import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-C49MFF9j.js";
5
+ import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-BnTEIeLE.js";
6
6
  import { A as toReusableWebhookKey, C as resolveThreadBindingMaxAgeExpiresAt, D as shouldDefaultPersist, E as setBindingRecord, S as resolveThreadBindingInactivityExpiresAt, T as saveBindingsToDisk, _ as rememberThreadBindingToken, b as resolveBindingRecordKey, c as ensureBindingsLoaded, f as normalizeTargetKind, g as rememberReusableWebhook, h as refreshUnboundThreadWebhookIdentity, i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, l as forgetThreadBindingToken, m as normalizeThreadId, n as MANAGERS_BY_ACCOUNT_ID, p as normalizeThreadBindingDurationMs, r as PERSIST_BY_ACCOUNT_ID, s as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, t as BINDINGS_BY_THREAD_ID, u as getThreadBindingToken, v as removeBindingRecord, w as resolveThreadBindingMaxAgeMs$1, x as resolveThreadBindingIdleTimeoutMs$1, y as resolveBindingIdsForSession } from "./thread-bindings.state-D8OMdk4O.js";
7
7
  import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
8
8
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
9
9
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
10
10
  import { getRuntimeConfigSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
11
- import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
11
+ import { createSubsystemLogger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
12
12
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
13
13
  import { SYSTEM_MARK } from "openclaw/plugin-sdk/text-chunking";
14
14
  import { formatThreadBindingDurationLabel, registerSessionBindingAdapter, resolveThreadBindingConversationIdFromBindingId, resolveThreadBindingFarewellText, resolveThreadBindingIntroText, resolveThreadBindingThreadName, unregisterSessionBindingAdapter } from "openclaw/plugin-sdk/conversation-runtime";
15
- import { resolveSessionAgentId } from "openclaw/plugin-sdk/agent-scope-runtime";
15
+ import { resolveSessionAgentIdStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
16
16
  //#region extensions/discord/src/monitor/thread-bindings.persona.ts
17
17
  const THREAD_BINDING_PERSONA_MAX_CHARS = 80;
18
18
  function normalizePersonaLabel(value) {
@@ -20,7 +20,8 @@ function normalizePersonaLabel(value) {
20
20
  return value.replace(/\s+/g, " ").trim() || void 0;
21
21
  }
22
22
  function resolveThreadBindingPersona(params) {
23
- return truncateUtf16Safe(`${SYSTEM_MARK} ${normalizePersonaLabel(params.label) || normalizePersonaLabel(params.agentId) || "agent"}`, THREAD_BINDING_PERSONA_MAX_CHARS);
23
+ const base = normalizePersonaLabel(params.label) || normalizePersonaLabel(params.agentId) || "agent";
24
+ return truncateUtf16Safe(`${SYSTEM_MARK} ${base}`, THREAD_BINDING_PERSONA_MAX_CHARS);
24
25
  }
25
26
  function resolveThreadBindingPersonaFromRecord(record) {
26
27
  return resolveThreadBindingPersona({
@@ -92,9 +93,10 @@ function resolveDiscordChannelInfoSafe(channel) {
92
93
  //#endregion
93
94
  //#region extensions/discord/src/monitor/thread-bindings.types.ts
94
95
  const THREAD_BINDINGS_SWEEP_INTERVAL_MS = 12e4;
95
- const DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS = 1440 * 60 * 1e3;
96
+ const DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS = 864e5;
96
97
  //#endregion
97
98
  //#region extensions/discord/src/monitor/thread-bindings.discord-api.ts
99
+ const log = createSubsystemLogger("discord/thread-bindings");
98
100
  function buildThreadTarget(threadId) {
99
101
  return /^(channel:|user:)/i.test(threadId) ? threadId : `channel:${threadId}`;
100
102
  }
@@ -154,7 +156,12 @@ async function maybeSendBindingMessage(params) {
154
156
  });
155
157
  return;
156
158
  } catch (err) {
157
- logVerbose(`discord thread binding webhook send failed: ${summarizeDiscordError(err)}`);
159
+ const fallbackToBot = canFallbackDiscordWebhookSend(err);
160
+ log.warn("discord thread binding webhook send failed", {
161
+ error: summarizeDiscordError(err),
162
+ fallbackToBot
163
+ });
164
+ if (!fallbackToBot) return;
158
165
  }
159
166
  try {
160
167
  await sendMessageDiscord(buildThreadTarget(record.threadId), text, {
@@ -232,11 +239,12 @@ async function resolveChannelIdForBinding(params) {
232
239
  }
233
240
  async function createThreadForBinding(params) {
234
241
  try {
235
- return (normalizeOptionalString((await createThreadDiscord(params.channelId, { name: params.threadName }, {
242
+ const created = await createThreadDiscord(params.channelId, { name: params.threadName }, {
236
243
  cfg: params.cfg,
237
244
  accountId: params.accountId,
238
245
  token: params.token
239
- }))?.id) ?? "") || null;
246
+ });
247
+ return (normalizeOptionalString(created?.id) ?? "") || null;
240
248
  } catch (err) {
241
249
  logVerbose(`discord thread binding auto-thread create failed for ${params.channelId}: ${summarizeDiscordError(err)}`);
242
250
  return null;
@@ -400,12 +408,6 @@ var thread_bindings_manager_exports = /* @__PURE__ */ __exportAll({
400
408
  createThreadBindingManager: () => createThreadBindingManager,
401
409
  getThreadBindingManager: () => getThreadBindingManager
402
410
  });
403
- function registerManager(manager) {
404
- MANAGERS_BY_ACCOUNT_ID.set(manager.accountId, manager);
405
- }
406
- function unregisterManager(accountId, manager) {
407
- if (MANAGERS_BY_ACCOUNT_ID.get(accountId) === manager) MANAGERS_BY_ACCOUNT_ID.delete(accountId);
408
- }
409
411
  function createNoopManager(accountIdRaw) {
410
412
  return {
411
413
  accountId: normalizeAccountId(accountIdRaw),
@@ -447,13 +449,14 @@ function createThreadBindingManager(params) {
447
449
  const maxAgeMs = normalizeThreadBindingDurationMs(params.maxAgeMs, 0);
448
450
  const resolveCurrentCfg = () => getRuntimeConfigSnapshot() ?? params.cfg;
449
451
  const resolveCurrentToken = () => getThreadBindingToken(accountId) ?? params.token;
452
+ const getCurrentBinding = (threadId) => MANAGERS_BY_ACCOUNT_ID.get(accountId) === manager ? manager.getByThreadId(threadId) : void 0;
450
453
  let sweepTimer = null;
451
454
  const runSweepOnce = async () => {
452
455
  const bindings = manager.listBindings();
453
456
  if (bindings.length === 0) return;
454
457
  let rest = null;
455
458
  for (const snapshotBinding of bindings) {
456
- const binding = manager.getByThreadId(snapshotBinding.threadId);
459
+ const binding = getCurrentBinding(snapshotBinding.threadId);
457
460
  if (!binding) continue;
458
461
  const now = Date.now();
459
462
  const inactivityExpiresAt = resolveThreadBindingInactivityExpiresAt({
@@ -496,8 +499,9 @@ function createThreadBindingManager(params) {
496
499
  }
497
500
  if (isDirectConversationBindingId(binding.threadId)) continue;
498
501
  if (!rest) try {
502
+ const cfg = resolveCurrentCfg();
499
503
  rest = createDiscordRestClient({
500
- cfg: resolveCurrentCfg(),
504
+ cfg,
501
505
  accountId,
502
506
  token: resolveCurrentToken()
503
507
  }).rest;
@@ -506,6 +510,7 @@ function createThreadBindingManager(params) {
506
510
  }
507
511
  try {
508
512
  const channel = await getChannel(rest, binding.threadId);
513
+ if (getCurrentBinding(binding.threadId) !== binding) continue;
509
514
  if (!channel || typeof channel !== "object") {
510
515
  logVerbose(`discord thread binding sweep probe returned invalid payload for ${binding.threadId}`);
511
516
  continue;
@@ -516,6 +521,7 @@ function createThreadBindingManager(params) {
516
521
  sendFarewell: true
517
522
  });
518
523
  } catch (err) {
524
+ if (getCurrentBinding(binding.threadId) !== binding) continue;
519
525
  if (isDiscordThreadGoneError(err)) {
520
526
  logVerbose(`discord thread binding sweep removing stale binding ${binding.threadId}: ${summarizeDiscordError(err)}`);
521
527
  manager.unbindThread({
@@ -604,6 +610,7 @@ function createThreadBindingManager(params) {
604
610
  const targetSessionKey = normalizeOptionalString(bindParams.targetSessionKey) ?? "";
605
611
  if (!targetSessionKey) return null;
606
612
  const targetKind = normalizeTargetKind(bindParams.targetKind, targetSessionKey);
613
+ const previous = existingValue?.targetSessionKey === targetSessionKey && existingValue.targetKind === targetKind ? existingValue : void 0;
607
614
  let webhookId = normalizeOptionalString(bindParams.webhookId) ?? normalizeOptionalString(existingValue?.webhookId) ?? "";
608
615
  let webhookToken = normalizeOptionalString(bindParams.webhookToken) ?? normalizeOptionalString(existingValue?.webhookToken) ?? "";
609
616
  if (!directConversationBinding && (!webhookId || !webhookToken)) {
@@ -631,22 +638,22 @@ function createThreadBindingManager(params) {
631
638
  threadId,
632
639
  targetKind,
633
640
  targetSessionKey,
634
- agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(existingValue?.agentId) ?? resolveSessionAgentId({
641
+ agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(previous?.agentId) ?? resolveSessionAgentIdStrict({
635
642
  config: cfg,
636
643
  sessionKey: targetSessionKey
637
644
  }),
638
- label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(existingValue?.label),
645
+ label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(previous?.label),
639
646
  webhookId: webhookId || void 0,
640
647
  webhookToken: webhookToken || void 0,
641
- boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(existingValue?.boundBy) ?? "system",
648
+ boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(previous?.boundBy) ?? "system",
642
649
  boundAt: now,
643
650
  lastActivityAt: now,
644
651
  idleTimeoutMs: typeof existingValue?.idleTimeoutMs === "number" ? existingValue.idleTimeoutMs : idleTimeoutMs,
645
652
  maxAgeMs: typeof existingValue?.maxAgeMs === "number" ? existingValue.maxAgeMs : maxAgeMs,
646
- metadata: bindParams.metadata && typeof bindParams.metadata === "object" ? {
647
- ...existingValue?.metadata,
653
+ metadata: {
654
+ ...previous?.metadata,
648
655
  ...bindParams.metadata
649
- } : existingValue?.metadata ? { ...existingValue.metadata } : void 0
656
+ }
650
657
  };
651
658
  setBindingRecord(record);
652
659
  if (persist) saveBindingsToDisk();
@@ -719,13 +726,15 @@ function createThreadBindingManager(params) {
719
726
  clearInterval(sweepTimer);
720
727
  sweepTimer = null;
721
728
  }
722
- unregisterManager(accountId, manager);
729
+ if (MANAGERS_BY_ACCOUNT_ID.get(accountId) === manager) {
730
+ MANAGERS_BY_ACCOUNT_ID.delete(accountId);
731
+ forgetThreadBindingToken(accountId);
732
+ }
723
733
  unregisterSessionBindingAdapter({
724
734
  channel: "discord",
725
735
  accountId,
726
736
  adapter: sessionBindingAdapter
727
737
  });
728
- forgetThreadBindingToken(accountId);
729
738
  }
730
739
  };
731
740
  if (params.enableSweeper !== false) {
@@ -745,7 +754,7 @@ function createThreadBindingManager(params) {
745
754
  resolveCurrentToken
746
755
  });
747
756
  registerSessionBindingAdapter(sessionBindingAdapter);
748
- registerManager(manager);
757
+ MANAGERS_BY_ACCOUNT_ID.set(accountId, manager);
749
758
  return manager;
750
759
  }
751
760
  function createNoopThreadBindingManager(accountId) {
@@ -9,9 +9,10 @@ function resolveBindingIdsForTargetSession(params) {
9
9
  ensureBindingsLoaded();
10
10
  const targetSessionKey = params.targetSessionKey.trim();
11
11
  if (!targetSessionKey) return [];
12
+ const accountId = params.accountId ? normalizeAccountId(params.accountId) : void 0;
12
13
  return resolveBindingIdsForSession({
13
14
  targetSessionKey,
14
- accountId: params.accountId ? normalizeAccountId(params.accountId) : void 0,
15
+ accountId,
15
16
  targetKind: params.targetKind
16
17
  });
17
18
  }
@@ -1,7 +1,7 @@
1
- import { F as DiscordError, Ot as editChannel, Tt as createThread, jt as getChannelMessage, on as __exportAll, y as discord_exports } from "./retry-Cv4jCU5Z.js";
1
+ import { Et as createThread, I as DiscordError, Mt as getChannelMessage, b as discord_exports, kt as editChannel, sn as __exportAll } from "./retry-BNCxiyyR.js";
2
2
  import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
3
- import { d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-ByOtwjo_.js";
4
- import { a as formatDiscordMediaText, f as resolveDiscordChannelInfo, n as resolveDiscordForwardedMessagesTextFromSnapshots, p as resolveDiscordMessageChannelId, t as resolveDiscordEmbedText } from "./message-text-aiwO5R2F.js";
3
+ import { d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-B1oySiVc.js";
4
+ import { a as formatDiscordMediaText, h as resolveDiscordMessageChannelId, m as resolveDiscordChannelInfo, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText } from "./message-text-BRVqYm-t.js";
5
5
  import { buildAgentSessionKey } from "openclaw/plugin-sdk/routing";
6
6
  import { normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
@@ -100,8 +100,8 @@ function normalizeTitleContextField(raw, maxChars) {
100
100
  }
101
101
  //#endregion
102
102
  //#region extensions/discord/src/monitor/threading.cache.ts
103
- const DISCORD_THREAD_STARTER_CACHE_TTL_MS = 300 * 1e3;
104
- const DISCORD_THREAD_STARTER_NEGATIVE_CACHE_TTL_MS = 30 * 1e3;
103
+ const DISCORD_THREAD_STARTER_CACHE_TTL_MS = 3e5;
104
+ const DISCORD_THREAD_STARTER_NEGATIVE_CACHE_TTL_MS = 3e4;
105
105
  const DISCORD_THREAD_STARTER_CACHE_MAX = 500;
106
106
  const DISCORD_THREAD_STARTER_CACHE = /* @__PURE__ */ new Map();
107
107
  function getCachedThreadStarter(key, now) {
@@ -266,7 +266,9 @@ function resolveDiscordReplyTarget(opts) {
266
266
  return opts.hasReplied ? void 0 : replyToId;
267
267
  }
268
268
  function sanitizeDiscordThreadName(rawName, fallbackId) {
269
- return truncateUtf16Safe(truncateUtf16Safe(rawName.replace(/<@!?\d+>/g, "").replace(/<@&\d+>/g, "").replace(/<#\d+>/g, "").replace(/\s+/g, " ").trim() || `Thread ${fallbackId}`, 80), 100) || `Thread ${fallbackId}`;
269
+ const baseSource = rawName.replace(/<@!?\d+>/g, "").replace(/<@&\d+>/g, "").replace(/<#\d+>/g, "").replace(/\s+/g, " ").trim() || `Thread ${fallbackId}`;
270
+ const base = truncateUtf16Safe(baseSource, 80);
271
+ return truncateUtf16Safe(base, 100) || `Thread ${fallbackId}`;
270
272
  }
271
273
  function resolveDiscordReplyDeliveryPlan(params) {
272
274
  const originalReplyTarget = params.replyTarget;
@@ -1,7 +1,7 @@
1
1
  import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
2
2
  //#region extensions/discord/src/monitor/timeouts.ts
3
3
  const DISCORD_DEFAULT_LISTENER_TIMEOUT_MS = 12e4;
4
- const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS = 30 * 6e4;
4
+ const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS = 18e5;
5
5
  const DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS = 6e4;
6
6
  const DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS = 12e4;
7
7
  /** @deprecated Discord listener timeouts are compatibility-only. */
@@ -1,6 +1,6 @@
1
- import { on as __exportAll } from "./retry-Cv4jCU5Z.js";
2
- import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount } from "./accounts-CfQ-vSyf.js";
3
- import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-UlYi9t0M.js";
1
+ import { sn as __exportAll } from "./retry-BNCxiyyR.js";
2
+ import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount } from "./accounts-CwJQoLjM.js";
3
+ import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-yc1sX7Gx.js";
4
4
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
5
5
  import { summarizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
@@ -205,7 +205,12 @@ const discordVoiceTranscriptsSourceProvider = {
205
205
  channelId
206
206
  }, { transcripts: {
207
207
  sessionId: request.session.sessionId,
208
- onUtterance: request.onUtterance
208
+ onUtterance: request.onUtterance,
209
+ onStop: () => request.onStatus?.({
210
+ sessionId: request.session.sessionId,
211
+ active: false,
212
+ source: request.session.source
213
+ })
209
214
  } });
210
215
  if (!joined.ok) return {
211
216
  ok: false,
@@ -1,4 +1,4 @@
1
- import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-BR11iHA4.js";
1
+ import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-D8lH7AkN.js";
2
2
  //#region extensions/discord/transcripts-source-api.ts
3
3
  function registerDiscordTranscriptSourceProvider(api) {
4
4
  api.registerTranscriptSourceProvider(discordVoiceTranscriptsSourceProvider);
@@ -1,5 +1,5 @@
1
- import { Rt as sendChannelTyping, on as __exportAll } from "./retry-Cv4jCU5Z.js";
2
- import { c as raceWithTimeout } from "./timeouts-B9cy6RvQ.js";
1
+ import { sn as __exportAll, zt as sendChannelTyping } from "./retry-BNCxiyyR.js";
2
+ import { c as raceWithTimeout } from "./timeouts-D86uWLt_.js";
3
3
  //#region extensions/discord/src/monitor/typing.ts
4
4
  var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
5
5
  const DISCORD_TYPING_START_TIMEOUT_MS = 5e3;