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,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var z = require('zod');
|
|
4
|
-
var client = require('./client-
|
|
4
|
+
var client = require('./client-DLlnmAPL.cjs');
|
|
5
5
|
|
|
6
6
|
const CLOSED_GOAL_CHARS = 200;
|
|
7
7
|
const closed = (task) => task.status === "done" || task.status === "cancelled";
|
|
@@ -121,7 +121,8 @@ function registerTeamsTools(server, sessionId, client$1 = client.createTeamsClie
|
|
|
121
121
|
botName: id.optional(),
|
|
122
122
|
directory: z.z.string().min(1).optional(),
|
|
123
123
|
assistant: z.z.enum(["claude", "codex", "pi-acp"]).optional(),
|
|
124
|
-
model: z.z.string().trim().min(1).max(256).optional()
|
|
124
|
+
model: z.z.string().trim().min(1).max(256).optional(),
|
|
125
|
+
agentProfile: z.z.object({ id: z.z.string().min(1).max(64), label: z.z.string().min(1).max(200).optional() }).nullable().optional().describe("Account a member spawns on (id from `very-happy account list`; null = machine login; omit = team default). Unusable \u2192 the launch is refused, never the machine login.")
|
|
125
126
|
});
|
|
126
127
|
action("message", "Send a persistent task-related message. Delivery does not mean the model has read or acted on it.", { taskId: id, body: text, recipientBotId: id.optional() });
|
|
127
128
|
action("submit", "Submit evidence for your current attempt and goal version. The owner still has to accept it.", { taskId: id, attemptId: id, goalVersion: z.z.number().int().positive(), result: text });
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
3
|
+
var logger = require('./logger-CX3x2eI4.cjs');
|
|
4
4
|
var require$$0 = require('fs');
|
|
5
5
|
var child_process = require('child_process');
|
|
6
6
|
require('chalk');
|
|
7
7
|
require('node:util');
|
|
8
|
-
require('./configuration-
|
|
8
|
+
require('./configuration-BBK0rmmj.cjs');
|
|
9
9
|
require('node:fs');
|
|
10
10
|
require('node:os');
|
|
11
11
|
require('node:path');
|
|
12
|
-
require('./package-
|
|
12
|
+
require('./package-uzlvxa5S.cjs');
|
|
13
13
|
require('node:fs/promises');
|
|
14
14
|
|
|
15
15
|
const PLIST_LABEL = "com.happy-cli.daemon";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { l as logger } from './logger-
|
|
1
|
+
import { l as logger } from './logger-JV7-4Q_6.mjs';
|
|
2
2
|
import { existsSync, unlinkSync } from 'fs';
|
|
3
3
|
import { execSync } from 'child_process';
|
|
4
4
|
import 'chalk';
|
|
5
5
|
import 'node:util';
|
|
6
|
-
import './configuration-
|
|
6
|
+
import './configuration-ThKBP_zY.mjs';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:os';
|
|
9
9
|
import 'node:path';
|
|
10
|
-
import './package-
|
|
10
|
+
import './package-Bw3H6VLn.mjs';
|
|
11
11
|
import 'node:fs/promises';
|
|
12
12
|
|
|
13
13
|
const PLIST_LABEL = "com.happy-cli.daemon";
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { mkdirSync, writeFileSync, chmodSync, readFileSync, rmSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { r as resolveClaudeAccount, a as applyAccountEnv, o as overridingUserSettings } from './claudeAccountEnv-BL1pR_37.mjs';
|
|
5
|
+
import { r as readSessionBindings, w as writeSessionBinding, d as defaultSecretProbe, a as readAccounts, c as readAccountsFileV2, f as writeAccountsFile } from './store-Vej_738f.mjs';
|
|
6
|
+
|
|
7
|
+
let current = null;
|
|
8
|
+
let home = null;
|
|
9
|
+
let currentSettings = {};
|
|
10
|
+
function accountClaudeSettings() {
|
|
11
|
+
return currentSettings;
|
|
12
|
+
}
|
|
13
|
+
function unavailableNotice(profile) {
|
|
14
|
+
const why = {
|
|
15
|
+
missing: "it no longer exists on this machine",
|
|
16
|
+
"missing-secret": "its key / token is missing on this machine",
|
|
17
|
+
expired: "its sign-in has expired \u2014 sign in again",
|
|
18
|
+
invalid: "its key was rejected \u2014 fix the key",
|
|
19
|
+
"agent-mismatch": "it belongs to another agent (Claude / Codex)"
|
|
20
|
+
};
|
|
21
|
+
return `Account "${profile.label}" is unavailable: ${why[profile.reason ?? ""] ?? profile.reason ?? "unknown reason"}. This session will not fall back to the machine login; switch accounts or fix it, and the session restarts in place.`;
|
|
22
|
+
}
|
|
23
|
+
function shouldRecordSpawnAccount(spawnAccountId, hasBinding) {
|
|
24
|
+
return !!spawnAccountId && !hasBinding;
|
|
25
|
+
}
|
|
26
|
+
function loadWrapperAccount(happyHome, sessionId, spawnAccountId, env = process.env) {
|
|
27
|
+
home = happyHome;
|
|
28
|
+
currentSettings = {};
|
|
29
|
+
let bindings = readSessionBindings(happyHome);
|
|
30
|
+
if (shouldRecordSpawnAccount(spawnAccountId, sessionId in bindings)) {
|
|
31
|
+
writeSessionBinding(happyHome, sessionId, { account: spawnAccountId });
|
|
32
|
+
bindings = { ...bindings, [sessionId]: { account: spawnAccountId } };
|
|
33
|
+
}
|
|
34
|
+
const probe = defaultSecretProbe(env);
|
|
35
|
+
const resolution = resolveClaudeAccount(sessionId, {
|
|
36
|
+
home: happyHome,
|
|
37
|
+
accounts: readAccounts(happyHome),
|
|
38
|
+
bindings,
|
|
39
|
+
fileReadable: probe.fileReadable,
|
|
40
|
+
env,
|
|
41
|
+
nodePath: process.execPath,
|
|
42
|
+
envKeyCopyPath: (id) => join(happyHome, "tmp", "accounts", `key-${process.pid}-${id}`),
|
|
43
|
+
readSecret: (path) => readFileSync(path, "utf8"),
|
|
44
|
+
now: Date.now()
|
|
45
|
+
});
|
|
46
|
+
if (resolution.kind === "machine") {
|
|
47
|
+
current = null;
|
|
48
|
+
return { profile: null, settings: {}, unavailable: false, notices: [], cleanup: () => {
|
|
49
|
+
} };
|
|
50
|
+
}
|
|
51
|
+
let cleanup = () => {
|
|
52
|
+
};
|
|
53
|
+
if (resolution.kind === "active" && resolution.envKeyCopy) {
|
|
54
|
+
const { name, path } = resolution.envKeyCopy;
|
|
55
|
+
mkdirSync(dirname(path), { recursive: true, mode: 448 });
|
|
56
|
+
writeFileSync(path, (env[name] ?? "").trim() + "\n", { mode: 384 });
|
|
57
|
+
chmodSync(path, 384);
|
|
58
|
+
delete env[name];
|
|
59
|
+
cleanup = () => rmSync(path, { force: true });
|
|
60
|
+
}
|
|
61
|
+
applyAccountEnv(env, resolution);
|
|
62
|
+
const notices = [];
|
|
63
|
+
if (resolution.kind === "unavailable") {
|
|
64
|
+
current = null;
|
|
65
|
+
notices.push(unavailableNotice(resolution.profile));
|
|
66
|
+
return { profile: resolution.profile, settings: {}, unavailable: true, notices, cleanup };
|
|
67
|
+
}
|
|
68
|
+
current = { id: resolution.id, kind: resolution.profile.kind };
|
|
69
|
+
currentSettings = resolution.settings;
|
|
70
|
+
const overrides = overridingUserSettings(readUserClaudeSettings(env), resolution.profile.kind);
|
|
71
|
+
if (overrides.length > 0) {
|
|
72
|
+
notices.push(`Your Claude settings.json sets ${overrides.join(", ")}, which takes precedence over account "${resolution.profile.label}". Remove it there for the account to apply.`);
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
profile: resolution.profile,
|
|
76
|
+
settings: resolution.settings,
|
|
77
|
+
...resolution.pinnedModel ? { pinnedModel: resolution.pinnedModel } : {},
|
|
78
|
+
unavailable: false,
|
|
79
|
+
notices,
|
|
80
|
+
cleanup
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function readUserClaudeSettings(env) {
|
|
84
|
+
const dir = env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");
|
|
85
|
+
try {
|
|
86
|
+
return JSON.parse(readFileSync(join(dir, "settings.json"), "utf8"));
|
|
87
|
+
} catch {
|
|
88
|
+
return void 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function noteAccountAuthFailure(now = Date.now()) {
|
|
92
|
+
if (!current || !home) return false;
|
|
93
|
+
const status = current.kind === "claude-subscription" ? "expired" : "invalid";
|
|
94
|
+
try {
|
|
95
|
+
const file = readAccountsFileV2(home);
|
|
96
|
+
const record = file.accounts[current.id];
|
|
97
|
+
if (record) {
|
|
98
|
+
record.check = { status, at: now, detail: "rejected during a session" };
|
|
99
|
+
writeAccountsFile(home, file);
|
|
100
|
+
return { label: record.label, status };
|
|
101
|
+
}
|
|
102
|
+
} catch {
|
|
103
|
+
}
|
|
104
|
+
return { label: current.id, status };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { accountClaudeSettings as a, loadWrapperAccount as l, noteAccountAuthFailure as n, shouldRecordSpawnAccount as s, unavailableNotice as u };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node_fs = require('node:fs');
|
|
4
|
+
var os = require('node:os');
|
|
5
|
+
var path = require('node:path');
|
|
6
|
+
var claudeAccountEnv = require('./claudeAccountEnv-CEX_EMZr.cjs');
|
|
7
|
+
var store = require('./store-CkNa6oj4.cjs');
|
|
8
|
+
|
|
9
|
+
let current = null;
|
|
10
|
+
let home = null;
|
|
11
|
+
let currentSettings = {};
|
|
12
|
+
function accountClaudeSettings() {
|
|
13
|
+
return currentSettings;
|
|
14
|
+
}
|
|
15
|
+
function unavailableNotice(profile) {
|
|
16
|
+
const why = {
|
|
17
|
+
missing: "it no longer exists on this machine",
|
|
18
|
+
"missing-secret": "its key / token is missing on this machine",
|
|
19
|
+
expired: "its sign-in has expired \u2014 sign in again",
|
|
20
|
+
invalid: "its key was rejected \u2014 fix the key",
|
|
21
|
+
"agent-mismatch": "it belongs to another agent (Claude / Codex)"
|
|
22
|
+
};
|
|
23
|
+
return `Account "${profile.label}" is unavailable: ${why[profile.reason ?? ""] ?? profile.reason ?? "unknown reason"}. This session will not fall back to the machine login; switch accounts or fix it, and the session restarts in place.`;
|
|
24
|
+
}
|
|
25
|
+
function shouldRecordSpawnAccount(spawnAccountId, hasBinding) {
|
|
26
|
+
return !!spawnAccountId && !hasBinding;
|
|
27
|
+
}
|
|
28
|
+
function loadWrapperAccount(happyHome, sessionId, spawnAccountId, env = process.env) {
|
|
29
|
+
home = happyHome;
|
|
30
|
+
currentSettings = {};
|
|
31
|
+
let bindings = store.readSessionBindings(happyHome);
|
|
32
|
+
if (shouldRecordSpawnAccount(spawnAccountId, sessionId in bindings)) {
|
|
33
|
+
store.writeSessionBinding(happyHome, sessionId, { account: spawnAccountId });
|
|
34
|
+
bindings = { ...bindings, [sessionId]: { account: spawnAccountId } };
|
|
35
|
+
}
|
|
36
|
+
const probe = store.defaultSecretProbe(env);
|
|
37
|
+
const resolution = claudeAccountEnv.resolveClaudeAccount(sessionId, {
|
|
38
|
+
home: happyHome,
|
|
39
|
+
accounts: store.readAccounts(happyHome),
|
|
40
|
+
bindings,
|
|
41
|
+
fileReadable: probe.fileReadable,
|
|
42
|
+
env,
|
|
43
|
+
nodePath: process.execPath,
|
|
44
|
+
envKeyCopyPath: (id) => path.join(happyHome, "tmp", "accounts", `key-${process.pid}-${id}`),
|
|
45
|
+
readSecret: (path) => node_fs.readFileSync(path, "utf8"),
|
|
46
|
+
now: Date.now()
|
|
47
|
+
});
|
|
48
|
+
if (resolution.kind === "machine") {
|
|
49
|
+
current = null;
|
|
50
|
+
return { profile: null, settings: {}, unavailable: false, notices: [], cleanup: () => {
|
|
51
|
+
} };
|
|
52
|
+
}
|
|
53
|
+
let cleanup = () => {
|
|
54
|
+
};
|
|
55
|
+
if (resolution.kind === "active" && resolution.envKeyCopy) {
|
|
56
|
+
const { name, path: path$1 } = resolution.envKeyCopy;
|
|
57
|
+
node_fs.mkdirSync(path.dirname(path$1), { recursive: true, mode: 448 });
|
|
58
|
+
node_fs.writeFileSync(path$1, (env[name] ?? "").trim() + "\n", { mode: 384 });
|
|
59
|
+
node_fs.chmodSync(path$1, 384);
|
|
60
|
+
delete env[name];
|
|
61
|
+
cleanup = () => node_fs.rmSync(path$1, { force: true });
|
|
62
|
+
}
|
|
63
|
+
claudeAccountEnv.applyAccountEnv(env, resolution);
|
|
64
|
+
const notices = [];
|
|
65
|
+
if (resolution.kind === "unavailable") {
|
|
66
|
+
current = null;
|
|
67
|
+
notices.push(unavailableNotice(resolution.profile));
|
|
68
|
+
return { profile: resolution.profile, settings: {}, unavailable: true, notices, cleanup };
|
|
69
|
+
}
|
|
70
|
+
current = { id: resolution.id, kind: resolution.profile.kind };
|
|
71
|
+
currentSettings = resolution.settings;
|
|
72
|
+
const overrides = claudeAccountEnv.overridingUserSettings(readUserClaudeSettings(env), resolution.profile.kind);
|
|
73
|
+
if (overrides.length > 0) {
|
|
74
|
+
notices.push(`Your Claude settings.json sets ${overrides.join(", ")}, which takes precedence over account "${resolution.profile.label}". Remove it there for the account to apply.`);
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
profile: resolution.profile,
|
|
78
|
+
settings: resolution.settings,
|
|
79
|
+
...resolution.pinnedModel ? { pinnedModel: resolution.pinnedModel } : {},
|
|
80
|
+
unavailable: false,
|
|
81
|
+
notices,
|
|
82
|
+
cleanup
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function readUserClaudeSettings(env) {
|
|
86
|
+
const dir = env.CLAUDE_CONFIG_DIR || path.join(os.homedir(), ".claude");
|
|
87
|
+
try {
|
|
88
|
+
return JSON.parse(node_fs.readFileSync(path.join(dir, "settings.json"), "utf8"));
|
|
89
|
+
} catch {
|
|
90
|
+
return void 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function noteAccountAuthFailure(now = Date.now()) {
|
|
94
|
+
if (!current || !home) return false;
|
|
95
|
+
const status = current.kind === "claude-subscription" ? "expired" : "invalid";
|
|
96
|
+
try {
|
|
97
|
+
const file = store.readAccountsFileV2(home);
|
|
98
|
+
const record = file.accounts[current.id];
|
|
99
|
+
if (record) {
|
|
100
|
+
record.check = { status, at: now, detail: "rejected during a session" };
|
|
101
|
+
store.writeAccountsFile(home, file);
|
|
102
|
+
return { label: record.label, status };
|
|
103
|
+
}
|
|
104
|
+
} catch {
|
|
105
|
+
}
|
|
106
|
+
return { label: current.id, status };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
exports.accountClaudeSettings = accountClaudeSettings;
|
|
110
|
+
exports.loadWrapperAccount = loadWrapperAccount;
|
|
111
|
+
exports.noteAccountAuthFailure = noteAccountAuthFailure;
|
|
112
|
+
exports.shouldRecordSpawnAccount = shouldRecordSpawnAccount;
|
|
113
|
+
exports.unavailableNotice = unavailableNotice;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "very-happy-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.193",
|
|
4
4
|
"description": "Remote multi-agent workspace CLI with deep Claude integration, native terminal streaming, and self-hosting.",
|
|
5
5
|
"author": "Kirill Dubovitskiy",
|
|
6
6
|
"contributors": [
|
|
@@ -117,12 +117,12 @@
|
|
|
117
117
|
"zod": "^4.6.7"
|
|
118
118
|
},
|
|
119
119
|
"optionalDependencies": {
|
|
120
|
-
"very-happy-tools-arm64-darwin": "0.2.
|
|
121
|
-
"very-happy-tools-x64-darwin": "0.2.
|
|
122
|
-
"very-happy-tools-arm64-linux": "0.2.
|
|
123
|
-
"very-happy-tools-x64-linux": "0.2.
|
|
124
|
-
"very-happy-tools-arm64-win32": "0.2.
|
|
125
|
-
"very-happy-tools-x64-win32": "0.2.
|
|
120
|
+
"very-happy-tools-arm64-darwin": "0.2.193",
|
|
121
|
+
"very-happy-tools-x64-darwin": "0.2.193",
|
|
122
|
+
"very-happy-tools-arm64-linux": "0.2.193",
|
|
123
|
+
"very-happy-tools-x64-linux": "0.2.193",
|
|
124
|
+
"very-happy-tools-arm64-win32": "0.2.193",
|
|
125
|
+
"very-happy-tools-x64-win32": "0.2.193"
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
128
|
"@slopus/happy-wire": "workspace:*",
|
|
@@ -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-BsUHyqWe.mjs';
|
|
2
|
-
|
|
3
|
-
const LAZY_MODULES = [
|
|
4
|
-
// Entry
|
|
5
|
-
["main", () => import('./main-omGr_ONk.mjs')],
|
|
6
|
-
["selfCheck", () => Promise.resolve().then(function () { return selfCheck; })],
|
|
7
|
-
// Subcommands (main.ts)
|
|
8
|
-
["api/api", () => import('./api-jfeMRg5R.mjs').then(function (n) { return n.e; })],
|
|
9
|
-
["claude/claudeCliPath", () => import('./claudeCliPath-BqkaH2oR.mjs')],
|
|
10
|
-
["claude/runClaude", () => import('./runClaude-C3rii_S6.mjs')],
|
|
11
|
-
["commands/agentHome", () => import('./agentHome-DGv105SR.mjs')],
|
|
12
|
-
["commands/auth", () => import('./auth-BYDtjVNb.mjs')],
|
|
13
|
-
["commands/auto", () => import('./auto-D5Jhukq1.mjs')],
|
|
14
|
-
["commands/codexCommand", () => import('./codexCommand-CIaOiiOj.mjs')],
|
|
15
|
-
["commands/connect", () => import('./connect-BTfAUhk8.mjs')],
|
|
16
|
-
["commands/installPiTools", () => import('./installPiTools-B_CdM5_2.mjs')],
|
|
17
|
-
["commands/installTerminalHooks", () => import('./installTerminalHooks-By7gBMEF.mjs')],
|
|
18
|
-
["commands/mcp", () => import('./mcp-D5hxmRAq.mjs')],
|
|
19
|
-
["commands/panels", () => import('./panels-CpEKWWbI.mjs')],
|
|
20
|
-
["commands/piTerminal", () => import('./piTerminal-BGdps8f3.mjs')],
|
|
21
|
-
["commands/sandbox", () => import('./sandbox-DJ7A7lsy.mjs')],
|
|
22
|
-
["commands/send", () => import('./send-Ba63huxv.mjs')],
|
|
23
|
-
["commands/server", () => import('./server-w3W0toNd.mjs')],
|
|
24
|
-
["commands/sessions", () => import('./sessions-Clk8MR5Y.mjs')],
|
|
25
|
-
["commands/sessionProvider", () => import('./sessionProvider-DUn91LhJ.mjs')],
|
|
26
|
-
["commands/spawn", () => import('./spawn-4tsp1uhh.mjs')],
|
|
27
|
-
["commands/teams", () => import('./teams-BO3_arwM.mjs')],
|
|
28
|
-
["commands/todo", () => import('./todo-BZ954vsz.mjs')],
|
|
29
|
-
["daemon/doctor", () => import('./doctor-BPkYWSuq.mjs')],
|
|
30
|
-
["daemon/install", () => import('./install-DTIveLOS.mjs')],
|
|
31
|
-
["daemon/run", () => import('./run-Bt0AklUU.mjs')],
|
|
32
|
-
["daemon/uninstall", () => import('./uninstall-B4T_e3Mr.mjs')],
|
|
33
|
-
["resume/handleResumeCommand", () => import('./handleResumeCommand-BK9XKH_l.mjs')],
|
|
34
|
-
["ui/doctor", () => import('./doctor-lsxmAK4o.mjs').then(function (n) { return n.d; })],
|
|
35
|
-
["agent/acp", () => import('./index-Cxso1rg4.mjs')],
|
|
36
|
-
["gemini/runGemini", () => import('./runGemini-DkYhRk9S.mjs')],
|
|
37
|
-
["gemini/utils/config", () => import('./config-OCEcVVK1.mjs')],
|
|
38
|
-
["openclaw/runOpenClaw", () => import('./runOpenClaw-DpprWCoz.mjs')],
|
|
39
|
-
["persistence", () => import('./persistence-Cpw4yJs8.mjs').then(function (n) { return n.G; })],
|
|
40
|
-
// Deferred halves of the runners and clients
|
|
41
|
-
["api/apiMachine", () => import('./apiMachine-DRJ7y-BB.mjs')],
|
|
42
|
-
["claude/runClaudeDeps", () => import('./runClaudeDeps-DlVfMG4F.mjs')],
|
|
43
|
-
["claude/claudeLocal", () => import('./claudeLocal-Bgb5GGsq.mjs')],
|
|
44
|
-
["claude/claudeLocalLauncher", () => import('./claudeLocalLauncher-T7EfT68h.mjs')],
|
|
45
|
-
["claude/sdk", () => import('./index-BdOJOZ6J.mjs')],
|
|
46
|
-
["assistant/bootstrap", () => import('./bootstrap-rLaL3kTa.mjs')],
|
|
47
|
-
["agentHome", () => import('./index-DuK9XYbZ.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 };
|