@openclaw/discord 2026.5.28-beta.3 → 2026.5.28-beta.4
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/action-runtime-api.js +1 -1
- package/dist/{api-ChQJ1kfZ.js → api-BmXlcjYW.js} +5 -5
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-CIZiiFBd.js → approval-handler.runtime-CN_E7nkQ.js} +3 -3
- package/dist/{audit-D6BXQsYY.js → audit-BFCBp74H.js} +3 -3
- package/dist/{channel--B_psO5e.js → channel-BYmr1mf7.js} +15 -15
- package/dist/{channel-actions-BOH34yJ5.js → channel-actions-BcCh_k4K.js} +2 -2
- package/dist/{channel-actions.runtime-B1RCm1JP.js → channel-actions.runtime-drnbrgpt.js} +5 -5
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-COYdCbY_.js → channel.setup-BsrP5-hv.js} +2 -2
- package/dist/{components-DX5Baphr.js → components-CjQujWa1.js} +27 -26
- package/dist/contract-api.js +2 -2
- package/dist/{conversation-identity-Dugx5WfH.js → conversation-identity-CsPV1Gjx.js} +2 -2
- package/dist/{directory-config-CcjUkNgK.js → directory-config-BqPvRoDv.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-NOtxlJZ3.js → directory-live-CCI0IMZq.js} +2 -2
- package/dist/{handle-action.guild-admin-wC9VaAdl.js → handle-action.guild-admin-BmjclQbR.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/legacy-state-migrations-api.js +99 -0
- package/dist/{manager.runtime-Bwgq6hJW.js → manager.runtime-ClhnLsZf.js} +3 -3
- package/dist/{message-handler-DhqxKFLP.js → message-handler-BnhAHqem.js} +6 -6
- package/dist/{message-handler.preflight-BC8QmsWW.js → message-handler.preflight-B1RTQ6ZO.js} +10 -10
- package/dist/{message-handler.process-DE1an2G4.js → message-handler.process-B1ODKav3.js} +9 -9
- package/dist/{message-utils-BlvuUPP4.js → message-utils-CmB03FoF.js} +1 -1
- package/dist/{outbound-adapter-BGrOFkR8.js → outbound-adapter-DfY2Dtf3.js} +11 -11
- package/dist/{pluralkit-Cq_PUr06.js → pluralkit-DAZN3ZMK.js} +1 -1
- package/dist/{probe-CSBPZIYV.js → probe-BiEg-_i1.js} +1 -1
- package/dist/{probe.runtime-BhWW0223.js → probe.runtime-Dja7CbJT.js} +1 -1
- package/dist/{provider-DIVQuJTw.js → provider-DCcqVFp-.js} +198 -138
- package/dist/{provider-session.runtime-C7jT_K-7.js → provider-session.runtime-mKSG07RE.js} +3 -3
- package/dist/provider.runtime-BmpunJHX.js +2 -0
- package/dist/{resolve-allowlist-common-CzfIcLSO.js → resolve-allowlist-common-DAIbZobr.js} +1 -1
- package/dist/{resolve-channels-CQ13aBCV.js → resolve-channels-D1zgoxnw.js} +3 -3
- package/dist/{resolve-users-Bj4Y4uWR.js → resolve-users-wPAvLk_8.js} +3 -3
- package/dist/{retry-after-CSukypPP.js → retry-after-D5_VmM-_.js} +10 -6
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +19 -19
- package/dist/runtime-api.lookup.js +5 -5
- package/dist/runtime-api.monitor-B38upMUK.js +5 -0
- package/dist/runtime-api.monitor.js +4 -4
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +3 -3
- package/dist/{runtime-DA70ebm-.js → runtime-gaB5-Wsj.js} +7 -7
- package/dist/{send-3r8QQkTY.js → send-CBxhnbKU.js} +3 -3
- package/dist/{send.components-2qRLUwBn.js → send.components-uuQuHL3t.js} +4 -4
- package/dist/{send.outbound-LjX_KYiO.js → send.outbound-DZHJYmNF.js} +3 -3
- package/dist/{send.receipt-Bo_43DQZ.js → send.receipt-3y2lVFRf.js} +4 -6
- package/dist/{send.shared-CXctTF1I.js → send.shared-Ddl21-Gt.js} +4 -5
- package/dist/setup-entry.js +5 -0
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{subagent-hooks-DoWTMQyQ.js → subagent-hooks-BacIbIBD.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-DV85gUxb.js → system-events-Cw6Hp8RF.js} +1 -1
- package/dist/{target-resolver-DVpZI7ZL.js → target-resolver-jjQzAS6T.js} +2 -2
- package/dist/targets-BVKF5wbg.js +3 -0
- package/dist/{thread-bindings-Cm3GqlNC.js → thread-bindings-BBq-yzq2.js} +4 -4
- package/dist/{thread-bindings.discord-api-JrJXT7L0.js → thread-bindings.discord-api-5QgEd_dW.js} +6 -6
- package/dist/{thread-bindings.manager-DqJuGG-r.js → thread-bindings.manager-COkxjwR9.js} +3 -3
- package/dist/{transcripts-source-lEfSvSRD.js → transcripts-source-DDrS8HrV.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-DlT_14RX.js → typing-B7bCMPJJ.js} +1 -1
- package/npm-shrinkwrap.json +3 -3
- package/package.json +7 -4
- package/dist/provider.runtime-BtnupyG-.js +0 -2
- package/dist/runtime-api.monitor-P-emTjcx.js +0 -5
- package/dist/targets-0WHF7kV0.js +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { t as handleDiscordAction } from "./runtime-gaB5-Wsj.js";
|
|
2
2
|
export { handleDiscordAction };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { n as parseRetryAfterHeaderSeconds } from "./retry-after-
|
|
1
|
+
import { n as parseRetryAfterHeaderSeconds, t as parseDiscordRetryAfterBodySeconds } from "./retry-after-D5_VmM-_.js";
|
|
2
|
+
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
2
3
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
3
4
|
import { resolveRetryConfig, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
4
5
|
//#region extensions/discord/src/error-body.ts
|
|
@@ -37,8 +38,7 @@ function parseDiscordApiErrorPayload(text) {
|
|
|
37
38
|
return null;
|
|
38
39
|
}
|
|
39
40
|
function parseRetryAfterSeconds(text, response) {
|
|
40
|
-
const
|
|
41
|
-
const retryAfter = payload && typeof payload.retry_after === "number" && Number.isFinite(payload.retry_after) ? payload.retry_after : void 0;
|
|
41
|
+
const retryAfter = parseDiscordRetryAfterBodySeconds(parseDiscordApiErrorPayload(text)?.retry_after);
|
|
42
42
|
if (retryAfter !== void 0) return retryAfter;
|
|
43
43
|
const header = response.headers.get("Retry-After");
|
|
44
44
|
if (!header) return;
|
|
@@ -62,7 +62,7 @@ function formatDiscordApiErrorText(text, response) {
|
|
|
62
62
|
return summary;
|
|
63
63
|
}
|
|
64
64
|
const message = typeof payload.message === "string" && payload.message.trim() ? payload.message.trim() : "unknown error";
|
|
65
|
-
const retryAfter = formatRetryAfterSeconds(
|
|
65
|
+
const retryAfter = formatRetryAfterSeconds(parseDiscordRetryAfterBodySeconds(payload.retry_after));
|
|
66
66
|
return retryAfter ? `${message} (retry after ${retryAfter})` : message;
|
|
67
67
|
}
|
|
68
68
|
var DiscordApiError = class extends Error {
|
|
@@ -84,7 +84,7 @@ function normalizeDiscordRequestBody(body, headers) {
|
|
|
84
84
|
}
|
|
85
85
|
function resolveDiscordRequestSignal(options) {
|
|
86
86
|
if (options.signal || typeof options.timeoutMs !== "number") return options.signal;
|
|
87
|
-
return AbortSignal.timeout(options.timeoutMs);
|
|
87
|
+
return AbortSignal.timeout(resolveTimerTimeoutMs(options.timeoutMs, 1));
|
|
88
88
|
}
|
|
89
89
|
async function requestDiscord(path, token, options) {
|
|
90
90
|
const fetchImpl = resolveFetch(options?.fetcher ?? fetch);
|
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-3y2lVFRf.js";
|
|
2
2
|
import { a as mergeDiscordAccountConfig, f as resolveDiscordMaxLinesPerMessage, i as listEnabledDiscordAccounts, l as resolveDiscordAccountConfig, o as resolveDefaultDiscordAccountId, r as listDiscordAccountIds, s as resolveDiscordAccount, t as createDiscordActionGate } from "./accounts-dXTfmnSZ.js";
|
|
3
3
|
import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.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-
|
|
5
|
-
import { n as fetchDiscord, r as requestDiscord, t as DiscordApiError } from "./api-
|
|
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
|
|
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";
|
|
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-jjQzAS6T.js";
|
|
7
|
+
import "./targets-BVKF5wbg.js";
|
|
8
|
+
import { a as getDiscordExecApprovalApprovers, c as shouldSuppressLocalDiscordExecApprovalPrompt, o as isDiscordExecApprovalApprover, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-CsPV1Gjx.js";
|
|
9
|
+
import { i as resolveDiscordGroupToolPolicy, n as collectDiscordStatusIssues, r as resolveDiscordGroupRequireMention, t as discordPlugin } from "./channel-BYmr1mf7.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-BsrP5-hv.js";
|
|
12
|
+
import { n as handleDiscordSubagentEnded, r as handleDiscordSubagentSpawning, t as handleDiscordSubagentDeliveryTarget } from "./subagent-hooks-BacIbIBD.js";
|
|
13
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-BmjclQbR.js";
|
|
14
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-BqPvRoDv.js";
|
|
15
|
+
import { t as fetchPluralKitMessageInfo } from "./pluralkit-DAZN3ZMK.js";
|
|
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
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-l_PsHQvX.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-drnbrgpt.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-
|
|
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-3y2lVFRf.js";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.js";
|
|
3
|
-
import { F as createDiscordClient, b as stripUndefinedFields } from "./send.shared-
|
|
4
|
-
import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-
|
|
3
|
+
import { F as createDiscordClient, b as stripUndefinedFields } from "./send.shared-Ddl21-Gt.js";
|
|
4
|
+
import { i as shouldHandleDiscordApprovalRequest, s as isDiscordExecApprovalClientEnabled } from "./conversation-identity-CsPV1Gjx.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-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-3y2lVFRf.js";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.js";
|
|
3
|
-
import { O as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
4
|
-
import "./send-
|
|
3
|
+
import { O as fetchChannelPermissionsDiscord } from "./send.shared-Ddl21-Gt.js";
|
|
4
|
+
import "./send-CBxhnbKU.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,13 +1,13 @@
|
|
|
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-3y2lVFRf.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-CjQujWa1.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-CsPV1Gjx.js";
|
|
7
7
|
import { r as resolveRequiredDiscordChannelPermissions } from "./audit-core-xwjIczO0.js";
|
|
8
|
-
import { t as discordMessageActions$1 } from "./channel-actions-
|
|
8
|
+
import { t as discordMessageActions$1 } from "./channel-actions-BcCh_k4K.js";
|
|
9
9
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-D5gY2ZTE.js";
|
|
10
|
-
import { n as discordOutbound } from "./outbound-adapter-
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-DfY2Dtf3.js";
|
|
11
11
|
import { a as discordSecurityAdapter, i as discordSetupAdapter, n as discordConfigAdapter, t as createDiscordPluginBase } from "./shared-D3NkInmq.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";
|
|
@@ -114,29 +114,29 @@ 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-BqPvRoDv.js").then((n) => n.t));
|
|
118
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-D1zgoxnw.js").then((n) => n.n));
|
|
119
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-wPAvLk_8.js").then((n) => n.n));
|
|
120
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-COkxjwR9.js").then((n) => n.a));
|
|
121
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-jjQzAS6T.js").then((n) => n.r));
|
|
122
122
|
async function loadDiscordProviderRuntime() {
|
|
123
|
-
discordProviderRuntimePromise ??= import("./provider.runtime-
|
|
123
|
+
discordProviderRuntimePromise ??= import("./provider.runtime-BmpunJHX.js");
|
|
124
124
|
return await discordProviderRuntimePromise;
|
|
125
125
|
}
|
|
126
126
|
async function loadDiscordProbeRuntime() {
|
|
127
|
-
discordProbeRuntimePromise ??= import("./probe.runtime-
|
|
127
|
+
discordProbeRuntimePromise ??= import("./probe.runtime-Dja7CbJT.js");
|
|
128
128
|
return await discordProbeRuntimePromise;
|
|
129
129
|
}
|
|
130
130
|
async function loadDiscordAuditModule() {
|
|
131
|
-
discordAuditModulePromise ??= import("./audit-
|
|
131
|
+
discordAuditModulePromise ??= import("./audit-BFCBp74H.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-CBxhnbKU.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-CCI0IMZq.js").then((n) => n.t);
|
|
140
140
|
return await discordDirectoryLiveModulePromise;
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-dXTfmnSZ.js";
|
|
2
2
|
import { t as inspectDiscordAccount } from "./account-inspect-C4sJZNbI.js";
|
|
3
|
-
import { d as readDiscordComponentSpec } from "./components-
|
|
3
|
+
import { d as readDiscordComponentSpec } from "./components-CjQujWa1.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";
|
|
@@ -22,7 +22,7 @@ const trustedRequesterGuildAdminActions = new Set([
|
|
|
22
22
|
]);
|
|
23
23
|
let discordChannelActionsRuntimePromise;
|
|
24
24
|
async function loadDiscordChannelActionsRuntime() {
|
|
25
|
-
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-
|
|
25
|
+
discordChannelActionsRuntimePromise ??= import("./channel-actions.runtime-drnbrgpt.js");
|
|
26
26
|
return await discordChannelActionsRuntimePromise;
|
|
27
27
|
}
|
|
28
28
|
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-3y2lVFRf.js";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, r as buildDiscordInteractiveComponents } from "./components-CjQujWa1.js";
|
|
3
|
+
import { t as handleDiscordAction } from "./runtime-gaB5-Wsj.js";
|
|
4
|
+
import "./targets-BVKF5wbg.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-BmjclQbR.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 discordPlugin } from "./channel
|
|
1
|
+
import { t as discordPlugin } from "./channel-BYmr1mf7.js";
|
|
2
2
|
export { discordPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as mergeDiscordAccountConfig, c as resolveDiscordAccountAllowFrom, l as resolveDiscordAccountConfig, m as resolveDiscordToken, o as resolveDefaultDiscordAccountId } from "./accounts-dXTfmnSZ.js";
|
|
2
2
|
import "./channel-api-CAJ0wMoV.js";
|
|
3
3
|
import { i as discordSetupAdapter, t as createDiscordPluginBase } from "./shared-D3NkInmq.js";
|
|
4
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
5
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
4
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-D1zgoxnw.js";
|
|
5
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-wPAvLk_8.js";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
7
|
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -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-3y2lVFRf.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";
|
|
@@ -462,10 +462,10 @@ function createButtonComponent(params) {
|
|
|
462
462
|
id: componentId,
|
|
463
463
|
kind: params.modalId ? "modal-trigger" : "button",
|
|
464
464
|
label: params.spec.label,
|
|
465
|
-
callbackData: params.spec.callbackData,
|
|
466
|
-
modalId: params.modalId,
|
|
467
|
-
reusable: params.spec.reusable,
|
|
468
|
-
allowedUsers: params.spec.allowedUsers
|
|
465
|
+
...params.spec.callbackData !== void 0 ? { callbackData: params.spec.callbackData } : {},
|
|
466
|
+
...params.modalId !== void 0 ? { modalId: params.modalId } : {},
|
|
467
|
+
...params.spec.reusable !== void 0 ? { reusable: params.spec.reusable } : {},
|
|
468
|
+
...params.spec.allowedUsers !== void 0 ? { allowedUsers: params.spec.allowedUsers } : {}
|
|
469
469
|
}
|
|
470
470
|
};
|
|
471
471
|
}
|
|
@@ -477,10 +477,10 @@ function createSelectComponent(params) {
|
|
|
477
477
|
id: componentId,
|
|
478
478
|
kind: "select",
|
|
479
479
|
label,
|
|
480
|
-
callbackData: params.spec.callbackData,
|
|
480
|
+
...params.spec.callbackData !== void 0 ? { callbackData: params.spec.callbackData } : {},
|
|
481
481
|
selectType,
|
|
482
482
|
...options ? { options } : {},
|
|
483
|
-
allowedUsers: params.spec.allowedUsers
|
|
483
|
+
...params.spec.allowedUsers !== void 0 ? { allowedUsers: params.spec.allowedUsers } : {}
|
|
484
484
|
});
|
|
485
485
|
if (type === "string") {
|
|
486
486
|
const options = params.spec.options ?? [];
|
|
@@ -577,12 +577,13 @@ function buildDiscordComponentMessage(params) {
|
|
|
577
577
|
const components = [];
|
|
578
578
|
const containerChildren = [];
|
|
579
579
|
const addEntry = (entry) => {
|
|
580
|
+
const reusable = entry.reusable ?? params.spec.reusable;
|
|
580
581
|
entries.push({
|
|
581
582
|
...entry,
|
|
582
|
-
sessionKey: params.sessionKey,
|
|
583
|
-
agentId: params.agentId,
|
|
584
|
-
accountId: params.accountId,
|
|
585
|
-
reusable
|
|
583
|
+
...params.sessionKey !== void 0 ? { sessionKey: params.sessionKey } : {},
|
|
584
|
+
...params.agentId !== void 0 ? { agentId: params.agentId } : {},
|
|
585
|
+
...params.accountId !== void 0 ? { accountId: params.accountId } : {},
|
|
586
|
+
...reusable !== void 0 ? { reusable } : {},
|
|
586
587
|
consumptionGroupId
|
|
587
588
|
});
|
|
588
589
|
};
|
|
@@ -645,26 +646,26 @@ function buildDiscordComponentMessage(params) {
|
|
|
645
646
|
name: normalizeModalFieldName(field.name, index),
|
|
646
647
|
label: field.label,
|
|
647
648
|
type: field.type,
|
|
648
|
-
description: field.description,
|
|
649
|
-
placeholder: field.placeholder,
|
|
650
|
-
required: field.required,
|
|
651
|
-
options: field.options,
|
|
652
|
-
minValues: field.minValues,
|
|
653
|
-
maxValues: field.maxValues,
|
|
654
|
-
minLength: field.minLength,
|
|
655
|
-
maxLength: field.maxLength,
|
|
656
|
-
style: field.style
|
|
649
|
+
...field.description !== void 0 ? { description: field.description } : {},
|
|
650
|
+
...field.placeholder !== void 0 ? { placeholder: field.placeholder } : {},
|
|
651
|
+
...field.required !== void 0 ? { required: field.required } : {},
|
|
652
|
+
...field.options !== void 0 ? { options: field.options } : {},
|
|
653
|
+
...field.minValues !== void 0 ? { minValues: field.minValues } : {},
|
|
654
|
+
...field.maxValues !== void 0 ? { maxValues: field.maxValues } : {},
|
|
655
|
+
...field.minLength !== void 0 ? { minLength: field.minLength } : {},
|
|
656
|
+
...field.maxLength !== void 0 ? { maxLength: field.maxLength } : {},
|
|
657
|
+
...field.style !== void 0 ? { style: field.style } : {}
|
|
657
658
|
}));
|
|
658
659
|
modals.push({
|
|
659
660
|
id: modalId,
|
|
660
661
|
title: params.spec.modal.title,
|
|
661
|
-
callbackData: params.spec.modal.callbackData,
|
|
662
662
|
fields,
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
663
|
+
...params.spec.modal.callbackData !== void 0 ? { callbackData: params.spec.modal.callbackData } : {},
|
|
664
|
+
...params.sessionKey !== void 0 ? { sessionKey: params.sessionKey } : {},
|
|
665
|
+
...params.agentId !== void 0 ? { agentId: params.agentId } : {},
|
|
666
|
+
...params.accountId !== void 0 ? { accountId: params.accountId } : {},
|
|
667
|
+
...params.spec.reusable !== void 0 ? { reusable: params.spec.reusable } : {},
|
|
668
|
+
...params.spec.modal.allowedUsers !== void 0 ? { allowedUsers: params.spec.modal.allowedUsers } : {}
|
|
668
669
|
});
|
|
669
670
|
const { component, entry } = createButtonComponent({
|
|
670
671
|
spec: {
|
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-COkxjwR9.js";
|
|
6
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-BqPvRoDv.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-3y2lVFRf.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-CN_E7nkQ.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-3y2lVFRf.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-BqPvRoDv.js";
|
|
2
2
|
export { listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-3y2lVFRf.js";
|
|
2
2
|
import { p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-dXTfmnSZ.js";
|
|
3
|
-
import { n as fetchDiscord } from "./api-
|
|
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";
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
package/dist/{handle-action.guild-admin-wC9VaAdl.js → handle-action.guild-admin-BmjclQbR.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-gaB5-Wsj.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-DDrS8HrV.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
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { normalizeProviderId } from "openclaw/plugin-sdk/provider-model-shared";
|
|
5
|
+
//#region extensions/discord/src/monitor/model-picker-preferences-migrations.ts
|
|
6
|
+
const PREFERENCE_MAX_ENTRIES = 2e3;
|
|
7
|
+
const MAX_PLUGIN_STATE_KEY_BYTES = 512;
|
|
8
|
+
const textEncoder = new TextEncoder();
|
|
9
|
+
function fileExists(filePath) {
|
|
10
|
+
try {
|
|
11
|
+
return fs.statSync(filePath).isFile();
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function readLegacyStore(filePath) {
|
|
17
|
+
try {
|
|
18
|
+
const parsed = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
19
|
+
return parsed && typeof parsed === "object" ? parsed : null;
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function normalizeLegacyPreferenceKey(key) {
|
|
25
|
+
const trimmed = key.trim();
|
|
26
|
+
if (!trimmed || textEncoder.encode(trimmed).length > MAX_PLUGIN_STATE_KEY_BYTES) return;
|
|
27
|
+
return trimmed;
|
|
28
|
+
}
|
|
29
|
+
function normalizeModelRef(raw) {
|
|
30
|
+
const value = raw?.trim();
|
|
31
|
+
if (!value) return null;
|
|
32
|
+
const slashIndex = value.indexOf("/");
|
|
33
|
+
if (slashIndex <= 0 || slashIndex >= value.length - 1) return null;
|
|
34
|
+
const provider = normalizeProviderId(value.slice(0, slashIndex));
|
|
35
|
+
const model = value.slice(slashIndex + 1).trim();
|
|
36
|
+
return provider && model ? `${provider}/${model}` : null;
|
|
37
|
+
}
|
|
38
|
+
function sanitizeRecentModels(models, limit) {
|
|
39
|
+
const deduped = [];
|
|
40
|
+
const seen = /* @__PURE__ */ new Set();
|
|
41
|
+
if (!Array.isArray(models)) return deduped;
|
|
42
|
+
for (const item of models) {
|
|
43
|
+
const normalized = normalizeModelRef(typeof item === "string" ? item : void 0);
|
|
44
|
+
if (!normalized || seen.has(normalized)) continue;
|
|
45
|
+
seen.add(normalized);
|
|
46
|
+
deduped.push(normalized);
|
|
47
|
+
if (deduped.length >= limit) break;
|
|
48
|
+
}
|
|
49
|
+
return deduped;
|
|
50
|
+
}
|
|
51
|
+
function hashSegment(value, length) {
|
|
52
|
+
return createHash("sha256").update(value, "utf8").digest("hex").slice(0, length);
|
|
53
|
+
}
|
|
54
|
+
function buildPreferenceModelKey(scopeKey, modelRef) {
|
|
55
|
+
return `v1:${hashSegment(scopeKey, 32)}:${hashSegment(modelRef, 24)}`;
|
|
56
|
+
}
|
|
57
|
+
function timestampMs(value) {
|
|
58
|
+
const parsed = typeof value === "string" ? Date.parse(value) : NaN;
|
|
59
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
60
|
+
}
|
|
61
|
+
function legacyUpdatedAtForIndex(updatedAt, index, total) {
|
|
62
|
+
return new Date(timestampMs(updatedAt) + Math.max(0, total - index)).toISOString();
|
|
63
|
+
}
|
|
64
|
+
const detectDiscordLegacyStateMigrations = ({ stateDir }) => {
|
|
65
|
+
const sourcePath = path.join(stateDir, "discord", "model-picker-preferences.json");
|
|
66
|
+
if (!fileExists(sourcePath)) return [];
|
|
67
|
+
return [{
|
|
68
|
+
kind: "plugin-state-import",
|
|
69
|
+
label: "Discord model picker preferences",
|
|
70
|
+
sourcePath,
|
|
71
|
+
targetPath: "plugin state:model-picker-preferences",
|
|
72
|
+
pluginId: "discord",
|
|
73
|
+
namespace: "model-picker-preferences",
|
|
74
|
+
maxEntries: PREFERENCE_MAX_ENTRIES,
|
|
75
|
+
scopeKey: "",
|
|
76
|
+
cleanupSource: "rename",
|
|
77
|
+
readEntries: () => {
|
|
78
|
+
const store = readLegacyStore(sourcePath);
|
|
79
|
+
if (!store || !store.entries || typeof store.entries !== "object") return [];
|
|
80
|
+
const out = [];
|
|
81
|
+
for (const [rawKey, rawEntry] of Object.entries(store.entries)) {
|
|
82
|
+
const scopeKey = normalizeLegacyPreferenceKey(rawKey);
|
|
83
|
+
if (!scopeKey || !rawEntry || typeof rawEntry !== "object") continue;
|
|
84
|
+
const recent = sanitizeRecentModels(rawEntry.recent, 10);
|
|
85
|
+
for (const [index, modelRef] of recent.entries()) out.push({
|
|
86
|
+
key: buildPreferenceModelKey(scopeKey, modelRef),
|
|
87
|
+
value: {
|
|
88
|
+
scopeKey,
|
|
89
|
+
modelRef,
|
|
90
|
+
updatedAt: legacyUpdatedAtForIndex(rawEntry.updatedAt, index, recent.length)
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
}];
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
export { detectDiscordLegacyStateMigrations };
|
|
@@ -1,9 +1,9 @@
|
|
|
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-3y2lVFRf.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-DZHJYmNF.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-DCcqVFp-.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";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as createDiscordRestClient } from "./send.shared-
|
|
2
|
-
import { d as resolveDiscordChannelNameSafe, l as resolveDiscordChannelIdSafe, p as resolveDiscordChannelParentSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-
|
|
1
|
+
import { I as createDiscordRestClient } from "./send.shared-Ddl21-Gt.js";
|
|
2
|
+
import { d as resolveDiscordChannelNameSafe, l as resolveDiscordChannelIdSafe, p as resolveDiscordChannelParentSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-5QgEd_dW.js";
|
|
3
3
|
import { a as mergeAbortSignals } from "./timeouts-l_PsHQvX.js";
|
|
4
|
-
import { c as hasDiscordMessageStickers, d as resolveDiscordMessageChannelId, r as resolveDiscordMessageText } from "./message-utils-
|
|
5
|
-
import { t as sendTyping } from "./typing-
|
|
4
|
+
import { c as hasDiscordMessageStickers, d as resolveDiscordMessageChannelId, r as resolveDiscordMessageText } from "./message-utils-CmB03FoF.js";
|
|
5
|
+
import { t as sendTyping } from "./typing-B7bCMPJJ.js";
|
|
6
6
|
import { danger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
7
7
|
import { createChannelRunQueue } from "openclaw/plugin-sdk/channel-outbound";
|
|
8
8
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
@@ -121,7 +121,7 @@ function applyImplicitReplyBatchGate(ctx, replyToMode, isBatched) {
|
|
|
121
121
|
//#region extensions/discord/src/monitor/message-run-queue.ts
|
|
122
122
|
let messageProcessRuntimePromise;
|
|
123
123
|
async function loadMessageProcessRuntime() {
|
|
124
|
-
messageProcessRuntimePromise ??= import("./message-handler.process-
|
|
124
|
+
messageProcessRuntimePromise ??= import("./message-handler.process-B1ODKav3.js");
|
|
125
125
|
return await messageProcessRuntimePromise;
|
|
126
126
|
}
|
|
127
127
|
async function processDiscordQueuedMessage(params) {
|
|
@@ -173,7 +173,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
173
173
|
//#region extensions/discord/src/monitor/message-handler.ts
|
|
174
174
|
let messagePreflightRuntimePromise;
|
|
175
175
|
async function loadMessagePreflightRuntime() {
|
|
176
|
-
messagePreflightRuntimePromise ??= import("./message-handler.preflight-
|
|
176
|
+
messagePreflightRuntimePromise ??= import("./message-handler.preflight-B1RTQ6ZO.js");
|
|
177
177
|
return await messagePreflightRuntimePromise;
|
|
178
178
|
}
|
|
179
179
|
function isNonEmptyString(value) {
|
package/dist/{message-handler.preflight-BC8QmsWW.js → message-handler.preflight-B1RTQ6ZO.js}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as discord_exports, k as Message, mt as getChannelMessage } from "./send.receipt-
|
|
1
|
+
import { c as discord_exports, k as Message, mt as getChannelMessage } from "./send.receipt-3y2lVFRf.js";
|
|
2
2
|
import { o as resolveDefaultDiscordAccountId } from "./accounts-dXTfmnSZ.js";
|
|
3
3
|
import { S as resolveTimestampMs, _ as resolveGroupDmAllow, a as normalizeDiscordSlug, b as formatDiscordUserTag, c as resolveDiscordChannelConfigWithFallback, d as resolveDiscordGuildEntry, f as resolveDiscordMemberAccessState, g as resolveDiscordShouldRequireMention, i as normalizeDiscordDisplaySlug, n as isDiscordGroupAllowedByPolicy, x as resolveDiscordSystemLocation } from "./allow-list-BnkWtVpA.js";
|
|
4
|
-
import { t as resolveDiscordConversationIdentity } from "./conversation-identity-
|
|
4
|
+
import { t as resolveDiscordConversationIdentity } from "./conversation-identity-CsPV1Gjx.js";
|
|
5
5
|
import { l as isRecentlyUnboundThreadWebhookMessage } from "./thread-bindings.state-BsOnj5NX.js";
|
|
6
|
-
import { d as resolveDiscordChannelNameSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-
|
|
7
|
-
import "./thread-bindings-
|
|
8
|
-
import { D as resolveDiscordTextCommandAccess, E as resolveDiscordDmCommandAccess, _ as resolveDiscordEffectiveRoute, g as resolveDiscordConversationRoute, h as buildDiscordRoutePeer, v as shouldIgnoreStaleDiscordRouteBinding, y as handleDiscordDmCommandDecision } from "./provider-
|
|
9
|
-
import { d as resolveDiscordMessageChannelId, l as resolveDiscordMessageStickers, o as resolveMediaList, r as resolveDiscordMessageText, u as resolveDiscordChannelInfo } from "./message-utils-
|
|
6
|
+
import { d as resolveDiscordChannelNameSafe, u as resolveDiscordChannelInfoSafe } from "./thread-bindings.discord-api-5QgEd_dW.js";
|
|
7
|
+
import "./thread-bindings-BBq-yzq2.js";
|
|
8
|
+
import { D as resolveDiscordTextCommandAccess, E as resolveDiscordDmCommandAccess, _ as resolveDiscordEffectiveRoute, g as resolveDiscordConversationRoute, h as buildDiscordRoutePeer, v as shouldIgnoreStaleDiscordRouteBinding, y as handleDiscordDmCommandDecision } from "./provider-DCcqVFp-.js";
|
|
9
|
+
import { d as resolveDiscordMessageChannelId, l as resolveDiscordMessageStickers, o as resolveMediaList, r as resolveDiscordMessageText, u as resolveDiscordChannelInfo } from "./message-utils-CmB03FoF.js";
|
|
10
10
|
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-BFp5w0F8.js";
|
|
11
11
|
import { normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { getChildLogger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -28,7 +28,7 @@ async function loadConversationRuntime$1() {
|
|
|
28
28
|
return await conversationRuntimePromise$1;
|
|
29
29
|
}
|
|
30
30
|
async function loadDiscordSendRuntime() {
|
|
31
|
-
discordSendRuntimePromise ??= import("./send-
|
|
31
|
+
discordSendRuntimePromise ??= import("./send-CBxhnbKU.js").then((n) => n.t);
|
|
32
32
|
return await discordSendRuntimePromise;
|
|
33
33
|
}
|
|
34
34
|
async function resolveDiscordDmPreflightAccess(params) {
|
|
@@ -423,7 +423,7 @@ let preflightAudioRuntimePromise;
|
|
|
423
423
|
let systemEventsRuntimePromise;
|
|
424
424
|
let discordThreadingRuntimePromise;
|
|
425
425
|
async function loadPluralKitRuntime() {
|
|
426
|
-
pluralkitRuntimePromise ??= import("./pluralkit-
|
|
426
|
+
pluralkitRuntimePromise ??= import("./pluralkit-DAZN3ZMK.js").then((n) => n.n);
|
|
427
427
|
return await pluralkitRuntimePromise;
|
|
428
428
|
}
|
|
429
429
|
async function loadPreflightAudioRuntime() {
|
|
@@ -431,11 +431,11 @@ async function loadPreflightAudioRuntime() {
|
|
|
431
431
|
return await preflightAudioRuntimePromise;
|
|
432
432
|
}
|
|
433
433
|
async function loadSystemEventsRuntime() {
|
|
434
|
-
systemEventsRuntimePromise ??= import("./system-events-
|
|
434
|
+
systemEventsRuntimePromise ??= import("./system-events-Cw6Hp8RF.js");
|
|
435
435
|
return await systemEventsRuntimePromise;
|
|
436
436
|
}
|
|
437
437
|
async function loadDiscordThreadingRuntime() {
|
|
438
|
-
discordThreadingRuntimePromise ??= import("./provider-
|
|
438
|
+
discordThreadingRuntimePromise ??= import("./provider-DCcqVFp-.js").then((n) => n.x);
|
|
439
439
|
return await discordThreadingRuntimePromise;
|
|
440
440
|
}
|
|
441
441
|
function isPreflightAborted(abortSignal) {
|