@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,30 +1,30 @@
|
|
|
1
1
|
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
2
|
import { a as resolveMatrixAccountConfig, i as resolveMatrixAccountAllowlistConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRoute, n as resolveMatrixStoredSessionMeta, o as resolveMatrixRoomConfig } from "./channel-
|
|
5
|
-
import { a as resolveMatrixAllowListMatch, i as normalizeMatrixUserId, r as normalizeMatrixAllowList } from "./channel.setup-
|
|
6
|
-
import { n as isMatrixRoomId, t as
|
|
3
|
+
import { h as resolveConfiguredMatrixBotUserIds } from "./setup-core-CKnNTfgD.mjs";
|
|
4
|
+
import { a as resolveMatrixThreadRouting, i as resolveMatrixInboundRoute, n as resolveMatrixStoredSessionMeta, o as resolveMatrixRoomConfig } from "./channel-BcwGspPw.mjs";
|
|
5
|
+
import { a as resolveMatrixAllowListMatch, i as normalizeMatrixUserId, r as normalizeMatrixAllowList } from "./channel.setup-CwuYD_CT.mjs";
|
|
6
|
+
import { n as isMatrixQualifiedUserId, r as isMatrixRoomId, t as isMatrixInviteAutoJoinTarget } from "./target-ids-HhcaKX1n.mjs";
|
|
7
7
|
import { a as MATRIX_REACTION_EVENT_TYPE } from "./send-currentness-C2rMVVIQ.mjs";
|
|
8
|
-
import { c as isStrictDirectMembership, f as resolveMatrixReplyToEventId, h as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, i as promoteMatrixDirectRoomCandidate, p as resolveMatrixThreadRootId, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers, v as RelationType } from "./direct-management-
|
|
9
|
-
import { _ as isPollEventType, c as formatMatrixMessageText, d as resolveMatrixReplacementContent, h as formatPollAsText, l as isLikelyBareFilename, r as sendMessageMatrix, v as isPollStartType, w as setBoundedMap, y as parsePollStart } from "./send-
|
|
10
|
-
import { t as createMatrixThreadBindingManager } from "./thread-bindings-
|
|
11
|
-
import { i as readMatrixMessages, u as fetchMatrixPollSnapshot } from "./messages-
|
|
12
|
-
import { a as isMatrixStartupAbortError, c as getMatrixMonitorTaskSignal, d as resolveMatrixAuthContext, l as backfillMatrixAuthDeviceIdAfterStartup, n as acquireSharedMatrixClient, o as throwIfMatrixStartupAborted, s as createMatrixMonitorTaskRunner, u as resolveMatrixAuth } from "./client-
|
|
13
|
-
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-
|
|
14
|
-
import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-
|
|
15
|
-
import { t as resolveMatrixTargets } from "./resolve-targets-
|
|
16
|
-
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-
|
|
8
|
+
import { c as isStrictDirectMembership, f as resolveMatrixReplyToEventId, h as MATRIX_OPENCLAW_FINALIZED_PREVIEW_KEY, i as promoteMatrixDirectRoomCandidate, p as resolveMatrixThreadRootId, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers, v as RelationType } from "./direct-management-B3wYhx_M.mjs";
|
|
9
|
+
import { _ as isPollEventType, c as formatMatrixMessageText, d as resolveMatrixReplacementContent, h as formatPollAsText, l as isLikelyBareFilename, r as sendMessageMatrix, u as resolveMatrixMessageAttachment, v as isPollStartType, w as setBoundedMap, y as parsePollStart } from "./send-LCOuTVc1.mjs";
|
|
10
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-CT4P-OSZ.mjs";
|
|
11
|
+
import { i as readMatrixMessages, u as fetchMatrixPollSnapshot } from "./messages-B1CZqU8u.mjs";
|
|
12
|
+
import { a as isMatrixStartupAbortError, c as getMatrixMonitorTaskSignal, d as resolveMatrixAuthContext, l as backfillMatrixAuthDeviceIdAfterStartup, n as acquireSharedMatrixClient, o as throwIfMatrixStartupAborted, s as createMatrixMonitorTaskRunner, u as resolveMatrixAuth } from "./client-vPPbaxNp.mjs";
|
|
13
|
+
import { i as isMatrixMediaSizeLimitError, r as MatrixMediaSizeLimitError } from "./http-client-ByR4STVQ.mjs";
|
|
14
|
+
import { n as prepareMatrixReplyPayload, r as resolveMatrixExtraContent } from "./outbound-LR3SqPIq.mjs";
|
|
15
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-BVVbbvP6.mjs";
|
|
16
|
+
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-D5_IsDIy.mjs";
|
|
17
17
|
import { createMatrixInboundEventDeduper } from "./inbound-dedupe-C-EBGY0B.mjs";
|
|
18
|
-
import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-
|
|
19
|
-
import { r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-
|
|
18
|
+
import { a as isMatrixAccessTokenInvalidatedError, d as isMatrixDisconnectedSyncState, f as isMatrixReadySyncState, p as isMatrixTerminalSyncState } from "./client-support-D-xHScuo.mjs";
|
|
19
|
+
import { r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-9Uqlpt1V.mjs";
|
|
20
20
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
21
|
-
import { createChannelProgressDraftCompositor, createLivePreviewLifecycle, createPreviewMessageReceipt, createReplyPrefixOptions, createTypingCallbacks, logTypingFailure, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
21
|
+
import { createChannelDeliveryAccumulator, createChannelProgressDraftCompositor, createLivePreviewLifecycle, createPreviewMessageReceipt, createReplyPrefixOptions, createTypingCallbacks, logTypingFailure, resolveChannelStreamingBlockEnabled, waitUntilAbort } from "openclaw/plugin-sdk/channel-outbound";
|
|
22
|
+
import { extractErrorCode, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
22
23
|
import { normalizeLowercaseStringOrEmpty, normalizeNullableString, normalizeOptionalString, normalizeStringifiedEntries, normalizeUniqueTrimmedStringList, readStringValue, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
23
24
|
import { stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
24
25
|
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
25
26
|
import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, canonicalizeAllowlistWithResolvedIds, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
|
|
26
27
|
import { normalizeStringEntries as normalizeStringEntries$1 } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
27
|
-
import { extractErrorCode, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
28
28
|
import { isFutureDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, resolveOptionalIntegerOption, resolvePromptHistoryLimit } from "openclaw/plugin-sdk/number-runtime";
|
|
29
29
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
30
30
|
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
@@ -40,7 +40,7 @@ import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-na
|
|
|
40
40
|
import { reportChannelRoomJoin } from "openclaw/plugin-sdk/channel-join-intro-runtime";
|
|
41
41
|
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
42
42
|
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
43
|
-
import { createAcceptedChannelDeliveryResult,
|
|
43
|
+
import { createAcceptedChannelDeliveryResult, createChannelInboundEnvelopeBuilderAsync, createChannelPartialDeliveryError, formatLocationText, hasFinalInboundReplyDispatch, isChannelPartialDeliveryError, logInboundDrop, resolveInboundMentionDecision, resolveInboundReplyDispatchCounts, toInboundMediaFactsWithMetadata, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
|
|
44
44
|
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-local-roots";
|
|
45
45
|
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
46
46
|
import { evaluateSupplementalContextVisibility, resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
@@ -66,7 +66,11 @@ function registerMatrixAutoJoin(params) {
|
|
|
66
66
|
const resolvedAliasRoomIds = /* @__PURE__ */ new Map();
|
|
67
67
|
if (autoJoin === "off") return () => {};
|
|
68
68
|
if (autoJoin === "always") logVerbose("matrix: auto-join enabled for all invites");
|
|
69
|
-
else
|
|
69
|
+
else {
|
|
70
|
+
logVerbose("matrix: auto-join enabled for allowlist invites");
|
|
71
|
+
const inertEntries = rawAllowlist.filter((entry) => !isMatrixInviteAutoJoinTarget(entry));
|
|
72
|
+
if (inertEntries.length > 0) core.logging.getChildLogger({ module: "matrix-auto-join" }).warn(`matrix: autoJoinAllowlist entries cannot match an invited room and are ignored: ${inertEntries.join(", ")}`);
|
|
73
|
+
}
|
|
70
74
|
const resolveAllowedAliasRoomId = async (alias) => {
|
|
71
75
|
if (resolvedAliasRoomIds.has(alias)) return resolvedAliasRoomIds.get(alias) ?? null;
|
|
72
76
|
const resolved = await params.client.resolveRoom(alias);
|
|
@@ -113,17 +117,12 @@ function normalizeMatrixUserLookupEntry(raw) {
|
|
|
113
117
|
function normalizeMatrixRoomLookupEntry(raw) {
|
|
114
118
|
return raw.replace(/^matrix:/i, "").replace(/^(room|channel):/i, "").trim();
|
|
115
119
|
}
|
|
116
|
-
function
|
|
120
|
+
function filterMatrixAllowlistEntries(entries, failClosedOnUnresolved = false) {
|
|
117
121
|
return entries.filter((entry) => {
|
|
118
122
|
const trimmed = entry.trim();
|
|
119
|
-
|
|
120
|
-
if (trimmed === "*") return true;
|
|
121
|
-
return isMatrixQualifiedUserId(normalizeMatrixUserLookupEntry(trimmed));
|
|
123
|
+
return Boolean(trimmed) && (failClosedOnUnresolved || trimmed === "*" || isMatrixQualifiedUserId(normalizeMatrixUserLookupEntry(trimmed)));
|
|
122
124
|
});
|
|
123
125
|
}
|
|
124
|
-
function filterFailClosedMatrixAllowlistEntries(entries) {
|
|
125
|
-
return entries.filter((entry) => entry.trim().length > 0);
|
|
126
|
-
}
|
|
127
126
|
function listResolvedMatrixAllowlistEntries(params) {
|
|
128
127
|
const resolvedEntries = [];
|
|
129
128
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -224,7 +223,7 @@ async function resolveMatrixMonitorUserAllowlist(params) {
|
|
|
224
223
|
runtime: params.runtime
|
|
225
224
|
});
|
|
226
225
|
return {
|
|
227
|
-
entries: params.failClosedOnUnresolved
|
|
226
|
+
entries: filterMatrixAllowlistEntries(canonicalized, params.failClosedOnUnresolved),
|
|
228
227
|
resolvedEntries: listResolvedMatrixAllowlistEntries({
|
|
229
228
|
entries: allowList,
|
|
230
229
|
resolvedMap: resolution.resolvedMap
|
|
@@ -280,12 +279,11 @@ async function resolveMatrixMonitorLiveUserAllowlist(params) {
|
|
|
280
279
|
resolveTargets: params.resolveTargets ?? resolveMatrixTargets,
|
|
281
280
|
allowNameMatching
|
|
282
281
|
});
|
|
283
|
-
const
|
|
282
|
+
const resolvedEntries = filterMatrixAllowlistEntries(canonicalizeAllowlistWithResolvedIds({
|
|
284
283
|
existing: pending,
|
|
285
284
|
resolvedMap: resolution.resolvedMap,
|
|
286
285
|
entryKey: normalizeMatrixUserId
|
|
287
|
-
});
|
|
288
|
-
const resolvedEntries = params.failClosedOnUnresolved ? filterFailClosedMatrixAllowlistEntries(canonicalized) : filterResolvedMatrixAllowlistEntries(canonicalized);
|
|
286
|
+
}), params.failClosedOnUnresolved);
|
|
289
287
|
for (const entry of resolvedEntries) addEntry(entry);
|
|
290
288
|
return effective;
|
|
291
289
|
}
|
|
@@ -474,36 +472,35 @@ function createDirectRoomTracker(client, opts = {}) {
|
|
|
474
472
|
}
|
|
475
473
|
return cached.remoteUserId === normalizedRemoteUserId;
|
|
476
474
|
};
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
475
|
+
const roomPolicies = {
|
|
476
|
+
canPromoteRecentInvite: [
|
|
477
|
+
true,
|
|
478
|
+
false,
|
|
479
|
+
"recent invite promotion veto"
|
|
480
|
+
],
|
|
481
|
+
canPromoteUnmappedStrictRoom: [
|
|
482
|
+
false,
|
|
483
|
+
false,
|
|
484
|
+
"unmapped strict room promotion veto"
|
|
485
|
+
],
|
|
486
|
+
shouldKeepLocallyPromotedDirectRoom: [
|
|
487
|
+
void 0,
|
|
488
|
+
void 0,
|
|
489
|
+
"local promotion keep-check"
|
|
490
|
+
],
|
|
491
|
+
isExplicitlyConfiguredRoom: [
|
|
492
|
+
false,
|
|
493
|
+
true,
|
|
494
|
+
"configured room check"
|
|
495
|
+
]
|
|
500
496
|
};
|
|
501
|
-
const
|
|
497
|
+
const checkRoomPolicy = async (key, roomId) => {
|
|
498
|
+
const [fallback, onError, label] = roomPolicies[key];
|
|
502
499
|
try {
|
|
503
|
-
return await opts
|
|
500
|
+
return await opts[key]?.(roomId) ?? fallback;
|
|
504
501
|
} catch (err) {
|
|
505
|
-
log(`matrix:
|
|
506
|
-
return
|
|
502
|
+
log(`matrix: ${label} failed room=${roomId} (${String(err)})`);
|
|
503
|
+
return onError;
|
|
507
504
|
}
|
|
508
505
|
};
|
|
509
506
|
const hasLocallyPromotedDirectRoom = (roomId, remoteUserId) => {
|
|
@@ -534,7 +531,7 @@ function createDirectRoomTracker(client, opts = {}) {
|
|
|
534
531
|
},
|
|
535
532
|
isDirectMessage: async (params) => {
|
|
536
533
|
const { roomId, senderId } = params;
|
|
537
|
-
if (await isExplicitlyConfiguredRoom
|
|
534
|
+
if (await checkRoomPolicy("isExplicitlyConfiguredRoom", roomId)) {
|
|
538
535
|
log(`matrix: dm rejected via explicit room config room=${roomId}`);
|
|
539
536
|
return false;
|
|
540
537
|
}
|
|
@@ -572,7 +569,7 @@ function createDirectRoomTracker(client, opts = {}) {
|
|
|
572
569
|
return true;
|
|
573
570
|
}
|
|
574
571
|
if (hasLocallyPromotedDirectRoom(roomId, senderId)) {
|
|
575
|
-
if (await shouldKeepLocallyPromotedDirectRoom
|
|
572
|
+
if (await checkRoomPolicy("shouldKeepLocallyPromotedDirectRoom", roomId) !== false) {
|
|
576
573
|
log(`matrix: dm detected via local promotion room=${roomId}`);
|
|
577
574
|
return true;
|
|
578
575
|
}
|
|
@@ -592,8 +589,8 @@ function createDirectRoomTracker(client, opts = {}) {
|
|
|
592
589
|
}
|
|
593
590
|
return promotion.classifyAsDirect;
|
|
594
591
|
};
|
|
595
|
-
if (hasRecentInviteCandidate(roomId, senderId) && await canPromoteRecentInvite
|
|
596
|
-
if (await canPromoteUnmappedStrictRoom
|
|
592
|
+
if (hasRecentInviteCandidate(roomId, senderId) && await checkRoomPolicy("canPromoteRecentInvite", roomId) && await promoteDirectRoom("recent invite")) return true;
|
|
593
|
+
if (await checkRoomPolicy("canPromoteUnmappedStrictRoom", roomId) && await promoteDirectRoom("per-room strict fallback")) return true;
|
|
597
594
|
}
|
|
598
595
|
log(`matrix: dm check room=${roomId} result=group members=${joinedMembers?.length ?? "unknown"}`);
|
|
599
596
|
return false;
|
|
@@ -750,7 +747,7 @@ const matrixVerificationConstants = {
|
|
|
750
747
|
const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
|
|
751
748
|
const SAS_NOTICE_RETRY_DELAY_MS = 750;
|
|
752
749
|
const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
|
|
753
|
-
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-
|
|
750
|
+
const loadMatrixDirectRoomDeps = createLazyRuntimeModule(() => Promise.all([import("./direct-management-B3wYhx_M.mjs").then((n) => n.t), import("./direct-management-B3wYhx_M.mjs").then((n) => n.o)]).then(([directManagementModule, directRoomModule]) => ({
|
|
754
751
|
inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
|
|
755
752
|
isStrictDirectRoom: directRoomModule.isStrictDirectRoom
|
|
756
753
|
})));
|
|
@@ -872,20 +869,17 @@ async function resolveVerificationSummaryForSignal(client, params) {
|
|
|
872
869
|
return activeByUser.find((entry) => normalizeNullableString(entry.roomId) === params.roomId) ?? activeByUser[0] ?? null;
|
|
873
870
|
}
|
|
874
871
|
async function resolveVerificationSasNoticeForSignal(client, params) {
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
summary: retriedSummary,
|
|
887
|
-
sasNotice: retriedSummary && isActiveVerificationSummary(retriedSummary) ? formatVerificationSasNotice(retriedSummary) : null
|
|
888
|
-
};
|
|
872
|
+
for (let attempt = 0;; attempt += 1) {
|
|
873
|
+
const summary = await resolveVerificationSummaryForSignal(client, params);
|
|
874
|
+
const sasNotice = summary && isActiveVerificationSummary(summary) ? formatVerificationSasNotice(summary) : null;
|
|
875
|
+
if (sasNotice || attempt > 0 || params.stage !== "ready" && params.stage !== "start") return {
|
|
876
|
+
summary,
|
|
877
|
+
sasNotice
|
|
878
|
+
};
|
|
879
|
+
await new Promise((resolve) => {
|
|
880
|
+
setTimeout(resolve, params.sasNoticeRetryDelayMs ?? SAS_NOTICE_RETRY_DELAY_MS);
|
|
881
|
+
});
|
|
882
|
+
}
|
|
889
883
|
}
|
|
890
884
|
function trackBounded(set, value) {
|
|
891
885
|
if (!value || set.has(value)) return false;
|
|
@@ -934,6 +928,18 @@ function createMatrixVerificationEventRouter(params) {
|
|
|
934
928
|
params.logVerboseMessage(`matrix: blocked verification sender ${senderId} (dmPolicy=${params.dmPolicy})`);
|
|
935
929
|
return false;
|
|
936
930
|
}
|
|
931
|
+
async function canRouteVerificationNotice(roomId, senderId, source) {
|
|
932
|
+
const { isStrictDirectRoom } = await loadMatrixDirectRoomDeps();
|
|
933
|
+
if (!await isStrictDirectRoom({
|
|
934
|
+
client: params.client,
|
|
935
|
+
roomId,
|
|
936
|
+
remoteUserId: senderId
|
|
937
|
+
})) {
|
|
938
|
+
params.logVerboseMessage(`matrix: ignoring verification ${source} outside strict DM room=${roomId} sender=${senderId}`);
|
|
939
|
+
return false;
|
|
940
|
+
}
|
|
941
|
+
return await isVerificationNoticeAuthorized(senderId);
|
|
942
|
+
}
|
|
937
943
|
async function resolveActiveDirectRoomId(remoteUserId) {
|
|
938
944
|
const { inspectMatrixDirectRooms } = await loadMatrixDirectRoomDeps();
|
|
939
945
|
const inspection = await inspectMatrixDirectRooms({
|
|
@@ -978,15 +984,7 @@ function createMatrixVerificationEventRouter(params) {
|
|
|
978
984
|
async function routeVerificationSummary(summary) {
|
|
979
985
|
const roomId = await resolveSummaryRoomId(summary);
|
|
980
986
|
if (!roomId || !isActiveVerificationSummary(summary)) return;
|
|
981
|
-
if (!await (
|
|
982
|
-
client: params.client,
|
|
983
|
-
roomId,
|
|
984
|
-
remoteUserId: summary.otherUserId
|
|
985
|
-
})) {
|
|
986
|
-
params.logVerboseMessage(`matrix: ignoring verification summary outside strict DM room=${roomId} sender=${summary.otherUserId}`);
|
|
987
|
-
return;
|
|
988
|
-
}
|
|
989
|
-
if (!await isVerificationNoticeAuthorized(summary.otherUserId)) return;
|
|
987
|
+
if (!await canRouteVerificationNotice(roomId, summary.otherUserId, "summary")) return;
|
|
990
988
|
const sasNotice = formatVerificationSasNotice(summary);
|
|
991
989
|
if (!sasNotice) return;
|
|
992
990
|
const sasFingerprint = `${summary.id}:${JSON.stringify(summary.sas)}`;
|
|
@@ -1006,15 +1004,7 @@ function createMatrixVerificationEventRouter(params) {
|
|
|
1006
1004
|
}
|
|
1007
1005
|
const flowId = signal.flowId;
|
|
1008
1006
|
const sourceFingerprint = normalizeNullableString(event?.event_id) ?? `${senderId}:${event.type}:${flowId ?? "none"}`;
|
|
1009
|
-
if (!await (
|
|
1010
|
-
client: params.client,
|
|
1011
|
-
roomId,
|
|
1012
|
-
remoteUserId: senderId
|
|
1013
|
-
})) {
|
|
1014
|
-
params.logVerboseMessage(`matrix: ignoring verification event outside strict DM room=${roomId} sender=${senderId}`);
|
|
1015
|
-
return;
|
|
1016
|
-
}
|
|
1017
|
-
if (!await isVerificationNoticeAuthorized(senderId)) return;
|
|
1007
|
+
if (!await canRouteVerificationNotice(roomId, senderId, "event")) return;
|
|
1018
1008
|
rememberVerificationUserRoom(senderId, roomId);
|
|
1019
1009
|
if (!trackBounded(routedVerificationEvents, sourceFingerprint)) return;
|
|
1020
1010
|
const stageNotice = formatVerificationStageNotice({
|
|
@@ -1064,11 +1054,11 @@ function formatMatrixPostHealthySyncDecryptionHint(accountId) {
|
|
|
1064
1054
|
return `matrix: repeated fresh encrypted messages are still failing to decrypt after Matrix resumed healthy sync. This device may still be missing new room keys. Check 'openclaw matrix verify status --verbose --account ${accountId}' and 'openclaw matrix devices list --account ${accountId}'.`;
|
|
1065
1055
|
}
|
|
1066
1056
|
function isFreshPostHealthySyncDecryptFailure(params) {
|
|
1067
|
-
const { event, healthySyncSinceMs,
|
|
1057
|
+
const { event, healthySyncSinceMs, nowMs } = params;
|
|
1068
1058
|
if (typeof healthySyncSinceMs !== "number" || !Number.isFinite(healthySyncSinceMs)) return false;
|
|
1069
1059
|
const eventTs = event.origin_server_ts;
|
|
1070
1060
|
if (!Number.isFinite(eventTs) || eventTs <= 0) return false;
|
|
1071
|
-
if (eventTs < healthySyncSinceMs
|
|
1061
|
+
if (eventTs < healthySyncSinceMs) return false;
|
|
1072
1062
|
if (eventTs > nowMs + 6e4) return false;
|
|
1073
1063
|
return true;
|
|
1074
1064
|
}
|
|
@@ -1094,7 +1084,6 @@ function createMatrixPostHealthySyncDecryptFailureTracker(params) {
|
|
|
1094
1084
|
if (!isFreshPostHealthySyncDecryptFailure({
|
|
1095
1085
|
event,
|
|
1096
1086
|
healthySyncSinceMs,
|
|
1097
|
-
graceMs: params.startupGraceMs,
|
|
1098
1087
|
nowMs
|
|
1099
1088
|
})) return {
|
|
1100
1089
|
freshAfterHealthySync: false,
|
|
@@ -1116,18 +1105,18 @@ function createMatrixPostHealthySyncDecryptFailureTracker(params) {
|
|
|
1116
1105
|
failureCount
|
|
1117
1106
|
};
|
|
1118
1107
|
warningEmitted = true;
|
|
1119
|
-
const rooms = uniqueStrings(observations.map((entry) => entry.roomId))
|
|
1120
|
-
const senders = uniqueStrings(observations.map((entry) => entry.sender).filter((sender) => Boolean(sender)))
|
|
1108
|
+
const rooms = uniqueStrings(observations.map((entry) => entry.roomId));
|
|
1109
|
+
const senders = uniqueStrings(observations.map((entry) => entry.sender).filter((sender) => Boolean(sender)));
|
|
1121
1110
|
const eventIds = observations.slice(-3).map((entry) => entry.eventId);
|
|
1122
1111
|
const latestError = observations.at(-1)?.error ?? error.message;
|
|
1123
1112
|
return {
|
|
1124
1113
|
freshAfterHealthySync: true,
|
|
1125
1114
|
failureCount,
|
|
1126
1115
|
warning: {
|
|
1127
|
-
rooms,
|
|
1128
|
-
roomCount:
|
|
1129
|
-
senders,
|
|
1130
|
-
senderCount:
|
|
1116
|
+
rooms: rooms.slice(0, MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_SAMPLE_LIMIT),
|
|
1117
|
+
roomCount: rooms.length,
|
|
1118
|
+
senders: senders.slice(0, MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_SAMPLE_LIMIT),
|
|
1119
|
+
senderCount: senders.length,
|
|
1131
1120
|
eventIds,
|
|
1132
1121
|
latestError,
|
|
1133
1122
|
windowMs: MATRIX_POST_HEALTHY_SYNC_DECRYPT_FAILURE_WINDOW_MS
|
|
@@ -1148,11 +1137,8 @@ async function resolveMatrixSelfUserId(client, logVerboseMessage) {
|
|
|
1148
1137
|
}
|
|
1149
1138
|
}
|
|
1150
1139
|
function registerMatrixMonitorEvents(params) {
|
|
1151
|
-
const { cfg, client, auth, allowFrom, dmEnabled, dmPolicy, readStoreAllowFrom, directTracker, invalidateMemberDisplayName, logVerboseMessage, warnedEncryptedRooms, warnedCryptoMissingRooms, logger,
|
|
1152
|
-
const postHealthySyncDecryptFailureTracker = createMatrixPostHealthySyncDecryptFailureTracker({
|
|
1153
|
-
getHealthySyncSinceMs,
|
|
1154
|
-
startupGraceMs
|
|
1155
|
-
});
|
|
1140
|
+
const { cfg, client, auth, allowFrom, dmEnabled, dmPolicy, readStoreAllowFrom, directTracker, invalidateMemberDisplayName, logVerboseMessage, warnedEncryptedRooms, warnedCryptoMissingRooms, logger, getHealthySyncSinceMs, formatNativeDependencyHint, onRoomMessage, runDetachedTask, sasNoticeRetryDelayMs } = params;
|
|
1141
|
+
const postHealthySyncDecryptFailureTracker = createMatrixPostHealthySyncDecryptFailureTracker({ getHealthySyncSinceMs });
|
|
1156
1142
|
const { routeVerificationEvent, routeVerificationSummary } = createMatrixVerificationEventRouter({
|
|
1157
1143
|
client,
|
|
1158
1144
|
allowFrom,
|
|
@@ -1169,12 +1155,15 @@ function registerMatrixMonitorEvents(params) {
|
|
|
1169
1155
|
logVerboseMessage(`matrix: ${label} failed (${String(error)})`);
|
|
1170
1156
|
});
|
|
1171
1157
|
};
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
runMonitorTask(`room message handler room=${roomId} id=${event.event_id ?? "unknown"}`, async () => {
|
|
1158
|
+
const dispatchRoomMessage = (label, roomId, event) => {
|
|
1159
|
+
runMonitorTask(`${label} room=${roomId} id=${event.event_id ?? "unknown"}`, async () => {
|
|
1175
1160
|
await onRoomMessage(roomId, event);
|
|
1176
1161
|
});
|
|
1177
1162
|
};
|
|
1163
|
+
const onRoomMessageEvent = (roomId, event) => {
|
|
1164
|
+
if (routeVerificationEvent(roomId, event)) return;
|
|
1165
|
+
dispatchRoomMessage("room message handler", roomId, event);
|
|
1166
|
+
};
|
|
1178
1167
|
const onEncryptedEvent = (roomId, event) => {
|
|
1179
1168
|
const eventId = event?.event_id ?? "unknown";
|
|
1180
1169
|
const eventType = event?.type ?? "unknown";
|
|
@@ -1186,9 +1175,7 @@ function registerMatrixMonitorEvents(params) {
|
|
|
1186
1175
|
logVerboseMessage(`matrix: decrypted event room=${roomId} type=${eventType} id=${eventId}`);
|
|
1187
1176
|
if (routeVerificationEvent(roomId, event)) return;
|
|
1188
1177
|
if (eventType !== EventType.RoomMessage) return;
|
|
1189
|
-
|
|
1190
|
-
await onRoomMessage(roomId, event);
|
|
1191
|
-
});
|
|
1178
|
+
dispatchRoomMessage("decrypted room message handler", roomId, event);
|
|
1192
1179
|
};
|
|
1193
1180
|
const onFailedDecryption = (roomId, event, error) => {
|
|
1194
1181
|
runMonitorTask(`failed decryption handler room=${roomId} id=${event.event_id ?? "unknown"}`, async () => {
|
|
@@ -1335,9 +1322,7 @@ function registerMatrixMonitorEvents(params) {
|
|
|
1335
1322
|
logVerboseMessage(`matrix: member event room=${roomId} stateKey=${stateKey} membership=${membership ?? "unknown"}`);
|
|
1336
1323
|
}
|
|
1337
1324
|
if (eventType === EventType.Reaction) {
|
|
1338
|
-
|
|
1339
|
-
await onRoomMessage(roomId, event);
|
|
1340
|
-
});
|
|
1325
|
+
dispatchRoomMessage("reaction handler", roomId, event);
|
|
1341
1326
|
return;
|
|
1342
1327
|
}
|
|
1343
1328
|
routeVerificationEvent(roomId, event);
|
|
@@ -1496,7 +1481,17 @@ function hasBundledMatrixReplacementRelation(event) {
|
|
|
1496
1481
|
return relations[RelationType.Replace] !== void 0;
|
|
1497
1482
|
}
|
|
1498
1483
|
function resolveMatrixInboundBodyText(params) {
|
|
1499
|
-
if (params.mediaPlaceholder)
|
|
1484
|
+
if (params.mediaPlaceholder) {
|
|
1485
|
+
if (params.filename?.trim()) {
|
|
1486
|
+
const attachment = resolveMatrixMessageAttachment({
|
|
1487
|
+
body: params.rawBody,
|
|
1488
|
+
filename: params.filename,
|
|
1489
|
+
msgtype: params.msgtype
|
|
1490
|
+
});
|
|
1491
|
+
if (attachment && !attachment.caption) return params.mediaPlaceholder;
|
|
1492
|
+
}
|
|
1493
|
+
return params.rawBody || params.mediaPlaceholder;
|
|
1494
|
+
}
|
|
1500
1495
|
if (!params.mediaDownloadFailed || !params.hadMediaUrl) return params.rawBody;
|
|
1501
1496
|
return formatMatrixMessageText({
|
|
1502
1497
|
body: params.rawBody,
|
|
@@ -1579,11 +1574,11 @@ function formatMatrixToolProgressMarkdownCode(text) {
|
|
|
1579
1574
|
}
|
|
1580
1575
|
//#endregion
|
|
1581
1576
|
//#region extensions/matrix/src/matrix/monitor/handler-runtime.ts
|
|
1582
|
-
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-
|
|
1577
|
+
const loadMatrixSendModule = createLazyRuntimeModule(() => import("./send-LCOuTVc1.mjs").then((n) => n.s));
|
|
1583
1578
|
const loadAcpBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/acp-binding-runtime"));
|
|
1584
1579
|
const loadSessionBindingRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/session-binding-runtime"));
|
|
1585
|
-
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-
|
|
1586
|
-
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-
|
|
1580
|
+
const loadMatrixReactionEvents = createLazyRuntimeModule(() => import("./reaction-events-CTSvOlXO.mjs"));
|
|
1581
|
+
const loadMatrixDraftStream = createLazyRuntimeModule(() => import("./draft-stream-Bdrh7dRt.mjs"));
|
|
1587
1582
|
async function matrixTextWouldActivateMentions(client, text) {
|
|
1588
1583
|
const { resolveMatrixMentionsForBody } = await loadMatrixSendModule();
|
|
1589
1584
|
const mentions = await resolveMatrixMentionsForBody({
|
|
@@ -1596,7 +1591,7 @@ async function matrixTextWouldActivateMentions(client, text) {
|
|
|
1596
1591
|
//#region extensions/matrix/src/matrix/monitor/handler-context.ts
|
|
1597
1592
|
async function resolveMatrixInboundContext(config) {
|
|
1598
1593
|
const { handler, ingress, roomId, event, eventTs, resolveThreadContext, resolveReplyContext, senderId, sharedDmContextNoticeRooms } = config;
|
|
1599
|
-
const { client, core, accountId, runtime, logVerboseMessage, groupPolicy, getRoomInfo, historyLimit, dmSessionScope, resolveStorePath: resolveStorePathImpl,
|
|
1594
|
+
const { client, core, accountId, runtime, logVerboseMessage, groupPolicy, getRoomInfo, historyLimit, dmSessionScope, resolveStorePath: resolveStorePathImpl, createChannelInboundEnvelopeBuilderAsync: createChannelInboundEnvelopeBuilderImpl, finalizeInboundContext } = handler;
|
|
1600
1595
|
const { cfg, resolveMessageIngress, route: _route, isDirectMessage, isRoom, effectiveRoomUsers, effectiveGroupAllowFrom, threadRootId, thread, senderName, bodyText, commandBodyText, roomConfig, messageId, inboundHistory, wasMentioned, effectiveWasMentioned, shouldBypassMention, canDetectMention, shouldRequireMention, commandAuthorized, locationPayload, media, preflightAudioTranscript, hasExplicitSessionBinding } = ingress;
|
|
1601
1596
|
const contextVisibilityMode = resolveChannelContextVisibilityMode({
|
|
1602
1597
|
cfg,
|
|
@@ -1645,7 +1640,7 @@ async function resolveMatrixInboundContext(config) {
|
|
|
1645
1640
|
const envelopeFrom = isDirectMessage ? senderName : roomName ?? roomId;
|
|
1646
1641
|
const textWithId = `${bodyText}\n[matrix event id: ${messageId} room: ${roomId}]`;
|
|
1647
1642
|
const storePath = resolveStorePathImpl(cfg.session?.store, { agentId: _route.agentId });
|
|
1648
|
-
const buildEnvelope = createChannelInboundEnvelopeBuilderImpl({
|
|
1643
|
+
const buildEnvelope = await createChannelInboundEnvelopeBuilderImpl({
|
|
1649
1644
|
cfg,
|
|
1650
1645
|
route: _route
|
|
1651
1646
|
});
|
|
@@ -1815,7 +1810,6 @@ async function createMatrixDraftController(params) {
|
|
|
1815
1810
|
let currentDraftBlockOffset = 0;
|
|
1816
1811
|
let latestDraftFullText = "";
|
|
1817
1812
|
const pendingDraftBoundaries = [];
|
|
1818
|
-
const latestQueuedDraftBoundaryOffsets = /* @__PURE__ */ new Map();
|
|
1819
1813
|
let currentDraftReplyToId = draftReplyToId;
|
|
1820
1814
|
const progressConfigEntry = accountConfig ?? cfg.channels?.matrix;
|
|
1821
1815
|
const progressSeed = `${accountId}:${roomId}`;
|
|
@@ -1874,8 +1868,7 @@ async function createMatrixDraftController(params) {
|
|
|
1874
1868
|
const queueDraftBlockBoundary = (payload, context) => {
|
|
1875
1869
|
const payloadTextLength = payload.text?.length ?? 0;
|
|
1876
1870
|
const messageGeneration = context?.assistantMessageIndex ?? currentDraftMessageGeneration;
|
|
1877
|
-
const nextDraftBoundaryOffset = (
|
|
1878
|
-
latestQueuedDraftBoundaryOffsets.set(messageGeneration, nextDraftBoundaryOffset);
|
|
1871
|
+
const nextDraftBoundaryOffset = (pendingDraftBoundaries.findLast((entry) => entry.messageGeneration === messageGeneration)?.endOffset ?? 0) + payloadTextLength;
|
|
1879
1872
|
pendingDraftBoundaries.push({
|
|
1880
1873
|
messageGeneration,
|
|
1881
1874
|
endOffset: nextDraftBoundaryOffset
|
|
@@ -1884,7 +1877,6 @@ async function createMatrixDraftController(params) {
|
|
|
1884
1877
|
const advanceDraftBlockBoundary = (options) => {
|
|
1885
1878
|
const completedBoundary = pendingDraftBoundaries.shift();
|
|
1886
1879
|
if (completedBoundary) {
|
|
1887
|
-
if (!pendingDraftBoundaries.some((entry) => entry.messageGeneration === completedBoundary.messageGeneration)) latestQueuedDraftBoundaryOffsets.delete(completedBoundary.messageGeneration);
|
|
1888
1880
|
if (completedBoundary.messageGeneration === currentDraftMessageGeneration) currentDraftBlockOffset = completedBoundary.endOffset;
|
|
1889
1881
|
return;
|
|
1890
1882
|
}
|
|
@@ -1903,7 +1895,6 @@ async function createMatrixDraftController(params) {
|
|
|
1903
1895
|
currentDraftBlockOffset = 0;
|
|
1904
1896
|
latestDraftFullText = "";
|
|
1905
1897
|
pendingDraftBoundaries.length = 0;
|
|
1906
|
-
latestQueuedDraftBoundaryOffsets.clear();
|
|
1907
1898
|
currentDraftReplyToId = draftReplyToId;
|
|
1908
1899
|
progressDraft.beginNewTurn({ force: true });
|
|
1909
1900
|
};
|
|
@@ -2512,7 +2503,7 @@ function resolveMentions(params) {
|
|
|
2512
2503
|
async function resolveMatrixIngressContent(config) {
|
|
2513
2504
|
const { handler, params: paramsLocal, access, roomId, event, eventType, isPollEvent, eventTs, senderId, roomHistoryTracker, resolveThreadContext, commitInboundEventIfClaimed } = config;
|
|
2514
2505
|
const { client, core, accountId, accountConfig, logger, logVerboseMessage, historyLimit, mediaMaxBytes, dmSessionScope, getMemberDisplayName } = handler;
|
|
2515
|
-
const { cfg,
|
|
2506
|
+
const { cfg, content: accessContent, messageId, audioPreflightMode, isDirectMessage, isRoom, locationPayload, reservedHistorySlot, threadRootId, thread, historyThreadId, discardReservedHistorySlot, markReservedHistorySlotConsumed, commitInboundEventIfClaimedAndDiscardReserved, roomConfig, allowBotsMode, isConfiguredBotSender, selfUserId, roomMatchMeta, getSenderName, accessState } = access;
|
|
2516
2507
|
const { resolveMessageIngress } = accessState;
|
|
2517
2508
|
let content = accessContent;
|
|
2518
2509
|
let pollSnapshotPromise = null;
|
|
@@ -2779,39 +2770,29 @@ async function resolveMatrixIngressContent(config) {
|
|
|
2779
2770
|
messageId
|
|
2780
2771
|
}, historyThreadId, reservedHistorySlot) : void 0;
|
|
2781
2772
|
if (reservedHistorySlot && preparedTrigger) markReservedHistorySlotConsumed();
|
|
2773
|
+
const inboundHistory = preparedTrigger ? buildInboundHistoryFromEntries({
|
|
2774
|
+
entries: preparedTrigger.history,
|
|
2775
|
+
limit: historyLimit
|
|
2776
|
+
}) : void 0;
|
|
2782
2777
|
return {
|
|
2783
|
-
|
|
2784
|
-
liveDmAllowFrom,
|
|
2778
|
+
...access,
|
|
2785
2779
|
resolveMessageIngress,
|
|
2786
2780
|
route: _route,
|
|
2787
2781
|
hasExplicitSessionBinding,
|
|
2788
|
-
roomConfig,
|
|
2789
|
-
isDirectMessage,
|
|
2790
|
-
isRoom,
|
|
2791
2782
|
shouldRequireMention,
|
|
2792
2783
|
wasMentioned,
|
|
2793
2784
|
effectiveWasMentioned,
|
|
2794
2785
|
shouldBypassMention,
|
|
2795
2786
|
canDetectMention,
|
|
2796
2787
|
commandAuthorized,
|
|
2797
|
-
inboundHistory
|
|
2798
|
-
entries: preparedTrigger.history,
|
|
2799
|
-
limit: historyLimit
|
|
2800
|
-
}) : void 0,
|
|
2788
|
+
inboundHistory,
|
|
2801
2789
|
senderName,
|
|
2802
2790
|
bodyText,
|
|
2803
2791
|
commandBodyText,
|
|
2804
2792
|
media,
|
|
2805
2793
|
preflightAudioTranscript,
|
|
2806
|
-
locationPayload,
|
|
2807
|
-
messageId,
|
|
2808
2794
|
triggerSnapshot: preparedTrigger,
|
|
2809
|
-
|
|
2810
|
-
threadContext,
|
|
2811
|
-
thread,
|
|
2812
|
-
botLoopProtection,
|
|
2813
|
-
effectiveGroupAllowFrom,
|
|
2814
|
-
effectiveRoomUsers
|
|
2795
|
+
threadContext
|
|
2815
2796
|
};
|
|
2816
2797
|
}
|
|
2817
2798
|
//#endregion
|
|
@@ -2824,10 +2805,8 @@ function decodeGeoUriParamValue(value) {
|
|
|
2824
2805
|
}
|
|
2825
2806
|
}
|
|
2826
2807
|
function parseGeoUri(value) {
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
if (!normalizeLowercaseStringOrEmpty(trimmed).startsWith("geo:")) return null;
|
|
2830
|
-
const [coordsPart, ...paramParts] = trimmed.slice(4).split(";");
|
|
2808
|
+
if (!value.toLowerCase().startsWith("geo:")) return null;
|
|
2809
|
+
const [coordsPart, ...paramParts] = value.slice(4).split(";");
|
|
2831
2810
|
if (!coordsPart) return null;
|
|
2832
2811
|
const coords = coordsPart.split(",");
|
|
2833
2812
|
if (coords.length < 2) return null;
|
|
@@ -2877,12 +2856,12 @@ function resolveMatrixLocation(params) {
|
|
|
2877
2856
|
//#endregion
|
|
2878
2857
|
//#region extensions/matrix/src/matrix/monitor/handler-ingress-prefix.ts
|
|
2879
2858
|
async function readMatrixIngressPrefix(config) {
|
|
2880
|
-
const { client, senderId, dropPreStartupMessages, eventTs, eventAge, startupMs,
|
|
2859
|
+
const { client, senderId, dropPreStartupMessages, eventTs, eventAge, startupMs, event, eventType, eventId, inboundDeduper, roomId, logVerboseMessage, directTracker, claimInboundReplay } = config;
|
|
2881
2860
|
const selfUserId = await client.getUserId();
|
|
2882
2861
|
if (senderId === selfUserId) return;
|
|
2883
2862
|
if (dropPreStartupMessages) {
|
|
2884
|
-
if (typeof eventTs === "number" && eventTs < startupMs
|
|
2885
|
-
if (typeof eventTs !== "number" && typeof eventAge === "number" && eventAge >
|
|
2863
|
+
if (typeof eventTs === "number" && eventTs < startupMs) return;
|
|
2864
|
+
if (typeof eventTs !== "number" && typeof eventAge === "number" && eventAge > 0) return;
|
|
2886
2865
|
}
|
|
2887
2866
|
const content = event.content;
|
|
2888
2867
|
if (eventType === EventType.RoomMessage && isMatrixVerificationRoomMessage({
|
|
@@ -2952,13 +2931,6 @@ function toMatrixPartialDeliveryError(error, settled) {
|
|
|
2952
2931
|
visibleReplySent: true
|
|
2953
2932
|
}) : error;
|
|
2954
2933
|
}
|
|
2955
|
-
function createMatrixReplyDeliveryResult(results) {
|
|
2956
|
-
if (results.length === 0) return mergeMatrixReplyDeliveryResults([]);
|
|
2957
|
-
return createAcceptedChannelDeliveryResult({
|
|
2958
|
-
results: results.map((result) => ({ receipt: result.receipt })),
|
|
2959
|
-
content: joinMatrixVisibleContent(results.map((result) => result.content))
|
|
2960
|
-
});
|
|
2961
|
-
}
|
|
2962
2934
|
function resolveVisibleMatrixReplyText(text) {
|
|
2963
2935
|
if (typeof text !== "string") return;
|
|
2964
2936
|
const trimmedStart = text.trimStart();
|
|
@@ -2976,7 +2948,7 @@ async function deliverMatrixReplies(params) {
|
|
|
2976
2948
|
if (core.logging.shouldLogVerbose()) params.runtime.log?.(message);
|
|
2977
2949
|
};
|
|
2978
2950
|
const hasRepliedRef = params.hasRepliedRef ?? { value: false };
|
|
2979
|
-
const
|
|
2951
|
+
const accepted = createChannelDeliveryAccumulator();
|
|
2980
2952
|
try {
|
|
2981
2953
|
for (const reply of params.replies) {
|
|
2982
2954
|
const visibleText = resolveVisibleMatrixReplyText(reply.text);
|
|
@@ -2998,7 +2970,7 @@ async function deliverMatrixReplies(params) {
|
|
|
2998
2970
|
const replyToIdForReply = explicitReplyToId || (!params.threadId && params.replyToMode !== "off" && (params.replyToMode === "all" || !hasRepliedRef.value) ? (reply.replyToId ?? params.replyToId)?.trim() : void 0);
|
|
2999
2971
|
const fallbackReplyToId = params.threadId ? (reply.replyToId ?? params.replyToId)?.trim() : void 0;
|
|
3000
2972
|
const onDeliveryResult = (result) => {
|
|
3001
|
-
|
|
2973
|
+
accepted.add({ receipt: result.receipt }, result.content);
|
|
3002
2974
|
if (replyToIdForReply) hasRepliedRef.value = true;
|
|
3003
2975
|
};
|
|
3004
2976
|
const extraContent = resolveMatrixExtraContent(reply);
|
|
@@ -3020,9 +2992,9 @@ async function deliverMatrixReplies(params) {
|
|
|
3020
2992
|
});
|
|
3021
2993
|
}
|
|
3022
2994
|
} catch (error) {
|
|
3023
|
-
throw toMatrixPartialDeliveryError(error, [
|
|
2995
|
+
throw toMatrixPartialDeliveryError(error, [accepted.result()]);
|
|
3024
2996
|
}
|
|
3025
|
-
return
|
|
2997
|
+
return accepted.result();
|
|
3026
2998
|
}
|
|
3027
2999
|
//#endregion
|
|
3028
3000
|
//#region extensions/matrix/src/matrix/monitor/handler-reply-dispatcher.ts
|
|
@@ -3248,7 +3220,7 @@ function createMatrixHandlerState(config) {
|
|
|
3248
3220
|
const SESSION_RESTART_RECOVERY_TOMBSTONE_ERROR_CODE = "SESSION_RESTART_RECOVERY_TOMBSTONE";
|
|
3249
3221
|
const RESTART_RECOVERY_TOMBSTONE_NOTICE = "This session ended during gateway restart recovery and cannot accept more messages. Send /new or /reset to start a replacement session.";
|
|
3250
3222
|
function createMatrixRoomMessageHandler(params) {
|
|
3251
|
-
const { client, core, cfg: startupConfig, accountId, runtime, logger, logVerboseMessage, allowFromResolvedEntries = [], groupAllowFromResolvedEntries = [], configuredBotUserIds = /* @__PURE__ */ new Set(), replyToMode, streaming, previewToolProgressEnabled, blockStreamingEnabled, historyLimit, startupMs,
|
|
3223
|
+
const { client, core, cfg: startupConfig, accountId, runtime, logger, logVerboseMessage, allowFromResolvedEntries = [], groupAllowFromResolvedEntries = [], configuredBotUserIds = /* @__PURE__ */ new Set(), replyToMode, streaming, previewToolProgressEnabled, blockStreamingEnabled, historyLimit, startupMs, dropPreStartupMessages, inboundDeduper, directTracker, getMemberDisplayName, resolveLiveUserAllowlist = resolveMatrixMonitorLiveUserAllowlist, resolveStorePath: resolveStorePathImpl = resolveStorePath, createChannelInboundEnvelopeBuilderAsync: createChannelInboundEnvelopeBuilderImpl = createChannelInboundEnvelopeBuilderAsync, resolveHumanDelayConfig: resolveHumanDelayConfigImpl = resolveHumanDelayConfig } = params;
|
|
3252
3224
|
const handlerConfig = {
|
|
3253
3225
|
...params,
|
|
3254
3226
|
allowFromResolvedEntries,
|
|
@@ -3256,7 +3228,7 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3256
3228
|
configuredBotUserIds,
|
|
3257
3229
|
resolveLiveUserAllowlist,
|
|
3258
3230
|
resolveStorePath: resolveStorePathImpl,
|
|
3259
|
-
|
|
3231
|
+
createChannelInboundEnvelopeBuilderAsync: createChannelInboundEnvelopeBuilderImpl,
|
|
3260
3232
|
resolveHumanDelayConfig: resolveHumanDelayConfigImpl
|
|
3261
3233
|
};
|
|
3262
3234
|
const handlerState = createMatrixHandlerState({
|
|
@@ -3313,7 +3285,6 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3313
3285
|
eventTs: eventTs ?? void 0,
|
|
3314
3286
|
eventAge: eventAge ?? void 0,
|
|
3315
3287
|
startupMs,
|
|
3316
|
-
startupGraceMs,
|
|
3317
3288
|
event,
|
|
3318
3289
|
eventType,
|
|
3319
3290
|
eventId,
|
|
@@ -3325,35 +3296,32 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3325
3296
|
inboundReplayClaim = handle;
|
|
3326
3297
|
}
|
|
3327
3298
|
});
|
|
3299
|
+
const ingressContext = {
|
|
3300
|
+
handler: handlerConfig,
|
|
3301
|
+
roomId,
|
|
3302
|
+
event,
|
|
3303
|
+
eventTs: eventTs ?? void 0,
|
|
3304
|
+
senderId,
|
|
3305
|
+
roomHistoryTracker,
|
|
3306
|
+
commitInboundEventIfClaimed
|
|
3307
|
+
};
|
|
3328
3308
|
const continueIngress = async (paramsLocal) => {
|
|
3329
3309
|
const access = await resolveMatrixIngressAccess({
|
|
3330
|
-
|
|
3310
|
+
...ingressContext,
|
|
3331
3311
|
params: paramsLocal,
|
|
3332
|
-
roomId,
|
|
3333
|
-
event,
|
|
3334
|
-
eventTs: eventTs ?? void 0,
|
|
3335
|
-
senderId,
|
|
3336
3312
|
isReactionEvent,
|
|
3337
3313
|
readStoreAllowFrom: handlerState.readStoreAllowFrom,
|
|
3338
3314
|
shouldSendPairingReply: handlerState.shouldSendPairingReply,
|
|
3339
|
-
resolveLiveAccountAllowlists: handlerState.resolveLiveAccountAllowlists
|
|
3340
|
-
roomHistoryTracker,
|
|
3341
|
-
commitInboundEventIfClaimed
|
|
3315
|
+
resolveLiveAccountAllowlists: handlerState.resolveLiveAccountAllowlists
|
|
3342
3316
|
});
|
|
3343
3317
|
if (!access) return;
|
|
3344
3318
|
return await resolveMatrixIngressContent({
|
|
3345
|
-
|
|
3319
|
+
...ingressContext,
|
|
3346
3320
|
params: paramsLocal,
|
|
3347
3321
|
access,
|
|
3348
|
-
roomId,
|
|
3349
|
-
event,
|
|
3350
3322
|
eventType,
|
|
3351
3323
|
isPollEvent,
|
|
3352
|
-
|
|
3353
|
-
senderId,
|
|
3354
|
-
roomHistoryTracker,
|
|
3355
|
-
resolveThreadContext,
|
|
3356
|
-
commitInboundEventIfClaimed
|
|
3324
|
+
resolveThreadContext
|
|
3357
3325
|
});
|
|
3358
3326
|
};
|
|
3359
3327
|
const ingressResult = historyLimit > 0 ? await roomIngressQueue.enqueue(roomId, async () => {
|
|
@@ -3378,14 +3346,10 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3378
3346
|
if ("deferredPrefix" in resolvedIngressResult) return;
|
|
3379
3347
|
const { cfg, liveDmAllowFrom, route: _route, roomConfig, isDirectMessage, isRoom, bodyText, messageId, triggerSnapshot, threadRootId, thread, botLoopProtection } = resolvedIngressResult;
|
|
3380
3348
|
const inboundContext = await resolveMatrixInboundContext({
|
|
3381
|
-
|
|
3349
|
+
...ingressContext,
|
|
3382
3350
|
ingress: resolvedIngressResult,
|
|
3383
|
-
roomId,
|
|
3384
|
-
event,
|
|
3385
|
-
eventTs: eventTs ?? void 0,
|
|
3386
3351
|
resolveThreadContext,
|
|
3387
3352
|
resolveReplyContext,
|
|
3388
|
-
senderId,
|
|
3389
3353
|
sharedDmContextNoticeRooms
|
|
3390
3354
|
});
|
|
3391
3355
|
if (!inboundContext) return;
|
|
@@ -3397,33 +3361,24 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3397
3361
|
channel: "matrix",
|
|
3398
3362
|
accountId: _route.accountId
|
|
3399
3363
|
});
|
|
3364
|
+
const sendTyping = async (isTyping) => {
|
|
3365
|
+
const { sendTypingMatrix } = await loadMatrixSendModule();
|
|
3366
|
+
await sendTypingMatrix(roomId, isTyping, { client });
|
|
3367
|
+
};
|
|
3368
|
+
const onTypingError = (action, error) => {
|
|
3369
|
+
logTypingFailure({
|
|
3370
|
+
log: logVerboseMessage,
|
|
3371
|
+
channel: "matrix",
|
|
3372
|
+
action,
|
|
3373
|
+
target: roomId,
|
|
3374
|
+
error
|
|
3375
|
+
});
|
|
3376
|
+
};
|
|
3400
3377
|
const typingCallbacks = createTypingCallbacks({
|
|
3401
|
-
start:
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
stop: async () => {
|
|
3406
|
-
const { sendTypingMatrix } = await loadMatrixSendModule();
|
|
3407
|
-
await sendTypingMatrix(roomId, false, { client });
|
|
3408
|
-
},
|
|
3409
|
-
onStartError: (err) => {
|
|
3410
|
-
logTypingFailure({
|
|
3411
|
-
log: logVerboseMessage,
|
|
3412
|
-
channel: "matrix",
|
|
3413
|
-
action: "start",
|
|
3414
|
-
target: roomId,
|
|
3415
|
-
error: err
|
|
3416
|
-
});
|
|
3417
|
-
},
|
|
3418
|
-
onStopError: (err) => {
|
|
3419
|
-
logTypingFailure({
|
|
3420
|
-
log: logVerboseMessage,
|
|
3421
|
-
channel: "matrix",
|
|
3422
|
-
action: "stop",
|
|
3423
|
-
target: roomId,
|
|
3424
|
-
error: err
|
|
3425
|
-
});
|
|
3426
|
-
}
|
|
3378
|
+
start: () => sendTyping(true),
|
|
3379
|
+
stop: () => sendTyping(false),
|
|
3380
|
+
onStartError: (err) => onTypingError("start", err),
|
|
3381
|
+
onStopError: (err) => onTypingError("stop", err)
|
|
3427
3382
|
});
|
|
3428
3383
|
const hookRunner = getGlobalHookRunner();
|
|
3429
3384
|
const allowProviderPreview = !((hookRunner?.hasHooks("reply_payload_sending") ?? false) || (hookRunner?.hasHooks("message_sending") ?? false));
|
|
@@ -3604,13 +3559,9 @@ function createMatrixRoomMessageHandler(params) {
|
|
|
3604
3559
|
}
|
|
3605
3560
|
const { dispatchResult } = turnResult;
|
|
3606
3561
|
const { queuedFinal } = dispatchResult;
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
return;
|
|
3611
|
-
}
|
|
3612
|
-
if (!queuedFinal && replyDispatcher.nonFinalReplyDeliveryFailed()) {
|
|
3613
|
-
logVerboseMessage(`matrix: non-final reply delivery failed room=${roomId} id=${messageId}; keeping replay committed`);
|
|
3562
|
+
const failedDeliveryKind = draftController.previewLifecycle.finalFailed ? "final" : !queuedFinal && replyDispatcher.nonFinalReplyDeliveryFailed() ? "non-final" : void 0;
|
|
3563
|
+
if (failedDeliveryKind) {
|
|
3564
|
+
logVerboseMessage(`matrix: ${failedDeliveryKind} reply delivery failed room=${roomId} id=${messageId}; keeping replay committed`);
|
|
3614
3565
|
await commitInboundEventIfClaimed();
|
|
3615
3566
|
return;
|
|
3616
3567
|
}
|
|
@@ -3652,10 +3603,10 @@ function shouldPromoteRecentInviteRoom(params) {
|
|
|
3652
3603
|
//#endregion
|
|
3653
3604
|
//#region extensions/matrix/src/matrix/monitor/startup.ts
|
|
3654
3605
|
const loadMatrixStartupMaintenanceDeps = createLazyRuntimeModule(() => Promise.all([
|
|
3655
|
-
import("./
|
|
3606
|
+
import("./setup-core-CKnNTfgD.mjs").then((n) => n.f),
|
|
3656
3607
|
import("./device-health-Be60VF1w.mjs").then((n) => n.t),
|
|
3657
|
-
import("./
|
|
3658
|
-
import("./startup-verification-
|
|
3608
|
+
import("./setup-core-CKnNTfgD.mjs").then((n) => n.u),
|
|
3609
|
+
import("./startup-verification-CgfUb4yJ.mjs")
|
|
3659
3610
|
]).then(([configUpdateModule, deviceHealthModule, profileModule, startupVerificationModule]) => ({
|
|
3660
3611
|
updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
|
|
3661
3612
|
summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
|
|
@@ -4035,7 +3986,6 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
4035
3986
|
const previewToolProgressEnabled = resolveMatrixPreviewToolProgressEnabled(accountConfig.streaming);
|
|
4036
3987
|
const blockStreamingEnabled = resolveChannelStreamingBlockEnabled(accountConfig) === true;
|
|
4037
3988
|
const startupMs = Date.now();
|
|
4038
|
-
const startupGraceMs = 0;
|
|
4039
3989
|
const warnedEncryptedRooms = /* @__PURE__ */ new Set();
|
|
4040
3990
|
const warnedCryptoMissingRooms = /* @__PURE__ */ new Set();
|
|
4041
3991
|
let healthySyncSinceMs;
|
|
@@ -4154,7 +4104,6 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
4154
4104
|
mediaMaxBytes,
|
|
4155
4105
|
historyLimit,
|
|
4156
4106
|
startupMs,
|
|
4157
|
-
startupGraceMs,
|
|
4158
4107
|
dropPreStartupMessages,
|
|
4159
4108
|
inboundDeduper,
|
|
4160
4109
|
directTracker,
|
|
@@ -4201,7 +4150,6 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
4201
4150
|
warnedEncryptedRooms,
|
|
4202
4151
|
warnedCryptoMissingRooms,
|
|
4203
4152
|
logger,
|
|
4204
|
-
startupGraceMs,
|
|
4205
4153
|
getHealthySyncSinceMs: () => healthySyncSinceMs,
|
|
4206
4154
|
formatNativeDependencyHint: core.system.formatNativeDependencyHint,
|
|
4207
4155
|
onRoomMessage: handleRoomMessage,
|
|
@@ -4264,11 +4212,7 @@ async function monitorMatrixProvider(opts = {}) {
|
|
|
4264
4212
|
}), syncLifecycle.waitForFatalStop()]);
|
|
4265
4213
|
await cleanup();
|
|
4266
4214
|
} catch (err) {
|
|
4267
|
-
if (monitorSetupClosed) {
|
|
4268
|
-
await cleanup("stop");
|
|
4269
|
-
return;
|
|
4270
|
-
}
|
|
4271
|
-
if (monitorLifecycleSignal?.aborted === true && isMatrixStartupAbortError(err)) {
|
|
4215
|
+
if (monitorSetupClosed || monitorLifecycleSignal?.aborted && isMatrixStartupAbortError(err)) {
|
|
4272
4216
|
await cleanup("stop");
|
|
4273
4217
|
return;
|
|
4274
4218
|
}
|