@ardennguyen/zalo-agent-cli 1.0.7 → 2.0.0

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 (1267) hide show
  1. package/DISCLAIMER.md +2 -2
  2. package/README.md +146 -69
  3. package/node_modules/asynckit/LICENSE +21 -0
  4. package/node_modules/asynckit/README.md +233 -0
  5. package/node_modules/asynckit/bench.js +76 -0
  6. package/node_modules/asynckit/index.js +6 -0
  7. package/node_modules/asynckit/lib/abort.js +29 -0
  8. package/node_modules/asynckit/lib/async.js +34 -0
  9. package/node_modules/asynckit/lib/defer.js +26 -0
  10. package/node_modules/asynckit/lib/iterate.js +75 -0
  11. package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  12. package/node_modules/asynckit/lib/readable_parallel.js +25 -0
  13. package/node_modules/asynckit/lib/readable_serial.js +25 -0
  14. package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  15. package/node_modules/asynckit/lib/state.js +37 -0
  16. package/node_modules/asynckit/lib/streamify.js +141 -0
  17. package/node_modules/asynckit/lib/terminator.js +29 -0
  18. package/node_modules/asynckit/package.json +63 -0
  19. package/node_modules/asynckit/parallel.js +43 -0
  20. package/node_modules/asynckit/serial.js +17 -0
  21. package/node_modules/asynckit/serialOrdered.js +75 -0
  22. package/node_modules/asynckit/stream.js +21 -0
  23. package/node_modules/bignumber.js/CHANGELOG.md +381 -0
  24. package/node_modules/bignumber.js/LICENCE.md +26 -0
  25. package/node_modules/bignumber.js/README.md +289 -0
  26. package/node_modules/bignumber.js/bignumber.d.mts +6 -0
  27. package/node_modules/bignumber.js/bignumber.d.ts +5 -0
  28. package/node_modules/bignumber.js/bignumber.js +2922 -0
  29. package/node_modules/bignumber.js/bignumber.mjs +2907 -0
  30. package/node_modules/bignumber.js/doc/API.html +2249 -0
  31. package/node_modules/bignumber.js/package.json +60 -0
  32. package/node_modules/bignumber.js/types.d.ts +1821 -0
  33. package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  34. package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  35. package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  36. package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  37. package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  38. package/node_modules/call-bind-apply-helpers/README.md +62 -0
  39. package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  40. package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  41. package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  42. package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  43. package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  44. package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  45. package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  46. package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  47. package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  48. package/node_modules/call-bind-apply-helpers/index.js +15 -0
  49. package/node_modules/call-bind-apply-helpers/package.json +85 -0
  50. package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  51. package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  52. package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  53. package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  54. package/node_modules/combined-stream/License +19 -0
  55. package/node_modules/combined-stream/Readme.md +138 -0
  56. package/node_modules/combined-stream/lib/combined_stream.js +208 -0
  57. package/node_modules/combined-stream/package.json +25 -0
  58. package/node_modules/crypto-js/CONTRIBUTING.md +28 -0
  59. package/node_modules/crypto-js/LICENSE +24 -0
  60. package/node_modules/crypto-js/README.md +275 -0
  61. package/node_modules/crypto-js/aes.js +234 -0
  62. package/node_modules/crypto-js/blowfish.js +471 -0
  63. package/node_modules/crypto-js/bower.json +39 -0
  64. package/node_modules/crypto-js/cipher-core.js +895 -0
  65. package/node_modules/crypto-js/core.js +807 -0
  66. package/node_modules/crypto-js/crypto-js.js +6657 -0
  67. package/node_modules/crypto-js/docs/QuickStartGuide.wiki +470 -0
  68. package/node_modules/crypto-js/enc-base64.js +136 -0
  69. package/node_modules/crypto-js/enc-base64url.js +148 -0
  70. package/node_modules/crypto-js/enc-hex.js +18 -0
  71. package/node_modules/crypto-js/enc-latin1.js +18 -0
  72. package/node_modules/crypto-js/enc-utf16.js +149 -0
  73. package/node_modules/crypto-js/enc-utf8.js +18 -0
  74. package/node_modules/crypto-js/evpkdf.js +134 -0
  75. package/node_modules/crypto-js/format-hex.js +66 -0
  76. package/node_modules/crypto-js/format-openssl.js +18 -0
  77. package/node_modules/crypto-js/hmac-md5.js +18 -0
  78. package/node_modules/crypto-js/hmac-ripemd160.js +18 -0
  79. package/node_modules/crypto-js/hmac-sha1.js +18 -0
  80. package/node_modules/crypto-js/hmac-sha224.js +18 -0
  81. package/node_modules/crypto-js/hmac-sha256.js +18 -0
  82. package/node_modules/crypto-js/hmac-sha3.js +18 -0
  83. package/node_modules/crypto-js/hmac-sha384.js +18 -0
  84. package/node_modules/crypto-js/hmac-sha512.js +18 -0
  85. package/node_modules/crypto-js/hmac.js +143 -0
  86. package/node_modules/crypto-js/index.js +18 -0
  87. package/node_modules/crypto-js/lib-typedarrays.js +76 -0
  88. package/node_modules/crypto-js/md5.js +268 -0
  89. package/node_modules/crypto-js/mode-cfb.js +80 -0
  90. package/node_modules/crypto-js/mode-ctr-gladman.js +116 -0
  91. package/node_modules/crypto-js/mode-ctr.js +58 -0
  92. package/node_modules/crypto-js/mode-ecb.js +40 -0
  93. package/node_modules/crypto-js/mode-ofb.js +54 -0
  94. package/node_modules/crypto-js/package.json +42 -0
  95. package/node_modules/crypto-js/pad-ansix923.js +49 -0
  96. package/node_modules/crypto-js/pad-iso10126.js +44 -0
  97. package/node_modules/crypto-js/pad-iso97971.js +40 -0
  98. package/node_modules/crypto-js/pad-nopadding.js +30 -0
  99. package/node_modules/crypto-js/pad-pkcs7.js +18 -0
  100. package/node_modules/crypto-js/pad-zeropadding.js +47 -0
  101. package/node_modules/crypto-js/pbkdf2.js +145 -0
  102. package/node_modules/crypto-js/rabbit-legacy.js +190 -0
  103. package/node_modules/crypto-js/rabbit.js +192 -0
  104. package/node_modules/crypto-js/rc4.js +139 -0
  105. package/node_modules/crypto-js/ripemd160.js +267 -0
  106. package/node_modules/crypto-js/sha1.js +150 -0
  107. package/node_modules/crypto-js/sha224.js +80 -0
  108. package/node_modules/crypto-js/sha256.js +199 -0
  109. package/node_modules/crypto-js/sha3.js +326 -0
  110. package/node_modules/crypto-js/sha384.js +83 -0
  111. package/node_modules/crypto-js/sha512.js +326 -0
  112. package/node_modules/crypto-js/tripledes.js +779 -0
  113. package/node_modules/crypto-js/x64-core.js +304 -0
  114. package/node_modules/delayed-stream/.npmignore +1 -0
  115. package/node_modules/delayed-stream/License +19 -0
  116. package/node_modules/delayed-stream/Makefile +7 -0
  117. package/node_modules/delayed-stream/Readme.md +141 -0
  118. package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  119. package/node_modules/delayed-stream/package.json +27 -0
  120. package/node_modules/dunder-proto/.eslintrc +5 -0
  121. package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  122. package/node_modules/dunder-proto/.nycrc +13 -0
  123. package/node_modules/dunder-proto/CHANGELOG.md +24 -0
  124. package/node_modules/dunder-proto/LICENSE +21 -0
  125. package/node_modules/dunder-proto/README.md +54 -0
  126. package/node_modules/dunder-proto/get.d.ts +5 -0
  127. package/node_modules/dunder-proto/get.js +30 -0
  128. package/node_modules/dunder-proto/package.json +76 -0
  129. package/node_modules/dunder-proto/set.d.ts +5 -0
  130. package/node_modules/dunder-proto/set.js +35 -0
  131. package/node_modules/dunder-proto/test/get.js +34 -0
  132. package/node_modules/dunder-proto/test/index.js +4 -0
  133. package/node_modules/dunder-proto/test/set.js +50 -0
  134. package/node_modules/dunder-proto/tsconfig.json +9 -0
  135. package/node_modules/es-define-property/.eslintrc +13 -0
  136. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  137. package/node_modules/es-define-property/.nycrc +9 -0
  138. package/node_modules/es-define-property/CHANGELOG.md +29 -0
  139. package/node_modules/es-define-property/LICENSE +21 -0
  140. package/node_modules/es-define-property/README.md +49 -0
  141. package/node_modules/es-define-property/index.d.ts +3 -0
  142. package/node_modules/es-define-property/index.js +14 -0
  143. package/node_modules/es-define-property/package.json +81 -0
  144. package/node_modules/es-define-property/test/index.js +56 -0
  145. package/node_modules/es-define-property/tsconfig.json +10 -0
  146. package/node_modules/es-errors/.eslintrc +5 -0
  147. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  148. package/node_modules/es-errors/CHANGELOG.md +40 -0
  149. package/node_modules/es-errors/LICENSE +21 -0
  150. package/node_modules/es-errors/README.md +55 -0
  151. package/node_modules/es-errors/eval.d.ts +3 -0
  152. package/node_modules/es-errors/eval.js +4 -0
  153. package/node_modules/es-errors/index.d.ts +3 -0
  154. package/node_modules/es-errors/index.js +4 -0
  155. package/node_modules/es-errors/package.json +80 -0
  156. package/node_modules/es-errors/range.d.ts +3 -0
  157. package/node_modules/es-errors/range.js +4 -0
  158. package/node_modules/es-errors/ref.d.ts +3 -0
  159. package/node_modules/es-errors/ref.js +4 -0
  160. package/node_modules/es-errors/syntax.d.ts +3 -0
  161. package/node_modules/es-errors/syntax.js +4 -0
  162. package/node_modules/es-errors/test/index.js +19 -0
  163. package/node_modules/es-errors/tsconfig.json +49 -0
  164. package/node_modules/es-errors/type.d.ts +3 -0
  165. package/node_modules/es-errors/type.js +4 -0
  166. package/node_modules/es-errors/uri.d.ts +3 -0
  167. package/node_modules/es-errors/uri.js +4 -0
  168. package/node_modules/es-object-atoms/.eslintrc +16 -0
  169. package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  170. package/node_modules/es-object-atoms/CHANGELOG.md +44 -0
  171. package/node_modules/es-object-atoms/LICENSE +21 -0
  172. package/node_modules/es-object-atoms/README.md +63 -0
  173. package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  174. package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  175. package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  176. package/node_modules/es-object-atoms/ToObject.js +10 -0
  177. package/node_modules/es-object-atoms/index.d.ts +3 -0
  178. package/node_modules/es-object-atoms/index.js +4 -0
  179. package/node_modules/es-object-atoms/isObject.d.ts +3 -0
  180. package/node_modules/es-object-atoms/isObject.js +6 -0
  181. package/node_modules/es-object-atoms/package.json +79 -0
  182. package/node_modules/es-object-atoms/test/index.js +38 -0
  183. package/node_modules/es-object-atoms/tsconfig.json +7 -0
  184. package/node_modules/es-set-tostringtag/.eslintrc +13 -0
  185. package/node_modules/es-set-tostringtag/.nycrc +9 -0
  186. package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
  187. package/node_modules/es-set-tostringtag/LICENSE +21 -0
  188. package/node_modules/es-set-tostringtag/README.md +53 -0
  189. package/node_modules/es-set-tostringtag/index.d.ts +10 -0
  190. package/node_modules/es-set-tostringtag/index.js +35 -0
  191. package/node_modules/es-set-tostringtag/package.json +78 -0
  192. package/node_modules/es-set-tostringtag/test/index.js +85 -0
  193. package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
  194. package/node_modules/form-data/CHANGELOG.md +686 -0
  195. package/node_modules/form-data/License +19 -0
  196. package/node_modules/form-data/README.md +355 -0
  197. package/node_modules/form-data/index.d.ts +62 -0
  198. package/node_modules/form-data/lib/browser.js +4 -0
  199. package/node_modules/form-data/lib/form_data.js +506 -0
  200. package/node_modules/form-data/lib/populate.js +10 -0
  201. package/node_modules/form-data/node_modules/mime-db/HISTORY.md +507 -0
  202. package/node_modules/form-data/node_modules/mime-db/LICENSE +23 -0
  203. package/node_modules/form-data/node_modules/mime-db/README.md +100 -0
  204. package/node_modules/form-data/node_modules/mime-db/db.json +8519 -0
  205. package/node_modules/form-data/node_modules/mime-db/index.js +12 -0
  206. package/node_modules/form-data/node_modules/mime-db/package.json +60 -0
  207. package/node_modules/form-data/node_modules/mime-types/HISTORY.md +397 -0
  208. package/node_modules/form-data/node_modules/mime-types/LICENSE +23 -0
  209. package/node_modules/form-data/node_modules/mime-types/README.md +113 -0
  210. package/node_modules/form-data/node_modules/mime-types/index.js +188 -0
  211. package/node_modules/form-data/node_modules/mime-types/package.json +44 -0
  212. package/node_modules/form-data/package.json +82 -0
  213. package/node_modules/function-bind/.eslintrc +21 -0
  214. package/node_modules/function-bind/.github/FUNDING.yml +12 -0
  215. package/node_modules/function-bind/.github/SECURITY.md +3 -0
  216. package/node_modules/function-bind/.nycrc +13 -0
  217. package/node_modules/function-bind/CHANGELOG.md +136 -0
  218. package/node_modules/function-bind/LICENSE +20 -0
  219. package/node_modules/function-bind/README.md +46 -0
  220. package/node_modules/function-bind/implementation.js +84 -0
  221. package/node_modules/function-bind/index.js +5 -0
  222. package/node_modules/function-bind/package.json +87 -0
  223. package/node_modules/function-bind/test/.eslintrc +9 -0
  224. package/node_modules/function-bind/test/index.js +252 -0
  225. package/node_modules/get-intrinsic/.eslintrc +42 -0
  226. package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  227. package/node_modules/get-intrinsic/.nycrc +9 -0
  228. package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  229. package/node_modules/get-intrinsic/LICENSE +21 -0
  230. package/node_modules/get-intrinsic/README.md +71 -0
  231. package/node_modules/get-intrinsic/index.js +378 -0
  232. package/node_modules/get-intrinsic/package.json +97 -0
  233. package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  234. package/node_modules/get-proto/.eslintrc +10 -0
  235. package/node_modules/get-proto/.github/FUNDING.yml +12 -0
  236. package/node_modules/get-proto/.nycrc +9 -0
  237. package/node_modules/get-proto/CHANGELOG.md +21 -0
  238. package/node_modules/get-proto/LICENSE +21 -0
  239. package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  240. package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  241. package/node_modules/get-proto/README.md +50 -0
  242. package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  243. package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  244. package/node_modules/get-proto/index.d.ts +5 -0
  245. package/node_modules/get-proto/index.js +27 -0
  246. package/node_modules/get-proto/package.json +81 -0
  247. package/node_modules/get-proto/test/index.js +68 -0
  248. package/node_modules/get-proto/tsconfig.json +9 -0
  249. package/node_modules/gopd/.eslintrc +16 -0
  250. package/node_modules/gopd/.github/FUNDING.yml +12 -0
  251. package/node_modules/gopd/CHANGELOG.md +45 -0
  252. package/node_modules/gopd/LICENSE +21 -0
  253. package/node_modules/gopd/README.md +40 -0
  254. package/node_modules/gopd/gOPD.d.ts +1 -0
  255. package/node_modules/gopd/gOPD.js +4 -0
  256. package/node_modules/gopd/index.d.ts +5 -0
  257. package/node_modules/gopd/index.js +15 -0
  258. package/node_modules/gopd/package.json +77 -0
  259. package/node_modules/gopd/test/index.js +36 -0
  260. package/node_modules/gopd/tsconfig.json +9 -0
  261. package/node_modules/has-symbols/.eslintrc +11 -0
  262. package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  263. package/node_modules/has-symbols/.nycrc +9 -0
  264. package/node_modules/has-symbols/CHANGELOG.md +91 -0
  265. package/node_modules/has-symbols/LICENSE +21 -0
  266. package/node_modules/has-symbols/README.md +46 -0
  267. package/node_modules/has-symbols/index.d.ts +3 -0
  268. package/node_modules/has-symbols/index.js +14 -0
  269. package/node_modules/has-symbols/package.json +111 -0
  270. package/node_modules/has-symbols/shams.d.ts +3 -0
  271. package/node_modules/has-symbols/shams.js +45 -0
  272. package/node_modules/has-symbols/test/index.js +22 -0
  273. package/node_modules/has-symbols/test/shams/core-js.js +29 -0
  274. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  275. package/node_modules/has-symbols/test/tests.js +58 -0
  276. package/node_modules/has-symbols/tsconfig.json +10 -0
  277. package/node_modules/has-tostringtag/.eslintrc +5 -0
  278. package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
  279. package/node_modules/has-tostringtag/.nycrc +13 -0
  280. package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
  281. package/node_modules/has-tostringtag/LICENSE +21 -0
  282. package/node_modules/has-tostringtag/README.md +46 -0
  283. package/node_modules/has-tostringtag/index.d.ts +3 -0
  284. package/node_modules/has-tostringtag/index.js +8 -0
  285. package/node_modules/has-tostringtag/package.json +108 -0
  286. package/node_modules/has-tostringtag/shams.d.ts +3 -0
  287. package/node_modules/has-tostringtag/shams.js +8 -0
  288. package/node_modules/has-tostringtag/test/index.js +21 -0
  289. package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
  290. package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
  291. package/node_modules/has-tostringtag/test/tests.js +15 -0
  292. package/node_modules/has-tostringtag/tsconfig.json +49 -0
  293. package/node_modules/hasown/.github/FUNDING.yml +12 -0
  294. package/node_modules/hasown/.nycrc +13 -0
  295. package/node_modules/hasown/CHANGELOG.md +58 -0
  296. package/node_modules/hasown/LICENSE +21 -0
  297. package/node_modules/hasown/README.md +40 -0
  298. package/node_modules/hasown/eslint.config.mjs +6 -0
  299. package/node_modules/hasown/index.d.ts +3 -0
  300. package/node_modules/hasown/index.js +8 -0
  301. package/node_modules/hasown/package.json +91 -0
  302. package/node_modules/hasown/tsconfig.json +6 -0
  303. package/node_modules/json-bigint/LICENSE +20 -0
  304. package/node_modules/json-bigint/README.md +240 -0
  305. package/node_modules/json-bigint/index.js +12 -0
  306. package/node_modules/json-bigint/lib/parse.js +443 -0
  307. package/node_modules/json-bigint/lib/stringify.js +384 -0
  308. package/node_modules/json-bigint/package.json +34 -0
  309. package/node_modules/math-intrinsics/.eslintrc +16 -0
  310. package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  311. package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  312. package/node_modules/math-intrinsics/LICENSE +21 -0
  313. package/node_modules/math-intrinsics/README.md +50 -0
  314. package/node_modules/math-intrinsics/abs.d.ts +1 -0
  315. package/node_modules/math-intrinsics/abs.js +4 -0
  316. package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  317. package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  318. package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  319. package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  320. package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  321. package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  322. package/node_modules/math-intrinsics/floor.d.ts +1 -0
  323. package/node_modules/math-intrinsics/floor.js +4 -0
  324. package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  325. package/node_modules/math-intrinsics/isFinite.js +12 -0
  326. package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  327. package/node_modules/math-intrinsics/isInteger.js +16 -0
  328. package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  329. package/node_modules/math-intrinsics/isNaN.js +6 -0
  330. package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  331. package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  332. package/node_modules/math-intrinsics/max.d.ts +1 -0
  333. package/node_modules/math-intrinsics/max.js +4 -0
  334. package/node_modules/math-intrinsics/min.d.ts +1 -0
  335. package/node_modules/math-intrinsics/min.js +4 -0
  336. package/node_modules/math-intrinsics/mod.d.ts +3 -0
  337. package/node_modules/math-intrinsics/mod.js +9 -0
  338. package/node_modules/math-intrinsics/package.json +86 -0
  339. package/node_modules/math-intrinsics/pow.d.ts +1 -0
  340. package/node_modules/math-intrinsics/pow.js +4 -0
  341. package/node_modules/math-intrinsics/round.d.ts +1 -0
  342. package/node_modules/math-intrinsics/round.js +4 -0
  343. package/node_modules/math-intrinsics/sign.d.ts +3 -0
  344. package/node_modules/math-intrinsics/sign.js +11 -0
  345. package/node_modules/math-intrinsics/test/index.js +192 -0
  346. package/node_modules/math-intrinsics/tsconfig.json +3 -0
  347. package/node_modules/pako/LICENSE +21 -0
  348. package/node_modules/pako/README.md +155 -0
  349. package/node_modules/pako/dist/pako.es5.js +6760 -0
  350. package/node_modules/pako/dist/pako.es5.min.js +2 -0
  351. package/node_modules/pako/dist/pako.esm.mjs +6945 -0
  352. package/node_modules/pako/dist/pako.js +6964 -0
  353. package/node_modules/pako/dist/pako.min.js +2 -0
  354. package/node_modules/pako/dist/pako_deflate.es5.js +3953 -0
  355. package/node_modules/pako/dist/pako_deflate.es5.min.js +2 -0
  356. package/node_modules/pako/dist/pako_deflate.js +4154 -0
  357. package/node_modules/pako/dist/pako_deflate.min.js +2 -0
  358. package/node_modules/pako/dist/pako_inflate.es5.js +3272 -0
  359. package/node_modules/pako/dist/pako_inflate.es5.min.js +2 -0
  360. package/node_modules/pako/dist/pako_inflate.js +3279 -0
  361. package/node_modules/pako/dist/pako_inflate.min.js +2 -0
  362. package/node_modules/pako/index.js +18 -0
  363. package/node_modules/pako/lib/deflate.js +387 -0
  364. package/node_modules/pako/lib/inflate.js +456 -0
  365. package/node_modules/pako/lib/utils/common.js +48 -0
  366. package/node_modules/pako/lib/utils/strings.js +174 -0
  367. package/node_modules/pako/lib/zlib/README +59 -0
  368. package/node_modules/pako/lib/zlib/adler32.js +51 -0
  369. package/node_modules/pako/lib/zlib/constants.js +68 -0
  370. package/node_modules/pako/lib/zlib/crc32.js +59 -0
  371. package/node_modules/pako/lib/zlib/deflate.js +2069 -0
  372. package/node_modules/pako/lib/zlib/gzheader.js +58 -0
  373. package/node_modules/pako/lib/zlib/inffast.js +344 -0
  374. package/node_modules/pako/lib/zlib/inflate.js +1575 -0
  375. package/node_modules/pako/lib/zlib/inftrees.js +340 -0
  376. package/node_modules/pako/lib/zlib/messages.js +32 -0
  377. package/node_modules/pako/lib/zlib/trees.js +1179 -0
  378. package/node_modules/pako/lib/zlib/zstream.js +47 -0
  379. package/node_modules/pako/package.json +73 -0
  380. package/node_modules/semver/LICENSE +15 -0
  381. package/node_modules/semver/README.md +680 -0
  382. package/node_modules/semver/bin/semver.js +195 -0
  383. package/node_modules/semver/classes/comparator.js +143 -0
  384. package/node_modules/semver/classes/index.js +7 -0
  385. package/node_modules/semver/classes/range.js +577 -0
  386. package/node_modules/semver/classes/semver.js +350 -0
  387. package/node_modules/semver/functions/clean.js +8 -0
  388. package/node_modules/semver/functions/cmp.js +54 -0
  389. package/node_modules/semver/functions/coerce.js +62 -0
  390. package/node_modules/semver/functions/compare-build.js +9 -0
  391. package/node_modules/semver/functions/compare-loose.js +5 -0
  392. package/node_modules/semver/functions/compare.js +7 -0
  393. package/node_modules/semver/functions/diff.js +60 -0
  394. package/node_modules/semver/functions/eq.js +5 -0
  395. package/node_modules/semver/functions/gt.js +5 -0
  396. package/node_modules/semver/functions/gte.js +5 -0
  397. package/node_modules/semver/functions/inc.js +21 -0
  398. package/node_modules/semver/functions/lt.js +5 -0
  399. package/node_modules/semver/functions/lte.js +5 -0
  400. package/node_modules/semver/functions/major.js +5 -0
  401. package/node_modules/semver/functions/minor.js +5 -0
  402. package/node_modules/semver/functions/neq.js +5 -0
  403. package/node_modules/semver/functions/parse.js +18 -0
  404. package/node_modules/semver/functions/patch.js +5 -0
  405. package/node_modules/semver/functions/prerelease.js +8 -0
  406. package/node_modules/semver/functions/rcompare.js +5 -0
  407. package/node_modules/semver/functions/rsort.js +5 -0
  408. package/node_modules/semver/functions/satisfies.js +12 -0
  409. package/node_modules/semver/functions/sort.js +5 -0
  410. package/node_modules/semver/functions/truncate.js +48 -0
  411. package/node_modules/semver/functions/valid.js +8 -0
  412. package/node_modules/semver/index.js +93 -0
  413. package/node_modules/semver/internal/constants.js +37 -0
  414. package/node_modules/semver/internal/debug.js +11 -0
  415. package/node_modules/semver/internal/identifiers.js +29 -0
  416. package/node_modules/semver/internal/lrucache.js +42 -0
  417. package/node_modules/semver/internal/parse-options.js +17 -0
  418. package/node_modules/semver/internal/re.js +223 -0
  419. package/node_modules/semver/package.json +78 -0
  420. package/node_modules/semver/preload.js +4 -0
  421. package/node_modules/semver/range.bnf +17 -0
  422. package/node_modules/semver/ranges/gtr.js +6 -0
  423. package/node_modules/semver/ranges/intersects.js +9 -0
  424. package/node_modules/semver/ranges/ltr.js +6 -0
  425. package/node_modules/semver/ranges/max-satisfying.js +27 -0
  426. package/node_modules/semver/ranges/min-satisfying.js +26 -0
  427. package/node_modules/semver/ranges/min-version.js +63 -0
  428. package/node_modules/semver/ranges/outside.js +82 -0
  429. package/node_modules/semver/ranges/simplify.js +49 -0
  430. package/node_modules/semver/ranges/subset.js +249 -0
  431. package/node_modules/semver/ranges/to-comparators.js +10 -0
  432. package/node_modules/semver/ranges/valid.js +13 -0
  433. package/node_modules/spark-md5/LICENSE +13 -0
  434. package/node_modules/spark-md5/README.md +191 -0
  435. package/node_modules/spark-md5/package.json +35 -0
  436. package/node_modules/spark-md5/spark-md5.js +751 -0
  437. package/node_modules/spark-md5/spark-md5.min.js +1 -0
  438. package/node_modules/tldts/LICENSE +13 -0
  439. package/node_modules/tldts/README.md +327 -0
  440. package/node_modules/tldts/bin/cli.js +21 -0
  441. package/node_modules/tldts/dist/cjs/index.js +666 -0
  442. package/node_modules/tldts/dist/cjs/index.js.map +1 -0
  443. package/node_modules/tldts/dist/cjs/src/data/trie.js +14 -0
  444. package/node_modules/tldts/dist/cjs/src/data/trie.js.map +1 -0
  445. package/node_modules/tldts/dist/cjs/src/suffix-trie.js +67 -0
  446. package/node_modules/tldts/dist/cjs/src/suffix-trie.js.map +1 -0
  447. package/node_modules/tldts/dist/cjs/tsconfig.tsbuildinfo +1 -0
  448. package/node_modules/tldts/dist/es6/index.js +33 -0
  449. package/node_modules/tldts/dist/es6/index.js.map +1 -0
  450. package/node_modules/tldts/dist/es6/src/data/trie.js +11 -0
  451. package/node_modules/tldts/dist/es6/src/data/trie.js.map +1 -0
  452. package/node_modules/tldts/dist/es6/src/suffix-trie.js +64 -0
  453. package/node_modules/tldts/dist/es6/src/suffix-trie.js.map +1 -0
  454. package/node_modules/tldts/dist/es6/tsconfig.bundle.tsbuildinfo +1 -0
  455. package/node_modules/tldts/dist/index.cjs.min.js +2 -0
  456. package/node_modules/tldts/dist/index.cjs.min.js.map +1 -0
  457. package/node_modules/tldts/dist/index.esm.min.js +2 -0
  458. package/node_modules/tldts/dist/index.esm.min.js.map +1 -0
  459. package/node_modules/tldts/dist/index.umd.min.js +2 -0
  460. package/node_modules/tldts/dist/index.umd.min.js.map +1 -0
  461. package/node_modules/tldts/dist/types/index.d.ts +7 -0
  462. package/node_modules/tldts/dist/types/src/data/trie.d.ts +5 -0
  463. package/node_modules/tldts/dist/types/src/suffix-trie.d.ts +5 -0
  464. package/node_modules/tldts/index.ts +62 -0
  465. package/node_modules/tldts/package.json +91 -0
  466. package/node_modules/tldts/src/data/trie.ts +14 -0
  467. package/node_modules/tldts/src/suffix-trie.ts +110 -0
  468. package/node_modules/tldts-core/LICENSE +13 -0
  469. package/node_modules/tldts-core/README.md +3 -0
  470. package/node_modules/tldts-core/dist/cjs/index.js +561 -0
  471. package/node_modules/tldts-core/dist/cjs/index.js.map +1 -0
  472. package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js +15 -0
  473. package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js.map +1 -0
  474. package/node_modules/tldts-core/dist/cjs/src/domain.js +83 -0
  475. package/node_modules/tldts-core/dist/cjs/src/domain.js.map +1 -0
  476. package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js +149 -0
  477. package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js.map +1 -0
  478. package/node_modules/tldts-core/dist/cjs/src/factory.js +104 -0
  479. package/node_modules/tldts-core/dist/cjs/src/factory.js.map +1 -0
  480. package/node_modules/tldts-core/dist/cjs/src/is-ip.js +72 -0
  481. package/node_modules/tldts-core/dist/cjs/src/is-ip.js.map +1 -0
  482. package/node_modules/tldts-core/dist/cjs/src/is-valid.js +69 -0
  483. package/node_modules/tldts-core/dist/cjs/src/is-valid.js.map +1 -0
  484. package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js +69 -0
  485. package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js.map +1 -0
  486. package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js +3 -0
  487. package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js.map +1 -0
  488. package/node_modules/tldts-core/dist/cjs/src/options.js +22 -0
  489. package/node_modules/tldts-core/dist/cjs/src/options.js.map +1 -0
  490. package/node_modules/tldts-core/dist/cjs/src/subdomain.js +14 -0
  491. package/node_modules/tldts-core/dist/cjs/src/subdomain.js.map +1 -0
  492. package/node_modules/tldts-core/dist/cjs/tsconfig.tsbuildinfo +1 -0
  493. package/node_modules/tldts-core/dist/es6/index.js +4 -0
  494. package/node_modules/tldts-core/dist/es6/index.js.map +1 -0
  495. package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js +12 -0
  496. package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js.map +1 -0
  497. package/node_modules/tldts-core/dist/es6/src/domain.js +80 -0
  498. package/node_modules/tldts-core/dist/es6/src/domain.js.map +1 -0
  499. package/node_modules/tldts-core/dist/es6/src/extract-hostname.js +146 -0
  500. package/node_modules/tldts-core/dist/es6/src/extract-hostname.js.map +1 -0
  501. package/node_modules/tldts-core/dist/es6/src/factory.js +99 -0
  502. package/node_modules/tldts-core/dist/es6/src/factory.js.map +1 -0
  503. package/node_modules/tldts-core/dist/es6/src/is-ip.js +69 -0
  504. package/node_modules/tldts-core/dist/es6/src/is-ip.js.map +1 -0
  505. package/node_modules/tldts-core/dist/es6/src/is-valid.js +66 -0
  506. package/node_modules/tldts-core/dist/es6/src/is-valid.js.map +1 -0
  507. package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js +66 -0
  508. package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js.map +1 -0
  509. package/node_modules/tldts-core/dist/es6/src/lookup/interface.js +2 -0
  510. package/node_modules/tldts-core/dist/es6/src/lookup/interface.js.map +1 -0
  511. package/node_modules/tldts-core/dist/es6/src/options.js +19 -0
  512. package/node_modules/tldts-core/dist/es6/src/options.js.map +1 -0
  513. package/node_modules/tldts-core/dist/es6/src/subdomain.js +11 -0
  514. package/node_modules/tldts-core/dist/es6/src/subdomain.js.map +1 -0
  515. package/node_modules/tldts-core/dist/es6/tsconfig.bundle.tsbuildinfo +1 -0
  516. package/node_modules/tldts-core/dist/types/index.d.ts +4 -0
  517. package/node_modules/tldts-core/dist/types/src/domain-without-suffix.d.ts +6 -0
  518. package/node_modules/tldts-core/dist/types/src/domain.d.ts +5 -0
  519. package/node_modules/tldts-core/dist/types/src/extract-hostname.d.ts +5 -0
  520. package/node_modules/tldts-core/dist/types/src/factory.d.ts +28 -0
  521. package/node_modules/tldts-core/dist/types/src/is-ip.d.ts +6 -0
  522. package/node_modules/tldts-core/dist/types/src/is-valid.d.ts +15 -0
  523. package/node_modules/tldts-core/dist/types/src/lookup/fast-path.d.ts +2 -0
  524. package/node_modules/tldts-core/dist/types/src/lookup/interface.d.ts +9 -0
  525. package/node_modules/tldts-core/dist/types/src/options.d.ts +10 -0
  526. package/node_modules/tldts-core/dist/types/src/subdomain.d.ts +4 -0
  527. package/node_modules/tldts-core/index.ts +10 -0
  528. package/node_modules/tldts-core/package.json +68 -0
  529. package/node_modules/tldts-core/src/domain-without-suffix.ts +14 -0
  530. package/node_modules/tldts-core/src/domain.ts +100 -0
  531. package/node_modules/tldts-core/src/extract-hostname.ts +170 -0
  532. package/node_modules/tldts-core/src/factory.ts +160 -0
  533. package/node_modules/tldts-core/src/is-ip.ts +87 -0
  534. package/node_modules/tldts-core/src/is-valid.ts +79 -0
  535. package/node_modules/tldts-core/src/lookup/fast-path.ts +80 -0
  536. package/node_modules/tldts-core/src/lookup/interface.ts +10 -0
  537. package/node_modules/tldts-core/src/options.ts +39 -0
  538. package/node_modules/tldts-core/src/subdomain.ts +11 -0
  539. package/node_modules/tough-cookie/LICENSE +12 -0
  540. package/node_modules/tough-cookie/README.md +154 -0
  541. package/node_modules/tough-cookie/dist/cookie/canonicalDomain.d.ts +33 -0
  542. package/node_modules/tough-cookie/dist/cookie/canonicalDomain.js +65 -0
  543. package/node_modules/tough-cookie/dist/cookie/constants.d.ts +54 -0
  544. package/node_modules/tough-cookie/dist/cookie/constants.js +38 -0
  545. package/node_modules/tough-cookie/dist/cookie/cookie.d.ts +326 -0
  546. package/node_modules/tough-cookie/dist/cookie/cookie.js +831 -0
  547. package/node_modules/tough-cookie/dist/cookie/cookieCompare.d.ts +58 -0
  548. package/node_modules/tough-cookie/dist/cookie/cookieCompare.js +84 -0
  549. package/node_modules/tough-cookie/dist/cookie/cookieJar.d.ts +621 -0
  550. package/node_modules/tough-cookie/dist/cookie/cookieJar.js +1000 -0
  551. package/node_modules/tough-cookie/dist/cookie/defaultPath.d.ts +40 -0
  552. package/node_modules/tough-cookie/dist/cookie/defaultPath.js +60 -0
  553. package/node_modules/tough-cookie/dist/cookie/domainMatch.d.ts +38 -0
  554. package/node_modules/tough-cookie/dist/cookie/domainMatch.js +94 -0
  555. package/node_modules/tough-cookie/dist/cookie/formatDate.d.ts +15 -0
  556. package/node_modules/tough-cookie/dist/cookie/formatDate.js +20 -0
  557. package/node_modules/tough-cookie/dist/cookie/index.d.ts +29 -0
  558. package/node_modules/tough-cookie/dist/cookie/index.js +54 -0
  559. package/node_modules/tough-cookie/dist/cookie/parseDate.d.ts +103 -0
  560. package/node_modules/tough-cookie/dist/cookie/parseDate.js +323 -0
  561. package/node_modules/tough-cookie/dist/cookie/permutePath.d.ts +14 -0
  562. package/node_modules/tough-cookie/dist/cookie/permutePath.js +32 -0
  563. package/node_modules/tough-cookie/dist/getPublicSuffix.d.ts +55 -0
  564. package/node_modules/tough-cookie/dist/getPublicSuffix.js +71 -0
  565. package/node_modules/tough-cookie/dist/memstore.d.ts +220 -0
  566. package/node_modules/tough-cookie/dist/memstore.js +187 -0
  567. package/node_modules/tough-cookie/dist/pathMatch.d.ts +17 -0
  568. package/node_modules/tough-cookie/dist/pathMatch.js +40 -0
  569. package/node_modules/tough-cookie/dist/permuteDomain.d.ts +15 -0
  570. package/node_modules/tough-cookie/dist/permuteDomain.js +44 -0
  571. package/node_modules/tough-cookie/dist/store.d.ts +211 -0
  572. package/node_modules/tough-cookie/dist/store.js +76 -0
  573. package/node_modules/tough-cookie/dist/utils.d.ts +34 -0
  574. package/node_modules/tough-cookie/dist/utils.js +99 -0
  575. package/node_modules/tough-cookie/dist/validators.d.ts +24 -0
  576. package/node_modules/tough-cookie/dist/validators.js +90 -0
  577. package/node_modules/tough-cookie/dist/version.d.ts +5 -0
  578. package/node_modules/tough-cookie/dist/version.js +8 -0
  579. package/node_modules/tough-cookie/package.json +144 -0
  580. package/node_modules/ws/LICENSE +20 -0
  581. package/node_modules/ws/README.md +548 -0
  582. package/node_modules/ws/browser.js +8 -0
  583. package/node_modules/ws/index.js +22 -0
  584. package/node_modules/ws/lib/buffer-util.js +131 -0
  585. package/node_modules/ws/lib/constants.js +19 -0
  586. package/node_modules/ws/lib/event-target.js +292 -0
  587. package/node_modules/ws/lib/extension.js +203 -0
  588. package/node_modules/ws/lib/limiter.js +55 -0
  589. package/node_modules/ws/lib/permessage-deflate.js +530 -0
  590. package/node_modules/ws/lib/receiver.js +743 -0
  591. package/node_modules/ws/lib/sender.js +607 -0
  592. package/node_modules/ws/lib/stream.js +161 -0
  593. package/node_modules/ws/lib/subprotocol.js +62 -0
  594. package/node_modules/ws/lib/validation.js +152 -0
  595. package/node_modules/ws/lib/websocket-server.js +562 -0
  596. package/node_modules/ws/lib/websocket.js +1407 -0
  597. package/node_modules/ws/package.json +74 -0
  598. package/node_modules/ws/wrapper.mjs +21 -0
  599. package/node_modules/zca-js/.prettierrc +5 -0
  600. package/node_modules/zca-js/CODE_OF_CONDUCT.md +163 -0
  601. package/node_modules/zca-js/CONTRIBUTING.md +470 -0
  602. package/node_modules/zca-js/LICENSE +21 -0
  603. package/node_modules/zca-js/README.md +225 -0
  604. package/node_modules/zca-js/SECURITY.md +83 -0
  605. package/node_modules/zca-js/dist/Errors/ZaloApiError.d.ts +4 -0
  606. package/node_modules/zca-js/dist/Errors/ZaloApiError.js +7 -0
  607. package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.d.ts +4 -0
  608. package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.js +7 -0
  609. package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.d.ts +4 -0
  610. package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.js +7 -0
  611. package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.d.ts +4 -0
  612. package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.js +7 -0
  613. package/node_modules/zca-js/dist/Errors/index.d.ts +4 -0
  614. package/node_modules/zca-js/dist/Errors/index.js +4 -0
  615. package/node_modules/zca-js/dist/apis/acceptFriendRequest.d.ts +2 -0
  616. package/node_modules/zca-js/dist/apis/acceptFriendRequest.js +28 -0
  617. package/node_modules/zca-js/dist/apis/addGroupBlockedMember.d.ts +2 -0
  618. package/node_modules/zca-js/dist/apis/addGroupBlockedMember.js +28 -0
  619. package/node_modules/zca-js/dist/apis/addGroupDeputy.d.ts +2 -0
  620. package/node_modules/zca-js/dist/apis/addGroupDeputy.js +30 -0
  621. package/node_modules/zca-js/dist/apis/addPollOptions.d.ts +14 -0
  622. package/node_modules/zca-js/dist/apis/addPollOptions.js +26 -0
  623. package/node_modules/zca-js/dist/apis/addQuickMessage.d.ts +11 -0
  624. package/node_modules/zca-js/dist/apis/addQuickMessage.js +60 -0
  625. package/node_modules/zca-js/dist/apis/addReaction.d.ts +18 -0
  626. package/node_modules/zca-js/dist/apis/addReaction.js +294 -0
  627. package/node_modules/zca-js/dist/apis/addUnreadMark.d.ts +8 -0
  628. package/node_modules/zca-js/dist/apis/addUnreadMark.js +52 -0
  629. package/node_modules/zca-js/dist/apis/addUserToGroup.d.ts +5 -0
  630. package/node_modules/zca-js/dist/apis/addUserToGroup.js +34 -0
  631. package/node_modules/zca-js/dist/apis/blockUser.d.ts +2 -0
  632. package/node_modules/zca-js/dist/apis/blockUser.js +28 -0
  633. package/node_modules/zca-js/dist/apis/blockViewFeed.d.ts +2 -0
  634. package/node_modules/zca-js/dist/apis/blockViewFeed.js +30 -0
  635. package/node_modules/zca-js/dist/apis/changeAccountAvatar.d.ts +3 -0
  636. package/node_modules/zca-js/dist/apis/changeAccountAvatar.js +52 -0
  637. package/node_modules/zca-js/dist/apis/changeFriendAlias.d.ts +2 -0
  638. package/node_modules/zca-js/dist/apis/changeFriendAlias.js +27 -0
  639. package/node_modules/zca-js/dist/apis/changeGroupAvatar.d.ts +3 -0
  640. package/node_modules/zca-js/dist/apis/changeGroupAvatar.js +44 -0
  641. package/node_modules/zca-js/dist/apis/changeGroupName.d.ts +4 -0
  642. package/node_modules/zca-js/dist/apis/changeGroupName.js +32 -0
  643. package/node_modules/zca-js/dist/apis/changeGroupOwner.d.ts +4 -0
  644. package/node_modules/zca-js/dist/apis/changeGroupOwner.js +30 -0
  645. package/node_modules/zca-js/dist/apis/createAutoReply.d.ts +14 -0
  646. package/node_modules/zca-js/dist/apis/createAutoReply.js +37 -0
  647. package/node_modules/zca-js/dist/apis/createBankAccount.d.ts +8 -0
  648. package/node_modules/zca-js/dist/apis/createBankAccount.js +32 -0
  649. package/node_modules/zca-js/dist/apis/createCatalog.d.ts +7 -0
  650. package/node_modules/zca-js/dist/apis/createCatalog.js +29 -0
  651. package/node_modules/zca-js/dist/apis/createGroup.d.ts +28 -0
  652. package/node_modules/zca-js/dist/apis/createGroup.js +43 -0
  653. package/node_modules/zca-js/dist/apis/createNote.d.ts +7 -0
  654. package/node_modules/zca-js/dist/apis/createNote.js +47 -0
  655. package/node_modules/zca-js/dist/apis/createPoll.d.ts +36 -0
  656. package/node_modules/zca-js/dist/apis/createPoll.js +40 -0
  657. package/node_modules/zca-js/dist/apis/createProductCatalog.d.ts +23 -0
  658. package/node_modules/zca-js/dist/apis/createProductCatalog.js +50 -0
  659. package/node_modules/zca-js/dist/apis/createReminder.d.ts +12 -0
  660. package/node_modules/zca-js/dist/apis/createReminder.js +63 -0
  661. package/node_modules/zca-js/dist/apis/custom.d.ts +9 -0
  662. package/node_modules/zca-js/dist/apis/custom.js +15 -0
  663. package/node_modules/zca-js/dist/apis/deleteAutoReply.d.ts +5 -0
  664. package/node_modules/zca-js/dist/apis/deleteAutoReply.js +29 -0
  665. package/node_modules/zca-js/dist/apis/deleteAvatar.d.ts +9 -0
  666. package/node_modules/zca-js/dist/apis/deleteAvatar.js +27 -0
  667. package/node_modules/zca-js/dist/apis/deleteBankAccount.d.ts +11 -0
  668. package/node_modules/zca-js/dist/apis/deleteBankAccount.js +32 -0
  669. package/node_modules/zca-js/dist/apis/deleteCatalog.d.ts +2 -0
  670. package/node_modules/zca-js/dist/apis/deleteCatalog.js +28 -0
  671. package/node_modules/zca-js/dist/apis/deleteChat.d.ts +19 -0
  672. package/node_modules/zca-js/dist/apis/deleteChat.js +50 -0
  673. package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.d.ts +9 -0
  674. package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.js +27 -0
  675. package/node_modules/zca-js/dist/apis/deleteMessage.d.ts +14 -0
  676. package/node_modules/zca-js/dist/apis/deleteMessage.js +52 -0
  677. package/node_modules/zca-js/dist/apis/deleteProductCatalog.d.ts +10 -0
  678. package/node_modules/zca-js/dist/apis/deleteProductCatalog.js +31 -0
  679. package/node_modules/zca-js/dist/apis/deleteSnapshotMobileMsg.js +18 -0
  680. package/node_modules/zca-js/dist/apis/disableGroupLink.d.ts +2 -0
  681. package/node_modules/zca-js/dist/apis/disableGroupLink.js +24 -0
  682. package/node_modules/zca-js/dist/apis/disperseGroup.d.ts +2 -0
  683. package/node_modules/zca-js/dist/apis/disperseGroup.js +28 -0
  684. package/node_modules/zca-js/dist/apis/editNote.d.ts +17 -0
  685. package/node_modules/zca-js/dist/apis/editNote.js +46 -0
  686. package/node_modules/zca-js/dist/apis/editReminder.d.ts +13 -0
  687. package/node_modules/zca-js/dist/apis/editReminder.js +61 -0
  688. package/node_modules/zca-js/dist/apis/enableGroupLink.d.ts +6 -0
  689. package/node_modules/zca-js/dist/apis/enableGroupLink.js +25 -0
  690. package/node_modules/zca-js/dist/apis/fetchAccountInfo.d.ts +5 -0
  691. package/node_modules/zca-js/dist/apis/fetchAccountInfo.js +10 -0
  692. package/node_modules/zca-js/dist/apis/findUser.d.ts +3 -0
  693. package/node_modules/zca-js/dist/apis/findUser.js +42 -0
  694. package/node_modules/zca-js/dist/apis/findUserByUsername.d.ts +3 -0
  695. package/node_modules/zca-js/dist/apis/findUserByUsername.js +27 -0
  696. package/node_modules/zca-js/dist/apis/forwardMessage.d.ts +24 -0
  697. package/node_modules/zca-js/dist/apis/forwardMessage.js +114 -0
  698. package/node_modules/zca-js/dist/apis/getAliasList.d.ts +8 -0
  699. package/node_modules/zca-js/dist/apis/getAliasList.js +27 -0
  700. package/node_modules/zca-js/dist/apis/getAllFriends.d.ts +3 -0
  701. package/node_modules/zca-js/dist/apis/getAllFriends.js +34 -0
  702. package/node_modules/zca-js/dist/apis/getAllGroups.d.ts +7 -0
  703. package/node_modules/zca-js/dist/apis/getAllGroups.js +10 -0
  704. package/node_modules/zca-js/dist/apis/getArchivedChatList.d.ts +5 -0
  705. package/node_modules/zca-js/dist/apis/getArchivedChatList.js +23 -0
  706. package/node_modules/zca-js/dist/apis/getAutoDeleteChat.d.ts +9 -0
  707. package/node_modules/zca-js/dist/apis/getAutoDeleteChat.js +21 -0
  708. package/node_modules/zca-js/dist/apis/getAutoReplyList.d.ts +6 -0
  709. package/node_modules/zca-js/dist/apis/getAutoReplyList.js +24 -0
  710. package/node_modules/zca-js/dist/apis/getAvatarList.d.ts +12 -0
  711. package/node_modules/zca-js/dist/apis/getAvatarList.js +28 -0
  712. package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.d.ts +7 -0
  713. package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.js +30 -0
  714. package/node_modules/zca-js/dist/apis/getBizAccount.d.ts +24 -0
  715. package/node_modules/zca-js/dist/apis/getBizAccount.js +27 -0
  716. package/node_modules/zca-js/dist/apis/getCatalogList.d.ts +18 -0
  717. package/node_modules/zca-js/dist/apis/getCatalogList.js +32 -0
  718. package/node_modules/zca-js/dist/apis/getCloseFriends.d.ts +3 -0
  719. package/node_modules/zca-js/dist/apis/getCloseFriends.js +20 -0
  720. package/node_modules/zca-js/dist/apis/getContext.d.ts +1 -0
  721. package/node_modules/zca-js/dist/apis/getContext.js +4 -0
  722. package/node_modules/zca-js/dist/apis/getCookie.d.ts +1 -0
  723. package/node_modules/zca-js/dist/apis/getCookie.js +9 -0
  724. package/node_modules/zca-js/dist/apis/getCrossDB.js +18 -0
  725. package/node_modules/zca-js/dist/apis/getFriendBoardList.d.ts +5 -0
  726. package/node_modules/zca-js/dist/apis/getFriendBoardList.js +26 -0
  727. package/node_modules/zca-js/dist/apis/getFriendOnlines.d.ts +10 -0
  728. package/node_modules/zca-js/dist/apis/getFriendOnlines.js +35 -0
  729. package/node_modules/zca-js/dist/apis/getFriendRecommendations.d.ts +42 -0
  730. package/node_modules/zca-js/dist/apis/getFriendRecommendations.js +27 -0
  731. package/node_modules/zca-js/dist/apis/getFriendRequestStatus.d.ts +8 -0
  732. package/node_modules/zca-js/dist/apis/getFriendRequestStatus.js +25 -0
  733. package/node_modules/zca-js/dist/apis/getFullAvatar.d.ts +5 -0
  734. package/node_modules/zca-js/dist/apis/getFullAvatar.js +25 -0
  735. package/node_modules/zca-js/dist/apis/getGroupBlockedMember.d.ts +23 -0
  736. package/node_modules/zca-js/dist/apis/getGroupBlockedMember.js +29 -0
  737. package/node_modules/zca-js/dist/apis/getGroupChatHistory.d.ts +8 -0
  738. package/node_modules/zca-js/dist/apis/getGroupChatHistory.js +36 -0
  739. package/node_modules/zca-js/dist/apis/getGroupInfo.d.ts +16 -0
  740. package/node_modules/zca-js/dist/apis/getGroupInfo.js +32 -0
  741. package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.d.ts +32 -0
  742. package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.js +38 -0
  743. package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.d.ts +38 -0
  744. package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.js +31 -0
  745. package/node_modules/zca-js/dist/apis/getGroupLinkDetail.d.ts +9 -0
  746. package/node_modules/zca-js/dist/apis/getGroupLinkDetail.js +25 -0
  747. package/node_modules/zca-js/dist/apis/getGroupLinkInfo.d.ts +34 -0
  748. package/node_modules/zca-js/dist/apis/getGroupLinkInfo.js +28 -0
  749. package/node_modules/zca-js/dist/apis/getGroupMembersInfo.d.ts +17 -0
  750. package/node_modules/zca-js/dist/apis/getGroupMembersInfo.js +24 -0
  751. package/node_modules/zca-js/dist/apis/getHiddenConversations.d.ts +11 -0
  752. package/node_modules/zca-js/dist/apis/getHiddenConversations.js +23 -0
  753. package/node_modules/zca-js/dist/apis/getLabels.d.ts +7 -0
  754. package/node_modules/zca-js/dist/apis/getLabels.js +28 -0
  755. package/node_modules/zca-js/dist/apis/getListBank.d.ts +5 -0
  756. package/node_modules/zca-js/dist/apis/getListBank.js +20 -0
  757. package/node_modules/zca-js/dist/apis/getListBankAccount.d.ts +7 -0
  758. package/node_modules/zca-js/dist/apis/getListBankAccount.js +27 -0
  759. package/node_modules/zca-js/dist/apis/getListBoard.d.ts +21 -0
  760. package/node_modules/zca-js/dist/apis/getListBoard.js +45 -0
  761. package/node_modules/zca-js/dist/apis/getListDevice.d.ts +10 -0
  762. package/node_modules/zca-js/dist/apis/getListDevice.js +22 -0
  763. package/node_modules/zca-js/dist/apis/getListReminder.d.ts +28 -0
  764. package/node_modules/zca-js/dist/apis/getListReminder.js +47 -0
  765. package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.d.ts +5 -0
  766. package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.js +39 -0
  767. package/node_modules/zca-js/dist/apis/getMute.d.ts +13 -0
  768. package/node_modules/zca-js/dist/apis/getMute.js +22 -0
  769. package/node_modules/zca-js/dist/apis/getOwnId.d.ts +1 -0
  770. package/node_modules/zca-js/dist/apis/getOwnId.js +4 -0
  771. package/node_modules/zca-js/dist/apis/getPendingGroupMembers.d.ts +11 -0
  772. package/node_modules/zca-js/dist/apis/getPendingGroupMembers.js +27 -0
  773. package/node_modules/zca-js/dist/apis/getPinConversations.d.ts +5 -0
  774. package/node_modules/zca-js/dist/apis/getPinConversations.js +22 -0
  775. package/node_modules/zca-js/dist/apis/getPollDetail.d.ts +3 -0
  776. package/node_modules/zca-js/dist/apis/getPollDetail.js +30 -0
  777. package/node_modules/zca-js/dist/apis/getProductCatalogList.d.ts +20 -0
  778. package/node_modules/zca-js/dist/apis/getProductCatalogList.js +33 -0
  779. package/node_modules/zca-js/dist/apis/getQR.d.ts +4 -0
  780. package/node_modules/zca-js/dist/apis/getQR.js +29 -0
  781. package/node_modules/zca-js/dist/apis/getQuickMessageList.d.ts +7 -0
  782. package/node_modules/zca-js/dist/apis/getQuickMessageList.js +24 -0
  783. package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.d.ts +6 -0
  784. package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.js +30 -0
  785. package/node_modules/zca-js/dist/apis/getReminder.d.ts +3 -0
  786. package/node_modules/zca-js/dist/apis/getReminder.js +25 -0
  787. package/node_modules/zca-js/dist/apis/getReminderResponses.d.ts +5 -0
  788. package/node_modules/zca-js/dist/apis/getReminderResponses.js +24 -0
  789. package/node_modules/zca-js/dist/apis/getSentFriendRequest.d.ts +18 -0
  790. package/node_modules/zca-js/dist/apis/getSentFriendRequest.js +24 -0
  791. package/node_modules/zca-js/dist/apis/getSettings.d.ts +3 -0
  792. package/node_modules/zca-js/dist/apis/getSettings.js +20 -0
  793. package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.d.ts +3 -0
  794. package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.js +24 -0
  795. package/node_modules/zca-js/dist/apis/getStickers.d.ts +1 -0
  796. package/node_modules/zca-js/dist/apis/getStickers.js +40 -0
  797. package/node_modules/zca-js/dist/apis/getStickersDetail.d.ts +3 -0
  798. package/node_modules/zca-js/dist/apis/getStickersDetail.js +40 -0
  799. package/node_modules/zca-js/dist/apis/getUnreadMark.d.ts +14 -0
  800. package/node_modules/zca-js/dist/apis/getUnreadMark.js +30 -0
  801. package/node_modules/zca-js/dist/apis/getUserInfo.d.ts +8 -0
  802. package/node_modules/zca-js/dist/apis/getUserInfo.js +44 -0
  803. package/node_modules/zca-js/dist/apis/inviteUserToGroups.d.ts +10 -0
  804. package/node_modules/zca-js/dist/apis/inviteUserToGroups.js +30 -0
  805. package/node_modules/zca-js/dist/apis/joinGroupInviteBox.d.ts +2 -0
  806. package/node_modules/zca-js/dist/apis/joinGroupInviteBox.js +25 -0
  807. package/node_modules/zca-js/dist/apis/joinGroupLink.d.ts +2 -0
  808. package/node_modules/zca-js/dist/apis/joinGroupLink.js +27 -0
  809. package/node_modules/zca-js/dist/apis/keepAlive.d.ts +4 -0
  810. package/node_modules/zca-js/dist/apis/keepAlive.js +22 -0
  811. package/node_modules/zca-js/dist/apis/lastOnline.d.ts +7 -0
  812. package/node_modules/zca-js/dist/apis/lastOnline.js +26 -0
  813. package/node_modules/zca-js/dist/apis/leaveGroup.d.ts +4 -0
  814. package/node_modules/zca-js/dist/apis/leaveGroup.js +33 -0
  815. package/node_modules/zca-js/dist/apis/listen.d.ts +102 -0
  816. package/node_modules/zca-js/dist/apis/listen.js +425 -0
  817. package/node_modules/zca-js/dist/apis/lockPoll.d.ts +2 -0
  818. package/node_modules/zca-js/dist/apis/lockPoll.js +28 -0
  819. package/node_modules/zca-js/dist/apis/login.d.ts +3 -0
  820. package/node_modules/zca-js/dist/apis/login.js +96 -0
  821. package/node_modules/zca-js/dist/apis/loginQR.d.ts +71 -0
  822. package/node_modules/zca-js/dist/apis/loginQR.js +376 -0
  823. package/node_modules/zca-js/dist/apis/logoutV2.js +79 -0
  824. package/node_modules/zca-js/dist/apis/lostFocus.d.ts +4 -0
  825. package/node_modules/zca-js/dist/apis/lostFocus.js +23 -0
  826. package/node_modules/zca-js/dist/apis/parseLink.d.ts +21 -0
  827. package/node_modules/zca-js/dist/apis/parseLink.js +27 -0
  828. package/node_modules/zca-js/dist/apis/pullMobileMsg.js +22 -0
  829. package/node_modules/zca-js/dist/apis/registerCatalog.d.ts +2 -0
  830. package/node_modules/zca-js/dist/apis/registerCatalog.js +27 -0
  831. package/node_modules/zca-js/dist/apis/rejectFriendRequest.d.ts +2 -0
  832. package/node_modules/zca-js/dist/apis/rejectFriendRequest.js +27 -0
  833. package/node_modules/zca-js/dist/apis/removeFriend.d.ts +2 -0
  834. package/node_modules/zca-js/dist/apis/removeFriend.js +28 -0
  835. package/node_modules/zca-js/dist/apis/removeFriendAlias.d.ts +2 -0
  836. package/node_modules/zca-js/dist/apis/removeFriendAlias.js +24 -0
  837. package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.d.ts +2 -0
  838. package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.js +28 -0
  839. package/node_modules/zca-js/dist/apis/removeGroupDeputy.d.ts +2 -0
  840. package/node_modules/zca-js/dist/apis/removeGroupDeputy.js +30 -0
  841. package/node_modules/zca-js/dist/apis/removeQuickMessage.d.ts +5 -0
  842. package/node_modules/zca-js/dist/apis/removeQuickMessage.js +27 -0
  843. package/node_modules/zca-js/dist/apis/removeReminder.d.ts +3 -0
  844. package/node_modules/zca-js/dist/apis/removeReminder.js +40 -0
  845. package/node_modules/zca-js/dist/apis/removeUnreadMark.d.ts +8 -0
  846. package/node_modules/zca-js/dist/apis/removeUnreadMark.js +50 -0
  847. package/node_modules/zca-js/dist/apis/removeUserFromGroup.d.ts +4 -0
  848. package/node_modules/zca-js/dist/apis/removeUserFromGroup.js +34 -0
  849. package/node_modules/zca-js/dist/apis/requestSyncMessage.js +18 -0
  850. package/node_modules/zca-js/dist/apis/resetHiddenConversPin.d.ts +2 -0
  851. package/node_modules/zca-js/dist/apis/resetHiddenConversPin.js +20 -0
  852. package/node_modules/zca-js/dist/apis/reuseAvatar.d.ts +2 -0
  853. package/node_modules/zca-js/dist/apis/reuseAvatar.js +26 -0
  854. package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.d.ts +14 -0
  855. package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.js +38 -0
  856. package/node_modules/zca-js/dist/apis/scanURL.d.ts +4 -0
  857. package/node_modules/zca-js/dist/apis/scanURL.js +28 -0
  858. package/node_modules/zca-js/dist/apis/searchSticker.d.ts +3 -0
  859. package/node_modules/zca-js/dist/apis/searchSticker.js +28 -0
  860. package/node_modules/zca-js/dist/apis/sendBankCard.d.ts +9 -0
  861. package/node_modules/zca-js/dist/apis/sendBankCard.js +53 -0
  862. package/node_modules/zca-js/dist/apis/sendCard.d.ts +10 -0
  863. package/node_modules/zca-js/dist/apis/sendCard.js +75 -0
  864. package/node_modules/zca-js/dist/apis/sendDeliveredEvent.d.ts +16 -0
  865. package/node_modules/zca-js/dist/apis/sendDeliveredEvent.js +55 -0
  866. package/node_modules/zca-js/dist/apis/sendFriendRequest.d.ts +2 -0
  867. package/node_modules/zca-js/dist/apis/sendFriendRequest.js +39 -0
  868. package/node_modules/zca-js/dist/apis/sendLink.d.ts +10 -0
  869. package/node_modules/zca-js/dist/apis/sendLink.js +78 -0
  870. package/node_modules/zca-js/dist/apis/sendMessage.d.ts +105 -0
  871. package/node_modules/zca-js/dist/apis/sendMessage.js +486 -0
  872. package/node_modules/zca-js/dist/apis/sendReport.d.ts +17 -0
  873. package/node_modules/zca-js/dist/apis/sendReport.js +53 -0
  874. package/node_modules/zca-js/dist/apis/sendSeenEvent.d.ts +16 -0
  875. package/node_modules/zca-js/dist/apis/sendSeenEvent.js +63 -0
  876. package/node_modules/zca-js/dist/apis/sendSticker.d.ts +10 -0
  877. package/node_modules/zca-js/dist/apis/sendSticker.js +74 -0
  878. package/node_modules/zca-js/dist/apis/sendTypingEvent.d.ts +5 -0
  879. package/node_modules/zca-js/dist/apis/sendTypingEvent.js +33 -0
  880. package/node_modules/zca-js/dist/apis/sendVideo.d.ts +35 -0
  881. package/node_modules/zca-js/dist/apis/sendVideo.js +134 -0
  882. package/node_modules/zca-js/dist/apis/sendVoice.d.ts +12 -0
  883. package/node_modules/zca-js/dist/apis/sendVoice.js +89 -0
  884. package/node_modules/zca-js/dist/apis/setHiddenConversations.d.ts +3 -0
  885. package/node_modules/zca-js/dist/apis/setHiddenConversations.js +39 -0
  886. package/node_modules/zca-js/dist/apis/setMute.d.ts +20 -0
  887. package/node_modules/zca-js/dist/apis/setMute.js +67 -0
  888. package/node_modules/zca-js/dist/apis/setPinnedConversations.d.ts +3 -0
  889. package/node_modules/zca-js/dist/apis/setPinnedConversations.js +34 -0
  890. package/node_modules/zca-js/dist/apis/sharePoll.d.ts +2 -0
  891. package/node_modules/zca-js/dist/apis/sharePoll.js +28 -0
  892. package/node_modules/zca-js/dist/apis/unblockUser.d.ts +2 -0
  893. package/node_modules/zca-js/dist/apis/unblockUser.js +28 -0
  894. package/node_modules/zca-js/dist/apis/undo.d.ts +9 -0
  895. package/node_modules/zca-js/dist/apis/undo.js +42 -0
  896. package/node_modules/zca-js/dist/apis/undoFriendRequest.d.ts +2 -0
  897. package/node_modules/zca-js/dist/apis/undoFriendRequest.js +27 -0
  898. package/node_modules/zca-js/dist/apis/updateActiveStatus.d.ts +4 -0
  899. package/node_modules/zca-js/dist/apis/updateActiveStatus.js +27 -0
  900. package/node_modules/zca-js/dist/apis/updateArchivedChatList.d.ts +10 -0
  901. package/node_modules/zca-js/dist/apis/updateArchivedChatList.js +34 -0
  902. package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.d.ts +9 -0
  903. package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.js +40 -0
  904. package/node_modules/zca-js/dist/apis/updateAutoReply.d.ts +15 -0
  905. package/node_modules/zca-js/dist/apis/updateAutoReply.js +38 -0
  906. package/node_modules/zca-js/dist/apis/updateBankAccount.d.ts +9 -0
  907. package/node_modules/zca-js/dist/apis/updateBankAccount.js +31 -0
  908. package/node_modules/zca-js/dist/apis/updateCatalog.d.ts +11 -0
  909. package/node_modules/zca-js/dist/apis/updateCatalog.js +30 -0
  910. package/node_modules/zca-js/dist/apis/updateGroupSettings.d.ts +40 -0
  911. package/node_modules/zca-js/dist/apis/updateGroupSettings.js +43 -0
  912. package/node_modules/zca-js/dist/apis/updateHiddenConversPin.d.ts +2 -0
  913. package/node_modules/zca-js/dist/apis/updateHiddenConversPin.js +30 -0
  914. package/node_modules/zca-js/dist/apis/updateLabels.d.ts +15 -0
  915. package/node_modules/zca-js/dist/apis/updateLabels.js +34 -0
  916. package/node_modules/zca-js/dist/apis/updateLang.d.ts +6 -0
  917. package/node_modules/zca-js/dist/apis/updateLang.js +30 -0
  918. package/node_modules/zca-js/dist/apis/updateProductCatalog.d.ts +25 -0
  919. package/node_modules/zca-js/dist/apis/updateProductCatalog.js +51 -0
  920. package/node_modules/zca-js/dist/apis/updateProfile.d.ts +20 -0
  921. package/node_modules/zca-js/dist/apis/updateProfile.js +43 -0
  922. package/node_modules/zca-js/dist/apis/updateProfileBio.d.ts +2 -0
  923. package/node_modules/zca-js/dist/apis/updateProfileBio.js +27 -0
  924. package/node_modules/zca-js/dist/apis/updateQuickMessage.d.ts +11 -0
  925. package/node_modules/zca-js/dist/apis/updateQuickMessage.js +61 -0
  926. package/node_modules/zca-js/dist/apis/updateSettings.d.ts +16 -0
  927. package/node_modules/zca-js/dist/apis/updateSettings.js +90 -0
  928. package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.d.ts +2 -0
  929. package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.js +27 -0
  930. package/node_modules/zca-js/dist/apis/uploadAttachment.d.ts +50 -0
  931. package/node_modules/zca-js/dist/apis/uploadAttachment.js +197 -0
  932. package/node_modules/zca-js/dist/apis/uploadProductPhoto.d.ts +14 -0
  933. package/node_modules/zca-js/dist/apis/uploadProductPhoto.js +50 -0
  934. package/node_modules/zca-js/dist/apis/votePoll.d.ts +5 -0
  935. package/node_modules/zca-js/dist/apis/votePoll.js +29 -0
  936. package/node_modules/zca-js/dist/apis.d.ts +317 -0
  937. package/node_modules/zca-js/dist/apis.js +327 -0
  938. package/node_modules/zca-js/dist/cjs/Errors/ZaloApiError.cjs +11 -0
  939. package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRAborted.cjs +12 -0
  940. package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRDeclined.cjs +12 -0
  941. package/node_modules/zca-js/dist/cjs/Errors/ZaloApiMissingImageMetadataGetter.cjs +12 -0
  942. package/node_modules/zca-js/dist/cjs/apis/acceptFriendRequest.cjs +33 -0
  943. package/node_modules/zca-js/dist/cjs/apis/addGroupBlockedMember.cjs +33 -0
  944. package/node_modules/zca-js/dist/cjs/apis/addGroupDeputy.cjs +35 -0
  945. package/node_modules/zca-js/dist/cjs/apis/addPollOptions.cjs +31 -0
  946. package/node_modules/zca-js/dist/cjs/apis/addQuickMessage.cjs +65 -0
  947. package/node_modules/zca-js/dist/cjs/apis/addReaction.cjs +308 -0
  948. package/node_modules/zca-js/dist/cjs/apis/addUnreadMark.cjs +66 -0
  949. package/node_modules/zca-js/dist/cjs/apis/addUserToGroup.cjs +39 -0
  950. package/node_modules/zca-js/dist/cjs/apis/blockUser.cjs +33 -0
  951. package/node_modules/zca-js/dist/cjs/apis/blockViewFeed.cjs +35 -0
  952. package/node_modules/zca-js/dist/cjs/apis/changeAccountAvatar.cjs +57 -0
  953. package/node_modules/zca-js/dist/cjs/apis/changeFriendAlias.cjs +32 -0
  954. package/node_modules/zca-js/dist/cjs/apis/changeGroupAvatar.cjs +49 -0
  955. package/node_modules/zca-js/dist/cjs/apis/changeGroupName.cjs +37 -0
  956. package/node_modules/zca-js/dist/cjs/apis/changeGroupOwner.cjs +35 -0
  957. package/node_modules/zca-js/dist/cjs/apis/createAutoReply.cjs +42 -0
  958. package/node_modules/zca-js/dist/cjs/apis/createBankAccount.cjs +37 -0
  959. package/node_modules/zca-js/dist/cjs/apis/createCatalog.cjs +34 -0
  960. package/node_modules/zca-js/dist/cjs/apis/createGroup.cjs +48 -0
  961. package/node_modules/zca-js/dist/cjs/apis/createNote.cjs +52 -0
  962. package/node_modules/zca-js/dist/cjs/apis/createPoll.cjs +45 -0
  963. package/node_modules/zca-js/dist/cjs/apis/createProductCatalog.cjs +55 -0
  964. package/node_modules/zca-js/dist/cjs/apis/createReminder.cjs +77 -0
  965. package/node_modules/zca-js/dist/cjs/apis/custom.cjs +19 -0
  966. package/node_modules/zca-js/dist/cjs/apis/deleteAutoReply.cjs +34 -0
  967. package/node_modules/zca-js/dist/cjs/apis/deleteAvatar.cjs +32 -0
  968. package/node_modules/zca-js/dist/cjs/apis/deleteBankAccount.cjs +37 -0
  969. package/node_modules/zca-js/dist/cjs/apis/deleteCatalog.cjs +33 -0
  970. package/node_modules/zca-js/dist/cjs/apis/deleteChat.cjs +64 -0
  971. package/node_modules/zca-js/dist/cjs/apis/deleteGroupInviteBox.cjs +32 -0
  972. package/node_modules/zca-js/dist/cjs/apis/deleteMessage.cjs +66 -0
  973. package/node_modules/zca-js/dist/cjs/apis/deleteProductCatalog.cjs +36 -0
  974. package/node_modules/zca-js/dist/cjs/apis/deleteSnapshotMobileMsg.cjs +22 -0
  975. package/node_modules/zca-js/dist/cjs/apis/disableGroupLink.cjs +29 -0
  976. package/node_modules/zca-js/dist/cjs/apis/disperseGroup.cjs +33 -0
  977. package/node_modules/zca-js/dist/cjs/apis/editNote.cjs +51 -0
  978. package/node_modules/zca-js/dist/cjs/apis/editReminder.cjs +75 -0
  979. package/node_modules/zca-js/dist/cjs/apis/enableGroupLink.cjs +30 -0
  980. package/node_modules/zca-js/dist/cjs/apis/fetchAccountInfo.cjs +15 -0
  981. package/node_modules/zca-js/dist/cjs/apis/findUser.cjs +56 -0
  982. package/node_modules/zca-js/dist/cjs/apis/findUserByUsername.cjs +41 -0
  983. package/node_modules/zca-js/dist/cjs/apis/forwardMessage.cjs +129 -0
  984. package/node_modules/zca-js/dist/cjs/apis/getAliasList.cjs +32 -0
  985. package/node_modules/zca-js/dist/cjs/apis/getAllFriends.cjs +48 -0
  986. package/node_modules/zca-js/dist/cjs/apis/getAllGroups.cjs +15 -0
  987. package/node_modules/zca-js/dist/cjs/apis/getArchivedChatList.cjs +28 -0
  988. package/node_modules/zca-js/dist/cjs/apis/getAutoDeleteChat.cjs +26 -0
  989. package/node_modules/zca-js/dist/cjs/apis/getAutoReplyList.cjs +29 -0
  990. package/node_modules/zca-js/dist/cjs/apis/getAvatarList.cjs +33 -0
  991. package/node_modules/zca-js/dist/cjs/apis/getAvatarUrlProfile.cjs +44 -0
  992. package/node_modules/zca-js/dist/cjs/apis/getBizAccount.cjs +32 -0
  993. package/node_modules/zca-js/dist/cjs/apis/getCatalogList.cjs +37 -0
  994. package/node_modules/zca-js/dist/cjs/apis/getCloseFriends.cjs +25 -0
  995. package/node_modules/zca-js/dist/cjs/apis/getContext.cjs +9 -0
  996. package/node_modules/zca-js/dist/cjs/apis/getCookie.cjs +14 -0
  997. package/node_modules/zca-js/dist/cjs/apis/getCrossDB.cjs +22 -0
  998. package/node_modules/zca-js/dist/cjs/apis/getFriendBoardList.cjs +31 -0
  999. package/node_modules/zca-js/dist/cjs/apis/getFriendOnlines.cjs +40 -0
  1000. package/node_modules/zca-js/dist/cjs/apis/getFriendRecommendations.cjs +32 -0
  1001. package/node_modules/zca-js/dist/cjs/apis/getFriendRequestStatus.cjs +30 -0
  1002. package/node_modules/zca-js/dist/cjs/apis/getFullAvatar.cjs +30 -0
  1003. package/node_modules/zca-js/dist/cjs/apis/getGroupBlockedMember.cjs +34 -0
  1004. package/node_modules/zca-js/dist/cjs/apis/getGroupChatHistory.cjs +51 -0
  1005. package/node_modules/zca-js/dist/cjs/apis/getGroupInfo.cjs +37 -0
  1006. package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxInfo.cjs +43 -0
  1007. package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxList.cjs +36 -0
  1008. package/node_modules/zca-js/dist/cjs/apis/getGroupLinkDetail.cjs +30 -0
  1009. package/node_modules/zca-js/dist/cjs/apis/getGroupLinkInfo.cjs +33 -0
  1010. package/node_modules/zca-js/dist/cjs/apis/getGroupMembersInfo.cjs +29 -0
  1011. package/node_modules/zca-js/dist/cjs/apis/getHiddenConversations.cjs +28 -0
  1012. package/node_modules/zca-js/dist/cjs/apis/getLabels.cjs +33 -0
  1013. package/node_modules/zca-js/dist/cjs/apis/getListBank.cjs +25 -0
  1014. package/node_modules/zca-js/dist/cjs/apis/getListBankAccount.cjs +32 -0
  1015. package/node_modules/zca-js/dist/cjs/apis/getListBoard.cjs +59 -0
  1016. package/node_modules/zca-js/dist/cjs/apis/getListDevice.cjs +27 -0
  1017. package/node_modules/zca-js/dist/cjs/apis/getListReminder.cjs +61 -0
  1018. package/node_modules/zca-js/dist/cjs/apis/getMultiUsersByPhones.cjs +53 -0
  1019. package/node_modules/zca-js/dist/cjs/apis/getMute.cjs +27 -0
  1020. package/node_modules/zca-js/dist/cjs/apis/getOwnId.cjs +9 -0
  1021. package/node_modules/zca-js/dist/cjs/apis/getPendingGroupMembers.cjs +32 -0
  1022. package/node_modules/zca-js/dist/cjs/apis/getPinConversations.cjs +27 -0
  1023. package/node_modules/zca-js/dist/cjs/apis/getPollDetail.cjs +35 -0
  1024. package/node_modules/zca-js/dist/cjs/apis/getProductCatalogList.cjs +38 -0
  1025. package/node_modules/zca-js/dist/cjs/apis/getQR.cjs +34 -0
  1026. package/node_modules/zca-js/dist/cjs/apis/getQuickMessageList.cjs +29 -0
  1027. package/node_modules/zca-js/dist/cjs/apis/getRelatedFriendGroup.cjs +35 -0
  1028. package/node_modules/zca-js/dist/cjs/apis/getReminder.cjs +30 -0
  1029. package/node_modules/zca-js/dist/cjs/apis/getReminderResponses.cjs +29 -0
  1030. package/node_modules/zca-js/dist/cjs/apis/getSentFriendRequest.cjs +29 -0
  1031. package/node_modules/zca-js/dist/cjs/apis/getSettings.cjs +25 -0
  1032. package/node_modules/zca-js/dist/cjs/apis/getStickerCategoryDetail.cjs +29 -0
  1033. package/node_modules/zca-js/dist/cjs/apis/getStickers.cjs +45 -0
  1034. package/node_modules/zca-js/dist/cjs/apis/getStickersDetail.cjs +45 -0
  1035. package/node_modules/zca-js/dist/cjs/apis/getUnreadMark.cjs +35 -0
  1036. package/node_modules/zca-js/dist/cjs/apis/getUserInfo.cjs +58 -0
  1037. package/node_modules/zca-js/dist/cjs/apis/inviteUserToGroups.cjs +35 -0
  1038. package/node_modules/zca-js/dist/cjs/apis/joinGroupInviteBox.cjs +30 -0
  1039. package/node_modules/zca-js/dist/cjs/apis/joinGroupLink.cjs +32 -0
  1040. package/node_modules/zca-js/dist/cjs/apis/keepAlive.cjs +27 -0
  1041. package/node_modules/zca-js/dist/cjs/apis/lastOnline.cjs +31 -0
  1042. package/node_modules/zca-js/dist/cjs/apis/leaveGroup.cjs +38 -0
  1043. package/node_modules/zca-js/dist/cjs/apis/listen.cjs +440 -0
  1044. package/node_modules/zca-js/dist/cjs/apis/lockPoll.cjs +33 -0
  1045. package/node_modules/zca-js/dist/cjs/apis/login.cjs +102 -0
  1046. package/node_modules/zca-js/dist/cjs/apis/loginQR.cjs +368 -0
  1047. package/node_modules/zca-js/dist/cjs/apis/logoutV2.cjs +83 -0
  1048. package/node_modules/zca-js/dist/cjs/apis/lostFocus.cjs +28 -0
  1049. package/node_modules/zca-js/dist/cjs/apis/parseLink.cjs +32 -0
  1050. package/node_modules/zca-js/dist/cjs/apis/pullMobileMsg.cjs +26 -0
  1051. package/node_modules/zca-js/dist/cjs/apis/registerCatalog.cjs +32 -0
  1052. package/node_modules/zca-js/dist/cjs/apis/rejectFriendRequest.cjs +32 -0
  1053. package/node_modules/zca-js/dist/cjs/apis/removeFriend.cjs +33 -0
  1054. package/node_modules/zca-js/dist/cjs/apis/removeFriendAlias.cjs +29 -0
  1055. package/node_modules/zca-js/dist/cjs/apis/removeGroupBlockedMember.cjs +33 -0
  1056. package/node_modules/zca-js/dist/cjs/apis/removeGroupDeputy.cjs +35 -0
  1057. package/node_modules/zca-js/dist/cjs/apis/removeQuickMessage.cjs +32 -0
  1058. package/node_modules/zca-js/dist/cjs/apis/removeReminder.cjs +54 -0
  1059. package/node_modules/zca-js/dist/cjs/apis/removeUnreadMark.cjs +64 -0
  1060. package/node_modules/zca-js/dist/cjs/apis/removeUserFromGroup.cjs +39 -0
  1061. package/node_modules/zca-js/dist/cjs/apis/requestSyncMessage.cjs +22 -0
  1062. package/node_modules/zca-js/dist/cjs/apis/resetHiddenConversPin.cjs +25 -0
  1063. package/node_modules/zca-js/dist/cjs/apis/reuseAvatar.cjs +31 -0
  1064. package/node_modules/zca-js/dist/cjs/apis/reviewPendingMemberRequest.cjs +43 -0
  1065. package/node_modules/zca-js/dist/cjs/apis/scanURL.cjs +33 -0
  1066. package/node_modules/zca-js/dist/cjs/apis/searchSticker.cjs +33 -0
  1067. package/node_modules/zca-js/dist/cjs/apis/sendBankCard.cjs +68 -0
  1068. package/node_modules/zca-js/dist/cjs/apis/sendCard.cjs +89 -0
  1069. package/node_modules/zca-js/dist/cjs/apis/sendDeliveredEvent.cjs +69 -0
  1070. package/node_modules/zca-js/dist/cjs/apis/sendFriendRequest.cjs +44 -0
  1071. package/node_modules/zca-js/dist/cjs/apis/sendLink.cjs +92 -0
  1072. package/node_modules/zca-js/dist/cjs/apis/sendMessage.cjs +500 -0
  1073. package/node_modules/zca-js/dist/cjs/apis/sendReport.cjs +67 -0
  1074. package/node_modules/zca-js/dist/cjs/apis/sendSeenEvent.cjs +77 -0
  1075. package/node_modules/zca-js/dist/cjs/apis/sendSticker.cjs +88 -0
  1076. package/node_modules/zca-js/dist/cjs/apis/sendTypingEvent.cjs +47 -0
  1077. package/node_modules/zca-js/dist/cjs/apis/sendVideo.cjs +148 -0
  1078. package/node_modules/zca-js/dist/cjs/apis/sendVoice.cjs +103 -0
  1079. package/node_modules/zca-js/dist/cjs/apis/setHiddenConversations.cjs +53 -0
  1080. package/node_modules/zca-js/dist/cjs/apis/setMute.cjs +81 -0
  1081. package/node_modules/zca-js/dist/cjs/apis/setPinnedConversations.cjs +48 -0
  1082. package/node_modules/zca-js/dist/cjs/apis/sharePoll.cjs +33 -0
  1083. package/node_modules/zca-js/dist/cjs/apis/unblockUser.cjs +33 -0
  1084. package/node_modules/zca-js/dist/cjs/apis/undo.cjs +56 -0
  1085. package/node_modules/zca-js/dist/cjs/apis/undoFriendRequest.cjs +32 -0
  1086. package/node_modules/zca-js/dist/cjs/apis/updateActiveStatus.cjs +32 -0
  1087. package/node_modules/zca-js/dist/cjs/apis/updateArchivedChatList.cjs +39 -0
  1088. package/node_modules/zca-js/dist/cjs/apis/updateAutoDeleteChat.cjs +54 -0
  1089. package/node_modules/zca-js/dist/cjs/apis/updateAutoReply.cjs +43 -0
  1090. package/node_modules/zca-js/dist/cjs/apis/updateBankAccount.cjs +36 -0
  1091. package/node_modules/zca-js/dist/cjs/apis/updateCatalog.cjs +35 -0
  1092. package/node_modules/zca-js/dist/cjs/apis/updateGroupSettings.cjs +48 -0
  1093. package/node_modules/zca-js/dist/cjs/apis/updateHiddenConversPin.cjs +35 -0
  1094. package/node_modules/zca-js/dist/cjs/apis/updateLabels.cjs +39 -0
  1095. package/node_modules/zca-js/dist/cjs/apis/updateLang.cjs +35 -0
  1096. package/node_modules/zca-js/dist/cjs/apis/updateProductCatalog.cjs +56 -0
  1097. package/node_modules/zca-js/dist/cjs/apis/updateProfile.cjs +48 -0
  1098. package/node_modules/zca-js/dist/cjs/apis/updateProfileBio.cjs +32 -0
  1099. package/node_modules/zca-js/dist/cjs/apis/updateQuickMessage.cjs +66 -0
  1100. package/node_modules/zca-js/dist/cjs/apis/updateSettings.cjs +95 -0
  1101. package/node_modules/zca-js/dist/cjs/apis/upgradeGroupToCommunity.cjs +32 -0
  1102. package/node_modules/zca-js/dist/cjs/apis/uploadAttachment.cjs +211 -0
  1103. package/node_modules/zca-js/dist/cjs/apis/uploadProductPhoto.cjs +55 -0
  1104. package/node_modules/zca-js/dist/cjs/apis/votePoll.cjs +34 -0
  1105. package/node_modules/zca-js/dist/cjs/apis.cjs +332 -0
  1106. package/node_modules/zca-js/dist/cjs/context.cjs +34 -0
  1107. package/node_modules/zca-js/dist/cjs/index.cjs +159 -0
  1108. package/node_modules/zca-js/dist/cjs/models/AutoReply.cjs +9 -0
  1109. package/node_modules/zca-js/dist/cjs/models/Bank.cjs +263 -0
  1110. package/node_modules/zca-js/dist/cjs/models/Board.cjs +8 -0
  1111. package/node_modules/zca-js/dist/cjs/models/DeliveredMessage.cjs +23 -0
  1112. package/node_modules/zca-js/dist/cjs/models/Enum.cjs +27 -0
  1113. package/node_modules/zca-js/dist/cjs/models/FriendEvent.cjs +87 -0
  1114. package/node_modules/zca-js/dist/cjs/models/Group.cjs +13 -0
  1115. package/node_modules/zca-js/dist/cjs/models/GroupEvent.cjs +94 -0
  1116. package/node_modules/zca-js/dist/cjs/models/Message.cjs +35 -0
  1117. package/node_modules/zca-js/dist/cjs/models/Reaction.cjs +74 -0
  1118. package/node_modules/zca-js/dist/cjs/models/Reminder.cjs +9 -0
  1119. package/node_modules/zca-js/dist/cjs/models/SeenMessage.cjs +23 -0
  1120. package/node_modules/zca-js/dist/cjs/models/Typing.cjs +23 -0
  1121. package/node_modules/zca-js/dist/cjs/models/Undo.cjs +16 -0
  1122. package/node_modules/zca-js/dist/cjs/models/ZBusiness.cjs +39 -0
  1123. package/node_modules/zca-js/dist/cjs/update.cjs +34 -0
  1124. package/node_modules/zca-js/dist/cjs/utils.cjs +703 -0
  1125. package/node_modules/zca-js/dist/cjs/zalo.cjs +112 -0
  1126. package/node_modules/zca-js/dist/context.d.ts +179 -0
  1127. package/node_modules/zca-js/dist/context.js +28 -0
  1128. package/node_modules/zca-js/dist/index.d.ts +166 -0
  1129. package/node_modules/zca-js/dist/index.js +14 -0
  1130. package/node_modules/zca-js/dist/models/Attachment.d.ts +9 -0
  1131. package/node_modules/zca-js/dist/models/Attachment.js +1 -0
  1132. package/node_modules/zca-js/dist/models/AutoReply.d.ts +20 -0
  1133. package/node_modules/zca-js/dist/models/AutoReply.js +7 -0
  1134. package/node_modules/zca-js/dist/models/Bank.d.ts +291 -0
  1135. package/node_modules/zca-js/dist/models/Bank.js +262 -0
  1136. package/node_modules/zca-js/dist/models/Board.d.ts +60 -0
  1137. package/node_modules/zca-js/dist/models/Board.js +6 -0
  1138. package/node_modules/zca-js/dist/models/Catalog.d.ts +16 -0
  1139. package/node_modules/zca-js/dist/models/Catalog.js +1 -0
  1140. package/node_modules/zca-js/dist/models/DeliveredMessage.d.ts +27 -0
  1141. package/node_modules/zca-js/dist/models/DeliveredMessage.js +17 -0
  1142. package/node_modules/zca-js/dist/models/Enum.d.ts +21 -0
  1143. package/node_modules/zca-js/dist/models/Enum.js +25 -0
  1144. package/node_modules/zca-js/dist/models/FriendEvent.d.ts +107 -0
  1145. package/node_modules/zca-js/dist/models/FriendEvent.js +83 -0
  1146. package/node_modules/zca-js/dist/models/Group.d.ts +125 -0
  1147. package/node_modules/zca-js/dist/models/Group.js +11 -0
  1148. package/node_modules/zca-js/dist/models/GroupEvent.d.ts +178 -0
  1149. package/node_modules/zca-js/dist/models/GroupEvent.js +90 -0
  1150. package/node_modules/zca-js/dist/models/Label.d.ts +10 -0
  1151. package/node_modules/zca-js/dist/models/Label.js +1 -0
  1152. package/node_modules/zca-js/dist/models/Message.d.ts +91 -0
  1153. package/node_modules/zca-js/dist/models/Message.js +29 -0
  1154. package/node_modules/zca-js/dist/models/ProductCatalog.d.ts +17 -0
  1155. package/node_modules/zca-js/dist/models/ProductCatalog.js +1 -0
  1156. package/node_modules/zca-js/dist/models/QuickMessage.d.ts +25 -0
  1157. package/node_modules/zca-js/dist/models/QuickMessage.js +1 -0
  1158. package/node_modules/zca-js/dist/models/Reaction.d.ts +85 -0
  1159. package/node_modules/zca-js/dist/models/Reaction.js +70 -0
  1160. package/node_modules/zca-js/dist/models/Reminder.d.ts +51 -0
  1161. package/node_modules/zca-js/dist/models/Reminder.js +7 -0
  1162. package/node_modules/zca-js/dist/models/SeenMessage.d.ts +26 -0
  1163. package/node_modules/zca-js/dist/models/SeenMessage.js +17 -0
  1164. package/node_modules/zca-js/dist/models/Sticker.d.ts +27 -0
  1165. package/node_modules/zca-js/dist/models/Sticker.js +1 -0
  1166. package/node_modules/zca-js/dist/models/Typing.d.ts +24 -0
  1167. package/node_modules/zca-js/dist/models/Typing.js +17 -0
  1168. package/node_modules/zca-js/dist/models/Undo.d.ts +34 -0
  1169. package/node_modules/zca-js/dist/models/Undo.js +12 -0
  1170. package/node_modules/zca-js/dist/models/User.d.ts +70 -0
  1171. package/node_modules/zca-js/dist/models/User.js +1 -0
  1172. package/node_modules/zca-js/dist/models/ZBusiness.d.ts +22 -0
  1173. package/node_modules/zca-js/dist/models/ZBusiness.js +35 -0
  1174. package/node_modules/zca-js/dist/models/index.d.ts +22 -0
  1175. package/node_modules/zca-js/dist/models/index.js +22 -0
  1176. package/node_modules/zca-js/dist/update.d.ts +2 -0
  1177. package/node_modules/zca-js/dist/update.js +29 -0
  1178. package/node_modules/zca-js/dist/utils.d.ts +167 -0
  1179. package/node_modules/zca-js/dist/utils.js +719 -0
  1180. package/node_modules/zca-js/dist/zalo.d.ts +41 -0
  1181. package/node_modules/zca-js/dist/zalo.js +107 -0
  1182. package/node_modules/zca-js/eslint.config.js +21 -0
  1183. package/node_modules/zca-js/index.d.ts +2 -0
  1184. package/node_modules/zca-js/package.json +78 -0
  1185. package/node_modules/zca-js/rollup.config.js +28 -0
  1186. package/package.json +79 -62
  1187. package/patches/zca-js+2.2.0.patch +1677 -0
  1188. package/src/cli.test.js +34 -5
  1189. package/src/commands/account.js +98 -5
  1190. package/src/commands/auto-reply.js +30 -10
  1191. package/src/commands/catalog.js +5 -4
  1192. package/src/commands/conv.js +551 -14
  1193. package/src/commands/friend.js +19 -7
  1194. package/src/commands/group.js +82 -31
  1195. package/src/commands/listen.js +607 -65
  1196. package/src/commands/login.js +179 -20
  1197. package/src/commands/mcp.js +392 -41
  1198. package/src/commands/msg.js +1278 -139
  1199. package/src/commands/oa-listen.js +130 -20
  1200. package/src/commands/oa.js +26 -5
  1201. package/src/commands/poll.js +7 -2
  1202. package/src/commands/profile.js +3 -2
  1203. package/src/commands/sync.js +2052 -0
  1204. package/src/core/accounts.js +69 -6
  1205. package/src/core/cached-message.js +200 -0
  1206. package/src/core/coverage.js +90 -0
  1207. package/src/core/daemon-channel.js +638 -0
  1208. package/src/core/daemon-sync.js +181 -0
  1209. package/src/core/db.js +1610 -0
  1210. package/src/core/forward.js +112 -0
  1211. package/src/core/group-history.js +248 -0
  1212. package/src/core/group-members.js +68 -0
  1213. package/src/core/group-settings.js +250 -0
  1214. package/src/core/history-fetch.js +208 -0
  1215. package/src/core/listener-lifecycle.js +90 -0
  1216. package/src/core/live-api.js +47 -0
  1217. package/src/core/live-store.js +733 -0
  1218. package/src/core/lock.js +129 -0
  1219. package/src/core/logout.js +289 -0
  1220. package/src/core/offline-queue.js +194 -0
  1221. package/src/core/pin.js +222 -0
  1222. package/src/core/read-state.js +318 -0
  1223. package/src/core/receipts.js +679 -0
  1224. package/src/core/recent-conversations.js +30 -0
  1225. package/src/core/self-heal.js +522 -0
  1226. package/src/core/socket-tap.js +154 -0
  1227. package/src/core/sync-v2/assets.js +181 -0
  1228. package/src/core/sync-v2/board.js +338 -0
  1229. package/src/core/sync-v2/conv-state.js +152 -0
  1230. package/src/core/sync-v2/gap-advice.js +110 -0
  1231. package/src/core/sync-v2/gid.js +103 -0
  1232. package/src/core/sync-v2/index.js +1208 -0
  1233. package/src/core/sync-v2/keepalive.js +177 -0
  1234. package/src/core/sync-v2/media.js +704 -0
  1235. package/src/core/sync-v2/message-types.js +522 -0
  1236. package/src/core/sync-v2/plan.js +95 -0
  1237. package/src/core/sync-v2/reactions.js +236 -0
  1238. package/src/core/sync-v2/renewlink.js +124 -0
  1239. package/src/core/sync-v2/zcloud-cipher.js +88 -0
  1240. package/src/core/sync-v2/zcloud.js +675 -0
  1241. package/src/core/sync.js +540 -0
  1242. package/src/core/zalo-client.js +179 -61
  1243. package/src/core/zca-custom.js +78 -0
  1244. package/src/index.js +14 -3
  1245. package/src/mcp/mcp-config.js +40 -3
  1246. package/src/mcp/mcp-http-transport.js +11 -2
  1247. package/src/mcp/mcp-server.js +4 -2
  1248. package/src/mcp/mcp-tools.js +837 -97
  1249. package/src/mcp/message-buffer.js +38 -8
  1250. package/src/mcp/message-buffer.test.js +67 -15
  1251. package/src/mcp/notifier.js +17 -1
  1252. package/src/mcp/notifier.test.js +6 -0
  1253. package/src/utils/bank-helpers.js +8 -3
  1254. package/src/utils/device-fingerprint.js +72 -0
  1255. package/src/utils/mentions.js +140 -0
  1256. package/src/utils/my-documents.js +95 -0
  1257. package/src/utils/open-file.js +49 -0
  1258. package/src/utils/output.js +75 -4
  1259. package/src/utils/parse-options.js +56 -0
  1260. package/src/utils/qr-http-server.js +44 -7
  1261. package/src/utils/quote.js +203 -0
  1262. package/src/utils/thread-type.js +72 -0
  1263. package/src/utils/update-check.js +42 -1
  1264. package/src/utils/urgency.js +29 -0
  1265. package/src/mcp/media-downloader.js +0 -191
  1266. package/src/mcp/media-downloader.test.js +0 -45
  1267. package/src/utils/qr-display.test.js +0 -97
