@openclaw/matrix 2026.11.7 → 2026.11.10-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 (354) hide show
  1. package/dist/.setup/{account-config-CRsKoMqJ.mjs → account-config-CVM2a28p.mjs} +1 -2
  2. package/dist/.setup/{account-selection-UUPhMBmu.mjs → account-selection-Cow3TMFO.mjs} +5 -8
  3. package/dist/.setup/{approval-handler.runtime-LBvkygUK.mjs → approval-handler.runtime-KhjfA3Qm.mjs} +8 -9
  4. package/dist/.setup/{approval-reactions-BazmsDbe.mjs → approval-reactions-Bz_8XB01.mjs} +2 -3
  5. package/dist/.setup/{backup-health-Dm_YMVFT.mjs → backup-health-BxH69np2.mjs} +1 -2
  6. package/dist/.setup/{channel-CHryi9FS.mjs → channel-DkjJIQBk.mjs} +30 -40
  7. package/dist/.setup/{channel.runtime-DluXWaGb.mjs → channel.runtime-DOjRmnx0.mjs} +10 -12
  8. package/dist/.setup/{channel.setup-BDbs0FLq.mjs → channel.setup-tIeMccfh.mjs} +9 -7
  9. package/dist/.setup/{cli-C7Jmy2x4.mjs → cli-CChA7Tf5.mjs} +23 -31
  10. package/dist/.setup/{cli-doctor-BVstkgJE.mjs → cli-doctor-CoRX0erj.mjs} +3 -4
  11. package/dist/.setup/{cli-metadata-B0GHIn05.mjs → cli-metadata-FwlOHfdX.mjs} +3 -5
  12. package/dist/.setup/{client-Bk_tBqNp.mjs → client-BVgnwwz0.mjs} +21 -26
  13. package/dist/.setup/{client-mFRVrUt3.mjs → client-BgOKS4W7.mjs} +4 -5
  14. package/dist/.setup/{client-bootstrap-Bhhri97J.mjs → client-bootstrap-CHs5OQ1Z.mjs} +2 -3
  15. package/dist/.setup/{client-support-B_Mp4Qk9.mjs → client-support-CqXAOZp3.mjs} +2 -3
  16. package/dist/.setup/{config-paths-CnREYb1Y.mjs → config-paths-DBpHxDyc.mjs} +1 -2
  17. package/dist/.setup/{create-client-CzUtZgYF.mjs → create-client-mnjEWdZV.mjs} +8 -9
  18. package/dist/.setup/{credentials-kT20jk_u.mjs → credentials-CGgWuhFV.mjs} +5 -6
  19. package/dist/.setup/{credentials-read-CM6wXUjL.mjs → credentials-read-rPqEpuxv.mjs} +5 -6
  20. package/dist/.setup/{credentials-state-B3cuUFwZ.mjs → credentials-state-jxq29yQw.mjs} +1 -2
  21. package/dist/.setup/{crypto-node.runtime-6Aj_ltHQ.mjs → crypto-node.runtime-E_hqXGxm.mjs} +1 -2
  22. package/dist/.setup/{crypto-runtime-BI9Pc344.mjs → crypto-runtime-tZ95jwNO.mjs} +10 -15
  23. package/dist/.setup/{crypto-state-store-BZLlwkv_.mjs → crypto-state-store-CzAmeC_Z.mjs} +4 -4
  24. package/dist/.setup/{crypto-store-ownership-CiQ1l_O7.mjs → crypto-store-ownership-DPO9WcVz.mjs} +3 -4
  25. package/dist/.setup/{crypto-unsafe-state-doctor-CmF1X1dZ.mjs → crypto-unsafe-state-doctor-D3WLE-t4.mjs} +6 -7
  26. package/dist/.setup/{deps-D-W_QQjz.mjs → deps-CVPT2Ros.mjs} +1 -2
  27. package/dist/.setup/{device-health-Ck2YpEVN.mjs → device-health-D7n-lPeb.mjs} +2 -3
  28. package/dist/.setup/{direct-management-Dp1giZ34.mjs → direct-management-D59C1WO-.mjs} +7 -11
  29. package/dist/.setup/{directory-live-DmkH9hcp.mjs → directory-live-CQNKUJJx.mjs} +5 -6
  30. package/dist/.setup/{doctor-contract-BANpMUbP.mjs → doctor-contract-GiXgCj7k.mjs} +2 -3
  31. package/dist/.setup/{draft-stream-bVedfEB3.mjs → draft-stream-B1hQ9Mgx.mjs} +3 -4
  32. package/dist/.setup/{encryption-guidance-Br3Lv9Hm.mjs → encryption-guidance-DfbEaKct.mjs} +3 -4
  33. package/dist/.setup/{env-vars-aEBngJPa.mjs → env-vars-Bh1iOXJ1.mjs} +1 -2
  34. package/dist/.setup/{errors-Bw4EHwKX.mjs → errors-CL3YJV8U.mjs} +1 -2
  35. package/dist/.setup/{event-helpers-CxNgMQqH.mjs → event-helpers-DDUjVVf7.mjs} +1 -2
  36. package/dist/.setup/{exec-approvals-BeYF9-3o.mjs → exec-approvals-C692_FeS.mjs} +6 -9
  37. package/dist/.setup/{file-sync-store-BpS12yaK.mjs → file-sync-store-CAhnwOPA.mjs} +6 -36
  38. package/dist/.setup/{http-client-B_ohXrBm.mjs → http-client-CqnKFKUH.mjs} +5 -8
  39. package/dist/.setup/{idb-persistence-BTOsltD9.mjs → idb-persistence-DeGUs--C.mjs} +6 -7
  40. package/dist/.setup/{idb-persistence-lock-Bh3ZLIsE.mjs → idb-persistence-lock-CH2K6d_3.mjs} +1 -2
  41. package/dist/.setup/{joined-room-encryption-C0gHa2DG.mjs → joined-room-encryption-9sJK1kM-.mjs} +2 -3
  42. package/dist/.setup/{logger-CuAzdD8Q.mjs → logger-B9TwnY6C.mjs} +2 -3
  43. package/dist/.setup/{logging-CoaEyRtA.mjs → logging-Bnsn7s4r.mjs} +3 -4
  44. package/dist/.setup/{messages-BqVczVlt.mjs → messages-DSS3EtqP.mjs} +9 -14
  45. package/dist/.setup/{monitor-BsSo3tCv.mjs → monitor-Ci1BOpAp.mjs} +94 -136
  46. package/dist/.setup/{onboarding-CoMpgTiK.mjs → onboarding-DA5lN0I1.mjs} +10 -11
  47. package/dist/.setup/{outbound-ntm0KOfK.mjs → outbound-CFFxi_uJ.mjs} +5 -6
  48. package/dist/.setup/{profile-update-gC436enW.mjs → profile-update-DP-a-BxL.mjs} +7 -9
  49. package/dist/.setup/{reaction-events-DTThoaJQ.mjs → reaction-events-B8JhmXYM.mjs} +8 -9
  50. package/dist/.setup/{resolve-targets-CWW9zTYp.mjs → resolve-targets-B3NLls5a.mjs} +4 -5
  51. package/dist/.setup/{retired-state-JGUEBE72.mjs → retired-state-BsxdpJNk.mjs} +3 -41
  52. package/dist/.setup/{room-info-CM3MKoh4.mjs → room-info-gld8p2j7.mjs} +6 -8
  53. package/dist/.setup/{runtime-1kn1P6io.mjs → runtime-Ck8TjD7L.mjs} +1 -2
  54. package/dist/.setup/{runtime-doctor-migrations-hxP-CXX7.mjs → runtime-doctor-migrations-CSvRANPN.mjs} +5 -10
  55. package/dist/.setup/{runtime-setter-api-i2MOXoT3.mjs → runtime-setter-api-CpwhcBQK.mjs} +1 -1
  56. package/dist/.setup/{sdk-ByFgA6Il.mjs → sdk-Bzp2OIxv.mjs} +33 -48
  57. package/dist/.setup/{secret-contract-DxyzKSzf.mjs → secret-contract-AKnr45nw.mjs} +2 -3
  58. package/dist/.setup/{secret-contract-api-Dukgvike.mjs → secret-contract-api-DMSwMIxd.mjs} +1 -1
  59. package/dist/.setup/{send-DFB7JGg2.mjs → send-COg4UAcR.mjs} +58 -44
  60. package/dist/.setup/{send-currentness-DGxiiBn9.mjs → send-currentness-D1x6YP9O.mjs} +2 -4
  61. package/dist/.setup/{setup-bootstrap-razh2kSp.mjs → setup-bootstrap-DCCxNvFW.mjs} +4 -5
  62. package/dist/.setup/{setup-core-BVbxltMM.mjs → setup-core-BRD4PRVa.mjs} +13 -20
  63. package/dist/.setup/setup-plugin-api-YtkxNQTz.mjs +2 -0
  64. package/dist/.setup/sqlite-state-D6Zpz1q1.mjs +36 -0
  65. package/dist/.setup/{startup-verification-UkaoSldm.mjs → startup-verification-DfOuAruK.mjs} +5 -5
  66. package/dist/.setup/{state-layout-walk-BQMgMykU.mjs → state-layout-walk-BqCZTHpp.mjs} +2 -3
  67. package/dist/.setup/{storage-C3N6YZIn.mjs → storage-CCarF_gm.mjs} +9 -10
  68. package/dist/.setup/{storage-paths-B51JM-pC.mjs → storage-paths-e_Vq6cvw.mjs} +1 -2
  69. package/dist/.setup/{subagent-hooks-CfGAysJi.mjs → subagent-hooks-BdbuojSv.mjs} +2 -3
  70. package/dist/.setup/{sync-cache-state-BKVaKRzQ.mjs → sync-cache-state-BMvqW4Ii.mjs} +5 -5
  71. package/dist/.setup/{sync-state-CWbp0QSY.mjs → sync-state-Cu1nagBV.mjs} +1 -2
  72. package/dist/.setup/{target-ids-HhcaKX1n.mjs → target-ids-DltG_ZHJ.mjs} +1 -2
  73. package/dist/.setup/{task-runner-DY3aKiQa.mjs → task-runner-CYyGHdNW.mjs} +1 -2
  74. package/dist/.setup/{thread-binding-api-BvuaKpd0.mjs → thread-binding-api-OtSciHmZ.mjs} +2 -3
  75. package/dist/.setup/{thread-bindings-D5VJEDZV.mjs → thread-bindings-DrYooQd3.mjs} +54 -23
  76. package/dist/.setup/{thread-bindings-shared-QmZOfX9Q.mjs → thread-bindings-shared-DEAGGuDA.mjs} +6 -3
  77. package/dist/.setup/{tool-actions-DexlmVDf.mjs → tool-actions-4dKbrHJ5.mjs} +25 -25
  78. package/dist/.setup/{url-validation-By_2hsXr.mjs → url-validation-DesoKUns.mjs} +1 -2
  79. package/dist/.setup/{verification-B122bsH2.mjs → verification-DIxfxgMv.mjs} +4 -5
  80. package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +1 -1
  81. package/dist/api.js +8 -8
  82. package/dist/auth-presence.js +2 -3
  83. package/dist/channel-plugin-api.js +1 -1
  84. package/dist/cli-metadata.js +1 -1
  85. package/dist/contract-api.js +2 -2
  86. package/dist/doctor-contract-api.js +15 -17
  87. package/dist/helper-api.js +3 -3
  88. package/dist/index.js +3 -4
  89. package/dist/plugin-entry.handlers.runtime.js +3 -4
  90. package/dist/runtime-api.js +7 -8
  91. package/dist/runtime-setter-api.js +1 -1
  92. package/dist/secret-contract-api.js +1 -1
  93. package/dist/session-binding-contract-api.js +2 -2
  94. package/dist/setup-entry.js +4 -5
  95. package/dist/setup-plugin-api.js +1 -1
  96. package/dist/subagent-hooks-api.js +2 -3
  97. package/dist/thread-binding-api.js +1 -1
  98. package/dist/thread-bindings-runtime.js +1 -1
  99. package/node_modules/@tokenizer/inflate/README.md +57 -17
  100. package/node_modules/@tokenizer/inflate/lib/ZipHandler.d.ts +12 -1
  101. package/node_modules/@tokenizer/inflate/lib/ZipHandler.js +127 -57
  102. package/node_modules/@tokenizer/inflate/lib/ZipLimitError.d.ts +18 -4
  103. package/node_modules/@tokenizer/inflate/lib/ZipLimitError.js +1 -1
  104. package/node_modules/@tokenizer/inflate/lib/index.d.ts +1 -1
  105. package/node_modules/@tokenizer/inflate/node_modules/strtok3/LICENSE.txt +21 -0
  106. package/node_modules/@tokenizer/inflate/node_modules/strtok3/README.md +736 -0
  107. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbortSignal.d.ts +2 -0
  108. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbortSignal.js +7 -0
  109. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbstractTokenizer.d.ts +117 -0
  110. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/AbstractTokenizer.js +204 -0
  111. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BlobTokenizer.d.ts +29 -0
  112. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BlobTokenizer.js +57 -0
  113. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferSizeError.d.ts +19 -0
  114. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferSizeError.js +27 -0
  115. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferTokenizer.d.ts +29 -0
  116. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/BufferTokenizer.js +51 -0
  117. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/FileTokenizer.d.ts +47 -0
  118. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/FileTokenizer.js +83 -0
  119. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/NotRegularFileError.d.ts +5 -0
  120. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/NotRegularFileError.js +8 -0
  121. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +34 -0
  122. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/ReadStreamTokenizer.js +140 -0
  123. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerBoundaryError.d.ts +7 -0
  124. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerBoundaryError.js +10 -0
  125. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerView.d.ts +9 -0
  126. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/TokenizerView.js +184 -0
  127. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/core.d.ts +44 -0
  128. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/core.js +56 -0
  129. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/index.d.ts +17 -0
  130. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/index.js +46 -0
  131. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/isRandomAccessTokenizer.d.ts +6 -0
  132. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/isRandomAccessTokenizer.js +10 -0
  133. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +54 -0
  134. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/AbstractStreamReader.js +73 -0
  135. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Deferred.d.ts +6 -0
  136. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Deferred.js +10 -0
  137. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Errors.d.ts +10 -0
  138. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/Errors.js +16 -0
  139. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/StreamReader.d.ts +34 -0
  140. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/StreamReader.js +125 -0
  141. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +14 -0
  142. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamByobReader.js +29 -0
  143. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +19 -0
  144. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +67 -0
  145. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +24 -0
  146. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReader.js +13 -0
  147. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +5 -0
  148. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +19 -0
  149. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/index.d.ts +6 -0
  150. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/stream/index.js +5 -0
  151. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/types.d.ts +163 -0
  152. package/node_modules/@tokenizer/inflate/node_modules/strtok3/lib/types.js +1 -0
  153. package/node_modules/@tokenizer/inflate/node_modules/strtok3/package.json +97 -0
  154. package/node_modules/@tokenizer/inflate/package.json +5 -5
  155. package/node_modules/fake-indexeddb/README.md +7 -7
  156. package/node_modules/fake-indexeddb/build/cjs/lib/Index.js +47 -22
  157. package/node_modules/fake-indexeddb/build/cjs/lib/ObjectStore.js +4 -2
  158. package/node_modules/fake-indexeddb/build/cjs/lib/RecordStore.js +14 -9
  159. package/node_modules/fake-indexeddb/build/esm/lib/Index.js +47 -22
  160. package/node_modules/fake-indexeddb/build/esm/lib/ObjectStore.js +4 -2
  161. package/node_modules/fake-indexeddb/build/esm/lib/RecordStore.js +14 -9
  162. package/node_modules/fake-indexeddb/package.json +1 -1
  163. package/node_modules/file-type/node_modules/strtok3/README.md +154 -9
  164. package/node_modules/file-type/node_modules/strtok3/lib/AbstractTokenizer.d.ts +3 -0
  165. package/node_modules/file-type/node_modules/strtok3/lib/AbstractTokenizer.js +12 -4
  166. package/node_modules/file-type/node_modules/strtok3/lib/BlobTokenizer.js +1 -0
  167. package/node_modules/file-type/node_modules/strtok3/lib/BufferTokenizer.js +2 -1
  168. package/node_modules/file-type/node_modules/strtok3/lib/FileTokenizer.d.ts +1 -1
  169. package/node_modules/file-type/node_modules/strtok3/lib/FileTokenizer.js +3 -3
  170. package/node_modules/file-type/node_modules/strtok3/lib/ReadStreamTokenizer.js +17 -2
  171. package/node_modules/file-type/node_modules/strtok3/lib/TokenizerBoundaryError.d.ts +7 -0
  172. package/node_modules/file-type/node_modules/strtok3/lib/TokenizerBoundaryError.js +10 -0
  173. package/node_modules/file-type/node_modules/strtok3/lib/TokenizerView.d.ts +9 -0
  174. package/node_modules/file-type/node_modules/strtok3/lib/TokenizerView.js +184 -0
  175. package/node_modules/file-type/node_modules/strtok3/lib/core.d.ts +4 -1
  176. package/node_modules/file-type/node_modules/strtok3/lib/core.js +5 -18
  177. package/node_modules/file-type/node_modules/strtok3/lib/index.js +28 -5
  178. package/node_modules/file-type/node_modules/strtok3/lib/isRandomAccessTokenizer.d.ts +6 -0
  179. package/node_modules/file-type/node_modules/strtok3/lib/isRandomAccessTokenizer.js +10 -0
  180. package/node_modules/file-type/node_modules/strtok3/lib/stream/StreamReader.d.ts +4 -0
  181. package/node_modules/file-type/node_modules/strtok3/lib/stream/StreamReader.js +29 -8
  182. package/node_modules/file-type/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +12 -2
  183. package/node_modules/file-type/node_modules/strtok3/lib/types.d.ts +19 -2
  184. package/node_modules/file-type/node_modules/strtok3/package.json +10 -8
  185. package/node_modules/file-type/package.json +3 -3
  186. package/node_modules/file-type/source/detectors/ebml.js +31 -16
  187. package/node_modules/file-type/source/detectors/zip.js +21 -203
  188. package/node_modules/matrix-js-sdk/CHANGELOG.md +28 -0
  189. package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.d.ts +30 -25
  190. package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.d.ts.map +1 -1
  191. package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js +91 -100
  192. package/node_modules/matrix-js-sdk/lib/matrixrtc/CallMembership.js.map +1 -1
  193. package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.d.ts +6 -4
  194. package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.d.ts.map +1 -1
  195. package/node_modules/matrix-js-sdk/lib/matrixrtc/EncryptionManager.js.map +1 -1
  196. package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.d.ts +2 -15
  197. package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.d.ts.map +1 -1
  198. package/node_modules/matrix-js-sdk/lib/matrixrtc/IMembershipManager.js.map +1 -1
  199. package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts +36 -7
  200. package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.d.ts.map +1 -1
  201. package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js +29 -2
  202. package/node_modules/matrix-js-sdk/lib/matrixrtc/LivekitTransport.js.map +1 -1
  203. package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts +12 -51
  204. package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -1
  205. package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js +10 -66
  206. package/node_modules/matrix-js-sdk/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
  207. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts +5 -10
  208. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.d.ts.map +1 -1
  209. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js +25 -44
  210. package/node_modules/matrix-js-sdk/lib/matrixrtc/MembershipManager.js.map +1 -1
  211. package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.d.ts +8 -8
  212. package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.d.ts.map +1 -1
  213. package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js +30 -22
  214. package/node_modules/matrix-js-sdk/lib/matrixrtc/RTCEncryptionManager.js.map +1 -1
  215. package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js +7 -8
  216. package/node_modules/matrix-js-sdk/lib/matrixrtc/ToDeviceKeyTransport.js.map +1 -1
  217. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.d.ts +8 -13
  218. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.d.ts.map +1 -1
  219. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js +2 -11
  220. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/rtc.js.map +1 -1
  221. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.d.ts +6 -2
  222. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.d.ts.map +1 -1
  223. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js +3 -0
  224. package/node_modules/matrix-js-sdk/lib/matrixrtc/membershipData/session.js.map +1 -1
  225. package/node_modules/matrix-js-sdk/lib/matrixrtc/types.d.ts +5 -0
  226. package/node_modules/matrix-js-sdk/lib/matrixrtc/types.d.ts.map +1 -1
  227. package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js +5 -0
  228. package/node_modules/matrix-js-sdk/lib/matrixrtc/types.js.map +1 -1
  229. package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.d.ts +9 -2
  230. package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.d.ts.map +1 -1
  231. package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js +8 -5
  232. package/node_modules/matrix-js-sdk/lib/models/event-timeline-set.js.map +1 -1
  233. package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts +17 -2
  234. package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.d.ts.map +1 -1
  235. package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js +88 -47
  236. package/node_modules/matrix-js-sdk/lib/models/room-sticky-events.js.map +1 -1
  237. package/node_modules/matrix-js-sdk/lib/models/room.d.ts +1 -1
  238. package/node_modules/matrix-js-sdk/lib/models/room.d.ts.map +1 -1
  239. package/node_modules/matrix-js-sdk/lib/models/room.js +8 -2
  240. package/node_modules/matrix-js-sdk/lib/models/room.js.map +1 -1
  241. package/node_modules/matrix-js-sdk/lib/models/thread.d.ts.map +1 -1
  242. package/node_modules/matrix-js-sdk/lib/models/thread.js +23 -2
  243. package/node_modules/matrix-js-sdk/lib/models/thread.js.map +1 -1
  244. package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.d.ts +3 -3
  245. package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +1 -1
  246. package/node_modules/matrix-js-sdk/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -1
  247. package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.d.ts +95 -0
  248. package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.d.ts.map +1 -0
  249. package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.js +3 -0
  250. package/node_modules/matrix-js-sdk/lib/rendezvous/SignInWithQRFlow.js.map +1 -0
  251. package/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts +1 -0
  252. package/node_modules/matrix-js-sdk/lib/rendezvous/index.d.ts.map +1 -1
  253. package/node_modules/matrix-js-sdk/lib/rendezvous/index.js.map +1 -1
  254. package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js +5 -1
  255. package/node_modules/matrix-js-sdk/lib/rust-crypto/index.js.map +1 -1
  256. package/node_modules/matrix-js-sdk/package.json +3 -3
  257. package/node_modules/matrix-js-sdk/src/matrixrtc/CallMembership.ts +85 -95
  258. package/node_modules/matrix-js-sdk/src/matrixrtc/EncryptionManager.ts +6 -4
  259. package/node_modules/matrix-js-sdk/src/matrixrtc/IMembershipManager.ts +2 -15
  260. package/node_modules/matrix-js-sdk/src/matrixrtc/LivekitTransport.ts +58 -9
  261. package/node_modules/matrix-js-sdk/src/matrixrtc/MatrixRTCSession.ts +21 -80
  262. package/node_modules/matrix-js-sdk/src/matrixrtc/MembershipManager.ts +23 -40
  263. package/node_modules/matrix-js-sdk/src/matrixrtc/RTCEncryptionManager.ts +51 -39
  264. package/node_modules/matrix-js-sdk/src/matrixrtc/ToDeviceKeyTransport.ts +7 -7
  265. package/node_modules/matrix-js-sdk/src/matrixrtc/membershipData/rtc.ts +9 -23
  266. package/node_modules/matrix-js-sdk/src/matrixrtc/membershipData/session.ts +14 -2
  267. package/node_modules/matrix-js-sdk/src/matrixrtc/types.ts +6 -0
  268. package/node_modules/matrix-js-sdk/src/models/event-timeline-set.ts +19 -4
  269. package/node_modules/matrix-js-sdk/src/models/room-sticky-events.ts +92 -58
  270. package/node_modules/matrix-js-sdk/src/models/room.ts +8 -2
  271. package/node_modules/matrix-js-sdk/src/models/thread.ts +25 -3
  272. package/node_modules/matrix-js-sdk/src/rendezvous/MSC4108SignInWithQR.ts +3 -3
  273. package/node_modules/matrix-js-sdk/src/rendezvous/SignInWithQRFlow.ts +117 -0
  274. package/node_modules/matrix-js-sdk/src/rendezvous/index.ts +1 -0
  275. package/node_modules/matrix-js-sdk/src/rust-crypto/index.ts +5 -1
  276. package/node_modules/music-metadata/README.md +62 -67
  277. package/node_modules/music-metadata/lib/ParserFactory.js +3 -1
  278. package/node_modules/music-metadata/lib/aiff/AiffParser.d.ts +2 -0
  279. package/node_modules/music-metadata/lib/aiff/AiffParser.js +42 -3
  280. package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +1 -0
  281. package/node_modules/music-metadata/lib/aiff/AiffToken.js +1 -0
  282. package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +11 -1
  283. package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +2 -2
  284. package/node_modules/music-metadata/lib/asf/AsfObject.js +81 -111
  285. package/node_modules/music-metadata/lib/asf/AsfParser.js +5 -3
  286. package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +27 -3
  287. package/node_modules/music-metadata/lib/asf/AsfUtil.d.ts +1 -1
  288. package/node_modules/music-metadata/lib/caf/CafParser.js +13 -2
  289. package/node_modules/music-metadata/lib/caf/CafToken.d.ts +2 -2
  290. package/node_modules/music-metadata/lib/caf/CafToken.js +9 -2
  291. package/node_modules/music-metadata/lib/common/Allocation.d.ts +6 -0
  292. package/node_modules/music-metadata/lib/common/Allocation.js +18 -0
  293. package/node_modules/music-metadata/lib/common/GenericTagMapper.js +1 -1
  294. package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +2 -0
  295. package/node_modules/music-metadata/lib/common/MetadataCollector.js +21 -4
  296. package/node_modules/music-metadata/lib/common/Util.d.ts +4 -0
  297. package/node_modules/music-metadata/lib/common/Util.js +34 -1
  298. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.d.ts +4 -1
  299. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +32 -36
  300. package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +6 -2
  301. package/node_modules/music-metadata/lib/flac/FlacParser.js +2 -1
  302. package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +7 -3
  303. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +91 -46
  304. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +6 -0
  305. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.d.ts +5 -0
  306. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +6 -4
  307. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +2 -1
  308. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +57 -15
  309. package/node_modules/music-metadata/lib/lrc/LyricsParser.d.ts +18 -2
  310. package/node_modules/music-metadata/lib/lrc/LyricsParser.js +14 -3
  311. package/node_modules/music-metadata/lib/mp4/Atom.d.ts +3 -3
  312. package/node_modules/music-metadata/lib/mp4/Atom.js +14 -7
  313. package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +25 -25
  314. package/node_modules/music-metadata/lib/mp4/AtomToken.js +136 -119
  315. package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +16 -2
  316. package/node_modules/music-metadata/lib/mp4/MP4Parser.js +370 -132
  317. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.js +30 -0
  318. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +19 -8
  319. package/node_modules/music-metadata/lib/ogg/OggParser.js +6 -2
  320. package/node_modules/music-metadata/lib/ogg/OggToken.d.ts +2 -2
  321. package/node_modules/music-metadata/lib/ogg/OggToken.js +3 -9
  322. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +9 -11
  323. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +111 -27
  324. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +6 -0
  325. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.js +6 -0
  326. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.d.ts +2 -2
  327. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +8 -4
  328. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +1 -0
  329. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +23 -3
  330. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.d.ts +4 -0
  331. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +15 -2
  332. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.js +1 -0
  333. package/node_modules/music-metadata/lib/type.d.ts +23 -6
  334. package/node_modules/music-metadata/lib/wav/BwfChunk.d.ts +12 -2
  335. package/node_modules/music-metadata/lib/wav/BwfChunk.js +39 -11
  336. package/node_modules/music-metadata/lib/wav/WaveParser.js +13 -2
  337. package/node_modules/music-metadata/package.json +2 -1
  338. package/node_modules/typebox/build/format/date_time.d.mts +2 -1
  339. package/node_modules/typebox/build/format/date_time.mjs +12 -3
  340. package/node_modules/typebox/package.json +1 -1
  341. package/package.json +8 -8
  342. package/dist/.setup/setup-plugin-api-CQKySg7F.mjs +0 -2
  343. package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/auto.js +0 -54
  344. package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/binarySearchTree.js +0 -413
  345. package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/fakeIndexedDB.js +0 -1018
  346. package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/forceCloseDatabase.js +0 -99
  347. package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/getAll.js +0 -707
  348. package/node_modules/fake-indexeddb/build/cjs/test/fakeIndexedDB/memoryLeaks.js +0 -42
  349. package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/auto.js +0 -52
  350. package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/binarySearchTree.js +0 -409
  351. package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/fakeIndexedDB.js +0 -1014
  352. package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/forceCloseDatabase.js +0 -95
  353. package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/getAll.js +0 -703
  354. package/node_modules/fake-indexeddb/build/esm/test/fakeIndexedDB/memoryLeaks.js +0 -38
