@openclaw/matrix 2026.7.2-beta.7 → 2026.7.34
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 +1 -1
- package/dist/{account-selection-kqquRzCf.js → .setup/account-selection-BOQeTqax.mjs} +18 -17
- package/dist/{approval-handler.runtime-DSeaIsGa.js → .setup/approval-handler.runtime-CEXm9_-p.mjs} +18 -28
- package/dist/{approval-ids-BdJGPAJT.js → .setup/approval-ids-DdFnDB3h.mjs} +1 -1
- package/dist/{approval-reaction-auth-BjOpELxu.js → .setup/approval-reaction-auth-CREvd7S7.mjs} +2 -2
- package/dist/.setup/approval-reactions-Cltyp8nL.mjs +113 -0
- package/dist/.setup/async-lock-BcLS4KOc.mjs +19 -0
- package/dist/{channel-vj788dNZ.js → .setup/channel-an4umty1.mjs} +186 -144
- package/dist/{channel.runtime-CLoF2S9T.js → .setup/channel.runtime-GHcIBJ7H.mjs} +51 -45
- package/dist/{cli-DMqfDE-q.js → .setup/cli-B3WYmv5U.mjs} +882 -901
- package/dist/{cli-metadata-C7D53SND.js → .setup/cli-metadata-RUKCn0wJ.mjs} +1 -1
- package/dist/{client-6eRENr7k.js → .setup/client-Ct0bUHCo.mjs} +5 -5
- package/dist/{shared-CUMWxcMz.js → .setup/client-DFBQtzCe.mjs} +422 -179
- package/dist/.setup/client-bootstrap-Be8jvNle.mjs +74 -0
- package/dist/{config-schema-Djxw3C6b.js → .setup/config-schema-D9J_vUF6.mjs} +89 -70
- package/dist/.setup/credentials-BhZlA0kL.mjs +56 -0
- package/dist/.setup/credentials-read-CRHg6XPm.mjs +114 -0
- package/dist/{credentials-write.runtime-Be9zNSUw.js → .setup/credentials-write.runtime-dWuLafsk.mjs} +1 -1
- package/dist/{crypto-runtime-D9_6J5tZ.js → .setup/crypto-runtime-D-cZa8P0.mjs} +81 -35
- package/dist/.setup/crypto-state-store-B43k3z3W.mjs +352 -0
- package/dist/{deps-CcVJfvRM.js → .setup/deps-Dy6yreL4.mjs} +92 -25
- package/dist/{device-health-B4-YXtJR.js → .setup/device-health-D4LBxuPq.mjs} +1 -6
- package/dist/{directory-live-C8dVBiCc.js → .setup/directory-live-BTEYxMwy.mjs} +10 -9
- package/dist/.setup/doctor-BGnvMzOR.mjs +169 -0
- package/dist/.setup/doctor-contract-DNJw0fdq.mjs +246 -0
- package/dist/{draft-stream-CtvOXq0Z.js → .setup/draft-stream-C-_OhpE8.mjs} +1 -6
- package/dist/{encryption-guidance-CbEFe38F.js → .setup/encryption-guidance-CpuuwmjL.mjs} +4 -3
- package/dist/{env-auth-CQsYbz-p.js → .setup/env-auth-CYJL1jNl.mjs} +2 -2
- package/dist/{env-vars-B0NxQnPk.js → .setup/env-vars-KzaYveuy.mjs} +1 -3
- package/dist/{exec-approval-resolver-BCgqRtZS.js → .setup/exec-approval-resolver-f9j6staN.mjs} +1 -2
- package/dist/{file-sync-store-DiiFsayX.js → .setup/file-sync-store-DU0cnYAz.mjs} +30 -25
- package/dist/{http-client-CycYxU9-.js → .setup/http-client-C954In2D.mjs} +45 -25
- package/dist/{idb-persistence-B6x7dMsF.js → .setup/idb-persistence-_HKTXkVC.mjs} +76 -78
- package/dist/{idb-persistence-lock-DAJ49nZX.js → .setup/idb-persistence-lock-B3fZXyF_.mjs} +1 -1
- package/dist/.setup/legacy-crypto-inspector-Byp8LCys.mjs +42 -0
- package/dist/.setup/legacy-crypto-restore-YQVoK1B2.mjs +93 -0
- package/dist/{logger-D0GCSDQq.js → .setup/logger-DpoogOgz.mjs} +1 -1
- package/dist/{logging-DV-p52N0.js → .setup/logging-CgxQOJJP.mjs} +2 -9
- package/dist/.setup/matrix-migration.runtime-BDH5c3fN.mjs +530 -0
- package/dist/{media-text-BTwzADS_.js → .setup/media-text-Cib-dxkn.mjs} +1 -1
- package/dist/{messages-DxQJkhxs.js → .setup/messages-D4DYGHYX.mjs} +15 -67
- package/dist/.setup/migration-snapshot-backup-CpgYhiUp.mjs +70 -0
- package/dist/.setup/migration-snapshot.runtime-O8qkMVaC.mjs +2 -0
- package/dist/{monitor-VyWlSLwo.js → .setup/monitor-DNcW_oAN.mjs} +2525 -2361
- package/dist/.setup/probe.runtime-CMPh0mFk.mjs +2 -0
- package/dist/{profile-update-CffmyW_4.js → .setup/profile-update-DzOL3Wiw.mjs} +5 -4
- package/dist/{reaction-events-B00WSi98.js → .setup/reaction-events-BcvgXxHb.mjs} +14 -64
- package/dist/{resolve-targets-nm2L48sh.js → .setup/resolve-targets-Bq80X9Sn.mjs} +3 -3
- package/dist/{resolver.runtime-DS6uPaEe.js → .setup/resolver.runtime-CeBHR9-T.mjs} +1 -1
- package/dist/{runtime-api-D1xI_cvh.js → .setup/runtime-api-CEsWNdil.mjs} +4 -4
- package/dist/.setup/runtime-setter-api-DGMubGUq.mjs +3 -0
- package/dist/{sdk-bUytQHx7.js → .setup/sdk-He1quVAq.mjs} +592 -261
- package/dist/.setup/secret-contract-api-CiTJ7pd5.mjs +3 -0
- package/dist/{secret-contract-M3hRmGO-.js → .setup/secret-contract-phPvlNfV.mjs} +53 -28
- package/dist/{send-BldGYG8g.js → .setup/send-CGgl0uTn.mjs} +133 -660
- package/dist/{setup-bootstrap-Deleiibz.js → .setup/setup-bootstrap-DUXBC8X2.mjs} +4 -4
- package/dist/{setup-core-BVfBv2ai.js → .setup/setup-core-bhdcEo7v.mjs} +239 -189
- package/dist/.setup/setup-plugin-api-CAwZ_Bi7.mjs +43 -0
- package/dist/.setup/setup-plugin-api-DIFVsOs3.mjs +2 -0
- package/dist/{setup-surface-BBq3WeqX.js → .setup/setup-surface-05_G-MnT.mjs} +149 -92
- package/dist/{startup-verification-wm3_i88s.js → .setup/startup-verification-BTwIGu1J.mjs} +7 -6
- package/dist/.setup/storage-NGZq5zet.mjs +432 -0
- package/dist/{storage-paths-gUmSydsW.js → .setup/storage-paths-BWo_ZEMC.mjs} +13 -2
- package/dist/{subagent-hooks-dkPAF6Et.js → .setup/subagent-hooks-BSWPJEmo.mjs} +2 -2
- package/dist/{thread-binding-api-DRbBZlhS.js → .setup/thread-binding-api-B7UaOoKv.mjs} +1 -1
- package/dist/{thread-bindings-DGbl3vDW.js → .setup/thread-bindings-DqmjG2on.mjs} +8 -8
- package/dist/{tool-actions.runtime-uu9blSqO.js → .setup/tool-actions.runtime-CXDLk2jg.mjs} +196 -332
- package/dist/{verification-DYMQ1QpI.js → .setup/verification-DeWOtZJr.mjs} +4 -3
- package/dist/api.js +9 -9
- package/dist/auth-presence.js +21 -13
- package/dist/channel-plugin-api.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +99 -524
- package/dist/helper-api.js +4 -4
- package/dist/index.js +1 -1
- package/dist/plugin-entry.handlers.runtime.js +2 -2
- package/dist/runtime-api.js +8 -8
- package/dist/runtime-heavy-api.js +3 -0
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +3 -3
- package/dist/setup-entry.js +4 -3
- package/dist/setup-plugin-api.js +1 -44
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/thread-binding-api.js +1 -1
- package/dist/thread-bindings-runtime.js +1 -1
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json +1 -1
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm.d.ts +2 -14
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +384 -409
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +224 -246
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm +0 -0
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts +58 -59
- package/node_modules/markdown-it/README.md +18 -294
- package/node_modules/markdown-it/bin/markdown-it.mjs +2 -2
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs +3013 -0
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs.map +1 -0
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js +14 -0
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js.map +1 -0
- package/node_modules/markdown-it/dist/markdown-it.cjs.js +4420 -0
- package/node_modules/markdown-it/dist/markdown-it.cjs.js.map +1 -0
- package/node_modules/markdown-it/dist/markdown-it.d.cts +19 -0
- package/node_modules/markdown-it/dist/markdown-it.d.mts +950 -0
- package/node_modules/markdown-it/dist/{index.cjs.js → markdown-it.mjs} +1504 -1525
- package/node_modules/markdown-it/dist/markdown-it.mjs.map +1 -0
- package/node_modules/markdown-it/node_modules/argparse/LICENSE +1 -208
- package/node_modules/markdown-it/node_modules/argparse/README.md +46 -41
- package/node_modules/markdown-it/node_modules/argparse/lib/_colorize.js +72 -0
- package/node_modules/markdown-it/node_modules/argparse/lib/argparse.d.ts +292 -0
- package/node_modules/markdown-it/node_modules/argparse/{argparse.js → lib/argparse.js} +1142 -1029
- package/node_modules/markdown-it/node_modules/argparse/lib/difflib.js +190 -0
- package/node_modules/markdown-it/node_modules/argparse/lib/sub.js +4 -4
- package/node_modules/markdown-it/node_modules/argparse/lib/textwrap.js +28 -28
- package/node_modules/markdown-it/node_modules/argparse/package.json +18 -11
- package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.d.ts +8 -0
- package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.js +46 -0
- package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib → dist}/decode.d.ts +28 -45
- package/node_modules/markdown-it/node_modules/entities/dist/decode.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/decode.js +189 -141
- package/node_modules/markdown-it/node_modules/entities/dist/decode.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/encode.d.ts +4 -2
- package/node_modules/markdown-it/node_modules/entities/dist/encode.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/encode.js +90 -0
- package/node_modules/markdown-it/node_modules/entities/dist/encode.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib → dist}/escape.d.ts +15 -10
- package/node_modules/markdown-it/node_modules/entities/dist/escape.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/escape.js +132 -0
- package/node_modules/markdown-it/node_modules/entities/dist/escape.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.d.ts +3 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.js +5 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.d.ts +3 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.js +5 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.d.ts +5 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.js +12 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/index.d.ts +14 -21
- package/node_modules/markdown-it/node_modules/entities/dist/index.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/index.js +91 -0
- package/node_modules/markdown-it/node_modules/entities/dist/index.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.d.ts +17 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.js +18 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.d.ts +7 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.js +17 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.d.ts +33 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.js +93 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/package.json +63 -70
- package/node_modules/markdown-it/node_modules/entities/readme.md +54 -45
- package/node_modules/markdown-it/node_modules/entities/src/decode-codepoint.ts +50 -0
- package/node_modules/markdown-it/node_modules/entities/src/decode.ts +671 -0
- package/node_modules/markdown-it/node_modules/entities/src/encode.ts +95 -0
- package/node_modules/markdown-it/node_modules/entities/src/escape.ts +160 -0
- package/node_modules/markdown-it/node_modules/entities/src/generated/decode-data-html.ts +7 -0
- package/node_modules/markdown-it/node_modules/entities/src/generated/decode-data-xml.ts +7 -0
- package/node_modules/markdown-it/node_modules/entities/src/generated/encode-html.ts +18 -0
- package/node_modules/markdown-it/node_modules/entities/src/index.ts +162 -0
- package/node_modules/markdown-it/node_modules/entities/src/internal/bin-trie-flags.ts +16 -0
- package/node_modules/markdown-it/node_modules/entities/src/internal/decode-shared.ts +18 -0
- package/node_modules/markdown-it/node_modules/entities/src/internal/encode-shared.ts +123 -0
- package/node_modules/markdown-it/node_modules/linkify-it/README.md +49 -86
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.cjs.js +636 -825
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.cjs.js.map +1 -0
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.d.ts +236 -0
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.mjs +538 -0
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.mjs.map +1 -0
- package/node_modules/markdown-it/node_modules/linkify-it/package.json +23 -20
- package/node_modules/markdown-it/node_modules/uc.micro/README.md +18 -1
- package/node_modules/markdown-it/node_modules/uc.micro/build/index.cjs.js +13 -18
- package/node_modules/markdown-it/node_modules/uc.micro/build/index.d.ts +6 -0
- package/node_modules/markdown-it/node_modules/uc.micro/build/index.mjs +8 -0
- package/node_modules/markdown-it/node_modules/uc.micro/package.json +12 -17
- package/node_modules/markdown-it/package.json +47 -30
- package/node_modules/matrix-js-sdk/CHANGELOG.md +0 -11
- package/node_modules/matrix-js-sdk/package.json +1 -1
- package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/Util.js +1 -7
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +3 -23
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +13 -38
- package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
- package/node_modules/music-metadata/package.json +6 -6
- package/node_modules/typebox/build/compile/validator.d.mts +4 -1
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +2 -5
- package/node_modules/typebox/build/guard/string.mjs +4 -16
- package/node_modules/typebox/build/schema/engine/_functions.mjs +15 -34
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -8
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +32 -29
- package/openclaw.plugin.json +146 -152
- package/package.json +31 -114
- package/dist/accounts-DfngqebB.js +0 -130
- package/dist/active-client-DXvz2gCo.js +0 -20
- package/dist/approval-reactions-D-BxBK_L.js +0 -202
- package/dist/client-Dbso3-0V.js +0 -30
- package/dist/client-bootstrap-XsIkHNt0.js +0 -110
- package/dist/create-client-BmSU-q-D.js +0 -61
- package/dist/credentials-W2EmwRhu.js +0 -65
- package/dist/credentials-read-DVmFCm7X.js +0 -77
- package/dist/doctor-CM8ijNpW.js +0 -64
- package/dist/doctor-contract-BMSJkkAE.js +0 -167
- package/dist/inbound-dedupe-CaBLblef.js +0 -48
- package/dist/probe.runtime-BuieqmS3.js +0 -3
- package/dist/record-shared-CWWx6fvI.js +0 -2
- package/dist/recovery-key-store-BNnHvXdk.js +0 -275
- package/dist/room-info-CAFZ3Z9J.js +0 -87
- package/dist/route-DY6at4qJ.js +0 -161
- package/dist/storage-BvAkgzvT.js +0 -685
- package/node_modules/markdown-it/dist/index.cjs.js.map +0 -1
- package/node_modules/markdown-it/dist/markdown-it.js +0 -3975
- package/node_modules/markdown-it/dist/markdown-it.js.map +0 -1
- package/node_modules/markdown-it/dist/markdown-it.min.js +0 -3
- package/node_modules/markdown-it/dist/markdown-it.min.js.map +0 -1
- package/node_modules/markdown-it/index.mjs +0 -1
- package/node_modules/markdown-it/lib/common/html_blocks.mjs +0 -67
- package/node_modules/markdown-it/lib/common/html_re.mjs +0 -25
- package/node_modules/markdown-it/lib/common/utils.mjs +0 -324
- package/node_modules/markdown-it/lib/helpers/index.mjs +0 -11
- package/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +0 -77
- package/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +0 -49
- package/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +0 -66
- package/node_modules/markdown-it/lib/index.mjs +0 -565
- package/node_modules/markdown-it/lib/parser_block.mjs +0 -134
- package/node_modules/markdown-it/lib/parser_core.mjs +0 -62
- package/node_modules/markdown-it/lib/parser_inline.mjs +0 -197
- package/node_modules/markdown-it/lib/presets/commonmark.mjs +0 -88
- package/node_modules/markdown-it/lib/presets/default.mjs +0 -47
- package/node_modules/markdown-it/lib/presets/zero.mjs +0 -70
- package/node_modules/markdown-it/lib/renderer.mjs +0 -322
- package/node_modules/markdown-it/lib/ruler.mjs +0 -340
- package/node_modules/markdown-it/lib/rules_block/blockquote.mjs +0 -209
- package/node_modules/markdown-it/lib/rules_block/code.mjs +0 -30
- package/node_modules/markdown-it/lib/rules_block/fence.mjs +0 -94
- package/node_modules/markdown-it/lib/rules_block/heading.mjs +0 -51
- package/node_modules/markdown-it/lib/rules_block/hr.mjs +0 -40
- package/node_modules/markdown-it/lib/rules_block/html_block.mjs +0 -80
- package/node_modules/markdown-it/lib/rules_block/lheading.mjs +0 -85
- package/node_modules/markdown-it/lib/rules_block/list.mjs +0 -331
- package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +0 -48
- package/node_modules/markdown-it/lib/rules_block/reference.mjs +0 -212
- package/node_modules/markdown-it/lib/rules_block/state_block.mjs +0 -220
- package/node_modules/markdown-it/lib/rules_block/table.mjs +0 -228
- package/node_modules/markdown-it/lib/rules_core/block.mjs +0 -13
- package/node_modules/markdown-it/lib/rules_core/inline.mjs +0 -11
- package/node_modules/markdown-it/lib/rules_core/linkify.mjs +0 -134
- package/node_modules/markdown-it/lib/rules_core/normalize.mjs +0 -17
- package/node_modules/markdown-it/lib/rules_core/replacements.mjs +0 -101
- package/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +0 -209
- package/node_modules/markdown-it/lib/rules_core/state_core.mjs +0 -17
- package/node_modules/markdown-it/lib/rules_core/text_join.mjs +0 -43
- package/node_modules/markdown-it/lib/rules_inline/autolink.mjs +0 -72
- package/node_modules/markdown-it/lib/rules_inline/backticks.mjs +0 -60
- package/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +0 -124
- package/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +0 -123
- package/node_modules/markdown-it/lib/rules_inline/entity.mjs +0 -51
- package/node_modules/markdown-it/lib/rules_inline/escape.mjs +0 -83
- package/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +0 -38
- package/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +0 -50
- package/node_modules/markdown-it/lib/rules_inline/image.mjs +0 -138
- package/node_modules/markdown-it/lib/rules_inline/link.mjs +0 -139
- package/node_modules/markdown-it/lib/rules_inline/linkify.mjs +0 -63
- package/node_modules/markdown-it/lib/rules_inline/newline.mjs +0 -42
- package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +0 -154
- package/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +0 -127
- package/node_modules/markdown-it/lib/rules_inline/text.mjs +0 -86
- package/node_modules/markdown-it/lib/token.mjs +0 -191
- package/node_modules/markdown-it/node_modules/argparse/CHANGELOG.md +0 -216
- package/node_modules/markdown-it/node_modules/entities/lib/decode.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/decode.js +0 -536
- package/node_modules/markdown-it/node_modules/entities/lib/decode.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.d.ts +0 -19
- package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.js +0 -76
- package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/encode.d.ts +0 -22
- package/node_modules/markdown-it/node_modules/entities/lib/encode.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/encode.js +0 -77
- package/node_modules/markdown-it/node_modules/entities/lib/encode.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/escape.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/escape.js +0 -122
- package/node_modules/markdown-it/node_modules/entities/lib/escape.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.d.ts +0 -211
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.d.ts +0 -19
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.js +0 -71
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.js +0 -69
- package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.d.ts +0 -43
- package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.js +0 -116
- package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +0 -3
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.js +0 -7
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +0 -3
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.js +0 -7
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.d.ts +0 -8
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.js +0 -10
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/index.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/index.js +0 -99
- package/node_modules/markdown-it/node_modules/entities/lib/esm/index.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/package.json +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.d.ts +0 -3
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.js +0 -9
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.d.ts +0 -3
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.d.ts +0 -8
- package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.js +0 -12
- package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/index.d.ts +0 -96
- package/node_modules/markdown-it/node_modules/entities/lib/index.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/index.js +0 -126
- package/node_modules/markdown-it/node_modules/entities/lib/index.js.map +0 -1
- package/node_modules/markdown-it/node_modules/linkify-it/index.mjs +0 -646
- package/node_modules/markdown-it/node_modules/linkify-it/lib/re.mjs +0 -193
- package/node_modules/markdown-it/node_modules/uc.micro/categories/Cc/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/categories/Cf/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/categories/P/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/categories/S/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/categories/Z/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/index.mjs +0 -8
- package/node_modules/markdown-it/node_modules/uc.micro/properties/Any/regex.mjs +0 -1
- /package/dist/{account-config-BZWN9tGS.js → .setup/account-config-BZWN9tGS.mjs} +0 -0
- /package/dist/{backup-health-Dm_YMVFT.js → .setup/backup-health-Dm_YMVFT.mjs} +0 -0
- /package/dist/{config-paths-CnREYb1Y.js → .setup/config-paths-CnREYb1Y.mjs} +0 -0
- /package/dist/{config-secret-input.runtime-CwsP3--c.js → .setup/config-secret-input.runtime-CwsP3--c.mjs} +0 -0
- /package/dist/{crypto-node.runtime-6Aj_ltHQ.js → .setup/crypto-node.runtime-6Aj_ltHQ.mjs} +0 -0
- /package/dist/{errors-C47hvAF8.js → .setup/errors-C47hvAF8.mjs} +0 -0
- /package/dist/{preflight-audio.runtime-BZxxQsxY.js → .setup/preflight-audio.runtime-BZxxQsxY.mjs} +0 -0
- /package/dist/{reaction-common-DkrQdBSZ.js → .setup/reaction-common-DkrQdBSZ.mjs} +0 -0
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{runtime-6S3DNFNv.js → .setup/runtime-6S3DNFNv.mjs} +0 -0
- /package/dist/{runtime-BefyhPWv.js → .setup/runtime-BefyhPWv.mjs} +0 -0
- /package/dist/{sync-state-CWbp0QSY.js → .setup/sync-state-CWbp0QSY.mjs} +0 -0
- /package/dist/{target-ids-B-5aQxwn.js → .setup/target-ids-B-5aQxwn.mjs} +0 -0
- /package/dist/{thread-bindings-shared-CKnY4LSd.js → .setup/thread-bindings-shared-CKnY4LSd.mjs} +0 -0
- /package/dist/{timeout-abort-signal-DMrgRFIy.js → .setup/timeout-abort-signal-DMrgRFIy.mjs} +0 -0
- /package/dist/{url-validation-GRHde6lq.js → .setup/url-validation-GRHde6lq.mjs} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { decodeHTML, decodeXML } from "./decode.js";
|
|
2
|
+
import { encodeHTML, encodeNonAsciiHTML } from "./encode.js";
|
|
3
|
+
import { encodeXML, escapeAttribute, escapeText, escapeUTF8, } from "./escape.js";
|
|
4
|
+
/** The level of entities to support. */
|
|
5
|
+
export var EntityLevel;
|
|
6
|
+
(function (EntityLevel) {
|
|
7
|
+
/** Support only XML entities. */
|
|
8
|
+
EntityLevel[EntityLevel["XML"] = 0] = "XML";
|
|
9
|
+
/** Support HTML entities, which are a superset of XML entities. */
|
|
10
|
+
EntityLevel[EntityLevel["HTML"] = 1] = "HTML";
|
|
11
|
+
})(EntityLevel || (EntityLevel = {}));
|
|
12
|
+
/**
|
|
13
|
+
* Encoding strategy used by `encode`.
|
|
14
|
+
*/
|
|
15
|
+
export var EncodingMode;
|
|
16
|
+
(function (EncodingMode) {
|
|
17
|
+
/**
|
|
18
|
+
* The output is UTF-8 encoded. Only characters that need escaping within
|
|
19
|
+
* XML will be escaped.
|
|
20
|
+
*/
|
|
21
|
+
EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8";
|
|
22
|
+
/**
|
|
23
|
+
* The output consists only of ASCII characters. Characters that need
|
|
24
|
+
* escaping within HTML, and characters that aren't ASCII characters will
|
|
25
|
+
* be escaped.
|
|
26
|
+
*/
|
|
27
|
+
EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII";
|
|
28
|
+
/**
|
|
29
|
+
* Encode all characters that have an equivalent entity, as well as all
|
|
30
|
+
* characters that are not ASCII characters.
|
|
31
|
+
*/
|
|
32
|
+
EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive";
|
|
33
|
+
/**
|
|
34
|
+
* Encode all characters that have to be escaped in HTML attributes,
|
|
35
|
+
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
|
36
|
+
*/
|
|
37
|
+
EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute";
|
|
38
|
+
/**
|
|
39
|
+
* Encode all characters that have to be escaped in HTML text,
|
|
40
|
+
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
|
|
41
|
+
*/
|
|
42
|
+
EncodingMode[EncodingMode["Text"] = 4] = "Text";
|
|
43
|
+
})(EncodingMode || (EncodingMode = {}));
|
|
44
|
+
/**
|
|
45
|
+
* Decodes a string with entities.
|
|
46
|
+
* @param input String to decode.
|
|
47
|
+
* @param options Decoding options.
|
|
48
|
+
*/
|
|
49
|
+
export function decode(input, options = EntityLevel.XML) {
|
|
50
|
+
const level = typeof options === "number" ? options : options.level;
|
|
51
|
+
if (level === EntityLevel.HTML) {
|
|
52
|
+
const mode = typeof options === "object" ? options.mode : undefined;
|
|
53
|
+
return decodeHTML(input, mode);
|
|
54
|
+
}
|
|
55
|
+
return decodeXML(input);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Encodes a string with entities.
|
|
59
|
+
* @param input String to encode.
|
|
60
|
+
* @param options Encoding options.
|
|
61
|
+
*/
|
|
62
|
+
export function encode(input, options = EntityLevel.XML) {
|
|
63
|
+
const { mode = EncodingMode.Extensive, level = EntityLevel.XML } = typeof options === "number" ? { level: options } : options;
|
|
64
|
+
switch (mode) {
|
|
65
|
+
case EncodingMode.UTF8: {
|
|
66
|
+
return escapeUTF8(input);
|
|
67
|
+
}
|
|
68
|
+
case EncodingMode.Attribute: {
|
|
69
|
+
return escapeAttribute(input);
|
|
70
|
+
}
|
|
71
|
+
case EncodingMode.Text: {
|
|
72
|
+
return escapeText(input);
|
|
73
|
+
}
|
|
74
|
+
case EncodingMode.ASCII: {
|
|
75
|
+
return level === EntityLevel.HTML
|
|
76
|
+
? encodeNonAsciiHTML(input)
|
|
77
|
+
: encodeXML(input);
|
|
78
|
+
}
|
|
79
|
+
// biome-ignore lint/complexity/noUselessSwitchCase: we get an error for the switch not being exhaustive
|
|
80
|
+
case EncodingMode.Extensive:
|
|
81
|
+
default: {
|
|
82
|
+
return level === EntityLevel.HTML
|
|
83
|
+
? encodeHTML(input)
|
|
84
|
+
: encodeXML(input);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export { DecodingMode, decodeHTML, decodeHTMLAttribute, decodeHTMLStrict, decodeXML, decodeXML as decodeXMLStrict, EntityDecoder, } from "./decode.js";
|
|
89
|
+
export { encodeHTML, encodeNonAsciiHTML, } from "./encode.js";
|
|
90
|
+
export { encodeXML, escape, escapeAttribute, escapeText, escapeUTF8, } from "./escape.js";
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bit flags & masks for the binary trie encoding used for entity decoding.
|
|
3
|
+
*
|
|
4
|
+
* Bit layout (16 bits total):
|
|
5
|
+
* 15..14 VALUE_LENGTH (+1 encoding; 0 => no value)
|
|
6
|
+
* 13 FLAG13. If valueLength>0: semicolon required flag (implicit ';').
|
|
7
|
+
* If valueLength==0: compact run flag.
|
|
8
|
+
* 12..7 BRANCH_LENGTH Branch length (0 => single branch in 6..0 if jumpOffset==char) OR run length (when compact run)
|
|
9
|
+
* 6..0 JUMP_TABLE Jump offset (jump table) OR single-branch char code OR first run char
|
|
10
|
+
*/
|
|
11
|
+
export declare enum BinTrieFlags {
|
|
12
|
+
VALUE_LENGTH = 49152,
|
|
13
|
+
FLAG13 = 8192,
|
|
14
|
+
BRANCH_LENGTH = 8064,
|
|
15
|
+
JUMP_TABLE = 127
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=bin-trie-flags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-trie-flags.d.ts","sourceRoot":"","sources":["../../src/internal/bin-trie-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,oBAAY,YAAY;IACpB,YAAY,QAAwB;IACpC,MAAM,OAAwB;IAC9B,aAAa,OAAwB;IACrC,UAAU,MAAwB;CACrC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bit flags & masks for the binary trie encoding used for entity decoding.
|
|
3
|
+
*
|
|
4
|
+
* Bit layout (16 bits total):
|
|
5
|
+
* 15..14 VALUE_LENGTH (+1 encoding; 0 => no value)
|
|
6
|
+
* 13 FLAG13. If valueLength>0: semicolon required flag (implicit ';').
|
|
7
|
+
* If valueLength==0: compact run flag.
|
|
8
|
+
* 12..7 BRANCH_LENGTH Branch length (0 => single branch in 6..0 if jumpOffset==char) OR run length (when compact run)
|
|
9
|
+
* 6..0 JUMP_TABLE Jump offset (jump table) OR single-branch char code OR first run char
|
|
10
|
+
*/
|
|
11
|
+
export var BinTrieFlags;
|
|
12
|
+
(function (BinTrieFlags) {
|
|
13
|
+
BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
|
|
14
|
+
BinTrieFlags[BinTrieFlags["FLAG13"] = 8192] = "FLAG13";
|
|
15
|
+
BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 8064] = "BRANCH_LENGTH";
|
|
16
|
+
BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
|
|
17
|
+
})(BinTrieFlags || (BinTrieFlags = {}));
|
|
18
|
+
//# sourceMappingURL=bin-trie-flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin-trie-flags.js","sourceRoot":"","sources":["../../src/internal/bin-trie-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,mEAAoC,CAAA;IACpC,sDAA8B,CAAA;IAC9B,oEAAqC,CAAA;IACrC,6DAAkC,CAAA;AACtC,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared base64 decode helper for generated decode data.
|
|
3
|
+
* Assumes global atob is available.
|
|
4
|
+
* @param input Input string to encode or decode.
|
|
5
|
+
*/
|
|
6
|
+
export declare function decodeBase64(input: string): Uint16Array;
|
|
7
|
+
//# sourceMappingURL=decode-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode-shared.d.ts","sourceRoot":"","sources":["../../src/internal/decode-shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAYvD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared base64 decode helper for generated decode data.
|
|
3
|
+
* Assumes global atob is available.
|
|
4
|
+
* @param input Input string to encode or decode.
|
|
5
|
+
*/
|
|
6
|
+
export function decodeBase64(input) {
|
|
7
|
+
const binary = atob(input);
|
|
8
|
+
const evenLength = binary.length & ~1; // Round down to even length
|
|
9
|
+
const out = new Uint16Array(evenLength / 2);
|
|
10
|
+
for (let index = 0, outIndex = 0; index < evenLength; index += 2) {
|
|
11
|
+
const lo = binary.charCodeAt(index);
|
|
12
|
+
const hi = binary.charCodeAt(index + 1);
|
|
13
|
+
out[outIndex++] = lo | (hi << 8);
|
|
14
|
+
}
|
|
15
|
+
return out;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=decode-shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode-shared.js","sourceRoot":"","sources":["../../src/internal/decode-shared.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACtC,MAAM,MAAM,GAAW,IAAI,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,4BAA4B;IACnE,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAE5C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,QAAQ,GAAG,CAAC,EAAE,KAAK,GAAG,UAAU,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC/D,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACxC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A node inside the encoding trie used by `encode.ts`.
|
|
3
|
+
*
|
|
4
|
+
* There are two physical shapes to minimize allocations and lookup cost:
|
|
5
|
+
*
|
|
6
|
+
* 1. Leaf node (string)
|
|
7
|
+
* - A plain string (already in the form `"&name;"`).
|
|
8
|
+
* - Represents a terminal match with no children.
|
|
9
|
+
*
|
|
10
|
+
* 2. Branch / value node (object)
|
|
11
|
+
*/
|
|
12
|
+
export type EncodeTrieNode = string | {
|
|
13
|
+
/**
|
|
14
|
+
* Entity value for the current code point sequence (wrapped: `&...;`).
|
|
15
|
+
* Present when the path to this node itself is a valid named entity.
|
|
16
|
+
*/
|
|
17
|
+
value: string | undefined;
|
|
18
|
+
/** If a number, the next code unit of the only next character. */
|
|
19
|
+
next: number | Map<number, EncodeTrieNode>;
|
|
20
|
+
/** If next is a number, `nextValue` contains the entity value. */
|
|
21
|
+
nextValue?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Parse a compact encode trie string into a Map structure used for encoding.
|
|
25
|
+
*
|
|
26
|
+
* Format per entry (ascending code points using delta encoding):
|
|
27
|
+
* <diffBase36>[&name;][{<children>}] -- diff omitted when 0
|
|
28
|
+
* Where diff = currentKey - previousKey - 1 (first entry stores absolute key).
|
|
29
|
+
* `&name;` is the entity value (already wrapped); a following `{` denotes children.
|
|
30
|
+
* @param serialized Serialized text fragment to encode.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseEncodeTrie(serialized: string): Map<number, EncodeTrieNode>;
|
|
33
|
+
//# sourceMappingURL=encode-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode-shared.d.ts","sourceRoot":"","sources":["../../src/internal/encode-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,cAAc,GACpB,MAAM,GACN;IACI;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,kEAAkE;IAClE,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC3C,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAER;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,MAAM,GACnB,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAsF7B"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a compact encode trie string into a Map structure used for encoding.
|
|
3
|
+
*
|
|
4
|
+
* Format per entry (ascending code points using delta encoding):
|
|
5
|
+
* <diffBase36>[&name;][{<children>}] -- diff omitted when 0
|
|
6
|
+
* Where diff = currentKey - previousKey - 1 (first entry stores absolute key).
|
|
7
|
+
* `&name;` is the entity value (already wrapped); a following `{` denotes children.
|
|
8
|
+
* @param serialized Serialized text fragment to encode.
|
|
9
|
+
*/
|
|
10
|
+
export function parseEncodeTrie(serialized) {
|
|
11
|
+
const top = new Map();
|
|
12
|
+
const totalLength = serialized.length;
|
|
13
|
+
let cursor = 0;
|
|
14
|
+
let lastTopKey = -1;
|
|
15
|
+
function readDiff() {
|
|
16
|
+
const start = cursor;
|
|
17
|
+
while (cursor < totalLength) {
|
|
18
|
+
const char = serialized.charAt(cursor);
|
|
19
|
+
if ((char < "0" || char > "9") && (char < "a" || char > "z")) {
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
cursor++;
|
|
23
|
+
}
|
|
24
|
+
if (cursor === start)
|
|
25
|
+
return 0;
|
|
26
|
+
return Number.parseInt(serialized.slice(start, cursor), 36);
|
|
27
|
+
}
|
|
28
|
+
function readEntity() {
|
|
29
|
+
if (serialized[cursor] !== "&") {
|
|
30
|
+
throw new Error(`Child entry missing value near index ${cursor}`);
|
|
31
|
+
}
|
|
32
|
+
// Cursor currently points at '&'
|
|
33
|
+
const start = cursor;
|
|
34
|
+
const end = serialized.indexOf(";", cursor + 1);
|
|
35
|
+
if (end === -1) {
|
|
36
|
+
throw new Error(`Unterminated entity starting at index ${start}`);
|
|
37
|
+
}
|
|
38
|
+
cursor = end + 1; // Move past ';'
|
|
39
|
+
return serialized.slice(start, cursor); // Includes & ... ;
|
|
40
|
+
}
|
|
41
|
+
while (cursor < totalLength) {
|
|
42
|
+
const keyDiff = readDiff();
|
|
43
|
+
const key = lastTopKey === -1 ? keyDiff : lastTopKey + keyDiff + 1;
|
|
44
|
+
let value;
|
|
45
|
+
if (serialized[cursor] === "&")
|
|
46
|
+
value = readEntity();
|
|
47
|
+
if (serialized[cursor] === "{") {
|
|
48
|
+
cursor++; // Skip '{'
|
|
49
|
+
// Parse first child
|
|
50
|
+
let diff = readDiff();
|
|
51
|
+
let childKey = diff; // First key (lastChildKey = -1)
|
|
52
|
+
const firstValue = readEntity();
|
|
53
|
+
if (serialized[cursor] === "{") {
|
|
54
|
+
throw new Error("Unexpected nested '{' beyond depth 2");
|
|
55
|
+
}
|
|
56
|
+
// If end of block -> single child optimization
|
|
57
|
+
if (serialized[cursor] === "}") {
|
|
58
|
+
top.set(key, { value, next: childKey, nextValue: firstValue });
|
|
59
|
+
cursor++; // Skip '}'
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const childMap = new Map([
|
|
63
|
+
[childKey, firstValue],
|
|
64
|
+
]);
|
|
65
|
+
let lastChildKey = childKey;
|
|
66
|
+
while (cursor < totalLength && serialized[cursor] !== "}") {
|
|
67
|
+
diff = readDiff();
|
|
68
|
+
childKey = lastChildKey + diff + 1;
|
|
69
|
+
const childValue = readEntity();
|
|
70
|
+
if (serialized[cursor] === "{") {
|
|
71
|
+
throw new Error("Unexpected nested '{' beyond depth 2");
|
|
72
|
+
}
|
|
73
|
+
childMap.set(childKey, childValue);
|
|
74
|
+
lastChildKey = childKey;
|
|
75
|
+
}
|
|
76
|
+
if (serialized[cursor] !== "}") {
|
|
77
|
+
throw new Error("Unterminated child block");
|
|
78
|
+
}
|
|
79
|
+
cursor++; // Skip '}'
|
|
80
|
+
top.set(key, { value, next: childMap });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (value === undefined) {
|
|
84
|
+
throw new Error(`Malformed encode trie: missing value at index ${cursor}`);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
top.set(key, value);
|
|
88
|
+
}
|
|
89
|
+
lastTopKey = key;
|
|
90
|
+
}
|
|
91
|
+
return top;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=encode-shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode-shared.js","sourceRoot":"","sources":["../../src/internal/encode-shared.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,90 +1,83 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "entities",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Encode & decode XML and HTML entities with ease & speed",
|
|
5
|
-
"author": "Felix Boehm <me@feedic.com>",
|
|
6
|
-
"funding": "https://github.com/fb55/entities?sponsor=1",
|
|
7
|
-
"sideEffects": false,
|
|
8
5
|
"keywords": [
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"encoding",
|
|
12
|
-
"html",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
6
|
+
"html entities",
|
|
7
|
+
"entity decoder",
|
|
8
|
+
"entity encoding",
|
|
9
|
+
"html decoding",
|
|
10
|
+
"html encoding",
|
|
11
|
+
"xml decoding",
|
|
12
|
+
"xml encoding"
|
|
15
13
|
],
|
|
16
|
-
"
|
|
17
|
-
"
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/fb55/entities.git"
|
|
18
17
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
18
|
+
"funding": "https://github.com/fb55/entities?sponsor=1",
|
|
19
|
+
"license": "BSD-2-Clause",
|
|
20
|
+
"author": "Felix Boehm <me@feedic.com>",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"type": "module",
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
26
27
|
},
|
|
27
|
-
"./
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"./decode": {
|
|
29
|
+
"types": "./dist/decode.d.ts",
|
|
30
|
+
"default": "./dist/decode.js"
|
|
30
31
|
},
|
|
31
|
-
"./
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"./escape": {
|
|
33
|
+
"types": "./dist/escape.d.ts",
|
|
34
|
+
"default": "./dist/escape.js"
|
|
34
35
|
}
|
|
35
36
|
},
|
|
37
|
+
"main": "./dist/index.js",
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
36
39
|
"files": [
|
|
37
|
-
"
|
|
40
|
+
"dist",
|
|
41
|
+
"src",
|
|
42
|
+
"!**/*.spec.ts"
|
|
38
43
|
],
|
|
39
|
-
"engines": {
|
|
40
|
-
"node": ">=0.12"
|
|
41
|
-
},
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@types/jest": "^28.1.8",
|
|
44
|
-
"@types/node": "^18.15.11",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
46
|
-
"@typescript-eslint/parser": "^5.58.0",
|
|
47
|
-
"eslint": "^8.38.0",
|
|
48
|
-
"eslint-config-prettier": "^8.8.0",
|
|
49
|
-
"eslint-plugin-node": "^11.1.0",
|
|
50
|
-
"jest": "^28.1.3",
|
|
51
|
-
"prettier": "^2.8.7",
|
|
52
|
-
"ts-jest": "^28.0.8",
|
|
53
|
-
"typedoc": "^0.24.1",
|
|
54
|
-
"typescript": "^5.0.4"
|
|
55
|
-
},
|
|
56
44
|
"scripts": {
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"lint": "npm run lint:es && npm run lint:prettier",
|
|
60
|
-
"lint:es": "eslint .",
|
|
61
|
-
"lint:prettier": "npm run prettier -- --check",
|
|
62
|
-
"format": "npm run format:es && npm run format:prettier",
|
|
63
|
-
"format:es": "npm run lint:es -- --fix",
|
|
64
|
-
"format:prettier": "npm run prettier -- --write",
|
|
65
|
-
"prettier": "prettier '**/*.{ts,md,json,yml}'",
|
|
66
|
-
"build": "npm run build:cjs && npm run build:esm",
|
|
67
|
-
"build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/entities/$(git rev-parse HEAD)/src/",
|
|
68
|
-
"build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
|
|
45
|
+
"benchmark": "node --import=tsx scripts/benchmark.ts",
|
|
46
|
+
"build": "tsc",
|
|
69
47
|
"build:docs": "typedoc --hideGenerator src/index.ts",
|
|
70
|
-
"build:trie": "
|
|
71
|
-
"build:
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
48
|
+
"build:encode-trie": "node --import=tsx scripts/write-encode-map.ts",
|
|
49
|
+
"build:trie": "node --import=tsx scripts/write-decode-map.ts",
|
|
50
|
+
"format": "npm run format:es && npm run format:biome",
|
|
51
|
+
"format:biome": "biome check --fix .",
|
|
52
|
+
"format:es": "npm run lint:es -- --fix",
|
|
53
|
+
"lint": "npm run lint:es && npm run lint:ts && npm run lint:biome",
|
|
54
|
+
"lint:biome": "biome check .",
|
|
55
|
+
"lint:es": "eslint .",
|
|
56
|
+
"lint:ts": "tsc --noEmit",
|
|
57
|
+
"prepublishOnly": "npm run build",
|
|
58
|
+
"test": "npm run test:vi && npm run lint",
|
|
59
|
+
"test:vi": "vitest run"
|
|
77
60
|
},
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@biomejs/biome": "^2.4.7",
|
|
63
|
+
"@eslint/compat": "^2.0.3",
|
|
64
|
+
"@feedic/eslint-config": "^0.3.1",
|
|
65
|
+
"@types/he": "^1.2.3",
|
|
66
|
+
"@types/node": "^25.5.0",
|
|
67
|
+
"eslint": "^10.0.3",
|
|
68
|
+
"eslint-config-biome": "^2.1.3",
|
|
69
|
+
"globals": "^17.4.0",
|
|
70
|
+
"he": "^1.2.0",
|
|
71
|
+
"html-entities": "^2.6.0",
|
|
72
|
+
"parse-entities": "^4.0.2",
|
|
73
|
+
"tinybench": "^6.0.0",
|
|
74
|
+
"tsx": "^4.21.0",
|
|
75
|
+
"typedoc": "^0.28.17",
|
|
76
|
+
"typescript": "^5.9.3",
|
|
77
|
+
"typescript-eslint": "^8.57.1",
|
|
78
|
+
"vitest": "^4.0.17"
|
|
85
79
|
},
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"proseWrap": "always"
|
|
80
|
+
"engines": {
|
|
81
|
+
"node": ">=20.19.0"
|
|
89
82
|
}
|
|
90
83
|
}
|
|
@@ -4,16 +4,16 @@ Encode & decode HTML & XML entities with ease & speed.
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
- 😇 Tried and true: `entities` is used by many popular libraries; eg.
|
|
8
|
+
[`htmlparser2`](https://github.com/fb55/htmlparser2), the official
|
|
9
|
+
[AWS SDK](https://github.com/aws/aws-sdk-js-v3) and
|
|
10
|
+
[`commonmark`](https://github.com/commonmark/commonmark.js) use it to process
|
|
11
|
+
HTML entities.
|
|
12
|
+
- ⚡️ Fast: `entities` is the fastest library for decoding HTML entities (as of
|
|
13
|
+
September 2025); see [performance](#performance).
|
|
14
|
+
- 🎛 Configurable: Get an output tailored for your needs. You are fine with
|
|
15
|
+
UTF8? That'll save you some bytes. Prefer to only have ASCII characters? We
|
|
16
|
+
can do that as well!
|
|
17
17
|
|
|
18
18
|
## How to…
|
|
19
19
|
|
|
@@ -24,7 +24,7 @@ Encode & decode HTML & XML entities with ease & speed.
|
|
|
24
24
|
### …use `entities`
|
|
25
25
|
|
|
26
26
|
```javascript
|
|
27
|
-
|
|
27
|
+
import * as entities from "entities";
|
|
28
28
|
|
|
29
29
|
// Encoding
|
|
30
30
|
entities.escapeUTF8("& ü"); // "&#38; ü"
|
|
@@ -38,15 +38,36 @@ entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
|
|
38
38
|
|
|
39
39
|
## Performance
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
Benchmarked in September 2025 with Node v24.6.0 on Apple M2 using `tinybench`.
|
|
42
|
+
Higher ops/s is better; `avg (μs)` is the mean time per operation.
|
|
43
|
+
See `scripts/benchmark.ts` to reproduce.
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
45
|
+
### Decoding
|
|
46
|
+
|
|
47
|
+
| Library | Version | ops/s | avg (μs) | ±% | slower |
|
|
48
|
+
| -------------- | ------- | --------- | -------- | ---- | ------ |
|
|
49
|
+
| entities | 7.0.0 | 5,838,416 | 175.57 | 0.06 | — |
|
|
50
|
+
| html-entities | 2.6.0 | 2,919,637 | 347.77 | 0.33 | 50.0% |
|
|
51
|
+
| he | 1.2.0 | 2,318,438 | 446.48 | 0.70 | 60.3% |
|
|
52
|
+
| parse-entities | 4.0.2 | 852,855 | 1,199.51 | 0.36 | 85.4% |
|
|
53
|
+
|
|
54
|
+
### Encoding
|
|
55
|
+
|
|
56
|
+
| Library | Version | ops/s | avg (μs) | ±% | slower |
|
|
57
|
+
| -------------- | ------- | --------- | -------- | ---- | ------ |
|
|
58
|
+
| entities | 7.0.0 | 2,770,115 | 368.09 | 0.11 | — |
|
|
59
|
+
| html-entities | 2.6.0 | 1,491,963 | 679.96 | 0.58 | 46.2% |
|
|
60
|
+
| he | 1.2.0 | 481,278 | 2,118.25 | 0.61 | 82.6% |
|
|
61
|
+
|
|
62
|
+
### Escaping
|
|
63
|
+
|
|
64
|
+
| Library | Version | ops/s | avg (μs) | ±% | slower |
|
|
65
|
+
| -------------- | ------- | --------- | -------- | ---- | ------ |
|
|
66
|
+
| entities | 7.0.0 | 4,616,468 | 223.84 | 0.17 | — |
|
|
67
|
+
| he | 1.2.0 | 3,659,301 | 280.76 | 0.58 | 20.7% |
|
|
68
|
+
| html-entities | 2.6.0 | 3,555,301 | 296.63 | 0.84 | 23.0% |
|
|
69
|
+
|
|
70
|
+
Note: Micro-benchmarks may vary across machines and Node versions.
|
|
50
71
|
|
|
51
72
|
---
|
|
52
73
|
|
|
@@ -68,8 +89,8 @@ This is helpful for decoding entities in legacy environments.
|
|
|
68
89
|
|
|
69
90
|
> Why should I use `entities` instead of alternative modules?
|
|
70
91
|
|
|
71
|
-
As of
|
|
72
|
-
not a
|
|
92
|
+
As of September 2025, `entities` is faster than other modules. Still, this is
|
|
93
|
+
not a differentiated space and other modules can catch up.
|
|
73
94
|
|
|
74
95
|
**More importantly**, you might already have `entities` in your dependency graph
|
|
75
96
|
(as a dependency of eg. `cheerio`, or `htmlparser2`), and including it directly
|
|
@@ -78,10 +99,9 @@ libraries, so have a look through your `node_modules` directory!
|
|
|
78
99
|
|
|
79
100
|
> Does `entities` support tree shaking?
|
|
80
101
|
|
|
81
|
-
Yes!
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Instead, use the functions that you need directly.
|
|
102
|
+
Yes! Note that for best results, you should not use the `encode` and `decode`
|
|
103
|
+
functions, as they wrap around a number of other functions, all of which will
|
|
104
|
+
remain in the bundle. Instead, use the functions that you need directly.
|
|
85
105
|
|
|
86
106
|
---
|
|
87
107
|
|
|
@@ -90,15 +110,15 @@ Instead, use the functions that you need directly.
|
|
|
90
110
|
This library wouldn't be possible without the work of these individuals. Thanks
|
|
91
111
|
to
|
|
92
112
|
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
- [@mathiasbynens](https://github.com/mathiasbynens) for his explanations about
|
|
114
|
+
character encodings, and his library `he`, which was one of the inspirations
|
|
115
|
+
for `entities`
|
|
116
|
+
- [@inikulin](https://github.com/inikulin) for his work on optimized tries for
|
|
117
|
+
decoding HTML entities for the `parse5` project
|
|
118
|
+
- [@mdevils](https://github.com/mdevils) for taking on the challenge of
|
|
119
|
+
producing a quick entity library with his `html-entities` library. `entities`
|
|
120
|
+
would be quite a bit slower if there wasn't any competition. Right now
|
|
121
|
+
`entities` is on top, but we'll see how long that lasts!
|
|
102
122
|
|
|
103
123
|
---
|
|
104
124
|
|
|
@@ -109,14 +129,3 @@ License: BSD-2-Clause
|
|
|
109
129
|
To report a security vulnerability, please use the
|
|
110
130
|
[Tidelift security contact](https://tidelift.com/security). Tidelift will
|
|
111
131
|
coordinate the fix and disclosure.
|
|
112
|
-
|
|
113
|
-
## `entities` for enterprise
|
|
114
|
-
|
|
115
|
-
Available as part of the Tidelift Subscription
|
|
116
|
-
|
|
117
|
-
The maintainers of `entities` and thousands of other packages are working with
|
|
118
|
-
Tidelift to deliver commercial support and maintenance for the open source
|
|
119
|
-
dependencies you use to build your applications. Save time, reduce risk, and
|
|
120
|
-
improve code health, while paying the maintainers of the exact dependencies you
|
|
121
|
-
use.
|
|
122
|
-
[Learn more.](https://tidelift.com/subscription/pkg/npm-entities?utm_source=npm-entities&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|