@@ -1,15 +1,196 @@
1
1
  /**
2
2
  * MCP tool registrations for Zalo message access and sending.
3
- * Registers 7 tools: zalo_get_messages, zalo_get_history, zalo_send_message, zalo_list_threads, zalo_search_threads, zalo_mark_read, zalo_view_media.
3
+ * Registers 12 tools: zalo_get_messages, zalo_get_history, zalo_send_message, zalo_list_threads,
4
+ * zalo_search_threads, zalo_mark_read, zalo_view_media, zalo_react, zalo_undo, zalo_get_group_members,
5
+ * zalo_list_conversations, zalo_coverage.
6
+ *
7
+ * A tool that mirrors a CLI command calls the same code the command does (src/core/cached-message.js,
8
+ * group-members.js, recent-conversations.js, src/utils/my-documents.js, urgency.js), so the two cannot
9
+ * drift apart.
4
10
  */
5
11
 
6
12
  import { z } from "zod";
7
- import { downloadMedia, openFile } from "./media-downloader.js";
13
+ import { openFile } from "../utils/open-file.js";
14
+ import { getMessages, getMessageById, getDisplayName, getThreadType, getConvState, getReadStates } from "../core/db.js";
15
+ import { downloadSyncedMedia } from "../core/sync-v2/media.js";
16
+ import { fetchAndCacheHistory } from "../core/history-fetch.js";
17
+ import { reactionCliMsgId, recallCliMsgId } from "../core/cached-message.js";
18
+ import { coverageReport } from "../core/coverage.js";
19
+ import { groupMemberUids, fetchMemberNames } from "../core/group-members.js";
20
+ import { recentConversations } from "../core/recent-conversations.js";
21
+ import { describeReadState, readOnZalo } from "../core/read-state.js";
8
22
  import { extractMessageText } from "../utils/extract-message-text.js";
