very-happy-cli 0.2.178 → 0.2.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcpBackend-DCQXHRzT.mjs → AcpBackend-B8Zi30Zh.mjs} +135 -16
- package/dist/{AcpBackend-CDkAQXYf.cjs → AcpBackend-DfRDtMcG.cjs} +135 -16
- package/dist/{AcpSessionManager-DckmUZza.cjs → AcpSessionManager-CASKOnOj.cjs} +38 -4
- package/dist/{AcpSessionManager-BXrQcqwC.mjs → AcpSessionManager-i8Rab0xT.mjs} +38 -4
- package/dist/{BasePermissionHandler-BVlrEhIi.mjs → BasePermissionHandler-26fKbRCm.mjs} +5 -2
- package/dist/{BasePermissionHandler-DyLmKKtO.cjs → BasePermissionHandler-BlM_tfej.cjs} +5 -2
- package/dist/acpSessionResume-B9l54P-X.mjs +67 -0
- package/dist/acpSessionResume-CR5pmgVo.cjs +74 -0
- package/dist/{agentHome-CEp9RMyK.cjs → agentHome-C7Sb7-Tz.cjs} +4 -4
- package/dist/{agentHome-C1xi37as.mjs → agentHome-CmGy0NWv.mjs} +4 -4
- package/dist/{api-JANhFdZV.cjs → api-DM7b1OKj.cjs} +38 -262
- package/dist/{api-Dib0dmqC.mjs → api-Hov8p7CA.mjs} +32 -256
- package/dist/{apiMachine-DNTJidYH.mjs → apiMachine-CwGEhQDT.mjs} +62 -15
- package/dist/{apiMachine-QhK-sKcr.cjs → apiMachine-DkGRj-Ai.cjs} +64 -17
- package/dist/{attachmentContent-bpQTBJ0y.cjs → attachmentContent-CEm13_gF.cjs} +4 -4
- package/dist/{attachmentContent-DkkdpSSJ.mjs → attachmentContent-CIn4iPEk.mjs} +2 -2
- package/dist/{auth-BRjd2esb.mjs → auth-BG1DY0gj.mjs} +5 -5
- package/dist/{auth-DgIV0Cvt.cjs → auth-CBXnm-Mj.cjs} +5 -5
- package/dist/{auth-omWDtgR8.cjs → auth-Dawj7pP5.cjs} +8 -8
- package/dist/{auth-DNct7VUi.mjs → auth-rggxMpEE.mjs} +8 -8
- package/dist/{auto-DKGFOJBo.mjs → auto-CXXLXGeL.mjs} +19 -18
- package/dist/{auto-CI16FZmX.cjs → auto-CbYOfoPS.cjs} +19 -18
- package/dist/{backgroundTaskActivity-BVwJBl02.mjs → backgroundTaskActivity-8PdPxrvy.mjs} +1 -1
- package/dist/{bootstrap-DCQ87Aan.cjs → bootstrap-DoA7okld.cjs} +2 -2
- package/dist/{bootstrap-BUagGC_-.mjs → bootstrap-Dt5I1SOl.mjs} +2 -2
- package/dist/{browser-Dj_DYQEh.mjs → browser-DUNetFT4.mjs} +1 -1
- package/dist/{browser-CSKhc0Bl.cjs → browser-DZ6qRtfH.cjs} +1 -1
- package/dist/{claudeCliPath-U4HHmV4r.cjs → claudeCliPath-GaP3UUz1.cjs} +1 -1
- package/dist/{claudeLocal-CdIVnOZp.cjs → claudeLocal--DNyMOSv.cjs} +8 -7
- package/dist/{claudeLocal-CCCvAeMd.mjs → claudeLocal-OHWQigCl.mjs} +6 -5
- package/dist/{claudeLocalLauncher-BmrpaRYJ.mjs → claudeLocalLauncher-BStvfa7M.mjs} +11 -10
- package/dist/{claudeLocalLauncher-21-xh5gc.cjs → claudeLocalLauncher-BhvPbcyH.cjs} +13 -12
- package/dist/{claudeSessionFork-kYCP1IJB.cjs → claudeSessionFork-Be16vzGc.cjs} +1 -1
- package/dist/{claudeSessionFork-DvxMKAmY.mjs → claudeSessionFork-GAVWhiKG.mjs} +1 -1
- package/dist/{client-C4zKGjiJ.cjs → client-BWjaHKtj.cjs} +2 -2
- package/dist/client-Ca5Pcgy_.mjs +71 -0
- package/dist/{client-CnlkkrZO.mjs → client-CnB7kRCT.mjs} +2 -2
- package/dist/{client-BTX9hsbr.mjs → client-D4uPb1uu.mjs} +3 -3
- package/dist/client-DJplzPjD.cjs +76 -0
- package/dist/{client-Dnza1hgN.cjs → client-D_loZ9IK.cjs} +3 -3
- package/dist/codex/happyMcpStdioBridge.cjs +24 -15
- package/dist/codex/happyMcpStdioBridge.mjs +25 -16
- package/dist/{codexAppServerClient-DvkpQgyv.mjs → codexAppServerClient-CO4G6OS4.mjs} +3 -3
- package/dist/{codexAppServerClient-CRlBWGn3.cjs → codexAppServerClient-PE-12AsW.cjs} +3 -3
- package/dist/{codexCommand-DzxIWXIT.cjs → codexCommand-BNoD1t1C.cjs} +127 -116
- package/dist/{codexCommand-BxjogBzU.mjs → codexCommand-B_xUH79E.mjs} +77 -66
- package/dist/{codexTermination-C28FzlLb.cjs → codexTermination-BmBbizFK.cjs} +7 -2
- package/dist/{codexTermination-ySDNMEhd.mjs → codexTermination-Dx48ma6e.mjs} +7 -2
- package/dist/{config-BFB5uJ4t.cjs → config-CtwEUxUP.cjs} +26 -26
- package/dist/{config-DwfEpFr3.mjs → config-DSu0Blos.mjs} +3 -3
- package/dist/{configuration-4TGMrjul.cjs → configuration-CYO-kPOS.cjs} +1 -1
- package/dist/{configuration-DVrb61aY.mjs → configuration-PxzEJumr.mjs} +1 -1
- package/dist/{connect-C7FPY0PI.mjs → connect-BQrg3TB6.mjs} +15 -15
- package/dist/{connect-QH2VJGBG.cjs → connect-Dq7wndzR.cjs} +28 -28
- package/dist/{context-JoKu0V54.cjs → context-6TP-iz_c.cjs} +1 -1
- package/dist/{context-B3XPVJlj.mjs → context-CJGRRGWW.mjs} +1 -1
- package/dist/{controlClient-BTaZlbC6.cjs → controlClient-Bqv5v5OM.cjs} +3 -3
- package/dist/{controlClient-BYKyGyxj.mjs → controlClient-DoeYovwP.mjs} +4 -4
- package/dist/{createSessionMetadata-8Fuj2-IV.mjs → createSessionMetadata-DDIChCx8.mjs} +2 -2
- package/dist/{createSessionMetadata-B2NynaWZ.cjs → createSessionMetadata-xz767pcG.cjs} +3 -3
- package/dist/{defaultPermissionMode-BEWCqJU-.cjs → defaultPermissionMode-PkZGsQDk.cjs} +2 -2
- package/dist/{defaultPermissionMode-B8kJG9uI.mjs → defaultPermissionMode-i5KzdK09.mjs} +2 -2
- package/dist/{detectCLI-DR9ZaN6B.cjs → detectCLI-BuYR_Qxe.cjs} +4 -4
- package/dist/{deterministicJson-C5ZwZ7hu.mjs → deterministicJson-CTEJDqtS.mjs} +217 -12
- package/dist/{deterministicJson-BjNQsAjO.cjs → deterministicJson-xqA6DaOm.cjs} +222 -16
- package/dist/{doctor-BshRnjLi.cjs → doctor-BrgSlfXn.cjs} +9 -9
- package/dist/{doctor-0BiGwJXk.mjs → doctor-IctjVh9T.mjs} +8 -8
- package/dist/{doctorReadiness-BCZGcN0a.cjs → doctorReadiness-Dl6yRQCy.cjs} +1 -1
- package/dist/{downloadTarget-BN5vZt3K.cjs → downloadTarget-CEb9che-.cjs} +6 -6
- package/dist/{downloadTarget-DJPwAZlu.mjs → downloadTarget-jbOz1egC.mjs} +6 -6
- package/dist/{ensureDaemonRunning-C5QfToCe.cjs → ensureDaemonRunning-D-HyjGIX.cjs} +6 -6
- package/dist/{ensureDaemonRunning-CSmb_mqt.mjs → ensureDaemonRunning-b1e8LCSM.mjs} +5 -5
- package/dist/{handleResumeCommand-BwnUZmbo.cjs → handleResumeCommand-BvWVuRwH.cjs} +23 -7
- package/dist/{handleResumeCommand-CgjpsdDe.mjs → handleResumeCommand-DpaZvm2c.mjs} +22 -6
- package/dist/{index-piJPsTsm.cjs → index-B2p2Mut7.cjs} +259 -53
- package/dist/{index-BehVbAsA.mjs → index-BUNnpGFF.mjs} +256 -50
- package/dist/{index-Bvldtdny.mjs → index-Bsvbgh9e.mjs} +4 -4
- package/dist/{index-BYOZ_8WZ.cjs → index-C64Ufj4D.cjs} +4 -4
- package/dist/{index-Clqlu17M.mjs → index-C6Vn5Eac.mjs} +155 -34
- package/dist/index-CMf5VbzG.mjs +18 -0
- package/dist/index-DmTlDRSL.cjs +24 -0
- package/dist/{index-_l1Sdmbi.cjs → index-Dv0Q48P3.cjs} +156 -33
- package/dist/{index-BRClDe07.cjs → index-F2UejqYs.cjs} +3 -3
- package/dist/{index-BYgfern_.mjs → index-wCbtF4BK.mjs} +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-BdvKiOQw.mjs → install-BX3lv3NO.mjs} +1 -1
- package/dist/{install-Cf6AFSWC.cjs → install-BXvf2E3o.cjs} +1 -1
- package/dist/{install-TO4taKW7.cjs → install-C0ANcEAW.cjs} +7 -7
- package/dist/{install-fYWHrPcC.mjs → install-CdzSV7qO.mjs} +3 -3
- package/dist/{installPiTools-BKnXjrVu.cjs → installPiTools-CL_axh_6.cjs} +1 -1
- package/dist/{installTerminalHooks-BQZbvxsZ.cjs → installTerminalHooks-BETLKAtd.cjs} +3 -3
- package/dist/lib.cjs +14 -14
- package/dist/lib.d.cts +239 -2
- package/dist/lib.d.mts +239 -2
- package/dist/lib.mjs +14 -14
- package/dist/{lidState-BeOwj6eW.cjs → lidState-DWGnm2H4.cjs} +1 -1
- package/dist/{lidState-DNMlIhX0.mjs → lidState-bBrmaQd2.mjs} +1 -1
- package/dist/{localHappyAgentAuth-Br-mgogg.cjs → localHappyAgentAuth-DZHQnIW9.cjs} +1 -1
- package/dist/{localHappyAgentAuth-BezKSFDi.mjs → localHappyAgentAuth-Dn1jYDpt.mjs} +1 -1
- package/dist/{logger--vAVtXB_.mjs → logger-BUngm5Xg.mjs} +2 -2
- package/dist/{logger-DXTWlPzP.cjs → logger-CphW5nUE.cjs} +2 -2
- package/dist/machineMetadata-BQm9YTcI.cjs +79 -0
- package/dist/machineMetadata-BXN_bKU3.mjs +68 -0
- package/dist/{main-DoMFJ2Cl.cjs → main-B2UV51nK.cjs} +112 -132
- package/dist/{main-CshDb5-1.mjs → main-DGkdYfEq.mjs} +106 -126
- package/dist/{mcp-pNc1EbQf.cjs → mcp-BFvAEIRz.cjs} +15 -15
- package/dist/{mcp-DKT_lrvQ.mjs → mcp-CbTtbs0f.mjs} +15 -15
- package/dist/{mirrorProtocol-6IFGPpjJ.mjs → mirrorProtocol-BR4luBC0.mjs} +148 -7
- package/dist/{mirrorProtocol-qKflWTX_.cjs → mirrorProtocol-HKPivs5o.cjs} +150 -4
- package/dist/{package-B7B03ejW.mjs → package-7Ld1YMhh.mjs} +8 -7
- package/dist/{package-DY4zTbKS.cjs → package-KhLqBDX9.cjs} +8 -7
- package/dist/panels-C7IVqpJk.mjs +137 -0
- package/dist/panels-Njf6GelF.cjs +142 -0
- package/dist/{peerTools-3R9RUARX.mjs → peerTools-BOlDRyhi.mjs} +60 -10
- package/dist/{peerTools-iy3_6Yc5.cjs → peerTools-DQNlrcqM.cjs} +60 -9
- package/dist/{persistence-BfX72dne.cjs → persistence-9BMYspxG.cjs} +2 -2
- package/dist/{persistence-DTk4sNpd.mjs → persistence-BFUOHW5h.mjs} +3 -3
- package/dist/{piRunnerArgs-CRQVR9o-.cjs → piRunnerArgs-DGaq6VYM.cjs} +8 -2
- package/dist/{piRunnerArgs-AT8QJY7x.mjs → piRunnerArgs-H2pgpA5z.mjs} +7 -1
- package/dist/{piRuntime-BHRT5MKO.cjs → piRuntime-CT5xv_3h.cjs} +2 -2
- package/dist/{piRuntime-E44qTVQ4.mjs → piRuntime-CdN0JAsa.mjs} +2 -2
- package/dist/{piTerminal-hI4WFdWm.cjs → piTerminal-0FBtXTHK.cjs} +18 -18
- package/dist/{piTerminal-De8nbciM.mjs → piTerminal-C4m9YXAV.mjs} +18 -18
- package/dist/processTreeSnapshot-CuLJDNC-.mjs +101 -0
- package/dist/processTreeSnapshot-mDbnuojn.cjs +105 -0
- package/dist/projectPath-C3ioB4Bu.cjs +13 -0
- package/dist/prompt-BOouDaTM.mjs +99 -0
- package/dist/prompt-lgF9IE82.cjs +105 -0
- package/dist/{attachmentLimits-UyFn8fkQ.mjs → pushNotifications-DCiBEVeC.mjs} +307 -3
- package/dist/{attachmentLimits-SqeAHrVC.cjs → pushNotifications-DI92havG.cjs} +308 -2
- package/dist/{index-DFPT4HOO.cjs → query-BETKBrnz.cjs} +25 -5
- package/dist/{index-CEjJnq05.mjs → query-ywZbQUzR.mjs} +26 -3
- package/dist/{rateLimitWindows-XrJiiBpU.mjs → rateLimitWindows-BkfuUB1a.mjs} +1 -1
- package/dist/{rateLimitWindows-Czb7_7cK.cjs → rateLimitWindows-YRIYVdo4.cjs} +1 -1
- package/dist/{registerCommonHandlers-C0_fyBQ0.cjs → registerCommonHandlers-C7a_dUWs.cjs} +30 -30
- package/dist/{registerCommonHandlers-CvIedVRf.mjs → registerCommonHandlers-CTkCvjxt.mjs} +2 -2
- package/dist/{registerKillSessionHandler-DYl7l4Ts.cjs → registerKillSessionHandler-CIsvBrVe.cjs} +6 -6
- package/dist/{registerKillSessionHandler-gwJ5lTf0.mjs → registerKillSessionHandler-CaqqRYq6.mjs} +6 -6
- package/dist/{remoteSessionClient-BRTIOX5b.cjs → remoteSessionClient-D843fkzL.cjs} +5 -5
- package/dist/{remoteSessionClient-DRb2Jr5s.mjs → remoteSessionClient-PP-mOKmw.mjs} +5 -5
- package/dist/{reportProgressTool-B9nCzbkL.cjs → reportProgressTool-14AXr959.cjs} +84 -2
- package/dist/{reportProgressTool-D5tEoXMW.mjs → reportProgressTool-ZOCNjWHr.mjs} +82 -3
- package/dist/{resources-JDPugcDq.cjs → resources-CvIlkzpP.cjs} +30 -0
- package/dist/{resources-BdFBQi8r.mjs → resources-y9jfyO-_.mjs} +30 -0
- package/dist/{run-CKe_WeLW.cjs → run-CAOCYYfT.cjs} +2806 -110
- package/dist/{run-BQ_FGaOL.mjs → run-Dajw2E5j.mjs} +2787 -91
- package/dist/{runClaude-zrrNcQC_.mjs → runClaude-C6oxWYbp.mjs} +49 -47
- package/dist/{runClaude-MHI5IKM-.cjs → runClaude-CRRKt-tm.cjs} +50 -48
- package/dist/{runClaudeDeps-RRw-Nusc.cjs → runClaudeDeps-B1ysqTvx.cjs} +310 -237
- package/dist/{runClaudeDeps-CVBCokOS.mjs → runClaudeDeps-BcZ68cX3.mjs} +297 -226
- package/dist/{runGemini-kipag2ag.mjs → runGemini-D7yKc4wD.mjs} +61 -55
- package/dist/{runGemini-D7Lg9yCr.cjs → runGemini-DtKFXqf-.cjs} +89 -83
- package/dist/{runOpenClaw-C_lRY3Do.mjs → runOpenClaw-C8ilyLP9.mjs} +19 -19
- package/dist/{runOpenClaw-DCcQ0L2N.cjs → runOpenClaw-Cq29mryb.cjs} +20 -20
- package/dist/{sandbox-BSyXFVFp.mjs → sandbox-CbCutma4.mjs} +4 -4
- package/dist/{sandbox-dMwPTmjm.cjs → sandbox-gIj-EuF4.cjs} +4 -4
- package/dist/{selfCheck-DkzDDUsE.cjs → selfCheck-BTGBVthv.cjs} +39 -38
- package/dist/selfCheck-Smt-5Xiq.mjs +85 -0
- package/dist/{send-dxC0miIA.cjs → send-CZf5lLw_.cjs} +8 -8
- package/dist/{send-C-k9nsd3.mjs → send-YZRMQvMJ.mjs} +9 -9
- package/dist/{server-DxoTYNlw.mjs → server-BqwXRzFZ.mjs} +4 -4
- package/dist/{server-B-W6P7Qr.cjs → server-CknFq6xG.cjs} +6 -6
- package/dist/sessionExitLifecycle-CzkLIgNZ.mjs +142 -0
- package/dist/sessionExitLifecycle-DFltxXU8.cjs +148 -0
- package/dist/{sessionLock-DWX6BbiU.cjs → sessionLock-DRZUcKHT.cjs} +38 -5
- package/dist/{sessionLock-DBdtZGOL.mjs → sessionLock-nBXdJxJm.mjs} +36 -5
- package/dist/{sessionOps-BAnr7n8t.cjs → sessionOps-BrGiU9-s.cjs} +10 -5
- package/dist/{sessionOps-BVoXe12O.mjs → sessionOps-C58iDeD5.mjs} +11 -6
- package/dist/{sessionScanner-BtxoeluY.mjs → sessionScanner-Bm57LEXe.mjs} +3 -3
- package/dist/{sessionScanner-CDOYsEUD.cjs → sessionScanner-CaO8bLaG.cjs} +3 -3
- package/dist/{sessions-C3sZJkzI.mjs → sessions-BXyBHo8n.mjs} +40 -18
- package/dist/{sessions-hAitoN-m.cjs → sessions-uzqPCc37.cjs} +39 -16
- package/dist/{setupOfflineReconnection-_eD4cuUT.mjs → setupOfflineReconnection-1Qlek3wl.mjs} +2 -2
- package/dist/{setupOfflineReconnection-C2EeYTFH.cjs → setupOfflineReconnection-DvvVX3TB.cjs} +2 -2
- package/dist/{spawn-Bc9v7pIf.cjs → spawn-DBkodJEO.cjs} +49 -18
- package/dist/{spawn-qNrB2CD_.mjs → spawn-vn93PhYL.mjs} +49 -18
- package/dist/spawnAgents-CgPMWexP.mjs +79 -0
- package/dist/{spawnAgents-BVEaz35W.cjs → spawnAgents-DLNMlhWJ.cjs} +37 -1
- package/dist/{spawnHappyCLI-C2stUioM.mjs → spawnHappyCLI-BjFZc_7V.mjs} +1 -1
- package/dist/{spawnHappyCLI-fzUagkKV.cjs → spawnHappyCLI-DnUZv0X2.cjs} +2 -2
- package/dist/{specialCommands-BJ-nqY4s.cjs → specialCommands-BRufxlqe.cjs} +3 -3
- package/dist/{specialCommands-C6W-rVyh.mjs → specialCommands-D3ND9bdg.mjs} +3 -3
- package/dist/{startFileWatcher-Bqlqjt93.cjs → startFileWatcher-D9cYzZOq.cjs} +1 -1
- package/dist/{startFileWatcher-CR09Snmz.mjs → startFileWatcher-DXJ7yB5v.mjs} +1 -1
- package/dist/startupSessionCreate-kdr3m1uX.cjs +26 -0
- package/dist/startupSessionCreate-uZ6BM0ty.mjs +24 -0
- package/dist/{streamRelay-CJoMk_d2.mjs → streamRelay-DnMCMMfV.mjs} +1 -1
- package/dist/{streamRelay-9kBPpbvU.cjs → streamRelay-Dy6amlzx.cjs} +1 -1
- package/dist/{sync-Dhmtk66S.cjs → sync-Bn-idAoy.cjs} +1 -1
- package/dist/{sync-DbW07iQS.mjs → sync-BvVhDO40.mjs} +1 -1
- package/dist/{systemPrompt-CQcuUmVp.mjs → systemPrompt-CIZcJuJF.mjs} +4 -3
- package/dist/{systemPrompt-3PYi3EUY.cjs → systemPrompt-DlyEk35T.cjs} +4 -3
- package/dist/{teams-DpxLcUU_.cjs → teams-BLeRpDxv.cjs} +8 -8
- package/dist/{teams-CwF4Z2fA.mjs → teams-DLY3B5yi.mjs} +8 -8
- package/dist/{time-A6zR3Iy6.cjs → time-Cjv0zxQO.cjs} +1 -1
- package/dist/{time-BuGWTVP6.mjs → time-D3ETL7Jb.mjs} +1 -1
- package/dist/{titleGenerator-D26gvNaS.cjs → titleGenerator-Cgp5ihFb.cjs} +10 -9
- package/dist/{titleGenerator-BGEzNWC9.mjs → titleGenerator-Uzbd4utr.mjs} +9 -8
- package/dist/{todo-DrZc76H5.mjs → todo-C9Ga-oEM.mjs} +6 -6
- package/dist/{todo-73g3NCIO.cjs → todo-pOMcEECE.cjs} +6 -6
- package/dist/{tools-CxJp4T1T.cjs → tools-BL7Byl_x.cjs} +1 -1
- package/dist/{tools-BtsrQnNS.mjs → tools-Cho7iIWf.mjs} +1 -1
- package/dist/{uninstall-DWNYvewQ.cjs → uninstall-CbayEVoV.cjs} +6 -6
- package/dist/{uninstall-DOb2mTwV.mjs → uninstall-CvZHVY9C.mjs} +3 -3
- package/dist/webPanels-B2_C2-3g.mjs +49 -0
- package/dist/webPanels-FCgFKvVe.cjs +53 -0
- package/package.json +8 -7
- package/dist/machineMetadata-B1H9gNbN.mjs +0 -39
- package/dist/machineMetadata-DcUupMje.cjs +0 -42
- package/dist/messageBuffer-BWlGgR3A.mjs +0 -71
- package/dist/messageBuffer-fJMH6uY8.cjs +0 -73
- package/dist/projectPath-ChLhdOyt.cjs +0 -13
- package/dist/selfCheck-CF7XGJPb.mjs +0 -84
- package/dist/sessionModeFile-ByLbXTbg.mjs +0 -32
- package/dist/sessionModeFile-CLLdidiJ.cjs +0 -36
- package/dist/spawnAgents-Bw6j4tqz.mjs +0 -45
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
4
|
-
var persistence = require('./persistence-
|
|
5
|
-
var configuration = require('./configuration-
|
|
3
|
+
var logger = require('./logger-CphW5nUE.cjs');
|
|
4
|
+
var persistence = require('./persistence-9BMYspxG.cjs');
|
|
5
|
+
var configuration = require('./configuration-CYO-kPOS.cjs');
|
|
6
6
|
|
|
7
7
|
function daemonControlHeaders(controlToken) {
|
|
8
8
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as logger } from './logger
|
|
2
|
-
import { d as readDaemonState, f as clearDaemonState } from './persistence-
|
|
3
|
-
import { c as configuration } from './configuration-
|
|
1
|
+
import { l as logger } from './logger-BUngm5Xg.mjs';
|
|
2
|
+
import { d as readDaemonState, f as clearDaemonState } from './persistence-BFUOHW5h.mjs';
|
|
3
|
+
import { c as configuration } from './configuration-PxzEJumr.mjs';
|
|
4
4
|
|
|
5
5
|
function daemonControlHeaders(controlToken) {
|
|
6
6
|
return {
|
|
@@ -278,4 +278,4 @@ async function checkDaemonHibernation(body) {
|
|
|
278
278
|
};
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
export { checkIfDaemonRunningAndCleanupStaleState as a,
|
|
281
|
+
export { checkIfDaemonRunningAndCleanupStaleState as a, pushFilePreviewViaDaemon as b, checkDaemonHibernation as c, setTerminalTitleViaDaemon as d, spawnDaemonSession as e, stopDaemonSession as f, listDaemonPeers as g, resumeDaemonSession as h, isDaemonRunningCurrentlyInstalledHappyVersion as i, reportSessionEditToDaemon as j, notifyDaemonTurnEvent as k, listDaemonSessions as l, notifyDaemonBackgroundTasks as m, notifyDaemonSessionStarted as n, notifyDaemonSessionEvent as o, pushClipboardViaDaemon as p, notifyDaemonClaudeAuthFailed as q, reportRateLimitsToDaemon as r, stopDaemon as s, cleanupDaemonState as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
2
|
import { resolve, isAbsolute, dirname } from 'node:path';
|
|
3
|
-
import { c as configuration } from './configuration-
|
|
3
|
+
import { c as configuration } from './configuration-PxzEJumr.mjs';
|
|
4
4
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
5
|
-
import { p as packageJson } from './package-
|
|
5
|
+
import { p as packageJson } from './package-7Ld1YMhh.mjs';
|
|
6
6
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
7
7
|
|
|
8
8
|
const realFs = {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var os = require('node:os');
|
|
4
4
|
var path = require('node:path');
|
|
5
|
-
var configuration = require('./configuration-
|
|
6
|
-
var projectPath = require('./projectPath-
|
|
7
|
-
var _package = require('./package-
|
|
5
|
+
var configuration = require('./configuration-CYO-kPOS.cjs');
|
|
6
|
+
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
7
|
+
var _package = require('./package-KhLqBDX9.cjs');
|
|
8
8
|
var node_fs = require('node:fs');
|
|
9
9
|
|
|
10
10
|
const realFs = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
4
|
-
var persistence = require('./persistence-
|
|
3
|
+
var logger = require('./logger-CphW5nUE.cjs');
|
|
4
|
+
var persistence = require('./persistence-9BMYspxG.cjs');
|
|
5
5
|
|
|
6
6
|
const PRESENCE_SETTLE_MS = 6e3;
|
|
7
7
|
async function commitHibernation(deps) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as logger } from './logger
|
|
2
|
-
import { e as evaluateWrapperIdle, j as HIBERNATION_UNSUPPORTED_BACKOFF_MS } from './persistence-
|
|
1
|
+
import { l as logger } from './logger-BUngm5Xg.mjs';
|
|
2
|
+
import { e as evaluateWrapperIdle, j as HIBERNATION_UNSUPPORTED_BACKOFF_MS } from './persistence-BFUOHW5h.mjs';
|
|
3
3
|
|
|
4
4
|
const PRESENCE_SETTLE_MS = 6e3;
|
|
5
5
|
async function commitHibernation(deps) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var child_process = require('child_process');
|
|
4
4
|
var os = require('os');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var require$$0 = require('fs');
|
|
6
|
+
var require$$1 = require('path');
|
|
7
7
|
|
|
8
8
|
function detectCLIAvailability() {
|
|
9
9
|
const isWindows = os.platform() === "win32";
|
|
@@ -38,7 +38,7 @@ function detectPosix() {
|
|
|
38
38
|
const codex = commandExists("codex");
|
|
39
39
|
const gemini = commandExists("gemini");
|
|
40
40
|
const openclawCommand = commandExists("openclaw");
|
|
41
|
-
const openclawConfig =
|
|
41
|
+
const openclawConfig = require$$0.existsSync(require$$1.join(os.homedir(), ".openclaw", "openclaw.json"));
|
|
42
42
|
const openclawEnv = !!process.env.OPENCLAW_GATEWAY_URL;
|
|
43
43
|
const openclaw = openclawCommand || openclawConfig || openclawEnv;
|
|
44
44
|
const pi = commandExists("pi") && commandExists("pi-acp");
|
|
@@ -50,7 +50,7 @@ function detectWindows() {
|
|
|
50
50
|
const codex = checkCommand("codex");
|
|
51
51
|
const gemini = checkCommand("gemini");
|
|
52
52
|
const openclawCommand = checkCommand("openclaw");
|
|
53
|
-
const openclawConfig =
|
|
53
|
+
const openclawConfig = require$$0.existsSync(require$$1.join(process.env.USERPROFILE || os.homedir(), ".openclaw", "openclaw.json"));
|
|
54
54
|
const openclawEnv = !!process.env.OPENCLAW_GATEWAY_URL;
|
|
55
55
|
const openclaw = openclawCommand || openclawConfig || openclawEnv;
|
|
56
56
|
const pi = checkCommand("pi") && checkCommand("pi-acp");
|
|
@@ -1,26 +1,124 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as logger } from './logger-BUngm5Xg.mjs';
|
|
2
|
+
import { p as prependToMessage, b as buildDigestLine, a as buildFirstTurnPrefix } from './prompt-BOouDaTM.mjs';
|
|
3
|
+
import { P as ProjectsUnsupportedError } from './client-Ca5Pcgy_.mjs';
|
|
4
|
+
import { c as createSelfReportState, A as AUTOMATION_TOOL_NAMES, P as PROJECT_TOOL_NAMES, r as registerAutomationTools, a as registerProjectTools, d as createProjectToolExecutor, b as registerReportProgressTool, n as normalizeAttention, e as normalizePhase, f as normalizeProgress, s as shouldAcceptSelfReport } from './reportProgressTool-ZOCNjWHr.mjs';
|
|
5
|
+
import { C as ContextUsageSchema } from './index-C6Vn5Eac.mjs';
|
|
2
6
|
import { unlink, mkdir, open, rename } from 'node:fs/promises';
|
|
3
7
|
import { randomUUID } from 'node:crypto';
|
|
4
8
|
import { constants } from 'node:fs';
|
|
5
9
|
import { dirname } from 'node:path';
|
|
6
10
|
import { z } from 'zod';
|
|
7
|
-
import { T as TeamConnectionPreflightError, c as createTeamsClient } from './client-
|
|
8
|
-
import { t as teamScopePath } from './context-
|
|
9
|
-
import { g as waitForSessionKey, e as sendUserMessage } from './sessionOps-
|
|
10
|
-
import { T as TEAM_SKILL } from './resources-
|
|
11
|
-
import { T as TEAM_TOOL_NAMES, r as registerTeamsTools } from './tools-
|
|
12
|
-
import {
|
|
13
|
-
import { S as SESSION_PEER_TOOL_NAMES, r as registerSessionPeerTools, a as createSessionPeerToolExecutor } from './peerTools-3R9RUARX.mjs';
|
|
11
|
+
import { T as TeamConnectionPreflightError, c as createTeamsClient } from './client-D4uPb1uu.mjs';
|
|
12
|
+
import { t as teamScopePath } from './context-CJGRRGWW.mjs';
|
|
13
|
+
import { g as waitForSessionKey, e as sendUserMessage } from './sessionOps-C58iDeD5.mjs';
|
|
14
|
+
import { T as TEAM_SKILL } from './resources-y9jfyO-_.mjs';
|
|
15
|
+
import { T as TEAM_TOOL_NAMES, r as registerTeamsTools } from './tools-Cho7iIWf.mjs';
|
|
16
|
+
import { S as SESSION_PEER_TOOL_NAMES, r as registerSessionPeerTools, a as createSessionPeerToolExecutor } from './peerTools-BOlDRyhi.mjs';
|
|
14
17
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
15
18
|
import { createServer } from 'node:http';
|
|
16
19
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
17
|
-
import { l as logger } from './logger--vAVtXB_.mjs';
|
|
18
20
|
import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION, c as CLIPBOARD_MAX_BYTES } from './limits-DIo7rEBR.mjs';
|
|
19
|
-
import { A as ASSISTANT_TOOL_NAMES, a as registerAssistantTools, c as checkDownloadTarget } from './downloadTarget-
|
|
21
|
+
import { A as ASSISTANT_TOOL_NAMES, a as registerAssistantTools, c as checkDownloadTarget } from './downloadTarget-jbOz1egC.mjs';
|
|
20
22
|
import { P as PREVIEW_TOOL_NAME, R as REPORT_PROGRESS_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, c as PREVIEW_DOWNLOAD_PARAM_DESCRIPTION } from './agentGuidance-BDYt2Qy2.mjs';
|
|
23
|
+
import { n as normalizeWebPanels, w as webPanelPath } from './webPanels-B2_C2-3g.mjs';
|
|
24
|
+
import { r as readSettings } from './persistence-BFUOHW5h.mjs';
|
|
25
|
+
import { g as getSessionNotificationBody } from './pushNotifications-DCiBEVeC.mjs';
|
|
21
26
|
import { c as checkPreviewPath } from './previewPath-CXN4Vag0.mjs';
|
|
22
27
|
import { createHash } from 'crypto';
|
|
23
28
|
|
|
29
|
+
function createProjectInjector(deps) {
|
|
30
|
+
const timeoutMs = deps.timeoutMs ?? 1500;
|
|
31
|
+
const now = deps.now ?? Date.now;
|
|
32
|
+
const presenceEvery = deps.presenceMinIntervalMs ?? 3e4;
|
|
33
|
+
const state = { projectId: null, prefixSent: false, cursor: 0, injectedVersion: null };
|
|
34
|
+
const titles = /* @__PURE__ */ new Map();
|
|
35
|
+
let lastPresenceAt = 0;
|
|
36
|
+
let lastPresenceVersion = null;
|
|
37
|
+
const label = (id) => titles.get(id) ?? id.slice(0, 8);
|
|
38
|
+
function withTimeout(p) {
|
|
39
|
+
return Promise.race([p, new Promise((_, reject) => setTimeout(() => reject(new Error("project injection timeout")), timeoutMs).unref?.())]);
|
|
40
|
+
}
|
|
41
|
+
function reportPresence(force) {
|
|
42
|
+
const sid = deps.sessionId();
|
|
43
|
+
const meta = deps.metadata?.() ?? null;
|
|
44
|
+
const machineId = typeof meta?.machineId === "string" ? meta.machineId : null;
|
|
45
|
+
if (!sid || !machineId || !state.projectId) return;
|
|
46
|
+
const t = now();
|
|
47
|
+
if (!force && state.injectedVersion === lastPresenceVersion && t - lastPresenceAt < presenceEvery) return;
|
|
48
|
+
lastPresenceAt = t;
|
|
49
|
+
lastPresenceVersion = state.injectedVersion;
|
|
50
|
+
const entry = {
|
|
51
|
+
sessionId: sid,
|
|
52
|
+
agent: deps.agent,
|
|
53
|
+
state: "running",
|
|
54
|
+
injectedInstructionsVersion: state.injectedVersion,
|
|
55
|
+
...typeof meta?.summary?.text === "string" ? { title: String(meta.summary.text).slice(0, 200) } : {},
|
|
56
|
+
...typeof meta?.board?.progress === "string" ? { doing: String(meta.board.progress).slice(0, 200) } : {},
|
|
57
|
+
...typeof meta?.worktree?.branch === "string" ? { branch: String(meta.worktree.branch).slice(0, 200) } : {},
|
|
58
|
+
...typeof meta?.host === "string" ? { machine: String(meta.host).slice(0, 200) } : {},
|
|
59
|
+
...Array.isArray(meta?.capabilities) ? { capabilities: meta.capabilities.filter((c) => typeof c === "string").slice(0, 32) } : {}
|
|
60
|
+
};
|
|
61
|
+
void deps.client.presence(machineId, [entry]).catch((error) => logger.debug(`[projects] presence write skipped: ${String(error)}`));
|
|
62
|
+
}
|
|
63
|
+
function markDelivered(sid, ids) {
|
|
64
|
+
if (ids.length) void deps.client.delivered(sid, ids).catch((error) => logger.debug(`[projects] delivered ack skipped: ${String(error)}`));
|
|
65
|
+
}
|
|
66
|
+
async function firstTurn(sid, message) {
|
|
67
|
+
const ctx = await withTimeout(deps.client.context(sid, {}, timeoutMs));
|
|
68
|
+
for (const s of ctx.sessions) if (s.title) titles.set(s.sessionId, s.title);
|
|
69
|
+
const built = buildFirstTurnPrefix(ctx, { label });
|
|
70
|
+
if (!built || !ctx.project) {
|
|
71
|
+
state.projectId = null;
|
|
72
|
+
return message;
|
|
73
|
+
}
|
|
74
|
+
state.projectId = ctx.project.id;
|
|
75
|
+
state.prefixSent = true;
|
|
76
|
+
state.cursor = ctx.asOf;
|
|
77
|
+
state.injectedVersion = built.instructionsVersion;
|
|
78
|
+
markDelivered(sid, ctx.unread.map((u) => u.id));
|
|
79
|
+
reportPresence(true);
|
|
80
|
+
return prependToMessage(message, built.prefix);
|
|
81
|
+
}
|
|
82
|
+
async function laterTurn(sid, message) {
|
|
83
|
+
const d = await withTimeout(deps.client.digest(sid, state.cursor, timeoutMs));
|
|
84
|
+
if (!d.projectId) {
|
|
85
|
+
state.projectId = null;
|
|
86
|
+
state.prefixSent = false;
|
|
87
|
+
state.injectedVersion = null;
|
|
88
|
+
return message;
|
|
89
|
+
}
|
|
90
|
+
if (d.projectId !== state.projectId) {
|
|
91
|
+
state.prefixSent = false;
|
|
92
|
+
return firstTurn(sid, message);
|
|
93
|
+
}
|
|
94
|
+
state.cursor = d.asOf;
|
|
95
|
+
if (d.instructions) state.injectedVersion = d.instructions.version;
|
|
96
|
+
markDelivered(sid, d.messages.map((m) => m.id));
|
|
97
|
+
reportPresence(!!d.instructions);
|
|
98
|
+
return prependToMessage(message, buildDigestLine(d, { label }));
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
state: () => ({ ...state }),
|
|
102
|
+
/** A fresh agent with no memory of earlier turns (ACP backend restart, new Claude conversation) needs P again. */
|
|
103
|
+
reset() {
|
|
104
|
+
state.prefixSent = false;
|
|
105
|
+
state.cursor = 0;
|
|
106
|
+
},
|
|
107
|
+
async decorate(message) {
|
|
108
|
+
if (typeof message !== "string") return message;
|
|
109
|
+
const sid = deps.sessionId();
|
|
110
|
+
if (!sid || deps.client.isDisabled()) return message;
|
|
111
|
+
try {
|
|
112
|
+
const out = state.prefixSent ? await laterTurn(sid, message) : await firstTurn(sid, message);
|
|
113
|
+
return out;
|
|
114
|
+
} catch (error) {
|
|
115
|
+
if (!(error instanceof ProjectsUnsupportedError)) logger.debug(`[projects] injection skipped: ${String(error)}`);
|
|
116
|
+
return message;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
24
122
|
const TEAMS_ADOPT_CAPABILITY = "teams-adopt-v1";
|
|
25
123
|
const TeamAdoptSchema = z.object({
|
|
26
124
|
requestId: z.string().min(1).max(128),
|
|
@@ -128,6 +226,41 @@ This session is now connected as the team lead. Call team_inspect to read the au
|
|
|
128
226
|
};
|
|
129
227
|
}
|
|
130
228
|
|
|
229
|
+
const REQUEST_HUMAN_TOOL_NAME = "request_human";
|
|
230
|
+
const REQUEST_HUMAN_REASON_MAX = 200;
|
|
231
|
+
const REQUEST_HUMAN_DEDUPE_MS = 6e4;
|
|
232
|
+
const REQUEST_HUMAN_TOOL_DESCRIPTION = "Ask the user to step in when you cannot continue on your own: a captcha, 2FA code, QR scan, OAuth consent page, or a decision only they can make. Sends a push notification and marks the task board as blocked. Give a short reason (no secrets; the server can read it). If this machine declares a web panel showing what you are working in (e.g. a remote desktop or browser dashboard), pass its id as `panel` so the notification opens it. Afterwards, poll for your own completion condition (the page changed, the element disappeared) instead of waiting for a reply.";
|
|
233
|
+
function createRequestHuman(deps) {
|
|
234
|
+
const now = deps.now ?? Date.now;
|
|
235
|
+
let last = null;
|
|
236
|
+
return async (rawReason, panel) => {
|
|
237
|
+
const reason = rawReason.replace(/\s+/g, " ").trim().slice(0, REQUEST_HUMAN_REASON_MAX);
|
|
238
|
+
if (!reason) return { notified: false, error: "reason must be a non-empty string" };
|
|
239
|
+
await deps.reportBlocked(reason);
|
|
240
|
+
const at = now();
|
|
241
|
+
if (last && last.reason === reason && at - last.at < REQUEST_HUMAN_DEDUPE_MS) {
|
|
242
|
+
return { notified: true, deduped: true };
|
|
243
|
+
}
|
|
244
|
+
let url = `/session/${encodeURIComponent(deps.sessionId)}`;
|
|
245
|
+
let unknownPanel;
|
|
246
|
+
if (panel) {
|
|
247
|
+
const machineId = deps.machineId();
|
|
248
|
+
const { panels } = normalizeWebPanels(await deps.readPanels().catch(() => void 0));
|
|
249
|
+
if (machineId && panels.some((p) => p.id === panel)) url = webPanelPath(machineId, panel);
|
|
250
|
+
else unknownPanel = panel;
|
|
251
|
+
}
|
|
252
|
+
const sent = await deps.sendAttention({ sessionId: deps.sessionId, reason, url });
|
|
253
|
+
if (sent.sent) last = { reason, at };
|
|
254
|
+
return { notified: sent.sent, url, ...unknownPanel ? { unknownPanel } : {}, ...sent.error ? { error: sent.error } : {} };
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function requestHumanResultText(r) {
|
|
258
|
+
if (r.deduped) return "Already asked for this in the last minute; the board still shows it. Keep polling your completion condition.";
|
|
259
|
+
if (!r.notified) return `Could not notify the user: ${r.error ?? "unknown error"}. The task board is marked blocked.`;
|
|
260
|
+
const panelNote = r.unknownPanel ? ` (panel "${r.unknownPanel}" is not declared on this machine, so the notification opens the session instead)` : "";
|
|
261
|
+
return `Notified the user${panelNote}. This does not mean they have seen it. Poll your own completion condition (URL changed, element gone) instead of waiting for a reply.`;
|
|
262
|
+
}
|
|
263
|
+
|
|
131
264
|
function createMcpServer(handlers, options, sessionId, client) {
|
|
132
265
|
const mcp = new McpServer({
|
|
133
266
|
name: "Very Happy Tools",
|
|
@@ -136,6 +269,7 @@ function createMcpServer(handlers, options, sessionId, client) {
|
|
|
136
269
|
registerTeamsTools(mcp, sessionId);
|
|
137
270
|
registerAutomationTools(mcp);
|
|
138
271
|
if (client) registerSessionPeerTools(mcp, createSessionPeerToolExecutor(client));
|
|
272
|
+
if (client) registerProjectTools(mcp, createProjectToolExecutor(() => client.sessionId));
|
|
139
273
|
mcp.registerTool("change_title", {
|
|
140
274
|
description: "Change the title of the current chat session",
|
|
141
275
|
title: "Change Chat Title",
|
|
@@ -222,6 +356,18 @@ function createMcpServer(handlers, options, sessionId, client) {
|
|
|
222
356
|
isError: true
|
|
223
357
|
};
|
|
224
358
|
});
|
|
359
|
+
mcp.registerTool(REQUEST_HUMAN_TOOL_NAME, {
|
|
360
|
+
description: REQUEST_HUMAN_TOOL_DESCRIPTION,
|
|
361
|
+
title: "Ask the user to step in",
|
|
362
|
+
inputSchema: {
|
|
363
|
+
reason: z.string().describe("What you need from the user, one short line (no secrets)"),
|
|
364
|
+
panel: z.string().optional().describe("Id of this machine's web panel that shows what you are working in (from ~/.happy/settings.json webPanels)")
|
|
365
|
+
}
|
|
366
|
+
}, async (args) => {
|
|
367
|
+
const response = await handlers.requestHuman(String(args.reason ?? ""), args.panel);
|
|
368
|
+
logger.debug("[happyMCP] request_human response:", response);
|
|
369
|
+
return { content: [{ type: "text", text: requestHumanResultText(response) }], isError: response.error === "reason must be a non-empty string" };
|
|
370
|
+
});
|
|
225
371
|
registerReportProgressTool(mcp, async (args) => {
|
|
226
372
|
const response = await handlers.reportProgress(String(args.progress ?? ""), normalizeAttention(args.attention), normalizePhase(args.phase));
|
|
227
373
|
logger.debug("[happyMCP] report_progress response:", response);
|
|
@@ -319,10 +465,66 @@ async function startHappyServer(client, options) {
|
|
|
319
465
|
} catch (error) {
|
|
320
466
|
return { delivered: false, truncated: false, totalBytes: 0, error: String(error) };
|
|
321
467
|
}
|
|
322
|
-
}
|
|
468
|
+
},
|
|
469
|
+
requestHuman: createRequestHuman({
|
|
470
|
+
sessionId: client.sessionId,
|
|
471
|
+
machineId: () => client.getMetadata()?.machineId,
|
|
472
|
+
readPanels: async () => (await readSettings()).webPanels,
|
|
473
|
+
// Same board write (and attention-change throttle bypass) as report_progress.
|
|
474
|
+
reportBlocked: (reason) => handlers.reportProgress(reason, "blocked"),
|
|
475
|
+
sendAttention: (input) => options?.push ? options.push.sendAttention({ ...input, sessionTitle: getSessionNotificationBody(client.getMetadata()) }) : Promise.resolve({ sent: false, error: "push is not available in this runner" })
|
|
476
|
+
})
|
|
323
477
|
};
|
|
324
478
|
const contextPath = "/runtime-context/" + randomUUID();
|
|
479
|
+
const steerPath = "/runtime-steer/" + randomUUID();
|
|
325
480
|
const server = createServer(async (req, res) => {
|
|
481
|
+
if (req.url?.startsWith("/runtime-steer/")) {
|
|
482
|
+
const steer = options?.piSteer;
|
|
483
|
+
if (!steer || req.headers.origin) {
|
|
484
|
+
res.writeHead(403).end();
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
if (req.method === "GET" && req.url === steerPath) {
|
|
488
|
+
const gone = new AbortController();
|
|
489
|
+
res.on("close", () => gone.abort());
|
|
490
|
+
const item = await steer.take(25e3, gone.signal);
|
|
491
|
+
if (res.writableEnded || gone.signal.aborted) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
if (!item) {
|
|
495
|
+
res.writeHead(204).end();
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
res.writeHead(200, { "content-type": "application/json" }).end(JSON.stringify(item));
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
if (req.method === "POST" && (req.url === steerPath + "/hello" || req.url === steerPath + "/ack")) {
|
|
502
|
+
let body = "";
|
|
503
|
+
for await (const chunk of req) {
|
|
504
|
+
body += chunk.toString();
|
|
505
|
+
if (Buffer.byteLength(body) > 1024) {
|
|
506
|
+
res.writeHead(413).end();
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (req.url.endsWith("/hello")) {
|
|
511
|
+
steer.hello();
|
|
512
|
+
res.writeHead(204).end();
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
try {
|
|
516
|
+
const ack = JSON.parse(body);
|
|
517
|
+
if (typeof ack.id !== "number") throw new Error("id");
|
|
518
|
+
steer.ack(ack.id, ack.delivered === true);
|
|
519
|
+
res.writeHead(204).end();
|
|
520
|
+
} catch {
|
|
521
|
+
res.writeHead(400).end();
|
|
522
|
+
}
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
res.writeHead(403).end();
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
326
528
|
if (req.url?.startsWith("/runtime-context/")) {
|
|
327
529
|
if (!options?.onContextUsage || req.url !== contextPath || req.method !== "POST" || req.headers.origin) {
|
|
328
530
|
res.writeHead(403).end();
|
|
@@ -379,14 +581,17 @@ async function startHappyServer(client, options) {
|
|
|
379
581
|
return {
|
|
380
582
|
url: baseUrl.toString(),
|
|
381
583
|
contextUsageUrl: options?.onContextUsage ? new URL(contextPath, baseUrl).toString() : void 0,
|
|
584
|
+
steerUrl: options?.piSteer ? new URL(steerPath, baseUrl).toString() : void 0,
|
|
382
585
|
toolNames: [
|
|
383
586
|
"change_title",
|
|
384
587
|
CLIPBOARD_TOOL_NAME,
|
|
385
588
|
PREVIEW_TOOL_NAME,
|
|
386
589
|
REPORT_PROGRESS_TOOL_NAME,
|
|
590
|
+
REQUEST_HUMAN_TOOL_NAME,
|
|
387
591
|
...TEAM_TOOL_NAMES,
|
|
388
592
|
...AUTOMATION_TOOL_NAMES,
|
|
389
593
|
...SESSION_PEER_TOOL_NAMES,
|
|
594
|
+
...PROJECT_TOOL_NAMES,
|
|
390
595
|
...options?.assistant && !process.env.VH_TEAM_SCOPE_FILE ? ASSISTANT_TOOL_NAMES : []
|
|
391
596
|
],
|
|
392
597
|
stop: () => {
|
|
@@ -483,4 +688,4 @@ function hashObject(obj, options, encoding = "hex") {
|
|
|
483
688
|
return createHash("sha256").update(jsonString).digest(encoding);
|
|
484
689
|
}
|
|
485
690
|
|
|
486
|
-
export { hashObject as h, startHappyServer as s };
|
|
691
|
+
export { createProjectInjector as c, hashObject as h, startHappyServer as s };
|