@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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Guid, parseWindowsGuid } from 'win-guid';
|
|
2
2
|
/**
|
|
3
3
|
* Ref:
|
|
4
4
|
* - https://tools.ietf.org/html/draft-fleischman-asf-01, Appendix A: ASF GUIDs
|
|
@@ -33,12 +33,18 @@ class AsfGuid {
|
|
|
33
33
|
*/
|
|
34
34
|
static decodeMediaType(mediaType) {
|
|
35
35
|
switch (mediaType.str) {
|
|
36
|
-
case AsfGuid.AudioMedia.str:
|
|
37
|
-
|
|
38
|
-
case AsfGuid.
|
|
39
|
-
|
|
40
|
-
case AsfGuid.
|
|
41
|
-
|
|
36
|
+
case AsfGuid.AudioMedia.str:
|
|
37
|
+
return 'audio';
|
|
38
|
+
case AsfGuid.VideoMedia.str:
|
|
39
|
+
return 'video';
|
|
40
|
+
case AsfGuid.CommandMedia.str:
|
|
41
|
+
return 'command';
|
|
42
|
+
case AsfGuid.Degradable_JPEG_Media.str:
|
|
43
|
+
return 'degradable-jpeg';
|
|
44
|
+
case AsfGuid.FileTransferMedia.str:
|
|
45
|
+
return 'file-transfer';
|
|
46
|
+
case AsfGuid.BinaryMedia.str:
|
|
47
|
+
return 'binary';
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
/**
|
|
@@ -60,50 +66,50 @@ class AsfGuid {
|
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
// 10.1 Top-level ASF object GUIDs
|
|
63
|
-
AsfGuid.HeaderObject = new AsfGuid(
|
|
64
|
-
AsfGuid.DataObject = new AsfGuid(
|
|
65
|
-
AsfGuid.SimpleIndexObject = new AsfGuid(
|
|
66
|
-
AsfGuid.IndexObject = new AsfGuid(
|
|
67
|
-
AsfGuid.MediaObjectIndexObject = new AsfGuid(
|
|
68
|
-
AsfGuid.TimecodeIndexObject = new AsfGuid(
|
|
69
|
+
AsfGuid.HeaderObject = new AsfGuid('75B22630-668E-11CF-A6D9-00AA0062CE6C');
|
|
70
|
+
AsfGuid.DataObject = new AsfGuid('75B22636-668E-11CF-A6D9-00AA0062CE6C');
|
|
71
|
+
AsfGuid.SimpleIndexObject = new AsfGuid('33000890-E5B1-11CF-89F4-00A0C90349CB');
|
|
72
|
+
AsfGuid.IndexObject = new AsfGuid('D6E229D3-35DA-11D1-9034-00A0C90349BE');
|
|
73
|
+
AsfGuid.MediaObjectIndexObject = new AsfGuid('FEB103F8-12AD-4C64-840F-2A1D2F7AD48C');
|
|
74
|
+
AsfGuid.TimecodeIndexObject = new AsfGuid('3CB73FD0-0C4A-4803-953D-EDF7B6228F0C');
|
|
69
75
|
// 10.2 Header Object GUIDs
|
|
70
|
-
AsfGuid.FilePropertiesObject = new AsfGuid(
|
|
71
|
-
AsfGuid.StreamPropertiesObject = new AsfGuid(
|
|
72
|
-
AsfGuid.HeaderExtensionObject = new AsfGuid(
|
|
73
|
-
AsfGuid.CodecListObject = new AsfGuid(
|
|
74
|
-
AsfGuid.ScriptCommandObject = new AsfGuid(
|
|
75
|
-
AsfGuid.MarkerObject = new AsfGuid(
|
|
76
|
-
AsfGuid.BitrateMutualExclusionObject = new AsfGuid(
|
|
77
|
-
AsfGuid.ErrorCorrectionObject = new AsfGuid(
|
|
78
|
-
AsfGuid.ContentDescriptionObject = new AsfGuid(
|
|
79
|
-
AsfGuid.ExtendedContentDescriptionObject = new AsfGuid(
|
|
80
|
-
AsfGuid.ContentBrandingObject = new AsfGuid(
|
|
81
|
-
AsfGuid.StreamBitratePropertiesObject = new AsfGuid(
|
|
82
|
-
AsfGuid.ContentEncryptionObject = new AsfGuid(
|
|
83
|
-
AsfGuid.ExtendedContentEncryptionObject = new AsfGuid(
|
|
84
|
-
AsfGuid.DigitalSignatureObject = new AsfGuid(
|
|
85
|
-
AsfGuid.PaddingObject = new AsfGuid(
|
|
76
|
+
AsfGuid.FilePropertiesObject = new AsfGuid('8CABDCA1-A947-11CF-8EE4-00C00C205365');
|
|
77
|
+
AsfGuid.StreamPropertiesObject = new AsfGuid('B7DC0791-A9B7-11CF-8EE6-00C00C205365');
|
|
78
|
+
AsfGuid.HeaderExtensionObject = new AsfGuid('5FBF03B5-A92E-11CF-8EE3-00C00C205365');
|
|
79
|
+
AsfGuid.CodecListObject = new AsfGuid('86D15240-311D-11D0-A3A4-00A0C90348F6');
|
|
80
|
+
AsfGuid.ScriptCommandObject = new AsfGuid('1EFB1A30-0B62-11D0-A39B-00A0C90348F6');
|
|
81
|
+
AsfGuid.MarkerObject = new AsfGuid('F487CD01-A951-11CF-8EE6-00C00C205365');
|
|
82
|
+
AsfGuid.BitrateMutualExclusionObject = new AsfGuid('D6E229DC-35DA-11D1-9034-00A0C90349BE');
|
|
83
|
+
AsfGuid.ErrorCorrectionObject = new AsfGuid('75B22635-668E-11CF-A6D9-00AA0062CE6C');
|
|
84
|
+
AsfGuid.ContentDescriptionObject = new AsfGuid('75B22633-668E-11CF-A6D9-00AA0062CE6C');
|
|
85
|
+
AsfGuid.ExtendedContentDescriptionObject = new AsfGuid('D2D0A440-E307-11D2-97F0-00A0C95EA850');
|
|
86
|
+
AsfGuid.ContentBrandingObject = new AsfGuid('2211B3FA-BD23-11D2-B4B7-00A0C955FC6E');
|
|
87
|
+
AsfGuid.StreamBitratePropertiesObject = new AsfGuid('7BF875CE-468D-11D1-8D82-006097C9A2B2');
|
|
88
|
+
AsfGuid.ContentEncryptionObject = new AsfGuid('2211B3FB-BD23-11D2-B4B7-00A0C955FC6E');
|
|
89
|
+
AsfGuid.ExtendedContentEncryptionObject = new AsfGuid('298AE614-2622-4C17-B935-DAE07EE9289C');
|
|
90
|
+
AsfGuid.DigitalSignatureObject = new AsfGuid('2211B3FC-BD23-11D2-B4B7-00A0C955FC6E');
|
|
91
|
+
AsfGuid.PaddingObject = new AsfGuid('1806D474-CADF-4509-A4BA-9AABCB96AAE8');
|
|
86
92
|
// 10.3 Header Extension Object GUIDs
|
|
87
|
-
AsfGuid.ExtendedStreamPropertiesObject = new AsfGuid(
|
|
88
|
-
AsfGuid.AdvancedMutualExclusionObject = new AsfGuid(
|
|
89
|
-
AsfGuid.GroupMutualExclusionObject = new AsfGuid(
|
|
90
|
-
AsfGuid.StreamPrioritizationObject = new AsfGuid(
|
|
91
|
-
AsfGuid.BandwidthSharingObject = new AsfGuid(
|
|
92
|
-
AsfGuid.LanguageListObject = new AsfGuid(
|
|
93
|
-
AsfGuid.MetadataObject = new AsfGuid(
|
|
94
|
-
AsfGuid.MetadataLibraryObject = new AsfGuid(
|
|
95
|
-
AsfGuid.IndexParametersObject = new AsfGuid(
|
|
96
|
-
AsfGuid.MediaObjectIndexParametersObject = new AsfGuid(
|
|
97
|
-
AsfGuid.TimecodeIndexParametersObject = new AsfGuid(
|
|
98
|
-
AsfGuid.CompatibilityObject = new AsfGuid(
|
|
99
|
-
AsfGuid.AdvancedContentEncryptionObject = new AsfGuid(
|
|
93
|
+
AsfGuid.ExtendedStreamPropertiesObject = new AsfGuid('14E6A5CB-C672-4332-8399-A96952065B5A');
|
|
94
|
+
AsfGuid.AdvancedMutualExclusionObject = new AsfGuid('A08649CF-4775-4670-8A16-6E35357566CD');
|
|
95
|
+
AsfGuid.GroupMutualExclusionObject = new AsfGuid('D1465A40-5A79-4338-B71B-E36B8FD6C249');
|
|
96
|
+
AsfGuid.StreamPrioritizationObject = new AsfGuid('D4FED15B-88D3-454F-81F0-ED5C45999E24');
|
|
97
|
+
AsfGuid.BandwidthSharingObject = new AsfGuid('A69609E6-517B-11D2-B6AF-00C04FD908E9');
|
|
98
|
+
AsfGuid.LanguageListObject = new AsfGuid('7C4346A9-EFE0-4BFC-B229-393EDE415C85');
|
|
99
|
+
AsfGuid.MetadataObject = new AsfGuid('C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA');
|
|
100
|
+
AsfGuid.MetadataLibraryObject = new AsfGuid('44231C94-9498-49D1-A141-1D134E457054');
|
|
101
|
+
AsfGuid.IndexParametersObject = new AsfGuid('D6E229DF-35DA-11D1-9034-00A0C90349BE');
|
|
102
|
+
AsfGuid.MediaObjectIndexParametersObject = new AsfGuid('6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7');
|
|
103
|
+
AsfGuid.TimecodeIndexParametersObject = new AsfGuid('F55E496D-9797-4B5D-8C8B-604DFE9BFB24');
|
|
104
|
+
AsfGuid.CompatibilityObject = new AsfGuid('26F18B5D-4584-47EC-9F5F-0E651F0452C9');
|
|
105
|
+
AsfGuid.AdvancedContentEncryptionObject = new AsfGuid('43058533-6981-49E6-9B74-AD12CB86D58C');
|
|
100
106
|
// 10.4 Stream Properties Object Stream Type GUIDs
|
|
101
|
-
AsfGuid.AudioMedia = new AsfGuid(
|
|
102
|
-
AsfGuid.VideoMedia = new AsfGuid(
|
|
103
|
-
AsfGuid.CommandMedia = new AsfGuid(
|
|
104
|
-
AsfGuid.JFIF_Media = new AsfGuid(
|
|
105
|
-
AsfGuid.Degradable_JPEG_Media = new AsfGuid(
|
|
106
|
-
AsfGuid.FileTransferMedia = new AsfGuid(
|
|
107
|
-
AsfGuid.BinaryMedia = new AsfGuid(
|
|
108
|
-
AsfGuid.ASF_Index_Placeholder_Object = new AsfGuid(
|
|
107
|
+
AsfGuid.AudioMedia = new AsfGuid('F8699E40-5B4D-11CF-A8FD-00805F5C442B');
|
|
108
|
+
AsfGuid.VideoMedia = new AsfGuid('BC19EFC0-5B4D-11CF-A8FD-00805F5C442B');
|
|
109
|
+
AsfGuid.CommandMedia = new AsfGuid('59DACFC0-59E6-11D0-A3AC-00A0C90348F6');
|
|
110
|
+
AsfGuid.JFIF_Media = new AsfGuid('B61BE100-5B4E-11CF-A8FD-00805F5C442B');
|
|
111
|
+
AsfGuid.Degradable_JPEG_Media = new AsfGuid('35907DE0-E415-11CF-A917-00805F5C442B');
|
|
112
|
+
AsfGuid.FileTransferMedia = new AsfGuid('91BD222C-F21C-497A-8B6D-5AA86BFC0185');
|
|
113
|
+
AsfGuid.BinaryMedia = new AsfGuid('3AFB65E2-47EF-40F2-AC2C-70A90D71D343');
|
|
114
|
+
AsfGuid.ASF_Index_Placeholder_Object = new AsfGuid('D9AADE20-7C17-4F9C-BC28-8555DD98E2A2');
|
|
109
115
|
export default AsfGuid;
|
|
@@ -44,7 +44,7 @@ export declare const DataType: {
|
|
|
44
44
|
*/
|
|
45
45
|
Word: number;
|
|
46
46
|
};
|
|
47
|
-
export type DataType = typeof DataType[keyof typeof DataType];
|
|
47
|
+
export type DataType = (typeof DataType)[keyof typeof DataType];
|
|
48
48
|
/**
|
|
49
49
|
* Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/ee663575
|
|
50
50
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// ASF Objects
|
|
2
2
|
import * as Token from 'token-types';
|
|
3
3
|
import * as util from '../common/Util.js';
|
|
4
|
-
import AsfGuid from './AsfGuid.js';
|
|
5
|
-
import { getParserForAttr, parseUnicodeAttr } from './AsfUtil.js';
|
|
6
4
|
import { AttachedPictureType } from '../id3v2/ID3v2Token.js';
|
|
7
5
|
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
6
|
+
import AsfGuid from './AsfGuid.js';
|
|
7
|
+
import { getParserForAttr, parseUnicodeAttr } from './AsfUtil.js';
|
|
8
8
|
export class AsfContentParseError extends makeUnexpectedFileContentError('ASF') {
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
@@ -300,6 +300,7 @@ export class ExtendedStreamPropertiesObjectState extends State {
|
|
|
300
300
|
alternateInitialBufferFullness: view.getInt32(32, true),
|
|
301
301
|
maximumObjectSize: view.getInt32(36, true),
|
|
302
302
|
flags: {
|
|
303
|
+
// ToDo, check flag positions
|
|
303
304
|
reliableFlag: util.getBit(buf, off + 40, 0),
|
|
304
305
|
seekableFlag: util.getBit(buf, off + 40, 1),
|
|
305
306
|
resendLiveCleanpointsFlag: util.getBit(buf, off + 40, 2)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import initDebug from 'debug';
|
|
2
2
|
import { EndOfStreamError } from 'strtok3';
|
|
3
|
+
import { BasicParser } from '../common/BasicParser.js';
|
|
3
4
|
import { TrackType } from '../type.js';
|
|
4
5
|
import AsfGuid from './AsfGuid.js';
|
|
5
6
|
import * as AsfObject from './AsfObject.js';
|
|
6
|
-
import { BasicParser } from '../common/BasicParser.js';
|
|
7
7
|
import { AsfContentParseError } from './AsfObject.js';
|
|
8
8
|
const debug = initDebug('music-metadata:parser:ASF');
|
|
9
9
|
const headerType = 'asf';
|
|
@@ -36,20 +36,23 @@ export class AsfParser extends BasicParser {
|
|
|
36
36
|
// Parse data part of the ASF Object
|
|
37
37
|
debug('header GUID=%s', header.objectId.str);
|
|
38
38
|
switch (header.objectId.str) {
|
|
39
|
-
case AsfObject.FilePropertiesObject.guid.str: {
|
|
39
|
+
case AsfObject.FilePropertiesObject.guid.str: {
|
|
40
|
+
// 3.2
|
|
40
41
|
this.validateAllocationSize(payloadSize, 'File Properties Object');
|
|
41
42
|
const fpo = await this.tokenizer.readToken(new AsfObject.FilePropertiesObject(header));
|
|
42
43
|
this.metadata.setFormat('duration', Number(fpo.playDuration / BigInt(1000)) / 10000 - Number(fpo.preroll) / 1000);
|
|
43
44
|
this.metadata.setFormat('bitrate', fpo.maximumBitrate);
|
|
44
45
|
break;
|
|
45
46
|
}
|
|
46
|
-
case AsfObject.StreamPropertiesObject.guid.str: {
|
|
47
|
+
case AsfObject.StreamPropertiesObject.guid.str: {
|
|
48
|
+
// 3.3
|
|
47
49
|
this.validateAllocationSize(payloadSize, 'Stream Properties Object');
|
|
48
50
|
const spo = await this.tokenizer.readToken(new AsfObject.StreamPropertiesObject(header));
|
|
49
51
|
this.metadata.setFormat('container', `ASF/${spo.streamType}`);
|
|
50
52
|
break;
|
|
51
53
|
}
|
|
52
|
-
case AsfObject.HeaderExtensionObject.guid.str: {
|
|
54
|
+
case AsfObject.HeaderExtensionObject.guid.str: {
|
|
55
|
+
// 3.4
|
|
53
56
|
const extensionHeaderToken = new AsfObject.HeaderExtensionObject();
|
|
54
57
|
if (payloadSize < extensionHeaderToken.len) {
|
|
55
58
|
throw new AsfContentParseError(`ASF Header Extension Object payload is too small: ${payloadSize} bytes`);
|
|
@@ -88,7 +91,10 @@ export class AsfParser extends BasicParser {
|
|
|
88
91
|
codecName: codec.codecName
|
|
89
92
|
});
|
|
90
93
|
});
|
|
91
|
-
const audioCodecs = codecs
|
|
94
|
+
const audioCodecs = codecs
|
|
95
|
+
.filter(codec => codec.type.audioCodec)
|
|
96
|
+
.map(codec => codec.codecName)
|
|
97
|
+
.join('/');
|
|
92
98
|
this.metadata.setFormat('codec', audioCodecs);
|
|
93
99
|
break;
|
|
94
100
|
}
|
|
@@ -169,13 +175,15 @@ export class AsfParser extends BasicParser {
|
|
|
169
175
|
this.validateAllocationSize(payloadSize, 'Extended Stream Properties Object');
|
|
170
176
|
await this.tokenizer.readToken(new AsfObject.ExtendedStreamPropertiesObjectState(header));
|
|
171
177
|
break;
|
|
172
|
-
case AsfObject.MetadataObjectState.guid.str: {
|
|
178
|
+
case AsfObject.MetadataObjectState.guid.str: {
|
|
179
|
+
// 4.7
|
|
173
180
|
this.validateAllocationSize(payloadSize, 'Metadata Object');
|
|
174
181
|
const moTags = await this.tokenizer.readToken(new AsfObject.MetadataObjectState(header));
|
|
175
182
|
await this.addTags(moTags);
|
|
176
183
|
break;
|
|
177
184
|
}
|
|
178
|
-
case AsfObject.MetadataLibraryObjectState.guid.str: {
|
|
185
|
+
case AsfObject.MetadataLibraryObjectState.guid.str: {
|
|
186
|
+
// 4.8
|
|
179
187
|
this.validateAllocationSize(payloadSize, 'Metadata Library Object');
|
|
180
188
|
const mlTags = await this.tokenizer.readToken(new AsfObject.MetadataLibraryObjectState(header));
|
|
181
189
|
await this.addTags(mlTags);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CommonTagMapper } from '../common/GenericTagMapper.js';
|
|
2
|
+
import type { IWarningCollector } from '../common/MetadataCollector.js';
|
|
2
3
|
import type { IRating, ITag } from '../type.js';
|
|
3
4
|
export declare class AsfTagMapper extends CommonTagMapper {
|
|
4
|
-
static toRating(rating: string): IRating;
|
|
5
|
+
static toRating(rating: string | number): IRating;
|
|
5
6
|
constructor();
|
|
6
|
-
protected postMap(tag: ITag): void;
|
|
7
|
+
protected postMap(tag: ITag, warnings: IWarningCollector): void;
|
|
7
8
|
}
|
|
@@ -36,6 +36,7 @@ const asfTagMap = {
|
|
|
36
36
|
// 'WM/PartOfSet': 'totaldiscs',
|
|
37
37
|
'WM/IsCompilation': 'compilation',
|
|
38
38
|
'WM/SharedUserRating': 'rating',
|
|
39
|
+
POPULARIMETER: 'rating',
|
|
39
40
|
'WM/BeatsPerMinute': 'bpm',
|
|
40
41
|
'WM/Mood': 'mood',
|
|
41
42
|
'WM/Media': 'media',
|
|
@@ -72,15 +73,31 @@ const asfTagMap = {
|
|
|
72
73
|
};
|
|
73
74
|
export class AsfTagMapper extends CommonTagMapper {
|
|
74
75
|
static toRating(rating) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
const value = typeof rating === 'number' ? rating : Number.parseFloat(rating);
|
|
77
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
78
|
+
return { rating: undefined };
|
|
79
|
+
}
|
|
80
|
+
return { rating: value / 99 };
|
|
78
81
|
}
|
|
79
82
|
constructor() {
|
|
80
83
|
super(['asf'], asfTagMap);
|
|
81
84
|
}
|
|
82
|
-
postMap(tag) {
|
|
85
|
+
postMap(tag, warnings) {
|
|
83
86
|
switch (tag.id) {
|
|
87
|
+
case 'POPULARIMETER': {
|
|
88
|
+
// popm-style attribute, written by e.g. foobar2000; value is "email|rating|counter"
|
|
89
|
+
const [email, rating] = tag.value.split('|');
|
|
90
|
+
const value = Number(rating);
|
|
91
|
+
const valid = /^\d+$/.test(rating) && Number.isInteger(value) && value >= 0 && value <= 255;
|
|
92
|
+
if (!valid) {
|
|
93
|
+
warnings.addWarning(`Invalid ASF POPULARIMETER rating: ${rating}`);
|
|
94
|
+
}
|
|
95
|
+
tag.value = {
|
|
96
|
+
source: email,
|
|
97
|
+
rating: valid && value > 0 ? ((value - 1) / 254) * CommonTagMapper.maxRatingScore : undefined
|
|
98
|
+
};
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
84
101
|
case 'WM/SharedUserRating': {
|
|
85
102
|
const keys = tag.id.split(':');
|
|
86
103
|
tag.value = AsfTagMapper.toRating(tag.value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { INativeTagMap, TagType } from './GenericTagTypes.js';
|
|
2
1
|
import { CommonTagMapper } from './GenericTagMapper.js';
|
|
2
|
+
import type { INativeTagMap, TagType } from './GenericTagTypes.js';
|
|
3
3
|
export declare class CaseInsensitiveTagMap extends CommonTagMapper {
|
|
4
4
|
constructor(tagTypes: TagType[], tagMap: INativeTagMap);
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IGenericTag, TagType } from './GenericTagTypes.js';
|
|
2
|
-
import type { IGenericTagMapper } from './GenericTagMapper.js';
|
|
3
1
|
import type { ITag } from '../type.js';
|
|
2
|
+
import type { IGenericTagMapper } from './GenericTagMapper.js';
|
|
3
|
+
import type { IGenericTag, TagType } from './GenericTagTypes.js';
|
|
4
4
|
import type { INativeMetadataCollector } from './MetadataCollector.js';
|
|
5
5
|
export declare class CombinedTagMapper {
|
|
6
6
|
tagMappers: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AiffTagMapper } from '../aiff/AiffTagMap.js';
|
|
2
|
+
import { APEv2TagMapper } from '../apev2/APEv2TagMapper.js';
|
|
3
3
|
import { AsfTagMapper } from '../asf/AsfTagMapper.js';
|
|
4
|
+
import { ID3v1TagMapper } from '../id3v1/ID3v1TagMap.js';
|
|
4
5
|
import { ID3v22TagMapper } from '../id3v2/ID3v22TagMapper.js';
|
|
5
|
-
import {
|
|
6
|
+
import { ID3v24TagMapper } from '../id3v2/ID3v24TagMapper.js';
|
|
7
|
+
import { MatroskaTagMapper } from '../matroska/MatroskaTagMapper.js';
|
|
6
8
|
import { MP4TagMapper } from '../mp4/MP4TagMapper.js';
|
|
7
9
|
import { VorbisTagMapper } from '../ogg/vorbis/VorbisTagMapper.js';
|
|
8
|
-
import { RiffInfoTagMapper } from '../riff/RiffInfoTagMap.js';
|
|
9
|
-
import { MatroskaTagMapper } from '../matroska/MatroskaTagMapper.js';
|
|
10
|
-
import { AiffTagMapper } from '../aiff/AiffTagMap.js';
|
|
11
10
|
import { InternalParserError } from '../ParseError.js';
|
|
11
|
+
import { RiffInfoTagMapper } from '../riff/RiffInfoTagMap.js';
|
|
12
12
|
export class CombinedTagMapper {
|
|
13
13
|
constructor() {
|
|
14
14
|
this.tagMappers = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { textDecode, textEncode } from '@borewit/text-codec';
|
|
2
|
+
import { FieldDecodingError, InternalParserError } from '../ParseError.js';
|
|
2
3
|
import * as util from './Util.js';
|
|
3
|
-
import { InternalParserError, FieldDecodingError } from '../ParseError.js';
|
|
4
4
|
const validFourCC = /^[\x21-\x7e©][\x20-\x7e\x00()]{3}/;
|
|
5
5
|
/**
|
|
6
6
|
* Token for read FourCC
|
|
@@ -17,8 +17,9 @@ export const FourCcToken = {
|
|
|
17
17
|
},
|
|
18
18
|
put: (buffer, offset, id) => {
|
|
19
19
|
const str = textEncode(id, 'latin1');
|
|
20
|
-
if (str.length !== 4)
|
|
20
|
+
if (str.length !== 4) {
|
|
21
21
|
throw new InternalParserError('Invalid length');
|
|
22
|
+
}
|
|
22
23
|
buffer.set(str, offset);
|
|
23
24
|
return offset + 4;
|
|
24
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type * as generic from './GenericTagTypes.js';
|
|
2
1
|
import type { ITag } from '../type.js';
|
|
2
|
+
import type * as generic from './GenericTagTypes.js';
|
|
3
3
|
import type { INativeMetadataCollector, IWarningCollector } from './MetadataCollector.js';
|
|
4
4
|
export interface IGenericTagMapper {
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FormatId, type IAudioMetadata, type ICommonTagsResult, type IFormat, type INativeTags, type IOptions, type IQualityInformation, type ITrackInfo
|
|
1
|
+
import { type AnyTagValue, type FormatId, type IAudioMetadata, type ICommonTagsResult, type IFormat, type INativeTags, type IOptions, type IQualityInformation, type ITrackInfo } from '../type.js';
|
|
2
2
|
import { type IGenericTag, type TagType } from './GenericTagTypes.js';
|
|
3
3
|
/**
|
|
4
4
|
* Combines all generic-tag-mappers for each tag type
|
|
@@ -22,6 +22,7 @@ export interface INativeMetadataCollector extends IWarningCollector {
|
|
|
22
22
|
*/
|
|
23
23
|
hasAny(): boolean;
|
|
24
24
|
setFormat(key: FormatId, value: AnyTagValue): void;
|
|
25
|
+
registerTagType(tagType: TagType): void;
|
|
25
26
|
addTag(tagType: TagType, tagId: string, value: AnyTagValue): Promise<void>;
|
|
26
27
|
addStreamInfo(streamInfo: ITrackInfo): void;
|
|
27
28
|
setAudioOnly(): void;
|
|
@@ -53,6 +54,7 @@ export declare class MetadataCollector implements INativeMetadataCollector {
|
|
|
53
54
|
addStreamInfo(streamInfo: ITrackInfo): void;
|
|
54
55
|
setFormat(key: FormatId, value: AnyTagValue): void;
|
|
55
56
|
setAudioOnly(): void;
|
|
57
|
+
registerTagType(tagType: TagType): void;
|
|
56
58
|
addTag(tagType: TagType, tagId: string, value: AnyTagValue): Promise<void>;
|
|
57
59
|
addWarning(warning: string): void;
|
|
58
60
|
postMap(tagType: TagType | 'artificial', tag: IGenericTag): Promise<void>;
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import { TrackTypeValueToKeyMap, } from '../type.js';
|
|
2
1
|
import initDebug from 'debug';
|
|
3
|
-
import {
|
|
2
|
+
import { fileTypeFromBuffer } from 'file-type';
|
|
3
|
+
import { parseLyrics } from '../lrc/LyricsParser.js';
|
|
4
|
+
import { TrackTypeValueToKeyMap } from '../type.js';
|
|
4
5
|
import { CombinedTagMapper } from './CombinedTagMapper.js';
|
|
5
6
|
import { CommonTagMapper } from './GenericTagMapper.js';
|
|
7
|
+
import { isSingleton, isUnique } from './GenericTagTypes.js';
|
|
6
8
|
import { toRatio } from './Util.js';
|
|
7
|
-
import { fileTypeFromBuffer } from 'file-type';
|
|
8
|
-
import { parseLyrics } from '../lrc/LyricsParser.js';
|
|
9
9
|
const debug = initDebug('music-metadata:collector');
|
|
10
|
-
const TagPriority = [
|
|
10
|
+
const TagPriority = [
|
|
11
|
+
'matroska',
|
|
12
|
+
'APEv2',
|
|
13
|
+
'vorbis',
|
|
14
|
+
'ID3v2.4',
|
|
15
|
+
'ID3v2.3',
|
|
16
|
+
'ID3v2.2',
|
|
17
|
+
'exif',
|
|
18
|
+
'asf',
|
|
19
|
+
'iTunes',
|
|
20
|
+
'AIFF',
|
|
21
|
+
'ID3v1'
|
|
22
|
+
];
|
|
11
23
|
/**
|
|
12
24
|
* Provided to the parser to uodate the metadata result.
|
|
13
25
|
* Responsible for triggering async updates
|
|
@@ -65,10 +77,15 @@ export class MetadataCollector {
|
|
|
65
77
|
this.setFormat('hasAudio', true);
|
|
66
78
|
this.setFormat('hasVideo', false);
|
|
67
79
|
}
|
|
80
|
+
registerTagType(tagType) {
|
|
81
|
+
if (!this.format.tagTypes.includes(tagType)) {
|
|
82
|
+
this.format.tagTypes.push(tagType);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
68
85
|
async addTag(tagType, tagId, value) {
|
|
69
86
|
debug(`tag ${tagType}.${tagId} = ${value}`);
|
|
70
87
|
if (!this.native[tagType]) {
|
|
71
|
-
this.
|
|
88
|
+
this.registerTagType(tagType);
|
|
72
89
|
this.native[tagType] = [];
|
|
73
90
|
}
|
|
74
91
|
this.native[tagType].push({ id: tagId, value });
|
|
@@ -158,10 +175,12 @@ export class MetadataCollector {
|
|
|
158
175
|
case 'showMovement':
|
|
159
176
|
tag.value = tag.value === '1' || tag.value === 1; // boolean
|
|
160
177
|
break;
|
|
161
|
-
case 'isrc': {
|
|
178
|
+
case 'isrc': {
|
|
179
|
+
// Only keep unique values
|
|
162
180
|
const commonTag = this.common[tag.id];
|
|
163
|
-
if (commonTag && commonTag.indexOf(tag.value) !== -1)
|
|
181
|
+
if (commonTag && commonTag.indexOf(tag.value) !== -1) {
|
|
164
182
|
return;
|
|
183
|
+
}
|
|
165
184
|
break;
|
|
166
185
|
}
|
|
167
186
|
case 'comment':
|
|
@@ -246,7 +265,7 @@ export class MetadataCollector {
|
|
|
246
265
|
}
|
|
247
266
|
return picture;
|
|
248
267
|
}
|
|
249
|
-
this.addWarning(
|
|
268
|
+
this.addWarning('Empty picture tag found');
|
|
250
269
|
return null;
|
|
251
270
|
}
|
|
252
271
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StringType } from 'token-types';
|
|
2
|
-
import { FieldDecodingError } from '../ParseError.js';
|
|
3
2
|
import { getUintBE } from 'uint8array-extras';
|
|
3
|
+
import { FieldDecodingError } from '../ParseError.js';
|
|
4
4
|
export function getBit(buf, off, bit) {
|
|
5
5
|
return (buf[off] & (1 << bit)) !== 0;
|
|
6
6
|
}
|
|
@@ -15,15 +15,17 @@ export function findZero(uint8Array, encoding) {
|
|
|
15
15
|
if (encoding === 'utf-16le' || encoding === 'utf-16be') {
|
|
16
16
|
// Look for 0x00 0x00 on 2-byte boundary
|
|
17
17
|
for (let i = 0; i + 1 < len; i += 2) {
|
|
18
|
-
if (uint8Array[i] === 0 && uint8Array[i + 1] === 0)
|
|
18
|
+
if (uint8Array[i] === 0 && uint8Array[i + 1] === 0) {
|
|
19
19
|
return i;
|
|
20
|
+
}
|
|
20
21
|
}
|
|
21
22
|
return len;
|
|
22
23
|
}
|
|
23
24
|
// latin1 / utf8 / utf16be (caller typically handles utf16be separately or via decode)
|
|
24
25
|
for (let i = 0; i < len; i++) {
|
|
25
|
-
if (uint8Array[i] === 0)
|
|
26
|
+
if (uint8Array[i] === 0) {
|
|
26
27
|
return i;
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
30
|
return len;
|
|
29
31
|
}
|
|
@@ -33,8 +35,9 @@ export function trimRightNull(x) {
|
|
|
33
35
|
}
|
|
34
36
|
function swapBytes(uint8Array) {
|
|
35
37
|
const l = uint8Array.length;
|
|
36
|
-
if ((l & 1) !== 0)
|
|
38
|
+
if ((l & 1) !== 0) {
|
|
37
39
|
throw new FieldDecodingError('Buffer length must be even');
|
|
40
|
+
}
|
|
38
41
|
for (let i = 0; i < l; i += 2) {
|
|
39
42
|
const a = uint8Array[i];
|
|
40
43
|
uint8Array[i] = uint8Array[i + 1];
|
|
@@ -48,19 +51,22 @@ function swapBytes(uint8Array) {
|
|
|
48
51
|
export function decodeString(uint8Array, encoding) {
|
|
49
52
|
// annoying workaround for a double BOM issue
|
|
50
53
|
// https://github.com/leetreveil/musicmetadata/issues/84
|
|
51
|
-
if (uint8Array[0] ===
|
|
54
|
+
if (uint8Array[0] === 0xff && uint8Array[1] === 0xfe) {
|
|
55
|
+
// little endian
|
|
52
56
|
return decodeString(uint8Array.subarray(2), encoding);
|
|
53
57
|
}
|
|
54
|
-
if (encoding === 'utf-16le' && uint8Array[0] ===
|
|
58
|
+
if (encoding === 'utf-16le' && uint8Array[0] === 0xfe && uint8Array[1] === 0xff) {
|
|
55
59
|
// BOM, indicating big endian decoding
|
|
56
|
-
if ((uint8Array.length & 1) !== 0)
|
|
60
|
+
if ((uint8Array.length & 1) !== 0) {
|
|
57
61
|
throw new FieldDecodingError('Expected even number of octets for 16-bit unicode string');
|
|
62
|
+
}
|
|
58
63
|
return decodeString(swapBytes(uint8Array), encoding);
|
|
59
64
|
}
|
|
60
65
|
if (encoding === 'utf-16be') {
|
|
61
66
|
// There is no native UTF-16BE decoder; swap to UTF-16LE and decode that.
|
|
62
|
-
if ((uint8Array.length & 1) !== 0)
|
|
67
|
+
if ((uint8Array.length & 1) !== 0) {
|
|
63
68
|
throw new FieldDecodingError('Expected even number of octets for 16-bit unicode string');
|
|
69
|
+
}
|
|
64
70
|
return new StringType(uint8Array.length, 'utf-16le').get(swapBytes(Uint8Array.from(uint8Array)), 0);
|
|
65
71
|
}
|
|
66
72
|
return new StringType(uint8Array.length, encoding).get(uint8Array, 0);
|
|
@@ -87,7 +93,7 @@ export function getBitAllignedNumber(source, byteOffset, bitOffset, len) {
|
|
|
87
93
|
const bitsRead = 8 - bitOff;
|
|
88
94
|
const bitsLeft = len - bitsRead;
|
|
89
95
|
if (bitsLeft < 0) {
|
|
90
|
-
value >>=
|
|
96
|
+
value >>= 8 - bitOff - len;
|
|
91
97
|
}
|
|
92
98
|
else if (bitsLeft > 0) {
|
|
93
99
|
value <<= bitsLeft;
|
|
@@ -136,13 +142,15 @@ export function toRatio(value) {
|
|
|
136
142
|
const ps = value.split(' ').map(p => p.trim().toLowerCase());
|
|
137
143
|
if (ps.length >= 1) {
|
|
138
144
|
const v = Number.parseFloat(ps[0]);
|
|
139
|
-
return ps.length === 2 && ps[1] === 'db'
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
return ps.length === 2 && ps[1] === 'db'
|
|
146
|
+
? {
|
|
147
|
+
dB: v,
|
|
148
|
+
ratio: dbToRatio(v)
|
|
149
|
+
}
|
|
150
|
+
: {
|
|
151
|
+
dB: ratioToDb(v),
|
|
152
|
+
ratio: v
|
|
153
|
+
};
|
|
146
154
|
}
|
|
147
155
|
}
|
|
148
156
|
/**
|
|
@@ -151,7 +159,7 @@ export function toRatio(value) {
|
|
|
151
159
|
*/
|
|
152
160
|
export function decodeUintBE(uint8Array) {
|
|
153
161
|
if (uint8Array.length === 0) {
|
|
154
|
-
throw new Error(
|
|
162
|
+
throw new Error('decodeUintBE: empty Uint8Array');
|
|
155
163
|
}
|
|
156
164
|
const view = new DataView(uint8Array.buffer, uint8Array.byteOffset, uint8Array.byteLength);
|
|
157
165
|
return getUintBE(view);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Primary entry point, Node.js specific entry point is MusepackParser.ts
|
|
3
3
|
*/
|
|
4
|
-
import { type AnyWebByteStream, type IFileInfo, type ITokenizer, type IRandomAccessTokenizer } from 'strtok3';
|
|
5
|
-
import type { IAudioMetadata, INativeTagDict, IOptions, IPicture, IPrivateOptions, ITag } from './type.js';
|
|
6
4
|
import type { Readable } from 'node:stream';
|
|
5
|
+
import { type AnyWebByteStream, type IFileInfo, type IRandomAccessTokenizer, type ITokenizer } from 'strtok3';
|
|
6
|
+
import type { IAudioMetadata, INativeTagDict, IOptions, IPicture, IPrivateOptions, ITag } from './type.js';
|
|
7
7
|
export type { IFileInfo } from 'strtok3';
|
|
8
|
-
export { type IAudioMetadata, type IOptions, type ITag, type INativeTagDict, type ICommonTagsResult, type IFormat, type IPicture, type IRatio, type IChapter, type ILyricsTag, LyricsContentType, TimestampFormat, IMetadataEventTag, IMetadataEvent } from './type.js';
|
|
9
|
-
export { CouldNotDetermineFileTypeError, UnsupportedFileTypeError } from './ParseError.js';
|
|
10
8
|
export * from './ParseError.js';
|
|
9
|
+
export { CouldNotDetermineFileTypeError, UnsupportedFileTypeError } from './ParseError.js';
|
|
10
|
+
export { type IAudioMetadata, type IChapter, type ICommonTagsResult, type IFormat, type ILyricsTag, type IMetadataEvent, type IMetadataEventTag, type INativeTagDict, type IOptions, type IPicture, type IRatio, type ITag, LyricsContentType, TimestampFormat } from './type.js';
|
|
11
11
|
/**
|
|
12
12
|
* Parse Web API File
|
|
13
13
|
* Requires Blob to be able to stream using a ReadableStreamBYOBReader, only available since Node.js ≥ 20
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Primary entry point, Node.js specific entry point is MusepackParser.ts
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { ParserFactory } from './ParserFactory.js';
|
|
4
|
+
import { fromBlob, fromBuffer, fromWebStream } from 'strtok3';
|
|
6
5
|
import { APEv2Parser } from './apev2/APEv2Parser.js';
|
|
7
6
|
import { hasID3v1Header } from './id3v1/ID3v1Parser.js';
|
|
8
7
|
import { getLyricsHeaderLength } from './lyrics3/Lyrics3.js';
|
|
9
|
-
|
|
10
|
-
export { CouldNotDetermineFileTypeError, UnsupportedFileTypeError } from './ParseError.js';
|
|
8
|
+
import { ParserFactory } from './ParserFactory.js';
|
|
11
9
|
export * from './ParseError.js';
|
|
10
|
+
export { CouldNotDetermineFileTypeError, UnsupportedFileTypeError } from './ParseError.js';
|
|
11
|
+
export { LyricsContentType, TimestampFormat } from './type.js';
|
|
12
12
|
/**
|
|
13
13
|
* Parse Web API File
|
|
14
14
|
* Requires Blob to be able to stream using a ReadableStreamBYOBReader, only available since Node.js ≥ 20
|
|
@@ -33,7 +33,9 @@ export async function parseBlob(blob, options = {}) {
|
|
|
33
33
|
* @returns Metadata
|
|
34
34
|
*/
|
|
35
35
|
export async function parseWebStream(webStream, fileInfo, options = {}) {
|
|
36
|
-
const tokenizer = fromWebStream(webStream, {
|
|
36
|
+
const tokenizer = fromWebStream(webStream, {
|
|
37
|
+
fileInfo: typeof fileInfo === 'string' ? { mimeType: fileInfo } : fileInfo
|
|
38
|
+
});
|
|
37
39
|
try {
|
|
38
40
|
return await parseFromTokenizer(tokenizer, options);
|
|
39
41
|
}
|
|
@@ -50,7 +52,9 @@ export async function parseWebStream(webStream, fileInfo, options = {}) {
|
|
|
50
52
|
* Ref: https://github.com/Borewit/strtok3/blob/e6938c81ff685074d5eb3064a11c0b03ca934c1d/src/index.ts#L15
|
|
51
53
|
*/
|
|
52
54
|
export async function parseBuffer(uint8Array, fileInfo, options = {}) {
|
|
53
|
-
const tokenizer = fromBuffer(uint8Array, {
|
|
55
|
+
const tokenizer = fromBuffer(uint8Array, {
|
|
56
|
+
fileInfo: typeof fileInfo === 'string' ? { mimeType: fileInfo } : fileInfo
|
|
57
|
+
});
|
|
54
58
|
return parseFromTokenizer(tokenizer, options);
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
@@ -89,11 +93,14 @@ export function ratingToStars(rating) {
|
|
|
89
93
|
* @return Cover image, if any, otherwise null
|
|
90
94
|
*/
|
|
91
95
|
export function selectCover(pictures) {
|
|
92
|
-
return pictures
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
return pictures
|
|
97
|
+
? pictures.reduce((acc, cur) => {
|
|
98
|
+
if (cur.name && cur.name.toLowerCase() in ['front', 'cover', 'cover (front)']) {
|
|
99
|
+
return cur;
|
|
100
|
+
}
|
|
101
|
+
return acc;
|
|
102
|
+
})
|
|
103
|
+
: null;
|
|
97
104
|
}
|
|
98
105
|
export async function scanAppendingHeaders(tokenizer, options = {}) {
|
|
99
106
|
let apeOffset = tokenizer.fileInfo.size;
|