very-happy-cli 0.2.180 → 0.2.182
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-B8Zi30Zh.mjs → AcpBackend-DLk3gMYH.mjs} +3 -3
- package/dist/{AcpBackend-DfRDtMcG.cjs → AcpBackend-JA5eu8Y0.cjs} +3 -3
- package/dist/{AcpSessionManager-CASKOnOj.cjs → AcpSessionManager-DjYidq4C.cjs} +1 -1
- package/dist/{AcpSessionManager-i8Rab0xT.mjs → AcpSessionManager-OrCww-Qv.mjs} +1 -1
- package/dist/{BasePermissionHandler-BlM_tfej.cjs → BasePermissionHandler-D3PMKLBS.cjs} +1 -1
- package/dist/{BasePermissionHandler-26fKbRCm.mjs → BasePermissionHandler-u-neo-iN.mjs} +1 -1
- package/dist/{acpSessionResume-CR5pmgVo.cjs → acpSessionResume-Dxo8222T.cjs} +1 -1
- package/dist/{acpSessionResume-B9l54P-X.mjs → acpSessionResume-u2TwX5Jd.mjs} +1 -1
- package/dist/{agentHome-C7Sb7-Tz.cjs → agentHome-CP1tCBXz.cjs} +4 -4
- package/dist/{agentHome-CmGy0NWv.mjs → agentHome-D3hNrnoA.mjs} +4 -4
- package/dist/{api-DM7b1OKj.cjs → api-CZWcG7uh.cjs} +10 -10
- package/dist/{api-Hov8p7CA.mjs → api-C_YSQnsi.mjs} +10 -10
- package/dist/{apiMachine-CwGEhQDT.mjs → apiMachine-C_GA5Bm-.mjs} +59 -32
- package/dist/{apiMachine-DkGRj-Ai.cjs → apiMachine-DPGrED5C.cjs} +60 -33
- package/dist/{attachmentContent-CIn4iPEk.mjs → attachmentContent-Ckzyb1Uy.mjs} +2 -2
- package/dist/{attachmentContent-CEm13_gF.cjs → attachmentContent-I_dJIevE.cjs} +2 -2
- package/dist/{auth-Dawj7pP5.cjs → auth-BKnE7uv7.cjs} +8 -8
- package/dist/{auth-BG1DY0gj.mjs → auth-CGgpiJ5-.mjs} +5 -5
- package/dist/{auth-rggxMpEE.mjs → auth-DOXMI-xp.mjs} +8 -8
- package/dist/{auth-CBXnm-Mj.cjs → auth-Lw_utSMV.cjs} +5 -5
- package/dist/{auto-CbYOfoPS.cjs → auto-CIgFHIyQ.cjs} +18 -18
- package/dist/{auto-CXXLXGeL.mjs → auto-Z56mMZnH.mjs} +18 -18
- package/dist/{bootstrap-Dt5I1SOl.mjs → bootstrap-D3vlOROj.mjs} +2 -2
- package/dist/{bootstrap-DoA7okld.cjs → bootstrap-DsXp74wv.cjs} +2 -2
- package/dist/{browser-DUNetFT4.mjs → browser-CUxGoATV.mjs} +1 -1
- package/dist/{browser-DZ6qRtfH.cjs → browser-CZlA9AkO.cjs} +1 -1
- package/dist/{claudeLocal-OHWQigCl.mjs → claudeLocal-FnTUgwCi.mjs} +6 -6
- package/dist/{claudeLocal--DNyMOSv.cjs → claudeLocal-oELvwiZL.cjs} +6 -6
- package/dist/{claudeLocalLauncher-BStvfa7M.mjs → claudeLocalLauncher-CO5YHCzi.mjs} +11 -11
- package/dist/{claudeLocalLauncher-BhvPbcyH.cjs → claudeLocalLauncher-QsVXEVdE.cjs} +11 -11
- package/dist/{claudeSessionFork-Be16vzGc.cjs → claudeSessionFork-BA4GE5AL.cjs} +1 -1
- package/dist/{claudeSessionFork-GAVWhiKG.mjs → claudeSessionFork-Cspr6QW0.mjs} +1 -1
- package/dist/{client-D4uPb1uu.mjs → client-BGfmSbWc.mjs} +44 -9
- package/dist/{client-BWjaHKtj.cjs → client-CDuW4MS9.cjs} +2 -2
- package/dist/{client-CnB7kRCT.mjs → client-Ctbw05Xj.mjs} +2 -2
- package/dist/{client-DJplzPjD.cjs → client-DK8CzUry.cjs} +2 -2
- package/dist/{client-Ca5Pcgy_.mjs → client-o-meK7-a.mjs} +2 -2
- package/dist/{client-D_loZ9IK.cjs → client-xnWiHqdb.cjs} +44 -8
- package/dist/codex/happyMcpStdioBridge.cjs +21 -20
- package/dist/codex/happyMcpStdioBridge.mjs +21 -20
- package/dist/{codexAppServerClient-CO4G6OS4.mjs → codexAppServerClient-BlsOZLul.mjs} +3 -3
- package/dist/{codexAppServerClient-PE-12AsW.cjs → codexAppServerClient-DhNDTU_i.cjs} +3 -3
- package/dist/{codexCommand-B_xUH79E.mjs → codexCommand-BGx5NMQR.mjs} +49 -46
- package/dist/{codexCommand-BNoD1t1C.cjs → codexCommand-DJDPfpIs.cjs} +49 -46
- package/dist/{codexTermination-Dx48ma6e.mjs → codexTermination-CVhhwHZU.mjs} +1 -1
- package/dist/{codexTermination-BmBbizFK.cjs → codexTermination-CqPMuokw.cjs} +1 -1
- package/dist/{config-CtwEUxUP.cjs → config-CHpxzXBL.cjs} +3 -3
- package/dist/{config-DSu0Blos.mjs → config-CWAe08-Q.mjs} +3 -3
- package/dist/{configuration-CYO-kPOS.cjs → configuration-B-CugKJ3.cjs} +1 -1
- package/dist/{configuration-PxzEJumr.mjs → configuration-YXw_Dcsb.mjs} +1 -1
- package/dist/{connect-Dq7wndzR.cjs → connect-BmHvMXH2.cjs} +13 -13
- package/dist/{connect-BQrg3TB6.mjs → connect-CPeJXHha.mjs} +13 -13
- package/dist/{context-6TP-iz_c.cjs → context-BtIVqHI5.cjs} +1 -1
- package/dist/{context-CJGRRGWW.mjs → context-Drzs_Z38.mjs} +1 -1
- package/dist/{controlClient-DoeYovwP.mjs → controlClient-BL4hb4l3.mjs} +3 -3
- package/dist/{controlClient-Bqv5v5OM.cjs → controlClient-D0kGwKYx.cjs} +3 -3
- package/dist/{createSessionMetadata-DDIChCx8.mjs → createSessionMetadata-DvGDsnsn.mjs} +2 -2
- package/dist/{createSessionMetadata-xz767pcG.cjs → createSessionMetadata-L499emJn.cjs} +2 -2
- package/dist/{defaultPermissionMode-i5KzdK09.mjs → defaultPermissionMode-BLfxu-Yz.mjs} +2 -2
- package/dist/{defaultPermissionMode-PkZGsQDk.cjs → defaultPermissionMode-MXpZlXud.cjs} +2 -2
- package/dist/{deterministicJson-CTEJDqtS.mjs → deterministicJson-B_UAbmQ4.mjs} +87 -24
- package/dist/{deterministicJson-xqA6DaOm.cjs → deterministicJson-CfLkBRvU.cjs} +87 -22
- package/dist/{doctor-BrgSlfXn.cjs → doctor-DMvlzmnE.cjs} +8 -7
- package/dist/{doctor-IctjVh9T.mjs → doctor-bKScPtZu.mjs} +8 -8
- package/dist/{downloadTarget-CEb9che-.cjs → downloadTarget-D33BFvew.cjs} +6 -6
- package/dist/{downloadTarget-jbOz1egC.mjs → downloadTarget-J9j37eFG.mjs} +6 -6
- package/dist/{ensureDaemonRunning-D-HyjGIX.cjs → ensureDaemonRunning-2IqWROJp.cjs} +5 -5
- package/dist/{ensureDaemonRunning-b1e8LCSM.mjs → ensureDaemonRunning-DLvwhpNg.mjs} +5 -5
- package/dist/fileStore-5qpetZS0.mjs +146 -0
- package/dist/fileStore-7qhnbs6N.cjs +152 -0
- package/dist/fsMkdir-0K3yENml.cjs +56 -0
- package/dist/fsMkdir-DumgLTzR.mjs +53 -0
- package/dist/{handleResumeCommand-DpaZvm2c.mjs → handleResumeCommand-CjtjQ_I7.mjs} +5 -5
- package/dist/{handleResumeCommand-BvWVuRwH.cjs → handleResumeCommand-Dp2Y-p6V.cjs} +5 -5
- package/dist/{index-C6Vn5Eac.mjs → index-BI0h2Zks.mjs} +54 -6
- package/dist/{index-CMf5VbzG.mjs → index-BOT0Tg5E.mjs} +4 -4
- package/dist/{index-C64Ufj4D.cjs → index-B_aNaW9w.cjs} +4 -4
- package/dist/{index-F2UejqYs.cjs → index-CZC7egJA.cjs} +3 -3
- package/dist/{index-Bsvbgh9e.mjs → index-Cllzqoes.mjs} +4 -4
- package/dist/{index-B2p2Mut7.cjs → index-DYVIbhAJ.cjs} +78 -60
- package/dist/{index-wCbtF4BK.mjs → index-D_LvOWUN.mjs} +3 -3
- package/dist/{index-DmTlDRSL.cjs → index-DymOv3kK.cjs} +4 -4
- package/dist/{index-BUNnpGFF.mjs → index-kA46KMxN.mjs} +79 -61
- package/dist/{index-Dv0Q48P3.cjs → index-oh8XEozJ.cjs} +57 -6
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-C0ANcEAW.cjs → install-BAa_Xmof.cjs} +3 -3
- package/dist/{install-CdzSV7qO.mjs → install-C46mkr9a.mjs} +3 -3
- package/dist/{install-BX3lv3NO.mjs → install-D0inLCv-.mjs} +1 -1
- package/dist/{install-BXvf2E3o.cjs → install-D2NCbeJ-.cjs} +1 -1
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +40 -1
- package/dist/lib.d.mts +40 -1
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-bBrmaQd2.mjs → lidState-D8Iuvjgl.mjs} +1 -1
- package/dist/{lidState-DWGnm2H4.cjs → lidState-DcPvwniz.cjs} +1 -1
- package/dist/{localHappyAgentAuth-Dn1jYDpt.mjs → localHappyAgentAuth-D3rQDRd9.mjs} +1 -1
- package/dist/{localHappyAgentAuth-DZHQnIW9.cjs → localHappyAgentAuth-SD6GM97y.cjs} +1 -1
- package/dist/{logger-CphW5nUE.cjs → logger-DK1ytCz6.cjs} +2 -2
- package/dist/{logger-BUngm5Xg.mjs → logger-DpqihN1f.mjs} +2 -2
- package/dist/{machineMetadata-BXN_bKU3.mjs → machineMetadata-D4E3qoIG.mjs} +13 -4
- package/dist/{machineMetadata-BQm9YTcI.cjs → machineMetadata-IJc6_iyx.cjs} +13 -3
- package/dist/{main-DGkdYfEq.mjs → main-CpUmw7hm.mjs} +45 -45
- package/dist/{main-B2UV51nK.cjs → main-DUXh2rgW.cjs} +45 -45
- package/dist/{mcp-CbTtbs0f.mjs → mcp-66g1TJ8P.mjs} +17 -15
- package/dist/{mcp-BFvAEIRz.cjs → mcp-D5f3Vd-z.cjs} +17 -15
- package/dist/{mirrorProtocol-HKPivs5o.cjs → mirrorProtocol-DkWOcZh9.cjs} +16 -153
- package/dist/{mirrorProtocol-BR4luBC0.mjs → mirrorProtocol-bsCUcaCY.mjs} +19 -151
- package/dist/{package-KhLqBDX9.cjs → package-BfeqAzyJ.cjs} +8 -8
- package/dist/{package-7Ld1YMhh.mjs → package-CKj8zndE.mjs} +8 -8
- package/dist/{panels-Njf6GelF.cjs → panels-2PXsw9-d.cjs} +5 -5
- package/dist/{panels-C7IVqpJk.mjs → panels-r8LmaBs6.mjs} +5 -5
- package/dist/{peerTools-DQNlrcqM.cjs → peerTools-BVp1z0T_.cjs} +5 -5
- package/dist/{peerTools-BOlDRyhi.mjs → peerTools-D_id4d41.mjs} +5 -5
- package/dist/{persistence-9BMYspxG.cjs → persistence-BdpwWXKh.cjs} +2 -2
- package/dist/{persistence-BFUOHW5h.mjs → persistence-jOEuAFTS.mjs} +2 -2
- package/dist/pi-CqyoZMjI.mjs +380 -0
- package/dist/pi-DlsrPCTa.cjs +400 -0
- package/dist/{piRunnerArgs-H2pgpA5z.mjs → piRunnerArgs-68I5F_M1.mjs} +1 -1
- package/dist/{piRunnerArgs-DGaq6VYM.cjs → piRunnerArgs-vxCHKnSA.cjs} +1 -1
- package/dist/{piRuntime-CT5xv_3h.cjs → piRuntime-C3Dg5uni.cjs} +2 -2
- package/dist/{piRuntime-CdN0JAsa.mjs → piRuntime-DgLIard1.mjs} +2 -2
- package/dist/{piTerminal-0FBtXTHK.cjs → piTerminal-C135BcLP.cjs} +20 -18
- package/dist/{piTerminal-C4m9YXAV.mjs → piTerminal-DJL0w-uA.mjs} +20 -18
- package/dist/{prompt-lgF9IE82.cjs → prompt-Bof2aQkI.cjs} +7 -2
- package/dist/{prompt-BOouDaTM.mjs → prompt-QHuFx9j6.mjs} +7 -2
- package/dist/{pushNotifications-DCiBEVeC.mjs → pushNotifications-CMmRsbKv.mjs} +12 -4
- package/dist/{pushNotifications-DI92havG.cjs → pushNotifications-CyQVDThC.cjs} +12 -4
- package/dist/{query-BETKBrnz.cjs → query-CK--1fbL.cjs} +1 -1
- package/dist/{query-ywZbQUzR.mjs → query-CPXnDURZ.mjs} +1 -1
- package/dist/{rateLimitWindows-BkfuUB1a.mjs → rateLimitWindows-Cqa4AGaB.mjs} +1 -1
- package/dist/{rateLimitWindows-YRIYVdo4.cjs → rateLimitWindows-DJxnNw-X.cjs} +1 -1
- package/dist/{registerCommonHandlers-C7a_dUWs.cjs → registerCommonHandlers-DbNoM39q.cjs} +2 -2
- package/dist/{registerCommonHandlers-CTkCvjxt.mjs → registerCommonHandlers-K8dICQO2.mjs} +2 -2
- package/dist/{registerKillSessionHandler-CIsvBrVe.cjs → registerKillSessionHandler-DiS_go8d.cjs} +6 -6
- package/dist/{registerKillSessionHandler-CaqqRYq6.mjs → registerKillSessionHandler-O1iriOMO.mjs} +6 -6
- package/dist/{remoteSessionClient-PP-mOKmw.mjs → remoteSessionClient-BlURPulk.mjs} +5 -5
- package/dist/{remoteSessionClient-D843fkzL.cjs → remoteSessionClient-CtV9mDko.cjs} +5 -5
- package/dist/{reportProgressTool-14AXr959.cjs → reportProgressTool-DlD_xjzU.cjs} +4 -4
- package/dist/{reportProgressTool-ZOCNjWHr.mjs → reportProgressTool-nCExrHZH.mjs} +4 -4
- package/dist/{resources-CvIlkzpP.cjs → resources-BPyN59Iv.cjs} +23 -2
- package/dist/{resources-y9jfyO-_.mjs → resources-CH1iP6Cv.mjs} +22 -3
- package/dist/{run-CAOCYYfT.cjs → run-BBNrcCfI.cjs} +621 -594
- package/dist/{run-Dajw2E5j.mjs → run-drtwHYkO.mjs} +557 -530
- package/dist/{runClaude-CRRKt-tm.cjs → runClaude-B3KSeby4.cjs} +23 -22
- package/dist/{runClaude-C6oxWYbp.mjs → runClaude-CFp27Tyi.mjs} +23 -22
- package/dist/{runClaudeDeps-B1ysqTvx.cjs → runClaudeDeps-C_C9TCI0.cjs} +43 -41
- package/dist/{runClaudeDeps-BcZ68cX3.mjs → runClaudeDeps-DMcv93lA.mjs} +48 -46
- package/dist/{runGemini-D7yKc4wD.mjs → runGemini-Bc6SY-hd.mjs} +40 -37
- package/dist/{runGemini-DtKFXqf-.cjs → runGemini-DzdSBAr9.cjs} +40 -37
- package/dist/{runOpenClaw-C8ilyLP9.mjs → runOpenClaw-DI0qMlgF.mjs} +19 -18
- package/dist/{runOpenClaw-Cq29mryb.cjs → runOpenClaw-DN6rEVqC.cjs} +19 -18
- package/dist/{sandbox-gIj-EuF4.cjs → sandbox-DtttPBMA.cjs} +4 -4
- package/dist/{sandbox-CbCutma4.mjs → sandbox-v-ffe8LR.mjs} +4 -4
- package/dist/{selfCheck-BTGBVthv.cjs → selfCheck-B-yy6bW3.cjs} +36 -36
- package/dist/selfCheck-BDfTwxqB.mjs +85 -0
- package/dist/{send-YZRMQvMJ.mjs → send-DpBwSZuj.mjs} +8 -8
- package/dist/{send-CZf5lLw_.cjs → send-ShzXYPRu.cjs} +8 -8
- package/dist/{server-CknFq6xG.cjs → server-CEzKrfKj.cjs} +6 -6
- package/dist/{server-BqwXRzFZ.mjs → server-DScgJXxa.mjs} +4 -4
- package/dist/{sessionLock-nBXdJxJm.mjs → sessionLock-B6K4SBZD.mjs} +3 -3
- package/dist/{sessionLock-DRZUcKHT.cjs → sessionLock-Dc0fadGG.cjs} +3 -3
- package/dist/{sessionOps-C58iDeD5.mjs → sessionOps-D0BPWPoh.mjs} +4 -4
- package/dist/{sessionOps-BrGiU9-s.cjs → sessionOps-Dx7wARjI.cjs} +4 -4
- package/dist/{sessionScanner-Bm57LEXe.mjs → sessionScanner-9Fpgaxtf.mjs} +3 -3
- package/dist/{sessionScanner-CaO8bLaG.cjs → sessionScanner-BJ35TVG6.cjs} +3 -3
- package/dist/{sessions-BXyBHo8n.mjs → sessions-CFtDlyZd.mjs} +10 -10
- package/dist/{sessions-uzqPCc37.cjs → sessions-TZGGAry1.cjs} +10 -10
- package/dist/{setupOfflineReconnection-DvvVX3TB.cjs → setupOfflineReconnection-B1GsVA8P.cjs} +2 -2
- package/dist/{setupOfflineReconnection-1Qlek3wl.mjs → setupOfflineReconnection-Biaus-0T.mjs} +2 -2
- package/dist/{spawn-DBkodJEO.cjs → spawn-BRTuypQ2.cjs} +14 -14
- package/dist/{spawn-vn93PhYL.mjs → spawn-CsoQ-Ecz.mjs} +14 -14
- package/dist/{spawnAgents-DLNMlhWJ.cjs → spawnAgents-CG211IW7.cjs} +1 -1
- package/dist/{spawnAgents-CgPMWexP.mjs → spawnAgents-Co-SLcx-.mjs} +1 -1
- package/dist/{spawnHappyCLI-BjFZc_7V.mjs → spawnHappyCLI-D1doCjkZ.mjs} +1 -1
- package/dist/{spawnHappyCLI-DnUZv0X2.cjs → spawnHappyCLI-D47kX6jg.cjs} +1 -1
- package/dist/{specialCommands-BRufxlqe.cjs → specialCommands-Ch-Gvy-i.cjs} +3 -3
- package/dist/{specialCommands-D3ND9bdg.mjs → specialCommands-xSmqT_Fu.mjs} +3 -3
- package/dist/{startFileWatcher-DXJ7yB5v.mjs → startFileWatcher-CCl2fFxT.mjs} +1 -1
- package/dist/{startFileWatcher-D9cYzZOq.cjs → startFileWatcher-gKQTstR6.cjs} +1 -1
- package/dist/{startupSessionCreate-kdr3m1uX.cjs → startupSessionCreate-BXqoUX30.cjs} +1 -1
- package/dist/{startupSessionCreate-uZ6BM0ty.mjs → startupSessionCreate-DlZc8yPl.mjs} +1 -1
- package/dist/{streamRelay-Dy6amlzx.cjs → streamRelay-B-J-4St1.cjs} +1 -1
- package/dist/{streamRelay-DnMCMMfV.mjs → streamRelay-DnJXsi36.mjs} +1 -1
- package/dist/{sync-BvVhDO40.mjs → sync-BbjMC3sR.mjs} +1 -1
- package/dist/{sync-Bn-idAoy.cjs → sync-BxMdnZzz.cjs} +1 -1
- package/dist/{systemPrompt-DlyEk35T.cjs → systemPrompt-C2KojRmK.cjs} +3 -3
- package/dist/{systemPrompt-CIZcJuJF.mjs → systemPrompt-CmSDAoIx.mjs} +3 -3
- package/dist/{teams-BLeRpDxv.cjs → teams-DESdalox.cjs} +13 -10
- package/dist/{teams-DLY3B5yi.mjs → teams-lRy1MS0Z.mjs} +13 -10
- package/dist/{time-D3ETL7Jb.mjs → time-Cfknl7xG.mjs} +1 -1
- package/dist/{time-Cjv0zxQO.cjs → time-DNLeIRgR.cjs} +1 -1
- package/dist/{titleGenerator-Uzbd4utr.mjs → titleGenerator-ClnMSzwC.mjs} +1 -1
- package/dist/{titleGenerator-Cgp5ihFb.cjs → titleGenerator-YNutaU88.cjs} +2 -2
- package/dist/{todo-pOMcEECE.cjs → todo-DS75Mboz.cjs} +6 -6
- package/dist/{todo-C9Ga-oEM.mjs → todo-DZbK5POc.mjs} +6 -6
- package/dist/{tools-Cho7iIWf.mjs → tools-BgdU0dWp.mjs} +3 -3
- package/dist/{tools-BL7Byl_x.cjs → tools-ClYcb1YQ.cjs} +3 -3
- package/dist/{uninstall-CbayEVoV.cjs → uninstall-Di1vPBLV.cjs} +3 -3
- package/dist/{uninstall-CvZHVY9C.mjs → uninstall-bXenFevR.mjs} +3 -3
- package/package.json +8 -8
- package/dist/selfCheck-Smt-5Xiq.mjs +0 -85
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { c as configuration } from './configuration-
|
|
3
|
-
import { r as readSettings, g as readCredentials, d as readDaemonState } from './persistence-
|
|
4
|
-
import { a as checkIfDaemonRunningAndCleanupStaleState } from './controlClient-
|
|
2
|
+
import { c as configuration } from './configuration-YXw_Dcsb.mjs';
|
|
3
|
+
import { r as readSettings, g as readCredentials, d as readDaemonState } from './persistence-jOEuAFTS.mjs';
|
|
4
|
+
import { a as checkIfDaemonRunningAndCleanupStaleState } from './controlClient-BL4hb4l3.mjs';
|
|
5
5
|
import { findAllHappyProcesses } from './doctor-BPkYWSuq.mjs';
|
|
6
6
|
import { statSync, realpathSync, existsSync, readdirSync } from 'node:fs';
|
|
7
7
|
import { isAbsolute, resolve, dirname, basename, delimiter, join } from 'node:path';
|
|
8
8
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
9
|
-
import { p as packageJson } from './package-
|
|
9
|
+
import { p as packageJson } from './package-CKj8zndE.mjs';
|
|
10
10
|
import { s as shareableSettingsSummary, c as collectRuntimeReadiness, S as SUPPORTED_NODE_LABEL, r as resolveClaudeCredentialReadiness, a as toolProbeLabel, b as daemonReadiness, d as daemonEndpointsMatch } from './doctorReadiness-C208SMN9.mjs';
|
|
11
11
|
import { c as credentialRelayProblem } from './authRelay-DhQhkBvX.mjs';
|
|
12
12
|
import { d as deriveLocalCliUpdateSummary } from './cliUpdate-Y34VGe9Y.mjs';
|
|
13
13
|
import { spawnSync } from 'node:child_process';
|
|
14
|
-
import { c as piInstallCommand } from './piRunnerArgs-
|
|
14
|
+
import { c as piInstallCommand } from './piRunnerArgs-68I5F_M1.mjs';
|
|
15
15
|
|
|
16
16
|
function shareSafeProcessLine(process2) {
|
|
17
17
|
return `PID ${process2.pid}: command arguments hidden for privacy`;
|
|
@@ -311,8 +311,8 @@ ${typeLabels[type] || type}:`));
|
|
|
311
311
|
}
|
|
312
312
|
console.log(chalk.gray(" An external claude command is only needed for native terminal/mirror use."));
|
|
313
313
|
try {
|
|
314
|
-
const { resolveAgentHomesForCli } = await import('./agentHome-
|
|
315
|
-
const { describeAgentHome } = await import('./index-
|
|
314
|
+
const { resolveAgentHomesForCli } = await import('./agentHome-D3hNrnoA.mjs');
|
|
315
|
+
const { describeAgentHome } = await import('./index-Cllzqoes.mjs');
|
|
316
316
|
const homes = await resolveAgentHomesForCli();
|
|
317
317
|
console.log(chalk.green(`\u2713 Claude config dir: ${describeAgentHome(homes.claudeConfigDir)}`));
|
|
318
318
|
console.log(chalk.green(`\u2713 Codex home: ${describeAgentHome(homes.codexHome)}`));
|
|
@@ -389,4 +389,4 @@ var doctor = /*#__PURE__*/Object.freeze({
|
|
|
389
389
|
runDoctorDaemon: runDoctorDaemon
|
|
390
390
|
});
|
|
391
391
|
|
|
392
|
-
export { globalPrefixForPackage as a, doctor as d, getEnvironmentInfo as g };
|
|
392
|
+
export { NPM_SAFE_ARG as N, globalPrefixForPackage as a, doctor as d, getEnvironmentInfo as g };
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
var promises = require('node:fs/promises');
|
|
4
4
|
var os = require('node:os');
|
|
5
5
|
var z = require('zod');
|
|
6
|
-
var logger = require('./logger-
|
|
7
|
-
var persistence = require('./persistence-
|
|
8
|
-
var controlClient = require('./controlClient-
|
|
9
|
-
var sessionOps = require('./sessionOps-
|
|
10
|
-
var remoteSessionClient = require('./remoteSessionClient-
|
|
6
|
+
var logger = require('./logger-DK1ytCz6.cjs');
|
|
7
|
+
var persistence = require('./persistence-BdpwWXKh.cjs');
|
|
8
|
+
var controlClient = require('./controlClient-D0kGwKYx.cjs');
|
|
9
|
+
var sessionOps = require('./sessionOps-Dx7wARjI.cjs');
|
|
10
|
+
var remoteSessionClient = require('./remoteSessionClient-CtV9mDko.cjs');
|
|
11
11
|
var ids = require('./ids-B6ZC0HGt.cjs');
|
|
12
12
|
var terminals = require('./terminals-B_bfC9c2.cjs');
|
|
13
|
-
var bootstrap = require('./bootstrap-
|
|
13
|
+
var bootstrap = require('./bootstrap-DsXp74wv.cjs');
|
|
14
14
|
var path = require('node:path');
|
|
15
15
|
|
|
16
16
|
const PERSONAL_MEMORY_SOFT_LIMIT_CHARS = 2e3;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { readFile, writeFile, appendFile, stat } from 'node:fs/promises';
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { l as logger } from './logger-
|
|
5
|
-
import { c as readPersistedSessions } from './persistence-
|
|
6
|
-
import { e as spawnDaemonSession } from './controlClient-
|
|
7
|
-
import { a as listSessions, r as readSessionTranscript, s as sessionWebUrl, g as waitForSessionKey, e as sendUserMessage, b as stopSession, d as archiveSession } from './sessionOps-
|
|
8
|
-
import { r as readRemoteTranscript, s as sendRemoteMessage, d as deliverToSession, R as RemoteSessionOpsError } from './remoteSessionClient-
|
|
4
|
+
import { l as logger } from './logger-DpqihN1f.mjs';
|
|
5
|
+
import { c as readPersistedSessions } from './persistence-jOEuAFTS.mjs';
|
|
6
|
+
import { e as spawnDaemonSession } from './controlClient-BL4hb4l3.mjs';
|
|
7
|
+
import { a as listSessions, r as readSessionTranscript, s as sessionWebUrl, g as waitForSessionKey, e as sendUserMessage, b as stopSession, d as archiveSession } from './sessionOps-D0BPWPoh.mjs';
|
|
8
|
+
import { r as readRemoteTranscript, s as sendRemoteMessage, d as deliverToSession, R as RemoteSessionOpsError } from './remoteSessionClient-BlURPulk.mjs';
|
|
9
9
|
import { i as isValidSessionId, a as isValidTerminalId } from './ids-DU6sLx4C.mjs';
|
|
10
10
|
import { l as listVhTerminals, r as readVhTerminal, s as sendToVhTerminal } from './terminals-Dlg0x3nY.mjs';
|
|
11
|
-
import { bootstrapAssistantHome, assistantPersonalMemoryPath } from './bootstrap-
|
|
11
|
+
import { bootstrapAssistantHome, assistantPersonalMemoryPath } from './bootstrap-D3vlOROj.mjs';
|
|
12
12
|
import { join, isAbsolute, normalize } from 'node:path';
|
|
13
13
|
|
|
14
14
|
const PERSONAL_MEMORY_SOFT_LIMIT_CHARS = 2e3;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
4
|
-
var controlClient = require('./controlClient-
|
|
5
|
-
var spawnHappyCLI = require('./spawnHappyCLI-
|
|
6
|
-
var persistence = require('./persistence-
|
|
7
|
-
var configuration = require('./configuration-
|
|
3
|
+
var logger = require('./logger-DK1ytCz6.cjs');
|
|
4
|
+
var controlClient = require('./controlClient-D0kGwKYx.cjs');
|
|
5
|
+
var spawnHappyCLI = require('./spawnHappyCLI-D47kX6jg.cjs');
|
|
6
|
+
var persistence = require('./persistence-BdpwWXKh.cjs');
|
|
7
|
+
var configuration = require('./configuration-B-CugKJ3.cjs');
|
|
8
8
|
var doctorReadiness = require('./doctorReadiness-Dl6yRQCy.cjs');
|
|
9
9
|
|
|
10
10
|
function extractNoSandboxFlag(args) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as logger } from './logger-
|
|
2
|
-
import { i as isDaemonRunningCurrentlyInstalledHappyVersion, a as checkIfDaemonRunningAndCleanupStaleState, s as stopDaemon } from './controlClient-
|
|
3
|
-
import { s as spawnHappyCLI } from './spawnHappyCLI-
|
|
4
|
-
import { d as readDaemonState } from './persistence-
|
|
5
|
-
import { c as configuration } from './configuration-
|
|
1
|
+
import { l as logger } from './logger-DpqihN1f.mjs';
|
|
2
|
+
import { i as isDaemonRunningCurrentlyInstalledHappyVersion, a as checkIfDaemonRunningAndCleanupStaleState, s as stopDaemon } from './controlClient-BL4hb4l3.mjs';
|
|
3
|
+
import { s as spawnHappyCLI } from './spawnHappyCLI-D1doCjkZ.mjs';
|
|
4
|
+
import { d as readDaemonState } from './persistence-jOEuAFTS.mjs';
|
|
5
|
+
import { c as configuration } from './configuration-YXw_Dcsb.mjs';
|
|
6
6
|
import { d as daemonEndpointsMatch } from './doctorReadiness-C208SMN9.mjs';
|
|
7
7
|
|
|
8
8
|
function extractNoSandboxFlag(args) {
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { randomBytes, createHash } from 'node:crypto';
|
|
2
|
+
import { promises, constants } from 'node:fs';
|
|
3
|
+
import { join, dirname, basename } from 'node:path';
|
|
4
|
+
|
|
5
|
+
const MAX_CONFIG_BYTES = 1024 * 1024;
|
|
6
|
+
const MAX_BACKUPS_PER_HARNESS = 20;
|
|
7
|
+
class ModelConfigError extends Error {
|
|
8
|
+
constructor(code, message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.code = code;
|
|
11
|
+
this.name = "ModelConfigError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function sha256(text) {
|
|
15
|
+
return createHash("sha256").update(text).digest("hex");
|
|
16
|
+
}
|
|
17
|
+
async function readConfigFile(path) {
|
|
18
|
+
let stat;
|
|
19
|
+
try {
|
|
20
|
+
stat = await promises.stat(path);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
if (error.code === "ENOENT") {
|
|
23
|
+
return { path, exists: false, content: "", hash: sha256(""), mode: null };
|
|
24
|
+
}
|
|
25
|
+
throw new ModelConfigError("read-failed", `Cannot read ${path}: ${error.message}`);
|
|
26
|
+
}
|
|
27
|
+
if (!stat.isFile()) throw new ModelConfigError("not-a-file", `${path} is not a regular file`);
|
|
28
|
+
if (stat.size > MAX_CONFIG_BYTES) throw new ModelConfigError("file-too-large", `${path} is larger than ${MAX_CONFIG_BYTES} bytes`);
|
|
29
|
+
const content = await promises.readFile(path, "utf8");
|
|
30
|
+
return { path, exists: true, content, hash: sha256(content), mode: stat.mode & 511 };
|
|
31
|
+
}
|
|
32
|
+
async function resolveWriteTarget(path) {
|
|
33
|
+
try {
|
|
34
|
+
return await promises.realpath(path);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
if (error.code === "ENOENT") {
|
|
37
|
+
try {
|
|
38
|
+
const link = await promises.readlink(path);
|
|
39
|
+
return link.startsWith("/") ? link : join(dirname(path), link);
|
|
40
|
+
} catch {
|
|
41
|
+
return path;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function atomicWriteFile(path, content, mode) {
|
|
48
|
+
const target = await resolveWriteTarget(path);
|
|
49
|
+
const dir = dirname(target);
|
|
50
|
+
await promises.mkdir(dir, { recursive: true, mode: 448 });
|
|
51
|
+
const tmp = join(dir, `.${basename(target)}.vh-tmp-${process.pid}-${randomBytes(4).toString("hex")}`);
|
|
52
|
+
const handle = await promises.open(tmp, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL, mode ?? 384);
|
|
53
|
+
try {
|
|
54
|
+
await handle.writeFile(content, "utf8");
|
|
55
|
+
await handle.sync();
|
|
56
|
+
} catch (error) {
|
|
57
|
+
await handle.close().catch(() => {
|
|
58
|
+
});
|
|
59
|
+
await promises.unlink(tmp).catch(() => {
|
|
60
|
+
});
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
await handle.close();
|
|
64
|
+
try {
|
|
65
|
+
if (mode !== null) await promises.chmod(tmp, mode);
|
|
66
|
+
await promises.rename(tmp, target);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
await promises.unlink(tmp).catch(() => {
|
|
69
|
+
});
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const dirHandle = await promises.open(dir, "r");
|
|
74
|
+
await dirHandle.sync().catch(() => {
|
|
75
|
+
});
|
|
76
|
+
await dirHandle.close();
|
|
77
|
+
} catch {
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const BACKUP_ID = /^\d{13}-[0-9a-f]{8}$/;
|
|
81
|
+
const HARNESS_DIR = /^[a-z][a-z0-9-]{0,31}$/;
|
|
82
|
+
class BackupStore {
|
|
83
|
+
constructor(root) {
|
|
84
|
+
this.root = root;
|
|
85
|
+
}
|
|
86
|
+
harnessDir(harness) {
|
|
87
|
+
if (!HARNESS_DIR.test(harness)) throw new ModelConfigError("invalid-harness", "Invalid harness");
|
|
88
|
+
return join(this.root, harness);
|
|
89
|
+
}
|
|
90
|
+
async create(harness, reason, files, now = Date.now()) {
|
|
91
|
+
const id = `${now}-${randomBytes(4).toString("hex")}`;
|
|
92
|
+
const dir = join(this.harnessDir(harness), id);
|
|
93
|
+
await promises.mkdir(dir, { recursive: true, mode: 448 });
|
|
94
|
+
const manifest = { id, createdAt: now, reason, files: files.map((f, i) => ({ path: f.path, blob: f.content === null ? null : `f${i}`, mode: f.mode })) };
|
|
95
|
+
for (const [i, file] of files.entries()) {
|
|
96
|
+
if (file.content !== null) await promises.writeFile(join(dir, `f${i}`), file.content, { encoding: "utf8", mode: 384 });
|
|
97
|
+
}
|
|
98
|
+
await promises.writeFile(join(dir, "manifest.json"), JSON.stringify(manifest, null, 2), { encoding: "utf8", mode: 384 });
|
|
99
|
+
await this.prune(harness);
|
|
100
|
+
return { id, createdAt: now, reason, files: files.map((f) => f.path) };
|
|
101
|
+
}
|
|
102
|
+
async list(harness) {
|
|
103
|
+
let names;
|
|
104
|
+
try {
|
|
105
|
+
names = await promises.readdir(this.harnessDir(harness));
|
|
106
|
+
} catch {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
const entries = [];
|
|
110
|
+
for (const name of names.filter((n) => BACKUP_ID.test(n))) {
|
|
111
|
+
try {
|
|
112
|
+
const manifest = JSON.parse(await promises.readFile(join(this.harnessDir(harness), name, "manifest.json"), "utf8"));
|
|
113
|
+
entries.push({ id: name, createdAt: Number(manifest.createdAt) || 0, reason: String(manifest.reason ?? ""), files: (manifest.files ?? []).map((f) => f.path) });
|
|
114
|
+
} catch {
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return entries.sort((a, b) => b.createdAt - a.createdAt);
|
|
118
|
+
}
|
|
119
|
+
async read(harness, id) {
|
|
120
|
+
if (!BACKUP_ID.test(id)) throw new ModelConfigError("invalid-backup", "Invalid backup id");
|
|
121
|
+
const dir = join(this.harnessDir(harness), id);
|
|
122
|
+
let manifest;
|
|
123
|
+
try {
|
|
124
|
+
manifest = JSON.parse(await promises.readFile(join(dir, "manifest.json"), "utf8"));
|
|
125
|
+
} catch {
|
|
126
|
+
throw new ModelConfigError("backup-not-found", "Backup not found");
|
|
127
|
+
}
|
|
128
|
+
const out = [];
|
|
129
|
+
for (const file of manifest.files) {
|
|
130
|
+
out.push({
|
|
131
|
+
path: file.path,
|
|
132
|
+
content: file.blob === null ? null : await promises.readFile(join(dir, file.blob), "utf8"),
|
|
133
|
+
mode: typeof file.mode === "number" ? file.mode : null
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
async prune(harness) {
|
|
139
|
+
const entries = await this.list(harness);
|
|
140
|
+
for (const stale of entries.slice(MAX_BACKUPS_PER_HARNESS)) {
|
|
141
|
+
await promises.rm(join(this.harnessDir(harness), stale.id), { recursive: true, force: true });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { BackupStore as B, ModelConfigError as M, atomicWriteFile as a, readConfigFile as r, sha256 as s };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node_crypto = require('node:crypto');
|
|
4
|
+
var node_fs = require('node:fs');
|
|
5
|
+
var path = require('node:path');
|
|
6
|
+
|
|
7
|
+
const MAX_CONFIG_BYTES = 1024 * 1024;
|
|
8
|
+
const MAX_BACKUPS_PER_HARNESS = 20;
|
|
9
|
+
class ModelConfigError extends Error {
|
|
10
|
+
constructor(code, message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.name = "ModelConfigError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function sha256(text) {
|
|
17
|
+
return node_crypto.createHash("sha256").update(text).digest("hex");
|
|
18
|
+
}
|
|
19
|
+
async function readConfigFile(path) {
|
|
20
|
+
let stat;
|
|
21
|
+
try {
|
|
22
|
+
stat = await node_fs.promises.stat(path);
|
|
23
|
+
} catch (error) {
|
|
24
|
+
if (error.code === "ENOENT") {
|
|
25
|
+
return { path, exists: false, content: "", hash: sha256(""), mode: null };
|
|
26
|
+
}
|
|
27
|
+
throw new ModelConfigError("read-failed", `Cannot read ${path}: ${error.message}`);
|
|
28
|
+
}
|
|
29
|
+
if (!stat.isFile()) throw new ModelConfigError("not-a-file", `${path} is not a regular file`);
|
|
30
|
+
if (stat.size > MAX_CONFIG_BYTES) throw new ModelConfigError("file-too-large", `${path} is larger than ${MAX_CONFIG_BYTES} bytes`);
|
|
31
|
+
const content = await node_fs.promises.readFile(path, "utf8");
|
|
32
|
+
return { path, exists: true, content, hash: sha256(content), mode: stat.mode & 511 };
|
|
33
|
+
}
|
|
34
|
+
async function resolveWriteTarget(path$1) {
|
|
35
|
+
try {
|
|
36
|
+
return await node_fs.promises.realpath(path$1);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
if (error.code === "ENOENT") {
|
|
39
|
+
try {
|
|
40
|
+
const link = await node_fs.promises.readlink(path$1);
|
|
41
|
+
return link.startsWith("/") ? link : path.join(path.dirname(path$1), link);
|
|
42
|
+
} catch {
|
|
43
|
+
return path$1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async function atomicWriteFile(path$1, content, mode) {
|
|
50
|
+
const target = await resolveWriteTarget(path$1);
|
|
51
|
+
const dir = path.dirname(target);
|
|
52
|
+
await node_fs.promises.mkdir(dir, { recursive: true, mode: 448 });
|
|
53
|
+
const tmp = path.join(dir, `.${path.basename(target)}.vh-tmp-${process.pid}-${node_crypto.randomBytes(4).toString("hex")}`);
|
|
54
|
+
const handle = await node_fs.promises.open(tmp, node_fs.constants.O_WRONLY | node_fs.constants.O_CREAT | node_fs.constants.O_EXCL, mode ?? 384);
|
|
55
|
+
try {
|
|
56
|
+
await handle.writeFile(content, "utf8");
|
|
57
|
+
await handle.sync();
|
|
58
|
+
} catch (error) {
|
|
59
|
+
await handle.close().catch(() => {
|
|
60
|
+
});
|
|
61
|
+
await node_fs.promises.unlink(tmp).catch(() => {
|
|
62
|
+
});
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
await handle.close();
|
|
66
|
+
try {
|
|
67
|
+
if (mode !== null) await node_fs.promises.chmod(tmp, mode);
|
|
68
|
+
await node_fs.promises.rename(tmp, target);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
await node_fs.promises.unlink(tmp).catch(() => {
|
|
71
|
+
});
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
const dirHandle = await node_fs.promises.open(dir, "r");
|
|
76
|
+
await dirHandle.sync().catch(() => {
|
|
77
|
+
});
|
|
78
|
+
await dirHandle.close();
|
|
79
|
+
} catch {
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const BACKUP_ID = /^\d{13}-[0-9a-f]{8}$/;
|
|
83
|
+
const HARNESS_DIR = /^[a-z][a-z0-9-]{0,31}$/;
|
|
84
|
+
class BackupStore {
|
|
85
|
+
constructor(root) {
|
|
86
|
+
this.root = root;
|
|
87
|
+
}
|
|
88
|
+
harnessDir(harness) {
|
|
89
|
+
if (!HARNESS_DIR.test(harness)) throw new ModelConfigError("invalid-harness", "Invalid harness");
|
|
90
|
+
return path.join(this.root, harness);
|
|
91
|
+
}
|
|
92
|
+
async create(harness, reason, files, now = Date.now()) {
|
|
93
|
+
const id = `${now}-${node_crypto.randomBytes(4).toString("hex")}`;
|
|
94
|
+
const dir = path.join(this.harnessDir(harness), id);
|
|
95
|
+
await node_fs.promises.mkdir(dir, { recursive: true, mode: 448 });
|
|
96
|
+
const manifest = { id, createdAt: now, reason, files: files.map((f, i) => ({ path: f.path, blob: f.content === null ? null : `f${i}`, mode: f.mode })) };
|
|
97
|
+
for (const [i, file] of files.entries()) {
|
|
98
|
+
if (file.content !== null) await node_fs.promises.writeFile(path.join(dir, `f${i}`), file.content, { encoding: "utf8", mode: 384 });
|
|
99
|
+
}
|
|
100
|
+
await node_fs.promises.writeFile(path.join(dir, "manifest.json"), JSON.stringify(manifest, null, 2), { encoding: "utf8", mode: 384 });
|
|
101
|
+
await this.prune(harness);
|
|
102
|
+
return { id, createdAt: now, reason, files: files.map((f) => f.path) };
|
|
103
|
+
}
|
|
104
|
+
async list(harness) {
|
|
105
|
+
let names;
|
|
106
|
+
try {
|
|
107
|
+
names = await node_fs.promises.readdir(this.harnessDir(harness));
|
|
108
|
+
} catch {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
const entries = [];
|
|
112
|
+
for (const name of names.filter((n) => BACKUP_ID.test(n))) {
|
|
113
|
+
try {
|
|
114
|
+
const manifest = JSON.parse(await node_fs.promises.readFile(path.join(this.harnessDir(harness), name, "manifest.json"), "utf8"));
|
|
115
|
+
entries.push({ id: name, createdAt: Number(manifest.createdAt) || 0, reason: String(manifest.reason ?? ""), files: (manifest.files ?? []).map((f) => f.path) });
|
|
116
|
+
} catch {
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return entries.sort((a, b) => b.createdAt - a.createdAt);
|
|
120
|
+
}
|
|
121
|
+
async read(harness, id) {
|
|
122
|
+
if (!BACKUP_ID.test(id)) throw new ModelConfigError("invalid-backup", "Invalid backup id");
|
|
123
|
+
const dir = path.join(this.harnessDir(harness), id);
|
|
124
|
+
let manifest;
|
|
125
|
+
try {
|
|
126
|
+
manifest = JSON.parse(await node_fs.promises.readFile(path.join(dir, "manifest.json"), "utf8"));
|
|
127
|
+
} catch {
|
|
128
|
+
throw new ModelConfigError("backup-not-found", "Backup not found");
|
|
129
|
+
}
|
|
130
|
+
const out = [];
|
|
131
|
+
for (const file of manifest.files) {
|
|
132
|
+
out.push({
|
|
133
|
+
path: file.path,
|
|
134
|
+
content: file.blob === null ? null : await node_fs.promises.readFile(path.join(dir, file.blob), "utf8"),
|
|
135
|
+
mode: typeof file.mode === "number" ? file.mode : null
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return out;
|
|
139
|
+
}
|
|
140
|
+
async prune(harness) {
|
|
141
|
+
const entries = await this.list(harness);
|
|
142
|
+
for (const stale of entries.slice(MAX_BACKUPS_PER_HARNESS)) {
|
|
143
|
+
await node_fs.promises.rm(path.join(this.harnessDir(harness), stale.id), { recursive: true, force: true });
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
exports.BackupStore = BackupStore;
|
|
149
|
+
exports.ModelConfigError = ModelConfigError;
|
|
150
|
+
exports.atomicWriteFile = atomicWriteFile;
|
|
151
|
+
exports.readConfigFile = readConfigFile;
|
|
152
|
+
exports.sha256 = sha256;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node_child_process = require('node:child_process');
|
|
4
|
+
var node_util = require('node:util');
|
|
5
|
+
var promises = require('node:fs/promises');
|
|
6
|
+
var path = require('node:path');
|
|
7
|
+
var os = require('node:os');
|
|
8
|
+
|
|
9
|
+
const FS_MKDIR_CAPABILITY_VERSION = 1;
|
|
10
|
+
const within = (root, path$1) => {
|
|
11
|
+
const rel = path.relative(root, path$1);
|
|
12
|
+
return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel);
|
|
13
|
+
};
|
|
14
|
+
function mkdirTarget(input, homeDir) {
|
|
15
|
+
if (typeof input !== "string" || !input.trim() || input.includes("\0")) throw new Error("invalid-path");
|
|
16
|
+
const raw = input.trim();
|
|
17
|
+
if (raw.split(/[\\/]+/).includes("..")) throw new Error("invalid-path");
|
|
18
|
+
const path$1 = raw === "~" ? homeDir : raw.startsWith("~/") ? path.join(homeDir, raw.slice(2)) : raw;
|
|
19
|
+
if (!path.isAbsolute(path$1)) throw new Error("invalid-path");
|
|
20
|
+
const normalized = path.join(path$1, ".").replace(new RegExp(`\\${path.sep}+$`), "") || path.sep;
|
|
21
|
+
if (!within(homeDir, normalized)) throw new Error("outside-home");
|
|
22
|
+
return normalized;
|
|
23
|
+
}
|
|
24
|
+
async function closestExisting(path$1) {
|
|
25
|
+
for (let current = path$1; ; current = path.dirname(current)) {
|
|
26
|
+
try {
|
|
27
|
+
await promises.stat(current);
|
|
28
|
+
return current;
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (error.code !== "ENOENT" || path.dirname(current) === current) throw error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function fsMkdir(input, options = {}, homeDir = os.homedir(), gitInit = (directory) => node_util.promisify(node_child_process.execFile)("git", ["init", "-q", directory], { timeout: 2e4 })) {
|
|
35
|
+
const path = mkdirTarget(input, homeDir);
|
|
36
|
+
const realHome = await promises.realpath(homeDir).catch(() => homeDir);
|
|
37
|
+
try {
|
|
38
|
+
const anchor = await closestExisting(path);
|
|
39
|
+
if (anchor === path) throw new Error("exists");
|
|
40
|
+
const realAnchor = await promises.realpath(anchor);
|
|
41
|
+
if (realAnchor !== realHome && !within(realHome, realAnchor)) throw new Error("outside-home");
|
|
42
|
+
if (!(await promises.stat(anchor)).isDirectory()) throw new Error("not-a-directory");
|
|
43
|
+
await promises.mkdir(path, { recursive: true });
|
|
44
|
+
} catch (error) {
|
|
45
|
+
const code = error?.code;
|
|
46
|
+
if (code === "EACCES" || code === "EPERM" || code === "EROFS") throw new Error("permission-denied");
|
|
47
|
+
if (code === "EEXIST") throw new Error("exists");
|
|
48
|
+
if (code === "ENOTDIR") throw new Error("not-a-directory");
|
|
49
|
+
throw error instanceof Error ? error : new Error("fs-failed");
|
|
50
|
+
}
|
|
51
|
+
const git = options.gitInit === true ? await gitInit(path).then(() => true, () => false) : false;
|
|
52
|
+
return { path, created: true, git };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
exports.FS_MKDIR_CAPABILITY_VERSION = FS_MKDIR_CAPABILITY_VERSION;
|
|
56
|
+
exports.fsMkdir = fsMkdir;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import { realpath, stat, mkdir } from 'node:fs/promises';
|
|
4
|
+
import { join, isAbsolute, sep, dirname, relative } from 'node:path';
|
|
5
|
+
import { homedir } from 'node:os';
|
|
6
|
+
|
|
7
|
+
const FS_MKDIR_CAPABILITY_VERSION = 1;
|
|
8
|
+
const within = (root, path) => {
|
|
9
|
+
const rel = relative(root, path);
|
|
10
|
+
return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
|
|
11
|
+
};
|
|
12
|
+
function mkdirTarget(input, homeDir) {
|
|
13
|
+
if (typeof input !== "string" || !input.trim() || input.includes("\0")) throw new Error("invalid-path");
|
|
14
|
+
const raw = input.trim();
|
|
15
|
+
if (raw.split(/[\\/]+/).includes("..")) throw new Error("invalid-path");
|
|
16
|
+
const path = raw === "~" ? homeDir : raw.startsWith("~/") ? join(homeDir, raw.slice(2)) : raw;
|
|
17
|
+
if (!isAbsolute(path)) throw new Error("invalid-path");
|
|
18
|
+
const normalized = join(path, ".").replace(new RegExp(`\\${sep}+$`), "") || sep;
|
|
19
|
+
if (!within(homeDir, normalized)) throw new Error("outside-home");
|
|
20
|
+
return normalized;
|
|
21
|
+
}
|
|
22
|
+
async function closestExisting(path) {
|
|
23
|
+
for (let current = path; ; current = dirname(current)) {
|
|
24
|
+
try {
|
|
25
|
+
await stat(current);
|
|
26
|
+
return current;
|
|
27
|
+
} catch (error) {
|
|
28
|
+
if (error.code !== "ENOENT" || dirname(current) === current) throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function fsMkdir(input, options = {}, homeDir = homedir(), gitInit = (directory) => promisify(execFile)("git", ["init", "-q", directory], { timeout: 2e4 })) {
|
|
33
|
+
const path = mkdirTarget(input, homeDir);
|
|
34
|
+
const realHome = await realpath(homeDir).catch(() => homeDir);
|
|
35
|
+
try {
|
|
36
|
+
const anchor = await closestExisting(path);
|
|
37
|
+
if (anchor === path) throw new Error("exists");
|
|
38
|
+
const realAnchor = await realpath(anchor);
|
|
39
|
+
if (realAnchor !== realHome && !within(realHome, realAnchor)) throw new Error("outside-home");
|
|
40
|
+
if (!(await stat(anchor)).isDirectory()) throw new Error("not-a-directory");
|
|
41
|
+
await mkdir(path, { recursive: true });
|
|
42
|
+
} catch (error) {
|
|
43
|
+
const code = error?.code;
|
|
44
|
+
if (code === "EACCES" || code === "EPERM" || code === "EROFS") throw new Error("permission-denied");
|
|
45
|
+
if (code === "EEXIST") throw new Error("exists");
|
|
46
|
+
if (code === "ENOTDIR") throw new Error("not-a-directory");
|
|
47
|
+
throw error instanceof Error ? error : new Error("fs-failed");
|
|
48
|
+
}
|
|
49
|
+
const git = options.gitInit === true ? await gitInit(path).then(() => true, () => false) : false;
|
|
50
|
+
return { path, created: true, git };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { FS_MKDIR_CAPABILITY_VERSION as F, fsMkdir as f };
|
|
@@ -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-D1doCjkZ.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-YXw_Dcsb.mjs';
|
|
8
|
+
import { g as getLocalHappyAgentCredentialPath, r as readLocalHappyAgentCredentials } from './localHappyAgentAuth-D3rQDRd9.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-DpqihN1f.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-CKj8zndE.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-D47kX6jg.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-B-CugKJ3.cjs');
|
|
10
|
+
var localHappyAgentAuth = require('./localHappyAgentAuth-SD6GM97y.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-DK1ytCz6.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-BfeqAzyJ.cjs');
|
|
22
22
|
require('node:fs/promises');
|
|
23
23
|
|
|
24
24
|
const ResumableMetadataSchema = z.z.object({
|