very-happy-cli 0.2.189 → 0.2.190
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-fj16v_cf.mjs → AcpBackend-Dd1h-Rgt.mjs} +3 -3
- package/dist/{AcpBackend-DRPJ2g9G.cjs → AcpBackend-dkRv9QHm.cjs} +3 -3
- package/dist/{AcpSessionManager-DM-KKg6v.cjs → AcpSessionManager-AqWAqahm.cjs} +1 -1
- package/dist/{AcpSessionManager-BZPmUDL5.mjs → AcpSessionManager-QBZ-CIf7.mjs} +2 -2
- package/dist/{BasePermissionHandler-CVtH-snr.mjs → BasePermissionHandler-CLp1ge-4.mjs} +1 -1
- package/dist/{BasePermissionHandler-DjM16uJz.cjs → BasePermissionHandler-CpSugp7Z.cjs} +1 -1
- package/dist/{acpSessionResume-2BTMsB7_.cjs → acpSessionResume-CZao6QEd.cjs} +1 -1
- package/dist/{acpSessionResume-Dxl1LRAT.mjs → acpSessionResume-CcpDuIO5.mjs} +1 -1
- package/dist/{agentHome-CHctmMzZ.mjs → agentHome-BJGRA2Kx.mjs} +4 -4
- package/dist/{agentHome-W17n1gnH.cjs → agentHome-fIUqT-pn.cjs} +4 -4
- package/dist/{api-BDuuyys8.cjs → api-CXL6jp-p.cjs} +18 -9
- package/dist/{api-B0yN68XH.mjs → api-Dw8gFsQi.mjs} +19 -10
- package/dist/{apiMachine-mc9CsKuS.mjs → apiMachine-BBNEtjf7.mjs} +56 -15
- package/dist/{apiMachine-iddD-F19.cjs → apiMachine-C6UqHoPF.cjs} +55 -14
- package/dist/{attachmentContent-CcIdMfAx.mjs → attachmentContent-CC4yIrSm.mjs} +2 -2
- package/dist/{attachmentContent-Cc5b7TPr.cjs → attachmentContent-NmVfKp-B.cjs} +2 -2
- package/dist/{auth-DQKSpaEf.cjs → auth-Bb_SL2os.cjs} +5 -5
- package/dist/{auth-DNAgkUkB.mjs → auth-Bh6SUoGi.mjs} +8 -8
- package/dist/{auth-CyrVvWHF.mjs → auth-Bj0psrD2.mjs} +5 -5
- package/dist/{auth-B7tVmyfX.cjs → auth-DKa4MsAi.cjs} +8 -8
- package/dist/{auto-CetlumDo.cjs → auto-C9Qohh0P.cjs} +15 -15
- package/dist/{auto-BklCipw1.mjs → auto-DK7pbCnV.mjs} +18 -18
- package/dist/{bootstrap-DfXwkUQb.mjs → bootstrap-Ct9Nb4sv.mjs} +2 -2
- package/dist/{bootstrap-CDY-Vz8q.cjs → bootstrap-DBJB0y-H.cjs} +2 -2
- package/dist/{browser-vb0k1zfI.mjs → browser-BGxDRhHy.mjs} +1 -1
- package/dist/{browser-D1yzC0Tu.cjs → browser-CLJWcodR.cjs} +1 -1
- package/dist/{claudeLocal-2dJIiTIq.cjs → claudeLocal-B6YDYlnY.cjs} +4 -4
- package/dist/{claudeLocal-Bid_rC_v.mjs → claudeLocal-Ux31hZyC.mjs} +5 -5
- package/dist/{claudeLocalLauncher-5pzpETxd.mjs → claudeLocalLauncher-D06QijMw.mjs} +10 -10
- package/dist/{claudeLocalLauncher-Jm5oQX5Z.cjs → claudeLocalLauncher-DFvmF8rC.cjs} +9 -9
- package/dist/{claudeSessionFork-DzecSBO4.mjs → claudeSessionFork-D2GI7P59.mjs} +1 -1
- package/dist/{claudeSessionFork-DsbcuDEJ.cjs → claudeSessionFork-DTLZ2rek.cjs} +1 -1
- package/dist/{client-D0aYWt53.cjs → client-Bffkrs5p.cjs} +2 -2
- package/dist/{client-BNmFaRXZ.cjs → client-CARZ_lNS.cjs} +3 -3
- package/dist/{client-DIfxYk7B.cjs → client-CMKGrnmT.cjs} +2 -2
- package/dist/{client-B161HwAk.mjs → client-CnGNYidN.mjs} +2 -2
- package/dist/{client-C9Ecbtko.mjs → client-CtL0Vtww.mjs} +4 -4
- package/dist/{client-CvjjadIE.mjs → client-DZkBUoh9.mjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +15 -15
- package/dist/codex/happyMcpStdioBridge.mjs +16 -16
- package/dist/{codexAppServerClient-BlVmpjR-.mjs → codexAppServerClient-CLc5nhLT.mjs} +13 -6
- package/dist/{codexAppServerClient-CO9f4Jr8.cjs → codexAppServerClient-CpT9F6EM.cjs} +13 -6
- package/dist/{codexCommand-BfoRP6E9.cjs → codexCommand-39kH99SJ.cjs} +72 -48
- package/dist/{codexCommand-CAMR4g5o.mjs → codexCommand-Dliq3EBv.mjs} +69 -45
- package/dist/{codexTermination-IrLZQzKC.cjs → codexTermination-ByW7tRjr.cjs} +1 -1
- package/dist/{codexTermination-BvGlN02_.mjs → codexTermination-ORIw0gpU.mjs} +1 -1
- package/dist/{codexThreadFork-DNekT4nQ.cjs → codexThreadFork-5kwoKjMu.cjs} +11 -17
- package/dist/{codexThreadFork-R76RU5H0.mjs → codexThreadFork-DobPd19R.mjs} +11 -17
- package/dist/{config-BGFqQGvh.cjs → config-CeIzCsfj.cjs} +3 -3
- package/dist/{config-CtMgGPvf.mjs → config-CxSsGO1Z.mjs} +3 -3
- package/dist/{configuration-1FabKklB.mjs → configuration-Dechcvd-.mjs} +1 -1
- package/dist/{configuration-C0ctLGW2.cjs → configuration-Dt5lKW3P.cjs} +1 -1
- package/dist/{connect-DSw-2f52.cjs → connect-NPDzIVC6.cjs} +12 -12
- package/dist/{connect-0lSugpjf.mjs → connect-UwQHvCpR.mjs} +13 -13
- package/dist/{context-D-hEk5pC.cjs → context-BdZssgF0.cjs} +1 -1
- package/dist/{context-BgxbXWKS.mjs → context-C9JbJoNe.mjs} +1 -1
- package/dist/{controlClient-F7hAEEy2.cjs → controlClient-BRk65BRO.cjs} +3 -3
- package/dist/{controlClient-DwNnNAUx.mjs → controlClient-D7NGfmtq.mjs} +3 -3
- package/dist/{createSessionMetadata-DezS33OM.cjs → createSessionMetadata-B_HZCDj_.cjs} +2 -2
- package/dist/{createSessionMetadata-CG6Klinp.mjs → createSessionMetadata-DyhFKAby.mjs} +2 -2
- package/dist/defaultPermissionMode-BnxJPVHT.mjs +4 -0
- package/dist/defaultPermissionMode-CxmTXUQR.cjs +7 -0
- package/dist/{deterministicJson-D0LU_XbO.cjs → deterministicJson-BEygolBQ.cjs} +12 -12
- package/dist/{deterministicJson-BMwgK21e.mjs → deterministicJson-DNmMVhFu.mjs} +13 -13
- package/dist/{doctor-wVNvRarN.cjs → doctor-B9lW1WlG.cjs} +7 -7
- package/dist/{doctor-D16hySse.mjs → doctor-BdBi7TFZ.mjs} +7 -7
- package/dist/{downloadTarget-C6tqaXGm.mjs → downloadTarget-CGojGjaN.mjs} +6 -6
- package/dist/{downloadTarget-aNcCxVRL.cjs → downloadTarget-DS0zT2AU.cjs} +6 -6
- package/dist/{ensureDaemonRunning-DZq8bvsp.mjs → ensureDaemonRunning-BOdbryDM.mjs} +5 -5
- package/dist/{ensureDaemonRunning-CIghxgDR.cjs → ensureDaemonRunning-Bibp6vhe.cjs} +5 -5
- package/dist/exitAfterFlush-AbKNZM0N.mjs +23 -0
- package/dist/exitAfterFlush-DIT_sIxR.cjs +25 -0
- package/dist/{handleResumeCommand-BNnD7EuD.mjs → handleResumeCommand-CgLzBYne.mjs} +5 -5
- package/dist/{handleResumeCommand-CMUTygsm.cjs → handleResumeCommand-DXOuWr4p.cjs} +5 -5
- package/dist/{agentAttachments-Dbw8iMCZ.cjs → heldInput-BOtqFO2r.cjs} +27 -0
- package/dist/heldInput-C69lA2dH.mjs +44 -0
- package/dist/{index-De02DNu5.cjs → index-Bs5FD8JF.cjs} +4 -4
- package/dist/{index-BuiG8hmg.mjs → index-CBHfkQNY.mjs} +133 -54
- package/dist/{index-4TpmBb2Q.cjs → index-CwRW11hT.cjs} +3 -3
- package/dist/{index-Df0bc_et.mjs → index-DUByZsKe.mjs} +4 -4
- package/dist/{index-B81qV_F_.cjs → index-DXSIi6j_.cjs} +4 -4
- package/dist/{index-BCQr-5Ei.mjs → index-Db0HIC-k.mjs} +4 -4
- package/dist/{index-WKyN-bNy.mjs → index-DmqsRnV7.mjs} +1 -1
- package/dist/{index-CnzsOD19.cjs → index-f8oDidjV.cjs} +131 -52
- package/dist/{index-CKd20r1W.mjs → index-rNTX33in.mjs} +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-DNbIEJUk.cjs → install-CXIL_FYx.cjs} +3 -3
- package/dist/{install-23ehAdTD.mjs → install-DfPrEWGG.mjs} +3 -3
- package/dist/lib.cjs +11 -11
- package/dist/lib.d.cts +53 -1
- package/dist/lib.d.mts +53 -1
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-q5Its2Hm.mjs → lidState-D0DF20oG.mjs} +1 -1
- package/dist/{lidState-B4dHJCeS.cjs → lidState-q_XFYg33.cjs} +1 -1
- package/dist/{localHappyAgentAuth-C_G5u5lY.mjs → localHappyAgentAuth-BBhM4Qk1.mjs} +1 -1
- package/dist/{localHappyAgentAuth-CG2nPD_H.cjs → localHappyAgentAuth-CKNW-MXw.cjs} +1 -1
- package/dist/{logger-BP1SW7Cs.cjs → logger-BBRTTVsQ.cjs} +2 -2
- package/dist/{logger-DOKH3Zbh.mjs → logger-CL7pin9b.mjs} +2 -2
- package/dist/{machineMetadata-D-5qeIqd.mjs → machineMetadata-DP06qdBk.mjs} +3 -3
- package/dist/{machineMetadata-BKX3ov9g.cjs → machineMetadata-DnFNlrVK.cjs} +3 -3
- package/dist/{main-ndpVIaSG.cjs → main-DLOXykOR.cjs} +49 -48
- package/dist/{main-DODz8DQE.mjs → main-DO7nRvhf.mjs} +49 -48
- package/dist/{mcp-BBwbSODp.mjs → mcp-C-4sPTae.mjs} +15 -15
- package/dist/{mcp-Bc4U4exu.cjs → mcp-Du0MgR7e.cjs} +14 -14
- package/dist/{mirrorProtocol-CiA3hO2y.cjs → mirrorProtocol-GuWMxLkh.cjs} +2 -2
- package/dist/{mirrorProtocol-D2vTWteS.mjs → mirrorProtocol-dkq2ZENA.mjs} +3 -3
- package/dist/{package-DTcaIhjW.mjs → package-C6uiXULx.mjs} +7 -7
- package/dist/{package-CYDdLA6R.cjs → package-DrY090nZ.cjs} +7 -7
- package/dist/{panels-C2xZ8rqU.cjs → panels-4DRBKHZP.cjs} +5 -5
- package/dist/{panels-DCaLxlSL.mjs → panels-DXYdJA6n.mjs} +5 -5
- package/dist/{peerTools-B4315xjX.cjs → peerTools-5ZM4spcZ.cjs} +5 -5
- package/dist/{peerTools-BtrUnSwz.mjs → peerTools-dY1aJez4.mjs} +5 -5
- package/dist/{persistence-CrzC7yr_.cjs → persistence-Bl5S3TLB.cjs} +6 -2
- package/dist/{persistence-0INrP3aB.mjs → persistence-Dogj7JIp.mjs} +6 -3
- package/dist/{piRunnerArgs-BtzW_kfh.cjs → piRunnerArgs-C3jZ1M6b.cjs} +1 -1
- package/dist/{piRunnerArgs-DRuxMlX1.mjs → piRunnerArgs-D8nN_Iit.mjs} +1 -1
- package/dist/{piRuntime-DEbPE_kW.cjs → piRuntime-Bd9-eq6M.cjs} +1 -1
- package/dist/{piRuntime-BMAFpIBV.mjs → piRuntime-BoeMsAXK.mjs} +1 -1
- package/dist/{piTerminal-MtxDtBE2.cjs → piTerminal-C3j1ca3x.cjs} +16 -16
- package/dist/{piTerminal-DQXV8_we.mjs → piTerminal-GEPkIGD4.mjs} +17 -17
- package/dist/{pushNotifications-CalIS9sq.cjs → pushNotifications-CfspRcl-.cjs} +20 -2
- package/dist/{pushNotifications-Cq1s8YVK.mjs → pushNotifications-dUceOIni.mjs} +21 -3
- package/dist/{query-CE2XDhhw.cjs → query-DjsVgG3E.cjs} +1 -1
- package/dist/{query-BYiPBHPC.mjs → query-iYH-tm7L.mjs} +1 -1
- package/dist/{rateLimitReporter-BKmoOZQi.cjs → rateLimitReporter-DUu2KydZ.cjs} +3 -3
- package/dist/{rateLimitReporter-DR5LXuiQ.mjs → rateLimitReporter-jeVi-fym.mjs} +3 -3
- package/dist/{rateLimitWindows-Cs56YJCH.cjs → rateLimitWindows-Bx3ROBP5.cjs} +1 -1
- package/dist/{rateLimitWindows-5vIuNjko.mjs → rateLimitWindows-CEn0DXaX.mjs} +1 -1
- package/dist/{registerCommonHandlers-DZPozYxc.cjs → registerCommonHandlers-Beun-cQv.cjs} +2 -2
- package/dist/{registerCommonHandlers-DWkTysjD.mjs → registerCommonHandlers-DWZ7mfdt.mjs} +2 -2
- package/dist/{registerKillSessionHandler-DhCjrs44.cjs → registerKillSessionHandler-CA1FFr_F.cjs} +15 -5
- package/dist/{registerKillSessionHandler-CSCTRIbI.mjs → registerKillSessionHandler-CzgklwLG.mjs} +16 -6
- package/dist/{remoteSessionClient-Vfj_5g2-.mjs → remoteSessionClient-BiC2KDew.mjs} +5 -5
- package/dist/{remoteSessionClient-Dq8XTLQP.cjs → remoteSessionClient-DGFI__5Z.cjs} +5 -5
- package/dist/{reportProgressTool-B7zmX7NJ.mjs → reportProgressTool-CgPy6n_7.mjs} +3 -3
- package/dist/{reportProgressTool-DznxPKES.cjs → reportProgressTool-CvPGov1F.cjs} +2 -2
- package/dist/{run-DSfNcR62.mjs → run-B_gFgJVB.mjs} +392 -42
- package/dist/{run-Ca8BiNCp.cjs → run-rPqQwDi_.cjs} +389 -39
- package/dist/{runClaude-hoepv-0X.mjs → runClaude-CykqeXK7.mjs} +26 -23
- package/dist/{runClaude-ClQQcgoO.cjs → runClaude-DM8gm8iu.cjs} +27 -24
- package/dist/{runClaudeDeps-D_v8t2SK.mjs → runClaudeDeps-D2phXGut.mjs} +101 -44
- package/dist/{runClaudeDeps-ck5_GYlP.cjs → runClaudeDeps-DGAomimZ.cjs} +94 -37
- package/dist/{runGemini-Cj0XsMiM.cjs → runGemini-CXTeSOZp.cjs} +32 -32
- package/dist/{runGemini-CTr2-cYG.mjs → runGemini-CtWCVkj5.mjs} +33 -33
- package/dist/{runOpenClaw-CdDMntiV.mjs → runOpenClaw-BBdjlViJ.mjs} +18 -18
- package/dist/{runOpenClaw-BoN1e3lP.cjs → runOpenClaw-CH_9_RyZ.cjs} +17 -17
- package/dist/{sandbox-BY2h19gc.cjs → sandbox-Bb5IMun3.cjs} +4 -4
- package/dist/{sandbox-DcaWB-Ou.mjs → sandbox-DGmXZ6Zz.mjs} +4 -4
- package/dist/selfCheck-BfK945YQ.mjs +86 -0
- package/dist/{selfCheck-DFS_GUaQ.cjs → selfCheck-CccwNTTK.cjs} +37 -37
- package/dist/{send-UBTHHNvZ.mjs → send-B6rHg8GT.mjs} +8 -8
- package/dist/{send-BMsUYU6g.cjs → send-BpiXPkDo.cjs} +8 -8
- package/dist/{server-Dt3mCtfQ.mjs → server-BkdAyHhC.mjs} +4 -4
- package/dist/{server-YrHMHNz1.cjs → server-DHUzjApC.cjs} +6 -6
- package/dist/{sessionLock-DSqiP2lH.cjs → sessionLock-BFBReiKq.cjs} +134 -3
- package/dist/{sessionLock-tEFvFXLD.mjs → sessionLock-Ca_bIo50.mjs} +121 -4
- package/dist/{sessionOps-CljctDs5.mjs → sessionOps-CA2kpm66.mjs} +13 -5
- package/dist/{sessionOps-BzeOKIEF.cjs → sessionOps-DeWVqpe4.cjs} +13 -4
- package/dist/{sessionProvider-ORgzmkXy.cjs → sessionProvider-VFbtUmMR.cjs} +5 -5
- package/dist/{sessionProvider-BnUFSJXM.mjs → sessionProvider-g18IiK74.mjs} +5 -5
- package/dist/{sessionScanner-Cr6PJ3PT.cjs → sessionScanner-CGzsN8V6.cjs} +3 -3
- package/dist/{sessionScanner-DZUlkdF6.mjs → sessionScanner-DDDud5re.mjs} +3 -3
- package/dist/{sessions-15cag-su.mjs → sessions-B4d50sCI.mjs} +35 -26
- package/dist/{sessions-aIo_HjmY.cjs → sessions-CKJPWFgu.cjs} +36 -25
- package/dist/{setupOfflineReconnection-B7I8R2Ex.mjs → setupOfflineReconnection-CyPNgyCe.mjs} +2 -2
- package/dist/{setupOfflineReconnection-tV0Q1dgR.cjs → setupOfflineReconnection-DPXRo_zf.cjs} +2 -2
- package/dist/{spawn-VG-HjJiR.cjs → spawn-CgSJzzWS.cjs} +13 -13
- package/dist/{spawn-ByrQgruJ.mjs → spawn-CrYN_OOT.mjs} +15 -15
- package/dist/{spawnAgents-Bh1RPShN.mjs → spawnAgents-DWCDYCQ1.mjs} +1 -1
- package/dist/{spawnHappyCLI-CxiR2Qoy.cjs → spawnHappyCLI-CTy3p6V_.cjs} +1 -1
- package/dist/{spawnHappyCLI-CEsXwz5V.mjs → spawnHappyCLI-DjbkiSH1.mjs} +1 -1
- package/dist/{startFileWatcher-C-XCZ5t2.cjs → startFileWatcher-BQs0cJA-.cjs} +1 -1
- package/dist/{startFileWatcher-DkEeeAtL.mjs → startFileWatcher-Dedtu1vq.mjs} +1 -1
- package/dist/{defaultPermissionMode-e2bIIJG4.mjs → startupSessionCreate-BKFU4v_h.mjs} +25 -6
- package/dist/{defaultPermissionMode-5EvgRq38.cjs → startupSessionCreate-Dxy3X4DG.cjs} +25 -7
- package/dist/{streamRelay-CqBynIon.mjs → streamRelay-P9e7Sohm.mjs} +1 -1
- package/dist/{sync-CoChLEIg.cjs → sync-DtWB7RzA.cjs} +1 -1
- package/dist/{sync-BvDMkKAN.mjs → sync-eZkXnsW_.mjs} +1 -1
- package/dist/{systemPrompt-Dy_Rf-0Z.cjs → systemPrompt-2XOpZ1j6.cjs} +1 -1
- package/dist/{systemPrompt-CgDaPigN.mjs → systemPrompt-Bn6g6aCH.mjs} +2 -2
- package/dist/{teams-DPvfLAk8.cjs → teams-ecFay4Gn.cjs} +6 -6
- package/dist/{teams-BC4_e5hR.mjs → teams-nadkqrbW.mjs} +7 -7
- package/dist/{template-CEK8MEjo.mjs → template-BiTD-jI9.mjs} +1 -1
- package/dist/{time-CUK37wiV.mjs → time-CN3TuSVG.mjs} +1 -1
- package/dist/{time-XwEZxKGc.cjs → time-gPD_EmA-.cjs} +1 -1
- package/dist/{titleGenerator-DWRVdqMU.mjs → titleGenerator-DgzTQdn2.mjs} +1 -1
- package/dist/{titleGenerator-DVX0NZUn.cjs → titleGenerator-lT5ldPuN.cjs} +2 -2
- package/dist/{todo-CKGrSrRE.cjs → todo-B1VeMk5A.cjs} +5 -5
- package/dist/{todo-BNMGXneA.mjs → todo-BIxd7l2Q.mjs} +6 -6
- package/dist/{tools-CjMafO_D.cjs → tools-DvqbLsCF.cjs} +1 -1
- package/dist/{tools-CCIEAVbB.mjs → tools-zXJpxiG_.mjs} +1 -1
- package/dist/{uninstall-CJvJ7gjr.mjs → uninstall-9htK6mb7.mjs} +3 -3
- package/dist/{uninstall-BdFbTXnL.cjs → uninstall-CvIOpwB5.cjs} +3 -3
- package/package.json +7 -7
- package/dist/agentAttachments-M_B5qEF2.mjs +0 -18
- package/dist/selfCheck-BQ_H2Sns.mjs +0 -86
- package/dist/startupSessionCreate-CYc8mra-.cjs +0 -26
- package/dist/startupSessionCreate-npXe2TdN.mjs +0 -24
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function flushStream(stream) {
|
|
2
|
+
return new Promise((resolve) => {
|
|
3
|
+
if (stream.destroyed || stream.writableEnded) {
|
|
4
|
+
resolve();
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
stream.on("error", () => resolve());
|
|
8
|
+
try {
|
|
9
|
+
stream.write("", () => resolve());
|
|
10
|
+
} catch {
|
|
11
|
+
resolve();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async function flushThenExit(code, streams, exit) {
|
|
16
|
+
await Promise.all(streams.map(flushStream));
|
|
17
|
+
return exit(code);
|
|
18
|
+
}
|
|
19
|
+
function exitAfterFlush(code) {
|
|
20
|
+
return flushThenExit(code, [process.stdout, process.stderr], (exitCode) => process.exit(exitCode));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { exitAfterFlush as e };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function flushStream(stream) {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
if (stream.destroyed || stream.writableEnded) {
|
|
6
|
+
resolve();
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
stream.on("error", () => resolve());
|
|
10
|
+
try {
|
|
11
|
+
stream.write("", () => resolve());
|
|
12
|
+
} catch {
|
|
13
|
+
resolve();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async function flushThenExit(code, streams, exit) {
|
|
18
|
+
await Promise.all(streams.map(flushStream));
|
|
19
|
+
return exit(code);
|
|
20
|
+
}
|
|
21
|
+
function exitAfterFlush(code) {
|
|
22
|
+
return flushThenExit(code, [process.stdout, process.stderr], (exitCode) => process.exit(exitCode));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.exitAfterFlush = exitAfterFlush;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import { s as spawnHappyCLI } from './spawnHappyCLI-
|
|
2
|
+
import { s as spawnHappyCLI } from './spawnHappyCLI-DjbkiSH1.mjs';
|
|
3
3
|
import axios, { AxiosError } from 'axios';
|
|
4
4
|
import tweetnacl from 'tweetnacl';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { d as decodeBase64, a as decryptWithDataKey, b as decryptLegacy } from './authRelay-DhQhkBvX.mjs';
|
|
7
|
-
import { c as configuration } from './configuration-
|
|
8
|
-
import { g as getLocalHappyAgentCredentialPath, r as readLocalHappyAgentCredentials } from './localHappyAgentAuth-
|
|
7
|
+
import { c as configuration } from './configuration-Dechcvd-.mjs';
|
|
8
|
+
import { g as getLocalHappyAgentCredentialPath, r as readLocalHappyAgentCredentials } from './localHappyAgentAuth-BBhM4Qk1.mjs';
|
|
9
9
|
import 'cross-spawn';
|
|
10
10
|
import 'node:path';
|
|
11
11
|
import './projectPath-BTBIMB57.mjs';
|
|
12
12
|
import 'path';
|
|
13
13
|
import 'url';
|
|
14
|
-
import './logger-
|
|
14
|
+
import './logger-CL7pin9b.mjs';
|
|
15
15
|
import 'chalk';
|
|
16
16
|
import 'node:util';
|
|
17
17
|
import 'node:crypto';
|
|
18
18
|
import 'node:os';
|
|
19
|
-
import './package-
|
|
19
|
+
import './package-C6uiXULx.mjs';
|
|
20
20
|
import 'node:fs/promises';
|
|
21
21
|
|
|
22
22
|
const ResumableMetadataSchema = z.object({
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var node_fs = require('node:fs');
|
|
4
|
-
var spawnHappyCLI = require('./spawnHappyCLI-
|
|
4
|
+
var spawnHappyCLI = require('./spawnHappyCLI-CTy3p6V_.cjs');
|
|
5
5
|
var axios = require('axios');
|
|
6
6
|
var tweetnacl = require('tweetnacl');
|
|
7
7
|
var z = require('zod');
|
|
8
8
|
var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
9
|
-
var configuration = require('./configuration-
|
|
10
|
-
var localHappyAgentAuth = require('./localHappyAgentAuth-
|
|
9
|
+
var configuration = require('./configuration-Dt5lKW3P.cjs');
|
|
10
|
+
var localHappyAgentAuth = require('./localHappyAgentAuth-CKNW-MXw.cjs');
|
|
11
11
|
require('cross-spawn');
|
|
12
12
|
require('node:path');
|
|
13
13
|
require('./projectPath-C3ioB4Bu.cjs');
|
|
14
14
|
require('path');
|
|
15
15
|
require('url');
|
|
16
|
-
require('./logger-
|
|
16
|
+
require('./logger-BBRTTVsQ.cjs');
|
|
17
17
|
require('chalk');
|
|
18
18
|
require('node:util');
|
|
19
19
|
require('node:crypto');
|
|
20
20
|
require('node:os');
|
|
21
|
-
require('./package-
|
|
21
|
+
require('./package-DrY090nZ.cjs');
|
|
22
22
|
require('node:fs/promises');
|
|
23
23
|
|
|
24
24
|
const ResumableMetadataSchema = z.z.object({
|
|
@@ -17,4 +17,31 @@ function registerAgentAttachmentDownloads(session) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
class HeldInput {
|
|
21
|
+
constructor(tombstone) {
|
|
22
|
+
this.tombstone = tombstone;
|
|
23
|
+
}
|
|
24
|
+
keys = null;
|
|
25
|
+
/** The runner took this batch off its queue; it has not reached the agent yet. */
|
|
26
|
+
hold(sourceIds) {
|
|
27
|
+
this.keys = sourceIds && sourceIds.length > 0 ? [...sourceIds] : null;
|
|
28
|
+
}
|
|
29
|
+
/** The agent has it (it runs, or fails as its own turn): nothing to report. */
|
|
30
|
+
delivered() {
|
|
31
|
+
this.keys = null;
|
|
32
|
+
}
|
|
33
|
+
get holding() {
|
|
34
|
+
return this.keys !== null;
|
|
35
|
+
}
|
|
36
|
+
/** It will never reach the agent: tell the web why. True when something was reported. */
|
|
37
|
+
drop(reason) {
|
|
38
|
+
const keys = this.keys;
|
|
39
|
+
this.keys = null;
|
|
40
|
+
if (!keys) return false;
|
|
41
|
+
this.tombstone(keys, reason);
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.HeldInput = HeldInput;
|
|
20
47
|
exports.registerAgentAttachmentDownloads = registerAgentAttachmentDownloads;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function registerAgentAttachmentDownloads(session) {
|
|
2
|
+
session.onFileEvent((fileEvent) => {
|
|
3
|
+
const attachment = fileEvent.content.data.ev;
|
|
4
|
+
const download = (async () => {
|
|
5
|
+
try {
|
|
6
|
+
const data = await session.downloadAndDecryptAttachment(attachment.ref);
|
|
7
|
+
if (!data) throw new Error("Attachment decryption failed");
|
|
8
|
+
return { data, mimeType: attachment.mimeType ?? "image/jpeg", name: attachment.name };
|
|
9
|
+
} catch {
|
|
10
|
+
session.sendSessionEvent({ type: "message", message: `Could not download attachment: ${attachment.name}. Please attach it again.` });
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
})();
|
|
14
|
+
session.trackAttachmentDownload(download);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class HeldInput {
|
|
19
|
+
constructor(tombstone) {
|
|
20
|
+
this.tombstone = tombstone;
|
|
21
|
+
}
|
|
22
|
+
keys = null;
|
|
23
|
+
/** The runner took this batch off its queue; it has not reached the agent yet. */
|
|
24
|
+
hold(sourceIds) {
|
|
25
|
+
this.keys = sourceIds && sourceIds.length > 0 ? [...sourceIds] : null;
|
|
26
|
+
}
|
|
27
|
+
/** The agent has it (it runs, or fails as its own turn): nothing to report. */
|
|
28
|
+
delivered() {
|
|
29
|
+
this.keys = null;
|
|
30
|
+
}
|
|
31
|
+
get holding() {
|
|
32
|
+
return this.keys !== null;
|
|
33
|
+
}
|
|
34
|
+
/** It will never reach the agent: tell the web why. True when something was reported. */
|
|
35
|
+
drop(reason) {
|
|
36
|
+
const keys = this.keys;
|
|
37
|
+
this.keys = null;
|
|
38
|
+
if (!keys) return false;
|
|
39
|
+
this.tombstone(keys, reason);
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { HeldInput as H, registerAgentAttachmentDownloads as r };
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var node_fs = require('node:fs');
|
|
4
4
|
var os = require('node:os');
|
|
5
|
-
var logger = require('./logger-
|
|
6
|
-
var persistence = require('./persistence-
|
|
5
|
+
var logger = require('./logger-BBRTTVsQ.cjs');
|
|
6
|
+
var persistence = require('./persistence-Bl5S3TLB.cjs');
|
|
7
7
|
var loginShellEnv = require('./loginShellEnv-BkuYtExZ.cjs');
|
|
8
8
|
require('chalk');
|
|
9
9
|
require('node:util');
|
|
10
|
-
require('./configuration-
|
|
10
|
+
require('./configuration-Dt5lKW3P.cjs');
|
|
11
11
|
require('node:path');
|
|
12
|
-
require('./package-
|
|
12
|
+
require('./package-DrY090nZ.cjs');
|
|
13
13
|
require('node:fs/promises');
|
|
14
14
|
require('zod');
|
|
15
15
|
require('./authRelay-Dy1qU9td.cjs');
|
|
@@ -1,94 +1,95 @@
|
|
|
1
|
-
import { D as DefaultTransport, A as AcpBackend, i as isAgentExitError, a as acpNoticeMessage } from './AcpBackend-
|
|
2
|
-
export { b as DEFAULT_IDLE_TIMEOUT_MS, c as DEFAULT_TOOL_CALL_TIMEOUT_MS, e as extractErrorDetail, f as formatDuration, d as formatDurationMinutes, h as handleAgentMessageChunk, g as handleAgentThoughtChunk, j as handleLegacyMessageChunk, k as handlePlanUpdate, l as handleThinkingUpdate, m as handleToolCall, n as handleToolCallUpdate, p as parseArgsFromContent } from './AcpBackend-
|
|
3
|
-
import { l as logger } from './logger-
|
|
4
|
-
import { A as AcpSessionManager } from './AcpSessionManager-
|
|
5
|
-
import {
|
|
6
|
-
import { h as hashObject, s as startHappyServer, r as readPiModelsJson, a as resolvePiContextUsage, c as createProjectInjector } from './deterministicJson-
|
|
1
|
+
import { D as DefaultTransport, A as AcpBackend, i as isAgentExitError, a as acpNoticeMessage } from './AcpBackend-Dd1h-Rgt.mjs';
|
|
2
|
+
export { b as DEFAULT_IDLE_TIMEOUT_MS, c as DEFAULT_TOOL_CALL_TIMEOUT_MS, e as extractErrorDetail, f as formatDuration, d as formatDurationMinutes, h as handleAgentMessageChunk, g as handleAgentThoughtChunk, j as handleLegacyMessageChunk, k as handlePlanUpdate, l as handleThinkingUpdate, m as handleToolCall, n as handleToolCallUpdate, p as parseArgsFromContent } from './AcpBackend-Dd1h-Rgt.mjs';
|
|
3
|
+
import { l as logger } from './logger-CL7pin9b.mjs';
|
|
4
|
+
import { A as AcpSessionManager } from './AcpSessionManager-QBZ-CIf7.mjs';
|
|
5
|
+
import { P as PROMPT_QUEUE_CAPABILITY, a as PROJECT_SESSION_CAPABILITY, H as PI_STEER_CAPABILITY, j as BUILTIN_TODO_DISCOVERY } from './index-DmqsRnV7.mjs';
|
|
6
|
+
import { h as hashObject, s as startHappyServer, r as readPiModelsJson, a as resolvePiContextUsage, c as createProjectInjector } from './deterministicJson-DNmMVhFu.mjs';
|
|
7
7
|
import { c as compactCommandText, C as COMPACT_UNSUPPORTED_NOTICE } from './specialCommands-MXUN0wfI.mjs';
|
|
8
|
-
import { r as registerAgentAttachmentDownloads } from './
|
|
9
|
-
import { c as configuration } from './configuration-
|
|
10
|
-
import { a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt, C as CLAUDE_ATTACHMENT_KINDS } from './attachmentContent-
|
|
11
|
-
import { p as preparePiTeamsRuntime } from './piRuntime-
|
|
8
|
+
import { r as registerAgentAttachmentDownloads, H as HeldInput } from './heldInput-C69lA2dH.mjs';
|
|
9
|
+
import { c as configuration } from './configuration-Dechcvd-.mjs';
|
|
10
|
+
import { a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt, C as CLAUDE_ATTACHMENT_KINDS } from './attachmentContent-CC4yIrSm.mjs';
|
|
11
|
+
import { p as preparePiTeamsRuntime } from './piRuntime-BoeMsAXK.mjs';
|
|
12
12
|
import { randomUUID } from 'node:crypto';
|
|
13
13
|
import { join } from 'node:path';
|
|
14
|
-
import { c as connectionState, A as ApiClient } from './api-
|
|
15
|
-
import { s as sharedProjectsClient } from './client-
|
|
16
|
-
import { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-
|
|
17
|
-
import { r as readSettings } from './persistence-
|
|
18
|
-
import { g as getInitialMachineMetadata } from './machineMetadata-
|
|
19
|
-
import { c as createSessionMetadata } from './createSessionMetadata-
|
|
20
|
-
import { s as setupOfflineReconnection } from './setupOfflineReconnection-
|
|
21
|
-
import { c as createSessionForStartup } from './startupSessionCreate-
|
|
22
|
-
import { n as notifyDaemonSessionStarted, k as reportSessionEditToDaemon } from './controlClient-
|
|
14
|
+
import { c as connectionState, A as ApiClient } from './api-Dw8gFsQi.mjs';
|
|
15
|
+
import { s as sharedProjectsClient } from './client-CnGNYidN.mjs';
|
|
16
|
+
import { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-CzgklwLG.mjs';
|
|
17
|
+
import { r as readSettings, a as resolveCheckMs } from './persistence-Dogj7JIp.mjs';
|
|
18
|
+
import { g as getInitialMachineMetadata } from './machineMetadata-DP06qdBk.mjs';
|
|
19
|
+
import { c as createSessionMetadata } from './createSessionMetadata-DyhFKAby.mjs';
|
|
20
|
+
import { s as setupOfflineReconnection } from './setupOfflineReconnection-CyPNgyCe.mjs';
|
|
21
|
+
import { c as createSessionForStartup, H as HibernationProbe } from './startupSessionCreate-BKFU4v_h.mjs';
|
|
22
|
+
import { n as notifyDaemonSessionStarted, c as checkDaemonHibernation, k as reportSessionEditToDaemon } from './controlClient-D7NGfmtq.mjs';
|
|
23
23
|
import { d as decodeBase64, e as encodeBase64 } from './authRelay-DhQhkBvX.mjs';
|
|
24
|
-
import { c as claimSessionOrExit, a as applyServerSnapshot, w as withoutServerSnapshot, m as mergeReconnectMetadata } from './sessionLock-
|
|
25
|
-
import { r as readAcpReconnectEnv, n as normalizeAcpPermissionMode, p as piRestartNotice, w as writeSessionModeFile, a as removeSessionModeFile } from './acpSessionResume-
|
|
26
|
-
import { S as StreamRelay } from './streamRelay-
|
|
24
|
+
import { A as AUTO_RESTART_CAPABILITY, c as claimSessionOrExit, a as applyServerSnapshot, w as withoutServerSnapshot, m as mergeReconnectMetadata, t as takeAutoRestartedEvent } from './sessionLock-Ca_bIo50.mjs';
|
|
25
|
+
import { r as readAcpReconnectEnv, n as normalizeAcpPermissionMode, p as piRestartNotice, w as writeSessionModeFile, a as removeSessionModeFile } from './acpSessionResume-CcpDuIO5.mjs';
|
|
26
|
+
import { S as StreamRelay } from './streamRelay-P9e7Sohm.mjs';
|
|
27
27
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
28
|
-
import { B as BasePermissionHandler } from './BasePermissionHandler-
|
|
29
|
-
import { T as TitleGenerator } from './titleGenerator-
|
|
28
|
+
import { B as BasePermissionHandler } from './BasePermissionHandler-CLp1ge-4.mjs';
|
|
29
|
+
import { T as TitleGenerator } from './titleGenerator-DgzTQdn2.mjs';
|
|
30
30
|
import { E as EditReportThrottle, e as extractAcpEditPaths } from './editPaths-BVfS_FFL.mjs';
|
|
31
31
|
import { readFileSync } from 'node:fs';
|
|
32
32
|
import { homedir } from 'node:os';
|
|
33
33
|
import 'node:child_process';
|
|
34
34
|
import '@agentclientprotocol/sdk';
|
|
35
|
-
import './time-
|
|
35
|
+
import './time-CN3TuSVG.mjs';
|
|
36
36
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
37
37
|
import './processTree-CP5IvQ2Z.mjs';
|
|
38
|
-
import './package-
|
|
38
|
+
import './package-C6uiXULx.mjs';
|
|
39
39
|
import 'chalk';
|
|
40
40
|
import 'node:util';
|
|
41
41
|
import '@paralleldrive/cuid2';
|
|
42
42
|
import 'zod';
|
|
43
43
|
import './prompt-QHuFx9j6.mjs';
|
|
44
|
-
import './reportProgressTool-
|
|
45
|
-
import './client-
|
|
44
|
+
import './reportProgressTool-CgPy6n_7.mjs';
|
|
45
|
+
import './client-DZkBUoh9.mjs';
|
|
46
46
|
import './precheckCompat-DeEbilbr.mjs';
|
|
47
47
|
import './agentGuidance-BDYt2Qy2.mjs';
|
|
48
48
|
import './trimIdent-BAjmv_TG.mjs';
|
|
49
49
|
import './pi-CqyoZMjI.mjs';
|
|
50
50
|
import './fileStore-5qpetZS0.mjs';
|
|
51
51
|
import 'node:fs/promises';
|
|
52
|
-
import './client-
|
|
53
|
-
import './context-
|
|
54
|
-
import './sessionOps-
|
|
52
|
+
import './client-CtL0Vtww.mjs';
|
|
53
|
+
import './context-C9JbJoNe.mjs';
|
|
54
|
+
import './sessionOps-CA2kpm66.mjs';
|
|
55
55
|
import 'axios';
|
|
56
56
|
import 'socket.io-client';
|
|
57
57
|
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
58
58
|
import './resources-CLP_MpK4.mjs';
|
|
59
|
-
import './tools-
|
|
60
|
-
import './peerTools-
|
|
59
|
+
import './tools-zXJpxiG_.mjs';
|
|
60
|
+
import './peerTools-dY1aJez4.mjs';
|
|
61
61
|
import './ids-DU6sLx4C.mjs';
|
|
62
|
-
import './remoteSessionClient-
|
|
62
|
+
import './remoteSessionClient-BiC2KDew.mjs';
|
|
63
63
|
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
64
64
|
import 'node:http';
|
|
65
65
|
import '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
66
66
|
import './limits-DIo7rEBR.mjs';
|
|
67
|
-
import './downloadTarget-
|
|
67
|
+
import './downloadTarget-CGojGjaN.mjs';
|
|
68
68
|
import './terminals-Dlg0x3nY.mjs';
|
|
69
69
|
import './terminalTitleSuggest-CeKsX_V6.mjs';
|
|
70
70
|
import './tmuxSocket-B8Yx20sT.mjs';
|
|
71
|
-
import './bootstrap-
|
|
71
|
+
import './bootstrap-Ct9Nb4sv.mjs';
|
|
72
72
|
import './webPanels-B2_C2-3g.mjs';
|
|
73
|
-
import './pushNotifications-
|
|
73
|
+
import './pushNotifications-dUceOIni.mjs';
|
|
74
74
|
import './previewPath-CXN4Vag0.mjs';
|
|
75
75
|
import 'crypto';
|
|
76
|
-
import './lidState-
|
|
76
|
+
import './lidState-D0DF20oG.mjs';
|
|
77
77
|
import 'os';
|
|
78
78
|
import 'child_process';
|
|
79
79
|
import 'node:events';
|
|
80
|
-
import './registerCommonHandlers-
|
|
80
|
+
import './registerCommonHandlers-DWZ7mfdt.mjs';
|
|
81
81
|
import 'util';
|
|
82
82
|
import 'fs/promises';
|
|
83
83
|
import 'path';
|
|
84
84
|
import 'cross-spawn';
|
|
85
|
-
import './sync-
|
|
85
|
+
import './sync-eZkXnsW_.mjs';
|
|
86
86
|
import 'tweetnacl';
|
|
87
87
|
import './types-CkqAACXx.mjs';
|
|
88
88
|
import './detectCLI-CSGMlV51.mjs';
|
|
89
89
|
import 'fs';
|
|
90
|
-
import './localHappyAgentAuth-
|
|
90
|
+
import './localHappyAgentAuth-BBhM4Qk1.mjs';
|
|
91
91
|
import './fsMkdir-DumgLTzR.mjs';
|
|
92
|
+
import './cliUpdate-Y34VGe9Y.mjs';
|
|
92
93
|
import './processTreeSnapshot-CuLJDNC-.mjs';
|
|
93
94
|
import 'url';
|
|
94
95
|
import 'node:module';
|
|
@@ -161,6 +162,10 @@ function describeAcpTurnFailure(agentName, error) {
|
|
|
161
162
|
return { message: `${agentName} error: ${detail}`, error: detail, exited: false };
|
|
162
163
|
}
|
|
163
164
|
|
|
165
|
+
function acpExitIntent(exit) {
|
|
166
|
+
return exit?.intent ?? "offline";
|
|
167
|
+
}
|
|
168
|
+
|
|
164
169
|
const OUT_OF_TURN_QUIET_MS = 6e4;
|
|
165
170
|
function isAcpTurnContent(msg) {
|
|
166
171
|
if (msg.type === "model-output") return typeof msg.textDelta === "string" && msg.textDelta.length > 0;
|
|
@@ -826,7 +831,9 @@ async function runAcp(opts) {
|
|
|
826
831
|
machineId: settings.machineId,
|
|
827
832
|
startedBy: opts.startedBy,
|
|
828
833
|
sandbox: settings.sandboxConfig,
|
|
829
|
-
|
|
834
|
+
// B-852: a daemon-spawned pi session reports when it is quiescent, so the
|
|
835
|
+
// daemon can restart it onto new code after an upgrade.
|
|
836
|
+
capabilities: [PROMPT_QUEUE_CAPABILITY, PROJECT_SESSION_CAPABILITY, ...opts.agentName === "pi" && opts.startedBy === "daemon" ? [AUTO_RESTART_CAPABILITY] : []]
|
|
830
837
|
});
|
|
831
838
|
metadata.attachmentKinds = [];
|
|
832
839
|
if (opts.agentName === "gemini") metadata.configuredModel = readGeminiConfiguredModel();
|
|
@@ -919,6 +926,11 @@ async function runAcp(opts) {
|
|
|
919
926
|
messageQueue.setOnWait(() => drain.onIdle());
|
|
920
927
|
}
|
|
921
928
|
attachPromptQueueDrain(session);
|
|
929
|
+
messageQueue.setOnDiscard((entries) => {
|
|
930
|
+
const keys = entries.map((entry) => entry.sourceId).filter((key) => typeof key === "string");
|
|
931
|
+
if (keys.length > 0) session.sendQueueCancelReason(keys, entries[0].reason);
|
|
932
|
+
});
|
|
933
|
+
const heldInput = new HeldInput((keys, reason) => session.sendQueueCancelReason(keys, reason));
|
|
922
934
|
let currentPermissionMode;
|
|
923
935
|
let currentModel;
|
|
924
936
|
let modeSelector = null;
|
|
@@ -1013,7 +1025,16 @@ async function runAcp(opts) {
|
|
|
1013
1025
|
session.keepAlive(thinking, "remote");
|
|
1014
1026
|
};
|
|
1015
1027
|
let acpSessionId = null;
|
|
1028
|
+
let piProbe = null;
|
|
1016
1029
|
let shouldExit = false;
|
|
1030
|
+
let exit = null;
|
|
1031
|
+
const beginExit = (intent, reason) => {
|
|
1032
|
+
if (!exit) exit = { intent, reason };
|
|
1033
|
+
shouldExit = true;
|
|
1034
|
+
heldInput.drop(exit.reason);
|
|
1035
|
+
messageQueue.discardAll(exit.reason);
|
|
1036
|
+
messageQueue.close();
|
|
1037
|
+
};
|
|
1017
1038
|
let abortController = new AbortController();
|
|
1018
1039
|
let turnCancelled = false;
|
|
1019
1040
|
let backendStarted = false;
|
|
@@ -1023,8 +1044,8 @@ async function runAcp(opts) {
|
|
|
1023
1044
|
const stopRunnerFromBackendStatus = (status, detail) => {
|
|
1024
1045
|
const reason = detail ? `${opts.agentName} backend ${status}: ${detail}` : `${opts.agentName} backend ${status}`;
|
|
1025
1046
|
logger.debug(`[${opts.agentName}] ${reason}; stopping ACP runner`);
|
|
1026
|
-
|
|
1027
|
-
|
|
1047
|
+
session.sendSessionEvent({ type: "message", message: reason });
|
|
1048
|
+
beginExit("offline", "failed");
|
|
1028
1049
|
};
|
|
1029
1050
|
const sendEnvelopes = (envelopes) => {
|
|
1030
1051
|
for (const envelope of envelopes) {
|
|
@@ -1382,6 +1403,7 @@ async function runAcp(opts) {
|
|
|
1382
1403
|
}).catch(() => {
|
|
1383
1404
|
logger.warn("[ACP] Failed to prepare user attachments");
|
|
1384
1405
|
session.sendSessionEvent({ type: "message", message: "Could not prepare this message. Please send it again." });
|
|
1406
|
+
if (message.localKey) session.sendQueueCancelReason([message.localKey], exit?.reason ?? "failed");
|
|
1385
1407
|
});
|
|
1386
1408
|
});
|
|
1387
1409
|
session.keepAlive(thinking, "remote");
|
|
@@ -1421,10 +1443,15 @@ async function runAcp(opts) {
|
|
|
1421
1443
|
}
|
|
1422
1444
|
);
|
|
1423
1445
|
const disposeTermination = registerKillSessionHandler(session.rpcHandlerManager, async () => {
|
|
1424
|
-
|
|
1425
|
-
messageQueue.close();
|
|
1446
|
+
beginExit("archive", "aborted");
|
|
1426
1447
|
await handleAbort();
|
|
1427
|
-
}, session, {
|
|
1448
|
+
}, session, {
|
|
1449
|
+
processSignals: true,
|
|
1450
|
+
onSignal: async () => {
|
|
1451
|
+
beginExit("offline", "restarted");
|
|
1452
|
+
await handleAbort();
|
|
1453
|
+
}
|
|
1454
|
+
});
|
|
1428
1455
|
const afterSessionStarted = async (requestedModel) => {
|
|
1429
1456
|
if (requestedModel) {
|
|
1430
1457
|
await switchModelIfRequested(requestedModel);
|
|
@@ -1478,6 +1505,36 @@ async function runAcp(opts) {
|
|
|
1478
1505
|
logger.debug(`[${opts.agentName}] Resume of agent session ${resumeId}: ${started.resumed ?? "new"}${started.loadFailure ? ` (${started.loadFailure})` : ""}`);
|
|
1479
1506
|
if (started.resumed !== "loaded") session.sendSessionEvent({ type: "message", message: piRestartNotice(opts.agentName, "resume", started) });
|
|
1480
1507
|
}
|
|
1508
|
+
if (opts.agentName === "pi" && opts.startedBy === "daemon") {
|
|
1509
|
+
const piSnapshot = () => {
|
|
1510
|
+
const meta = session.getMetadata();
|
|
1511
|
+
return {
|
|
1512
|
+
flavor: "acp",
|
|
1513
|
+
resumable: typeof meta?.piSessionId === "string" && meta.piSessionId.length > 0,
|
|
1514
|
+
uiSession: true,
|
|
1515
|
+
...isAssistantVariant ? { variant: "assistant" } : {},
|
|
1516
|
+
...process.env.HAPPY_SPAWNED_BY ? { spawnedBy: process.env.HAPPY_SPAWNED_BY } : {},
|
|
1517
|
+
...meta?.tags ? { tags: meta.tags } : {},
|
|
1518
|
+
keepAwake: false,
|
|
1519
|
+
thinking,
|
|
1520
|
+
queuedInputs: messageQueue.size() + (session.promptQueueHasPending() ? 1 : 0),
|
|
1521
|
+
waitingForInput: messageQueue.isWaiting(),
|
|
1522
|
+
pendingRequests: Object.keys(session.getAgentState()?.requests ?? {}).length,
|
|
1523
|
+
backgroundTasks: 0,
|
|
1524
|
+
lastActivityAt: session.lastActivityAt,
|
|
1525
|
+
...shouldExit ? { exiting: true } : {}
|
|
1526
|
+
};
|
|
1527
|
+
};
|
|
1528
|
+
piProbe = new HibernationProbe({
|
|
1529
|
+
checkMs: resolveCheckMs(),
|
|
1530
|
+
snapshot: piSnapshot,
|
|
1531
|
+
ask: (report) => checkDaemonHibernation({ sessionId: session.sessionId, pid: process.pid, report }),
|
|
1532
|
+
commit: async () => false
|
|
1533
|
+
});
|
|
1534
|
+
piProbe.start();
|
|
1535
|
+
}
|
|
1536
|
+
const autoUpdated = takeAutoRestartedEvent(process.env);
|
|
1537
|
+
if (autoUpdated) session.sendSessionEvent(autoUpdated);
|
|
1481
1538
|
if (verbose) {
|
|
1482
1539
|
if (!sawSlashCommands) {
|
|
1483
1540
|
logAcp("muted", `Outgoing slash commands from ${opts.agentName}: not reported yet`);
|
|
@@ -1501,6 +1558,7 @@ async function runAcp(opts) {
|
|
|
1501
1558
|
}
|
|
1502
1559
|
break;
|
|
1503
1560
|
}
|
|
1561
|
+
heldInput.hold(batch.sourceIds);
|
|
1504
1562
|
logAcp("incoming", `Incoming prompt: ${formatUnknownForConsole(batch.message, ACP_EVENT_PREVIEW_CHARS)}`);
|
|
1505
1563
|
endOutOfTurn("prompt");
|
|
1506
1564
|
sendEnvelopes(sessionManager.startTurn());
|
|
@@ -1530,6 +1588,13 @@ async function runAcp(opts) {
|
|
|
1530
1588
|
happyHomeDir: configuration.happyHomeDir,
|
|
1531
1589
|
sessionId: session.sessionId
|
|
1532
1590
|
}) : [];
|
|
1591
|
+
if (shouldExit) {
|
|
1592
|
+
sendEnvelopes(sessionManager.endTurn("cancelled"));
|
|
1593
|
+
streamRelay.endTurn();
|
|
1594
|
+
setThinking(false);
|
|
1595
|
+
break;
|
|
1596
|
+
}
|
|
1597
|
+
heldInput.delivered();
|
|
1533
1598
|
promptInFlight = true;
|
|
1534
1599
|
let outcome;
|
|
1535
1600
|
try {
|
|
@@ -1556,6 +1621,7 @@ async function runAcp(opts) {
|
|
|
1556
1621
|
} catch (error) {
|
|
1557
1622
|
const failure = describeAcpTurnFailure(opts.agentName, error);
|
|
1558
1623
|
session.sendSessionEvent({ type: "message", message: failure.message });
|
|
1624
|
+
heldInput.drop("failed");
|
|
1559
1625
|
sendEnvelopes(sessionManager.endTurn("failed", failure.error));
|
|
1560
1626
|
streamRelay.endTurn();
|
|
1561
1627
|
setThinking(false);
|
|
@@ -1568,6 +1634,7 @@ async function runAcp(opts) {
|
|
|
1568
1634
|
}
|
|
1569
1635
|
} finally {
|
|
1570
1636
|
disposeTermination?.();
|
|
1637
|
+
piProbe?.stop();
|
|
1571
1638
|
setThinking(false);
|
|
1572
1639
|
clearInterval(keepAliveInterval);
|
|
1573
1640
|
streamRelay.endTurn();
|
|
@@ -1594,15 +1661,27 @@ async function runAcp(opts) {
|
|
|
1594
1661
|
}
|
|
1595
1662
|
try {
|
|
1596
1663
|
session.closePromptQueueDrain();
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1664
|
+
heldInput.drop(exit?.reason ?? "failed");
|
|
1665
|
+
messageQueue.discardAll(exit?.reason ?? "failed");
|
|
1666
|
+
const intent = acpExitIntent(exit);
|
|
1667
|
+
if (intent === "archive") {
|
|
1668
|
+
session.updateMetadata((currentMetadata) => ({
|
|
1669
|
+
...currentMetadata,
|
|
1670
|
+
lifecycleState: "archived",
|
|
1671
|
+
lifecycleStateSince: Date.now(),
|
|
1672
|
+
archivedBy: "cli",
|
|
1673
|
+
archiveReason: "Session ended"
|
|
1674
|
+
}));
|
|
1675
|
+
}
|
|
1604
1676
|
session.sendSessionDeath();
|
|
1605
1677
|
await session.flush();
|
|
1678
|
+
if (intent === "offline") {
|
|
1679
|
+
try {
|
|
1680
|
+
await api.deactivateSession(session.sessionId);
|
|
1681
|
+
} catch (error) {
|
|
1682
|
+
logger.debug(`[${opts.agentName}] deactivate on exit failed:`, error);
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1606
1685
|
await session.close();
|
|
1607
1686
|
} catch (error) {
|
|
1608
1687
|
logger.debug(`[${opts.agentName}] Session close failed:`, error);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _package = require('./package-
|
|
3
|
+
var _package = require('./package-DrY090nZ.cjs');
|
|
4
4
|
var module$1 = require('node:module');
|
|
5
5
|
var node_fs = require('node:fs');
|
|
6
6
|
var promises = require('node:fs/promises');
|
|
@@ -59,10 +59,10 @@ async function pruneStaleCompileCaches(happyHomeDir, cliVersion) {
|
|
|
59
59
|
async function run(args) {
|
|
60
60
|
enableCompileCacheIfPossible(_package.packageJson.version);
|
|
61
61
|
if (isStandaloneVersionRequest(args) || isSelfCheckRequest(args)) {
|
|
62
|
-
const { selfCheckMain } = await Promise.resolve().then(function () { return require('./selfCheck-
|
|
62
|
+
const { selfCheckMain } = await Promise.resolve().then(function () { return require('./selfCheck-CccwNTTK.cjs'); });
|
|
63
63
|
process.exit(await selfCheckMain({ verbose: isSelfCheckRequest(args) }));
|
|
64
64
|
}
|
|
65
|
-
const { main } = await Promise.resolve().then(function () { return require('./main-
|
|
65
|
+
const { main } = await Promise.resolve().then(function () { return require('./main-DLOXykOR.cjs'); });
|
|
66
66
|
await main();
|
|
67
67
|
}
|
|
68
68
|
void run(process.argv.slice(2));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { statSync, readdirSync } from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
|
-
import { l as logger } from './logger-
|
|
4
|
-
import { r as readSettings } from './persistence-
|
|
3
|
+
import { l as logger } from './logger-CL7pin9b.mjs';
|
|
4
|
+
import { r as readSettings } from './persistence-Dogj7JIp.mjs';
|
|
5
5
|
import { d as describeAgentHome, C as CLAUDE_CONFIG_DIR_ENV, a as CODEX_HOME_ENV, f as findClaudeConversation, b as agentHomeCandidates, c as findCodexThread, r as resolveAgentHomes, A as AGENT_HOME_ENV_NAMES, g as agentHomeEnv, p as probeLoginShellEnv } from './loginShellEnv-Dw8M7tkI.mjs';
|
|
6
6
|
export { h as claudeConversationPath, i as claudeProjectDirName, j as codexRolloutFileMatches, e as expandHomePath } from './loginShellEnv-Dw8M7tkI.mjs';
|
|
7
7
|
import 'chalk';
|
|
8
8
|
import 'node:util';
|
|
9
|
-
import './configuration-
|
|
9
|
+
import './configuration-Dechcvd-.mjs';
|
|
10
10
|
import 'node:path';
|
|
11
|
-
import './package-
|
|
11
|
+
import './package-C6uiXULx.mjs';
|
|
12
12
|
import 'node:fs/promises';
|
|
13
13
|
import 'zod';
|
|
14
14
|
import './authRelay-DhQhkBvX.mjs';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var query = require('./query-
|
|
3
|
+
var query = require('./query-DjsVgG3E.cjs');
|
|
4
4
|
var claudeAgentSdk = require('@anthropic-ai/claude-agent-sdk');
|
|
5
5
|
require('./promptCacheTtl-B8PCzE6k.cjs');
|
|
6
6
|
require('node:fs');
|
|
7
7
|
require('node:os');
|
|
8
8
|
require('node:path');
|
|
9
|
-
require('./logger-
|
|
9
|
+
require('./logger-BBRTTVsQ.cjs');
|
|
10
10
|
require('chalk');
|
|
11
11
|
require('node:util');
|
|
12
|
-
require('./configuration-
|
|
13
|
-
require('./package-
|
|
12
|
+
require('./configuration-Dt5lKW3P.cjs');
|
|
13
|
+
require('./package-DrY090nZ.cjs');
|
|
14
14
|
require('node:fs/promises');
|
|
15
15
|
require('./processTreeSnapshot-mDbnuojn.cjs');
|
|
16
16
|
require('node:child_process');
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { q as query } from './query-
|
|
1
|
+
import { q as query } from './query-iYH-tm7L.mjs';
|
|
2
2
|
export { AbortError } from '@anthropic-ai/claude-agent-sdk';
|
|
3
3
|
import './promptCacheTtl-Ce0TVbrx.mjs';
|
|
4
4
|
import 'node:fs';
|
|
5
5
|
import 'node:os';
|
|
6
6
|
import 'node:path';
|
|
7
|
-
import './logger-
|
|
7
|
+
import './logger-CL7pin9b.mjs';
|
|
8
8
|
import 'chalk';
|
|
9
9
|
import 'node:util';
|
|
10
|
-
import './configuration-
|
|
11
|
-
import './package-
|
|
10
|
+
import './configuration-Dechcvd-.mjs';
|
|
11
|
+
import './package-C6uiXULx.mjs';
|
|
12
12
|
import 'node:fs/promises';
|
|
13
13
|
import './processTreeSnapshot-CuLJDNC-.mjs';
|
|
14
14
|
import 'node:child_process';
|
|
@@ -1644,4 +1644,4 @@ z.object({
|
|
|
1644
1644
|
reason: z.string()
|
|
1645
1645
|
});
|
|
1646
1646
|
|
|
1647
|
-
export { AUTOMATION_NAME_PATTERN as A, BUILTIN_TODO_SKILL as B,
|
|
1647
|
+
export { AUTOMATION_NAME_PATTERN as A, BUILTIN_TODO_SKILL as B, isAttentionBoardLocalId as C, OwnerBoardUpdateInputSchema as D, OwnerBoardResolveInputSchema as E, OwnerBoardListInputSchema as F, ATTENTION_SESSION_CAPABILITY as G, PI_STEER_CAPABILITY as H, RelayAssignmentResponseSchema as I, CODEX_STEER_CAPABILITY as J, CODEX_COMPACT_CAPABILITY as K, RelayCandidatesResponseSchema as L, ServerMigrateNoticeSchema as M, isHarnessInstallId as N, OwnerBoardPostInputSchema as O, PROMPT_QUEUE_CAPABILITY as P, AUTOMATION_PRECHECK_OUTPUT_MAX_CHARS as Q, ReleaseDrainNoticeSchema as R, STREAM_DELTA_MAX_CHARS as S, AUTOMATION_PRECHECK_DEFAULT_TIMEOUT_MS as T, AUTOMATION_CLAIM_MAX_RUNS as U, AUTOMATION_DAEMON_CAPABILITY_PRECHECK as V, AUTOMATION_DEFAULT_LEASE_MS as W, HARNESS_INSTALL_CAPABILITY_VERSION as X, PROJECT_SESSION_CAPABILITY as a, AUTOMATION_PRECHECK_MAX_TIMEOUT_MS as b, AutomationPrecheckSchema as c, AUTOMATION_ATTENTION_REASON_MAX_CHARS as d, AUTOMATION_SUMMARY_MAX_CHARS as e, isInsideTeamWorktree as f, createEnvelope as g, createBuiltinTodoClient as h, isAutomationRunTerminal as i, BUILTIN_TODO_DISCOVERY as j, getAgentCodeDefaults as k, isLatestModelMode as l, resolveLatestModel as m, normalizeAgentKey as n, AutomationNameSchema as o, parseLatestModelTable as p, AutomationConcurrencySchema as q, rebaseTeamWorktreePath as r, streamKeyOf as s, AutomationActionSchema as t, AutomationTriggerSchema as u, AgentVersionsSchema as v, AGENT_VERSION_SOURCES as w, ATTENTION_DISABLED_ERROR as x, ATTENTION_LIMITS as y, ownerBoardPostToRest as z };
|