23
+ import { expandMentions, ALL_MENTION_UID } from "../utils/mentions.js";
24
+ import { resolveSelfThread } from "../utils/my-documents.js";
25
+ import { buildQuote, resolveQuoteSender } from "../utils/quote.js";
26
+ import { urgencyLevel } from "../utils/urgency.js";
27
+
28
+ /**
29
+ * Resolve a thread's type the way the CLI does.
30
+ *
31
+ * The CLI rewrites a defaulted `--type` to 1 when the cache knows the id is a
32
+ * group (`applyCachedThreadType`, wired in src/index.js). The MCP tools had no
33
+ * equivalent: `threadType` carried a zod `.default(0)`, which is
34
+ * indistinguishable from the caller explicitly choosing DM, so a group send
35
+ * through MCP went out as type 0. It reports success, but the self-echo comes
36
+ * back on cmd 501 instead of 521, the listener re-types the conversation, and
37
+ * mentions are dropped silently. The MCP server IS the db writer, so the
38
+ * agent's own mistake corrupts the cache that quoting and history then read.
39
+ *
40
+ * Omitted means "work it out"; an explicit 0 or 1 is always obeyed.
41
+ *
42
+ * @param {string} threadId
43
+ * @param {number} [explicit] - the caller's threadType, if they gave one
44
+ * @returns {number} THREAD_USER or THREAD_GROUP
45
+ */
46
+ function resolveThreadType(threadId, explicit) {
47
+ if (explicit !== undefined && explicit !== null) return Number(explicit);
48
+ try {
49
+ return getThreadType(String(threadId)) === "group" ? THREAD_GROUP : THREAD_USER;
50
+ } catch {
51
+ // No cache yet: fall back to the old assumption rather than failing.
52
+ return THREAD_USER;
53
+ }
54
+ }
9
55
 
