very-happy-cli 0.2.205 → 0.2.207
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-BqkDMgcN.mjs → AcpBackend-Bl-oWkHt.mjs} +3 -3
- package/dist/{AcpBackend-Do37yiZg.cjs → AcpBackend-C4SaE4IN.cjs} +3 -3
- package/dist/{AcpSessionManager-BpQKu2_m.cjs → AcpSessionManager-CKSM-N3a.cjs} +1 -1
- package/dist/{AcpSessionManager-CvEO7Yex.mjs → AcpSessionManager-DqNWNKVy.mjs} +1 -1
- package/dist/{BasePermissionHandler-BpaIn9ko.mjs → BasePermissionHandler-BAfjjqWG.mjs} +1 -1
- package/dist/{BasePermissionHandler-CUXi-tq4.cjs → BasePermissionHandler-DffP0tjT.cjs} +1 -1
- package/dist/{account-C1nsl3ij.mjs → account-CneNvaLv.mjs} +5 -5
- package/dist/{account-SwG5Yefp.cjs → account-pH6JQJbQ.cjs} +5 -5
- package/dist/{acpSessionResume-DvDKsJTV.mjs → acpSessionResume-C6KuYvK8.mjs} +1 -1
- package/dist/{acpSessionResume-BCEol11N.cjs → acpSessionResume-Cp2majJ5.cjs} +1 -1
- package/dist/{agentHome-BuFxooEg.mjs → agentHome-BkiHrQwj.mjs} +4 -4
- package/dist/{agentHome-8wzmbm0H.cjs → agentHome-ZGpu5XKy.cjs} +4 -4
- package/dist/{api-20GbdpxY.mjs → api-D7EAwOT2.mjs} +9 -9
- package/dist/{api-BnTF8fkj.cjs → api-eXuwG3LS.cjs} +9 -9
- package/dist/{apiMachine-C8NGJHHd.mjs → apiMachine-B5c9zCjB.mjs} +56 -16
- package/dist/{apiMachine-cyDRM_S-.cjs → apiMachine-B8ZxgTx1.cjs} +56 -16
- package/dist/{attachmentContent-Coo9lUxK.mjs → attachmentContent-DV7W3vw7.mjs} +2 -2
- package/dist/{attachmentContent-B7zz_LPF.cjs → attachmentContent-DhTreh-W.cjs} +2 -2
- package/dist/{auth-By6u_iKB.cjs → auth-CFUuiMdV.cjs} +5 -5
- package/dist/{auth-75rP3vc0.mjs → auth-DX3_VbOL.mjs} +8 -8
- package/dist/{auth-w4UTRbIf.cjs → auth-DhZkCYgz.cjs} +8 -8
- package/dist/{auth-BX6xrdHv.mjs → auth-hEcrRFkt.mjs} +5 -5
- package/dist/{auto-BhmWtRvv.mjs → auto-BI4y9q_F.mjs} +14 -14
- package/dist/{auto-xr_gqUoy.cjs → auto-C4fniaPr.cjs} +14 -14
- package/dist/{bootstrap-Dn_VvHSt.mjs → bootstrap-CBoerZOm.mjs} +2 -2
- package/dist/{bootstrap-3ti7LXMz.cjs → bootstrap-DPbGC_1B.cjs} +2 -2
- package/dist/{browser-C4PVyjGe.cjs → browser-BRH_1Tgz.cjs} +1 -1
- package/dist/{browser-C4wWGXH7.mjs → browser-ilsUkzwR.mjs} +1 -1
- package/dist/{claudeLocal-B8rOA-EB.mjs → claudeLocal-CmRDtqcj.mjs} +4 -4
- package/dist/{claudeLocal-DZALKVVc.cjs → claudeLocal-D6-w4R7R.cjs} +4 -4
- package/dist/{claudeLocalLauncher-CJPRSv3z.mjs → claudeLocalLauncher-B9gzCvDn.mjs} +9 -9
- package/dist/{claudeLocalLauncher-Bf5uj0EA.cjs → claudeLocalLauncher-D93IuVcy.cjs} +9 -9
- package/dist/{claudeSessionFork-unEBLW0t.cjs → claudeSessionFork-Bo-LD1DH.cjs} +1 -1
- package/dist/{claudeSessionFork-BK4U655i.mjs → claudeSessionFork-ghL7gnlU.mjs} +1 -1
- package/dist/{client-Bh-y6cVc.cjs → client-5SAqN0dw.cjs} +4 -4
- package/dist/{client-BbYds4AV.mjs → client-BGLgYzYC.mjs} +4 -4
- package/dist/{client-DGsdLx8L.cjs → client-BcUWsWK-.cjs} +2 -2
- package/dist/{client-wMlUPnrV.cjs → client-CTsx4zlq.cjs} +2 -2
- package/dist/{client-BxtaglBR.mjs → client-DCFPJD00.mjs} +2 -2
- package/dist/{client-m-K1b6Qa.mjs → client-DTwpdW59.mjs} +2 -2
- package/dist/{client-CvLm25Wq.mjs → client-DhnaMxKS.mjs} +2 -2
- package/dist/{client-BKjBr6pc.cjs → client-N9svGBOP.cjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +18 -18
- package/dist/codex/happyMcpStdioBridge.mjs +18 -18
- package/dist/{codexAppServerClient-6aQelpRl.cjs → codexAppServerClient-3mdddlO9.cjs} +3 -3
- package/dist/{codexAppServerClient-BeRimnu9.mjs → codexAppServerClient-CBVlr7hu.mjs} +3 -3
- package/dist/{codexCommand-CmGNDs45.mjs → codexCommand-BP88QTCU.mjs} +43 -43
- package/dist/{codexCommand-CYVaGmhh.cjs → codexCommand-Bps4LkvI.cjs} +43 -43
- package/dist/{codexTermination-B09HyYIB.cjs → codexTermination-C9CVmb9Q.cjs} +1 -1
- package/dist/{codexTermination-Z18pGkkl.mjs → codexTermination-CUPmLwbF.mjs} +1 -1
- package/dist/{config-Dq_N615Z.cjs → config-O4t1U8Bi.cjs} +3 -3
- package/dist/{config-4b-sF37g.mjs → config-eTAvnx-a.mjs} +3 -3
- package/dist/{configuration-Fx61b4MJ.cjs → configuration-B-smHMf7.cjs} +1 -1
- package/dist/{configuration-H8q1sMwk.mjs → configuration-C4w7_yT9.mjs} +1 -1
- package/dist/{connect-D54AnDIT.cjs → connect-BGZmkECR.cjs} +12 -12
- package/dist/{connect-BwSwKPzI.mjs → connect-BJT1vGf-.mjs} +12 -12
- package/dist/{context-CM1Xd_HO.mjs → context-Cy2pdGOi.mjs} +1 -1
- package/dist/{context-D-QOcYuX.cjs → context-Dfj4Pjqz.cjs} +1 -1
- package/dist/{controlClient-D9DYqW02.mjs → controlClient-CtBRHlbJ.mjs} +3 -3
- package/dist/{controlClient-D04wXKoQ.cjs → controlClient-Dlm7wz-k.cjs} +3 -3
- package/dist/{createSessionMetadata-Ce539QXK.cjs → createSessionMetadata-B1NbiqH5.cjs} +2 -2
- package/dist/{createSessionMetadata-CHa4pufa.mjs → createSessionMetadata-DqBHMEgs.mjs} +2 -2
- package/dist/{deterministicJson-BEeXnWCF.mjs → deterministicJson-B94VfD9g.mjs} +14 -14
- package/dist/{deterministicJson-D34CnNHO.cjs → deterministicJson-DGheByZm.cjs} +14 -14
- package/dist/{doctor-BX8oWKZq.cjs → doctor-CdXBxTms.cjs} +7 -7
- package/dist/{doctor-BI0Iywt_.mjs → doctor-D3Ph5EzU.mjs} +7 -7
- package/dist/{downloadTarget-TzXJEh6W.cjs → downloadTarget-BpToCct7.cjs} +6 -6
- package/dist/{downloadTarget-DX3m00OE.mjs → downloadTarget-DBDqU17k.mjs} +6 -6
- package/dist/{ensureDaemonRunning-BBBqZ6vQ.mjs → ensureDaemonRunning-7J9kb-Sj.mjs} +5 -5
- package/dist/{ensureDaemonRunning-Bvu-yyFn.cjs → ensureDaemonRunning-Balq1x5B.cjs} +5 -5
- package/dist/{exitNotice-M4UjtWkr.cjs → exitNotice-CTcWpCmg.cjs} +2 -2
- package/dist/{exitNotice-gOAdDcL3.mjs → exitNotice-DkJaD0I0.mjs} +2 -2
- package/dist/{format-BPAREVhi.mjs → format-0c3qb7FE.mjs} +1 -1
- package/dist/{format-BEktLc45.cjs → format-DoTTSy8C.cjs} +1 -1
- package/dist/{handleResumeCommand-DziiqogX.mjs → handleResumeCommand-BUIHxf87.mjs} +5 -5
- package/dist/{handleResumeCommand-6dYW_WOi.cjs → handleResumeCommand-Dp-rTs9Q.cjs} +5 -5
- package/dist/{index-UuWDafdi.mjs → index-B-hkUPYN.mjs} +41 -41
- package/dist/{index-CzBvl9py.mjs → index-BlUhrNAx.mjs} +3 -3
- package/dist/{index-Cawt-fgZ.cjs → index-CP6WBAk_.cjs} +4 -4
- package/dist/{index-BRq5iitn.mjs → index-D47YHzru.mjs} +4 -4
- package/dist/{index-DCvq8Cfw.mjs → index-DE5JMca_.mjs} +4 -4
- package/dist/{index-bVMcFi7v.cjs → index-DMhMr4cb.cjs} +4 -4
- package/dist/{index-BmacwzcK.cjs → index-DWtaNZd1.cjs} +40 -40
- package/dist/{index-CoW4RNEb.cjs → index-Du6DD3Re.cjs} +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-B4OVUIw5.mjs → install-CwQRBYJL.mjs} +3 -3
- package/dist/{install-BQc4Hwuo.cjs → install-Sr04Bhi-.cjs} +3 -3
- package/dist/{issue-h_BIrzLs.mjs → issue-D9rmZ2Im.mjs} +7 -7
- package/dist/{issue-WpLZYxUQ.cjs → issue-pnYFBO-F.cjs} +7 -7
- package/dist/lib.cjs +11 -11
- package/dist/lib.d.cts +65 -0
- package/dist/lib.d.mts +65 -0
- package/dist/lib.mjs +11 -11
- package/dist/{localHappyAgentAuth-DgLh3xzW.mjs → localHappyAgentAuth-Bc3bo0fI.mjs} +1 -1
- package/dist/{localHappyAgentAuth-DQRWBUxQ.cjs → localHappyAgentAuth-BpBQ_aFo.cjs} +1 -1
- package/dist/{logger-BKAKIZdy.mjs → logger-8f-WNgus.mjs} +2 -2
- package/dist/{logger-DP35yx-C.cjs → logger-HxTu5uFs.cjs} +2 -2
- package/dist/{machineMetadata-CZj0XwM_.cjs → machineMetadata-C7DEm41X.cjs} +3 -3
- package/dist/{machineMetadata-DTlMMhj_.mjs → machineMetadata-EyybyGYp.mjs} +3 -3
- package/dist/{main-l_nP9IQq.cjs → main-CW8xXpXM.cjs} +48 -48
- package/dist/{main-BIE1zeaH.mjs → main-Dmb6KKtB.mjs} +48 -48
- package/dist/{mcp-KQHODyR3.cjs → mcp-BHKpSJPk.cjs} +15 -15
- package/dist/{mcp-B5F6-_7o.mjs → mcp-DAuW3X2i.mjs} +15 -15
- package/dist/{mirrorProtocol-duXHJeBW.cjs → mirrorProtocol-Cmxr0YBU.cjs} +2 -2
- package/dist/{mirrorProtocol-DDOUSWqL.mjs → mirrorProtocol-kXv1EaAI.mjs} +2 -2
- package/dist/{package-BCJfNMlt.cjs → package-ChmhpzsE.cjs} +8 -8
- package/dist/{package-CMmhJwSf.mjs → package-Cp8RjVmm.mjs} +8 -8
- package/dist/{panels-CBlIJIu8.cjs → panels-iylFFXPZ.cjs} +5 -5
- package/dist/{panels-BWxZMb_x.mjs → panels-x99J6c1O.mjs} +5 -5
- package/dist/{peerTools-C6Y28jqG.cjs → peerTools-ZUDz2PCs.cjs} +5 -5
- package/dist/{peerTools-ZJzoM48N.mjs → peerTools-jWghbgAH.mjs} +5 -5
- package/dist/{persistence-dLgWDclq.mjs → persistence-D1E7jiV4.mjs} +2 -2
- package/dist/{persistence-iiVFxhbt.cjs → persistence-DxboRqwb.cjs} +2 -2
- package/dist/{piRunnerArgs-DuWYye4f.mjs → piRunnerArgs-BM9b8W_4.mjs} +1 -1
- package/dist/{piRunnerArgs-DxWxgOSZ.cjs → piRunnerArgs-gNYQH48T.cjs} +1 -1
- package/dist/{piRuntime-Cbwk6bN0.mjs → piRuntime-B6X6ax5K.mjs} +1 -1
- package/dist/{piRuntime-6UnkPaS1.cjs → piRuntime-mqdaYw91.cjs} +1 -1
- package/dist/{piTerminal-BaoUqlM0.cjs → piTerminal-D-bOYy3E.cjs} +17 -17
- package/dist/{piTerminal-Dn0qN9nb.mjs → piTerminal-DaoQF1Rn.mjs} +17 -17
- package/dist/{pushNotifications-gcQv61e6.cjs → pushNotifications-EJWZAYed.cjs} +19 -2
- package/dist/{pushNotifications-DD9Z0CoN.mjs → pushNotifications-WgO2p0eT.mjs} +19 -2
- package/dist/{query-CFdlRD7b.mjs → query-BGtAkN33.mjs} +1 -1
- package/dist/{query-12momZSq.cjs → query-ykhx5AZx.cjs} +1 -1
- package/dist/{rateLimitWindows-CVS-btq-.mjs → rateLimitWindows-BRImToc6.mjs} +1 -1
- package/dist/{rateLimitWindows-D2Gmg7jU.cjs → rateLimitWindows-Cfdnt4On.cjs} +1 -1
- package/dist/{reconnectGate-m81ySKhh.mjs → reconnectGate-B9iXSyiI.mjs} +1 -1
- package/dist/{reconnectGate-BkSaZdIx.cjs → reconnectGate-DY97bPDg.cjs} +1 -1
- package/dist/{registerCommonHandlers-CqLHkmG2.mjs → registerCommonHandlers-YbBzC20u.mjs} +2 -2
- package/dist/{registerCommonHandlers-B5p3ZZmp.cjs → registerCommonHandlers-YsrcwRo3.cjs} +2 -2
- package/dist/{registerKillSessionHandler-Bf_Q9yii.cjs → registerKillSessionHandler-ClPpvQnu.cjs} +5 -5
- package/dist/{registerKillSessionHandler-jYSuGIP1.mjs → registerKillSessionHandler-d3rziH37.mjs} +5 -5
- package/dist/{registerSideQuestionHandler-CPR29B9d.mjs → registerSideQuestionHandler-C3K33AGg.mjs} +4 -4
- package/dist/{registerSideQuestionHandler-DSIw3xPW.cjs → registerSideQuestionHandler-CMvcaD2A.cjs} +4 -4
- package/dist/{remoteSessionClient-CLuxs0_y.mjs → remoteSessionClient-B1C7gwqX.mjs} +5 -5
- package/dist/{remoteSessionClient-DX-60nto.cjs → remoteSessionClient-e9jDdGyc.cjs} +5 -5
- package/dist/{reportProgressTool-k3g3D6cX.mjs → reportProgressTool-67vB9Y7g.mjs} +4 -4
- package/dist/{reportProgressTool-D1XAxeY1.cjs → reportProgressTool-B3yNkD_S.cjs} +4 -4
- package/dist/{run-BBJqaIoY.mjs → run-BjpvcAAW.mjs} +269 -37
- package/dist/{run-DOb_agpA.cjs → run-c4votzBI.cjs} +269 -37
- package/dist/{runClaude-NTvReMNp.mjs → runClaude-B1NEkS3e.mjs} +20 -20
- package/dist/{runClaude-BU3Lrd5o.cjs → runClaude-DkaZHsDR.cjs} +20 -20
- package/dist/{runClaudeDeps-DQV-QdDi.cjs → runClaudeDeps-C8s0t81_.cjs} +38 -38
- package/dist/{runClaudeDeps-Dh2LVY2w.mjs → runClaudeDeps-JYJCSgT2.mjs} +44 -44
- package/dist/{runGemini-CGD4bqQ3.mjs → runGemini-Bgmlv2sP.mjs} +35 -35
- package/dist/{runGemini-dk877ztP.cjs → runGemini-m1e3OwXi.cjs} +35 -35
- package/dist/{runOpenClaw-CQakHPPq.cjs → runOpenClaw-B5iSbZvU.cjs} +17 -17
- package/dist/{runOpenClaw-6MAJ_tHi.mjs → runOpenClaw-BTry3E0Y.mjs} +17 -17
- package/dist/{sandbox-B3YMD9I6.mjs → sandbox-BPZsegqb.mjs} +4 -4
- package/dist/{sandbox-8DeDre0R.cjs → sandbox-D-irSe8t.cjs} +4 -4
- package/dist/{selfCheck-BpvUNBmv.cjs → selfCheck-08_EII_I.cjs} +39 -39
- package/dist/selfCheck-BPzN6ip2.mjs +89 -0
- package/dist/{send-DgrbVZzC.mjs → send-4esWxXzr.mjs} +8 -8
- package/dist/{send-Bym_IU4n.cjs → send-DUNnoCVK.cjs} +8 -8
- package/dist/{server-CmAgeEhS.mjs → server-Bn1QXAY4.mjs} +4 -4
- package/dist/{server-BY-FubRe.cjs → server-NG8ODDc_.cjs} +6 -6
- package/dist/{sessionLock-BMtAQ4bW.mjs → sessionLock-BKnXIWnQ.mjs} +9 -4
- package/dist/{sessionLock-WXtjQC9q.cjs → sessionLock-CW-P7VU9.cjs} +9 -3
- package/dist/{sessionOps-BEVzE38e.cjs → sessionOps-Cei-Q7OB.cjs} +4 -4
- package/dist/{sessionOps-BxLhHEhM.mjs → sessionOps-Ct7ayY1X.mjs} +4 -4
- package/dist/{sessionProvider-B1tL5K5f.mjs → sessionProvider-D8bZBiAX.mjs} +5 -5
- package/dist/{sessionProvider-DCnZFxwe.cjs → sessionProvider-DoXNlG4E.cjs} +5 -5
- package/dist/{sessionScanner-eX2f-j0u.cjs → sessionScanner-CGs_Lbq7.cjs} +3 -3
- package/dist/{sessionScanner-Ctm9w-AJ.mjs → sessionScanner-DivfvOis.mjs} +3 -3
- package/dist/{sessions-BuxOqRcc.mjs → sessions-DN47YSMs.mjs} +10 -10
- package/dist/{sessions-BG8r7uht.cjs → sessions-VYh46wvf.cjs} +10 -10
- package/dist/{setupOfflineReconnection-65k1yEFn.cjs → setupOfflineReconnection-DHBmg5_6.cjs} +2 -2
- package/dist/{setupOfflineReconnection-Dd4NCN9i.mjs → setupOfflineReconnection-DqeCU4SM.mjs} +2 -2
- package/dist/{spawn-wys_MPgK.mjs → spawn-ChyfhZlN.mjs} +12 -12
- package/dist/{spawn-0YaC-DQg.cjs → spawn-DQLUI6h9.cjs} +12 -12
- package/dist/{spawnHappyCLI-EvPb0jB3.mjs → spawnHappyCLI-D6R-aIkL.mjs} +1 -1
- package/dist/{spawnHappyCLI-Bf_N42fi.cjs → spawnHappyCLI-DIR-U_rK.cjs} +1 -1
- package/dist/{startFileWatcher-GF4BNFA1.mjs → startFileWatcher-CQCQrB3d.mjs} +1 -1
- package/dist/{startFileWatcher-ikipjpDk.cjs → startFileWatcher-Qy7f8U4k.cjs} +1 -1
- package/dist/{startupSessionCreate-Dp3_kvi_.mjs → startupSessionCreate-BgoNJdcx.mjs} +3 -3
- package/dist/{startupSessionCreate-CHU23k6u.cjs → startupSessionCreate-cInaqBEd.cjs} +3 -3
- package/dist/{sync-Dm6GaS8P.cjs → sync-DS_emV3g.cjs} +1 -1
- package/dist/{sync-Co0wRhGu.mjs → sync-DzKT0Ova.mjs} +1 -1
- package/dist/{systemPrompt-Ds7HcfDZ.cjs → systemPrompt-DVy690s2.cjs} +1 -1
- package/dist/{systemPrompt-5cZbY0sf.mjs → systemPrompt-rpf-Xff-.mjs} +1 -1
- package/dist/{teams-DBWFUOC3.mjs → teams-CbqS5j_2.mjs} +8 -8
- package/dist/{teams-nrcZL-1X.cjs → teams-DwBVRsbw.cjs} +8 -8
- package/dist/{time-NSglRbyr.cjs → time-i8fiLSHv.cjs} +1 -1
- package/dist/{time-Cn0mV-di.mjs → time-o_AW-82H.mjs} +1 -1
- package/dist/{titleGenerator-CMIUB04_.cjs → titleGenerator-EGdbOCLR.cjs} +2 -2
- package/dist/{titleGenerator-hmxUR3rU.mjs → titleGenerator-rKTQTQN7.mjs} +1 -1
- package/dist/{todo-CDdBityL.mjs → todo-CWyVxUyT.mjs} +7 -7
- package/dist/{todo-D5BoNMb7.cjs → todo-d8aPaBq_.cjs} +7 -7
- package/dist/{tools-BmQbzAfY.mjs → tools--22wuNI5.mjs} +1 -1
- package/dist/{tools-CLkNfafW.cjs → tools-DtSHBOmt.cjs} +1 -1
- package/dist/{uninstall-DCx_qNMZ.cjs → uninstall-BAaq0c10.cjs} +3 -3
- package/dist/{uninstall-DE0SH2qs.mjs → uninstall-CJqFoKZO.mjs} +3 -3
- package/package.json +8 -8
- package/dist/selfCheck-BCKIF6ST.mjs +0 -89
|
@@ -1,6 +1,6 @@
|
|
|
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-kXv1EaAI.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-BM9b8W_4.mjs';
|
|
4
4
|
import fs from 'fs/promises';
|
|
5
5
|
import os from 'os';
|
|
6
6
|
import * as tmp from 'tmp';
|
|
@@ -8,20 +8,20 @@ import axios from 'axios';
|
|
|
8
8
|
import { a as issueRelaunchEnv } from './sessionMetadata-C1eoAi89.mjs';
|
|
9
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';
|
|
10
10
|
import { join, isAbsolute, resolve, dirname, sep, basename, relative } from 'node:path';
|
|
11
|
-
import { f as teamExitMarkerPath, d as detectTeamUserLanguage, g as teamOwnerText, a as teamLanguageRule, c as teamLanguageReminder } from './exitNotice-
|
|
12
|
-
import { f as ensurePrivateDirectorySync, w as writePrivateFileSync, c as configuration } from './configuration-
|
|
13
|
-
import { T as TurnActivityTracker, A as ApiClient } from './api-
|
|
11
|
+
import { f as teamExitMarkerPath, d as detectTeamUserLanguage, g as teamOwnerText, a as teamLanguageRule, c as teamLanguageReminder } from './exitNotice-DkJaD0I0.mjs';
|
|
12
|
+
import { f as ensurePrivateDirectorySync, w as writePrivateFileSync, c as configuration } from './configuration-C4w7_yT9.mjs';
|
|
13
|
+
import { T as TurnActivityTracker, A as ApiClient } from './api-D7EAwOT2.mjs';
|
|
14
14
|
import { S as SPAWN_AGENTS, i as isSpawnAgent, s as sanitizeSpawnPermissionMode, r as resolveSpawnPermissionMode, a as resolveFirstMessageMeta, j as joinProject } from './spawnAgents-CcFKtKdX.mjs';
|
|
15
|
-
import { l as logger } from './logger-
|
|
16
|
-
import { p as pruneStaleCompileCaches } from './index-
|
|
17
|
-
import { a as authAndSetupMachineIfNeeded } from './auth-
|
|
15
|
+
import { l as logger } from './logger-8f-WNgus.mjs';
|
|
16
|
+
import { p as pruneStaleCompileCaches } from './index-BlUhrNAx.mjs';
|
|
17
|
+
import { a as authAndSetupMachineIfNeeded } from './auth-hEcrRFkt.mjs';
|
|
18
18
|
import { spawn, execSync } from 'child_process';
|
|
19
|
-
import { p as packageJson } from './package-
|
|
20
|
-
import { a as globalPrefixForPackage, N as NPM_SAFE_ARG, g as getEnvironmentInfo } from './doctor-
|
|
21
|
-
import { s as spawnHappyCLI } from './spawnHappyCLI-
|
|
22
|
-
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-
|
|
23
|
-
import { i as isDaemonRunningCurrentlyInstalledHappyVersion, s as stopDaemon, x as cleanupDaemonState } from './controlClient-
|
|
24
|
-
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-
|
|
19
|
+
import { p as packageJson } from './package-Cp8RjVmm.mjs';
|
|
20
|
+
import { a as globalPrefixForPackage, N as NPM_SAFE_ARG, g as getEnvironmentInfo } from './doctor-D3Ph5EzU.mjs';
|
|
21
|
+
import { s as spawnHappyCLI } from './spawnHappyCLI-D6R-aIkL.mjs';
|
|
22
|
+
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-D1E7jiV4.mjs';
|
|
23
|
+
import { i as isDaemonRunningCurrentlyInstalledHappyVersion, s as stopDaemon, x as cleanupDaemonState } from './controlClient-CtBRHlbJ.mjs';
|
|
24
|
+
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-Ct7ayY1X.mjs';
|
|
25
25
|
import { a3 as AgentProfilesStateSchema, ar as ServerMigrateNoticeSchema, as as isHarnessInstallId, at as agentProfileUnavailableReason, au as MODEL_INTENT_CONFIG, q as AUTOMATION_SUMMARY_MAX_CHARS, av as AUTOMATION_PRECHECK_OUTPUT_MAX_CHARS, aw as AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS, d as AUTOMATION_PRECHECK_MAX_TIMEOUT_MS, ax as AUTOMATION_CLAIM_MAX_RUNS, ay as AUTOMATION_DAEMON_CAPABILITY_PRECHECK, az as AUTOMATION_DEFAULT_LEASE_MS, i as isAutomationRunTerminal, D as resolveLaunchAgentProfile, aA as ISSUE_SENT_FROM, aB as ISSUE_DISPATCH_LOCAL_ID_PREFIX, f as ISSUE_ASSIGNABLE_AGENTS, aC as HARNESS_INSTALL_CAPABILITY_VERSION } from './index-DWk-WTU-.mjs';
|
|
26
26
|
import fastify from 'fastify';
|
|
27
27
|
import { z } from 'zod';
|
|
@@ -30,37 +30,37 @@ import { d as decodeBase64, s as sameRelay, e as encodeBase64, h as decrypt } fr
|
|
|
30
30
|
import { randomBytes, createHash, timingSafeEqual, randomUUID } from 'node:crypto';
|
|
31
31
|
import { c as checkPreviewPath } from './previewPath-CXN4Vag0.mjs';
|
|
32
32
|
import { a as BACKGROUND_TASKS_MAX, d as BACKGROUND_TASK_DESCRIPTION_MAX, e as BackgroundTaskTracker } from './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
33
|
-
import { b as sanitizeRateLimitReport } from './rateLimitWindows-
|
|
34
|
-
import { f as formatEditConflictNotice, b as SESSION_PEER_SENT_FROM, s as sendPeerMessage, l as listPeerSessions, C as CLI_PEER_SENDER_ID } from './peerTools-
|
|
33
|
+
import { b as sanitizeRateLimitReport } from './rateLimitWindows-BRImToc6.mjs';
|
|
34
|
+
import { f as formatEditConflictNotice, b as SESSION_PEER_SENT_FROM, s as sendPeerMessage, l as listPeerSessions, C as CLI_PEER_SENDER_ID } from './peerTools-jWghbgAH.mjs';
|
|
35
35
|
import os$1, { hostname, homedir, tmpdir } from 'node:os';
|
|
36
|
-
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-
|
|
37
|
-
import { assistantHome, bootstrapAssistantHome } from './bootstrap-
|
|
38
|
-
import { refreshAgentHomes, locateClaudeConversation, agentHomeSpawnEnv } from './index-
|
|
36
|
+
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-B1C7gwqX.mjs';
|
|
37
|
+
import { assistantHome, bootstrapAssistantHome } from './bootstrap-CBoerZOm.mjs';
|
|
38
|
+
import { refreshAgentHomes, locateClaudeConversation, agentHomeSpawnEnv } from './index-DE5JMca_.mjs';
|
|
39
39
|
import require$$0, { existsSync as existsSync$1, statSync as statSync$1, mkdtempSync, rmSync } from 'fs';
|
|
40
40
|
import require$$1, { join as join$1 } from 'path';
|
|
41
41
|
import { spawn as spawn$1, execFile, spawnSync } from 'node:child_process';
|
|
42
42
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
43
43
|
import { d as daemonEndpointsMatch, r as resolveClaudeCredentialReadiness } from './doctorReadiness-C208SMN9.mjs';
|
|
44
|
-
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-
|
|
44
|
+
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-EyybyGYp.mjs';
|
|
45
45
|
import { M as ModelConfigError, B as BackupStore, r as readConfigFile, s as sha256, a as atomicWriteFile } from './fileStore-5qpetZS0.mjs';
|
|
46
46
|
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';
|
|
47
47
|
import { p as parse } from './codexAccount-BPQ-lPhH.mjs';
|
|
48
48
|
import require$$3 from 'crypto';
|
|
49
49
|
import { c as commandOnPath } from './detectCLI-CSGMlV51.mjs';
|
|
50
|
-
import { buildResumeLaunch } from './handleResumeCommand-
|
|
50
|
+
import { buildResumeLaunch } from './handleResumeCommand-BUIHxf87.mjs';
|
|
51
51
|
import { n as normalizeWebPanels } from './webPanels-B2_C2-3g.mjs';
|
|
52
52
|
import { access, symlink, readFile, rm, unlink, readlink, lstat, constants, rename, mkdir, copyFile, readdir, stat, open } from 'node:fs/promises';
|
|
53
53
|
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';
|
|
54
|
-
import { P as ProjectsUnsupportedError, c as createProjectsClient } from './client-
|
|
55
|
-
import { u as uncheckedWrapperStatus, 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
|
|
56
|
-
import { c as createAutomationsClient, i as isAutomationsUnavailable, d as AutomationsRequestError } from './client-
|
|
54
|
+
import { P as ProjectsUnsupportedError, c as createProjectsClient } from './client-DCFPJD00.mjs';
|
|
55
|
+
import { u as uncheckedWrapperStatus, 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 restartIdleRefusal, n as AUTO_RESTARTED_ENV, o as encodeAutoRestarted, q as pendingUpgradeVersion, v as resolveCheckInGraceMs, x as resolveQuietMs, y as AUTO_RESTART_RECHECK_CAP_MS } from './sessionLock-BKnXIWnQ.mjs';
|
|
56
|
+
import { c as createAutomationsClient, i as isAutomationsUnavailable, d as AutomationsRequestError } from './client-DhnaMxKS.mjs';
|
|
57
57
|
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';
|
|
58
58
|
import { A as AccountService } from './accountService-CqrWNH8K.mjs';
|
|
59
59
|
import { spawnSetupTokenPty, watchAccountFiles } from './daemonAccounts-BtkmoJmC.mjs';
|
|
60
60
|
import { g as getProjectPath } from './path-D2wdaNSk.mjs';
|
|
61
61
|
import { b as extractClaudeEditPaths } from './editPaths-BVfS_FFL.mjs';
|
|
62
|
-
import { s as startFileWatcher } from './startFileWatcher-
|
|
63
|
-
import { I as InvalidateSync } from './sync-
|
|
62
|
+
import { s as startFileWatcher } from './startFileWatcher-CQCQrB3d.mjs';
|
|
63
|
+
import { I as InvalidateSync } from './sync-DzKT0Ova.mjs';
|
|
64
64
|
import { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
|
|
65
65
|
import { t as tmuxArgs, a as scrubTmuxClientEnv, s as shellescape } from './tmuxSocket-BmZyixRM.mjs';
|
|
66
66
|
import { i as isProcessAlive, t as terminateProcessTree } from './processTermination-ChJG5SLW.mjs';
|
|
@@ -68,31 +68,31 @@ import { findAllHappyProcesses } from './doctor-GN5mPOn5.mjs';
|
|
|
68
68
|
import { T as TEAM_SKILL, a as TEAM_LEAD_PLAYBOOK, b as TEAM_MEMBER_RULES } from './resources-CLP_MpK4.mjs';
|
|
69
69
|
import { promisify } from 'node:util';
|
|
70
70
|
import { b as clipText, r as renderAction, c as clipAutomationReport, e as renderTemplate } from './template-D8fzlO58.mjs';
|
|
71
|
-
import { I as IssuesUnsupportedError, a as IssueRequestError, c as createIssuesClient } from './client-
|
|
71
|
+
import { I as IssuesUnsupportedError, a as IssueRequestError, c as createIssuesClient } from './client-DTwpdW59.mjs';
|
|
72
72
|
import { d as describeAgentHome } from './loginShellEnv-Dw8M7tkI.mjs';
|
|
73
73
|
import { S as SPAWN_ACCOUNT_ENV } from './store-Fge1h9wy.mjs';
|
|
74
|
-
import './acpSessionResume-
|
|
74
|
+
import './acpSessionResume-C6KuYvK8.mjs';
|
|
75
75
|
import './prompt-QHuFx9j6.mjs';
|
|
76
|
-
import './pushNotifications-
|
|
76
|
+
import './pushNotifications-WgO2p0eT.mjs';
|
|
77
77
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
78
|
-
import './reconnectGate-
|
|
78
|
+
import './reconnectGate-B9iXSyiI.mjs';
|
|
79
79
|
import 'node:events';
|
|
80
80
|
import 'socket.io-client';
|
|
81
81
|
import './limits-DIo7rEBR.mjs';
|
|
82
|
-
import './time-
|
|
83
|
-
import './registerCommonHandlers-
|
|
82
|
+
import './time-o_AW-82H.mjs';
|
|
83
|
+
import './registerCommonHandlers-YbBzC20u.mjs';
|
|
84
84
|
import 'util';
|
|
85
85
|
import 'cross-spawn';
|
|
86
86
|
import '@paralleldrive/cuid2';
|
|
87
87
|
import 'chalk';
|
|
88
88
|
import 'node:module';
|
|
89
89
|
import 'tweetnacl';
|
|
90
|
-
import './browser-
|
|
90
|
+
import './browser-ilsUkzwR.mjs';
|
|
91
91
|
import 'open';
|
|
92
92
|
import './specialCommands-MXUN0wfI.mjs';
|
|
93
93
|
import './ids-DU6sLx4C.mjs';
|
|
94
94
|
import 'url';
|
|
95
|
-
import './localHappyAgentAuth-
|
|
95
|
+
import './localHappyAgentAuth-Bc3bo0fI.mjs';
|
|
96
96
|
import './claudeAccountEnv-C6Wl-ZbT.mjs';
|
|
97
97
|
import 'node:readline';
|
|
98
98
|
import 'node-pty';
|
|
@@ -4624,7 +4624,8 @@ function createHarnessInstaller(deps) {
|
|
|
4624
4624
|
return {
|
|
4625
4625
|
/** True while npm may be writing the prefix — including after an unconfirmed kill. */
|
|
4626
4626
|
isRunning: () => running !== null || blocked,
|
|
4627
|
-
|
|
4627
|
+
/** `requester` is only for the log: the machine page (owner) or B-894's agent auto-update. */
|
|
4628
|
+
async request(params, requester = "owner") {
|
|
4628
4629
|
const harness = params && typeof params === "object" ? params.harness : void 0;
|
|
4629
4630
|
if (!isHarnessInstallId(harness)) {
|
|
4630
4631
|
deps.log(`[HARNESS] refused install request for an unknown harness`);
|
|
@@ -4646,7 +4647,7 @@ function createHarnessInstaller(deps) {
|
|
|
4646
4647
|
return location;
|
|
4647
4648
|
}
|
|
4648
4649
|
const startedAt = now();
|
|
4649
|
-
deps.log(`[HARNESS] owner requested ${harness} install`);
|
|
4650
|
+
deps.log(`[HARNESS] ${requester === "auto-update" ? "agent auto-update" : "owner"} requested ${harness} install`);
|
|
4650
4651
|
deps.publish({ harness, state: "installing", startedAt, at: startedAt });
|
|
4651
4652
|
void run(harness, location.prefix, startedAt);
|
|
4652
4653
|
return { accepted: true, harness };
|
|
@@ -4654,6 +4655,197 @@ function createHarnessInstaller(deps) {
|
|
|
4654
4655
|
};
|
|
4655
4656
|
}
|
|
4656
4657
|
|
|
4658
|
+
const AGENT_AUTO_UPDATE_HARNESSES = ["codex"];
|
|
4659
|
+
const AGENT_AUTO_UPDATE_MAX_ATTEMPTS = 2;
|
|
4660
|
+
const AGENT_AUTO_UPDATE_BACKOFF_MS = 30 * 60 * 1e3;
|
|
4661
|
+
const AGENT_AUTO_UPDATE_SNAPSHOT_MAX_AGE_MS = 12 * 60 * 60 * 1e3;
|
|
4662
|
+
const TRANSIENT_REFUSALS = /* @__PURE__ */ new Set(["install_in_progress", "cli_update_in_progress"]);
|
|
4663
|
+
function decideAgentAutoUpdate(input) {
|
|
4664
|
+
const { harness } = input;
|
|
4665
|
+
if (!input.enabled) return { action: "skip", harness, reason: "disabled" };
|
|
4666
|
+
const versions = input.versions;
|
|
4667
|
+
if (!versions || input.now - versions.checkedAt > AGENT_AUTO_UPDATE_SNAPSHOT_MAX_AGE_MS) return { action: "skip", harness, reason: "no-versions" };
|
|
4668
|
+
const agent = versions.agents.find((a) => a.id === harness);
|
|
4669
|
+
if (!agent || agent.status !== "update-available" || !agent.latest) return { action: "skip", harness, reason: "current" };
|
|
4670
|
+
const target = agent.latest;
|
|
4671
|
+
const attempt = input.attempt?.target === target ? input.attempt : void 0;
|
|
4672
|
+
if (attempt?.succeeded) return { action: "skip", harness, reason: "still-outdated", target };
|
|
4673
|
+
if (attempt && attempt.attempts >= AGENT_AUTO_UPDATE_MAX_ATTEMPTS) return { action: "skip", harness, reason: "gave-up", target };
|
|
4674
|
+
if (attempt && input.now - attempt.lastAt < AGENT_AUTO_UPDATE_BACKOFF_MS) return { action: "skip", harness, reason: "backoff", target };
|
|
4675
|
+
if (input.turnActive) return { action: "skip", harness, reason: "turn-active", target };
|
|
4676
|
+
if (input.installerBusy) return { action: "skip", harness, reason: "installer-busy", target };
|
|
4677
|
+
return { action: "install", harness, from: agent.installed, target };
|
|
4678
|
+
}
|
|
4679
|
+
function createAgentAutoUpdater(deps) {
|
|
4680
|
+
const now = deps.now ?? Date.now;
|
|
4681
|
+
const loaded = deps.store?.read() ?? { attempts: {}, statuses: {} };
|
|
4682
|
+
const attempts = new Map(
|
|
4683
|
+
Object.entries(loaded.attempts).map(([harness, attempt]) => [harness, attempt])
|
|
4684
|
+
);
|
|
4685
|
+
const statuses = { ...loaded.statuses };
|
|
4686
|
+
const save = () => {
|
|
4687
|
+
try {
|
|
4688
|
+
deps.store?.write({ attempts: Object.fromEntries(attempts), statuses: { ...statuses } });
|
|
4689
|
+
} catch (error) {
|
|
4690
|
+
deps.log(`[AGENT AUTO-UPDATE] could not save state: ${String(error)}`);
|
|
4691
|
+
}
|
|
4692
|
+
};
|
|
4693
|
+
for (const status of Object.values(statuses)) {
|
|
4694
|
+
if (status.state !== "installing") continue;
|
|
4695
|
+
const attempt = attempts.get(status.harness);
|
|
4696
|
+
if (attempt?.target === status.target) attempt.detail = "interrupted_by_daemon_restart";
|
|
4697
|
+
statuses[status.harness] = {
|
|
4698
|
+
...status,
|
|
4699
|
+
state: status.attempts >= AGENT_AUTO_UPDATE_MAX_ATTEMPTS ? "gave-up" : "failed",
|
|
4700
|
+
detail: "interrupted_by_daemon_restart"
|
|
4701
|
+
};
|
|
4702
|
+
}
|
|
4703
|
+
if (Object.keys(statuses).length > 0) {
|
|
4704
|
+
save();
|
|
4705
|
+
deps.publish({ ...statuses });
|
|
4706
|
+
}
|
|
4707
|
+
let pending = null;
|
|
4708
|
+
let ticking = false;
|
|
4709
|
+
const setStatus = (status) => {
|
|
4710
|
+
statuses[status.harness] = status;
|
|
4711
|
+
save();
|
|
4712
|
+
deps.publish({ ...statuses });
|
|
4713
|
+
};
|
|
4714
|
+
const fail = (harness, target, detail) => {
|
|
4715
|
+
const attempt = attempts.get(harness);
|
|
4716
|
+
attempt.detail = detail;
|
|
4717
|
+
const gaveUp = attempt.attempts >= AGENT_AUTO_UPDATE_MAX_ATTEMPTS;
|
|
4718
|
+
deps.log(`[AGENT AUTO-UPDATE] ${harness} \u2192 ${target} failed (attempt ${attempt.attempts}): ${detail}${gaveUp ? "; giving up on this version" : ""}`);
|
|
4719
|
+
setStatus({ harness, target, state: gaveUp ? "gave-up" : "failed", detail, attempts: attempt.attempts, at: now() });
|
|
4720
|
+
};
|
|
4721
|
+
async function tick() {
|
|
4722
|
+
if (ticking || pending) return;
|
|
4723
|
+
ticking = true;
|
|
4724
|
+
try {
|
|
4725
|
+
for (const harness of AGENT_AUTO_UPDATE_HARNESSES) {
|
|
4726
|
+
const decision = decideAgentAutoUpdate({
|
|
4727
|
+
harness,
|
|
4728
|
+
enabled: deps.enabled(),
|
|
4729
|
+
versions: deps.versions(),
|
|
4730
|
+
turnActive: deps.turnActive(harness),
|
|
4731
|
+
installerBusy: deps.installerBusy(),
|
|
4732
|
+
attempt: attempts.get(harness),
|
|
4733
|
+
now: now()
|
|
4734
|
+
});
|
|
4735
|
+
if (decision.action !== "install") {
|
|
4736
|
+
const status = statuses[harness];
|
|
4737
|
+
if (decision.reason === "still-outdated" && status?.state === "installed" && status.target === decision.target) {
|
|
4738
|
+
const attempt2 = attempts.get(harness);
|
|
4739
|
+
attempt2.attempts = AGENT_AUTO_UPDATE_MAX_ATTEMPTS;
|
|
4740
|
+
fail(harness, decision.target, "still_outdated_after_install");
|
|
4741
|
+
}
|
|
4742
|
+
continue;
|
|
4743
|
+
}
|
|
4744
|
+
const prior = attempts.get(harness);
|
|
4745
|
+
const attempt = prior?.target === decision.target ? { ...prior, attempts: prior.attempts + 1, lastAt: now() } : { target: decision.target, attempts: 1, lastAt: now() };
|
|
4746
|
+
attempts.set(harness, attempt);
|
|
4747
|
+
deps.log(`[AGENT AUTO-UPDATE] ${harness} ${decision.from ?? "?"} \u2192 ${decision.target} (attempt ${attempt.attempts})`);
|
|
4748
|
+
pending = { harness, target: decision.target };
|
|
4749
|
+
setStatus({ harness, target: decision.target, state: "installing", attempts: attempt.attempts, at: now() });
|
|
4750
|
+
const result = await deps.request(harness).catch((error) => ({ error: `request_failed: ${String(error)}` }));
|
|
4751
|
+
if ("accepted" in result) return;
|
|
4752
|
+
pending = null;
|
|
4753
|
+
if (TRANSIENT_REFUSALS.has(result.error)) {
|
|
4754
|
+
if (prior?.target === decision.target) attempts.set(harness, prior);
|
|
4755
|
+
else attempts.delete(harness);
|
|
4756
|
+
const before = statuses[harness];
|
|
4757
|
+
delete statuses[harness];
|
|
4758
|
+
save();
|
|
4759
|
+
if (before) deps.publish({ ...statuses });
|
|
4760
|
+
continue;
|
|
4761
|
+
}
|
|
4762
|
+
fail(harness, decision.target, result.error);
|
|
4763
|
+
}
|
|
4764
|
+
} finally {
|
|
4765
|
+
ticking = false;
|
|
4766
|
+
}
|
|
4767
|
+
}
|
|
4768
|
+
function onInstallState(state) {
|
|
4769
|
+
if (!pending || state.harness !== pending.harness || state.state === "installing") return;
|
|
4770
|
+
const { harness, target } = pending;
|
|
4771
|
+
pending = null;
|
|
4772
|
+
const attempt = attempts.get(harness);
|
|
4773
|
+
if (!attempt) return;
|
|
4774
|
+
if (state.state === "installed") {
|
|
4775
|
+
attempt.succeeded = true;
|
|
4776
|
+
deps.log(`[AGENT AUTO-UPDATE] ${harness} \u2192 ${target} installed`);
|
|
4777
|
+
setStatus({ harness, target, state: "installed", attempts: attempt.attempts, at: now() });
|
|
4778
|
+
} else {
|
|
4779
|
+
fail(harness, target, state.detail ?? "unknown");
|
|
4780
|
+
}
|
|
4781
|
+
}
|
|
4782
|
+
return { tick, onInstallState, statuses: () => ({ ...statuses }) };
|
|
4783
|
+
}
|
|
4784
|
+
const AGENT_AUTO_UPDATE_TICK_MS = 5 * 60 * 1e3;
|
|
4785
|
+
function resolveAgentAutoUpdateTickMs(raw) {
|
|
4786
|
+
const value = raw === void 0 ? NaN : Number(raw);
|
|
4787
|
+
return Number.isFinite(value) && value >= 1e3 ? value : AGENT_AUTO_UPDATE_TICK_MS;
|
|
4788
|
+
}
|
|
4789
|
+
|
|
4790
|
+
const STATES = /* @__PURE__ */ new Set(["installing", "installed", "failed", "gave-up"]);
|
|
4791
|
+
const isCount = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0;
|
|
4792
|
+
function parseAttempt(raw) {
|
|
4793
|
+
if (!raw || typeof raw !== "object") return null;
|
|
4794
|
+
const { target, attempts, lastAt, succeeded, detail } = raw;
|
|
4795
|
+
if (typeof target !== "string" || !target || !isCount(attempts) || !isCount(lastAt)) return null;
|
|
4796
|
+
return {
|
|
4797
|
+
target,
|
|
4798
|
+
attempts,
|
|
4799
|
+
lastAt,
|
|
4800
|
+
...succeeded === true ? { succeeded: true } : {},
|
|
4801
|
+
...typeof detail === "string" ? { detail } : {}
|
|
4802
|
+
};
|
|
4803
|
+
}
|
|
4804
|
+
function parseStatus(harness, raw) {
|
|
4805
|
+
if (!raw || typeof raw !== "object") return null;
|
|
4806
|
+
const { target, state, detail, attempts, at } = raw;
|
|
4807
|
+
if (typeof target !== "string" || !target || typeof state !== "string" || !STATES.has(state) || !isCount(attempts) || !isCount(at)) return null;
|
|
4808
|
+
return {
|
|
4809
|
+
harness,
|
|
4810
|
+
target,
|
|
4811
|
+
state,
|
|
4812
|
+
attempts,
|
|
4813
|
+
at,
|
|
4814
|
+
...typeof detail === "string" ? { detail } : {}
|
|
4815
|
+
};
|
|
4816
|
+
}
|
|
4817
|
+
function parseAgentAutoUpdatePersisted(raw) {
|
|
4818
|
+
const out = { attempts: {}, statuses: {} };
|
|
4819
|
+
if (!raw || typeof raw !== "object") return out;
|
|
4820
|
+
const { attempts, statuses } = raw;
|
|
4821
|
+
for (const [harness, value] of Object.entries(attempts && typeof attempts === "object" ? attempts : {})) {
|
|
4822
|
+
const attempt = parseAttempt(value);
|
|
4823
|
+
if (attempt) out.attempts[harness] = attempt;
|
|
4824
|
+
}
|
|
4825
|
+
for (const [harness, value] of Object.entries(statuses && typeof statuses === "object" ? statuses : {})) {
|
|
4826
|
+
const status = parseStatus(harness, value);
|
|
4827
|
+
if (status) out.statuses[harness] = status;
|
|
4828
|
+
}
|
|
4829
|
+
return out;
|
|
4830
|
+
}
|
|
4831
|
+
function agentAutoUpdateStore(homeDir) {
|
|
4832
|
+
const file = join(homeDir, "agent-auto-update.json");
|
|
4833
|
+
return {
|
|
4834
|
+
read() {
|
|
4835
|
+
try {
|
|
4836
|
+
return parseAgentAutoUpdatePersisted(JSON.parse(readFileSync(file, "utf8")));
|
|
4837
|
+
} catch {
|
|
4838
|
+
return { attempts: {}, statuses: {} };
|
|
4839
|
+
}
|
|
4840
|
+
},
|
|
4841
|
+
write(state) {
|
|
4842
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
4843
|
+
writeFileSync(tmp, JSON.stringify(state), { mode: 384 });
|
|
4844
|
+
renameSync(tmp, file);
|
|
4845
|
+
}
|
|
4846
|
+
};
|
|
4847
|
+
}
|
|
4848
|
+
|
|
4657
4849
|
function buildPresenceBatch(live, previous) {
|
|
4658
4850
|
const current = new Set(live.map((s) => s.sessionId));
|
|
4659
4851
|
const sessions = live.slice(0, 200).map((s) => ({
|
|
@@ -7710,6 +7902,7 @@ async function startDaemon() {
|
|
|
7710
7902
|
let claudeCredentialStoreSetting = (await readSettings()).claudeCredentialStore === "file" ? "file" : "auto";
|
|
7711
7903
|
let agentHibernationSetting = (await readSettings()).agentHibernationIdleMs;
|
|
7712
7904
|
let autoRestartSetting = (await readSettings()).autoRestartSessions !== false;
|
|
7905
|
+
let agentAutoUpdateSetting = (await readSettings()).agentAutoUpdate === true;
|
|
7713
7906
|
try {
|
|
7714
7907
|
const homes = await refreshAgentHomes();
|
|
7715
7908
|
logger.debug(`[DAEMON RUN] Claude config dir: ${describeAgentHome(homes.claudeConfigDir)}; Codex home: ${describeAgentHome(homes.codexHome)}`);
|
|
@@ -8410,6 +8603,7 @@ async function startDaemon() {
|
|
|
8410
8603
|
}
|
|
8411
8604
|
return sessionIdToFinishedSession.get(happySessionId);
|
|
8412
8605
|
};
|
|
8606
|
+
const trackedSessionFlavor = (happySessionId) => findTrackedSessionById(happySessionId)?.happySessionMetadataFromLocalWebhook?.flavor ?? "claude";
|
|
8413
8607
|
const persistRestoreRecord = (happySessionId, fallback, metadata) => {
|
|
8414
8608
|
const candidates = [...pidToTrackedSession.values()].filter((s) => s.happySessionId === happySessionId && isPidAlive(s.pid));
|
|
8415
8609
|
const live = candidates.find((s) => s.childProcess) ?? candidates[0];
|
|
@@ -8645,6 +8839,16 @@ async function startDaemon() {
|
|
|
8645
8839
|
};
|
|
8646
8840
|
const restartSessionImpl = async (happySessionId, options) => {
|
|
8647
8841
|
try {
|
|
8842
|
+
if (options?.ifIdle) {
|
|
8843
|
+
const busy = restartIdleRefusal({
|
|
8844
|
+
turnActive: turnActivity.activeSessions().includes(happySessionId),
|
|
8845
|
+
backgroundTasks: backgroundTasks.count(happySessionId)
|
|
8846
|
+
});
|
|
8847
|
+
if (busy) {
|
|
8848
|
+
logger.debug(`[DAEMON RUN] restart-session ${happySessionId} refused (ifIdle): ${busy}`);
|
|
8849
|
+
return { type: "error", errorMessage: `busy:${busy}` };
|
|
8850
|
+
}
|
|
8851
|
+
}
|
|
8648
8852
|
const counts = options?.account ? accountRestartCounts : restartCounts;
|
|
8649
8853
|
const prior = counts.get(happySessionId) ?? 0;
|
|
8650
8854
|
const decision = options?.auto ? { allowed: true } : decideRestart(prior, options?.account ? DEFAULT_MAX_ACCOUNT_RESTARTS : DEFAULT_MAX_RESTARTS);
|
|
@@ -9133,6 +9337,13 @@ async function startDaemon() {
|
|
|
9133
9337
|
return autoRestartSetting;
|
|
9134
9338
|
});
|
|
9135
9339
|
setTimeout(() => autoRestartScheduler.sweep(), 5e3).unref?.();
|
|
9340
|
+
let agentAutoUpdater = null;
|
|
9341
|
+
apiMachine.setAgentAutoUpdateHandlers(agentAutoUpdateSetting, async (enabled) => {
|
|
9342
|
+
await updateSettings((current) => ({ ...current, agentAutoUpdate: enabled }));
|
|
9343
|
+
agentAutoUpdateSetting = enabled;
|
|
9344
|
+
void agentAutoUpdater?.tick();
|
|
9345
|
+
return agentAutoUpdateSetting;
|
|
9346
|
+
});
|
|
9136
9347
|
const accountService = new AccountService({
|
|
9137
9348
|
home: configuration.happyHomeDir,
|
|
9138
9349
|
env: process.env,
|
|
@@ -9272,7 +9483,9 @@ async function startDaemon() {
|
|
|
9272
9483
|
const stopAgentVersionChecks = startAgentVersionChecks(
|
|
9273
9484
|
(snapshot) => {
|
|
9274
9485
|
latestAgentVersions = snapshot;
|
|
9275
|
-
return apiMachine.updateDaemonState((state) => ({ ...state, status: state?.status ?? "running", agentVersions: snapshot }))
|
|
9486
|
+
return apiMachine.updateDaemonState((state) => ({ ...state, status: state?.status ?? "running", agentVersions: snapshot })).finally(() => {
|
|
9487
|
+
void agentAutoUpdater?.tick();
|
|
9488
|
+
});
|
|
9276
9489
|
},
|
|
9277
9490
|
(error) => logger.debug("[DAEMON RUN] Agent version check failed", error)
|
|
9278
9491
|
);
|
|
@@ -9282,6 +9495,7 @@ async function startDaemon() {
|
|
|
9282
9495
|
commandOnPath,
|
|
9283
9496
|
cliUpdateBusy: () => updateController.isRunning() || handoverInFlight,
|
|
9284
9497
|
publish: (state) => {
|
|
9498
|
+
agentAutoUpdater?.onInstallState(state);
|
|
9285
9499
|
void apiMachine.updateDaemonState((current) => ({ ...current, status: current?.status ?? "running", harnessInstall: state })).catch((error) => logger.debug("[DAEMON RUN] harness install state publish failed", error));
|
|
9286
9500
|
},
|
|
9287
9501
|
afterInstall: async () => {
|
|
@@ -9291,6 +9505,22 @@ async function startDaemon() {
|
|
|
9291
9505
|
log: (message) => logger.warn(`[DAEMON RUN] ${message}`)
|
|
9292
9506
|
});
|
|
9293
9507
|
apiMachine.setHarnessInstallHandler((params) => harnessInstaller.request(params));
|
|
9508
|
+
agentAutoUpdater = createAgentAutoUpdater({
|
|
9509
|
+
enabled: () => agentAutoUpdateSetting,
|
|
9510
|
+
versions: () => latestAgentVersions,
|
|
9511
|
+
turnActive: (harness) => turnActivity.activeSessions().some((id) => trackedSessionFlavor(id) === harness),
|
|
9512
|
+
installerBusy: () => !!harnessInstaller?.isRunning() || updateController.isRunning() || handoverInFlight,
|
|
9513
|
+
request: (harness) => harnessInstaller.request({ harness }, "auto-update"),
|
|
9514
|
+
publish: (status) => {
|
|
9515
|
+
void apiMachine.setAgentAutoUpdateStatus(status);
|
|
9516
|
+
},
|
|
9517
|
+
log: (message) => logger.warn(`[DAEMON RUN] ${message}`),
|
|
9518
|
+
store: agentAutoUpdateStore(configuration.happyHomeDir)
|
|
9519
|
+
});
|
|
9520
|
+
const agentAutoUpdateInterval = setInterval(() => {
|
|
9521
|
+
void agentAutoUpdater?.tick();
|
|
9522
|
+
}, resolveAgentAutoUpdateTickMs(process.env.HAPPY_AGENT_AUTO_UPDATE_TICK_MS));
|
|
9523
|
+
agentAutoUpdateInterval.unref?.();
|
|
9294
9524
|
const heartbeatIntervalMs = parseInt(process.env.HAPPY_DAEMON_HEARTBEAT_INTERVAL || "60000");
|
|
9295
9525
|
const wakeDetector = createWakeDetector(heartbeatIntervalMs);
|
|
9296
9526
|
const restartOnStaleVersionAndHeartbeat = setInterval(serialTask(async () => {
|
|
@@ -9340,6 +9570,7 @@ async function startDaemon() {
|
|
|
9340
9570
|
projectPresence?.stop();
|
|
9341
9571
|
clearInterval(restartOnStaleVersionAndHeartbeat);
|
|
9342
9572
|
clearInterval(cliUpdateInterval);
|
|
9573
|
+
clearInterval(agentAutoUpdateInterval);
|
|
9343
9574
|
policyAnnouncements.stop();
|
|
9344
9575
|
policyRefresh.stop();
|
|
9345
9576
|
stopAgentVersionChecks();
|
|
@@ -9481,6 +9712,7 @@ async function startDaemon() {
|
|
|
9481
9712
|
logger.debug("[DAEMON RUN] Health check interval cleared");
|
|
9482
9713
|
}
|
|
9483
9714
|
clearInterval(cliUpdateInterval);
|
|
9715
|
+
clearInterval(agentAutoUpdateInterval);
|
|
9484
9716
|
clearInterval(autoRestartSweep);
|
|
9485
9717
|
policyAnnouncements.stop();
|
|
9486
9718
|
policyRefresh.stop();
|