@openclaw/discord 2026.11.5 → 2026.11.10-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/.setup/{account-inspect-DGkdWwix.mjs → account-inspect-CSz5Qodj.mjs} +2 -3
- package/dist/.setup/{accounts-C_25wyxC.mjs → accounts-DtjvhJUj.mjs} +4 -8
- package/dist/.setup/{active-turn-thread-route-KvRTAVE3.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
- package/dist/.setup/{allow-list-BXrS8-R9.mjs → allow-list-CkqpzPvP.mjs} +5 -9
- package/dist/.setup/{api-BlBD4ism.mjs → api-C4j_kC-2.mjs} +4 -6
- package/dist/.setup/{approval-handler.runtime-o2N6GRFH.mjs → approval-handler.runtime-DjtQbUPp.mjs} +10 -10
- package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs} +3 -4
- package/dist/.setup/{audit-5b-FXj9R.mjs → audit-B9vk3V2z.mjs} +6 -7
- package/dist/.setup/{channel-CplVDtyZ.mjs → channel-Cihfaj84.mjs} +38 -41
- package/dist/.setup/{channel-access-9cyzozUP.mjs → channel-access-DhJhVrdZ.mjs} +1 -2
- package/dist/.setup/{channel.setup-B3MtmBQG.mjs → channel.setup-DmGdG9BH.mjs} +7 -10
- package/dist/.setup/{command-deploy-store-DFkBTViB.mjs → command-deploy-store-DPWiBMks.mjs} +1 -2
- package/dist/.setup/{command-owners-C7rUdqUX.mjs → command-owners-BzlhNBxA.mjs} +1 -2
- package/dist/.setup/{components-YCvQ6YLS.mjs → components-GePlato3.mjs} +10 -16
- package/dist/.setup/{components.base-CiS0h_XP.mjs → components.base-C5sAPHe4.mjs} +1 -2
- package/dist/.setup/config-DDwcUaxT.mjs +20 -0
- package/dist/.setup/{config-schema-BNKN1cu5.mjs → config-schema-D3M1livr.mjs} +5 -7
- package/dist/.setup/{conversation-binding-route-kCTw8cij.mjs → conversation-binding-route-CAaWWJdQ.mjs} +2 -3
- package/dist/.setup/conversation-fork-B6PiUuln.mjs +197 -0
- package/dist/.setup/{directory-config-Ble81PWH.mjs → directory-config-BXJuh9-J.mjs} +3 -4
- package/dist/.setup/directory-live-B9UoQG9g.mjs +90 -0
- package/dist/.setup/{discord-DGVSguhx.mjs → discord-cXPUdHQi.mjs} +98 -77
- package/dist/.setup/{doctor-eujgbnpZ.mjs → doctor-MTAWTgRa.mjs} +7 -8
- package/dist/.setup/{doctor-contract-Bwv8EuQ_.mjs → doctor-contract-Dstl3cMg.mjs} +2 -3
- package/dist/.setup/{endpoint-runtime-lf4DeLas.mjs → endpoint-runtime-BM3x-m6O.mjs} +1 -2
- package/dist/.setup/{guilds-eDq22iSM.mjs → guilds-DYBhgnfq.mjs} +3 -4
- package/dist/.setup/{handle-action-CktwmzMz.mjs → handle-action-El1ok7Ak.mjs} +13 -12
- package/dist/.setup/{handle-action.guild-admin-WLQ7fRqI.mjs → handle-action.guild-admin-CxYfg02j.mjs} +7 -5
- package/dist/.setup/identity-link-B7KOBo_l.mjs +74 -0
- package/dist/.setup/{listeners-Df8lx3vK.mjs → listeners-DIyynRvV.mjs} +2 -3
- package/dist/.setup/{live-policy-config-DiBVuaU6.mjs → live-policy-config-DjIHWFla.mjs} +3 -5
- package/dist/.setup/{message-handler-DeoWTD-4.mjs → message-handler-BoQcvdfV.mjs} +18 -17
- package/dist/.setup/{message-handler.preflight-DKOjgF0z.mjs → message-handler.preflight-C7uhmcsV.mjs} +20 -27
- package/dist/.setup/{message-handler.preflight-pluralkit-CYZfXXb6.mjs → message-handler.preflight-pluralkit-BFntgVKc.mjs} +10 -14
- package/dist/.setup/{message-handler.process-RKRgMCJy.mjs → message-handler.process-B29pkCxQ.mjs} +54 -66
- package/dist/.setup/oauth-http-DdVyzSbo.mjs +40 -0
- package/dist/.setup/{outbound-payload-BaZmjewa.mjs → outbound-payload-Dh6xCO6z.mjs} +18 -13
- package/dist/.setup/{outbound-session-route-Cgx4i9cS.mjs → outbound-session-route-G_fK5RAh.mjs} +22 -34
- package/dist/.setup/{output-activity-uBpMSX75.mjs → output-activity-CDgs2s3O.mjs} +1 -2
- package/dist/.setup/{pluralkit-B64dfq_j.mjs → pluralkit-DcXbHTpQ.mjs} +2 -3
- package/dist/.setup/{preflight-audio-C6QtD6HX.mjs → preflight-audio-r4BbaJxh.mjs} +1 -2
- package/dist/.setup/{presence-cache-Dq-3nH7R.mjs → presence-cache-B3xj3b0l.mjs} +1 -2
- package/dist/.setup/{probe-DezB-6xz.mjs → probe-CfGMZwFD.mjs} +5 -6
- package/dist/.setup/{provider-D63dgDSw.mjs → provider-CnDxdXUm.mjs} +252 -246
- package/dist/.setup/{provider-session.runtime-ePktW62k.mjs → provider-session.runtime-CCBGrm-d.mjs} +3 -3
- package/dist/.setup/provider.runtime-BoSMAwDb.mjs +1 -0
- package/dist/.setup/{proxy-fetch-BzXwBAXt.mjs → proxy-fetch-B8cK6FLQ.mjs} +1 -2
- package/dist/.setup/{realtime-session.runtime-rlZ3WzwC.mjs → realtime-session.runtime-OD95VAEG.mjs} +15 -25
- package/dist/.setup/{receive-recovery-C3Ks4wAQ.mjs → receive-recovery-DV_v5ROf.mjs} +3 -6
- package/dist/.setup/{resolve-allowlist-common-Bk8Fj6Ik.mjs → resolve-allowlist-common-CYdqBUgV.mjs} +3 -4
- package/dist/.setup/{resolve-channels-Bp8frXvc.mjs → resolve-channels-BNnyfCR8.mjs} +10 -9
- package/dist/.setup/{resolve-users-Cvcj22sG.mjs → resolve-users-CDMAGrzv.mjs} +5 -6
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime-BJaCvlmq.mjs → runtime-CkeNX7ic.mjs} +62 -51
- package/dist/.setup/{runtime-BMgTyuwg.mjs → runtime-DSaHEGJd.mjs} +4 -24
- package/dist/.setup/{runtime-DgnVQ7zW.mjs → runtime-DcBvHOm1.mjs} +1 -2
- package/dist/.setup/{runtime-doctor-migrations-BPV-R4G9.mjs → runtime-doctor-migrations-BpV1jKk0.mjs} +5 -9
- package/dist/.setup/{secret-config-contract-B1kE4sDv.mjs → secret-config-contract-CP6teHec.mjs} +1 -2
- package/dist/.setup/{security-audit-BFT84Uny.mjs → security-audit-CTwisG7c.mjs} +3 -4
- package/dist/.setup/{security-contract-DNyyjTZZ.mjs → security-contract-D-o0iWDk.mjs} +1 -2
- package/dist/.setup/{security-doctor-nGgPm65L.mjs → security-doctor-4s7omTZd.mjs} +1 -2
- package/dist/.setup/{send-CVW7V-VZ.mjs → send-DKzwsZkm.mjs} +28 -32
- package/dist/.setup/{send.components-C8YXdnO_.mjs → send.components-CIZALYDP.mjs} +12 -14
- package/dist/.setup/{send.outbound-Uzcmh3Yd.mjs → send.outbound-cQ4Ohmsc.mjs} +11 -16
- package/dist/.setup/send.permissions-BvH_Dr8p.mjs +369 -0
- package/dist/.setup/{send.receipt-NZDOTZBU.mjs → send.receipt-CZ7ks6g7.mjs} +64 -17
- package/dist/.setup/send.shared-D2lh737v.mjs +259 -0
- package/dist/.setup/{sender-identity-76HFb8eK.mjs → sender-identity-Dt5ELjRN.mjs} +2 -3
- package/dist/.setup/{session-contract-BO5tlIdl.mjs → session-contract-Bq71MS78.mjs} +1 -2
- package/dist/.setup/{session-key-normalization-CCHGNSQw.mjs → session-key-normalization-Cfvze5hd.mjs} +1 -2
- package/dist/.setup/setup-plugin-api-BJt8tAAC.mjs +2 -0
- package/dist/.setup/{shared-yDUSExm2.mjs → shared-Bf7ifHlc.mjs} +14 -17
- package/dist/.setup/{shared-interactive-DmzaoKOM.mjs → shared-interactive-DKBw4SNV.mjs} +7 -12
- package/dist/.setup/{subagent-hooks-CDkdHQyy.mjs → subagent-hooks-CVmIOrAR.mjs} +4 -5
- package/dist/.setup/{system-events-yfWz150v.mjs → system-events-DB6p2H4l.mjs} +3 -4
- package/dist/.setup/{target-parsing-C-HyNxcE.mjs → target-parsing-BiuhcK9Q.mjs} +1 -2
- package/dist/.setup/{target-resolver-BOOzqxxM.mjs → target-resolver-48znkzky.mjs} +6 -7
- package/dist/.setup/{thread-binding-api-BDZJD4na.mjs → thread-binding-api-Drd4Zu-5.mjs} +1 -2
- package/dist/.setup/{thread-bindings-zce4cpu_.mjs → thread-bindings-DTHVdmvF.mjs} +7 -10
- package/dist/.setup/{thread-bindings.manager-NywKzUtc.mjs → thread-bindings.manager-6EnH3YZh.mjs} +45 -30
- package/dist/.setup/{thread-bindings.session-updates-D0j7oh8S.mjs → thread-bindings.session-updates-BPO6pPzd.mjs} +9 -12
- package/dist/.setup/{threading-DodLYDt-.mjs → threading-PC3IIaHd.mjs} +5 -7
- package/dist/.setup/{timeouts-cIxzatmv.mjs → timeouts-CT9hnmo4.mjs} +1 -2
- package/dist/.setup/{transcripts-source-ie9GBWaU.mjs → transcripts-source-C3F_ErM1.mjs} +33 -46
- package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
- package/dist/.setup/{voice-runtime-Dc8Su9Cm.mjs → voice-runtime-CzV3fXxV.mjs} +28 -46
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +2 -3
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +10 -50
- package/dist/api.js +21 -22
- package/dist/assets/embedded-app-sdk.mjs +1 -1
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/directory-contract-api.js +2 -3
- package/dist/doctor-contract-api.js +7 -8
- package/dist/index.js +1 -2
- package/dist/runtime-api.js +23 -22
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-entry.js +2 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +14 -26
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/transcripts-source-api.js +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +2 -3
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/zlib.d.ts +752 -0
- package/node_modules/typebox/build/format/date_time.d.mts +2 -1
- package/node_modules/typebox/build/format/date_time.mjs +12 -3
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +7 -2
- package/package.json +5 -5
- package/dist/.setup/directory-live-DH3tpS3x.mjs +0 -144
- package/dist/.setup/provider.runtime-DcNkwhPW.mjs +0 -1
- package/dist/.setup/send.shared-a_6Oeyg1.mjs +0 -589
- package/dist/.setup/setup-plugin-api-BExhGEhL.mjs +0 -2
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Official OpenClaw channel plugin for Discord servers, channels, DMs, slash commands, and app events.
|
|
4
4
|
|
|
5
|
+
Voice input has a packet-inactivity deadline even when a speaker disconnects
|
|
6
|
+
without a speaking-end event. `voice.captureSilenceGraceMs` still controls the
|
|
7
|
+
grace after the SDK detects silence. Active recordings flush
|
|
8
|
+
bounded WAV segments to disk; stream errors discard the incomplete segment and
|
|
9
|
+
release the speaker subscription. Continuous capture remains registered.
|
|
10
|
+
|
|
5
11
|
Install from OpenClaw:
|
|
6
12
|
|
|
7
13
|
```bash
|
|
@@ -16,3 +22,34 @@ Configurations using pre-July-2026 `voice.tts.<provider>` keys or per-channel
|
|
|
16
22
|
preserves these old settings and reports the exact path instead of rewriting
|
|
17
23
|
them. Supported configurations use `voice.tts.providers`, channel `enabled`,
|
|
18
24
|
and top-level `bindings`.
|
|
25
|
+
|
|
26
|
+
## Forking a conversation
|
|
27
|
+
|
|
28
|
+
Run `/fork [title]` inside an existing server text thread or forum post to copy the
|
|
29
|
+
OpenClaw conversation into a new sibling under the same parent channel. The
|
|
30
|
+
source stays bound to its original session. The new thread is bound to the copied
|
|
31
|
+
ordinary session, and receives a short text-only recap with Discord mentions
|
|
32
|
+
neutralized. A Discord jump link points to the sibling; it never grants access.
|
|
33
|
+
Names are limited to Discord's 100-character thread-name limit. Forum siblings
|
|
34
|
+
reuse available source tags, including the forum's required-tag constraint.
|
|
35
|
+
|
|
36
|
+
Private threads stay private. The bot creates a non-invitable sibling, adds only
|
|
37
|
+
the requester, and confirms their access before binding and recap delivery.
|
|
38
|
+
Other source members are not automatically included. Members with Discord's
|
|
39
|
+
Manage Threads permission may still have access under Discord's normal rules.
|
|
40
|
+
There is no public fallback and no invitation link.
|
|
41
|
+
|
|
42
|
+
DMs, unthreaded channels, announcement threads, and media-channel posts are not
|
|
43
|
+
supported. The bot needs View Channel, Read Message History, Send Messages in
|
|
44
|
+
Threads, and the applicable Create Public Threads, Create Private Threads, or
|
|
45
|
+
forum Send Messages permission. Thread bindings must be enabled for the bot
|
|
46
|
+
account; existing account and command authorization still applies. This adds no
|
|
47
|
+
new configuration or migration requirement for existing installations. The
|
|
48
|
+
requester must be able to view the source and parent and read the source message
|
|
49
|
+
history; a visible channel alone does not grant historical context access.
|
|
50
|
+
|
|
51
|
+
If creation has an uncertain outcome, OpenClaw does not retry it automatically.
|
|
52
|
+
Inspect the parent channel before running the command again. When Discord returns
|
|
53
|
+
a sibling identity but membership or binding setup fails, the error includes its
|
|
54
|
+
jump link and no recap is sent. The sibling is preserved rather than silently
|
|
55
|
+
creating another one or deleting native work.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as listDiscordAccountIds, n as inspectDiscordAccountConfig, v as resolveDiscordAccountAvailability } from "./accounts-
|
|
1
|
+
import { i as listDiscordAccountIds, n as inspectDiscordAccountConfig, v as resolveDiscordAccountAvailability } from "./accounts-DtjvhJUj.mjs";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
3
3
|
import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
4
|
-
|
|
4
|
+
// extensions/discord/src/account-inspect.ts
|
|
5
5
|
function inspectDiscordAccountPrimary(params) {
|
|
6
6
|
return inspectDiscordAccountConfig(params, {
|
|
7
7
|
includeName: true,
|
|
@@ -27,5 +27,4 @@ function inspectDiscordAccount(params) {
|
|
|
27
27
|
})
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { inspectDiscordAccount as t };
|
|
@@ -6,7 +6,7 @@ import { resolveConfiguredFromCredentialStatuses } from "openclaw/plugin-sdk/cha
|
|
|
6
6
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, normalizeAccountId as normalizeAccountId$1, resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { getRuntimeConfigSnapshot, getRuntimeConfigSourceSnapshot, selectApplicableRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
9
|
-
|
|
9
|
+
// extensions/discord/src/account-token-inspect.ts
|
|
10
10
|
function inspectDiscordConfiguredToken(value) {
|
|
11
11
|
const credential = resolveSecretInputString({
|
|
12
12
|
value,
|
|
@@ -59,8 +59,7 @@ function resolveDiscordAccountAvailability(params) {
|
|
|
59
59
|
stateReason: duplicateOwner ? `duplicate bot token; using account "${duplicateOwner}"` : void 0
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
//#region extensions/discord/src/runtime-config.ts
|
|
62
|
+
// extensions/discord/src/runtime-config.ts
|
|
64
63
|
function selectDiscordRuntimeConfig(inputConfig) {
|
|
65
64
|
return selectApplicableRuntimeConfig({
|
|
66
65
|
inputConfig,
|
|
@@ -94,8 +93,7 @@ function selectDiscordActivitiesRuntimeConfig(inputConfig) {
|
|
|
94
93
|
}
|
|
95
94
|
};
|
|
96
95
|
}
|
|
97
|
-
|
|
98
|
-
//#region extensions/discord/src/token.ts
|
|
96
|
+
// extensions/discord/src/token.ts
|
|
99
97
|
function stripDiscordBotPrefix(token) {
|
|
100
98
|
return token.replace(/^Bot\s+/i, "");
|
|
101
99
|
}
|
|
@@ -162,8 +160,7 @@ function resolveDiscordToken(cfg, opts = {}) {
|
|
|
162
160
|
tokenStatus: "missing"
|
|
163
161
|
};
|
|
164
162
|
}
|
|
165
|
-
|
|
166
|
-
//#region extensions/discord/src/accounts.ts
|
|
163
|
+
// extensions/discord/src/accounts.ts
|
|
167
164
|
const { listAccountIds: listDiscordAccountIds, resolveDefaultAccountId: resolveDefaultDiscordAccountId, resolveAccountConfig: mergeDiscordAccountConfig } = createAccountListHelpers("discord", {
|
|
168
165
|
implicitDefaultAccount: {
|
|
169
166
|
channelKeys: ["token"],
|
|
@@ -271,5 +268,4 @@ function listDiscordStartupAccountIds(cfg) {
|
|
|
271
268
|
if (!startupAccountIds.includes(defaultAccountId)) return startupAccountIds;
|
|
272
269
|
return [defaultAccountId, ...startupAccountIds.filter((candidateId) => candidateId !== defaultAccountId)];
|
|
273
270
|
}
|
|
274
|
-
//#endregion
|
|
275
271
|
export { selectDiscordActivitiesRuntimeConfig as _, listDiscordStartupAccountIds as a, resolveDefaultDiscordAccountId as c, resolveDiscordAccountConfig as d, resolveDiscordAccountDisabledReason as f, resolveDiscordToken as g, normalizeDiscordToken as h, listDiscordAccountIds as i, resolveDiscordAccount as l, resolveDiscordMaxLinesPerMessage as m, inspectDiscordAccountConfig as n, listEnabledDiscordAccounts as o, resolveDiscordAccountDmPolicy as p, isDiscordAccountEnabledForRuntime as r, mergeDiscordAccountConfig as s, createDiscordActionGate as t, resolveDiscordAccountAllowFrom as u, resolveDiscordAccountAvailability as v };
|
package/dist/.setup/{active-turn-thread-route-KvRTAVE3.mjs → active-turn-thread-route-DkPnk2x8.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
|
|
2
|
+
// extensions/discord/src/active-turn-thread-route.ts
|
|
3
3
|
const activeRoutes = /* @__PURE__ */ new Map();
|
|
4
4
|
function beginDiscordActiveTurnThreadRoute(sessionKey, route) {
|
|
5
5
|
const key = normalizeOptionalString(sessionKey);
|
|
@@ -35,5 +35,4 @@ function notifyDiscordActiveTurnThreadReplyDelivered(params) {
|
|
|
35
35
|
route.onThreadReplyDelivered?.(threadId);
|
|
36
36
|
return true;
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { notifyDiscordActiveTurnThreadCreated as n, notifyDiscordActiveTurnThreadReplyDelivered as r, beginDiscordActiveTurnThreadRoute as t };
|
|
@@ -3,12 +3,11 @@ import { ChannelType } from "discord-api-types/v10";
|
|
|
3
3
|
import { asFiniteNumberInRange, parseStrictFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { buildChannelKeyCandidates, normalizeChannelSlug, resolveChannelEntryMatchWithFallback, resolveChannelMatchConfig } from "openclaw/plugin-sdk/channel-targets";
|
|
5
5
|
import { resolveAllowlistMatchByCandidates } from "openclaw/plugin-sdk/allow-from";
|
|
6
|
-
|
|
6
|
+
// extensions/discord/src/channel-type.ts
|
|
7
7
|
function isDiscordThreadChannelType(channelType) {
|
|
8
8
|
return channelType === ChannelType.AnnouncementThread || channelType === ChannelType.PublicThread || channelType === ChannelType.PrivateThread;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
//#region extensions/discord/src/retry-after.ts
|
|
10
|
+
// extensions/discord/src/retry-after.ts
|
|
12
11
|
const RETRY_AFTER_BODY_SECONDS_RE = /^(?:\d+\.?\d*|\.\d+)$/;
|
|
13
12
|
const MAX_SAFE_RETRY_AFTER_SECONDS = Number.MAX_SAFE_INTEGER / 1e3;
|
|
14
13
|
function parseDiscordRetryAfterBodySeconds(value) {
|
|
@@ -18,8 +17,7 @@ function parseDiscordRetryAfterBodySeconds(value) {
|
|
|
18
17
|
max: MAX_SAFE_RETRY_AFTER_SECONDS
|
|
19
18
|
});
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
//#region extensions/discord/src/monitor/format.ts
|
|
20
|
+
// extensions/discord/src/monitor/format.ts
|
|
23
21
|
function formatDiscordReactionEmoji(emoji) {
|
|
24
22
|
if (emoji.id && emoji.name) return `<:${emoji.name}:${emoji.id}>`;
|
|
25
23
|
if (emoji.id) return `emoji:${emoji.id}`;
|
|
@@ -30,8 +28,7 @@ function formatDiscordUserTag(user) {
|
|
|
30
28
|
if (discriminator && discriminator !== "0") return `${user.username}#${discriminator}`;
|
|
31
29
|
return user.username ?? user.id;
|
|
32
30
|
}
|
|
33
|
-
|
|
34
|
-
//#region extensions/discord/src/monitor/allow-list.ts
|
|
31
|
+
// extensions/discord/src/monitor/allow-list.ts
|
|
35
32
|
const DISCORD_OWNER_ALLOWLIST_PREFIXES = [
|
|
36
33
|
"discord:",
|
|
37
34
|
"user:",
|
|
@@ -69,7 +66,7 @@ function normalizeDiscordSlug(value) {
|
|
|
69
66
|
return normalizeChannelSlug(value);
|
|
70
67
|
}
|
|
71
68
|
function normalizeDiscordDisplaySlug(value) {
|
|
72
|
-
return normalizeLowercaseStringOrEmpty(value).normalize("NFC").replace(/^#/, "").replace(/[\s_]+/g, "-").replace(/[^\p{L}\p{M}\p{N}-]+/gu, "-").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "");
|
|
69
|
+
return normalizeLowercaseStringOrEmpty(value).normalize("NFC").replace(/[\uFE0E\uFE0F\u20E3]/g, "").replace(/^#/, "").replace(/[\s_]+/g, "-").replace(/[^\p{L}\p{M}\p{N}-]+/gu, "-").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "");
|
|
73
70
|
}
|
|
74
71
|
function allowListMatches(list, candidate, params) {
|
|
75
72
|
return resolveDiscordAllowListMatch({
|
|
@@ -311,5 +308,4 @@ function shouldEmitDiscordReactionNotification(params) {
|
|
|
311
308
|
if (mode === "own") return Boolean(params.botId && params.messageAuthorId === params.botId);
|
|
312
309
|
return false;
|
|
313
310
|
}
|
|
314
|
-
//#endregion
|
|
315
311
|
export { parseDiscordRetryAfterBodySeconds as C, formatDiscordUserTag as S, resolveDiscordOwnerAllowFrom as _, normalizeDiscordDisplaySlug as a, shouldEmitDiscordReactionNotification as b, resolveDiscordChannelConfig as c, resolveDiscordCommandAuthorized as d, resolveDiscordGuildEntry as f, resolveDiscordOwnerAccess as g, resolveDiscordMentionPolicy as h, normalizeDiscordAllowList as i, resolveDiscordChannelConfigWithFallback as l, resolveDiscordMemberAllowed as m, hasConfiguredDiscordChannels as n, normalizeDiscordSlug as o, resolveDiscordMemberAccessState as p, isDiscordGroupAllowedByPolicy as r, resolveDiscordAllowListMatch as s, allowListMatches as t, resolveDiscordChannelPolicyCommandAuthorizer as u, resolveDiscordShouldRequireMention as v, isDiscordThreadChannelType as w, formatDiscordReactionEmoji as x, resolveGroupDmAllow as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-
|
|
2
|
-
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-
|
|
1
|
+
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-CkqpzPvP.mjs";
|
|
2
|
+
import { n as getDiscordEndpointRuntime } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
3
3
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
4
4
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
5
5
|
import { captureChannelReadAuthority, captureEffectAuthority, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
@@ -8,7 +8,7 @@ import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
|
8
8
|
import { parseRetryAfterHeaderSeconds, resolveRetryConfig, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
9
9
|
import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
|
|
10
10
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
11
|
-
|
|
11
|
+
// extensions/discord/src/error-body.ts
|
|
12
12
|
const DISCORD_RESPONSE_BODY_SUMMARY_MAX_CHARS = 240;
|
|
13
13
|
function parseDiscordHttpErrorBody(raw) {
|
|
14
14
|
if (!raw) return;
|
|
@@ -29,8 +29,7 @@ function isDiscordHtmlResponseBody(body, contentType) {
|
|
|
29
29
|
function isDiscordRateLimitResponseBody(body) {
|
|
30
30
|
return /error 1015|cloudflare|rate limit/i.test(body);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
//#region extensions/discord/src/api.ts
|
|
32
|
+
// extensions/discord/src/api.ts
|
|
34
33
|
const DISCORD_API_BASE = "https://discord.com/api/v10";
|
|
35
34
|
const DISCORD_API_RETRY_DEFAULTS = {
|
|
36
35
|
attempts: 3,
|
|
@@ -152,5 +151,4 @@ async function fetchDiscord(path, token, fetcher = fetch, options) {
|
|
|
152
151
|
method: "GET"
|
|
153
152
|
});
|
|
154
153
|
}
|
|
155
|
-
//#endregion
|
|
156
154
|
export { isDiscordRateLimitResponseBody as a, requestDiscord as i, DiscordApiError as n, parseDiscordHttpErrorBody as o, fetchDiscord as r, summarizeDiscordResponseBody as s, DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS as t };
|
package/dist/.setup/{approval-handler.runtime-o2N6GRFH.mjs → approval-handler.runtime-DjtQbUPp.mjs}
RENAMED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as editChannelMessage, E as deleteChannelMessage, J as stripUndefinedFields, f as serializePayload, w as createChannelMessage, y as createUserDmChannel } from "./discord-
|
|
3
|
-
import {
|
|
4
|
-
import { r as colorToNumber } from "./components.base-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { u as createDiscordClient } from "./send.permissions-BvH_Dr8p.mjs";
|
|
2
|
+
import { D as editChannelMessage, E as deleteChannelMessage, J as stripUndefinedFields, f as serializePayload, w as createChannelMessage, y as createUserDmChannel } from "./discord-cXPUdHQi.mjs";
|
|
3
|
+
import { C as findGraphemeChunkEnd } from "./send.receipt-CZ7ks6g7.mjs";
|
|
4
|
+
import { r as colorToNumber } from "./components.base-C5sAPHe4.mjs";
|
|
5
|
+
import { y as createDiscordMessageNonce } from "./send.shared-D2lh737v.mjs";
|
|
6
|
+
import { a as DISCORD_APPROVAL_DECISIONS, o as buildExecApprovalCustomId } from "./shared-interactive-DKBw4SNV.mjs";
|
|
7
|
+
import { c as formatDiscordApprovalDisplayValue, k as isDiscordExecApprovalClientEnabled, s as DISCORD_APPROVAL_ALLOWED_MENTIONS } from "./outbound-session-route-G_fK5RAh.mjs";
|
|
8
|
+
import { r as shouldHandleDiscordApprovalRequest } from "./channel-Cihfaj84.mjs";
|
|
9
|
+
import { t as discordApprovalMessageUpdates } from "./approval-message-updates-DqOXxPss.mjs";
|
|
9
10
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
11
|
import { ButtonStyle, ComponentType } from "discord-api-types/v10";
|
|
11
12
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
12
13
|
import { formatChannelApprovalResolvedLabel } from "openclaw/plugin-sdk/approval-runtime";
|
|
13
14
|
import { createChannelApprovalNativeRuntimeAdapterAsync } from "openclaw/plugin-sdk/approval-handler-runtime";
|
|
14
|
-
|
|
15
|
+
// extensions/discord/src/approval-handler.runtime.ts
|
|
15
16
|
function resolveHandlerContext(params) {
|
|
16
17
|
const context = params.context;
|
|
17
18
|
const accountId = normalizeOptionalString(params.accountId) ?? "";
|
|
@@ -255,5 +256,4 @@ const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapterAs
|
|
|
255
256
|
}
|
|
256
257
|
}
|
|
257
258
|
});
|
|
258
|
-
//#endregion
|
|
259
259
|
export { discordApprovalNativeRuntime };
|
package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as parseCustomId } from "./components.base-
|
|
2
|
-
import { s as parseExecApprovalData } from "./shared-interactive-
|
|
1
|
+
import { i as parseCustomId } from "./components.base-C5sAPHe4.mjs";
|
|
2
|
+
import { s as parseExecApprovalData } from "./shared-interactive-DKBw4SNV.mjs";
|
|
3
3
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
4
|
-
|
|
4
|
+
// extensions/discord/src/approval-message-updates.ts
|
|
5
5
|
const discordApprovalMessageUpdates = new KeyedAsyncQueue();
|
|
6
6
|
/** Read the current control identity, rather than reconstructing delivery ownership. */
|
|
7
7
|
function hasDiscordApprovalControl(message, approval) {
|
|
@@ -13,5 +13,4 @@ function hasDiscordApprovalControl(message, approval) {
|
|
|
13
13
|
}
|
|
14
14
|
return "components" in message && Array.isArray(message.components) && message.components.some((component) => hasDiscordApprovalControl(component, approval));
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { hasDiscordApprovalControl as n, discordApprovalMessageUpdates as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import {
|
|
4
|
-
import "./send-
|
|
5
|
-
import { T as collectDiscordAuditChannelIdsForAccount, w as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-
|
|
6
|
-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-CSz5Qodj.mjs";
|
|
3
|
+
import { i as fetchChannelPermissionsDiscord } from "./send.permissions-BvH_Dr8p.mjs";
|
|
4
|
+
import "./send-DKzwsZkm.mjs";
|
|
5
|
+
import { T as collectDiscordAuditChannelIdsForAccount, w as auditDiscordChannelPermissionsWithFetcher } from "./outbound-session-route-G_fK5RAh.mjs";
|
|
6
|
+
// extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
|
|
9
9
|
collectDiscordAuditChannelIds: () => collectDiscordAuditChannelIds
|
|
@@ -18,5 +18,4 @@ async function auditDiscordChannelPermissions(params) {
|
|
|
18
18
|
fetchChannelPermissions: fetchChannelPermissionsDiscord
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { audit_exports as n, collectDiscordAuditChannelIds as r, auditDiscordChannelPermissions as t };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
2
|
-
import { q as withDiscordRequestAuthority } from "./discord-
|
|
3
|
-
import { c as normalizeDiscordMessagingTarget, o as looksLikeDiscordTargetId, s as matchesDiscordToolContextTarget } from "./send.receipt-
|
|
4
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
5
|
-
import { l as withAbortTimeout } from "./timeouts-
|
|
6
|
-
import { t as getDiscordRuntime } from "./runtime-
|
|
7
|
-
import { A as shouldSuppressLocalDiscordExecApprovalPrompt, D as getDiscordExecApprovalApprovers, E as resolveRequiredDiscordChannelPermissions, O as isDiscordExecApprovalApprover, b as discordMessageActions, k as isDiscordExecApprovalClientEnabled, l as resolveDiscordGroupRequireMention, m as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, u as resolveDiscordGroupToolPolicy, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-
|
|
8
|
-
import { a as resolveDiscordInboundConversation, i as resolveDiscordCommandConversation, n as discordOutbound, r as resolveDiscordAttachedOutboundTarget } from "./outbound-payload-
|
|
9
|
-
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-
|
|
10
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
11
|
-
import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
12
|
-
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-
|
|
13
|
-
import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
14
|
-
import { t as defaultTopLevelPlacement } from "./thread-binding-api-
|
|
1
|
+
import { a as listDiscordStartupAccountIds, c as resolveDefaultDiscordAccountId, d as resolveDiscordAccountConfig, i as listDiscordAccountIds, l as resolveDiscordAccount, u as resolveDiscordAccountAllowFrom } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { q as withDiscordRequestAuthority } from "./discord-cXPUdHQi.mjs";
|
|
3
|
+
import { c as normalizeDiscordMessagingTarget, d as normalizeDiscordSnowflake, o as looksLikeDiscordTargetId, s as matchesDiscordToolContextTarget } from "./send.receipt-CZ7ks6g7.mjs";
|
|
4
|
+
import { t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
5
|
+
import { l as withAbortTimeout } from "./timeouts-CT9hnmo4.mjs";
|
|
6
|
+
import { t as getDiscordRuntime } from "./runtime-DcBvHOm1.mjs";
|
|
7
|
+
import { A as shouldSuppressLocalDiscordExecApprovalPrompt, D as getDiscordExecApprovalApprovers, E as resolveRequiredDiscordChannelPermissions, O as isDiscordExecApprovalApprover, b as discordMessageActions, k as isDiscordExecApprovalClientEnabled, l as resolveDiscordGroupRequireMention, m as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, u as resolveDiscordGroupToolPolicy, y as resolveDiscordRuntimeBindingConversationId } from "./outbound-session-route-G_fK5RAh.mjs";
|
|
8
|
+
import { a as resolveDiscordInboundConversation, i as resolveDiscordCommandConversation, n as discordOutbound, r as resolveDiscordAttachedOutboundTarget } from "./outbound-payload-Dh6xCO6z.mjs";
|
|
9
|
+
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DPWiBMks.mjs";
|
|
10
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-CAaWWJdQ.mjs";
|
|
11
|
+
import { i as discordSecurityAdapter, n as discordConfigAdapter, r as discordSetupContract, t as createDiscordPluginBase } from "./shared-Bf7ifHlc.mjs";
|
|
12
|
+
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-Cfvze5hd.mjs";
|
|
13
|
+
import { i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-BPO6pPzd.mjs";
|
|
14
|
+
import { t as defaultTopLevelPlacement } from "./thread-binding-api-Drd4Zu-5.mjs";
|
|
15
15
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
16
16
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
17
17
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -32,7 +32,7 @@ import { createLazyChannelApprovalNativeRuntimeAdapterAsync } from "openclaw/plu
|
|
|
32
32
|
import { createChannelApproverDmTargetResolverAsync, createChannelNativeOriginTargetResolverAsync, doesApprovalRequestSelectChannelAccountAsync, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
33
33
|
import { isChannelExecApprovalClientEnabledFromConfig, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
|
|
34
34
|
import { resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
|
|
35
|
-
|
|
35
|
+
// extensions/discord/src/approval-shared.ts
|
|
36
36
|
function isDiscordApprovalAccountEligible(params) {
|
|
37
37
|
const account = resolveDiscordAccount(params);
|
|
38
38
|
const config = params.configOverride ?? account.config.execApprovals;
|
|
@@ -57,8 +57,7 @@ async function shouldHandleDiscordApprovalRequest(params) {
|
|
|
57
57
|
}) ? [accountId] : []
|
|
58
58
|
}) && isDiscordApprovalAccountEligible(params);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
//#region extensions/discord/src/approval-native.ts
|
|
60
|
+
// extensions/discord/src/approval-native.ts
|
|
62
61
|
function extractDiscordSessionKind(sessionKey) {
|
|
63
62
|
if (!sessionKey) return null;
|
|
64
63
|
const raw = sessionKey.match(/discord:(?:[^:]+:)?(channel|group|dm|direct):/)?.[1];
|
|
@@ -162,30 +161,29 @@ function getDiscordApprovalCapability() {
|
|
|
162
161
|
accountId
|
|
163
162
|
}),
|
|
164
163
|
shouldHandle: shouldHandleDiscordApprovalRequest,
|
|
165
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
164
|
+
load: async () => (await import("./approval-handler.runtime-DjtQbUPp.mjs")).discordApprovalNativeRuntime
|
|
166
165
|
})
|
|
167
166
|
});
|
|
168
167
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
176
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
177
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-
|
|
168
|
+
// extensions/discord/src/channel.loaders.ts
|
|
169
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-BXJuh9-J.mjs").then((n) => n.t));
|
|
170
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-BNnyfCR8.mjs").then((n) => n.n));
|
|
171
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-CDMAGrzv.mjs").then((n) => n.n));
|
|
172
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-6EnH3YZh.mjs").then((n) => n.r));
|
|
173
|
+
const loadDiscordConversationForkModule = createLazyRuntimeModule(() => import("./conversation-fork-B6PiUuln.mjs"));
|
|
174
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-48znkzky.mjs").then((n) => n.r));
|
|
175
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-BoSMAwDb.mjs"));
|
|
176
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe-CfGMZwFD.mjs").then((n) => n.o));
|
|
178
177
|
async function probeDiscordStatusAccount(params) {
|
|
179
178
|
const startedAtMs = Date.now();
|
|
180
179
|
const runtime = await loadDiscordProbeRuntime();
|
|
181
180
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
182
181
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
183
182
|
}
|
|
184
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
185
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
186
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
187
|
-
|
|
188
|
-
//#region extensions/discord/src/conversation-route-owner.ts
|
|
183
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-B9vk3V2z.mjs").then((n) => n.n));
|
|
184
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-DKzwsZkm.mjs").then((n) => n.t));
|
|
185
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-B9UoQG9g.mjs").then((n) => n.t));
|
|
186
|
+
// extensions/discord/src/conversation-route-owner.ts
|
|
189
187
|
async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBindings) {
|
|
190
188
|
const prepared = inputs.map((params) => {
|
|
191
189
|
const accountId = normalizeAccountId(params.accountId);
|
|
@@ -257,8 +255,7 @@ async function prepareDiscordConversationRouteOwnersAsync(inputs, inspectBinding
|
|
|
257
255
|
return () => item.resolve(inspect()[position]);
|
|
258
256
|
});
|
|
259
257
|
}
|
|
260
|
-
|
|
261
|
-
//#region extensions/discord/src/status-issues.ts
|
|
258
|
+
// extensions/discord/src/status-issues.ts
|
|
262
259
|
function isDiscordMessageContentIntentDisabled(value) {
|
|
263
260
|
return isRecord$1(value) && isRecord$1(value.intents) && value.intents.messageContent === "disabled";
|
|
264
261
|
}
|
|
@@ -316,8 +313,7 @@ function collectDiscordStatusIssues(accounts) {
|
|
|
316
313
|
}
|
|
317
314
|
return issues;
|
|
318
315
|
}
|
|
319
|
-
|
|
320
|
-
//#region extensions/discord/src/thread-bindings-channel.ts
|
|
316
|
+
// extensions/discord/src/thread-bindings-channel.ts
|
|
321
317
|
function toConversationLifecycleBinding(binding) {
|
|
322
318
|
return {
|
|
323
319
|
boundAt: binding.boundAt,
|
|
@@ -327,6 +323,7 @@ function toConversationLifecycleBinding(binding) {
|
|
|
327
323
|
};
|
|
328
324
|
}
|
|
329
325
|
const discordConversationBindings = {
|
|
326
|
+
prepareFork: async (params) => (await loadDiscordConversationForkModule()).prepareDiscordConversationFork(params),
|
|
330
327
|
supportsCurrentConversationBinding: true,
|
|
331
328
|
bindingStore: "adapter",
|
|
332
329
|
defaultTopLevelPlacement,
|
|
@@ -353,8 +350,7 @@ const discordConversationBindings = {
|
|
|
353
350
|
accountId: params.accountId ?? void 0
|
|
354
351
|
})).map(toConversationLifecycleBinding)
|
|
355
352
|
};
|
|
356
|
-
|
|
357
|
-
//#region extensions/discord/src/channel.ts
|
|
353
|
+
// extensions/discord/src/channel.ts
|
|
358
354
|
const DISCORD_ACCOUNT_STARTUP_STAGGER_MS = 1e4;
|
|
359
355
|
const discordMessageAdapter = createChannelMessageAdapterFromOutbound({
|
|
360
356
|
id: "discord",
|
|
@@ -408,6 +404,7 @@ const discordPluginBase = createDiscordPluginBase({ setupContract: discordSetupC
|
|
|
408
404
|
const discordPlugin = createChatChannelPlugin({
|
|
409
405
|
base: {
|
|
410
406
|
...discordPluginBase,
|
|
407
|
+
identityLink: { prepare: async (cfg, accountId) => (await import("./identity-link-B7KOBo_l.mjs")).discordIdentityLink.prepare(cfg, accountId) },
|
|
411
408
|
allowlist: {
|
|
412
409
|
...buildLegacyDmAccountAllowlistAdapter({
|
|
413
410
|
channelId: "discord",
|
|
@@ -813,10 +810,11 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
813
810
|
currentChannelId: nativeChannelId ? normalizeDiscordMessagingTarget(nativeChannelId) : currentMessagingTarget,
|
|
814
811
|
currentChatType,
|
|
815
812
|
currentMessagingTarget,
|
|
816
|
-
currentMessageId: context.CurrentMessageId,
|
|
813
|
+
currentMessageId: normalizeDiscordSnowflake(context.CurrentMessageId ?? "") ?? void 0,
|
|
817
814
|
hasRepliedRef
|
|
818
815
|
};
|
|
819
|
-
}
|
|
816
|
+
},
|
|
817
|
+
resolveReplyTransport: ({ replyToId }) => replyToId && !normalizeDiscordSnowflake(replyToId) ? { replyToId: null } : null
|
|
820
818
|
},
|
|
821
819
|
outbound: {
|
|
822
820
|
...discordOutbound,
|
|
@@ -825,5 +823,4 @@ const discordPlugin = createChatChannelPlugin({
|
|
|
825
823
|
shouldSuppressLocalPayloadPrompt: shouldSuppressLocalDiscordExecApprovalPrompt
|
|
826
824
|
}
|
|
827
825
|
});
|
|
828
|
-
//#endregion
|
|
829
826
|
export { collectDiscordStatusIssues as n, shouldHandleDiscordApprovalRequest as r, discordPlugin as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { asOptionalObjectRecord, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
|
|
2
|
+
// extensions/discord/src/monitor/channel-access.ts
|
|
3
3
|
function resolveDiscordChannelNameSafe(channel) {
|
|
4
4
|
return readStringField(asOptionalObjectRecord(channel), "name");
|
|
5
5
|
}
|
|
@@ -20,5 +20,4 @@ function resolveDiscordChannelInfoSafe(channel) {
|
|
|
20
20
|
parentName: readStringField(asOptionalObjectRecord(record?.parent), "name")
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { resolveDiscordChannelNameSafe as n, resolveDiscordChannelTopicSafe as r, resolveDiscordChannelInfoSafe as t };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { c as resolveDefaultDiscordAccountId, g as resolveDiscordToken, n as inspectDiscordAccountConfig, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
2
|
-
import { r as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
3
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
4
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { c as resolveDefaultDiscordAccountId, g as resolveDiscordToken, n as inspectDiscordAccountConfig, s as mergeDiscordAccountConfig, u as resolveDiscordAccountAllowFrom } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { r as discordSetupContract, t as createDiscordPluginBase } from "./shared-Bf7ifHlc.mjs";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BNnyfCR8.mjs";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-CDMAGrzv.mjs";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
8
8
|
import { createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createSetupTranslator, createStandardChannelSetupStatus, defineTokenCredential, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptResolvedAllowFrom, resolveEntriesWithOptionalToken, resolveSetupAccountId, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup-runtime";
|
|
9
9
|
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
10
10
|
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
11
|
-
|
|
11
|
+
// extensions/discord/src/setup-account-state.ts
|
|
12
12
|
function resolveDiscordSetupAccountConfig(params) {
|
|
13
13
|
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultDiscordAccountId(params.cfg));
|
|
14
14
|
return {
|
|
@@ -19,8 +19,7 @@ function resolveDiscordSetupAccountConfig(params) {
|
|
|
19
19
|
function inspectDiscordSetupAccount(params) {
|
|
20
20
|
return inspectDiscordAccountConfig(params, { resolveFallbackToken: (accountId) => resolveDiscordToken(params.cfg, { accountId }) });
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
//#region extensions/discord/src/setup-core.ts
|
|
22
|
+
// extensions/discord/src/setup-core.ts
|
|
24
23
|
const t = createSetupTranslator();
|
|
25
24
|
const channel = "discord";
|
|
26
25
|
const DISCORD_TOKEN_HELP_LINES = [
|
|
@@ -228,11 +227,9 @@ const discordSetupWizard = {
|
|
|
228
227
|
dmPolicy: discordDmPolicy,
|
|
229
228
|
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
|
|
230
229
|
};
|
|
231
|
-
|
|
232
|
-
//#region extensions/discord/src/channel.setup.ts
|
|
230
|
+
// extensions/discord/src/channel.setup.ts
|
|
233
231
|
const discordSetupPlugin = { ...createDiscordPluginBase({
|
|
234
232
|
setupWizard: discordSetupWizard,
|
|
235
233
|
setupContract: discordSetupContract
|
|
236
234
|
}) };
|
|
237
|
-
//#endregion
|
|
238
235
|
export { discordSetupPlugin as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// extensions/discord/src/command-deploy-store.ts
|
|
2
2
|
const DISCORD_COMMAND_DEPLOY_HASH_NAMESPACE = "command-deploy-hashes";
|
|
3
3
|
const DISCORD_COMMAND_DEPLOY_HASH_MAX_ENTRIES = 1e4;
|
|
4
4
|
function openDiscordCommandDeployHashStore(openKeyedStore) {
|
|
@@ -8,5 +8,4 @@ function openDiscordCommandDeployHashStore(openKeyedStore) {
|
|
|
8
8
|
overflowPolicy: "evict-oldest"
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { DISCORD_COMMAND_DEPLOY_HASH_NAMESPACE as n, openDiscordCommandDeployHashStore as r, DISCORD_COMMAND_DEPLOY_HASH_MAX_ENTRIES as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// extensions/discord/src/command-owners.ts
|
|
2
2
|
function resolveDiscordCommandOwnerEntries(cfg) {
|
|
3
3
|
const entries = (cfg.commands?.ownerAllowFrom ?? []).map((entry) => String(entry).trim()).filter((entry) => entry && (/^(discord|user|pk):/i.test(entry) || !entry.includes(":")));
|
|
4
4
|
return entries.length > 0 ? entries : void 0;
|
|
@@ -6,5 +6,4 @@ function resolveDiscordCommandOwnerEntries(cfg) {
|
|
|
6
6
|
function resolveDiscordCommandOwnerAllowFrom(cfg) {
|
|
7
7
|
return resolveDiscordCommandOwnerEntries(cfg)?.map((entry) => entry.replace(/^discord:/i, "").trim()).filter(Boolean);
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { resolveDiscordCommandOwnerEntries as n, resolveDiscordCommandOwnerAllowFrom as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { J as stripUndefinedFields, a as Label, c as TextInput, i as CheckboxGroup, o as Modal, s as RadioGroup, u as asSerializableComponent } from "./discord-
|
|
3
|
-
import { i as parseCustomId, r as colorToNumber, t as BaseMessageInteractiveComponent } from "./components.base-
|
|
4
|
-
import { _ as parseDiscordModalCustomId, c as DISCORD_COMPONENT_CUSTOM_ID_KEY, d as buildDiscordComponentCustomId, f as buildDiscordModalCustomId, g as parseDiscordComponentCustomIdForInteraction, h as parseDiscordComponentCustomId, l as DISCORD_MODAL_CUSTOM_ID_KEY, t as buildDiscordInteractiveComponents, v as parseDiscordModalCustomIdForInteraction } from "./shared-interactive-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { J as stripUndefinedFields, a as Label, c as TextInput, i as CheckboxGroup, o as Modal, s as RadioGroup, u as asSerializableComponent } from "./discord-cXPUdHQi.mjs";
|
|
3
|
+
import { i as parseCustomId, r as colorToNumber, t as BaseMessageInteractiveComponent } from "./components.base-C5sAPHe4.mjs";
|
|
4
|
+
import { _ as parseDiscordModalCustomId, c as DISCORD_COMPONENT_CUSTOM_ID_KEY, d as buildDiscordComponentCustomId, f as buildDiscordModalCustomId, g as parseDiscordComponentCustomIdForInteraction, h as parseDiscordComponentCustomId, l as DISCORD_MODAL_CUSTOM_ID_KEY, t as buildDiscordInteractiveComponents, v as parseDiscordModalCustomIdForInteraction } from "./shared-interactive-DKBw4SNV.mjs";
|
|
5
5
|
import { asBoolean, asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { ButtonStyle, ComponentType, MessageFlags, TextInputStyle } from "discord-api-types/v10";
|
|
7
7
|
import crypto from "node:crypto";
|
|
8
|
-
|
|
8
|
+
// extensions/discord/src/components.types.ts
|
|
9
9
|
const DISCORD_COMPONENT_SELECT_TYPES = [
|
|
10
10
|
"string",
|
|
11
11
|
"user",
|
|
@@ -13,8 +13,7 @@ const DISCORD_COMPONENT_SELECT_TYPES = [
|
|
|
13
13
|
"mentionable",
|
|
14
14
|
"channel"
|
|
15
15
|
];
|
|
16
|
-
|
|
17
|
-
//#region extensions/discord/src/components.parse.ts
|
|
16
|
+
// extensions/discord/src/components.parse.ts
|
|
18
17
|
const DISCORD_COMPONENT_ATTACHMENT_PREFIX = "attachment://";
|
|
19
18
|
const BLOCK_ALIASES = /* @__PURE__ */ new Map([["row", "actions"], ["action-row", "actions"]]);
|
|
20
19
|
function requireObject(value, label) {
|
|
@@ -307,8 +306,7 @@ function readDiscordComponentSpec(raw) {
|
|
|
307
306
|
modal
|
|
308
307
|
};
|
|
309
308
|
}
|
|
310
|
-
|
|
311
|
-
//#region extensions/discord/src/components.builders.ts
|
|
309
|
+
// extensions/discord/src/components.builders.ts
|
|
312
310
|
function createShortId(prefix) {
|
|
313
311
|
return `${prefix}${crypto.randomBytes(6).toString("base64url")}`;
|
|
314
312
|
}
|
|
@@ -553,8 +551,7 @@ function buildDiscordComponentMessage(params) {
|
|
|
553
551
|
function buildDiscordComponentMessageFlags(components) {
|
|
554
552
|
return components.some((component) => component.isV2) ? MessageFlags.IsComponentsV2 : void 0;
|
|
555
553
|
}
|
|
556
|
-
|
|
557
|
-
//#region extensions/discord/src/internal/components.message.ts
|
|
554
|
+
// extensions/discord/src/internal/components.message.ts
|
|
558
555
|
var AnySelectMenu = class extends BaseMessageInteractiveComponent {
|
|
559
556
|
constructor(..._args) {
|
|
560
557
|
super(..._args);
|
|
@@ -607,8 +604,7 @@ var RoleSelectMenu = class extends AnySelectMenu {
|
|
|
607
604
|
this.type = ComponentType.RoleSelect;
|
|
608
605
|
}
|
|
609
606
|
};
|
|
610
|
-
|
|
611
|
-
//#region extensions/discord/src/components.modal.ts
|
|
607
|
+
// extensions/discord/src/components.modal.ts
|
|
612
608
|
function createModalFieldComponent(field) {
|
|
613
609
|
if (field.type === "text") {
|
|
614
610
|
class DynamicTextInput extends TextInput {
|
|
@@ -697,8 +693,7 @@ function createDiscordFormModal(entry) {
|
|
|
697
693
|
fields: entry.fields
|
|
698
694
|
});
|
|
699
695
|
}
|
|
700
|
-
|
|
701
|
-
//#region extensions/discord/src/components.ts
|
|
696
|
+
// extensions/discord/src/components.ts
|
|
702
697
|
var components_exports = /* @__PURE__ */ __exportAll({
|
|
703
698
|
DISCORD_COMPONENT_ATTACHMENT_PREFIX: () => DISCORD_COMPONENT_ATTACHMENT_PREFIX,
|
|
704
699
|
DISCORD_COMPONENT_CUSTOM_ID_KEY: () => DISCORD_COMPONENT_CUSTOM_ID_KEY,
|
|
@@ -726,5 +721,4 @@ function formatDiscordComponentEventText(params) {
|
|
|
726
721
|
if (values.length === 0) return `Updated "${params.label}".`;
|
|
727
722
|
return `Selected ${values.join(", ")} from "${params.label}".`;
|
|
728
723
|
}
|
|
729
|
-
//#endregion
|
|
730
724
|
export { buildDiscordComponentMessage as a, coerceDiscordComponentParam as c, createDiscordFormModal as i, readDiscordComponentSpec as l, formatDiscordComponentEventText as n, buildDiscordComponentMessageFlags as o, DiscordFormModal as r, DISCORD_COMPONENT_ATTACHMENT_PREFIX as s, components_exports as t, resolveDiscordComponentAttachmentName as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// extensions/discord/src/internal/components.base.ts
|
|
2
2
|
function parseCustomId(id) {
|
|
3
3
|
const [rawKey = "", ...parts] = id.split(";");
|
|
4
4
|
const [keyPart = "", firstValue] = rawKey.split("=");
|
|
@@ -28,5 +28,4 @@ var BaseComponent = class {
|
|
|
28
28
|
};
|
|
29
29
|
var BaseMessageInteractiveComponent = class {};
|
|
30
30
|
var BaseModalComponent = class extends BaseComponent {};
|
|
31
|
-
//#endregion
|
|
32
31
|
export { parseCustomId as i, BaseModalComponent as n, colorToNumber as r, BaseMessageInteractiveComponent as t };
|