@openclaw/discord 2026.11.3 → 2026.11.5-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.
- package/dist/.setup/{account-inspect-8cCu6uPG.mjs → account-inspect-DGkdWwix.mjs} +1 -1
- package/dist/.setup/{accounts-ljrzXBJi.mjs → accounts-C_25wyxC.mjs} +9 -6
- package/dist/.setup/{active-turn-thread-route-C4tp9noA.mjs → active-turn-thread-route-KvRTAVE3.mjs} +1 -2
- package/dist/.setup/{allow-list-BKqOldGy.mjs → allow-list-BXrS8-R9.mjs} +4 -152
- package/dist/.setup/{api-DqmMUZau.mjs → api-BlBD4ism.mjs} +10 -20
- package/dist/.setup/{approval-handler.runtime-D0qu1um7.mjs → approval-handler.runtime-BGYjX1t9.mjs} +80 -61
- package/dist/.setup/{approval-message-updates-CdurC9Ej.mjs → approval-message-updates-DKsCfxSW.mjs} +2 -2
- package/dist/.setup/{audit-ChorIwio.mjs → audit-5b-FXj9R.mjs} +4 -4
- package/dist/.setup/{channel-ZilgdF5e.mjs → channel-CWwTHWFo.mjs} +134 -202
- package/dist/.setup/channel-access-9cyzozUP.mjs +24 -0
- package/dist/.setup/channel.setup-B3MtmBQG.mjs +238 -0
- package/dist/.setup/{components-Du9NhD8h.mjs → components-YCvQ6YLS.mjs} +209 -430
- package/dist/.setup/components.base-CiS0h_XP.mjs +32 -0
- package/dist/.setup/{config-schema-_uBILpQf.mjs → config-schema-BNKN1cu5.mjs} +6 -7
- package/dist/.setup/{conversation-binding-route-8Ul1KpGF.mjs → conversation-binding-route-kCTw8cij.mjs} +2 -2
- package/dist/.setup/{directory-config-3iVub-3m.mjs → directory-config-Ble81PWH.mjs} +1 -1
- package/dist/.setup/{directory-live-BDVl2DoC.mjs → directory-live-DH3tpS3x.mjs} +52 -57
- package/dist/.setup/{discord-BMD-JiVS.mjs → discord-DGVSguhx.mjs} +1124 -1710
- package/dist/.setup/{doctor-hQKbkNKq.mjs → doctor-eujgbnpZ.mjs} +3 -5
- package/dist/.setup/endpoint-runtime-lf4DeLas.mjs +139 -0
- package/dist/.setup/guilds-eDq22iSM.mjs +22 -0
- package/dist/.setup/{handle-action-B1lmt4ms.mjs → handle-action-CktwmzMz.mjs} +15 -15
- package/dist/.setup/{handle-action.guild-admin-B6g31cwt.mjs → handle-action.guild-admin-WLQ7fRqI.mjs} +5 -5
- package/dist/.setup/listeners-Df8lx3vK.mjs +47 -0
- package/dist/.setup/{live-policy-config-C_Q966Wh.mjs → live-policy-config-DiBVuaU6.mjs} +2 -3
- package/dist/.setup/{message-handler-CkI3yMjL.mjs → message-handler-hhNSioxo.mjs} +154 -115
- package/dist/.setup/{message-handler.preflight-CEfkFV9U.mjs → message-handler.preflight-BZcZE1o-.mjs} +30 -105
- package/dist/.setup/{message-handler.preflight-pluralkit-D5si80_L.mjs → message-handler.preflight-pluralkit-CYZfXXb6.mjs} +9 -22
- package/dist/.setup/{message-handler.process-DsMtetRf.mjs → message-handler.process-B0n-mQ99.mjs} +256 -373
- package/dist/.setup/outbound-payload-BaZmjewa.mjs +447 -0
- package/dist/.setup/{outbound-session-route-BtUpGBTb.mjs → outbound-session-route-Cgx4i9cS.mjs} +139 -86
- package/dist/.setup/{preflight-audio-wWgsZG5F.mjs → preflight-audio-C6QtD6HX.mjs} +1 -5
- package/dist/.setup/{presence-cache-DCeTsL73.mjs → presence-cache-Dq-3nH7R.mjs} +1 -6
- package/dist/.setup/{probe-CBaoCs-c.mjs → probe-DezB-6xz.mjs} +5 -9
- package/dist/.setup/{provider-CI_OLfvz.mjs → provider-BN2bCIUp.mjs} +3440 -4308
- package/dist/.setup/{provider-session.runtime-TWOo_JZx.mjs → provider-session.runtime-Dr_5X43t.mjs} +3 -3
- package/dist/.setup/provider.runtime-BuJpl0Pv.mjs +1 -0
- package/dist/.setup/proxy-fetch-BzXwBAXt.mjs +30 -0
- package/dist/.setup/{realtime-session.runtime-DvfS4vJj.mjs → realtime-session.runtime-BTDWsV4d.mjs} +44 -81
- package/dist/.setup/{receive-recovery-CKvaG2Hf.mjs → receive-recovery-C3Ks4wAQ.mjs} +13 -27
- package/dist/.setup/{resolve-allowlist-common-cIjtqh2F.mjs → resolve-allowlist-common-Bk8Fj6Ik.mjs} +3 -13
- package/dist/.setup/{resolve-channels-Cj5i7hzj.mjs → resolve-channels-Bp8frXvc.mjs} +7 -8
- package/dist/.setup/{resolve-users-BQLbysRB.mjs → resolve-users-Cvcj22sG.mjs} +4 -7
- package/dist/.setup/{runtime-RWnuJgWB.mjs → runtime-BJaCvlmq.mjs} +196 -239
- package/dist/.setup/{runtime-plifsKg9.mjs → runtime-BMgTyuwg.mjs} +6 -6
- package/dist/.setup/{secret-config-contract-z6FhbT8E.mjs → secret-config-contract-B1kE4sDv.mjs} +4 -9
- package/dist/.setup/{send-da6ENJ9f.mjs → send-CVW7V-VZ.mjs} +149 -175
- package/dist/.setup/{send.components-CWZUuGvA.mjs → send.components-C8YXdnO_.mjs} +59 -71
- package/dist/.setup/{send.outbound-qZ3iK3Vq.mjs → send.outbound-Uzcmh3Yd.mjs} +76 -129
- package/dist/.setup/{send.receipt-C18khRYH.mjs → send.receipt-NZDOTZBU.mjs} +30 -32
- package/dist/.setup/{send.shared-CnlMgoqQ.mjs → send.shared-a_6Oeyg1.mjs} +38 -115
- package/dist/.setup/{sender-identity-DgbJykq0.mjs → sender-identity-76HFb8eK.mjs} +3 -9
- package/dist/.setup/setup-plugin-api-BExhGEhL.mjs +2 -0
- package/dist/.setup/shared-interactive-DmzaoKOM.mjs +316 -0
- package/dist/.setup/{shared-CY5vJM48.mjs → shared-yDUSExm2.mjs} +8 -11
- package/dist/.setup/{subagent-hooks-CIu2TFz3.mjs → subagent-hooks-CDkdHQyy.mjs} +1 -1
- package/dist/.setup/{system-events-DCOLXkwS.mjs → system-events-yfWz150v.mjs} +2 -2
- package/dist/.setup/{target-resolver-CApivu3G.mjs → target-resolver-BOOzqxxM.mjs} +3 -3
- package/dist/.setup/{thread-bindings-DcvT_JgI.mjs → thread-bindings-zce4cpu_.mjs} +12 -20
- package/dist/.setup/{thread-bindings.manager-5Sh7yedN.mjs → thread-bindings.manager-NywKzUtc.mjs} +22 -42
- package/dist/.setup/{thread-bindings.session-updates-BMdJeJMc.mjs → thread-bindings.session-updates-D0j7oh8S.mjs} +11 -18
- package/dist/.setup/{threading-CzjFeUSe.mjs → threading-DodLYDt-.mjs} +68 -105
- package/dist/.setup/{timeouts-CuNARfyw.mjs → timeouts-cIxzatmv.mjs} +1 -1
- package/dist/.setup/{transcripts-source-8RDQrSVb.mjs → transcripts-source-ie9GBWaU.mjs} +110 -179
- package/dist/.setup/{voice-runtime-BsDILmAv.mjs → voice-runtime-B7V_LTdX.mjs} +231 -452
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -2
- package/dist/activities-api.js +286 -341
- package/dist/api.js +16 -16
- package/dist/channel-config-api.js +1 -2
- package/dist/channel-plugin-api.js +1 -2
- package/dist/contract-api.js +1 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +1 -2
- package/dist/secret-contract-api.js +1 -2
- package/dist/security-audit-contract-api.js +1 -2
- package/dist/security-contract-api.js +1 -2
- package/dist/session-key-api.js +1 -2
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -2
- package/dist/src/voice/audio-worker.runtime.js +56 -68
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/thread-binding-api.js +1 -2
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +3339 -4021
- package/node_modules/@napi-rs/wasm-runtime/package.json +1 -1
- package/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@types/lodash/common/function.d.ts +2 -2
- package/node_modules/@types/lodash/package.json +2 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/discord-api-types/package.json +4 -4
- package/node_modules/discord-api-types/rest/v10/index.d.ts +8 -0
- package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/index.js +8 -0
- package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/oauth2.d.ts +26 -2
- package/node_modules/discord-api-types/rest/v10/oauth2.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.d.ts +8 -0
- package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.js +8 -0
- package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v9/oauth2.d.ts +26 -2
- package/node_modules/discord-api-types/rest/v9/oauth2.d.ts.map +1 -1
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/node_modules/undici/docs/docs/api/Interceptors.md +15 -2
- package/node_modules/undici/lib/dispatcher/client-h2.js +78 -3
- package/node_modules/undici/lib/dispatcher/pool-base.js +20 -3
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/api.d.ts +1 -1
- package/node_modules/undici/types/utility.d.ts +4 -4
- package/node_modules/uuid/package.json +17 -17
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/openclaw.plugin.json +1 -31
- package/package.json +8 -8
- package/dist/.setup/channel-access-DasWY_OV.mjs +0 -48
- package/dist/.setup/channel.setup-DaDQdctj.mjs +0 -249
- package/dist/.setup/outbound-adapter-DfAanoCO.mjs +0 -543
- package/dist/.setup/provider.runtime-DnionCyo.mjs +0 -2
- package/dist/.setup/setup-plugin-api-D1QuM187.mjs +0 -3
- package/dist/.setup/targets-UWWZ6gF7.mjs +0 -3
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region 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
|
+
//#endregion
|
|
32
|
+
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).
|
|
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",
|
|
@@ -353,11 +353,6 @@ const DiscordIdSchema = z.union([z.string(), z.number()]).transform((value, ctx)
|
|
|
353
353
|
}).pipe(z.string());
|
|
354
354
|
const DiscordIdListSchema = z.array(DiscordIdSchema);
|
|
355
355
|
const DiscordSnowflakeStringSchema = z.string().regex(/^\d+$/, "Discord user ID must be numeric");
|
|
356
|
-
const DiscordDmSchema = z.object({
|
|
357
|
-
enabled: z.boolean().optional(),
|
|
358
|
-
groupEnabled: z.boolean().optional(),
|
|
359
|
-
groupChannels: DiscordIdListSchema.optional()
|
|
360
|
-
}).strict();
|
|
361
356
|
const DiscordPresenceEventsSchema = z.object({
|
|
362
357
|
enabled: z.boolean().optional(),
|
|
363
358
|
channelId: DiscordSnowflakeStringSchema,
|
|
@@ -474,11 +469,15 @@ const DiscordVoiceSchema = z.object({
|
|
|
474
469
|
captureSilenceGraceMs: z.number().int().positive().max(3e4).optional(),
|
|
475
470
|
tts: TtsConfigSchema.optional()
|
|
476
471
|
}).strict().optional();
|
|
477
|
-
const { accountShape, rootPolicyShape } = buildChannelAccountSchemaParts({
|
|
472
|
+
const { accountShape, rootPolicyShape, groupDmShape } = buildChannelAccountSchemaParts({
|
|
478
473
|
omit: ["groupAllowFrom"],
|
|
479
474
|
allowFrom: DiscordIdListSchema.optional(),
|
|
480
475
|
streaming: ChannelPreviewStreamingConfigSchema.optional()
|
|
481
476
|
});
|
|
477
|
+
const DiscordDmSchema = z.strictObject({
|
|
478
|
+
...groupDmShape,
|
|
479
|
+
groupChannels: DiscordIdListSchema.optional()
|
|
480
|
+
});
|
|
482
481
|
const DiscordAccountSchemaBase = z.object({
|
|
483
482
|
...accountShape,
|
|
484
483
|
joinIntro: z.boolean().optional(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-Cgx4i9cS.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
|
//#region 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:
|
|
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-B4FMCO8f.mjs";
|
|
2
|
-
import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
2
|
+
import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
|
|
3
3
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
5
5
|
//#region extensions/discord/src/directory-config.ts
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-C_25wyxC.mjs";
|
|
3
|
+
import { o as normalizeDiscordSlug } from "./allow-list-BXrS8-R9.mjs";
|
|
4
|
+
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BlBD4ism.mjs";
|
|
5
|
+
import { n as listGuilds, r as searchDiscordGuildMembers, t as listDiscordGuildChannels } from "./guilds-eDq22iSM.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
|
//#region extensions/discord/src/directory-cache-state.ts
|
|
8
10
|
const discordDirectoryCacheState = { handlesByAccount: /* @__PURE__ */ new Map() };
|
|
9
11
|
//#endregion
|
|
@@ -34,9 +36,7 @@ function setCacheEntry(cache, key, userId) {
|
|
|
34
36
|
const previous = cache.get(key);
|
|
35
37
|
cache.delete(key);
|
|
36
38
|
cache.set(key, previous === void 0 || previous === userId ? userId : null);
|
|
37
|
-
|
|
38
|
-
const oldest = cache.keys().next();
|
|
39
|
-
if (!oldest.done) cache.delete(oldest.value);
|
|
39
|
+
pruneMapToMaxSize(cache, DISCORD_DIRECTORY_CACHE_MAX_ENTRIES);
|
|
40
40
|
}
|
|
41
41
|
function rememberDiscordDirectoryUser(params) {
|
|
42
42
|
const userId = normalizeDiscordSnowflake(params.userId);
|
|
@@ -77,64 +77,59 @@ function resolveDiscordDirectoryAccess(params) {
|
|
|
77
77
|
accountId: account.accountId
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
-
async function listDiscordGuilds(token) {
|
|
81
|
-
return (await fetchDiscord("/users/@me/guilds", token, fetch, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS })).filter((guild) => guild.id && guild.name);
|
|
82
|
-
}
|
|
83
80
|
async function listDiscordDirectoryLive(params, kind) {
|
|
84
81
|
const access = resolveDiscordDirectoryAccess(params);
|
|
85
82
|
if (!access || kind === "user" && !access.query) return [];
|
|
86
83
|
const { token, query, accountId } = access;
|
|
87
|
-
const
|
|
88
|
-
const guilds = await listDiscordGuilds(token);
|
|
84
|
+
const guilds = await listGuilds(token, fetch, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
|
|
89
85
|
const rows = [];
|
|
90
86
|
const seenUserIds = /* @__PURE__ */ new Set();
|
|
91
87
|
const limit = kind === "user" && typeof params.limit === "number" && params.limit > 0 ? params.limit : 25;
|
|
92
|
-
for (const guild of guilds)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
if (rows.length >= limit) return rows;
|
|
88
|
+
for (const guild of guilds) {
|
|
89
|
+
if (!guild.id || !guild.name) continue;
|
|
90
|
+
if (kind === "group") {
|
|
91
|
+
const channels = await listDiscordGuildChannels(token, fetch, guild.id);
|
|
92
|
+
for (const channel of channels) {
|
|
93
|
+
const name = channel.name?.trim();
|
|
94
|
+
if (!name) continue;
|
|
95
|
+
if (query && !normalizeDiscordSlug(name).includes(normalizeDiscordSlug(query))) continue;
|
|
96
|
+
rows.push({
|
|
97
|
+
kind: "group",
|
|
98
|
+
id: `channel:${channel.id}`,
|
|
99
|
+
name,
|
|
100
|
+
handle: `#${name}`,
|
|
101
|
+
raw: channel
|
|
102
|
+
});
|
|
103
|
+
if (typeof params.limit === "number" && params.limit > 0 && rows.length >= params.limit) return rows;
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
const members = await searchDiscordGuildMembers(token, fetch, guild.id, query, Math.min(limit, 100));
|
|
107
|
+
for (const member of members) {
|
|
108
|
+
const user = member.user;
|
|
109
|
+
if (!user?.id) continue;
|
|
110
|
+
rememberDiscordDirectoryUser({
|
|
111
|
+
accountId,
|
|
112
|
+
userId: user.id,
|
|
113
|
+
handles: [
|
|
114
|
+
user.username,
|
|
115
|
+
user.global_name,
|
|
116
|
+
member.nick,
|
|
117
|
+
user.username ? `@${user.username}` : null
|
|
118
|
+
]
|
|
119
|
+
});
|
|
120
|
+
if (seenUserIds.has(user.id)) continue;
|
|
121
|
+
seenUserIds.add(user.id);
|
|
122
|
+
const name = member.nick?.trim() || user.global_name?.trim() || user.username?.trim();
|
|
123
|
+
rows.push({
|
|
124
|
+
kind: "user",
|
|
125
|
+
id: `user:${user.id}`,
|
|
126
|
+
name: name || void 0,
|
|
127
|
+
handle: user.username ? `@${user.username}` : void 0,
|
|
128
|
+
rank: user.bot ? 0 : 1,
|
|
129
|
+
raw: member
|
|
130
|
+
});
|
|
131
|
+
if (rows.length >= limit) return rows;
|
|
132
|
+
}
|
|
138
133
|
}
|
|
139
134
|
}
|
|
140
135
|
return rows;
|