very-happy-cli 0.2.200 → 0.2.202
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-CwSShYPI.cjs → AcpBackend-BRcPXur6.cjs} +3 -3
- package/dist/{AcpBackend-Cnp6WNn8.mjs → AcpBackend-Z51picBa.mjs} +3 -3
- package/dist/{AcpSessionManager-C4O3jhT_.mjs → AcpSessionManager-BCGqL1Em.mjs} +2 -2
- package/dist/{AcpSessionManager-DqW99tOL.cjs → AcpSessionManager-BckOYH3I.cjs} +2 -2
- package/dist/{BasePermissionHandler-CgqjIUyG.cjs → BasePermissionHandler-BYIY3kxs.cjs} +1 -1
- package/dist/{BasePermissionHandler-8Msj0Z8j.mjs → BasePermissionHandler-BhJjr-wB.mjs} +1 -1
- package/dist/{account-BIxPuBEs.mjs → account-B-HTHZKw.mjs} +11 -11
- package/dist/{account-DcNh2_SN.cjs → account-B0Wu7rJR.cjs} +11 -11
- package/dist/{accountService-BDJo14mY.cjs → accountService-Cns8UYGI.cjs} +4 -4
- package/dist/{accountService-ELazcp3V.mjs → accountService-DEpIq6CF.mjs} +4 -4
- package/dist/{acpSessionResume-De_sTG30.mjs → acpSessionResume-BKjQRT4V.mjs} +1 -1
- package/dist/{acpSessionResume-B_W8uTI6.cjs → acpSessionResume-C8Kd8eK6.cjs} +1 -1
- package/dist/{agentHome-C-900jC1.mjs → agentHome-BXiCouR4.mjs} +4 -4
- package/dist/{agentHome-C-usjJwB.cjs → agentHome-DnxSf1ox.cjs} +4 -4
- package/dist/{api-BPWRzeNF.cjs → api-B-FB-s4z.cjs} +10 -10
- package/dist/{api-DCUiAds-.mjs → api-Cu1OFHDM.mjs} +10 -10
- package/dist/{apiMachine-DjhbA1rL.cjs → apiMachine-DCWgI1l_.cjs} +28 -18
- package/dist/{apiMachine-CJl4m3V3.mjs → apiMachine-DYGPILVb.mjs} +28 -18
- package/dist/{attachmentContent-BKIq6EXR.mjs → attachmentContent-Dq8P5ODq.mjs} +2 -2
- package/dist/{attachmentContent-C2f1UEP9.cjs → attachmentContent-dXwHB_3C.cjs} +2 -2
- package/dist/{auth-h6oU63Ni.cjs → auth-BVNBE4B1.cjs} +8 -8
- package/dist/{auth-8jKFCZOX.mjs → auth-CgdE-j7z.mjs} +5 -5
- package/dist/{auth-uLRHXOGY.mjs → auth-D11uvx2P.mjs} +8 -8
- package/dist/{auth-oAnLi4Tl.cjs → auth-DpIHm7Lb.cjs} +5 -5
- package/dist/{auto-Bpa5iA1A.cjs → auto-Ba2b-il4.cjs} +17 -17
- package/dist/{auto-A5arQ-bI.mjs → auto-WdjHKP9R.mjs} +17 -17
- package/dist/{bootstrap-BkLFgEGF.mjs → bootstrap-BTYJf2w8.mjs} +2 -2
- package/dist/{bootstrap-DUKAKxrJ.cjs → bootstrap-CsZO_jkL.cjs} +2 -2
- package/dist/{browser-Ds-N-Dup.cjs → browser-DgufCq1K.cjs} +1 -1
- package/dist/{browser-BAlw0rns.mjs → browser-Dx3UOVPP.mjs} +1 -1
- package/dist/{claudeAccountEnv-D33xXRE7.cjs → claudeAccountEnv-Btp39mfa.cjs} +1 -1
- package/dist/{claudeAccountEnv-CI8RlIB9.mjs → claudeAccountEnv-DowsOlDB.mjs} +1 -1
- package/dist/{claudeLocal-BbsOT-EF.cjs → claudeLocal-Q0FgzhTu.cjs} +5 -5
- package/dist/{claudeLocal-X48n0RhP.mjs → claudeLocal-ylDKcvX0.mjs} +5 -5
- package/dist/{claudeLocalLauncher-D18gRtxz.mjs → claudeLocalLauncher-CtybsaR8.mjs} +10 -10
- package/dist/{claudeLocalLauncher-D1jS3iK4.cjs → claudeLocalLauncher-D2rZvuaW.cjs} +10 -10
- package/dist/{claudeSessionFork-Bkxn40Y8.cjs → claudeSessionFork-BrstQPE4.cjs} +1 -1
- package/dist/{claudeSessionFork-n1vMiFcP.mjs → claudeSessionFork-DRLxmv9j.mjs} +1 -1
- package/dist/{client-BnoN4P4t.cjs → client-CNWx72ZT.cjs} +2 -2
- package/dist/{client-C8BTmcrh.cjs → client-Ch4Azlny.cjs} +4 -4
- package/dist/{client-BgxQ9aej.mjs → client-Cj7D61by.mjs} +3 -3
- package/dist/{client-Blpuk2Hr.mjs → client-D0oBXuEe.mjs} +2 -2
- package/dist/{client-C0qjAgZ_.mjs → client-DJsXNJWO.mjs} +4 -4
- package/dist/{client-BXwIqRha.mjs → client-DfT_CRwl.mjs} +2 -2
- package/dist/{client-D0_UOmC1.cjs → client-Dq7jaxb2.cjs} +2 -2
- package/dist/{client-1zIbVVX5.cjs → client-xV99weGP.cjs} +3 -3
- package/dist/codex/happyMcpStdioBridge.cjs +18 -18
- package/dist/codex/happyMcpStdioBridge.mjs +18 -18
- package/dist/{codexAccount-BAezf1fY.mjs → codexAccount-CieIQLOX.mjs} +1 -1
- package/dist/{codexAccount-DfeCHUOU.cjs → codexAccount-D-OBY29W.cjs} +1 -1
- package/dist/{codexAppServerClient-xBeqblCj.cjs → codexAppServerClient-BwBPZonh.cjs} +3 -3
- package/dist/{codexAppServerClient-By4ntTIr.mjs → codexAppServerClient-DtdCZ7_b.mjs} +3 -3
- package/dist/{codexCommand-CgzJe-Ti.cjs → codexCommand-CsY9YFiG.cjs} +53 -52
- package/dist/{codexCommand-C7BVsmPu.mjs → codexCommand-D92AQCLU.mjs} +49 -48
- package/dist/{codexTermination-DVrdQx3Q.cjs → codexTermination-BbXG2oFT.cjs} +1 -1
- package/dist/{codexTermination-BS0sLBKS.mjs → codexTermination-rhIxjRMJ.mjs} +1 -1
- package/dist/{config-D3jidXDu.mjs → config-BnN1yFyi.mjs} +3 -3
- package/dist/{config-4R0rnthZ.cjs → config-Zhkmfb3O.cjs} +3 -3
- package/dist/{configuration-4pG95tsq.mjs → configuration-CQaLZMa-.mjs} +1 -1
- package/dist/{configuration-ClUt7pqs.cjs → configuration-DZUnfWp2.cjs} +1 -1
- package/dist/{connect-Da2NQJ3K.cjs → connect-BToTf3Gy.cjs} +13 -13
- package/dist/{connect-Do5qcqmg.mjs → connect-DY5QLfbI.mjs} +13 -13
- package/dist/{context-wMsIGwBw.cjs → context-BHydzPZw.cjs} +1 -1
- package/dist/{context-Cf05DtNM.mjs → context-ByTvtMXZ.mjs} +1 -1
- package/dist/{controlClient-SYDFcIkk.cjs → controlClient-Bfwe0Xpt.cjs} +3 -3
- package/dist/{controlClient-bqCKl9Nv.mjs → controlClient-Cqhd8ynk.mjs} +3 -3
- package/dist/{createSessionMetadata-msQTEvvn.cjs → createSessionMetadata-D_qa01wq.cjs} +2 -2
- package/dist/{createSessionMetadata-CQkxe_4T.mjs → createSessionMetadata-tmhDzhJZ.mjs} +2 -2
- package/dist/{daemonAccounts-B8xnkprW.mjs → daemonAccounts-D5shoCLt.mjs} +3 -3
- package/dist/{daemonAccounts-Ch_rSTSX.cjs → daemonAccounts-ciidbU2h.cjs} +2 -2
- package/dist/{defaultPermissionMode-BETWd5Lf.cjs → defaultPermissionMode-Cs_Tv83b.cjs} +1 -1
- package/dist/{defaultPermissionMode-Cl3OvdHp.mjs → defaultPermissionMode-DgeiMMqy.mjs} +1 -1
- package/dist/{deterministicJson-CQ8jkArF.cjs → deterministicJson-CbUdClvO.cjs} +67 -20
- package/dist/{deterministicJson-BRAeReBK.mjs → deterministicJson-DRL1Gs_c.mjs} +68 -21
- package/dist/{doctor-C9D-t20z.cjs → doctor-DHCmWcwR.cjs} +7 -7
- package/dist/{doctor-Dy7z3qvy.mjs → doctor-Wu0yZ80l.mjs} +7 -7
- package/dist/{downloadTarget-DfoOSrYi.cjs → downloadTarget-BoJrjpEe.cjs} +6 -6
- package/dist/{downloadTarget-Diq-GBu4.mjs → downloadTarget-G72yKQcM.mjs} +6 -6
- package/dist/{ensureDaemonRunning-LqrgqVG3.mjs → ensureDaemonRunning-BKGybp3s.mjs} +5 -5
- package/dist/{ensureDaemonRunning-Df76EtKd.cjs → ensureDaemonRunning-CnkyGd9x.cjs} +5 -5
- package/dist/{format-CbliQN8V.mjs → format-BSx-Nv2p.mjs} +2 -1
- package/dist/{format-P9_M_7ga.cjs → format-DePME4uu.cjs} +2 -1
- package/dist/{handleResumeCommand-Dz4Aw_aZ.mjs → handleResumeCommand-DrJdhjLD.mjs} +5 -5
- package/dist/{handleResumeCommand-CjCtwrrm.cjs → handleResumeCommand-uKzhaOVC.cjs} +5 -5
- package/dist/{index-BiutHOAO.cjs → index-44o_qMvE.cjs} +14 -4
- package/dist/{index-CdOnhx2X.cjs → index-BKXqaux4.cjs} +4 -4
- package/dist/{index-Sdvy1Lsf.mjs → index-BcYJJV-f.mjs} +3 -3
- package/dist/{index-ByBOdEvG.cjs → index-Bi7Lmykl.cjs} +47 -46
- package/dist/{index-BNBXrqRE.mjs → index-C-eSUhXW.mjs} +4 -4
- package/dist/{index-kwsivEs-.mjs → index-CiRMvS73.mjs} +14 -5
- package/dist/{index-DUwOmhnq.cjs → index-CoBaGAA4.cjs} +3 -3
- package/dist/{index-CjMA70-R.mjs → index-CowtCbZ_.mjs} +46 -45
- package/dist/{index-CbzettaI.cjs → index-DDOCSeEj.cjs} +4 -4
- package/dist/{index-XP-qcJQ3.mjs → index-fNsf-8K-.mjs} +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-DMXd8Z4c.mjs → install-0TkucJrC.mjs} +3 -3
- package/dist/{install-C4dKrmxR.cjs → install-Ddc8TlWE.cjs} +3 -3
- package/dist/{issue-BijeNKIT.cjs → issue-CIfzJuaS.cjs} +8 -8
- package/dist/{issue-COytLvGE.mjs → issue-CML2xa46.mjs} +8 -8
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +4 -0
- package/dist/lib.d.mts +4 -0
- package/dist/lib.mjs +12 -12
- package/dist/{localHappyAgentAuth-DeDQjw24.mjs → localHappyAgentAuth-BUX4E1ug.mjs} +1 -1
- package/dist/{localHappyAgentAuth-CjtNcaI0.cjs → localHappyAgentAuth-WLqXQbc6.cjs} +1 -1
- package/dist/{logger-BLMi8oJK.mjs → logger-BEVIGYKL.mjs} +17 -3
- package/dist/{logger-D28MY1Bv.cjs → logger-Dhc0l3xH.cjs} +17 -2
- package/dist/{machineMetadata-D8OWVD4l.mjs → machineMetadata-BQdp_ihk.mjs} +3 -3
- package/dist/{machineMetadata-BzjrIn_N.cjs → machineMetadata-ixKckJ7k.cjs} +3 -3
- package/dist/{main-DoJIcSOh.cjs → main-BNBYOcQb.cjs} +49 -49
- package/dist/{main-c0fCuBON.mjs → main-BzQSe4Zu.mjs} +49 -49
- package/dist/{mcp-DKkBFGUa.mjs → mcp-BueI4Bel.mjs} +18 -18
- package/dist/{mcp-CEtvR6tG.cjs → mcp-BwskAxOK.cjs} +18 -18
- package/dist/{mirrorProtocol-DFQLXDBI.mjs → mirrorProtocol-5aFYsCCe.mjs} +3 -3
- package/dist/{mirrorProtocol-CCl9dtzh.cjs → mirrorProtocol-DGMmhArw.cjs} +3 -3
- package/dist/{package-BFSsS_dl.cjs → package-CAmlKYcH.cjs} +7 -7
- package/dist/{package-DbGqY8Ej.mjs → package-aOUtHYRZ.mjs} +7 -7
- package/dist/{panels-2yIO9FxQ.mjs → panels-BeVMgmRW.mjs} +5 -5
- package/dist/{panels-BqLXIQif.cjs → panels-By2IDfXv.cjs} +5 -5
- package/dist/{peerTools-4GYKxr8J.mjs → peerTools-BkRgJomj.mjs} +5 -5
- package/dist/{peerTools-Z8V2E0AF.cjs → peerTools-dgllF1wT.cjs} +5 -5
- package/dist/{persistence-TpVFA5-I.cjs → persistence-05BAS4Ou.cjs} +12 -2
- package/dist/{persistence-DbOKjdUD.mjs → persistence-EuUaQKL7.mjs} +12 -3
- package/dist/{piRunnerArgs-Bdj0sjAT.mjs → piRunnerArgs-CygWrAwY.mjs} +1 -1
- package/dist/{piRunnerArgs-DOEJJymf.cjs → piRunnerArgs-DkjCRPYn.cjs} +1 -1
- package/dist/{piRuntime-B0QZykV7.mjs → piRuntime-LRW_t6ME.mjs} +1 -1
- package/dist/{piRuntime-DiRayy91.cjs → piRuntime-zY2jIQod.cjs} +1 -1
- package/dist/{piTerminal-DciFqPEi.cjs → piTerminal-BfZshXGh.cjs} +20 -20
- package/dist/{piTerminal-DGF4X7C-.mjs → piTerminal-BhlPA1HR.mjs} +20 -20
- package/dist/{pushNotifications-CrCTpDiN.mjs → pushNotifications-B7Ga8Zyf.mjs} +3 -3
- package/dist/{pushNotifications-C1i2W1GQ.cjs → pushNotifications-DaVlLe7N.cjs} +3 -3
- package/dist/{query-CrSvcV32.mjs → query-BQLtwpr9.mjs} +1 -1
- package/dist/{query-BkOpCpRo.cjs → query-CX0Of89i.cjs} +1 -1
- package/dist/{rateLimitWindows-BREA7OZj.cjs → rateLimitWindows-CpSOlXBt.cjs} +1 -1
- package/dist/{rateLimitWindows-DZVrafmm.mjs → rateLimitWindows-hv2zLYid.mjs} +1 -1
- package/dist/{reconnectGate-YQ5jXJfY.cjs → reconnectGate-B_aJrehH.cjs} +1 -1
- package/dist/{reconnectGate-COxAZTv8.mjs → reconnectGate-DO_ZQmJE.mjs} +1 -1
- package/dist/{registerCommonHandlers-Cfl_dEWs.mjs → registerCommonHandlers-BEpK4WD2.mjs} +2 -2
- package/dist/{registerCommonHandlers-D95IxqDN.cjs → registerCommonHandlers-em2elV3l.cjs} +2 -2
- package/dist/{registerKillSessionHandler-DoE6xgH3.mjs → registerKillSessionHandler-D-dDzI2n.mjs} +6 -6
- package/dist/{registerKillSessionHandler-DJJXtc_L.cjs → registerKillSessionHandler-D4ZQvsH2.cjs} +6 -6
- package/dist/{registerSideQuestionHandler-DsRz-aD9.cjs → registerSideQuestionHandler-BIOLUe2U.cjs} +4 -4
- package/dist/{registerSideQuestionHandler-Dv00rqcy.mjs → registerSideQuestionHandler-okUy9Q_-.mjs} +4 -4
- package/dist/{remoteSessionClient-DleOeQlN.cjs → remoteSessionClient-BLWFXMBo.cjs} +5 -5
- package/dist/{remoteSessionClient-BFd_D9ka.mjs → remoteSessionClient-CzjLyL9c.mjs} +5 -5
- package/dist/{reportProgressTool-D4xKY9Ur.mjs → reportProgressTool-CNi0Vqqm.mjs} +5 -5
- package/dist/{reportProgressTool-DtEpDqv3.cjs → reportProgressTool-DcNBXBw8.cjs} +5 -5
- package/dist/{run-iDEMW4js.mjs → run-D59Gb4SQ.mjs} +272 -73
- package/dist/{run-CVAIFpsp.cjs → run-bzlz4DI1.cjs} +272 -73
- package/dist/{runClaude-DvHdLJaV.mjs → runClaude-DZtdmcXK.mjs} +26 -25
- package/dist/{runClaude-gucCQBma.cjs → runClaude-kVp1PKab.cjs} +29 -28
- package/dist/{runClaudeDeps-CQ8vvqUQ.cjs → runClaudeDeps-BHv9FkVz.cjs} +43 -42
- package/dist/{runClaudeDeps-DkFWFwVc.mjs → runClaudeDeps-D83tR1KP.mjs} +49 -48
- package/dist/{runGemini-B2lXQDru.mjs → runGemini-DLc_bL4E.mjs} +36 -35
- package/dist/{runGemini-C0vqJYtS.cjs → runGemini-W-0t7skM.cjs} +36 -35
- package/dist/{runOpenClaw-DNV7GX73.cjs → runOpenClaw-BsqbOw8R.cjs} +18 -18
- package/dist/{runOpenClaw-Ddb6sOkY.mjs → runOpenClaw-mm-hKxMC.mjs} +18 -18
- package/dist/{sandbox-Cw0cPDDh.mjs → sandbox-DXbKl-Os.mjs} +4 -4
- package/dist/{sandbox-FA0RlaZg.cjs → sandbox-DrWJss7J.cjs} +4 -4
- package/dist/selfCheck-B1XdrEbN.mjs +89 -0
- package/dist/{selfCheck-DFC8fzhF.cjs → selfCheck-CVXucSXR.cjs} +40 -40
- package/dist/{send-CwgqPftE.mjs → send-Cdda78Iw.mjs} +8 -8
- package/dist/{send-BFd-5b_Q.cjs → send-D7pRBaht.cjs} +8 -8
- package/dist/{server-DwOdMGAP.cjs → server-BI6defPs.cjs} +6 -6
- package/dist/{server-C_4Fk45r.mjs → server-CNilQcJK.mjs} +4 -4
- package/dist/{sessionLock-DglhFHzB.cjs → sessionLock-Bjsy90aM.cjs} +3 -3
- package/dist/{sessionLock-CphKQyav.mjs → sessionLock-CVjlaRSL.mjs} +3 -3
- package/dist/sessionMetadata-B44cL4Xj.cjs +29 -0
- package/dist/sessionMetadata-C1eoAi89.mjs +25 -0
- package/dist/{sessionOps-D-uFSTHk.mjs → sessionOps-CV5RUpwG.mjs} +4 -4
- package/dist/{sessionOps-CIFvoFPA.cjs → sessionOps-CvmOHwGP.cjs} +4 -4
- package/dist/{sessionProvider-B0daO-Ln.cjs → sessionProvider-4sWr0Myr.cjs} +10 -10
- package/dist/{sessionProvider-D8y7K8bK.mjs → sessionProvider-BmO4ahnt.mjs} +10 -10
- package/dist/{sessionScanner-DQAOP6pU.mjs → sessionScanner-34Q0vTR3.mjs} +3 -3
- package/dist/{sessionScanner-CWflbWoH.cjs → sessionScanner-DZBiEOyb.cjs} +3 -3
- package/dist/{sessions-CaO_-AI7.mjs → sessions-Cl435KQT.mjs} +10 -10
- package/dist/{sessions-CzpI76qj.cjs → sessions-DjAXZWTX.cjs} +10 -10
- package/dist/{setupOfflineReconnection-Ck-p0YPb.mjs → setupOfflineReconnection-BC5FJTkc.mjs} +2 -2
- package/dist/{setupOfflineReconnection-BZHRoKDx.cjs → setupOfflineReconnection-zebrb6U_.cjs} +2 -2
- package/dist/{spawn-DyjOa4nf.cjs → spawn-C8cJK9-m.cjs} +14 -14
- package/dist/{spawn-BEJxfj60.mjs → spawn-DqWdgMt_.mjs} +14 -14
- package/dist/{spawnAgents-XObVj6zN.mjs → spawnAgents-BclZYkov.mjs} +1 -1
- package/dist/{spawnAgents-IiuqX0S5.cjs → spawnAgents-DvbEDCIq.cjs} +1 -1
- package/dist/{spawnHappyCLI-Cc9kKpcq.mjs → spawnHappyCLI-BckHSjR0.mjs} +1 -1
- package/dist/{spawnHappyCLI-C3XuIB2N.cjs → spawnHappyCLI-CeWgULMt.cjs} +1 -1
- package/dist/{startFileWatcher-t3K1y9kY.mjs → startFileWatcher-BXiBlfVr.mjs} +1 -1
- package/dist/{startFileWatcher-CeDJl9mN.cjs → startFileWatcher-CXZYt0y9.cjs} +1 -1
- package/dist/{sessionMetadata-DyTJ0Ki5.cjs → startupSessionCreate-CycB-kwu.cjs} +3 -14
- package/dist/{sessionMetadata-V7Z7F-cj.mjs → startupSessionCreate-D8hODW7I.mjs} +4 -14
- package/dist/{store-DOZAMV4W.cjs → store-Cpb1LMNW.cjs} +1 -1
- package/dist/{store-CqNAE-0v.mjs → store-DWmjM4Ex.mjs} +1 -1
- package/dist/{streamRelay-Dyp4x44P.cjs → streamRelay-4XiiNB3N.cjs} +1 -1
- package/dist/{streamRelay-7D7v0hvk.mjs → streamRelay-DdGOsW8v.mjs} +1 -1
- package/dist/{sync-s1pUqWGm.mjs → sync-BfM5OKSS.mjs} +1 -1
- package/dist/{sync-BvxhuW9R.cjs → sync-CyUWevwD.cjs} +1 -1
- package/dist/{systemPrompt-CCdSrtn3.cjs → systemPrompt-BUZQDf4k.cjs} +2 -2
- package/dist/{systemPrompt-CLYTbBhV.mjs → systemPrompt-Tu_2ixE3.mjs} +2 -2
- package/dist/{teams-BVp5F_xN.mjs → teams-Cpdqvfe3.mjs} +7 -7
- package/dist/{teams-D2q1DQWz.cjs → teams-KjHee0Vg.cjs} +7 -7
- package/dist/{template-M1YGFYUT.cjs → template-3fV9bi0X.cjs} +1 -1
- package/dist/{template-oBrR0saD.mjs → template-CtRLg2PG.mjs} +1 -1
- package/dist/{time-qd46L189.mjs → time-BQWf06hA.mjs} +1 -1
- package/dist/{time-D-v2Cd9e.cjs → time-CbOTVtAt.cjs} +1 -1
- package/dist/{titleGenerator-CSYqcorn.cjs → titleGenerator-CpiQkf_r.cjs} +3 -3
- package/dist/{titleGenerator-BdeHi3IY.mjs → titleGenerator-DYnqd0oI.mjs} +2 -2
- package/dist/{todo-Dq_YuJvj.cjs → todo-Cp6bRp62.cjs} +26 -18
- package/dist/{todo-DiEhLgUZ.mjs → todo-DVrsXyKn.mjs} +26 -18
- package/dist/{tools-CY2zrdd5.cjs → tools-BFQm7xny.cjs} +1 -1
- package/dist/{tools-DR7GWBBV.mjs → tools-XGAJepvT.mjs} +1 -1
- package/dist/{uninstall-BvwDZVU9.mjs → uninstall-C2LF0vtR.mjs} +3 -3
- package/dist/{uninstall-BHhHjbzE.cjs → uninstall-Cyqq90JW.cjs} +3 -3
- package/dist/{wrapperAccount-ejUjAQaM.cjs → wrapperAccount-nGGMJDBF.cjs} +2 -2
- package/dist/{wrapperAccount-CpDsQL15.mjs → wrapperAccount-z8Swrd08.mjs} +2 -2
- package/package.json +7 -7
- package/dist/selfCheck-B-hKig8I.mjs +0 -89
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { i as isClaudeSessionId, h as extractCompleteLines, j as decideBackfill, k as parseTerminalHookPayload, m as decideMirrorBinding, M as MIRROR_BACKFILL_LINES_DEFAULT, n as mirrorLineKey, o as mirrorLocalId, q as initializeOwnedWorktree, f as summarizeSpawnSessionForLog, t as startAgentVersionChecks, W as WORKTREE_CAPABILITY_VERSION, u as currentWorktreeService } from './mirrorProtocol-
|
|
1
|
+
import { i as isClaudeSessionId, h as extractCompleteLines, j as decideBackfill, k as parseTerminalHookPayload, m as decideMirrorBinding, M as MIRROR_BACKFILL_LINES_DEFAULT, n as mirrorLineKey, o as mirrorLocalId, q as initializeOwnedWorktree, f as summarizeSpawnSessionForLog, t as startAgentVersionChecks, W as WORKTREE_CAPABILITY_VERSION, u as currentWorktreeService } from './mirrorProtocol-5aFYsCCe.mjs';
|
|
2
2
|
import { F as FS_MKDIR_CAPABILITY_VERSION } from './fsMkdir-DumgLTzR.mjs';
|
|
3
|
-
import { P as PI_ADAPTER_INSTALL_HINT, s as sanitizeSpawnModel } from './piRunnerArgs-
|
|
3
|
+
import { P as PI_ADAPTER_INSTALL_HINT, s as sanitizeSpawnModel } from './piRunnerArgs-CygWrAwY.mjs';
|
|
4
4
|
import fs from 'fs/promises';
|
|
5
5
|
import os from 'os';
|
|
6
6
|
import * as tmp from 'tmp';
|
|
7
7
|
import axios from 'axios';
|
|
8
|
+
import { a as issueRelaunchEnv } from './sessionMetadata-C1eoAi89.mjs';
|
|
8
9
|
import { readFileSync, openSync, fsyncSync, closeSync, renameSync, existsSync, readdirSync, statSync, unlinkSync, readSync, writeSync, ftruncateSync, utimesSync, realpathSync, promises, constants as constants$1, writeFileSync, mkdirSync, accessSync, rmdirSync } from 'node:fs';
|
|
9
10
|
import { join, isAbsolute, resolve, dirname, sep, basename, relative } from 'node:path';
|
|
10
|
-
import { f as ensurePrivateDirectorySync, w as writePrivateFileSync, c as configuration } from './configuration-
|
|
11
|
-
import { T as TurnActivityTracker, A as ApiClient } from './api-
|
|
12
|
-
import { S as SPAWN_AGENTS, i as isSpawnAgent, s as sanitizeSpawnPermissionMode, r as resolveSpawnPermissionMode, a as resolveFirstMessageMeta, j as joinProject } from './spawnAgents-
|
|
13
|
-
import { l as logger } from './logger-
|
|
14
|
-
import { p as pruneStaleCompileCaches } from './index-
|
|
15
|
-
import { a as authAndSetupMachineIfNeeded } from './auth-
|
|
11
|
+
import { f as ensurePrivateDirectorySync, w as writePrivateFileSync, c as configuration } from './configuration-CQaLZMa-.mjs';
|
|
12
|
+
import { T as TurnActivityTracker, A as ApiClient } from './api-Cu1OFHDM.mjs';
|
|
13
|
+
import { S as SPAWN_AGENTS, i as isSpawnAgent, s as sanitizeSpawnPermissionMode, r as resolveSpawnPermissionMode, a as resolveFirstMessageMeta, j as joinProject } from './spawnAgents-BclZYkov.mjs';
|
|
14
|
+
import { l as logger } from './logger-BEVIGYKL.mjs';
|
|
15
|
+
import { p as pruneStaleCompileCaches } from './index-BcYJJV-f.mjs';
|
|
16
|
+
import { a as authAndSetupMachineIfNeeded } from './auth-CgdE-j7z.mjs';
|
|
16
17
|
import { spawn, execSync } from 'child_process';
|
|
17
|
-
import { p as packageJson } from './package-
|
|
18
|
-
import { a as globalPrefixForPackage, N as NPM_SAFE_ARG, g as getEnvironmentInfo } from './doctor-
|
|
19
|
-
import { s as spawnHappyCLI } from './spawnHappyCLI-
|
|
20
|
-
import { c as readPersistedSessions, r as readSettings, l as latchKeepAwake, s as reportSignature, t as decideDaemonHibernation, v as nextCheckDelay, x as persistSession, d as readDaemonState, y as acquireDaemonLock, a as resolveCheckMs, z as resolveIdleMs, A as deletePersistedSessions, B as writeDaemonState, C as writeSettings, D as settingIdleMs, u as updateSettings, E as rewriteCredentialsForRelay, g as readCredentials,
|
|
21
|
-
import { i as isDaemonRunningCurrentlyInstalledHappyVersion, s as stopDaemon, w as cleanupDaemonState } from './controlClient-
|
|
22
|
-
import { e as sendUserMessage, f as readSessionMetadata, r as readSessionTranscript, l as listAccountSessions, a as listSessions, M as MAX_READ_LIMIT, s as sessionWebUrl, n as lineageOf, g as waitForSessionKey, d as archiveSession, h as analyzeLatestTurn, i as readSessionLog, j as TURN_WINDOW, p as userPromptText } from './sessionOps-
|
|
23
|
-
import {
|
|
18
|
+
import { p as packageJson } from './package-aOUtHYRZ.mjs';
|
|
19
|
+
import { a as globalPrefixForPackage, N as NPM_SAFE_ARG, g as getEnvironmentInfo } from './doctor-Wu0yZ80l.mjs';
|
|
20
|
+
import { s as spawnHappyCLI } from './spawnHappyCLI-BckHSjR0.mjs';
|
|
21
|
+
import { c as readPersistedSessions, r as readSettings, l as latchKeepAwake, s as reportSignature, t as decideDaemonHibernation, v as nextCheckDelay, x as persistSession, d as readDaemonState, y as acquireDaemonLock, a as resolveCheckMs, z as resolveIdleMs, A as deletePersistedSessions, B as writeDaemonState, C as writeSettings, D as settingIdleMs, u as updateSettings, E as readDaemonStatePidSync, F as rewriteCredentialsForRelay, g as readCredentials, G as releaseDaemonLock } from './persistence-EuUaQKL7.mjs';
|
|
22
|
+
import { i as isDaemonRunningCurrentlyInstalledHappyVersion, s as stopDaemon, w as cleanupDaemonState } from './controlClient-Cqhd8ynk.mjs';
|
|
23
|
+
import { e as sendUserMessage, f as readSessionMetadata, r as readSessionTranscript, l as listAccountSessions, a as listSessions, M as MAX_READ_LIMIT, s as sessionWebUrl, n as lineageOf, g as waitForSessionKey, d as archiveSession, h as analyzeLatestTurn, i as readSessionLog, j as TURN_WINDOW, p as userPromptText } from './sessionOps-CV5RUpwG.mjs';
|
|
24
|
+
import { a2 as AgentProfilesStateSchema, an as ServerMigrateNoticeSchema, ao as isHarnessInstallId, ap as agentProfileUnavailableReason, aq as MODEL_INTENT_CONFIG, q as AUTOMATION_SUMMARY_MAX_CHARS, ar as AUTOMATION_PRECHECK_OUTPUT_MAX_CHARS, as as AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS, d as AUTOMATION_PRECHECK_MAX_TIMEOUT_MS, at as AUTOMATION_CLAIM_MAX_RUNS, au as AUTOMATION_DAEMON_CAPABILITY_PRECHECK, av as AUTOMATION_DEFAULT_LEASE_MS, i as isAutomationRunTerminal, D as resolveLaunchAgentProfile, aw as ISSUE_SENT_FROM, ax as ISSUE_DISPATCH_LOCAL_ID_PREFIX, f as ISSUE_ASSIGNABLE_AGENTS, ay as HARNESS_INSTALL_CAPABILITY_VERSION } from './index-CiRMvS73.mjs';
|
|
24
25
|
import fastify from 'fastify';
|
|
25
26
|
import { z } from 'zod';
|
|
26
27
|
import { validatorCompiler, serializerCompiler } from 'fastify-type-provider-zod';
|
|
@@ -28,69 +29,69 @@ import { d as decodeBase64, s as sameRelay, e as encodeBase64, h as decrypt } fr
|
|
|
28
29
|
import { randomBytes, createHash, timingSafeEqual, randomUUID } from 'node:crypto';
|
|
29
30
|
import { c as checkPreviewPath } from './previewPath-CXN4Vag0.mjs';
|
|
30
31
|
import { a as BACKGROUND_TASKS_MAX, d as BACKGROUND_TASK_DESCRIPTION_MAX, e as BackgroundTaskTracker } from './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
31
|
-
import { b as sanitizeRateLimitReport } from './rateLimitWindows-
|
|
32
|
-
import { f as formatEditConflictNotice, b as SESSION_PEER_SENT_FROM, s as sendPeerMessage, l as listPeerSessions, C as CLI_PEER_SENDER_ID } from './peerTools-
|
|
32
|
+
import { b as sanitizeRateLimitReport } from './rateLimitWindows-hv2zLYid.mjs';
|
|
33
|
+
import { f as formatEditConflictNotice, b as SESSION_PEER_SENT_FROM, s as sendPeerMessage, l as listPeerSessions, C as CLI_PEER_SENDER_ID } from './peerTools-BkRgJomj.mjs';
|
|
33
34
|
import os$1, { hostname, homedir, tmpdir } from 'node:os';
|
|
34
|
-
import { c as RemoteCallBudget, e as REMOTE_WRITE_CALLS_PER_MINUTE, d as deliverToSession, g as guardRemoteSessionOpsRequest, h as remoteError, i as REMOTE_OP_DEADLINE_MS, j as formatRemoteAuditLine, k as REMOTE_SEND_COMMIT_DEADLINE_MS, m as REMOTE_RESUME_WAIT_MS, n as capRemoteTranscript, o as capRemoteText, p as REMOTE_ANSWER_MAX_BYTES, q as REMOTE_TITLE_MAX_BYTES } from './remoteSessionClient-
|
|
35
|
-
import { assistantHome, bootstrapAssistantHome } from './bootstrap-
|
|
36
|
-
import { refreshAgentHomes, locateClaudeConversation, agentHomeSpawnEnv } from './index-
|
|
35
|
+
import { c as RemoteCallBudget, e as REMOTE_WRITE_CALLS_PER_MINUTE, d as deliverToSession, g as guardRemoteSessionOpsRequest, h as remoteError, i as REMOTE_OP_DEADLINE_MS, j as formatRemoteAuditLine, k as REMOTE_SEND_COMMIT_DEADLINE_MS, m as REMOTE_RESUME_WAIT_MS, n as capRemoteTranscript, o as capRemoteText, p as REMOTE_ANSWER_MAX_BYTES, q as REMOTE_TITLE_MAX_BYTES } from './remoteSessionClient-CzjLyL9c.mjs';
|
|
36
|
+
import { assistantHome, bootstrapAssistantHome } from './bootstrap-BTYJf2w8.mjs';
|
|
37
|
+
import { refreshAgentHomes, locateClaudeConversation, agentHomeSpawnEnv } from './index-fNsf-8K-.mjs';
|
|
37
38
|
import require$$0, { existsSync as existsSync$1, statSync as statSync$1, mkdtempSync, rmSync } from 'fs';
|
|
38
39
|
import require$$1, { join as join$1 } from 'path';
|
|
39
40
|
import { spawn as spawn$1, execFile, spawnSync } from 'node:child_process';
|
|
40
41
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
41
42
|
import { d as daemonEndpointsMatch, r as resolveClaudeCredentialReadiness } from './doctorReadiness-C208SMN9.mjs';
|
|
42
|
-
import { o as ownerRetryPending, c as consumeOwnerRetry, s as spawnGate, a as afterStartupFailure, b as startupFailureMessage, T as TEAM_SPAWN_MAX_ATTEMPTS, d as TEAM_CLEANUP_RETRY_MS, g as getInitialMachineMetadata, e as getStartupCliAvailability, f as TEAM_RETRY_CAPABILITY_VERSION, w as withRunningCliFacts } from './machineMetadata-
|
|
43
|
+
import { o as ownerRetryPending, c as consumeOwnerRetry, s as spawnGate, a as afterStartupFailure, b as startupFailureMessage, T as TEAM_SPAWN_MAX_ATTEMPTS, d as TEAM_CLEANUP_RETRY_MS, g as getInitialMachineMetadata, e as getStartupCliAvailability, f as TEAM_RETRY_CAPABILITY_VERSION, w as withRunningCliFacts } from './machineMetadata-BQdp_ihk.mjs';
|
|
43
44
|
import { M as ModelConfigError, B as BackupStore, r as readConfigFile, s as sha256, a as atomicWriteFile } from './fileStore-5qpetZS0.mjs';
|
|
44
45
|
import { c as collectSecretValues, a as parseJsonObject, b as childObject, s as setOrDelete, d as changedPaths, e as stringifyLike, f as fail, n as normalizeModelList, g as normalizeModelId, h as normalizeSecret, i as normalizeBaseUrl, u as uniq, j as baseUrlWarnings, m as maskSecret, k as getPath$1, l as normalizeProviderId, o as piAdapter, r as redactText } from './pi-CqyoZMjI.mjs';
|
|
45
|
-
import { p as parse } from './codexAccount-
|
|
46
|
+
import { p as parse } from './codexAccount-CieIQLOX.mjs';
|
|
46
47
|
import require$$3 from 'crypto';
|
|
47
48
|
import { c as commandOnPath } from './detectCLI-CSGMlV51.mjs';
|
|
48
|
-
import { buildResumeLaunch } from './handleResumeCommand-
|
|
49
|
+
import { buildResumeLaunch } from './handleResumeCommand-DrJdhjLD.mjs';
|
|
49
50
|
import { n as normalizeWebPanels } from './webPanels-B2_C2-3g.mjs';
|
|
50
51
|
import { access, symlink, readFile, rm, unlink, readlink, lstat, constants, rename, mkdir, copyFile, readdir, stat, open } from 'node:fs/promises';
|
|
51
52
|
import { p as parseExactVersion, c as compareExactVersions, f as fetchCliUpdateState, r as resolveCliUpdateCheckInterval, D as DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS } from './cliUpdate-Y34VGe9Y.mjs';
|
|
52
|
-
import { P as ProjectsUnsupportedError, c as createProjectsClient } from './client-
|
|
53
|
-
import { d as wrapperReportsIdle, f as decideAutoRestart, s as statusFromVerdict, g as autoRestartNextCheck, h as wrapperStaleness, r as recordAttempt, i as AUTO_RESTART_MAX_ATTEMPTS, j as AUTO_RESTART_MIN_GAP_MS, p as processIdentityFields, k as readSessionLock, l as AUTO_RESTARTED_ENV, n as encodeAutoRestarted, o as pendingUpgradeVersion, q as resolveQuietMs, u as AUTO_RESTART_RECHECK_CAP_MS } from './sessionLock-
|
|
54
|
-
import { c as createAutomationsClient, i as isAutomationsUnavailable, d as AutomationsRequestError } from './client-
|
|
53
|
+
import { P as ProjectsUnsupportedError, c as createProjectsClient } from './client-DfT_CRwl.mjs';
|
|
54
|
+
import { d as wrapperReportsIdle, f as decideAutoRestart, s as statusFromVerdict, g as autoRestartNextCheck, h as wrapperStaleness, r as recordAttempt, i as AUTO_RESTART_MAX_ATTEMPTS, j as AUTO_RESTART_MIN_GAP_MS, p as processIdentityFields, k as readSessionLock, l as AUTO_RESTARTED_ENV, n as encodeAutoRestarted, o as pendingUpgradeVersion, q as resolveQuietMs, u as AUTO_RESTART_RECHECK_CAP_MS } from './sessionLock-CVjlaRSL.mjs';
|
|
55
|
+
import { c as createAutomationsClient, i as isAutomationsUnavailable, d as AutomationsRequestError } from './client-D0oBXuEe.mjs';
|
|
55
56
|
import { w as withKeychainOffPath, a as keychainIdentityFor, i as interpretSecurityRead, s as securityReadArgs, b as securityDeleteArgs, c as keychainOffShimDir, d as interpretCredentialsFile, C as CREDENTIALS_REJECTED_DETAIL, e as buildClaudeAuthState, f as claudeAuthStateChanged, r as resolveSdkClaudeBinary, g as classifyAuthStatus, h as diagnoseStores, p as parseLaunchctlPid, H as HAPPY_DAEMON_LAUNCHD_LABEL, j as classifyLineage, l as probeLaunchdJob, m as detectDaemonSupervisor, n as daemonLineage, o as probeSystemdKillMode, q as wrappersSurviveHandover, t as handoverWaitsForSessions } from './daemonSupervisor-BxohggqN.mjs';
|
|
56
|
-
import { A as AccountService } from './accountService-
|
|
57
|
-
import { spawnSetupTokenPty, watchAccountFiles } from './daemonAccounts-
|
|
57
|
+
import { A as AccountService } from './accountService-DEpIq6CF.mjs';
|
|
58
|
+
import { spawnSetupTokenPty, watchAccountFiles } from './daemonAccounts-D5shoCLt.mjs';
|
|
58
59
|
import { g as getProjectPath } from './path-D2wdaNSk.mjs';
|
|
59
60
|
import { b as extractClaudeEditPaths } from './editPaths-BVfS_FFL.mjs';
|
|
60
|
-
import { s as startFileWatcher } from './startFileWatcher-
|
|
61
|
-
import { I as InvalidateSync } from './sync-
|
|
61
|
+
import { s as startFileWatcher } from './startFileWatcher-BXiBlfVr.mjs';
|
|
62
|
+
import { I as InvalidateSync } from './sync-BfM5OKSS.mjs';
|
|
62
63
|
import { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
|
|
63
64
|
import { t as tmuxArgs, a as scrubTmuxClientEnv, s as shellescape } from './tmuxSocket-BmZyixRM.mjs';
|
|
64
65
|
import { i as isProcessAlive, t as terminateProcessTree } from './processTermination-ChJG5SLW.mjs';
|
|
65
66
|
import { findAllHappyProcesses } from './doctor-GN5mPOn5.mjs';
|
|
66
67
|
import { T as TEAM_SKILL, a as TEAM_LEAD_PLAYBOOK, b as TEAM_MEMBER_RULES } from './resources-CLP_MpK4.mjs';
|
|
67
68
|
import { promisify } from 'node:util';
|
|
68
|
-
import { b as clipText, r as renderAction, c as clipAutomationReport, e as renderTemplate } from './template-
|
|
69
|
-
import { I as IssuesUnsupportedError, a as IssueRequestError, c as createIssuesClient } from './client-
|
|
69
|
+
import { b as clipText, r as renderAction, c as clipAutomationReport, e as renderTemplate } from './template-CtRLg2PG.mjs';
|
|
70
|
+
import { I as IssuesUnsupportedError, a as IssueRequestError, c as createIssuesClient } from './client-Cj7D61by.mjs';
|
|
70
71
|
import { d as describeAgentHome } from './loginShellEnv-Dw8M7tkI.mjs';
|
|
71
|
-
import { S as SPAWN_ACCOUNT_ENV } from './store-
|
|
72
|
-
import './acpSessionResume-
|
|
73
|
-
import './pushNotifications-
|
|
72
|
+
import { S as SPAWN_ACCOUNT_ENV } from './store-DWmjM4Ex.mjs';
|
|
73
|
+
import './acpSessionResume-BKjQRT4V.mjs';
|
|
74
|
+
import './pushNotifications-B7Ga8Zyf.mjs';
|
|
74
75
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
75
|
-
import './reconnectGate-
|
|
76
|
+
import './reconnectGate-DO_ZQmJE.mjs';
|
|
76
77
|
import 'node:events';
|
|
77
78
|
import 'socket.io-client';
|
|
78
79
|
import './limits-DIo7rEBR.mjs';
|
|
79
|
-
import './time-
|
|
80
|
-
import './registerCommonHandlers-
|
|
80
|
+
import './time-BQWf06hA.mjs';
|
|
81
|
+
import './registerCommonHandlers-BEpK4WD2.mjs';
|
|
81
82
|
import 'util';
|
|
82
83
|
import 'cross-spawn';
|
|
83
84
|
import '@paralleldrive/cuid2';
|
|
84
85
|
import 'chalk';
|
|
85
86
|
import 'node:module';
|
|
86
87
|
import 'tweetnacl';
|
|
87
|
-
import './browser-
|
|
88
|
+
import './browser-Dx3UOVPP.mjs';
|
|
88
89
|
import 'open';
|
|
89
90
|
import './specialCommands-MXUN0wfI.mjs';
|
|
90
91
|
import './ids-DU6sLx4C.mjs';
|
|
91
92
|
import 'url';
|
|
92
|
-
import './localHappyAgentAuth-
|
|
93
|
-
import './claudeAccountEnv-
|
|
93
|
+
import './localHappyAgentAuth-BUX4E1ug.mjs';
|
|
94
|
+
import './claudeAccountEnv-DowsOlDB.mjs';
|
|
94
95
|
import 'node:readline';
|
|
95
96
|
import 'node-pty';
|
|
96
97
|
import './processTreeSnapshot-fuwxC0fr.mjs';
|
|
@@ -3893,8 +3894,9 @@ function createUpdateController(deps) {
|
|
|
3893
3894
|
outcome = { state, version, detail, at: now(), ...manualVersion ? { source: "manual" } : {} };
|
|
3894
3895
|
deps.publish(snapshot());
|
|
3895
3896
|
}
|
|
3897
|
+
const superseded = () => !!deps.owned && !deps.owned();
|
|
3896
3898
|
async function evaluate() {
|
|
3897
|
-
if (!policy || running) return;
|
|
3899
|
+
if (!policy || running || superseded()) return;
|
|
3898
3900
|
const target = manualVersion ?? policy.autoUpdateVersion ?? null;
|
|
3899
3901
|
if (outcome?.version === target && ["failed", "installed", "manual_required"].includes(outcome.state)) {
|
|
3900
3902
|
const fingerprint = JSON.stringify([policy.checkedAt, outcome.state, outcome.version, outcome.detail, manualVersion, autoUpdateEnabled]);
|
|
@@ -3986,19 +3988,23 @@ function createUpdateController(deps) {
|
|
|
3986
3988
|
}
|
|
3987
3989
|
}
|
|
3988
3990
|
async function refresh() {
|
|
3989
|
-
if (
|
|
3991
|
+
if (superseded()) return "superseded";
|
|
3992
|
+
if (blocked) return "blocked";
|
|
3993
|
+
if (operation) return "busy";
|
|
3990
3994
|
operation = "refresh";
|
|
3991
3995
|
try {
|
|
3992
3996
|
const next = await deps.policy();
|
|
3993
|
-
if (!next) return;
|
|
3997
|
+
if (!next) return "unavailable";
|
|
3994
3998
|
if (manualVersion && !validManualTarget(next, manualVersion)) manualVersion = null;
|
|
3995
3999
|
policy = next;
|
|
3996
4000
|
await evaluate();
|
|
4001
|
+
return policyStale() ? "stale" : "ok";
|
|
3997
4002
|
} finally {
|
|
3998
4003
|
operation = null;
|
|
3999
4004
|
}
|
|
4000
4005
|
}
|
|
4001
4006
|
async function retry(version) {
|
|
4007
|
+
if (superseded()) return { error: "daemon_superseded" };
|
|
4002
4008
|
if (operation || blocked) return { error: blocked ? "manual_recovery_required" : "update_in_progress" };
|
|
4003
4009
|
if (typeof version !== "string" || outcome?.state !== "failed" || outcome.version !== version) {
|
|
4004
4010
|
return { error: "no_matching_failed_update" };
|
|
@@ -4023,6 +4029,7 @@ function createUpdateController(deps) {
|
|
|
4023
4029
|
}
|
|
4024
4030
|
}
|
|
4025
4031
|
async function request(version) {
|
|
4032
|
+
if (superseded()) return { error: "daemon_superseded" };
|
|
4026
4033
|
if (operation || blocked) return { error: blocked ? "manual_recovery_required" : "update_in_progress" };
|
|
4027
4034
|
operation = "request";
|
|
4028
4035
|
try {
|
|
@@ -4066,7 +4073,8 @@ function createUpdateController(deps) {
|
|
|
4066
4073
|
handoverHold = { reason, at: now() };
|
|
4067
4074
|
publish("failed", manualVersion ?? policy?.autoUpdateVersion ?? null, "handover_preflight_failed");
|
|
4068
4075
|
}
|
|
4069
|
-
|
|
4076
|
+
const policyStale = () => !policy || now() - policy.checkedAt > 65 * 6e4;
|
|
4077
|
+
return { refresh, retry, request, tick, withHandover, holdHandover, policyStale, isRunning: () => running, currentTarget: () => policy?.autoUpdateVersion ?? null };
|
|
4070
4078
|
}
|
|
4071
4079
|
|
|
4072
4080
|
const defaults = {
|
|
@@ -4275,6 +4283,132 @@ function createPolicyAnnouncementHandler(deps) {
|
|
|
4275
4283
|
};
|
|
4276
4284
|
}
|
|
4277
4285
|
|
|
4286
|
+
const POLICY_REFRESH_MIN_INTERVAL_MS = 5 * 6e4;
|
|
4287
|
+
const POLICY_REFRESH_RETRY_MS = 3e4;
|
|
4288
|
+
const POLICY_REFRESH_MAX_BACKOFF_MS = 30 * 6e4;
|
|
4289
|
+
const WAKE_GAP_SLACK_MS = 2 * 6e4;
|
|
4290
|
+
function createPolicyRefreshTrigger(deps) {
|
|
4291
|
+
const now = deps.now ?? Date.now;
|
|
4292
|
+
const minIntervalMs = deps.minIntervalMs ?? POLICY_REFRESH_MIN_INTERVAL_MS;
|
|
4293
|
+
const retryMs = deps.retryMs ?? POLICY_REFRESH_RETRY_MS;
|
|
4294
|
+
const maxBackoffMs = deps.maxBackoffMs ?? POLICY_REFRESH_MAX_BACKOFF_MS;
|
|
4295
|
+
const setTimer = deps.setTimer ?? ((fn, ms) => {
|
|
4296
|
+
const t = setTimeout(fn, ms);
|
|
4297
|
+
t.unref?.();
|
|
4298
|
+
return t;
|
|
4299
|
+
});
|
|
4300
|
+
const clearTimer = deps.clearTimer ?? ((handle) => clearTimeout(handle));
|
|
4301
|
+
const log = (message, level) => deps.log?.(message, level);
|
|
4302
|
+
let lastSuccessAt = null;
|
|
4303
|
+
let lastAttemptAt = null;
|
|
4304
|
+
let lastBypassAt = null;
|
|
4305
|
+
let failures = 0;
|
|
4306
|
+
let inFlight = false;
|
|
4307
|
+
let timer = null;
|
|
4308
|
+
let stopped = false;
|
|
4309
|
+
const backoff = (n) => n <= 0 ? retryMs : Math.min(retryMs * 2 ** (n - 1), maxBackoffMs);
|
|
4310
|
+
function earliestRun(reason) {
|
|
4311
|
+
const windowEnd = lastSuccessAt === null ? 0 : lastSuccessAt + minIntervalMs;
|
|
4312
|
+
const retryAt = lastAttemptAt === null ? 0 : lastAttemptAt + backoff(failures);
|
|
4313
|
+
if (retryAt <= Math.max(windowEnd, now())) return { at: windowEnd, bypass: false };
|
|
4314
|
+
const mayBypass = (reason === "connect" || reason === "wake") && (lastBypassAt === null || now() - lastBypassAt >= minIntervalMs);
|
|
4315
|
+
return mayBypass ? { at: windowEnd, bypass: true } : { at: retryAt, bypass: false };
|
|
4316
|
+
}
|
|
4317
|
+
function defer(ms) {
|
|
4318
|
+
if (timer !== null) return;
|
|
4319
|
+
timer = setTimer(() => {
|
|
4320
|
+
timer = null;
|
|
4321
|
+
request("scheduled");
|
|
4322
|
+
}, Math.max(0, ms));
|
|
4323
|
+
}
|
|
4324
|
+
function run(reason) {
|
|
4325
|
+
inFlight = true;
|
|
4326
|
+
lastAttemptAt = now();
|
|
4327
|
+
log(`CLI update policy refresh (${reason})`, failures === 0 ? "warn" : "debug");
|
|
4328
|
+
void deps.refresh().catch(() => "unavailable").then((result) => {
|
|
4329
|
+
inFlight = false;
|
|
4330
|
+
if (result === "superseded") {
|
|
4331
|
+
stop();
|
|
4332
|
+
return;
|
|
4333
|
+
}
|
|
4334
|
+
if (result === "ok") {
|
|
4335
|
+
if (failures > 0) log(`CLI update policy refresh recovered after ${failures} failed attempt(s)`, "warn");
|
|
4336
|
+
lastSuccessAt = now();
|
|
4337
|
+
failures = 0;
|
|
4338
|
+
return;
|
|
4339
|
+
}
|
|
4340
|
+
if (result === "busy") lastAttemptAt = now();
|
|
4341
|
+
else {
|
|
4342
|
+
if (result === "stale") lastSuccessAt = now();
|
|
4343
|
+
failures += 1;
|
|
4344
|
+
const stepUp = failures === 1 || backoff(failures) > backoff(failures - 1);
|
|
4345
|
+
const next = result === "blocked" ? "waiting for the next connect / wake / hourly check" : `next try in ${Math.round(backoff(failures) / 1e3)}s`;
|
|
4346
|
+
log(`CLI update policy refresh (${reason}) read no fresh policy (${result}, ${failures} in a row); ${next}`, stepUp ? "warn" : "debug");
|
|
4347
|
+
}
|
|
4348
|
+
if (stopped || result === "blocked") return;
|
|
4349
|
+
defer(earliestRun("scheduled").at - now());
|
|
4350
|
+
});
|
|
4351
|
+
}
|
|
4352
|
+
function request(reason) {
|
|
4353
|
+
if (stopped) return "stopped";
|
|
4354
|
+
if (inFlight) return "in-flight";
|
|
4355
|
+
const { at, bypass } = earliestRun(reason);
|
|
4356
|
+
const wait = at - now();
|
|
4357
|
+
if (wait > 0) {
|
|
4358
|
+
defer(wait);
|
|
4359
|
+
return "deferred";
|
|
4360
|
+
}
|
|
4361
|
+
if (bypass) lastBypassAt = now();
|
|
4362
|
+
if (timer !== null) {
|
|
4363
|
+
clearTimer(timer);
|
|
4364
|
+
timer = null;
|
|
4365
|
+
}
|
|
4366
|
+
run(reason);
|
|
4367
|
+
return "run";
|
|
4368
|
+
}
|
|
4369
|
+
function stop() {
|
|
4370
|
+
stopped = true;
|
|
4371
|
+
if (timer !== null) clearTimer(timer);
|
|
4372
|
+
timer = null;
|
|
4373
|
+
}
|
|
4374
|
+
return {
|
|
4375
|
+
request,
|
|
4376
|
+
/** Any other refresh (startup, hourly, announcement) that read a policy restarts the window (and a fresh one ends the backoff); one that found us superseded stops it. */
|
|
4377
|
+
noteRefreshed(result) {
|
|
4378
|
+
if (result === "ok" || result === "stale") lastSuccessAt = now();
|
|
4379
|
+
if (result === "ok") failures = 0;
|
|
4380
|
+
else if (result === "superseded") stop();
|
|
4381
|
+
},
|
|
4382
|
+
stop
|
|
4383
|
+
};
|
|
4384
|
+
}
|
|
4385
|
+
function createWakeDetector(intervalMs, now = Date.now, slackMs = WAKE_GAP_SLACK_MS) {
|
|
4386
|
+
let last = null;
|
|
4387
|
+
return {
|
|
4388
|
+
/** Call once per heartbeat; true when the process was just suspended. */
|
|
4389
|
+
beat() {
|
|
4390
|
+
const at = now();
|
|
4391
|
+
const woke = last !== null && at - last > intervalMs + slackMs;
|
|
4392
|
+
last = at;
|
|
4393
|
+
return woke;
|
|
4394
|
+
}
|
|
4395
|
+
};
|
|
4396
|
+
}
|
|
4397
|
+
|
|
4398
|
+
function createDaemonOwnership(deps) {
|
|
4399
|
+
let superseded = false;
|
|
4400
|
+
return {
|
|
4401
|
+
owns() {
|
|
4402
|
+
if (superseded) return false;
|
|
4403
|
+
const ownerPid = deps.statePid();
|
|
4404
|
+
if (ownerPid === null || ownerPid === deps.pid) return true;
|
|
4405
|
+
superseded = true;
|
|
4406
|
+
deps.onSuperseded(ownerPid);
|
|
4407
|
+
return false;
|
|
4408
|
+
}
|
|
4409
|
+
};
|
|
4410
|
+
}
|
|
4411
|
+
|
|
4278
4412
|
const HARNESS_INSTALL_CATALOG = Object.freeze({
|
|
4279
4413
|
claude: Object.freeze({ packages: [{ name: "@anthropic-ai/claude-code", spec: "latest" }], commands: ["claude"], minNode: "22.0.0", scripts: true }),
|
|
4280
4414
|
codex: Object.freeze({ packages: [{ name: "@openai/codex", spec: "latest" }], commands: ["codex"], minNode: "16.0.0", scripts: false }),
|
|
@@ -7053,6 +7187,7 @@ function listIssueReceipts(home, now = Date.now()) {
|
|
|
7053
7187
|
|
|
7054
7188
|
const ISSUE_POLL_MS = 5e3;
|
|
7055
7189
|
const ISSUE_SPAWNED_BY = "issue";
|
|
7190
|
+
const ISSUE_SPAWN_UNKNOWN_GRACE_MS = 6e4;
|
|
7056
7191
|
const FIRST_MESSAGE_KEY_WAIT_MS = 1e4;
|
|
7057
7192
|
function issueKeyFromPrompt(prompt) {
|
|
7058
7193
|
return /^You are assigned issue ([A-Z]+-\d{1,9}):/.exec(prompt)?.[1] ?? null;
|
|
@@ -7104,10 +7239,35 @@ function createIssueWorker(deps) {
|
|
|
7104
7239
|
writeIssueReceipt(home, receipt);
|
|
7105
7240
|
return receipt;
|
|
7106
7241
|
};
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7242
|
+
const now = deps.now ?? Date.now;
|
|
7243
|
+
const unknownSpawns = /* @__PURE__ */ new Map();
|
|
7244
|
+
async function fail(receipt, error) {
|
|
7245
|
+
await client.fail(receipt.dispatchId, { machineId: deps.machineId, claimId: receipt.claimId, error: error.slice(0, 4e3) });
|
|
7246
|
+
save({ ...receipt, phase: "failed" });
|
|
7247
|
+
deps.log(`Issue dispatch ${receipt.dispatchId} failed`);
|
|
7248
|
+
}
|
|
7249
|
+
function holdUnknown(view, receipt, reason) {
|
|
7250
|
+
const held = unknownSpawns.get(view.id);
|
|
7251
|
+
unknownSpawns.set(view.id, { view, receipt, reason, deadline: held?.deadline ?? now() + ISSUE_SPAWN_UNKNOWN_GRACE_MS });
|
|
7252
|
+
deps.log(`Issue dispatch ${view.id} spawn outcome unknown; re-checking`);
|
|
7253
|
+
}
|
|
7254
|
+
async function recheckUnknown() {
|
|
7255
|
+
for (const [id, held] of [...unknownSpawns]) {
|
|
7256
|
+
if (closed) return;
|
|
7257
|
+
const matches = persistedRunSessions(held.view.runId);
|
|
7258
|
+
try {
|
|
7259
|
+
if (matches.length === 1) {
|
|
7260
|
+
unknownSpawns.delete(id);
|
|
7261
|
+
await afterSpawn(held.view, save({ ...held.receipt, sessionId: matches[0], phase: "spawned" }));
|
|
7262
|
+
} else if (matches.length > 1 || now() >= held.deadline) {
|
|
7263
|
+
unknownSpawns.delete(id);
|
|
7264
|
+
await fail(held.receipt, matches.length > 1 ? `Spawn produced ${matches.length} sessions for this run; stop the extra ones and retry` : `Session did not start within ${Math.round(ISSUE_SPAWN_UNKNOWN_GRACE_MS / 1e3)} s (${held.reason}); check the machine before retrying`);
|
|
7265
|
+
}
|
|
7266
|
+
} catch (error) {
|
|
7267
|
+
if (httpCode(error) === "issue_dispatch_claim_mismatch" || error instanceof IssuesUnsupportedError) unknownSpawns.delete(id);
|
|
7268
|
+
deps.log(`Issue dispatch ${id} remains pending${error instanceof IssueRequestError && error.code ? ` (${error.code})` : ""}`);
|
|
7269
|
+
}
|
|
7270
|
+
}
|
|
7111
7271
|
}
|
|
7112
7272
|
async function complete(receipt) {
|
|
7113
7273
|
let lastError;
|
|
@@ -7166,7 +7326,7 @@ function createIssueWorker(deps) {
|
|
|
7166
7326
|
await fail({ ...receipt, phase: "claimed" }, accountUnavailableError(spawned.errorMessage, "issue") ?? spawned.errorMessage);
|
|
7167
7327
|
return;
|
|
7168
7328
|
}
|
|
7169
|
-
if (spawned.type === "error" && spawned.startupExit?.exited) {
|
|
7329
|
+
if (spawned.type === "error" && (spawned.startupExit?.exited || spawned.notStarted)) {
|
|
7170
7330
|
await fail(receipt, `Session failed to start: ${spawned.errorMessage}`);
|
|
7171
7331
|
return;
|
|
7172
7332
|
}
|
|
@@ -7177,25 +7337,36 @@ function createIssueWorker(deps) {
|
|
|
7177
7337
|
if (spawned.type !== "success") {
|
|
7178
7338
|
const matches = persistedRunSessions(view.runId);
|
|
7179
7339
|
if (matches.length !== 1) {
|
|
7180
|
-
|
|
7340
|
+
holdUnknown(view, receipt, spawned.errorMessage);
|
|
7181
7341
|
return;
|
|
7182
7342
|
}
|
|
7183
7343
|
receipt = save({ ...receipt, sessionId: matches[0], phase: "spawned" });
|
|
7184
7344
|
} else {
|
|
7185
7345
|
receipt = save({ ...receipt, sessionId: spawned.sessionId, phase: "spawned" });
|
|
7186
7346
|
}
|
|
7187
|
-
|
|
7188
|
-
if (spawn.projectId && deps.joinProject) await deps.joinProject(receipt.sessionId, spawn.projectId).catch(() => void 0);
|
|
7189
|
-
}
|
|
7190
|
-
if (receipt.phase === "spawning") {
|
|
7347
|
+
} else if (receipt.phase === "spawning") {
|
|
7191
7348
|
const matches = persistedRunSessions(view.runId);
|
|
7192
7349
|
if (matches.length !== 1) {
|
|
7193
|
-
|
|
7350
|
+
holdUnknown(view, receipt, "the spawn was interrupted by a daemon restart");
|
|
7194
7351
|
return;
|
|
7195
7352
|
}
|
|
7196
7353
|
receipt = save({ ...receipt, sessionId: matches[0], phase: "spawned" });
|
|
7197
|
-
|
|
7354
|
+
} else {
|
|
7355
|
+
if (receipt.sessionId && !receipt.ended) runBySession.set(receipt.sessionId, view.runId);
|
|
7356
|
+
await deliverAndComplete(view, receipt);
|
|
7357
|
+
return;
|
|
7198
7358
|
}
|
|
7359
|
+
await afterSpawn(view, receipt);
|
|
7360
|
+
}
|
|
7361
|
+
async function afterSpawn(view, receipt) {
|
|
7362
|
+
runBySession.set(receipt.sessionId, view.runId);
|
|
7363
|
+
const projectId = view.spawn?.projectId;
|
|
7364
|
+
if (projectId && deps.joinProject) await deps.joinProject(receipt.sessionId, projectId).catch(() => void 0);
|
|
7365
|
+
await deliverAndComplete(view, receipt);
|
|
7366
|
+
}
|
|
7367
|
+
async function deliverAndComplete(view, receipt) {
|
|
7368
|
+
const spawn = view.spawn;
|
|
7369
|
+
const agent = spawn.agent;
|
|
7199
7370
|
if (receipt.phase === "spawned") {
|
|
7200
7371
|
const sessionId = receipt.sessionId;
|
|
7201
7372
|
const mode = sanitizeSpawnPermissionMode(spawn.permissionMode ?? void 0);
|
|
@@ -7286,6 +7457,7 @@ function createIssueWorker(deps) {
|
|
|
7286
7457
|
if (running || closed || Date.now() < retryAt) return;
|
|
7287
7458
|
running = true;
|
|
7288
7459
|
try {
|
|
7460
|
+
await recheckUnknown();
|
|
7289
7461
|
let dispatches;
|
|
7290
7462
|
try {
|
|
7291
7463
|
dispatches = (await client.poll(deps.machineId)).dispatches ?? [];
|
|
@@ -7767,7 +7939,8 @@ async function startDaemon() {
|
|
|
7767
7939
|
logger.debug(`[DAEMON RUN] Directory creation failed: ${errorMessage}`);
|
|
7768
7940
|
return {
|
|
7769
7941
|
type: "error",
|
|
7770
|
-
errorMessage
|
|
7942
|
+
errorMessage,
|
|
7943
|
+
notStarted: true
|
|
7771
7944
|
};
|
|
7772
7945
|
}
|
|
7773
7946
|
}
|
|
@@ -7826,11 +7999,11 @@ async function startDaemon() {
|
|
|
7826
7999
|
const requested = forkSpawnAccount(options.agentProfileId, options.parentSessionId, (id) => accountServiceRef.sessionAccount(id));
|
|
7827
8000
|
spawnAccountId = accountServiceRef.resolveSpawnAccount(accountAgent, requested);
|
|
7828
8001
|
} catch (error) {
|
|
7829
|
-
return { type: "error", errorMessage: error instanceof Error ? error.message : String(error) };
|
|
8002
|
+
return { type: "error", errorMessage: error instanceof Error ? error.message : String(error), notStarted: true };
|
|
7830
8003
|
}
|
|
7831
8004
|
if (spawnAccountId) extraEnv[SPAWN_ACCOUNT_ENV] = spawnAccountId;
|
|
7832
8005
|
} else if (options.agentProfileId) {
|
|
7833
|
-
return { type: "error", errorMessage: `agent-profile-unavailable:agent-mismatch: accounts are not supported for ${options.agent} yet
|
|
8006
|
+
return { type: "error", errorMessage: `agent-profile-unavailable:agent-mismatch: accounts are not supported for ${options.agent} yet`, notStarted: true };
|
|
7834
8007
|
}
|
|
7835
8008
|
const claudeAuthStatus = claudeAuthServiceRef?.current()?.status;
|
|
7836
8009
|
if ((options.agent ?? "claude") === "claude" && claudeAuthStatus && !spawnAccountId) {
|
|
@@ -7857,7 +8030,8 @@ async function startDaemon() {
|
|
|
7857
8030
|
logger.warn(`[DAEMON RUN] ${errorMessage}`);
|
|
7858
8031
|
return {
|
|
7859
8032
|
type: "error",
|
|
7860
|
-
errorMessage
|
|
8033
|
+
errorMessage,
|
|
8034
|
+
notStarted: true
|
|
7861
8035
|
};
|
|
7862
8036
|
}
|
|
7863
8037
|
let tmuxSessionName = extraEnv.TMUX_SESSION_NAME;
|
|
@@ -7878,7 +8052,8 @@ async function startDaemon() {
|
|
|
7878
8052
|
if (!isSpawnAgent(agent)) {
|
|
7879
8053
|
return {
|
|
7880
8054
|
type: "error",
|
|
7881
|
-
errorMessage: `Unsupported agent type: '${options.agent}'. Please update your CLI to the latest version
|
|
8055
|
+
errorMessage: `Unsupported agent type: '${options.agent}'. Please update your CLI to the latest version.`,
|
|
8056
|
+
notStarted: true
|
|
7882
8057
|
};
|
|
7883
8058
|
}
|
|
7884
8059
|
const resumeId = agent === "claude" ? options.resumeClaudeSessionId : agent === "codex" ? options.resumeCodexThreadId : void 0;
|
|
@@ -7964,7 +8139,8 @@ async function startDaemon() {
|
|
|
7964
8139
|
default:
|
|
7965
8140
|
return {
|
|
7966
8141
|
type: "error",
|
|
7967
|
-
errorMessage: `Unsupported agent type: '${options.agent}'. Please update your CLI to the latest version
|
|
8142
|
+
errorMessage: `Unsupported agent type: '${options.agent}'. Please update your CLI to the latest version.`,
|
|
8143
|
+
notStarted: true
|
|
7968
8144
|
};
|
|
7969
8145
|
}
|
|
7970
8146
|
const args = [
|
|
@@ -8034,7 +8210,8 @@ async function startDaemon() {
|
|
|
8034
8210
|
logger.debug("[DAEMON RUN] Failed to spawn process - no PID returned");
|
|
8035
8211
|
return Promise.resolve({
|
|
8036
8212
|
type: "error",
|
|
8037
|
-
errorMessage: "Failed to spawn Happy process - no PID returned"
|
|
8213
|
+
errorMessage: "Failed to spawn Happy process - no PID returned",
|
|
8214
|
+
notStarted: true
|
|
8038
8215
|
});
|
|
8039
8216
|
}
|
|
8040
8217
|
timer?.mark("spawned");
|
|
@@ -8260,7 +8437,9 @@ async function startDaemon() {
|
|
|
8260
8437
|
HAPPY_RECONNECT_SEQ: String(tracked.encryption.seq),
|
|
8261
8438
|
HAPPY_RECONNECT_METADATA_VERSION: String(tracked.encryption.metadataVersion),
|
|
8262
8439
|
HAPPY_RECONNECT_AGENT_STATE_VERSION: String(tracked.encryption.agentStateVersion),
|
|
8263
|
-
...teamEnv
|
|
8440
|
+
...teamEnv,
|
|
8441
|
+
// B-874c: an issue run's binding rides every relaunch (digest, MCP context).
|
|
8442
|
+
...issueRelaunchEnv(metadata)
|
|
8264
8443
|
}
|
|
8265
8444
|
});
|
|
8266
8445
|
if (result.type === "success") {
|
|
@@ -8402,6 +8581,8 @@ async function startDaemon() {
|
|
|
8402
8581
|
HAPPY_RECONNECT_METADATA_VERSION: String(tracked.encryption.metadataVersion),
|
|
8403
8582
|
HAPPY_RECONNECT_AGENT_STATE_VERSION: String(tracked.encryption.agentStateVersion),
|
|
8404
8583
|
...teamEnv,
|
|
8584
|
+
// B-874c: see resumeSessionImpl.
|
|
8585
|
+
...issueRelaunchEnv(metadata),
|
|
8405
8586
|
...options?.auto ? { [AUTO_RESTARTED_ENV]: encodeAutoRestarted(options.auto.kind, options.auto.target) } : {}
|
|
8406
8587
|
}
|
|
8407
8588
|
});
|
|
@@ -8850,6 +9031,14 @@ async function startDaemon() {
|
|
|
8850
9031
|
host: initialMachineMetadata.host
|
|
8851
9032
|
})).then(() => logger.debug(`[DAEMON RUN] claimed the machine record for host ${initialMachineMetadata.host}`)).catch((error) => logger.debug("[DAEMON RUN] could not refresh the recorded host:", error));
|
|
8852
9033
|
}
|
|
9034
|
+
const daemonOwnership = createDaemonOwnership({
|
|
9035
|
+
pid: process.pid,
|
|
9036
|
+
statePid: readDaemonStatePidSync,
|
|
9037
|
+
onSuperseded: (ownerPid) => {
|
|
9038
|
+
logger.debug(`[DAEMON RUN] Somehow a different daemon (pid ${ownerPid}) was started without killing us. We should kill ourselves.`);
|
|
9039
|
+
requestShutdown("exception", "A different daemon was started without killing us. We should kill ourselves.");
|
|
9040
|
+
}
|
|
9041
|
+
});
|
|
8853
9042
|
let lastUpdateLog = "";
|
|
8854
9043
|
let harnessInstaller = null;
|
|
8855
9044
|
let handoverInFlight = false;
|
|
@@ -8872,7 +9061,9 @@ async function startDaemon() {
|
|
|
8872
9061
|
installFenced: () => !!harnessInstaller?.isRunning(),
|
|
8873
9062
|
busyGraceMs: resolveBusyInstallGrace(process.env.HAPPY_CLI_UPDATE_BUSY_GRACE_MS),
|
|
8874
9063
|
lastInstall: lastInstallStore(configuration.happyHomeDir),
|
|
9064
|
+
owned: daemonOwnership.owns,
|
|
8875
9065
|
publish: (state) => {
|
|
9066
|
+
if (!daemonOwnership.owns()) return;
|
|
8876
9067
|
cliUpdateStateRef = state;
|
|
8877
9068
|
fileState = { ...fileState, cliUpdate: state };
|
|
8878
9069
|
writeDaemonState(fileState);
|
|
@@ -8909,10 +9100,17 @@ async function startDaemon() {
|
|
|
8909
9100
|
relayMoveInFlight = null;
|
|
8910
9101
|
});
|
|
8911
9102
|
});
|
|
8912
|
-
const
|
|
9103
|
+
const policyRefresh = createPolicyRefreshTrigger({
|
|
9104
|
+
refresh: () => updateController.refresh(),
|
|
9105
|
+
log: (message, level) => level === "warn" ? logger.warn(`[DAEMON RUN] ${message}`) : logger.debug(`[DAEMON RUN] ${message}`)
|
|
9106
|
+
});
|
|
9107
|
+
const refreshCliUpdate = () => updateController.refresh().then(policyRefresh.noteRefreshed).catch((error) => {
|
|
8913
9108
|
logger.debug("[DAEMON RUN] CLI update policy check failed:", error);
|
|
8914
9109
|
});
|
|
8915
|
-
|
|
9110
|
+
apiMachine.setControlConnectedHandler(() => {
|
|
9111
|
+
policyRefresh.request("connect");
|
|
9112
|
+
});
|
|
9113
|
+
policyRefresh.request("startup");
|
|
8916
9114
|
const cliUpdateIntervalMs = resolveCliUpdateCheckInterval(process.env.HAPPY_CLI_UPDATE_CHECK_INTERVAL);
|
|
8917
9115
|
if (process.env.HAPPY_CLI_UPDATE_CHECK_INTERVAL && cliUpdateIntervalMs === DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS && process.env.HAPPY_CLI_UPDATE_CHECK_INTERVAL.trim() !== String(DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS)) {
|
|
8918
9116
|
logger.warn(`[DAEMON RUN] Ignoring invalid HAPPY_CLI_UPDATE_CHECK_INTERVAL; using ${DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS}ms`);
|
|
@@ -8949,6 +9147,7 @@ async function startDaemon() {
|
|
|
8949
9147
|
});
|
|
8950
9148
|
apiMachine.setHarnessInstallHandler((params) => harnessInstaller.request(params));
|
|
8951
9149
|
const heartbeatIntervalMs = parseInt(process.env.HAPPY_DAEMON_HEARTBEAT_INTERVAL || "60000");
|
|
9150
|
+
const wakeDetector = createWakeDetector(heartbeatIntervalMs);
|
|
8952
9151
|
const restartOnStaleVersionAndHeartbeat = setInterval(serialTask(async () => {
|
|
8953
9152
|
try {
|
|
8954
9153
|
if (process.env.DEBUG) {
|
|
@@ -8960,6 +9159,7 @@ async function startDaemon() {
|
|
|
8960
9159
|
onChildExited(pid);
|
|
8961
9160
|
}
|
|
8962
9161
|
}
|
|
9162
|
+
if (!daemonOwnership.owns()) return;
|
|
8963
9163
|
await updateController.tick();
|
|
8964
9164
|
await updateController.withHandover(async () => {
|
|
8965
9165
|
handoverInFlight = true;
|
|
@@ -8996,6 +9196,7 @@ async function startDaemon() {
|
|
|
8996
9196
|
clearInterval(restartOnStaleVersionAndHeartbeat);
|
|
8997
9197
|
clearInterval(cliUpdateInterval);
|
|
8998
9198
|
policyAnnouncements.stop();
|
|
9199
|
+
policyRefresh.stop();
|
|
8999
9200
|
stopAgentVersionChecks();
|
|
9000
9201
|
claudeAuthService.stop();
|
|
9001
9202
|
stopAccountWatch();
|
|
@@ -9023,12 +9224,9 @@ async function startDaemon() {
|
|
|
9023
9224
|
handoverInFlight = false;
|
|
9024
9225
|
}
|
|
9025
9226
|
});
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
requestShutdown("exception", "A different daemon was started without killing us. We should kill ourselves.");
|
|
9030
|
-
return;
|
|
9031
|
-
}
|
|
9227
|
+
if (!daemonOwnership.owns()) return;
|
|
9228
|
+
const woke = wakeDetector.beat();
|
|
9229
|
+
if (woke || updateController.policyStale()) policyRefresh.request(woke ? "wake" : "stale");
|
|
9032
9230
|
try {
|
|
9033
9231
|
fileState = withDaemonHeartbeat(fileState, (/* @__PURE__ */ new Date()).toLocaleString());
|
|
9034
9232
|
writeDaemonState(fileState);
|
|
@@ -9140,6 +9338,7 @@ async function startDaemon() {
|
|
|
9140
9338
|
clearInterval(cliUpdateInterval);
|
|
9141
9339
|
clearInterval(autoRestartSweep);
|
|
9142
9340
|
policyAnnouncements.stop();
|
|
9341
|
+
policyRefresh.stop();
|
|
9143
9342
|
stopAgentVersionChecks();
|
|
9144
9343
|
await apiMachine.updateDaemonState((state) => ({
|
|
9145
9344
|
...state,
|