@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
@@ -86,7 +86,7 @@ This can be useful for converting a `Buffer` to a pure `Uint8Array`. `Buffer` is
86
86
 
87
87
  Tip: If you want a copy, just call `.slice()` on the return value.
88
88
 
89
- ### `concatUint8Arrays(arrays: Uint8Array[], totalLength?: number): Uint8Array`
89
+ ### `concatUint8Arrays(arrays: Array<Uint8Array | ArrayBuffer>, totalLength?: number): Uint8Array`
90
90
 
91
91
  Concatenate the given arrays into a new array.
92
92
 
@@ -106,7 +106,7 @@ console.log(concatUint8Arrays([a, b]));
106
106
  //=> Uint8Array [1, 2, 3, 4, 5, 6]
107
107
  ```
108
108
 
109
- ### `areUint8ArraysEqual(a: Uint8Array, b: Uint8Array): boolean`
109
+ ### `areUint8ArraysEqual(a: Uint8Array | ArrayBuffer, b: Uint8Array | ArrayBuffer): boolean`
110
110
 
111
111
  Check if two arrays are identical by verifying that they contain the same bytes in the same sequence.
112
112
 
@@ -126,7 +126,7 @@ console.log(areUint8ArraysEqual(a, c));
126
126
  //=> false
127
127
  ```
128
128
 
129
- ### `compareUint8Arrays(a: Uint8Array, b: Uint8Array): 0 | 1 | -1`
129
+ ### `compareUint8Arrays(a: Uint8Array | ArrayBuffer, b: Uint8Array | ArrayBuffer): 0 | 1 | -1`
130
130
 
131
131
  Compare two arrays and indicate their relative order or equality. Useful for sorting.
132
132
 
@@ -180,7 +180,7 @@ console.log(stringToUint8Array('Hello'));
180
180
  //=> Uint8Array [72, 101, 108, 108, 111]
181
181
  ```
182
182
 
183
- ### `uint8ArrayToBase64(array: Uint8Array, options?: {urlSafe: boolean}): string`
183
+ ### `uint8ArrayToBase64(array: Uint8Array | ArrayBuffer, options?: {urlSafe: boolean}): string`
184
184
 
185
185
  Convert a `Uint8Array` to a Base64-encoded string.
186
186
 
@@ -242,7 +242,7 @@ console.log(base64ToString('SGVsbG8='));
242
242
  //=> 'Hello'
243
243
  ```
244
244
 
245
- ### `uint8ArrayToHex(array: Uint8Array): string`
245
+ ### `uint8ArrayToHex(array: Uint8Array | ArrayBuffer): string`
246
246
 
247
247
  Convert a `Uint8Array` to a Hex string.
248
248
 
@@ -285,7 +285,7 @@ console.log(getUintBE(new DataView(byteArray.buffer)));
285
285
  //=> 20015998341291
286
286
  ```
287
287
 
288
- ### `indexOf(array: Uint8Array, value: Uint8Array): number`
288
+ ### `indexOf(array: Uint8Array | ArrayBuffer, value: Uint8Array | ArrayBuffer): number`
289
289
 
290
290
  Find the index of the first occurrence of the given sequence of bytes (`value`) within the given `Uint8Array` (`array`).
291
291
 
@@ -300,7 +300,7 @@ console.log(indexOf(byteArray, new Uint8Array([0x78, 0x90])));
300
300
  //=> 3
301
301
  ```
302
302
 
303
- ### `includes(array: Uint8Array, value: Uint8Array): boolean`
303
+ ### `includes(array: Uint8Array | ArrayBuffer, value: Uint8Array | ArrayBuffer): boolean`
304
304
 
305
305
  Checks if the given sequence of bytes (`value`) is within the given `Uint8Array` (`array`).
306
306
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/matrix",
3
- "version": "2026.10.2",
3
+ "version": "2026.10.5-beta.2",
4
4
  "description": "OpenClaw Matrix channel plugin for rooms and direct messages.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,17 +9,17 @@
9
9
  "type": "module",
