@openclaw/discord 2026.11.7 → 2026.11.10-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +37 -0
  2. package/dist/.setup/{account-inspect-DGkdWwix.mjs → account-inspect-CSz5Qodj.mjs} +2 -3
  3. package/dist/.setup/{accounts-C_25wyxC.mjs → accounts-DtjvhJUj.mjs} +4 -8
  4. package/dist/.setup/{active-turn-thread-route-KvRTAVE3.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
  5. package/dist/.setup/{allow-list-C3j0qLDp.mjs → allow-list-CkqpzPvP.mjs} +4 -8
  6. package/dist/.setup/{api-DYRggUgK.mjs → api-C4j_kC-2.mjs} +4 -6
  7. package/dist/.setup/{approval-handler.runtime-BN4W1r0o.mjs → approval-handler.runtime-DXzPFNvC.mjs} +10 -10
  8. package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs} +3 -4
  9. package/dist/.setup/{audit-BL6EoUun.mjs → audit-B9vk3V2z.mjs} +6 -7
  10. package/dist/.setup/{channel-DdI2l55_.mjs → channel-CKffiPiV.mjs} +38 -41
  11. package/dist/.setup/{channel-access-9cyzozUP.mjs → channel-access-DhJhVrdZ.mjs} +1 -2
  12. package/dist/.setup/{channel.setup-kNWMxlgu.mjs → channel.setup-DmGdG9BH.mjs} +7 -10
  13. package/dist/.setup/{command-deploy-store-DFkBTViB.mjs → command-deploy-store-DPWiBMks.mjs} +1 -2
  14. package/dist/.setup/{command-owners-C7rUdqUX.mjs → command-owners-BzlhNBxA.mjs} +1 -2
  15. package/dist/.setup/{components-C1Phe3uw.mjs → components-GePlato3.mjs} +10 -16
  16. package/dist/.setup/{components.base-CiS0h_XP.mjs → components.base-C5sAPHe4.mjs} +1 -2
  17. package/dist/.setup/config-DDwcUaxT.mjs +20 -0
  18. package/dist/.setup/{config-schema-BNKN1cu5.mjs → config-schema-D3M1livr.mjs} +5 -7
  19. package/dist/.setup/{conversation-binding-route-K_jFbvi5.mjs → conversation-binding-route-CAaWWJdQ.mjs} +2 -3
  20. package/dist/.setup/conversation-fork-B6PiUuln.mjs +197 -0
  21. package/dist/.setup/{directory-config-Ble81PWH.mjs → directory-config-BXJuh9-J.mjs} +3 -4
  22. package/dist/.setup/{directory-live-CY2-qrHI.mjs → directory-live-B9UoQG9g.mjs} +9 -64
  23. package/dist/.setup/{discord-BRVFhk09.mjs → discord-cXPUdHQi.mjs} +98 -77
  24. package/dist/.setup/{doctor-RqH-6JB0.mjs → doctor-MTAWTgRa.mjs} +7 -8
  25. package/dist/.setup/{doctor-contract-Bwv8EuQ_.mjs → doctor-contract-Dstl3cMg.mjs} +2 -3
  26. package/dist/.setup/{endpoint-runtime-lf4DeLas.mjs → endpoint-runtime-BM3x-m6O.mjs} +1 -2
  27. package/dist/.setup/{guilds-BSnrns-F.mjs → guilds-DYBhgnfq.mjs} +3 -4
  28. package/dist/.setup/{handle-action-uD87h2FK.mjs → handle-action-El1ok7Ak.mjs} +13 -12
  29. package/dist/.setup/{handle-action.guild-admin-CqBx_3mG.mjs → handle-action.guild-admin-CxYfg02j.mjs} +7 -5
  30. package/dist/.setup/identity-link-B7KOBo_l.mjs +74 -0
  31. package/dist/.setup/{listeners-DnHLrLIN.mjs → listeners-DIyynRvV.mjs} +2 -3
  32. package/dist/.setup/{live-policy-config-y0Qy36X3.mjs → live-policy-config-DjIHWFla.mjs} +3 -5
  33. package/dist/.setup/{message-handler-CWL_u0X8.mjs → message-handler-DP3cAQCZ.mjs} +18 -17
  34. package/dist/.setup/{message-handler.preflight-83tpEdBG.mjs → message-handler.preflight-S5yc9UdR.mjs} +20 -27
  35. package/dist/.setup/{message-handler.preflight-pluralkit-Dhcx7Ifz.mjs → message-handler.preflight-pluralkit-BFntgVKc.mjs} +10 -14
  36. package/dist/.setup/{message-handler.process-BC-wNZwK.mjs → message-handler.process-bXE_4sq5.mjs} +56 -67
  37. package/dist/.setup/oauth-http-DdVyzSbo.mjs +40 -0
  38. package/dist/.setup/{outbound-payload-CK3_bDvK.mjs → outbound-payload-Dh6xCO6z.mjs} +18 -13
  39. package/dist/.setup/{outbound-session-route-Ay_DnOOl.mjs → outbound-session-route-G_fK5RAh.mjs} +22 -34
  40. package/dist/.setup/{output-activity-uBpMSX75.mjs → output-activity-CDgs2s3O.mjs} +1 -2
  41. package/dist/.setup/{pluralkit-B64dfq_j.mjs → pluralkit-DcXbHTpQ.mjs} +2 -3
  42. package/dist/.setup/{preflight-audio-C6QtD6HX.mjs → preflight-audio-r4BbaJxh.mjs} +1 -2
  43. package/dist/.setup/{presence-cache-Dq-3nH7R.mjs → presence-cache-B3xj3b0l.mjs} +1 -2
  44. package/dist/.setup/{probe-CbDJojNV.mjs → probe-CfGMZwFD.mjs} +5 -6
  45. package/dist/.setup/{provider-CRb3Myky.mjs → provider-BA4ysXXm.mjs} +200 -249
  46. package/dist/.setup/{provider-session.runtime-3cZpps3H.mjs → provider-session.runtime-Cr2oPicL.mjs} +3 -3
  47. package/dist/.setup/provider.runtime-D4BlQKDq.mjs +1 -0
  48. package/dist/.setup/{proxy-fetch-BzXwBAXt.mjs → proxy-fetch-B8cK6FLQ.mjs} +1 -2
  49. package/dist/.setup/{realtime-session.runtime-BRYpjS9P.mjs → realtime-session.runtime-DQvAKxj9.mjs} +15 -25
  50. package/dist/.setup/{receive-recovery-C3Ks4wAQ.mjs → receive-recovery-DV_v5ROf.mjs} +3 -6
  51. package/dist/.setup/{resolve-allowlist-common-B-S0wRIw.mjs → resolve-allowlist-common-CYdqBUgV.mjs} +3 -4
  52. package/dist/.setup/{resolve-channels-g16NM6Ho.mjs → resolve-channels-BNnyfCR8.mjs} +6 -7
  53. package/dist/.setup/{resolve-users-DAfOOXdy.mjs → resolve-users-CDMAGrzv.mjs} +5 -6
  54. package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
  55. package/dist/.setup/{runtime--HZ9r3tF.mjs → runtime-CkeNX7ic.mjs} +59 -50
  56. package/dist/.setup/{runtime-BMgTyuwg.mjs → runtime-DSaHEGJd.mjs} +4 -24
  57. package/dist/.setup/{runtime-DgnVQ7zW.mjs → runtime-DcBvHOm1.mjs} +1 -2
  58. package/dist/.setup/{runtime-doctor-migrations-BPV-R4G9.mjs → runtime-doctor-migrations-BpV1jKk0.mjs} +5 -9
  59. package/dist/.setup/{secret-config-contract-B1kE4sDv.mjs → secret-config-contract-CP6teHec.mjs} +1 -2
  60. package/dist/.setup/{security-audit-BFT84Uny.mjs → security-audit-CTwisG7c.mjs} +3 -4
  61. package/dist/.setup/{security-contract-DNyyjTZZ.mjs → security-contract-D-o0iWDk.mjs} +1 -2
  62. package/dist/.setup/{security-doctor-nGgPm65L.mjs → security-doctor-4s7omTZd.mjs} +1 -2
  63. package/dist/.setup/{send-CtvwfZQ2.mjs → send-DKzwsZkm.mjs} +26 -31
  64. package/dist/.setup/{send.components-CtLtE0yD.mjs → send.components-CIZALYDP.mjs} +12 -14
  65. package/dist/.setup/{send.outbound-D58xXPgs.mjs → send.outbound-cQ4Ohmsc.mjs} +11 -16
  66. package/dist/.setup/send.permissions-BvH_Dr8p.mjs +369 -0
  67. package/dist/.setup/{send.receipt-DLOV4qx6.mjs → send.receipt-CZ7ks6g7.mjs} +64 -17
  68. package/dist/.setup/send.shared-D2lh737v.mjs +259 -0
  69. package/dist/.setup/{sender-identity-BbA7FNbr.mjs → sender-identity-Dt5ELjRN.mjs} +2 -3
  70. package/dist/.setup/{session-contract-BO5tlIdl.mjs → session-contract-Bq71MS78.mjs} +1 -2
  71. package/dist/.setup/{session-key-normalization-CCHGNSQw.mjs → session-key-normalization-Cfvze5hd.mjs} +1 -2
  72. package/dist/.setup/setup-plugin-api-BJt8tAAC.mjs +2 -0
  73. package/dist/.setup/{shared-Dv2DamaK.mjs → shared-Bf7ifHlc.mjs} +14 -17
  74. package/dist/.setup/{shared-interactive-DmzaoKOM.mjs → shared-interactive-DKBw4SNV.mjs} +7 -12
  75. package/dist/.setup/{subagent-hooks-yT45eTyz.mjs → subagent-hooks-CVmIOrAR.mjs} +4 -5
  76. package/dist/.setup/{system-events-Dlzp9Jcj.mjs → system-events-DB6p2H4l.mjs} +3 -4
  77. package/dist/.setup/{target-parsing-C-HyNxcE.mjs → target-parsing-BiuhcK9Q.mjs} +1 -2
  78. package/dist/.setup/{target-resolver-BzaZPBm9.mjs → target-resolver-48znkzky.mjs} +6 -7
  79. package/dist/.setup/{thread-binding-api-BDZJD4na.mjs → thread-binding-api-Drd4Zu-5.mjs} +1 -2
  80. package/dist/.setup/{thread-bindings-DRWhgKCc.mjs → thread-bindings-DTHVdmvF.mjs} +7 -10
  81. package/dist/.setup/{thread-bindings.manager-CWJKirn1.mjs → thread-bindings.manager-6EnH3YZh.mjs} +45 -30
  82. package/dist/.setup/{thread-bindings.session-updates-DzJrXc4w.mjs → thread-bindings.session-updates-BPO6pPzd.mjs} +9 -12
  83. package/dist/.setup/{threading-BbsPuT5G.mjs → threading-PC3IIaHd.mjs} +5 -7
  84. package/dist/.setup/{timeouts-cIxzatmv.mjs → timeouts-CT9hnmo4.mjs} +1 -2
  85. package/dist/.setup/{transcripts-source-DIW1fU_P.mjs → transcripts-source-C3F_ErM1.mjs} +20 -33
  86. package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
  87. package/dist/.setup/{voice-runtime-oJ6BZs5D.mjs → voice-runtime-CZGbraKC.mjs} +28 -46
  88. package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
  89. package/dist/account-inspect-api.js +2 -3
  90. package/dist/action-runtime-api.js +1 -1
  91. package/dist/activities-api.js +10 -50
  92. package/dist/api.js +21 -22
  93. package/dist/assets/embedded-app-sdk.mjs +1 -1
  94. package/dist/channel-config-api.js +1 -1
  95. package/dist/channel-plugin-api.js +1 -1
  96. package/dist/contract-api.js +1 -1
  97. package/dist/directory-contract-api.js +2 -3
  98. package/dist/doctor-contract-api.js +7 -8
  99. package/dist/index.js +1 -2
  100. package/dist/runtime-api.js +23 -22
  101. package/dist/runtime-setter-api.js +1 -1
  102. package/dist/secret-contract-api.js +1 -1
  103. package/dist/security-audit-contract-api.js +1 -1
  104. package/dist/security-contract-api.js +1 -1
  105. package/dist/session-key-api.js +1 -1
  106. package/dist/setup-entry.js +2 -3
  107. package/dist/setup-plugin-api.js +1 -1
  108. package/dist/src/voice/audio-worker.runtime.js +14 -26
  109. package/dist/subagent-hooks-api.js +2 -3
  110. package/dist/thread-binding-api.js +1 -1
  111. package/dist/transcripts-source-api.js +2 -3
  112. package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +2 -3
  113. package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +2 -3
  114. package/node_modules/@types/node/README.md +1 -1
  115. package/node_modules/@types/node/package.json +2 -2
  116. package/node_modules/@types/node/zlib.d.ts +752 -0
  117. package/node_modules/typebox/build/format/date_time.d.mts +2 -1
  118. package/node_modules/typebox/build/format/date_time.mjs +12 -3
  119. package/node_modules/typebox/package.json +1 -1
  120. package/openclaw.plugin.json +7 -2
  121. package/package.json +5 -5
  122. package/dist/.setup/provider.runtime-tmkt3QOg.mjs +0 -1
  123. package/dist/.setup/send.shared-B_KKRrD7.mjs +0 -589
  124. package/dist/.setup/setup-plugin-api-ty5RJrMy.mjs +0 -2
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Official OpenClaw channel plugin for Discord servers, channels, DMs, slash commands, and app events.
4
4
 
