@openclaw/whatsapp 2026.9.5 → 2026.9.7

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 (359) hide show
  1. package/assets/icon.png +0 -0
  2. package/dist/.setup/{accounts-D_NGDjCx.mjs → accounts-CtRPAQCL.mjs} +3 -9
  3. package/dist/.setup/{action-runtime-DZZFamfl.mjs → action-runtime-DeVk5V7r.mjs} +2 -2
  4. package/dist/.setup/{agent-tools-login-B6MAs75N.mjs → agent-tools-login-CL5C1rA2.mjs} +5 -1
  5. package/dist/.setup/{approval-handler.runtime-C0hzmMSj.mjs → approval-handler.runtime-CjqMlPOX.mjs} +6 -26
  6. package/dist/.setup/{approval-reactions-BnXw-UZI.mjs → approval-reactions-DiOFvb1s.mjs} +8 -14
  7. package/dist/.setup/{auth-store-Dh8a3cba.mjs → auth-store-BBonwKks.mjs} +9 -33
  8. package/dist/.setup/{channel-CSclZYjU.mjs → channel-CJFE0kD_.mjs} +82 -154
  9. package/dist/.setup/{channel-react-action-1iBiEnq7.mjs → channel-react-action-2r_hjLZV.mjs} +4 -8
  10. package/dist/.setup/{channel.runtime-ddGY37w8.mjs → channel.runtime-C94goLw9.mjs} +4 -4
  11. package/dist/.setup/{channel.setup-CqUl8COe.mjs → channel.setup-CfN1UfdY.mjs} +1 -1
  12. package/dist/.setup/{connection-controller-C60mU7j7.mjs → connection-controller-CHo1oRJA.mjs} +13 -63
  13. package/dist/.setup/{creds-files-Drg3usj1.mjs → creds-files-CDATZWWM.mjs} +5 -11
  14. package/dist/.setup/{directory-config-BHPoBklt.mjs → directory-config-DUiJ5d8I.mjs} +13 -14
  15. package/dist/.setup/doctor-iMwg0Vhr.mjs +222 -0
  16. package/dist/.setup/group-config-path-DZr3ucUO.mjs +40 -0
  17. package/dist/.setup/{group-session-key-D22hYMdE.mjs → group-session-key-2-mja4OF.mjs} +3 -9
  18. package/dist/.setup/{login-2dmd1TfE.mjs → login-BFlvSh9h.mjs} +9 -11
  19. package/dist/.setup/{login-qr-CgKtO_ef.mjs → login-qr-Ayb8i25J.mjs} +29 -77
  20. package/dist/.setup/{monitor-BblvzLpX.mjs → monitor-CGpV2VNN.mjs} +391 -509
  21. package/dist/.setup/{question-reactions-D3Zq9Gbn.mjs → question-reactions-CPyyi5AY.mjs} +2 -2
  22. package/dist/.setup/rolldown-runtime-BBjsoOtd.mjs +27 -0
  23. package/dist/.setup/{send-C6jDmcL9.mjs → send-BGdvf5cC.mjs} +31 -80
  24. package/dist/.setup/{send-api-B4DOt2RJ.mjs → send-api-H4AkQJjT.mjs} +45 -109
  25. package/dist/.setup/{session-errors-JuazczrA.mjs → session-errors-B8UcAnZN.mjs} +1 -4
  26. package/dist/.setup/{session.runtime-DcJuO42v.mjs → session.runtime-st1konFI.mjs} +1 -1
  27. package/dist/.setup/{setup-finalize-BYEgU0hb.mjs → setup-finalize-DmPX4EaW.mjs} +32 -70
  28. package/dist/.setup/setup-plugin-api-vJlxKzca.mjs +3 -0
  29. package/dist/.setup/{setup-surface-Cd3wN5HD.mjs → setup-surface-43fj197P.mjs} +3 -3
  30. package/dist/.setup/{shared-C9OEtKgc.mjs → shared-DgOG5Iqr.mjs} +26 -37
  31. package/dist/.setup/{socket-close-CCVSFufF.mjs → socket-close-CT__V2fz.mjs} +80 -92
  32. package/dist/.setup/{targets-runtime-RBjx3pg_.mjs → targets-runtime-DmiqXIXO.mjs} +2 -7
  33. package/dist/action-runtime-api.js +1 -1
  34. package/dist/action-runtime.runtime.js +1 -1
  35. package/dist/agent-tools-api.js +6 -13
  36. package/dist/api.js +10 -10
  37. package/dist/auth-presence.js +1 -1
  38. package/dist/channel-plugin-api.js +1 -1
  39. package/dist/contract-api.js +2 -2
  40. package/dist/directory-contract-api.js +1 -1
  41. package/dist/doctor-contract-api.js +9 -10
  42. package/dist/light-runtime-api.js +3 -3
  43. package/dist/login-qr-runtime.js +1 -1
  44. package/dist/runtime-api.js +10 -10
  45. package/dist/setup-entry.js +1 -1
  46. package/dist/setup-plugin-api.js +1 -1
  47. package/node_modules/audio-decode/LICENSE +9 -10
  48. package/node_modules/audio-decode/README.md +16 -0
  49. package/node_modules/audio-decode/audio-decode.d.ts +2 -14
  50. package/node_modules/audio-decode/audio-decode.js +4 -92
  51. package/node_modules/audio-decode/meta.js +1 -0
  52. package/node_modules/audio-decode/node_modules/{audio-buffer → @audio/decode}/LICENSE +1 -1
  53. package/node_modules/audio-decode/node_modules/@audio/decode/audio-decode.d.ts +52 -0
  54. package/node_modules/audio-decode/node_modules/@audio/decode/audio-decode.js +242 -0
  55. package/node_modules/audio-decode/node_modules/@audio/decode/meta.js +14 -0
  56. package/node_modules/audio-decode/node_modules/@audio/decode/package.json +114 -0
  57. package/node_modules/audio-decode/node_modules/@audio/decode/readme.md +191 -0
  58. package/node_modules/audio-decode/node_modules/@audio/decode/stream.d.ts +12 -0
  59. package/node_modules/audio-decode/node_modules/@audio/decode/stream.js +1 -0
  60. package/node_modules/audio-decode/node_modules/@audio/decode/test.html +52 -0
  61. package/node_modules/audio-decode/node_modules/@audio/decode-aac/LICENSE +9 -0
  62. package/node_modules/audio-decode/node_modules/@audio/decode-aac/README.md +80 -0
  63. package/node_modules/audio-decode/node_modules/@audio/decode-aac/alac.js +326 -0
  64. package/node_modules/audio-decode/node_modules/@audio/decode-aac/audio.d.ts +15 -0
  65. package/node_modules/audio-decode/node_modules/@audio/decode-aac/audio.js +10 -0
  66. package/node_modules/audio-decode/node_modules/@audio/decode-aac/decode-aac.d.ts +24 -0
  67. package/node_modules/audio-decode/node_modules/@audio/decode-aac/decode-aac.js +452 -0
  68. package/node_modules/audio-decode/node_modules/@audio/decode-aac/meta.js +81 -0
  69. package/node_modules/audio-decode/node_modules/@audio/decode-aac/package.json +63 -0
  70. package/node_modules/audio-decode/node_modules/@audio/decode-aac/src/aac.wasm.js +0 -0
  71. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/LICENSE +12 -0
  72. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/LICENSE.liba52 +340 -0
  73. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/README.md +41 -0
  74. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/audio.d.ts +15 -0
  75. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/audio.js +9 -0
  76. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/decode-ac3.d.ts +20 -0
  77. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/decode-ac3.js +131 -0
  78. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/package.json +64 -0
  79. package/node_modules/audio-decode/node_modules/@audio/decode-ac3/src/ac3.wasm.js +0 -0
  80. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/LICENSE +21 -0
  81. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/README.md +46 -0
  82. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/audio.d.ts +15 -0
  83. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/audio.js +10 -0
  84. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/decode-aiff.d.ts +16 -0
  85. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/decode-aiff.js +583 -0
  86. package/node_modules/audio-decode/node_modules/@audio/decode-aiff/package.json +52 -0
  87. package/node_modules/audio-decode/node_modules/@audio/decode-amr/LICENSE +191 -0
  88. package/node_modules/audio-decode/node_modules/@audio/decode-amr/README.md +65 -0
  89. package/node_modules/audio-decode/node_modules/@audio/decode-amr/audio.d.ts +15 -0
  90. package/node_modules/audio-decode/node_modules/@audio/decode-amr/audio.js +10 -0
  91. package/node_modules/audio-decode/node_modules/@audio/decode-amr/decode-amr.d.ts +16 -0
  92. package/node_modules/audio-decode/node_modules/@audio/decode-amr/decode-amr.js +150 -0
  93. package/node_modules/audio-decode/node_modules/@audio/decode-amr/package.json +58 -0
  94. package/node_modules/audio-decode/node_modules/@audio/decode-amr/src/amr.wasm.js +0 -0
  95. package/node_modules/audio-decode/node_modules/@audio/decode-avi/LICENSE +21 -0
  96. package/node_modules/audio-decode/node_modules/@audio/decode-avi/README.md +53 -0
  97. package/node_modules/audio-decode/node_modules/@audio/decode-avi/audio.d.ts +15 -0
  98. package/node_modules/audio-decode/node_modules/@audio/decode-avi/audio.js +9 -0
  99. package/node_modules/audio-decode/node_modules/@audio/decode-avi/decode-avi.d.ts +21 -0
  100. package/node_modules/audio-decode/node_modules/@audio/decode-avi/decode-avi.js +241 -0
  101. package/node_modules/audio-decode/node_modules/@audio/decode-avi/package.json +66 -0
  102. package/node_modules/audio-decode/node_modules/@audio/decode-caf/LICENSE +21 -0
  103. package/node_modules/audio-decode/node_modules/@audio/decode-caf/README.md +48 -0
  104. package/node_modules/audio-decode/node_modules/@audio/decode-caf/audio.d.ts +15 -0
  105. package/node_modules/audio-decode/node_modules/@audio/decode-caf/audio.js +10 -0
  106. package/node_modules/audio-decode/node_modules/@audio/decode-caf/decode-caf.d.ts +16 -0
  107. package/node_modules/audio-decode/node_modules/@audio/decode-caf/decode-caf.js +238 -0
  108. package/node_modules/audio-decode/node_modules/@audio/decode-caf/package.json +53 -0
  109. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/LICENSE +21 -0
  110. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/README.md +73 -0
  111. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/audio.d.ts +21 -0
  112. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/audio.js +15 -0
  113. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/decode-dsd.d.ts +29 -0
  114. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/decode-dsd.js +423 -0
  115. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/meta.js +40 -0
  116. package/node_modules/audio-decode/node_modules/@audio/decode-dsd/package.json +64 -0
  117. package/node_modules/audio-decode/node_modules/@audio/decode-dts/LICENSE +12 -0
  118. package/node_modules/audio-decode/node_modules/@audio/decode-dts/LICENSE.libdca +339 -0
  119. package/node_modules/audio-decode/node_modules/@audio/decode-dts/README.md +41 -0
  120. package/node_modules/audio-decode/node_modules/@audio/decode-dts/audio.d.ts +15 -0
  121. package/node_modules/audio-decode/node_modules/@audio/decode-dts/audio.js +9 -0
  122. package/node_modules/audio-decode/node_modules/@audio/decode-dts/decode-dts.d.ts +20 -0
  123. package/node_modules/audio-decode/node_modules/@audio/decode-dts/decode-dts.js +139 -0
  124. package/node_modules/audio-decode/node_modules/@audio/decode-dts/package.json +64 -0
  125. package/node_modules/audio-decode/node_modules/@audio/decode-dts/src/dts.wasm.js +0 -0
  126. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/LICENSE +12 -0
  127. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/LICENSE.ffmpeg +502 -0
  128. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/README.md +45 -0
  129. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/audio.d.ts +15 -0
  130. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/audio.js +9 -0
  131. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/decode-eac3.d.ts +20 -0
  132. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/decode-eac3.js +124 -0
  133. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/package.json +68 -0
  134. package/node_modules/audio-decode/node_modules/@audio/decode-eac3/src/eac3.wasm.js +0 -0
  135. package/node_modules/audio-decode/node_modules/@audio/decode-flac/LICENSE +25 -0
  136. package/node_modules/audio-decode/node_modules/@audio/decode-flac/README.md +23 -0
  137. package/node_modules/audio-decode/node_modules/@audio/decode-flac/audio.d.ts +15 -0
  138. package/node_modules/audio-decode/node_modules/@audio/decode-flac/audio.js +10 -0
  139. package/node_modules/audio-decode/node_modules/@audio/decode-flac/decode-flac.d.ts +18 -0
  140. package/node_modules/audio-decode/node_modules/@audio/decode-flac/decode-flac.js +3172 -0
  141. package/node_modules/audio-decode/node_modules/@audio/decode-flac/meta.js +115 -0
  142. package/node_modules/audio-decode/node_modules/@audio/decode-flac/package.json +60 -0
  143. package/node_modules/audio-decode/node_modules/@audio/decode-mod/LICENSE +23 -0
  144. package/node_modules/audio-decode/node_modules/@audio/decode-mod/LICENSE.libopenmpt +25 -0
  145. package/node_modules/audio-decode/node_modules/@audio/decode-mod/README.md +86 -0
  146. package/node_modules/audio-decode/node_modules/@audio/decode-mod/audio.d.ts +20 -0
  147. package/node_modules/audio-decode/node_modules/@audio/decode-mod/audio.js +12 -0
  148. package/node_modules/audio-decode/node_modules/@audio/decode-mod/decode-mod.d.ts +58 -0
  149. package/node_modules/audio-decode/node_modules/@audio/decode-mod/decode-mod.js +148 -0
  150. package/node_modules/audio-decode/node_modules/@audio/decode-mod/package.json +68 -0
  151. package/node_modules/audio-decode/node_modules/@audio/decode-mod/src/mod.wasm.js +0 -0
  152. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/LICENSE +25 -0
  153. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/README.md +20 -0
  154. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/audio.d.ts +15 -0
  155. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/audio.js +10 -0
  156. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/decode-mp3.d.ts +16 -0
  157. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/decode-mp3.js +793 -0
  158. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/meta.js +143 -0
  159. package/node_modules/audio-decode/node_modules/@audio/decode-mp3/package.json +60 -0
  160. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/LICENSE +21 -0
  161. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/README.md +58 -0
  162. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/audio.d.ts +15 -0
  163. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/audio.js +9 -0
  164. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/decode-mp4.d.ts +21 -0
  165. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/decode-mp4.js +455 -0
  166. package/node_modules/audio-decode/node_modules/@audio/decode-mp4/package.json +74 -0
  167. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/LICENSE +31 -0
  168. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/LICENSE.libmpcdec +31 -0
  169. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/README.md +60 -0
  170. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/audio.d.ts +15 -0
  171. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/audio.js +9 -0
  172. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/decode-mpc.d.ts +20 -0
  173. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/decode-mpc.js +158 -0
  174. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/package.json +64 -0
  175. package/node_modules/audio-decode/node_modules/@audio/decode-mpc/src/mpc.wasm.js +0 -0
  176. package/node_modules/audio-decode/node_modules/@audio/decode-opus/LICENSE +25 -0
  177. package/node_modules/audio-decode/node_modules/@audio/decode-opus/LICENSE.libopus +44 -0
  178. package/node_modules/audio-decode/node_modules/@audio/decode-opus/README.md +32 -0
  179. package/node_modules/audio-decode/node_modules/@audio/decode-opus/audio.d.ts +15 -0
  180. package/node_modules/audio-decode/node_modules/@audio/decode-opus/audio.js +10 -0
  181. package/node_modules/audio-decode/node_modules/@audio/decode-opus/core.d.ts +33 -0
  182. package/node_modules/audio-decode/node_modules/@audio/decode-opus/core.js +147 -0
  183. package/node_modules/audio-decode/node_modules/@audio/decode-opus/decode-opus.d.ts +18 -0
  184. package/node_modules/audio-decode/node_modules/@audio/decode-opus/decode-opus.js +1 -0
  185. package/node_modules/audio-decode/node_modules/@audio/decode-opus/meta.js +103 -0
  186. package/node_modules/audio-decode/node_modules/@audio/decode-opus/package.json +68 -0
  187. package/node_modules/audio-decode/node_modules/@audio/decode-opus/src/decode-opus.js +2 -0
  188. package/node_modules/audio-decode/node_modules/@audio/decode-opus/src/opus.wasm.js +0 -0
  189. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/LICENSE +25 -0
  190. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/README.md +19 -0
  191. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/audio.d.ts +15 -0
  192. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/audio.js +10 -0
  193. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/decode-qoa.d.ts +16 -0
  194. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/decode-qoa.js +275 -0
  195. package/node_modules/audio-decode/node_modules/@audio/decode-qoa/package.json +56 -0
  196. package/node_modules/audio-decode/node_modules/@audio/decode-tta/LICENSE +21 -0
  197. package/node_modules/audio-decode/node_modules/@audio/decode-tta/LICENSE.ttadec +39 -0
  198. package/node_modules/audio-decode/node_modules/@audio/decode-tta/README.md +58 -0
  199. package/node_modules/audio-decode/node_modules/@audio/decode-tta/audio.d.ts +15 -0
  200. package/node_modules/audio-decode/node_modules/@audio/decode-tta/audio.js +9 -0
  201. package/node_modules/audio-decode/node_modules/@audio/decode-tta/decode-tta.d.ts +17 -0
  202. package/node_modules/audio-decode/node_modules/@audio/decode-tta/decode-tta.js +302 -0
  203. package/node_modules/audio-decode/node_modules/@audio/decode-tta/package.json +58 -0
  204. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/LICENSE +25 -0
  205. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/README.md +33 -0
  206. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/audio.d.ts +15 -0
  207. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/audio.js +10 -0
  208. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/decode-vorbis.d.ts +18 -0
  209. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/decode-vorbis.js +2984 -0
  210. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/meta.js +102 -0
  211. package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/package.json +60 -0
  212. package/node_modules/audio-decode/node_modules/@audio/decode-wav/LICENSE +21 -0
  213. package/node_modules/audio-decode/node_modules/@audio/decode-wav/README.md +23 -0
  214. package/node_modules/audio-decode/node_modules/@audio/decode-wav/audio.d.ts +15 -0
  215. package/node_modules/audio-decode/node_modules/@audio/decode-wav/audio.js +10 -0
  216. package/node_modules/audio-decode/node_modules/@audio/decode-wav/decode-wav.d.ts +8 -0
  217. package/node_modules/audio-decode/node_modules/@audio/decode-wav/decode-wav.js +256 -0
  218. package/node_modules/audio-decode/node_modules/@audio/decode-wav/meta.js +114 -0
  219. package/node_modules/audio-decode/node_modules/@audio/decode-wav/package.json +52 -0
  220. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/LICENSE +29 -0
  221. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/LICENSE.wavpack +25 -0
  222. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/README.md +41 -0
  223. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/audio.d.ts +15 -0
  224. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/audio.js +9 -0
  225. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/decode-wavpack.d.ts +18 -0
  226. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/decode-wavpack.js +140 -0
  227. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/package.json +62 -0
  228. package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/src/wavpack.wasm.js +0 -0
  229. package/node_modules/audio-decode/node_modules/@audio/decode-webm/LICENSE +21 -0
  230. package/node_modules/audio-decode/node_modules/@audio/decode-webm/LICENSE.libopus +44 -0
  231. package/node_modules/audio-decode/node_modules/@audio/decode-webm/README.md +59 -0
  232. package/node_modules/audio-decode/node_modules/@audio/decode-webm/audio.d.ts +15 -0
  233. package/node_modules/audio-decode/node_modules/@audio/decode-webm/audio.js +10 -0
  234. package/node_modules/audio-decode/node_modules/@audio/decode-webm/decode-webm.d.ts +18 -0
  235. package/node_modules/audio-decode/node_modules/@audio/decode-webm/decode-webm.js +141 -0
  236. package/node_modules/audio-decode/node_modules/@audio/decode-webm/package.json +76 -0
  237. package/node_modules/audio-decode/node_modules/@audio/decode-webm/src/opus.wasm.js +0 -0
  238. package/node_modules/audio-decode/node_modules/@audio/decode-wma/LICENSE +12 -0
  239. package/node_modules/audio-decode/node_modules/@audio/decode-wma/README.md +74 -0
  240. package/node_modules/audio-decode/node_modules/@audio/decode-wma/audio.d.ts +15 -0
  241. package/node_modules/audio-decode/node_modules/@audio/decode-wma/audio.js +10 -0
  242. package/node_modules/audio-decode/node_modules/@audio/decode-wma/decode-wma.d.ts +33 -0
  243. package/node_modules/audio-decode/node_modules/@audio/decode-wma/decode-wma.js +516 -0
  244. package/node_modules/audio-decode/node_modules/@audio/decode-wma/package.json +57 -0
  245. package/node_modules/audio-decode/node_modules/@audio/decode-wma/src/wma.wasm.js +0 -0
  246. package/node_modules/audio-decode/package.json +37 -39
  247. package/node_modules/audio-decode/stream.d.ts +2 -0
  248. package/node_modules/audio-decode/stream.js +2 -0
  249. package/node_modules/baileys/lib/Utils/messages-media.js +1 -1
  250. package/node_modules/baileys/node_modules/file-type/package.json +3 -2
  251. package/node_modules/baileys/node_modules/file-type/readme.md +5 -0
  252. package/node_modules/baileys/node_modules/file-type/source/detectors/zip.js +9 -4
  253. package/node_modules/baileys/node_modules/file-type/source/index.js +28 -1
  254. package/node_modules/baileys/node_modules/file-type/source/supported.js +2 -0
  255. package/node_modules/baileys/node_modules/p-timeout/index.js +3 -0
  256. package/node_modules/baileys/node_modules/p-timeout/package.json +1 -1
  257. package/node_modules/baileys/package.json +1 -1
  258. package/node_modules/typebox/build/compile/code.mjs +1 -2
  259. package/node_modules/typebox/build/compile/validator.mjs +5 -1
  260. package/node_modules/typebox/build/format/iri.mjs +16 -9
  261. package/node_modules/typebox/build/guard/emit.mjs +2 -2
  262. package/node_modules/typebox/build/guard/guard.d.mts +7 -5
  263. package/node_modules/typebox/build/guard/guard.mjs +14 -9
  264. package/node_modules/typebox/build/guard/index.mjs +6 -0
  265. package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
  266. package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
  267. package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
  268. package/node_modules/typebox/build/schema/build.mjs +2 -3
  269. package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
  270. package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
  271. package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
  272. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
  273. package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
  274. package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
  275. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
  276. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
  277. package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
  278. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
  279. package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
  280. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
  281. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
  282. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
  283. package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
  284. package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
  285. package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
  286. package/node_modules/typebox/build/schema/parse.mjs +3 -0
  287. package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
  288. package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
  289. package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
  290. package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
  291. package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
  292. package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
  293. package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
  294. package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
  295. package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
  296. package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
  297. package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
  298. package/node_modules/typebox/package.json +1 -1
  299. package/node_modules/typebox/readme.md +3 -1
  300. package/package.json +6 -6
  301. package/dist/.setup/doctor-BPb-SjdE.mjs +0 -65
  302. package/dist/.setup/group-config-path-BGyzT9Lg.mjs +0 -54
  303. package/dist/.setup/normalize-DdsROMMa.mjs +0 -2
  304. package/dist/.setup/rolldown-runtime-D7D4PA-g.mjs +0 -13
  305. package/dist/.setup/runtime-group-policy-DeSRFXEV.mjs +0 -11
  306. package/dist/.setup/setup-plugin-api-CXfU-7vN.mjs +0 -3
  307. package/dist/.setup/text-runtime-CHl0iPYe.mjs +0 -4
  308. package/node_modules/audio-decode/.eslintrc.json +0 -43
  309. package/node_modules/audio-decode/.github/workflows/test.js.yml +0 -31
  310. package/node_modules/audio-decode/.travis.yml +0 -13
  311. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/README.md +0 -293
  312. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/dist/opus-ml-decoder.min.js +0 -11646
  313. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/dist/opus-ml-decoder.min.js.map +0 -1
  314. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/index.js +0 -8
  315. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/package.json +0 -58
  316. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/EmscriptenWasm.js +0 -0
  317. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/OpusMLDecoder.js +0 -253
  318. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/OpusMLDecoderWebWorker.js +0 -17
  319. package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/types.d.ts +0 -77
  320. package/node_modules/audio-decode/node_modules/audio-buffer/.eslintrc.json +0 -44
  321. package/node_modules/audio-decode/node_modules/audio-buffer/.github/workflows/node.js.yml +0 -31
  322. package/node_modules/audio-decode/node_modules/audio-buffer/.travis.yml +0 -7
  323. package/node_modules/audio-decode/node_modules/audio-buffer/index.js +0 -76
  324. package/node_modules/audio-decode/node_modules/audio-buffer/package.json +0 -37
  325. package/node_modules/audio-decode/node_modules/audio-buffer/readme.md +0 -56
  326. package/node_modules/audio-decode/node_modules/node-wav/README.md +0 -35
  327. package/node_modules/audio-decode/node_modules/node-wav/file.wav +0 -0
  328. package/node_modules/audio-decode/node_modules/node-wav/index.js +0 -291
  329. package/node_modules/audio-decode/node_modules/node-wav/package.json +0 -29
  330. package/node_modules/audio-decode/node_modules/node-wav/tests/file1.wav +0 -0
  331. package/node_modules/audio-decode/node_modules/node-wav/tests/test.js +0 -66
  332. package/node_modules/audio-decode/node_modules/node-wav/x.js +0 -12
  333. package/node_modules/audio-decode/node_modules/node-wav/x.json +0 -86702
  334. package/node_modules/audio-decode/node_modules/node-wav/x.js~ +0 -13
  335. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/README.md +0 -320
  336. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.min.js +0 -232
  337. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.min.js.map +0 -1
  338. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.opus-ml.min.js +0 -0
  339. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.opus-ml.min.js.map +0 -1
  340. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/index.js +0 -8
  341. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/package.json +0 -74
  342. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/src/OggOpusDecoder.js +0 -226
  343. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/src/OggOpusDecoderWebWorker.js +0 -17
  344. package/node_modules/audio-decode/node_modules/ogg-opus-decoder/types.d.ts +0 -37
  345. package/node_modules/audio-decode/node_modules/opus-decoder/README.md +0 -265
  346. package/node_modules/audio-decode/node_modules/opus-decoder/dist/opus-decoder.min.js +0 -232
  347. package/node_modules/audio-decode/node_modules/opus-decoder/dist/opus-decoder.min.js.map +0 -1
  348. package/node_modules/audio-decode/node_modules/opus-decoder/index.js +0 -8
  349. package/node_modules/audio-decode/node_modules/opus-decoder/package.json +0 -56
  350. package/node_modules/audio-decode/node_modules/opus-decoder/src/EmscriptenWasm.js +0 -0
  351. package/node_modules/audio-decode/node_modules/opus-decoder/src/OpusDecoder.js +0 -239
  352. package/node_modules/audio-decode/node_modules/opus-decoder/src/OpusDecoderWebWorker.js +0 -17
  353. package/node_modules/audio-decode/node_modules/opus-decoder/types.d.ts +0 -74
  354. package/node_modules/audio-decode/readme.md +0 -49
  355. package/node_modules/audio-decode/tea.yaml +0 -6
  356. package/node_modules/audio-decode/test-case.js +0 -11
  357. package/node_modules/audio-decode/test.html +0 -15
  358. package/node_modules/audio-decode/test.js +0 -107
  359. /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
