@openclaw/discord 2026.10.10-beta.4 → 2026.10.10
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-X_Xlr42B.mjs} +2 -3
- package/dist/.setup/{accounts-ljrzXBJi.mjs → accounts-C18HNgge.mjs} +4 -8
- package/dist/.setup/{active-turn-thread-route-C4tp9noA.mjs → active-turn-thread-route-BAc_Xik-.mjs} +1 -2
- package/dist/.setup/{allow-list-B_ToXtew.mjs → allow-list-D1ZGfhXh.mjs} +5 -10
- package/dist/.setup/{api-CtmE1OUN.mjs → api-Bth1wKF9.mjs} +3 -5
- package/dist/.setup/{approval-handler.runtime-BvF8oUpa.mjs → approval-handler.runtime-BAoEELJJ.mjs} +8 -9
- package/dist/.setup/{approval-message-updates-wbUqLtLI.mjs → approval-message-updates-Cks-MSCJ.mjs} +3 -4
- package/dist/.setup/{audit-UwzCdDJk.mjs → audit-Dw_rAZIz.mjs} +6 -7
- package/dist/.setup/{channel-BlvyeRAu.mjs → channel-BMpMAeQL.mjs} +33 -41
- package/dist/.setup/{channel-access-DasWY_OV.mjs → channel-access-BPrWoEXM.mjs} +1 -2
- package/dist/.setup/{channel.setup-By7wNopw.mjs → channel.setup-DVe7Y3Jf.mjs} +8 -12
- package/dist/.setup/{command-deploy-store-DFkBTViB.mjs → command-deploy-store-DPWiBMks.mjs} +1 -2
- package/dist/.setup/{command-owners-D78sAoOz.mjs → command-owners-BzlhNBxA.mjs} +2 -3
- package/dist/.setup/{components-C_cuoW1q.mjs → components-BvOWSPxr.mjs} +11 -20
- package/dist/.setup/{config-schema-_uBILpQf.mjs → config-schema-Coyq5wOr.mjs} +3 -5
- package/dist/.setup/{conversation-binding-route-fdYsXexV.mjs → conversation-binding-route-DOPUZNYo.mjs} +2 -3
- package/dist/.setup/{directory-config-3iVub-3m.mjs → directory-config-CIqVnQtn.mjs} +3 -4
- package/dist/.setup/{directory-live-DLygQVtW.mjs → directory-live-DUuPEWub.mjs} +7 -10
- package/dist/.setup/{discord-Cl2OPTZ6.mjs → discord-eFlHX1Gn.mjs} +35 -68
- package/dist/.setup/{doctor-94GSI6lY.mjs → doctor-Dty_Ossy.mjs} +8 -9
- package/dist/.setup/{doctor-contract-Bwv8EuQ_.mjs → doctor-contract-Dstl3cMg.mjs} +2 -3
- package/dist/.setup/{handle-action-0-FZD3Am.mjs → handle-action-DXY91jF-.mjs} +10 -11
- package/dist/.setup/{handle-action.guild-admin-DfAWANBE.mjs → handle-action.guild-admin-BvBCfhXF.mjs} +3 -4
- package/dist/.setup/{live-policy-config-BPoB3eQi.mjs → live-policy-config-DO1Fk2hp.mjs} +3 -5
- package/dist/.setup/{message-handler-CtR2w7W_.mjs → message-handler-fL1j1NiR.mjs} +11 -16
- package/dist/.setup/{message-handler.preflight-BqUw7LWb.mjs → message-handler.preflight-DkjwNZAd.mjs} +20 -28
- package/dist/.setup/{message-handler.preflight-pluralkit-BU9I_X-b.mjs → message-handler.preflight-pluralkit-DR4BnvMU.mjs} +10 -14
- package/dist/.setup/{message-handler.process-BZeWmSNC.mjs → message-handler.process-ClOwIPDK.mjs} +33 -47
- package/dist/.setup/{outbound-adapter-DBwgKemw.mjs → outbound-adapter-DWyAWBFh.mjs} +13 -19
- package/dist/.setup/{outbound-session-route-CsHHPxsQ.mjs → outbound-session-route-TFBPPkoz.mjs} +21 -32
- 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-wWgsZG5F.mjs → preflight-audio-CwtPIsvk.mjs} +1 -2
- package/dist/.setup/{presence-cache-DCeTsL73.mjs → presence-cache-CgutE4NN.mjs} +1 -2
- package/dist/.setup/{probe-D3P1x4aN.mjs → probe-DNge7OEP.mjs} +5 -6
- package/dist/.setup/{provider-DUTsZJHz.mjs → provider-BBDuE14w.mjs} +165 -227
- package/dist/.setup/{provider-session.runtime-Ucr3XodI.mjs → provider-session.runtime-D8hMXXqJ.mjs} +3 -3
- package/dist/.setup/provider.runtime-BQ1z4Aq1.mjs +1 -0
- package/dist/.setup/{realtime-session.runtime-bNnPOKP_.mjs → realtime-session.runtime-cetognkp.mjs} +14 -23
- package/dist/.setup/{receive-recovery-CKvaG2Hf.mjs → receive-recovery-C77CVdGM.mjs} +3 -6
- package/dist/.setup/{resolve-allowlist-common-DNSsUQRF.mjs → resolve-allowlist-common-CI77288n.mjs} +5 -7
- package/dist/.setup/{resolve-channels-UdT38DzU.mjs → resolve-channels-DYc6-xgV.mjs} +5 -6
- package/dist/.setup/{resolve-users-DnCsrXZ_.mjs → resolve-users-BQT7XWF2.mjs} +4 -5
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime-DE6W14G3.mjs → runtime-CI0UJqeS.mjs} +23 -35
- package/dist/.setup/{runtime-Cg5pIBm_.mjs → runtime-CcijhTJT.mjs} +4 -6
- 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-CIsH7R3B.mjs → secret-config-contract-BdbCvqnM.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-yR1hfybW.mjs → send-Cbq-IVsS.mjs} +18 -28
- package/dist/.setup/{send.components--dxMjc2O.mjs → send.components-BV6ucNpJ.mjs} +10 -13
- package/dist/.setup/{send.outbound-B5vQwgUK.mjs → send.outbound-CGhBhzjQ.mjs} +9 -13
- package/dist/.setup/{send.receipt-eE3zLTDH.mjs → send.receipt-Dw-_r5Bx.mjs} +17 -19
- package/dist/.setup/{send.shared-iGf1rqAm.mjs → send.shared-D4MioxW_.mjs} +14 -23
- package/dist/.setup/{sender-identity-BNBvGt1l.mjs → sender-identity-DrN5c4ec.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-B4J6wmL1.mjs +2 -0
- package/dist/.setup/{shared-DgzLizSt.mjs → shared-Bp0sxD5R.mjs} +15 -19
- package/dist/.setup/{subagent-hooks-tBtaqWkD.mjs → subagent-hooks-mQbDkvuD.mjs} +3 -4
- package/dist/.setup/{system-events-DGsxf-l9.mjs → system-events-2zc2eGfF.mjs} +3 -4
- package/dist/.setup/{target-parsing-C-HyNxcE.mjs → target-parsing-BiuhcK9Q.mjs} +1 -2
- package/dist/.setup/{target-resolver-BFOKmBni.mjs → target-resolver-CAHeVfmZ.mjs} +6 -7
- package/dist/.setup/targets-BaklhOqq.mjs +3 -0
- package/dist/.setup/{thread-binding-api-BDZJD4na.mjs → thread-binding-api-Drd4Zu-5.mjs} +1 -2
- package/dist/.setup/{thread-bindings-Dsc3zsrI.mjs → thread-bindings-Dg7X_ZXP.mjs} +8 -11
- package/dist/.setup/{thread-bindings.manager-BMpmKLQh.mjs → thread-bindings.manager-DCDYksah.mjs} +15 -20
- package/dist/.setup/{thread-bindings.session-updates-BMdJeJMc.mjs → thread-bindings.session-updates-C76plLS3.mjs} +5 -9
- package/dist/.setup/{threading-Cg_QRc8s.mjs → threading-l0UfrE6x.mjs} +6 -9
- package/dist/.setup/{timeouts-CuNARfyw.mjs → timeouts-DTrUsJ_W.mjs} +1 -2
- package/dist/.setup/{transcripts-source-fRvFsZng.mjs → transcripts-source-CGgOaWcu.mjs} +19 -32
- package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
- package/dist/.setup/{voice-runtime-DHDNu0fz.mjs → voice-runtime-DY1EwDfi.mjs} +33 -55
- 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 +13 -20
- package/dist/api.js +21 -22
- package/dist/assets/embedded-app-sdk.mjs +1 -1
- 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/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +3 -2
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +3 -2
- package/node_modules/undici/README.md +25 -3
- package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
- package/node_modules/undici/docs/docs/api/Errors.md +76 -1
- package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/undici/docs/docs/api/Interceptors.md +13 -6
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/undici/docs/docs/index.md +12 -12
- package/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/undici/lib/core/request.js +16 -1
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/core/util.js +26 -1
- package/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
- package/node_modules/undici/lib/dispatcher/client-h2.js +46 -14
- package/node_modules/undici/lib/dispatcher/client.js +4 -1
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/undici/lib/dispatcher/pool-base.js +65 -28
- package/node_modules/undici/lib/dispatcher/pool.js +11 -8
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
- package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
- package/node_modules/undici/lib/handler/redirect-handler.js +28 -8
- package/node_modules/undici/lib/handler/retry-handler.js +44 -11
- package/node_modules/undici/lib/interceptor/cache.js +11 -3
- package/node_modules/undici/lib/interceptor/decompress.js +22 -9
- package/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/undici/lib/web/cookies/util.js +19 -2
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
- package/node_modules/undici/lib/web/fetch/body.js +47 -38
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/undici/lib/web/fetch/headers.js +2 -2
- package/node_modules/undici/lib/web/fetch/index.js +8 -4
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/undici/lib/web/websocket/receiver.js +25 -4
- package/node_modules/undici/package.json +7 -5
- package/node_modules/undici/types/cache-interceptor.d.ts +10 -0
- package/node_modules/undici/types/client.d.ts +10 -4
- package/node_modules/undici/types/errors.d.ts +16 -1
- package/node_modules/undici/types/h2c-client.d.ts +1 -1
- package/node_modules/undici/types/interceptors.d.ts +6 -1
- package/package.json +5 -5
- package/dist/.setup/provider.runtime-J8NuMCNs.mjs +0 -1
- package/dist/.setup/setup-plugin-api-DVpA_yqS.mjs +0 -2
- package/dist/.setup/targets-UbCpek5o.mjs +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
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";
|
|
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
|
|
6
6
|
var directory_config_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
listDiscordDirectoryGroupsFromConfig: () => listDiscordDirectoryGroupsFromConfig,
|
|
8
8
|
listDiscordDirectoryPeersFromConfig: () => listDiscordDirectoryPeersFromConfig
|
|
@@ -42,5 +42,4 @@ const listDiscordDirectoryGroupsFromConfig = createResolvedDirectoryEntriesListe
|
|
|
42
42
|
return /^\d+$/.test(cleaned) ? `channel:${cleaned}` : null;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
//#endregion
|
|
46
45
|
export { listDiscordDirectoryGroupsFromConfig as n, listDiscordDirectoryPeersFromConfig as r, directory_config_exports as t };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-
|
|
3
|
-
import { o as normalizeDiscordSlug } from "./allow-list-
|
|
4
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
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";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
-
|
|
7
|
+
// extensions/discord/src/directory-cache-state.ts
|
|
8
8
|
const discordDirectoryCacheState = { handlesByAccount: /* @__PURE__ */ new Map() };
|
|
9
|
-
|
|
10
|
-
//#region extensions/discord/src/directory-cache.ts
|
|
9
|
+
// extensions/discord/src/directory-cache.ts
|
|
11
10
|
const DISCORD_DIRECTORY_CACHE_MAX_ENTRIES = 4e3;
|
|
12
11
|
const DISCORD_DISCRIMINATOR_SUFFIX = /#\d{4}$/;
|
|
13
12
|
function normalizeDiscordSnowflake(value) {
|
|
@@ -61,8 +60,7 @@ function resolveDiscordDirectoryUserId(params) {
|
|
|
61
60
|
if (!withoutDiscriminator || withoutDiscriminator === handle) return;
|
|
62
61
|
return cache.get(withoutDiscriminator);
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
//#region extensions/discord/src/directory-live.ts
|
|
63
|
+
// extensions/discord/src/directory-live.ts
|
|
66
64
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
67
65
|
listDiscordDirectoryGroupsLive: () => listDiscordDirectoryGroupsLive,
|
|
68
66
|
listDiscordDirectoryPeersLive: () => listDiscordDirectoryPeersLive
|
|
@@ -147,5 +145,4 @@ function listDiscordDirectoryGroupsLive(params) {
|
|
|
147
145
|
function listDiscordDirectoryPeersLive(params) {
|
|
148
146
|
return listDiscordDirectoryLive(params, "user");
|
|
149
147
|
}
|
|
150
|
-
//#endregion
|
|
151
148
|
export { normalizeDiscordSnowflake as a, normalizeDiscordHandleKey as i, listDiscordDirectoryGroupsLive as n, rememberDiscordDirectoryUser as o, listDiscordDirectoryPeersLive as r, resolveDiscordDirectoryUserId as s, directory_live_exports as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { D as getDiscordEndpointRuntime, T as parseDiscordRetryAfterBodySeconds } from "./allow-list-
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { D as getDiscordEndpointRuntime, T as parseDiscordRetryAfterBodySeconds } from "./allow-list-D1ZGfhXh.mjs";
|
|
3
3
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
4
4
|
import { asOptionalObjectRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { ApplicationCommandOptionType, ApplicationCommandType, ButtonStyle, ComponentType, GatewayDispatchEvents, InteractionContextType, InteractionResponseType, InteractionType, MessageFlags, Routes, TextInputStyle } from "discord-api-types/v10";
|
|
@@ -16,12 +16,11 @@ import { AsyncLocalStorage } from "node:async_hooks";
|
|
|
16
16
|
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
17
17
|
import { redactIdentifier, redactSensitiveFieldValue } from "openclaw/plugin-sdk/logging-core";
|
|
18
18
|
import { parseRetryAfterHeaderSeconds } from "openclaw/plugin-sdk/retry-runtime";
|
|
19
|
-
|
|
19
|
+
// extensions/discord/src/internal/undefined-fields.ts
|
|
20
20
|
function stripUndefinedFields(value) {
|
|
21
21
|
return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0));
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
//#region extensions/discord/src/internal/api.guild.ts
|
|
23
|
+
// extensions/discord/src/internal/api.guild.ts
|
|
25
24
|
const discordGuildEmojiListSchema = Type.Array(Type.Object({
|
|
26
25
|
id: Type.Union([Type.String(), Type.Null()]),
|
|
27
26
|
name: Type.Union([Type.String(), Type.Null()]),
|
|
@@ -40,8 +39,7 @@ async function listGuildEmojis(rest, guildId) {
|
|
|
40
39
|
if (!Check(discordGuildEmojiListSchema, emojis)) throw new Error("Invalid Discord guild emoji response.");
|
|
41
40
|
return emojis;
|
|
42
41
|
}
|
|
43
|
-
|
|
44
|
-
//#region extensions/discord/src/internal/api.messages.ts
|
|
42
|
+
// extensions/discord/src/internal/api.messages.ts
|
|
45
43
|
function normalizeDiscordMessageId(messageId) {
|
|
46
44
|
const normalized = messageId.trim();
|
|
47
45
|
if (!/^[0-9]+$/u.test(normalized)) throw new Error("Invalid Discord message ID. Expected decimal digits.");
|
|
@@ -74,8 +72,7 @@ async function createThread(rest, channelId, data, messageId) {
|
|
|
74
72
|
const route = messageId === void 0 ? Routes.threads(channelId) : Routes.threads(channelId, normalizeDiscordMessageId(messageId));
|
|
75
73
|
return await rest.post(route, data);
|
|
76
74
|
}
|
|
77
|
-
|
|
78
|
-
//#region extensions/discord/src/internal/api.reactions.ts
|
|
75
|
+
// extensions/discord/src/internal/api.reactions.ts
|
|
79
76
|
function ownReactionMutation(method) {
|
|
80
77
|
return async (rest, channelId, messageId, encodedEmoji) => {
|
|
81
78
|
await rest[method](Routes.channelMessageOwnReaction(channelId, normalizeDiscordMessageId(messageId), encodedEmoji));
|
|
@@ -86,8 +83,7 @@ const deleteOwnMessageReaction = ownReactionMutation("delete");
|
|
|
86
83
|
async function listMessageReactionUsers(rest, channelId, messageId, encodedEmoji, query) {
|
|
87
84
|
return await rest.get(Routes.channelMessageReaction(channelId, normalizeDiscordMessageId(messageId), encodedEmoji), query);
|
|
88
85
|
}
|
|
89
|
-
|
|
90
|
-
//#region extensions/discord/src/internal/api.users.ts
|
|
86
|
+
// extensions/discord/src/internal/api.users.ts
|
|
91
87
|
async function getCurrentUser(rest) {
|
|
92
88
|
return await rest.get(Routes.user("@me"));
|
|
93
89
|
}
|
|
@@ -97,13 +93,11 @@ async function getUser(rest, userId) {
|
|
|
97
93
|
async function createUserDmChannel(rest, recipientId) {
|
|
98
94
|
return await rest.post(Routes.userChannels(), { body: { recipient_id: recipientId } });
|
|
99
95
|
}
|
|
100
|
-
|
|
101
|
-
//#region extensions/discord/src/internal/api.webhooks.ts
|
|
96
|
+
// extensions/discord/src/internal/api.webhooks.ts
|
|
102
97
|
async function createChannelWebhook(rest, channelId, data) {
|
|
103
98
|
return await rest.post(Routes.channelWebhooks(channelId), data);
|
|
104
99
|
}
|
|
105
|
-
|
|
106
|
-
//#region extensions/discord/src/internal/command-comparison.ts
|
|
100
|
+
// extensions/discord/src/internal/command-comparison.ts
|
|
107
101
|
const unorderedCommandArrayFields = /* @__PURE__ */ new Set([
|
|
108
102
|
"channel_types",
|
|
109
103
|
"contexts",
|
|
@@ -160,8 +154,7 @@ function normalizeDescriptionForComparison(description) {
|
|
|
160
154
|
function commandsEqual(a, b) {
|
|
161
155
|
return JSON.stringify(comparableCommand(a)) === JSON.stringify(comparableCommand(b));
|
|
162
156
|
}
|
|
163
|
-
|
|
164
|
-
//#region extensions/discord/src/internal/command-deploy.ts
|
|
157
|
+
// extensions/discord/src/internal/command-deploy.ts
|
|
165
158
|
const DISCORD_APPLICATION_COMMAND_LIMIT_REACHED = 30032;
|
|
166
159
|
var DiscordCommandDeployer = class {
|
|
167
160
|
constructor(params) {
|
|
@@ -228,8 +221,7 @@ function stableCommandSetHash(commands) {
|
|
|
228
221
|
const stable = commands.toSorted((a, b) => stableCommandKey(a).localeCompare(stableCommandKey(b))).map((command) => stableComparableObject(command));
|
|
229
222
|
return createHash("sha256").update(JSON.stringify(stable)).digest("hex");
|
|
230
223
|
}
|
|
231
|
-
|
|
232
|
-
//#region extensions/discord/src/internal/components.base.ts
|
|
224
|
+
// extensions/discord/src/internal/components.base.ts
|
|
233
225
|
function parseCustomId(id) {
|
|
234
226
|
const [rawKey = "", ...parts] = id.split(";");
|
|
235
227
|
const [keyPart = "", firstValue] = rawKey.split("=");
|
|
@@ -268,8 +260,7 @@ var BaseMessageInteractiveComponent = class extends BaseComponent {
|
|
|
268
260
|
run(_interaction, _data) {}
|
|
269
261
|
};
|
|
270
262
|
var BaseModalComponent = class extends BaseComponent {};
|
|
271
|
-
|
|
272
|
-
//#region extensions/discord/src/internal/component-registry.ts
|
|
263
|
+
// extensions/discord/src/internal/component-registry.ts
|
|
273
264
|
var ComponentRegistry = class {
|
|
274
265
|
constructor() {
|
|
275
266
|
this.entries = /* @__PURE__ */ new Map();
|
|
@@ -295,8 +286,7 @@ var ComponentRegistry = class {
|
|
|
295
286
|
return this.wildcardEntries.find((entry) => options?.componentType === void 0 || entry.type === options.componentType);
|
|
296
287
|
}
|
|
297
288
|
};
|
|
298
|
-
|
|
299
|
-
//#region extensions/discord/src/internal/structures.ts
|
|
289
|
+
// extensions/discord/src/internal/structures.ts
|
|
300
290
|
var Base = class {
|
|
301
291
|
constructor(client) {
|
|
302
292
|
this.client = client;
|
|
@@ -457,8 +447,7 @@ function channelFactory(clientForTest, channelData) {
|
|
|
457
447
|
ownerId: "owner_id" in channelData ? channelData.owner_id : void 0
|
|
458
448
|
};
|
|
459
449
|
}
|
|
460
|
-
|
|
461
|
-
//#region extensions/discord/src/internal/entity-cache.ts
|
|
450
|
+
// extensions/discord/src/internal/entity-cache.ts
|
|
462
451
|
const DEFAULT_REST_CACHE_TTL_MS = 3e4;
|
|
463
452
|
const DEFAULT_MAX_ENTRIES = 5e3;
|
|
464
453
|
const DEFAULT_SWEEP_INTERVAL_MS = 3e4;
|
|
@@ -545,8 +534,7 @@ var DiscordEntityCache = class {
|
|
|
545
534
|
for (const [key, entry] of this.entries) if (entry.expiresAt <= now) this.entries.delete(key);
|
|
546
535
|
}
|
|
547
536
|
};
|
|
548
|
-
|
|
549
|
-
//#region extensions/discord/src/internal/event-queue.ts
|
|
537
|
+
// extensions/discord/src/internal/event-queue.ts
|
|
550
538
|
const DEFAULT_MAX_QUEUE_SIZE = 1e4;
|
|
551
539
|
const DEFAULT_MAX_CONCURRENCY = 50;
|
|
552
540
|
const DEFAULT_LISTENER_TIMEOUT_MS = 12e4;
|
|
@@ -652,8 +640,7 @@ function normalizePositiveInteger(value, fallback) {
|
|
|
652
640
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return fallback;
|
|
653
641
|
return Math.max(1, Math.floor(value));
|
|
654
642
|
}
|
|
655
|
-
|
|
656
|
-
//#region extensions/discord/src/internal/commands.ts
|
|
643
|
+
// extensions/discord/src/internal/commands.ts
|
|
657
644
|
async function deferCommandInteractionIfNeeded(command, interaction) {
|
|
658
645
|
if (!command.defer) return;
|
|
659
646
|
await interaction.defer({ ephemeral: command.ephemeral });
|
|
@@ -741,8 +728,7 @@ var CommandWithSubcommands = class extends BaseCommand {
|
|
|
741
728
|
}));
|
|
742
729
|
}
|
|
743
730
|
};
|
|
744
|
-
|
|
745
|
-
//#region extensions/discord/src/internal/interaction-options.ts
|
|
731
|
+
// extensions/discord/src/internal/interaction-options.ts
|
|
746
732
|
function findOption(options, matches) {
|
|
747
733
|
for (const option of options ?? []) {
|
|
748
734
|
if (matches(option)) return option;
|
|
@@ -785,13 +771,11 @@ var OptionsHandler = class {
|
|
|
785
771
|
return findOption(this.rawOptions, (option) => "focused" in option && Boolean(option.focused));
|
|
786
772
|
}
|
|
787
773
|
};
|
|
788
|
-
|
|
789
|
-
//#region extensions/discord/src/internal/interaction-response.ts
|
|
774
|
+
// extensions/discord/src/internal/interaction-response.ts
|
|
790
775
|
function needsComponentsV2Query(body) {
|
|
791
776
|
return body !== null && typeof body === "object" && "flags" in body && typeof body.flags === "number" && (body.flags & MessageFlags.IsComponentsV2) !== 0;
|
|
792
777
|
}
|
|
793
|
-
|
|
794
|
-
//#region extensions/discord/src/internal/modal-fields.ts
|
|
778
|
+
// extensions/discord/src/internal/modal-fields.ts
|
|
795
779
|
function extractModalFields(components) {
|
|
796
780
|
const out = {};
|
|
797
781
|
for (const component of flattenModalComponents(components)) {
|
|
@@ -850,8 +834,7 @@ var ModalFields = class {
|
|
|
850
834
|
});
|
|
851
835
|
}
|
|
852
836
|
};
|
|
853
|
-
|
|
854
|
-
//#region extensions/discord/src/internal/embeds.ts
|
|
837
|
+
// extensions/discord/src/internal/embeds.ts
|
|
855
838
|
var Embed = class {
|
|
856
839
|
constructor(embed) {
|
|
857
840
|
Object.assign(this, embed);
|
|
@@ -871,8 +854,7 @@ var Embed = class {
|
|
|
871
854
|
});
|
|
872
855
|
}
|
|
873
856
|
};
|
|
874
|
-
|
|
875
|
-
//#region extensions/discord/src/internal/payload.ts
|
|
857
|
+
// extensions/discord/src/internal/payload.ts
|
|
876
858
|
function hasDiscordV2Components(components) {
|
|
877
859
|
return Boolean(components?.some((component) => "isV2" in component && component.isV2 || "type" in component && component.type !== ComponentType.ActionRow));
|
|
878
860
|
}
|
|
@@ -897,8 +879,7 @@ function serializePayload(payload) {
|
|
|
897
879
|
sticker_ids: payload.stickers
|
|
898
880
|
});
|
|
899
881
|
}
|
|
900
|
-
|
|
901
|
-
//#region extensions/discord/src/internal/schemas.ts
|
|
882
|
+
// extensions/discord/src/internal/schemas.ts
|
|
902
883
|
const discordInteractionPayloadSchema = Type.Object({
|
|
903
884
|
id: Type.String({ minLength: 1 }),
|
|
904
885
|
token: Type.String({ minLength: 1 }),
|
|
@@ -916,8 +897,7 @@ function assertDiscordInteractionPayload(value) {
|
|
|
916
897
|
function isDiscordRateLimitBody(value) {
|
|
917
898
|
return Check(discordRateLimitBodySchema, value);
|
|
918
899
|
}
|
|
919
|
-
|
|
920
|
-
//#region extensions/discord/src/internal/interactions.ts
|
|
900
|
+
// extensions/discord/src/internal/interactions.ts
|
|
921
901
|
function readInteractionUser(rawData, client) {
|
|
922
902
|
const directUser = "user" in rawData ? rawData.user : void 0;
|
|
923
903
|
if (directUser && typeof directUser === "object" && "id" in directUser) return new User(client, directUser);
|
|
@@ -1081,8 +1061,7 @@ function createInteraction(client, rawData) {
|
|
|
1081
1061
|
if (rawData.type === InteractionType.MessageComponent) return new ((componentInteractions.get(rawData.data?.component_type)) ?? BaseComponentInteraction)(client, rawData);
|
|
1082
1062
|
return new BaseInteraction(client, rawData);
|
|
1083
1063
|
}
|
|
1084
|
-
|
|
1085
|
-
//#region extensions/discord/src/internal/interaction-dispatch.ts
|
|
1064
|
+
// extensions/discord/src/internal/interaction-dispatch.ts
|
|
1086
1065
|
async function dispatchInteraction(client, rawData) {
|
|
1087
1066
|
const interaction = createInteraction(client, rawData);
|
|
1088
1067
|
if (rawData.type === InteractionType.ApplicationCommandAutocomplete) {
|
|
@@ -1152,8 +1131,7 @@ async function deferComponentInteractionIfNeeded(component, interaction) {
|
|
|
1152
1131
|
}
|
|
1153
1132
|
await interaction.acknowledge();
|
|
1154
1133
|
}
|
|
1155
|
-
|
|
1156
|
-
//#region extensions/discord/src/internal/request-authority.ts
|
|
1134
|
+
// extensions/discord/src/internal/request-authority.ts
|
|
1157
1135
|
const requestAuthority = resolveGlobalSingleton(Symbol.for("openclaw.discord.requestAuthority"), () => new AsyncLocalStorage());
|
|
1158
1136
|
/** Carry the host's existing assertion without changing its lifetime or ownership. */
|
|
1159
1137
|
function withDiscordRequestAuthority(assertCurrent, run) {
|
|
@@ -1167,8 +1145,7 @@ function withDiscordRequestAuthority(assertCurrent, run) {
|
|
|
1167
1145
|
function captureDiscordRequestAuthority() {
|
|
1168
1146
|
return requestAuthority.getStore();
|
|
1169
1147
|
}
|
|
1170
|
-
|
|
1171
|
-
//#region extensions/discord/src/internal/rest-body.ts
|
|
1148
|
+
// extensions/discord/src/internal/rest-body.ts
|
|
1172
1149
|
function fileBlob(file) {
|
|
1173
1150
|
return file.data instanceof Blob ? file.data : new Blob([file.data], { type: typeof file.contentType === "string" ? file.contentType : void 0 });
|
|
1174
1151
|
}
|
|
@@ -1226,8 +1203,7 @@ function serializeRequestBody(data, headers) {
|
|
|
1226
1203
|
headers.set("Content-Type", "application/json");
|
|
1227
1204
|
return JSON.stringify(data.body);
|
|
1228
1205
|
}
|
|
1229
|
-
|
|
1230
|
-
//#region extensions/discord/src/internal/rest-errors.ts
|
|
1206
|
+
// extensions/discord/src/internal/rest-errors.ts
|
|
1231
1207
|
const DISCORD_UNKNOWN_MESSAGE = 10008;
|
|
1232
1208
|
const DISCORD_UNKNOWN_VOICE_STATE = 10065;
|
|
1233
1209
|
const DISCORD_ERROR_BODY_MAX_DEPTH = 64;
|
|
@@ -1361,8 +1337,7 @@ var RateLimitError = class extends DiscordError {
|
|
|
1361
1337
|
this.bucket = readDiscordRateLimitBucket(response);
|
|
1362
1338
|
}
|
|
1363
1339
|
};
|
|
1364
|
-
|
|
1365
|
-
//#region extensions/discord/src/internal/rest-routes.ts
|
|
1340
|
+
// extensions/discord/src/internal/rest-routes.ts
|
|
1366
1341
|
const RATE_LIMIT_HEADER_NUMBER_RE = /^\d+(?:\.\d+)?$/;
|
|
1367
1342
|
const DISCORD_ROUTE_IDENTIFIER_HASH_LENGTH = 32;
|
|
1368
1343
|
function redactWebhookTokenInPath(path) {
|
|
@@ -1412,8 +1387,7 @@ function appendQuery(path, query) {
|
|
|
1412
1387
|
for (const [key, value] of Object.entries(query)) search.set(key, String(value));
|
|
1413
1388
|
return `${path}?${search.toString()}`;
|
|
1414
1389
|
}
|
|
1415
|
-
|
|
1416
|
-
//#region extensions/discord/src/internal/rest-scheduler.ts
|
|
1390
|
+
// extensions/discord/src/internal/rest-scheduler.ts
|
|
1417
1391
|
const MAX_QUEUE_SIZE = 1e3;
|
|
1418
1392
|
const MAX_CONCURRENT_WORKERS = 4;
|
|
1419
1393
|
const MAX_RATE_LIMIT_RETRIES = 3;
|
|
@@ -1665,8 +1639,7 @@ var RestScheduler = class {
|
|
|
1665
1639
|
function isGlobalRateLimit(parsed) {
|
|
1666
1640
|
return parsed && typeof parsed === "object" && "global" in parsed ? Boolean(parsed.global) : false;
|
|
1667
1641
|
}
|
|
1668
|
-
|
|
1669
|
-
//#region extensions/discord/src/internal/rest.ts
|
|
1642
|
+
// extensions/discord/src/internal/rest.ts
|
|
1670
1643
|
const defaultOptions = {
|
|
1671
1644
|
baseUrl: "https://discord.com/api",
|
|
1672
1645
|
timeout: 15e3,
|
|
@@ -1845,8 +1818,7 @@ function getRequestPriority(method, path) {
|
|
|
1845
1818
|
if (/^\/interactions\/\d+\/[^/]+\/callback$/.test(normalizedPath)) return "critical";
|
|
1846
1819
|
return normalizedMethod === "GET" ? "background" : "standard";
|
|
1847
1820
|
}
|
|
1848
|
-
|
|
1849
|
-
//#region extensions/discord/src/internal/client.ts
|
|
1821
|
+
// extensions/discord/src/internal/client.ts
|
|
1850
1822
|
var Plugin = class {};
|
|
1851
1823
|
var Client = class {
|
|
1852
1824
|
constructor(options, handlers, plugins = []) {
|
|
@@ -1920,8 +1892,7 @@ var Client = class {
|
|
|
1920
1892
|
})));
|
|
1921
1893
|
}
|
|
1922
1894
|
};
|
|
1923
|
-
|
|
1924
|
-
//#region extensions/discord/src/internal/components.message.ts
|
|
1895
|
+
// extensions/discord/src/internal/components.message.ts
|
|
1925
1896
|
var BaseButton = class extends BaseMessageInteractiveComponent {
|
|
1926
1897
|
constructor(..._args) {
|
|
1927
1898
|
super(..._args);
|
|
@@ -2150,8 +2121,7 @@ var Container = class extends V2Component {
|
|
|
2150
2121
|
});
|
|
2151
2122
|
}
|
|
2152
2123
|
};
|
|
2153
|
-
|
|
2154
|
-
//#region extensions/discord/src/internal/components.modal.ts
|
|
2124
|
+
// extensions/discord/src/internal/components.modal.ts
|
|
2155
2125
|
var TextInput = class extends BaseModalComponent {
|
|
2156
2126
|
constructor(..._args) {
|
|
2157
2127
|
super(..._args);
|
|
@@ -2229,8 +2199,7 @@ var Modal = class {
|
|
|
2229
2199
|
};
|
|
2230
2200
|
}
|
|
2231
2201
|
};
|
|
2232
|
-
|
|
2233
|
-
//#region extensions/discord/src/internal/listeners.ts
|
|
2202
|
+
// extensions/discord/src/internal/listeners.ts
|
|
2234
2203
|
var BaseListener = class {};
|
|
2235
2204
|
var ReadyListener = class extends BaseListener {
|
|
2236
2205
|
constructor(..._args) {
|
|
@@ -2298,8 +2267,7 @@ var ThreadDeleteListener = class extends BaseListener {
|
|
|
2298
2267
|
this.type = GatewayDispatchEvents.ThreadDelete;
|
|
2299
2268
|
}
|
|
2300
2269
|
};
|
|
2301
|
-
|
|
2302
|
-
//#region extensions/discord/src/internal/discord.ts
|
|
2270
|
+
// extensions/discord/src/internal/discord.ts
|
|
2303
2271
|
var discord_exports = /* @__PURE__ */ __exportAll({
|
|
2304
2272
|
AutocompleteInteraction: () => AutocompleteInteraction,
|
|
2305
2273
|
BaseCommand: () => BaseCommand,
|
|
@@ -2386,5 +2354,4 @@ var discord_exports = /* @__PURE__ */ __exportAll({
|
|
|
2386
2354
|
});
|
|
2387
2355
|
import * as import_discord_api_types_v10 from "discord-api-types/v10";
|
|
2388
2356
|
__reExport(discord_exports, import_discord_api_types_v10);
|
|
2389
|
-
//#endregion
|
|
2390
2357
|
export { User as $, StringSelectMenu as A, isUnknownDiscordVoiceStateError as B, LinkButton as C, Row as D, RoleSelectMenu as E, Plugin as F, withDiscordRequestAuthority as G, readDiscordMessage as H, RequestClient as I, Embed as J, hasDiscordV2Components as K, DiscordError as L, Thumbnail as M, UserSelectMenu as N, Section as O, Client as P, Message as Q, RateLimitError as R, File as S, MentionableSelectMenu as T, readRetryAfter as U, readDiscordCode as V, captureDiscordRequestAuthority as W, CommandWithSubcommands as X, Command as Y, Guild as Z, TextInput as _, getGuild as _t, MessageCreateListener as a, createOwnMessageReaction as at, ChannelSelectMenu as b, listGuildEmojis as bt, PresenceUpdateListener as c, createChannelMessage as ct, ThreadUpdateListener as d, editChannelMessage as dt, BaseMessageInteractiveComponent as et, VoiceStateUpdateListener as f, getChannel as ft, RadioGroup as g, unpinChannelMessage as gt, Modal as h, pinChannelMessage as ht, InteractionCreateListener as i, getCurrentUser as it, TextDisplay as j, Separator as k, ReadyListener as l, createThread as lt, Label as m, getThreadMember as mt, GuildCreateListener as n, createChannelWebhook as nt, MessageReactionAddListener as o, deleteOwnMessageReaction as ot, CheckboxGroup as p, getChannelMessage as pt, serializePayload as q, GuildDeleteListener as r, createUserDmChannel as rt, MessageReactionRemoveListener as s, listMessageReactionUsers as st, discord_exports as t, parseCustomId as tt, ThreadDeleteListener as u, deleteChannelMessage as ut, AnySelectMenu as v, getGuildMember as vt, MediaGallery as w, Container as x, stripUndefinedFields as xt, Button as y, getGuildVoiceState as yt, isUnknownDiscordMessageError as z };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
4
|
-
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-
|
|
5
|
-
import { n as normalizeCompatibilityConfig } from "./doctor-contract-
|
|
6
|
-
import { t as isDiscordMutableAllowEntry } from "./security-doctor-
|
|
7
|
-
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId } from "./accounts-C18HNgge.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-X_Xlr42B.mjs";
|
|
3
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-Bp0sxD5R.mjs";
|
|
4
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BpV1jKk0.mjs";
|
|
5
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Dstl3cMg.mjs";
|
|
6
|
+
import { t as isDiscordMutableAllowEntry } from "./security-doctor-4s7omTZd.mjs";
|
|
7
|
+
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-CGgOaWcu.mjs";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
10
|
-
|
|
10
|
+
// extensions/discord/src/doctor.ts
|
|
11
11
|
function sanitizeForLog(value) {
|
|
12
12
|
return value.replace(/\p{Cc}+/gu, " ").trim();
|
|
13
13
|
}
|
|
@@ -184,5 +184,4 @@ const discordDoctor = {
|
|
|
184
184
|
collectMutableAllowlistWarnings: ({ cfg }) => collectDiscordMutableAllowlistWarnings(cfg),
|
|
185
185
|
repairConfig: ({ cfg, doctorFixCommand }) => maybeRepairDiscordNumericIds(cfg, doctorFixCommand)
|
|
186
186
|
};
|
|
187
|
-
//#endregion
|
|
188
187
|
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,19 +1,19 @@
|
|
|
1
|
-
import { G as withDiscordRequestAuthority } from "./discord-
|
|
2
|
-
import { u as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
3
|
-
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-
|
|
4
|
-
import "./targets-
|
|
5
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
6
|
-
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-
|
|
1
|
+
import { G as withDiscordRequestAuthority } from "./discord-eFlHX1Gn.mjs";
|
|
2
|
+
import { u as matchesDiscordToolContextTarget } from "./send.receipt-Dw-_r5Bx.mjs";
|
|
3
|
+
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
4
|
+
import "./targets-BaklhOqq.mjs";
|
|
5
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-CI0UJqeS.mjs";
|
|
6
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-BvOWSPxr.mjs";
|
|
7
7
|
import "../action-runtime-api.js";
|
|
8
|
-
import { C 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 { C as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-TFBPPkoz.mjs";
|
|
9
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-BvBCfhXF.mjs";
|
|
10
|
+
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-BAc_Xik-.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();
|
|
@@ -277,5 +277,4 @@ async function dispatchDiscordMessageAction(ctx) {
|
|
|
277
277
|
}
|
|
278
278
|
throw new Error(`Action ${action} is not supported for provider ${providerId}.`);
|
|
279
279
|
}
|
|
280
|
-
//#endregion
|
|
281
280
|
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-CI0UJqeS.mjs";
|
|
2
2
|
import "../action-runtime-api.js";
|
|
3
|
-
import { S as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-
|
|
3
|
+
import { S as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-TFBPPkoz.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",
|
|
@@ -191,5 +191,4 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
191
191
|
}, readPolicyOptions);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
//#endregion
|
|
195
194
|
export { tryHandleDiscordMessageActionGuildAdmin as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as normalizeDiscordAllowList } from "./allow-list-
|
|
1
|
+
import { i as normalizeDiscordAllowList } from "./allow-list-D1ZGfhXh.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:",
|
|
@@ -55,8 +55,7 @@ const discordIngressIdentity = defineStableChannelIngressIdentity({
|
|
|
55
55
|
sensitivity: "pii"
|
|
56
56
|
}))
|
|
57
57
|
});
|
|
58
|
-
|
|
59
|
-
//#region extensions/discord/src/live-policy-config.ts
|
|
58
|
+
// extensions/discord/src/live-policy-config.ts
|
|
60
59
|
/** Account policy consumed at inbound admission, without replacing the transport. */
|
|
61
60
|
function selectDiscordLivePolicyConfig(config) {
|
|
62
61
|
return {
|
|
@@ -69,5 +68,4 @@ function selectDiscordLivePolicyConfig(config) {
|
|
|
69
68
|
dangerouslyAllowNameMatching: config.dangerouslyAllowNameMatching
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
|
-
//#endregion
|
|
73
71
|
export { discordIngressIdentity as n, selectDiscordLivePolicyConfig as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as getDiscordEndpointRuntime, k as resolveDiscordEndpointMediaGuard } from "./allow-list-
|
|
2
|
-
import { t as getDiscordRuntime } from "./runtime-
|
|
3
|
-
import { D as createDiscordLivePolicyReader, O as mapGatewayDispatchData } from "./provider-
|
|
4
|
-
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-
|
|
1
|
+
import { D as getDiscordEndpointRuntime, k as resolveDiscordEndpointMediaGuard } from "./allow-list-D1ZGfhXh.mjs";
|
|
2
|
+
import { t as getDiscordRuntime } from "./runtime-DcBvHOm1.mjs";
|
|
3
|
+
import { D as createDiscordLivePolicyReader, O as mapGatewayDispatchData } from "./provider-BBDuE14w.mjs";
|
|
4
|
+
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-CGgOaWcu.mjs";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
7
7
|
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -15,7 +15,7 @@ import { DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, createChannelIngressError, createCh
|
|
|
15
15
|
import { fanInChannelIngressLifecycles } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
16
16
|
import { createDeferred } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
17
17
|
import { createChannelInboundDebouncer, resolveInboundDebounceMs, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
|
|
18
|
-
|
|
18
|
+
// extensions/discord/src/monitor/ingress.ts
|
|
19
19
|
const DISCORD_INGRESS_PAYLOAD_VERSION = 1;
|
|
20
20
|
const DISCORD_INGRESS_DRAIN_INTERVAL_MS = 1e3;
|
|
21
21
|
const DiscordIngressPayloadError = createChannelIngressError("DiscordIngressPayloadError");
|
|
@@ -117,8 +117,7 @@ function createDiscordIngressMonitor(params) {
|
|
|
117
117
|
stop: monitor.stop
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
//#region extensions/discord/src/monitor/message-avatar.ts
|
|
120
|
+
// extensions/discord/src/monitor/message-avatar.ts
|
|
122
121
|
const DISCORD_AVATAR_MAX_BYTES = 262144;
|
|
123
122
|
const DISCORD_AVATAR_CACHE_MAX_ENTRIES = 128;
|
|
124
123
|
const DISCORD_GUILD_ICON_TTL_MS = 3e5;
|
|
@@ -193,9 +192,8 @@ function createDiscordAvatarResolver() {
|
|
|
193
192
|
return guildIcon?.hash ? resolveSavedAvatar(`${params.conversationId}\0${guildIcon.hash}`, discordAvatarUrl("icons", params.guildId, guildIcon.hash), endpointRuntime) : void 0;
|
|
194
193
|
} };
|
|
195
194
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-BZeWmSNC.mjs"));
|
|
195
|
+
// extensions/discord/src/monitor/message-run-queue.ts
|
|
196
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-ClOwIPDK.mjs"));
|
|
199
197
|
async function processDiscordQueuedMessage(params) {
|
|
200
198
|
const abortSignal = params.job.context.abortSignal && params.lifecycleSignal ? AbortSignal.any([params.job.context.abortSignal, params.lifecycleSignal]) : params.job.context.abortSignal ?? params.lifecycleSignal;
|
|
201
199
|
try {
|
|
@@ -277,9 +275,8 @@ function createDiscordMessageRunQueue(params) {
|
|
|
277
275
|
}
|
|
278
276
|
};
|
|
279
277
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-BqUw7LWb.mjs"));
|
|
278
|
+
// extensions/discord/src/monitor/message-dispatcher.ts
|
|
279
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-DkjwNZAd.mjs"));
|
|
283
280
|
function createDiscordMessageDispatcher(params) {
|
|
284
281
|
const readPolicy = params.readPolicy ?? createDiscordLivePolicyReader({
|
|
285
282
|
...params,
|
|
@@ -456,8 +453,7 @@ function createDiscordMessageDispatcher(params) {
|
|
|
456
453
|
};
|
|
457
454
|
return handler;
|
|
458
455
|
}
|
|
459
|
-
|
|
460
|
-
//#region extensions/discord/src/monitor/message-handler.ts
|
|
456
|
+
// extensions/discord/src/monitor/message-handler.ts
|
|
461
457
|
function createDiscordMessageHandler(params) {
|
|
462
458
|
const dispatcher = createDiscordMessageDispatcher(params);
|
|
463
459
|
const ingress = (params.testing?.createIngressMonitor ?? createDiscordIngressMonitor)({
|
|
@@ -488,5 +484,4 @@ function createDiscordMessageHandler(params) {
|
|
|
488
484
|
};
|
|
489
485
|
return handler;
|
|
490
486
|
}
|
|
491
|
-
//#endregion
|
|
492
487
|
export { createDiscordMessageHandler as t };
|