10
10
  "dependencies": {
11
11
  "@matrix-org/matrix-sdk-crypto-nodejs": "0.6.6",
12
- "@matrix-org/matrix-sdk-crypto-wasm": "18.8.0",
13
- "@openclaw/fs-safe": "0.24.2",
12
+ "@matrix-org/matrix-sdk-crypto-wasm": "18.9.0",
13
+ "@openclaw/fs-safe": "0.25.0",
14
14
  "fake-indexeddb": "6.2.5",
15
15
  "markdown-it": "15.0.2",
16
16
  "matrix-js-sdk": "42.4.0",
17
- "music-metadata": "11.15.0",
17
+ "music-metadata": "11.16.1",
18
18
  "typebox": "1.3.34",
19
19
  "zod": "4.6.5"
20
20
  },
21
21
  "peerDependencies": {
22
- "openclaw": ">=2026.10.2"
22
+ "openclaw": ">=2026.10.5-beta.2"
23
23
  },
24
24
  "peerDependenciesMeta": {
25
25
  "openclaw": {
@@ -169,11 +169,11 @@
169
169
  "allowInvalidConfigRecovery": true
170
170
  },
171
171
  "compat": {
172
- "pluginApi": ">=2026.10.2"
172
+ "pluginApi": ">=2026.10.5-beta.2"
173
173
  },
174
174
  "build": {
175
175
  "bundledDist": false,
176
- "openclawVersion": "2026.10.2"
176
+ "openclawVersion": "2026.10.5-beta.2"
177
177
  },
178
178
  "release": {
179
179
  "publishToClawHub": true,
@@ -1,138 +0,0 @@
1
- import { a as resolveConfiguredMatrixAccountIds, d as resolveScopedMatrixEnvConfig, f as resolveMatrixAccountStringValues, l as resolveGlobalMatrixEnvConfig, s as resolveMatrixDefaultOrOnlyAccountId } from "./account-selection-BDeeqwwR.mjs";
2
- import { a as resolveMatrixAccountConfig, o as resolveMatrixBaseConfig, t as findMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
3
- import { a as loadMatrixCredentials, o as loadMatrixCredentialsAsync, r as credentialsMatchConfig, t as captureMatrixCredentialsEnv } from "./credentials-read-CqRiEAQa.mjs";
4
- import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
5
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
- import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
7
- //#region extensions/matrix/src/matrix/accounts.ts
8
- function clean(value) {
9
- return normalizeOptionalString(value) ?? "";
10
- }
11
- function resolveMatrixAccountAuthView(params) {
12
- const normalizedAccountId = normalizeAccountId(params.accountId);
13
- const matrix = resolveMatrixBaseConfig(params.cfg);
14
- const account = findMatrixAccountConfig(params.cfg, normalizedAccountId) ?? {};
15
- const resolvedStrings = resolveMatrixAccountStringValues({
16
- accountId: normalizedAccountId,
17
- account: {
18
- homeserver: clean(account.homeserver),
19
- userId: clean(account.userId),
20
- accessToken: typeof account.accessToken === "string" ? clean(account.accessToken) : "",
21
- password: typeof account.password === "string" ? clean(account.password) : "",
22
- deviceId: clean(account.deviceId),
23
- deviceName: clean(account.deviceName)
24
- },
25
- scopedEnv: resolveScopedMatrixEnvConfig(normalizedAccountId, params.env),
26
- channel: {
27
- homeserver: clean(matrix.homeserver),
28
- userId: clean(matrix.userId),
29
- accessToken: typeof matrix.accessToken === "string" ? clean(matrix.accessToken) : "",
30
- password: typeof matrix.password === "string" ? clean(matrix.password) : "",
31
- deviceId: clean(matrix.deviceId),
32
- deviceName: clean(matrix.deviceName)
33
- },
34
- globalEnv: resolveGlobalMatrixEnvConfig(params.env)
35
- });
36
- return {
37
- homeserver: resolvedStrings.homeserver,
38
- userId: resolvedStrings.userId,
39
- accessToken: resolvedStrings.accessToken || void 0,
40
- password: resolvedStrings.password || void 0
41
- };
42
- }
43
- function resolveMatrixAccountUserId(authView, stored) {
44
- const configuredUserId = authView.userId.trim();
45
- if (configuredUserId) return configuredUserId;
46
- if (!stored) return null;
47
- if (authView.homeserver && stored.homeserver !== authView.homeserver) return null;
48
- if (authView.accessToken && stored.accessToken !== authView.accessToken) return null;
49
- return stored.userId.trim() || null;
50
- }
51
- function listMatrixAccountIds(cfg) {
52
- const ids = resolveConfiguredMatrixAccountIds(cfg, process.env);
53
- return ids.length > 0 ? ids : [DEFAULT_ACCOUNT_ID];
54
- }
55
- function resolveDefaultMatrixAccountId(cfg, env = process.env) {
56
- return normalizeAccountId(resolveMatrixDefaultOrOnlyAccountId(cfg, env));
57
- }
58
- async function resolveConfiguredMatrixBotUserIds(params) {
59
- const env = params.env ?? process.env;
60
- const currentAccountId = normalizeAccountId(params.accountId);
61
- const accounts = [.../* @__PURE__ */ new Set([...resolveConfiguredMatrixAccountIds(params.cfg, env), DEFAULT_ACCOUNT_ID])].filter((accountId) => normalizeAccountId(accountId) !== currentAccountId).map((accountId) => prepareMatrixAccount({
62
- cfg: params.cfg,
63
- accountId,
64
- env
65
- }));
66
- const ids = /* @__PURE__ */ new Set();
67
- if (accounts.length === 0 || params.abortSignal?.aborted) return ids;
68
- const credentialsEnv = captureMatrixCredentialsEnv(env);
69
- for (const prepared of accounts) {
70
- if (params.abortSignal?.aborted) break;
71
- const stored = await loadMatrixCredentialsAsync(credentialsEnv, prepared.account.accountId);
72
- if (!isMatrixAccountConfigured(prepared, stored)) continue;
73
- const userId = resolveMatrixAccountUserId(prepared.authView, stored);
74
- if (userId) ids.add(userId);
75
- }
76
- return ids;
77
- }
78
- function prepareMatrixAccount(params) {
79
- const env = params.env ?? process.env;
80
- const accountId = normalizeAccountId(params.accountId ?? resolveDefaultMatrixAccountId(params.cfg, env));
81
- const matrixBase = resolveMatrixBaseConfig(params.cfg);
82
- const base = resolveMatrixAccountConfig({
83
- cfg: params.cfg,
84
- accountId,
85
- env
86
- });
87
- const explicitAuthConfig = accountId === DEFAULT_ACCOUNT_ID ? base : findMatrixAccountConfig(params.cfg, accountId) ?? {};
88
- const enabled = base.enabled !== false && matrixBase.enabled !== false;
89
- const authView = resolveMatrixAccountAuthView({
90
- cfg: params.cfg,
91
- accountId,
92
- env
93
- });
94
- const hasHomeserver = Boolean(authView.homeserver);
95
- const hasUserId = Boolean(authView.userId);
96
- const hasAccessToken = Boolean(authView.accessToken) || hasConfiguredSecretInput(explicitAuthConfig.accessToken);
97
- const hasPassword = Boolean(authView.password);
98
- const hasPasswordAuth = hasUserId && (hasPassword || hasConfiguredSecretInput(explicitAuthConfig.password));
99
- return {
100
- authView,
101
- hasHomeserver,
102
- hasConfiguredAuth: hasAccessToken || hasPasswordAuth,
103
- account: {
104
- accountId,
105
- enabled,
106
- name: normalizeOptionalString(base.name),
107
- homeserver: authView.homeserver || void 0,
108
- userId: authView.userId || void 0,
109
- config: base
110
- }
111
- };
112
- }
113
- function isMatrixAccountConfigured(prepared, stored) {
114
- const { authView } = prepared;
115
- const hasStored = stored && authView.homeserver ? credentialsMatchConfig(stored, {
116
- homeserver: authView.homeserver,
117
- userId: authView.userId || ""
118
- }) : false;
119
- return prepared.hasHomeserver && (prepared.hasConfiguredAuth || hasStored);
120
- }
121
- function resolveMatrixAccount(params) {
122
- const prepared = prepareMatrixAccount(params);
123
- const stored = prepared.hasHomeserver && !prepared.hasConfiguredAuth ? loadMatrixCredentials(params.env ?? process.env, prepared.account.accountId) : null;
124
- return {
125
- ...prepared.account,
126
- configured: isMatrixAccountConfigured(prepared, stored)
127
- };
128
- }
129
- async function resolveMatrixAccountAsync(params) {
130
- const prepared = prepareMatrixAccount(params);
131
- const stored = prepared.hasHomeserver && !prepared.hasConfiguredAuth ? await loadMatrixCredentialsAsync(captureMatrixCredentialsEnv(params.env ?? process.env), prepared.account.accountId) : null;
132
- return {
133
- ...prepared.account,
134
- configured: isMatrixAccountConfigured(prepared, stored)
135
- };
136
- }
137
- //#endregion
138
- export { resolveMatrixAccountAsync as a, resolveMatrixAccount as i, resolveConfiguredMatrixBotUserIds as n, resolveDefaultMatrixAccountId as r, listMatrixAccountIds as t };
@@ -1,102 +0,0 @@
1
- import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
2
- import { t as findMatrixAccountConfig } from "./account-config-CRsKoMqJ.mjs";
3
- import { n as resolveMatrixConfigPath, r as shouldStoreMatrixAccountAtTopLevel, t as resolveMatrixConfigFieldPath } from "./config-paths-CnREYb1Y.mjs";
4
- import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
5
- import { coerceSecretRef, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
6
- import { resolveOptionalIntegerOption } from "openclaw/plugin-sdk/number-runtime";
7
- //#region extensions/matrix/src/matrix/config-update.ts
8
- var config_update_exports = /* @__PURE__ */ __exportAll({
9
- resolveMatrixConfigFieldPath: () => resolveMatrixConfigFieldPath,
10
- resolveMatrixConfigPath: () => resolveMatrixConfigPath,
11
- shouldStoreMatrixAccountAtTopLevel: () => shouldStoreMatrixAccountAtTopLevel,
12
- updateMatrixAccountConfig: () => updateMatrixAccountConfig
13
- });
14
- function applyNullableField(target, key, value, normalize = (entry) => entry) {
15
- if (value === void 0) return;
16
- const normalized = value === null ? void 0 : normalize(value);
17
- if (normalized === void 0) delete target[key];
18
- else target[key] = normalized;
19
- }
20
- function normalizeMatrixSecretInput(value, key, defaults) {
21
- if (typeof value === "string") return normalizeSecretInputString(value) || void 0;
22
- const ref = coerceSecretRef(value, defaults);
23
- if (!ref) throw new Error(`Invalid Matrix ${key} SecretInput.`);
24
- return ref;
25
- }
26
- function cloneMatrixDmConfig(dm) {
27
- return {
28
- ...dm,
29
- ...dm.allowFrom ? { allowFrom: [...dm.allowFrom] } : {}
30
- };
31
- }
32
- function cloneMatrixRoomMap(rooms) {
33
- if (!rooms) return rooms;
34
- return Object.fromEntries(Object.entries(rooms).map(([roomId, roomCfg]) => [roomId, roomCfg ? { ...roomCfg } : roomCfg]));
35
- }
36
- function updateMatrixAccountConfig(cfg, accountId, patch) {
37
- const matrix = cfg.channels?.matrix ?? {};
38
- const normalizedAccountId = normalizeAccountId(accountId);
39
- const nextAccount = { ...findMatrixAccountConfig(cfg, normalizedAccountId) ?? (normalizedAccountId === DEFAULT_ACCOUNT_ID ? matrix : {}) };
40
- const trimString = (value) => value.trim() || void 0;
41
- applyNullableField(nextAccount, "name", patch.name, trimString);
42
- if (typeof patch.enabled === "boolean") nextAccount.enabled = patch.enabled;
43
- else if (typeof nextAccount.enabled !== "boolean") nextAccount.enabled = true;
44
- applyNullableField(nextAccount, "homeserver", patch.homeserver, trimString);
45
- applyNullableField(nextAccount, "proxy", patch.proxy, trimString);
46
- applyNullableField(nextAccount, "userId", patch.userId, trimString);
47
- for (const key of ["accessToken", "password"]) applyNullableField(nextAccount, key, patch[key], (value) => normalizeMatrixSecretInput(value, key, cfg.secrets?.defaults));
48
- applyNullableField(nextAccount, "deviceId", patch.deviceId, trimString);
49
- applyNullableField(nextAccount, "deviceName", patch.deviceName, trimString);
50
- applyNullableField(nextAccount, "avatarUrl", patch.avatarUrl, trimString);
51
- if (patch.allowPrivateNetwork !== void 0) {
52
- const nextNetwork = nextAccount.network && typeof nextAccount.network === "object" ? { ...nextAccount.network } : {};
53
- if (patch.allowPrivateNetwork === null) delete nextNetwork.dangerouslyAllowPrivateNetwork;
54
- else nextNetwork.dangerouslyAllowPrivateNetwork = patch.allowPrivateNetwork;
55
- if (Object.keys(nextNetwork).length > 0) nextAccount.network = nextNetwork;
56
- else delete nextAccount.network;
57
- }
58
- applyNullableField(nextAccount, "initialSyncLimit", patch.initialSyncLimit, (value) => resolveOptionalIntegerOption(value, { min: 0 }));
59
- applyNullableField(nextAccount, "encryption", patch.encryption);
60
- applyNullableField(nextAccount, "allowBots", patch.allowBots);
61
- applyNullableField(nextAccount, "autoJoin", patch.autoJoin);
62
- applyNullableField(nextAccount, "autoJoinAllowlist", patch.autoJoinAllowlist, (value) => [...value]);
63
- applyNullableField(nextAccount, "dm", patch.dm, (value) => cloneMatrixDmConfig({
64
- ...nextAccount.dm,
65
- ...value
66
- }));
67
- applyNullableField(nextAccount, "groupPolicy", patch.groupPolicy);
68
- applyNullableField(nextAccount, "groupAllowFrom", patch.groupAllowFrom, (value) => [...value]);
69
- for (const key of ["groups", "rooms"]) applyNullableField(nextAccount, key, patch[key], cloneMatrixRoomMap);
70
- const nextAccounts = Object.fromEntries(Object.entries(matrix.accounts ?? {}).filter(([rawAccountId]) => rawAccountId === normalizedAccountId || normalizeAccountId(rawAccountId) !== normalizedAccountId));
71
- if (shouldStoreMatrixAccountAtTopLevel(cfg, normalizedAccountId)) {
72
- const { accounts: _ignoredAccounts, defaultAccount } = matrix;
73
- const { accounts: _ignoredNextAccounts, defaultAccount: _ignoredNextDefaultAccount, ...topLevelAccount } = nextAccount;
74
- return {
75
- ...cfg,
76
- channels: {
77
- ...cfg.channels,
78
- matrix: {
79
- ...defaultAccount ? { defaultAccount } : {},
80
- enabled: true,
81
- ...topLevelAccount
82
- }
83
- }
84
- };
85
- }
86
- return {
87
- ...cfg,
88
- channels: {
89
- ...cfg.channels,
90
- matrix: {
91
- ...matrix,
92
- enabled: true,
93
- accounts: {
94
- ...nextAccounts,
95
- [normalizedAccountId]: nextAccount
96
- }
97
- }
98
- }
99
- };
100
- }
101
- //#endregion
102
- export { updateMatrixAccountConfig as n, config_update_exports as t };
@@ -1,80 +0,0 @@
1
- import { i as __exportAll } from "./doctor-contract-CsTNmbMa.mjs";
2
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
- //#region extensions/matrix/src/matrix/profile.ts
4
- var profile_exports = /* @__PURE__ */ __exportAll({
5
- isSupportedMatrixAvatarSource: () => isSupportedMatrixAvatarSource,
6
- syncMatrixOwnProfile: () => syncMatrixOwnProfile
7
- });
8
- const MATRIX_PROFILE_AVATAR_MAX_BYTES = 10485760;
9
- function isMatrixMxcUri(value) {
10
- return normalizeLowercaseStringOrEmpty(value).startsWith("mxc://");
11
- }
12
- function isMatrixHttpAvatarUri(value) {
13
- const normalized = normalizeLowercaseStringOrEmpty(value);
14
- return normalized.startsWith("https://") || normalized.startsWith("http://");
15
- }
16
- function isSupportedMatrixAvatarSource(value) {
17
- return isMatrixMxcUri(value) || isMatrixHttpAvatarUri(value);
18
- }
19
- async function resolveAvatarUrl(params) {
20
- const avatarPath = normalizeOptionalString(params.avatarPath) ?? null;
21
- const avatarSource = avatarPath ?? normalizeOptionalString(params.avatarUrl) ?? null;
22
- if (!avatarSource || !avatarPath && isMatrixMxcUri(avatarSource)) return {
23
- resolvedAvatarUrl: avatarSource,
24
- uploadedAvatarSource: null,
25
- convertedAvatarFromHttp: false
26
- };
27
- if (!avatarPath && !isMatrixHttpAvatarUri(avatarSource)) throw new Error("Matrix avatar URL must be an mxc:// URI or an http(s) URL.");
28
- const loadAvatar = avatarPath ? params.loadAvatarFromPath : params.loadAvatarFromUrl;
29
- if (!loadAvatar) throw new Error(avatarPath ? "Matrix avatar path upload requires a media loader." : "Matrix avatar URL conversion requires a media loader.");
30
- const media = await loadAvatar(avatarSource, params.avatarMaxBytes);
31
- return {
32
- resolvedAvatarUrl: await params.client.uploadContent(media.buffer, media.contentType, media.fileName || "avatar"),
33
- uploadedAvatarSource: avatarPath ? "path" : "http",
34
- convertedAvatarFromHttp: !avatarPath
35
- };
36
- }
37
- async function syncMatrixOwnProfile(params) {
38
- const desiredDisplayName = normalizeOptionalString(params.displayName) ?? null;
39
- const avatar = await resolveAvatarUrl({
40
- client: params.client,
41
- avatarUrl: params.avatarUrl ?? null,
42
- avatarPath: params.avatarPath ?? null,
43
- avatarMaxBytes: params.avatarMaxBytes ?? MATRIX_PROFILE_AVATAR_MAX_BYTES,
44
- loadAvatarFromUrl: params.loadAvatarFromUrl,
45
- loadAvatarFromPath: params.loadAvatarFromPath
46
- });
47
- const desiredAvatarUrl = avatar.resolvedAvatarUrl;
48
- if (!desiredDisplayName && !desiredAvatarUrl) return {
49
- skipped: true,
50
- displayNameUpdated: false,
51
- avatarUpdated: false,
52
- ...avatar,
53
- resolvedAvatarUrl: null
54
- };
55
- let currentDisplayName;
56
- let currentAvatarUrl;
57
- try {
58
- const currentProfile = await params.client.getUserProfile(params.userId);
59
- currentDisplayName = normalizeOptionalString(currentProfile.displayname);
60
- currentAvatarUrl = normalizeOptionalString(currentProfile.avatar_url);
61
- } catch {}
62
- let displayNameUpdated = false;
63
- let avatarUpdated = false;
64
- if (desiredDisplayName && currentDisplayName !== desiredDisplayName) {
65
- await params.client.setDisplayName(desiredDisplayName);
66
- displayNameUpdated = true;
67
- }
68
- if (desiredAvatarUrl && currentAvatarUrl !== desiredAvatarUrl) {
69
- await params.client.setAvatarUrl(desiredAvatarUrl);
70
- avatarUpdated = true;
71
- }
72
- return {
73
- skipped: false,
74
- displayNameUpdated,
75
- avatarUpdated,
76
- ...avatar
77
- };
78
- }
79
- //#endregion
80
- export { profile_exports as n, syncMatrixOwnProfile as r, isSupportedMatrixAvatarSource as t };