very-happy-cli 0.2.192 → 0.2.194
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-CGHTDJd9.mjs → AcpBackend-C3Kx0QJb.mjs} +3 -3
- package/dist/{AcpBackend-BQO4ShOy.cjs → AcpBackend-DJzsue14.cjs} +3 -3
- package/dist/{AcpSessionManager-LlUMmcpB.cjs → AcpSessionManager-Bc3iafB1.cjs} +2 -2
- package/dist/{AcpSessionManager-G0xD6Jbq.mjs → AcpSessionManager-SteuoqMY.mjs} +2 -2
- package/dist/{BasePermissionHandler-BmTIg376.mjs → BasePermissionHandler-D2pNcAXn.mjs} +1 -1
- package/dist/{BasePermissionHandler-N6Ip3tFt.cjs → BasePermissionHandler-DKzNFVCh.cjs} +1 -1
- package/dist/{account-DtaouikP.cjs → account-ByVjlvFj.cjs} +84 -27
- package/dist/{account-CCVT-HO_.mjs → account-DC2YyU24.mjs} +84 -27
- package/dist/{accountService-Dd9uqde2.mjs → accountService-Cd7bnkfd.mjs} +369 -19
- package/dist/{accountService-Bddy0zwL.cjs → accountService-CuUSJDhP.cjs} +369 -19
- package/dist/{acpSessionResume-BWEUxNtC.mjs → acpSessionResume-B6VClxKQ.mjs} +1 -1
- package/dist/{acpSessionResume-BnHDk5eD.cjs → acpSessionResume-DHHgbNnk.cjs} +1 -1
- package/dist/{agentHome-B0VnjkZW.mjs → agentHome-9caXwo7k.mjs} +4 -4
- package/dist/{agentHome-CqQ29YY7.cjs → agentHome-Bov1aHYS.cjs} +4 -4
- package/dist/{api-_LeBScjg.mjs → api-aE60mNjs.mjs} +10 -10
- package/dist/{api-hMDsC6Wg.cjs → api-wYwQCJml.cjs} +10 -10
- package/dist/{apiMachine-CgRldeJ6.mjs → apiMachine-CvNB38Xg.mjs} +36 -19
- package/dist/{apiMachine-CqW2m6Zr.cjs → apiMachine-DwaqfM9Q.cjs} +36 -19
- package/dist/{attachmentContent-CyptLIfq.mjs → attachmentContent-C2ymY_-w.mjs} +2 -2
- package/dist/{attachmentContent-BEeT2J5n.cjs → attachmentContent-DB8ZsxGE.cjs} +2 -2
- package/dist/{auth-CFQikywl.mjs → auth-BYtmGgE1.mjs} +8 -8
- package/dist/{auth-CA1OClsW.cjs → auth-Bce0Zk3q.cjs} +8 -8
- package/dist/{auth-DL8_J9vu.mjs → auth-CWO6cQ4G.mjs} +5 -5
- package/dist/{auth-C9NvNHhL.cjs → auth-boIcb7iq.cjs} +5 -5
- package/dist/{auto-uQOxlxLp.cjs → auto-AaggdihK.cjs} +24 -22
- package/dist/{auto-CKI05w1D.mjs → auto-B-kopWQx.mjs} +24 -22
- package/dist/{bootstrap-DaZ0Np7X.mjs → bootstrap-CiWwfHB2.mjs} +2 -2
- package/dist/{bootstrap-DsZGc69k.cjs → bootstrap-kywZ0tvD.cjs} +2 -2
- package/dist/{browser-BUIaSHK2.mjs → browser-CFfZM3yg.mjs} +1 -1
- package/dist/{browser-Ft0ASDm7.cjs → browser-Do2MFdq6.cjs} +1 -1
- package/dist/{claudeAccountEnv-ON24i0qv.mjs → claudeAccountEnv-BL1pR_37.mjs} +2 -1
- package/dist/{claudeAccountEnv-BOBpJ3k8.cjs → claudeAccountEnv-CEX_EMZr.cjs} +2 -1
- package/dist/{claudeLocal-B1ZVtryl.mjs → claudeLocal-B47NjZfB.mjs} +5 -5
- package/dist/{claudeLocal-BMf9t4Fa.cjs → claudeLocal-DLd8ogcH.cjs} +5 -5
- package/dist/{claudeLocalLauncher-Bp8bqF4y.mjs → claudeLocalLauncher-5DDuHpCD.mjs} +10 -10
- package/dist/{claudeLocalLauncher-C8TeJcfF.cjs → claudeLocalLauncher-D_UTQ4o_.cjs} +10 -10
- package/dist/{claudeSessionFork-YiktY55n.cjs → claudeSessionFork-4g6-Sk3Q.cjs} +104 -38
- package/dist/{claudeSessionFork-8AA47z8Y.mjs → claudeSessionFork-BrJTncNL.mjs} +105 -40
- package/dist/{client-Crh8_cNx.cjs → client-BIg2LPVx.cjs} +2 -2
- package/dist/{client-CFHZfh9x.cjs → client-BfDga3xi.cjs} +4 -4
- package/dist/{client-Bm4oKvW7.mjs → client-Cbxr9VUE.mjs} +4 -2
- package/dist/{client-D8XROyZc.cjs → client-CsfPUxLy.cjs} +4 -2
- package/dist/{client-BmPaBnDK.mjs → client-DS5JEsHs.mjs} +4 -4
- package/dist/{client-Cxlp_D4I.mjs → client-OjYRPhZs.mjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +16 -16
- package/dist/codex/happyMcpStdioBridge.mjs +16 -16
- package/dist/codexAccount-BDQjRbtI.cjs +1028 -0
- package/dist/codexAccount-NOX5pmQf.mjs +1015 -0
- package/dist/{codexAppServerClient-q8GHQhyC.cjs → codexAppServerClient-Bj5vN7sb.cjs} +18 -7
- package/dist/{codexAppServerClient-BWJbLCQn.mjs → codexAppServerClient-HKAm8f_D.mjs} +18 -7
- package/dist/{codexCommand-BfXfRQr4.mjs → codexCommand-655pR6CR.mjs} +188 -58
- package/dist/{codexCommand-BgpGg-Zy.cjs → codexCommand-DtbDjHZp.cjs} +187 -57
- package/dist/{codexTermination-CVUF0X75.cjs → codexTermination-CX_FHKT5.cjs} +1 -1
- package/dist/{codexTermination-s9fd1gkA.mjs → codexTermination-DxLR-bb5.mjs} +1 -1
- package/dist/{codexThreadFork-5kwoKjMu.cjs → codexThreadFork-C6ZmcT2z.cjs} +22 -1
- package/dist/{codexThreadFork-DobPd19R.mjs → codexThreadFork-CVzAqELg.mjs} +22 -2
- package/dist/{config-BF8XgLyc.mjs → config-CIvXVGlP.mjs} +3 -3
- package/dist/{config-BAjyTyYp.cjs → config-Cv-A-Bw0.cjs} +3 -3
- package/dist/{configuration-CXEVKAyF.cjs → configuration-2Pbg3a0H.cjs} +1 -1
- package/dist/{configuration-IhRiLDVe.mjs → configuration-rTcdHkhE.mjs} +1 -1
- package/dist/{connect-LZh1gr08.mjs → connect-B9Bl68PF.mjs} +13 -13
- package/dist/{connect-rCS56arw.cjs → connect-BAYNAE8A.cjs} +13 -13
- package/dist/{context-DO6F5YwH.mjs → context-C7QarZMk.mjs} +1 -1
- package/dist/{context-3_S_mWz9.cjs → context-CLTyu_tQ.cjs} +1 -1
- package/dist/{controlClient-8ILulwjc.mjs → controlClient-BIdGnYBo.mjs} +3 -3
- package/dist/{controlClient-j7p5p3_7.cjs → controlClient-CIqHL07h.cjs} +3 -3
- package/dist/{createSessionMetadata-DwdD_uVo.cjs → createSessionMetadata-BHjzRzPc.cjs} +2 -2
- package/dist/{createSessionMetadata-oyaTZm1b.mjs → createSessionMetadata-PrN-dT7K.mjs} +2 -2
- package/dist/{daemonAccounts-BCjDgoNt.cjs → daemonAccounts-CpGDY_4k.cjs} +4 -1
- package/dist/{daemonAccounts-BJgt6IJe.mjs → daemonAccounts-DwPwKxvv.mjs} +5 -2
- package/dist/{defaultPermissionMode-BFShzF55.cjs → defaultPermissionMode-BakXiqRr.cjs} +1 -1
- package/dist/{defaultPermissionMode-Lt3PUCwY.mjs → defaultPermissionMode-DF5AfeBb.mjs} +1 -1
- package/dist/{deterministicJson-Dfp-7wUZ.mjs → deterministicJson-DFwJ57jR.mjs} +13 -13
- package/dist/{deterministicJson-DUN0v3St.cjs → deterministicJson-ZBFn1jtS.cjs} +13 -13
- package/dist/{doctor-B_UwMcVT.mjs → doctor-CFYpAXvt.mjs} +7 -7
- package/dist/{doctor-FgUYTbAT.cjs → doctor-yyM-zii7.cjs} +7 -7
- package/dist/{downloadTarget-C0d6jRx-.mjs → downloadTarget-CVPBZMnY.mjs} +6 -6
- package/dist/{downloadTarget-BrrQEDxg.cjs → downloadTarget-DlmqPQp9.cjs} +6 -6
- package/dist/{ensureDaemonRunning-KUMFfIil.mjs → ensureDaemonRunning-B6Y-CMWe.mjs} +5 -5
- package/dist/{ensureDaemonRunning-Cq4FYI5Q.cjs → ensureDaemonRunning-D2ny0yon.cjs} +5 -5
- package/dist/{handleResumeCommand-Cl9GIL5F.cjs → handleResumeCommand-D-mGugcu.cjs} +5 -5
- package/dist/{handleResumeCommand-BGhVo3QH.mjs → handleResumeCommand-DlrDcV5B.mjs} +5 -5
- package/dist/{index-CQ_hLLCj.cjs → index-2Fcq3AGX.cjs} +3 -3
- package/dist/{index-CRipkiqo.cjs → index-5c33fqLQ.cjs} +4 -4
- package/dist/{index-JQDyJ3Li.mjs → index-BJsenPFp.mjs} +3 -3
- package/dist/{index-BzAYnYct.cjs → index-BUFrKZeQ.cjs} +198 -108
- package/dist/{index-D8ODb0_U.cjs → index-BWvmUCQF.cjs} +42 -42
- package/dist/{index-v5EmjT8l.mjs → index-Bi3dVJ0S.mjs} +4 -4
- package/dist/{index-CZaLMmPC.cjs → index-CPkSLWP_.cjs} +4 -4
- package/dist/{index-DYD3GM1m.mjs → index-D1YnIih6.mjs} +195 -109
- package/dist/{index-BjXjMhGY.mjs → index-DEN6vfEY.mjs} +4 -4
- package/dist/{index-Ca1Tt96A.mjs → index-DuDD9khO.mjs} +43 -43
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-ClUA9tbC.cjs → install-BOA4nEbm.cjs} +3 -3
- package/dist/{install-D6EHRtAN.mjs → install-BVYL-wSO.mjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +97 -25
- package/dist/lib.d.mts +97 -25
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-DqoN7zH4.cjs → lidState-DYeb7Wud.cjs} +1 -1
- package/dist/{lidState-CZOXXdzv.mjs → lidState-zy20u7T3.mjs} +1 -1
- package/dist/{localHappyAgentAuth-YHxDZ4x4.mjs → localHappyAgentAuth-CBsX08VJ.mjs} +1 -1
- package/dist/{localHappyAgentAuth-BnGCpHRX.cjs → localHappyAgentAuth-CScN2McN.cjs} +1 -1
- package/dist/{logger-8su64lqR.cjs → logger-CepF8C5Z.cjs} +2 -2
- package/dist/{logger-Fd_rNvgd.mjs → logger-SGCwRIV5.mjs} +2 -2
- package/dist/{machineMetadata-1HIIC7Bc.mjs → machineMetadata-ClJfd7ay.mjs} +3 -3
- package/dist/{machineMetadata-DYXt3p6u.cjs → machineMetadata-ObK4hjF0.cjs} +3 -3
- package/dist/{main-BI6GIzUL.mjs → main-C7ZcZVBY.mjs} +47 -47
- package/dist/{main-C_GrcYkn.cjs → main-mhXOpUV7.cjs} +47 -47
- package/dist/{mcp-XGoxywno.mjs → mcp-BuCpkYTY.mjs} +18 -18
- package/dist/{mcp-BycIv9oQ.cjs → mcp-Zz7m0j8A.cjs} +18 -18
- package/dist/{mirrorProtocol-DXT3rv7T.mjs → mirrorProtocol-B0H9UTBM.mjs} +3 -3
- package/dist/{mirrorProtocol-DVnB8EO8.cjs → mirrorProtocol-IhICxf0K.cjs} +3 -3
- package/dist/{package-iuLlSiSF.cjs → package-C7WgesIw.cjs} +7 -7
- package/dist/{package-6KkRAops.mjs → package-Q_ELj5DL.mjs} +7 -7
- package/dist/{panels-B5Di2zb2.mjs → panels-Cm69UXgE.mjs} +5 -5
- package/dist/{panels-0C89q0Tu.cjs → panels-yyxpwZnk.cjs} +5 -5
- package/dist/{peerTools-CANTX_mG.cjs → peerTools-BcZAbqBL.cjs} +5 -5
- package/dist/{peerTools-CKJ-IDM4.mjs → peerTools-DUg9RduG.mjs} +5 -5
- package/dist/{persistence-B4ttN-fR.cjs → persistence-D0gNvqXe.cjs} +2 -2
- package/dist/{persistence-DWcHe035.mjs → persistence-mr4Y484W.mjs} +2 -2
- package/dist/{piRunnerArgs-Bl5GpBoN.mjs → piRunnerArgs-CGjpl4iF.mjs} +1 -1
- package/dist/{piRunnerArgs-BOkfxyak.cjs → piRunnerArgs-DK_DDkYW.cjs} +1 -1
- package/dist/{piRuntime-DzrIiZU8.cjs → piRuntime-CtZRNOEb.cjs} +1 -1
- package/dist/{piRuntime-BhwxzdQf.mjs → piRuntime-HUA19wG8.mjs} +1 -1
- package/dist/{piTerminal-DnA2CbGr.mjs → piTerminal-Bgy1W9mA.mjs} +20 -20
- package/dist/{piTerminal-BdS7ol7v.cjs → piTerminal-D9OPouek.cjs} +20 -20
- package/dist/{pushNotifications-BqFoLye2.cjs → pushNotifications-CH0XVPQe.cjs} +3 -3
- package/dist/{pushNotifications-DkQ0yvFs.mjs → pushNotifications-DjEl8G0a.mjs} +3 -3
- package/dist/{query-BQ4br3yn.cjs → query-Df3WhSA0.cjs} +1 -1
- package/dist/{query-BRJYSkb1.mjs → query-DmIo5OXf.mjs} +1 -1
- package/dist/{rateLimitReporter-BRbYkmuP.mjs → rateLimitReporter-B_PZClib.mjs} +3 -3
- package/dist/{rateLimitReporter-DK5SQuCc.cjs → rateLimitReporter-M_IKRRS7.cjs} +3 -3
- package/dist/{rateLimitWindows-DBfiuYeg.cjs → rateLimitWindows-B9PERFm1.cjs} +1 -1
- package/dist/{rateLimitWindows-Da5AR-4u.mjs → rateLimitWindows-a2yE3kCv.mjs} +1 -1
- package/dist/{registerCommonHandlers-yQ7Ru-l0.mjs → registerCommonHandlers-CND00Dpj.mjs} +2 -2
- package/dist/{registerCommonHandlers-m6pxxf2J.cjs → registerCommonHandlers-D4uXC0he.cjs} +2 -2
- package/dist/{registerKillSessionHandler-BDNpi7YO.mjs → registerKillSessionHandler-CwyHwm_n.mjs} +6 -6
- package/dist/{registerKillSessionHandler-BAOIa_Fs.cjs → registerKillSessionHandler-DQKsD9CW.cjs} +6 -6
- package/dist/{remoteSessionClient-iJMXRN_D.cjs → remoteSessionClient-DOWgca08.cjs} +5 -5
- package/dist/{remoteSessionClient-CZ7aaNgj.mjs → remoteSessionClient-mIr_9OL_.mjs} +5 -5
- package/dist/{reportProgressTool-DpFs7pSe.cjs → reportProgressTool-BLw2_Ohi.cjs} +3 -3
- package/dist/{reportProgressTool-DfQhPu0s.mjs → reportProgressTool-DTKlUlHv.mjs} +3 -3
- package/dist/{run-p-xp1_HY.cjs → run-1V6DLzTY.cjs} +178 -847
- package/dist/{run-CwN28mcj.mjs → run-bfxXYL5N.mjs} +176 -845
- package/dist/{runClaude-DRKtAGTm.mjs → runClaude-BgvDhl2p.mjs} +25 -25
- package/dist/{runClaude-D6U1Z575.cjs → runClaude-DuFgZZwO.cjs} +25 -25
- package/dist/{runClaudeDeps-BheVcIlD.mjs → runClaudeDeps-CX7GtH7O.mjs} +46 -46
- package/dist/{runClaudeDeps-Dkofokgb.cjs → runClaudeDeps-DeVinBmE.cjs} +41 -41
- package/dist/{runGemini-owbvhFbi.mjs → runGemini-Cd27u-7R.mjs} +33 -33
- package/dist/{runGemini-C8q3YCc0.cjs → runGemini-DiYSk3s1.cjs} +33 -33
- package/dist/{runOpenClaw-Dky3-mjO.mjs → runOpenClaw-CWkkfRSo.mjs} +18 -18
- package/dist/{runOpenClaw-DGeN66-t.cjs → runOpenClaw-DyQnBzpy.cjs} +18 -18
- package/dist/{sandbox-D2CPyoCA.cjs → sandbox-BAXXYewR.cjs} +4 -4
- package/dist/{sandbox-sq_wy9Gl.mjs → sandbox-C35zDrkc.mjs} +4 -4
- package/dist/selfCheck-DKMF0Dyu.mjs +88 -0
- package/dist/{selfCheck-BgLvQKSt.cjs → selfCheck-R71q-x7u.cjs} +39 -39
- package/dist/{send-Cd10YhXh.cjs → send-3Wa9th3D.cjs} +8 -8
- package/dist/{send-K9vg-8t-.mjs → send-DiSaR5Bk.mjs} +8 -8
- package/dist/{server-DRrV64r0.cjs → server-BJu2bFBy.cjs} +6 -6
- package/dist/{server-De4W1zuK.mjs → server-BxMJxaE6.mjs} +4 -4
- package/dist/{sessionLock-BDtSzzKS.cjs → sessionLock-BJ1ngLgm.cjs} +3 -3
- package/dist/{sessionLock-Dl6i7IgA.mjs → sessionLock-dbi4JPhP.mjs} +3 -3
- package/dist/{sessionOps-DvnEH4PL.cjs → sessionOps-BUlpeaUe.cjs} +50 -8
- package/dist/{sessionOps-gU88-W9F.mjs → sessionOps-C9wRmCBg.mjs} +51 -9
- package/dist/{sessionProvider-CKcIo7KO.mjs → sessionProvider-BEHfI5gs.mjs} +11 -9
- package/dist/{sessionProvider-CbSZeZrl.cjs → sessionProvider-DYD6JepE.cjs} +11 -9
- package/dist/{sessionScanner-7RtcCeyD.cjs → sessionScanner-BwbjEoSf.cjs} +3 -3
- package/dist/{sessionScanner-DR32uSby.mjs → sessionScanner-CFITViIZ.mjs} +3 -3
- package/dist/{sessions-BvuMjgvJ.cjs → sessions-C-wBd0fN.cjs} +10 -10
- package/dist/{sessions-DTt2Eguk.mjs → sessions-wOcO2X-k.mjs} +10 -10
- package/dist/{setupOfflineReconnection-DduOsw6p.cjs → setupOfflineReconnection-Bd6XsWhA.cjs} +2 -2
- package/dist/{setupOfflineReconnection-BGnvhRfb.mjs → setupOfflineReconnection-BrljmbqX.mjs} +2 -2
- package/dist/{spawn-CL3cUc7b.mjs → spawn-BPioepNz.mjs} +66 -22
- package/dist/{spawn-DMB6rRPA.cjs → spawn-Crprnq9Z.cjs} +66 -22
- package/dist/{spawnAgents-CClb7buD.cjs → spawnAgents-B9olJ8xn.cjs} +1 -1
- package/dist/{spawnAgents-CRMfOJhh.mjs → spawnAgents-I29H9nO8.mjs} +1 -1
- package/dist/{spawnHappyCLI-Cj_6IICe.mjs → spawnHappyCLI-BA1bTIiO.mjs} +1 -1
- package/dist/{spawnHappyCLI-DJdhX_Qx.cjs → spawnHappyCLI-C0XAWy8V.cjs} +1 -1
- package/dist/{startFileWatcher-DikVa8kg.mjs → startFileWatcher-COCEjNT8.mjs} +1 -1
- package/dist/{startFileWatcher-LnOmVW6H.cjs → startFileWatcher-Ca5izs24.cjs} +1 -1
- package/dist/{startupSessionCreate-CDdaLaMq.mjs → startupSessionCreate-BnEPBxsJ.mjs} +3 -3
- package/dist/{startupSessionCreate-B3ND-917.cjs → startupSessionCreate-Cmg1gkKS.cjs} +3 -3
- package/dist/{store-DV__wCvP.cjs → store-CkNa6oj4.cjs} +46 -9
- package/dist/{store--XN-7MS0.mjs → store-Vej_738f.mjs} +46 -10
- package/dist/{streamRelay-DFdOaLOn.cjs → streamRelay-C0G1HOOd.cjs} +1 -1
- package/dist/{streamRelay-sABnxEXq.mjs → streamRelay-C5U-C4GS.mjs} +1 -1
- package/dist/{sync-_2lsZ1U2.cjs → sync-BfrnSdL1.cjs} +1 -1
- package/dist/{sync-JoEZKRo8.mjs → sync-DVcNkv8e.mjs} +1 -1
- package/dist/{systemPrompt-Zq4HyrZ5.mjs → systemPrompt-BxZebU75.mjs} +2 -2
- package/dist/{systemPrompt-CJEvNCuW.cjs → systemPrompt-Os5ca7pu.cjs} +2 -2
- package/dist/{teams-BNZafnrT.cjs → teams--pv0QFMA.cjs} +7 -7
- package/dist/{teams-qz4LqKJ2.mjs → teams-CNB3DE_n.mjs} +7 -7
- package/dist/{template-LgvBbOna.cjs → template-B9pLEP8v.cjs} +2 -2
- package/dist/{template-CJ8BWSsc.mjs → template-CL9EvQLQ.mjs} +2 -2
- package/dist/{time-bzmet4s5.mjs → time-0Ru4clBD.mjs} +1 -1
- package/dist/{time-CaUlWSNJ.cjs → time-Da5GIiCa.cjs} +1 -1
- package/dist/{titleGenerator-BuIIu_JP.cjs → titleGenerator-9xIXHA5K.cjs} +3 -3
- package/dist/{titleGenerator-CbTtJ_1D.mjs → titleGenerator-CaCzpYyA.mjs} +2 -2
- package/dist/{todo-DIrVF_Ak.mjs → todo-CZXHl2Lg.mjs} +6 -6
- package/dist/{todo-CQ_BTf9C.cjs → todo-DUY_J3l_.cjs} +6 -6
- package/dist/{tools-cLOjBvPn.mjs → tools-DqA2Jt2R.mjs} +3 -2
- package/dist/{tools-BnmmFZji.cjs → tools-hPD2Hvei.cjs} +3 -2
- package/dist/{uninstall-C5OuW6dE.mjs → uninstall-CjMzELYw.mjs} +3 -3
- package/dist/{uninstall-uEEGKB84.cjs → uninstall-rTvdpRLt.cjs} +3 -3
- package/dist/{wrapperAccount-DXlD3bsO.mjs → wrapperAccount-BkufO_9g.mjs} +5 -4
- package/dist/{wrapperAccount-DzoGqS2b.cjs → wrapperAccount-D2A4DuZy.cjs} +6 -3
- package/package.json +7 -7
- package/dist/selfCheck-vkfrgQ7X.mjs +0 -88
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { r as resolveSpawnPermissionMode, c as chooseProject, j as joinProject, a as resolveFirstMessageMeta, w as waitsForModelCatalog, s as sanitizeSpawnPermissionMode, A as ALLOWED_SPAWN_PERMISSION_MODES, S as SPAWN_AGENTS } from './spawnAgents-
|
|
2
|
-
import { s as sharedProjectsClient } from './client-
|
|
1
|
+
import { r as resolveSpawnPermissionMode, c as chooseProject, j as joinProject, a as resolveFirstMessageMeta, w as waitsForModelCatalog, s as sanitizeSpawnPermissionMode, A as ALLOWED_SPAWN_PERMISSION_MODES, S as SPAWN_AGENTS } from './spawnAgents-I29H9nO8.mjs';
|
|
2
|
+
import { s as sharedProjectsClient } from './client-Cbxr9VUE.mjs';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { readFileSync, statSync } from 'node:fs';
|
|
5
5
|
import { resolve } from 'node:path';
|
|
6
|
-
import { b as checkIfDaemonRunningAndCleanupStaleState, f as spawnDaemonSession, h as stopDaemonSession } from './controlClient-
|
|
7
|
-
import { c as readPersistedSessions } from './persistence-
|
|
8
|
-
import {
|
|
9
|
-
import { c as configuration } from './configuration-
|
|
6
|
+
import { b as checkIfDaemonRunningAndCleanupStaleState, f as spawnDaemonSession, h as stopDaemonSession } from './controlClient-BIdGnYBo.mjs';
|
|
7
|
+
import { c as readPersistedSessions, r as readSettings } from './persistence-mr4Y484W.mjs';
|
|
8
|
+
import { u as parseLatestModelTable, v as resolveLaunchAgentProfile } from './index-D1YnIih6.mjs';
|
|
9
|
+
import { c as configuration } from './configuration-rTcdHkhE.mjs';
|
|
10
10
|
import { g as getProjectPath } from './path-D2wdaNSk.mjs';
|
|
11
|
-
import { f as forkSession, F as ForkSourceMissingError } from './claudeSessionFork-
|
|
12
|
-
import { C as CodexAppServerClient } from './codexAppServerClient-
|
|
13
|
-
import { f as forkCodexThread } from './codexThreadFork-
|
|
14
|
-
import { e as sendUserMessage, f as readSessionMetadata, g as waitForSessionKey, s as sessionWebUrl } from './sessionOps-
|
|
15
|
-
import { i as isValidSpawnOrigin } from './createSessionMetadata-
|
|
16
|
-
import { l as logger } from './logger-
|
|
11
|
+
import { f as forkSession, a as forkCompletedTurns, F as ForkSourceMissingError } from './claudeSessionFork-BrJTncNL.mjs';
|
|
12
|
+
import { C as CodexAppServerClient } from './codexAppServerClient-HKAm8f_D.mjs';
|
|
13
|
+
import { f as forkCodexThread, a as forkCodexCompletedTurns } from './codexThreadFork-CVzAqELg.mjs';
|
|
14
|
+
import { e as sendUserMessage, f as readSessionMetadata, g as waitForSessionKey, s as sessionWebUrl, h as analyzeLatestTurn, i as readSessionLog, j as TURN_WINDOW } from './sessionOps-C9wRmCBg.mjs';
|
|
15
|
+
import { i as isValidSpawnOrigin } from './createSessionMetadata-PrN-dT7K.mjs';
|
|
16
|
+
import { l as logger } from './logger-SGCwRIV5.mjs';
|
|
17
17
|
import { w as waitForForkBackfill } from './forkBackfill-DYIjlN1Z.mjs';
|
|
18
18
|
import 'node:fs/promises';
|
|
19
19
|
import 'zod';
|
|
@@ -22,17 +22,17 @@ import 'node:crypto';
|
|
|
22
22
|
import 'tweetnacl';
|
|
23
23
|
import '@paralleldrive/cuid2';
|
|
24
24
|
import 'node:os';
|
|
25
|
-
import './package-
|
|
25
|
+
import './package-Q_ELj5DL.mjs';
|
|
26
26
|
import 'node:readline';
|
|
27
27
|
import 'node:child_process';
|
|
28
28
|
import 'cross-spawn';
|
|
29
29
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
30
30
|
import './manager-BEsI4qt3.mjs';
|
|
31
31
|
import '@anthropic-ai/sandbox-runtime';
|
|
32
|
-
import './rateLimitWindows-
|
|
32
|
+
import './rateLimitWindows-a2yE3kCv.mjs';
|
|
33
33
|
import './processTree-CP5IvQ2Z.mjs';
|
|
34
34
|
import 'axios';
|
|
35
|
-
import './time-
|
|
35
|
+
import './time-0Ru4clBD.mjs';
|
|
36
36
|
import './specialCommands-MXUN0wfI.mjs';
|
|
37
37
|
import 'socket.io-client';
|
|
38
38
|
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
@@ -80,10 +80,14 @@ function resolveForkSource(sessionId, persisted) {
|
|
|
80
80
|
if (!nonEmpty(metadata.claudeSessionId)) throw new Error(`Session ${sessionId} has no Claude conversation id yet (it never ran a turn) \u2014 nothing to fork.`);
|
|
81
81
|
return { agent: "claude", directory, claudeSessionId: metadata.claudeSessionId, permissionMode, parentSessionId: sessionId };
|
|
82
82
|
}
|
|
83
|
-
async function forkProviderConversation(source) {
|
|
83
|
+
async function forkProviderConversation(source, opts = {}) {
|
|
84
84
|
if (source.agent === "claude") {
|
|
85
85
|
try {
|
|
86
|
-
|
|
86
|
+
const projectDir = getProjectPath(source.directory);
|
|
87
|
+
if (!opts.running) return { resumeClaudeSessionId: await forkSession(projectDir, source.claudeSessionId) };
|
|
88
|
+
const result = await forkCompletedTurns(projectDir, source.claudeSessionId);
|
|
89
|
+
if ("startFresh" in result) throw new Error(NO_COMPLETED_TURN);
|
|
90
|
+
return { resumeClaudeSessionId: result.newClaudeSessionId, excludedPrompts: result.excludedPrompts };
|
|
87
91
|
} catch (error) {
|
|
88
92
|
if (error instanceof ForkSourceMissingError) throw new Error("Claude session file not found on this machine");
|
|
89
93
|
throw error;
|
|
@@ -92,12 +96,18 @@ async function forkProviderConversation(source) {
|
|
|
92
96
|
const client = new CodexAppServerClient();
|
|
93
97
|
await client.connect();
|
|
94
98
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
if (!opts.running) {
|
|
100
|
+
const result2 = await forkCodexThread(client, { threadId: source.codexThreadId, cwd: source.directory });
|
|
101
|
+
return { resumeCodexThreadId: result2.newCodexThreadId };
|
|
102
|
+
}
|
|
103
|
+
const result = await forkCodexCompletedTurns(client, { threadId: source.codexThreadId, cwd: source.directory });
|
|
104
|
+
if ("startFresh" in result) throw new Error(NO_COMPLETED_TURN);
|
|
105
|
+
return { resumeCodexThreadId: result.newCodexThreadId, excludedPrompts: result.excludedPrompts };
|
|
97
106
|
} finally {
|
|
98
107
|
await client.disconnect();
|
|
99
108
|
}
|
|
100
109
|
}
|
|
110
|
+
const NO_COMPLETED_TURN = "the session is running its first turn \u2014 nothing has completed yet to fork; retry once it ends.";
|
|
101
111
|
|
|
102
112
|
function spawnEnvironmentVariables(env, hasPrompt) {
|
|
103
113
|
return hasPrompt ? { ...env, HAPPY_FIRST_MESSAGE_FROM_CLI: "1" } : env;
|
|
@@ -222,7 +232,7 @@ ${chalk.bold("Options:")}
|
|
|
222
232
|
machine runs (claude: newest Opus; codex: newest
|
|
223
233
|
sol its Codex lists; gemini: newest pro), else the
|
|
224
234
|
machine default. 'default' = the machine default.
|
|
225
|
-
--account <id> Claude account on this machine (\`very-happy account
|
|
235
|
+
--account <id> Claude / Codex account on this machine (\`very-happy account
|
|
226
236
|
list\`); 'machine' = the machine's own login.
|
|
227
237
|
Default = the machine's default account, if set. A
|
|
228
238
|
missing or expired account fails the spawn.
|
|
@@ -230,6 +240,9 @@ ${chalk.bold("Options:")}
|
|
|
230
240
|
web's fork): copies its conversation and continues
|
|
231
241
|
it in a new session, in the same directory and with
|
|
232
242
|
the same agent (so --dir / --agent are not needed).
|
|
243
|
+
A source mid-turn forks its completed turns only;
|
|
244
|
+
the prompt left out is printed (--json:
|
|
245
|
+
excludedPrompts). The source is not interrupted.
|
|
233
246
|
--env KEY=VALUE Extra environment for the session process. Repeatable.
|
|
234
247
|
\${VAR} is expanded against the daemon's environment;
|
|
235
248
|
an unresolved reference fails the spawn.
|
|
@@ -264,6 +277,16 @@ const defaultFirstMessageDeps = {
|
|
|
264
277
|
sendUserMessage,
|
|
265
278
|
warn: (message) => console.error(chalk.yellow("Warning:"), message)
|
|
266
279
|
};
|
|
280
|
+
async function sourceTurnRunning(sessionId) {
|
|
281
|
+
const persisted = readPersistedSessions()[sessionId];
|
|
282
|
+
if (!persisted) return false;
|
|
283
|
+
try {
|
|
284
|
+
return !analyzeLatestTurn(await readSessionLog(sessionId, persisted, TURN_WINDOW)).ended;
|
|
285
|
+
} catch (error) {
|
|
286
|
+
console.error(chalk.dim(`(could not read whether ${sessionId} is mid-turn \u2014 forking everything: ${error instanceof Error ? error.message : String(error)})`));
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
267
290
|
async function waitForModelCatalog(readMetadata, initial, knobs = {}) {
|
|
268
291
|
const timeoutMs = knobs.timeoutMs ?? 8e3;
|
|
269
292
|
const pollMs = knobs.pollMs ?? 400;
|
|
@@ -369,14 +392,28 @@ async function handleSpawnCommand(args) {
|
|
|
369
392
|
process.exit(1);
|
|
370
393
|
}
|
|
371
394
|
let resumeIds = {};
|
|
395
|
+
let excludedPrompts = [];
|
|
372
396
|
if (forkSource) {
|
|
373
397
|
try {
|
|
374
|
-
|
|
398
|
+
const running = await sourceTurnRunning(forkSource.parentSessionId);
|
|
399
|
+
const { excludedPrompts: excluded = [], ...ids } = await forkProviderConversation(forkSource, { running });
|
|
400
|
+
resumeIds = ids;
|
|
401
|
+
excludedPrompts = excluded;
|
|
375
402
|
} catch (error) {
|
|
376
403
|
console.error(chalk.red("Error:"), `Failed to fork session ${forkSource.parentSessionId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
377
404
|
process.exit(1);
|
|
378
405
|
}
|
|
379
406
|
}
|
|
407
|
+
let accountChoice = options.account ? options.account === "machine" ? null : options.account : void 0;
|
|
408
|
+
if (accountChoice === void 0 && options.project && !forkSource) {
|
|
409
|
+
try {
|
|
410
|
+
const defaults = await sharedProjectsClient().defaults(options.project);
|
|
411
|
+
const machineId = (await readSettings()).machineId;
|
|
412
|
+
if (machineId) accountChoice = resolveLaunchAgentProfile({ project: defaults.agentProfiles, agent: agent ?? "claude", machineId }).agentProfileId;
|
|
413
|
+
} catch (error) {
|
|
414
|
+
console.error(chalk.dim(`(project ${options.project}: defaults unavailable \u2014 using the machine default account: ${error instanceof Error ? error.message : String(error)})`));
|
|
415
|
+
}
|
|
416
|
+
}
|
|
380
417
|
logger.debug(`[SPAWN CMD] Spawning session in ${directory}${forkSource ? ` (fork of ${forkSource.parentSessionId})` : ""}`);
|
|
381
418
|
const result = await spawnDaemonSession(directory, void 0, {
|
|
382
419
|
spawnedBy: options.spawnedBy,
|
|
@@ -389,7 +426,7 @@ async function handleSpawnCommand(args) {
|
|
|
389
426
|
environmentVariables: spawnEnvironmentVariables(options.env, prompt !== void 0),
|
|
390
427
|
...resumeIds,
|
|
391
428
|
...forkSource ? { parentSessionId: forkSource.parentSessionId } : {},
|
|
392
|
-
...
|
|
429
|
+
...accountChoice !== void 0 ? { agentProfileId: accountChoice } : {}
|
|
393
430
|
});
|
|
394
431
|
if (result?.error || !result?.success || !result?.sessionId) {
|
|
395
432
|
const message = result?.error || "Daemon returned no session ID";
|
|
@@ -441,6 +478,9 @@ async function handleSpawnCommand(args) {
|
|
|
441
478
|
if (forkSource) {
|
|
442
479
|
payload.forkedFrom = forkSource.parentSessionId;
|
|
443
480
|
}
|
|
481
|
+
if (excludedPrompts.length > 0) {
|
|
482
|
+
payload.excludedPrompts = excludedPrompts;
|
|
483
|
+
}
|
|
444
484
|
if (projectOutcome.joined) {
|
|
445
485
|
payload.project = { id: projectOutcome.projectId, via: projectOutcome.via };
|
|
446
486
|
}
|
|
@@ -460,6 +500,10 @@ async function handleSpawnCommand(args) {
|
|
|
460
500
|
if (prompt !== void 0 && promptError === null) {
|
|
461
501
|
console.log(chalk.green("First message sent."));
|
|
462
502
|
}
|
|
503
|
+
if (excludedPrompts.length > 0) {
|
|
504
|
+
console.log(chalk.yellow("The source was mid-turn: the fork holds its completed turns only. Left out (send it again if you want it):"));
|
|
505
|
+
for (const text of excludedPrompts) console.log(text.split("\n").map((line) => ` > ${line}`).join("\n"));
|
|
506
|
+
}
|
|
463
507
|
}
|
|
464
508
|
if (promptError !== null) {
|
|
465
509
|
console.error(chalk.red("Error:"), `Session ${sessionId} was spawned, but sending the first message failed: ${promptError}`);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var spawnAgents = require('./spawnAgents-
|
|
4
|
-
var client = require('./client-
|
|
3
|
+
var spawnAgents = require('./spawnAgents-B9olJ8xn.cjs');
|
|
4
|
+
var client = require('./client-CsfPUxLy.cjs');
|
|
5
5
|
var chalk = require('chalk');
|
|
6
6
|
var node_fs = require('node:fs');
|
|
7
7
|
var path$1 = require('node:path');
|
|
8
|
-
var controlClient = require('./controlClient-
|
|
9
|
-
var persistence = require('./persistence-
|
|
10
|
-
var index = require('./index-
|
|
11
|
-
var configuration = require('./configuration-
|
|
8
|
+
var controlClient = require('./controlClient-CIqHL07h.cjs');
|
|
9
|
+
var persistence = require('./persistence-D0gNvqXe.cjs');
|
|
10
|
+
var index = require('./index-BUFrKZeQ.cjs');
|
|
11
|
+
var configuration = require('./configuration-2Pbg3a0H.cjs');
|
|
12
12
|
var path = require('./path-B7zW-WwE.cjs');
|
|
13
|
-
var claudeSessionFork = require('./claudeSessionFork-
|
|
14
|
-
var codexAppServerClient = require('./codexAppServerClient-
|
|
15
|
-
var codexThreadFork = require('./codexThreadFork-
|
|
16
|
-
var sessionOps = require('./sessionOps-
|
|
17
|
-
var createSessionMetadata = require('./createSessionMetadata-
|
|
18
|
-
var logger = require('./logger-
|
|
13
|
+
var claudeSessionFork = require('./claudeSessionFork-4g6-Sk3Q.cjs');
|
|
14
|
+
var codexAppServerClient = require('./codexAppServerClient-Bj5vN7sb.cjs');
|
|
15
|
+
var codexThreadFork = require('./codexThreadFork-C6ZmcT2z.cjs');
|
|
16
|
+
var sessionOps = require('./sessionOps-BUlpeaUe.cjs');
|
|
17
|
+
var createSessionMetadata = require('./createSessionMetadata-BHjzRzPc.cjs');
|
|
18
|
+
var logger = require('./logger-CepF8C5Z.cjs');
|
|
19
19
|
var forkBackfill = require('./forkBackfill-8eLDeS73.cjs');
|
|
20
20
|
require('node:fs/promises');
|
|
21
21
|
require('zod');
|
|
@@ -24,17 +24,17 @@ require('node:crypto');
|
|
|
24
24
|
require('tweetnacl');
|
|
25
25
|
require('@paralleldrive/cuid2');
|
|
26
26
|
require('node:os');
|
|
27
|
-
require('./package-
|
|
27
|
+
require('./package-C7WgesIw.cjs');
|
|
28
28
|
require('node:readline');
|
|
29
29
|
require('node:child_process');
|
|
30
30
|
require('cross-spawn');
|
|
31
31
|
require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
32
32
|
require('./manager-HrEj442o.cjs');
|
|
33
33
|
require('@anthropic-ai/sandbox-runtime');
|
|
34
|
-
require('./rateLimitWindows-
|
|
34
|
+
require('./rateLimitWindows-B9PERFm1.cjs');
|
|
35
35
|
require('./processTree-CMHWlVse.cjs');
|
|
36
36
|
require('axios');
|
|
37
|
-
require('./time-
|
|
37
|
+
require('./time-Da5GIiCa.cjs');
|
|
38
38
|
require('./specialCommands-J3JFOq0J.cjs');
|
|
39
39
|
require('socket.io-client');
|
|
40
40
|
require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
@@ -82,10 +82,14 @@ function resolveForkSource(sessionId, persisted) {
|
|
|
82
82
|
if (!nonEmpty(metadata.claudeSessionId)) throw new Error(`Session ${sessionId} has no Claude conversation id yet (it never ran a turn) \u2014 nothing to fork.`);
|
|
83
83
|
return { agent: "claude", directory, claudeSessionId: metadata.claudeSessionId, permissionMode, parentSessionId: sessionId };
|
|
84
84
|
}
|
|
85
|
-
async function forkProviderConversation(source) {
|
|
85
|
+
async function forkProviderConversation(source, opts = {}) {
|
|
86
86
|
if (source.agent === "claude") {
|
|
87
87
|
try {
|
|
88
|
-
|
|
88
|
+
const projectDir = path.getProjectPath(source.directory);
|
|
89
|
+
if (!opts.running) return { resumeClaudeSessionId: await claudeSessionFork.forkSession(projectDir, source.claudeSessionId) };
|
|
90
|
+
const result = await claudeSessionFork.forkCompletedTurns(projectDir, source.claudeSessionId);
|
|
91
|
+
if ("startFresh" in result) throw new Error(NO_COMPLETED_TURN);
|
|
92
|
+
return { resumeClaudeSessionId: result.newClaudeSessionId, excludedPrompts: result.excludedPrompts };
|
|
89
93
|
} catch (error) {
|
|
90
94
|
if (error instanceof claudeSessionFork.ForkSourceMissingError) throw new Error("Claude session file not found on this machine");
|
|
91
95
|
throw error;
|
|
@@ -94,12 +98,18 @@ async function forkProviderConversation(source) {
|
|
|
94
98
|
const client = new codexAppServerClient.CodexAppServerClient();
|
|
95
99
|
await client.connect();
|
|
96
100
|
try {
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
if (!opts.running) {
|
|
102
|
+
const result2 = await codexThreadFork.forkCodexThread(client, { threadId: source.codexThreadId, cwd: source.directory });
|
|
103
|
+
return { resumeCodexThreadId: result2.newCodexThreadId };
|
|
104
|
+
}
|
|
105
|
+
const result = await codexThreadFork.forkCodexCompletedTurns(client, { threadId: source.codexThreadId, cwd: source.directory });
|
|
106
|
+
if ("startFresh" in result) throw new Error(NO_COMPLETED_TURN);
|
|
107
|
+
return { resumeCodexThreadId: result.newCodexThreadId, excludedPrompts: result.excludedPrompts };
|
|
99
108
|
} finally {
|
|
100
109
|
await client.disconnect();
|
|
101
110
|
}
|
|
102
111
|
}
|
|
112
|
+
const NO_COMPLETED_TURN = "the session is running its first turn \u2014 nothing has completed yet to fork; retry once it ends.";
|
|
103
113
|
|
|
104
114
|
function spawnEnvironmentVariables(env, hasPrompt) {
|
|
105
115
|
return hasPrompt ? { ...env, HAPPY_FIRST_MESSAGE_FROM_CLI: "1" } : env;
|
|
@@ -224,7 +234,7 @@ ${chalk.bold("Options:")}
|
|
|
224
234
|
machine runs (claude: newest Opus; codex: newest
|
|
225
235
|
sol its Codex lists; gemini: newest pro), else the
|
|
226
236
|
machine default. 'default' = the machine default.
|
|
227
|
-
--account <id> Claude account on this machine (\`very-happy account
|
|
237
|
+
--account <id> Claude / Codex account on this machine (\`very-happy account
|
|
228
238
|
list\`); 'machine' = the machine's own login.
|
|
229
239
|
Default = the machine's default account, if set. A
|
|
230
240
|
missing or expired account fails the spawn.
|
|
@@ -232,6 +242,9 @@ ${chalk.bold("Options:")}
|
|
|
232
242
|
web's fork): copies its conversation and continues
|
|
233
243
|
it in a new session, in the same directory and with
|
|
234
244
|
the same agent (so --dir / --agent are not needed).
|
|
245
|
+
A source mid-turn forks its completed turns only;
|
|
246
|
+
the prompt left out is printed (--json:
|
|
247
|
+
excludedPrompts). The source is not interrupted.
|
|
235
248
|
--env KEY=VALUE Extra environment for the session process. Repeatable.
|
|
236
249
|
\${VAR} is expanded against the daemon's environment;
|
|
237
250
|
an unresolved reference fails the spawn.
|
|
@@ -266,6 +279,16 @@ const defaultFirstMessageDeps = {
|
|
|
266
279
|
sendUserMessage: sessionOps.sendUserMessage,
|
|
267
280
|
warn: (message) => console.error(chalk.yellow("Warning:"), message)
|
|
268
281
|
};
|
|
282
|
+
async function sourceTurnRunning(sessionId) {
|
|
283
|
+
const persisted = persistence.readPersistedSessions()[sessionId];
|
|
284
|
+
if (!persisted) return false;
|
|
285
|
+
try {
|
|
286
|
+
return !sessionOps.analyzeLatestTurn(await sessionOps.readSessionLog(sessionId, persisted, sessionOps.TURN_WINDOW)).ended;
|
|
287
|
+
} catch (error) {
|
|
288
|
+
console.error(chalk.dim(`(could not read whether ${sessionId} is mid-turn \u2014 forking everything: ${error instanceof Error ? error.message : String(error)})`));
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
269
292
|
async function waitForModelCatalog(readMetadata, initial, knobs = {}) {
|
|
270
293
|
const timeoutMs = knobs.timeoutMs ?? 8e3;
|
|
271
294
|
const pollMs = knobs.pollMs ?? 400;
|
|
@@ -371,14 +394,28 @@ async function handleSpawnCommand(args) {
|
|
|
371
394
|
process.exit(1);
|
|
372
395
|
}
|
|
373
396
|
let resumeIds = {};
|
|
397
|
+
let excludedPrompts = [];
|
|
374
398
|
if (forkSource) {
|
|
375
399
|
try {
|
|
376
|
-
|
|
400
|
+
const running = await sourceTurnRunning(forkSource.parentSessionId);
|
|
401
|
+
const { excludedPrompts: excluded = [], ...ids } = await forkProviderConversation(forkSource, { running });
|
|
402
|
+
resumeIds = ids;
|
|
403
|
+
excludedPrompts = excluded;
|
|
377
404
|
} catch (error) {
|
|
378
405
|
console.error(chalk.red("Error:"), `Failed to fork session ${forkSource.parentSessionId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
379
406
|
process.exit(1);
|
|
380
407
|
}
|
|
381
408
|
}
|
|
409
|
+
let accountChoice = options.account ? options.account === "machine" ? null : options.account : void 0;
|
|
410
|
+
if (accountChoice === void 0 && options.project && !forkSource) {
|
|
411
|
+
try {
|
|
412
|
+
const defaults = await client.sharedProjectsClient().defaults(options.project);
|
|
413
|
+
const machineId = (await persistence.readSettings()).machineId;
|
|
414
|
+
if (machineId) accountChoice = index.resolveLaunchAgentProfile({ project: defaults.agentProfiles, agent: agent ?? "claude", machineId }).agentProfileId;
|
|
415
|
+
} catch (error) {
|
|
416
|
+
console.error(chalk.dim(`(project ${options.project}: defaults unavailable \u2014 using the machine default account: ${error instanceof Error ? error.message : String(error)})`));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
382
419
|
logger.logger.debug(`[SPAWN CMD] Spawning session in ${directory}${forkSource ? ` (fork of ${forkSource.parentSessionId})` : ""}`);
|
|
383
420
|
const result = await controlClient.spawnDaemonSession(directory, void 0, {
|
|
384
421
|
spawnedBy: options.spawnedBy,
|
|
@@ -391,7 +428,7 @@ async function handleSpawnCommand(args) {
|
|
|
391
428
|
environmentVariables: spawnEnvironmentVariables(options.env, prompt !== void 0),
|
|
392
429
|
...resumeIds,
|
|
393
430
|
...forkSource ? { parentSessionId: forkSource.parentSessionId } : {},
|
|
394
|
-
...
|
|
431
|
+
...accountChoice !== void 0 ? { agentProfileId: accountChoice } : {}
|
|
395
432
|
});
|
|
396
433
|
if (result?.error || !result?.success || !result?.sessionId) {
|
|
397
434
|
const message = result?.error || "Daemon returned no session ID";
|
|
@@ -443,6 +480,9 @@ async function handleSpawnCommand(args) {
|
|
|
443
480
|
if (forkSource) {
|
|
444
481
|
payload.forkedFrom = forkSource.parentSessionId;
|
|
445
482
|
}
|
|
483
|
+
if (excludedPrompts.length > 0) {
|
|
484
|
+
payload.excludedPrompts = excludedPrompts;
|
|
485
|
+
}
|
|
446
486
|
if (projectOutcome.joined) {
|
|
447
487
|
payload.project = { id: projectOutcome.projectId, via: projectOutcome.via };
|
|
448
488
|
}
|
|
@@ -462,6 +502,10 @@ async function handleSpawnCommand(args) {
|
|
|
462
502
|
if (prompt !== void 0 && promptError === null) {
|
|
463
503
|
console.log(chalk.green("First message sent."));
|
|
464
504
|
}
|
|
505
|
+
if (excludedPrompts.length > 0) {
|
|
506
|
+
console.log(chalk.yellow("The source was mid-turn: the fork holds its completed turns only. Left out (send it again if you want it):"));
|
|
507
|
+
for (const text of excludedPrompts) console.log(text.split("\n").map((line) => ` > ${line}`).join("\n"));
|
|
508
|
+
}
|
|
465
509
|
}
|
|
466
510
|
if (promptError !== null) {
|
|
467
511
|
console.error(chalk.red("Error:"), `Session ${sessionId} was spawned, but sending the first message failed: ${promptError}`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as getAgentCodeDefaults, M as isLatestModelMode, N as resolveLatestModel, O as LATEST_MODEL_MODE, Q as EFFORT_INTENT_AUTO, T as normalizeAgentKey } from './index-D1YnIih6.mjs';
|
|
2
2
|
|
|
3
3
|
function chooseProject(opts) {
|
|
4
4
|
if (opts.project) return { kind: "explicit", projectId: opts.project };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawn } from 'cross-spawn';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
4
|
-
import { l as logger } from './logger-
|
|
4
|
+
import { l as logger } from './logger-SGCwRIV5.mjs';
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
|
|
7
7
|
let cachedRuntime = null;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var spawn = require('cross-spawn');
|
|
4
4
|
var path = require('node:path');
|
|
5
5
|
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
6
|
-
var logger = require('./logger-
|
|
6
|
+
var logger = require('./logger-CepF8C5Z.cjs');
|
|
7
7
|
var node_fs = require('node:fs');
|
|
8
8
|
|
|
9
9
|
let cachedRuntime = null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as logger } from './logger-
|
|
2
|
-
import { e as evaluateWrapperIdle, j as isQuiescent, k as HIBERNATION_UNSUPPORTED_BACKOFF_MS } from './persistence-
|
|
3
|
-
import { c as connectionState } from './api-
|
|
1
|
+
import { l as logger } from './logger-SGCwRIV5.mjs';
|
|
2
|
+
import { e as evaluateWrapperIdle, j as isQuiescent, k as HIBERNATION_UNSUPPORTED_BACKOFF_MS } from './persistence-mr4Y484W.mjs';
|
|
3
|
+
import { c as connectionState } from './api-aE60mNjs.mjs';
|
|
4
4
|
|
|
5
5
|
const PRESENCE_SETTLE_MS = 6e3;
|
|
6
6
|
async function commitHibernation(deps) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
4
|
-
var persistence = require('./persistence-
|
|
5
|
-
var api = require('./api-
|
|
3
|
+
var logger = require('./logger-CepF8C5Z.cjs');
|
|
4
|
+
var persistence = require('./persistence-D0gNvqXe.cjs');
|
|
5
|
+
var api = require('./api-wYwQCJml.cjs');
|
|
6
6
|
|
|
7
7
|
const PRESENCE_SETTLE_MS = 6e3;
|
|
8
8
|
async function commitHibernation(deps) {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var node_fs = require('node:fs');
|
|
4
4
|
var os = require('node:os');
|
|
5
5
|
var path = require('node:path');
|
|
6
|
+
var index = require('./index-BUFrKZeQ.cjs');
|
|
6
7
|
|
|
7
8
|
function providersPath(happyHomeDir) {
|
|
8
9
|
return path.join(happyHomeDir, "providers.json");
|
|
@@ -50,6 +51,15 @@ function parseSessionProvidersFile(raw) {
|
|
|
50
51
|
return out;
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
const KIND_AGENT = {
|
|
55
|
+
"claude-subscription": "claude",
|
|
56
|
+
"claude-api": "claude",
|
|
57
|
+
"codex-chatgpt": "codex",
|
|
58
|
+
"codex-provider": "codex"
|
|
59
|
+
};
|
|
60
|
+
function isApiKind(kind) {
|
|
61
|
+
return kind === "claude-api" || kind === "codex-provider";
|
|
62
|
+
}
|
|
53
63
|
const SPAWN_ACCOUNT_ENV = "VH_AGENT_PROFILE_ID";
|
|
54
64
|
const SUBSCRIPTION_TOKEN_TTL_MS = 365 * 24 * 60 * 60 * 1e3;
|
|
55
65
|
const ACCOUNT_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,47}$/;
|
|
@@ -60,6 +70,10 @@ function accountSecretPath(home, id) {
|
|
|
60
70
|
if (!ACCOUNT_ID_PATTERN.test(id)) throw new Error(`invalid account id "${id}"`);
|
|
61
71
|
return path.join(home, "accounts", id, "secret");
|
|
62
72
|
}
|
|
73
|
+
function accountCodexHomePath(home, id) {
|
|
74
|
+
if (!ACCOUNT_ID_PATTERN.test(id)) throw new Error(`invalid account id "${id}"`);
|
|
75
|
+
return path.join(home, "accounts", id, "codex-home");
|
|
76
|
+
}
|
|
63
77
|
function sessionAccountsPath(home) {
|
|
64
78
|
return path.join(home, "session-accounts.json");
|
|
65
79
|
}
|
|
@@ -97,14 +111,26 @@ function parseAccountsFile(raw) {
|
|
|
97
111
|
for (const [id, value] of Object.entries(src)) {
|
|
98
112
|
if (!ACCOUNT_ID_PATTERN.test(id) || !value || typeof value !== "object") continue;
|
|
99
113
|
const a = value;
|
|
100
|
-
|
|
114
|
+
const kind = a.kind;
|
|
115
|
+
if (typeof a.kind !== "string" || !(a.kind in KIND_AGENT) || a.agent !== KIND_AGENT[kind]) continue;
|
|
101
116
|
const label = typeof a.label === "string" && a.label.trim() ? a.label.trim() : id;
|
|
102
|
-
const rec = { label, agent:
|
|
103
|
-
|
|
104
|
-
|
|
117
|
+
const rec = { label, agent: KIND_AGENT[kind], kind, createdAt: typeof a.createdAt === "number" ? a.createdAt : 0 };
|
|
118
|
+
const baseUrl = typeof a.baseUrl === "string" && /^https?:\/\//.test(a.baseUrl) ? a.baseUrl.replace(/\/+$/, "") : void 0;
|
|
119
|
+
if (kind === "codex-provider") {
|
|
120
|
+
const provider = typeof a.provider === "string" && /^[A-Za-z0-9_-]{1,64}$/.test(a.provider) ? a.provider : void 0;
|
|
121
|
+
if (!provider && !baseUrl) continue;
|
|
122
|
+
if (provider) rec.provider = provider;
|
|
123
|
+
if (a.wireApi === "responses" || a.wireApi === "chat") rec.wireApi = a.wireApi;
|
|
124
|
+
}
|
|
125
|
+
if (kind === "codex-chatgpt") {
|
|
126
|
+
if (typeof a.email === "string" && a.email) rec.email = a.email;
|
|
127
|
+
if (typeof a.planType === "string" && a.planType) rec.planType = a.planType;
|
|
128
|
+
}
|
|
129
|
+
if (isApiKind(kind)) {
|
|
130
|
+
if (kind === "claude-api" && !baseUrl) continue;
|
|
105
131
|
const key = parseKey(a.key);
|
|
106
132
|
if (!key) continue;
|
|
107
|
-
rec.baseUrl =
|
|
133
|
+
if (baseUrl) rec.baseUrl = baseUrl;
|
|
108
134
|
rec.key = key;
|
|
109
135
|
if (Array.isArray(a.models)) rec.models = a.models.filter((m) => typeof m === "string" && m.length > 0);
|
|
110
136
|
if (a.contextWindows && typeof a.contextWindows === "object") {
|
|
@@ -208,15 +234,22 @@ function writeAccountSecret(home, id, secret) {
|
|
|
208
234
|
function removeAccountSecret(home, id) {
|
|
209
235
|
node_fs.rmSync(path.dirname(accountSecretPath(home, id)), { recursive: true, force: true });
|
|
210
236
|
}
|
|
237
|
+
const KIND_ID_BASE = {
|
|
238
|
+
"claude-subscription": "claude-sub",
|
|
239
|
+
"claude-api": "claude-api",
|
|
240
|
+
"codex-chatgpt": "chatgpt",
|
|
241
|
+
"codex-provider": "codex-api"
|
|
242
|
+
};
|
|
211
243
|
function newAccountId(label, kind, taken) {
|
|
212
244
|
const used = new Set(taken);
|
|
213
245
|
const ascii = /^[\x20-\x7e]*$/.test(label);
|
|
214
246
|
const slug = ascii ? label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40) : "";
|
|
215
|
-
const base = slug && /^[a-z0-9]/.test(slug) ? slug : kind
|
|
247
|
+
const base = slug && /^[a-z0-9]/.test(slug) ? slug : KIND_ID_BASE[kind];
|
|
216
248
|
if (!used.has(base)) return base;
|
|
217
249
|
for (let n = 2; ; n++) if (!used.has(`${base}-${n}`)) return `${base}-${n}`;
|
|
218
250
|
}
|
|
219
251
|
function secretPresent(home, id, a, probe) {
|
|
252
|
+
if (a.kind === "codex-chatgpt") return probe.fileReadable(path.join(accountCodexHomePath(home, id), "auth.json"));
|
|
220
253
|
if (a.kind === "claude-subscription" || a.key?.source === "stored") return probe.fileReadable(accountSecretPath(home, id));
|
|
221
254
|
if (a.key?.source === "file") return probe.fileReadable(expandHome(a.key.path));
|
|
222
255
|
if (a.key?.source === "env") return !!probe.env[a.key.name]?.trim();
|
|
@@ -230,7 +263,7 @@ function accountStatus(home, id, a, probe, now) {
|
|
|
230
263
|
}
|
|
231
264
|
function summarizeAccount(home, id, a, probe, now) {
|
|
232
265
|
const { status, detail } = accountStatus(home, id, a, probe, now);
|
|
233
|
-
const keySource = a.kind === "claude-subscription" ? "stored" : a.key?.source;
|
|
266
|
+
const keySource = a.kind === "claude-subscription" || a.kind === "codex-chatgpt" ? "stored" : a.key?.source;
|
|
234
267
|
const keyRef = a.key?.source === "file" ? a.key.path : a.key?.source === "env" ? a.key.name : void 0;
|
|
235
268
|
return {
|
|
236
269
|
id,
|
|
@@ -246,7 +279,10 @@ function summarizeAccount(home, id, a, probe, now) {
|
|
|
246
279
|
...a.models ? { models: a.models } : {},
|
|
247
280
|
...keySource ? { keySource } : {},
|
|
248
281
|
...keyRef ? { keyRef } : {},
|
|
249
|
-
...a.legacy ? { legacy: true } : {}
|
|
282
|
+
...a.legacy ? { legacy: true } : {},
|
|
283
|
+
...a.provider ? { provider: a.provider } : {},
|
|
284
|
+
...a.email ? { email: a.email } : {},
|
|
285
|
+
...a.planType ? { planType: a.planType } : {}
|
|
250
286
|
};
|
|
251
287
|
}
|
|
252
288
|
function defaultSecretProbe(env = process.env) {
|
|
@@ -265,11 +301,12 @@ function buildAgentProfilesState(home, file, probe, now, daemonPid) {
|
|
|
265
301
|
const accounts = Object.entries(file.accounts).map(([id, a]) => summarizeAccount(home, id, a, probe, now)).sort((x, y) => (x.createdAt ?? 0) - (y.createdAt ?? 0) || x.id.localeCompare(y.id));
|
|
266
302
|
const defaults = {};
|
|
267
303
|
for (const [agent, id] of Object.entries(file.defaults)) if (file.accounts[id]) defaults[agent] = id;
|
|
268
|
-
return { daemonPid, updatedAt: now, accounts, defaults };
|
|
304
|
+
return { daemonPid, updatedAt: now, accounts, defaults, kinds: [...index.AGENT_PROFILE_KINDS] };
|
|
269
305
|
}
|
|
270
306
|
|
|
271
307
|
exports.SPAWN_ACCOUNT_ENV = SPAWN_ACCOUNT_ENV;
|
|
272
308
|
exports.SUBSCRIPTION_TOKEN_TTL_MS = SUBSCRIPTION_TOKEN_TTL_MS;
|
|
309
|
+
exports.accountCodexHomePath = accountCodexHomePath;
|
|
273
310
|
exports.accountSecretPath = accountSecretPath;
|
|
274
311
|
exports.accountsPath = accountsPath;
|
|
275
312
|
exports.buildAgentProfilesState = buildAgentProfilesState;
|