@openclaw/discord 2026.9.8 → 2026.10.1-beta.2
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/README.md +7 -0
- package/dist/.setup/{account-inspect-De8hOUxG.mjs → account-inspect-CjKqkDnH.mjs} +2 -2
- package/dist/.setup/{accounts-ChaMcixG.mjs → accounts-DXHCL8Zm.mjs} +9 -32
- package/dist/.setup/{active-turn-thread-route-fmHl1HNd.mjs → active-turn-thread-route-C4tp9noA.mjs} +5 -9
- package/dist/.setup/{activities-api-tvbsU2e3.mjs → activities-api-BL_hJ0JQ.mjs} +15 -18
- package/dist/.setup/{api-DVbJwZVt.mjs → api-_oznjffB.mjs} +1 -1
- package/dist/.setup/{approval-handler.runtime-DxCK2Rux.mjs → approval-handler.runtime-BilYSrRF.mjs} +22 -61
- package/dist/.setup/{approval-message-updates-BKFqavHZ.mjs → approval-message-updates-CgRwc2_Q.mjs} +2 -2
- package/dist/.setup/{audit-CLg9I71N.mjs → audit-DtvzxONM.mjs} +4 -4
- package/dist/.setup/{channel-access-C12aDZ0p.mjs → channel-access-BRp3Y-rF.mjs} +4 -17
- package/dist/.setup/{channel-type-DRCrEMss.mjs → channel-type-D1_b5UhU.mjs} +12 -16
- package/dist/.setup/{channel-DxlUVU9t.mjs → channel-z5lQMS_9.mjs} +79 -75
- package/dist/.setup/{channel.setup-CRo1GjV7.mjs → channel.setup-DBJtugJO.mjs} +14 -34
- package/dist/.setup/{components-Cq1PvIpN.mjs → components-CzXLR3QH.mjs} +56 -72
- package/dist/.setup/{config-schema-oxELUSDx.mjs → config-schema-CsemBDpS.mjs} +6 -17
- package/dist/.setup/{conversation-binding-route-Caz_XuFH.mjs → conversation-binding-route-Bi62ApSt.mjs} +1 -1
- package/dist/.setup/{directory-config-esqNn0Eo.mjs → directory-config-BH1LA-gi.mjs} +1 -1
- package/dist/.setup/{directory-live-DtKRHuGV.mjs → directory-live-C9xz7IPm.mjs} +10 -13
- package/dist/.setup/{discord-0xJYfdDD.mjs → discord-J7aRzq2Q.mjs} +101 -381
- package/dist/.setup/{doctor-BCl1H5tl.mjs → doctor-DxSAngJq.mjs} +31 -70
- package/dist/.setup/doctor-contract-Bg3NPAMw.mjs +137 -0
- package/dist/.setup/{handle-action-CUvQWnE7.mjs → handle-action-DlmFX-_G.mjs} +10 -11
- package/dist/.setup/{handle-action.guild-admin-Df-8gVle.mjs → handle-action.guild-admin-BnyqTczR.mjs} +67 -129
- package/dist/.setup/{live-policy-config-8Pv20CHc.mjs → live-policy-config-emmPNyh4.mjs} +1 -1
- package/dist/.setup/{message-handler-B-Jk4oDk.mjs → message-handler-BNToPZrx.mjs} +7 -6
- package/dist/.setup/{message-handler.preflight-v-__NSDq.mjs → message-handler.preflight-D0BcCyI7.mjs} +13 -23
- package/dist/.setup/{message-handler.preflight-pluralkit-CWLUBVcx.mjs → message-handler.preflight-pluralkit-D1g3eq0B.mjs} +5 -8
- package/dist/.setup/{message-handler.process-BNFFuChn.mjs → message-handler.process-CThRmCWK.mjs} +57 -96
- package/dist/.setup/{outbound-adapter-BobT-kse.mjs → outbound-adapter-BPq0c2wY.mjs} +11 -17
- package/dist/.setup/{outbound-session-route-zVGxxceg.mjs → outbound-session-route-DGPPKA0z.mjs} +21 -46
- package/dist/.setup/{presence-cache-Di3H3DIU.mjs → presence-cache-Dg3_dADn.mjs} +2 -4
- package/dist/.setup/{probe-LYrIHlBF.mjs → probe-DIRY8vh7.mjs} +17 -27
- package/dist/.setup/{provider-B_G5hASF.mjs → provider-D2OKMo0f.mjs} +273 -446
- package/dist/.setup/{provider-session.runtime-BYlTBFD2.mjs → provider-session.runtime-BupCTZQv.mjs} +3 -3
- package/dist/.setup/provider.runtime-BaW_JnfU.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-oUd9DOcz.mjs → realtime-session.runtime-D5RSC8Mm.mjs} +6 -8
- package/dist/.setup/{receive-recovery-CHPOsnLc.mjs → receive-recovery-GqF2PUN_.mjs} +1 -4
- package/dist/.setup/{resolve-allowlist-common-DPdRggu5.mjs → resolve-allowlist-common-DUYRrrVB.mjs} +5 -9
- package/dist/.setup/{resolve-channels-BFPNRmVv.mjs → resolve-channels--MUatisx.mjs} +3 -3
- package/dist/.setup/{resolve-users-0-aBuCy3.mjs → resolve-users-CxLcDmM0.mjs} +6 -9
- package/dist/.setup/{retry-pz_cSha2.mjs → retry-BKzO25k4.mjs} +27 -51
- package/dist/.setup/{runtime-sUksZ--Q.mjs → runtime-CerRBfaa.mjs} +2 -2
- package/dist/.setup/{runtime-FN000lxA.mjs → runtime-CwUA0RLr.mjs} +228 -255
- package/dist/.setup/{runtime-doctor-migrations-CshUGl36.mjs → runtime-doctor-migrations-BPV-R4G9.mjs} +6 -0
- package/dist/.setup/{security-audit-Cdaegq7C.mjs → security-audit-D42cp5N7.mjs} +21 -48
- package/dist/.setup/{send-CrfEI6Bs.mjs → send-2X7m2Zmw.mjs} +45 -58
- package/dist/.setup/{send.components-DxQAMfES.mjs → send.components-RqvgmCs3.mjs} +44 -90
- package/dist/.setup/{send.outbound-BISKnb-a.mjs → send.outbound-B4QHSEzm.mjs} +60 -98
- package/dist/.setup/{send.shared-DGFkbkQR.mjs → send.shared-BQIUh6Vn.mjs} +13 -20
- package/dist/.setup/{sender-identity-B9X5Vb9R.mjs → sender-identity-CooeYfAn.mjs} +1 -1
- package/dist/.setup/{session-key-normalization-wJgsKPNF.mjs → session-key-normalization-CCHGNSQw.mjs} +3 -9
- package/dist/.setup/setup-plugin-api-nn_giXvZ.mjs +3 -0
- package/dist/.setup/{shared-B3wZ4hN-.mjs → shared-CIJn6AEC.mjs} +7 -7
- package/dist/.setup/{subagent-hooks-nlUE9ow7.mjs → subagent-hooks-BYlVnxzy.mjs} +4 -9
- package/dist/.setup/{system-events-CdeZnvPV.mjs → system-events-CQ3if_pS.mjs} +2 -2
- package/dist/.setup/{target-resolver-BuLapkhy.mjs → target-resolver-Dzxf80Y3.mjs} +5 -13
- package/dist/.setup/targets-Lf8D55w-.mjs +3 -0
- package/dist/.setup/{thread-bindings-D7TfgjR_.mjs → thread-bindings-yNNlcUWE.mjs} +5 -6
- package/dist/.setup/{thread-bindings.manager-DN-NissX.mjs → thread-bindings.manager-plk0zJAW.mjs} +14 -20
- package/dist/.setup/{thread-bindings.session-updates-CshfKghV.mjs → thread-bindings.session-updates-C9aKtVs6.mjs} +295 -5
- package/dist/.setup/{timeouts-D86uWLt_.mjs → timeouts-pun7VJ02.mjs} +2 -15
- package/dist/.setup/{transcripts-source-p8EV179h.mjs → transcripts-source-CNWswry-.mjs} +31 -79
- package/dist/.setup/typing-CNlSKY5S.mjs +11 -0
- package/dist/.setup/{voice-runtime-B46rcwrG.mjs → voice-runtime-Bc75quiH.mjs} +62 -110
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +1 -1
- package/dist/api.js +18 -18
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/control-ui/2afbdab1d3aa65a789d8a3eba666f4b1ec5df07073538fe30d6cf32093a1fb2d/index.js +1 -0
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +19 -128
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +20 -21
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +6 -8
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/libopus-wasm/CHANGELOG.md +8 -0
- package/node_modules/libopus-wasm/dist/discordjs.d.ts.map +1 -1
- package/node_modules/libopus-wasm/dist/discordjs.js +14 -2
- package/node_modules/libopus-wasm/dist/generated/libopus.generated.mjs +0 -0
- package/node_modules/libopus-wasm/dist/index.d.ts.map +1 -1
- package/node_modules/libopus-wasm/dist/index.js +55 -100
- package/node_modules/libopus-wasm/package.json +5 -5
- package/node_modules/undici/README.md +10 -1
- package/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
- package/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/undici/docs/docs/api/Fetch.md +10 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/undici/docs/docs/index.md +10 -1
- package/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/undici/lib/dispatcher/client.js +6 -1
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/undici/lib/web/fetch/index.js +46 -25
- package/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/undici/lib/web/websocket/connection.js +33 -12
- package/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/undici/lib/web/websocket/receiver.js +2 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
- package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/diagnostics-channel.d.ts +2 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/webidl.d.ts +13 -7
- package/openclaw.plugin.json +6 -0
- package/package.json +12 -7
- package/dist/.setup/doctor-contract-CvvgwrrG.mjs +0 -409
- package/dist/.setup/model-picker-preference-primitives-BHT1LkR_.mjs +0 -37
- package/dist/.setup/provider.runtime-CUE3UxER.mjs +0 -2
- package/dist/.setup/setup-plugin-api-BQUBxbhe.mjs +0 -3
- package/dist/.setup/targets-0KUcEIYx.mjs +0 -3
- package/dist/.setup/thread-bindings.state-g6v9zAym.mjs +0 -331
- package/dist/.setup/typing-BiHCzBRu.mjs +0 -15
|
@@ -1,71 +1,39 @@
|
|
|
1
|
-
import { s as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
3
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
4
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
5
|
-
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-
|
|
6
|
-
import { n as normalizeCompatibilityConfig } from "./doctor-contract-
|
|
1
|
+
import { s as resolveDefaultDiscordAccountId } from "./accounts-DXHCL8Zm.mjs";
|
|
2
|
+
import { n as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-CNWswry-.mjs";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-CjKqkDnH.mjs";
|
|
4
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-CIJn6AEC.mjs";
|
|
5
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BPV-R4G9.mjs";
|
|
6
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Bg3NPAMw.mjs";
|
|
7
7
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.mjs";
|
|
8
|
-
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
9
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
+
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
10
10
|
//#region extensions/discord/src/doctor.ts
|
|
11
11
|
function sanitizeForLog(value) {
|
|
12
12
|
return value.replace(/\p{Cc}+/gu, " ").trim();
|
|
13
13
|
}
|
|
14
14
|
function collectDiscordIdLists(prefix, account, userAllowlistsOnly = false) {
|
|
15
|
-
const refs = [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (dm) {
|
|
22
|
-
refs.push({
|
|
23
|
-
pathLabel: `${prefix}.dm.allowFrom`,
|
|
24
|
-
holder: dm,
|
|
25
|
-
key: "allowFrom"
|
|
26
|
-
});
|
|
27
|
-
if (!userAllowlistsOnly) refs.push({
|
|
28
|
-
pathLabel: `${prefix}.dm.groupChannels`,
|
|
29
|
-
holder: dm,
|
|
30
|
-
key: "groupChannels"
|
|
15
|
+
const refs = [];
|
|
16
|
+
const addLists = (holder, path, keys) => {
|
|
17
|
+
for (const key of keys) refs.push({
|
|
18
|
+
pathLabel: `${path}.${key}`,
|
|
19
|
+
holder,
|
|
20
|
+
key
|
|
31
21
|
});
|
|
32
|
-
}
|
|
22
|
+
};
|
|
23
|
+
addLists(account, prefix, ["allowFrom"]);
|
|
24
|
+
const dm = (0, runtime_doctor_migrations_exports.asObjectRecord)(account.dm);
|
|
25
|
+
if (dm) addLists(dm, `${prefix}.dm`, userAllowlistsOnly ? ["allowFrom"] : ["allowFrom", "groupChannels"]);
|
|
33
26
|
const execApprovals = (0, runtime_doctor_migrations_exports.asObjectRecord)(account.execApprovals);
|
|
34
|
-
if (execApprovals && !userAllowlistsOnly)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
const guilds = (0, runtime_doctor_migrations_exports.asObjectRecord)(account.guilds);
|
|
40
|
-
if (!guilds) return refs;
|
|
41
|
-
for (const guildId of Object.keys(guilds)) {
|
|
42
|
-
const guild = (0, runtime_doctor_migrations_exports.asObjectRecord)(guilds[guildId]);
|
|
27
|
+
if (execApprovals && !userAllowlistsOnly) addLists(execApprovals, `${prefix}.execApprovals`, ["approvers"]);
|
|
28
|
+
const memberKeys = userAllowlistsOnly ? ["users"] : ["users", "roles"];
|
|
29
|
+
for (const [guildId, guildValue] of Object.entries((0, runtime_doctor_migrations_exports.asObjectRecord)(account.guilds) ?? {})) {
|
|
30
|
+
const guild = (0, runtime_doctor_migrations_exports.asObjectRecord)(guildValue);
|
|
43
31
|
if (!guild) continue;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!userAllowlistsOnly) refs.push({
|
|
50
|
-
pathLabel: `${prefix}.guilds.${guildId}.roles`,
|
|
51
|
-
holder: guild,
|
|
52
|
-
key: "roles"
|
|
53
|
-
});
|
|
54
|
-
const channels = (0, runtime_doctor_migrations_exports.asObjectRecord)(guild.channels);
|
|
55
|
-
if (!channels) continue;
|
|
56
|
-
for (const channelId of Object.keys(channels)) {
|
|
57
|
-
const channel = (0, runtime_doctor_migrations_exports.asObjectRecord)(channels[channelId]);
|
|
58
|
-
if (!channel) continue;
|
|
59
|
-
refs.push({
|
|
60
|
-
pathLabel: `${prefix}.guilds.${guildId}.channels.${channelId}.users`,
|
|
61
|
-
holder: channel,
|
|
62
|
-
key: "users"
|
|
63
|
-
});
|
|
64
|
-
if (!userAllowlistsOnly) refs.push({
|
|
65
|
-
pathLabel: `${prefix}.guilds.${guildId}.channels.${channelId}.roles`,
|
|
66
|
-
holder: channel,
|
|
67
|
-
key: "roles"
|
|
68
|
-
});
|
|
32
|
+
const guildPath = `${prefix}.guilds.${guildId}`;
|
|
33
|
+
addLists(guild, guildPath, memberKeys);
|
|
34
|
+
for (const [channelId, channelValue] of Object.entries((0, runtime_doctor_migrations_exports.asObjectRecord)(guild.channels) ?? {})) {
|
|
35
|
+
const channel = (0, runtime_doctor_migrations_exports.asObjectRecord)(channelValue);
|
|
36
|
+
if (channel) addLists(channel, `${guildPath}.channels.${channelId}`, memberKeys);
|
|
69
37
|
}
|
|
70
38
|
}
|
|
71
39
|
return refs;
|
|
@@ -91,17 +59,10 @@ function scanDiscordNumericIdEntries(cfg) {
|
|
|
91
59
|
}
|
|
92
60
|
function collectDiscordNumericIdWarnings(params) {
|
|
93
61
|
if (params.hits.length === 0) return [];
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (existing) existing.push(hit);
|
|
99
|
-
else hitsByListPath.set(listPath, [hit]);
|
|
100
|
-
}
|
|
101
|
-
const repairableHits = [];
|
|
102
|
-
const blockedHits = [];
|
|
103
|
-
for (const hits of hitsByListPath.values()) if (hits.some((hit) => !hit.safe)) blockedHits.push(...hits);
|
|
104
|
-
else repairableHits.push(...hits);
|
|
62
|
+
const listPath = (hit) => hit.path.replace(/\[\d+\]$/, "");
|
|
63
|
+
const blockedPaths = new Set(params.hits.filter((hit) => !hit.safe).map(listPath));
|
|
64
|
+
const repairableHits = params.hits.filter((hit) => !blockedPaths.has(listPath(hit)));
|
|
65
|
+
const blockedHits = params.hits.filter((hit) => blockedPaths.has(listPath(hit)));
|
|
105
66
|
const lines = [];
|
|
106
67
|
if (repairableHits.length > 0) {
|
|
107
68
|
const sample = expectDefined(repairableHits.at(0), "non-empty repairable Discord ID hits");
|
|
@@ -209,7 +170,7 @@ function collectDiscordMutableAllowlistWarnings(cfg) {
|
|
|
209
170
|
`- Found ${hits.length} mutable allowlist ${hits.length === 1 ? "entry" : "entries"} across discord while name matching is disabled by default.`,
|
|
210
171
|
...exampleLines,
|
|
211
172
|
...remaining ? [remaining] : [],
|
|
212
|
-
`- Option A (break-glass): enable channels.discord.
|
|
173
|
+
`- Option A (break-glass): enable channels.discord.dangerouslyAllowNameMatching=true for the affected scope.`,
|
|
213
174
|
`- Option B (recommended): resolve names to stable Discord IDs and rewrite the allowlist entries.`
|
|
214
175
|
];
|
|
215
176
|
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { t as runtime_doctor_migrations_exports } from "./runtime-doctor-migrations-BPV-R4G9.mjs";
|
|
2
|
+
import { isSupportedRealtimeVoiceActivationName, normalizeRealtimeVoiceActivationNamePrefix } from "openclaw/plugin-sdk/realtime-voice-activation";
|
|
3
|
+
//#region extensions/discord/src/doctor-contract.ts
|
|
4
|
+
const RETIRED_TUNING_KEYS = /* @__PURE__ */ new Set([
|
|
5
|
+
"gatewayInfoTimeoutMs",
|
|
6
|
+
"gatewayReadyTimeoutMs",
|
|
7
|
+
"gatewayRuntimeReadyTimeoutMs",
|
|
8
|
+
"eventQueue",
|
|
9
|
+
"retry"
|
|
10
|
+
]);
|
|
11
|
+
const streamingAliasMigration = (0, runtime_doctor_migrations_exports.defineChannelAliasMigration)({
|
|
12
|
+
channelId: "discord",
|
|
13
|
+
streaming: {
|
|
14
|
+
defaultMode: "off",
|
|
15
|
+
includePreviewChunk: true
|
|
16
|
+
},
|
|
17
|
+
accountStreamingReplacesRoot: true,
|
|
18
|
+
dm: {
|
|
19
|
+
root: true,
|
|
20
|
+
accounts: true
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function hasUnsupportedRealtimeWakeNamesInVoice(value) {
|
|
24
|
+
const voice = (0, runtime_doctor_migrations_exports.asObjectRecord)(value);
|
|
25
|
+
const wakeNames = (0, runtime_doctor_migrations_exports.asObjectRecord)(voice?.realtime)?.wakeNames;
|
|
26
|
+
return Array.isArray(wakeNames) ? wakeNames.length === 0 || wakeNames.some((wakeName) => typeof wakeName === "string" && !isSupportedRealtimeVoiceActivationName(wakeName)) : false;
|
|
27
|
+
}
|
|
28
|
+
function hasUnsupportedDiscordRealtimeWakeNames(value) {
|
|
29
|
+
return hasUnsupportedRealtimeWakeNamesInVoice((0, runtime_doctor_migrations_exports.asObjectRecord)(value)?.voice);
|
|
30
|
+
}
|
|
31
|
+
function normalizeUnsupportedRealtimeWakeNames(entry, pathPrefix, changes) {
|
|
32
|
+
const voice = (0, runtime_doctor_migrations_exports.asObjectRecord)(entry.voice);
|
|
33
|
+
const realtime = (0, runtime_doctor_migrations_exports.asObjectRecord)(voice?.realtime);
|
|
34
|
+
const wakeNames = realtime?.wakeNames;
|
|
35
|
+
if (!voice || !realtime || !Array.isArray(wakeNames)) return {
|
|
36
|
+
entry,
|
|
37
|
+
changed: false
|
|
38
|
+
};
|
|
39
|
+
let normalized = 0;
|
|
40
|
+
let removed = 0;
|
|
41
|
+
const nextWakeNames = wakeNames.flatMap((wakeName) => {
|
|
42
|
+
if (typeof wakeName !== "string" || isSupportedRealtimeVoiceActivationName(wakeName)) return [wakeName];
|
|
43
|
+
const nextWakeName = normalizeRealtimeVoiceActivationNamePrefix(wakeName);
|
|
44
|
+
if (!nextWakeName) {
|
|
45
|
+
removed += 1;
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
normalized += 1;
|
|
49
|
+
return [nextWakeName];
|
|
50
|
+
});
|
|
51
|
+
if (wakeNames.length > 0 && normalized === 0 && removed === 0) return {
|
|
52
|
+
entry,
|
|
53
|
+
changed: false
|
|
54
|
+
};
|
|
55
|
+
const dedupedWakeNames = Array.from(new Set(nextWakeNames));
|
|
56
|
+
if (wakeNames.length === 0) changes.push(`Removed empty ${pathPrefix}.voice.realtime.wakeNames; unset wake names use the default agent/OpenClaw fallback.`);
|
|
57
|
+
const nextRealtime = { ...realtime };
|
|
58
|
+
if (dedupedWakeNames.length > 0) nextRealtime.wakeNames = dedupedWakeNames;
|
|
59
|
+
else delete nextRealtime.wakeNames;
|
|
60
|
+
if (normalized > 0) changes.push(`Shortened ${normalized} unsupported ${pathPrefix}.voice.realtime.wakeNames entries to one or two words.`);
|
|
61
|
+
if (removed > 0) changes.push(`Removed ${removed} unsupported ${pathPrefix}.voice.realtime.wakeNames entries with no usable words.`);
|
|
62
|
+
return {
|
|
63
|
+
entry: {
|
|
64
|
+
...entry,
|
|
65
|
+
voice: {
|
|
66
|
+
...voice,
|
|
67
|
+
realtime: nextRealtime
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
changed: true
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const legacyConfigRules = [
|
|
74
|
+
{
|
|
75
|
+
path: ["channels", "discord"],
|
|
76
|
+
message: "channels.discord.voice.realtime.wakeNames entries longer than two words are unsupported; use one- or two-word activation names. Run \"openclaw doctor --fix\".",
|
|
77
|
+
match: hasUnsupportedDiscordRealtimeWakeNames
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
path: [
|
|
81
|
+
"channels",
|
|
82
|
+
"discord",
|
|
83
|
+
"accounts"
|
|
84
|
+
],
|
|
85
|
+
message: "channels.discord.accounts.<id>.voice.realtime.wakeNames entries longer than two words are unsupported; use one- or two-word activation names. Run \"openclaw doctor --fix\".",
|
|
86
|
+
match: (value) => (0, runtime_doctor_migrations_exports.hasLegacyAccountStreamingAliases)(value, hasUnsupportedDiscordRealtimeWakeNames)
|
|
87
|
+
},
|
|
88
|
+
...streamingAliasMigration.legacyConfigRules
|
|
89
|
+
];
|
|
90
|
+
function normalizeCompatibilityConfig({ cfg }) {
|
|
91
|
+
const changes = [];
|
|
92
|
+
const aliases = streamingAliasMigration.normalizeChannelConfig({
|
|
93
|
+
cfg,
|
|
94
|
+
changes
|
|
95
|
+
});
|
|
96
|
+
const tuningKnobs = (0, runtime_doctor_migrations_exports.stripRetiredChannelKeys)({
|
|
97
|
+
cfg: aliases.config,
|
|
98
|
+
channelId: "discord",
|
|
99
|
+
keys: RETIRED_TUNING_KEYS,
|
|
100
|
+
scope: "root-and-accounts"
|
|
101
|
+
});
|
|
102
|
+
const rawEntry = (0, runtime_doctor_migrations_exports.asObjectRecord)(tuningKnobs.config.channels?.discord);
|
|
103
|
+
if (!rawEntry) return {
|
|
104
|
+
config: cfg,
|
|
105
|
+
changes: []
|
|
106
|
+
};
|
|
107
|
+
let updated = rawEntry;
|
|
108
|
+
let changed = tuningKnobs.config !== cfg;
|
|
109
|
+
if (tuningKnobs.changed) changes.push("Removed retired Discord tuning knobs.");
|
|
110
|
+
const accounts = (0, runtime_doctor_migrations_exports.normalizeChannelAccounts)({
|
|
111
|
+
entry: updated,
|
|
112
|
+
pathPrefix: "channels.discord",
|
|
113
|
+
changes,
|
|
114
|
+
normalizeAccount: ({ account, pathPrefix, changes: accountChanges }) => normalizeUnsupportedRealtimeWakeNames(account, pathPrefix, accountChanges)
|
|
115
|
+
});
|
|
116
|
+
updated = accounts.entry;
|
|
117
|
+
changed = changed || accounts.changed;
|
|
118
|
+
const normalizedWakeNames = normalizeUnsupportedRealtimeWakeNames(updated, "channels.discord", changes);
|
|
119
|
+
updated = normalizedWakeNames.entry;
|
|
120
|
+
changed = changed || normalizedWakeNames.changed;
|
|
121
|
+
if (!changed) return {
|
|
122
|
+
config: cfg,
|
|
123
|
+
changes: []
|
|
124
|
+
};
|
|
125
|
+
return {
|
|
126
|
+
config: {
|
|
127
|
+
...tuningKnobs.config,
|
|
128
|
+
channels: {
|
|
129
|
+
...tuningKnobs.config.channels,
|
|
130
|
+
discord: updated
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
changes
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
export { normalizeCompatibilityConfig as n, legacyConfigRules as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-
|
|
2
|
-
import { C as withDiscordRequestAuthority } from "./discord-
|
|
3
|
-
import { _ as matchesDiscordToolContextTarget, b as parseDiscordTarget, x as resolveDiscordChannelId } from "./retry-
|
|
4
|
-
import "./targets-
|
|
5
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-CzXLR3QH.mjs";
|
|
2
|
+
import { C as withDiscordRequestAuthority } from "./discord-J7aRzq2Q.mjs";
|
|
3
|
+
import { _ as matchesDiscordToolContextTarget, b as parseDiscordTarget, x as resolveDiscordChannelId } from "./retry-BKzO25k4.mjs";
|
|
4
|
+
import "./targets-Lf8D55w-.mjs";
|
|
5
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-CwUA0RLr.mjs";
|
|
6
6
|
import "../action-runtime-api.js";
|
|
7
|
-
import { b as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-
|
|
8
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
9
|
-
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-
|
|
7
|
+
import { b as discordInboundEventDelivery, i as isDiscordComponentSpecWithinMessageLimit, n as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-session-route-DGPPKA0z.mjs";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-BnyqTczR.mjs";
|
|
9
|
+
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-C4tp9noA.mjs";
|
|
10
10
|
import { asOptionalRecord, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
11
|
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
12
12
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
@@ -55,9 +55,8 @@ async function dispatchDiscordMessageAction(ctx) {
|
|
|
55
55
|
...ctx.progressSnapshot ? { progressSnapshot: ctx.progressSnapshot } : {},
|
|
56
56
|
...readPolicyOptions
|
|
57
57
|
};
|
|
58
|
-
const runAction = (
|
|
59
|
-
|
|
60
|
-
accountId: accountId ?? void 0,
|
|
58
|
+
const runAction = (payload) => handleDiscordAction({
|
|
59
|
+
accountId,
|
|
61
60
|
...payload
|
|
62
61
|
}, cfg, actionOptions);
|
|
63
62
|
const notifyVisibleOutbound = (result, to, fallbackSessionKey) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-CwUA0RLr.mjs";
|
|
2
2
|
import "../action-runtime-api.js";
|
|
3
|
-
import { y as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-
|
|
3
|
+
import { y as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-DGPPKA0z.mjs";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
6
6
|
import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/param-readers";
|
|
@@ -63,94 +63,62 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
63
63
|
const { action, params: actionParams, cfg } = ctx;
|
|
64
64
|
const accountId = ctx.accountId ?? readStringParam(actionParams, "accountId");
|
|
65
65
|
const senderUserId = readDiscordRequesterSenderId(ctx);
|
|
66
|
+
const runAction = (runtimeAction, values, options) => handleDiscordAction({
|
|
67
|
+
action: runtimeAction,
|
|
68
|
+
accountId: accountId ?? void 0,
|
|
69
|
+
...values
|
|
70
|
+
}, cfg, options);
|
|
66
71
|
const metadataRead = guildMetadataReads[action];
|
|
67
72
|
if (metadataRead) {
|
|
68
73
|
const values = Object.fromEntries(metadataRead.requiredParams.map((key) => [key, readStringParam(actionParams, key, { required: true })]));
|
|
69
|
-
return await
|
|
70
|
-
action: metadataRead.action,
|
|
71
|
-
accountId: accountId ?? void 0,
|
|
72
|
-
...values
|
|
73
|
-
}, cfg, readPolicyOptions);
|
|
74
|
+
return await runAction(metadataRead.action, values, readPolicyOptions);
|
|
74
75
|
}
|
|
75
76
|
if (action === "emoji-list") {
|
|
76
77
|
const guildId = readStringParam(actionParams, "guildId");
|
|
77
78
|
const limit = readPositiveIntegerParam(actionParams, "limit");
|
|
78
|
-
return await
|
|
79
|
-
action: "emojiList",
|
|
80
|
-
accountId: accountId ?? void 0,
|
|
79
|
+
return await runAction("emojiList", {
|
|
81
80
|
...guildId ? { guildId } : { channelId: resolveChannelId() },
|
|
82
81
|
...limit ? { limit } : {}
|
|
83
|
-
},
|
|
82
|
+
}, readPolicyOptions);
|
|
84
83
|
}
|
|
85
|
-
if (action === "emoji-upload") {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
if (action === "emoji-upload") return await runAction("emojiUpload", {
|
|
85
|
+
guildId: readStringParam(actionParams, "guildId", { required: true }),
|
|
86
|
+
name: readStringParam(actionParams, "emojiName", { required: true }),
|
|
87
|
+
mediaUrl: readStringParam(actionParams, "media", {
|
|
89
88
|
required: true,
|
|
90
89
|
trim: false
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}, cfg, actionOptions);
|
|
102
|
-
}
|
|
103
|
-
if (action === "sticker-upload") {
|
|
104
|
-
const guildId = readStringParam(actionParams, "guildId", { required: true });
|
|
105
|
-
const name = readStringParam(actionParams, "stickerName", { required: true });
|
|
106
|
-
const description = readStringParam(actionParams, "stickerDesc", { required: true });
|
|
107
|
-
const tags = readStringParam(actionParams, "stickerTags", { required: true });
|
|
108
|
-
const mediaUrl = readStringParam(actionParams, "media", {
|
|
90
|
+
}),
|
|
91
|
+
roleIds: readStringArrayParam(actionParams, "roleIds"),
|
|
92
|
+
...senderParam(senderUserId)
|
|
93
|
+
}, actionOptions);
|
|
94
|
+
if (action === "sticker-upload") return await runAction("stickerUpload", {
|
|
95
|
+
guildId: readStringParam(actionParams, "guildId", { required: true }),
|
|
96
|
+
name: readStringParam(actionParams, "stickerName", { required: true }),
|
|
97
|
+
description: readStringParam(actionParams, "stickerDesc", { required: true }),
|
|
98
|
+
tags: readStringParam(actionParams, "stickerTags", { required: true }),
|
|
99
|
+
mediaUrl: readStringParam(actionParams, "media", {
|
|
109
100
|
required: true,
|
|
110
101
|
trim: false
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
...senderParam(senderUserId)
|
|
121
|
-
}, cfg, actionOptions);
|
|
122
|
-
}
|
|
123
|
-
if (action === "role-add" || action === "role-remove") {
|
|
124
|
-
const guildId = readStringParam(actionParams, "guildId", { required: true });
|
|
125
|
-
const userId = readStringParam(actionParams, "userId", { required: true });
|
|
126
|
-
const roleId = readStringParam(actionParams, "roleId", { required: true });
|
|
127
|
-
return await handleDiscordAction({
|
|
128
|
-
action: action === "role-add" ? "roleAdd" : "roleRemove",
|
|
129
|
-
accountId: accountId ?? void 0,
|
|
130
|
-
guildId,
|
|
131
|
-
userId,
|
|
132
|
-
roleId,
|
|
133
|
-
...senderParam(senderUserId)
|
|
134
|
-
}, cfg);
|
|
135
|
-
}
|
|
102
|
+
}),
|
|
103
|
+
...senderParam(senderUserId)
|
|
104
|
+
}, actionOptions);
|
|
105
|
+
if (action === "role-add" || action === "role-remove") return await runAction(action === "role-add" ? "roleAdd" : "roleRemove", {
|
|
106
|
+
guildId: readStringParam(actionParams, "guildId", { required: true }),
|
|
107
|
+
userId: readStringParam(actionParams, "userId", { required: true }),
|
|
108
|
+
roleId: readStringParam(actionParams, "roleId", { required: true }),
|
|
109
|
+
...senderParam(senderUserId)
|
|
110
|
+
});
|
|
136
111
|
if (action === "channel-create" || action === "channel-edit" || action === "channel-move") {
|
|
137
112
|
const mutation = channelMutation[action];
|
|
138
|
-
return await
|
|
139
|
-
action: mutation.action,
|
|
140
|
-
accountId: accountId ?? void 0,
|
|
113
|
+
return await runAction(mutation.action, {
|
|
141
114
|
...mutation.read(actionParams),
|
|
142
115
|
...senderParam(senderUserId)
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
if (action === "channel-delete") {
|
|
146
|
-
const channelId = readStringParam(actionParams, "channelId", { required: true });
|
|
147
|
-
return await handleDiscordAction({
|
|
148
|
-
action: "channelDelete",
|
|
149
|
-
accountId: accountId ?? void 0,
|
|
150
|
-
channelId,
|
|
151
|
-
...senderParam(senderUserId)
|
|
152
|
-
}, cfg);
|
|
116
|
+
});
|
|
153
117
|
}
|
|
118
|
+
if (action === "channel-delete") return await runAction("channelDelete", {
|
|
119
|
+
channelId: readStringParam(actionParams, "channelId", { required: true }),
|
|
120
|
+
...senderParam(senderUserId)
|
|
121
|
+
});
|
|
154
122
|
if (action === "category-create" || action === "category-edit" || action === "category-delete") {
|
|
155
123
|
const creating = action === "category-create";
|
|
156
124
|
const categoryId = readStringParam(actionParams, creating ? "guildId" : "categoryId", { required: true });
|
|
@@ -158,39 +126,24 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
158
126
|
name: readStringParam(actionParams, "name", { required: creating }),
|
|
159
127
|
position: readNonNegativeIntegerParam(actionParams, "position")
|
|
160
128
|
};
|
|
161
|
-
return await
|
|
162
|
-
action: creating ? "categoryCreate" : action === "category-edit" ? "categoryEdit" : "categoryDelete",
|
|
163
|
-
accountId: accountId ?? void 0,
|
|
129
|
+
return await runAction(creating ? "categoryCreate" : action === "category-edit" ? "categoryEdit" : "categoryDelete", {
|
|
164
130
|
...creating ? { guildId: categoryId } : { categoryId },
|
|
165
131
|
...fields,
|
|
166
132
|
...senderParam(senderUserId)
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
if (action === "event-create") {
|
|
170
|
-
const guildId = readStringParam(actionParams, "guildId", { required: true });
|
|
171
|
-
const name = readStringParam(actionParams, "eventName", { required: true });
|
|
172
|
-
const startTime = readStringParam(actionParams, "startTime", { required: true });
|
|
173
|
-
const endTime = readStringParam(actionParams, "endTime");
|
|
174
|
-
const description = readStringParam(actionParams, "desc");
|
|
175
|
-
const channelId = readStringParam(actionParams, "channelId");
|
|
176
|
-
const location = readStringParam(actionParams, "location");
|
|
177
|
-
const entityType = readStringParam(actionParams, "eventType");
|
|
178
|
-
const image = readStringParam(actionParams, "image", { trim: false });
|
|
179
|
-
return await handleDiscordAction({
|
|
180
|
-
action: "eventCreate",
|
|
181
|
-
accountId: accountId ?? void 0,
|
|
182
|
-
guildId,
|
|
183
|
-
name,
|
|
184
|
-
startTime,
|
|
185
|
-
endTime,
|
|
186
|
-
description,
|
|
187
|
-
channelId,
|
|
188
|
-
location,
|
|
189
|
-
entityType,
|
|
190
|
-
image,
|
|
191
|
-
...senderParam(senderUserId)
|
|
192
|
-
}, cfg, actionOptions);
|
|
133
|
+
});
|
|
193
134
|
}
|
|
135
|
+
if (action === "event-create") return await runAction("eventCreate", {
|
|
136
|
+
guildId: readStringParam(actionParams, "guildId", { required: true }),
|
|
137
|
+
name: readStringParam(actionParams, "eventName", { required: true }),
|
|
138
|
+
startTime: readStringParam(actionParams, "startTime", { required: true }),
|
|
139
|
+
endTime: readStringParam(actionParams, "endTime"),
|
|
140
|
+
description: readStringParam(actionParams, "desc"),
|
|
141
|
+
channelId: readStringParam(actionParams, "channelId"),
|
|
142
|
+
location: readStringParam(actionParams, "location"),
|
|
143
|
+
entityType: readStringParam(actionParams, "eventType"),
|
|
144
|
+
image: readStringParam(actionParams, "image", { trim: false }),
|
|
145
|
+
...senderParam(senderUserId)
|
|
146
|
+
}, actionOptions);
|
|
194
147
|
if (isDiscordModerationAction(action)) {
|
|
195
148
|
const moderation = readDiscordModerationCommand(action, {
|
|
196
149
|
...actionParams,
|
|
@@ -200,28 +153,18 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
200
153
|
message: "deleteDays must be an integer from 0 to 7"
|
|
201
154
|
})
|
|
202
155
|
});
|
|
203
|
-
return await
|
|
156
|
+
return await runAction(moderation.action, {
|
|
204
157
|
...moderation,
|
|
205
|
-
accountId: accountId ?? void 0,
|
|
206
158
|
senderUserId
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
if (action === "thread-list") {
|
|
210
|
-
const guildId = readStringParam(actionParams, "guildId", { required: true });
|
|
211
|
-
const channelId = readStringParam(actionParams, "channelId");
|
|
212
|
-
const includeArchived = typeof actionParams.includeArchived === "boolean" ? actionParams.includeArchived : void 0;
|
|
213
|
-
const before = readStringParam(actionParams, "before");
|
|
214
|
-
const limit = readPositiveIntegerParam(actionParams, "limit");
|
|
215
|
-
return await handleDiscordAction({
|
|
216
|
-
action: "threadList",
|
|
217
|
-
accountId: accountId ?? void 0,
|
|
218
|
-
guildId,
|
|
219
|
-
channelId,
|
|
220
|
-
includeArchived,
|
|
221
|
-
before,
|
|
222
|
-
limit
|
|
223
|
-
}, cfg, readPolicyOptions);
|
|
159
|
+
});
|
|
224
160
|
}
|
|
161
|
+
if (action === "thread-list") return await runAction("threadList", {
|
|
162
|
+
guildId: readStringParam(actionParams, "guildId", { required: true }),
|
|
163
|
+
channelId: readStringParam(actionParams, "channelId"),
|
|
164
|
+
includeArchived: typeof actionParams.includeArchived === "boolean" ? actionParams.includeArchived : void 0,
|
|
165
|
+
before: readStringParam(actionParams, "before"),
|
|
166
|
+
limit: readPositiveIntegerParam(actionParams, "limit")
|
|
167
|
+
}, readPolicyOptions);
|
|
225
168
|
if (action === "thread-reply") {
|
|
226
169
|
const content = readStringParam(actionParams, "message", {
|
|
227
170
|
required: true,
|
|
@@ -229,16 +172,13 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
229
172
|
});
|
|
230
173
|
const mediaUrl = readStringParam(actionParams, "media", { trim: false }) ?? readStringParam(actionParams, "path", { trim: false }) ?? readStringParam(actionParams, "filePath", { trim: false });
|
|
231
174
|
const replyTo = readStringParam(actionParams, "replyTo");
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
action: "threadReply",
|
|
235
|
-
accountId: accountId ?? void 0,
|
|
236
|
-
channelId,
|
|
175
|
+
return await runAction("threadReply", {
|
|
176
|
+
channelId: readStringParam(actionParams, "threadId") ?? resolveChannelId(),
|
|
237
177
|
content,
|
|
238
178
|
mediaUrl: mediaUrl ?? void 0,
|
|
239
179
|
replyTo: replyTo ?? void 0,
|
|
240
180
|
...readBooleanParam(actionParams, "silent") === true ? { silent: true } : {}
|
|
241
|
-
},
|
|
181
|
+
}, actionOptions);
|
|
242
182
|
}
|
|
243
183
|
if (action === "search") {
|
|
244
184
|
const guildId = readStringParam(actionParams, "guildId");
|
|
@@ -246,9 +186,7 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
246
186
|
if (!query) throw new Error("Discord search requires query text. Provide query or content.");
|
|
247
187
|
const explicitChannelIds = readStringArrayParam(actionParams, "channelIds");
|
|
248
188
|
const channelId = readStringParam(actionParams, "channelId") ?? (!guildId && !explicitChannelIds?.length && ctx.toolContext?.currentChannelProvider?.trim().toLowerCase() === "discord" ? ctx.toolContext?.currentChannelId?.trim() || void 0 : void 0);
|
|
249
|
-
return await
|
|
250
|
-
action: "searchMessages",
|
|
251
|
-
accountId: accountId ?? void 0,
|
|
189
|
+
return await runAction("searchMessages", {
|
|
252
190
|
...guildId ? { guildId } : {},
|
|
253
191
|
content: query,
|
|
254
192
|
channelId,
|
|
@@ -256,7 +194,7 @@ async function tryHandleDiscordMessageActionGuildAdmin(params) {
|
|
|
256
194
|
authorId: readStringParam(actionParams, "authorId"),
|
|
257
195
|
authorIds: readStringArrayParam(actionParams, "authorIds"),
|
|
258
196
|
limit: readPositiveIntegerParam(actionParams, "limit")
|
|
259
|
-
},
|
|
197
|
+
}, readPolicyOptions);
|
|
260
198
|
}
|
|
261
199
|
}
|
|
262
200
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as normalizeDiscordAllowList } from "./channel-type-D1_b5UhU.mjs";
|
|
2
2
|
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
3
3
|
//#region extensions/discord/src/monitor/ingress-identity.ts
|
|
4
4
|
const DISCORD_ALLOW_LIST_PREFIXES = [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as resolveDiscordEndpointMediaGuard, O as getDiscordEndpointRuntime } from "./channel-type-D1_b5UhU.mjs";
|
|
2
2
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
3
|
-
import { A as resolveDiscordMessageChannelId, O as resolveDiscordReferencedReplyMessageId, T as hasDiscordMessageStickers, w as resolveDiscordCdnPolicy, y as resolveDiscordMessageText } from "./transcripts-source-
|
|
4
|
-
import { D as createDiscordLivePolicyReader, O as mapGatewayDispatchData } from "./provider-
|
|
3
|
+
import { A as resolveDiscordMessageChannelId, O as resolveDiscordReferencedReplyMessageId, T as hasDiscordMessageStickers, w as resolveDiscordCdnPolicy, y as resolveDiscordMessageText } from "./transcripts-source-CNWswry-.mjs";
|
|
4
|
+
import { D as createDiscordLivePolicyReader, O as mapGatewayDispatchData } from "./provider-D2OKMo0f.mjs";
|
|
5
5
|
import { logDebug } from "openclaw/plugin-sdk/logging-core";
|
|
6
|
+
import { normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
7
|
import { GatewayDispatchEvents } from "discord-api-types/v10";
|
|
7
8
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
8
|
-
import { normalizeNullableString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { createRuntimeConfigReader } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
10
10
|
import { danger } from "openclaw/plugin-sdk/runtime-env";
|
|
11
11
|
import { DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, createChannelIngressError, createChannelIngressMonitor, createChannelRunQueue } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -88,6 +88,7 @@ function createDiscordIngressMonitor(params) {
|
|
|
88
88
|
},
|
|
89
89
|
appendRetryDelaysMs: [0],
|
|
90
90
|
drain: {
|
|
91
|
+
deferredLaneOccupancy: "release",
|
|
91
92
|
retryPolicy: {
|
|
92
93
|
maxAttempts: DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS,
|
|
93
94
|
deadLetterMinAgeMs: 0
|
|
@@ -193,7 +194,7 @@ function createDiscordAvatarResolver() {
|
|
|
193
194
|
}
|
|
194
195
|
//#endregion
|
|
195
196
|
//#region extensions/discord/src/monitor/message-run-queue.ts
|
|
196
|
-
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-
|
|
197
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-CThRmCWK.mjs"));
|
|
197
198
|
async function processDiscordQueuedMessage(params) {
|
|
198
199
|
const abortSignal = params.job.context.abortSignal && params.lifecycleSignal ? AbortSignal.any([params.job.context.abortSignal, params.lifecycleSignal]) : params.job.context.abortSignal ?? params.lifecycleSignal;
|
|
199
200
|
try {
|
|
@@ -280,7 +281,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
280
281
|
}
|
|
281
282
|
//#endregion
|
|
282
283
|
//#region extensions/discord/src/monitor/message-dispatcher.ts
|
|
283
|
-
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-
|
|
284
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-D0BcCyI7.mjs"));
|
|
284
285
|
function createDiscordMessageDispatcher(params) {
|
|
285
286
|
const readPolicy = params.readPolicy ?? createDiscordLivePolicyReader({
|
|
286
287
|
...params,
|