@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.
Files changed (279) hide show
  1. package/dist/.setup/{account-selection-BDeeqwwR.mjs → account-selection-Bs_jCAaG.mjs} +3 -5
  2. package/dist/.setup/{approval-handler.runtime-QkHLH2az.mjs → approval-handler.runtime-rxLn8CbP.mjs} +60 -83
  3. package/dist/.setup/{channel-CeRXEAEP.mjs → channel-BcwGspPw.mjs} +92 -120
  4. package/dist/.setup/{channel.runtime-DBQA2y1F.mjs → channel.runtime-CUc6rbu1.mjs} +23 -18
  5. package/dist/.setup/{channel.setup-DC2t7_PK.mjs → channel.setup-CwuYD_CT.mjs} +2 -3
  6. package/dist/.setup/{cli-Be8tdNw8.mjs → cli-mbL9jCro.mjs} +80 -120
  7. package/dist/.setup/{cli-metadata-CtcjBFhc.mjs → cli-metadata-6MOGuyHq.mjs} +1 -1
  8. package/dist/.setup/{client-DY3HExqI.mjs → client-BlTvpEWC.mjs} +2 -2
  9. package/dist/.setup/{client-bootstrap-CZvJjr29.mjs → client-bootstrap-D05xy1HB.mjs} +2 -3
  10. package/dist/.setup/{client-support-D7BlioUb.mjs → client-support-D-xHScuo.mjs} +1 -1
  11. package/dist/.setup/{client-kmih04ng.mjs → client-vPPbaxNp.mjs} +14 -24
  12. package/dist/.setup/{create-client-CbJVyFDy.mjs → create-client-CroC4BVc.mjs} +4 -4
  13. package/dist/.setup/{credentials-C2dvc_kB.mjs → credentials-Bf9PQ7xs.mjs} +4 -18
  14. package/dist/.setup/{crypto-runtime-B2AjWo-i.mjs → crypto-runtime-CpJ0b7vY.mjs} +80 -123
  15. package/dist/.setup/{deps-CFNl7tQo.mjs → deps-L_1bUAGL.mjs} +20 -37
  16. package/dist/.setup/{direct-management-DJtQhLKH.mjs → direct-management-B3wYhx_M.mjs} +25 -51
  17. package/dist/.setup/{directory-live-DW5UykLL.mjs → directory-live-B1WbfSHo.mjs} +3 -3
  18. package/dist/.setup/{draft-stream-B87DfA6a.mjs → draft-stream-Bdrh7dRt.mjs} +2 -3
  19. package/dist/.setup/{encryption-guidance-BEjKbiMR.mjs → encryption-guidance-D5_IsDIy.mjs} +1 -1
  20. package/dist/.setup/{env-vars-dGqak9dN.mjs → env-vars-aEBngJPa.mjs} +2 -17
  21. package/dist/.setup/{event-helpers-CspuhE9k.mjs → event-helpers-CxNgMQqH.mjs} +5 -7
  22. package/dist/.setup/{exec-approvals-BLDAMyHs.mjs → exec-approvals-BgNWWJg1.mjs} +6 -12
  23. package/dist/.setup/{file-sync-store-Clc9iEdn.mjs → file-sync-store-BdKx_gMi.mjs} +2 -5
  24. package/dist/.setup/{http-client-DfJY5Ck0.mjs → http-client-ByR4STVQ.mjs} +55 -59
  25. package/dist/.setup/{messages-uCbwLRKS.mjs → messages-B1CZqU8u.mjs} +4 -16
  26. package/dist/.setup/{monitor-skIntQVG.mjs → monitor-Dk_fQL1k.mjs} +176 -232
  27. package/dist/.setup/{onboarding-Cm_tOJxs.mjs → onboarding-CrSexor_.mjs} +33 -50
  28. package/dist/.setup/{outbound-CqQou3ny.mjs → outbound-LR3SqPIq.mjs} +2 -2
  29. package/dist/.setup/{profile-update-C1n8SRqH.mjs → profile-update-C7bjaGR6.mjs} +2 -3
  30. package/dist/.setup/{reaction-events-Cqq46xsG.mjs → reaction-events-CTSvOlXO.mjs} +4 -4
  31. package/dist/.setup/{resolve-targets-DFeU1Ww6.mjs → resolve-targets-BVVbbvP6.mjs} +15 -21
  32. package/dist/.setup/{retired-state-BXUQ2I-C.mjs → retired-state-DW5pLH05.mjs} +22 -3
  33. package/dist/.setup/{room-info-BPMbwe8I.mjs → room-info-9Uqlpt1V.mjs} +4 -4
  34. package/dist/.setup/{sdk-CgQGkCsS.mjs → sdk-Cfc6m7fY.mjs} +115 -195
  35. package/dist/.setup/{secret-contract-JlB6VmI3.mjs → secret-contract-DSBRvhdZ.mjs} +1 -1
  36. package/dist/.setup/{secret-contract-api-B-iJoQEv.mjs → secret-contract-api-DzEJ-X7n.mjs} +1 -1
  37. package/dist/.setup/{send-B1Y2L4wj.mjs → send-LCOuTVc1.mjs} +10 -30
  38. package/dist/.setup/{setup-bootstrap-UNIGyKnk.mjs → setup-bootstrap-CV-hHBXu.mjs} +2 -2
  39. package/dist/.setup/setup-core-CKnNTfgD.mjs +673 -0
  40. package/dist/.setup/{setup-plugin-api-BRs9bcp4.mjs → setup-plugin-api-BDAYk1a5.mjs} +1 -1
  41. package/dist/.setup/{startup-verification-D00eUt74.mjs → startup-verification-CgfUb4yJ.mjs} +3 -3
  42. package/dist/.setup/{storage-D7agewjH.mjs → storage-DkC6bHgA.mjs} +24 -49
  43. package/dist/.setup/{subagent-hooks-D5kd_kzN.mjs → subagent-hooks-D8jyeQsO.mjs} +1 -1
  44. package/dist/.setup/{sync-cache-state-C2z64uyk.mjs → sync-cache-state-D4G-fi3t.mjs} +20 -33
  45. package/dist/.setup/{target-ids-Nwx7cMVE.mjs → target-ids-HhcaKX1n.mjs} +15 -1
  46. package/dist/.setup/{thread-binding-api-DRMC62cs.mjs → thread-binding-api-BvuaKpd0.mjs} +1 -1
  47. package/dist/.setup/{thread-bindings-DveHVZqN.mjs → thread-bindings-CT4P-OSZ.mjs} +38 -58
  48. package/dist/.setup/{thread-bindings-shared-hxKkYC1W.mjs → thread-bindings-shared-CbsFNbAY.mjs} +19 -37
  49. package/dist/.setup/{tool-actions-BqlK2ilM.mjs → tool-actions-DAp6_XSJ.mjs} +17 -18
  50. package/dist/.setup/{verification-kMlFYUn0.mjs → verification-B3VswneT.mjs} +15 -21
  51. package/dist/api.js +7 -7
  52. package/dist/channel-plugin-api.js +1 -1
  53. package/dist/cli-metadata.js +1 -1
  54. package/dist/contract-api.js +2 -2
  55. package/dist/doctor-contract-api.js +13 -22
  56. package/dist/helper-api.js +2 -2
  57. package/dist/index.js +1 -1
  58. package/dist/plugin-entry.handlers.runtime.js +2 -2
  59. package/dist/runtime-api.js +4 -4
  60. package/dist/secret-contract-api.js +1 -1
  61. package/dist/session-binding-contract-api.js +1 -1
  62. package/dist/setup-entry.js +2 -2
  63. package/dist/setup-plugin-api.js +1 -1
  64. package/dist/subagent-hooks-api.js +1 -1
  65. package/dist/thread-binding-api.js +1 -1
  66. package/dist/thread-bindings-runtime.js +1 -1
  67. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json +1 -1
  68. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm.d.ts +129 -129
  69. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +688 -688
  70. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +512 -512
  71. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm +0 -0
  72. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts +84 -84
  73. package/node_modules/@openclaw/fs-safe/CHANGELOG.md +35 -0
  74. package/node_modules/@openclaw/fs-safe/README.md +1 -1
  75. package/node_modules/@openclaw/fs-safe/dist/advanced.d.ts +1 -1
  76. package/node_modules/@openclaw/fs-safe/dist/advanced.js +1 -1
  77. package/node_modules/@openclaw/fs-safe/dist/archive-durability.js +1 -1
  78. package/node_modules/@openclaw/fs-safe/dist/archive-merge.js +4 -4
  79. package/node_modules/@openclaw/fs-safe/dist/archive-parser.wasm +0 -0
  80. package/node_modules/@openclaw/fs-safe/dist/archive-read.js +5 -4
  81. package/node_modules/@openclaw/fs-safe/dist/archive-staging.d.ts +1 -1
  82. package/node_modules/@openclaw/fs-safe/dist/archive-staging.js +22 -38
  83. package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.d.ts +17 -0
  84. package/node_modules/@openclaw/fs-safe/dist/copy-path-admission.js +117 -0
  85. package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.d.ts +8 -5
  86. package/node_modules/@openclaw/fs-safe/dist/copy-root-file-sync.js +27 -50
  87. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.d.ts +3 -0
  88. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-acquire.js +57 -11
  89. package/node_modules/@openclaw/fs-safe/dist/guarded-mutation.js +5 -5
  90. package/node_modules/@openclaw/fs-safe/dist/guest-native-python.js +52 -5
  91. package/node_modules/@openclaw/fs-safe/dist/guest.js +1 -1
  92. package/node_modules/@openclaw/fs-safe/dist/native-binding.d.ts +1 -0
  93. package/node_modules/@openclaw/fs-safe/dist/native-operations.d.ts +0 -1
  94. package/node_modules/@openclaw/fs-safe/dist/native-operations.js +22 -26
  95. package/node_modules/@openclaw/fs-safe/dist/native-pinned-write-windows.js +5 -1
  96. package/node_modules/@openclaw/fs-safe/dist/native-staged-file.js +4 -1
  97. package/node_modules/@openclaw/fs-safe/dist/permission-exec.js +2 -1
  98. package/node_modules/@openclaw/fs-safe/dist/pinned-write-types.d.ts +6 -1
  99. package/node_modules/@openclaw/fs-safe/dist/private-temp-workspace.js +2 -2
  100. package/node_modules/@openclaw/fs-safe/dist/publish-file.js +34 -7
  101. package/node_modules/@openclaw/fs-safe/dist/replace-file-copy-fallback.js +1 -4
  102. package/node_modules/@openclaw/fs-safe/dist/replace-file-descriptor.js +6 -0
  103. package/node_modules/@openclaw/fs-safe/dist/root-create-input.d.ts +15 -1
  104. package/node_modules/@openclaw/fs-safe/dist/root-create-input.js +4 -0
  105. package/node_modules/@openclaw/fs-safe/dist/root-directory-entry.js +1 -1
  106. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.d.ts +0 -1
  107. package/node_modules/@openclaw/fs-safe/dist/root-directory-list.js +6 -12
  108. package/node_modules/@openclaw/fs-safe/dist/root-impl.js +15 -15
  109. package/node_modules/@openclaw/fs-safe/dist/root-paths.js +1 -1
  110. package/node_modules/@openclaw/fs-safe/dist/root-walk.js +4 -4
  111. package/node_modules/@openclaw/fs-safe/dist/root-write-verification.d.ts +10 -1
  112. package/node_modules/@openclaw/fs-safe/dist/root-write-verification.js +20 -0
  113. package/node_modules/@openclaw/fs-safe/dist/secure-temp-dir.js +19 -7
  114. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-acquire.js +25 -3
  115. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-admission.d.ts +2 -0
  116. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.d.ts +14 -0
  117. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock-retained.js +187 -0
  118. package/node_modules/@openclaw/fs-safe/dist/sidecar-lock.js +15 -1
  119. package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.d.ts +10 -0
  120. package/node_modules/@openclaw/fs-safe/dist/temp-directory-diagnostics.js +29 -0
  121. package/node_modules/@openclaw/fs-safe/dist/temp-target.js +1 -1
  122. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-admission.js +6 -6
  123. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.d.ts +4 -4
  124. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-child-admission.js +17 -16
  125. package/node_modules/@openclaw/fs-safe/dist/temp-workspace-descriptor.js +20 -28
  126. package/node_modules/@openclaw/fs-safe/dist/walk.js +2 -13
  127. package/node_modules/@openclaw/fs-safe/dist/watch-native.d.ts +2 -2
  128. package/node_modules/@openclaw/fs-safe/dist/watch-native.js +3 -1
  129. package/node_modules/@openclaw/fs-safe/dist/watch-rescan.js +3 -9
  130. package/node_modules/@openclaw/fs-safe/dist/watch.js +2 -3
  131. package/node_modules/@openclaw/fs-safe/docs/advanced.md +1 -1
  132. package/node_modules/@openclaw/fs-safe/docs/archive.md +3 -0
  133. package/node_modules/@openclaw/fs-safe/docs/atomic.md +11 -3
  134. package/node_modules/@openclaw/fs-safe/docs/contributing.md +1 -1
  135. package/node_modules/@openclaw/fs-safe/docs/copy.md +48 -0
  136. package/node_modules/@openclaw/fs-safe/docs/guest.md +21 -4
  137. package/node_modules/@openclaw/fs-safe/docs/path-scope.md +4 -0
  138. package/node_modules/@openclaw/fs-safe/docs/sidecar-lock.md +46 -8
  139. package/node_modules/@openclaw/fs-safe/docs/temp.md +12 -0
  140. package/node_modules/@openclaw/fs-safe/docs/watch.md +3 -2
  141. package/node_modules/@openclaw/fs-safe/package.json +15 -15
  142. package/node_modules/@openclaw/fs-safe-darwin-arm64/fs-safe-native.node +0 -0
  143. package/node_modules/@openclaw/fs-safe-darwin-arm64/package.json +1 -1
  144. package/node_modules/@openclaw/fs-safe-darwin-x64/fs-safe-native.node +0 -0
  145. package/node_modules/@openclaw/fs-safe-darwin-x64/package.json +1 -1
  146. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/fs-safe-native.node +0 -0
  147. package/node_modules/@openclaw/fs-safe-linux-arm64-gnu/package.json +1 -1
  148. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/fs-safe-native.node +0 -0
  149. package/node_modules/@openclaw/fs-safe-linux-arm64-musl/package.json +1 -1
  150. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/fs-safe-native.node +0 -0
  151. package/node_modules/@openclaw/fs-safe-linux-x64-gnu/package.json +1 -1
  152. package/node_modules/@openclaw/fs-safe-linux-x64-musl/fs-safe-native.node +0 -0
  153. package/node_modules/@openclaw/fs-safe-linux-x64-musl/package.json +1 -1
  154. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/fs-safe-native.node +0 -0
  155. package/node_modules/@openclaw/fs-safe-win32-x64-msvc/package.json +1 -1
  156. package/node_modules/matrix-widget-api/lib/interfaces/RtcLivekitActions.d.ts +6 -12
  157. package/node_modules/matrix-widget-api/lib/interfaces/RtcLivekitActions.js.map +1 -1
  158. package/node_modules/matrix-widget-api/package.json +1 -1
  159. package/node_modules/matrix-widget-api/src/interfaces/RtcLivekitActions.ts +6 -13
  160. package/node_modules/music-metadata/README.md +35 -32
  161. package/node_modules/music-metadata/lib/ParserFactory.d.ts +1 -1
  162. package/node_modules/music-metadata/lib/ParserFactory.js +17 -13
  163. package/node_modules/music-metadata/lib/aiff/AiffParser.js +19 -12
  164. package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +1 -1
  165. package/node_modules/music-metadata/lib/aiff/AiffToken.js +2 -1
  166. package/node_modules/music-metadata/lib/apev2/APEv2Parser.d.ts +4 -3
  167. package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +59 -16
  168. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.js +1 -0
  169. package/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts +1 -1
  170. package/node_modules/music-metadata/lib/apev2/APEv2Token.js +1 -1
  171. package/node_modules/music-metadata/lib/asf/AsfGuid.js +56 -50
  172. package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +1 -1
  173. package/node_modules/music-metadata/lib/asf/AsfObject.js +3 -2
  174. package/node_modules/music-metadata/lib/asf/AsfParser.js +15 -7
  175. package/node_modules/music-metadata/lib/asf/AsfTagMapper.d.ts +3 -2
  176. package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +21 -4
  177. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.d.ts +1 -1
  178. package/node_modules/music-metadata/lib/common/CombinedTagMapper.d.ts +2 -2
  179. package/node_modules/music-metadata/lib/common/CombinedTagMapper.js +6 -6
  180. package/node_modules/music-metadata/lib/common/FourCC.js +3 -2
  181. package/node_modules/music-metadata/lib/common/GenericTagMapper.d.ts +1 -1
  182. package/node_modules/music-metadata/lib/common/GenericTagTypes.js +1 -1
  183. package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +3 -1
  184. package/node_modules/music-metadata/lib/common/MetadataCollector.js +28 -9
  185. package/node_modules/music-metadata/lib/common/Util.js +25 -17
  186. package/node_modules/music-metadata/lib/core.d.ts +4 -4
  187. package/node_modules/music-metadata/lib/core.js +18 -11
  188. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +29 -16
  189. package/node_modules/music-metadata/lib/dsf/DsfChunk.d.ts +1 -1
  190. package/node_modules/music-metadata/lib/dsf/DsfParser.js +3 -5
  191. package/node_modules/music-metadata/lib/ebml/EbmlIterator.d.ts +1 -1
  192. package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +35 -6
  193. package/node_modules/music-metadata/lib/ebml/types.d.ts +1 -1
  194. package/node_modules/music-metadata/lib/ebml/types.js +1 -1
  195. package/node_modules/music-metadata/lib/flac/FlacParser.d.ts +1 -1
  196. package/node_modules/music-metadata/lib/flac/FlacParser.js +6 -5
  197. package/node_modules/music-metadata/lib/flac/FlacToken.d.ts +1 -1
  198. package/node_modules/music-metadata/lib/flac/FlacToken.js +1 -1
  199. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.d.ts +1 -1
  200. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +212 -42
  201. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js +5 -5
  202. package/node_modules/music-metadata/lib/id3v2/FrameHeader.d.ts +1 -1
  203. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +8 -5
  204. package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +2 -1
  205. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +54 -23
  206. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.d.ts +1 -1
  207. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +1 -1
  208. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +3 -3
  209. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.js +2 -2
  210. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +1 -1
  211. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +32 -16
  212. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.d.ts +2 -2
  213. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +2 -3
  214. package/node_modules/music-metadata/lib/index.js +6 -3
  215. package/node_modules/music-metadata/lib/lrc/LyricsParser.js +3 -5
  216. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.js +7 -3
  217. package/node_modules/music-metadata/lib/matroska/MatroskaParser.js +22 -11
  218. package/node_modules/music-metadata/lib/matroska/types.d.ts +2 -2
  219. package/node_modules/music-metadata/lib/mp4/Atom.d.ts +4 -3
  220. package/node_modules/music-metadata/lib/mp4/Atom.js +44 -11
  221. package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +1 -1
  222. package/node_modules/music-metadata/lib/mp4/AtomToken.js +30 -8
  223. package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +2 -0
  224. package/node_modules/music-metadata/lib/mp4/MP4Parser.js +79 -54
  225. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.d.ts +2 -2
  226. package/node_modules/music-metadata/lib/mpeg/MpegLoader.js +1 -1
  227. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +41 -19
  228. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.d.ts +2 -2
  229. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js +1 -1
  230. package/node_modules/music-metadata/lib/mpeg/XingTag.d.ts +1 -1
  231. package/node_modules/music-metadata/lib/musepack/MusepackParser.js +2 -2
  232. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.js +1 -1
  233. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js +4 -3
  234. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js +3 -3
  235. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js +7 -5
  236. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +2 -2
  237. package/node_modules/music-metadata/lib/ogg/OggParser.js +23 -13
  238. package/node_modules/music-metadata/lib/ogg/OggToken.d.ts +2 -0
  239. package/node_modules/music-metadata/lib/ogg/OggToken.js +1 -1
  240. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +2 -2
  241. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +2 -2
  242. package/node_modules/music-metadata/lib/ogg/opus/OpusStream.d.ts +2 -2
  243. package/node_modules/music-metadata/lib/ogg/opus/OpusStream.js +8 -4
  244. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +2 -2
  245. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +2 -1
  246. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.d.ts +2 -2
  247. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.d.ts +1 -1
  248. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +1 -1
  249. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +4 -3
  250. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +16 -9
  251. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +4 -0
  252. package/node_modules/music-metadata/lib/riff/RiffChunk.d.ts +3 -1
  253. package/node_modules/music-metadata/lib/riff/RiffChunk.js +3 -2
  254. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.d.ts +1 -1
  255. package/node_modules/music-metadata/lib/type.d.ts +3 -3
  256. package/node_modules/music-metadata/lib/type.js +1 -1
  257. package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +1 -1
  258. package/node_modules/music-metadata/lib/wav/WaveChunk.js +3 -2
  259. package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +6 -2
  260. package/node_modules/music-metadata/lib/wav/WaveParser.js +75 -22
  261. package/node_modules/music-metadata/lib/wavpack/WavPackParser.js +22 -13
  262. package/node_modules/music-metadata/lib/wavpack/WavPackToken.js +3 -2
  263. package/node_modules/music-metadata/package.json +3 -2
  264. package/node_modules/uint8array-extras/index.d.ts +7 -7
  265. package/node_modules/uint8array-extras/index.js +27 -13
  266. package/node_modules/uint8array-extras/package.json +6 -6
  267. package/node_modules/uint8array-extras/readme.md +7 -7
  268. package/package.json +7 -7
  269. package/dist/.setup/accounts-C_r0UlEm.mjs +0 -138
  270. package/dist/.setup/config-update-CZndPxNd.mjs +0 -102
  271. package/dist/.setup/profile-DS0xdJAi.mjs +0 -80
  272. package/dist/.setup/setup-core-6DppLENo.mjs +0 -377
  273. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.d.ts +0 -17
  274. package/node_modules/@openclaw/fs-safe/dist/file-lock-sync-root-arbitration.js +0 -66
  275. package/node_modules/@openclaw/fs-safe/dist/publish-file-native.d.ts +0 -4
  276. package/node_modules/@openclaw/fs-safe/dist/publish-file-native.js +0 -35
  277. package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.d.ts +0 -7
  278. package/node_modules/@openclaw/fs-safe/dist/root-move-preflight.js +0 -16
  279. package/dist/.setup/{errors-DKVS3_DO.mjs → errors-Bw4EHwKX.mjs} +1 -1
