very-happy-cli 0.2.159 → 0.2.161
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-VsfkZiVF.mjs → AcpBackend-6U6pQgx1.mjs} +4 -2
- package/dist/{AcpBackend-DUYFlyfN.cjs → AcpBackend-Ba98QDif.cjs} +78 -76
- package/dist/{AcpSessionManager-Bdv8LWXh.cjs → AcpSessionManager-BAY1Pggx.cjs} +9 -9
- package/dist/{AcpSessionManager-rYtVb0kN.mjs → AcpSessionManager-CoMWFVw3.mjs} +1 -1
- package/dist/BasePermissionHandler-2R0uH2CI.cjs +157 -0
- package/dist/BasePermissionHandler-BvvhBTja.mjs +155 -0
- package/dist/BaseReasoningProcessor-DyhO1uoU.mjs +198 -0
- package/dist/BaseReasoningProcessor-fsVNmCEF.cjs +200 -0
- package/dist/RemoteModeDisplay-D-HewyXg.mjs +150 -0
- package/dist/RemoteModeDisplay-NC1gPHtj.cjs +153 -0
- package/dist/agentAttachments-Dbw8iMCZ.cjs +20 -0
- package/dist/agentAttachments-M_B5qEF2.mjs +18 -0
- package/dist/agentGuidance-B5NATuFa.cjs +28 -0
- package/dist/agentGuidance-CQuNlNx8.mjs +20 -0
- package/dist/{agentHome-CvsJyeQB.mjs → agentHome-Ck1i1TQB.mjs} +8 -22
- package/dist/{agentHome-CHh4lmjM.cjs → agentHome-DvNnGphb.cjs} +14 -28
- package/dist/api-B2vLMS-z.cjs +3346 -0
- package/dist/api-SffjRQ1b.mjs +3339 -0
- package/dist/{types-Dh-s4Lqs.mjs → apiMachine-BpW9t8MO.mjs} +9116 -16205
- package/dist/{types-BbvK1Tr_.cjs → apiMachine-gFA54X7y.cjs} +9104 -16247
- package/dist/assistantTools-BfA0R3_m.cjs +380 -0
- package/dist/assistantTools-CgiTbnWb.mjs +376 -0
- package/dist/attachmentContent-CSGxr71v.mjs +82 -0
- package/dist/attachmentContent-DMMZzevR.cjs +88 -0
- package/dist/attachmentLimits-CzVrqgLR.cjs +354 -0
- package/dist/attachmentLimits-yba1uHFO.mjs +348 -0
- package/dist/auth-Bt4ceBBy.cjs +227 -0
- package/dist/auth-CYHjQ8oQ.mjs +225 -0
- package/dist/auth-DdyVZSo6.mjs +218 -0
- package/dist/auth-x4CEoysH.cjs +220 -0
- package/dist/authRelay-BdYkC1Po.cjs +156 -0
- package/dist/authRelay-DSAvg1uv.mjs +143 -0
- package/dist/{auto-DKmEls8Z.cjs → auto-BDXDUnjB.cjs} +70 -79
- package/dist/{auto-nb8GhRRy.mjs → auto-CXLlRi3a.mjs} +27 -36
- package/dist/backgroundTaskActivity-8PdPxrvy.mjs +149 -0
- package/dist/backgroundTaskActivity-CBvUdj39.cjs +157 -0
- package/dist/bootstrap-BNQq05jR.mjs +112 -0
- package/dist/bootstrap-CkgIq8N3.cjs +116 -0
- package/dist/browser-9pyhQr1R.mjs +20 -0
- package/dist/browser-BDOlKWYe.cjs +22 -0
- package/dist/claudeCliPath-BqkaH2oR.mjs +8 -0
- package/dist/claudeCliPath-U4HHmV4r.cjs +10 -0
- package/dist/claudeLocal-BDuGFnjJ.cjs +343 -0
- package/dist/claudeLocal-CQa8qnwq.mjs +339 -0
- package/dist/claudeLocalLauncher-Bd5I2-j6.cjs +154 -0
- package/dist/claudeLocalLauncher-CDqQI9ak.mjs +152 -0
- package/dist/cliUpdate-DsKXPFYp.cjs +120 -0
- package/dist/cliUpdate-Y34VGe9Y.mjs +112 -0
- package/dist/client-Brn-UwVk.mjs +100 -0
- package/dist/client-CXb1VJui.mjs +112 -0
- package/dist/client-C_axwRry.cjs +104 -0
- package/dist/client-DOBWJL3u.cjs +119 -0
- package/dist/codex/happyMcpStdioBridge.cjs +33 -14
- package/dist/codex/happyMcpStdioBridge.mjs +26 -7
- package/dist/codexAppServerClient-ZzhUTWPo.cjs +1090 -0
- package/dist/codexAppServerClient-oeQKD6Qf.mjs +1088 -0
- package/dist/codexCommand-C7H0NpBe.cjs +2088 -0
- package/dist/codexCommand-CJ82bl3l.mjs +2086 -0
- package/dist/codexThreadFork-BCaEMBiM.mjs +338 -0
- package/dist/codexThreadFork-BZqF-9bX.cjs +350 -0
- package/dist/{config-ClLtM6F3.mjs → config-BglnktIo.mjs} +7 -40
- package/dist/{config-DLx-vW3I.cjs → config-CYpL1Ahd.cjs} +26 -59
- package/dist/configuration-DoWFJUPm.mjs +170 -0
- package/dist/configuration-v9f8LM9T.cjs +181 -0
- package/dist/connect-hgcNjyAB.mjs +682 -0
- package/dist/connect-yEvjdRvx.cjs +684 -0
- package/dist/constants-BC4St0xd.mjs +11 -0
- package/dist/constants-VJ0N6WuG.cjs +17 -0
- package/dist/contentLogMetadata-BlWI0egu.mjs +51 -0
- package/dist/contentLogMetadata-ZSFk_NjQ.cjs +54 -0
- package/dist/context-B45vMtSZ.cjs +69 -0
- package/dist/context-C9GHPLEm.mjs +65 -0
- package/dist/controlClient-DjoKTtgK.mjs +260 -0
- package/dist/controlClient-fEHE85bH.cjs +279 -0
- package/dist/createSessionMetadata-BRLB9CNO.cjs +58 -0
- package/dist/createSessionMetadata-mIeehclp.mjs +54 -0
- package/dist/defaultPermissionMode-BnxJPVHT.mjs +4 -0
- package/dist/defaultPermissionMode-CxmTXUQR.cjs +7 -0
- package/dist/detectCLI-CSGMlV51.mjs +58 -0
- package/dist/detectCLI-DR9ZaN6B.cjs +61 -0
- package/dist/deterministicJson-DKDP_mM-.cjs +507 -0
- package/dist/deterministicJson-p835AdAU.mjs +502 -0
- package/dist/doctor-BPkYWSuq.mjs +75 -0
- package/dist/doctor-BeUuQXFs.mjs +391 -0
- package/dist/doctor-hVNnSZJn.cjs +395 -0
- package/dist/doctor-u46qYYKX.cjs +79 -0
- package/dist/doctorReadiness-BCZGcN0a.cjs +151 -0
- package/dist/doctorReadiness-C208SMN9.mjs +142 -0
- package/dist/editPaths-BVfS_FFL.mjs +68 -0
- package/dist/editPaths-Bqp4OFPw.cjs +73 -0
- package/dist/ensureDaemonRunning-CO7d1gOC.mjs +61 -0
- package/dist/ensureDaemonRunning-Dg9aZfjs.cjs +64 -0
- package/dist/handleResumeCommand-BiTPK0qd.mjs +240 -0
- package/dist/handleResumeCommand-DnVmy7a3.cjs +245 -0
- package/dist/ids-B6ZC0HGt.cjs +13 -0
- package/dist/ids-DU6sLx4C.mjs +10 -0
- package/dist/index-B6UGRQ7h.mjs +102 -0
- package/dist/{index-2mCaeKyf.mjs → index-CAFwetLk.mjs} +68 -38
- package/dist/index-Cqx-Raq6.mjs +68 -0
- package/dist/index-D3kI0hDR.cjs +107 -0
- package/dist/index-DA7yINuk.cjs +994 -0
- package/dist/{index-BEOMECtE.cjs → index-LIn6nCcq.cjs} +121 -91
- package/dist/index-Pf2cV9cn.cjs +182 -0
- package/dist/index-SPGPenK5.mjs +158 -0
- package/dist/index-gNTWtSKN.cjs +71 -0
- package/dist/index-qdS1friN.mjs +949 -0
- package/dist/index.cjs +5 -46
- package/dist/index.mjs +5 -46
- package/dist/{install-BPhJppvd.mjs → install-BO_W7VhL.mjs} +37 -37
- package/dist/install-Bu85vlHD.cjs +88 -0
- package/dist/install-ClUUl3yp.mjs +86 -0
- package/dist/{install-BOHrUaFM.cjs → install-Cs5qAPrB.cjs} +38 -38
- package/dist/{installPiTools-DuZ6jZvX.cjs → installPiTools-BKnXjrVu.cjs} +2 -3
- package/dist/{installPiTools-Cj7yU9Fc.mjs → installPiTools-B_CdM5_2.mjs} +1 -2
- package/dist/{installTerminalHooks-Cou3WUf3.cjs → installTerminalHooks-BQZbvxsZ.cjs} +5 -40
- package/dist/{installTerminalHooks-WeznjkuC.mjs → installTerminalHooks-By7gBMEF.mjs} +3 -38
- package/dist/lib.cjs +28 -19
- package/dist/lib.d.cts +12 -2
- package/dist/lib.d.mts +12 -2
- package/dist/lib.mjs +23 -14
- package/dist/lidState-C2dI0FAN.mjs +297 -0
- package/dist/lidState-KHHu1015.cjs +305 -0
- package/dist/limits-C-a7gr04.cjs +43 -0
- package/dist/limits-DIo7rEBR.mjs +36 -0
- package/dist/localHappyAgentAuth-BXiHPXdC.cjs +86 -0
- package/dist/localHappyAgentAuth-DCsetiyG.mjs +82 -0
- package/dist/logger-Bc8-u1w0.cjs +275 -0
- package/dist/logger-fXoNzNuB.mjs +271 -0
- package/dist/loginShellEnv-BkuYtExZ.cjs +182 -0
- package/dist/loginShellEnv-Dw8M7tkI.mjs +167 -0
- package/dist/machineMetadata-BHjehxJY.mjs +38 -0
- package/dist/machineMetadata-BibDMFVx.cjs +41 -0
- package/dist/main-BktM4A1K.mjs +939 -0
- package/dist/main-CLaX-t-b.cjs +941 -0
- package/dist/manager-BQ4flvQZ.mjs +101 -0
- package/dist/manager-Cly8xVIR.cjs +105 -0
- package/dist/{mcp-Dy3f_K0h.mjs → mcp-CeUd9KDr.mjs} +27 -33
- package/dist/{mcp-CPYbtsYG.cjs → mcp-GBfE70nk.cjs} +42 -48
- package/dist/messageBuffer-BWlGgR3A.mjs +71 -0
- package/dist/messageBuffer-fJMH6uY8.cjs +73 -0
- package/dist/mirrorProtocol-BNLtoWjO.mjs +170 -0
- package/dist/mirrorProtocol-BUtmg1ws.cjs +186 -0
- package/dist/oneShotPrompts-CL0dip9C.cjs +16 -0
- package/dist/oneShotPrompts-DT4p6RNd.mjs +12 -0
- package/dist/package-Cl5BEP5x.cjs +173 -0
- package/dist/package-uOg9SCKi.mjs +171 -0
- package/dist/path-B7zW-WwE.cjs +18 -0
- package/dist/path-D2wdaNSk.mjs +15 -0
- package/dist/peerTools-CIeiy9wn.cjs +283 -0
- package/dist/peerTools-Dz3_7Bkk.mjs +272 -0
- package/dist/permissionMode-CH4FoZfU.mjs +80 -0
- package/dist/permissionMode-CrV-XuMs.cjs +87 -0
- package/dist/persistence-CBNMzSa8.cjs +414 -0
- package/dist/persistence-oET5n61f.mjs +372 -0
- package/dist/piExtension.mjs +2 -1
- package/dist/piRunnerArgs-Bf7RUF__.cjs +66 -0
- package/dist/piRunnerArgs-Dk1ncwHF.mjs +59 -0
- package/dist/{piRuntime-NtF0YqjH.cjs → piRuntime-B_6TE9Eb.cjs} +4 -4
- package/dist/{piRuntime-kLZNpAAl.mjs → piRuntime-BwRdhK_N.mjs} +2 -2
- package/dist/{piTerminal-B0fEOV_2.mjs → piTerminal-Bap3R8Re.mjs} +32 -35
- package/dist/{piTerminal-9J0GAKzb.cjs → piTerminal-CagmEoez.cjs} +32 -35
- package/dist/previewPath-B0rBdhy1.cjs +83 -0
- package/dist/previewPath-CXN4Vag0.mjs +81 -0
- package/dist/projectPath-BTBIMB57.mjs +10 -0
- package/dist/projectPath-ChLhdOyt.cjs +13 -0
- package/dist/registerCommonHandlers-BjSV2Skz.cjs +538 -0
- package/dist/registerCommonHandlers-CrgvJsOy.mjs +536 -0
- package/dist/registerKillSessionHandler-6TC2S3lf.cjs +366 -0
- package/dist/registerKillSessionHandler-Cbc8Rgtd.mjs +363 -0
- package/dist/remoteSessionClient-BNx78NLb.cjs +634 -0
- package/dist/remoteSessionClient-CO7qOjR0.mjs +612 -0
- package/dist/resources-BdFBQi8r.mjs +117 -0
- package/dist/resources-JDPugcDq.cjs +120 -0
- package/dist/run-2l5vSt2h.mjs +5743 -0
- package/dist/run-D5xAEWSB.cjs +5766 -0
- package/dist/runClaude-BX6ixjtW.cjs +894 -0
- package/dist/runClaude-BgN6xo05.mjs +892 -0
- package/dist/runClaudeDeps-Bp20MScE.cjs +4168 -0
- package/dist/runClaudeDeps-COBBhD9o.mjs +4129 -0
- package/dist/{runGemini-F-mqx3_K.cjs → runGemini-CSMPkt0p.cjs} +202 -175
- package/dist/{runGemini-DV6Ouadt.mjs → runGemini-Cc2jq-uh.mjs} +58 -31
- package/dist/{runOpenClaw-D7MlPS5n.mjs → runOpenClaw-CIlCwdW2.mjs} +31 -32
- package/dist/{runOpenClaw-Qqo9j63M.cjs → runOpenClaw-YBwua4Rf.cjs} +64 -65
- package/dist/sandbox-C4gXLP1p.cjs +187 -0
- package/dist/sandbox-CNkwOtHI.mjs +180 -0
- package/dist/selfCheck-CU8xSDsl.cjs +87 -0
- package/dist/selfCheck-hJ6PCh7v.mjs +84 -0
- package/dist/{send-CLhYXNgy.mjs → send-CGHcKZ-w.mjs} +12 -5
- package/dist/{send-4qJTCAYW.cjs → send-DY9Nr-x4.cjs} +16 -9
- package/dist/server-II51Mimf.cjs +407 -0
- package/dist/server-m2b5pamZ.mjs +404 -0
- package/dist/sessionLock-7ePAYDOg.cjs +205 -0
- package/dist/sessionLock-Cw6FmbMv.mjs +197 -0
- package/dist/sessionModeFile-BVCV5f7E.cjs +36 -0
- package/dist/sessionModeFile-CDmDyRkD.mjs +32 -0
- package/dist/sessionOps-C_f1wKOr.mjs +760 -0
- package/dist/sessionOps-DJdExmBy.cjs +783 -0
- package/dist/sessionScanner-CaAHLyNV.mjs +206 -0
- package/dist/sessionScanner-D1goKdd3.cjs +209 -0
- package/dist/{sessions-Bh1pyddi.cjs → sessions-DGs6ALNo.cjs} +37 -28
- package/dist/{sessions-CzIH2rGp.mjs → sessions-DnvmWUel.mjs} +17 -8
- package/dist/setupOfflineReconnection-CVViqZft.mjs +72 -0
- package/dist/setupOfflineReconnection-R7XuR_sj.cjs +74 -0
- package/dist/smallFastModel-BLNgMrwR.mjs +18 -0
- package/dist/smallFastModel-D_uxGMo3.cjs +21 -0
- package/dist/{spawn-CmFOSVdW.cjs → spawn-CXTH7qg1.cjs} +61 -65
- package/dist/{spawn-CPIWlPOM.mjs → spawn-DNYSvFtC.mjs} +35 -40
- package/dist/spawnAgents-BGQiEF-w.cjs +52 -0
- package/dist/spawnAgents-DZzZ9jMI.mjs +45 -0
- package/dist/spawnHappyCLI-BhYj84rv.cjs +66 -0
- package/dist/spawnHappyCLI-cqWQbwsb.mjs +64 -0
- package/dist/specialCommands-BSqhYg5X.mjs +52 -0
- package/dist/specialCommands-DSsTeRej.cjs +54 -0
- package/dist/startFileWatcher-CKKx-8ZO.cjs +71 -0
- package/dist/startFileWatcher-CdegMbJj.mjs +69 -0
- package/dist/startupPlan-BLMbfQIH.cjs +12 -0
- package/dist/startupPlan-DFMyNgAs.mjs +10 -0
- package/dist/streamRelay-BiKw59Cc.cjs +233 -0
- package/dist/streamRelay-FPVbHpbM.mjs +231 -0
- package/dist/sync-CVk4QERO.cjs +71 -0
- package/dist/sync-CxD-w_40.mjs +69 -0
- package/dist/systemPrompt-BygJcmbi.cjs +97 -0
- package/dist/systemPrompt-DmtypUc7.mjs +94 -0
- package/dist/{teams-CEahj4cm.mjs → teams-BOC6nIPL.mjs} +9 -40
- package/dist/{teams-CB1R9-Z9.cjs → teams-BsvpOBfn.cjs} +14 -45
- package/dist/template-BaHAmH2K.cjs +129 -0
- package/dist/template-CiOPa2rd.mjs +121 -0
- package/dist/{terminalTitleSuggest-DKgX3osW.mjs → terminalTitleSuggest-CeKsX_V6.mjs} +1 -9
- package/dist/{terminalTitleSuggest-Dji8I0Jy.cjs → terminalTitleSuggest-DhvRFX3H.cjs} +0 -10
- package/dist/terminals-B_bfC9c2.cjs +250 -0
- package/dist/terminals-Dlg0x3nY.mjs +235 -0
- package/dist/time-BZNdNiIV.mjs +38 -0
- package/dist/time-CNRE4ChD.cjs +42 -0
- package/dist/titleGenerator-CFRhU-xq.cjs +172 -0
- package/dist/titleGenerator-ox6ptCsp.mjs +166 -0
- package/dist/tmuxSocket-B8Yx20sT.mjs +19 -0
- package/dist/tmuxSocket-D-Xt6Vn-.cjs +24 -0
- package/dist/{todo-DqyRI4wP.cjs → todo-B-KB7oAB.cjs} +15 -12
- package/dist/{todo-Cknp5D4U.mjs → todo-C5KBVbUw.mjs} +11 -8
- package/dist/tools-BZabNIid.mjs +177 -0
- package/dist/tools-BmQQUATY.mjs +60 -0
- package/dist/tools-CsSovyNp.cjs +180 -0
- package/dist/tools-lMDra4Pv.cjs +63 -0
- package/dist/trimIdent-4gvk9Wk6.cjs +22 -0
- package/dist/trimIdent-BAjmv_TG.mjs +20 -0
- package/dist/types-CRS-srZK.cjs +66 -0
- package/dist/types-CkqAACXx.mjs +64 -0
- package/dist/uninstall-B1WLtC1d.mjs +47 -0
- package/dist/uninstall-fvA5aWpU.cjs +49 -0
- package/package.json +7 -7
- package/scripts/session_hook_forwarder.cjs +9 -2
- package/dist/agentGuidance-BRDN1NoZ.cjs +0 -2217
- package/dist/agentGuidance-KgvYuF3R.mjs +0 -2145
- package/dist/index-BF6WfgV5.mjs +0 -19624
- package/dist/index-C-JazrMB.mjs +0 -52
- package/dist/index-blDSadUR.cjs +0 -58
- package/dist/index-rH3DrQ5B.cjs +0 -19688
- package/dist/limits-BH5CV5vR.cjs +0 -2683
- package/dist/limits-CjRj8IX5.mjs +0 -2558
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chalk = require('chalk');
|
|
4
|
+
var inquirer = require('inquirer');
|
|
5
|
+
var node_fs = require('node:fs');
|
|
6
|
+
var os = require('node:os');
|
|
7
|
+
var persistence = require('./persistence-CBNMzSa8.cjs');
|
|
8
|
+
require('node:fs/promises');
|
|
9
|
+
require('./configuration-v9f8LM9T.cjs');
|
|
10
|
+
require('node:path');
|
|
11
|
+
require('./package-Cl5BEP5x.cjs');
|
|
12
|
+
require('zod');
|
|
13
|
+
require('./authRelay-BdYkC1Po.cjs');
|
|
14
|
+
require('node:crypto');
|
|
15
|
+
require('tweetnacl');
|
|
16
|
+
require('./logger-Bc8-u1w0.cjs');
|
|
17
|
+
require('node:util');
|
|
18
|
+
|
|
19
|
+
const DEFAULT_WORKSPACE_ROOT = "~/Workspace";
|
|
20
|
+
const DEFAULT_DENY_READ_PATHS = ["~/.ssh", "~/.aws", "~/.gnupg"];
|
|
21
|
+
function workspaceCandidatesForPlatform(platform) {
|
|
22
|
+
if (platform === "darwin") {
|
|
23
|
+
return ["~/Developer", "~/Develop", "~/Workspace"];
|
|
24
|
+
}
|
|
25
|
+
if (platform === "linux") {
|
|
26
|
+
return ["~/Workspace", "~/Developer", "~/Develop"];
|
|
27
|
+
}
|
|
28
|
+
return ["~/Developer", "~/Develop", "~/Workspace"];
|
|
29
|
+
}
|
|
30
|
+
function detectWorkspaceRootSuggestions(options) {
|
|
31
|
+
const platform = options?.platform ?? process.platform;
|
|
32
|
+
const home = options?.home ?? os.homedir();
|
|
33
|
+
const pathExists = options?.pathExists ?? node_fs.existsSync;
|
|
34
|
+
const candidates = workspaceCandidatesForPlatform(platform);
|
|
35
|
+
const existing = candidates.filter((candidate) => {
|
|
36
|
+
const absolutePath = candidate.replace(/^~(?=\/|$)/, home);
|
|
37
|
+
return pathExists(absolutePath);
|
|
38
|
+
});
|
|
39
|
+
if (existing.length > 0) {
|
|
40
|
+
return existing;
|
|
41
|
+
}
|
|
42
|
+
return [candidates[0] ?? DEFAULT_WORKSPACE_ROOT];
|
|
43
|
+
}
|
|
44
|
+
async function handleSandboxCommand(args) {
|
|
45
|
+
const subcommand = args[0];
|
|
46
|
+
if (!subcommand || subcommand === "help" || subcommand === "--help" || subcommand === "-h") {
|
|
47
|
+
handleSandboxHelp();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
switch (subcommand) {
|
|
51
|
+
case "configure":
|
|
52
|
+
await handleSandboxConfigure();
|
|
53
|
+
break;
|
|
54
|
+
case "status":
|
|
55
|
+
await handleSandboxStatus();
|
|
56
|
+
break;
|
|
57
|
+
case "disable":
|
|
58
|
+
await handleSandboxDisable();
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
console.error(chalk.red(`Unknown sandbox subcommand: ${subcommand}`));
|
|
62
|
+
handleSandboxHelp();
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function handleSandboxConfigure() {
|
|
67
|
+
const workspaceRootSuggestions = detectWorkspaceRootSuggestions();
|
|
68
|
+
const workspaceRootDefault = workspaceRootSuggestions[0] ?? DEFAULT_WORKSPACE_ROOT;
|
|
69
|
+
const answers = await inquirer.prompt([
|
|
70
|
+
{
|
|
71
|
+
type: "list",
|
|
72
|
+
name: "scopeMode",
|
|
73
|
+
message: "How should file access be scoped?",
|
|
74
|
+
default: "workspace",
|
|
75
|
+
choices: [
|
|
76
|
+
{ name: "workspace - Full workspace root directory", value: "workspace" },
|
|
77
|
+
{ name: "per-project - Only current project directory", value: "project" }
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: "list",
|
|
82
|
+
name: "workspaceRoot",
|
|
83
|
+
message: "Pick your workspace root directory",
|
|
84
|
+
when: (currentAnswers) => currentAnswers.scopeMode === "workspace",
|
|
85
|
+
default: workspaceRootDefault,
|
|
86
|
+
choices: workspaceRootSuggestions.map((pathValue) => ({
|
|
87
|
+
name: `${pathValue}${node_fs.existsSync(pathValue.replace(/^~(?=\/|$)/, os.homedir())) ? "" : " (suggested)"}`,
|
|
88
|
+
value: pathValue
|
|
89
|
+
}))
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
type: "list",
|
|
93
|
+
name: "networkMode",
|
|
94
|
+
message: "How should network access be handled?",
|
|
95
|
+
default: "allowed",
|
|
96
|
+
choices: [
|
|
97
|
+
{ name: "allowed - Allow all network access (default)", value: "allowed" },
|
|
98
|
+
{ name: "blocked - Block all network access (most secure)", value: "blocked" }
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: "confirm",
|
|
103
|
+
name: "allowLocalBinding",
|
|
104
|
+
message: "Allow binding to localhost ports? (for dev servers)",
|
|
105
|
+
default: true
|
|
106
|
+
}
|
|
107
|
+
]);
|
|
108
|
+
const scopeMode = answers.scopeMode;
|
|
109
|
+
const sandboxConfig = persistence.SandboxConfigSchema.parse({
|
|
110
|
+
enabled: true,
|
|
111
|
+
workspaceRoot: scopeMode === "workspace" ? answers.workspaceRoot || workspaceRootDefault : void 0,
|
|
112
|
+
sessionIsolation: scopeMode === "workspace" ? "workspace" : "strict",
|
|
113
|
+
customWritePaths: [],
|
|
114
|
+
denyReadPaths: DEFAULT_DENY_READ_PATHS,
|
|
115
|
+
extraWritePaths: ["/tmp"],
|
|
116
|
+
denyWritePaths: [".env"],
|
|
117
|
+
networkMode: answers.networkMode,
|
|
118
|
+
allowedDomains: [],
|
|
119
|
+
deniedDomains: [],
|
|
120
|
+
allowLocalBinding: Boolean(answers.allowLocalBinding)
|
|
121
|
+
});
|
|
122
|
+
console.log(chalk.bold("\nSandbox configuration summary:"));
|
|
123
|
+
console.log(JSON.stringify(sandboxConfig, null, 2));
|
|
124
|
+
const { confirmSave } = await inquirer.prompt([
|
|
125
|
+
{
|
|
126
|
+
type: "confirm",
|
|
127
|
+
name: "confirmSave",
|
|
128
|
+
message: "Save and enable this sandbox configuration?",
|
|
129
|
+
default: true
|
|
130
|
+
}
|
|
131
|
+
]);
|
|
132
|
+
if (!confirmSave) {
|
|
133
|
+
console.log(chalk.yellow("Sandbox configuration cancelled."));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
await persistence.updateSettings((settings) => ({
|
|
137
|
+
...settings,
|
|
138
|
+
sandboxConfig
|
|
139
|
+
}));
|
|
140
|
+
console.log(chalk.green("Sandbox configuration saved and enabled."));
|
|
141
|
+
console.log(chalk.gray("Use --no-sandbox to bypass sandboxing for a single session."));
|
|
142
|
+
}
|
|
143
|
+
async function handleSandboxStatus() {
|
|
144
|
+
const settings = await persistence.readSettings();
|
|
145
|
+
const config = settings.sandboxConfig;
|
|
146
|
+
if (!config) {
|
|
147
|
+
console.log("Sandbox is not configured. Run `very-happy sandbox configure`.");
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
console.log(chalk.bold("Sandbox status"));
|
|
151
|
+
console.log(`Enabled: ${config.enabled ? "yes" : "no"}`);
|
|
152
|
+
const scope = config.sessionIsolation === "workspace" ? "workspace" : "per-project";
|
|
153
|
+
console.log(`Scope: ${scope}`);
|
|
154
|
+
if (scope === "workspace") {
|
|
155
|
+
console.log(`Workspace root: ${config.workspaceRoot ?? DEFAULT_WORKSPACE_ROOT}`);
|
|
156
|
+
}
|
|
157
|
+
console.log(`Network mode: ${config.networkMode}`);
|
|
158
|
+
console.log(`Allow localhost binding: ${config.allowLocalBinding ? "yes" : "no"}`);
|
|
159
|
+
}
|
|
160
|
+
async function handleSandboxDisable() {
|
|
161
|
+
await persistence.updateSettings((settings) => ({
|
|
162
|
+
...settings,
|
|
163
|
+
sandboxConfig: persistence.SandboxConfigSchema.parse({
|
|
164
|
+
...settings.sandboxConfig ?? {},
|
|
165
|
+
enabled: false
|
|
166
|
+
})
|
|
167
|
+
}));
|
|
168
|
+
console.log(chalk.green("Sandbox disabled."));
|
|
169
|
+
}
|
|
170
|
+
function handleSandboxHelp() {
|
|
171
|
+
console.log(`
|
|
172
|
+
${chalk.bold("very-happy sandbox")} - Sandbox management
|
|
173
|
+
|
|
174
|
+
${chalk.bold("Usage:")}
|
|
175
|
+
very-happy sandbox configure Configure sandbox settings interactively
|
|
176
|
+
very-happy sandbox status Show current sandbox configuration
|
|
177
|
+
very-happy sandbox disable Disable sandboxing
|
|
178
|
+
very-happy sandbox help Show this help
|
|
179
|
+
`);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
exports.detectWorkspaceRootSuggestions = detectWorkspaceRootSuggestions;
|
|
183
|
+
exports.handleSandboxCommand = handleSandboxCommand;
|
|
184
|
+
exports.handleSandboxConfigure = handleSandboxConfigure;
|
|
185
|
+
exports.handleSandboxDisable = handleSandboxDisable;
|
|
186
|
+
exports.handleSandboxHelp = handleSandboxHelp;
|
|
187
|
+
exports.handleSandboxStatus = handleSandboxStatus;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { homedir } from 'node:os';
|
|
5
|
+
import { SandboxConfigSchema, updateSettings, readSettings } from './persistence-oET5n61f.mjs';
|
|
6
|
+
import 'node:fs/promises';
|
|
7
|
+
import './configuration-DoWFJUPm.mjs';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import './package-uOg9SCKi.mjs';
|
|
10
|
+
import 'zod';
|
|
11
|
+
import './authRelay-DSAvg1uv.mjs';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'tweetnacl';
|
|
14
|
+
import './logger-fXoNzNuB.mjs';
|
|
15
|
+
import 'node:util';
|
|
16
|
+
|
|
17
|
+
const DEFAULT_WORKSPACE_ROOT = "~/Workspace";
|
|
18
|
+
const DEFAULT_DENY_READ_PATHS = ["~/.ssh", "~/.aws", "~/.gnupg"];
|
|
19
|
+
function workspaceCandidatesForPlatform(platform) {
|
|
20
|
+
if (platform === "darwin") {
|
|
21
|
+
return ["~/Developer", "~/Develop", "~/Workspace"];
|
|
22
|
+
}
|
|
23
|
+
if (platform === "linux") {
|
|
24
|
+
return ["~/Workspace", "~/Developer", "~/Develop"];
|
|
25
|
+
}
|
|
26
|
+
return ["~/Developer", "~/Develop", "~/Workspace"];
|
|
27
|
+
}
|
|
28
|
+
function detectWorkspaceRootSuggestions(options) {
|
|
29
|
+
const platform = options?.platform ?? process.platform;
|
|
30
|
+
const home = options?.home ?? homedir();
|
|
31
|
+
const pathExists = options?.pathExists ?? existsSync;
|
|
32
|
+
const candidates = workspaceCandidatesForPlatform(platform);
|
|
33
|
+
const existing = candidates.filter((candidate) => {
|
|
34
|
+
const absolutePath = candidate.replace(/^~(?=\/|$)/, home);
|
|
35
|
+
return pathExists(absolutePath);
|
|
36
|
+
});
|
|
37
|
+
if (existing.length > 0) {
|
|
38
|
+
return existing;
|
|
39
|
+
}
|
|
40
|
+
return [candidates[0] ?? DEFAULT_WORKSPACE_ROOT];
|
|
41
|
+
}
|
|
42
|
+
async function handleSandboxCommand(args) {
|
|
43
|
+
const subcommand = args[0];
|
|
44
|
+
if (!subcommand || subcommand === "help" || subcommand === "--help" || subcommand === "-h") {
|
|
45
|
+
handleSandboxHelp();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
switch (subcommand) {
|
|
49
|
+
case "configure":
|
|
50
|
+
await handleSandboxConfigure();
|
|
51
|
+
break;
|
|
52
|
+
case "status":
|
|
53
|
+
await handleSandboxStatus();
|
|
54
|
+
break;
|
|
55
|
+
case "disable":
|
|
56
|
+
await handleSandboxDisable();
|
|
57
|
+
break;
|
|
58
|
+
default:
|
|
59
|
+
console.error(chalk.red(`Unknown sandbox subcommand: ${subcommand}`));
|
|
60
|
+
handleSandboxHelp();
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function handleSandboxConfigure() {
|
|
65
|
+
const workspaceRootSuggestions = detectWorkspaceRootSuggestions();
|
|
66
|
+
const workspaceRootDefault = workspaceRootSuggestions[0] ?? DEFAULT_WORKSPACE_ROOT;
|
|
67
|
+
const answers = await inquirer.prompt([
|
|
68
|
+
{
|
|
69
|
+
type: "list",
|
|
70
|
+
name: "scopeMode",
|
|
71
|
+
message: "How should file access be scoped?",
|
|
72
|
+
default: "workspace",
|
|
73
|
+
choices: [
|
|
74
|
+
{ name: "workspace - Full workspace root directory", value: "workspace" },
|
|
75
|
+
{ name: "per-project - Only current project directory", value: "project" }
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: "list",
|
|
80
|
+
name: "workspaceRoot",
|
|
81
|
+
message: "Pick your workspace root directory",
|
|
82
|
+
when: (currentAnswers) => currentAnswers.scopeMode === "workspace",
|
|
83
|
+
default: workspaceRootDefault,
|
|
84
|
+
choices: workspaceRootSuggestions.map((pathValue) => ({
|
|
85
|
+
name: `${pathValue}${existsSync(pathValue.replace(/^~(?=\/|$)/, homedir())) ? "" : " (suggested)"}`,
|
|
86
|
+
value: pathValue
|
|
87
|
+
}))
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "list",
|
|
91
|
+
name: "networkMode",
|
|
92
|
+
message: "How should network access be handled?",
|
|
93
|
+
default: "allowed",
|
|
94
|
+
choices: [
|
|
95
|
+
{ name: "allowed - Allow all network access (default)", value: "allowed" },
|
|
96
|
+
{ name: "blocked - Block all network access (most secure)", value: "blocked" }
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: "confirm",
|
|
101
|
+
name: "allowLocalBinding",
|
|
102
|
+
message: "Allow binding to localhost ports? (for dev servers)",
|
|
103
|
+
default: true
|
|
104
|
+
}
|
|
105
|
+
]);
|
|
106
|
+
const scopeMode = answers.scopeMode;
|
|
107
|
+
const sandboxConfig = SandboxConfigSchema.parse({
|
|
108
|
+
enabled: true,
|
|
109
|
+
workspaceRoot: scopeMode === "workspace" ? answers.workspaceRoot || workspaceRootDefault : void 0,
|
|
110
|
+
sessionIsolation: scopeMode === "workspace" ? "workspace" : "strict",
|
|
111
|
+
customWritePaths: [],
|
|
112
|
+
denyReadPaths: DEFAULT_DENY_READ_PATHS,
|
|
113
|
+
extraWritePaths: ["/tmp"],
|
|
114
|
+
denyWritePaths: [".env"],
|
|
115
|
+
networkMode: answers.networkMode,
|
|
116
|
+
allowedDomains: [],
|
|
117
|
+
deniedDomains: [],
|
|
118
|
+
allowLocalBinding: Boolean(answers.allowLocalBinding)
|
|
119
|
+
});
|
|
120
|
+
console.log(chalk.bold("\nSandbox configuration summary:"));
|
|
121
|
+
console.log(JSON.stringify(sandboxConfig, null, 2));
|
|
122
|
+
const { confirmSave } = await inquirer.prompt([
|
|
123
|
+
{
|
|
124
|
+
type: "confirm",
|
|
125
|
+
name: "confirmSave",
|
|
126
|
+
message: "Save and enable this sandbox configuration?",
|
|
127
|
+
default: true
|
|
128
|
+
}
|
|
129
|
+
]);
|
|
130
|
+
if (!confirmSave) {
|
|
131
|
+
console.log(chalk.yellow("Sandbox configuration cancelled."));
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
await updateSettings((settings) => ({
|
|
135
|
+
...settings,
|
|
136
|
+
sandboxConfig
|
|
137
|
+
}));
|
|
138
|
+
console.log(chalk.green("Sandbox configuration saved and enabled."));
|
|
139
|
+
console.log(chalk.gray("Use --no-sandbox to bypass sandboxing for a single session."));
|
|
140
|
+
}
|
|
141
|
+
async function handleSandboxStatus() {
|
|
142
|
+
const settings = await readSettings();
|
|
143
|
+
const config = settings.sandboxConfig;
|
|
144
|
+
if (!config) {
|
|
145
|
+
console.log("Sandbox is not configured. Run `very-happy sandbox configure`.");
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
console.log(chalk.bold("Sandbox status"));
|
|
149
|
+
console.log(`Enabled: ${config.enabled ? "yes" : "no"}`);
|
|
150
|
+
const scope = config.sessionIsolation === "workspace" ? "workspace" : "per-project";
|
|
151
|
+
console.log(`Scope: ${scope}`);
|
|
152
|
+
if (scope === "workspace") {
|
|
153
|
+
console.log(`Workspace root: ${config.workspaceRoot ?? DEFAULT_WORKSPACE_ROOT}`);
|
|
154
|
+
}
|
|
155
|
+
console.log(`Network mode: ${config.networkMode}`);
|
|
156
|
+
console.log(`Allow localhost binding: ${config.allowLocalBinding ? "yes" : "no"}`);
|
|
157
|
+
}
|
|
158
|
+
async function handleSandboxDisable() {
|
|
159
|
+
await updateSettings((settings) => ({
|
|
160
|
+
...settings,
|
|
161
|
+
sandboxConfig: SandboxConfigSchema.parse({
|
|
162
|
+
...settings.sandboxConfig ?? {},
|
|
163
|
+
enabled: false
|
|
164
|
+
})
|
|
165
|
+
}));
|
|
166
|
+
console.log(chalk.green("Sandbox disabled."));
|
|
167
|
+
}
|
|
168
|
+
function handleSandboxHelp() {
|
|
169
|
+
console.log(`
|
|
170
|
+
${chalk.bold("very-happy sandbox")} - Sandbox management
|
|
171
|
+
|
|
172
|
+
${chalk.bold("Usage:")}
|
|
173
|
+
very-happy sandbox configure Configure sandbox settings interactively
|
|
174
|
+
very-happy sandbox status Show current sandbox configuration
|
|
175
|
+
very-happy sandbox disable Disable sandboxing
|
|
176
|
+
very-happy sandbox help Show this help
|
|
177
|
+
`);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export { detectWorkspaceRootSuggestions, handleSandboxCommand, handleSandboxConfigure, handleSandboxDisable, handleSandboxHelp, handleSandboxStatus };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _package = require('./package-Cl5BEP5x.cjs');
|
|
4
|
+
|
|
5
|
+
const LAZY_MODULES = [
|
|
6
|
+
// Entry
|
|
7
|
+
["main", () => Promise.resolve().then(function () { return require('./main-CLaX-t-b.cjs'); })],
|
|
8
|
+
["selfCheck", () => Promise.resolve().then(function () { return selfCheck; })],
|
|
9
|
+
// Subcommands (main.ts)
|
|
10
|
+
["api/api", () => Promise.resolve().then(function () { return require('./api-B2vLMS-z.cjs'); }).then(function (n) { return n.api; })],
|
|
11
|
+
["claude/claudeCliPath", () => Promise.resolve().then(function () { return require('./claudeCliPath-U4HHmV4r.cjs'); })],
|
|
12
|
+
["claude/runClaude", () => Promise.resolve().then(function () { return require('./runClaude-BX6ixjtW.cjs'); })],
|
|
13
|
+
["commands/agentHome", () => Promise.resolve().then(function () { return require('./agentHome-DvNnGphb.cjs'); })],
|
|
14
|
+
["commands/auth", () => Promise.resolve().then(function () { return require('./auth-x4CEoysH.cjs'); })],
|
|
15
|
+
["commands/auto", () => Promise.resolve().then(function () { return require('./auto-BDXDUnjB.cjs'); })],
|
|
16
|
+
["commands/codexCommand", () => Promise.resolve().then(function () { return require('./codexCommand-C7H0NpBe.cjs'); })],
|
|
17
|
+
["commands/connect", () => Promise.resolve().then(function () { return require('./connect-yEvjdRvx.cjs'); })],
|
|
18
|
+
["commands/installPiTools", () => Promise.resolve().then(function () { return require('./installPiTools-BKnXjrVu.cjs'); })],
|
|
19
|
+
["commands/installTerminalHooks", () => Promise.resolve().then(function () { return require('./installTerminalHooks-BQZbvxsZ.cjs'); })],
|
|
20
|
+
["commands/mcp", () => Promise.resolve().then(function () { return require('./mcp-GBfE70nk.cjs'); })],
|
|
21
|
+
["commands/piTerminal", () => Promise.resolve().then(function () { return require('./piTerminal-CagmEoez.cjs'); })],
|
|
22
|
+
["commands/sandbox", () => Promise.resolve().then(function () { return require('./sandbox-C4gXLP1p.cjs'); })],
|
|
23
|
+
["commands/send", () => Promise.resolve().then(function () { return require('./send-DY9Nr-x4.cjs'); })],
|
|
24
|
+
["commands/server", () => Promise.resolve().then(function () { return require('./server-II51Mimf.cjs'); })],
|
|
25
|
+
["commands/sessions", () => Promise.resolve().then(function () { return require('./sessions-DGs6ALNo.cjs'); })],
|
|
26
|
+
["commands/spawn", () => Promise.resolve().then(function () { return require('./spawn-CXTH7qg1.cjs'); })],
|
|
27
|
+
["commands/teams", () => Promise.resolve().then(function () { return require('./teams-BsvpOBfn.cjs'); })],
|
|
28
|
+
["commands/todo", () => Promise.resolve().then(function () { return require('./todo-B-KB7oAB.cjs'); })],
|
|
29
|
+
["daemon/doctor", () => Promise.resolve().then(function () { return require('./doctor-u46qYYKX.cjs'); })],
|
|
30
|
+
["daemon/install", () => Promise.resolve().then(function () { return require('./install-Bu85vlHD.cjs'); })],
|
|
31
|
+
["daemon/run", () => Promise.resolve().then(function () { return require('./run-D5xAEWSB.cjs'); })],
|
|
32
|
+
["daemon/uninstall", () => Promise.resolve().then(function () { return require('./uninstall-fvA5aWpU.cjs'); })],
|
|
33
|
+
["resume/handleResumeCommand", () => Promise.resolve().then(function () { return require('./handleResumeCommand-DnVmy7a3.cjs'); })],
|
|
34
|
+
["ui/doctor", () => Promise.resolve().then(function () { return require('./doctor-hVNnSZJn.cjs'); }).then(function (n) { return n.doctor; })],
|
|
35
|
+
["agent/acp", () => Promise.resolve().then(function () { return require('./index-LIn6nCcq.cjs'); })],
|
|
36
|
+
["gemini/runGemini", () => Promise.resolve().then(function () { return require('./runGemini-CSMPkt0p.cjs'); })],
|
|
37
|
+
["gemini/utils/config", () => Promise.resolve().then(function () { return require('./config-CYpL1Ahd.cjs'); })],
|
|
38
|
+
["openclaw/runOpenClaw", () => Promise.resolve().then(function () { return require('./runOpenClaw-YBwua4Rf.cjs'); })],
|
|
39
|
+
["persistence", () => Promise.resolve().then(function () { return require('./persistence-CBNMzSa8.cjs'); })],
|
|
40
|
+
// Deferred halves of the runners and clients
|
|
41
|
+
["api/apiMachine", () => Promise.resolve().then(function () { return require('./apiMachine-gFA54X7y.cjs'); })],
|
|
42
|
+
["claude/runClaudeDeps", () => Promise.resolve().then(function () { return require('./runClaudeDeps-Bp20MScE.cjs'); })],
|
|
43
|
+
["claude/claudeLocal", () => Promise.resolve().then(function () { return require('./claudeLocal-BDuGFnjJ.cjs'); })],
|
|
44
|
+
["claude/claudeLocalLauncher", () => Promise.resolve().then(function () { return require('./claudeLocalLauncher-Bd5I2-j6.cjs'); })],
|
|
45
|
+
["claude/sdk", () => Promise.resolve().then(function () { return require('./index-D3kI0hDR.cjs'); })],
|
|
46
|
+
["assistant/bootstrap", () => Promise.resolve().then(function () { return require('./bootstrap-CkgIq8N3.cjs'); })],
|
|
47
|
+
["agentHome", () => Promise.resolve().then(function () { return require('./index-Pf2cV9cn.cjs'); })],
|
|
48
|
+
["ui/ink/RemoteModeDisplay", () => Promise.resolve().then(function () { return require('./RemoteModeDisplay-NC1gPHtj.cjs'); })],
|
|
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: ${_package.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
|
+
exports.runSelfCheck = runSelfCheck;
|
|
87
|
+
exports.selfCheckMain = selfCheckMain;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { p as packageJson } from './package-uOg9SCKi.mjs';
|
|
2
|
+
|
|
3
|
+
const LAZY_MODULES = [
|
|
4
|
+
// Entry
|
|
5
|
+
["main", () => import('./main-BktM4A1K.mjs')],
|
|
6
|
+
["selfCheck", () => Promise.resolve().then(function () { return selfCheck; })],
|
|
7
|
+
// Subcommands (main.ts)
|
|
8
|
+
["api/api", () => import('./api-SffjRQ1b.mjs').then(function (n) { return n.b; })],
|
|
9
|
+
["claude/claudeCliPath", () => import('./claudeCliPath-BqkaH2oR.mjs')],
|
|
10
|
+
["claude/runClaude", () => import('./runClaude-BgN6xo05.mjs')],
|
|
11
|
+
["commands/agentHome", () => import('./agentHome-Ck1i1TQB.mjs')],
|
|
12
|
+
["commands/auth", () => import('./auth-DdyVZSo6.mjs')],
|
|
13
|
+
["commands/auto", () => import('./auto-CXLlRi3a.mjs')],
|
|
14
|
+
["commands/codexCommand", () => import('./codexCommand-CJ82bl3l.mjs')],
|
|
15
|
+
["commands/connect", () => import('./connect-hgcNjyAB.mjs')],
|
|
16
|
+
["commands/installPiTools", () => import('./installPiTools-B_CdM5_2.mjs')],
|
|
17
|
+
["commands/installTerminalHooks", () => import('./installTerminalHooks-By7gBMEF.mjs')],
|
|
18
|
+
["commands/mcp", () => import('./mcp-CeUd9KDr.mjs')],
|
|
19
|
+
["commands/piTerminal", () => import('./piTerminal-Bap3R8Re.mjs')],
|
|
20
|
+
["commands/sandbox", () => import('./sandbox-CNkwOtHI.mjs')],
|
|
21
|
+
["commands/send", () => import('./send-CGHcKZ-w.mjs')],
|
|
22
|
+
["commands/server", () => import('./server-m2b5pamZ.mjs')],
|
|
23
|
+
["commands/sessions", () => import('./sessions-DnvmWUel.mjs')],
|
|
24
|
+
["commands/spawn", () => import('./spawn-DNYSvFtC.mjs')],
|
|
25
|
+
["commands/teams", () => import('./teams-BOC6nIPL.mjs')],
|
|
26
|
+
["commands/todo", () => import('./todo-C5KBVbUw.mjs')],
|
|
27
|
+
["daemon/doctor", () => import('./doctor-BPkYWSuq.mjs')],
|
|
28
|
+
["daemon/install", () => import('./install-ClUUl3yp.mjs')],
|
|
29
|
+
["daemon/run", () => import('./run-2l5vSt2h.mjs')],
|
|
30
|
+
["daemon/uninstall", () => import('./uninstall-B1WLtC1d.mjs')],
|
|
31
|
+
["resume/handleResumeCommand", () => import('./handleResumeCommand-BiTPK0qd.mjs')],
|
|
32
|
+
["ui/doctor", () => import('./doctor-BeUuQXFs.mjs').then(function (n) { return n.d; })],
|
|
33
|
+
["agent/acp", () => import('./index-CAFwetLk.mjs')],
|
|
34
|
+
["gemini/runGemini", () => import('./runGemini-Cc2jq-uh.mjs')],
|
|
35
|
+
["gemini/utils/config", () => import('./config-BglnktIo.mjs')],
|
|
36
|
+
["openclaw/runOpenClaw", () => import('./runOpenClaw-CIlCwdW2.mjs')],
|
|
37
|
+
["persistence", () => import('./persistence-oET5n61f.mjs')],
|
|
38
|
+
// Deferred halves of the runners and clients
|
|
39
|
+
["api/apiMachine", () => import('./apiMachine-BpW9t8MO.mjs')],
|
|
40
|
+
["claude/runClaudeDeps", () => import('./runClaudeDeps-COBBhD9o.mjs')],
|
|
41
|
+
["claude/claudeLocal", () => import('./claudeLocal-CQa8qnwq.mjs')],
|
|
42
|
+
["claude/claudeLocalLauncher", () => import('./claudeLocalLauncher-CDqQI9ak.mjs')],
|
|
43
|
+
["claude/sdk", () => import('./index-B6UGRQ7h.mjs')],
|
|
44
|
+
["assistant/bootstrap", () => import('./bootstrap-BNQq05jR.mjs')],
|
|
45
|
+
["agentHome", () => import('./index-SPGPenK5.mjs')],
|
|
46
|
+
["ui/ink/RemoteModeDisplay", () => import('./RemoteModeDisplay-D-HewyXg.mjs')],
|
|
47
|
+
// External packages imported on demand
|
|
48
|
+
["expo-server-sdk", () => import('expo-server-sdk')],
|
|
49
|
+
["ink", () => import('ink')],
|
|
50
|
+
["react", () => import('react')]
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
async function runSelfCheck(modules = LAZY_MODULES) {
|
|
54
|
+
const failures = [];
|
|
55
|
+
for (const [name, load] of modules) {
|
|
56
|
+
try {
|
|
57
|
+
await load();
|
|
58
|
+
} catch (error) {
|
|
59
|
+
failures.push({ name, error: error instanceof Error ? error.message : String(error) });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return failures;
|
|
63
|
+
}
|
|
64
|
+
async function selfCheckMain(opts = {}) {
|
|
65
|
+
const started = Date.now();
|
|
66
|
+
const failures = await runSelfCheck();
|
|
67
|
+
if (failures.length > 0) {
|
|
68
|
+
for (const failure of failures) {
|
|
69
|
+
console.error(`very-happy: failed to load ${failure.name}: ${failure.error}`);
|
|
70
|
+
}
|
|
71
|
+
return 1;
|
|
72
|
+
}
|
|
73
|
+
if (opts.verbose) console.log(`self-check: ${LAZY_MODULES.length} modules loaded in ${Date.now() - started}ms`);
|
|
74
|
+
console.log(`very-happy version: ${packageJson.version}`);
|
|
75
|
+
return 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var selfCheck = /*#__PURE__*/Object.freeze({
|
|
79
|
+
__proto__: null,
|
|
80
|
+
runSelfCheck: runSelfCheck,
|
|
81
|
+
selfCheckMain: selfCheckMain
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
export { runSelfCheck, selfCheckMain };
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { readFileSync } from 'node:fs';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import '
|
|
7
|
-
import '@paralleldrive/cuid2';
|
|
4
|
+
import { readPersistedSessions } from './persistence-oET5n61f.mjs';
|
|
5
|
+
import { s as sessionWebUrl } from './sessionOps-C_f1wKOr.mjs';
|
|
6
|
+
import { d as deliverToSession, s as sendRemoteMessage } from './remoteSessionClient-CO7qOjR0.mjs';
|
|
8
7
|
import 'node:fs/promises';
|
|
8
|
+
import './configuration-DoWFJUPm.mjs';
|
|
9
|
+
import 'node:os';
|
|
10
|
+
import './package-uOg9SCKi.mjs';
|
|
11
|
+
import 'zod';
|
|
12
|
+
import './authRelay-DSAvg1uv.mjs';
|
|
9
13
|
import 'node:crypto';
|
|
10
14
|
import 'tweetnacl';
|
|
15
|
+
import './logger-fXoNzNuB.mjs';
|
|
11
16
|
import 'node:util';
|
|
12
|
-
import 'node:os';
|
|
13
17
|
import 'axios';
|
|
18
|
+
import './controlClient-DjoKTtgK.mjs';
|
|
19
|
+
import './time-BZNdNiIV.mjs';
|
|
14
20
|
import 'socket.io-client';
|
|
21
|
+
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
15
22
|
|
|
16
23
|
const EXIT_SESSION_NOT_LIVE = 3;
|
|
17
24
|
const MACHINE_ID_RE = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
@@ -3,17 +3,24 @@
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
4
|
var node_fs = require('node:fs');
|
|
5
5
|
var path = require('node:path');
|
|
6
|
-
var persistence = require('./
|
|
7
|
-
var
|
|
8
|
-
require('
|
|
9
|
-
require('@paralleldrive/cuid2');
|
|
6
|
+
var persistence = require('./persistence-CBNMzSa8.cjs');
|
|
7
|
+
var sessionOps = require('./sessionOps-DJdExmBy.cjs');
|
|
8
|
+
var remoteSessionClient = require('./remoteSessionClient-BNx78NLb.cjs');
|
|
10
9
|
require('node:fs/promises');
|
|
10
|
+
require('./configuration-v9f8LM9T.cjs');
|
|
11
|
+
require('node:os');
|
|
12
|
+
require('./package-Cl5BEP5x.cjs');
|
|
13
|
+
require('zod');
|
|
14
|
+
require('./authRelay-BdYkC1Po.cjs');
|
|
11
15
|
require('node:crypto');
|
|
12
16
|
require('tweetnacl');
|
|
17
|
+
require('./logger-Bc8-u1w0.cjs');
|
|
13
18
|
require('node:util');
|
|
14
|
-
require('node:os');
|
|
15
19
|
require('axios');
|
|
20
|
+
require('./controlClient-fEHE85bH.cjs');
|
|
21
|
+
require('./time-CNRE4ChD.cjs');
|
|
16
22
|
require('socket.io-client');
|
|
23
|
+
require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
17
24
|
|
|
18
25
|
const EXIT_SESSION_NOT_LIVE = 3;
|
|
19
26
|
const MACHINE_ID_RE = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
@@ -113,7 +120,7 @@ function fail(options, sessionId, message) {
|
|
|
113
120
|
const payload = { delivered: false, error: message };
|
|
114
121
|
if (sessionId) {
|
|
115
122
|
payload.sessionId = sessionId;
|
|
116
|
-
payload.url =
|
|
123
|
+
payload.url = sessionOps.sessionWebUrl(sessionId);
|
|
117
124
|
}
|
|
118
125
|
console.log(JSON.stringify(payload));
|
|
119
126
|
} else {
|
|
@@ -162,16 +169,16 @@ async function handleSendCommand(args) {
|
|
|
162
169
|
let machine;
|
|
163
170
|
try {
|
|
164
171
|
if (persisted) {
|
|
165
|
-
result = await
|
|
172
|
+
result = await remoteSessionClient.deliverToSession(sessionId, persisted, prompt, "cli-send", { resume: options.resume, ...model });
|
|
166
173
|
} else {
|
|
167
|
-
const remote = await
|
|
174
|
+
const remote = await remoteSessionClient.sendRemoteMessage(sessionId, prompt, { resume: options.resume, ...model, ...options.machine ? { machineId: options.machine } : {} });
|
|
168
175
|
result = remote;
|
|
169
176
|
machine = remote.machine;
|
|
170
177
|
}
|
|
171
178
|
} catch (error) {
|
|
172
179
|
fail(options, sessionId, `Failed to send message: ${error instanceof Error ? error.message : String(error)}`);
|
|
173
180
|
}
|
|
174
|
-
const url =
|
|
181
|
+
const url = sessionOps.sessionWebUrl(sessionId);
|
|
175
182
|
const where = machine ? ` on ${machine.host}` : "";
|
|
176
183
|
if (!result.delivered) {
|
|
177
184
|
if (options.json) {
|