@openclaw/matrix 2026.10.2 → 2026.10.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-selection-BDeeqwwR.mjs → account-selection-Bs_jCAaG.mjs} +3 -5
- package/dist/.setup/{approval-handler.runtime-QkHLH2az.mjs → approval-handler.runtime-rxLn8CbP.mjs} +60 -83
- package/dist/.setup/{channel-CeRXEAEP.mjs → channel-BcwGspPw.mjs} +92 -120
- package/dist/.setup/{channel.runtime-DBQA2y1F.mjs → channel.runtime-CUc6rbu1.mjs} +23 -18
- package/dist/.setup/{channel.setup-DC2t7_PK.mjs → channel.setup-CwuYD_CT.mjs} +2 -3
- package/dist/.setup/{cli-Be8tdNw8.mjs → cli-mbL9jCro.mjs} +80 -120
- package/dist/.setup/{cli-metadata-CtcjBFhc.mjs → cli-metadata-6MOGuyHq.mjs} +1 -1
- package/dist/.setup/{client-DY3HExqI.mjs → client-BlTvpEWC.mjs} +2 -2
- package/dist/.setup/{client-bootstrap-CZvJjr29.mjs → client-bootstrap-D05xy1HB.mjs} +2 -3
- package/dist/.setup/{client-support-D7BlioUb.mjs → client-support-D-xHScuo.mjs} +1 -1
- package/dist/.setup/{client-kmih04ng.mjs → client-vPPbaxNp.mjs} +14 -24
- package/dist/.setup/{create-client-CbJVyFDy.mjs → create-client-CroC4BVc.mjs} +4 -4
- package/dist/.setup/{credentials-C2dvc_kB.mjs → credentials-Bf9PQ7xs.mjs} +4 -18
- package/dist/.setup/{crypto-runtime-B2AjWo-i.mjs → crypto-runtime-CpJ0b7vY.mjs} +80 -123
- package/dist/.setup/{deps-CFNl7tQo.mjs → deps-L_1bUAGL.mjs} +20 -37
- package/dist/.setup/{direct-management-DJtQhLKH.mjs → direct-management-B3wYhx_M.mjs} +25 -51
- package/dist/.setup/{directory-live-DW5UykLL.mjs → directory-live-B1WbfSHo.mjs} +3 -3
- package/dist/.setup/{draft-stream-B87DfA6a.mjs → draft-stream-Bdrh7dRt.mjs} +2 -3
- package/dist/.setup/{encryption-guidance-BEjKbiMR.mjs → encryption-guidance-D5_IsDIy.mjs} +1 -1
- package/dist/.setup/{env-vars-dGqak9dN.mjs → env-vars-aEBngJPa.mjs} +2 -17
- package/dist/.setup/{event-helpers-CspuhE9k.mjs → event-helpers-CxNgMQqH.mjs} +5 -7
- package/dist/.setup/{exec-approvals-BLDAMyHs.mjs → exec-approvals-BgNWWJg1.mjs} +6 -12
- package/dist/.setup/{file-sync-store-Clc9iEdn.mjs → file-sync-store-BdKx_gMi.mjs} +2 -5
- package/dist/.setup/{http-client-DfJY5Ck0.mjs → http-client-ByR4STVQ.mjs} +55 -59
- package/dist/.setup/{messages-uCbwLRKS.mjs → messages-B1CZqU8u.mjs} +4 -16
- package/dist/.setup/{monitor-skIntQVG.mjs → monitor-Dk_fQL1k.mjs} +176 -232
- package/dist/.setup/{onboarding-Cm_tOJxs.mjs → onboarding-CrSexor_.mjs} +33 -50
- package/dist/.setup/{outbound-CqQou3ny.mjs → outbound-LR3SqPIq.mjs} +2 -2
- package/dist/.setup/{profile-update-C1n8SRqH.mjs → profile-update-C7bjaGR6.mjs} +2 -3
- package/dist/.setup/{reaction-events-Cqq46xsG.mjs → reaction-events-CTSvOlXO.mjs} +4 -4
- package/dist/.setup/{resolve-targets-DFeU1Ww6.mjs → resolve-targets-BVVbbvP6.mjs} +15 -21
- package/dist/.setup/{retired-state-BXUQ2I-C.mjs → retired-state-DW5pLH05.mjs} +22 -3
- package/dist/.setup/{room-info-BPMbwe8I.mjs → room-info-9Uqlpt1V.mjs} +4 -4
- package/dist/.setup/{sdk-CgQGkCsS.mjs → sdk-Cfc6m7fY.mjs} +115 -195
- package/dist/.setup/{secret-contract-JlB6VmI3.mjs → secret-contract-DSBRvhdZ.mjs} +1 -1
- package/dist/.setup/{secret-contract-api-B-iJoQEv.mjs → secret-contract-api-DzEJ-X7n.mjs} +1 -1
- package/dist/.setup/{send-B1Y2L4wj.mjs → send-LCOuTVc1.mjs} +10 -30
- package/dist/.setup/{setup-bootstrap-UNIGyKnk.mjs → setup-bootstrap-CV-hHBXu.mjs} +2 -2
- package/dist/.setup/setup-core-CKnNTfgD.mjs +673 -0
- package/dist/.setup/{setup-plugin-api-BRs9bcp4.mjs → setup-plugin-api-BDAYk1a5.mjs} +1 -1
- package/dist/.setup/{startup-verification-D00eUt74.mjs → startup-verification-CgfUb4yJ.mjs} +3 -3
- package/dist/.setup/{storage-D7agewjH.mjs → storage-DkC6bHgA.mjs} +24 -49
- package/dist/.setup/{subagent-hooks-D5kd_kzN.mjs → subagent-hooks-D8jyeQsO.mjs} +1 -1
- package/dist/.setup/{sync-cache-state-C2z64uyk.mjs → sync-cache-state-D4G-fi3t.mjs} +20 -33
- package/dist/.setup/{target-ids-Nwx7cMVE.mjs → target-ids-HhcaKX1n.mjs} +15 -1
- package/dist/.setup/{thread-binding-api-DRMC62cs.mjs → thread-binding-api-BvuaKpd0.mjs} +1 -1
- package/dist/.setup/{thread-bindings-DveHVZqN.mjs → thread-bindings-CT4P-OSZ.mjs} +38 -58
- package/dist/.setup/{thread-bindings-shared-hxKkYC1W.mjs → thread-bindings-shared-CbsFNbAY.mjs} +19 -37
- package/dist/.setup/{tool-actions-BqlK2ilM.mjs → tool-actions-DAp6_XSJ.mjs} +17 -18
- package/dist/.setup/{verification-kMlFYUn0.mjs → verification-B3VswneT.mjs} +15 -21
- package/dist/api.js +7 -7
- 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 +13 -22
- package/dist/helper-api.js +2 -2
- package/dist/index.js +1 -1
- package/dist/plugin-entry.handlers.runtime.js +2 -2
- package/dist/runtime-api.js +4 -4
- package/dist/secret-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/setup-entry.js +2 -2
- package/dist/setup-plugin-api.js +1 -1
- 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 +129 -129
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +688 -688
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +512 -512
- 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 +84 -84
- package/node_modules/@openclaw/fs-safe/CHANGELOG.md +35 -0
- package/node_modules/@openclaw/fs-safe/README.md +1 -1
- package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/advanced.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +4 -4
- package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
- package/node_modules/@openclaw/fs-safe/dist/archive-read.js +5 -4
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +1 -1
- package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +22 -38
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.d.ts +17 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +117 -0
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.d.ts +8 -5
- package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.js +27 -50
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +3 -0
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +57 -11
- package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +5 -5
- package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +52 -5
- package/node_modules/@openclaw/fs-safe/dist/guest.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +1 -0
- package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/native-operations.js +22 -26
- package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +5 -1
- package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +4 -1
- package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +2 -1
- package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +6 -1
- package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +2 -2
- package/node_modules/@openclaw/fs-safe/dist/publish-file.js +34 -7
- package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +1 -4
- package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +6 -0
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +15 -1
- package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +4 -0
- package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +0 -1
- package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +6 -12
- package/node_modules/@openclaw/fs-safe/dist/root-impl.js +15 -15
- package/node_modules/@openclaw/fs-safe/dist/root-paths.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/root-walk.js +4 -4
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +10 -1
- package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +20 -0
- package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +19 -7
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +25 -3
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +2 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.d.ts +14 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.js +187 -0
- package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +15 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.d.ts +10 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.js +29 -0
- package/node_modules/@openclaw/fs-safe/dist/temp-target.js +1 -1
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +6 -6
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +4 -4
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +17 -16
- package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +20 -28
- package/node_modules/@openclaw/fs-safe/dist/walk.js +2 -13
- package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +2 -2
- package/node_modules/@openclaw/fs-safe/dist/watch-native.js +3 -1
- package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +3 -9
- package/node_modules/@openclaw/fs-safe/dist/watch.js +2 -3
- package/node_modules/@openclaw/fs-safe/docs/advanced.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/archive.md +3 -0
- package/node_modules/@openclaw/fs-safe/docs/atomic.md +11 -3
- package/node_modules/@openclaw/fs-safe/docs/contributing.md +1 -1
- package/node_modules/@openclaw/fs-safe/docs/copy.md +48 -0
- package/node_modules/@openclaw/fs-safe/docs/guest.md +21 -4
- package/node_modules/@openclaw/fs-safe/docs/path-scope.md +4 -0
- package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +46 -8
- package/node_modules/@openclaw/fs-safe/docs/temp.md +12 -0
- package/node_modules/@openclaw/fs-safe/docs/watch.md +3 -2
- package/node_modules/@openclaw/fs-safe/package.json +15 -15
- package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
- package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
- package/node_modules/matrix-widget-api/lib/interfaces/RtcLivekitActions.d.ts +6 -12
- package/node_modules/matrix-widget-api/lib/interfaces/RtcLivekitActions.js.map +1 -1
- package/node_modules/matrix-widget-api/package.json +1 -1
- package/node_modules/matrix-widget-api/src/interfaces/RtcLivekitActions.ts +6 -13
- package/node_modules/music-metadata/README.md +35 -32
- package/node_modules/music-metadata/lib/ParserFactory.d.ts +1 -1
- package/node_modules/music-metadata/lib/ParserFactory.js +17 -13
- package/node_modules/music-metadata/lib/aiff/AiffParser.js +19 -12
- package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +1 -1
- package/node_modules/music-metadata/lib/aiff/AiffToken.js +2 -1
- package/node_modules/music-metadata/lib/apev2/APEv2Parser.d.ts +4 -3
- package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +59 -16
- package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.js +1 -0
- package/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts +1 -1
- package/node_modules/music-metadata/lib/apev2/APEv2Token.js +1 -1
- package/node_modules/music-metadata/lib/asf/AsfGuid.js +56 -50
- package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +1 -1
- package/node_modules/music-metadata/lib/asf/AsfObject.js +3 -2
- package/node_modules/music-metadata/lib/asf/AsfParser.js +15 -7
- package/node_modules/music-metadata/lib/asf/AsfTagMapper.d.ts +3 -2
- package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +21 -4
- package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/CombinedTagMapper.d.ts +2 -2
- package/node_modules/music-metadata/lib/common/CombinedTagMapper.js +6 -6
- package/node_modules/music-metadata/lib/common/FourCC.js +3 -2
- package/node_modules/music-metadata/lib/common/GenericTagMapper.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/GenericTagTypes.js +1 -1
- package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +3 -1
- package/node_modules/music-metadata/lib/common/MetadataCollector.js +28 -9
- package/node_modules/music-metadata/lib/common/Util.js +25 -17
- package/node_modules/music-metadata/lib/core.d.ts +4 -4
- package/node_modules/music-metadata/lib/core.js +18 -11
- package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +29 -16
- package/node_modules/music-metadata/lib/dsf/DsfChunk.d.ts +1 -1
- package/node_modules/music-metadata/lib/dsf/DsfParser.js +3 -5
- package/node_modules/music-metadata/lib/ebml/EbmlIterator.d.ts +1 -1
- package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +35 -6
- package/node_modules/music-metadata/lib/ebml/types.d.ts +1 -1
- package/node_modules/music-metadata/lib/ebml/types.js +1 -1
- package/node_modules/music-metadata/lib/flac/FlacParser.d.ts +1 -1
- package/node_modules/music-metadata/lib/flac/FlacParser.js +6 -5
- package/node_modules/music-metadata/lib/flac/FlacToken.d.ts +1 -1
- package/node_modules/music-metadata/lib/flac/FlacToken.js +1 -1
- package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.d.ts +1 -1
- package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +212 -42
- package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js +5 -5
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.d.ts +1 -1
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +8 -5
- package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +2 -1
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +54 -23
- package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.d.ts +1 -1
- package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +1 -1
- package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +3 -3
- package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.js +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +1 -1
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +32 -16
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.d.ts +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +2 -3
- package/node_modules/music-metadata/lib/index.js +6 -3
- package/node_modules/music-metadata/lib/lrc/LyricsParser.js +3 -5
- package/node_modules/music-metadata/lib/matroska/MatroskaDtd.js +7 -3
- package/node_modules/music-metadata/lib/matroska/MatroskaParser.js +22 -11
- package/node_modules/music-metadata/lib/matroska/types.d.ts +2 -2
- package/node_modules/music-metadata/lib/mp4/Atom.d.ts +4 -3
- package/node_modules/music-metadata/lib/mp4/Atom.js +44 -11
- package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +1 -1
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +30 -8
- package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +2 -0
- package/node_modules/music-metadata/lib/mp4/MP4Parser.js +79 -54
- package/node_modules/music-metadata/lib/mp4/MP4TagMapper.d.ts +2 -2
- package/node_modules/music-metadata/lib/mpeg/MpegLoader.js +1 -1
- package/node_modules/music-metadata/lib/mpeg/MpegParser.js +41 -19
- package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.d.ts +2 -2
- package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js +1 -1
- package/node_modules/music-metadata/lib/mpeg/XingTag.d.ts +1 -1
- package/node_modules/music-metadata/lib/musepack/MusepackParser.js +2 -2
- package/node_modules/music-metadata/lib/musepack/sv7/BitReader.js +1 -1
- package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js +4 -3
- package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js +3 -3
- package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js +7 -5
- package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +2 -2
- package/node_modules/music-metadata/lib/ogg/OggParser.js +23 -13
- package/node_modules/music-metadata/lib/ogg/OggToken.d.ts +2 -0
- package/node_modules/music-metadata/lib/ogg/OggToken.js +1 -1
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +2 -2
- package/node_modules/music-metadata/lib/ogg/opus/OpusStream.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/opus/OpusStream.js +8 -4
- package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +2 -1
- package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.d.ts +1 -1
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +1 -1
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +4 -3
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +16 -9
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +4 -0
- package/node_modules/music-metadata/lib/riff/RiffChunk.d.ts +3 -1
- package/node_modules/music-metadata/lib/riff/RiffChunk.js +3 -2
- package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.d.ts +1 -1
- package/node_modules/music-metadata/lib/type.d.ts +3 -3
- package/node_modules/music-metadata/lib/type.js +1 -1
- package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +1 -1
- package/node_modules/music-metadata/lib/wav/WaveChunk.js +3 -2
- package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +6 -2
- package/node_modules/music-metadata/lib/wav/WaveParser.js +75 -22
- package/node_modules/music-metadata/lib/wavpack/WavPackParser.js +22 -13
- package/node_modules/music-metadata/lib/wavpack/WavPackToken.js +3 -2
- package/node_modules/music-metadata/package.json +3 -2
- package/node_modules/uint8array-extras/index.d.ts +7 -7
- package/node_modules/uint8array-extras/index.js +27 -13
- package/node_modules/uint8array-extras/package.json +6 -6
- package/node_modules/uint8array-extras/readme.md +7 -7
- package/package.json +7 -7
- package/dist/.setup/accounts-C_r0UlEm.mjs +0 -138
- package/dist/.setup/config-update-CZndPxNd.mjs +0 -102
- package/dist/.setup/profile-DS0xdJAi.mjs +0 -80
- package/dist/.setup/setup-core-6DppLENo.mjs +0 -377
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.d.ts +0 -17
- package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.js +0 -66
- package/node_modules/@openclaw/fs-safe/dist/publish-file-native.d.ts +0 -4
- package/node_modules/@openclaw/fs-safe/dist/publish-file-native.js +0 -35
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.d.ts +0 -7
- package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.js +0 -16
- package/dist/.setup/{errors-DKVS3_DO.mjs → errors-Bw4EHwKX.mjs} +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
|
|
2
2
|
import { n as getMatrixRuntimeLifecycle } from "./runtime-1kn1P6io.mjs";
|
|
3
|
-
import { c as hasReadyMatrixEnvAuth, d as resolveScopedMatrixEnvConfig, f as resolveMatrixAccountStringValues, i as requiresExplicitMatrixDefaultAccount, l as resolveGlobalMatrixEnvConfig, s as resolveMatrixDefaultOrOnlyAccountId, u as resolveMatrixEnvAuthReadiness } from "./account-selection-
|
|
4
|
-
import { t as getMatrixScopedEnvVarNames } from "./env-vars-
|
|
3
|
+
import { c as hasReadyMatrixEnvAuth, d as resolveScopedMatrixEnvConfig, f as resolveMatrixAccountStringValues, i as requiresExplicitMatrixDefaultAccount, l as resolveGlobalMatrixEnvConfig, s as resolveMatrixDefaultOrOnlyAccountId, u as resolveMatrixEnvAuthReadiness } from "./account-selection-Bs_jCAaG.mjs";
|
|
4
|
+
import { t as getMatrixScopedEnvVarNames } from "./env-vars-aEBngJPa.mjs";
|
|
5
5
|
import { o as resolveMatrixBaseConfig, r as listNormalizedMatrixAccountIds, t as findMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
6
6
|
import { t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.mjs";
|
|
7
7
|
import { n as validateMatrixHomeserverUrl, t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-CF6pG6eE.mjs";
|
|
8
|
-
import { i as repairCurrentTokenStorageMetaDeviceId } from "./storage-
|
|
8
|
+
import { i as repairCurrentTokenStorageMetaDeviceId } from "./storage-DkC6bHgA.mjs";
|
|
9
9
|
import { createLazyRuntimeMethod, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
10
10
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
|
|
11
|
+
import { formatErrorMessage, toErrorObject, toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
11
12
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
13
|
import { coerceSecretRef, isBuiltInDefaultSecretProviderRef, normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
13
|
-
import { formatErrorMessage, toErrorObject, toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
14
14
|
import { resolveOptionalIntegerOption } from "openclaw/plugin-sdk/number-runtime";
|
|
15
15
|
import { ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
16
16
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
17
17
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
18
|
-
import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
18
|
+
import { racePromiseWithAbortSignal, raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
19
19
|
import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
20
20
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
21
21
|
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
22
22
|
//#region extensions/matrix/src/matrix/client/auth-request.ts
|
|
23
|
-
const loadMatrixAuthClientDeps = createLazyRuntimeModule(() => Promise.all([import("./sdk-
|
|
23
|
+
const loadMatrixAuthClientDeps = createLazyRuntimeModule(() => Promise.all([import("./sdk-Cfc6m7fY.mjs").then((n) => n.t), import("./logging-BKV8TYQq.mjs").then((n) => n.n)]).then(([sdkModule, loggingModule]) => ({
|
|
24
24
|
MatrixClient: sdkModule.MatrixClient,
|
|
25
25
|
ensureMatrixSdkLoggingConfigured: loggingModule.ensureMatrixSdkLoggingConfigured
|
|
26
26
|
})));
|
|
@@ -90,7 +90,7 @@ async function fetchMatrixWhoamiIdentity(params) {
|
|
|
90
90
|
//#endregion
|
|
91
91
|
//#region extensions/matrix/src/matrix/client/config.ts
|
|
92
92
|
const loadMatrixCredentialsReadDeps = createLazyRuntimeModule(() => import("./credentials-read-CqRiEAQa.mjs").then((n) => n.i));
|
|
93
|
-
const loadMatrixCredentialsWriteRuntime = createLazyRuntimeModule(() => import("./credentials-
|
|
93
|
+
const loadMatrixCredentialsWriteRuntime = createLazyRuntimeModule(() => import("./credentials-Bf9PQ7xs.mjs"));
|
|
94
94
|
const loadMatrixSecretInputDeps = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/secret-input-runtime"));
|
|
95
95
|
function credentialsMatchBackfillAuthLineage(params) {
|
|
96
96
|
if (!params.stored) return true;
|
|
@@ -509,25 +509,15 @@ function isMatrixStartupAbortError(error) {
|
|
|
509
509
|
}
|
|
510
510
|
async function awaitMatrixStartupWithAbort(promise, abortSignal) {
|
|
511
511
|
if (!abortSignal) return await promise;
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
};
|
|
518
|
-
abortSignal.addEventListener("abort", onAbort, { once: true });
|
|
519
|
-
promise.then((value) => {
|
|
520
|
-
abortSignal.removeEventListener("abort", onAbort);
|
|
521
|
-
resolve(value);
|
|
522
|
-
}, (error) => {
|
|
523
|
-
abortSignal.removeEventListener("abort", onAbort);
|
|
524
|
-
reject(toErrorObject(error, "Non-Error rejection"));
|
|
525
|
-
});
|
|
526
|
-
});
|
|
512
|
+
try {
|
|
513
|
+
return await racePromiseWithAbortSignal(promise, abortSignal, createMatrixStartupAbortError);
|
|
514
|
+
} catch (error) {
|
|
515
|
+
throw toErrorObject(error, "Non-Error rejection");
|
|
516
|
+
}
|
|
527
517
|
}
|
|
528
518
|
//#endregion
|
|
529
519
|
//#region extensions/matrix/src/matrix/client/shared.ts
|
|
530
|
-
const loadMatrixCreateClientDeps = createLazyRuntimeModule(() => import("./create-client-
|
|
520
|
+
const loadMatrixCreateClientDeps = createLazyRuntimeModule(() => import("./create-client-CroC4BVc.mjs"));
|
|
531
521
|
const MATRIX_RETIREMENT_DRAIN_TIMEOUT_MS = 5e3;
|
|
532
522
|
const sharedClientStates = /* @__PURE__ */ new Map();
|
|
533
523
|
const sharedClientPromises = /* @__PURE__ */ new Map();
|
|
@@ -891,7 +881,7 @@ var client_exports = /* @__PURE__ */ __exportAll({
|
|
|
891
881
|
stopSharedClientForAccount: () => stopSharedClientForAccount,
|
|
892
882
|
validateMatrixHomeserverUrl: () => validateMatrixHomeserverUrl
|
|
893
883
|
});
|
|
894
|
-
const loadMatrixClientRuntime = createLazyRuntimeModule(() => import("./create-client-
|
|
884
|
+
const loadMatrixClientRuntime = createLazyRuntimeModule(() => import("./create-client-CroC4BVc.mjs"));
|
|
895
885
|
const createMatrixClient = createLazyRuntimeMethod(loadMatrixClientRuntime, (runtime) => runtime.createMatrixClient);
|
|
896
886
|
//#endregion
|
|
897
887
|
export { isMatrixStartupAbortError as a, getMatrixMonitorTaskSignal as c, resolveMatrixAuthContext as d, createMatrixStartupAbortError as i, backfillMatrixAuthDeviceIdAfterStartup as l, acquireSharedMatrixClient as n, throwIfMatrixStartupAborted as o, awaitMatrixStartupWithAbort as r, createMatrixMonitorTaskRunner as s, client_exports as t, resolveMatrixAuth as u };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
2
|
import { t as resolveValidatedMatrixHomeserverUrl } from "./url-validation-CF6pG6eE.mjs";
|
|
3
|
-
import { n as maybeMigrateLegacyStorage, o as resolveMatrixStoragePaths, s as writeStorageMeta } from "./storage-
|
|
4
|
-
import "./client-
|
|
3
|
+
import { n as maybeMigrateLegacyStorage, o as resolveMatrixStoragePaths, s as writeStorageMeta } from "./storage-DkC6bHgA.mjs";
|
|
4
|
+
import "./client-vPPbaxNp.mjs";
|
|
5
5
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { ssrfPolicyFromDangerouslyAllowPrivateNetwork } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
8
8
|
import fs from "node:fs";
|
|
9
9
|
//#region extensions/matrix/src/matrix/client/create-client.ts
|
|
10
10
|
const loadMatrixCreateClientRuntimeDeps = createLazyRuntimeModule(() => Promise.all([
|
|
11
|
-
import("./sdk-
|
|
11
|
+
import("./sdk-Cfc6m7fY.mjs").then((n) => n.t),
|
|
12
12
|
import("./logging-BKV8TYQq.mjs").then((n) => n.n),
|
|
13
|
-
import("./file-sync-store-
|
|
13
|
+
import("./file-sync-store-BdKx_gMi.mjs")
|
|
14
14
|
]).then(([sdkModule, loggingModule, syncStoreModule]) => ({
|
|
15
15
|
MatrixClient: sdkModule.MatrixClient,
|
|
16
16
|
SqliteBackedMatrixSyncStore: syncStoreModule.SqliteBackedMatrixSyncStore,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { i as normalizeMatrixStoredCredentials, n as isMatrixCredentialRevocation, r as matrixCredentialsStoreKey } from "./credentials-state-B3cuUFwZ.mjs";
|
|
2
2
|
import { i as resolveMatrixCredentialsDir, o as resolveMatrixCredentialsPath } from "./storage-paths-B51JM-pC.mjs";
|
|
3
3
|
import { a as loadMatrixCredentials, c as openMatrixCredentialsStore, n as clearMatrixCredentials, r as credentialsMatchConfig, s as openMatrixCredentialsAsyncStore } from "./credentials-read-CqRiEAQa.mjs";
|
|
4
|
+
import { c as updateMatrixKeyedState } from "./retired-state-DW5pLH05.mjs";
|
|
4
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
5
6
|
//#region extensions/matrix/src/matrix/credentials.ts
|
|
6
7
|
async function saveMatrixCredentials(credentials, env = process.env, accountId) {
|
|
@@ -51,24 +52,9 @@ async function touchMatrixCredentials(env = process.env, accountId) {
|
|
|
51
52
|
async function updateMatrixCredentials(env, accountId, update) {
|
|
52
53
|
const store = openMatrixCredentialsAsyncStore(env);
|
|
53
54
|
const key = matrixCredentialsStoreKey(accountId);
|
|
54
|
-
|
|
55
|
-
openMatrixCredentialsStore(env).update(key, update);
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
let observation = await store.observe(key);
|
|
59
|
-
for (;;) {
|
|
60
|
-
const value = update(observation.value);
|
|
61
|
-
const result = await store.compareAndApply(key, observation.comparison, value === void 0 ? {
|
|
62
|
-
operation: "update",
|
|
63
|
-
action: "keep"
|
|
64
|
-
} : {
|
|
65
|
-
operation: "update",
|
|
66
|
-
action: "set",
|
|
67
|
-
value
|
|
68
|
-
});
|
|
69
|
-
if (result.status !== "conflict") return;
|
|
70
|
-
observation = result.current;
|
|
71
|
-
}
|
|
55
|
+
await updateMatrixKeyedState(store, key, update, () => {
|
|
56
|
+
return openMatrixCredentialsStore(env).update(key, update);
|
|
57
|
+
});
|
|
72
58
|
}
|
|
73
59
|
//#endregion
|
|
74
60
|
export { clearMatrixCredentials, credentialsMatchConfig, loadMatrixCredentials, resolveMatrixCredentialsDir, resolveMatrixCredentialsPath, saveBackfilledMatrixDeviceId, saveMatrixCredentials, touchMatrixCredentials };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
|
-
import { t as ensureMatrixCryptoRuntime } from "./deps-
|
|
3
|
-
import { n as RETIRED_MATRIX_STATE_REMEDIATION } from "./retired-state-
|
|
4
|
-
import { c as readMatrixIdbSnapshotJson, u as writeMatrixIdbSnapshotJson } from "./storage-
|
|
2
|
+
import { t as ensureMatrixCryptoRuntime } from "./deps-L_1bUAGL.mjs";
|
|
3
|
+
import { n as RETIRED_MATRIX_STATE_REMEDIATION } from "./retired-state-DW5pLH05.mjs";
|
|
4
|
+
import { c as readMatrixIdbSnapshotJson, u as writeMatrixIdbSnapshotJson } from "./storage-DkC6bHgA.mjs";
|
|
5
5
|
import { r as noop, t as LogService } from "./logger-CXQnpXCt.mjs";
|
|
6
|
-
import { a as isRepairableSecretStorageAccessError, i as trustMatrixOwnIdentity, n as isMatrixDeviceOwnerVerified, o as MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS, r as isMatrixDeviceVerifiedInCurrentClient } from "./sdk-
|
|
6
|
+
import { a as isRepairableSecretStorageAccessError, i as trustMatrixOwnIdentity, n as isMatrixDeviceOwnerVerified, o as MATRIX_IDB_SNAPSHOT_LOCK_OPTIONS, r as isMatrixDeviceVerifiedInCurrentClient } from "./sdk-Cfc6m7fY.mjs";
|
|
7
7
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
8
|
-
import { filterStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
-
import path from "node:path";
|
|
10
8
|
import { formatErrorMessage, toErrorObject, toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
9
|
+
import { asOptionalObjectRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
|
+
import path from "node:path";
|
|
11
11
|
import { resolveDateTimestampMs, resolveTimestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
12
12
|
import fs from "node:fs";
|
|
13
13
|
import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
@@ -125,22 +125,8 @@ var MatrixCryptoBootstrapper = class {
|
|
|
125
125
|
userId,
|
|
126
126
|
password: this.deps.getPassword?.()
|
|
127
127
|
});
|
|
128
|
-
const hasPublishedCrossSigningKeys =
|
|
129
|
-
|
|
130
|
-
try {
|
|
131
|
-
return await crypto.userHasCrossSigningKeys(userId, true);
|
|
132
|
-
} catch {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
const isCrossSigningReady = async () => {
|
|
137
|
-
if (typeof crypto.isCrossSigningReady !== "function") return true;
|
|
138
|
-
try {
|
|
139
|
-
return await crypto.isCrossSigningReady();
|
|
140
|
-
} catch {
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
128
|
+
const hasPublishedCrossSigningKeys = () => crypto.userHasCrossSigningKeys(userId, true).catch(() => false);
|
|
129
|
+
const isCrossSigningReady = () => crypto.isCrossSigningReady().catch(() => false);
|
|
144
130
|
const finalize = async () => {
|
|
145
131
|
const ready = await isCrossSigningReady();
|
|
146
132
|
const published = ready ? await waitForPublishedCrossSigningKeys() : await hasPublishedCrossSigningKeys();
|
|
@@ -277,13 +263,11 @@ var MatrixCryptoBootstrapper = class {
|
|
|
277
263
|
const deviceId = this.deps.getDeviceId()?.trim();
|
|
278
264
|
if (!deviceId) return null;
|
|
279
265
|
const userId = await this.deps.getUserId();
|
|
280
|
-
const deviceStatus =
|
|
266
|
+
const deviceStatus = await crypto.getDeviceVerificationStatus(userId, deviceId).catch(() => null);
|
|
281
267
|
if (isMatrixDeviceOwnerVerified(deviceStatus)) return true;
|
|
282
|
-
|
|
283
|
-
if (
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
const refreshedStatus = typeof crypto.getDeviceVerificationStatus === "function" ? await crypto.getDeviceVerificationStatus(userId, deviceId).catch(() => null) : null;
|
|
268
|
+
await crypto.setDeviceVerified(userId, deviceId, true);
|
|
269
|
+
if (await crypto.isCrossSigningReady()) await crypto.crossSignDevice(deviceId);
|
|
270
|
+
const refreshedStatus = await crypto.getDeviceVerificationStatus(userId, deviceId).catch(() => null);
|
|
287
271
|
const verified = isMatrixDeviceOwnerVerified(refreshedStatus);
|
|
288
272
|
if (!verified && options.strict) throw new Error(`Matrix own device ${deviceId} does not have full Matrix identity trust after bootstrap`);
|
|
289
273
|
return verified;
|
|
@@ -310,7 +294,7 @@ function createMatrixCryptoFacade(deps) {
|
|
|
310
294
|
return async (...args) => {
|
|
311
295
|
const crypto = deps.client.getCrypto();
|
|
312
296
|
const userId = deps.client.getUserId();
|
|
313
|
-
if (userId &&
|
|
297
|
+
if (userId && crypto) for (const request of crypto.getVerificationRequestsToDeviceInProgress(userId)) manager.trackVerificationRequest(request);
|
|
314
298
|
return await run(...args);
|
|
315
299
|
};
|
|
316
300
|
}
|
|
@@ -351,14 +335,12 @@ function createMatrixCryptoFacade(deps) {
|
|
|
351
335
|
},
|
|
352
336
|
listVerifications: withTrackedVerifications(manager.listVerifications.bind(manager)),
|
|
353
337
|
ensureVerificationDmTracked: async ({ roomId, userId }) => {
|
|
354
|
-
const
|
|
355
|
-
const request = typeof crypto?.findVerificationRequestDMInProgress === "function" ? crypto.findVerificationRequestDMInProgress(roomId, userId) : void 0;
|
|
338
|
+
const request = deps.client.getCrypto()?.findVerificationRequestDMInProgress(roomId, userId);
|
|
356
339
|
if (!request) return null;
|
|
357
340
|
return deps.verificationManager.trackVerificationRequest(request);
|
|
358
341
|
},
|
|
359
342
|
requestVerification: async (params) => {
|
|
360
|
-
|
|
361
|
-
return await deps.verificationManager.requestVerification(crypto, params);
|
|
343
|
+
return await deps.verificationManager.requestVerification(deps.client.getCrypto(), params);
|
|
362
344
|
},
|
|
363
345
|
acceptVerification: withTrackedVerifications(manager.acceptVerification.bind(manager)),
|
|
364
346
|
cancelVerification: withTrackedVerifications(manager.cancelVerification.bind(manager)),
|
|
@@ -457,33 +439,33 @@ var MatrixDecryptBridge = class {
|
|
|
457
439
|
const pending = Array.from(this.decryptRetries.entries());
|
|
458
440
|
if (pending.length === 0) return;
|
|
459
441
|
LogService.debug("MatrixClientLite", `Retrying pending decryptions due to ${reason}`);
|
|
460
|
-
|
|
461
|
-
if (state.timer) {
|
|
462
|
-
clearTimeout(state.timer);
|
|
463
|
-
state.timer = null;
|
|
464
|
-
}
|
|
465
|
-
if (state.inFlight) continue;
|
|
466
|
-
this.runDecryptRetry(retryKey).catch(noop);
|
|
467
|
-
}
|
|
442
|
+
this.startPendingRetries(pending);
|
|
468
443
|
}
|
|
469
444
|
bindCryptoRetrySignals(crypto) {
|
|
470
445
|
if (!crypto || this.cryptoRetrySignalsBound) return;
|
|
471
446
|
this.cryptoRetrySignalsBound = true;
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
447
|
+
for (const [eventName, reason, includeExhausted] of [
|
|
448
|
+
[
|
|
449
|
+
CryptoEvent.KeyBackupDecryptionKeyCached,
|
|
450
|
+
"crypto.keyBackupDecryptionKeyCached",
|
|
451
|
+
true
|
|
452
|
+
],
|
|
453
|
+
[
|
|
454
|
+
CryptoEvent.RehydrationCompleted,
|
|
455
|
+
"dehydration.RehydrationCompleted",
|
|
456
|
+
true
|
|
457
|
+
],
|
|
458
|
+
[
|
|
459
|
+
CryptoEvent.DevicesUpdated,
|
|
460
|
+
"crypto.devicesUpdated",
|
|
461
|
+
false
|
|
462
|
+
],
|
|
463
|
+
[
|
|
464
|
+
CryptoEvent.KeysChanged,
|
|
465
|
+
"crossSigning.keysChanged",
|
|
466
|
+
false
|
|
467
|
+
]
|
|
468
|
+
]) crypto.on(eventName, () => this.retryPendingNow(reason, { includeExhausted }));
|
|
487
469
|
}
|
|
488
470
|
stop() {
|
|
489
471
|
this.quiescing = true;
|
|
@@ -495,7 +477,12 @@ var MatrixDecryptBridge = class {
|
|
|
495
477
|
async drainPendingDecryptions(_reason) {
|
|
496
478
|
this.quiescing = true;
|
|
497
479
|
const pendingSdkDecryptions = Array.from(this.pendingSdkDecryptions);
|
|
498
|
-
|
|
480
|
+
this.startPendingRetries(Array.from(this.decryptRetries.entries()));
|
|
481
|
+
await raceWithTimeout(Promise.all([Promise.allSettled(pendingSdkDecryptions), this.waitForActiveRetryRunsToFinish()]), MATRIX_DECRYPT_DRAIN_TIMEOUT_MS, () => {
|
|
482
|
+
throw new Error(`Matrix decryption drain did not finish within ${MATRIX_DECRYPT_DRAIN_TIMEOUT_MS}ms`);
|
|
483
|
+
}, { ref: false });
|
|
484
|
+
}
|
|
485
|
+
startPendingRetries(pending) {
|
|
499
486
|
for (const [retryKey, state] of pending) {
|
|
500
487
|
if (state.timer) {
|
|
501
488
|
clearTimeout(state.timer);
|
|
@@ -503,9 +490,6 @@ var MatrixDecryptBridge = class {
|
|
|
503
490
|
}
|
|
504
491
|
if (!state.inFlight) this.runDecryptRetry(retryKey).catch(noop);
|
|
505
492
|
}
|
|
506
|
-
await raceWithTimeout(Promise.all([Promise.allSettled(pendingSdkDecryptions), this.waitForActiveRetryRunsToFinish()]), MATRIX_DECRYPT_DRAIN_TIMEOUT_MS, () => {
|
|
507
|
-
throw new Error(`Matrix decryption drain did not finish within ${MATRIX_DECRYPT_DRAIN_TIMEOUT_MS}ms`);
|
|
508
|
-
}, { ref: false });
|
|
509
493
|
}
|
|
510
494
|
handleEncryptedEventDecrypted(params) {
|
|
511
495
|
if (this.stopped) return;
|
|
@@ -667,24 +651,22 @@ var MatrixIdbSnapshotMigrationRequiredError = class extends Error {
|
|
|
667
651
|
}
|
|
668
652
|
};
|
|
669
653
|
function isValidIdbIndexSnapshot(value) {
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
return typeof candidate.name === "string" && (typeof candidate.keyPath === "string" || Array.isArray(candidate.keyPath) && candidate.keyPath.every((entry) => typeof entry === "string")) && typeof candidate.multiEntry === "boolean" && typeof candidate.unique === "boolean";
|
|
654
|
+
const candidate = asOptionalObjectRecord(value);
|
|
655
|
+
return typeof candidate?.name === "string" && (typeof candidate.keyPath === "string" || Array.isArray(candidate.keyPath) && candidate.keyPath.every((entry) => typeof entry === "string")) && typeof candidate.multiEntry === "boolean" && typeof candidate.unique === "boolean";
|
|
673
656
|
}
|
|
674
657
|
function isValidIdbRecordSnapshot(value) {
|
|
675
|
-
|
|
676
|
-
return "key" in
|
|
658
|
+
const candidate = asOptionalObjectRecord(value);
|
|
659
|
+
return Boolean(candidate && "key" in candidate && "value" in candidate);
|
|
677
660
|
}
|
|
678
661
|
function isValidIdbStoreSnapshot(value) {
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
const validKeyPath =
|
|
682
|
-
return typeof candidate
|
|
662
|
+
const candidate = asOptionalObjectRecord(value);
|
|
663
|
+
const keyPath = candidate?.keyPath;
|
|
664
|
+
const validKeyPath = keyPath === null || typeof keyPath === "string" || Array.isArray(keyPath) && keyPath.every((entry) => typeof entry === "string");
|
|
665
|
+
return typeof candidate?.name === "string" && validKeyPath && typeof candidate.autoIncrement === "boolean" && Array.isArray(candidate.indexes) && candidate.indexes.every((entry) => isValidIdbIndexSnapshot(entry)) && Array.isArray(candidate.records) && candidate.records.every((entry) => isValidIdbRecordSnapshot(entry));
|
|
683
666
|
}
|
|
684
667
|
function isValidIdbDatabaseSnapshot(value) {
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
return typeof candidate.name === "string" && typeof candidate.version === "number" && Number.isFinite(candidate.version) && candidate.version > 0 && Array.isArray(candidate.stores) && candidate.stores.every((entry) => isValidIdbStoreSnapshot(entry));
|
|
668
|
+
const candidate = asOptionalObjectRecord(value);
|
|
669
|
+
return typeof candidate?.name === "string" && typeof candidate.version === "number" && Number.isFinite(candidate.version) && candidate.version > 0 && Array.isArray(candidate.stores) && candidate.stores.every((entry) => isValidIdbStoreSnapshot(entry));
|
|
688
670
|
}
|
|
689
671
|
function parseSnapshotPayload(data) {
|
|
690
672
|
const parsed = JSON.parse(data);
|
|
@@ -846,18 +828,6 @@ function throwLegacySnapshotMigrationRequired() {
|
|
|
846
828
|
}
|
|
847
829
|
//#endregion
|
|
848
830
|
//#region extensions/matrix/src/matrix/sdk/verification-manager.ts
|
|
849
|
-
const MATRIX_VERIFICATION_PHASES = /* @__PURE__ */ new Set([
|
|
850
|
-
-1,
|
|
851
|
-
VerificationPhase.Unsent,
|
|
852
|
-
VerificationPhase.Requested,
|
|
853
|
-
VerificationPhase.Ready,
|
|
854
|
-
VerificationPhase.Started,
|
|
855
|
-
VerificationPhase.Cancelled,
|
|
856
|
-
VerificationPhase.Done
|
|
857
|
-
]);
|
|
858
|
-
function isMatrixVerificationPhase(value) {
|
|
859
|
-
return typeof value === "number" && MATRIX_VERIFICATION_PHASES.has(value);
|
|
860
|
-
}
|
|
861
831
|
const MAX_TRACKED_VERIFICATION_SESSIONS = 256;
|
|
862
832
|
const TERMINAL_SESSION_RETENTION_MS = 864e5;
|
|
863
833
|
const SAS_AUTO_CONFIRM_DELAY_MS = 3e4;
|
|
@@ -876,10 +846,6 @@ var MatrixVerificationManager = class {
|
|
|
876
846
|
return fallback;
|
|
877
847
|
}
|
|
878
848
|
}
|
|
879
|
-
readVerificationPhase(request, fallback) {
|
|
880
|
-
const phase = this.readRequestValue(() => request.phase, fallback);
|
|
881
|
-
return isMatrixVerificationPhase(phase) ? phase : fallback;
|
|
882
|
-
}
|
|
883
849
|
readVerificationRequestIdentity(request) {
|
|
884
850
|
return {
|
|
885
851
|
transactionId: this.readRequestValue(() => request.transactionId?.trim() ?? "", ""),
|
|
@@ -900,7 +866,7 @@ var MatrixVerificationManager = class {
|
|
|
900
866
|
}
|
|
901
867
|
pruneVerificationSessions(nowMs) {
|
|
902
868
|
for (const [id, session] of this.verificationSessions) {
|
|
903
|
-
const phase = this.
|
|
869
|
+
const phase = this.readRequestValue(() => session.request.phase, -1);
|
|
904
870
|
if ((phase === VerificationPhase.Done || phase === VerificationPhase.Cancelled) && nowMs - session.updatedAtMs > TERMINAL_SESSION_RETENTION_MS) this.verificationSessions.delete(id);
|
|
905
871
|
}
|
|
906
872
|
if (this.verificationSessions.size <= MAX_TRACKED_VERIFICATION_SESSIONS) return;
|
|
@@ -916,6 +882,13 @@ var MatrixVerificationManager = class {
|
|
|
916
882
|
session.updatedAtMs = resolveDateTimestampMs(Date.now());
|
|
917
883
|
this.emitVerificationSummary(session);
|
|
918
884
|
}
|
|
885
|
+
observeVerificationOperation(session, operation, onError) {
|
|
886
|
+
return operation.then(() => this.touchVerificationSession(session)).catch((err) => {
|
|
887
|
+
onError?.();
|
|
888
|
+
session.error = formatErrorMessage(err);
|
|
889
|
+
this.touchVerificationSession(session);
|
|
890
|
+
});
|
|
891
|
+
}
|
|
919
892
|
clearSasAutoConfirmTimer(session) {
|
|
920
893
|
if (!session.sasAutoConfirmTimer) return;
|
|
921
894
|
clearTimeout(session.sasAutoConfirmTimer);
|
|
@@ -923,12 +896,11 @@ var MatrixVerificationManager = class {
|
|
|
923
896
|
}
|
|
924
897
|
buildVerificationSummary(session) {
|
|
925
898
|
const request = session.request;
|
|
926
|
-
const phase = this.
|
|
899
|
+
const phase = this.readRequestValue(() => request.phase, VerificationPhase.Requested);
|
|
927
900
|
const accepting = this.readRequestValue(() => request.accepting, false);
|
|
928
901
|
const declining = this.readRequestValue(() => request.declining, false);
|
|
929
902
|
const pending = this.readRequestValue(() => request.pending, false);
|
|
930
|
-
const
|
|
931
|
-
const methods = filterStringEntries(methodsRaw);
|
|
903
|
+
const methods = this.readRequestValue(() => request.methods, []).slice();
|
|
932
904
|
const sasCallbacks = session.sasCallbacks ?? session.activeVerifier?.getShowSasCallbacks();
|
|
933
905
|
if (sasCallbacks) session.sasCallbacks = sasCallbacks;
|
|
934
906
|
const canAccept = phase < VerificationPhase.Ready && !accepting && !declining;
|
|
@@ -975,8 +947,7 @@ var MatrixVerificationManager = class {
|
|
|
975
947
|
session.request.on(VerificationRequestEvent.Change, () => {
|
|
976
948
|
this.touchVerificationSession(session);
|
|
977
949
|
this.maybeAutoAcceptInboundRequest(session);
|
|
978
|
-
|
|
979
|
-
if (verifier) this.attachVerifierToVerificationSession(session, verifier);
|
|
950
|
+
this.attachRequestVerifier(session);
|
|
980
951
|
this.maybeAutoStartInboundSas(session);
|
|
981
952
|
});
|
|
982
953
|
}
|
|
@@ -985,28 +956,23 @@ var MatrixVerificationManager = class {
|
|
|
985
956
|
const request = session.request;
|
|
986
957
|
const isSelfVerification = this.readRequestValue(() => request.isSelfVerification, false);
|
|
987
958
|
const initiatedByMe = this.readRequestValue(() => request.initiatedByMe, false);
|
|
988
|
-
const phase = this.
|
|
959
|
+
const phase = this.readRequestValue(() => request.phase, VerificationPhase.Requested);
|
|
989
960
|
const accepting = this.readRequestValue(() => request.accepting, false);
|
|
990
961
|
const declining = this.readRequestValue(() => request.declining, false);
|
|
991
962
|
if (isSelfVerification || initiatedByMe) return;
|
|
992
963
|
if (phase !== VerificationPhase.Requested || accepting || declining) return;
|
|
993
964
|
session.acceptRequested = true;
|
|
994
|
-
request.accept()
|
|
995
|
-
this.touchVerificationSession(session);
|
|
996
|
-
}).catch((err) => {
|
|
965
|
+
this.observeVerificationOperation(session, request.accept(), () => {
|
|
997
966
|
session.acceptRequested = false;
|
|
998
|
-
session.error = formatErrorMessage(err);
|
|
999
|
-
this.touchVerificationSession(session);
|
|
1000
967
|
});
|
|
1001
968
|
}
|
|
1002
969
|
maybeAutoStartInboundSas(session) {
|
|
1003
970
|
if (session.activeVerifier || session.verifyStarted || session.startRequested) return;
|
|
1004
971
|
if (this.readRequestValue(() => session.request.initiatedByMe, true)) return;
|
|
1005
972
|
if (!this.readRequestValue(() => session.request.isSelfVerification, false)) return;
|
|
1006
|
-
const phase = this.
|
|
973
|
+
const phase = this.readRequestValue(() => session.request.phase, VerificationPhase.Requested);
|
|
1007
974
|
if (phase < VerificationPhase.Ready || phase >= VerificationPhase.Cancelled) return;
|
|
1008
|
-
const
|
|
1009
|
-
const methods = filterStringEntries(methodsRaw);
|
|
975
|
+
const methods = this.readRequestValue(() => session.request.methods, []);
|
|
1010
976
|
const chosenMethod = this.readRequestValue(() => session.request.chosenMethod, null);
|
|
1011
977
|
if (!(methods.includes(VerificationMethod.Sas) || chosenMethod === VerificationMethod.Sas)) return;
|
|
1012
978
|
session.startRequested = true;
|
|
@@ -1017,6 +983,10 @@ var MatrixVerificationManager = class {
|
|
|
1017
983
|
session.startRequested = false;
|
|
1018
984
|
});
|
|
1019
985
|
}
|
|
986
|
+
attachRequestVerifier(session, request = session.request) {
|
|
987
|
+
const verifier = this.readRequestValue(() => request.verifier, null);
|
|
988
|
+
if (verifier) this.attachVerifierToVerificationSession(session, verifier);
|
|
989
|
+
}
|
|
1020
990
|
attachVerifierToVerificationSession(session, verifier) {
|
|
1021
991
|
session.activeVerifier = verifier;
|
|
1022
992
|
this.touchVerificationSession(session);
|
|
@@ -1057,14 +1027,9 @@ var MatrixVerificationManager = class {
|
|
|
1057
1027
|
session.sasCallbacks = callbacks;
|
|
1058
1028
|
session.sasAutoConfirmTimer = setTimeout(() => {
|
|
1059
1029
|
session.sasAutoConfirmTimer = void 0;
|
|
1060
|
-
if (this.
|
|
1030
|
+
if (this.readRequestValue(() => session.request.phase, VerificationPhase.Requested) >= VerificationPhase.Cancelled) return;
|
|
1061
1031
|
session.sasAutoConfirmStarted = true;
|
|
1062
|
-
this.confirmSasForSession(session, callbacks)
|
|
1063
|
-
this.touchVerificationSession(session);
|
|
1064
|
-
}).catch((err) => {
|
|
1065
|
-
session.error = formatErrorMessage(err);
|
|
1066
|
-
this.touchVerificationSession(session);
|
|
1067
|
-
});
|
|
1032
|
+
this.observeVerificationOperation(session, this.confirmSasForSession(session, callbacks));
|
|
1068
1033
|
}, SAS_AUTO_CONFIRM_DELAY_MS);
|
|
1069
1034
|
}
|
|
1070
1035
|
async confirmSasForSession(session, callbacks) {
|
|
@@ -1074,12 +1039,7 @@ var MatrixVerificationManager = class {
|
|
|
1074
1039
|
ensureVerificationStarted(session) {
|
|
1075
1040
|
if (!session.activeVerifier || session.verifyStarted) return;
|
|
1076
1041
|
session.verifyStarted = true;
|
|
1077
|
-
session.verifyPromise = session.activeVerifier.verify()
|
|
1078
|
-
this.touchVerificationSession(session);
|
|
1079
|
-
}).catch((err) => {
|
|
1080
|
-
session.error = formatErrorMessage(err);
|
|
1081
|
-
this.touchVerificationSession(session);
|
|
1082
|
-
});
|
|
1042
|
+
session.verifyPromise = this.observeVerificationOperation(session, session.activeVerifier.verify());
|
|
1083
1043
|
}
|
|
1084
1044
|
async trustOwnDeviceAfterConfirmedSas(session) {
|
|
1085
1045
|
if (!this.readRequestValue(() => session.request.isSelfVerification, false)) return;
|
|
@@ -1098,8 +1058,7 @@ var MatrixVerificationManager = class {
|
|
|
1098
1058
|
for (const existing of this.verificationSessions.values()) if (this.isSameLogicalVerificationRequest(existing.request, request)) {
|
|
1099
1059
|
existing.request = request;
|
|
1100
1060
|
this.ensureVerificationRequestTracked(existing);
|
|
1101
|
-
|
|
1102
|
-
if (verifier) this.attachVerifierToVerificationSession(existing, verifier);
|
|
1061
|
+
this.attachRequestVerifier(existing, request);
|
|
1103
1062
|
this.touchVerificationSession(existing);
|
|
1104
1063
|
return this.buildVerificationSummary(existing);
|
|
1105
1064
|
}
|
|
@@ -1118,8 +1077,7 @@ var MatrixVerificationManager = class {
|
|
|
1118
1077
|
this.verificationSessions.set(session.id, session);
|
|
1119
1078
|
this.ensureVerificationRequestTracked(session);
|
|
1120
1079
|
this.maybeAutoAcceptInboundRequest(session);
|
|
1121
|
-
|
|
1122
|
-
if (verifier) this.attachVerifierToVerificationSession(session, verifier);
|
|
1080
|
+
this.attachRequestVerifier(session, request);
|
|
1123
1081
|
this.maybeAutoStartInboundSas(session);
|
|
1124
1082
|
this.emitVerificationSummary(session);
|
|
1125
1083
|
return this.buildVerificationSummary(session);
|
|
@@ -1132,10 +1090,9 @@ var MatrixVerificationManager = class {
|
|
|
1132
1090
|
if (!crypto) throw new Error("Matrix crypto is not available");
|
|
1133
1091
|
let request;
|
|
1134
1092
|
if (params.ownUser) request = await crypto.requestOwnUserVerification();
|
|
1135
|
-
else if (params.userId && params.deviceId
|
|
1136
|
-
else if (params.userId && params.roomId
|
|
1093
|
+
else if (params.userId && params.deviceId) request = await crypto.requestDeviceVerification(params.userId, params.deviceId);
|
|
1094
|
+
else if (params.userId && params.roomId) request = await crypto.requestVerificationDM(params.userId, params.roomId);
|
|
1137
1095
|
else throw new Error("Matrix verification request requires one of: ownUser, userId+deviceId, or userId+roomId");
|
|
1138
|
-
if (!request) throw new Error("Matrix verification request could not be created");
|
|
1139
1096
|
return this.trackVerificationRequest(request);
|
|
1140
1097
|
}
|
|
1141
1098
|
async acceptVerification(id) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import path from "node:path";
|
|
3
2
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
3
|
+
import path from "node:path";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import { runCommandWithTimeout } from "openclaw/plugin-sdk/process-runtime";
|
|
6
6
|
//#region extensions/matrix/src/matrix/deps.ts
|
|
@@ -41,71 +41,57 @@ function isMuslRuntime() {
|
|
|
41
41
|
}
|
|
42
42
|
function resolveMatrixCryptoNativeBindingFilename() {
|
|
43
43
|
switch (process.platform) {
|
|
44
|
-
case "darwin": return
|
|
44
|
+
case "darwin": return ["arm64", "x64"].includes(process.arch) ? `matrix-sdk-crypto.darwin-${process.arch}.node` : null;
|
|
45
45
|
case "linux":
|
|
46
|
-
if (process.arch === "x64") return
|
|
46
|
+
if (process.arch === "x64") return `matrix-sdk-crypto.linux-x64-${isMuslRuntime() ? "musl" : "gnu"}.node`;
|
|
47
47
|
if (process.arch === "arm64" && !isMuslRuntime()) return "matrix-sdk-crypto.linux-arm64-gnu.node";
|
|
48
48
|
if (process.arch === "arm") return "matrix-sdk-crypto.linux-arm-gnueabihf.node";
|
|
49
49
|
if (process.arch === "s390x") return "matrix-sdk-crypto.linux-s390x-gnu.node";
|
|
50
50
|
return null;
|
|
51
|
-
case "win32": return
|
|
51
|
+
case "win32": return [
|
|
52
|
+
"x64",
|
|
53
|
+
"ia32",
|
|
54
|
+
"arm64"
|
|
55
|
+
].includes(process.arch) ? `matrix-sdk-crypto.win32-${process.arch}-msvc.node` : null;
|
|
52
56
|
default: return null;
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
|
-
function resolveMatrixCryptoNativeBindingPath(
|
|
59
|
+
function resolveMatrixCryptoNativeBindingPath() {
|
|
56
60
|
const filename = resolveMatrixCryptoNativeBindingFilename();
|
|
57
61
|
if (!filename) return null;
|
|
58
62
|
try {
|
|
59
|
-
return path.join(path.dirname(
|
|
63
|
+
return path.join(path.dirname(defaultResolveFn("@matrix-org/matrix-sdk-crypto-nodejs/download-lib.js")), filename);
|
|
60
64
|
} catch {
|
|
61
65
|
return null;
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
|
-
function removeIncompleteMatrixCryptoNativeBinding(
|
|
65
|
-
const bindingPath = params.bindingPath;
|
|
68
|
+
function removeIncompleteMatrixCryptoNativeBinding(bindingPath) {
|
|
66
69
|
if (!bindingPath) return;
|
|
67
70
|
try {
|
|
68
71
|
const stat = fs.statSync(bindingPath);
|
|
69
72
|
if (!stat.isFile() || stat.size >= MIN_MATRIX_CRYPTO_NATIVE_BINDING_BYTES) return;
|
|
70
73
|
fs.unlinkSync(bindingPath);
|
|
71
|
-
params.log?.(`matrix: removed incomplete native crypto runtime (${stat.size} bytes); it will be downloaded again`);
|
|
72
74
|
} catch (error) {
|
|
73
75
|
if (error.code !== "ENOENT") throw error;
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
|
-
async function ensureMatrixCryptoRuntime(
|
|
77
|
-
|
|
78
|
-
if (usesDefaultRuntime && defaultMatrixCryptoRuntimeEnsurePromise) {
|
|
79
|
-
await defaultMatrixCryptoRuntimeEnsurePromise;
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const ensurePromise = ensureMatrixCryptoRuntimeOnce(params);
|
|
83
|
-
if (!usesDefaultRuntime) {
|
|
84
|
-
await ensurePromise;
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
defaultMatrixCryptoRuntimeEnsurePromise = ensurePromise.catch((error) => {
|
|
78
|
+
async function ensureMatrixCryptoRuntime() {
|
|
79
|
+
defaultMatrixCryptoRuntimeEnsurePromise ??= ensureMatrixCryptoRuntimeOnce().catch((error) => {
|
|
88
80
|
defaultMatrixCryptoRuntimeEnsurePromise = null;
|
|
89
81
|
throw error;
|
|
90
82
|
});
|
|
91
83
|
await defaultMatrixCryptoRuntimeEnsurePromise;
|
|
92
84
|
}
|
|
93
|
-
async function ensureMatrixCryptoRuntimeOnce(
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
removeIncompleteMatrixCryptoNativeBinding({
|
|
97
|
-
bindingPath: nativeBindingPath,
|
|
98
|
-
log: params.log
|
|
99
|
-
});
|
|
100
|
-
const requireFn = params.requireFn ?? defaultRequireFn;
|
|
85
|
+
async function ensureMatrixCryptoRuntimeOnce() {
|
|
86
|
+
const nativeBindingPath = resolveMatrixCryptoNativeBindingPath();
|
|
87
|
+
removeIncompleteMatrixCryptoNativeBinding(nativeBindingPath);
|
|
101
88
|
try {
|
|
102
|
-
|
|
89
|
+
defaultRequireFn("@matrix-org/matrix-sdk-crypto-nodejs");
|
|
103
90
|
return;
|
|
104
91
|
} catch (err) {
|
|
105
92
|
if (!isMissingMatrixCryptoRuntimeError(err)) throw err;
|
|
106
93
|
}
|
|
107
|
-
const scriptPath =
|
|
108
|
-
params.log?.("matrix: bootstrapping native crypto runtime");
|
|
94
|
+
const scriptPath = defaultResolveFn("@matrix-org/matrix-sdk-crypto-nodejs/download-lib.js");
|
|
109
95
|
let failure;
|
|
110
96
|
try {
|
|
111
97
|
const result = await runCommandWithTimeout([process.execPath, scriptPath], {
|
|
@@ -121,12 +107,9 @@ async function ensureMatrixCryptoRuntimeOnce(params) {
|
|
|
121
107
|
} catch (error) {
|
|
122
108
|
failure = (error instanceof Error ? error.message : String(error)).trim();
|
|
123
109
|
}
|
|
124
|
-
removeIncompleteMatrixCryptoNativeBinding(
|
|
125
|
-
bindingPath: nativeBindingPath,
|
|
126
|
-
log: params.log
|
|
127
|
-
});
|
|
110
|
+
removeIncompleteMatrixCryptoNativeBinding(nativeBindingPath);
|
|
128
111
|
if (failure !== void 0) throw new Error(failure || "Matrix crypto runtime bootstrap failed.");
|
|
129
|
-
|
|
112
|
+
defaultRequireFn("@matrix-org/matrix-sdk-crypto-nodejs");
|
|
130
113
|
}
|
|
131
114
|
async function ensureMatrixSdkInstalled(params) {
|
|
132
115
|
const missing = resolveMissingMatrixPackages(params?.resolveFn);
|