@@ -1,9 +1,9 @@
1
- import { EndOfStreamError } from 'strtok3';
2
1
  import initDebug from 'debug';
3
- import { ID3v2Header } from './ID3v2Token.js';
4
- import { ID3v2Parser } from './ID3v2Parser.js';
5
- import { ID3v1Parser } from '../id3v1/ID3v1Parser.js';
2
+ import { EndOfStreamError } from 'strtok3';
6
3
  import { BasicParser } from '../common/BasicParser.js';
4
+ import { ID3v1Parser } from '../id3v1/ID3v1Parser.js';
5
+ import { ID3v2Parser } from './ID3v2Parser.js';
6
+ import { ID3v2Header } from './ID3v2Token.js';
7
7
  const debug = initDebug('music-metadata:parser:ID3');
8
8
  /**
9
9
  * Abstract parser which tries take ID3v2 and ID3v1 headers.
@@ -22,7 +22,7 @@ export class AbstractID3Parser extends BasicParser {
22
22
  }
23
23
  catch (err) {
24
24
  if (err instanceof EndOfStreamError) {
25
- debug("End-of-stream");
25
+ debug('End-of-stream');
26
26
  }
27
27
  else {
28
28
  throw err;
@@ -1,5 +1,5 @@
1
- import { type ID3v2MajorVersion } from './ID3v2Token.js';
2
1
  import type { IWarningCollector } from '../common/MetadataCollector.js';
2
+ import { type ID3v2MajorVersion } from './ID3v2Token.js';
3
3
  export interface IFrameFlags {
4
4
  status: {
5
5
  tag_alter_preservation: boolean;
@@ -1,18 +1,21 @@
1
1
  // lib/id3v2/FrameHeader.ts
2
+ import { textDecode } from '@borewit/text-codec';
2
3
  import * as Token from 'token-types';
3
4
  import * as util from '../common/Util.js';
4
- import { UINT32SYNCSAFE } from './ID3v2Token.js';
5
- import { textDecode } from '@borewit/text-codec';
6
5
  import { Id3v2ContentError } from './FrameParser.js';
6
+ import { UINT32SYNCSAFE } from './ID3v2Token.js';
7
7
  /**
8
8
  * Frame header length (bytes) depending on ID3v2 major version.
9
9
  */
