@openclaw/discord 2026.10.10 → 2026.10.33
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-X_Xlr42B.mjs → account-inspect-8cCu6uPG.mjs} +3 -2
- package/dist/.setup/{accounts-C18HNgge.mjs → accounts-ljrzXBJi.mjs} +8 -4
- package/dist/.setup/{active-turn-thread-route-BAc_Xik-.mjs → active-turn-thread-route-C4tp9noA.mjs} +2 -1
- package/dist/.setup/{allow-list-D1ZGfhXh.mjs → allow-list-BKqOldGy.mjs} +11 -6
- package/dist/.setup/{api-Bth1wKF9.mjs → api-DqmMUZau.mjs} +5 -3
- package/dist/.setup/{approval-handler.runtime-BAoEELJJ.mjs → approval-handler.runtime-D0qu1um7.mjs} +9 -8
- package/dist/.setup/{approval-message-updates-Cks-MSCJ.mjs → approval-message-updates-CdurC9Ej.mjs} +4 -3
- package/dist/.setup/{audit-Dw_rAZIz.mjs → audit-ChorIwio.mjs} +7 -6
- package/dist/.setup/{channel-BMpMAeQL.mjs → channel-ZilgdF5e.mjs} +41 -33
- package/dist/.setup/{channel-access-BPrWoEXM.mjs → channel-access-DasWY_OV.mjs} +2 -1
- package/dist/.setup/{channel.setup-DVe7Y3Jf.mjs → channel.setup-DaDQdctj.mjs} +12 -8
- package/dist/.setup/{command-deploy-store-DPWiBMks.mjs → command-deploy-store-DFkBTViB.mjs} +2 -1
- package/dist/.setup/{command-owners-BzlhNBxA.mjs → command-owners-C7rUdqUX.mjs} +2 -1
- package/dist/.setup/{components-BvOWSPxr.mjs → components-Du9NhD8h.mjs} +20 -11
- package/dist/.setup/{config-schema-Coyq5wOr.mjs → config-schema-_uBILpQf.mjs} +5 -3
- package/dist/.setup/{conversation-binding-route-DOPUZNYo.mjs → conversation-binding-route-8Ul1KpGF.mjs} +3 -2
- package/dist/.setup/{directory-config-CIqVnQtn.mjs → directory-config-3iVub-3m.mjs} +4 -3
- package/dist/.setup/{directory-live-DUuPEWub.mjs → directory-live-BDVl2DoC.mjs} +15 -14
- package/dist/.setup/{discord-eFlHX1Gn.mjs → discord-BMD-JiVS.mjs} +68 -35
- package/dist/.setup/{doctor-contract-Dstl3cMg.mjs → doctor-contract-Bwv8EuQ_.mjs} +3 -2
- package/dist/.setup/{doctor-Dty_Ossy.mjs → doctor-hQKbkNKq.mjs} +9 -8
- package/dist/.setup/{handle-action-DXY91jF-.mjs → handle-action-B1lmt4ms.mjs} +11 -10
- package/dist/.setup/{handle-action.guild-admin-BvBCfhXF.mjs → handle-action.guild-admin-B6g31cwt.mjs} +4 -3
- package/dist/.setup/{live-policy-config-DO1Fk2hp.mjs → live-policy-config-C_Q966Wh.mjs} +5 -3
- package/dist/.setup/{message-handler-fL1j1NiR.mjs → message-handler-CkI3yMjL.mjs} +20 -14
- package/dist/.setup/{message-handler.preflight-DkjwNZAd.mjs → message-handler.preflight-CEfkFV9U.mjs} +28 -20
- package/dist/.setup/{message-handler.preflight-pluralkit-DR4BnvMU.mjs → message-handler.preflight-pluralkit-D5si80_L.mjs} +14 -10
- package/dist/.setup/{message-handler.process-ClOwIPDK.mjs → message-handler.process-DsMtetRf.mjs} +47 -33
- package/dist/.setup/{outbound-adapter-DWyAWBFh.mjs → outbound-adapter-DfAanoCO.mjs} +19 -13
- package/dist/.setup/{outbound-session-route-TFBPPkoz.mjs → outbound-session-route-BtUpGBTb.mjs} +32 -21
- package/dist/.setup/{output-activity-CDgs2s3O.mjs → output-activity-uBpMSX75.mjs} +2 -1
- package/dist/.setup/{pluralkit-DcXbHTpQ.mjs → pluralkit-B64dfq_j.mjs} +3 -2
- package/dist/.setup/{preflight-audio-CwtPIsvk.mjs → preflight-audio-wWgsZG5F.mjs} +2 -1
- package/dist/.setup/{presence-cache-CgutE4NN.mjs → presence-cache-DCeTsL73.mjs} +2 -1
- package/dist/.setup/{probe-DNge7OEP.mjs → probe-CBaoCs-c.mjs} +6 -5
- package/dist/.setup/{provider-BBDuE14w.mjs → provider-CI_OLfvz.mjs} +209 -119
- package/dist/.setup/{provider-session.runtime-D8hMXXqJ.mjs → provider-session.runtime-TWOo_JZx.mjs} +3 -3
- package/dist/.setup/provider.runtime-DnionCyo.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-cetognkp.mjs → realtime-session.runtime-DvfS4vJj.mjs} +23 -14
- package/dist/.setup/{receive-recovery-C77CVdGM.mjs → receive-recovery-CKvaG2Hf.mjs} +6 -3
- package/dist/.setup/{resolve-allowlist-common-CI77288n.mjs → resolve-allowlist-common-cIjtqh2F.mjs} +7 -5
- package/dist/.setup/{resolve-channels-DYc6-xgV.mjs → resolve-channels-Cj5i7hzj.mjs} +10 -7
- package/dist/.setup/{resolve-users-BQT7XWF2.mjs → resolve-users-BQLbysRB.mjs} +5 -4
- package/dist/.setup/{rolldown-runtime-nwUcYXjP.mjs → rolldown-runtime-B4FMCO8f.mjs} +2 -1
- package/dist/.setup/{runtime-DcBvHOm1.mjs → runtime-DgnVQ7zW.mjs} +2 -1
- package/dist/.setup/{runtime-CI0UJqeS.mjs → runtime-RWnuJgWB.mjs} +35 -23
- package/dist/.setup/{runtime-doctor-migrations-BpV1jKk0.mjs → runtime-doctor-migrations-BPV-R4G9.mjs} +9 -5
- package/dist/.setup/{runtime-CcijhTJT.mjs → runtime-plifsKg9.mjs} +6 -4
- package/dist/.setup/{secret-config-contract-BdbCvqnM.mjs → secret-config-contract-z6FhbT8E.mjs} +3 -2
- package/dist/.setup/{security-audit-CTwisG7c.mjs → security-audit-BFT84Uny.mjs} +4 -3
- package/dist/.setup/{security-contract-D-o0iWDk.mjs → security-contract-DNyyjTZZ.mjs} +2 -1
- package/dist/.setup/{security-doctor-4s7omTZd.mjs → security-doctor-nGgPm65L.mjs} +2 -1
- package/dist/.setup/{send-Cbq-IVsS.mjs → send-da6ENJ9f.mjs} +28 -18
- package/dist/.setup/{send.components-BV6ucNpJ.mjs → send.components-CWZUuGvA.mjs} +15 -10
- package/dist/.setup/{send.outbound-CGhBhzjQ.mjs → send.outbound-qZ3iK3Vq.mjs} +13 -9
- package/dist/.setup/{send.receipt-Dw-_r5Bx.mjs → send.receipt-C18khRYH.mjs} +16 -9
- package/dist/.setup/{send.shared-D4MioxW_.mjs → send.shared-CnlMgoqQ.mjs} +23 -14
- package/dist/.setup/{sender-identity-DrN5c4ec.mjs → sender-identity-DgbJykq0.mjs} +3 -2
- package/dist/.setup/{session-contract-Bq71MS78.mjs → session-contract-BO5tlIdl.mjs} +2 -1
- package/dist/.setup/{session-key-normalization-Cfvze5hd.mjs → session-key-normalization-CCHGNSQw.mjs} +2 -1
- package/dist/.setup/setup-plugin-api-D1QuM187.mjs +3 -0
- package/dist/.setup/{shared-Bp0sxD5R.mjs → shared-CY5vJM48.mjs} +19 -15
- package/dist/.setup/{subagent-hooks-mQbDkvuD.mjs → subagent-hooks-CIu2TFz3.mjs} +4 -3
- package/dist/.setup/{system-events-2zc2eGfF.mjs → system-events-DCOLXkwS.mjs} +4 -3
- package/dist/.setup/{target-parsing-BiuhcK9Q.mjs → target-parsing-C-HyNxcE.mjs} +2 -1
- package/dist/.setup/{target-resolver-CAHeVfmZ.mjs → target-resolver-CApivu3G.mjs} +7 -6
- package/dist/.setup/targets-UWWZ6gF7.mjs +3 -0
- package/dist/.setup/{thread-binding-api-Drd4Zu-5.mjs → thread-binding-api-BDZJD4na.mjs} +2 -1
- package/dist/.setup/{thread-bindings-Dg7X_ZXP.mjs → thread-bindings-DcvT_JgI.mjs} +11 -8
- package/dist/.setup/{thread-bindings.manager-DCDYksah.mjs → thread-bindings.manager-5Sh7yedN.mjs} +20 -15
- package/dist/.setup/{thread-bindings.session-updates-C76plLS3.mjs → thread-bindings.session-updates-BMdJeJMc.mjs} +9 -5
- package/dist/.setup/{threading-l0UfrE6x.mjs → threading-CzjFeUSe.mjs} +9 -6
- package/dist/.setup/{timeouts-DTrUsJ_W.mjs → timeouts-CuNARfyw.mjs} +2 -1
- package/dist/.setup/{transcripts-source-CGgOaWcu.mjs → transcripts-source-8RDQrSVb.mjs} +38 -26
- package/dist/.setup/{typing-DAv4S2fI.mjs → typing-CNlSKY5S.mjs} +3 -2
- package/dist/.setup/{voice-runtime-DY1EwDfi.mjs → voice-runtime-BsDILmAv.mjs} +55 -33
- package/dist/account-inspect-api.js +3 -2
- package/dist/action-runtime-api.js +2 -1
- package/dist/activities-api.js +20 -13
- package/dist/api.js +22 -21
- package/dist/channel-config-api.js +2 -1
- package/dist/channel-plugin-api.js +2 -1
- package/dist/contract-api.js +2 -1
- package/dist/directory-contract-api.js +3 -2
- package/dist/doctor-contract-api.js +7 -5
- package/dist/index.js +2 -1
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-setter-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/security-audit-contract-api.js +2 -1
- package/dist/security-contract-api.js +2 -1
- package/dist/session-key-api.js +2 -1
- package/dist/setup-entry.js +3 -2
- package/dist/setup-plugin-api.js +2 -1
- package/dist/src/voice/audio-worker.runtime.js +14 -8
- package/dist/subagent-hooks-api.js +3 -2
- package/dist/thread-binding-api.js +2 -1
- package/dist/transcripts-source-api.js +3 -2
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-BQ1z4Aq1.mjs +0 -1
- package/dist/.setup/setup-plugin-api-B4J6wmL1.mjs +0 -2
- package/dist/.setup/targets-BaklhOqq.mjs +0 -3
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-
|
|
1
|
+
import { _ as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-BtUpGBTb.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
|
|
5
5
|
function prepareDiscordBindingRoute(params) {
|
|
6
6
|
let baseRoute;
|
|
7
7
|
return {
|
|
@@ -64,4 +64,5 @@ function applyDiscordBindingRoute(params, resolvedRuntimeRoute, baseRoute) {
|
|
|
64
64
|
configuredRoute
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
+
//#endregion
|
|
67
68
|
export { resolveDiscordConversationBindingRouteAsync as n, resolveDiscordConversationBindingRoute as t };
|
|
@@ -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-B4FMCO8f.mjs";
|
|
2
|
+
import { c as resolveDefaultDiscordAccountId, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-ljrzXBJi.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
|
|
6
6
|
var directory_config_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
listDiscordDirectoryGroupsFromConfig: () => listDiscordDirectoryGroupsFromConfig,
|
|
8
8
|
listDiscordDirectoryPeersFromConfig: () => listDiscordDirectoryPeersFromConfig
|
|
@@ -42,4 +42,5 @@ const listDiscordDirectoryGroupsFromConfig = createResolvedDirectoryEntriesListe
|
|
|
42
42
|
return /^\d+$/.test(cleaned) ? `channel:${cleaned}` : null;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
+
//#endregion
|
|
45
46
|
export { listDiscordDirectoryGroupsFromConfig as n, listDiscordDirectoryPeersFromConfig as r, directory_config_exports as t };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-
|
|
3
|
-
import {
|
|
4
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-ljrzXBJi.mjs";
|
|
3
|
+
import { a as normalizeDiscordDisplaySlug } from "./allow-list-BKqOldGy.mjs";
|
|
4
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DqmMUZau.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
|
+
//#region extensions/discord/src/directory-cache-state.ts
|
|
8
8
|
const discordDirectoryCacheState = { handlesByAccount: /* @__PURE__ */ new Map() };
|
|
9
|
-
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region extensions/discord/src/directory-cache.ts
|
|
10
11
|
const DISCORD_DIRECTORY_CACHE_MAX_ENTRIES = 4e3;
|
|
11
12
|
const DISCORD_DISCRIMINATOR_SUFFIX = /#\d{4}$/;
|
|
12
13
|
function normalizeDiscordSnowflake(value) {
|
|
@@ -30,8 +31,9 @@ function ensureAccountCache(accountId) {
|
|
|
30
31
|
return created;
|
|
31
32
|
}
|
|
32
33
|
function setCacheEntry(cache, key, userId) {
|
|
34
|
+
const previous = cache.get(key);
|
|
33
35
|
cache.delete(key);
|
|
34
|
-
cache.set(key, userId);
|
|
36
|
+
cache.set(key, previous === void 0 || previous === userId ? userId : null);
|
|
35
37
|
if (cache.size <= DISCORD_DIRECTORY_CACHE_MAX_ENTRIES) return;
|
|
36
38
|
const oldest = cache.keys().next();
|
|
37
39
|
if (!oldest.done) cache.delete(oldest.value);
|
|
@@ -54,13 +56,10 @@ function resolveDiscordDirectoryUserId(params) {
|
|
|
54
56
|
if (!cache) return;
|
|
55
57
|
const handle = normalizeDiscordHandleKey(params.handle);
|
|
56
58
|
if (!handle) return;
|
|
57
|
-
|
|
58
|
-
if (direct) return direct;
|
|
59
|
-
const withoutDiscriminator = handle.replace(DISCORD_DISCRIMINATOR_SUFFIX, "");
|
|
60
|
-
if (!withoutDiscriminator || withoutDiscriminator === handle) return;
|
|
61
|
-
return cache.get(withoutDiscriminator);
|
|
59
|
+
return cache.get(handle) ?? void 0;
|
|
62
60
|
}
|
|
63
|
-
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region extensions/discord/src/directory-live.ts
|
|
64
63
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
65
64
|
listDiscordDirectoryGroupsLive: () => listDiscordDirectoryGroupsLive,
|
|
66
65
|
listDiscordDirectoryPeersLive: () => listDiscordDirectoryPeersLive
|
|
@@ -85,6 +84,7 @@ async function listDiscordDirectoryLive(params, kind) {
|
|
|
85
84
|
const access = resolveDiscordDirectoryAccess(params);
|
|
86
85
|
if (!access || kind === "user" && !access.query) return [];
|
|
87
86
|
const { token, query, accountId } = access;
|
|
87
|
+
const channelQuery = normalizeDiscordDisplaySlug(query);
|
|
88
88
|
const guilds = await listDiscordGuilds(token);
|
|
89
89
|
const rows = [];
|
|
90
90
|
const seenUserIds = /* @__PURE__ */ new Set();
|
|
@@ -94,7 +94,7 @@ async function listDiscordDirectoryLive(params, kind) {
|
|
|
94
94
|
for (const channel of channels) {
|
|
95
95
|
const name = channel.name?.trim();
|
|
96
96
|
if (!name) continue;
|
|
97
|
-
if (
|
|
97
|
+
if (channelQuery && !normalizeDiscordDisplaySlug(name).includes(channelQuery)) continue;
|
|
98
98
|
rows.push({
|
|
99
99
|
kind: "group",
|
|
100
100
|
id: `channel:${channel.id}`,
|
|
@@ -145,4 +145,5 @@ function listDiscordDirectoryGroupsLive(params) {
|
|
|
145
145
|
function listDiscordDirectoryPeersLive(params) {
|
|
146
146
|
return listDiscordDirectoryLive(params, "user");
|
|
147
147
|
}
|
|
148
|
+
//#endregion
|
|
148
149
|
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-B4FMCO8f.mjs";
|
|
2
|
+
import { D as getDiscordEndpointRuntime, T as parseDiscordRetryAfterBodySeconds } from "./allow-list-BKqOldGy.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,11 +16,12 @@ 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
|
+
//#region 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
|
-
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region extensions/discord/src/internal/api.guild.ts
|
|
24
25
|
const discordGuildEmojiListSchema = Type.Array(Type.Object({
|
|
25
26
|
id: Type.Union([Type.String(), Type.Null()]),
|
|
26
27
|
name: Type.Union([Type.String(), Type.Null()]),
|
|
@@ -39,7 +40,8 @@ async function listGuildEmojis(rest, guildId) {
|
|
|
39
40
|
if (!Check(discordGuildEmojiListSchema, emojis)) throw new Error("Invalid Discord guild emoji response.");
|
|
40
41
|
return emojis;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region extensions/discord/src/internal/api.messages.ts
|
|
43
45
|
function normalizeDiscordMessageId(messageId) {
|
|
44
46
|
const normalized = messageId.trim();
|
|
45
47
|
if (!/^[0-9]+$/u.test(normalized)) throw new Error("Invalid Discord message ID. Expected decimal digits.");
|
|
@@ -72,7 +74,8 @@ async function createThread(rest, channelId, data, messageId) {
|
|
|
72
74
|
const route = messageId === void 0 ? Routes.threads(channelId) : Routes.threads(channelId, normalizeDiscordMessageId(messageId));
|
|
73
75
|
return await rest.post(route, data);
|
|
74
76
|
}
|
|
75
|
-
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region extensions/discord/src/internal/api.reactions.ts
|
|
76
79
|
function ownReactionMutation(method) {
|
|
77
80
|
return async (rest, channelId, messageId, encodedEmoji) => {
|
|
78
81
|
await rest[method](Routes.channelMessageOwnReaction(channelId, normalizeDiscordMessageId(messageId), encodedEmoji));
|
|
@@ -83,7 +86,8 @@ const deleteOwnMessageReaction = ownReactionMutation("delete");
|
|
|
83
86
|
async function listMessageReactionUsers(rest, channelId, messageId, encodedEmoji, query) {
|
|
84
87
|
return await rest.get(Routes.channelMessageReaction(channelId, normalizeDiscordMessageId(messageId), encodedEmoji), query);
|
|
85
88
|
}
|
|
86
|
-
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region extensions/discord/src/internal/api.users.ts
|
|
87
91
|
async function getCurrentUser(rest) {
|
|
88
92
|
return await rest.get(Routes.user("@me"));
|
|
89
93
|
}
|
|
@@ -93,11 +97,13 @@ async function getUser(rest, userId) {
|
|
|
93
97
|
async function createUserDmChannel(rest, recipientId) {
|
|
94
98
|
return await rest.post(Routes.userChannels(), { body: { recipient_id: recipientId } });
|
|
95
99
|
}
|
|
96
|
-
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region extensions/discord/src/internal/api.webhooks.ts
|
|
97
102
|
async function createChannelWebhook(rest, channelId, data) {
|
|
98
103
|
return await rest.post(Routes.channelWebhooks(channelId), data);
|
|
99
104
|
}
|
|
100
|
-
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region extensions/discord/src/internal/command-comparison.ts
|
|
101
107
|
const unorderedCommandArrayFields = /* @__PURE__ */ new Set([
|
|
102
108
|
"channel_types",
|
|
103
109
|
"contexts",
|
|
@@ -154,7 +160,8 @@ function normalizeDescriptionForComparison(description) {
|
|
|
154
160
|
function commandsEqual(a, b) {
|
|
155
161
|
return JSON.stringify(comparableCommand(a)) === JSON.stringify(comparableCommand(b));
|
|
156
162
|
}
|
|
157
|
-
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region extensions/discord/src/internal/command-deploy.ts
|
|
158
165
|
const DISCORD_APPLICATION_COMMAND_LIMIT_REACHED = 30032;
|
|
159
166
|
var DiscordCommandDeployer = class {
|
|
160
167
|
constructor(params) {
|
|
@@ -221,7 +228,8 @@ function stableCommandSetHash(commands) {
|
|
|
221
228
|
const stable = commands.toSorted((a, b) => stableCommandKey(a).localeCompare(stableCommandKey(b))).map((command) => stableComparableObject(command));
|
|
222
229
|
return createHash("sha256").update(JSON.stringify(stable)).digest("hex");
|
|
223
230
|
}
|
|
224
|
-
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region extensions/discord/src/internal/components.base.ts
|
|
225
233
|
function parseCustomId(id) {
|
|
226
234
|
const [rawKey = "", ...parts] = id.split(";");
|
|
227
235
|
const [keyPart = "", firstValue] = rawKey.split("=");
|
|
@@ -260,7 +268,8 @@ var BaseMessageInteractiveComponent = class extends BaseComponent {
|
|
|
260
268
|
run(_interaction, _data) {}
|
|
261
269
|
};
|
|
262
270
|
var BaseModalComponent = class extends BaseComponent {};
|
|
263
|
-
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region extensions/discord/src/internal/component-registry.ts
|
|
264
273
|
var ComponentRegistry = class {
|
|
265
274
|
constructor() {
|
|
266
275
|
this.entries = /* @__PURE__ */ new Map();
|
|
@@ -286,7 +295,8 @@ var ComponentRegistry = class {
|
|
|
286
295
|
return this.wildcardEntries.find((entry) => options?.componentType === void 0 || entry.type === options.componentType);
|
|
287
296
|
}
|
|
288
297
|
};
|
|
289
|
-
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region extensions/discord/src/internal/structures.ts
|
|
290
300
|
var Base = class {
|
|
291
301
|
constructor(client) {
|
|
292
302
|
this.client = client;
|
|
@@ -447,7 +457,8 @@ function channelFactory(clientForTest, channelData) {
|
|
|
447
457
|
ownerId: "owner_id" in channelData ? channelData.owner_id : void 0
|
|
448
458
|
};
|
|
449
459
|
}
|
|
450
|
-
|
|
460
|
+
//#endregion
|
|
461
|
+
//#region extensions/discord/src/internal/entity-cache.ts
|
|
451
462
|
const DEFAULT_REST_CACHE_TTL_MS = 3e4;
|
|
452
463
|
const DEFAULT_MAX_ENTRIES = 5e3;
|
|
453
464
|
const DEFAULT_SWEEP_INTERVAL_MS = 3e4;
|
|
@@ -534,7 +545,8 @@ var DiscordEntityCache = class {
|
|
|
534
545
|
for (const [key, entry] of this.entries) if (entry.expiresAt <= now) this.entries.delete(key);
|
|
535
546
|
}
|
|
536
547
|
};
|
|
537
|
-
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region extensions/discord/src/internal/event-queue.ts
|
|
538
550
|
const DEFAULT_MAX_QUEUE_SIZE = 1e4;
|
|
539
551
|
const DEFAULT_MAX_CONCURRENCY = 50;
|
|
540
552
|
const DEFAULT_LISTENER_TIMEOUT_MS = 12e4;
|
|
@@ -640,7 +652,8 @@ function normalizePositiveInteger(value, fallback) {
|
|
|
640
652
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return fallback;
|
|
641
653
|
return Math.max(1, Math.floor(value));
|
|
642
654
|
}
|
|
643
|
-
|
|
655
|
+
//#endregion
|
|
656
|
+
//#region extensions/discord/src/internal/commands.ts
|
|
644
657
|
async function deferCommandInteractionIfNeeded(command, interaction) {
|
|
645
658
|
if (!command.defer) return;
|
|
646
659
|
await interaction.defer({ ephemeral: command.ephemeral });
|
|
@@ -728,7 +741,8 @@ var CommandWithSubcommands = class extends BaseCommand {
|
|
|
728
741
|
}));
|
|
729
742
|
}
|
|
730
743
|
};
|
|
731
|
-
|
|
744
|
+
//#endregion
|
|
745
|
+
//#region extensions/discord/src/internal/interaction-options.ts
|
|
732
746
|
function findOption(options, matches) {
|
|
733
747
|
for (const option of options ?? []) {
|
|
734
748
|
if (matches(option)) return option;
|
|
@@ -771,11 +785,13 @@ var OptionsHandler = class {
|
|
|
771
785
|
return findOption(this.rawOptions, (option) => "focused" in option && Boolean(option.focused));
|
|
772
786
|
}
|
|
773
787
|
};
|
|
774
|
-
|
|
788
|
+
//#endregion
|
|
789
|
+
//#region extensions/discord/src/internal/interaction-response.ts
|
|
775
790
|
function needsComponentsV2Query(body) {
|
|
776
791
|
return body !== null && typeof body === "object" && "flags" in body && typeof body.flags === "number" && (body.flags & MessageFlags.IsComponentsV2) !== 0;
|
|
777
792
|
}
|
|
778
|
-
|
|
793
|
+
//#endregion
|
|
794
|
+
//#region extensions/discord/src/internal/modal-fields.ts
|
|
779
795
|
function extractModalFields(components) {
|
|
780
796
|
const out = {};
|
|
781
797
|
for (const component of flattenModalComponents(components)) {
|
|
@@ -834,7 +850,8 @@ var ModalFields = class {
|
|
|
834
850
|
});
|
|
835
851
|
}
|
|
836
852
|
};
|
|
837
|
-
|
|
853
|
+
//#endregion
|
|
854
|
+
//#region extensions/discord/src/internal/embeds.ts
|
|
838
855
|
var Embed = class {
|
|
839
856
|
constructor(embed) {
|
|
840
857
|
Object.assign(this, embed);
|
|
@@ -854,7 +871,8 @@ var Embed = class {
|
|
|
854
871
|
});
|
|
855
872
|
}
|
|
856
873
|
};
|
|
857
|
-
|
|
874
|
+
//#endregion
|
|
875
|
+
//#region extensions/discord/src/internal/payload.ts
|
|
858
876
|
function hasDiscordV2Components(components) {
|
|
859
877
|
return Boolean(components?.some((component) => "isV2" in component && component.isV2 || "type" in component && component.type !== ComponentType.ActionRow));
|
|
860
878
|
}
|
|
@@ -879,7 +897,8 @@ function serializePayload(payload) {
|
|
|
879
897
|
sticker_ids: payload.stickers
|
|
880
898
|
});
|
|
881
899
|
}
|
|
882
|
-
|
|
900
|
+
//#endregion
|
|
901
|
+
//#region extensions/discord/src/internal/schemas.ts
|
|
883
902
|
const discordInteractionPayloadSchema = Type.Object({
|
|
884
903
|
id: Type.String({ minLength: 1 }),
|
|
885
904
|
token: Type.String({ minLength: 1 }),
|
|
@@ -897,7 +916,8 @@ function assertDiscordInteractionPayload(value) {
|
|
|
897
916
|
function isDiscordRateLimitBody(value) {
|
|
898
917
|
return Check(discordRateLimitBodySchema, value);
|
|
899
918
|
}
|
|
900
|
-
|
|
919
|
+
//#endregion
|
|
920
|
+
//#region extensions/discord/src/internal/interactions.ts
|
|
901
921
|
function readInteractionUser(rawData, client) {
|
|
902
922
|
const directUser = "user" in rawData ? rawData.user : void 0;
|
|
903
923
|
if (directUser && typeof directUser === "object" && "id" in directUser) return new User(client, directUser);
|
|
@@ -1061,7 +1081,8 @@ function createInteraction(client, rawData) {
|
|
|
1061
1081
|
if (rawData.type === InteractionType.MessageComponent) return new ((componentInteractions.get(rawData.data?.component_type)) ?? BaseComponentInteraction)(client, rawData);
|
|
1062
1082
|
return new BaseInteraction(client, rawData);
|
|
1063
1083
|
}
|
|
1064
|
-
|
|
1084
|
+
//#endregion
|
|
1085
|
+
//#region extensions/discord/src/internal/interaction-dispatch.ts
|
|
1065
1086
|
async function dispatchInteraction(client, rawData) {
|
|
1066
1087
|
const interaction = createInteraction(client, rawData);
|
|
1067
1088
|
if (rawData.type === InteractionType.ApplicationCommandAutocomplete) {
|
|
@@ -1131,7 +1152,8 @@ async function deferComponentInteractionIfNeeded(component, interaction) {
|
|
|
1131
1152
|
}
|
|
1132
1153
|
await interaction.acknowledge();
|
|
1133
1154
|
}
|
|
1134
|
-
|
|
1155
|
+
//#endregion
|
|
1156
|
+
//#region extensions/discord/src/internal/request-authority.ts
|
|
1135
1157
|
const requestAuthority = resolveGlobalSingleton(Symbol.for("openclaw.discord.requestAuthority"), () => new AsyncLocalStorage());
|
|
1136
1158
|
/** Carry the host's existing assertion without changing its lifetime or ownership. */
|
|
1137
1159
|
function withDiscordRequestAuthority(assertCurrent, run) {
|
|
@@ -1145,7 +1167,8 @@ function withDiscordRequestAuthority(assertCurrent, run) {
|
|
|
1145
1167
|
function captureDiscordRequestAuthority() {
|
|
1146
1168
|
return requestAuthority.getStore();
|
|
1147
1169
|
}
|
|
1148
|
-
|
|
1170
|
+
//#endregion
|
|
1171
|
+
//#region extensions/discord/src/internal/rest-body.ts
|
|
1149
1172
|
function fileBlob(file) {
|
|
1150
1173
|
return file.data instanceof Blob ? file.data : new Blob([file.data], { type: typeof file.contentType === "string" ? file.contentType : void 0 });
|
|
1151
1174
|
}
|
|
@@ -1203,7 +1226,8 @@ function serializeRequestBody(data, headers) {
|
|
|
1203
1226
|
headers.set("Content-Type", "application/json");
|
|
1204
1227
|
return JSON.stringify(data.body);
|
|
1205
1228
|
}
|
|
1206
|
-
|
|
1229
|
+
//#endregion
|
|
1230
|
+
//#region extensions/discord/src/internal/rest-errors.ts
|
|
1207
1231
|
const DISCORD_UNKNOWN_MESSAGE = 10008;
|
|
1208
1232
|
const DISCORD_UNKNOWN_VOICE_STATE = 10065;
|
|
1209
1233
|
const DISCORD_ERROR_BODY_MAX_DEPTH = 64;
|
|
@@ -1337,7 +1361,8 @@ var RateLimitError = class extends DiscordError {
|
|
|
1337
1361
|
this.bucket = readDiscordRateLimitBucket(response);
|
|
1338
1362
|
}
|
|
1339
1363
|
};
|
|
1340
|
-
|
|
1364
|
+
//#endregion
|
|
1365
|
+
//#region extensions/discord/src/internal/rest-routes.ts
|
|
1341
1366
|
const RATE_LIMIT_HEADER_NUMBER_RE = /^\d+(?:\.\d+)?$/;
|
|
1342
1367
|
const DISCORD_ROUTE_IDENTIFIER_HASH_LENGTH = 32;
|
|
1343
1368
|
function redactWebhookTokenInPath(path) {
|
|
@@ -1387,7 +1412,8 @@ function appendQuery(path, query) {
|
|
|
1387
1412
|
for (const [key, value] of Object.entries(query)) search.set(key, String(value));
|
|
1388
1413
|
return `${path}?${search.toString()}`;
|
|
1389
1414
|
}
|
|
1390
|
-
|
|
1415
|
+
//#endregion
|
|
1416
|
+
//#region extensions/discord/src/internal/rest-scheduler.ts
|
|
1391
1417
|
const MAX_QUEUE_SIZE = 1e3;
|
|
1392
1418
|
const MAX_CONCURRENT_WORKERS = 4;
|
|
1393
1419
|
const MAX_RATE_LIMIT_RETRIES = 3;
|
|
@@ -1639,7 +1665,8 @@ var RestScheduler = class {
|
|
|
1639
1665
|
function isGlobalRateLimit(parsed) {
|
|
1640
1666
|
return parsed && typeof parsed === "object" && "global" in parsed ? Boolean(parsed.global) : false;
|
|
1641
1667
|
}
|
|
1642
|
-
|
|
1668
|
+
//#endregion
|
|
1669
|
+
//#region extensions/discord/src/internal/rest.ts
|
|
1643
1670
|
const defaultOptions = {
|
|
1644
1671
|
baseUrl: "https://discord.com/api",
|
|
1645
1672
|
timeout: 15e3,
|
|
@@ -1818,7 +1845,8 @@ function getRequestPriority(method, path) {
|
|
|
1818
1845
|
if (/^\/interactions\/\d+\/[^/]+\/callback$/.test(normalizedPath)) return "critical";
|
|
1819
1846
|
return normalizedMethod === "GET" ? "background" : "standard";
|
|
1820
1847
|
}
|
|
1821
|
-
|
|
1848
|
+
//#endregion
|
|
1849
|
+
//#region extensions/discord/src/internal/client.ts
|
|
1822
1850
|
var Plugin = class {};
|
|
1823
1851
|
var Client = class {
|
|
1824
1852
|
constructor(options, handlers, plugins = []) {
|
|
@@ -1892,7 +1920,8 @@ var Client = class {
|
|
|
1892
1920
|
})));
|
|
1893
1921
|
}
|
|
1894
1922
|
};
|
|
1895
|
-
|
|
1923
|
+
//#endregion
|
|
1924
|
+
//#region extensions/discord/src/internal/components.message.ts
|
|
1896
1925
|
var BaseButton = class extends BaseMessageInteractiveComponent {
|
|
1897
1926
|
constructor(..._args) {
|
|
1898
1927
|
super(..._args);
|
|
@@ -2121,7 +2150,8 @@ var Container = class extends V2Component {
|
|
|
2121
2150
|
});
|
|
2122
2151
|
}
|
|
2123
2152
|
};
|
|
2124
|
-
|
|
2153
|
+
//#endregion
|
|
2154
|
+
//#region extensions/discord/src/internal/components.modal.ts
|
|
2125
2155
|
var TextInput = class extends BaseModalComponent {
|
|
2126
2156
|
constructor(..._args) {
|
|
2127
2157
|
super(..._args);
|
|
@@ -2199,7 +2229,8 @@ var Modal = class {
|
|
|
2199
2229
|
};
|
|
2200
2230
|
}
|
|
2201
2231
|
};
|
|
2202
|
-
|
|
2232
|
+
//#endregion
|
|
2233
|
+
//#region extensions/discord/src/internal/listeners.ts
|
|
2203
2234
|
var BaseListener = class {};
|
|
2204
2235
|
var ReadyListener = class extends BaseListener {
|
|
2205
2236
|
constructor(..._args) {
|
|
@@ -2267,7 +2298,8 @@ var ThreadDeleteListener = class extends BaseListener {
|
|
|
2267
2298
|
this.type = GatewayDispatchEvents.ThreadDelete;
|
|
2268
2299
|
}
|
|
2269
2300
|
};
|
|
2270
|
-
|
|
2301
|
+
//#endregion
|
|
2302
|
+
//#region extensions/discord/src/internal/discord.ts
|
|
2271
2303
|
var discord_exports = /* @__PURE__ */ __exportAll({
|
|
2272
2304
|
AutocompleteInteraction: () => AutocompleteInteraction,
|
|
2273
2305
|
BaseCommand: () => BaseCommand,
|
|
@@ -2354,4 +2386,5 @@ var discord_exports = /* @__PURE__ */ __exportAll({
|
|
|
2354
2386
|
});
|
|
2355
2387
|
import * as import_discord_api_types_v10 from "discord-api-types/v10";
|
|
2356
2388
|
__reExport(discord_exports, import_discord_api_types_v10);
|
|
2389
|
+
//#endregion
|
|
2357
2390
|
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,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-BPV-R4G9.mjs";
|
|
2
2
|
import { isSupportedRealtimeVoiceActivationName, normalizeRealtimeVoiceActivationNamePrefix } from "openclaw/plugin-sdk/realtime-voice-activation";
|
|
3
|
-
|
|
3
|
+
//#region extensions/discord/src/doctor-contract.ts
|
|
4
4
|
const RETIRED_TUNING_KEYS = /* @__PURE__ */ new Set([
|
|
5
5
|
"gatewayInfoTimeoutMs",
|
|
6
6
|
"gatewayReadyTimeoutMs",
|
|
@@ -124,4 +124,5 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
124
124
|
changes
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
+
//#endregion
|
|
127
128
|
export { normalizeCompatibilityConfig as n, legacyConfigRules as t };
|
|
@@ -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-ljrzXBJi.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-8cCu6uPG.mjs";
|
|
3
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-CY5vJM48.mjs";
|
|
4
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BPV-R4G9.mjs";
|
|
5
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Bwv8EuQ_.mjs";
|
|
6
|
+
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.mjs";
|
|
7
|
+
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-8RDQrSVb.mjs";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
10
|
-
|
|
10
|
+
//#region extensions/discord/src/doctor.ts
|
|
11
11
|
function sanitizeForLog(value) {
|
|
12
12
|
return value.replace(/\p{Cc}+/gu, " ").trim();
|
|
13
13
|
}
|
|
@@ -184,4 +184,5 @@ const discordDoctor = {
|
|
|
184
184
|
collectMutableAllowlistWarnings: ({ cfg }) => collectDiscordMutableAllowlistWarnings(cfg),
|
|
185
185
|
repairConfig: ({ cfg, doctorFixCommand }) => maybeRepairDiscordNumericIds(cfg, doctorFixCommand)
|
|
186
186
|
};
|
|
187
|
+
//#endregion
|
|
187
188
|
export { collectDiscordMissingEnvTokenWarnings, collectDiscordNumericIdWarnings, discordDoctor, maybeRepairDiscordNumericIds, scanDiscordNumericIdEntries };
|
|
@@ -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-BMD-JiVS.mjs";
|
|
2
|
+
import { u as matchesDiscordToolContextTarget } from "./send.receipt-C18khRYH.mjs";
|
|
3
|
+
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
4
|
+
import "./targets-UWWZ6gF7.mjs";
|
|
5
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-RWnuJgWB.mjs";
|
|
6
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-Du9NhD8h.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-BtUpGBTb.mjs";
|
|
9
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-B6g31cwt.mjs";
|
|
10
|
+
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-C4tp9noA.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
|
+
//#region 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,4 +277,5 @@ async function dispatchDiscordMessageAction(ctx) {
|
|
|
277
277
|
}
|
|
278
278
|
throw new Error(`Action ${action} is not supported for provider ${providerId}.`);
|
|
279
279
|
}
|
|
280
|
+
//#endregion
|
|
280
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-RWnuJgWB.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-BtUpGBTb.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
|
+
//#region extensions/discord/src/actions/handle-action.guild-admin.ts
|
|
8
8
|
const guildMetadataReads = {
|
|
9
9
|
"member-info": {
|
|
10
10
|
action: "memberInfo",
|
|
@@ -191,4 +191,5 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
191
191
|
}, readPolicyOptions);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
+
//#endregion
|
|
194
195
|
export { tryHandleDiscordMessageActionGuildAdmin as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as normalizeDiscordAllowList } from "./allow-list-
|
|
1
|
+
import { i as normalizeDiscordAllowList } from "./allow-list-BKqOldGy.mjs";
|
|
2
2
|
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
3
|
-
|
|
3
|
+
//#region extensions/discord/src/monitor/ingress-identity.ts
|
|
4
4
|
const DISCORD_ALLOW_LIST_PREFIXES = [
|
|
5
5
|
"discord:",
|
|
6
6
|
"user:",
|
|
@@ -55,7 +55,8 @@ const discordIngressIdentity = defineStableChannelIngressIdentity({
|
|
|
55
55
|
sensitivity: "pii"
|
|
56
56
|
}))
|
|
57
57
|
});
|
|
58
|
-
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region extensions/discord/src/live-policy-config.ts
|
|
59
60
|
/** Account policy consumed at inbound admission, without replacing the transport. */
|
|
60
61
|
function selectDiscordLivePolicyConfig(config) {
|
|
61
62
|
return {
|
|
@@ -68,4 +69,5 @@ function selectDiscordLivePolicyConfig(config) {
|
|
|
68
69
|
dangerouslyAllowNameMatching: config.dangerouslyAllowNameMatching
|
|
69
70
|
};
|
|
70
71
|
}
|
|
72
|
+
//#endregion
|
|
71
73
|
export { discordIngressIdentity as n, selectDiscordLivePolicyConfig as t };
|