@openclaw/discord 2026.5.28-beta.4 → 2026.5.30-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-BkL-fm-M.js} +7 -5
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-CN_E7nkQ.js → approval-handler.runtime-BFLqemq4.js} +4 -4
- package/dist/{audit-BFCBp74H.js → audit-CKzCd_nb.js} +4 -4
- package/dist/{channel-BYmr1mf7.js → channel-DnUKVkVn.js} +16 -16
- package/dist/{channel-actions-BcCh_k4K.js → channel-actions-D60aLg8q.js} +16 -4
- package/dist/{channel-actions.runtime-drnbrgpt.js → channel-actions.runtime-D6awrVWB.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-Cqfoar5h.js} +6 -20
- package/dist/{components-CjQujWa1.js → components-CWgTTA0J.js} +1 -1
- package/dist/{config-schema-3tZYNVTM.js → config-schema-C1lzB2Ld.js} +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/{conversation-identity-CsPV1Gjx.js → conversation-identity-Dvi-8LyR.js} +2 -2
- package/dist/{directory-config-BqPvRoDv.js → directory-config-B-i4XzWZ.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-CCI0IMZq.js → directory-live-B5E-IbgC.js} +1 -1
- package/dist/{doctor-Dy7sI1sL.js → doctor-DT41iqQA.js} +2 -2
- package/dist/{handle-action.guild-admin-BmjclQbR.js → handle-action.guild-admin-B39nAL5c.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-ClHe315Q.js} +16 -8
- package/dist/{message-handler-BnhAHqem.js → message-handler-Deidymb-.js} +182 -29
- package/dist/{message-handler.preflight-B1RTQ6ZO.js → message-handler.preflight-DeTwc2nk.js} +11 -11
- package/dist/{message-handler.process-B1ODKav3.js → message-handler.process-DJkFWirK.js} +30 -28
- package/dist/{message-utils-CmB03FoF.js → message-utils-C4OlktSy.js} +19 -15
- package/dist/{outbound-adapter-DfY2Dtf3.js → outbound-adapter-DCC3zPuC.js} +51 -86
- package/dist/{pluralkit-DAZN3ZMK.js → pluralkit-Dhad974D.js} +1 -1
- package/dist/{provider-DCcqVFp-.js → provider-SeIwaTTJ.js} +127 -133
- package/dist/{provider-session.runtime-mKSG07RE.js → provider-session.runtime-B5aLy8NA.js} +3 -3
- package/dist/provider.runtime-DVHYE9ZI.js +2 -0
- package/dist/{resolve-channels-D1zgoxnw.js → resolve-channels-LMOlvXSw.js} +1 -1
- package/dist/{resolve-users-wPAvLk_8.js → resolve-users-WNAKeCd_.js} +1 -1
- package/dist/{runtime-gaB5-Wsj.js → runtime-Dg0INaGm.js} +7 -7
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +21 -21
- package/dist/runtime-api.lookup.js +4 -4
- package/dist/runtime-api.monitor-C56AP2ZG.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-DwUf-fzH.js} +6 -6
- package/dist/{send.components-uuQuHL3t.js → send.components-BVfuI0-G.js} +25 -11
- package/dist/{send.outbound-DZHJYmNF.js → send.outbound-4IJRwYbJ.js} +3 -3
- package/dist/{send.receipt-3y2lVFRf.js → send.receipt-CxFJX9o3.js} +22 -10
- package/dist/{send.shared-Ddl21-Gt.js → send.shared-DQwyGjXe.js} +2 -2
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-D3NkInmq.js → shared-D-ePFtjZ.js} +3 -3
- package/dist/{subagent-hooks-BacIbIBD.js → subagent-hooks-CqhiwYpb.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -5
- package/dist/{system-events-Cw6Hp8RF.js → system-events-DZdHRt2j.js} +1 -1
- package/dist/{target-resolver-jjQzAS6T.js → target-resolver-DTD90GqZ.js} +2 -2
- package/dist/targets-xBATI2q7.js +3 -0
- package/dist/{thread-bindings-BBq-yzq2.js → thread-bindings-VrlFUPDW.js} +6 -6
- package/dist/{thread-bindings.discord-api-5QgEd_dW.js → thread-bindings.discord-api-CItgvv24.js} +5 -5
- package/dist/{thread-bindings.manager-COkxjwR9.js → thread-bindings.manager-hhqHJlGr.js} +4 -4
- package/dist/{thread-bindings.session-updates-D5gY2ZTE.js → thread-bindings.session-updates-0BaqAU8S.js} +1 -1
- package/dist/{thread-bindings.state-BsOnj5NX.js → thread-bindings.state-B-iprgEM.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-CFsqnHc4.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-B7bCMPJJ.js → typing-Bfns8H17.js} +2 -2
- package/npm-shrinkwrap.json +3 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -4
- package/dist/provider.runtime-BmpunJHX.js +0 -2
- package/dist/runtime-api.monitor-B38upMUK.js +0 -5
- package/dist/targets-BVKF5wbg.js +0 -3
|
@@ -2,8 +2,8 @@ import { a as mergeDiscordAccountConfig, l as resolveDiscordAccountConfig, o as
|
|
|
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
27
|
const hasAccountToken = Boolean(accountConfig && Object.prototype.hasOwnProperty.call(accountConfig, "token"));
|
|
26
|
-
const accountToken =
|
|
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-BkL-fm-M.js";
|
|
2
2
|
//#region extensions/discord/account-inspect-api.ts
|
|
3
3
|
function inspectDiscordReadOnlyAccount(cfg, accountId) {
|
|
4
4
|
return inspectDiscordAccount({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-Dg0INaGm.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-
|
|
1
|
+
import { Ht as parseDiscordTarget, Ut as resolveDiscordChannelId, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId, o as normalizeDiscordOutboundTarget } from "./send.receipt-CxFJX9o3.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BkL-fm-M.js";
|
|
2
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-dXTfmnSZ.js";
|
|
3
|
-
import {
|
|
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-CjQujWa1.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-CWgTTA0J.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-DTD90GqZ.js";
|
|
7
|
+
import "./targets-xBATI2q7.js";
|
|
8
|
+
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-Dvi-8LyR.js";
|
|
9
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-DnUKVkVn.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-
|
|
11
|
+
import { t as discordSetupPlugin } from "./channel.setup-Cqfoar5h.js";
|
|
12
|
+
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-CqhiwYpb.js";
|
|
13
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-B39nAL5c.js";
|
|
14
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-B-i4XzWZ.js";
|
|
15
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-Dhad974D.js";
|
|
16
16
|
import { a as resolveDiscordPrivilegedIntentsFromFlags, i as probeDiscord, n as fetchDiscordApplicationSummary, r as parseApplicationIdFromToken, t as fetchDiscordApplicationId } from "./probe-BiEg-_i1.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-D6awrVWB.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-CxFJX9o3.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BkL-fm-M.js";
|
|
3
|
+
import { F as createDiscordClient, b as stripUndefinedFields } from "./send.shared-DQwyGjXe.js";
|
|
4
|
+
import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-Dvi-8LyR.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-CxFJX9o3.js";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BkL-fm-M.js";
|
|
3
|
+
import { O as fetchChannelPermissionsDiscord } from "./send.shared-DQwyGjXe.js";
|
|
4
|
+
import "./send-DwUf-fzH.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-
|
|
1
|
+
import { Ht as parseDiscordTarget, a as normalizeDiscordMessagingTarget, i as looksLikeDiscordTargetId } from "./send.receipt-CxFJX9o3.js";
|
|
2
2
|
import { c as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.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-CWgTTA0J.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-Dvi-8LyR.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-D60aLg8q.js";
|
|
9
|
+
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-0BaqAU8S.js";
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-DCC3zPuC.js";
|
|
11
|
+
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-D-ePFtjZ.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";
|
|
@@ -114,13 +114,13 @@ let discordProbeRuntimePromise;
|
|
|
114
114
|
let discordAuditModulePromise;
|
|
115
115
|
let discordSendModulePromise;
|
|
116
116
|
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-
|
|
117
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-B-i4XzWZ.js").then((n) => n.t));
|
|
118
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-LMOlvXSw.js").then((n) => n.n));
|
|
119
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-WNAKeCd_.js").then((n) => n.n));
|
|
120
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-hhqHJlGr.js").then((n) => n.a));
|
|
121
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-DTD90GqZ.js").then((n) => n.r));
|
|
122
122
|
async function loadDiscordProviderRuntime() {
|
|
123
|
-
discordProviderRuntimePromise ??= import("./provider.runtime-
|
|
123
|
+
discordProviderRuntimePromise ??= import("./provider.runtime-DVHYE9ZI.js");
|
|
124
124
|
return await discordProviderRuntimePromise;
|
|
125
125
|
}
|
|
126
126
|
async function loadDiscordProbeRuntime() {
|
|
@@ -128,15 +128,15 @@ async function loadDiscordProbeRuntime() {
|
|
|
128
128
|
return await discordProbeRuntimePromise;
|
|
129
129
|
}
|
|
130
130
|
async function loadDiscordAuditModule() {
|
|
131
|
-
discordAuditModulePromise ??= import("./audit-
|
|
131
|
+
discordAuditModulePromise ??= import("./audit-CKzCd_nb.js").then((n) => n.n);
|
|
132
132
|
return await discordAuditModulePromise;
|
|
133
133
|
}
|
|
134
134
|
async function loadDiscordSendModule() {
|
|
135
|
-
discordSendModulePromise ??= import("./send-
|
|
135
|
+
discordSendModulePromise ??= import("./send-DwUf-fzH.js").then((n) => n.t);
|
|
136
136
|
return await discordSendModulePromise;
|
|
137
137
|
}
|
|
138
138
|
async function loadDiscordDirectoryLiveModule() {
|
|
139
|
-
discordDirectoryLiveModulePromise ??= import("./directory-live-
|
|
139
|
+
discordDirectoryLiveModulePromise ??= import("./directory-live-B5E-IbgC.js").then((n) => n.t);
|
|
140
140
|
return await discordDirectoryLiveModulePromise;
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BkL-fm-M.js";
|
|
1
2
|
import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-dXTfmnSZ.js";
|
|
2
|
-
import {
|
|
3
|
-
import { d as readDiscordComponentSpec } from "./components-CjQujWa1.js";
|
|
3
|
+
import { d as readDiscordComponentSpec } from "./components-CWgTTA0J.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";
|
|
@@ -20,9 +20,21 @@ const trustedRequesterGuildAdminActions = new Set([
|
|
|
20
20
|
"category-delete",
|
|
21
21
|
"event-create"
|
|
22
22
|
]);
|
|
23
|
+
const localExecutionActions = new Set([
|
|
24
|
+
"send",
|
|
25
|
+
"upload-file",
|
|
26
|
+
"thread-reply",
|
|
27
|
+
"sticker",
|
|
28
|
+
"emoji-upload",
|
|
29
|
+
"sticker-upload",
|
|
30
|
+
"event-create"
|
|
31
|
+
]);
|
|
32
|
+
function resolveDiscordActionExecutionMode({ action }) {
|
|
33
|
+
return localExecutionActions.has(action) ? "local" : "gateway";
|
|
34
|
+
}
|
|
23
35
|
let discordChannelActionsRuntimePromise;
|
|
24
36
|
async function loadDiscordChannelActionsRuntime() {
|
|
25
|
-
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-
|
|
37
|
+
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-D6awrVWB.js");
|
|
26
38
|
return await discordChannelActionsRuntimePromise;
|
|
27
39
|
}
|
|
28
40
|
function listDiscoverableDiscordAccounts(cfg) {
|
|
@@ -127,7 +139,7 @@ function describeDiscordMessageTool({ cfg, accountId }) {
|
|
|
127
139
|
};
|
|
128
140
|
}
|
|
129
141
|
const discordMessageActions = {
|
|
130
|
-
resolveExecutionMode:
|
|
142
|
+
resolveExecutionMode: resolveDiscordActionExecutionMode,
|
|
131
143
|
describeMessageTool: describeDiscordMessageTool,
|
|
132
144
|
requiresTrustedRequesterSender: ({ action, toolContext }) => normalizeOptionalString(toolContext?.currentChannelProvider)?.toLowerCase() === "discord" && trustedRequesterGuildAdminActions.has(action),
|
|
133
145
|
extractToolSend: ({ args }) => {
|
|
@@ -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-CxFJX9o3.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-CWgTTA0J.js";
|
|
3
|
+
import { t as handleDiscordAction } from "./runtime-Dg0INaGm.js";
|
|
4
|
+
import "./targets-xBATI2q7.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-B39nAL5c.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-C1lzB2Ld.js";
|
|
2
2
|
export { DiscordChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordPlugin } from "./channel-
|
|
1
|
+
import { t as discordPlugin } from "./channel-DnUKVkVn.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -1,29 +1,15 @@
|
|
|
1
|
+
import { n as inspectDiscordConfiguredToken } from "./account-inspect-BkL-fm-M.js";
|
|
1
2
|
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, l as resolveDiscordAccountConfig, m as resolveDiscordToken, o as resolveDefaultDiscordAccountId } from "./accounts-dXTfmnSZ.js";
|
|
2
3
|
import "./channel-api-CAJ0wMoV.js";
|
|
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-
|
|
4
|
+
import { i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-D-ePFtjZ.js";
|
|
5
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-LMOlvXSw.js";
|
|
6
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-WNAKeCd_.js";
|
|
6
7
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
|
-
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createLegacyCompatChannelDmPolicy, createSetupTranslator, createStandardChannelSetupStatus, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptLegacyChannelAllowFromForAccount, resolveEntriesWithOptionalToken, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup-runtime";
|
|
10
10
|
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
11
11
|
import "openclaw/plugin-sdk/account-resolution";
|
|
12
12
|
//#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
13
|
function resolveDefaultDiscordSetupAccountId(cfg) {
|
|
28
14
|
return resolveDefaultDiscordAccountId(cfg);
|
|
29
15
|
}
|
|
@@ -39,7 +25,7 @@ function inspectDiscordSetupAccount(params) {
|
|
|
39
25
|
const enabled = params.cfg.channels?.discord?.enabled !== false && config.enabled !== false;
|
|
40
26
|
const accountConfig = resolveDiscordAccountConfig(params.cfg, accountId);
|
|
41
27
|
const hasAccountToken = Boolean(accountConfig && Object.prototype.hasOwnProperty.call(accountConfig, "token"));
|
|
42
|
-
const accountToken =
|
|
28
|
+
const accountToken = inspectDiscordConfiguredToken(accountConfig?.token);
|
|
43
29
|
if (accountToken) return {
|
|
44
30
|
accountId,
|
|
45
31
|
enabled,
|
|
@@ -58,7 +44,7 @@ function inspectDiscordSetupAccount(params) {
|
|
|
58
44
|
configured: false,
|
|
59
45
|
config
|
|
60
46
|
};
|
|
61
|
-
const channelToken =
|
|
47
|
+
const channelToken = inspectDiscordConfiguredToken(params.cfg.channels?.discord?.token);
|
|
62
48
|
if (channelToken) return {
|
|
63
49
|
accountId,
|
|
64
50
|
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-CxFJX9o3.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";
|
|
@@ -196,7 +196,7 @@ const DiscordChannelConfigSchema = buildChannelConfigSchema(DiscordConfigSchema,
|
|
|
196
196
|
},
|
|
197
197
|
"voice.model": {
|
|
198
198
|
label: "Discord Voice Model",
|
|
199
|
-
help: "Optional LLM model override for Discord voice channel responses and realtime agent consults (for example openai
|
|
199
|
+
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
200
|
},
|
|
201
201
|
"voice.mode": {
|
|
202
202
|
label: "Discord Voice Mode",
|
package/dist/contract-api.js
CHANGED
|
@@ -2,7 +2,7 @@ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doc
|
|
|
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-hhqHJlGr.js";
|
|
6
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-B-i4XzWZ.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,4 +1,4 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget } from "./send.receipt-
|
|
1
|
+
import { Ht as parseDiscordTarget } from "./send.receipt-CxFJX9o3.js";
|
|
2
2
|
import { r as listDiscordAccountIds, s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.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";
|
|
@@ -229,7 +229,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
229
229
|
request,
|
|
230
230
|
configOverride
|
|
231
231
|
}),
|
|
232
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
232
|
+
load: async () => (await import("./approval-handler.runtime-BFLqemq4.js").then((n) => n.t)).discordApprovalNativeRuntime
|
|
233
233
|
})
|
|
234
234
|
});
|
|
235
235
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-CxFJX9o3.js";
|
|
2
2
|
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, o as resolveDefaultDiscordAccountId } from "./accounts-dXTfmnSZ.js";
|
|
3
3
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
@@ -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-B-i4XzWZ.js";
|
|
2
2
|
export { listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-CxFJX9o3.js";
|
|
2
2
|
import { p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
|
|
3
3
|
import { n as fetchDiscord } from "./api-BmXlcjYW.js";
|
|
4
4
|
import { a as normalizeDiscordSlug } from "./allow-list-BnkWtVpA.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BkL-fm-M.js";
|
|
1
2
|
import { o as resolveDefaultDiscordAccountId } from "./accounts-dXTfmnSZ.js";
|
|
2
|
-
import {
|
|
3
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-D3NkInmq.js";
|
|
3
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-D-ePFtjZ.js";
|
|
4
4
|
import { n as normalizeCompatibilityConfig } from "./doctor-contract-8-Ia3d_X.js";
|
|
5
5
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-uUo8hTD5.js";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
package/dist/{handle-action.guild-admin-BmjclQbR.js → handle-action.guild-admin-B39nAL5c.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-Dg0INaGm.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-CFsqnHc4.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,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { MAX_DATE_TIMESTAMP_MS, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
3
4
|
import fs from "node:fs";
|
|
4
5
|
import { normalizeProviderId } from "openclaw/plugin-sdk/provider-model-shared";
|
|
5
6
|
//#region extensions/discord/src/monitor/model-picker-preferences-migrations.ts
|
|
@@ -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");
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, _ as VoiceStateUpdateListener, c as discord_exports, h as ResumedListener, jt as getGuildVoiceState, m as ReadyListener } from "./send.receipt-
|
|
1
|
+
import { Ht as parseDiscordTarget, _ as VoiceStateUpdateListener, c as discord_exports, h as ResumedListener, jt as getGuildVoiceState, m as ReadyListener } from "./send.receipt-CxFJX9o3.js";
|
|
2
2
|
import { c as resolveDiscordAccountAllowFrom } from "./accounts-dXTfmnSZ.js";
|
|
3
3
|
import { a as normalizeDiscordSlug, b as formatDiscordUserTag, m as resolveDiscordOwnerAccess } from "./allow-list-BnkWtVpA.js";
|
|
4
|
-
import { i as formatMention } from "./send.outbound-
|
|
4
|
+
import { i as formatMention } from "./send.outbound-4IJRwYbJ.js";
|
|
5
5
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
6
|
-
import { f as buildDiscordGroupSystemPrompt, o as authorizeDiscordVoiceIngress, u as resolveDiscordVoiceEnabled } from "./provider-
|
|
6
|
+
import { f as buildDiscordGroupSystemPrompt, o as authorizeDiscordVoiceIngress, u as resolveDiscordVoiceEnabled } from "./provider-SeIwaTTJ.js";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import { asBoolean, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|
10
10
|
import path from "node:path";
|
|
11
|
+
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
11
12
|
import { resolveFfmpegBin } from "openclaw/plugin-sdk/media-runtime";
|
|
12
13
|
import { createSubsystemLogger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
13
14
|
import { stripInlineDirectiveTagsForDisplay } from "openclaw/plugin-sdk/text-chunking";
|
|
@@ -1425,17 +1426,21 @@ var DiscordRealtimeVoiceSession = class {
|
|
|
1425
1426
|
logger$2.warn(`discord voice: realtime wake-name follow-up has no speaker context voiceSession=${this.params.entry.voiceSessionKey} agent=${this.params.entry.route.agentId}`);
|
|
1426
1427
|
return;
|
|
1427
1428
|
}
|
|
1429
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(DISCORD_REALTIME_WAKE_NAME_FOLLOWUP_TTL_MS);
|
|
1430
|
+
if (expiresAt === void 0) return;
|
|
1428
1431
|
this.pendingWakeNameFollowup = {
|
|
1429
1432
|
context,
|
|
1430
1433
|
startedAt: turn?.startedAt ?? Date.now(),
|
|
1431
|
-
expiresAt
|
|
1434
|
+
expiresAt
|
|
1432
1435
|
};
|
|
1433
1436
|
logger$2.info(`discord voice: realtime wake-name follow-up armed speaker=${context.speakerLabel} voiceSession=${this.params.entry.voiceSessionKey} agent=${this.params.entry.route.agentId}`);
|
|
1434
1437
|
}
|
|
1435
1438
|
consumePendingWakeNameFollowup() {
|
|
1436
1439
|
const pending = this.pendingWakeNameFollowup;
|
|
1437
1440
|
this.pendingWakeNameFollowup = void 0;
|
|
1438
|
-
|
|
1441
|
+
const now = asDateTimestampMs(Date.now());
|
|
1442
|
+
const expiresAt = pending ? asDateTimestampMs(pending.expiresAt) : void 0;
|
|
1443
|
+
if (!pending || now === void 0 || expiresAt === void 0 || now > expiresAt) return;
|
|
1439
1444
|
const currentTurn = this.peekPendingSpeakerTurn();
|
|
1440
1445
|
if (currentTurn && currentTurn.context.userId !== pending.context.userId) return;
|
|
1441
1446
|
if (currentTurn) this.consumePendingSpeakerContext();
|
|
@@ -1949,7 +1954,9 @@ var DiscordVoiceSpeakerContextResolver = class {
|
|
|
1949
1954
|
const key = this.resolveCacheKey(guildId, userId);
|
|
1950
1955
|
const cached = this.cache.get(key);
|
|
1951
1956
|
if (!cached) return;
|
|
1952
|
-
|
|
1957
|
+
const now = asDateTimestampMs(Date.now());
|
|
1958
|
+
const expiresAt = asDateTimestampMs(cached.expiresAt);
|
|
1959
|
+
if (now === void 0 || expiresAt === void 0 || expiresAt <= now) {
|
|
1953
1960
|
this.cache.delete(key);
|
|
1954
1961
|
return;
|
|
1955
1962
|
}
|
|
@@ -1963,9 +1970,10 @@ var DiscordVoiceSpeakerContextResolver = class {
|
|
|
1963
1970
|
}
|
|
1964
1971
|
setCachedContext(guildId, userId, context) {
|
|
1965
1972
|
const key = this.resolveCacheKey(guildId, userId);
|
|
1966
|
-
|
|
1973
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(SPEAKER_CONTEXT_CACHE_TTL_MS);
|
|
1974
|
+
if (expiresAt !== void 0) this.cache.set(key, {
|
|
1967
1975
|
...context,
|
|
1968
|
-
expiresAt
|
|
1976
|
+
expiresAt
|
|
1969
1977
|
});
|
|
1970
1978
|
}
|
|
1971
1979
|
};
|