10
10
  export function getFrameHeaderLength(majorVer) {
11
11
  switch (majorVer) {
12
- case 2: return 6;
12
+ case 2:
13
+ return 6;
13
14
  case 3:
14
- case 4: return 10;
15
- default: throw makeUnexpectedMajorVersionError(majorVer);
15
+ case 4:
16
+ return 10;
17
+ default:
18
+ throw makeUnexpectedMajorVersionError(majorVer);
16
19
  }
17
20
  }
18
21
  function readFrameFlags(b, majorVer) {
@@ -1,6 +1,6 @@
1
- import { type ID3v2MajorVersion, type ITextEncoding } from './ID3v2Token.js';
2
1
  import type { IWarningCollector } from '../common/MetadataCollector.js';
3
2
  import { type IChapterInfo } from './ID3v2ChapterToken.js';
3
+ import { type ID3v2MajorVersion, type ITextEncoding } from './ID3v2Token.js';
4
4
  interface ICustomTag {
5
5
  owner_identifier: string;
6
6
  }
@@ -65,6 +65,7 @@ export declare class FrameParser {
65
65
  /**
66
66
  * id3v2.4 defines that multiple T* values are separated by 0x00
67
67
  * id3v2.3 defines that TCOM, TEXT, TOLY, TOPE & TPE1 values are separated by /
68
+ * (TCON/TCO genre values are NOT slash-separated in ID3v2.3)
68
69
  * @param tag - Tag name
69
70
  * @param text - Concatenated tag value
70
71
  * @returns Split tag value
@@ -1,12 +1,12 @@
1
1
  import initDebug from 'debug';
2
2
  import * as Token from 'token-types';
3
3
  import * as util from '../common/Util.js';
4
- import { AttachedPictureType, SyncTextHeader, TextEncodingToken, TextHeader } from './ID3v2Token.js';
4
+ import { decodeUintBE } from '../common/Util.js';
5
5
  import { Genres } from '../id3v1/ID3v1Parser.js';
6
6
  import { makeUnexpectedFileContentError } from '../ParseError.js';
7
- import { decodeUintBE } from '../common/Util.js';
8
- import { ChapterInfo } from './ID3v2ChapterToken.js';
9
7
  import { getFrameHeaderLength, readFrameHeader } from './FrameHeader.js';
8
+ import { ChapterInfo } from './ID3v2ChapterToken.js';
9
+ import { AttachedPictureType, SyncTextHeader, TextEncodingToken, TextHeader } from './ID3v2Token.js';
10
10
  const debug = initDebug('music-metadata:id3v2:frame-parser');
11
11
  const defaultEnc = 'latin1'; // latin1 == iso-8859-1;
12
12
  const urlEnc = { encoding: defaultEnc, bom: false };
@@ -32,8 +32,9 @@ export function parseGenre(origVal) {
32
32
  }
33
33
  code = undefined;
34
34
  }
35
- else
35
+ else {
36
36
  code += c;
37
+ }
37
38
  }
38
39
  else if (c === '(') {
39
40
  code = '';
@@ -53,10 +54,12 @@ export function parseGenre(origVal) {
53
54
  return genres;
54
55
  }
55
56
  function parseGenreCode(code) {
56
- if (code === 'RX')
57
+ if (code === 'RX') {
57
58
  return 'Remix';
58
- if (code === 'CR')
59
+ }
60
+ if (code === 'CR') {
59
61
  return 'Cover';
62
+ }
60
63
  if (code.match(/^\d*$/)) {
61
64
  return Genres[Number.parseInt(code, 10)];
62
65
  }
@@ -128,13 +131,15 @@ export class FrameParser {
128
131
  break;
129
132
  case 'TCO':
130
133
  case 'TCON':
131
- output = this.splitValue(type, text).map(v => parseGenre(v)).reduce((acc, val) => acc.concat(val), []);
134
+ output = this.splitValue(type, text)
135
+ .map(v => parseGenre(v))
136
+ .reduce((acc, val) => acc.concat(val), []);
132
137
  break;
133
138
  case 'PCS':
134
139
  case 'PCST':
135
140
  // TODO: Why `default` not results `1` but `''`?
136
141
  output = this.major >= 4 ? this.splitValue(type, text) : [text];
137
- output = (Array.isArray(output) && output[0] === '') ? 1 : 0;
142
+ output = Array.isArray(output) && output[0] === '' ? 1 : 0;
138
143
  break;
139
144
  default:
140
145
  output = this.major >= 4 ? this.splitValue(type, text) : [text];
@@ -145,7 +150,7 @@ export class FrameParser {
145
150
  const idAndData = FrameParser.readIdentifierAndData(uint8Array.subarray(1), encoding);
146
151
  output = {
147
152
  description: idAndData.id,
148
- text: this.splitValue(type, util.decodeString(idAndData.data, encoding).replace(/\x00+$/, ''))
153
+ text: this.splitValue(type, FrameParser.trimNullPadding(util.decodeString(idAndData.data, encoding)))
149
154
  };
150
155
  break;
151
156
  }
@@ -234,12 +239,14 @@ export class FrameParser {
234
239
  output = { owner_identifier: ufid.id, identifier: ufid.data };
235
240
  break;
236
241
  }
237
- case 'PRIV': { // private frame
242
+ case 'PRIV': {
243
+ // private frame
238
244
  const priv = FrameParser.readIdentifierAndData(uint8Array, defaultEnc);
239
245
  output = { owner_identifier: priv.id, data: priv.data };
240
246
  break;
241
247
  }
242
- case 'POPM': { // Popularimeter
248
+ case 'POPM': {
249
+ // Popularimeter
243
250
  uint8Array = uint8Array.subarray(offset);
244
251
  const emailStr = FrameParser.readNullTerminatedString(uint8Array, urlEnc);
245
252
  const email = emailStr.text;
@@ -258,7 +265,8 @@ export class FrameParser {
258
265
  };
259
266
  break;
260
267
  }
261
- case 'GEOB': { // General encapsulated object
268
+ case 'GEOB': {
269
+ // General encapsulated object
262
270
  // [encoding] <MIME> 0x00 <filename> 0x00/0x00 0x00 <description> 0x00/0x00 0x00 <data>
263
271
  const encoding = TextEncodingToken.get(uint8Array, 0);
264
272
  uint8Array = uint8Array.subarray(1);
@@ -317,8 +325,9 @@ export class FrameParser {
317
325
  }
318
326
  // ID3v2 Chapters 1.0
319
327
  // https://mutagen-specs.readthedocs.io/en/latest/id3/id3v2-chapters-1.0.html#chapter-frame
320
- case 'CHAP': { // // Chapter frame
321
- debug("Reading CHAP");
328
+ case 'CHAP': {
329
+ // // Chapter frame
330
+ debug('Reading CHAP');
322
331
  fzero = util.findZero(uint8Array, defaultEnc);
323
332
  const chapter = {
324
333
  label: util.decodeString(uint8Array.subarray(0, fzero), defaultEnc),
@@ -339,7 +348,8 @@ export class FrameParser {
339
348
  }
340
349
  // ID3v2 Chapters 1.0
341
350
  // https://mutagen-specs.readthedocs.io/en/latest/id3/id3v2-chapters-1.0.html#table-of-contents-frame
342
- case 'CTOC': { // Table of contents frame
351
+ case 'CTOC': {
352
+ // Table of contents frame
343
353
  debug('Reading CTOC');
344
354
  // Element ID (null-terminated latin1)
345
355
  const idEnd = util.findZero(uint8Array, defaultEnc);
@@ -383,21 +393,19 @@ export class FrameParser {
383
393
  return output;
384
394
  }
385
395
  static readNullTerminatedString(uint8Array, encoding) {
386
- const bomSize = encoding.bom ? 2 : 0;
387
396
  const originalLen = uint8Array.length;
388
- const valueArray = uint8Array.subarray(bomSize);
389
- const zeroIndex = util.findZero(valueArray, encoding.encoding);
390
- if (zeroIndex >= valueArray.length) {
391
- // No terminator found, decode full buffer remainder
397
+ const zeroIndex = util.findZero(uint8Array, encoding.encoding);
398
+ if (zeroIndex >= originalLen) {
399
+ // No terminator found, decode the whole buffer
392
400
  return {
393
401
  text: util.decodeString(uint8Array, encoding.encoding),
394
402
  len: originalLen
395
403
  };
396
404
  }
397
- const txt = uint8Array.subarray(0, bomSize + zeroIndex);
405
+ const txt = uint8Array.subarray(0, zeroIndex);
398
406
  return {
399
407
  text: util.decodeString(txt, encoding.encoding),
400
- len: bomSize + zeroIndex + FrameParser.getNullTerminatorLength(encoding.encoding)
408
+ len: zeroIndex + FrameParser.getNullTerminatorLength(encoding.encoding)
401
409
  };
402
410
  }
403
411
  static fixPictureMimeType(pictureType) {
@@ -425,6 +433,7 @@ export class FrameParser {
425
433
  /**
426
434
  * id3v2.4 defines that multiple T* values are separated by 0x00
427
435
  * id3v2.3 defines that TCOM, TEXT, TOLY, TOPE & TPE1 values are separated by /
436
+ * (TCON/TCO genre values are NOT slash-separated in ID3v2.3)
428
437
  * @param tag - Tag name
429
438
  * @param text - Concatenated tag value
430
439
  * @returns Split tag value
@@ -436,7 +445,29 @@ export class FrameParser {
436
445
  if (values.length > 1) {
437
446
  this.warningCollector.addWarning(`ID3v2.${this.major} ${tag} uses non standard null-separator.`);
438
447
  }
439
- else {
448
+ else if ([
449
+ /* v2.3: */ 'TPE1',
450
+ 'TPE2',
451
+ 'TPE3',
452
+ 'TPE4',
453
+ 'TCOM',
454
+ 'TEXT',
455
+ 'TOLY',
456
+ 'TOPE',
457
+ /* v2.2: */ 'TP1',
458
+ 'TCM',
459
+ 'TXT',
460
+ 'TOA',
461
+ 'TOL',
462
+ // Picard can flatten multiple values with '/' in these frames.
463
+ // https://picard-docs.musicbrainz.org/en/v2.13/config/options_tags_compatibility_id3.html
464
+ 'TXXX',
465
+ 'TSRC',
466
+ // Retain legacy support for nonstandard slash-separated credits.
467
+ 'IPLS'
468
+ ].includes(tag)) {
469
+ // note that field Genre (TCON/TCO) is NOT in this list:
470
+ // a genre like "Duo Cello/Piano" must stay intact
440
471
  values = text.split(/\//g);
441
472
  }
442
473
  }
