@openclaw/discord 2026.10.1 → 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 (164) hide show
  1. package/dist/.setup/account-inspect-8cCu6uPG.mjs +31 -0
  2. package/dist/.setup/{accounts-HE9-mj1L.mjs → accounts-ljrzXBJi.mjs} +47 -45
  3. package/dist/.setup/{allow-list-vxkG9_JD.mjs → allow-list-B_ToXtew.mjs} +34 -101
  4. package/dist/.setup/{api-DlNUkDqj.mjs → api-CtmE1OUN.mjs} +25 -31
  5. package/dist/.setup/{approval-handler.runtime-DmnEa54W.mjs → approval-handler.runtime-D7FoZSn0.mjs} +30 -53
  6. package/dist/.setup/{approval-message-updates-B0jdSqOj.mjs → approval-message-updates-CIGByUcE.mjs} +2 -2
  7. package/dist/.setup/{audit-BpikUwN_.mjs → audit-zSawfbsN.mjs} +5 -8
  8. package/dist/.setup/{channel-Dr-AUnGt.mjs → channel-DI7DMzu0.mjs} +136 -215
  9. package/dist/.setup/{channel-access-BRp3Y-rF.mjs → channel-access-DasWY_OV.mjs} +6 -7
  10. package/dist/.setup/{channel.setup-BmNvkidb.mjs → channel.setup-DdFVN1mr.mjs} +35 -64
  11. package/dist/.setup/{components-DLJR0xU-.mjs → components-HN9052L1.mjs} +123 -146
  12. package/dist/.setup/{config-schema-BQWfnSCx.mjs → config-schema-_uBILpQf.mjs} +7 -3
  13. package/dist/.setup/{conversation-binding-route-DicJC1Lj.mjs → conversation-binding-route-DTjCBx-O.mjs} +1 -1
  14. package/dist/.setup/{directory-config-gqsdcplU.mjs → directory-config-3iVub-3m.mjs} +1 -1
  15. package/dist/.setup/{directory-live-Bipr0eUJ.mjs → directory-live-DLygQVtW.mjs} +18 -22
  16. package/dist/.setup/{discord-9gysrhzp.mjs → discord-BGqgx-yd.mjs} +686 -854
  17. package/dist/.setup/{doctor-B2bskDcF.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-UmkjXBfo.mjs → handle-action-CXH1h1tq.mjs} +25 -38
  20. package/dist/.setup/{handle-action.guild-admin-CB4sc9VV.mjs → handle-action.guild-admin-CHKW6PIs.mjs} +25 -31
  21. package/dist/.setup/{live-policy-config-VxexfRKo.mjs → live-policy-config-BPoB3eQi.mjs} +1 -1
  22. package/dist/.setup/{message-handler-BK69A-NB.mjs → message-handler-Ii_etru1.mjs} +9 -14
  23. package/dist/.setup/{message-handler.preflight-DFpsh90H.mjs → message-handler.preflight-C7YuSRl_.mjs} +79 -128
  24. package/dist/.setup/{message-handler.preflight-pluralkit-BXGGVmpe.mjs → message-handler.preflight-pluralkit-C3iAG--b.mjs} +6 -6
  25. package/dist/.setup/{message-handler.process-TKoqcqIP.mjs → message-handler.process-ClgWYH6o.mjs} +234 -206
  26. package/dist/.setup/{outbound-adapter-D4wRAb5S.mjs → outbound-adapter-D8OOIuKn.mjs} +73 -112
  27. package/dist/.setup/{outbound-session-route-BvBH4LC6.mjs → outbound-session-route-B0Hpwn3Q.mjs} +57 -115
  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-BwSKpnZf.mjs → probe-D3P1x4aN.mjs} +10 -18
  33. package/dist/.setup/{provider-YP8gN9_o.mjs → provider-D9EzOfG8.mjs} +2990 -3903
  34. package/dist/.setup/{provider-session.runtime-D1gkPxHT.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-BKUQBy1u.mjs → realtime-session.runtime-CxGBk8H-.mjs} +69 -98
  37. package/dist/.setup/{receive-recovery-DgkX7Qvi.mjs → receive-recovery-eVmK2_hl.mjs} +2 -12
  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-DNrwvunm.mjs → resolve-users-DnCsrXZ_.mjs} +12 -41
  41. package/dist/.setup/{runtime-CESTexGn.mjs → runtime-CRTkKU1G.mjs} +202 -313
  42. package/dist/.setup/{runtime-DPcmPST9.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-CJk3VP5q.mjs → send-DbILKgcm.mjs} +184 -241
  47. package/dist/.setup/{send.components-dPljuV24.mjs → send.components-FxOS3CeP.mjs} +47 -63
  48. package/dist/.setup/{send.outbound-rOboMO_6.mjs → send.outbound-_jx4Xpd3.mjs} +178 -202
  49. package/dist/.setup/{send.receipt-DVOg2Oaw.mjs → send.receipt-BAlzXd8e.mjs} +33 -109
  50. package/dist/.setup/{send.shared-C4CN24D9.mjs → send.shared-CjQ4jbMA.mjs} +97 -153
  51. package/dist/.setup/{sender-identity-AHpUNr72.mjs → sender-identity-BNBvGt1l.mjs} +1 -1
  52. package/dist/.setup/setup-plugin-api-xfOFmxHP.mjs +3 -0
  53. package/dist/.setup/{shared-BoBnM5kM.mjs → shared-CestGDpq.mjs} +30 -20
  54. package/dist/.setup/{subagent-hooks-HH8Uy9cx.mjs → subagent-hooks-CME7dSGf.mjs} +5 -10
  55. package/dist/.setup/{system-events-Cwxaww8i.mjs → system-events-BwwSDCw4.mjs} +2 -2
  56. package/dist/.setup/target-parsing-C-HyNxcE.mjs +48 -0
  57. package/dist/.setup/{target-resolver-CSFoPQ12.mjs → target-resolver-Bse8fuTi.mjs} +11 -27
  58. package/dist/.setup/targets-DZJjkzwv.mjs +3 -0
  59. package/dist/.setup/{thread-bindings-DjQCkmsd.mjs → thread-bindings-0hPTSK14.mjs} +61 -52
  60. package/dist/.setup/{thread-bindings.manager-D2-GYZ5s.mjs → thread-bindings.manager-CdNa6UIs.mjs} +138 -211
  61. package/dist/.setup/{thread-bindings.session-updates-Bu_CGr_O.mjs → thread-bindings.session-updates-DGSljVf6.mjs} +60 -99
  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-CaZQnGRH.mjs → transcripts-source-0qQYVu2H.mjs} +50 -368
  65. package/dist/.setup/{voice-runtime-DDymtIw8.mjs → voice-runtime-QlZJ4sHv.mjs} +166 -322
  66. package/dist/account-inspect-api.js +1 -1
  67. package/dist/action-runtime-api.js +1 -1
  68. package/dist/activities-api.js +77 -120
  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/runtime-api.js +21 -20
  75. package/dist/secret-contract-api.js +1 -1
  76. package/dist/security-audit-contract-api.js +1 -1
  77. package/dist/security-contract-api.js +1 -1
  78. package/dist/setup-entry.js +1 -1
  79. package/dist/setup-plugin-api.js +1 -1
  80. package/dist/src/voice/audio-worker.runtime.js +38 -57
  81. package/dist/subagent-hooks-api.js +1 -1
  82. package/dist/transcripts-source-api.js +1 -1
  83. package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts +21 -0
  84. package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts.map +1 -1
  85. package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts +21 -0
  86. package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts.map +1 -1
  87. package/node_modules/discord-api-types/globals.d.ts +6 -0
  88. package/node_modules/discord-api-types/globals.d.ts.map +1 -1
  89. package/node_modules/discord-api-types/globals.js +6 -0
  90. package/node_modules/discord-api-types/globals.js.map +1 -1
  91. package/node_modules/discord-api-types/package.json +3 -3
  92. package/node_modules/discord-api-types/payloads/index.mjs +1 -0
  93. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts +207 -0
  94. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts.map +1 -0
  95. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js +25 -0
  96. package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js.map +1 -0
  97. package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts +1 -1
  98. package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts.map +1 -1
  99. package/node_modules/discord-api-types/payloads/v10/guild.d.ts +27 -23
  100. package/node_modules/discord-api-types/payloads/v10/guild.d.ts.map +1 -1
  101. package/node_modules/discord-api-types/payloads/v10/guild.js +26 -22
  102. package/node_modules/discord-api-types/payloads/v10/guild.js.map +1 -1
  103. package/node_modules/discord-api-types/payloads/v10/index.d.ts +1 -0
  104. package/node_modules/discord-api-types/payloads/v10/index.d.ts.map +1 -1
  105. package/node_modules/discord-api-types/payloads/v10/index.js +1 -0
  106. package/node_modules/discord-api-types/payloads/v10/index.js.map +1 -1
  107. package/node_modules/discord-api-types/payloads/v10/index.mjs +1 -0
  108. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts +207 -0
  109. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts.map +1 -0
  110. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js +25 -0
  111. package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js.map +1 -0
  112. package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts +1 -1
  113. package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts.map +1 -1
  114. package/node_modules/discord-api-types/payloads/v9/guild.d.ts +27 -23
  115. package/node_modules/discord-api-types/payloads/v9/guild.d.ts.map +1 -1
  116. package/node_modules/discord-api-types/payloads/v9/guild.js +26 -22
  117. package/node_modules/discord-api-types/payloads/v9/guild.js.map +1 -1
  118. package/node_modules/discord-api-types/payloads/v9/index.d.ts +1 -0
  119. package/node_modules/discord-api-types/payloads/v9/index.d.ts.map +1 -1
  120. package/node_modules/discord-api-types/payloads/v9/index.js +1 -0
  121. package/node_modules/discord-api-types/payloads/v9/index.js.map +1 -1
  122. package/node_modules/discord-api-types/payloads/v9/index.mjs +1 -0
  123. package/node_modules/discord-api-types/rest/common.d.ts +2 -0
  124. package/node_modules/discord-api-types/rest/common.d.ts.map +1 -1
  125. package/node_modules/discord-api-types/rest/common.js +2 -0
  126. package/node_modules/discord-api-types/rest/common.js.map +1 -1
  127. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts +70 -0
  128. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts.map +1 -0
  129. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js +3 -0
  130. package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js.map +1 -0
  131. package/node_modules/discord-api-types/rest/v10/index.d.ts +1 -0
  132. package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
  133. package/node_modules/discord-api-types/rest/v10/index.js +29 -0
  134. package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
  135. package/node_modules/discord-api-types/rest/v10/interactions.d.ts +4 -2
  136. package/node_modules/discord-api-types/rest/v10/interactions.d.ts.map +1 -1
  137. package/node_modules/discord-api-types/rest/v10/user.d.ts +2 -2
  138. package/node_modules/discord-api-types/rest/v10/user.d.ts.map +1 -1
  139. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts +70 -0
  140. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts.map +1 -0
  141. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js +3 -0
  142. package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js.map +1 -0
  143. package/node_modules/discord-api-types/rest/v9/index.d.ts +1 -0
  144. package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
  145. package/node_modules/discord-api-types/rest/v9/index.js +29 -0
  146. package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
  147. package/node_modules/discord-api-types/rest/v9/interactions.d.ts +4 -2
  148. package/node_modules/discord-api-types/rest/v9/interactions.d.ts.map +1 -1
  149. package/node_modules/discord-api-types/rest/v9/user.d.ts +2 -2
  150. package/node_modules/discord-api-types/rest/v9/user.d.ts.map +1 -1
  151. package/node_modules/discord-api-types/v10.mjs +1 -0
  152. package/node_modules/discord-api-types/v9.mjs +1 -0
  153. package/node_modules/ws/lib/websocket.js +17 -3
  154. package/node_modules/ws/package.json +1 -1
  155. package/openclaw.plugin.json +3 -6
  156. package/package.json +7 -12
  157. package/dist/.setup/account-inspect-DsER5ILV.mjs +0 -45
  158. package/dist/.setup/provider.runtime-CZ51OIgD.mjs +0 -2
  159. package/dist/.setup/resolve-allowlist-common-BUyU3C-T.mjs +0 -27
  160. package/dist/.setup/resolve-channels-DA6QlhZN.mjs +0 -246
  161. package/dist/.setup/security-contract-DSHk7I2w.mjs +0 -26
  162. package/dist/.setup/setup-plugin-api-BVlCz3fm.mjs +0 -3
  163. package/dist/.setup/targets-bqXQENmX.mjs +0 -3
  164. package/dist/control-ui/2afbdab1d3aa65a789d8a3eba666f4b1ec5df07073538fe30d6cf32093a1fb2d/index.js +0 -1
