yuurei 0.0.1
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/LICENSE +21 -0
- package/README.md +231 -0
- package/dist/artifact/collector.d.ts +15 -0
- package/dist/artifact/collector.d.ts.map +1 -0
- package/dist/artifact/collector.js +87 -0
- package/dist/artifact/collector.js.map +1 -0
- package/dist/artifact/types.d.ts +10 -0
- package/dist/artifact/types.d.ts.map +1 -0
- package/dist/artifact/types.js +2 -0
- package/dist/artifact/types.js.map +1 -0
- package/dist/cell/digest.d.ts +10 -0
- package/dist/cell/digest.d.ts.map +1 -0
- package/dist/cell/digest.js +13 -0
- package/dist/cell/digest.js.map +1 -0
- package/dist/cell/resolver.d.ts +18 -0
- package/dist/cell/resolver.d.ts.map +1 -0
- package/dist/cell/resolver.js +41 -0
- package/dist/cell/resolver.js.map +1 -0
- package/dist/cell/types.d.ts +48 -0
- package/dist/cell/types.d.ts.map +1 -0
- package/dist/cell/types.js +2 -0
- package/dist/cell/types.js.map +1 -0
- package/dist/cli/clean.d.ts +16 -0
- package/dist/cli/clean.d.ts.map +1 -0
- package/dist/cli/clean.js +24 -0
- package/dist/cli/clean.js.map +1 -0
- package/dist/cli/doctor.d.ts +29 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +160 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/exit-codes.d.ts +15 -0
- package/dist/cli/exit-codes.d.ts.map +1 -0
- package/dist/cli/exit-codes.js +18 -0
- package/dist/cli/exit-codes.js.map +1 -0
- package/dist/cli/init.d.ts +32 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +143 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/inspect.d.ts +4 -0
- package/dist/cli/inspect.d.ts.map +1 -0
- package/dist/cli/inspect.js +24 -0
- package/dist/cli/inspect.js.map +1 -0
- package/dist/cli/output.d.ts +5 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +5 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/profile-list.d.ts +3 -0
- package/dist/cli/profile-list.d.ts.map +1 -0
- package/dist/cli/profile-list.js +14 -0
- package/dist/cli/profile-list.js.map +1 -0
- package/dist/cli/run.d.ts +22 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +95 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/trace-show.d.ts +3 -0
- package/dist/cli/trace-show.d.ts.map +1 -0
- package/dist/cli/trace-show.js +22 -0
- package/dist/cli/trace-show.js.map +1 -0
- package/dist/config/discovery.d.ts +3 -0
- package/dist/config/discovery.d.ts.map +1 -0
- package/dist/config/discovery.js +18 -0
- package/dist/config/discovery.js.map +1 -0
- package/dist/config/schema.d.ts +21 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +19 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/yuurei-config.d.ts +4 -0
- package/dist/config/yuurei-config.d.ts.map +1 -0
- package/dist/config/yuurei-config.js +10 -0
- package/dist/config/yuurei-config.js.map +1 -0
- package/dist/cost/noop.d.ts +7 -0
- package/dist/cost/noop.d.ts.map +1 -0
- package/dist/cost/noop.js +10 -0
- package/dist/cost/noop.js.map +1 -0
- package/dist/cost/types.d.ts +21 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +2 -0
- package/dist/cost/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +111 -0
- package/dist/index.js.map +1 -0
- package/dist/isolation/config-root.d.ts +9 -0
- package/dist/isolation/config-root.d.ts.map +1 -0
- package/dist/isolation/config-root.js +10 -0
- package/dist/isolation/config-root.js.map +1 -0
- package/dist/isolation/env.d.ts +2 -0
- package/dist/isolation/env.d.ts.map +1 -0
- package/dist/isolation/env.js +17 -0
- package/dist/isolation/env.js.map +1 -0
- package/dist/isolation/index.d.ts +9 -0
- package/dist/isolation/index.d.ts.map +1 -0
- package/dist/isolation/index.js +21 -0
- package/dist/isolation/index.js.map +1 -0
- package/dist/isolation/level0.d.ts +20 -0
- package/dist/isolation/level0.d.ts.map +1 -0
- package/dist/isolation/level0.js +51 -0
- package/dist/isolation/level0.js.map +1 -0
- package/dist/isolation/level1.d.ts +13 -0
- package/dist/isolation/level1.d.ts.map +1 -0
- package/dist/isolation/level1.js +58 -0
- package/dist/isolation/level1.js.map +1 -0
- package/dist/isolation/tempdir.d.ts +53 -0
- package/dist/isolation/tempdir.d.ts.map +1 -0
- package/dist/isolation/tempdir.js +87 -0
- package/dist/isolation/tempdir.js.map +1 -0
- package/dist/isolation/types.d.ts +37 -0
- package/dist/isolation/types.d.ts.map +1 -0
- package/dist/isolation/types.js +2 -0
- package/dist/isolation/types.js.map +1 -0
- package/dist/profile/loader.d.ts +9 -0
- package/dist/profile/loader.d.ts.map +1 -0
- package/dist/profile/loader.js +95 -0
- package/dist/profile/loader.js.map +1 -0
- package/dist/profile/manifest.d.ts +29 -0
- package/dist/profile/manifest.d.ts.map +1 -0
- package/dist/profile/manifest.js +28 -0
- package/dist/profile/manifest.js.map +1 -0
- package/dist/profile/types.d.ts +31 -0
- package/dist/profile/types.d.ts.map +1 -0
- package/dist/profile/types.js +2 -0
- package/dist/profile/types.js.map +1 -0
- package/dist/run/id.d.ts +7 -0
- package/dist/run/id.d.ts.map +1 -0
- package/dist/run/id.js +15 -0
- package/dist/run/id.js.map +1 -0
- package/dist/run/layout.d.ts +27 -0
- package/dist/run/layout.d.ts.map +1 -0
- package/dist/run/layout.js +45 -0
- package/dist/run/layout.js.map +1 -0
- package/dist/run/pipeline.d.ts +45 -0
- package/dist/run/pipeline.d.ts.map +1 -0
- package/dist/run/pipeline.js +246 -0
- package/dist/run/pipeline.js.map +1 -0
- package/dist/run/signals.d.ts +53 -0
- package/dist/run/signals.d.ts.map +1 -0
- package/dist/run/signals.js +74 -0
- package/dist/run/signals.js.map +1 -0
- package/dist/runtime/claude-code/args.d.ts +8 -0
- package/dist/runtime/claude-code/args.d.ts.map +1 -0
- package/dist/runtime/claude-code/args.js +13 -0
- package/dist/runtime/claude-code/args.js.map +1 -0
- package/dist/runtime/claude-code/index.d.ts +11 -0
- package/dist/runtime/claude-code/index.d.ts.map +1 -0
- package/dist/runtime/claude-code/index.js +167 -0
- package/dist/runtime/claude-code/index.js.map +1 -0
- package/dist/runtime/claude-code/paths.d.ts +3 -0
- package/dist/runtime/claude-code/paths.d.ts.map +1 -0
- package/dist/runtime/claude-code/paths.js +6 -0
- package/dist/runtime/claude-code/paths.js.map +1 -0
- package/dist/runtime/codex/args.d.ts +21 -0
- package/dist/runtime/codex/args.d.ts.map +1 -0
- package/dist/runtime/codex/args.js +35 -0
- package/dist/runtime/codex/args.js.map +1 -0
- package/dist/runtime/codex/index.d.ts +13 -0
- package/dist/runtime/codex/index.d.ts.map +1 -0
- package/dist/runtime/codex/index.js +299 -0
- package/dist/runtime/codex/index.js.map +1 -0
- package/dist/runtime/codex/paths.d.ts +3 -0
- package/dist/runtime/codex/paths.d.ts.map +1 -0
- package/dist/runtime/codex/paths.js +6 -0
- package/dist/runtime/codex/paths.js.map +1 -0
- package/dist/runtime/detect.d.ts +5 -0
- package/dist/runtime/detect.d.ts.map +1 -0
- package/dist/runtime/detect.js +42 -0
- package/dist/runtime/detect.js.map +1 -0
- package/dist/runtime/exec.d.ts +24 -0
- package/dist/runtime/exec.d.ts.map +1 -0
- package/dist/runtime/exec.js +132 -0
- package/dist/runtime/exec.js.map +1 -0
- package/dist/runtime/registry.d.ts +4 -0
- package/dist/runtime/registry.d.ts.map +1 -0
- package/dist/runtime/registry.js +23 -0
- package/dist/runtime/registry.js.map +1 -0
- package/dist/runtime/reserved-paths.d.ts +22 -0
- package/dist/runtime/reserved-paths.d.ts.map +1 -0
- package/dist/runtime/reserved-paths.js +30 -0
- package/dist/runtime/reserved-paths.js.map +1 -0
- package/dist/runtime/types.d.ts +105 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +2 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/trace/reader.d.ts +4 -0
- package/dist/trace/reader.d.ts.map +1 -0
- package/dist/trace/reader.js +9 -0
- package/dist/trace/reader.js.map +1 -0
- package/dist/trace/redact.d.ts +22 -0
- package/dist/trace/redact.d.ts.map +1 -0
- package/dist/trace/redact.js +124 -0
- package/dist/trace/redact.js.map +1 -0
- package/dist/trace/schema.d.ts +49 -0
- package/dist/trace/schema.d.ts.map +1 -0
- package/dist/trace/schema.js +53 -0
- package/dist/trace/schema.js.map +1 -0
- package/dist/trace/writer.d.ts +17 -0
- package/dist/trace/writer.d.ts.map +1 -0
- package/dist/trace/writer.js +45 -0
- package/dist/trace/writer.js.map +1 -0
- package/dist/util/fs.d.ts +17 -0
- package/dist/util/fs.d.ts.map +1 -0
- package/dist/util/fs.js +61 -0
- package/dist/util/fs.js.map +1 -0
- package/dist/util/hash.d.ts +3 -0
- package/dist/util/hash.d.ts.map +1 -0
- package/dist/util/hash.js +7 -0
- package/dist/util/hash.js.map +1 -0
- package/dist/util/json.d.ts +8 -0
- package/dist/util/json.d.ts.map +1 -0
- package/dist/util/json.js +24 -0
- package/dist/util/json.js.map +1 -0
- package/dist/util/logger.d.ts +8 -0
- package/dist/util/logger.d.ts.map +1 -0
- package/dist/util/logger.js +16 -0
- package/dist/util/logger.js.map +1 -0
- package/dist/version.d.ts +24 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +26 -0
- package/dist/version.js.map +1 -0
- package/docs/assets/yuurei-top.jpg +0 -0
- package/package.json +61 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { findYuureiDir } from '../config/discovery.js';
|
|
3
|
+
import { readTrace } from '../trace/reader.js';
|
|
4
|
+
import { YuureiError, EXIT_CODES } from './exit-codes.js';
|
|
5
|
+
export async function runTraceShow(cwd, runId, logger) {
|
|
6
|
+
const yuureiDir = await findYuureiDir(cwd);
|
|
7
|
+
if (!yuureiDir) {
|
|
8
|
+
throw new YuureiError('no .yuurei/ directory found', EXIT_CODES.CONFIG_ERROR);
|
|
9
|
+
}
|
|
10
|
+
const runDir = join(yuureiDir, 'runs', runId);
|
|
11
|
+
const trace = await readTrace(runDir).catch(() => {
|
|
12
|
+
throw new YuureiError(`no trace found for run: ${runId}`, EXIT_CODES.CONFIG_ERROR);
|
|
13
|
+
});
|
|
14
|
+
logger.info(runId, {
|
|
15
|
+
runtime: trace.runtime.id,
|
|
16
|
+
exitCode: trace.execution.exit_code,
|
|
17
|
+
signal: trace.execution.signal,
|
|
18
|
+
durationMs: trace.execution.duration_ms,
|
|
19
|
+
timedOut: trace.execution.timed_out,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=trace-show.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-show.js","sourceRoot":"","sources":["../../src/cli/trace-show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG1D,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAW,EAAE,KAAa,EAAE,MAAc;IAC3E,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC;IAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CAAC,6BAA6B,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;QAC/C,MAAM,IAAI,WAAW,CAAC,2BAA2B,KAAK,EAAE,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE;QACjB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE;QACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS;QACnC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;QAC9B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW;QACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS;KACpC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/config/discovery.ts"],"names":[],"mappings":"AAGA,+FAA+F;AAC/F,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAa5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { dirname, join } from 'node:path';
|
|
2
|
+
import { pathExists } from '../util/fs.js';
|
|
3
|
+
/** Walks upward from `startDir` looking for a `.yuurei/` directory, like git finds `.git/`. */
|
|
4
|
+
export async function findYuureiDir(startDir) {
|
|
5
|
+
let current = startDir;
|
|
6
|
+
for (;;) {
|
|
7
|
+
const candidate = join(current, '.yuurei');
|
|
8
|
+
if (await pathExists(candidate)) {
|
|
9
|
+
return candidate;
|
|
10
|
+
}
|
|
11
|
+
const parent = dirname(current);
|
|
12
|
+
if (parent === current) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
current = parent;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/config/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,+FAA+F;AAC/F,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAgB;IAClD,IAAI,OAAO,GAAG,QAAQ,CAAC;IACvB,SAAS,CAAC;QACR,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC3C,IAAI,MAAM,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAChC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Schema for `.yuurei/yuurei.yaml` (design doc §7.2). */
|
|
3
|
+
export declare const YuureiConfigSchema: z.ZodObject<{
|
|
4
|
+
version: z.ZodLiteral<1>;
|
|
5
|
+
profiles: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
6
|
+
runtime: z.ZodString;
|
|
7
|
+
source: z.ZodString;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
runs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
10
|
+
profile: z.ZodString;
|
|
11
|
+
task: z.ZodString;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type YuureiConfig = z.infer<typeof YuureiConfigSchema>;
|
|
15
|
+
/** Schema for a single `profiles/<name>/profile.yaml`. */
|
|
16
|
+
export declare const ProfileYamlSchema: z.ZodObject<{
|
|
17
|
+
runtime: z.ZodString;
|
|
18
|
+
description: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type ProfileYaml = z.infer<typeof ProfileYamlSchema>;
|
|
21
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB;;;;;;;;;;iBAgB7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,0DAA0D;AAC1D,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Schema for `.yuurei/yuurei.yaml` (design doc §7.2). */
|
|
3
|
+
export const YuureiConfigSchema = z.object({
|
|
4
|
+
version: z.literal(1),
|
|
5
|
+
profiles: z.record(z.string(), z.object({
|
|
6
|
+
runtime: z.string(),
|
|
7
|
+
source: z.string(),
|
|
8
|
+
})),
|
|
9
|
+
runs: z.record(z.string(), z.object({
|
|
10
|
+
profile: z.string(),
|
|
11
|
+
task: z.string(),
|
|
12
|
+
})),
|
|
13
|
+
});
|
|
14
|
+
/** Schema for a single `profiles/<name>/profile.yaml`. */
|
|
15
|
+
export const ProfileYamlSchema = z.object({
|
|
16
|
+
runtime: z.string(),
|
|
17
|
+
description: z.string().optional(),
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0DAA0D;AAC1D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAChB,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;KACnB,CAAC,CACH;IACD,IAAI,EAAE,CAAC,CAAC,MAAM,CACZ,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC,CACH;CACF,CAAC,CAAC;AAIH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yuurei-config.d.ts","sourceRoot":"","sources":["../../src/config/yuurei-config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpE,qDAAqD;AACrD,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAG/E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { parse } from 'yaml';
|
|
4
|
+
import { YuureiConfigSchema } from './schema.js';
|
|
5
|
+
/** Loads and validates `<yuureiDir>/yuurei.yaml`. */
|
|
6
|
+
export async function loadYuureiConfig(yuureiDir) {
|
|
7
|
+
const raw = await readFile(join(yuureiDir, 'yuurei.yaml'), 'utf8');
|
|
8
|
+
return YuureiConfigSchema.parse(parse(raw));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=yuurei-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yuurei-config.js","sourceRoot":"","sources":["../../src/config/yuurei-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAqB,MAAM,aAAa,CAAC;AAEpE,qDAAqD;AACrD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,SAAiB;IACtD,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,CAAC;IACnE,OAAO,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CostEstimate, CostModel, UsageRecord } from './types.js';
|
|
2
|
+
/** v0.3's only CostModel implementation: always declines to estimate. */
|
|
3
|
+
export declare class NoopCostModel implements CostModel {
|
|
4
|
+
id(): string;
|
|
5
|
+
estimate(_input: UsageRecord): Promise<CostEstimate>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=noop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../src/cost/noop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEvE,yEAAyE;AACzE,qBAAa,aAAc,YAAW,SAAS;IAC7C,EAAE,IAAI,MAAM;IAIN,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CAG3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noop.js","sourceRoot":"","sources":["../../src/cost/noop.ts"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,MAAM,OAAO,aAAa;IACxB,EAAE;QACA,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,MAAmB;QAChC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface UsageRecord {
|
|
2
|
+
runtimeId: string;
|
|
3
|
+
model: string;
|
|
4
|
+
tokensIn: number | null;
|
|
5
|
+
tokensOut: number | null;
|
|
6
|
+
}
|
|
7
|
+
export interface CostEstimate {
|
|
8
|
+
/** null = cannot be estimated, distinct from a real zero-cost result. */
|
|
9
|
+
amount: number | null;
|
|
10
|
+
currency: string | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Boundary converting observed usage into cost. v0.3 ships only a no-op
|
|
14
|
+
* implementation (see ./noop.ts); pricing/cost logic is deliberately out
|
|
15
|
+
* of scope so trace data stays re-computable later (design doc §6.4).
|
|
16
|
+
*/
|
|
17
|
+
export interface CostModel {
|
|
18
|
+
id(): string;
|
|
19
|
+
estimate(input: UsageRecord): Promise<CostEstimate>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cost/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,IAAI,MAAM,CAAC;IACb,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/cost/types.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import cac from 'cac';
|
|
3
|
+
import { runClean } from './cli/clean.js';
|
|
4
|
+
import { printDoctorReport, runDoctor } from './cli/doctor.js';
|
|
5
|
+
import { runInit } from './cli/init.js';
|
|
6
|
+
import { runInspect } from './cli/inspect.js';
|
|
7
|
+
import { EXIT_CODES, YuureiError } from './cli/exit-codes.js';
|
|
8
|
+
import { loggerForFlags } from './cli/output.js';
|
|
9
|
+
import { runProfileList } from './cli/profile-list.js';
|
|
10
|
+
import { runRun } from './cli/run.js';
|
|
11
|
+
import { runTraceShow } from './cli/trace-show.js';
|
|
12
|
+
import { packageVersion } from './version.js';
|
|
13
|
+
const cli = cac('yuurei');
|
|
14
|
+
function withErrorHandling(action) {
|
|
15
|
+
return async (...args) => {
|
|
16
|
+
try {
|
|
17
|
+
await action(...args);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
const flags = args[args.length - 1];
|
|
21
|
+
const logger = loggerForFlags(flags);
|
|
22
|
+
if (error instanceof YuureiError) {
|
|
23
|
+
logger.error(error.message);
|
|
24
|
+
process.exitCode = error.exitCode;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
28
|
+
process.exitCode = EXIT_CODES.RUNTIME_EXECUTION_FAILED;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
cli
|
|
33
|
+
.command('doctor', 'Inspect the environment; never mutates it')
|
|
34
|
+
.option('--json', 'Output as JSON')
|
|
35
|
+
.action(withErrorHandling(async (flags) => {
|
|
36
|
+
const report = await runDoctor();
|
|
37
|
+
printDoctorReport(report, loggerForFlags(flags), flags.json ? 'json' : 'human');
|
|
38
|
+
}));
|
|
39
|
+
cli
|
|
40
|
+
.command('profile <action>', 'Manage profiles (only "list" is supported)')
|
|
41
|
+
.option('--json', 'Output as JSON')
|
|
42
|
+
.action(withErrorHandling(async (action, flags) => {
|
|
43
|
+
if (action !== 'list') {
|
|
44
|
+
throw new YuureiError(`unknown profile action: ${action}`, EXIT_CODES.CONFIG_ERROR);
|
|
45
|
+
}
|
|
46
|
+
await runProfileList(process.cwd(), loggerForFlags(flags));
|
|
47
|
+
}));
|
|
48
|
+
cli
|
|
49
|
+
.command('inspect <profile-name>', 'Resolve a profile without running anything')
|
|
50
|
+
.option('--json', 'Output as JSON')
|
|
51
|
+
.action(withErrorHandling(async (profileName, flags) => {
|
|
52
|
+
await runInspect(process.cwd(), profileName, loggerForFlags(flags));
|
|
53
|
+
}));
|
|
54
|
+
cli
|
|
55
|
+
.command('clean', 'Remove orphaned isolation temp directories')
|
|
56
|
+
.option('--json', 'Output as JSON')
|
|
57
|
+
.action(withErrorHandling(async (flags) => {
|
|
58
|
+
await runClean(loggerForFlags(flags));
|
|
59
|
+
}));
|
|
60
|
+
cli
|
|
61
|
+
.command('init [directory]', 'Scaffold a new project for a first run')
|
|
62
|
+
.option('--runtime <runtime>', 'Runtime to scaffold for (default: claude-code)')
|
|
63
|
+
.option('--profile <name>', 'Profile name (default: claude-basic)')
|
|
64
|
+
.option('--task <name>', 'Task name (default: hello)')
|
|
65
|
+
.option('--run <name>', 'Named run referencing the profile and task (default: the task name)')
|
|
66
|
+
.option('--json', 'Output as JSON')
|
|
67
|
+
.action(withErrorHandling(async (directory, flags) => {
|
|
68
|
+
await runInit(process.cwd(), {
|
|
69
|
+
directory: directory ?? '',
|
|
70
|
+
runtime: flags.runtime ?? 'claude-code',
|
|
71
|
+
profile: flags.profile ?? 'claude-basic',
|
|
72
|
+
task: flags.task ?? 'hello',
|
|
73
|
+
...(flags.run !== undefined ? { run: flags.run } : {}),
|
|
74
|
+
json: flags.json ?? false,
|
|
75
|
+
}, loggerForFlags(flags));
|
|
76
|
+
}));
|
|
77
|
+
cli
|
|
78
|
+
.command('run [run-name]', 'Execute a run')
|
|
79
|
+
.option('--profile <profile>', 'Profile name (used with --task instead of a run name)')
|
|
80
|
+
.option('--task <task>', 'Task file path (used with --profile instead of a run name)')
|
|
81
|
+
.option('--model <model>', 'Requested model')
|
|
82
|
+
.option('--keep', 'Keep the isolated workspace for debugging')
|
|
83
|
+
.option('--timeout <ms>', 'Kill the runtime process after this many milliseconds (default: no timeout)')
|
|
84
|
+
.option('--isolation <level>', 'Isolation strategy: level0 or level1 (default: level1)')
|
|
85
|
+
.option('--bridge-codex-auth-file', 'Experimental: bridge the real ~/.codex/auth.json into the isolated run (Codex only, off by default)')
|
|
86
|
+
.option('--json', 'Output as JSON')
|
|
87
|
+
.action(withErrorHandling(async (runName, flags) => {
|
|
88
|
+
await runRun(process.cwd(), {
|
|
89
|
+
runName,
|
|
90
|
+
profile: flags.profile,
|
|
91
|
+
task: flags.task,
|
|
92
|
+
model: flags.model,
|
|
93
|
+
keep: flags.keep,
|
|
94
|
+
timeoutMs: flags.timeout !== undefined ? Number(flags.timeout) : undefined,
|
|
95
|
+
isolation: flags.isolation,
|
|
96
|
+
bridgeCodexAuthFile: flags.bridgeCodexAuthFile,
|
|
97
|
+
}, loggerForFlags(flags));
|
|
98
|
+
}));
|
|
99
|
+
cli
|
|
100
|
+
.command('trace <action> <run-id>', 'Inspect traces (only "show" is supported)')
|
|
101
|
+
.option('--json', 'Output as JSON')
|
|
102
|
+
.action(withErrorHandling(async (action, runId, flags) => {
|
|
103
|
+
if (action !== 'show') {
|
|
104
|
+
throw new YuureiError(`unknown trace action: ${action}`, EXIT_CODES.CONFIG_ERROR);
|
|
105
|
+
}
|
|
106
|
+
await runTraceShow(process.cwd(), runId, loggerForFlags(flags));
|
|
107
|
+
}));
|
|
108
|
+
cli.help();
|
|
109
|
+
cli.version(packageVersion);
|
|
110
|
+
cli.parse();
|
|
111
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC;AAE1B,SAAS,iBAAiB,CACxB,MAAwC;IAExC,OAAO,KAAK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AAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;QAC1E,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;KAC/C,EACD,cAAc,CAAC,KAAK,CAAC,CACtB,CAAC;AACJ,CAAC,CACF,CACF,CAAC;AAEJ,GAAG;KACA,OAAO,CAAC,yBAAyB,EAAE,2CAA2C,CAAC;KAC/E,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;KAClC,MAAM,CACL,iBAAiB,CAAC,KAAK,EAAE,MAAc,EAAE,KAAa,EAAE,KAAyB,EAAE,EAAE;IACnF,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,MAAM,IAAI,WAAW,CAAC,yBAAyB,MAAM,EAAE,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACpF,CAAC;IACD,MAAM,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;AAClE,CAAC,CAAC,CACH,CAAC;AAEJ,GAAG,CAAC,IAAI,EAAE,CAAC;AACX,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AAC5B,GAAG,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IsolationContext } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the directory from which runtime-specific config paths should be
|
|
4
|
+
* resolved. Under level1, this is the isolated homeDir; under level0, it is
|
|
5
|
+
* rootDir (so CLAUDE_CONFIG_DIR / CODEX_HOME still point away from the user's
|
|
6
|
+
* real ~/.claude / ~/.codex — see design doc §9.3).
|
|
7
|
+
*/
|
|
8
|
+
export declare function configRootOf(context: IsolationContext): string;
|
|
9
|
+
//# sourceMappingURL=config-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-root.d.ts","sourceRoot":"","sources":["../../src/isolation/config-root.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the directory from which runtime-specific config paths should be
|
|
3
|
+
* resolved. Under level1, this is the isolated homeDir; under level0, it is
|
|
4
|
+
* rootDir (so CLAUDE_CONFIG_DIR / CODEX_HOME still point away from the user's
|
|
5
|
+
* real ~/.claude / ~/.codex — see design doc §9.3).
|
|
6
|
+
*/
|
|
7
|
+
export function configRootOf(context) {
|
|
8
|
+
return context.homeDir ?? context.rootDir;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=config-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-root.js","sourceRoot":"","sources":["../../src/isolation/config-root.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAAyB;IACpD,OAAO,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/isolation/env.ts"],"names":[],"mappings":"AAOA,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,CAAC,UAAU,EACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASxB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment variables that are safe to forward into an isolated run
|
|
3
|
+
* unchanged (e.g. terminal/locale basics). Everything else is dropped
|
|
4
|
+
* unless a runtime adapter explicitly re-adds something it needs.
|
|
5
|
+
*/
|
|
6
|
+
const ALLOWED_ENV_KEYS = ['PATH', 'LANG', 'LC_ALL', 'TERM', 'TZ'];
|
|
7
|
+
export function buildRestrictedEnv(source, overrides) {
|
|
8
|
+
const restricted = {};
|
|
9
|
+
for (const key of ALLOWED_ENV_KEYS) {
|
|
10
|
+
const value = source[key];
|
|
11
|
+
if (value !== undefined) {
|
|
12
|
+
restricted[key] = value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return { ...restricted, ...overrides };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/isolation/env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAElE,MAAM,UAAU,kBAAkB,CAChC,MAAyB,EACzB,SAAiC;IAEjC,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,SAAS,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Isolation, IsolationContext } from './types.js';
|
|
2
|
+
export declare function createIsolation(strategy: 'level0' | 'level1'): Isolation;
|
|
3
|
+
/**
|
|
4
|
+
* Fail-closed gate: throws if isolation cannot be verified. This is the
|
|
5
|
+
* only place callers should call to get a verified context — never call
|
|
6
|
+
* `isolation.verify()` directly and branch on the result elsewhere.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createVerifiedIsolation(isolation: Isolation, cell: Parameters<Isolation['create']>[0]): Promise<IsolationContext>;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/isolation/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAmB,MAAM,YAAY,CAAC;AAE/E,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAExE;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,GACvC,OAAO,CAAC,gBAAgB,CAAC,CAa3B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EXIT_CODES, YuureiError } from '../cli/exit-codes.js';
|
|
2
|
+
import { Level0Isolation } from './level0.js';
|
|
3
|
+
import { Level1Isolation } from './level1.js';
|
|
4
|
+
export function createIsolation(strategy) {
|
|
5
|
+
return strategy === 'level0' ? new Level0Isolation() : new Level1Isolation();
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Fail-closed gate: throws if isolation cannot be verified. This is the
|
|
9
|
+
* only place callers should call to get a verified context — never call
|
|
10
|
+
* `isolation.verify()` directly and branch on the result elsewhere.
|
|
11
|
+
*/
|
|
12
|
+
export async function createVerifiedIsolation(isolation, cell) {
|
|
13
|
+
const context = await isolation.create(cell);
|
|
14
|
+
const report = await isolation.verify(context);
|
|
15
|
+
if (!report.verified) {
|
|
16
|
+
await isolation.dispose(context);
|
|
17
|
+
throw new YuureiError(`isolation verification failed: ${report.findings.join('; ')}`, EXIT_CODES.ISOLATION_VERIFICATION_FAILED);
|
|
18
|
+
}
|
|
19
|
+
return context;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/isolation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,MAAM,UAAU,eAAe,CAAC,QAA6B;IAC3D,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC,CAAC,IAAI,eAAe,EAAE,CAAC;AAC/E,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,SAAoB,EACpB,IAAwC;IAExC,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAoB,MAAM,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEhE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjC,MAAM,IAAI,WAAW,CACnB,kCAAkC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAC9D,UAAU,CAAC,6BAA6B,CACzC,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ResolvedCell } from '../cell/types.js';
|
|
2
|
+
import type { Isolation, IsolationContext, IsolationReport } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Level 0 isolation: swaps CLI arguments / config-root paths only, no
|
|
5
|
+
* temporary HOME. The narrowest isolation strategy (design doc §9.3).
|
|
6
|
+
*
|
|
7
|
+
* Unlike level1, the operator's real HOME is left untouched in the
|
|
8
|
+
* spawned process's environment — level0 only redirects config-root
|
|
9
|
+
* resolution (e.g. CLAUDE_CONFIG_DIR/CODEX_HOME, set later by the runtime
|
|
10
|
+
* adapter via configRootOf()) rather than sandboxing HOME itself. A
|
|
11
|
+
* runtime, hook, or command that reads $HOME for anything other than its
|
|
12
|
+
* own config root still sees the operator's real home directory under
|
|
13
|
+
* level0 — that is the intended, narrower tradeoff this level makes.
|
|
14
|
+
*/
|
|
15
|
+
export declare class Level0Isolation implements Isolation {
|
|
16
|
+
create(_cell: ResolvedCell): Promise<IsolationContext>;
|
|
17
|
+
verify(context: IsolationContext): Promise<IsolationReport>;
|
|
18
|
+
dispose(context: IsolationContext): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=level0.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"level0.d.ts","sourceRoot":"","sources":["../../src/isolation/level0.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG/E;;;;;;;;;;;GAWG;AACH,qBAAa,eAAgB,YAAW,SAAS;IACzC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAYtD,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAoB3D,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAIxD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { buildRestrictedEnv } from './env.js';
|
|
2
|
+
import { createTempDir, removeTempDir } from './tempdir.js';
|
|
3
|
+
import { pathExists } from '../util/fs.js';
|
|
4
|
+
/**
|
|
5
|
+
* Level 0 isolation: swaps CLI arguments / config-root paths only, no
|
|
6
|
+
* temporary HOME. The narrowest isolation strategy (design doc §9.3).
|
|
7
|
+
*
|
|
8
|
+
* Unlike level1, the operator's real HOME is left untouched in the
|
|
9
|
+
* spawned process's environment — level0 only redirects config-root
|
|
10
|
+
* resolution (e.g. CLAUDE_CONFIG_DIR/CODEX_HOME, set later by the runtime
|
|
11
|
+
* adapter via configRootOf()) rather than sandboxing HOME itself. A
|
|
12
|
+
* runtime, hook, or command that reads $HOME for anything other than its
|
|
13
|
+
* own config root still sees the operator's real home directory under
|
|
14
|
+
* level0 — that is the intended, narrower tradeoff this level makes.
|
|
15
|
+
*/
|
|
16
|
+
export class Level0Isolation {
|
|
17
|
+
async create(_cell) {
|
|
18
|
+
const rootDir = await createTempDir();
|
|
19
|
+
const realHome = process.env['HOME'];
|
|
20
|
+
return {
|
|
21
|
+
strategy: 'level0',
|
|
22
|
+
rootDir,
|
|
23
|
+
homeDir: null,
|
|
24
|
+
env: buildRestrictedEnv(process.env, realHome !== undefined ? { HOME: realHome } : {}),
|
|
25
|
+
keep: false,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async verify(context) {
|
|
29
|
+
const checkedAt = new Date().toISOString();
|
|
30
|
+
const findings = [];
|
|
31
|
+
if (!(await pathExists(context.rootDir))) {
|
|
32
|
+
findings.push(`rootDir does not exist: ${context.rootDir}`);
|
|
33
|
+
}
|
|
34
|
+
if (context.homeDir !== null) {
|
|
35
|
+
findings.push('level0 isolation must not set homeDir');
|
|
36
|
+
}
|
|
37
|
+
const realHome = process.env['HOME'];
|
|
38
|
+
if (realHome !== undefined && context.env['HOME'] !== realHome) {
|
|
39
|
+
findings.push('level0 isolation must leave the real HOME untouched');
|
|
40
|
+
}
|
|
41
|
+
return findings.length === 0
|
|
42
|
+
? { verified: true, strategy: 'level0', checkedAt }
|
|
43
|
+
: { verified: false, strategy: 'level0', checkedAt, findings };
|
|
44
|
+
}
|
|
45
|
+
async dispose(context) {
|
|
46
|
+
if (context.keep)
|
|
47
|
+
return;
|
|
48
|
+
await removeTempDir(context.rootDir);
|
|
49
|
+
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,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC/D,QAAQ,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;QACvE,CAAC;QAED,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC;YAC1B,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE;YACnD,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAyB;QACrC,IAAI,OAAO,CAAC,IAAI;YAAE,OAAO;QACzB,MAAM,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ResolvedCell } from '../cell/types.js';
|
|
2
|
+
import type { Isolation, IsolationContext, IsolationReport } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Level 1 isolation: temporary HOME directory plus a restricted env var
|
|
5
|
+
* set, so runtime adapters that read `$HOME`-relative config never touch
|
|
6
|
+
* the user's real global configuration (design doc §9.3).
|
|
7
|
+
*/
|
|
8
|
+
export declare class Level1Isolation implements Isolation {
|
|
9
|
+
create(_cell: ResolvedCell): Promise<IsolationContext>;
|
|
10
|
+
verify(context: IsolationContext): Promise<IsolationReport>;
|
|
11
|
+
dispose(context: IsolationContext): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=level1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"level1.d.ts","sourceRoot":"","sources":["../../src/isolation/level1.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIrD,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE/E;;;;GAIG;AACH,qBAAa,eAAgB,YAAW,SAAS;IACzC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC;IActD,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IA8B3D,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAIxD"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { mkdir, realpath } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { isPathWithin, pathExists } from '../util/fs.js';
|
|
4
|
+
import { buildRestrictedEnv } from './env.js';
|
|
5
|
+
import { createTempDir, removeTempDir } from './tempdir.js';
|
|
6
|
+
/**
|
|
7
|
+
* Level 1 isolation: temporary HOME directory plus a restricted env var
|
|
8
|
+
* set, so runtime adapters that read `$HOME`-relative config never touch
|
|
9
|
+
* the user's real global configuration (design doc §9.3).
|
|
10
|
+
*/
|
|
11
|
+
export class Level1Isolation {
|
|
12
|
+
async create(_cell) {
|
|
13
|
+
const rootDir = await createTempDir();
|
|
14
|
+
const homeDir = join(rootDir, 'home');
|
|
15
|
+
await mkdir(homeDir, { recursive: true, mode: 0o700 });
|
|
16
|
+
return {
|
|
17
|
+
strategy: 'level1',
|
|
18
|
+
rootDir,
|
|
19
|
+
homeDir,
|
|
20
|
+
env: buildRestrictedEnv(process.env, { HOME: homeDir }),
|
|
21
|
+
keep: false,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
async verify(context) {
|
|
25
|
+
const checkedAt = new Date().toISOString();
|
|
26
|
+
const findings = [];
|
|
27
|
+
if (context.homeDir === null) {
|
|
28
|
+
findings.push('level1 isolation requires a homeDir');
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (!(await pathExists(context.homeDir))) {
|
|
32
|
+
findings.push(`homeDir does not exist: ${context.homeDir}`);
|
|
33
|
+
}
|
|
34
|
+
if (!(await isPathWithin(context.rootDir, context.homeDir))) {
|
|
35
|
+
findings.push(`homeDir ${context.homeDir} is not nested under rootDir ${context.rootDir}`);
|
|
36
|
+
}
|
|
37
|
+
const realHome = process.env['HOME']
|
|
38
|
+
? await realpath(process.env['HOME']).catch(() => null)
|
|
39
|
+
: null;
|
|
40
|
+
const realIsolatedHome = await realpath(context.homeDir).catch(() => null);
|
|
41
|
+
if (realHome !== null && realIsolatedHome === realHome) {
|
|
42
|
+
findings.push('isolated homeDir resolves to the real user HOME');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (context.env['HOME'] !== context.homeDir) {
|
|
46
|
+
findings.push('env.HOME does not match the isolated homeDir');
|
|
47
|
+
}
|
|
48
|
+
return findings.length === 0
|
|
49
|
+
? { verified: true, strategy: 'level1', checkedAt }
|
|
50
|
+
: { verified: false, strategy: 'level1', checkedAt, findings };
|
|
51
|
+
}
|
|
52
|
+
async dispose(context) {
|
|
53
|
+
if (context.keep)
|
|
54
|
+
return;
|
|
55
|
+
await removeTempDir(context.rootDir);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=level1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"level1.js","sourceRoot":"","sources":["../../src/isolation/level1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG5D;;;;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