@openclaw/discord 2026.10.1-beta.2 → 2026.10.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/.setup/account-inspect-8cCu6uPG.mjs +31 -0
  2. package/dist/.setup/{accounts-DXHCL8Zm.mjs → accounts-ljrzXBJi.mjs} +49 -47
  3. package/dist/.setup/{channel-type-D1_b5UhU.mjs → allow-list-B_ToXtew.mjs} +40 -107
  4. package/dist/.setup/{api-_oznjffB.mjs → api-CtmE1OUN.mjs} +27 -33
  5. package/dist/.setup/{approval-handler.runtime-BilYSrRF.mjs → approval-handler.runtime-D7FoZSn0.mjs} +31 -54
  6. package/dist/.setup/{approval-message-updates-CgRwc2_Q.mjs → approval-message-updates-CIGByUcE.mjs} +2 -2
  7. package/dist/.setup/{audit-DtvzxONM.mjs → audit-zSawfbsN.mjs} +5 -8
  8. package/dist/.setup/{channel-z5lQMS_9.mjs → channel-DI7DMzu0.mjs} +138 -217
  9. package/dist/.setup/{channel-access-BRp3Y-rF.mjs → channel-access-DasWY_OV.mjs} +6 -7
  10. package/dist/.setup/{channel.setup-DBJtugJO.mjs → channel.setup-DdFVN1mr.mjs} +36 -65
  11. package/dist/.setup/{components-CzXLR3QH.mjs → components-HN9052L1.mjs} +124 -147
  12. package/dist/.setup/{config-schema-CsemBDpS.mjs → config-schema-_uBILpQf.mjs} +8 -4
  13. package/dist/.setup/{conversation-binding-route-Bi62ApSt.mjs → conversation-binding-route-DTjCBx-O.mjs} +1 -1
  14. package/dist/.setup/{directory-config-BH1LA-gi.mjs → directory-config-3iVub-3m.mjs} +1 -1
  15. package/dist/.setup/{directory-live-C9xz7IPm.mjs → directory-live-DLygQVtW.mjs} +18 -22
  16. package/dist/.setup/{discord-J7aRzq2Q.mjs → discord-BGqgx-yd.mjs} +686 -854
  17. package/dist/.setup/{doctor-DxSAngJq.mjs → doctor-DSrNJ7m2.mjs} +36 -47
  18. package/dist/.setup/{doctor-contract-Bg3NPAMw.mjs → doctor-contract-Bwv8EuQ_.mjs} +7 -16
  19. package/dist/.setup/{handle-action-DlmFX-_G.mjs → handle-action-CXH1h1tq.mjs} +26 -39
  20. package/dist/.setup/{handle-action.guild-admin-BnyqTczR.mjs → handle-action.guild-admin-CHKW6PIs.mjs} +25 -31
  21. package/dist/.setup/{live-policy-config-emmPNyh4.mjs → live-policy-config-BPoB3eQi.mjs} +1 -1
  22. package/dist/.setup/{message-handler-BNToPZrx.mjs → message-handler-Ii_etru1.mjs} +17 -22
  23. package/dist/.setup/{message-handler.preflight-D0BcCyI7.mjs → message-handler.preflight-C7YuSRl_.mjs} +85 -134
  24. package/dist/.setup/{message-handler.preflight-pluralkit-D1g3eq0B.mjs → message-handler.preflight-pluralkit-C3iAG--b.mjs} +9 -9
  25. package/dist/.setup/{message-handler.process-CThRmCWK.mjs → message-handler.process-ClgWYH6o.mjs} +239 -211
  26. package/dist/.setup/{outbound-adapter-BPq0c2wY.mjs → outbound-adapter-D8OOIuKn.mjs} +76 -115
  27. package/dist/.setup/{outbound-session-route-DGPPKA0z.mjs → outbound-session-route-B0Hpwn3Q.mjs} +61 -119
  28. package/dist/.setup/output-activity-uBpMSX75.mjs +11 -0
  29. package/dist/.setup/{pluralkit-a6_NLfH9.mjs → pluralkit-B64dfq_j.mjs} +3 -1
  30. package/dist/.setup/{preflight-audio-DHGIHEpv.mjs → preflight-audio-wWgsZG5F.mjs} +1 -5
  31. package/dist/.setup/{presence-cache-Dg3_dADn.mjs → presence-cache-DCeTsL73.mjs} +3 -6
  32. package/dist/.setup/{probe-DIRY8vh7.mjs → probe-D3P1x4aN.mjs} +11 -19
  33. package/dist/.setup/{provider-D2OKMo0f.mjs → provider-D9EzOfG8.mjs} +4003 -4916
  34. package/dist/.setup/{provider-session.runtime-BupCTZQv.mjs → provider-session.runtime-CsnRvddI.mjs} +5 -5
  35. package/dist/.setup/provider.runtime-BQVcM7Pg.mjs +2 -0
  36. package/dist/.setup/{realtime-session.runtime-D5RSC8Mm.mjs → realtime-session.runtime-CxGBk8H-.mjs} +84 -113
  37. package/dist/.setup/{receive-recovery-GqF2PUN_.mjs → receive-recovery-eVmK2_hl.mjs} +4 -14
  38. package/dist/.setup/resolve-allowlist-common-DNSsUQRF.mjs +66 -0
  39. package/dist/.setup/resolve-channels-UdT38DzU.mjs +173 -0
  40. package/dist/.setup/{resolve-users-CxLcDmM0.mjs → resolve-users-DnCsrXZ_.mjs} +12 -41
  41. package/dist/.setup/{runtime-CwUA0RLr.mjs → runtime-CRTkKU1G.mjs} +205 -316
  42. package/dist/.setup/{runtime-CerRBfaa.mjs → runtime-DPm3gZXk.mjs} +2 -2
  43. package/dist/.setup/{secret-config-contract-uOE2J7yM.mjs → secret-config-contract-CIsH7R3B.mjs} +9 -18
  44. package/dist/.setup/{security-audit-D42cp5N7.mjs → security-audit-BFT84Uny.mjs} +1 -2
  45. package/dist/.setup/security-contract-DNyyjTZZ.mjs +19 -0
  46. package/dist/.setup/{send-2X7m2Zmw.mjs → send-DbILKgcm.mjs} +194 -251
  47. package/dist/.setup/{send.components-RqvgmCs3.mjs → send.components-FxOS3CeP.mjs} +49 -65
  48. package/dist/.setup/{send.outbound-B4QHSEzm.mjs → send.outbound-_jx4Xpd3.mjs} +182 -206
  49. package/dist/.setup/{retry-BKzO25k4.mjs → send.receipt-BAlzXd8e.mjs} +155 -231
  50. package/dist/.setup/{send.shared-BQIUh6Vn.mjs → send.shared-CjQ4jbMA.mjs} +129 -185
  51. package/dist/.setup/{sender-identity-CooeYfAn.mjs → sender-identity-BNBvGt1l.mjs} +1 -1
  52. package/dist/.setup/setup-plugin-api-xfOFmxHP.mjs +3 -0
  53. package/dist/.setup/{shared-CIJn6AEC.mjs → shared-CestGDpq.mjs} +32 -22
  54. package/dist/.setup/{subagent-hooks-BYlVnxzy.mjs → subagent-hooks-CME7dSGf.mjs} +5 -10
  55. package/dist/.setup/{system-events-CQ3if_pS.mjs → system-events-BwwSDCw4.mjs} +2 -2
  56. package/dist/.setup/target-parsing-C-HyNxcE.mjs +48 -0
  57. package/dist/.setup/{target-resolver-Dzxf80Y3.mjs → target-resolver-Bse8fuTi.mjs} +11 -27
  58. package/dist/.setup/targets-DZJjkzwv.mjs +3 -0
  59. package/dist/.setup/{thread-bindings-yNNlcUWE.mjs → thread-bindings-0hPTSK14.mjs} +61 -52
  60. package/dist/.setup/{thread-bindings.manager-plk0zJAW.mjs → thread-bindings.manager-CdNa6UIs.mjs} +141 -214
  61. package/dist/.setup/{thread-bindings.session-updates-C9aKtVs6.mjs → thread-bindings.session-updates-DGSljVf6.mjs} +62 -101
  62. package/dist/.setup/threading-BKe3E3tp.mjs +246 -0
  63. package/dist/.setup/{timeouts-pun7VJ02.mjs → timeouts-CuNARfyw.mjs} +10 -18
  64. package/dist/.setup/{transcripts-source-CNWswry-.mjs → transcripts-source-0qQYVu2H.mjs} +62 -380
  65. package/dist/.setup/{voice-runtime-Bc75quiH.mjs → voice-runtime-QlZJ4sHv.mjs} +197 -353
  66. package/dist/account-inspect-api.js +1 -1
  67. package/dist/action-runtime-api.js +1 -1
  68. package/dist/activities-api.js +745 -1
  69. package/dist/api.js +19 -18
  70. package/dist/channel-config-api.js +1 -1
  71. package/dist/channel-plugin-api.js +1 -1
  72. package/dist/directory-contract-api.js +1 -1
  73. package/dist/doctor-contract-api.js +1 -1
  74. package/dist/index.js +9 -5
  75. package/dist/runtime-api.js +21 -20
  76. package/dist/secret-contract-api.js +1 -1
  77. package/dist/security-audit-contract-api.js +1 -1
  78. package/dist/security-contract-api.js +1 -1
  79. package/dist/setup-entry.js +1 -1
  80. package/dist/setup-plugin-api.js +1 -1
  81. package/dist/src/voice/audio-worker.runtime.js +40 -59
  82. package/dist/subagent-hooks-api.js +1 -1
  83. package/dist/transcripts-source-api.js +1 -1
  84. package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts +21 -0
  85. package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts.map +1 -1
  86. package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts +21 -0
  87. package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts.map +1 -1
  88. package/node_modules/discord-api-types/globals.d.ts +6 -0
  89. package/node_modules/discord-api-types/globals.d.ts.map +1 -1
  90. package/node_modules/discord-api-types/globals.js +6 -0
  91. package/node_modules/discord-api-types/globals.js.map +1 -1
  92. package/node_modules/discord-api-types/package.json +3 -3
  93. package/node_modules/discord-api-types/payloads/index.mjs +1 -0
  94. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts +207 -0
  95. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts.map +1 -0
  96. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js +25 -0
  97. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js.map +1 -0
  98. package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts +1 -1
  99. package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts.map +1 -1
  100. package/node_modules/discord-api-types/payloads/v10/guild.d.ts +27 -23
  101. package/node_modules/discord-api-types/payloads/v10/guild.d.ts.map +1 -1
  102. package/node_modules/discord-api-types/payloads/v10/guild.js +26 -22
  103. package/node_modules/discord-api-types/payloads/v10/guild.js.map +1 -1
  104. package/node_modules/discord-api-types/payloads/v10/index.d.ts +1 -0
  105. package/node_modules/discord-api-types/payloads/v10/index.d.ts.map +1 -1
  106. package/node_modules/discord-api-types/payloads/v10/index.js +1 -0
  107. package/node_modules/discord-api-types/payloads/v10/index.js.map +1 -1
  108. package/node_modules/discord-api-types/payloads/v10/index.mjs +1 -0
  109. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts +207 -0
  110. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts.map +1 -0
  111. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js +25 -0
  112. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js.map +1 -0
  113. package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts +1 -1
  114. package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts.map +1 -1
  115. package/node_modules/discord-api-types/payloads/v9/guild.d.ts +27 -23
  116. package/node_modules/discord-api-types/payloads/v9/guild.d.ts.map +1 -1
  117. package/node_modules/discord-api-types/payloads/v9/guild.js +26 -22
  118. package/node_modules/discord-api-types/payloads/v9/guild.js.map +1 -1
  119. package/node_modules/discord-api-types/payloads/v9/index.d.ts +1 -0
  120. package/node_modules/discord-api-types/payloads/v9/index.d.ts.map +1 -1
  121. package/node_modules/discord-api-types/payloads/v9/index.js +1 -0
  122. package/node_modules/discord-api-types/payloads/v9/index.js.map +1 -1
  123. package/node_modules/discord-api-types/payloads/v9/index.mjs +1 -0
  124. package/node_modules/discord-api-types/rest/common.d.ts +2 -0
  125. package/node_modules/discord-api-types/rest/common.d.ts.map +1 -1
  126. package/node_modules/discord-api-types/rest/common.js +2 -0
  127. package/node_modules/discord-api-types/rest/common.js.map +1 -1
  128. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts +70 -0
  129. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts.map +1 -0
  130. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js +3 -0
  131. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js.map +1 -0
  132. package/node_modules/discord-api-types/rest/v10/index.d.ts +1 -0
  133. package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
  134. package/node_modules/discord-api-types/rest/v10/index.js +29 -0
  135. package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
  136. package/node_modules/discord-api-types/rest/v10/interactions.d.ts +4 -2
  137. package/node_modules/discord-api-types/rest/v10/interactions.d.ts.map +1 -1
  138. package/node_modules/discord-api-types/rest/v10/user.d.ts +2 -2
  139. package/node_modules/discord-api-types/rest/v10/user.d.ts.map +1 -1
  140. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts +70 -0
  141. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts.map +1 -0
  142. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js +3 -0
  143. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js.map +1 -0
  144. package/node_modules/discord-api-types/rest/v9/index.d.ts +1 -0
  145. package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
  146. package/node_modules/discord-api-types/rest/v9/index.js +29 -0
  147. package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
  148. package/node_modules/discord-api-types/rest/v9/interactions.d.ts +4 -2
  149. package/node_modules/discord-api-types/rest/v9/interactions.d.ts.map +1 -1
  150. package/node_modules/discord-api-types/rest/v9/user.d.ts +2 -2
  151. package/node_modules/discord-api-types/rest/v9/user.d.ts.map +1 -1
  152. package/node_modules/discord-api-types/v10.mjs +1 -0
  153. package/node_modules/discord-api-types/v9.mjs +1 -0
  154. package/node_modules/ws/lib/websocket.js +17 -3
  155. package/node_modules/ws/package.json +1 -1
  156. package/openclaw.plugin.json +3 -6
  157. package/package.json +7 -12
  158. package/dist/.setup/account-inspect-CjKqkDnH.mjs +0 -45
  159. package/dist/.setup/activities-api-BL_hJ0JQ.mjs +0 -789
  160. package/dist/.setup/provider.runtime-BaW_JnfU.mjs +0 -2
  161. package/dist/.setup/resolve-allowlist-common-DUYRrrVB.mjs +0 -27
  162. package/dist/.setup/resolve-channels--MUatisx.mjs +0 -246
  163. package/dist/.setup/security-contract-DSHk7I2w.mjs +0 -26
  164. package/dist/.setup/setup-plugin-api-nn_giXvZ.mjs +0 -3
  165. package/dist/.setup/targets-Lf8D55w-.mjs +0 -3
  166. package/dist/control-ui/2afbdab1d3aa65a789d8a3eba666f4b1ec5df07073538fe30d6cf32093a1fb2d/index.js +0 -1
