hyperclaw 5.4.0 → 5.4.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 +1 -0
- package/dist/a2ui-protocol-CUqdJGh7.js +75 -0
- package/dist/a2ui-protocol-CibzbTxL.js +75 -0
- package/dist/a2ui-protocol-Dtb8zlog.js +75 -0
- package/dist/a2ui-protocol-ORP2Etw0.js +75 -0
- package/dist/a2ui-protocol-whRZHdBk.js +75 -0
- package/dist/abort-controller-B55O1IgK.js +47995 -0
- package/dist/agents-routing-Ai2BQVpU.js +7 -0
- package/dist/agents-routing-B0D0vcp5.js +424 -0
- package/dist/agents-routing-B0RBl1B8.js +424 -0
- package/dist/agents-routing-BC6GndVe.js +7 -0
- package/dist/agents-routing-BSUaOpce.js +7 -0
- package/dist/agents-routing-C4PVN8G6.js +7 -0
- package/dist/agents-routing-CyFBHvyk.js +424 -0
- package/dist/agents-routing-Dcr29-JV.js +424 -0
- package/dist/agents-routing-DdpszaMx.js +7 -0
- package/dist/agents-routing-EwzORQQv.js +424 -0
- package/dist/agents-routing-Fd-uQ4R_.js +7 -0
- package/dist/agents-routing-eLjVYBAk.js +424 -0
- package/dist/api-key-validation-BANgbsfO.js +66 -0
- package/dist/api-key-validation-Bnz-0MMK.js +66 -0
- package/dist/api-key-validation-D_fMCaO5.js +66 -0
- package/dist/api-key-validation-Db7rG3JU.js +66 -0
- package/dist/api-key-validation-DrMrLEa0.js +66 -0
- package/dist/api-keys-guide-B6AJ1V5D.js +149 -0
- package/dist/api-keys-guide-C75JQOdH.js +149 -0
- package/dist/api-keys-guide-CFJPrgsL.js +149 -0
- package/dist/api-keys-guide-DDz08BJQ.js +149 -0
- package/dist/api-keys-guide-DmKF7tB-.js +149 -0
- package/dist/audit-BLMB8qp7.js +445 -0
- package/dist/audit-Cb2TvqYZ.js +445 -0
- package/dist/audit-D7koAKvj.js +445 -0
- package/dist/audit-Q-Uy5nem.js +445 -0
- package/dist/audit-xP_175jB.js +445 -0
- package/dist/backup-7l3iovkX.js +86 -0
- package/dist/backup-BKLTHh62.js +86 -0
- package/dist/backup-CspxXk78.js +86 -0
- package/dist/backup-CtHJEqGr.js +86 -0
- package/dist/backup-D8dFYDXV.js +86 -0
- package/dist/banner-CZ2BfvQq.js +143 -0
- package/dist/banner-CjTRWmks.js +7 -0
- package/dist/banner-DYzQ8cCb.js +143 -0
- package/dist/banner-Dpygks0H.js +143 -0
- package/dist/banner-ZX1WLr44.js +7 -0
- package/dist/banner-jW84OrYg.js +7 -0
- package/dist/bounty-tools-CCwY61YO.js +211 -0
- package/dist/bounty-tools-Cq-oC9gk.js +211 -0
- package/dist/bounty-tools-DZ-WtRdE.js +211 -0
- package/dist/bounty-tools-DhpmjF5Y.js +211 -0
- package/dist/bounty-tools-NGuBWI55.js +211 -0
- package/dist/browser-tools-5Fl1hP_2.js +5 -0
- package/dist/browser-tools-Ay-wU_a4.js +5 -0
- package/dist/browser-tools-BMgBB2fK.js +179 -0
- package/dist/browser-tools-kcViDwk5.js +179 -0
- package/dist/chat-BUa1oGqj.js +528 -0
- package/dist/chat-CJa0ph8c.js +528 -0
- package/dist/chat-CKnfxa1-.js +528 -0
- package/dist/chat-CQKCIrIY.js +528 -0
- package/dist/chat-CiuT-GTs.js +528 -0
- package/dist/chat-DfI8uOzF.js +528 -0
- package/dist/chat-Dz5rmUSs.js +528 -0
- package/dist/chat-RTmX1F16.js +528 -0
- package/dist/chat-npW_ZOmo.js +528 -0
- package/dist/claw-tasks-Cio1Q7eA.js +80 -0
- package/dist/claw-tasks-Dq38PrL5.js +80 -0
- package/dist/claw-tasks-DzxNWVcz.js +80 -0
- package/dist/claw-tasks-L7vQSGlt.js +80 -0
- package/dist/claw-tasks-dndWneZW.js +80 -0
- package/dist/config-B-W-Mz4X.js +7 -0
- package/dist/config-BAwkTUJC.js +261 -0
- package/dist/config-BzK_Xl4Y.js +261 -0
- package/dist/config-CYPw2v4l.js +261 -0
- package/dist/config-ClsdlpXc.js +261 -0
- package/dist/config-DN9fdLL3.js +261 -0
- package/dist/config-Dm394B6X.js +7 -0
- package/dist/config-FejpHHTz.js +261 -0
- package/dist/config-SiLqEezw.js +7 -0
- package/dist/config-Tq_GJHf7.js +7 -0
- package/dist/config-n4qy5jIy.js +7 -0
- package/dist/config-qJUYRMzx.js +7 -0
- package/dist/connector-BYPxgmsD.js +312 -0
- package/dist/connector-CwT7KZm2.js +309 -0
- package/dist/connector-DX4k-lGd.js +442 -0
- package/dist/cost-tracker-C2q5zKic.js +103 -0
- package/dist/cost-tracker-CsRQAOEr.js +103 -0
- package/dist/cost-tracker-DAXWN5YT.js +103 -0
- package/dist/cost-tracker-bySvehH6.js +103 -0
- package/dist/cost-tracker-x9E8VKtk.js +103 -0
- package/dist/credentials-store-BAW87r6f.js +7 -0
- package/dist/credentials-store-BHtk7_H_.js +7 -0
- package/dist/credentials-store-CESgFvFU.js +89 -0
- package/dist/credentials-store-CR4WSDGl.js +7 -0
- package/dist/credentials-store-CXq4kZub.js +89 -0
- package/dist/credentials-store-DUp8dtaS.js +89 -0
- package/dist/credentials-store-Ddhgmbpz.js +7 -0
- package/dist/credentials-store-hiSga8qn.js +89 -0
- package/dist/credentials-store-kLdrmqSt.js +7 -0
- package/dist/credentials-store-onL1tYct.js +89 -0
- package/dist/cron-tasks-BFsaCKxE.js +89 -0
- package/dist/cron-tasks-BelA2aUW.js +89 -0
- package/dist/cron-tasks-CF4MJoIU.js +89 -0
- package/dist/cron-tasks-D1T9fWAb.js +89 -0
- package/dist/cron-tasks-f_ieXSG2.js +89 -0
- package/dist/daemon-ApB1nMs2.js +421 -0
- package/dist/daemon-B2ghXB-I.js +7 -0
- package/dist/daemon-BTYhQvD_.js +7 -0
- package/dist/daemon-BldYSrDj.js +421 -0
- package/dist/daemon-BoaFnmdF.js +421 -0
- package/dist/daemon-BqTcxMZe.js +7 -0
- package/dist/daemon-BrHxr4ut.js +421 -0
- package/dist/daemon-BzdeLgON.js +421 -0
- package/dist/daemon-BzqWIC4v.js +7 -0
- package/dist/daemon-C3OczPR1.js +7 -0
- package/dist/daemon-CivMFYkD.js +7 -0
- package/dist/daemon-D57KIIA3.js +421 -0
- package/dist/daemon-D8uyH9et.js +7 -0
- package/dist/daemon-DBTtYx6E.js +421 -0
- package/dist/daemon-DBXFUMue.js +421 -0
- package/dist/daemon-srcdhzUG.js +7 -0
- package/dist/delivery-BURWi8wu.js +4 -0
- package/dist/delivery-Bt0xW6L9.js +4 -0
- package/dist/delivery-C2sAERN7.js +4 -0
- package/dist/delivery-CF2Q4hb1.js +95 -0
- package/dist/delivery-CfMljOwk.js +95 -0
- package/dist/delivery-DP0d4_A4.js +95 -0
- package/dist/delivery-DXYt4aMO.js +4 -0
- package/dist/delivery-DXxP2UL4.js +4 -0
- package/dist/delivery-jT2UIDlU.js +95 -0
- package/dist/delivery-kZ2mVkU5.js +95 -0
- package/dist/destructive-gate-5LYh6brt.js +116 -0
- package/dist/destructive-gate-B_hNKtu6.js +116 -0
- package/dist/destructive-gate-C1ny9ek2.js +116 -0
- package/dist/destructive-gate-DvxPSDMR.js +116 -0
- package/dist/destructive-gate-Qd2y7x1B.js +116 -0
- package/dist/dist-B1qvBUax.js +30541 -0
- package/dist/engine-B-JvIt_Y.js +7 -0
- package/dist/engine-BBJlKpMP.js +7 -0
- package/dist/engine-BGZnBZ4m.js +7 -0
- package/dist/engine-BNygJfCo.js +335 -0
- package/dist/engine-BTSXJNba.js +346 -0
- package/dist/engine-C7LyH310.js +353 -0
- package/dist/engine-C_nC_Ioe.js +351 -0
- package/dist/engine-DB4MBzki.js +7 -0
- package/dist/engine-DCtJSbKU.js +7 -0
- package/dist/engine-DPi9fhMl.js +332 -0
- package/dist/engine-DeaqDcaT.js +7 -0
- package/dist/engine-DuvXJrUP.js +335 -0
- package/dist/engine-HkyTC_xl.js +332 -0
- package/dist/engine-JysunhPR.js +7 -0
- package/dist/engine-MzEUw7qb.js +7 -0
- package/dist/engine-j9Yaqt_-.js +332 -0
- package/dist/env-resolve--MaE2kFF.js +167 -0
- package/dist/env-resolve-BYWG94tK.js +11 -0
- package/dist/env-resolve-Bop7KbNq.js +167 -0
- package/dist/env-resolve-Buos635Y.js +167 -0
- package/dist/env-resolve-C0R8R7pb.js +167 -0
- package/dist/env-resolve-D3dP1-Xt.js +11 -0
- package/dist/env-resolve-Dr-KfTtw.js +11 -0
- package/dist/env-resolve-DvsbhPKl.js +11 -0
- package/dist/env-resolve-NNM3F6Eo.js +167 -0
- package/dist/env-resolve-dTjn-g8X.js +11 -0
- package/dist/extraction-tools-Bh5F0ENP.js +91 -0
- package/dist/extraction-tools-BjzXD9LW.js +5 -0
- package/dist/extraction-tools-D1lrDYhe.js +5 -0
- package/dist/extraction-tools-FBwtT2Bx.js +91 -0
- package/dist/fileFromPath-CodL6KXh.js +85 -0
- package/dist/gmail-watch-setup--eQ8raeb.js +42 -0
- package/dist/gmail-watch-setup-9t14gy1B.js +42 -0
- package/dist/gmail-watch-setup-B9fx_OLg.js +42 -0
- package/dist/gmail-watch-setup-BzbG0ICM.js +42 -0
- package/dist/gmail-watch-setup-DP3kDRx1.js +42 -0
- package/dist/heartbeat-engine-5iOlL7Dj.js +89 -0
- package/dist/heartbeat-engine-B9bhAHNi.js +89 -0
- package/dist/heartbeat-engine-Bu4q18GH.js +89 -0
- package/dist/heartbeat-engine-CF_JjNJ4.js +89 -0
- package/dist/heartbeat-engine-CLADYZxE.js +89 -0
- package/dist/hub-CZeGrS20.js +6 -0
- package/dist/hub-DAkEVTEy.js +545 -0
- package/dist/hyperclawbot-BEm8_87h.js +516 -0
- package/dist/hyperclawbot-CNVUtvYC.js +516 -0
- package/dist/hyperclawbot-D5ofLNgm.js +516 -0
- package/dist/hyperclawbot-D61zVMyQ.js +516 -0
- package/dist/hyperclawbot-DR6BgI_d.js +516 -0
- package/dist/hyperclawbot-DwScttSx.js +516 -0
- package/dist/hyperclawbot-hZv4pde0.js +516 -0
- package/dist/hyperclawbot-v65eL2U0.js +516 -0
- package/dist/inference-BEvs7s3c.js +2854 -0
- package/dist/inference-C4b9YqXk.js +8 -0
- package/dist/inference-C874-2MI.js +8 -0
- package/dist/inference-CRF6HyyH.js +2854 -0
- package/dist/inference-CfhTACI8.js +2854 -0
- package/dist/inference-DCSz6Sb1.js +2880 -0
- package/dist/inference-DGsy36Ru.js +8 -0
- package/dist/inference-Da7Hw4J3.js +8 -0
- package/dist/inference-DhJ-SHZn.js +8 -0
- package/dist/inference-K7Jrnzre.js +2854 -0
- package/dist/isFile-CSxoSB8X.js +2274 -0
- package/dist/knowledge-graph-BdsJ5KEL.js +134 -0
- package/dist/knowledge-graph-BiIvoxPt.js +134 -0
- package/dist/knowledge-graph-CFRBepzr.js +134 -0
- package/dist/knowledge-graph-CeDeahui.js +134 -0
- package/dist/knowledge-graph-DoYFZnUr.js +134 -0
- package/dist/loader-C2qtNbtF.js +6 -0
- package/dist/loader-D6yjBYo4.js +410 -0
- package/dist/loader-DBO6yRNh.js +6 -0
- package/dist/loader-DMMb9emn.js +410 -0
- package/dist/loader-DUhmG3V9.js +410 -0
- package/dist/loader-Dl8LNycw.js +6 -0
- package/dist/loader-JktrmJOG.js +6 -0
- package/dist/loader-UpOYxgZv.js +6 -0
- package/dist/loader-hXv2mZjK.js +410 -0
- package/dist/loader-nDBcv3Tm.js +410 -0
- package/dist/logger-BD316YbA.js +86 -0
- package/dist/logger-BnXZkfsp.js +86 -0
- package/dist/logger-CmphFNmW.js +86 -0
- package/dist/logger-DkHzhh56.js +86 -0
- package/dist/logger-Oty9sC13.js +86 -0
- package/dist/manager-3-q8zuAW.js +250 -0
- package/dist/manager-BIc6zzZV.js +250 -0
- package/dist/manager-BkMzc-EJ.js +250 -0
- package/dist/manager-Bq5LApdR.js +6 -0
- package/dist/manager-BwobWy0l.js +120 -0
- package/dist/manager-CNgdJunf.js +250 -0
- package/dist/manager-CozyZSDG.js +250 -0
- package/dist/manager-D4mDWXph.js +120 -0
- package/dist/manager-DuS-WQhZ.js +120 -0
- package/dist/manager-Dz2eKYqo.js +116 -0
- package/dist/manager-R0TlRMZy.js +120 -0
- package/dist/manager-aJfY7rt6.js +120 -0
- package/dist/mcp-BH7HtOQ8.js +142 -0
- package/dist/mcp-CAJSA_ee.js +142 -0
- package/dist/mcp-CD-iIQa2.js +142 -0
- package/dist/mcp-CI2F3m8G.js +142 -0
- package/dist/mcp-DGo37Ifb.js +142 -0
- package/dist/mcp-loader-C-21ynRH.js +93 -0
- package/dist/mcp-loader-Ct1NQKnX.js +93 -0
- package/dist/mcp-loader-D1T6UX73.js +93 -0
- package/dist/mcp-loader-DJk6MEof.js +93 -0
- package/dist/mcp-loader-DdXvU63s.js +93 -0
- package/dist/mcp-loader-Di7n__ta.js +93 -0
- package/dist/mcp-loader-gMliiJ7R.js +93 -0
- package/dist/memory-CyonlkTy.js +6 -0
- package/dist/memory-DPSWQBc0.js +276 -0
- package/dist/memory-auto-B0QOqaUD.js +306 -0
- package/dist/memory-auto-BSxYJugl.js +5 -0
- package/dist/memory-auto-BVCJeTwd.js +306 -0
- package/dist/memory-auto-CcFRxMj-.js +306 -0
- package/dist/memory-auto-CifT5aj_.js +5 -0
- package/dist/memory-auto-Cp2Jwx3Y.js +306 -0
- package/dist/memory-auto-DXKe2ayf.js +5 -0
- package/dist/memory-auto-DjK_D8CA.js +306 -0
- package/dist/memory-auto-N57dp4Do.js +5 -0
- package/dist/memory-auto-n0kOcU7F.js +5 -0
- package/dist/memory-integration-D2RvZ-MB.js +91 -0
- package/dist/memory-integration-D8shLJwp.js +91 -0
- package/dist/memory-integration-DLmzJ62L.js +91 -0
- package/dist/memory-integration-DMXDbMIL.js +91 -0
- package/dist/memory-integration-Dgr-mjue.js +91 -0
- package/dist/moltbook-CIeOshK6.js +81 -0
- package/dist/moltbook-CX5XWn06.js +81 -0
- package/dist/moltbook-DUfiE4NY.js +81 -0
- package/dist/moltbook-DvV6GFFL.js +81 -0
- package/dist/moltbook-YEiNI8Cm.js +81 -0
- package/dist/multi-agent-tools-jzfvT4zP.js +87 -0
- package/dist/multimodal-zZdwqISl.js +77 -0
- package/dist/node-BYrxELx2.js +251 -0
- package/dist/node-CLWgPlAk.js +251 -0
- package/dist/node-Czz8Y85D.js +251 -0
- package/dist/node-DFKhz7Zn.js +251 -0
- package/dist/node-Du2H2Ddi.js +226 -0
- package/dist/node-domexception-v89b0Nwz.js +21 -0
- package/dist/node-pending-queue-CIMXPU6K.js +32 -0
- package/dist/node-pending-queue-DUXCbYkp.js +32 -0
- package/dist/node-pending-queue-DZp7cdfo.js +32 -0
- package/dist/node-pending-queue-iYpoWqxe.js +32 -0
- package/dist/nodes-registry-BTy7Sc7D.js +52 -0
- package/dist/nodes-registry-BYjmmJBU.js +52 -0
- package/dist/nodes-registry-BeiEjd9U.js +52 -0
- package/dist/nodes-registry-C8GeEGq0.js +52 -0
- package/dist/nodes-registry-Du6Klz0l.js +52 -0
- package/dist/oauth-flow-BA0yMrHx.js +148 -0
- package/dist/oauth-flow-C4QSMsbl.js +148 -0
- package/dist/oauth-flow-CIuDBDsp.js +148 -0
- package/dist/oauth-flow-CZOsvU1v.js +148 -0
- package/dist/oauth-flow-CniM4jlJ.js +148 -0
- package/dist/oauth-provider-BA4GVFKg.js +111 -0
- package/dist/oauth-provider-Bnul5A_Z.js +111 -0
- package/dist/oauth-provider-Dk-6BmGL.js +111 -0
- package/dist/oauth-provider-DqPXPiiC.js +111 -0
- package/dist/oauth-provider-MEgHjij2.js +111 -0
- package/dist/observability-0spm7MPz.js +89 -0
- package/dist/observability-B3dDQSdI.js +89 -0
- package/dist/observability-BOMYgHUh.js +89 -0
- package/dist/observability-CDqHr-_o.js +89 -0
- package/dist/observability-ah2a7sh1.js +89 -0
- package/dist/onboard-BJ78s3NT.js +3854 -0
- package/dist/onboard-BnyHie0K.js +14 -0
- package/dist/onboard-C55YXd_e.js +14 -0
- package/dist/onboard-CNnm4yYp.js +3841 -0
- package/dist/onboard-CXSVPnP7.js +3854 -0
- package/dist/onboard-CwvXXOR1.js +14 -0
- package/dist/onboard-CxlIsNhX.js +3854 -0
- package/dist/onboard-D-5gWzH0.js +3854 -0
- package/dist/onboard-D9pjgaVR.js +3854 -0
- package/dist/onboard-DPmufMqX.js +14 -0
- package/dist/onboard-F9lKA2ie.js +14 -0
- package/dist/onboard-UTQXzlPD.js +3854 -0
- package/dist/onboard-UhWVcTap.js +14 -0
- package/dist/onboard-W5DsxVf2.js +3854 -0
- package/dist/onboard-YszvVNgS.js +14 -0
- package/dist/onboard-hK098kjl.js +14 -0
- package/dist/onboard-pLDBUBpO.js +14 -0
- package/dist/onboard-zISipu-l.js +3854 -0
- package/dist/openai-CrdtuLxw.js +6292 -0
- package/dist/orchestrator-5M-6MB7r.js +6 -0
- package/dist/orchestrator-B3BjP1dy.js +6 -0
- package/dist/orchestrator-BZS62iDS.js +6 -0
- package/dist/orchestrator-C0t11xj7.js +189 -0
- package/dist/orchestrator-CA4eKeGn.js +189 -0
- package/dist/orchestrator-CNxTIlOK.js +189 -0
- package/dist/orchestrator-CTMbjgH_.js +6 -0
- package/dist/orchestrator-Cg1vgEHb.js +6 -0
- package/dist/orchestrator-Crn4fgbI.js +189 -0
- package/dist/orchestrator-Cs6s-QmS.js +189 -0
- package/dist/orchestrator-DGqwsLmO.js +189 -0
- package/dist/orchestrator-DV5t6wQ0.js +6 -0
- package/dist/orchestrator-UUHsFKiH.js +6 -0
- package/dist/orchestrator-eT0ZL4yl.js +6 -0
- package/dist/orchestrator-oa7HbCnF.js +189 -0
- package/dist/orchestrator-tUKag7pG.js +189 -0
- package/dist/osint-47yIek6w.js +283 -0
- package/dist/osint-BJvOCmVk.js +283 -0
- package/dist/osint-CK9xVUUm.js +283 -0
- package/dist/osint-D6vQXCWh.js +283 -0
- package/dist/osint-DLYZsp1k.js +283 -0
- package/dist/osint-c-xDjLb-.js +283 -0
- package/dist/osint-cAAdO-cx.js +283 -0
- package/dist/osint-chat-B0lc0Y6r.js +789 -0
- package/dist/osint-chat-BJgnkFDm.js +789 -0
- package/dist/osint-chat-BUhiSpf9.js +789 -0
- package/dist/osint-chat-C-9FVAkU.js +789 -0
- package/dist/osint-chat-C09BvbGy.js +789 -0
- package/dist/osint-chat-CWET8Fno.js +789 -0
- package/dist/osint-chat-Cgdzg3lh.js +789 -0
- package/dist/osint-chat-zdeaaw7a.js +789 -0
- package/dist/osint-e6oBrtlj.js +283 -0
- package/dist/pc-access-BCaF5mRs.js +858 -0
- package/dist/pc-access-BOcXappE.js +858 -0
- package/dist/pc-access-BgZNmAdB.js +8 -0
- package/dist/pc-access-CAoM6WN4.js +8 -0
- package/dist/pc-access-D2HdoziZ.js +8 -0
- package/dist/pc-access-D4g0fjQb.js +858 -0
- package/dist/pending-approval-CEu_-DGQ.js +22 -0
- package/dist/pending-approval-CJPyt8U5.js +22 -0
- package/dist/pending-approval-CzMNCTfZ.js +22 -0
- package/dist/pending-approval-DaXi7otO.js +22 -0
- package/dist/pending-approval-KcyeiifE.js +22 -0
- package/dist/providers-BfW-fgpw.js +5 -0
- package/dist/providers-Cs1h_TJA.js +1137 -0
- package/dist/providers-DrZP0NeR.js +5 -0
- package/dist/providers-dHhpJo9j.js +1120 -0
- package/dist/reminders-store-B58LldEG.js +58 -0
- package/dist/reminders-store-C4gWckLa.js +58 -0
- package/dist/reminders-store-DT0o6a60.js +58 -0
- package/dist/renderer-B8c22rbg.js +228 -0
- package/dist/renderer-BS0ETL20.js +228 -0
- package/dist/renderer-B_ew6jRs.js +228 -0
- package/dist/renderer-Cg3c41A5.js +228 -0
- package/dist/renderer-UoPcgaAd.js +228 -0
- package/dist/rules-BAYXiKiJ.js +106 -0
- package/dist/rules-D0v5nuSE.js +106 -0
- package/dist/rules-DCKPgwLb.js +106 -0
- package/dist/rules-Zn9j4PnO.js +106 -0
- package/dist/rules-oAgOSPHC.js +106 -0
- package/dist/run-main.js +492 -131
- package/dist/runner-B5uo6C5q.js +1310 -0
- package/dist/runner-BaZ2V27T.js +1307 -0
- package/dist/runner-Bgl7UTbV.js +1307 -0
- package/dist/runner-DOKp3-v5.js +1307 -0
- package/dist/runner-voYdfM_f.js +1307 -0
- package/dist/search-tools-BBwMa8VX.js +107 -0
- package/dist/search-tools-CEUOO9Jf.js +107 -0
- package/dist/search-tools-DXVuVXW_.js +107 -0
- package/dist/search-tools-VHP3xVyC.js +107 -0
- package/dist/search-tools-w_zT7-dr.js +107 -0
- package/dist/server-BAdJwMM9.js +4 -0
- package/dist/server-BD9FLc7S.js +1384 -0
- package/dist/server-BJkDIs8Z.js +1467 -0
- package/dist/server-BlqWBbS7.js +4 -0
- package/dist/server-BzwPvTbD.js +1447 -0
- package/dist/server-CBvSfG4w.js +4 -0
- package/dist/server-CbNBcB41.js +4 -0
- package/dist/server-CtFoXM88.js +4 -0
- package/dist/server-DPTXaJJF.js +4 -0
- package/dist/server-DVxVLu_G.js +1467 -0
- package/dist/server-DZj6Nobr.js +1467 -0
- package/dist/server-Diu80smx.js +4 -0
- package/dist/server-DszV63tu.js +4 -0
- package/dist/server-Dv2zHHy-.js +1447 -0
- package/dist/server-MDmdWHob.js +1447 -0
- package/dist/server-N9LnLQCS.js +1447 -0
- package/dist/session-store-C6Otslf9.js +5 -0
- package/dist/session-store-Cmfnvuw9.js +141 -0
- package/dist/session-store-CuR9DgRf.js +5 -0
- package/dist/session-store-Cx1RMBhS.js +5 -0
- package/dist/session-store-DPPHkJBn.js +5 -0
- package/dist/session-store-DWLCWQFS.js +141 -0
- package/dist/session-store-qGufR_m5.js +141 -0
- package/dist/session-store-sUpA509O.js +141 -0
- package/dist/sessions-tools-9Z8TtdmP.js +5 -0
- package/dist/sessions-tools-BAZnoQLp.js +95 -0
- package/dist/sessions-tools-Bb_zF947.js +95 -0
- package/dist/sessions-tools-ClrKqLII.js +131 -0
- package/dist/sessions-tools-DFe23ZDD.js +5 -0
- package/dist/sessions-tools-JHSZ6Bns.js +5 -0
- package/dist/sessions-tools-TsRdeFb7.js +95 -0
- package/dist/sessions-tools-nYP3Agfs.js +5 -0
- package/dist/skill-loader-9jg876RH.js +160 -0
- package/dist/skill-loader-CM4KWQ7_.js +160 -0
- package/dist/skill-loader-CS3OP4Lr.js +160 -0
- package/dist/skill-loader-CnJDLNbY.js +7 -0
- package/dist/skill-loader-DRLgt5V2.js +160 -0
- package/dist/skill-loader-DVpEgYV2.js +7 -0
- package/dist/skill-loader-Df5T_UFl.js +7 -0
- package/dist/skill-loader-DxE-gZkT.js +7 -0
- package/dist/skill-runtime-8Xh5874w.js +104 -0
- package/dist/skill-runtime-B3aUdWKh.js +104 -0
- package/dist/skill-runtime-BKyhYvpW.js +5 -0
- package/dist/skill-runtime-BLkXA1mO.js +104 -0
- package/dist/skill-runtime-BMk-h6Dl.js +5 -0
- package/dist/skill-runtime-BP0kZfmM.js +5 -0
- package/dist/skill-runtime-BaTX-RGy.js +5 -0
- package/dist/skill-runtime-CB9tnc-P.js +104 -0
- package/dist/skill-runtime-CLK5HTVE.js +5 -0
- package/dist/skill-runtime-COyc3Bci.js +104 -0
- package/dist/skill-runtime-CvDXX7wN.js +5 -0
- package/dist/skill-runtime-D4REZnhY.js +104 -0
- package/dist/skill-runtime-D6-rGzX1.js +104 -0
- package/dist/skill-runtime-DQRi9sIf.js +5 -0
- package/dist/skill-runtime-DRd56NWK.js +104 -0
- package/dist/skill-runtime-Dej1Yr5V.js +5 -0
- package/dist/src-6dmkVQGq.js +63 -0
- package/dist/src-7yBXPAs6.js +315 -0
- package/dist/src-9GyYED0T.js +63 -0
- package/dist/src-B9L6qb-Z.js +462 -0
- package/dist/src-BEjIVOmq.js +63 -0
- package/dist/src-BOnuFlI4.js +23 -0
- package/dist/src-BY3On_zO.js +462 -0
- package/dist/src-BdgKAlMQ.js +20 -0
- package/dist/src-BkEtHLLy.js +462 -0
- package/dist/src-C52A3OwC.js +301 -0
- package/dist/src-C8cbfjat.js +173 -0
- package/dist/src-CDeWGebw.js +315 -0
- package/dist/src-CNAVUFC6.js +462 -0
- package/dist/src-CQ2lZvdF.js +462 -0
- package/dist/src-Cdwn9xpG.js +462 -0
- package/dist/src-CyCLoqIP.js +63 -0
- package/dist/src-D-OND_62.js +301 -0
- package/dist/src-DB6dPsbY.js +63 -0
- package/dist/src-DE4mH0BB.js +63 -0
- package/dist/src-DFo8lVfV.js +300 -0
- package/dist/src-DJbpP4Gs.js +462 -0
- package/dist/src-DPfnArdr.js +300 -0
- package/dist/src-DTft7Qvt.js +63 -0
- package/dist/src-DgvFah8g.js +153 -0
- package/dist/src-TYvV_oFO.js +63 -0
- package/dist/src-krHV0uVj.js +315 -0
- package/dist/src-lltU5gkh.js +20 -0
- package/dist/src-tF0sBtr3.js +462 -0
- package/dist/sub-agent-tools-BwOxHu6f.js +39 -0
- package/dist/sub-agent-tools-CE8pVUdb.js +39 -0
- package/dist/sub-agent-tools-CJVEIF1F.js +39 -0
- package/dist/sub-agent-tools-CQWNfYn_.js +39 -0
- package/dist/sub-agent-tools-CViiqebO.js +39 -0
- package/dist/sub-agent-tools-DgT4jUHC.js +39 -0
- package/dist/sub-agent-tools-Lbin_4S3.js +39 -0
- package/dist/sub-agent-tools-f4X1M-li.js +39 -0
- package/dist/tool-policy-1EBdJkSG.js +190 -0
- package/dist/tool-policy-B1bL0X-E.js +189 -0
- package/dist/tool-policy-CfWEnRxy.js +190 -0
- package/dist/tool-policy-NLbucl5-.js +189 -0
- package/dist/tool-policy-yNVTLNDY.js +189 -0
- package/dist/tts-elevenlabs-Bk24wQ2V.js +64 -0
- package/dist/tts-elevenlabs-CCeOqqrh.js +64 -0
- package/dist/tts-elevenlabs-CHrJZuNW.js +64 -0
- package/dist/tts-elevenlabs-DHqQsqMz.js +64 -0
- package/dist/tts-elevenlabs-TUKPkSV2.js +64 -0
- package/dist/vision-BMRKyu3c.js +167 -0
- package/dist/vision-CW1YCKed.js +167 -0
- package/dist/vision-DPLmrwUA.js +167 -0
- package/dist/vision-Q4EOcBS6.js +167 -0
- package/dist/vision-XyAGO5La.js +167 -0
- package/dist/vision-tools-B5DNR28M.js +5 -0
- package/dist/vision-tools-CC9HSuvN.js +51 -0
- package/dist/vision-tools-Ca3OhtdX.js +51 -0
- package/dist/vision-tools-CpU2fSRv.js +51 -0
- package/dist/vision-tools-Ct52djW8.js +51 -0
- package/dist/vision-tools-DF7N2DDI.js +5 -0
- package/dist/vision-tools-DVYx9-Jw.js +5 -0
- package/dist/vision-tools-DyP6lRA5.js +5 -0
- package/dist/vision-tools-RIVKEUeY.js +5 -0
- package/dist/vision-tools-kYb3effk.js +51 -0
- package/dist/voice-transcription-B1D1rpca.js +170 -0
- package/dist/voice-transcription-Bz2y0nPK.js +170 -0
- package/dist/voice-transcription-CVFcHpPF.js +170 -0
- package/dist/voice-transcription-CvQuWPYK.js +170 -0
- package/dist/voice-transcription-YqndiLA7.js +170 -0
- package/dist/website-watch-tools-B036Y8OQ.js +176 -0
- package/dist/website-watch-tools-B8CHie8v.js +5 -0
- package/dist/website-watch-tools-Brk5oIEv.js +176 -0
- package/dist/website-watch-tools-CJqRj_GB.js +5 -0
- package/dist/website-watch-tools-CSSEu3Qy.js +5 -0
- package/dist/website-watch-tools-D92dkYZa.js +176 -0
- package/dist/website-watch-tools-Du_a8lXq.js +176 -0
- package/dist/website-watch-tools-UdTBGgRk.js +5 -0
- package/package.json +5 -3
- package/static/chat.html +18 -4
- package/static/web/assets/index-D2ekZ-uM.js +75 -0
- package/static/web/assets/index-D_9lvvup.css +1 -0
- package/static/web/index.html +2 -2
- package/static/web/assets/index-B5N1LHGR.css +0 -1
- package/static/web/assets/index-Bf8pf7Wg.js +0 -75
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
const require_paths = require('./paths-AIyBxIzm.js');
|
|
3
|
+
const require_paths$1 = require('./paths-DPovhojT.js');
|
|
4
|
+
const require_env_resolve = require('./env-resolve--MaE2kFF.js');
|
|
5
|
+
const chalk = require_chunk.__toESM(require("chalk"));
|
|
6
|
+
const fs_extra = require_chunk.__toESM(require("fs-extra"));
|
|
7
|
+
|
|
8
|
+
//#region src/cli/config.ts
|
|
9
|
+
require_paths$1.init_paths();
|
|
10
|
+
require_env_resolve.init_env_resolve();
|
|
11
|
+
const getHC_DIR = () => require_paths.getHyperClawDir();
|
|
12
|
+
const getCFG_FILE = () => require_paths.getConfigPath();
|
|
13
|
+
var ConfigStore = class {
|
|
14
|
+
/** Load raw config from disk (no hydration). Use for persistence to avoid writing resolved secrets back. */
|
|
15
|
+
async loadRaw() {
|
|
16
|
+
try {
|
|
17
|
+
return await fs_extra.default.readJson(getCFG_FILE());
|
|
18
|
+
} catch (e) {
|
|
19
|
+
if (e?.code === "ENOENT") return {};
|
|
20
|
+
console.error("[config] Failed to load config:", e?.message ?? String(e));
|
|
21
|
+
throw e;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** Load config with env/credentials hydration for runtime use. Do NOT pass the result to save — use patch/save with explicit values only. */
|
|
25
|
+
async load() {
|
|
26
|
+
try {
|
|
27
|
+
const cfg = await fs_extra.default.readJson(getCFG_FILE());
|
|
28
|
+
if (cfg.channelConfigs) for (const [chId, ch] of Object.entries(cfg.channelConfigs)) {
|
|
29
|
+
const tok = require_env_resolve.resolveChannelToken(chId, ch?.token || ch?.botToken);
|
|
30
|
+
if (tok && !ch?.token) ch.token = tok;
|
|
31
|
+
if (tok && !ch?.botToken) ch.botToken = tok;
|
|
32
|
+
}
|
|
33
|
+
if (cfg.provider && !cfg.provider.apiKey) {
|
|
34
|
+
const key = await require_env_resolve.getProviderCredentialAsync(cfg);
|
|
35
|
+
if (key) cfg.provider.apiKey = key;
|
|
36
|
+
}
|
|
37
|
+
return cfg;
|
|
38
|
+
} catch (e) {
|
|
39
|
+
if (e?.code === "ENOENT") return {};
|
|
40
|
+
console.error("[config] Failed to load config:", e?.message ?? String(e));
|
|
41
|
+
throw e;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async save(cfg) {
|
|
45
|
+
const target = getCFG_FILE();
|
|
46
|
+
const tmp = target + ".tmp";
|
|
47
|
+
await fs_extra.default.ensureDir(getHC_DIR());
|
|
48
|
+
await fs_extra.default.writeJson(tmp, cfg, { spaces: 2 });
|
|
49
|
+
await fs_extra.default.chmod(tmp, 384);
|
|
50
|
+
await fs_extra.default.rename(tmp, target);
|
|
51
|
+
}
|
|
52
|
+
/** Merge patch into raw config and save. Uses loadRaw() so hydrated secrets from env/store are never written back. */
|
|
53
|
+
async patch(patch) {
|
|
54
|
+
const raw = await this.loadRaw();
|
|
55
|
+
await this.save(deepMerge(raw, patch));
|
|
56
|
+
}
|
|
57
|
+
async setProviderKey(providerId, apiKey) {
|
|
58
|
+
const cfg = await this.load();
|
|
59
|
+
await this.patch({ provider: {
|
|
60
|
+
...cfg.provider,
|
|
61
|
+
providerId,
|
|
62
|
+
apiKey
|
|
63
|
+
} });
|
|
64
|
+
console.log(chalk.default.green(` ✅ API key saved for ${providerId}`));
|
|
65
|
+
}
|
|
66
|
+
async setModel(modelId) {
|
|
67
|
+
const cfg = await this.load();
|
|
68
|
+
await this.patch({ provider: {
|
|
69
|
+
...cfg.provider,
|
|
70
|
+
modelId
|
|
71
|
+
} });
|
|
72
|
+
console.log(chalk.default.green(` ✅ Model: ${modelId}`));
|
|
73
|
+
}
|
|
74
|
+
async setServiceApiKey(serviceId, apiKey) {
|
|
75
|
+
const cfg = await this.load();
|
|
76
|
+
const apiKeys = {
|
|
77
|
+
...cfg.skills?.apiKeys || {},
|
|
78
|
+
[serviceId]: apiKey
|
|
79
|
+
};
|
|
80
|
+
await this.patch({ skills: {
|
|
81
|
+
...cfg.skills,
|
|
82
|
+
installed: cfg.skills?.installed || [],
|
|
83
|
+
apiKeys
|
|
84
|
+
} });
|
|
85
|
+
console.log(chalk.default.green(` ✅ Service API key saved for ${serviceId}`));
|
|
86
|
+
}
|
|
87
|
+
async enableChannel(channelId, channelConfig) {
|
|
88
|
+
const cfg = await this.load();
|
|
89
|
+
const gwBase = cfg.gateway ?? {
|
|
90
|
+
port: 18789,
|
|
91
|
+
bind: "127.0.0.1",
|
|
92
|
+
authToken: "",
|
|
93
|
+
runtime: "node",
|
|
94
|
+
enabledChannels: [],
|
|
95
|
+
hooks: true,
|
|
96
|
+
tailscaleExposure: "off"
|
|
97
|
+
};
|
|
98
|
+
const channels = gwBase.enabledChannels ?? [];
|
|
99
|
+
if (!channels.includes(channelId)) channels.push(channelId);
|
|
100
|
+
const patch = { gateway: {
|
|
101
|
+
...gwBase,
|
|
102
|
+
enabledChannels: channels
|
|
103
|
+
} };
|
|
104
|
+
if (channelConfig) patch.channelConfigs = {
|
|
105
|
+
...cfg.channelConfigs,
|
|
106
|
+
[channelId]: channelConfig
|
|
107
|
+
};
|
|
108
|
+
await this.patch(patch);
|
|
109
|
+
console.log(chalk.default.green(` ✅ Channel enabled: ${channelId}`));
|
|
110
|
+
}
|
|
111
|
+
async disableChannel(channelId) {
|
|
112
|
+
const cfg = await this.load();
|
|
113
|
+
const gwBase = cfg.gateway ?? {
|
|
114
|
+
port: 18789,
|
|
115
|
+
bind: "127.0.0.1",
|
|
116
|
+
authToken: "",
|
|
117
|
+
runtime: "node",
|
|
118
|
+
enabledChannels: [],
|
|
119
|
+
hooks: true,
|
|
120
|
+
tailscaleExposure: "off"
|
|
121
|
+
};
|
|
122
|
+
const channels = (gwBase.enabledChannels ?? []).filter((c) => c !== channelId);
|
|
123
|
+
await this.patch({ gateway: {
|
|
124
|
+
...gwBase,
|
|
125
|
+
enabledChannels: channels
|
|
126
|
+
} });
|
|
127
|
+
console.log(chalk.default.green(` ✅ Channel disabled: ${channelId}`));
|
|
128
|
+
}
|
|
129
|
+
async setGatewayPort(port) {
|
|
130
|
+
const cfg = await this.load();
|
|
131
|
+
const gwBase = cfg.gateway ?? {
|
|
132
|
+
port: 18789,
|
|
133
|
+
bind: "127.0.0.1",
|
|
134
|
+
authToken: "",
|
|
135
|
+
runtime: "node",
|
|
136
|
+
enabledChannels: [],
|
|
137
|
+
hooks: true,
|
|
138
|
+
tailscaleExposure: "off"
|
|
139
|
+
};
|
|
140
|
+
await this.patch({ gateway: {
|
|
141
|
+
...gwBase,
|
|
142
|
+
port
|
|
143
|
+
} });
|
|
144
|
+
}
|
|
145
|
+
async setGatewayBind(bind) {
|
|
146
|
+
const cfg = await this.load();
|
|
147
|
+
const gwBase = cfg.gateway ?? {
|
|
148
|
+
port: 18789,
|
|
149
|
+
bind: "127.0.0.1",
|
|
150
|
+
authToken: "",
|
|
151
|
+
runtime: "node",
|
|
152
|
+
enabledChannels: [],
|
|
153
|
+
hooks: true,
|
|
154
|
+
tailscaleExposure: "off"
|
|
155
|
+
};
|
|
156
|
+
await this.patch({ gateway: {
|
|
157
|
+
...gwBase,
|
|
158
|
+
bind
|
|
159
|
+
} });
|
|
160
|
+
}
|
|
161
|
+
async generateToken() {
|
|
162
|
+
const token = require("crypto").randomBytes(32).toString("base64url");
|
|
163
|
+
const cfg = await this.load();
|
|
164
|
+
const gwBase = cfg.gateway ?? {
|
|
165
|
+
port: 18789,
|
|
166
|
+
bind: "127.0.0.1",
|
|
167
|
+
authToken: "",
|
|
168
|
+
runtime: "node",
|
|
169
|
+
enabledChannels: [],
|
|
170
|
+
hooks: true,
|
|
171
|
+
tailscaleExposure: "off"
|
|
172
|
+
};
|
|
173
|
+
await this.patch({ gateway: {
|
|
174
|
+
...gwBase,
|
|
175
|
+
authToken: token
|
|
176
|
+
} });
|
|
177
|
+
return token;
|
|
178
|
+
}
|
|
179
|
+
async show(scrub = true) {
|
|
180
|
+
const cfg = await this.load();
|
|
181
|
+
const display = scrub ? scrubSecrets(cfg) : cfg;
|
|
182
|
+
console.log(chalk.default.bold.cyan("\n 🦅 HYPERCLAW CONFIGURATION\n"));
|
|
183
|
+
printSection("Provider", display.provider);
|
|
184
|
+
printSection("Gateway", display.gateway);
|
|
185
|
+
printSection("Identity", display.identity);
|
|
186
|
+
printSection("PC Access", display.pcAccess);
|
|
187
|
+
if (display.channelConfigs && Object.keys(display.channelConfigs).length > 0) {
|
|
188
|
+
console.log(chalk.default.bold.white(" Channel Configs:"));
|
|
189
|
+
for (const [ch, v] of Object.entries(display.channelConfigs)) {
|
|
190
|
+
const scrubbed = scrubChannelConfig(v);
|
|
191
|
+
console.log(` ${chalk.default.cyan(ch)}: ${JSON.stringify(scrubbed).slice(0, 80)}`);
|
|
192
|
+
}
|
|
193
|
+
console.log();
|
|
194
|
+
}
|
|
195
|
+
if (display.skills?.installed?.length) {
|
|
196
|
+
console.log(chalk.default.bold.white(" Skills:"));
|
|
197
|
+
display.skills.installed.forEach((s) => console.log(` • ${s}`));
|
|
198
|
+
console.log();
|
|
199
|
+
}
|
|
200
|
+
console.log(chalk.default.gray(` Config file: ${getCFG_FILE()}`));
|
|
201
|
+
console.log();
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
function deepMerge(base, patch) {
|
|
205
|
+
const result = { ...base };
|
|
206
|
+
for (const key of Object.keys(patch || {})) {
|
|
207
|
+
if (patch[key] === void 0) continue;
|
|
208
|
+
if (patch[key] !== null && typeof patch[key] === "object" && !Array.isArray(patch[key])) result[key] = deepMerge(base[key] || {}, patch[key]);
|
|
209
|
+
else result[key] = patch[key];
|
|
210
|
+
}
|
|
211
|
+
return result;
|
|
212
|
+
}
|
|
213
|
+
function scrubSecrets(cfg) {
|
|
214
|
+
const s = JSON.parse(JSON.stringify(cfg));
|
|
215
|
+
if (s.provider?.apiKey) s.provider.apiKey = "●●●●●●●●";
|
|
216
|
+
if (Array.isArray(s.providers)) for (const p of s.providers) {
|
|
217
|
+
if (p.apiKey) p.apiKey = "●●●●●●●●";
|
|
218
|
+
if (Array.isArray(p.apiKeys)) p.apiKeys = p.apiKeys.map(() => "●●●●●●●●");
|
|
219
|
+
}
|
|
220
|
+
if (s.gateway?.authToken) s.gateway.authToken = "●●●●●●●●";
|
|
221
|
+
if (s.gateway?.remote?.token) s.gateway.remote.token = "●●●●●●●●";
|
|
222
|
+
if (s.gateway?.remote?.password) s.gateway.remote.password = "●●●●●●●●";
|
|
223
|
+
if (s.talkMode?.apiKey) s.talkMode.apiKey = "●●●●●●●●";
|
|
224
|
+
if (s.skills?.apiKeys) {
|
|
225
|
+
const keys = Object.keys(s.skills.apiKeys);
|
|
226
|
+
s.skills.apiKeys = Object.fromEntries(keys.map((k) => [k, "●●●●●●●●"]));
|
|
227
|
+
}
|
|
228
|
+
return s;
|
|
229
|
+
}
|
|
230
|
+
function scrubChannelConfig(ch) {
|
|
231
|
+
const s = { ...ch };
|
|
232
|
+
const secretFields = [
|
|
233
|
+
"token",
|
|
234
|
+
"accessToken",
|
|
235
|
+
"apiKey",
|
|
236
|
+
"appSecret",
|
|
237
|
+
"appPassword",
|
|
238
|
+
"signingSecret",
|
|
239
|
+
"channelSecret",
|
|
240
|
+
"secretKey",
|
|
241
|
+
"password",
|
|
242
|
+
"verifyToken"
|
|
243
|
+
];
|
|
244
|
+
for (const f of secretFields) if (s[f]) s[f] = "●●●●●●●●";
|
|
245
|
+
return s;
|
|
246
|
+
}
|
|
247
|
+
function printSection(label, data) {
|
|
248
|
+
if (!data || Object.keys(data).length === 0) return;
|
|
249
|
+
console.log(chalk.default.bold.white(` ${label}:`));
|
|
250
|
+
for (const [k, v] of Object.entries(data)) if (Array.isArray(v)) console.log(` ${chalk.default.gray(k)}: ${v.join(", ") || "(none)"}`);
|
|
251
|
+
else console.log(` ${chalk.default.gray(k)}: ${v}`);
|
|
252
|
+
console.log();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
//#endregion
|
|
256
|
+
Object.defineProperty(exports, 'ConfigStore', {
|
|
257
|
+
enumerable: true,
|
|
258
|
+
get: function () {
|
|
259
|
+
return ConfigStore;
|
|
260
|
+
}
|
|
261
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
require('./paths-AIyBxIzm.js');
|
|
3
|
+
require('./paths-DPovhojT.js');
|
|
4
|
+
require('./env-resolve-C0R8R7pb.js');
|
|
5
|
+
const require_config = require('./config-BzK_Xl4Y.js');
|
|
6
|
+
|
|
7
|
+
exports.ConfigStore = require_config.ConfigStore;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
require('./paths-AIyBxIzm.js');
|
|
3
|
+
require('./paths-DPovhojT.js');
|
|
4
|
+
require('./env-resolve--MaE2kFF.js');
|
|
5
|
+
const require_config = require('./config-FejpHHTz.js');
|
|
6
|
+
|
|
7
|
+
exports.ConfigStore = require_config.ConfigStore;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
require('./paths-AIyBxIzm.js');
|
|
3
|
+
require('./paths-DPovhojT.js');
|
|
4
|
+
require('./env-resolve-Buos635Y.js');
|
|
5
|
+
const require_config = require('./config-BAwkTUJC.js');
|
|
6
|
+
|
|
7
|
+
exports.ConfigStore = require_config.ConfigStore;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-jS-bbMI5.js');
|
|
2
|
+
require('./paths-AIyBxIzm.js');
|
|
3
|
+
require('./paths-DPovhojT.js');
|
|
4
|
+
require('./env-resolve-Bop7KbNq.js');
|
|
5
|
+
const require_config = require('./config-CYPw2v4l.js');
|
|
6
|
+
|
|
7
|
+
exports.ConfigStore = require_config.ConfigStore;
|
|
@@ -0,0 +1,312 @@
|
|
|
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 allowed = this.config.inlineMode ? ["message", "inline_query"] : ["message"];
|
|
120
|
+
const updates = await tgRequest(this.token, "getUpdates", {
|
|
121
|
+
offset: this.offset,
|
|
122
|
+
timeout: 30,
|
|
123
|
+
allowed_updates: allowed
|
|
124
|
+
});
|
|
125
|
+
for (const u of updates) {
|
|
126
|
+
this.offset = u.update_id + 1;
|
|
127
|
+
await this.handleUpdate(u).catch((e) => console.log(chalk.default.yellow(` ⚠ ${e.message}`)));
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {
|
|
130
|
+
if (this.running) {
|
|
131
|
+
console.log(chalk.default.yellow(` ⚠ Telegram poll: ${e.message}`));
|
|
132
|
+
await sleep(5e3);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
async handleUpdate(u) {
|
|
137
|
+
if (u.inline_query) {
|
|
138
|
+
this.emit("inline_query", {
|
|
139
|
+
id: u.inline_query.id,
|
|
140
|
+
from: String(u.inline_query.from?.id),
|
|
141
|
+
query: u.inline_query.query,
|
|
142
|
+
username: u.inline_query.from?.username
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const msg = u.message || u.edited_message;
|
|
147
|
+
if (!msg) return;
|
|
148
|
+
const text = msg.text?.trim() || "";
|
|
149
|
+
if (!text && !msg.voice) return;
|
|
150
|
+
const userId = String(msg.from?.id || "");
|
|
151
|
+
const isDM = msg.chat.type === "private";
|
|
152
|
+
const isGroup = msg.chat.type === "group" || msg.chat.type === "supergroup";
|
|
153
|
+
if (isDM && !await this.checkDMPolicy(userId, msg.chat.id, text || "[voice note]")) return;
|
|
154
|
+
let finalText = text || "[voice note]";
|
|
155
|
+
if (isGroup) {
|
|
156
|
+
const groupAllowFrom = this.config.groupAllowFrom ?? [];
|
|
157
|
+
if (groupAllowFrom.length > 0 && !groupAllowFrom.includes(String(msg.chat.id))) return;
|
|
158
|
+
const activation = this.config.groupActivation ?? "mention";
|
|
159
|
+
if (activation === "mention") {
|
|
160
|
+
const botUsername = this.botInfo?.username ? `@${this.botInfo.username}`.toLowerCase() : "";
|
|
161
|
+
const mentioned = botUsername && text.toLowerCase().includes(botUsername);
|
|
162
|
+
const isReplyToBot = msg.reply_to_message?.from?.is_bot && msg.reply_to_message.from.id === this.botInfo?.id;
|
|
163
|
+
if (!mentioned && !isReplyToBot) return;
|
|
164
|
+
if (mentioned && botUsername) finalText = text.replace(new RegExp(botUsername, "gi"), "").trim() || finalText;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
let audioBuffer;
|
|
168
|
+
if (msg?.voice?.file_id) try {
|
|
169
|
+
const file = await tgRequest(this.token, "getFile", { file_id: msg.voice.file_id });
|
|
170
|
+
audioBuffer = await tgDownloadFile(this.token, file.file_path);
|
|
171
|
+
} catch (e) {
|
|
172
|
+
console.log(chalk.default.yellow(` ⚠ Telegram voice download failed: ${e.message}`));
|
|
173
|
+
}
|
|
174
|
+
this.emit("message", {
|
|
175
|
+
id: String(msg.message_id),
|
|
176
|
+
channelId: "telegram",
|
|
177
|
+
from: userId,
|
|
178
|
+
fromUsername: msg.from?.username,
|
|
179
|
+
chatId: msg.chat.id,
|
|
180
|
+
text: finalText,
|
|
181
|
+
audioBuffer,
|
|
182
|
+
timestamp: new Date(msg.date * 1e3).toISOString(),
|
|
183
|
+
isDM,
|
|
184
|
+
isGroup,
|
|
185
|
+
threadId: msg.message_thread_id != null ? String(msg.message_thread_id) : void 0
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
async checkDMPolicy(userId, chatId, text) {
|
|
189
|
+
if (this.config.dmPolicy === "none") return false;
|
|
190
|
+
if (this.config.dmPolicy === "open") return true;
|
|
191
|
+
if (this.config.dmPolicy === "allowlist") {
|
|
192
|
+
if (this.config.allowFrom.includes(userId)) return true;
|
|
193
|
+
await this.sendMessage(chatId, `🦅 *HyperClaw*\n\nYou are not on the allowlist.`);
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
if (this.config.dmPolicy === "pairing") {
|
|
197
|
+
if (this.config.approvedPairings.includes(userId)) return true;
|
|
198
|
+
const upper = text.trim().toUpperCase();
|
|
199
|
+
if (this.config.pendingPairings[upper]) {
|
|
200
|
+
this.config.approvedPairings.push(userId);
|
|
201
|
+
delete this.config.pendingPairings[upper];
|
|
202
|
+
await this.saveState();
|
|
203
|
+
await this.sendMessage(chatId, `🦅 *Paired!* You can now send messages.`);
|
|
204
|
+
this.emit("pairing:approved", {
|
|
205
|
+
userId,
|
|
206
|
+
channelId: "telegram"
|
|
207
|
+
});
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
const code = generateCode();
|
|
211
|
+
this.config.pendingPairings[code] = userId;
|
|
212
|
+
await this.saveState();
|
|
213
|
+
await this.sendMessage(chatId, `🦅 *HyperClaw Pairing*\n\nSend the owner this code:\n\`${code}\`\n\nApprove with:\n\`hyperclaw pairing approve telegram ${code}\``);
|
|
214
|
+
console.log(chalk.default.cyan(` 🦅 Telegram pairing from ${userId} — code: ${code}`));
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
async sendMessage(chatId, text, opts = {}) {
|
|
220
|
+
const chunks = chunkText(text, 4096);
|
|
221
|
+
let last = null;
|
|
222
|
+
for (const chunk of chunks) last = await tgRequest(this.token, "sendMessage", {
|
|
223
|
+
chat_id: chatId,
|
|
224
|
+
text: chunk,
|
|
225
|
+
parse_mode: opts.parse_mode || "Markdown",
|
|
226
|
+
disable_web_page_preview: opts.disable_web_page_preview ?? true,
|
|
227
|
+
...opts.reply_to_message_id ? { reply_to_message_id: opts.reply_to_message_id } : {},
|
|
228
|
+
...opts.message_thread_id != null ? { message_thread_id: opts.message_thread_id } : {}
|
|
229
|
+
});
|
|
230
|
+
return last;
|
|
231
|
+
}
|
|
232
|
+
async sendTyping(chatId) {
|
|
233
|
+
await tgRequest(this.token, "sendChatAction", {
|
|
234
|
+
chat_id: chatId,
|
|
235
|
+
action: "typing"
|
|
236
|
+
}).catch(() => {});
|
|
237
|
+
}
|
|
238
|
+
/** Answer inline query (Telegram inline mode). Results shown when user types @botname <query> in any chat. */
|
|
239
|
+
async answerInlineQuery(queryId, results, opts) {
|
|
240
|
+
try {
|
|
241
|
+
const articles = results.map((r) => ({
|
|
242
|
+
type: "article",
|
|
243
|
+
id: r.id,
|
|
244
|
+
title: r.title,
|
|
245
|
+
description: r.description,
|
|
246
|
+
input_message_content: {
|
|
247
|
+
message_text: r.message_text,
|
|
248
|
+
parse_mode: r.parse_mode || "Markdown"
|
|
249
|
+
}
|
|
250
|
+
}));
|
|
251
|
+
await tgRequest(this.token, "answerInlineQuery", {
|
|
252
|
+
inline_query_id: queryId,
|
|
253
|
+
results: articles,
|
|
254
|
+
cache_time: opts?.cache_time ?? 60
|
|
255
|
+
});
|
|
256
|
+
return true;
|
|
257
|
+
} catch {
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
approvePairing(code) {
|
|
262
|
+
const upper = code.toUpperCase();
|
|
263
|
+
if (!this.config.pendingPairings[upper]) return false;
|
|
264
|
+
const userId = this.config.pendingPairings[upper];
|
|
265
|
+
this.config.approvedPairings.push(userId);
|
|
266
|
+
delete this.config.pendingPairings[upper];
|
|
267
|
+
this.saveState();
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
addToAllowlist(userId) {
|
|
271
|
+
if (!this.config.allowFrom.includes(userId)) {
|
|
272
|
+
this.config.allowFrom.push(userId);
|
|
273
|
+
this.saveState();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
listPendingPairings() {
|
|
277
|
+
return Object.entries(this.config.pendingPairings).map(([code, userId]) => ({
|
|
278
|
+
code,
|
|
279
|
+
userId
|
|
280
|
+
}));
|
|
281
|
+
}
|
|
282
|
+
handleWebhookPayload(body) {
|
|
283
|
+
try {
|
|
284
|
+
this.handleUpdate(JSON.parse(body));
|
|
285
|
+
} catch {}
|
|
286
|
+
}
|
|
287
|
+
async loadState() {
|
|
288
|
+
try {
|
|
289
|
+
const s = await fs_extra.default.readJson(STATE_FILE);
|
|
290
|
+
this.offset = s.offset || 0;
|
|
291
|
+
if (s.pendingPairings) this.config.pendingPairings = s.pendingPairings;
|
|
292
|
+
if (s.approvedPairings) this.config.approvedPairings = s.approvedPairings;
|
|
293
|
+
} catch {}
|
|
294
|
+
}
|
|
295
|
+
async saveState() {
|
|
296
|
+
await fs_extra.default.ensureDir(path.default.dirname(STATE_FILE));
|
|
297
|
+
await fs_extra.default.writeJson(STATE_FILE, {
|
|
298
|
+
offset: this.offset,
|
|
299
|
+
pendingPairings: this.config.pendingPairings,
|
|
300
|
+
approvedPairings: this.config.approvedPairings
|
|
301
|
+
}, { spaces: 2 });
|
|
302
|
+
}
|
|
303
|
+
isRunning() {
|
|
304
|
+
return this.running;
|
|
305
|
+
}
|
|
306
|
+
getBotInfo() {
|
|
307
|
+
return this.botInfo;
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
//#endregion
|
|
312
|
+
exports.TelegramConnector = TelegramConnector;
|