@clipboard-health/groundcrew 4.48.0 → 4.48.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/clearance-allow-hosts +1 -0
- package/crew.config.example.ts +2 -2
- package/dist/commands/doctor.js +0 -25
- package/dist/commands/openWorkspace.d.ts.map +1 -1
- package/dist/commands/openWorkspace.js +14 -17
- package/dist/commands/resumeWorkspace.d.ts.map +1 -1
- package/dist/commands/resumeWorkspace.js +7 -15
- package/dist/commands/setupWorkspace.d.ts.map +1 -1
- package/dist/commands/setupWorkspace.js +16 -18
- package/dist/lib/agentLaunch.d.ts +13 -11
- package/dist/lib/agentLaunch.d.ts.map +1 -1
- package/dist/lib/agentLaunch.js +102 -52
- package/dist/lib/cmuxAgentHookInstall.d.ts +17 -0
- package/dist/lib/cmuxAgentHookInstall.d.ts.map +1 -0
- package/dist/lib/cmuxAgentHookInstall.js +42 -0
- package/dist/lib/codexConfigRelocation.d.ts +60 -0
- package/dist/lib/codexConfigRelocation.d.ts.map +1 -0
- package/dist/lib/codexConfigRelocation.js +70 -0
- package/dist/lib/commandRunner.d.ts +9 -0
- package/dist/lib/commandRunner.d.ts.map +1 -1
- package/dist/lib/commandRunner.js +1 -0
- package/dist/lib/config.d.ts +8 -12
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +1 -2
- package/dist/lib/gitCommonDir.d.ts +7 -0
- package/dist/lib/gitCommonDir.d.ts.map +1 -0
- package/dist/lib/gitCommonDir.js +15 -0
- package/dist/lib/host.d.ts +0 -14
- package/dist/lib/host.d.ts.map +1 -1
- package/dist/lib/host.js +1 -8
- package/dist/lib/launchCommand.d.ts +32 -52
- package/dist/lib/launchCommand.d.ts.map +1 -1
- package/dist/lib/launchCommand.js +96 -187
- package/dist/lib/localRunner.d.ts +4 -5
- package/dist/lib/localRunner.d.ts.map +1 -1
- package/dist/lib/localRunner.js +4 -23
- package/docs/configuration.md +3 -3
- package/docs/runners.md +7 -50
- package/docs/setup-hooks.md +1 -1
- package/docs/spec/e2e-scenario-catalog.md +1 -1
- package/docs/spec/v2-design.md +7 -7
- package/docs/task-sources.md +3 -3
- package/package.json +2 -5
- package/static/demo.tape +0 -2
- package/static/render-demo.sh +0 -1
- package/dist/lib/clearanceHosts.d.ts +0 -31
- package/dist/lib/clearanceHosts.d.ts.map +0 -1
- package/dist/lib/clearanceHosts.js +0 -96
- package/dist/lib/srtLaunch.d.ts +0 -61
- package/dist/lib/srtLaunch.d.ts.map +0 -1
- package/dist/lib/srtLaunch.js +0 -107
- package/dist/lib/srtPolicy.d.ts +0 -118
- package/dist/lib/srtPolicy.d.ts.map +0 -1
- package/dist/lib/srtPolicy.js +0 -371
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How an agent that cannot run with a read-only config home is pointed at a
|
|
3
|
+
* relocated, per-launch writable home instead. The safehouse launch stages a
|
|
4
|
+
* temp dir, seeds it with the minimal files the agent needs to authenticate +
|
|
5
|
+
* keep its config, exports `configDirEnv` to that dir, and grants it write.
|
|
6
|
+
* Credential files that Codex refreshes are copied back by the host after the
|
|
7
|
+
* agent exits, without granting the sandbox the whole real home.
|
|
8
|
+
*
|
|
9
|
+
* Empirically validated on macOS: codex hard-fails to launch
|
|
10
|
+
* with a read-only `~/.codex` ("failed to initialize in-process app-server
|
|
11
|
+
* client") and authenticates from a file (`auth.json`), so relocating
|
|
12
|
+
* `CODEX_HOME` + seeding `auth.json`/`config.toml` both unblocks it and closes
|
|
13
|
+
* persistence.
|
|
14
|
+
*/
|
|
15
|
+
export interface AgentConfigRelocation {
|
|
16
|
+
/** Env var that points the agent at a relocated config home. */
|
|
17
|
+
configDirEnv: string;
|
|
18
|
+
/** Home-relative dir the seed files come from (the agent's real home). */
|
|
19
|
+
sourceHomeRelativeDir: string;
|
|
20
|
+
/** Files (relative to `sourceHomeRelativeDir`) seeded into the relocated home. */
|
|
21
|
+
seedFiles: readonly string[];
|
|
22
|
+
/** Seed files whose writes must persist back to the source store. */
|
|
23
|
+
persistedFiles: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Return the config-relocation spec for an agent, or `undefined` when the
|
|
27
|
+
* agent has no registered relocation (claude, unknown agents) — the caller
|
|
28
|
+
* then runs that agent against its real home.
|
|
29
|
+
*/
|
|
30
|
+
export declare function agentConfigRelocation(agent: string): AgentConfigRelocation | undefined;
|
|
31
|
+
export interface StagedAgentConfigHome {
|
|
32
|
+
/** The relocated, writable config/state home staged for this launch. */
|
|
33
|
+
configDir: string;
|
|
34
|
+
/** Env var (e.g. `CODEX_HOME`) that points the agent at `configDir`. */
|
|
35
|
+
configDirEnv: {
|
|
36
|
+
name: string;
|
|
37
|
+
value: string;
|
|
38
|
+
};
|
|
39
|
+
/** Files the host copies back after the sandboxed agent exits. */
|
|
40
|
+
writeBackFiles: readonly StagedAgentConfigWriteBack[];
|
|
41
|
+
}
|
|
42
|
+
interface StagedAgentConfigWriteBack {
|
|
43
|
+
baselinePath: string;
|
|
44
|
+
sourcePath: string;
|
|
45
|
+
stagedPath: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Stage + seed a relocated, writable config home for an agent that cannot run
|
|
49
|
+
* with a read-only config home (codex's `CODEX_HOME`) under the safehouse
|
|
50
|
+
* runner. `parentDir` must already exist (the caller stages it inside a
|
|
51
|
+
* dedicated per-launch temp dir); the config home itself is created here.
|
|
52
|
+
*/
|
|
53
|
+
export declare function stageRelocatedAgentConfigHome(input: {
|
|
54
|
+
agent: string;
|
|
55
|
+
relocation: AgentConfigRelocation;
|
|
56
|
+
parentDir: string;
|
|
57
|
+
sourceConfigDir: string;
|
|
58
|
+
}): StagedAgentConfigHome;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=codexConfigRelocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codexConfigRelocation.d.ts","sourceRoot":"","sources":["../../src/lib/codexConfigRelocation.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,qBAAqB,EAAE,MAAM,CAAC;IAC9B,kFAAkF;IAClF,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,qEAAqE;IACrE,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAaD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAEtF;AAED,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,kEAAkE;IAClE,cAAc,EAAE,SAAS,0BAA0B,EAAE,CAAC;CACvD;AAED,UAAU,0BAA0B;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,qBAAqB,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,qBAAqB,CAexB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { copyFileSync, existsSync, mkdirSync, realpathSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
const AGENT_CONFIG_RELOCATIONS = {
|
|
4
|
+
codex: {
|
|
5
|
+
configDirEnv: "CODEX_HOME",
|
|
6
|
+
sourceHomeRelativeDir: ".codex",
|
|
7
|
+
// auth.json carries the ChatGPT OAuth tokens (codex reads creds from a file,
|
|
8
|
+
// not the keychain); config.toml preserves the user's codex configuration.
|
|
9
|
+
seedFiles: ["auth.json", "config.toml"],
|
|
10
|
+
persistedFiles: ["auth.json"],
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Return the config-relocation spec for an agent, or `undefined` when the
|
|
15
|
+
* agent has no registered relocation (claude, unknown agents) — the caller
|
|
16
|
+
* then runs that agent against its real home.
|
|
17
|
+
*/
|
|
18
|
+
export function agentConfigRelocation(agent) {
|
|
19
|
+
return AGENT_CONFIG_RELOCATIONS[agent.toLowerCase()];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Stage + seed a relocated, writable config home for an agent that cannot run
|
|
23
|
+
* with a read-only config home (codex's `CODEX_HOME`) under the safehouse
|
|
24
|
+
* runner. `parentDir` must already exist (the caller stages it inside a
|
|
25
|
+
* dedicated per-launch temp dir); the config home itself is created here.
|
|
26
|
+
*/
|
|
27
|
+
export function stageRelocatedAgentConfigHome(input) {
|
|
28
|
+
const configDir = path.join(input.parentDir, `${input.agent}-home`);
|
|
29
|
+
mkdirSync(configDir, { recursive: true });
|
|
30
|
+
const writeBackFiles = seedRelocatedConfigDir({
|
|
31
|
+
baselineDir: path.join(input.parentDir, "write-back-baseline"),
|
|
32
|
+
sourceDir: input.sourceConfigDir,
|
|
33
|
+
seedFiles: input.relocation.seedFiles,
|
|
34
|
+
persistedFiles: input.relocation.persistedFiles,
|
|
35
|
+
relocatedConfigDir: configDir,
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
configDir,
|
|
39
|
+
configDirEnv: { name: input.relocation.configDirEnv, value: configDir },
|
|
40
|
+
writeBackFiles,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Seed the agent's minimal credential/config files into the relocated home.
|
|
45
|
+
* Best-effort per file: a missing source (e.g. the user isn't logged into the
|
|
46
|
+
* agent, or has no config) is skipped rather than aborting the launch — the
|
|
47
|
+
* agent then reports its own "not logged in" state, which is the correct signal.
|
|
48
|
+
*/
|
|
49
|
+
function seedRelocatedConfigDir(input) {
|
|
50
|
+
const writeBackFiles = [];
|
|
51
|
+
for (const file of input.seedFiles) {
|
|
52
|
+
const source = path.join(input.sourceDir, file);
|
|
53
|
+
if (!existsSync(source)) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const destination = path.join(input.relocatedConfigDir, file);
|
|
57
|
+
copyFileSync(source, destination);
|
|
58
|
+
if (input.persistedFiles.includes(file)) {
|
|
59
|
+
const baselinePath = path.join(input.baselineDir, file);
|
|
60
|
+
mkdirSync(path.dirname(baselinePath), { recursive: true });
|
|
61
|
+
copyFileSync(source, baselinePath);
|
|
62
|
+
writeBackFiles.push({
|
|
63
|
+
baselinePath,
|
|
64
|
+
sourcePath: realpathSync(source),
|
|
65
|
+
stagedPath: destination,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return writeBackFiles;
|
|
70
|
+
}
|
|
@@ -4,6 +4,15 @@ export interface RunCommandOptions {
|
|
|
4
4
|
timeoutMs?: number;
|
|
5
5
|
stdio?: "captured" | "inherit";
|
|
6
6
|
trim?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Explicit subprocess env, replacing (not merging with) the inherited host
|
|
9
|
+
* env — matching `execFileSync`'s own semantics. Callers that want the host
|
|
10
|
+
* env plus overrides (e.g. relocating an agent's config-dir var) build that
|
|
11
|
+
* merge themselves before calling in, the same pattern the shell adapter
|
|
12
|
+
* uses for its own subprocess spawns. Only honored for the default
|
|
13
|
+
* (`captured`) mode — no caller needs it under `stdio: "inherit"` yet.
|
|
14
|
+
*/
|
|
15
|
+
env?: NodeJS.ProcessEnv;
|
|
7
16
|
}
|
|
8
17
|
export declare function runCommand(command: string, arguments_: readonly string[], options: RunCommandOptions & {
|
|
9
18
|
stdio: "inherit";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandRunner.d.ts","sourceRoot":"","sources":["../../src/lib/commandRunner.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"commandRunner.d.ts","sourceRoot":"","sources":["../../src/lib/commandRunner.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAED,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,EAAE,iBAAiB,GAAG;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GAChD,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,CAAC,EAAE,iBAAiB,GAAG;IAAE,KAAK,CAAC,EAAE,UAAU,CAAA;CAAE,GACnD,MAAM,CAAC;AA+BV,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,EAAE,iBAAiB,GAAG;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,GAChD,OAAO,CAAC,SAAS,CAAC,CAAC;AACtB,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,CAAC,EAAE,iBAAiB,GAAG;IAAE,KAAK,CAAC,EAAE,UAAU,CAAA;CAAE,GACnD,OAAO,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -23,6 +23,7 @@ export function runCommand(command, arguments_, options = {}) {
|
|
|
23
23
|
maxBuffer: RUN_MAX_BUFFER_BYTES,
|
|
24
24
|
stdio: ["ignore", "pipe", "pipe"],
|
|
25
25
|
timeout: options.timeoutMs ?? DEFAULT_RUN_TIMEOUT_MS,
|
|
26
|
+
...(options.env === undefined ? {} : { env: options.env }),
|
|
26
27
|
});
|
|
27
28
|
return options.trim === false ? output : output.trim();
|
|
28
29
|
}
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -55,18 +55,14 @@ export type WorkspaceKindSetting = "auto" | "cmux" | "tmux" | "zellij";
|
|
|
55
55
|
export declare const WORKSPACE_KIND_SETTINGS: readonly WorkspaceKindSetting[];
|
|
56
56
|
/**
|
|
57
57
|
* Concrete local isolation backend selected for a launch. `safehouse` is
|
|
58
|
-
* macOS-only (clearance HTTP-egress + sandbox profile); `
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* `sdx` is Docker Sandboxes (`sbx` CLI) — works on Linux and macOS and is the
|
|
62
|
-
* only known option that lets the agent use Docker safely without exposing the
|
|
63
|
-
* host socket; `none` is an explicit unsandboxed escape hatch.
|
|
58
|
+
* macOS-only (clearance HTTP-egress + sandbox profile); `sdx` is Docker
|
|
59
|
+
* Sandboxes (`sbx` CLI) on Linux and macOS; `none` is an explicit unsandboxed
|
|
60
|
+
* escape hatch.
|
|
64
61
|
*/
|
|
65
|
-
export type LocalRunner = "safehouse" | "
|
|
62
|
+
export type LocalRunner = "safehouse" | "sdx" | "none";
|
|
66
63
|
/**
|
|
67
64
|
* User-facing local runner setting. `auto` resolves at launch time:
|
|
68
|
-
* macOS picks `safehouse`, Linux picks `sdx`. `
|
|
69
|
-
* picked implicitly — both are opt-in via an explicit `local.runner`.
|
|
65
|
+
* macOS picks `safehouse`, Linux picks `sdx`. `none` is never picked implicitly.
|
|
70
66
|
*/
|
|
71
67
|
export type LocalRunnerSetting = LocalRunner | "auto";
|
|
72
68
|
export declare const LOCAL_RUNNER_SETTINGS: readonly LocalRunnerSetting[];
|
|
@@ -314,7 +310,7 @@ export interface Config {
|
|
|
314
310
|
* Network egress posture for local launches. Defaults to `"allowlisted"`.
|
|
315
311
|
* With the safehouse runner, `"allowlisted"` uses Clearance and `"open"`
|
|
316
312
|
* keeps the filesystem sandbox while running bare `safehouse` with
|
|
317
|
-
* unrestricted network egress. `
|
|
313
|
+
* unrestricted network egress. `sdx`/`none` ignore this setting.
|
|
318
314
|
*/
|
|
319
315
|
networkEgress?: NetworkEgressSetting;
|
|
320
316
|
/**
|
|
@@ -336,8 +332,8 @@ export interface Config {
|
|
|
336
332
|
enable?: string[];
|
|
337
333
|
};
|
|
338
334
|
/**
|
|
339
|
-
* Host directories re-opened read-only inside the sandbox
|
|
340
|
-
*
|
|
335
|
+
* Host directories re-opened read-only inside the safehouse sandbox, for
|
|
336
|
+
* toolchains the sandbox profile masks but does not re-open.
|
|
341
337
|
* `~` is expanded. Defaults to tfenv's config root so `terraform`/`tfenv`
|
|
342
338
|
* work in the sandbox; set your own list to add or replace entries.
|
|
343
339
|
*/
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAO1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,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E;QACP,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAE9D;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;AAEzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IACjC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;CAChC;AA0TD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,GAAG,OAAO,CAE1F;AAyJD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,EACtC,IAAI,EAAE,MAAM,GACX,OAAO,CAKT;AAumBD,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CA+B5E;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAGpE"}
|
package/dist/lib/config.js
CHANGED
|
@@ -24,7 +24,6 @@ export const WORKSPACE_KIND_SETTINGS = [
|
|
|
24
24
|
export const LOCAL_RUNNER_SETTINGS = [
|
|
25
25
|
"auto",
|
|
26
26
|
"safehouse",
|
|
27
|
-
"srt",
|
|
28
27
|
"sdx",
|
|
29
28
|
"none",
|
|
30
29
|
];
|
|
@@ -53,7 +52,7 @@ const DEFAULT_GIT = {
|
|
|
53
52
|
};
|
|
54
53
|
/**
|
|
55
54
|
* Read-only sandbox dirs granted by default: tfenv's config root, which the
|
|
56
|
-
* safehouse
|
|
55
|
+
* safehouse profiles mask but don't re-open. `~` expands at normalization.
|
|
57
56
|
*/
|
|
58
57
|
const DEFAULT_LOCAL_READ_ONLY_DIRS = ["~/.config/tfenv"];
|
|
59
58
|
function normalizeLocal(userLocal) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the worktree's shared git directory from the checkout itself.
|
|
3
|
+
* This supports both native worktrees and externally provisioned worktrees
|
|
4
|
+
* whose git storage lives outside the checkout tree.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveGitCommonDir(worktreeDir: string): string;
|
|
7
|
+
//# sourceMappingURL=gitCommonDir.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitCommonDir.d.ts","sourceRoot":"","sources":["../../src/lib/gitCommonDir.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAQ/D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { runCommand } from "./commandRunner.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the worktree's shared git directory from the checkout itself.
|
|
4
|
+
* This supports both native worktrees and externally provisioned worktrees
|
|
5
|
+
* whose git storage lives outside the checkout tree.
|
|
6
|
+
*/
|
|
7
|
+
export function resolveGitCommonDir(worktreeDir) {
|
|
8
|
+
return runCommand("git", [
|
|
9
|
+
"-C",
|
|
10
|
+
worktreeDir,
|
|
11
|
+
"rev-parse",
|
|
12
|
+
"--path-format=absolute",
|
|
13
|
+
"--git-common-dir",
|
|
14
|
+
]);
|
|
15
|
+
}
|
package/dist/lib/host.d.ts
CHANGED
|
@@ -14,12 +14,6 @@ export interface HostCapabilities {
|
|
|
14
14
|
hasTmux: boolean;
|
|
15
15
|
/** True when the `zellij` binary is on PATH. */
|
|
16
16
|
hasZellij: boolean;
|
|
17
|
-
/** True when the `bubblewrap` binary is on PATH (Linux srt dependency). */
|
|
18
|
-
hasBubblewrap: boolean;
|
|
19
|
-
/** True when the `socat` binary is on PATH (Linux srt dependency). */
|
|
20
|
-
hasSocat: boolean;
|
|
21
|
-
/** True when the `rg` (ripgrep) binary is on PATH (Linux srt dependency). */
|
|
22
|
-
hasRipgrep: boolean;
|
|
23
17
|
/** True when the host platform is macOS. Safehouse is macOS-only. */
|
|
24
18
|
isMacOS: boolean;
|
|
25
19
|
/** True when the host platform is Linux. */
|
|
@@ -30,14 +24,6 @@ export interface HostCapabilities {
|
|
|
30
24
|
* or WSL before creating a worktree.
|
|
31
25
|
*/
|
|
32
26
|
isSafehouseSupported: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* True when srt (Anthropic sandbox-runtime) is supportable on this
|
|
35
|
-
* platform. srt uses `sandbox-exec` on macOS and `bubblewrap` on Linux,
|
|
36
|
-
* so this tracks "macOS || Linux"; WSL inherits the Linux path. The srt
|
|
37
|
-
* binary itself ships as a groundcrew dependency, so there is no PATH
|
|
38
|
-
* probe — but the Linux backend additionally needs bubblewrap/socat/rg.
|
|
39
|
-
*/
|
|
40
|
-
isSrtSupported: boolean;
|
|
41
27
|
/**
|
|
42
28
|
* True when sdx (Docker Sandboxes) is supportable on this platform —
|
|
43
29
|
* sbx is published for both macOS and Linux, so this stays in sync with
|
package/dist/lib/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/lib/host.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,YAAY,EAAE,OAAO,CAAC;IACtB,gEAAgE;IAChE,MAAM,EAAE,OAAO,CAAC;IAChB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/lib/host.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,YAAY,EAAE,OAAO,CAAC;IACtB,gEAAgE;IAChE,MAAM,EAAE,OAAO,CAAC;IAChB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAc1F;AAED,wBAAsB,sBAAsB,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAqB5F"}
|
package/dist/lib/host.js
CHANGED
|
@@ -28,15 +28,12 @@ export async function which(cmd, signal) {
|
|
|
28
28
|
export async function detectHostCapabilities(signal) {
|
|
29
29
|
const isMacOS = process.platform === "darwin";
|
|
30
30
|
const isLinux = process.platform === "linux";
|
|
31
|
-
const [safehouse, sbx, cmux, tmux, zellij
|
|
31
|
+
const [safehouse, sbx, cmux, tmux, zellij] = await Promise.all([
|
|
32
32
|
which("safehouse", signal),
|
|
33
33
|
which("sbx", signal),
|
|
34
34
|
which("cmux", signal),
|
|
35
35
|
which("tmux", signal),
|
|
36
36
|
which("zellij", signal),
|
|
37
|
-
which("bwrap", signal),
|
|
38
|
-
which("socat", signal),
|
|
39
|
-
which("rg", signal),
|
|
40
37
|
]);
|
|
41
38
|
return {
|
|
42
39
|
hasSafehouse: safehouse !== undefined,
|
|
@@ -44,13 +41,9 @@ export async function detectHostCapabilities(signal) {
|
|
|
44
41
|
hasCmux: cmux !== undefined,
|
|
45
42
|
hasTmux: tmux !== undefined,
|
|
46
43
|
hasZellij: zellij !== undefined,
|
|
47
|
-
hasBubblewrap: bubblewrap !== undefined,
|
|
48
|
-
hasSocat: socat !== undefined,
|
|
49
|
-
hasRipgrep: ripgrep !== undefined,
|
|
50
44
|
isMacOS,
|
|
51
45
|
isLinux,
|
|
52
46
|
isSafehouseSupported: isMacOS,
|
|
53
|
-
isSrtSupported: isMacOS || isLinux,
|
|
54
47
|
isSdxSupported: isMacOS || isLinux,
|
|
55
48
|
};
|
|
56
49
|
}
|
|
@@ -20,30 +20,11 @@ export declare function withResumeArgs(definition: AgentDefinition, resumeArgs:
|
|
|
20
20
|
* exercise the catch branch.
|
|
21
21
|
*/
|
|
22
22
|
export declare function resolveSafehouseClearancePath(baseUrl?: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* Resolve the `srt` CLI shipped by `@anthropic-ai/sandbox-runtime` (a pinned
|
|
25
|
-
* groundcrew dependency) via Node's module resolution, reading the package's
|
|
26
|
-
* `bin` field so the path survives version bumps that move the entry point.
|
|
27
|
-
* The resolved `dist/cli.js` carries a `#!/usr/bin/env node` shebang and npm
|
|
28
|
-
* marks it executable, so it is exec'd directly like the safehouse wrapper.
|
|
29
|
-
*
|
|
30
|
-
* @param baseUrl - **Test-only seam.** Production callers must omit this so the
|
|
31
|
-
* helper resolves from this module's URL. Tests pass an invalid value to
|
|
32
|
-
* exercise the catch branch.
|
|
33
|
-
*/
|
|
34
|
-
export declare function resolveSrtBinPath(baseUrl?: string): string;
|
|
35
|
-
/**
|
|
36
|
-
* Extract the `srt` entry from a package manifest's `bin` field, which npm
|
|
37
|
-
* allows as either a bare string (single-bin packages) or a name→path map.
|
|
38
|
-
*/
|
|
39
|
-
export declare function srtBinEntry(manifest: {
|
|
40
|
-
bin?: string | Record<string, string>;
|
|
41
|
-
}): string;
|
|
42
23
|
export declare function isEnvironmentAssignment(token: string): boolean;
|
|
43
24
|
/**
|
|
44
25
|
* Infer the agent's command basename from a agent `cmd` (skipping a leading
|
|
45
26
|
* `env`/`KEY=val` prefix). Safehouse uses it to pick the matching `.sb`
|
|
46
|
-
* profile
|
|
27
|
+
* profile.
|
|
47
28
|
*/
|
|
48
29
|
export declare function inferAgentCommandName(agentCmd: string): string;
|
|
49
30
|
export type WorkerEnvironment = Readonly<{
|
|
@@ -64,6 +45,33 @@ export interface SafehouseAgentIntegration {
|
|
|
64
45
|
* cmux activity-reporting hooks for a Claude agent).
|
|
65
46
|
*/
|
|
66
47
|
agentArgs?: readonly string[];
|
|
48
|
+
/**
|
|
49
|
+
* Extra **writable** safehouse `--add-dirs` paths contributed by the
|
|
50
|
+
* integration (e.g. codex's relocated `CODEX_HOME` under safehouse, which
|
|
51
|
+
* the agent must read AND write session/state into — unlike
|
|
52
|
+
* `addDirsReadOnly`). Merged into the agent wrap's `--add-dirs` alongside
|
|
53
|
+
* `safehouseAgentAddDirs`; never granted to the repo-controlled
|
|
54
|
+
* prepareWorktree wrap.
|
|
55
|
+
*/
|
|
56
|
+
addDirs?: readonly string[];
|
|
57
|
+
/**
|
|
58
|
+
* Files copied from their staged sandbox location back to the source store
|
|
59
|
+
* by the host after the agent exits. This keeps credential refreshes without
|
|
60
|
+
* granting the sandbox write access to the source config home.
|
|
61
|
+
*/
|
|
62
|
+
writeBackFiles?: readonly SafehouseAgentWriteBack[];
|
|
63
|
+
/**
|
|
64
|
+
* Extra paths torn down (`rm -rf`) once the agent wrap exits — success or
|
|
65
|
+
* failure — folded into the same EXIT trap that already cleans up the
|
|
66
|
+
* profile-shim dir. Empty/undefined for integrations that stage nothing
|
|
67
|
+
* (Claude), which leaves the trap's shape unchanged.
|
|
68
|
+
*/
|
|
69
|
+
teardownPaths?: readonly string[];
|
|
70
|
+
}
|
|
71
|
+
interface SafehouseAgentWriteBack {
|
|
72
|
+
baselinePath: string;
|
|
73
|
+
sourcePath: string;
|
|
74
|
+
stagedPath: string;
|
|
67
75
|
}
|
|
68
76
|
interface LaunchCommandArguments {
|
|
69
77
|
definition: AgentDefinition;
|
|
@@ -72,8 +80,8 @@ interface LaunchCommandArguments {
|
|
|
72
80
|
/**
|
|
73
81
|
* Directory the agent and prepareWorktree hook cwd into (the `cd`/`-w`
|
|
74
82
|
* target). Equals `worktreeDir` unless the repo recipe sets a `workdir`, in
|
|
75
|
-
* which case it is the subproject dir. The `{{worktree}}` template
|
|
76
|
-
*
|
|
83
|
+
* which case it is the subproject dir. The `{{worktree}}` template keeps using
|
|
84
|
+
* `worktreeDir` (the whole checkout).
|
|
77
85
|
*/
|
|
78
86
|
workingDir: string;
|
|
79
87
|
/**
|
|
@@ -94,7 +102,7 @@ interface LaunchCommandArguments {
|
|
|
94
102
|
* Operator-only, per-repository setup command run on the HOST shell (never a
|
|
95
103
|
* sandbox), before `prepareWorktreeCommand` and the agent. Resolved by the
|
|
96
104
|
* caller from `knownRepositories[].unsandboxedHooks.prepareWorktree` in
|
|
97
|
-
* crew.config.ts. Emitted for the safehouse
|
|
105
|
+
* crew.config.ts. Emitted for the safehouse and none runners; the sdx
|
|
98
106
|
* runner rejects it (no host to run it on).
|
|
99
107
|
*/
|
|
100
108
|
prepareWorktreeUnsandboxedCommand?: string | undefined;
|
|
@@ -106,7 +114,7 @@ interface LaunchCommandArguments {
|
|
|
106
114
|
runner: LocalRunner;
|
|
107
115
|
/**
|
|
108
116
|
* Network egress posture. The safehouse runner uses `"allowlisted"` for the
|
|
109
|
-
* Clearance shim and `"open"` for bare `safehouse`;
|
|
117
|
+
* Clearance shim and `"open"` for bare `safehouse`; sdx/unwrapped paths
|
|
110
118
|
* ignore it.
|
|
111
119
|
*/
|
|
112
120
|
networkEgress: NetworkEgressSetting;
|
|
@@ -117,34 +125,6 @@ interface LaunchCommandArguments {
|
|
|
117
125
|
* on one host and sdx on another without config edits.
|
|
118
126
|
*/
|
|
119
127
|
sandboxName?: string | undefined;
|
|
120
|
-
/**
|
|
121
|
-
* Absolute path to the profile-neutral srt settings JSON for the
|
|
122
|
-
* prepareWorktree wrap (no agent credential grants). Required when
|
|
123
|
-
* `runner === "srt"`. Staged in `srtSettingsDir`.
|
|
124
|
-
*/
|
|
125
|
-
srtPrepareSettingsFile?: string | undefined;
|
|
126
|
-
/**
|
|
127
|
-
* Absolute path to the full agent srt settings JSON for the agent wrap.
|
|
128
|
-
* Required when `runner === "srt"`. Staged in `srtSettingsDir`.
|
|
129
|
-
*/
|
|
130
|
-
srtAgentSettingsFile?: string | undefined;
|
|
131
|
-
/**
|
|
132
|
-
* Absolute temp dir holding the srt settings files. Required when
|
|
133
|
-
* `runner === "srt"`; torn down by the launch command after srt exits.
|
|
134
|
-
*/
|
|
135
|
-
srtSettingsDir?: string | undefined;
|
|
136
|
-
/**
|
|
137
|
-
* Env var that points the agent at its relocated, writable config home
|
|
138
|
-
* (e.g. `{ name: "CODEX_HOME", value: "<settingsDir>/codex-home" }`).
|
|
139
|
-
* Injected into the agent wrap's `env -i` (with an explicit value, not a
|
|
140
|
-
* host-env passthrough) so the agent writes state to the staged dir instead
|
|
141
|
-
* of its read-only real home. Only the agent wrap gets it — the prepare wrap
|
|
142
|
-
* runs the repo hook, not the agent. Undefined for read-only agents (claude).
|
|
143
|
-
*/
|
|
144
|
-
srtAgentConfigDirEnv?: {
|
|
145
|
-
name: string;
|
|
146
|
-
value: string;
|
|
147
|
-
} | undefined;
|
|
148
128
|
/**
|
|
149
129
|
* Extra filesystem paths granted read/write to the safehouse sandbox via
|
|
150
130
|
* `--add-dirs`, beyond safehouse's automatic cwd grant. Resolved (and deduped)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launchCommand.d.ts","sourceRoot":"","sources":["../../src/lib/launchCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"launchCommand.d.ts","sourceRo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