@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
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# micromark-util-edit-map
|
|
2
|
+
|
|
3
|
+
[![Build][build-badge]][build]
|
|
4
|
+
[![Coverage][coverage-badge]][coverage]
|
|
5
|
+
[![Downloads][downloads-badge]][downloads]
|
|
6
|
+
[![Size][bundle-size-badge]][bundle-size]
|
|
7
|
+
[![Sponsors][sponsors-badge]][opencollective]
|
|
8
|
+
[![Backers][backers-badge]][opencollective]
|
|
9
|
+
[![Chat][chat-badge]][chat]
|
|
10
|
+
|
|
11
|
+
[micromark][] utility to batch changes to lists of events.
|
|
12
|
+
|
|
13
|
+
## Contents
|
|
14
|
+
|
|
15
|
+
* [What is this?](#what-is-this)
|
|
16
|
+
* [When should I use this?](#when-should-i-use-this)
|
|
17
|
+
* [Install](#install)
|
|
18
|
+
* [Use](#use)
|
|
19
|
+
* [API](#api)
|
|
20
|
+
* [`EditMap()`](#editmap)
|
|
21
|
+
* [`EditMap#add(index, remove, add)`](#editmapaddindex-remove-add)
|
|
22
|
+
* [`EditMap#addBefore(index, remove, add)`](#editmapaddbeforeindex-remove-add)
|
|
23
|
+
* [`EditMap#consume(events)`](#editmapconsumeevents)
|
|
24
|
+
* [Types](#types)
|
|
25
|
+
* [Compatibility](#compatibility)
|
|
26
|
+
* [Security](#security)
|
|
27
|
+
* [Contribute](#contribute)
|
|
28
|
+
* [License](#license)
|
|
29
|
+
|
|
30
|
+
## What is this?
|
|
31
|
+
|
|
32
|
+
This package exposes an algorithm to batch changes to lists of events,
|
|
33
|
+
needed when authoring complex resolvers, such as for tables or lists.
|
|
34
|
+
|
|
35
|
+
## When should I use this?
|
|
36
|
+
|
|
37
|
+
This package is only useful when you are making your own micromark extensions
|
|
38
|
+
that need to change many places in lists of events,
|
|
39
|
+
such as injecting the result of parsing subcontent,
|
|
40
|
+
or cleaning up how a construct is represented.
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
This package is [ESM only][esm].
|
|
45
|
+
In Node.js (version 16+), install with [npm][]:
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
npm install micromark-util-edit-map
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
In Deno with [`esm.sh`][esmsh]:
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import {EditMap} from 'https://esm.sh/micromark-util-edit-map@1'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
In browsers with [`esm.sh`][esmsh]:
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<script type="module">
|
|
61
|
+
import {EditMap} from 'https://esm.sh/micromark-util-edit-map@1?bundle'
|
|
62
|
+
</script>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Use
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
/**
|
|
69
|
+
* @import {Event} from 'micromark-util-types'
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
import {EditMap} from 'micromark-util-edit-map'
|
|
73
|
+
|
|
74
|
+
/** @type {Array<Event>} */
|
|
75
|
+
const events = [] // Assume this is filled.
|
|
76
|
+
|
|
77
|
+
const editMap = new EditMap()
|
|
78
|
+
|
|
79
|
+
editMap.add(1, 0, [['enter', events[2][1], events[2][2]]])
|
|
80
|
+
editMap.add(2, 1, [])
|
|
81
|
+
|
|
82
|
+
editMap.consume(events)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## API
|
|
86
|
+
|
|
87
|
+
This module exports the identifier [`EditMap`][api-edit-map].
|
|
88
|
+
There is no default export.
|
|
89
|
+
|
|
90
|
+
### `EditMap()`
|
|
91
|
+
|
|
92
|
+
Create a new edit map.
|
|
93
|
+
|
|
94
|
+
###### Returns
|
|
95
|
+
|
|
96
|
+
New instance (`EditMap`).
|
|
97
|
+
|
|
98
|
+
### `EditMap#add(index, remove, add)`
|
|
99
|
+
|
|
100
|
+
Create an edit: a remove and/or add at a certain place.
|
|
101
|
+
|
|
102
|
+
###### Parameters
|
|
103
|
+
|
|
104
|
+
* `index` (`number`)
|
|
105
|
+
— index at which to apply the edit
|
|
106
|
+
* `remove` (`number`)
|
|
107
|
+
— count of items to remove at the index
|
|
108
|
+
* `add` (`Array<Event>`)
|
|
109
|
+
— items to add at the index
|
|
110
|
+
|
|
111
|
+
###### Returns
|
|
112
|
+
|
|
113
|
+
Nothing (`undefined`).
|
|
114
|
+
|
|
115
|
+
### `EditMap#addBefore(index, remove, add)`
|
|
116
|
+
|
|
117
|
+
Create an edit: but insert `add` before existing additions at `index`,
|
|
118
|
+
instead of after them.
|
|
119
|
+
|
|
120
|
+
###### Parameters
|
|
121
|
+
|
|
122
|
+
* `index` (`number`)
|
|
123
|
+
— index at which to apply the edit
|
|
124
|
+
* `remove` (`number`)
|
|
125
|
+
— count of items to remove at the index
|
|
126
|
+
* `add` (`Array<Event>`)
|
|
127
|
+
— items to add at the index
|
|
128
|
+
|
|
129
|
+
###### Returns
|
|
130
|
+
|
|
131
|
+
Nothing (`undefined`).
|
|
132
|
+
|
|
133
|
+
### `EditMap#consume(events)`
|
|
134
|
+
|
|
135
|
+
Done, change the events.
|
|
136
|
+
|
|
137
|
+
###### Parameters
|
|
138
|
+
|
|
139
|
+
* `events` (`Array<Event>`)
|
|
140
|
+
— list of events to apply the edits to
|
|
141
|
+
|
|
142
|
+
###### Returns
|
|
143
|
+
|
|
144
|
+
Nothing (`undefined`).
|
|
145
|
+
|
|
146
|
+
## Types
|
|
147
|
+
|
|
148
|
+
This package is fully typed with [TypeScript][].
|
|
149
|
+
It exports no additional types.
|
|
150
|
+
|
|
151
|
+
## Compatibility
|
|
152
|
+
|
|
153
|
+
Projects maintained by the unified collective are compatible with maintained
|
|
154
|
+
versions of Node.js.
|
|
155
|
+
|
|
156
|
+
When we cut a new major release, we drop support for unmaintained versions of
|
|
157
|
+
Node.
|
|
158
|
+
This means we try to keep the current release line,
|
|
159
|
+
`micromark-util-edit-map@1`, compatible with Node.js 16.
|
|
160
|
+
This package works with `micromark@4`.
|
|
161
|
+
|
|
162
|
+
## Security
|
|
163
|
+
|
|
164
|
+
This package is safe.
|
|
165
|
+
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
|
|
166
|
+
submit a security report.
|
|
167
|
+
|
|
168
|
+
## Contribute
|
|
169
|
+
|
|
170
|
+
See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
|
|
171
|
+
to get started.
|
|
172
|
+
See [`support.md`][support] for ways to get help.
|
|
173
|
+
|
|
174
|
+
This project has a [code of conduct][coc].
|
|
175
|
+
By interacting with this repository, organisation, or community you agree to
|
|
176
|
+
abide by its terms.
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
[MIT][license] © [Titus Wormer][author]
|
|
181
|
+
|
|
182
|
+
<!-- Definitions -->
|
|
183
|
+
|
|
184
|
+
[api-edit-map]: #editmap
|
|
185
|
+
|
|
186
|
+
[author]: https://wooorm.com
|
|
187
|
+
|
|
188
|
+
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
|
|
189
|
+
|
|
190
|
+
[build]: https://github.com/micromark/micromark/actions
|
|
191
|
+
|
|
192
|
+
[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
|
|
193
|
+
|
|
194
|
+
[bundle-size]: https://bundlejs.com/?q=micromark-util-edit-map
|
|
195
|
+
|
|
196
|
+
[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-edit-map
|
|
197
|
+
|
|
198
|
+
[chat]: https://github.com/micromark/micromark/discussions
|
|
199
|
+
|
|
200
|
+
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
|
|
201
|
+
|
|
202
|
+
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
|
|
203
|
+
|
|
204
|
+
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
|
|
205
|
+
|
|
206
|
+
[coverage]: https://codecov.io/github/micromark/micromark
|
|
207
|
+
|
|
208
|
+
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
|
|
209
|
+
|
|
210
|
+
[downloads]: https://www.npmjs.com/package/micromark-util-edit-map
|
|
211
|
+
|
|
212
|
+
[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-edit-map.svg
|
|
213
|
+
|
|
214
|
+
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
|
|
215
|
+
|
|
216
|
+
[esmsh]: https://esm.sh
|
|
217
|
+
|
|
218
|
+
[health]: https://github.com/micromark/.github
|
|
219
|
+
|
|
220
|
+
[license]: https://github.com/micromark/micromark/blob/main/license
|
|
221
|
+
|
|
222
|
+
[micromark]: https://github.com/micromark/micromark
|
|
223
|
+
|
|
224
|
+
[npm]: https://docs.npmjs.com/cli/install
|
|
225
|
+
|
|
226
|
+
[opencollective]: https://opencollective.com/unified
|
|
227
|
+
|
|
228
|
+
[securitymd]: https://github.com/micromark/.github/blob/main/security.md
|
|
229
|
+
|
|
230
|
+
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
|
|
231
|
+
|
|
232
|
+
[support]: https://github.com/micromark/.github/blob/main/support.md
|
|
233
|
+
|
|
234
|
+
[typescript]: https://www.typescriptlang.org
|
|
@@ -643,6 +643,11 @@ export interface TokenizeContext {
|
|
|
643
643
|
*/
|
|
644
644
|
_contentTypeTextTrailing?: boolean | undefined
|
|
645
645
|
|
|
646
|
+
/**
|
|
647
|
+
* Stack of label start tokens that can still close.
|
|
648
|
+
*/
|
|
649
|
+
_labelStarts?: Array<Token> | undefined
|
|
650
|
+
|
|
646
651
|
/**
|
|
647
652
|
* Current code.
|
|
648
653
|
*/
|
|
@@ -769,7 +774,6 @@ export type Encoding =
|
|
|
769
774
|
| 'utf-16le' // Always supported in Node.
|
|
770
775
|
| 'utf-16be' // Not supported when ICU is disabled.
|
|
771
776
|
// Everything else (depends on browser, or full ICU data).
|
|
772
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
773
777
|
| (string & {})
|
|
774
778
|
|
|
775
779
|
/**
|
|
@@ -792,8 +796,7 @@ export interface Extension {
|
|
|
792
796
|
flowInitial?: ConstructRecord | undefined
|
|
793
797
|
flow?: ConstructRecord | undefined
|
|
794
798
|
insideSpan?:
|
|
795
|
-
|
|
796
|
-
| undefined
|
|
799
|
+
{null?: Array<Pick<Construct, 'resolveAll'>> | undefined} | undefined
|
|
797
800
|
string?: ConstructRecord | undefined
|
|
798
801
|
text?: ConstructRecord | undefined
|
|
799
802
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "micromark-util-types",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "micromark utility with a couple of typescript types",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -33,39 +33,5 @@
|
|
|
33
33
|
"index.d.ts",
|
|
34
34
|
"index.js"
|
|
35
35
|
],
|
|
36
|
-
"exports": "./index.js"
|
|
37
|
-
"xo": {
|
|
38
|
-
"envs": [
|
|
39
|
-
"shared-node-browser"
|
|
40
|
-
],
|
|
41
|
-
"overrides": [
|
|
42
|
-
{
|
|
43
|
-
"files": [
|
|
44
|
-
"**/*.d.ts"
|
|
45
|
-
],
|
|
46
|
-
"rules": {
|
|
47
|
-
"@typescript-eslint/array-type": [
|
|
48
|
-
"error",
|
|
49
|
-
{
|
|
50
|
-
"default": "generic"
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
"@typescript-eslint/ban-types": [
|
|
54
|
-
"error",
|
|
55
|
-
{
|
|
56
|
-
"extendDefaults": true
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"@typescript-eslint/consistent-type-definitions": [
|
|
60
|
-
"error",
|
|
61
|
-
"interface"
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
"prettier": true,
|
|
67
|
-
"rules": {
|
|
68
|
-
"unicorn/text-encoding-identifier-case": "off"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
36
|
+
"exports": "./index.js"
|
|
71
37
|
}
|
|
@@ -75,11 +75,24 @@ class WebSocket extends EventEmitter {
|
|
|
75
75
|
this._redirects = 0;
|
|
76
76
|
|
|
77
77
|
if (protocols === undefined) {
|
|
78
|
-
protocols
|
|
78
|
+
if (!options || options.protocols === undefined) {
|
|
79
|
+
protocols = [];
|
|
80
|
+
} else if (Array.isArray(options.protocols)) {
|
|
81
|
+
protocols = options.protocols;
|
|
82
|
+
} else {
|
|
83
|
+
protocols = [options.protocols];
|
|
84
|
+
}
|
|
79
85
|
} else if (!Array.isArray(protocols)) {
|
|
80
86
|
if (typeof protocols === 'object' && protocols !== null) {
|
|
81
87
|
options = protocols;
|
|
82
|
-
|
|
88
|
+
|
|
89
|
+
if (options.protocols === undefined) {
|
|
90
|
+
protocols = [];
|
|
91
|
+
} else if (Array.isArray(options.protocols)) {
|
|
92
|
+
protocols = options.protocols;
|
|
93
|
+
} else {
|
|
94
|
+
protocols = [options.protocols];
|
|
95
|
+
}
|
|
83
96
|
} else {
|
|
84
97
|
protocols = [protocols];
|
|
85
98
|
}
|
|
@@ -318,7 +331,6 @@ class WebSocket extends EventEmitter {
|
|
|
318
331
|
return;
|
|
319
332
|
}
|
|
320
333
|
|
|
321
|
-
this._readyState = WebSocket.CLOSING;
|
|
322
334
|
this._sender.close(code, data, !this._isServer, (err) => {
|
|
323
335
|
//
|
|
324
336
|
// This error is handled by the `'error'` listener on the socket. We only
|
|
@@ -336,6 +348,7 @@ class WebSocket extends EventEmitter {
|
|
|
336
348
|
}
|
|
337
349
|
});
|
|
338
350
|
|
|
351
|
+
this._readyState = WebSocket.CLOSING;
|
|
339
352
|
setCloseTimer(this);
|
|
340
353
|
}
|
|
341
354
|
|
|
@@ -681,6 +694,7 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
681
694
|
socketPath: undefined,
|
|
682
695
|
hostname: undefined,
|
|
683
696
|
protocol: undefined,
|
|
697
|
+
protocols: undefined,
|
|
684
698
|
timeout: undefined,
|
|
685
699
|
method: 'GET',
|
|
686
700
|
host: undefined,
|
package/openclaw.plugin.json
CHANGED
|
@@ -45,9 +45,6 @@
|
|
|
45
45
|
"additionalProperties": false,
|
|
46
46
|
"properties": {}
|
|
47
47
|
},
|
|
48
|
-
"controlUi": {
|
|
49
|
-
"entry": "dist/control-ui/2afbdab1d3aa65a789d8a3eba666f4b1ec5df07073538fe30d6cf32093a1fb2d/index.js"
|
|
50
|
-
},
|
|
51
48
|
"channelConfigs": {
|
|
52
49
|
"discord": {
|
|
53
50
|
"schema": {
|
|
@@ -3741,11 +3738,11 @@
|
|
|
3741
3738
|
},
|
|
3742
3739
|
"streaming": {
|
|
3743
3740
|
"label": "Discord Streaming Mode",
|
|
3744
|
-
"help": "Discord
|
|
3741
|
+
"help": "Discord shows useful work status by default without streaming answer text. Set mode to \"off\" for quiet final-only delivery, or \"partial\"/\"block\" for answer previews. Run openclaw doctor --fix to migrate legacy keys."
|
|
3745
3742
|
},
|
|
3746
3743
|
"streaming.mode": {
|
|
3747
3744
|
"label": "Discord Streaming Mode",
|
|
3748
|
-
"help": "Discord preview mode: \"off\" | \"partial\" | \"block\" | \"progress\". Default: \"off\"."
|
|
3745
|
+
"help": "Discord preview mode: \"off\" | \"partial\" | \"block\" | \"progress\". Default: \"progress\"; \"off\" explicitly disables progress drafts."
|
|
3749
3746
|
},
|
|
3750
3747
|
"streaming.chunkMode": {
|
|
3751
3748
|
"label": "Discord Chunk Mode",
|
|
@@ -3797,7 +3794,7 @@
|
|
|
3797
3794
|
},
|
|
3798
3795
|
"streaming.progress.toolProgress": {
|
|
3799
3796
|
"label": "Discord Progress Tool Lines",
|
|
3800
|
-
"help": "Show
|
|
3797
|
+
"help": "Show the detailed rolling tool log (default: false). Work status, delegated-task states, plans, and authored progress remain visible without it. Set streaming.mode to off for quiet final-only delivery."
|
|
3801
3798
|
},
|
|
3802
3799
|
"streaming.progress.commentary": {
|
|
3803
3800
|
"label": "Discord Progress Commentary",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/discord",
|
|
3
|
-
"version": "2026.10.2",
|
|
3
|
+
"version": "2026.10.5-beta.2",
|
|
4
4
|
"description": "OpenClaw Discord channel plugin for channels, DMs, commands, and app events.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@discord/embedded-app-sdk": "2.5.0",
|
|
12
12
|
"@discordjs/voice": "0.19.2",
|
|
13
|
-
"discord-api-types": "0.38.
|
|
13
|
+
"discord-api-types": "0.38.56",
|
|
14
14
|
"libopus-wasm": "0.4.1",
|
|
15
15
|
"mdast-util-from-markdown": "2.0.3",
|
|
16
16
|
"typebox": "1.3.34",
|
|
17
17
|
"undici": "8.11.2",
|
|
18
|
-
"ws": "8.
|
|
18
|
+
"ws": "8.22.0",
|
|
19
19
|
"zod": "4.6.5"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"openclaw": ">=2026.10.2"
|
|
22
|
+
"openclaw": ">=2026.10.5-beta.2"
|
|
23
23
|
},
|
|
24
24
|
"peerDependenciesMeta": {
|
|
25
25
|
"openclaw": {
|
|
@@ -95,14 +95,14 @@
|
|
|
95
95
|
"allowInvalidConfigRecovery": true
|
|
96
96
|
},
|
|
97
97
|
"compat": {
|
|
98
|
-
"pluginApi": ">=2026.10.2"
|
|
98
|
+
"pluginApi": ">=2026.10.5-beta.2"
|
|
99
99
|
},
|
|
100
100
|
"build": {
|
|
101
101
|
"bundledDist": false,
|
|
102
102
|
"workerEntries": [
|
|
103
103
|
"./src/voice/audio-worker.runtime.ts"
|
|
104
104
|
],
|
|
105
|
-
"openclawVersion": "2026.10.2",
|
|
105
|
+
"openclawVersion": "2026.10.5-beta.2",
|
|
106
106
|
"staticAssets": [
|
|
107
107
|
{
|
|
108
108
|
"source": "./assets/embedded-app-sdk.mjs",
|
|
@@ -111,17 +111,12 @@
|
|
|
111
111
|
]
|
|
112
112
|
},
|
|
113
113
|
"assetScripts": {
|
|
114
|
-
"build": "node --import ../../scripts/tsx.mjs ../../scripts/build-discord-activity-sdk.mts
|
|
115
|
-
"copy": "cd ../.. && node --import ./scripts/tsx.mjs scripts/build-plugin-control-ui.mts extensions/discord --copy",
|
|
116
|
-
"buildOutputs": [
|
|
117
|
-
"openclaw.plugin.json"
|
|
118
|
-
]
|
|
114
|
+
"build": "node --import ../../scripts/tsx.mjs ../../scripts/build-discord-activity-sdk.mts"
|
|
119
115
|
},
|
|
120
116
|
"release": {
|
|
121
117
|
"publishToClawHub": true,
|
|
122
118
|
"publishToNpm": true
|
|
123
119
|
},
|
|
124
|
-
"controlUi": "./browser/index.ts",
|
|
125
120
|
"runtimeExtensions": [
|
|
126
121
|
"./dist/index.js"
|
|
127
122
|
],
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { _ as inspectDiscordAccountTokenState, o as mergeDiscordAccountConfig, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig, v as resolveDiscordAccountAvailability } from "./accounts-HE9-mj1L.mjs";
|
|
2
|
-
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
3
|
-
import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
4
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
//#region extensions/discord/src/account-inspect.ts
|
|
6
|
-
function inspectDiscordAccountPrimary(params) {
|
|
7
|
-
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultDiscordAccountId(params.cfg));
|
|
8
|
-
const merged = mergeDiscordAccountConfig(params.cfg, accountId);
|
|
9
|
-
const enabled = params.cfg.channels?.discord?.enabled !== false && merged.enabled !== false;
|
|
10
|
-
const accountConfig = resolveDiscordAccountConfig(params.cfg, accountId);
|
|
11
|
-
const hasAccountToken = Boolean(accountConfig && Object.hasOwn(accountConfig, "token"));
|
|
12
|
-
return inspectDiscordAccountTokenState({
|
|
13
|
-
base: {
|
|
14
|
-
accountId,
|
|
15
|
-
enabled,
|
|
16
|
-
name: normalizeOptionalString(merged.name)
|
|
17
|
-
},
|
|
18
|
-
config: merged,
|
|
19
|
-
accountToken: accountConfig?.token,
|
|
20
|
-
hasAccountToken,
|
|
21
|
-
channelToken: params.cfg.channels?.discord?.token,
|
|
22
|
-
resolveFallbackToken: () => {
|
|
23
|
-
const envToken = accountId === DEFAULT_ACCOUNT_ID ? normalizeSecretInputString(params.envToken ?? process.env.DISCORD_BOT_TOKEN) : void 0;
|
|
24
|
-
return {
|
|
25
|
-
token: envToken?.replace(/^Bot\s+/i, "") ?? "",
|
|
26
|
-
source: envToken ? "env" : "none"
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function inspectDiscordAccount(params) {
|
|
32
|
-
const account = inspectDiscordAccountPrimary(params);
|
|
33
|
-
return {
|
|
34
|
-
...account,
|
|
35
|
-
...resolveDiscordAccountAvailability({
|
|
36
|
-
account,
|
|
37
|
-
resolveAccounts: () => listDiscordAccountIds(params.cfg).map((accountId) => inspectDiscordAccountPrimary({
|
|
38
|
-
...params,
|
|
39
|
-
accountId
|
|
40
|
-
}))
|
|
41
|
-
})
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
//#endregion
|
|
45
|
-
export { inspectDiscordAccount as t };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { m as normalizeDiscordToken } from "./accounts-HE9-mj1L.mjs";
|
|
2
|
-
import { o as normalizeDiscordSlug } from "./allow-list-vxkG9_JD.mjs";
|
|
3
|
-
import { r as fetchDiscord } from "./api-DlNUkDqj.mjs";
|
|
4
|
-
//#region extensions/discord/src/guilds.ts
|
|
5
|
-
async function listGuilds(token, fetcher, options) {
|
|
6
|
-
return (await fetchDiscord("/users/@me/guilds", token, fetcher, options)).filter((guild) => typeof guild.id === "string" && typeof guild.name === "string").map((guild) => ({
|
|
7
|
-
id: guild.id,
|
|
8
|
-
name: guild.name,
|
|
9
|
-
slug: normalizeDiscordSlug(guild.name)
|
|
10
|
-
}));
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region extensions/discord/src/resolve-allowlist-common.ts
|
|
14
|
-
function resolveDiscordAllowlistToken(token) {
|
|
15
|
-
return normalizeDiscordToken(token, "channels.discord.token");
|
|
16
|
-
}
|
|
17
|
-
function filterDiscordGuilds(guilds, params) {
|
|
18
|
-
if (params.guildId) return guilds.filter((guild) => guild.id === params.guildId);
|
|
19
|
-
if (params.guildName) {
|
|
20
|
-
const slug = normalizeDiscordSlug(params.guildName);
|
|
21
|
-
const match = slug ? guilds.find((guild) => guild.slug === slug) : void 0;
|
|
22
|
-
return match ? [match] : [];
|
|
23
|
-
}
|
|
24
|
-
return guilds;
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { resolveDiscordAllowlistToken as n, listGuilds as r, filterDiscordGuilds as t };
|