5
+ Voice input has a packet-inactivity deadline even when a speaker disconnects
6
+ without a speaking-end event. `voice.captureSilenceGraceMs` still controls the
7
+ grace after the SDK detects silence. Active recordings flush
8
+ bounded WAV segments to disk; stream errors discard the incomplete segment and
9
+ release the speaker subscription. Continuous capture remains registered.
10
+
5
11
  Install from OpenClaw:
6
12
 
7
13
  ```bash
@@ -16,3 +22,34 @@ Configurations using pre-July-2026 `voice.tts.<provider>` keys or per-channel
16
22
  preserves these old settings and reports the exact path instead of rewriting
17
23
  them. Supported configurations use `voice.tts.providers`, channel `enabled`,
18
24
  and top-level `bindings`.
25
+
26
+ ## Forking a conversation
27
+
28
+ Run `/fork [title]` inside an existing server text thread or forum post to copy the
29
+ OpenClaw conversation into a new sibling under the same parent channel. The
30
+ source stays bound to its original session. The new thread is bound to the copied
31
+ ordinary session, and receives a short text-only recap with Discord mentions
32
+ neutralized. A Discord jump link points to the sibling; it never grants access.
33
+ Names are limited to Discord's 100-character thread-name limit. Forum siblings
34
+ reuse available source tags, including the forum's required-tag constraint.
35
+
36
+ Private threads stay private. The bot creates a non-invitable sibling, adds only
37
+ the requester, and confirms their access before binding and recap delivery.
38
+ Other source members are not automatically included. Members with Discord's
39
+ Manage Threads permission may still have access under Discord's normal rules.
40
+ There is no public fallback and no invitation link.
41
+
42
+ DMs, unthreaded channels, announcement threads, and media-channel posts are not
43
+ supported. The bot needs View Channel, Read Message History, Send Messages in
44
+ Threads, and the applicable Create Public Threads, Create Private Threads, or
45
+ forum Send Messages permission. Thread bindings must be enabled for the bot
46
+ account; existing account and command authorization still applies. This adds no
47
+ new configuration or migration requirement for existing installations. The
48
+ requester must be able to view the source and parent and read the source message
49
+ history; a visible channel alone does not grant historical context access.
50
+
51
+ If creation has an uncertain outcome, OpenClaw does not retry it automatically.
52
+ Inspect the parent channel before running the command again. When Discord returns
53
+ a sibling identity but membership or binding setup fails, the error includes its
54
+ jump link and no recap is sent. The sibling is preserved rather than silently
55
+ creating another one or deleting native work.
@@ -1,7 +1,7 @@
1
- import { i as listDiscordAccountIds, n as inspectDiscordAccountConfig, v as resolveDiscordAccountAvailability } from "./accounts-C_25wyxC.mjs";
1
+ import { i as listDiscordAccountIds, n as inspectDiscordAccountConfig, v as resolveDiscordAccountAvailability } from "./accounts-DtjvhJUj.mjs";
2
2
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
3
3
  import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
4
- //#region extensions/discord/src/account-inspect.ts
4
+ // extensions/discord/src/account-inspect.ts
5
5
  function inspectDiscordAccountPrimary(params) {
6
6
  return inspectDiscordAccountConfig(params, {
7
7
  includeName: true,
@@ -27,5 +27,4 @@ function inspectDiscordAccount(params) {
27
27
  })
28
28
  };
29
29
  }
30
- //#endregion
31
30
  export { inspectDiscordAccount as t };
@@ -6,7 +6,7 @@ import { resolveConfiguredFromCredentialStatuses } from "openclaw/plugin-sdk/cha
6
6
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, normalizeAccountId as normalizeAccountId$1, resolveAccountEntry } from "openclaw/plugin-sdk/routing";
7
7
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import { getRuntimeConfigSnapshot, getRuntimeConfigSourceSnapshot, selectApplicableRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
9
- //#region extensions/discord/src/account-token-inspect.ts
9
+ // extensions/discord/src/account-token-inspect.ts
10
10
  function inspectDiscordConfiguredToken(value) {
11
11
  const credential = resolveSecretInputString({
12
12
  value,
@@ -59,8 +59,7 @@ function resolveDiscordAccountAvailability(params) {
59
59
  stateReason: duplicateOwner ? `duplicate bot token; using account "${duplicateOwner}"` : void 0
60
60
  };
61
61
  }
62
- //#endregion
63
- //#region extensions/discord/src/runtime-config.ts
62
+ // extensions/discord/src/runtime-config.ts
64
63
  function selectDiscordRuntimeConfig(inputConfig) {
65
64
  return selectApplicableRuntimeConfig({
66
65
  inputConfig,
@@ -94,8 +93,7 @@ function selectDiscordActivitiesRuntimeConfig(inputConfig) {
94
93
  }
95
94
  };
96
95
  }
97
- //#endregion
98
- //#region extensions/discord/src/token.ts
96
+ // extensions/discord/src/token.ts
99
97
  function stripDiscordBotPrefix(token) {
100
98
  return token.replace(/^Bot\s+/i, "");
101
99
  }
@@ -162,8 +160,7 @@ function resolveDiscordToken(cfg, opts = {}) {
162
160
  tokenStatus: "missing"
163
161
  };
164
162
  }
165
- //#endregion
166
- //#region extensions/discord/src/accounts.ts
163
+ // extensions/discord/src/accounts.ts
167
164
  const { listAccountIds: listDiscordAccountIds, resolveDefaultAccountId: resolveDefaultDiscordAccountId, resolveAccountConfig: mergeDiscordAccountConfig } = createAccountListHelpers("discord", {
168
165
  implicitDefaultAccount: {
169
166
  channelKeys: ["token"],
@@ -271,5 +268,4 @@ function listDiscordStartupAccountIds(cfg) {
271
268
  if (!startupAccountIds.includes(defaultAccountId)) return startupAccountIds;
272
269
  return [defaultAccountId, ...startupAccountIds.filter((candidateId) => candidateId !== defaultAccountId)];
273
270
  }
274
- //#endregion
275
271
  export { selectDiscordActivitiesRuntimeConfig as _, listDiscordStartupAccountIds as a, resolveDefaultDiscordAccountId as c, resolveDiscordAccountConfig as d, resolveDiscordAccountDisabledReason as f, resolveDiscordToken as g, normalizeDiscordToken as h, listDiscordAccountIds as i, resolveDiscordAccount as l, resolveDiscordMaxLinesPerMessage as m, inspectDiscordAccountConfig as n, listEnabledDiscordAccounts as o, resolveDiscordAccountDmPolicy as p, isDiscordAccountEnabledForRuntime as r, mergeDiscordAccountConfig as s, createDiscordActionGate as t, resolveDiscordAccountAllowFrom as u, resolveDiscordAccountAvailability as v };
@@ -1,5 +1,5 @@
1
1
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
2
- //#region extensions/discord/src/active-turn-thread-route.ts
2
+ // extensions/discord/src/active-turn-thread-route.ts
3
3
  const activeRoutes = /* @__PURE__ */ new Map();
4
4
  function beginDiscordActiveTurnThreadRoute(sessionKey, route) {
5
5
  const key = normalizeOptionalString(sessionKey);
@@ -35,5 +35,4 @@ function notifyDiscordActiveTurnThreadReplyDelivered(params) {
35
35
  route.onThreadReplyDelivered?.(threadId);
36
36
  return true;
37
37
  }
38
- //#endregion
39
38
  export { notifyDiscordActiveTurnThreadCreated as n, notifyDiscordActiveTurnThreadReplyDelivered as r, beginDiscordActiveTurnThreadRoute as t };
@@ -3,12 +3,11 @@ import { ChannelType } from "discord-api-types/v10";
3
3
  import { asFiniteNumberInRange, parseStrictFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
4
4
  import { buildChannelKeyCandidates, normalizeChannelSlug, resolveChannelEntryMatchWithFallback, resolveChannelMatchConfig } from "openclaw/plugin-sdk/channel-targets";
5
5
  import { resolveAllowlistMatchByCandidates } from "openclaw/plugin-sdk/allow-from";
6
- //#region extensions/discord/src/channel-type.ts
6
+ // extensions/discord/src/channel-type.ts
7
7
  function isDiscordThreadChannelType(channelType) {
8
8
  return channelType === ChannelType.AnnouncementThread || channelType === ChannelType.PublicThread || channelType === ChannelType.PrivateThread;
9
9
  }
10
- //#endregion
11
- //#region extensions/discord/src/retry-after.ts
10
+ // extensions/discord/src/retry-after.ts
12
11
  const RETRY_AFTER_BODY_SECONDS_RE = /^(?:\d+\.?\d*|\.\d+)$/;
13
12
  const MAX_SAFE_RETRY_AFTER_SECONDS = Number.MAX_SAFE_INTEGER / 1e3;
14
13
  function parseDiscordRetryAfterBodySeconds(value) {
@@ -18,8 +17,7 @@ function parseDiscordRetryAfterBodySeconds(value) {
18
17
  max: MAX_SAFE_RETRY_AFTER_SECONDS
19
18
  });
20
19
  }
21
- //#endregion
22
- //#region extensions/discord/src/monitor/format.ts
20
+ // extensions/discord/src/monitor/format.ts
23
21
  function formatDiscordReactionEmoji(emoji) {
24
22
  if (emoji.id && emoji.name) return `<:${emoji.name}:${emoji.id}>`;
25
23
  if (emoji.id) return `emoji:${emoji.id}`;
@@ -30,8 +28,7 @@ function formatDiscordUserTag(user) {
30
28
  if (discriminator && discriminator !== "0") return `${user.username}#${discriminator}`;
