@openclaw/discord 2026.5.28 → 2026.5.31-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-C4sJZNbI.js → account-inspect-DDZtT5C8.js} +9 -7
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-dXTfmnSZ.js → accounts-P19jm1lf.js} +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/api.js +16 -16
- package/dist/{approval-handler.runtime-CN_E7nkQ.js → approval-handler.runtime-DSFfzXpo.js} +4 -4
- package/dist/{audit-BFCBp74H.js → audit-kgIklCyI.js} +4 -4
- package/dist/{channel-COXb22wL.js → channel-D0gX0yj6.js} +44 -31
- package/dist/{channel-actions-C2g9OmnG.js → channel-actions-DDoc4V7x.js} +4 -4
- package/dist/{channel-actions.runtime-drnbrgpt.js → channel-actions.runtime-CqZfnMaA.js} +5 -5
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-BsrP5-hv.js → channel.setup-BNZm3eed.js} +8 -23
- package/dist/{components-CjQujWa1.js → components-DcLQ2JkV.js} +1 -1
- package/dist/{config-schema-3tZYNVTM.js → config-schema-spuxW477.js} +17 -1
- package/dist/contract-api.js +3 -3
- package/dist/{conversation-identity-CsPV1Gjx.js → conversation-identity-BURFgcfI.js} +7 -5
- package/dist/{directory-config-BqPvRoDv.js → directory-config-B9Jw1Q2R.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-CCI0IMZq.js → directory-live-CDWUg-nA.js} +2 -2
- package/dist/{doctor-Dy7sI1sL.js → doctor-BUhqxLb9.js} +4 -5
- package/dist/{doctor-contract-8-Ia3d_X.js → doctor-contract-BAu3WLvd.js} +5 -5
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{handle-action.guild-admin-BmjclQbR.js → handle-action.guild-admin-Dpa-kUzu.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/legacy-state-migrations-api.js +3 -1
- package/dist/{manager.runtime-ClhnLsZf.js → manager.runtime-BWBENHRA.js} +22 -19
- package/dist/{message-handler-BnhAHqem.js → message-handler-HO8BbZmQ.js} +182 -29
- package/dist/{message-handler.preflight-B1RTQ6ZO.js → message-handler.preflight-DxHBPQvD.js} +24 -17
- package/dist/{message-handler.process-B1ODKav3.js → message-handler.process-Cq3j7A9k.js} +41 -29
- package/dist/{message-utils-CmB03FoF.js → message-utils-D_3KTxh_.js} +19 -15
- package/dist/{outbound-adapter-DfY2Dtf3.js → outbound-adapter-BkPkILpq.js} +52 -87
- package/dist/{pluralkit-DAZN3ZMK.js → pluralkit-Ds9aZAM4.js} +1 -1
- package/dist/{probe-BiEg-_i1.js → probe-2MdGjUAf.js} +1 -1
- package/dist/{probe.runtime-Dja7CbJT.js → probe.runtime-J927koKG.js} +1 -1
- package/dist/{provider-DCcqVFp-.js → provider-BK8hjk_y.js} +224 -150
- package/dist/{provider-session.runtime-mKSG07RE.js → provider-session.runtime-CYMFlLg9.js} +3 -3
- package/dist/provider.runtime-RfQSSM_v.js +2 -0
- package/dist/{resolve-allowlist-common-DAIbZobr.js → resolve-allowlist-common-BIf3417N.js} +1 -1
- package/dist/{resolve-channels-D1zgoxnw.js → resolve-channels-DK-3f_aA.js} +2 -2
- package/dist/{resolve-users-wPAvLk_8.js → resolve-users-DUDPsfWt.js} +2 -2
- package/dist/{runtime-gaB5-Wsj.js → runtime-Blf_d9E7.js} +8 -8
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-LVbgPRHA.js +6 -0
- package/dist/runtime-api.monitor.js +5 -5
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +5 -5
- package/dist/{send-CBxhnbKU.js → send-BHkA8a-k.js} +7 -7
- package/dist/{send.components-uuQuHL3t.js → send.components-CUHzDapa.js} +26 -12
- package/dist/{send.outbound-DZHJYmNF.js → send.outbound-DSKZbjML.js} +15 -5
- package/dist/{send.receipt-3y2lVFRf.js → send.receipt-CjsWpitW.js} +25 -13
- package/dist/{send.shared-Ddl21-Gt.js → send.shared-Cluujl6W.js} +3 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-D3NkInmq.js → shared-BMGLQw74.js} +5 -5
- package/dist/{subagent-hooks-BacIbIBD.js → subagent-hooks-7jAn9HT5.js} +3 -3
- package/dist/subagent-hooks-api.js +1 -5
- package/dist/{system-events-Cw6Hp8RF.js → system-events-BjuNA9Zs.js} +1 -1
- package/dist/{target-resolver-jjQzAS6T.js → target-resolver-BYuWNVQp.js} +3 -3
- package/dist/targets-BNDUOdvI.js +3 -0
- package/dist/{thread-bindings-BBq-yzq2.js → thread-bindings-CKruJE91.js} +6 -6
- package/dist/{thread-bindings.discord-api-5QgEd_dW.js → thread-bindings.discord-api-BjLUwwSP.js} +5 -5
- package/dist/{thread-bindings.manager-COkxjwR9.js → thread-bindings.manager-Dji7SZHG.js} +4 -4
- package/dist/{thread-bindings.session-updates-D5gY2ZTE.js → thread-bindings.session-updates-DoDFvU_h.js} +1 -1
- package/dist/{thread-bindings.state-BsOnj5NX.js → thread-bindings.state-DYp4FVEB.js} +8 -2
- package/dist/{timeouts-l_PsHQvX.js → timeouts-CEJ3--Uw.js} +5 -2
- package/dist/timeouts.js +1 -1
- package/dist/{transcripts-source-DDrS8HrV.js → transcripts-source-O73_YIDs.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-B7bCMPJJ.js → typing-CKW0i8du.js} +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +5 -2
- package/node_modules/typebox/build/type/script/mapping.mjs +15 -8
- package/node_modules/typebox/build/type/script/parser.d.mts +3 -1
- package/node_modules/typebox/build/type/script/parser.mjs +2 -1
- package/node_modules/typebox/package.json +29 -29
- package/npm-shrinkwrap.json +7 -38
- package/openclaw.plugin.json +77 -1
- package/package.json +5 -5
- package/dist/provider.runtime-BmpunJHX.js +0 -2
- package/dist/runtime-api.monitor-B38upMUK.js +0 -5
- package/dist/targets-BVKF5wbg.js +0 -3
|
@@ -1,9 +1,9 @@
|
|
|
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-P19jm1lf.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";
|
|
5
|
-
//#region extensions/discord/src/account-inspect.ts
|
|
6
|
-
function
|
|
5
|
+
//#region extensions/discord/src/account-token-inspect.ts
|
|
6
|
+
function inspectDiscordConfiguredToken(value) {
|
|
7
7
|
const normalized = normalizeSecretInputString(value);
|
|
8
8
|
if (normalized) return {
|
|
9
9
|
token: normalized.replace(/^Bot\s+/i, ""),
|
|
@@ -17,13 +17,15 @@ function inspectDiscordTokenValue(value) {
|
|
|
17
17
|
};
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region extensions/discord/src/account-inspect.ts
|
|
20
22
|
function inspectDiscordAccount(params) {
|
|
21
23
|
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultDiscordAccountId(params.cfg));
|
|
22
24
|
const merged = mergeDiscordAccountConfig(params.cfg, accountId);
|
|
23
25
|
const enabled = params.cfg.channels?.discord?.enabled !== false && merged.enabled !== false;
|
|
24
26
|
const accountConfig = resolveDiscordAccountConfig(params.cfg, accountId);
|
|
25
|
-
const hasAccountToken = Boolean(accountConfig && Object.
|
|
26
|
-
const accountToken =
|
|
27
|
+
const hasAccountToken = Boolean(accountConfig && Object.hasOwn(accountConfig, "token"));
|
|
28
|
+
const accountToken = inspectDiscordConfiguredToken(accountConfig?.token);
|
|
27
29
|
if (accountToken) return {
|
|
28
30
|
accountId,
|
|
29
31
|
enabled,
|
|
@@ -44,7 +46,7 @@ function inspectDiscordAccount(params) {
|
|
|
44
46
|
configured: false,
|
|
45
47
|
config: merged
|
|
46
48
|
};
|
|
47
|
-
const channelToken =
|
|
49
|
+
const channelToken = inspectDiscordConfiguredToken(params.cfg.channels?.discord?.token);
|
|
48
50
|
if (channelToken) return {
|
|
49
51
|
accountId,
|
|
50
52
|
enabled,
|
|
@@ -78,4 +80,4 @@ function inspectDiscordAccount(params) {
|
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
//#endregion
|
|
81
|
-
export { inspectDiscordAccount as t };
|
|
83
|
+
export { inspectDiscordConfiguredToken as n, inspectDiscordAccount as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
1
|
+
import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
|
|
2
2
|
//#region extensions/discord/account-inspect-api.ts
|
|
3
3
|
function inspectDiscordReadOnlyAccount(cfg, accountId) {
|
|
4
4
|
return inspectDiscordAccount({
|
|
@@ -45,7 +45,7 @@ function resolveDiscordToken(cfg, opts = {}) {
|
|
|
45
45
|
const accountId = normalizeAccountId$1(opts.accountId);
|
|
46
46
|
const discordCfg = selectedCfg?.channels?.discord;
|
|
47
47
|
const accountCfg = resolveAccountEntry(discordCfg?.accounts, accountId);
|
|
48
|
-
const hasAccountToken = Boolean(accountCfg && Object.
|
|
48
|
+
const hasAccountToken = Boolean(accountCfg && Object.hasOwn(accountCfg, "token"));
|
|
49
49
|
const accountToken = resolveDiscordTokenValue({
|
|
50
50
|
cfg: selectedCfg,
|
|
51
51
|
value: accountCfg?.token,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-Blf_d9E7.js";
|
|
2
2
|
export { handleDiscordAction };
|
package/dist/api.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, Ut as resolveDiscordChannelId, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId, o as normalizeDiscordOutboundTarget } from "./send.receipt-
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
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-
|
|
1
|
+
import { Ht as parseDiscordTarget, Ut as resolveDiscordChannelId, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId, o as normalizeDiscordOutboundTarget } from "./send.receipt-CjsWpitW.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
|
|
3
|
+
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-P19jm1lf.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-DcLQ2JkV.js";
|
|
5
5
|
import { n as fetchDiscord, r as requestDiscord, t as DiscordApiError } from "./api-BmXlcjYW.js";
|
|
6
|
-
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-
|
|
7
|
-
import "./targets-
|
|
8
|
-
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-
|
|
9
|
-
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-
|
|
6
|
+
import { i as parseDiscordSendTarget, n as resolveDiscordTarget } from "./target-resolver-BYuWNVQp.js";
|
|
7
|
+
import "./targets-BNDUOdvI.js";
|
|
8
|
+
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-BURFgcfI.js";
|
|
9
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-D0gX0yj6.js";
|
|
10
10
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
11
|
-
import { t as discordSetupPlugin } from "./channel.setup-
|
|
12
|
-
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-
|
|
13
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
14
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
15
|
-
import { t as fetchPluralKitMessageInfo } from "./pluralkit-
|
|
16
|
-
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-
|
|
11
|
+
import { t as discordSetupPlugin } from "./channel.setup-BNZm3eed.js";
|
|
12
|
+
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-7jAn9HT5.js";
|
|
13
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Dpa-kUzu.js";
|
|
14
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-B9Jw1Q2R.js";
|
|
15
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-Ds9aZAM4.js";
|
|
16
|
+
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-2MdGjUAf.js";
|
|
17
17
|
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-Bh_65L5C.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-
|
|
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-CEJ3--Uw.js";
|
|
19
19
|
import { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
20
20
|
//#region extensions/discord/api.ts
|
|
21
|
-
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-
|
|
21
|
+
const handleDiscordMessageAction = async (...args) => (await import("./channel-actions.runtime-CqZfnMaA.js")).handleDiscordMessageAction(...args);
|
|
22
22
|
//#endregion
|
|
23
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 { B as Container, J as Separator, K as Row, R as Button, Wt as __exportAll, X as TextDisplay, ft as editChannelMessage, j as serializePayload, nt as createUserDmChannel, st as createChannelMessage, ut as deleteChannelMessage } from "./send.receipt-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { F as createDiscordClient, b as stripUndefinedFields } from "./send.shared-
|
|
4
|
-
import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-
|
|
1
|
+
import { B as Container, J as Separator, K as Row, R as Button, Wt as __exportAll, X as TextDisplay, ft as editChannelMessage, j as serializePayload, nt as createUserDmChannel, st as createChannelMessage, ut as deleteChannelMessage } from "./send.receipt-CjsWpitW.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
|
|
3
|
+
import { F as createDiscordClient, b as stripUndefinedFields } from "./send.shared-Cluujl6W.js";
|
|
4
|
+
import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-BURFgcfI.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,7 +1,7 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { O as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
4
|
-
import "./send-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-CjsWpitW.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
|
|
3
|
+
import { O as fetchChannelPermissionsDiscord } from "./send.shared-Cluujl6W.js";
|
|
4
|
+
import "./send-BHkA8a-k.js";
|
|
5
5
|
import { n as collectDiscordAuditChannelIdsForAccount, t as auditDiscordChannelPermissionsWithFetcher } from "./audit-core-xwjIczO0.js";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId } from "./send.receipt-
|
|
2
|
-
import { c as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-
|
|
1
|
+
import { Ht as parseDiscordTarget, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId } from "./send.receipt-CjsWpitW.js";
|
|
2
|
+
import { c as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
3
|
import { a as projectCredentialSnapshotFields, n as PAIRING_APPROVED_MESSAGE, o as resolveConfiguredFromCredentialStatuses, r as buildTokenChannelStatusSummary, t as DEFAULT_ACCOUNT_ID } from "./channel-api-CAJ0wMoV.js";
|
|
4
|
-
import { x as resolveDiscordOutboundSessionRoute } from "./components-
|
|
4
|
+
import { x as resolveDiscordOutboundSessionRoute } from "./components-DcLQ2JkV.js";
|
|
5
5
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
6
|
-
import { c as shouldSuppressLocalDiscordExecApprovalPrompt, n as resolveDiscordCurrentConversationIdentity, r as getDiscordApprovalCapability } from "./conversation-identity-
|
|
6
|
+
import { c as shouldSuppressLocalDiscordExecApprovalPrompt, n as resolveDiscordCurrentConversationIdentity, r as getDiscordApprovalCapability } from "./conversation-identity-BURFgcfI.js";
|
|
7
7
|
import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-xwjIczO0.js";
|
|
8
|
-
import { t as discordMessageActions$1 } from "./channel-actions-
|
|
9
|
-
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
10
|
-
import { n as discordOutbound } from "./outbound-adapter-
|
|
11
|
-
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-
|
|
8
|
+
import { t as discordMessageActions$1 } from "./channel-actions-DDoc4V7x.js";
|
|
9
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DoDFvU_h.js";
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-BkPkILpq.js";
|
|
11
|
+
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-BMGLQw74.js";
|
|
12
12
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.js";
|
|
13
13
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
14
14
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
@@ -77,18 +77,8 @@ function parseDiscordParentChannelFromSessionKey(raw) {
|
|
|
77
77
|
return match?.[1] ? `channel:${match[1]}` : void 0;
|
|
78
78
|
}
|
|
79
79
|
function resolveDiscordCommandConversation(params) {
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
params.commandTo,
|
|
83
|
-
params.fallbackTo
|
|
84
|
-
];
|
|
85
|
-
if (params.threadId) {
|
|
86
|
-
const parentConversationId = normalizeDiscordMessagingTarget(normalizeOptionalString(params.threadParentId) ?? "") || parseDiscordParentChannelFromSessionKey(params.parentSessionKey) || resolveDiscordConversationIdFromTargets(targets);
|
|
87
|
-
return {
|
|
88
|
-
conversationId: params.threadId,
|
|
89
|
-
...parentConversationId && parentConversationId !== params.threadId ? { parentConversationId } : {}
|
|
90
|
-
};
|
|
91
|
-
}
|
|
80
|
+
const threadConversation = resolveDiscordThreadConversationRef(params);
|
|
81
|
+
if (threadConversation) return threadConversation;
|
|
92
82
|
const conversationId = resolveDiscordCurrentConversationIdentity({
|
|
93
83
|
from: params.from,
|
|
94
84
|
chatType: params.chatType,
|
|
@@ -98,7 +88,28 @@ function resolveDiscordCommandConversation(params) {
|
|
|
98
88
|
});
|
|
99
89
|
return conversationId ? { conversationId } : null;
|
|
100
90
|
}
|
|
91
|
+
function resolveDiscordThreadConversationRef(params) {
|
|
92
|
+
const threadId = normalizeOptionalStringifiedId(params.threadId);
|
|
93
|
+
if (!threadId) return null;
|
|
94
|
+
const targets = [
|
|
95
|
+
params.originatingTo ?? params.to,
|
|
96
|
+
params.commandTo,
|
|
97
|
+
params.fallbackTo ?? params.conversationId
|
|
98
|
+
];
|
|
99
|
+
const parentConversationId = normalizeDiscordMessagingTarget(normalizeOptionalStringifiedId(params.threadParentId) ?? "") || parseDiscordParentChannelFromSessionKey(params.parentSessionKey) || resolveDiscordConversationIdFromTargets(targets);
|
|
100
|
+
return {
|
|
101
|
+
conversationId: threadId,
|
|
102
|
+
...parentConversationId && parentConversationId !== threadId ? { parentConversationId } : {}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
101
105
|
function resolveDiscordInboundConversation(params) {
|
|
106
|
+
const threadConversation = resolveDiscordThreadConversationRef({
|
|
107
|
+
to: params.to,
|
|
108
|
+
conversationId: params.conversationId,
|
|
109
|
+
threadId: params.threadId,
|
|
110
|
+
threadParentId: params.threadParentId
|
|
111
|
+
});
|
|
112
|
+
if (threadConversation) return threadConversation;
|
|
102
113
|
const conversationId = resolveDiscordCurrentConversationIdentity({
|
|
103
114
|
from: params.from,
|
|
104
115
|
chatType: params.isGroup ? "group" : "direct",
|
|
@@ -114,29 +125,29 @@ let discordProbeRuntimePromise;
|
|
|
114
125
|
let discordAuditModulePromise;
|
|
115
126
|
let discordSendModulePromise;
|
|
116
127
|
let discordDirectoryLiveModulePromise;
|
|
117
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
118
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
119
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
120
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
121
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
128
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-B9Jw1Q2R.js").then((n) => n.t));
|
|
129
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-DK-3f_aA.js").then((n) => n.n));
|
|
130
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DUDPsfWt.js").then((n) => n.n));
|
|
131
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-Dji7SZHG.js").then((n) => n.a));
|
|
132
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-BYuWNVQp.js").then((n) => n.r));
|
|
122
133
|
async function loadDiscordProviderRuntime() {
|
|
123
|
-
discordProviderRuntimePromise ??= import("./provider.runtime-
|
|
134
|
+
discordProviderRuntimePromise ??= import("./provider.runtime-RfQSSM_v.js");
|
|
124
135
|
return await discordProviderRuntimePromise;
|
|
125
136
|
}
|
|
126
137
|
async function loadDiscordProbeRuntime() {
|
|
127
|
-
discordProbeRuntimePromise ??= import("./probe.runtime-
|
|
138
|
+
discordProbeRuntimePromise ??= import("./probe.runtime-J927koKG.js");
|
|
128
139
|
return await discordProbeRuntimePromise;
|
|
129
140
|
}
|
|
130
141
|
async function loadDiscordAuditModule() {
|
|
131
|
-
discordAuditModulePromise ??= import("./audit-
|
|
142
|
+
discordAuditModulePromise ??= import("./audit-kgIklCyI.js").then((n) => n.n);
|
|
132
143
|
return await discordAuditModulePromise;
|
|
133
144
|
}
|
|
134
145
|
async function loadDiscordSendModule() {
|
|
135
|
-
discordSendModulePromise ??= import("./send-
|
|
146
|
+
discordSendModulePromise ??= import("./send-BHkA8a-k.js").then((n) => n.t);
|
|
136
147
|
return await discordSendModulePromise;
|
|
137
148
|
}
|
|
138
149
|
async function loadDiscordDirectoryLiveModule() {
|
|
139
|
-
discordDirectoryLiveModulePromise ??= import("./directory-live-
|
|
150
|
+
discordDirectoryLiveModulePromise ??= import("./directory-live-CDWUg-nA.js").then((n) => n.t);
|
|
140
151
|
return await discordDirectoryLiveModulePromise;
|
|
141
152
|
}
|
|
142
153
|
//#endregion
|
|
@@ -442,10 +453,12 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
442
453
|
messaging: {
|
|
443
454
|
targetPrefixes: ["discord"],
|
|
444
455
|
normalizeTarget: normalizeDiscordMessagingTarget,
|
|
445
|
-
resolveInboundConversation: ({ from, to, conversationId, isGroup }) => resolveDiscordInboundConversation({
|
|
456
|
+
resolveInboundConversation: ({ from, to, conversationId, threadId, threadParentId, isGroup }) => resolveDiscordInboundConversation({
|
|
446
457
|
from,
|
|
447
458
|
to,
|
|
448
459
|
conversationId,
|
|
460
|
+
threadId,
|
|
461
|
+
threadParentId,
|
|
449
462
|
isGroup
|
|
450
463
|
}),
|
|
451
464
|
normalizeExplicitSessionKey: ({ sessionKey, ctx }) => normalizeExplicitDiscordSessionKey(sessionKey, ctx),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { d as readDiscordComponentSpec } from "./components-
|
|
1
|
+
import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
|
|
2
|
+
import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-P19jm1lf.js";
|
|
3
|
+
import { d as readDiscordComponentSpec } from "./components-DcLQ2JkV.js";
|
|
4
4
|
import { i as withDiscordInboundEventDeliveryMetadata } from "./inbound-event-delivery-CEPlt2uz.js";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { createUnionActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -34,7 +34,7 @@ function resolveDiscordActionExecutionMode({ action }) {
|
|
|
34
34
|
}
|
|
35
35
|
let discordChannelActionsRuntimePromise;
|
|
36
36
|
async function loadDiscordChannelActionsRuntime() {
|
|
37
|
-
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-
|
|
37
|
+
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-CqZfnMaA.js");
|
|
38
38
|
return await discordChannelActionsRuntimePromise;
|
|
39
39
|
}
|
|
40
40
|
function listDiscoverableDiscordAccounts(cfg) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Ut as resolveDiscordChannelId } from "./send.receipt-
|
|
2
|
-
import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-
|
|
3
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { Ut as resolveDiscordChannelId } from "./send.receipt-CjsWpitW.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-DcLQ2JkV.js";
|
|
3
|
+
import { t as handleDiscordAction } from "./runtime-Blf_d9E7.js";
|
|
4
|
+
import "./targets-BNDUOdvI.js";
|
|
5
5
|
import "./action-runtime-api.js";
|
|
6
6
|
import { r as notifyDiscordInboundEventOutboundSuccess } from "./inbound-event-delivery-CEPlt2uz.js";
|
|
7
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
7
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-Dpa-kUzu.js";
|
|
8
8
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
10
10
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-spuxW477.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-D0gX0yj6.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import { i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-
|
|
4
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
5
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { n as inspectDiscordConfiguredToken } from "./account-inspect-DDZtT5C8.js";
|
|
2
|
+
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, l as resolveDiscordAccountConfig, m as resolveDiscordToken, o as resolveDefaultDiscordAccountId } from "./accounts-P19jm1lf.js";
|
|
3
|
+
import { i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-BMGLQw74.js";
|
|
4
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-DK-3f_aA.js";
|
|
5
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-DUDPsfWt.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
|
-
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
8
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
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
|
|
13
|
-
function inspectConfiguredToken(value) {
|
|
14
|
-
const normalized = normalizeSecretInputString(value);
|
|
15
|
-
if (normalized) return {
|
|
16
|
-
token: normalized.replace(/^Bot\s+/i, ""),
|
|
17
|
-
tokenSource: "config",
|
|
18
|
-
tokenStatus: "available"
|
|
19
|
-
};
|
|
20
|
-
if (hasConfiguredSecretInput(value)) return {
|
|
21
|
-
token: "",
|
|
22
|
-
tokenSource: "config",
|
|
23
|
-
tokenStatus: "configured_unavailable"
|
|
24
|
-
};
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
12
|
function resolveDefaultDiscordSetupAccountId(cfg) {
|
|
28
13
|
return resolveDefaultDiscordAccountId(cfg);
|
|
29
14
|
}
|
|
@@ -38,8 +23,8 @@ function inspectDiscordSetupAccount(params) {
|
|
|
38
23
|
const { accountId, config } = resolveDiscordSetupAccountConfig(params);
|
|
39
24
|
const enabled = params.cfg.channels?.discord?.enabled !== false && config.enabled !== false;
|
|
40
25
|
const accountConfig = resolveDiscordAccountConfig(params.cfg, accountId);
|
|
41
|
-
const hasAccountToken = Boolean(accountConfig && Object.
|
|
42
|
-
const accountToken =
|
|
26
|
+
const hasAccountToken = Boolean(accountConfig && Object.hasOwn(accountConfig, "token"));
|
|
27
|
+
const accountToken = inspectDiscordConfiguredToken(accountConfig?.token);
|
|
43
28
|
if (accountToken) return {
|
|
44
29
|
accountId,
|
|
45
30
|
enabled,
|
|
@@ -58,7 +43,7 @@ function inspectDiscordSetupAccount(params) {
|
|
|
58
43
|
configured: false,
|
|
59
44
|
config
|
|
60
45
|
};
|
|
61
|
-
const channelToken =
|
|
46
|
+
const channelToken = inspectDiscordConfiguredToken(params.cfg.channels?.discord?.token);
|
|
62
47
|
if (channelToken) return {
|
|
63
48
|
accountId,
|
|
64
49
|
enabled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as Container, F as Modal, G as RoleSelectMenu, H as LinkButton, Ht as parseDiscordTarget, I as RadioGroup, J as Separator, K as Row, L as TextInput, N as CheckboxGroup, P as Label, Q as UserSelectMenu, R as Button, U as MediaGallery, V as File, W as MentionableSelectMenu, Wt as __exportAll, X as TextDisplay, Y as StringSelectMenu, Z as Thumbnail, et as parseCustomId, q as Section, z as ChannelSelectMenu } from "./send.receipt-
|
|
1
|
+
import { B as Container, F as Modal, G as RoleSelectMenu, H as LinkButton, Ht as parseDiscordTarget, I as RadioGroup, J as Separator, K as Row, L as TextInput, N as CheckboxGroup, P as Label, Q as UserSelectMenu, R as Button, U as MediaGallery, V as File, W as MentionableSelectMenu, Wt as __exportAll, X as TextDisplay, Y as StringSelectMenu, Z as Thumbnail, et as parseCustomId, q as Section, z as ChannelSelectMenu } from "./send.receipt-CjsWpitW.js";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { buildOutboundBaseSessionKey } from "openclaw/plugin-sdk/routing";
|
|
4
4
|
import { buildThreadAwareOutboundSessionRoute } from "openclaw/plugin-sdk/channel-core";
|
|
@@ -18,6 +18,22 @@ const DiscordChannelConfigSchema = buildChannelConfigSchema(DiscordConfigSchema,
|
|
|
18
18
|
label: "Discord Config Writes",
|
|
19
19
|
help: "Allow Discord to write config in response to channel events/commands (default: true)."
|
|
20
20
|
},
|
|
21
|
+
mentionPatterns: {
|
|
22
|
+
label: "Discord Mention Pattern Policy",
|
|
23
|
+
help: "Scopes configured groupChat mentionPatterns to selected Discord channel IDs. Native Discord @mentions still trigger even when regex patterns are denied."
|
|
24
|
+
},
|
|
25
|
+
"mentionPatterns.mode": {
|
|
26
|
+
label: "Discord Mention Pattern Mode",
|
|
27
|
+
help: "\"allow\" enables configured regex mention patterns unless denyIn matches; \"deny\" disables them unless allowIn matches."
|
|
28
|
+
},
|
|
29
|
+
"mentionPatterns.allowIn": {
|
|
30
|
+
label: "Discord Mention Pattern Allowlist",
|
|
31
|
+
help: "Discord channel IDs where configured regex mention patterns are enabled when mode is deny."
|
|
32
|
+
},
|
|
33
|
+
"mentionPatterns.denyIn": {
|
|
34
|
+
label: "Discord Mention Pattern Denylist",
|
|
35
|
+
help: "Discord channel IDs where configured regex mention patterns are disabled. Native @mentions still trigger."
|
|
36
|
+
},
|
|
21
37
|
proxy: {
|
|
22
38
|
label: "Discord Proxy URL",
|
|
23
39
|
help: "Proxy URL for Discord gateway + API requests (app-id lookup and allowlist resolution). Set per account via channels.discord.accounts.<id>.proxy."
|
|
@@ -196,7 +212,7 @@ const DiscordChannelConfigSchema = buildChannelConfigSchema(DiscordConfigSchema,
|
|
|
196
212
|
},
|
|
197
213
|
"voice.model": {
|
|
198
214
|
label: "Discord Voice Model",
|
|
199
|
-
help: "Optional LLM model override for Discord voice channel responses and realtime agent consults (for example openai
|
|
215
|
+
help: "Optional LLM model override for Discord voice channel responses and realtime agent consults (for example openai/gpt-5.5). Leave unset to inherit the routed agent model."
|
|
200
216
|
},
|
|
201
217
|
"voice.mode": {
|
|
202
218
|
label: "Discord Voice Mode",
|
package/dist/contract-api.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BAu3WLvd.js";
|
|
2
2
|
import { n as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-BjM-1hr9.js";
|
|
3
3
|
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DSHk7I2w.js";
|
|
4
4
|
import { t as deriveLegacySessionChatType } from "./session-contract-BO5tlIdl.js";
|
|
5
|
-
import { i as testing, n as createThreadBindingManager } from "./thread-bindings.manager-
|
|
6
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
5
|
+
import { i as testing, n as createThreadBindingManager } from "./thread-bindings.manager-Dji7SZHG.js";
|
|
6
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-B9Jw1Q2R.js";
|
|
7
7
|
import { t as collectDiscordSecurityAuditFindings } from "./security-audit-Bh_65L5C.js";
|
|
8
8
|
export { collectDiscordSecurityAuditFindings, collectRuntimeConfigAssignments, collectUnsupportedSecretRefConfigCandidates, createThreadBindingManager, deriveLegacySessionChatType, testing as discordThreadBindingTesting, legacyConfigRules, listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig, normalizeCompatibilityConfig, secretTargetRegistryEntries, unsupportedSecretRefSurfacePatterns };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget } from "./send.receipt-
|
|
2
|
-
import { r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-
|
|
1
|
+
import { Ht as parseDiscordTarget } from "./send.receipt-CjsWpitW.js";
|
|
2
|
+
import { r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
5
5
|
import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetResolver, doesApprovalRequestMatchChannelAccount, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
@@ -95,9 +95,11 @@ function shouldHandleDiscordApprovalRequest(params) {
|
|
|
95
95
|
//#region extensions/discord/src/approval-native.ts
|
|
96
96
|
function extractDiscordSessionKind(sessionKey) {
|
|
97
97
|
if (!sessionKey) return null;
|
|
98
|
-
const match = sessionKey.match(/discord:(channel|group|dm):/);
|
|
98
|
+
const match = sessionKey.match(/discord:(?:[^:]+:)?(channel|group|dm|direct):/);
|
|
99
99
|
if (!match) return null;
|
|
100
|
-
|
|
100
|
+
const raw = match[1];
|
|
101
|
+
if (raw === "direct") return "dm";
|
|
102
|
+
return raw;
|
|
101
103
|
}
|
|
102
104
|
function normalizeDiscordOriginChannelId(value) {
|
|
103
105
|
if (!value) return null;
|
|
@@ -229,7 +231,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
229
231
|
request,
|
|
230
232
|
configOverride
|
|
231
233
|
}),
|
|
232
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
234
|
+
load: async () => (await import("./approval-handler.runtime-DSFfzXpo.js").then((n) => n.t)).discordApprovalNativeRuntime
|
|
233
235
|
})
|
|
234
236
|
});
|
|
235
237
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
2
|
-
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, o as resolveDefaultDiscordAccountId } from "./accounts-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-CjsWpitW.js";
|
|
2
|
+
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, o as resolveDefaultDiscordAccountId } from "./accounts-P19jm1lf.js";
|
|
3
3
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
5
5
|
//#region extensions/discord/src/directory-config.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
1
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-B9Jw1Q2R.js";
|
|
2
2
|
export { listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
2
|
-
import { p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-CjsWpitW.js";
|
|
2
|
+
import { p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
3
|
import { n as fetchDiscord } from "./api-BmXlcjYW.js";
|
|
4
4
|
import { a as normalizeDiscordSlug } from "./allow-list-BnkWtVpA.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
4
|
-
import { n as normalizeCompatibilityConfig } from "./doctor-contract-
|
|
1
|
+
import { t as inspectDiscordAccount } from "./account-inspect-DDZtT5C8.js";
|
|
2
|
+
import { o as resolveDefaultDiscordAccountId } from "./accounts-P19jm1lf.js";
|
|
3
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-BMGLQw74.js";
|
|
4
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-BAu3WLvd.js";
|
|
5
5
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-uUo8hTD5.js";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { collectProviderDangerousNameMatchingScopes } from "openclaw/plugin-sdk/runtime-doctor";
|
|
8
|
-
import "openclaw/plugin-sdk/channel-contract";
|
|
9
8
|
//#region extensions/discord/src/doctor.ts
|
|
10
9
|
function asObjectRecord$1(value) {
|
|
11
10
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -11,7 +11,7 @@ const LEGACY_TTS_PROVIDER_KEYS = [
|
|
|
11
11
|
function hasLegacyTtsProviderKeys(value) {
|
|
12
12
|
const tts = asObjectRecord(value);
|
|
13
13
|
if (!tts) return false;
|
|
14
|
-
return LEGACY_TTS_PROVIDER_KEYS.some((key) => Object.
|
|
14
|
+
return LEGACY_TTS_PROVIDER_KEYS.some((key) => Object.hasOwn(tts, key));
|
|
15
15
|
}
|
|
16
16
|
function hasLegacyDiscordAccountTtsProviderKeys(value) {
|
|
17
17
|
const accounts = asObjectRecord(value);
|
|
@@ -26,7 +26,7 @@ function hasLegacyDiscordGuildChannelAllowAlias(value) {
|
|
|
26
26
|
return Object.values(guilds).some((guildValue) => {
|
|
27
27
|
const channels = asObjectRecord(asObjectRecord(guildValue)?.channels);
|
|
28
28
|
if (!channels) return false;
|
|
29
|
-
return Object.values(channels).some((channel) => Object.
|
|
29
|
+
return Object.values(channels).some((channel) => Object.hasOwn(asObjectRecord(channel) ?? {}, "allow"));
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
function hasLegacyDiscordGuildChannelAgentId(value) {
|
|
@@ -35,7 +35,7 @@ function hasLegacyDiscordGuildChannelAgentId(value) {
|
|
|
35
35
|
return Object.values(guilds).some((guildValue) => {
|
|
36
36
|
const channels = asObjectRecord(asObjectRecord(guildValue)?.channels);
|
|
37
37
|
if (!channels) return false;
|
|
38
|
-
return Object.values(channels).some((channel) => Object.
|
|
38
|
+
return Object.values(channels).some((channel) => Object.hasOwn(asObjectRecord(channel) ?? {}, "agentId"));
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
function hasLegacyDiscordAccountGuildChannelAllowAlias(value) {
|
|
@@ -182,7 +182,7 @@ function normalizeDiscordGuildChannelAllowAliases(params) {
|
|
|
182
182
|
const nextChannels = { ...channels };
|
|
183
183
|
for (const [channelId, channelValue] of Object.entries(channels)) {
|
|
184
184
|
const channel = asObjectRecord(channelValue);
|
|
185
|
-
if (!channel || !Object.
|
|
185
|
+
if (!channel || !Object.hasOwn(channel, "allow")) continue;
|
|
186
186
|
const nextChannel = { ...channel };
|
|
187
187
|
if (nextChannel.enabled === void 0) {
|
|
188
188
|
nextChannel.enabled = channel.allow;
|
|
@@ -234,7 +234,7 @@ function normalizeDiscordGuildChannelAgentIds(params) {
|
|
|
234
234
|
const nextChannels = { ...channels };
|
|
235
235
|
for (const [channelId, channelValue] of Object.entries(channels)) {
|
|
236
236
|
const channel = asObjectRecord(channelValue);
|
|
237
|
-
if (!channel || !Object.
|
|
237
|
+
if (!channel || !Object.hasOwn(channel, "agentId")) continue;
|
|
238
238
|
const nextChannel = { ...channel };
|
|
239
239
|
const rawAgentId = nextChannel.agentId;
|
|
240
240
|
delete nextChannel.agentId;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BAu3WLvd.js";
|
|
2
2
|
export { legacyConfigRules, normalizeCompatibilityConfig };
|
package/dist/{handle-action.guild-admin-BmjclQbR.js → handle-action.guild-admin-Dpa-kUzu.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as readDiscordChannelCreateParams, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { a as readDiscordChannelCreateParams, n as isDiscordModerationAction, o as readDiscordChannelEditParams, r as readDiscordModerationCommand, s as readDiscordChannelMoveParams, t as handleDiscordAction } from "./runtime-Blf_d9E7.js";
|
|
2
2
|
import "./action-runtime-api.js";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/agent-runtime";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { registerDiscordSubagentHooks } from "./subagent-hooks-api.js";
|
|
2
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
2
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-O73_YIDs.js";
|
|
3
3
|
import "./transcripts-source-api.js";
|
|
4
4
|
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
5
5
|
//#region extensions/discord/index.ts
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MAX_DATE_TIMESTAMP_MS, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
1
2
|
import { createHash } from "node:crypto";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import fs from "node:fs";
|
|
@@ -59,7 +60,8 @@ function timestampMs(value) {
|
|
|
59
60
|
return Number.isFinite(parsed) ? parsed : 0;
|
|
60
61
|
}
|
|
61
62
|
function legacyUpdatedAtForIndex(updatedAt, index, total) {
|
|
62
|
-
|
|
63
|
+
const baseMs = timestampMs(updatedAt);
|
|
64
|
+
return timestampMsToIsoString(Math.min(baseMs + Math.max(0, total), MAX_DATE_TIMESTAMP_MS) - Math.max(0, index)) ?? timestampMsToIsoString(baseMs) ?? timestampMsToIsoString(Math.max(0, total - index)) ?? "1970-01-01T00:00:00.000Z";
|
|
63
65
|
}
|
|
64
66
|
const detectDiscordLegacyStateMigrations = ({ stateDir }) => {
|
|
65
67
|
const sourcePath = path.join(stateDir, "discord", "model-picker-preferences.json");
|