very-happy-cli 0.2.191 → 0.2.193
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-CCy_9AfR.mjs → AcpBackend-B4PwjqHt.mjs} +3 -3
- package/dist/{AcpBackend-DgrIc1vH.cjs → AcpBackend-DtJCgftG.cjs} +3 -3
- package/dist/{AcpSessionManager-CQnxx7gD.mjs → AcpSessionManager-BzKWgkdP.mjs} +2 -2
- package/dist/{AcpSessionManager-DVOzCD3P.cjs → AcpSessionManager-D4qshX_H.cjs} +2 -2
- package/dist/{BasePermissionHandler-C9Ag7yvs.cjs → BasePermissionHandler-5iG-cvA2.cjs} +1 -1
- package/dist/{BasePermissionHandler-DYLN6Ec9.mjs → BasePermissionHandler-DV6UM6e9.mjs} +1 -1
- package/dist/account-Dco_nGT4.mjs +297 -0
- package/dist/account-DvpA60oU.cjs +302 -0
- package/dist/accountService-Cd7bnkfd.mjs +916 -0
- package/dist/accountService-CuUSJDhP.cjs +921 -0
- package/dist/{acpSessionResume-TvP_4Zq2.cjs → acpSessionResume-Bk9mjXZ9.cjs} +1 -1
- package/dist/{acpSessionResume-Bi7pA1n_.mjs → acpSessionResume-TQwN9ZZE.mjs} +1 -1
- package/dist/{agentHome-DGv105SR.mjs → agentHome-Bep8semY.mjs} +4 -4
- package/dist/{agentHome-DNUKJWOY.cjs → agentHome-c2dlgcw1.cjs} +4 -4
- package/dist/{api-BBxZ7y2z.cjs → api-CBE_a88I.cjs} +10 -10
- package/dist/{api-jfeMRg5R.mjs → api-DUfunY3x.mjs} +10 -10
- package/dist/{apiMachine-DqyjKBZG.cjs → apiMachine-BqtG0IWm.cjs} +83 -27
- package/dist/{apiMachine-DRJ7y-BB.mjs → apiMachine-CU_bw5nV.mjs} +78 -22
- package/dist/{attachmentContent-BO2njyza.cjs → attachmentContent-B3AzuYqk.cjs} +2 -2
- package/dist/{attachmentContent-Dm_RIs5L.mjs → attachmentContent-KNIZxwlu.mjs} +2 -2
- package/dist/{auth-BYDtjVNb.mjs → auth-CZ7pKS-j.mjs} +8 -8
- package/dist/{auth-DnxoVkkf.cjs → auth-DCjxpI6Z.cjs} +5 -5
- package/dist/{auth-DLR3ksCF.cjs → auth-SJ_dPw7H.cjs} +8 -8
- package/dist/{auth-DC6rg8lJ.mjs → auth-jN5dNqTO.mjs} +5 -5
- package/dist/{auto-CwO0u8hB.cjs → auto-B_59RYH1.cjs} +23 -21
- package/dist/{auto-D5Jhukq1.mjs → auto-DC0Sq-qB.mjs} +23 -21
- package/dist/{bootstrap-rLaL3kTa.mjs → bootstrap-B3gMpU9e.mjs} +2 -2
- package/dist/{bootstrap-sly4qPPY.cjs → bootstrap-CoJu9VnB.cjs} +2 -2
- package/dist/{browser-CHpVgyni.mjs → browser-LHW2hBH8.mjs} +1 -1
- package/dist/{browser-BTgZ9d4i.cjs → browser-v1pdPP1E.cjs} +1 -1
- package/dist/claudeAccountEnv-BL1pR_37.mjs +133 -0
- package/dist/claudeAccountEnv-CEX_EMZr.cjs +138 -0
- package/dist/{claudeLocal-Bgb5GGsq.mjs → claudeLocal-BZUgA5G2.mjs} +5 -5
- package/dist/{claudeLocal-1vuTFcL8.cjs → claudeLocal-BrzM2RBI.cjs} +5 -5
- package/dist/{claudeLocalLauncher-T7EfT68h.mjs → claudeLocalLauncher-A0AQyHFi.mjs} +10 -10
- package/dist/{claudeLocalLauncher-DOsL6HFY.cjs → claudeLocalLauncher-XAMpXUM7.cjs} +10 -10
- package/dist/{claudeSessionFork-Cko4SaVi.cjs → claudeSessionFork-Mhn2fYe_.cjs} +1 -1
- package/dist/{claudeSessionFork-CPvi6yDX.mjs → claudeSessionFork-_GwIlmMB.mjs} +1 -1
- package/dist/{client-BXD66ZF5.mjs → client-7RnI9J0W.mjs} +2 -2
- package/dist/{client-Bi20Ka0h.mjs → client-Bde4QVIn.mjs} +4 -2
- package/dist/{client-C5-C0t2a.cjs → client-CJr8Pjwm.cjs} +4 -2
- package/dist/{client-BscskEBk.cjs → client-D2GWkd-T.cjs} +2 -2
- package/dist/{client-C-OdTbrU.cjs → client-DLlnmAPL.cjs} +4 -4
- package/dist/{client-Bh1aUPh-.mjs → client-DwbhrX6D.mjs} +4 -4
- 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-DXhAf6i-.mjs → codexAppServerClient-B3QJV6Ey.mjs} +18 -7
- package/dist/{codexAppServerClient-DKXeikEe.cjs → codexAppServerClient-DWEsZUC4.cjs} +18 -7
- package/dist/{codexCommand-DvbbpYBS.cjs → codexCommand-Bg8AmxVm.cjs} +195 -63
- package/dist/{codexCommand-CIaOiiOj.mjs → codexCommand-D1xlj4sT.mjs} +196 -64
- package/dist/{codexTermination-BszWfyk5.cjs → codexTermination-ByX9GcEJ.cjs} +1 -1
- package/dist/{codexTermination-BcQdEDaw.mjs → codexTermination-CaWAVQjZ.mjs} +1 -1
- package/dist/{config-Di3Cf6js.cjs → config-B2GGbiTv.cjs} +3 -3
- package/dist/{config-OCEcVVK1.mjs → config-C2XYEwXz.mjs} +3 -3
- package/dist/{configuration-DfPBa-9d.cjs → configuration-BBK0rmmj.cjs} +1 -1
- package/dist/{configuration-ECqXu34R.mjs → configuration-ThKBP_zY.mjs} +1 -1
- package/dist/{connect-BTfAUhk8.mjs → connect-BirnCl9q.mjs} +13 -13
- package/dist/{connect-BPQRuOw5.cjs → connect-C3tZs_NC.cjs} +13 -13
- package/dist/{context-CfgTFpCB.mjs → context-C0EFLnOg.mjs} +1 -1
- package/dist/{context-Co7hUaW-.cjs → context-wDp0aZBK.cjs} +1 -1
- package/dist/{controlClient-ClI7A0qE.mjs → controlClient-Ckl8N1MS.mjs} +14 -5
- package/dist/{controlClient-C13_pSKG.cjs → controlClient-DwWTns3A.cjs} +15 -4
- package/dist/{createSessionMetadata-Cf78KHtt.cjs → createSessionMetadata-DqZ6h02H.cjs} +2 -2
- package/dist/{createSessionMetadata-B0eT_Kfj.mjs → createSessionMetadata-vug4Cv8z.mjs} +2 -2
- package/dist/daemonAccounts-CpGDY_4k.cjs +54 -0
- package/dist/daemonAccounts-DwPwKxvv.mjs +30 -0
- package/dist/{defaultPermissionMode-oqTupStc.cjs → defaultPermissionMode-BakXiqRr.cjs} +1 -1
- package/dist/{defaultPermissionMode-m6z2QVyP.mjs → defaultPermissionMode-DF5AfeBb.mjs} +1 -1
- package/dist/{deterministicJson-BtSwbsok.mjs → deterministicJson-BzX94gi3.mjs} +13 -13
- package/dist/{deterministicJson-CpFFgUL_.cjs → deterministicJson-t33SsuRC.cjs} +13 -13
- package/dist/{doctor-BEU0_1Xv.cjs → doctor-B9ug1LZb.cjs} +7 -7
- package/dist/{doctor-lsxmAK4o.mjs → doctor-C1zyOSXw.mjs} +7 -7
- package/dist/{downloadTarget-BXqXhNF7.mjs → downloadTarget-Baslc6jW.mjs} +6 -6
- package/dist/{downloadTarget-CikzJv1h.cjs → downloadTarget-T1id2Gh6.cjs} +6 -6
- package/dist/{ensureDaemonRunning-B_9WAlbU.mjs → ensureDaemonRunning-C6ERYK-O.mjs} +5 -5
- package/dist/{ensureDaemonRunning-BUuH-pbE.cjs → ensureDaemonRunning-CoAg11Zi.cjs} +5 -5
- package/dist/{handleResumeCommand-BK9XKH_l.mjs → handleResumeCommand-CrlqDuz7.mjs} +5 -5
- package/dist/{handleResumeCommand-Dj7oi2KO.cjs → handleResumeCommand-DPi-sPm7.cjs} +5 -5
- package/dist/{index-D3c7CLot.cjs → index-B1swQJUS.cjs} +4 -4
- package/dist/{index-CmZusg8Q.cjs → index-B2dJA8VG.cjs} +3 -3
- package/dist/{index-CLUHaPU8.cjs → index-BUFrKZeQ.cjs} +205 -5
- package/dist/{index-BjZnpGWX.mjs → index-BbdV2mzy.mjs} +3 -3
- package/dist/{index-BdOJOZ6J.mjs → index-BcSPg3c5.mjs} +4 -4
- package/dist/{index-CauRYQKr.cjs → index-Bkslzin5.cjs} +44 -40
- package/dist/{index-DuK9XYbZ.mjs → index-Cn73rdtQ.mjs} +4 -4
- package/dist/{index-Bq8NKSCF.mjs → index-D1YnIih6.mjs} +195 -6
- package/dist/{index-Cxso1rg4.mjs → index-fZO4nF6e.mjs} +45 -41
- package/dist/{index-Dg2NAF_-.cjs → index-rocrvOYG.cjs} +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-DXllkuy0.cjs → install-CArXjPfW.cjs} +3 -3
- package/dist/{install-DTIveLOS.mjs → install-CChhyV2G.mjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +354 -0
- package/dist/lib.d.mts +354 -0
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-CD81ryTy.mjs → lidState-B6yYKjNK.mjs} +1 -1
- package/dist/{lidState-C9_DoF9i.cjs → lidState-B_v6qgfE.cjs} +1 -1
- package/dist/{localHappyAgentAuth-Cg-m1lwm.mjs → localHappyAgentAuth-KRlg_aI0.mjs} +1 -1
- package/dist/{localHappyAgentAuth-CCjUvOfi.cjs → localHappyAgentAuth-jJH0n67S.cjs} +1 -1
- package/dist/{logger-Ct2zvaq0.cjs → logger-CX3x2eI4.cjs} +2 -2
- package/dist/{logger-GcbI0eg2.mjs → logger-JV7-4Q_6.mjs} +2 -2
- package/dist/{machineMetadata-CXRmFNOV.mjs → machineMetadata-D5-SW9kv.mjs} +3 -3
- package/dist/{machineMetadata-DDCVWb_x.cjs → machineMetadata-DhZuM0iB.cjs} +3 -3
- package/dist/{main-BHC-WIcM.cjs → main-1x1HGQEy.cjs} +92 -48
- package/dist/{main-omGr_ONk.mjs → main-CFOdXbPD.mjs} +92 -48
- package/dist/{mcp-xUzii0m8.cjs → mcp-BnKBSEh7.cjs} +18 -15
- package/dist/{mcp-D5hxmRAq.mjs → mcp-R6lMcFLO.mjs} +18 -15
- package/dist/{mirrorProtocol-Lcx20Oby.mjs → mirrorProtocol-CD4ntuZJ.mjs} +3 -3
- package/dist/{mirrorProtocol-Dfl8Ahyf.cjs → mirrorProtocol-DO-KtvAL.cjs} +3 -3
- package/dist/{package-BsUHyqWe.mjs → package-Bw3H6VLn.mjs} +7 -7
- package/dist/{package-9n7wd2dT.cjs → package-uzlvxa5S.cjs} +7 -7
- package/dist/{panels-CpEKWWbI.mjs → panels-BamhZCoZ.mjs} +5 -5
- package/dist/{panels-BfknEmt7.cjs → panels-C46FxjmH.cjs} +5 -5
- package/dist/{peerTools-CElYh-5u.cjs → peerTools-D-VNNFw-.cjs} +5 -5
- package/dist/{peerTools-CwCe6tmJ.mjs → peerTools-WtRgTSqG.mjs} +5 -5
- package/dist/{persistence-Cpw4yJs8.mjs → persistence-Cg4sfjQV.mjs} +2 -2
- package/dist/{persistence-A2NeERZJ.cjs → persistence-CsmAgN-C.cjs} +2 -2
- package/dist/{piRunnerArgs-Bqmu16He.mjs → piRunnerArgs-BbaAQvb4.mjs} +2 -2
- package/dist/{piRunnerArgs-BnFU0K73.cjs → piRunnerArgs-vnFygygF.cjs} +1 -1
- package/dist/{piRuntime-Cgn1b0OX.mjs → piRuntime-Bid7TBf5.mjs} +1 -1
- package/dist/{piRuntime-DpS9TAIs.cjs → piRuntime-C2uj5Ucx.cjs} +1 -1
- package/dist/{piTerminal-rmve-VlI.cjs → piTerminal-Ckpjfoqa.cjs} +20 -17
- package/dist/{piTerminal-BGdps8f3.mjs → piTerminal-CqxgrI13.mjs} +20 -17
- package/dist/{pushNotifications-23YSd-0l.cjs → pushNotifications-BCg7YAiu.cjs} +5 -3
- package/dist/{pushNotifications-XAM8__Pg.mjs → pushNotifications-BbE-qV9I.mjs} +5 -3
- package/dist/{query-SZcYnJoW.mjs → query-Bfr9O_62.mjs} +1 -1
- package/dist/{query-u2GX-I0C.cjs → query-vQ-HG394.cjs} +1 -1
- package/dist/{rateLimitReporter-CaTzBe3x.cjs → rateLimitReporter-BZ8x0-6-.cjs} +3 -3
- package/dist/{rateLimitReporter-COUkf446.mjs → rateLimitReporter-CAz7VMw4.mjs} +3 -3
- package/dist/{rateLimitWindows-B2Kx6L0S.cjs → rateLimitWindows-BZl6GMwQ.cjs} +1 -1
- package/dist/{rateLimitWindows-j_qQk0KY.mjs → rateLimitWindows-CRARnKaI.mjs} +1 -1
- package/dist/reconnectEnv-B31lY4nR.cjs +27 -0
- package/dist/reconnectEnv-DeSvHl3q.mjs +24 -0
- package/dist/{registerCommonHandlers-D1MiSfcB.cjs → registerCommonHandlers-CZGmrPbT.cjs} +2 -2
- package/dist/{registerCommonHandlers-DRRfinzK.mjs → registerCommonHandlers-Cj3Nl9y-.mjs} +2 -2
- package/dist/{registerKillSessionHandler-Cpug_r5C.mjs → registerKillSessionHandler-Bg9t45Ub.mjs} +6 -6
- package/dist/{registerKillSessionHandler-hvCsEn7b.cjs → registerKillSessionHandler-C3EDnW4F.cjs} +6 -6
- package/dist/{remoteSessionClient-BdnJ_n8C.mjs → remoteSessionClient--0vfA7I5.mjs} +5 -5
- package/dist/{remoteSessionClient-6ymeMVa4.cjs → remoteSessionClient-CcSP24Zq.cjs} +5 -5
- package/dist/{reportProgressTool-XgQBzxoD.mjs → reportProgressTool-DVru7jc_.mjs} +3 -3
- package/dist/{reportProgressTool-tzQLCLIw.cjs → reportProgressTool-Ddg1yVq2.cjs} +3 -3
- package/dist/{run-DYL_wuj7.cjs → run-BTrIT_jU.cjs} +347 -856
- package/dist/{run-Bt0AklUU.mjs → run-HtvH6BLi.mjs} +346 -855
- package/dist/{runClaude-C3rii_S6.mjs → runClaude-DsHTk5Bu.mjs} +62 -44
- package/dist/{runClaude-CBEpYO4S.cjs → runClaude-ipjwAHPI.cjs} +62 -44
- package/dist/{runClaudeDeps-CYuozSC6.cjs → runClaudeDeps-BKpwL6ln.cjs} +51 -42
- package/dist/{runClaudeDeps-DlVfMG4F.mjs → runClaudeDeps-BV3vpeyY.mjs} +56 -47
- package/dist/{runGemini-CEI3b90u.cjs → runGemini-B-G0_7Ab.cjs} +33 -33
- package/dist/{runGemini-DkYhRk9S.mjs → runGemini-DhjK6_Fp.mjs} +33 -33
- package/dist/{runOpenClaw-DpprWCoz.mjs → runOpenClaw-B6lawk8n.mjs} +18 -18
- package/dist/{runOpenClaw-BgjD6E4d.cjs → runOpenClaw-BHIo8tkn.cjs} +18 -18
- package/dist/{sandbox-XCDUbH72.cjs → sandbox-BAsO0ILe.cjs} +4 -4
- package/dist/{sandbox-DJ7A7lsy.mjs → sandbox-CKb7pCXg.mjs} +4 -4
- package/dist/selfCheck-CZ-t1Xzq.mjs +88 -0
- package/dist/{selfCheck-BYUDB1Uq.cjs → selfCheck-D4VvVZNi.cjs} +39 -37
- package/dist/{send-CASDBCyJ.cjs → send-Cz5m39QR.cjs} +8 -8
- package/dist/{send-Ba63huxv.mjs → send-D8ipLKMY.mjs} +8 -8
- package/dist/{server-w3W0toNd.mjs → server-CjvgT3N9.mjs} +4 -4
- package/dist/{server-cZoV9XRt.cjs → server-CySyJKPH.cjs} +6 -6
- package/dist/{sessionLock-G2PMqvsh.mjs → sessionLock-B73fhgQN.mjs} +10 -4
- package/dist/{sessionLock-BmLA2S8K.cjs → sessionLock-DdDCuNUs.cjs} +10 -3
- package/dist/{sessionOps-DPw5k8vV.mjs → sessionOps-C65Iej_C.mjs} +50 -8
- package/dist/{sessionOps-DXlTmS7J.cjs → sessionOps-XSEjIqNq.cjs} +50 -8
- package/dist/sessionProvider-CLVNkfji.mjs +110 -0
- package/dist/sessionProvider-Dgsty8z_.cjs +115 -0
- package/dist/{sessionScanner-AHjnicxi.cjs → sessionScanner-D8IVXMMH.cjs} +3 -3
- package/dist/{sessionScanner-BCXpdZJN.mjs → sessionScanner-MW1P9Pm9.mjs} +3 -3
- package/dist/{sessions-BiBXOBx0.cjs → sessions-BKz7gZqg.cjs} +10 -10
- package/dist/{sessions-Clk8MR5Y.mjs → sessions-Dtk_agUL.mjs} +10 -10
- package/dist/{setupOfflineReconnection-DI-QZGYz.mjs → setupOfflineReconnection-Bvdy-2xd.mjs} +2 -2
- package/dist/{setupOfflineReconnection-BKLfOd-i.cjs → setupOfflineReconnection-DxMiW7OV.cjs} +2 -2
- package/dist/{spawn-D5omsx1Q.cjs → spawn-DiPkJcrQ.cjs} +36 -17
- package/dist/{spawn-4tsp1uhh.mjs → spawn-Dm4xsZBX.mjs} +36 -17
- package/dist/{spawnAgents-CtkkIFHd.cjs → spawnAgents-B9olJ8xn.cjs} +1 -1
- package/dist/{spawnAgents-CjoU6ZOS.mjs → spawnAgents-I29H9nO8.mjs} +1 -1
- package/dist/{spawnHappyCLI-CF_gLi92.cjs → spawnHappyCLI-BYGOUda1.cjs} +1 -1
- package/dist/{spawnHappyCLI-CIA9Sc_5.mjs → spawnHappyCLI-CnMwzjWX.mjs} +1 -1
- package/dist/{startFileWatcher-9Stpxe7p.cjs → startFileWatcher-D14W6gn-.cjs} +1 -1
- package/dist/{startFileWatcher-CDO6fb2m.mjs → startFileWatcher-DePAY1T5.mjs} +1 -1
- package/dist/{startupSessionCreate-BtR4iYEC.mjs → startupSessionCreate-DoK0IvJG.mjs} +3 -3
- package/dist/{startupSessionCreate-CcF7rGGB.cjs → startupSessionCreate-rBHd4tc1.cjs} +3 -3
- package/dist/store-CkNa6oj4.cjs +326 -0
- package/dist/store-Vej_738f.mjs +305 -0
- package/dist/{streamRelay-BhI6jqF-.cjs → streamRelay-C0G1HOOd.cjs} +1 -1
- package/dist/{streamRelay-DMwOMTKf.mjs → streamRelay-C5U-C4GS.mjs} +1 -1
- package/dist/{sync-C0PRuTMj.mjs → sync-BP6vnxVP.mjs} +1 -1
- package/dist/{sync-Ba8N6xba.cjs → sync-WYBwkJvG.cjs} +1 -1
- package/dist/{systemPrompt-DV5IReD4.cjs → systemPrompt-BkQlCk5_.cjs} +2 -2
- package/dist/{systemPrompt-D0q8eyjy.mjs → systemPrompt-aRqBmkpw.mjs} +2 -2
- package/dist/{teams-BO3_arwM.mjs → teams-CGmC4ygu.mjs} +7 -7
- package/dist/{teams-z3Gp-KlV.cjs → teams-phbpwAGD.cjs} +7 -7
- package/dist/{template-B_5l6pkc.cjs → template-B9pLEP8v.cjs} +2 -2
- package/dist/{template-DLR_0hfj.mjs → template-CL9EvQLQ.mjs} +2 -2
- package/dist/{time-Cy0a-7YX.cjs → time-BTLcO8jp.cjs} +1 -1
- package/dist/{time-D0jvDRhn.mjs → time-Cw0liIqB.mjs} +1 -1
- package/dist/{titleGenerator-RGHWP2YL.cjs → titleGenerator-Y1_7ceJC.cjs} +17 -13
- package/dist/{titleGenerator-AGQsXskb.mjs → titleGenerator-h6TmFe-c.mjs} +16 -12
- package/dist/{todo-CzIDPLFy.cjs → todo-BxiPiCvB.cjs} +6 -6
- package/dist/{todo-BZ954vsz.mjs → todo-OKcTC_VC.mjs} +6 -6
- package/dist/{tools-Bei5i03L.mjs → tools-BR-drXZ8.mjs} +3 -2
- package/dist/{tools-B1x1j6tz.cjs → tools-CcebYtLj.cjs} +3 -2
- package/dist/{uninstall-C3cnIvz1.cjs → uninstall-CnDeCC-M.cjs} +3 -3
- package/dist/{uninstall-B4T_e3Mr.mjs → uninstall-D3stWKD2.mjs} +3 -3
- package/dist/wrapperAccount-BkufO_9g.mjs +107 -0
- package/dist/wrapperAccount-D2A4DuZy.cjs +113 -0
- package/package.json +7 -7
- package/dist/providerBinding-B-Qbx9W2.cjs +0 -140
- package/dist/providerBinding-CYubGg-Z.mjs +0 -132
- package/dist/selfCheck-C-rNljKV.mjs +0 -86
- package/dist/sessionProvider-DUn91LhJ.mjs +0 -109
- package/dist/sessionProvider-Dg691XQ4.cjs +0 -114
|
@@ -1,56 +1,59 @@
|
|
|
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-B73fhgQN.mjs';
|
|
3
|
+
import { r as readSettings, H as HIBERNATION_CAPABILITY, a as resolveCheckMs, l as latchKeepAwake, e as evaluateWrapperIdle } from './persistence-Cg4sfjQV.mjs';
|
|
4
|
+
import { c as createSessionForStartup, H as HibernationProbe, a as commitHibernation } from './startupSessionCreate-DoK0IvJG.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, R as RUN_INTENT_CAPABILITY, C as CLAUDE_CONFIG_MODEL_CAPABILITY, r as restoredEffort, b as restoredModel } from './index-
|
|
11
|
-
import { D as DEFAULT_CLAUDE_PERMISSION_MODE, r as registerRunIntentRpc, a as recordRunIntents, w as withoutEffort } from './defaultPermissionMode-
|
|
6
|
+
import { c as connectionState, A as ApiClient, s as startOfflineReconnection } from './api-DUfunY3x.mjs';
|
|
7
|
+
import { l as logger } from './logger-JV7-4Q_6.mjs';
|
|
8
|
+
import { s as spawnOriginTags, a as sessionWorktreeMetadata } from './createSessionMetadata-vug4Cv8z.mjs';
|
|
9
|
+
import { p as packageJson } from './package-Bw3H6VLn.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-D1YnIih6.mjs';
|
|
11
|
+
import { D as DEFAULT_CLAUDE_PERMISSION_MODE, r as registerRunIntentRpc, a as recordRunIntents, w as withoutEffort } from './defaultPermissionMode-DF5AfeBb.mjs';
|
|
12
12
|
import { F as FORK_BACKFILL_CAPABILITY, p as publishForkBackfillWhenCommitted } from './forkBackfill-DYIjlN1Z.mjs';
|
|
13
|
-
import { c as configuration } from './configuration-
|
|
14
|
-
import { l as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
13
|
+
import { c as configuration } from './configuration-ThKBP_zY.mjs';
|
|
14
|
+
import { l as loadWrapperAccount } from './wrapperAccount-BkufO_9g.mjs';
|
|
15
|
+
import { S as SPAWN_ACCOUNT_ENV } from './store-Vej_738f.mjs';
|
|
16
|
+
import { n as notifyDaemonSessionStarted, c as checkDaemonHibernation } from './controlClient-Ckl8N1MS.mjs';
|
|
17
|
+
import { g as getInitialMachineMetadata } from './machineMetadata-D5-SW9kv.mjs';
|
|
17
18
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
18
19
|
import { resolve, join } from 'node:path';
|
|
19
20
|
import { a as applySandboxPermissionPolicy, r as resolveInitialClaudePermissionMode, m as mapToClaudeMode, b as reconcilePublishedPermissionMode } from './permissionMode-CH4FoZfU.mjs';
|
|
20
21
|
import { d as decodeBase64, e as encodeBase64 } from './authRelay-DhQhkBvX.mjs';
|
|
21
22
|
import { readFile } from 'node:fs/promises';
|
|
22
|
-
import { C as CLAUDE_ATTACHMENT_KINDS, s as stripAttachmentManifest } from './attachmentContent-
|
|
23
|
+
import { C as CLAUDE_ATTACHMENT_KINDS, s as stripAttachmentManifest } from './attachmentContent-KNIZxwlu.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-B6yYKjNK.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-BbE-qV9I.mjs';
|
|
37
39
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
38
40
|
import './limits-DIo7rEBR.mjs';
|
|
39
|
-
import './time-
|
|
40
|
-
import './registerCommonHandlers-
|
|
41
|
+
import './time-Cw0liIqB.mjs';
|
|
42
|
+
import './registerCommonHandlers-Cj3Nl9y-.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-BP6vnxVP.mjs';
|
|
48
50
|
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
49
51
|
import 'chalk';
|
|
50
52
|
import 'node:util';
|
|
53
|
+
import './claudeAccountEnv-BL1pR_37.mjs';
|
|
51
54
|
import './detectCLI-CSGMlV51.mjs';
|
|
52
55
|
import 'fs';
|
|
53
|
-
import './localHappyAgentAuth-
|
|
56
|
+
import './localHappyAgentAuth-KRlg_aI0.mjs';
|
|
54
57
|
import 'tweetnacl';
|
|
55
58
|
import './fsMkdir-DumgLTzR.mjs';
|
|
56
59
|
import 'url';
|
|
@@ -61,7 +64,7 @@ const CLAUDE_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
|
|
|
61
64
|
function restoredClaudeEffort(effort) {
|
|
62
65
|
return CLAUDE_EFFORTS.includes(effort ?? "") ? effort : void 0;
|
|
63
66
|
}
|
|
64
|
-
const importRunClaudeDeps = () => import('./runClaudeDeps-
|
|
67
|
+
const importRunClaudeDeps = () => import('./runClaudeDeps-BV3vpeyY.mjs');
|
|
65
68
|
async function runClaude(credentials, options = {}) {
|
|
66
69
|
logger.debug(`[CLAUDE] ===== CLAUDE MODE STARTING =====`);
|
|
67
70
|
logger.debug(`[CLAUDE] This is the Claude agent, NOT Gemini`);
|
|
@@ -71,11 +74,13 @@ async function runClaude(credentials, options = {}) {
|
|
|
71
74
|
prewarmSpawnEnv[key] = process.env[key];
|
|
72
75
|
delete process.env[key];
|
|
73
76
|
}
|
|
77
|
+
const spawnAccountId = process.env[SPAWN_ACCOUNT_ENV] || void 0;
|
|
78
|
+
delete process.env[SPAWN_ACCOUNT_ENV];
|
|
74
79
|
const workingDirectory = process.cwd();
|
|
75
80
|
const isAssistantVariant = process.env.HAPPY_SESSION_VARIANT === "assistant";
|
|
76
81
|
if (isAssistantVariant) {
|
|
77
82
|
try {
|
|
78
|
-
const { bootstrapAssistantHome } = await import('./bootstrap-
|
|
83
|
+
const { bootstrapAssistantHome } = await import('./bootstrap-B3gMpU9e.mjs');
|
|
79
84
|
await bootstrapAssistantHome();
|
|
80
85
|
} catch (error) {
|
|
81
86
|
logger.debug("[START] Assistant home bootstrap failed:", error);
|
|
@@ -95,8 +100,9 @@ async function runClaude(credentials, options = {}) {
|
|
|
95
100
|
}
|
|
96
101
|
return depsLoadPromise;
|
|
97
102
|
};
|
|
103
|
+
const reconnectEnv = takeReconnectEnv();
|
|
98
104
|
const reconnectRequested = Boolean(
|
|
99
|
-
|
|
105
|
+
reconnectEnv.HAPPY_RECONNECT_SESSION_ID && reconnectEnv.HAPPY_RECONNECT_ENCRYPTION_KEY && reconnectEnv.HAPPY_RECONNECT_ENCRYPTION_VARIANT
|
|
100
106
|
);
|
|
101
107
|
const startupPlan = planClaudeStartup({ startedBy: options.startedBy, reconnect: reconnectRequested });
|
|
102
108
|
connectionState.setBackend("Claude");
|
|
@@ -150,7 +156,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
150
156
|
// a brand-new session cannot pick a PDF until after sending once.
|
|
151
157
|
attachmentKinds: [...CLAUDE_ATTACHMENT_KINDS],
|
|
152
158
|
queueCancellation: true,
|
|
153
|
-
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],
|
|
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],
|
|
154
160
|
// B-849b: this session's model / thinking choice (wrapper is the sole
|
|
155
161
|
// writer; a reconnect keeps the server copy). A spawn-time model is a choice.
|
|
156
162
|
modelIntent: options.model ?? null,
|
|
@@ -176,12 +182,12 @@ async function runClaude(credentials, options = {}) {
|
|
|
176
182
|
// B-586: linked git worktree → branch shown in the session list.
|
|
177
183
|
...sessionWorktreeMetadata(workingDirectory)
|
|
178
184
|
};
|
|
179
|
-
const reconnectSessionId =
|
|
180
|
-
const reconnectKeyBase64 =
|
|
181
|
-
const reconnectVariant =
|
|
182
|
-
const reconnectSeq =
|
|
183
|
-
const reconnectMetadataVersion =
|
|
184
|
-
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;
|
|
185
191
|
let response;
|
|
186
192
|
if (reconnectSessionId && reconnectKeyBase64 && reconnectVariant) {
|
|
187
193
|
logger.debug(`[START] Reconnecting to existing session ${reconnectSessionId}`);
|
|
@@ -200,7 +206,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
200
206
|
}
|
|
201
207
|
if (!response) {
|
|
202
208
|
let offlineSessionId = null;
|
|
203
|
-
const { claudeLocal } = await import('./claudeLocal-
|
|
209
|
+
const { claudeLocal } = await import('./claudeLocal-BZUgA5G2.mjs');
|
|
204
210
|
const { createSessionScanner: createSessionScanner2 } = await loadDeps();
|
|
205
211
|
const reconnection = startOfflineReconnection({
|
|
206
212
|
serverUrl: configuration.serverUrl,
|
|
@@ -437,19 +443,22 @@ async function runClaude(credentials, options = {}) {
|
|
|
437
443
|
}
|
|
438
444
|
});
|
|
439
445
|
options = { ...options, claudeEnvVars: { ...options.claudeEnvVars, VH_PEER_SESSION_ID: response.id } };
|
|
440
|
-
let
|
|
446
|
+
let account;
|
|
441
447
|
try {
|
|
442
|
-
|
|
443
|
-
if (provider) {
|
|
444
|
-
applyProviderEnv(process.env, provider);
|
|
445
|
-
options = { ...options, model: provider.model };
|
|
446
|
-
providerPinnedModel = provider.model;
|
|
447
|
-
logger.debug(`[START] B-794 provider binding: profile=${provider.profile} model=${provider.model} baseUrl=${provider.baseUrl}`);
|
|
448
|
-
}
|
|
448
|
+
account = loadWrapperAccount(configuration.happyHomeDir, response.id, spawnAccountId);
|
|
449
449
|
} catch (error) {
|
|
450
450
|
const reason = error instanceof Error ? error.message : String(error);
|
|
451
|
-
logger.debug(`[START] B-
|
|
452
|
-
|
|
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" });
|
|
453
462
|
}
|
|
454
463
|
const initialScannerSessionId = forkClaudeSessionId ?? (metadata.claudeSessionId ?? null);
|
|
455
464
|
const transcriptPathHints = new TranscriptPathHints();
|
|
@@ -499,7 +508,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
499
508
|
}
|
|
500
509
|
});
|
|
501
510
|
logger.debug(`[START] Hook server started on port ${hookServer.port}`);
|
|
502
|
-
const hookSettingsPath = generateHookSettingsFile(hookServer.port);
|
|
511
|
+
const hookSettingsPath = generateHookSettingsFile(hookServer.port, void 0, account.settings);
|
|
503
512
|
logger.debug(`[START] Generated hook settings file: ${hookSettingsPath}`);
|
|
504
513
|
const logPath = logger.logFilePath;
|
|
505
514
|
logger.infoDeveloper(`Session: ${response.id}`);
|
|
@@ -570,7 +579,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
570
579
|
getModel: () => currentModel,
|
|
571
580
|
cwd: workingDirectory,
|
|
572
581
|
getEnv: () => options.claudeEnvVars,
|
|
573
|
-
settingsPath: writeSideQuestionSettingsFile(configuration.happyHomeDir),
|
|
582
|
+
settingsPath: writeSideQuestionSettingsFile(configuration.happyHomeDir, account.settings),
|
|
574
583
|
// B-482: in remote mode the launcher parks the live Query's /btw entry
|
|
575
584
|
// on the session while the Query is alive; local mode never sets it.
|
|
576
585
|
getLiveQuery: () => currentSession?.getSideQuestionLive() ?? null
|
|
@@ -607,6 +616,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
607
616
|
startedBy: options.startedBy,
|
|
608
617
|
startingMode: options.startingMode,
|
|
609
618
|
claudeArgs: options.claudeArgs,
|
|
619
|
+
reconnect: reconnectRequested,
|
|
610
620
|
setting: settings?.claudePrewarm
|
|
611
621
|
};
|
|
612
622
|
const prewarmCtx = () => ({ sandboxEnabled, isAssistantVariant, staleModeSnapshot: false, pinnedModel: providerPinnedModel });
|
|
@@ -624,6 +634,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
624
634
|
let userMessageSeen = false;
|
|
625
635
|
const prewarmTagFiles = /* @__PURE__ */ new Set();
|
|
626
636
|
const createPrewarm = () => {
|
|
637
|
+
if (account.unavailable) return null;
|
|
627
638
|
const eligibility = claudePrewarmEligibility({
|
|
628
639
|
...prewarmSessionInput,
|
|
629
640
|
env: { ...process.env, ...prewarmSpawnEnv },
|
|
@@ -650,7 +661,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
650
661
|
const tag = prewarmHookGate.newTag();
|
|
651
662
|
let tagHookSettingsPath;
|
|
652
663
|
try {
|
|
653
|
-
tagHookSettingsPath = generateHookSettingsFile(hookServer.port, tag);
|
|
664
|
+
tagHookSettingsPath = generateHookSettingsFile(hookServer.port, tag, account.settings);
|
|
654
665
|
} catch (error) {
|
|
655
666
|
slot.release();
|
|
656
667
|
logger.debug(formatPrewarmLine("skipped", "hook-settings"));
|
|
@@ -699,6 +710,11 @@ async function runClaude(credentials, options = {}) {
|
|
|
699
710
|
});
|
|
700
711
|
session.onUserMessage(async (message) => {
|
|
701
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
|
+
}
|
|
702
718
|
if (message?.content?.text) {
|
|
703
719
|
titleGenerator.maybeGenerate(message.content.text);
|
|
704
720
|
boardAnalyzer.noteUserMessage(message.content.text);
|
|
@@ -852,6 +868,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
852
868
|
happyServer.stop();
|
|
853
869
|
hookServer.stop();
|
|
854
870
|
cleanupHookSettingsFile(hookSettingsPath);
|
|
871
|
+
account.cleanup();
|
|
855
872
|
await remoteScanner.cleanup();
|
|
856
873
|
logger.debug("[START] Cleanup complete, exiting");
|
|
857
874
|
await terminateSurvivors(wrapperTree);
|
|
@@ -997,6 +1014,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
997
1014
|
logger.debug("Stopped Happy MCP server");
|
|
998
1015
|
hookServer.stop();
|
|
999
1016
|
cleanupHookSettingsFile(hookSettingsPath);
|
|
1017
|
+
account.cleanup();
|
|
1000
1018
|
logger.debug("Stopped Hook server and cleaned up settings file");
|
|
1001
1019
|
process.exit(exitCode);
|
|
1002
1020
|
}
|
|
@@ -1,58 +1,61 @@
|
|
|
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-DdDCuNUs.cjs');
|
|
5
|
+
var persistence = require('./persistence-CsmAgN-C.cjs');
|
|
6
|
+
var startupSessionCreate = require('./startupSessionCreate-rBHd4tc1.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-
|
|
13
|
-
var defaultPermissionMode = require('./defaultPermissionMode-
|
|
8
|
+
var api = require('./api-CBE_a88I.cjs');
|
|
9
|
+
var logger = require('./logger-CX3x2eI4.cjs');
|
|
10
|
+
var createSessionMetadata = require('./createSessionMetadata-DqZ6h02H.cjs');
|
|
11
|
+
var _package = require('./package-uzlvxa5S.cjs');
|
|
12
|
+
var index = require('./index-BUFrKZeQ.cjs');
|
|
13
|
+
var defaultPermissionMode = require('./defaultPermissionMode-BakXiqRr.cjs');
|
|
14
14
|
var forkBackfill = require('./forkBackfill-8eLDeS73.cjs');
|
|
15
|
-
var configuration = require('./configuration-
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
15
|
+
var configuration = require('./configuration-BBK0rmmj.cjs');
|
|
16
|
+
var wrapperAccount = require('./wrapperAccount-D2A4DuZy.cjs');
|
|
17
|
+
var store = require('./store-CkNa6oj4.cjs');
|
|
18
|
+
var controlClient = require('./controlClient-DwWTns3A.cjs');
|
|
19
|
+
var machineMetadata = require('./machineMetadata-DhZuM0iB.cjs');
|
|
19
20
|
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
20
21
|
var path = require('node:path');
|
|
21
22
|
var permissionMode = require('./permissionMode-CrV-XuMs.cjs');
|
|
22
23
|
var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
23
24
|
var promises = require('node:fs/promises');
|
|
24
|
-
var attachmentContent = require('./attachmentContent-
|
|
25
|
+
var attachmentContent = require('./attachmentContent-B3AzuYqk.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-B_v6qgfE.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-BCg7YAiu.cjs');
|
|
39
41
|
require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
40
42
|
require('./limits-C-a7gr04.cjs');
|
|
41
|
-
require('./time-
|
|
42
|
-
require('./registerCommonHandlers-
|
|
43
|
+
require('./time-BTLcO8jp.cjs');
|
|
44
|
+
require('./registerCommonHandlers-CZGmrPbT.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-WYBwkJvG.cjs');
|
|
50
52
|
require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
51
53
|
require('chalk');
|
|
52
54
|
require('node:util');
|
|
55
|
+
require('./claudeAccountEnv-CEX_EMZr.cjs');
|
|
53
56
|
require('./detectCLI-BuYR_Qxe.cjs');
|
|
54
57
|
require('fs');
|
|
55
|
-
require('./localHappyAgentAuth-
|
|
58
|
+
require('./localHappyAgentAuth-jJH0n67S.cjs');
|
|
56
59
|
require('tweetnacl');
|
|
57
60
|
require('./fsMkdir-0K3yENml.cjs');
|
|
58
61
|
require('url');
|
|
@@ -63,7 +66,7 @@ const CLAUDE_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
|
|
|
63
66
|
function restoredClaudeEffort(effort) {
|
|
64
67
|
return CLAUDE_EFFORTS.includes(effort ?? "") ? effort : void 0;
|
|
65
68
|
}
|
|
66
|
-
const importRunClaudeDeps = () => Promise.resolve().then(function () { return require('./runClaudeDeps-
|
|
69
|
+
const importRunClaudeDeps = () => Promise.resolve().then(function () { return require('./runClaudeDeps-BKpwL6ln.cjs'); });
|
|
67
70
|
async function runClaude(credentials, options = {}) {
|
|
68
71
|
logger.logger.debug(`[CLAUDE] ===== CLAUDE MODE STARTING =====`);
|
|
69
72
|
logger.logger.debug(`[CLAUDE] This is the Claude agent, NOT Gemini`);
|
|
@@ -73,11 +76,13 @@ async function runClaude(credentials, options = {}) {
|
|
|
73
76
|
prewarmSpawnEnv[key] = process.env[key];
|
|
74
77
|
delete process.env[key];
|
|
75
78
|
}
|
|
79
|
+
const spawnAccountId = process.env[store.SPAWN_ACCOUNT_ENV] || void 0;
|
|
80
|
+
delete process.env[store.SPAWN_ACCOUNT_ENV];
|
|
76
81
|
const workingDirectory = process.cwd();
|
|
77
82
|
const isAssistantVariant = process.env.HAPPY_SESSION_VARIANT === "assistant";
|
|
78
83
|
if (isAssistantVariant) {
|
|
79
84
|
try {
|
|
80
|
-
const { bootstrapAssistantHome } = await Promise.resolve().then(function () { return require('./bootstrap-
|
|
85
|
+
const { bootstrapAssistantHome } = await Promise.resolve().then(function () { return require('./bootstrap-CoJu9VnB.cjs'); });
|
|
81
86
|
await bootstrapAssistantHome();
|
|
82
87
|
} catch (error) {
|
|
83
88
|
logger.logger.debug("[START] Assistant home bootstrap failed:", error);
|
|
@@ -97,8 +102,9 @@ async function runClaude(credentials, options = {}) {
|
|
|
97
102
|
}
|
|
98
103
|
return depsLoadPromise;
|
|
99
104
|
};
|
|
105
|
+
const reconnectEnv$1 = reconnectEnv.takeReconnectEnv();
|
|
100
106
|
const reconnectRequested = Boolean(
|
|
101
|
-
|
|
107
|
+
reconnectEnv$1.HAPPY_RECONNECT_SESSION_ID && reconnectEnv$1.HAPPY_RECONNECT_ENCRYPTION_KEY && reconnectEnv$1.HAPPY_RECONNECT_ENCRYPTION_VARIANT
|
|
102
108
|
);
|
|
103
109
|
const startupPlan$1 = startupPlan.planClaudeStartup({ startedBy: options.startedBy, reconnect: reconnectRequested });
|
|
104
110
|
api.connectionState.setBackend("Claude");
|
|
@@ -152,7 +158,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
152
158
|
// a brand-new session cannot pick a PDF until after sending once.
|
|
153
159
|
attachmentKinds: [...attachmentContent.CLAUDE_ATTACHMENT_KINDS],
|
|
154
160
|
queueCancellation: true,
|
|
155
|
-
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],
|
|
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],
|
|
156
162
|
// B-849b: this session's model / thinking choice (wrapper is the sole
|
|
157
163
|
// writer; a reconnect keeps the server copy). A spawn-time model is a choice.
|
|
158
164
|
modelIntent: options.model ?? null,
|
|
@@ -178,12 +184,12 @@ async function runClaude(credentials, options = {}) {
|
|
|
178
184
|
// B-586: linked git worktree → branch shown in the session list.
|
|
179
185
|
...createSessionMetadata.sessionWorktreeMetadata(workingDirectory)
|
|
180
186
|
};
|
|
181
|
-
const reconnectSessionId =
|
|
182
|
-
const reconnectKeyBase64 =
|
|
183
|
-
const reconnectVariant =
|
|
184
|
-
const reconnectSeq =
|
|
185
|
-
const reconnectMetadataVersion =
|
|
186
|
-
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;
|
|
187
193
|
let response;
|
|
188
194
|
if (reconnectSessionId && reconnectKeyBase64 && reconnectVariant) {
|
|
189
195
|
logger.logger.debug(`[START] Reconnecting to existing session ${reconnectSessionId}`);
|
|
@@ -202,7 +208,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
202
208
|
}
|
|
203
209
|
if (!response) {
|
|
204
210
|
let offlineSessionId = null;
|
|
205
|
-
const { claudeLocal } = await Promise.resolve().then(function () { return require('./claudeLocal-
|
|
211
|
+
const { claudeLocal } = await Promise.resolve().then(function () { return require('./claudeLocal-BrzM2RBI.cjs'); });
|
|
206
212
|
const { createSessionScanner: createSessionScanner2 } = await loadDeps();
|
|
207
213
|
const reconnection = api.startOfflineReconnection({
|
|
208
214
|
serverUrl: configuration.configuration.serverUrl,
|
|
@@ -439,19 +445,22 @@ async function runClaude(credentials, options = {}) {
|
|
|
439
445
|
}
|
|
440
446
|
});
|
|
441
447
|
options = { ...options, claudeEnvVars: { ...options.claudeEnvVars, VH_PEER_SESSION_ID: response.id } };
|
|
442
|
-
let
|
|
448
|
+
let account;
|
|
443
449
|
try {
|
|
444
|
-
|
|
445
|
-
if (provider) {
|
|
446
|
-
providerBinding.applyProviderEnv(process.env, provider);
|
|
447
|
-
options = { ...options, model: provider.model };
|
|
448
|
-
providerPinnedModel = provider.model;
|
|
449
|
-
logger.logger.debug(`[START] B-794 provider binding: profile=${provider.profile} model=${provider.model} baseUrl=${provider.baseUrl}`);
|
|
450
|
-
}
|
|
450
|
+
account = wrapperAccount.loadWrapperAccount(configuration.configuration.happyHomeDir, response.id, spawnAccountId);
|
|
451
451
|
} catch (error) {
|
|
452
452
|
const reason = error instanceof Error ? error.message : String(error);
|
|
453
|
-
logger.logger.debug(`[START] B-
|
|
454
|
-
|
|
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" });
|
|
455
464
|
}
|
|
456
465
|
const initialScannerSessionId = forkClaudeSessionId ?? (metadata.claudeSessionId ?? null);
|
|
457
466
|
const transcriptPathHints = new transcriptCursor.TranscriptPathHints();
|
|
@@ -501,7 +510,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
501
510
|
}
|
|
502
511
|
});
|
|
503
512
|
logger.logger.debug(`[START] Hook server started on port ${hookServer.port}`);
|
|
504
|
-
const hookSettingsPath = generateHookSettingsFile(hookServer.port);
|
|
513
|
+
const hookSettingsPath = generateHookSettingsFile(hookServer.port, void 0, account.settings);
|
|
505
514
|
logger.logger.debug(`[START] Generated hook settings file: ${hookSettingsPath}`);
|
|
506
515
|
const logPath = logger.logger.logFilePath;
|
|
507
516
|
logger.logger.infoDeveloper(`Session: ${response.id}`);
|
|
@@ -572,7 +581,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
572
581
|
getModel: () => currentModel,
|
|
573
582
|
cwd: workingDirectory,
|
|
574
583
|
getEnv: () => options.claudeEnvVars,
|
|
575
|
-
settingsPath: writeSideQuestionSettingsFile(configuration.configuration.happyHomeDir),
|
|
584
|
+
settingsPath: writeSideQuestionSettingsFile(configuration.configuration.happyHomeDir, account.settings),
|
|
576
585
|
// B-482: in remote mode the launcher parks the live Query's /btw entry
|
|
577
586
|
// on the session while the Query is alive; local mode never sets it.
|
|
578
587
|
getLiveQuery: () => currentSession?.getSideQuestionLive() ?? null
|
|
@@ -609,6 +618,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
609
618
|
startedBy: options.startedBy,
|
|
610
619
|
startingMode: options.startingMode,
|
|
611
620
|
claudeArgs: options.claudeArgs,
|
|
621
|
+
reconnect: reconnectRequested,
|
|
612
622
|
setting: settings?.claudePrewarm
|
|
613
623
|
};
|
|
614
624
|
const prewarmCtx = () => ({ sandboxEnabled, isAssistantVariant, staleModeSnapshot: false, pinnedModel: providerPinnedModel });
|
|
@@ -626,6 +636,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
626
636
|
let userMessageSeen = false;
|
|
627
637
|
const prewarmTagFiles = /* @__PURE__ */ new Set();
|
|
628
638
|
const createPrewarm = () => {
|
|
639
|
+
if (account.unavailable) return null;
|
|
629
640
|
const eligibility = claudePrewarmEligibility({
|
|
630
641
|
...prewarmSessionInput,
|
|
631
642
|
env: { ...process.env, ...prewarmSpawnEnv },
|
|
@@ -652,7 +663,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
652
663
|
const tag = prewarmHookGate.newTag();
|
|
653
664
|
let tagHookSettingsPath;
|
|
654
665
|
try {
|
|
655
|
-
tagHookSettingsPath = generateHookSettingsFile(hookServer.port, tag);
|
|
666
|
+
tagHookSettingsPath = generateHookSettingsFile(hookServer.port, tag, account.settings);
|
|
656
667
|
} catch (error) {
|
|
657
668
|
slot.release();
|
|
658
669
|
logger.logger.debug(formatPrewarmLine("skipped", "hook-settings"));
|
|
@@ -701,6 +712,11 @@ async function runClaude(credentials, options = {}) {
|
|
|
701
712
|
});
|
|
702
713
|
session.onUserMessage(async (message) => {
|
|
703
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
|
+
}
|
|
704
720
|
if (message?.content?.text) {
|
|
705
721
|
titleGenerator.maybeGenerate(message.content.text);
|
|
706
722
|
boardAnalyzer.noteUserMessage(message.content.text);
|
|
@@ -854,6 +870,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
854
870
|
happyServer.stop();
|
|
855
871
|
hookServer.stop();
|
|
856
872
|
cleanupHookSettingsFile(hookSettingsPath);
|
|
873
|
+
account.cleanup();
|
|
857
874
|
await remoteScanner.cleanup();
|
|
858
875
|
logger.logger.debug("[START] Cleanup complete, exiting");
|
|
859
876
|
await terminateSurvivors(wrapperTree);
|
|
@@ -999,6 +1016,7 @@ async function runClaude(credentials, options = {}) {
|
|
|
999
1016
|
logger.logger.debug("Stopped Happy MCP server");
|
|
1000
1017
|
hookServer.stop();
|
|
1001
1018
|
cleanupHookSettingsFile(hookSettingsPath);
|
|
1019
|
+
account.cleanup();
|
|
1002
1020
|
logger.logger.debug("Stopped Hook server and cleaned up settings file");
|
|
1003
1021
|
process.exit(exitCode);
|
|
1004
1022
|
}
|