31
29
  return user.username ?? user.id;
32
30
  }
33
- //#endregion
34
- //#region extensions/discord/src/monitor/allow-list.ts
31
+ // extensions/discord/src/monitor/allow-list.ts
35
32
  const DISCORD_OWNER_ALLOWLIST_PREFIXES = [
36
33
  "discord:",
37
34
  "user:",
@@ -311,5 +308,4 @@ function shouldEmitDiscordReactionNotification(params) {
311
308
  if (mode === "own") return Boolean(params.botId && params.messageAuthorId === params.botId);
312
309
  return false;
313
310
  }
314
- //#endregion
315
311
  export { parseDiscordRetryAfterBodySeconds as C, formatDiscordUserTag as S, resolveDiscordOwnerAllowFrom as _, normalizeDiscordDisplaySlug as a, shouldEmitDiscordReactionNotification as b, resolveDiscordChannelConfig as c, resolveDiscordCommandAuthorized as d, resolveDiscordGuildEntry as f, resolveDiscordOwnerAccess as g, resolveDiscordMentionPolicy as h, normalizeDiscordAllowList as i, resolveDiscordChannelConfigWithFallback as l, resolveDiscordMemberAllowed as m, hasConfiguredDiscordChannels as n, normalizeDiscordSlug as o, resolveDiscordMemberAccessState as p, isDiscordGroupAllowedByPolicy as r, resolveDiscordAllowListMatch as s, allowListMatches as t, resolveDiscordChannelPolicyCommandAuthorizer as u, resolveDiscordShouldRequireMention as v, isDiscordThreadChannelType as w, formatDiscordReactionEmoji as x, resolveGroupDmAllow as y };
@@ -1,5 +1,5 @@
1
- import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-C3j0qLDp.mjs";
2
- import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-lf4DeLas.mjs";
1
+ import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-CkqpzPvP.mjs";
2
+ import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-BM3x-m6O.mjs";
3
3
  import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
4
4
  import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
5
5
  import { captureChannelReadAuthority, captureEffectAuthority, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
@@ -8,7 +8,7 @@ import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
8
8
  import { parseRetryAfterHeaderSeconds, resolveRetryConfig, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
9
9
  import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
10
10
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
11
- //#region extensions/discord/src/error-body.ts
11
+ // extensions/discord/src/error-body.ts
12
12
  const DISCORD_RESPONSE_BODY_SUMMARY_MAX_CHARS = 240;
13
13
  function parseDiscordHttpErrorBody(raw) {
14
14
  if (!raw) return;
@@ -29,8 +29,7 @@ function isDiscordHtmlResponseBody(body, contentType) {
29
29
  function isDiscordRateLimitResponseBody(body) {
30
30
  return /error 1015|cloudflare|rate limit/i.test(body);
31
31
  }
32
- //#endregion
33
- //#region extensions/discord/src/api.ts
32
+ // extensions/discord/src/api.ts
34
33
  const DISCORD_API_BASE = "https://discord.com/api/v10";
35
34
  const DISCORD_API_RETRY_DEFAULTS = {
36
35
  attempts: 3,
@@ -152,5 +151,4 @@ async function fetchDiscord(path, token, fetcher = fetch, options) {
152
151
  method: "GET"
153
152
  });
154
153
  }
155
- //#endregion
156
154
  export { isDiscordRateLimitResponseBody as a, requestDiscord as i, DiscordApiError as n, parseDiscordHttpErrorBody as o, fetchDiscord as r, summarizeDiscordResponseBody as s, DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS as t };
@@ -1,17 +1,18 @@
1
- import { D as createDiscordMessageNonce, M as createDiscordClient } from "./send.shared-B_KKRrD7.mjs";
2
- import { D as editChannelMessage, E as deleteChannelMessage, J as stripUndefinedFields, f as serializePayload, w as createChannelMessage, y as createUserDmChannel } from "./discord-BRVFhk09.mjs";
3
- import { y as findGraphemeChunkEnd } from "./send.receipt-DLOV4qx6.mjs";
4
- import { r as colorToNumber } from "./components.base-CiS0h_XP.mjs";
5
- import { a as DISCORD_APPROVAL_DECISIONS, o as buildExecApprovalCustomId } from "./shared-interactive-DmzaoKOM.mjs";
6
- import { c as formatDiscordApprovalDisplayValue, k as isDiscordExecApprovalClientEnabled, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-Ay_DnOOl.mjs";
7
- import { r as shouldHandleDiscordApprovalRequest } from "./channel-DdI2l55_.mjs";
8
- import { t as discordApprovalMessageUpdates } from "./approval-message-updates-DKsCfxSW.mjs";
1
+ import { u as createDiscordClient } from "./send.permissions-BvH_Dr8p.mjs";
2
+ import { D as editChannelMessage, E as deleteChannelMessage, J as stripUndefinedFields, f as serializePayload, w as createChannelMessage, y as createUserDmChannel } from "./discord-cXPUdHQi.mjs";
3
+ import { C as findGraphemeChunkEnd } from "./send.receipt-CZ7ks6g7.mjs";
4
+ import { r as colorToNumber } from "./components.base-C5sAPHe4.mjs";
5
+ import { y as createDiscordMessageNonce } from "./send.shared-D2lh737v.mjs";
6
+ import { a as DISCORD_APPROVAL_DECISIONS, o as buildExecApprovalCustomId } from "./shared-interactive-DKBw4SNV.mjs";
7
+ import { c as formatDiscordApprovalDisplayValue, k as isDiscordExecApprovalClientEnabled, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-G_fK5RAh.mjs";
8
+ import { r as shouldHandleDiscordApprovalRequest } from "./channel-CKffiPiV.mjs";
9
+ import { t as discordApprovalMessageUpdates } from "./approval-message-updates-DqOXxPss.mjs";
9
10
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
10
11
  import { ButtonStyle, ComponentType } from "discord-api-types/v10";
11
12
  import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
12
13
  import { formatChannelApprovalResolvedLabel } from "openclaw/plugin-sdk/approval-runtime";
13
14
  import { createChannelApprovalNativeRuntimeAdapterAsync } from "openclaw/plugin-sdk/approval-handler-runtime";
14
- //#region extensions/discord/src/approval-handler.runtime.ts
15
+ // extensions/discord/src/approval-handler.runtime.ts
15
16
  function resolveHandlerContext(params) {
16
17
  const context = params.context;
17
18
  const accountId = normalizeOptionalString(params.accountId) ?? "";
@@ -255,5 +256,4 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapterAs
255
256
  }
256
257
  }
257
258
  });
258
- //#endregion
259
259
  export { discordApprovalNativeRuntime };
@@ -1,7 +1,7 @@
1
- import { i as parseCustomId } from "./components.base-CiS0h_XP.mjs";
2
- import { s as parseExecApprovalData } from "./shared-interactive-DmzaoKOM.mjs";
1
+ import { i as parseCustomId } from "./components.base-C5sAPHe4.mjs";
2
+ import { s as parseExecApprovalData } from "./shared-interactive-DKBw4SNV.mjs";
3
3
  import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
4
- //#region extensions/discord/src/approval-message-updates.ts
4
+ // extensions/discord/src/approval-message-updates.ts
5
5
  const discordApprovalMessageUpdates = new KeyedAsyncQueue();
6
6
  /** Read the current control identity, rather than reconstructing delivery ownership. */
7
7
  function hasDiscordApprovalControl(message, approval) {
@@ -13,5 +13,4 @@ function hasDiscordApprovalControl(message, approval) {
13
13
  }
14
14
  return "components" in message && Array.isArray(message.components) && message.components.some((component) => hasDiscordApprovalControl(component, approval));
15
15
  }
16
- //#endregion
17
16
  export { hasDiscordApprovalControl as n, discordApprovalMessageUpdates as t };
@@ -1,9 +1,9 @@
1
- import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
- import { t as inspectDiscordAccount } from "./account-inspect-DGkdWwix.mjs";
3
- import { b as fetchChannelPermissionsDiscord } from "./send.shared-B_KKRrD7.mjs";
4
- import "./send-CtvwfZQ2.mjs";
5
- import { T as collectDiscordAuditChannelIdsForAccount, w as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-Ay_DnOOl.mjs";
6
- //#region extensions/discord/src/audit.ts
1
+ import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
2
+ import { t as inspectDiscordAccount } from "./account-inspect-CSz5Qodj.mjs";
3
+ import { i as fetchChannelPermissionsDiscord } from "./send.permissions-BvH_Dr8p.mjs";
4
+ import "./send-DKzwsZkm.mjs";
5
+ import { T as collectDiscordAuditChannelIdsForAccount, w as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-G_fK5RAh.mjs";
6
+ // extensions/discord/src/audit.ts
7
7
  var audit_exports = /* @__PURE__ */ __exportAll({
8
8
  auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
9
9
  collectDiscordAuditChannelIds: () => collectDiscordAuditChannelIds
@@ -18,5 +18,4 @@ async function auditDiscordChannelPermissions(params) {
18
18
  fetchChannelPermissions: fetchChannelPermissionsDiscord
19
19
  });
20
20
  }
21
- //#endregion
22
21
  export { audit_exports as n, collectDiscordAuditChannelIds as r, auditDiscordChannelPermissions as t };
@@ -1,17 +1,17 @@
1
- import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
2
- import { q as withDiscordRequestAuthority } from "./discord-BRVFhk09.mjs";
3
- import { c as normalizeDiscordMessagingTarget, o as looksLikeDiscordTargetId, s as matchesDiscordToolContextTarget } from "./send.receipt-DLOV4qx6.mjs";
4
- import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
5
- import { l as withAbortTimeout } from "./timeouts-cIxzatmv.mjs";
6
- import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
7
- import { A as shouldSuppressLocalDiscordExecApprovalPrompt, D as getDiscordExecApprovalApprovers, E as resolveRequiredDiscordChannelPermissions, O as isDiscordExecApprovalApprover, b as discordMessageActions, k as isDiscordExecApprovalClientEnabled, l as resolveDiscordGroupRequireMention, m as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, u as resolveDiscordGroupToolPolicy, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-Ay_DnOOl.mjs";
8
- import { a as resolveDiscordInboundConversation, i as resolveDiscordCommandConversation, n as discordOutbound, r as resolveDiscordAttachedOutboundTarget } from "./outbound-payload-CK3_bDvK.mjs";
9
- import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.mjs";
10
- import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-K_jFbvi5.mjs";
11
- import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupContract, t as createDiscordPluginBase } from "./shared-Dv2DamaK.mjs";
12
- import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-CCHGNSQw.mjs";
13
- import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DzJrXc4w.mjs";
14
- import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.mjs";
1
+ import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-DtjvhJUj.mjs";
2
+ import { q as withDiscordRequestAuthority } from "./discord-cXPUdHQi.mjs";
3
+ import { c as normalizeDiscordMessagingTarget, d as normalizeDiscordSnowflake, o as looksLikeDiscordTargetId, s as matchesDiscordToolContextTarget } from "./send.receipt-CZ7ks6g7.mjs";
4
+ import { t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
5
+ import { l as withAbortTimeout } from "./timeouts-CT9hnmo4.mjs";
6
+ import { t as getDiscordRuntime } from "./runtime-DcBvHOm1.mjs";
7
+ import { A as shouldSuppressLocalDiscordExecApprovalPrompt, D as getDiscordExecApprovalApprovers, E as resolveRequiredDiscordChannelPermissions, O as isDiscordExecApprovalApprover, b as discordMessageActions, k as isDiscordExecApprovalClientEnabled, l as resolveDiscordGroupRequireMention, m as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, u as resolveDiscordGroupToolPolicy, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-G_fK5RAh.mjs";
8
+ import { a as resolveDiscordInboundConversation, i as resolveDiscordCommandConversation, n as discordOutbound, r as resolveDiscordAttachedOutboundTarget } from "./outbound-payload-Dh6xCO6z.mjs";
9
+ import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DPWiBMks.mjs";
10
+ import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-CAaWWJdQ.mjs";
11
+ import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupContract, t as createDiscordPluginBase } from "./shared-Bf7ifHlc.mjs";
12
+ import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-Cfvze5hd.mjs";
13
+ import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-BPO6pPzd.mjs";
14
+ import { t as defaultTopLevelPlacement } from "./thread-binding-api-Drd4Zu-5.mjs";
15
15
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
16
16
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
17
17
  import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
@@ -32,7 +32,7 @@ import { createLazyChannelApprovalNativeRuntimeAdapterAsync } from "openclaw/plu
32
32
  import { createChannelApproverDmTargetResolverAsync, createChannelNativeOriginTargetResolverAsync, doesApprovalRequestSelectChannelAccountAsync, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
33
33
  import { isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
34
34
  import { resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
35
- //#region extensions/discord/src/approval-shared.ts
35
+ // extensions/discord/src/approval-shared.ts
36
36
  function isDiscordApprovalAccountEligible(params) {
37
37
  const account = resolveDiscordAccount(params);
38
38
  const config = params.configOverride ?? account.config.execApprovals;
@@ -57,8 +57,7 @@ async function shouldHandleDiscordApprovalRequest(params) {
57
57
  }) ? [accountId] : []
58
58
  }) && isDiscordApprovalAccountEligible(params);
59
59
  }
60
- //#endregion
61
- //#region extensions/discord/src/approval-native.ts
60
+ // extensions/discord/src/approval-native.ts
62
61
  function extractDiscordSessionKind(sessionKey) {
63
62
  if (!sessionKey) return null;
64
63
  const raw = sessionKey.match(/discord:(?:[^:]+:)?(channel|group|dm|direct):/)?.[1];
@@ -162,30 +161,29 @@ function getDiscordApprovalCapability() {
162
161
  accountId
163
162
  }),
164
163
  shouldHandle: shouldHandleDiscordApprovalRequest,
165
- load: async () => (await import("./approval-handler.runtime-BN4W1r0o.mjs")).discordApprovalNativeRuntime
164
+ load: async () => (await import("./approval-handler.runtime-DXzPFNvC.mjs")).discordApprovalNativeRuntime
166
165
  })
167
166
  });
168
167
  }
169
- //#endregion
170
- //#region extensions/discord/src/channel.loaders.ts
171
- const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-Ble81PWH.mjs").then((n) => n.t));
172
- const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-g16NM6Ho.mjs").then((n) => n.n));
173
- const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DAfOOXdy.mjs").then((n) => n.n));
174
- const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-CWJKirn1.mjs").then((n) => n.r));
175
- const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BzaZPBm9.mjs").then((n) => n.r));
176
- const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-tmkt3QOg.mjs"));
177
- const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-CbDJojNV.mjs").then((n) => n.o));
168
+ // extensions/discord/src/channel.loaders.ts
169
+ const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-BXJuh9-J.mjs").then((n) => n.t));
170
+ const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-BNnyfCR8.mjs").then((n) => n.n));
171
+ const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-CDMAGrzv.mjs").then((n) => n.n));
172
+ const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-6EnH3YZh.mjs").then((n) => n.r));
173
+ const loadDiscordConversationForkModule = createLazyRuntimeModule(() => import("./conversation-fork-B6PiUuln.mjs"));
174
+ const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-48znkzky.mjs").then((n) => n.r));
175
+ const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-D4BlQKDq.mjs"));
176
+ const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-CfGMZwFD.mjs").then((n) => n.o));
178
177
  async function probeDiscordStatusAccount(params) {
179
178
  const startedAtMs = Date.now();
180
179
  const runtime = await loadDiscordProbeRuntime();
181
180
  const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
182
181
  return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
183
182
  }
184
- const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-BL6EoUun.mjs").then((n) => n.n));
185
- const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-CtvwfZQ2.mjs").then((n) => n.t));
186
- const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-CY2-qrHI.mjs").then((n) => n.t));
187
- //#endregion
188
- //#region extensions/discord/src/conversation-route-owner.ts
183
+ const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-B9vk3V2z.mjs").then((n) => n.n));
184
+ const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-DKzwsZkm.mjs").then((n) => n.t));
185
+ const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-B9UoQG9g.mjs").then((n) => n.t));
186
+ // extensions/discord/src/conversation-route-owner.ts
189
187
  async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBindings) {
190
188
  const prepared = inputs.map((params) => {
191
189
  const accountId = normalizeAccountId(params.accountId);
@@ -257,8 +255,7 @@ async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBinding
257
255
  return () => item.resolve(inspect()[position]);
258
256
  });
259
257
  }