@@ -209,7 +209,7 @@ export async function getAudioWaveform(buffer, logger) {
209
209
  audioData = await toBuffer(buffer);
210
210
  }
211
211
  const audioBuffer = await decoder(audioData);
212
- const rawData = audioBuffer.getChannelData(0); // We only need to work with one channel of data
212
+ const rawData = audioBuffer.channelData[0]; // We only need to work with one channel of data
213
213
  const samples = 64; // Number of samples we want to have in our final data set
214
214
  const blockSize = Math.floor(rawData.length / samples); // the number of samples in each subdivision
215
215
  const filteredData = [];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "file-type",
3
- "version": "22.0.2",
3
+ "version": "22.1.1",
4
4
  "description": "Detect the file type of a file, stream, or data",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/file-type",
@@ -228,7 +228,8 @@
228
228
  "dat",
229
229
  "key",
230
230
  "numbers",
231
- "pages"
231
+ "pages",
232
+ "iso"
232
233
  ],
233
234
  "dependencies": {
234
235
  "@tokenizer/inflate": "^0.4.1",
@@ -464,6 +464,7 @@ MIME media subtypes prefixed with `x-ft-` are custom and defined by us. They are
464
464
  - [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format)) - Windows icon file
465
465
  - [`ics`](https://en.wikipedia.org/wiki/ICalendar#Data_format) - iCalendar
466
466
  - [`indd`](https://en.wikipedia.org/wiki/Adobe_InDesign#File_format) - Adobe InDesign document
467
+ - [`iso`](https://en.wikipedia.org/wiki/ISO_9660) - ISO 9660 disc image
467
468
  - [`it`](https://wiki.openmpt.org/Manual:_Module_formats#The_Impulse_Tracker_format_.28.it.29) - Audio module format: Impulse Tracker
468
469
  - [`j2c`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000
469
470
  - [`jar`](https://en.wikipedia.org/wiki/JAR_(file_format)) - Java archive
@@ -578,6 +579,10 @@ MIME media subtypes prefixed with `x-ft-` are custom and defined by us. They are
578
579
  - [`zip`](https://en.wikipedia.org/wiki/Zip_(file_format)) - Archive file
579
580
  - [`zst`](https://en.wikipedia.org/wiki/Zstandard) - Archive file
580
581
 
582
+ ISO 9660 requires random-access input or `fileTypeStream()` with `sampleSize >= 32_774`; `fileTypeFromStream()` is unsupported.
583
+
584
+ When `[Content_Types].xml` cannot be reached — it may trail the content entries, and only so much of what precedes it is scanned — the type is guessed from the archive's directory names: `word/`, `xl/` and `ppt/` are reported as `docx`, `xlsx` and `pptx`. Macro-enabled and template variants are therefore reported as their base type, and a non-OOXML archive containing one of those directories is reported as OOXML.
585
+
581
586
  *[Pull requests](.github/pull_request_template.md) are welcome for additional commonly used file types.*
582
587
 
583
588
  The following file types will not be accepted, but most of them are supported by [third-party detectors](#available-third-party-file-type-detectors).
@@ -392,7 +392,7 @@ async function readZipDataDescriptorEntryWithLimit(zipHandler, {shouldBuffer, ma
392
392
 
393
393
  bytesConsumed += chunkLength;
394
394
  if (bytesConsumed > maximumLength) {
395
- throw new Error(`ZIP entry compressed data exceeds ${maximumLength} bytes`);
395
+ throw new ParserHardLimitError(`ZIP entry data descriptor not found within ${maximumLength} bytes`);
396
396
  }
397
397
 
398
398
  if (shouldBuffer) {
@@ -626,9 +626,14 @@ export async function detectZip(tokenizer) {
626
626
  openXmlState.hasUnparseableContentTypes = true;
627
627
  }
628
628
 
629
- // When the stream was truncated before reaching [Content_Types].xml, use directory names as a fallback.
630
- // This handles LibreOffice-created OOXML files where [Content_Types].xml appears after content entries.
631
- if (!fileType && error instanceof strtok3.EndOfStreamError && !openXmlState.hasContentTypesEntry) {
629
+ // Producers are free to put [Content_Types].xml after the content entries, so running out of
630
+ // input or budget before reaching it says nothing about whether this is an OOXML file.
631
+ // Guess from the directory names instead.
632
+ if (
633
+ !fileType
634
+ && (error instanceof strtok3.EndOfStreamError || error instanceof ParserHardLimitError)
635
+ && !openXmlState.hasContentTypesEntry
636
+ ) {
632
637
  fileType = getOpenXmlFileTypeFromDirectoryNames(openXmlState);
633
638
  }
634
639
  }
@@ -64,7 +64,7 @@ function getKnownFileSizeOrMaximum(fileSize) {
64
64
 
65
65
  // Keep the specifier non-literal at the call site so browser bundlers do not try to resolve Node-only imports.
66
66
  function importAtRuntime(specifier) {
67
- return import(specifier);
67
+ return import(/* @vite-ignore */ /* webpackIgnore: true */ specifier);
68
68
  }
69
69
 
70
70
  // Wrap stream in an identity TransformStream to avoid BYOB readers.
@@ -1689,6 +1689,33 @@ export class FileTypeParser {
1689
1689
  mime: 'application/pgp-encrypted',
1690
1690
  };
1691
1691
  }
1692
+
1693
+ // ISO 9660 optical disc image: the Volume Descriptor Set starts at sector 16 (2048-byte
1694
+ // sectors). Every descriptor in that set carries the 5-byte standard identifier `CD001`
1695
+ // at offset 1, regardless of descriptor type, so checking the first one is sufficient.
1696
+ // Only attempted for random-access inputs (buffer/file/blob, or a stream sampled with a
1697
+ // large enough `sampleSize`): on an unknown-size stream this offset is far past what's
1698
+ // reasonable to buffer just to rule out one format, so it's left undetected there.
1699
+ const isoStandardIdentifierOffset = 32_769;
1700
+ const isoStandardIdentifierLength = 5;
1701
+ if (
1702
+ tokenizer.supportsRandomAccess()
1703
+ && tokenizer.fileInfo.size >= (isoStandardIdentifierOffset + isoStandardIdentifierLength)
1704
+ ) {
1705
+ const isoStandardIdentifier = new Uint8Array(isoStandardIdentifierLength);
1706
+ await tokenizer.peekBuffer(isoStandardIdentifier, {
1707
+ position: isoStandardIdentifierOffset,
1708
+ length: isoStandardIdentifierLength,
1709
+ mayBeLess: true,
1710
+ });
1711
+
1712
+ if (checkBytes(isoStandardIdentifier, stringToBytes('CD001'))) {
1713
+ return {
1714
+ ext: 'iso',
1715
+ mime: 'application/x-iso9660-image',
1716
+ };
1717
+ }
1718
+ }
1692
1719
  };
1693
1720
  // Detections with limited supporting data, resulting in a higher likelihood of false positives
1694
1721
  detectImprecise = async tokenizer => {
@@ -184,6 +184,7 @@ export const extensions = [
184
184
  'key',
185
185
  'numbers',
186
186
  'pages',
187
+ 'iso',
187
188
  ];
188
189
 
189
190
  export const mimeTypes = [
@@ -365,4 +366,5 @@ export const mimeTypes = [
365
366
  'application/vnd.apple.keynote',
366
367
  'application/vnd.apple.numbers',
367
368
  'application/vnd.apple.pages',
369
+ 'application/x-iso9660-image',
368
370
  ];
@@ -28,6 +28,9 @@ export default function pTimeout(promise, options) {
28
28
 
29
29
  if (signal?.aborted) {
30
30
  reject(getAbortedReason(signal));
31
+ // The input still needs a rejection handler even though cancellation won.
32
+ // eslint-disable-next-line promise/prefer-await-to-then, promise/prefer-catch
33
+ promise.then(resolve, reject);
31
34
  return;
32
35
  }
33
36
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "p-timeout",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "description": "Timeout a promise after a specified amount of time",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/p-timeout",
@@ -87,7 +87,7 @@
87
87
  "typescript": "^5.8.2"
88
88
  },
89
89
  "peerDependencies": {
90
- "audio-decode": "^2.1.3",
90
+ "audio-decode": "^3.12.0",
91
91
  "jimp": "^1.6.1",
92
92
  "link-preview-js": "^3.0.0",
93
93
  "sharp": "*"
@@ -16,9 +16,8 @@ function Separator() {
16
16
  function ImportSection(build) {
17
17
  const context = build.UseUnevaluated() ? [`import { CheckContext } from "typebox/schema"`] : [];
18
18
  const hashing = `import { Hashing } from "typebox/system"`;
19
- const format = `import { Format } from "typebox/format"`;
20
19
  const guard = `import { Guard } from "typebox/guard"`;
21
- return [...context, hashing, format, guard];
20
+ return [...context, hashing, guard];
22
21
  }
23
22
  // ------------------------------------------------------------------
24
23
  // ExternalSection
@@ -1,4 +1,5 @@
1
1
  // deno-fmt-ignore-file
2
+ import { EnableParseErrors, DisableParseErrors } from '../system/settings/internal.mjs';
2
3
  import { Settings } from '../system/settings/index.mjs';
3
4
  import { Errors, Clean, Convert, Create, Default, Decode, Encode, HasCodec, Parser, ParseError } from '../value/index.mjs';
4
5
  import { Build } from '../schema/index.mjs';
@@ -51,7 +52,10 @@ export class Validator {
51
52
  return value;
52
53
  if (Settings.Get().correctiveParse)
53
54
  return Parser(this.Context(), this.Type(), value);
54
- throw new ParseError(value, this.Errors(value));
55
+ EnableParseErrors();
56
+ const errors = this.Errors(value);
57
+ DisableParseErrors();
58
+ throw new ParseError(value, errors);
55
59
  }
56
60
  /** Returns an array of validation errors for the given value. */
57
61
  Errors(value) {
@@ -1,9 +1,10 @@
1
1
  // deno-lint-ignore-file no-control-regex
2
- const IpvFutureMatchMaxLength = 2048;
3
- const IpvFutureMatch = /\[[vV][0-9a-fA-F]+\.[^\]]+\]/; // Guarded By IpvFutureMatchMaxLength
4
- const InvalidIriChars = /[\x00-\x20<>\^`{|}\\]/;
5
- const InvalidPercentEncoding = /%(?![0-9a-fA-F]{2})/;
6
2
  // ------------------------------------------------------------------
3
+ //
4
+ // Removed by the following PR
5
+ //
6
+ // https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/1176
7
+ //
7
8
  // NarrowIpvFuture
8
9
  //
9
10
  // Substitutes an IPvFuture address with a standard IPv6 loopback
@@ -13,12 +14,18 @@ const InvalidPercentEncoding = /%(?![0-9a-fA-F]{2})/;
13
14
  // be expensive on large strings, this operation is strictly
14
15
  // limited to inputs under a defined length threshold.
15
16
  //
16
- // (review-optimization)
17
+ // ------------------------------------------------------------------
18
+ //
19
+ // const IpvFutureMatchMaxLength = 2048
20
+ // const IpvFutureMatch = /\[[vV][0-9a-fA-F]+\.[^\]]+\]/ // Guarded By IpvFutureMatchMaxLength
21
+ //
22
+ // function NarrowIpvFuture(value: string): string {
23
+ // return value.length < IpvFutureMatchMaxLength ? value.replace(IpvFutureMatch, '[::1]') : value
24
+ // }
17
25
  //
18
26
  // ------------------------------------------------------------------
19
- function NarrowIpvFuture(value) {
20
- return value.length < IpvFutureMatchMaxLength ? value.replace(IpvFutureMatch, '[::1]') : value;
21
- }
27
+ const InvalidIriChars = /[\x00-\x20<>\^`{|}\\]/;
28
+ const InvalidPercentEncoding = /%(?![0-9a-fA-F]{2})/;
22
29
  /**
23
30
  * Returns true if the value is a valid Internationalized Resource Identifier.
24
31
  * @specification https://datatracker.ietf.org/doc/html/rfc3987
@@ -31,5 +38,5 @@ export function IsIri(value) {
31
38
  if (InvalidPercentEncoding.test(value))
32
39
  return false;
33
40
  // 3. Delegate to the native URL parser, patching the IPvFuture edge case beforehand.
34
- return URL.canParse(NarrowIpvFuture(value));
41
+ return URL.canParse(value);
35
42
  }
@@ -97,10 +97,10 @@ export function IsGreaterEqualThan(left, right) {
97
97
  // String
98
98
  // --------------------------------------------------------------------------
99
99
  export function IsMinLength(value, length) {
100
- return `Guard.IsMinLength(${value}, ${length})`;
100
+ return `(${value}.length >= ${(+length) << 1} || (${value}.length >= ${length} && Guard.CodePointCount(${value}) >= ${length}))`;
101
101
  }
102
102
  export function IsMaxLength(value, length) {
103
- return `Guard.IsMaxLength(${value}, ${length})`;
103
+ return `(${value}.length <= ${length} || (${value}.length <= ${(+length) << 1} && Guard.CodePointCount(${value}) <= ${length}))`;
104
104
  }
105
105
  // --------------------------------------------------------------------------
106
106
  // Array
@@ -33,12 +33,14 @@ export declare function IsMultipleOf(dividend: bigint | number, divisor: bigint
33
33
  /** Returns true if the value appears to be an instance of a class. */
34
34
  export declare function IsClassInstance(value: unknown): boolean;
35
35
  export declare function IsValueLike(value: unknown): value is bigint | boolean | null | number | string | undefined;
36
- /** Returns the number of grapheme clusters in the string */
36
+ /** Returns the total number of visual grapheme clusters in the string. */
37
37
  export declare function GraphemeCount(value: string): number;
38
- /** Returns true if the string has at most the given number of graphemes */
39
- export declare function IsMaxLength(value: string, length: number): boolean;
40
- /** Returns true if the string has at least the given number of graphemes */
41
- export declare function IsMinLength(value: string, length: number): boolean;
38
+ /** Returns the total number of Unicode code points in the string. */
39
+ export declare function CodePointCount(value: string): number;
40
+ /** Returns true if the string length in Unicode code points does not exceed maxLength */
41
+ export declare function IsMaxLength(value: string, maxLength: number): boolean;
42
+ /** Returns true if the string length in Unicode code points is at least minLength */
43
+ export declare function IsMinLength(value: string, minLength: number): boolean;
42
44
  /** Returns true if every element from offset satisfies the callback, short-circuiting on the first failure */
43
45
  export declare function Every<T>(value: T[], offset: number, callback: (value: T, index: number) => boolean): boolean;
44
46
  /** Returns true if every element from offset satisfies the callback, using exhaustive enumeration */
@@ -1,5 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
- import * as String from './string.mjs';
2
+ import * as UnicodeSegmentGuard from './unicode/unicode_segment.mjs';
3
+ import * as UnicodeGuard from './unicode/unicode.mjs';
3
4
  // --------------------------------------------------------------------------
4
5
  // Guards
5
6
  // --------------------------------------------------------------------------
@@ -123,17 +124,21 @@ export function IsValueLike(value) {
123
124
  // --------------------------------------------------------------------------
124
125
  // String
125
126
  // --------------------------------------------------------------------------
126
- /** Returns the number of grapheme clusters in the string */
127
+ /** Returns the total number of visual grapheme clusters in the string. */
127
128
  export function GraphemeCount(value) {
128
- return String.GraphemeCount(value);
129
+ return UnicodeSegmentGuard.GraphemeCount(value);
129
130
  }
130
- /** Returns true if the string has at most the given number of graphemes */
131
- export function IsMaxLength(value, length) {
132
- return String.IsMaxLength(value, length);
131
+ /** Returns the total number of Unicode code points in the string. */
132
+ export function CodePointCount(value) {
133
+ return UnicodeGuard.CodePointCount(value);
133
134
  }
134
- /** Returns true if the string has at least the given number of graphemes */
135
- export function IsMinLength(value, length) {
136
- return String.IsMinLength(value, length);
135
+ /** Returns true if the string length in Unicode code points does not exceed maxLength */
136
+ export function IsMaxLength(value, maxLength) {
137
+ return UnicodeGuard.IsMaxLength(value, maxLength);
138
+ }
139
+ /** Returns true if the string length in Unicode code points is at least minLength */
140
+ export function IsMinLength(value, minLength) {
141
+ return UnicodeGuard.IsMinLength(value, minLength);
137
142
  }
138
143
  // --------------------------------------------------------------------------
139
144
  // Array
@@ -1,6 +1,12 @@
1
+ // ------------------------------------------------------------------
2
+ // Guards
3
+ // ------------------------------------------------------------------
1
4
  export * as EmitGuard from './emit.mjs';
2
5
  export * as GlobalsGuard from './globals.mjs';
3
6
  export * as NativeGuard from './native.mjs';
7
+ // ------------------------------------------------------------------
8
+ // Default
9
+ // ------------------------------------------------------------------
4
10
  import * as Guard from './guard.mjs';
5
11
  export * as Guard from './guard.mjs';
6
12
  export default Guard;
@@ -0,0 +1,6 @@
1
+ /** Returns the total number of Unicode code points in the string */
2
+ export declare function CodePointCount(value: string): number;
3
+ /** Returns true if the string length in Unicode code points is less than or equal to maxLength */
4
+ export declare function IsMaxLength(value: string, maxLength: number): boolean;
5
+ /** Returns true if the string length in Unicode code points is greater than or equal to minLength */
6
+ export declare function IsMinLength(value: string, minLength: number): boolean;
@@ -0,0 +1,35 @@
1
+ // ------------------------------------------------------------------
2
+ // CodePointCount (10-bit Shift Branchless)
3
+ //
4
+ // Counts code points by enumerating UTF-16 sequences and incrementing
5
+ // when not within a high/low pairing. Because surrogate blocks are
6
+ // 1024 (2^10) wide and aligned, by shifting right by (0xA), we can
7
+ // collapse each unit to a constant per block (high: 0x36, low: 0x37)
8
+ // and shift again into a packed (0x3637) for comparison. Fetch calls
9
+ // to charCodeAt(...) are kept to one call per iteration.
10
+ //
11
+ // ------------------------------------------------------------------
12
+ /** Returns the total number of Unicode code points in the string */
13
+ export function CodePointCount(value) {
14
+ let result = 0, index = 0, prev = 0;
15
+ while (index < value.length) {
16
+ const next = value.charCodeAt(index++) >> 0xA; // shift (10-bits into high/low)
17
+ result += +(((prev << 8) | next) !== 0x3637); // packed (or +!(prev === 0x36 && next === 0x37))
18
+ prev = next;
19
+ }
20
+ return result;
21
+ }
22
+ // ------------------------------------------------------------------
23
+ // IsMaxLength
24
+ // ------------------------------------------------------------------
25
+ /** Returns true if the string length in Unicode code points is less than or equal to maxLength */
26
+ export function IsMaxLength(value, maxLength) {
27
+ return value.length <= maxLength || (value.length <= (maxLength << 1) && CodePointCount(value) <= maxLength);
28
+ }
29
+ // ------------------------------------------------------------------
30
+ // IsMinLength
31
+ // ------------------------------------------------------------------
32
+ /** Returns true if the string length in Unicode code points is greater than or equal to minLength */
33
+ export function IsMinLength(value, minLength) {
34
+ return value.length >= (minLength << 1) || (value.length >= minLength && CodePointCount(value) >= minLength);
35
+ }
@@ -91,26 +91,12 @@ function IsGraphemeCodePoint(value) {
91
91
  IsZeroWidthJoiner(value)));
92
92
  }
93
93
  // --------------------------------------------------------------------------
94
- // GraphemeCount
95
- // --------------------------------------------------------------------------
96
- /** Returns the number of grapheme clusters in a string */
97
- export function GraphemeCount(value) {
98
- let count = 0;
99
- let index = 0;
100
- while (index < value.length) {
101
- index = NextGraphemeClusterIndex(value, index);
102
- count++;
103
- }
104
- return count;
105
- }
106
- // --------------------------------------------------------------------------
107
94
  // IsMinLengthSegmented
108
95
  // --------------------------------------------------------------------------
109
96
  /** Checks if a string has at least a minimum number of grapheme clusters */
110
97
  function IsMinLengthSegmented(value, minLength) {
111
98
  // if (minLength === 0) return true // 0-length (unreachable)
112
- let count = 0;
113
- let index = 0;
99
+ let count = 0, index = 0;
114
100
  while (index < value.length) {
115
101
  index = NextGraphemeClusterIndex(value, index);
116
102
  if ((++count) >= minLength)
@@ -123,8 +109,7 @@ function IsMinLengthSegmented(value, minLength) {
123
109
  // --------------------------------------------------------------------------
124
110
  /** Checks if a string has at most a maximum number of grapheme clusters */
125
111
  function IsMaxLengthSegmented(value, maxLength) {
126
- let count = 0;
127
- let index = 0;
112
+ let count = 0, index = 0;
128
113
  while (index < value.length) {
129
114
  index = NextGraphemeClusterIndex(value, index);
130
115
  if ((++count) > maxLength)
@@ -133,7 +118,19 @@ function IsMaxLengthSegmented(value, maxLength) {
133
118
  return true;
134
119
  }
135
120
  // --------------------------------------------------------------------------
136
- // IsMinLengthFast
121
+ // GraphemeCount
122
+ // --------------------------------------------------------------------------
123
+ /** Returns the number of grapheme clusters in a string */
124
+ export function GraphemeCount(value) {
125
+ let count = 0, index = 0;
126
+ while (index < value.length) {
127
+ index = NextGraphemeClusterIndex(value, index);
128
+ count++;
129
+ }
130
+ return count;
131
+ }
132
+ // --------------------------------------------------------------------------
133
+ // IsMinLength
137
134
  // --------------------------------------------------------------------------
138
135
  /** Fast check for minimum grapheme length, falls back to full check if needed */
139
136
  export function IsMinLength(value, minLength) {
@@ -151,7 +148,7 @@ export function IsMinLength(value, minLength) {
151
148
  }
152
149
  }
153
150
  // --------------------------------------------------------------------------
154
- // IsMaxLengthFast
151
+ // IsMaxLength
155
152
  // --------------------------------------------------------------------------
156
153
  /** Fast check for maximum grapheme length, falls back to full check if needed */
157
154
  export function IsMaxLength(value, maxLength) {
@@ -4,7 +4,6 @@ import { Arguments } from '../system/arguments/index.mjs';
4
4
  import { Environment } from '../system/environment/index.mjs';
5
5
  import { Hashing } from '../system/hashing/index.mjs';
6
6
  import { Guard } from '../guard/index.mjs';
7
- import { Format } from '../format/index.mjs';
8
7
  import * as Engine from './engine/index.mjs';
9
8
  // ------------------------------------------------------------------
10
9
  // CreateCode
@@ -20,8 +19,8 @@ function CreateCode(build) {
20
19
  // CreateEvaluatedCheck
21
20
  // ------------------------------------------------------------------
22
21
  function CreateEvaluatedCheck(build, code) {
23
- const factory = Environment.Evaluate('CheckContext', 'Guard', 'Format', 'Hashing', build.External().identifier, code);
24
- return factory(Engine.CheckContext, Guard, Format, Hashing, build.External().variables);
22
+ const factory = Environment.Evaluate('CheckContext', 'Guard', 'Hashing', build.External().identifier, code);
23
+ return factory(Engine.CheckContext, Guard, Hashing, build.External().variables);
25
24
  }
26
25
  // ------------------------------------------------------------------
27
26
  // CreateDynamicCheck
@@ -0,0 +1 @@
1
+ export declare function EncodeFragment(fragment: string): string;
@@ -0,0 +1,11 @@
1
+ // ------------------------------------------------------------------
2
+ // EncodeFragment
3
+ //
4
+ // We use this function to encode instancePath and schemaPath path
5
+ // fragments for errors. We need this encoding such that callers
6
+ // can use Pointer to deref error targets. We should consider adding
7
+ // this to the Pointer module as Pointer.Encode(...) (review)
8
+ // ------------------------------------------------------------------
9
+ export function EncodeFragment(fragment) {
10
+ return fragment.replace(/~/g, '~0').replace(/\//g, '~1');
11
+ }
@@ -4,9 +4,18 @@ import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
4
4
  // ------------------------------------------------------------------
5
5
  // Build
6
6
  // ------------------------------------------------------------------
7
+ function BuildRefineMultiple(_stack, _context, schema, value) {
8
+ const external = Externals.CreateVariable(schema['~refine']);
9
+ return E.Every(external, E.Constant(0), ['refinement', '_'], E.Call(E.Member('refinement', 'check'), [value]));
10
+ }
11
+ function BuildRefineSingle(_stack, _context, schema, value) {
12
+ const external = Externals.CreateVariable(schema['~refine'][0]);
13
+ return E.Call(E.Member(external, 'check'), [value]);
14
+ }
7
15
  export function BuildRefine(_stack, _context, schema, value) {
8
- const refinements = Externals.CreateVariable(schema['~refine'].map((refinement) => refinement));
9
- return E.Every(refinements, E.Constant(0), ['refinement', '_'], E.Call(E.Member('refinement', 'check'), [value]));
16
+ return G.IsEqual(schema['~refine'].length, 1)
17
+ ? BuildRefineSingle(_stack, _context, schema, value)
18
+ : BuildRefineMultiple(_stack, _context, schema, value);
10
19
  }
11
20
  // ------------------------------------------------------------------
12
21
  // Check
@@ -19,8 +28,7 @@ export function CheckRefine(_stack, _context, schema, value) {
19
28
  // ------------------------------------------------------------------
20
29
  export function ErrorRefine(_stack, context, schemaPath, instancePath, schema, value) {
21
30
  return G.EveryAll(schema['~refine'], 0, (refinement, index) => {
22
- return refinement.check(value) || context.AddError('~refine', schemaPath, instancePath, {
23
- index, message: refinement.error(value)
24
- });
31
+ return refinement.check(value) ||
32
+ context.AddError('~refine', schemaPath, instancePath, { index, message: refinement.error(value) });
25
33
  });
26
34
  }
@@ -1,6 +1,7 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Schema from '../types/index.mjs';
3
3
  import * as Externals from './_externals.mjs';
4
+ import * as Pathing from './_pathing.mjs';
4
5
  import { Unique } from './_unique.mjs';
5
6
  import { UnicodeRegExp } from './_regexp.mjs';
6
7
  import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
@@ -107,7 +108,7 @@ export function ErrorAdditionalProperties(stack, context, schemaPath, instancePa
107
108
  const additionalProperties = [];
108
109
  const isAdditionalProperties = G.EveryAll(G.Keys(value), 0, (key, _index) => {
109
110
  const nextSchemaPath = `${schemaPath}/additionalProperties`;
110
- const nextInstancePath = `${instancePath}/${key}`;
111
+ const nextInstancePath = `${instancePath}/${Pathing.EncodeFragment(key)}`;
111
112
  const isAdditionalProperty = regexp.test(key) ||
112
113
  (ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema.additionalProperties, value[key]) && context.AddKey(key));
113
114
  if (!isAdditionalProperty)
@@ -1,4 +1,5 @@
1
1
  // deno-fmt-ignore-file
2
+ import * as Pathing from './_pathing.mjs';
2
3
  import { EmitGuard as E, Guard as G } from '../../guard/index.mjs';
3
4
  import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
4
5
  // ------------------------------------------------------------------
@@ -32,7 +33,7 @@ export function CheckDependencies(stack, context, schema, value) {
32
33
  export function ErrorDependencies(stack, context, schemaPath, instancePath, schema, value) {
33
34
  const isLength = G.IsEqual(G.Keys(value).length, 0);
34
35
  const isEvery = G.EveryAll(G.Entries(schema.dependencies), 0, ([key, schema]) => {
35
- const nextSchemaPath = `${schemaPath}/dependencies/${key}`;
36
+ const nextSchemaPath = `${schemaPath}/dependencies/${Pathing.EncodeFragment(key)}`;
36
37
  return !G.HasPropertyKey(value, key) || (G.IsArray(schema)
37
38
  ? schema.every((dependency) => G.HasPropertyKey(value, dependency) ||
38
39
  context.AddError('dependencies', schemaPath, instancePath, { property: key, dependencies: schema }))
@@ -1,4 +1,5 @@
1
1
  // deno-fmt-ignore-file
2
+ import * as Pathing from './_pathing.mjs';
2
3
  import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
3
4
  import { BuildSchema, CheckSchema, ErrorSchema } from './schema.mjs';
4
5
  // ------------------------------------------------------------------
@@ -30,7 +31,7 @@ export function CheckDependentSchemas(stack, context, schema, value) {
30
31
  export function ErrorDependentSchemas(stack, context, schemaPath, instancePath, schema, value) {
31
32
  const isLength = G.IsEqual(G.Keys(value).length, 0);
32
33
  const isEvery = G.EveryAll(G.Entries(schema.dependentSchemas), 0, ([key, schema]) => {
33
- const nextSchemaPath = `${schemaPath}/dependentSchemas/${key}`;
34
+ const nextSchemaPath = `${schemaPath}/dependentSchemas/${Pathing.EncodeFragment(key)}`;
34
35
  return !G.HasPropertyKey(value, key) ||
35
36
  ErrorSchema(stack, context, nextSchemaPath, instancePath, schema, value);
36
37
  });
@@ -3,4 +3,4 @@ import * as Stack from './_stack.mjs';
3
3
  import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
4
4
  export declare function BuildDynamicRef(stack: Stack.XStack, context: BuildContext, schema: Schema.XDynamicRef, value: string): string;
5
5
  export declare function CheckDynamicRef(stack: Stack.XStack, context: CheckContext, schema: Schema.XDynamicRef, value: unknown): boolean;
6
- export declare function ErrorDynamicRef(stack: Stack.XStack, context: ErrorContext, _schemaPath: string, instancePath: string, schema: Schema.XDynamicRef, value: unknown): boolean;
6
+ export declare function ErrorDynamicRef(stack: Stack.XStack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XDynamicRef, value: unknown): boolean;
@@ -22,8 +22,8 @@ export function CheckDynamicRef(stack, context, schema, value) {
22
22
  // ------------------------------------------------------------------
23
23
  // Error
24
24
  // ------------------------------------------------------------------
25
- export function ErrorDynamicRef(stack, context, _schemaPath, instancePath, schema, value) {
25
+ export function ErrorDynamicRef(stack, context, schemaPath, instancePath, schema, value) {
26
26
  const target = Resolve.DynamicRef(stack, schema) ?? false;
27
27
  const nextStack = target ? { ...stack, pendingResource: true } : stack;
28
- return (Schema.IsSchema(target) && ErrorSchema(nextStack, context, '#', instancePath, target, value));
28
+ return (Schema.IsSchema(target) && ErrorSchema(nextStack, context, schemaPath, instancePath, target, value));
29
29
  }
@@ -1,11 +1,18 @@
1
1
  // deno-fmt-ignore-file
2
+ import * as Externals from './_externals.mjs';
2
3
  import { Format } from '../../format/index.mjs';
3
4
  import { EmitGuard as E } from '../../guard/index.mjs';
4
5
  // ------------------------------------------------------------------
5
- // Build
6
+ // Build (Remote)
7
+ // ------------------------------------------------------------------
8
+ // export function BuildFormat(_stack: Stack.XStack, _context: BuildContext, schema: Schema.XFormat, value: string): string {
9
+ // return E.Call(E.Member('Format', 'Test'), [E.Constant(schema.format), value])
10
+ // }
11
+ // ------------------------------------------------------------------
12
+ // Build (Inline)
6
13
  // ------------------------------------------------------------------
7
14
  export function BuildFormat(_stack, _context, schema, value) {
8
- return E.Call(E.Member('Format', 'Test'), [E.Constant(schema.format), value]);
15
+ return Format.Has(schema.format) ? E.Call(Externals.CreateVariable(Format.Get(schema.format)), [value]) : E.Constant(true);
9
16
  }
10
17
  // ------------------------------------------------------------------
11
18
  // Check
@@ -1,5 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
2
  import * as Externals from './_externals.mjs';
3
+ import * as Pathing from './_pathing.mjs';
3
4
  import { Unique } from './_unique.mjs';
4
5
  import { UnicodeRegExp } from './_regexp.mjs';
5
6
  import { BuildSchemaPushStack, CheckSchemaPushStack, ErrorSchemaPushStack } from './schema.mjs';
@@ -34,10 +35,10 @@ export function CheckPatternProperties(stack, context, schema, value) {
34
35
  // ------------------------------------------------------------------
35
36
  export function ErrorPatternProperties(stack, context, schemaPath, instancePath, schema, value) {
36
37
  return G.EveryAll(G.Entries(schema.patternProperties), 0, ([pattern, schema]) => {
37
- const nextSchemaPath = `${schemaPath}/patternProperties/${pattern}`;
38
+ const nextSchemaPath = `${schemaPath}/patternProperties/${Pathing.EncodeFragment(pattern)}`;
38
39
  const regexp = UnicodeRegExp(pattern);
39
40
  return G.EveryAll(G.Entries(value), 0, ([key, value]) => {
40
- const nextInstancePath = `${instancePath}/${key}`;
41
+ const nextInstancePath = `${instancePath}/${Pathing.EncodeFragment(key)}`;
41
42
  const notKey = !regexp.test(key);
42
43
  return notKey || ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema, value) && context.AddKey(key);
43
44
  });