hyperclaw 5.2.0 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +227 -3
- package/dist/a2ui-protocol-A2xow5Ch.js +75 -0
- package/dist/a2ui-protocol-dTomAnFE.js +75 -0
- package/dist/agents-routing-95_s2yea.js +6 -0
- package/dist/agents-routing-Bz3SstlK.js +398 -0
- package/dist/agents-routing-DHDK2axt.js +6 -0
- package/dist/agents-routing-DRMS8Ol-.js +6 -0
- package/dist/agents-routing-biXULPch.js +398 -0
- package/dist/agents-routing-iQmIOe3k.js +398 -0
- package/dist/api-key-validation-BeQ2MZAT.js +64 -0
- package/dist/api-key-validation-C2WQk1oM.js +64 -0
- package/dist/api-keys-guide-2cD5Rf-K.js +149 -0
- package/dist/api-keys-guide-BdT2lfX6.js +149 -0
- package/dist/api-keys-guide-BwCIj8qd.js +149 -0
- package/dist/audit-1Anq45mH.js +441 -0
- package/dist/audit-BAVTInWP.js +441 -0
- package/dist/audit-CV0gLGaL.js +444 -0
- package/dist/audit-Dnt0XgZD.js +441 -0
- package/dist/audit-DqNGdIKU.js +441 -0
- package/dist/bounty-tools-Cx7BXUfz.js +211 -0
- package/dist/bounty-tools-DWvW3yc-.js +211 -0
- package/dist/bounty-tools-FI7DHmsS.js +211 -0
- package/dist/bounty-tools-cjmA3Hgk.js +211 -0
- package/dist/browser-tools-BGPBCApQ.js +5 -0
- package/dist/browser-tools-Btu_vB2d.js +179 -0
- package/dist/browser-tools-DF2nQ1hi.js +5 -0
- package/dist/browser-tools-DYx4p13A.js +179 -0
- package/dist/chat-4ZistSKP.js +310 -0
- package/dist/chat-BqiMMQc4.js +324 -0
- package/dist/chat-BxxYzPaz.js +324 -0
- package/dist/chat-C0W8lwhh.js +324 -0
- package/dist/chat-CKBxDWAQ.js +324 -0
- package/dist/chat-CkCcCkVG.js +324 -0
- package/dist/chat-DCOKsydK.js +310 -0
- package/dist/chat-DZcZ1Uli.js +310 -0
- package/dist/chat-DiIra4_i.js +324 -0
- package/dist/chat-R_NuOa1v.js +324 -0
- package/dist/claw-tasks-CIkuuhga.js +80 -0
- package/dist/claw-tasks-CquRilLP.js +80 -0
- package/dist/claw-tasks-xXtZpeY0.js +80 -0
- package/dist/config-BEz4yNRx.js +261 -0
- package/dist/config-Br73VMLb.js +261 -0
- package/dist/config-CXqmvq_H.js +7 -0
- package/dist/config-D5vF0kvV.js +261 -0
- package/dist/config-D_6MxFk3.js +7 -0
- package/dist/config-b2HmFrBr.js +7 -0
- package/dist/connector-1H0OW1h8.js +419 -0
- package/dist/connector-1qpQ5L-T.js +173 -0
- package/dist/connector-2OVpYt0c.js +213 -0
- package/dist/connector-8cFkE3X4.js +552 -0
- package/dist/connector-B2bZD1id.js +181 -0
- package/dist/connector-B3W7quzD.js +568 -0
- package/dist/connector-B4FWhOzd.js +189 -0
- package/dist/connector-B5fqvoZL.js +239 -0
- package/dist/connector-BA8ZbhPt.js +162 -0
- package/dist/connector-BFl0XIwB.js +182 -0
- package/dist/connector-BIGRhSuN.js +419 -0
- package/dist/connector-BK0qVbvh.js +498 -0
- package/dist/connector-BMtA4KSF.js +194 -0
- package/dist/connector-BPIrifW-.js +218 -0
- package/dist/connector-BRNU-rJ4.js +225 -0
- package/dist/connector-BS7lvyLd.js +213 -0
- package/dist/connector-BZ_-UPUL.js +305 -0
- package/dist/connector-Bd0NZ5bT.js +189 -0
- package/dist/connector-BjsPwu-Y.js +531 -0
- package/dist/connector-BnSsjz1D.js +167 -0
- package/dist/connector-BrogAqVQ.js +239 -0
- package/dist/connector-BsVTG3U3.js +181 -0
- package/dist/connector-By9pLJgR.js +340 -0
- package/dist/connector-C7c1ASzT.js +192 -0
- package/dist/connector-CIj28thK.js +182 -0
- package/dist/connector-CJkuYNd1.js +280 -0
- package/dist/connector-CPcUmIHz.js +552 -0
- package/dist/connector-CUlP4He3.js +194 -0
- package/dist/connector-CZg2I8Tn.js +350 -0
- package/dist/connector-C_NtpthL.js +498 -0
- package/dist/connector-CddDB9IK.js +192 -0
- package/dist/connector-ChQMspky.js +167 -0
- package/dist/connector-ClHFpI56.js +425 -0
- package/dist/connector-CmhUVhMT.js +531 -0
- package/dist/connector-CnX7lwCt.js +425 -0
- package/dist/connector-D36oGwnK.js +162 -0
- package/dist/connector-DDJ7Nxkq.js +286 -0
- package/dist/connector-DDn2QDuf.js +167 -0
- package/dist/connector-DO_bzgJn.js +167 -0
- package/dist/connector-DVcRo21Y.js +568 -0
- package/dist/connector-DhWs2anT.js +189 -0
- package/dist/connector-DsY1IXMz.js +508 -0
- package/dist/connector-DwRF3CQg.js +218 -0
- package/dist/connector-HG61cV9h.js +340 -0
- package/dist/connector-HR28FwA5.js +181 -0
- package/dist/connector-K0QGRYh5.js +85 -0
- package/dist/connector-NliR7NZZ.js +508 -0
- package/dist/connector-VolY_hP4.js +350 -0
- package/dist/connector-Wjx9ih70.js +286 -0
- package/dist/connector-dfqk7NYD.js +181 -0
- package/dist/connector-e0W4Mpmq.js +189 -0
- package/dist/connector-eK6_phVW.js +280 -0
- package/dist/connector-l7UmCYaL.js +225 -0
- package/dist/connector-n2YnOJYZ.js +305 -0
- package/dist/connector-orobFcqE.js +531 -0
- package/dist/connector-r1SRYSqX.js +173 -0
- package/dist/connector-tZgn5_Fk.js +85 -0
- package/dist/connector-wm4Oe1DK.js +181 -0
- package/dist/cost-tracker-DHTv6zpR.js +103 -0
- package/dist/cost-tracker-DJ1tiKcx.js +103 -0
- package/dist/cost-tracker-jbK_AoIV.js +103 -0
- package/dist/credentials-store-C0R-pQM7.js +5 -0
- package/dist/credentials-store-C9HwQSY2.js +5 -0
- package/dist/credentials-store-D5Xw3F75.js +89 -0
- package/dist/credentials-store-DIPxVk51.js +86 -0
- package/dist/credentials-store-DU2cVTiY.js +7 -0
- package/dist/credentials-store-Djqi3oXC.js +5 -0
- package/dist/credentials-store-HwLJ3GS2.js +87 -0
- package/dist/credentials-store-z16XvFZ2.js +86 -0
- package/dist/cron-tasks-4my0PJce.js +85 -0
- package/dist/cron-tasks-CJkI0lo3.js +82 -0
- package/dist/cron-tasks-DN1YjYhK.js +82 -0
- package/dist/cron-tasks-DuNdK89e.js +82 -0
- package/dist/daemon-3xj3FVuw.js +5 -0
- package/dist/daemon-3zd_nupj.js +333 -0
- package/dist/daemon-B9-h7ryw.js +7 -0
- package/dist/daemon-BLC4AL9L.js +401 -0
- package/dist/daemon-BR1uU7jH.js +333 -0
- package/dist/daemon-BRdtCOoC.js +7 -0
- package/dist/daemon-BnmNBHY5.js +384 -0
- package/dist/daemon-BwspQtiu.js +7 -0
- package/dist/daemon-Bx5HTGjk.js +404 -0
- package/dist/daemon-CCxpXxSb.js +7 -0
- package/dist/daemon-CEUxN3SQ.js +7 -0
- package/dist/daemon-CHk9_ezz.js +403 -0
- package/dist/daemon-CgrsZ0d9.js +320 -0
- package/dist/daemon-Cy7iD9au.js +7 -0
- package/dist/daemon-DCm9RCEz.js +401 -0
- package/dist/daemon-DNzuDyu8.js +7 -0
- package/dist/daemon-DWFWCLvh.js +7 -0
- package/dist/daemon-DgBZaFyi.js +355 -0
- package/dist/daemon-Dsyjad7g.js +7 -0
- package/dist/daemon-DwxPYrb6.js +404 -0
- package/dist/daemon-DxoPIGQG.js +333 -0
- package/dist/daemon-MXsEPeVa.js +7 -0
- package/dist/daemon-rpJ-J0bv.js +403 -0
- package/dist/daemon-sZVjFUoX.js +7 -0
- package/dist/delivery-8fo4GZ-j.js +95 -0
- package/dist/delivery-CkxNZIsF.js +95 -0
- package/dist/delivery-CtbHkJbB.js +95 -0
- package/dist/delivery-D1z3f3KW.js +4 -0
- package/dist/delivery-DKGpk5M4.js +4 -0
- package/dist/delivery-DReKOHyM.js +95 -0
- package/dist/delivery-Ddn-VajP.js +4 -0
- package/dist/delivery-DsoxcD2z.js +4 -0
- package/dist/destructive-gate-CEn4BsTd.js +101 -0
- package/dist/destructive-gate-CgCqfKuT.js +101 -0
- package/dist/destructive-gate-DcEpMEqP.js +101 -0
- package/dist/developer-keys-7rQ8M4Qo.js +127 -0
- package/dist/developer-keys-BeUpyenR.js +8 -0
- package/dist/developer-keys-CSmzA-dl.js +127 -0
- package/dist/developer-keys-KFGbGuZj.js +8 -0
- package/dist/device-auth-store-BDhzxuPc.js +5 -0
- package/dist/device-auth-store-Cjyn2XeY.js +86 -0
- package/dist/device-auth-store-DgSabRGa.js +7 -0
- package/dist/device-auth-store-LKgpU74c.js +88 -0
- package/dist/device-auth-store-UlkrF-9_.js +5 -0
- package/dist/device-auth-store-yvGLuYAl.js +86 -0
- package/dist/doctor-BcfmNAGV.js +233 -0
- package/dist/doctor-CEP3UQjn.js +227 -0
- package/dist/doctor-CmJh0JLr.js +6 -0
- package/dist/doctor-CtDvddSn.js +231 -0
- package/dist/doctor-DPoCaXsd.js +227 -0
- package/dist/doctor-DPvY68XB.js +6 -0
- package/dist/doctor-G6EMPukm.js +6 -0
- package/dist/doctor-tL9TXt9y.js +6 -0
- package/dist/engine-1fLMFUn2.js +7 -0
- package/dist/engine-7lSiOc0W.js +323 -0
- package/dist/engine-B83pxJM4.js +318 -0
- package/dist/engine-B8hxtYpN.js +323 -0
- package/dist/engine-BXqijc79.js +7 -0
- package/dist/engine-BfQ-vNqE.js +321 -0
- package/dist/engine-BlpKw8D4.js +7 -0
- package/dist/engine-BmN7L0jl.js +7 -0
- package/dist/engine-CRagwas6.js +321 -0
- package/dist/engine-CppTnNbG.js +7 -0
- package/dist/engine-CwAfDQbD.js +7 -0
- package/dist/engine-D5kY4hMJ.js +7 -0
- package/dist/engine-DJSfl_Hc.js +323 -0
- package/dist/engine-DQcMDIbU.js +305 -0
- package/dist/engine-W1I8kkgV.js +305 -0
- package/dist/engine-mVrq_pfQ.js +7 -0
- package/dist/env-resolve-BeamD7l5.js +10 -0
- package/dist/env-resolve-C0otwkgN.js +10 -0
- package/dist/env-resolve-CC_po9t5.js +10 -0
- package/dist/env-resolve-COjiKYD8.js +147 -0
- package/dist/env-resolve-CYiFHLAi.js +145 -0
- package/dist/env-resolve-ClZcv5-B.js +145 -0
- package/dist/env-resolve-DS92g2fk.js +151 -0
- package/dist/env-resolve-DkBUmcI3.js +10 -0
- package/dist/extraction-tools-6PREYSAK.js +5 -0
- package/dist/extraction-tools-B8F3nsLR.js +5 -0
- package/dist/extraction-tools-BX5HGgko.js +91 -0
- package/dist/extraction-tools-Co11UJdZ.js +91 -0
- package/dist/form_data-DDfyO9B0.js +8657 -0
- package/dist/form_data-DgWnyuDn.js +8657 -0
- package/dist/gateway-BfHcLG6d.js +194 -0
- package/dist/gateway-CzI8dnlS.js +196 -0
- package/dist/gateway-DNv10FFg.js +194 -0
- package/dist/gateway-DRh5v1KI.js +4 -0
- package/dist/gateway-DroPtqyM.js +6 -0
- package/dist/gateway-DyWwV0Nu.js +4 -0
- package/dist/gmail-watch-setup-BV4r_lgb.js +40 -0
- package/dist/gmail-watch-setup-CW_5D9g-.js +40 -0
- package/dist/gmail-watch-setup-xG9GkPwr.js +42 -0
- package/dist/health-CBy1PfzC.js +152 -0
- package/dist/health-Cq_yE5Ln.js +6 -0
- package/dist/heartbeat-engine-7I0dZeea.js +83 -0
- package/dist/heartbeat-engine-BZUNOanp.js +84 -0
- package/dist/heartbeat-engine-DNm8ggAs.js +83 -0
- package/dist/heartbeat-engine-tgK7xXmt.js +83 -0
- package/dist/hub-CI4qcd1b.js +515 -0
- package/dist/hub-CNQaC4JI.js +515 -0
- package/dist/hub-Co1SbxLs.js +6 -0
- package/dist/hub-eUh89obm.js +6 -0
- package/dist/hyperclawbot-Bkncybig.js +508 -0
- package/dist/hyperclawbot-C37Unss3.js +505 -0
- package/dist/hyperclawbot-CFHXZr12.js +505 -0
- package/dist/hyperclawbot-DGou0MZ6.js +508 -0
- package/dist/hyperclawbot-DnPIyjox.js +508 -0
- package/dist/hyperclawbot-GYFaTEgC.js +505 -0
- package/dist/hyperclawbot-mcLnyJyM.js +505 -0
- package/dist/hyperclawbot-xcastgTV.js +508 -0
- package/dist/hyperclawbot-y0i_joQK.js +505 -0
- package/dist/inference-BvmMO9dq.js +8 -0
- package/dist/inference-C2HOfRf8.js +2848 -0
- package/dist/inference-CKvR5Ik5.js +2841 -0
- package/dist/inference-DVVmhQn5.js +2841 -0
- package/dist/inference-DoM_iai-.js +2848 -0
- package/dist/inference-DwgXrvBb.js +6 -0
- package/dist/inference-Go1G6tnF.js +8 -0
- package/dist/inference-_ptQe0oG.js +2841 -0
- package/dist/inference-gK62s15E.js +6 -0
- package/dist/inference-lLDvSTR9.js +6 -0
- package/dist/knowledge-graph-4SxFnwEm.js +131 -0
- package/dist/knowledge-graph-BsH-HoUJ.js +131 -0
- package/dist/knowledge-graph-BxrAiV2B.js +134 -0
- package/dist/knowledge-graph-DCa91Nz5.js +131 -0
- package/dist/loader-7fz2fb92.js +400 -0
- package/dist/loader-B2jZXMBu.js +6 -0
- package/dist/loader-CbS0tIrR.js +4 -0
- package/dist/loader-Ckvv7vHF.js +410 -0
- package/dist/loader-CwOXDhFQ.js +400 -0
- package/dist/loader-DpEOgWXZ.js +4 -0
- package/dist/loader-DpYgmaul.js +4 -0
- package/dist/loader-DtyQP7wL.js +400 -0
- package/dist/logger-B3AqfQWG.js +84 -0
- package/dist/logger-B_q8yqmA.js +84 -0
- package/dist/logger-BxJklsDv.js +84 -0
- package/dist/logger-ry2oCfdf.js +86 -0
- package/dist/manager-9zwhTeQ5.js +233 -0
- package/dist/manager-B1RbCW6C.js +31 -0
- package/dist/manager-B90HEHxe.js +6 -0
- package/dist/manager-B94UWcTs.js +233 -0
- package/dist/manager-BDvL_oPs.js +4 -0
- package/dist/manager-BEatAtIB.js +31 -0
- package/dist/manager-BQf9drst.js +120 -0
- package/dist/manager-Bau1mIqb.js +6 -0
- package/dist/manager-BkqHak_e.js +247 -0
- package/dist/manager-BoFdZm-l.js +233 -0
- package/dist/manager-C2bq0AXc.js +233 -0
- package/dist/manager-CBe3W3eG.js +117 -0
- package/dist/manager-CoHr8_eJ.js +117 -0
- package/dist/manager-CuS13QUO.js +6 -0
- package/dist/manager-DO0pK2OI.js +117 -0
- package/dist/manager-DVetfBCH.js +6 -0
- package/dist/manager-Jd0qSzVe.js +35 -0
- package/dist/manager-TxFgaHT9.js +31 -0
- package/dist/manager-Yo6ZAofG.js +250 -0
- package/dist/mcp-B_WJiTZz.js +139 -0
- package/dist/mcp-DVhPLprc.js +139 -0
- package/dist/mcp-GWnLTVi-.js +142 -0
- package/dist/mcp-loader-B6xz7ftt.js +94 -0
- package/dist/mcp-loader-BLanJREp.js +94 -0
- package/dist/mcp-loader-Bx7FFxAU.js +94 -0
- package/dist/mcp-loader-CecsT-3O.js +93 -0
- package/dist/mcp-loader-Cr0LRQHE.js +93 -0
- package/dist/mcp-loader-D0rbtV3G.js +93 -0
- package/dist/memory-B47nvgOq.js +271 -0
- package/dist/memory-D-Py-cz5.js +273 -0
- package/dist/memory-D991eoj7.js +6 -0
- package/dist/memory-DoQoaHjo.js +4 -0
- package/dist/memory-auto-5aBZQJQY.js +5 -0
- package/dist/memory-auto-BTeOoLsb.js +306 -0
- package/dist/memory-auto-BvjfaflZ.js +5 -0
- package/dist/memory-auto-CSUt3aas.js +306 -0
- package/dist/memory-auto-CfpACu6s.js +306 -0
- package/dist/memory-auto-DI9Xpd-x.js +306 -0
- package/dist/memory-auto-D_mPVYqI.js +5 -0
- package/dist/memory-auto-PmKetZuo.js +5 -0
- package/dist/memory-auto-_Jv-Diw_.js +306 -0
- package/dist/memory-auto-rLBheyC0.js +5 -0
- package/dist/memory-integration-UFc6CdRA.js +91 -0
- package/dist/memory-integration-_NOy60Fj.js +91 -0
- package/dist/memory-integration-nbQ8esDu.js +91 -0
- package/dist/moltbook-B4znBD46.js +81 -0
- package/dist/moltbook-CGtA7Lb3.js +81 -0
- package/dist/moltbook-EZOfIwcN.js +81 -0
- package/dist/node-BvA5_2f_.js +222 -0
- package/dist/node-CRaZw_av.js +225 -0
- package/dist/node-CSOPY84m.js +222 -0
- package/dist/node-FPkFXYdU.js +225 -0
- package/dist/nodes-registry--DkZbn41.js +52 -0
- package/dist/nodes-registry-DYEH1aWn.js +52 -0
- package/dist/nodes-registry-jK7T0THg.js +52 -0
- package/dist/oauth-flow-B3S4T_SJ.js +147 -0
- package/dist/oauth-flow-CuQHP_RD.js +150 -0
- package/dist/oauth-flow-D_iqT6nr.js +150 -0
- package/dist/oauth-flow-Du2N6B2V.js +150 -0
- package/dist/oauth-provider-B2RBpiXg.js +111 -0
- package/dist/oauth-provider-C1qk9SI-.js +110 -0
- package/dist/oauth-provider-CDOMIZgF.js +110 -0
- package/dist/observability-4CyDqBWi.js +89 -0
- package/dist/observability-BfhV3r9r.js +89 -0
- package/dist/observability-DAnU8Ung.js +89 -0
- package/dist/onboard-3SoScSbC.js +11 -0
- package/dist/onboard-BAhuTUMO.js +4240 -0
- package/dist/onboard-BHKBzytX.js +13 -0
- package/dist/onboard-BVYo6E_l.js +3865 -0
- package/dist/onboard-Bf3ht6ct.js +11 -0
- package/dist/onboard-Bmpa_pxc.js +3865 -0
- package/dist/onboard-BwFFnEDj.js +13 -0
- package/dist/onboard-C-0A7RKN.js +4211 -0
- package/dist/onboard-CCuETEUr.js +3865 -0
- package/dist/onboard-CDi3B996.js +13 -0
- package/dist/onboard-CcXqOCHa.js +3862 -0
- package/dist/onboard-Cw85LmyN.js +13 -0
- package/dist/onboard-DU3acWAq.js +13 -0
- package/dist/onboard-DVEFIFRj.js +11 -0
- package/dist/onboard-DW8b3EUP.js +4250 -0
- package/dist/onboard-DfYWM7yN.js +13 -0
- package/dist/onboard-DiDTuD7m.js +13 -0
- package/dist/onboard-DqamkA0I.js +11 -0
- package/dist/onboard-DtDFU4lV.js +3865 -0
- package/dist/onboard-IdhgSexF.js +11 -0
- package/dist/onboard-Qh-qibLR.js +3861 -0
- package/dist/onboard-T54jLovz.js +13 -0
- package/dist/onboard-nQerZcpc.js +3862 -0
- package/dist/onboard-qXuXl5An.js +4250 -0
- package/dist/onboard-r2hLYfsL.js +3865 -0
- package/dist/onboard-xsSdyO6Y.js +3865 -0
- package/dist/onboard-yACJiQ6A.js +4215 -0
- package/dist/onboard-z1K8FTgh.js +13 -0
- package/dist/orchestrator-BIKrbOtx.js +6 -0
- package/dist/orchestrator-C71UI_0E.js +189 -0
- package/dist/orchestrator-C9I6EVhh.js +189 -0
- package/dist/orchestrator-CC6vuL6m.js +6 -0
- package/dist/orchestrator-CExmcac2.js +189 -0
- package/dist/orchestrator-CQm9v71d.js +6 -0
- package/dist/orchestrator-CSZnojZo.js +189 -0
- package/dist/orchestrator-Cc-gXExz.js +189 -0
- package/dist/orchestrator-CxySH0n5.js +6 -0
- package/dist/orchestrator-Cybvh-J0.js +189 -0
- package/dist/orchestrator-D-9pExNB.js +189 -0
- package/dist/orchestrator-DG-RjZIu.js +6 -0
- package/dist/orchestrator-DvEjhiJR.js +6 -0
- package/dist/orchestrator-FFpXJwSV.js +189 -0
- package/dist/orchestrator-f6IjivCr.js +6 -0
- package/dist/orchestrator-mPfwBFvX.js +6 -0
- package/dist/osint-BIGH02i8.js +277 -0
- package/dist/osint-Cc2Ju-o4.js +277 -0
- package/dist/osint-Cg3-CYHx.js +278 -0
- package/dist/pairing-BRPzVXzQ.js +198 -0
- package/dist/pairing-Cm78Tsdx.js +4 -0
- package/dist/pairing-D4sA3-Ha.js +6 -0
- package/dist/pairing-ouc_v-OX.js +196 -0
- package/dist/pc-access-BZvlAXYN.js +819 -0
- package/dist/pc-access-CziyndiO.js +8 -0
- package/dist/pc-access-D5k6dAfU.js +819 -0
- package/dist/pc-access-DoPSPiAK.js +8 -0
- package/dist/pending-approval-BaKZ0b_s.js +22 -0
- package/dist/pending-approval-CBVZcFJn.js +22 -0
- package/dist/pending-approval-DiZ96D8v.js +22 -0
- package/dist/providers-CFQC39vg.js +5 -0
- package/dist/providers-DP8T0QCR.js +1089 -0
- package/dist/reminders-store-BSIw5Y5z.js +58 -0
- package/dist/reminders-store-Bus52SjO.js +58 -0
- package/dist/renderer-CmMjrkqN.js +225 -0
- package/dist/renderer-_Y9mEqMM.js +225 -0
- package/dist/renderer-h3ar94cf.js +228 -0
- package/dist/rules-D3GcY_lt.js +103 -0
- package/dist/rules-DFoset7W.js +103 -0
- package/dist/rules-eJw9i4RF.js +106 -0
- package/dist/run-main.js +461 -333
- package/dist/runner-C-syOqBr.js +1273 -0
- package/dist/runner-C73am--A.js +1273 -0
- package/dist/runner-DKLq9jhv.js +1273 -0
- package/dist/runner-Im-aCXhh.js +1273 -0
- package/dist/runner-NvAzKXbv.js +1273 -0
- package/dist/security-2DPBzs5F.js +4 -0
- package/dist/security-BhhX8wJx.js +73 -0
- package/dist/server-7tmTtdPU.js +4 -0
- package/dist/server-A38RPbRE.js +1291 -0
- package/dist/server-B0k_pCt5.js +4 -0
- package/dist/server-BErPWJZ5.js +4 -0
- package/dist/server-BKo-zifC.js +4 -0
- package/dist/server-Bav63Eqx.js +4 -0
- package/dist/server-BbWQWOH4.js +4 -0
- package/dist/server-BfHtA0Y2.js +1278 -0
- package/dist/server-BiYaxlFV.js +1287 -0
- package/dist/server-C6htB4FI.js +4 -0
- package/dist/server-CB7cjcj4.js +1278 -0
- package/dist/server-CNiOi5dN.js +1285 -0
- package/dist/server-CSC4npaT.js +1285 -0
- package/dist/server-CZfP2Poz.js +1278 -0
- package/dist/server-C_YVts3e.js +4 -0
- package/dist/server-CbQl0M21.js +1278 -0
- package/dist/server-Cj45rxn-.js +1292 -0
- package/dist/server-Ct7Fl3SE.js +1285 -0
- package/dist/server-D9q-3mLF.js +1292 -0
- package/dist/server-DRc26z9e.js +4 -0
- package/dist/server-DT7JjjVD.js +4 -0
- package/dist/server-DacRJyZn.js +4 -0
- package/dist/server-PCtHMXe2.js +1292 -0
- package/dist/server-wXCH_TCU.js +4 -0
- package/dist/session-store-7ZPOoB81.js +5 -0
- package/dist/session-store-BOa2y_EQ.js +5 -0
- package/dist/session-store-BYEr8j52.js +139 -0
- package/dist/session-store-Bx7lBD_a.js +141 -0
- package/dist/session-store-C13h7I2r.js +136 -0
- package/dist/session-store-CUHgJ0Xr.js +5 -0
- package/dist/session-store-cbtK6hx9.js +136 -0
- package/dist/session-store-eecMioKI.js +5 -0
- package/dist/sessions-tools-B5_ow-s7.js +5 -0
- package/dist/sessions-tools-CG2mvJo6.js +95 -0
- package/dist/sessions-tools-DVSejkNU.js +95 -0
- package/dist/sessions-tools-fOL1N3Zu.js +5 -0
- package/dist/skill-loader-99egKAGN.js +160 -0
- package/dist/skill-loader-Bl6pYxNN.js +160 -0
- package/dist/skill-loader-D4D5kfDu.js +7 -0
- package/dist/skill-loader-DwbmjEDa.js +7 -0
- package/dist/skill-runtime-1CrUOOGv.js +5 -0
- package/dist/skill-runtime-B-2O7Vgb.js +102 -0
- package/dist/skill-runtime-B7PutgyZ.js +5 -0
- package/dist/skill-runtime-BGNtPD_L.js +102 -0
- package/dist/skill-runtime-BUhMkMzO.js +5 -0
- package/dist/skill-runtime-Bv7fCCx8.js +102 -0
- package/dist/skill-runtime-Bx2HHcta.js +102 -0
- package/dist/skill-runtime-C6HVvnmN.js +5 -0
- package/dist/skill-runtime-CtSykP3r.js +102 -0
- package/dist/skill-runtime-DUAt8JM_.js +5 -0
- package/dist/skill-runtime-DZ6uJXGW.js +102 -0
- package/dist/skill-runtime-DaLnq_Jm.js +5 -0
- package/dist/skill-runtime-DpDbjL7y.js +102 -0
- package/dist/skill-runtime-acmnZSq7.js +102 -0
- package/dist/skill-runtime-dzuLMVSw.js +5 -0
- package/dist/skill-runtime-wiVnzSoJ.js +5 -0
- package/dist/src-B5lCcPXX.js +63 -0
- package/dist/src-B7Kxqi35.js +20 -0
- package/dist/src-B8DEmVd6.js +458 -0
- package/dist/src-BqbwzQQj.js +63 -0
- package/dist/src-C63ECu1t.js +63 -0
- package/dist/src-C65-5rOW.js +458 -0
- package/dist/src-CbTAVbeI.js +20 -0
- package/dist/src-Cmnclt47.js +63 -0
- package/dist/src-D0kptBSa.js +458 -0
- package/dist/src-DZtpIvWJ.js +63 -0
- package/dist/src-DjzS20TD.js +63 -0
- package/dist/src-DmPjS2Z4.js +458 -0
- package/dist/src-DmbIgW0O.js +63 -0
- package/dist/src-DsaXFru7.js +63 -0
- package/dist/src-Dt0TXI8r.js +458 -0
- package/dist/src-PPagVWuK.js +63 -0
- package/dist/src-rktqvEBJ.js +458 -0
- package/dist/src-tI8EOp6-.js +458 -0
- package/dist/src-zUHOCQgl.js +458 -0
- package/dist/src-zWhGmJSN.js +458 -0
- package/dist/sub-agent-tools-9k60L5mn.js +39 -0
- package/dist/sub-agent-tools-BBJf8oPD.js +39 -0
- package/dist/sub-agent-tools-BVCARpnF.js +39 -0
- package/dist/sub-agent-tools-Cx5BB5IO.js +39 -0
- package/dist/sub-agent-tools-DMT7jjBc.js +39 -0
- package/dist/sub-agent-tools-F-04gxf8.js +39 -0
- package/dist/sub-agent-tools-iBQiRKg6.js +39 -0
- package/dist/sub-agent-tools-kr921YOA.js +39 -0
- package/dist/theme-CLXvI6Hr.js +183 -0
- package/dist/theme-DdZT-Bq4.js +10 -0
- package/dist/theme-GEpjn_0G.js +180 -0
- package/dist/theme-hOlG-hDL.js +8 -0
- package/dist/tool-policy-D1zWYBKm.js +189 -0
- package/dist/tool-policy-TmXx_fpp.js +189 -0
- package/dist/tool-policy-YgysHf5s.js +189 -0
- package/dist/tts-elevenlabs-BT4WrEwy.js +61 -0
- package/dist/tts-elevenlabs-C62Wnnrg.js +61 -0
- package/dist/tts-elevenlabs-DmEFFeR8.js +61 -0
- package/dist/update-check-BeAPt4-f.js +98 -0
- package/dist/update-check-CaHNCDqe.js +6 -0
- package/dist/vision-B5DQ5hYa.js +121 -0
- package/dist/vision-XOSSQe4m.js +121 -0
- package/dist/vision-sIO3kwFy.js +121 -0
- package/dist/vision-tools-BHogJPuK.js +5 -0
- package/dist/vision-tools-BZhV8wg3.js +51 -0
- package/dist/vision-tools-BiDKd0UA.js +5 -0
- package/dist/vision-tools-CdRxilYR.js +5 -0
- package/dist/vision-tools-DnUjpQhI.js +51 -0
- package/dist/vision-tools-gtUq6d-x.js +51 -0
- package/dist/voice-transcription-5_iQE-0C.js +138 -0
- package/dist/voice-transcription-C3SuzK96.js +138 -0
- package/dist/voice-transcription-CYFj4Iv3.js +138 -0
- package/dist/voice-transcription-ygmlOkky.js +138 -0
- package/dist/website-watch-tools-BF-wR0UI.js +5 -0
- package/dist/website-watch-tools-CVh7RA5-.js +139 -0
- package/dist/website-watch-tools-CthBrGPP.js +5 -0
- package/dist/website-watch-tools-Oxf8Mv4j.js +139 -0
- package/package.json +1 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
const chalk = require_chunk.__toESM(require("chalk"));
|
|
3
|
+
const fs_extra = require_chunk.__toESM(require("fs-extra"));
|
|
4
|
+
const path = require_chunk.__toESM(require("path"));
|
|
5
|
+
const os = require_chunk.__toESM(require("os"));
|
|
6
|
+
const ws = require_chunk.__toESM(require("ws"));
|
|
7
|
+
const http = require_chunk.__toESM(require("http"));
|
|
8
|
+
const https = require_chunk.__toESM(require("https"));
|
|
9
|
+
const events = require_chunk.__toESM(require("events"));
|
|
10
|
+
|
|
11
|
+
//#region extensions/bluebubbles/src/connector.ts
|
|
12
|
+
const STATE_FILE = path.default.join(os.default.homedir(), ".hyperclaw", "bluebubbles-state.json");
|
|
13
|
+
function bbReq(serverUrl, password, method, endpoint, body) {
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
const url = new URL(`${serverUrl}/api/v1${endpoint}`);
|
|
16
|
+
url.searchParams.set("password", password);
|
|
17
|
+
const isHttps = url.protocol === "https:";
|
|
18
|
+
const mod = isHttps ? https.default : http.default;
|
|
19
|
+
const payload = body ? JSON.stringify(body) : null;
|
|
20
|
+
const req = mod.request({
|
|
21
|
+
hostname: url.hostname,
|
|
22
|
+
port: url.port || (isHttps ? 443 : 1234),
|
|
23
|
+
path: url.pathname + url.search,
|
|
24
|
+
method,
|
|
25
|
+
headers: payload ? {
|
|
26
|
+
"Content-Type": "application/json",
|
|
27
|
+
"Content-Length": Buffer.byteLength(payload)
|
|
28
|
+
} : {},
|
|
29
|
+
rejectUnauthorized: false
|
|
30
|
+
}, (res) => {
|
|
31
|
+
let data = "";
|
|
32
|
+
res.on("data", (c) => data += c);
|
|
33
|
+
res.on("end", () => {
|
|
34
|
+
try {
|
|
35
|
+
const r = JSON.parse(data);
|
|
36
|
+
if (r.status !== 200) reject(new Error(r.error?.message || "BB error"));
|
|
37
|
+
else resolve(r.data);
|
|
38
|
+
} catch {
|
|
39
|
+
reject(new Error("Invalid JSON"));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
req.on("error", reject);
|
|
44
|
+
if (payload) req.write(payload);
|
|
45
|
+
req.end();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
var BlueBubblesConnector = class extends events.EventEmitter {
|
|
49
|
+
config;
|
|
50
|
+
running = false;
|
|
51
|
+
ws = null;
|
|
52
|
+
lastMessageTs = 0;
|
|
53
|
+
constructor(config) {
|
|
54
|
+
super();
|
|
55
|
+
this.config = {
|
|
56
|
+
dmPolicy: "allowlist",
|
|
57
|
+
allowFrom: [],
|
|
58
|
+
approvedPairings: [],
|
|
59
|
+
pendingPairings: {},
|
|
60
|
+
...config
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
async connect() {
|
|
64
|
+
const info = await bbReq(this.config.serverUrl, this.config.password, "GET", "/server/info");
|
|
65
|
+
await this.loadState();
|
|
66
|
+
this.running = true;
|
|
67
|
+
console.log(chalk.default.green(` 🦅 BlueBubbles (iMessage): ${info?.os_version || "macOS"} server connected`));
|
|
68
|
+
this.emit("connected", { serverInfo: info });
|
|
69
|
+
this.connectWebSocket();
|
|
70
|
+
}
|
|
71
|
+
connectWebSocket() {
|
|
72
|
+
const url = new URL(this.config.serverUrl);
|
|
73
|
+
const wsUrl = `${url.protocol === "https:" ? "wss" : "ws"}://${url.hostname}:${url.port || 1234}`;
|
|
74
|
+
this.ws = new ws.WebSocket(`${wsUrl}?password=${encodeURIComponent(this.config.password)}`, { rejectUnauthorized: false });
|
|
75
|
+
this.ws.on("message", async (data) => {
|
|
76
|
+
try {
|
|
77
|
+
const event = JSON.parse(data.toString());
|
|
78
|
+
if (event.type === "new-message" || event.type === "updated-message") await this.handleMessage(event.data);
|
|
79
|
+
} catch {}
|
|
80
|
+
});
|
|
81
|
+
this.ws.on("close", () => {
|
|
82
|
+
if (this.running) setTimeout(() => this.connectWebSocket(), 5e3);
|
|
83
|
+
});
|
|
84
|
+
this.ws.on("error", () => {});
|
|
85
|
+
setInterval(() => {
|
|
86
|
+
if (this.ws?.readyState === ws.WebSocket.OPEN) this.ws.send(JSON.stringify({ type: "ping" }));
|
|
87
|
+
}, 3e4);
|
|
88
|
+
}
|
|
89
|
+
async handleMessage(msg) {
|
|
90
|
+
if (!msg || msg.isFromMe) return;
|
|
91
|
+
const text = msg.text;
|
|
92
|
+
const from = msg.handle?.address;
|
|
93
|
+
if (!text || !from) return;
|
|
94
|
+
const ts = msg.dateCreated || 0;
|
|
95
|
+
if (ts <= this.lastMessageTs) return;
|
|
96
|
+
this.lastMessageTs = ts;
|
|
97
|
+
await this.saveState();
|
|
98
|
+
const allowed = await this.checkDMPolicy(from, text);
|
|
99
|
+
if (!allowed) return;
|
|
100
|
+
this.emit("message", {
|
|
101
|
+
id: msg.guid,
|
|
102
|
+
channelId: "bluebubbles",
|
|
103
|
+
from,
|
|
104
|
+
chatId: msg.chats?.[0]?.guid || from,
|
|
105
|
+
text,
|
|
106
|
+
timestamp: new Date(ts).toISOString(),
|
|
107
|
+
isDM: !msg.isGroup
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
async checkDMPolicy(from, text) {
|
|
111
|
+
if (this.config.dmPolicy === "none") return false;
|
|
112
|
+
if (this.config.dmPolicy === "open") return true;
|
|
113
|
+
if (this.config.dmPolicy === "allowlist") {
|
|
114
|
+
if (this.config.allowFrom.includes(from)) return true;
|
|
115
|
+
await this.sendMessage(from, "🦅 HyperClaw: Not on allowlist.");
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
if (this.config.dmPolicy === "pairing") {
|
|
119
|
+
if (this.config.approvedPairings.includes(from)) return true;
|
|
120
|
+
const upper = text.trim().toUpperCase();
|
|
121
|
+
if (this.config.pendingPairings[upper]) {
|
|
122
|
+
this.config.approvedPairings.push(from);
|
|
123
|
+
delete this.config.pendingPairings[upper];
|
|
124
|
+
await this.saveState();
|
|
125
|
+
await this.sendMessage(from, "🦅 Paired!");
|
|
126
|
+
this.emit("pairing:approved", {
|
|
127
|
+
userId: from,
|
|
128
|
+
channelId: "bluebubbles"
|
|
129
|
+
});
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
const code = Array.from({ length: 6 }, () => "ABCDEFGHJKLMNPQRSTUVWXYZ23456789"[Math.floor(Math.random() * 32)]).join("");
|
|
133
|
+
this.config.pendingPairings[code] = from;
|
|
134
|
+
await this.saveState();
|
|
135
|
+
await this.sendMessage(from, `🦅 Pairing code: ${code}\nApprove: hyperclaw pairing approve bluebubbles ${code}`);
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
async sendMessage(address, text) {
|
|
141
|
+
await bbReq(this.config.serverUrl, this.config.password, "POST", "/message/text", {
|
|
142
|
+
chatGuid: `iMessage;-;${address}`,
|
|
143
|
+
message: text.slice(0, 65536),
|
|
144
|
+
method: "apple-script"
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
disconnect() {
|
|
148
|
+
this.running = false;
|
|
149
|
+
this.ws?.close();
|
|
150
|
+
}
|
|
151
|
+
approvePairing(code) {
|
|
152
|
+
const upper = code.toUpperCase();
|
|
153
|
+
if (!this.config.pendingPairings[upper]) return false;
|
|
154
|
+
this.config.approvedPairings.push(this.config.pendingPairings[upper]);
|
|
155
|
+
delete this.config.pendingPairings[upper];
|
|
156
|
+
this.saveState();
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
async loadState() {
|
|
160
|
+
try {
|
|
161
|
+
const s = await fs_extra.default.readJson(STATE_FILE);
|
|
162
|
+
this.lastMessageTs = s.lastTs || 0;
|
|
163
|
+
if (s.p) this.config.pendingPairings = s.p;
|
|
164
|
+
if (s.a) this.config.approvedPairings = s.a;
|
|
165
|
+
} catch {}
|
|
166
|
+
}
|
|
167
|
+
async saveState() {
|
|
168
|
+
await fs_extra.default.ensureDir(path.default.dirname(STATE_FILE));
|
|
169
|
+
await fs_extra.default.writeJson(STATE_FILE, {
|
|
170
|
+
lastTs: this.lastMessageTs,
|
|
171
|
+
p: this.config.pendingPairings,
|
|
172
|
+
a: this.config.approvedPairings
|
|
173
|
+
}, { spaces: 2 });
|
|
174
|
+
}
|
|
175
|
+
isRunning() {
|
|
176
|
+
return this.running;
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
//#endregion
|
|
181
|
+
exports.BlueBubblesConnector = BlueBubblesConnector;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
const chalk = require_chunk.__toESM(require("chalk"));
|
|
3
|
+
const fs_extra = require_chunk.__toESM(require("fs-extra"));
|
|
4
|
+
const path = require_chunk.__toESM(require("path"));
|
|
5
|
+
const os = require_chunk.__toESM(require("os"));
|
|
6
|
+
const crypto = require_chunk.__toESM(require("crypto"));
|
|
7
|
+
const https = require_chunk.__toESM(require("https"));
|
|
8
|
+
const events = require_chunk.__toESM(require("events"));
|
|
9
|
+
|
|
10
|
+
//#region extensions/sms/src/connector.ts
|
|
11
|
+
const STATE_FILE = path.default.join(os.default.homedir(), ".hyperclaw", "sms-state.json");
|
|
12
|
+
function twilioRequest(accountSid, authToken, method, endpoint, body) {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
const auth = Buffer.from(`${accountSid}:${authToken}`).toString("base64");
|
|
15
|
+
const payload = body ? Object.entries(body).map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join("&") : null;
|
|
16
|
+
const req = https.default.request({
|
|
17
|
+
hostname: "api.twilio.com",
|
|
18
|
+
port: 443,
|
|
19
|
+
path: `/2010-04-01/Accounts/${accountSid}${endpoint}.json`,
|
|
20
|
+
method,
|
|
21
|
+
headers: {
|
|
22
|
+
"Authorization": `Basic ${auth}`,
|
|
23
|
+
...payload ? {
|
|
24
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
25
|
+
"Content-Length": Buffer.byteLength(payload)
|
|
26
|
+
} : {}
|
|
27
|
+
}
|
|
28
|
+
}, (res) => {
|
|
29
|
+
let data = "";
|
|
30
|
+
res.on("data", (c) => data += c);
|
|
31
|
+
res.on("end", () => {
|
|
32
|
+
try {
|
|
33
|
+
const r = JSON.parse(data);
|
|
34
|
+
if (res.statusCode && res.statusCode >= 400) reject(new Error(r.message || `Twilio ${res.statusCode}`));
|
|
35
|
+
else resolve(r);
|
|
36
|
+
} catch {
|
|
37
|
+
reject(new Error("Invalid JSON"));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
req.on("error", reject);
|
|
42
|
+
if (payload) req.write(payload);
|
|
43
|
+
req.end();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
var SMSConnector = class extends events.EventEmitter {
|
|
47
|
+
config;
|
|
48
|
+
running = false;
|
|
49
|
+
constructor(config) {
|
|
50
|
+
super();
|
|
51
|
+
this.config = {
|
|
52
|
+
dmPolicy: "allowlist",
|
|
53
|
+
allowFrom: [],
|
|
54
|
+
approvedPairings: [],
|
|
55
|
+
pendingPairings: {},
|
|
56
|
+
...config
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
async connect() {
|
|
60
|
+
await twilioRequest(this.config.accountSid, this.config.authToken, "GET", "");
|
|
61
|
+
await this.loadState();
|
|
62
|
+
this.running = true;
|
|
63
|
+
console.log(chalk.default.green(` 🦅 SMS: ${this.config.fromNumber} connected via Twilio`));
|
|
64
|
+
this.emit("connected", { number: this.config.fromNumber });
|
|
65
|
+
}
|
|
66
|
+
disconnect() {
|
|
67
|
+
this.running = false;
|
|
68
|
+
}
|
|
69
|
+
async handleWebhook(body, twilioSignature, webhookUrl) {
|
|
70
|
+
const params = Object.fromEntries(body.split("&").map((p) => {
|
|
71
|
+
const [k, v] = p.split("=");
|
|
72
|
+
return [decodeURIComponent(k), decodeURIComponent(v || "").replace(/\+/g, " ")];
|
|
73
|
+
}));
|
|
74
|
+
const from = params.From;
|
|
75
|
+
const text = params.Body;
|
|
76
|
+
const messageSid = params.MessageSid;
|
|
77
|
+
if (!from || !text) return;
|
|
78
|
+
if (twilioSignature && !this.verifySignature(body, twilioSignature, webhookUrl)) {
|
|
79
|
+
console.log(chalk.default.yellow(" ⚠ SMS: invalid Twilio signature"));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const allowed = await this.checkDMPolicy(from, text);
|
|
83
|
+
if (!allowed) return;
|
|
84
|
+
this.emit("message", {
|
|
85
|
+
id: messageSid,
|
|
86
|
+
channelId: "sms",
|
|
87
|
+
from,
|
|
88
|
+
chatId: from,
|
|
89
|
+
text,
|
|
90
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
91
|
+
isDM: true
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
verifySignature(body, signature, url) {
|
|
95
|
+
const params = Object.fromEntries(body.split("&").map((p) => {
|
|
96
|
+
const [k, v] = p.split("=");
|
|
97
|
+
return [decodeURIComponent(k), decodeURIComponent(v || "").replace(/\+/g, " ")];
|
|
98
|
+
}));
|
|
99
|
+
const sortedParams = Object.keys(params).sort().map((k) => `${k}${params[k]}`).join("");
|
|
100
|
+
const expected = crypto.default.createHmac("sha1", this.config.authToken).update(url + sortedParams).digest("base64");
|
|
101
|
+
try {
|
|
102
|
+
return crypto.default.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
|
|
103
|
+
} catch {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async checkDMPolicy(from, text) {
|
|
108
|
+
if (this.config.dmPolicy === "none") return false;
|
|
109
|
+
if (this.config.dmPolicy === "open") return true;
|
|
110
|
+
if (this.config.dmPolicy === "allowlist") {
|
|
111
|
+
if (this.config.allowFrom.includes(from)) return true;
|
|
112
|
+
await this.sendMessage(from, "🦅 HyperClaw: You are not on the allowlist.");
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
if (this.config.dmPolicy === "pairing") {
|
|
116
|
+
if (this.config.approvedPairings.includes(from)) return true;
|
|
117
|
+
const upper = text.trim().toUpperCase();
|
|
118
|
+
if (this.config.pendingPairings[upper]) {
|
|
119
|
+
this.config.approvedPairings.push(from);
|
|
120
|
+
delete this.config.pendingPairings[upper];
|
|
121
|
+
await this.saveState();
|
|
122
|
+
await this.sendMessage(from, "🦅 HyperClaw: Paired! You can now send messages.");
|
|
123
|
+
this.emit("pairing:approved", {
|
|
124
|
+
userId: from,
|
|
125
|
+
channelId: "sms"
|
|
126
|
+
});
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
const code = this.generateCode();
|
|
130
|
+
this.config.pendingPairings[code] = from;
|
|
131
|
+
await this.saveState();
|
|
132
|
+
await this.sendMessage(from, `🦅 HyperClaw Pairing: send this code to the owner: ${code}\nThey can approve with: hyperclaw pairing approve sms ${code}`);
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
async sendMessage(to, text) {
|
|
138
|
+
await twilioRequest(this.config.accountSid, this.config.authToken, "POST", "/Messages", {
|
|
139
|
+
From: this.config.fromNumber,
|
|
140
|
+
To: to,
|
|
141
|
+
Body: text.slice(0, 1600)
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
async getStatus(messageSid) {
|
|
145
|
+
const r = await twilioRequest(this.config.accountSid, this.config.authToken, "GET", `/Messages/${messageSid}`);
|
|
146
|
+
return r.status;
|
|
147
|
+
}
|
|
148
|
+
async broadcast(numbers, text) {
|
|
149
|
+
for (const num of numbers) await this.sendMessage(num, text).catch((e) => console.log(chalk.default.yellow(` ⚠ SMS broadcast failed to ${num}: ${e.message}`)));
|
|
150
|
+
}
|
|
151
|
+
generateCode() {
|
|
152
|
+
const chars = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
153
|
+
return Array.from({ length: 6 }, () => chars[Math.floor(Math.random() * chars.length)]).join("");
|
|
154
|
+
}
|
|
155
|
+
approvePairing(code) {
|
|
156
|
+
const upper = code.toUpperCase();
|
|
157
|
+
if (!this.config.pendingPairings[upper]) return false;
|
|
158
|
+
this.config.approvedPairings.push(this.config.pendingPairings[upper]);
|
|
159
|
+
delete this.config.pendingPairings[upper];
|
|
160
|
+
this.saveState();
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
addToAllowlist(number) {
|
|
164
|
+
if (!this.config.allowFrom.includes(number)) {
|
|
165
|
+
this.config.allowFrom.push(number);
|
|
166
|
+
this.saveState();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async loadState() {
|
|
170
|
+
try {
|
|
171
|
+
const s = await fs_extra.default.readJson(STATE_FILE);
|
|
172
|
+
if (s.pendingPairings) this.config.pendingPairings = s.pendingPairings;
|
|
173
|
+
if (s.approvedPairings) this.config.approvedPairings = s.approvedPairings;
|
|
174
|
+
} catch {}
|
|
175
|
+
}
|
|
176
|
+
async saveState() {
|
|
177
|
+
await fs_extra.default.ensureDir(path.default.dirname(STATE_FILE));
|
|
178
|
+
await fs_extra.default.writeJson(STATE_FILE, {
|
|
179
|
+
pendingPairings: this.config.pendingPairings,
|
|
180
|
+
approvedPairings: this.config.approvedPairings
|
|
181
|
+
}, { spaces: 2 });
|
|
182
|
+
}
|
|
183
|
+
isRunning() {
|
|
184
|
+
return this.running;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
exports.SMSConnector = SMSConnector;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
const chalk = require_chunk.__toESM(require("chalk"));
|
|
3
|
+
const fs_extra = require_chunk.__toESM(require("fs-extra"));
|
|
4
|
+
const path = require_chunk.__toESM(require("path"));
|
|
5
|
+
const os = require_chunk.__toESM(require("os"));
|
|
6
|
+
const https = require_chunk.__toESM(require("https"));
|
|
7
|
+
const events = require_chunk.__toESM(require("events"));
|
|
8
|
+
|
|
9
|
+
//#region extensions/telegram/src/connector.ts
|
|
10
|
+
function tgDownloadFile(token, filePath) {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
const req = https.default.request({
|
|
13
|
+
hostname: "api.telegram.org",
|
|
14
|
+
port: 443,
|
|
15
|
+
path: `/file/bot${token}/${filePath}`,
|
|
16
|
+
method: "GET"
|
|
17
|
+
}, (res) => {
|
|
18
|
+
const chunks = [];
|
|
19
|
+
res.on("data", (c) => chunks.push(c));
|
|
20
|
+
res.on("end", () => resolve(Buffer.concat(chunks)));
|
|
21
|
+
});
|
|
22
|
+
req.on("error", reject);
|
|
23
|
+
req.setTimeout(3e4, () => {
|
|
24
|
+
req.destroy();
|
|
25
|
+
reject(new Error("Download timeout"));
|
|
26
|
+
});
|
|
27
|
+
req.end();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function tgRequest(token, method, body) {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
const payload = body ? JSON.stringify(body) : null;
|
|
33
|
+
const req = https.default.request({
|
|
34
|
+
hostname: "api.telegram.org",
|
|
35
|
+
port: 443,
|
|
36
|
+
path: `/bot${token}/${method}`,
|
|
37
|
+
method: payload ? "POST" : "GET",
|
|
38
|
+
headers: payload ? {
|
|
39
|
+
"Content-Type": "application/json",
|
|
40
|
+
"Content-Length": Buffer.byteLength(payload)
|
|
41
|
+
} : {}
|
|
42
|
+
}, (res) => {
|
|
43
|
+
let data = "";
|
|
44
|
+
res.on("data", (c) => data += c);
|
|
45
|
+
res.on("end", () => {
|
|
46
|
+
try {
|
|
47
|
+
const r = JSON.parse(data);
|
|
48
|
+
if (r.ok) resolve(r.result);
|
|
49
|
+
else reject(new Error(r.description || "Telegram API error"));
|
|
50
|
+
} catch {
|
|
51
|
+
reject(new Error("Invalid JSON"));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
req.on("error", reject);
|
|
56
|
+
req.setTimeout(35e3, () => {
|
|
57
|
+
req.destroy();
|
|
58
|
+
reject(new Error("Timeout"));
|
|
59
|
+
});
|
|
60
|
+
if (payload) req.write(payload);
|
|
61
|
+
req.end();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const STATE_FILE = path.default.join(os.default.homedir(), ".hyperclaw", "telegram-state.json");
|
|
65
|
+
function sleep(ms) {
|
|
66
|
+
return new Promise((r) => setTimeout(r, ms));
|
|
67
|
+
}
|
|
68
|
+
function generateCode() {
|
|
69
|
+
const chars = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
70
|
+
return Array.from({ length: 6 }, () => chars[Math.floor(Math.random() * chars.length)]).join("");
|
|
71
|
+
}
|
|
72
|
+
function chunkText(text, max) {
|
|
73
|
+
if (text.length <= max) return [text];
|
|
74
|
+
const chunks = [];
|
|
75
|
+
let i = 0;
|
|
76
|
+
while (i < text.length) {
|
|
77
|
+
let end = Math.min(i + max, text.length);
|
|
78
|
+
if (end < text.length) {
|
|
79
|
+
const nl = text.lastIndexOf("\n", end);
|
|
80
|
+
if (nl > i) end = nl + 1;
|
|
81
|
+
}
|
|
82
|
+
chunks.push(text.slice(i, end));
|
|
83
|
+
i = end;
|
|
84
|
+
}
|
|
85
|
+
return chunks;
|
|
86
|
+
}
|
|
87
|
+
var TelegramConnector = class extends events.EventEmitter {
|
|
88
|
+
token;
|
|
89
|
+
config;
|
|
90
|
+
offset = 0;
|
|
91
|
+
running = false;
|
|
92
|
+
botInfo = null;
|
|
93
|
+
constructor(token, config) {
|
|
94
|
+
super();
|
|
95
|
+
this.token = token;
|
|
96
|
+
this.config = {
|
|
97
|
+
token,
|
|
98
|
+
dmPolicy: "allowlist",
|
|
99
|
+
allowFrom: [],
|
|
100
|
+
pendingPairings: {},
|
|
101
|
+
approvedPairings: [],
|
|
102
|
+
...config
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
async connect() {
|
|
106
|
+
this.botInfo = await tgRequest(this.token, "getMe");
|
|
107
|
+
console.log(chalk.default.green(` 🦅 Telegram: @${this.botInfo?.username} connected`));
|
|
108
|
+
await this.loadState();
|
|
109
|
+
this.running = true;
|
|
110
|
+
this.pollLoop();
|
|
111
|
+
this.emit("connected", this.botInfo);
|
|
112
|
+
}
|
|
113
|
+
async disconnect() {
|
|
114
|
+
this.running = false;
|
|
115
|
+
await this.saveState();
|
|
116
|
+
}
|
|
117
|
+
async pollLoop() {
|
|
118
|
+
while (this.running) try {
|
|
119
|
+
const updates = await tgRequest(this.token, "getUpdates", {
|
|
120
|
+
offset: this.offset,
|
|
121
|
+
timeout: 30,
|
|
122
|
+
allowed_updates: ["message"]
|
|
123
|
+
});
|
|
124
|
+
for (const u of updates) {
|
|
125
|
+
this.offset = u.update_id + 1;
|
|
126
|
+
await this.handleUpdate(u).catch((e) => console.log(chalk.default.yellow(` ⚠ ${e.message}`)));
|
|
127
|
+
}
|
|
128
|
+
} catch (e) {
|
|
129
|
+
if (this.running) {
|
|
130
|
+
console.log(chalk.default.yellow(` ⚠ Telegram poll: ${e.message}`));
|
|
131
|
+
await sleep(5e3);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async handleUpdate(u) {
|
|
136
|
+
const msg = u.message || u.edited_message;
|
|
137
|
+
if (!msg) return;
|
|
138
|
+
const text = msg.text?.trim() || "";
|
|
139
|
+
if (!text && !msg.voice) return;
|
|
140
|
+
const userId = String(msg.from?.id || "");
|
|
141
|
+
const isDM = msg.chat.type === "private";
|
|
142
|
+
const isGroup = msg.chat.type === "group" || msg.chat.type === "supergroup";
|
|
143
|
+
if (isDM && !await this.checkDMPolicy(userId, msg.chat.id, text || "[voice note]")) return;
|
|
144
|
+
let finalText = text || "[voice note]";
|
|
145
|
+
if (isGroup) {
|
|
146
|
+
const groupAllowFrom = this.config.groupAllowFrom ?? [];
|
|
147
|
+
if (groupAllowFrom.length > 0 && !groupAllowFrom.includes(String(msg.chat.id))) return;
|
|
148
|
+
const activation = this.config.groupActivation ?? "mention";
|
|
149
|
+
if (activation === "mention") {
|
|
150
|
+
const botUsername = this.botInfo?.username ? `@${this.botInfo.username}`.toLowerCase() : "";
|
|
151
|
+
const mentioned = botUsername && text.toLowerCase().includes(botUsername);
|
|
152
|
+
const isReplyToBot = msg.reply_to_message?.from?.is_bot && msg.reply_to_message.from.id === this.botInfo?.id;
|
|
153
|
+
if (!mentioned && !isReplyToBot) return;
|
|
154
|
+
if (mentioned && botUsername) finalText = text.replace(new RegExp(botUsername, "gi"), "").trim() || finalText;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
let audioPath;
|
|
158
|
+
if (msg?.voice?.file_id) try {
|
|
159
|
+
const file = await tgRequest(this.token, "getFile", { file_id: msg.voice.file_id });
|
|
160
|
+
const buf = await tgDownloadFile(this.token, file.file_path);
|
|
161
|
+
const ext = (file.file_path || "").split(".").pop() || "oga";
|
|
162
|
+
const tmp = path.default.join(os.default.tmpdir(), `hyperclaw-tg-voice-${msg.message_id}.${ext}`);
|
|
163
|
+
await fs_extra.default.writeFile(tmp, buf);
|
|
164
|
+
audioPath = tmp;
|
|
165
|
+
} catch (e) {
|
|
166
|
+
console.log(chalk.default.yellow(` ⚠ Telegram voice download failed: ${e.message}`));
|
|
167
|
+
}
|
|
168
|
+
this.emit("message", {
|
|
169
|
+
id: String(msg.message_id),
|
|
170
|
+
channelId: "telegram",
|
|
171
|
+
from: userId,
|
|
172
|
+
fromUsername: msg.from?.username,
|
|
173
|
+
chatId: msg.chat.id,
|
|
174
|
+
text: finalText,
|
|
175
|
+
audioPath,
|
|
176
|
+
timestamp: new Date(msg.date * 1e3).toISOString(),
|
|
177
|
+
isDM
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
async checkDMPolicy(userId, chatId, text) {
|
|
181
|
+
if (this.config.dmPolicy === "none") return false;
|
|
182
|
+
if (this.config.dmPolicy === "open") return true;
|
|
183
|
+
if (this.config.dmPolicy === "allowlist") {
|
|
184
|
+
if (this.config.allowFrom.includes(userId)) return true;
|
|
185
|
+
await this.sendMessage(chatId, `🦅 *HyperClaw*\n\nYou are not on the allowlist.`);
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
if (this.config.dmPolicy === "pairing") {
|
|
189
|
+
if (this.config.approvedPairings.includes(userId)) return true;
|
|
190
|
+
const upper = text.trim().toUpperCase();
|
|
191
|
+
if (this.config.pendingPairings[upper]) {
|
|
192
|
+
this.config.approvedPairings.push(userId);
|
|
193
|
+
delete this.config.pendingPairings[upper];
|
|
194
|
+
await this.saveState();
|
|
195
|
+
await this.sendMessage(chatId, `🦅 *Paired!* You can now send messages.`);
|
|
196
|
+
this.emit("pairing:approved", {
|
|
197
|
+
userId,
|
|
198
|
+
channelId: "telegram"
|
|
199
|
+
});
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
const code = generateCode();
|
|
203
|
+
this.config.pendingPairings[code] = userId;
|
|
204
|
+
await this.saveState();
|
|
205
|
+
await this.sendMessage(chatId, `🦅 *HyperClaw Pairing*\n\nSend the owner this code:\n\`${code}\`\n\nApprove with:\n\`hyperclaw pairing approve telegram ${code}\``);
|
|
206
|
+
console.log(chalk.default.cyan(` 🦅 Telegram pairing from ${userId} — code: ${code}`));
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
async sendMessage(chatId, text, opts = {}) {
|
|
212
|
+
const chunks = chunkText(text, 4096);
|
|
213
|
+
let last = null;
|
|
214
|
+
for (const chunk of chunks) last = await tgRequest(this.token, "sendMessage", {
|
|
215
|
+
chat_id: chatId,
|
|
216
|
+
text: chunk,
|
|
217
|
+
parse_mode: opts.parse_mode || "Markdown",
|
|
218
|
+
disable_web_page_preview: opts.disable_web_page_preview ?? true,
|
|
219
|
+
...opts.reply_to_message_id ? { reply_to_message_id: opts.reply_to_message_id } : {}
|
|
220
|
+
});
|
|
221
|
+
return last;
|
|
222
|
+
}
|
|
223
|
+
async sendTyping(chatId) {
|
|
224
|
+
await tgRequest(this.token, "sendChatAction", {
|
|
225
|
+
chat_id: chatId,
|
|
226
|
+
action: "typing"
|
|
227
|
+
}).catch(() => {});
|
|
228
|
+
}
|
|
229
|
+
approvePairing(code) {
|
|
230
|
+
const upper = code.toUpperCase();
|
|
231
|
+
if (!this.config.pendingPairings[upper]) return false;
|
|
232
|
+
const userId = this.config.pendingPairings[upper];
|
|
233
|
+
this.config.approvedPairings.push(userId);
|
|
234
|
+
delete this.config.pendingPairings[upper];
|
|
235
|
+
this.saveState();
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
addToAllowlist(userId) {
|
|
239
|
+
if (!this.config.allowFrom.includes(userId)) {
|
|
240
|
+
this.config.allowFrom.push(userId);
|
|
241
|
+
this.saveState();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
listPendingPairings() {
|
|
245
|
+
return Object.entries(this.config.pendingPairings).map(([code, userId]) => ({
|
|
246
|
+
code,
|
|
247
|
+
userId
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
handleWebhookPayload(body) {
|
|
251
|
+
try {
|
|
252
|
+
this.handleUpdate(JSON.parse(body));
|
|
253
|
+
} catch {}
|
|
254
|
+
}
|
|
255
|
+
async loadState() {
|
|
256
|
+
try {
|
|
257
|
+
const s = await fs_extra.default.readJson(STATE_FILE);
|
|
258
|
+
this.offset = s.offset || 0;
|
|
259
|
+
if (s.pendingPairings) this.config.pendingPairings = s.pendingPairings;
|
|
260
|
+
if (s.approvedPairings) this.config.approvedPairings = s.approvedPairings;
|
|
261
|
+
} catch {}
|
|
262
|
+
}
|
|
263
|
+
async saveState() {
|
|
264
|
+
await fs_extra.default.ensureDir(path.default.dirname(STATE_FILE));
|
|
265
|
+
await fs_extra.default.writeJson(STATE_FILE, {
|
|
266
|
+
offset: this.offset,
|
|
267
|
+
pendingPairings: this.config.pendingPairings,
|
|
268
|
+
approvedPairings: this.config.approvedPairings
|
|
269
|
+
}, { spaces: 2 });
|
|
270
|
+
}
|
|
271
|
+
isRunning() {
|
|
272
|
+
return this.running;
|
|
273
|
+
}
|
|
274
|
+
getBotInfo() {
|
|
275
|
+
return this.botInfo;
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
//#endregion
|
|
280
|
+
exports.TelegramConnector = TelegramConnector;
|