@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,10 +1,11 @@
|
|
|
1
1
|
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
2
|
import { n as isMatrixActiveTokenRootDirectory, r as resolveMatrixAccountStorageRoot } from "./storage-paths-B51JM-pC.mjs";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as updateMatrixKeyedState, d as writeMatrixStateChunks, i as assertMatrixSupportedStateRoot, l as chunkMatrixStateJson, o as resolveMatrixSqliteStateEnv, r as assertMatrixSupportedStateFile, u as readMatrixStateChunks } from "./retired-state-DW5pLH05.mjs";
|
|
4
4
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
7
7
|
import path from "node:path";
|
|
8
|
+
import { asSafeIntegerInRange } from "openclaw/plugin-sdk/number-runtime";
|
|
8
9
|
import fs from "node:fs";
|
|
9
10
|
import os from "node:os";
|
|
10
11
|
//#region extensions/matrix/src/matrix/crypto-state-store.ts
|
|
@@ -45,37 +46,20 @@ async function readMatrixRecoveryKeyStateForPathAsync(recoveryKeyPath, stateRunt
|
|
|
45
46
|
async function writeMatrixRecoveryKeyStateForPathAsync(params) {
|
|
46
47
|
const payload = normalizeMatrixStoredRecoveryKey(params.payload);
|
|
47
48
|
if (!payload) throw new Error("Invalid Matrix recovery key state");
|
|
49
|
+
const store = params.stateRuntime.openKeyedStore(openMatrixRecoveryKeyStoreOptions(path.dirname(params.recoveryKeyPath)));
|
|
50
|
+
const key = resolveRecoveryKeyStateKeyForPath(params.recoveryKeyPath);
|
|
48
51
|
if (params.preserveEncodedPrivateKey) {
|
|
49
|
-
|
|
52
|
+
const update = (current) => normalizeMatrixStoredRecoveryKey({
|
|
50
53
|
...payload,
|
|
51
54
|
encodedPrivateKey: normalizeMatrixStoredRecoveryKey(current)?.encodedPrivateKey
|
|
52
|
-
}) ?? void 0
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
async function updateMatrixRecoveryKeyState(params, update) {
|
|
58
|
-
const store = params.stateRuntime.openKeyedStore(openMatrixRecoveryKeyStoreOptions(path.dirname(params.recoveryKeyPath)));
|
|
59
|
-
const key = resolveRecoveryKeyStateKeyForPath(params.recoveryKeyPath);
|
|
60
|
-
if (!store.observe || !store.compareAndApply) {
|
|
61
|
-
if (!store.update) throw new Error("Matrix recovery key store does not support atomic updates");
|
|
62
|
-
await store.update(key, update);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
let observation = await store.observe(key);
|
|
66
|
-
for (;;) {
|
|
67
|
-
const value = update(observation.value);
|
|
68
|
-
const result = await store.compareAndApply(key, observation.comparison, value === void 0 ? {
|
|
69
|
-
operation: "update",
|
|
70
|
-
action: "keep"
|
|
71
|
-
} : {
|
|
72
|
-
operation: "update",
|
|
73
|
-
action: "set",
|
|
74
|
-
value
|
|
55
|
+
}) ?? void 0;
|
|
56
|
+
await updateMatrixKeyedState(store, key, update, async () => {
|
|
57
|
+
if (!store.update) throw new Error("Matrix recovery key store does not support atomic updates");
|
|
58
|
+
return await store.update(key, update);
|
|
75
59
|
});
|
|
76
|
-
|
|
77
|
-
observation = result.current;
|
|
60
|
+
return;
|
|
78
61
|
}
|
|
62
|
+
await store.register(key, payload);
|
|
79
63
|
}
|
|
80
64
|
async function readMatrixIdbSnapshotJson(storageRootDir, stateRuntime = getMatrixRuntime().state) {
|
|
81
65
|
const store = stateRuntime.openKeyedStore(openMatrixIdbSnapshotStoreOptions(storageRootDir));
|
|
@@ -143,7 +127,6 @@ function buildIdbSnapshotRows(snapshotJson, databaseCount) {
|
|
|
143
127
|
}));
|
|
144
128
|
return {
|
|
145
129
|
chunks,
|
|
146
|
-
nextChunkKeys: new Set(chunks.map((chunk) => chunk.key)),
|
|
147
130
|
meta: {
|
|
148
131
|
key: idbMetaKey(),
|
|
149
132
|
value: {
|
|
@@ -171,7 +154,10 @@ function digestText(value) {
|
|
|
171
154
|
return createHash("sha256").update(value, "utf8").digest("hex");
|
|
172
155
|
}
|
|
173
156
|
function isIdbSnapshotMeta(value) {
|
|
174
|
-
return isRecord(value) && value.kind === "meta" && value.version === 1 && typeof value.generation === "string" && value.generation.trim() !== "" &&
|
|
157
|
+
return isRecord(value) && value.kind === "meta" && value.version === 1 && typeof value.generation === "string" && value.generation.trim() !== "" && asSafeIntegerInRange(value.chunkCount, {
|
|
158
|
+
min: 0,
|
|
159
|
+
max: IDB_SNAPSHOT_MAX_CHUNKS
|
|
160
|
+
}) !== void 0 && typeof value.digest === "string" && asSafeIntegerInRange(value.databaseCount, { min: 0 }) !== void 0 && typeof value.persistedAt === "string";
|
|
175
161
|
}
|
|
176
162
|
//#endregion
|
|
177
163
|
//#region extensions/matrix/src/matrix/client/storage-metadata.ts
|
|
@@ -266,7 +252,7 @@ async function resolvePreferredMatrixStorageRoot(params) {
|
|
|
266
252
|
tokenHash: best.tokenHash
|
|
267
253
|
};
|
|
268
254
|
}
|
|
269
|
-
const
|
|
255
|
+
const populatedSiblingTokenHashes = [];
|
|
270
256
|
const populatedTokenHashes = bestCurrentScore > 0 ? [params.canonicalTokenHash] : [];
|
|
271
257
|
for (const entry of siblingEntries.toSorted((a, b) => a.name.localeCompare(b.name))) {
|
|
272
258
|
if (!entry.isDirectory()) continue;
|
|
@@ -284,20 +270,21 @@ async function resolvePreferredMatrixStorageRoot(params) {
|
|
|
284
270
|
const candidateScore = await scoreStorageRoot(candidateRootDir, metadata);
|
|
285
271
|
if (candidateScore <= 0) continue;
|
|
286
272
|
populatedTokenHashes.push(entry.name);
|
|
287
|
-
|
|
273
|
+
populatedSiblingTokenHashes.push(entry.name);
|
|
274
|
+
const candidate = {
|
|
288
275
|
rootDir: candidateRootDir,
|
|
289
276
|
tokenHash: entry.name,
|
|
290
277
|
score: candidateScore,
|
|
291
278
|
mtimeMs: resolveStorageRootMtimeMs(candidateRootDir)
|
|
292
|
-
}
|
|
279
|
+
};
|
|
280
|
+
if (candidate.score > best.score || best.rootDir !== params.canonicalRootDir && candidate.score === best.score && candidate.mtimeMs > best.mtimeMs) best = candidate;
|
|
293
281
|
}
|
|
294
|
-
for (const candidate of compatiblePopulatedSiblings) if (candidate.score > best.score || best.rootDir !== params.canonicalRootDir && candidate.score === best.score && candidate.mtimeMs > best.mtimeMs) best = candidate;
|
|
295
282
|
if (populatedTokenHashes.length > 1) getMatrixRuntime().logging.getChildLogger({ module: "matrix-storage" }).warn("matrix: multiple populated token-hash storage roots detected", {
|
|
296
283
|
parentDir,
|
|
297
284
|
canonicalTokenHash: params.canonicalTokenHash,
|
|
298
285
|
selectedTokenHash: best.tokenHash,
|
|
299
286
|
populatedTokenHashes,
|
|
300
|
-
populatedSiblingTokenHashes
|
|
287
|
+
populatedSiblingTokenHashes,
|
|
301
288
|
populatedRootCount: populatedTokenHashes.length
|
|
302
289
|
});
|
|
303
290
|
return {
|
|
@@ -349,7 +336,7 @@ async function maybeMigrateLegacyStorage({ storagePaths }) {
|
|
|
349
336
|
const { rootDir, storagePath } = storagePaths;
|
|
350
337
|
await assertMatrixSupportedStateRoot(rootDir);
|
|
351
338
|
if (!fs.existsSync(storagePath)) return;
|
|
352
|
-
const syncCache = await import("./sync-cache-state-
|
|
339
|
+
const syncCache = await import("./sync-cache-state-D4G-fi3t.mjs").then((n) => n.o);
|
|
353
340
|
if (!await syncCache.readLegacyMatrixSyncCacheState(rootDir)) return;
|
|
354
341
|
const logger = getMatrixRuntime().logging.getChildLogger({ module: "matrix-storage" });
|
|
355
342
|
fs.mkdirSync(rootDir, { recursive: true });
|
|
@@ -395,25 +382,13 @@ async function mutateStorageMeta(rootDir, mutation) {
|
|
|
395
382
|
try {
|
|
396
383
|
const store = openStorageMetaStore(rootDir);
|
|
397
384
|
const decode = (value) => normalizeMatrixStorageMetadata(value) ?? {};
|
|
398
|
-
|
|
385
|
+
return await updateMatrixKeyedState(store, STORAGE_META_STATE_KEY, (current) => prepareStorageMetaMutation(decode(current), mutation) ?? void 0, () => {
|
|
399
386
|
const legacyStore = getMatrixRuntime().state.openSyncKeyedStore(openMatrixStorageMetaStoreOptions(rootDir));
|
|
400
387
|
const next = prepareStorageMetaMutation(decode(legacyStore.lookup(STORAGE_META_STATE_KEY)), mutation);
|
|
401
388
|
if (!next) return false;
|
|
402
389
|
legacyStore.register(STORAGE_META_STATE_KEY, next);
|
|
403
390
|
return true;
|
|
404
|
-
}
|
|
405
|
-
let observation = await store.observe(STORAGE_META_STATE_KEY);
|
|
406
|
-
for (;;) {
|
|
407
|
-
const next = prepareStorageMetaMutation(decode(observation.value), mutation);
|
|
408
|
-
if (!next) return false;
|
|
409
|
-
const result = await store.compareAndApply(STORAGE_META_STATE_KEY, observation.comparison, {
|
|
410
|
-
operation: "update",
|
|
411
|
-
action: "set",
|
|
412
|
-
value: next
|
|
413
|
-
});
|
|
414
|
-
if (result.status !== "conflict") return true;
|
|
415
|
-
observation = result.current;
|
|
416
|
-
}
|
|
391
|
+
}, "skip");
|
|
417
392
|
} catch {
|
|
418
393
|
return false;
|
|
419
394
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as listBindingsForAccount, i as listAllBindings, n as getMatrixThreadBindingManager, o as removeBindingRecord, s as resolveBindingKey } from "./thread-bindings-shared-
|
|
1
|
+
import { a as listBindingsForAccount, i as listAllBindings, n as getMatrixThreadBindingManager, o as removeBindingRecord, s as resolveBindingKey } from "./thread-bindings-shared-CbsFNbAY.mjs";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { getSessionBindingService } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
4
4
|
//#region extensions/matrix/src/matrix/subagent-hooks.ts
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { d as writeMatrixStateChunks, l as chunkMatrixStateJson, o as resolveMatrixSqliteStateEnv, u as readMatrixStateChunks } from "./retired-state-DW5pLH05.mjs";
|
|
3
3
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import path from "node:path";
|
|
6
|
+
import { asSafeIntegerInRange } from "openclaw/plugin-sdk/number-runtime";
|
|
6
7
|
import fs from "node:fs/promises";
|
|
7
8
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
8
9
|
//#region extensions/matrix/src/matrix/client/sync-cache-state.ts
|
|
@@ -18,7 +19,8 @@ var sync_cache_state_exports = /* @__PURE__ */ __exportAll({
|
|
|
18
19
|
const SYNC_CACHE_NAMESPACE = "sync-cache";
|
|
19
20
|
const SYNC_CACHE_MAX_ENTRIES = 2e4;
|
|
20
21
|
const SYNC_CACHE_MAX_CHUNKS = Math.floor(19999 / 2);
|
|
21
|
-
const
|
|
22
|
+
const SYNC_CACHE_META_KEY = "current:meta";
|
|
23
|
+
const SYNC_CACHE_CHUNK_PREFIX = "current:sync:";
|
|
22
24
|
const SYNC_CACHE_CHUNK_BYTES = 24e3;
|
|
23
25
|
const syncCacheOperations = new KeyedAsyncQueue();
|
|
24
26
|
function normalizeRoomsData(value) {
|
|
@@ -41,15 +43,6 @@ function toPersistedSyncData(value) {
|
|
|
41
43
|
roomsData
|
|
42
44
|
};
|
|
43
45
|
}
|
|
44
|
-
if (typeof value.next_batch === "string" && value.next_batch.trim()) {
|
|
45
|
-
const roomsData = normalizeRoomsData(value.rooms);
|
|
46
|
-
if (!roomsData) return null;
|
|
47
|
-
return {
|
|
48
|
-
nextBatch: value.next_batch,
|
|
49
|
-
accountData: isRecord(value.account_data) && Array.isArray(value.account_data.events) ? value.account_data.events : [],
|
|
50
|
-
roomsData
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
46
|
return null;
|
|
54
47
|
}
|
|
55
48
|
function normalizePersistedStore(value) {
|
|
@@ -75,15 +68,14 @@ async function readPersistedStoreFromStore(params) {
|
|
|
75
68
|
return syncCacheOperations.enqueue(path.resolve(storageRootDir), () => readPersistedStore(store));
|
|
76
69
|
}
|
|
77
70
|
async function readPersistedStore(store) {
|
|
78
|
-
const
|
|
79
|
-
const meta = await store.lookup(metaKey(stateKey));
|
|
71
|
+
const meta = await store.lookup(SYNC_CACHE_META_KEY);
|
|
80
72
|
if (!isSyncCacheMeta(meta)) return null;
|
|
81
|
-
const chunks = await readMatrixStateChunks(store, Array.from({ length: meta.chunkCount }, (_, index) => chunkKey(
|
|
73
|
+
const chunks = await readMatrixStateChunks(store, Array.from({ length: meta.chunkCount }, (_, index) => chunkKey(meta.generation, index)), "sync-chunk");
|
|
82
74
|
const syncJson = chunks?.join("") ?? "";
|
|
83
75
|
const intact = chunks !== null && (chunks.length === 0 || meta.syncDigest === digestText(syncJson));
|
|
84
76
|
let savedSync = null;
|
|
85
77
|
if (intact && chunks.length > 0) try {
|
|
86
|
-
savedSync =
|
|
78
|
+
savedSync = JSON.parse(syncJson);
|
|
87
79
|
} catch {
|
|
88
80
|
savedSync = null;
|
|
89
81
|
}
|
|
@@ -94,14 +86,8 @@ async function readPersistedStore(store) {
|
|
|
94
86
|
cleanShutdown: intact && meta.cleanShutdown
|
|
95
87
|
});
|
|
96
88
|
}
|
|
97
|
-
function
|
|
98
|
-
return `${
|
|
99
|
-
}
|
|
100
|
-
function chunkKeyPrefix(stateKey) {
|
|
101
|
-
return `${stateKey}:sync:`;
|
|
102
|
-
}
|
|
103
|
-
function chunkKey(stateKey, generation, index) {
|
|
104
|
-
return `${chunkKeyPrefix(stateKey)}${generation}:${index}`;
|
|
89
|
+
function chunkKey(generation, index) {
|
|
90
|
+
return `${SYNC_CACHE_CHUNK_PREFIX}${generation}:${index}`;
|
|
105
91
|
}
|
|
106
92
|
function resolveLegacySyncCachePath(storageRootDir) {
|
|
107
93
|
return path.join(storageRootDir, "bot-storage.json");
|
|
@@ -110,13 +96,16 @@ function digestText(value) {
|
|
|
110
96
|
return createHash("sha256").update(value, "utf8").digest("hex");
|
|
111
97
|
}
|
|
112
98
|
function isSyncCacheMeta(value) {
|
|
113
|
-
return isRecord(value) && value.kind === "meta" && value.version === 1 && typeof value.generation === "string" && value.generation.trim() !== "" &&
|
|
99
|
+
return isRecord(value) && value.kind === "meta" && value.version === 1 && typeof value.generation === "string" && value.generation.trim() !== "" && asSafeIntegerInRange(value.chunkCount, {
|
|
100
|
+
min: 0,
|
|
101
|
+
max: SYNC_CACHE_MAX_CHUNKS
|
|
102
|
+
}) !== void 0;
|
|
114
103
|
}
|
|
115
|
-
function buildSyncCacheRows(
|
|
104
|
+
function buildSyncCacheRows(payload) {
|
|
116
105
|
const generation = randomUUID().replaceAll("-", "");
|
|
117
106
|
const syncJson = payload.savedSync ? JSON.stringify(payload.savedSync) : "";
|
|
118
107
|
const chunks = chunkMatrixStateJson(syncJson, SYNC_CACHE_CHUNK_BYTES, SYNC_CACHE_MAX_CHUNKS, "Matrix sync cache exceeds SQLite chunk limit").map((data, index) => ({
|
|
119
|
-
key: chunkKey(
|
|
108
|
+
key: chunkKey(generation, index),
|
|
120
109
|
value: {
|
|
121
110
|
kind: "sync-chunk",
|
|
122
111
|
index,
|
|
@@ -125,9 +114,8 @@ function buildSyncCacheRows(stateKey, payload) {
|
|
|
125
114
|
}));
|
|
126
115
|
return {
|
|
127
116
|
chunks,
|
|
128
|
-
nextChunkKeys: new Set(chunks.map((chunk) => chunk.key)),
|
|
129
117
|
meta: {
|
|
130
|
-
key:
|
|
118
|
+
key: SYNC_CACHE_META_KEY,
|
|
131
119
|
value: {
|
|
132
120
|
kind: "meta",
|
|
133
121
|
version: 1,
|
|
@@ -155,9 +143,8 @@ async function hasMatrixSyncCacheStateInStore(params) {
|
|
|
155
143
|
}
|
|
156
144
|
async function writeMatrixSyncCacheStateToStore(params) {
|
|
157
145
|
const { storageRootDir, store, payload } = params;
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
return syncCacheOperations.enqueue(path.resolve(storageRootDir), () => writeMatrixStateChunks(store, rows, chunkKeyPrefix(stateKey)));
|
|
146
|
+
const rows = buildSyncCacheRows(payload);
|
|
147
|
+
return syncCacheOperations.enqueue(path.resolve(storageRootDir), () => writeMatrixStateChunks(store, rows, SYNC_CACHE_CHUNK_PREFIX));
|
|
161
148
|
}
|
|
162
149
|
function openMatrixSyncCacheStoreOptions(storageRootDir) {
|
|
163
150
|
return {
|
|
@@ -169,8 +156,8 @@ function openMatrixSyncCacheStoreOptions(storageRootDir) {
|
|
|
169
156
|
async function deleteMatrixSyncCacheStateFromStore(params) {
|
|
170
157
|
const { storageRootDir, store } = params;
|
|
171
158
|
return syncCacheOperations.enqueue(path.resolve(storageRootDir), async () => {
|
|
172
|
-
await store.delete(
|
|
173
|
-
for (const row of await store.entries()) if (row.key.startsWith(
|
|
159
|
+
await store.delete(SYNC_CACHE_META_KEY);
|
|
160
|
+
for (const row of await store.entries()) if (row.key.startsWith(SYNC_CACHE_CHUNK_PREFIX)) await store.delete(row.key);
|
|
174
161
|
await fs.rm(resolveLegacySyncCachePath(storageRootDir), { force: true }).catch(() => void 0);
|
|
175
162
|
});
|
|
176
163
|
}
|
|
@@ -62,6 +62,20 @@ function isMatrixRoomId(raw) {
|
|
|
62
62
|
const trimmed = raw.trim();
|
|
63
63
|
return trimmed.startsWith("!") && trimmed.length > 1;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Whether `raw` is an invite auto-join target the room matcher can ever accept:
|
|
67
|
+
* the wildcard, a literal room ID, or a full `#alias:server` with both a local
|
|
68
|
+
* part and a server name. This is the shared contract for
|
|
69
|
+
* `channels.matrix.autoJoinAllowlist`; the setup wizard rejects other values and
|
|
70
|
+
* the invite handler reports them as inert.
|
|
71
|
+
*/
|
|
72
|
+
function isMatrixInviteAutoJoinTarget(raw) {
|
|
73
|
+
const trimmed = raw.trim();
|
|
74
|
+
if (trimmed === "*" || isMatrixRoomId(trimmed)) return true;
|
|
75
|
+
if (!trimmed.startsWith("#")) return false;
|
|
76
|
+
const [localPart, serverName] = trimmed.slice(1).split(":", 2);
|
|
77
|
+
return Boolean(localPart) && Boolean(serverName);
|
|
78
|
+
}
|
|
65
79
|
function normalizeMatrixResolvableTarget(raw) {
|
|
66
80
|
return stripKnownPrefixes(raw, [
|
|
67
81
|
MATRIX_PREFIX,
|
|
@@ -84,4 +98,4 @@ function resolveMatrixDirectUserId(params) {
|
|
|
84
98
|
return isMatrixQualifiedUserId(userId) ? userId : void 0;
|
|
85
99
|
}
|
|
86
100
|
//#endregion
|
|
87
|
-
export {
|
|
101
|
+
export { normalizeMatrixResolvableTarget as a, normalizeMatrixMessagingTarget as i, isMatrixQualifiedUserId as n, resolveMatrixDirectUserId as o, isMatrixRoomId as r, resolveMatrixTargetIdentity as s, isMatrixInviteAutoJoinTarget as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as resolveMatrixTargetIdentity } from "./target-ids-HhcaKX1n.mjs";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/matrix/src/thread-binding-api.ts
|
|
4
4
|
const defaultTopLevelPlacement = "child";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as getMatrixRuntime } from "./runtime-1kn1P6io.mjs";
|
|
2
|
-
import { a as listBindingsForAccount, c as setBindingRecord, f as
|
|
3
|
-
import { o as resolveMatrixSqliteStateEnv, r as assertMatrixSupportedStateFile, s as resolveMatrixSqliteStateKey } from "./retired-state-
|
|
4
|
-
import { a as resolveMatrixStateFilePath, t as claimCurrentTokenStorageState } from "./storage-
|
|
5
|
-
import { r as sendMessageMatrix } from "./send-
|
|
2
|
+
import { a as listBindingsForAccount, c as setBindingRecord, f as toSessionBindingRecord, o as removeBindingRecord, r as getMatrixThreadBindingManagerEntry, s as resolveBindingKey, t as deleteMatrixThreadBindingManagerEntry, u as setMatrixThreadBindingManagerEntry } from "./thread-bindings-shared-CbsFNbAY.mjs";
|
|
3
|
+
import { o as resolveMatrixSqliteStateEnv, r as assertMatrixSupportedStateFile, s as resolveMatrixSqliteStateKey } from "./retired-state-DW5pLH05.mjs";
|
|
4
|
+
import { a as resolveMatrixStateFilePath, t as claimCurrentTokenStorageState } from "./storage-DkC6bHgA.mjs";
|
|
5
|
+
import { r as sendMessageMatrix } from "./send-LCOuTVc1.mjs";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import path from "node:path";
|
|
@@ -169,7 +169,10 @@ async function createMatrixThreadBindingManager(params) {
|
|
|
169
169
|
const targetSessionKey = input.targetSessionKey.trim();
|
|
170
170
|
if (!targetSessionKey) return [];
|
|
171
171
|
const now = Date.now();
|
|
172
|
-
const nextBindings = listBindingsForAccount(params.accountId).filter((entry) => entry.targetSessionKey === targetSessionKey).map((entry) =>
|
|
172
|
+
const nextBindings = listBindingsForAccount(params.accountId).filter((entry) => entry.targetSessionKey === targetSessionKey).map((entry) => Object.assign({}, entry, {
|
|
173
|
+
[input.field]: Math.max(0, Math.floor(input.value)),
|
|
174
|
+
lastActivityAt: now
|
|
175
|
+
}));
|
|
173
176
|
if (nextBindings.length === 0) return [];
|
|
174
177
|
for (const entry of nextBindings) setBindingRecord(entry);
|
|
175
178
|
persistSafely(input.persistReason);
|
|
@@ -198,28 +201,18 @@ async function createMatrixThreadBindingManager(params) {
|
|
|
198
201
|
schedulePersist(TOUCH_PERSIST_DELAY_MS);
|
|
199
202
|
return nextRecord;
|
|
200
203
|
},
|
|
201
|
-
setIdleTimeoutBySessionKey: ({ targetSessionKey, idleTimeoutMs }) => {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return updateBindingsBySessionKey({
|
|
214
|
-
targetSessionKey,
|
|
215
|
-
persistReason: "max-age-update",
|
|
216
|
-
update: (entry, now) => ({
|
|
217
|
-
...entry,
|
|
218
|
-
maxAgeMs: Math.max(0, Math.floor(maxAgeMs)),
|
|
219
|
-
lastActivityAt: now
|
|
220
|
-
})
|
|
221
|
-
});
|
|
222
|
-
},
|
|
204
|
+
setIdleTimeoutBySessionKey: ({ targetSessionKey, idleTimeoutMs }) => updateBindingsBySessionKey({
|
|
205
|
+
targetSessionKey,
|
|
206
|
+
field: "idleTimeoutMs",
|
|
207
|
+
value: idleTimeoutMs,
|
|
208
|
+
persistReason: "idle-timeout-update"
|
|
209
|
+
}),
|
|
210
|
+
setMaxAgeBySessionKey: ({ targetSessionKey, maxAgeMs }) => updateBindingsBySessionKey({
|
|
211
|
+
targetSessionKey,
|
|
212
|
+
field: "maxAgeMs",
|
|
213
|
+
value: maxAgeMs,
|
|
214
|
+
persistReason: "max-age-update"
|
|
215
|
+
}),
|
|
223
216
|
stop: async () => {
|
|
224
217
|
if (sweepTimer) clearInterval(sweepTimer);
|
|
225
218
|
let finalPersist = persistQueue;
|
|
@@ -241,27 +234,20 @@ async function createMatrixThreadBindingManager(params) {
|
|
|
241
234
|
}
|
|
242
235
|
};
|
|
243
236
|
let sweepTimer = null;
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
};
|
|
247
|
-
const sendFarewellMessages = async (removed, reason) => {
|
|
248
|
-
await Promise.all(removed.map(async (record) => {
|
|
249
|
-
await sendFarewellMessage({
|
|
250
|
-
cfg: params.cfg,
|
|
251
|
-
client: params.client,
|
|
252
|
-
accountId: params.accountId,
|
|
253
|
-
record,
|
|
254
|
-
defaultIdleTimeoutMs: defaults.idleTimeoutMs,
|
|
255
|
-
defaultMaxAgeMs: defaults.maxAgeMs,
|
|
256
|
-
reason: typeof reason === "function" ? reason(record) : reason
|
|
257
|
-
});
|
|
258
|
-
}));
|
|
259
|
-
};
|
|
260
|
-
const unbindRecords = async (records, reason) => {
|
|
261
|
-
const removed = removeRecords(records);
|
|
237
|
+
const unbindRecords = async (records, reason, onRemoved) => {
|
|
238
|
+
const removed = records.map((record) => removeBindingRecord(record)).filter((record) => Boolean(record));
|
|
262
239
|
if (removed.length === 0) return [];
|
|
240
|
+
removed.forEach((record) => onRemoved?.(record));
|
|
263
241
|
await persist();
|
|
264
|
-
await
|
|
242
|
+
await Promise.all(removed.map((record) => sendFarewellMessage({
|
|
243
|
+
cfg: params.cfg,
|
|
244
|
+
client: params.client,
|
|
245
|
+
accountId: params.accountId,
|
|
246
|
+
record,
|
|
247
|
+
defaultIdleTimeoutMs: defaults.idleTimeoutMs,
|
|
248
|
+
defaultMaxAgeMs: defaults.maxAgeMs,
|
|
249
|
+
reason: typeof reason === "function" ? reason(record) : reason
|
|
250
|
+
})));
|
|
265
251
|
return removed.map((record) => toSessionBindingRecord(record, defaults));
|
|
266
252
|
};
|
|
267
253
|
const sessionBindingAdapter = {
|
|
@@ -301,7 +287,7 @@ async function createMatrixThreadBindingManager(params) {
|
|
|
301
287
|
accountId: params.accountId,
|
|
302
288
|
conversationId: boundConversationId,
|
|
303
289
|
...boundParentConversationId ? { parentConversationId: boundParentConversationId } : {},
|
|
304
|
-
targetKind:
|
|
290
|
+
targetKind: input.targetKind === "subagent" ? "subagent" : "acp",
|
|
305
291
|
targetSessionKey,
|
|
306
292
|
agentId: normalizeOptionalString(input.metadata?.agentId) ?? resolveSessionAgentIdStrict({
|
|
307
293
|
config: params.cfg,
|
|
@@ -339,7 +325,7 @@ async function createMatrixThreadBindingManager(params) {
|
|
|
339
325
|
manager.touchBinding(bindingId, at);
|
|
340
326
|
},
|
|
341
327
|
unbind: async (input) => {
|
|
342
|
-
return
|
|
328
|
+
return unbindRecords(listBindingsForAccount(params.accountId).filter((record) => {
|
|
343
329
|
if (input.bindingId?.trim()) return resolveBindingKey(record) === input.bindingId.trim();
|
|
344
330
|
if (input.targetSessionKey?.trim()) return record.targetSessionKey === input.targetSessionKey.trim();
|
|
345
331
|
return false;
|
|
@@ -360,16 +346,10 @@ async function createMatrixThreadBindingManager(params) {
|
|
|
360
346
|
})).filter((entry) => typeof entry.lifecycle.expiresAt === "number" && entry.lifecycle.expiresAt <= now && Boolean(entry.lifecycle.reason));
|
|
361
347
|
if (expired.length === 0) return;
|
|
362
348
|
const reasonByBindingKey = new Map(expired.map(({ record, lifecycle }) => [resolveBindingKey(record), lifecycle.reason]));
|
|
363
|
-
(
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
const reason = reasonByBindingKey.get(resolveBindingKey(record));
|
|
368
|
-
params.logVerboseMessage?.(`matrix: auto-unbinding ${record.conversationId} due to ${reason}`);
|
|
369
|
-
}
|
|
370
|
-
await persist();
|
|
371
|
-
await sendFarewellMessages(removed, (record) => reasonByBindingKey.get(resolveBindingKey(record)));
|
|
372
|
-
})().catch((err) => {
|
|
349
|
+
unbindRecords(expired.map(({ record }) => record), (record) => reasonByBindingKey.get(resolveBindingKey(record)), (record) => {
|
|
350
|
+
const reason = reasonByBindingKey.get(resolveBindingKey(record));
|
|
351
|
+
params.logVerboseMessage?.(`matrix: auto-unbinding ${record.conversationId} due to ${reason}`);
|
|
352
|
+
}).catch((err) => {
|
|
373
353
|
params.logVerboseMessage?.(`matrix: failed auto-unbinding expired bindings account=${params.accountId}: ${String(err)}`);
|
|
374
354
|
});
|
|
375
355
|
}, THREAD_BINDINGS_SWEEP_INTERVAL_MS);
|
package/dist/.setup/{thread-bindings-shared-hxKkYC1W.mjs → thread-bindings-shared-CbsFNbAY.mjs}
RENAMED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import { resolveThreadBindingLifecycle } from "openclaw/plugin-sdk/thread-bindings-session-runtime";
|
|
1
|
+
import { projectThreadBindingRecord, resolveThreadBindingLifecycle } from "openclaw/plugin-sdk/thread-bindings-session-runtime";
|
|
2
2
|
//#region extensions/matrix/src/matrix/thread-bindings-shared.ts
|
|
3
3
|
const MANAGERS_BY_ACCOUNT_ID = /* @__PURE__ */ new Map();
|
|
4
4
|
const BINDINGS_BY_ACCOUNT_CONVERSATION = /* @__PURE__ */ new Map();
|
|
5
5
|
function resolveBindingKey(params) {
|
|
6
6
|
return `${params.accountId}:${params.parentConversationId?.trim() || "-"}:${params.conversationId}`;
|
|
7
7
|
}
|
|
8
|
-
function toSessionBindingTargetKind(raw) {
|
|
9
|
-
return raw === "subagent" ? "subagent" : "session";
|
|
10
|
-
}
|
|
11
|
-
function toMatrixBindingTargetKind(raw) {
|
|
12
|
-
return raw === "subagent" ? "subagent" : "acp";
|
|
13
|
-
}
|
|
14
8
|
function toSessionBindingRecord(record, defaults) {
|
|
15
9
|
const lifecycle = resolveThreadBindingLifecycle({
|
|
16
10
|
record,
|
|
@@ -19,28 +13,20 @@ function toSessionBindingRecord(record, defaults) {
|
|
|
19
13
|
});
|
|
20
14
|
const idleTimeoutMs = typeof record.idleTimeoutMs === "number" ? record.idleTimeoutMs : defaults.idleTimeoutMs;
|
|
21
15
|
const maxAgeMs = typeof record.maxAgeMs === "number" ? record.maxAgeMs : defaults.maxAgeMs;
|
|
22
|
-
return {
|
|
23
|
-
bindingId: resolveBindingKey(record),
|
|
24
|
-
targetSessionKey: record.targetSessionKey,
|
|
25
|
-
targetKind: toSessionBindingTargetKind(record.targetKind),
|
|
16
|
+
return projectThreadBindingRecord(record, {
|
|
26
17
|
conversation: {
|
|
27
18
|
channel: "matrix",
|
|
28
|
-
accountId: record.accountId,
|
|
29
19
|
conversationId: record.conversationId,
|
|
30
20
|
parentConversationId: record.parentConversationId
|
|
31
21
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
agentId: record.agentId,
|
|
37
|
-
label: record.label,
|
|
38
|
-
boundBy: record.boundBy,
|
|
39
|
-
lastActivityAt: record.lastActivityAt,
|
|
22
|
+
bindingId: resolveBindingKey(record),
|
|
23
|
+
targetKind: record.targetKind === "subagent" ? "subagent" : "session",
|
|
24
|
+
lifecycle: {
|
|
25
|
+
...lifecycle,
|
|
40
26
|
idleTimeoutMs,
|
|
41
27
|
maxAgeMs
|
|
42
28
|
}
|
|
43
|
-
};
|
|
29
|
+
});
|
|
44
30
|
}
|
|
45
31
|
function setBindingRecord(record) {
|
|
46
32
|
BINDINGS_BY_ACCOUNT_CONVERSATION.set(resolveBindingKey(record), record);
|
|
@@ -69,21 +55,17 @@ function deleteMatrixThreadBindingManagerEntry(accountId) {
|
|
|
69
55
|
function getMatrixThreadBindingManager(accountId) {
|
|
70
56
|
return MANAGERS_BY_ACCOUNT_ID.get(accountId)?.manager ?? null;
|
|
71
57
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const manager = MANAGERS_BY_ACCOUNT_ID.get(params.accountId)?.manager;
|
|
82
|
-
if (!manager) return [];
|
|
83
|
-
return manager.setMaxAgeBySessionKey(params).map((record) => toSessionBindingRecord(record, {
|
|
84
|
-
idleTimeoutMs: manager.getIdleTimeoutMs(),
|
|
85
|
-
maxAgeMs: manager.getMaxAgeMs()
|
|
86
|
-
}));
|
|
58
|
+
function createMatrixThreadBindingTimeoutSetter(update) {
|
|
59
|
+
return (params) => {
|
|
60
|
+
const manager = MANAGERS_BY_ACCOUNT_ID.get(params.accountId)?.manager;
|
|
61
|
+
if (!manager) return [];
|
|
62
|
+
return update(manager, params).map((record) => toSessionBindingRecord(record, {
|
|
63
|
+
idleTimeoutMs: manager.getIdleTimeoutMs(),
|
|
64
|
+
maxAgeMs: manager.getMaxAgeMs()
|
|
65
|
+
}));
|
|
66
|
+
};
|
|
87
67
|
}
|
|
68
|
+
const setMatrixThreadBindingIdleTimeoutBySessionKey = createMatrixThreadBindingTimeoutSetter((manager, params) => manager.setIdleTimeoutBySessionKey(params));
|
|
69
|
+
const setMatrixThreadBindingMaxAgeBySessionKey = createMatrixThreadBindingTimeoutSetter((manager, params) => manager.setMaxAgeBySessionKey(params));
|
|
88
70
|
//#endregion
|
|
89
|
-
export { listBindingsForAccount as a, setBindingRecord as c, setMatrixThreadBindingMaxAgeBySessionKey as d,
|
|
71
|
+
export { listBindingsForAccount as a, setBindingRecord as c, setMatrixThreadBindingMaxAgeBySessionKey as d, toSessionBindingRecord as f, listAllBindings as i, setMatrixThreadBindingIdleTimeoutBySessionKey as l, getMatrixThreadBindingManager as n, removeBindingRecord as o, getMatrixThreadBindingManagerEntry as r, resolveBindingKey as s, deleteMatrixThreadBindingManagerEntry as t, setMatrixThreadBindingManagerEntry as u };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig } from "./account-config-CRsKoMqJ.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { o as resolveMatrixRoomConfig } from "./channel-
|
|
4
|
-
import {
|
|
2
|
+
import { g as resolveDefaultMatrixAccountId } from "./setup-core-CKnNTfgD.mjs";
|
|
3
|
+
import { o as resolveMatrixRoomConfig } from "./channel-BcwGspPw.mjs";
|
|
4
|
+
import { a as normalizeMatrixResolvableTarget } from "./target-ids-HhcaKX1n.mjs";
|
|
5
5
|
import { l as selectOwnMatrixReactionEventIds, s as buildMatrixReactionRelationsPath, u as summarizeMatrixReactionEvents } from "./send-currentness-C2rMVVIQ.mjs";
|
|
6
|
-
import { c as isStrictDirectMembership, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers } from "./direct-management-
|
|
7
|
-
import { C as resolveMatrixRoomId, n as reactMatrixMessage, p as buildPollResponseContent, v as isPollStartType, y as parsePollStart } from "./send-
|
|
8
|
-
import { i as parseMxc } from "./event-helpers-
|
|
9
|
-
import { a as sendMatrixMessage, c as EventType, i as readMatrixMessages, l as resolveMatrixActionLimit, n as editMatrixMessage, o as fetchEventSummary, r as readMatrixMessage, s as readPinnedEvents, t as deleteMatrixMessage } from "./messages-
|
|
10
|
-
import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-
|
|
11
|
-
import { t as applyMatrixProfileUpdate } from "./profile-update-
|
|
12
|
-
import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-
|
|
13
|
-
import { n as getMatrixMemberInfo, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-
|
|
6
|
+
import { c as isStrictDirectMembership, s as hasDirectMatrixMemberFlag, u as readJoinedMatrixMembers } from "./direct-management-B3wYhx_M.mjs";
|
|
7
|
+
import { C as resolveMatrixRoomId, n as reactMatrixMessage, p as buildPollResponseContent, v as isPollStartType, y as parsePollStart } from "./send-LCOuTVc1.mjs";
|
|
8
|
+
import { i as parseMxc } from "./event-helpers-CxNgMQqH.mjs";
|
|
9
|
+
import { a as sendMatrixMessage, c as EventType, i as readMatrixMessages, l as resolveMatrixActionLimit, n as editMatrixMessage, o as fetchEventSummary, r as readMatrixMessage, s as readPinnedEvents, t as deleteMatrixMessage } from "./messages-B1CZqU8u.mjs";
|
|
10
|
+
import { n as withResolvedActionClient, r as withResolvedRoomAction } from "./client-BlTvpEWC.mjs";
|
|
11
|
+
import { t as applyMatrixProfileUpdate } from "./profile-update-C7bjaGR6.mjs";
|
|
12
|
+
import { _ as scanMatrixVerificationQr, a as confirmMatrixVerificationSas, b as verifyMatrixRecoveryKey, c as getMatrixRoomKeyBackupStatus, d as listMatrixVerifications, f as mismatchMatrixVerificationSas, h as restoreMatrixRoomKeyBackup, i as confirmMatrixVerificationReciprocateQr, l as getMatrixVerificationSas, n as bootstrapMatrixVerification, o as generateMatrixVerificationQr, p as requestMatrixVerification, r as cancelMatrixVerification, s as getMatrixEncryptionStatus, t as acceptMatrixVerification, u as getMatrixVerificationStatus, v as startMatrixVerification } from "./verification-B3VswneT.mjs";
|
|
13
|
+
import { n as getMatrixMemberInfo, r as getMatrixRoomInfo, t as createMatrixRoomInfoResolver } from "./room-info-9Uqlpt1V.mjs";
|
|
14
14
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
15
|
-
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString,
|
|
15
|
+
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeUniqueTrimmedStringList, uniqueValues } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
16
16
|
import { ToolAuthorizationError, createActionGate, jsonResult, readPositiveIntegerParam, readReactionParams, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
17
17
|
import { timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
18
18
|
import { captureChannelReadAuthority } from "openclaw/plugin-sdk/fetch-runtime";
|
|
@@ -47,19 +47,16 @@ function normalizeOptionIndexes(indexes) {
|
|
|
47
47
|
const normalized = indexes.map((index) => Math.trunc(index)).filter((index) => Number.isFinite(index) && index > 0);
|
|
48
48
|
return uniqueValues(normalized);
|
|
49
49
|
}
|
|
50
|
-
function normalizeOptionIds(optionIds) {
|
|
51
|
-
return uniqueStrings(optionIds.map((optionId) => optionId.trim()).filter((optionId) => optionId.length > 0));
|
|
52
|
-
}
|
|
53
50
|
function resolveSelectedAnswerIds(params) {
|
|
54
51
|
const parsed = parsePollStart(params.pollContent);
|
|
55
52
|
if (!parsed) throw new Error("Matrix poll vote requires a valid poll start event.");
|
|
56
|
-
const selectedById =
|
|
53
|
+
const selectedById = normalizeUniqueTrimmedStringList(params.optionIds);
|
|
57
54
|
const selectedByIndex = normalizeOptionIndexes(params.optionIndexes ?? []).map((index) => {
|
|
58
55
|
const answer = parsed.answers[index - 1];
|
|
59
56
|
if (!answer) throw new Error(`Matrix poll option index ${index} is out of range for a poll with ${parsed.answers.length} options.`);
|
|
60
57
|
return answer.id;
|
|
61
58
|
});
|
|
62
|
-
const answerIds =
|
|
59
|
+
const answerIds = normalizeUniqueTrimmedStringList([...selectedById, ...selectedByIndex]);
|
|
63
60
|
if (answerIds.length === 0) throw new Error("Matrix poll vote requires at least one poll option id or index.");
|
|
64
61
|
if (answerIds.length > parsed.maxSelections) throw new Error(`Matrix poll allows at most ${parsed.maxSelections} selection${parsed.maxSelections === 1 ? "" : "s"}.`);
|
|
65
62
|
const answerMap = new Map(parsed.answers.map((answer) => [answer.id, answer.text]));
|
|
@@ -281,7 +278,9 @@ async function withAuthorizedMatrixReadTarget(params) {
|
|
|
281
278
|
const groupPolicy = account.config.allowlistOnly && resolvedGroupPolicy === "open" ? "allowlist" : resolvedGroupPolicy;
|
|
282
279
|
const dmPolicy = account.config.allowlistOnly ? account.config.dm?.policy === "disabled" ? "disabled" : "allowlist" : account.config.dm?.policy ?? "pairing";
|
|
283
280
|
const directOperator = params.context?.conversationReadOrigin === "direct-operator";
|
|
284
|
-
|
|
281
|
+
const dmEnabled = account.config.dm?.enabled !== false && dmPolicy !== "disabled";
|
|
282
|
+
const groupEnabled = groupPolicy !== "disabled";
|
|
283
|
+
if (!(!finalPolicy.blocked && (classification.kind === "direct" ? dmEnabled && (directOperator || current || includesEntry(account.config.dm?.allowFrom, classification.remoteUserId)) : classification.kind === "group" ? groupEnabled && (directOperator || current || groupPolicy === "open" || room.config !== void 0) : groupEnabled && dmEnabled && (directOperator || current || groupPolicy === "open" && hasWildcardEntry(account.config.dm?.allowFrom))))) throw new ToolAuthorizationError("Matrix read target is not allowed.");
|
|
285
284
|
return await params.run({
|
|
286
285
|
client,
|
|
287
286
|
roomId
|