@openclaw/discord 2026.9.6 → 2026.9.8
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/assets/icon.png +0 -0
- package/dist/.setup/{account-inspect-BwQj24ht.mjs → account-inspect-De8hOUxG.mjs} +1 -1
- package/dist/.setup/{accounts-CwJQoLjM.mjs → accounts-ChaMcixG.mjs} +1 -4
- package/dist/.setup/{activities-api-COU4-0nR.mjs → activities-api-tvbsU2e3.mjs} +38 -66
- package/dist/.setup/{api-CBK9zcq5.mjs → api-DVbJwZVt.mjs} +10 -2
- package/dist/.setup/{approval-handler.runtime-CbBktBb4.mjs → approval-handler.runtime-DxCK2Rux.mjs} +49 -125
- package/dist/.setup/{approval-message-updates-jf9zMaIC.mjs → approval-message-updates-BKFqavHZ.mjs} +2 -2
- package/dist/.setup/{audit-vKbh-LFR.mjs → audit-CLg9I71N.mjs} +5 -5
- package/dist/.setup/{channel-Dv4e3Jpc.mjs → channel-DxlUVU9t.mjs} +121 -227
- package/dist/.setup/{channel-type-DKnjV1XW.mjs → channel-type-DRCrEMss.mjs} +22 -22
- package/dist/.setup/{channel.setup-0NX6FFwi.mjs → channel.setup-CRo1GjV7.mjs} +6 -9
- package/dist/.setup/{components-yBEb75bB.mjs → components-Cq1PvIpN.mjs} +41 -69
- package/dist/.setup/{config-schema-CiZz-mtA.mjs → config-schema-oxELUSDx.mjs} +19 -44
- package/dist/.setup/{conversation-binding-route-B7qImK_b.mjs → conversation-binding-route-Caz_XuFH.mjs} +10 -5
- package/dist/.setup/{directory-config-BytTftz-.mjs → directory-config-esqNn0Eo.mjs} +6 -9
- package/dist/.setup/{directory-live--EGTH0DC.mjs → directory-live-DtKRHuGV.mjs} +6 -12
- package/dist/.setup/{discord-BXpHW-cu.mjs → discord-0xJYfdDD.mjs} +82 -386
- package/dist/.setup/{doctor-D1R-uFIu.mjs → doctor-BCl1H5tl.mjs} +21 -36
- package/dist/.setup/{doctor-contract-Co5vRCZ6.mjs → doctor-contract-CvvgwrrG.mjs} +41 -50
- package/dist/.setup/{channel-actions.runtime-leZuw01r.mjs → handle-action-CUvQWnE7.mjs} +67 -104
- package/dist/.setup/{handle-action.guild-admin-DcFa8NwA.mjs → handle-action.guild-admin-Df-8gVle.mjs} +62 -120
- package/dist/.setup/{live-policy-config-eKQ-PLdy.mjs → live-policy-config-8Pv20CHc.mjs} +2 -3
- package/dist/.setup/{message-handler-X6ejmbtY.mjs → message-handler-B-Jk4oDk.mjs} +18 -94
- package/dist/.setup/{message-handler.preflight-pluralkit-8Xji34AF.mjs → message-handler.preflight-pluralkit-CWLUBVcx.mjs} +8 -10
- package/dist/.setup/{message-handler.preflight-DE_POxFc.mjs → message-handler.preflight-v-__NSDq.mjs} +69 -180
- package/dist/.setup/{message-handler.process-CCmIVnxy.mjs → message-handler.process-BNFFuChn.mjs} +65 -86
- package/dist/.setup/{outbound-adapter-ClIgmu4F.mjs → outbound-adapter-BobT-kse.mjs} +105 -19
- package/dist/.setup/{outbound-session-route-VulUE0yV.mjs → outbound-session-route-zVGxxceg.mjs} +140 -108
- package/dist/.setup/{pluralkit-CdAt1G0P.mjs → pluralkit-a6_NLfH9.mjs} +1 -1
- package/dist/.setup/{presence-cache-dYSHPWMx.mjs → presence-cache-Di3H3DIU.mjs} +0 -4
- package/dist/.setup/{probe-CupW4we4.mjs → probe-LYrIHlBF.mjs} +13 -4
- package/dist/.setup/{provider-iOf73HW-.mjs → provider-B_G5hASF.mjs} +721 -1416
- package/dist/.setup/provider-session.runtime-BYlTBFD2.mjs +6 -0
- package/dist/.setup/provider.runtime-CUE3UxER.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-Dz8uVutq.mjs → realtime-session.runtime-oUd9DOcz.mjs} +41 -55
- package/dist/.setup/{receive-recovery-DHst8WRx.mjs → receive-recovery-CHPOsnLc.mjs} +1 -4
- package/dist/.setup/{resolve-allowlist-common-CwMBzbx9.mjs → resolve-allowlist-common-DPdRggu5.mjs} +4 -7
- package/dist/.setup/{resolve-channels-BbvsLQOZ.mjs → resolve-channels-BFPNRmVv.mjs} +21 -40
- package/dist/.setup/{resolve-users-ByFlR7LQ.mjs → resolve-users-0-aBuCy3.mjs} +4 -4
- package/dist/.setup/{retry-BEYkDy0P.mjs → retry-pz_cSha2.mjs} +3 -3
- package/dist/.setup/rolldown-runtime-B4FMCO8f.mjs +28 -0
- package/dist/.setup/{runtime-B8lJfyrA.mjs → runtime-FN000lxA.mjs} +60 -162
- package/dist/.setup/runtime-doctor-migrations-CshUGl36.mjs +159 -0
- package/dist/.setup/{runtime-DisDbixd.mjs → runtime-sUksZ--Q.mjs} +2 -5
- package/dist/.setup/{secret-config-contract-DFu9hfU8.mjs → secret-config-contract-uOE2J7yM.mjs} +15 -85
- package/dist/.setup/{security-audit-s5w50-Ly.mjs → security-audit-Cdaegq7C.mjs} +3 -1
- package/dist/.setup/{send-CIBzvXjS.mjs → send-CrfEI6Bs.mjs} +53 -108
- package/dist/.setup/{send.components-ChY21qr-.mjs → send.components-DxQAMfES.mjs} +62 -107
- package/dist/.setup/{send.outbound-QTyuFupn.mjs → send.outbound-BISKnb-a.mjs} +66 -140
- package/dist/.setup/{send.shared-VNvWfX2T.mjs → send.shared-DGFkbkQR.mjs} +10 -25
- package/dist/.setup/{sender-identity-0Ymgvmaj.mjs → sender-identity-B9X5Vb9R.mjs} +2 -3
- package/dist/.setup/setup-plugin-api-BQUBxbhe.mjs +3 -0
- package/dist/.setup/{shared-DHPDaMSx.mjs → shared-B3wZ4hN-.mjs} +25 -32
- package/dist/.setup/{subagent-hooks-CjW7r8Pe.mjs → subagent-hooks-nlUE9ow7.mjs} +5 -6
- package/dist/.setup/system-events-CdeZnvPV.mjs +33 -0
- package/dist/.setup/{target-resolver-BXpy6VT8.mjs → target-resolver-BuLapkhy.mjs} +9 -12
- package/dist/.setup/targets-0KUcEIYx.mjs +3 -0
- package/dist/.setup/{thread-bindings-CEh2dhqP.mjs → thread-bindings-D7TfgjR_.mjs} +33 -35
- package/dist/.setup/{thread-bindings.manager-ve-i6oqt.mjs → thread-bindings.manager-DN-NissX.mjs} +325 -233
- package/dist/.setup/thread-bindings.session-updates-CshfKghV.mjs +359 -0
- package/dist/.setup/{thread-bindings.state-BThFQEga.mjs → thread-bindings.state-g6v9zAym.mjs} +21 -62
- package/dist/.setup/{transcripts-source-DVegW0WI.mjs → transcripts-source-p8EV179h.mjs} +76 -235
- package/dist/.setup/{typing-BKZL5fGj.mjs → typing-BiHCzBRu.mjs} +2 -1
- package/dist/.setup/{voice-runtime-elTtjEIG.mjs → voice-runtime-B46rcwrG.mjs} +140 -244
- 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/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +4 -4
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +20 -20
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-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 +15 -24
- package/dist/subagent-hooks-api.js +3 -4
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +20 -8
- package/node_modules/@types/node/ffi.d.ts +14 -0
- package/node_modules/@types/node/http2.d.ts +3 -2
- package/node_modules/@types/node/net.d.ts +16 -4
- package/node_modules/@types/node/package.json +2 -17
- package/node_modules/@types/node/process.d.ts +1 -0
- package/node_modules/@types/node/quic.d.ts +39 -1
- package/node_modules/@types/node/stream/iter.d.ts +9 -12
- package/node_modules/@types/node/test/reporters.d.ts +1 -0
- package/node_modules/@types/node/test.d.ts +72 -0
- package/node_modules/@types/node/tls.d.ts +14 -10
- package/node_modules/@types/node/vm.d.ts +2 -1
- package/node_modules/@types/node/worker_threads.d.ts +4 -1
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/openclaw.plugin.json +21 -1
- package/package.json +5 -5
- package/dist/.setup/agent-components.runtime-CEPrf2SY.mjs +0 -4
- package/dist/.setup/probe.runtime-DBQ_AGPe.mjs +0 -2
- package/dist/.setup/provider-session.runtime-DrGAYnZv.mjs +0 -6
- package/dist/.setup/provider.runtime-BmjW_pIw.mjs +0 -2
- package/dist/.setup/security-audit.runtime-DHtYenx9.mjs +0 -2
- package/dist/.setup/setup-plugin-api-Dvr41dyx.mjs +0 -3
- package/dist/.setup/system-events-B2YEEMbS.mjs +0 -34
- package/dist/.setup/targets-CvemhN3i.mjs +0 -3
- package/dist/.setup/thread-bindings.session-updates-DCQq1WZ5.mjs +0 -55
- /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
package/dist/.setup/{outbound-session-route-VulUE0yV.mjs → outbound-session-route-zVGxxceg.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-
|
|
2
|
-
import { t as isDiscordThreadChannelType } from "./channel-type-
|
|
3
|
-
import { c as resolveDiscordAccount, r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-
|
|
4
|
-
import { _ as
|
|
1
|
+
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-Cq1PvIpN.mjs";
|
|
2
|
+
import { t as isDiscordThreadChannelType } from "./channel-type-DRCrEMss.mjs";
|
|
3
|
+
import { c as resolveDiscordAccount, r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-ChaMcixG.mjs";
|
|
4
|
+
import { _ as matchesDiscordToolContextTarget, b as parseDiscordTarget, v as normalizeDiscordMessagingTarget } from "./retry-pz_cSha2.mjs";
|
|
5
5
|
import { n as resolveDiscordCommandOwnerEntries } from "./command-owners-D78sAoOz.mjs";
|
|
6
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
6
|
+
import { t as inspectDiscordAccount } from "./account-inspect-De8hOUxG.mjs";
|
|
7
7
|
import { ChannelType } from "discord-api-types/v10";
|
|
8
8
|
import { Type } from "typebox";
|
|
9
9
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -13,10 +13,8 @@ import { resolveAskUserQuestionOptionIndices } from "openclaw/plugin-sdk/reply-p
|
|
|
13
13
|
import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
14
14
|
import { createUnionActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
15
15
|
import { buildThreadAwareOutboundSessionRoute } from "openclaw/plugin-sdk/channel-core";
|
|
16
|
-
import { createChannelApproverDmTargetResolver, createChannelNativeOriginTargetResolver } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
17
16
|
import { getExecApprovalReplyMetadata, isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
|
|
18
17
|
import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
19
|
-
import { createApproverRestrictedNativeApprovalCapability } from "openclaw/plugin-sdk/approval-delivery-runtime";
|
|
20
18
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
21
19
|
import { createInboundEventDeliveryCorrelation } from "openclaw/plugin-sdk/inbound-event-delivery";
|
|
22
20
|
//#region extensions/discord/src/exec-approvals.ts
|
|
@@ -91,11 +89,6 @@ function resolveRequiredDiscordChannelPermissions(channelType) {
|
|
|
91
89
|
if (channelType === ChannelType.GuildVoice || channelType === ChannelType.GuildStageVoice) return [...REQUIRED_VOICE_CHANNEL_PERMISSIONS];
|
|
92
90
|
return [...REQUIRED_TEXT_CHANNEL_PERMISSIONS];
|
|
93
91
|
}
|
|
94
|
-
function shouldAuditChannelConfig(config) {
|
|
95
|
-
if (!config) return true;
|
|
96
|
-
if (config.enabled === false) return false;
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
92
|
function listConfiguredGuildChannelKeys(guilds) {
|
|
100
93
|
if (!guilds) return [];
|
|
101
94
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -107,7 +100,7 @@ function listConfiguredGuildChannelKeys(guilds) {
|
|
|
107
100
|
const channelId = normalizeOptionalString(key) ?? "";
|
|
108
101
|
if (!channelId) continue;
|
|
109
102
|
if (channelId === "*") continue;
|
|
110
|
-
if (
|
|
103
|
+
if (value?.enabled === false) continue;
|
|
111
104
|
ids.add(channelId);
|
|
112
105
|
}
|
|
113
106
|
}
|
|
@@ -271,103 +264,133 @@ function matchesCurrentDiscordThread(params) {
|
|
|
271
264
|
toolContext: params.toolContext
|
|
272
265
|
});
|
|
273
266
|
}
|
|
274
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
267
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./handle-action-CUvQWnE7.mjs"));
|
|
268
|
+
const discordActionGroups = [
|
|
269
|
+
{
|
|
270
|
+
gate: "polls",
|
|
271
|
+
actions: ["poll"]
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
gate: "reactions",
|
|
275
|
+
actions: [
|
|
276
|
+
"react",
|
|
277
|
+
"reactions",
|
|
278
|
+
"emoji-list"
|
|
279
|
+
]
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
gate: "messages",
|
|
283
|
+
actions: [
|
|
284
|
+
"upload-file",
|
|
285
|
+
"read",
|
|
286
|
+
"edit",
|
|
287
|
+
"delete"
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
gate: "pins",
|
|
292
|
+
actions: [
|
|
293
|
+
"pin",
|
|
294
|
+
"unpin",
|
|
295
|
+
"list-pins"
|
|
296
|
+
]
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
gate: "permissions",
|
|
300
|
+
actions: ["permissions"]
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
gate: "threads",
|
|
304
|
+
actions: [
|
|
305
|
+
"thread-create",
|
|
306
|
+
"thread-list",
|
|
307
|
+
"thread-reply"
|
|
308
|
+
]
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
gate: "search",
|
|
312
|
+
actions: ["search"]
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
gate: "stickers",
|
|
316
|
+
actions: ["sticker"]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
gate: "memberInfo",
|
|
320
|
+
actions: ["member-info"]
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
gate: "roleInfo",
|
|
324
|
+
actions: ["role-info"]
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
gate: "emojiUploads",
|
|
328
|
+
actions: ["emoji-upload"]
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
gate: "stickerUploads",
|
|
332
|
+
actions: ["sticker-upload"]
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
gate: "roles",
|
|
336
|
+
actions: ["role-add", "role-remove"],
|
|
337
|
+
defaultEnabled: false
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
gate: "channelInfo",
|
|
341
|
+
actions: ["channel-info", "channel-list"]
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
gate: "channels",
|
|
345
|
+
actions: [
|
|
346
|
+
"channel-create",
|
|
347
|
+
"channel-edit",
|
|
348
|
+
"channel-delete",
|
|
349
|
+
"channel-move",
|
|
350
|
+
"category-create",
|
|
351
|
+
"category-edit",
|
|
352
|
+
"category-delete"
|
|
353
|
+
]
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
gate: "voiceStatus",
|
|
357
|
+
actions: ["voice-status"]
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
gate: "events",
|
|
361
|
+
actions: ["event-list", "event-create"]
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
gate: "moderation",
|
|
365
|
+
actions: [
|
|
366
|
+
"timeout",
|
|
367
|
+
"kick",
|
|
368
|
+
"ban"
|
|
369
|
+
],
|
|
370
|
+
defaultEnabled: false
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
gate: "presence",
|
|
374
|
+
actions: ["set-presence"],
|
|
375
|
+
defaultEnabled: false
|
|
376
|
+
}
|
|
377
|
+
];
|
|
303
378
|
function describeDiscordMessageTool({ cfg, accountId }) {
|
|
304
|
-
const
|
|
379
|
+
const accounts = (accountId ? [accountId] : listDiscordAccountIds(cfg)).map((id) => inspectDiscordAccount({
|
|
305
380
|
cfg,
|
|
306
|
-
accountId
|
|
307
|
-
});
|
|
308
|
-
if (
|
|
381
|
+
accountId: id
|
|
382
|
+
})).filter((account) => account.enabled && account.configured);
|
|
383
|
+
if (accounts.length === 0) return {
|
|
309
384
|
actions: [],
|
|
310
385
|
capabilities: [],
|
|
311
386
|
schema: null
|
|
312
387
|
};
|
|
388
|
+
const isEnabled = createUnionActionGate(accounts, (account) => createDiscordActionGate({
|
|
389
|
+
cfg,
|
|
390
|
+
accountId: account.accountId
|
|
391
|
+
}));
|
|
313
392
|
const actions = /* @__PURE__ */ new Set(["send"]);
|
|
314
|
-
if (
|
|
315
|
-
if (discovery.isEnabled("reactions")) {
|
|
316
|
-
actions.add("react");
|
|
317
|
-
actions.add("reactions");
|
|
318
|
-
actions.add("emoji-list");
|
|
319
|
-
}
|
|
320
|
-
if (discovery.isEnabled("messages")) {
|
|
321
|
-
actions.add("upload-file");
|
|
322
|
-
actions.add("read");
|
|
323
|
-
actions.add("edit");
|
|
324
|
-
actions.add("delete");
|
|
325
|
-
}
|
|
326
|
-
if (discovery.isEnabled("pins")) {
|
|
327
|
-
actions.add("pin");
|
|
328
|
-
actions.add("unpin");
|
|
329
|
-
actions.add("list-pins");
|
|
330
|
-
}
|
|
331
|
-
if (discovery.isEnabled("permissions")) actions.add("permissions");
|
|
332
|
-
if (discovery.isEnabled("threads")) {
|
|
333
|
-
actions.add("thread-create");
|
|
334
|
-
actions.add("thread-list");
|
|
335
|
-
actions.add("thread-reply");
|
|
336
|
-
}
|
|
337
|
-
if (discovery.isEnabled("search")) actions.add("search");
|
|
338
|
-
if (discovery.isEnabled("stickers")) actions.add("sticker");
|
|
339
|
-
if (discovery.isEnabled("memberInfo")) actions.add("member-info");
|
|
340
|
-
if (discovery.isEnabled("roleInfo")) actions.add("role-info");
|
|
341
|
-
if (discovery.isEnabled("emojiUploads")) actions.add("emoji-upload");
|
|
342
|
-
if (discovery.isEnabled("stickerUploads")) actions.add("sticker-upload");
|
|
343
|
-
if (discovery.isEnabled("roles", false)) {
|
|
344
|
-
actions.add("role-add");
|
|
345
|
-
actions.add("role-remove");
|
|
346
|
-
}
|
|
347
|
-
if (discovery.isEnabled("channelInfo")) {
|
|
348
|
-
actions.add("channel-info");
|
|
349
|
-
actions.add("channel-list");
|
|
350
|
-
}
|
|
351
|
-
if (discovery.isEnabled("channels")) {
|
|
352
|
-
actions.add("channel-create");
|
|
353
|
-
actions.add("channel-edit");
|
|
354
|
-
actions.add("channel-delete");
|
|
355
|
-
actions.add("channel-move");
|
|
356
|
-
actions.add("category-create");
|
|
357
|
-
actions.add("category-edit");
|
|
358
|
-
actions.add("category-delete");
|
|
359
|
-
}
|
|
360
|
-
if (discovery.isEnabled("voiceStatus")) actions.add("voice-status");
|
|
361
|
-
if (discovery.isEnabled("events")) {
|
|
362
|
-
actions.add("event-list");
|
|
363
|
-
actions.add("event-create");
|
|
364
|
-
}
|
|
365
|
-
if (discovery.isEnabled("moderation", false)) {
|
|
366
|
-
actions.add("timeout");
|
|
367
|
-
actions.add("kick");
|
|
368
|
-
actions.add("ban");
|
|
369
|
-
}
|
|
370
|
-
if (discovery.isEnabled("presence", false)) actions.add("set-presence");
|
|
393
|
+
for (const group of discordActionGroups) if (isEnabled(group.gate, group.defaultEnabled ?? true)) for (const action of group.actions) actions.add(action);
|
|
371
394
|
const schema = [];
|
|
372
395
|
if (actions.has("react")) schema.push({
|
|
373
396
|
actions: ["react", "reactions"],
|
|
@@ -541,7 +564,7 @@ function buildDiscordConversationRouteContext(params) {
|
|
|
541
564
|
};
|
|
542
565
|
}
|
|
543
566
|
function resolveDiscordConversationRoute(params) {
|
|
544
|
-
|
|
567
|
+
const input = {
|
|
545
568
|
cfg: params.cfg,
|
|
546
569
|
channel: "discord",
|
|
547
570
|
accountId: params.accountId,
|
|
@@ -552,7 +575,16 @@ function resolveDiscordConversationRoute(params) {
|
|
|
552
575
|
kind: "channel",
|
|
553
576
|
id: params.parentConversationId
|
|
554
577
|
} : void 0
|
|
555
|
-
}
|
|
578
|
+
};
|
|
579
|
+
try {
|
|
580
|
+
return resolveAgentRoute(input);
|
|
581
|
+
} catch (error) {
|
|
582
|
+
if (!params.defaultAgentId || !(error instanceof Error) || !("code" in error) || error.code !== "AGENT_SELECTION_REQUIRED") throw error;
|
|
583
|
+
return resolveAgentRoute({
|
|
584
|
+
...input,
|
|
585
|
+
defaultAgentId: params.defaultAgentId
|
|
586
|
+
});
|
|
587
|
+
}
|
|
556
588
|
}
|
|
557
589
|
function resolveDiscordBoundConversationRoute(params) {
|
|
558
590
|
return resolveDiscordEffectiveRoute({
|
|
@@ -681,11 +713,11 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
681
713
|
}
|
|
682
714
|
}
|
|
683
715
|
};
|
|
684
|
-
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-
|
|
716
|
+
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-DxQAMfES.mjs").then((n) => n.i), "sendDiscordComponentMessage");
|
|
685
717
|
async function sendDiscordComponentMessageLazy(...args) {
|
|
686
718
|
return await (await loadDiscordComponentSend())(...args);
|
|
687
719
|
}
|
|
688
|
-
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-
|
|
720
|
+
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-Cq1PvIpN.mjs").then((n) => n.a));
|
|
689
721
|
function addPayloadTextFallback(spec, payload) {
|
|
690
722
|
return spec.text ? spec : {
|
|
691
723
|
...spec,
|
|
@@ -791,4 +823,4 @@ function resolveDiscordOutboundTargetKindHint(params) {
|
|
|
791
823
|
return "channel";
|
|
792
824
|
}
|
|
793
825
|
//#endregion
|
|
794
|
-
export {
|
|
826
|
+
export { collectDiscordAuditChannelIdsForAccount as C, isDiscordExecApprovalClientEnabled as D, isDiscordExecApprovalApprover as E, shouldSuppressLocalDiscordExecApprovalPrompt as O, auditDiscordChannelPermissionsWithFetcher as S, getDiscordExecApprovalApprovers as T, resolveDiscordRuntimeBindingConversationId as _, resolveDiscordComponentSpec as a, discordInboundEventDelivery as b, formatDiscordApprovalDisplayValue as c, resolveDiscordBoundConversationRoute as d, resolveDiscordConversationRoute as f, resolveDiscordCurrentConversationIdentity as g, resolveDiscordConversationIdentity as h, isDiscordComponentSpecWithinMessageLimit as i, buildDiscordConversationRouteContext as l, shouldIgnoreStaleDiscordRouteBinding as m, DISCORD_PRESENTATION_CAPABILITIES as n, sendDiscordComponentMessageLazy as o, resolveDiscordEffectiveRoute as p, buildDiscordPresentationPayload as r, DISCORD_APPROVAL_ALLOWED_MENTIONS as s, resolveDiscordOutboundSessionRoute as t, buildDiscordRoutePeer as u, discordMessageActions as v, resolveRequiredDiscordChannelPermissions as w, notifyDiscordInboundEventOutboundPayloadSuccess as x, isTrustedRequesterGuildAdminAction as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
3
3
|
import { readProviderJsonObjectResponse, readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
4
4
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
@@ -9,7 +9,6 @@ const presenceCache = /* @__PURE__ */ new Map();
|
|
|
9
9
|
function resolveAccountKey(accountId) {
|
|
10
10
|
return accountId ?? "default";
|
|
11
11
|
}
|
|
12
|
-
/** Update cached presence for a user. */
|
|
13
12
|
function setPresence(accountId, userId, data) {
|
|
14
13
|
const accountKey = resolveAccountKey(accountId);
|
|
15
14
|
let accountCache = presenceCache.get(accountKey);
|
|
@@ -23,11 +22,9 @@ function setPresence(accountId, userId, data) {
|
|
|
23
22
|
if (oldest !== void 0) accountCache.delete(oldest);
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
/** Get cached presence for a user. Returns undefined if not cached. */
|
|
27
25
|
function getPresence(accountId, userId) {
|
|
28
26
|
return presenceCache.get(resolveAccountKey(accountId))?.get(userId);
|
|
29
27
|
}
|
|
30
|
-
/** Clear cached presence data. */
|
|
31
28
|
function clearPresences(accountId) {
|
|
32
29
|
if (accountId) {
|
|
33
30
|
presenceCache.delete(resolveAccountKey(accountId));
|
|
@@ -35,7 +32,6 @@ function clearPresences(accountId) {
|
|
|
35
32
|
}
|
|
36
33
|
presenceCache.clear();
|
|
37
34
|
}
|
|
38
|
-
/** Get the number of cached presence entries. */
|
|
39
35
|
function presenceCacheSize() {
|
|
40
36
|
let total = 0;
|
|
41
37
|
for (const accountCache of presenceCache.values()) total += accountCache.size;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { D as getDiscordEndpointRuntime } from "./channel-type-DRCrEMss.mjs";
|
|
3
|
+
import { m as normalizeDiscordToken } from "./accounts-ChaMcixG.mjs";
|
|
4
|
+
import { n as DiscordApiError, r as fetchDiscord } from "./api-DVbJwZVt.mjs";
|
|
4
5
|
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
5
6
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
6
7
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
7
8
|
import { fetchWithTimeout, runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
9
|
//#region extensions/discord/src/probe.ts
|
|
10
|
+
var probe_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
+
fetchDiscordApplicationId: () => fetchDiscordApplicationId,
|
|
12
|
+
fetchDiscordApplicationSummary: () => fetchDiscordApplicationSummary,
|
|
13
|
+
parseApplicationIdFromToken: () => parseApplicationIdFromToken,
|
|
14
|
+
probeDiscord: () => probeDiscord,
|
|
15
|
+
probeDiscordApplicationId: () => probeDiscordApplicationId,
|
|
16
|
+
resolveDiscordPrivilegedIntentsFromFlags: () => resolveDiscordPrivilegedIntentsFromFlags
|
|
17
|
+
});
|
|
9
18
|
const DISCORD_API_BASE = "https://discord.com/api/v10";
|
|
10
19
|
const DISCORD_PROBE_GET_ME_LABEL = "discord.probe.getMe";
|
|
11
20
|
const DISCORD_PROBE_JSON_MAX_BYTES = 16777216;
|
|
@@ -181,4 +190,4 @@ async function fetchDiscordApplicationId(token, timeoutMs, fetcher = fetch) {
|
|
|
181
190
|
if (result.kind === "unavailable" && result.status === 429) throw result.error;
|
|
182
191
|
}
|
|
183
192
|
//#endregion
|
|
184
|
-
export { probeDiscordApplicationId as a, probeDiscord as i, fetchDiscordApplicationSummary as n,
|
|
193
|
+
export { probeDiscordApplicationId as a, probeDiscord as i, fetchDiscordApplicationSummary as n, probe_exports as o, parseApplicationIdFromToken as r, resolveDiscordPrivilegedIntentsFromFlags as s, fetchDiscordApplicationId as t };
|