@openclaw/discord 2026.10.10 → 2026.11.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 (217) hide show
  1. package/dist/.setup/{account-inspect-X_Xlr42B.mjs → account-inspect-CSz5Qodj.mjs} +1 -1
  2. package/dist/.setup/{accounts-C18HNgge.mjs → accounts-DtjvhJUj.mjs} +9 -6
  3. package/dist/.setup/{active-turn-thread-route-BAc_Xik-.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
  4. package/dist/.setup/{allow-list-D1ZGfhXh.mjs → allow-list-DahA0Jxh.mjs} +3 -150
  5. package/dist/.setup/{api-Bth1wKF9.mjs → api-Bp0HI4q3.mjs} +10 -20
  6. package/dist/.setup/{approval-handler.runtime-BAoEELJJ.mjs → approval-handler.runtime-Cy53ugTf.mjs} +80 -61
  7. package/dist/.setup/{approval-message-updates-Cks-MSCJ.mjs → approval-message-updates-DqOXxPss.mjs} +2 -2
  8. package/dist/.setup/{audit-Dw_rAZIz.mjs → audit-DoPKOfQE.mjs} +4 -4
  9. package/dist/.setup/{channel-BMpMAeQL.mjs → channel-Ds6iuNdy.mjs} +134 -201
  10. package/dist/.setup/channel-access-DhJhVrdZ.mjs +23 -0
  11. package/dist/.setup/channel.setup-BLt9dkIG.mjs +235 -0
  12. package/dist/.setup/{components-BvOWSPxr.mjs → components-WTfUxead.mjs} +208 -426
  13. package/dist/.setup/components.base-C5sAPHe4.mjs +31 -0
  14. package/dist/.setup/{config-schema-Coyq5wOr.mjs → config-schema-GX2yDgIH.mjs} +6 -7
  15. package/dist/.setup/{conversation-binding-route-DOPUZNYo.mjs → conversation-binding-route-CZdm-X5A.mjs} +2 -2
  16. package/dist/.setup/{directory-config-CIqVnQtn.mjs → directory-config-BXJuh9-J.mjs} +1 -1
  17. package/dist/.setup/{directory-live-DUuPEWub.mjs → directory-live-CEopeb8Q.mjs} +55 -62
  18. package/dist/.setup/{discord-eFlHX1Gn.mjs → discord-r79VFjJp.mjs} +1087 -1664
  19. package/dist/.setup/{doctor-Dty_Ossy.mjs → doctor-UfLW8nye.mjs} +3 -5
  20. package/dist/.setup/endpoint-runtime-BM3x-m6O.mjs +138 -0
  21. package/dist/.setup/guilds-DQucP5Tn.mjs +21 -0
  22. package/dist/.setup/{handle-action-DXY91jF-.mjs → handle-action-BarHOi-v.mjs} +15 -15
  23. package/dist/.setup/{handle-action.guild-admin-BvBCfhXF.mjs → handle-action.guild-admin-oRUb8p_O.mjs} +5 -5
  24. package/dist/.setup/listeners-CHgTENFu.mjs +46 -0
  25. package/dist/.setup/{live-policy-config-DO1Fk2hp.mjs → live-policy-config-EKp4O6zx.mjs} +2 -3
  26. package/dist/.setup/{message-handler-fL1j1NiR.mjs → message-handler-DUeT8Asf.mjs} +154 -113
  27. package/dist/.setup/{message-handler.preflight-DkjwNZAd.mjs → message-handler.preflight-C6TNtKW0.mjs} +30 -104
  28. package/dist/.setup/{message-handler.preflight-pluralkit-DR4BnvMU.mjs → message-handler.preflight-pluralkit-6E9TFmmN.mjs} +9 -22
  29. package/dist/.setup/{message-handler.process-ClOwIPDK.mjs → message-handler.process-D8_oQ5Cp.mjs} +256 -367
  30. package/dist/.setup/outbound-payload-DUsrFICb.mjs +445 -0
  31. package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-Cb8cv4Oi.mjs} +138 -86
  32. package/dist/.setup/{preflight-audio-CwtPIsvk.mjs → preflight-audio-r4BbaJxh.mjs} +1 -5
  33. package/dist/.setup/{presence-cache-CgutE4NN.mjs → presence-cache-B3xj3b0l.mjs} +1 -6
  34. package/dist/.setup/{probe-DNge7OEP.mjs → probe-BUmJyH35.mjs} +5 -9
  35. package/dist/.setup/{provider-BBDuE14w.mjs → provider-Dm2ERSxe.mjs} +3600 -4454
  36. package/dist/.setup/{provider-session.runtime-D8hMXXqJ.mjs → provider-session.runtime-DCIqDsIg.mjs} +3 -3
  37. package/dist/.setup/provider.runtime-DmxPGoUg.mjs +1 -0
  38. package/dist/.setup/proxy-fetch-B8cK6FLQ.mjs +29 -0
  39. package/dist/.setup/{realtime-session.runtime-cetognkp.mjs → realtime-session.runtime-WJL6NdwK.mjs} +43 -81
  40. package/dist/.setup/{receive-recovery-C77CVdGM.mjs → receive-recovery-DV_v5ROf.mjs} +13 -27
  41. package/dist/.setup/{resolve-allowlist-common-CI77288n.mjs → resolve-allowlist-common-C37fgnYG.mjs} +3 -12
  42. package/dist/.setup/{resolve-channels-DYc6-xgV.mjs → resolve-channels-CwpnQ7C2.mjs} +5 -4
  43. package/dist/.setup/{resolve-users-BQT7XWF2.mjs → resolve-users-D6jSwe8R.mjs} +4 -7
  44. package/dist/.setup/{runtime-CcijhTJT.mjs → runtime-B-PgPsGR.mjs} +6 -6
  45. package/dist/.setup/{runtime-CI0UJqeS.mjs → runtime-DhOMlnYS.mjs} +196 -235
  46. package/dist/.setup/{secret-config-contract-BdbCvqnM.mjs → secret-config-contract-CP6teHec.mjs} +4 -9
  47. package/dist/.setup/{send-Cbq-IVsS.mjs → send-DnLL6XoO.mjs} +149 -174
  48. package/dist/.setup/{send.components-BV6ucNpJ.mjs → send.components-xB43CksK.mjs} +61 -71
  49. package/dist/.setup/{send.outbound-CGhBhzjQ.mjs → send.outbound-B11X6TOE.mjs} +75 -129
  50. package/dist/.setup/{send.receipt-Dw-_r5Bx.mjs → send.receipt-CMteCIZS.mjs} +29 -31
  51. package/dist/.setup/{send.shared-D4MioxW_.mjs → send.shared-BcLLZBul.mjs} +38 -112
  52. package/dist/.setup/{sender-identity-DrN5c4ec.mjs → sender-identity-CGNpdJmb.mjs} +3 -9
  53. package/dist/.setup/setup-plugin-api-C6AMx3hu.mjs +2 -0
  54. package/dist/.setup/{shared-Bp0sxD5R.mjs → shared-BEYw16he.mjs} +8 -10
  55. package/dist/.setup/shared-interactive-DKBw4SNV.mjs +311 -0
  56. package/dist/.setup/{subagent-hooks-mQbDkvuD.mjs → subagent-hooks-DlYElpXa.mjs} +1 -1
  57. package/dist/.setup/{system-events-2zc2eGfF.mjs → system-events--Pk6y9aP.mjs} +2 -2
  58. package/dist/.setup/{target-resolver-CAHeVfmZ.mjs → target-resolver-Bo9EpGp_.mjs} +3 -3
  59. package/dist/.setup/{thread-bindings-Dg7X_ZXP.mjs → thread-bindings-BF-hr-bg.mjs} +12 -20
  60. package/dist/.setup/{thread-bindings.manager-DCDYksah.mjs → thread-bindings.manager-CQCkha5r.mjs} +22 -42
  61. package/dist/.setup/{thread-bindings.session-updates-C76plLS3.mjs → thread-bindings.session-updates-C2gJAj_I.mjs} +11 -18
  62. package/dist/.setup/{threading-l0UfrE6x.mjs → threading-HA9C2wYR.mjs} +68 -104
  63. package/dist/.setup/{timeouts-DTrUsJ_W.mjs → timeouts-CT9hnmo4.mjs} +1 -1
  64. package/dist/.setup/{transcripts-source-CGgOaWcu.mjs → transcripts-source-DzpzETZR.mjs} +102 -172
  65. package/dist/.setup/{voice-runtime-DY1EwDfi.mjs → voice-runtime-Bo_nsVvX.mjs} +231 -448
  66. package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
  67. package/dist/account-inspect-api.js +1 -1
  68. package/dist/action-runtime-api.js +1 -1
  69. package/dist/activities-api.js +285 -337
  70. package/dist/api.js +16 -16
  71. package/dist/assets/embedded-app-sdk.mjs +1 -1
  72. package/dist/channel-config-api.js +1 -1
  73. package/dist/channel-plugin-api.js +1 -1
  74. package/dist/directory-contract-api.js +1 -1
  75. package/dist/runtime-api.js +22 -22
  76. package/dist/secret-contract-api.js +1 -1
  77. package/dist/setup-entry.js +1 -1
  78. package/dist/setup-plugin-api.js +1 -1
  79. package/dist/src/voice/audio-worker.runtime.js +56 -68
  80. package/dist/subagent-hooks-api.js +1 -1
  81. package/dist/transcripts-source-api.js +1 -1
  82. package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +2 -3
  83. package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +2 -3
  84. package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +3339 -4021
  85. package/node_modules/@napi-rs/wasm-runtime/package.json +1 -1
  86. package/node_modules/@types/lodash/README.md +1 -1
  87. package/node_modules/@types/lodash/common/function.d.ts +2 -2
  88. package/node_modules/@types/lodash/package.json +2 -2
  89. package/node_modules/@types/node/README.md +1 -1
  90. package/node_modules/@types/node/package.json +2 -2
  91. package/node_modules/@types/node/util.d.ts +6 -3
  92. package/node_modules/discord-api-types/package.json +4 -4
  93. package/node_modules/discord-api-types/rest/v10/index.d.ts +8 -0
  94. package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
  95. package/node_modules/discord-api-types/rest/v10/index.js +8 -0
  96. package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
  97. package/node_modules/discord-api-types/rest/v10/oauth2.d.ts +26 -2
  98. package/node_modules/discord-api-types/rest/v10/oauth2.d.ts.map +1 -1
  99. package/node_modules/discord-api-types/rest/v9/index.d.ts +8 -0
  100. package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
  101. package/node_modules/discord-api-types/rest/v9/index.js +8 -0
  102. package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
  103. package/node_modules/discord-api-types/rest/v9/oauth2.d.ts +26 -2
  104. package/node_modules/discord-api-types/rest/v9/oauth2.d.ts.map +1 -1
  105. package/node_modules/typebox/build/format/duration.d.mts +2 -2
  106. package/node_modules/typebox/build/format/duration.mjs +2 -2
  107. package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
  108. package/node_modules/typebox/build/format/idn_email.mjs +1 -0
  109. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
  110. package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
  111. package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
  112. package/node_modules/typebox/build/format/ipv4.mjs +2 -2
  113. package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
  114. package/node_modules/typebox/build/format/ipv6.mjs +1 -1
  115. package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
  116. package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
  117. package/node_modules/typebox/build/schema/build.mjs +1 -0
  118. package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
  119. package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
  120. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
  121. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
  122. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
  123. package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
  124. package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
  125. package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
  126. package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
  127. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
  128. package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
  129. package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
  130. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
  131. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
  132. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
  133. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
  134. package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
  135. package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
  136. package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
  137. package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
  138. package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
  139. package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
  140. package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
  141. package/node_modules/typebox/build/system/memory/create.mjs +18 -13
  142. package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
  143. package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
  144. package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
  145. package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
  146. package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
  147. package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
  148. package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
  149. package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
  150. package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
  151. package/node_modules/typebox/build/system/memory/update.mjs +43 -16
  152. package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
  153. package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
  154. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
  155. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
  156. package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
  157. package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
  158. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
  159. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
  160. package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
  161. package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
  162. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
  163. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
  164. package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
  165. package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
  166. package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
  167. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  168. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
  169. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
  170. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
  171. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
  172. package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
  173. package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
  174. package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
  175. package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
  176. package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
  177. package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
  178. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
  179. package/node_modules/typebox/package.json +1 -1
  180. package/node_modules/typebox/readme.md +1 -1
  181. package/node_modules/undici/docs/docs/api/Interceptors.md +15 -2
  182. package/node_modules/undici/lib/dispatcher/client-h2.js +78 -3
  183. package/node_modules/undici/lib/dispatcher/pool-base.js +20 -3
  184. package/node_modules/undici/package.json +3 -3
  185. package/node_modules/undici/types/api.d.ts +1 -1
  186. package/node_modules/undici/types/utility.d.ts +4 -4
  187. package/node_modules/uuid/package.json +17 -17
  188. package/node_modules/zod/package.json +1 -1
  189. package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  190. package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  191. package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  192. package/node_modules/zod/src/v4/core/compile.ts +9 -0
  193. package/node_modules/zod/src/v4/core/schemas.ts +35 -1
  194. package/node_modules/zod/src/v4/core/util.ts +13 -0
  195. package/node_modules/zod/src/v4/core/versions.ts +1 -1
  196. package/node_modules/zod/v4/core/compile.cjs +8 -0
  197. package/node_modules/zod/v4/core/compile.js +8 -0
  198. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  199. package/node_modules/zod/v4/core/schemas.d.cts +3 -1
  200. package/node_modules/zod/v4/core/schemas.d.ts +3 -1
  201. package/node_modules/zod/v4/core/schemas.js +30 -0
  202. package/node_modules/zod/v4/core/util.cjs +15 -0
  203. package/node_modules/zod/v4/core/util.d.cts +2 -0
  204. package/node_modules/zod/v4/core/util.d.ts +2 -0
  205. package/node_modules/zod/v4/core/util.js +14 -0
  206. package/node_modules/zod/v4/core/versions.cjs +1 -1
  207. package/node_modules/zod/v4/core/versions.js +1 -1
  208. package/openclaw.plugin.json +1 -31
  209. package/package.json +8 -8
  210. package/dist/.setup/channel-access-BPrWoEXM.mjs +0 -47
  211. package/dist/.setup/channel.setup-DVe7Y3Jf.mjs +0 -245
  212. package/dist/.setup/outbound-adapter-DWyAWBFh.mjs +0 -537
  213. package/dist/.setup/provider.runtime-BQ1z4Aq1.mjs +0 -1
  214. package/dist/.setup/setup-plugin-api-B4J6wmL1.mjs +0 -2
  215. package/dist/.setup/targets-BaklhOqq.mjs +0 -3
  216. package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
  217. package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
