wildcrane-runner 0.6.119 → 0.6.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/runner.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.119 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.121 — built by runner/scripts/build.mjs. Do not edit.
2
2
  import { createRequire as __ai4kanbanRequire } from 'node:module'
3
3
  const require = __ai4kanbanRequire(import.meta.url)
4
4
  var __create = Object.create;
@@ -152756,6 +152756,8 @@ ${url2}`,
152756
152756
  refused: (why2) => `WildCrane \u62D2\u7EDD\u4E86\u8FDE\u63A5\uFF1A${why2}`,
152757
152757
  updated: (version2) => `\u5DF2\u66F4\u65B0\u5230 ${version2}`,
152758
152758
  rolledBack: (version2) => `\u65B0\u7248\u672C\u672A\u80FD\u542F\u52A8\uFF0C\u5DF2\u9000\u56DE ${version2}`,
152759
+ spawnFailed: (why2) => `Runner \u65E0\u6CD5\u542F\u52A8\uFF1A${why2}`,
152760
+ updateDownloadFailed: () => "Runner \u66F4\u65B0\u4E0B\u8F7D\u5931\u8D25\uFF0C\u7EE7\u7EED\u8FD0\u884C\u5F53\u524D\u7248\u672C\uFF0C\u7A0D\u540E\u91CD\u8BD5\u3002",
152759
152761
  nodeTooOld: (range) => `\u65B0\u7248\u672C\u9700\u8981 Node ${range}\uFF0C\u8BF7\u5347\u7EA7 Node\u3002\u672C\u6B21\u7EE7\u7EED\u4F7F\u7528\u5F53\u524D\u7248\u672C\u3002`,
152760
152762
  alreadyRunning: () => "\u672C\u673A\u5DF2\u6709 WildCrane Runner \u6B63\u5728\u8FD0\u884C\uFF0C\u65E0\u6CD5\u542F\u52A8\u7B2C\u4E8C\u4E2A\u5B9E\u4F8B\u3002",
152761
152763
  stopped: () => "\u5DF2\u505C\u6B62"
@@ -152773,6 +152775,8 @@ ${url2}`,
152773
152775
  refused: (why2) => `WildCrane refused the connection: ${why2}`,
152774
152776
  updated: (version2) => `Updated to ${version2}`,
152775
152777
  rolledBack: (version2) => `The new version did not start \u2014 back on ${version2}`,
152778
+ spawnFailed: (why2) => `Runner could not start: ${why2}`,
152779
+ updateDownloadFailed: () => "The Runner update could not download. The current version will keep running and retry later.",
152776
152780
  nodeTooOld: (range) => `The new version needs Node ${range}. Update Node; running the current version for now.`,
152777
152781
  alreadyRunning: () => "A WildCrane Runner is already running on this computer. A second instance cannot start.",
152778
152782
  stopped: () => "Stopped"
@@ -152792,9 +152796,9 @@ function status(line) {
152792
152796
  }
152793
152797
 
152794
152798
  // src/protocol.ts
152795
- var VERSION = true ? "0.6.119" : "0.0.0";
152796
- var AKB_VERSION = true ? "0.11.101" : "0.0.0";
152797
- var AKB_CONTRACT = true ? 34 : 0;
152799
+ var VERSION = true ? "0.6.121" : "0.0.0";
152800
+ var AKB_VERSION = true ? "0.11.103" : "0.0.0";
152801
+ var AKB_CONTRACT = true ? 36 : 0;
152798
152802
  var EXIT_REFUSED = 10;
152799
152803
  var EXIT_OUTDATED = 11;
152800
152804
  var EXIT_UPDATE = 12;
@@ -152804,13 +152808,13 @@ var EXIT_ALREADY_RUNNING = 13;
152804
152808
  import { spawn as spawn2 } from "node:child_process";
152805
152809
  import { randomUUID as randomUUID4 } from "node:crypto";
152806
152810
  import fs20 from "node:fs";
152807
- import os5 from "node:os";
152811
+ import os6 from "node:os";
152808
152812
  import path23 from "node:path";
152809
152813
 
152810
152814
  // ../cli/src/lib/agent/harnesses/antigravity.ts
152811
152815
  import fs14 from "node:fs";
152812
152816
  import path15 from "node:path";
152813
- import { createHash as createHash4 } from "node:crypto";
152817
+ import { createHash as createHash5 } from "node:crypto";
152814
152818
  import { spawnSync as spawnSync3 } from "node:child_process";
152815
152819
 
152816
152820
  // ../cli/src/lib/agent/locate.ts
@@ -153358,8 +153362,9 @@ function warn(message) {
153358
153362
  }
153359
153363
 
153360
153364
  // ../cli/src/lib/machine/project.ts
153361
- import { randomUUID } from "node:crypto";
153365
+ import { createHash as createHash3, randomUUID } from "node:crypto";
153362
153366
  import fs8 from "node:fs";
153367
+ import os5 from "node:os";
153363
153368
  import path9 from "node:path";
153364
153369
  var RECORD = "board.json";
153365
153370
  var SESSIONS_FILE = "sessions.json";