10
56
  /** Thread type constants matching zca-js ThreadType enum */
11
57
  const THREAD_USER = 0;
12
58
 
59
+ /** Thread type for groups — the only kind Zalo delivers mentions in. */
60
+ const THREAD_GROUP = 1;
61
+
62
+ /**
63
+ * How many member ids `zalo_get_group_members` asks Zalo to name per request.
64
+ * zca-js puts them in the request URL, and Zalo Web asks in bounded batches
65
+ * too; 50 is the batch the group commands already use for `getGroupInfo`.
66
+ */
67
+ const MEMBER_NAME_BATCH = 50;
68
+
69
+ /** How a refusal tells an agent to supply a message's cliMsgId itself. */
70
+ const CLI_MSG_ID_HINT = "the `cliMsgId` parameter (zalo_send_message returns it for a message you sent)";
71
+
72
+ /**
73
+ * A user's display name, read from the local cache only.
74
+ *
75
+ * Names a `@[uid]` mention token in `zalo_send_message`, and a member in
76
+ * `zalo_get_group_members` before that tool asks Zalo for the rest.
77
+ *
78
+ * **For mentions this deliberately does not do what the CLI does.** `msg
79
+ * send` falls back to a batched `getGroupMembersInfo` call for uids the cache
80
+ * cannot name (`fetchMentionNames` in `src/commands/msg.js`); the MCP send
81
+ * does not, and stays purely local:
82
+ *
83
+ * - The CLI's fallback exists for a human typing a uid for someone who has
84
+ * never posted in the group. An agent mostly learns uids from
85
+ * `zalo_get_messages` / `zalo_get_history`, whose rows carry `senderName`
86
+ * alongside `senderId`, so the cache can already name them. The exception
87
+ * is `zalo_get_group_members`, which hands out every member's uid and asks
88
+ * Zalo for the names the cache lacks — but writes none of them back (zalo.db
89
+ * has exactly three writers, AGENTS.md §13), so such a member is still
90
+ * tagged here under the bare uid.
91
+ * - `mcp start` opens the db before it serves a request and exits if it
92
+ * cannot, so unlike the CLI the cache is never merely absent here.
93
+ * - A network lookup in the hot path of every send would add an unofficial-API
94
+ * round trip, its latency, and its failure modes to a tool agents call in
95
+ * loops. The unofficial API is what gets accounts banned.
96
+ *
97
+ * The cost of staying local is a bare uid as the visible label when the cache
98
+ * has no name. The mention still tags the right person — `uid` is what Zalo
99
+ * notifies on — and `zalo_send_message` reports the fallback back to the
100
+ * caller as `unresolvedMentions` rather than hiding it.
101
+ *
102
+ * Never throws: a cache miss must not fail a send.
103
+ *
104
+ * @param {string} uid
105
+ * @returns {string|null}
106
+ */
107
+ function cachedDisplayName(uid) {
108
+ try {
109
+ return getDisplayName(uid);
110
+ } catch {
111
+ return null; // no db in this process
112
+ }
113
+ }
114
+
115
+ /**
116
+ * This account's own uid, or "" when the session cannot say.
117
+ *
118
+ * @param {object} api - zca-js API instance
119
+ * @returns {string}
120
+ */
121
+ function ownIdOf(api) {
122
+ try {
123
+ const id = api.getOwnId?.();
124
+ return id === undefined || id === null ? "" : String(id);
125
+ } catch {
126
+ return "";
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Each conversation's read state on Zalo -- the account's own reading, on any
132
+ * device -- for the tools that list conversations. Empty when the cache
133
+ * cannot answer, so a listing never fails for want of it.
134
+ *
135
+ * @param {object} api - zca-js API instance
136
+ * @param {string[]} threadIds
137
+ * @returns {Map<string, object>} threadId -> an entry of db.js getReadStates
138
+ */
139
+ function readStatesOf(api, threadIds) {
140
+ try {
141
+ return getReadStates(threadIds, ownIdOf(api));
142
+ } catch {
143
+ return new Map();
144
+ }
145
+ }
146
+
147
+ /**
148
+ * Resolve a `threadId` that names the self-chat to My Documents, as every
149
+ * `msg` subcommand does.
150
+ *
151
+ * `me`, or this account's own uid, means My Documents: a 1-1 conversation of
152
+ * its own whose id is the session's `loginInfo.send2me_id`, never the own uid
153
+ * (src/utils/my-documents.js, the same function `msg send me` calls). An
154
+ * explicit `threadType: 1` is refused, as `msg send me -t 1` is.
155
+ *
156
+ * @param {object} api - zca-js API instance
157
+ * @param {string} threadId - as the caller gave it
158
+ * @param {number} [threadTypeIn] - the caller's threadType, if they gave one
159
+ * @returns {null|{threadId: string, notice: string}|{error: string}} null when it is not a self reference
160
+ */
161
+ function selfThread(api, threadId, threadTypeIn) {
162
+ let ownId = null;
163
+ try {
164
+ ownId = api.getOwnId?.() ?? null;
165
+ } catch {
166
+ /* no session context: only the `me` alias can match, and it says why it cannot resolve */
167
+ }
168
+ return resolveSelfThread(threadId, {
169
+ ownId: ownId === null ? null : String(ownId),
170
+ send2meId: () => api.getContext().loginInfo?.send2me_id,
171
+ groupRequested: Number(threadTypeIn) === THREAD_GROUP,
172
+ });
173
+ }
174
+
175
+ /**
176
+ * The conversation a send or a message action names, and its type.
177
+ *
178
+ * My Documents (see {@link selfThread}) is always a 1-1; anything else is
179
+ * typed by {@link resolveThreadType}: the caller's explicit threadType, else
180
+ * the cache's.
181
+ *
182
+ * @param {object} api - zca-js API instance
183
+ * @param {string} threadIdIn - as the caller gave it
184
+ * @param {number} [threadTypeIn] - the caller's threadType, if they gave one
185
+ * @returns {{threadId: string, threadType: number, notice?: string}|{error: string}} `notice` only for My Documents
186
+ */
187
+ function actionThread(api, threadIdIn, threadTypeIn) {
188
+ const self = selfThread(api, threadIdIn, threadTypeIn);
189
+ if (self?.error) return { error: self.error };
190
+ if (self) return { threadId: self.threadId, threadType: THREAD_USER, notice: self.notice };
191
+ return { threadId: threadIdIn, threadType: resolveThreadType(threadIdIn, threadTypeIn) };
192
+ }
193
+
13
194
  /**
14
195
  * Wrap a result object into MCP tool content format.
15
196
  * @param {object} result
@@ -28,6 +209,56 @@ function err(message) {
28
209
  return { content: [{ type: "text", text: `Error: ${message}` }], isError: true };
29
210
  }
30
211
 
212
+ /**
213
+ * Read a thread's history out of the local cache.
214
+ *
215
+ * Returns null when the cache has nothing for the thread, which is the signal
216
+ * to fall back to asking Zalo.
217
+ *
218
+ * @param {string} threadId
219
+ * @param {number} limit
220
+ * @param {number} [before] - epoch ms; return messages older than this
221
+ * @param {object} [nameCache]
222
+ * @returns {object|null} tool payload, or null when the cache is empty/unopened
223
+ */
224
+ function cacheHistory(threadId, limit, before, nameCache) {
225
+ let rows;
226
+ try {
227
+ rows = getMessages(String(threadId), limit, before);
228
+ } catch {
229
+ return null; // no db open in this process — server path it is
230
+ }
231
+ if (!rows || rows.length === 0) return null;
232
+
233
+ const messages = rows
234
+ .map((m) => ({
235
+ msgId: m.msgId,
236
+ threadId: m.threadId,
237
+ senderId: m.senderId || null,
238
+ senderName: m.senderName || null,
239
+ text: m.text,
240
+ timestamp: m.timestamp,
241
+ type: m.type,
242
+ localPath: m.localPath || undefined,
243
+ hasAttachment: m.has_attachment ? true : undefined,
244
+ msgStatus: m.msgStatus ?? undefined,
245
+ }))
246
+ .sort((a, b) => (a.timestamp || 0) - (b.timestamp || 0));
247
+
248
+ const info = nameCache?.get(String(threadId));
249
+ if (info) for (const m of messages) m.threadName = info.name;
250
+
251
+ return {
252
+ threadId: String(threadId),
253
+ source: "cache",
254
+ count: messages.length,
255
+ messages,
256
+ // Oldest returned timestamp: pass it back as `before` for the next page.
257
+ cursor: messages.length ? messages[0].timestamp : (before ?? null),
258
+ hasMore: rows.length >= limit,
259
+ };
260
+ }
261
+
31
262
  /**
32
263
  * Register all Zalo MCP tools on the server.
33
264
  * @param {import("@modelcontextprotocol/sdk/server/mcp.js").McpServer} server
@@ -36,26 +267,54 @@ function err(message) {
36
267
  * @param {import("./thread-filter.js").ThreadFilter} filter
37
268
  * @param {object} config - MCP config
38
269
  * @param {import("./thread-name-cache.js").ThreadNameCache} [nameCache] - Thread name cache
270
+ * @param {string} [accountDir] - account data dir; media is fetched into <accountDir>/media
271
+ * @param {ReturnType<import("../core/daemon-channel.js").createStageLock>} [stageLock] - the
272
+ * daemon's one-stage-at-a-time lock; a server-side history fetch takes it, as `listen`'s does
39
273
  */
40
- export function registerTools(server, api, buffer, filter, config, nameCache) {
274
+ export function registerTools(server, api, buffer, filter, config, nameCache, accountDir, stageLock) {
41
275
  const maxPerPoll = config.limits?.maxMessagesPerPoll ?? 20;
42
276
 
277
+ // Several bots can share one listener, each with its own read cursor
278
+ // (triage M7). A bot that names none reads as "default", as before.
279
+ const consumerSchema = z
280
+ .string()
281
+ .min(1)
282
+ .max(64)
283
+ .regex(/^[A-Za-z0-9._:@-]+$/)
284
+ .optional()
285
+ .describe(
286
+ "Your bot's name, when several bots share this server: each name has its own read cursor, " +
287
+ "so one bot's zalo_mark_read does not hide messages from another. Omit it for a single bot.",
288
+ );
289
+
43
290
  // --- zalo_get_messages ---
44
291
  server.registerTool(
45
292
  "zalo_get_messages",
46
293
  {
47
294
  title: "Get Zalo Messages",
48
295
  description:
49
- "Get messages from Zalo threads (DMs and groups). Returns buffered messages since last read. Use 'since' cursor from previous response for incremental polling.",
296
+ "Get messages from Zalo threads (DMs and groups). Returns buffered messages this consumer has " +
297
+ "not marked read (see zalo_mark_read). Use 'since' cursor from previous response for incremental polling. " +
298
+ "Each message's `readOnZalo` says whether the account itself has already read it on Zalo -- the " +
299
+ "human, on the phone or Zalo Web -- and is null when the listener has not heard; zalo_mark_read " +
300
+ "does not change it.",
50
301
  inputSchema: z.object({
51
302
  threadId: z.string().optional().describe("Thread ID to read from. Omit for all watched threads."),
52
- since: z.number().int().min(0).default(0).describe("Cursor from previous read for incremental polling"),
303
+ since: z
304
+ .number()
305
+ .int()
306
+ .min(0)
307
+ .default(0)
308
+ .describe("Cursor from previous read for incremental polling; 0 means from your read cursor"),
53
309
  limit: z.number().int().min(1).max(100).default(maxPerPoll).describe("Max messages to return"),
310
+ consumer: consumerSchema,
54
311
  }),
55
312
  },
56
- async ({ threadId, since, limit }) => {
313
+ async ({ threadId, since, limit, consumer }) => {
57
314
  try {
58
- const result = buffer.read(threadId, since, limit);
315
+ // An explicit cursor is honored as given; 0 starts after what this consumer marked read.
316
+ const from = since > 0 ? since : buffer.readCursor(consumer);
317
+ const result = buffer.read(threadId, from, limit);
59
318
  // Enrich messages with thread name from cache
60
319
  if (nameCache) {
61
320
  for (const msg of result.messages) {
@@ -63,6 +322,25 @@ export function registerTools(server, api, buffer, filter, config, nameCache) {
63
322
  if (info) msg.threadName = info.name;
64
323
  }
65
324
  }
325
+ // Whether the human already read each one, from its
326
+ // conversation's read watermark (src/core/read-state.js).
327
+ const watermarks = new Map();
328
+ const watermarkOf = (id) => {
329
+ if (!watermarks.has(id)) {
330
+ let st = null;
331
+ try {
332
+ st = getConvState(id);
333
+ } catch {
334
+ /* no cache: unknown */
335
+ }
336
+ watermarks.set(id, st?.lastReadMsgId ?? null);
337
+ }
338
+ return watermarks.get(id);
339
+ };
340
+ result.messages = result.messages.map((msg) => ({
341
+ ...msg,
342
+ readOnZalo: readOnZalo(msg.id, watermarkOf(String(msg.threadId))),
343
+ }));
66
344
  return ok(result);
67
345
  } catch (e) {
68
346
  console.error("[mcp-tools] zalo_get_messages error:", e.message);
@@ -76,24 +354,161 @@ export function registerTools(server, api, buffer, filter, config, nameCache) {
76
354
  "zalo_send_message",
77
355
  {
78
356
  title: "Send Zalo Message",
79
- description: "Send a text message to a Zalo thread (DM or group). threadType: 0=DM(User), 1=Group.",
357
+ description:
358
+ "Send a text message to a Zalo thread (DM or group). threadType: 0=DM(User), 1=Group. " +
359
+ "To @-mention someone in a group, put `@[uid]` in the text where the tag belongs — " +
360
+ "`@[123456]` becomes `@Their Name` and notifies them, and `@[-1]` is @All. " +
361
+ "Use the `senderId` from zalo_get_messages or zalo_get_history as the uid; the display name " +
362
+ "is read from the local cache, and a uid it cannot name is tagged as the bare uid " +
363
+ "(reported back as `unresolvedMentions`). Mentions only deliver in groups (threadType 1). " +
364
+ "To reply to a specific message, pass its msgId as `quoteMsgId` — Zalo supports quote-replies " +
365
+ "to text messages only, and the quoted message must already be in the local cache. " +
366
+ '`urgency` marks the message Important or Urgent, as the apps do. `threadId: "me"` sends to ' +
367
+ "My Documents (your own cloud chat); the reply carries its real thread id.",
80
368
  inputSchema: z.object({
81
- threadId: z.string().describe("Thread ID to send message to"),
82
- text: z.string().min(1).describe("Message text to send"),
369
+ threadId: z
370
+ .string()
371
+ .describe("Thread ID to send message to. `me` (or your own uid) is My Documents, a 1-1 thread"),
372
+ text: z
373
+ .string()
374
+ .min(1)
375
+ .describe("Message text to send. `@[uid]` tokens expand to @-mentions; `@[-1]` is @All."),
83
376
  threadType: z
84
377
  .number()
85
378
  .int()
86
379
  .min(0)
87
380
  .max(1)
88
- .default(THREAD_USER)
89
- .describe("Thread type: 0=DM(User), 1=Group"),
381
+ .optional()
382
+ .describe(
383
+ "Thread type: 0=DM(User), 1=Group. Omit it and the cached thread type is " +
384
+ "used, which is what the CLI does — pass a value only to override that.",
385
+ ),
386
+ quoteMsgId: z
387
+ .string()
388
+ .optional()
389
+ .describe(
390
+ "msgId of a cached TEXT message in this thread to quote-reply to. " +
391
+ "Get it from zalo_get_messages or zalo_get_history.",
392
+ ),
393
+ urgency: z
394
+ .enum(["normal", "important", "urgent"])
395
+ .optional()
396
+ .describe(
397
+ "Mark the message the way the apps' Important/Urgent option does. Omit it, or 'normal', " +
398
+ "for an ordinary message",
399
+ ),
90
400
  }),
91
401
  },
92
- async ({ threadId, text, threadType }) => {
402
+ async ({ threadId: threadIdIn, text, threadType: threadTypeIn, quoteMsgId, urgency: urgencyIn }) => {
403
+ // `me` (or the own uid) is My Documents, always a 1-1 -- resolved
404
+ // before anything else reads the thread id, as `msg send me` is.
405
+ const thread = actionThread(api, threadIdIn, threadTypeIn);
406
+ if (thread.error) {
407
+ console.error("[mcp-tools] zalo_send_message refused:", thread.error);
408
+ return err(thread.error);
409
+ }
410
+ const { threadId, threadType } = thread;
93
411
  try {
94
- const result = await api.sendMessage(text, threadId, Number(threadType));
412
+ const warnings = [];
413
+
414
+ // `@[uid]` -> `@Display Name`, with the mention offsets measured
415
+ // on the string that comes out. The CLI runs this last, after
416
+ // markdown, because a display name may itself contain `*` or `_`;
417
+ // there is no markdown or style pass here, so there is nothing to
418
+ // order against and nothing to move — if styles are ever added to
419
+ // this tool, they must be run through `shiftStyles(styles,
420
+ // expanded.edits)` the way `msg send` does.
421
+ const unresolved = [];
422
+ const expanded = expandMentions(text, (uid) => {
423
+ const name = cachedDisplayName(uid);
424
+ if (!name && uid !== ALL_MENTION_UID) unresolved.push(uid);
425
+ return name;
426
+ });
427
+ const mentions = expanded.mentions;
428
+
429
+ // zca-js drops mentions outside a group, so a DM send would
430
+ // quietly arrive with the names as plain text and nobody tagged.
431
+ if (mentions.length > 0 && Number(threadType) !== THREAD_GROUP) {
432
+ warnings.push(
433
+ "Mentions only apply to group messages. This was sent with threadType " +
434
+ `${Number(threadType)}, so the names went out as plain text and nobody was tagged.`,
435
+ );
436
+ }
437
+
438
+ let quote;
439
+ if (quoteMsgId) {
440
+ // buildQuote needs `cliMsgId` and the `property` blob, which
441
+ // live only in the cached row's raw_data. A db that is not
442
+ // open reads as "not cached", whose message names the fix.
443
+ let row = null;
444
+ try {
445
+ row = getMessageById(quoteMsgId);
446
+ } catch (e) {
447
+ console.error("[mcp-tools] cache unavailable for quote:", e.message);
448
+ }
449
+ const built = buildQuote(row, { msgId: quoteMsgId, threadId });
450
+ // Reported through err() rather than letting zca-js raise a
451
+ // raw ZaloApiError: "stickers can't be quoted" and "not
452
+ // cached, fetch the thread" are different problems and the
453
+ // agent can act on both.
454
+ if (built.error) {
455
+ console.error("[mcp-tools] zalo_send_message quote error:", built.error);
456
+ return err(built.error);
457
+ }
458
+ if (built.warning) warnings.push(built.warning);
459
+ quote = built.quote;
460
+ // A sync-restored row's sender is a noised id that Zalo
461
+ // rejects with code 114, so resolve it rather than hand the
462
+ // caller a send that cannot land.
463
+ if (built.opaqueSender) {
464
+ const fixed = await resolveQuoteSender(quote, api);
465
+ if (fixed.error) {
466
+ console.error("[mcp-tools] zalo_send_message quote sender:", fixed.error);
467
+ return err(fixed.error);
468
+ }
469
+ if (fixed.resolved) warnings.push(`Resolved the quoted message's sender: ${fixed.resolved}`);
470
+ }
471
+ }
472
+
473
+ // 1 (important) or 2 (urgent), mapped exactly as `msg send
474
+ // --urgency` maps it; zca-js turns it into the `metaData:
475
+ // {urgency}` Zalo Web sends. "normal" is no urgency at all.
476
+ const urgency = urgencyIn ? urgencyLevel(urgencyIn) : null;
477
+
478
+ // A plain send stays a plain string: the object form is only
479
+ // built when there is something to put in it.
480
+ const hasExtras = mentions.length > 0 || Boolean(quote) || Boolean(urgency);
481
+ const content = hasExtras
482
+ ? {
483
+ msg: expanded.text,
484
+ ...(mentions.length > 0 && { mentions }),
485
+ ...(quote && { quote }),
486
+ ...(urgency && { urgency }),
487
+ }
488
+ : expanded.text;
489
+
490
+ for (const w of warnings) console.error("[mcp-tools] zalo_send_message warning:", w);
491
+
492
+ const result = await api.sendMessage(content, threadId, Number(threadType));
95
493
  const messageId = result?.message?.msgId ?? result?.msgId ?? null;
96
- return ok({ success: true, messageId });
494
+ // `msg react`, `msg undo` and a later quote all key off cliMsgId,
495
+ // and it appears in no other output. Without it an agent cannot
496
+ // act on the message it just sent -- not even by shelling out.
497
+ const cliMsgId = result?.message?.cliMsgId ?? result?.cliMsgId ?? null;
498
+ return ok({
499
+ success: true,
500
+ messageId,
501
+ ...(cliMsgId !== null && { cliMsgId: String(cliMsgId) }),
502
+ threadType,
503
+ // Only for `me`: the thread it really went to, which is
504
+ // what a later zalo_get_history names.
505
+ ...(thread.notice && { threadId, notice: thread.notice }),
506
+ // Only when it differs, so the common send keeps its shape:
507
+ // the agent wrote `@[123]` and needs to know what was sent.
508
+ ...(expanded.text !== text && { text: expanded.text }),
509
+ ...(unresolved.length > 0 && { unresolvedMentions: unresolved }),
510
+ ...(warnings.length > 0 && { warnings }),
511
+ });
97
512
  } catch (e) {
98
513
  console.error("[mcp-tools] zalo_send_message error:", e.message);
99
514
  return err(e.message);
@@ -107,18 +522,26 @@ export function registerTools(server, api, buffer, filter, config, nameCache) {
107
522
  {
108
523
  title: "List Zalo Threads",
109
524
  description:
110
- "List all Zalo threads currently buffered with unread message counts. Useful for discovering active conversations.",
525
+ "List all Zalo threads currently buffered with unread message counts. Useful for discovering active " +
526
+ "conversations. `unread` is this consumer's own count; `readState` is how far the account itself " +
527
+ "has read the conversation on Zalo (the human, on any device), null when the listener has not heard.",
111
528
  inputSchema: z.object({
112
529
  type: z
113
530
  .enum(["group", "dm", "all"])
114
531
  .default("all")
115
532
  .describe("Filter by thread type: 'dm', 'group', or 'all'"),
533
+ consumer: consumerSchema,
116
534
  }),
117
535
  },
118
- async ({ type }) => {
536
+ async ({ type, consumer }) => {
119
537
  try {
120
- const stats = buffer.getStats(0);
121
- // Enrich each stat entry with threadType and thread name
538
+ // Unread is per consumer: after what this consumer marked read.
539
+ const stats = buffer.getStats(buffer.readCursor(consumer));
540
+ const reads = readStatesOf(
541
+ api,
542
+ stats.map((t) => String(t.threadId)),
543
+ );
544
+ // Enrich each stat entry with threadType, thread name and read state
122
545
  const enriched = stats.map((t) => {
123
546
  const threadType = buffer.getThreadType(t.threadId) ?? "unknown";
124
547
  const cached = nameCache?.get(t.threadId);
@@ -127,6 +550,7 @@ export function registerTools(server, api, buffer, filter, config, nameCache) {
127
550
  threadType,
128
551
  name: cached?.name ?? null,
129
552
  ...(cached?.memberCount !== undefined && { memberCount: cached.memberCount }),
553
+ readState: describeReadState(reads.get(String(t.threadId))),
130
554
  };
131
555
  });
132
556
  const filtered = type === "all" ? enriched : enriched.filter((t) => t.threadType === type);
@@ -174,19 +598,22 @@ export function registerTools(server, api, buffer, filter, config, nameCache) {
174
598
  {
175
599
  title: "Mark Zalo Messages Read",
176
600
  description:
177
- "Discard buffered messages up to and including the given cursor. Use the cursor returned by zalo_get_messages.",
601
+ "Mark buffered messages up to and including the given cursor as read for this consumer. Use the " +
602
+ "cursor returned by zalo_get_messages. Other consumers keep their own cursor, and nothing is " +
603
+ "deleted: messages leave the buffer only by age or size.",
178
604
  inputSchema: z.object({
179
605
  cursor: z
180
606
  .number()
181
607
  .int()
182
608
  .min(0)
183
609
  .describe("Cursor value returned from a previous zalo_get_messages call"),
610
+ consumer: consumerSchema,
184
611
  }),
185
612
  },
186
- async ({ cursor }) => {
613
+ async ({ cursor, consumer }) => {
187
614
  try {
188
- const discarded = buffer.markRead(cursor);
189
- return ok({ success: true, discarded });
615
+ const marked = buffer.markRead(cursor, consumer);
616
+ return ok({ success: true, marked, readCursor: buffer.readCursor(consumer) });
190
617
  } catch (e) {
191
618
  console.error("[mcp-tools] zalo_mark_read error:", e.message);
192
619
  return err(e.message);
@@ -200,9 +627,14 @@ export function registerTools(server, api, buffer, filter, config, nameCache) {
200
627
  {
201
628
  title: "Get Zalo Message History",
202
629
  description:
203
- "Fetch historical messages from a Zalo DM or group conversation (up to ~2 weeks). " +
204
- "Unlike zalo_get_messages (which reads from the live buffer), this fetches older messages " +
205
- "from the Zalo server. Use 'lastMsgId' cursor from previous response for pagination. " +
630
+ "Fetch historical messages from a Zalo DM or group conversation. " +
631
+ "Reads the local cache first (everything the listener and `zalo-agent sync` " +
632
+ "have stored, which can be the full history), and falls back to asking the Zalo server " +
633
+ "when the cache has nothing for the thread: a group's cloud-message store first, then the " +
634
+ "socket stream, caching what comes back. Zalo serves only messages since this login that " +
635
+ "way; `filtered: true` means it withheld older ones, which only `zalo-agent sync` restores. " +
636
+ "Page the cache with 'before' (epoch ms, from the previous response's cursor) and the server " +
637
+ "path with 'lastMsgId'. " +
206
638
  "WARNING: Large limits may consume significant memory/bandwidth. Start with a small limit and paginate.",
207
639
  inputSchema: z.object({
208
640
  threadId: z.string().describe("Thread ID to fetch history from"),
@@ -211,74 +643,79 @@ export function registerTools(server, api, buffer, filter, config, nameCache) {
211
643
  .int()
212
644
  .min(0)
213
645
  .max(1)
214
- .default(THREAD_USER)
215
- .describe("Thread type: 0=DM(User), 1=Group"),
646
+ .optional()
647
+ .describe(
648
+ "Thread type: 0=DM(User), 1=Group. Omit it and the cached thread type is " +
649
+ "used, which is what the CLI does — pass a value only to override that.",
650
+ ),
216
651
  limit: z.number().int().min(1).max(200).default(50).describe("Max messages to fetch"),
217
652
  lastMsgId: z
218
653
  .string()
219
654
  .optional()
220
655
  .nullable()
221
- .describe("Cursor: last message ID from previous fetch for pagination"),
656
+ .describe("Cursor: last message ID from previous fetch, for the server-side path"),
657
+ before: z
658
+ .number()
659
+ .int()
660
+ .positive()
661
+ .optional()
662
+ .describe("Cursor: return cached messages older than this epoch-ms timestamp"),
222
663
  }),
223
664
  },
224
- async ({ threadId, threadType, limit, lastMsgId }) => {
665
+ async ({ threadId, threadType: threadTypeIn, limit, lastMsgId, before }) => {
666
+ const threadType = resolveThreadType(threadId, threadTypeIn);
225
667
  try {
226
- const allMessages = [];
227
- let cursor = lastMsgId || null;
228
- let done = false;
229
- const maxPages = Math.ceil(limit / 20);
230
- let page = 0;
231
-
232
- while (!done && allMessages.length < limit && page < maxPages) {
233
- page++;
234
- const pageMessages = await new Promise((resolve) => {
235
- const handler = (messages) => {
236
- clearTimeout(timer);
237
- api.listener.removeListener("old_messages", handler);
238
- resolve(messages);
239
- };
240
- const timer = setTimeout(() => {
241
- api.listener.removeListener("old_messages", handler);
242
- resolve([]);
243
- }, 10000);
244
-
245
- api.listener.on("old_messages", handler);
246
- api.listener.requestOldMessages(threadType, cursor);
247
- });
668
+ // The cache is the better source and usually the only one that
669
+ // answers: Zalo returns an empty set for the socket history
670
+ // request on current accounts, while the cache holds whatever
671
+ // the listener saw and whatever a transfer sync restored.
672
+ const cached = cacheHistory(threadId, limit, before, nameCache);
673
+ if (cached) return ok(cached);
248
674
 
249
- if (!pageMessages || pageMessages.length === 0) {
250
- done = true;
251
- break;
252
- }
253
-
254
- for (const msg of pageMessages) {
255
- if (allMessages.length >= limit) break;
256
- // API returns messages globally — filter to requested thread
257
- const msgThread = String(msg.threadId || "");
258
- const msgSender = String(msg.data?.uidFrom || "");
259
- const target = String(threadId);
260
- if (msgThread !== target && msgSender !== target) continue;
261
- const rawContent = msg.data?.content;
262
- const isText = typeof rawContent === "string";
263
- allMessages.push({
264
- msgId: msg.data?.msgId,
265
- threadId: msg.threadId,
266
- senderId: msg.data?.uidFrom || null,
267
- senderName: msg.data?.dName || null,
268
- text: isText ? rawContent : extractMessageText(rawContent, msg.data?.msgType),
269
- timestamp: msg.data?.ts ? Number(msg.data.ts) : null,
270
- type: isText ? "text" : msg.data?.msgType || "attachment",
271
- });
272
- }
273
-
274
- const lastMsg = pageMessages[pageMessages.length - 1];
275
- const nextId = lastMsg?.data?.actionId || lastMsg?.data?.msgId;
276
- if (!nextId || nextId === cursor) done = true;
277
- cursor = nextId;
675
+ // Nothing cached: ask Zalo through the one shared fetch `listen`'s
676
+ // daemon uses for `msg history` (src/core/history-fetch.js): a
677
+ // group's cloud-message store first, then the socket stream, and
678
+ // what comes back is cached insert-if-absent — this server is the
679
+ // account's db writer. It used to be a hand-rolled socket loop that
680
+ // never asked a group's store and cached nothing (triage M6).
681
+ // One stage at a time on this socket: a sync stage beside a scan
682
+ // lost the socket once, and an AI client should hear "busy" now
683
+ // rather than wait minutes behind a restore.
684
+ const release = stageLock ? stageLock.tryAcquire("history") : () => {};
685
+ if (!release) {
686
+ const busy = stageLock.current();
687
+ return err(
688
+ `A ${busy?.stage || "sync"} stage is running on this socket. Try again when it finishes.`,
689
+ );
690
+ }
691
+ let fetched;
692
+ try {
693
+ fetched = await fetchAndCacheHistory(api, threadId, threadType, {
694
+ limit,
695
+ fromMsgId: lastMsgId || null,
696
+ });
697
+ } finally {
698
+ release();
278
699
  }
279
700
 
280
- // Sort oldest first
701
+ const allMessages = fetched.frames.map((f) => {
702
+ const d = f.data || {};
703
+ const rawContent = d.content;
704
+ const isText = typeof rawContent === "string";
705
+ return {
706
+ msgId: d.msgId,
707
+ threadId: f.threadId,
708
+ senderId: d.uidFrom || null,
709
+ senderName: d.dName || null,
710
+ text: isText ? rawContent : extractMessageText(rawContent, d.msgType),
711
+ timestamp: d.ts ? Number(d.ts) : null,
712
+ type: isText ? "text" : d.msgType || "attachment",
713
+ };
714
+ });
715
+
716
+ // Sort oldest first; the oldest message is where the next page starts.
281
717
  allMessages.sort((a, b) => (a.timestamp || 0) - (b.timestamp || 0));
718
+ const cursor = allMessages.length ? String(allMessages[0].msgId) : lastMsgId || null;
282
719
 
283
720
  // Enrich with thread name
284
721
  if (nameCache) {
@@ -291,10 +728,22 @@ export function registerTools(server, api, buffer, filter, config, nameCache) {
291
728
  return ok({
292
729
  threadId,
293
730
  threadType: threadType === 0 ? "dm" : "group",
731
+ source: "server",
732
+ // Which Zalo path answered: a group's cloud-message store, or the socket stream.
733
+ via: fetched.source,
294
734
  count: allMessages.length,
295
735
  messages: allMessages,
296
- cursor: cursor,
297
- hasMore: !done,
736
+ cursor,
737
+ hasMore: Boolean(fetched.more) || (fetched.source === "socket" && allMessages.length >= limit),
738
+ filtered: fetched.filtered === true,
739
+ ...(fetched.filtered || allMessages.length === 0
740
+ ? {
741
+ note:
742
+ "Zalo serves a conversation's messages only since this login; older ones are " +
743
+ "withheld. `zalo-agent sync` restores them from the owner's phone (it asks for a " +
744
+ "tap), and zalo_get_history then reads them from the cache.",
745
+ }
746
+ : {}),
298
747
  });
299
748
  } catch (e) {
300
749
  console.error("[mcp-tools] zalo_get_history error:", e.message);
@@ -324,30 +773,321 @@ export function registerTools(server, api, buffer, filter, config, nameCache) {
324
773
  },
325
774
  async ({ messageId, threadId, open }) => {
326
775
  try {
327
- const allMessages = buffer.read(threadId, 0, 9999).messages;
328
- const message = allMessages.find((m) => m.id === messageId);
329
- if (!message) return err(`Message ${messageId} not found in buffer`);
330
- if (!message.attachment?.url) return err(`Message ${messageId} has no media attachment`);
776
+ // The cached row is authoritative: it records where a fetched
777
+ // file actually landed, so a message that arrived before this
778
+ // process started is still openable. The buffer is only a
779
+ // fallback for a thread id.
780
+ let row = null;
781
+ try {
782
+ row = getMessageById(messageId);
783
+ } catch (e) {
784
+ console.error("[mcp-tools] cache unavailable:", e.message);
785
+ }
786
+ const buffered = buffer.read(threadId, 0, 9999).messages.find((m) => m.id === messageId) || null;
787
+ if (!row && !buffered) return err(`Message ${messageId} not found in cache or buffer`);
788
+ if (row && !row.has_attachment && !buffered?.attachment?.url) {
789
+ return err(`Message ${messageId} has no media attachment`);
790
+ }
331
791
 
332
- // Use local file if already auto-downloaded, otherwise download now
333
- let localPath = message.attachment.localPath;
792
+ let localPath = row?.localPath || null;
334
793
  if (!localPath) {
335
- const threadName = nameCache?.get(message.threadId)?.name || null;
336
- const result = await downloadMedia(message, {
337
- downloadDir: mediaConfig.downloadDir || undefined,
338
- autoOpen: false,
339
- threadName,
794
+ // Same downloader as the CLI, so the file lands in the one
795
+ // per-conversation folder every other command reads from.
796
+ const stats = await downloadSyncedMedia({
797
+ api,
798
+ accountDir,
799
+ threadId: String(row?.threadId || buffered?.threadId || threadId || ""),
800
+ limit: 50,
801
+ concurrency: 2,
802
+ mediaRoot: mediaConfig.downloadDir || undefined,
340
803
  });
341
- localPath = result.path;
804
+ localPath = getMessageById(messageId)?.localPath || null;
805
+ if (!localPath) {
806
+ return err(
807
+ `Could not fetch media for ${messageId} (${stats.expired} expired, ` +
808
+ `${stats.throttled} rate limited, ${stats.unknown} unexplained, ` +
809
+ `${stats.failed} failed). Rate limiting clears on a retry; an unexplained ` +
810
+ `failure is usually a 403, which Zalo returns for a lapsed signature and ` +
811
+ `under load alike. Try zalo-agent sync-media, then zalo-agent sync.`,
812
+ );
813
+ }
342
814
  }
343
815
 
344
816
  if (open) openFile(localPath);
345
817
 
346
- return ok({ success: true, path: localPath, mediaType: message.type });
818
+ return ok({ success: true, path: localPath, mediaType: row?.type || buffered?.type || null });
347
819
  } catch (e) {
348
820
  console.error("[mcp-tools] zalo_view_media error:", e.message);
349
821
  return err(e.message);
350
822
  }
351
823
  },
352
824
  );
825
+
826
+ // The threadType parameter of the message actions, worded as the send's is.
827
+ const threadTypeSchema = z
828
+ .number()
829
+ .int()
830
+ .min(0)
831
+ .max(1)
832
+ .optional()
833
+ .describe(
834
+ "Thread type: 0=DM(User), 1=Group. Omit it and the cached thread type is " +
835
+ "used, which is what the CLI does — pass a value only to override that.",
836
+ );
837
+ const cliMsgIdSchema = z
838
+ .string()
839
+ .min(1)
840
+ .optional()
841
+ .describe(
842
+ "The message's cliMsgId. zalo_send_message returns it for a message you sent; omit it and it is " +
843
+ "read from the local cache",
844
+ );
845
+
846
+ // --- zalo_react ---
847
+ server.registerTool(
848
+ "zalo_react",
849
+ {
850
+ title: "React to a Zalo Message",
851
+ description:
852
+ "Add a reaction to a message, as `msg react` does. `reaction` is a Zalo reaction code: " +
853
+ "`/-strong` (like), `/-heart` (heart), `:>` (haha), `:o` (wow), `:-((` (cry), `:-h` (angry), " +
854
+ "`:-*` (kiss), `:')` (tears of joy), `/-weak` (dislike). Zalo keys a reaction on the message's " +
855
+ "cliMsgId as well as its msgId, so the cliMsgId comes from `cliMsgId` or the local cache; when " +
856
+ "neither has it the reaction is refused and nothing is sent — Zalo accepts a reaction keyed on the " +
857
+ "msgId alone and never shows it. `threadId` may be `me` for My Documents.",
858
+ inputSchema: z.object({
859
+ msgId: z
860
+ .string()
861
+ .min(1)
862
+ .describe("msgId of the message to react to (from zalo_get_messages or zalo_get_history)"),
863
+ threadId: z.string().min(1).describe("The conversation the message is in. `me` is My Documents"),
864
+ reaction: z.string().min(1).describe("Reaction code, e.g. `/-strong`, `/-heart`, `:>`"),
865
+ threadType: threadTypeSchema,
866
+ cliMsgId: cliMsgIdSchema,
867
+ }),
868
+ },
869
+ async ({ msgId, threadId: threadIdIn, reaction, threadType: threadTypeIn, cliMsgId }) => {
870
+ const thread = actionThread(api, threadIdIn, threadTypeIn);
871
+ if (thread.error) {
872
+ console.error("[mcp-tools] zalo_react refused:", thread.error);
873
+ return err(thread.error);
874
+ }
875
+ const { threadId, threadType } = thread;
876
+ try {
877
+ // `msg react`'s own resolution (src/core/cached-message.js),
878
+ // and like it, settled before the api is touched: a message
879
+ // with no known cliMsgId is refused without a request.
880
+ const target = reactionCliMsgId({ msgId, threadId, cliMsgId }, { passItAs: CLI_MSG_ID_HINT });
881
+ if (target.error) {
882
+ console.error("[mcp-tools] zalo_react refused:", target.error);
883
+ return err(target.error);
884
+ }
885
+ const dest = { data: { msgId, cliMsgId: target.cliMsgId }, threadId, type: Number(threadType) };
886
+ await api.addReaction(reaction, dest);
887
+ return ok({
888
+ success: true,
889
+ reaction,
890
+ msgId,
891
+ cliMsgId: target.cliMsgId,
892
+ threadId,
893
+ threadType,
894
+ ...(thread.notice && { notice: thread.notice }),
895
+ });
896
+ } catch (e) {
897
+ console.error("[mcp-tools] zalo_react error:", e.message);
898
+ return err(e.message);
899
+ }
900
+ },
901
+ );
902
+
903
+ // --- zalo_undo ---
904
+ server.registerTool(
905
+ "zalo_undo",
906
+ {
907
+ title: "Recall a Zalo Message",
908
+ description:
909
+ "Recall one of your own messages for everyone in the conversation, as `msg undo` does (the apps' " +
910
+ "Thu hồi). Zalo names the message by msgId and cliMsgId, so the cliMsgId comes from `cliMsgId` or " +
911
+ "the local cache; when neither has it nothing is sent. Zalo accepts a recall only for a while after " +
912
+ "the message was sent. `threadId` may be `me` for My Documents.",
913
+ inputSchema: z.object({
914
+ msgId: z.string().min(1).describe("msgId of your message to recall"),
915
+ threadId: z.string().min(1).describe("The conversation the message is in. `me` is My Documents"),
916
+ threadType: threadTypeSchema,
917
+ cliMsgId: cliMsgIdSchema,
918
+ }),
919
+ },
920
+ async ({ msgId, threadId: threadIdIn, threadType: threadTypeIn, cliMsgId }) => {
921
+ const thread = actionThread(api, threadIdIn, threadTypeIn);
922
+ if (thread.error) {
923
+ console.error("[mcp-tools] zalo_undo refused:", thread.error);
924
+ return err(thread.error);
925
+ }
926
+ const { threadId, threadType } = thread;
927
+ try {
928
+ // `msg undo`'s own resolution: the caller's id, else the cache's.
929
+ const target = recallCliMsgId({ msgId, threadId, cliMsgId }, { passItAs: CLI_MSG_ID_HINT });
930
+ if (target.error) {
931
+ console.error("[mcp-tools] zalo_undo refused:", target.error);
932
+ return err(target.error);
933
+ }
934
+ await api.undo({ msgId, cliMsgId: target.cliMsgId }, threadId, Number(threadType));
935
+ return ok({
936
+ success: true,
937
+ msgId,
938
+ cliMsgId: target.cliMsgId,
939
+ threadId,
940
+ threadType,
941
+ ...(thread.notice && { notice: thread.notice }),
942
+ });
943
+ } catch (e) {
944
+ console.error("[mcp-tools] zalo_undo error:", e.message);
945
+ return err(e.message);
946
+ }
947
+ },
948
+ );
949
+
950
+ // --- zalo_get_group_members ---
951
+ server.registerTool(
952
+ "zalo_get_group_members",
953
+ {
954
+ title: "List Zalo Group Members",
955
+ description:
956
+ "List a group's members, as `group members` does: each member's uid, with a display name — from " +
957
+ "the local cache, or from Zalo for members the cache cannot name. `totalMember` is Zalo's own " +
958
+ "count. A member's uid can be @-mentioned in zalo_send_message as `@[uid]`.",
959
+ inputSchema: z.object({
960
+ groupId: z
961
+ .string()
962
+ .min(1)
963
+ .describe("The group's thread id (from zalo_search_threads or zalo_list_conversations)"),
964
+ }),
965
+ },
966
+ async ({ groupId }) => {
967
+ try {
968
+ const group = await groupMemberUids(api, groupId);
969
+ if (!group.found) {
970
+ return err(
971
+ `Zalo's answer does not include group ${groupId}: this account is not in it, or it is not ` +
972
+ "a group id (a 1-1 conversation's id is the other person's uid).",
973
+ );
974
+ }
975
+
976
+ // The cache first, as a mention is named; one batched lookup
977
+ // (the one `msg send` uses) for the members it cannot name.
978
+ // Nothing is written back: zalo.db has three writers.
979
+ const names = new Map();
980
+ const unnamed = [];
981
+ for (const uid of group.uids) {
982
+ const name = cachedDisplayName(uid);
983
+ if (name) names.set(uid, name);
984
+ else unnamed.push(uid);
985
+ }
986
+ const warnings = [];
987
+ if (unnamed.length > 0) {
988
+ const fetched = await fetchMemberNames(api, unnamed, { batchSize: MEMBER_NAME_BATCH });
989
+ for (const [uid, name] of fetched.names) names.set(uid, name);
990
+ const still = unnamed.filter((uid) => !names.has(uid)).length;
991
+ if (fetched.errors.length > 0 && still > 0) {
992
+ warnings.push(`Zalo did not name ${still} member(s): ${fetched.errors[0]}`);
993
+ }
994
+ }
995
+ for (const w of warnings) console.error("[mcp-tools] zalo_get_group_members warning:", w);
996
+
997
+ const members = group.uids.map((uid) => ({ uid, displayName: names.get(uid) ?? null }));
998
+ return ok({
999
+ groupId,
1000
+ name: group.name,
1001
+ totalMember: group.totalMember,
1002
+ count: members.length,
1003
+ members,
1004
+ ...(warnings.length > 0 && { warnings }),
1005
+ });
1006
+ } catch (e) {
1007
+ console.error("[mcp-tools] zalo_get_group_members error:", e.message);
1008
+ return err(e.message);
1009
+ }
1010
+ },
1011
+ );
1012
+
1013
+ // --- zalo_list_conversations ---
1014
+ server.registerTool(
1015
+ "zalo_list_conversations",
1016
+ {
1017
+ title: "List Recent Zalo Conversations",
1018
+ description:
1019
+ "List the conversations this account was most recently active in, newest first, from the local " +
1020
+ "cache — what `conv recent` lists: thread id, type, name and last activity. Unlike " +
1021
+ "zalo_list_threads it is not limited to what arrived since this server started. `limit` is per " +
1022
+ "type, as `conv recent -n` is: with type 'all' that is up to `limit` DMs and `limit` groups. " +
1023
+ "`readState` is how far the account itself has read each conversation on Zalo (the human, on any " +
1024
+ "device): the newest message read, how many cached messages from others came after it, and whether " +
1025
+ "it is marked unread; null when the listener has not heard.",
1026
+ inputSchema: z.object({
1027
+ type: z
1028
+ .enum(["group", "dm", "all"])
1029
+ .default("all")
1030
+ .describe("Filter by thread type: 'dm', 'group', or 'all'"),
1031
+ limit: z.number().int().min(1).max(200).default(20).describe("Max conversations of each type"),
1032
+ }),
1033
+ },
1034
+ async ({ type, limit }) => {
1035
+ try {
1036
+ const threads = recentConversations(limit, type);
1037
+ const reads = readStatesOf(
1038
+ api,
1039
+ threads.map((t) => String(t.threadId)),
1040
+ );
1041
+ const conversations = threads.map((t) => {
1042
+ const isGroup = t.type === "group";
1043
+ const ts = Number(t.lastUpdate) || null;
1044
+ return {
1045
+ threadId: String(t.threadId),
1046
+ type: isGroup ? "group" : "dm",
1047
+ threadType: isGroup ? THREAD_GROUP : THREAD_USER,
1048
+ name: t.name || nameCache?.get(String(t.threadId))?.name || null,
1049
+ lastActivity: ts,
1050
+ lastActivityAt: ts ? new Date(ts).toISOString() : null,
1051
+ readState: describeReadState(reads.get(String(t.threadId))),
1052
+ };
1053
+ });
1054
+ return ok({
1055
+ conversations,
1056
+ total: conversations.length,
1057
+ source: "cache",
1058
+ ...(conversations.length === 0 && {
1059
+ note:
1060
+ "The local cache holds no conversations yet. This server records them as messages " +
1061
+ "arrive, and `zalo-agent sync` restores older ones from the owner's phone.",
1062
+ }),
1063
+ });
1064
+ } catch (e) {
1065
+ console.error("[mcp-tools] zalo_list_conversations error:", e.message);
1066
+ return err(e.message);
1067
+ }
1068
+ },
1069
+ );
1070
+
1071
+ // --- zalo_coverage ---
1072
+ server.registerTool(
1073
+ "zalo_coverage",
1074
+ {
1075
+ title: "Zalo Cache Coverage",
1076
+ description:
1077
+ "How complete the local message cache is. Lists the coverage gaps still pending — windows in which " +
1078
+ "this account's connection to Zalo was down, so messages from them may be missing — with each " +
1079
+ "gap's from/to and reason, counts the gaps already resolved, and names the `zalo-agent sync --from " +
1080
+ "<date>` run that restores the pending ones from the owner's phone (it needs a tap on the phone, " +
1081
+ "so a person runs it). Read-only: nothing is sent to Zalo.",
1082
+ inputSchema: z.object({}),
1083
+ },
1084
+ async () => {
1085
+ try {
1086
+ return ok(coverageReport());
1087
+ } catch (e) {
1088
+ console.error("[mcp-tools] zalo_coverage error:", e.message);
1089
+ return err(e.message);
1090
+ }
1091
+ },
1092
+ );
353
1093
  }