@@ -1,13 +1,13 @@
1
- import { s as buildExecApprovalCustomId } from "./components-CzXLR3QH.mjs";
2
- import { A as serializePayload, B as Container, J as Separator, K as Row, R as Button, X as TextDisplay, lt as deleteChannelMessage, rt as createUserDmChannel, tt as stripUndefinedFields, ut as editChannelMessage } from "./discord-J7aRzq2Q.mjs";
3
- import { s as findGraphemeChunkEnd } from "./retry-BKzO25k4.mjs";
4
- import { D as createDiscordMessageNonce, M as createDiscordClient } from "./send.shared-BQIUh6Vn.mjs";
5
- import { D as isDiscordExecApprovalClientEnabled, c as formatDiscordApprovalDisplayValue, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-DGPPKA0z.mjs";
6
- import { a as shouldHandleDiscordApprovalRequest } from "./channel-z5lQMS_9.mjs";
7
- import { t as discordApprovalMessageUpdates } from "./approval-message-updates-CgRwc2_Q.mjs";
8
- import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
1
+ import { D as createDiscordMessageNonce, N as createDiscordClient } from "./send.shared-CjQ4jbMA.mjs";
2
+ import { D as Row, K as serializePayload, bt as stripUndefinedFields, j as TextDisplay, k as Separator, lt as deleteChannelMessage, nt as createUserDmChannel, st as createChannelMessage, ut as editChannelMessage, x as Container, y as Button } from "./discord-BGqgx-yd.mjs";
3
+ import { y as findGraphemeChunkEnd } from "./send.receipt-BAlzXd8e.mjs";
4
+ import { s as buildExecApprovalCustomId } from "./components-HN9052L1.mjs";
5
+ import { D as isDiscordExecApprovalClientEnabled, c as formatDiscordApprovalDisplayValue, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-B0Hpwn3Q.mjs";
6
+ import { a as shouldHandleDiscordApprovalRequest } from "./channel-DI7DMzu0.mjs";
7
+ import { t as discordApprovalMessageUpdates } from "./approval-message-updates-CIGByUcE.mjs";
9
8
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
10
- import { ButtonStyle, Routes } from "discord-api-types/v10";
9
+ import { ButtonStyle } from "discord-api-types/v10";
10
+ import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
11
11
  import { createChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
12
12
  import { formatChannelApprovalResolvedLabel } from "openclaw/plugin-sdk/approval-runtime";
13
13
  //#region extensions/discord/src/approval-handler.runtime.ts
@@ -21,20 +21,13 @@ function resolveHandlerContext(params) {
21
21
  };
22
22
  }
23
23
  var ExecApprovalActionButton = class extends Button {
24
- constructor(params) {
24
+ constructor(view, descriptor) {
25
25
  super();
26
- this.customId = buildExecApprovalCustomId(params.approvalId, params.approvalKind, params.descriptor.decision);
27
- this.label = params.descriptor.label;
28
- this.style = params.descriptor.style === "success" ? ButtonStyle.Success : params.descriptor.style === "primary" ? ButtonStyle.Primary : params.descriptor.style === "danger" ? ButtonStyle.Danger : ButtonStyle.Secondary;
26
+ this.customId = buildExecApprovalCustomId(view.approvalId, view.approvalKind, descriptor.decision);
27
+ this.label = descriptor.label;
28
+ this.style = descriptor.style === "success" ? ButtonStyle.Success : descriptor.style === "primary" ? ButtonStyle.Primary : descriptor.style === "danger" ? ButtonStyle.Danger : ButtonStyle.Secondary;
29
29
  }
30
30
  };
31
- function createApprovalActionRow(view) {
32
- return new Row(view.actions.map((descriptor) => new ExecApprovalActionButton({
33
- approvalId: view.approvalId,
34
- approvalKind: view.approvalKind,
35
- descriptor
36
- })));
37
- }
38
31
  function buildExecApprovalPayload(container) {
39
32
  return {
40
33
  components: [container],
@@ -45,23 +38,14 @@ function formatCommandPreview(commandText, maxChars) {
45
38
  const end = findGraphemeChunkEnd(commandText, 0, maxChars, maxChars, false);
46
39
  return (end < commandText.length ? `${commandText.slice(0, end)}...` : commandText).replace(/`/g, "​`");
47
40
  }
48
- function formatOptionalCommandPreview(commandText, maxChars) {
49
- if (!commandText) return null;
50
- return formatCommandPreview(commandText, maxChars);
51
- }
52
- function createApprovalContainer(params) {
53
- const { view } = params;
41
+ function createApprovalContainer(view) {
54
42
  const plugin = view.approvalKind === "plugin";
55
43
  const systemAgent = view.approvalKind === "system-agent";
56
44
  const pending = view.phase === "pending";
57
45
  const approvalLabel = plugin ? "Plugin" : systemAgent ? "OpenClaw Change" : "Exec";
58
- const { commandPreview, commandSecondaryPreview } = plugin ? {
59
- commandPreview: formatCommandPreview(view.title, 700),
60
- commandSecondaryPreview: formatOptionalCommandPreview(view.description, 1e3)
61
- } : {
62
- commandPreview: formatCommandPreview(view.commandText, pending ? 1e3 : 500),
63
- commandSecondaryPreview: formatOptionalCommandPreview(view.commandPreview, pending ? 500 : 300)
64
- };
46
+ const commandPreview = formatCommandPreview(plugin ? view.title : view.commandText, plugin ? 700 : pending ? 1e3 : 500);
47
+ const secondaryText = plugin ? view.description : view.commandPreview;
48
+ const commandSecondaryPreview = secondaryText ? formatCommandPreview(secondaryText, plugin ? 1e3 : pending ? 500 : 300) : null;
65
49
  const decisionLabel = view.phase === "resolved" ? formatChannelApprovalResolvedLabel(view, (decision) => decision === "allow-once" ? "Allowed (once)" : decision === "allow-always" ? "Allowed (always)" : "Denied") : void 0;
66
50
  const title = pending ? `${approvalLabel} Approval Required` : `${approvalLabel} Approval: ${view.phase === "expired" ? "Expired" : decisionLabel}`;
67
51
  const description = pending ? plugin ? "A plugin action needs your approval." : systemAgent ? "An OpenClaw change needs your approval." : "A command needs your approval." : view.phase === "expired" ? "This approval request has expired." : view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(view.resolvedBy)}` : "Resolved";
@@ -79,7 +63,7 @@ function createApprovalContainer(params) {
79
63
  ];
80
64
  if (commandSecondaryPreview) components.push(new TextDisplay(`### Shell Preview\n\`\`\`\n${commandSecondaryPreview}\n\`\`\``));
81
65
  if (view.metadata.length) components.push(new TextDisplay(view.metadata.map((item) => `- ${item.label}: ${item.value}`).join("\n")));
82
- if (params.actionRow) components.push(params.actionRow);
66
+ if (pending) components.push(new Row(view.actions.map((descriptor) => new ExecApprovalActionButton(view, descriptor))));
83
67
  components.push(new Separator({
84
68
  divider: false,
85
69
  spacing: "small"
@@ -87,34 +71,30 @@ function createApprovalContainer(params) {
87
71
  return new Container(components, { accentColor });
88
72
  }
89
73
  async function finalizeMessage(params) {
90
- if (params.cleanupAfterResolve) try {
74
+ const operations = params.cleanupAfterResolve ? ["delete", "update"] : ["update"];
75
+ for (const operation of operations) try {
91
76
  const { rest, request: discordRequest } = createDiscordClient({
92
77
  cfg: params.cfg,
93
78
  token: params.token,
94
79
  accountId: params.accountId
95
80
  });
96
- await discordApprovalMessageUpdates.enqueue(params.messageId, () => discordRequest(() => deleteChannelMessage(rest, params.channelId, params.messageId), "delete-approval"));
81
+ let request;
82
+ if (operation === "delete") request = () => deleteChannelMessage(rest, params.channelId, params.messageId);
83
+ else {
84
+ const payload = buildExecApprovalPayload(params.container);
85
+ request = () => editChannelMessage(rest, params.channelId, params.messageId, { body: stripUndefinedFields(serializePayload(payload)) });
86
+ }
87
+ await discordApprovalMessageUpdates.enqueue(params.messageId, () => discordRequest(request, `${operation}-approval`));
97
88
  return;
98
89
  } catch (err) {
99
- logError(`discord approvals: failed to delete message: ${String(err)}`);
100
- }
101
- try {
102
- const { rest, request: discordRequest } = createDiscordClient({
103
- cfg: params.cfg,
104
- token: params.token,
105
- accountId: params.accountId
106
- });
107
- const payload = buildExecApprovalPayload(params.container);
108
- await discordApprovalMessageUpdates.enqueue(params.messageId, () => discordRequest(() => editChannelMessage(rest, params.channelId, params.messageId, { body: stripUndefinedFields(serializePayload(payload)) }), "update-approval"));
109
- } catch (err) {
110
- logError(`discord approvals: failed to update message: ${String(err)}`);
90
+ logError(`discord approvals: failed to ${operation} message: ${String(err)}`);
111
91
  }
112
92
  }
113
93
  function buildTerminalApprovalResult(params) {
114
94
  if (!resolveHandlerContext(params)) return { kind: "delete" };
115
95
  return {
116
96
  kind: "update",
117
- payload: createApprovalContainer({ view: params.view })
97
+ payload: createApprovalContainer(params.view)
118
98
  };
119
99
  }
120
100
  const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
@@ -149,10 +129,7 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
149
129
  accountId,
150
130
  context
151
131
  })) return { body: {} };
152
- const container = createApprovalContainer({
153
- view,
154
- actionRow: createApprovalActionRow(view)
155
- });
132
+ const container = createApprovalContainer(view);
156
133
  return { body: stripUndefinedFields(serializePayload(buildExecApprovalPayload(container))) };
157
134
  },
158
135
  buildResolvedResult: buildTerminalApprovalResult,
@@ -209,7 +186,7 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
209
186
  nonce: createDiscordMessageNonce(),
210
187
  enforce_nonce: true
211
188
  };
212
- const message = await discordRequest(() => rest.post(Routes.channelMessages(preparedTarget.discordChannelId), { body }), plannedTarget.surface === "origin" ? "send-approval-channel" : "send-approval", { safety: "nonce-protected-create" });
189
+ const message = await discordRequest(() => createChannelMessage(rest, preparedTarget.discordChannelId, { body }), plannedTarget.surface === "origin" ? "send-approval-channel" : "send-approval", { safety: "nonce-protected-create" });
213
190
  if (!message?.id) {
214
191
  if (plannedTarget.surface === "origin") logError("discord approvals: failed to send to channel");
215
192
  else if (preparedTarget.recipientUserId) logError(`discord approvals: failed to send message to user ${preparedTarget.recipientUserId}`);
@@ -1,5 +1,5 @@
1
- import { c as parseExecApprovalData } from "./components-CzXLR3QH.mjs";
2
- import { et as parseCustomId } from "./discord-J7aRzq2Q.mjs";
1
+ import { et as parseCustomId } from "./discord-BGqgx-yd.mjs";
2
+ import { c as parseExecApprovalData } from "./components-HN9052L1.mjs";
3
3
  import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
4
4
  //#region extensions/discord/src/approval-message-updates.ts
5
5
  const discordApprovalMessageUpdates = new KeyedAsyncQueue();
@@ -1,18 +1,15 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
2
- import { b as fetchChannelPermissionsDiscord } from "./send.shared-BQIUh6Vn.mjs";
3
- import { t as inspectDiscordAccount } from "./account-inspect-CjKqkDnH.mjs";
4
- import "./send-2X7m2Zmw.mjs";
5
- import { C as collectDiscordAuditChannelIdsForAccount, S as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-DGPPKA0z.mjs";
2
+ import { t as inspectDiscordAccount } from "./account-inspect-8cCu6uPG.mjs";
3
+ import { b as fetchChannelPermissionsDiscord } from "./send.shared-CjQ4jbMA.mjs";
4
+ import "./send-DbILKgcm.mjs";
5
+ import { C as collectDiscordAuditChannelIdsForAccount, S as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-B0Hpwn3Q.mjs";
6
6
  //#region extensions/discord/src/audit.ts
7
7
  var audit_exports = /* @__PURE__ */ __exportAll({
8
8
  auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
9
9
  collectDiscordAuditChannelIds: () => collectDiscordAuditChannelIds
10
10
  });
11
11
  function collectDiscordAuditChannelIds(params) {
12
- const account = inspectDiscordAccount({
13
- cfg: params.cfg,
14
- accountId: params.accountId
15
- });
12
+ const account = inspectDiscordAccount(params);
16
13
  return collectDiscordAuditChannelIdsForAccount(account.config);
17
14
  }
18
15
  async function auditDiscordChannelPermissions(params) {