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