@openclaw/whatsapp 2026.9.5 → 2026.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icon.png +0 -0
- package/dist/.setup/{accounts-D_NGDjCx.mjs → accounts-CtRPAQCL.mjs} +3 -9
- package/dist/.setup/{action-runtime-DZZFamfl.mjs → action-runtime-DeVk5V7r.mjs} +2 -2
- package/dist/.setup/{agent-tools-login-B6MAs75N.mjs → agent-tools-login-CL5C1rA2.mjs} +5 -1
- package/dist/.setup/{approval-handler.runtime-C0hzmMSj.mjs → approval-handler.runtime-CjqMlPOX.mjs} +6 -26
- package/dist/.setup/{approval-reactions-BnXw-UZI.mjs → approval-reactions-DiOFvb1s.mjs} +8 -14
- package/dist/.setup/{auth-store-Dh8a3cba.mjs → auth-store-BBonwKks.mjs} +9 -33
- package/dist/.setup/{channel-CSclZYjU.mjs → channel-CJFE0kD_.mjs} +82 -154
- package/dist/.setup/{channel-react-action-1iBiEnq7.mjs → channel-react-action-2r_hjLZV.mjs} +4 -8
- package/dist/.setup/{channel.runtime-ddGY37w8.mjs → channel.runtime-C94goLw9.mjs} +4 -4
- package/dist/.setup/{channel.setup-CqUl8COe.mjs → channel.setup-CfN1UfdY.mjs} +1 -1
- package/dist/.setup/{connection-controller-C60mU7j7.mjs → connection-controller-CHo1oRJA.mjs} +13 -63
- package/dist/.setup/{creds-files-Drg3usj1.mjs → creds-files-CDATZWWM.mjs} +5 -11
- package/dist/.setup/{directory-config-BHPoBklt.mjs → directory-config-DUiJ5d8I.mjs} +13 -14
- package/dist/.setup/doctor-iMwg0Vhr.mjs +222 -0
- package/dist/.setup/group-config-path-DZr3ucUO.mjs +40 -0
- package/dist/.setup/{group-session-key-D22hYMdE.mjs → group-session-key-2-mja4OF.mjs} +3 -9
- package/dist/.setup/{login-2dmd1TfE.mjs → login-BFlvSh9h.mjs} +9 -11
- package/dist/.setup/{login-qr-CgKtO_ef.mjs → login-qr-Ayb8i25J.mjs} +29 -77
- package/dist/.setup/{monitor-BblvzLpX.mjs → monitor-CGpV2VNN.mjs} +391 -509
- package/dist/.setup/{question-reactions-D3Zq9Gbn.mjs → question-reactions-CPyyi5AY.mjs} +2 -2
- package/dist/.setup/rolldown-runtime-BBjsoOtd.mjs +27 -0
- package/dist/.setup/{send-C6jDmcL9.mjs → send-BGdvf5cC.mjs} +31 -80
- package/dist/.setup/{send-api-B4DOt2RJ.mjs → send-api-H4AkQJjT.mjs} +45 -109
- package/dist/.setup/{session-errors-JuazczrA.mjs → session-errors-B8UcAnZN.mjs} +1 -4
- package/dist/.setup/{session.runtime-DcJuO42v.mjs → session.runtime-st1konFI.mjs} +1 -1
- package/dist/.setup/{setup-finalize-BYEgU0hb.mjs → setup-finalize-DmPX4EaW.mjs} +32 -70
- package/dist/.setup/setup-plugin-api-vJlxKzca.mjs +3 -0
- package/dist/.setup/{setup-surface-Cd3wN5HD.mjs → setup-surface-43fj197P.mjs} +3 -3
- package/dist/.setup/{shared-C9OEtKgc.mjs → shared-DgOG5Iqr.mjs} +26 -37
- package/dist/.setup/{socket-close-CCVSFufF.mjs → socket-close-CT__V2fz.mjs} +80 -92
- package/dist/.setup/{targets-runtime-RBjx3pg_.mjs → targets-runtime-DmiqXIXO.mjs} +2 -7
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/agent-tools-api.js +6 -13
- package/dist/api.js +10 -10
- package/dist/auth-presence.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +9 -10
- package/dist/light-runtime-api.js +3 -3
- package/dist/login-qr-runtime.js +1 -1
- package/dist/runtime-api.js +10 -10
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/audio-decode/LICENSE +9 -10
- package/node_modules/audio-decode/README.md +16 -0
- package/node_modules/audio-decode/audio-decode.d.ts +2 -14
- package/node_modules/audio-decode/audio-decode.js +4 -92
- package/node_modules/audio-decode/meta.js +1 -0
- package/node_modules/audio-decode/node_modules/{audio-buffer → @audio/decode}/LICENSE +1 -1
- package/node_modules/audio-decode/node_modules/@audio/decode/audio-decode.d.ts +52 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/audio-decode.js +242 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/meta.js +14 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/package.json +114 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/readme.md +191 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/stream.d.ts +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/stream.js +1 -0
- package/node_modules/audio-decode/node_modules/@audio/decode/test.html +52 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/LICENSE +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/README.md +80 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/alac.js +326 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/decode-aac.d.ts +24 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/decode-aac.js +452 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/meta.js +81 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/package.json +63 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aac/src/aac.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/LICENSE +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/LICENSE.liba52 +340 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/README.md +41 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/decode-ac3.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/decode-ac3.js +131 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/package.json +64 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-ac3/src/ac3.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/README.md +46 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/decode-aiff.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/decode-aiff.js +583 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-aiff/package.json +52 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/LICENSE +191 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/README.md +65 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/decode-amr.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/decode-amr.js +150 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/package.json +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-amr/src/amr.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/README.md +53 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/decode-avi.d.ts +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/decode-avi.js +241 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-avi/package.json +66 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/README.md +48 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/decode-caf.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/decode-caf.js +238 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-caf/package.json +53 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/README.md +73 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/audio.d.ts +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/audio.js +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/decode-dsd.d.ts +29 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/decode-dsd.js +423 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/meta.js +40 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dsd/package.json +64 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/LICENSE +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/LICENSE.libdca +339 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/README.md +41 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/decode-dts.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/decode-dts.js +139 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/package.json +64 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-dts/src/dts.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/LICENSE +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/LICENSE.ffmpeg +502 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/README.md +45 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/decode-eac3.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/decode-eac3.js +124 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/package.json +68 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-eac3/src/eac3.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/README.md +23 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/decode-flac.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/decode-flac.js +3172 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/meta.js +115 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-flac/package.json +60 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/LICENSE +23 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/LICENSE.libopenmpt +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/README.md +86 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/audio.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/audio.js +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/decode-mod.d.ts +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/decode-mod.js +148 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/package.json +68 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mod/src/mod.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/README.md +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/decode-mp3.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/decode-mp3.js +793 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/meta.js +143 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp3/package.json +60 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/README.md +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/decode-mp4.d.ts +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/decode-mp4.js +455 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mp4/package.json +74 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/LICENSE +31 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/LICENSE.libmpcdec +31 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/README.md +60 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/decode-mpc.d.ts +20 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/decode-mpc.js +158 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/package.json +64 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-mpc/src/mpc.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/LICENSE.libopus +44 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/README.md +32 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/core.d.ts +33 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/core.js +147 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/decode-opus.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/decode-opus.js +1 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/meta.js +103 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/package.json +68 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/src/decode-opus.js +2 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-opus/src/opus.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/README.md +19 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/decode-qoa.d.ts +16 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/decode-qoa.js +275 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-qoa/package.json +56 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/LICENSE.ttadec +39 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/README.md +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/decode-tta.d.ts +17 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/decode-tta.js +302 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-tta/package.json +58 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/LICENSE +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/README.md +33 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/decode-vorbis.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/decode-vorbis.js +2984 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/meta.js +102 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-vorbis/package.json +60 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/README.md +23 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/decode-wav.d.ts +8 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/decode-wav.js +256 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/meta.js +114 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wav/package.json +52 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/LICENSE +29 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/LICENSE.wavpack +25 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/README.md +41 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/audio.js +9 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/decode-wavpack.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/decode-wavpack.js +140 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/package.json +62 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wavpack/src/wavpack.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/LICENSE +21 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/LICENSE.libopus +44 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/README.md +59 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/decode-webm.d.ts +18 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/decode-webm.js +141 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/package.json +76 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-webm/src/opus.wasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/LICENSE +12 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/README.md +74 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/audio.d.ts +15 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/audio.js +10 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/decode-wma.d.ts +33 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/decode-wma.js +516 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/package.json +57 -0
- package/node_modules/audio-decode/node_modules/@audio/decode-wma/src/wma.wasm.js +0 -0
- package/node_modules/audio-decode/package.json +37 -39
- package/node_modules/audio-decode/stream.d.ts +2 -0
- package/node_modules/audio-decode/stream.js +2 -0
- package/node_modules/baileys/lib/Utils/messages-media.js +1 -1
- package/node_modules/baileys/node_modules/file-type/package.json +3 -2
- package/node_modules/baileys/node_modules/file-type/readme.md +5 -0
- package/node_modules/baileys/node_modules/file-type/source/detectors/zip.js +9 -4
- package/node_modules/baileys/node_modules/file-type/source/index.js +28 -1
- package/node_modules/baileys/node_modules/file-type/source/supported.js +2 -0
- package/node_modules/baileys/node_modules/p-timeout/index.js +3 -0
- package/node_modules/baileys/node_modules/p-timeout/package.json +1 -1
- package/node_modules/baileys/package.json +1 -1
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/package.json +6 -6
- package/dist/.setup/doctor-BPb-SjdE.mjs +0 -65
- package/dist/.setup/group-config-path-BGyzT9Lg.mjs +0 -54
- package/dist/.setup/normalize-DdsROMMa.mjs +0 -2
- package/dist/.setup/rolldown-runtime-D7D4PA-g.mjs +0 -13
- package/dist/.setup/runtime-group-policy-DeSRFXEV.mjs +0 -11
- package/dist/.setup/setup-plugin-api-CXfU-7vN.mjs +0 -3
- package/dist/.setup/text-runtime-CHl0iPYe.mjs +0 -4
- package/node_modules/audio-decode/.eslintrc.json +0 -43
- package/node_modules/audio-decode/.github/workflows/test.js.yml +0 -31
- package/node_modules/audio-decode/.travis.yml +0 -13
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/README.md +0 -293
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/dist/opus-ml-decoder.min.js +0 -11646
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/dist/opus-ml-decoder.min.js.map +0 -1
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/index.js +0 -8
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/package.json +0 -58
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/EmscriptenWasm.js +0 -0
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/OpusMLDecoder.js +0 -253
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/src/OpusMLDecoderWebWorker.js +0 -17
- package/node_modules/audio-decode/node_modules/@wasm-audio-decoders/opus-ml/types.d.ts +0 -77
- package/node_modules/audio-decode/node_modules/audio-buffer/.eslintrc.json +0 -44
- package/node_modules/audio-decode/node_modules/audio-buffer/.github/workflows/node.js.yml +0 -31
- package/node_modules/audio-decode/node_modules/audio-buffer/.travis.yml +0 -7
- package/node_modules/audio-decode/node_modules/audio-buffer/index.js +0 -76
- package/node_modules/audio-decode/node_modules/audio-buffer/package.json +0 -37
- package/node_modules/audio-decode/node_modules/audio-buffer/readme.md +0 -56
- package/node_modules/audio-decode/node_modules/node-wav/README.md +0 -35
- package/node_modules/audio-decode/node_modules/node-wav/file.wav +0 -0
- package/node_modules/audio-decode/node_modules/node-wav/index.js +0 -291
- package/node_modules/audio-decode/node_modules/node-wav/package.json +0 -29
- package/node_modules/audio-decode/node_modules/node-wav/tests/file1.wav +0 -0
- package/node_modules/audio-decode/node_modules/node-wav/tests/test.js +0 -66
- package/node_modules/audio-decode/node_modules/node-wav/x.js +0 -12
- package/node_modules/audio-decode/node_modules/node-wav/x.json +0 -86702
- package/node_modules/audio-decode/node_modules/node-wav/x.js~ +0 -13
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/README.md +0 -320
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.min.js +0 -232
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.min.js.map +0 -1
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.opus-ml.min.js +0 -0
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/dist/ogg-opus-decoder.opus-ml.min.js.map +0 -1
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/index.js +0 -8
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/package.json +0 -74
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/src/OggOpusDecoder.js +0 -226
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/src/OggOpusDecoderWebWorker.js +0 -17
- package/node_modules/audio-decode/node_modules/ogg-opus-decoder/types.d.ts +0 -37
- package/node_modules/audio-decode/node_modules/opus-decoder/README.md +0 -265
- package/node_modules/audio-decode/node_modules/opus-decoder/dist/opus-decoder.min.js +0 -232
- package/node_modules/audio-decode/node_modules/opus-decoder/dist/opus-decoder.min.js.map +0 -1
- package/node_modules/audio-decode/node_modules/opus-decoder/index.js +0 -8
- package/node_modules/audio-decode/node_modules/opus-decoder/package.json +0 -56
- package/node_modules/audio-decode/node_modules/opus-decoder/src/EmscriptenWasm.js +0 -0
- package/node_modules/audio-decode/node_modules/opus-decoder/src/OpusDecoder.js +0 -239
- package/node_modules/audio-decode/node_modules/opus-decoder/src/OpusDecoderWebWorker.js +0 -17
- package/node_modules/audio-decode/node_modules/opus-decoder/types.d.ts +0 -74
- package/node_modules/audio-decode/readme.md +0 -49
- package/node_modules/audio-decode/tea.yaml +0 -6
- package/node_modules/audio-decode/test-case.js +0 -11
- package/node_modules/audio-decode/test.html +0 -15
- package/node_modules/audio-decode/test.js +0 -107
- /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { c as resolveMergedWhatsAppAccountConfig, o as resolveWhatsAppAuthDir } from "./accounts-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.mjs";
|
|
2
|
+
import { c as resolveMergedWhatsAppAccountConfig, o as resolveWhatsAppAuthDir } from "./accounts-CtRPAQCL.mjs";
|
|
3
3
|
import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-BGra1ZnM.mjs";
|
|
4
4
|
import { i as hasPendingWhatsAppConnectionOwner, r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-hgLJoRc8.mjs";
|
|
5
|
-
import "./
|
|
6
|
-
import { M as waitForCredsSaveQueueWithTimeout, f as readWebAuthExistsForDecision } from "./auth-store-Dh8a3cba.mjs";
|
|
5
|
+
import { M as waitForCredsSaveQueueWithTimeout, f as readWebAuthExistsForDecision } from "./auth-store-BBonwKks.mjs";
|
|
7
6
|
import { n as resolveWebAccountId } from "./active-listener-CDjoX9QR.mjs";
|
|
8
|
-
import {
|
|
7
|
+
import { b as acquireWhatsAppStandaloneConnectionOwner, i as waitForWaConnection, n as createWaDirectorySocket, t as closeWhatsAppSocketAndWait, v as WhatsAppConnectionOwnerBusyError } from "./socket-close-CT__V2fz.mjs";
|
|
9
8
|
import { listResolvedDirectoryGroupEntriesFromMapKeys, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
10
9
|
//#region extensions/whatsapp/src/directory-config.ts
|
|
11
10
|
var directory_config_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -15,16 +14,13 @@ var directory_config_exports = /* @__PURE__ */ __exportAll({
|
|
|
15
14
|
listWhatsAppDirectoryGroupsLive: () => listWhatsAppDirectoryGroupsLive,
|
|
16
15
|
listWhatsAppDirectoryPeersFromConfig: () => listWhatsAppDirectoryPeersFromConfig
|
|
17
16
|
});
|
|
18
|
-
function resolveWhatsAppDirectoryAccount(cfg, accountId) {
|
|
19
|
-
return resolveMergedWhatsAppAccountConfig({
|
|
20
|
-
cfg,
|
|
21
|
-
accountId
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
17
|
async function listWhatsAppDirectoryPeersFromConfig(params) {
|
|
25
18
|
return listResolvedDirectoryUserEntriesFromAllowFrom({
|
|
26
19
|
...params,
|
|
27
|
-
resolveAccount:
|
|
20
|
+
resolveAccount: (cfg, accountId) => resolveMergedWhatsAppAccountConfig({
|
|
21
|
+
cfg,
|
|
22
|
+
accountId
|
|
23
|
+
}),
|
|
28
24
|
resolveAllowFrom: (account) => account.allowFrom,
|
|
29
25
|
normalizeId: (entry) => {
|
|
30
26
|
const normalized = normalizeWhatsAppTarget(entry);
|
|
@@ -36,7 +32,10 @@ async function listWhatsAppDirectoryPeersFromConfig(params) {
|
|
|
36
32
|
async function listWhatsAppDirectoryGroupsFromConfig(params) {
|
|
37
33
|
return listResolvedDirectoryGroupEntriesFromMapKeys({
|
|
38
34
|
...params,
|
|
39
|
-
resolveAccount:
|
|
35
|
+
resolveAccount: (cfg, accountId) => resolveMergedWhatsAppAccountConfig({
|
|
36
|
+
cfg,
|
|
37
|
+
accountId
|
|
38
|
+
}),
|
|
40
39
|
resolveGroups: (account) => account.groups
|
|
41
40
|
});
|
|
42
41
|
}
|
|
@@ -127,7 +126,7 @@ async function finishPriorStandaloneCleanup(authDir) {
|
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
128
|
async function listGroupsThroughStandaloneOwner(params) {
|
|
130
|
-
const account =
|
|
129
|
+
const account = resolveMergedWhatsAppAccountConfig(params);
|
|
131
130
|
const authDir = resolveWhatsAppAuthDir({
|
|
132
131
|
cfg: params.cfg,
|
|
133
132
|
accountId: account.accountId
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-BBjsoOtd.mjs";
|
|
2
|
+
//#region packages/normalization-core/src/record-coerce.ts
|
|
3
|
+
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6
|
+
}
|
|
7
|
+
/** Returns a non-array record or null. */
|
|
8
|
+
function asNullableRecord(value) {
|
|
9
|
+
return isRecord(value) ? value : null;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/config/channel-config-normalization.ts
|
|
13
|
+
/** Applies one channel-specific doctor migration to every object-shaped account. */
|
|
14
|
+
function normalizeChannelAccounts(params) {
|
|
15
|
+
const rawAccounts = asNullableRecord(params.entry.accounts);
|
|
16
|
+
if (!rawAccounts) return {
|
|
17
|
+
entry: params.entry,
|
|
18
|
+
changed: false
|
|
19
|
+
};
|
|
20
|
+
let changed = false;
|
|
21
|
+
const accounts = { ...rawAccounts };
|
|
22
|
+
for (const [accountId, value] of Object.entries(rawAccounts)) {
|
|
23
|
+
const account = asNullableRecord(value);
|
|
24
|
+
if (!account) continue;
|
|
25
|
+
const normalized = params.normalizeAccount({
|
|
26
|
+
account,
|
|
27
|
+
accountId,
|
|
28
|
+
pathPrefix: `${params.pathPrefix}.accounts.${accountId}`,
|
|
29
|
+
changes: params.changes
|
|
30
|
+
});
|
|
31
|
+
if (normalized.changed) {
|
|
32
|
+
accounts[accountId] = normalized.entry;
|
|
33
|
+
changed = true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return changed ? {
|
|
37
|
+
entry: {
|
|
38
|
+
...params.entry,
|
|
39
|
+
accounts
|
|
40
|
+
},
|
|
41
|
+
changed: true
|
|
42
|
+
} : {
|
|
43
|
+
entry: params.entry,
|
|
44
|
+
changed: false
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** Applies the same channel-specific doctor migration at root and account scope. */
|
|
48
|
+
function normalizeChannelConfigEntries(params) {
|
|
49
|
+
const changes = params.changes ?? [];
|
|
50
|
+
const channels = params.cfg.channels;
|
|
51
|
+
const entry = asNullableRecord(channels?.[params.channelId]);
|
|
52
|
+
if (!entry) return {
|
|
53
|
+
config: params.cfg,
|
|
54
|
+
changes
|
|
55
|
+
};
|
|
56
|
+
const channelPath = `channels.${params.channelId}`;
|
|
57
|
+
const root = params.normalizeEntry({
|
|
58
|
+
entry,
|
|
59
|
+
pathPrefix: channelPath,
|
|
60
|
+
changes
|
|
61
|
+
});
|
|
62
|
+
const accounts = normalizeChannelAccounts({
|
|
63
|
+
entry: root.entry,
|
|
64
|
+
pathPrefix: channelPath,
|
|
65
|
+
changes,
|
|
66
|
+
normalizeAccount: (accountParams) => params.normalizeEntry({
|
|
67
|
+
entry: accountParams.account,
|
|
68
|
+
accountId: accountParams.accountId,
|
|
69
|
+
pathPrefix: accountParams.pathPrefix,
|
|
70
|
+
changes: accountParams.changes
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
if (!root.changed && !accounts.changed) return {
|
|
74
|
+
config: params.cfg,
|
|
75
|
+
changes
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
config: {
|
|
79
|
+
...params.cfg,
|
|
80
|
+
channels: {
|
|
81
|
+
...channels,
|
|
82
|
+
[params.channelId]: accounts.entry
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
changes
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
90
|
+
/** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
|
|
91
|
+
function createLegacyWebhookListenerDoctorContract(params) {
|
|
92
|
+
const portKey = params.portKey ?? "webhookPort";
|
|
93
|
+
const hostKey = params.hostKey === void 0 ? "webhookHost" : params.hostKey;
|
|
94
|
+
const source = (entry) => params.webhookKey ? asNullableRecord(entry[params.webhookKey]) : entry;
|
|
95
|
+
const hasLegacy = (value) => {
|
|
96
|
+
const entry = asNullableRecord(value);
|
|
97
|
+
const listener = entry && source(entry);
|
|
98
|
+
return Boolean(listener && (Object.hasOwn(listener, portKey) || hostKey && Object.hasOwn(listener, hostKey)));
|
|
99
|
+
};
|
|
100
|
+
const prefix = `channels.${params.channelKey}`;
|
|
101
|
+
return {
|
|
102
|
+
legacyConfigRules: [{
|
|
103
|
+
path: ["channels", params.channelKey],
|
|
104
|
+
message: `${prefix} webhook listeners moved to Gateway routes. Run "openclaw doctor --fix" to preserve explicitly configured listener settings as legacyWebhook.`,
|
|
105
|
+
match: (value) => {
|
|
106
|
+
const accounts = asNullableRecord(asNullableRecord(value)?.accounts);
|
|
107
|
+
return hasLegacy(value) || Object.values(accounts ?? {}).some(hasLegacy);
|
|
108
|
+
}
|
|
109
|
+
}],
|
|
110
|
+
normalizeCompatibilityConfig: ({ cfg }) => {
|
|
111
|
+
const root = asNullableRecord(asNullableRecord(cfg.channels)?.[params.channelKey]);
|
|
112
|
+
const inherited = root && source(root);
|
|
113
|
+
const canonicalRoot = asNullableRecord(root?.legacyWebhook);
|
|
114
|
+
return normalizeChannelConfigEntries({
|
|
115
|
+
cfg,
|
|
116
|
+
channelId: params.channelKey,
|
|
117
|
+
normalizeEntry: ({ entry, accountId, pathPrefix, changes }) => {
|
|
118
|
+
const listener = source(entry);
|
|
119
|
+
if (!listener || !hasLegacy(entry)) return {
|
|
120
|
+
entry,
|
|
121
|
+
changed: false
|
|
122
|
+
};
|
|
123
|
+
const next = { ...entry };
|
|
124
|
+
const port = Object.hasOwn(listener, portKey) ? listener[portKey] : (accountId ? canonicalRoot?.port ?? inherited?.[portKey] : void 0) ?? params.defaultPort;
|
|
125
|
+
const inheritedHost = accountId ? canonicalRoot ? canonicalRoot.host : (hostKey ? inherited?.[hostKey] : void 0) ?? params.defaultHost : params.defaultHost;
|
|
126
|
+
const host = hostKey ? listener[hostKey] ?? inheritedHost : inheritedHost;
|
|
127
|
+
const legacyPath = [pathPrefix, params.webhookKey].filter(Boolean).join(".");
|
|
128
|
+
if (Object.hasOwn(entry, "legacyWebhook")) changes.push(`Removed ${legacyPath} legacy listener keys; ${pathPrefix}.legacyWebhook is already configured.`);
|
|
129
|
+
else if (accountId && root?.legacyWebhook === false) changes.push(`Removed ${legacyPath} legacy listener keys; ${prefix}.legacyWebhook: false keeps this account's inherited listener disabled.`);
|
|
130
|
+
else {
|
|
131
|
+
next.legacyWebhook = {
|
|
132
|
+
port,
|
|
133
|
+
...host !== void 0 ? { host } : {}
|
|
134
|
+
};
|
|
135
|
+
changes.push(`Moved ${legacyPath} listener settings to ${pathPrefix}.legacyWebhook. Point the external callback or reverse proxy at the Gateway port and webhook path, verify delivery, then set legacyWebhook: false to disable legacy forwarding.`);
|
|
136
|
+
}
|
|
137
|
+
const updated = params.webhookKey ? { ...listener } : next;
|
|
138
|
+
delete updated[portKey];
|
|
139
|
+
if (hostKey) delete updated[hostKey];
|
|
140
|
+
if (params.webhookKey) {
|
|
141
|
+
if (Object.keys(updated).length) next[params.webhookKey] = updated;
|
|
142
|
+
else delete next[params.webhookKey];
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
entry: next,
|
|
146
|
+
changed: true
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
155
|
+
var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
|
|
156
|
+
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
157
|
+
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region extensions/whatsapp/src/doctor.ts
|
|
160
|
+
function resolveLegacyAckScope(ack) {
|
|
161
|
+
const direct = ack.direct !== false;
|
|
162
|
+
const group = ack.group ?? "mentions";
|
|
163
|
+
if (direct) return group === "always" ? "all" : group === "never" ? "direct" : void 0;
|
|
164
|
+
return group === "always" ? "group-all" : group === "mentions" ? "group-mentions" : group === "never" ? "off" : void 0;
|
|
165
|
+
}
|
|
166
|
+
function resolveDefaultAgentEmoji(cfg) {
|
|
167
|
+
const entries = (0, runtime_doctor_migrations_exports.asObjectRecord)((0, runtime_doctor_migrations_exports.asObjectRecord)(cfg.agents)?.entries);
|
|
168
|
+
const agents = entries ? Object.values(entries).flatMap((value) => {
|
|
169
|
+
const entry = (0, runtime_doctor_migrations_exports.asObjectRecord)(value);
|
|
170
|
+
return entry ? [entry] : [];
|
|
171
|
+
}) : [];
|
|
172
|
+
const agent = agents.find((entry) => entry.default === true) ?? agents[0];
|
|
173
|
+
const emoji = (0, runtime_doctor_migrations_exports.asObjectRecord)(agent?.identity)?.emoji;
|
|
174
|
+
return typeof emoji === "string" ? emoji : void 0;
|
|
175
|
+
}
|
|
176
|
+
function normalizeCompatibilityConfig({ cfg }) {
|
|
177
|
+
const changes = [];
|
|
178
|
+
const sources = [];
|
|
179
|
+
for (const scope of (0, runtime_doctor_migrations_exports.collectChannelAccountScopes)({
|
|
180
|
+
cfg,
|
|
181
|
+
channelId: "whatsapp"
|
|
182
|
+
})) {
|
|
183
|
+
const ack = (0, runtime_doctor_migrations_exports.asObjectRecord)(scope.account.ackReaction);
|
|
184
|
+
if (!ack) continue;
|
|
185
|
+
sources.push({
|
|
186
|
+
path: `${scope.prefix}.ackReaction`,
|
|
187
|
+
account: scope.account,
|
|
188
|
+
...typeof ack.emoji === "string" ? { emoji: ack.emoji } : {},
|
|
189
|
+
scope: resolveLegacyAckScope(ack),
|
|
190
|
+
unrepresentableScope: ack.direct !== false && (ack.group ?? "mentions") === "mentions"
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (sources.length === 0) return {
|
|
194
|
+
config: cfg,
|
|
195
|
+
changes
|
|
196
|
+
};
|
|
197
|
+
const messages = cfg.messages ??= {};
|
|
198
|
+
const identityEmoji = resolveDefaultAgentEmoji(cfg) ?? "👀";
|
|
199
|
+
for (const source of sources) {
|
|
200
|
+
messages.ackReaction ??= source.emoji ?? identityEmoji;
|
|
201
|
+
messages.ackReactionScope ??= source.scope;
|
|
202
|
+
delete source.account.ackReaction;
|
|
203
|
+
changes.push(`Moved translatable ${source.path} settings to messages ack settings.`);
|
|
204
|
+
}
|
|
205
|
+
const finalEmoji = messages.ackReaction.trim();
|
|
206
|
+
const finalScope = messages.ackReactionScope ?? "group-mentions";
|
|
207
|
+
const comparableFinalScope = finalScope === "none" ? "off" : finalScope;
|
|
208
|
+
for (const source of sources) {
|
|
209
|
+
const sourceEmoji = source.emoji?.trim();
|
|
210
|
+
if (source.emoji === void 0) changes.push(`${source.path} used a route-dependent agent identity acknowledgement emoji before migration; the final messages.ackReaction is ${JSON.stringify(finalEmoji)}. Review messages.ackReaction.`);
|
|
211
|
+
else if (sourceEmoji !== finalEmoji) changes.push(`${source.path} requested acknowledgement emoji ${JSON.stringify(sourceEmoji)}, but the final messages.ackReaction is ${JSON.stringify(finalEmoji)}. Review messages.ackReaction.`);
|
|
212
|
+
if (source.unrepresentableScope) changes.push(`${source.path} migration cannot preserve both direct-message and mentioned-group acknowledgements; the final messages.ackReactionScope is ${JSON.stringify(finalScope)}. Review messages.ackReactionScope.`);
|
|
213
|
+
else if (source.scope && source.scope !== comparableFinalScope) changes.push(`${source.path} requested acknowledgement scope ${JSON.stringify(source.scope)}, but the final messages.ackReactionScope is ${JSON.stringify(finalScope)}. Review messages.ackReactionScope.`);
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
config: cfg,
|
|
217
|
+
changes
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const whatsappDoctor = { normalizeCompatibilityConfig };
|
|
221
|
+
//#endregion
|
|
222
|
+
export { whatsappDoctor as n, runtime_doctor_migrations_exports as r, normalizeCompatibilityConfig as t };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-core";
|
|
2
|
+
//#region extensions/whatsapp/src/group-config-path.ts
|
|
3
|
+
const WHATSAPP_GROUP_SCOPE_FIELDS = [
|
|
4
|
+
"groupPolicy",
|
|
5
|
+
"groupAllowFrom",
|
|
6
|
+
"groups"
|
|
7
|
+
];
|
|
8
|
+
function resolveWhatsAppAccountKey(accounts, accountId) {
|
|
9
|
+
if (!accounts) return;
|
|
10
|
+
if (Object.hasOwn(accounts, accountId)) return accountId;
|
|
11
|
+
const normalizedAccountId = accountId.trim().toLowerCase();
|
|
12
|
+
return Object.keys(accounts).find((key) => key.trim().toLowerCase() === normalizedAccountId);
|
|
13
|
+
}
|
|
14
|
+
function normalizePathAccountId(accountId) {
|
|
15
|
+
return typeof accountId === "string" ? accountId.trim() || DEFAULT_ACCOUNT_ID : DEFAULT_ACCOUNT_ID;
|
|
16
|
+
}
|
|
17
|
+
function hasConfiguredField(config, field) {
|
|
18
|
+
return Boolean(config && typeof config === "object" && Object.hasOwn(config, field) && config[field] !== void 0);
|
|
19
|
+
}
|
|
20
|
+
function resolveWhatsAppGroupScopeBasePath(params, fields = WHATSAPP_GROUP_SCOPE_FIELDS) {
|
|
21
|
+
const accountId = normalizePathAccountId(params.accountId);
|
|
22
|
+
const whatsapp = params.cfg.channels?.whatsapp;
|
|
23
|
+
const accounts = whatsapp?.accounts;
|
|
24
|
+
const accountKey = resolveWhatsAppAccountKey(accounts, accountId);
|
|
25
|
+
const defaultAccountKey = resolveWhatsAppAccountKey(accounts, DEFAULT_ACCOUNT_ID);
|
|
26
|
+
const accountConfig = accountKey ? accounts?.[accountKey] : void 0;
|
|
27
|
+
const defaultAccountConfig = defaultAccountKey ? accounts?.[defaultAccountKey] : void 0;
|
|
28
|
+
const hasField = (config) => fields.some((field) => hasConfiguredField(config, field));
|
|
29
|
+
if (hasField(accountConfig)) return `channels.whatsapp.accounts.${accountKey}`;
|
|
30
|
+
if (accountId !== DEFAULT_ACCOUNT_ID && hasField(defaultAccountConfig)) return `channels.whatsapp.accounts.${defaultAccountKey}`;
|
|
31
|
+
if (hasField(whatsapp)) return "channels.whatsapp";
|
|
32
|
+
}
|
|
33
|
+
function resolveWhatsAppConfigPath(params) {
|
|
34
|
+
return `${resolveWhatsAppGroupScopeBasePath(params) ?? "channels.whatsapp"}.${params.field}`;
|
|
35
|
+
}
|
|
36
|
+
function resolveWhatsAppGroupsConfigPath(params) {
|
|
37
|
+
return `${resolveWhatsAppGroupScopeBasePath(params, ["groups"]) ?? resolveWhatsAppGroupScopeBasePath(params) ?? "channels.whatsapp"}.groups`;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { resolveWhatsAppGroupsConfigPath as n, resolveWhatsAppConfigPath as t };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CtRPAQCL.mjs";
|
|
2
2
|
import { c as normalizeWhatsAppTarget } from "./normalize-target-BGra1ZnM.mjs";
|
|
3
|
-
import "./
|
|
4
|
-
import { r as jidToE164 } from "./targets-runtime-RBjx3pg_.mjs";
|
|
5
|
-
import "./text-runtime-CHl0iPYe.mjs";
|
|
3
|
+
import { r as jidToE164 } from "./targets-runtime-DmiqXIXO.mjs";
|
|
6
4
|
import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound";
|
|
7
5
|
import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
8
6
|
import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser } from "baileys";
|
|
@@ -96,11 +94,7 @@ function lookupInboundMessageMetaForTarget(accountId, targetJid, messageId) {
|
|
|
96
94
|
const exact = lookupInboundMessageMeta(accountId, targetJid, messageId);
|
|
97
95
|
if (exact) return {
|
|
98
96
|
remoteJid: targetJid,
|
|
99
|
-
|
|
100
|
-
participantE164: exact.participantE164,
|
|
101
|
-
body: exact.body,
|
|
102
|
-
media: exact.media,
|
|
103
|
-
fromMe: exact.fromMe
|
|
97
|
+
...exact
|
|
104
98
|
};
|
|
105
99
|
const prefix = `${accountId}:`;
|
|
106
100
|
const suffix = `:${messageId}`;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
3
|
-
import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-
|
|
4
|
-
import {
|
|
5
|
-
import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.mjs";
|
|
2
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CtRPAQCL.mjs";
|
|
3
|
+
import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-BBonwKks.mjs";
|
|
4
|
+
import { _ as renderQrTerminal, h as resolveWhatsAppSocketTiming, r as createWaSocket } from "./socket-close-CT__V2fz.mjs";
|
|
5
|
+
import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-CHo1oRJA.mjs";
|
|
6
6
|
import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
|
|
7
7
|
import { logInfo } from "openclaw/plugin-sdk/logging-core";
|
|
8
8
|
import { danger, defaultRuntime, success } from "openclaw/plugin-sdk/runtime-env";
|
|
9
|
+
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
9
10
|
import { getRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
10
11
|
//#region extensions/whatsapp/src/login.ts
|
|
11
12
|
var login_exports = /* @__PURE__ */ __exportAll({ loginWeb: () => loginWeb });
|
|
@@ -20,14 +21,11 @@ async function loginWeb(verbose, waitForConnection, runtime = defaultRuntime, ac
|
|
|
20
21
|
const socketTiming = resolveWhatsAppSocketTiming();
|
|
21
22
|
const restoredFromBackup = await restoreCredsFromBackupIfNeeded(account.authDir, { beforeCredentialPersistence: options?.beforeCredentialPersistence });
|
|
22
23
|
const credentialPersistenceState = { failure: null };
|
|
23
|
-
|
|
24
|
-
const credentialPersistenceFailurePromise = new Promise((resolve) => {
|
|
25
|
-
resolveCredentialPersistenceFailure = resolve;
|
|
26
|
-
});
|
|
24
|
+
const credentialPersistenceFailure = createDeferred();
|
|
27
25
|
const onCredentialPersistenceError = (error) => {
|
|
28
26
|
if (credentialPersistenceState.failure) return;
|
|
29
27
|
credentialPersistenceState.failure = { error };
|
|
30
|
-
|
|
28
|
+
credentialPersistenceFailure.resolve(credentialPersistenceState.failure);
|
|
31
29
|
};
|
|
32
30
|
const credentialPersistenceTasks = /* @__PURE__ */ new Set();
|
|
33
31
|
const onCredentialPersistenceTask = (task) => {
|
|
@@ -84,7 +82,7 @@ async function loginWeb(verbose, waitForConnection, runtime = defaultRuntime, ac
|
|
|
84
82
|
onQr,
|
|
85
83
|
...credentialPersistenceOptions,
|
|
86
84
|
...options?.beforeCredentialPersistence ? {
|
|
87
|
-
credentialPersistenceFailure:
|
|
85
|
+
credentialPersistenceFailure: credentialPersistenceFailure.promise,
|
|
88
86
|
getCredentialPersistenceFailure: () => credentialPersistenceState.failure,
|
|
89
87
|
waitForCredentialPersistence
|
|
90
88
|
} : {},
|
|
@@ -1,50 +1,36 @@
|
|
|
1
|
-
import { a as resolveWhatsAppAccount } from "./accounts-
|
|
2
|
-
import { c as logoutWeb, f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-
|
|
1
|
+
import { a as resolveWhatsAppAccount } from "./accounts-CtRPAQCL.mjs";
|
|
2
|
+
import { c as logoutWeb, f as readWebAuthExistsForDecision, g as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-BBonwKks.mjs";
|
|
3
3
|
import { t as getActiveWebListener } from "./active-listener-CDjoX9QR.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { t as formatError } from "./session-errors-
|
|
6
|
-
import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-
|
|
4
|
+
import { h as resolveWhatsAppSocketTiming, r as createWaSocket } from "./socket-close-CT__V2fz.mjs";
|
|
5
|
+
import { t as formatError } from "./session-errors-B8UcAnZN.mjs";
|
|
6
|
+
import { i as closeWaSocket, o as waitForWhatsAppLoginResult, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-CHo1oRJA.mjs";
|
|
7
7
|
import { logInfo } from "openclaw/plugin-sdk/logging-core";
|
|
8
8
|
import { danger, defaultRuntime, info, success } from "openclaw/plugin-sdk/runtime-env";
|
|
9
9
|
import { renderQrPngDataUrl } from "openclaw/plugin-sdk/media-runtime";
|
|
10
10
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
11
|
+
import { createDeferred } from "openclaw/plugin-sdk/extension-shared";
|
|
11
12
|
import { randomUUID } from "node:crypto";
|
|
12
13
|
import { getRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
14
|
+
import { setImmediate } from "node:timers/promises";
|
|
13
15
|
//#region extensions/whatsapp/src/login-qr.ts
|
|
14
|
-
function waitForNextTask() {
|
|
15
|
-
return new Promise((resolve) => {
|
|
16
|
-
setImmediate(resolve);
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
16
|
const ACTIVE_LOGIN_TTL_MS = 18e4;
|
|
20
17
|
const MAX_QR_RENDER_CHASES = 10;
|
|
21
18
|
const activeLogins = /* @__PURE__ */ new Map();
|
|
22
|
-
function resolveWhatsAppLoginTimeoutMs(value, fallbackMs, minMs) {
|
|
23
|
-
return resolveTimerTimeoutMs(value, fallbackMs, minMs);
|
|
24
|
-
}
|
|
25
|
-
function closeSocket(sock) {
|
|
26
|
-
closeWaSocket(sock);
|
|
27
|
-
}
|
|
28
19
|
async function resetActiveLogin(accountId, reason) {
|
|
29
20
|
const login = activeLogins.get(accountId);
|
|
30
21
|
if (login) {
|
|
31
22
|
activeLogins.delete(accountId);
|
|
32
|
-
|
|
23
|
+
closeWaSocket(login.sock);
|
|
33
24
|
}
|
|
34
25
|
if (reason) logInfo(reason);
|
|
35
26
|
}
|
|
36
27
|
function isLoginFresh(login) {
|
|
37
28
|
return Date.now() - login.startedAt < ACTIVE_LOGIN_TTL_MS;
|
|
38
29
|
}
|
|
39
|
-
function resetQrUpdateSignal(login) {
|
|
40
|
-
login.qrUpdatePromise = new Promise((resolve) => {
|
|
41
|
-
login.resolveQrUpdate = resolve;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
30
|
function notifyQrUpdate(login) {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
resolve
|
|
31
|
+
const previous = login.qrUpdate;
|
|
32
|
+
login.qrUpdate = createDeferred();
|
|
33
|
+
previous.resolve();
|
|
48
34
|
}
|
|
49
35
|
function updateLoginQrState(login, qr) {
|
|
50
36
|
login.qr = qr;
|
|
@@ -141,28 +127,7 @@ async function waitForQrOrRecoveredLogin(params) {
|
|
|
141
127
|
outcome: "failed",
|
|
142
128
|
message: `Failed to get QR: ${String(err)}`
|
|
143
129
|
}));
|
|
144
|
-
const
|
|
145
|
-
if (activeLogins.get(params.accountId)?.id !== params.login.id) return {
|
|
146
|
-
outcome: "failed",
|
|
147
|
-
message: "WhatsApp login was replaced by a newer request."
|
|
148
|
-
};
|
|
149
|
-
await waitForNextTask();
|
|
150
|
-
const latest = activeLogins.get(params.accountId);
|
|
151
|
-
if (latest?.id !== params.login.id) return {
|
|
152
|
-
outcome: "failed",
|
|
153
|
-
message: "WhatsApp login was replaced by a newer request."
|
|
154
|
-
};
|
|
155
|
-
if (latest.qr) return {
|
|
156
|
-
outcome: "qr",
|
|
157
|
-
qr: latest.qr
|
|
158
|
-
};
|
|
159
|
-
if (latest.connected) return { outcome: "connected" };
|
|
160
|
-
return {
|
|
161
|
-
outcome: "failed",
|
|
162
|
-
message: latest.error ? `WhatsApp login failed: ${latest.error}` : "WhatsApp login failed."
|
|
163
|
-
};
|
|
164
|
-
});
|
|
165
|
-
const qrUpdateResult = params.login.qrUpdatePromise.then(() => {
|
|
130
|
+
const readLoginResult = (fallbackMessage) => {
|
|
166
131
|
const current = activeLogins.get(params.accountId);
|
|
167
132
|
if (current?.id !== params.login.id) return {
|
|
168
133
|
outcome: "failed",
|
|
@@ -175,9 +140,14 @@ async function waitForQrOrRecoveredLogin(params) {
|
|
|
175
140
|
if (current.connected) return { outcome: "connected" };
|
|
176
141
|
return {
|
|
177
142
|
outcome: "failed",
|
|
178
|
-
message: current.error ? `WhatsApp login failed: ${current.error}` :
|
|
143
|
+
message: current.error ? `WhatsApp login failed: ${current.error}` : fallbackMessage
|
|
179
144
|
};
|
|
145
|
+
};
|
|
146
|
+
const loginResult = params.login.waitPromise.then(async () => {
|
|
147
|
+
if (activeLogins.get(params.accountId)?.id === params.login.id) await setImmediate();
|
|
148
|
+
return readLoginResult("WhatsApp login failed.");
|
|
180
149
|
});
|
|
150
|
+
const qrUpdateResult = params.login.qrUpdate.promise.then(() => readLoginResult("WhatsApp QR update ended without an active QR."));
|
|
181
151
|
return await Promise.race([
|
|
182
152
|
qrResult,
|
|
183
153
|
loginResult,
|
|
@@ -212,7 +182,7 @@ async function startWebLoginWithQr(opts = {}) {
|
|
|
212
182
|
return { message: `WhatsApp login failed: ${formatError(err)}` };
|
|
213
183
|
}
|
|
214
184
|
const existing = activeLogins.get(account.accountId);
|
|
215
|
-
if (existing && isLoginFresh(existing) && existing.qrDataUrl) return {
|
|
185
|
+
if (!opts.force && existing && isLoginFresh(existing) && !existing.connected && existing.error === void 0 && existing.qrDataUrl) return {
|
|
216
186
|
qrDataUrl: existing.qrDataUrl,
|
|
217
187
|
message: "QR already active. Scan it in WhatsApp → Linked Devices."
|
|
218
188
|
};
|
|
@@ -225,7 +195,7 @@ async function startWebLoginWithQr(opts = {}) {
|
|
|
225
195
|
});
|
|
226
196
|
const qrTimer = setTimeout(() => {
|
|
227
197
|
rejectQr?.(/* @__PURE__ */ new Error("Timed out waiting for WhatsApp QR"));
|
|
228
|
-
},
|
|
198
|
+
}, resolveTimerTimeoutMs(opts.timeoutMs, 3e4, 5e3));
|
|
229
199
|
let sock;
|
|
230
200
|
let pendingQr = null;
|
|
231
201
|
const loginId = randomUUID();
|
|
@@ -270,7 +240,6 @@ async function startWebLoginWithQr(opts = {}) {
|
|
|
270
240
|
return { message: `Failed to start WhatsApp login: ${String(err)}` };
|
|
271
241
|
}
|
|
272
242
|
const nextLogin = {
|
|
273
|
-
accountId: account.accountId,
|
|
274
243
|
authDir: account.authDir,
|
|
275
244
|
isLegacyAuthDir: account.isLegacyAuthDir,
|
|
276
245
|
id: loginId,
|
|
@@ -279,8 +248,7 @@ async function startWebLoginWithQr(opts = {}) {
|
|
|
279
248
|
connected: false,
|
|
280
249
|
waitPromise: Promise.resolve(),
|
|
281
250
|
qrVersion: 0,
|
|
282
|
-
|
|
283
|
-
resolveQrUpdate: null,
|
|
251
|
+
qrUpdate: createDeferred(),
|
|
284
252
|
qrRenderPromise: null,
|
|
285
253
|
verbose: Boolean(opts.verbose),
|
|
286
254
|
runtime,
|
|
@@ -291,11 +259,10 @@ async function startWebLoginWithQr(opts = {}) {
|
|
|
291
259
|
await opts.beforeCredentialPersistence?.();
|
|
292
260
|
} catch (err) {
|
|
293
261
|
clearTimeout(qrTimer);
|
|
294
|
-
|
|
262
|
+
closeWaSocket(sock);
|
|
295
263
|
return { message: `Failed to start WhatsApp login: ${String(err)}` };
|
|
296
264
|
}
|
|
297
265
|
operationOwner.current = nextLogin;
|
|
298
|
-
resetQrUpdateSignal(nextLogin);
|
|
299
266
|
activeLogins.set(account.accountId, nextLogin);
|
|
300
267
|
if (pendingQr) {
|
|
301
268
|
const qrVersion = updateLoginQrState(nextLogin, pendingQr);
|
|
@@ -370,21 +337,12 @@ async function waitForWebLogin(opts = {}) {
|
|
|
370
337
|
message: "The login QR expired. Ask me to generate a new one."
|
|
371
338
|
};
|
|
372
339
|
}
|
|
373
|
-
const timeoutMs =
|
|
340
|
+
const timeoutMs = resolveTimerTimeoutMs(opts.timeoutMs, 12e4, 1e3);
|
|
374
341
|
const deadline = Date.now() + timeoutMs;
|
|
375
342
|
const currentQrDataUrl = opts.currentQrDataUrl;
|
|
376
343
|
while (true) {
|
|
377
344
|
if (login.error) {
|
|
378
|
-
|
|
379
|
-
const message = WHATSAPP_LOGGED_OUT_QR_MESSAGE;
|
|
380
|
-
await resetActiveLogin(account.accountId, message);
|
|
381
|
-
runtime.log(danger(message));
|
|
382
|
-
return {
|
|
383
|
-
connected: false,
|
|
384
|
-
message
|
|
385
|
-
};
|
|
386
|
-
}
|
|
387
|
-
const message = `WhatsApp login failed: ${login.error}`;
|
|
345
|
+
const message = login.errorStatus === 401 ? WHATSAPP_LOGGED_OUT_QR_MESSAGE : `WhatsApp login failed: ${login.error}`;
|
|
388
346
|
await resetActiveLogin(account.accountId, message);
|
|
389
347
|
runtime.log(danger(message));
|
|
390
348
|
return {
|
|
@@ -411,26 +369,20 @@ async function waitForWebLogin(opts = {}) {
|
|
|
411
369
|
connected: false,
|
|
412
370
|
message: "Still waiting for the QR scan. Let me know when you’ve scanned it."
|
|
413
371
|
};
|
|
372
|
+
let timer;
|
|
414
373
|
const timeout = new Promise((resolve) => {
|
|
415
|
-
setTimeout(() => resolve("timeout"), remaining);
|
|
374
|
+
timer = setTimeout(() => resolve("timeout"), remaining);
|
|
416
375
|
});
|
|
417
376
|
const result = await Promise.race([
|
|
418
377
|
login.waitPromise.then(() => "done"),
|
|
419
|
-
login.
|
|
378
|
+
login.qrUpdate.promise.then(() => "qr-update"),
|
|
420
379
|
timeout
|
|
421
|
-
]);
|
|
380
|
+
]).finally(() => clearTimeout(timer));
|
|
422
381
|
if (result === "timeout") return {
|
|
423
382
|
connected: false,
|
|
424
383
|
message: "Still waiting for the QR scan. Let me know when you’ve scanned it."
|
|
425
384
|
};
|
|
426
|
-
if (result === "qr-update") continue;
|
|
427
|
-
if (result === "done") {
|
|
428
|
-
if (login.connected || login.error) continue;
|
|
429
|
-
return {
|
|
430
|
-
connected: false,
|
|
431
|
-
message: "Login ended without a connection."
|
|
432
|
-
};
|
|
433
|
-
}
|
|
385
|
+
if (result === "qr-update" || login.connected || login.error) continue;
|
|
434
386
|
return {
|
|
435
387
|
connected: false,
|
|
436
388
|
message: "Login ended without a connection."
|