@openclaw/discord 2026.11.8 → 2026.11.9
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-DGkdWwix.mjs → account-inspect-CSz5Qodj.mjs} +2 -3
- package/dist/.setup/{accounts-C_25wyxC.mjs → accounts-DtjvhJUj.mjs} +4 -8
- package/dist/.setup/{active-turn-thread-route-KvRTAVE3.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
- package/dist/.setup/{allow-list-C3j0qLDp.mjs → allow-list-CkqpzPvP.mjs} +4 -8
- package/dist/.setup/{api-DYRggUgK.mjs → api-C4j_kC-2.mjs} +4 -6
- package/dist/.setup/{approval-handler.runtime-eKrSqVPF.mjs → approval-handler.runtime-bB4eKcGl.mjs} +9 -10
- package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs} +3 -4
- package/dist/.setup/{audit-DZLJ0my1.mjs → audit-D1UISAXW.mjs} +6 -7
- package/dist/.setup/{channel-access-9cyzozUP.mjs → channel-access-DhJhVrdZ.mjs} +1 -2
- package/dist/.setup/{channel-COE1KIJz.mjs → channel-i4V5w1Nh.mjs} +32 -39
- package/dist/.setup/{channel.setup-B4SQu9Qg.mjs → channel.setup-BrGEJ0Ia.mjs} +7 -10
- package/dist/.setup/{command-deploy-store-DFkBTViB.mjs → command-deploy-store-DPWiBMks.mjs} +1 -2
- package/dist/.setup/{command-owners-C7rUdqUX.mjs → command-owners-BzlhNBxA.mjs} +1 -2
- package/dist/.setup/{components-Cy4hDa6J.mjs → components-DeCLO9w0.mjs} +10 -16
- package/dist/.setup/{components.base-CiS0h_XP.mjs → components.base-C5sAPHe4.mjs} +1 -2
- package/dist/.setup/{config-schema-BNKN1cu5.mjs → config-schema-GX2yDgIH.mjs} +3 -5
- package/dist/.setup/{conversation-binding-route-Cy_QeEBm.mjs → conversation-binding-route-CHCfhsCl.mjs} +2 -3
- package/dist/.setup/{directory-config-Ble81PWH.mjs → directory-config-BXJuh9-J.mjs} +3 -4
- package/dist/.setup/{directory-live-DOVK9G9P.mjs → directory-live-dzJ14-DT.mjs} +7 -8
- package/dist/.setup/{discord-KsHAulAQ.mjs → discord-BGkLzt2b.mjs} +28 -52
- package/dist/.setup/{doctor-CQescbAS.mjs → doctor-DBBXoP9w.mjs} +7 -8
- package/dist/.setup/{doctor-contract-Bwv8EuQ_.mjs → doctor-contract-Dstl3cMg.mjs} +2 -3
- package/dist/.setup/{endpoint-runtime-lf4DeLas.mjs → endpoint-runtime-BM3x-m6O.mjs} +1 -2
- package/dist/.setup/{guilds-BSnrns-F.mjs → guilds-DYBhgnfq.mjs} +3 -4
- package/dist/.setup/{handle-action-BfSo0qkY.mjs → handle-action-Dx2N-4A6.mjs} +10 -11
- package/dist/.setup/{handle-action.guild-admin-BOzk0kPz.mjs → handle-action.guild-admin-CGzsE3bM.mjs} +3 -4
- package/dist/.setup/{listeners-C0-BvUVA.mjs → listeners-DHjDOlXW.mjs} +2 -3
- package/dist/.setup/{live-policy-config-y0Qy36X3.mjs → live-policy-config-DjIHWFla.mjs} +3 -5
- package/dist/.setup/{message-handler-h8xpc_1a.mjs → message-handler-OqhwO2Il.mjs} +11 -15
- package/dist/.setup/{message-handler.preflight-CO1JNXKw.mjs → message-handler.preflight-DaqozzfW.mjs} +20 -43
- package/dist/.setup/{message-handler.preflight-pluralkit-C4FSmp6X.mjs → message-handler.preflight-pluralkit-CPWdqrEU.mjs} +10 -14
- package/dist/.setup/{message-handler.process-IPQv14En.mjs → message-handler.process-C6ETXKq2.mjs} +26 -34
- package/dist/.setup/{outbound-payload-Pz-zEQnX.mjs → outbound-payload-DOFjmMNE.mjs} +9 -11
- package/dist/.setup/{outbound-session-route-CpweCkxm.mjs → outbound-session-route-CzL157kC.mjs} +22 -34
- package/dist/.setup/{output-activity-uBpMSX75.mjs → output-activity-CDgs2s3O.mjs} +1 -2
- package/dist/.setup/{pluralkit-B64dfq_j.mjs → pluralkit-DcXbHTpQ.mjs} +2 -3
- package/dist/.setup/{preflight-audio-C6QtD6HX.mjs → preflight-audio-r4BbaJxh.mjs} +1 -2
- package/dist/.setup/{presence-cache-Dq-3nH7R.mjs → presence-cache-B3xj3b0l.mjs} +1 -2
- package/dist/.setup/{probe-CbDJojNV.mjs → probe-CfGMZwFD.mjs} +5 -6
- package/dist/.setup/{provider-D9dwCcy8.mjs → provider-BcSZ6vqo.mjs} +109 -185
- package/dist/.setup/{provider-session.runtime-pCvFOgHs.mjs → provider-session.runtime-CxGNqH7Q.mjs} +3 -3
- package/dist/.setup/provider.runtime-DPhNybGw.mjs +1 -0
- package/dist/.setup/{proxy-fetch-BzXwBAXt.mjs → proxy-fetch-B8cK6FLQ.mjs} +1 -2
- package/dist/.setup/{realtime-session.runtime-CP8Opnfr.mjs → realtime-session.runtime-Carw2Z1J.mjs} +15 -25
- package/dist/.setup/{receive-recovery-C3Ks4wAQ.mjs → receive-recovery-DV_v5ROf.mjs} +3 -6
- package/dist/.setup/{resolve-allowlist-common-B-S0wRIw.mjs → resolve-allowlist-common-CYdqBUgV.mjs} +3 -4
- package/dist/.setup/{resolve-channels-g16NM6Ho.mjs → resolve-channels-BNnyfCR8.mjs} +6 -7
- package/dist/.setup/{resolve-users-DAfOOXdy.mjs → resolve-users-CDMAGrzv.mjs} +5 -6
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime-BMgTyuwg.mjs → runtime-B-PgPsGR.mjs} +4 -6
- package/dist/.setup/{runtime-BRcmFvOV.mjs → runtime-BJxDx_zr.mjs} +18 -26
- package/dist/.setup/{runtime-DgnVQ7zW.mjs → runtime-DcBvHOm1.mjs} +1 -2
- package/dist/.setup/{runtime-doctor-migrations-BPV-R4G9.mjs → runtime-doctor-migrations-BpV1jKk0.mjs} +5 -9
- package/dist/.setup/{secret-config-contract-B1kE4sDv.mjs → secret-config-contract-CP6teHec.mjs} +1 -2
- package/dist/.setup/{security-audit-BFT84Uny.mjs → security-audit-CTwisG7c.mjs} +3 -4
- package/dist/.setup/{security-contract-DNyyjTZZ.mjs → security-contract-D-o0iWDk.mjs} +1 -2
- package/dist/.setup/{security-doctor-nGgPm65L.mjs → security-doctor-4s7omTZd.mjs} +1 -2
- package/dist/.setup/{send-DXPqEgjA.mjs → send-BQtMCED2.mjs} +19 -28
- package/dist/.setup/{send.components-MUCtA6qV.mjs → send.components-BTjOU5BX.mjs} +11 -14
- package/dist/.setup/{send.outbound-70KlFdzN.mjs → send.outbound-izfb48w-.mjs} +10 -15
- package/dist/.setup/{send.receipt-DkCkAjRL.mjs → send.receipt-D0vpuJMr.mjs} +11 -20
- package/dist/.setup/{send.shared-BXWCIkfx.mjs → send.shared-BVJkIe93.mjs} +12 -18
- package/dist/.setup/{sender-identity-BbA7FNbr.mjs → sender-identity-Dt5ELjRN.mjs} +2 -3
- package/dist/.setup/{session-contract-BO5tlIdl.mjs → session-contract-Bq71MS78.mjs} +1 -2
- package/dist/.setup/{session-key-normalization-CCHGNSQw.mjs → session-key-normalization-Cfvze5hd.mjs} +1 -2
- package/dist/.setup/setup-plugin-api-DCiNtEra.mjs +2 -0
- package/dist/.setup/{shared-G2-0EUo3.mjs → shared-djlPz0hY.mjs} +14 -17
- package/dist/.setup/{shared-interactive-DmzaoKOM.mjs → shared-interactive-DKBw4SNV.mjs} +7 -12
- package/dist/.setup/{subagent-hooks-BUvQ4Oj4.mjs → subagent-hooks-BTmMGFYh.mjs} +3 -4
- package/dist/.setup/{system-events-CYFu0Vp4.mjs → system-events-LN3PXCia.mjs} +3 -4
- package/dist/.setup/{target-parsing-C-HyNxcE.mjs → target-parsing-BiuhcK9Q.mjs} +1 -2
- package/dist/.setup/{target-resolver-54k9fO6u.mjs → target-resolver-C98DQ-sp.mjs} +6 -7
- package/dist/.setup/{thread-binding-api-BDZJD4na.mjs → thread-binding-api-Drd4Zu-5.mjs} +1 -2
- package/dist/.setup/{thread-bindings-BiO6_GA2.mjs → thread-bindings-ESkVljSW.mjs} +7 -10
- package/dist/.setup/{thread-bindings.manager-CadGpkjc.mjs → thread-bindings.manager-BG7MMT7H.mjs} +15 -20
- package/dist/.setup/{thread-bindings.session-updates-B4iJqhAn.mjs → thread-bindings.session-updates-Ddn14oJa.mjs} +6 -10
- package/dist/.setup/{threading-Bem-g91c.mjs → threading-BzxVQcv8.mjs} +5 -7
- package/dist/.setup/{timeouts-cIxzatmv.mjs → timeouts-CT9hnmo4.mjs} +1 -2
- package/dist/.setup/{transcripts-source-DUL7GRxU.mjs → transcripts-source-a1btN-pC.mjs} +20 -33
- package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
- package/dist/.setup/{voice-runtime-D0TWfWJO.mjs → voice-runtime-BI76hQQH.mjs} +28 -46
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +2 -3
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +9 -13
- package/dist/api.js +21 -22
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/directory-contract-api.js +2 -3
- package/dist/doctor-contract-api.js +5 -7
- package/dist/index.js +1 -2
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-entry.js +2 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +8 -14
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/transcripts-source-api.js +2 -3
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-DTEY_Gvi.mjs +0 -1
- package/dist/.setup/setup-plugin-api-Dj04bzEC.mjs +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-
|
|
3
|
-
import { a as normalizeDiscordDisplaySlug } from "./allow-list-
|
|
4
|
-
import { f as rememberDiscordDirectoryUser } from "./send.receipt-
|
|
5
|
-
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
6
|
-
import { n as listGuilds, r as searchDiscordGuildMembers, t as listDiscordGuildChannels } from "./guilds-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-DtjvhJUj.mjs";
|
|
3
|
+
import { a as normalizeDiscordDisplaySlug } from "./allow-list-CkqpzPvP.mjs";
|
|
4
|
+
import { f as rememberDiscordDirectoryUser } from "./send.receipt-D0vpuJMr.mjs";
|
|
5
|
+
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-C4j_kC-2.mjs";
|
|
6
|
+
import { n as listGuilds, r as searchDiscordGuildMembers, t as listDiscordGuildChannels } from "./guilds-DYBhgnfq.mjs";
|
|
7
7
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
-
|
|
8
|
+
// extensions/discord/src/directory-live.ts
|
|
9
9
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
10
10
|
listDiscordDirectoryGroupsLive: () => listDiscordDirectoryGroupsLive,
|
|
11
11
|
listDiscordDirectoryPeersLive: () => listDiscordDirectoryPeersLive
|
|
@@ -87,5 +87,4 @@ function listDiscordDirectoryGroupsLive(params) {
|
|
|
87
87
|
function listDiscordDirectoryPeersLive(params) {
|
|
88
88
|
return listDiscordDirectoryLive(params, "user");
|
|
89
89
|
}
|
|
90
|
-
//#endregion
|
|
91
90
|
export { listDiscordDirectoryGroupsLive as n, listDiscordDirectoryPeersLive as r, directory_live_exports as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-
|
|
3
|
-
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-
|
|
4
|
-
import { i as parseCustomId, n as BaseModalComponent, t as BaseMessageInteractiveComponent } from "./components.base-
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-CkqpzPvP.mjs";
|
|
3
|
+
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
4
|
+
import { i as parseCustomId, n as BaseModalComponent, t as BaseMessageInteractiveComponent } from "./components.base-C5sAPHe4.mjs";
|
|
5
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
6
6
|
import { asOptionalObjectRecord, asRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { ApplicationCommandOptionType, ApplicationCommandType, ComponentType, GatewayDispatchEvents, InteractionContextType, InteractionResponseType, InteractionType, MessageFlags, Routes, TextInputStyle } from "discord-api-types/v10";
|
|
@@ -17,12 +17,11 @@ import { Type } from "typebox";
|
|
|
17
17
|
import { Check } from "typebox/value";
|
|
18
18
|
import { createHash } from "node:crypto";
|
|
19
19
|
import { createPermitPool } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
20
|
-
|
|
20
|
+
// extensions/discord/src/internal/undefined-fields.ts
|
|
21
21
|
function stripUndefinedFields(value) {
|
|
22
22
|
return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0));
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
//#region extensions/discord/src/internal/request-authority.ts
|
|
24
|
+
// extensions/discord/src/internal/request-authority.ts
|
|
26
25
|
const requestAuthority = resolveGlobalSingleton(Symbol.for("openclaw.discord.requestAuthority"), () => new AsyncLocalStorage());
|
|
27
26
|
/** Carry the host's existing assertion without changing its lifetime or ownership. */
|
|
28
27
|
function withDiscordRequestAuthority(assertCurrent, run) {
|
|
@@ -36,8 +35,7 @@ function withDiscordRequestAuthority(assertCurrent, run) {
|
|
|
36
35
|
function captureDiscordRequestAuthority() {
|
|
37
36
|
return requestAuthority.getStore();
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
//#region extensions/discord/src/internal/rest-body.ts
|
|
38
|
+
// extensions/discord/src/internal/rest-body.ts
|
|
41
39
|
function fileBlob(file) {
|
|
42
40
|
return file.data instanceof Blob ? file.data : new Blob([file.data], { type: typeof file.contentType === "string" ? file.contentType : void 0 });
|
|
43
41
|
}
|
|
@@ -95,8 +93,7 @@ function serializeRequestBody(data, headers) {
|
|
|
95
93
|
headers.set("Content-Type", "application/json");
|
|
96
94
|
return JSON.stringify(data.body);
|
|
97
95
|
}
|
|
98
|
-
|
|
99
|
-
//#region extensions/discord/src/internal/rest-errors.ts
|
|
96
|
+
// extensions/discord/src/internal/rest-errors.ts
|
|
100
97
|
const DISCORD_UNKNOWN_MESSAGE = 10008;
|
|
101
98
|
const DISCORD_UNKNOWN_VOICE_STATE = 10065;
|
|
102
99
|
const DISCORD_ERROR_BODY_MAX_DEPTH = 64;
|
|
@@ -228,8 +225,7 @@ var RateLimitError = class extends DiscordError {
|
|
|
228
225
|
this.scope = body.global ? "global" : readDiscordRateLimitScope(response);
|
|
229
226
|
}
|
|
230
227
|
};
|
|
231
|
-
|
|
232
|
-
//#region extensions/discord/src/internal/rest-routes.ts
|
|
228
|
+
// extensions/discord/src/internal/rest-routes.ts
|
|
233
229
|
const RATE_LIMIT_HEADER_NUMBER_RE = /^\d+(?:\.\d+)?$/;
|
|
234
230
|
const DISCORD_ROUTE_IDENTIFIER_HASH_LENGTH = 32;
|
|
235
231
|
function redactWebhookTokenInPath(path) {
|
|
@@ -279,8 +275,7 @@ function appendQuery(path, query) {
|
|
|
279
275
|
for (const [key, value] of Object.entries(query)) search.set(key, String(value));
|
|
280
276
|
return `${path}?${search.toString()}`;
|
|
281
277
|
}
|
|
282
|
-
|
|
283
|
-
//#region extensions/discord/src/internal/rest-scheduler.ts
|
|
278
|
+
// extensions/discord/src/internal/rest-scheduler.ts
|
|
284
279
|
const MAX_QUEUE_SIZE = 1e3;
|
|
285
280
|
const MAX_CONCURRENT_WORKERS = 4;
|
|
286
281
|
const MAX_RATE_LIMIT_RETRIES = 3;
|
|
@@ -515,8 +510,7 @@ function abortReason(signal) {
|
|
|
515
510
|
function isGlobalRateLimit(parsed) {
|
|
516
511
|
return parsed && typeof parsed === "object" && "global" in parsed ? Boolean(parsed.global) : false;
|
|
517
512
|
}
|
|
518
|
-
|
|
519
|
-
//#region extensions/discord/src/internal/schemas.ts
|
|
513
|
+
// extensions/discord/src/internal/schemas.ts
|
|
520
514
|
const discordInteractionPayloadSchema = Type.Object({
|
|
521
515
|
id: Type.String({ minLength: 1 }),
|
|
522
516
|
token: Type.String({ minLength: 1 }),
|
|
@@ -534,8 +528,7 @@ function assertDiscordInteractionPayload(value) {
|
|
|
534
528
|
function isDiscordRateLimitBody(value) {
|
|
535
529
|
return Check(discordRateLimitBodySchema, value);
|
|
536
530
|
}
|
|
537
|
-
|
|
538
|
-
//#region extensions/discord/src/internal/rest.ts
|
|
531
|
+
// extensions/discord/src/internal/rest.ts
|
|
539
532
|
const DISCORD_REST_TIMEOUT_MS = 15e3;
|
|
540
533
|
const defaultOptions = {
|
|
541
534
|
baseUrl: "https://discord.com/api",
|
|
@@ -700,8 +693,7 @@ function getRequestPriority(method, path) {
|
|
|
700
693
|
if (/^\/interactions\/\d+\/[^/]+\/callback$/.test(normalizedPath)) return "critical";
|
|
701
694
|
return normalizedMethod === "GET" ? "background" : "standard";
|
|
702
695
|
}
|
|
703
|
-
|
|
704
|
-
//#region extensions/discord/src/internal/api.guild.ts
|
|
696
|
+
// extensions/discord/src/internal/api.guild.ts
|
|
705
697
|
const discordGuildEmojiListSchema = Type.Array(Type.Object({
|
|
706
698
|
id: Type.Union([Type.String(), Type.Null()]),
|
|
707
699
|
name: Type.Union([Type.String(), Type.Null()]),
|
|
@@ -720,8 +712,7 @@ async function listGuildEmojis(rest, guildId) {
|
|
|
720
712
|
if (!Check(discordGuildEmojiListSchema, emojis)) throw new Error("Invalid Discord guild emoji response.");
|
|
721
713
|
return emojis;
|
|
722
714
|
}
|
|
723
|
-
|
|
724
|
-
//#region extensions/discord/src/internal/api.messages.ts
|
|
715
|
+
// extensions/discord/src/internal/api.messages.ts
|
|
725
716
|
function normalizeDiscordMessageId(messageId) {
|
|
726
717
|
const normalized = messageId.trim();
|
|
727
718
|
if (!/^[0-9]+$/u.test(normalized)) throw new Error("Invalid Discord message ID. Expected decimal digits.");
|
|
@@ -754,8 +745,7 @@ async function createThread(rest, channelId, data, messageId) {
|
|
|
754
745
|
const route = messageId === void 0 ? Routes.threads(channelId) : Routes.threads(channelId, normalizeDiscordMessageId(messageId));
|
|
755
746
|
return await rest.post(route, data);
|
|
756
747
|
}
|
|
757
|
-
|
|
758
|
-
//#region extensions/discord/src/internal/api.reactions.ts
|
|
748
|
+
// extensions/discord/src/internal/api.reactions.ts
|
|
759
749
|
function ownReactionMutation(method) {
|
|
760
750
|
return async (rest, channelId, messageId, encodedEmoji) => {
|
|
761
751
|
await rest[method](Routes.channelMessageOwnReaction(channelId, normalizeDiscordMessageId(messageId), encodedEmoji));
|
|
@@ -766,8 +756,7 @@ const deleteOwnMessageReaction = ownReactionMutation("delete");
|
|
|
766
756
|
async function listMessageReactionUsers(rest, channelId, messageId, encodedEmoji, query) {
|
|
767
757
|
return await rest.get(Routes.channelMessageReaction(channelId, normalizeDiscordMessageId(messageId), encodedEmoji), query);
|
|
768
758
|
}
|
|
769
|
-
|
|
770
|
-
//#region extensions/discord/src/internal/api.users.ts
|
|
759
|
+
// extensions/discord/src/internal/api.users.ts
|
|
771
760
|
async function getCurrentUser(rest) {
|
|
772
761
|
return await rest.get(Routes.user("@me"));
|
|
773
762
|
}
|
|
@@ -777,8 +766,7 @@ async function getUser(rest, userId) {
|
|
|
777
766
|
async function createUserDmChannel(rest, recipientId) {
|
|
778
767
|
return await rest.post(Routes.userChannels(), { body: { recipient_id: recipientId } });
|
|
779
768
|
}
|
|
780
|
-
|
|
781
|
-
//#region extensions/discord/src/internal/commands.ts
|
|
769
|
+
// extensions/discord/src/internal/commands.ts
|
|
782
770
|
async function deferCommandInteractionIfNeeded(command, interaction) {
|
|
783
771
|
if (!command.defer) return;
|
|
784
772
|
await interaction.defer({ ephemeral: command.ephemeral });
|
|
@@ -866,8 +854,7 @@ var CommandWithSubcommands = class extends BaseCommand {
|
|
|
866
854
|
}));
|
|
867
855
|
}
|
|
868
856
|
};
|
|
869
|
-
|
|
870
|
-
//#region extensions/discord/src/internal/structures.ts
|
|
857
|
+
// extensions/discord/src/internal/structures.ts
|
|
871
858
|
var Base = class {
|
|
872
859
|
constructor(client) {
|
|
873
860
|
this.client = client;
|
|
@@ -1021,8 +1008,7 @@ function channelFactory(clientForTest, channelData) {
|
|
|
1021
1008
|
ownerId: "owner_id" in channelData ? channelData.owner_id : void 0
|
|
1022
1009
|
};
|
|
1023
1010
|
}
|
|
1024
|
-
|
|
1025
|
-
//#region extensions/discord/src/internal/interaction-options.ts
|
|
1011
|
+
// extensions/discord/src/internal/interaction-options.ts
|
|
1026
1012
|
function findOption(options, matches) {
|
|
1027
1013
|
for (const option of options ?? []) {
|
|
1028
1014
|
if (matches(option)) return option;
|
|
@@ -1065,8 +1051,7 @@ var OptionsHandler = class {
|
|
|
1065
1051
|
return findOption(this.rawOptions, (option) => "focused" in option && Boolean(option.focused));
|
|
1066
1052
|
}
|
|
1067
1053
|
};
|
|
1068
|
-
|
|
1069
|
-
//#region extensions/discord/src/internal/modal-fields.ts
|
|
1054
|
+
// extensions/discord/src/internal/modal-fields.ts
|
|
1070
1055
|
function extractModalFields(components) {
|
|
1071
1056
|
const out = {};
|
|
1072
1057
|
for (const component of flattenModalComponents(components)) {
|
|
@@ -1125,8 +1110,7 @@ var ModalFields = class {
|
|
|
1125
1110
|
});
|
|
1126
1111
|
}
|
|
1127
1112
|
};
|
|
1128
|
-
|
|
1129
|
-
//#region extensions/discord/src/internal/embeds.ts
|
|
1113
|
+
// extensions/discord/src/internal/embeds.ts
|
|
1130
1114
|
var Embed = class {
|
|
1131
1115
|
constructor(embed) {
|
|
1132
1116
|
Object.assign(this, embed);
|
|
@@ -1146,8 +1130,7 @@ var Embed = class {
|
|
|
1146
1130
|
});
|
|
1147
1131
|
}
|
|
1148
1132
|
};
|
|
1149
|
-
|
|
1150
|
-
//#region extensions/discord/src/internal/payload.ts
|
|
1133
|
+
// extensions/discord/src/internal/payload.ts
|
|
1151
1134
|
function asSerializableComponent(component) {
|
|
1152
1135
|
return {
|
|
1153
1136
|
isV2: component.type !== ComponentType.ActionRow,
|
|
@@ -1178,8 +1161,7 @@ function serializePayload(payload) {
|
|
|
1178
1161
|
sticker_ids: payload.stickers
|
|
1179
1162
|
});
|
|
1180
1163
|
}
|
|
1181
|
-
|
|
1182
|
-
//#region extensions/discord/src/internal/interactions.ts
|
|
1164
|
+
// extensions/discord/src/internal/interactions.ts
|
|
1183
1165
|
function needsComponentsV2Query(body) {
|
|
1184
1166
|
return "flags" in body && ((body.flags ?? 0) & MessageFlags.IsComponentsV2) !== 0;
|
|
1185
1167
|
}
|
|
@@ -1332,8 +1314,7 @@ function createInteraction(client, rawData) {
|
|
|
1332
1314
|
if (rawData.type === InteractionType.MessageComponent) return new BaseComponentInteraction(client, rawData);
|
|
1333
1315
|
return new BaseInteraction(client, rawData);
|
|
1334
1316
|
}
|
|
1335
|
-
|
|
1336
|
-
//#region extensions/discord/src/internal/interaction-dispatch.ts
|
|
1317
|
+
// extensions/discord/src/internal/interaction-dispatch.ts
|
|
1337
1318
|
async function dispatchInteraction(client, rawData) {
|
|
1338
1319
|
const interaction = createInteraction(client, rawData);
|
|
1339
1320
|
if (rawData.type === InteractionType.ApplicationCommandAutocomplete) {
|
|
@@ -1400,8 +1381,7 @@ async function deferComponentInteractionIfNeeded(component, interaction) {
|
|
|
1400
1381
|
}
|
|
1401
1382
|
await interaction.acknowledge();
|
|
1402
1383
|
}
|
|
1403
|
-
|
|
1404
|
-
//#region extensions/discord/src/internal/client.ts
|
|
1384
|
+
// extensions/discord/src/internal/client.ts
|
|
1405
1385
|
const DEFAULT_REST_CACHE_TTL_MS = 3e4;
|
|
1406
1386
|
const DEFAULT_MAX_ENTRIES = 5e3;
|
|
1407
1387
|
const DEFAULT_SWEEP_INTERVAL_MS = 3e4;
|
|
@@ -1695,8 +1675,7 @@ var Client = class {
|
|
|
1695
1675
|
}));
|
|
1696
1676
|
}
|
|
1697
1677
|
};
|
|
1698
|
-
|
|
1699
|
-
//#region extensions/discord/src/internal/components.modal.ts
|
|
1678
|
+
// extensions/discord/src/internal/components.modal.ts
|
|
1700
1679
|
var TextInput = class extends BaseModalComponent {
|
|
1701
1680
|
constructor(..._args) {
|
|
1702
1681
|
super(..._args);
|
|
@@ -1774,8 +1753,7 @@ var Modal = class {
|
|
|
1774
1753
|
};
|
|
1775
1754
|
}
|
|
1776
1755
|
};
|
|
1777
|
-
|
|
1778
|
-
//#region extensions/discord/src/internal/listeners.ts
|
|
1756
|
+
// extensions/discord/src/internal/listeners.ts
|
|
1779
1757
|
var BaseListener = class {};
|
|
1780
1758
|
var ReadyListener = class extends BaseListener {
|
|
1781
1759
|
constructor(..._args) {
|
|
@@ -1789,8 +1767,7 @@ var GuildCreateListener = class extends BaseListener {
|
|
|
1789
1767
|
this.type = GatewayDispatchEvents.GuildCreate;
|
|
1790
1768
|
}
|
|
1791
1769
|
};
|
|
1792
|
-
|
|
1793
|
-
//#region extensions/discord/src/internal/discord.ts
|
|
1770
|
+
// extensions/discord/src/internal/discord.ts
|
|
1794
1771
|
var discord_exports = /* @__PURE__ */ __exportAll({
|
|
1795
1772
|
AutocompleteInteraction: () => AutocompleteInteraction,
|
|
1796
1773
|
BaseCommand: () => BaseCommand,
|
|
@@ -1845,5 +1822,4 @@ var discord_exports = /* @__PURE__ */ __exportAll({
|
|
|
1845
1822
|
});
|
|
1846
1823
|
import * as import_discord_api_types_v10 from "discord-api-types/v10";
|
|
1847
1824
|
__reExport(discord_exports, import_discord_api_types_v10);
|
|
1848
|
-
//#endregion
|
|
1849
1825
|
export { getThreadMember as A, RateLimitError as B, listMessageReactionUsers as C, editChannelMessage as D, deleteChannelMessage as E, getGuildVoiceState as F, readRetryAfter as G, isUnknownDiscordVoiceStateError as H, listGuildEmojis as I, stripUndefinedFields as J, captureDiscordRequestAuthority as K, DISCORD_REST_TIMEOUT_MS as L, unpinChannelMessage as M, getGuild as N, getChannel as O, getGuildMember as P, RequestClient as R, deleteOwnMessageReaction as S, createThread as T, readDiscordCode as U, isUnknownDiscordMessageError as V, readDiscordMessage as W, Command as _, Label as a, getCurrentUser as b, TextInput as c, hasDiscordV2Components as d, serializePayload as f, User as g, Message as h, CheckboxGroup as i, pinChannelMessage as j, getChannelMessage as k, Client as l, Guild as m, GuildCreateListener as n, Modal as o, Embed as p, withDiscordRequestAuthority as q, ReadyListener as r, RadioGroup as s, discord_exports as t, asSerializableComponent as u, CommandWithSubcommands as v, createChannelMessage as w, createOwnMessageReaction as x, createUserDmChannel as y, DiscordError as z };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-
|
|
4
|
-
import { n as normalizeCompatibilityConfig } from "./doctor-contract-
|
|
5
|
-
import { t as isDiscordMutableAllowEntry } from "./security-doctor-
|
|
6
|
-
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-CSz5Qodj.mjs";
|
|
3
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BpV1jKk0.mjs";
|
|
4
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Dstl3cMg.mjs";
|
|
5
|
+
import { t as isDiscordMutableAllowEntry } from "./security-doctor-4s7omTZd.mjs";
|
|
6
|
+
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-a1btN-pC.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
9
|
-
|
|
9
|
+
// extensions/discord/src/doctor.ts
|
|
10
10
|
function sanitizeForLog(value) {
|
|
11
11
|
return value.replace(/\p{Cc}+/gu, " ").trim();
|
|
12
12
|
}
|
|
@@ -182,5 +182,4 @@ const discordDoctor = {
|
|
|
182
182
|
collectMutableAllowlistWarnings: ({ cfg }) => collectDiscordMutableAllowlistWarnings(cfg),
|
|
183
183
|
repairConfig: ({ cfg, doctorFixCommand }) => maybeRepairDiscordNumericIds(cfg, doctorFixCommand)
|
|
184
184
|
};
|
|
185
|
-
//#endregion
|
|
186
185
|
export { collectDiscordMissingEnvTokenWarnings, collectDiscordNumericIdWarnings, discordDoctor, maybeRepairDiscordNumericIds, scanDiscordNumericIdEntries };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-
|
|
1
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BpV1jKk0.mjs";
|
|
2
2
|
import { isSupportedRealtimeVoiceActivationName, normalizeRealtimeVoiceActivationNamePrefix } from "openclaw/plugin-sdk/realtime-voice-activation";
|
|
3
|
-
|
|
3
|
+
// extensions/discord/src/doctor-contract.ts
|
|
4
4
|
const RETIRED_TUNING_KEYS = /* @__PURE__ */ new Set([
|
|
5
5
|
"gatewayInfoTimeoutMs",
|
|
6
6
|
"gatewayReadyTimeoutMs",
|
|
@@ -124,5 +124,4 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
124
124
|
changes
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
//#endregion
|
|
128
127
|
export { normalizeCompatibilityConfig as n, legacyConfigRules as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
2
2
|
import { fetchWithSsrFGuard, isBlockedHostnameOrIp, isLoopbackHost } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
3
|
-
|
|
3
|
+
// extensions/discord/src/endpoint-runtime.ts
|
|
4
4
|
const DISCORD_ENDPOINT_RESPONSE_MAX_BYTES = 8388608;
|
|
5
5
|
const DISCORD_API_URL_ENV = "DISCORD_API_URL";
|
|
6
6
|
function parseHttpAnchor(value, label) {
|
|
@@ -135,5 +135,4 @@ function assertDiscordEndpointGatewayUrl(url, gatewayOrigin) {
|
|
|
135
135
|
}
|
|
136
136
|
if (parsed.origin !== gatewayOrigin || parsed.username || parsed.password || parsed.hash) throw new Error("Discord endpoint Gateway URL is outside the configured WebSocket origin");
|
|
137
137
|
}
|
|
138
|
-
//#endregion
|
|
139
138
|
export { resolveDiscordEndpointMediaGuard as i, getDiscordEndpointRuntime as n, resolveDiscordEndpointAttachmentGuard as r, assertDiscordEndpointGatewayUrl as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as normalizeDiscordSlug } from "./allow-list-
|
|
2
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
3
|
-
|
|
1
|
+
import { o as normalizeDiscordSlug } from "./allow-list-CkqpzPvP.mjs";
|
|
2
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-C4j_kC-2.mjs";
|
|
3
|
+
// extensions/discord/src/guilds.ts
|
|
4
4
|
function listDiscordGuildChannels(token, fetcher, guildId) {
|
|
5
5
|
return fetchDiscord(`/guilds/${guildId}/channels`, token, fetcher, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
|
|
6
6
|
}
|
|
@@ -18,5 +18,4 @@ async function listGuilds(token, fetcher, options) {
|
|
|
18
18
|
slug: normalizeDiscordSlug(guild.name)
|
|
19
19
|
}] : []);
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { listGuilds as n, searchDiscordGuildMembers as r, listDiscordGuildChannels as t };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { q as withDiscordRequestAuthority } from "./discord-
|
|
2
|
-
import { s as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
3
|
-
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-
|
|
4
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
5
|
-
import { n as buildDiscordPresentationComponents, t as buildDiscordInteractiveComponents } from "./shared-interactive-
|
|
6
|
-
import { c as coerceDiscordComponentParam } from "./components-
|
|
1
|
+
import { q as withDiscordRequestAuthority } from "./discord-BGkLzt2b.mjs";
|
|
2
|
+
import { s as matchesDiscordToolContextTarget } from "./send.receipt-D0vpuJMr.mjs";
|
|
3
|
+
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
4
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-BJxDx_zr.mjs";
|
|
5
|
+
import { n as buildDiscordPresentationComponents, t as buildDiscordInteractiveComponents } from "./shared-interactive-DKBw4SNV.mjs";
|
|
6
|
+
import { c as coerceDiscordComponentParam } from "./components-DeCLO9w0.mjs";
|
|
7
7
|
import "../action-runtime-api.js";
|
|
8
|
-
import { S as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-
|
|
9
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
10
|
-
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-
|
|
8
|
+
import { S as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-CzL157kC.mjs";
|
|
9
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-CGzsE3bM.mjs";
|
|
10
|
+
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-DkPnk2x8.mjs";
|
|
11
11
|
import { asOptionalRecord, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
13
13
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
14
14
|
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
15
15
|
import { readPositiveIntegerParam as readPositiveIntegerParam$1, readStringArrayParam as readStringArrayParam$1, readStringParam as readStringParam$1 } from "openclaw/plugin-sdk/agent-runtime";
|
|
16
|
-
|
|
16
|
+
// extensions/discord/src/actions/handle-action.ts
|
|
17
17
|
const providerId = "discord";
|
|
18
18
|
function readCurrentDiscordTarget(toolContext) {
|
|
19
19
|
const provider = toolContext?.currentChannelProvider?.trim().toLowerCase();
|
|
@@ -278,5 +278,4 @@ async function dispatchDiscordMessageAction(ctx) {
|
|
|
278
278
|
}
|
|
279
279
|
throw new Error(`Action ${action} is not supported for provider ${providerId}.`);
|
|
280
280
|
}
|
|
281
|
-
//#endregion
|
|
282
281
|
export { handleDiscordMessageAction };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-BJxDx_zr.mjs";
|
|
2
2
|
import "../action-runtime-api.js";
|
|
3
|
-
import { x as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-
|
|
3
|
+
import { x as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-CzL157kC.mjs";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
6
6
|
import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/param-readers";
|
|
7
|
-
|
|
7
|
+
// extensions/discord/src/actions/handle-action.guild-admin.ts
|
|
8
8
|
const guildMetadataReads = {
|
|
9
9
|
"member-info": {
|
|
10
10
|
action: "memberInfo",
|
|
@@ -194,5 +194,4 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
194
194
|
}, readPolicyOptions);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
//#endregion
|
|
198
197
|
export { tryHandleDiscordMessageActionGuildAdmin as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as discord_exports } from "./discord-
|
|
1
|
+
import { t as discord_exports } from "./discord-BGkLzt2b.mjs";
|
|
2
2
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
3
3
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
4
|
-
|
|
4
|
+
// extensions/discord/src/voice/listeners.ts
|
|
5
5
|
const logger = createSubsystemLogger("discord/voice");
|
|
6
6
|
function startAutoJoin(operation, context = "") {
|
|
7
7
|
operation().catch((err) => logger.warn(`discord voice: autoJoin${context} failed: ${formatErrorMessage(err)}`));
|
|
@@ -43,5 +43,4 @@ var DiscordVoiceStateUpdateListener = class {
|
|
|
43
43
|
await this.manager.handleVoiceStateUpdate(data, transition ? transition.previous ?? null : void 0);
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
//#endregion
|
|
47
46
|
export { DiscordVoiceGuildCreateListener, DiscordVoiceReadyListener, DiscordVoiceResumedListener, DiscordVoiceStateUpdateListener };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as normalizeDiscordAllowList } from "./allow-list-
|
|
1
|
+
import { i as normalizeDiscordAllowList } from "./allow-list-CkqpzPvP.mjs";
|
|
2
2
|
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
3
|
-
|
|
3
|
+
// extensions/discord/src/monitor/ingress-identity.ts
|
|
4
4
|
const DISCORD_ALLOW_LIST_PREFIXES = [
|
|
5
5
|
"discord:",
|
|
6
6
|
"user:",
|
|
@@ -54,8 +54,7 @@ const discordIngressIdentity = defineStableChannelIngressIdentity({
|
|
|
54
54
|
sensitivity: "pii"
|
|
55
55
|
}))
|
|
56
56
|
});
|
|
57
|
-
|
|
58
|
-
//#region extensions/discord/src/live-policy-config.ts
|
|
57
|
+
// extensions/discord/src/live-policy-config.ts
|
|
59
58
|
/** Account policy consumed at inbound admission, without replacing the transport. */
|
|
60
59
|
function selectDiscordLivePolicyConfig(config) {
|
|
61
60
|
return {
|
|
@@ -68,5 +67,4 @@ function selectDiscordLivePolicyConfig(config) {
|
|
|
68
67
|
dangerouslyAllowNameMatching: config.dangerouslyAllowNameMatching
|
|
69
68
|
};
|
|
70
69
|
}
|
|
71
|
-
//#endregion
|
|
72
70
|
export { discordIngressIdentity as n, selectDiscordLivePolicyConfig as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { q as withDiscordRequestAuthority } from "./discord-
|
|
2
|
-
import { i as resolveDiscordEndpointMediaGuard, n as getDiscordEndpointRuntime } from "./endpoint-runtime-
|
|
3
|
-
import { t as getDiscordRuntime } from "./runtime-
|
|
4
|
-
import { D as createMessageDispatchData, E as createDiscordLivePolicyReader } from "./provider-
|
|
5
|
-
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-
|
|
1
|
+
import { q as withDiscordRequestAuthority } from "./discord-BGkLzt2b.mjs";
|
|
2
|
+
import { i as resolveDiscordEndpointMediaGuard, n as getDiscordEndpointRuntime } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
3
|
+
import { t as getDiscordRuntime } from "./runtime-DcBvHOm1.mjs";
|
|
4
|
+
import { D as createMessageDispatchData, E as createDiscordLivePolicyReader } from "./provider-BcSZ6vqo.mjs";
|
|
5
|
+
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-a1btN-pC.mjs";
|
|
6
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
8
8
|
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -17,7 +17,7 @@ import { DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, createChannelIngressError, createCh
|
|
|
17
17
|
import { racePromiseWithAbortSignal } from "openclaw/plugin-sdk/time-runtime";
|
|
18
18
|
import { fanInChannelIngressLifecycles, prepareChannelIngressEvent } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
19
19
|
import { createChannelInboundDebouncer, resolveInboundDebounceMs, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
|
|
20
|
-
|
|
20
|
+
// extensions/discord/src/monitor/ingress.ts
|
|
21
21
|
const DISCORD_INGRESS_PAYLOAD_VERSION = 1;
|
|
22
22
|
const DISCORD_INGRESS_DRAIN_INTERVAL_MS = 1e3;
|
|
23
23
|
const DiscordIngressPayloadError = createChannelIngressError("DiscordIngressPayloadError");
|
|
@@ -139,8 +139,7 @@ function createDiscordIngressMonitor(params) {
|
|
|
139
139
|
stop: monitor.stop
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
//#region extensions/discord/src/monitor/message-avatar.ts
|
|
142
|
+
// extensions/discord/src/monitor/message-avatar.ts
|
|
144
143
|
const DISCORD_AVATAR_MAX_BYTES = 262144;
|
|
145
144
|
const DISCORD_AVATAR_CACHE_MAX_ENTRIES = 128;
|
|
146
145
|
const DISCORD_GUILD_ICON_TTL_MS = 3e5;
|
|
@@ -215,10 +214,9 @@ function createDiscordAvatarResolver() {
|
|
|
215
214
|
return guildIcon?.hash ? resolveSavedAvatar(`${params.conversationId}\0${guildIcon.hash}`, discordAvatarUrl("icons", params.guildId, guildIcon.hash), endpointRuntime) : void 0;
|
|
216
215
|
} };
|
|
217
216
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-IPQv14En.mjs"));
|
|
217
|
+
// extensions/discord/src/monitor/message-dispatcher.ts
|
|
218
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-DaqozzfW.mjs"));
|
|
219
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-C6ETXKq2.mjs"));
|
|
222
220
|
function createDiscordMessageDispatcher(params) {
|
|
223
221
|
const readPolicy = params.readPolicy ?? createDiscordLivePolicyReader({
|
|
224
222
|
...params,
|
|
@@ -495,8 +493,7 @@ function createDiscordMessageDispatcher(params) {
|
|
|
495
493
|
};
|
|
496
494
|
return handler;
|
|
497
495
|
}
|
|
498
|
-
|
|
499
|
-
//#region extensions/discord/src/monitor/message-handler.ts
|
|
496
|
+
// extensions/discord/src/monitor/message-handler.ts
|
|
500
497
|
function createDiscordMessageHandler(params) {
|
|
501
498
|
const dispatcher = createDiscordMessageDispatcher(params);
|
|
502
499
|
const ingress = createDiscordIngressMonitor({
|
|
@@ -528,5 +525,4 @@ function createDiscordMessageHandler(params) {
|
|
|
528
525
|
};
|
|
529
526
|
return handler;
|
|
530
527
|
}
|
|
531
|
-
//#endregion
|
|
532
528
|
export { createDiscordMessageHandler as t };
|