@openclaw/discord 2026.11.7 → 2026.11.8
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/{approval-handler.runtime-BN4W1r0o.mjs → approval-handler.runtime-eKrSqVPF.mjs} +5 -5
- package/dist/.setup/{audit-BL6EoUun.mjs → audit-DZLJ0my1.mjs} +3 -3
- package/dist/.setup/{channel-DdI2l55_.mjs → channel-COE1KIJz.mjs} +17 -16
- package/dist/.setup/{channel.setup-kNWMxlgu.mjs → channel.setup-B4SQu9Qg.mjs} +1 -1
- package/dist/.setup/{components-C1Phe3uw.mjs → components-Cy4hDa6J.mjs} +1 -1
- package/dist/.setup/{conversation-binding-route-K_jFbvi5.mjs → conversation-binding-route-Cy_QeEBm.mjs} +1 -1
- package/dist/.setup/{directory-live-CY2-qrHI.mjs → directory-live-DOVK9G9P.mjs} +3 -57
- package/dist/.setup/{discord-BRVFhk09.mjs → discord-KsHAulAQ.mjs} +65 -20
- package/dist/.setup/{doctor-RqH-6JB0.mjs → doctor-CQescbAS.mjs} +1 -1
- package/dist/.setup/{handle-action-uD87h2FK.mjs → handle-action-BfSo0qkY.mjs} +7 -6
- package/dist/.setup/{handle-action.guild-admin-CqBx_3mG.mjs → handle-action.guild-admin-BOzk0kPz.mjs} +6 -3
- package/dist/.setup/{listeners-DnHLrLIN.mjs → listeners-C0-BvUVA.mjs} +1 -1
- package/dist/.setup/{message-handler-CWL_u0X8.mjs → message-handler-h8xpc_1a.mjs} +5 -5
- package/dist/.setup/{message-handler.preflight-83tpEdBG.mjs → message-handler.preflight-CO1JNXKw.mjs} +7 -7
- package/dist/.setup/{message-handler.preflight-pluralkit-Dhcx7Ifz.mjs → message-handler.preflight-pluralkit-C4FSmp6X.mjs} +3 -3
- package/dist/.setup/{message-handler.process-BC-wNZwK.mjs → message-handler.process-IPQv14En.mjs} +11 -11
- package/dist/.setup/{outbound-payload-CK3_bDvK.mjs → outbound-payload-Pz-zEQnX.mjs} +5 -5
- package/dist/.setup/{outbound-session-route-Ay_DnOOl.mjs → outbound-session-route-CpweCkxm.mjs} +4 -4
- package/dist/.setup/{provider-CRb3Myky.mjs → provider-D9dwCcy8.mjs} +15 -15
- package/dist/.setup/{provider-session.runtime-3cZpps3H.mjs → provider-session.runtime-pCvFOgHs.mjs} +3 -3
- package/dist/.setup/provider.runtime-DTEY_Gvi.mjs +1 -0
- package/dist/.setup/{realtime-session.runtime-BRYpjS9P.mjs → realtime-session.runtime-CP8Opnfr.mjs} +2 -2
- package/dist/.setup/{runtime--HZ9r3tF.mjs → runtime-BRcmFvOV.mjs} +37 -27
- package/dist/.setup/{send-CtvwfZQ2.mjs → send-DXPqEgjA.mjs} +5 -5
- package/dist/.setup/{send.components-CtLtE0yD.mjs → send.components-MUCtA6qV.mjs} +6 -6
- package/dist/.setup/{send.outbound-D58xXPgs.mjs → send.outbound-70KlFdzN.mjs} +4 -5
- package/dist/.setup/{send.receipt-DLOV4qx6.mjs → send.receipt-DkCkAjRL.mjs} +58 -2
- package/dist/.setup/{send.shared-B_KKRrD7.mjs → send.shared-BXWCIkfx.mjs} +6 -5
- package/dist/.setup/setup-plugin-api-Dj04bzEC.mjs +2 -0
- package/dist/.setup/{shared-Dv2DamaK.mjs → shared-G2-0EUo3.mjs} +1 -1
- package/dist/.setup/{subagent-hooks-yT45eTyz.mjs → subagent-hooks-BUvQ4Oj4.mjs} +1 -1
- package/dist/.setup/{system-events-Dlzp9Jcj.mjs → system-events-CYFu0Vp4.mjs} +1 -1
- package/dist/.setup/{target-resolver-BzaZPBm9.mjs → target-resolver-54k9fO6u.mjs} +2 -2
- package/dist/.setup/{thread-bindings-DRWhgKCc.mjs → thread-bindings-BiO6_GA2.mjs} +2 -2
- package/dist/.setup/{thread-bindings.manager-CWJKirn1.mjs → thread-bindings.manager-CadGpkjc.mjs} +6 -6
- package/dist/.setup/{thread-bindings.session-updates-DzJrXc4w.mjs → thread-bindings.session-updates-B4iJqhAn.mjs} +1 -1
- package/dist/.setup/{threading-BbsPuT5G.mjs → threading-Bem-g91c.mjs} +2 -2
- package/dist/.setup/{transcripts-source-DIW1fU_P.mjs → transcripts-source-DUL7GRxU.mjs} +1 -1
- package/dist/.setup/{voice-runtime-oJ6BZs5D.mjs → voice-runtime-D0TWfWJO.mjs} +6 -6
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +1 -1
- package/dist/api.js +9 -9
- package/dist/channel-plugin-api.js +1 -1
- package/dist/runtime-api.js +15 -15
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/package.json +4 -4
- package/dist/.setup/provider.runtime-tmkt3QOg.mjs +0 -1
- package/dist/.setup/setup-plugin-api-ty5RJrMy.mjs +0 -2
package/dist/.setup/{approval-handler.runtime-BN4W1r0o.mjs → approval-handler.runtime-eKrSqVPF.mjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { D as createDiscordMessageNonce, M as createDiscordClient } from "./send.shared-
|
|
2
|
-
import { D as editChannelMessage, E as deleteChannelMessage, J as stripUndefinedFields, f as serializePayload, w as createChannelMessage, y as createUserDmChannel } from "./discord-
|
|
3
|
-
import {
|
|
1
|
+
import { D as createDiscordMessageNonce, M as createDiscordClient } from "./send.shared-BXWCIkfx.mjs";
|
|
2
|
+
import { D as editChannelMessage, E as deleteChannelMessage, J as stripUndefinedFields, f as serializePayload, w as createChannelMessage, y as createUserDmChannel } from "./discord-KsHAulAQ.mjs";
|
|
3
|
+
import { C as findGraphemeChunkEnd } from "./send.receipt-DkCkAjRL.mjs";
|
|
4
4
|
import { r as colorToNumber } from "./components.base-CiS0h_XP.mjs";
|
|
5
5
|
import { a as DISCORD_APPROVAL_DECISIONS, o as buildExecApprovalCustomId } from "./shared-interactive-DmzaoKOM.mjs";
|
|
6
|
-
import { c as formatDiscordApprovalDisplayValue, k as isDiscordExecApprovalClientEnabled, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-
|
|
7
|
-
import { r as shouldHandleDiscordApprovalRequest } from "./channel-
|
|
6
|
+
import { c as formatDiscordApprovalDisplayValue, k as isDiscordExecApprovalClientEnabled, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-CpweCkxm.mjs";
|
|
7
|
+
import { r as shouldHandleDiscordApprovalRequest } from "./channel-COE1KIJz.mjs";
|
|
8
8
|
import { t as discordApprovalMessageUpdates } from "./approval-message-updates-DKsCfxSW.mjs";
|
|
9
9
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import { ButtonStyle, ComponentType } from "discord-api-types/v10";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-DGkdWwix.mjs";
|
|
3
|
-
import { b as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
4
|
-
import "./send-
|
|
5
|
-
import { T as collectDiscordAuditChannelIdsForAccount, w as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-
|
|
3
|
+
import { b as fetchChannelPermissionsDiscord } from "./send.shared-BXWCIkfx.mjs";
|
|
4
|
+
import "./send-DXPqEgjA.mjs";
|
|
5
|
+
import { T as collectDiscordAuditChannelIdsForAccount, w as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-CpweCkxm.mjs";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import { q as withDiscordRequestAuthority } from "./discord-
|
|
3
|
-
import { c as normalizeDiscordMessagingTarget, o as looksLikeDiscordTargetId, s as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
2
|
+
import { q as withDiscordRequestAuthority } from "./discord-KsHAulAQ.mjs";
|
|
3
|
+
import { c as normalizeDiscordMessagingTarget, d as normalizeDiscordSnowflake, o as looksLikeDiscordTargetId, s as matchesDiscordToolContextTarget } from "./send.receipt-DkCkAjRL.mjs";
|
|
4
4
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
5
5
|
import { l as withAbortTimeout } from "./timeouts-cIxzatmv.mjs";
|
|
6
6
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
7
|
-
import { A as shouldSuppressLocalDiscordExecApprovalPrompt, D as getDiscordExecApprovalApprovers, E as resolveRequiredDiscordChannelPermissions, O as isDiscordExecApprovalApprover, b as discordMessageActions, k as isDiscordExecApprovalClientEnabled, l as resolveDiscordGroupRequireMention, m as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, u as resolveDiscordGroupToolPolicy, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-
|
|
8
|
-
import { a as resolveDiscordInboundConversation, i as resolveDiscordCommandConversation, n as discordOutbound, r as resolveDiscordAttachedOutboundTarget } from "./outbound-payload-
|
|
7
|
+
import { A as shouldSuppressLocalDiscordExecApprovalPrompt, D as getDiscordExecApprovalApprovers, E as resolveRequiredDiscordChannelPermissions, O as isDiscordExecApprovalApprover, b as discordMessageActions, k as isDiscordExecApprovalClientEnabled, l as resolveDiscordGroupRequireMention, m as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, u as resolveDiscordGroupToolPolicy, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-CpweCkxm.mjs";
|
|
8
|
+
import { a as resolveDiscordInboundConversation, i as resolveDiscordCommandConversation, n as discordOutbound, r as resolveDiscordAttachedOutboundTarget } from "./outbound-payload-Pz-zEQnX.mjs";
|
|
9
9
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.mjs";
|
|
10
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
11
|
-
import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
10
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-Cy_QeEBm.mjs";
|
|
11
|
+
import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupContract, t as createDiscordPluginBase } from "./shared-G2-0EUo3.mjs";
|
|
12
12
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-CCHGNSQw.mjs";
|
|
13
|
-
import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
13
|
+
import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-B4iJqhAn.mjs";
|
|
14
14
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.mjs";
|
|
15
15
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
16
16
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -162,7 +162,7 @@ function getDiscordApprovalCapability() {
|
|
|
162
162
|
accountId
|
|
163
163
|
}),
|
|
164
164
|
shouldHandle: shouldHandleDiscordApprovalRequest,
|
|
165
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
165
|
+
load: async () => (await import("./approval-handler.runtime-eKrSqVPF.mjs")).discordApprovalNativeRuntime
|
|
166
166
|
})
|
|
167
167
|
});
|
|
168
168
|
}
|
|
@@ -171,9 +171,9 @@ function getDiscordApprovalCapability() {
|
|
|
171
171
|
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-Ble81PWH.mjs").then((n) => n.t));
|
|
172
172
|
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-g16NM6Ho.mjs").then((n) => n.n));
|
|
173
173
|
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DAfOOXdy.mjs").then((n) => n.n));
|
|
174
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
175
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
176
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
174
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-CadGpkjc.mjs").then((n) => n.r));
|
|
175
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-54k9fO6u.mjs").then((n) => n.r));
|
|
176
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-DTEY_Gvi.mjs"));
|
|
177
177
|
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-CbDJojNV.mjs").then((n) => n.o));
|
|
178
178
|
async function probeDiscordStatusAccount(params) {
|
|
179
179
|
const startedAtMs = Date.now();
|
|
@@ -181,9 +181,9 @@ async function probeDiscordStatusAccount(params) {
|
|
|
181
181
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
182
182
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
183
183
|
}
|
|
184
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
185
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
186
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
184
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-DZLJ0my1.mjs").then((n) => n.n));
|
|
185
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-DXPqEgjA.mjs").then((n) => n.t));
|
|
186
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-DOVK9G9P.mjs").then((n) => n.t));
|
|
187
187
|
//#endregion
|
|
188
188
|
//#region extensions/discord/src/conversation-route-owner.ts
|
|
189
189
|
async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBindings) {
|
|
@@ -817,10 +817,11 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
817
817
|
currentChannelId: nativeChannelId ? normalizeDiscordMessagingTarget(nativeChannelId) : currentMessagingTarget,
|
|
818
818
|
currentChatType,
|
|
819
819
|
currentMessagingTarget,
|
|
820
|
-
currentMessageId: context.CurrentMessageId,
|
|
820
|
+
currentMessageId: normalizeDiscordSnowflake(context.CurrentMessageId ?? "") ?? void 0,
|
|
821
821
|
hasRepliedRef
|
|
822
822
|
};
|
|
823
|
-
}
|
|
823
|
+
},
|
|
824
|
+
resolveReplyTransport: ({ replyToId }) => replyToId && !normalizeDiscordSnowflake(replyToId) ? { replyToId: null } : null
|
|
824
825
|
},
|
|
825
826
|
outbound: {
|
|
826
827
|
...discordOutbound,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as resolveDefaultDiscordAccountId, g as resolveDiscordToken, n as inspectDiscordAccountConfig, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import { r as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
2
|
+
import { r as discordSetupContract, t as createDiscordPluginBase } from "./shared-G2-0EUo3.mjs";
|
|
3
3
|
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-g16NM6Ho.mjs";
|
|
4
4
|
import { t as resolveDiscordUserAllowlist } from "./resolve-users-DAfOOXdy.mjs";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { J as stripUndefinedFields, a as Label, c as TextInput, i as CheckboxGroup, o as Modal, s as RadioGroup, u as asSerializableComponent } from "./discord-
|
|
2
|
+
import { J as stripUndefinedFields, a as Label, c as TextInput, i as CheckboxGroup, o as Modal, s as RadioGroup, u as asSerializableComponent } from "./discord-KsHAulAQ.mjs";
|
|
3
3
|
import { i as parseCustomId, r as colorToNumber, t as BaseMessageInteractiveComponent } from "./components.base-CiS0h_XP.mjs";
|
|
4
4
|
import { _ as parseDiscordModalCustomId, c as DISCORD_COMPONENT_CUSTOM_ID_KEY, d as buildDiscordComponentCustomId, f as buildDiscordModalCustomId, g as parseDiscordComponentCustomIdForInteraction, h as parseDiscordComponentCustomId, l as DISCORD_MODAL_CUSTOM_ID_KEY, t as buildDiscordInteractiveComponents, v as parseDiscordModalCustomIdForInteraction } from "./shared-interactive-DmzaoKOM.mjs";
|
|
5
5
|
import { asBoolean, asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-
|
|
1
|
+
import { g as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-CpweCkxm.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
|
|
@@ -1,64 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { h as normalizeDiscordToken, l as resolveDiscordAccount } from "./accounts-C_25wyxC.mjs";
|
|
3
3
|
import { a as normalizeDiscordDisplaySlug } from "./allow-list-C3j0qLDp.mjs";
|
|
4
|
+
import { f as rememberDiscordDirectoryUser } from "./send.receipt-DkCkAjRL.mjs";
|
|
4
5
|
import { t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-DYRggUgK.mjs";
|
|
5
6
|
import { n as listGuilds, r as searchDiscordGuildMembers, t as listDiscordGuildChannels } from "./guilds-BSnrns-F.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
-
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
9
|
-
//#region extensions/discord/src/directory-cache-state.ts
|
|
10
|
-
const discordDirectoryCacheState = { handlesByAccount: /* @__PURE__ */ new Map() };
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region extensions/discord/src/directory-cache.ts
|
|
13
|
-
const DISCORD_DIRECTORY_CACHE_MAX_ENTRIES = 4e3;
|
|
14
|
-
const DISCORD_DISCRIMINATOR_SUFFIX = /#\d{4}$/;
|
|
15
|
-
function normalizeDiscordSnowflake(value) {
|
|
16
|
-
const text = normalizeOptionalStringifiedId(value) ?? "";
|
|
17
|
-
if (!/^\d+$/.test(text)) return null;
|
|
18
|
-
return text;
|
|
19
|
-
}
|
|
20
|
-
function normalizeDiscordHandleKey(raw) {
|
|
21
|
-
let handle = normalizeOptionalString(raw) ?? "";
|
|
22
|
-
if (!handle) return null;
|
|
23
|
-
if (handle.startsWith("@")) handle = normalizeOptionalString(handle.slice(1)) ?? "";
|
|
24
|
-
if (!handle || /\s/.test(handle)) return null;
|
|
25
|
-
return handle.toLowerCase();
|
|
26
|
-
}
|
|
27
|
-
function ensureAccountCache(accountId) {
|
|
28
|
-
const cacheKey = normalizeAccountId(accountId);
|
|
29
|
-
const existing = discordDirectoryCacheState.handlesByAccount.get(cacheKey);
|
|
30
|
-
if (existing) return existing;
|
|
31
|
-
const created = /* @__PURE__ */ new Map();
|
|
32
|
-
discordDirectoryCacheState.handlesByAccount.set(cacheKey, created);
|
|
33
|
-
return created;
|
|
34
|
-
}
|
|
35
|
-
function setCacheEntry(cache, key, userId) {
|
|
36
|
-
const previous = cache.get(key);
|
|
37
|
-
cache.delete(key);
|
|
38
|
-
cache.set(key, previous === void 0 || previous === userId ? userId : null);
|
|
39
|
-
pruneMapToMaxSize(cache, DISCORD_DIRECTORY_CACHE_MAX_ENTRIES);
|
|
40
|
-
}
|
|
41
|
-
function rememberDiscordDirectoryUser(params) {
|
|
42
|
-
const userId = normalizeDiscordSnowflake(params.userId);
|
|
43
|
-
if (!userId) return;
|
|
44
|
-
const cache = ensureAccountCache(params.accountId);
|
|
45
|
-
for (const candidate of params.handles) {
|
|
46
|
-
if (typeof candidate !== "string") continue;
|
|
47
|
-
const handle = normalizeDiscordHandleKey(candidate);
|
|
48
|
-
if (!handle) continue;
|
|
49
|
-
setCacheEntry(cache, handle, userId);
|
|
50
|
-
const withoutDiscriminator = handle.replace(DISCORD_DISCRIMINATOR_SUFFIX, "");
|
|
51
|
-
if (withoutDiscriminator && withoutDiscriminator !== handle) setCacheEntry(cache, withoutDiscriminator, userId);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function resolveDiscordDirectoryUserId(params) {
|
|
55
|
-
const cache = discordDirectoryCacheState.handlesByAccount.get(normalizeAccountId(params.accountId));
|
|
56
|
-
if (!cache) return;
|
|
57
|
-
const handle = normalizeDiscordHandleKey(params.handle);
|
|
58
|
-
if (!handle) return;
|
|
59
|
-
return cache.get(handle) ?? void 0;
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
7
|
+
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
62
8
|
//#region extensions/discord/src/directory-live.ts
|
|
63
9
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
64
10
|
listDiscordDirectoryGroupsLive: () => listDiscordDirectoryGroupsLive,
|
|
@@ -142,4 +88,4 @@ function listDiscordDirectoryPeersLive(params) {
|
|
|
142
88
|
return listDiscordDirectoryLive(params, "user");
|
|
143
89
|
}
|
|
144
90
|
//#endregion
|
|
145
|
-
export {
|
|
91
|
+
export { listDiscordDirectoryGroupsLive as n, listDiscordDirectoryPeersLive as r, directory_live_exports as t };
|
|
@@ -321,21 +321,58 @@ var RestScheduler = class {
|
|
|
321
321
|
}
|
|
322
322
|
enqueue(params) {
|
|
323
323
|
if (this.queuedRequests >= MAX_QUEUE_SIZE) throw new Error("Discord request queue is full");
|
|
324
|
+
const signal = params.signal;
|
|
325
|
+
if (signal?.aborted) return Promise.reject(abortReason(signal));
|
|
324
326
|
const routeKey = createRouteKey(params.method, params.path);
|
|
325
327
|
const bucket = this.getBucket(this.routeBuckets.get(routeKey) ?? routeKey);
|
|
326
328
|
return new Promise((resolve, reject) => {
|
|
327
|
-
|
|
328
|
-
this.queuedByLane[params.priority] += 1;
|
|
329
|
-
bucket.pending[params.priority].push({
|
|
329
|
+
const request = {
|
|
330
330
|
...params,
|
|
331
331
|
routeKey,
|
|
332
332
|
retryCount: 0,
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
state: "queued",
|
|
334
|
+
resolve: (value) => {
|
|
335
|
+
this.settleRequest(request);
|
|
336
|
+
resolve(value);
|
|
337
|
+
},
|
|
338
|
+
reject: (reason) => {
|
|
339
|
+
this.settleRequest(request);
|
|
340
|
+
reject(reason);
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
if (signal) {
|
|
344
|
+
const onAbort = () => this.cancelQueuedRequest(request);
|
|
345
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
346
|
+
request.detachAbort = () => signal.removeEventListener("abort", onAbort);
|
|
347
|
+
}
|
|
348
|
+
this.queuedRequests += 1;
|
|
349
|
+
this.queuedByLane[params.priority] += 1;
|
|
350
|
+
bucket.pending[params.priority].push(request);
|
|
336
351
|
this.drainQueues();
|
|
337
352
|
});
|
|
338
353
|
}
|
|
354
|
+
/** Settles each request once, whether it completed, failed, or was cancelled. */
|
|
355
|
+
settleRequest(request) {
|
|
356
|
+
if (request.state === "settled") return;
|
|
357
|
+
request.state = "settled";
|
|
358
|
+
request.detachAbort?.();
|
|
359
|
+
request.detachAbort = void 0;
|
|
360
|
+
this.queuedRequests = Math.max(0, this.queuedRequests - 1);
|
|
361
|
+
}
|
|
362
|
+
/** Drops a queued attempt; dispatched work settles normally. */
|
|
363
|
+
cancelQueuedRequest(request) {
|
|
364
|
+
if (request.state !== "queued") return;
|
|
365
|
+
for (const bucket of this.buckets.values()) for (const lane of requestPriorities) {
|
|
366
|
+
const queue = bucket.pending[lane];
|
|
367
|
+
const index = queue.indexOf(request);
|
|
368
|
+
if (index < 0) continue;
|
|
369
|
+
queue.splice(index, 1);
|
|
370
|
+
this.queuedByLane[lane] = Math.max(0, this.queuedByLane[lane] - 1);
|
|
371
|
+
request.reject(abortReason(request.signal));
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
request.reject(abortReason(request.signal));
|
|
375
|
+
}
|
|
339
376
|
getBucket(key) {
|
|
340
377
|
const existing = this.buckets.get(key);
|
|
341
378
|
if (existing) return existing;
|
|
@@ -437,6 +474,7 @@ var RestScheduler = class {
|
|
|
437
474
|
}
|
|
438
475
|
const queued = queue.shift();
|
|
439
476
|
if (!queued) continue;
|
|
477
|
+
queued.state = "dispatched";
|
|
440
478
|
this.queuedByLane[lane] = Math.max(0, this.queuedByLane[lane] - 1);
|
|
441
479
|
this.laneCursor = (this.laneCursor + laneOffset + 1) % laneSchedule.length;
|
|
442
480
|
return {
|
|
@@ -448,33 +486,32 @@ var RestScheduler = class {
|
|
|
448
486
|
return { waitMs: nextDelayMs };
|
|
449
487
|
}
|
|
450
488
|
async runQueuedRequest(queued, bucket) {
|
|
451
|
-
let requeued = false;
|
|
452
489
|
try {
|
|
453
490
|
queued.resolve(await this.executor(queued));
|
|
454
491
|
} catch (error) {
|
|
455
|
-
if (error instanceof RateLimitError && this.requeueRateLimitedRequest(queued))
|
|
456
|
-
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
queued.reject(error);
|
|
492
|
+
if (error instanceof RateLimitError && this.requeueRateLimitedRequest(queued)) return;
|
|
493
|
+
queued.reject(error instanceof Error ? error : new Error(String(error)));
|
|
460
494
|
} finally {
|
|
461
495
|
bucket.active = Math.max(0, bucket.active - 1);
|
|
462
496
|
this.activeWorkers = Math.max(0, this.activeWorkers - 1);
|
|
463
|
-
if (!requeued) this.queuedRequests = Math.max(0, this.queuedRequests - 1);
|
|
464
497
|
this.drainQueues();
|
|
465
498
|
}
|
|
466
499
|
}
|
|
467
500
|
requeueRateLimitedRequest(queued) {
|
|
468
|
-
if (queued.retryCount >= MAX_RATE_LIMIT_RETRIES) return false;
|
|
501
|
+
if (queued.signal?.aborted || queued.retryCount >= MAX_RATE_LIMIT_RETRIES) return false;
|
|
469
502
|
const bucketKey = this.routeBuckets.get(queued.routeKey) ?? queued.routeKey;
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
});
|
|
503
|
+
queued.retryCount += 1;
|
|
504
|
+
queued.state = "queued";
|
|
505
|
+
this.getBucket(bucketKey).pending[queued.priority].push(queued);
|
|
474
506
|
this.queuedByLane[queued.priority] += 1;
|
|
475
507
|
return true;
|
|
476
508
|
}
|
|
477
509
|
};
|
|
510
|
+
/** Promise rejections always carry an Error; a non-Error abort reason uses the standard shape. */
|
|
511
|
+
function abortReason(signal) {
|
|
512
|
+
const reason = signal?.reason;
|
|
513
|
+
return reason instanceof Error ? reason : new DOMException("The operation was aborted.", "AbortError");
|
|
514
|
+
}
|
|
478
515
|
function isGlobalRateLimit(parsed) {
|
|
479
516
|
return parsed && typeof parsed === "object" && "global" in parsed ? Boolean(parsed.global) : false;
|
|
480
517
|
}
|
|
@@ -586,6 +623,8 @@ var RequestClient = class {
|
|
|
586
623
|
assertActionAuthority();
|
|
587
624
|
assertReadAuthority?.();
|
|
588
625
|
} : assertReadAuthority;
|
|
626
|
+
const callerSignal = this.options.callerSignal;
|
|
627
|
+
callerSignal?.throwIfAborted();
|
|
589
628
|
assertCurrent?.();
|
|
590
629
|
if (!this.options.queueRequests) return await this.executeRequest(method, path, params, routeKey, assertCurrent, effect);
|
|
591
630
|
return await this.scheduler.enqueue({
|
|
@@ -597,7 +636,8 @@ var RequestClient = class {
|
|
|
597
636
|
data: params.data,
|
|
598
637
|
assertCurrent,
|
|
599
638
|
effect
|
|
600
|
-
}
|
|
639
|
+
},
|
|
640
|
+
...callerSignal ? { signal: callerSignal } : {}
|
|
601
641
|
});
|
|
602
642
|
}
|
|
603
643
|
async executeRequest(method, path, params, routeKey = createRouteKey(method, path), assertCurrent, effect = captureEffectAuthority()) {
|
|
@@ -1377,6 +1417,7 @@ const CACHE_KIND_BY_EVENT = /* @__PURE__ */ new Map([
|
|
|
1377
1417
|
[GatewayDispatchEvents.GuildMemberUpdate, "member"]
|
|
1378
1418
|
]);
|
|
1379
1419
|
const DISCORD_APPLICATION_COMMAND_LIMIT_REACHED = 30032;
|
|
1420
|
+
const DISCORD_UNKNOWN_APPLICATION_COMMAND = 10063;
|
|
1380
1421
|
function stableCommandKey(command) {
|
|
1381
1422
|
return `${command.type ?? ApplicationCommandType.ChatInput}:${command.name}`;
|
|
1382
1423
|
}
|
|
@@ -1593,7 +1634,11 @@ var Client = class {
|
|
|
1593
1634
|
return;
|
|
1594
1635
|
}
|
|
1595
1636
|
}
|
|
1596
|
-
for (const command of existing) if (!desiredKeys.has(stableCommandKey(command)))
|
|
1637
|
+
for (const command of existing) if (!desiredKeys.has(stableCommandKey(command))) try {
|
|
1638
|
+
await this.requestCommandDeploy("delete", Routes.applicationCommand(this.options.clientId, command.id));
|
|
1639
|
+
} catch (error) {
|
|
1640
|
+
if (!(error instanceof DiscordError && error.status === 404 && error.discordCode === DISCORD_UNKNOWN_APPLICATION_COMMAND)) throw error;
|
|
1641
|
+
}
|
|
1597
1642
|
}
|
|
1598
1643
|
async loadPersistedHash() {
|
|
1599
1644
|
if (this.commandDeployHashLoaded) return;
|
|
@@ -3,7 +3,7 @@ import { t as inspectDiscordAccount } from "./account-inspect-DGkdWwix.mjs";
|
|
|
3
3
|
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BPV-R4G9.mjs";
|
|
4
4
|
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Bwv8EuQ_.mjs";
|
|
5
5
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.mjs";
|
|
6
|
-
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
6
|
+
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-DUL7GRxU.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
9
9
|
//#region extensions/discord/src/doctor.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { q as withDiscordRequestAuthority } from "./discord-
|
|
2
|
-
import { s as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
1
|
+
import { q as withDiscordRequestAuthority } from "./discord-KsHAulAQ.mjs";
|
|
2
|
+
import { s as matchesDiscordToolContextTarget } from "./send.receipt-DkCkAjRL.mjs";
|
|
3
3
|
import { n as resolveDiscordChannelId, t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
4
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime
|
|
4
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-BRcmFvOV.mjs";
|
|
5
5
|
import { n as buildDiscordPresentationComponents, t as buildDiscordInteractiveComponents } from "./shared-interactive-DmzaoKOM.mjs";
|
|
6
|
-
import { c as coerceDiscordComponentParam } from "./components-
|
|
6
|
+
import { c as coerceDiscordComponentParam } from "./components-Cy4hDa6J.mjs";
|
|
7
7
|
import "../action-runtime-api.js";
|
|
8
|
-
import { S as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-
|
|
9
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
8
|
+
import { S as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-CpweCkxm.mjs";
|
|
9
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-BOzk0kPz.mjs";
|
|
10
10
|
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-KvRTAVE3.mjs";
|
|
11
11
|
import { asOptionalRecord, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -44,6 +44,7 @@ async function dispatchDiscordMessageAction(ctx) {
|
|
|
44
44
|
mediaReadFile: ctx.mediaReadFile,
|
|
45
45
|
...ctx.reply ? { reply: ctx.reply } : {},
|
|
46
46
|
...ctx.progressSnapshot ? { progressSnapshot: ctx.progressSnapshot } : {},
|
|
47
|
+
...ctx.abortSignal ? { callerSignal: ctx.abortSignal } : {},
|
|
47
48
|
...readPolicyOptions
|
|
48
49
|
};
|
|
49
50
|
const runAction = (payload) => handleDiscordAction({
|
|
@@ -1,6 +1,6 @@
|
|
|
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-BRcmFvOV.mjs";
|
|
2
2
|
import "../action-runtime-api.js";
|
|
3
|
-
import { x as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-
|
|
3
|
+
import { x as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-CpweCkxm.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";
|
|
@@ -65,7 +65,10 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
65
65
|
action: runtimeAction,
|
|
66
66
|
accountId,
|
|
67
67
|
...values
|
|
68
|
-
}, cfg,
|
|
68
|
+
}, cfg, actionOptions.callerSignal ? {
|
|
69
|
+
...options,
|
|
70
|
+
callerSignal: actionOptions.callerSignal
|
|
71
|
+
} : options);
|
|
69
72
|
const metadataRead = guildMetadataReads[action];
|
|
70
73
|
if (metadataRead) {
|
|
71
74
|
const values = Object.fromEntries(metadataRead.requiredParams.map((key) => [key, readStringParam(actionParams, key, { required: true })]));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as discord_exports } from "./discord-
|
|
1
|
+
import { t as discord_exports } from "./discord-KsHAulAQ.mjs";
|
|
2
2
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
3
3
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
4
4
|
//#region extensions/discord/src/voice/listeners.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { q as withDiscordRequestAuthority } from "./discord-
|
|
1
|
+
import { q as withDiscordRequestAuthority } from "./discord-KsHAulAQ.mjs";
|
|
2
2
|
import { i as resolveDiscordEndpointMediaGuard, n as getDiscordEndpointRuntime } from "./endpoint-runtime-lf4DeLas.mjs";
|
|
3
3
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
4
|
-
import { D as createMessageDispatchData, E as createDiscordLivePolicyReader } from "./provider-
|
|
5
|
-
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-
|
|
4
|
+
import { D as createMessageDispatchData, E as createDiscordLivePolicyReader } from "./provider-D9dwCcy8.mjs";
|
|
5
|
+
import { E as hasDiscordMessageStickers, T as resolveDiscordCdnPolicy, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, k as resolveDiscordReferencedReplyMessageId } from "./transcripts-source-DUL7GRxU.mjs";
|
|
6
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
8
8
|
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -217,8 +217,8 @@ function createDiscordAvatarResolver() {
|
|
|
217
217
|
}
|
|
218
218
|
//#endregion
|
|
219
219
|
//#region extensions/discord/src/monitor/message-dispatcher.ts
|
|
220
|
-
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-
|
|
221
|
-
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-
|
|
220
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-CO1JNXKw.mjs"));
|
|
221
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-IPQv14En.mjs"));
|
|
222
222
|
function createDiscordMessageDispatcher(params) {
|
|
223
223
|
const readPolicy = params.readPolicy ?? createDiscordLivePolicyReader({
|
|
224
224
|
...params,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { c as resolveDefaultDiscordAccountId } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import { h as Message, k as getChannelMessage, t as discord_exports } from "./discord-
|
|
2
|
+
import { h as Message, k as getChannelMessage, t as discord_exports } from "./discord-KsHAulAQ.mjs";
|
|
3
3
|
import { S as formatDiscordUserTag, a as normalizeDiscordDisplaySlug, f as resolveDiscordGuildEntry, h as resolveDiscordMentionPolicy, l as resolveDiscordChannelConfigWithFallback, o as normalizeDiscordSlug, p as resolveDiscordMemberAccessState } from "./allow-list-C3j0qLDp.mjs";
|
|
4
4
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-cIxzatmv.mjs";
|
|
5
|
-
import { _ as resolveDiscordConversationIdentity, h as resolveDiscordEffectiveRoute, m as resolveDiscordConversationRoute, p as buildDiscordRoutePeer, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-
|
|
6
|
-
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-
|
|
5
|
+
import { _ as resolveDiscordConversationIdentity, h as resolveDiscordEffectiveRoute, m as resolveDiscordConversationRoute, p as buildDiscordRoutePeer, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-CpweCkxm.mjs";
|
|
6
|
+
import { n as resolveDiscordConversationBindingRouteAsync } from "./conversation-binding-route-Cy_QeEBm.mjs";
|
|
7
7
|
import { n as resolveDiscordChannelNameSafe } from "./channel-access-9cyzozUP.mjs";
|
|
8
|
-
import { A as resolveDiscordTextCommandAccess, T as handleDiscordDmCommandDecision, k as resolveDiscordDmCommandAccess, n as resolveDiscordPreflightChannelAccess } from "./provider-
|
|
9
|
-
import { A as resolveDiscordChannelInfo, C as resolveMediaList, D as resolveDiscordMessageStickers, O as resolveDiscordReferencedReplyMessage, S as resolveForwardedMediaList, _ as resolveDiscordMessageBatch, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, v as resolveDiscordMessageHistoryText, y as resolveDiscordMessageMentionDocuments } from "./transcripts-source-
|
|
8
|
+
import { A as resolveDiscordTextCommandAccess, T as handleDiscordDmCommandDecision, k as resolveDiscordDmCommandAccess, n as resolveDiscordPreflightChannelAccess } from "./provider-D9dwCcy8.mjs";
|
|
9
|
+
import { A as resolveDiscordChannelInfo, C as resolveMediaList, D as resolveDiscordMessageStickers, O as resolveDiscordReferencedReplyMessage, S as resolveForwardedMediaList, _ as resolveDiscordMessageBatch, b as resolveDiscordMessageText, j as resolveDiscordMessageChannelId, v as resolveDiscordMessageHistoryText, y as resolveDiscordMessageMentionDocuments } from "./transcripts-source-DUL7GRxU.mjs";
|
|
10
10
|
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-BbA7FNbr.mjs";
|
|
11
|
-
import { a as createDiscordHistorySenderProvenance, c as hasRawDiscordUserMention, d as matchesActiveDiscordMentionPatterns, f as resolveDiscordMentionState, i as loadSystemEventsRuntime, l as isBoundThreadBotSystemMessage, n as loadDiscordThreadingRuntime, p as shouldIgnoreBoundThreadWebhookMessage, r as loadPreflightAudioRuntime, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo, u as isDiscordThreadChannelMessage } from "./message-handler.preflight-pluralkit-
|
|
11
|
+
import { a as createDiscordHistorySenderProvenance, c as hasRawDiscordUserMention, d as matchesActiveDiscordMentionPatterns, f as resolveDiscordMentionState, i as loadSystemEventsRuntime, l as isBoundThreadBotSystemMessage, n as loadDiscordThreadingRuntime, p as shouldIgnoreBoundThreadWebhookMessage, r as loadPreflightAudioRuntime, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo, u as isDiscordThreadChannelMessage } from "./message-handler.preflight-pluralkit-C4FSmp6X.mjs";
|
|
12
12
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
13
13
|
import { getChildLogger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
14
14
|
import { MessageReferenceType, MessageType } from "discord-api-types/v10";
|
|
@@ -26,7 +26,7 @@ import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
|
|
26
26
|
import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
27
27
|
//#region extensions/discord/src/monitor/message-handler.dm-preflight.ts
|
|
28
28
|
const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
|
|
29
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
29
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-DXPqEgjA.mjs").then((n) => n.t));
|
|
30
30
|
async function resolveDiscordDmPreflightAccess(params) {
|
|
31
31
|
if (params.dmPolicy === "disabled") {
|
|
32
32
|
logVerbose("discord: drop dm (dmPolicy: disabled)");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { w as isDiscordThreadChannelType } from "./allow-list-C3j0qLDp.mjs";
|
|
2
|
-
import { D as resolveDiscordMessageStickers } from "./transcripts-source-
|
|
2
|
+
import { D as resolveDiscordMessageStickers } from "./transcripts-source-DUL7GRxU.mjs";
|
|
3
3
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
4
4
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -100,8 +100,8 @@ function resolveDiscordHistoryMediaIds(message) {
|
|
|
100
100
|
//#region extensions/discord/src/monitor/message-handler.preflight-runtime.ts
|
|
101
101
|
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-B64dfq_j.mjs").then((n) => n.n));
|
|
102
102
|
const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-C6QtD6HX.mjs"));
|
|
103
|
-
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-
|
|
104
|
-
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-
|
|
103
|
+
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-CYFu0Vp4.mjs"));
|
|
104
|
+
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-Bem-g91c.mjs").then((n) => n.t));
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region extensions/discord/src/monitor/message-handler.preflight-pluralkit.ts
|
|
107
107
|
async function resolveDiscordPreflightPluralKitInfo(params) {
|
package/dist/.setup/{message-handler.process-BC-wNZwK.mjs → message-handler.process-IPQv14En.mjs}
RENAMED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { m as resolveDiscordMaxLinesPerMessage } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import { N as createDiscordRestClient, O as resolveDiscordMessageFlags, P as createDiscordRuntimeAccountContext, u as resolveDiscordTargetChannelId } from "./send.shared-
|
|
3
|
-
import { D as editChannelMessage, E as deleteChannelMessage, K as captureDiscordRequestAuthority, P as getGuildMember, h as Message, q as withDiscordRequestAuthority, t as discord_exports } from "./discord-
|
|
2
|
+
import { N as createDiscordRestClient, O as resolveDiscordMessageFlags, P as createDiscordRuntimeAccountContext, u as resolveDiscordTargetChannelId } from "./send.shared-BXWCIkfx.mjs";
|
|
3
|
+
import { D as editChannelMessage, E as deleteChannelMessage, K as captureDiscordRequestAuthority, P as getGuildMember, h as Message, q as withDiscordRequestAuthority, t as discord_exports } from "./discord-KsHAulAQ.mjs";
|
|
4
4
|
import { i as normalizeDiscordAllowList, o as normalizeDiscordSlug } from "./allow-list-C3j0qLDp.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { S as chunkDiscordTextWithMode, y as createDiscordRetryRunner } from "./send.receipt-DkCkAjRL.mjs";
|
|
6
6
|
import { n as resolveDiscordChannelId } from "./target-parsing-C-HyNxcE.mjs";
|
|
7
|
-
import { a as removeReactionDiscord, r as reactMessageDiscord } from "./send-
|
|
8
|
-
import { o as discordTextHasBroadcastMention } from "./send.outbound-
|
|
7
|
+
import { a as removeReactionDiscord, r as reactMessageDiscord } from "./send-DXPqEgjA.mjs";
|
|
8
|
+
import { o as discordTextHasBroadcastMention } from "./send.outbound-70KlFdzN.mjs";
|
|
9
9
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-cIxzatmv.mjs";
|
|
10
|
-
import { S as discordInboundEventDelivery, _ as resolveDiscordConversationIdentity, p as buildDiscordRoutePeer } from "./outbound-session-route-
|
|
11
|
-
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-payload-
|
|
12
|
-
import { C as buildDiscordInboundAccessContext, c as formatDiscordReplySkip, d as buildGuildLabel, f as resolveReplyContext, l as sanitizeDiscordFrontChannelReplyPayloads, o as deliverDiscordReply, s as formatDiscordReplyDeliveryFailure, u as buildDirectLabel, w as createDiscordSupplementalContextAccessChecker } from "./provider-
|
|
13
|
-
import { D as resolveDiscordMessageStickers, b as resolveDiscordMessageText, h as resolveDiscordThreadStarter, k as resolveDiscordReferencedReplyMessageId, v as resolveDiscordMessageHistoryText, w as resolveReferencedReplyMediaList, x as formatDiscordMediaText } from "./transcripts-source-
|
|
10
|
+
import { S as discordInboundEventDelivery, _ as resolveDiscordConversationIdentity, p as buildDiscordRoutePeer } from "./outbound-session-route-CpweCkxm.mjs";
|
|
11
|
+
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-payload-Pz-zEQnX.mjs";
|
|
12
|
+
import { C as buildDiscordInboundAccessContext, c as formatDiscordReplySkip, d as buildGuildLabel, f as resolveReplyContext, l as sanitizeDiscordFrontChannelReplyPayloads, o as deliverDiscordReply, s as formatDiscordReplyDeliveryFailure, u as buildDirectLabel, w as createDiscordSupplementalContextAccessChecker } from "./provider-D9dwCcy8.mjs";
|
|
13
|
+
import { D as resolveDiscordMessageStickers, b as resolveDiscordMessageText, h as resolveDiscordThreadStarter, k as resolveDiscordReferencedReplyMessageId, v as resolveDiscordMessageHistoryText, w as resolveReferencedReplyMediaList, x as formatDiscordMediaText } from "./transcripts-source-DUL7GRxU.mjs";
|
|
14
14
|
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-BbA7FNbr.mjs";
|
|
15
|
-
import { n as resolveDiscordAutoThreadReplyPlan } from "./threading-
|
|
15
|
+
import { n as resolveDiscordAutoThreadReplyPlan } from "./threading-Bem-g91c.mjs";
|
|
16
16
|
import { t as beginDiscordActiveTurnThreadRoute } from "./active-turn-thread-route-KvRTAVE3.mjs";
|
|
17
|
-
import { a as createDiscordHistorySenderProvenance, l as isBoundThreadBotSystemMessage, o as filterDiscordHistoryEntriesForContext, p as shouldIgnoreBoundThreadWebhookMessage, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo } from "./message-handler.preflight-pluralkit-
|
|
17
|
+
import { a as createDiscordHistorySenderProvenance, l as isBoundThreadBotSystemMessage, o as filterDiscordHistoryEntriesForContext, p as shouldIgnoreBoundThreadWebhookMessage, s as resolveDiscordHistoryMediaIds, t as resolveDiscordPreflightPluralKitInfo } from "./message-handler.preflight-pluralkit-C4FSmp6X.mjs";
|
|
18
18
|
import { t as sendTyping } from "./typing-CNlSKY5S.mjs";
|
|
19
19
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
20
20
|
import { danger, logVerbose, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as createDiscordActionGate } from "./accounts-C_25wyxC.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { S as chunkDiscordTextWithMode, _ as canFallbackDiscordWebhookSend, b as hasDiscordMessageCreateAmbiguity, c as normalizeDiscordMessagingTarget, g as resolveDiscordReplyReference, i as toDiscordOutboundDeliveryResult, l as normalizeDiscordOutboundTarget, n as createDiscordSendReceiptFromResults, t as createDiscordSendReceipt } from "./send.receipt-DkCkAjRL.mjs";
|
|
3
3
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
4
|
-
import { C as notifyDiscordInboundEventOutboundPayloadSuccess, S as discordInboundEventDelivery, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, v as resolveDiscordCurrentConversationIdentity } from "./outbound-session-route-
|
|
4
|
+
import { C as notifyDiscordInboundEventOutboundPayloadSuccess, S as discordInboundEventDelivery, a as resolveDiscordComponentSpec, c as formatDiscordApprovalDisplayValue, n as DISCORD_PRESENTATION_CAPABILITIES, o as sendDiscordComponentMessageLazy, r as buildDiscordPresentationPayload, v as resolveDiscordCurrentConversationIdentity } from "./outbound-session-route-CpweCkxm.mjs";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
7
7
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -74,7 +74,7 @@ function resolveDiscordInboundConversation(params) {
|
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region extensions/discord/src/outbound-payload.ts
|
|
77
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
77
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-DXPqEgjA.mjs").then((n) => n.t));
|
|
78
78
|
function resolveDiscordDeliveryOptions(ctx) {
|
|
79
79
|
return {
|
|
80
80
|
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
@@ -162,8 +162,8 @@ const DISCORD_VIDEO_MEDIA_EXTENSIONS = [
|
|
|
162
162
|
".webm"
|
|
163
163
|
];
|
|
164
164
|
const log = createSubsystemLogger("discord/outbound");
|
|
165
|
-
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-
|
|
166
|
-
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-
|
|
165
|
+
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-BiO6_GA2.mjs").then((n) => n.i));
|
|
166
|
+
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-MUCtA6qV.mjs").then((n) => n.i));
|
|
167
167
|
const discordOutbound = {
|
|
168
168
|
deliveryMode: "direct",
|
|
169
169
|
chunker: (text, limit, ctx) => chunkDiscordTextWithMode(text, {
|
package/dist/.setup/{outbound-session-route-Ay_DnOOl.mjs → outbound-session-route-CpweCkxm.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-C_25wyxC.mjs";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-DGkdWwix.mjs";
|
|
3
3
|
import { w as isDiscordThreadChannelType } from "./allow-list-C3j0qLDp.mjs";
|
|
4
|
-
import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
4
|
+
import { c as normalizeDiscordMessagingTarget, s as matchesDiscordToolContextTarget } from "./send.receipt-DkCkAjRL.mjs";
|
|
5
5
|
import { t as parseDiscordTarget } from "./target-parsing-C-HyNxcE.mjs";
|
|
6
|
-
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-
|
|
6
|
+
import { c as coerceDiscordComponentParam, l as readDiscordComponentSpec } from "./components-Cy4hDa6J.mjs";
|
|
7
7
|
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-C7rUdqUX.mjs";
|
|
8
8
|
import { createLazyRuntimeMethod, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
9
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -215,7 +215,7 @@ const localExecutionActions = /* @__PURE__ */ new Set([
|
|
|
215
215
|
"sticker-upload",
|
|
216
216
|
"event-create"
|
|
217
217
|
]);
|
|
218
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-
|
|
218
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-BfSo0qkY.mjs"));
|
|
219
219
|
const discordActionGroups = [
|
|
220
220
|
{
|
|
221
221
|
gate: "polls",
|
|
@@ -712,7 +712,7 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
714
|
};
|
|
715
|
-
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-
|
|
715
|
+
const sendDiscordComponentMessageLazy = createLazyRuntimeMethod(createLazyRuntimeModule(() => import("./send.components-MUCtA6qV.mjs").then((n) => n.i)), (runtime) => runtime.sendDiscordComponentMessage);
|
|
716
716
|
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./shared-interactive-DmzaoKOM.mjs").then((n) => n.r));
|
|
717
717
|
function addPayloadTextFallback(spec, payload) {
|
|
718
718
|
return spec.text ? spec : {
|