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,552 @@
|
|
|
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/slack/src/connector.ts
|
|
11
|
+
const STATE_BASE = path.default.join(os.default.homedir(), ".hyperclaw");
|
|
12
|
+
const DEFAULT_CHUNK = 3e3;
|
|
13
|
+
function slackApi(token, method, body = {}) {
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
const payload = JSON.stringify(body);
|
|
16
|
+
const req = https.default.request({
|
|
17
|
+
hostname: "slack.com",
|
|
18
|
+
port: 443,
|
|
19
|
+
path: `/api/${method}`,
|
|
20
|
+
method: "POST",
|
|
21
|
+
headers: {
|
|
22
|
+
Authorization: `Bearer ${token}`,
|
|
23
|
+
"Content-Type": "application/json; charset=utf-8",
|
|
24
|
+
"Content-Length": Buffer.byteLength(payload)
|
|
25
|
+
}
|
|
26
|
+
}, (res) => {
|
|
27
|
+
let data = "";
|
|
28
|
+
res.on("data", (c) => data += c);
|
|
29
|
+
res.on("end", () => {
|
|
30
|
+
try {
|
|
31
|
+
const r = JSON.parse(data);
|
|
32
|
+
if (!r.ok) reject(new Error(r.error || "Slack API error"));
|
|
33
|
+
else resolve(r);
|
|
34
|
+
} catch {
|
|
35
|
+
reject(new Error("Slack: invalid JSON"));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
req.on("error", reject);
|
|
40
|
+
req.setTimeout(3e4, () => {
|
|
41
|
+
req.destroy();
|
|
42
|
+
reject(new Error("Slack API timeout"));
|
|
43
|
+
});
|
|
44
|
+
req.write(payload);
|
|
45
|
+
req.end();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function chunkText(text, limit, mode) {
|
|
49
|
+
if (mode === "newline") {
|
|
50
|
+
const paras = text.split(/\n\n+/);
|
|
51
|
+
const chunks$1 = [];
|
|
52
|
+
let cur = "";
|
|
53
|
+
for (const p of paras) if ((cur + "\n\n" + p).length > limit && cur) {
|
|
54
|
+
chunks$1.push(cur.trim());
|
|
55
|
+
cur = p;
|
|
56
|
+
} else cur = cur ? cur + "\n\n" + p : p;
|
|
57
|
+
if (cur) chunks$1.push(cur.trim());
|
|
58
|
+
return chunks$1.filter(Boolean);
|
|
59
|
+
}
|
|
60
|
+
const chunks = [];
|
|
61
|
+
for (let i = 0; i < text.length; i += limit) chunks.push(text.slice(i, i + limit));
|
|
62
|
+
return chunks.length ? chunks : [""];
|
|
63
|
+
}
|
|
64
|
+
function generateCode() {
|
|
65
|
+
return Array.from({ length: 6 }, () => "ABCDEFGHJKLMNPQRSTUVWXYZ23456789"[Math.floor(Math.random() * 32)]).join("");
|
|
66
|
+
}
|
|
67
|
+
var SlackAccount = class extends events.EventEmitter {
|
|
68
|
+
cfg;
|
|
69
|
+
accountId;
|
|
70
|
+
botUserId = "";
|
|
71
|
+
teamName = "";
|
|
72
|
+
running = false;
|
|
73
|
+
wsReconnectDelay = 1e3;
|
|
74
|
+
constructor(accountId, cfg) {
|
|
75
|
+
super();
|
|
76
|
+
this.accountId = accountId;
|
|
77
|
+
this.cfg = {
|
|
78
|
+
mode: "socket",
|
|
79
|
+
userTokenReadOnly: true,
|
|
80
|
+
textChunkLimit: DEFAULT_CHUNK,
|
|
81
|
+
chunkMode: "length",
|
|
82
|
+
streaming: "partial",
|
|
83
|
+
nativeStreaming: true,
|
|
84
|
+
dmPolicy: "pairing",
|
|
85
|
+
allowFrom: [],
|
|
86
|
+
groupPolicy: "allowlist",
|
|
87
|
+
channels: {},
|
|
88
|
+
replyToMode: "off",
|
|
89
|
+
thread: {
|
|
90
|
+
historyScope: "thread",
|
|
91
|
+
inheritParent: false,
|
|
92
|
+
initialHistoryLimit: 20
|
|
93
|
+
},
|
|
94
|
+
actions: {
|
|
95
|
+
messages: true,
|
|
96
|
+
reactions: true,
|
|
97
|
+
pins: true,
|
|
98
|
+
memberInfo: true,
|
|
99
|
+
emojiList: true
|
|
100
|
+
},
|
|
101
|
+
...cfg
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
async authenticate() {
|
|
105
|
+
const token = this.cfg.botToken;
|
|
106
|
+
const auth = await slackApi(token, "auth.test");
|
|
107
|
+
this.botUserId = auth.user_id;
|
|
108
|
+
this.teamName = auth.team;
|
|
109
|
+
console.log(chalk.default.green(` 💼 Slack [${this.accountId}]: @${auth.user} in ${auth.team}`));
|
|
110
|
+
}
|
|
111
|
+
async connect() {
|
|
112
|
+
await this.loadState();
|
|
113
|
+
await this.authenticate();
|
|
114
|
+
this.running = true;
|
|
115
|
+
this.emit("connected", {
|
|
116
|
+
userId: this.botUserId,
|
|
117
|
+
team: this.teamName,
|
|
118
|
+
accountId: this.accountId
|
|
119
|
+
});
|
|
120
|
+
const mode = this.cfg.mode ?? "socket";
|
|
121
|
+
if (mode === "socket") this.connectSocketMode();
|
|
122
|
+
}
|
|
123
|
+
disconnect() {
|
|
124
|
+
this.running = false;
|
|
125
|
+
}
|
|
126
|
+
async connectSocketMode() {
|
|
127
|
+
if (!this.cfg.appToken) {
|
|
128
|
+
console.error(`[slack:${this.accountId}] Socket Mode requires appToken (xapp-...)`);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
let WebSocketImpl;
|
|
132
|
+
try {
|
|
133
|
+
WebSocketImpl = await import("ws");
|
|
134
|
+
} catch {
|
|
135
|
+
console.error(`[slack:${this.accountId}] ws package not found — install: npm i ws`);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
while (this.running) try {
|
|
139
|
+
const resp = await slackApi(this.cfg.appToken, "apps.connections.open");
|
|
140
|
+
const wsUrl = resp.url;
|
|
141
|
+
await new Promise((resolve) => {
|
|
142
|
+
const WS = WebSocketImpl.default ?? WebSocketImpl;
|
|
143
|
+
const ws = new WS(wsUrl);
|
|
144
|
+
ws.on("open", () => {
|
|
145
|
+
this.wsReconnectDelay = 1e3;
|
|
146
|
+
});
|
|
147
|
+
ws.on("message", (raw) => {
|
|
148
|
+
let envelope;
|
|
149
|
+
try {
|
|
150
|
+
envelope = JSON.parse(raw.toString());
|
|
151
|
+
} catch {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (envelope.envelope_id) ws.send(JSON.stringify({ envelope_id: envelope.envelope_id }));
|
|
155
|
+
this.handleSocketEnvelope(envelope);
|
|
156
|
+
});
|
|
157
|
+
ws.on("close", () => resolve());
|
|
158
|
+
ws.on("error", () => resolve());
|
|
159
|
+
});
|
|
160
|
+
if (!this.running) break;
|
|
161
|
+
await new Promise((r) => setTimeout(r, this.wsReconnectDelay));
|
|
162
|
+
this.wsReconnectDelay = Math.min(this.wsReconnectDelay * 2, 3e4);
|
|
163
|
+
} catch (e) {
|
|
164
|
+
if (this.running) {
|
|
165
|
+
console.log(chalk.default.yellow(` ⚠ Slack [${this.accountId}] socket: ${e.message}`));
|
|
166
|
+
await new Promise((r) => setTimeout(r, this.wsReconnectDelay));
|
|
167
|
+
this.wsReconnectDelay = Math.min(this.wsReconnectDelay * 2, 3e4);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
async handleSocketEnvelope(envelope) {
|
|
172
|
+
const type = envelope.type || "";
|
|
173
|
+
switch (type) {
|
|
174
|
+
case "hello": break;
|
|
175
|
+
case "disconnect": break;
|
|
176
|
+
case "events_api": {
|
|
177
|
+
const payload = envelope.payload || {};
|
|
178
|
+
if (payload.type === "event_callback") await this.handleEvent(payload.event, payload);
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
case "slash_commands": {
|
|
182
|
+
const p = envelope.payload || {};
|
|
183
|
+
if (p.command || p.user_id) await this.handleSlashCommand(p);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case "block_actions":
|
|
187
|
+
case "interactive": {
|
|
188
|
+
const p = envelope.payload || {};
|
|
189
|
+
this.emit("interaction", {
|
|
190
|
+
accountId: this.accountId,
|
|
191
|
+
type,
|
|
192
|
+
payload: p
|
|
193
|
+
});
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
async handleWebhook(body, signature, timestamp) {
|
|
199
|
+
if (!this.verifySignature(body, signature, timestamp)) {
|
|
200
|
+
console.log(chalk.default.yellow(` ⚠ Slack [${this.accountId}]: invalid signature`));
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
let payload;
|
|
204
|
+
try {
|
|
205
|
+
payload = JSON.parse(body);
|
|
206
|
+
} catch {
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
if (payload.type === "url_verification") return payload.challenge;
|
|
210
|
+
if (payload.type === "event_callback") await this.handleEvent(payload.event, payload);
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
verifySignature(body, signature, timestamp) {
|
|
214
|
+
if (!this.cfg.signingSecret) return false;
|
|
215
|
+
const ts = parseInt(timestamp);
|
|
216
|
+
if (Math.abs(Date.now() / 1e3 - ts) > 300) return false;
|
|
217
|
+
const baseString = `v0:${timestamp}:${body}`;
|
|
218
|
+
const hash = "v0=" + crypto.default.createHmac("sha256", this.cfg.signingSecret).update(baseString).digest("hex");
|
|
219
|
+
try {
|
|
220
|
+
return crypto.default.timingSafeEqual(Buffer.from(hash), Buffer.from(signature));
|
|
221
|
+
} catch {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
async handleEvent(event, _outer) {
|
|
226
|
+
if (!event) return;
|
|
227
|
+
if (event.bot_id || event.user === this.botUserId) return;
|
|
228
|
+
const evType = event.type || "";
|
|
229
|
+
if (["reaction_added", "reaction_removed"].includes(evType)) {
|
|
230
|
+
this.emit("system_event", {
|
|
231
|
+
accountId: this.accountId,
|
|
232
|
+
type: evType,
|
|
233
|
+
event
|
|
234
|
+
});
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
if ([
|
|
238
|
+
"member_joined_channel",
|
|
239
|
+
"member_left_channel",
|
|
240
|
+
"channel_rename",
|
|
241
|
+
"pin_added",
|
|
242
|
+
"pin_removed"
|
|
243
|
+
].includes(evType)) {
|
|
244
|
+
this.emit("system_event", {
|
|
245
|
+
accountId: this.accountId,
|
|
246
|
+
type: evType,
|
|
247
|
+
event
|
|
248
|
+
});
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
if (evType !== "message" && evType !== "app_mention") return;
|
|
252
|
+
if (!event.text || !event.user || !event.channel) return;
|
|
253
|
+
if (event.subtype && event.subtype !== "file_share") return;
|
|
254
|
+
const channelType = event.channel_type || "";
|
|
255
|
+
const isDM = channelType === "im";
|
|
256
|
+
const isGroup = channelType === "mpim";
|
|
257
|
+
const isChannel = !isDM && !isGroup;
|
|
258
|
+
const isAppMention = evType === "app_mention";
|
|
259
|
+
const threadTs = event.thread_ts;
|
|
260
|
+
const ts = event.ts || "";
|
|
261
|
+
const text = event.text.replace(/<@[A-Z0-9]+>/g, "").trim();
|
|
262
|
+
if (isDM) {
|
|
263
|
+
const dmEnabled = this.cfg.dm?.enabled !== false;
|
|
264
|
+
if (!dmEnabled) return;
|
|
265
|
+
const allowed = await this.checkDMPolicy(event.user, event.channel, text, ts);
|
|
266
|
+
if (!allowed) return;
|
|
267
|
+
} else if (isGroup) {
|
|
268
|
+
const groupEnabled = this.cfg.dm?.groupEnabled === true;
|
|
269
|
+
if (!groupEnabled) return;
|
|
270
|
+
const groupChannels = this.cfg.dm?.groupChannels;
|
|
271
|
+
if (groupChannels?.length && !groupChannels.includes(event.channel)) return;
|
|
272
|
+
} else if (!this.checkChannelPolicy(event.channel, event.user, text, isAppMention)) return;
|
|
273
|
+
this.addReaction(this.resolveAckReaction(), event.channel, ts);
|
|
274
|
+
const chatType = isDM ? "direct" : isGroup ? "group" : "channel";
|
|
275
|
+
const replyToMode = this.resolveReplyToMode(chatType);
|
|
276
|
+
this.emit("message", {
|
|
277
|
+
channelId: "slack",
|
|
278
|
+
accountId: this.accountId,
|
|
279
|
+
chatId: event.channel,
|
|
280
|
+
from: event.user,
|
|
281
|
+
text,
|
|
282
|
+
ts,
|
|
283
|
+
threadTs,
|
|
284
|
+
isDM,
|
|
285
|
+
isGroup,
|
|
286
|
+
isChannel,
|
|
287
|
+
chatType,
|
|
288
|
+
replyToMode
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
async handleSlashCommand(payload) {
|
|
292
|
+
const text = [payload.command, payload.text].filter(Boolean).join(" ");
|
|
293
|
+
const userId = payload.user_id || "";
|
|
294
|
+
const channelId = payload.channel_id || "";
|
|
295
|
+
if (!userId || !channelId) return;
|
|
296
|
+
this.emit("message", {
|
|
297
|
+
channelId: "slack",
|
|
298
|
+
accountId: this.accountId,
|
|
299
|
+
chatId: channelId,
|
|
300
|
+
from: userId,
|
|
301
|
+
text,
|
|
302
|
+
isDM: false,
|
|
303
|
+
isSlashCommand: true,
|
|
304
|
+
ephemeral: this.cfg.slashCommand?.ephemeral !== false
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
async checkDMPolicy(userId, channelId, text, ts) {
|
|
308
|
+
const policy = this.cfg.dm?.policy ?? this.cfg.dmPolicy ?? "pairing";
|
|
309
|
+
const allowFrom = this.cfg.allowFrom ?? this.cfg.dm?.allowFrom ?? [];
|
|
310
|
+
switch (policy) {
|
|
311
|
+
case "disabled": return false;
|
|
312
|
+
case "open": return true;
|
|
313
|
+
case "allowlist":
|
|
314
|
+
if (allowFrom.includes(userId) || allowFrom.includes("*")) return true;
|
|
315
|
+
await this.sendMessage(channelId, "HyperClaw: Not on allowlist.");
|
|
316
|
+
return false;
|
|
317
|
+
case "pairing": {
|
|
318
|
+
if (this.cfg.approvedPairings.includes(userId)) return true;
|
|
319
|
+
const upper = text.trim().toUpperCase().match(/[A-Z0-9]{6}/)?.[0];
|
|
320
|
+
if (upper && this.cfg.pendingPairings[upper]) {
|
|
321
|
+
this.cfg.approvedPairings.push(userId);
|
|
322
|
+
delete this.cfg.pendingPairings[upper];
|
|
323
|
+
await this.saveState();
|
|
324
|
+
await this.sendMessage(channelId, "Paired! You can now send messages.");
|
|
325
|
+
this.emit("pairing:approved", {
|
|
326
|
+
userId,
|
|
327
|
+
channelId: "slack",
|
|
328
|
+
accountId: this.accountId
|
|
329
|
+
});
|
|
330
|
+
return true;
|
|
331
|
+
}
|
|
332
|
+
const code = generateCode();
|
|
333
|
+
this.cfg.pendingPairings[code] = userId;
|
|
334
|
+
await this.saveState();
|
|
335
|
+
await this.sendMessage(channelId, `*HyperClaw Pairing*\n\nCode: \`${code}\`\nApprove: \`hyperclaw pairing approve slack ${code}\``);
|
|
336
|
+
return false;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
checkChannelPolicy(channelId, userId, text, isAppMention) {
|
|
342
|
+
const policy = this.cfg.groupPolicy ?? "allowlist";
|
|
343
|
+
if (policy === "disabled") return false;
|
|
344
|
+
const chCfg = this.cfg.channels?.[channelId] || {};
|
|
345
|
+
if (policy === "open") {
|
|
346
|
+
if (chCfg.allowFrom?.length && !chCfg.allowFrom.includes(userId)) return false;
|
|
347
|
+
if (chCfg.users?.length && !chCfg.users.includes(userId)) return false;
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
if (!this.cfg.channels?.[channelId]) return isAppMention;
|
|
351
|
+
if (chCfg.allowFrom?.length && !chCfg.allowFrom.includes(userId)) return false;
|
|
352
|
+
if (chCfg.users?.length && !chCfg.users.includes(userId)) return false;
|
|
353
|
+
if (chCfg.requireMention !== false && !isAppMention) return false;
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
resolveAckReaction() {
|
|
357
|
+
return this.cfg.ackReaction ?? "";
|
|
358
|
+
}
|
|
359
|
+
resolveTypingReaction() {
|
|
360
|
+
return this.cfg.typingReaction ?? "";
|
|
361
|
+
}
|
|
362
|
+
resolveReplyToMode(chatType) {
|
|
363
|
+
const byType = this.cfg.replyToModeByChatType;
|
|
364
|
+
if (byType) {
|
|
365
|
+
if (chatType === "direct" && byType.direct) return byType.direct;
|
|
366
|
+
if (chatType === "group" && byType.group) return byType.group;
|
|
367
|
+
if (chatType === "channel" && byType.channel) return byType.channel;
|
|
368
|
+
}
|
|
369
|
+
return this.cfg.replyToMode ?? "off";
|
|
370
|
+
}
|
|
371
|
+
async addReaction(emoji, channel, timestamp) {
|
|
372
|
+
if (!emoji || !channel || !timestamp) return;
|
|
373
|
+
const name = emoji.replace(/:/g, "");
|
|
374
|
+
await slackApi(this.cfg.botToken, "reactions.add", {
|
|
375
|
+
channel,
|
|
376
|
+
timestamp,
|
|
377
|
+
name
|
|
378
|
+
}).catch(() => {});
|
|
379
|
+
}
|
|
380
|
+
async removeReaction(emoji, channel, timestamp) {
|
|
381
|
+
if (!emoji || !channel || !timestamp) return;
|
|
382
|
+
const name = emoji.replace(/:/g, "");
|
|
383
|
+
await slackApi(this.cfg.botToken, "reactions.remove", {
|
|
384
|
+
channel,
|
|
385
|
+
timestamp,
|
|
386
|
+
name
|
|
387
|
+
}).catch(() => {});
|
|
388
|
+
}
|
|
389
|
+
async sendMessage(channel, text, threadTs, opts = {}) {
|
|
390
|
+
const limit = this.cfg.textChunkLimit ?? DEFAULT_CHUNK;
|
|
391
|
+
const mode = this.cfg.chunkMode ?? "length";
|
|
392
|
+
const chunks = chunkText(text, limit, mode);
|
|
393
|
+
const replyThread = threadTs && this.resolveReplyToMode("channel") !== "off";
|
|
394
|
+
for (const chunk of chunks) {
|
|
395
|
+
const payload = {
|
|
396
|
+
channel,
|
|
397
|
+
text: chunk,
|
|
398
|
+
mrkdwn: true,
|
|
399
|
+
...replyThread ? { thread_ts: threadTs } : {}
|
|
400
|
+
};
|
|
401
|
+
if (opts.ephemeral && opts.userId) await slackApi(this.cfg.botToken, "chat.postEphemeral", {
|
|
402
|
+
...payload,
|
|
403
|
+
user: opts.userId
|
|
404
|
+
});
|
|
405
|
+
else await slackApi(this.cfg.botToken, "chat.postMessage", payload);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
async sendTyping(channelId) {}
|
|
409
|
+
async startStream(channel, threadTs) {
|
|
410
|
+
if (this.cfg.streaming === "off" || !this.cfg.nativeStreaming) return null;
|
|
411
|
+
try {
|
|
412
|
+
const r = await slackApi(this.cfg.botToken, "chat.startStream", {
|
|
413
|
+
channel,
|
|
414
|
+
...threadTs ? { thread_ts: threadTs } : {}
|
|
415
|
+
});
|
|
416
|
+
return r.stream_ts || null;
|
|
417
|
+
} catch {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
async appendStream(streamTs, text) {
|
|
422
|
+
await slackApi(this.cfg.botToken, "chat.appendStream", {
|
|
423
|
+
stream_ts: streamTs,
|
|
424
|
+
text
|
|
425
|
+
}).catch(() => {});
|
|
426
|
+
}
|
|
427
|
+
async stopStream(streamTs, text) {
|
|
428
|
+
await slackApi(this.cfg.botToken, "chat.stopStream", {
|
|
429
|
+
stream_ts: streamTs,
|
|
430
|
+
text
|
|
431
|
+
}).catch(() => {});
|
|
432
|
+
}
|
|
433
|
+
async setAssistantStatus(channelId, threadTs, status) {
|
|
434
|
+
await slackApi(this.cfg.botToken, "assistant.threads.setStatus", {
|
|
435
|
+
channel_id: channelId,
|
|
436
|
+
thread_ts: threadTs,
|
|
437
|
+
status
|
|
438
|
+
}).catch(() => {});
|
|
439
|
+
}
|
|
440
|
+
approvePairing(code) {
|
|
441
|
+
const upper = code.toUpperCase();
|
|
442
|
+
if (!this.cfg.pendingPairings[upper]) return false;
|
|
443
|
+
this.cfg.approvedPairings.push(this.cfg.pendingPairings[upper]);
|
|
444
|
+
delete this.cfg.pendingPairings[upper];
|
|
445
|
+
this.saveState();
|
|
446
|
+
return true;
|
|
447
|
+
}
|
|
448
|
+
async openDM(userId) {
|
|
449
|
+
const r = await slackApi(this.cfg.botToken, "conversations.open", { users: userId });
|
|
450
|
+
return r.channel.id;
|
|
451
|
+
}
|
|
452
|
+
async sendDM(userId, text) {
|
|
453
|
+
const channelId = await this.openDM(userId);
|
|
454
|
+
await this.sendMessage(channelId, text);
|
|
455
|
+
}
|
|
456
|
+
stateFile() {
|
|
457
|
+
return path.default.join(STATE_BASE, `slack-state-${this.accountId}.json`);
|
|
458
|
+
}
|
|
459
|
+
async loadState() {
|
|
460
|
+
try {
|
|
461
|
+
const s = await fs_extra.default.readJson(this.stateFile());
|
|
462
|
+
if (s.p) this.cfg.pendingPairings = s.p;
|
|
463
|
+
if (s.a) this.cfg.approvedPairings = s.a;
|
|
464
|
+
} catch {}
|
|
465
|
+
}
|
|
466
|
+
async saveState() {
|
|
467
|
+
await fs_extra.default.ensureDir(STATE_BASE);
|
|
468
|
+
await fs_extra.default.writeJson(this.stateFile(), {
|
|
469
|
+
p: this.cfg.pendingPairings,
|
|
470
|
+
a: this.cfg.approvedPairings
|
|
471
|
+
}, { spaces: 2 });
|
|
472
|
+
}
|
|
473
|
+
isRunning() {
|
|
474
|
+
return this.running;
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
var SlackConnector = class extends events.EventEmitter {
|
|
478
|
+
config;
|
|
479
|
+
accounts = [];
|
|
480
|
+
constructor(config) {
|
|
481
|
+
super();
|
|
482
|
+
this.config = config;
|
|
483
|
+
}
|
|
484
|
+
async connect() {
|
|
485
|
+
const sharedState = {
|
|
486
|
+
approvedPairings: this.config.approvedPairings ?? [],
|
|
487
|
+
pendingPairings: this.config.pendingPairings ?? {}
|
|
488
|
+
};
|
|
489
|
+
const accountEntries = Object.entries(this.config.accounts || {});
|
|
490
|
+
if (accountEntries.length === 0) {
|
|
491
|
+
const acct = new SlackAccount("default", {
|
|
492
|
+
...this.config,
|
|
493
|
+
...sharedState
|
|
494
|
+
});
|
|
495
|
+
this.wire(acct);
|
|
496
|
+
await acct.connect();
|
|
497
|
+
this.accounts.push(acct);
|
|
498
|
+
} else for (const [id, acctCfg] of accountEntries) {
|
|
499
|
+
const merged = {
|
|
500
|
+
...this.config,
|
|
501
|
+
...acctCfg,
|
|
502
|
+
botToken: acctCfg.botToken || this.config.botToken,
|
|
503
|
+
...sharedState
|
|
504
|
+
};
|
|
505
|
+
if (!merged.botToken) {
|
|
506
|
+
console.error(`[slack] Account "${id}" has no botToken — skipping`);
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
const acct = new SlackAccount(id, merged);
|
|
510
|
+
this.wire(acct);
|
|
511
|
+
try {
|
|
512
|
+
await acct.connect();
|
|
513
|
+
this.accounts.push(acct);
|
|
514
|
+
} catch (e) {
|
|
515
|
+
console.error(`[slack] Account "${id}" failed: ${e.message}`);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
wire(acct) {
|
|
520
|
+
acct.on("message", (msg) => this.emit("message", msg));
|
|
521
|
+
acct.on("connected", (info) => this.emit("connected", info));
|
|
522
|
+
acct.on("pairing:approved", (info) => this.emit("pairing:approved", info));
|
|
523
|
+
acct.on("system_event", (ev) => this.emit("system_event", ev));
|
|
524
|
+
acct.on("interaction", (ev) => this.emit("interaction", ev));
|
|
525
|
+
}
|
|
526
|
+
async sendMessage(channel, text, threadTs) {
|
|
527
|
+
const acct = this.accounts[0];
|
|
528
|
+
if (!acct) throw new Error("Slack: no connected account");
|
|
529
|
+
await acct.sendMessage(channel, text, threadTs);
|
|
530
|
+
}
|
|
531
|
+
async sendTyping(channelId) {}
|
|
532
|
+
async handleWebhook(body, signature, timestamp) {
|
|
533
|
+
for (const acct of this.accounts) {
|
|
534
|
+
const r = await acct.handleWebhook(body, signature, timestamp);
|
|
535
|
+
if (r != null) return r;
|
|
536
|
+
}
|
|
537
|
+
return null;
|
|
538
|
+
}
|
|
539
|
+
approvePairing(code) {
|
|
540
|
+
return this.accounts.some((a) => a.approvePairing(code));
|
|
541
|
+
}
|
|
542
|
+
disconnect() {
|
|
543
|
+
for (const a of this.accounts) a.disconnect();
|
|
544
|
+
this.accounts = [];
|
|
545
|
+
}
|
|
546
|
+
isRunning() {
|
|
547
|
+
return this.accounts.some((a) => a.isRunning());
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
//#endregion
|
|
552
|
+
exports.SlackConnector = SlackConnector;
|