very-happy-cli 0.2.190 → 0.2.192
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-dkRv9QHm.cjs → AcpBackend-BQO4ShOy.cjs} +3 -3
- package/dist/{AcpBackend-Dd1h-Rgt.mjs → AcpBackend-CGHTDJd9.mjs} +3 -3
- package/dist/{AcpSessionManager-QBZ-CIf7.mjs → AcpSessionManager-G0xD6Jbq.mjs} +2 -2
- package/dist/{AcpSessionManager-AqWAqahm.cjs → AcpSessionManager-LlUMmcpB.cjs} +2 -2
- package/dist/{BasePermissionHandler-CLp1ge-4.mjs → BasePermissionHandler-BmTIg376.mjs} +1 -1
- package/dist/{BasePermissionHandler-CpSugp7Z.cjs → BasePermissionHandler-N6Ip3tFt.cjs} +1 -1
- package/dist/account-CCVT-HO_.mjs +240 -0
- package/dist/account-DtaouikP.cjs +245 -0
- package/dist/accountService-Bddy0zwL.cjs +571 -0
- package/dist/accountService-Dd9uqde2.mjs +566 -0
- package/dist/{acpSessionResume-CcpDuIO5.mjs → acpSessionResume-BWEUxNtC.mjs} +1 -1
- package/dist/{acpSessionResume-CZao6QEd.cjs → acpSessionResume-BnHDk5eD.cjs} +1 -1
- package/dist/{agentHome-BJGRA2Kx.mjs → agentHome-B0VnjkZW.mjs} +4 -4
- package/dist/{agentHome-fIUqT-pn.cjs → agentHome-CqQ29YY7.cjs} +4 -4
- package/dist/{api-Dw8gFsQi.mjs → api-_LeBScjg.mjs} +10 -10
- package/dist/{api-CXL6jp-p.cjs → api-hMDsC6Wg.cjs} +10 -10
- package/dist/{apiMachine-BBNEtjf7.mjs → apiMachine-CgRldeJ6.mjs} +76 -21
- package/dist/{apiMachine-C6UqHoPF.cjs → apiMachine-CqW2m6Zr.cjs} +81 -26
- package/dist/{attachmentContent-NmVfKp-B.cjs → attachmentContent-BEeT2J5n.cjs} +2 -2
- package/dist/{attachmentContent-CC4yIrSm.mjs → attachmentContent-CyptLIfq.mjs} +2 -2
- package/dist/{auth-Bb_SL2os.cjs → auth-C9NvNHhL.cjs} +5 -5
- package/dist/{auth-DKa4MsAi.cjs → auth-CA1OClsW.cjs} +8 -8
- package/dist/{auth-Bh6SUoGi.mjs → auth-CFQikywl.mjs} +8 -8
- package/dist/{auth-Bj0psrD2.mjs → auth-DL8_J9vu.mjs} +5 -5
- package/dist/{auto-DK7pbCnV.mjs → auto-CKI05w1D.mjs} +17 -17
- package/dist/{auto-C9Qohh0P.cjs → auto-uQOxlxLp.cjs} +17 -17
- package/dist/{bootstrap-Ct9Nb4sv.mjs → bootstrap-DaZ0Np7X.mjs} +2 -2
- package/dist/{bootstrap-DBJB0y-H.cjs → bootstrap-DsZGc69k.cjs} +2 -2
- package/dist/{browser-BGxDRhHy.mjs → browser-BUIaSHK2.mjs} +1 -1
- package/dist/{browser-CLJWcodR.cjs → browser-Ft0ASDm7.cjs} +1 -1
- package/dist/claudeAccountEnv-BOBpJ3k8.cjs +137 -0
- package/dist/claudeAccountEnv-ON24i0qv.mjs +132 -0
- package/dist/{claudeLocal-Ux31hZyC.mjs → claudeLocal-B1ZVtryl.mjs} +5 -5
- package/dist/{claudeLocal-B6YDYlnY.cjs → claudeLocal-BMf9t4Fa.cjs} +5 -5
- package/dist/{claudeLocalLauncher-D06QijMw.mjs → claudeLocalLauncher-Bp8bqF4y.mjs} +10 -10
- package/dist/{claudeLocalLauncher-DFvmF8rC.cjs → claudeLocalLauncher-C8TeJcfF.cjs} +10 -10
- package/dist/{claudeSessionFork-D2GI7P59.mjs → claudeSessionFork-8AA47z8Y.mjs} +1 -1
- package/dist/{claudeSessionFork-DTLZ2rek.cjs → claudeSessionFork-YiktY55n.cjs} +1 -1
- package/dist/{client-CnGNYidN.mjs → client-Bm4oKvW7.mjs} +2 -2
- package/dist/{client-CtL0Vtww.mjs → client-BmPaBnDK.mjs} +4 -4
- package/dist/{client-CARZ_lNS.cjs → client-CFHZfh9x.cjs} +4 -4
- package/dist/{client-Bffkrs5p.cjs → client-Crh8_cNx.cjs} +2 -2
- package/dist/{client-DZkBUoh9.mjs → client-Cxlp_D4I.mjs} +2 -2
- package/dist/{client-CMKGrnmT.cjs → client-D8XROyZc.cjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +16 -16
- package/dist/codex/happyMcpStdioBridge.mjs +16 -16
- package/dist/{codexAppServerClient-CLc5nhLT.mjs → codexAppServerClient-BWJbLCQn.mjs} +3 -3
- package/dist/{codexAppServerClient-CpT9F6EM.cjs → codexAppServerClient-q8GHQhyC.cjs} +3 -3
- package/dist/{codexCommand-Dliq3EBv.mjs → codexCommand-BfXfRQr4.mjs} +121 -61
- package/dist/{codexCommand-39kH99SJ.cjs → codexCommand-BgpGg-Zy.cjs} +121 -61
- package/dist/{codexTermination-ByW7tRjr.cjs → codexTermination-CVUF0X75.cjs} +1 -1
- package/dist/{codexTermination-ORIw0gpU.mjs → codexTermination-s9fd1gkA.mjs} +1 -1
- package/dist/{config-CeIzCsfj.cjs → config-BAjyTyYp.cjs} +3 -3
- package/dist/{config-CxSsGO1Z.mjs → config-BF8XgLyc.mjs} +3 -3
- package/dist/{configuration-Dt5lKW3P.cjs → configuration-CXEVKAyF.cjs} +1 -1
- package/dist/{configuration-Dechcvd-.mjs → configuration-IhRiLDVe.mjs} +1 -1
- package/dist/{connect-UwQHvCpR.mjs → connect-LZh1gr08.mjs} +13 -13
- package/dist/{connect-NPDzIVC6.cjs → connect-rCS56arw.cjs} +13 -13
- package/dist/{context-BdZssgF0.cjs → context-3_S_mWz9.cjs} +1 -1
- package/dist/{context-C9JbJoNe.mjs → context-DO6F5YwH.mjs} +1 -1
- package/dist/{controlClient-D7NGfmtq.mjs → controlClient-8ILulwjc.mjs} +14 -5
- package/dist/{controlClient-BRk65BRO.cjs → controlClient-j7p5p3_7.cjs} +15 -4
- package/dist/{createSessionMetadata-B_HZCDj_.cjs → createSessionMetadata-DwdD_uVo.cjs} +2 -2
- package/dist/{createSessionMetadata-DyhFKAby.mjs → createSessionMetadata-oyaTZm1b.mjs} +2 -2
- package/dist/daemonAccounts-BCjDgoNt.cjs +51 -0
- package/dist/daemonAccounts-BJgt6IJe.mjs +27 -0
- package/dist/defaultPermissionMode-BFShzF55.cjs +49 -0
- package/dist/defaultPermissionMode-Lt3PUCwY.mjs +43 -0
- package/dist/{deterministicJson-BEygolBQ.cjs → deterministicJson-DUN0v3St.cjs} +13 -13
- package/dist/{deterministicJson-DNmMVhFu.mjs → deterministicJson-Dfp-7wUZ.mjs} +13 -13
- package/dist/{doctor-BdBi7TFZ.mjs → doctor-B_UwMcVT.mjs} +7 -7
- package/dist/{doctor-B9lW1WlG.cjs → doctor-FgUYTbAT.cjs} +7 -7
- package/dist/{downloadTarget-DS0zT2AU.cjs → downloadTarget-BrrQEDxg.cjs} +6 -6
- package/dist/{downloadTarget-CGojGjaN.mjs → downloadTarget-C0d6jRx-.mjs} +6 -6
- package/dist/{ensureDaemonRunning-Bibp6vhe.cjs → ensureDaemonRunning-Cq4FYI5Q.cjs} +5 -5
- package/dist/{ensureDaemonRunning-BOdbryDM.mjs → ensureDaemonRunning-KUMFfIil.mjs} +5 -5
- package/dist/{handleResumeCommand-CgLzBYne.mjs → handleResumeCommand-BGhVo3QH.mjs} +5 -5
- package/dist/{handleResumeCommand-DXOuWr4p.cjs → handleResumeCommand-Cl9GIL5F.cjs} +5 -5
- package/dist/{index-Db0HIC-k.mjs → index-BjXjMhGY.mjs} +4 -4
- package/dist/{index-BOe6dKnL.cjs → index-BzAYnYct.cjs} +186 -0
- package/dist/{index-CwRW11hT.cjs → index-CQ_hLLCj.cjs} +3 -3
- package/dist/{index-DXSIi6j_.cjs → index-CRipkiqo.cjs} +4 -4
- package/dist/{index-Bs5FD8JF.cjs → index-CZaLMmPC.cjs} +4 -4
- package/dist/{index-CBHfkQNY.mjs → index-Ca1Tt96A.mjs} +45 -41
- package/dist/{index-f8oDidjV.cjs → index-D8ODb0_U.cjs} +44 -40
- package/dist/{index-DmqsRnV7.mjs → index-DYD3GM1m.mjs} +168 -1
- package/dist/{index-rNTX33in.mjs → index-JQDyJ3Li.mjs} +3 -3
- package/dist/{index-DUByZsKe.mjs → index-v5EmjT8l.mjs} +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-CXIL_FYx.cjs → install-ClUA9tbC.cjs} +3 -3
- package/dist/{install-DfPrEWGG.mjs → install-D6EHRtAN.mjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +292 -0
- package/dist/lib.d.mts +292 -0
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-D0DF20oG.mjs → lidState-CZOXXdzv.mjs} +1 -1
- package/dist/{lidState-q_XFYg33.cjs → lidState-DqoN7zH4.cjs} +1 -1
- package/dist/{localHappyAgentAuth-CKNW-MXw.cjs → localHappyAgentAuth-BnGCpHRX.cjs} +1 -1
- package/dist/{localHappyAgentAuth-BBhM4Qk1.mjs → localHappyAgentAuth-YHxDZ4x4.mjs} +1 -1
- package/dist/{logger-BBRTTVsQ.cjs → logger-8su64lqR.cjs} +2 -2
- package/dist/{logger-CL7pin9b.mjs → logger-Fd_rNvgd.mjs} +2 -2
- package/dist/{machineMetadata-DP06qdBk.mjs → machineMetadata-1HIIC7Bc.mjs} +3 -3
- package/dist/{machineMetadata-DnFNlrVK.cjs → machineMetadata-DYXt3p6u.cjs} +3 -3
- package/dist/{main-DO7nRvhf.mjs → main-BI6GIzUL.mjs} +92 -48
- package/dist/{main-DLOXykOR.cjs → main-C_GrcYkn.cjs} +92 -48
- package/dist/{mcp-Du0MgR7e.cjs → mcp-BycIv9oQ.cjs} +18 -15
- package/dist/{mcp-C-4sPTae.mjs → mcp-XGoxywno.mjs} +18 -15
- package/dist/{mirrorProtocol-GuWMxLkh.cjs → mirrorProtocol-DVnB8EO8.cjs} +3 -3
- package/dist/{mirrorProtocol-dkq2ZENA.mjs → mirrorProtocol-DXT3rv7T.mjs} +3 -3
- package/dist/{package-C6uiXULx.mjs → package-6KkRAops.mjs} +7 -7
- package/dist/{package-DrY090nZ.cjs → package-iuLlSiSF.cjs} +7 -7
- package/dist/{panels-4DRBKHZP.cjs → panels-0C89q0Tu.cjs} +5 -5
- package/dist/{panels-DXYdJA6n.mjs → panels-B5Di2zb2.mjs} +5 -5
- package/dist/{peerTools-5ZM4spcZ.cjs → peerTools-CANTX_mG.cjs} +5 -5
- package/dist/{peerTools-dY1aJez4.mjs → peerTools-CKJ-IDM4.mjs} +5 -5
- package/dist/{persistence-Bl5S3TLB.cjs → persistence-B4ttN-fR.cjs} +2 -2
- package/dist/{persistence-Dogj7JIp.mjs → persistence-DWcHe035.mjs} +2 -2
- package/dist/{piRunnerArgs-C3jZ1M6b.cjs → piRunnerArgs-BOkfxyak.cjs} +1 -1
- package/dist/{piRunnerArgs-D8nN_Iit.mjs → piRunnerArgs-Bl5GpBoN.mjs} +2 -2
- package/dist/{piRuntime-BoeMsAXK.mjs → piRuntime-BhwxzdQf.mjs} +1 -1
- package/dist/{piRuntime-Bd9-eq6M.cjs → piRuntime-DzrIiZU8.cjs} +1 -1
- package/dist/{piTerminal-C3j1ca3x.cjs → piTerminal-BdS7ol7v.cjs} +20 -17
- package/dist/{piTerminal-GEPkIGD4.mjs → piTerminal-DnA2CbGr.mjs} +20 -17
- package/dist/{pushNotifications-CfspRcl-.cjs → pushNotifications-BqFoLye2.cjs} +12 -3
- package/dist/{pushNotifications-dUceOIni.mjs → pushNotifications-DkQ0yvFs.mjs} +12 -3
- package/dist/{query-DjsVgG3E.cjs → query-BQ4br3yn.cjs} +1 -1
- package/dist/{query-iYH-tm7L.mjs → query-BRJYSkb1.mjs} +1 -1
- package/dist/{rateLimitReporter-jeVi-fym.mjs → rateLimitReporter-BRbYkmuP.mjs} +3 -3
- package/dist/{rateLimitReporter-DUu2KydZ.cjs → rateLimitReporter-DK5SQuCc.cjs} +3 -3
- package/dist/{rateLimitWindows-Bx3ROBP5.cjs → rateLimitWindows-DBfiuYeg.cjs} +1 -1
- package/dist/{rateLimitWindows-CEn0DXaX.mjs → rateLimitWindows-Da5AR-4u.mjs} +1 -1
- package/dist/reconnectEnv-B31lY4nR.cjs +27 -0
- package/dist/reconnectEnv-DeSvHl3q.mjs +24 -0
- package/dist/{registerCommonHandlers-Beun-cQv.cjs → registerCommonHandlers-m6pxxf2J.cjs} +2 -2
- package/dist/{registerCommonHandlers-DWZ7mfdt.mjs → registerCommonHandlers-yQ7Ru-l0.mjs} +2 -2
- package/dist/{registerKillSessionHandler-CA1FFr_F.cjs → registerKillSessionHandler-BAOIa_Fs.cjs} +6 -6
- package/dist/{registerKillSessionHandler-CzgklwLG.mjs → registerKillSessionHandler-BDNpi7YO.mjs} +6 -6
- package/dist/{remoteSessionClient-BiC2KDew.mjs → remoteSessionClient-CZ7aaNgj.mjs} +5 -5
- package/dist/{remoteSessionClient-DGFI__5Z.cjs → remoteSessionClient-iJMXRN_D.cjs} +5 -5
- package/dist/{reportProgressTool-CgPy6n_7.mjs → reportProgressTool-DfQhPu0s.mjs} +3 -3
- package/dist/{reportProgressTool-CvPGov1F.cjs → reportProgressTool-DpFs7pSe.cjs} +3 -3
- package/dist/{run-B_gFgJVB.mjs → run-CwN28mcj.mjs} +215 -52
- package/dist/{run-rPqQwDi_.cjs → run-p-xp1_HY.cjs} +214 -51
- package/dist/{runClaude-DM8gm8iu.cjs → runClaude-D6U1Z575.cjs} +83 -48
- package/dist/{runClaude-CykqeXK7.mjs → runClaude-DRKtAGTm.mjs} +83 -48
- package/dist/{runClaudeDeps-D2phXGut.mjs → runClaudeDeps-BheVcIlD.mjs} +147 -69
- package/dist/{runClaudeDeps-DGAomimZ.cjs → runClaudeDeps-Dkofokgb.cjs} +142 -64
- package/dist/{runGemini-CXTeSOZp.cjs → runGemini-C8q3YCc0.cjs} +33 -33
- package/dist/{runGemini-CtWCVkj5.mjs → runGemini-owbvhFbi.mjs} +33 -33
- package/dist/{runOpenClaw-CH_9_RyZ.cjs → runOpenClaw-DGeN66-t.cjs} +18 -18
- package/dist/{runOpenClaw-BBdjlViJ.mjs → runOpenClaw-Dky3-mjO.mjs} +18 -18
- package/dist/{sandbox-Bb5IMun3.cjs → sandbox-D2CPyoCA.cjs} +4 -4
- package/dist/{sandbox-DGmXZ6Zz.mjs → sandbox-sq_wy9Gl.mjs} +4 -4
- package/dist/{selfCheck-CccwNTTK.cjs → selfCheck-BgLvQKSt.cjs} +39 -37
- package/dist/selfCheck-vkfrgQ7X.mjs +88 -0
- package/dist/{send-BpiXPkDo.cjs → send-Cd10YhXh.cjs} +8 -8
- package/dist/{send-B6rHg8GT.mjs → send-K9vg-8t-.mjs} +8 -8
- package/dist/{server-DHUzjApC.cjs → server-DRrV64r0.cjs} +6 -6
- package/dist/{server-BkdAyHhC.mjs → server-De4W1zuK.mjs} +4 -4
- package/dist/{sessionLock-BFBReiKq.cjs → sessionLock-BDtSzzKS.cjs} +10 -3
- package/dist/{sessionLock-Ca_bIo50.mjs → sessionLock-Dl6i7IgA.mjs} +10 -4
- package/dist/{sessionOps-DeWVqpe4.cjs → sessionOps-DvnEH4PL.cjs} +6 -4
- package/dist/{sessionOps-CA2kpm66.mjs → sessionOps-gU88-W9F.mjs} +6 -4
- package/dist/sessionProvider-CKcIo7KO.mjs +108 -0
- package/dist/sessionProvider-CbSZeZrl.cjs +113 -0
- package/dist/{sessionScanner-CGzsN8V6.cjs → sessionScanner-7RtcCeyD.cjs} +3 -3
- package/dist/{sessionScanner-DDDud5re.mjs → sessionScanner-DR32uSby.mjs} +3 -3
- package/dist/{sessions-CKJPWFgu.cjs → sessions-BvuMjgvJ.cjs} +10 -10
- package/dist/{sessions-B4d50sCI.mjs → sessions-DTt2Eguk.mjs} +10 -10
- package/dist/{setupOfflineReconnection-CyPNgyCe.mjs → setupOfflineReconnection-BGnvhRfb.mjs} +2 -2
- package/dist/{setupOfflineReconnection-DPXRo_zf.cjs → setupOfflineReconnection-DduOsw6p.cjs} +2 -2
- package/dist/{spawn-CrYN_OOT.mjs → spawn-CL3cUc7b.mjs} +26 -17
- package/dist/{spawn-CgSJzzWS.cjs → spawn-DMB6rRPA.cjs} +26 -17
- package/dist/{spawnAgents-C1-4m7aN.cjs → spawnAgents-CClb7buD.cjs} +8 -2
- package/dist/{spawnAgents-DWCDYCQ1.mjs → spawnAgents-CRMfOJhh.mjs} +8 -2
- package/dist/{spawnHappyCLI-DjbkiSH1.mjs → spawnHappyCLI-Cj_6IICe.mjs} +1 -1
- package/dist/{spawnHappyCLI-CTy3p6V_.cjs → spawnHappyCLI-DJdhX_Qx.cjs} +1 -1
- package/dist/{startFileWatcher-Dedtu1vq.mjs → startFileWatcher-DikVa8kg.mjs} +1 -1
- package/dist/{startFileWatcher-BQs0cJA-.cjs → startFileWatcher-LnOmVW6H.cjs} +1 -1
- package/dist/{startupSessionCreate-Dxy3X4DG.cjs → startupSessionCreate-B3ND-917.cjs} +3 -3
- package/dist/{startupSessionCreate-BKFU4v_h.mjs → startupSessionCreate-CDdaLaMq.mjs} +3 -3
- package/dist/store--XN-7MS0.mjs +269 -0
- package/dist/store-DV__wCvP.cjs +289 -0
- package/dist/{streamRelay-D9a4cBEa.cjs → streamRelay-DFdOaLOn.cjs} +1 -1
- package/dist/{streamRelay-P9e7Sohm.mjs → streamRelay-sABnxEXq.mjs} +1 -1
- package/dist/{sync-eZkXnsW_.mjs → sync-JoEZKRo8.mjs} +1 -1
- package/dist/{sync-DtWB7RzA.cjs → sync-_2lsZ1U2.cjs} +1 -1
- package/dist/{systemPrompt-2XOpZ1j6.cjs → systemPrompt-CJEvNCuW.cjs} +2 -2
- package/dist/{systemPrompt-Bn6g6aCH.mjs → systemPrompt-Zq4HyrZ5.mjs} +2 -2
- package/dist/{teams-ecFay4Gn.cjs → teams-BNZafnrT.cjs} +7 -7
- package/dist/{teams-nadkqrbW.mjs → teams-qz4LqKJ2.mjs} +7 -7
- package/dist/{template-BiTD-jI9.mjs → template-CJ8BWSsc.mjs} +1 -1
- package/dist/{template-17HATY_Y.cjs → template-LgvBbOna.cjs} +1 -1
- package/dist/{time-gPD_EmA-.cjs → time-CaUlWSNJ.cjs} +1 -1
- package/dist/{time-CN3TuSVG.mjs → time-bzmet4s5.mjs} +1 -1
- package/dist/{titleGenerator-lT5ldPuN.cjs → titleGenerator-BuIIu_JP.cjs} +17 -13
- package/dist/{titleGenerator-DgzTQdn2.mjs → titleGenerator-CbTtJ_1D.mjs} +16 -12
- package/dist/{todo-B1VeMk5A.cjs → todo-CQ_BTf9C.cjs} +6 -6
- package/dist/{todo-BIxd7l2Q.mjs → todo-DIrVF_Ak.mjs} +6 -6
- package/dist/{tools-DvqbLsCF.cjs → tools-BnmmFZji.cjs} +1 -1
- package/dist/{tools-zXJpxiG_.mjs → tools-cLOjBvPn.mjs} +1 -1
- package/dist/{uninstall-9htK6mb7.mjs → uninstall-C5OuW6dE.mjs} +3 -3
- package/dist/{uninstall-CvIOpwB5.cjs → uninstall-uEEGKB84.cjs} +3 -3
- package/dist/wrapperAccount-DXlD3bsO.mjs +106 -0
- package/dist/wrapperAccount-DzoGqS2b.cjs +110 -0
- package/package.json +7 -7
- package/dist/defaultPermissionMode-BnxJPVHT.mjs +0 -4
- package/dist/defaultPermissionMode-CxmTXUQR.cjs +0 -7
- package/dist/providerBinding-B-Qbx9W2.cjs +0 -140
- package/dist/providerBinding-CYubGg-Z.mjs +0 -132
- package/dist/selfCheck-BfK945YQ.mjs +0 -86
- package/dist/sessionProvider-VFbtUmMR.cjs +0 -114
- package/dist/sessionProvider-g18IiK74.mjs +0 -109
|
@@ -1,65 +1,72 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var os = require('node:os');
|
|
4
|
-
var sessionLock = require('./sessionLock-
|
|
5
|
-
var persistence = require('./persistence-
|
|
6
|
-
var startupSessionCreate = require('./startupSessionCreate-
|
|
4
|
+
var sessionLock = require('./sessionLock-BDtSzzKS.cjs');
|
|
5
|
+
var persistence = require('./persistence-B4ttN-fR.cjs');
|
|
6
|
+
var startupSessionCreate = require('./startupSessionCreate-B3ND-917.cjs');
|
|
7
7
|
var node_crypto = require('node:crypto');
|
|
8
|
-
var api = require('./api-
|
|
9
|
-
var logger = require('./logger-
|
|
10
|
-
var createSessionMetadata = require('./createSessionMetadata-
|
|
11
|
-
var _package = require('./package-
|
|
12
|
-
var index = require('./index-
|
|
8
|
+
var api = require('./api-hMDsC6Wg.cjs');
|
|
9
|
+
var logger = require('./logger-8su64lqR.cjs');
|
|
10
|
+
var createSessionMetadata = require('./createSessionMetadata-DwdD_uVo.cjs');
|
|
11
|
+
var _package = require('./package-iuLlSiSF.cjs');
|
|
12
|
+
var index = require('./index-BzAYnYct.cjs');
|
|
13
|
+
var defaultPermissionMode = require('./defaultPermissionMode-BFShzF55.cjs');
|
|
13
14
|
var forkBackfill = require('./forkBackfill-8eLDeS73.cjs');
|
|
14
|
-
var configuration = require('./configuration-
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
15
|
+
var configuration = require('./configuration-CXEVKAyF.cjs');
|
|
16
|
+
var wrapperAccount = require('./wrapperAccount-DzoGqS2b.cjs');
|
|
17
|
+
var store = require('./store-DV__wCvP.cjs');
|
|
18
|
+
var controlClient = require('./controlClient-j7p5p3_7.cjs');
|
|
19
|
+
var machineMetadata = require('./machineMetadata-DYXt3p6u.cjs');
|
|
18
20
|
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
19
21
|
var path = require('node:path');
|
|
20
22
|
var permissionMode = require('./permissionMode-CrV-XuMs.cjs');
|
|
21
23
|
var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
22
24
|
var promises = require('node:fs/promises');
|
|
23
|
-
var
|
|
24
|
-
var attachmentContent = require('./attachmentContent-NmVfKp-B.cjs');
|
|
25
|
+
var attachmentContent = require('./attachmentContent-BEeT2J5n.cjs');
|
|
25
26
|
var transcriptCursor = require('./transcriptCursor-DcXGLeSc.cjs');
|
|
26
27
|
var startupPlan = require('./startupPlan-BLMbfQIH.cjs');
|
|
28
|
+
var reconnectEnv = require('./reconnectEnv-B31lY4nR.cjs');
|
|
27
29
|
require('./cliUpdate-DsKXPFYp.cjs');
|
|
28
30
|
require('node:fs');
|
|
29
31
|
require('./processTreeSnapshot-mDbnuojn.cjs');
|
|
30
32
|
require('node:child_process');
|
|
31
33
|
require('zod');
|
|
32
34
|
require('axios');
|
|
33
|
-
require('./lidState-
|
|
35
|
+
require('./lidState-DqoN7zH4.cjs');
|
|
34
36
|
require('os');
|
|
35
37
|
require('child_process');
|
|
36
38
|
require('node:events');
|
|
37
39
|
require('socket.io-client');
|
|
38
|
-
require('./pushNotifications-
|
|
40
|
+
require('./pushNotifications-BqFoLye2.cjs');
|
|
39
41
|
require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
40
42
|
require('./limits-C-a7gr04.cjs');
|
|
41
|
-
require('./time-
|
|
42
|
-
require('./registerCommonHandlers-
|
|
43
|
+
require('./time-CaUlWSNJ.cjs');
|
|
44
|
+
require('./registerCommonHandlers-m6pxxf2J.cjs');
|
|
43
45
|
require('util');
|
|
44
46
|
require('fs/promises');
|
|
45
47
|
require('crypto');
|
|
46
48
|
require('path');
|
|
47
49
|
require('cross-spawn');
|
|
48
50
|
require('@paralleldrive/cuid2');
|
|
49
|
-
require('./sync-
|
|
51
|
+
require('./sync-_2lsZ1U2.cjs');
|
|
50
52
|
require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
51
53
|
require('chalk');
|
|
52
54
|
require('node:util');
|
|
55
|
+
require('./claudeAccountEnv-BOBpJ3k8.cjs');
|
|
53
56
|
require('./detectCLI-BuYR_Qxe.cjs');
|
|
54
57
|
require('fs');
|
|
55
|
-
require('./localHappyAgentAuth-
|
|
58
|
+
require('./localHappyAgentAuth-BnGCpHRX.cjs');
|
|
56
59
|
require('tweetnacl');
|
|
57
60
|
require('./fsMkdir-0K3yENml.cjs');
|
|
58
61
|
require('url');
|
|
59
62
|
|
|
60
63
|
const DEFAULT_CLAUDE_MODEL = void 0;
|
|
61
64
|
const DEFAULT_CLAUDE_EFFORT = void 0;
|
|
62
|
-
const
|
|
65
|
+
const CLAUDE_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
|
|
66
|
+
function restoredClaudeEffort(effort) {
|
|
67
|
+
return CLAUDE_EFFORTS.includes(effort ?? "") ? effort : void 0;
|
|
68
|
+
}
|
|
69
|
+
const importRunClaudeDeps = () => Promise.resolve().then(function () { return require('./runClaudeDeps-Dkofokgb.cjs'); });
|
|
63
70
|
async function runClaude(credentials, options = {}) {
|
|
64
71
|
logger.logger.debug(`[CLAUDE] ===== CLAUDE MODE STARTING =====`);
|
|
65
72
|
logger.logger.debug(`[CLAUDE] This is the Claude agent, NOT Gemini`);
|
|
@@ -69,11 +76,13 @@ async function runClaude(credentials, options = {}) {
|
|
|
69
76
|
prewarmSpawnEnv[key] = process.env[key];
|
|
70
77
|
delete process.env[key];
|
|
71
78
|
}
|
|
79
|
+
const spawnAccountId = process.env[store.SPAWN_ACCOUNT_ENV] || void 0;
|
|
80
|
+
delete process.env[store.SPAWN_ACCOUNT_ENV];
|
|
72
81
|
const workingDirectory = process.cwd();
|
|
73
82
|
const isAssistantVariant = process.env.HAPPY_SESSION_VARIANT === "assistant";
|
|
74
83
|
if (isAssistantVariant) {
|
|
75
84
|
try {
|
|
76
|
-
const { bootstrapAssistantHome } = await Promise.resolve().then(function () { return require('./bootstrap-
|
|
85
|
+
const { bootstrapAssistantHome } = await Promise.resolve().then(function () { return require('./bootstrap-DsZGc69k.cjs'); });
|
|
77
86
|
await bootstrapAssistantHome();
|
|
78
87
|
} catch (error) {
|
|
79
88
|
logger.logger.debug("[START] Assistant home bootstrap failed:", error);
|
|
@@ -93,8 +102,9 @@ async function runClaude(credentials, options = {}) {
|
|
|
93
102
|
}
|
|
94
103
|
return depsLoadPromise;
|
|
95
104
|
};
|
|
105
|
+
const reconnectEnv$1 = reconnectEnv.takeReconnectEnv();
|
|
96
106
|
const reconnectRequested = Boolean(
|
|
97
|
-
|
|
107
|
+
reconnectEnv$1.HAPPY_RECONNECT_SESSION_ID && reconnectEnv$1.HAPPY_RECONNECT_ENCRYPTION_KEY && reconnectEnv$1.HAPPY_RECONNECT_ENCRYPTION_VARIANT
|
|
98
108
|
);
|
|
99
109
|
const startupPlan$1 = startupPlan.planClaudeStartup({ startedBy: options.startedBy, reconnect: reconnectRequested });
|
|
100
110
|
api.connectionState.setBackend("Claude");
|
|
@@ -148,7 +158,12 @@ async function runClaude(credentials, options = {}) {
|
|
|
148
158
|
// a brand-new session cannot pick a PDF until after sending once.
|
|
149
159
|
attachmentKinds: [...attachmentContent.CLAUDE_ATTACHMENT_KINDS],
|
|
150
160
|
queueCancellation: true,
|
|
151
|
-
capabilities: ["claude-steer-v1", "claude-live-permission-v1", "claude-live-permission-v2", "claude-btw-v1", "claude-runtime-controls-v1", "claude-opus-5-5-v1", index.PROMPT_QUEUE_CAPABILITY, forkBackfill.FORK_BACKFILL_CAPABILITY, persistence.HIBERNATION_CAPABILITY, sessionLock.AUTO_RESTART_CAPABILITY, index.PROJECT_SESSION_CAPABILITY],
|
|
161
|
+
capabilities: ["claude-steer-v1", "claude-live-permission-v1", "claude-live-permission-v2", "claude-btw-v1", "claude-runtime-controls-v1", "claude-opus-5-5-v1", index.PROMPT_QUEUE_CAPABILITY, forkBackfill.FORK_BACKFILL_CAPABILITY, persistence.HIBERNATION_CAPABILITY, sessionLock.AUTO_RESTART_CAPABILITY, index.PROJECT_SESSION_CAPABILITY, index.RUN_INTENT_CAPABILITY, index.CLAUDE_CONFIG_MODEL_CAPABILITY, index.AGENT_PROFILE_SESSION_CAPABILITY],
|
|
162
|
+
// B-849b: this session's model / thinking choice (wrapper is the sole
|
|
163
|
+
// writer; a reconnect keeps the server copy). A spawn-time model is a choice.
|
|
164
|
+
modelIntent: options.model ?? null,
|
|
165
|
+
effortIntent: null,
|
|
166
|
+
stickyModel: options.model ?? null,
|
|
152
167
|
// Effective mode this process enforces. Kept current by
|
|
153
168
|
// publishPermissionMode below; the web renders it instead of guessing.
|
|
154
169
|
permissionMode: permissionMode.mapToClaudeMode(initialPermissionMode ?? "default"),
|
|
@@ -169,12 +184,12 @@ async function runClaude(credentials, options = {}) {
|
|
|
169
184
|
// B-586: linked git worktree → branch shown in the session list.
|
|
170
185
|
...createSessionMetadata.sessionWorktreeMetadata(workingDirectory)
|
|
171
186
|
};
|
|
172
|
-
const reconnectSessionId =
|
|
173
|
-
const reconnectKeyBase64 =
|
|
174
|
-
const reconnectVariant =
|
|
175
|
-
const reconnectSeq =
|
|
176
|
-
const reconnectMetadataVersion =
|
|
177
|
-
const reconnectAgentStateVersion =
|
|
187
|
+
const reconnectSessionId = reconnectEnv$1.HAPPY_RECONNECT_SESSION_ID;
|
|
188
|
+
const reconnectKeyBase64 = reconnectEnv$1.HAPPY_RECONNECT_ENCRYPTION_KEY;
|
|
189
|
+
const reconnectVariant = reconnectEnv$1.HAPPY_RECONNECT_ENCRYPTION_VARIANT;
|
|
190
|
+
const reconnectSeq = reconnectEnv$1.HAPPY_RECONNECT_SEQ;
|
|
191
|
+
const reconnectMetadataVersion = reconnectEnv$1.HAPPY_RECONNECT_METADATA_VERSION;
|
|
192
|
+
const reconnectAgentStateVersion = reconnectEnv$1.HAPPY_RECONNECT_AGENT_STATE_VERSION;
|
|
178
193
|
let response;
|
|
179
194
|
if (reconnectSessionId && reconnectKeyBase64 && reconnectVariant) {
|
|
180
195
|
logger.logger.debug(`[START] Reconnecting to existing session ${reconnectSessionId}`);
|
|
@@ -193,7 +208,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
193
208
|
}
|
|
194
209
|
if (!response) {
|
|
195
210
|
let offlineSessionId = null;
|
|
196
|
-
const { claudeLocal } = await Promise.resolve().then(function () { return require('./claudeLocal-
|
|
211
|
+
const { claudeLocal } = await Promise.resolve().then(function () { return require('./claudeLocal-BMf9t4Fa.cjs'); });
|
|
197
212
|
const { createSessionScanner: createSessionScanner2 } = await loadDeps();
|
|
198
213
|
const reconnection = api.startOfflineReconnection({
|
|
199
214
|
serverUrl: configuration.configuration.serverUrl,
|
|
@@ -258,6 +273,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
258
273
|
logger.logger.debug(`[START] Reconnect without server snapshot (${snapshot.reason}); skipping existing messages`);
|
|
259
274
|
}
|
|
260
275
|
}
|
|
276
|
+
const restoredRun = reconnectSeeded ? { model: index.restoredModel(response.metadata), effort: index.restoredEffort(response.metadata) } : null;
|
|
261
277
|
const earlySession = startupPlan$1.sessionClientBeforeWebhook ? api$1.sessionSyncClient(response) : null;
|
|
262
278
|
try {
|
|
263
279
|
logger.logger.debug(`[START] Reporting session ${response.id} to daemon`);
|
|
@@ -429,19 +445,22 @@ async function runClaude(credentials, options = {}) {
|
|
|
429
445
|
}
|
|
430
446
|
});
|
|
431
447
|
options = { ...options, claudeEnvVars: { ...options.claudeEnvVars, VH_PEER_SESSION_ID: response.id } };
|
|
432
|
-
let
|
|
448
|
+
let account;
|
|
433
449
|
try {
|
|
434
|
-
|
|
435
|
-
if (provider) {
|
|
436
|
-
providerBinding.applyProviderEnv(process.env, provider);
|
|
437
|
-
options = { ...options, model: provider.model };
|
|
438
|
-
providerPinnedModel = provider.model;
|
|
439
|
-
logger.logger.debug(`[START] B-794 provider binding: profile=${provider.profile} model=${provider.model} baseUrl=${provider.baseUrl}`);
|
|
440
|
-
}
|
|
450
|
+
account = wrapperAccount.loadWrapperAccount(configuration.configuration.happyHomeDir, response.id, spawnAccountId);
|
|
441
451
|
} catch (error) {
|
|
442
452
|
const reason = error instanceof Error ? error.message : String(error);
|
|
443
|
-
logger.logger.debug(`[START] B-
|
|
444
|
-
|
|
453
|
+
logger.logger.debug(`[START] B-850a account resolution failed: ${reason}`);
|
|
454
|
+
account = spawnAccountId ? { profile: { id: spawnAccountId, label: spawnAccountId, kind: "unknown", status: "unavailable", reason: "error" }, settings: {}, unavailable: true, notices: [`Account "${spawnAccountId}" could not be loaded: ${reason}`], cleanup: () => {
|
|
455
|
+
} } : { profile: null, settings: {}, unavailable: false, notices: [], cleanup: () => {
|
|
456
|
+
} };
|
|
457
|
+
}
|
|
458
|
+
const providerPinnedModel = account.pinnedModel;
|
|
459
|
+
if (providerPinnedModel) options = { ...options, model: providerPinnedModel };
|
|
460
|
+
logger.logger.debug(`[START] B-850a account: ${account.profile ? `${account.profile.id} ${account.profile.kind} ${account.profile.status}` : "machine login"}`);
|
|
461
|
+
session.updateMetadata((current) => ({ ...current, agentProfile: account.profile }));
|
|
462
|
+
for (const notice of account.notices) {
|
|
463
|
+
session.sendSessionEvent({ type: "message", message: notice, kind: account.unavailable ? "agent-profile-unavailable" : "agent-profile-warning" });
|
|
445
464
|
}
|
|
446
465
|
const initialScannerSessionId = forkClaudeSessionId ?? (metadata.claudeSessionId ?? null);
|
|
447
466
|
const transcriptPathHints = new transcriptCursor.TranscriptPathHints();
|
|
@@ -491,7 +510,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
491
510
|
}
|
|
492
511
|
});
|
|
493
512
|
logger.logger.debug(`[START] Hook server started on port ${hookServer.port}`);
|
|
494
|
-
const hookSettingsPath = generateHookSettingsFile(hookServer.port);
|
|
513
|
+
const hookSettingsPath = generateHookSettingsFile(hookServer.port, void 0, account.settings);
|
|
495
514
|
logger.logger.debug(`[START] Generated hook settings file: ${hookSettingsPath}`);
|
|
496
515
|
const logPath = logger.logger.logFilePath;
|
|
497
516
|
logger.logger.infoDeveloper(`Session: ${response.id}`);
|
|
@@ -546,13 +565,14 @@ async function runClaude(credentials, options = {}) {
|
|
|
546
565
|
}
|
|
547
566
|
};
|
|
548
567
|
let lastExplicitModeSwitchAt = 0;
|
|
549
|
-
let currentModel = options.model ?? DEFAULT_CLAUDE_MODEL;
|
|
568
|
+
let currentModel = restoredRun?.model !== void 0 ? restoredRun.model ?? void 0 : options.model ?? DEFAULT_CLAUDE_MODEL;
|
|
550
569
|
let currentFallbackModel = void 0;
|
|
551
570
|
let currentCustomSystemPrompt = void 0;
|
|
552
571
|
let currentAppendSystemPrompt = void 0;
|
|
553
572
|
let currentAllowedTools = void 0;
|
|
554
573
|
let currentDisallowedTools = withAssistantDenylist(void 0, isAssistantVariant);
|
|
555
|
-
let currentEffort = DEFAULT_CLAUDE_EFFORT;
|
|
574
|
+
let currentEffort = restoredClaudeEffort(restoredRun?.effort) ?? DEFAULT_CLAUDE_EFFORT;
|
|
575
|
+
if (restoredRun) logger.logger.debug(`[START] Restored run intent: model=${currentModel ?? "default"} effort=${currentEffort ?? "default"}`);
|
|
556
576
|
registerSideQuestionHandler(session.rpcHandlerManager, {
|
|
557
577
|
getClaudeSessionId: () => {
|
|
558
578
|
const id = currentSession?.sessionId ?? null;
|
|
@@ -561,21 +581,26 @@ async function runClaude(credentials, options = {}) {
|
|
|
561
581
|
getModel: () => currentModel,
|
|
562
582
|
cwd: workingDirectory,
|
|
563
583
|
getEnv: () => options.claudeEnvVars,
|
|
564
|
-
settingsPath: writeSideQuestionSettingsFile(configuration.configuration.happyHomeDir),
|
|
584
|
+
settingsPath: writeSideQuestionSettingsFile(configuration.configuration.happyHomeDir, account.settings),
|
|
565
585
|
// B-482: in remote mode the launcher parks the live Query's /btw entry
|
|
566
586
|
// on the session while the Query is alive; local mode never sets it.
|
|
567
587
|
getLiveQuery: () => currentSession?.getSideQuestionLive() ?? null
|
|
568
588
|
});
|
|
569
589
|
const resetCurrentModeDefaults = () => {
|
|
570
|
-
currentModel = options.model ?? DEFAULT_CLAUDE_MODEL;
|
|
571
590
|
currentFallbackModel = void 0;
|
|
572
591
|
currentCustomSystemPrompt = void 0;
|
|
573
592
|
currentAppendSystemPrompt = void 0;
|
|
574
593
|
currentAllowedTools = void 0;
|
|
575
594
|
currentDisallowedTools = withAssistantDenylist(void 0, isAssistantVariant);
|
|
576
|
-
currentEffort = DEFAULT_CLAUDE_EFFORT;
|
|
577
595
|
logger.logger.debug("[loop] Reset current mode defaults after abort");
|
|
578
596
|
};
|
|
597
|
+
defaultPermissionMode.registerRunIntentRpc(session.rpcHandlerManager, session, (request) => {
|
|
598
|
+
const resolved = resolveMessageMode(currentModeState(), request, { sandboxEnabled, isAssistantVariant, staleModeSnapshot: true, pinnedModel: providerPinnedModel });
|
|
599
|
+
currentModel = resolved.next.model;
|
|
600
|
+
currentEffort = resolved.next.effort;
|
|
601
|
+
logger.logger.debug(`[loop] Run intent set: model=${currentModel ?? "default"} effort=${currentEffort ?? "default"}`);
|
|
602
|
+
return { facts: { stickyModel: currentModel ?? null }, effortRefused: resolved.ignoredEffort !== void 0 };
|
|
603
|
+
});
|
|
579
604
|
const currentModeState = () => ({
|
|
580
605
|
permissionMode: currentPermissionMode,
|
|
581
606
|
model: currentModel,
|
|
@@ -593,6 +618,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
593
618
|
startedBy: options.startedBy,
|
|
594
619
|
startingMode: options.startingMode,
|
|
595
620
|
claudeArgs: options.claudeArgs,
|
|
621
|
+
reconnect: reconnectRequested,
|
|
596
622
|
setting: settings?.claudePrewarm
|
|
597
623
|
};
|
|
598
624
|
const prewarmCtx = () => ({ sandboxEnabled, isAssistantVariant, staleModeSnapshot: false, pinnedModel: providerPinnedModel });
|
|
@@ -610,6 +636,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
610
636
|
let userMessageSeen = false;
|
|
611
637
|
const prewarmTagFiles = /* @__PURE__ */ new Set();
|
|
612
638
|
const createPrewarm = () => {
|
|
639
|
+
if (account.unavailable) return null;
|
|
613
640
|
const eligibility = claudePrewarmEligibility({
|
|
614
641
|
...prewarmSessionInput,
|
|
615
642
|
env: { ...process.env, ...prewarmSpawnEnv },
|
|
@@ -636,7 +663,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
636
663
|
const tag = prewarmHookGate.newTag();
|
|
637
664
|
let tagHookSettingsPath;
|
|
638
665
|
try {
|
|
639
|
-
tagHookSettingsPath = generateHookSettingsFile(hookServer.port, tag);
|
|
666
|
+
tagHookSettingsPath = generateHookSettingsFile(hookServer.port, tag, account.settings);
|
|
640
667
|
} catch (error) {
|
|
641
668
|
slot.release();
|
|
642
669
|
logger.logger.debug(formatPrewarmLine("skipped", "hook-settings"));
|
|
@@ -685,6 +712,11 @@ async function runClaude(credentials, options = {}) {
|
|
|
685
712
|
});
|
|
686
713
|
session.onUserMessage(async (message) => {
|
|
687
714
|
userMessageSeen = true;
|
|
715
|
+
if (account.unavailable && account.profile) {
|
|
716
|
+
if (message.localKey) session.sendQueueCancelReason([message.localKey], "failed");
|
|
717
|
+
session.sendSessionEvent({ type: "message", message: account.notices[0] ?? `Account "${account.profile.label}" is unavailable.`, kind: "agent-profile-unavailable" });
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
688
720
|
if (message?.content?.text) {
|
|
689
721
|
titleGenerator.maybeGenerate(message.content.text);
|
|
690
722
|
boardAnalyzer.noteUserMessage(message.content.text);
|
|
@@ -713,6 +745,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
713
745
|
if (resolved.ignoredEffort !== void 0) {
|
|
714
746
|
logger.logger.debug(`[loop] Ignoring invalid effort from user message: ${resolved.ignoredEffort}`);
|
|
715
747
|
}
|
|
748
|
+
defaultPermissionMode.recordRunIntents(session, resolved.ignoredEffort !== void 0 ? defaultPermissionMode.withoutEffort(message.meta) : message.meta, { stickyModel: currentModel ?? null });
|
|
716
749
|
logger.logger.debug(`[loop] Message mode: permission=${resolved.mode.permissionMode} model=${resolved.mode.model || "default"} effort=${resolved.mode.effort ?? "default"} appendSystemPrompt=${resolved.mode.appendSystemPrompt ? "set" : "none"} customSystemPrompt=${resolved.mode.customSystemPrompt ? "set" : "none"}`);
|
|
717
750
|
scoreFirstMessage(message.meta, predictedFirstMode, resolved.mode);
|
|
718
751
|
const resolvedMode = resolved.mode;
|
|
@@ -837,6 +870,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
837
870
|
happyServer.stop();
|
|
838
871
|
hookServer.stop();
|
|
839
872
|
cleanupHookSettingsFile(hookSettingsPath);
|
|
873
|
+
account.cleanup();
|
|
840
874
|
await remoteScanner.cleanup();
|
|
841
875
|
logger.logger.debug("[START] Cleanup complete, exiting");
|
|
842
876
|
await terminateSurvivors(wrapperTree);
|
|
@@ -982,6 +1016,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
982
1016
|
logger.logger.debug("Stopped Happy MCP server");
|
|
983
1017
|
hookServer.stop();
|
|
984
1018
|
cleanupHookSettingsFile(hookSettingsPath);
|
|
1019
|
+
account.cleanup();
|
|
985
1020
|
logger.logger.debug("Stopped Hook server and cleaned up settings file");
|
|
986
1021
|
process.exit(exitCode);
|
|
987
1022
|
}
|
|
@@ -1,63 +1,70 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
|
-
import { A as AUTO_RESTART_CAPABILITY, c as claimSessionOrExit, a as applyServerSnapshot, b as applyReconnectReplay, w as withoutServerSnapshot, m as mergeReconnectMetadata, t as takeAutoRestartedEvent, e as exitCursorStamp } from './sessionLock-
|
|
3
|
-
import { r as readSettings, H as HIBERNATION_CAPABILITY, a as resolveCheckMs, l as latchKeepAwake, e as evaluateWrapperIdle } from './persistence-
|
|
4
|
-
import { c as createSessionForStartup, H as HibernationProbe, a as commitHibernation } from './startupSessionCreate-
|
|
2
|
+
import { A as AUTO_RESTART_CAPABILITY, c as claimSessionOrExit, a as applyServerSnapshot, b as applyReconnectReplay, w as withoutServerSnapshot, m as mergeReconnectMetadata, t as takeAutoRestartedEvent, e as exitCursorStamp } from './sessionLock-Dl6i7IgA.mjs';
|
|
3
|
+
import { r as readSettings, H as HIBERNATION_CAPABILITY, a as resolveCheckMs, l as latchKeepAwake, e as evaluateWrapperIdle } from './persistence-DWcHe035.mjs';
|
|
4
|
+
import { c as createSessionForStartup, H as HibernationProbe, a as commitHibernation } from './startupSessionCreate-CDdaLaMq.mjs';
|
|
5
5
|
import { randomUUID } from 'node:crypto';
|
|
6
|
-
import { c as connectionState, A as ApiClient, s as startOfflineReconnection } from './api-
|
|
7
|
-
import { l as logger } from './logger-
|
|
8
|
-
import { s as spawnOriginTags, a as sessionWorktreeMetadata } from './createSessionMetadata-
|
|
9
|
-
import { p as packageJson } from './package-
|
|
10
|
-
import { P as PROMPT_QUEUE_CAPABILITY, a as PROJECT_SESSION_CAPABILITY } from './index-
|
|
6
|
+
import { c as connectionState, A as ApiClient, s as startOfflineReconnection } from './api-_LeBScjg.mjs';
|
|
7
|
+
import { l as logger } from './logger-Fd_rNvgd.mjs';
|
|
8
|
+
import { s as spawnOriginTags, a as sessionWorktreeMetadata } from './createSessionMetadata-oyaTZm1b.mjs';
|
|
9
|
+
import { p as packageJson } from './package-6KkRAops.mjs';
|
|
10
|
+
import { P as PROMPT_QUEUE_CAPABILITY, a as PROJECT_SESSION_CAPABILITY, R as RUN_INTENT_CAPABILITY, C as CLAUDE_CONFIG_MODEL_CAPABILITY, A as AGENT_PROFILE_SESSION_CAPABILITY, r as restoredEffort, b as restoredModel } from './index-DYD3GM1m.mjs';
|
|
11
|
+
import { D as DEFAULT_CLAUDE_PERMISSION_MODE, r as registerRunIntentRpc, a as recordRunIntents, w as withoutEffort } from './defaultPermissionMode-Lt3PUCwY.mjs';
|
|
11
12
|
import { F as FORK_BACKFILL_CAPABILITY, p as publishForkBackfillWhenCommitted } from './forkBackfill-DYIjlN1Z.mjs';
|
|
12
|
-
import { c as configuration } from './configuration-
|
|
13
|
-
import { l as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { c as configuration } from './configuration-IhRiLDVe.mjs';
|
|
14
|
+
import { l as loadWrapperAccount } from './wrapperAccount-DXlD3bsO.mjs';
|
|
15
|
+
import { S as SPAWN_ACCOUNT_ENV } from './store--XN-7MS0.mjs';
|
|
16
|
+
import { n as notifyDaemonSessionStarted, c as checkDaemonHibernation } from './controlClient-8ILulwjc.mjs';
|
|
17
|
+
import { g as getInitialMachineMetadata } from './machineMetadata-1HIIC7Bc.mjs';
|
|
16
18
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
17
19
|
import { resolve, join } from 'node:path';
|
|
18
20
|
import { a as applySandboxPermissionPolicy, r as resolveInitialClaudePermissionMode, m as mapToClaudeMode, b as reconcilePublishedPermissionMode } from './permissionMode-CH4FoZfU.mjs';
|
|
19
21
|
import { d as decodeBase64, e as encodeBase64 } from './authRelay-DhQhkBvX.mjs';
|
|
20
22
|
import { readFile } from 'node:fs/promises';
|
|
21
|
-
import {
|
|
22
|
-
import { C as CLAUDE_ATTACHMENT_KINDS, s as stripAttachmentManifest } from './attachmentContent-CC4yIrSm.mjs';
|
|
23
|
+
import { C as CLAUDE_ATTACHMENT_KINDS, s as stripAttachmentManifest } from './attachmentContent-CyptLIfq.mjs';
|
|
23
24
|
import { T as TranscriptPathHints } from './transcriptCursor-B7T_gkQ0.mjs';
|
|
24
25
|
import { p as planClaudeStartup } from './startupPlan-DFMyNgAs.mjs';
|
|
26
|
+
import { t as takeReconnectEnv } from './reconnectEnv-DeSvHl3q.mjs';
|
|
25
27
|
import './cliUpdate-Y34VGe9Y.mjs';
|
|
26
28
|
import 'node:fs';
|
|
27
29
|
import './processTreeSnapshot-CuLJDNC-.mjs';
|
|
28
30
|
import 'node:child_process';
|
|
29
31
|
import 'zod';
|
|
30
32
|
import 'axios';
|
|
31
|
-
import './lidState-
|
|
33
|
+
import './lidState-CZOXXdzv.mjs';
|
|
32
34
|
import 'os';
|
|
33
35
|
import 'child_process';
|
|
34
36
|
import 'node:events';
|
|
35
37
|
import 'socket.io-client';
|
|
36
|
-
import './pushNotifications-
|
|
38
|
+
import './pushNotifications-DkQ0yvFs.mjs';
|
|
37
39
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
38
40
|
import './limits-DIo7rEBR.mjs';
|
|
39
|
-
import './time-
|
|
40
|
-
import './registerCommonHandlers-
|
|
41
|
+
import './time-bzmet4s5.mjs';
|
|
42
|
+
import './registerCommonHandlers-yQ7Ru-l0.mjs';
|
|
41
43
|
import 'util';
|
|
42
44
|
import 'fs/promises';
|
|
43
45
|
import 'crypto';
|
|
44
46
|
import 'path';
|
|
45
47
|
import 'cross-spawn';
|
|
46
48
|
import '@paralleldrive/cuid2';
|
|
47
|
-
import './sync-
|
|
49
|
+
import './sync-JoEZKRo8.mjs';
|
|
48
50
|
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
49
51
|
import 'chalk';
|
|
50
52
|
import 'node:util';
|
|
53
|
+
import './claudeAccountEnv-ON24i0qv.mjs';
|
|
51
54
|
import './detectCLI-CSGMlV51.mjs';
|
|
52
55
|
import 'fs';
|
|
53
|
-
import './localHappyAgentAuth-
|
|
56
|
+
import './localHappyAgentAuth-YHxDZ4x4.mjs';
|
|
54
57
|
import 'tweetnacl';
|
|
55
58
|
import './fsMkdir-DumgLTzR.mjs';
|
|
56
59
|
import 'url';
|
|
57
60
|
|
|
58
61
|
const DEFAULT_CLAUDE_MODEL = void 0;
|
|
59
62
|
const DEFAULT_CLAUDE_EFFORT = void 0;
|
|
60
|
-
const
|
|
63
|
+
const CLAUDE_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
|
|
64
|
+
function restoredClaudeEffort(effort) {
|
|
65
|
+
return CLAUDE_EFFORTS.includes(effort ?? "") ? effort : void 0;
|
|
66
|
+
}
|
|
67
|
+
const importRunClaudeDeps = () => import('./runClaudeDeps-BheVcIlD.mjs');
|
|
61
68
|
async function runClaude(credentials, options = {}) {
|
|
62
69
|
logger.debug(`[CLAUDE] ===== CLAUDE MODE STARTING =====`);
|
|
63
70
|
logger.debug(`[CLAUDE] This is the Claude agent, NOT Gemini`);
|
|
@@ -67,11 +74,13 @@ async function runClaude(credentials, options = {}) {
|
|
|
67
74
|
prewarmSpawnEnv[key] = process.env[key];
|
|
68
75
|
delete process.env[key];
|
|
69
76
|
}
|
|
77
|
+
const spawnAccountId = process.env[SPAWN_ACCOUNT_ENV] || void 0;
|
|
78
|
+
delete process.env[SPAWN_ACCOUNT_ENV];
|
|
70
79
|
const workingDirectory = process.cwd();
|
|
71
80
|
const isAssistantVariant = process.env.HAPPY_SESSION_VARIANT === "assistant";
|
|
72
81
|
if (isAssistantVariant) {
|
|
73
82
|
try {
|
|
74
|
-
const { bootstrapAssistantHome } = await import('./bootstrap-
|
|
83
|
+
const { bootstrapAssistantHome } = await import('./bootstrap-DaZ0Np7X.mjs');
|
|
75
84
|
await bootstrapAssistantHome();
|
|
76
85
|
} catch (error) {
|
|
77
86
|
logger.debug("[START] Assistant home bootstrap failed:", error);
|
|
@@ -91,8 +100,9 @@ async function runClaude(credentials, options = {}) {
|
|
|
91
100
|
}
|
|
92
101
|
return depsLoadPromise;
|
|
93
102
|
};
|
|
103
|
+
const reconnectEnv = takeReconnectEnv();
|
|
94
104
|
const reconnectRequested = Boolean(
|
|
95
|
-
|
|
105
|
+
reconnectEnv.HAPPY_RECONNECT_SESSION_ID && reconnectEnv.HAPPY_RECONNECT_ENCRYPTION_KEY && reconnectEnv.HAPPY_RECONNECT_ENCRYPTION_VARIANT
|
|
96
106
|
);
|
|
97
107
|
const startupPlan = planClaudeStartup({ startedBy: options.startedBy, reconnect: reconnectRequested });
|
|
98
108
|
connectionState.setBackend("Claude");
|
|
@@ -146,7 +156,12 @@ async function runClaude(credentials, options = {}) {
|
|
|
146
156
|
// a brand-new session cannot pick a PDF until after sending once.
|
|
147
157
|
attachmentKinds: [...CLAUDE_ATTACHMENT_KINDS],
|
|
148
158
|
queueCancellation: true,
|
|
149
|
-
capabilities: ["claude-steer-v1", "claude-live-permission-v1", "claude-live-permission-v2", "claude-btw-v1", "claude-runtime-controls-v1", "claude-opus-5-5-v1", PROMPT_QUEUE_CAPABILITY, FORK_BACKFILL_CAPABILITY, HIBERNATION_CAPABILITY, AUTO_RESTART_CAPABILITY, PROJECT_SESSION_CAPABILITY],
|
|
159
|
+
capabilities: ["claude-steer-v1", "claude-live-permission-v1", "claude-live-permission-v2", "claude-btw-v1", "claude-runtime-controls-v1", "claude-opus-5-5-v1", PROMPT_QUEUE_CAPABILITY, FORK_BACKFILL_CAPABILITY, HIBERNATION_CAPABILITY, AUTO_RESTART_CAPABILITY, PROJECT_SESSION_CAPABILITY, RUN_INTENT_CAPABILITY, CLAUDE_CONFIG_MODEL_CAPABILITY, AGENT_PROFILE_SESSION_CAPABILITY],
|
|
160
|
+
// B-849b: this session's model / thinking choice (wrapper is the sole
|
|
161
|
+
// writer; a reconnect keeps the server copy). A spawn-time model is a choice.
|
|
162
|
+
modelIntent: options.model ?? null,
|
|
163
|
+
effortIntent: null,
|
|
164
|
+
stickyModel: options.model ?? null,
|
|
150
165
|
// Effective mode this process enforces. Kept current by
|
|
151
166
|
// publishPermissionMode below; the web renders it instead of guessing.
|
|
152
167
|
permissionMode: mapToClaudeMode(initialPermissionMode ?? "default"),
|
|
@@ -167,12 +182,12 @@ async function runClaude(credentials, options = {}) {
|
|
|
167
182
|
// B-586: linked git worktree → branch shown in the session list.
|
|
168
183
|
...sessionWorktreeMetadata(workingDirectory)
|
|
169
184
|
};
|
|
170
|
-
const reconnectSessionId =
|
|
171
|
-
const reconnectKeyBase64 =
|
|
172
|
-
const reconnectVariant =
|
|
173
|
-
const reconnectSeq =
|
|
174
|
-
const reconnectMetadataVersion =
|
|
175
|
-
const reconnectAgentStateVersion =
|
|
185
|
+
const reconnectSessionId = reconnectEnv.HAPPY_RECONNECT_SESSION_ID;
|
|
186
|
+
const reconnectKeyBase64 = reconnectEnv.HAPPY_RECONNECT_ENCRYPTION_KEY;
|
|
187
|
+
const reconnectVariant = reconnectEnv.HAPPY_RECONNECT_ENCRYPTION_VARIANT;
|
|
188
|
+
const reconnectSeq = reconnectEnv.HAPPY_RECONNECT_SEQ;
|
|
189
|
+
const reconnectMetadataVersion = reconnectEnv.HAPPY_RECONNECT_METADATA_VERSION;
|
|
190
|
+
const reconnectAgentStateVersion = reconnectEnv.HAPPY_RECONNECT_AGENT_STATE_VERSION;
|
|
176
191
|
let response;
|
|
177
192
|
if (reconnectSessionId && reconnectKeyBase64 && reconnectVariant) {
|
|
178
193
|
logger.debug(`[START] Reconnecting to existing session ${reconnectSessionId}`);
|
|
@@ -191,7 +206,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
191
206
|
}
|
|
192
207
|
if (!response) {
|
|
193
208
|
let offlineSessionId = null;
|
|
194
|
-
const { claudeLocal } = await import('./claudeLocal-
|
|
209
|
+
const { claudeLocal } = await import('./claudeLocal-B1ZVtryl.mjs');
|
|
195
210
|
const { createSessionScanner: createSessionScanner2 } = await loadDeps();
|
|
196
211
|
const reconnection = startOfflineReconnection({
|
|
197
212
|
serverUrl: configuration.serverUrl,
|
|
@@ -256,6 +271,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
256
271
|
logger.debug(`[START] Reconnect without server snapshot (${snapshot.reason}); skipping existing messages`);
|
|
257
272
|
}
|
|
258
273
|
}
|
|
274
|
+
const restoredRun = reconnectSeeded ? { model: restoredModel(response.metadata), effort: restoredEffort(response.metadata) } : null;
|
|
259
275
|
const earlySession = startupPlan.sessionClientBeforeWebhook ? api.sessionSyncClient(response) : null;
|
|
260
276
|
try {
|
|
261
277
|
logger.debug(`[START] Reporting session ${response.id} to daemon`);
|
|
@@ -427,19 +443,22 @@ async function runClaude(credentials, options = {}) {
|
|
|
427
443
|
}
|
|
428
444
|
});
|
|
429
445
|
options = { ...options, claudeEnvVars: { ...options.claudeEnvVars, VH_PEER_SESSION_ID: response.id } };
|
|
430
|
-
let
|
|
446
|
+
let account;
|
|
431
447
|
try {
|
|
432
|
-
|
|
433
|
-
if (provider) {
|
|
434
|
-
applyProviderEnv(process.env, provider);
|
|
435
|
-
options = { ...options, model: provider.model };
|
|
436
|
-
providerPinnedModel = provider.model;
|
|
437
|
-
logger.debug(`[START] B-794 provider binding: profile=${provider.profile} model=${provider.model} baseUrl=${provider.baseUrl}`);
|
|
438
|
-
}
|
|
448
|
+
account = loadWrapperAccount(configuration.happyHomeDir, response.id, spawnAccountId);
|
|
439
449
|
} catch (error) {
|
|
440
450
|
const reason = error instanceof Error ? error.message : String(error);
|
|
441
|
-
logger.debug(`[START] B-
|
|
442
|
-
|
|
451
|
+
logger.debug(`[START] B-850a account resolution failed: ${reason}`);
|
|
452
|
+
account = spawnAccountId ? { profile: { id: spawnAccountId, label: spawnAccountId, kind: "unknown", status: "unavailable", reason: "error" }, settings: {}, unavailable: true, notices: [`Account "${spawnAccountId}" could not be loaded: ${reason}`], cleanup: () => {
|
|
453
|
+
} } : { profile: null, settings: {}, unavailable: false, notices: [], cleanup: () => {
|
|
454
|
+
} };
|
|
455
|
+
}
|
|
456
|
+
const providerPinnedModel = account.pinnedModel;
|
|
457
|
+
if (providerPinnedModel) options = { ...options, model: providerPinnedModel };
|
|
458
|
+
logger.debug(`[START] B-850a account: ${account.profile ? `${account.profile.id} ${account.profile.kind} ${account.profile.status}` : "machine login"}`);
|
|
459
|
+
session.updateMetadata((current) => ({ ...current, agentProfile: account.profile }));
|
|
460
|
+
for (const notice of account.notices) {
|
|
461
|
+
session.sendSessionEvent({ type: "message", message: notice, kind: account.unavailable ? "agent-profile-unavailable" : "agent-profile-warning" });
|
|
443
462
|
}
|
|
444
463
|
const initialScannerSessionId = forkClaudeSessionId ?? (metadata.claudeSessionId ?? null);
|
|
445
464
|
const transcriptPathHints = new TranscriptPathHints();
|
|
@@ -489,7 +508,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
489
508
|
}
|
|
490
509
|
});
|
|
491
510
|
logger.debug(`[START] Hook server started on port ${hookServer.port}`);
|
|
492
|
-
const hookSettingsPath = generateHookSettingsFile(hookServer.port);
|
|
511
|
+
const hookSettingsPath = generateHookSettingsFile(hookServer.port, void 0, account.settings);
|
|
493
512
|
logger.debug(`[START] Generated hook settings file: ${hookSettingsPath}`);
|
|
494
513
|
const logPath = logger.logFilePath;
|
|
495
514
|
logger.infoDeveloper(`Session: ${response.id}`);
|
|
@@ -544,13 +563,14 @@ async function runClaude(credentials, options = {}) {
|
|
|
544
563
|
}
|
|
545
564
|
};
|
|
546
565
|
let lastExplicitModeSwitchAt = 0;
|
|
547
|
-
let currentModel = options.model ?? DEFAULT_CLAUDE_MODEL;
|
|
566
|
+
let currentModel = restoredRun?.model !== void 0 ? restoredRun.model ?? void 0 : options.model ?? DEFAULT_CLAUDE_MODEL;
|
|
548
567
|
let currentFallbackModel = void 0;
|
|
549
568
|
let currentCustomSystemPrompt = void 0;
|
|
550
569
|
let currentAppendSystemPrompt = void 0;
|
|
551
570
|
let currentAllowedTools = void 0;
|
|
552
571
|
let currentDisallowedTools = withAssistantDenylist(void 0, isAssistantVariant);
|
|
553
|
-
let currentEffort = DEFAULT_CLAUDE_EFFORT;
|
|
572
|
+
let currentEffort = restoredClaudeEffort(restoredRun?.effort) ?? DEFAULT_CLAUDE_EFFORT;
|
|
573
|
+
if (restoredRun) logger.debug(`[START] Restored run intent: model=${currentModel ?? "default"} effort=${currentEffort ?? "default"}`);
|
|
554
574
|
registerSideQuestionHandler(session.rpcHandlerManager, {
|
|
555
575
|
getClaudeSessionId: () => {
|
|
556
576
|
const id = currentSession?.sessionId ?? null;
|
|
@@ -559,21 +579,26 @@ async function runClaude(credentials, options = {}) {
|
|
|
559
579
|
getModel: () => currentModel,
|
|
560
580
|
cwd: workingDirectory,
|
|
561
581
|
getEnv: () => options.claudeEnvVars,
|
|
562
|
-
settingsPath: writeSideQuestionSettingsFile(configuration.happyHomeDir),
|
|
582
|
+
settingsPath: writeSideQuestionSettingsFile(configuration.happyHomeDir, account.settings),
|
|
563
583
|
// B-482: in remote mode the launcher parks the live Query's /btw entry
|
|
564
584
|
// on the session while the Query is alive; local mode never sets it.
|
|
565
585
|
getLiveQuery: () => currentSession?.getSideQuestionLive() ?? null
|
|
566
586
|
});
|
|
567
587
|
const resetCurrentModeDefaults = () => {
|
|
568
|
-
currentModel = options.model ?? DEFAULT_CLAUDE_MODEL;
|
|
569
588
|
currentFallbackModel = void 0;
|
|
570
589
|
currentCustomSystemPrompt = void 0;
|
|
571
590
|
currentAppendSystemPrompt = void 0;
|
|
572
591
|
currentAllowedTools = void 0;
|
|
573
592
|
currentDisallowedTools = withAssistantDenylist(void 0, isAssistantVariant);
|
|
574
|
-
currentEffort = DEFAULT_CLAUDE_EFFORT;
|
|
575
593
|
logger.debug("[loop] Reset current mode defaults after abort");
|
|
576
594
|
};
|
|
595
|
+
registerRunIntentRpc(session.rpcHandlerManager, session, (request) => {
|
|
596
|
+
const resolved = resolveMessageMode(currentModeState(), request, { sandboxEnabled, isAssistantVariant, staleModeSnapshot: true, pinnedModel: providerPinnedModel });
|
|
597
|
+
currentModel = resolved.next.model;
|
|
598
|
+
currentEffort = resolved.next.effort;
|
|
599
|
+
logger.debug(`[loop] Run intent set: model=${currentModel ?? "default"} effort=${currentEffort ?? "default"}`);
|
|
600
|
+
return { facts: { stickyModel: currentModel ?? null }, effortRefused: resolved.ignoredEffort !== void 0 };
|
|
601
|
+
});
|
|
577
602
|
const currentModeState = () => ({
|
|
578
603
|
permissionMode: currentPermissionMode,
|
|
579
604
|
model: currentModel,
|
|
@@ -591,6 +616,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
591
616
|
startedBy: options.startedBy,
|
|
592
617
|
startingMode: options.startingMode,
|
|
593
618
|
claudeArgs: options.claudeArgs,
|
|
619
|
+
reconnect: reconnectRequested,
|
|
594
620
|
setting: settings?.claudePrewarm
|
|
595
621
|
};
|
|
596
622
|
const prewarmCtx = () => ({ sandboxEnabled, isAssistantVariant, staleModeSnapshot: false, pinnedModel: providerPinnedModel });
|
|
@@ -608,6 +634,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
608
634
|
let userMessageSeen = false;
|
|
609
635
|
const prewarmTagFiles = /* @__PURE__ */ new Set();
|
|
610
636
|
const createPrewarm = () => {
|
|
637
|
+
if (account.unavailable) return null;
|
|
611
638
|
const eligibility = claudePrewarmEligibility({
|
|
612
639
|
...prewarmSessionInput,
|
|
613
640
|
env: { ...process.env, ...prewarmSpawnEnv },
|
|
@@ -634,7 +661,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
634
661
|
const tag = prewarmHookGate.newTag();
|
|
635
662
|
let tagHookSettingsPath;
|
|
636
663
|
try {
|
|
637
|
-
tagHookSettingsPath = generateHookSettingsFile(hookServer.port, tag);
|
|
664
|
+
tagHookSettingsPath = generateHookSettingsFile(hookServer.port, tag, account.settings);
|
|
638
665
|
} catch (error) {
|
|
639
666
|
slot.release();
|
|
640
667
|
logger.debug(formatPrewarmLine("skipped", "hook-settings"));
|
|
@@ -683,6 +710,11 @@ async function runClaude(credentials, options = {}) {
|
|
|
683
710
|
});
|
|
684
711
|
session.onUserMessage(async (message) => {
|
|
685
712
|
userMessageSeen = true;
|
|
713
|
+
if (account.unavailable && account.profile) {
|
|
714
|
+
if (message.localKey) session.sendQueueCancelReason([message.localKey], "failed");
|
|
715
|
+
session.sendSessionEvent({ type: "message", message: account.notices[0] ?? `Account "${account.profile.label}" is unavailable.`, kind: "agent-profile-unavailable" });
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
686
718
|
if (message?.content?.text) {
|
|
687
719
|
titleGenerator.maybeGenerate(message.content.text);
|
|
688
720
|
boardAnalyzer.noteUserMessage(message.content.text);
|
|
@@ -711,6 +743,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
711
743
|
if (resolved.ignoredEffort !== void 0) {
|
|
712
744
|
logger.debug(`[loop] Ignoring invalid effort from user message: ${resolved.ignoredEffort}`);
|
|
713
745
|
}
|
|
746
|
+
recordRunIntents(session, resolved.ignoredEffort !== void 0 ? withoutEffort(message.meta) : message.meta, { stickyModel: currentModel ?? null });
|
|
714
747
|
logger.debug(`[loop] Message mode: permission=${resolved.mode.permissionMode} model=${resolved.mode.model || "default"} effort=${resolved.mode.effort ?? "default"} appendSystemPrompt=${resolved.mode.appendSystemPrompt ? "set" : "none"} customSystemPrompt=${resolved.mode.customSystemPrompt ? "set" : "none"}`);
|
|
715
748
|
scoreFirstMessage(message.meta, predictedFirstMode, resolved.mode);
|
|
716
749
|
const resolvedMode = resolved.mode;
|
|
@@ -835,6 +868,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
835
868
|
happyServer.stop();
|
|
836
869
|
hookServer.stop();
|
|
837
870
|
cleanupHookSettingsFile(hookSettingsPath);
|
|
871
|
+
account.cleanup();
|
|
838
872
|
await remoteScanner.cleanup();
|
|
839
873
|
logger.debug("[START] Cleanup complete, exiting");
|
|
840
874
|
await terminateSurvivors(wrapperTree);
|
|
@@ -980,6 +1014,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
980
1014
|
logger.debug("Stopped Happy MCP server");
|
|
981
1015
|
hookServer.stop();
|
|
982
1016
|
cleanupHookSettingsFile(hookSettingsPath);
|
|
1017
|
+
account.cleanup();
|
|
983
1018
|
logger.debug("Stopped Hook server and cleaned up settings file");
|
|
984
1019
|
process.exit(exitCode);
|
|
985
1020
|
}
|