@openclaw/discord 2026.5.14-beta.1 → 2026.5.16-beta.1
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/{account-inspect-BhtPexBW.js → account-inspect-B_N30NV0.js} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-BbRDLOSB.js → accounts-DnNVBDfc.js} +93 -3
- package/dist/action-runtime-api.js +1 -1
- package/dist/{allow-list-n8Ki-Rt3.js → allow-list-CBI-M84K.js} +24 -2
- package/dist/api.js +19 -21
- package/dist/{approval-handler.runtime-CWW7pvnT.js → approval-handler.runtime-CS97g4S1.js} +4 -4
- package/dist/{audit-CifMTQ4S.js → audit-BZOw16KT.js} +5 -5
- package/dist/{channel-actions-BfavEEmD.js → channel-actions-0dOFg3Mu.js} +4 -4
- package/dist/{channel-actions.runtime-CwAAxp-T.js → channel-actions.runtime-BB30vneH.js} +11 -5
- package/dist/channel-config-api.js +1 -1
- package/dist/{channel-Di2t5Ef3.js → channel-ngFtP-WD.js} +23 -25
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-7et6c1aZ.js → channel.setup-BwmvzHMR.js} +35 -34
- package/dist/{components-Dxq2mU57.js → components-Cgm7XT8-.js} +120 -3
- package/dist/{config-schema-DnD91yKG.js → config-schema-D0eb2vPJ.js} +5 -1
- package/dist/contract-api.js +7 -7
- package/dist/{approval-native-DBBOuPzt.js → conversation-identity-Dh8wIQ_K.js} +123 -6
- package/dist/{directory-config-BFIM4K7-.js → directory-config-CW_JusGS.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/directory-live-MrDSKsMf.js +159 -0
- package/dist/{doctor-CpgTyCTh.js → doctor-CWTWiBru.js} +5 -5
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{doctor-contract-BGjjFBdq.js → doctor-contract-ftWAMvBl.js} +1 -1
- package/dist/{handle-action.guild-admin-SEB7Ohbw.js → handle-action.guild-admin-DOW3XfEG.js} +1 -1
- package/dist/{inbound-context-jtKcY9on.js → inbound-context-BdfOEkhj.js} +8 -11
- package/dist/{manager.runtime-DWYmpG8O.js → manager.runtime-D8sDxzBv.js} +7 -9
- package/dist/{message-handler-Cg5wp_2Y.js → message-handler-D-Nboii4.js} +7 -7
- package/dist/{message-handler.preflight-B4lZOc7E.js → message-handler.preflight-BMgBVbmR.js} +106 -26
- package/dist/{message-handler.process-BuDy-YnE.js → message-handler.process-Dfu_aSv1.js} +262 -216
- package/dist/{message-utils-m_Trzh54.js → message-utils-CY91O2k2.js} +36 -3
- package/dist/{outbound-adapter-DXtiQgPB.js → outbound-adapter-Fe4Ee_GO.js} +7 -10
- package/dist/{pluralkit-B1HTaBc9.js → pluralkit-B2AqgTHV.js} +1 -1
- package/dist/{preflight-audio-CD97vnac.js → preflight-audio-DFGpAvzi.js} +1 -1
- package/dist/{probe-BZtr8qle.js → probe-CiBYm-vD.js} +2 -2
- package/dist/{probe.runtime-0F0UzBoJ.js → probe.runtime-9hi1GYNU.js} +1 -1
- package/dist/{provider-B28t_1YH.js → provider-B81nXBRc.js} +1043 -46
- package/dist/{provider-session.runtime-DaeQ5NLC.js → provider-session.runtime-C7p_WbqZ.js} +3 -3
- package/dist/provider.runtime-B_3TYTb7.js +2 -0
- package/dist/{resolve-allowlist-common-CVHYb5Hb.js → resolve-allowlist-common-DybgkAjk.js} +3 -3
- package/dist/{resolve-channels-JNt3Ak6P.js → resolve-channels-u7_agBcm.js} +4 -4
- package/dist/{resolve-users-CrjbUxrL.js → resolve-users-Bc25I6OP.js} +3 -3
- package/dist/{runtime-C6dFeIPS.js → runtime-ToiiUiXe.js} +121 -49
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +25 -26
- package/dist/runtime-api.lookup.js +6 -6
- package/dist/runtime-api.monitor-DJQdXyzE.js +5 -0
- package/dist/runtime-api.monitor.js +7 -8
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +5 -5
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/{security-audit-BQ_sGK3J.js → security-audit-CLPZKYi4.js} +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-B7Gmz2DX.js → security-audit.runtime-CCm9leFJ.js} +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-DDM8s4P5.js → send-CvXckvRn.js} +16 -7
- package/dist/{send.components-Cidmc-7C.js → send.components-BlNbbG3H.js} +10 -11
- package/dist/{send.outbound-DsgxtI_N.js → send.outbound-BKh71kjw.js} +135 -28
- package/dist/{discord-BqYcwxvG.js → send.receipt-nKLxvA1s.js} +319 -1
- package/dist/{send.shared-CnvqNVpX.js → send.shared-Bdj-DP6-.js} +44 -31
- package/dist/{sender-identity-w9rSI-nD.js → sender-identity-BTGL3VbF.js} +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-ljKQIIu9.js → shared-LuaeDRhK.js} +16 -14
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{subagent-hooks-DFS9GrHB.js → subagent-hooks-vwV-pjIA.js} +3 -3
- package/dist/{system-events-B04UOvPg.js → system-events-Bnit0zkQ.js} +2 -2
- package/dist/{target-resolver-DklxEM4N.js → target-resolver-BsGT9hI7.js} +3 -6
- package/dist/targets-DwW6OieO.js +3 -0
- package/dist/test-api.js +5 -5
- package/dist/{thread-bindings-qSEjvnb4.js → thread-bindings-BwcE40jS.js} +6 -7
- package/dist/{thread-bindings.discord-api-BvPFybEu.js → thread-bindings.discord-api-BtXi8-Fz.js} +67 -8
- package/dist/{thread-bindings.manager-C-LpcekY.js → thread-bindings.manager-BL5QlX3G.js} +4 -5
- package/dist/{thread-bindings.session-updates-D18cCLmN.js → thread-bindings.session-updates-ZnRRzzgf.js} +1 -1
- package/dist/timeouts.js +1 -1
- package/dist/{typing-_jePdFIw.js → typing-C_8U8J7E.js} +2 -2
- package/openclaw.plugin.json +10 -0
- package/package.json +6 -6
- package/dist/access-Dxmzr0ix.js +0 -89
- package/dist/approval-shared-DxKO7gfl.js +0 -93
- package/dist/channel-access-BL-wemES.js +0 -62
- package/dist/chunk-DYl-_5RL.js +0 -179
- package/dist/conversation-identity-CvIx6J7M.js +0 -31
- package/dist/directory-cache-Ddl-Oxue.js +0 -62
- package/dist/directory-live-CdCwhQYI.js +0 -101
- package/dist/doctor-shared-D_QLzu30.js +0 -4
- package/dist/format-D8TsaXxW.js +0 -24
- package/dist/mentions-BZoGn0ul.js +0 -88
- package/dist/normalize-Cu94FOqy.js +0 -58
- package/dist/outbound-session-route-BaJRt05p.js +0 -43
- package/dist/provider.runtime-6_eQZwab.js +0 -2
- package/dist/reply-delivery-DU6Dm1P4.js +0 -191
- package/dist/route-resolution-DxF6Qn7V.js +0 -268
- package/dist/runtime-api.monitor-Ba1r1iSI.js +0 -6
- package/dist/send.receipt-BAZw2Zsz.js +0 -35
- package/dist/shared-interactive-DavY6jYt.js +0 -79
- package/dist/target-parsing-D-H7nnh2.js +0 -51
- package/dist/targets-DkUzREzb.js +0 -3
- package/dist/threading-D9rX0JRU.js +0 -475
- package/dist/token-BZtonk7d.js +0 -93
- /package/dist/{agent-components.runtime-zT8qPsnM.js → agent-components.runtime-CEMbMQcQ.js} +0 -0
- /package/dist/{api-DzNBVTto.js → api-DgQLz1wq.js} +0 -0
- /package/dist/{audit-core-BgDZSkIR.js → audit-core-DRyoXREU.js} +0 -0
- /package/dist/{channel-api-CTSWMrnD.js → channel-api-JudoSiJv.js} +0 -0
- /package/dist/{config-api-CFZtoMaS.js → config-api-oLS_52S7.js} +0 -0
- /package/dist/{gateway-registry-BKG4KIVC.js → gateway-registry-BKSpa4GB.js} +0 -0
- /package/dist/{preflight-audio.runtime-fXnUxxBa.js → preflight-audio.runtime-Drc-OFcp.js} +0 -0
- /package/dist/{preview-streaming-DCPAe24T.js → preview-streaming-CXTZydhx.js} +0 -0
- /package/dist/{runtime-BqCoo-zp.js → runtime-Tqtvj5GX.js} +0 -0
- /package/dist/{secret-config-contract-BCQNNS7N.js → secret-config-contract-B3347_eU.js} +0 -0
- /package/dist/{security-contract-DkCMKSvb.js → security-contract-DyCRvz_Q.js} +0 -0
- /package/dist/{security-doctor-BJH5YIGL.js → security-doctor-Cp-NqNdS.js} +0 -0
- /package/dist/{session-contract-D871HDFG.js → session-contract-ugfEa9Xc.js} +0 -0
- /package/dist/{session-key-normalization-BV82IME9.js → session-key-normalization-B7h83qD2.js} +0 -0
- /package/dist/{thread-bindings.state-SPlv6mh7.js → thread-bindings.state-BdBeo7Rx.js} +0 -0
- /package/dist/{timeouts-C3FYXWJX.js → timeouts-snXNwR4m.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as mergeDiscordAccountConfig, l as resolveDiscordAccountConfig, o as resolveDefaultDiscordAccountId } from "./accounts-
|
|
1
|
+
import { a as mergeDiscordAccountConfig, l as resolveDiscordAccountConfig, o as resolveDefaultDiscordAccountId } from "./accounts-DnNVBDfc.js";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
1
|
+
import { t as inspectDiscordAccount } from "./account-inspect-B_N30NV0.js";
|
|
2
2
|
//#region extensions/discord/account-inspect-api.ts
|
|
3
3
|
function inspectDiscordReadOnlyAccount(cfg, accountId) {
|
|
4
4
|
return inspectDiscordAccount({
|
|
@@ -1,9 +1,99 @@
|
|
|
1
|
-
import { n as resolveDiscordToken, r as selectDiscordRuntimeConfig } from "./token-BZtonk7d.js";
|
|
2
1
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
2
|
+
import { normalizeResolvedSecretInputString, resolveSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createAccountActionGate, createAccountListHelpers, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-helpers";
|
|
5
5
|
import { mapAllowFromEntries, normalizeChannelDmPolicy, resolveChannelDmAllowFrom, resolveChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
6
|
-
import { resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
|
6
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, normalizeAccountId as normalizeAccountId$1, resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
|
7
|
+
import { getRuntimeConfigSnapshot, getRuntimeConfigSourceSnapshot, selectApplicableRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
8
|
+
//#region extensions/discord/src/runtime-config.ts
|
|
9
|
+
function selectDiscordRuntimeConfig(inputConfig) {
|
|
10
|
+
return selectApplicableRuntimeConfig({
|
|
11
|
+
inputConfig,
|
|
12
|
+
runtimeConfig: getRuntimeConfigSnapshot(),
|
|
13
|
+
runtimeSourceConfig: getRuntimeConfigSourceSnapshot()
|
|
14
|
+
}) ?? inputConfig;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region extensions/discord/src/token.ts
|
|
18
|
+
function stripDiscordBotPrefix(token) {
|
|
19
|
+
return token.replace(/^Bot\s+/i, "");
|
|
20
|
+
}
|
|
21
|
+
function normalizeDiscordToken(raw, path) {
|
|
22
|
+
const trimmed = normalizeResolvedSecretInputString({
|
|
23
|
+
value: raw,
|
|
24
|
+
path
|
|
25
|
+
});
|
|
26
|
+
if (!trimmed) return;
|
|
27
|
+
return stripDiscordBotPrefix(trimmed);
|
|
28
|
+
}
|
|
29
|
+
function resolveDiscordTokenValue(params) {
|
|
30
|
+
const resolved = resolveSecretInputString({
|
|
31
|
+
value: params.value,
|
|
32
|
+
path: params.path,
|
|
33
|
+
defaults: params.cfg.secrets?.defaults,
|
|
34
|
+
mode: "inspect"
|
|
35
|
+
});
|
|
36
|
+
if (resolved.status === "available") return {
|
|
37
|
+
status: "available",
|
|
38
|
+
value: stripDiscordBotPrefix(resolved.value)
|
|
39
|
+
};
|
|
40
|
+
if (resolved.status === "configured_unavailable") return { status: "configured_unavailable" };
|
|
41
|
+
return { status: "missing" };
|
|
42
|
+
}
|
|
43
|
+
function resolveDiscordToken(cfg, opts = {}) {
|
|
44
|
+
const selectedCfg = selectDiscordRuntimeConfig(cfg);
|
|
45
|
+
const accountId = normalizeAccountId$1(opts.accountId);
|
|
46
|
+
const discordCfg = selectedCfg?.channels?.discord;
|
|
47
|
+
const accountCfg = resolveAccountEntry(discordCfg?.accounts, accountId);
|
|
48
|
+
const hasAccountToken = Boolean(accountCfg && Object.prototype.hasOwnProperty.call(accountCfg, "token"));
|
|
49
|
+
const accountToken = resolveDiscordTokenValue({
|
|
50
|
+
cfg: selectedCfg,
|
|
51
|
+
value: accountCfg?.token,
|
|
52
|
+
path: `channels.discord.accounts.${accountId}.token`
|
|
53
|
+
});
|
|
54
|
+
if (accountToken.status === "available" && accountToken.value) return {
|
|
55
|
+
token: accountToken.value,
|
|
56
|
+
source: "config",
|
|
57
|
+
tokenStatus: "available"
|
|
58
|
+
};
|
|
59
|
+
if (accountToken.status === "configured_unavailable") return {
|
|
60
|
+
token: "",
|
|
61
|
+
source: "config",
|
|
62
|
+
tokenStatus: "configured_unavailable"
|
|
63
|
+
};
|
|
64
|
+
if (hasAccountToken) return {
|
|
65
|
+
token: "",
|
|
66
|
+
source: "none",
|
|
67
|
+
tokenStatus: "missing"
|
|
68
|
+
};
|
|
69
|
+
const configToken = resolveDiscordTokenValue({
|
|
70
|
+
cfg: selectedCfg,
|
|
71
|
+
value: discordCfg?.token,
|
|
72
|
+
path: "channels.discord.token"
|
|
73
|
+
});
|
|
74
|
+
if (configToken.status === "available" && configToken.value) return {
|
|
75
|
+
token: configToken.value,
|
|
76
|
+
source: "config",
|
|
77
|
+
tokenStatus: "available"
|
|
78
|
+
};
|
|
79
|
+
if (configToken.status === "configured_unavailable") return {
|
|
80
|
+
token: "",
|
|
81
|
+
source: "config",
|
|
82
|
+
tokenStatus: "configured_unavailable"
|
|
83
|
+
};
|
|
84
|
+
const envToken = accountId === DEFAULT_ACCOUNT_ID$1 ? normalizeDiscordToken(opts.envToken ?? process.env.DISCORD_BOT_TOKEN, "DISCORD_BOT_TOKEN") : void 0;
|
|
85
|
+
if (envToken) return {
|
|
86
|
+
token: envToken,
|
|
87
|
+
source: "env",
|
|
88
|
+
tokenStatus: "available"
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
token: "",
|
|
92
|
+
source: "none",
|
|
93
|
+
tokenStatus: "missing"
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
7
97
|
//#region extensions/discord/src/accounts.ts
|
|
8
98
|
const { listAccountIds, resolveDefaultAccountId } = createAccountListHelpers("discord");
|
|
9
99
|
const listDiscordAccountIds = listAccountIds;
|
|
@@ -128,4 +218,4 @@ function listEnabledDiscordAccounts(cfg) {
|
|
|
128
218
|
})).filter((account) => isDiscordAccountEnabledForRuntime(account, cfg));
|
|
129
219
|
}
|
|
130
220
|
//#endregion
|
|
131
|
-
export { mergeDiscordAccountConfig as a, resolveDiscordAccountAllowFrom as c, resolveDiscordAccountDmPolicy as d, resolveDiscordMaxLinesPerMessage as f, listEnabledDiscordAccounts as i, resolveDiscordAccountConfig as l, isDiscordAccountEnabledForRuntime as n, resolveDefaultDiscordAccountId as o, listDiscordAccountIds as r, resolveDiscordAccount as s, createDiscordActionGate as t, resolveDiscordAccountDisabledReason as u };
|
|
221
|
+
export { mergeDiscordAccountConfig as a, resolveDiscordAccountAllowFrom as c, resolveDiscordAccountDmPolicy as d, resolveDiscordMaxLinesPerMessage as f, listEnabledDiscordAccounts as i, resolveDiscordAccountConfig as l, resolveDiscordToken as m, isDiscordAccountEnabledForRuntime as n, resolveDefaultDiscordAccountId as o, normalizeDiscordToken as p, listDiscordAccountIds as r, resolveDiscordAccount as s, createDiscordActionGate as t, resolveDiscordAccountDisabledReason as u };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-ToiiUiXe.js";
|
|
2
2
|
export { handleDiscordAction };
|
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
import { n as formatDiscordUserTag } from "./format-D8TsaXxW.js";
|
|
2
1
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
2
|
import { buildChannelKeyCandidates, resolveChannelEntryMatchWithFallback, resolveChannelMatchConfig } from "openclaw/plugin-sdk/channel-targets";
|
|
3
|
+
//#region extensions/discord/src/monitor/format.ts
|
|
4
|
+
function resolveDiscordSystemLocation(params) {
|
|
5
|
+
const { isDirectMessage, isGroupDm, guild, channelName } = params;
|
|
6
|
+
if (isDirectMessage) return "DM";
|
|
7
|
+
if (isGroupDm) return `Group DM #${channelName}`;
|
|
8
|
+
return guild?.name ? `${guild.name} #${channelName}` : `#${channelName}`;
|
|
9
|
+
}
|
|
10
|
+
function formatDiscordReactionEmoji(emoji) {
|
|
11
|
+
if (emoji.id && emoji.name) return `<:${emoji.name}:${emoji.id}>`;
|
|
12
|
+
if (emoji.id) return `emoji:${emoji.id}`;
|
|
13
|
+
return emoji.name ?? "emoji";
|
|
14
|
+
}
|
|
15
|
+
function formatDiscordUserTag(user) {
|
|
16
|
+
const discriminator = (user.discriminator ?? "").trim();
|
|
17
|
+
if (discriminator && discriminator !== "0") return `${user.username}#${discriminator}`;
|
|
18
|
+
return user.username ?? user.id;
|
|
19
|
+
}
|
|
20
|
+
function resolveTimestampMs(timestamp) {
|
|
21
|
+
if (!timestamp) return;
|
|
22
|
+
const parsed = Date.parse(timestamp);
|
|
23
|
+
return Number.isNaN(parsed) ? void 0 : parsed;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
4
26
|
//#region extensions/discord/src/monitor/allow-list.ts
|
|
5
27
|
const DISCORD_OWNER_ALLOWLIST_PREFIXES = [
|
|
6
28
|
"discord:",
|
|
@@ -329,4 +351,4 @@ function shouldEmitDiscordReactionNotification(params) {
|
|
|
329
351
|
return false;
|
|
330
352
|
}
|
|
331
353
|
//#endregion
|
|
332
|
-
export { resolveGroupDmAllow as _, normalizeDiscordSlug as a, resolveDiscordChannelConfigWithFallback as c, resolveDiscordGuildEntry as d, resolveDiscordMemberAccessState as f, resolveDiscordShouldRequireMention as g, resolveDiscordOwnerAllowFrom as h, normalizeDiscordDisplaySlug as i, resolveDiscordChannelPolicyCommandAuthorizer as l, resolveDiscordOwnerAccess as m, isDiscordGroupAllowedByPolicy as n, resolveDiscordAllowListMatch as o, resolveDiscordMemberAllowed as p, normalizeDiscordAllowList as r, resolveDiscordChannelConfig as s, allowListMatches as t, resolveDiscordCommandAuthorized as u, shouldEmitDiscordReactionNotification as v };
|
|
354
|
+
export { resolveTimestampMs as S, resolveGroupDmAllow as _, normalizeDiscordSlug as a, formatDiscordUserTag as b, resolveDiscordChannelConfigWithFallback as c, resolveDiscordGuildEntry as d, resolveDiscordMemberAccessState as f, resolveDiscordShouldRequireMention as g, resolveDiscordOwnerAllowFrom as h, normalizeDiscordDisplaySlug as i, resolveDiscordChannelPolicyCommandAuthorizer as l, resolveDiscordOwnerAccess as m, isDiscordGroupAllowedByPolicy as n, resolveDiscordAllowListMatch as o, resolveDiscordMemberAllowed as p, normalizeDiscordAllowList as r, resolveDiscordChannelConfig as s, allowListMatches as t, resolveDiscordCommandAuthorized as u, shouldEmitDiscordReactionNotification as v, resolveDiscordSystemLocation as x, formatDiscordReactionEmoji as y };
|
package/dist/api.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import {
|
|
6
|
-
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import "./
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { n as
|
|
15
|
-
import { t as
|
|
16
|
-
import { n as
|
|
17
|
-
import { t as
|
|
18
|
-
import { a as
|
|
19
|
-
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-BQ_sGK3J.js";
|
|
20
|
-
import { a as mergeAbortSignals, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-C3FYXWJX.js";
|
|
1
|
+
import { Ht as parseDiscordTarget, Ut as resolveDiscordChannelId, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId, o as normalizeDiscordOutboundTarget } from "./send.receipt-nKLxvA1s.js";
|
|
2
|
+
import { a as mergeDiscordAccountConfig, f as resolveDiscordMaxLinesPerMessage, i as listEnabledDiscordAccounts, l as resolveDiscordAccountConfig, o as resolveDefaultDiscordAccountId, r as listDiscordAccountIds, s as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-DnNVBDfc.js";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-B_N30NV0.js";
|
|
4
|
+
import { _ as parseDiscordComponentCustomId, b as parseDiscordModalCustomIdForInteraction, c as buildDiscordComponentMessage, d as readDiscordComponentSpec, f as resolveDiscordComponentAttachmentName, g as buildDiscordModalCustomId, h as buildDiscordComponentCustomId, l as buildDiscordComponentMessageFlags, m as DISCORD_MODAL_CUSTOM_ID_KEY, n as formatDiscordComponentEventText, o as DiscordFormModal, p as DISCORD_COMPONENT_CUSTOM_ID_KEY, r as buildDiscordInteractiveComponents, s as createDiscordFormModal, u as DISCORD_COMPONENT_ATTACHMENT_PREFIX, v as parseDiscordComponentCustomIdForInteraction, y as parseDiscordModalCustomId } from "./components-Cgm7XT8-.js";
|
|
5
|
+
import { n as fetchDiscord, r as requestDiscord, t as DiscordApiError } from "./api-DgQLz1wq.js";
|
|
6
|
+
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-BsGT9hI7.js";
|
|
7
|
+
import "./targets-DwW6OieO.js";
|
|
8
|
+
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-Dh8wIQ_K.js";
|
|
9
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-ngFtP-WD.js";
|
|
10
|
+
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-B7h83qD2.js";
|
|
11
|
+
import { t as discordSetupPlugin } from "./channel.setup-BwmvzHMR.js";
|
|
12
|
+
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-vwV-pjIA.js";
|
|
13
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-DOW3XfEG.js";
|
|
14
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-CW_JusGS.js";
|
|
15
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-B2AqgTHV.js";
|
|
16
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-CiBYm-vD.js";
|
|
17
|
+
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-CLPZKYi4.js";
|
|
18
|
+
import { a as mergeAbortSignals, i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-snXNwR4m.js";
|
|
21
19
|
import { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
22
20
|
//#region extensions/discord/api.ts
|
|
23
|
-
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-
|
|
21
|
+
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-BB30vneH.js")).handleDiscordMessageAction(...args);
|
|
24
22
|
//#endregion
|
|
25
23
|
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_COMPONENT_ATTACHMENT_PREFIX, DISCORD_COMPONENT_CUSTOM_ID_KEY, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, DISCORD_MODAL_CUSTOM_ID_KEY, DiscordApiError, DiscordFormModal, buildDiscordComponentCustomId, buildDiscordComponentMessage, buildDiscordComponentMessageFlags, buildDiscordInteractiveComponents, buildDiscordModalCustomId, collectDiscordSecurityAuditFindings, collectDiscordStatusIssues, createDiscordActionGate, createDiscordFormModal, discordPlugin, discordSetupPlugin, fetchDiscord, fetchDiscordApplicationId, fetchDiscordApplicationSummary, fetchPluralKitMessageInfo, formatDiscordComponentEventText, getDiscordExecApprovalApprovers, handleDiscordMessageAction, handleDiscordSubagentDeliveryTarget, handleDiscordSubagentEnded, handleDiscordSubagentSpawning, inspectDiscordAccount, isDiscordExecApprovalApprover, isDiscordExecApprovalClientEnabled, listDiscordAccountIds, listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig, listEnabledDiscordAccounts, looksLikeDiscordTargetId, mergeAbortSignals, mergeDiscordAccountConfig, normalizeDiscordMessagingTarget, normalizeDiscordOutboundTarget, normalizeExplicitDiscordSessionKey, parseApplicationIdFromToken, parseDiscordComponentCustomId, parseDiscordComponentCustomIdForInteraction as parseDiscordComponentCustomIdForCarbon, parseDiscordComponentCustomIdForInteraction, parseDiscordModalCustomId, parseDiscordModalCustomIdForInteraction as parseDiscordModalCustomIdForCarbon, parseDiscordModalCustomIdForInteraction, parseDiscordSendTarget, parseDiscordTarget, probeDiscord, readDiscordComponentSpec, requestDiscord, resolveDefaultDiscordAccountId, resolveDiscordAccount, resolveDiscordAccountConfig, resolveDiscordChannelId, resolveDiscordComponentAttachmentName, resolveDiscordGroupRequireMention, resolveDiscordGroupToolPolicy, resolveDiscordMaxLinesPerMessage, resolveDiscordPrivilegedIntentsFromFlags, resolveDiscordRuntimeGroupPolicy, resolveDiscordTarget, shouldSuppressLocalDiscordExecApprovalPrompt, tryHandleDiscordMessageActionGuildAdmin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import {
|
|
4
|
-
import { i as
|
|
1
|
+
import { B as Container, J as Separator, K as Row, M as serializePayload, R as Button, Wt as __exportAll, X as TextDisplay, ft as editChannelMessage, nt as createUserDmChannel, st as createChannelMessage, ut as deleteChannelMessage } from "./send.receipt-nKLxvA1s.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-B_N30NV0.js";
|
|
3
|
+
import { M as createDiscordClient, b as stripUndefinedFields } from "./send.shared-Bdj-DP6-.js";
|
|
4
|
+
import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-Dh8wIQ_K.js";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { ButtonStyle } from "discord-api-types/v10";
|
|
7
7
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import {
|
|
4
|
-
import "./send-
|
|
5
|
-
import { n as collectDiscordAuditChannelIdsForAccount, t as auditDiscordChannelPermissionsWithFetcher } from "./audit-core-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-nKLxvA1s.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-B_N30NV0.js";
|
|
3
|
+
import { E as fetchChannelPermissionsDiscord } from "./send.shared-Bdj-DP6-.js";
|
|
4
|
+
import "./send-CvXckvRn.js";
|
|
5
|
+
import { n as collectDiscordAuditChannelIdsForAccount, t as auditDiscordChannelPermissionsWithFetcher } from "./audit-core-DRyoXREU.js";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import {
|
|
1
|
+
import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-DnNVBDfc.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-B_N30NV0.js";
|
|
3
|
+
import { d as readDiscordComponentSpec } from "./components-Cgm7XT8-.js";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { createUnionActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
6
6
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
7
7
|
//#region extensions/discord/src/channel-actions.ts
|
|
8
8
|
let discordChannelActionsRuntimePromise;
|
|
9
9
|
async function loadDiscordChannelActionsRuntime() {
|
|
10
|
-
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-
|
|
10
|
+
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-BB30vneH.js");
|
|
11
11
|
return await discordChannelActionsRuntimePromise;
|
|
12
12
|
}
|
|
13
13
|
function listDiscoverableDiscordAccounts(cfg) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { Ut as resolveDiscordChannelId } from "./send.receipt-nKLxvA1s.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-Cgm7XT8-.js";
|
|
3
|
+
import { t as handleDiscordAction } from "./runtime-ToiiUiXe.js";
|
|
4
|
+
import "./targets-DwW6OieO.js";
|
|
5
5
|
import "./action-runtime-api.js";
|
|
6
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
6
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-DOW3XfEG.js";
|
|
7
7
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
9
9
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
@@ -51,13 +51,16 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
51
51
|
const rawEmbeds = params.embeds;
|
|
52
52
|
const embeds = Array.isArray(rawEmbeds) ? rawEmbeds : void 0;
|
|
53
53
|
const silent = readBooleanParam(params, "silent") === true;
|
|
54
|
+
const suppressEmbeds = readBooleanParam(params, "suppressEmbeds");
|
|
54
55
|
const sessionKey = readStringParam(params, "__sessionKey");
|
|
55
56
|
const agentId = readStringParam(params, "__agentId");
|
|
57
|
+
const threadName = readStringParam(params, "threadName");
|
|
56
58
|
return await handleDiscordAction({
|
|
57
59
|
action: "sendMessage",
|
|
58
60
|
accountId: accountId ?? void 0,
|
|
59
61
|
to,
|
|
60
62
|
content: content ?? "",
|
|
63
|
+
...threadName ? { threadName } : {},
|
|
61
64
|
mediaUrl: mediaUrl ?? void 0,
|
|
62
65
|
filename: filename ?? void 0,
|
|
63
66
|
replyTo: replyTo ?? void 0,
|
|
@@ -65,6 +68,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
65
68
|
embeds,
|
|
66
69
|
asVoice,
|
|
67
70
|
silent,
|
|
71
|
+
...suppressEmbeds === void 0 ? {} : { suppressEmbeds },
|
|
68
72
|
__sessionKey: sessionKey ?? void 0,
|
|
69
73
|
__agentId: agentId ?? void 0
|
|
70
74
|
}, cfg, actionOptions);
|
|
@@ -77,6 +81,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
77
81
|
const filename = readStringParam(params, "filename");
|
|
78
82
|
const replyTo = readStringParam(params, "replyTo");
|
|
79
83
|
const silent = readBooleanParam(params, "silent") === true;
|
|
84
|
+
const suppressEmbeds = readBooleanParam(params, "suppressEmbeds");
|
|
80
85
|
const sessionKey = readStringParam(params, "__sessionKey");
|
|
81
86
|
const agentId = readStringParam(params, "__agentId");
|
|
82
87
|
return await handleDiscordAction({
|
|
@@ -88,6 +93,7 @@ async function handleDiscordMessageAction(ctx) {
|
|
|
88
93
|
filename: filename ?? void 0,
|
|
89
94
|
replyTo: replyTo ?? void 0,
|
|
90
95
|
silent,
|
|
96
|
+
...suppressEmbeds === void 0 ? {} : { suppressEmbeds },
|
|
91
97
|
__sessionKey: sessionKey ?? void 0,
|
|
92
98
|
__agentId: agentId ?? void 0
|
|
93
99
|
}, cfg, actionOptions);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-D0eb2vPJ.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
import {
|
|
13
|
-
import { n as discordOutbound } from "./outbound-adapter-DXtiQgPB.js";
|
|
14
|
-
import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-ljKQIIu9.js";
|
|
15
|
-
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-BV82IME9.js";
|
|
1
|
+
import { Ht as parseDiscordTarget, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId } from "./send.receipt-nKLxvA1s.js";
|
|
2
|
+
import { c as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-DnNVBDfc.js";
|
|
3
|
+
import { a as projectCredentialSnapshotFields, n as PAIRING_APPROVED_MESSAGE, o as resolveConfiguredFromCredentialStatuses, r as buildTokenChannelStatusSummary, t as DEFAULT_ACCOUNT_ID } from "./channel-api-JudoSiJv.js";
|
|
4
|
+
import { x as resolveDiscordOutboundSessionRoute } from "./components-Cgm7XT8-.js";
|
|
5
|
+
import { t as getDiscordRuntime } from "./runtime-Tqtvj5GX.js";
|
|
6
|
+
import { c as shouldSuppressLocalDiscordExecApprovalPrompt, n as resolveDiscordCurrentConversationIdentity, r as getDiscordApprovalCapability } from "./conversation-identity-Dh8wIQ_K.js";
|
|
7
|
+
import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-DRyoXREU.js";
|
|
8
|
+
import { t as discordMessageActions$1 } from "./channel-actions-0dOFg3Mu.js";
|
|
9
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-ZnRRzzgf.js";
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-Fe4Ee_GO.js";
|
|
11
|
+
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-LuaeDRhK.js";
|
|
12
|
+
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-B7h83qD2.js";
|
|
16
13
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
17
14
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
18
15
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -129,29 +126,29 @@ let discordProbeRuntimePromise;
|
|
|
129
126
|
let discordAuditModulePromise;
|
|
130
127
|
let discordSendModulePromise;
|
|
131
128
|
let discordDirectoryLiveModulePromise;
|
|
132
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
133
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
134
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
135
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
136
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
129
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-CW_JusGS.js").then((n) => n.t));
|
|
130
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-u7_agBcm.js").then((n) => n.n));
|
|
131
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-Bc25I6OP.js").then((n) => n.n));
|
|
132
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-BL5QlX3G.js").then((n) => n.a));
|
|
133
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BsGT9hI7.js").then((n) => n.r));
|
|
137
134
|
async function loadDiscordProviderRuntime() {
|
|
138
|
-
discordProviderRuntimePromise ??= import("./provider.runtime-
|
|
135
|
+
discordProviderRuntimePromise ??= import("./provider.runtime-B_3TYTb7.js");
|
|
139
136
|
return await discordProviderRuntimePromise;
|
|
140
137
|
}
|
|
141
138
|
async function loadDiscordProbeRuntime() {
|
|
142
|
-
discordProbeRuntimePromise ??= import("./probe.runtime-
|
|
139
|
+
discordProbeRuntimePromise ??= import("./probe.runtime-9hi1GYNU.js");
|
|
143
140
|
return await discordProbeRuntimePromise;
|
|
144
141
|
}
|
|
145
142
|
async function loadDiscordAuditModule() {
|
|
146
|
-
discordAuditModulePromise ??= import("./audit-
|
|
143
|
+
discordAuditModulePromise ??= import("./audit-BZOw16KT.js").then((n) => n.n);
|
|
147
144
|
return await discordAuditModulePromise;
|
|
148
145
|
}
|
|
149
146
|
async function loadDiscordSendModule() {
|
|
150
|
-
discordSendModulePromise ??= import("./send-
|
|
147
|
+
discordSendModulePromise ??= import("./send-CvXckvRn.js").then((n) => n.t);
|
|
151
148
|
return await discordSendModulePromise;
|
|
152
149
|
}
|
|
153
150
|
async function loadDiscordDirectoryLiveModule() {
|
|
154
|
-
discordDirectoryLiveModulePromise ??= import("./directory-live-
|
|
151
|
+
discordDirectoryLiveModulePromise ??= import("./directory-live-MrDSKsMf.js").then((n) => n.t);
|
|
155
152
|
return await discordDirectoryLiveModulePromise;
|
|
156
153
|
}
|
|
157
154
|
//#endregion
|
|
@@ -727,6 +724,7 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
727
724
|
}),
|
|
728
725
|
gateway: { startAccount: async (ctx) => {
|
|
729
726
|
const account = ctx.account;
|
|
727
|
+
if (account.tokenStatus === "configured_unavailable") throw new Error(`Discord bot token configured for account "${account.accountId}" is unavailable; resolve SecretRefs against the active runtime snapshot before using this account.`);
|
|
730
728
|
const startupDelayMs = resolveDiscordStartupDelayMs(ctx.cfg, account.accountId);
|
|
731
729
|
if (startupDelayMs > 0) {
|
|
732
730
|
ctx.log?.info(`[${account.accountId}] delaying provider startup ${Math.round(startupDelayMs / 1e3)}s to reduce Discord startup rate limits`);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-ngFtP-WD.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-CrjbUxrL.js";
|
|
1
|
+
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, l as resolveDiscordAccountConfig, m as resolveDiscordToken, o as resolveDefaultDiscordAccountId } from "./accounts-DnNVBDfc.js";
|
|
2
|
+
import { i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-LuaeDRhK.js";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-u7_agBcm.js";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-Bc25I6OP.js";
|
|
6
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
6
|
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
8
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
-
import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createLegacyCompatChannelDmPolicy, createStandardChannelSetupStatus, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptLegacyChannelAllowFromForAccount, resolveEntriesWithOptionalToken, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup-runtime";
|
|
8
|
+
import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createLegacyCompatChannelDmPolicy, createSetupTranslator, createStandardChannelSetupStatus, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptLegacyChannelAllowFromForAccount, resolveEntriesWithOptionalToken, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup-runtime";
|
|
10
9
|
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
11
10
|
import "openclaw/plugin-sdk/account-resolution";
|
|
12
11
|
//#region extensions/discord/src/setup-account-state.ts
|
|
@@ -90,13 +89,14 @@ function inspectDiscordSetupAccount(params) {
|
|
|
90
89
|
}
|
|
91
90
|
//#endregion
|
|
92
91
|
//#region extensions/discord/src/setup-core.ts
|
|
92
|
+
const t$1 = createSetupTranslator();
|
|
93
93
|
const channel$1 = "discord";
|
|
94
94
|
const DISCORD_TOKEN_HELP_LINES = [
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
95
|
+
t$1("wizard.discord.tokenHelpCreateApplication"),
|
|
96
|
+
t$1("wizard.discord.tokenHelpCopyToken"),
|
|
97
|
+
t$1("wizard.discord.tokenHelpInviteBot"),
|
|
98
|
+
t$1("wizard.discord.tokenHelpMessageContentIntent"),
|
|
99
|
+
t$1("wizard.channels.docs", { link: formatDocsLink("/discord", "discord") })
|
|
100
100
|
];
|
|
101
101
|
function mapDiscordSetupAllowlistEntries(resolved) {
|
|
102
102
|
if (!Array.isArray(resolved)) return [];
|
|
@@ -152,10 +152,10 @@ function createDiscordSetupWizardBase(handlers) {
|
|
|
152
152
|
channel: channel$1,
|
|
153
153
|
status: createStandardChannelSetupStatus({
|
|
154
154
|
channelLabel: "Discord",
|
|
155
|
-
configuredLabel: "
|
|
156
|
-
unconfiguredLabel: "
|
|
157
|
-
configuredHint: "
|
|
158
|
-
unconfiguredHint: "
|
|
155
|
+
configuredLabel: t$1("wizard.channels.statusConfigured"),
|
|
156
|
+
unconfiguredLabel: t$1("wizard.channels.statusNeedsToken"),
|
|
157
|
+
configuredHint: t$1("wizard.channels.statusConfigured"),
|
|
158
|
+
unconfiguredHint: t$1("wizard.channels.statusNeedsToken"),
|
|
159
159
|
configuredScore: 2,
|
|
160
160
|
unconfiguredScore: 1,
|
|
161
161
|
resolveConfigured: ({ cfg, accountId }) => inspectDiscordSetupAccount({
|
|
@@ -166,13 +166,13 @@ function createDiscordSetupWizardBase(handlers) {
|
|
|
166
166
|
credentials: [{
|
|
167
167
|
inputKey: "token",
|
|
168
168
|
providerHint: channel$1,
|
|
169
|
-
credentialLabel: "
|
|
169
|
+
credentialLabel: t$1("wizard.discord.botToken"),
|
|
170
170
|
preferredEnvVar: "DISCORD_BOT_TOKEN",
|
|
171
|
-
helpTitle: "
|
|
171
|
+
helpTitle: t$1("wizard.discord.botToken"),
|
|
172
172
|
helpLines: DISCORD_TOKEN_HELP_LINES,
|
|
173
|
-
envPrompt: "
|
|
174
|
-
keepPrompt: "
|
|
175
|
-
inputPrompt: "
|
|
173
|
+
envPrompt: t$1("wizard.discord.tokenEnvPrompt"),
|
|
174
|
+
keepPrompt: t$1("wizard.discord.tokenKeepPrompt"),
|
|
175
|
+
inputPrompt: t$1("wizard.discord.tokenInputPrompt"),
|
|
176
176
|
allowEnv: ({ accountId }) => accountId === DEFAULT_ACCOUNT_ID,
|
|
177
177
|
inspect: ({ cfg, accountId }) => {
|
|
178
178
|
const account = inspectDiscordSetupAccount({
|
|
@@ -189,7 +189,7 @@ function createDiscordSetupWizardBase(handlers) {
|
|
|
189
189
|
}],
|
|
190
190
|
groupAccess: createAccountScopedGroupAccessSection({
|
|
191
191
|
channel: channel$1,
|
|
192
|
-
label: "
|
|
192
|
+
label: t$1("wizard.discord.channelsLabel"),
|
|
193
193
|
placeholder: "My Server/#general, guildId/channelId, #support",
|
|
194
194
|
currentPolicy: ({ cfg, accountId }) => resolveDiscordSetupAccountConfig({
|
|
195
195
|
cfg,
|
|
@@ -220,17 +220,17 @@ function createDiscordSetupWizardBase(handlers) {
|
|
|
220
220
|
credentialInputKey: "token",
|
|
221
221
|
helpTitle: "Discord allowlist",
|
|
222
222
|
helpLines: [
|
|
223
|
-
"
|
|
224
|
-
"
|
|
223
|
+
t$1("wizard.discord.allowlistIntro"),
|
|
224
|
+
t$1("wizard.discord.examples"),
|
|
225
225
|
"- 123456789012345678",
|
|
226
226
|
"- @alice",
|
|
227
227
|
"- alice#1234",
|
|
228
|
-
"
|
|
229
|
-
|
|
228
|
+
t$1("wizard.discord.multipleEntries"),
|
|
229
|
+
t$1("wizard.channels.docs", { link: formatDocsLink("/discord", "discord") })
|
|
230
230
|
],
|
|
231
|
-
message: "
|
|
231
|
+
message: t$1("wizard.discord.allowFromPrompt"),
|
|
232
232
|
placeholder: "@alice, 123456789012345678",
|
|
233
|
-
invalidWithoutCredentialNote: "
|
|
233
|
+
invalidWithoutCredentialNote: t$1("wizard.discord.allowFromInvalidWithoutToken"),
|
|
234
234
|
parseId: parseDiscordAllowFromId,
|
|
235
235
|
resolveEntries: handlers.resolveAllowFromEntries
|
|
236
236
|
}),
|
|
@@ -240,6 +240,7 @@ function createDiscordSetupWizardBase(handlers) {
|
|
|
240
240
|
}
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region extensions/discord/src/setup-surface.ts
|
|
243
|
+
const t = createSetupTranslator();
|
|
243
244
|
const channel = "discord";
|
|
244
245
|
async function resolveDiscordAllowFromEntries(params) {
|
|
245
246
|
return await resolveEntriesWithOptionalToken({
|
|
@@ -271,20 +272,20 @@ async function promptDiscordAllowFrom(params) {
|
|
|
271
272
|
cfg,
|
|
272
273
|
accountId
|
|
273
274
|
}),
|
|
274
|
-
noteTitle: "
|
|
275
|
+
noteTitle: t("wizard.discord.allowlistTitle"),
|
|
275
276
|
noteLines: [
|
|
276
|
-
"
|
|
277
|
-
"
|
|
277
|
+
t("wizard.discord.allowlistIntro"),
|
|
278
|
+
t("wizard.discord.examples"),
|
|
278
279
|
"- 123456789012345678",
|
|
279
280
|
"- @alice",
|
|
280
281
|
"- alice#1234",
|
|
281
|
-
"
|
|
282
|
-
|
|
282
|
+
t("wizard.discord.multipleEntries"),
|
|
283
|
+
t("wizard.channels.docs", { link: formatDocsLink("/discord", "discord") })
|
|
283
284
|
],
|
|
284
|
-
message: "
|
|
285
|
+
message: t("wizard.discord.allowFromPrompt"),
|
|
285
286
|
placeholder: "@alice, 123456789012345678",
|
|
286
287
|
parseId: parseDiscordAllowFromId,
|
|
287
|
-
invalidWithoutTokenNote: "
|
|
288
|
+
invalidWithoutTokenNote: t("wizard.discord.allowFromInvalidWithoutToken"),
|
|
288
289
|
resolveExisting: (account, cfg) => resolveDiscordAccountAllowFrom({
|
|
289
290
|
cfg,
|
|
290
291
|
accountId: account.accountId
|