@@ -1,12 +1,12 @@
1
- import { D as createDiscordMessageNonce, N as createDiscordClient } from "./send.shared-C4CN24D9.mjs";
2
- import { A as serializePayload, B as Container, J as Separator, K as Row, R as Button, X as TextDisplay, ct as deleteChannelMessage, lt as editChannelMessage, nt as createUserDmChannel, yt as stripUndefinedFields } from "./discord-9gysrhzp.mjs";
3
- import { x as findGraphemeChunkEnd } from "./send.receipt-DVOg2Oaw.mjs";
4
- import { s as buildExecApprovalCustomId } from "./components-DLJR0xU-.mjs";
5
- import { D as isDiscordExecApprovalClientEnabled, c as formatDiscordApprovalDisplayValue, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-BvBH4LC6.mjs";
6
- import { a as shouldHandleDiscordApprovalRequest } from "./channel-Dr-AUnGt.mjs";
7
- import { t as discordApprovalMessageUpdates } from "./approval-message-updates-B0jdSqOj.mjs";
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";
8
8
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
9
- import { ButtonStyle, Routes } from "discord-api-types/v10";
9
+ import { ButtonStyle } from "discord-api-types/v10";
10
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";
@@ -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 { et as parseCustomId } from "./discord-9gysrhzp.mjs";
2
- import { c as parseExecApprovalData } from "./components-DLJR0xU-.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 { t as inspectDiscordAccount } from "./account-inspect-DsER5ILV.mjs";
3
- import { b as fetchChannelPermissionsDiscord } from "./send.shared-C4CN24D9.mjs";
4
- import "./send-CJk3VP5q.mjs";
5
- import { C as collectDiscordAuditChannelIdsForAccount, S as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-BvBH4LC6.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) {