@@ -0,0 +1,31 @@
1
+ // extensions/discord/src/internal/components.base.ts
2
+ function parseCustomId(id) {
3
+ const [rawKey = "", ...parts] = id.split(";");
4
+ const [keyPart = "", firstValue] = rawKey.split("=");
5
+ const key = keyPart.split(":", 1)[0] ?? "";
6
+ const data = {};
7
+ const entries = firstValue === void 0 ? parts : [rawKey.slice(key.length + 1), ...parts];
8
+ for (const entry of entries) {
9
+ const index = entry.indexOf("=");
10
+ if (index < 0) continue;
11
+ const name = entry.slice(0, index).replace(/^[^:]+:/, "");
12
+ const raw = entry.slice(index + 1);
13
+ data[name] = raw === "true" ? true : raw === "false" ? false : raw;
14
+ }
15
+ return {
16
+ key,
17
+ data
18
+ };
19
+ }
20
+ function colorToNumber(value) {
21
+ if (typeof value === "number") return Number.isInteger(value) && value >= 0 && value <= 16777215 ? value : void 0;
22
+ if (typeof value === "string" && /^#?[0-9a-f]{6}$/i.test(value)) return Number.parseInt(value.replace(/^#/, ""), 16);
23
+ }
24
+ var BaseComponent = class {
25
+ constructor() {
26
+ this.isV2 = false;
27
+ }
28
+ };
29
+ var BaseMessageInteractiveComponent = class {};
30
+ var BaseModalComponent = class extends BaseComponent {};
31
+ export { parseCustomId as i, BaseModalComponent as n, colorToNumber as r, BaseMessageInteractiveComponent as t };
@@ -37,7 +37,7 @@ const discordChannelConfigUiHints = {
37
37
  }),
