very-happy-cli 0.2.185 → 0.2.187
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-CCqL9mP1.cjs → AcpBackend-B2-ReWTo.cjs} +3 -3
- package/dist/{AcpBackend-DkoqWhTa.mjs → AcpBackend-C4Emg-H3.mjs} +3 -3
- package/dist/{AcpSessionManager-DrtAJQUH.cjs → AcpSessionManager-DR4-oZCz.cjs} +2 -2
- package/dist/{AcpSessionManager-BNPex8tJ.mjs → AcpSessionManager-Nard_zFS.mjs} +2 -2
- package/dist/{BasePermissionHandler-Dd4oGPDg.mjs → BasePermissionHandler-Bk9DmVZH.mjs} +1 -1
- package/dist/{BasePermissionHandler-DJZITwmL.cjs → BasePermissionHandler-CZ19WzsP.cjs} +1 -1
- package/dist/{acpSessionResume-_2NtETqb.mjs → acpSessionResume-DPSfMe7r.mjs} +1 -1
- package/dist/{acpSessionResume-umHzSMbQ.cjs → acpSessionResume-Hto_b8MK.cjs} +1 -1
- package/dist/{agentHome-Dv_hRIt7.mjs → agentHome-4-odnrAk.mjs} +4 -4
- package/dist/{agentHome-CmIMqMWy.cjs → agentHome-Mveyfa24.cjs} +4 -4
- package/dist/{api-BSz8MYte.cjs → api-DVEzYcoy.cjs} +10 -10
- package/dist/{api-BTS8mqLy.mjs → api-cVvbFZVK.mjs} +10 -10
- package/dist/{apiMachine-utCDabnO.cjs → apiMachine-Bd1C_JN6.cjs} +14 -14
- package/dist/{apiMachine-BcjccOmd.mjs → apiMachine-M7qY1izH.mjs} +14 -14
- package/dist/{attachmentContent-hkdGP2NV.cjs → attachmentContent-D8hViGiA.cjs} +2 -2
- package/dist/{attachmentContent-DpOzgDTw.mjs → attachmentContent-NNF-Eo4O.mjs} +2 -2
- package/dist/{auth-BKD2U9S2.mjs → auth-BCHL8Fx5.mjs} +5 -5
- package/dist/{auth-DzXdF08E.cjs → auth-BHw8be0X.cjs} +8 -8
- package/dist/{auth-CpbTj74y.mjs → auth-CKNEKwEV.mjs} +8 -8
- package/dist/{auth-B8nCUEiK.cjs → auth-b_1h0677.cjs} +5 -5
- package/dist/{auto-C-NK2JS8.mjs → auto-D716QYa3.mjs} +19 -19
- package/dist/{auto-E3ouHO37.cjs → auto-Da4rCLal.cjs} +19 -19
- package/dist/{bootstrap-DV4dqeCe.mjs → bootstrap-CndcegDb.mjs} +2 -2
- package/dist/{bootstrap-DIMkxIbR.cjs → bootstrap-j2RuoHVy.cjs} +2 -2
- package/dist/{browser-C0xt1NE-.mjs → browser-CLsM513o.mjs} +1 -1
- package/dist/{browser-Ch50ZchJ.cjs → browser-DIYTnD_T.cjs} +1 -1
- package/dist/{claudeLocal-D-U3fIdS.mjs → claudeLocal-3HbTx7K-.mjs} +7 -6
- package/dist/{claudeLocal-Curd8-dn.cjs → claudeLocal-C_uUbEO_.cjs} +9 -8
- package/dist/{claudeLocalLauncher-BEJ9Wad_.cjs → claudeLocalLauncher-BxWouVYk.cjs} +11 -11
- package/dist/{claudeLocalLauncher-BTNUVzRK.mjs → claudeLocalLauncher-DXh2chq3.mjs} +11 -11
- package/dist/{claudeSessionFork-JPEHVbfR.mjs → claudeSessionFork-B4olbwfj.mjs} +1 -1
- package/dist/{claudeSessionFork-DMdeScGk.cjs → claudeSessionFork-CsU96yXX.cjs} +1 -1
- package/dist/{client-D2lOnvzs.mjs → client-C8w9aQYe.mjs} +2 -2
- package/dist/{client-dpo5EbS9.cjs → client-CCy72Phz.cjs} +14 -5
- package/dist/{client-qgKef7S6.cjs → client-CWSfPlGD.cjs} +2 -2
- package/dist/{client-D1rJt15-.mjs → client-D8p1YjVt.mjs} +14 -5
- package/dist/{client-Ct1rnpJw.mjs → client-Zqg7DXHl.mjs} +2 -2
- package/dist/{client-C54hMWx6.cjs → client-q1aNOKgy.cjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +18 -17
- package/dist/codex/happyMcpStdioBridge.mjs +18 -17
- package/dist/{codexAppServerClient-CM3O0zHW.mjs → codexAppServerClient-Csc-XsRV.mjs} +3 -3
- package/dist/{codexAppServerClient-DGeqZViU.cjs → codexAppServerClient-g8npaIU9.cjs} +3 -3
- package/dist/{codexCommand-CkdopWS7.mjs → codexCommand-BS-foS_R.mjs} +43 -43
- package/dist/{codexCommand-D_8fbJEk.cjs → codexCommand-BV8pTAtv.cjs} +43 -43
- package/dist/{codexTermination-MG2j2DDX.cjs → codexTermination-B5WgZAWO.cjs} +1 -1
- package/dist/{codexTermination-FO52Ahcx.mjs → codexTermination-lOO15mt2.mjs} +1 -1
- package/dist/{config-IDbpY1Am.cjs → config-BOnZRJIG.cjs} +3 -3
- package/dist/{config-CppOKnWe.mjs → config-Ba5ufl-D.mjs} +3 -3
- package/dist/{configuration-HPdj5Til.mjs → configuration-8EAa2X9P.mjs} +1 -1
- package/dist/{configuration-CwfmwaLU.cjs → configuration-CAfdO4IC.cjs} +1 -1
- package/dist/{connect-BNlBIAM8.cjs → connect-2hWuvxRM.cjs} +13 -13
- package/dist/{connect-1YK7vPbW.mjs → connect-BHWHNe54.mjs} +13 -13
- package/dist/{context-DetK5c-x.mjs → context-B-jybQhf.mjs} +1 -1
- package/dist/{context-D3vDWjiI.cjs → context-BtCz06PX.cjs} +1 -1
- package/dist/{controlClient-DBylxaEh.mjs → controlClient-O-vf2MkJ.mjs} +3 -3
- package/dist/{controlClient-DTMI1aTp.cjs → controlClient-mH9AxBwT.cjs} +3 -3
- package/dist/{createSessionMetadata-D2Ll7PlQ.cjs → createSessionMetadata-Bcn7b8QB.cjs} +2 -2
- package/dist/{createSessionMetadata-D8pfpX4V.mjs → createSessionMetadata-HlzlfP0U.mjs} +2 -2
- package/dist/{daemonSupervisor-DfzrtNhM.mjs → daemonSupervisor-BxohggqN.mjs} +40 -1
- package/dist/{daemonSupervisor-57JYYzMf.cjs → daemonSupervisor-alqGPANc.cjs} +43 -1
- package/dist/{defaultPermissionMode-DVXkcryy.cjs → defaultPermissionMode-BN3PdltF.cjs} +2 -2
- package/dist/{defaultPermissionMode-Bkhj_DwT.mjs → defaultPermissionMode-BPDeX4S8.mjs} +2 -2
- package/dist/{deterministicJson-cEWItQun.mjs → deterministicJson-CruOxFA6.mjs} +14 -14
- package/dist/{deterministicJson-DUCYjhHe.cjs → deterministicJson-D9pZQhU9.cjs} +14 -14
- package/dist/{doctor-DpWtxNeT.mjs → doctor-BNhLBBTK.mjs} +7 -7
- package/dist/{doctor-tLRILlmz.cjs → doctor-lHD1YZH6.cjs} +7 -7
- package/dist/{downloadTarget-Ci5wcYC2.cjs → downloadTarget-BhkQxTa8.cjs} +6 -6
- package/dist/{downloadTarget-B5b5BHb2.mjs → downloadTarget-ByTxs_N5.mjs} +6 -6
- package/dist/{ensureDaemonRunning-Dsv8UPwx.cjs → ensureDaemonRunning-BiCK6RiS.cjs} +5 -5
- package/dist/{ensureDaemonRunning-GDGwNDGF.mjs → ensureDaemonRunning-Cv0AMaHK.mjs} +5 -5
- package/dist/{handleResumeCommand-DW7Ml1u5.mjs → handleResumeCommand-Cy_KW0LN.mjs} +5 -5
- package/dist/{handleResumeCommand-CncudrQd.cjs → handleResumeCommand-WB4VDeKk.cjs} +5 -5
- package/dist/{index-BEHzEYP0.cjs → index-B44ft-m4.cjs} +40 -40
- package/dist/{index-DisBaRvM.mjs → index-B9f1vKcC.mjs} +96 -0
- package/dist/{index-Dzb_Bsfu.cjs → index-Bcp-PEGc.cjs} +4 -4
- package/dist/{index-DRWlaLbe.mjs → index-BpSpw6jG.mjs} +3 -3
- package/dist/{index-Bh806Q-1.cjs → index-BpWESchl.cjs} +3 -3
- package/dist/{index-Ub-5xbcU.cjs → index-BumVulwx.cjs} +96 -0
- package/dist/{index-bT1X9Brv.mjs → index-CVMbboXv.mjs} +7 -7
- package/dist/{index-C1qLnBOk.mjs → index-CdOz1uDl.mjs} +41 -41
- package/dist/{index-Vx4EQ6wI.cjs → index-Vtcax4oD.cjs} +7 -7
- package/dist/{index-Wf6mKJq9.mjs → index-lWXWV0H2.mjs} +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-F3rP8tBU.mjs → install-B8O1JpJH.mjs} +1 -1
- package/dist/{install-BATFlr_l.cjs → install-BOHlqewf.cjs} +1 -1
- package/dist/{install-CRs4tGBa.cjs → install-DdRVv9IS.cjs} +3 -3
- package/dist/{install-DmF9wfwV.mjs → install-mK93DJ6L.mjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-CG9jFcML.mjs → lidState-LtdUCXi-.mjs} +1 -1
- package/dist/{lidState-wwiu6M3p.cjs → lidState-XyjQaZtU.cjs} +1 -1
- package/dist/{localHappyAgentAuth-UoytSUX0.cjs → localHappyAgentAuth-C9Aj_wGD.cjs} +1 -1
- package/dist/{localHappyAgentAuth-CWha8BiX.mjs → localHappyAgentAuth-DqFE0Adr.mjs} +1 -1
- package/dist/{logger-CIUMiSLo.cjs → logger-BILSzq2s.cjs} +2 -2
- package/dist/{logger-BjXkscIr.mjs → logger-SAU4uSs4.mjs} +2 -2
- package/dist/{machineMetadata-BPlyxzxb.cjs → machineMetadata-C5TgUTpD.cjs} +3 -3
- package/dist/{machineMetadata-Ca4Dpy6s.mjs → machineMetadata-ZVnihOuL.mjs} +3 -3
- package/dist/{main-CS1U9i4s.mjs → main-BjOHtX8u.mjs} +47 -47
- package/dist/{main-FD8mmcsK.cjs → main-CVfx_-l7.cjs} +47 -47
- package/dist/{mcp-C7Rm1dTM.cjs → mcp-By9XK193.cjs} +15 -15
- package/dist/{mcp-BS6rdR8p.mjs → mcp-CWVr7KbQ.mjs} +15 -15
- package/dist/{mirrorProtocol-C3Anki4S.mjs → mirrorProtocol-BI6XbokT.mjs} +3 -3
- package/dist/{mirrorProtocol-CMJ2HOZF.cjs → mirrorProtocol-C0wyaesn.cjs} +3 -3
- package/dist/{package-Do0Y9bGA.mjs → package-BMBwnCn3.mjs} +10 -10
- package/dist/{package-CRDjc5vK.cjs → package-Bbfq2KR7.cjs} +10 -10
- package/dist/{panels-C-jss7nF.mjs → panels-CbIUwV6q.mjs} +5 -5
- package/dist/{panels-DwTHrZuo.cjs → panels-rQmysHlY.cjs} +5 -5
- package/dist/{peerTools-SLRntgX6.cjs → peerTools-CZfiq_Dx.cjs} +5 -5
- package/dist/{peerTools-CL7zBxlC.mjs → peerTools-CyruQrOo.mjs} +5 -5
- package/dist/{persistence-CmVwM5uq.mjs → persistence-C7T3HYjq.mjs} +2 -2
- package/dist/{persistence-CNWBdUH2.cjs → persistence-DPeSC0SK.cjs} +2 -2
- package/dist/{piRunnerArgs-K0K9Y0Yq.mjs → piRunnerArgs-CsWompo8.mjs} +1 -1
- package/dist/{piRunnerArgs-CXJx3PPx.cjs → piRunnerArgs-DAq8vIpP.cjs} +1 -1
- package/dist/{piRuntime-Bv41vG05.cjs → piRuntime-CFqlQFoz.cjs} +2 -2
- package/dist/{piRuntime-BSoHy-QJ.mjs → piRuntime-Dxd8Gfun.mjs} +2 -2
- package/dist/{piTerminal-B8acGxsm.mjs → piTerminal-BssuKDtJ.mjs} +18 -18
- package/dist/{piTerminal-DSs-fnps.cjs → piTerminal-DHG3Kzve.cjs} +18 -18
- package/dist/promptCacheTtl-B8PCzE6k.cjs +76 -0
- package/dist/promptCacheTtl-Ce0TVbrx.mjs +72 -0
- package/dist/{pushNotifications-DnpJJ7VR.mjs → pushNotifications-Bi72c41d.mjs} +3 -3
- package/dist/{pushNotifications-C651e0ZZ.cjs → pushNotifications-CsSyhnHu.cjs} +3 -3
- package/dist/{query-rxLftxvh.mjs → query-BQOwsKS1.mjs} +3 -2
- package/dist/{query-DXFx2VZY.cjs → query-Cuef299f.cjs} +5 -4
- package/dist/{rateLimitWindows-D9mQRGHv.mjs → rateLimitWindows-B6IAWYN5.mjs} +1 -1
- package/dist/{rateLimitWindows-1WoBs8ln.cjs → rateLimitWindows-bfwC81Z-.cjs} +1 -1
- package/dist/{registerCommonHandlers-K-BTp2iR.cjs → registerCommonHandlers-CQC04iF3.cjs} +2 -2
- package/dist/{registerCommonHandlers-DpBxSCBi.mjs → registerCommonHandlers-qzb6TQqo.mjs} +2 -2
- package/dist/{registerKillSessionHandler-DwPEAS2G.cjs → registerKillSessionHandler-BraKB5Ks.cjs} +6 -6
- package/dist/{registerKillSessionHandler-BDxd20fg.mjs → registerKillSessionHandler-DMPrrNKX.mjs} +6 -6
- package/dist/{remoteSessionClient-DHWfDMHA.mjs → remoteSessionClient-D3XhN_sd.mjs} +5 -5
- package/dist/{remoteSessionClient-DnFblfFz.cjs → remoteSessionClient-DffolBcQ.cjs} +5 -5
- package/dist/{reportProgressTool-CYgnezAO.cjs → reportProgressTool-BieTXE_R.cjs} +3 -3
- package/dist/{reportProgressTool-DJXfK6rp.mjs → reportProgressTool-irHR-XEW.mjs} +3 -3
- package/dist/{resources-CqwHPhdK.cjs → resources-BZ_Be0qM.cjs} +1 -1
- package/dist/{resources-CLdQfe3b.mjs → resources-CLP_MpK4.mjs} +1 -1
- package/dist/{run-BChqUxs6.cjs → run-Ck_WA6Nj.cjs} +218 -46
- package/dist/{run-BkixRBWm.mjs → run-DCUaxe2S.mjs} +221 -49
- package/dist/{runClaude-Bdw9vTgv.cjs → runClaude-BUGku2Qp.cjs} +22 -22
- package/dist/{runClaude-FWTCLnVq.mjs → runClaude-BryAvfNV.mjs} +22 -22
- package/dist/{runClaudeDeps-C6mCzhtO.mjs → runClaudeDeps-BZkWM9_u.mjs} +45 -45
- package/dist/{runClaudeDeps-CN_moqup.cjs → runClaudeDeps-Dbk1VrOW.cjs} +40 -40
- package/dist/{runGemini-CzPwEltY.cjs → runGemini-B6AZ2bv0.cjs} +34 -34
- package/dist/{runGemini-CI7ut_ng.mjs → runGemini-DT379gpi.mjs} +34 -34
- package/dist/{runOpenClaw-8V2K_-lg.mjs → runOpenClaw-Bpp9mkyO.mjs} +18 -18
- package/dist/{runOpenClaw-CLw64Nmq.cjs → runOpenClaw-eBUYlIVJ.cjs} +18 -18
- package/dist/{sandbox-DD2oQTt3.cjs → sandbox-Bv4H1P6u.cjs} +4 -4
- package/dist/{sandbox-BMkBdvHW.mjs → sandbox-Z8TM9eUg.mjs} +4 -4
- package/dist/{selfCheck-0jELpLE9.cjs → selfCheck--1k2Ptf6.cjs} +37 -37
- package/dist/selfCheck-DIGghfQz.mjs +86 -0
- package/dist/{send-BoLglO1t.cjs → send-BG4KYe6f.cjs} +8 -8
- package/dist/{send-BNjwFaVp.mjs → send-CKTovWuQ.mjs} +8 -8
- package/dist/{server-Uw82k7zD.cjs → server-BTNwH-sA.cjs} +6 -6
- package/dist/{server-C5wOp8jw.mjs → server-DLpXtoiZ.mjs} +4 -4
- package/dist/{sessionLock-BTo7Cdbi.cjs → sessionLock-Cf6RlgfF.cjs} +3 -3
- package/dist/{sessionLock-YMRCi-Ec.mjs → sessionLock-DhzB5ZI9.mjs} +3 -3
- package/dist/{sessionOps-BO6AesNJ.mjs → sessionOps-CiFjBCMa.mjs} +4 -4
- package/dist/{sessionOps-BDHEzyAY.cjs → sessionOps-R52JWMnX.cjs} +4 -4
- package/dist/{sessionProvider-DLdJJV6A.cjs → sessionProvider-LATn-lZL.cjs} +5 -5
- package/dist/{sessionProvider-CB9lGJdF.mjs → sessionProvider-f2tUhwBc.mjs} +5 -5
- package/dist/{sessionScanner-3TevonZd.cjs → sessionScanner-DRzZtGtu.cjs} +3 -3
- package/dist/{sessionScanner-BkukogZy.mjs → sessionScanner-lS1puA5H.mjs} +3 -3
- package/dist/{sessions-Bx-6fXTL.mjs → sessions-D01nnjOE.mjs} +10 -10
- package/dist/{sessions-BkBcZSj7.cjs → sessions-DGd8Fin6.cjs} +10 -10
- package/dist/{setupOfflineReconnection-DMfoVL-0.cjs → setupOfflineReconnection-Ds7ywGwR.cjs} +2 -2
- package/dist/{setupOfflineReconnection-DYzysFFJ.mjs → setupOfflineReconnection-UApZjcU5.mjs} +2 -2
- package/dist/{spawn-DvyBhowH.cjs → spawn-CT3g4p8A.cjs} +14 -14
- package/dist/{spawn-CHC32rLr.mjs → spawn-ct8aSMA8.mjs} +14 -14
- package/dist/{spawnAgents-D15n6tAj.cjs → spawnAgents-DsJSyLDl.cjs} +1 -1
- package/dist/{spawnAgents-jXo9jIYo.mjs → spawnAgents-f2q31uUV.mjs} +1 -1
- package/dist/{spawnHappyCLI-WYJCvAWD.cjs → spawnHappyCLI-DedrWByd.cjs} +1 -1
- package/dist/{spawnHappyCLI-e9MaJWB0.mjs → spawnHappyCLI-Dp05fHcp.mjs} +1 -1
- package/dist/{specialCommands-DqrQnKHC.cjs → specialCommands-35KxDNE8.cjs} +3 -3
- package/dist/{specialCommands-D00VrQ09.mjs → specialCommands-CTtmGCCf.mjs} +3 -3
- package/dist/{startFileWatcher-VFZ-Bpwa.cjs → startFileWatcher-72w11DP_.cjs} +1 -1
- package/dist/{startFileWatcher-CvUUesns.mjs → startFileWatcher-BLdxJdgu.mjs} +1 -1
- package/dist/{startupSessionCreate-B6HNLg0g.mjs → startupSessionCreate-CJFR_Zom.mjs} +1 -1
- package/dist/{startupSessionCreate-B25xTUJ4.cjs → startupSessionCreate-Cy4J4-Ep.cjs} +1 -1
- package/dist/{streamRelay-GzHxvMem.mjs → streamRelay-B3FloUTT.mjs} +1 -1
- package/dist/{streamRelay-CtTpf-Li.cjs → streamRelay-Cn_uGG6m.cjs} +1 -1
- package/dist/{sync-HPnxI4fz.mjs → sync-BWX1OVQi.mjs} +1 -1
- package/dist/{sync-DliZ1zZh.cjs → sync-lxDpbIh3.cjs} +1 -1
- package/dist/{systemPrompt-CYvRvanR.cjs → systemPrompt-0DqWPGY6.cjs} +2 -2
- package/dist/{systemPrompt-D9JJpzl_.mjs → systemPrompt-BIilbjt_.mjs} +2 -2
- package/dist/{teams-D7Ad6YSf.cjs → teams-CImmJLlM.cjs} +9 -9
- package/dist/{teams-C0PJlIMz.mjs → teams-CvpB8Rdm.mjs} +9 -9
- package/dist/{template-BLJxflCH.cjs → template-DPsqlHJQ.cjs} +1 -1
- package/dist/{template-YlpbYGeQ.mjs → template-DuKZw-Sz.mjs} +1 -1
- package/dist/{time-BCGGrWp4.cjs → time-BbQJi3Eh.cjs} +1 -1
- package/dist/{time-BbJ-NWcl.mjs → time-DjS5me2q.mjs} +1 -1
- package/dist/{titleGenerator-03Y2uoZW.mjs → titleGenerator-CGdBp5lQ.mjs} +1 -1
- package/dist/{titleGenerator-IrI84kqh.cjs → titleGenerator-CfJme6ep.cjs} +2 -2
- package/dist/{todo-DOh8KaxD.mjs → todo-BxfUKwTM.mjs} +6 -6
- package/dist/{todo-DdV9_uEu.cjs → todo-rN20m9lT.cjs} +6 -6
- package/dist/tools-B_W7xJNh.mjs +137 -0
- package/dist/tools-kGtSjG8h.cjs +140 -0
- package/dist/{uninstall-oGvAKOlN.cjs → uninstall-CBQsxEmD.cjs} +3 -3
- package/dist/{uninstall-BVYlC0jw.mjs → uninstall-DUjvgLlg.mjs} +3 -3
- package/package.json +10 -10
- package/dist/selfCheck-DgWZfw5E.mjs +0 -86
- package/dist/smallFastModel-BLNgMrwR.mjs +0 -18
- package/dist/smallFastModel-D_uxGMo3.cjs +0 -21
- package/dist/tools-DeoxWyQ0.cjs +0 -63
- package/dist/tools-WXF7ApAe.mjs +0 -60
|
@@ -30,7 +30,7 @@ You coordinate; members do the work. Follow these defaults unless the user says
|
|
|
30
30
|
3. Prevent conflicts. Before delegating, name the files or modules each task will touch. Give work on the same area to one member in sequence, or agree the boundary and who rebases onto whom before both start. Relay overlaps between members yourself. Merges are serialized and yours.
|
|
31
31
|
4. Keep the team context. When the user gives a new instruction, or you make a decision, assign work, accept or return a result, or agree a conflict rule, record it at once with mcp__happy__project_note (kind decision, finding or handoff) in the team's project. After a context compaction or restart, read mcp__happy__project_context (full=true) and team_inspect before acting. If it answers "not in a project", ask the user to link this team to a project on the team page.
|
|
32
32
|
5. Write complete task briefs. Each goal states the background with the user's own words, what to do, acceptance criteria, boundaries (no merging, releasing or touching production unless the user authorized it), and the evidence to hand back (tests, screenshots, CI).
|
|
33
|
-
6. Review before accepting. A submission is not completion: check its evidence before team_accept. With team_return, say exactly what is wrong and how to fix it. Have a different member re-review security-sensitive changes. An idle member is neither done nor stuck; run team_inspect before chasing it.
|
|
33
|
+
6. Review before accepting. A submission is not completion: check its evidence before team_accept. With team_return, say exactly what is wrong and how to fix it. Have a different member re-review security-sensitive changes. An idle member is neither done nor stuck; run team_inspect before chasing it. Submissions and member messages wake you as a new turn: end your turn and wait; never poll with sleep loops, which hold those notifications back.
|
|
34
34
|
7. Report through the briefing board. With the owner_board_* tools: every decision the user must make goes on the board (owner_board_post kind decision, 2-4 options, one recommended, a stable key), never repeated in chat or member replies; refresh it with owner_board_update. Answer what you can in the stream (it is attached for you); if it needs work, say who is on it, set owner_board_update state in_progress, then owner_board_post kind answer with reply_to. Post a report for milestones (accepted, merged, released, incident conclusion) and a todo for what only the user can do offline (request_human when it blocks you); not progress, idle members or review detail. One item per topic, at most 5 open. Without the board, report conclusion first, with only what they must decide or know. Set recipientBotId on every team_message; without it the message goes to the task's assignee.
|
|
35
35
|
8. Never create a team to recover. If a team tool says this session has no team or no team scope, do not call team_create or team_join: run team_inspect, or tell the user and wait.`;
|
|
36
36
|
const TEAM_MEMBER_RULES = `Before starting, read the team's project context with mcp__happy__project_context; it returns "not in a project" when the team has none. Do only what your task asks. If your work overlaps another member's or needs a wider scope, tell your lead with team_message (recipientBotId = the lead) before going further. Submit with evidence: commands and results, artifact paths, screenshots or CI links.`;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var mirrorProtocol = require('./mirrorProtocol-
|
|
3
|
+
var mirrorProtocol = require('./mirrorProtocol-C0wyaesn.cjs');
|
|
4
4
|
var fsMkdir = require('./fsMkdir-0K3yENml.cjs');
|
|
5
|
-
var piRunnerArgs = require('./piRunnerArgs-
|
|
5
|
+
var piRunnerArgs = require('./piRunnerArgs-DAq8vIpP.cjs');
|
|
6
6
|
var fs = require('fs/promises');
|
|
7
7
|
var os$1 = require('os');
|
|
8
8
|
var tmp = require('tmp');
|
|
9
9
|
var axios = require('axios');
|
|
10
10
|
var node_fs = require('node:fs');
|
|
11
11
|
var path = require('node:path');
|
|
12
|
-
var configuration = require('./configuration-
|
|
13
|
-
var api = require('./api-
|
|
14
|
-
var spawnAgents = require('./spawnAgents-
|
|
15
|
-
var logger = require('./logger-
|
|
16
|
-
var index$2 = require('./index-
|
|
17
|
-
var auth = require('./auth-
|
|
12
|
+
var configuration = require('./configuration-CAfdO4IC.cjs');
|
|
13
|
+
var api = require('./api-DVEzYcoy.cjs');
|
|
14
|
+
var spawnAgents = require('./spawnAgents-DsJSyLDl.cjs');
|
|
15
|
+
var logger = require('./logger-BILSzq2s.cjs');
|
|
16
|
+
var index$2 = require('./index-BpWESchl.cjs');
|
|
17
|
+
var auth = require('./auth-b_1h0677.cjs');
|
|
18
18
|
var child_process = require('child_process');
|
|
19
|
-
var _package = require('./package-
|
|
20
|
-
var doctor = require('./doctor-
|
|
21
|
-
var spawnHappyCLI = require('./spawnHappyCLI-
|
|
22
|
-
var persistence = require('./persistence-
|
|
23
|
-
var controlClient = require('./controlClient-
|
|
24
|
-
var sessionOps = require('./sessionOps-
|
|
19
|
+
var _package = require('./package-Bbfq2KR7.cjs');
|
|
20
|
+
var doctor = require('./doctor-lHD1YZH6.cjs');
|
|
21
|
+
var spawnHappyCLI = require('./spawnHappyCLI-DedrWByd.cjs');
|
|
22
|
+
var persistence = require('./persistence-DPeSC0SK.cjs');
|
|
23
|
+
var controlClient = require('./controlClient-mH9AxBwT.cjs');
|
|
24
|
+
var sessionOps = require('./sessionOps-R52JWMnX.cjs');
|
|
25
25
|
var fastify = require('fastify');
|
|
26
26
|
var z = require('zod');
|
|
27
27
|
var fastifyTypeProviderZod = require('fastify-type-provider-zod');
|
|
@@ -29,62 +29,62 @@ var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
|
29
29
|
var node_crypto = require('node:crypto');
|
|
30
30
|
var previewPath = require('./previewPath-B0rBdhy1.cjs');
|
|
31
31
|
var backgroundTaskActivity = require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
32
|
-
var rateLimitWindows = require('./rateLimitWindows-
|
|
33
|
-
var peerTools = require('./peerTools-
|
|
32
|
+
var rateLimitWindows = require('./rateLimitWindows-bfwC81Z-.cjs');
|
|
33
|
+
var peerTools = require('./peerTools-CZfiq_Dx.cjs');
|
|
34
34
|
var os = require('node:os');
|
|
35
|
-
var remoteSessionClient = require('./remoteSessionClient-
|
|
36
|
-
var bootstrap = require('./bootstrap-
|
|
37
|
-
var index$1 = require('./index-
|
|
35
|
+
var remoteSessionClient = require('./remoteSessionClient-DffolBcQ.cjs');
|
|
36
|
+
var bootstrap = require('./bootstrap-j2RuoHVy.cjs');
|
|
37
|
+
var index$1 = require('./index-Bcp-PEGc.cjs');
|
|
38
38
|
var require$$0 = require('fs');
|
|
39
39
|
var require$$1 = require('path');
|
|
40
40
|
var node_child_process = require('node:child_process');
|
|
41
41
|
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
42
42
|
var doctorReadiness = require('./doctorReadiness-Dl6yRQCy.cjs');
|
|
43
|
-
var machineMetadata = require('./machineMetadata-
|
|
43
|
+
var machineMetadata = require('./machineMetadata-C5TgUTpD.cjs');
|
|
44
44
|
var fileStore = require('./fileStore-7qhnbs6N.cjs');
|
|
45
45
|
var pi = require('./pi-DlsrPCTa.cjs');
|
|
46
46
|
var require$$3 = require('crypto');
|
|
47
47
|
var detectCLI = require('./detectCLI-BuYR_Qxe.cjs');
|
|
48
|
-
var handleResumeCommand = require('./handleResumeCommand-
|
|
48
|
+
var handleResumeCommand = require('./handleResumeCommand-WB4VDeKk.cjs');
|
|
49
49
|
var webPanels = require('./webPanels-FCgFKvVe.cjs');
|
|
50
|
-
var index = require('./index-
|
|
50
|
+
var index = require('./index-BumVulwx.cjs');
|
|
51
51
|
var promises = require('node:fs/promises');
|
|
52
52
|
var cliUpdate = require('./cliUpdate-DsKXPFYp.cjs');
|
|
53
|
-
var client = require('./client-
|
|
54
|
-
var client$1 = require('./client-
|
|
55
|
-
var daemonSupervisor = require('./daemonSupervisor-
|
|
53
|
+
var client = require('./client-q1aNOKgy.cjs');
|
|
54
|
+
var client$1 = require('./client-CWSfPlGD.cjs');
|
|
55
|
+
var daemonSupervisor = require('./daemonSupervisor-alqGPANc.cjs');
|
|
56
56
|
var path$1 = require('./path-B7zW-WwE.cjs');
|
|
57
57
|
var editPaths = require('./editPaths-Bqp4OFPw.cjs');
|
|
58
|
-
var startFileWatcher = require('./startFileWatcher-
|
|
59
|
-
var sync = require('./sync-
|
|
58
|
+
var startFileWatcher = require('./startFileWatcher-72w11DP_.cjs');
|
|
59
|
+
var sync = require('./sync-lxDpbIh3.cjs');
|
|
60
60
|
var types = require('./types-CRS-srZK.cjs');
|
|
61
61
|
var tmuxSocket = require('./tmuxSocket-D-Xt6Vn-.cjs');
|
|
62
|
-
var sessionLock = require('./sessionLock-
|
|
62
|
+
var sessionLock = require('./sessionLock-Cf6RlgfF.cjs');
|
|
63
63
|
var doctor$1 = require('./doctor-u46qYYKX.cjs');
|
|
64
|
-
var resources = require('./resources-
|
|
64
|
+
var resources = require('./resources-BZ_Be0qM.cjs');
|
|
65
65
|
var node_util = require('node:util');
|
|
66
|
-
var template = require('./template-
|
|
66
|
+
var template = require('./template-DPsqlHJQ.cjs');
|
|
67
67
|
var loginShellEnv = require('./loginShellEnv-BkuYtExZ.cjs');
|
|
68
|
-
require('./acpSessionResume-
|
|
69
|
-
require('./lidState-
|
|
68
|
+
require('./acpSessionResume-Hto_b8MK.cjs');
|
|
69
|
+
require('./lidState-XyjQaZtU.cjs');
|
|
70
70
|
require('node:events');
|
|
71
71
|
require('socket.io-client');
|
|
72
|
-
require('./pushNotifications-
|
|
72
|
+
require('./pushNotifications-CsSyhnHu.cjs');
|
|
73
73
|
require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
74
74
|
require('./limits-C-a7gr04.cjs');
|
|
75
|
-
require('./time-
|
|
76
|
-
require('./registerCommonHandlers-
|
|
75
|
+
require('./time-BbQJi3Eh.cjs');
|
|
76
|
+
require('./registerCommonHandlers-CQC04iF3.cjs');
|
|
77
77
|
require('util');
|
|
78
78
|
require('cross-spawn');
|
|
79
79
|
require('@paralleldrive/cuid2');
|
|
80
80
|
require('chalk');
|
|
81
81
|
require('node:module');
|
|
82
82
|
require('tweetnacl');
|
|
83
|
-
require('./browser-
|
|
83
|
+
require('./browser-DIYTnD_T.cjs');
|
|
84
84
|
require('open');
|
|
85
85
|
require('./ids-B6ZC0HGt.cjs');
|
|
86
86
|
require('url');
|
|
87
|
-
require('./localHappyAgentAuth-
|
|
87
|
+
require('./localHappyAgentAuth-C9Aj_wGD.cjs');
|
|
88
88
|
require('./processTreeSnapshot-mDbnuojn.cjs');
|
|
89
89
|
require('ps-list');
|
|
90
90
|
|
|
@@ -4431,7 +4431,7 @@ const runNpmProcess = (args, deps = processDefaults) => new Promise((resolveResu
|
|
|
4431
4431
|
child.on("close", (code) => done({ code: timedOut ? null : code, stdout, stderr, terminationConfirmed: !timedOut || treeKilled }));
|
|
4432
4432
|
});
|
|
4433
4433
|
const runNpm = (args) => runNpmProcess(args);
|
|
4434
|
-
const defaults = {
|
|
4434
|
+
const defaults$1 = {
|
|
4435
4435
|
npm: runNpm,
|
|
4436
4436
|
fs: { lstat: promises.lstat, readlink: promises.readlink, unlink: promises.unlink, rm: promises.rm, readFile: promises.readFile, symlink: promises.symlink, access: promises.access },
|
|
4437
4437
|
platform: process.platform,
|
|
@@ -4463,7 +4463,7 @@ function ownedCliLink(link, target, packageDir) {
|
|
|
4463
4463
|
const resolved = path.resolve(path.dirname(link), target);
|
|
4464
4464
|
return resolved.startsWith(path.join(packageDir, "bin") + path.sep);
|
|
4465
4465
|
}
|
|
4466
|
-
async function installCliSafely(version, deps = defaults) {
|
|
4466
|
+
async function installCliSafely(version, deps = defaults$1) {
|
|
4467
4467
|
const parsed = cliUpdate.parseExactVersion(version);
|
|
4468
4468
|
if (!parsed) throw new Error("Invalid exact CLI version");
|
|
4469
4469
|
if (deps.platform === "win32") {
|
|
@@ -4560,6 +4560,12 @@ async function installCliSafely(version, deps = defaults) {
|
|
|
4560
4560
|
}
|
|
4561
4561
|
}
|
|
4562
4562
|
|
|
4563
|
+
const DEFAULT_BUSY_INSTALL_GRACE_MS = 15 * 6e4;
|
|
4564
|
+
function resolveBusyInstallGrace(raw) {
|
|
4565
|
+
if (raw === void 0 || raw.trim() === "") return DEFAULT_BUSY_INSTALL_GRACE_MS;
|
|
4566
|
+
const value = Number(raw);
|
|
4567
|
+
return Number.isInteger(value) && value >= 0 && value <= 24 * 60 * 6e4 ? value : DEFAULT_BUSY_INSTALL_GRACE_MS;
|
|
4568
|
+
}
|
|
4563
4569
|
function createUpdateController(deps) {
|
|
4564
4570
|
let policy = null;
|
|
4565
4571
|
let outcome = null;
|
|
@@ -4570,6 +4576,8 @@ function createUpdateController(deps) {
|
|
|
4570
4576
|
let handoverHold;
|
|
4571
4577
|
let lastPublished = "";
|
|
4572
4578
|
let autoUpdateEnabled;
|
|
4579
|
+
let busySince = null;
|
|
4580
|
+
let busyDeferred = null;
|
|
4573
4581
|
let lastInstall = (() => {
|
|
4574
4582
|
try {
|
|
4575
4583
|
return deps.lastInstall?.read() ?? null;
|
|
@@ -4636,14 +4644,29 @@ function createUpdateController(deps) {
|
|
|
4636
4644
|
publish(order === null ? "policy_stale" : "current", target);
|
|
4637
4645
|
return;
|
|
4638
4646
|
}
|
|
4647
|
+
let whileBusy = false;
|
|
4639
4648
|
if (!deps.idle()) {
|
|
4640
|
-
|
|
4641
|
-
|
|
4649
|
+
if (busySince?.version !== target) busySince = { version: target, at: now() };
|
|
4650
|
+
whileBusy = !!deps.installWhileBusy && busyDeferred?.version !== target && !deps.installFenced?.() && now() - busySince.at >= (deps.busyGraceMs ?? DEFAULT_BUSY_INSTALL_GRACE_MS);
|
|
4651
|
+
if (!whileBusy) {
|
|
4652
|
+
publish("waiting_idle", target, busyDeferred?.version === target ? busyDeferred.reason : void 0);
|
|
4653
|
+
return;
|
|
4654
|
+
}
|
|
4642
4655
|
}
|
|
4643
4656
|
running = true;
|
|
4644
|
-
publish("installing", target);
|
|
4657
|
+
publish("installing", target, whileBusy ? "while_busy" : void 0);
|
|
4645
4658
|
try {
|
|
4646
|
-
const code = await deps.install(target);
|
|
4659
|
+
const code = whileBusy ? await deps.installWhileBusy(target) : await deps.install(target);
|
|
4660
|
+
if (code && typeof code === "object" && "deferred" in code) {
|
|
4661
|
+
busyDeferred = { version: target, reason: code.deferred };
|
|
4662
|
+
publish("waiting_idle", target, code.deferred);
|
|
4663
|
+
return;
|
|
4664
|
+
}
|
|
4665
|
+
if (code && typeof code === "object" && "blocked" in code) {
|
|
4666
|
+
blocked = true;
|
|
4667
|
+
publish("manual_required", target, code.blocked);
|
|
4668
|
+
return;
|
|
4669
|
+
}
|
|
4647
4670
|
if (code && typeof code === "object") {
|
|
4648
4671
|
if ("manual" in code) publish("manual_required", target, code.manual);
|
|
4649
4672
|
else publish("failed", target, code.failed);
|
|
@@ -4761,6 +4784,134 @@ function createUpdateController(deps) {
|
|
|
4761
4784
|
return { refresh, retry, request, tick, withHandover, holdHandover, isRunning: () => running, currentTarget: () => policy?.autoUpdateVersion ?? null };
|
|
4762
4785
|
}
|
|
4763
4786
|
|
|
4787
|
+
const defaults = {
|
|
4788
|
+
npm: runNpm,
|
|
4789
|
+
fs: { lstat: promises.lstat, readlink: promises.readlink, readFile: promises.readFile, readdir: promises.readdir, copyFile: promises.copyFile, mkdir: promises.mkdir, rename: promises.rename, rm: promises.rm, access: promises.access },
|
|
4790
|
+
platform: process.platform,
|
|
4791
|
+
runningPackageDir: projectPath.projectPath(),
|
|
4792
|
+
now: Date.now
|
|
4793
|
+
};
|
|
4794
|
+
const MANAGED_BINS = ["very-happy", "very-happy-mcp"];
|
|
4795
|
+
async function manifest(dir, deps) {
|
|
4796
|
+
try {
|
|
4797
|
+
return JSON.parse(await deps.fs.readFile(path.join(dir, "package.json"), "utf8"));
|
|
4798
|
+
} catch {
|
|
4799
|
+
return null;
|
|
4800
|
+
}
|
|
4801
|
+
}
|
|
4802
|
+
async function isFile(path, deps) {
|
|
4803
|
+
const stat = await deps.fs.lstat(path).catch(() => null);
|
|
4804
|
+
return !!stat?.isFile();
|
|
4805
|
+
}
|
|
4806
|
+
function packageRelative(path$1) {
|
|
4807
|
+
const normalized = path.relative("/pkg", path.resolve("/pkg", path$1));
|
|
4808
|
+
return normalized && !normalized.startsWith("..") && !normalized.startsWith(path.sep) ? normalized : null;
|
|
4809
|
+
}
|
|
4810
|
+
async function binsUnchanged(stagedDir, liveDir, prefix, deps) {
|
|
4811
|
+
const staged = await manifest(stagedDir, deps);
|
|
4812
|
+
const bin = staged?.bin;
|
|
4813
|
+
if (!bin || typeof bin !== "object") return "staged_bin_map_unreadable";
|
|
4814
|
+
const names = Object.keys(bin).sort();
|
|
4815
|
+
if (names.join(",") !== [...MANAGED_BINS].sort().join(",")) return "staged_bin_map_changed";
|
|
4816
|
+
for (const name of MANAGED_BINS) {
|
|
4817
|
+
const target = packageRelative(String(bin[name]));
|
|
4818
|
+
if (!target || !await isFile(path.join(stagedDir, target), deps)) return "staged_bin_missing";
|
|
4819
|
+
const link = path.join(prefix, "bin", name);
|
|
4820
|
+
const stat = await deps.fs.lstat(link).catch(() => null);
|
|
4821
|
+
if (!stat?.isSymbolicLink()) return "live_bin_not_linked";
|
|
4822
|
+
const linkTarget = await deps.fs.readlink(link);
|
|
4823
|
+
if (!ownedCliLink(link, linkTarget, liveDir)) return "live_bin_not_owned";
|
|
4824
|
+
if (path.relative(liveDir, path.resolve(path.dirname(link), linkTarget)) !== target) return "staged_bin_map_changed";
|
|
4825
|
+
}
|
|
4826
|
+
return null;
|
|
4827
|
+
}
|
|
4828
|
+
async function keepOldChunks(liveDir, stagedDir, deps, sub = "dist") {
|
|
4829
|
+
const live = await deps.fs.readdir(path.join(liveDir, sub)).catch(() => []);
|
|
4830
|
+
const staged = new Set(await deps.fs.readdir(path.join(stagedDir, sub)).catch(() => []));
|
|
4831
|
+
let kept = 0;
|
|
4832
|
+
for (const name of live) {
|
|
4833
|
+
if (path.basename(name) !== name) continue;
|
|
4834
|
+
const from = path.join(liveDir, sub, name);
|
|
4835
|
+
const stat = await deps.fs.lstat(from).catch(() => null);
|
|
4836
|
+
if (stat?.isDirectory()) {
|
|
4837
|
+
if (!staged.has(name)) await deps.fs.mkdir(path.join(stagedDir, sub, name));
|
|
4838
|
+
kept += await keepOldChunks(liveDir, stagedDir, deps, path.join(sub, name));
|
|
4839
|
+
continue;
|
|
4840
|
+
}
|
|
4841
|
+
if (staged.has(name) || !stat?.isFile()) continue;
|
|
4842
|
+
await deps.fs.copyFile(from, path.join(stagedDir, sub, name), node_fs.constants.COPYFILE_EXCL);
|
|
4843
|
+
kept++;
|
|
4844
|
+
}
|
|
4845
|
+
return kept;
|
|
4846
|
+
}
|
|
4847
|
+
async function installCliStaged(version, deps = defaults) {
|
|
4848
|
+
const parsed = cliUpdate.parseExactVersion(version);
|
|
4849
|
+
if (!parsed) throw new Error("Invalid exact CLI version");
|
|
4850
|
+
if (deps.platform === "win32") return { outcome: { deferred: "staged_install_unsupported" } };
|
|
4851
|
+
const liveDir = deps.runningPackageDir;
|
|
4852
|
+
const prefix = liveDir ? doctor.globalPrefixForPackage(liveDir) : null;
|
|
4853
|
+
if (!liveDir || !prefix) return { outcome: { manual: "install_location_unverified" } };
|
|
4854
|
+
const liveStat = await deps.fs.lstat(liveDir).catch(() => null);
|
|
4855
|
+
const live = await manifest(liveDir, deps);
|
|
4856
|
+
if (!liveStat?.isDirectory() || liveStat.isSymbolicLink() || live?.name !== "very-happy-cli" || typeof live.version !== "string") {
|
|
4857
|
+
return { outcome: { manual: "install_location_unverified" } };
|
|
4858
|
+
}
|
|
4859
|
+
const root = path.dirname(liveDir);
|
|
4860
|
+
try {
|
|
4861
|
+
await deps.fs.access(root, node_fs.constants.W_OK);
|
|
4862
|
+
await deps.fs.access(liveDir, node_fs.constants.W_OK);
|
|
4863
|
+
} catch {
|
|
4864
|
+
return { outcome: { manual: "install_location_not_writable" } };
|
|
4865
|
+
}
|
|
4866
|
+
const stagePrefix = path.join(root, `.very-happy-cli-stage-${parsed.exact}`);
|
|
4867
|
+
const stagedDir = path.join(stagePrefix, "lib", "node_modules", "very-happy-cli");
|
|
4868
|
+
const retiredDir = path.join(root, `.very-happy-cli-retired-${live.version}-${deps.now()}`);
|
|
4869
|
+
const cleanup = async (path) => {
|
|
4870
|
+
await deps.fs.rm(path, { recursive: true, force: true }).catch(() => void 0);
|
|
4871
|
+
};
|
|
4872
|
+
await cleanup(stagePrefix);
|
|
4873
|
+
let swapped = false;
|
|
4874
|
+
try {
|
|
4875
|
+
const result = await deps.npm(autoUpdateInstallArgs(parsed.exact, stagePrefix));
|
|
4876
|
+
if (result.terminationConfirmed === false) return { outcome: "blocked" };
|
|
4877
|
+
if (result.code !== 0) return { outcome: result.code };
|
|
4878
|
+
const staged = await manifest(stagedDir, deps);
|
|
4879
|
+
if (staged?.name !== "very-happy-cli" || staged.version !== parsed.exact) return { outcome: { deferred: "staged_package_unverified" } };
|
|
4880
|
+
const binProblem = await binsUnchanged(stagedDir, liveDir, prefix, deps);
|
|
4881
|
+
if (binProblem) return { outcome: { deferred: binProblem } };
|
|
4882
|
+
let keptChunks;
|
|
4883
|
+
try {
|
|
4884
|
+
keptChunks = await keepOldChunks(liveDir, stagedDir, deps);
|
|
4885
|
+
} catch {
|
|
4886
|
+
return { outcome: { deferred: "staged_copy_failed" } };
|
|
4887
|
+
}
|
|
4888
|
+
try {
|
|
4889
|
+
await deps.fs.rename(liveDir, retiredDir);
|
|
4890
|
+
} catch {
|
|
4891
|
+
return { outcome: { deferred: "staged_retire_failed" } };
|
|
4892
|
+
}
|
|
4893
|
+
try {
|
|
4894
|
+
await deps.fs.rename(stagedDir, liveDir);
|
|
4895
|
+
} catch {
|
|
4896
|
+
try {
|
|
4897
|
+
await deps.fs.rename(retiredDir, liveDir);
|
|
4898
|
+
} catch {
|
|
4899
|
+
return { outcome: { blocked: "staged_rollback_failed", retiredDir }, keptChunks };
|
|
4900
|
+
}
|
|
4901
|
+
return { outcome: { deferred: "staged_swap_failed" } };
|
|
4902
|
+
}
|
|
4903
|
+
swapped = true;
|
|
4904
|
+
const installed = await manifest(liveDir, deps);
|
|
4905
|
+
return { outcome: installed?.version === parsed.exact ? 0 : { failed: "installed_elsewhere" }, keptChunks };
|
|
4906
|
+
} finally {
|
|
4907
|
+
await cleanup(stagePrefix);
|
|
4908
|
+
if (swapped) {
|
|
4909
|
+
await cleanup(retiredDir);
|
|
4910
|
+
await cleanup(path.join(root, ".package-lock.json"));
|
|
4911
|
+
}
|
|
4912
|
+
}
|
|
4913
|
+
}
|
|
4914
|
+
|
|
4764
4915
|
function parseLastInstall(raw) {
|
|
4765
4916
|
if (!raw || typeof raw !== "object") return null;
|
|
4766
4917
|
const { from, to, at, source } = raw;
|
|
@@ -7031,7 +7182,7 @@ ${action.prompt}`, { localId: `automation-${run.id}` });
|
|
|
7031
7182
|
}
|
|
7032
7183
|
}
|
|
7033
7184
|
persist({ runId: run.id, automationId: automation.id, kind: "spawn", phase: "starting", claimId: run.claimId, stickyKey, ...action.worktree ? { directory } : {} });
|
|
7034
|
-
const spawned = await deps.spawn({ directory, agent, permissionMode, spawnedBy: AUTOMATION_SPAWNED_BY, environmentVariables: env });
|
|
7185
|
+
const spawned = await deps.spawn({ directory, agent, permissionMode, spawnedBy: AUTOMATION_SPAWNED_BY, environmentVariables: stickyKey ? { ...env, VH_AUTOMATION_STICKY: "1" } : env });
|
|
7035
7186
|
if (spawned.type !== "success") {
|
|
7036
7187
|
await failNow(claimed, "spawn", spawned.type === "error" ? spawned.errorMessage : "Directory approval required", "spawn_failed");
|
|
7037
7188
|
return;
|
|
@@ -8446,6 +8597,17 @@ async function startDaemon() {
|
|
|
8446
8597
|
const daemonSupervisor$1 = daemonSupervisor.detectDaemonSupervisor(process.env, process.platform, launchdJob);
|
|
8447
8598
|
const lineage = daemonSupervisor.daemonLineage(daemonSupervisor$1, process.env, process.platform, launchdJob);
|
|
8448
8599
|
logger.logger.debug(`[DAEMON RUN] Supervisor: ${daemonSupervisor$1} (lineage ${lineage}${launchdJob ? `, launchd job pid ${launchdJob.jobPid ?? "-"}` : ""})`);
|
|
8600
|
+
const systemdKillMode = daemonSupervisor$1 === "systemd" ? await daemonSupervisor.probeSystemdKillMode() : null;
|
|
8601
|
+
const handoverSparesWrappers = daemonSupervisor.wrappersSurviveHandover({
|
|
8602
|
+
supervisor: daemonSupervisor$1,
|
|
8603
|
+
env: process.env,
|
|
8604
|
+
platform: process.platform,
|
|
8605
|
+
pid: process.pid,
|
|
8606
|
+
ppid: process.ppid,
|
|
8607
|
+
inContainer: require$$0.existsSync("/.dockerenv") || require$$0.existsSync("/run/.containerenv"),
|
|
8608
|
+
systemdKillMode
|
|
8609
|
+
});
|
|
8610
|
+
logger.logger.debug(`[DAEMON RUN] Handover spares wrappers: ${handoverSparesWrappers}${daemonSupervisor$1 === "systemd" ? ` (KillMode ${systemdKillMode ?? "unknown"})` : ""}`);
|
|
8449
8611
|
let fileState = {
|
|
8450
8612
|
pid: process.pid,
|
|
8451
8613
|
httpPort: controlPort,
|
|
@@ -8579,6 +8741,15 @@ async function startDaemon() {
|
|
|
8579
8741
|
// whose turn ended but still has background tasks is busy too.
|
|
8580
8742
|
idle: () => !turnActivity.hasActiveTurn() && !backgroundTasks.hasAny() && !harnessInstaller?.isRunning(),
|
|
8581
8743
|
install: installCliSafely,
|
|
8744
|
+
// B-817: a machine that is never idle installs after the grace period
|
|
8745
|
+
// through the staged path, which never leaves the live tree incomplete.
|
|
8746
|
+
installWhileBusy: async (version) => {
|
|
8747
|
+
const report = await installCliStaged(version);
|
|
8748
|
+
logger.logger.warn(`[DAEMON RUN] CLI update: staged install while busy -> ${JSON.stringify(report.outcome)} keptChunks=${report.keptChunks ?? 0}`);
|
|
8749
|
+
return report.outcome;
|
|
8750
|
+
},
|
|
8751
|
+
installFenced: () => !!harnessInstaller?.isRunning(),
|
|
8752
|
+
busyGraceMs: resolveBusyInstallGrace(process.env.HAPPY_CLI_UPDATE_BUSY_GRACE_MS),
|
|
8582
8753
|
lastInstall: lastInstallStore(configuration.configuration.happyHomeDir),
|
|
8583
8754
|
publish: (state) => {
|
|
8584
8755
|
cliUpdateStateRef = state;
|
|
@@ -8680,7 +8851,8 @@ async function startDaemon() {
|
|
|
8680
8851
|
}
|
|
8681
8852
|
}
|
|
8682
8853
|
const relayMove = pendingRelayMove;
|
|
8683
|
-
|
|
8854
|
+
const sessionsHold = () => daemonSupervisor.handoverWaitsForSessions({ bundleReplaced, relayMove: !!relayMove, sparesWrappers: handoverSparesWrappers }) && (turnActivity.hasActiveTurn() || backgroundTasks.hasAny());
|
|
8855
|
+
if ((bundleReplaced || relayMove) && !teamWorker?.busy && !automationRunner?.busy && !updateController.isRunning() && !harnessInstaller?.isRunning() && !sessionsHold()) {
|
|
8684
8856
|
const preflight = bundleReplaced ? await preflightNewBundle(bundlePath) : { action: "proceed" };
|
|
8685
8857
|
if (preflight.action === "hold") {
|
|
8686
8858
|
if (lastHandoverHold !== preflight.reason) {
|
|
@@ -8690,7 +8862,7 @@ async function startDaemon() {
|
|
|
8690
8862
|
updateController.holdHandover(preflight.reason);
|
|
8691
8863
|
return;
|
|
8692
8864
|
}
|
|
8693
|
-
if (teamWorker?.busy || automationRunner?.busy || updateController.isRunning() || harnessInstaller?.isRunning() ||
|
|
8865
|
+
if (teamWorker?.busy || automationRunner?.busy || updateController.isRunning() || harnessInstaller?.isRunning() || sessionsHold()) return;
|
|
8694
8866
|
lastHandoverHold = null;
|
|
8695
8867
|
logger.logger.debug(relayMove ? `[DAEMON RUN] Relay moved to ${relayMove.serverUrl}; handing off to a new daemon on the new settings` : "[DAEMON RUN] Daemon bundle replaced on disk and verified, handing off to new daemon");
|
|
8696
8868
|
teamWorker?.stop();
|