@@ -153407,7 +153412,7 @@ function rootAbove(board) {
153407
153412
  var NESTED_STATE = /(^|[/\\])\.akb[/\\](?:(?:boards|hidden-boards)[/\\])?\.akb(?=[/\\]|$)/;
153408
153413
  var InvalidBoardStatePath = class extends BoardError {
153409
153414
  constructor(file3, state, id2) {
153410
- const use = state ? `Use ${state}${id2 ? ` or an .assets/${id2}/\u2026 reference` : ""}.` : "Use the board\u2019s project-local .akb/hidden-boards/ or .akb/boards/ directory.";
153415
+ const use = state ? `Use ${state}${id2 ? ` or an .assets/${id2}/\u2026 reference` : ""}.` : "Use the board\u2019s project-local state directory.";
153411
153416
  super(`Invalid nested board state path: ${file3}. ${use}`, { kind: "board-state-path" });
153412
153417
  }
153413
153418
  };
@@ -153427,36 +153432,91 @@ function stateLayout(board, root2) {
153427
153432
  }
153428
153433
  const hiddenPrefix = `.akb${path9.sep}`;
153429
153434
  const hidden = relative.startsWith(hiddenPrefix);
153430
- const state = path9.join(project, ".akb", hidden ? "hidden-boards" : "boards", (hidden ? relative.slice(hiddenPrefix.length) : relative) || "_root");
153435
+ const runnerBoard = relative === `${hiddenPrefix}kanban`;
153436
+ const akb = path9.join(project, ".akb");
153437
+ const state = runnerBoard ? path9.join(akb, "state") : hidden ? path9.join(akb, "hidden-boards", relative.slice(hiddenPrefix.length)) : path9.join(akb, "boards", relative || "_root");
153431
153438
  assertBoardStatePath(state, state);
153432
153439
  assertBoardStatePath(realPathOf(state), state);
153433
- const legacy2 = hidden ? path9.join(project, ".akb", "boards", relative) : null;
153434
- return { state, legacy: legacy2 };
153440
+ const legacy2 = hidden ? [path9.join(akb, "boards", relative)] : [];
153441
+ if (runnerBoard) legacy2.push(path9.join(akb, "hidden-boards", "kanban"));
153442
+ return { project, state, legacy: legacy2, runnerBoard };
153435
153443
  }
153436
153444
  function projectStateDir(board, root2 = stateRootOf(board)) {
153437
153445
  return stateLayout(board, root2).state;
153438
153446
  }
153439
153447
  function hasLegacyProjectState(board, root2 = stateRootOf(board)) {
153440
153448
  const { legacy: legacy2 } = stateLayout(board, root2);
153441
- return !!legacy2 && !!fs8.lstatSync(legacy2, { throwIfNoEntry: false });
153449
+ return legacy2.some((dir) => fs8.lstatSync(dir, { throwIfNoEntry: false }));
153450
+ }
153451
+ function hasRunningSession(dir) {
153452
+ try {
153453
+ const store = JSON.parse(fs8.readFileSync(path9.join(dir, SESSIONS_FILE), "utf8"));
153454
+ const runs = Array.isArray(store?.runs) ? store.runs : store?.live;
153455
+ return Array.isArray(runs) && runs.some((run3) => run3?.status === "running" && [run3.pid, run3.agentPid].some(isLivePid));
153456
+ } catch (error62) {
153457
+ if (missing(error62) || error62 instanceof SyntaxError) return false;
153458
+ throw error62;
153459
+ }
153460
+ }
153461
+ function isLivePid(pid) {
153462
+ if (!Number.isSafeInteger(pid) || pid < 1) return false;
153463
+ try {
153464
+ process.kill(pid, 0);
153465
+ return true;
153466
+ } catch (error62) {
153467
+ return error62.code === "EPERM";
153468
+ }
153469
+ }
153470
+ function hasRunnerJob(project) {
153471
+ const home4 = process.env.WILDCRANE_HOME || path9.join(os5.homedir(), ".wildcrane");
153472
+ const prefix = `${createHash3("sha256").update(project).digest("hex")}.`;
153473
+ try {
153474
+ return fs8.readdirSync(path9.join(home4, "holds")).some((name) => name.startsWith(prefix) && isLivePid(Number(name.slice(prefix.length))));
153475
+ } catch (error62) {
153476
+ if (missing(error62)) return false;
153477
+ throw error62;
153478
+ }
153442
153479
  }