260
- //#endregion
261
- //#region extensions/discord/src/status-issues.ts
258
+ // extensions/discord/src/status-issues.ts
262
259
  function isDiscordMessageContentIntentDisabled(value) {
263
260
  return isRecord$1(value) && isRecord$1(value.intents) && value.intents.messageContent === "disabled";
264
261
  }
@@ -316,8 +313,7 @@ function collectDiscordStatusIssues(accounts) {
316
313
  }
317
314
  return issues;
318
315
  }
319
- //#endregion
320
- //#region extensions/discord/src/thread-bindings-channel.ts
316
+ // extensions/discord/src/thread-bindings-channel.ts
321
317
  function toConversationLifecycleBinding(binding) {
322
318
  return {
323
319
  boundAt: binding.boundAt,
@@ -327,6 +323,7 @@ function toConversationLifecycleBinding(binding) {
327
323
  };
328
324
  }
329
325
  const discordConversationBindings = {
326
+ prepareFork: async (params) => (await loadDiscordConversationForkModule()).prepareDiscordConversationFork(params),
330
327
  supportsCurrentConversationBinding: true,
331
328
  bindingStore: "adapter",
332
329
  defaultTopLevelPlacement,
@@ -353,8 +350,7 @@ const discordConversationBindings = {
353
350
  accountId: params.accountId ?? void 0
354
351
  })).map(toConversationLifecycleBinding)
