@hyperwindmill/caretaker-cli 0.14.0 → 0.14.2
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/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAgBA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqF1D"}
|
package/dist/cli/index.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
// `caretaker` → render the Ink TUI (default)
|
|
3
3
|
// `caretaker run [prompt...]` → headless one-shot via the harness
|
|
4
4
|
// `caretaker --help|-h` → commander's help
|
|
5
|
+
// `caretaker --version|-v` → prints the CLI version (from package.json)
|
|
5
6
|
//
|
|
6
7
|
// More subcommands (web, exec, session, agent, plugin, …) plug in
|
|
7
8
|
// alongside `run` via `program.command(…)`.
|
|
9
|
+
import { readFileSync } from 'node:fs';
|
|
8
10
|
import { Command } from 'commander';
|
|
9
11
|
import { createElement } from 'react';
|
|
10
12
|
import { render } from 'ink';
|
|
@@ -12,7 +14,7 @@ import App from '../tui/app.js';
|
|
|
12
14
|
import { runCommand } from './run.js';
|
|
13
15
|
export async function runCli(argv) {
|
|
14
16
|
// No subcommand and no flags → TUI. Anything else flows through commander
|
|
15
|
-
// so `--help`, `--version` and unknown-command diagnostics behave normally.
|
|
17
|
+
// so `--help`, `--version|-v` and unknown-command diagnostics behave normally.
|
|
16
18
|
if (argv.length <= 2) {
|
|
17
19
|
// Wait for Ink to unmount (ESC / Quit call useApp().exit()), then force the
|
|
18
20
|
// process down. Without this the event loop stays alive on background boot
|
|
@@ -22,10 +24,24 @@ export async function runCli(argv) {
|
|
|
22
24
|
await waitUntilExit();
|
|
23
25
|
process.exit(0);
|
|
24
26
|
}
|
|
27
|
+
// Read the version from package.json at runtime (relative to this module, not
|
|
28
|
+
// the CWD) so it tracks the single Changesets-managed version without a static
|
|
29
|
+
// JSON import that would break tsc's rootDir constraint. Guarded: this runs for
|
|
30
|
+
// every subcommand, and package.json is not always co-located with dist/ (e.g.
|
|
31
|
+
// the Electron desktop bundle ships dist/ only) — an unreadable file must never
|
|
32
|
+
// take the whole process down, only degrade the reported version.
|
|
33
|
+
let version = '0.0.0';
|
|
34
|
+
try {
|
|
35
|
+
version = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8')).version;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// ponytail: fall back to a placeholder version if package.json isn't bundled
|
|
39
|
+
}
|
|
25
40
|
const program = new Command();
|
|
26
41
|
program
|
|
27
42
|
.name('caretaker-cli')
|
|
28
|
-
.description('Caretaker — TUI agent harness with subcommands for scripting.')
|
|
43
|
+
.description('Caretaker — TUI agent harness with subcommands for scripting.')
|
|
44
|
+
.version(version, '-v, --version', 'output the CLI version and exit');
|
|
29
45
|
program
|
|
30
46
|
.command('run [prompt...]')
|
|
31
47
|
.description('Run an agent headlessly with a one-shot prompt.')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude_code_runner.d.ts","sourceRoot":"","sources":["../../src/harness/claude_code_runner.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAM3E,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"claude_code_runner.d.ts","sourceRoot":"","sources":["../../src/harness/claude_code_runner.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAM3E,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,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AAgB,iCAAiC,CAC/C,YAAY,GAAE,MAA4D,GACzE,MAAM,GAAG,IAAI,CAQf;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;kFAC8E;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,CAe5D;AAED,uEAAuE;AACvE,wBAAgB,oBAAoB,CAAC,CAAC,EAAE;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC,GAAG,mBAAmB,CAoBtB;AAsMD,wBAAsB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,GAAE,YAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CAmI/F"}
|
|
@@ -15,6 +15,7 @@ import { readSession, updateClaudeSessionId, assistantMessage, toolMessage, } fr
|
|
|
15
15
|
import { loadMcpServers } from '../store/json.js';
|
|
16
16
|
import { resolvedServerRuntime } from '../mcp/client.js';
|
|
17
17
|
import { DOCKER_BASH_HOOK_SCRIPT, dockerClaudeSettings } from '../lib/docker.js';
|
|
18
|
+
import { mergeShellEnv } from './tools/builtin/shell-env.js';
|
|
18
19
|
let spawnImpl = nodeSpawn;
|
|
19
20
|
export function __setSpawn(fn) {
|
|
20
21
|
spawnImpl = fn;
|
|
@@ -158,7 +159,14 @@ async function attemptRun(command, args, prompt, workingDir, signal, cb) {
|
|
|
158
159
|
};
|
|
159
160
|
const child = spawnImpl(command, args, {
|
|
160
161
|
cwd: workingDir,
|
|
161
|
-
|
|
162
|
+
// Merge the probed interactive-shell PATH + version-manager vars (nvm/fnm/
|
|
163
|
+
// volta) into the env so the spawned `claude` — and any stdio MCP server it
|
|
164
|
+
// spawns in turn (e.g. `caretaker-cli mcp`) — can find `node`/`claude` even
|
|
165
|
+
// when caretaker itself was launched from a non-interactive shell. Uses
|
|
166
|
+
// mergeShellEnv (not commandEnv) on purpose: PATH is fixed WITHOUT scrubbing
|
|
167
|
+
// secrets, so env-based auth (ANTHROPIC_API_KEY, CLAUDE_CODE_*) survives.
|
|
168
|
+
// Degrades to process.env unchanged if the boot-time probe hasn't run.
|
|
169
|
+
env: mergeShellEnv(process.env),
|
|
162
170
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
163
171
|
});
|
|
164
172
|
const onAbort = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperwindmill/caretaker-cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Caretaker — in-process agent harness, TUI, file-based state.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"typescript": "^5.9.3",
|
|
84
84
|
"typescript-eslint": "^8.59.2",
|
|
85
85
|
"zod": "^4.4.3",
|
|
86
|
-
"
|
|
87
|
-
"
|
|
86
|
+
"webview-ui": "0.14.2",
|
|
87
|
+
"caretaker-types": "0.14.2"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@hono/node-server": "^2.0.4",
|