very-happy-cli 0.2.188 → 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-2loP7MpF.mjs → AcpBackend-Dd1h-Rgt.mjs} +3 -3
- package/dist/{AcpBackend-B8AYkp5n.cjs → AcpBackend-dkRv9QHm.cjs} +3 -3
- package/dist/{AcpSessionManager-CLqo9R9Y.cjs → AcpSessionManager-AqWAqahm.cjs} +3 -3
- package/dist/{AcpSessionManager-C17doAoR.mjs → AcpSessionManager-QBZ-CIf7.mjs} +4 -4
- package/dist/{BasePermissionHandler-CrfyUmqO.mjs → BasePermissionHandler-CLp1ge-4.mjs} +1 -1
- package/dist/{BasePermissionHandler-C8UEcFz0.cjs → BasePermissionHandler-CpSugp7Z.cjs} +1 -1
- package/dist/{acpSessionResume-OuYlLGxL.cjs → acpSessionResume-CZao6QEd.cjs} +1 -1
- package/dist/{acpSessionResume-F705a1cF.mjs → acpSessionResume-CcpDuIO5.mjs} +1 -1
- package/dist/{agentHome-Dc7LYF3d.mjs → agentHome-BJGRA2Kx.mjs} +4 -4
- package/dist/{agentHome-DsKHJ_Sf.cjs → agentHome-fIUqT-pn.cjs} +4 -4
- package/dist/{api-BOqjYd5r.cjs → api-CXL6jp-p.cjs} +18 -9
- package/dist/{api-DNKa7kVy.mjs → api-Dw8gFsQi.mjs} +19 -10
- package/dist/{apiMachine-Di1G9ECW.mjs → apiMachine-BBNEtjf7.mjs} +56 -15
- package/dist/{apiMachine--rcPpMmt.cjs → apiMachine-C6UqHoPF.cjs} +55 -14
- package/dist/{attachmentContent-C9S4ekAz.mjs → attachmentContent-CC4yIrSm.mjs} +2 -2
- package/dist/{attachmentContent-BFRMLong.cjs → attachmentContent-NmVfKp-B.cjs} +2 -2
- package/dist/{auth-CXmI92aj.cjs → auth-Bb_SL2os.cjs} +5 -5
- package/dist/{auth-Bzwo_vOM.mjs → auth-Bh6SUoGi.mjs} +8 -8
- package/dist/{auth-BNhhk2Fr.mjs → auth-Bj0psrD2.mjs} +5 -5
- package/dist/{auth-CQtfznF0.cjs → auth-DKa4MsAi.cjs} +8 -8
- package/dist/{auto-DXLdaX5O.cjs → auto-C9Qohh0P.cjs} +17 -16
- package/dist/{auto-DHYOLnXB.mjs → auto-DK7pbCnV.mjs} +19 -18
- package/dist/{bootstrap-Di38SnpN.mjs → bootstrap-Ct9Nb4sv.mjs} +2 -2
- package/dist/{bootstrap-eJ1l7VYl.cjs → bootstrap-DBJB0y-H.cjs} +2 -2
- package/dist/{browser-6Cg7G6bb.mjs → browser-BGxDRhHy.mjs} +1 -1
- package/dist/{browser-D3uBFRQu.cjs → browser-CLJWcodR.cjs} +1 -1
- package/dist/{claudeLocal-BBaE4QF_.cjs → claudeLocal-B6YDYlnY.cjs} +4 -4
- package/dist/{claudeLocal-CqaEs-81.mjs → claudeLocal-Ux31hZyC.mjs} +5 -5
- package/dist/{claudeLocalLauncher-BDUPxtsI.mjs → claudeLocalLauncher-D06QijMw.mjs} +10 -10
- package/dist/{claudeLocalLauncher-wPxKtH_P.cjs → claudeLocalLauncher-DFvmF8rC.cjs} +9 -9
- package/dist/{claudeSessionFork-DzWFzj9m.mjs → claudeSessionFork-D2GI7P59.mjs} +1 -1
- package/dist/{claudeSessionFork-CmY25Fl3.cjs → claudeSessionFork-DTLZ2rek.cjs} +1 -1
- package/dist/{client-DmY03OZZ.cjs → client-Bffkrs5p.cjs} +2 -2
- package/dist/{client-C2HcMqRF.cjs → client-CARZ_lNS.cjs} +3 -3
- package/dist/{client-agH03Irm.cjs → client-CMKGrnmT.cjs} +2 -2
- package/dist/{client-DWws_aQK.mjs → client-CnGNYidN.mjs} +2 -2
- package/dist/{client-qJ0y8fus.mjs → client-CtL0Vtww.mjs} +4 -4
- package/dist/{client-DcDE6Ifk.mjs → client-DZkBUoh9.mjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +16 -15
- package/dist/codex/happyMcpStdioBridge.mjs +17 -16
- package/dist/{codexAppServerClient-DgE99i7X.mjs → codexAppServerClient-CLc5nhLT.mjs} +37 -6
- package/dist/{codexAppServerClient-DwzC8LR0.cjs → codexAppServerClient-CpT9F6EM.cjs} +37 -6
- package/dist/{codexCommand-1vFEA1KT.cjs → codexCommand-39kH99SJ.cjs} +148 -61
- package/dist/{codexCommand-DUSVzbKh.mjs → codexCommand-Dliq3EBv.mjs} +143 -56
- package/dist/{codexTermination-DuDPyBRR.cjs → codexTermination-ByW7tRjr.cjs} +1 -1
- package/dist/{codexTermination-Bybovr2z.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-C4xOL5bH.cjs → config-CeIzCsfj.cjs} +3 -3
- package/dist/{config-BrzZ0O-6.mjs → config-CxSsGO1Z.mjs} +3 -3
- package/dist/{configuration-BZHpFD7K.mjs → configuration-Dechcvd-.mjs} +1 -1
- package/dist/{configuration-DyPW9mVa.cjs → configuration-Dt5lKW3P.cjs} +1 -1
- package/dist/{connect-DurKwMEo.cjs → connect-NPDzIVC6.cjs} +12 -12
- package/dist/{connect-Cw_INlj8.mjs → connect-UwQHvCpR.mjs} +13 -13
- package/dist/{context-2xDvjkQp.cjs → context-BdZssgF0.cjs} +1 -1
- package/dist/{context-t7YV0aZc.mjs → context-C9JbJoNe.mjs} +1 -1
- package/dist/{controlClient-DvFaPsg6.cjs → controlClient-BRk65BRO.cjs} +3 -3
- package/dist/{controlClient-Bw56NIrj.mjs → controlClient-D7NGfmtq.mjs} +3 -3
- package/dist/{createSessionMetadata-Dpg6bV6f.cjs → createSessionMetadata-B_HZCDj_.cjs} +2 -2
- package/dist/{createSessionMetadata-Dn5BkLfU.mjs → createSessionMetadata-DyhFKAby.mjs} +2 -2
- package/dist/defaultPermissionMode-BnxJPVHT.mjs +4 -0
- package/dist/defaultPermissionMode-CxmTXUQR.cjs +7 -0
- package/dist/{deterministicJson-D0BrV1FD.cjs → deterministicJson-BEygolBQ.cjs} +12 -12
- package/dist/{deterministicJson-CsRckxVq.mjs → deterministicJson-DNmMVhFu.mjs} +13 -13
- package/dist/{doctor-CYe4d9kU.cjs → doctor-B9lW1WlG.cjs} +7 -7
- package/dist/{doctor-B4HQiW6j.mjs → doctor-BdBi7TFZ.mjs} +7 -7
- package/dist/{downloadTarget-tYMV_VHo.mjs → downloadTarget-CGojGjaN.mjs} +6 -6
- package/dist/{downloadTarget-CuhBVvuC.cjs → downloadTarget-DS0zT2AU.cjs} +6 -6
- package/dist/{ensureDaemonRunning-DVtIG9z7.mjs → ensureDaemonRunning-BOdbryDM.mjs} +5 -5
- package/dist/{ensureDaemonRunning-Ce3BlWiR.cjs → ensureDaemonRunning-Bibp6vhe.cjs} +5 -5
- package/dist/exitAfterFlush-AbKNZM0N.mjs +23 -0
- package/dist/exitAfterFlush-DIT_sIxR.cjs +25 -0
- package/dist/{handleResumeCommand-BU1uMNyv.mjs → handleResumeCommand-CgLzBYne.mjs} +5 -5
- package/dist/{handleResumeCommand-CLxsmAW0.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-KwuXqLwe.cjs → index-Bs5FD8JF.cjs} +4 -4
- package/dist/{index-ChX0eVXw.mjs → index-CBHfkQNY.mjs} +142 -60
- package/dist/{index-DoXbGEAi.cjs → index-CwRW11hT.cjs} +3 -3
- package/dist/{index-CVHRt3SS.mjs → index-DUByZsKe.mjs} +4 -4
- package/dist/{index-wWJJAQRk.cjs → index-DXSIi6j_.cjs} +4 -4
- package/dist/{index-DDz0Ftoy.mjs → index-Db0HIC-k.mjs} +4 -4
- package/dist/{index-WKyN-bNy.mjs → index-DmqsRnV7.mjs} +1 -1
- package/dist/{index-DG1kGjkF.cjs → index-f8oDidjV.cjs} +142 -60
- package/dist/{index-B1OxWiNG.mjs → index-rNTX33in.mjs} +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-cAYvHxXR.cjs → install-CXIL_FYx.cjs} +3 -3
- package/dist/{install-CMa_FOWu.mjs → install-DfPrEWGG.mjs} +3 -3
- package/dist/lib.cjs +11 -11
- package/dist/lib.d.cts +61 -1
- package/dist/lib.d.mts +61 -1
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-D-lsD1FS.mjs → lidState-D0DF20oG.mjs} +1 -1
- package/dist/{lidState-d1vgQ3n7.cjs → lidState-q_XFYg33.cjs} +1 -1
- package/dist/{localHappyAgentAuth-wvDp-nGj.mjs → localHappyAgentAuth-BBhM4Qk1.mjs} +1 -1
- package/dist/{localHappyAgentAuth-DucSnCg3.cjs → localHappyAgentAuth-CKNW-MXw.cjs} +1 -1
- package/dist/{logger-C3vZG6Q0.cjs → logger-BBRTTVsQ.cjs} +2 -2
- package/dist/{logger-RpzJ4d8V.mjs → logger-CL7pin9b.mjs} +2 -2
- package/dist/{machineMetadata-CiQ2_1Mq.mjs → machineMetadata-DP06qdBk.mjs} +3 -3
- package/dist/{machineMetadata-CAvFq1Jg.cjs → machineMetadata-DnFNlrVK.cjs} +3 -3
- package/dist/{main-ChpYcFZi.cjs → main-DLOXykOR.cjs} +49 -48
- package/dist/{main-IPhaImjm.mjs → main-DO7nRvhf.mjs} +49 -48
- package/dist/{mcp-CWnMvju6.mjs → mcp-C-4sPTae.mjs} +16 -15
- package/dist/{mcp-2xF232hL.cjs → mcp-Du0MgR7e.cjs} +15 -14
- package/dist/{mirrorProtocol-CVzPObON.cjs → mirrorProtocol-GuWMxLkh.cjs} +2 -2
- package/dist/{mirrorProtocol-Dr7fNq8V.mjs → mirrorProtocol-dkq2ZENA.mjs} +3 -3
- package/dist/{package-CwB8rFJt.mjs → package-C6uiXULx.mjs} +7 -7
- package/dist/{package-Gnf_935w.cjs → package-DrY090nZ.cjs} +7 -7
- package/dist/{panels-DTlTsndU.cjs → panels-4DRBKHZP.cjs} +5 -5
- package/dist/{panels-L1mSkC-y.mjs → panels-DXYdJA6n.mjs} +5 -5
- package/dist/{peerTools-C1E5cQ86.cjs → peerTools-5ZM4spcZ.cjs} +5 -5
- package/dist/{peerTools-2_8Bw9PU.mjs → peerTools-dY1aJez4.mjs} +5 -5
- package/dist/{persistence-CqtjFiD1.cjs → persistence-Bl5S3TLB.cjs} +6 -2
- package/dist/{persistence-Bn4qEbDg.mjs → persistence-Dogj7JIp.mjs} +6 -3
- package/dist/{piRunnerArgs-BI8yQRBZ.cjs → piRunnerArgs-C3jZ1M6b.cjs} +1 -1
- package/dist/{piRunnerArgs-DWBb63W9.mjs → piRunnerArgs-D8nN_Iit.mjs} +1 -1
- package/dist/{piRuntime--mQ43MSM.cjs → piRuntime-Bd9-eq6M.cjs} +1 -1
- package/dist/{piRuntime-Do8oqbm3.mjs → piRuntime-BoeMsAXK.mjs} +1 -1
- package/dist/{piTerminal-BzcvLFsP.cjs → piTerminal-C3j1ca3x.cjs} +17 -16
- package/dist/{piTerminal-GC1KHTYQ.mjs → piTerminal-GEPkIGD4.mjs} +18 -17
- package/dist/{pushNotifications-Bb-QSqXw.cjs → pushNotifications-CfspRcl-.cjs} +20 -2
- package/dist/{pushNotifications-BThg4nVd.mjs → pushNotifications-dUceOIni.mjs} +21 -3
- package/dist/{query-Bz3pocKH.cjs → query-DjsVgG3E.cjs} +1 -1
- package/dist/{query-CkgIJ_Dy.mjs → query-iYH-tm7L.mjs} +1 -1
- package/dist/{rateLimitReporter-BkHyvLru.cjs → rateLimitReporter-DUu2KydZ.cjs} +3 -3
- package/dist/{rateLimitReporter-Iw4k3Bbr.mjs → rateLimitReporter-jeVi-fym.mjs} +3 -3
- package/dist/{rateLimitWindows-Bm_dcQGW.cjs → rateLimitWindows-Bx3ROBP5.cjs} +1 -1
- package/dist/{rateLimitWindows-CQ4tIQnx.mjs → rateLimitWindows-CEn0DXaX.mjs} +1 -1
- package/dist/{registerCommonHandlers-CIs6H2DV.cjs → registerCommonHandlers-Beun-cQv.cjs} +2 -2
- package/dist/{registerCommonHandlers-CaWl9ll1.mjs → registerCommonHandlers-DWZ7mfdt.mjs} +2 -2
- package/dist/{specialCommands-BsvSoDhC.cjs → registerKillSessionHandler-CA1FFr_F.cjs} +15 -62
- package/dist/{specialCommands-DHU7TNeK.mjs → registerKillSessionHandler-CzgklwLG.mjs} +17 -60
- package/dist/{remoteSessionClient-uPj7omsw.mjs → remoteSessionClient-BiC2KDew.mjs} +5 -5
- package/dist/{remoteSessionClient-DgUMfPW4.cjs → remoteSessionClient-DGFI__5Z.cjs} +5 -5
- package/dist/{reportProgressTool-DUEq3xAL.mjs → reportProgressTool-CgPy6n_7.mjs} +3 -3
- package/dist/{reportProgressTool-CaJ8EwLq.cjs → reportProgressTool-CvPGov1F.cjs} +2 -2
- package/dist/{run-DTUJBD6p.mjs → run-B_gFgJVB.mjs} +393 -42
- package/dist/{run-DyyGMqND.cjs → run-rPqQwDi_.cjs} +391 -40
- package/dist/{runClaude-DTNvIz2J.mjs → runClaude-CykqeXK7.mjs} +26 -23
- package/dist/{runClaude-8JDaPoGQ.cjs → runClaude-DM8gm8iu.cjs} +27 -24
- package/dist/{runClaudeDeps-CgGkgg7e.mjs → runClaudeDeps-D2phXGut.mjs} +106 -46
- package/dist/{runClaudeDeps-BeLo5zss.cjs → runClaudeDeps-DGAomimZ.cjs} +101 -40
- package/dist/{runGemini-BSOdU563.cjs → runGemini-CXTeSOZp.cjs} +50 -49
- package/dist/{runGemini-eU8UOzfc.mjs → runGemini-CtWCVkj5.mjs} +49 -48
- package/dist/{runOpenClaw-D8RZiA1e.mjs → runOpenClaw-BBdjlViJ.mjs} +25 -24
- package/dist/{runOpenClaw-CYyFoGRZ.cjs → runOpenClaw-CH_9_RyZ.cjs} +26 -25
- package/dist/{sandbox-C8zfNX-4.cjs → sandbox-Bb5IMun3.cjs} +4 -4
- package/dist/{sandbox-DlPahdhl.mjs → sandbox-DGmXZ6Zz.mjs} +4 -4
- package/dist/selfCheck-BfK945YQ.mjs +86 -0
- package/dist/{selfCheck-D28nvuPJ.cjs → selfCheck-CccwNTTK.cjs} +37 -37
- package/dist/{send-DBpv-1eh.mjs → send-B6rHg8GT.mjs} +9 -8
- package/dist/{send-C58kX4qz.cjs → send-BpiXPkDo.cjs} +9 -8
- package/dist/{server-J5K6pOox.mjs → server-BkdAyHhC.mjs} +4 -4
- package/dist/{server-I_CETZzn.cjs → server-DHUzjApC.cjs} +6 -6
- package/dist/{sessionLock-DjE7O0LS.cjs → sessionLock-BFBReiKq.cjs} +134 -3
- package/dist/{sessionLock-C7Wg1RVd.mjs → sessionLock-Ca_bIo50.mjs} +121 -4
- package/dist/{sessionOps-CYjMT7Ad.mjs → sessionOps-CA2kpm66.mjs} +36 -5
- package/dist/{sessionOps-DGMpl9NB.cjs → sessionOps-DeWVqpe4.cjs} +36 -4
- package/dist/{sessionProvider-DVtxrOuM.cjs → sessionProvider-VFbtUmMR.cjs} +5 -5
- package/dist/{sessionProvider-TLiFn9kD.mjs → sessionProvider-g18IiK74.mjs} +5 -5
- package/dist/{sessionScanner-BZ1ZSn6I.cjs → sessionScanner-CGzsN8V6.cjs} +3 -3
- package/dist/{sessionScanner-CknV1IlN.mjs → sessionScanner-DDDud5re.mjs} +3 -3
- package/dist/{sessions-DU4bxkap.mjs → sessions-B4d50sCI.mjs} +36 -26
- package/dist/{sessions-CTkBKs5U.cjs → sessions-CKJPWFgu.cjs} +37 -25
- package/dist/{setupOfflineReconnection-DaOXnGuH.mjs → setupOfflineReconnection-CyPNgyCe.mjs} +2 -2
- package/dist/{setupOfflineReconnection-CQHNuP_0.cjs → setupOfflineReconnection-DPXRo_zf.cjs} +2 -2
- package/dist/{spawn-C0wZc03S.cjs → spawn-CgSJzzWS.cjs} +17 -16
- package/dist/{spawn-DdnYTtQe.mjs → spawn-CrYN_OOT.mjs} +18 -17
- package/dist/{spawnAgents-BjyU78Ue.cjs → spawnAgents-C1-4m7aN.cjs} +3 -1
- package/dist/{spawnAgents-D-7wMw-a.mjs → spawnAgents-DWCDYCQ1.mjs} +4 -2
- package/dist/{spawnHappyCLI-BJUd974I.cjs → spawnHappyCLI-CTy3p6V_.cjs} +1 -1
- package/dist/{spawnHappyCLI-CnyyJk74.mjs → spawnHappyCLI-DjbkiSH1.mjs} +1 -1
- package/dist/specialCommands-J3JFOq0J.cjs +60 -0
- package/dist/specialCommands-MXUN0wfI.mjs +54 -0
- package/dist/{startFileWatcher-DBboREco.cjs → startFileWatcher-BQs0cJA-.cjs} +1 -1
- package/dist/{startFileWatcher-CpO5Mwbr.mjs → startFileWatcher-Dedtu1vq.mjs} +1 -1
- package/dist/{defaultPermissionMode-DMTnlccv.mjs → startupSessionCreate-BKFU4v_h.mjs} +25 -6
- package/dist/{defaultPermissionMode-Dlm0q1m0.cjs → startupSessionCreate-Dxy3X4DG.cjs} +25 -7
- package/dist/{streamRelay-CqBynIon.mjs → streamRelay-P9e7Sohm.mjs} +1 -1
- package/dist/{sync-6HFRJP1h.cjs → sync-DtWB7RzA.cjs} +1 -1
- package/dist/{sync-I8NYmycF.mjs → sync-eZkXnsW_.mjs} +1 -1
- package/dist/{systemPrompt-BDWj5QSL.cjs → systemPrompt-2XOpZ1j6.cjs} +1 -1
- package/dist/{systemPrompt-C1RSY_60.mjs → systemPrompt-Bn6g6aCH.mjs} +2 -2
- package/dist/{teams-eUD7ymif.cjs → teams-ecFay4Gn.cjs} +6 -6
- package/dist/{teams-GpLFbXXE.mjs → teams-nadkqrbW.mjs} +7 -7
- package/dist/{template-CEK8MEjo.mjs → template-BiTD-jI9.mjs} +1 -1
- package/dist/{time-umG7yHkb.mjs → time-CN3TuSVG.mjs} +1 -1
- package/dist/{time-BAJRbB6U.cjs → time-gPD_EmA-.cjs} +1 -1
- package/dist/{titleGenerator-dmFlxkRs.mjs → titleGenerator-DgzTQdn2.mjs} +1 -1
- package/dist/{titleGenerator-iqb2jOF1.cjs → titleGenerator-lT5ldPuN.cjs} +2 -2
- package/dist/{todo-DsR7WnQS.cjs → todo-B1VeMk5A.cjs} +5 -5
- package/dist/{todo-CT4AJ3sH.mjs → todo-BIxd7l2Q.mjs} +6 -6
- package/dist/{tools-30E66QL_.cjs → tools-DvqbLsCF.cjs} +1 -1
- package/dist/{tools-BOWazSD6.mjs → tools-zXJpxiG_.mjs} +1 -1
- package/dist/{uninstall-DImXs6VZ.mjs → uninstall-9htK6mb7.mjs} +3 -3
- package/dist/{uninstall-BtTc9hHa.cjs → uninstall-CvIOpwB5.cjs} +3 -3
- package/package.json +7 -7
- package/dist/agentAttachments-M_B5qEF2.mjs +0 -18
- package/dist/selfCheck-4bcdHPFQ.mjs +0 -86
- package/dist/startupSessionCreate-BgaVuvQp.mjs +0 -24
- package/dist/startupSessionCreate-C1u2dtz8.cjs +0 -26
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var persistence = require('./persistence-
|
|
3
|
+
var persistence = require('./persistence-Bl5S3TLB.cjs');
|
|
4
|
+
var cliUpdate = require('./cliUpdate-DsKXPFYp.cjs');
|
|
4
5
|
var node_fs = require('node:fs');
|
|
5
6
|
var path = require('node:path');
|
|
6
|
-
var configuration = require('./configuration-
|
|
7
|
-
var logger = require('./logger-
|
|
7
|
+
var configuration = require('./configuration-Dt5lKW3P.cjs');
|
|
8
|
+
var logger = require('./logger-BBRTTVsQ.cjs');
|
|
8
9
|
var processTreeSnapshot = require('./processTreeSnapshot-mDbnuojn.cjs');
|
|
9
10
|
|
|
10
11
|
const PROCESS_IDENTITY_FIELDS = [
|
|
@@ -83,6 +84,122 @@ function applyReconnectReplay(response) {
|
|
|
83
84
|
return { response: { ...response, seq: cursor.seq }, replay: { source: "offline-exit", seq: cursor.seq } };
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
const AUTO_RESTART_CAPABILITY = "auto-restart-v1";
|
|
88
|
+
const AUTO_RESTART_QUIET_MS = 10 * 60 * 1e3;
|
|
89
|
+
const AUTO_RESTART_RECHECK_CAP_MS = 10 * 60 * 1e3;
|
|
90
|
+
function resolveQuietMs(env = process.env) {
|
|
91
|
+
const raw = env.HAPPY_AUTO_RESTART_QUIET_MS;
|
|
92
|
+
if (raw !== void 0 && raw.trim() !== "") {
|
|
93
|
+
const value = Number(raw);
|
|
94
|
+
if (Number.isFinite(value) && value >= 0) return Math.round(value);
|
|
95
|
+
}
|
|
96
|
+
return AUTO_RESTART_QUIET_MS;
|
|
97
|
+
}
|
|
98
|
+
const AUTO_RESTART_MAX_CONCURRENT = 1;
|
|
99
|
+
const AUTO_RESTART_MIN_GAP_MS = 15e3;
|
|
100
|
+
const AUTO_RESTART_MAX_ATTEMPTS = 2;
|
|
101
|
+
const AUTO_RESTART_BACKOFF_MS = 10 * 60 * 1e3;
|
|
102
|
+
const AUTO_RESTART_MIN_CHECK_MS = 15e3;
|
|
103
|
+
const AUTO_RESTART_FLAVORS = ["claude", "codex", "acp"];
|
|
104
|
+
function wrapperStaleness(input) {
|
|
105
|
+
const wrapper = input.wrapperVersion?.trim();
|
|
106
|
+
if (wrapper) {
|
|
107
|
+
const cmp = cliUpdate.compareExactVersions(wrapper, input.daemonVersion);
|
|
108
|
+
if (cmp !== null && cmp < 0) return { kind: "cli", from: wrapper, target: input.daemonVersion };
|
|
109
|
+
}
|
|
110
|
+
const running = input.agentVersion?.trim();
|
|
111
|
+
const installed = input.installedAgentVersion?.trim();
|
|
112
|
+
if (running && installed) {
|
|
113
|
+
const cmp = cliUpdate.compareExactVersions(running, installed);
|
|
114
|
+
if (cmp !== null && cmp < 0) return { kind: "agent", from: running, target: installed };
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
function decideAutoRestart(input) {
|
|
119
|
+
const { report } = input;
|
|
120
|
+
if (!input.enabled) return { ok: false, reason: "disabled" };
|
|
121
|
+
if (!input.staleness) return { ok: false, reason: "not-stale" };
|
|
122
|
+
if (!input.trackedLive) return { ok: false, reason: "not-tracked" };
|
|
123
|
+
if (report.exiting) return { ok: false, reason: "exiting" };
|
|
124
|
+
if (!report.uiSession) return { ok: false, reason: "local-terminal" };
|
|
125
|
+
if (report.variant) return { ok: false, reason: "assistant" };
|
|
126
|
+
if (!AUTO_RESTART_FLAVORS.includes(report.flavor)) return { ok: false, reason: "unsupported-flavor" };
|
|
127
|
+
if (!input.resumable) return { ok: false, reason: "not-resumable" };
|
|
128
|
+
if (report.thinking || input.turnActive) return { ok: false, reason: "turn-active" };
|
|
129
|
+
if (report.pendingRequests > 0) return { ok: false, reason: "pending-request" };
|
|
130
|
+
if (report.queuedInputs > 0 || !report.waitingForInput) return { ok: false, reason: "queued-input" };
|
|
131
|
+
if (report.backgroundTasks > 0 || input.backgroundTasks > 0) return { ok: false, reason: "background-tasks" };
|
|
132
|
+
if ((report.scheduledWakeups ?? 0) > 0) return { ok: false, reason: "scheduled-wakeup" };
|
|
133
|
+
if (!(input.now - report.lastActivityAt >= (input.quietMs ?? AUTO_RESTART_QUIET_MS))) return { ok: false, reason: "recent-activity" };
|
|
134
|
+
if (input.automationRunning) return { ok: false, reason: "automation-running" };
|
|
135
|
+
const attempt = input.attempt && input.attempt.target === input.staleness.target ? input.attempt : null;
|
|
136
|
+
if (attempt && attempt.attempts >= AUTO_RESTART_MAX_ATTEMPTS) return { ok: false, reason: "gave-up" };
|
|
137
|
+
if (attempt && input.now < attempt.notBefore) return { ok: false, reason: "backoff" };
|
|
138
|
+
if (input.inFlight >= AUTO_RESTART_MAX_CONCURRENT) return { ok: false, reason: "machine-busy" };
|
|
139
|
+
if (input.lastStartedAt !== null && input.now - input.lastStartedAt < AUTO_RESTART_MIN_GAP_MS) return { ok: false, reason: "machine-busy" };
|
|
140
|
+
return { ok: true };
|
|
141
|
+
}
|
|
142
|
+
function autoRestartNextCheck(verdict, input, jitter = 0) {
|
|
143
|
+
if (verdict.ok) return null;
|
|
144
|
+
switch (verdict.reason) {
|
|
145
|
+
case "recent-activity":
|
|
146
|
+
return Math.max(AUTO_RESTART_MIN_CHECK_MS, input.report.lastActivityAt + (input.quietMs ?? AUTO_RESTART_QUIET_MS) - input.now);
|
|
147
|
+
case "machine-busy":
|
|
148
|
+
return AUTO_RESTART_MIN_GAP_MS + Math.round(Math.min(Math.max(jitter, 0), 0.999) * 2 * AUTO_RESTART_MIN_GAP_MS);
|
|
149
|
+
case "backoff":
|
|
150
|
+
return Math.max(AUTO_RESTART_MIN_CHECK_MS, (input.attempt?.notBefore ?? input.now) - input.now);
|
|
151
|
+
default:
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function recordAttempt(previous, target, ok, now, error) {
|
|
156
|
+
if (ok) return null;
|
|
157
|
+
const attempts = (previous && previous.target === target ? previous.attempts : 0) + 1;
|
|
158
|
+
return { target, attempts, notBefore: now + AUTO_RESTART_BACKOFF_MS * attempts, ...error ? { lastError: error } : {} };
|
|
159
|
+
}
|
|
160
|
+
const MANUAL_REASONS = /* @__PURE__ */ new Set(["local-terminal", "assistant", "unsupported-flavor", "not-resumable"]);
|
|
161
|
+
function statusFromVerdict(verdict, previous, staleness, now, attempt) {
|
|
162
|
+
if (verdict.ok) return null;
|
|
163
|
+
if (verdict.reason === "disabled" || verdict.reason === "not-stale" || verdict.reason === "not-tracked") return null;
|
|
164
|
+
const since = previous && previous.target === staleness.target ? previous.since : now;
|
|
165
|
+
if (verdict.reason === "gave-up") {
|
|
166
|
+
return { state: "failed", reason: attempt?.lastError ?? "gave-up", since, target: staleness.target };
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
state: MANUAL_REASONS.has(verdict.reason) ? "manual" : "waiting",
|
|
170
|
+
reason: verdict.reason,
|
|
171
|
+
since,
|
|
172
|
+
target: staleness.target
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function wrapperReportsIdle(input) {
|
|
176
|
+
const caps = input.capabilities ?? [];
|
|
177
|
+
if (input.variant) return false;
|
|
178
|
+
if (caps.includes(AUTO_RESTART_CAPABILITY)) return true;
|
|
179
|
+
if (!caps.includes("agent-hibernation-v1")) return false;
|
|
180
|
+
if (input.flavor !== "claude" && input.flavor !== "codex") return false;
|
|
181
|
+
if (input.spawnedBy && input.spawnedBy.trim()) return false;
|
|
182
|
+
return !(input.tags ?? []).some((tag) => tag === "teams" || tag === "automation" || tag === "assistant");
|
|
183
|
+
}
|
|
184
|
+
const AUTO_UPDATED_EVENT_KIND = "session-auto-updated";
|
|
185
|
+
const AUTO_RESTARTED_ENV = "HAPPY_AUTO_RESTARTED";
|
|
186
|
+
function encodeAutoRestarted(kind, target) {
|
|
187
|
+
return `${kind}:${target}`;
|
|
188
|
+
}
|
|
189
|
+
function decodeAutoRestarted(raw) {
|
|
190
|
+
const match = /^(cli|agent):(\S{1,64})$/.exec(raw?.trim() ?? "");
|
|
191
|
+
return match ? { kind: match[1], target: match[2] } : null;
|
|
192
|
+
}
|
|
193
|
+
function autoUpdatedEventText(kind, version, agentName = "Codex") {
|
|
194
|
+
return kind === "agent" ? `Updated ${agentName} to ${version} (session restarted in place, history kept)` : `Updated to Very Happy ${version} (session restarted in place, history kept)`;
|
|
195
|
+
}
|
|
196
|
+
function takeAutoRestartedEvent(env, agentName) {
|
|
197
|
+
const decoded = decodeAutoRestarted(env[AUTO_RESTARTED_ENV]);
|
|
198
|
+
delete env[AUTO_RESTARTED_ENV];
|
|
199
|
+
if (!decoded) return null;
|
|
200
|
+
return { type: "message", kind: AUTO_UPDATED_EVENT_KIND, message: autoUpdatedEventText(decoded.kind, decoded.target, agentName) };
|
|
201
|
+
}
|
|
202
|
+
|
|
86
203
|
const runtime = {
|
|
87
204
|
signal: (pid, signal) => process.kill(pid, signal),
|
|
88
205
|
isAlive: (pid) => {
|
|
@@ -235,13 +352,27 @@ async function claimSessionOrExit(happySessionId, options) {
|
|
|
235
352
|
process.on("exit", () => releaseSessionLock(happySessionId));
|
|
236
353
|
}
|
|
237
354
|
|
|
355
|
+
exports.AUTO_RESTARTED_ENV = AUTO_RESTARTED_ENV;
|
|
356
|
+
exports.AUTO_RESTART_CAPABILITY = AUTO_RESTART_CAPABILITY;
|
|
357
|
+
exports.AUTO_RESTART_MAX_ATTEMPTS = AUTO_RESTART_MAX_ATTEMPTS;
|
|
358
|
+
exports.AUTO_RESTART_MIN_GAP_MS = AUTO_RESTART_MIN_GAP_MS;
|
|
359
|
+
exports.AUTO_RESTART_RECHECK_CAP_MS = AUTO_RESTART_RECHECK_CAP_MS;
|
|
238
360
|
exports.applyReconnectReplay = applyReconnectReplay;
|
|
239
361
|
exports.applyServerSnapshot = applyServerSnapshot;
|
|
362
|
+
exports.autoRestartNextCheck = autoRestartNextCheck;
|
|
240
363
|
exports.claimSessionOrExit = claimSessionOrExit;
|
|
364
|
+
exports.decideAutoRestart = decideAutoRestart;
|
|
365
|
+
exports.encodeAutoRestarted = encodeAutoRestarted;
|
|
241
366
|
exports.exitCursorStamp = exitCursorStamp;
|
|
242
367
|
exports.mergeReconnectMetadata = mergeReconnectMetadata;
|
|
243
368
|
exports.processIdentityFields = processIdentityFields;
|
|
244
369
|
exports.readSessionLock = readSessionLock;
|
|
370
|
+
exports.recordAttempt = recordAttempt;
|
|
371
|
+
exports.resolveQuietMs = resolveQuietMs;
|
|
372
|
+
exports.statusFromVerdict = statusFromVerdict;
|
|
373
|
+
exports.takeAutoRestartedEvent = takeAutoRestartedEvent;
|
|
245
374
|
exports.terminateProcess = terminateProcess;
|
|
246
375
|
exports.terminateProcessTree = terminateProcessTree;
|
|
247
376
|
exports.withoutServerSnapshot = withoutServerSnapshot;
|
|
377
|
+
exports.wrapperReportsIdle = wrapperReportsIdle;
|
|
378
|
+
exports.wrapperStaleness = wrapperStaleness;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as hibernationReplaySeq } from './persistence-Dogj7JIp.mjs';
|
|
2
|
+
import { c as compareExactVersions } from './cliUpdate-Y34VGe9Y.mjs';
|
|
2
3
|
import { existsSync, readFileSync, unlinkSync, mkdirSync, renameSync } from 'node:fs';
|
|
3
4
|
import { join } from 'node:path';
|
|
4
|
-
import { c as configuration, w as writePrivateFileSync } from './configuration-
|
|
5
|
-
import { l as logger } from './logger-
|
|
5
|
+
import { c as configuration, w as writePrivateFileSync } from './configuration-Dechcvd-.mjs';
|
|
6
|
+
import { l as logger } from './logger-CL7pin9b.mjs';
|
|
6
7
|
import { s as snapshotTree, k as killSurvivors } from './processTreeSnapshot-CuLJDNC-.mjs';
|
|
7
8
|
|
|
8
9
|
const PROCESS_IDENTITY_FIELDS = [
|
|
@@ -81,6 +82,122 @@ function applyReconnectReplay(response) {
|
|
|
81
82
|
return { response: { ...response, seq: cursor.seq }, replay: { source: "offline-exit", seq: cursor.seq } };
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
const AUTO_RESTART_CAPABILITY = "auto-restart-v1";
|
|
86
|
+
const AUTO_RESTART_QUIET_MS = 10 * 60 * 1e3;
|
|
87
|
+
const AUTO_RESTART_RECHECK_CAP_MS = 10 * 60 * 1e3;
|
|
88
|
+
function resolveQuietMs(env = process.env) {
|
|
89
|
+
const raw = env.HAPPY_AUTO_RESTART_QUIET_MS;
|
|
90
|
+
if (raw !== void 0 && raw.trim() !== "") {
|
|
91
|
+
const value = Number(raw);
|
|
92
|
+
if (Number.isFinite(value) && value >= 0) return Math.round(value);
|
|
93
|
+
}
|
|
94
|
+
return AUTO_RESTART_QUIET_MS;
|
|
95
|
+
}
|
|
96
|
+
const AUTO_RESTART_MAX_CONCURRENT = 1;
|
|
97
|
+
const AUTO_RESTART_MIN_GAP_MS = 15e3;
|
|
98
|
+
const AUTO_RESTART_MAX_ATTEMPTS = 2;
|
|
99
|
+
const AUTO_RESTART_BACKOFF_MS = 10 * 60 * 1e3;
|
|
100
|
+
const AUTO_RESTART_MIN_CHECK_MS = 15e3;
|
|
101
|
+
const AUTO_RESTART_FLAVORS = ["claude", "codex", "acp"];
|
|
102
|
+
function wrapperStaleness(input) {
|
|
103
|
+
const wrapper = input.wrapperVersion?.trim();
|
|
104
|
+
if (wrapper) {
|
|
105
|
+
const cmp = compareExactVersions(wrapper, input.daemonVersion);
|
|
106
|
+
if (cmp !== null && cmp < 0) return { kind: "cli", from: wrapper, target: input.daemonVersion };
|
|
107
|
+
}
|
|
108
|
+
const running = input.agentVersion?.trim();
|
|
109
|
+
const installed = input.installedAgentVersion?.trim();
|
|
110
|
+
if (running && installed) {
|
|
111
|
+
const cmp = compareExactVersions(running, installed);
|
|
112
|
+
if (cmp !== null && cmp < 0) return { kind: "agent", from: running, target: installed };
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
function decideAutoRestart(input) {
|
|
117
|
+
const { report } = input;
|
|
118
|
+
if (!input.enabled) return { ok: false, reason: "disabled" };
|
|
119
|
+
if (!input.staleness) return { ok: false, reason: "not-stale" };
|
|
120
|
+
if (!input.trackedLive) return { ok: false, reason: "not-tracked" };
|
|
121
|
+
if (report.exiting) return { ok: false, reason: "exiting" };
|
|
122
|
+
if (!report.uiSession) return { ok: false, reason: "local-terminal" };
|
|
123
|
+
if (report.variant) return { ok: false, reason: "assistant" };
|
|
124
|
+
if (!AUTO_RESTART_FLAVORS.includes(report.flavor)) return { ok: false, reason: "unsupported-flavor" };
|
|
125
|
+
if (!input.resumable) return { ok: false, reason: "not-resumable" };
|
|
126
|
+
if (report.thinking || input.turnActive) return { ok: false, reason: "turn-active" };
|
|
127
|
+
if (report.pendingRequests > 0) return { ok: false, reason: "pending-request" };
|
|
128
|
+
if (report.queuedInputs > 0 || !report.waitingForInput) return { ok: false, reason: "queued-input" };
|
|
129
|
+
if (report.backgroundTasks > 0 || input.backgroundTasks > 0) return { ok: false, reason: "background-tasks" };
|
|
130
|
+
if ((report.scheduledWakeups ?? 0) > 0) return { ok: false, reason: "scheduled-wakeup" };
|
|
131
|
+
if (!(input.now - report.lastActivityAt >= (input.quietMs ?? AUTO_RESTART_QUIET_MS))) return { ok: false, reason: "recent-activity" };
|
|
132
|
+
if (input.automationRunning) return { ok: false, reason: "automation-running" };
|
|
133
|
+
const attempt = input.attempt && input.attempt.target === input.staleness.target ? input.attempt : null;
|
|
134
|
+
if (attempt && attempt.attempts >= AUTO_RESTART_MAX_ATTEMPTS) return { ok: false, reason: "gave-up" };
|
|
135
|
+
if (attempt && input.now < attempt.notBefore) return { ok: false, reason: "backoff" };
|
|
136
|
+
if (input.inFlight >= AUTO_RESTART_MAX_CONCURRENT) return { ok: false, reason: "machine-busy" };
|
|
137
|
+
if (input.lastStartedAt !== null && input.now - input.lastStartedAt < AUTO_RESTART_MIN_GAP_MS) return { ok: false, reason: "machine-busy" };
|
|
138
|
+
return { ok: true };
|
|
139
|
+
}
|
|
140
|
+
function autoRestartNextCheck(verdict, input, jitter = 0) {
|
|
141
|
+
if (verdict.ok) return null;
|
|
142
|
+
switch (verdict.reason) {
|
|
143
|
+
case "recent-activity":
|
|
144
|
+
return Math.max(AUTO_RESTART_MIN_CHECK_MS, input.report.lastActivityAt + (input.quietMs ?? AUTO_RESTART_QUIET_MS) - input.now);
|
|
145
|
+
case "machine-busy":
|
|
146
|
+
return AUTO_RESTART_MIN_GAP_MS + Math.round(Math.min(Math.max(jitter, 0), 0.999) * 2 * AUTO_RESTART_MIN_GAP_MS);
|
|
147
|
+
case "backoff":
|
|
148
|
+
return Math.max(AUTO_RESTART_MIN_CHECK_MS, (input.attempt?.notBefore ?? input.now) - input.now);
|
|
149
|
+
default:
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function recordAttempt(previous, target, ok, now, error) {
|
|
154
|
+
if (ok) return null;
|
|
155
|
+
const attempts = (previous && previous.target === target ? previous.attempts : 0) + 1;
|
|
156
|
+
return { target, attempts, notBefore: now + AUTO_RESTART_BACKOFF_MS * attempts, ...error ? { lastError: error } : {} };
|
|
157
|
+
}
|
|
158
|
+
const MANUAL_REASONS = /* @__PURE__ */ new Set(["local-terminal", "assistant", "unsupported-flavor", "not-resumable"]);
|
|
159
|
+
function statusFromVerdict(verdict, previous, staleness, now, attempt) {
|
|
160
|
+
if (verdict.ok) return null;
|
|
161
|
+
if (verdict.reason === "disabled" || verdict.reason === "not-stale" || verdict.reason === "not-tracked") return null;
|
|
162
|
+
const since = previous && previous.target === staleness.target ? previous.since : now;
|
|
163
|
+
if (verdict.reason === "gave-up") {
|
|
164
|
+
return { state: "failed", reason: attempt?.lastError ?? "gave-up", since, target: staleness.target };
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
state: MANUAL_REASONS.has(verdict.reason) ? "manual" : "waiting",
|
|
168
|
+
reason: verdict.reason,
|
|
169
|
+
since,
|
|
170
|
+
target: staleness.target
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function wrapperReportsIdle(input) {
|
|
174
|
+
const caps = input.capabilities ?? [];
|
|
175
|
+
if (input.variant) return false;
|
|
176
|
+
if (caps.includes(AUTO_RESTART_CAPABILITY)) return true;
|
|
177
|
+
if (!caps.includes("agent-hibernation-v1")) return false;
|
|
178
|
+
if (input.flavor !== "claude" && input.flavor !== "codex") return false;
|
|
179
|
+
if (input.spawnedBy && input.spawnedBy.trim()) return false;
|
|
180
|
+
return !(input.tags ?? []).some((tag) => tag === "teams" || tag === "automation" || tag === "assistant");
|
|
181
|
+
}
|
|
182
|
+
const AUTO_UPDATED_EVENT_KIND = "session-auto-updated";
|
|
183
|
+
const AUTO_RESTARTED_ENV = "HAPPY_AUTO_RESTARTED";
|
|
184
|
+
function encodeAutoRestarted(kind, target) {
|
|
185
|
+
return `${kind}:${target}`;
|
|
186
|
+
}
|
|
187
|
+
function decodeAutoRestarted(raw) {
|
|
188
|
+
const match = /^(cli|agent):(\S{1,64})$/.exec(raw?.trim() ?? "");
|
|
189
|
+
return match ? { kind: match[1], target: match[2] } : null;
|
|
190
|
+
}
|
|
191
|
+
function autoUpdatedEventText(kind, version, agentName = "Codex") {
|
|
192
|
+
return kind === "agent" ? `Updated ${agentName} to ${version} (session restarted in place, history kept)` : `Updated to Very Happy ${version} (session restarted in place, history kept)`;
|
|
193
|
+
}
|
|
194
|
+
function takeAutoRestartedEvent(env, agentName) {
|
|
195
|
+
const decoded = decodeAutoRestarted(env[AUTO_RESTARTED_ENV]);
|
|
196
|
+
delete env[AUTO_RESTARTED_ENV];
|
|
197
|
+
if (!decoded) return null;
|
|
198
|
+
return { type: "message", kind: AUTO_UPDATED_EVENT_KIND, message: autoUpdatedEventText(decoded.kind, decoded.target, agentName) };
|
|
199
|
+
}
|
|
200
|
+
|
|
84
201
|
const runtime = {
|
|
85
202
|
signal: (pid, signal) => process.kill(pid, signal),
|
|
86
203
|
isAlive: (pid) => {
|
|
@@ -233,4 +350,4 @@ async function claimSessionOrExit(happySessionId, options) {
|
|
|
233
350
|
process.on("exit", () => releaseSessionLock(happySessionId));
|
|
234
351
|
}
|
|
235
352
|
|
|
236
|
-
export { applyServerSnapshot as a, applyReconnectReplay as b, claimSessionOrExit as c,
|
|
353
|
+
export { AUTO_RESTART_CAPABILITY as A, applyServerSnapshot as a, applyReconnectReplay as b, claimSessionOrExit as c, wrapperReportsIdle as d, exitCursorStamp as e, decideAutoRestart as f, autoRestartNextCheck as g, wrapperStaleness as h, AUTO_RESTART_MAX_ATTEMPTS as i, AUTO_RESTART_MIN_GAP_MS as j, readSessionLock as k, terminateProcess as l, mergeReconnectMetadata as m, terminateProcessTree as n, AUTO_RESTARTED_ENV as o, processIdentityFields as p, encodeAutoRestarted as q, recordAttempt as r, statusFromVerdict as s, takeAutoRestartedEvent as t, resolveQuietMs as u, AUTO_RESTART_RECHECK_CAP_MS as v, withoutServerSnapshot as w };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { c as configuration } from './configuration-
|
|
2
|
+
import { c as configuration } from './configuration-Dechcvd-.mjs';
|
|
3
3
|
import { e as encodeBase64, g as encrypt, d as decodeBase64, h as decrypt } from './authRelay-DhQhkBvX.mjs';
|
|
4
|
-
import { l as listDaemonSessions, f as stopDaemonSession } from './controlClient-
|
|
5
|
-
import { b as readCredentialsForConfiguredRelay, c as readPersistedSessions } from './persistence-
|
|
4
|
+
import { l as listDaemonSessions, f as stopDaemonSession } from './controlClient-D7NGfmtq.mjs';
|
|
5
|
+
import { b as readCredentialsForConfiguredRelay, c as readPersistedSessions } from './persistence-Dogj7JIp.mjs';
|
|
6
6
|
import { randomUUID } from 'node:crypto';
|
|
7
|
-
import { d as delay } from './time-
|
|
7
|
+
import { d as delay } from './time-CN3TuSVG.mjs';
|
|
8
|
+
import { c as compactCommandText, p as parseClear } from './specialCommands-MXUN0wfI.mjs';
|
|
8
9
|
import { io } from 'socket.io-client';
|
|
9
10
|
import { b as backgroundTasksReport } from './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
10
11
|
|
|
@@ -197,6 +198,19 @@ function isSteerPrompt(body) {
|
|
|
197
198
|
const b = asRecord(body);
|
|
198
199
|
return !!b && asRecord(b.meta)?.delivery === "steer";
|
|
199
200
|
}
|
|
201
|
+
function isControlCommand(text) {
|
|
202
|
+
return compactCommandText(text) !== null || parseClear(text).isClear;
|
|
203
|
+
}
|
|
204
|
+
const COMPACTION_FAILED = "Compaction failed:";
|
|
205
|
+
function controlCommandVerdict(body) {
|
|
206
|
+
const b = asRecord(body);
|
|
207
|
+
const data = b?.role === "agent" && b.content?.type === "event" ? asRecord(b.content.data) : null;
|
|
208
|
+
if (data?.type !== "message" || typeof data.message !== "string") return null;
|
|
209
|
+
const text = data.message.trim();
|
|
210
|
+
if (text === "Compaction completed" || text === "Context was reset") return { status: "completed", error: null };
|
|
211
|
+
if (text.startsWith(COMPACTION_FAILED)) return { status: "failed", error: text.slice(COMPACTION_FAILED.length).trim() || null };
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
200
214
|
function userPromptText(body) {
|
|
201
215
|
return isUserPrompt(body) ? body.content.text : null;
|
|
202
216
|
}
|
|
@@ -217,6 +231,8 @@ function analyzeLatestTurn(entries, options = {}) {
|
|
|
217
231
|
let startedAfterPrompt = false;
|
|
218
232
|
const emitsStarts = entries.some((entry) => sessionEnvelope(entry.body)?.ev?.t === "turn-start");
|
|
219
233
|
const steerAnchor = userIndex >= 0 && isSteerPrompt(entries[userIndex].body);
|
|
234
|
+
const anchorText = userIndex >= 0 ? userPromptText(entries[userIndex].body) : null;
|
|
235
|
+
const commandAnchor = anchorText !== null && isControlCommand(anchorText);
|
|
220
236
|
for (let i = userIndex + 1; i < entries.length; i++) {
|
|
221
237
|
const body = entries[i].body;
|
|
222
238
|
if (options.anchor && isUserPrompt(body)) {
|
|
@@ -241,6 +257,13 @@ function analyzeLatestTurn(entries, options = {}) {
|
|
|
241
257
|
error = typeof env.ev.error === "string" ? env.ev.error : null;
|
|
242
258
|
continue;
|
|
243
259
|
}
|
|
260
|
+
const verdict = commandAnchor && !ended ? controlCommandVerdict(body) : null;
|
|
261
|
+
if (verdict) {
|
|
262
|
+
ended = true;
|
|
263
|
+
status = verdict.status;
|
|
264
|
+
error = verdict.error;
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
244
267
|
const piece = agentPiece(body);
|
|
245
268
|
if (!piece) continue;
|
|
246
269
|
if (piece.kind === "tool") texts = [];
|
|
@@ -518,6 +541,12 @@ function sessionLiveness(live, sessionId) {
|
|
|
518
541
|
const child = live.find((entry) => entry.happySessionId === sessionId);
|
|
519
542
|
return child ? livenessOf(child) : { live: false };
|
|
520
543
|
}
|
|
544
|
+
function lineageOf(meta) {
|
|
545
|
+
return {
|
|
546
|
+
...typeof meta?.parentSessionId === "string" && meta.parentSessionId ? { parentSessionId: meta.parentSessionId } : {},
|
|
547
|
+
...typeof meta?.forkedFromMessageId === "string" && meta.forkedFromMessageId ? { forkedFromMessageId: meta.forkedFromMessageId } : {}
|
|
548
|
+
};
|
|
549
|
+
}
|
|
521
550
|
function toSummary(id, persisted, extra) {
|
|
522
551
|
const meta = persisted?.metadata;
|
|
523
552
|
return {
|
|
@@ -530,6 +559,7 @@ function toSummary(id, persisted, extra) {
|
|
|
530
559
|
...meta?.flavor ? { flavor: meta.flavor } : {},
|
|
531
560
|
...meta?.tags?.length ? { tags: [...meta.tags] } : {},
|
|
532
561
|
...meta?.variant ? { variant: meta.variant } : {},
|
|
562
|
+
...lineageOf(meta),
|
|
533
563
|
url: sessionWebUrl(id),
|
|
534
564
|
...persisted?.savedAt !== void 0 ? { savedAt: persisted.savedAt } : {}
|
|
535
565
|
};
|
|
@@ -575,6 +605,7 @@ function summarizeAccountSession(row, persisted, liveIds, now) {
|
|
|
575
605
|
...meta.flavor ? { flavor: meta.flavor } : {},
|
|
576
606
|
...meta.tags?.length ? { tags: [...meta.tags] } : {},
|
|
577
607
|
...meta.variant ? { variant: meta.variant } : {},
|
|
608
|
+
...lineageOf(meta),
|
|
578
609
|
...meta.machineId ? { machineId: meta.machineId } : {},
|
|
579
610
|
...persisted.savedAt !== void 0 ? { savedAt: persisted.savedAt } : {},
|
|
580
611
|
pending,
|
|
@@ -762,4 +793,4 @@ async function unarchiveSession(sessionId) {
|
|
|
762
793
|
);
|
|
763
794
|
}
|
|
764
795
|
|
|
765
|
-
export { DEFAULT_RECENT_LIMIT as D, MAX_READ_LIMIT as M, TurnWaitTimeoutError as T, listSessions as a, stopSession as b, resolvePermissionRequest as c, archiveSession as d, sendUserMessage as e, readSessionMetadata as f, waitForSessionKey as g, sessionLiveness as h, readSessionState as i,
|
|
796
|
+
export { DEFAULT_RECENT_LIMIT as D, MAX_READ_LIMIT as M, TurnWaitTimeoutError as T, listSessions as a, stopSession as b, resolvePermissionRequest as c, archiveSession as d, sendUserMessage as e, readSessionMetadata as f, waitForSessionKey as g, sessionLiveness as h, readSessionState as i, lineageOf as j, analyzeLatestTurn as k, listAccountSessions as l, readSessionLog as m, TURN_WINDOW as n, openUserScopedSocket as o, userPromptText as p, readSessionTranscript as r, sessionWebUrl as s, unarchiveSession as u, waitForTurnEnd as w };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var axios = require('axios');
|
|
4
|
-
var configuration = require('./configuration-
|
|
4
|
+
var configuration = require('./configuration-Dt5lKW3P.cjs');
|
|
5
5
|
var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
6
|
-
var controlClient = require('./controlClient-
|
|
7
|
-
var persistence = require('./persistence-
|
|
6
|
+
var controlClient = require('./controlClient-BRk65BRO.cjs');
|
|
7
|
+
var persistence = require('./persistence-Bl5S3TLB.cjs');
|
|
8
8
|
var node_crypto = require('node:crypto');
|
|
9
|
-
var time = require('./time-
|
|
9
|
+
var time = require('./time-gPD_EmA-.cjs');
|
|
10
|
+
var specialCommands = require('./specialCommands-J3JFOq0J.cjs');
|
|
10
11
|
var socket_ioClient = require('socket.io-client');
|
|
11
12
|
var backgroundTaskActivity = require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
12
13
|
|
|
@@ -199,6 +200,19 @@ function isSteerPrompt(body) {
|
|
|
199
200
|
const b = asRecord(body);
|
|
200
201
|
return !!b && asRecord(b.meta)?.delivery === "steer";
|
|
201
202
|
}
|
|
203
|
+
function isControlCommand(text) {
|
|
204
|
+
return specialCommands.compactCommandText(text) !== null || specialCommands.parseClear(text).isClear;
|
|
205
|
+
}
|
|
206
|
+
const COMPACTION_FAILED = "Compaction failed:";
|
|
207
|
+
function controlCommandVerdict(body) {
|
|
208
|
+
const b = asRecord(body);
|
|
209
|
+
const data = b?.role === "agent" && b.content?.type === "event" ? asRecord(b.content.data) : null;
|
|
210
|
+
if (data?.type !== "message" || typeof data.message !== "string") return null;
|
|
211
|
+
const text = data.message.trim();
|
|
212
|
+
if (text === "Compaction completed" || text === "Context was reset") return { status: "completed", error: null };
|
|
213
|
+
if (text.startsWith(COMPACTION_FAILED)) return { status: "failed", error: text.slice(COMPACTION_FAILED.length).trim() || null };
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
202
216
|
function userPromptText(body) {
|
|
203
217
|
return isUserPrompt(body) ? body.content.text : null;
|
|
204
218
|
}
|
|
@@ -219,6 +233,8 @@ function analyzeLatestTurn(entries, options = {}) {
|
|
|
219
233
|
let startedAfterPrompt = false;
|
|
220
234
|
const emitsStarts = entries.some((entry) => sessionEnvelope(entry.body)?.ev?.t === "turn-start");
|
|
221
235
|
const steerAnchor = userIndex >= 0 && isSteerPrompt(entries[userIndex].body);
|
|
236
|
+
const anchorText = userIndex >= 0 ? userPromptText(entries[userIndex].body) : null;
|
|
237
|
+
const commandAnchor = anchorText !== null && isControlCommand(anchorText);
|
|
222
238
|
for (let i = userIndex + 1; i < entries.length; i++) {
|
|
223
239
|
const body = entries[i].body;
|
|
224
240
|
if (options.anchor && isUserPrompt(body)) {
|
|
@@ -243,6 +259,13 @@ function analyzeLatestTurn(entries, options = {}) {
|
|
|
243
259
|
error = typeof env.ev.error === "string" ? env.ev.error : null;
|
|
244
260
|
continue;
|
|
245
261
|
}
|
|
262
|
+
const verdict = commandAnchor && !ended ? controlCommandVerdict(body) : null;
|
|
263
|
+
if (verdict) {
|
|
264
|
+
ended = true;
|
|
265
|
+
status = verdict.status;
|
|
266
|
+
error = verdict.error;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
246
269
|
const piece = agentPiece(body);
|
|
247
270
|
if (!piece) continue;
|
|
248
271
|
if (piece.kind === "tool") texts = [];
|
|
@@ -520,6 +543,12 @@ function sessionLiveness(live, sessionId) {
|
|
|
520
543
|
const child = live.find((entry) => entry.happySessionId === sessionId);
|
|
521
544
|
return child ? livenessOf(child) : { live: false };
|
|
522
545
|
}
|
|
546
|
+
function lineageOf(meta) {
|
|
547
|
+
return {
|
|
548
|
+
...typeof meta?.parentSessionId === "string" && meta.parentSessionId ? { parentSessionId: meta.parentSessionId } : {},
|
|
549
|
+
...typeof meta?.forkedFromMessageId === "string" && meta.forkedFromMessageId ? { forkedFromMessageId: meta.forkedFromMessageId } : {}
|
|
550
|
+
};
|
|
551
|
+
}
|
|
523
552
|
function toSummary(id, persisted, extra) {
|
|
524
553
|
const meta = persisted?.metadata;
|
|
525
554
|
return {
|
|
@@ -532,6 +561,7 @@ function toSummary(id, persisted, extra) {
|
|
|
532
561
|
...meta?.flavor ? { flavor: meta.flavor } : {},
|
|
533
562
|
...meta?.tags?.length ? { tags: [...meta.tags] } : {},
|
|
534
563
|
...meta?.variant ? { variant: meta.variant } : {},
|
|
564
|
+
...lineageOf(meta),
|
|
535
565
|
url: sessionWebUrl(id),
|
|
536
566
|
...persisted?.savedAt !== void 0 ? { savedAt: persisted.savedAt } : {}
|
|
537
567
|
};
|
|
@@ -577,6 +607,7 @@ function summarizeAccountSession(row, persisted, liveIds, now) {
|
|
|
577
607
|
...meta.flavor ? { flavor: meta.flavor } : {},
|
|
578
608
|
...meta.tags?.length ? { tags: [...meta.tags] } : {},
|
|
579
609
|
...meta.variant ? { variant: meta.variant } : {},
|
|
610
|
+
...lineageOf(meta),
|
|
580
611
|
...meta.machineId ? { machineId: meta.machineId } : {},
|
|
581
612
|
...persisted.savedAt !== void 0 ? { savedAt: persisted.savedAt } : {},
|
|
582
613
|
pending,
|
|
@@ -770,6 +801,7 @@ exports.TURN_WINDOW = TURN_WINDOW;
|
|
|
770
801
|
exports.TurnWaitTimeoutError = TurnWaitTimeoutError;
|
|
771
802
|
exports.analyzeLatestTurn = analyzeLatestTurn;
|
|
772
803
|
exports.archiveSession = archiveSession;
|
|
804
|
+
exports.lineageOf = lineageOf;
|
|
773
805
|
exports.listAccountSessions = listAccountSessions;
|
|
774
806
|
exports.listSessions = listSessions;
|
|
775
807
|
exports.openUserScopedSocket = openUserScopedSocket;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
|
-
var configuration = require('./configuration-
|
|
5
|
-
var controlClient = require('./controlClient-
|
|
4
|
+
var configuration = require('./configuration-Dt5lKW3P.cjs');
|
|
5
|
+
var controlClient = require('./controlClient-BRk65BRO.cjs');
|
|
6
6
|
var providerBinding = require('./providerBinding-B-Qbx9W2.cjs');
|
|
7
7
|
require('node:fs');
|
|
8
8
|
require('node:os');
|
|
9
9
|
require('node:path');
|
|
10
|
-
require('./package-
|
|
10
|
+
require('./package-DrY090nZ.cjs');
|
|
11
11
|
require('node:fs/promises');
|
|
12
|
-
require('./logger-
|
|
12
|
+
require('./logger-BBRTTVsQ.cjs');
|
|
13
13
|
require('node:util');
|
|
14
|
-
require('./persistence-
|
|
14
|
+
require('./persistence-Bl5S3TLB.cjs');
|
|
15
15
|
require('zod');
|
|
16
16
|
require('./authRelay-Dy1qU9td.cjs');
|
|
17
17
|
require('node:crypto');
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { c as configuration } from './configuration-
|
|
3
|
-
import { r as restartDaemonSession } from './controlClient-
|
|
2
|
+
import { c as configuration } from './configuration-Dechcvd-.mjs';
|
|
3
|
+
import { r as restartDaemonSession } from './controlClient-D7NGfmtq.mjs';
|
|
4
4
|
import { r as readSessionProviders, b as readProviders, w as writeSessionProviders, u as updateBindings, s as sessionProvidersPath } from './providerBinding-CYubGg-Z.mjs';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:os';
|
|
7
7
|
import 'node:path';
|
|
8
|
-
import './package-
|
|
8
|
+
import './package-C6uiXULx.mjs';
|
|
9
9
|
import 'node:fs/promises';
|
|
10
|
-
import './logger-
|
|
10
|
+
import './logger-CL7pin9b.mjs';
|
|
11
11
|
import 'node:util';
|
|
12
|
-
import './persistence-
|
|
12
|
+
import './persistence-Dogj7JIp.mjs';
|
|
13
13
|
import 'zod';
|
|
14
14
|
import './authRelay-DhQhkBvX.mjs';
|
|
15
15
|
import 'node:crypto';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var sync = require('./sync-
|
|
3
|
+
var sync = require('./sync-DtWB7RzA.cjs');
|
|
4
4
|
var types = require('./types-CRS-srZK.cjs');
|
|
5
5
|
var path$1 = require('node:path');
|
|
6
6
|
var node_fs = require('node:fs');
|
|
7
7
|
var transcriptCursor = require('./transcriptCursor-DcXGLeSc.cjs');
|
|
8
|
-
var logger = require('./logger-
|
|
9
|
-
var startFileWatcher = require('./startFileWatcher-
|
|
8
|
+
var logger = require('./logger-BBRTTVsQ.cjs');
|
|
9
|
+
var startFileWatcher = require('./startFileWatcher-BQs0cJA-.cjs');
|
|
10
10
|
var path = require('./path-B7zW-WwE.cjs');
|
|
11
11
|
|
|
12
12
|
class Future {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { I as InvalidateSync } from './sync-
|
|
1
|
+
import { I as InvalidateSync } from './sync-eZkXnsW_.mjs';
|
|
2
2
|
import { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { statSync } from 'node:fs';
|
|
5
5
|
import { r as readTranscriptIncrement, i as isValidTranscriptHint } from './transcriptCursor-B7T_gkQ0.mjs';
|
|
6
|
-
import { l as logger } from './logger-
|
|
7
|
-
import { s as startFileWatcher } from './startFileWatcher-
|
|
6
|
+
import { l as logger } from './logger-CL7pin9b.mjs';
|
|
7
|
+
import { s as startFileWatcher } from './startFileWatcher-Dedtu1vq.mjs';
|
|
8
8
|
import { g as getProjectPath } from './path-D2wdaNSk.mjs';
|
|
9
9
|
|
|
10
10
|
class Future {
|