@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,11 +1,11 @@
|
|
|
1
|
-
import * as Token from 'token-types';
|
|
2
1
|
import initDebug from 'debug';
|
|
3
2
|
import * as strtok3 from 'strtok3';
|
|
4
|
-
import
|
|
3
|
+
import * as Token from 'token-types';
|
|
5
4
|
import { BasicParser } from '../common/BasicParser.js';
|
|
5
|
+
import { FourCcToken } from '../common/FourCC.js';
|
|
6
6
|
import { ID3v2Parser } from '../id3v2/ID3v2Parser.js';
|
|
7
|
-
import { ChunkHeader64 } from './DsdiffToken.js';
|
|
8
7
|
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
8
|
+
import { ChunkHeader64 } from './DsdiffToken.js';
|
|
9
9
|
const debug = initDebug('music-metadata:parser:aiff');
|
|
10
10
|
export class DsdiffContentParseError extends makeUnexpectedFileContentError('DSDIFF') {
|
|
11
11
|
}
|
|
@@ -18,8 +18,9 @@ export class DsdiffContentParseError extends makeUnexpectedFileContentError('DSD
|
|
|
18
18
|
export class DsdiffParser extends BasicParser {
|
|
19
19
|
async parse() {
|
|
20
20
|
const header = await this.tokenizer.readToken(ChunkHeader64);
|
|
21
|
-
if (header.chunkID !== 'FRM8')
|
|
21
|
+
if (header.chunkID !== 'FRM8') {
|
|
22
22
|
throw new DsdiffContentParseError('Unexpected chunk-ID');
|
|
23
|
+
}
|
|
23
24
|
this.metadata.setAudioOnly();
|
|
24
25
|
const type = (await this.tokenizer.readToken(FourCcToken)).trim();
|
|
25
26
|
switch (type) {
|
|
@@ -37,26 +38,30 @@ export class DsdiffParser extends BasicParser {
|
|
|
37
38
|
// If the data is an odd number of bytes in length, a pad byte must be added at the end
|
|
38
39
|
debug(`Chunk id=${chunkHeader.chunkID}`);
|
|
39
40
|
await this.readData(chunkHeader);
|
|
40
|
-
remainingSize -=
|
|
41
|
+
remainingSize -= BigInt(ChunkHeader64.len) + chunkHeader.chunkSize;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
async readData(header) {
|
|
44
45
|
debug(`Reading data of chunk[ID=${header.chunkID}, size=${header.chunkSize}]`);
|
|
45
46
|
const p0 = this.tokenizer.position;
|
|
46
47
|
switch (header.chunkID.trim()) {
|
|
47
|
-
case 'FVER': {
|
|
48
|
+
case 'FVER': {
|
|
49
|
+
// 3.1 FORMAT VERSION CHUNK
|
|
48
50
|
const version = await this.tokenizer.readToken(Token.UINT32_LE);
|
|
49
51
|
debug(`DSDIFF version=${version}`);
|
|
50
52
|
break;
|
|
51
53
|
}
|
|
52
|
-
case 'PROP': {
|
|
54
|
+
case 'PROP': {
|
|
55
|
+
// 3.2 PROPERTY CHUNK
|
|
53
56
|
const propType = await this.tokenizer.readToken(FourCcToken);
|
|
54
|
-
if (propType !== 'SND ')
|
|
57
|
+
if (propType !== 'SND ') {
|
|
55
58
|
throw new DsdiffContentParseError('Unexpected PROP-chunk ID');
|
|
59
|
+
}
|
|
56
60
|
await this.handleSoundPropertyChunks(header.chunkSize - BigInt(FourCcToken.len));
|
|
57
61
|
break;
|
|
58
62
|
}
|
|
59
|
-
case 'ID3': {
|
|
63
|
+
case 'ID3': {
|
|
64
|
+
// Unofficial ID3 tag support
|
|
60
65
|
const id3_data = await this.tokenizer.readToken(new Token.Uint8ArrayType(Number(header.chunkSize)));
|
|
61
66
|
const rst = strtok3.fromBuffer(id3_data);
|
|
62
67
|
await new ID3v2Parser().parse(this.metadata, rst, this.options);
|
|
@@ -64,7 +69,7 @@ export class DsdiffParser extends BasicParser {
|
|
|
64
69
|
}
|
|
65
70
|
case 'DSD':
|
|
66
71
|
if (this.metadata.format.numberOfChannels) {
|
|
67
|
-
this.metadata.setFormat('numberOfSamples', Number(header.chunkSize * BigInt(8) / BigInt(this.metadata.format.numberOfChannels)));
|
|
72
|
+
this.metadata.setFormat('numberOfSamples', Number((header.chunkSize * BigInt(8)) / BigInt(this.metadata.format.numberOfChannels)));
|
|
68
73
|
}
|
|
69
74
|
if (this.metadata.format.numberOfSamples && this.metadata.format.sampleRate) {
|
|
70
75
|
this.metadata.setFormat('duration', this.metadata.format.numberOfSamples / this.metadata.format.sampleRate);
|
|
@@ -87,18 +92,21 @@ export class DsdiffParser extends BasicParser {
|
|
|
87
92
|
debug(`Sound-property-chunk[ID=${sndPropHeader.chunkID}, size=${sndPropHeader.chunkSize}]`);
|
|
88
93
|
const p0 = this.tokenizer.position;
|
|
89
94
|
switch (sndPropHeader.chunkID.trim()) {
|
|
90
|
-
case 'FS': {
|
|
95
|
+
case 'FS': {
|
|
96
|
+
// 3.2.1 Sample Rate Chunk
|
|
91
97
|
const sampleRate = await this.tokenizer.readToken(Token.UINT32_BE);
|
|
92
98
|
this.metadata.setFormat('sampleRate', sampleRate);
|
|
93
99
|
break;
|
|
94
100
|
}
|
|
95
|
-
case 'CHNL': {
|
|
101
|
+
case 'CHNL': {
|
|
102
|
+
// 3.2.2 Channels Chunk
|
|
96
103
|
const numChannels = await this.tokenizer.readToken(Token.UINT16_BE);
|
|
97
104
|
this.metadata.setFormat('numberOfChannels', numChannels);
|
|
98
105
|
await this.handleChannelChunks(sndPropHeader.chunkSize - BigInt(Token.UINT16_BE.len));
|
|
99
106
|
break;
|
|
100
107
|
}
|
|
101
|
-
case 'CMPR': {
|
|
108
|
+
case 'CMPR': {
|
|
109
|
+
// 3.2.3 Compression Type Chunk
|
|
102
110
|
const compressionIdCode = (await this.tokenizer.readToken(FourCcToken)).trim();
|
|
103
111
|
const count = await this.tokenizer.readToken(Token.UINT8);
|
|
104
112
|
const compressionName = await this.tokenizer.readToken(new Token.StringType(count, 'ascii'));
|
|
@@ -109,7 +117,8 @@ export class DsdiffParser extends BasicParser {
|
|
|
109
117
|
this.metadata.setFormat('codec', `${compressionIdCode} (${compressionName})`);
|
|
110
118
|
break;
|
|
111
119
|
}
|
|
112
|
-
case 'ABSS': {
|
|
120
|
+
case 'ABSS': {
|
|
121
|
+
// 3.2.4 Absolute Start Time Chunk
|
|
113
122
|
const hours = await this.tokenizer.readToken(Token.UINT16_BE);
|
|
114
123
|
const minutes = await this.tokenizer.readToken(Token.UINT8);
|
|
115
124
|
const seconds = await this.tokenizer.readToken(Token.UINT8);
|
|
@@ -117,7 +126,8 @@ export class DsdiffParser extends BasicParser {
|
|
|
117
126
|
debug(`ABSS ${hours}:${minutes}:${seconds}.${samples}`);
|
|
118
127
|
break;
|
|
119
128
|
}
|
|
120
|
-
case 'LSCO': {
|
|
129
|
+
case 'LSCO': {
|
|
130
|
+
// 3.2.5 Loudspeaker Configuration Chunk
|
|
121
131
|
const lsConfig = await this.tokenizer.readToken(Token.UINT16_BE);
|
|
122
132
|
debug(`LSCO lsConfig=${lsConfig}`);
|
|
123
133
|
break;
|
|
@@ -134,7 +144,10 @@ export class DsdiffParser extends BasicParser {
|
|
|
134
144
|
remainingSize -= BigInt(ChunkHeader64.len) + sndPropHeader.chunkSize;
|
|
135
145
|
debug(`Parsing sound-property-chunks, remainingSize=${remainingSize}`);
|
|
136
146
|
}
|
|
137
|
-
if (this.metadata.format.lossless &&
|
|
147
|
+
if (this.metadata.format.lossless &&
|
|
148
|
+
this.metadata.format.sampleRate &&
|
|
149
|
+
this.metadata.format.numberOfChannels &&
|
|
150
|
+
this.metadata.format.bitsPerSample) {
|
|
138
151
|
const bitrate = this.metadata.format.sampleRate * this.metadata.format.numberOfChannels * this.metadata.format.bitsPerSample;
|
|
139
152
|
this.metadata.setFormat('bitrate', bitrate);
|
|
140
153
|
}
|
|
@@ -43,7 +43,7 @@ export declare const ChannelType: {
|
|
|
43
43
|
'5 channels': number;
|
|
44
44
|
'5.1 channels': number;
|
|
45
45
|
};
|
|
46
|
-
export type ChannelType = typeof ChannelType[keyof typeof ChannelType];
|
|
46
|
+
export type ChannelType = (typeof ChannelType)[keyof typeof ChannelType];
|
|
47
47
|
/**
|
|
48
48
|
* Interface to format chunk payload chunk
|
|
49
49
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import initDebug from 'debug';
|
|
2
2
|
import { AbstractID3Parser } from '../id3v2/AbstractID3Parser.js';
|
|
3
|
-
import { ChunkHeader, DsdChunk, FormatChunk } from './DsfChunk.js';
|
|
4
3
|
import { ID3v2Parser } from '../id3v2/ID3v2Parser.js';
|
|
5
|
-
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
6
4
|
import { ID3v2Header } from '../id3v2/ID3v2Token.js';
|
|
5
|
+
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
6
|
+
import { ChunkHeader, DsdChunk, FormatChunk } from './DsfChunk.js';
|
|
7
7
|
const debug = initDebug('music-metadata:parser:DSF');
|
|
8
8
|
export class DsdContentParseError extends makeUnexpectedFileContentError('DSD') {
|
|
9
9
|
}
|
|
@@ -66,9 +66,7 @@ export class DsfParser extends AbstractID3Parser {
|
|
|
66
66
|
this.metadata.setFormat('bitsPerSample', formatChunk.bitsPerSample);
|
|
67
67
|
this.metadata.setFormat('numberOfSamples', formatChunk.sampleCount);
|
|
68
68
|
this.metadata.setFormat('duration', Number(formatChunk.sampleCount) / formatChunk.samplingFrequency);
|
|
69
|
-
const bitrate = formatChunk.bitsPerSample *
|
|
70
|
-
formatChunk.samplingFrequency *
|
|
71
|
-
formatChunk.channelNum;
|
|
69
|
+
const bitrate = formatChunk.bitsPerSample * formatChunk.samplingFrequency * formatChunk.channelNum;
|
|
72
70
|
this.metadata.setFormat('bitrate', bitrate);
|
|
73
71
|
return; // We got what we want, stop further processing of chunks
|
|
74
72
|
}
|
|
@@ -28,7 +28,7 @@ export declare const ParseAction: {
|
|
|
28
28
|
readonly TerminateParsing: 4;
|
|
29
29
|
readonly SkipElement: 5;
|
|
30
30
|
};
|
|
31
|
-
export type ParseAction = typeof ParseAction[keyof typeof ParseAction];
|
|
31
|
+
export type ParseAction = (typeof ParseAction)[keyof typeof ParseAction];
|
|
32
32
|
/**
|
|
33
33
|
* @return true, to quit the parser
|
|
34
34
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Float32_BE, Float64_BE, StringType, UINT8 } from 'token-types';
|
|
2
1
|
import initDebug from 'debug';
|
|
3
2
|
import { EndOfStreamError } from 'strtok3';
|
|
4
|
-
import { DataType } from './types.js';
|
|
5
3
|
import * as Token from 'token-types';
|
|
4
|
+
import { Float32_BE, Float64_BE, StringType, UINT8 } from 'token-types';
|
|
6
5
|
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
6
|
+
import { DataType } from './types.js';
|
|
7
7
|
const debug = initDebug('music-metadata:parser:ebml');
|
|
8
8
|
export class EbmlContentError extends makeUnexpectedFileContentError('EBML') {
|
|
9
9
|
}
|
|
@@ -61,14 +61,15 @@ export class EbmlIterator {
|
|
|
61
61
|
switch (action) {
|
|
62
62
|
case ParseAction.ReadNext:
|
|
63
63
|
{
|
|
64
|
-
if (element.id ===
|
|
64
|
+
if (element.id === 0x1f43b675) {
|
|
65
65
|
// Hack to ignore remaining segment, when cluster element received
|
|
66
66
|
// await this.tokenizer.ignore(posDone - this.tokenizer.position);
|
|
67
67
|
// break;
|
|
68
68
|
}
|
|
69
69
|
debug(`Read element: name=${getElementPath(child)}{id=0x${element.id.toString(16)}, container=${!!child.container}} at position=${elementPosition}`);
|
|
70
70
|
if (child.container) {
|
|
71
|
-
const
|
|
71
|
+
const childEnd = Math.min(posDone, this.tokenizer.fileInfo.size ?? Number.POSITIVE_INFINITY, element.len >= 0 ? this.tokenizer.position + element.len : posDone);
|
|
72
|
+
const res = await this.parseContainer(child, childEnd, listener);
|
|
72
73
|
if (child.multiple) {
|
|
73
74
|
if (!tree[child.name]) {
|
|
74
75
|
tree[child.name] = [];
|
|
@@ -83,6 +84,13 @@ export class EbmlIterator {
|
|
|
83
84
|
else {
|
|
84
85
|
const parser = this.parserMap.get(child.value);
|
|
85
86
|
if (typeof parser === 'function') {
|
|
87
|
+
// Validate before leaf readers allocate buffers or string tokens from the declared length.
|
|
88
|
+
const end = Math.min(posDone, this.tokenizer.fileInfo.size ?? Number.POSITIVE_INFINITY);
|
|
89
|
+
if (!Number.isSafeInteger(element.len) ||
|
|
90
|
+
element.len < 0 ||
|
|
91
|
+
element.len > end - this.tokenizer.position) {
|
|
92
|
+
throw new EbmlContentError(`Invalid element length: ${element.len}`);
|
|
93
|
+
}
|
|
86
94
|
const value = await parser(element);
|
|
87
95
|
tree[child.name] = value;
|
|
88
96
|
await listener.elementValue(child, value, elementPosition);
|
|
@@ -166,10 +174,30 @@ export class EbmlIterator {
|
|
|
166
174
|
return readUIntBE(buf, e.len);
|
|
167
175
|
}
|
|
168
176
|
async readString(e) {
|
|
169
|
-
const
|
|
177
|
+
const buf = await this.readBuffer(e);
|
|
178
|
+
const rawString = new StringType(e.len, 'utf-8').get(buf, 0);
|
|
170
179
|
return rawString.replace(/\x00.*$/g, '');
|
|
171
180
|
}
|
|
172
181
|
async readBuffer(e) {
|
|
182
|
+
const chunkSize = 64 * 1024;
|
|
183
|
+
if ((!this.tokenizer.supportsRandomAccess() || this.tokenizer.fileInfo.size === undefined) && e.len > chunkSize) {
|
|
184
|
+
// Neither a declared container size nor an advertised stream size proves these bytes exist.
|
|
185
|
+
// Allocate incrementally, and only assemble the leaf after reading its payload.
|
|
186
|
+
const chunks = [];
|
|
187
|
+
for (let remaining = e.len; remaining > 0;) {
|
|
188
|
+
const chunk = new Uint8Array(Math.min(remaining, chunkSize));
|
|
189
|
+
await this.tokenizer.readBuffer(chunk);
|
|
190
|
+
chunks.push(chunk);
|
|
191
|
+
remaining -= chunk.length;
|
|
192
|
+
}
|
|
193
|
+
const buf = new Uint8Array(e.len);
|
|
194
|
+
let offset = 0;
|
|
195
|
+
for (const chunk of chunks) {
|
|
196
|
+
buf.set(chunk, offset);
|
|
197
|
+
offset += chunk.length;
|
|
198
|
+
}
|
|
199
|
+
return buf;
|
|
200
|
+
}
|
|
173
201
|
const buf = new Uint8Array(e.len);
|
|
174
202
|
await this.tokenizer.readBuffer(buf);
|
|
175
203
|
return buf;
|
|
@@ -202,7 +230,8 @@ function linkParents(element) {
|
|
|
202
230
|
const child = element.container[id];
|
|
203
231
|
child.id = Number.parseInt(id, 10);
|
|
204
232
|
return child;
|
|
205
|
-
})
|
|
233
|
+
})
|
|
234
|
+
.forEach(child => {
|
|
206
235
|
child.parent = element;
|
|
207
236
|
linkParents(child);
|
|
208
237
|
});
|
|
@@ -9,7 +9,7 @@ export declare const DataType: {
|
|
|
9
9
|
readonly binary: 4;
|
|
10
10
|
readonly float: 5;
|
|
11
11
|
};
|
|
12
|
-
export type DataType = typeof DataType[keyof typeof DataType];
|
|
12
|
+
export type DataType = (typeof DataType)[keyof typeof DataType];
|
|
13
13
|
export type ValueType = string | number | Uint8Array | boolean | ITree | ITree[];
|
|
14
14
|
export interface IHeader {
|
|
15
15
|
id: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type IVorbisPicture } from '../ogg/vorbis/Vorbis.js';
|
|
2
1
|
import { AbstractID3Parser } from '../id3v2/AbstractID3Parser.js';
|
|
2
|
+
import { type IVorbisPicture } from '../ogg/vorbis/Vorbis.js';
|
|
3
3
|
import type { IBlockStreamInfo } from './FlacToken.js';
|
|
4
4
|
export declare class FlacParser extends AbstractID3Parser {
|
|
5
5
|
private vorbisParser;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import initDebug from 'debug';
|
|
2
2
|
import { Uint8ArrayType } from 'token-types';
|
|
3
|
-
import { VorbisPictureToken } from '../ogg/vorbis/Vorbis.js';
|
|
4
|
-
import { AbstractID3Parser } from '../id3v2/AbstractID3Parser.js';
|
|
5
3
|
import { FourCcToken } from '../common/FourCC.js';
|
|
6
|
-
import {
|
|
4
|
+
import { AbstractID3Parser } from '../id3v2/AbstractID3Parser.js';
|
|
5
|
+
import { VorbisPictureToken } from '../ogg/vorbis/Vorbis.js';
|
|
7
6
|
import { VorbisDecoder } from '../ogg/vorbis/VorbisDecoder.js';
|
|
7
|
+
import { VorbisStream } from '../ogg/vorbis/VorbisStream.js';
|
|
8
8
|
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
9
9
|
import * as Flac from './FlacToken.js';
|
|
10
10
|
const debug = initDebug('music-metadata:parser:FLAC');
|
|
@@ -29,7 +29,7 @@ export class FlacParser extends AbstractID3Parser {
|
|
|
29
29
|
} while (!blockHeader.lastBlock);
|
|
30
30
|
if (this.tokenizer.fileInfo.size && this.metadata.format.duration) {
|
|
31
31
|
const dataSize = this.tokenizer.fileInfo.size - this.tokenizer.position;
|
|
32
|
-
this.metadata.setFormat('bitrate', 8 * dataSize / this.metadata.format.duration);
|
|
32
|
+
this.metadata.setFormat('bitrate', (8 * dataSize) / this.metadata.format.duration);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
async parseDataBlock(blockHeader) {
|
|
@@ -60,8 +60,9 @@ export class FlacParser extends AbstractID3Parser {
|
|
|
60
60
|
* Parse STREAMINFO
|
|
61
61
|
*/
|
|
62
62
|
async readBlockStreamInfo(dataLen) {
|
|
63
|
-
if (dataLen !== Flac.BlockStreamInfo.len)
|
|
63
|
+
if (dataLen !== Flac.BlockStreamInfo.len) {
|
|
64
64
|
throw new FlacContentError('Unexpected block-stream-info length');
|
|
65
|
+
}
|
|
65
66
|
const streamInfo = await this.tokenizer.readToken(Flac.BlockStreamInfo);
|
|
66
67
|
this.metadata.setFormat('container', 'FLAC');
|
|
67
68
|
this.processsStreamInfo(streamInfo);
|
|
@@ -12,7 +12,7 @@ export declare const BlockType: {
|
|
|
12
12
|
CUESHEET: number;
|
|
13
13
|
PICTURE: number;
|
|
14
14
|
};
|
|
15
|
-
export type BlockType = typeof BlockType[keyof typeof BlockType];
|
|
15
|
+
export type BlockType = (typeof BlockType)[keyof typeof BlockType];
|
|
16
16
|
/**
|
|
17
17
|
* METADATA_BLOCK_DATA
|
|
18
18
|
* Ref: https://xiph.org/flac/format.html#metadata_block_streaminfo
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as util from '../common/Util.js';
|
|
2
1
|
import { UINT16_BE, UINT24_BE, Uint8ArrayType } from 'token-types';
|
|
2
|
+
import * as util from '../common/Util.js';
|
|
3
3
|
/**
|
|
4
4
|
* FLAC supports up to 128 kinds of metadata blocks; currently the following are defined:
|
|
5
5
|
* ref: https://xiph.org/flac/format.html#metadata_block
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IRandomAccessTokenizer, ITokenizer } from 'strtok3';
|
|
2
2
|
import { BasicParser } from '../common/BasicParser.js';
|
|
3
|
-
import type { IPrivateOptions } from '../type.js';
|
|
4
3
|
import type { INativeMetadataCollector } from '../common/MetadataCollector.js';
|
|
4
|
+
import type { IPrivateOptions } from '../type.js';
|
|
5
5
|
/**
|
|
6
6
|
* ID3v1 Genre mappings
|
|
7
7
|
* Ref: https://de.wikipedia.org/wiki/Liste_der_ID3v1-Genres
|
|
@@ -1,43 +1,207 @@
|
|
|
1
|
+
import { textDecode } from '@borewit/text-codec';
|
|
1
2
|
import initDebug from 'debug';
|
|
2
3
|
import { StringType, UINT8 } from 'token-types';
|
|
3
|
-
import * as util from '../common/Util.js';
|
|
4
|
-
import { BasicParser } from '../common/BasicParser.js';
|
|
5
4
|
import { APEv2Parser } from '../apev2/APEv2Parser.js';
|
|
6
|
-
import {
|
|
5
|
+
import { BasicParser } from '../common/BasicParser.js';
|
|
6
|
+
import * as util from '../common/Util.js';
|
|
7
7
|
const debug = initDebug('music-metadata:parser:ID3v1');
|
|
8
8
|
/**
|
|
9
9
|
* ID3v1 Genre mappings
|
|
10
10
|
* Ref: https://de.wikipedia.org/wiki/Liste_der_ID3v1-Genres
|
|
11
11
|
*/
|
|
12
12
|
export const Genres = [
|
|
13
|
-
'Blues',
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
13
|
+
'Blues',
|
|
14
|
+
'Classic Rock',
|
|
15
|
+
'Country',
|
|
16
|
+
'Dance',
|
|
17
|
+
'Disco',
|
|
18
|
+
'Funk',
|
|
19
|
+
'Grunge',
|
|
20
|
+
'Hip-Hop',
|
|
21
|
+
'Jazz',
|
|
22
|
+
'Metal',
|
|
23
|
+
'New Age',
|
|
24
|
+
'Oldies',
|
|
25
|
+
'Other',
|
|
26
|
+
'Pop',
|
|
27
|
+
'R&B',
|
|
28
|
+
'Rap',
|
|
29
|
+
'Reggae',
|
|
30
|
+
'Rock',
|
|
31
|
+
'Techno',
|
|
32
|
+
'Industrial',
|
|
33
|
+
'Alternative',
|
|
34
|
+
'Ska',
|
|
35
|
+
'Death Metal',
|
|
36
|
+
'Pranks',
|
|
37
|
+
'Soundtrack',
|
|
38
|
+
'Euro-Techno',
|
|
39
|
+
'Ambient',
|
|
40
|
+
'Trip-Hop',
|
|
41
|
+
'Vocal',
|
|
42
|
+
'Jazz+Funk',
|
|
43
|
+
'Fusion',
|
|
44
|
+
'Trance',
|
|
45
|
+
'Classical',
|
|
46
|
+
'Instrumental',
|
|
47
|
+
'Acid',
|
|
48
|
+
'House',
|
|
49
|
+
'Game',
|
|
50
|
+
'Sound Clip',
|
|
51
|
+
'Gospel',
|
|
52
|
+
'Noise',
|
|
53
|
+
'Alt. Rock',
|
|
54
|
+
'Bass',
|
|
55
|
+
'Soul',
|
|
56
|
+
'Punk',
|
|
57
|
+
'Space',
|
|
58
|
+
'Meditative',
|
|
59
|
+
'Instrumental Pop',
|
|
60
|
+
'Instrumental Rock',
|
|
61
|
+
'Ethnic',
|
|
62
|
+
'Gothic',
|
|
63
|
+
'Darkwave',
|
|
64
|
+
'Techno-Industrial',
|
|
65
|
+
'Electronic',
|
|
66
|
+
'Pop-Folk',
|
|
67
|
+
'Eurodance',
|
|
68
|
+
'Dream',
|
|
69
|
+
'Southern Rock',
|
|
70
|
+
'Comedy',
|
|
71
|
+
'Cult',
|
|
72
|
+
'Gangsta Rap',
|
|
73
|
+
'Top 40',
|
|
74
|
+
'Christian Rap',
|
|
75
|
+
'Pop/Funk',
|
|
76
|
+
'Jungle',
|
|
77
|
+
'Native American',
|
|
78
|
+
'Cabaret',
|
|
79
|
+
'New Wave',
|
|
80
|
+
'Psychedelic',
|
|
81
|
+
'Rave',
|
|
82
|
+
'Showtunes',
|
|
83
|
+
'Trailer',
|
|
84
|
+
'Lo-Fi',
|
|
85
|
+
'Tribal',
|
|
86
|
+
'Acid Punk',
|
|
87
|
+
'Acid Jazz',
|
|
88
|
+
'Polka',
|
|
89
|
+
'Retro',
|
|
90
|
+
'Musical',
|
|
91
|
+
'Rock & Roll',
|
|
92
|
+
'Hard Rock',
|
|
93
|
+
'Folk',
|
|
94
|
+
'Folk/Rock',
|
|
95
|
+
'National Folk',
|
|
96
|
+
'Swing',
|
|
97
|
+
'Fast-Fusion',
|
|
98
|
+
'Bebob',
|
|
99
|
+
'Latin',
|
|
100
|
+
'Revival',
|
|
101
|
+
'Celtic',
|
|
102
|
+
'Bluegrass',
|
|
103
|
+
'Avantgarde',
|
|
104
|
+
'Gothic Rock',
|
|
105
|
+
'Progressive Rock',
|
|
106
|
+
'Psychedelic Rock',
|
|
107
|
+
'Symphonic Rock',
|
|
108
|
+
'Slow Rock',
|
|
109
|
+
'Big Band',
|
|
110
|
+
'Chorus',
|
|
111
|
+
'Easy Listening',
|
|
112
|
+
'Acoustic',
|
|
113
|
+
'Humour',
|
|
114
|
+
'Speech',
|
|
115
|
+
'Chanson',
|
|
116
|
+
'Opera',
|
|
117
|
+
'Chamber Music',
|
|
118
|
+
'Sonata',
|
|
119
|
+
'Symphony',
|
|
120
|
+
'Booty Bass',
|
|
121
|
+
'Primus',
|
|
122
|
+
'Porn Groove',
|
|
123
|
+
'Satire',
|
|
124
|
+
'Slow Jam',
|
|
125
|
+
'Club',
|
|
126
|
+
'Tango',
|
|
127
|
+
'Samba',
|
|
128
|
+
'Folklore',
|
|
129
|
+
'Ballad',
|
|
130
|
+
'Power Ballad',
|
|
131
|
+
'Rhythmic Soul',
|
|
132
|
+
'Freestyle',
|
|
133
|
+
'Duet',
|
|
134
|
+
'Punk Rock',
|
|
135
|
+
'Drum Solo',
|
|
136
|
+
'A Cappella',
|
|
137
|
+
'Euro-House',
|
|
138
|
+
'Dance Hall',
|
|
139
|
+
'Goa',
|
|
140
|
+
'Drum & Bass',
|
|
141
|
+
'Club-House',
|
|
142
|
+
'Hardcore',
|
|
143
|
+
'Terror',
|
|
144
|
+
'Indie',
|
|
145
|
+
'BritPop',
|
|
146
|
+
'Negerpunk',
|
|
147
|
+
'Polsk Punk',
|
|
148
|
+
'Beat',
|
|
149
|
+
'Christian Gangsta Rap',
|
|
150
|
+
'Heavy Metal',
|
|
151
|
+
'Black Metal',
|
|
152
|
+
'Crossover',
|
|
153
|
+
'Contemporary Christian',
|
|
154
|
+
'Christian Rock',
|
|
155
|
+
'Merengue',
|
|
156
|
+
'Salsa',
|
|
157
|
+
'Thrash Metal',
|
|
158
|
+
'Anime',
|
|
159
|
+
'JPop',
|
|
160
|
+
'Synthpop',
|
|
161
|
+
'Abstract',
|
|
162
|
+
'Art Rock',
|
|
163
|
+
'Baroque',
|
|
164
|
+
'Bhangra',
|
|
165
|
+
'Big Beat',
|
|
166
|
+
'Breakbeat',
|
|
167
|
+
'Chillout',
|
|
168
|
+
'Downtempo',
|
|
169
|
+
'Dub',
|
|
170
|
+
'EBM',
|
|
171
|
+
'Eclectic',
|
|
172
|
+
'Electro',
|
|
173
|
+
'Electroclash',
|
|
174
|
+
'Emo',
|
|
175
|
+
'Experimental',
|
|
176
|
+
'Garage',
|
|
177
|
+
'Global',
|
|
178
|
+
'IDM',
|
|
179
|
+
'Illbient',
|
|
180
|
+
'Industro-Goth',
|
|
181
|
+
'Jam Band',
|
|
182
|
+
'Krautrock',
|
|
183
|
+
'Leftfield',
|
|
184
|
+
'Lounge',
|
|
185
|
+
'Math Rock',
|
|
186
|
+
'New Romantic',
|
|
187
|
+
'Nu-Breakz',
|
|
188
|
+
'Post-Punk',
|
|
189
|
+
'Post-Rock',
|
|
190
|
+
'Psytrance',
|
|
191
|
+
'Shoegaze',
|
|
192
|
+
'Space Rock',
|
|
193
|
+
'Trop Rock',
|
|
194
|
+
'World Music',
|
|
195
|
+
'Neoclassical',
|
|
196
|
+
'Audiobook',
|
|
197
|
+
'Audio Theatre',
|
|
198
|
+
'Neue Deutsche Welle',
|
|
199
|
+
'Podcast',
|
|
200
|
+
'Indie Rock',
|
|
201
|
+
'G-Funk',
|
|
202
|
+
'Dubstep',
|
|
203
|
+
'Garage Rock',
|
|
204
|
+
'Psybient'
|
|
41
205
|
];
|
|
42
206
|
/**
|
|
43
207
|
* Spec: http://id3.org/ID3v1
|
|
@@ -46,25 +210,29 @@ export const Genres = [
|
|
|
46
210
|
const Iid3v1Token = {
|
|
47
211
|
len: 128,
|
|
48
212
|
/**
|
|
49
|
-
* @param buf Buffer possibly holding the 128
|
|
213
|
+
* @param buf Buffer possibly holding the 128-byte ID3v1/1.1 metadata header
|
|
50
214
|
* @param off Offset in buffer in bytes
|
|
51
|
-
* @returns ID3v1.1 header if first 3 bytes
|
|
215
|
+
* @returns ID3v1/1.1 header if the first 3 bytes equal 'TAG', otherwise null is returned
|
|
52
216
|
*/
|
|
53
217
|
get: (buf, off) => {
|
|
54
218
|
const header = new Id3v1StringType(3).get(buf, off);
|
|
55
|
-
|
|
219
|
+
if (header !== 'TAG') {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
const zeroByte = UINT8.get(buf, off + 125);
|
|
223
|
+
const track = UINT8.get(buf, off + 126);
|
|
224
|
+
// ID3v1.1 replaces the final two comment bytes with a zero separator and a nonzero track number.
|
|
225
|
+
const hasTrack = zeroByte === 0 && track !== 0;
|
|
226
|
+
return {
|
|
56
227
|
header,
|
|
57
228
|
title: new Id3v1StringType(30).get(buf, off + 3),
|
|
58
229
|
artist: new Id3v1StringType(30).get(buf, off + 33),
|
|
59
230
|
album: new Id3v1StringType(30).get(buf, off + 63),
|
|
60
231
|
year: new Id3v1StringType(4).get(buf, off + 93),
|
|
61
|
-
comment: new Id3v1StringType(28).get(buf, off + 97),
|
|
62
|
-
|
|
63
|
-
zeroByte: UINT8.get(buf, off + 127),
|
|
64
|
-
// track: ID3v1.1 field added by Michael Mutschler
|
|
65
|
-
track: UINT8.get(buf, off + 126),
|
|
232
|
+
comment: new Id3v1StringType(hasTrack ? 28 : 30).get(buf, off + 97),
|
|
233
|
+
track: hasTrack ? track : undefined,
|
|
66
234
|
genre: UINT8.get(buf, off + 127)
|
|
67
|
-
}
|
|
235
|
+
};
|
|
68
236
|
}
|
|
69
237
|
};
|
|
70
238
|
class Id3v1StringType {
|
|
@@ -110,12 +278,14 @@ export class ID3v1Parser extends BasicParser {
|
|
|
110
278
|
debug('ID3v1 header found at: pos=%s', this.tokenizer.fileInfo.size - Iid3v1Token.len);
|
|
111
279
|
const props = ['title', 'artist', 'album', 'comment', 'track', 'year'];
|
|
112
280
|
for (const id of props) {
|
|
113
|
-
if (header[id] && header[id] !== '')
|
|
281
|
+
if (header[id] && header[id] !== '') {
|
|
114
282
|
await this.addTag(id, header[id]);
|
|
283
|
+
}
|
|
115
284
|
}
|
|
116
285
|
const genre = ID3v1Parser.getGenre(header.genre);
|
|
117
|
-
if (genre)
|
|
286
|
+
if (genre) {
|
|
118
287
|
await this.addTag('genre', genre);
|
|
288
|
+
}
|
|
119
289
|
}
|
|
120
290
|
else {
|
|
121
291
|
debug('ID3v1 header not found at: pos=%s', this.tokenizer.fileInfo.size - Iid3v1Token.len);
|