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,140 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var node_fs = require('node:fs');
|
|
4
|
-
var os = require('node:os');
|
|
5
|
-
var path = require('node:path');
|
|
6
|
-
|
|
7
|
-
const PROVIDER_STRIPPED_ENV_KEYS = [
|
|
8
|
-
"ANTHROPIC_API_KEY",
|
|
9
|
-
"CLAUDE_CODE_OAUTH_TOKEN",
|
|
10
|
-
"CLAUDE_CODE_OAUTH_REFRESH_TOKEN",
|
|
11
|
-
"CLAUDE_CODE_OAUTH_SCOPES",
|
|
12
|
-
"CLAUDE_CODE_USE_BEDROCK",
|
|
13
|
-
"CLAUDE_CODE_USE_VERTEX",
|
|
14
|
-
"ANTHROPIC_CUSTOM_HEADERS",
|
|
15
|
-
"ANTHROPIC_SMALL_FAST_MODEL",
|
|
16
|
-
"CLAUDE_CODE_MAX_CONTEXT_TOKENS"
|
|
17
|
-
];
|
|
18
|
-
function providersPath(happyHomeDir) {
|
|
19
|
-
return path.join(happyHomeDir, "providers.json");
|
|
20
|
-
}
|
|
21
|
-
function sessionProvidersPath(happyHomeDir) {
|
|
22
|
-
return path.join(happyHomeDir, "session-providers.json");
|
|
23
|
-
}
|
|
24
|
-
function expandHome(path$1, home = os.homedir()) {
|
|
25
|
-
return path$1 === "~" ? home : path$1.startsWith("~/") ? path.join(home, path$1.slice(2)) : path$1;
|
|
26
|
-
}
|
|
27
|
-
function readJson(path) {
|
|
28
|
-
if (!node_fs.existsSync(path)) return void 0;
|
|
29
|
-
return JSON.parse(node_fs.readFileSync(path, "utf8"));
|
|
30
|
-
}
|
|
31
|
-
function parseProvidersFile(raw) {
|
|
32
|
-
const profiles = {};
|
|
33
|
-
const src = raw && typeof raw === "object" ? raw.profiles : void 0;
|
|
34
|
-
if (src && typeof src === "object") {
|
|
35
|
-
for (const [id, p] of Object.entries(src)) {
|
|
36
|
-
if (!p || typeof p !== "object") continue;
|
|
37
|
-
const { name, baseUrl, apiKeyFile, models } = p;
|
|
38
|
-
if (typeof baseUrl !== "string" || !/^https?:\/\//.test(baseUrl) || typeof apiKeyFile !== "string" || !apiKeyFile) continue;
|
|
39
|
-
const ids = [];
|
|
40
|
-
const contextWindows = {};
|
|
41
|
-
for (const m of Array.isArray(models) ? models : []) {
|
|
42
|
-
if (typeof m === "string") ids.push(m);
|
|
43
|
-
else if (m && typeof m === "object" && typeof m.id === "string") {
|
|
44
|
-
const { id: modelId, contextWindow } = m;
|
|
45
|
-
ids.push(modelId);
|
|
46
|
-
if (typeof contextWindow === "number" && Number.isInteger(contextWindow) && contextWindow > 0) contextWindows[modelId] = contextWindow;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
profiles[id] = {
|
|
50
|
-
...typeof name === "string" ? { name } : {},
|
|
51
|
-
baseUrl: baseUrl.replace(/\/+$/, ""),
|
|
52
|
-
apiKeyFile,
|
|
53
|
-
...Array.isArray(models) ? { models: ids } : {},
|
|
54
|
-
...Object.keys(contextWindows).length > 0 ? { contextWindows } : {}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return { profiles };
|
|
59
|
-
}
|
|
60
|
-
function parseSessionProvidersFile(raw) {
|
|
61
|
-
const out = {};
|
|
62
|
-
if (!raw || typeof raw !== "object") return out;
|
|
63
|
-
for (const [sessionId, b] of Object.entries(raw)) {
|
|
64
|
-
if (!b || typeof b !== "object") continue;
|
|
65
|
-
const { profile, model } = b;
|
|
66
|
-
if (typeof profile === "string" && profile && typeof model === "string" && model) out[sessionId] = { profile, model };
|
|
67
|
-
}
|
|
68
|
-
return out;
|
|
69
|
-
}
|
|
70
|
-
function readProviders(happyHomeDir) {
|
|
71
|
-
return parseProvidersFile(readJson(providersPath(happyHomeDir)));
|
|
72
|
-
}
|
|
73
|
-
function readSessionProviders(happyHomeDir) {
|
|
74
|
-
return parseSessionProvidersFile(readJson(sessionProvidersPath(happyHomeDir)));
|
|
75
|
-
}
|
|
76
|
-
function buildProviderEnv(profile, model, token) {
|
|
77
|
-
const contextWindow = profile.contextWindows?.[model];
|
|
78
|
-
return {
|
|
79
|
-
ANTHROPIC_BASE_URL: profile.baseUrl,
|
|
80
|
-
ANTHROPIC_AUTH_TOKEN: token,
|
|
81
|
-
ANTHROPIC_MODEL: model,
|
|
82
|
-
ANTHROPIC_DEFAULT_OPUS_MODEL: model,
|
|
83
|
-
ANTHROPIC_DEFAULT_SONNET_MODEL: model,
|
|
84
|
-
ANTHROPIC_DEFAULT_HAIKU_MODEL: model,
|
|
85
|
-
ANTHROPIC_SMALL_FAST_MODEL: model,
|
|
86
|
-
CLAUDE_CODE_SUBAGENT_MODEL: model,
|
|
87
|
-
CLAUDE_CODE_NO_MODEL_FALLBACK: "1",
|
|
88
|
-
...contextWindow ? { CLAUDE_CODE_MAX_CONTEXT_TOKENS: String(contextWindow) } : {}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function resolveSessionProvider(sessionId, deps) {
|
|
92
|
-
const binding = deps.bindings[sessionId];
|
|
93
|
-
if (!binding) return null;
|
|
94
|
-
const profile = deps.providers.profiles[binding.profile];
|
|
95
|
-
if (!profile) throw new Error(`provider profile "${binding.profile}" is not defined in providers.json`);
|
|
96
|
-
const token = deps.readKey(profile.apiKeyFile).trim();
|
|
97
|
-
if (!token) throw new Error(`provider profile "${binding.profile}": api key file is empty`);
|
|
98
|
-
return {
|
|
99
|
-
profile: binding.profile,
|
|
100
|
-
model: binding.model,
|
|
101
|
-
baseUrl: profile.baseUrl,
|
|
102
|
-
env: buildProviderEnv(profile, binding.model, token),
|
|
103
|
-
unset: PROVIDER_STRIPPED_ENV_KEYS
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
function loadSessionProvider(happyHomeDir, sessionId) {
|
|
107
|
-
const bindings = readSessionProviders(happyHomeDir);
|
|
108
|
-
if (!bindings[sessionId]) return null;
|
|
109
|
-
return resolveSessionProvider(sessionId, {
|
|
110
|
-
providers: readProviders(happyHomeDir),
|
|
111
|
-
bindings,
|
|
112
|
-
readKey: (p) => node_fs.readFileSync(expandHome(p), "utf8")
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function applyProviderEnv(env, provider) {
|
|
116
|
-
for (const key of provider.unset) delete env[key];
|
|
117
|
-
Object.assign(env, provider.env);
|
|
118
|
-
}
|
|
119
|
-
function updateBindings(current, sessionId, binding) {
|
|
120
|
-
const next = { ...current };
|
|
121
|
-
if (binding) next[sessionId] = binding;
|
|
122
|
-
else delete next[sessionId];
|
|
123
|
-
return next;
|
|
124
|
-
}
|
|
125
|
-
function writeSessionProviders(happyHomeDir, bindings) {
|
|
126
|
-
const path$1 = sessionProvidersPath(happyHomeDir);
|
|
127
|
-
node_fs.mkdirSync(path.dirname(path$1), { recursive: true });
|
|
128
|
-
const tmp = `${path$1}.${process.pid}.tmp`;
|
|
129
|
-
node_fs.writeFileSync(tmp, JSON.stringify(bindings, null, 2) + "\n", { mode: 384 });
|
|
130
|
-
node_fs.chmodSync(tmp, 384);
|
|
131
|
-
node_fs.renameSync(tmp, path$1);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
exports.applyProviderEnv = applyProviderEnv;
|
|
135
|
-
exports.loadSessionProvider = loadSessionProvider;
|
|
136
|
-
exports.readProviders = readProviders;
|
|
137
|
-
exports.readSessionProviders = readSessionProviders;
|
|
138
|
-
exports.sessionProvidersPath = sessionProvidersPath;
|
|
139
|
-
exports.updateBindings = updateBindings;
|
|
140
|
-
exports.writeSessionProviders = writeSessionProviders;
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { mkdirSync, writeFileSync, chmodSync, renameSync, existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import { dirname, join } from 'node:path';
|
|
4
|
-
|
|
5
|
-
const PROVIDER_STRIPPED_ENV_KEYS = [
|
|
6
|
-
"ANTHROPIC_API_KEY",
|
|
7
|
-
"CLAUDE_CODE_OAUTH_TOKEN",
|
|
8
|
-
"CLAUDE_CODE_OAUTH_REFRESH_TOKEN",
|
|
9
|
-
"CLAUDE_CODE_OAUTH_SCOPES",
|
|
10
|
-
"CLAUDE_CODE_USE_BEDROCK",
|
|
11
|
-
"CLAUDE_CODE_USE_VERTEX",
|
|
12
|
-
"ANTHROPIC_CUSTOM_HEADERS",
|
|
13
|
-
"ANTHROPIC_SMALL_FAST_MODEL",
|
|
14
|
-
"CLAUDE_CODE_MAX_CONTEXT_TOKENS"
|
|
15
|
-
];
|
|
16
|
-
function providersPath(happyHomeDir) {
|
|
17
|
-
return join(happyHomeDir, "providers.json");
|
|
18
|
-
}
|
|
19
|
-
function sessionProvidersPath(happyHomeDir) {
|
|
20
|
-
return join(happyHomeDir, "session-providers.json");
|
|
21
|
-
}
|
|
22
|
-
function expandHome(path, home = homedir()) {
|
|
23
|
-
return path === "~" ? home : path.startsWith("~/") ? join(home, path.slice(2)) : path;
|
|
24
|
-
}
|
|
25
|
-
function readJson(path) {
|
|
26
|
-
if (!existsSync(path)) return void 0;
|
|
27
|
-
return JSON.parse(readFileSync(path, "utf8"));
|
|
28
|
-
}
|
|
29
|
-
function parseProvidersFile(raw) {
|
|
30
|
-
const profiles = {};
|
|
31
|
-
const src = raw && typeof raw === "object" ? raw.profiles : void 0;
|
|
32
|
-
if (src && typeof src === "object") {
|
|
33
|
-
for (const [id, p] of Object.entries(src)) {
|
|
34
|
-
if (!p || typeof p !== "object") continue;
|
|
35
|
-
const { name, baseUrl, apiKeyFile, models } = p;
|
|
36
|
-
if (typeof baseUrl !== "string" || !/^https?:\/\//.test(baseUrl) || typeof apiKeyFile !== "string" || !apiKeyFile) continue;
|
|
37
|
-
const ids = [];
|
|
38
|
-
const contextWindows = {};
|
|
39
|
-
for (const m of Array.isArray(models) ? models : []) {
|
|
40
|
-
if (typeof m === "string") ids.push(m);
|
|
41
|
-
else if (m && typeof m === "object" && typeof m.id === "string") {
|
|
42
|
-
const { id: modelId, contextWindow } = m;
|
|
43
|
-
ids.push(modelId);
|
|
44
|
-
if (typeof contextWindow === "number" && Number.isInteger(contextWindow) && contextWindow > 0) contextWindows[modelId] = contextWindow;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
profiles[id] = {
|
|
48
|
-
...typeof name === "string" ? { name } : {},
|
|
49
|
-
baseUrl: baseUrl.replace(/\/+$/, ""),
|
|
50
|
-
apiKeyFile,
|
|
51
|
-
...Array.isArray(models) ? { models: ids } : {},
|
|
52
|
-
...Object.keys(contextWindows).length > 0 ? { contextWindows } : {}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return { profiles };
|
|
57
|
-
}
|
|
58
|
-
function parseSessionProvidersFile(raw) {
|
|
59
|
-
const out = {};
|
|
60
|
-
if (!raw || typeof raw !== "object") return out;
|
|
61
|
-
for (const [sessionId, b] of Object.entries(raw)) {
|
|
62
|
-
if (!b || typeof b !== "object") continue;
|
|
63
|
-
const { profile, model } = b;
|
|
64
|
-
if (typeof profile === "string" && profile && typeof model === "string" && model) out[sessionId] = { profile, model };
|
|
65
|
-
}
|
|
66
|
-
return out;
|
|
67
|
-
}
|
|
68
|
-
function readProviders(happyHomeDir) {
|
|
69
|
-
return parseProvidersFile(readJson(providersPath(happyHomeDir)));
|
|
70
|
-
}
|
|
71
|
-
function readSessionProviders(happyHomeDir) {
|
|
72
|
-
return parseSessionProvidersFile(readJson(sessionProvidersPath(happyHomeDir)));
|
|
73
|
-
}
|
|
74
|
-
function buildProviderEnv(profile, model, token) {
|
|
75
|
-
const contextWindow = profile.contextWindows?.[model];
|
|
76
|
-
return {
|
|
77
|
-
ANTHROPIC_BASE_URL: profile.baseUrl,
|
|
78
|
-
ANTHROPIC_AUTH_TOKEN: token,
|
|
79
|
-
ANTHROPIC_MODEL: model,
|
|
80
|
-
ANTHROPIC_DEFAULT_OPUS_MODEL: model,
|
|
81
|
-
ANTHROPIC_DEFAULT_SONNET_MODEL: model,
|
|
82
|
-
ANTHROPIC_DEFAULT_HAIKU_MODEL: model,
|
|
83
|
-
ANTHROPIC_SMALL_FAST_MODEL: model,
|
|
84
|
-
CLAUDE_CODE_SUBAGENT_MODEL: model,
|
|
85
|
-
CLAUDE_CODE_NO_MODEL_FALLBACK: "1",
|
|
86
|
-
...contextWindow ? { CLAUDE_CODE_MAX_CONTEXT_TOKENS: String(contextWindow) } : {}
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function resolveSessionProvider(sessionId, deps) {
|
|
90
|
-
const binding = deps.bindings[sessionId];
|
|
91
|
-
if (!binding) return null;
|
|
92
|
-
const profile = deps.providers.profiles[binding.profile];
|
|
93
|
-
if (!profile) throw new Error(`provider profile "${binding.profile}" is not defined in providers.json`);
|
|
94
|
-
const token = deps.readKey(profile.apiKeyFile).trim();
|
|
95
|
-
if (!token) throw new Error(`provider profile "${binding.profile}": api key file is empty`);
|
|
96
|
-
return {
|
|
97
|
-
profile: binding.profile,
|
|
98
|
-
model: binding.model,
|
|
99
|
-
baseUrl: profile.baseUrl,
|
|
100
|
-
env: buildProviderEnv(profile, binding.model, token),
|
|
101
|
-
unset: PROVIDER_STRIPPED_ENV_KEYS
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
function loadSessionProvider(happyHomeDir, sessionId) {
|
|
105
|
-
const bindings = readSessionProviders(happyHomeDir);
|
|
106
|
-
if (!bindings[sessionId]) return null;
|
|
107
|
-
return resolveSessionProvider(sessionId, {
|
|
108
|
-
providers: readProviders(happyHomeDir),
|
|
109
|
-
bindings,
|
|
110
|
-
readKey: (p) => readFileSync(expandHome(p), "utf8")
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
function applyProviderEnv(env, provider) {
|
|
114
|
-
for (const key of provider.unset) delete env[key];
|
|
115
|
-
Object.assign(env, provider.env);
|
|
116
|
-
}
|
|
117
|
-
function updateBindings(current, sessionId, binding) {
|
|
118
|
-
const next = { ...current };
|
|
119
|
-
if (binding) next[sessionId] = binding;
|
|
120
|
-
else delete next[sessionId];
|
|
121
|
-
return next;
|
|
122
|
-
}
|
|
123
|
-
function writeSessionProviders(happyHomeDir, bindings) {
|
|
124
|
-
const path = sessionProvidersPath(happyHomeDir);
|
|
125
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
126
|
-
const tmp = `${path}.${process.pid}.tmp`;
|
|
127
|
-
writeFileSync(tmp, JSON.stringify(bindings, null, 2) + "\n", { mode: 384 });
|
|
128
|
-
chmodSync(tmp, 384);
|
|
129
|
-
renameSync(tmp, path);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export { applyProviderEnv as a, readProviders as b, loadSessionProvider as l, readSessionProviders as r, sessionProvidersPath as s, updateBindings as u, writeSessionProviders as w };
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { p as packageJson } from './package-C6uiXULx.mjs';
|
|
2
|
-
|
|
3
|
-
const LAZY_MODULES = [
|
|
4
|
-
// Entry
|
|
5
|
-
["main", () => import('./main-DO7nRvhf.mjs')],
|
|
6
|
-
["selfCheck", () => Promise.resolve().then(function () { return selfCheck; })],
|
|
7
|
-
// Subcommands (main.ts)
|
|
8
|
-
["api/api", () => import('./api-Dw8gFsQi.mjs').then(function (n) { return n.e; })],
|
|
9
|
-
["claude/claudeCliPath", () => import('./claudeCliPath-BqkaH2oR.mjs')],
|
|
10
|
-
["claude/runClaude", () => import('./runClaude-CykqeXK7.mjs')],
|
|
11
|
-
["commands/agentHome", () => import('./agentHome-BJGRA2Kx.mjs')],
|
|
12
|
-
["commands/auth", () => import('./auth-Bh6SUoGi.mjs')],
|
|
13
|
-
["commands/auto", () => import('./auto-DK7pbCnV.mjs')],
|
|
14
|
-
["commands/codexCommand", () => import('./codexCommand-Dliq3EBv.mjs')],
|
|
15
|
-
["commands/connect", () => import('./connect-UwQHvCpR.mjs')],
|
|
16
|
-
["commands/installPiTools", () => import('./installPiTools-B_CdM5_2.mjs')],
|
|
17
|
-
["commands/installTerminalHooks", () => import('./installTerminalHooks-By7gBMEF.mjs')],
|
|
18
|
-
["commands/mcp", () => import('./mcp-C-4sPTae.mjs')],
|
|
19
|
-
["commands/panels", () => import('./panels-DXYdJA6n.mjs')],
|
|
20
|
-
["commands/piTerminal", () => import('./piTerminal-GEPkIGD4.mjs')],
|
|
21
|
-
["commands/sandbox", () => import('./sandbox-DGmXZ6Zz.mjs')],
|
|
22
|
-
["commands/send", () => import('./send-B6rHg8GT.mjs')],
|
|
23
|
-
["commands/server", () => import('./server-BkdAyHhC.mjs')],
|
|
24
|
-
["commands/sessions", () => import('./sessions-B4d50sCI.mjs')],
|
|
25
|
-
["commands/sessionProvider", () => import('./sessionProvider-g18IiK74.mjs')],
|
|
26
|
-
["commands/spawn", () => import('./spawn-CrYN_OOT.mjs')],
|
|
27
|
-
["commands/teams", () => import('./teams-nadkqrbW.mjs')],
|
|
28
|
-
["commands/todo", () => import('./todo-BIxd7l2Q.mjs')],
|
|
29
|
-
["daemon/doctor", () => import('./doctor-BPkYWSuq.mjs')],
|
|
30
|
-
["daemon/install", () => import('./install-DfPrEWGG.mjs')],
|
|
31
|
-
["daemon/run", () => import('./run-B_gFgJVB.mjs')],
|
|
32
|
-
["daemon/uninstall", () => import('./uninstall-9htK6mb7.mjs')],
|
|
33
|
-
["resume/handleResumeCommand", () => import('./handleResumeCommand-CgLzBYne.mjs')],
|
|
34
|
-
["ui/doctor", () => import('./doctor-BdBi7TFZ.mjs').then(function (n) { return n.d; })],
|
|
35
|
-
["agent/acp", () => import('./index-CBHfkQNY.mjs')],
|
|
36
|
-
["gemini/runGemini", () => import('./runGemini-CtWCVkj5.mjs')],
|
|
37
|
-
["gemini/utils/config", () => import('./config-CxSsGO1Z.mjs')],
|
|
38
|
-
["openclaw/runOpenClaw", () => import('./runOpenClaw-BBdjlViJ.mjs')],
|
|
39
|
-
["persistence", () => import('./persistence-Dogj7JIp.mjs').then(function (n) { return n.G; })],
|
|
40
|
-
// Deferred halves of the runners and clients
|
|
41
|
-
["api/apiMachine", () => import('./apiMachine-BBNEtjf7.mjs')],
|
|
42
|
-
["claude/runClaudeDeps", () => import('./runClaudeDeps-D2phXGut.mjs')],
|
|
43
|
-
["claude/claudeLocal", () => import('./claudeLocal-Ux31hZyC.mjs')],
|
|
44
|
-
["claude/claudeLocalLauncher", () => import('./claudeLocalLauncher-D06QijMw.mjs')],
|
|
45
|
-
["claude/sdk", () => import('./index-Db0HIC-k.mjs')],
|
|
46
|
-
["assistant/bootstrap", () => import('./bootstrap-Ct9Nb4sv.mjs')],
|
|
47
|
-
["agentHome", () => import('./index-DUByZsKe.mjs')],
|
|
48
|
-
["ui/ink/RemoteModeDisplay", () => import('./RemoteModeDisplay-D-HewyXg.mjs')],
|
|
49
|
-
// External packages imported on demand
|
|
50
|
-
["expo-server-sdk", () => import('expo-server-sdk')],
|
|
51
|
-
["ink", () => import('ink')],
|
|
52
|
-
["react", () => import('react')]
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
async function runSelfCheck(modules = LAZY_MODULES) {
|
|
56
|
-
const failures = [];
|
|
57
|
-
for (const [name, load] of modules) {
|
|
58
|
-
try {
|
|
59
|
-
await load();
|
|
60
|
-
} catch (error) {
|
|
61
|
-
failures.push({ name, error: error instanceof Error ? error.message : String(error) });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return failures;
|
|
65
|
-
}
|
|
66
|
-
async function selfCheckMain(opts = {}) {
|
|
67
|
-
const started = Date.now();
|
|
68
|
-
const failures = await runSelfCheck();
|
|
69
|
-
if (failures.length > 0) {
|
|
70
|
-
for (const failure of failures) {
|
|
71
|
-
console.error(`very-happy: failed to load ${failure.name}: ${failure.error}`);
|
|
72
|
-
}
|
|
73
|
-
return 1;
|
|
74
|
-
}
|
|
75
|
-
if (opts.verbose) console.log(`self-check: ${LAZY_MODULES.length} modules loaded in ${Date.now() - started}ms`);
|
|
76
|
-
console.log(`very-happy version: ${packageJson.version}`);
|
|
77
|
-
return 0;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
var selfCheck = /*#__PURE__*/Object.freeze({
|
|
81
|
-
__proto__: null,
|
|
82
|
-
runSelfCheck: runSelfCheck,
|
|
83
|
-
selfCheckMain: selfCheckMain
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
export { runSelfCheck, selfCheckMain };
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chalk = require('chalk');
|
|
4
|
-
var configuration = require('./configuration-Dt5lKW3P.cjs');
|
|
5
|
-
var controlClient = require('./controlClient-BRk65BRO.cjs');
|
|
6
|
-
var providerBinding = require('./providerBinding-B-Qbx9W2.cjs');
|
|
7
|
-
require('node:fs');
|
|
8
|
-
require('node:os');
|
|
9
|
-
require('node:path');
|
|
10
|
-
require('./package-DrY090nZ.cjs');
|
|
11
|
-
require('node:fs/promises');
|
|
12
|
-
require('./logger-BBRTTVsQ.cjs');
|
|
13
|
-
require('node:util');
|
|
14
|
-
require('./persistence-Bl5S3TLB.cjs');
|
|
15
|
-
require('zod');
|
|
16
|
-
require('./authRelay-Dy1qU9td.cjs');
|
|
17
|
-
require('node:crypto');
|
|
18
|
-
require('tweetnacl');
|
|
19
|
-
|
|
20
|
-
const SESSION_PROVIDER_HELP = `Usage:
|
|
21
|
-
very-happy session provider --list
|
|
22
|
-
very-happy session provider <sessionId> <profile> [--model <model>] [--no-restart]
|
|
23
|
-
very-happy session provider <sessionId> default [--no-restart]
|
|
24
|
-
|
|
25
|
-
Binds a Claude (SDK/remote) session on THIS machine to a provider profile from
|
|
26
|
-
$HAPPY_HOME_DIR/providers.json, then restarts the session in place (history
|
|
27
|
-
kept). "default" removes the binding. --model defaults to the profile's first model.`;
|
|
28
|
-
function parseSessionProviderArgs(args) {
|
|
29
|
-
const positional = [];
|
|
30
|
-
let model;
|
|
31
|
-
let restart = true;
|
|
32
|
-
let list = false;
|
|
33
|
-
for (let i = 0; i < args.length; i++) {
|
|
34
|
-
const arg = args[i];
|
|
35
|
-
if (arg === "-h" || arg === "--help") return { action: "help" };
|
|
36
|
-
if (arg === "--list") list = true;
|
|
37
|
-
else if (arg === "--no-restart") restart = false;
|
|
38
|
-
else if (arg === "--model") {
|
|
39
|
-
model = args[++i];
|
|
40
|
-
if (!model) throw new Error("--model needs a value");
|
|
41
|
-
} else if (arg.startsWith("--model=")) model = arg.slice("--model=".length);
|
|
42
|
-
else if (arg.startsWith("-")) throw new Error(`unknown option ${arg}`);
|
|
43
|
-
else positional.push(arg);
|
|
44
|
-
}
|
|
45
|
-
if (list) {
|
|
46
|
-
if (positional.length > 0) throw new Error("--list takes no session id");
|
|
47
|
-
return { action: "list" };
|
|
48
|
-
}
|
|
49
|
-
if (positional.length === 0) return { action: "help" };
|
|
50
|
-
if (positional.length !== 2) throw new Error("expected <sessionId> <profile|default>");
|
|
51
|
-
const [sessionId, profile] = positional;
|
|
52
|
-
if (profile === "default") {
|
|
53
|
-
if (model) throw new Error("--model cannot be used with default");
|
|
54
|
-
return { action: "clear", sessionId, restart };
|
|
55
|
-
}
|
|
56
|
-
return { action: "set", sessionId, profile, model, restart };
|
|
57
|
-
}
|
|
58
|
-
function resolveBindingRequest(providers, profile, model) {
|
|
59
|
-
const p = providers.profiles[profile];
|
|
60
|
-
if (!p) {
|
|
61
|
-
const known = Object.keys(providers.profiles);
|
|
62
|
-
throw new Error(`unknown provider profile "${profile}"${known.length ? ` (known: ${known.join(", ")})` : " (providers.json has no profiles)"}`);
|
|
63
|
-
}
|
|
64
|
-
const chosen = model ?? p.models?.[0];
|
|
65
|
-
if (!chosen) throw new Error(`profile "${profile}" lists no models; pass --model`);
|
|
66
|
-
if (p.models && p.models.length > 0 && !p.models.includes(chosen)) {
|
|
67
|
-
throw new Error(`model "${chosen}" is not in profile "${profile}" models (${p.models.join(", ")})`);
|
|
68
|
-
}
|
|
69
|
-
return { profile, model: chosen };
|
|
70
|
-
}
|
|
71
|
-
async function handleSessionProviderCommand(args) {
|
|
72
|
-
const parsed = parseSessionProviderArgs(args);
|
|
73
|
-
const home = configuration.configuration.happyHomeDir;
|
|
74
|
-
if (parsed.action === "help") {
|
|
75
|
-
console.log(SESSION_PROVIDER_HELP);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const bindings = providerBinding.readSessionProviders(home);
|
|
79
|
-
if (parsed.action === "list") {
|
|
80
|
-
const entries = Object.entries(bindings);
|
|
81
|
-
if (entries.length === 0) console.log("No session provider bindings.");
|
|
82
|
-
for (const [sessionId, b] of entries) console.log(`${sessionId} ${b.profile} ${b.model}`);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (parsed.action === "set") {
|
|
86
|
-
const binding = resolveBindingRequest(providerBinding.readProviders(home), parsed.profile, parsed.model);
|
|
87
|
-
providerBinding.writeSessionProviders(home, providerBinding.updateBindings(bindings, parsed.sessionId, binding));
|
|
88
|
-
console.log(`Bound ${parsed.sessionId} \u2192 ${binding.profile} / ${binding.model} (${providerBinding.sessionProvidersPath(home)})`);
|
|
89
|
-
} else {
|
|
90
|
-
if (!bindings[parsed.sessionId]) {
|
|
91
|
-
console.log(`${parsed.sessionId} has no binding; nothing to change.`);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
providerBinding.writeSessionProviders(home, providerBinding.updateBindings(bindings, parsed.sessionId, null));
|
|
95
|
-
console.log(`Cleared binding for ${parsed.sessionId} (default provider).`);
|
|
96
|
-
}
|
|
97
|
-
if (!parsed.restart) {
|
|
98
|
-
console.log(chalk.dim("Not restarted; the binding applies when the session next starts."));
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const result = await controlClient.restartDaemonSession(parsed.sessionId);
|
|
102
|
-
if (result.success) {
|
|
103
|
-
console.log(`Restarted ${parsed.sessionId} in place.`);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
console.error(chalk.yellow(`Binding saved, but restart failed: ${result.error}`));
|
|
107
|
-
console.error(chalk.dim("It applies the next time this session is resumed on this machine."));
|
|
108
|
-
process.exitCode = 1;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
exports.SESSION_PROVIDER_HELP = SESSION_PROVIDER_HELP;
|
|
112
|
-
exports.handleSessionProviderCommand = handleSessionProviderCommand;
|
|
113
|
-
exports.parseSessionProviderArgs = parseSessionProviderArgs;
|
|
114
|
-
exports.resolveBindingRequest = resolveBindingRequest;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { c as configuration } from './configuration-Dechcvd-.mjs';
|
|
3
|
-
import { r as restartDaemonSession } from './controlClient-D7NGfmtq.mjs';
|
|
4
|
-
import { r as readSessionProviders, b as readProviders, w as writeSessionProviders, u as updateBindings, s as sessionProvidersPath } from './providerBinding-CYubGg-Z.mjs';
|
|
5
|
-
import 'node:fs';
|
|
6
|
-
import 'node:os';
|
|
7
|
-
import 'node:path';
|
|
8
|
-
import './package-C6uiXULx.mjs';
|
|
9
|
-
import 'node:fs/promises';
|
|
10
|
-
import './logger-CL7pin9b.mjs';
|
|
11
|
-
import 'node:util';
|
|
12
|
-
import './persistence-Dogj7JIp.mjs';
|
|
13
|
-
import 'zod';
|
|
14
|
-
import './authRelay-DhQhkBvX.mjs';
|
|
15
|
-
import 'node:crypto';
|
|
16
|
-
import 'tweetnacl';
|
|
17
|
-
|
|
18
|
-
const SESSION_PROVIDER_HELP = `Usage:
|
|
19
|
-
very-happy session provider --list
|
|
20
|
-
very-happy session provider <sessionId> <profile> [--model <model>] [--no-restart]
|
|
21
|
-
very-happy session provider <sessionId> default [--no-restart]
|
|
22
|
-
|
|
23
|
-
Binds a Claude (SDK/remote) session on THIS machine to a provider profile from
|
|
24
|
-
$HAPPY_HOME_DIR/providers.json, then restarts the session in place (history
|
|
25
|
-
kept). "default" removes the binding. --model defaults to the profile's first model.`;
|
|
26
|
-
function parseSessionProviderArgs(args) {
|
|
27
|
-
const positional = [];
|
|
28
|
-
let model;
|
|
29
|
-
let restart = true;
|
|
30
|
-
let list = false;
|
|
31
|
-
for (let i = 0; i < args.length; i++) {
|
|
32
|
-
const arg = args[i];
|
|
33
|
-
if (arg === "-h" || arg === "--help") return { action: "help" };
|
|
34
|
-
if (arg === "--list") list = true;
|
|
35
|
-
else if (arg === "--no-restart") restart = false;
|
|
36
|
-
else if (arg === "--model") {
|
|
37
|
-
model = args[++i];
|
|
38
|
-
if (!model) throw new Error("--model needs a value");
|
|
39
|
-
} else if (arg.startsWith("--model=")) model = arg.slice("--model=".length);
|
|
40
|
-
else if (arg.startsWith("-")) throw new Error(`unknown option ${arg}`);
|
|
41
|
-
else positional.push(arg);
|
|
42
|
-
}
|
|
43
|
-
if (list) {
|
|
44
|
-
if (positional.length > 0) throw new Error("--list takes no session id");
|
|
45
|
-
return { action: "list" };
|
|
46
|
-
}
|
|
47
|
-
if (positional.length === 0) return { action: "help" };
|
|
48
|
-
if (positional.length !== 2) throw new Error("expected <sessionId> <profile|default>");
|
|
49
|
-
const [sessionId, profile] = positional;
|
|
50
|
-
if (profile === "default") {
|
|
51
|
-
if (model) throw new Error("--model cannot be used with default");
|
|
52
|
-
return { action: "clear", sessionId, restart };
|
|
53
|
-
}
|
|
54
|
-
return { action: "set", sessionId, profile, model, restart };
|
|
55
|
-
}
|
|
56
|
-
function resolveBindingRequest(providers, profile, model) {
|
|
57
|
-
const p = providers.profiles[profile];
|
|
58
|
-
if (!p) {
|
|
59
|
-
const known = Object.keys(providers.profiles);
|
|
60
|
-
throw new Error(`unknown provider profile "${profile}"${known.length ? ` (known: ${known.join(", ")})` : " (providers.json has no profiles)"}`);
|
|
61
|
-
}
|
|
62
|
-
const chosen = model ?? p.models?.[0];
|
|
63
|
-
if (!chosen) throw new Error(`profile "${profile}" lists no models; pass --model`);
|
|
64
|
-
if (p.models && p.models.length > 0 && !p.models.includes(chosen)) {
|
|
65
|
-
throw new Error(`model "${chosen}" is not in profile "${profile}" models (${p.models.join(", ")})`);
|
|
66
|
-
}
|
|
67
|
-
return { profile, model: chosen };
|
|
68
|
-
}
|
|
69
|
-
async function handleSessionProviderCommand(args) {
|
|
70
|
-
const parsed = parseSessionProviderArgs(args);
|
|
71
|
-
const home = configuration.happyHomeDir;
|
|
72
|
-
if (parsed.action === "help") {
|
|
73
|
-
console.log(SESSION_PROVIDER_HELP);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const bindings = readSessionProviders(home);
|
|
77
|
-
if (parsed.action === "list") {
|
|
78
|
-
const entries = Object.entries(bindings);
|
|
79
|
-
if (entries.length === 0) console.log("No session provider bindings.");
|
|
80
|
-
for (const [sessionId, b] of entries) console.log(`${sessionId} ${b.profile} ${b.model}`);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (parsed.action === "set") {
|
|
84
|
-
const binding = resolveBindingRequest(readProviders(home), parsed.profile, parsed.model);
|
|
85
|
-
writeSessionProviders(home, updateBindings(bindings, parsed.sessionId, binding));
|
|
86
|
-
console.log(`Bound ${parsed.sessionId} \u2192 ${binding.profile} / ${binding.model} (${sessionProvidersPath(home)})`);
|
|
87
|
-
} else {
|
|
88
|
-
if (!bindings[parsed.sessionId]) {
|
|
89
|
-
console.log(`${parsed.sessionId} has no binding; nothing to change.`);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
writeSessionProviders(home, updateBindings(bindings, parsed.sessionId, null));
|
|
93
|
-
console.log(`Cleared binding for ${parsed.sessionId} (default provider).`);
|
|
94
|
-
}
|
|
95
|
-
if (!parsed.restart) {
|
|
96
|
-
console.log(chalk.dim("Not restarted; the binding applies when the session next starts."));
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const result = await restartDaemonSession(parsed.sessionId);
|
|
100
|
-
if (result.success) {
|
|
101
|
-
console.log(`Restarted ${parsed.sessionId} in place.`);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
console.error(chalk.yellow(`Binding saved, but restart failed: ${result.error}`));
|
|
105
|
-
console.error(chalk.dim("It applies the next time this session is resumed on this machine."));
|
|
106
|
-
process.exitCode = 1;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export { SESSION_PROVIDER_HELP, handleSessionProviderCommand, parseSessionProviderArgs, resolveBindingRequest };
|