153443
153480
  function migrateProjectState(board, root2 = stateRootOf(board)) {
153444
- const { state, legacy: legacy2 } = stateLayout(board, root2);
153445
- if (!legacy2 || !fs8.lstatSync(legacy2, { throwIfNoEntry: false })) return state;
153446
- const conflict = () => new BoardError(`Board state exists at both ${legacy2} and ${state}. Stop the CLI and Runner, compare both directories, and move the legacy directory aside after reconciling its contents.`, { kind: "board-state-conflict" });
153481
+ const { project, state, legacy: legacy2, runnerBoard } = stateLayout(board, root2);
153482
+ const present = legacy2.filter((dir) => {
153483
+ const entry = fs8.lstatSync(dir, { throwIfNoEntry: false });
153484
+ if (!entry) return false;
153485
+ if (!entry.isDirectory() || realPathOf(dir) !== dir) {
153486
+ throw new BoardError(`Legacy board state must be a regular directory: ${dir}. Move the saved state to ${state} before restarting.`, { kind: "board-state-path" });
153487
+ }
153488
+ return true;
153489
+ });
153490
+ if (!present.length) return state;
153491
+ if (runnerBoard && hasRunnerJob(project) || [...present, state].some(hasRunningSession)) {
153492
+ throw new BoardError(`Board state migration is waiting for the running tasks in ${project} to exit.`, { kind: "board-state-busy" });
153493
+ }
153494
+ const sources3 = present.filter((dir) => {
153495
+ try {
153496
+ fs8.rmdirSync(dir);
153497
+ return false;
153498
+ } catch (error62) {
153499
+ if (missing(error62)) return false;
153500
+ if (["ENOTEMPTY", "EEXIST"].includes(error62.code ?? "")) return true;
153501
+ throw error62;
153502
+ }
153503
+ });
153504
+ const conflict = (dirs2) => new BoardError(`Board state exists at ${dirs2.join(" and ")}. Compare the saved state before moving it to ${state}.`, { kind: "board-state-conflict" });
153505
+ if (sources3.length > 1) throw conflict(sources3);
153506
+ const source2 = sources3[0];
153507
+ if (!source2) return state;
153447
153508
  if (fs8.lstatSync(state, { throwIfNoEntry: false })) {
153448
- if (fs8.lstatSync(legacy2, { throwIfNoEntry: false })) throw conflict();
153509
+ if (fs8.lstatSync(source2, { throwIfNoEntry: false })) throw conflict([source2, state]);
153449
153510
  return state;
153450
153511
  }
153451
- if (realPathOf(legacy2) !== legacy2) {
153452
- throw new BoardError(`Legacy board state points through a symbolic link: ${legacy2}. Move the saved state to ${state} and remove the old link before restarting.`, { kind: "board-state-path" });
153453
- }
153454
153512
  fs8.mkdirSync(path9.dirname(state), { recursive: true });
153455
153513
  try {
153456
- fs8.renameSync(legacy2, state);
153514
+ fs8.renameSync(source2, state);
153457
153515
  } catch (error62) {
153458
- if (missing(error62) && !fs8.lstatSync(legacy2, { throwIfNoEntry: false }) && fs8.existsSync(state)) return state;
153459
- if (fs8.lstatSync(legacy2, { throwIfNoEntry: false }) && fs8.lstatSync(state, { throwIfNoEntry: false })) throw conflict();
153516
+ if (fs8.lstatSync(state, { throwIfNoEntry: false })) {
153517
+ if (fs8.lstatSync(source2, { throwIfNoEntry: false })) throw conflict([source2, state]);
153518
+ if (missing(error62)) return state;
153519
+ }
153460
153520
  throw error62;
153461
153521
  }
153462
153522
  return state;
@@ -154084,9 +154144,9 @@ function codexFailure(raw, fallback) {
154084
154144
  // ../cli/src/lib/agent/wire/acp-cost.ts
154085
154145
  import fs12 from "node:fs";
154086
154146
  import path13 from "node:path";
154087
- import { createHash as createHash3 } from "node:crypto";
154147
+ import { createHash as createHash4 } from "node:crypto";
154088
154148
  function acpCostFile(tool, cwd, session) {
154089
- const key = createHash3("sha256").update(JSON.stringify([tool, cwd, session])).digest("hex");
154149
+ const key = createHash4("sha256").update(JSON.stringify([tool, cwd, session])).digest("hex");
154090
154150
  return path13.join(machineHome(), "usage", "acp", `${key}.json`);
154091
154151
  }
154092
154152
  function readAcpCost(file3) {
@@ -154455,8 +154515,8 @@ function createTail(log) {
154455
154515
  // ../cli/package.json
154456
154516
  var package_default = {
154457
154517
  name: "wildcrane",
154458
- version: "0.11.101",
154459
- akbContract: 34,
154518
+ version: "0.11.103",
154519
+ akbContract: 36,
154460
154520
  canonicalCommands: true,
154461
154521
  description: "WildCrane's `akb` command \u2014 scaffold the Markdown board under docs/kanban/, put an agent on a card, and carry the flows the agent works by.",
154462
154522
  keywords: [
@@ -155359,7 +155419,7 @@ function systemPrompt(text4, _argv, env2) {
155359
155419
  const rule = `${text4}
155360
155420
 
155361
155421
  The task working directory is ${env2.PWD ?? process.cwd()}. Use it as the base for project files and commands. This additional workspace contains only language rules; do not write task output here.`;
155362
- const hash2 = createHash4("sha256").update(rule).digest("hex").slice(0, 16);
155422
+ const hash2 = createHash5("sha256").update(rule).digest("hex").slice(0, 16);
155363
155423
  const root2 = path15.join(machineHome(), "prompts", `antigravity-${hash2}`);
155364
155424
  const file3 = path15.join(root2, ".agents", "rules", "language.md");
155365
155425
  fs14.mkdirSync(path15.dirname(file3), { recursive: true });
@@ -160420,8 +160480,8 @@ var sources = Object.fromEntries(
160420
160480
  ])
160421
160481
  );
160422
160482
  Object.assign(sources, {
160423
- "claude-code": () => claudeModels(path23.join(process.env.CLAUDE_CONFIG_DIR || path23.join(os5.homedir(), ".claude"), "cache", "model-catalog")),
160424
- codex: () => codexModels(path23.join(process.env.CODEX_HOME || path23.join(os5.homedir(), ".codex"), "models_cache.json")),
160483
+ "claude-code": () => claudeModels(path23.join(process.env.CLAUDE_CONFIG_DIR || path23.join(os6.homedir(), ".claude"), "cache", "model-catalog")),
160484
+ codex: () => codexModels(path23.join(process.env.CODEX_HOME || path23.join(os6.homedir(), ".codex"), "models_cache.json")),
160425
160485
  opencode: async (signal2) => opencodeModels(await output(installedCommand(HARNESSES2.opencode).argv[0], ["models"], signal2)),
160426
160486
  cursor: (signal2) => cursorModels(signal2),
160427
160487
  antigravity: async (signal2) => antigravityModels(await output(installedCommand(HARNESSES2.antigravity).argv[0], ["models"], signal2))
@@ -160434,7 +160494,7 @@ function cursorModels(signal2, argv = installedCommand(HARNESSES2.cursor).argv)
160434
160494
  return new Promise((resolve2) => {
160435
160495
  let child;
160436
160496
  try {
160437
- const start = spawnable(argv[0], argv.slice(1), { cwd: os5.tmpdir(), stdio: ["pipe", "pipe", "ignore"], env: copyEnv(argv[0], withSystemProxy({ ...process.env, ...HARNESSES2.cursor.env() })) });
160497
+ const start = spawnable(argv[0], argv.slice(1), { cwd: os6.tmpdir(), stdio: ["pipe", "pipe", "ignore"], env: copyEnv(argv[0], withSystemProxy({ ...process.env, ...HARNESSES2.cursor.env() })) });
160438
160498
  child = spawn2(start.command, start.args, start.options);
160439
160499
  } catch {
160440
160500
  return resolve2([]);
@@ -160453,7 +160513,7 @@ function cursorModels(signal2, argv = installedCommand(HARNESSES2.cursor).argv)
160453
160513
  child.on("error", () => done([]));
160454
160514
  child.on("close", () => done([]));
160455
160515
  const rpc = connect(child.stdout, child.stdin, (msg) => msg.id !== void 0 && rpc.refuse(msg.id, "no"), { jsonrpc: true });
160456
- rpc.call("initialize", { protocolVersion: 1, clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false } }).then(() => rpc.call("session/new", { cwd: os5.tmpdir(), mcpServers: [] })).then((opened) => done(acpModels(opened))).catch(() => done([]));
160516
+ rpc.call("initialize", { protocolVersion: 1, clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false } }).then(() => rpc.call("session/new", { cwd: os6.tmpdir(), mcpServers: [] })).then((opened) => done(acpModels(opened))).catch(() => done([]));
160457
160517
  });
160458
160518
  }
160459
160519
  function acpModels(opened) {
@@ -160604,7 +160664,7 @@ import path25 from "node:path";
160604
160664
  import crypto3 from "node:crypto";
160605
160665
  import diagnosticsChannel from "node:diagnostics_channel";
160606
160666
  import fs22 from "node:fs";
160607
- import os6 from "node:os";
160667
+ import os7 from "node:os";
160608
160668
  import path24 from "node:path";
160609
160669
  import { PassThrough, Writable } from "node:stream";
160610
160670
  var import_undici2 = __toESM(require_undici(), 1);
@@ -160674,7 +160734,7 @@ function readPrivate(file3) {
160674
160734
  }
160675
160735
  }
160676
160736
  function nativeEndpoint(key) {
160677
- const directory3 = path24.join(os6.tmpdir(), `wc-codex-${crypto3.createHash("sha256").update(runnerCwd()).digest("hex").slice(0, 12)}`);
160737
+ const directory3 = path24.join(os7.tmpdir(), `wc-codex-${crypto3.createHash("sha256").update(runnerCwd()).digest("hex").slice(0, 12)}`);
160678
160738
  fs22.mkdirSync(directory3, { recursive: true, mode: 448 });
160679
160739
  fs22.chmodSync(directory3, 448);
160680
160740
  return `unix://${path24.join(directory3, `${key.slice(0, 12)}-${crypto3.randomBytes(6).toString("hex")}.sock`)}`;
@@ -161159,7 +161219,7 @@ function connectCloudLive(handlers) {
161159
161219
 
161160
161220
  // src/folders.ts
161161
161221
  import fs25 from "node:fs";
161162
- import os7 from "node:os";
161222
+ import os8 from "node:os";
161163
161223
  import path27 from "node:path";
161164
161224
  var projectsFile = () => path27.join(runnerHome(), "projects.json");
161165
161225
  function realpath(p2) {
@@ -161248,7 +161308,7 @@ var allow = (dir) => {
161248
161308
  var disallow = (dir) => update2((list3) => list3.filter((p2) => p2 !== dir));
161249
161309
  var SYSTEM_MAC = ["/System", "/Library", "/Applications", "/usr", "/bin", "/sbin", "/etc", "/var", "/private", "/opt", "/cores", "/dev"];
161250
161310
  var SYSTEM_WIN = ["Windows", "Program Files", "Program Files (x86)", "ProgramData"];
161251
- var here = () => ({ platform: process.platform, home: os7.homedir(), resolve: realpath });
161311
+ var here = () => ({ platform: process.platform, home: os8.homedir(), resolve: realpath });
161252
161312
  function refusal2(picked, where = here()) {
161253
161313
  const win = where.platform === "win32";
161254
161314
  const p2 = win ? path27.win32 : path27.posix;
@@ -161353,7 +161413,7 @@ import fs35 from "node:fs";
161353
161413
  import path37 from "node:path";
161354
161414
 
161355
161415
  // ../cli/src/lib/agent/cloud-studios.ts
161356
- import { createHash as createHash5, randomUUID as randomUUID6 } from "node:crypto";
161416
+ import { createHash as createHash6, randomUUID as randomUUID6 } from "node:crypto";
161357
161417
  import { setTimeout as delay2 } from "node:timers/promises";
161358
161418
  import fs29 from "node:fs";
161359
161419
  import path31 from "node:path";
@@ -161780,7 +161840,7 @@ var versionFile = (id2, version2) => path31.join(root(), "versions", `${safe(id2
161780
161840
  var listFile = (project) => path31.join(root(), "lists", `${safe(project)}.json`);
161781
161841
  var pinFile = (task) => path31.join(root(), "tasks", `${safe(task)}.json`);
161782
161842
  var sessionDir = (task) => path31.join(root(), "sessions", safe(task));
161783
- var sessionFileOf = (task, session) => path31.join(sessionDir(task), createHash5("sha256").update(session).digest("hex") + ".json");
161843
+ var sessionFileOf = (task, session) => path31.join(sessionDir(task), createHash6("sha256").update(session).digest("hex") + ".json");
161784
161844
  var skillDir = (id2, version2) => path31.join(root(), "bundles", safe(id2) + "@" + version2);
161785
161845
  function readJson(file3) {
161786
161846
  try {
@@ -161799,7 +161859,7 @@ function writeJson(file3, value) {
161799
161859
  fs29.rmSync(tmp, { force: true });
161800
161860
  }
161801
161861
  }
161802
- var filesHash = (files) => createHash5("sha256").update(hashInput(files)).digest("hex");
161862
+ var filesHash = (files) => createHash6("sha256").update(hashInput(files)).digest("hex");
161803
161863
  var readVersion2 = (id2, version2) => {
161804
161864
  const held5 = readJson(versionFile(id2, version2));
161805
161865
  return held5?.id === id2 && held5.version === version2 && isStudioFiles(held5.files) && (!held5.filesSha256 || filesHash(held5.files) === held5.filesSha256) ? held5 : null;
@@ -161831,7 +161891,7 @@ function saveStudioSession(task, session, pin) {
161831
161891
  if (!fs29.existsSync(file3)) writeJson(file3, pin);
161832
161892
  }
161833
161893
  function runtimeContextFile(task, runtime, session) {
161834
- const key = createHash5("sha256").update(JSON.stringify([runtime, session])).digest("hex");
161894
+ const key = createHash6("sha256").update(JSON.stringify([runtime, session])).digest("hex");
161835
161895
  return path31.join(sessionDir(task), "context", key + ".json");
161836
161896
  }
161837
161897
  function readRuntimeContext(task, runtime, session) {
@@ -161963,7 +162023,7 @@ async function cachedPackage(held5, pack, download2) {
161963
162023
  const read6 = await download2(pack.downloadUrl, pack.zipBytes);
161964
162024
  if (!read6.ok) return read6;
161965
162025
  const zip = read6.value;
161966
- if (zip.length !== pack.zipBytes || createHash5("sha256").update(zip).digest("hex") !== pack.zipSha256) return invalid("the Studio ZIP digest");
162026
+ if (zip.length !== pack.zipBytes || createHash6("sha256").update(zip).digest("hex") !== pack.zipSha256) return invalid("the Studio ZIP digest");
161967
162027
  let files;
161968
162028
  try {
161969
162029
  files = decodeStudioZip(zip);
@@ -165010,7 +165070,7 @@ import fs44 from "node:fs";
165010
165070
  import path46 from "node:path";
165011
165071
 
165012
165072
  // ../cli/src/lib/agent/runtime-context.ts
165013
- import { createHash as createHash6 } from "node:crypto";
165073
+ import { createHash as createHash7 } from "node:crypto";
165014
165074
 
165015
165075
  // ../cli/node_modules/zod/v4/classic/external.js
165016
165076
  var external_exports = {};
@@ -184848,7 +184908,7 @@ function reviewBoundary(review, assigned, studio2 = []) {
184848
184908
  }
184849
184909
 
184850
184910
  // ../cli/src/lib/agent/runtime-context.ts
184851
- var contextFingerprint = (text4) => createHash6("sha256").update(text4).digest("hex");
184911
+ var contextFingerprint = (text4) => createHash7("sha256").update(text4).digest("hex");
184852
184912
  function contextUpdate(previous, blocks) {
184853
184913
  const sent = { ...previous };
184854
184914
  const parts = [];
@@ -187240,7 +187300,7 @@ function processesStopped(mark, root2) {
187240
187300
 
187241
187301
  // src/flow.ts
187242
187302
  import fs74 from "node:fs";
187243
- import os9 from "node:os";
187303
+ import os10 from "node:os";
187244
187304
  import path75 from "node:path";
187245
187305
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
187246
187306
 
@@ -189995,7 +190055,7 @@ function cmdMemoryFile(askedName) {
189995
190055
 
189996
190056
  // ../cli/src/commands/inspect.ts
189997
190057
  import fs69 from "node:fs";
189998
- import os8 from "node:os";
190058
+ import os9 from "node:os";
189999
190059
  import path70 from "node:path";
190000
190060
  function cmdInspect(id2) {
190001
190061
  const findings = [];
@@ -190050,12 +190110,13 @@ function cmdInspect(id2) {
190050
190110
  records.push(...fact("delivery", () => (store.deliveries ?? []).filter((held6) => held6.cardId === id2), []));
190051
190111
  const held5 = [...new Map(records.map((held6) => [held6.deliveryId, held6])).values()].sort((a2, b2) => b2.startedAt - a2.startedAt)[0];
190052
190112
  const job = executionOf()?.job;
190053
- const checkpoint = job ? read6("recovery", path70.join(process.env.WILDCRANE_HOME || os8.homedir() + "/.wildcrane", "checkpoints", `${encodeURIComponent(job)}.json`), null) : null;
190113
+ const checkpoint = job ? read6("recovery", path70.join(process.env.WILDCRANE_HOME || os9.homedir() + "/.wildcrane", "checkpoints", `${encodeURIComponent(job)}.json`), null) : null;
190054
190114
  const delivery = fact("delivery", () => held5 ? { id: held5.deliveryId, status: held5.status, directory: held5.worktree ?? REPO_ROOT, completedSteps: (held5.completions ?? []).map((c2) => c2.step) } : null, null);
190055
190115
  const recovery = fact("recovery", () => checkpoint ? { pendingOperations: checkpoint.pending ?? [], submitted: checkpoint.submitted ?? null } : null, null);
190056
190116
  const result = {
190057
190117
  id: id2,
190058
190118
  card,
190119
+ asset_folder: path70.join(ASSETS, String(id2)),
190059
190120
  previews: fact("previews", () => Object.entries(progress).map(([agent, p2]) => ({
190060
190121
  agent,
190061
190122
  currentStageId: p2.currentStageId,
@@ -190453,9 +190514,9 @@ import fs72 from "node:fs";
190453
190514
  import path73 from "node:path";
190454
190515
 
190455
190516
  // ../cli/src/lib/signals/identity.ts
190456
- import { createHash as createHash7 } from "node:crypto";
190517
+ import { createHash as createHash8 } from "node:crypto";
190457
190518
  var DERIVED = "derived-";
190458
- var derivedSourceId = (seed) => `${DERIVED}${createHash7("sha256").update(seed).digest("hex").slice(0, 16)}`;
190519
+ var derivedSourceId = (seed) => `${DERIVED}${createHash8("sha256").update(seed).digest("hex").slice(0, 16)}`;
190459
190520
 
190460
190521
  // src/triage.ts
190461
190522
  var triageDir = (board) => path73.join(board, "triage");
@@ -190998,7 +191059,7 @@ async function runFlow(job, ws, deps, io) {
190998
191059
  const task = currentTask;
190999
191060
  const startsDelivery = ["delivery resume", "run resume", "task implement"].includes(args2.slice(0, 2).join(" "));
191000
191061
  if (review && action === "implement" && startsDelivery) {
191001
- previewDirectory ??= fs74.mkdtempSync(path75.join(os9.tmpdir(), "wildcrane-previews-"));
191062
+ previewDirectory ??= fs74.mkdtempSync(path75.join(os10.tmpdir(), "wildcrane-previews-"));
191002
191063
  const inputs = task?.preview_inputs;
191003
191064
  const staged = await attemptSync(io, "previews", () => stageSavedPreviews(previewDirectory, ws, review, inputs, () => stopping(io)));
191004
191065
  if (!staged.ok) return refuse(refusedSync(job, staged));
@@ -191758,7 +191819,7 @@ function runnerSettingsSupport() {
191758
191819
  }
191759
191820
 
191760
191821
  // src/jobs.ts
191761
- import { createHash as createHash9 } from "node:crypto";
191822
+ import { createHash as createHash10 } from "node:crypto";
191762
191823
 
191763
191824
  // src/conversation-progress.ts
191764
191825
  function conversationProgress(attempt, send3, valid, unconfirmed) {
@@ -191855,9 +191916,9 @@ function conversationProgress(attempt, send3, valid, unconfirmed) {
191855
191916
  // src/reply-images.ts
191856
191917
  import fs77 from "node:fs";
191857
191918
  import path78 from "node:path";
191858
- import os10 from "node:os";
191919
+ import os11 from "node:os";
191859
191920
  import { fileURLToPath as fileURLToPath5 } from "node:url";
191860
- import { createHash as createHash8 } from "node:crypto";
191921
+ import { createHash as createHash9 } from "node:crypto";
191861
191922
  init_file_limits();
191862
191923
  var inside2 = (root2, file3) => {
191863
191924
  const p2 = path78.relative(root2, file3);
@@ -191867,7 +191928,7 @@ function collectReplyImages(parts, cwd) {
191867
191928
  const files = /* @__PURE__ */ new Map();
191868
191929
  const tools = [];
191869
191930
  const output3 = [];
191870
- const roots = [cwd, path78.join(process.env.CODEX_HOME?.trim() || path78.join(os10.homedir(), ".codex"), "generated_images")].flatMap((p2) => {
191931
+ const roots = [cwd, path78.join(process.env.CODEX_HOME?.trim() || path78.join(os11.homedir(), ".codex"), "generated_images")].flatMap((p2) => {
191871
191932
  try {
191872
191933
  return [fs77.realpathSync(p2)];
191873
191934
  } catch {
@@ -191921,7 +191982,7 @@ function collectReplyImages(parts, cwd) {
191921
191982
  const bytes = read6();
191922
191983
  const mime = imageMime(bytes);
191923
191984
  if (!mime || p2.mime && p2.mime !== mime || bytes.length > ASSET_FILE_LIMIT) throw Error();
191924
- const id2 = `rim_${createHash8("sha256").update(bytes).digest("hex")}`;
191985
+ const id2 = `rim_${createHash9("sha256").update(bytes).digest("hex")}`;
191925
191986
  if (!files.has(id2)) files.set(id2, { read: read6, mime });
191926
191987
  return { type: "image", id: id2, mime, status: "saved" };
191927
191988
  } catch {
@@ -191976,7 +192037,7 @@ async function saveReplyImages(parts, cwd, upload2) {
191976
192037
  let bytes;
191977
192038
  try {
191978
192039
  bytes = f2.read();
191979
- if (`rim_${createHash8("sha256").update(bytes).digest("hex")}` !== key || imageMime(bytes) !== f2.mime) continue;
192040
+ if (`rim_${createHash9("sha256").update(bytes).digest("hex")}` !== key || imageMime(bytes) !== f2.mime) continue;
191980
192041
  } catch {
191981
192042
  continue;
191982
192043
  }
@@ -193261,7 +193322,7 @@ async function runClaimedStep(job, deps, track, keep2, lease, scope, replyStream
193261
193322
  const stream2 = watching();
193262
193323
  return sendBack(publishingJob, deps, ws, completed, sync, stream2, finishClaimed, landed, async (pushed) => {
193263
193324
  const records = pushed.conflict ? pendingConflicts(ws.board) : [];
193264
- const facts = createHash9("sha256").update(JSON.stringify(pushed.conflict ? records.map((r2) => ({ id: r2.id, state: r2.state, files: r2.files })) : pushed.failure)).digest("hex");
193325
+ const facts = createHash10("sha256").update(JSON.stringify(pushed.conflict ? records.map((r2) => ({ id: r2.id, state: r2.state, files: r2.files })) : pushed.failure)).digest("hex");
193265
193326
  const failRepair = async (reason) => {
193266
193327
  if (!stream2.asked()) stream2.event({ kind: "error", data: { text: reason } });
193267
193328
  await stream2.end();
@@ -196078,18 +196139,27 @@ import path89 from "node:path";
196078
196139
  import fs87 from "node:fs";
196079
196140
  import path88 from "node:path";
196080
196141
  var CONNECT_MS = 2 * 6e4;
196142
+ var RETRY_MS3 = 5 * 6e4;
196143
+ var isVersion = (value) => typeof value === "string" && /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(value);
196081
196144
  var stateFile2 = () => path88.join(versionsDir(), "state.json");
196082
196145
  function readState() {
196083
196146
  try {
196084
- const held5 = JSON.parse(fs87.readFileSync(stateFile2(), "utf8"));
196085
- return { ...held5, good: held5.good ?? [], bad: held5.bad ?? [] };
196147
+ const { verified, good, retry: retry2, alpha, rollbackAt } = JSON.parse(fs87.readFileSync(stateFile2(), "utf8"));
196148
+ const last2 = verified === void 0 && Array.isArray(good) ? good[0] : verified;
196149
+ return { verified: isVersion(last2) ? last2 : null, retry: retry2, alpha, rollbackAt };
196086
196150
  } catch {
196087
- return { good: [], bad: [] };
196151
+ return { verified: null };
196088
196152
  }
196089
196153
  }
196154
+ function verifiedCandidate() {
196155
+ const { verified } = readState();
196156
+ if (!verified) return null;
196157
+ const entry = entryOf(versionDir(verified));
196158
+ return fs87.existsSync(entry) ? { version: verified, entry } : null;
196159
+ }
196090
196160
  function provenNewer(own4) {
196091
- const proven = readState().good.find((v) => fs87.existsSync(entryOf(versionDir(v))));
196092
- return proven && compare(proven, own4) > 0 ? proven : null;
196161
+ const verified = verifiedCandidate();
196162
+ return verified && compare(verified.version, own4) > 0 ? verified.version : null;
196093
196163
  }
196094
196164
 
196095
196165
  // src/settings.html
package/dist/settings.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.119 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.121 — built by runner/scripts/build.mjs. Do not edit.
2
2
  import { createRequire as __ai4kanbanRequire } from 'node:module'
3
3
  const require = __ai4kanbanRequire(import.meta.url)
4
4
  var __create = Object.create;
@@ -41756,8 +41756,8 @@ function cloudProblem(response, body) {
41756
41756
  }
41757
41757
 
41758
41758
  // src/protocol.ts
41759
- var VERSION = true ? "0.6.119" : "0.0.0";
41760
- var AKB_VERSION = true ? "0.11.101" : "0.0.0";
41759
+ var VERSION = true ? "0.6.121" : "0.0.0";
41760
+ var AKB_VERSION = true ? "0.11.103" : "0.0.0";
41761
41761
 
41762
41762
  // ../cli/src/lib/agent/harnesses/antigravity.ts
41763
41763
  import fs10 from "node:fs";
@@ -42274,7 +42274,7 @@ function rootAbove(board) {
42274
42274
  var NESTED_STATE = /(^|[/\\])\.akb[/\\](?:(?:boards|hidden-boards)[/\\])?\.akb(?=[/\\]|$)/;
42275
42275
  var InvalidBoardStatePath = class extends BoardError {
42276
42276
  constructor(file2, state, id) {
42277
- const use = state ? `Use ${state}${id ? ` or an .assets/${id}/\u2026 reference` : ""}.` : "Use the board\u2019s project-local .akb/hidden-boards/ or .akb/boards/ directory.";
42277
+ const use = state ? `Use ${state}${id ? ` or an .assets/${id}/\u2026 reference` : ""}.` : "Use the board\u2019s project-local state directory.";
42278
42278
  super(`Invalid nested board state path: ${file2}. ${use}`, { kind: "board-state-path" });
42279
42279
  }
42280
42280
  };
@@ -42294,18 +42294,21 @@ function stateLayout(board, root2) {
42294
42294
  }
42295
42295
  const hiddenPrefix = `.akb${path8.sep}`;
42296
42296
  const hidden = relative.startsWith(hiddenPrefix);
42297
- const state = path8.join(project, ".akb", hidden ? "hidden-boards" : "boards", (hidden ? relative.slice(hiddenPrefix.length) : relative) || "_root");
42297
+ const runnerBoard = relative === `${hiddenPrefix}kanban`;
42298
+ const akb = path8.join(project, ".akb");
42299
+ const state = runnerBoard ? path8.join(akb, "state") : hidden ? path8.join(akb, "hidden-boards", relative.slice(hiddenPrefix.length)) : path8.join(akb, "boards", relative || "_root");
42298
42300
  assertBoardStatePath(state, state);
42299
42301
  assertBoardStatePath(realPathOf(state), state);
42300
- const legacy = hidden ? path8.join(project, ".akb", "boards", relative) : null;
42301
- return { state, legacy };
42302
+ const legacy = hidden ? [path8.join(akb, "boards", relative)] : [];
42303
+ if (runnerBoard) legacy.push(path8.join(akb, "hidden-boards", "kanban"));
42304
+ return { project, state, legacy, runnerBoard };
42302
42305
  }
42303
42306
  function projectStateDir(board, root2 = stateRootOf(board)) {
42304
42307
  return stateLayout(board, root2).state;
42305
42308
  }
42306
42309
  function hasLegacyProjectState(board, root2 = stateRootOf(board)) {
42307
42310
  const { legacy } = stateLayout(board, root2);
42308
- return !!legacy && !!fs7.lstatSync(legacy, { throwIfNoEntry: false });
42311
+ return legacy.some((dir) => fs7.lstatSync(dir, { throwIfNoEntry: false }));
42309
42312
  }
42310
42313
 
42311
42314
  // ../cli/src/lib/paths.ts
@@ -42921,8 +42924,8 @@ function createTail(log) {
42921
42924
  // ../cli/package.json
42922
42925
  var package_default = {
42923
42926
  name: "wildcrane",
42924
- version: "0.11.101",
42925
- akbContract: 34,
42927
+ version: "0.11.103",
42928
+ akbContract: 36,
42926
42929
  canonicalCommands: true,
42927
42930
  description: "WildCrane's `akb` command \u2014 scaffold the Markdown board under docs/kanban/, put an agent on a card, and carry the flows the agent works by.",
42928
42931
  keywords: [
@@ -48367,6 +48370,8 @@ ${url}`,
48367
48370
  refused: (why) => `WildCrane \u62D2\u7EDD\u4E86\u8FDE\u63A5\uFF1A${why}`,
48368
48371
  updated: (version) => `\u5DF2\u66F4\u65B0\u5230 ${version}`,
48369
48372
  rolledBack: (version) => `\u65B0\u7248\u672C\u672A\u80FD\u542F\u52A8\uFF0C\u5DF2\u9000\u56DE ${version}`,
48373
+ spawnFailed: (why) => `Runner \u65E0\u6CD5\u542F\u52A8\uFF1A${why}`,
48374
+ updateDownloadFailed: () => "Runner \u66F4\u65B0\u4E0B\u8F7D\u5931\u8D25\uFF0C\u7EE7\u7EED\u8FD0\u884C\u5F53\u524D\u7248\u672C\uFF0C\u7A0D\u540E\u91CD\u8BD5\u3002",
48370
48375
  nodeTooOld: (range) => `\u65B0\u7248\u672C\u9700\u8981 Node ${range}\uFF0C\u8BF7\u5347\u7EA7 Node\u3002\u672C\u6B21\u7EE7\u7EED\u4F7F\u7528\u5F53\u524D\u7248\u672C\u3002`,
48371
48376
  alreadyRunning: () => "\u672C\u673A\u5DF2\u6709 WildCrane Runner \u6B63\u5728\u8FD0\u884C\uFF0C\u65E0\u6CD5\u542F\u52A8\u7B2C\u4E8C\u4E2A\u5B9E\u4F8B\u3002",
48372
48377
  stopped: () => "\u5DF2\u505C\u6B62"
@@ -48384,6 +48389,8 @@ ${url}`,
48384
48389
  refused: (why) => `WildCrane refused the connection: ${why}`,
48385
48390
  updated: (version) => `Updated to ${version}`,
48386
48391
  rolledBack: (version) => `The new version did not start \u2014 back on ${version}`,
48392
+ spawnFailed: (why) => `Runner could not start: ${why}`,
48393
+ updateDownloadFailed: () => "The Runner update could not download. The current version will keep running and retry later.",
48387
48394
  nodeTooOld: (range) => `The new version needs Node ${range}. Update Node; running the current version for now.`,
48388
48395
  alreadyRunning: () => "A WildCrane Runner is already running on this computer. A second instance cannot start.",
48389
48396
  stopped: () => "Stopped"
@@ -48938,18 +48945,27 @@ var waitWord = new Int32Array(new SharedArrayBuffer(4));
48938
48945
 
48939
48946
  // src/launcher.ts
48940
48947
  var CONNECT_MS = 2 * 6e4;
48948
+ var RETRY_MS = 5 * 6e4;
48949
+ var isVersion = (value) => typeof value === "string" && /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(value);
48941
48950
  var stateFile = () => path34.join(versionsDir(), "state.json");
48942
48951
  function readState() {
48943
48952
  try {
48944
- const held2 = JSON.parse(fs29.readFileSync(stateFile(), "utf8"));
48945
- return { ...held2, good: held2.good ?? [], bad: held2.bad ?? [] };
48953
+ const { verified, good, retry: retry2, alpha, rollbackAt } = JSON.parse(fs29.readFileSync(stateFile(), "utf8"));
48954
+ const last2 = verified === void 0 && Array.isArray(good) ? good[0] : verified;
48955
+ return { verified: isVersion(last2) ? last2 : null, retry: retry2, alpha, rollbackAt };
48946
48956
  } catch {
48947
- return { good: [], bad: [] };
48957
+ return { verified: null };
48948
48958
  }
48949
48959
  }
48960
+ function verifiedCandidate() {
48961
+ const { verified } = readState();
48962
+ if (!verified) return null;
48963
+ const entry = entryOf(versionDir(verified));
48964
+ return fs29.existsSync(entry) ? { version: verified, entry } : null;
48965
+ }
48950
48966
  function provenNewer(own2) {
48951
- const proven = readState().good.find((v) => fs29.existsSync(entryOf(versionDir(v))));
48952
- return proven && compare(proven, own2) > 0 ? proven : null;
48967
+ const verified = verifiedCandidate();
48968
+ return verified && compare(verified.version, own2) > 0 ? verified.version : null;
48953
48969
  }
48954
48970
 
48955
48971
  // src/settings.html
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane-runner",
3
- "version": "0.6.119",
3
+ "version": "0.6.121",
4
4
  "description": "WildCrane's Local Runner — connects this computer to WildCrane and runs its jobs on your local Claude Code, Codex, OpenCode or Cursor.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://wildcrane.ai/",