38
38
  "streaming.progress.toolProgress": {
39
39
  label: "Discord Progress Tool Lines",
40
- help: "Show the detailed rolling tool log (default: false). Work status, delegated-task states, plans, and authored progress remain visible without it. Set streaming.mode to off for quiet final-only delivery."
40
+ help: "Show the detailed rolling tool log and delegated-task lifecycle rows (default: false). The editable work message, plans, and authored progress remain visible without it. Set streaming.mode to off for quiet final-only delivery."
41
41
  },
42
42
  joinIntro: {
43
43
  label: "Discord Guild Join Introduction",
@@ -352,11 +352,6 @@ const DiscordIdSchema = z.union([z.string(), z.number()]).transform((value, ctx)
352
352
  }).pipe(z.string());
353
353
  const DiscordIdListSchema = z.array(DiscordIdSchema);
354
354
  const DiscordSnowflakeStringSchema = z.string().regex(/^\d+$/, "Discord user ID must be numeric");
355
- const DiscordDmSchema = z.object({
356
- enabled: z.boolean().optional(),
357
- groupEnabled: z.boolean().optional(),
358
- groupChannels: DiscordIdListSchema.optional()
359
- }).strict();
360
355
  const DiscordPresenceEventsSchema = z.object({
361
356
  enabled: z.boolean().optional(),
362
357
  channelId: DiscordSnowflakeStringSchema,
@@ -473,11 +468,15 @@ const DiscordVoiceSchema = z.object({
473
468
  captureSilenceGraceMs: z.number().int().positive().max(3e4).optional(),
474
469
  tts: TtsConfigSchema.optional()
475
470
  }).strict().optional();
476
- const { accountShape, rootPolicyShape } = buildChannelAccountSchemaParts({
471
+ const { accountShape, rootPolicyShape, groupDmShape } = buildChannelAccountSchemaParts({
477
472
  omit: ["groupAllowFrom"],
478
473
  allowFrom: DiscordIdListSchema.optional(),
479
474
  streaming: ChannelPreviewStreamingConfigSchema.optional()
480
475
  });
476
+ const DiscordDmSchema = z.strictObject({
477
+ ...groupDmShape,
478
+ groupChannels: DiscordIdListSchema.optional()
479
+ });
481
480
  const DiscordAccountSchemaBase = z.object({
482
481
  ...accountShape,
483
482
  joinIntro: z.boolean().optional(),
@@ -1,4 +1,4 @@
1
- import { _ as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-TFBPPkoz.mjs";
1
+ import { g as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-Cb8cv4Oi.mjs";
2
2
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
3
3
  import { inspectRuntimeConversationBindingRoute, resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRouteAsync } from "openclaw/plugin-sdk/conversation-binding-runtime";
4
4
  // extensions/discord/src/monitor/conversation-binding-route.ts
@@ -10,7 +10,7 @@ function prepareDiscordBindingRoute(params) {
10
10
  baseRoute = params.resolveRoute(selection);
11
11
  return baseRoute;
12
12
  },
13
- touchBinding: params.touchBinding,
13
+ touchBinding: false,
14
14
  conversation: {
15
15
  channel: "discord",
16
16
  accountId: params.accountId,
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
2
- import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-C18HNgge.mjs";
2
+ import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-DtjvhJUj.mjs";
3
3
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
4
4
  import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
5
5
  // extensions/discord/src/directory-config.ts
@@ -1,9 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
2
- import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-C18HNgge.mjs";
3
- import { o as normalizeDiscordSlug } from "./allow-list-D1ZGfhXh.mjs";
4
- import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-Bth1wKF9.mjs";
2
+ import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-DtjvhJUj.mjs";
3
+ import { o as normalizeDiscordSlug } from "./allow-list-DahA0Jxh.mjs";
4
+ import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-Bp0HI4q3.mjs";
5
+ import { n as listGuilds, r as searchDiscordGuildMembers, t as listDiscordGuildChannels } from "./guilds-DQucP5Tn.mjs";
5
6
  import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
6
7
  import { normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
8
+ import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
7
9
  // extensions/discord/src/directory-cache-state.ts
8
10
  const discordDirectoryCacheState = { handlesByAccount: /* @__PURE__ */ new Map() };
9
11
  // extensions/discord/src/directory-cache.ts
@@ -30,11 +32,10 @@ function ensureAccountCache(accountId) {
30
32
  return created;
31
33
  }
32
34
  function setCacheEntry(cache, key, userId) {
35
+ const previous = cache.get(key);
33
36
  cache.delete(key);
34
- cache.set(key, userId);
35
- if (cache.size <= DISCORD_DIRECTORY_CACHE_MAX_ENTRIES) return;
36
- const oldest = cache.keys().next();
37
- if (!oldest.done) cache.delete(oldest.value);
37
+ cache.set(key, previous === void 0 || previous === userId ? userId : null);
38
+ pruneMapToMaxSize(cache, DISCORD_DIRECTORY_CACHE_MAX_ENTRIES);
38
39
  }
39
40
  function rememberDiscordDirectoryUser(params) {
40
41
  const userId = normalizeDiscordSnowflake(params.userId);
@@ -54,11 +55,7 @@ function resolveDiscordDirectoryUserId(params) {
54
55
  if (!cache) return;
55
56
  const handle = normalizeDiscordHandleKey(params.handle);
56
57
  if (!handle) return;
57
- const direct = cache.get(handle);
58
- if (direct) return direct;
59
- const withoutDiscriminator = handle.replace(DISCORD_DISCRIMINATOR_SUFFIX, "");
60
- if (!withoutDiscriminator || withoutDiscriminator === handle) return;
61
- return cache.get(withoutDiscriminator);
58
+ return cache.get(handle) ?? void 0;
62
59
  }
63
60
  // extensions/discord/src/directory-live.ts
64
61
  var directory_live_exports = /* @__PURE__ */ __exportAll({
@@ -78,63 +75,59 @@ function resolveDiscordDirectoryAccess(params) {
78
75
  accountId: account.accountId
79
76
  };
80
77
  }
81
- async function listDiscordGuilds(token) {
82
- return (await fetchDiscord("/users/@me/guilds", token, fetch, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS })).filter((guild) => guild.id && guild.name);
83
- }
84
78
  async function listDiscordDirectoryLive(params, kind) {
85
79
  const access = resolveDiscordDirectoryAccess(params);
86
80
  if (!access || kind === "user" && !access.query) return [];
87
81
  const { token, query, accountId } = access;
88
- const guilds = await listDiscordGuilds(token);
82
+ const guilds = await listGuilds(token, fetch, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
89
83
  const rows = [];
90
84
  const seenUserIds = /* @__PURE__ */ new Set();
91
85
  const limit = kind === "user" && typeof params.limit === "number" && params.limit > 0 ? params.limit : 25;
92
- for (const guild of guilds) if (kind === "group") {
93
- const channels = await fetchDiscord(`/guilds/${guild.id}/channels`, token, fetch, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
94
- for (const channel of channels) {
95
- const name = channel.name?.trim();
96
- if (!name) continue;
97
- if (query && !normalizeDiscordSlug(name).includes(normalizeDiscordSlug(query))) continue;
98
- rows.push({
99
- kind: "group",
100
- id: `channel:${channel.id}`,
101
- name,
102
- handle: `#${name}`,
103
- raw: channel
104
- });
105
- if (typeof params.limit === "number" && params.limit > 0 && rows.length >= params.limit) return rows;
106
- }
107
- } else {
108
- const paramsObj = new URLSearchParams({
109
- query,
110
- limit: String(Math.min(limit, 100))
111
- });
112
- const members = await fetchDiscord(`/guilds/${guild.id}/members/search?${paramsObj.toString()}`, token, fetch, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
113
- for (const member of members) {
114
- const user = member.user;
115
- if (!user?.id) continue;
116
- rememberDiscordDirectoryUser({
117
- accountId,
118
- userId: user.id,
119
- handles: [
120
- user.username,
121
- user.global_name,
122
- member.nick,
123
- user.username ? `@${user.username}` : null
124
- ]
125
- });
126
- if (seenUserIds.has(user.id)) continue;
127
- seenUserIds.add(user.id);
128
- const name = member.nick?.trim() || user.global_name?.trim() || user.username?.trim();
129
- rows.push({
130
- kind: "user",
131
- id: `user:${user.id}`,
132
- name: name || void 0,
133
- handle: user.username ? `@${user.username}` : void 0,
134
- rank: user.bot ? 0 : 1,
135
- raw: member
136
- });
137
- if (rows.length >= limit) return rows;
86
+ for (const guild of guilds) {
87
+ if (!guild.id || !guild.name) continue;
88
+ if (kind === "group") {
89
+ const channels = await listDiscordGuildChannels(token, fetch, guild.id);
90
+ for (const channel of channels) {
91
+ const name = channel.name?.trim();
92
+ if (!name) continue;
93
+ if (query && !normalizeDiscordSlug(name).includes(normalizeDiscordSlug(query))) continue;
94
+ rows.push({
95
+ kind: "group",
96
+ id: `channel:${channel.id}`,
97
+ name,
98
+ handle: `#${name}`,
99
+ raw: channel
100
+ });
101
+ if (typeof params.limit === "number" && params.limit > 0 && rows.length >= params.limit) return rows;
102
+ }
103
+ } else {
104
+ const members = await searchDiscordGuildMembers(token, fetch, guild.id, query, Math.min(limit, 100));
105
+ for (const member of members) {
106
+ const user = member.user;
107
+ if (!user?.id) continue;
108
+ rememberDiscordDirectoryUser({
109
+ accountId,
110
+ userId: user.id,
111
+ handles: [
112
+ user.username,
113
+ user.global_name,
114
+ member.nick,
115
+ user.username ? `@${user.username}` : null
116
+ ]
117
+ });
118
+ if (seenUserIds.has(user.id)) continue;
119
+ seenUserIds.add(user.id);
120
+ const name = member.nick?.trim() || user.global_name?.trim() || user.username?.trim();
121
+ rows.push({
122
+ kind: "user",
123
+ id: `user:${user.id}`,
124
+ name: name || void 0,
125
+ handle: user.username ? `@${user.username}` : void 0,
126
+ rank: user.bot ? 0 : 1,
127
+ raw: member
128
+ });
129
+ if (rows.length >= limit) return rows;
130
+ }
138
131
  }
139
132
  }
140
133
  return rows;