runcastle 1.0.5 → 1.0.6
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/bin/runcastle.js +16 -6
- package/index.js +13 -5
- package/package.json +1 -1
package/bin/runcastle.js
CHANGED
|
@@ -62,6 +62,9 @@ var init_paths = () => {};
|
|
|
62
62
|
|
|
63
63
|
// ../core/src/config.ts
|
|
64
64
|
import * as z from "zod";
|
|
65
|
+
function resolveSandboxImage(config) {
|
|
66
|
+
return config.sandboxImage ?? DEFAULT_SANDBOX_IMAGE;
|
|
67
|
+
}
|
|
65
68
|
function resolveModel(step, config, project, runOverride) {
|
|
66
69
|
return runOverride ?? config.stepModels[step] ?? project?.model ?? config.model;
|
|
67
70
|
}
|
|
@@ -77,7 +80,7 @@ var MODEL_STEPS, ModelStep, DEFAULT_SMOKE_MODEL = "claude-haiku-4-5-20251001", f
|
|
|
77
80
|
}
|
|
78
81
|
delete obj.smokeModel;
|
|
79
82
|
return obj;
|
|
80
|
-
}, RuncastleConfig;
|
|
83
|
+
}, RuncastleConfig, DEFAULT_SANDBOX_IMAGE = "sandcastle:runcastle";
|
|
81
84
|
var init_config = __esm(() => {
|
|
82
85
|
MODEL_STEPS = [
|
|
83
86
|
"ideation",
|
|
@@ -2756,7 +2759,7 @@ function buildBurnAgent(config2, token, model) {
|
|
|
2756
2759
|
return agent;
|
|
2757
2760
|
}
|
|
2758
2761
|
function selectSandbox(config2) {
|
|
2759
|
-
const imageOpts =
|
|
2762
|
+
const imageOpts = { imageName: resolveSandboxImage(config2) };
|
|
2760
2763
|
switch (config2.sandbox) {
|
|
2761
2764
|
case "docker":
|
|
2762
2765
|
return docker(imageOpts);
|
|
@@ -2948,7 +2951,7 @@ async function realExecuteResearchRun(ctx, waypoint, config2, token, model) {
|
|
|
2948
2951
|
const throttle = createResearchStreamThrottle((e) => ctx.emitEvent(e));
|
|
2949
2952
|
const runOptions = {
|
|
2950
2953
|
agent: buildBurnAgent(config2, token, model),
|
|
2951
|
-
sandbox: config2.sandbox === "docker" ? docker2(
|
|
2954
|
+
sandbox: config2.sandbox === "docker" ? docker2({ imageName: resolveSandboxImage(config2) }) : noSandbox2(),
|
|
2952
2955
|
cwd: project.repoPath,
|
|
2953
2956
|
prompt,
|
|
2954
2957
|
branchStrategy: { type: "branch", branch: tempBranch, baseBranch: feature.branch },
|
|
@@ -4996,7 +4999,7 @@ function afkTokenProbe(env) {
|
|
|
4996
4999
|
async function runDoctor(env) {
|
|
4997
5000
|
const { exec } = env;
|
|
4998
5001
|
const processEnv = env.env ?? process.env;
|
|
4999
|
-
const imageName = env.imageName ??
|
|
5002
|
+
const imageName = env.imageName ?? DEFAULT_SANDBOX_IMAGE;
|
|
5000
5003
|
const results = [
|
|
5001
5004
|
await bunProbe(exec),
|
|
5002
5005
|
await nodeProbe(exec),
|
|
@@ -5018,6 +5021,9 @@ function exitCodeFor(report, mode) {
|
|
|
5018
5021
|
return report.tier1Ok ? 0 : 1;
|
|
5019
5022
|
return report.ok ? 0 : 1;
|
|
5020
5023
|
}
|
|
5024
|
+
var init_doctor = __esm(() => {
|
|
5025
|
+
init_src();
|
|
5026
|
+
});
|
|
5021
5027
|
|
|
5022
5028
|
// src/doctor/system-exec.ts
|
|
5023
5029
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -5201,6 +5207,7 @@ function fileAfkTokenIo(exec) {
|
|
|
5201
5207
|
var AFK_TOKEN_KEY = "CLAUDE_CODE_OAUTH_TOKEN";
|
|
5202
5208
|
var init_setup = __esm(() => {
|
|
5203
5209
|
init_paths();
|
|
5210
|
+
init_doctor();
|
|
5204
5211
|
init_errors();
|
|
5205
5212
|
init_asset_paths();
|
|
5206
5213
|
});
|
|
@@ -5210,6 +5217,7 @@ import * as z11 from "zod";
|
|
|
5210
5217
|
var setupRouter;
|
|
5211
5218
|
var init_setup2 = __esm(() => {
|
|
5212
5219
|
init_src();
|
|
5220
|
+
init_doctor();
|
|
5213
5221
|
init_system_exec();
|
|
5214
5222
|
init_registry();
|
|
5215
5223
|
init_setup();
|
|
@@ -5227,7 +5235,7 @@ var init_setup2 = __esm(() => {
|
|
|
5227
5235
|
const exec = createSystemExec();
|
|
5228
5236
|
const preferred = ctx.config.sandbox === "podman" ? "podman" : "docker";
|
|
5229
5237
|
const runtime = await resolveRuntime(exec, preferred);
|
|
5230
|
-
const imageName = ctx.config
|
|
5238
|
+
const imageName = resolveSandboxImage(ctx.config);
|
|
5231
5239
|
const sandcastleBin = input.kind === "build-image" ? resolveSandcastleBin() ?? undefined : undefined;
|
|
5232
5240
|
const spec = terminalSpec(input.kind, { runtime, imageName, sandcastleBin });
|
|
5233
5241
|
const sessionId = newId("setup");
|
|
@@ -5585,7 +5593,7 @@ function envWithToken() {
|
|
|
5585
5593
|
function resolveDoctorEnv() {
|
|
5586
5594
|
let imageName;
|
|
5587
5595
|
try {
|
|
5588
|
-
imageName = loadConfig()
|
|
5596
|
+
imageName = resolveSandboxImage(loadConfig());
|
|
5589
5597
|
} catch {
|
|
5590
5598
|
imageName = undefined;
|
|
5591
5599
|
}
|
|
@@ -5604,9 +5612,11 @@ async function runCli(argv, log = console.log) {
|
|
|
5604
5612
|
return exitCodeFor(report, mode);
|
|
5605
5613
|
}
|
|
5606
5614
|
var init_cli = __esm(() => {
|
|
5615
|
+
init_src();
|
|
5607
5616
|
init_paths();
|
|
5608
5617
|
init_config_load();
|
|
5609
5618
|
init_ticket_burner();
|
|
5619
|
+
init_doctor();
|
|
5610
5620
|
init_report();
|
|
5611
5621
|
init_system_exec();
|
|
5612
5622
|
if (false) {}
|
package/index.js
CHANGED
|
@@ -61,6 +61,9 @@ var init_paths = () => {};
|
|
|
61
61
|
|
|
62
62
|
// ../core/src/config.ts
|
|
63
63
|
import * as z from "zod";
|
|
64
|
+
function resolveSandboxImage(config) {
|
|
65
|
+
return config.sandboxImage ?? DEFAULT_SANDBOX_IMAGE;
|
|
66
|
+
}
|
|
64
67
|
function resolveModel(step, config, project, runOverride) {
|
|
65
68
|
return runOverride ?? config.stepModels[step] ?? project?.model ?? config.model;
|
|
66
69
|
}
|
|
@@ -76,7 +79,7 @@ var MODEL_STEPS, ModelStep, DEFAULT_SMOKE_MODEL = "claude-haiku-4-5-20251001", f
|
|
|
76
79
|
}
|
|
77
80
|
delete obj.smokeModel;
|
|
78
81
|
return obj;
|
|
79
|
-
}, RuncastleConfig;
|
|
82
|
+
}, RuncastleConfig, DEFAULT_SANDBOX_IMAGE = "sandcastle:runcastle";
|
|
80
83
|
var init_config = __esm(() => {
|
|
81
84
|
MODEL_STEPS = [
|
|
82
85
|
"ideation",
|
|
@@ -2755,7 +2758,7 @@ function buildBurnAgent(config2, token, model) {
|
|
|
2755
2758
|
return agent;
|
|
2756
2759
|
}
|
|
2757
2760
|
function selectSandbox(config2) {
|
|
2758
|
-
const imageOpts =
|
|
2761
|
+
const imageOpts = { imageName: resolveSandboxImage(config2) };
|
|
2759
2762
|
switch (config2.sandbox) {
|
|
2760
2763
|
case "docker":
|
|
2761
2764
|
return docker(imageOpts);
|
|
@@ -2947,7 +2950,7 @@ async function realExecuteResearchRun(ctx, waypoint, config2, token, model) {
|
|
|
2947
2950
|
const throttle = createResearchStreamThrottle((e) => ctx.emitEvent(e));
|
|
2948
2951
|
const runOptions = {
|
|
2949
2952
|
agent: buildBurnAgent(config2, token, model),
|
|
2950
|
-
sandbox: config2.sandbox === "docker" ? docker2(
|
|
2953
|
+
sandbox: config2.sandbox === "docker" ? docker2({ imageName: resolveSandboxImage(config2) }) : noSandbox2(),
|
|
2951
2954
|
cwd: project.repoPath,
|
|
2952
2955
|
prompt,
|
|
2953
2956
|
branchStrategy: { type: "branch", branch: tempBranch, baseBranch: feature.branch },
|
|
@@ -4995,7 +4998,7 @@ function afkTokenProbe(env) {
|
|
|
4995
4998
|
async function runDoctor(env) {
|
|
4996
4999
|
const { exec } = env;
|
|
4997
5000
|
const processEnv = env.env ?? process.env;
|
|
4998
|
-
const imageName = env.imageName ??
|
|
5001
|
+
const imageName = env.imageName ?? DEFAULT_SANDBOX_IMAGE;
|
|
4999
5002
|
const results = [
|
|
5000
5003
|
await bunProbe(exec),
|
|
5001
5004
|
await nodeProbe(exec),
|
|
@@ -5017,6 +5020,9 @@ function exitCodeFor(report, mode) {
|
|
|
5017
5020
|
return report.tier1Ok ? 0 : 1;
|
|
5018
5021
|
return report.ok ? 0 : 1;
|
|
5019
5022
|
}
|
|
5023
|
+
var init_doctor = __esm(() => {
|
|
5024
|
+
init_src();
|
|
5025
|
+
});
|
|
5020
5026
|
|
|
5021
5027
|
// src/doctor/system-exec.ts
|
|
5022
5028
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -5200,6 +5206,7 @@ function fileAfkTokenIo(exec) {
|
|
|
5200
5206
|
var AFK_TOKEN_KEY = "CLAUDE_CODE_OAUTH_TOKEN";
|
|
5201
5207
|
var init_setup = __esm(() => {
|
|
5202
5208
|
init_paths();
|
|
5209
|
+
init_doctor();
|
|
5203
5210
|
init_errors();
|
|
5204
5211
|
init_asset_paths();
|
|
5205
5212
|
});
|
|
@@ -5209,6 +5216,7 @@ import * as z11 from "zod";
|
|
|
5209
5216
|
var setupRouter;
|
|
5210
5217
|
var init_setup2 = __esm(() => {
|
|
5211
5218
|
init_src();
|
|
5219
|
+
init_doctor();
|
|
5212
5220
|
init_system_exec();
|
|
5213
5221
|
init_registry();
|
|
5214
5222
|
init_setup();
|
|
@@ -5226,7 +5234,7 @@ var init_setup2 = __esm(() => {
|
|
|
5226
5234
|
const exec = createSystemExec();
|
|
5227
5235
|
const preferred = ctx.config.sandbox === "podman" ? "podman" : "docker";
|
|
5228
5236
|
const runtime = await resolveRuntime(exec, preferred);
|
|
5229
|
-
const imageName = ctx.config
|
|
5237
|
+
const imageName = resolveSandboxImage(ctx.config);
|
|
5230
5238
|
const sandcastleBin = input.kind === "build-image" ? resolveSandcastleBin() ?? undefined : undefined;
|
|
5231
5239
|
const spec = terminalSpec(input.kind, { runtime, imageName, sandcastleBin });
|
|
5232
5240
|
const sessionId = newId("setup");
|