@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
@@ -18,12 +18,14 @@ const vorbisTagMap = {
18
18
  ORIGINALYEAR: 'originalyear',
19
19
  RELEASEDATE: 'releasedate',
20
20
  COMMENT: 'comment',
21
+ DESCRIPTION: 'comment',
21
22
  TRACKNUMBER: 'track',
22
23
  DISCNUMBER: 'disk',
23
24
  GENRE: 'genre',
24
25
  METADATA_BLOCK_PICTURE: 'picture',
25
26
  COMPOSER: 'composer',
26
27
  LYRICS: 'lyrics',
28
+ UNSYNCEDLYRICS: 'lyrics',
27
29
  ALBUMSORT: 'albumsort',
28
30
  TITLESORT: 'titlesort',
29
31
  WORK: 'work',
@@ -41,6 +43,8 @@ const vorbisTagMap = {
41
43
  DJMIXER: 'djmixer',
42
44
  MIXER: 'mixer',
43
45
  LABEL: 'label',
46
+ ORGANIZATION: 'label',
47
+ PUBLISHER: 'label',
44
48
  GROUPING: 'grouping',
45
49
  SUBTITLE: 'subtitle',
46
50
  DISCSUBTITLE: 'discsubtitle',
@@ -1,3 +1,4 @@
1
+ import type { SupportedEncoding } from '@borewit/text-codec';
1
2
  import type { IGetToken } from 'strtok3';
2
3
  import type { IChunkHeader } from '../iff/index.js';
3
4
  export type { IChunkHeader } from '../iff/index.js';
@@ -9,8 +10,9 @@ export declare const Header: IGetToken<IChunkHeader>;
9
10
  * Token to parse RIFF-INFO tag value
10
11
  */
11
12
  export declare class ListInfoTagValue implements IGetToken<string> {
13
+ private readonly encoding;
12
14
  len: number;
13
15
  private tagHeader;
14
- constructor(tagHeader: IChunkHeader);
16
+ constructor(tagHeader: IChunkHeader, encoding?: SupportedEncoding);
15
17
  get(buf: Uint8Array, off: number): string;
16
18
  }
@@ -17,12 +17,13 @@ export const Header = {
17
17
  * Token to parse RIFF-INFO tag value
18
18
  */
19
19
  export class ListInfoTagValue {
20
- constructor(tagHeader) {
20
+ constructor(tagHeader, encoding = 'latin1') {
21
+ this.encoding = encoding;
21
22
  this.tagHeader = tagHeader;
22
23
  this.len = tagHeader.chunkSize;
23
24
  this.len += this.len & 1; // if it is an odd length, round up to even
24
25
  }
25
26
  get(buf, off) {
26
- return new Token.StringType(this.tagHeader.chunkSize, 'utf8').get(buf, off);
27
+ return new Token.StringType(this.tagHeader.chunkSize, this.encoding).get(buf, off).split('\0', 1)[0];
27
28
  }
28
29
  }
@@ -1,5 +1,5 @@
1
- import type { INativeTagMap } from '../common/GenericTagTypes.js';
2
1
  import { CommonTagMapper } from '../common/GenericTagMapper.js';
2
+ import type { INativeTagMap } from '../common/GenericTagTypes.js';
3
3
  /**
4
4
  * RIFF Info Tags; part of the EXIF 2.3
5
5
  * Ref: http://owl.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info
@@ -1,9 +1,9 @@
1
- import type { TagType } from './common/GenericTagTypes.js';
2
1
  import type { IFooter } from './apev2/APEv2Token.js';
3
- import type { TrackType } from './matroska/types.js';
2
+ import type { TagType } from './common/GenericTagTypes.js';
4
3
  import type { LyricsContentType, TimestampFormat } from './id3v2/ID3v2Token.js';
5
- export { TrackType, TrackTypeValueToKeyMap } from './matroska/types.js';
4
+ import type { TrackType } from './matroska/types.js';
6
5
  export { LyricsContentType, TimestampFormat } from './id3v2/ID3v2Token.js';
6
+ export { TrackType, TrackTypeValueToKeyMap } from './matroska/types.js';
7
7
  export type AnyTagValue = unknown;
8
8
  /**
9
9
  * Attached picture, typically used for cover art
@@ -1,2 +1,2 @@
1
- export { TrackType, TrackTypeValueToKeyMap } from './matroska/types.js';
2
1
  export { LyricsContentType, TimestampFormat } from './id3v2/ID3v2Token.js';
2
+ export { TrackType, TrackTypeValueToKeyMap } from './matroska/types.js';
@@ -37,7 +37,7 @@ export declare const WaveFormat: {
37
37
  MPEG: number;
38
38
  MPEGLAYER3: number;
39
39
  };
40
- export type WaveFormat = typeof WaveFormat[keyof typeof WaveFormat];
40
+ export type WaveFormat = (typeof WaveFormat)[keyof typeof WaveFormat];
41
41
  export declare const WaveFormatNameMap: {
42
42
  [WaveFormat.PCM]: string;
43
43
  [WaveFormat.ADPCM]: string;
@@ -16,7 +16,7 @@ export const WaveFormat = {
16
16
  // MPEG-4 and AAC Audio Types
17
17
  MPEG_ADTS_AAC: 0x1600,
18
18
  MPEG_LOAS: 0x1602,
19
- RAW_AAC1: 0x00FF,
19
+ RAW_AAC1: 0x00ff,
20
20
  // Dolby Audio Types
21
21
  DOLBY_AC3_SPDIF: 0x0092,
22
22
  DVM: 0x2000,
@@ -53,8 +53,9 @@ export const WaveFormatNameMap = {
53
53
  */
54
54
  export class Format {
55
55
  constructor(header) {
56
- if (header.chunkSize < 16)
56
+ if (header.chunkSize < 16) {
57
57
  throw new WaveContentError('Invalid chunk size');
58
+ }
58
59
  this.len = header.chunkSize;
59
60
  }
60
61
  get(buf, off) {
@@ -1,5 +1,5 @@
1
- import * as riff from '../riff/RiffChunk.js';
2
1
  import { BasicParser } from '../common/BasicParser.js';
2
+ import * as riff from '../riff/RiffChunk.js';
3
3
  /**
4
4
  * Resource Interchange File Format (RIFF) Parser
5
5
  *
@@ -12,6 +12,8 @@ import { BasicParser } from '../common/BasicParser.js';
12
12
  * ToDo: Split WAVE part from RIFF parser
13
13
  */
14
14
  export declare class WaveParser extends BasicParser {
15
+ private codePage;
16
+ private readonly pendingInfoTags;
15
17
  private fact;
16
18
  private blockAlign;
17
19
  private avgBytesPerSec;
@@ -21,5 +23,7 @@ export declare class WaveParser extends BasicParser {
21
23
  readWaveChunk(remaining: number): Promise<void>;
22
24
  parseListTag(listHeader: riff.IChunkHeader): Promise<void>;
23
25
  private parseRiffInfoTags;
24
- private addTag;
26
+ private addInfoTag;
27
+ private flushInfoTags;
28
+ private getInfoEncoding;
25
29
  }
@@ -1,13 +1,12 @@
1
+ import initDebug from 'debug';
1
2
  import * as strtok3 from 'strtok3';
2
3
  import * as Token from 'token-types';
3
- import initDebug from 'debug';
4
- import * as riff from '../riff/RiffChunk.js';
5
- import * as WaveChunk from './WaveChunk.js';
6
- import { ID3v2Parser } from '../id3v2/ID3v2Parser.js';
7
- import * as util from '../common/Util.js';
8
- import { FourCcToken } from '../common/FourCC.js';
9
4
  import { BasicParser } from '../common/BasicParser.js';
5
+ import { FourCcToken } from '../common/FourCC.js';
6
+ import { ID3v2Parser } from '../id3v2/ID3v2Parser.js';
7
+ import * as riff from '../riff/RiffChunk.js';
10
8
  import { BroadcastAudioExtensionChunk } from './BwfChunk.js';
9
+ import * as WaveChunk from './WaveChunk.js';
11
10
  import { WaveContentError } from './WaveChunk.js';
12
11
  const debug = initDebug('music-metadata:parser:RIFF');
13
12
  /**
@@ -24,20 +23,23 @@ const debug = initDebug('music-metadata:parser:RIFF');
24
23
  export class WaveParser extends BasicParser {
25
24
  constructor() {
26
25
  super(...arguments);
26
+ this.pendingInfoTags = [];
27
27
  this.blockAlign = 0;
28
28
  this.avgBytesPerSec = 0;
29
29
  }
30
30
  async parse() {
31
31
  const riffHeader = await this.tokenizer.readToken(riff.Header);
32
32
  debug(`pos=${this.tokenizer.position}, parse: chunkID=${riffHeader.chunkID}`);
33
- if (riffHeader.chunkID !== 'RIFF')
33
+ if (riffHeader.chunkID !== 'RIFF') {
34
34
  return; // Not RIFF format
35
+ }
35
36
  this.metadata.setAudioOnly();
36
- return this.parseRiffChunk(riffHeader.chunkSize).catch(err => {
37
+ await this.parseRiffChunk(riffHeader.chunkSize).catch(err => {
37
38
  if (!(err instanceof strtok3.EndOfStreamError)) {
38
39
  throw err;
39
40
  }
40
41
  });
42
+ await this.flushInfoTags();
41
43
  }
42
44
  async parseRiffChunk(chunkSize) {
43
45
  const type = await this.tokenizer.readToken(FourCcToken);
@@ -59,6 +61,18 @@ export class WaveParser extends BasicParser {
59
61
  this.header = header;
60
62
  debug(`pos=${this.tokenizer.position}, readChunk: chunkID=RIFF/WAVE/${header.chunkID}`);
61
63
  switch (header.chunkID) {
64
+ case 'CSET': {
65
+ if (header.chunkSize < 8) {
66
+ throw new WaveContentError('CSET chunk must contain at least 8 bytes');
67
+ }
68
+ const cset = await this.tokenizer.readToken(new Token.Uint8ArrayType(header.chunkSize));
69
+ this.codePage = Token.UINT16_LE.get(cset, 0);
70
+ if (!this.getInfoEncoding()) {
71
+ this.metadata.addWarning(`Unsupported RIFF CSET code page: ${this.codePage}; LIST/INFO tags will be omitted`);
72
+ }
73
+ await this.flushInfoTags();
74
+ break;
75
+ }
62
76
  case 'LIST':
63
77
  await this.parseListTag(header);
64
78
  break;
@@ -66,7 +80,8 @@ export class WaveParser extends BasicParser {
66
80
  this.metadata.setFormat('lossless', false);
67
81
  this.fact = await this.tokenizer.readToken(new WaveChunk.FactChunk(header));
68
82
  break;
69
- case 'fmt ': { // The Util Chunk, non-PCM Formats
83
+ case 'fmt ': {
84
+ // The Util Chunk, non-PCM Formats
70
85
  const fmt = await this.tokenizer.readToken(new WaveChunk.Format(header));
71
86
  let subFormat = WaveChunk.WaveFormatNameMap[fmt.wFormatTag];
72
87
  if (!subFormat) {
@@ -82,13 +97,15 @@ export class WaveParser extends BasicParser {
82
97
  break;
83
98
  }
84
99
  case 'id3 ': // The way Picard, FooBar currently stores, ID3 meta-data
85
- case 'ID3 ': { // The way Mp3Tags stores ID3 meta-data
100
+ case 'ID3 ': {
101
+ // The way Mp3Tags stores ID3 meta-data
86
102
  const id3_data = await this.tokenizer.readToken(new Token.Uint8ArrayType(header.chunkSize));
87
103
  const rst = strtok3.fromBuffer(id3_data);
88
104
  await new ID3v2Parser().parse(this.metadata, rst, this.options);
89
105
  break;
90
106
  }
91
- case 'data': { // PCM-data
107
+ case 'data': {
108
+ // PCM-data
92
109
  if (this.metadata.format.lossless !== false) {
93
110
  this.metadata.setFormat('lossless', true);
94
111
  }
@@ -100,7 +117,11 @@ export class WaveParser extends BasicParser {
100
117
  chunkSize = calcRemaining;
101
118
  }
102
119
  }
103
- const numberOfSamples = this.fact ? this.fact.dwSampleLength : (chunkSize === 0xffffffff ? undefined : chunkSize / this.blockAlign);
120
+ const numberOfSamples = this.fact
121
+ ? this.fact.dwSampleLength
122
+ : chunkSize === 0xffffffff
123
+ ? undefined
124
+ : chunkSize / this.blockAlign;
104
125
  if (numberOfSamples) {
105
126
  this.metadata.setFormat('numberOfSamples', numberOfSamples);
106
127
  if (this.metadata.format.sampleRate) {
@@ -111,16 +132,17 @@ export class WaveParser extends BasicParser {
111
132
  this.metadata.setFormat('bitrate', this.avgBytesPerSec * 8);
112
133
  }
113
134
  else if (this.metadata.format.duration) {
114
- this.metadata.setFormat('bitrate', chunkSize * 8 / this.metadata.format.duration);
135
+ this.metadata.setFormat('bitrate', (chunkSize * 8) / this.metadata.format.duration);
115
136
  }
116
137
  await this.tokenizer.ignore(header.chunkSize);
117
138
  break;
118
139
  }
119
- case 'bext': { // Broadcast Audio Extension chunk https://tech.ebu.ch/docs/tech/tech3285.pdf
140
+ case 'bext': {
141
+ // Broadcast Audio Extension chunk https://tech.ebu.ch/docs/tech/tech3285.pdf
120
142
  const bext = await this.tokenizer.readToken(BroadcastAudioExtensionChunk);
121
- Object.keys(bext).forEach(key => {
122
- this.metadata.addTag('exif', `bext.${key}`, bext[key]);
123
- });
143
+ for (const key of Object.keys(bext)) {
144
+ await this.metadata.addTag('exif', `bext.${key}`, bext[key]);
145
+ }
124
146
  const bextRemaining = header.chunkSize - BroadcastAudioExtensionChunk.len;
125
147
  await this.tokenizer.ignore(bextRemaining);
126
148
  break;
@@ -157,15 +179,46 @@ export class WaveParser extends BasicParser {
157
179
  while (chunkSize >= 8) {
158
180
  const header = await this.tokenizer.readToken(riff.Header);
159
181
  const valueToken = new riff.ListInfoTagValue(header);
160
- const value = await this.tokenizer.readToken(valueToken);
161
- this.addTag(header.chunkID, util.stripNulls(value));
162
- chunkSize -= (8 + valueToken.len);
182
+ const bytes = await this.tokenizer.readToken(new Token.Uint8ArrayType(valueToken.len));
183
+ if (this.codePage === undefined) {
184
+ this.metadata.registerTagType('exif');
185
+ this.pendingInfoTags.push({ header, bytes });
186
+ }
187
+ else {
188
+ await this.addInfoTag(header, bytes);
189
+ }
190
+ chunkSize -= 8 + valueToken.len;
163
191
  }
164
192
  if (chunkSize !== 0) {
165
193
  throw new WaveContentError(`Illegal remaining size: ${chunkSize}`);
166
194
  }
167
195
  }
168
- addTag(id, value) {
169
- this.metadata.addTag('exif', id, value);
196
+ async addInfoTag(header, bytes) {
197
+ const encoding = this.getInfoEncoding();
198
+ if (encoding) {
199
+ const value = new riff.ListInfoTagValue(header, encoding).get(bytes, 0);
200
+ await this.metadata.addTag('exif', header.chunkID, value);
201
+ }
202
+ }
203
+ async flushInfoTags() {
204
+ for (const { header, bytes } of this.pendingInfoTags.splice(0)) {
205
+ await this.addInfoTag(header, bytes);
206
+ }
207
+ }
208
+ getInfoEncoding() {
209
+ // RIFF CSET: absent/zero means ISO 8859-1, not Windows-1252.
210
+ // https://www.robotplanet.dk/audio/wav_meta_data/riff_mci.pdf#page=25
211
+ switch (this.codePage) {
212
+ case undefined:
213
+ case 0:
214
+ case 28591:
215
+ return 'latin1';
216
+ case 1252:
217
+ return 'windows-1252';
218
+ case 65001:
219
+ return 'utf-8';
220
+ default:
221
+ return undefined;
222
+ }
170
223
  }
171
224
  }
@@ -1,11 +1,11 @@
1
+ import initDebug from 'debug';
1
2
  import * as Token from 'token-types';
3
+ import { uint8ArrayToHex } from 'uint8array-extras';
2
4
  import { tryParseApeHeader } from '../apev2/APEv2Parser.js';
3
- import { FourCcToken } from '../common/FourCC.js';
4
5
  import { BasicParser } from '../common/BasicParser.js';
5
- import { BlockHeaderToken, MetadataIdToken } from './WavPackToken.js';
6
- import initDebug from 'debug';
7
- import { uint8ArrayToHex } from 'uint8array-extras';
6
+ import { FourCcToken } from '../common/FourCC.js';
8
7
  import { makeUnexpectedFileContentError } from '../ParseError.js';
8
+ import { BlockHeaderToken, MetadataIdToken } from './WavPackToken.js';
9
9
  const debug = initDebug('music-metadata:parser:WavPack');
10
10
  export class WavPackContentError extends makeUnexpectedFileContentError('WavPack') {
11
11
  }
@@ -28,11 +28,13 @@ export class WavPackParser extends BasicParser {
28
28
  async parseWavPackBlocks() {
29
29
  do {
30
30
  const blockId = await this.tokenizer.peekToken(FourCcToken);
31
- if (blockId !== 'wvpk')
31
+ if (blockId !== 'wvpk') {
32
32
  break;
33
+ }
33
34
  const header = await this.tokenizer.readToken(BlockHeaderToken);
34
- if (header.BlockID !== 'wvpk')
35
+ if (header.BlockID !== 'wvpk') {
35
36
  throw new WavPackContentError('Invalid WavPack Block-ID');
37
+ }
36
38
  debug(`WavPack header blockIndex=${header.blockIndex}, len=${BlockHeaderToken.len}`);
37
39
  if (header.blockIndex === 0 && !this.metadata.format.container) {
38
40
  this.metadata.setFormat('container', 'WavPack');
@@ -49,13 +51,16 @@ export class WavPackParser extends BasicParser {
49
51
  this.metadata.setFormat('codec', header.flags.isDSD ? 'DSD' : 'PCM');
50
52
  }
51
53
  const ignoreBytes = header.blockSize - (BlockHeaderToken.len - 8);
52
- await (header.blockIndex === 0 ? this.parseMetadataSubBlock(header, ignoreBytes) : this.tokenizer.ignore(ignoreBytes));
54
+ await (header.blockIndex === 0
55
+ ? this.parseMetadataSubBlock(header, ignoreBytes)
56
+ : this.tokenizer.ignore(ignoreBytes));
53
57
  if (header.blockSamples > 0) {
54
58
  this.audioDataSize += header.blockSize; // Count audio data for bit-rate calculation
55
59
  }
56
- } while (!this.tokenizer.fileInfo.size || this.tokenizer.fileInfo.size - this.tokenizer.position >= BlockHeaderToken.len);
60
+ } while (!this.tokenizer.fileInfo.size ||
61
+ this.tokenizer.fileInfo.size - this.tokenizer.position >= BlockHeaderToken.len);
57
62
  if (this.metadata.format.duration) {
58
- this.metadata.setFormat('bitrate', this.audioDataSize * 8 / this.metadata.format.duration);
63
+ this.metadata.setFormat('bitrate', (this.audioDataSize * 8) / this.metadata.format.duration);
59
64
  }
60
65
  }
61
66
  /**
@@ -74,13 +79,15 @@ export class WavPackParser extends BasicParser {
74
79
  switch (id.functionId) {
75
80
  case 0x0: // ID_DUMMY: could be used to pad WavPack blocks
76
81
  break;
77
- case 0xe: { // ID_DSD_BLOCK
82
+ case 0xe: {
83
+ // ID_DSD_BLOCK
78
84
  debug('ID_DSD_BLOCK');
79
85
  // https://github.com/dbry/WavPack/issues/71#issuecomment-483094813
80
86
  const mp = 1 << Token.UINT8.get(data, 0);
81
87
  const samplingRate = header.flags.samplingRate * mp * 8; // ToDo: second factor should be read from DSD-metadata block https://github.com/dbry/WavPack/issues/71#issuecomment-483094813
82
- if (!header.flags.isDSD)
88
+ if (!header.flags.isDSD) {
83
89
  throw new WavPackContentError('Only expect DSD block if DSD-flag is set');
90
+ }
84
91
  this.metadata.setFormat('sampleRate', samplingRate);
85
92
  this.metadata.setFormat('duration', header.totalSamples / samplingRate);
86
93
  break;
@@ -100,10 +107,12 @@ export class WavPackParser extends BasicParser {
100
107
  }
101
108
  remaining -= MetadataIdToken.len + (id.largeBlock ? Token.UINT24_LE.len : Token.UINT8.len) + dataSizeInWords * 2;
102
109
  debug(`remainingLength=${remaining}`);
103
- if (id.isOddSize)
110
+ if (id.isOddSize) {
104
111
  this.tokenizer.ignore(1);
112
+ }
105
113
  }
106
- if (remaining !== 0)
114
+ if (remaining !== 0) {
107
115
  throw new WavPackContentError('metadata-sub-block should fit it remaining length');
116
+ }
108
117
  }
109
118
  }
@@ -1,7 +1,8 @@
1
1
  import * as Token from 'token-types';
2
2
  import { FourCcToken } from '../common/FourCC.js';
3
- const SampleRates = [6000, 8000, 9600, 11025, 12000, 16000, 22050, 24000, 32000, 44100,
4
- 48000, 64000, 88200, 96000, 192000, -1];
3
+ const SampleRates = [
4
+ 6000, 8000, 9600, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000, 192000, -1
5
+ ];
5
6
  /**
6
7
  * WavPack Block Header
7
8
  *
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "music-metadata",
3
3
  "description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.",
4
- "version": "11.15.0",
4
+ "version": "11.16.1",
5
5
  "author": {
6
6
  "name": "Borewit",
7
7
  "url": "https://github.com/Borewit"
@@ -98,6 +98,7 @@
98
98
  "compile:dev": "yarn run compile-src:dev && yarn compile-test && yarn compile-doc",
99
99
  "compile:prod": "yarn run compile-src:prod && yarn compile-test && yarn compile-doc",
100
100
  "lint:ts": "biome check",
101
+ "lint:ts:fix": "biome check --write",
101
102
  "lint:md": "yarn run remark -u remark-preset-lint-consistent .",
102
103
  "lint": "yarn run lint:ts && yarn run lint:md",
103
104
  "test": "mocha",
@@ -152,5 +153,5 @@
152
153
  "bugs": {
153
154
  "url": "https://github.com/Borewit/music-metadata/issues"
154
155
  },
155
- "packageManager": "yarn@4.9.2"
156
+ "packageManager": "yarn@4.18.0"
156
157
  }
@@ -92,7 +92,7 @@ console.log(concatUint8Arrays([a, b]));
92
92
  //=> Uint8Array [1, 2, 3, 4, 5, 6]
93
93
  ```
94
94
  */
95
- export function concatUint8Arrays(arrays: Uint8Array[], totalLength?: number): Uint8Array<ArrayBuffer>;
95
+ export function concatUint8Arrays(arrays: Array<Uint8Array | ArrayBuffer>, totalLength?: number): Uint8Array<ArrayBuffer>;
96
96
 
97
97
  /**
98
98
  Check if two arrays are identical by verifying that they contain the same bytes in the same sequence.
@@ -114,7 +114,7 @@ console.log(areUint8ArraysEqual(a, c));
114
114
  //=> false
115
115
  ```
116
116
  */
117
- export function areUint8ArraysEqual(a: Uint8Array, b: Uint8Array): boolean;
117
+ export function areUint8ArraysEqual(a: Uint8Array | ArrayBuffer, b: Uint8Array | ArrayBuffer): boolean;
118
118
 
119
119
  /**
120
120
  Compare two arrays and indicate their relative order or equality. Useful for sorting.
@@ -133,7 +133,7 @@ const array3 = new Uint8Array([7, 8, 9]);
133
133
  //=> [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
134
134
  ```
135
135
  */
136
- export function compareUint8Arrays(a: Uint8Array, b: Uint8Array): 0 | 1 | -1;
136
+ export function compareUint8Arrays(a: Uint8Array | ArrayBuffer, b: Uint8Array | ArrayBuffer): 0 | 1 | -1;
137
137
 
138
138
  /**
139
139
  Convert a `Uint8Array` to a string.
@@ -193,7 +193,7 @@ console.log(uint8ArrayToBase64(byteArray));
193
193
  //=> 'SGVsbG8='
194
194
  ```
195
195
  */
196
- export function uint8ArrayToBase64(array: Uint8Array, options?: {urlSafe: boolean}): string;
196
+ export function uint8ArrayToBase64(array: Uint8Array | ArrayBuffer, options?: {urlSafe: boolean}): string;
197
197
 
198
198
  /**
199
199
  Convert a Base64-encoded or [Base64URL](https://base64.guru/standards/base64url)-encoded string to a `Uint8Array`.
@@ -261,7 +261,7 @@ console.log(uint8ArrayToHex(byteArray));
261
261
  //=> '48656c6c6f'
262
262
  ```
263
263
  */
264
- export function uint8ArrayToHex(array: Uint8Array): string;
264
+ export function uint8ArrayToHex(array: Uint8Array | ArrayBuffer): string;
265
265
 
266
266
  /**
267
267
  Convert a Hex string to a `Uint8Array`.
@@ -310,7 +310,7 @@ console.log(indexOf(byteArray, new Uint8Array([0x78, 0x90])));
310
310
  //=> 3
311
311
  ```
312
312
  */
313
- export function indexOf(array: Uint8Array, value: Uint8Array): number;
313
+ export function indexOf(array: Uint8Array | ArrayBuffer, value: Uint8Array | ArrayBuffer): number;
314
314
 
315
315
  /**
316
316
  Checks if the given sequence of bytes (`value`) is within the given `Uint8Array` (`array`).
@@ -328,4 +328,4 @@ console.log(includes(byteArray, new Uint8Array([0x78, 0x90])));
328
328
  //=> true
329
329
  ```
330
330
  */
331
- export function includes(array: Uint8Array, value: Uint8Array): boolean;
331
+ export function includes(array: Uint8Array | ArrayBuffer, value: Uint8Array | ArrayBuffer): boolean;
@@ -26,6 +26,10 @@ function isUint8ArrayOrArrayBuffer(value) {
26
26
  return isUint8Array(value) || isArrayBuffer(value);
27
27
  }
28
28
 
29
+ function toUint8ArrayIfArrayBuffer(value) {
30
+ return isArrayBuffer(value) ? new Uint8Array(value) : value;
31
+ }
32
+
29
33
  export function assertUint8Array(value) {
30
34
  if (!isUint8Array(value)) {
31
35
  throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof value}\``);
@@ -55,13 +59,14 @@ export function concatUint8Arrays(arrays, totalLength) {
55
59
  return new Uint8Array(0);
56
60
  }
57
61
 
58
- totalLength ??= arrays.reduce((accumulator, currentValue) => accumulator + currentValue.length, 0);
62
+ totalLength ??= arrays.reduce((accumulator, currentValue) => accumulator + currentValue.byteLength, 0);
59
63
 
60
64
  const returnValue = new Uint8Array(totalLength);
61
65
 
62
66
  let offset = 0;
63
- for (const array of arrays) {
64
- assertUint8Array(array);
67
+ for (let array of arrays) {
68
+ assertUint8ArrayOrArrayBuffer(array);
69
+ array = toUint8ArrayIfArrayBuffer(array);
65
70
  returnValue.set(array, offset);
66
71
  offset += array.length;
67
72
  }
@@ -70,8 +75,10 @@ export function concatUint8Arrays(arrays, totalLength) {
70
75
  }
71
76
 
72
77
  export function areUint8ArraysEqual(a, b) {
73
- assertUint8Array(a);
74
- assertUint8Array(b);
78
+ assertUint8ArrayOrArrayBuffer(a);
79
+ assertUint8ArrayOrArrayBuffer(b);
80
+ a = toUint8ArrayIfArrayBuffer(a);
81
+ b = toUint8ArrayIfArrayBuffer(b);
75
82
 
76
83
  if (a === b) {
77
84
  return true;
@@ -92,8 +99,10 @@ export function areUint8ArraysEqual(a, b) {
92
99
  }
93
100
 
94
101
  export function compareUint8Arrays(a, b) {
95
- assertUint8Array(a);
96
- assertUint8Array(b);
102
+ assertUint8ArrayOrArrayBuffer(a);
103
+ assertUint8ArrayOrArrayBuffer(b);
104
+ a = toUint8ArrayIfArrayBuffer(a);
105
+ b = toUint8ArrayIfArrayBuffer(b);
97
106
 
98
107
  const length = Math.min(a.length, b.length);
99
108
 
@@ -147,7 +156,8 @@ function base64UrlToBase64(base64url) {
147
156
  const MAX_BLOCK_SIZE = 65_535;
148
157
 
149
158
  export function uint8ArrayToBase64(array, {urlSafe = false} = {}) {
150
- assertUint8Array(array);
159
+ assertUint8ArrayOrArrayBuffer(array);
160
+ array = toUint8ArrayIfArrayBuffer(array);
151
161
 
152
162
  let base64 = '';
153
163
 
@@ -178,7 +188,8 @@ export function base64ToString(base64String) {
178
188
  const byteToHexLookupTable = Array.from({length: 256}, (_, index) => index.toString(16).padStart(2, '0'));
179
189
 
180
190
  export function uint8ArrayToHex(array) {
181
- assertUint8Array(array);
191
+ assertUint8ArrayOrArrayBuffer(array);
192
+ array = toUint8ArrayIfArrayBuffer(array);
182
193
 
183
194
  // Concatenating a string is faster than using an array.
184
195
  let hexString = '';
@@ -273,11 +284,14 @@ export function getUintBE(view) {
273
284
  }
274
285
 
275
286
  /**
276
- @param {Uint8Array} array
277
- @param {Uint8Array} value
287
+ @param {Uint8Array | ArrayBuffer} array
288
+ @param {Uint8Array | ArrayBuffer} value
278
289
  @returns {number}
279
290
  */
280
291
  export function indexOf(array, value) {
292
+ array = toUint8ArrayIfArrayBuffer(array);
293
+ value = toUint8ArrayIfArrayBuffer(value);
294
+
281
295
  const arrayLength = array.length;
282
296
  const valueLength = value.length;
283
297
 
@@ -309,8 +323,8 @@ export function indexOf(array, value) {
309
323
  }
310
324
 
311
325
  /**
312
- @param {Uint8Array} array
313
- @param {Uint8Array} value
326
+ @param {Uint8Array | ArrayBuffer} array
327
+ @param {Uint8Array | ArrayBuffer} value
314
328
  @returns {boolean}
315
329
  */
316
330
  export function includes(array, value) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uint8array-extras",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Useful utilities for working with Uint8Array (and Buffer)",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/uint8array-extras",
@@ -20,7 +20,7 @@
20
20
  "node": ">=18"
21
21
  },
22
22
  "scripts": {
23
- "test": "xo && ava && tsc index.d.ts"
23
+ "test": "xo && ava && tsc --lib es2023 index.d.ts"
24
24
  },
25
25
  "files": [
26
26
  "index.js",
@@ -46,9 +46,9 @@
46
46
  "hexadecimal"
47
47
  ],
48
48
  "devDependencies": {
49
- "ava": "^6.0.1",
50
- "typescript": "^5.3.3",
51
- "xo": "^0.56.0",
52
- "benchmark": "2.1.4"
49
+ "ava": "^6.4.1",
50
+ "benchmark": "2.1.4",
51
+ "typescript": "^5.9.3",
52
+ "xo": "^1.2.3"
53
53
  }
54
54
  }