@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/dist/{connection-controller-BOB2MVKY.js → .setup/connection-controller-Dt62u6fI.mjs}
RENAMED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { n as
|
|
3
|
-
import {
|
|
4
|
-
import { c as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { n as registerWhatsAppConnectionController, r as unregisterWhatsAppConnectionController } from "./connection-controller-registry-TSX_udJp.mjs";
|
|
2
|
+
import { n as getStatusCode, t as formatError } from "./session-errors-BAj9D2La.mjs";
|
|
3
|
+
import { t as DEFAULT_WHATSAPP_SOCKET_TIMING } from "./socket-timing-DhbVFjah.mjs";
|
|
4
|
+
import { c as logoutWeb, f as readWebAuthExistsForDecision, r as WhatsAppAuthUnstableError } from "./auth-store-BZKGa0tW.mjs";
|
|
5
|
+
import { c as resolveComparableIdentity } from "./identity-CDB1bT-p.mjs";
|
|
6
|
+
import { r as waitForWaConnection, t as createWaSocket } from "./session-vUI41Jel.mjs";
|
|
7
7
|
import { computeBackoff, info, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
8
|
-
import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
|
|
9
8
|
import { clamp } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
10
9
|
import { randomUUID } from "node:crypto";
|
|
11
|
-
//#region extensions/whatsapp/src/reconnect.ts
|
|
12
|
-
const DEFAULT_HEARTBEAT_SECONDS = 60;
|
|
13
10
|
const DEFAULT_RECONNECT_POLICY = {
|
|
14
11
|
initialMs: 2e3,
|
|
15
12
|
maxMs: 3e4,
|
|
@@ -18,14 +15,16 @@ const DEFAULT_RECONNECT_POLICY = {
|
|
|
18
15
|
maxAttempts: 12
|
|
19
16
|
};
|
|
20
17
|
function resolveHeartbeatSeconds(cfg, overrideSeconds) {
|
|
21
|
-
const candidate = overrideSeconds;
|
|
18
|
+
const candidate = overrideSeconds ?? cfg.web?.heartbeatSeconds;
|
|
22
19
|
if (typeof candidate === "number" && candidate > 0) return candidate;
|
|
23
|
-
return
|
|
20
|
+
return 60;
|
|
24
21
|
}
|
|
25
22
|
function resolveReconnectPolicy(cfg, overrides) {
|
|
23
|
+
const reconnectOverrides = cfg.web?.reconnect ?? {};
|
|
26
24
|
const overrideConfig = overrides ?? {};
|
|
27
25
|
const merged = {
|
|
28
26
|
...DEFAULT_RECONNECT_POLICY,
|
|
27
|
+
...reconnectOverrides,
|
|
29
28
|
...overrideConfig
|
|
30
29
|
};
|
|
31
30
|
merged.initialMs = Math.max(250, merged.initialMs);
|
|
@@ -87,49 +86,23 @@ function createLiveConnection(params) {
|
|
|
87
86
|
openedAfterRecentInbound: params.openedAfterRecentInbound,
|
|
88
87
|
backgroundTasks: /* @__PURE__ */ new Set(),
|
|
89
88
|
closePromise,
|
|
90
|
-
resolveClose: resolveClosePromise
|
|
91
|
-
socketClosed: false
|
|
89
|
+
resolveClose: resolveClosePromise
|
|
92
90
|
};
|
|
93
91
|
}
|
|
94
|
-
async function closeWebSocketBestEffort(sock) {
|
|
95
|
-
try {
|
|
96
|
-
await sock.ws?.close?.();
|
|
97
|
-
} catch {}
|
|
98
|
-
}
|
|
99
92
|
function closeWaSocket(sock) {
|
|
100
93
|
try {
|
|
101
94
|
if (typeof sock?.end === "function") {
|
|
102
|
-
|
|
95
|
+
sock.end(/* @__PURE__ */ new Error("OpenClaw WhatsApp socket close"));
|
|
103
96
|
return;
|
|
104
97
|
}
|
|
105
|
-
|
|
106
|
-
} catch {
|
|
107
|
-
if (sock) closeWebSocketBestEffort(sock);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function stoppedControllerError() {
|
|
111
|
-
return /* @__PURE__ */ new Error("WhatsApp connection controller is shutting down");
|
|
98
|
+
sock?.ws?.close?.();
|
|
99
|
+
} catch {}
|
|
112
100
|
}
|
|
113
101
|
function closeWaSocketSoon(sock, delayMs = 500) {
|
|
114
102
|
setTimeout(() => {
|
|
115
103
|
closeWaSocket(sock);
|
|
116
104
|
}, delayMs);
|
|
117
105
|
}
|
|
118
|
-
async function waitForLoginSocket(params) {
|
|
119
|
-
if (!params.credentialPersistenceFailure) {
|
|
120
|
-
await params.wait();
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
const outcome = await Promise.race([params.wait().then(() => ({ kind: "connected" })), params.credentialPersistenceFailure.then((failure) => ({
|
|
124
|
-
kind: "credential-persistence-failed",
|
|
125
|
-
failure
|
|
126
|
-
}))]);
|
|
127
|
-
if (outcome.kind === "credential-persistence-failed") throw outcome.failure.error;
|
|
128
|
-
}
|
|
129
|
-
function throwIfCredentialPersistenceFailed(getFailure) {
|
|
130
|
-
const failure = getFailure?.();
|
|
131
|
-
if (failure) throw failure.error;
|
|
132
|
-
}
|
|
133
106
|
async function waitForWhatsAppLoginResult(params) {
|
|
134
107
|
const wait = params.waitForConnection ?? waitForWaConnection;
|
|
135
108
|
const createSocket = params.createSocket ?? createWaSocket;
|
|
@@ -144,9 +117,7 @@ async function waitForWhatsAppLoginResult(params) {
|
|
|
144
117
|
authDir: params.authDir,
|
|
145
118
|
...params.socketTiming,
|
|
146
119
|
onQr: params.onQr,
|
|
147
|
-
beforeCredentialPersistence: params.beforeCredentialPersistence
|
|
148
|
-
onCredentialPersistenceError: params.onCredentialPersistenceError,
|
|
149
|
-
onCredentialPersistenceTask: params.onCredentialPersistenceTask
|
|
120
|
+
beforeCredentialPersistence: params.beforeCredentialPersistence
|
|
150
121
|
});
|
|
151
122
|
params.onSocketReplaced?.(currentSock);
|
|
152
123
|
return null;
|
|
@@ -160,14 +131,8 @@ async function waitForWhatsAppLoginResult(params) {
|
|
|
160
131
|
}
|
|
161
132
|
};
|
|
162
133
|
while (true) try {
|
|
163
|
-
await
|
|
164
|
-
wait: async () => await wait(currentSock, { timeout: "none" }),
|
|
165
|
-
credentialPersistenceFailure: params.credentialPersistenceFailure
|
|
166
|
-
});
|
|
167
|
-
await params.waitForCredentialPersistence?.();
|
|
168
|
-
throwIfCredentialPersistenceFailed(params.getCredentialPersistenceFailure);
|
|
134
|
+
await wait(currentSock, { timeout: "none" });
|
|
169
135
|
const persistedAuth = await readWebAuthExistsForDecision(params.authDir);
|
|
170
|
-
throwIfCredentialPersistenceFailed(params.getCredentialPersistenceFailure);
|
|
171
136
|
if (persistedAuth.outcome === "unstable") return {
|
|
172
137
|
outcome: "failed",
|
|
173
138
|
message: WHATSAPP_LOGIN_AUTH_UNSTABLE_MESSAGE,
|
|
@@ -237,16 +202,6 @@ var WhatsAppConnectionController = class {
|
|
|
237
202
|
constructor(params) {
|
|
238
203
|
this.disconnectRetryController = new AbortController();
|
|
239
204
|
this.current = null;
|
|
240
|
-
this.runtimeContextLease = null;
|
|
241
|
-
this.pendingOwnerContextLease = null;
|
|
242
|
-
this.connectionOwnerLease = null;
|
|
243
|
-
this.retainedOwnerReleaseLease = null;
|
|
244
|
-
this.connectionOwnerLeasePromise = null;
|
|
245
|
-
this.connectionSetupPromise = null;
|
|
246
|
-
this.pendingSocketCleanup = null;
|
|
247
|
-
this.shuttingDown = false;
|
|
248
|
-
this.ownerAcquireAbortController = new AbortController();
|
|
249
|
-
this.setupAbortController = new AbortController();
|
|
250
205
|
this.reconnectAttempts = 0;
|
|
251
206
|
this.lastHandledInboundAt = null;
|
|
252
207
|
this.accountId = params.accountId;
|
|
@@ -267,17 +222,11 @@ var WhatsAppConnectionController = class {
|
|
|
267
222
|
...params.socketTiming
|
|
268
223
|
};
|
|
269
224
|
this.socketRef = { current: null };
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const stop = () => {
|
|
273
|
-
resolve("aborted");
|
|
274
|
-
this.stopDisconnectRetries();
|
|
275
|
-
this.ownerAcquireAbortController.abort(abortSignal.reason);
|
|
276
|
-
this.setupAbortController.abort(abortSignal.reason);
|
|
277
|
-
};
|
|
278
|
-
if (abortSignal.aborted) stop();
|
|
279
|
-
else abortSignal.addEventListener("abort", stop, { once: true });
|
|
225
|
+
this.abortPromise = params.abortSignal && new Promise((resolve) => {
|
|
226
|
+
params.abortSignal?.addEventListener("abort", () => resolve("aborted"), { once: true });
|
|
280
227
|
});
|
|
228
|
+
if (params.abortSignal?.aborted) this.stopDisconnectRetries();
|
|
229
|
+
else params.abortSignal?.addEventListener("abort", () => this.stopDisconnectRetries(), { once: true });
|
|
281
230
|
}
|
|
282
231
|
getActiveListener() {
|
|
283
232
|
return this.current?.listener ?? null;
|
|
@@ -346,23 +295,7 @@ var WhatsAppConnectionController = class {
|
|
|
346
295
|
this.current.unregisterUnhandled = unregister;
|
|
347
296
|
}
|
|
348
297
|
async openConnection(params) {
|
|
349
|
-
if (this.shuttingDown) throw stoppedControllerError();
|
|
350
|
-
if (this.connectionSetupPromise) throw new Error("WhatsApp connection setup is already in progress");
|
|
351
|
-
const setupPromise = this.openConnectionOwned(params);
|
|
352
|
-
this.connectionSetupPromise = setupPromise;
|
|
353
|
-
try {
|
|
354
|
-
return await setupPromise;
|
|
355
|
-
} finally {
|
|
356
|
-
if (this.connectionSetupPromise === setupPromise) this.connectionSetupPromise = null;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
async openConnectionOwned(params) {
|
|
360
|
-
await this.ensureConnectionOwnership();
|
|
361
|
-
this.throwIfSetupStopped();
|
|
362
|
-
await this.finishPendingSocketCleanup();
|
|
363
|
-
this.throwIfSetupStopped();
|
|
364
298
|
if (this.current) await this.closeCurrentConnection();
|
|
365
|
-
this.throwIfSetupStopped();
|
|
366
299
|
let sock = null;
|
|
367
300
|
let connection = null;
|
|
368
301
|
try {
|
|
@@ -372,9 +305,7 @@ var WhatsAppConnectionController = class {
|
|
|
372
305
|
...params.getMessage ? { getMessage: params.getMessage } : {},
|
|
373
306
|
...params.cachedGroupMetadata ? { cachedGroupMetadata: params.cachedGroupMetadata } : {}
|
|
374
307
|
});
|
|
375
|
-
this.
|
|
376
|
-
await this.waitForSetupStep(waitForWaConnection(sock, { timeoutMs: this.socketTiming.connectTimeoutMs }));
|
|
377
|
-
this.throwIfSetupStopped();
|
|
308
|
+
await waitForWaConnection(sock, { timeoutMs: this.socketTiming.connectTimeoutMs });
|
|
378
309
|
this.socketRef.current = sock;
|
|
379
310
|
connection = createLiveConnection({
|
|
380
311
|
connectionId: params.connectionId,
|
|
@@ -382,63 +313,24 @@ var WhatsAppConnectionController = class {
|
|
|
382
313
|
listener: {},
|
|
383
314
|
openedAfterRecentInbound: this.isOpeningAfterRecentInbound()
|
|
384
315
|
});
|
|
385
|
-
const
|
|
316
|
+
const listener = await params.createListener({
|
|
386
317
|
sock,
|
|
387
318
|
connection
|
|
388
319
|
});
|
|
389
|
-
let listener;
|
|
390
|
-
try {
|
|
391
|
-
listener = await this.waitForSetupStep(listenerTask);
|
|
392
|
-
} catch (error) {
|
|
393
|
-
if (this.setupAbortController.signal.aborted) listenerTask.then((lateListener) => lateListener.close?.()).catch(() => {});
|
|
394
|
-
throw error;
|
|
395
|
-
}
|
|
396
320
|
connection.listener = listener;
|
|
397
|
-
this.throwIfSetupStopped();
|
|
398
321
|
this.current = connection;
|
|
399
322
|
connection.unregisterTransportActivity = this.attachTransportActivityListener(sock);
|
|
400
|
-
|
|
401
|
-
this.runtimeContextLease = registerChannelRuntimeContext({
|
|
402
|
-
channelRuntime: getWhatsAppChannelRuntime(),
|
|
403
|
-
channelId: "whatsapp",
|
|
404
|
-
accountId: this.accountId,
|
|
405
|
-
capability: WHATSAPP_CONNECTION_CONTROLLER_CAPABILITY,
|
|
406
|
-
context: this,
|
|
407
|
-
abortSignal: this.abortSignal
|
|
408
|
-
});
|
|
409
|
-
previousRuntimeContextLease?.dispose();
|
|
410
|
-
this.pendingOwnerContextLease?.dispose();
|
|
411
|
-
this.pendingOwnerContextLease = null;
|
|
323
|
+
registerWhatsAppConnectionController(this.accountId, this);
|
|
412
324
|
this.startTimers(connection, {
|
|
413
325
|
onHeartbeat: params.onHeartbeat,
|
|
414
326
|
onWatchdogTimeout: params.onWatchdogTimeout
|
|
415
327
|
});
|
|
416
328
|
return connection;
|
|
417
329
|
} catch (err) {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
await connection?.listener.close?.();
|
|
423
|
-
} catch {}
|
|
424
|
-
if (this.socketRef.current === sock) this.socketRef.current = null;
|
|
425
|
-
if (sock) {
|
|
426
|
-
const cleanup = connection ?? {
|
|
427
|
-
sock,
|
|
428
|
-
socketClosed: false
|
|
429
|
-
};
|
|
430
|
-
await this.finishSocketCleanup(cleanup);
|
|
431
|
-
}
|
|
432
|
-
if (connection?.unregisterUnhandled) connection.unregisterUnhandled();
|
|
433
|
-
connection?.unregisterTransportActivity?.();
|
|
434
|
-
}
|
|
435
|
-
} catch (closeError) {
|
|
436
|
-
if (sock && (!connection || this.current !== connection)) this.pendingSocketCleanup = connection ?? {
|
|
437
|
-
sock,
|
|
438
|
-
socketClosed: false
|
|
439
|
-
};
|
|
440
|
-
throw new AggregateError([err, closeError], "WhatsApp connection setup and close failed", { cause: err });
|
|
441
|
-
}
|
|
330
|
+
if (this.socketRef.current === sock) this.socketRef.current = null;
|
|
331
|
+
closeWaSocket(sock);
|
|
332
|
+
if (connection?.unregisterUnhandled) connection.unregisterUnhandled();
|
|
333
|
+
connection?.unregisterTransportActivity?.();
|
|
442
334
|
throw err;
|
|
443
335
|
}
|
|
444
336
|
}
|
|
@@ -531,7 +423,6 @@ var WhatsAppConnectionController = class {
|
|
|
531
423
|
const connection = this.current;
|
|
532
424
|
if (!connection) return;
|
|
533
425
|
this.current = null;
|
|
534
|
-
this.pendingSocketCleanup = connection;
|
|
535
426
|
if (this.socketRef.current === connection.sock) this.socketRef.current = null;
|
|
536
427
|
connection.unregisterUnhandled?.();
|
|
537
428
|
connection.unregisterTransportActivity?.();
|
|
@@ -544,103 +435,15 @@ var WhatsAppConnectionController = class {
|
|
|
544
435
|
try {
|
|
545
436
|
await connection.listener.close?.();
|
|
546
437
|
} catch {}
|
|
547
|
-
|
|
548
|
-
if (this.pendingSocketCleanup === connection) this.pendingSocketCleanup = null;
|
|
438
|
+
closeWaSocket(connection.sock);
|
|
549
439
|
}
|
|
550
440
|
async waitBeforeRetry(delayMs) {
|
|
551
441
|
await this.sleep(delayMs, this.abortSignal);
|
|
552
442
|
}
|
|
553
443
|
async shutdown() {
|
|
554
|
-
this.shuttingDown = true;
|
|
555
|
-
const stoppedError = stoppedControllerError();
|
|
556
|
-
this.ownerAcquireAbortController.abort(stoppedError);
|
|
557
|
-
this.setupAbortController.abort(stoppedError);
|
|
558
444
|
this.stopDisconnectRetries();
|
|
559
|
-
await this.connectionSetupPromise?.catch(() => {});
|
|
560
|
-
await this.connectionOwnerLeasePromise?.catch(() => {});
|
|
561
445
|
await this.closeCurrentConnection();
|
|
562
|
-
|
|
563
|
-
try {
|
|
564
|
-
this.runtimeContextLease?.dispose();
|
|
565
|
-
} finally {
|
|
566
|
-
this.runtimeContextLease = null;
|
|
567
|
-
try {
|
|
568
|
-
this.pendingOwnerContextLease?.dispose();
|
|
569
|
-
} finally {
|
|
570
|
-
this.pendingOwnerContextLease = null;
|
|
571
|
-
if (this.connectionOwnerLease) {
|
|
572
|
-
await this.connectionOwnerLease.release();
|
|
573
|
-
this.connectionOwnerLease = null;
|
|
574
|
-
}
|
|
575
|
-
if (this.retainedOwnerReleaseLease) {
|
|
576
|
-
await this.retainedOwnerReleaseLease.release();
|
|
577
|
-
this.retainedOwnerReleaseLease = null;
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
async finishSocketCleanup(cleanup) {
|
|
583
|
-
if (!cleanup.socketClosed) {
|
|
584
|
-
await closeWhatsAppSocketAndWait(cleanup.sock, "OpenClaw WhatsApp socket close");
|
|
585
|
-
cleanup.socketClosed = true;
|
|
586
|
-
}
|
|
587
|
-
if (await waitForCredsSaveQueueWithTimeout(this.authDir) === "timed_out") throw new Error("WhatsApp credential persistence did not drain before owner release");
|
|
588
|
-
}
|
|
589
|
-
async finishPendingSocketCleanup() {
|
|
590
|
-
const cleanup = this.pendingSocketCleanup;
|
|
591
|
-
if (!cleanup) return;
|
|
592
|
-
await this.finishSocketCleanup(cleanup);
|
|
593
|
-
if (this.pendingSocketCleanup === cleanup) this.pendingSocketCleanup = null;
|
|
594
|
-
}
|
|
595
|
-
throwIfSetupStopped() {
|
|
596
|
-
if (this.shuttingDown || this.setupAbortController.signal.aborted) throw stoppedControllerError();
|
|
597
|
-
}
|
|
598
|
-
async waitForSetupStep(task) {
|
|
599
|
-
this.throwIfSetupStopped();
|
|
600
|
-
const signal = this.setupAbortController.signal;
|
|
601
|
-
let onAbort;
|
|
602
|
-
const aborted = new Promise((_resolve, reject) => {
|
|
603
|
-
onAbort = () => reject(stoppedControllerError());
|
|
604
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
605
|
-
});
|
|
606
|
-
try {
|
|
607
|
-
return await Promise.race([task, aborted]);
|
|
608
|
-
} finally {
|
|
609
|
-
if (onAbort) signal.removeEventListener("abort", onAbort);
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
async ensureConnectionOwnership() {
|
|
613
|
-
if (this.retainedOwnerReleaseLease) {
|
|
614
|
-
await this.retainedOwnerReleaseLease.release();
|
|
615
|
-
this.retainedOwnerReleaseLease = null;
|
|
616
|
-
}
|
|
617
|
-
if (this.connectionOwnerLease) return;
|
|
618
|
-
if (!this.connectionOwnerLeasePromise) this.connectionOwnerLeasePromise = (async () => {
|
|
619
|
-
const ownerLease = await acquireWhatsAppGatewayConnectionOwner(this.authDir, this.ownerAcquireAbortController.signal);
|
|
620
|
-
try {
|
|
621
|
-
if (this.shuttingDown) throw stoppedControllerError();
|
|
622
|
-
this.pendingOwnerContextLease = registerChannelRuntimeContext({
|
|
623
|
-
channelRuntime: getWhatsAppChannelRuntime(),
|
|
624
|
-
channelId: "whatsapp",
|
|
625
|
-
accountId: this.accountId,
|
|
626
|
-
capability: WHATSAPP_CONNECTION_OWNER_PENDING_CAPABILITY,
|
|
627
|
-
context: true,
|
|
628
|
-
abortSignal: this.abortSignal
|
|
629
|
-
});
|
|
630
|
-
this.connectionOwnerLease = ownerLease;
|
|
631
|
-
} catch (error) {
|
|
632
|
-
try {
|
|
633
|
-
await ownerLease.release();
|
|
634
|
-
} catch (releaseError) {
|
|
635
|
-
this.retainedOwnerReleaseLease = ownerLease;
|
|
636
|
-
throw new AggregateError([error, releaseError], "WhatsApp connection ownership setup and release failed", { cause: error });
|
|
637
|
-
}
|
|
638
|
-
throw error;
|
|
639
|
-
}
|
|
640
|
-
})().finally(() => {
|
|
641
|
-
this.connectionOwnerLeasePromise = null;
|
|
642
|
-
});
|
|
643
|
-
await this.connectionOwnerLeasePromise;
|
|
446
|
+
unregisterWhatsAppConnectionController(this.accountId, this);
|
|
644
447
|
}
|
|
645
448
|
startTimers(connection, hooks) {
|
|
646
449
|
if (!this.keepAlive) return;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region extensions/whatsapp/src/connection-controller-registry.ts
|
|
2
|
+
const CONNECTION_REGISTRY_KEY = Symbol.for("openclaw.whatsapp.connectionControllerRegistry");
|
|
3
|
+
function getConnectionRegistryState() {
|
|
4
|
+
const globalState = globalThis;
|
|
5
|
+
const existing = globalState[CONNECTION_REGISTRY_KEY];
|
|
6
|
+
if (existing) return existing;
|
|
7
|
+
const created = { controllers: /* @__PURE__ */ new Map() };
|
|
8
|
+
globalState[CONNECTION_REGISTRY_KEY] = created;
|
|
9
|
+
return created;
|
|
10
|
+
}
|
|
11
|
+
function getRegisteredWhatsAppConnectionController(accountId) {
|
|
12
|
+
return getConnectionRegistryState().controllers.get(accountId) ?? null;
|
|
13
|
+
}
|
|
14
|
+
function registerWhatsAppConnectionController(accountId, controller) {
|
|
15
|
+
getConnectionRegistryState().controllers.set(accountId, controller);
|
|
16
|
+
}
|
|
17
|
+
function unregisterWhatsAppConnectionController(accountId, controller) {
|
|
18
|
+
const controllers = getConnectionRegistryState().controllers;
|
|
19
|
+
if (controllers.get(accountId) === controller) controllers.delete(accountId);
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { registerWhatsAppConnectionController as n, unregisterWhatsAppConnectionController as r, getRegisteredWhatsAppConnectionController as t };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { t as resolveMergedWhatsAppAccountConfig } from "./account-config-6PTOSfaI.mjs";
|
|
3
|
+
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-bVWjgftN.mjs";
|
|
4
|
+
import "./normalize-eddWWsNV.mjs";
|
|
5
|
+
import { listResolvedDirectoryGroupEntriesFromMapKeys, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
6
|
+
//#region extensions/whatsapp/src/directory-config.ts
|
|
7
|
+
var directory_config_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
listWhatsAppDirectoryGroupsFromConfig: () => listWhatsAppDirectoryGroupsFromConfig,
|
|
9
|
+
listWhatsAppDirectoryPeersFromConfig: () => listWhatsAppDirectoryPeersFromConfig
|
|
10
|
+
});
|
|
11
|
+
function resolveWhatsAppDirectoryAccount(cfg, accountId) {
|
|
12
|
+
return resolveMergedWhatsAppAccountConfig({
|
|
13
|
+
cfg,
|
|
14
|
+
accountId
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async function listWhatsAppDirectoryPeersFromConfig(params) {
|
|
18
|
+
return listResolvedDirectoryUserEntriesFromAllowFrom({
|
|
19
|
+
...params,
|
|
20
|
+
resolveAccount: resolveWhatsAppDirectoryAccount,
|
|
21
|
+
resolveAllowFrom: (account) => account.allowFrom,
|
|
22
|
+
normalizeId: (entry) => {
|
|
23
|
+
const normalized = normalizeWhatsAppTarget(entry);
|
|
24
|
+
if (!normalized || isWhatsAppGroupJid(normalized)) return null;
|
|
25
|
+
return normalized;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async function listWhatsAppDirectoryGroupsFromConfig(params) {
|
|
30
|
+
return listResolvedDirectoryGroupEntriesFromMapKeys({
|
|
31
|
+
...params,
|
|
32
|
+
resolveAccount: resolveWhatsAppDirectoryAccount,
|
|
33
|
+
resolveGroups: (account) => account.groups
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { listWhatsAppDirectoryGroupsFromConfig as n, listWhatsAppDirectoryPeersFromConfig as r, directory_config_exports as t };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region extensions/whatsapp/src/doctor.ts
|
|
2
|
+
function normalizeCompatibilityConfig({ cfg }) {
|
|
3
|
+
const legacyAckReaction = cfg.messages?.ackReaction?.trim();
|
|
4
|
+
if (!legacyAckReaction || cfg.channels?.whatsapp === void 0) return {
|
|
5
|
+
config: cfg,
|
|
6
|
+
changes: []
|
|
7
|
+
};
|
|
8
|
+
if (cfg.channels.whatsapp?.ackReaction !== void 0) return {
|
|
9
|
+
config: cfg,
|
|
10
|
+
changes: []
|
|
11
|
+
};
|
|
12
|
+
const legacyScope = cfg.messages?.ackReactionScope ?? "group-mentions";
|
|
13
|
+
let direct = true;
|
|
14
|
+
let group = "mentions";
|
|
15
|
+
if (legacyScope === "all") {
|
|
16
|
+
direct = true;
|
|
17
|
+
group = "always";
|
|
18
|
+
} else if (legacyScope === "direct") {
|
|
19
|
+
direct = true;
|
|
20
|
+
group = "never";
|
|
21
|
+
} else if (legacyScope === "group-all") {
|
|
22
|
+
direct = false;
|
|
23
|
+
group = "always";
|
|
24
|
+
} else if (legacyScope === "group-mentions") {
|
|
25
|
+
direct = false;
|
|
26
|
+
group = "mentions";
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
config: {
|
|
30
|
+
...cfg,
|
|
31
|
+
channels: {
|
|
32
|
+
...cfg.channels,
|
|
33
|
+
whatsapp: {
|
|
34
|
+
...cfg.channels?.whatsapp,
|
|
35
|
+
ackReaction: {
|
|
36
|
+
emoji: legacyAckReaction,
|
|
37
|
+
direct,
|
|
38
|
+
group
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
changes: [`Copied messages.ackReaction → channels.whatsapp.ackReaction (scope: ${legacyScope}).`]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const whatsappDoctor = { normalizeCompatibilityConfig };
|
|
47
|
+
//#endregion
|
|
48
|
+
export { whatsappDoctor as n, normalizeCompatibilityConfig as t };
|
|
@@ -1,37 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "./normalize-C7Hkc_vE.js";
|
|
4
|
-
import { r as jidToE164 } from "./targets-runtime-TMk0lGuy.js";
|
|
5
|
-
import "./text-runtime-CaKLhowd.js";
|
|
6
|
-
import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
7
|
-
import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound";
|
|
1
|
+
import { r as jidToE164 } from "./targets-runtime-C-GiVn6Y.mjs";
|
|
2
|
+
import "./text-runtime-CUrq1mFq.mjs";
|
|
8
3
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
9
|
-
//#region extensions/whatsapp/src/approval-auth.ts
|
|
10
|
-
function normalizeWhatsAppApproverId(value) {
|
|
11
|
-
const normalized = normalizeWhatsAppTarget(String(value));
|
|
12
|
-
if (!normalized || normalized.endsWith("@g.us")) return;
|
|
13
|
-
return normalized;
|
|
14
|
-
}
|
|
15
|
-
function normalizeWhatsAppApproverEntry(value) {
|
|
16
|
-
return String(value).trim() === "*" ? "*" : normalizeWhatsAppApproverId(value);
|
|
17
|
-
}
|
|
18
|
-
const whatsappApproval = createChannelApprovalAuth({
|
|
19
|
-
channelLabel: "WhatsApp",
|
|
20
|
-
resolveInputs: ({ cfg, accountId }) => {
|
|
21
|
-
return { allowFrom: resolveWhatsAppAccount({
|
|
22
|
-
cfg,
|
|
23
|
-
accountId
|
|
24
|
-
}).allowFrom };
|
|
25
|
-
},
|
|
26
|
-
normalizeApprover: normalizeWhatsAppApproverEntry,
|
|
27
|
-
normalizeSenderId: normalizeWhatsAppApproverId,
|
|
28
|
-
isWildcardAuthorized: ({ purpose, approvers }) => purpose === "action" && approvers.includes("*")
|
|
29
|
-
});
|
|
30
|
-
const getWhatsAppApprovalApprovers = whatsappApproval.resolveApprovers;
|
|
31
|
-
const whatsappApprovalAuth = whatsappApproval.approvalAuth;
|
|
32
|
-
//#endregion
|
|
33
4
|
//#region extensions/whatsapp/src/quoted-message.ts
|
|
34
|
-
const CACHE_TTL_MS =
|
|
5
|
+
const CACHE_TTL_MS = 6e5;
|
|
35
6
|
const MAX_ENTRIES = 500;
|
|
36
7
|
const cache = /* @__PURE__ */ new Map();
|
|
37
8
|
function makeCacheKey(accountId, remoteJid, messageId) {
|
|
@@ -60,7 +31,6 @@ function lookupInboundMessageMeta(accountId, remoteJid, messageId) {
|
|
|
60
31
|
participant: entry.participant,
|
|
61
32
|
participantE164: entry.participantE164,
|
|
62
33
|
body: entry.body,
|
|
63
|
-
media: entry.media,
|
|
64
34
|
fromMe: entry.fromMe
|
|
65
35
|
};
|
|
66
36
|
}
|
|
@@ -98,7 +68,6 @@ function lookupInboundMessageMetaForTarget(accountId, targetJid, messageId) {
|
|
|
98
68
|
participant: exact.participant,
|
|
99
69
|
participantE164: exact.participantE164,
|
|
100
70
|
body: exact.body,
|
|
101
|
-
media: exact.media,
|
|
102
71
|
fromMe: exact.fromMe
|
|
103
72
|
};
|
|
104
73
|
const prefix = `${accountId}:`;
|
|
@@ -115,7 +84,6 @@ function lookupInboundMessageMetaForTarget(accountId, targetJid, messageId) {
|
|
|
115
84
|
participant: entry.participant,
|
|
116
85
|
participantE164: entry.participantE164,
|
|
117
86
|
body: entry.body,
|
|
118
|
-
media: entry.media,
|
|
119
87
|
fromMe: entry.fromMe
|
|
120
88
|
};
|
|
121
89
|
if (!matchesQuotedConversationTarget(targetJid, candidate)) continue;
|
|
@@ -128,7 +96,6 @@ function buildQuotedMessageOptions(params) {
|
|
|
128
96
|
const id = params.messageId?.trim();
|
|
129
97
|
const remoteJid = params.remoteJid?.trim();
|
|
130
98
|
if (!id || !remoteJid) return;
|
|
131
|
-
const previewText = [params.messageText, formatMediaPlaceholderText(params.media ? [params.media] : [])].filter(Boolean).join("\n");
|
|
132
99
|
return { quoted: {
|
|
133
100
|
key: {
|
|
134
101
|
remoteJid,
|
|
@@ -136,7 +103,7 @@ function buildQuotedMessageOptions(params) {
|
|
|
136
103
|
fromMe: params.fromMe ?? false,
|
|
137
104
|
participant: params.participant
|
|
138
105
|
},
|
|
139
|
-
message: { conversation:
|
|
106
|
+
message: { conversation: params.messageText ?? "" }
|
|
140
107
|
} };
|
|
141
108
|
}
|
|
142
109
|
//#endregion
|
|
@@ -167,4 +134,4 @@ function resolveWhatsAppGroupSessionRoute(route) {
|
|
|
167
134
|
};
|
|
168
135
|
}
|
|
169
136
|
//#endregion
|
|
170
|
-
export { cacheInboundMessageMeta as a,
|
|
137
|
+
export { cacheInboundMessageMeta as a, buildQuotedMessageOptions as i, resolveWhatsAppGroupSessionRoute as n, lookupInboundMessageMeta as o, resolveWhatsAppLegacyGroupSessionKey as r, lookupInboundMessageMetaForTarget as s, resolveWhatsAppGroupSessionKey as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as jidToE164 } from "./targets-runtime-
|
|
2
|
-
import {
|
|
1
|
+
import { r as jidToE164 } from "./targets-runtime-C-GiVn6Y.mjs";
|
|
2
|
+
import { n as normalizeE164 } from "./text-runtime-CUrq1mFq.mjs";
|
|
3
3
|
//#region extensions/whatsapp/src/identity.ts
|
|
4
4
|
const WHATSAPP_LID_RE = /@(lid|hosted\.lid)$/i;
|
|
5
5
|
function normalizeDeviceScopedJid(jid) {
|