@openclaw/discord 2026.10.2 → 2026.10.5-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/dist/.setup/account-inspect-8cCu6uPG.mjs +31 -0
- package/dist/.setup/{accounts-HE9-mj1L.mjs → accounts-ljrzXBJi.mjs} +47 -45
- package/dist/.setup/{allow-list-vxkG9_JD.mjs → allow-list-B_ToXtew.mjs} +34 -101
- package/dist/.setup/{api-DlNUkDqj.mjs → api-CtmE1OUN.mjs} +25 -31
- package/dist/.setup/{approval-handler.runtime-DmnEa54W.mjs → approval-handler.runtime-D7FoZSn0.mjs} +30 -53
- package/dist/.setup/{approval-message-updates-B0jdSqOj.mjs → approval-message-updates-CIGByUcE.mjs} +2 -2
- package/dist/.setup/{audit-BpikUwN_.mjs → audit-zSawfbsN.mjs} +5 -8
- package/dist/.setup/{channel-Dr-AUnGt.mjs → channel-DI7DMzu0.mjs} +136 -215
- package/dist/.setup/{channel-access-BRp3Y-rF.mjs → channel-access-DasWY_OV.mjs} +6 -7
- package/dist/.setup/{channel.setup-BmNvkidb.mjs → channel.setup-DdFVN1mr.mjs} +35 -64
- package/dist/.setup/{components-DLJR0xU-.mjs → components-HN9052L1.mjs} +123 -146
- package/dist/.setup/{config-schema-BQWfnSCx.mjs → config-schema-_uBILpQf.mjs} +7 -3
- package/dist/.setup/{conversation-binding-route-DicJC1Lj.mjs → conversation-binding-route-DTjCBx-O.mjs} +1 -1
- package/dist/.setup/{directory-config-gqsdcplU.mjs → directory-config-3iVub-3m.mjs} +1 -1
- package/dist/.setup/{directory-live-Bipr0eUJ.mjs → directory-live-DLygQVtW.mjs} +18 -22
- package/dist/.setup/{discord-9gysrhzp.mjs → discord-BGqgx-yd.mjs} +686 -854
- package/dist/.setup/{doctor-B2bskDcF.mjs → doctor-DSrNJ7m2.mjs} +36 -47
- package/dist/.setup/{doctor-contract-Bg3NPAMw.mjs → doctor-contract-Bwv8EuQ_.mjs} +7 -16
- package/dist/.setup/{handle-action-UmkjXBfo.mjs → handle-action-CXH1h1tq.mjs} +25 -38
- package/dist/.setup/{handle-action.guild-admin-CB4sc9VV.mjs → handle-action.guild-admin-CHKW6PIs.mjs} +25 -31
- package/dist/.setup/{live-policy-config-VxexfRKo.mjs → live-policy-config-BPoB3eQi.mjs} +1 -1
- package/dist/.setup/{message-handler-BK69A-NB.mjs → message-handler-Ii_etru1.mjs} +9 -14
- package/dist/.setup/{message-handler.preflight-DFpsh90H.mjs → message-handler.preflight-C7YuSRl_.mjs} +79 -128
- package/dist/.setup/{message-handler.preflight-pluralkit-BXGGVmpe.mjs → message-handler.preflight-pluralkit-C3iAG--b.mjs} +6 -6
- package/dist/.setup/{message-handler.process-TKoqcqIP.mjs → message-handler.process-ClgWYH6o.mjs} +234 -206
- package/dist/.setup/{outbound-adapter-D4wRAb5S.mjs → outbound-adapter-D8OOIuKn.mjs} +73 -112
- package/dist/.setup/{outbound-session-route-BvBH4LC6.mjs → outbound-session-route-B0Hpwn3Q.mjs} +57 -115
- package/dist/.setup/output-activity-uBpMSX75.mjs +11 -0
- package/dist/.setup/{pluralkit-a6_NLfH9.mjs → pluralkit-B64dfq_j.mjs} +3 -1
- package/dist/.setup/{preflight-audio-DHGIHEpv.mjs → preflight-audio-wWgsZG5F.mjs} +1 -5
- package/dist/.setup/{presence-cache-Dg3_dADn.mjs → presence-cache-DCeTsL73.mjs} +3 -6
- package/dist/.setup/{probe-BwSKpnZf.mjs → probe-D3P1x4aN.mjs} +10 -18
- package/dist/.setup/{provider-YP8gN9_o.mjs → provider-D9EzOfG8.mjs} +2990 -3903
- package/dist/.setup/{provider-session.runtime-D1gkPxHT.mjs → provider-session.runtime-CsnRvddI.mjs} +5 -5
- package/dist/.setup/provider.runtime-BQVcM7Pg.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-BKUQBy1u.mjs → realtime-session.runtime-CxGBk8H-.mjs} +69 -98
- package/dist/.setup/{receive-recovery-DgkX7Qvi.mjs → receive-recovery-eVmK2_hl.mjs} +2 -12
- package/dist/.setup/resolve-allowlist-common-DNSsUQRF.mjs +66 -0
- package/dist/.setup/resolve-channels-UdT38DzU.mjs +173 -0
- package/dist/.setup/{resolve-users-DNrwvunm.mjs → resolve-users-DnCsrXZ_.mjs} +12 -41
- package/dist/.setup/{runtime-CESTexGn.mjs → runtime-CRTkKU1G.mjs} +202 -313
- package/dist/.setup/{runtime-DPcmPST9.mjs → runtime-DPm3gZXk.mjs} +2 -2
- package/dist/.setup/{secret-config-contract-uOE2J7yM.mjs → secret-config-contract-CIsH7R3B.mjs} +9 -18
- package/dist/.setup/{security-audit-D42cp5N7.mjs → security-audit-BFT84Uny.mjs} +1 -2
- package/dist/.setup/security-contract-DNyyjTZZ.mjs +19 -0
- package/dist/.setup/{send-CJk3VP5q.mjs → send-DbILKgcm.mjs} +184 -241
- package/dist/.setup/{send.components-dPljuV24.mjs → send.components-FxOS3CeP.mjs} +47 -63
- package/dist/.setup/{send.outbound-rOboMO_6.mjs → send.outbound-_jx4Xpd3.mjs} +178 -202
- package/dist/.setup/{send.receipt-DVOg2Oaw.mjs → send.receipt-BAlzXd8e.mjs} +33 -109
- package/dist/.setup/{send.shared-C4CN24D9.mjs → send.shared-CjQ4jbMA.mjs} +97 -153
- package/dist/.setup/{sender-identity-AHpUNr72.mjs → sender-identity-BNBvGt1l.mjs} +1 -1
- package/dist/.setup/setup-plugin-api-xfOFmxHP.mjs +3 -0
- package/dist/.setup/{shared-BoBnM5kM.mjs → shared-CestGDpq.mjs} +30 -20
- package/dist/.setup/{subagent-hooks-HH8Uy9cx.mjs → subagent-hooks-CME7dSGf.mjs} +5 -10
- package/dist/.setup/{system-events-Cwxaww8i.mjs → system-events-BwwSDCw4.mjs} +2 -2
- package/dist/.setup/target-parsing-C-HyNxcE.mjs +48 -0
- package/dist/.setup/{target-resolver-CSFoPQ12.mjs → target-resolver-Bse8fuTi.mjs} +11 -27
- package/dist/.setup/targets-DZJjkzwv.mjs +3 -0
- package/dist/.setup/{thread-bindings-DjQCkmsd.mjs → thread-bindings-0hPTSK14.mjs} +61 -52
- package/dist/.setup/{thread-bindings.manager-D2-GYZ5s.mjs → thread-bindings.manager-CdNa6UIs.mjs} +138 -211
- package/dist/.setup/{thread-bindings.session-updates-Bu_CGr_O.mjs → thread-bindings.session-updates-DGSljVf6.mjs} +60 -99
- package/dist/.setup/threading-BKe3E3tp.mjs +246 -0
- package/dist/.setup/{timeouts-pun7VJ02.mjs → timeouts-CuNARfyw.mjs} +10 -18
- package/dist/.setup/{transcripts-source-CaZQnGRH.mjs → transcripts-source-0qQYVu2H.mjs} +50 -368
- package/dist/.setup/{voice-runtime-DDymtIw8.mjs → voice-runtime-QlZJ4sHv.mjs} +166 -322
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +77 -120
- package/dist/api.js +19 -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 +1 -1
- package/dist/runtime-api.js +21 -20
- 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/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +38 -57
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@types/node/dgram.d.ts +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/zlib.d.ts +6 -0
- package/node_modules/@types/ws/README.md +1 -1
- package/node_modules/@types/ws/index.d.mts +4 -0
- package/node_modules/@types/ws/index.d.ts +4 -0
- package/node_modules/@types/ws/package.json +3 -3
- package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts +21 -0
- package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts.map +1 -1
- package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts +21 -0
- package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts.map +1 -1
- package/node_modules/discord-api-types/globals.d.ts +6 -0
- package/node_modules/discord-api-types/globals.d.ts.map +1 -1
- package/node_modules/discord-api-types/globals.js +6 -0
- package/node_modules/discord-api-types/globals.js.map +1 -1
- package/node_modules/discord-api-types/package.json +3 -3
- package/node_modules/discord-api-types/payloads/index.mjs +1 -0
- package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts +207 -0
- package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts.map +1 -0
- package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js +25 -0
- package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js.map +1 -0
- package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts +1 -1
- package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/guild.d.ts +27 -23
- package/node_modules/discord-api-types/payloads/v10/guild.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/guild.js +26 -22
- package/node_modules/discord-api-types/payloads/v10/guild.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/index.d.ts +1 -0
- package/node_modules/discord-api-types/payloads/v10/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/index.js +1 -0
- package/node_modules/discord-api-types/payloads/v10/index.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/index.mjs +1 -0
- package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts +207 -0
- package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts.map +1 -0
- package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js +25 -0
- package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js.map +1 -0
- package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts +1 -1
- package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/guild.d.ts +27 -23
- package/node_modules/discord-api-types/payloads/v9/guild.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/guild.js +26 -22
- package/node_modules/discord-api-types/payloads/v9/guild.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/index.d.ts +1 -0
- package/node_modules/discord-api-types/payloads/v9/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/index.js +1 -0
- package/node_modules/discord-api-types/payloads/v9/index.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/index.mjs +1 -0
- package/node_modules/discord-api-types/rest/common.d.ts +2 -0
- package/node_modules/discord-api-types/rest/common.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/common.js +2 -0
- package/node_modules/discord-api-types/rest/common.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts +70 -0
- package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts.map +1 -0
- package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js +3 -0
- package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js.map +1 -0
- package/node_modules/discord-api-types/rest/v10/index.d.ts +1 -0
- package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/index.js +29 -0
- package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/interactions.d.ts +4 -2
- package/node_modules/discord-api-types/rest/v10/interactions.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/user.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v10/user.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts +70 -0
- package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts.map +1 -0
- package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js +3 -0
- package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js.map +1 -0
- package/node_modules/discord-api-types/rest/v9/index.d.ts +1 -0
- package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.js +29 -0
- package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v9/interactions.d.ts +4 -2
- package/node_modules/discord-api-types/rest/v9/interactions.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/user.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v9/user.d.ts.map +1 -1
- package/node_modules/discord-api-types/v10.mjs +1 -0
- package/node_modules/discord-api-types/v9.mjs +1 -0
- package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/compile.js +14 -4
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/create-tokenizer.js +7 -6
- package/node_modules/micromark/dev/lib/initialize/document.js +25 -21
- package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/initialize/text.js +10 -6
- package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/preprocess.js +19 -21
- package/node_modules/micromark/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/lib/compile.js +37 -29
- package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/lib/create-tokenizer.js +37 -35
- package/node_modules/micromark/lib/initialize/document.js +21 -13
- package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/lib/initialize/text.js +7 -3
- package/node_modules/micromark/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/lib/preprocess.js +16 -19
- package/node_modules/micromark/package.json +2 -15
- package/node_modules/micromark-core-commonmark/dev/lib/attention.js +18 -24
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +1 -43
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +19 -43
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +2 -53
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +14 -12
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +14 -5
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +14 -5
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +8 -5
- package/node_modules/micromark-core-commonmark/lib/attention.js +14 -24
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/code-fenced.js +1 -39
- package/node_modules/micromark-core-commonmark/lib/code-indented.js +11 -29
- package/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -51
- package/node_modules/micromark-core-commonmark/lib/label-end.js +11 -10
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-image.js +11 -3
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-link.js +11 -3
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/setext-underline.js +7 -5
- package/node_modules/micromark-core-commonmark/package.json +4 -16
- package/node_modules/micromark-factory-space/dev/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/dev/index.js +58 -3
- package/node_modules/micromark-factory-space/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/index.js +55 -3
- package/node_modules/micromark-factory-space/package.json +1 -10
- package/node_modules/micromark-factory-space/readme.md +25 -25
- package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
- package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/index.js +225 -0
- package/node_modules/micromark-util-edit-map/license +22 -0
- package/node_modules/micromark-util-edit-map/package.json +48 -0
- package/node_modules/micromark-util-edit-map/readme.md +234 -0
- package/node_modules/micromark-util-types/index.d.ts +6 -3
- package/node_modules/micromark-util-types/package.json +2 -36
- package/node_modules/ws/lib/websocket.js +17 -3
- package/node_modules/ws/package.json +1 -1
- package/openclaw.plugin.json +3 -6
- package/package.json +7 -12
- package/dist/.setup/account-inspect-DsER5ILV.mjs +0 -45
- package/dist/.setup/provider.runtime-CZ51OIgD.mjs +0 -2
- package/dist/.setup/resolve-allowlist-common-BUyU3C-T.mjs +0 -27
- package/dist/.setup/resolve-channels-DA6QlhZN.mjs +0 -246
- package/dist/.setup/security-contract-DSHk7I2w.mjs +0 -26
- package/dist/.setup/setup-plugin-api-BVlCz3fm.mjs +0 -3
- package/dist/.setup/targets-bqXQENmX.mjs +0 -3
- package/dist/control-ui/2afbdab1d3aa65a789d8a3eba666f4b1ec5df07073538fe30d6cf32093a1fb2d/index.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i 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-ljrzXBJi.mjs";
|
|
2
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-CestGDpq.mjs";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-UdT38DzU.mjs";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-DnCsrXZ_.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
|
-
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
10
9
|
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
10
|
+
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
11
11
|
//#region extensions/discord/src/setup-account-state.ts
|
|
12
12
|
function resolveDiscordSetupAccountConfig(params) {
|
|
13
13
|
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultDiscordAccountId(params.cfg));
|
|
@@ -17,21 +17,7 @@ function resolveDiscordSetupAccountConfig(params) {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
function inspectDiscordSetupAccount(params) {
|
|
20
|
-
|
|
21
|
-
const enabled = params.cfg.channels?.discord?.enabled !== false && config.enabled !== false;
|
|
22
|
-
const accountConfig = resolveDiscordAccountConfig(params.cfg, accountId);
|
|
23
|
-
const hasAccountToken = Boolean(accountConfig && Object.hasOwn(accountConfig, "token"));
|
|
24
|
-
return inspectDiscordAccountTokenState({
|
|
25
|
-
base: {
|
|
26
|
-
accountId,
|
|
27
|
-
enabled
|
|
28
|
-
},
|
|
29
|
-
config,
|
|
30
|
-
accountToken: accountConfig?.token,
|
|
31
|
-
hasAccountToken,
|
|
32
|
-
channelToken: params.cfg.channels?.discord?.token,
|
|
33
|
-
resolveFallbackToken: () => resolveDiscordToken(params.cfg, { accountId })
|
|
34
|
-
});
|
|
20
|
+
return inspectDiscordAccountConfig(params, { resolveFallbackToken: (accountId) => resolveDiscordToken(params.cfg, { accountId }) });
|
|
35
21
|
}
|
|
36
22
|
//#endregion
|
|
37
23
|
//#region extensions/discord/src/setup-core.ts
|
|
@@ -44,9 +30,19 @@ const DISCORD_TOKEN_HELP_LINES = [
|
|
|
44
30
|
t$1("wizard.discord.tokenHelpMessageContentIntent"),
|
|
45
31
|
t$1("wizard.channels.docs", { link: formatDocsLink("/discord", "discord") })
|
|
46
32
|
];
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
function getDiscordAllowFromHelpLines() {
|
|
34
|
+
return [
|
|
35
|
+
t$1("wizard.discord.allowlistIntro"),
|
|
36
|
+
t$1("wizard.discord.examples"),
|
|
37
|
+
"- 123456789012345678",
|
|
38
|
+
"- @alice",
|
|
39
|
+
"- alice#1234",
|
|
40
|
+
t$1("wizard.discord.multipleEntries"),
|
|
41
|
+
t$1("wizard.channels.docs", { link: formatDocsLink("/discord", "discord") })
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
function setDiscordGuildChannelAllowlist(cfg, accountId, resolved) {
|
|
45
|
+
const entries = Array.isArray(resolved) ? resolved.flatMap((entry) => {
|
|
50
46
|
if (!entry || typeof entry !== "object") return [];
|
|
51
47
|
const row = entry;
|
|
52
48
|
if (row.resolved === false) return [];
|
|
@@ -57,12 +53,10 @@ function mapDiscordSetupAllowlistEntries(resolved) {
|
|
|
57
53
|
guildKey,
|
|
58
54
|
channelKey
|
|
59
55
|
}] : [{ guildKey }];
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function setDiscordGuildChannelAllowlist(cfg, accountId, entries) {
|
|
56
|
+
}) : [];
|
|
63
57
|
const guilds = { ...accountId === DEFAULT_ACCOUNT_ID ? cfg.channels?.discord?.guilds ?? {} : cfg.channels?.discord?.accounts?.[accountId]?.guilds ?? {} };
|
|
64
58
|
for (const entry of entries) {
|
|
65
|
-
const guildKey = entry.guildKey
|
|
59
|
+
const guildKey = entry.guildKey;
|
|
66
60
|
const existing = guilds[guildKey] ?? {};
|
|
67
61
|
if (entry.channelKey) {
|
|
68
62
|
const channels = { ...existing.channels };
|
|
@@ -133,10 +127,7 @@ function createDiscordSetupWizardBase(handlers) {
|
|
|
133
127
|
keepPrompt: t$1("wizard.discord.tokenKeepPrompt"),
|
|
134
128
|
inputPrompt: t$1("wizard.discord.tokenInputPrompt"),
|
|
135
129
|
allowEnv: ({ accountId }) => accountId === DEFAULT_ACCOUNT_ID,
|
|
136
|
-
resolveAccount:
|
|
137
|
-
cfg,
|
|
138
|
-
accountId
|
|
139
|
-
}),
|
|
130
|
+
resolveAccount: inspectDiscordSetupAccount,
|
|
140
131
|
accountConfigured: (account) => account.configured,
|
|
141
132
|
hasConfiguredValue: (account) => account.tokenStatus !== "missing",
|
|
142
133
|
resolvedValue: (account) => normalizeOptionalString(account.token),
|
|
@@ -154,8 +145,7 @@ function createDiscordSetupWizardBase(handlers) {
|
|
|
154
145
|
cfg,
|
|
155
146
|
accountId
|
|
156
147
|
}).config.guilds ?? {}).flatMap(([guildKey, value]) => {
|
|
157
|
-
const
|
|
158
|
-
const channelKeys = Object.keys(channels);
|
|
148
|
+
const channelKeys = Object.keys(value?.channels ?? {});
|
|
159
149
|
if (channelKeys.length === 0) return [/^\d+$/.test(guildKey) ? `guild:${guildKey}` : guildKey];
|
|
160
150
|
return channelKeys.map((channelKey) => `${guildKey}/${channelKey}`);
|
|
161
151
|
}),
|
|
@@ -168,21 +158,13 @@ function createDiscordSetupWizardBase(handlers) {
|
|
|
168
158
|
input,
|
|
169
159
|
resolved: false
|
|
170
160
|
})),
|
|
171
|
-
applyAllowlist: ({ cfg, accountId, resolved }) => setDiscordGuildChannelAllowlist(cfg, accountId,
|
|
161
|
+
applyAllowlist: ({ cfg, accountId, resolved }) => setDiscordGuildChannelAllowlist(cfg, accountId, resolved)
|
|
172
162
|
}),
|
|
173
163
|
allowFrom: createAccountScopedAllowFromSection({
|
|
174
164
|
channel: channel$1,
|
|
175
165
|
credentialInputKey: "token",
|
|
176
166
|
helpTitle: "Discord allowlist",
|
|
177
|
-
helpLines:
|
|
178
|
-
t$1("wizard.discord.allowlistIntro"),
|
|
179
|
-
t$1("wizard.discord.examples"),
|
|
180
|
-
"- 123456789012345678",
|
|
181
|
-
"- @alice",
|
|
182
|
-
"- alice#1234",
|
|
183
|
-
t$1("wizard.discord.multipleEntries"),
|
|
184
|
-
t$1("wizard.channels.docs", { link: formatDocsLink("/discord", "discord") })
|
|
185
|
-
],
|
|
167
|
+
helpLines: getDiscordAllowFromHelpLines(),
|
|
186
168
|
message: t$1("wizard.discord.allowFromPrompt"),
|
|
187
169
|
placeholder: "@alice, 123456789012345678",
|
|
188
170
|
invalidWithoutCredentialNote: t$1("wizard.discord.allowFromInvalidWithoutToken"),
|
|
@@ -207,15 +189,7 @@ async function promptDiscordAllowFrom(params) {
|
|
|
207
189
|
accountId
|
|
208
190
|
});
|
|
209
191
|
const noteTitle = t("wizard.discord.allowlistTitle");
|
|
210
|
-
await params.prompter.note(
|
|
211
|
-
t("wizard.discord.allowlistIntro"),
|
|
212
|
-
t("wizard.discord.examples"),
|
|
213
|
-
"- 123456789012345678",
|
|
214
|
-
"- @alice",
|
|
215
|
-
"- alice#1234",
|
|
216
|
-
t("wizard.discord.multipleEntries"),
|
|
217
|
-
t("wizard.channels.docs", { link: formatDocsLink("/discord", "discord") })
|
|
218
|
-
].join("\n"), noteTitle);
|
|
192
|
+
await params.prompter.note(getDiscordAllowFromHelpLines().join("\n"), noteTitle);
|
|
219
193
|
const allowFrom = await promptResolvedAllowFrom({
|
|
220
194
|
prompter: params.prompter,
|
|
221
195
|
existing: resolveDiscordAccountAllowFrom({
|
|
@@ -248,17 +222,6 @@ async function promptDiscordAllowFrom(params) {
|
|
|
248
222
|
}
|
|
249
223
|
});
|
|
250
224
|
}
|
|
251
|
-
async function resolveDiscordGroupAllowlist(params) {
|
|
252
|
-
return await resolveEntriesWithOptionalToken({
|
|
253
|
-
token: resolveDiscordToken(params.cfg, { accountId: params.accountId }).token || (typeof params.credentialValues.token === "string" ? params.credentialValues.token : ""),
|
|
254
|
-
entries: params.entries,
|
|
255
|
-
buildWithoutToken: (input) => ({
|
|
256
|
-
input,
|
|
257
|
-
resolved: false
|
|
258
|
-
}),
|
|
259
|
-
resolveEntries: resolveDiscordChannelAllowlist
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
225
|
const discordSetupWizard = createDiscordSetupWizardBase({
|
|
263
226
|
promptAllowFrom: promptDiscordAllowFrom,
|
|
264
227
|
resolveAllowFromEntries: async ({ cfg, accountId, credentialValues, entries }) => await resolveBasicAllowFromEntries({
|
|
@@ -266,7 +229,15 @@ const discordSetupWizard = createDiscordSetupWizardBase({
|
|
|
266
229
|
entries,
|
|
267
230
|
resolveEntries: resolveDiscordUserAllowlist
|
|
268
231
|
}),
|
|
269
|
-
resolveGroupAllowlist:
|
|
232
|
+
resolveGroupAllowlist: async (params) => await resolveEntriesWithOptionalToken({
|
|
233
|
+
token: resolveDiscordToken(params.cfg, { accountId: params.accountId }).token || (typeof params.credentialValues.token === "string" ? params.credentialValues.token : ""),
|
|
234
|
+
entries: params.entries,
|
|
235
|
+
buildWithoutToken: (input) => ({
|
|
236
|
+
input,
|
|
237
|
+
resolved: false
|
|
238
|
+
}),
|
|
239
|
+
resolveEntries: resolveDiscordChannelAllowlist
|
|
240
|
+
})
|
|
270
241
|
});
|
|
271
242
|
//#endregion
|
|
272
243
|
//#region extensions/discord/src/channel.setup.ts
|