@openclaw/whatsapp 2026.7.2-beta.7 → 2026.7.33
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/README.md +1 -1
- package/dist/{access-control-pZcxTmd5.js → .setup/access-control-C0jumQuO.mjs} +5 -4
- package/dist/.setup/account-config-6PTOSfaI.mjs +47 -0
- package/dist/{accounts-CSqLvCY5.js → .setup/accounts-Dw16pdNl.mjs} +9 -47
- package/dist/{action-runtime-BzfDFPbH.js → .setup/action-runtime-DLK_9v4r.mjs} +3 -3
- package/dist/{active-listener-BEjWsCNM.js → .setup/active-listener-CloPBx0S.mjs} +3 -3
- package/dist/{agent-tools-login-DE9MU98T.js → .setup/agent-tools-login-DINqgaYo.mjs} +19 -7
- package/dist/{approval-handler.runtime-DrA59QSA.js → .setup/approval-handler.runtime-DtJZbu3y.mjs} +14 -20
- package/dist/{approval-resolver-DoeBBt22.js → .setup/approval-resolver-DF-lu8k5.mjs} +1 -2
- package/dist/{auth-store-DcEpIOmE.js → .setup/auth-store-BZKGa0tW.mjs} +25 -29
- package/dist/{channel-Dg62olhy.js → .setup/channel-9WGjBznd.mjs} +117 -132
- package/dist/{channel-react-action-J_YtyMGX.js → .setup/channel-react-action-mvIbAFhn.mjs} +15 -12
- package/dist/{channel.runtime-BP0xNmLi.js → .setup/channel.runtime-DmmMgRJQ.mjs} +6 -6
- package/dist/.setup/channel.setup-ByBYSeLd.mjs +22 -0
- package/dist/.setup/config-schema-mBX2nmn1.mjs +47 -0
- package/dist/{connection-controller-BOB2MVKY.js → .setup/connection-controller-Dt62u6fI.mjs} +29 -226
- package/dist/.setup/connection-controller-registry-TSX_udJp.mjs +22 -0
- package/dist/{constants-HU41RHGI.js → .setup/constants-C7m81BNe.mjs} +1 -1
- package/dist/.setup/directory-config-B7Obxrq2.mjs +37 -0
- package/dist/.setup/doctor-By3SB4lm.mjs +48 -0
- package/dist/{group-session-key-DVMZlO3x.js → .setup/group-session-key-CEwPRRRK.mjs} +5 -38
- package/dist/{identity-CPrT5aEU.js → .setup/identity-CDB1bT-p.mjs} +2 -2
- package/dist/.setup/legacy-session-surface-api-B2szjq4r.mjs +2 -0
- package/dist/.setup/legacy-state-migrations-api-DXCxufZz.mjs +3 -0
- package/dist/{login-CvY2Dhch.js → .setup/login-7b3M0iBp.mjs} +12 -51
- package/dist/{login-qr-Bncpb6js.js → .setup/login-qr-CbyA4QX5.mjs} +47 -23
- package/dist/{monitor-CfkaUSL2.js → .setup/monitor-Dh6Di_YO.mjs} +1451 -1843
- package/dist/.setup/normalize-eddWWsNV.mjs +2 -0
- package/dist/{normalize-target-CugRyONv.js → .setup/normalize-target-bVWjgftN.mjs} +10 -18
- package/dist/{resolve-outbound-target-1GqbT1uX.js → .setup/resolve-outbound-target-oI7VpU4w.mjs} +1 -1
- package/dist/.setup/runtime-BfAdAEYT.mjs +8 -0
- package/dist/.setup/send-BQjMC41n.mjs +777 -0
- package/dist/{send-api-7wk6eQyW.js → .setup/send-api-BiAkPLr3.mjs} +155 -105
- package/dist/{session-errors-JuazczrA.js → .setup/session-errors-BAj9D2La.mjs} +1 -2
- package/dist/.setup/session-vUI41Jel.mjs +252 -0
- package/dist/.setup/session.runtime-B-V3rXP6.mjs +12 -0
- package/dist/{shared-CAxd15bp.js → .setup/setup-core--FfzntMG.mjs} +94 -63
- package/dist/{setup-finalize-BZucx24W.js → .setup/setup-finalize-DCruIciL.mjs} +17 -46
- package/dist/.setup/setup-plugin-api-B6ck_20D.mjs +3 -0
- package/dist/{setup-surface-BkVcd769.js → .setup/setup-surface-Zvj2cLzz.mjs} +4 -4
- package/dist/.setup/socket-timing-DhbVFjah.mjs +77 -0
- package/dist/{state-migrations-CAMTrs2U.js → .setup/state-migrations-D_BmQUR9.mjs} +8 -1
- package/dist/.setup/targets-runtime-C-GiVn6Y.mjs +188 -0
- package/dist/.setup/text-runtime-CUrq1mFq.mjs +4 -0
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/{call-tool-api.js → agent-tools-api.js} +26 -11
- package/dist/api.js +27 -17
- package/dist/auth-presence.js +1 -1
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/constants.js +2 -0
- package/dist/contract-api.js +5 -5
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +5 -46
- package/dist/index.js +4 -4
- package/dist/legacy-session-surface-api.js +1 -1
- package/dist/legacy-state-migrations-api.js +1 -1
- package/dist/light-runtime-api.js +4 -4
- package/dist/login-qr-runtime.js +1 -1
- package/dist/runtime-api.js +14 -14
- package/dist/runtime-setter-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/setup-entry.js +4 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/targets.js +2 -0
- package/node_modules/audio-decode/node_modules/@thi.ng/bitstream/package.json +4 -4
- package/node_modules/audio-decode/node_modules/@thi.ng/errors/package.json +4 -4
- package/node_modules/audio-decode/node_modules/audio-type/package.json +2 -3
- package/node_modules/baileys/node_modules/@protobufjs/aspromise/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/aspromise/README.md +13 -0
- package/node_modules/baileys/node_modules/{protobufjs/src/util/aspromise.d.ts → @protobufjs/aspromise/index.d.ts} +13 -13
- package/node_modules/baileys/node_modules/{protobufjs/src/util/aspromise.js → @protobufjs/aspromise/index.js} +52 -52
- package/node_modules/baileys/node_modules/@protobufjs/aspromise/package.json +21 -0
- package/node_modules/baileys/node_modules/@protobufjs/aspromise/tests/index.js +130 -0
- package/node_modules/baileys/node_modules/@protobufjs/base64/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/base64/README.md +19 -0
- package/node_modules/baileys/node_modules/{protobufjs/src/util/base64.d.ts → @protobufjs/base64/index.d.ts} +32 -32
- package/node_modules/baileys/node_modules/{protobufjs/src/util/base64.js → @protobufjs/base64/index.js} +139 -146
- package/node_modules/baileys/node_modules/@protobufjs/base64/package.json +21 -0
- package/node_modules/baileys/node_modules/@protobufjs/base64/tests/index.js +46 -0
- package/node_modules/baileys/node_modules/@protobufjs/codegen/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/codegen/README.md +49 -0
- package/node_modules/baileys/node_modules/{protobufjs/src/util/codegen.d.ts → @protobufjs/codegen/index.d.ts} +31 -31
- package/node_modules/baileys/node_modules/{protobufjs/src/util/codegen.js → @protobufjs/codegen/index.js} +112 -118
- package/node_modules/baileys/node_modules/@protobufjs/codegen/package.json +13 -0
- package/node_modules/baileys/node_modules/@protobufjs/codegen/tests/index.js +13 -0
- package/node_modules/baileys/node_modules/@protobufjs/eventemitter/CHANGELOG.md +8 -0
- package/node_modules/baileys/node_modules/@protobufjs/eventemitter/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/eventemitter/README.md +22 -0
- package/node_modules/baileys/node_modules/{protobufjs/src/util/eventemitter.d.ts → @protobufjs/eventemitter/index.d.ts} +45 -45
- package/node_modules/baileys/node_modules/{protobufjs/src/util/eventemitter.js → @protobufjs/eventemitter/index.js} +86 -86
- package/node_modules/baileys/node_modules/@protobufjs/eventemitter/package.json +21 -0
- package/node_modules/baileys/node_modules/@protobufjs/eventemitter/tests/index.js +83 -0
- package/node_modules/baileys/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/baileys/node_modules/@protobufjs/fetch/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/fetch/README.md +13 -0
- package/node_modules/baileys/node_modules/{protobufjs/src/util/fetch.d.ts → @protobufjs/fetch/index.d.ts} +56 -56
- package/node_modules/baileys/node_modules/{protobufjs/src/util/fetch.js → @protobufjs/fetch/index.js} +112 -112
- package/node_modules/baileys/node_modules/@protobufjs/fetch/package.json +27 -0
- package/node_modules/baileys/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/baileys/node_modules/@protobufjs/fetch/tests/index.js +158 -0
- package/node_modules/baileys/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/baileys/node_modules/@protobufjs/float/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/float/README.md +102 -0
- package/node_modules/baileys/node_modules/@protobufjs/float/bench/index.js +87 -0
- package/node_modules/baileys/node_modules/@protobufjs/float/bench/suite.js +46 -0
- package/node_modules/baileys/node_modules/{protobufjs/src/util/float.js → @protobufjs/float/index.js} +335 -335
- package/node_modules/baileys/node_modules/@protobufjs/float/package.json +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/float/tests/index.js +100 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/README.md +13 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/index.d.ts +10 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/index.js +38 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/package.json +21 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/tests/data/array.js +1 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +1 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +1 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/tests/data/object.js +1 -0
- package/node_modules/baileys/node_modules/@protobufjs/inquire/tests/index.js +20 -0
- package/node_modules/baileys/node_modules/@protobufjs/path/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/path/README.md +19 -0
- package/node_modules/baileys/node_modules/{protobufjs/src/util/path.d.ts → @protobufjs/path/index.d.ts} +22 -22
- package/node_modules/baileys/node_modules/{protobufjs/src/util/path.js → @protobufjs/path/index.js} +65 -100
- package/node_modules/baileys/node_modules/@protobufjs/path/package.json +21 -0
- package/node_modules/baileys/node_modules/@protobufjs/path/tests/index.js +60 -0
- package/node_modules/baileys/node_modules/@protobufjs/pool/.npmignore +3 -0
- package/node_modules/baileys/node_modules/@protobufjs/pool/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/pool/README.md +13 -0
- package/node_modules/baileys/node_modules/{protobufjs/src/util/pool.d.ts → @protobufjs/pool/index.d.ts} +32 -32
- package/node_modules/baileys/node_modules/{protobufjs/src/util/pool.js → @protobufjs/pool/index.js} +48 -48
- package/node_modules/baileys/node_modules/@protobufjs/pool/package.json +21 -0
- package/node_modules/baileys/node_modules/@protobufjs/pool/tests/index.js +33 -0
- package/node_modules/baileys/node_modules/@protobufjs/utf8/LICENSE +26 -0
- package/node_modules/baileys/node_modules/@protobufjs/utf8/README.md +20 -0
- package/node_modules/baileys/node_modules/{protobufjs/src/util/utf8.d.ts → @protobufjs/utf8/index.d.ts} +24 -24
- package/node_modules/baileys/node_modules/{protobufjs/src/util/utf8.js → @protobufjs/utf8/index.js} +104 -190
- package/node_modules/baileys/node_modules/@protobufjs/utf8/package.json +21 -0
- package/node_modules/baileys/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt +207 -0
- package/node_modules/baileys/node_modules/@protobufjs/utf8/tests/data/utf8.txt +216 -0
- package/node_modules/baileys/node_modules/@protobufjs/utf8/tests/index.js +74 -0
- package/node_modules/baileys/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/baileys/node_modules/@types/node/README.md +15 -0
- package/node_modules/baileys/node_modules/@types/node/assert/strict.d.ts +68 -0
- package/node_modules/baileys/node_modules/@types/node/assert.d.ts +1077 -0
- package/node_modules/baileys/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/node_modules/baileys/node_modules/@types/node/buffer.buffer.d.ts +466 -0
- package/node_modules/baileys/node_modules/@types/node/buffer.d.ts +1799 -0
- package/node_modules/baileys/node_modules/@types/node/child_process.d.ts +1362 -0
- package/node_modules/baileys/node_modules/@types/node/cluster.d.ts +432 -0
- package/node_modules/baileys/node_modules/@types/node/console.d.ts +93 -0
- package/node_modules/baileys/node_modules/@types/node/constants.d.ts +14 -0
- package/node_modules/baileys/node_modules/@types/node/crypto.d.ts +3954 -0
- package/node_modules/baileys/node_modules/@types/node/dgram.d.ts +537 -0
- package/node_modules/baileys/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
- package/node_modules/baileys/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/node_modules/baileys/node_modules/@types/node/dns.d.ts +876 -0
- package/node_modules/baileys/node_modules/@types/node/domain.d.ts +150 -0
- package/node_modules/baileys/node_modules/@types/node/events.d.ts +1008 -0
- package/node_modules/baileys/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/baileys/node_modules/@types/node/fs/promises.d.ts +1471 -0
- package/node_modules/baileys/node_modules/@types/node/fs.d.ts +4786 -0
- package/node_modules/baileys/node_modules/@types/node/globals.d.ts +150 -0
- package/node_modules/baileys/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/node_modules/baileys/node_modules/@types/node/http.d.ts +2172 -0
- package/node_modules/baileys/node_modules/@types/node/http2.d.ts +2489 -0
- package/node_modules/baileys/node_modules/@types/node/https.d.ts +400 -0
- package/node_modules/baileys/node_modules/@types/node/index.d.ts +115 -0
- package/node_modules/baileys/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/baileys/node_modules/@types/node/inspector.d.ts +264 -0
- package/node_modules/baileys/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/node_modules/baileys/node_modules/@types/node/module.d.ts +726 -0
- package/node_modules/baileys/node_modules/@types/node/net.d.ts +970 -0
- package/node_modules/baileys/node_modules/@types/node/os.d.ts +498 -0
- package/node_modules/baileys/node_modules/@types/node/package.json +155 -0
- package/node_modules/baileys/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/baileys/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/baileys/node_modules/@types/node/path.d.ts +178 -0
- package/node_modules/baileys/node_modules/@types/node/perf_hooks.d.ts +604 -0
- package/node_modules/baileys/node_modules/@types/node/process.d.ts +2217 -0
- package/node_modules/baileys/node_modules/@types/node/punycode.d.ts +89 -0
- package/node_modules/baileys/node_modules/@types/node/querystring.d.ts +139 -0
- package/node_modules/baileys/node_modules/@types/node/quic.d.ts +978 -0
- package/node_modules/baileys/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/node_modules/baileys/node_modules/@types/node/readline.d.ts +508 -0
- package/node_modules/baileys/node_modules/@types/node/repl.d.ts +420 -0
- package/node_modules/baileys/node_modules/@types/node/sea.d.ts +47 -0
- package/node_modules/baileys/node_modules/@types/node/sqlite.d.ts +1123 -0
- package/node_modules/baileys/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/node_modules/baileys/node_modules/@types/node/stream/iter.d.ts +451 -0
- package/node_modules/baileys/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/node_modules/baileys/node_modules/@types/node/stream/web.d.ts +300 -0
- package/node_modules/baileys/node_modules/@types/node/stream.d.ts +1806 -0
- package/node_modules/baileys/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/node_modules/baileys/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/baileys/node_modules/@types/node/test.d.ts +2389 -0
- package/node_modules/baileys/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/node_modules/baileys/node_modules/@types/node/timers.d.ts +149 -0
- package/node_modules/baileys/node_modules/@types/node/tls.d.ts +1193 -0
- package/node_modules/baileys/node_modules/@types/node/trace_events.d.ts +103 -0
- package/node_modules/baileys/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
- package/node_modules/baileys/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/baileys/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/baileys/node_modules/@types/node/ts5.6/index.d.ts +117 -0
- package/node_modules/baileys/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/baileys/node_modules/@types/node/ts5.7/index.d.ts +117 -0
- package/node_modules/baileys/node_modules/@types/node/tty.d.ts +225 -0
- package/node_modules/baileys/node_modules/@types/node/url.d.ts +556 -0
- package/node_modules/baileys/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/baileys/node_modules/@types/node/util.d.ts +1677 -0
- package/node_modules/baileys/node_modules/@types/node/v8.d.ts +1062 -0
- package/node_modules/baileys/node_modules/@types/node/vm.d.ts +1136 -0
- package/node_modules/baileys/node_modules/@types/node/wasi.d.ts +131 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/streams.d.ts +115 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/baileys/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/baileys/node_modules/@types/node/worker_threads.d.ts +669 -0
- package/node_modules/baileys/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/baileys/node_modules/@types/node/zlib.d.ts +589 -0
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/browser/index.js +4 -11
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/browser/index.min.js +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +3 -3
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/index.js +4 -11
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/index.min.js.map +3 -3
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/node/index.js +4 -11
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/node/index.min.js +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +3 -3
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/browser/index.js +4 -11
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/browser/index.min.js.map +3 -3
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/index.js +4 -11
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/index.min.js.map +3 -3
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/node/index.js +4 -11
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/baileys/node_modules/lru-cache/dist/esm/node/index.min.js.map +3 -3
- package/node_modules/baileys/node_modules/lru-cache/package.json +1 -1
- package/node_modules/baileys/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
- package/node_modules/baileys/node_modules/music-metadata/lib/common/Util.js +1 -7
- package/node_modules/baileys/node_modules/music-metadata/lib/id3v2/FrameHeader.js +3 -23
- package/node_modules/baileys/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
- package/node_modules/baileys/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
- package/node_modules/baileys/node_modules/music-metadata/lib/mp4/AtomToken.js +13 -38
- package/node_modules/baileys/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
- package/node_modules/baileys/node_modules/music-metadata/package.json +6 -6
- package/node_modules/baileys/node_modules/p-queue/dist/index.js +27 -37
- package/node_modules/baileys/node_modules/p-queue/package.json +1 -1
- package/node_modules/baileys/node_modules/protobufjs/README.md +553 -266
- package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.js +1985 -3177
- package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.js +1244 -1966
- package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.js +2005 -3330
- package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/baileys/node_modules/protobufjs/ext/descriptor/README.md +70 -3
- package/node_modules/baileys/node_modules/protobufjs/ext/descriptor/index.d.ts +193 -0
- package/node_modules/baileys/node_modules/protobufjs/ext/descriptor/index.js +1185 -1
- package/node_modules/baileys/node_modules/protobufjs/ext/descriptor/test.js +54 -0
- package/node_modules/baileys/node_modules/protobufjs/google/api/annotations.json +1 -3
- package/node_modules/baileys/node_modules/protobufjs/google/api/http.json +1 -2
- package/node_modules/baileys/node_modules/protobufjs/google/protobuf/api.json +6 -12
- package/node_modules/baileys/node_modules/protobufjs/google/protobuf/descriptor.json +87 -170
- package/node_modules/baileys/node_modules/protobufjs/google/protobuf/descriptor.proto +8 -0
- package/node_modules/baileys/node_modules/protobufjs/google/protobuf/source_context.json +1 -2
- package/node_modules/baileys/node_modules/protobufjs/google/protobuf/type.json +7 -14
- package/node_modules/baileys/node_modules/protobufjs/index.d.ts +703 -1066
- package/node_modules/baileys/node_modules/protobufjs/package.json +52 -25
- package/node_modules/baileys/node_modules/protobufjs/scripts/postinstall.js +32 -0
- package/node_modules/baileys/node_modules/protobufjs/src/common.js +8 -14
- package/node_modules/baileys/node_modules/protobufjs/src/converter.js +51 -85
- package/node_modules/baileys/node_modules/protobufjs/src/decoder.js +61 -205
- package/node_modules/baileys/node_modules/protobufjs/src/encoder.js +7 -27
- package/node_modules/baileys/node_modules/protobufjs/src/enum.js +5 -18
- package/node_modules/baileys/node_modules/protobufjs/src/field.js +19 -71
- package/node_modules/baileys/node_modules/protobufjs/src/index-light.js +29 -29
- package/node_modules/baileys/node_modules/protobufjs/src/index-minimal.js +13 -12
- package/node_modules/baileys/node_modules/protobufjs/src/index.js +6 -6
- package/node_modules/baileys/node_modules/protobufjs/src/mapfield.js +8 -26
- package/node_modules/baileys/node_modules/protobufjs/src/message.js +11 -5
- package/node_modules/baileys/node_modules/protobufjs/src/method.js +7 -30
- package/node_modules/baileys/node_modules/protobufjs/src/namespace.js +10 -26
- package/node_modules/baileys/node_modules/protobufjs/src/object.js +31 -41
- package/node_modules/baileys/node_modules/protobufjs/src/oneof.js +1 -12
- package/node_modules/baileys/node_modules/protobufjs/src/parse.js +47 -169
- package/node_modules/baileys/node_modules/protobufjs/src/reader.js +50 -412
- package/node_modules/baileys/node_modules/protobufjs/src/reader_buffer.js +5 -31
- package/node_modules/baileys/node_modules/protobufjs/src/root.js +4 -16
- package/node_modules/baileys/node_modules/protobufjs/src/rpc/service.js +5 -18
- package/node_modules/baileys/node_modules/protobufjs/src/service.js +2 -15
- package/node_modules/baileys/node_modules/protobufjs/src/tokenize.js +1 -6
- package/node_modules/baileys/node_modules/protobufjs/src/type.js +36 -80
- package/node_modules/baileys/node_modules/protobufjs/src/typescript.jsdoc +15 -0
- package/node_modules/baileys/node_modules/protobufjs/src/util/longbits.js +6 -10
- package/node_modules/baileys/node_modules/protobufjs/src/util/minimal.js +54 -71
- package/node_modules/baileys/node_modules/protobufjs/src/util.js +17 -51
- package/node_modules/baileys/node_modules/protobufjs/src/verifier.js +14 -19
- package/node_modules/baileys/node_modules/protobufjs/src/wrappers.js +3 -2
- package/node_modules/baileys/node_modules/protobufjs/src/writer.js +191 -424
- package/node_modules/baileys/node_modules/protobufjs/src/writer_buffer.js +26 -41
- package/node_modules/baileys/node_modules/protobufjs/tsconfig.json +5 -3
- package/node_modules/baileys/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/baileys/node_modules/undici-types/README.md +6 -0
- package/node_modules/baileys/node_modules/undici-types/agent.d.ts +30 -0
- package/node_modules/baileys/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/baileys/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/node_modules/baileys/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/baileys/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/baileys/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/baileys/node_modules/undici-types/client.d.ts +129 -0
- package/node_modules/baileys/node_modules/undici-types/connector.d.ts +36 -0
- package/node_modules/baileys/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/baileys/node_modules/undici-types/cookies.d.ts +30 -0
- package/node_modules/baileys/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/node_modules/baileys/node_modules/undici-types/dispatcher.d.ts +253 -0
- package/node_modules/baileys/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/baileys/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/baileys/node_modules/undici-types/errors.d.ts +177 -0
- package/node_modules/baileys/node_modules/undici-types/eventsource.d.ts +66 -0
- package/node_modules/baileys/node_modules/undici-types/fetch.d.ts +231 -0
- package/node_modules/baileys/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/baileys/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/baileys/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/baileys/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/baileys/node_modules/undici-types/handlers.d.ts +14 -0
- package/node_modules/baileys/node_modules/undici-types/header.d.ts +165 -0
- package/node_modules/baileys/node_modules/undici-types/index.d.ts +93 -0
- package/node_modules/baileys/node_modules/undici-types/interceptors.d.ts +80 -0
- package/node_modules/baileys/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/node_modules/baileys/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/baileys/node_modules/undici-types/mock-client.d.ts +27 -0
- package/node_modules/baileys/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/baileys/node_modules/undici-types/mock-interceptor.d.ts +94 -0
- package/node_modules/baileys/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/node_modules/baileys/node_modules/undici-types/package.json +55 -0
- package/node_modules/baileys/node_modules/undici-types/patch.d.ts +29 -0
- package/node_modules/baileys/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/baileys/node_modules/undici-types/pool.d.ts +39 -0
- package/node_modules/baileys/node_modules/undici-types/proxy-agent.d.ts +29 -0
- package/node_modules/baileys/node_modules/undici-types/readable.d.ts +68 -0
- package/node_modules/baileys/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/baileys/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/node_modules/baileys/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/node_modules/baileys/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/node_modules/baileys/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/baileys/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/baileys/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/baileys/node_modules/undici-types/webidl.d.ts +346 -0
- package/node_modules/baileys/node_modules/undici-types/websocket.d.ts +188 -0
- package/node_modules/baileys/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/baileys/node_modules/ws/package.json +1 -1
- package/node_modules/typebox/build/compile/validator.d.mts +4 -1
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +2 -5
- package/node_modules/typebox/build/guard/string.mjs +4 -16
- package/node_modules/typebox/build/schema/engine/_functions.mjs +15 -34
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -8
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +32 -29
- package/openclaw.plugin.json +239 -214
- package/package.json +11 -21
- package/dist/approval-reactions-Cu66aYdq.js +0 -373
- package/dist/channel.setup-pMwNVkCA.js +0 -19
- package/dist/config-schema-BQP5YCeK.js +0 -50
- package/dist/connection-controller-runtime-context-DG0tuYuw.js +0 -23
- package/dist/directory-config-DalGrfGN.js +0 -196
- package/dist/doctor-CwzVXKoE.js +0 -10
- package/dist/normalize-C7Hkc_vE.js +0 -2
- package/dist/question-reactions-CRsnyoMK.js +0 -142
- package/dist/runtime-BLlToOi6.js +0 -21
- package/dist/send-D37ddk22.js +0 -436
- package/dist/session.runtime-Nsqaehbd.js +0 -16
- package/dist/socket-close-DridEuzz.js +0 -622
- package/dist/targets-runtime-TMk0lGuy.js +0 -299
- package/dist/text-runtime-CaKLhowd.js +0 -4
- package/node_modules/baileys/node_modules/protobufjs/ext/README.md +0 -70
- package/node_modules/baileys/node_modules/protobufjs/ext/descriptor.d.ts +0 -87
- package/node_modules/baileys/node_modules/protobufjs/ext/descriptor.generated.d.ts +0 -417
- package/node_modules/baileys/node_modules/protobufjs/ext/descriptor.js +0 -1356
- package/node_modules/baileys/node_modules/protobufjs/ext/protojson.LICENSE +0 -201
- package/node_modules/baileys/node_modules/protobufjs/ext/protojson.d.ts +0 -20
- package/node_modules/baileys/node_modules/protobufjs/ext/protojson.generated.d.ts +0 -49
- package/node_modules/baileys/node_modules/protobufjs/ext/protojson.js +0 -951
- package/node_modules/baileys/node_modules/protobufjs/ext/textformat.d.ts +0 -19
- package/node_modules/baileys/node_modules/protobufjs/ext/textformat.generated.d.ts +0 -33
- package/node_modules/baileys/node_modules/protobufjs/ext/textformat.js +0 -1276
- package/node_modules/baileys/node_modules/protobufjs/google/protobuf/compiler/plugin.json +0 -126
- package/node_modules/baileys/node_modules/protobufjs/google/protobuf/compiler/plugin.proto +0 -47
- package/node_modules/baileys/node_modules/protobufjs/src/typescript.js +0 -25
- /package/dist/{account-ids-CB5SOWjc.js → .setup/account-ids-CB5SOWjc.mjs} +0 -0
- /package/dist/{audio-preflight.runtime-C_glQhZY.js → .setup/audio-preflight.runtime-C_glQhZY.mjs} +0 -0
- /package/dist/{command-policy-BIOSHySD.js → .setup/command-policy-BIOSHySD.mjs} +0 -0
- /package/dist/{creds-files-B1kSWtBg.js → .setup/creds-files-B1kSWtBg.mjs} +0 -0
- /package/dist/{group-config-path-BGyzT9Lg.js → .setup/group-config-path-BGyzT9Lg.mjs} +0 -0
- /package/dist/{group-session-contract-DDnZSsJ1.js → .setup/group-session-contract-DDnZSsJ1.mjs} +0 -0
- /package/dist/{reply-resolver.runtime-Ded8D58Y.js → .setup/reply-resolver.runtime-Ded8D58Y.mjs} +0 -0
- /package/dist/{rolldown-runtime-D7D4PA-g.js → .setup/rolldown-runtime-D7D4PA-g.mjs} +0 -0
- /package/dist/{security-contract-nAzD945y.js → .setup/security-contract-nAzD945y.mjs} +0 -0
- /package/dist/{session-contract-DMTm6Q_L.js → .setup/session-contract-DMTm6Q_L.mjs} +0 -0
- /package/node_modules/baileys/node_modules/{protobufjs/src/util/float.d.ts → @protobufjs/float/index.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Official OpenClaw channel plugin for WhatsApp Web chats.
|
|
|
5
5
|
Install from OpenClaw:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
openclaw
|
|
8
|
+
openclaw plugin add @openclaw/whatsapp
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Link a WhatsApp account through the plugin's setup flow, then configure which chats OpenClaw agents should monitor and reply to.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
2
|
-
import { n as isSelfChatMode } from "./targets-runtime-
|
|
3
|
-
import {
|
|
4
|
-
import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-Dw16pdNl.mjs";
|
|
2
|
+
import { n as isSelfChatMode } from "./targets-runtime-C-GiVn6Y.mjs";
|
|
3
|
+
import { n as normalizeE164 } from "./text-runtime-CUrq1mFq.mjs";
|
|
4
|
+
import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-CDB1bT-p.mjs";
|
|
5
5
|
import { defaultRuntime } from "openclaw/plugin-sdk/runtime-env";
|
|
6
6
|
import { resolveChannelGroupPolicy, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
7
7
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
@@ -233,6 +233,7 @@ async function resolveWhatsAppIngressAccess(params) {
|
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
async function resolveWhatsAppCommandAuthorized(params) {
|
|
236
|
+
if (!(params.cfg.commands?.useAccessGroups !== false)) return true;
|
|
236
237
|
const self = getSelfIdentity(params.msg, params.authDir);
|
|
237
238
|
const admission = requireWhatsAppInboundAdmission(params.msg);
|
|
238
239
|
const policy = params.policy ?? resolveWhatsAppInboundPolicy({
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DEFAULT_ACCOUNT_ID, mergeAccountConfig, resolveAccountEntry, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-core";
|
|
2
|
+
import { resolveChannelStreamingBlockEnabled, resolveChannelStreamingChunkMode } from "openclaw/plugin-sdk/channel-outbound";
|
|
3
|
+
//#region extensions/whatsapp/src/account-config.ts
|
|
4
|
+
function resolveWhatsAppDefaultAccountSharedConfig(cfg) {
|
|
5
|
+
const defaultAccount = resolveAccountEntry(cfg.channels?.whatsapp?.accounts, DEFAULT_ACCOUNT_ID);
|
|
6
|
+
if (!defaultAccount) return;
|
|
7
|
+
const { enabled: _ignoredEnabled, name: _ignoredName, authDir: _ignoredAuthDir, selfChatMode: _ignoredSelfChatMode, ...sharedDefaults } = defaultAccount;
|
|
8
|
+
return sharedDefaults;
|
|
9
|
+
}
|
|
10
|
+
function resolveWhatsAppAccountConfigForTest(cfg, accountId) {
|
|
11
|
+
return resolveAccountEntry(cfg.channels?.whatsapp?.accounts, accountId);
|
|
12
|
+
}
|
|
13
|
+
function resolveMergedNamedWhatsAppAccountConfig(params) {
|
|
14
|
+
const rootCfg = params.cfg.channels?.whatsapp;
|
|
15
|
+
const accountConfig = resolveWhatsAppAccountConfigForTest(params.cfg, params.accountId);
|
|
16
|
+
return {
|
|
17
|
+
...mergeAccountConfig({
|
|
18
|
+
channelConfig: rootCfg,
|
|
19
|
+
accountConfig: void 0,
|
|
20
|
+
omitKeys: ["defaultAccount"]
|
|
21
|
+
}),
|
|
22
|
+
...resolveWhatsAppDefaultAccountSharedConfig(params.cfg),
|
|
23
|
+
...accountConfig
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function resolveMergedWhatsAppAccountConfig(params) {
|
|
27
|
+
const rootCfg = params.cfg.channels?.whatsapp;
|
|
28
|
+
const accountId = params.accountId?.trim() || rootCfg?.defaultAccount || DEFAULT_ACCOUNT_ID;
|
|
29
|
+
const base = resolveMergedAccountConfig({
|
|
30
|
+
channelConfig: rootCfg,
|
|
31
|
+
accounts: rootCfg?.accounts,
|
|
32
|
+
accountId,
|
|
33
|
+
omitKeys: ["defaultAccount"]
|
|
34
|
+
});
|
|
35
|
+
const merged = accountId === DEFAULT_ACCOUNT_ID ? base : resolveMergedNamedWhatsAppAccountConfig({
|
|
36
|
+
cfg: params.cfg,
|
|
37
|
+
accountId
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
accountId,
|
|
41
|
+
...merged,
|
|
42
|
+
chunkMode: resolveChannelStreamingChunkMode(merged) ?? merged.chunkMode,
|
|
43
|
+
blockStreaming: resolveChannelStreamingBlockEnabled(merged) ?? merged.blockStreaming
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { resolveMergedWhatsAppAccountConfig as t };
|
|
@@ -1,51 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
1
|
+
import { t as resolveMergedWhatsAppAccountConfig } from "./account-config-6PTOSfaI.mjs";
|
|
2
|
+
import { n as listConfiguredAccountIds, r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-CB5SOWjc.mjs";
|
|
3
|
+
import { n as hasWebCredsRegularFileSync, r as hasWebCredsSync } from "./creds-files-B1kSWtBg.mjs";
|
|
3
4
|
import fs from "node:fs";
|
|
4
5
|
import path from "node:path";
|
|
5
|
-
import { DEFAULT_ACCOUNT_ID,
|
|
6
|
+
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, resolveUserPath } from "openclaw/plugin-sdk/account-core";
|
|
6
7
|
import { resolveOAuthDir } from "openclaw/plugin-sdk/state-paths";
|
|
7
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
-
//#region extensions/whatsapp/src/account-config.ts
|
|
9
|
-
function resolveWhatsAppDefaultAccountSharedConfig(cfg) {
|
|
10
|
-
const defaultAccount = resolveAccountEntry(cfg.channels?.whatsapp?.accounts, DEFAULT_ACCOUNT_ID);
|
|
11
|
-
if (!defaultAccount) return;
|
|
12
|
-
const { enabled: _ignoredEnabled, name: _ignoredName, authDir: _ignoredAuthDir, selfChatMode: _ignoredSelfChatMode, ...sharedDefaults } = defaultAccount;
|
|
13
|
-
return sharedDefaults;
|
|
14
|
-
}
|
|
15
|
-
function resolveWhatsAppAccountConfigForTest(cfg, accountId) {
|
|
16
|
-
return resolveAccountEntry(cfg.channels?.whatsapp?.accounts, accountId);
|
|
17
|
-
}
|
|
18
|
-
function resolveMergedNamedWhatsAppAccountConfig(params) {
|
|
19
|
-
const rootCfg = params.cfg.channels?.whatsapp;
|
|
20
|
-
const accountConfig = resolveWhatsAppAccountConfigForTest(params.cfg, params.accountId);
|
|
21
|
-
return {
|
|
22
|
-
...mergeAccountConfig({
|
|
23
|
-
channelConfig: rootCfg,
|
|
24
|
-
accountConfig: void 0,
|
|
25
|
-
omitKeys: ["defaultAccount"]
|
|
26
|
-
}),
|
|
27
|
-
...resolveWhatsAppDefaultAccountSharedConfig(params.cfg),
|
|
28
|
-
...accountConfig
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function resolveMergedWhatsAppAccountConfig(params) {
|
|
32
|
-
const rootCfg = params.cfg.channels?.whatsapp;
|
|
33
|
-
const accountId = params.accountId?.trim() || rootCfg?.defaultAccount || DEFAULT_ACCOUNT_ID;
|
|
34
|
-
const base = resolveMergedAccountConfig({
|
|
35
|
-
channelConfig: rootCfg,
|
|
36
|
-
accounts: rootCfg?.accounts,
|
|
37
|
-
accountId,
|
|
38
|
-
omitKeys: ["defaultAccount"]
|
|
39
|
-
});
|
|
40
|
-
return {
|
|
41
|
-
accountId,
|
|
42
|
-
...accountId === DEFAULT_ACCOUNT_ID ? base : resolveMergedNamedWhatsAppAccountConfig({
|
|
43
|
-
cfg: params.cfg,
|
|
44
|
-
accountId
|
|
45
|
-
})
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
9
|
//#region extensions/whatsapp/src/accounts.ts
|
|
50
10
|
const DEFAULT_WHATSAPP_MEDIA_MAX_MB = 50;
|
|
51
11
|
function listWhatsAppAuthDirs(cfg) {
|
|
@@ -117,7 +77,7 @@ function resolveWhatsAppAccount(params) {
|
|
|
117
77
|
name: normalizeOptionalString(merged.name),
|
|
118
78
|
enabled,
|
|
119
79
|
sendReadReceipts: merged.sendReadReceipts ?? true,
|
|
120
|
-
messagePrefix: merged.
|
|
80
|
+
messagePrefix: merged.messagePrefix ?? params.cfg.messages?.messagePrefix,
|
|
121
81
|
defaultTo: merged.defaultTo,
|
|
122
82
|
authDir,
|
|
123
83
|
isLegacyAuthDir: isLegacy,
|
|
@@ -129,12 +89,14 @@ function resolveWhatsAppAccount(params) {
|
|
|
129
89
|
mentionPatterns: merged.mentionPatterns,
|
|
130
90
|
historyLimit: merged.historyLimit,
|
|
131
91
|
textChunkLimit: merged.textChunkLimit,
|
|
132
|
-
|
|
92
|
+
chunkMode: merged.chunkMode,
|
|
133
93
|
mediaMaxMb: merged.mediaMaxMb,
|
|
94
|
+
blockStreaming: merged.blockStreaming,
|
|
134
95
|
ackReaction: merged.ackReaction,
|
|
135
96
|
reactionLevel: merged.reactionLevel,
|
|
136
97
|
groups: merged.groups,
|
|
137
98
|
direct: merged.direct,
|
|
99
|
+
debounceMs: merged.debounceMs,
|
|
138
100
|
replyToMode: merged.replyToMode
|
|
139
101
|
};
|
|
140
102
|
}
|
|
@@ -149,4 +111,4 @@ function listEnabledWhatsAppAccounts(cfg) {
|
|
|
149
111
|
})).filter((account) => account.enabled);
|
|
150
112
|
}
|
|
151
113
|
//#endregion
|
|
152
|
-
export { resolveWhatsAppAccount as a,
|
|
114
|
+
export { resolveWhatsAppAccount as a, listWhatsAppAuthDirs as i, hasAnyWhatsAppAuth as n, resolveWhatsAppAuthDir as o, listEnabledWhatsAppAccounts as r, resolveWhatsAppMediaMaxBytes as s, DEFAULT_WHATSAPP_MEDIA_MAX_MB as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
2
|
-
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-
|
|
3
|
-
import {
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-Dw16pdNl.mjs";
|
|
2
|
+
import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-oI7VpU4w.mjs";
|
|
3
|
+
import { g as resolveWhatsAppReactionLevel, r as sendReactionWhatsApp } from "./send-BQjMC41n.mjs";
|
|
4
4
|
import { ToolAuthorizationError, createActionGate, jsonResult, readReactionParams, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
5
5
|
//#region extensions/whatsapp/src/action-runtime-target-auth.ts
|
|
6
6
|
function resolveAuthorizedWhatsAppOutboundTarget(params) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.
|
|
2
|
-
import {
|
|
1
|
+
import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.mjs";
|
|
2
|
+
import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-TSX_udJp.mjs";
|
|
3
3
|
//#region extensions/whatsapp/src/active-listener.ts
|
|
4
4
|
function resolveWebAccountId(params) {
|
|
5
5
|
return (params.accountId ?? "").trim() || resolveDefaultWhatsAppAccountId(params.cfg);
|
|
6
6
|
}
|
|
7
7
|
function getActiveWebListener(accountId) {
|
|
8
|
-
return
|
|
8
|
+
return getRegisteredWhatsAppConnectionController(accountId)?.getActiveListener() ?? null;
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
11
|
export { resolveWebAccountId as n, getActiveWebListener as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { startWebLoginWithQr, waitForWebLogin } from "
|
|
2
|
-
import "
|
|
1
|
+
import { startWebLoginWithQr, waitForWebLogin } from "../login-qr-runtime.js";
|
|
2
|
+
import "../login-qr-api.js";
|
|
3
3
|
import { optionalPositiveIntegerSchema, readPositiveIntegerParam } from "openclaw/plugin-sdk/channel-actions";
|
|
4
4
|
import { Type } from "typebox";
|
|
5
5
|
//#region extensions/whatsapp/src/agent-tools-login.ts
|
|
@@ -7,22 +7,29 @@ const QR_DATA_URL_MAX_LENGTH = 16384;
|
|
|
7
7
|
function readOptionalString(value) {
|
|
8
8
|
return typeof value === "string" && value.trim() ? value : void 0;
|
|
9
9
|
}
|
|
10
|
-
function createWhatsAppLoginTool() {
|
|
10
|
+
function createWhatsAppLoginTool(context) {
|
|
11
|
+
if (context.senderIsOwner !== true) return null;
|
|
11
12
|
return {
|
|
12
13
|
label: "WhatsApp Login",
|
|
13
14
|
name: "whatsapp_login",
|
|
14
15
|
description: "Generate a WhatsApp QR code for linking, or wait for the scan to complete.",
|
|
15
16
|
parameters: Type.Object({
|
|
16
|
-
action: Type.
|
|
17
|
+
action: Type.Unsafe({
|
|
18
|
+
type: "string",
|
|
19
|
+
enum: ["start", "wait"]
|
|
20
|
+
}),
|
|
17
21
|
timeoutMs: optionalPositiveIntegerSchema(),
|
|
18
22
|
force: Type.Optional(Type.Boolean()),
|
|
19
23
|
accountId: Type.Optional(Type.String()),
|
|
20
24
|
currentQrDataUrl: Type.Optional(Type.String({
|
|
21
25
|
maxLength: QR_DATA_URL_MAX_LENGTH,
|
|
22
|
-
pattern: "^data:image/png;base64
|
|
26
|
+
pattern: "^data:image/png;base64,"
|
|
23
27
|
}))
|
|
24
28
|
}),
|
|
25
|
-
execute: async (_toolCallId, args) => {
|
|
29
|
+
execute: async (_toolCallId, args, signal) => {
|
|
30
|
+
const beforeCredentialPersistence = async () => {
|
|
31
|
+
if (!signal || signal.aborted) throw new Error("WhatsApp login authority is no longer active.");
|
|
32
|
+
};
|
|
26
33
|
const renderQrReply = (params) => {
|
|
27
34
|
return {
|
|
28
35
|
content: [{
|
|
@@ -63,9 +70,11 @@ function createWhatsAppLoginTool() {
|
|
|
63
70
|
details: { connected: result.connected }
|
|
64
71
|
};
|
|
65
72
|
}
|
|
73
|
+
await beforeCredentialPersistence();
|
|
66
74
|
const result = await startWebLoginWithQr({
|
|
67
75
|
accountId,
|
|
68
76
|
timeoutMs,
|
|
77
|
+
beforeCredentialPersistence,
|
|
69
78
|
force: typeof args.force === "boolean" ? args.force : false
|
|
70
79
|
});
|
|
71
80
|
if (!result.qrDataUrl) return {
|
|
@@ -83,5 +92,8 @@ function createWhatsAppLoginTool() {
|
|
|
83
92
|
}
|
|
84
93
|
};
|
|
85
94
|
}
|
|
95
|
+
function registerWhatsAppLoginTool(api) {
|
|
96
|
+
api.registerTool((context) => createWhatsAppLoginTool(context), { name: "whatsapp_login" });
|
|
97
|
+
}
|
|
86
98
|
//#endregion
|
|
87
|
-
export { createWhatsAppLoginTool as t };
|
|
99
|
+
export { registerWhatsAppLoginTool as n, createWhatsAppLoginTool as t };
|
package/dist/{approval-handler.runtime-DrA59QSA.js → .setup/approval-handler.runtime-DtJZbu3y.mjs}
RENAMED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { i as getWhatsAppRuntime } from "./runtime-BLlToOi6.js";
|
|
6
|
-
import "./normalize-C7Hkc_vE.js";
|
|
7
|
-
import { i as unregisterWhatsAppApprovalReactionTarget, r as registerWhatsAppApprovalReactionTarget } from "./approval-reactions-Cu66aYdq.js";
|
|
1
|
+
import { s as normalizeWhatsAppMessagingTarget } from "./normalize-target-bVWjgftN.mjs";
|
|
2
|
+
import { f as registerWhatsAppApprovalReactionTarget, i as sendTypingWhatsApp, p as unregisterWhatsAppApprovalReactionTarget, t as sendMessageWhatsApp } from "./send-BQjMC41n.mjs";
|
|
3
|
+
import "./normalize-eddWWsNV.mjs";
|
|
4
|
+
import { n as getWhatsAppRuntime } from "./runtime-BfAdAEYT.mjs";
|
|
8
5
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
9
|
-
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
10
|
-
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
11
6
|
import { buildApprovalReactionPendingContent } from "openclaw/plugin-sdk/approval-reaction-runtime";
|
|
7
|
+
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
12
8
|
import { buildChannelApprovalExpiredText, buildChannelApprovalResolvedText, createChannelApprovalNativeRuntimeAdapter, resolvePreparedApprovalAccountId } from "openclaw/plugin-sdk/approval-handler-runtime";
|
|
13
9
|
//#region extensions/whatsapp/src/approval-handler.runtime.ts
|
|
14
10
|
const log = createSubsystemLogger("whatsapp/approvals");
|
|
@@ -44,15 +40,14 @@ const whatsappApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter(
|
|
|
44
40
|
})
|
|
45
41
|
},
|
|
46
42
|
transport: {
|
|
47
|
-
prepareTarget: ({
|
|
43
|
+
prepareTarget: ({ plannedTarget, accountId }) => {
|
|
48
44
|
const to = normalizeWhatsAppMessagingTarget(plannedTarget.target.to);
|
|
49
45
|
if (!to) return null;
|
|
50
46
|
const prepared = {
|
|
51
47
|
to,
|
|
52
48
|
accountId: resolvePreparedApprovalAccountId({
|
|
53
49
|
plannedAccountId: plannedTarget.target.accountId,
|
|
54
|
-
contextAccountId: accountId
|
|
55
|
-
fallbackAccountId: cfg ? resolveDefaultWhatsAppAccountId(cfg) : DEFAULT_ACCOUNT_ID
|
|
50
|
+
contextAccountId: accountId
|
|
56
51
|
})
|
|
57
52
|
};
|
|
58
53
|
return {
|
|
@@ -64,13 +59,13 @@ const whatsappApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter(
|
|
|
64
59
|
const verbose = getWhatsAppRuntime().logging.shouldLogVerbose();
|
|
65
60
|
await sendTypingWhatsApp(preparedTarget.to, {
|
|
66
61
|
cfg,
|
|
67
|
-
accountId: preparedTarget.accountId
|
|
62
|
+
...preparedTarget.accountId ? { accountId: preparedTarget.accountId } : {}
|
|
68
63
|
}).catch(() => {});
|
|
69
64
|
const result = await sendMessageWhatsApp(preparedTarget.to, pendingPayload.reactionPayload.text ?? "", {
|
|
70
65
|
cfg,
|
|
71
66
|
verbose,
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
preserveLeadingWhitespace: true,
|
|
68
|
+
...preparedTarget.accountId ? { accountId: preparedTarget.accountId } : {}
|
|
74
69
|
});
|
|
75
70
|
if (!result.messageId) return null;
|
|
76
71
|
return {
|
|
@@ -85,8 +80,8 @@ const whatsappApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter(
|
|
|
85
80
|
await sendMessageWhatsApp(entry.to, payload.text, {
|
|
86
81
|
cfg,
|
|
87
82
|
verbose,
|
|
88
|
-
accountId: entry.accountId,
|
|
89
83
|
preserveLeadingWhitespace: true,
|
|
84
|
+
...entry.accountId ? { accountId: entry.accountId } : {},
|
|
90
85
|
quotedMessageKey: {
|
|
91
86
|
id: entry.messageId,
|
|
92
87
|
remoteJid: entry.remoteJid,
|
|
@@ -97,24 +92,23 @@ const whatsappApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter(
|
|
|
97
92
|
},
|
|
98
93
|
interactions: {
|
|
99
94
|
bindPending: ({ entry, request, view, pendingPayload }) => registerWhatsAppApprovalReactionTarget({
|
|
100
|
-
accountId: entry.accountId,
|
|
95
|
+
accountId: entry.accountId ?? "",
|
|
101
96
|
remoteJid: entry.remoteJid,
|
|
102
97
|
messageId: entry.messageId,
|
|
103
98
|
approvalId: request.id,
|
|
104
|
-
approvalKind: view.approvalKind,
|
|
105
99
|
allowedDecisions: pendingPayload.reactionPayload.allowedDecisions,
|
|
106
100
|
ttlMs: Math.max(1, view.expiresAtMs - Date.now())
|
|
107
101
|
}) ? true : null,
|
|
108
102
|
unbindPending: ({ entry }) => {
|
|
109
103
|
unregisterWhatsAppApprovalReactionTarget({
|
|
110
|
-
accountId: entry.accountId,
|
|
104
|
+
accountId: entry.accountId ?? "",
|
|
111
105
|
remoteJid: entry.remoteJid,
|
|
112
106
|
messageId: entry.messageId
|
|
113
107
|
});
|
|
114
108
|
},
|
|
115
109
|
cancelDelivered: ({ entry }) => {
|
|
116
110
|
unregisterWhatsAppApprovalReactionTarget({
|
|
117
|
-
accountId: entry.accountId,
|
|
111
|
+
accountId: entry.accountId ?? "",
|
|
118
112
|
remoteJid: entry.remoteJid,
|
|
119
113
|
messageId: entry.messageId
|
|
120
114
|
});
|
|
@@ -2,10 +2,9 @@ import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
|
|
|
2
2
|
import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
|
|
3
3
|
//#region extensions/whatsapp/src/approval-resolver.ts
|
|
4
4
|
async function resolveWhatsAppApproval(params) {
|
|
5
|
-
|
|
5
|
+
await resolveApprovalOverGateway({
|
|
6
6
|
cfg: params.cfg,
|
|
7
7
|
approvalId: params.approvalId,
|
|
8
|
-
approvalKind: params.approvalKind,
|
|
9
8
|
decision: params.decision,
|
|
10
9
|
senderId: params.senderId,
|
|
11
10
|
gatewayUrl: params.gatewayUrl,
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.
|
|
2
|
-
import { a as readWebCredsJsonRawSync, c as statWebCredsFileSync, i as readWebCredsJsonRaw, o as resolveWebCredsBackupPath,
|
|
3
|
-
import {
|
|
4
|
-
import { c as resolveComparableIdentity } from "./identity-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { a as readWebCredsJsonRawSync, c as statWebCredsFileSync, i as readWebCredsJsonRaw, o as resolveWebCredsBackupPath, s as resolveWebCredsPath, t as assertWebCredsPathRegularFileOrMissing } from "./creds-files-B1kSWtBg.mjs";
|
|
3
|
+
import { r as resolveUserPath } from "./text-runtime-CUrq1mFq.mjs";
|
|
4
|
+
import { c as resolveComparableIdentity } from "./identity-CDB1bT-p.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { resolveOAuthDir as resolveOAuthDir$1 } from "openclaw/plugin-sdk/state-paths";
|
|
7
7
|
import { replaceFileAtomic } from "openclaw/plugin-sdk/security-runtime";
|
|
8
8
|
import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
9
9
|
import { defaultRuntime, getChildLogger, info, success } from "openclaw/plugin-sdk/runtime-env";
|
|
10
|
+
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
10
11
|
import fs from "node:fs/promises";
|
|
11
12
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/routing";
|
|
12
13
|
import { enqueueKeyedTask } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
13
|
-
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
14
14
|
//#region extensions/whatsapp/src/creds-persistence.ts
|
|
15
15
|
const CREDS_FILE_MODE = 384;
|
|
16
16
|
const CREDS_SAVE_FLUSH_TIMEOUT_MS = 15e3;
|
|
17
17
|
const credsSaveQueues = /* @__PURE__ */ new Map();
|
|
18
18
|
async function stringifyCreds(creds) {
|
|
19
|
-
const { BufferJSON } = await import("./session.runtime-
|
|
19
|
+
const { BufferJSON } = await import("./session.runtime-B-V3rXP6.mjs").then((n) => n.a);
|
|
20
20
|
return JSON.stringify(creds, BufferJSON.replacer);
|
|
21
21
|
}
|
|
22
22
|
async function writeWebCredsRawAtomically(params) {
|
|
23
|
+
await params.beforeCredentialPersistence?.();
|
|
23
24
|
await assertWebCredsPathRegularFileOrMissing(params.filePath);
|
|
24
25
|
await replaceFileAtomic({
|
|
25
26
|
filePath: params.filePath,
|
|
@@ -31,14 +32,16 @@ async function writeWebCredsRawAtomically(params) {
|
|
|
31
32
|
syncParentDir: true,
|
|
32
33
|
beforeRename: async ({ filePath }) => {
|
|
33
34
|
await assertWebCredsPathRegularFileOrMissing(filePath);
|
|
35
|
+
await params.beforeCredentialPersistence?.();
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
38
|
}
|
|
37
|
-
async function writeCredsJsonAtomically(authDir, creds) {
|
|
39
|
+
async function writeCredsJsonAtomically(authDir, creds, beforeCredentialPersistence) {
|
|
38
40
|
await writeWebCredsRawAtomically({
|
|
39
41
|
filePath: resolveWebCredsPath(authDir),
|
|
40
42
|
content: await stringifyCreds(creds),
|
|
41
|
-
tempPrefix: ".creds"
|
|
43
|
+
tempPrefix: ".creds",
|
|
44
|
+
beforeCredentialPersistence
|
|
42
45
|
});
|
|
43
46
|
}
|
|
44
47
|
function enqueueCredsSave(authDir, saveCreds, onError) {
|
|
@@ -75,7 +78,6 @@ var auth_store_exports = /* @__PURE__ */ __exportAll({
|
|
|
75
78
|
WhatsAppAuthUnstableError: () => WhatsAppAuthUnstableError,
|
|
76
79
|
formatWhatsAppWebAuthStatusState: () => formatWhatsAppWebAuthStatusState,
|
|
77
80
|
getWebAuthAgeMs: () => getWebAuthAgeMs,
|
|
78
|
-
hasWebCredsSync: () => hasWebCredsSync,
|
|
79
81
|
logWebSelfId: () => logWebSelfId,
|
|
80
82
|
logoutWeb: () => logoutWeb,
|
|
81
83
|
pickWebChannel: () => pickWebChannel,
|
|
@@ -131,9 +133,8 @@ function isValidJson(raw) {
|
|
|
131
133
|
return false;
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
|
-
async function restoreCredsFromBackupIfNeeded(authDir, options) {
|
|
136
|
+
async function restoreCredsFromBackupIfNeeded(authDir, options = {}) {
|
|
135
137
|
const logger = getChildLogger({ module: "web-session" });
|
|
136
|
-
let restore;
|
|
137
138
|
try {
|
|
138
139
|
const credsPath = resolveWebCredsPath(authDir);
|
|
139
140
|
const backupPath = resolveWebCredsBackupPath(authDir);
|
|
@@ -146,27 +147,21 @@ async function restoreCredsFromBackupIfNeeded(authDir, options) {
|
|
|
146
147
|
if (raw && isValidJson(raw)) return false;
|
|
147
148
|
const backupRaw = readCredsJsonRaw(backupPath);
|
|
148
149
|
if (!backupRaw || !isValidJson(backupRaw)) return false;
|
|
149
|
-
restore = {
|
|
150
|
-
content: backupRaw,
|
|
151
|
-
credsPath
|
|
152
|
-
};
|
|
153
|
-
} catch {
|
|
154
|
-
return false;
|
|
155
|
-
}
|
|
156
|
-
await options?.beforeCredentialPersistence?.();
|
|
157
|
-
try {
|
|
158
150
|
await writeWebCredsRawAtomically({
|
|
159
|
-
filePath:
|
|
160
|
-
content:
|
|
161
|
-
tempPrefix: ".creds.restore"
|
|
151
|
+
filePath: credsPath,
|
|
152
|
+
content: backupRaw,
|
|
153
|
+
tempPrefix: ".creds.restore",
|
|
154
|
+
beforeCredentialPersistence: options.beforeCredentialPersistence
|
|
162
155
|
});
|
|
163
|
-
logger.warn({ credsPath
|
|
156
|
+
logger.warn({ credsPath }, "restored corrupted WhatsApp creds.json from backup");
|
|
164
157
|
return true;
|
|
165
158
|
} catch {}
|
|
166
159
|
return false;
|
|
167
160
|
}
|
|
168
161
|
async function webAuthExists(authDir = resolveDefaultWebAuthDir()) {
|
|
169
|
-
const
|
|
162
|
+
const resolvedAuthDir = resolveUserPath(authDir);
|
|
163
|
+
const credsPath = resolveWebCredsPath(resolvedAuthDir);
|
|
164
|
+
const raw = await readWebCredsJsonRaw(credsPath);
|
|
170
165
|
if (!raw) return false;
|
|
171
166
|
try {
|
|
172
167
|
JSON.parse(raw);
|
|
@@ -244,10 +239,11 @@ function isBaileysAuthFileName(name) {
|
|
|
244
239
|
async function clearBaileysAuthFiles(authDir, beforeCredentialPersistence) {
|
|
245
240
|
const rootStats = await fs.lstat(authDir).catch(() => null);
|
|
246
241
|
if (!rootStats?.isDirectory() || rootStats.isSymbolicLink()) return;
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
242
|
+
const entries = await fs.readdir(authDir, { withFileTypes: true });
|
|
243
|
+
await Promise.all(entries.map(async (entry) => {
|
|
244
|
+
if (!entry.isFile()) return;
|
|
245
|
+
if (!isBaileysAuthFileName(entry.name)) return;
|
|
246
|
+
await beforeCredentialPersistence?.();
|
|
251
247
|
await fs.rm(path.join(authDir, entry.name), { force: true });
|
|
252
248
|
}));
|
|
253
249
|
}
|