@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,20 +1,17 @@
|
|
|
1
|
-
import { a as resolveMatrixAccountConfig
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { i as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { c as
|
|
10
|
-
import { t as applyMatrixProfileUpdate } from "./profile-update-CffmyW_4.js";
|
|
11
|
-
import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-DYMQ1QpI.js";
|
|
12
|
-
import { t as createMatrixRoomInfoResolver } from "./room-info-CAFZ3Z9J.js";
|
|
1
|
+
import { a as resolveMatrixAccountConfig } from "./account-config-BZWN9tGS.mjs";
|
|
2
|
+
import "./setup-core-bhdcEo7v.mjs";
|
|
3
|
+
import { E as parsePollStart, T as isPollStartType, b as buildPollResponseContent, i as reactMatrixMessage, u as resolveMatrixRoomId } from "./send-CGgl0uTn.mjs";
|
|
4
|
+
import { i as buildMatrixReactionRelationsPath, o as selectOwnMatrixReactionEventIds, s as summarizeMatrixReactionEvents } from "./reaction-common-DkrQdBSZ.mjs";
|
|
5
|
+
import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-Ct0bUHCo.mjs";
|
|
6
|
+
import { a as fetchEventSummary, c as resolveMatrixActionLimit, i as sendMatrixMessage, n as editMatrixMessage, o as readPinnedEvents, r as readMatrixMessages, s as EventType, t as deleteMatrixMessage } from "./messages-D4DYGHYX.mjs";
|
|
7
|
+
import { a as jsonResult, c as readStringArrayParam, l as readStringParam, o as readPositiveIntegerParam, r as createActionGate, s as readReactionParams } from "./runtime-api-CEsWNdil.mjs";
|
|
8
|
+
import { t as applyMatrixProfileUpdate } from "./profile-update-DzOL3Wiw.mjs";
|
|
9
|
+
import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-DeWOtZJr.mjs";
|
|
13
10
|
import { normalizeOptionalLowercaseString, uniqueStrings, uniqueValues } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
14
|
-
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
15
11
|
//#region extensions/matrix/src/matrix/actions/polls.ts
|
|
16
12
|
function normalizeOptionIndexes(indexes) {
|
|
17
|
-
|
|
13
|
+
const normalized = indexes.map((index) => Math.trunc(index)).filter((index) => Number.isFinite(index) && index > 0);
|
|
14
|
+
return uniqueValues(normalized);
|
|
18
15
|
}
|
|
19
16
|
function normalizeOptionIds(optionIds) {
|
|
20
17
|
return uniqueStrings(optionIds.map((optionId) => optionId.trim()).filter((optionId) => optionId.length > 0));
|
|
@@ -45,7 +42,8 @@ function resolveSelectedAnswerIds(params) {
|
|
|
45
42
|
async function voteMatrixPoll(roomId, pollId, opts = {}) {
|
|
46
43
|
return await withResolvedRoomAction(roomId, opts, async (client, resolvedRoom) => {
|
|
47
44
|
const pollEvent = await client.getEvent(resolvedRoom, pollId);
|
|
48
|
-
|
|
45
|
+
const eventType = typeof pollEvent.type === "string" ? pollEvent.type : "";
|
|
46
|
+
if (!isPollStartType(eventType)) throw new Error(`Event ${pollId} is not a Matrix poll start event.`);
|
|
49
47
|
const { answerIds, labels, maxSelections } = resolveSelectedAnswerIds({
|
|
50
48
|
optionIds: [...opts.optionIds ?? [], ...opts.optionId ? [opts.optionId] : []],
|
|
51
49
|
optionIndexes: [...opts.optionIndexes ?? [], ...opts.optionIndex !== void 0 ? [opts.optionIndex] : []],
|
|
@@ -73,7 +71,8 @@ async function listMatrixReactionEvents(client, roomId, messageId, limit) {
|
|
|
73
71
|
}
|
|
74
72
|
async function listMatrixReactions(roomId, messageId, opts = {}) {
|
|
75
73
|
return await withResolvedRoomAction(roomId, opts, async (client, resolvedRoom) => {
|
|
76
|
-
|
|
74
|
+
const chunk = await listMatrixReactionEvents(client, resolvedRoom, messageId, resolveMatrixActionLimit(opts.limit, 100));
|
|
75
|
+
return summarizeMatrixReactionEvents(chunk);
|
|
77
76
|
});
|
|
78
77
|
}
|
|
79
78
|
async function removeMatrixReactions(roomId, messageId, opts = {}) {
|
|
@@ -120,10 +119,9 @@ async function listMatrixPins(roomId, opts = {}) {
|
|
|
120
119
|
}
|
|
121
120
|
//#endregion
|
|
122
121
|
//#region extensions/matrix/src/matrix/actions/room.ts
|
|
123
|
-
async function getMatrixMemberInfo(userId, opts) {
|
|
122
|
+
async function getMatrixMemberInfo(userId, opts = {}) {
|
|
124
123
|
return await withResolvedActionClient(opts, async (client) => {
|
|
125
|
-
const roomId = await resolveMatrixRoomId(client, opts.roomId);
|
|
126
|
-
if (!(await client.getJoinedRoomMembers(roomId)).includes(userId)) throw new Error(`User ${userId} is not a member of room ${roomId}`);
|
|
124
|
+
const roomId = opts.roomId ? await resolveMatrixRoomId(client, opts.roomId) : void 0;
|
|
127
125
|
const profile = await client.getUserProfile(userId);
|
|
128
126
|
return {
|
|
129
127
|
userId,
|
|
@@ -134,7 +132,7 @@ async function getMatrixMemberInfo(userId, opts) {
|
|
|
134
132
|
membership: null,
|
|
135
133
|
powerLevel: null,
|
|
136
134
|
displayName: profile?.displayname ?? null,
|
|
137
|
-
roomId
|
|
135
|
+
roomId: roomId ?? null
|
|
138
136
|
};
|
|
139
137
|
});
|
|
140
138
|
}
|
|
@@ -170,126 +168,6 @@ async function getMatrixRoomInfo(roomId, opts = {}) {
|
|
|
170
168
|
});
|
|
171
169
|
}
|
|
172
170
|
//#endregion
|
|
173
|
-
//#region extensions/matrix/src/matrix/read-policy.ts
|
|
174
|
-
function normalizeRoomId(raw) {
|
|
175
|
-
return raw?.trim().replace(/^room:/i, "") ?? "";
|
|
176
|
-
}
|
|
177
|
-
function isCurrentRoom(params) {
|
|
178
|
-
return params.context?.currentChannelProvider?.trim().toLowerCase() === "matrix" && params.context.requesterAccountId?.trim() === params.accountId && normalizeRoomId(params.context.currentChannelId) === normalizeRoomId(params.roomId);
|
|
179
|
-
}
|
|
180
|
-
function includesEntry(entries, value) {
|
|
181
|
-
const normalized = value.trim().toLowerCase();
|
|
182
|
-
return (entries ?? []).some((entry) => {
|
|
183
|
-
const candidate = String(entry).replace(/^matrix:/i, "").trim().toLowerCase();
|
|
184
|
-
return candidate === "*" || candidate === normalized;
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
function hasWildcardEntry(entries) {
|
|
188
|
-
return (entries ?? []).some((entry) => String(entry).replace(/^matrix:/i, "").trim() === "*");
|
|
189
|
-
}
|
|
190
|
-
function resolveMatrixReadRoomPolicy(params) {
|
|
191
|
-
const room = resolveMatrixRoomConfig({
|
|
192
|
-
rooms: params.account.config.groups ?? params.account.config.rooms,
|
|
193
|
-
roomId: params.roomId,
|
|
194
|
-
aliases: params.aliases
|
|
195
|
-
});
|
|
196
|
-
const baseRoom = resolveMatrixRoomConfig({
|
|
197
|
-
rooms: params.baseConfig.groups ?? params.baseConfig.rooms,
|
|
198
|
-
roomId: params.roomId,
|
|
199
|
-
aliases: params.aliases
|
|
200
|
-
});
|
|
201
|
-
const baseRoomAccount = baseRoom.config?.account;
|
|
202
|
-
const explicitlyScopedToAnotherAccount = room.config === void 0 && baseRoom.matchSource === "direct" && typeof baseRoomAccount === "string" && normalizeAccountId(baseRoomAccount) !== params.account.accountId;
|
|
203
|
-
const accountMatches = !room.config?.account || room.config.account === params.account.accountId;
|
|
204
|
-
const configuredRoomBlocked = room.config !== void 0 && (!room.allowed || !accountMatches);
|
|
205
|
-
return {
|
|
206
|
-
blocked: explicitlyScopedToAnotherAccount || configuredRoomBlocked,
|
|
207
|
-
blockedBeforeProviderAccess: explicitlyScopedToAnotherAccount || room.matchSource === "direct" && configuredRoomBlocked,
|
|
208
|
-
room
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
async function classifyMatrixReadRoom(params) {
|
|
212
|
-
const members = await readJoinedMatrixMembers(params.client, params.roomId);
|
|
213
|
-
if (!members) return { kind: "unknown" };
|
|
214
|
-
if (members.length >= 3) return { kind: "group" };
|
|
215
|
-
if (members.length !== 2) return { kind: "unknown" };
|
|
216
|
-
const selfUserId = await params.client.getUserId().catch(() => null);
|
|
217
|
-
if (!selfUserId || !members.includes(selfUserId)) return { kind: "unknown" };
|
|
218
|
-
const remoteUserId = members.find((member) => member !== selfUserId);
|
|
219
|
-
if (!isStrictDirectMembership({
|
|
220
|
-
selfUserId,
|
|
221
|
-
remoteUserId,
|
|
222
|
-
joinedMembers: members
|
|
223
|
-
}) || !remoteUserId) return { kind: "unknown" };
|
|
224
|
-
const memberStateFlag = await hasDirectMatrixMemberFlag(params.client, params.roomId, selfUserId);
|
|
225
|
-
await params.client.dms.update().catch(() => false);
|
|
226
|
-
if (memberStateFlag === true || params.client.dms.isDm(params.roomId)) return {
|
|
227
|
-
kind: "direct",
|
|
228
|
-
remoteUserId
|
|
229
|
-
};
|
|
230
|
-
return memberStateFlag === false ? { kind: "group" } : { kind: "unknown" };
|
|
231
|
-
}
|
|
232
|
-
async function withAuthorizedMatrixReadTarget(params) {
|
|
233
|
-
const account = resolveMatrixAccount({
|
|
234
|
-
cfg: params.cfg,
|
|
235
|
-
accountId: params.accountId
|
|
236
|
-
});
|
|
237
|
-
const baseConfig = resolveMatrixBaseConfig(params.cfg);
|
|
238
|
-
if (resolveMatrixReadRoomPolicy({
|
|
239
|
-
account,
|
|
240
|
-
baseConfig,
|
|
241
|
-
roomId: normalizeMatrixResolvableTarget(params.roomId),
|
|
242
|
-
aliases: []
|
|
243
|
-
}).blockedBeforeProviderAccess) throw new ToolAuthorizationError("Matrix read target is not allowed.");
|
|
244
|
-
return await withResolvedActionClient(params.opts, async (client) => {
|
|
245
|
-
const roomId = await resolveMatrixRoomId(client, params.roomId);
|
|
246
|
-
const inputAlias = params.roomId.trim().startsWith("#") ? params.roomId.trim() : void 0;
|
|
247
|
-
const { getRoomInfo } = createMatrixRoomInfoResolver(client);
|
|
248
|
-
const roomInfo = await getRoomInfo(roomId, { includeAliases: true });
|
|
249
|
-
const mutableRoomName = account.config.dangerouslyAllowNameMatching === true ? roomInfo.name : void 0;
|
|
250
|
-
const aliases = [
|
|
251
|
-
inputAlias,
|
|
252
|
-
roomInfo.canonicalAlias,
|
|
253
|
-
...roomInfo.altAliases,
|
|
254
|
-
mutableRoomName
|
|
255
|
-
].filter((value) => Boolean(value));
|
|
256
|
-
const finalPolicy = resolveMatrixReadRoomPolicy({
|
|
257
|
-
account,
|
|
258
|
-
baseConfig,
|
|
259
|
-
roomId,
|
|
260
|
-
aliases
|
|
261
|
-
});
|
|
262
|
-
const room = finalPolicy.room;
|
|
263
|
-
const current = isCurrentRoom({
|
|
264
|
-
accountId: account.accountId,
|
|
265
|
-
context: params.context,
|
|
266
|
-
roomId
|
|
267
|
-
});
|
|
268
|
-
const currentChatType = params.context?.currentChatType?.trim().toLowerCase();
|
|
269
|
-
const trustedCurrentClassification = currentChatType === "direct" ? {
|
|
270
|
-
kind: "direct",
|
|
271
|
-
remoteUserId: ""
|
|
272
|
-
} : currentChatType === "group" || currentChatType === "channel" ? { kind: "group" } : null;
|
|
273
|
-
const classification = room.matchSource === "direct" ? { kind: "group" } : current && trustedCurrentClassification ? trustedCurrentClassification : await classifyMatrixReadRoom({
|
|
274
|
-
client,
|
|
275
|
-
roomId
|
|
276
|
-
});
|
|
277
|
-
const resolvedGroupPolicy = resolveAllowlistProviderRuntimeGroupPolicy({
|
|
278
|
-
providerConfigPresent: params.cfg.channels?.matrix !== void 0,
|
|
279
|
-
groupPolicy: account.config.groupPolicy,
|
|
280
|
-
defaultGroupPolicy: resolveDefaultGroupPolicy(params.cfg)
|
|
281
|
-
}).groupPolicy;
|
|
282
|
-
const groupPolicy = account.config.allowlistOnly && resolvedGroupPolicy === "open" ? "allowlist" : resolvedGroupPolicy;
|
|
283
|
-
const dmPolicy = account.config.allowlistOnly ? account.config.dm?.policy === "disabled" ? "disabled" : "allowlist" : account.config.dm?.policy ?? "pairing";
|
|
284
|
-
const directOperator = params.context?.conversationReadOrigin === "direct-operator";
|
|
285
|
-
if (!(finalPolicy.blocked ? false : directOperator ? classification.kind === "direct" ? account.config.dm?.enabled !== false && dmPolicy !== "disabled" : classification.kind === "group" ? groupPolicy !== "disabled" : groupPolicy !== "disabled" && dmPolicy !== "disabled" && account.config.dm?.enabled !== false : classification.kind === "direct" ? account.config.dm?.enabled !== false && dmPolicy !== "disabled" && (current || includesEntry(account.config.dm?.allowFrom, classification.remoteUserId)) : classification.kind === "group" ? groupPolicy !== "disabled" && (current || groupPolicy === "open" || room.config !== void 0) : current ? groupPolicy !== "disabled" && dmPolicy !== "disabled" && account.config.dm?.enabled !== false : groupPolicy === "open" && dmPolicy !== "disabled" && account.config.dm?.enabled !== false && hasWildcardEntry(account.config.dm?.allowFrom))) throw new ToolAuthorizationError("Matrix read target is not allowed.");
|
|
286
|
-
return await params.run({
|
|
287
|
-
client,
|
|
288
|
-
roomId
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
//#endregion
|
|
293
171
|
//#region extensions/matrix/src/tool-actions.ts
|
|
294
172
|
const messageActions = /* @__PURE__ */ new Set([
|
|
295
173
|
"sendMessage",
|
|
@@ -324,15 +202,6 @@ const verificationActions = /* @__PURE__ */ new Set([
|
|
|
324
202
|
"verificationBackupStatus",
|
|
325
203
|
"verificationBackupRestore"
|
|
326
204
|
]);
|
|
327
|
-
function projectMatrixMessagesForDisplay(messages) {
|
|
328
|
-
return messages.map((message) => ({
|
|
329
|
-
...message,
|
|
330
|
-
...message.eventId ? { id: message.eventId } : {},
|
|
331
|
-
...message.sender ? { authorTag: message.sender } : {},
|
|
332
|
-
...message.body !== void 0 ? { content: message.body } : {},
|
|
333
|
-
...typeof message.timestamp === "number" && Number.isFinite(message.timestamp) && Math.abs(message.timestamp) <= 864e13 ? { ts: new Date(message.timestamp).toISOString() } : {}
|
|
334
|
-
}));
|
|
335
|
-
}
|
|
336
205
|
function readRoomId(params, required = true) {
|
|
337
206
|
const direct = readStringParam(params, "roomId") ?? readStringParam(params, "channelId");
|
|
338
207
|
if (direct) return direct;
|
|
@@ -381,51 +250,36 @@ async function handleMatrixAction(params, cfg, opts = {}) {
|
|
|
381
250
|
cfg,
|
|
382
251
|
...accountId ? { accountId } : {}
|
|
383
252
|
};
|
|
384
|
-
const withReadTarget = async (roomId, run) => await withAuthorizedMatrixReadTarget({
|
|
385
|
-
cfg,
|
|
386
|
-
accountId,
|
|
387
|
-
roomId,
|
|
388
|
-
context: opts.readContext,
|
|
389
|
-
opts: clientOpts,
|
|
390
|
-
run
|
|
391
|
-
});
|
|
392
253
|
if (reactionActions.has(action)) {
|
|
393
254
|
if (!isActionEnabled("reactions")) throw new Error("Matrix reactions are disabled.");
|
|
394
255
|
const roomId = readRoomId(params);
|
|
395
256
|
const messageId = readStringParam(params, "messageId", { required: true });
|
|
396
257
|
if (action === "react") {
|
|
397
258
|
const { emoji, remove, isEmpty } = readReactionParams(params, { removeErrorMessage: "Emoji is required to remove a Matrix reaction." });
|
|
398
|
-
if (remove || isEmpty)
|
|
399
|
-
|
|
400
|
-
removed: (await withReadTarget(roomId, async (target) => {
|
|
401
|
-
return await removeMatrixReactions(target.roomId, messageId, {
|
|
402
|
-
...clientOpts,
|
|
403
|
-
client: target.client,
|
|
404
|
-
emoji: remove ? emoji : void 0
|
|
405
|
-
});
|
|
406
|
-
})).removed
|
|
407
|
-
});
|
|
408
|
-
await withReadTarget(roomId, async (target) => {
|
|
409
|
-
await reactMatrixMessage(target.roomId, messageId, emoji, {
|
|
259
|
+
if (remove || isEmpty) {
|
|
260
|
+
const result = await removeMatrixReactions(roomId, messageId, {
|
|
410
261
|
...clientOpts,
|
|
411
|
-
|
|
262
|
+
emoji: remove ? emoji : void 0
|
|
412
263
|
});
|
|
413
|
-
|
|
264
|
+
return jsonResult({
|
|
265
|
+
ok: true,
|
|
266
|
+
removed: result.removed
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
await reactMatrixMessage(roomId, messageId, emoji, clientOpts);
|
|
414
270
|
return jsonResult({
|
|
415
271
|
ok: true,
|
|
416
272
|
added: emoji
|
|
417
273
|
});
|
|
418
274
|
}
|
|
419
275
|
const limit = readPositiveIntegerParam(params, "limit", { message: "limit must be a positive integer." });
|
|
276
|
+
const reactions = await listMatrixReactions(roomId, messageId, {
|
|
277
|
+
...clientOpts,
|
|
278
|
+
limit: limit ?? void 0
|
|
279
|
+
});
|
|
420
280
|
return jsonResult({
|
|
421
281
|
ok: true,
|
|
422
|
-
reactions
|
|
423
|
-
return await listMatrixReactions(target.roomId, messageId, {
|
|
424
|
-
...clientOpts,
|
|
425
|
-
client: target.client,
|
|
426
|
-
limit: limit ?? void 0
|
|
427
|
-
});
|
|
428
|
-
})
|
|
282
|
+
reactions
|
|
429
283
|
});
|
|
430
284
|
}
|
|
431
285
|
if (pollActions.has(action)) {
|
|
@@ -436,16 +290,14 @@ async function handleMatrixAction(params, cfg, opts = {}) {
|
|
|
436
290
|
const optionIndex = readPositiveIntegerParam(params, "pollOptionIndex", { message: "pollOptionIndex must be a positive integer." });
|
|
437
291
|
const optionIds = [...readStringArrayParam(params, "pollOptionIds") ?? [], ...optionId ? [optionId] : []];
|
|
438
292
|
const optionIndexes = [...readPositiveIntegerArrayParam(params, "pollOptionIndexes"), ...optionIndex !== void 0 ? [optionIndex] : []];
|
|
293
|
+
const result = await voteMatrixPoll(roomId, pollId, {
|
|
294
|
+
...clientOpts,
|
|
295
|
+
optionIds,
|
|
296
|
+
optionIndexes
|
|
297
|
+
});
|
|
439
298
|
return jsonResult({
|
|
440
299
|
ok: true,
|
|
441
|
-
result
|
|
442
|
-
return await voteMatrixPoll(target.roomId, pollId, {
|
|
443
|
-
...clientOpts,
|
|
444
|
-
client: target.client,
|
|
445
|
-
optionIds,
|
|
446
|
-
optionIndexes
|
|
447
|
-
});
|
|
448
|
-
})
|
|
300
|
+
result
|
|
449
301
|
});
|
|
450
302
|
}
|
|
451
303
|
if (messageActions.has(action)) {
|
|
@@ -461,42 +313,36 @@ async function handleMatrixAction(params, cfg, opts = {}) {
|
|
|
461
313
|
const replyToId = readStringParam(params, "replyToId") ?? readStringParam(params, "replyTo");
|
|
462
314
|
const threadId = readStringParam(params, "threadId");
|
|
463
315
|
const audioAsVoice = typeof readRawParam(params, "audioAsVoice") === "boolean" ? readRawParam(params, "audioAsVoice") : typeof readRawParam(params, "asVoice") === "boolean" ? readRawParam(params, "asVoice") : void 0;
|
|
316
|
+
const result = await sendMatrixMessage(to, content, {
|
|
317
|
+
mediaUrl: mediaUrl ?? void 0,
|
|
318
|
+
mediaLocalRoots: opts.mediaLocalRoots,
|
|
319
|
+
replyToId: replyToId ?? void 0,
|
|
320
|
+
threadId: threadId ?? void 0,
|
|
321
|
+
audioAsVoice,
|
|
322
|
+
...clientOpts
|
|
323
|
+
});
|
|
464
324
|
return jsonResult({
|
|
465
325
|
ok: true,
|
|
466
|
-
result
|
|
467
|
-
mediaUrl: mediaUrl ?? void 0,
|
|
468
|
-
mediaLocalRoots: opts.mediaLocalRoots,
|
|
469
|
-
replyToId: replyToId ?? void 0,
|
|
470
|
-
threadId: threadId ?? void 0,
|
|
471
|
-
audioAsVoice,
|
|
472
|
-
...clientOpts
|
|
473
|
-
})
|
|
326
|
+
result
|
|
474
327
|
});
|
|
475
328
|
}
|
|
476
329
|
case "editMessage": {
|
|
477
330
|
const roomId = readRoomId(params);
|
|
478
331
|
const messageId = readStringParam(params, "messageId", { required: true });
|
|
479
332
|
const content = readStringParam(params, "content", { required: true });
|
|
333
|
+
const result = await editMatrixMessage(roomId, messageId, content, clientOpts);
|
|
480
334
|
return jsonResult({
|
|
481
335
|
ok: true,
|
|
482
|
-
result
|
|
483
|
-
return await editMatrixMessage(target.roomId, messageId, content, {
|
|
484
|
-
...clientOpts,
|
|
485
|
-
client: target.client
|
|
486
|
-
});
|
|
487
|
-
})
|
|
336
|
+
result
|
|
488
337
|
});
|
|
489
338
|
}
|
|
490
339
|
case "deleteMessage": {
|
|
491
340
|
const roomId = readRoomId(params);
|
|
492
341
|
const messageId = readStringParam(params, "messageId", { required: true });
|
|
493
342
|
const reason = readStringParam(params, "reason");
|
|
494
|
-
await
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
...clientOpts,
|
|
498
|
-
client: target.client
|
|
499
|
-
});
|
|
343
|
+
await deleteMatrixMessage(roomId, messageId, {
|
|
344
|
+
reason: reason ?? void 0,
|
|
345
|
+
...clientOpts
|
|
500
346
|
});
|
|
501
347
|
return jsonResult({
|
|
502
348
|
ok: true,
|
|
@@ -509,122 +355,108 @@ async function handleMatrixAction(params, cfg, opts = {}) {
|
|
|
509
355
|
const before = readStringParam(params, "before");
|
|
510
356
|
const after = readStringParam(params, "after");
|
|
511
357
|
const threadId = readStringParam(params, "threadId");
|
|
358
|
+
const result = await readMatrixMessages(roomId, {
|
|
359
|
+
limit: limit ?? void 0,
|
|
360
|
+
before: before ?? void 0,
|
|
361
|
+
after: after ?? void 0,
|
|
362
|
+
threadId: threadId ?? void 0,
|
|
363
|
+
...clientOpts
|
|
364
|
+
});
|
|
512
365
|
return jsonResult({
|
|
513
366
|
ok: true,
|
|
514
|
-
...
|
|
515
|
-
const messages = await readMatrixMessages(target.roomId, {
|
|
516
|
-
limit: limit ?? void 0,
|
|
517
|
-
before: before ?? void 0,
|
|
518
|
-
after: after ?? void 0,
|
|
519
|
-
threadId: threadId ?? void 0,
|
|
520
|
-
...clientOpts,
|
|
521
|
-
client: target.client
|
|
522
|
-
});
|
|
523
|
-
return {
|
|
524
|
-
...messages,
|
|
525
|
-
messages: projectMatrixMessagesForDisplay(messages.messages),
|
|
526
|
-
roomId: target.roomId,
|
|
527
|
-
...threadId ? { threadId } : {}
|
|
528
|
-
};
|
|
529
|
-
})
|
|
367
|
+
...result
|
|
530
368
|
});
|
|
531
369
|
}
|
|
532
|
-
default: break;
|
|
533
370
|
}
|
|
534
371
|
}
|
|
535
372
|
if (pinActions.has(action)) {
|
|
536
373
|
if (!isActionEnabled("pins")) throw new Error("Matrix pins are disabled.");
|
|
537
374
|
const roomId = readRoomId(params);
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
} : action === "unpinMessage" ? {
|
|
542
|
-
kind: "unpin",
|
|
543
|
-
messageId: readStringParam(params, "messageId", { required: true })
|
|
544
|
-
} : { kind: "list" };
|
|
545
|
-
return await withReadTarget(roomId, async (target) => {
|
|
546
|
-
const actionOpts = {
|
|
547
|
-
...clientOpts,
|
|
548
|
-
client: target.client
|
|
549
|
-
};
|
|
550
|
-
if (request.kind === "pin") return jsonResult({
|
|
551
|
-
ok: true,
|
|
552
|
-
pinned: (await pinMatrixMessage(target.roomId, request.messageId, actionOpts)).pinned
|
|
553
|
-
});
|
|
554
|
-
if (request.kind === "unpin") return jsonResult({
|
|
375
|
+
if (action === "pinMessage") {
|
|
376
|
+
const result = await pinMatrixMessage(roomId, readStringParam(params, "messageId", { required: true }), clientOpts);
|
|
377
|
+
return jsonResult({
|
|
555
378
|
ok: true,
|
|
556
|
-
pinned:
|
|
379
|
+
pinned: result.pinned
|
|
557
380
|
});
|
|
558
|
-
|
|
381
|
+
}
|
|
382
|
+
if (action === "unpinMessage") {
|
|
383
|
+
const result = await unpinMatrixMessage(roomId, readStringParam(params, "messageId", { required: true }), clientOpts);
|
|
559
384
|
return jsonResult({
|
|
560
385
|
ok: true,
|
|
561
|
-
pinned: result.pinned
|
|
562
|
-
events: result.events,
|
|
563
|
-
pins: projectMatrixMessagesForDisplay(result.events)
|
|
386
|
+
pinned: result.pinned
|
|
564
387
|
});
|
|
388
|
+
}
|
|
389
|
+
const result = await listMatrixPins(roomId, clientOpts);
|
|
390
|
+
return jsonResult({
|
|
391
|
+
ok: true,
|
|
392
|
+
pinned: result.pinned,
|
|
393
|
+
events: result.events
|
|
565
394
|
});
|
|
566
395
|
}
|
|
567
396
|
if (profileActions.has(action)) {
|
|
568
397
|
if (!isActionEnabled("profile")) throw new Error("Matrix profile updates are disabled.");
|
|
569
398
|
const avatarPath = readStringParam(params, "avatarPath") ?? readStringParam(params, "path") ?? readStringParam(params, "filePath");
|
|
399
|
+
const result = await applyMatrixProfileUpdate({
|
|
400
|
+
cfg,
|
|
401
|
+
account: accountId,
|
|
402
|
+
displayName: readStringParam(params, "displayName") ?? readStringParam(params, "name"),
|
|
403
|
+
avatarUrl: readStringParam(params, "avatarUrl"),
|
|
404
|
+
avatarPath,
|
|
405
|
+
mediaLocalRoots: opts.mediaLocalRoots
|
|
406
|
+
});
|
|
570
407
|
return jsonResult({
|
|
571
408
|
ok: true,
|
|
572
|
-
...
|
|
573
|
-
cfg,
|
|
574
|
-
account: accountId,
|
|
575
|
-
displayName: readStringParam(params, "displayName") ?? readStringParam(params, "name"),
|
|
576
|
-
avatarUrl: readStringParam(params, "avatarUrl"),
|
|
577
|
-
avatarPath,
|
|
578
|
-
mediaLocalRoots: opts.mediaLocalRoots
|
|
579
|
-
})
|
|
409
|
+
...result
|
|
580
410
|
});
|
|
581
411
|
}
|
|
582
412
|
if (action === "memberInfo") {
|
|
583
413
|
if (!isActionEnabled("memberInfo")) throw new Error("Matrix member info is disabled.");
|
|
584
|
-
const
|
|
414
|
+
const result = await getMatrixMemberInfo(readStringParam(params, "userId", { required: true }), {
|
|
415
|
+
roomId: readStringParam(params, "roomId") ?? readStringParam(params, "channelId") ?? void 0,
|
|
416
|
+
...clientOpts
|
|
417
|
+
});
|
|
585
418
|
return jsonResult({
|
|
586
419
|
ok: true,
|
|
587
|
-
member:
|
|
588
|
-
return await getMatrixMemberInfo(userId, {
|
|
589
|
-
roomId: target.roomId,
|
|
590
|
-
...clientOpts,
|
|
591
|
-
client: target.client
|
|
592
|
-
});
|
|
593
|
-
})
|
|
420
|
+
member: result
|
|
594
421
|
});
|
|
595
422
|
}
|
|
596
423
|
if (action === "channelInfo") {
|
|
597
424
|
if (!isActionEnabled("channelInfo")) throw new Error("Matrix room info is disabled.");
|
|
425
|
+
const result = await getMatrixRoomInfo(readRoomId(params), clientOpts);
|
|
598
426
|
return jsonResult({
|
|
599
427
|
ok: true,
|
|
600
|
-
room:
|
|
601
|
-
return await getMatrixRoomInfo(target.roomId, {
|
|
602
|
-
...clientOpts,
|
|
603
|
-
client: target.client
|
|
604
|
-
});
|
|
605
|
-
})
|
|
428
|
+
room: result
|
|
606
429
|
});
|
|
607
430
|
}
|
|
608
431
|
if (verificationActions.has(action)) {
|
|
609
432
|
if (!isActionEnabled("verification")) throw new Error("Matrix verification actions are disabled.");
|
|
610
433
|
const requestId = readStringParam(params, "requestId") ?? readStringParam(params, "verificationId") ?? readStringParam(params, "id");
|
|
611
|
-
if (action === "encryptionStatus")
|
|
612
|
-
|
|
613
|
-
status
|
|
614
|
-
includeRecoveryKey
|
|
434
|
+
if (action === "encryptionStatus") {
|
|
435
|
+
const includeRecoveryKey = params.includeRecoveryKey === true;
|
|
436
|
+
const status = await getMatrixEncryptionStatus({
|
|
437
|
+
includeRecoveryKey,
|
|
615
438
|
...clientOpts
|
|
616
|
-
})
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
439
|
+
});
|
|
440
|
+
return jsonResult({
|
|
441
|
+
ok: true,
|
|
442
|
+
status
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
if (action === "verificationStatus") {
|
|
446
|
+
const includeRecoveryKey = params.includeRecoveryKey === true;
|
|
447
|
+
const status = await getMatrixVerificationStatus({
|
|
448
|
+
includeRecoveryKey,
|
|
622
449
|
...clientOpts
|
|
623
|
-
})
|
|
624
|
-
|
|
450
|
+
});
|
|
451
|
+
return jsonResult({
|
|
452
|
+
ok: true,
|
|
453
|
+
status
|
|
454
|
+
});
|
|
455
|
+
}
|
|
625
456
|
if (action === "verificationBootstrap") {
|
|
457
|
+
const recoveryKey = readStringParam(params, "recoveryKey", { trim: false }) ?? readStringParam(params, "key", { trim: false });
|
|
626
458
|
const result = await bootstrapMatrixVerification({
|
|
627
|
-
recoveryKey:
|
|
459
|
+
recoveryKey: recoveryKey ?? void 0,
|
|
628
460
|
forceResetCrossSigning: params.forceResetCrossSigning === true,
|
|
629
461
|
...clientOpts
|
|
630
462
|
});
|
|
@@ -634,7 +466,8 @@ async function handleMatrixAction(params, cfg, opts = {}) {
|
|
|
634
466
|
});
|
|
635
467
|
}
|
|
636
468
|
if (action === "verificationRecoveryKey") {
|
|
637
|
-
const
|
|
469
|
+
const recoveryKey = readStringParam(params, "recoveryKey", { trim: false }) ?? readStringParam(params, "key", { trim: false });
|
|
470
|
+
const result = await verifyMatrixRecoveryKey(readStringParam({ recoveryKey }, "recoveryKey", {
|
|
638
471
|
required: true,
|
|
639
472
|
trim: false
|
|
640
473
|
}), clientOpts);
|
|
@@ -643,13 +476,17 @@ async function handleMatrixAction(params, cfg, opts = {}) {
|
|
|
643
476
|
result
|
|
644
477
|
});
|
|
645
478
|
}
|
|
646
|
-
if (action === "verificationBackupStatus")
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
479
|
+
if (action === "verificationBackupStatus") {
|
|
480
|
+
const status = await getMatrixRoomKeyBackupStatus(clientOpts);
|
|
481
|
+
return jsonResult({
|
|
482
|
+
ok: true,
|
|
483
|
+
status
|
|
484
|
+
});
|
|
485
|
+
}
|
|
650
486
|
if (action === "verificationBackupRestore") {
|
|
487
|
+
const recoveryKey = readStringParam(params, "recoveryKey", { trim: false }) ?? readStringParam(params, "key", { trim: false });
|
|
651
488
|
const result = await restoreMatrixRoomKeyBackup({
|
|
652
|
-
recoveryKey:
|
|
489
|
+
recoveryKey: recoveryKey ?? void 0,
|
|
653
490
|
...clientOpts
|
|
654
491
|
});
|
|
655
492
|
return jsonResult({
|
|
@@ -657,79 +494,106 @@ async function handleMatrixAction(params, cfg, opts = {}) {
|
|
|
657
494
|
result
|
|
658
495
|
});
|
|
659
496
|
}
|
|
660
|
-
if (action === "verificationList")
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
497
|
+
if (action === "verificationList") {
|
|
498
|
+
const verifications = await listMatrixVerifications(clientOpts);
|
|
499
|
+
return jsonResult({
|
|
500
|
+
ok: true,
|
|
501
|
+
verifications
|
|
502
|
+
});
|
|
503
|
+
}
|
|
664
504
|
if (action === "verificationRequest") {
|
|
665
505
|
const userId = readStringParam(params, "userId");
|
|
666
506
|
const deviceId = readStringParam(params, "deviceId");
|
|
667
507
|
const roomId = readStringParam(params, "roomId") ?? readStringParam(params, "channelId");
|
|
508
|
+
const ownUser = typeof params.ownUser === "boolean" ? params.ownUser : void 0;
|
|
509
|
+
const verification = await requestMatrixVerification({
|
|
510
|
+
ownUser,
|
|
511
|
+
userId: userId ?? void 0,
|
|
512
|
+
deviceId: deviceId ?? void 0,
|
|
513
|
+
roomId: roomId ?? void 0,
|
|
514
|
+
...clientOpts
|
|
515
|
+
});
|
|
668
516
|
return jsonResult({
|
|
669
517
|
ok: true,
|
|
670
|
-
verification
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
518
|
+
verification
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
if (action === "verificationAccept") {
|
|
522
|
+
const verification = await acceptMatrixVerification(readStringParam({ requestId }, "requestId", { required: true }), clientOpts);
|
|
523
|
+
return jsonResult({
|
|
524
|
+
ok: true,
|
|
525
|
+
verification
|
|
677
526
|
});
|
|
678
527
|
}
|
|
679
|
-
if (action === "verificationAccept") return jsonResult({
|
|
680
|
-
ok: true,
|
|
681
|
-
verification: await acceptMatrixVerification(readStringParam({ requestId }, "requestId", { required: true }), clientOpts)
|
|
682
|
-
});
|
|
683
528
|
if (action === "verificationCancel") {
|
|
684
529
|
const reason = readStringParam(params, "reason");
|
|
685
530
|
const code = readStringParam(params, "code");
|
|
531
|
+
const verification = await cancelMatrixVerification(readStringParam({ requestId }, "requestId", { required: true }), {
|
|
532
|
+
reason: reason ?? void 0,
|
|
533
|
+
code: code ?? void 0,
|
|
534
|
+
...clientOpts
|
|
535
|
+
});
|
|
686
536
|
return jsonResult({
|
|
687
537
|
ok: true,
|
|
688
|
-
verification
|
|
689
|
-
reason: reason ?? void 0,
|
|
690
|
-
code: code ?? void 0,
|
|
691
|
-
...clientOpts
|
|
692
|
-
})
|
|
538
|
+
verification
|
|
693
539
|
});
|
|
694
540
|
}
|
|
695
541
|
if (action === "verificationStart") {
|
|
696
|
-
const
|
|
542
|
+
const methodRaw = readStringParam(params, "method");
|
|
543
|
+
const method = normalizeOptionalLowercaseString(methodRaw);
|
|
697
544
|
if (method && method !== "sas") throw new Error("Matrix verificationStart only supports method=sas; use verificationGenerateQr/verificationScanQr for QR flows.");
|
|
545
|
+
const verification = await startMatrixVerification(readStringParam({ requestId }, "requestId", { required: true }), {
|
|
546
|
+
method: "sas",
|
|
547
|
+
...clientOpts
|
|
548
|
+
});
|
|
698
549
|
return jsonResult({
|
|
699
550
|
ok: true,
|
|
700
|
-
verification
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
551
|
+
verification
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
if (action === "verificationGenerateQr") {
|
|
555
|
+
const qr = await generateMatrixVerificationQr(readStringParam({ requestId }, "requestId", { required: true }), clientOpts);
|
|
556
|
+
return jsonResult({
|
|
557
|
+
ok: true,
|
|
558
|
+
...qr
|
|
704
559
|
});
|
|
705
560
|
}
|
|
706
|
-
if (action === "verificationGenerateQr") return jsonResult({
|
|
707
|
-
ok: true,
|
|
708
|
-
...await generateMatrixVerificationQr(readStringParam({ requestId }, "requestId", { required: true }), clientOpts)
|
|
709
|
-
});
|
|
710
561
|
if (action === "verificationScanQr") {
|
|
711
562
|
const qrDataBase64 = readStringParam(params, "qrDataBase64") ?? readStringParam(params, "qrData") ?? readStringParam(params, "qr");
|
|
563
|
+
const verification = await scanMatrixVerificationQr(readStringParam({ requestId }, "requestId", { required: true }), readStringParam({ qrDataBase64 }, "qrDataBase64", { required: true }), clientOpts);
|
|
712
564
|
return jsonResult({
|
|
713
565
|
ok: true,
|
|
714
|
-
verification
|
|
566
|
+
verification
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
if (action === "verificationSas") {
|
|
570
|
+
const sas = await getMatrixVerificationSas(readStringParam({ requestId }, "requestId", { required: true }), clientOpts);
|
|
571
|
+
return jsonResult({
|
|
572
|
+
ok: true,
|
|
573
|
+
sas
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
if (action === "verificationConfirm") {
|
|
577
|
+
const verification = await confirmMatrixVerificationSas(readStringParam({ requestId }, "requestId", { required: true }), clientOpts);
|
|
578
|
+
return jsonResult({
|
|
579
|
+
ok: true,
|
|
580
|
+
verification
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
if (action === "verificationMismatch") {
|
|
584
|
+
const verification = await mismatchMatrixVerificationSas(readStringParam({ requestId }, "requestId", { required: true }), clientOpts);
|
|
585
|
+
return jsonResult({
|
|
586
|
+
ok: true,
|
|
587
|
+
verification
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
if (action === "verificationConfirmQr") {
|
|
591
|
+
const verification = await confirmMatrixVerificationReciprocateQr(readStringParam({ requestId }, "requestId", { required: true }), clientOpts);
|
|
592
|
+
return jsonResult({
|
|
593
|
+
ok: true,
|
|
594
|
+
verification
|
|
715
595
|
});
|
|
716
596
|
}
|
|
717
|
-
if (action === "verificationSas") return jsonResult({
|
|
718
|
-
ok: true,
|
|
719
|
-
sas: await getMatrixVerificationSas(readStringParam({ requestId }, "requestId", { required: true }), clientOpts)
|
|
720
|
-
});
|
|
721
|
-
if (action === "verificationConfirm") return jsonResult({
|
|
722
|
-
ok: true,
|
|
723
|
-
verification: await confirmMatrixVerificationSas(readStringParam({ requestId }, "requestId", { required: true }), clientOpts)
|
|
724
|
-
});
|
|
725
|
-
if (action === "verificationMismatch") return jsonResult({
|
|
726
|
-
ok: true,
|
|
727
|
-
verification: await mismatchMatrixVerificationSas(readStringParam({ requestId }, "requestId", { required: true }), clientOpts)
|
|
728
|
-
});
|
|
729
|
-
if (action === "verificationConfirmQr") return jsonResult({
|
|
730
|
-
ok: true,
|
|
731
|
-
verification: await confirmMatrixVerificationReciprocateQr(readStringParam({ requestId }, "requestId", { required: true }), clientOpts)
|
|
732
|
-
});
|
|
733
597
|
}
|
|
734
598
|
throw new Error(`Unsupported Matrix action: ${action}`);
|
|
735
599
|
}
|