@@ -2253,7 +2253,7 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {
2253
2253
  /**
2254
2254
  * Processes poll events:
2255
2255
  * If the event has a decryption failure, it will listen for decryption and tries again.
2256
- * If it is a poll start event (`m.poll.start`),
2256
+ * If it is a poll start event (`m.poll.start`) for a poll not yet known to the room,
2257
2257
  * it creates and stores a Poll model and emits a PollEvent.New event.
2258
2258
  * If the event is related to a poll, it will add it to the poll.
2259
2259
  * Noop for other cases.
@@ -2269,6 +2269,10 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {
2269
2269
  }
2270
2270
 
2271
2271
  if (M_POLL_START.matches(event.getType())) {
2272
+ // Check that we don't already have the poll as events can arrive more than once
2273
+ // in some situations. If we add the poll twice, it will break the existing poll model.
2274
+ if (this.polls.has(event.getId()!)) return;
2275
+
2272
2276
  try {
2273
2277
  const poll = new Poll(event, this.client, this);
2274
2278
  this.polls.set(event.getId()!, poll);
@@ -3132,7 +3136,9 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {
3132
3136
  threadId = "",
3133
3137
  } = this.eventShouldLiveIn(event, neighbouringEvents, threadRoots);
3134
3138
 
3135
- if (!shouldLiveInThread && !shouldLiveInRoom && event.isRelation()) {
3139
+ // Cached relations are aggregated below and attach when their parent is later hydrated.
3140
+ // Avoid blocking offline startup on a parent fetch.
3141
+ if (!fromCache && !shouldLiveInThread && !shouldLiveInRoom && event.isRelation()) {
3136
3142
  try {
3137
3143
  const parentEvent = new MatrixEvent(
3138
3144
  await this.client.fetchRoomEvent(this.roomId, event.relationEventId!),
@@ -68,6 +68,28 @@ export function determineFeatureSupport(stable: boolean, unstable: boolean): Fea
68
68
  }
69
69
  }
70
70
 
71
+ /**
72
+ * Cap on how many threads fetch their initial events at the same time. Each fetch is a (recursive) `/relations`
73
+ * request, and opening a thread list creates every thread in the room at once; without a cap a room with dozens
74
+ * of threads fires dozens of concurrent heavy requests, which can starve everything else the homeserver worker is doing.
75
+ */
76
+ const MAX_CONCURRENT_INITIAL_FETCHES = 3;
77
+ let runningInitialFetches = 0;
78
+ const waitingInitialFetches: (() => void)[] = [];
79
+
80
+ async function withInitialFetchSlot<T>(fn: () => Promise<T>): Promise<T> {
81
+ if (runningInitialFetches >= MAX_CONCURRENT_INITIAL_FETCHES) {
82
+ await new Promise<void>((resolve) => waitingInitialFetches.push(resolve));
83
+ }
84
+ runningInitialFetches++;
85
+ try {
86
+ return await fn();
87
+ } finally {
88
+ runningInitialFetches--;
89
+ waitingInitialFetches.shift()?.();
90
+ }
91
+ }
92
+
71
93
  export class Thread extends ReadReceipt<ThreadEmittedEvents, ThreadEventHandlerMap> {
72
94
  public static hasServerSideSupport = FeatureSupport.None;
73
95
  public static hasServerSideListSupport = FeatureSupport.None;
@@ -679,9 +701,9 @@ export class Thread extends ReadReceipt<ThreadEmittedEvents, ThreadEventHandlerM
679
701
  this.timelineSet.addEventsToTimeline([this.rootEvent], true, false, this.liveTimeline, null);
680
702
  this.liveTimeline.setPaginationToken(null, Direction.Backward);
681
703
  } else {
682
- this.initalEventFetchProm = this.client.paginateEventTimeline(this.liveTimeline, {
683
- backwards: true,
684
- });
704
+ this.initalEventFetchProm = withInitialFetchSlot(() =>
705
+ this.client.paginateEventTimeline(this.liveTimeline, { backwards: true }),
706
+ );
685
707
  await this.initalEventFetchProm;
686
708
  }
687
709
  // We have now fetched the initial events, so set the flag. We need to do this before
@@ -36,7 +36,7 @@ import {
36
36
  type ValidatedAuthMetadata,
37
37
  waitForDeviceAuthorization,
38
38
  } from "../oauth/index.ts";
39
- import { type CryptoApi } from "../crypto-api/index.ts";
39
+ import { type SignInWithQRSecrets, type SignInWithQRFlow } from "./SignInWithQRFlow.ts";
40
40
 
41
41
  /**
42
42
  * Enum representing the payload types transmissible over [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108)
@@ -106,7 +106,7 @@ interface AcceptedPayload extends MSC4108Payload {
106
106
  type: PayloadType.ProtocolAccepted;
107
107
  }
108
108
 
109
- interface SecretsPayload extends MSC4108Payload, Awaited<ReturnType<NonNullable<CryptoApi["exportSecretsBundle"]>>> {
109
+ interface SecretsPayload extends MSC4108Payload, SignInWithQRSecrets {
110
110
  type: PayloadType.Secrets;
111
111
  }
112
112
 
@@ -115,7 +115,7 @@ interface SecretsPayload extends MSC4108Payload, Awaited<ReturnType<NonNullable<
115
115
  * sign in with QR + OAuth2 flow.
116
116
  * @experimental Note that this is UNSTABLE and may have breaking changes without notice.
117
117
  */
118
- export class MSC4108SignInWithQR {
118
+ export class MSC4108SignInWithQR implements SignInWithQRFlow {
119
119
  private readonly ourIntent: QrCodeIntent;
120
120
  private _code?: Uint8Array;
121
121
  private expectingNewDeviceId?: string;
@@ -0,0 +1,117 @@
1
+ /*
2
+ Copyright 2026 Element Creations Ltd.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */
16
+
17
+ import {
18
+ type ClientRendezvousFailureReason,
19
+ type MSC4108FailureReason,
20
+ type RendezvousFailureListener,
21
+ } from "./RendezvousFailureReason.ts";
22
+ import { type DeviceAccessTokenResponse, type ValidatedAuthMetadata } from "../oauth/index.ts";
23
+ import type { SecretsBundleJson } from "../@types/matrix-sdk-crypto-wasm.d.ts";
24
+
25
+ /**
26
+ * The secrets bundle shared from the existing device to the new device.
27
+ * @experimental Note that this is UNSTABLE and may have breaking changes without notice.
28
+ */
29
+ export type { SecretsBundleJson as SignInWithQRSecrets } from "../@types/matrix-sdk-crypto-wasm.d.ts";
30
+
31
+ /**
32
+ * Common interface for the sign in with QR + OAuth2 flows, e.g. the 2024 and 2025 versions of
33
+ * [MSC4108](https://github.com/matrix-org/matrix-spec-proposals/pull/4108).
34
+ * @experimental Note that this is UNSTABLE and may have breaking changes without notice.
35
+ */
36
+ export interface SignInWithQRFlow {
37
+ /**
38
+ * Callback for when the rendezvous fails.
39
+ */
40
+ onFailure?: RendezvousFailureListener;
41
+
42
+ /**
43
+ * Returns the check code for the secure channel or undefined if not generated yet.
44
+ */
45
+ readonly checkCode: string | undefined;
46
+
47
+ /**
48
+ * Returns the code representing the rendezvous suitable for rendering in a QR code or undefined if not generated yet.
49
+ */
50
+ readonly code: Uint8Array | undefined;
51
+
52
+ /**
53
+ * Returns true if the device is the already logged in device reciprocating a new login on the other side of the channel.
54
+ */
55
+ readonly isExistingDevice: boolean;
56
+
57
+ /**
58
+ * Returns true if the device is the new device logging in being reciprocated by the device on the other side of the channel.
59
+ */
60
+ readonly isNewDevice: boolean;
61
+
62
+ /**
63
+ * Generate the code including doing partial set up of the channel where required.
64
+ */
65
+ generateCode(): Promise<void>;
66
+
67
+ /**
68
+ * The first step in the OAuth2 QR login process.
69
+ * To be called after the QR code has been rendered or scanned.
70
+ * The scanning device has to discover the homeserver details, if they scanned the code then they already have it.
71
+ * If the new device is the one rendering the QR code then it has to wait be sent the homeserver details via the rendezvous channel.
72
+ *
73
+ * Depending on the version of the flow, the homeserver is identified either by `serverName` or `baseUrl`.
74
+ */
75
+ negotiateProtocols(): Promise<{ serverName?: string; baseUrl?: string }>;
76
+
77
+ /**
78
+ * The second & third step in the OAuth2 QR login process.
79
+ * To be called after `negotiateProtocols` for the existing device.
80
+ * To be called after OAuth2 negotiation for the new device.
81
+ *
82
+ * @param input - Required for the new device to start the device authorization grant, not required for the existing device reciprocating the login
83
+ */
84
+ deviceAuthorizationGrant(input?: { metadata: ValidatedAuthMetadata; clientId: string; deviceId: string }): Promise<{
85
+ verificationUri?: string;
86
+ userCode?: string;
87
+ }>;
88
+
89
+ /**
90
+ * The fourth step in the OAuth2 QR login process.
91
+ * The reciprocating device must perform step 5 for this method to resolve.
92
+ * To be called after {@link deviceAuthorizationGrant} only on the new device.
93
+ */
94
+ completeLoginOnNewDevice(input: { clientId: string }): Promise<DeviceAccessTokenResponse | undefined>;
95
+
96
+ /**
97
+ * The fifth (and final) step in the OAuth2 QR login process.
98
+ * To be called after the new device has completed authentication.
99
+ */
100
+ shareSecrets(): Promise<{ secrets?: SecretsBundleJson }>;
101
+
102
+ /**
103
+ * Decline the login on the existing device.
104
+ */
105
+ declineLoginOnExistingDevice(): Promise<void>;
106
+
107
+ /**
108
+ * Cancels the rendezvous session.
109
+ * @param reason the reason for the cancellation
110
+ */
111
+ cancel(reason: MSC4108FailureReason | ClientRendezvousFailureReason): Promise<void>;
112
+
113
+ /**
114
+ * Closes the rendezvous session.
115
+ */
116
+ close(): Promise<void>;
117
+ }
@@ -23,6 +23,7 @@ import { RendezvousIntent } from "./RendezvousIntent.ts";
23
23
  import { logger } from "../logger.ts";
24
24
 
25
25
  export * from "./MSC4108SignInWithQR.ts";
26
+ export type * from "./SignInWithQRFlow.ts";
26
27
  export type * from "./RendezvousChannel.ts";
27
28
  export type * from "./RendezvousCode.ts";
28
29
  export * from "./RendezvousError.ts";
@@ -286,7 +286,11 @@ async function initOlmMachine(
286
286
  logger.info(
287
287
  `Checking for pending key bundle for recently-joined room ${roomId} (joined ${new Date(pendingDetails.inviteAcceptedAtMillis).toISOString()})`,
288
288
  );
289
- await rustCrypto.maybeAcceptKeyBundle(roomId, pendingDetails.inviterId.toString());
289
+ // Launch `maybeAcceptKeyBundle` without awaiting it so it cannot block crypto initialisation.
290
+ // Failed or interrupted key queries/downloads leave the pending marker for a later startup to retry.
291
+ rustCrypto.maybeAcceptKeyBundle(roomId, pendingDetails.inviterId.toString()).catch((err) => {
292
+ logger.error("Error attempting to download a pending room key bundle", err);
293
+ });
290
294
  } else {
291
295
  logger.info(
292
296
  `Clearing pending-key-bundle flag for room ${roomId} (too old: joined ${new Date(pendingDetails.inviteAcceptedAtMillis).toISOString()})`,
@@ -615,6 +615,12 @@ Returns a list of supported MIME-types. This may include some MIME-types which a
615
615
  Files, buffers, and Blobs support chapters whether `moov` appears before or after `mdat`.
616
616
  For forward-only streams, `moov` must appear before the chapter data.
617
617
 
618
+ - `maxChapterCount`: `number` (default: `1000`)
619
+
620
+ Maximum chapters returned from QuickTime/Nero MP4 and ID3v2 chapter lists.
621
+ Must be a positive safe integer. Excess chapters are omitted with a warning.
622
+ MP4 chapters still require `includeChapters: true`.
623
+
618
624
  - `maxMemoryAllocation`: `number` (default: `67108864`, 64 MiB)
619
625
 
620
626
  Maximum bytes buffered for a single metadata payload, accumulated Ogg packet, or tokenizer stream lookahead.
@@ -627,6 +633,12 @@ Returns a list of supported MIME-types. This may include some MIME-types which a
627
633
  Audio/video data that is skipped does not count toward this limit. This does not cap total process memory:
628
634
  decoded metadata, multiple retained tags, and temporary copies can require additional memory.
629
635
 
636
+ - `maxMetadataEntries`: `number` (default: `100000`)
637
+
638
+ Maximum entries in an individual decoded metadata list, table, or buffered container structure.
639
+ Must be a positive safe integer. Raise this for files with larger retained tables.
640
+ This count is independent of `maxMemoryAllocation` and does not limit total collected metadata or process memory.
641
+
630
642
  - `mkvUseIndex`: `boolean` (default: `false`)
631
643
 
632
644
  When `true`, the parser uses the SeekHead index in Matroska (MKV) files to skip segment and cluster elements.
@@ -650,6 +662,8 @@ Returns a list of supported MIME-types. This may include some MIME-types which a
650
662
 
651
663
  When `true`, embedded cover art (images) will not be extracted.
652
664
  Useful for reducing memory and processing when cover images are unnecessary.
665
+ MP4 JPEG/PNG bodies are skipped before buffering, so skipped artwork may exceed
666
+ `maxMemoryAllocation`. Buffered metadata values remain subject to that limit.
653
667
 
654
668
  - `skipPostHeaders`: `boolean` (default: `false`)
655
669
  When `true`, tag headers located at the end of the file will not be read.
@@ -690,6 +704,43 @@ Audio format information. Defined in the TypeScript `IFormat` interface:
690
704
  - `format.modificationTime?: Date` Track modification / tag update time
691
705
  - `format.trackGain?: number` Track gain in dB
692
706
  - `format.albumGain?: number` Album gain in dB
707
+ - [`format.chapters?: IChapter[]`](#metadataformatchapters) Chapter titles and timestamps, when available
708
+
709
+ #### `metadata.format.chapters`
710
+
711
+ Chapters use the `IChapter` interface. For MP4 QuickTime and Nero chapter lists,
712
+ set `includeChapters: true` when parsing. Each chapter has a `title` (which can be
713
+ empty), a `start` timestamp, and an optional `end` timestamp.
714
+
715
+ Use the chapter's own `timeScale` to convert both timestamps to seconds. When
716
+ `timeScale` is omitted, its default is **1**: timestamps are already in seconds.
717
+ Do not assume that every chapter uses milliseconds or the audio sample rate.
718
+ A QuickTime chapter track with a missing or zero timescale is rejected; an
719
+ available Nero chapter list is used instead.
720
+
721
+ | Chapter source | Timestamp units | `timeScale` |
722
+ | --- | --- | --- |
723
+ | ID3v2 CHAP | Seconds | Omitted (equivalent to `1`) |
724
+ | MP4 QuickTime chapter track | Chapter track time units | Chapter track's timescale |
725
+ | MP4 Nero `chpl` | 100-nanosecond units | `10000000` |
726
+
727
+ ```js
728
+ import { parseFile } from 'music-metadata';
729
+
730
+ const { format } = await parseFile('audiobook.m4b', { includeChapters: true });
731
+ const chapters = (format.chapters ?? []).map(chapter => {
732
+ const timeScale = chapter.timeScale ?? 1;
733
+ return {
734
+ title: chapter.title,
735
+ startSeconds: chapter.start / timeScale,
736
+ endSeconds: chapter.end === undefined ? undefined : chapter.end / timeScale
737
+ };
738
+ });
739
+ ```
740
+
741
+ An omitted `end` means the parser did not provide an end timestamp. Applications
742
+ that need chapter ends must choose how to derive missing values. `sampleOffset`,
743
+ when present, is a separate audio sample position; it is not the timestamp scale.
693
744
 
694
745
  #### `metadata.format.trackInfo`
695
746
 
@@ -710,41 +761,16 @@ for (const track of videoTracks) {
710
761
  console.log(format.containerDuration, format.overallBitrate);
711
762
  ```
712
763
 
713
- Each entry describes one discovered track. The order follows container discovery and does not identify
714
- a preferred track; use `type`, container flags, and language to choose one. In MPEG-4, the codec and
715
- media properties describe the first sample description, even when the track has multiple sample descriptions. In Ogg, entries describe
716
- logical media streams; Skeleton headers do not create media tracks. Single-stream audio parsers map
717
- their format properties to one audio track after parsing.
718
-
719
- Properties are optional when unavailable and are not copied between tracks. In particular, a container
720
- or summary bitrate is not a per-track bitrate. The existing `format.duration` and `format.bitrate`
721
- fields retain their summary semantics. Use `containerDuration` for the complete presentation and
722
- `overallBitrate` for the actual file size multiplied by eight and divided by that duration. These
723
- statistics remain unset when timing is unavailable; `overallBitrate` also requires a known input size.
724
-
725
- MPEG-4 derives audio and video timing from media headers, sample tables, and fragments, including
726
- fragment defaults and decode timestamps. Track bitrates use sample sizes and duration; video properties
727
- include encoded dimensions, display dimensions, and average frame rate. ASF supplies stream dimensions,
728
- stream bitrates, and extended stream timing and frame rate when present. Standalone and nested Stream
729
- Properties Objects describe actual streams; Codec List entries supply names without creating unused tracks.
730
-
731
- Matroska applies specified defaults for flags, language, channels, and sample rate, and prefers IETF
732
- language tags when present. Track statistics tags provide duration, bitrate, and frame count; without
733
- these tags, per-track timing may be unavailable even when segment duration is known. Media clusters
734
- are not scanned to calculate missing track statistics.
735
-
736
- Ogg/Theora duration comes from granule positions. Set `duration: true` to allow scanning beyond the
737
- initial metadata pages. Once a video stream has been fully read, its average bitrate uses that logical
738
- stream's payload bytes, including codec headers and excluding Ogg framing and other streams. Resolution
739
- and frame rate are available from the identification header. Audio streams retain their own codec
740
- bitrate semantics.
741
-
742
- For Ogg/Opus, the per-track average bitrate uses the logical stream's payload bytes, including codec
743
- headers and excluding Ogg framing and other streams. It requires the logical stream's end-of-stream
744
- (EOS) page and a known duration; reaching input EOF alone is insufficient. Set `duration: true` to
745
- allow scanning when needed. The summary `format.bitrate` retains
746
- its existing file-size estimate and can differ from the per-track bitrate. Vorbis and Speex use nominal
747
- bitrates when their headers provide them.
764
+ Each entry describes one track, with its codec, language, duration, bitrate and
765
+ available audio or video properties. Choose tracks by type, language and selection
766
+ flags; their order does not indicate a preferred track.
767
+
768
+ Track properties describe the individual stream, and fields may be absent when
769
+ information is unavailable. Set `duration: true` when you need timing information;
770
+ this can require reading beyond the initial metadata.
771
+
772
+ Use `format.containerDuration` and `format.overallBitrate` for the complete file's
773
+ duration and average bitrate.
748
774
 
749
775
  `metadata.format.trackInfo` is an array of [trackInfo](#trackinfo) objects, empty when no track information is available.
750
776
 
@@ -847,38 +873,7 @@ import {uint8ArrayToBase64} from 'uint8array-extras';
847
873
  img.src = `data:${picture.format};base64,${uint8ArrayToBase64(picture.data)}`;
848
874
  ```
849
875
 
850
- ## Dependencies
851
-
852
- Dependency diagram:
853
- ```mermaid
854
- graph TD;
855
- MMN("music-metadata (Node.js entry point)")-->MMP
856
- MMN-->FTN
857
- MMP("music-metadata (primary entry point)")-->S(strtok3)
858
- MMP-->TY(token-types)
859
- MMP-->FTP
860
- MMP-->UAE
861
- FTN("file-type (Node.js entry point)")-->FTP
862
- FTP("file-type (primary entry point)")-->S
863
- S(strtok3)-->TO("@tokenizer/token")
864
- TY(token-types)-->TO
865
- TY-->IE("ieee754")
866
- FTP-->TY
867
- NS("node:stream")
868
- FTN-->NS
869
- FTP-->UAE(uint8array-extras)
870
- style NS fill:#F88,stroke:#A44
871
- style IE fill:#CCC,stroke:#888
872
- style FTN fill:#FAA,stroke:#A44
873
- style MMN fill:#FAA,stroke:#A44
874
- ```
875
-
876
- Dependency list:
877
- - [tokenizer-token](https://github.com/Borewit/tokenizer-token)
878
- - [strtok3](https://github.com/Borewit/strtok3)
879
- - [token-types](https://github.com/Borewit/token-types)
880
- - [file-type](https://github.com/sindresorhus/file-type)
881
- - [@tokenizer-token](https://github.com/Borewit/tokenizer-token)
876
+ For the internal design and dependencies, see the [architecture guide](doc/architecture.md).
882
877
 
883
878
  ## CommonJS backward compatibility
884
879
 
@@ -7,7 +7,7 @@ import { aiffParserLoader } from './aiff/AiffLoader.js';
7
7
  import { apeParserLoader } from './apev2/Apev2Loader.js';
8
8
  import { asfParserLoader } from './asf/AsfLoader.js';
9
9
  import { cafParserLoader } from './caf/CafLoader.js';
10
- import { getMaxMemoryAllocation } from './common/Allocation.js';
10
+ import { getMaxChapterCount, getMaxMemoryAllocation, getMaxMetadataEntries } from './common/Allocation.js';
11
11
  import { MetadataCollector } from './common/MetadataCollector.js';
12
12
  import { createAudioTrackInfo, finalizeContainerInfo } from './common/TrackInfo.js';
13
13
  import { scanAppendingHeaders } from './core.js';
@@ -61,6 +61,8 @@ export class ParserFactory {
61
61
  }
62
62
  async parse(tokenizer, parserLoader, opts = {}) {
63
63
  const maxBufferSize = getMaxMemoryAllocation(opts);
64
+ getMaxMetadataEntries(opts);
65
+ getMaxChapterCount(opts);
64
66
  if (isRandomAccessTokenizer(tokenizer)) {
65
67
  debug('tokenizer supports random-access, scanning for appending headers');
66
68
  await scanAppendingHeaders(tokenizer, opts);
@@ -10,6 +10,8 @@ import * as iff from '../iff/index.js';
10
10
  export declare class AIFFParser extends BasicParser {
11
11
  private isCompressed;
12
12
  private soundDataBytes;
13
+ private soundDataComplete;
14
+ private common;
13
15
  parse(): Promise<void>;
14
16
  readData(header: iff.IChunkHeader): Promise<number>;
15
17
  readTextChunk(header: iff.IChunkHeader): Promise<number>;
@@ -1,6 +1,7 @@
1
1
  import initDebug from 'debug';
2
2
  import * as strtok3 from 'strtok3';
3
3
  import * as Token from 'token-types';
4
+ import { getMaxMetadataEntries } from '../common/Allocation.js';
4
5
  import { BasicParser } from '../common/BasicParser.js';
5
6
  import { FourCcToken } from '../common/FourCC.js';
6
7
  import { parseEmbeddedID3v2 } from '../id3v2/EmbeddedID3v2.js';
@@ -18,6 +19,8 @@ const debug = initDebug('music-metadata:parser:aiff');
18
19
  export class AIFFParser extends BasicParser {
19
20
  isCompressed = null;
20
21
  soundDataBytes;
22
+ soundDataComplete = false;
23
+ common;
21
24
  async parse() {
22
25
  const header = await this.readToken(iff.Header);
23
26
  if (header.chunkID !== 'FORM') {
@@ -38,14 +41,27 @@ export class AIFFParser extends BasicParser {
38
41
  }
39
42
  this.metadata.setFormat('lossless', !this.isCompressed);
40
43
  this.metadata.setAudioOnly();
44
+ let remaining = header.chunkSize - FourCcToken.len;
45
+ if (remaining < 0) {
46
+ throw new AiffContentError(`Invalid FORM chunk size: ${header.chunkSize}`);
47
+ }
41
48
  try {
42
- while (!this.tokenizer.fileInfo.size ||
43
- this.tokenizer.fileInfo.size - this.tokenizer.position >= iff.Header.len) {
49
+ while (remaining >= iff.Header.len) {
44
50
  debug(`Reading AIFF chunk at offset=${this.tokenizer.position}`);
45
51
  const chunkHeader = await this.readToken(iff.Header);
52
+ remaining -= iff.Header.len;
53
+ const available = this.tokenizer.fileInfo.size;
54
+ if (chunkHeader.chunkSize > remaining ||
55
+ (available !== undefined && chunkHeader.chunkSize > available - this.tokenizer.position)) {
56
+ throw new AiffContentError(`Chunk ${chunkHeader.chunkID} size ${chunkHeader.chunkSize} exceeds remaining FORM data`);
57
+ }
46
58
  const nextChunk = 2 * Math.round(chunkHeader.chunkSize / 2);
47
59
  const bytesRead = await this.readData(chunkHeader);
48
- await this.tokenizer.ignore(nextChunk - bytesRead);
60
+ const ignored = await this.tokenizer.ignore(nextChunk - bytesRead);
61
+ if (chunkHeader.chunkID === 'SSND') {
62
+ this.soundDataComplete = ignored === nextChunk - bytesRead;
63
+ }
64
+ remaining -= nextChunk;
49
65
  }
50
66
  }
51
67
  catch (err) {
@@ -56,6 +72,20 @@ export class AIFFParser extends BasicParser {
56
72
  throw err;
57
73
  }
58
74
  }
75
+ // Apple IMA4 COMM stores packet counts; some encoders already store decoded
76
+ // frames. Only expand counts corroborated by the complete SSND payload.
77
+ // Each packet contains 64 frames in 34 bytes per channel.
78
+ const common = this.common;
79
+ if (common?.compressionType === 'ima4' &&
80
+ common.numChannels > 0 &&
81
+ common.numSampleFrames > 0 &&
82
+ common.sampleRate > 0 &&
83
+ this.soundDataComplete &&
84
+ this.soundDataBytes === common.numSampleFrames * common.numChannels * 34) {
85
+ const samples = common.numSampleFrames * 64;
86
+ this.metadata.setFormat('numberOfSamples', samples);
87
+ this.metadata.setFormat('duration', samples / common.sampleRate);
88
+ }
59
89
  // COMM and SSND can appear in either order.
60
90
  const duration = this.metadata.format.duration;
61
91
  if (this.soundDataBytes !== undefined && duration !== undefined && Number.isFinite(duration) && duration > 0) {
@@ -70,6 +100,7 @@ export class AIFFParser extends BasicParser {
70
100
  throw new AiffContentError('Failed to parse AIFF.COMM chunk when compression type is unknown');
71
101
  }
72
102
  const common = await this.readToken(new AiffToken.Common(header, this.isCompressed));
103
+ this.common = common;
73
104
  this.metadata.setFormat('bitsPerSample', common.sampleSize);
74
105
  this.metadata.setFormat('sampleRate', common.sampleRate);
75
106
  this.metadata.setFormat('numberOfChannels', common.numChannels);
@@ -86,6 +117,7 @@ export class AIFFParser extends BasicParser {
86
117
  return header.chunkSize;
87
118
  }
88
119
  case 'SSND': {
120
+ this.soundDataComplete = false;
89
121
  if (header.chunkSize < AiffToken.SoundDataHeader.len) {
90
122
  throw new AiffContentError('SSND chunk is too small to contain its header');
91
123
  }
@@ -109,6 +141,13 @@ export class AIFFParser extends BasicParser {
109
141
  }
110
142
  async readTextChunk(header) {
111
143
  const value = await this.readToken(new Token.StringType(header.chunkSize, 'ascii'));
144
+ let valueCount = 1;
145
+ for (let offset = value.indexOf('\0'); offset >= 0; offset = value.indexOf('\0', offset + 1)) {
146
+ ++valueCount;
147
+ }
148
+ if (valueCount > getMaxMetadataEntries(this.options)) {
149
+ throw new AiffContentError(`Text value count ${valueCount} exceeds entry limit ${getMaxMetadataEntries(this.options)}`);
150
+ }
112
151
  const values = value
113
152
  .split('\0')
114
153
  .map(v => v.trim())
@@ -1,6 +1,7 @@
1
1
  import type { IGetToken } from 'strtok3';
2
2
  import type * as iff from '../iff/index.js';
3
3
  export declare const compressionTypes: {
4
+ ima4: string;
4
5
  NONE: string;
5
6
  sowt: string;
6
7
  fl32: string;
@@ -2,6 +2,7 @@ import * as Token from 'token-types';
2
2
  import { FourCcToken } from '../common/FourCC.js';
3
3
  import { makeUnexpectedFileContentError } from '../ParseError.js';
4
4
  export const compressionTypes = {
5
+ ima4: 'IMA4 ADPCM',
5
6
  NONE: 'not compressed PCM Apple Computer',
6
7
  sowt: 'PCM (byte swapped)',
7
8
  fl32: '32-bit floating point IEEE 32-bit float',
@@ -2,7 +2,7 @@ import { textDecode } from '@borewit/text-codec';
2
2
  import initDebug from 'debug';
3
3
  import * as strtok3 from 'strtok3';
4
4
  import { StringType } from 'token-types';
5
- import { getTokenizerOptions, readBuffer } from '../common/Allocation.js';
5
+ import { getMaxMetadataEntries, getTokenizerOptions, readBuffer } from '../common/Allocation.js';
6
6
  import { BasicParser } from '../common/BasicParser.js';
7
7
  import * as util from '../common/Util.js';
8
8
  import { makeUnexpectedFileContentError } from '../ParseError.js';
@@ -99,6 +99,9 @@ export class APEv2Parser extends BasicParser {
99
99
  return this.tryParseApeHeader();
100
100
  }
101
101
  async parseTags(footer) {
102
+ if (footer.fields > getMaxMetadataEntries(this.options)) {
103
+ throw new ApeContentError(`Tag item count ${footer.fields} exceeds entry limit ${getMaxMetadataEntries(this.options)}`);
104
+ }
102
105
  const keyBuffer = new Uint8Array(256); // maximum tag key length
103
106
  let bytesRemaining = footer.size - TagFooter.len;
104
107
  debug(`Parse APE tags at offset=${this.tokenizer.position}, size=${bytesRemaining}`);
@@ -134,6 +137,13 @@ export class APEv2Parser extends BasicParser {
134
137
  case DataType.text_utf8: {
135
138
  // utf-8 text-string
136
139
  const value = textDecode(await this.readTagValue(tagItemHeader.size), 'utf-8');
140
+ let valueCount = 1;
141
+ for (let offset = value.indexOf('\0'); offset >= 0; offset = value.indexOf('\0', offset + 1)) {
142
+ ++valueCount;
143
+ }
144
+ if (valueCount > getMaxMetadataEntries(this.options)) {
145
+ throw new ApeContentError(`Text value count ${valueCount} exceeds entry limit ${getMaxMetadataEntries(this.options)}`);
146
+ }
137
147
  const values = value.split(/\x00/g);
138
148
  await Promise.all(values.map(val => this.metadata.addTag(tagFormat, key, val)));
139
149
  break;
@@ -1,4 +1,4 @@
1
- import type { IGetToken, ITokenizer } from 'strtok3';
1
+ import { type IGetToken, type ITokenizer } from 'strtok3';
2
2
  import type { AnyTagValue, IAudioTrack, IPicture, ITag, IVideoTrack } from '../type.js';
3
3
  import AsfGuid from './AsfGuid.js';
4
4
  declare const AsfContentParseError_base: {
@@ -241,7 +241,7 @@ export interface ICodecEntry {
241
241
  * 3.5: Read the Codec-List-Object, which provides user-friendly information about the codecs and formats used to encode the content found in the ASF file.
242
242
  * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_5
243
243
  */
244
- export declare function readCodecEntries(tokenizer: ITokenizer, payloadSize: number): Promise<ICodecEntry[]>;
244
+ export declare function readCodecEntries(tokenizer: ITokenizer, payloadSize: number, maxEntries?: number): Promise<ICodecEntry[]>;
245
245
  /**
246
246
  * 3.10 Content Description Object (optional, one only)
247
247
  * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_10