@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
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { a as resolveMatrixDefaultOrOnlyAccountId, o as resolveMatrixAccountStringValues, r as resolveConfiguredMatrixAccountIds } from "./account-selection-kqquRzCf.js";
|
|
2
|
-
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig, t as findMatrixAccountConfig } from "./account-config-BZWN9tGS.js";
|
|
3
|
-
import { i as resolveScopedMatrixEnvConfig, n as resolveGlobalMatrixEnvConfig } from "./env-auth-CQsYbz-p.js";
|
|
4
|
-
import { o as loadMatrixCredentials, r as credentialsMatchConfig } from "./credentials-read-DVmFCm7X.js";
|
|
5
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
|
-
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
|
-
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input-runtime";
|
|
8
|
-
//#region extensions/matrix/src/matrix/accounts.ts
|
|
9
|
-
function clean(value) {
|
|
10
|
-
return normalizeOptionalString(value) ?? "";
|
|
11
|
-
}
|
|
12
|
-
function resolveMatrixAccountAuthView(params) {
|
|
13
|
-
const normalizedAccountId = normalizeAccountId(params.accountId);
|
|
14
|
-
const matrix = resolveMatrixBaseConfig(params.cfg);
|
|
15
|
-
const account = findMatrixAccountConfig(params.cfg, normalizedAccountId) ?? {};
|
|
16
|
-
const resolvedStrings = resolveMatrixAccountStringValues({
|
|
17
|
-
accountId: normalizedAccountId,
|
|
18
|
-
account: {
|
|
19
|
-
homeserver: clean(account.homeserver),
|
|
20
|
-
userId: clean(account.userId),
|
|
21
|
-
accessToken: typeof account.accessToken === "string" ? clean(account.accessToken) : "",
|
|
22
|
-
password: typeof account.password === "string" ? clean(account.password) : "",
|
|
23
|
-
deviceId: clean(account.deviceId),
|
|
24
|
-
deviceName: clean(account.deviceName)
|
|
25
|
-
},
|
|
26
|
-
scopedEnv: resolveScopedMatrixEnvConfig(normalizedAccountId, params.env),
|
|
27
|
-
channel: {
|
|
28
|
-
homeserver: clean(matrix.homeserver),
|
|
29
|
-
userId: clean(matrix.userId),
|
|
30
|
-
accessToken: typeof matrix.accessToken === "string" ? clean(matrix.accessToken) : "",
|
|
31
|
-
password: typeof matrix.password === "string" ? clean(matrix.password) : "",
|
|
32
|
-
deviceId: clean(matrix.deviceId),
|
|
33
|
-
deviceName: clean(matrix.deviceName)
|
|
34
|
-
},
|
|
35
|
-
globalEnv: resolveGlobalMatrixEnvConfig(params.env)
|
|
36
|
-
});
|
|
37
|
-
return {
|
|
38
|
-
homeserver: resolvedStrings.homeserver,
|
|
39
|
-
userId: resolvedStrings.userId,
|
|
40
|
-
accessToken: resolvedStrings.accessToken || void 0,
|
|
41
|
-
password: resolvedStrings.password || void 0
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function resolveMatrixAccountUserId(params) {
|
|
45
|
-
const env = params.env ?? process.env;
|
|
46
|
-
const authView = resolveMatrixAccountAuthView({
|
|
47
|
-
cfg: params.cfg,
|
|
48
|
-
accountId: params.accountId,
|
|
49
|
-
env
|
|
50
|
-
});
|
|
51
|
-
const configuredUserId = authView.userId.trim();
|
|
52
|
-
if (configuredUserId) return configuredUserId;
|
|
53
|
-
const stored = loadMatrixCredentials(env, params.accountId);
|
|
54
|
-
if (!stored) return null;
|
|
55
|
-
if (authView.homeserver && stored.homeserver !== authView.homeserver) return null;
|
|
56
|
-
if (authView.accessToken && stored.accessToken !== authView.accessToken) return null;
|
|
57
|
-
return stored.userId.trim() || null;
|
|
58
|
-
}
|
|
59
|
-
function listMatrixAccountIds(cfg) {
|
|
60
|
-
const ids = resolveConfiguredMatrixAccountIds(cfg, process.env);
|
|
61
|
-
return ids.length > 0 ? ids : [DEFAULT_ACCOUNT_ID];
|
|
62
|
-
}
|
|
63
|
-
function resolveDefaultMatrixAccountId(cfg) {
|
|
64
|
-
return normalizeAccountId(resolveMatrixDefaultOrOnlyAccountId(cfg));
|
|
65
|
-
}
|
|
66
|
-
function resolveConfiguredMatrixBotUserIds(params) {
|
|
67
|
-
const env = params.env ?? process.env;
|
|
68
|
-
const currentAccountId = normalizeAccountId(params.accountId);
|
|
69
|
-
const accountIds = new Set(resolveConfiguredMatrixAccountIds(params.cfg, env));
|
|
70
|
-
if (resolveMatrixAccount({
|
|
71
|
-
cfg: params.cfg,
|
|
72
|
-
accountId: DEFAULT_ACCOUNT_ID,
|
|
73
|
-
env
|
|
74
|
-
}).configured) accountIds.add(DEFAULT_ACCOUNT_ID);
|
|
75
|
-
const ids = /* @__PURE__ */ new Set();
|
|
76
|
-
for (const accountId of accountIds) {
|
|
77
|
-
if (normalizeAccountId(accountId) === currentAccountId) continue;
|
|
78
|
-
if (!resolveMatrixAccount({
|
|
79
|
-
cfg: params.cfg,
|
|
80
|
-
accountId,
|
|
81
|
-
env
|
|
82
|
-
}).configured) continue;
|
|
83
|
-
const userId = resolveMatrixAccountUserId({
|
|
84
|
-
cfg: params.cfg,
|
|
85
|
-
accountId,
|
|
86
|
-
env
|
|
87
|
-
});
|
|
88
|
-
if (userId) ids.add(userId);
|
|
89
|
-
}
|
|
90
|
-
return ids;
|
|
91
|
-
}
|
|
92
|
-
function resolveMatrixAccount(params) {
|
|
93
|
-
const env = params.env ?? process.env;
|
|
94
|
-
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultMatrixAccountId(params.cfg));
|
|
95
|
-
const matrixBase = resolveMatrixBaseConfig(params.cfg);
|
|
96
|
-
const base = resolveMatrixAccountConfig({
|
|
97
|
-
cfg: params.cfg,
|
|
98
|
-
accountId,
|
|
99
|
-
env
|
|
100
|
-
});
|
|
101
|
-
const explicitAuthConfig = accountId === DEFAULT_ACCOUNT_ID ? base : findMatrixAccountConfig(params.cfg, accountId) ?? {};
|
|
102
|
-
const enabled = base.enabled !== false && matrixBase.enabled !== false;
|
|
103
|
-
const authView = resolveMatrixAccountAuthView({
|
|
104
|
-
cfg: params.cfg,
|
|
105
|
-
accountId,
|
|
106
|
-
env
|
|
107
|
-
});
|
|
108
|
-
const hasHomeserver = Boolean(authView.homeserver);
|
|
109
|
-
const hasUserId = Boolean(authView.userId);
|
|
110
|
-
const hasAccessToken = Boolean(authView.accessToken) || hasConfiguredSecretInput(explicitAuthConfig.accessToken);
|
|
111
|
-
const hasPassword = Boolean(authView.password);
|
|
112
|
-
const hasPasswordAuth = hasUserId && (hasPassword || hasConfiguredSecretInput(explicitAuthConfig.password));
|
|
113
|
-
const stored = loadMatrixCredentials(env, accountId);
|
|
114
|
-
const hasStored = stored && authView.homeserver ? credentialsMatchConfig(stored, {
|
|
115
|
-
homeserver: authView.homeserver,
|
|
116
|
-
userId: authView.userId || ""
|
|
117
|
-
}) : false;
|
|
118
|
-
const configured = hasHomeserver && (hasAccessToken || hasPasswordAuth || hasStored);
|
|
119
|
-
return {
|
|
120
|
-
accountId,
|
|
121
|
-
enabled,
|
|
122
|
-
name: normalizeOptionalString(base.name),
|
|
123
|
-
configured,
|
|
124
|
-
homeserver: authView.homeserver || void 0,
|
|
125
|
-
userId: authView.userId || void 0,
|
|
126
|
-
config: base
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
//#endregion
|
|
130
|
-
export { resolveMatrixAccount as i, resolveConfiguredMatrixBotUserIds as n, resolveDefaultMatrixAccountId as r, listMatrixAccountIds as t };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
2
|
-
//#region extensions/matrix/src/matrix/active-client.ts
|
|
3
|
-
const activeClients = /* @__PURE__ */ new Map();
|
|
4
|
-
function resolveAccountKey(accountId) {
|
|
5
|
-
return normalizeAccountId(accountId) || DEFAULT_ACCOUNT_ID;
|
|
6
|
-
}
|
|
7
|
-
function setActiveMatrixClient(client, accountId) {
|
|
8
|
-
const key = resolveAccountKey(accountId);
|
|
9
|
-
if (!client) {
|
|
10
|
-
activeClients.delete(key);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
activeClients.set(key, client);
|
|
14
|
-
}
|
|
15
|
-
function getActiveMatrixClient(accountId) {
|
|
16
|
-
const key = resolveAccountKey(accountId);
|
|
17
|
-
return activeClients.get(key) ?? null;
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
export { setActiveMatrixClient as n, getActiveMatrixClient as t };
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { n as getOptionalMatrixRuntime } from "./runtime-6S3DNFNv.js";
|
|
2
|
-
import { normalizeAccountId, normalizeOptionalAccountId } from "openclaw/plugin-sdk/routing";
|
|
3
|
-
import { createApprovalReactionTargetStore } from "openclaw/plugin-sdk/approval-reaction-runtime";
|
|
4
|
-
//#region extensions/matrix/src/approval-reactions.ts
|
|
5
|
-
const MATRIX_APPROVAL_REACTION_META = {
|
|
6
|
-
"allow-once": {
|
|
7
|
-
emoji: "✅",
|
|
8
|
-
label: "Allow once"
|
|
9
|
-
},
|
|
10
|
-
"allow-always": {
|
|
11
|
-
emoji: "♾️",
|
|
12
|
-
label: "Allow always"
|
|
13
|
-
},
|
|
14
|
-
deny: {
|
|
15
|
-
emoji: "❌",
|
|
16
|
-
label: "Deny"
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const MATRIX_APPROVAL_REACTION_ORDER = [
|
|
20
|
-
"allow-once",
|
|
21
|
-
"allow-always",
|
|
22
|
-
"deny"
|
|
23
|
-
];
|
|
24
|
-
const PERSISTENT_NAMESPACE = "matrix.approval-reactions";
|
|
25
|
-
const PERSISTENT_MAX_ENTRIES = 1e3;
|
|
26
|
-
const DEFAULT_REACTION_TARGET_TTL_MS = 1440 * 60 * 1e3;
|
|
27
|
-
function reportPersistentApprovalReactionError(error) {
|
|
28
|
-
try {
|
|
29
|
-
getOptionalMatrixRuntime()?.logging.getChildLogger({
|
|
30
|
-
plugin: "matrix",
|
|
31
|
-
feature: "approval-reaction-state"
|
|
32
|
-
}).warn("Matrix persistent approval reaction state failed", { error: String(error) });
|
|
33
|
-
} catch {}
|
|
34
|
-
}
|
|
35
|
-
function readPersistedTarget(target) {
|
|
36
|
-
const value = target;
|
|
37
|
-
const accountId = typeof value?.accountId === "string" ? normalizeOptionalAccountId(value.accountId) : void 0;
|
|
38
|
-
const approvalId = typeof value?.approvalId === "string" ? value.approvalId.trim() : "";
|
|
39
|
-
const roomId = typeof value?.roomId === "string" ? value.roomId.trim() : "";
|
|
40
|
-
const eventId = typeof value?.eventId === "string" ? value.eventId.trim() : "";
|
|
41
|
-
if (!value || !accountId || !approvalId || !Array.isArray(value.allowedDecisions) || !roomId || !eventId || value.approvalKind !== "exec" && value.approvalKind !== "plugin") return null;
|
|
42
|
-
return {
|
|
43
|
-
accountId,
|
|
44
|
-
approvalId,
|
|
45
|
-
approvalKind: value.approvalKind,
|
|
46
|
-
roomId,
|
|
47
|
-
eventId,
|
|
48
|
-
allowedDecisions: value.allowedDecisions
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function openPersistentMatrixApprovalReactionStore() {
|
|
52
|
-
return getOptionalMatrixRuntime()?.state.openKeyedStore({
|
|
53
|
-
namespace: PERSISTENT_NAMESPACE,
|
|
54
|
-
maxEntries: PERSISTENT_MAX_ENTRIES,
|
|
55
|
-
defaultTtlMs: DEFAULT_REACTION_TARGET_TTL_MS
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
const matrixApprovalReactionTargets = createApprovalReactionTargetStore({
|
|
59
|
-
namespace: PERSISTENT_NAMESPACE,
|
|
60
|
-
maxEntries: PERSISTENT_MAX_ENTRIES,
|
|
61
|
-
defaultTtlMs: DEFAULT_REACTION_TARGET_TTL_MS,
|
|
62
|
-
openStore: openPersistentMatrixApprovalReactionStore,
|
|
63
|
-
logPersistentError: reportPersistentApprovalReactionError,
|
|
64
|
-
readPersistedTarget
|
|
65
|
-
});
|
|
66
|
-
const matrixApprovalReactionTargetIndex = /* @__PURE__ */ new Map();
|
|
67
|
-
function pruneMatrixApprovalReactionTargetIndex() {
|
|
68
|
-
const nowMs = Date.now();
|
|
69
|
-
for (const [key, entry] of matrixApprovalReactionTargetIndex) if (entry.expiresAtMs <= nowMs) matrixApprovalReactionTargetIndex.delete(key);
|
|
70
|
-
while (matrixApprovalReactionTargetIndex.size > PERSISTENT_MAX_ENTRIES) {
|
|
71
|
-
const oldestKey = matrixApprovalReactionTargetIndex.keys().next().value;
|
|
72
|
-
if (!oldestKey) return;
|
|
73
|
-
matrixApprovalReactionTargetIndex.delete(oldestKey);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function buildReactionTargetKey(accountId, roomId, eventId) {
|
|
77
|
-
const normalizedAccountId = normalizeAccountId(accountId);
|
|
78
|
-
const normalizedRoomId = roomId.trim();
|
|
79
|
-
const normalizedEventId = eventId.trim();
|
|
80
|
-
if (!normalizedAccountId || !normalizedRoomId || !normalizedEventId) return null;
|
|
81
|
-
return JSON.stringify([
|
|
82
|
-
normalizedAccountId,
|
|
83
|
-
normalizedRoomId,
|
|
84
|
-
normalizedEventId
|
|
85
|
-
]);
|
|
86
|
-
}
|
|
87
|
-
function listMatrixApprovalReactionBindings(allowedDecisions) {
|
|
88
|
-
const allowed = new Set(allowedDecisions);
|
|
89
|
-
return MATRIX_APPROVAL_REACTION_ORDER.filter((decision) => allowed.has(decision)).map((decision) => ({
|
|
90
|
-
decision,
|
|
91
|
-
emoji: MATRIX_APPROVAL_REACTION_META[decision].emoji,
|
|
92
|
-
label: MATRIX_APPROVAL_REACTION_META[decision].label
|
|
93
|
-
}));
|
|
94
|
-
}
|
|
95
|
-
function buildMatrixApprovalReactionHint(allowedDecisions) {
|
|
96
|
-
const bindings = listMatrixApprovalReactionBindings(allowedDecisions);
|
|
97
|
-
if (bindings.length === 0) return null;
|
|
98
|
-
return `React here: ${bindings.map((binding) => `${binding.emoji} ${binding.label}`).join(", ")}`;
|
|
99
|
-
}
|
|
100
|
-
function resolveMatrixApprovalReactionDecision(reactionKey, allowedDecisions) {
|
|
101
|
-
const normalizedReaction = reactionKey.trim();
|
|
102
|
-
if (!normalizedReaction) return null;
|
|
103
|
-
const allowed = new Set(allowedDecisions);
|
|
104
|
-
for (const decision of MATRIX_APPROVAL_REACTION_ORDER) {
|
|
105
|
-
if (!allowed.has(decision)) continue;
|
|
106
|
-
if (MATRIX_APPROVAL_REACTION_META[decision].emoji === normalizedReaction) return decision;
|
|
107
|
-
}
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
function registerMatrixApprovalReactionTarget(params) {
|
|
111
|
-
const accountId = normalizeAccountId(params.accountId);
|
|
112
|
-
const key = buildReactionTargetKey(accountId, params.roomId, params.eventId);
|
|
113
|
-
const approvalId = params.approvalId.trim();
|
|
114
|
-
const allowedDecisions = Array.from(new Set(params.allowedDecisions.filter((decision) => decision === "allow-once" || decision === "allow-always" || decision === "deny")));
|
|
115
|
-
if (!key || !approvalId || params.approvalKind !== "exec" && params.approvalKind !== "plugin" || allowedDecisions.length === 0) return;
|
|
116
|
-
const ttlMs = Math.max(1, params.ttlMs ?? DEFAULT_REACTION_TARGET_TTL_MS);
|
|
117
|
-
const target = {
|
|
118
|
-
accountId,
|
|
119
|
-
approvalId,
|
|
120
|
-
approvalKind: params.approvalKind,
|
|
121
|
-
roomId: params.roomId.trim(),
|
|
122
|
-
eventId: params.eventId.trim(),
|
|
123
|
-
allowedDecisions
|
|
124
|
-
};
|
|
125
|
-
matrixApprovalReactionTargetIndex.delete(key);
|
|
126
|
-
matrixApprovalReactionTargetIndex.set(key, {
|
|
127
|
-
target,
|
|
128
|
-
expiresAtMs: Date.now() + ttlMs
|
|
129
|
-
});
|
|
130
|
-
pruneMatrixApprovalReactionTargetIndex();
|
|
131
|
-
matrixApprovalReactionTargets.register(key, target, { ttlMs });
|
|
132
|
-
}
|
|
133
|
-
function unregisterMatrixApprovalReactionTarget(params) {
|
|
134
|
-
const key = buildReactionTargetKey(params.accountId, params.roomId, params.eventId);
|
|
135
|
-
if (!key) return;
|
|
136
|
-
matrixApprovalReactionTargetIndex.delete(key);
|
|
137
|
-
matrixApprovalReactionTargets.delete(key);
|
|
138
|
-
}
|
|
139
|
-
/** Retires every Matrix reaction anchor bound to one canonical approval. */
|
|
140
|
-
async function unregisterMatrixApprovalReactionTargetsForApproval(params) {
|
|
141
|
-
const accountId = normalizeAccountId(params.accountId);
|
|
142
|
-
const approvalId = params.approvalId.trim();
|
|
143
|
-
if (!approvalId) return [];
|
|
144
|
-
pruneMatrixApprovalReactionTargetIndex();
|
|
145
|
-
const matches = /* @__PURE__ */ new Map();
|
|
146
|
-
for (const [key, entry] of matrixApprovalReactionTargetIndex) if (entry.target.approvalId === approvalId && entry.target.accountId === accountId && entry.target.approvalKind === params.approvalKind) matches.set(key, entry.target);
|
|
147
|
-
let persistentStore = void 0;
|
|
148
|
-
try {
|
|
149
|
-
persistentStore = openPersistentMatrixApprovalReactionStore();
|
|
150
|
-
for (const entry of await persistentStore?.entries() ?? []) {
|
|
151
|
-
if (entry.value.version !== 1) continue;
|
|
152
|
-
const target = readPersistedTarget(entry.value.target);
|
|
153
|
-
if (target?.approvalId === approvalId && target.accountId === accountId && target.approvalKind === params.approvalKind && buildReactionTargetKey(target.accountId, target.roomId, target.eventId) === entry.key) matches.set(entry.key, target);
|
|
154
|
-
}
|
|
155
|
-
} catch (error) {
|
|
156
|
-
reportPersistentApprovalReactionError(error);
|
|
157
|
-
}
|
|
158
|
-
const persistentDeletes = [];
|
|
159
|
-
for (const [key] of matches) {
|
|
160
|
-
matrixApprovalReactionTargetIndex.delete(key);
|
|
161
|
-
matrixApprovalReactionTargets.delete(key);
|
|
162
|
-
if (persistentStore) persistentDeletes.push(persistentStore.delete(key));
|
|
163
|
-
}
|
|
164
|
-
await Promise.allSettled(persistentDeletes);
|
|
165
|
-
return Array.from(matches.values(), ({ accountId: ownerAccountId, roomId, eventId }) => ({
|
|
166
|
-
accountId: ownerAccountId,
|
|
167
|
-
roomId,
|
|
168
|
-
eventId
|
|
169
|
-
}));
|
|
170
|
-
}
|
|
171
|
-
function resolveTarget(params) {
|
|
172
|
-
const target = params.target;
|
|
173
|
-
if (!target) return null;
|
|
174
|
-
const decision = resolveMatrixApprovalReactionDecision(params.reactionKey, target.allowedDecisions);
|
|
175
|
-
if (!decision) return null;
|
|
176
|
-
return {
|
|
177
|
-
approvalId: target.approvalId,
|
|
178
|
-
approvalKind: target.approvalKind,
|
|
179
|
-
decision
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
async function resolveMatrixApprovalReactionTargetWithPersistence(params) {
|
|
183
|
-
const accountId = normalizeAccountId(params.accountId);
|
|
184
|
-
const key = buildReactionTargetKey(accountId, params.roomId, params.eventId);
|
|
185
|
-
if (!key) return null;
|
|
186
|
-
const target = await matrixApprovalReactionTargets.lookup(key);
|
|
187
|
-
if (target && (target.accountId !== accountId || buildReactionTargetKey(target.accountId, target.roomId, target.eventId) !== key)) return null;
|
|
188
|
-
if (target) {
|
|
189
|
-
matrixApprovalReactionTargetIndex.delete(key);
|
|
190
|
-
matrixApprovalReactionTargetIndex.set(key, {
|
|
191
|
-
target,
|
|
192
|
-
expiresAtMs: Date.now() + DEFAULT_REACTION_TARGET_TTL_MS
|
|
193
|
-
});
|
|
194
|
-
pruneMatrixApprovalReactionTargetIndex();
|
|
195
|
-
}
|
|
196
|
-
return resolveTarget({
|
|
197
|
-
target,
|
|
198
|
-
reactionKey: params.reactionKey
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
//#endregion
|
|
202
|
-
export { unregisterMatrixApprovalReactionTarget as a, resolveMatrixApprovalReactionTargetWithPersistence as i, listMatrixApprovalReactionBindings as n, unregisterMatrixApprovalReactionTargetsForApproval as o, registerMatrixApprovalReactionTarget as r, buildMatrixApprovalReactionHint as t };
|
package/dist/client-Dbso3-0V.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { t as getMatrixScopedEnvVarNames } from "./env-vars-B0NxQnPk.js";
|
|
3
|
-
import { i as resolveScopedMatrixEnvConfig, r as resolveMatrixEnvAuthReadiness, t as hasReadyMatrixEnvAuth } from "./env-auth-CQsYbz-p.js";
|
|
4
|
-
import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.js";
|
|
5
|
-
import { t as isBunRuntime } from "./runtime-BefyhPWv.js";
|
|
6
|
-
import { d as backfillMatrixAuthDeviceIdAfterStartup, f as resolveMatrixAuth, i as resolveSharedMatrixClient, m as resolveMatrixConfigForAccount, n as releaseSharedClientInstance, o as stopSharedClientForAccount, p as resolveMatrixAuthContext, r as removeSharedClientInstance, s as stopSharedClientInstance, t as acquireSharedMatrixClient } from "./shared-CUMWxcMz.js";
|
|
7
|
-
import { t as createMatrixClient } from "./create-client-BmSU-q-D.js";
|
|
8
|
-
//#region extensions/matrix/src/matrix/client.ts
|
|
9
|
-
var client_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
-
acquireSharedMatrixClient: () => acquireSharedMatrixClient,
|
|
11
|
-
backfillMatrixAuthDeviceIdAfterStartup: () => backfillMatrixAuthDeviceIdAfterStartup,
|
|
12
|
-
createMatrixClient: () => createMatrixClient,
|
|
13
|
-
getMatrixScopedEnvVarNames: () => getMatrixScopedEnvVarNames,
|
|
14
|
-
hasReadyMatrixEnvAuth: () => hasReadyMatrixEnvAuth,
|
|
15
|
-
isBunRuntime: () => isBunRuntime,
|
|
16
|
-
releaseSharedClientInstance: () => releaseSharedClientInstance,
|
|
17
|
-
removeSharedClientInstance: () => removeSharedClientInstance,
|
|
18
|
-
resolveMatrixAuth: () => resolveMatrixAuth,
|
|
19
|
-
resolveMatrixAuthContext: () => resolveMatrixAuthContext,
|
|
20
|
-
resolveMatrixConfigForAccount: () => resolveMatrixConfigForAccount,
|
|
21
|
-
resolveMatrixEnvAuthReadiness: () => resolveMatrixEnvAuthReadiness,
|
|
22
|
-
resolveScopedMatrixEnvConfig: () => resolveScopedMatrixEnvConfig,
|
|
23
|
-
resolveSharedMatrixClient: () => resolveSharedMatrixClient,
|
|
24
|
-
resolveValidatedMatrixHomeserverUrl: () => resolveValidatedMatrixHomeserverUrl,
|
|
25
|
-
stopSharedClientForAccount: () => stopSharedClientForAccount,
|
|
26
|
-
stopSharedClientInstance: () => stopSharedClientInstance,
|
|
27
|
-
validateMatrixHomeserverUrl: () => validateMatrixHomeserverUrl
|
|
28
|
-
});
|
|
29
|
-
//#endregion
|
|
30
|
-
export { client_exports as t };
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { t as getActiveMatrixClient } from "./active-client-DXvz2gCo.js";
|
|
3
|
-
import { t as isBunRuntime } from "./runtime-BefyhPWv.js";
|
|
4
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
5
|
-
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
6
|
-
//#region extensions/matrix/src/matrix/client-bootstrap.ts
|
|
7
|
-
var client_bootstrap_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
-
resolveRuntimeMatrixClientWithReadiness: () => resolveRuntimeMatrixClientWithReadiness,
|
|
9
|
-
withResolvedRuntimeMatrixClient: () => withResolvedRuntimeMatrixClient
|
|
10
|
-
});
|
|
11
|
-
const loadMatrixSharedClientRuntimeDeps = createLazyRuntimeModule(() => Promise.all([import("./client-Dbso3-0V.js").then((n) => n.t), import("./shared-CUMWxcMz.js").then((n) => n.a)]).then(([clientModule, sharedModule]) => ({
|
|
12
|
-
acquireSharedMatrixClient: clientModule.acquireSharedMatrixClient,
|
|
13
|
-
resolveMatrixAuthContext: clientModule.resolveMatrixAuthContext,
|
|
14
|
-
releaseSharedClientInstance: sharedModule.releaseSharedClientInstance
|
|
15
|
-
})));
|
|
16
|
-
async function ensureResolvedClientReadiness(params) {
|
|
17
|
-
if (params.readiness === "started") {
|
|
18
|
-
await params.client.start();
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (params.readiness === "prepared" || !params.readiness && params.preparedByDefault) await params.client.prepareForOneOff();
|
|
22
|
-
}
|
|
23
|
-
function ensureMatrixNodeRuntime() {
|
|
24
|
-
if (isBunRuntime()) throw new Error("Matrix support requires Node (bun runtime not supported)");
|
|
25
|
-
}
|
|
26
|
-
async function resolveRuntimeMatrixClient(opts) {
|
|
27
|
-
ensureMatrixNodeRuntime();
|
|
28
|
-
if (opts.client) {
|
|
29
|
-
await opts.onResolved?.(opts.client, { preparedByDefault: false });
|
|
30
|
-
return {
|
|
31
|
-
client: opts.client,
|
|
32
|
-
stopOnDone: false
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
if (!opts.cfg) throw new Error("Matrix runtime client requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.");
|
|
36
|
-
const cfg = requireRuntimeConfig(opts.cfg, "Matrix runtime client");
|
|
37
|
-
const { acquireSharedMatrixClient, releaseSharedClientInstance, resolveMatrixAuthContext } = await loadMatrixSharedClientRuntimeDeps();
|
|
38
|
-
const authContext = resolveMatrixAuthContext({
|
|
39
|
-
cfg,
|
|
40
|
-
accountId: opts.accountId
|
|
41
|
-
});
|
|
42
|
-
const active = getActiveMatrixClient(authContext.accountId);
|
|
43
|
-
if (active) {
|
|
44
|
-
await opts.onResolved?.(active, { preparedByDefault: false });
|
|
45
|
-
return {
|
|
46
|
-
client: active,
|
|
47
|
-
stopOnDone: false
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
const client = await acquireSharedMatrixClient({
|
|
51
|
-
cfg,
|
|
52
|
-
timeoutMs: opts.timeoutMs,
|
|
53
|
-
accountId: authContext.accountId,
|
|
54
|
-
startClient: false
|
|
55
|
-
});
|
|
56
|
-
try {
|
|
57
|
-
await opts.onResolved?.(client, { preparedByDefault: true });
|
|
58
|
-
} catch (err) {
|
|
59
|
-
await releaseSharedClientInstance(client, "stop");
|
|
60
|
-
throw err;
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
client,
|
|
64
|
-
stopOnDone: true,
|
|
65
|
-
cleanup: async (mode) => {
|
|
66
|
-
await releaseSharedClientInstance(client, mode);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
async function resolveRuntimeMatrixClientWithReadiness(opts) {
|
|
71
|
-
return await resolveRuntimeMatrixClient({
|
|
72
|
-
client: opts.client,
|
|
73
|
-
cfg: opts.cfg,
|
|
74
|
-
timeoutMs: opts.timeoutMs,
|
|
75
|
-
accountId: opts.accountId,
|
|
76
|
-
onResolved: async (client, context) => {
|
|
77
|
-
await ensureResolvedClientReadiness({
|
|
78
|
-
client,
|
|
79
|
-
readiness: opts.readiness,
|
|
80
|
-
preparedByDefault: context.preparedByDefault
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
async function stopResolvedRuntimeMatrixClient(resolved, mode = "stop") {
|
|
86
|
-
if (!resolved.stopOnDone) return;
|
|
87
|
-
if (resolved.cleanup) {
|
|
88
|
-
await resolved.cleanup(mode);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (mode === "persist") {
|
|
92
|
-
await resolved.client.stopAndPersist();
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
if (mode === "discard") {
|
|
96
|
-
resolved.client.stopWithoutPersist();
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
resolved.client.stop();
|
|
100
|
-
}
|
|
101
|
-
async function withResolvedRuntimeMatrixClient(opts, run, stopMode = "stop") {
|
|
102
|
-
const resolved = await resolveRuntimeMatrixClientWithReadiness(opts);
|
|
103
|
-
try {
|
|
104
|
-
return await run(resolved.client);
|
|
105
|
-
} finally {
|
|
106
|
-
await stopResolvedRuntimeMatrixClient(resolved, stopMode);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
//#endregion
|
|
110
|
-
export { withResolvedRuntimeMatrixClient as n, client_bootstrap_exports as t };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-GRHde6lq.js";
|
|
3
|
-
import { d as writeStorageMeta, l as resolveMatrixStoragePaths, r as maybeMigrateLegacyStorage } from "./storage-BvAkgzvT.js";
|
|
4
|
-
import "./shared-CUMWxcMz.js";
|
|
5
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
-
import { ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
8
|
-
import fs from "node:fs";
|
|
9
|
-
//#region extensions/matrix/src/matrix/client/create-client.ts
|
|
10
|
-
var create_client_exports = /* @__PURE__ */ __exportAll({ createMatrixClient: () => createMatrixClient });
|
|
11
|
-
const loadMatrixCreateClientRuntimeDeps = createLazyRuntimeModule(() => Promise.all([import("./sdk-bUytQHx7.js"), import("./logging-DV-p52N0.js").then((n) => n.n)]).then(([sdkModule, loggingModule]) => ({
|
|
12
|
-
MatrixClient: sdkModule.MatrixClient,
|
|
13
|
-
ensureMatrixSdkLoggingConfigured: loggingModule.ensureMatrixSdkLoggingConfigured
|
|
14
|
-
})));
|
|
15
|
-
async function createMatrixClient(params) {
|
|
16
|
-
const { MatrixClient, ensureMatrixSdkLoggingConfigured } = await loadMatrixCreateClientRuntimeDeps();
|
|
17
|
-
ensureMatrixSdkLoggingConfigured();
|
|
18
|
-
const homeserver = await resolveValidatedMatrixHomeserverUrl(params.homeserver, { dangerouslyAllowPrivateNetwork: params.allowPrivateNetwork });
|
|
19
|
-
const matrixClientUserId = normalizeOptionalString(params.userId);
|
|
20
|
-
const userId = matrixClientUserId ?? "unknown";
|
|
21
|
-
const storagePaths = params.persistStorage !== false ? resolveMatrixStoragePaths({
|
|
22
|
-
homeserver,
|
|
23
|
-
userId,
|
|
24
|
-
accessToken: params.accessToken,
|
|
25
|
-
accountId: params.accountId,
|
|
26
|
-
deviceId: params.deviceId,
|
|
27
|
-
env: process.env
|
|
28
|
-
}) : null;
|
|
29
|
-
if (storagePaths) {
|
|
30
|
-
await maybeMigrateLegacyStorage({
|
|
31
|
-
storagePaths,
|
|
32
|
-
env: process.env
|
|
33
|
-
});
|
|
34
|
-
fs.mkdirSync(storagePaths.rootDir, { recursive: true });
|
|
35
|
-
writeStorageMeta({
|
|
36
|
-
storagePaths,
|
|
37
|
-
homeserver,
|
|
38
|
-
userId,
|
|
39
|
-
accountId: params.accountId,
|
|
40
|
-
deviceId: params.deviceId
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
const cryptoDatabasePrefix = storagePaths ? `openclaw-matrix-${storagePaths.accountKey}-${storagePaths.tokenHash}` : void 0;
|
|
44
|
-
return new MatrixClient(homeserver, params.accessToken, {
|
|
45
|
-
userId: matrixClientUserId,
|
|
46
|
-
password: params.password,
|
|
47
|
-
deviceId: params.deviceId,
|
|
48
|
-
encryption: params.encryption,
|
|
49
|
-
localTimeoutMs: params.localTimeoutMs,
|
|
50
|
-
initialSyncLimit: params.initialSyncLimit,
|
|
51
|
-
storageRootDir: storagePaths?.rootDir,
|
|
52
|
-
recoveryKeyPath: storagePaths?.recoveryKeyPath,
|
|
53
|
-
idbSnapshotPath: storagePaths?.idbSnapshotPath,
|
|
54
|
-
cryptoDatabasePrefix,
|
|
55
|
-
autoBootstrapCrypto: params.autoBootstrapCrypto,
|
|
56
|
-
ssrfPolicy: params.ssrfPolicy ?? ssrfPolicyFromDangerouslyAllowPrivateNetwork(params.allowPrivateNetwork),
|
|
57
|
-
dispatcherPolicy: params.dispatcherPolicy
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
export { create_client_exports as n, createMatrixClient as t };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { a as resolveMatrixCredentialsPath, r as resolveMatrixCredentialsDir } from "./storage-paths-gUmSydsW.js";
|
|
2
|
-
import { a as isMatrixCredentialRevocation, c as normalizeMatrixStoredCredentials, l as openMatrixCredentialsStore, n as clearMatrixCredentials, o as loadMatrixCredentials, r as credentialsMatchConfig, s as matrixCredentialsStoreKey } from "./credentials-read-DVmFCm7X.js";
|
|
3
|
-
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
|
-
//#region extensions/matrix/src/matrix/credentials.ts
|
|
5
|
-
function requireCredentialStoreUpdate(store) {
|
|
6
|
-
if (!store.update) throw new Error("Matrix credentials require atomic plugin-state updates");
|
|
7
|
-
return store.update;
|
|
8
|
-
}
|
|
9
|
-
async function saveMatrixCredentials(credentials, env = process.env, accountId) {
|
|
10
|
-
const normalizedAccountId = normalizeAccountId(accountId);
|
|
11
|
-
const store = openMatrixCredentialsStore(env);
|
|
12
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
13
|
-
requireCredentialStoreUpdate(store)(matrixCredentialsStoreKey(normalizedAccountId), (current) => {
|
|
14
|
-
const existing = normalizeMatrixStoredCredentials(current, normalizedAccountId);
|
|
15
|
-
return {
|
|
16
|
-
accountId: normalizedAccountId,
|
|
17
|
-
homeserver: credentials.homeserver,
|
|
18
|
-
userId: credentials.userId,
|
|
19
|
-
accessToken: credentials.accessToken,
|
|
20
|
-
...typeof credentials.deviceId === "string" ? { deviceId: credentials.deviceId } : {},
|
|
21
|
-
createdAt: existing?.createdAt ?? now,
|
|
22
|
-
lastUsedAt: now
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
async function saveBackfilledMatrixDeviceId(credentials, env = process.env, accountId) {
|
|
27
|
-
const normalizedAccountId = normalizeAccountId(accountId);
|
|
28
|
-
const store = openMatrixCredentialsStore(env);
|
|
29
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
30
|
-
let result = "saved";
|
|
31
|
-
requireCredentialStoreUpdate(store)(matrixCredentialsStoreKey(normalizedAccountId), (current) => {
|
|
32
|
-
if (isMatrixCredentialRevocation(current, normalizedAccountId)) {
|
|
33
|
-
result = "skipped";
|
|
34
|
-
return current;
|
|
35
|
-
}
|
|
36
|
-
const existing = normalizeMatrixStoredCredentials(current, normalizedAccountId);
|
|
37
|
-
if (existing && (existing.homeserver !== credentials.homeserver || existing.userId !== credentials.userId || existing.accessToken !== credentials.accessToken)) {
|
|
38
|
-
result = "skipped";
|
|
39
|
-
return existing;
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
accountId: normalizedAccountId,
|
|
43
|
-
homeserver: credentials.homeserver,
|
|
44
|
-
userId: credentials.userId,
|
|
45
|
-
accessToken: credentials.accessToken,
|
|
46
|
-
...typeof credentials.deviceId === "string" ? { deviceId: credentials.deviceId } : {},
|
|
47
|
-
createdAt: existing?.createdAt ?? now,
|
|
48
|
-
lastUsedAt: now
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
async function touchMatrixCredentials(env = process.env, accountId) {
|
|
54
|
-
const normalizedAccountId = normalizeAccountId(accountId);
|
|
55
|
-
requireCredentialStoreUpdate(openMatrixCredentialsStore(env))(matrixCredentialsStoreKey(normalizedAccountId), (current) => {
|
|
56
|
-
if (isMatrixCredentialRevocation(current, normalizedAccountId)) return current;
|
|
57
|
-
const existing = normalizeMatrixStoredCredentials(current, normalizedAccountId);
|
|
58
|
-
return existing ? {
|
|
59
|
-
...existing,
|
|
60
|
-
lastUsedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
61
|
-
} : void 0;
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
//#endregion
|
|
65
|
-
export { clearMatrixCredentials, credentialsMatchConfig, loadMatrixCredentials, resolveMatrixCredentialsDir, resolveMatrixCredentialsPath, saveBackfilledMatrixDeviceId, saveMatrixCredentials, touchMatrixCredentials };
|