very-happy-cli 0.2.178 → 0.2.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcpBackend-DCQXHRzT.mjs → AcpBackend-CHp3y7cb.mjs} +135 -16
- package/dist/{AcpBackend-CDkAQXYf.cjs → AcpBackend-DFipFF7-.cjs} +135 -16
- package/dist/{AcpSessionManager-DckmUZza.cjs → AcpSessionManager-0zpvRJXc.cjs} +38 -4
- package/dist/{AcpSessionManager-BXrQcqwC.mjs → AcpSessionManager-d2-rKWWa.mjs} +38 -4
- package/dist/{BasePermissionHandler-DyLmKKtO.cjs → BasePermissionHandler-CH3zuEkA.cjs} +5 -2
- package/dist/{BasePermissionHandler-BVlrEhIi.mjs → BasePermissionHandler-DdZBYIR4.mjs} +5 -2
- package/dist/acpSessionResume-DTGmAPLt.mjs +67 -0
- package/dist/acpSessionResume-oiCBnAVA.cjs +74 -0
- package/dist/{agentHome-CEp9RMyK.cjs → agentHome-BWcz8mz0.cjs} +4 -4
- package/dist/{agentHome-C1xi37as.mjs → agentHome-CghLvL_1.mjs} +4 -4
- package/dist/{api-JANhFdZV.cjs → api-Cmjfr8Z7.cjs} +28 -260
- package/dist/{api-Dib0dmqC.mjs → api-CzwFpJQc.mjs} +21 -253
- package/dist/{apiMachine-DNTJidYH.mjs → apiMachine-DJkTEiqy.mjs} +43 -15
- package/dist/{apiMachine-QhK-sKcr.cjs → apiMachine-G6OogT08.cjs} +43 -15
- package/dist/{attachmentContent-DkkdpSSJ.mjs → attachmentContent-B2os4HbA.mjs} +2 -2
- package/dist/{attachmentContent-bpQTBJ0y.cjs → attachmentContent-Bo0UAsSu.cjs} +4 -4
- package/dist/{auth-BRjd2esb.mjs → auth-BS6PaOOG.mjs} +5 -5
- package/dist/{auth-DgIV0Cvt.cjs → auth-D6bBUwZa.cjs} +5 -5
- package/dist/{auth-DNct7VUi.mjs → auth-DMX0xPNK.mjs} +8 -8
- package/dist/{auth-omWDtgR8.cjs → auth-HEhRaNgL.cjs} +8 -8
- package/dist/{auto-CI16FZmX.cjs → auto-C6I55iOh.cjs} +18 -17
- package/dist/{auto-DKGFOJBo.mjs → auto-Cl1SEDcD.mjs} +18 -17
- package/dist/{bootstrap-DCQ87Aan.cjs → bootstrap-exVucYav.cjs} +2 -2
- package/dist/{bootstrap-BUagGC_-.mjs → bootstrap-iuyufnp3.mjs} +2 -2
- package/dist/{browser-CSKhc0Bl.cjs → browser-BohJK12g.cjs} +1 -1
- package/dist/{browser-Dj_DYQEh.mjs → browser-CSYum7xH.mjs} +1 -1
- package/dist/{claudeLocal-CCCvAeMd.mjs → claudeLocal-Dq_R3Ax_.mjs} +6 -5
- package/dist/{claudeLocal-CdIVnOZp.cjs → claudeLocal-re4yjSTx.cjs} +6 -5
- package/dist/{claudeLocalLauncher-21-xh5gc.cjs → claudeLocalLauncher-B4hJHpCA.cjs} +11 -10
- package/dist/{claudeLocalLauncher-BmrpaRYJ.mjs → claudeLocalLauncher-CN67lN7-.mjs} +11 -10
- package/dist/{claudeSessionFork-DvxMKAmY.mjs → claudeSessionFork-BihfD0Ik.mjs} +1 -1
- package/dist/{claudeSessionFork-kYCP1IJB.cjs → claudeSessionFork-DiSMYerV.cjs} +1 -1
- package/dist/{client-Dnza1hgN.cjs → client-BKcK1Bi-.cjs} +3 -3
- package/dist/client-BhoEBnuN.mjs +71 -0
- package/dist/{client-C4zKGjiJ.cjs → client-CuVdN6PP.cjs} +2 -2
- package/dist/{client-BTX9hsbr.mjs → client-DuTDwWSQ.mjs} +3 -3
- package/dist/client-ZjOsn6nZ.cjs +76 -0
- package/dist/{client-CnlkkrZO.mjs → client-wo9nbxuf.mjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +24 -15
- package/dist/codex/happyMcpStdioBridge.mjs +24 -15
- package/dist/{codexAppServerClient-DvkpQgyv.mjs → codexAppServerClient-BK3zra_1.mjs} +3 -3
- package/dist/{codexAppServerClient-CRlBWGn3.cjs → codexAppServerClient-Dt5zxrun.cjs} +3 -3
- package/dist/{codexCommand-BxjogBzU.mjs → codexCommand-B6pY7CMh.mjs} +65 -60
- package/dist/{codexCommand-DzxIWXIT.cjs → codexCommand-CAZ1SLjg.cjs} +88 -83
- package/dist/{codexTermination-ySDNMEhd.mjs → codexTermination-Cd1Eon_4.mjs} +1 -1
- package/dist/{codexTermination-C28FzlLb.cjs → codexTermination-DmGbHxcD.cjs} +1 -1
- package/dist/{config-DwfEpFr3.mjs → config-2oMG_fEI.mjs} +3 -3
- package/dist/{config-BFB5uJ4t.cjs → config-B0uK6K7n.cjs} +3 -3
- package/dist/{configuration-4TGMrjul.cjs → configuration-CMHZnp6G.cjs} +1 -1
- package/dist/{configuration-DVrb61aY.mjs → configuration-WMi4idBB.mjs} +1 -1
- package/dist/{connect-C7FPY0PI.mjs → connect-BLVHhHzA.mjs} +14 -14
- package/dist/{connect-QH2VJGBG.cjs → connect-uaglGrde.cjs} +14 -14
- package/dist/{context-JoKu0V54.cjs → context-DXzU5bFM.cjs} +1 -1
- package/dist/{context-B3XPVJlj.mjs → context-DploEcoN.mjs} +1 -1
- package/dist/{controlClient-BYKyGyxj.mjs → controlClient-BWUJrj3t.mjs} +3 -3
- package/dist/{controlClient-BTaZlbC6.cjs → controlClient-C-5qCt8W.cjs} +3 -3
- package/dist/{createSessionMetadata-8Fuj2-IV.mjs → createSessionMetadata-3uXrJgOW.mjs} +2 -2
- package/dist/{createSessionMetadata-B2NynaWZ.cjs → createSessionMetadata-BkIzHALd.cjs} +2 -2
- package/dist/{defaultPermissionMode-B8kJG9uI.mjs → defaultPermissionMode-BzxLh20a.mjs} +2 -2
- package/dist/{defaultPermissionMode-BEWCqJU-.cjs → defaultPermissionMode-pS3vmiSg.cjs} +2 -2
- package/dist/{deterministicJson-BjNQsAjO.cjs → deterministicJson-B8z2GPi9.cjs} +220 -14
- package/dist/{deterministicJson-C5ZwZ7hu.mjs → deterministicJson-D_whDMFd.mjs} +217 -12
- package/dist/{doctor-BshRnjLi.cjs → doctor-Br1Kcy2J.cjs} +7 -7
- package/dist/{doctor-0BiGwJXk.mjs → doctor-CmtSsR2-.mjs} +7 -7
- package/dist/{downloadTarget-BN5vZt3K.cjs → downloadTarget-BQJK_6oH.cjs} +6 -6
- package/dist/{downloadTarget-DJPwAZlu.mjs → downloadTarget-BoNwTIH_.mjs} +6 -6
- package/dist/{ensureDaemonRunning-C5QfToCe.cjs → ensureDaemonRunning-BRUmsq6J.cjs} +5 -5
- package/dist/{ensureDaemonRunning-CSmb_mqt.mjs → ensureDaemonRunning-Czo9IHJQ.mjs} +5 -5
- package/dist/{handleResumeCommand-CgjpsdDe.mjs → handleResumeCommand-C8thKjqf.mjs} +21 -5
- package/dist/{handleResumeCommand-BwnUZmbo.cjs → handleResumeCommand-tKD_Hpxc.cjs} +21 -5
- package/dist/{index-BYOZ_8WZ.cjs → index-B0UjHlAe.cjs} +4 -4
- package/dist/{index-BehVbAsA.mjs → index-BTxHphpV.mjs} +254 -49
- package/dist/index-BiyC7cZ3.mjs +18 -0
- package/dist/{index-_l1Sdmbi.cjs → index-C6O2vVjm.cjs} +154 -33
- package/dist/index-CUuc6iCn.cjs +24 -0
- package/dist/{index-Bvldtdny.mjs → index-CdQI0C9p.mjs} +4 -4
- package/dist/{index-BRClDe07.cjs → index-D09T1m8Y.cjs} +3 -3
- package/dist/{index-BYgfern_.mjs → index-D3bidoG8.mjs} +3 -3
- package/dist/{index-piJPsTsm.cjs → index-DMqDMT1Q.cjs} +256 -51
- package/dist/{index-Clqlu17M.mjs → index-DPOa4NhL.mjs} +153 -34
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-BdvKiOQw.mjs → install-BX3lv3NO.mjs} +1 -1
- package/dist/{install-Cf6AFSWC.cjs → install-BXvf2E3o.cjs} +1 -1
- package/dist/{install-TO4taKW7.cjs → install-CYRZxS87.cjs} +3 -3
- package/dist/{install-fYWHrPcC.mjs → install-hnve_9vq.mjs} +3 -3
- package/dist/lib.cjs +13 -13
- package/dist/lib.d.cts +62 -1
- package/dist/lib.d.mts +62 -1
- package/dist/lib.mjs +13 -13
- package/dist/{lidState-DNMlIhX0.mjs → lidState-Bb8fgXg3.mjs} +1 -1
- package/dist/{lidState-BeOwj6eW.cjs → lidState-Dv2wwFTj.cjs} +1 -1
- package/dist/{localHappyAgentAuth-Br-mgogg.cjs → localHappyAgentAuth-DjYvkXvV.cjs} +1 -1
- package/dist/{localHappyAgentAuth-BezKSFDi.mjs → localHappyAgentAuth-NEU7fax7.mjs} +1 -1
- package/dist/{logger--vAVtXB_.mjs → logger-BtVhHnD8.mjs} +2 -2
- package/dist/{logger-DXTWlPzP.cjs → logger-C1GWx3gi.cjs} +2 -2
- package/dist/{machineMetadata-DcUupMje.cjs → machineMetadata-CLHS9sv_.cjs} +3 -3
- package/dist/{machineMetadata-B1H9gNbN.mjs → machineMetadata-D-g--oU_.mjs} +3 -3
- package/dist/{main-CshDb5-1.mjs → main-B2LWV8DI.mjs} +58 -45
- package/dist/{main-DoMFJ2Cl.cjs → main-CWhSsbtU.cjs} +58 -45
- package/dist/{mcp-pNc1EbQf.cjs → mcp-CARUsXHV.cjs} +14 -14
- package/dist/{mcp-DKT_lrvQ.mjs → mcp-ext92q3Y.mjs} +14 -14
- package/dist/{mirrorProtocol-6IFGPpjJ.mjs → mirrorProtocol-BwYibqry.mjs} +3 -3
- package/dist/{mirrorProtocol-qKflWTX_.cjs → mirrorProtocol-DEy2g1CB.cjs} +3 -3
- package/dist/{package-B7B03ejW.mjs → package-BPPebGQF.mjs} +7 -7
- package/dist/{package-DY4zTbKS.cjs → package-SgqTYsjn.cjs} +7 -7
- package/dist/panels-BZ0_Tt7B.mjs +137 -0
- package/dist/panels-D1c7q2dD.cjs +142 -0
- package/dist/{peerTools-3R9RUARX.mjs → peerTools-CWKzcQ7u.mjs} +60 -10
- package/dist/{peerTools-iy3_6Yc5.cjs → peerTools-DRQETXaz.cjs} +60 -9
- package/dist/{persistence-BfX72dne.cjs → persistence-BegE7NPa.cjs} +2 -2
- package/dist/{persistence-DTk4sNpd.mjs → persistence-Cr-wutZ4.mjs} +3 -3
- package/dist/{piRunnerArgs-CRQVR9o-.cjs → piRunnerArgs-Cs-378Vz.cjs} +8 -2
- package/dist/{piRunnerArgs-AT8QJY7x.mjs → piRunnerArgs-DwvM_yWA.mjs} +7 -1
- package/dist/{piRuntime-BHRT5MKO.cjs → piRuntime-BG-1td_n.cjs} +2 -2
- package/dist/{piRuntime-E44qTVQ4.mjs → piRuntime-Bue5mnlc.mjs} +2 -2
- package/dist/{piTerminal-De8nbciM.mjs → piTerminal-B5x9X5yV.mjs} +17 -17
- package/dist/{piTerminal-hI4WFdWm.cjs → piTerminal-G4z-xVyy.cjs} +17 -17
- package/dist/processTreeSnapshot-CuLJDNC-.mjs +101 -0
- package/dist/processTreeSnapshot-mDbnuojn.cjs +105 -0
- package/dist/prompt-BOouDaTM.mjs +99 -0
- package/dist/prompt-lgF9IE82.cjs +105 -0
- package/dist/{attachmentLimits-UyFn8fkQ.mjs → pushNotifications-BdFjDjQe.mjs} +303 -3
- package/dist/{attachmentLimits-SqeAHrVC.cjs → pushNotifications-DaLQUyi0.cjs} +304 -2
- package/dist/{index-DFPT4HOO.cjs → query-Ctfg-5gy.cjs} +25 -5
- package/dist/{index-CEjJnq05.mjs → query-DYP_W1wp.mjs} +26 -3
- package/dist/{rateLimitWindows-XrJiiBpU.mjs → rateLimitWindows-CuEqk_0g.mjs} +1 -1
- package/dist/{rateLimitWindows-Czb7_7cK.cjs → rateLimitWindows-Dj_8voBK.cjs} +1 -1
- package/dist/{registerCommonHandlers-CvIedVRf.mjs → registerCommonHandlers-BAlP7SGc.mjs} +2 -2
- package/dist/{registerCommonHandlers-C0_fyBQ0.cjs → registerCommonHandlers-Cj084Sg7.cjs} +2 -2
- package/dist/{registerKillSessionHandler-gwJ5lTf0.mjs → registerKillSessionHandler-PD0jWtQo.mjs} +6 -6
- package/dist/{registerKillSessionHandler-DYl7l4Ts.cjs → registerKillSessionHandler-qMju0ZfF.cjs} +6 -6
- package/dist/{remoteSessionClient-BRTIOX5b.cjs → remoteSessionClient-B7i7MkYV.cjs} +5 -5
- package/dist/{remoteSessionClient-DRb2Jr5s.mjs → remoteSessionClient-Bn2qu5C5.mjs} +5 -5
- package/dist/{reportProgressTool-B9nCzbkL.cjs → reportProgressTool-CM1JFAHg.cjs} +84 -2
- package/dist/{reportProgressTool-D5tEoXMW.mjs → reportProgressTool-gHItlSzz.mjs} +82 -3
- package/dist/{resources-JDPugcDq.cjs → resources-CvIlkzpP.cjs} +30 -0
- package/dist/{resources-BdFBQi8r.mjs → resources-y9jfyO-_.mjs} +30 -0
- package/dist/{run-BQ_FGaOL.mjs → run-BM4TxiyN.mjs} +177 -41
- package/dist/{run-CKe_WeLW.cjs → run-CNXwIe0A.cjs} +191 -55
- package/dist/{runClaude-MHI5IKM-.cjs → runClaude-CWhj2V4Q.cjs} +36 -40
- package/dist/{runClaude-zrrNcQC_.mjs → runClaude-C_3I8hvR.mjs} +36 -40
- package/dist/{runClaudeDeps-RRw-Nusc.cjs → runClaudeDeps-B81cOKnH.cjs} +294 -156
- package/dist/{runClaudeDeps-CVBCokOS.mjs → runClaudeDeps-QGrOeDe2.mjs} +294 -159
- package/dist/{runGemini-kipag2ag.mjs → runGemini-BEdWEZLR.mjs} +60 -54
- package/dist/{runGemini-D7Lg9yCr.cjs → runGemini-CgRLYbt5.cjs} +60 -54
- package/dist/{runOpenClaw-DCcQ0L2N.cjs → runOpenClaw-C1NVmzOL.cjs} +18 -18
- package/dist/{runOpenClaw-C_lRY3Do.mjs → runOpenClaw-DdQZAYj1.mjs} +18 -18
- package/dist/{sandbox-BSyXFVFp.mjs → sandbox-DjQUdCMG.mjs} +4 -4
- package/dist/{sandbox-dMwPTmjm.cjs → sandbox-nocIjliq.cjs} +4 -4
- package/dist/selfCheck-CjCF4C3v.mjs +85 -0
- package/dist/{selfCheck-DkzDDUsE.cjs → selfCheck-DCt4Uzbq.cjs} +36 -35
- package/dist/{send-C-k9nsd3.mjs → send-Ct7X4pPU.mjs} +8 -8
- package/dist/{send-dxC0miIA.cjs → send-Dydf_hwZ.cjs} +8 -8
- package/dist/{server-B-W6P7Qr.cjs → server-CosABFbd.cjs} +6 -6
- package/dist/{server-DxoTYNlw.mjs → server-DTQGZMxh.mjs} +4 -4
- package/dist/{sessionLock-DWX6BbiU.cjs → sessionLock-DokGab2R.cjs} +16 -3
- package/dist/{sessionLock-DBdtZGOL.mjs → sessionLock-WYIyaVO4.mjs} +16 -4
- package/dist/{sessionOps-BVoXe12O.mjs → sessionOps-BIGgRube.mjs} +10 -5
- package/dist/{sessionOps-BAnr7n8t.cjs → sessionOps-S-qPBLFf.cjs} +10 -5
- package/dist/{sessionScanner-CDOYsEUD.cjs → sessionScanner-CIMM2hvZ.cjs} +3 -3
- package/dist/{sessionScanner-BtxoeluY.mjs → sessionScanner-o5hnMi5e.mjs} +3 -3
- package/dist/{sessions-C3sZJkzI.mjs → sessions-BJHEZpi2.mjs} +39 -17
- package/dist/{sessions-hAitoN-m.cjs → sessions-JchI1w3z.cjs} +39 -16
- package/dist/{setupOfflineReconnection-C2EeYTFH.cjs → setupOfflineReconnection-CNiAt5ZP.cjs} +2 -2
- package/dist/{setupOfflineReconnection-_eD4cuUT.mjs → setupOfflineReconnection-DMiBO2y9.mjs} +2 -2
- package/dist/{spawn-Bc9v7pIf.cjs → spawn-6PD7nnoC.cjs} +48 -17
- package/dist/{spawn-qNrB2CD_.mjs → spawn-DgvUNYEo.mjs} +48 -17
- package/dist/{spawnAgents-BVEaz35W.cjs → spawnAgents-DsXgegHM.cjs} +37 -1
- package/dist/spawnAgents-P006Hqio.mjs +79 -0
- package/dist/{spawnHappyCLI-C2stUioM.mjs → spawnHappyCLI-CCOrEtf9.mjs} +1 -1
- package/dist/{spawnHappyCLI-fzUagkKV.cjs → spawnHappyCLI-Dywezwk6.cjs} +1 -1
- package/dist/{specialCommands-C6W-rVyh.mjs → specialCommands-DPcd9edP.mjs} +3 -3
- package/dist/{specialCommands-BJ-nqY4s.cjs → specialCommands-QxPpkGKf.cjs} +3 -3
- package/dist/{startFileWatcher-CR09Snmz.mjs → startFileWatcher-DghDOCO4.mjs} +1 -1
- package/dist/{startFileWatcher-Bqlqjt93.cjs → startFileWatcher-RECH5qY8.cjs} +1 -1
- package/dist/{streamRelay-CJoMk_d2.mjs → streamRelay-DMV_TXfS.mjs} +1 -1
- package/dist/{streamRelay-9kBPpbvU.cjs → streamRelay-DlUWKUpo.cjs} +1 -1
- package/dist/{sync-DbW07iQS.mjs → sync-CSe0Rf45.mjs} +1 -1
- package/dist/{sync-Dhmtk66S.cjs → sync-D23jbqVa.cjs} +1 -1
- package/dist/{systemPrompt-3PYi3EUY.cjs → systemPrompt-BOy4kU4P.cjs} +4 -3
- package/dist/{systemPrompt-CQcuUmVp.mjs → systemPrompt-CFNKnh65.mjs} +4 -3
- package/dist/{teams-CwF4Z2fA.mjs → teams-DyY669f0.mjs} +8 -8
- package/dist/{teams-DpxLcUU_.cjs → teams-Ov2BDT-A.cjs} +8 -8
- package/dist/{time-BuGWTVP6.mjs → time-65DcU6Jx.mjs} +1 -1
- package/dist/{time-A6zR3Iy6.cjs → time-CrwIMHta.cjs} +1 -1
- package/dist/{titleGenerator-D26gvNaS.cjs → titleGenerator-CS_rh2_J.cjs} +9 -8
- package/dist/{titleGenerator-BGEzNWC9.mjs → titleGenerator-CiAMxf7s.mjs} +9 -8
- package/dist/{todo-DrZc76H5.mjs → todo-BDONw0sK.mjs} +6 -6
- package/dist/{todo-73g3NCIO.cjs → todo-KY-okGii.cjs} +6 -6
- package/dist/{tools-BtsrQnNS.mjs → tools-D8-PnZEG.mjs} +1 -1
- package/dist/{tools-CxJp4T1T.cjs → tools-_w52DZG6.cjs} +1 -1
- package/dist/{uninstall-DWNYvewQ.cjs → uninstall-8vnLN-IE.cjs} +3 -3
- package/dist/{uninstall-DOb2mTwV.mjs → uninstall-_fjGRP9b.mjs} +3 -3
- package/dist/webPanels-B2_C2-3g.mjs +49 -0
- package/dist/webPanels-FCgFKvVe.cjs +53 -0
- package/package.json +7 -7
- package/dist/selfCheck-CF7XGJPb.mjs +0 -84
- package/dist/sessionModeFile-ByLbXTbg.mjs +0 -32
- package/dist/sessionModeFile-CLLdidiJ.cjs +0 -36
- package/dist/spawnAgents-Bw6j4tqz.mjs +0 -45
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { i as isClaudeSessionId, g as extractCompleteLines, h as decideBackfill, j as parseTerminalHookPayload, k as decideMirrorBinding, M as MIRROR_BACKFILL_LINES_DEFAULT, m as mirrorLineKey, n as mirrorLocalId, o as initializeOwnedWorktree, e as summarizeSpawnSessionForLog, q as startAgentVersionChecks, W as WORKTREE_CAPABILITY_VERSION, t as currentWorktreeService } from './mirrorProtocol-
|
|
2
|
-
import { P as PI_ADAPTER_INSTALL_HINT, s as sanitizeSpawnModel } from './piRunnerArgs-
|
|
1
|
+
import { i as isClaudeSessionId, g as extractCompleteLines, h as decideBackfill, j as parseTerminalHookPayload, k as decideMirrorBinding, M as MIRROR_BACKFILL_LINES_DEFAULT, m as mirrorLineKey, n as mirrorLocalId, o as initializeOwnedWorktree, e as summarizeSpawnSessionForLog, q as startAgentVersionChecks, W as WORKTREE_CAPABILITY_VERSION, t as currentWorktreeService } from './mirrorProtocol-BwYibqry.mjs';
|
|
2
|
+
import { P as PI_ADAPTER_INSTALL_HINT, s as sanitizeSpawnModel } from './piRunnerArgs-DwvM_yWA.mjs';
|
|
3
3
|
import fs from 'fs/promises';
|
|
4
4
|
import * as tmp from 'tmp';
|
|
5
5
|
import axios from 'axios';
|
|
6
|
-
import { T as TurnActivityTracker, A as ApiClient } from './api-
|
|
7
|
-
import { S as SPAWN_AGENTS, i as isSpawnAgent, s as sanitizeSpawnPermissionMode, r as resolveSpawnPermissionMode, a as resolveFirstMessageMeta } from './spawnAgents-
|
|
8
|
-
import { l as logger } from './logger
|
|
6
|
+
import { T as TurnActivityTracker, A as ApiClient } from './api-CzwFpJQc.mjs';
|
|
7
|
+
import { S as SPAWN_AGENTS, i as isSpawnAgent, s as sanitizeSpawnPermissionMode, r as resolveSpawnPermissionMode, a as resolveFirstMessageMeta, j as joinProject } from './spawnAgents-P006Hqio.mjs';
|
|
8
|
+
import { l as logger } from './logger-BtVhHnD8.mjs';
|
|
9
9
|
import { readdirSync, statSync, unlinkSync, realpathSync, mkdirSync, writeFileSync, accessSync, constants as constants$1, existsSync, readFileSync, openSync, fsyncSync, closeSync, renameSync } from 'node:fs';
|
|
10
10
|
import { join, isAbsolute, resolve, dirname, sep, basename, delimiter } from 'node:path';
|
|
11
|
-
import { p as pruneStaleCompileCaches } from './index-
|
|
12
|
-
import { a as authAndSetupMachineIfNeeded } from './auth-
|
|
13
|
-
import { c as configuration, f as ensurePrivateDirectorySync, w as writePrivateFileSync } from './configuration-
|
|
11
|
+
import { p as pruneStaleCompileCaches } from './index-D3bidoG8.mjs';
|
|
12
|
+
import { a as authAndSetupMachineIfNeeded } from './auth-BS6PaOOG.mjs';
|
|
13
|
+
import { c as configuration, f as ensurePrivateDirectorySync, w as writePrivateFileSync } from './configuration-WMi4idBB.mjs';
|
|
14
14
|
import { spawn, execSync } from 'child_process';
|
|
15
|
-
import { p as packageJson } from './package-
|
|
16
|
-
import { g as globalPrefixForPackage, a as getEnvironmentInfo } from './doctor-
|
|
17
|
-
import { s as spawnHappyCLI } from './spawnHappyCLI-
|
|
18
|
-
import {
|
|
19
|
-
import { i as isDaemonRunningCurrentlyInstalledHappyVersion, b as stopDaemon, o as cleanupDaemonState } from './controlClient-
|
|
20
|
-
import { e as sendUserMessage, f as readSessionMetadata, r as readSessionTranscript, l as listAccountSessions, a as listSessions, M as MAX_READ_LIMIT, s as sessionWebUrl, g as waitForSessionKey, d as archiveSession, j as analyzeLatestTurn, k as readSessionLog, m as TURN_WINDOW, n as userPromptText } from './sessionOps-
|
|
15
|
+
import { p as packageJson } from './package-BPPebGQF.mjs';
|
|
16
|
+
import { g as globalPrefixForPackage, a as getEnvironmentInfo } from './doctor-CmtSsR2-.mjs';
|
|
17
|
+
import { s as spawnHappyCLI } from './spawnHappyCLI-CCOrEtf9.mjs';
|
|
18
|
+
import { c as readPersistedSessions, r as readSettings, l as latchKeepAwake, q as reportSignature, s as decideDaemonHibernation, t as nextCheckDelay, v as persistSession, d as readDaemonState, x as acquireDaemonLock, a as resolveCheckMs, y as resolveIdleMs, z as deletePersistedSessions, A as writeDaemonState, B as writeSettings, C as settingIdleMs, u as updateSettings, D as rewriteCredentialsForRelay, g as readCredentials, E as releaseDaemonLock } from './persistence-Cr-wutZ4.mjs';
|
|
19
|
+
import { i as isDaemonRunningCurrentlyInstalledHappyVersion, b as stopDaemon, o as cleanupDaemonState } from './controlClient-BWUJrj3t.mjs';
|
|
20
|
+
import { e as sendUserMessage, f as readSessionMetadata, r as readSessionTranscript, l as listAccountSessions, a as listSessions, M as MAX_READ_LIMIT, s as sessionWebUrl, g as waitForSessionKey, d as archiveSession, j as analyzeLatestTurn, k as readSessionLog, m as TURN_WINDOW, n as userPromptText } from './sessionOps-BIGgRube.mjs';
|
|
21
21
|
import fastify from 'fastify';
|
|
22
22
|
import { z } from 'zod';
|
|
23
23
|
import { validatorCompiler, serializerCompiler } from 'fastify-type-provider-zod';
|
|
@@ -25,59 +25,62 @@ import { d as decodeBase64, s as sameRelay, e as encodeBase64, h as decrypt } fr
|
|
|
25
25
|
import { randomBytes, createHash, timingSafeEqual, randomUUID } from 'node:crypto';
|
|
26
26
|
import { c as checkPreviewPath } from './previewPath-CXN4Vag0.mjs';
|
|
27
27
|
import { a as BACKGROUND_TASKS_MAX, c as BACKGROUND_TASK_DESCRIPTION_MAX, d as BackgroundTaskTracker } from './backgroundTaskActivity-BVwJBl02.mjs';
|
|
28
|
-
import { b as sanitizeRateLimitReport } from './rateLimitWindows-
|
|
29
|
-
import { f as formatEditConflictNotice, b as SESSION_PEER_SENT_FROM, s as sendPeerMessage, l as listPeerSessions, C as CLI_PEER_SENDER_ID } from './peerTools-
|
|
28
|
+
import { b as sanitizeRateLimitReport } from './rateLimitWindows-CuEqk_0g.mjs';
|
|
29
|
+
import { f as formatEditConflictNotice, b as SESSION_PEER_SENT_FROM, s as sendPeerMessage, l as listPeerSessions, C as CLI_PEER_SENDER_ID } from './peerTools-CWKzcQ7u.mjs';
|
|
30
30
|
import os, { hostname, homedir, userInfo, tmpdir } from 'node:os';
|
|
31
|
-
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-
|
|
32
|
-
import { assistantHome, bootstrapAssistantHome } from './bootstrap-
|
|
33
|
-
import { refreshAgentHomes, locateClaudeConversation, agentHomeSpawnEnv } from './index-
|
|
31
|
+
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-Bn2qu5C5.mjs';
|
|
32
|
+
import { assistantHome, bootstrapAssistantHome } from './bootstrap-iuyufnp3.mjs';
|
|
33
|
+
import { refreshAgentHomes, locateClaudeConversation, agentHomeSpawnEnv } from './index-CdQI0C9p.mjs';
|
|
34
34
|
import { existsSync as existsSync$1, statSync as statSync$1, mkdtempSync, rmSync } from 'fs';
|
|
35
35
|
import { join as join$1 } from 'path';
|
|
36
36
|
import { spawn as spawn$1, execFile, spawnSync } from 'node:child_process';
|
|
37
37
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
38
38
|
import { d as daemonEndpointsMatch, r as resolveClaudeCredentialReadiness } from './doctorReadiness-C208SMN9.mjs';
|
|
39
|
-
import { g as getInitialMachineMetadata, a as getStartupCliAvailability } from './machineMetadata-
|
|
40
|
-
import { buildResumeLaunch } from './handleResumeCommand-
|
|
41
|
-
import {
|
|
39
|
+
import { g as getInitialMachineMetadata, a as getStartupCliAvailability } from './machineMetadata-D-g--oU_.mjs';
|
|
40
|
+
import { buildResumeLaunch } from './handleResumeCommand-C8thKjqf.mjs';
|
|
41
|
+
import { n as normalizeWebPanels } from './webPanels-B2_C2-3g.mjs';
|
|
42
|
+
import { w as ServerMigrateNoticeSchema, x as AUTOMATION_SUMMARY_MAX_CHARS, y as AUTOMATION_PRECHECK_OUTPUT_MAX_CHARS, z as AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS, b as AUTOMATION_PRECHECK_MAX_TIMEOUT_MS, D as AUTOMATION_CLAIM_MAX_RUNS, E as AUTOMATION_DAEMON_CAPABILITY_PRECHECK, F as AUTOMATION_DEFAULT_LEASE_MS, i as isAutomationRunTerminal } from './index-DPOa4NhL.mjs';
|
|
42
43
|
import { access, symlink, readFile, rm, unlink, readlink, lstat, constants, stat, open } from 'node:fs/promises';
|
|
43
44
|
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';
|
|
44
|
-
import {
|
|
45
|
+
import { P as ProjectsUnsupportedError, c as createProjectsClient } from './client-BhoEBnuN.mjs';
|
|
46
|
+
import { c as createAutomationsClient, i as isAutomationsUnavailable, d as AutomationsRequestError } from './client-wo9nbxuf.mjs';
|
|
45
47
|
import { createRequire } from 'node:module';
|
|
46
48
|
import { g as getProjectPath } from './path-D2wdaNSk.mjs';
|
|
47
49
|
import { b as extractClaudeEditPaths } from './editPaths-BVfS_FFL.mjs';
|
|
48
|
-
import { s as startFileWatcher } from './startFileWatcher-
|
|
49
|
-
import { I as InvalidateSync } from './sync-
|
|
50
|
+
import { s as startFileWatcher } from './startFileWatcher-DghDOCO4.mjs';
|
|
51
|
+
import { I as InvalidateSync } from './sync-CSe0Rf45.mjs';
|
|
50
52
|
import { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
|
|
51
53
|
import { t as tmuxArgs, a as scrubTmuxClientEnv, s as shellescape } from './tmuxSocket-B8Yx20sT.mjs';
|
|
52
|
-
import { p as processIdentityFields, r as readSessionLock, t as terminateProcess } from './sessionLock-
|
|
54
|
+
import { p as processIdentityFields, r as readSessionLock, t as terminateProcess, d as terminateProcessTree } from './sessionLock-WYIyaVO4.mjs';
|
|
53
55
|
import { findAllHappyProcesses } from './doctor-BPkYWSuq.mjs';
|
|
54
|
-
import { T as TEAM_SKILL } from './resources-
|
|
56
|
+
import { T as TEAM_SKILL } from './resources-y9jfyO-_.mjs';
|
|
55
57
|
import { promisify } from 'node:util';
|
|
56
58
|
import { c as clipText, r as renderAction, b as renderTemplate } from './template-CiOPa2rd.mjs';
|
|
57
59
|
import { d as detectDaemonSupervisor } from './daemonSupervisor-C6urv3_8.mjs';
|
|
58
60
|
import { d as describeAgentHome } from './loginShellEnv-Dw8M7tkI.mjs';
|
|
59
|
-
import './
|
|
60
|
-
import './lidState-
|
|
61
|
+
import './acpSessionResume-DTGmAPLt.mjs';
|
|
62
|
+
import './lidState-Bb8fgXg3.mjs';
|
|
61
63
|
import 'os';
|
|
62
64
|
import 'node:events';
|
|
63
65
|
import 'socket.io-client';
|
|
64
|
-
import './
|
|
66
|
+
import './pushNotifications-BdFjDjQe.mjs';
|
|
67
|
+
import './contentLogMetadata-BlWI0egu.mjs';
|
|
65
68
|
import './limits-DIo7rEBR.mjs';
|
|
66
|
-
import './time-
|
|
67
|
-
import './registerCommonHandlers-
|
|
69
|
+
import './time-65DcU6Jx.mjs';
|
|
70
|
+
import './registerCommonHandlers-BAlP7SGc.mjs';
|
|
68
71
|
import 'util';
|
|
69
72
|
import 'crypto';
|
|
70
73
|
import 'cross-spawn';
|
|
71
74
|
import '@paralleldrive/cuid2';
|
|
72
|
-
import './contentLogMetadata-BlWI0egu.mjs';
|
|
73
75
|
import 'chalk';
|
|
74
76
|
import 'tweetnacl';
|
|
75
|
-
import './browser-
|
|
77
|
+
import './browser-CSYum7xH.mjs';
|
|
76
78
|
import 'open';
|
|
77
79
|
import './ids-DU6sLx4C.mjs';
|
|
78
80
|
import 'url';
|
|
79
81
|
import './detectCLI-CSGMlV51.mjs';
|
|
80
|
-
import './localHappyAgentAuth-
|
|
82
|
+
import './localHappyAgentAuth-NEU7fax7.mjs';
|
|
83
|
+
import './processTreeSnapshot-CuLJDNC-.mjs';
|
|
81
84
|
import 'ps-list';
|
|
82
85
|
|
|
83
86
|
async function resolveRelaunchMetadata(snapshot, fetchServer) {
|
|
@@ -165,7 +168,7 @@ function startCaffeinate() {
|
|
|
165
168
|
}
|
|
166
169
|
killOrphanedCaffeinateProcesses();
|
|
167
170
|
try {
|
|
168
|
-
caffeinateProcess = spawn("caffeinate",
|
|
171
|
+
caffeinateProcess = spawn("caffeinate", caffeinateArgs(process.pid), {
|
|
169
172
|
stdio: "ignore",
|
|
170
173
|
detached: false
|
|
171
174
|
});
|
|
@@ -232,12 +235,36 @@ function setupCleanupHandlers() {
|
|
|
232
235
|
cleanup();
|
|
233
236
|
});
|
|
234
237
|
}
|
|
238
|
+
function caffeinateArgs(daemonPid) {
|
|
239
|
+
return ["-im", "-w", String(daemonPid)];
|
|
240
|
+
}
|
|
241
|
+
function orphanedLegacyCaffeinatePids(psOutput) {
|
|
242
|
+
const pids = [];
|
|
243
|
+
for (const line of psOutput.split("\n")) {
|
|
244
|
+
const m = /^\s*(\d+)\s+(\d+)\s+(.*?)\s*$/.exec(line);
|
|
245
|
+
if (!m) continue;
|
|
246
|
+
const [, pid, ppid, command] = m;
|
|
247
|
+
if (ppid !== "1") continue;
|
|
248
|
+
if (!/^(?:\/usr\/bin\/)?caffeinate -im$/.test(command)) continue;
|
|
249
|
+
pids.push(Number(pid));
|
|
250
|
+
}
|
|
251
|
+
return pids;
|
|
252
|
+
}
|
|
235
253
|
function killOrphanedCaffeinateProcesses() {
|
|
236
254
|
if (process.platform !== "darwin") return;
|
|
255
|
+
let ps;
|
|
237
256
|
try {
|
|
238
|
-
execSync(
|
|
239
|
-
|
|
240
|
-
|
|
257
|
+
ps = execSync("ps -A -o pid=,ppid=,command=", { timeout: 5e3, encoding: "utf8" });
|
|
258
|
+
} catch (error) {
|
|
259
|
+
logger.debug("[caffeinate] Could not list processes; skipping orphan cleanup:", error);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
for (const pid of orphanedLegacyCaffeinatePids(ps)) {
|
|
263
|
+
try {
|
|
264
|
+
process.kill(pid, "SIGTERM");
|
|
265
|
+
logger.debug(`[caffeinate] Killed orphaned legacy caffeinate PID ${pid}`);
|
|
266
|
+
} catch {
|
|
267
|
+
}
|
|
241
268
|
}
|
|
242
269
|
}
|
|
243
270
|
|
|
@@ -347,6 +374,12 @@ function formatAssistantReportMessage(title, sessionId, event) {
|
|
|
347
374
|
|
|
348
375
|
function resumePrecheck(metadata, fs) {
|
|
349
376
|
const flavor = metadata.flavor ?? "claude";
|
|
377
|
+
if (flavor === "acp" && metadata.piSessionId) {
|
|
378
|
+
if (!metadata.path || !fs.cwdExists(metadata.path)) {
|
|
379
|
+
return { ok: false, reason: "missing-cwd", detail: `working directory ${metadata.path ?? "(none)"} does not exist` };
|
|
380
|
+
}
|
|
381
|
+
return { ok: true };
|
|
382
|
+
}
|
|
350
383
|
if (flavor !== "claude" && flavor !== "codex") {
|
|
351
384
|
return { ok: false, reason: "unsupported-flavor", detail: `flavor "${flavor}" cannot be resumed` };
|
|
352
385
|
}
|
|
@@ -2030,6 +2063,43 @@ function spawnAgentUnavailableError(agent, availability) {
|
|
|
2030
2063
|
return null;
|
|
2031
2064
|
}
|
|
2032
2065
|
|
|
2066
|
+
function startWebPanelsSync(deps) {
|
|
2067
|
+
let lastMtime;
|
|
2068
|
+
let lastProblems = "";
|
|
2069
|
+
let stopped = false;
|
|
2070
|
+
let inflight = null;
|
|
2071
|
+
const run = async () => {
|
|
2072
|
+
try {
|
|
2073
|
+
const mtime = await deps.statMtime();
|
|
2074
|
+
if (mtime === lastMtime) return;
|
|
2075
|
+
lastMtime = mtime;
|
|
2076
|
+
const { panels, problems } = normalizeWebPanels(mtime === null ? void 0 : await deps.readRaw());
|
|
2077
|
+
const key = JSON.stringify(problems);
|
|
2078
|
+
if (problems.length > 0 && key !== lastProblems) deps.logProblems(problems);
|
|
2079
|
+
lastProblems = key;
|
|
2080
|
+
await deps.publish(panels);
|
|
2081
|
+
} catch {
|
|
2082
|
+
lastMtime = void 0;
|
|
2083
|
+
}
|
|
2084
|
+
};
|
|
2085
|
+
const tick = () => {
|
|
2086
|
+
if (stopped) return Promise.resolve();
|
|
2087
|
+
inflight ??= run().finally(() => {
|
|
2088
|
+
inflight = null;
|
|
2089
|
+
});
|
|
2090
|
+
return inflight;
|
|
2091
|
+
};
|
|
2092
|
+
void tick();
|
|
2093
|
+
const timer = setInterval(() => {
|
|
2094
|
+
void tick();
|
|
2095
|
+
}, deps.intervalMs ?? 2e3);
|
|
2096
|
+
timer.unref?.();
|
|
2097
|
+
return { stop: () => {
|
|
2098
|
+
stopped = true;
|
|
2099
|
+
clearInterval(timer);
|
|
2100
|
+
}, tick };
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2033
2103
|
function isAcceptableRelayUrl(url) {
|
|
2034
2104
|
try {
|
|
2035
2105
|
const parsed = new URL(url);
|
|
@@ -2485,6 +2555,44 @@ function createUpdateController(deps) {
|
|
|
2485
2555
|
return { refresh, retry, request, tick, withHandover, holdHandover, isRunning: () => running };
|
|
2486
2556
|
}
|
|
2487
2557
|
|
|
2558
|
+
function buildPresenceBatch(live, previous) {
|
|
2559
|
+
const current = new Set(live.map((s) => s.sessionId));
|
|
2560
|
+
const sessions = live.slice(0, 200).map((s) => ({
|
|
2561
|
+
sessionId: s.sessionId,
|
|
2562
|
+
state: s.running ? "running" : "idle",
|
|
2563
|
+
...s.flavor ? { agent: s.flavor } : {},
|
|
2564
|
+
...s.branch ? { branch: s.branch.slice(0, 200) } : {}
|
|
2565
|
+
}));
|
|
2566
|
+
const gone = [...previous].filter((id) => !current.has(id)).slice(0, 200);
|
|
2567
|
+
return { sessions, gone, current };
|
|
2568
|
+
}
|
|
2569
|
+
function createProjectPresenceReporter(deps) {
|
|
2570
|
+
let previous = /* @__PURE__ */ new Set();
|
|
2571
|
+
let running = false;
|
|
2572
|
+
async function tick() {
|
|
2573
|
+
if (running || deps.client.isDisabled()) return;
|
|
2574
|
+
running = true;
|
|
2575
|
+
try {
|
|
2576
|
+
const batch = buildPresenceBatch(deps.live(), previous);
|
|
2577
|
+
if (batch.sessions.length === 0 && batch.gone.length === 0) {
|
|
2578
|
+
previous = batch.current;
|
|
2579
|
+
return;
|
|
2580
|
+
}
|
|
2581
|
+
await deps.client.presence(deps.machineId, batch.sessions, batch.gone);
|
|
2582
|
+
previous = batch.current;
|
|
2583
|
+
} catch (error) {
|
|
2584
|
+
if (!(error instanceof ProjectsUnsupportedError)) deps.log(`project presence tick failed: ${String(error)}`);
|
|
2585
|
+
} finally {
|
|
2586
|
+
running = false;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
const timer = setInterval(() => {
|
|
2590
|
+
void tick();
|
|
2591
|
+
}, deps.intervalMs ?? 6e4);
|
|
2592
|
+
timer.unref?.();
|
|
2593
|
+
return { tick, stop: () => clearInterval(timer) };
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2488
2596
|
const AUTOMATION_BINDINGS_TTL_MS = 10 * 60 * 1e3;
|
|
2489
2597
|
const HIBERNATION_IN_FLIGHT_MS = 6e4;
|
|
2490
2598
|
const HIBERNATION_EXIT_WAIT_MS = 15e3;
|
|
@@ -4551,6 +4659,7 @@ ${action.prompt}`, { localId: `automation-${run.id}` });
|
|
|
4551
4659
|
}
|
|
4552
4660
|
persist({ runId: run.id, automationId: automation.id, kind: "spawn", phase: "running", claimId: run.claimId, sessionId: spawned.sessionId, stickyKey, ...action.worktree ? { directory } : {} });
|
|
4553
4661
|
const item = track(claimed, "spawn", spawned.sessionId);
|
|
4662
|
+
if (automation.projectId && deps.joinProject) await deps.joinProject(spawned.sessionId, automation.projectId).catch(() => void 0);
|
|
4554
4663
|
try {
|
|
4555
4664
|
const capabilities = readPersistedSessions()[spawned.sessionId]?.metadata?.capabilities ?? null;
|
|
4556
4665
|
const meta = resolveFirstMessageMeta({ agent, permissionMode, explicitModel: action.model ?? void 0, capabilities });
|
|
@@ -4911,6 +5020,7 @@ async function startDaemon() {
|
|
|
4911
5020
|
const sessionIdToFinishedSession = /* @__PURE__ */ new Map();
|
|
4912
5021
|
let teamWorker;
|
|
4913
5022
|
let automationRunner;
|
|
5023
|
+
let projectPresence;
|
|
4914
5024
|
const persisted = readPersistedSessions();
|
|
4915
5025
|
const liveHappyProcesses = await findAllHappyProcesses();
|
|
4916
5026
|
for (const [id, s] of Object.entries(persisted)) {
|
|
@@ -5000,6 +5110,7 @@ async function startDaemon() {
|
|
|
5000
5110
|
}
|
|
5001
5111
|
};
|
|
5002
5112
|
const assistantSpawnGate = createSpawnGate();
|
|
5113
|
+
const projectsClient = createProjectsClient({ token: async () => credentials.token });
|
|
5003
5114
|
const spawnSession = async (options) => {
|
|
5004
5115
|
const timer = createSpawnTimer();
|
|
5005
5116
|
await refreshAgentHomes(Date.now(), { allowStale: true });
|
|
@@ -5011,6 +5122,10 @@ async function startDaemon() {
|
|
|
5011
5122
|
result = await (options.forceNew ? assistantSpawnGate.replace(() => spawnSessionImpl(options, timer)) : assistantSpawnGate.join(() => spawnSessionImpl(options, timer)));
|
|
5012
5123
|
}
|
|
5013
5124
|
logger.debug(timer.format({ agent: options.agent ?? "claude", outcome: result.type }));
|
|
5125
|
+
if (result.type === "success" && options.parentSessionId) {
|
|
5126
|
+
const outcome = await joinProject(projectsClient, result.sessionId, { kind: "lineage", parentSessionId: options.parentSessionId });
|
|
5127
|
+
if (outcome.joined) logger.debug(`[DAEMON RUN] fork ${result.sessionId} joined project ${outcome.projectId} (lineage)`);
|
|
5128
|
+
}
|
|
5014
5129
|
return result;
|
|
5015
5130
|
};
|
|
5016
5131
|
const currentCliAvailability = () => apiMachineRef?.getCLIAvailability() ?? startupCliAvailability;
|
|
@@ -5641,7 +5756,7 @@ async function startDaemon() {
|
|
|
5641
5756
|
resolve();
|
|
5642
5757
|
}
|
|
5643
5758
|
};
|
|
5644
|
-
const requested =
|
|
5759
|
+
const requested = terminateProcessTree(pid, () => {
|
|
5645
5760
|
const tracked = pidToTrackedSession.get(pid);
|
|
5646
5761
|
if (tracked) {
|
|
5647
5762
|
if (tracked.happySessionId && tracked.encryption) {
|
|
@@ -5757,7 +5872,7 @@ async function startDaemon() {
|
|
|
5757
5872
|
logger.debug(`[DAEMON RUN] Attempting to stop session ${sessionId}`);
|
|
5758
5873
|
for (const [pid, session] of pidToTrackedSession.entries()) {
|
|
5759
5874
|
if (session.happySessionId === sessionId || sessionId.startsWith("PID-") && pid === parseInt(sessionId.replace("PID-", ""))) {
|
|
5760
|
-
const requested =
|
|
5875
|
+
const requested = terminateProcessTree(pid, (stopped) => {
|
|
5761
5876
|
if (!stopped) {
|
|
5762
5877
|
logger.debug(`[DAEMON RUN] Session ${sessionId} survived SIGTERM and SIGKILL attempts`);
|
|
5763
5878
|
return;
|
|
@@ -6020,6 +6135,12 @@ async function startDaemon() {
|
|
|
6020
6135
|
daemonHibernation.invalidateBindings();
|
|
6021
6136
|
return resolveIdleMs(agentHibernationSetting);
|
|
6022
6137
|
});
|
|
6138
|
+
const webPanelsSync = startWebPanelsSync({
|
|
6139
|
+
statMtime: async () => (await fs.stat(configuration.settingsFile).catch(() => null))?.mtimeMs ?? null,
|
|
6140
|
+
readRaw: async () => (await readSettings()).webPanels,
|
|
6141
|
+
publish: (panels) => apiMachine.setWebPanels(panels),
|
|
6142
|
+
logProblems: (problems) => logger.warn(`[DAEMON RUN] settings.json webPanels: skipped ${problems.length} entr${problems.length === 1 ? "y" : "ies"}: ${problems.map((p) => `#${p.index}${p.id ? ` (${p.id})` : ""} ${p.reason}`).join("; ")}`)
|
|
6143
|
+
});
|
|
6023
6144
|
apiMachine.connect();
|
|
6024
6145
|
if (identityConflict?.confidence === "weak") {
|
|
6025
6146
|
void apiMachine.updateMachineMetadata((current) => ({
|
|
@@ -6127,6 +6248,7 @@ async function startDaemon() {
|
|
|
6127
6248
|
logger.debug(relayMove ? `[DAEMON RUN] Relay moved to ${relayMove.serverUrl}; handing off to a new daemon on the new settings` : "[DAEMON RUN] Daemon bundle replaced on disk and verified, handing off to new daemon");
|
|
6128
6249
|
teamWorker?.stop();
|
|
6129
6250
|
automationRunner?.stop();
|
|
6251
|
+
projectPresence?.stop();
|
|
6130
6252
|
clearInterval(restartOnStaleVersionAndHeartbeat);
|
|
6131
6253
|
clearInterval(cliUpdateInterval);
|
|
6132
6254
|
stopAgentVersionChecks();
|
|
@@ -6200,6 +6322,18 @@ async function startDaemon() {
|
|
|
6200
6322
|
if (result.type !== "success") return false;
|
|
6201
6323
|
return waitForSessionLive(id, (sid) => [...pidToTrackedSession.values()].some((s) => s.happySessionId === sid && isPidAlive(s.pid)));
|
|
6202
6324
|
},
|
|
6325
|
+
joinProject: (sessionId, projectId) => joinProject(projectsClient, sessionId, { kind: "explicit", projectId }, { via: "automation" }),
|
|
6326
|
+
log: (message) => logger.debug(`[DAEMON RUN] ${message}`)
|
|
6327
|
+
});
|
|
6328
|
+
projectPresence = createProjectPresenceReporter({
|
|
6329
|
+
machineId,
|
|
6330
|
+
client: projectsClient,
|
|
6331
|
+
live: () => [...pidToTrackedSession.values()].filter((s) => s.happySessionId && isPidAlive(s.pid)).map((s) => ({
|
|
6332
|
+
sessionId: s.happySessionId,
|
|
6333
|
+
flavor: s.happySessionMetadataFromLocalWebhook?.flavor ?? null,
|
|
6334
|
+
branch: s.happySessionMetadataFromLocalWebhook?.worktree?.branch ?? null,
|
|
6335
|
+
running: turnActivity.activeSessions().includes(s.happySessionId)
|
|
6336
|
+
})),
|
|
6203
6337
|
log: (message) => logger.debug(`[DAEMON RUN] ${message}`)
|
|
6204
6338
|
});
|
|
6205
6339
|
void apiMachine.updateMachineMetadata((current) => ({
|
|
@@ -6210,10 +6344,12 @@ async function startDaemon() {
|
|
|
6210
6344
|
worktreeVersion: WORKTREE_CAPABILITY_VERSION
|
|
6211
6345
|
})).catch(() => logger.debug("[DAEMON RUN] Teams capability publication will retry on reconnect"));
|
|
6212
6346
|
const cleanupAndShutdown = async (source, errorMessage) => {
|
|
6347
|
+
webPanelsSync.stop();
|
|
6213
6348
|
logger.debug(`[DAEMON RUN] Starting proper cleanup (source: ${source}, errorMessage: ${errorMessage})...`);
|
|
6214
6349
|
const scrollbackFlush = apiMachine.flushTerminalScrollback();
|
|
6215
6350
|
teamWorker?.stop();
|
|
6216
6351
|
automationRunner?.stop({ killScripts: true });
|
|
6352
|
+
projectPresence?.stop();
|
|
6217
6353
|
currentWorktreeService()?.stopAll();
|
|
6218
6354
|
if (restartOnStaleVersionAndHeartbeat) {
|
|
6219
6355
|
clearInterval(restartOnStaleVersionAndHeartbeat);
|