355
352
  };
356
- //#endregion
357
- //#region extensions/discord/src/channel.ts
353
+ // extensions/discord/src/channel.ts
358
354
  const DISCORD_ACCOUNT_STARTUP_STAGGER_MS = 1e4;
359
355
  const discordMessageAdapter = createChannelMessageAdapterFromOutbound({
360
356
  id: "discord",
@@ -408,6 +404,7 @@ const discordPluginBase = createDiscordPluginBase({ setupContract: discordSetupC
408
404
  const discordPlugin = createChatChannelPlugin({
409
405
  base: {
410
406
  ...discordPluginBase,
407
+ identityLink: { prepare: async (cfg, accountId) => (await import("./identity-link-B7KOBo_l.mjs")).discordIdentityLink.prepare(cfg, accountId) },
411
408
  allowlist: {
412
409
  ...buildLegacyDmAccountAllowlistAdapter({
413
410
  channelId: "discord",
@@ -817,10 +814,11 @@ const discordPlugin = createChatChannelPlugin({
817
814
  currentChannelId: nativeChannelId ? normalizeDiscordMessagingTarget(nativeChannelId) : currentMessagingTarget,
818
815
  currentChatType,
819
816
  currentMessagingTarget,
820
- currentMessageId: context.CurrentMessageId,
817
+ currentMessageId: normalizeDiscordSnowflake(context.CurrentMessageId ?? "") ?? void 0,
821
818
  hasRepliedRef
822
819
  };
823
- }
820
+ },
821
+ resolveReplyTransport: ({ replyToId }) => replyToId && !normalizeDiscordSnowflake(replyToId) ? { replyToId: null } : null
824
822
  },
825
823
  outbound: {
826
824
  ...discordOutbound,
@@ -829,5 +827,4 @@ const discordPlugin = createChatChannelPlugin({
829
827
  shouldSuppressLocalPayloadPrompt: shouldSuppressLocalDiscordExecApprovalPrompt
830
828
  }
831
829
  });
832
- //#endregion
833
830
  export { collectDiscordStatusIssues as n, shouldHandleDiscordApprovalRequest as r, discordPlugin as t };
@@ -1,5 +1,5 @@
1
1
  import { asOptionalObjectRecord, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
2
- //#region extensions/discord/src/monitor/channel-access.ts
2
+ // extensions/discord/src/monitor/channel-access.ts
3
3
  function resolveDiscordChannelNameSafe(channel) {
4
4
  return readStringField(asOptionalObjectRecord(channel), "name");
5
5
  }
@@ -20,5 +20,4 @@ function resolveDiscordChannelInfoSafe(channel) {
20
20
  parentName: readStringField(asOptionalObjectRecord(record?.parent), "name")
21
21
  };
22
22
  }
23
- //#endregion
24
23
  export { resolveDiscordChannelNameSafe as n, resolveDiscordChannelTopicSafe as r, resolveDiscordChannelInfoSafe as t };
@@ -1,14 +1,14 @@
1
- import { c as resolveDefaultDiscordAccountId, g as resolveDiscordToken, n as inspectDiscordAccountConfig, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
2
- import { r as discordSetupContract, t as createDiscordPluginBase } from "./shared-Dv2DamaK.mjs";
3
- import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-g16NM6Ho.mjs";
4
- import { t as resolveDiscordUserAllowlist } from "./resolve-users-DAfOOXdy.mjs";
1
+ import { c as resolveDefaultDiscordAccountId, g as resolveDiscordToken, n as inspectDiscordAccountConfig, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-DtjvhJUj.mjs";
2
+ import { r as discordSetupContract, t as createDiscordPluginBase } from "./shared-Bf7ifHlc.mjs";
3
+ import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BNnyfCR8.mjs";
4
+ import { t as resolveDiscordUserAllowlist } from "./resolve-users-CDMAGrzv.mjs";
5
5
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
6
6
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
8
8
  import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createSetupTranslator, createStandardChannelSetupStatus, defineTokenCredential, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptResolvedAllowFrom, resolveEntriesWithOptionalToken, resolveSetupAccountId, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup-runtime";
9
9
  import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
10
10
  import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
11
- //#region extensions/discord/src/setup-account-state.ts
11
+ // extensions/discord/src/setup-account-state.ts
12
12
  function resolveDiscordSetupAccountConfig(params) {
13
13
  const accountId = normalizeAccountId(params.accountId ?? resolveDefaultDiscordAccountId(params.cfg));
14
14
  return {
@@ -19,8 +19,7 @@ function resolveDiscordSetupAccountConfig(params) {
19
19
  function inspectDiscordSetupAccount(params) {
20
20
  return inspectDiscordAccountConfig(params, { resolveFallbackToken: (accountId) => resolveDiscordToken(params.cfg, { accountId }) });
21
21
  }
22
- //#endregion
23
- //#region extensions/discord/src/setup-core.ts
22
+ // extensions/discord/src/setup-core.ts
24
23
  const t = createSetupTranslator();
25
24
  const channel = "discord";
26
25
  const DISCORD_TOKEN_HELP_LINES = [
@@ -228,11 +227,9 @@ const discordSetupWizard = {
228
227
  dmPolicy: discordDmPolicy,
229
228
  disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
230
229
  };
231
- //#endregion
232
- //#region extensions/discord/src/channel.setup.ts
230
+ // extensions/discord/src/channel.setup.ts
233
231
  const discordSetupPlugin = { ...createDiscordPluginBase({
234
232
  setupWizard: discordSetupWizard,
235
233
  setupContract: discordSetupContract
236
234
  }) };
237
- //#endregion
238
235
  export { discordSetupPlugin as t };
@@ -1,4 +1,4 @@
1
- //#region extensions/discord/src/command-deploy-store.ts
1
+ // extensions/discord/src/command-deploy-store.ts
2
2
  const DISCORD_COMMAND_DEPLOY_HASH_NAMESPACE = "command-deploy-hashes";
3
3
  const DISCORD_COMMAND_DEPLOY_HASH_MAX_ENTRIES = 1e4;
4
4
  function openDiscordCommandDeployHashStore(openKeyedStore) {
@@ -8,5 +8,4 @@ function openDiscordCommandDeployHashStore(openKeyedStore) {
8
8
  overflowPolicy: "evict-oldest"
9
9
  });
10
10
  }
11
- //#endregion
12
11
  export { DISCORD_COMMAND_DEPLOY_HASH_NAMESPACE as n, openDiscordCommandDeployHashStore as r, DISCORD_COMMAND_DEPLOY_HASH_MAX_ENTRIES as t };
@@ -1,4 +1,4 @@
1
- //#region extensions/discord/src/command-owners.ts
1
+ // extensions/discord/src/command-owners.ts
2
2
  function resolveDiscordCommandOwnerEntries(cfg) {
3
3
  const entries = (cfg.commands?.ownerAllowFrom ?? []).map((entry) => String(entry).trim()).filter((entry) => entry && (/^(discord|user|pk):/i.test(entry) || !entry.includes(":")));
4
4
  return entries.length > 0 ? entries : void 0;
@@ -6,5 +6,4 @@ function resolveDiscordCommandOwnerEntries(cfg) {
6
6
  function resolveDiscordCommandOwnerAllowFrom(cfg) {
7
7
  return resolveDiscordCommandOwnerEntries(cfg)?.map((entry) => entry.replace(/^discord:/i, "").trim()).filter(Boolean);
8
8
  }
9
- //#endregion
10
9
  export { resolveDiscordCommandOwnerEntries as n, resolveDiscordCommandOwnerAllowFrom as t };
@@ -1,11 +1,11 @@
1
- import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
- import { J as stripUndefinedFields, a as Label, c as TextInput, i as CheckboxGroup, o as Modal, s as RadioGroup, u as asSerializableComponent } from "./discord-BRVFhk09.mjs";
3
- import { i as parseCustomId, r as colorToNumber, t as BaseMessageInteractiveComponent } from "./components.base-CiS0h_XP.mjs";
4
- import { _ as parseDiscordModalCustomId, c as DISCORD_COMPONENT_CUSTOM_ID_KEY, d as buildDiscordComponentCustomId, f as buildDiscordModalCustomId, g as parseDiscordComponentCustomIdForInteraction, h as parseDiscordComponentCustomId, l as DISCORD_MODAL_CUSTOM_ID_KEY, t as buildDiscordInteractiveComponents, v as parseDiscordModalCustomIdForInteraction } from "./shared-interactive-DmzaoKOM.mjs";
1
+ import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
2
+ import { J as stripUndefinedFields, a as Label, c as TextInput, i as CheckboxGroup, o as Modal, s as RadioGroup, u as asSerializableComponent } from "./discord-cXPUdHQi.mjs";
3
+ import { i as parseCustomId, r as colorToNumber, t as BaseMessageInteractiveComponent } from "./components.base-C5sAPHe4.mjs";
4
+ import { _ as parseDiscordModalCustomId, c as DISCORD_COMPONENT_CUSTOM_ID_KEY, d as buildDiscordComponentCustomId, f as buildDiscordModalCustomId, g as parseDiscordComponentCustomIdForInteraction, h as parseDiscordComponentCustomId, l as DISCORD_MODAL_CUSTOM_ID_KEY, t as buildDiscordInteractiveComponents, v as parseDiscordModalCustomIdForInteraction } from "./shared-interactive-DKBw4SNV.mjs";
5
5
  import { asBoolean, asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { ButtonStyle, ComponentType, MessageFlags, TextInputStyle } from "discord-api-types/v10";
7
7
  import crypto from "node:crypto";
8
- //#region extensions/discord/src/components.types.ts
8
+ // extensions/discord/src/components.types.ts
9
9
  const DISCORD_COMPONENT_SELECT_TYPES = [
10
10
  "string",
11
11
  "user",
@@ -13,8 +13,7 @@ const DISCORD_COMPONENT_SELECT_TYPES = [
13
13
  "mentionable",
14
14
  "channel"
15
15
  ];
16
- //#endregion
17
- //#region extensions/discord/src/components.parse.ts
16
+ // extensions/discord/src/components.parse.ts
18
17
  const DISCORD_COMPONENT_ATTACHMENT_PREFIX = "attachment://";
19
18
  const BLOCK_ALIASES = /* @__PURE__ */ new Map([["row", "actions"], ["action-row", "actions"]]);
20
19
  function requireObject(value, label) {
@@ -307,8 +306,7 @@ function readDiscordComponentSpec(raw) {
307
306
  modal
308
307
  };
309
308
  }
310
- //#endregion
311
- //#region extensions/discord/src/components.builders.ts
309
+ // extensions/discord/src/components.builders.ts
312
310
  function createShortId(prefix) {
313
311
  return `${prefix}${crypto.randomBytes(6).toString("base64url")}`;
314
312
  }
@@ -553,8 +551,7 @@ function buildDiscordComponentMessage(params) {
553
551
  function buildDiscordComponentMessageFlags(components) {
554
552
  return components.some((component) => component.isV2) ? MessageFlags.IsComponentsV2 : void 0;
555
553
  }
556
- //#endregion
557
- //#region extensions/discord/src/internal/components.message.ts
554
+ // extensions/discord/src/internal/components.message.ts
558
555
  var AnySelectMenu = class extends BaseMessageInteractiveComponent {
559
556
  constructor(..._args) {
560
557
  super(..._args);
@@ -607,8 +604,7 @@ var RoleSelectMenu = class extends AnySelectMenu {
607
604
  this.type = ComponentType.RoleSelect;
608
605
  }
609
606
  };
610
- //#endregion
611
- //#region extensions/discord/src/components.modal.ts
607
+ // extensions/discord/src/components.modal.ts
612
608
  function createModalFieldComponent(field) {
613
609
  if (field.type === "text") {
614
610
  class DynamicTextInput extends TextInput {
@@ -697,8 +693,7 @@ function createDiscordFormModal(entry) {
697
693
  fields: entry.fields
698
694
  });
699
695
  }
700
- //#endregion
701
- //#region extensions/discord/src/components.ts
696
+ // extensions/discord/src/components.ts
702
697
  var components_exports = /* @__PURE__ */ __exportAll({
703
698
  DISCORD_COMPONENT_ATTACHMENT_PREFIX: () => DISCORD_COMPONENT_ATTACHMENT_PREFIX,
704
699
  DISCORD_COMPONENT_CUSTOM_ID_KEY: () => DISCORD_COMPONENT_CUSTOM_ID_KEY,
@@ -726,5 +721,4 @@ function formatDiscordComponentEventText(params) {
726
721
  if (values.length === 0) return `Updated "${params.label}".`;
727
722
  return `Selected ${values.join(", ")} from "${params.label}".`;
728
723
  }
729
- //#endregion
730
724
  export { buildDiscordComponentMessage as a, coerceDiscordComponentParam as c, createDiscordFormModal as i, readDiscordComponentSpec as l, formatDiscordComponentEventText as n, buildDiscordComponentMessageFlags as o, DiscordFormModal as r, DISCORD_COMPONENT_ATTACHMENT_PREFIX as s, components_exports as t, resolveDiscordComponentAttachmentName as u };
@@ -1,4 +1,4 @@
1
- //#region extensions/discord/src/internal/components.base.ts
1
+ // extensions/discord/src/internal/components.base.ts
2
2
  function parseCustomId(id) {
3
3
  const [rawKey = "", ...parts] = id.split(";");
4
4
  const [keyPart = "", firstValue] = rawKey.split("=");
@@ -28,5 +28,4 @@ var BaseComponent = class {
28
28
  };
29
29
  var BaseMessageInteractiveComponent = class {};
30
30
  var BaseModalComponent = class extends BaseComponent {};
31
- //#endregion
32
31
  export { parseCustomId as i, BaseModalComponent as n, colorToNumber as r, BaseMessageInteractiveComponent as t };