very-happy-cli 0.2.178 → 0.2.180
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-DCQXHRzT.mjs → AcpBackend-B8Zi30Zh.mjs} +135 -16
- package/dist/{AcpBackend-CDkAQXYf.cjs → AcpBackend-DfRDtMcG.cjs} +135 -16
- package/dist/{AcpSessionManager-DckmUZza.cjs → AcpSessionManager-CASKOnOj.cjs} +38 -4
- package/dist/{AcpSessionManager-BXrQcqwC.mjs → AcpSessionManager-i8Rab0xT.mjs} +38 -4
- package/dist/{BasePermissionHandler-BVlrEhIi.mjs → BasePermissionHandler-26fKbRCm.mjs} +5 -2
- package/dist/{BasePermissionHandler-DyLmKKtO.cjs → BasePermissionHandler-BlM_tfej.cjs} +5 -2
- package/dist/acpSessionResume-B9l54P-X.mjs +67 -0
- package/dist/acpSessionResume-CR5pmgVo.cjs +74 -0
- package/dist/{agentHome-CEp9RMyK.cjs → agentHome-C7Sb7-Tz.cjs} +4 -4
- package/dist/{agentHome-C1xi37as.mjs → agentHome-CmGy0NWv.mjs} +4 -4
- package/dist/{api-JANhFdZV.cjs → api-DM7b1OKj.cjs} +38 -262
- package/dist/{api-Dib0dmqC.mjs → api-Hov8p7CA.mjs} +32 -256
- package/dist/{apiMachine-DNTJidYH.mjs → apiMachine-CwGEhQDT.mjs} +62 -15
- package/dist/{apiMachine-QhK-sKcr.cjs → apiMachine-DkGRj-Ai.cjs} +64 -17
- package/dist/{attachmentContent-bpQTBJ0y.cjs → attachmentContent-CEm13_gF.cjs} +4 -4
- package/dist/{attachmentContent-DkkdpSSJ.mjs → attachmentContent-CIn4iPEk.mjs} +2 -2
- package/dist/{auth-BRjd2esb.mjs → auth-BG1DY0gj.mjs} +5 -5
- package/dist/{auth-DgIV0Cvt.cjs → auth-CBXnm-Mj.cjs} +5 -5
- package/dist/{auth-omWDtgR8.cjs → auth-Dawj7pP5.cjs} +8 -8
- package/dist/{auth-DNct7VUi.mjs → auth-rggxMpEE.mjs} +8 -8
- package/dist/{auto-DKGFOJBo.mjs → auto-CXXLXGeL.mjs} +19 -18
- package/dist/{auto-CI16FZmX.cjs → auto-CbYOfoPS.cjs} +19 -18
- package/dist/{backgroundTaskActivity-BVwJBl02.mjs → backgroundTaskActivity-8PdPxrvy.mjs} +1 -1
- package/dist/{bootstrap-DCQ87Aan.cjs → bootstrap-DoA7okld.cjs} +2 -2
- package/dist/{bootstrap-BUagGC_-.mjs → bootstrap-Dt5I1SOl.mjs} +2 -2
- package/dist/{browser-Dj_DYQEh.mjs → browser-DUNetFT4.mjs} +1 -1
- package/dist/{browser-CSKhc0Bl.cjs → browser-DZ6qRtfH.cjs} +1 -1
- package/dist/{claudeCliPath-U4HHmV4r.cjs → claudeCliPath-GaP3UUz1.cjs} +1 -1
- package/dist/{claudeLocal-CdIVnOZp.cjs → claudeLocal--DNyMOSv.cjs} +8 -7
- package/dist/{claudeLocal-CCCvAeMd.mjs → claudeLocal-OHWQigCl.mjs} +6 -5
- package/dist/{claudeLocalLauncher-BmrpaRYJ.mjs → claudeLocalLauncher-BStvfa7M.mjs} +11 -10
- package/dist/{claudeLocalLauncher-21-xh5gc.cjs → claudeLocalLauncher-BhvPbcyH.cjs} +13 -12
- package/dist/{claudeSessionFork-kYCP1IJB.cjs → claudeSessionFork-Be16vzGc.cjs} +1 -1
- package/dist/{claudeSessionFork-DvxMKAmY.mjs → claudeSessionFork-GAVWhiKG.mjs} +1 -1
- package/dist/{client-C4zKGjiJ.cjs → client-BWjaHKtj.cjs} +2 -2
- package/dist/client-Ca5Pcgy_.mjs +71 -0
- package/dist/{client-CnlkkrZO.mjs → client-CnB7kRCT.mjs} +2 -2
- package/dist/{client-BTX9hsbr.mjs → client-D4uPb1uu.mjs} +3 -3
- package/dist/client-DJplzPjD.cjs +76 -0
- package/dist/{client-Dnza1hgN.cjs → client-D_loZ9IK.cjs} +3 -3
- package/dist/codex/happyMcpStdioBridge.cjs +24 -15
- package/dist/codex/happyMcpStdioBridge.mjs +25 -16
- package/dist/{codexAppServerClient-DvkpQgyv.mjs → codexAppServerClient-CO4G6OS4.mjs} +3 -3
- package/dist/{codexAppServerClient-CRlBWGn3.cjs → codexAppServerClient-PE-12AsW.cjs} +3 -3
- package/dist/{codexCommand-DzxIWXIT.cjs → codexCommand-BNoD1t1C.cjs} +127 -116
- package/dist/{codexCommand-BxjogBzU.mjs → codexCommand-B_xUH79E.mjs} +77 -66
- package/dist/{codexTermination-C28FzlLb.cjs → codexTermination-BmBbizFK.cjs} +7 -2
- package/dist/{codexTermination-ySDNMEhd.mjs → codexTermination-Dx48ma6e.mjs} +7 -2
- package/dist/{config-BFB5uJ4t.cjs → config-CtwEUxUP.cjs} +26 -26
- package/dist/{config-DwfEpFr3.mjs → config-DSu0Blos.mjs} +3 -3
- package/dist/{configuration-4TGMrjul.cjs → configuration-CYO-kPOS.cjs} +1 -1
- package/dist/{configuration-DVrb61aY.mjs → configuration-PxzEJumr.mjs} +1 -1
- package/dist/{connect-C7FPY0PI.mjs → connect-BQrg3TB6.mjs} +15 -15
- package/dist/{connect-QH2VJGBG.cjs → connect-Dq7wndzR.cjs} +28 -28
- package/dist/{context-JoKu0V54.cjs → context-6TP-iz_c.cjs} +1 -1
- package/dist/{context-B3XPVJlj.mjs → context-CJGRRGWW.mjs} +1 -1
- package/dist/{controlClient-BTaZlbC6.cjs → controlClient-Bqv5v5OM.cjs} +3 -3
- package/dist/{controlClient-BYKyGyxj.mjs → controlClient-DoeYovwP.mjs} +4 -4
- package/dist/{createSessionMetadata-8Fuj2-IV.mjs → createSessionMetadata-DDIChCx8.mjs} +2 -2
- package/dist/{createSessionMetadata-B2NynaWZ.cjs → createSessionMetadata-xz767pcG.cjs} +3 -3
- package/dist/{defaultPermissionMode-BEWCqJU-.cjs → defaultPermissionMode-PkZGsQDk.cjs} +2 -2
- package/dist/{defaultPermissionMode-B8kJG9uI.mjs → defaultPermissionMode-i5KzdK09.mjs} +2 -2
- package/dist/{detectCLI-DR9ZaN6B.cjs → detectCLI-BuYR_Qxe.cjs} +4 -4
- package/dist/{deterministicJson-C5ZwZ7hu.mjs → deterministicJson-CTEJDqtS.mjs} +217 -12
- package/dist/{deterministicJson-BjNQsAjO.cjs → deterministicJson-xqA6DaOm.cjs} +222 -16
- package/dist/{doctor-BshRnjLi.cjs → doctor-BrgSlfXn.cjs} +9 -9
- package/dist/{doctor-0BiGwJXk.mjs → doctor-IctjVh9T.mjs} +8 -8
- package/dist/{doctorReadiness-BCZGcN0a.cjs → doctorReadiness-Dl6yRQCy.cjs} +1 -1
- package/dist/{downloadTarget-BN5vZt3K.cjs → downloadTarget-CEb9che-.cjs} +6 -6
- package/dist/{downloadTarget-DJPwAZlu.mjs → downloadTarget-jbOz1egC.mjs} +6 -6
- package/dist/{ensureDaemonRunning-C5QfToCe.cjs → ensureDaemonRunning-D-HyjGIX.cjs} +6 -6
- package/dist/{ensureDaemonRunning-CSmb_mqt.mjs → ensureDaemonRunning-b1e8LCSM.mjs} +5 -5
- package/dist/{handleResumeCommand-BwnUZmbo.cjs → handleResumeCommand-BvWVuRwH.cjs} +23 -7
- package/dist/{handleResumeCommand-CgjpsdDe.mjs → handleResumeCommand-DpaZvm2c.mjs} +22 -6
- package/dist/{index-piJPsTsm.cjs → index-B2p2Mut7.cjs} +259 -53
- package/dist/{index-BehVbAsA.mjs → index-BUNnpGFF.mjs} +256 -50
- package/dist/{index-Bvldtdny.mjs → index-Bsvbgh9e.mjs} +4 -4
- package/dist/{index-BYOZ_8WZ.cjs → index-C64Ufj4D.cjs} +4 -4
- package/dist/{index-Clqlu17M.mjs → index-C6Vn5Eac.mjs} +155 -34
- package/dist/index-CMf5VbzG.mjs +18 -0
- package/dist/index-DmTlDRSL.cjs +24 -0
- package/dist/{index-_l1Sdmbi.cjs → index-Dv0Q48P3.cjs} +156 -33
- package/dist/{index-BRClDe07.cjs → index-F2UejqYs.cjs} +3 -3
- package/dist/{index-BYgfern_.mjs → index-wCbtF4BK.mjs} +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-BdvKiOQw.mjs → install-BX3lv3NO.mjs} +1 -1
- package/dist/{install-Cf6AFSWC.cjs → install-BXvf2E3o.cjs} +1 -1
- package/dist/{install-TO4taKW7.cjs → install-C0ANcEAW.cjs} +7 -7
- package/dist/{install-fYWHrPcC.mjs → install-CdzSV7qO.mjs} +3 -3
- package/dist/{installPiTools-BKnXjrVu.cjs → installPiTools-CL_axh_6.cjs} +1 -1
- package/dist/{installTerminalHooks-BQZbvxsZ.cjs → installTerminalHooks-BETLKAtd.cjs} +3 -3
- package/dist/lib.cjs +14 -14
- package/dist/lib.d.cts +239 -2
- package/dist/lib.d.mts +239 -2
- package/dist/lib.mjs +14 -14
- package/dist/{lidState-BeOwj6eW.cjs → lidState-DWGnm2H4.cjs} +1 -1
- package/dist/{lidState-DNMlIhX0.mjs → lidState-bBrmaQd2.mjs} +1 -1
- package/dist/{localHappyAgentAuth-Br-mgogg.cjs → localHappyAgentAuth-DZHQnIW9.cjs} +1 -1
- package/dist/{localHappyAgentAuth-BezKSFDi.mjs → localHappyAgentAuth-Dn1jYDpt.mjs} +1 -1
- package/dist/{logger--vAVtXB_.mjs → logger-BUngm5Xg.mjs} +2 -2
- package/dist/{logger-DXTWlPzP.cjs → logger-CphW5nUE.cjs} +2 -2
- package/dist/machineMetadata-BQm9YTcI.cjs +79 -0
- package/dist/machineMetadata-BXN_bKU3.mjs +68 -0
- package/dist/{main-DoMFJ2Cl.cjs → main-B2UV51nK.cjs} +112 -132
- package/dist/{main-CshDb5-1.mjs → main-DGkdYfEq.mjs} +106 -126
- package/dist/{mcp-pNc1EbQf.cjs → mcp-BFvAEIRz.cjs} +15 -15
- package/dist/{mcp-DKT_lrvQ.mjs → mcp-CbTtbs0f.mjs} +15 -15
- package/dist/{mirrorProtocol-6IFGPpjJ.mjs → mirrorProtocol-BR4luBC0.mjs} +148 -7
- package/dist/{mirrorProtocol-qKflWTX_.cjs → mirrorProtocol-HKPivs5o.cjs} +150 -4
- package/dist/{package-B7B03ejW.mjs → package-7Ld1YMhh.mjs} +8 -7
- package/dist/{package-DY4zTbKS.cjs → package-KhLqBDX9.cjs} +8 -7
- package/dist/panels-C7IVqpJk.mjs +137 -0
- package/dist/panels-Njf6GelF.cjs +142 -0
- package/dist/{peerTools-3R9RUARX.mjs → peerTools-BOlDRyhi.mjs} +60 -10
- package/dist/{peerTools-iy3_6Yc5.cjs → peerTools-DQNlrcqM.cjs} +60 -9
- package/dist/{persistence-BfX72dne.cjs → persistence-9BMYspxG.cjs} +2 -2
- package/dist/{persistence-DTk4sNpd.mjs → persistence-BFUOHW5h.mjs} +3 -3
- package/dist/{piRunnerArgs-CRQVR9o-.cjs → piRunnerArgs-DGaq6VYM.cjs} +8 -2
- package/dist/{piRunnerArgs-AT8QJY7x.mjs → piRunnerArgs-H2pgpA5z.mjs} +7 -1
- package/dist/{piRuntime-BHRT5MKO.cjs → piRuntime-CT5xv_3h.cjs} +2 -2
- package/dist/{piRuntime-E44qTVQ4.mjs → piRuntime-CdN0JAsa.mjs} +2 -2
- package/dist/{piTerminal-hI4WFdWm.cjs → piTerminal-0FBtXTHK.cjs} +18 -18
- package/dist/{piTerminal-De8nbciM.mjs → piTerminal-C4m9YXAV.mjs} +18 -18
- package/dist/processTreeSnapshot-CuLJDNC-.mjs +101 -0
- package/dist/processTreeSnapshot-mDbnuojn.cjs +105 -0
- package/dist/projectPath-C3ioB4Bu.cjs +13 -0
- package/dist/prompt-BOouDaTM.mjs +99 -0
- package/dist/prompt-lgF9IE82.cjs +105 -0
- package/dist/{attachmentLimits-UyFn8fkQ.mjs → pushNotifications-DCiBEVeC.mjs} +307 -3
- package/dist/{attachmentLimits-SqeAHrVC.cjs → pushNotifications-DI92havG.cjs} +308 -2
- package/dist/{index-DFPT4HOO.cjs → query-BETKBrnz.cjs} +25 -5
- package/dist/{index-CEjJnq05.mjs → query-ywZbQUzR.mjs} +26 -3
- package/dist/{rateLimitWindows-XrJiiBpU.mjs → rateLimitWindows-BkfuUB1a.mjs} +1 -1
- package/dist/{rateLimitWindows-Czb7_7cK.cjs → rateLimitWindows-YRIYVdo4.cjs} +1 -1
- package/dist/{registerCommonHandlers-C0_fyBQ0.cjs → registerCommonHandlers-C7a_dUWs.cjs} +30 -30
- package/dist/{registerCommonHandlers-CvIedVRf.mjs → registerCommonHandlers-CTkCvjxt.mjs} +2 -2
- package/dist/{registerKillSessionHandler-DYl7l4Ts.cjs → registerKillSessionHandler-CIsvBrVe.cjs} +6 -6
- package/dist/{registerKillSessionHandler-gwJ5lTf0.mjs → registerKillSessionHandler-CaqqRYq6.mjs} +6 -6
- package/dist/{remoteSessionClient-BRTIOX5b.cjs → remoteSessionClient-D843fkzL.cjs} +5 -5
- package/dist/{remoteSessionClient-DRb2Jr5s.mjs → remoteSessionClient-PP-mOKmw.mjs} +5 -5
- package/dist/{reportProgressTool-B9nCzbkL.cjs → reportProgressTool-14AXr959.cjs} +84 -2
- package/dist/{reportProgressTool-D5tEoXMW.mjs → reportProgressTool-ZOCNjWHr.mjs} +82 -3
- package/dist/{resources-JDPugcDq.cjs → resources-CvIlkzpP.cjs} +30 -0
- package/dist/{resources-BdFBQi8r.mjs → resources-y9jfyO-_.mjs} +30 -0
- package/dist/{run-CKe_WeLW.cjs → run-CAOCYYfT.cjs} +2806 -110
- package/dist/{run-BQ_FGaOL.mjs → run-Dajw2E5j.mjs} +2787 -91
- package/dist/{runClaude-zrrNcQC_.mjs → runClaude-C6oxWYbp.mjs} +49 -47
- package/dist/{runClaude-MHI5IKM-.cjs → runClaude-CRRKt-tm.cjs} +50 -48
- package/dist/{runClaudeDeps-RRw-Nusc.cjs → runClaudeDeps-B1ysqTvx.cjs} +310 -237
- package/dist/{runClaudeDeps-CVBCokOS.mjs → runClaudeDeps-BcZ68cX3.mjs} +297 -226
- package/dist/{runGemini-kipag2ag.mjs → runGemini-D7yKc4wD.mjs} +61 -55
- package/dist/{runGemini-D7Lg9yCr.cjs → runGemini-DtKFXqf-.cjs} +89 -83
- package/dist/{runOpenClaw-C_lRY3Do.mjs → runOpenClaw-C8ilyLP9.mjs} +19 -19
- package/dist/{runOpenClaw-DCcQ0L2N.cjs → runOpenClaw-Cq29mryb.cjs} +20 -20
- package/dist/{sandbox-BSyXFVFp.mjs → sandbox-CbCutma4.mjs} +4 -4
- package/dist/{sandbox-dMwPTmjm.cjs → sandbox-gIj-EuF4.cjs} +4 -4
- package/dist/{selfCheck-DkzDDUsE.cjs → selfCheck-BTGBVthv.cjs} +39 -38
- package/dist/selfCheck-Smt-5Xiq.mjs +85 -0
- package/dist/{send-dxC0miIA.cjs → send-CZf5lLw_.cjs} +8 -8
- package/dist/{send-C-k9nsd3.mjs → send-YZRMQvMJ.mjs} +9 -9
- package/dist/{server-DxoTYNlw.mjs → server-BqwXRzFZ.mjs} +4 -4
- package/dist/{server-B-W6P7Qr.cjs → server-CknFq6xG.cjs} +6 -6
- package/dist/sessionExitLifecycle-CzkLIgNZ.mjs +142 -0
- package/dist/sessionExitLifecycle-DFltxXU8.cjs +148 -0
- package/dist/{sessionLock-DWX6BbiU.cjs → sessionLock-DRZUcKHT.cjs} +38 -5
- package/dist/{sessionLock-DBdtZGOL.mjs → sessionLock-nBXdJxJm.mjs} +36 -5
- package/dist/{sessionOps-BAnr7n8t.cjs → sessionOps-BrGiU9-s.cjs} +10 -5
- package/dist/{sessionOps-BVoXe12O.mjs → sessionOps-C58iDeD5.mjs} +11 -6
- package/dist/{sessionScanner-BtxoeluY.mjs → sessionScanner-Bm57LEXe.mjs} +3 -3
- package/dist/{sessionScanner-CDOYsEUD.cjs → sessionScanner-CaO8bLaG.cjs} +3 -3
- package/dist/{sessions-C3sZJkzI.mjs → sessions-BXyBHo8n.mjs} +40 -18
- package/dist/{sessions-hAitoN-m.cjs → sessions-uzqPCc37.cjs} +39 -16
- package/dist/{setupOfflineReconnection-_eD4cuUT.mjs → setupOfflineReconnection-1Qlek3wl.mjs} +2 -2
- package/dist/{setupOfflineReconnection-C2EeYTFH.cjs → setupOfflineReconnection-DvvVX3TB.cjs} +2 -2
- package/dist/{spawn-Bc9v7pIf.cjs → spawn-DBkodJEO.cjs} +49 -18
- package/dist/{spawn-qNrB2CD_.mjs → spawn-vn93PhYL.mjs} +49 -18
- package/dist/spawnAgents-CgPMWexP.mjs +79 -0
- package/dist/{spawnAgents-BVEaz35W.cjs → spawnAgents-DLNMlhWJ.cjs} +37 -1
- package/dist/{spawnHappyCLI-C2stUioM.mjs → spawnHappyCLI-BjFZc_7V.mjs} +1 -1
- package/dist/{spawnHappyCLI-fzUagkKV.cjs → spawnHappyCLI-DnUZv0X2.cjs} +2 -2
- package/dist/{specialCommands-BJ-nqY4s.cjs → specialCommands-BRufxlqe.cjs} +3 -3
- package/dist/{specialCommands-C6W-rVyh.mjs → specialCommands-D3ND9bdg.mjs} +3 -3
- package/dist/{startFileWatcher-Bqlqjt93.cjs → startFileWatcher-D9cYzZOq.cjs} +1 -1
- package/dist/{startFileWatcher-CR09Snmz.mjs → startFileWatcher-DXJ7yB5v.mjs} +1 -1
- package/dist/startupSessionCreate-kdr3m1uX.cjs +26 -0
- package/dist/startupSessionCreate-uZ6BM0ty.mjs +24 -0
- package/dist/{streamRelay-CJoMk_d2.mjs → streamRelay-DnMCMMfV.mjs} +1 -1
- package/dist/{streamRelay-9kBPpbvU.cjs → streamRelay-Dy6amlzx.cjs} +1 -1
- package/dist/{sync-Dhmtk66S.cjs → sync-Bn-idAoy.cjs} +1 -1
- package/dist/{sync-DbW07iQS.mjs → sync-BvVhDO40.mjs} +1 -1
- package/dist/{systemPrompt-CQcuUmVp.mjs → systemPrompt-CIZcJuJF.mjs} +4 -3
- package/dist/{systemPrompt-3PYi3EUY.cjs → systemPrompt-DlyEk35T.cjs} +4 -3
- package/dist/{teams-DpxLcUU_.cjs → teams-BLeRpDxv.cjs} +8 -8
- package/dist/{teams-CwF4Z2fA.mjs → teams-DLY3B5yi.mjs} +8 -8
- package/dist/{time-A6zR3Iy6.cjs → time-Cjv0zxQO.cjs} +1 -1
- package/dist/{time-BuGWTVP6.mjs → time-D3ETL7Jb.mjs} +1 -1
- package/dist/{titleGenerator-D26gvNaS.cjs → titleGenerator-Cgp5ihFb.cjs} +10 -9
- package/dist/{titleGenerator-BGEzNWC9.mjs → titleGenerator-Uzbd4utr.mjs} +9 -8
- package/dist/{todo-DrZc76H5.mjs → todo-C9Ga-oEM.mjs} +6 -6
- package/dist/{todo-73g3NCIO.cjs → todo-pOMcEECE.cjs} +6 -6
- package/dist/{tools-CxJp4T1T.cjs → tools-BL7Byl_x.cjs} +1 -1
- package/dist/{tools-BtsrQnNS.mjs → tools-Cho7iIWf.mjs} +1 -1
- package/dist/{uninstall-DWNYvewQ.cjs → uninstall-CbayEVoV.cjs} +6 -6
- package/dist/{uninstall-DOb2mTwV.mjs → uninstall-CvZHVY9C.mjs} +3 -3
- package/dist/webPanels-B2_C2-3g.mjs +49 -0
- package/dist/webPanels-FCgFKvVe.cjs +53 -0
- package/package.json +8 -7
- package/dist/machineMetadata-B1H9gNbN.mjs +0 -39
- package/dist/machineMetadata-DcUupMje.cjs +0 -42
- package/dist/messageBuffer-BWlGgR3A.mjs +0 -71
- package/dist/messageBuffer-fJMH6uY8.cjs +0 -73
- package/dist/projectPath-ChLhdOyt.cjs +0 -13
- package/dist/selfCheck-CF7XGJPb.mjs +0 -84
- package/dist/sessionModeFile-ByLbXTbg.mjs +0 -32
- package/dist/sessionModeFile-CLLdidiJ.cjs +0 -36
- package/dist/spawnAgents-Bw6j4tqz.mjs +0 -45
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { c as connectionState } from './api-Hov8p7CA.mjs';
|
|
2
|
+
|
|
3
|
+
const DAEMON_SESSION_CREATE_RETRY_DELAYS_MS = [500, 1e3, 2e3, 3e3];
|
|
4
|
+
class SessionStartupError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "SessionStartupError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
async function createSessionForStartup(create, opts) {
|
|
11
|
+
if (opts.startedBy !== "daemon") return create();
|
|
12
|
+
const delays = opts.delaysMs ?? DAEMON_SESSION_CREATE_RETRY_DELAYS_MS;
|
|
13
|
+
const sleep = opts.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
14
|
+
for (let attempt = 0; ; attempt++) {
|
|
15
|
+
const session = await create();
|
|
16
|
+
if (session) return session;
|
|
17
|
+
if (attempt >= delays.length) break;
|
|
18
|
+
opts.log?.(`[START] Session create attempt ${attempt + 1} failed (${connectionState.describe("Session creation") ?? "server unavailable"}); retrying in ${delays[attempt]}ms`);
|
|
19
|
+
await sleep(delays[attempt]);
|
|
20
|
+
}
|
|
21
|
+
throw new SessionStartupError(`Could not create the session on the server after ${delays.length + 1} attempts: ${connectionState.describe("Session creation") ?? "server unavailable"}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { createSessionForStartup as c };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { l as logger } from './logger
|
|
1
|
+
import { l as logger } from './logger-BUngm5Xg.mjs';
|
|
2
2
|
import { existsSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { g as getProjectPath } from './path-D2wdaNSk.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { f as BUILTIN_TODO_DISCOVERY } from './index-C6Vn5Eac.mjs';
|
|
6
6
|
import { t as trimIdent } from './trimIdent-BAjmv_TG.mjs';
|
|
7
7
|
import { homedir } from 'node:os';
|
|
8
8
|
import { A as AGENT_GUIDANCE } from './agentGuidance-BDYt2Qy2.mjs';
|
|
9
|
+
import { P as PROJECT_HINT } from './prompt-BOouDaTM.mjs';
|
|
9
10
|
|
|
10
11
|
function claudeCheckSession(sessionId, path) {
|
|
11
12
|
const projectDir = getProjectPath(path);
|
|
@@ -69,7 +70,7 @@ function shouldIncludeCoAuthoredBy() {
|
|
|
69
70
|
|
|
70
71
|
const BASE_SYSTEM_PROMPT = (() => trimIdent(`
|
|
71
72
|
This chat is titled automatically from the user's first message. Call "mcp__happy__change_title" only when the topic has clearly moved on or the current title is too generic to find this chat later. Do not call it as a ritual at the start of a chat, and not for a quick question you can just answer.
|
|
72
|
-
`))() + "\n\n" + AGENT_GUIDANCE + "\n\n" + BUILTIN_TODO_DISCOVERY;
|
|
73
|
+
`))() + "\n\n" + AGENT_GUIDANCE + "\n\n" + BUILTIN_TODO_DISCOVERY + "\n\n" + PROJECT_HINT;
|
|
73
74
|
const CO_AUTHORED_CREDITS = (() => trimIdent(`
|
|
74
75
|
When you yourself create a git commit, instead of just giving co-credit to Claude, also give credit to Happy like so:
|
|
75
76
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
3
|
+
var logger = require('./logger-CphW5nUE.cjs');
|
|
4
4
|
var node_fs = require('node:fs');
|
|
5
5
|
var path$1 = require('node:path');
|
|
6
6
|
var path = require('./path-B7zW-WwE.cjs');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-Dv0Q48P3.cjs');
|
|
8
8
|
var trimIdent = require('./trimIdent-4gvk9Wk6.cjs');
|
|
9
9
|
var os = require('node:os');
|
|
10
10
|
var agentGuidance = require('./agentGuidance-BtBx2xxE.cjs');
|
|
11
|
+
var prompt = require('./prompt-lgF9IE82.cjs');
|
|
11
12
|
|
|
12
13
|
function claudeCheckSession(sessionId, path$2) {
|
|
13
14
|
const projectDir = path.getProjectPath(path$2);
|
|
@@ -71,7 +72,7 @@ function shouldIncludeCoAuthoredBy() {
|
|
|
71
72
|
|
|
72
73
|
const BASE_SYSTEM_PROMPT = (() => trimIdent.trimIdent(`
|
|
73
74
|
This chat is titled automatically from the user's first message. Call "mcp__happy__change_title" only when the topic has clearly moved on or the current title is too generic to find this chat later. Do not call it as a ritual at the start of a chat, and not for a quick question you can just answer.
|
|
74
|
-
`))() + "\n\n" + agentGuidance.AGENT_GUIDANCE + "\n\n" + index.BUILTIN_TODO_DISCOVERY;
|
|
75
|
+
`))() + "\n\n" + agentGuidance.AGENT_GUIDANCE + "\n\n" + index.BUILTIN_TODO_DISCOVERY + "\n\n" + prompt.PROJECT_HINT;
|
|
75
76
|
const CO_AUTHORED_CREDITS = (() => trimIdent.trimIdent(`
|
|
76
77
|
When you yourself create a git commit, instead of just giving co-credit to Claude, also give credit to Happy like so:
|
|
77
78
|
|
|
@@ -4,20 +4,20 @@ var os = require('node:os');
|
|
|
4
4
|
var promises = require('node:fs/promises');
|
|
5
5
|
var z = require('zod');
|
|
6
6
|
var node_crypto = require('node:crypto');
|
|
7
|
-
var client = require('./client-
|
|
8
|
-
var persistence = require('./persistence-
|
|
9
|
-
var install = require('./install-
|
|
10
|
-
require('./configuration-
|
|
7
|
+
var client = require('./client-D_loZ9IK.cjs');
|
|
8
|
+
var persistence = require('./persistence-9BMYspxG.cjs');
|
|
9
|
+
var install = require('./install-BXvf2E3o.cjs');
|
|
10
|
+
require('./configuration-CYO-kPOS.cjs');
|
|
11
11
|
require('node:fs');
|
|
12
12
|
require('node:path');
|
|
13
|
-
require('./package-
|
|
14
|
-
require('./context-
|
|
13
|
+
require('./package-KhLqBDX9.cjs');
|
|
14
|
+
require('./context-6TP-iz_c.cjs');
|
|
15
15
|
require('./authRelay-Dy1qU9td.cjs');
|
|
16
16
|
require('tweetnacl');
|
|
17
|
-
require('./logger-
|
|
17
|
+
require('./logger-CphW5nUE.cjs');
|
|
18
18
|
require('chalk');
|
|
19
19
|
require('node:util');
|
|
20
|
-
require('./resources-
|
|
20
|
+
require('./resources-CvIlkzpP.cjs');
|
|
21
21
|
|
|
22
22
|
const legacyTask = z.z.object({
|
|
23
23
|
id: z.z.string().regex(/^T-\d{3,}$/),
|
|
@@ -2,20 +2,20 @@ import { homedir } from 'node:os';
|
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
|
-
import { t as teamRequest, c as createTeamsClient } from './client-
|
|
6
|
-
import {
|
|
7
|
-
import { a as installTeamSkill, i as installAutomationSkill } from './install-
|
|
8
|
-
import './configuration-
|
|
5
|
+
import { t as teamRequest, c as createTeamsClient } from './client-D4uPb1uu.mjs';
|
|
6
|
+
import { b as readCredentialsForConfiguredRelay } from './persistence-BFUOHW5h.mjs';
|
|
7
|
+
import { a as installTeamSkill, i as installAutomationSkill } from './install-BX3lv3NO.mjs';
|
|
8
|
+
import './configuration-PxzEJumr.mjs';
|
|
9
9
|
import 'node:fs';
|
|
10
10
|
import 'node:path';
|
|
11
|
-
import './package-
|
|
12
|
-
import './context-
|
|
11
|
+
import './package-7Ld1YMhh.mjs';
|
|
12
|
+
import './context-CJGRRGWW.mjs';
|
|
13
13
|
import './authRelay-DhQhkBvX.mjs';
|
|
14
14
|
import 'tweetnacl';
|
|
15
|
-
import './logger
|
|
15
|
+
import './logger-BUngm5Xg.mjs';
|
|
16
16
|
import 'chalk';
|
|
17
17
|
import 'node:util';
|
|
18
|
-
import './resources-
|
|
18
|
+
import './resources-y9jfyO-_.mjs';
|
|
19
19
|
|
|
20
20
|
const legacyTask = z.object({
|
|
21
21
|
id: z.string().regex(/^T-\d{3,}$/),
|
|
@@ -5,22 +5,23 @@ var module$1 = require('node:module');
|
|
|
5
5
|
var oneShotPrompts = require('./oneShotPrompts-CL0dip9C.cjs');
|
|
6
6
|
var node_crypto = require('node:crypto');
|
|
7
7
|
var path = require('node:path');
|
|
8
|
-
var logger = require('./logger-
|
|
9
|
-
var projectPath = require('./projectPath-
|
|
8
|
+
var logger = require('./logger-CphW5nUE.cjs');
|
|
9
|
+
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
10
10
|
|
|
11
11
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
12
12
|
const MAX_PROMPT_SAMPLE_CHARS = 500;
|
|
13
13
|
const MAX_TITLE_CHARS = 60;
|
|
14
14
|
const GENERATION_TIMEOUT_MS = 3e4;
|
|
15
|
-
function
|
|
15
|
+
function loadClaudeVersionUtils() {
|
|
16
|
+
const require$1 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('titleGenerator-Cgp5ihFb.cjs', document.baseURI).href)));
|
|
17
|
+
return require$1(path.resolve(path.join(projectPath.projectPath(), "scripts", "claude_version_utils.cjs")));
|
|
18
|
+
}
|
|
19
|
+
function resolveClaudeBinary(loadUtils = loadClaudeVersionUtils) {
|
|
16
20
|
try {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const { getClaudeCliPath } = require$1(utilsPath);
|
|
20
|
-
const path$1 = getClaudeCliPath();
|
|
21
|
-
if (typeof path$1 === "string" && path$1.length > 0) return path$1;
|
|
21
|
+
const found = loadUtils().findGlobalClaudeCliPath();
|
|
22
|
+
if (found && typeof found.path === "string" && found.path.length > 0) return found.path;
|
|
22
23
|
} catch (error) {
|
|
23
|
-
logger.logger.debug("[titleGenerator]
|
|
24
|
+
logger.logger.debug("[titleGenerator] findGlobalClaudeCliPath failed; falling back to PATH", { error: String(error) });
|
|
24
25
|
}
|
|
25
26
|
return process.env.HAPPY_CLAUDE_PATH || "claude";
|
|
26
27
|
}
|
|
@@ -3,21 +3,22 @@ import { createRequire } from 'node:module';
|
|
|
3
3
|
import { T as TITLE_PROMPT_PREFIX } from './oneShotPrompts-DT4p6RNd.mjs';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
5
|
import { resolve, join } from 'node:path';
|
|
6
|
-
import { l as logger } from './logger
|
|
6
|
+
import { l as logger } from './logger-BUngm5Xg.mjs';
|
|
7
7
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
8
8
|
|
|
9
9
|
const MAX_PROMPT_SAMPLE_CHARS = 500;
|
|
10
10
|
const MAX_TITLE_CHARS = 60;
|
|
11
11
|
const GENERATION_TIMEOUT_MS = 3e4;
|
|
12
|
-
function
|
|
12
|
+
function loadClaudeVersionUtils() {
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
return require(resolve(join(projectPath(), "scripts", "claude_version_utils.cjs")));
|
|
15
|
+
}
|
|
16
|
+
function resolveClaudeBinary(loadUtils = loadClaudeVersionUtils) {
|
|
13
17
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const { getClaudeCliPath } = require(utilsPath);
|
|
17
|
-
const path = getClaudeCliPath();
|
|
18
|
-
if (typeof path === "string" && path.length > 0) return path;
|
|
18
|
+
const found = loadUtils().findGlobalClaudeCliPath();
|
|
19
|
+
if (found && typeof found.path === "string" && found.path.length > 0) return found.path;
|
|
19
20
|
} catch (error) {
|
|
20
|
-
logger.debug("[titleGenerator]
|
|
21
|
+
logger.debug("[titleGenerator] findGlobalClaudeCliPath failed; falling back to PATH", { error: String(error) });
|
|
21
22
|
}
|
|
22
23
|
return process.env.HAPPY_CLAUDE_PATH || "claude";
|
|
23
24
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { c as configuration } from './configuration-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as readTeamScope, t as teamScopePath } from './context-
|
|
1
|
+
import { c as configuration } from './configuration-PxzEJumr.mjs';
|
|
2
|
+
import { e as createBuiltinTodoClient, B as BUILTIN_TODO_SKILL } from './index-C6Vn5Eac.mjs';
|
|
3
|
+
import { b as readCredentialsForConfiguredRelay } from './persistence-BFUOHW5h.mjs';
|
|
4
|
+
import { r as readTeamScope, t as teamScopePath } from './context-CJGRRGWW.mjs';
|
|
5
5
|
import 'node:fs';
|
|
6
6
|
import 'node:os';
|
|
7
7
|
import 'node:path';
|
|
8
|
-
import './package-
|
|
8
|
+
import './package-7Ld1YMhh.mjs';
|
|
9
9
|
import 'node:fs/promises';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import '@paralleldrive/cuid2';
|
|
12
12
|
import './authRelay-DhQhkBvX.mjs';
|
|
13
13
|
import 'node:crypto';
|
|
14
14
|
import 'tweetnacl';
|
|
15
|
-
import './logger
|
|
15
|
+
import './logger-BUngm5Xg.mjs';
|
|
16
16
|
import 'chalk';
|
|
17
17
|
import 'node:util';
|
|
18
18
|
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var configuration = require('./configuration-
|
|
4
|
-
var index = require('./index-
|
|
5
|
-
var persistence = require('./persistence-
|
|
6
|
-
var context = require('./context-
|
|
3
|
+
var configuration = require('./configuration-CYO-kPOS.cjs');
|
|
4
|
+
var index = require('./index-Dv0Q48P3.cjs');
|
|
5
|
+
var persistence = require('./persistence-9BMYspxG.cjs');
|
|
6
|
+
var context = require('./context-6TP-iz_c.cjs');
|
|
7
7
|
require('node:fs');
|
|
8
8
|
require('node:os');
|
|
9
9
|
require('node:path');
|
|
10
|
-
require('./package-
|
|
10
|
+
require('./package-KhLqBDX9.cjs');
|
|
11
11
|
require('node:fs/promises');
|
|
12
12
|
require('zod');
|
|
13
13
|
require('@paralleldrive/cuid2');
|
|
14
14
|
require('./authRelay-Dy1qU9td.cjs');
|
|
15
15
|
require('node:crypto');
|
|
16
16
|
require('tweetnacl');
|
|
17
|
-
require('./logger-
|
|
17
|
+
require('./logger-CphW5nUE.cjs');
|
|
18
18
|
require('chalk');
|
|
19
19
|
require('node:util');
|
|
20
20
|
|
|
@@ -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-D_loZ9IK.cjs');
|
|
5
5
|
|
|
6
6
|
const TEAM_TOOL_NAMES = ["team_create", "team_join", "team_inspect", "team_delegate", "team_message", "team_submit", "team_accept", "team_return", "team_cancel", "team_handoff", "team_schedule_create", "team_schedule_pause", "team_schedule_resume", "team_schedule_cancel"];
|
|
7
7
|
const id = z.z.string().min(1).max(128);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { c as createTeamsClient } from './client-
|
|
2
|
+
import { c as createTeamsClient } from './client-D4uPb1uu.mjs';
|
|
3
3
|
|
|
4
4
|
const TEAM_TOOL_NAMES = ["team_create", "team_join", "team_inspect", "team_delegate", "team_message", "team_submit", "team_accept", "team_return", "team_cancel", "team_handoff", "team_schedule_create", "team_schedule_pause", "team_schedule_resume", "team_schedule_cancel"];
|
|
5
5
|
const id = z.string().min(1).max(128);
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
4
|
-
var
|
|
3
|
+
var logger = require('./logger-CphW5nUE.cjs');
|
|
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-CYO-kPOS.cjs');
|
|
9
9
|
require('node:fs');
|
|
10
10
|
require('node:os');
|
|
11
11
|
require('node:path');
|
|
12
|
-
require('./package-
|
|
12
|
+
require('./package-KhLqBDX9.cjs');
|
|
13
13
|
require('node:fs/promises');
|
|
14
14
|
|
|
15
15
|
const PLIST_LABEL = "com.happy-cli.daemon";
|
|
16
16
|
const PLIST_FILE = `/Library/LaunchDaemons/${PLIST_LABEL}.plist`;
|
|
17
17
|
async function uninstall$1() {
|
|
18
18
|
try {
|
|
19
|
-
if (!
|
|
19
|
+
if (!require$$0.existsSync(PLIST_FILE)) {
|
|
20
20
|
logger.logger.info("Daemon plist not found. Nothing to uninstall.");
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
@@ -26,7 +26,7 @@ async function uninstall$1() {
|
|
|
26
26
|
} catch (error) {
|
|
27
27
|
logger.logger.info("Failed to unload daemon (it might not be running)");
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
require$$0.unlinkSync(PLIST_FILE);
|
|
30
30
|
logger.logger.info(`Removed daemon plist from ${PLIST_FILE}`);
|
|
31
31
|
logger.logger.info("Daemon uninstalled successfully");
|
|
32
32
|
} catch (error) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { l as logger } from './logger
|
|
1
|
+
import { l as logger } from './logger-BUngm5Xg.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-PxzEJumr.mjs';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:os';
|
|
9
9
|
import 'node:path';
|
|
10
|
-
import './package-
|
|
10
|
+
import './package-7Ld1YMhh.mjs';
|
|
11
11
|
import 'node:fs/promises';
|
|
12
12
|
|
|
13
13
|
const PLIST_LABEL = "com.happy-cli.daemon";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const WEB_PANEL_LIMIT = 8;
|
|
2
|
+
const WEB_PANEL_TITLE_MAX = 40;
|
|
3
|
+
const ID_RE = /^[a-z0-9][a-z0-9-]{0,31}$/;
|
|
4
|
+
const LOOPBACK = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
5
|
+
function webPanelUrlProblem(raw) {
|
|
6
|
+
if (typeof raw !== "string" || !raw.trim()) return "url is required";
|
|
7
|
+
let url;
|
|
8
|
+
try {
|
|
9
|
+
url = new URL(raw.trim());
|
|
10
|
+
} catch {
|
|
11
|
+
return "url is not a valid URL";
|
|
12
|
+
}
|
|
13
|
+
if (url.username || url.password) return "url must not contain credentials";
|
|
14
|
+
if (url.protocol === "https:") return null;
|
|
15
|
+
if (url.protocol === "http:" && LOOPBACK.has(url.hostname)) return null;
|
|
16
|
+
return "url must be https:// (http:// only for localhost)";
|
|
17
|
+
}
|
|
18
|
+
function normalizeWebPanels(raw) {
|
|
19
|
+
const panels = [];
|
|
20
|
+
const problems = [];
|
|
21
|
+
if (raw === void 0 || raw === null) return { panels, problems };
|
|
22
|
+
if (!Array.isArray(raw)) return { panels, problems: [{ index: -1, reason: "webPanels must be an array" }] };
|
|
23
|
+
const seen = /* @__PURE__ */ new Set();
|
|
24
|
+
raw.forEach((entry, index) => {
|
|
25
|
+
const e = entry && typeof entry === "object" ? entry : {};
|
|
26
|
+
const id = typeof e.id === "string" ? e.id.trim() : "";
|
|
27
|
+
const skip = (reason) => {
|
|
28
|
+
problems.push({ index, ...id ? { id } : {}, reason });
|
|
29
|
+
};
|
|
30
|
+
if (!ID_RE.test(id)) return skip("id must match ^[a-z0-9][a-z0-9-]{0,31}$");
|
|
31
|
+
if (seen.has(id)) return skip("duplicate id");
|
|
32
|
+
const urlProblem = webPanelUrlProblem(e.url);
|
|
33
|
+
if (urlProblem) return skip(urlProblem);
|
|
34
|
+
if (panels.length >= WEB_PANEL_LIMIT) return skip(`more than ${WEB_PANEL_LIMIT} panels`);
|
|
35
|
+
const title = (typeof e.title === "string" && e.title.trim() ? e.title.trim() : id).slice(0, WEB_PANEL_TITLE_MAX);
|
|
36
|
+
seen.add(id);
|
|
37
|
+
panels.push({ id, title, url: new URL(e.url.trim()).href, embed: e.embed !== false });
|
|
38
|
+
return void 0;
|
|
39
|
+
});
|
|
40
|
+
return { panels, problems };
|
|
41
|
+
}
|
|
42
|
+
function webPanelsSignature(panels) {
|
|
43
|
+
return JSON.stringify(panels.map((p) => [p.id, p.title, p.url, p.embed]));
|
|
44
|
+
}
|
|
45
|
+
function webPanelPath(machineId, panelId) {
|
|
46
|
+
return `/machine/${encodeURIComponent(machineId)}/panel/${encodeURIComponent(panelId)}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { webPanelsSignature as a, normalizeWebPanels as n, webPanelPath as w };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const WEB_PANEL_LIMIT = 8;
|
|
4
|
+
const WEB_PANEL_TITLE_MAX = 40;
|
|
5
|
+
const ID_RE = /^[a-z0-9][a-z0-9-]{0,31}$/;
|
|
6
|
+
const LOOPBACK = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
7
|
+
function webPanelUrlProblem(raw) {
|
|
8
|
+
if (typeof raw !== "string" || !raw.trim()) return "url is required";
|
|
9
|
+
let url;
|
|
10
|
+
try {
|
|
11
|
+
url = new URL(raw.trim());
|
|
12
|
+
} catch {
|
|
13
|
+
return "url is not a valid URL";
|
|
14
|
+
}
|
|
15
|
+
if (url.username || url.password) return "url must not contain credentials";
|
|
16
|
+
if (url.protocol === "https:") return null;
|
|
17
|
+
if (url.protocol === "http:" && LOOPBACK.has(url.hostname)) return null;
|
|
18
|
+
return "url must be https:// (http:// only for localhost)";
|
|
19
|
+
}
|
|
20
|
+
function normalizeWebPanels(raw) {
|
|
21
|
+
const panels = [];
|
|
22
|
+
const problems = [];
|
|
23
|
+
if (raw === void 0 || raw === null) return { panels, problems };
|
|
24
|
+
if (!Array.isArray(raw)) return { panels, problems: [{ index: -1, reason: "webPanels must be an array" }] };
|
|
25
|
+
const seen = /* @__PURE__ */ new Set();
|
|
26
|
+
raw.forEach((entry, index) => {
|
|
27
|
+
const e = entry && typeof entry === "object" ? entry : {};
|
|
28
|
+
const id = typeof e.id === "string" ? e.id.trim() : "";
|
|
29
|
+
const skip = (reason) => {
|
|
30
|
+
problems.push({ index, ...id ? { id } : {}, reason });
|
|
31
|
+
};
|
|
32
|
+
if (!ID_RE.test(id)) return skip("id must match ^[a-z0-9][a-z0-9-]{0,31}$");
|
|
33
|
+
if (seen.has(id)) return skip("duplicate id");
|
|
34
|
+
const urlProblem = webPanelUrlProblem(e.url);
|
|
35
|
+
if (urlProblem) return skip(urlProblem);
|
|
36
|
+
if (panels.length >= WEB_PANEL_LIMIT) return skip(`more than ${WEB_PANEL_LIMIT} panels`);
|
|
37
|
+
const title = (typeof e.title === "string" && e.title.trim() ? e.title.trim() : id).slice(0, WEB_PANEL_TITLE_MAX);
|
|
38
|
+
seen.add(id);
|
|
39
|
+
panels.push({ id, title, url: new URL(e.url.trim()).href, embed: e.embed !== false });
|
|
40
|
+
return void 0;
|
|
41
|
+
});
|
|
42
|
+
return { panels, problems };
|
|
43
|
+
}
|
|
44
|
+
function webPanelsSignature(panels) {
|
|
45
|
+
return JSON.stringify(panels.map((p) => [p.id, p.title, p.url, p.embed]));
|
|
46
|
+
}
|
|
47
|
+
function webPanelPath(machineId, panelId) {
|
|
48
|
+
return `/machine/${encodeURIComponent(machineId)}/panel/${encodeURIComponent(panelId)}`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
exports.normalizeWebPanels = normalizeWebPanels;
|
|
52
|
+
exports.webPanelPath = webPanelPath;
|
|
53
|
+
exports.webPanelsSignature = webPanelsSignature;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "very-happy-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.180",
|
|
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.0.0"
|
|
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.180",
|
|
121
|
+
"very-happy-tools-x64-darwin": "0.2.180",
|
|
122
|
+
"very-happy-tools-arm64-linux": "0.2.180",
|
|
123
|
+
"very-happy-tools-x64-linux": "0.2.180",
|
|
124
|
+
"very-happy-tools-arm64-win32": "0.2.180",
|
|
125
|
+
"very-happy-tools-x64-win32": "0.2.180"
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
128
|
"@slopus/happy-wire": "workspace:*",
|
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
"cross-env": "^10.1.0",
|
|
135
135
|
"dotenv": "^16.6.1",
|
|
136
136
|
"pkgroll": "^2.14.2",
|
|
137
|
+
"smol-toml": "1.9.0",
|
|
137
138
|
"ts-node": "^10",
|
|
138
139
|
"tsx": "^4.20.6",
|
|
139
140
|
"typescript": "5.9.3",
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import os from 'node:os';
|
|
2
|
-
import { p as packageJson } from './package-B7B03ejW.mjs';
|
|
3
|
-
import { c as configuration } from './configuration-DVrb61aY.mjs';
|
|
4
|
-
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
5
|
-
import { d as detectCLIAvailability } from './detectCLI-CSGMlV51.mjs';
|
|
6
|
-
import { d as detectResumeSupport } from './localHappyAgentAuth-BezKSFDi.mjs';
|
|
7
|
-
|
|
8
|
-
function buildInitialMachineMetadata(cliAvailability) {
|
|
9
|
-
const hostSuffix = process.env.HAPPY_VARIANT === "dev" ? "-dev" : "";
|
|
10
|
-
return {
|
|
11
|
-
teamsVersion: 1,
|
|
12
|
-
teamLaunchVersion: 1,
|
|
13
|
-
worktreeVersion: 1,
|
|
14
|
-
host: os.hostname() + hostSuffix,
|
|
15
|
-
platform: os.platform(),
|
|
16
|
-
happyCliVersion: packageJson.version,
|
|
17
|
-
homeDir: os.homedir(),
|
|
18
|
-
happyHomeDir: configuration.happyHomeDir,
|
|
19
|
-
happyLibDir: projectPath(),
|
|
20
|
-
cliAvailability,
|
|
21
|
-
resumeSupport: { ...detectResumeSupport(), rpcAvailable: true }
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
let memo = null;
|
|
25
|
-
function compute() {
|
|
26
|
-
if (!memo) {
|
|
27
|
-
const cliAvailability = detectCLIAvailability();
|
|
28
|
-
memo = { metadata: buildInitialMachineMetadata(cliAvailability), cliAvailability };
|
|
29
|
-
}
|
|
30
|
-
return memo;
|
|
31
|
-
}
|
|
32
|
-
function getInitialMachineMetadata() {
|
|
33
|
-
return compute().metadata;
|
|
34
|
-
}
|
|
35
|
-
function getStartupCliAvailability() {
|
|
36
|
-
return compute().cliAvailability;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { getStartupCliAvailability as a, getInitialMachineMetadata as g };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var os = require('node:os');
|
|
4
|
-
var _package = require('./package-DY4zTbKS.cjs');
|
|
5
|
-
var configuration = require('./configuration-4TGMrjul.cjs');
|
|
6
|
-
var projectPath = require('./projectPath-ChLhdOyt.cjs');
|
|
7
|
-
var detectCLI = require('./detectCLI-DR9ZaN6B.cjs');
|
|
8
|
-
var localHappyAgentAuth = require('./localHappyAgentAuth-Br-mgogg.cjs');
|
|
9
|
-
|
|
10
|
-
function buildInitialMachineMetadata(cliAvailability) {
|
|
11
|
-
const hostSuffix = process.env.HAPPY_VARIANT === "dev" ? "-dev" : "";
|
|
12
|
-
return {
|
|
13
|
-
teamsVersion: 1,
|
|
14
|
-
teamLaunchVersion: 1,
|
|
15
|
-
worktreeVersion: 1,
|
|
16
|
-
host: os.hostname() + hostSuffix,
|
|
17
|
-
platform: os.platform(),
|
|
18
|
-
happyCliVersion: _package.packageJson.version,
|
|
19
|
-
homeDir: os.homedir(),
|
|
20
|
-
happyHomeDir: configuration.configuration.happyHomeDir,
|
|
21
|
-
happyLibDir: projectPath.projectPath(),
|
|
22
|
-
cliAvailability,
|
|
23
|
-
resumeSupport: { ...localHappyAgentAuth.detectResumeSupport(), rpcAvailable: true }
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
let memo = null;
|
|
27
|
-
function compute() {
|
|
28
|
-
if (!memo) {
|
|
29
|
-
const cliAvailability = detectCLI.detectCLIAvailability();
|
|
30
|
-
memo = { metadata: buildInitialMachineMetadata(cliAvailability), cliAvailability };
|
|
31
|
-
}
|
|
32
|
-
return memo;
|
|
33
|
-
}
|
|
34
|
-
function getInitialMachineMetadata() {
|
|
35
|
-
return compute().metadata;
|
|
36
|
-
}
|
|
37
|
-
function getStartupCliAvailability() {
|
|
38
|
-
return compute().cliAvailability;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
exports.getInitialMachineMetadata = getInitialMachineMetadata;
|
|
42
|
-
exports.getStartupCliAvailability = getStartupCliAvailability;
|