@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,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 { FourCcToken } from '../common/FourCC.js';
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 -= (BigInt(ChunkHeader64.len) + chunkHeader.chunkSize);
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': { // 3.1 FORMAT VERSION CHUNK
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': { // 3.2 PROPERTY CHUNK
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': { // Unofficial ID3 tag support
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': { // 3.2.1 Sample Rate Chunk
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': { // 3.2.2 Channels Chunk
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': { // 3.2.3 Compression Type Chunk
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': { // 3.2.4 Absolute Start Time Chunk
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': { // 3.2.5 Loudspeaker Configuration Chunk
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 && this.metadata.format.sampleRate && this.metadata.format.numberOfChannels && this.metadata.format.bitsPerSample) {
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 === 0x1F43B675) {
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 res = await this.parseContainer(child, element.len >= 0 ? this.tokenizer.position + element.len : -1, listener);
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 rawString = await this.tokenizer.readToken(new StringType(e.len, 'utf-8'));
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
- }).forEach(child => {
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;
@@ -4,5 +4,5 @@ export const DataType = {
4
4
  uid: 2,
5
5
  bool: 3,
6
6
  binary: 4,
7
- float: 5,
7
+ float: 5
8
8
  };
@@ -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 { VorbisStream } from '../ogg/vorbis/VorbisStream.js';
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 { textDecode } from '@borewit/text-codec';
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', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk', 'Grunge', 'Hip-Hop',
14
- 'Jazz', 'Metal', 'New Age', 'Oldies', 'Other', 'Pop', 'R&B', 'Rap', 'Reggae', 'Rock',
15
- 'Techno', 'Industrial', 'Alternative', 'Ska', 'Death Metal', 'Pranks', 'Soundtrack',
16
- 'Euro-Techno', 'Ambient', 'Trip-Hop', 'Vocal', 'Jazz+Funk', 'Fusion', 'Trance',
17
- 'Classical', 'Instrumental', 'Acid', 'House', 'Game', 'Sound Clip', 'Gospel', 'Noise',
18
- 'Alt. Rock', 'Bass', 'Soul', 'Punk', 'Space', 'Meditative', 'Instrumental Pop',
19
- 'Instrumental Rock', 'Ethnic', 'Gothic', 'Darkwave', 'Techno-Industrial',
20
- 'Electronic', 'Pop-Folk', 'Eurodance', 'Dream', 'Southern Rock', 'Comedy', 'Cult',
21
- 'Gangsta Rap', 'Top 40', 'Christian Rap', 'Pop/Funk', 'Jungle', 'Native American',
22
- 'Cabaret', 'New Wave', 'Psychedelic', 'Rave', 'Showtunes', 'Trailer', 'Lo-Fi', 'Tribal',
23
- 'Acid Punk', 'Acid Jazz', 'Polka', 'Retro', 'Musical', 'Rock & Roll', 'Hard Rock',
24
- 'Folk', 'Folk/Rock', 'National Folk', 'Swing', 'Fast-Fusion', 'Bebob', 'Latin', 'Revival',
25
- 'Celtic', 'Bluegrass', 'Avantgarde', 'Gothic Rock', 'Progressive Rock', 'Psychedelic Rock',
26
- 'Symphonic Rock', 'Slow Rock', 'Big Band', 'Chorus', 'Easy Listening', 'Acoustic', 'Humour',
27
- 'Speech', 'Chanson', 'Opera', 'Chamber Music', 'Sonata', 'Symphony', 'Booty Bass', 'Primus',
28
- 'Porn Groove', 'Satire', 'Slow Jam', 'Club', 'Tango', 'Samba', 'Folklore',
29
- 'Ballad', 'Power Ballad', 'Rhythmic Soul', 'Freestyle', 'Duet', 'Punk Rock', 'Drum Solo',
30
- 'A Cappella', 'Euro-House', 'Dance Hall', 'Goa', 'Drum & Bass', 'Club-House',
31
- 'Hardcore', 'Terror', 'Indie', 'BritPop', 'Negerpunk', 'Polsk Punk', 'Beat',
32
- 'Christian Gangsta Rap', 'Heavy Metal', 'Black Metal', 'Crossover', 'Contemporary Christian',
33
- 'Christian Rock', 'Merengue', 'Salsa', 'Thrash Metal', 'Anime', 'JPop', 'Synthpop',
34
- 'Abstract', 'Art Rock', 'Baroque', 'Bhangra', 'Big Beat', 'Breakbeat', 'Chillout',
35
- 'Downtempo', 'Dub', 'EBM', 'Eclectic', 'Electro', 'Electroclash', 'Emo', 'Experimental',
36
- 'Garage', 'Global', 'IDM', 'Illbient', 'Industro-Goth', 'Jam Band', 'Krautrock',
37
- 'Leftfield', 'Lounge', 'Math Rock', 'New Romantic', 'Nu-Breakz', 'Post-Punk', 'Post-Rock',
38
- 'Psytrance', 'Shoegaze', 'Space Rock', 'Trop Rock', 'World Music', 'Neoclassical', 'Audiobook',
39
- 'Audio Theatre', 'Neue Deutsche Welle', 'Podcast', 'Indie Rock', 'G-Funk', 'Dubstep',
40
- 'Garage Rock', 'Psybient'
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 bytes ID3v1.1 metadata header
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 equals 'TAG', otherwise null is returned
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
- return header === 'TAG' ? {
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
- // ID3v1.1 separator for track
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
- } : null;
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);