squidclaw 3.0.14 → 3.0.15
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/dist/{accounts-BsypiWiC.js → accounts-BznLC9dH.js} +2 -2
- package/dist/{accounts-CojLB8gu.js → accounts-Ci60lQsY.js} +17 -17
- package/dist/{accounts-CBMZbUu2.js → accounts-Dw4ivpQU.js} +2 -2
- package/dist/{active-listener-eLf5VQ_4.js → active-listener-B5jww01z.js} +2 -2
- package/dist/{api-key-rotation-R0EeTSGR.js → api-key-rotation-C1EZFUSy.js} +2 -2
- package/dist/{audio-preflight-C2dLsMCR.js → audio-preflight-CG6H_U7W.js} +32 -32
- package/dist/{audio-transcription-runner-B7Q9WPbH.js → audio-transcription-runner-D0H4ucWV.js} +12 -12
- package/dist/{audit-membership-runtime-w23FnNAN.js → audit-membership-runtime-DyLj-uhz.js} +4 -4
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +51 -51
- package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +51 -51
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-B-tyheVe.js → channel-activity-CUT8qw0W.js} +3 -3
- package/dist/{chrome-3982B8u4.js → chrome-53mklS3F.js} +18 -18
- package/dist/{command-registry-CquAbyqR.js → command-registry-D-zYyZpc.js} +4 -4
- package/dist/{commands-registry-i6O3l1QI.js → commands-registry-DmH3aIGN.js} +4 -4
- package/dist/{completion-cli-8PdK97J-.js → completion-cli-ClRcwvgc.js} +1 -1
- package/dist/{completion-cli-CIM6cyBy.js → completion-cli-DhTAfX_O.js} +2 -2
- package/dist/{deliver-BLMHHSPm.js → deliver-DBhlEXOh.js} +21 -21
- package/dist/deliver-runtime-BpVWeU13.js +36 -0
- package/dist/deps-send-discord.runtime-CL6FlfRz.js +26 -0
- package/dist/deps-send-imessage.runtime-DP56C3XB.js +25 -0
- package/dist/deps-send-signal.runtime-4WUnsfj1.js +24 -0
- package/dist/deps-send-slack.runtime-BM_8OV-V.js +22 -0
- package/dist/deps-send-telegram.runtime-CL27zxrX.js +27 -0
- package/dist/deps-send-whatsapp.runtime-B0xMiMJX.js +60 -0
- package/dist/{diagnostic-CFkF5G3N.js → diagnostic-C2LLQE3X.js} +2 -2
- package/dist/{doctor-completion-DWWBwulC.js → doctor-completion-CvbhXcBA.js} +1 -1
- package/dist/{doctor-completion-CGmYWy0n.js → doctor-completion-DTHBtueI.js} +1 -1
- package/dist/entry.js +2 -2
- package/dist/{plugin-sdk/errors-B8oJXuCF.js → errors-kkRuS2Cs.js} +1 -1
- package/dist/{fetch-38Yx06gt.js → fetch-CxBkawdM.js} +5 -5
- package/dist/{fetch-guard-D4vl4ujr.js → fetch-guard-fb71kZZ8.js} +2 -2
- package/dist/{frontmatter-CjKtFduT.js → frontmatter-Cq1TcIQ2.js} +3 -3
- package/dist/{fs-safe-CwHbZdFH.js → fs-safe-BoB4X3GD.js} +4 -4
- package/dist/{gateway-cli-9UpCzUUR.js → gateway-cli-5rUG2fBn.js} +1 -1
- package/dist/{gateway-cli-CUph5Eqo.js → gateway-cli-CF1kp5f9.js} +1 -1
- package/dist/{github-copilot-token-Cw3tAXM9.js → github-copilot-token-B5cPlwaz.js} +7 -7
- package/dist/{image-UWdNg3AV.js → image-C5cdH_Hn.js} +6 -6
- package/dist/{image-ops-MgyUqvIc.js → image-ops-BSjD6uEb.js} +2 -2
- package/dist/image-runtime-B1jzvCV9.js +29 -0
- package/dist/index.js +1 -1
- package/dist/{ir-KtKnWVYv.js → ir-DM4doOj9.js} +8 -8
- package/dist/{legacy-names-B0wgIP0Q.js → legacy-names-aGJJuzM_.js} +1 -1
- package/dist/llm-slug-generator.js +51 -51
- package/dist/{logger-oGKcCLZ5.js → logger-CnTSBL7T.js} +7 -7
- package/dist/{login-BJ7RjzPV.js → login--L7xmR80.js} +5 -5
- package/dist/{login-qr-C2dv3VjF.js → login-qr-StQBwOgw.js} +10 -10
- package/dist/{manager-Cz8NNpPk.js → manager-B5htbo-7.js} +13 -13
- package/dist/manager-runtime-CbCJ9KL0.js +18 -0
- package/dist/{model-selection-2Xl7Zx-s.js → model-selection-BfuTT3Ie.js} +43 -43
- package/dist/{onboard-DLJ_9fJU.js → onboard-BVgRwIeK.js} +1 -1
- package/dist/{onboard-aISMp4Kt.js → onboard-Vq9LkQon.js} +1 -1
- package/dist/{onboarding-Bl4RDn6W.js → onboarding-BW7AN6GP.js} +1 -1
- package/dist/{onboarding-YgRfODPk.js → onboarding-DO1ScRD8.js} +1 -1
- package/dist/{onboarding.finalize-Bm7_INHb.js → onboarding.finalize-DyoNGKAv.js} +11 -3
- package/dist/{onboarding.finalize-DQcrecUs.js → onboarding.finalize-mpPeXAsn.js} +12 -4
- package/dist/{outbound-CZO5ZCAG.js → outbound-Dp8B-7n3.js} +6 -6
- package/dist/{outbound-attachment-BBtJNyuW.js → outbound-attachment-BSZq7jTZ.js} +2 -2
- package/dist/{path-alias-guards-Cpsiv2KL.js → path-alias-guards-DORgbZ1w.js} +1 -1
- package/dist/{paths-CSdAWKDO.js → paths-DA5srn0U.js} +5 -5
- package/dist/{paths-CXClY8zC.js → paths-DSd911Oe.js} +4 -4
- package/dist/{pi-embedded-DgpQEVa1.js → pi-embedded-CrAWjHKR.js} +162 -162
- package/dist/{pi-embedded-helpers-CkCvcpdc.js → pi-embedded-helpers-DM4KAgn-.js} +52 -52
- package/dist/{pi-model-discovery-CHdwOZiV.js → pi-model-discovery-DE0XZt9x.js} +7 -7
- package/dist/pi-model-discovery-runtime-B5s0PRpY.js +11 -0
- package/dist/{pi-tools.before-tool-call.runtime-BlLvl0eL.js → pi-tools.before-tool-call.runtime-DfLoi4qR.js} +9 -9
- package/dist/plugin-sdk/{accounts-BW7b9aIf.js → accounts-C9RGqL4T.js} +3 -3
- package/dist/plugin-sdk/{accounts-tAi-tfAf.js → accounts-CgiUq3Un.js} +2 -2
- package/dist/plugin-sdk/{accounts-De05T3_J.js → accounts-DcDj_weC.js} +2 -2
- package/dist/plugin-sdk/{active-listener-DZCohPuZ.js → active-listener-BlJ5RUzB.js} +2 -2
- package/dist/plugin-sdk/{api-key-rotation-CrX0fvDj.js → api-key-rotation-Z-Qny376.js} +2 -2
- package/dist/plugin-sdk/{audio-preflight-BgPpaXum.js → audio-preflight-DXuewfE7.js} +26 -26
- package/dist/plugin-sdk/{audio-transcription-runner-CO4tyQtQ.js → audio-transcription-runner-DSNzBBSH.js} +11 -11
- package/dist/plugin-sdk/{audit-membership-runtime-Xl20kCBe.js → audit-membership-runtime-DHQDvH4u.js} +2 -2
- package/dist/plugin-sdk/{channel-activity-QlTyjswN.js → channel-activity-D1afTUj8.js} +3 -3
- package/dist/plugin-sdk/{channel-web-NzpRnn9f.js → channel-web-IPKOTqU3.js} +18 -18
- package/dist/plugin-sdk/{chrome-CVbDHFaE.js → chrome-B1q83rKv.js} +6 -6
- package/dist/plugin-sdk/{commands-registry-DSWbTWB2.js → commands-registry-DzySrtKG.js} +4 -4
- package/dist/plugin-sdk/{common-BpvaubXW.js → common-D8IL0ajZ.js} +2 -2
- package/dist/plugin-sdk/{config-DE6ibnmU.js → config-B5u_IldI.js} +7 -7
- package/dist/plugin-sdk/{deliver-86fU1nUC.js → deliver-S0Nnmc4b.js} +10 -10
- package/dist/plugin-sdk/deliver-runtime-tAQPm44B.js +32 -0
- package/dist/plugin-sdk/deps-send-discord.runtime-DeuyKcxA.js +23 -0
- package/dist/plugin-sdk/deps-send-imessage.runtime-D9NRm877.js +22 -0
- package/dist/plugin-sdk/deps-send-signal.runtime-DBepwGd9.js +21 -0
- package/dist/plugin-sdk/deps-send-slack.runtime-CUWnNsmH.js +19 -0
- package/dist/plugin-sdk/deps-send-telegram.runtime-CRI0ptpU.js +24 -0
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-CypkchYB.js +57 -0
- package/dist/plugin-sdk/{diagnostic-DwTd77di.js → diagnostic-CMOeaeBe.js} +2 -2
- package/dist/plugin-sdk/discord.js +6 -6
- package/dist/{errors-DfgAh2Ml.js → plugin-sdk/errors-9oVz7reJ.js} +1 -1
- package/dist/plugin-sdk/{fetch-guard-dmZ4U9uQ.js → fetch-guard-C_jkJc0N.js} +2 -2
- package/dist/plugin-sdk/{fs-safe-DqCO1D4C.js → fs-safe-DFbwq9CS.js} +3 -3
- package/dist/plugin-sdk/{image-UG930mNm.js → image-C-YH4Uik.js} +6 -6
- package/dist/plugin-sdk/{image-ops-D9cweu_-.js → image-ops-57ipHrBF.js} +2 -2
- package/dist/plugin-sdk/image-runtime-BzP3HfiE.js +25 -0
- package/dist/plugin-sdk/imessage.js +2 -2
- package/dist/plugin-sdk/index.js +50 -50
- package/dist/plugin-sdk/{ir-pigw84ir.js → ir-CYDBM_JC.js} +7 -7
- package/dist/plugin-sdk/{local-roots-CIhD7Co-.js → local-roots-BfR7HxIa.js} +4 -4
- package/dist/plugin-sdk/{logger-DIb2cGHp.js → logger-Bg4vIUJn.js} +2 -2
- package/dist/plugin-sdk/{login-DN33Ry8p.js → login-BhBKfrcu.js} +4 -4
- package/dist/plugin-sdk/{login-qr-DXZPiiDq.js → login-qr-pZv8YA21.js} +5 -5
- package/dist/plugin-sdk/{manager-cBbgCrQ7.js → manager-CNL-O6jb.js} +8 -8
- package/dist/plugin-sdk/manager-runtime-B87hYNyb.js +15 -0
- package/dist/plugin-sdk/{outbound-attachment-C4f-OcC0.js → outbound-attachment-rsxzcJYF.js} +2 -2
- package/dist/plugin-sdk/{outbound-ux3UTEA3.js → outbound-icMF_rUc.js} +5 -5
- package/dist/plugin-sdk/{path-alias-guards-TnxupPQC.js → path-alias-guards-DA0MhfkG.js} +1 -1
- package/dist/plugin-sdk/{paths-B7_75Pdr.js → paths-CP67O8eN.js} +1 -1
- package/dist/plugin-sdk/{pi-embedded-helpers-CBAsAxOB.js → pi-embedded-helpers-8ieRSf-l.js} +16 -16
- package/dist/plugin-sdk/{pi-model-discovery-hrhgLkQy.js → pi-model-discovery-DSSANt82.js} +1 -1
- package/dist/plugin-sdk/pi-model-discovery-runtime-C2t2kU5s.js +8 -0
- package/dist/plugin-sdk/{pi-tools.before-tool-call.runtime-EL-r4x87.js → pi-tools.before-tool-call.runtime-ChLGyK0j.js} +4 -4
- package/dist/plugin-sdk/{plugins-NKOOkt_i.js → plugins-BLeJXdd2.js} +4 -4
- package/dist/plugin-sdk/{proxy-env-DooJ7AbC.js → proxy-env-CtPm4saU.js} +1 -1
- package/dist/plugin-sdk/{proxy-fetch-ZPEvp58f.js → proxy-fetch-Cf3IUSDw.js} +1 -1
- package/dist/plugin-sdk/{pw-ai-jALO1jBq.js → pw-ai-CtZSk4at.js} +9 -9
- package/dist/plugin-sdk/{qmd-manager-Bei6TaFq.js → qmd-manager-Ov9ElEfG.js} +7 -7
- package/dist/plugin-sdk/{query-expansion-POz2za8a.js → query-expansion-CzjwW461.js} +4 -4
- package/dist/plugin-sdk/{redact-9WsNyb7S.js → redact-DfACyt0X.js} +1 -1
- package/dist/plugin-sdk/{reply-sihF_R23.js → reply-Bl5GGHri.js} +73 -73
- package/dist/plugin-sdk/{resolve-outbound-target-qXRaNZi8.js → resolve-outbound-target-D-0B2aK8.js} +2 -2
- package/dist/plugin-sdk/{run-with-concurrency-DmTrN5JG.js → run-with-concurrency-kVooFCVo.js} +1 -1
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-B6MdStWm.js +10 -0
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-DexVGpkn.js +19 -0
- package/dist/plugin-sdk/{send-jou-S7lc.js → send-BKQRdkHg.js} +5 -5
- package/dist/plugin-sdk/{send-aWQBb6ca.js → send-BkAfzZYd.js} +8 -8
- package/dist/plugin-sdk/{send-BMv-WOpW.js → send-C7C3x6hg.js} +7 -7
- package/dist/plugin-sdk/{send-Cm6HGK-a.js → send-CGlHhdoZ.js} +6 -6
- package/dist/plugin-sdk/{send-DZB0Hlej.js → send-YldTY40c.js} +13 -13
- package/dist/plugin-sdk/{session-C98G_V4e.js → session-uS6b35hg.js} +3 -3
- package/dist/plugin-sdk/signal.js +2 -2
- package/dist/plugin-sdk/{skill-commands-_K2_qYb4.js → skill-commands-c9HTevk5.js} +4 -4
- package/dist/plugin-sdk/{skills-D58hSyfJ.js → skills-OK3LublS.js} +6 -6
- package/dist/plugin-sdk/slash-commands.runtime-JFUaFK3N.js +13 -0
- package/dist/plugin-sdk/slash-dispatch.runtime-BP81ZOIp.js +52 -0
- package/dist/plugin-sdk/slash-skill-commands.runtime-KVmn_84j.js +16 -0
- package/dist/plugin-sdk/{store-CHxyy2Nq.js → store-BkxOV4wy.js} +2 -2
- package/dist/plugin-sdk/subagent-registry-runtime-DZHhsl5N.js +52 -0
- package/dist/plugin-sdk/{tables-D2Q-dmPT.js → tables-8_ELoE8R.js} +1 -1
- package/dist/plugin-sdk/{thinking-0lRH3Rcl.js → thinking-TLm688bb.js} +7 -7
- package/dist/plugin-sdk/{tokens-CTIYTLWu.js → tokens-DAL_5WHL.js} +1 -1
- package/dist/plugin-sdk/{tool-images-K2kMTUHK.js → tool-images-CbObuT48.js} +2 -2
- package/dist/plugin-sdk/web-DIhuSOD-.js +56 -0
- package/dist/plugin-sdk/{whatsapp-actions-DnEN6SNn.js → whatsapp-actions-DVZ223y_.js} +17 -17
- package/dist/plugin-sdk/whatsapp.js +50 -50
- package/dist/{plugins--Y8ggxrk.js → plugins-Db8j13y8.js} +11 -11
- package/dist/{program-BpSOl_1X.js → program-BJO_oaKF.js} +2 -2
- package/dist/{program-context-tphS7xu7.js → program-context-CWsWlM9-.js} +6 -6
- package/dist/{prompt-select-styled-DL2p1pfi.js → prompt-select-styled-CnWGIwST.js} +1 -1
- package/dist/{prompt-select-styled-CqnrivgC.js → prompt-select-styled-R6Iau0zv.js} +1 -1
- package/dist/{proxy-env-BAlmOqn_.js → proxy-env-bjBQWAZU.js} +1 -1
- package/dist/{plugin-sdk/proxy-fetch-Dt5BedH8.js → proxy-fetch-lH6RsRTE.js} +1 -1
- package/dist/{pw-ai-Ci7uZGTd.js → pw-ai-BMx3rnIH.js} +14 -14
- package/dist/{qmd-manager-CO-shcLU.js → qmd-manager-BN0siR2Z.js} +10 -10
- package/dist/{query-expansion-DlQOkf-g.js → query-expansion-Dzxt6kXo.js} +6 -6
- package/dist/{redact-NmPEVjIo.js → redact-DvzicBMu.js} +1 -1
- package/dist/{register.maintenance-BUWUvg1o.js → register.maintenance-C0WLFNcv.js} +5 -5
- package/dist/{register.maintenance-CMAt3Nl8.js → register.maintenance-c4CZQhHy.js} +4 -4
- package/dist/{register.onboard-CbiTdKQX.js → register.onboard-B8LXDCnA.js} +2 -2
- package/dist/{register.onboard-1KrFhKgA.js → register.onboard-C8-hGp4-.js} +2 -2
- package/dist/{register.setup-KhsHMx2v.js → register.setup-Bw1pnWbM.js} +2 -2
- package/dist/{register.setup-Ct7W5KHu.js → register.setup-DiUpJRvj.js} +2 -2
- package/dist/{register.subclis-Z1fJCSxh.js → register.subclis-BbFUfhdj.js} +3 -3
- package/dist/{run-main-DDsH3MYf.js → run-main-Exefhxet.js} +3 -3
- package/dist/{run-with-concurrency-FczpX8ng.js → run-with-concurrency-BFR3ReeF.js} +4 -4
- package/dist/runtime-whatsapp-login.runtime-DTnWO4dr.js +13 -0
- package/dist/runtime-whatsapp-outbound.runtime-XzfTCc36.js +22 -0
- package/dist/{send-BYlxWwez.js → send-0EU-Y3Gn.js} +5 -5
- package/dist/{send-Jg_3nT2E.js → send-B92swUj4.js} +26 -26
- package/dist/{send-Je58aHGD.js → send-By-oi8SV.js} +6 -6
- package/dist/{send-CqgPl09X.js → send-C2v8GsVK.js} +7 -7
- package/dist/{send-D2tGdo2t.js → send-CKtUdJpX.js} +8 -8
- package/dist/{session-DC1-0Js7.js → session-CZ24KNcj.js} +8 -8
- package/dist/{skill-commands-BaKuTMGP.js → skill-commands-BRoRvs2q.js} +9 -9
- package/dist/{skills-BeJSK5PY.js → skills-OLKf_9cW.js} +22 -22
- package/dist/slash-commands.runtime-jY_-vStu.js +16 -0
- package/dist/slash-dispatch.runtime-BxaEpG30.js +56 -0
- package/dist/slash-skill-commands.runtime-B6vRGL-p.js +20 -0
- package/dist/{store-Ky_egzlA.js → store-Mz6VjFuy.js} +2 -2
- package/dist/subagent-registry-runtime-BNE1FIwQ.js +56 -0
- package/dist/{subsystem-BaLYRf7D.js → subsystem-6v7sWnAD.js} +14 -14
- package/dist/{tables-BlsVH8H4.js → tables-0InE37AN.js} +1 -1
- package/dist/{plugin-sdk/target-errors-BVBW25Y3.js → target-errors-B37sVq3w.js} +2 -2
- package/dist/{thinking-D9F_aLRB.js → thinking-D4AaB24F.js} +7 -7
- package/dist/{tokens-D2XhLqIz.js → tokens-DfbMVF9y.js} +1 -1
- package/dist/{tool-images-C2WK6W0J.js → tool-images-Dpl5RgN7.js} +2 -2
- package/dist/{update-cli-gLKrP8UQ.js → update-cli-CeMQxSs2.js} +4 -4
- package/dist/{update-cli-Fe17E_Xm.js → update-cli-esFXuN7Z.js} +5 -5
- package/dist/{web-D4FdtS8P.js → web-gFh8coIz.js} +55 -55
- package/dist/{whatsapp-actions-aF5qDSh_.js → whatsapp-actions-B-LXYZ6Z.js} +21 -21
- package/dist/{workspace-TqfVSQuO.js → workspace-kVMIaBrV.js} +20 -20
- package/package.json +1 -1
- package/dist/deliver-runtime-BSg7XU_9.js +0 -36
- package/dist/deps-send-discord.runtime-DpEvkdzn.js +0 -26
- package/dist/deps-send-imessage.runtime-etYmfsQ1.js +0 -25
- package/dist/deps-send-signal.runtime-4HiuvLY4.js +0 -24
- package/dist/deps-send-slack.runtime-Y5M5BNt7.js +0 -22
- package/dist/deps-send-telegram.runtime-CQ6XgUqx.js +0 -27
- package/dist/deps-send-whatsapp.runtime-B1XdeiW1.js +0 -60
- package/dist/image-runtime-3Z60UCGO.js +0 -29
- package/dist/manager-runtime-By-gmgqz.js +0 -18
- package/dist/pi-model-discovery-runtime-DiznhLrZ.js +0 -11
- package/dist/plugin-sdk/accounts-B6gye1Jd.js +0 -46
- package/dist/plugin-sdk/accounts-C-BT6Po7.js +0 -288
- package/dist/plugin-sdk/accounts-DQDXV8eB.js +0 -35
- package/dist/plugin-sdk/active-listener-CirjQdCm.js +0 -50
- package/dist/plugin-sdk/api-key-rotation-CCoQ5SD_.js +0 -181
- package/dist/plugin-sdk/audio-preflight-xnWAFqH-.js +0 -69
- package/dist/plugin-sdk/audio-transcription-runner-BDmtq7-q.js +0 -2176
- package/dist/plugin-sdk/audit-membership-runtime-B9b-zRwg.js +0 -58
- package/dist/plugin-sdk/channel-activity-JjLRpUa_.js +0 -94
- package/dist/plugin-sdk/channel-web-DNWsxhYh.js +0 -2256
- package/dist/plugin-sdk/chrome-B5PWOUbr.js +0 -2415
- package/dist/plugin-sdk/commands-registry-BKeyJUxK.js +0 -1125
- package/dist/plugin-sdk/config-FhBFLsNm.js +0 -17911
- package/dist/plugin-sdk/deliver-DEbTlzFy.js +0 -1694
- package/dist/plugin-sdk/deliver-runtime-BJHbLq-S.js +0 -32
- package/dist/plugin-sdk/deliver-runtime-CO2uP-r9.js +0 -32
- package/dist/plugin-sdk/deps-send-discord.runtime-CDRnV2G9.js +0 -23
- package/dist/plugin-sdk/deps-send-discord.runtime-DIPW0tR4.js +0 -23
- package/dist/plugin-sdk/deps-send-imessage.runtime-B6kLsqc2.js +0 -22
- package/dist/plugin-sdk/deps-send-imessage.runtime-ByGjRa1H.js +0 -22
- package/dist/plugin-sdk/deps-send-signal.runtime-BSQh0bHr.js +0 -21
- package/dist/plugin-sdk/deps-send-signal.runtime-Ca1awu4L.js +0 -21
- package/dist/plugin-sdk/deps-send-slack.runtime-BFom-0ng.js +0 -19
- package/dist/plugin-sdk/deps-send-slack.runtime-CRzWCVkC.js +0 -19
- package/dist/plugin-sdk/deps-send-telegram.runtime-BWyavKp9.js +0 -24
- package/dist/plugin-sdk/deps-send-telegram.runtime-CpTtZ6JM.js +0 -24
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-C0XcOgX1.js +0 -57
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-cC_XvHV8.js +0 -57
- package/dist/plugin-sdk/diagnostic-Dv9S12vm.js +0 -319
- package/dist/plugin-sdk/errors-CgRPdp3o.js +0 -54
- package/dist/plugin-sdk/fetch-guard-W_A4uSz2.js +0 -156
- package/dist/plugin-sdk/fs-safe-Dqmpk-Fr.js +0 -352
- package/dist/plugin-sdk/image-BSFy8d1M.js +0 -2310
- package/dist/plugin-sdk/image-ops-DN17S88I.js +0 -584
- package/dist/plugin-sdk/image-runtime-5YO31sjU.js +0 -25
- package/dist/plugin-sdk/image-runtime-Bu3DSIBB.js +0 -25
- package/dist/plugin-sdk/ir-JaPZ0yKH.js +0 -1296
- package/dist/plugin-sdk/local-roots-BTW3ifco.js +0 -186
- package/dist/plugin-sdk/logger-DDdrdbDu.js +0 -1163
- package/dist/plugin-sdk/login-BXGRny-S.js +0 -57
- package/dist/plugin-sdk/login-qr-DTs92ap8.js +0 -320
- package/dist/plugin-sdk/manager-DzFj9oHX.js +0 -3917
- package/dist/plugin-sdk/manager-runtime-Dbz_bpiL.js +0 -15
- package/dist/plugin-sdk/manager-runtime-DrpyZvO0.js +0 -15
- package/dist/plugin-sdk/outbound-CQ7uBBML.js +0 -212
- package/dist/plugin-sdk/outbound-attachment-dTE6EVdX.js +0 -19
- package/dist/plugin-sdk/path-alias-guards-gBhrAn14.js +0 -43
- package/dist/plugin-sdk/paths-C6W4VHoa.js +0 -166
- package/dist/plugin-sdk/pi-embedded-helpers-CfzQPXDC.js +0 -9627
- package/dist/plugin-sdk/pi-model-discovery-Bt6B0MAj.js +0 -134
- package/dist/plugin-sdk/pi-model-discovery-runtime-BcgXpTmL.js +0 -8
- package/dist/plugin-sdk/pi-model-discovery-runtime-SPHihgeR.js +0 -8
- package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-DYJQxhuo.js +0 -354
- package/dist/plugin-sdk/plugins-6NxPd6TS.js +0 -864
- package/dist/plugin-sdk/pw-ai-BFK39pwE.js +0 -1938
- package/dist/plugin-sdk/qmd-manager-6bozlfFg.js +0 -1448
- package/dist/plugin-sdk/query-expansion-eeVz_aEm.js +0 -1011
- package/dist/plugin-sdk/redact-BoNEjbpF.js +0 -319
- package/dist/plugin-sdk/reply-DgcrQBKL.js +0 -98828
- package/dist/plugin-sdk/resolve-outbound-target-CbaJ-kc2.js +0 -40
- package/dist/plugin-sdk/run-with-concurrency-5DMu9szx.js +0 -1994
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DMNRnMAJ.js +0 -10
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-jkgyeVsN.js +0 -10
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-DdLJJ1YC.js +0 -19
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-w9rCES1O.js +0 -19
- package/dist/plugin-sdk/send-BSoMbeqA.js +0 -3135
- package/dist/plugin-sdk/send-Byyfc20_.js +0 -503
- package/dist/plugin-sdk/send-CI-xWEs7.js +0 -2587
- package/dist/plugin-sdk/send-DzP9EJqK.js +0 -540
- package/dist/plugin-sdk/send-MlSZ82sA.js +0 -414
- package/dist/plugin-sdk/session-DFy97tfW.js +0 -169
- package/dist/plugin-sdk/skill-commands-yum46YuA.js +0 -342
- package/dist/plugin-sdk/skills-DUphJGKn.js +0 -1428
- package/dist/plugin-sdk/slash-commands.runtime-5UW5KLyR.js +0 -13
- package/dist/plugin-sdk/slash-commands.runtime-CyZybvM0.js +0 -13
- package/dist/plugin-sdk/slash-dispatch.runtime-4oQ2P_qo.js +0 -52
- package/dist/plugin-sdk/slash-dispatch.runtime-DGI2ovR2.js +0 -52
- package/dist/plugin-sdk/slash-skill-commands.runtime-Cb1PFrG4.js +0 -16
- package/dist/plugin-sdk/slash-skill-commands.runtime-y_mOLyS7.js +0 -16
- package/dist/plugin-sdk/ssrf-B3XRWBsP.js +0 -202
- package/dist/plugin-sdk/store-DFvIhzWZ.js +0 -81
- package/dist/plugin-sdk/subagent-registry-runtime-DtKXhKtl.js +0 -52
- package/dist/plugin-sdk/subagent-registry-runtime-TxOQ-aoU.js +0 -52
- package/dist/plugin-sdk/tables-bDM_jlLP.js +0 -55
- package/dist/plugin-sdk/thinking-Bu-w5mW5.js +0 -1206
- package/dist/plugin-sdk/tokens-CLE20fRI.js +0 -52
- package/dist/plugin-sdk/tool-images-D0G_giwP.js +0 -274
- package/dist/plugin-sdk/web-DSXk7XCb.js +0 -56
- package/dist/plugin-sdk/web-wfXoGaeS.js +0 -56
- package/dist/plugin-sdk/whatsapp-actions-BOyA0Uuj.js +0 -80
- package/dist/proxy-fetch-C2v-Utgg.js +0 -38
- package/dist/runtime-whatsapp-login.runtime-nLoztrHq.js +0 -13
- package/dist/runtime-whatsapp-outbound.runtime-ipj7KEHf.js +0 -22
- package/dist/slash-commands.runtime-SPLrdY5U.js +0 -16
- package/dist/slash-dispatch.runtime-BXF9mgkV.js +0 -56
- package/dist/slash-skill-commands.runtime-DbWF-siU.js +0 -20
- package/dist/subagent-registry-runtime-CqsLRf4P.js +0 -56
- package/dist/target-errors-CiNyvgLy.js +0 -195
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { i as resolveWhatsAppAccount, l as logoutWeb } from "./accounts-C-BT6Po7.js";
|
|
2
|
-
import { Pr as formatCliCommand, n as loadConfig } from "./config-FhBFLsNm.js";
|
|
3
|
-
import { B as success, F as danger, I as info, c as defaultRuntime, r as logInfo } from "./logger-DDdrdbDu.js";
|
|
4
|
-
import { i as waitForWaConnection, n as formatError, t as createWaSocket } from "./session-DFy97tfW.js";
|
|
5
|
-
import { DisconnectReason } from "@whiskeysockets/baileys";
|
|
6
|
-
|
|
7
|
-
//#region src/web/login.ts
|
|
8
|
-
async function loginWeb(verbose, waitForConnection, runtime = defaultRuntime, accountId) {
|
|
9
|
-
const wait = waitForConnection ?? waitForWaConnection;
|
|
10
|
-
const account = resolveWhatsAppAccount({
|
|
11
|
-
cfg: loadConfig(),
|
|
12
|
-
accountId
|
|
13
|
-
});
|
|
14
|
-
const sock = await createWaSocket(true, verbose, { authDir: account.authDir });
|
|
15
|
-
logInfo("Waiting for WhatsApp connection...", runtime);
|
|
16
|
-
try {
|
|
17
|
-
await wait(sock);
|
|
18
|
-
console.log(success("✅ Linked! Credentials saved for future sends."));
|
|
19
|
-
} catch (err) {
|
|
20
|
-
const code = err?.error?.output?.statusCode ?? err?.output?.statusCode;
|
|
21
|
-
if (code === 515) {
|
|
22
|
-
console.log(info("WhatsApp asked for a restart after pairing (code 515); creds are saved. Restarting connection once…"));
|
|
23
|
-
try {
|
|
24
|
-
sock.ws?.close();
|
|
25
|
-
} catch {}
|
|
26
|
-
const retry = await createWaSocket(false, verbose, { authDir: account.authDir });
|
|
27
|
-
try {
|
|
28
|
-
await wait(retry);
|
|
29
|
-
console.log(success("✅ Linked after restart; web session ready."));
|
|
30
|
-
return;
|
|
31
|
-
} finally {
|
|
32
|
-
setTimeout(() => retry.ws?.close(), 500);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (code === DisconnectReason.loggedOut) {
|
|
36
|
-
await logoutWeb({
|
|
37
|
-
authDir: account.authDir,
|
|
38
|
-
isLegacyAuthDir: account.isLegacyAuthDir,
|
|
39
|
-
runtime
|
|
40
|
-
});
|
|
41
|
-
console.error(danger(`WhatsApp reported the session is logged out. Cleared cached web session; please rerun ${formatCliCommand("squidclaw channels login")} and scan the QR again.`));
|
|
42
|
-
throw new Error("Session logged out; cache cleared. Re-run login.", { cause: err });
|
|
43
|
-
}
|
|
44
|
-
const formatted = formatError(err);
|
|
45
|
-
console.error(danger(`WhatsApp Web connection ended before fully opening. ${formatted}`));
|
|
46
|
-
throw new Error(formatted, { cause: err });
|
|
47
|
-
} finally {
|
|
48
|
-
setTimeout(() => {
|
|
49
|
-
try {
|
|
50
|
-
sock.ws?.close();
|
|
51
|
-
} catch {}
|
|
52
|
-
}, 500);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
export { loginWeb as t };
|
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
import "./run-with-concurrency-5DMu9szx.js";
|
|
2
|
-
import { _ as webAuthExists, i as resolveWhatsAppAccount, l as logoutWeb, p as readWebSelfId } from "./accounts-C-BT6Po7.js";
|
|
3
|
-
import "./paths-8xF5kDne.js";
|
|
4
|
-
import "./github-copilot-token-Dy-0-Kh3.js";
|
|
5
|
-
import { n as loadConfig } from "./config-FhBFLsNm.js";
|
|
6
|
-
import { B as success, F as danger, I as info, c as defaultRuntime, r as logInfo } from "./logger-DDdrdbDu.js";
|
|
7
|
-
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-DFy97tfW.js";
|
|
8
|
-
import { randomUUID } from "node:crypto";
|
|
9
|
-
import { DisconnectReason } from "@whiskeysockets/baileys";
|
|
10
|
-
import QRCodeModule from "qrcode-terminal/vendor/QRCode/index.js";
|
|
11
|
-
import QRErrorCorrectLevelModule from "qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js";
|
|
12
|
-
import { deflateSync } from "node:zlib";
|
|
13
|
-
|
|
14
|
-
//#region src/media/png-encode.ts
|
|
15
|
-
/**
|
|
16
|
-
* Minimal PNG encoder for generating simple RGBA images without native dependencies.
|
|
17
|
-
* Used for QR codes, live probes, and other programmatic image generation.
|
|
18
|
-
*/
|
|
19
|
-
const CRC_TABLE = (() => {
|
|
20
|
-
const table = new Uint32Array(256);
|
|
21
|
-
for (let i = 0; i < 256; i += 1) {
|
|
22
|
-
let c = i;
|
|
23
|
-
for (let k = 0; k < 8; k += 1) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
24
|
-
table[i] = c >>> 0;
|
|
25
|
-
}
|
|
26
|
-
return table;
|
|
27
|
-
})();
|
|
28
|
-
/** Compute CRC32 checksum for a buffer (used in PNG chunk encoding). */
|
|
29
|
-
function crc32(buf) {
|
|
30
|
-
let crc = 4294967295;
|
|
31
|
-
for (let i = 0; i < buf.length; i += 1) crc = CRC_TABLE[(crc ^ buf[i]) & 255] ^ crc >>> 8;
|
|
32
|
-
return (crc ^ 4294967295) >>> 0;
|
|
33
|
-
}
|
|
34
|
-
/** Create a PNG chunk with type, data, and CRC. */
|
|
35
|
-
function pngChunk(type, data) {
|
|
36
|
-
const typeBuf = Buffer.from(type, "ascii");
|
|
37
|
-
const len = Buffer.alloc(4);
|
|
38
|
-
len.writeUInt32BE(data.length, 0);
|
|
39
|
-
const crc = crc32(Buffer.concat([typeBuf, data]));
|
|
40
|
-
const crcBuf = Buffer.alloc(4);
|
|
41
|
-
crcBuf.writeUInt32BE(crc, 0);
|
|
42
|
-
return Buffer.concat([
|
|
43
|
-
len,
|
|
44
|
-
typeBuf,
|
|
45
|
-
data,
|
|
46
|
-
crcBuf
|
|
47
|
-
]);
|
|
48
|
-
}
|
|
49
|
-
/** Write a pixel to an RGBA buffer. Ignores out-of-bounds writes. */
|
|
50
|
-
function fillPixel(buf, x, y, width, r, g, b, a = 255) {
|
|
51
|
-
if (x < 0 || y < 0 || x >= width) return;
|
|
52
|
-
const idx = (y * width + x) * 4;
|
|
53
|
-
if (idx < 0 || idx + 3 >= buf.length) return;
|
|
54
|
-
buf[idx] = r;
|
|
55
|
-
buf[idx + 1] = g;
|
|
56
|
-
buf[idx + 2] = b;
|
|
57
|
-
buf[idx + 3] = a;
|
|
58
|
-
}
|
|
59
|
-
/** Encode an RGBA buffer as a PNG image. */
|
|
60
|
-
function encodePngRgba(buffer, width, height) {
|
|
61
|
-
const stride = width * 4;
|
|
62
|
-
const raw = Buffer.alloc((stride + 1) * height);
|
|
63
|
-
for (let row = 0; row < height; row += 1) {
|
|
64
|
-
const rawOffset = row * (stride + 1);
|
|
65
|
-
raw[rawOffset] = 0;
|
|
66
|
-
buffer.copy(raw, rawOffset + 1, row * stride, row * stride + stride);
|
|
67
|
-
}
|
|
68
|
-
const compressed = deflateSync(raw);
|
|
69
|
-
const signature = Buffer.from([
|
|
70
|
-
137,
|
|
71
|
-
80,
|
|
72
|
-
78,
|
|
73
|
-
71,
|
|
74
|
-
13,
|
|
75
|
-
10,
|
|
76
|
-
26,
|
|
77
|
-
10
|
|
78
|
-
]);
|
|
79
|
-
const ihdr = Buffer.alloc(13);
|
|
80
|
-
ihdr.writeUInt32BE(width, 0);
|
|
81
|
-
ihdr.writeUInt32BE(height, 4);
|
|
82
|
-
ihdr[8] = 8;
|
|
83
|
-
ihdr[9] = 6;
|
|
84
|
-
ihdr[10] = 0;
|
|
85
|
-
ihdr[11] = 0;
|
|
86
|
-
ihdr[12] = 0;
|
|
87
|
-
return Buffer.concat([
|
|
88
|
-
signature,
|
|
89
|
-
pngChunk("IHDR", ihdr),
|
|
90
|
-
pngChunk("IDAT", compressed),
|
|
91
|
-
pngChunk("IEND", Buffer.alloc(0))
|
|
92
|
-
]);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/web/qr-image.ts
|
|
97
|
-
const QRCode = QRCodeModule;
|
|
98
|
-
const QRErrorCorrectLevel = QRErrorCorrectLevelModule;
|
|
99
|
-
function createQrMatrix(input) {
|
|
100
|
-
const qr = new QRCode(-1, QRErrorCorrectLevel.L);
|
|
101
|
-
qr.addData(input);
|
|
102
|
-
qr.make();
|
|
103
|
-
return qr;
|
|
104
|
-
}
|
|
105
|
-
async function renderQrPngBase64(input, opts = {}) {
|
|
106
|
-
const { scale = 6, marginModules = 4 } = opts;
|
|
107
|
-
const qr = createQrMatrix(input);
|
|
108
|
-
const modules = qr.getModuleCount();
|
|
109
|
-
const size = (modules + marginModules * 2) * scale;
|
|
110
|
-
const buf = Buffer.alloc(size * size * 4, 255);
|
|
111
|
-
for (let row = 0; row < modules; row += 1) for (let col = 0; col < modules; col += 1) {
|
|
112
|
-
if (!qr.isDark(row, col)) continue;
|
|
113
|
-
const startX = (col + marginModules) * scale;
|
|
114
|
-
const startY = (row + marginModules) * scale;
|
|
115
|
-
for (let y = 0; y < scale; y += 1) {
|
|
116
|
-
const pixelY = startY + y;
|
|
117
|
-
for (let x = 0; x < scale; x += 1) fillPixel(buf, startX + x, pixelY, size, 0, 0, 0, 255);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return encodePngRgba(buf, size, size).toString("base64");
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region src/web/login-qr.ts
|
|
125
|
-
const ACTIVE_LOGIN_TTL_MS = 3 * 6e4;
|
|
126
|
-
const activeLogins = /* @__PURE__ */ new Map();
|
|
127
|
-
function closeSocket(sock) {
|
|
128
|
-
try {
|
|
129
|
-
sock.ws?.close();
|
|
130
|
-
} catch {}
|
|
131
|
-
}
|
|
132
|
-
async function resetActiveLogin(accountId, reason) {
|
|
133
|
-
const login = activeLogins.get(accountId);
|
|
134
|
-
if (login) {
|
|
135
|
-
closeSocket(login.sock);
|
|
136
|
-
activeLogins.delete(accountId);
|
|
137
|
-
}
|
|
138
|
-
if (reason) logInfo(reason);
|
|
139
|
-
}
|
|
140
|
-
function isLoginFresh(login) {
|
|
141
|
-
return Date.now() - login.startedAt < ACTIVE_LOGIN_TTL_MS;
|
|
142
|
-
}
|
|
143
|
-
function attachLoginWaiter(accountId, login) {
|
|
144
|
-
login.waitPromise = waitForWaConnection(login.sock).then(() => {
|
|
145
|
-
const current = activeLogins.get(accountId);
|
|
146
|
-
if (current?.id === login.id) current.connected = true;
|
|
147
|
-
}).catch((err) => {
|
|
148
|
-
const current = activeLogins.get(accountId);
|
|
149
|
-
if (current?.id !== login.id) return;
|
|
150
|
-
current.error = formatError(err);
|
|
151
|
-
current.errorStatus = getStatusCode(err);
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
async function restartLoginSocket(login, runtime) {
|
|
155
|
-
if (login.restartAttempted) return false;
|
|
156
|
-
login.restartAttempted = true;
|
|
157
|
-
runtime.log(info("WhatsApp asked for a restart after pairing (code 515); retrying connection once…"));
|
|
158
|
-
closeSocket(login.sock);
|
|
159
|
-
try {
|
|
160
|
-
login.sock = await createWaSocket(false, login.verbose, { authDir: login.authDir });
|
|
161
|
-
login.connected = false;
|
|
162
|
-
login.error = void 0;
|
|
163
|
-
login.errorStatus = void 0;
|
|
164
|
-
attachLoginWaiter(login.accountId, login);
|
|
165
|
-
return true;
|
|
166
|
-
} catch (err) {
|
|
167
|
-
login.error = formatError(err);
|
|
168
|
-
login.errorStatus = getStatusCode(err);
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
async function startWebLoginWithQr(opts = {}) {
|
|
173
|
-
const runtime = opts.runtime ?? defaultRuntime;
|
|
174
|
-
const account = resolveWhatsAppAccount({
|
|
175
|
-
cfg: loadConfig(),
|
|
176
|
-
accountId: opts.accountId
|
|
177
|
-
});
|
|
178
|
-
const hasWeb = await webAuthExists(account.authDir);
|
|
179
|
-
const selfId = readWebSelfId(account.authDir);
|
|
180
|
-
if (hasWeb && !opts.force) return { message: `WhatsApp is already linked (${selfId.e164 ?? selfId.jid ?? "unknown"}). Say “relink” if you want a fresh QR.` };
|
|
181
|
-
const existing = activeLogins.get(account.accountId);
|
|
182
|
-
if (existing && isLoginFresh(existing) && existing.qrDataUrl) return {
|
|
183
|
-
qrDataUrl: existing.qrDataUrl,
|
|
184
|
-
message: "QR already active. Scan it in WhatsApp → Linked Devices."
|
|
185
|
-
};
|
|
186
|
-
await resetActiveLogin(account.accountId);
|
|
187
|
-
let resolveQr = null;
|
|
188
|
-
let rejectQr = null;
|
|
189
|
-
const qrPromise = new Promise((resolve, reject) => {
|
|
190
|
-
resolveQr = resolve;
|
|
191
|
-
rejectQr = reject;
|
|
192
|
-
});
|
|
193
|
-
const qrTimer = setTimeout(() => {
|
|
194
|
-
rejectQr?.(/* @__PURE__ */ new Error("Timed out waiting for WhatsApp QR"));
|
|
195
|
-
}, Math.max(opts.timeoutMs ?? 3e4, 5e3));
|
|
196
|
-
let sock;
|
|
197
|
-
let pendingQr = null;
|
|
198
|
-
try {
|
|
199
|
-
sock = await createWaSocket(false, Boolean(opts.verbose), {
|
|
200
|
-
authDir: account.authDir,
|
|
201
|
-
onQr: (qr) => {
|
|
202
|
-
if (pendingQr) return;
|
|
203
|
-
pendingQr = qr;
|
|
204
|
-
const current = activeLogins.get(account.accountId);
|
|
205
|
-
if (current && !current.qr) current.qr = qr;
|
|
206
|
-
clearTimeout(qrTimer);
|
|
207
|
-
runtime.log(info("WhatsApp QR received."));
|
|
208
|
-
resolveQr?.(qr);
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
} catch (err) {
|
|
212
|
-
clearTimeout(qrTimer);
|
|
213
|
-
await resetActiveLogin(account.accountId);
|
|
214
|
-
return { message: `Failed to start WhatsApp login: ${String(err)}` };
|
|
215
|
-
}
|
|
216
|
-
const login = {
|
|
217
|
-
accountId: account.accountId,
|
|
218
|
-
authDir: account.authDir,
|
|
219
|
-
isLegacyAuthDir: account.isLegacyAuthDir,
|
|
220
|
-
id: randomUUID(),
|
|
221
|
-
sock,
|
|
222
|
-
startedAt: Date.now(),
|
|
223
|
-
connected: false,
|
|
224
|
-
waitPromise: Promise.resolve(),
|
|
225
|
-
restartAttempted: false,
|
|
226
|
-
verbose: Boolean(opts.verbose)
|
|
227
|
-
};
|
|
228
|
-
activeLogins.set(account.accountId, login);
|
|
229
|
-
if (pendingQr && !login.qr) login.qr = pendingQr;
|
|
230
|
-
attachLoginWaiter(account.accountId, login);
|
|
231
|
-
let qr;
|
|
232
|
-
try {
|
|
233
|
-
qr = await qrPromise;
|
|
234
|
-
} catch (err) {
|
|
235
|
-
clearTimeout(qrTimer);
|
|
236
|
-
await resetActiveLogin(account.accountId);
|
|
237
|
-
return { message: `Failed to get QR: ${String(err)}` };
|
|
238
|
-
}
|
|
239
|
-
login.qrDataUrl = `data:image/png;base64,${await renderQrPngBase64(qr)}`;
|
|
240
|
-
return {
|
|
241
|
-
qrDataUrl: login.qrDataUrl,
|
|
242
|
-
message: "Scan this QR in WhatsApp → Linked Devices."
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
async function waitForWebLogin(opts = {}) {
|
|
246
|
-
const runtime = opts.runtime ?? defaultRuntime;
|
|
247
|
-
const account = resolveWhatsAppAccount({
|
|
248
|
-
cfg: loadConfig(),
|
|
249
|
-
accountId: opts.accountId
|
|
250
|
-
});
|
|
251
|
-
const activeLogin = activeLogins.get(account.accountId);
|
|
252
|
-
if (!activeLogin) return {
|
|
253
|
-
connected: false,
|
|
254
|
-
message: "No active WhatsApp login in progress."
|
|
255
|
-
};
|
|
256
|
-
const login = activeLogin;
|
|
257
|
-
if (!isLoginFresh(login)) {
|
|
258
|
-
await resetActiveLogin(account.accountId);
|
|
259
|
-
return {
|
|
260
|
-
connected: false,
|
|
261
|
-
message: "The login QR expired. Ask me to generate a new one."
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
const timeoutMs = Math.max(opts.timeoutMs ?? 12e4, 1e3);
|
|
265
|
-
const deadline = Date.now() + timeoutMs;
|
|
266
|
-
while (true) {
|
|
267
|
-
const remaining = deadline - Date.now();
|
|
268
|
-
if (remaining <= 0) return {
|
|
269
|
-
connected: false,
|
|
270
|
-
message: "Still waiting for the QR scan. Let me know when you’ve scanned it."
|
|
271
|
-
};
|
|
272
|
-
const timeout = new Promise((resolve) => setTimeout(() => resolve("timeout"), remaining));
|
|
273
|
-
if (await Promise.race([login.waitPromise.then(() => "done"), timeout]) === "timeout") return {
|
|
274
|
-
connected: false,
|
|
275
|
-
message: "Still waiting for the QR scan. Let me know when you’ve scanned it."
|
|
276
|
-
};
|
|
277
|
-
if (login.error) {
|
|
278
|
-
if (login.errorStatus === DisconnectReason.loggedOut) {
|
|
279
|
-
await logoutWeb({
|
|
280
|
-
authDir: login.authDir,
|
|
281
|
-
isLegacyAuthDir: login.isLegacyAuthDir,
|
|
282
|
-
runtime
|
|
283
|
-
});
|
|
284
|
-
const message = "WhatsApp reported the session is logged out. Cleared cached web session; please scan a new QR.";
|
|
285
|
-
await resetActiveLogin(account.accountId, message);
|
|
286
|
-
runtime.log(danger(message));
|
|
287
|
-
return {
|
|
288
|
-
connected: false,
|
|
289
|
-
message
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
if (login.errorStatus === 515) {
|
|
293
|
-
if (await restartLoginSocket(login, runtime) && isLoginFresh(login)) continue;
|
|
294
|
-
}
|
|
295
|
-
const message = `WhatsApp login failed: ${login.error}`;
|
|
296
|
-
await resetActiveLogin(account.accountId, message);
|
|
297
|
-
runtime.log(danger(message));
|
|
298
|
-
return {
|
|
299
|
-
connected: false,
|
|
300
|
-
message
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
if (login.connected) {
|
|
304
|
-
const message = "✅ Linked! WhatsApp is ready.";
|
|
305
|
-
runtime.log(success(message));
|
|
306
|
-
await resetActiveLogin(account.accountId);
|
|
307
|
-
return {
|
|
308
|
-
connected: true,
|
|
309
|
-
message
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
return {
|
|
313
|
-
connected: false,
|
|
314
|
-
message: "Login ended without a connection."
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
//#endregion
|
|
320
|
-
export { startWebLoginWithQr, waitForWebLogin };
|