@@ -1,5 +1,5 @@
1
- import type { INativeTagMap } from '../common/GenericTagTypes.js';
2
1
  import { CaseInsensitiveTagMap } from '../common/CaseInsensitiveTagMap.js';
2
+ import type { INativeTagMap } from '../common/GenericTagTypes.js';
3
3
  /**
4
4
  * ID3v2.2 tag mappings
5
5
  */
@@ -28,7 +28,7 @@ export const id3v22TagMap = {
28
28
  TSS: 'encodersettings',
29
29
  WAR: 'website',
30
30
  PCS: 'podcast',
31
- TCP: "compilation",
31
+ TCP: 'compilation',
32
32
  TDR: 'date',
33
33
  TS2: 'albumartistsort',
34
34
  TSA: 'albumsort',
@@ -1,6 +1,6 @@
1
1
  import { UINT32_LE } from 'token-types';
2
- import { CommonTagMapper } from '../common/GenericTagMapper.js';
3
2
  import { CaseInsensitiveTagMap } from '../common/CaseInsensitiveTagMap.js';
3
+ import { CommonTagMapper } from '../common/GenericTagMapper.js';
4
4
  import { decodeString } from '../common/Util.js';
5
5
  /**
6
6
  * ID3v2.3/ID3v2.4 tag mappings
@@ -138,13 +138,13 @@ const id3v24TagMap = {
138
138
  TKWD: 'keywords',
139
139
  WFED: 'podcasturl',
140
140
  GRP1: 'grouping',
141
- PCNT: 'playCounter',
141
+ PCNT: 'playCounter'
142
142
  };
143
143
  export class ID3v24TagMapper extends CaseInsensitiveTagMap {
144
144
  static toRating(popm) {
145
145
  return {
146
146
  source: popm.email,
147
- rating: popm.rating > 0 ? (popm.rating - 1) / 254 * CommonTagMapper.maxRatingScore : undefined
147
+ rating: popm.rating > 0 ? ((popm.rating - 1) / 254) * CommonTagMapper.maxRatingScore : undefined
148
148
  };
149
149
  }
150
150
  constructor() {
@@ -10,8 +10,8 @@ export const ChapterInfo = {
10
10
  return {
11
11
  startTime: Token.UINT32_BE.get(buf, off),
12
12
  endTime: Token.UINT32_BE.get(buf, off + 4),
13
- startOffset: startOffset === 0xFFFFFFFF ? undefined : startOffset,
14
- endOffset: endOffset === 0xFFFFFFFF ? undefined : endOffset,
13
+ startOffset: startOffset === 0xffffffff ? undefined : startOffset,
14
+ endOffset: endOffset === 0xffffffff ? undefined : endOffset
15
15
  };
16
16
  }
17
17
  };
@@ -1,6 +1,6 @@
1
1
  import type { ITokenizer } from 'strtok3';
2
- import type { IOptions } from '../type.js';
3
2
  import type { INativeMetadataCollector } from '../common/MetadataCollector.js';
3
+ import type { IOptions } from '../type.js';
4
4
  export declare class ID3v2Parser {
5
5
  static removeUnsyncBytes(buffer: Uint8Array): Uint8Array;
6
6
  private static readFrameData;
@@ -1,7 +1,7 @@
1
1
  import * as Token from 'token-types';
2
+ import { getFrameHeaderLength, readFrameHeader } from './FrameHeader.js';
2
3
  import { FrameParser, Id3v2ContentError } from './FrameParser.js';
3
4
  import { ExtendedHeader, ID3v2Header } from './ID3v2Token.js';
4
- import { getFrameHeaderLength, readFrameHeader } from './FrameHeader.js';
5
5
  export class ID3v2Parser {
6
6
  constructor() {
7
7
  this.tokenizer = undefined;
@@ -17,7 +17,7 @@ export class ID3v2Parser {
17
17
  if (readI !== writeI) {
18
18
  buffer[writeI] = buffer[readI];
19
19
  }
20
- readI += (buffer[readI] === 0xFF && buffer[readI + 1] === 0) ? 2 : 1;
20
+ readI += buffer[readI] === 0xff && buffer[readI + 1] === 0 ? 2 : 1;
21
21
  writeI++;
22
22
  }
23
23
  if (readI < buffer.length) {
@@ -58,10 +58,17 @@ export class ID3v2Parser {
58
58
  this.options = options;
59
59
  const id3Header = await this.tokenizer.readToken(ID3v2Header);
60
60
  if (id3Header.fileIdentifier !== 'ID3') {
61
- throw new Id3v2ContentError('expected ID3-header file-identifier \'ID3\' was not found');
61
+ throw new Id3v2ContentError("expected ID3-header file-identifier 'ID3' was not found");
62
+ }
63
+ const fileSize = this.tokenizer.fileInfo.size;
64
+ if (fileSize !== undefined) {
65
+ const remainingBytes = fileSize - this.tokenizer.position;
66
+ if (id3Header.size > remainingBytes) {
67
+ throw new Id3v2ContentError(`ID3v2 tag size ${id3Header.size} exceeds remaining file size ${remainingBytes}`);
68
+ }
62
69
  }
63
70
  this.id3Header = id3Header;
64
- this.headerType = (`ID3v2.${id3Header.version.major}`);
71
+ this.headerType = `ID3v2.${id3Header.version.major}`;
65
72
  await (id3Header.flags.isExtendedHeader ? this.parseExtendedHeader() : this.parseId3Data(id3Header.size));
66
73
  // Post process
67
74
  const chapters = ID3v2Parser.mapId3v2Chapters(this.metadata.native[this.headerType]);
@@ -70,7 +77,9 @@ export class ID3v2Parser {
70
77
  async parseExtendedHeader() {
71
78
  const extendedHeader = await this.tokenizer.readToken(ExtendedHeader);
72
79
  const dataRemaining = extendedHeader.size - ExtendedHeader.len;
73
- return dataRemaining > 0 ? this.parseExtendedHeaderData(dataRemaining, extendedHeader.size) : this.parseId3Data(this.id3Header.size - extendedHeader.size);
80
+ return dataRemaining > 0
81
+ ? this.parseExtendedHeaderData(dataRemaining, extendedHeader.size)
82
+ : this.parseId3Data(this.id3Header.size - extendedHeader.size);
74
83
  }
75
84
  async parseExtendedHeaderData(dataRemaining, extendedHeaderSize) {
76
85
  await this.tokenizer.ignore(dataRemaining);
@@ -86,7 +95,9 @@ export class ID3v2Parser {
86
95
  }
87
96
  break;
88
97
  default:
89
- await (Array.isArray(tag.value) ? Promise.all(tag.value.map(value => this.addTag(tag.id, value))) : this.addTag(tag.id, tag.value));
98
+ await (Array.isArray(tag.value)
99
+ ? Promise.all(tag.value.map(value => this.addTag(tag.id, value)))
100
+ : this.addTag(tag.id, tag.value));
90
101
  }
91
102
  }
92
103
  }
@@ -100,8 +111,9 @@ export class ID3v2Parser {
100
111
  let offset = 0;
101
112
  const tags = [];
102
113
  while (true) {
103
- if (offset === data.length)
114
+ if (offset === data.length) {
104
115
  break;
116
+ }
105
117
  const frameHeaderLength = getFrameHeaderLength(this.id3Header.version.major);
106
118
  if (offset + frameHeaderLength > data.length) {
107
119
  this.metadata.addWarning('Illegal ID3v2 tag length');
@@ -126,28 +138,32 @@ export class ID3v2Parser {
126
138
  * as produced by `FrameParser.readData`.
127
139
  */
128
140
  static mapId3v2Chapters(id3Tags) {
129
- if (!id3Tags)
141
+ if (!id3Tags) {
130
142
  return;
131
- const chapFrames = id3Tags.filter(t => t.id === 'CHAP');
132
- if (!chapFrames?.length)
143
+ }
144
+ const chapFrames = id3Tags.filter(t => t.id === 'CHAP').map(t => t.value);
145
+ if (!chapFrames.length) {
133
146
  return;
134
- const tocFrames = id3Tags.filter(t => t.id === 'CTOC');
135
- const topLevelToc = tocFrames?.find(t => t.value.flags?.topLevel);
147
+ }
148
+ const tocFrames = id3Tags.filter(t => t.id === 'CTOC').map(t => t.value);
149
+ const topLevelToc = tocFrames.find(t => t.flags.topLevel);
136
150
  const chapterById = new Map();
137
151
  for (const chap of chapFrames) {
138
- chapterById.set(chap.value.label, chap.value);
152
+ chapterById.set(chap.label, chap);
139
153
  }
140
- const orderedIds = topLevelToc?.value.childElementIds;
154
+ const orderedIds = topLevelToc?.childElementIds;
141
155
  const chapters = [];
142
156
  const source = orderedIds ?? [...chapterById.keys()];
143
157
  for (const id of source) {
144
158
  const chap = chapterById.get(id);
145
- if (!chap)
159
+ if (!chap) {
146
160
  continue;
161
+ }
147
162
  const frames = chap.frames;
148
163
  const title = frames.get('TIT2');
149
- if (!title)
164
+ if (!title) {
150
165
  continue; // title is required
166
+ }
151
167
  chapters.push({
152
168
  id,
153
169
  title,
@@ -46,13 +46,13 @@ export declare const LyricsContentType: {
46
46
  chord: number;
47
47
  trivia_pop: number;
48
48
  };
49
- export type LyricsContentType = typeof LyricsContentType[keyof typeof LyricsContentType];
49
+ export type LyricsContentType = (typeof LyricsContentType)[keyof typeof LyricsContentType];
50
50
  export declare const TimestampFormat: {
51
51
  notSynchronized: number;
52
52
  mpegFrameNumber: number;
53
53
  milliseconds: number;
54
54
  };
55
- export type TimestampFormat = typeof TimestampFormat[keyof typeof TimestampFormat];
55
+ export type TimestampFormat = (typeof TimestampFormat)[keyof typeof TimestampFormat];
56
56
  /**
57
57
  * 28 bits (representing up to 256MB) integer, the msb is 0 to avoid 'false syncsignals'.
58
58
  * 4 * %0xxxxxxx
@@ -37,7 +37,7 @@ export const LyricsContentType = {
37
37
  movement_part: 3,
38
38
  events: 4,
39
39
  chord: 5,
40
- trivia_pop: 6,
40
+ trivia_pop: 6
41
41
  };
42
42
  export const TimestampFormat = {
43
43
  notSynchronized: 0,
@@ -50,8 +50,7 @@ export const TimestampFormat = {
50
50
  */
51
51
  export const UINT32SYNCSAFE = {
52
52
  get: (buf, off) => {
53
- return buf[off + 3] & 0x7f | ((buf[off + 2]) << 7) |
54
- ((buf[off + 1]) << 14) | ((buf[off]) << 21);
53
+ return (buf[off + 3] & 0x7f) | (buf[off + 2] << 7) | (buf[off + 1] << 14) | (buf[off] << 21);
55
54
  },
56
55
  len: 4
57
56
  };
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Node.js specific entry point.
3
3
  */
4
- import { fromFile, fromStream } from 'strtok3';
5
4
  import initDebug from 'debug';
5
+ import { fromFile, fromStream } from 'strtok3';
6
6
  import { CouldNotDetermineFileTypeError, parseFromTokenizer, UnsupportedFileTypeError } from './core.js';
7
7
  import { ParserFactory } from './ParserFactory.js';
8
8
  export * from './core.js';
@@ -15,7 +15,9 @@ const debug = initDebug('music-metadata:parser');
15
15
  * @returns Metadata
16
16
  */
17
17
  export async function parseStream(stream, fileInfo, options = {}) {
18
- const tokenizer = await fromStream(stream, { fileInfo: typeof fileInfo === 'string' ? { mimeType: fileInfo } : fileInfo });
18
+ const tokenizer = await fromStream(stream, {
19
+ fileInfo: typeof fileInfo === 'string' ? { mimeType: fileInfo } : fileInfo
20
+ });
19
21
  try {
20
22
  return await parseFromTokenizer(tokenizer, options);
21
23
  }
@@ -35,8 +37,9 @@ export async function parseFile(filePath, options = {}) {
35
37
  const parserFactory = new ParserFactory();
36
38
  try {
37
39
  const parserLoader = parserFactory.findLoaderForExtension(filePath);
38
- if (!parserLoader)
40
+ if (!parserLoader) {
39
41
  debug('Parser could not be determined by file extension');
42
+ }
40
43
  try {
41
44
  return await parserFactory.parse(fileTokenizer, parserLoader, options);
42
45
  }
@@ -12,7 +12,7 @@ export function toUnsyncedLyrics(lyrics) {
12
12
  contentType: LyricsContentType.lyrics,
13
13
  timeStampFormat: TimestampFormat.notSynchronized,
14
14
  text: lyrics.trim(),
15
- syncText: [],
15
+ syncText: []
16
16
  };
17
17
  }
18
18
  /**
@@ -28,9 +28,7 @@ export function parseLrc(lrcString) {
28
28
  if (match) {
29
29
  const minutes = Number.parseInt(match[1], 10);
30
30
  const seconds = Number.parseInt(match[2], 10);
31
- const ms = match[3].length === 3
32
- ? Number.parseInt(match[3], 10)
33
- : Number.parseInt(match[3], 10) * 10;
31
+ const ms = match[3].length === 3 ? Number.parseInt(match[3], 10) : Number.parseInt(match[3], 10) * 10;
34
32
  const timestamp = (minutes * 60 + seconds) * 1000 + ms;
35
33
  const text = line.replace(TIMESTAMP_REGEX, '').trim();
36
34
  syncText.push({ timestamp, text });
@@ -40,6 +38,6 @@ export function parseLrc(lrcString) {
40
38
  contentType: LyricsContentType.lyrics,
41
39
  timeStampFormat: TimestampFormat.milliseconds,
42
40
  text: syncText.map(line => line.text).join('\n'),
43
- syncText,
41
+ syncText
44
42
  };
45
43
  }
@@ -9,6 +9,7 @@ export const matroskaDtd = {
9
9
  name: 'dtd',
10
10
  container: {
11
11
  0x1a45dfa3: {
12
+ // 5.1
12
13
  name: 'ebml',
13
14
  container: {
14
15
  0x4286: { name: 'ebmlVersion', value: DataType.uint }, // 5.1.1
@@ -178,7 +179,8 @@ export const matroskaDtd = {
178
179
  0x5378: { name: 'blockNumber', value: DataType.uint },
179
180
  0xea: { name: 'codecState', value: DataType.uint },
180
181
  0xdb: {
181
- name: 'reference', container: {
182
+ name: 'reference',
183
+ container: {
182
184
  0x96: { name: 'time', value: DataType.uint },
183
185
  0x97: { name: 'cluster', value: DataType.uint },
184
186
  0x535f: { name: 'number', value: DataType.uint },
@@ -225,10 +227,12 @@ export const matroskaDtd = {
225
227
  0x98: { name: 'hidden', value: DataType.bool },
226
228
  0x4598: { name: 'enabled', value: DataType.uid },
227
229
  0x8f: {
228
- name: 'track', container: {
230
+ name: 'track',
231
+ container: {
229
232
  0x89: { name: 'trackNumber', value: DataType.uid },
230
233
  0x80: {
231
- name: 'display', container: {
234
+ name: 'display',
235
+ container: {
232
236
  0x85: { name: 'string', value: DataType.string },
233
237
  0x437c: { name: 'language ', value: DataType.string },
234
238
  0x437e: { name: 'country ', value: DataType.string }
@@ -1,8 +1,8 @@
1
1
  import initDebug from 'debug';
2
2
  import { BasicParser } from '../common/BasicParser.js';
3
+ import { EbmlIterator, ParseAction } from '../ebml/EbmlIterator.js';
3
4
  import { matroskaDtd } from './MatroskaDtd.js';
4
5
  import { TargetType, TrackType } from './types.js';
5
- import { EbmlIterator, ParseAction } from '../ebml/EbmlIterator.js';
6
6
  const debug = initDebug('music-metadata:parser:matroska');
7
7
  /**
8
8
  * Extensible Binary Meta Language (EBML) parser
@@ -26,7 +26,7 @@ export class MatroskaParser extends BasicParser {
26
26
  const matroskaIterator = new EbmlIterator(this.tokenizer);
27
27
  debug('Initializing DTD end MatroskaIterator');
28
28
  await matroskaIterator.iterate(matroskaDtd, containerSize, {
29
- startNext: (element) => {
29
+ startNext: element => {
30
30
  switch (element.id) {
31
31
  // case 0x1f43b675: // cluster
32
32
  case 0x1c53bb6b: // Cueing Data
@@ -59,18 +59,20 @@ export class MatroskaParser extends BasicParser {
59
59
  this.seekHeadOffset = offset;
60
60
  break;
61
61
  case 0x1549a966:
62
- { // Info (Segment Information)
62
+ {
63
+ // Info (Segment Information)
63
64
  const info = value;
64
65
  const timecodeScale = info.timecodeScale ? info.timecodeScale : 1000000;
65
66
  if (typeof info.duration === 'number') {
66
- const duration = info.duration * timecodeScale / 1000000000;
67
+ const duration = (info.duration * timecodeScale) / 1000000000;
67
68
  await this.addTag('segment:title', info.title);
68
69
  this.metadata.setFormat('duration', Number(duration));
69
70
  }
70
71
  }
71
72
  break;
72
73
  case 0x1654ae6b:
73
- { // tracks
74
+ {
75
+ // tracks
74
76
  const audioTracks = value;
75
77
  if (audioTracks?.entries) {
76
78
  audioTracks.entries.forEach(entry => {
@@ -91,12 +93,15 @@ export class MatroskaParser extends BasicParser {
91
93
  const audioTrack = audioTracks.entries
92
94
  .filter(entry => entry.trackType === TrackType.audio)
93
95
  .reduce((acc, cur) => {
94
- if (!acc)
96
+ if (!acc) {
95
97
  return cur;
96
- if (cur.flagDefault && !acc.flagDefault)
98
+ }
99
+ if (cur.flagDefault && !acc.flagDefault) {
97
100
  return cur;
98
- if (cur.trackNumber < acc.trackNumber)
101
+ }
102
+ if (cur.trackNumber < acc.trackNumber) {
99
103
  return cur;
104
+ }
100
105
  return acc;
101
106
  }, null);
102
107
  if (audioTrack) {
@@ -108,11 +113,16 @@ export class MatroskaParser extends BasicParser {
108
113
  }
109
114
  break;
110
115
  case 0x1254c367:
111
- { // tags
116
+ {
117
+ // tags
112
118
  const tags = value;
113
119
  await Promise.all(tags.tag.map(async (tag) => {
114
120
  const target = tag.target;
115
- const targetType = target?.targetTypeValue ? TargetType[target.targetTypeValue] : (target?.targetType ? target.targetType : 'track');
121
+ const targetType = target?.targetTypeValue
122
+ ? TargetType[target.targetTypeValue]
123
+ : target?.targetType
124
+ ? target.targetType
125
+ : 'track';
116
126
  await Promise.all(tag.simpleTags.map(async (simpleTag) => {
117
127
  const value = simpleTag.string ? simpleTag.string : simpleTag.binary;
118
128
  await this.addTag(`${targetType}:${simpleTag.name}`, value);
@@ -121,7 +131,8 @@ export class MatroskaParser extends BasicParser {
121
131
  }
122
132
  break;
123
133
  case 0x1941a469:
124
- { // attachments
134
+ {
135
+ // attachments
125
136
  const attachments = value;
126
137
  await Promise.all(attachments.attachedFiles
127
138
  .filter(file => file.mimeType.startsWith('image/'))