runcastle 1.3.2 → 1.3.3

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/index.js CHANGED
@@ -1017,7 +1017,8 @@ var init_client = __esm(() => {
1017
1017
 
1018
1018
  // src/launcher/asset-paths.ts
1019
1019
  import { existsSync as existsSync2 } from "fs";
1020
- import { join as join3, resolve as resolve2 } from "path";
1020
+ import { dirname, join as join3, resolve as resolve2 } from "path";
1021
+ import { fileURLToPath } from "url";
1021
1022
  function resolveAsset(envVar, fallback) {
1022
1023
  const override = process.env[envVar];
1023
1024
  if (override) {
@@ -1038,6 +1039,17 @@ function vendoredAssetPaths(pkgRoot) {
1038
1039
  [ASSET_ENV.sandcastleTemplate]: join3(pkgRoot, "sandcastle-template")
1039
1040
  };
1040
1041
  }
1042
+ function sandcastleTemplateFallback(moduleDir) {
1043
+ const inSource = join3(moduleDir, "..", "assets", "sandcastle");
1044
+ const installed = [moduleDir, dirname(moduleDir)].map((pkgRoot) => vendoredAssetPaths(pkgRoot)[ASSET_ENV.sandcastleTemplate]);
1045
+ return [inSource, ...installed].find((dir) => existsSync2(dir)) ?? inSource;
1046
+ }
1047
+ function sandcastleTemplateDir() {
1048
+ return resolveAsset(ASSET_ENV.sandcastleTemplate, sandcastleTemplateFallback(dirname(fileURLToPath(import.meta.url))));
1049
+ }
1050
+ function burnerDockerfilePath() {
1051
+ return join3(sandcastleTemplateDir(), "Dockerfile");
1052
+ }
1041
1053
  function applyInstalledAssetEnv(pkgRoot) {
1042
1054
  for (const [envVar, path] of Object.entries(vendoredAssetPaths(pkgRoot))) {
1043
1055
  if (process.env[envVar] === undefined && existsSync2(path))
@@ -1235,7 +1247,7 @@ var init_kill_tree = () => {};
1235
1247
  import { spawn as spawn2 } from "child_process";
1236
1248
  import { createRequire } from "module";
1237
1249
  import { existsSync as existsSync4 } from "fs";
1238
- import { fileURLToPath } from "url";
1250
+ import { fileURLToPath as fileURLToPath2 } from "url";
1239
1251
  function isBun() {
1240
1252
  return typeof globalThis.Bun !== "undefined";
1241
1253
  }
@@ -1428,7 +1440,7 @@ var init_pty_sidecar = __esm(() => {
1428
1440
  init_asset_paths();
1429
1441
  init_resolve_executable();
1430
1442
  init_kill_tree();
1431
- HOST_PATH = resolveAsset(ASSET_ENV.ptyHost, fileURLToPath(new URL("./pty-host.cjs", import.meta.url)));
1443
+ HOST_PATH = resolveAsset(ASSET_ENV.ptyHost, fileURLToPath2(new URL("./pty-host.cjs", import.meta.url)));
1432
1444
  });
1433
1445
 
1434
1446
  // src/pty/pty.ts
@@ -2905,7 +2917,7 @@ import {
2905
2917
  writeFileSync
2906
2918
  } from "fs";
2907
2919
  import { tmpdir } from "os";
2908
- import { dirname, join as join6, resolve as resolve4 } from "path";
2920
+ import { dirname as dirname2, join as join6, resolve as resolve4 } from "path";
2909
2921
  import { simpleGit } from "simple-git";
2910
2922
  function deriveDriveState(info) {
2911
2923
  if (!info)
@@ -3067,7 +3079,7 @@ async function ensureTalkWorktree(project, feature) {
3067
3079
  return addWorktree(g, worktreePath, branch, "talk worktree");
3068
3080
  }
3069
3081
  async function addWorktree(g, worktreePath, branch, label) {
3070
- mkdirSync2(dirname(worktreePath), { recursive: true });
3082
+ mkdirSync2(dirname2(worktreePath), { recursive: true });
3071
3083
  try {
3072
3084
  await g.raw(["worktree", "add", worktreePath, branch]);
3073
3085
  return worktreePath;
@@ -3274,7 +3286,7 @@ async function excludeFilePath(repoPath) {
3274
3286
  }
3275
3287
  async function excludePath(repoPath, pattern) {
3276
3288
  const file = await excludeFilePath(repoPath);
3277
- mkdirSync2(dirname(file), { recursive: true });
3289
+ mkdirSync2(dirname2(file), { recursive: true });
3278
3290
  const current = existsSync6(file) ? readFileSync3(file, "utf8") : "";
3279
3291
  if (current.split(/\r?\n/).includes(pattern))
3280
3292
  return;
@@ -4278,10 +4290,10 @@ var init_skills = __esm(() => {
4278
4290
 
4279
4291
  // src/launcher/artifacts.ts
4280
4292
  import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync2 } from "fs";
4281
- import { fileURLToPath as fileURLToPath2 } from "url";
4293
+ import { fileURLToPath as fileURLToPath3 } from "url";
4282
4294
  import { join as join7 } from "path";
4283
4295
  function hookClientPath() {
4284
- return resolveAsset(ASSET_ENV.hookClient, fileURLToPath2(new URL("./hook-client.ts", import.meta.url)));
4296
+ return resolveAsset(ASSET_ENV.hookClient, fileURLToPath3(new URL("./hook-client.ts", import.meta.url)));
4285
4297
  }
4286
4298
  function serverUrlFor(config2) {
4287
4299
  return `http://localhost:${config2.serverPort}`;
@@ -4877,8 +4889,8 @@ var init_artifacts = __esm(() => {
4877
4889
 
4878
4890
  // src/launcher/skills-root.ts
4879
4891
  import { existsSync as existsSync7 } from "fs";
4880
- import { dirname as dirname2, join as join8, resolve as resolve6 } from "path";
4881
- import { fileURLToPath as fileURLToPath3 } from "url";
4892
+ import { dirname as dirname3, join as join8, resolve as resolve6 } from "path";
4893
+ import { fileURLToPath as fileURLToPath4 } from "url";
4882
4894
  function resolveSkillsRoot(fromDir) {
4883
4895
  const override = process.env[SKILLS_DIR_ENV];
4884
4896
  if (override) {
@@ -4894,7 +4906,7 @@ function resolveSkillsRoot(fromDir) {
4894
4906
  searched.push(candidate);
4895
4907
  if (existsSync7(join8(candidate, SKILLS_MARKER)))
4896
4908
  return candidate;
4897
- const parent = dirname2(dir);
4909
+ const parent = dirname3(dir);
4898
4910
  if (parent === dir)
4899
4911
  break;
4900
4912
  dir = parent;
@@ -4903,7 +4915,7 @@ function resolveSkillsRoot(fromDir) {
4903
4915
  ${searched.join(`
4904
4916
  `)}`);
4905
4917
  }
4906
- function resolvePluginDir(fromDir = dirname2(fileURLToPath3(import.meta.url))) {
4918
+ function resolvePluginDir(fromDir = dirname3(fileURLToPath4(import.meta.url))) {
4907
4919
  const rel = join8("packages", "skills", "packs", "runcastle");
4908
4920
  const override = process.env[SKILLS_DIR_ENV];
4909
4921
  if (override) {
@@ -4919,7 +4931,7 @@ function resolvePluginDir(fromDir = dirname2(fileURLToPath3(import.meta.url))) {
4919
4931
  searched.push(candidate);
4920
4932
  if (existsSync7(candidate))
4921
4933
  return candidate;
4922
- const parent = dirname2(dir);
4934
+ const parent = dirname3(dir);
4923
4935
  if (parent === dir)
4924
4936
  break;
4925
4937
  dir = parent;
@@ -5031,7 +5043,6 @@ var init_codex_auth = () => {};
5031
5043
 
5032
5044
  // src/doctor/doctor.ts
5033
5045
  import { existsSync as existsSync9, statSync } from "fs";
5034
- import { fileURLToPath as fileURLToPath4 } from "url";
5035
5046
  async function versionProbe(exec, id, label, bin, fix) {
5036
5047
  const out = await exec(bin, ["--version"]);
5037
5048
  if (out.ok && out.code === 0) {
@@ -5287,7 +5298,7 @@ async function runDoctor(env) {
5287
5298
  const { exec } = env;
5288
5299
  const processEnv = env.env ?? process.env;
5289
5300
  const imageName = env.imageName ?? DEFAULT_SANDBOX_IMAGE;
5290
- const burnerDockerfile = env.burnerDockerfile ?? fileURLToPath4(new URL("../assets/sandcastle/Dockerfile", import.meta.url));
5301
+ const burnerDockerfile = env.burnerDockerfile ?? burnerDockerfilePath();
5291
5302
  const fileMtime = env.fileMtime ?? ((path) => statSync(path).mtime);
5292
5303
  const required = new Set(env.runtimes ?? [DEFAULT_RUNTIME]);
5293
5304
  const results = [
@@ -5319,6 +5330,7 @@ function exitCodeFor(report, mode) {
5319
5330
  var RUNTIME_SPECS;
5320
5331
  var init_doctor = __esm(() => {
5321
5332
  init_src();
5333
+ init_asset_paths();
5322
5334
  init_codex_auth();
5323
5335
  RUNTIME_SPECS = {
5324
5336
  "claude-code": {
@@ -5363,7 +5375,7 @@ import {
5363
5375
  statSync as statSync2,
5364
5376
  writeFileSync as writeFileSync3
5365
5377
  } from "fs";
5366
- import { basename, dirname as dirname3, join as join10, resolve as resolve7 } from "path";
5378
+ import { basename, dirname as dirname4, join as join10, resolve as resolve7 } from "path";
5367
5379
  function codexHomeDir2(sessionId) {
5368
5380
  return join10(sessionDir(sessionId), "codex-home");
5369
5381
  }
@@ -5413,7 +5425,7 @@ function mcpServerTables(userConfigToml) {
5413
5425
  `).trim();
5414
5426
  }
5415
5427
  function readInheritedMcpServers(env = process.env) {
5416
- const path = join10(dirname3(realCodexAuthFile(env)), "config.toml");
5428
+ const path = join10(dirname4(realCodexAuthFile(env)), "config.toml");
5417
5429
  if (!existsSync10(path))
5418
5430
  return "";
5419
5431
  try {
@@ -5485,8 +5497,8 @@ function gitInfoDir(worktreePath) {
5485
5497
  if (!named)
5486
5498
  return null;
5487
5499
  const gitDir = resolve7(worktreePath, named[1].trim());
5488
- const parent = dirname3(gitDir);
5489
- return basename(parent) === "worktrees" ? join10(dirname3(parent), "info") : join10(gitDir, "info");
5500
+ const parent = dirname4(gitDir);
5501
+ return basename(parent) === "worktrees" ? join10(dirname4(parent), "info") : join10(gitDir, "info");
5490
5502
  }
5491
5503
  function buildCodexArgs(input) {
5492
5504
  return [
@@ -6805,7 +6817,7 @@ var init_chunk_NGBM7T3E = __esm(() => {
6805
6817
  // ../../node_modules/.bun/@ai-hero+sandcastle@0.12.0/node_modules/@ai-hero/sandcastle/dist/chunk-VOG34SRF.js
6806
6818
  import { createRequire as createRequire4 } from "module";
6807
6819
  import * as clack from "@clack/prompts";
6808
- import { join as join$1, basename as basename2, dirname as dirname4, resolve as resolve9, posix as posix2, normalize, isAbsolute as isAbsolute2 } from "path";
6820
+ import { join as join$1, basename as basename2, dirname as dirname5, resolve as resolve9, posix as posix2, normalize, isAbsolute as isAbsolute2 } from "path";
6809
6821
  import { styleText, promisify } from "util";
6810
6822
  import { existsSync as existsSync13, statSync as statSync5 } from "fs";
6811
6823
  import { tmpdir as tmpdir2, homedir as homedir3 } from "os";
@@ -17947,7 +17959,7 @@ ${e instanceof Error ? e.message : String(e)}`
17947
17959
  const hostFilePath = join$1(untrackedDir, relPath);
17948
17960
  yield* Effect_exports.tryPromise({
17949
17961
  try: async () => {
17950
- await mkdir(dirname4(hostFilePath), { recursive: true });
17962
+ await mkdir(dirname5(hostFilePath), { recursive: true });
17951
17963
  await handle.copyFileOut(sandboxFilePath, hostFilePath);
17952
17964
  },
17953
17965
  catch: (e) => new SyncError({
@@ -17979,7 +17991,7 @@ ${e instanceof Error ? e.message : String(e)}`
17979
17991
  for (const relPath of untrackedFiles) {
17980
17992
  const srcPath = join$1(untrackedDir, relPath);
17981
17993
  const destPath = join$1(hostRepoDir, relPath);
17982
- await mkdir(dirname4(destPath), { recursive: true });
17994
+ await mkdir(dirname5(destPath), { recursive: true });
17983
17995
  const content = await readFile(srcPath);
17984
17996
  await writeFile(destPath, content);
17985
17997
  }
@@ -18630,7 +18642,7 @@ Worktree removed (no uncommitted changes)`);
18630
18642
  }
18631
18643
  if (!isFile2)
18632
18644
  continue;
18633
- const parentDir = dirname4(mount.sandboxPath);
18645
+ const parentDir = dirname5(mount.sandboxPath);
18634
18646
  if (parentDir === sandboxHomedir)
18635
18647
  continue;
18636
18648
  if (!parentDir.startsWith(sandboxHomedir + "/")) {
@@ -29898,7 +29910,7 @@ ${this.stack.split(`
29898
29910
  FileDisplay = {
29899
29911
  layer: (filePath) => Layer_exports.effect(Display, Effect_exports.gen(function* () {
29900
29912
  const fs = yield* FileSystem_exports.FileSystem;
29901
- yield* fs.makeDirectory(dirname4(filePath), { recursive: true }).pipe(Effect_exports.orDie);
29913
+ yield* fs.makeDirectory(dirname5(filePath), { recursive: true }).pipe(Effect_exports.orDie);
29902
29914
  const delimiter = `
29903
29915
  --- Run started: ${(/* @__PURE__ */ new Date()).toISOString()} ---
29904
29916
  `;
@@ -53369,7 +53381,7 @@ var init_chunk_62WN33RK = __esm(() => {
53369
53381
  // ../../node_modules/.bun/@ai-hero+sandcastle@0.12.0/node_modules/@ai-hero/sandcastle/dist/index.js
53370
53382
  import { createRequire as createRequire8 } from "module";
53371
53383
  import { mkdirSync as mkdirSync6, appendFileSync } from "fs";
53372
- import path, { join as join14, posix as posix4, dirname as dirname6, relative as relative3 } from "path";
53384
+ import path, { join as join14, posix as posix4, dirname as dirname7, relative as relative3 } from "path";
53373
53385
  import { styleText as styleText2 } from "util";
53374
53386
  import * as clack2 from "@clack/prompts";
53375
53387
  import { readdir as readdir2, access as access3, readFile as readFile3, mkdir as mkdir3, writeFile as writeFile3, rm as rm3 } from "fs/promises";
@@ -54476,7 +54488,7 @@ Emit only a corrected <${error.tag}> block. Do not change files or run commands.
54476
54488
  }) => {
54477
54489
  const jsonl = await readSandboxFile(handle, sourcePath, tag);
54478
54490
  const rewritten = transferClaudeSession(jsonl, fromCwd, toCwd);
54479
- await mkdir3(dirname6(destPath), { recursive: true });
54491
+ await mkdir3(dirname7(destPath), { recursive: true });
54480
54492
  await writeFile3(destPath, rewritten);
54481
54493
  }, makeClaudeSessionStorage = (options) => {
54482
54494
  const hostProjectsDir = options?.sessionStorage?.hostProjectsDir;
@@ -54547,7 +54559,7 @@ Emit only a corrected <${error.tag}> block. Do not change files or run commands.
54547
54559
  const rewritten = transferCodexSession(jsonl, sandboxCwd, hostCwd);
54548
54560
  const root = hostSessionsDir ?? join14(process.env.HOME ?? "~", ".codex", "sessions");
54549
54561
  const target = join14(root, located.relativePath);
54550
- await mkdir3(dirname6(target), { recursive: true });
54562
+ await mkdir3(dirname7(target), { recursive: true });
54551
54563
  await writeFile3(target, rewritten);
54552
54564
  capturedPaths.set(sessionId, target);
54553
54565
  },
@@ -54753,7 +54765,7 @@ var init_dist = __esm(() => {
54753
54765
 
54754
54766
  // src/services/settings.ts
54755
54767
  import { existsSync as existsSync14, mkdirSync as mkdirSync7, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "fs";
54756
- import { dirname as dirname7 } from "path";
54768
+ import { dirname as dirname8 } from "path";
54757
54769
  import * as z3 from "zod";
54758
54770
  import { eq as eq9 } from "drizzle-orm";
54759
54771
  function hostDefaults(logicalCpus) {
@@ -54906,7 +54918,7 @@ function describeValue(value) {
54906
54918
  function writeGlobal(configFile, configKey, value) {
54907
54919
  const raw = readRawConfig(configFile);
54908
54920
  raw[configKey] = value;
54909
- mkdirSync7(dirname7(configFile), { recursive: true });
54921
+ mkdirSync7(dirname8(configFile), { recursive: true });
54910
54922
  writeFileSync5(configFile, `${JSON.stringify(raw, null, 2)}
54911
54923
  `);
54912
54924
  }
@@ -54945,7 +54957,7 @@ function writeStepModel(configFile, step4, value) {
54945
54957
  else
54946
54958
  stepModels[step4] = value;
54947
54959
  raw.stepModels = stepModels;
54948
- mkdirSync7(dirname7(configFile), { recursive: true });
54960
+ mkdirSync7(dirname8(configFile), { recursive: true });
54949
54961
  writeFileSync5(configFile, `${JSON.stringify(raw, null, 2)}
54950
54962
  `);
54951
54963
  }
@@ -55124,7 +55136,7 @@ var init_settings = __esm(() => {
55124
55136
 
55125
55137
  // src/services/setup.ts
55126
55138
  import { copyFileSync as copyFileSync2, existsSync as existsSync15, mkdirSync as mkdirSync8, readFileSync as readFileSync7, readdirSync as readdirSync4, writeFileSync as writeFileSync6 } from "fs";
55127
- import { dirname as dirname8, join as join15 } from "path";
55139
+ import { dirname as dirname9, join as join15 } from "path";
55128
55140
  import { fileURLToPath as fileURLToPath6 } from "url";
55129
55141
  async function writeGitIdentity(exec3, identity4) {
55130
55142
  const name = identity4.name.trim();
@@ -55228,7 +55240,7 @@ async function resolveRuntime(exec3, preferred) {
55228
55240
  function resolveSandcastleBin() {
55229
55241
  try {
55230
55242
  const mainUrl = import.meta.resolve("@ai-hero/sandcastle");
55231
- let dir = dirname8(fileURLToPath6(mainUrl));
55243
+ let dir = dirname9(fileURLToPath6(mainUrl));
55232
55244
  for (let hops = 0;hops < 6; hops++) {
55233
55245
  const manifestPath = join15(dir, "package.json");
55234
55246
  if (existsSync15(manifestPath)) {
@@ -55237,7 +55249,7 @@ function resolveSandcastleBin() {
55237
55249
  return join15(dir, manifest.bin.sandcastle);
55238
55250
  }
55239
55251
  }
55240
- const parent = dirname8(dir);
55252
+ const parent = dirname9(dir);
55241
55253
  if (parent === dir)
55242
55254
  break;
55243
55255
  dir = parent;
@@ -55262,9 +55274,6 @@ function terminalSpec(kind, opts) {
55262
55274
  args: [opts.sandcastleBin, opts.runtime, "build-image", "--image-name", opts.imageName]
55263
55275
  };
55264
55276
  }
55265
- function sandcastleTemplateDir() {
55266
- return resolveAsset(ASSET_ENV.sandcastleTemplate, fileURLToPath6(new URL("../assets/sandcastle", import.meta.url)));
55267
- }
55268
55277
  function refreshSandcastleConfig(templateDir, targetDir) {
55269
55278
  const dir = join15(targetDir, ".sandcastle");
55270
55279
  mkdirSync8(dir, { recursive: true });
@@ -55313,7 +55322,7 @@ function fileAfkTokenIo(exec3, runtime5 = DEFAULT_RUNTIME) {
55313
55322
  return {
55314
55323
  read: () => existsSync15(path2) ? readFileSync7(path2, "utf8") : "",
55315
55324
  write: (content) => {
55316
- mkdirSync8(dirname8(path2), { recursive: true });
55325
+ mkdirSync8(dirname9(path2), { recursive: true });
55317
55326
  writeFileSync6(path2, content, "utf8");
55318
55327
  },
55319
55328
  verify: createCredentialVerifier(exec3, runtime5)
@@ -56300,7 +56309,7 @@ var init_podman = __esm(() => {
56300
56309
 
56301
56310
  // src/workflows/ticket-burner.ts
56302
56311
  import { existsSync as existsSync17, mkdirSync as mkdirSync10, readFileSync as readFileSync9, readdirSync as readdirSync5, rmSync as rmSync3 } from "fs";
56303
- import { dirname as dirname9, join as join17, posix as posixPath, win32 as winPath } from "path";
56312
+ import { dirname as dirname10, join as join17, posix as posixPath, win32 as winPath } from "path";
56304
56313
  import { fileURLToPath as fileURLToPath7 } from "url";
56305
56314
  function missingImageRuntimeMessage(runtime5, image) {
56306
56315
  const binary = RUNTIME_BINARY[runtime5];
@@ -57402,7 +57411,7 @@ function resolverTemplatePath() {
57402
57411
  return burnerAssetPath("resolve-conflict.md");
57403
57412
  }
57404
57413
  function burnerAssetPath(file) {
57405
- const here = dirname9(fileURLToPath7(import.meta.url));
57414
+ const here = dirname10(fileURLToPath7(import.meta.url));
57406
57415
  return join17(resolveSkillsRoot(here), "burner", file);
57407
57416
  }
57408
57417
  function listFeatureDocs(docsDir, prefix = "") {
@@ -58244,7 +58253,7 @@ var init_ticket_burner = __esm(() => {
58244
58253
 
58245
58254
  // src/workflows/research.ts
58246
58255
  import { mkdirSync as mkdirSync11, readFileSync as readFileSync10 } from "fs";
58247
- import { dirname as dirname10, join as join18 } from "path";
58256
+ import { dirname as dirname11, join as join18 } from "path";
58248
58257
  import { fileURLToPath as fileURLToPath8 } from "url";
58249
58258
  function waypointSlug(waypoint) {
58250
58259
  const base = waypoint.title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
@@ -58312,7 +58321,7 @@ function interpretResearchResult(result, docRelPath) {
58312
58321
  return { status: "failed", error: "agent produced no commits \u2014 no research summary landed" };
58313
58322
  }
58314
58323
  function researchTemplatePath() {
58315
- const here = dirname10(fileURLToPath8(import.meta.url));
58324
+ const here = dirname11(fileURLToPath8(import.meta.url));
58316
58325
  return join18(resolveSkillsRoot(here), "burner", "research-waypoint.md");
58317
58326
  }
58318
58327
  async function realExecuteResearchRun(ctx, waypoint, config2, token, model) {
@@ -59103,7 +59112,7 @@ var init_features = __esm(() => {
59103
59112
 
59104
59113
  // src/services/test-notes.ts
59105
59114
  import { existsSync as existsSync19, mkdirSync as mkdirSync12, rmSync as rmSync5, writeFileSync as writeFileSync8 } from "fs";
59106
- import { dirname as dirname11 } from "path";
59115
+ import { dirname as dirname12 } from "path";
59107
59116
  import { and as and9, asc as asc5, eq as eq12, lt } from "drizzle-orm";
59108
59117
  function rowToNote(row) {
59109
59118
  return TestNote.parse({
@@ -59359,7 +59368,7 @@ function renderTestNotes(ctx, feature) {
59359
59368
  lines.push(noteLine(ctx, note2));
59360
59369
  }
59361
59370
  const path2 = featureDocPath(projectForFeature(ctx, feature), feature, "test-notes.md");
59362
- mkdirSync12(dirname11(path2), { recursive: true });
59371
+ mkdirSync12(dirname12(path2), { recursive: true });
59363
59372
  writeFileSync8(path2, `${lines.join(`
59364
59373
  `)}
59365
59374
  `, "utf8");
@@ -60935,12 +60944,12 @@ var init_web = __esm(() => {
60935
60944
 
60936
60945
  // src/version.ts
60937
60946
  import { readFileSync as readFileSync12 } from "fs";
60938
- import { dirname as dirname12, join as join21 } from "path";
60947
+ import { dirname as dirname13, join as join21 } from "path";
60939
60948
  import { fileURLToPath as fileURLToPath9 } from "url";
60940
60949
  function runcastleVersion() {
60941
60950
  if (cached4)
60942
60951
  return cached4;
60943
- const here = dirname12(fileURLToPath9(import.meta.url));
60952
+ const here = dirname13(fileURLToPath9(import.meta.url));
60944
60953
  for (const pkgPath of [join21(here, "..", "package.json"), join21(here, "package.json")]) {
60945
60954
  try {
60946
60955
  const pkg = JSON.parse(readFileSync12(pkgPath, "utf8"));
@@ -60959,7 +60968,7 @@ var init_version = () => {};
60959
60968
  // src/services/install-id.ts
60960
60969
  import { randomUUID as randomUUID3 } from "crypto";
60961
60970
  import { existsSync as existsSync22, mkdirSync as mkdirSync13, readFileSync as readFileSync13, writeFileSync as writeFileSync9 } from "fs";
60962
- import { dirname as dirname13 } from "path";
60971
+ import { dirname as dirname14 } from "path";
60963
60972
  function getInstallId() {
60964
60973
  const file = installIdPath();
60965
60974
  try {
@@ -60969,7 +60978,7 @@ function getInstallId() {
60969
60978
  return existing;
60970
60979
  }
60971
60980
  const id3 = randomUUID3();
60972
- mkdirSync13(dirname13(file), { recursive: true });
60981
+ mkdirSync13(dirname14(file), { recursive: true });
60973
60982
  writeFileSync9(file, `${id3}
60974
60983
  `);
60975
60984
  return id3;
@@ -62058,7 +62067,7 @@ var init_feature = __esm(() => {
62058
62067
  // src/services/fsbrowse.ts
62059
62068
  import { existsSync as existsSync24, readdirSync as readdirSync6, statSync as statSync8 } from "fs";
62060
62069
  import { homedir as homedir4 } from "os";
62061
- import { basename as basename3, dirname as dirname14, isAbsolute as isAbsolute3, join as join26, resolve as resolve12, sep as sep4 } from "path";
62070
+ import { basename as basename3, dirname as dirname15, isAbsolute as isAbsolute3, join as join26, resolve as resolve12, sep as sep4 } from "path";
62062
62071
  function expandPath(input, home = homedir4()) {
62063
62072
  const trimmed = input.trim();
62064
62073
  if (trimmed === "")
@@ -62111,7 +62120,7 @@ function crumbsFor(dir) {
62111
62120
  let cur = dir;
62112
62121
  for (;; ) {
62113
62122
  out.unshift({ name: basename3(cur) || cur, path: cur });
62114
- const parent = dirname14(cur);
62123
+ const parent = dirname15(cur);
62115
62124
  if (parent === cur)
62116
62125
  break;
62117
62126
  cur = parent;
@@ -62119,7 +62128,7 @@ function crumbsFor(dir) {
62119
62128
  return out;
62120
62129
  }
62121
62130
  function parentOf(dir) {
62122
- const parent = dirname14(dir);
62131
+ const parent = dirname15(dir);
62123
62132
  return parent === dir ? null : parent;
62124
62133
  }
62125
62134
  function browseDir(input, showHidden = false, home = homedir4()) {
@@ -62133,7 +62142,7 @@ function browseDir(input, showHidden = false, home = homedir4()) {
62133
62142
  let dir = target;
62134
62143
  try {
62135
62144
  if (!statSync8(target).isDirectory())
62136
- dir = dirname14(target);
62145
+ dir = dirname15(target);
62137
62146
  } catch (e) {
62138
62147
  throw new InvalidInputError(`cannot read path: ${target} (${errMsg4(e)})`);
62139
62148
  }
@@ -62607,6 +62616,31 @@ var init_settings2 = __esm(() => {
62607
62616
  });
62608
62617
  });
62609
62618
 
62619
+ // src/doctor/afk-env.ts
62620
+ import { existsSync as existsSync26, readFileSync as readFileSync15 } from "fs";
62621
+ function envWithAfkCredentials() {
62622
+ const merged = { ...process.env };
62623
+ try {
62624
+ const path2 = envPath();
62625
+ if (existsSync26(path2)) {
62626
+ const fromFile = parseEnvFile3(readFileSync15(path2, "utf8"));
62627
+ for (const runtime5 of AGENT_RUNTIMES) {
62628
+ const key = RUNTIME_SPECS[runtime5].afkKey;
62629
+ const value = fromFile[key];
62630
+ if (value && value.length > 0)
62631
+ merged[key] = value;
62632
+ }
62633
+ }
62634
+ } catch {}
62635
+ return merged;
62636
+ }
62637
+ var init_afk_env = __esm(() => {
62638
+ init_src();
62639
+ init_paths();
62640
+ init_ticket_burner();
62641
+ init_doctor();
62642
+ });
62643
+
62610
62644
  // src/trpc/routers/setup.ts
62611
62645
  import { isNotNull as isNotNull4 } from "drizzle-orm";
62612
62646
  import * as z12 from "zod";
@@ -62614,8 +62648,10 @@ var setupRouter;
62614
62648
  var init_setup2 = __esm(() => {
62615
62649
  init_src();
62616
62650
  init_schema();
62651
+ init_afk_env();
62617
62652
  init_doctor();
62618
62653
  init_system_exec();
62654
+ init_asset_paths();
62619
62655
  init_registry();
62620
62656
  init_setup();
62621
62657
  init_resolve_executable();
@@ -62625,6 +62661,8 @@ var init_setup2 = __esm(() => {
62625
62661
  const projectModels = ctx.db.select({ model: projects.model }).from(projects).where(isNotNull4(projects.model)).all().map((p) => p.model);
62626
62662
  return runDoctor({
62627
62663
  exec: createSystemExec(),
62664
+ burnerDockerfile: burnerDockerfilePath(),
62665
+ env: envWithAfkCredentials(),
62628
62666
  runtimes: configuredRuntimes(ctx.config, projectModels),
62629
62667
  ...ctx.config.sandboxImage ? { imageName: ctx.config.sandboxImage } : {}
62630
62668
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcastle",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Burn tickets into shipped features with Claude Code.",
5
5
  "license": "FSL-1.1-ALv2",
6
6
  "type": "module",