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