wildcrane-runner 0.6.108 → 0.6.109

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.108 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.109 — 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;
@@ -152799,8 +152799,8 @@ function status(line) {
152799
152799
  }
152800
152800
 
152801
152801
  // src/protocol.ts
152802
- var VERSION = true ? "0.6.108" : "0.0.0";
152803
- var AKB_VERSION = true ? "0.11.88" : "0.0.0";
152802
+ var VERSION = true ? "0.6.109" : "0.0.0";
152803
+ var AKB_VERSION = true ? "0.11.89" : "0.0.0";
152804
152804
  var AKB_CONTRACT = true ? 29 : 0;
152805
152805
  var EXIT_REFUSED = 10;
152806
152806
  var EXIT_OUTDATED = 11;
@@ -155472,8 +155472,9 @@ function createTail(log) {
155472
155472
  // ../cli/package.json
155473
155473
  var package_default = {
155474
155474
  name: "wildcrane",
155475
- version: "0.11.88",
155475
+ version: "0.11.89",
155476
155476
  akbContract: 29,
155477
+ canonicalCommands: true,
155477
155478
  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.",
155478
155479
  keywords: [
155479
155480
  "kanban",
@@ -157390,6 +157391,7 @@ function boardLockName(kanban, root2) {
157390
157391
  const name = from && !from.startsWith("..") ? from : path14.basename(kanban);
157391
157392
  return `${name.split(path14.sep).join("-")}.lock`;
157392
157393
  }
157394
+ var shellWord = (value) => /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, "\\$&")}"`;
157393
157395
  var BOARD_FLAG = "";
157394
157396
  function setBoard(kanban, root2, flag) {
157395
157397
  REPO_ROOT = path14.resolve(root2);
@@ -157435,7 +157437,7 @@ function setBoard(kanban, root2, flag) {
157435
157437
  }
157436
157438
  function setBoardRoot(root2, named = false) {
157437
157439
  const project = path14.resolve(root2);
157438
- return setBoard(path14.join(project, "docs", "kanban"), project, named ? ` --dir ${project}` : "");
157440
+ return setBoard(path14.join(project, "docs", "kanban"), project, named ? ` --dir ${shellWord(project)}` : "");
157439
157441
  }
157440
157442
  setBoardRoot(process.cwd());
157441
157443
  var rel = (p2) => {
@@ -180058,6 +180060,7 @@ var bundledAkb = (dist = HERE) => ({
180058
180060
  command: process.execPath,
180059
180061
  args: akbArgs(path26.join(dist, "akb", "bin", "ai4kanban.mjs"), dist),
180060
180062
  version: AKB_VERSION,
180063
+ canonicalCommands: true,
180061
180064
  shim: path26.join(akbHome(), BUNDLED_SHIM)
180062
180065
  });
180063
180066
  var quote = (s) => /^[\w./:@=-]+$/.test(s) ? s : `"${s}"`;
@@ -180098,6 +180101,15 @@ function akbEnv(akb, board, task, language, base = process.env) {
180098
180101
  return env2;
180099
180102
  }
180100
180103
  var KEEP = 256 * 1024;
180104
+ function compatibleArgs(akb, args2) {
180105
+ if (akb.canonicalCommands) return args2;
180106
+ const [group, verb, ...rest] = args2;
180107
+ if (group === "run" || group === "delivery") return ["raw", ...args2];
180108
+ if (group === "task" && verb && ["refine", "revise", "resolve", "implement"].includes(verb)) return ["raw", "card", verb, ...rest];
180109
+ if (group === "memory" && verb === "describe-project") return ["raw", verb, ...rest];
180110
+ if (group === "memory" && verb === "review") return ["raw", ...args2];
180111
+ return args2;
180112
+ }
180101
180113
  function runAkb(akb, args2, opts) {
180102
180114
  return new Promise((resolve2) => {
180103
180115
  let out = "";
@@ -180108,7 +180120,7 @@ function runAkb(akb, args2, opts) {
180108
180120
  };
180109
180121
  let child;
180110
180122
  try {
180111
- child = spawn3(akb.command, [...akb.args, ...args2], { cwd: opts.cwd, env: { ...akbEnv(akb, opts.board, opts.task, opts.language), ...opts.env }, detached: process.platform !== "win32", stdio: ["ignore", "pipe", "pipe"] });
180123
+ child = spawn3(akb.command, [...akb.args, ...compatibleArgs(akb, args2)], { cwd: opts.cwd, env: { ...akbEnv(akb, opts.board, opts.task, opts.language), ...opts.env }, detached: process.platform !== "win32", stdio: ["ignore", "pipe", "pipe"] });
180112
180124
  } catch (e2) {
180113
180125
  return resolve2({ code: null, out: "", last: e2 instanceof Error ? e2.message : String(e2) });
180114
180126
  }
@@ -181326,7 +181338,7 @@ function conflictPrompt(board, work = "Continue the original work from its saved
181326
181338
  const records = conflictList(board);
181327
181339
  return records.length ? [
181328
181340
  "Resolve these saved board content conflicts using `akb guide resolve-conflict` before continuing.",
181329
- ...records.map((r2) => `${r2.id}: ${r2.paths.join(", ")}; read with akb raw conflict show ${r2.id}.`),
181341
+ ...records.map((r2) => `${r2.id}: ${r2.paths.join(", ")}; read with akb board conflict show ${r2.id}.`),
181330
181342
  work
181331
181343
  ].join("\n") : "";
181332
181344
  }
@@ -181677,14 +181689,14 @@ function writeAkbState(state) {
181677
181689
  `);
181678
181690
  fs32.renameSync(staging, stateFile());
181679
181691
  }
181680
- function contractOf(dir) {
181692
+ function packageInfo(dir) {
181681
181693
  try {
181682
- return JSON.parse(fs32.readFileSync(path35.join(dir, "package.json"), "utf8")).akbContract ?? null;
181694
+ return JSON.parse(fs32.readFileSync(path35.join(dir, "package.json"), "utf8")) ?? {};
181683
181695
  } catch {
181684
- return null;
181696
+ return {};
181685
181697
  }
181686
181698
  }
181687
- var usable = (dir) => fs32.existsSync(entryOf2(dir)) && contractOf(dir) === AKB_CONTRACT;
181699
+ var usable = (dir) => fs32.existsSync(entryOf2(dir)) && packageInfo(dir).akbContract === AKB_CONTRACT;
181688
181700
  function currentAkb() {
181689
181701
  const { current: current2 } = readAkbState();
181690
181702
  if (!current2) return bundledAkb();
@@ -181695,7 +181707,7 @@ function currentAkb() {
181695
181707
  fs32.utimesSync(dir, now, now);
181696
181708
  } catch {
181697
181709
  }
181698
- return { command: process.execPath, args: akbArgs(entryOf2(dir)), version: current2, shim: path35.join(dir, "shim") };
181710
+ return { command: process.execPath, args: akbArgs(entryOf2(dir)), version: current2, canonicalCommands: packageInfo(dir).canonicalCommands === true, shim: path35.join(dir, "shim") };
181699
181711
  }
181700
181712
  var answers2 = (dir, version2) => new Promise((resolve2) => {
181701
181713
  execFile(process.execPath, [entryOf2(dir), "--version"], { cwd: runnerCwd(), timeout: CHECK_MS2, killSignal: "SIGKILL" }, (error62, stdout) => resolve2(!error62 && stdout.trim().split(/\s+/).at(-1) === version2));
@@ -181709,7 +181721,7 @@ function useVersion(current2) {
181709
181721
  async function fetchVersion(version2) {
181710
181722
  const got = await installPackage(AKB, version2);
181711
181723
  if (!got.ok) return console.error(`runner: akb ${version2} was not fetched: ${got.detail}`);
181712
- if (contractOf(got.dir) !== AKB_CONTRACT || !await answers2(got.dir, version2)) {
181724
+ if (packageInfo(got.dir).akbContract !== AKB_CONTRACT || !await answers2(got.dir, version2)) {
181713
181725
  console.error(`runner: akb ${version2} failed its check and will not be used`);
181714
181726
  const state = readAkbState();
181715
181727
  return writeAkbState({ ...state, bad: [.../* @__PURE__ */ new Set([...state.bad, version2])] });
@@ -181931,7 +181943,7 @@ var Set_default = '# Set\n\nGroup three or more previews of one purpose: a `<Set
181931
181943
  var Storyboard_default = '# Storyboard\n\nShow a sequence with `<Storyboard src=".assets/<card id>/<storyboard>.json" label="..." />` alone in a paragraph; `label` is optional. Inline and fenced examples remain text.\n\n- **Frames**: a shot frame or slide preview may be anything an Asset shows, but not a storyboard or compare.\n- **Data contract**: follow the producing agent\'s storyboard contract and validator for its shots or slides, keeping stable IDs and reachable preview files.\n';
181932
181944
 
181933
181945
  // ../cli/src/components/Studio.md
181934
- var Studio_default = '# Studio\n\nShow STUDIO.md and its real differences with `<Studio src=".assets/<card id>/studio-review/review.json" />` alone in a paragraph. Inline and fenced examples remain text.\n\n- **Freeze**: `akb raw studio preview <card id> --folder <draft> --base <baseline>` freezes the complete draft and prints its Studio and attachment tags; use `--base empty` for a new Studio.\n- **Files**: put the attachment tags in the files Preview when present. Three or more changed files use a Set; paired file and diff Assets share a label.\n- **Results**: show trial results as ordinary Preview Components beside the Studio, without a separate manifest or Agent assignment.\n- **Refresh**: rerun after changing the draft; publish only the approved fingerprint. See [the contract](https://github.com/wildcrane-ai/wildcrane/blob/main/docs/api/studio-review.md).\n';
181946
+ var Studio_default = '# Studio\n\nShow STUDIO.md and its real differences with `<Studio src=".assets/<card id>/studio-review/review.json" />` alone in a paragraph. Inline and fenced examples remain text.\n\n- **Freeze**: `akb studio preview <card id> --folder <draft> --base <baseline>` freezes the complete draft and prints its Studio and attachment tags; use `--base empty` for a new Studio.\n- **Files**: put the attachment tags in the files Preview when present. Three or more changed files use a Set; paired file and diff Assets share a label.\n- **Results**: show trial results as ordinary Preview Components beside the Studio, without a separate manifest or Agent assignment.\n- **Refresh**: rerun after changing the draft; publish only the approved fingerprint. See [the contract](https://github.com/wildcrane-ai/wildcrane/blob/main/docs/api/studio-review.md).\n';
181935
181947
 
181936
181948
  // ../cli/src/components/shared.md
181937
181949
  var shared_default = "A Studio is the workbench for one kind of work. A Preview is work shown for review and fine-tuning, as a draft or finished result. Preview Components are the UI components that display it.\n\nTags draw only in the card body; in any other Markdown file, show pictures as plain Markdown images with paths relative to that file.\n";
@@ -182085,10 +182097,10 @@ var RUNTIME_OPTION = {
182085
182097
  description: "the runtime to run on, for this run only (default: the flow's own agent's)"
182086
182098
  };
182087
182099
  var CARRY_OPTIONS = [
182088
- { flags: "--new-session", description: "start planning in a new session" },
182089
- { flags: "--session <id>", description: "the agent session to carry on, over the card's own" },
182090
- { flags: "--fork", description: "with --session: start from a copy of it" },
182091
- { flags: "--transcript <file>", description: "the discussion the card came from, read when no session is carried on" }
182100
+ { internal: true, flags: "--new-session", description: "start planning in a new session" },
182101
+ { internal: true, flags: "--session <id>", description: "the agent session to carry on, over the card's own" },
182102
+ { internal: true, flags: "--fork", description: "with --session: start from a copy of it" },
182103
+ { internal: true, flags: "--transcript <file>", description: "the discussion the card came from, read when no session is carried on" }
182092
182104
  ];
182093
182105
  var FLOWS = [
182094
182106
  {
@@ -182235,7 +182247,7 @@ var PROPOSER = {
182235
182247
  value: "auto",
182236
182248
  label: "Just do them",
182237
182249
  cost: "For speed over quality",
182238
- prompt: `${SMALL_FIX} Do each one instead of proposing it: create it with \`akb raw create --studio <studio> --source "#<finished card id>"\`, its Scope and Todo written per \`akb guide writing\`, then \`akb raw update <id> --status ready\` so it waits only for the user to approve the build.`
182250
+ prompt: `${SMALL_FIX} Do each one instead of proposing it: create it with \`akb task create --title "<title>" --studio <studio> --source "#<finished card id>"\`, its Scope and Todo written per \`akb guide writing\`, then \`akb task update <id> --status ready\` so it waits only for the user to approve the build.`
182239
182251
  },
182240
182252
  { value: "propose", label: "Ask me first", cost: "For balancing speed and quality" },
182241
182253
  {
@@ -184810,7 +184822,7 @@ async function reconcileArchives(ws, base, archives, pending, machine) {
184810
184822
  }
184811
184823
  return errors;
184812
184824
  }
184813
- function taskStudioContext(ws, docs = true) {
184825
+ function taskStudioContext(ws, docs = true, canonicalCommands = true) {
184814
184826
  if (!ws.cloudTask) return "";
184815
184827
  const pin = readPin(ws.cloudTask), held5 = pin && readVersion2(pin.studio, pin.version);
184816
184828
  if (!held5) throw new Error("The task Studio version is not downloaded.");
@@ -184818,20 +184830,22 @@ function taskStudioContext(ws, docs = true) {
184818
184830
  if ("problem" in read6) throw new Error(read6.problem);
184819
184831
  const def = read6.def;
184820
184832
  const notes = readText(path45.join(ws.board, studioRuleFile(held5.id)))?.trim();
184833
+ const studioFile = canonicalCommands ? "akb studio file" : "akb raw file";
184834
+ const components = componentDocsText(allComponents());
184821
184835
  return [
184822
184836
  "<studio>",
184823
184837
  def.rules,
184824
184838
  ...def.previews.map(({ id: id2, instructions }) => `<Preview id="${id2}">
184825
184839
  ${instructions}
184826
184840
  </Preview>`),
184827
- "Prepare only requested outputs. Revise saved work in place and preserve unrelated outputs. Use stable Preview IDs in task results. Read linked resources on demand with akb raw file. Read relevant memory on demand; do not write memory in task runs.",
184841
+ `Prepare only requested outputs. Revise saved work in place and preserve unrelated outputs. Use stable Preview IDs in task results. Read linked resources on demand with \`${studioFile} ${def.id} <path>\`. Read relevant memory on demand; do not write memory in task runs.`,
184828
184842
  held5.files["shared/RULES.md"] ?? "",
184829
184843
  "</studio>",
184830
184844
  ...notes ? [`<rules>
184831
184845
  ${notes}
184832
184846
  </rules>`] : [],
184833
184847
  ...memoryDirectories(ws.board).map((dir) => `Memory directory: ${dir}`),
184834
- ...docs ? ["Preview Components", componentDocsText(allComponents())] : []
184848
+ ...docs ? ["Preview Components", canonicalCommands ? components : components.replace("akb studio preview", "akb raw studio preview")] : []
184835
184849
  ].filter(Boolean).join("\n\n");
184836
184850
  }
184837
184851
 
@@ -185645,11 +185659,11 @@ async function stopRuns(akb, ws, id2, since, ms) {
185645
185659
  const until = Date.now() + ms;
185646
185660
  const call2 = (args2) => runAkb(akb, [...args2, "--board", ws.board], { cwd: ws.cwd, board: ws.board });
185647
185661
  while (Date.now() < until) {
185648
- const runs = answerOf2(await call2(["raw", "run", "list", "--card", String(id2), "--all", "--json"]))?.runs;
185662
+ const runs = answerOf2(await call2(["run", "list", "--card", String(id2), "--all", "--json"]))?.runs;
185649
185663
  const live = (runs ?? []).filter((r2) => r2.status === "running" && (r2.startedAt ?? 0) >= since);
185650
185664
  if (!runs) return false;
185651
185665
  if (!live.length && (runs ?? []).filter((r2) => (r2.startedAt ?? 0) >= since).every((r2) => r2.managedProcess ? connectionStopped(r2.agentPid ? { pid: r2.agentPid, identity: r2.agentIdentity } : void 0) : processesStopped(runMark(r2.sessionId, r2.startedAt), r2.agentPid && r2.agentStartedAt ? { pid: r2.agentPid, since: r2.agentStartedAt } : void 0))) return true;
185652
- for (const r2 of live) await call2(["raw", "run", "stop", r2.sessionId]);
185666
+ for (const r2 of live) await call2(["run", "stop", r2.sessionId]);
185653
185667
  await wait(250);
185654
185668
  }
185655
185669
  return false;
@@ -185818,7 +185832,7 @@ function pickRow(job, r2, machine, reports, servers, mcpFile) {
185818
185832
  return { id: r2.id, name: r2.name, harness: runtime, ...runtimeSettings(runtime, r2.model, r2.settings, r2.id, servers, mcpFile) };
185819
185833
  }
185820
185834
  function recoveryArgs(run3) {
185821
- return run3.finished ? ["raw", "run", "log", run3.id] : ["raw", "run", "resume", run3.id, "--require-session"];
185835
+ return run3.finished ? ["run", "log", run3.id] : ["run", "resume", run3.id, "--require-session"];
185822
185836
  }
185823
185837
  function runsSpent(runs, since, job, io) {
185824
185838
  const source2 = job.flow?.historical_recovery ? void 0 : job.flow?.sync_recovery_of ?? job.syncRecoveryOf ?? io.flowRun?.from;
@@ -185830,12 +185844,12 @@ async function runReview(job, ws, tasks, deps, io) {
185830
185844
  const failed = await setUp(job, ws, deps, io);
185831
185845
  if (failed) return { ok: false, reason: failed };
185832
185846
  const akb = boardAkb(job, ws, deps, io);
185833
- const args2 = io.flowRun ? recoveryArgs(io.flowRun) : ["raw", "memory", "review", "--task", ...tasks];
185847
+ const args2 = io.flowRun ? recoveryArgs(io.flowRun) : ["memory", "review", "--task", ...tasks];
185834
185848
  const ran = await akb([...args2, "--follow", "--events", "--json"], true);
185835
185849
  if (io.lost()) return { ok: false, reason: "" };
185836
185850
  const answer = answerOf2(ran);
185837
185851
  if (ran.code !== 0) return { ok: false, reason: reasonOf(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal3(ran) };
185838
- const runs = answerOf2(await akb(["raw", "run", "list", "--all", "--json"]))?.runs ?? [];
185852
+ const runs = answerOf2(await akb(["run", "list", "--all", "--json"]))?.runs ?? [];
185839
185853
  return { ok: true, report: { ...answer?.result?.trim() ? { reply: answer.result.trim() } : {}, ...spentBy(runsSpent(runs, since, job, io), job) } };
185840
185854
  }
185841
185855
  async function reviewRejections(job, ws, deps, io, refreshReview) {
@@ -185854,7 +185868,7 @@ async function reviewRejections(job, ws, deps, io, refreshReview) {
185854
185868
  const denied = await refreshReview?.();
185855
185869
  if (denied) return { runs: [], failure: denied };
185856
185870
  const ran = await akb(["raw", "review-dismissals", "--follow", "--events", "--json"], true, { AI4KANBAN_REJECTION_INPUT: scratch });
185857
- const runs = (answerOf2(await akb(["raw", "run", "list", "--all", "--json"]))?.runs ?? []).filter((r2) => (r2.startedAt ?? 0) >= since);
185871
+ const runs = (answerOf2(await akb(["run", "list", "--all", "--json"]))?.runs ?? []).filter((r2) => (r2.startedAt ?? 0) >= since);
185858
185872
  if (stopping(io)) return { runs };
185859
185873
  if (ran.code !== 0) return { runs, failure: refusal3(ran) };
185860
185874
  return { runs, laid, session: answerOf2(ran)?.agentSession };
@@ -185884,7 +185898,7 @@ async function runAgent(job, ws, deps, io) {
185884
185898
  const ran2 = await akb2([...args3, "--follow", "--events", "--json"], true);
185885
185899
  if (ran2.code !== 0 || stopping(io)) return { ok: false, reason: refusal3(ran2) };
185886
185900
  const answer2 = answerOf2(ran2);
185887
- const runs2 = answerOf2(await akb2(["raw", "run", "list", "--all", "--json"]))?.runs ?? [];
185901
+ const runs2 = answerOf2(await akb2(["run", "list", "--all", "--json"]))?.runs ?? [];
185888
185902
  return { ok: true, report: {
185889
185903
  reply: answer2?.result,
185890
185904
  session: answer2?.agentSession,
@@ -185897,14 +185911,14 @@ async function runAgent(job, ws, deps, io) {
185897
185911
  return failure3 ? { ok: false, reason: failure3 } : { ok: true, report: { session, ...spentBy(runs2, job) }, reviewed: laid };
185898
185912
  }
185899
185913
  if (name === "reflect" && !tasks?.length) return { ok: true, report: {} };
185900
- const args2 = name === "reflect" ? ["raw", "reflect", "--cards", ...tasks.map((t2) => String(t2.number))] : ["raw", ...name === "prune-memory" ? ["memory", "prune"] : [name]];
185914
+ const args2 = name === "reflect" ? ["raw", "reflect", "--cards", ...tasks.map((t2) => String(t2.number))] : name === "describe-project" ? ["memory", name] : ["raw", ...name === "prune-memory" ? ["memory", "prune"] : [name]];
185901
185915
  const akb = boardAkb(job, ws, deps, io, ws.cloudTask ?? void 0);
185902
- await akb(["raw", "run", "list", "--all", "--json"]);
185916
+ await akb(["run", "list", "--all", "--json"]);
185903
185917
  const ran = await akb([...args2, "--follow", "--events", "--json"], true);
185904
185918
  if (io.lost()) return { ok: false, reason: "" };
185905
185919
  const answer = answerOf2(ran);
185906
185920
  if (ran.code !== 0) return { ok: false, reason: reasonOf(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal3(ran) };
185907
- const runs = answerOf2(await akb(["raw", "run", "list", "--all", "--json"]))?.runs ?? [];
185921
+ const runs = answerOf2(await akb(["run", "list", "--all", "--json"]))?.runs ?? [];
185908
185922
  return { ok: true, report: { ...answer?.agentSession ? { session: answer.agentSession } : {}, ...answer?.result?.trim() ? { reply: answer.result.trim() } : {}, ...spentBy(runsSpent(runs, since, job, io), job) } };
185909
185923
  }
185910
185924
  function writeTranscript(job, dir) {
@@ -185998,7 +186012,7 @@ async function runFlow(job, ws, deps, io) {
185998
186012
  if (denied || stopping(io)) return { code: 1, out: "", last: denied || "Task preparation stopped.", reviewRefused: denied };
185999
186013
  const review = job.taskReview;
186000
186014
  const task = currentTask;
186001
- const startsDelivery = ["delivery resume", "run resume", "card implement"].includes(args2.slice(1, 3).join(" "));
186015
+ const startsDelivery = ["delivery resume", "run resume", "task implement"].includes(args2.slice(0, 2).join(" "));
186002
186016
  if (review && action === "implement" && startsDelivery) {
186003
186017
  previewDirectory ??= fs48.mkdtempSync(path51.join(os8.tmpdir(), "wildcrane-previews-"));
186004
186018
  const inputs = task?.preview_inputs;
@@ -186078,7 +186092,7 @@ ${pictures(job, ws, ws.number)}`);
186078
186092
  const MAX_ATTEMPTS = 3;
186079
186093
  let attempt = io.reconcileRetry?.get()?.attempt ?? 0;
186080
186094
  for (; ; ) {
186081
- const ran = await akb(["raw", "delivery", "reconcile", String(card), "--json"]);
186095
+ const ran = await akb(["delivery", "reconcile", String(card), "--json"]);
186082
186096
  if (stopping(io)) return { kind: "none" };
186083
186097
  const parsed = answerOf2(ran);
186084
186098
  if (ran.code === 0 && parsed?.kind && ["running", "completed", "resumable", "none"].includes(parsed.kind)) {
@@ -186108,7 +186122,7 @@ ${pictures(job, ws, ws.number)}`);
186108
186122
  if (reconciled?.kind === "unverified") {
186109
186123
  io.show(`[recovery] delivery reconciliation unverified${reconciled.deliveryId ? ` (delivery ${reconciled.deliveryId})` : ""}: ${reconciled.diagnostic}
186110
186124
  `);
186111
- const runs = answerOf2(await akb(["raw", "run", "list", "--card", String(card), "--all", "--json"]))?.runs ?? [];
186125
+ const runs = answerOf2(await akb(["run", "list", "--card", String(card), "--all", "--json"]))?.runs ?? [];
186112
186126
  return {
186113
186127
  ok: false,
186114
186128
  reason: "task_recovery_unverified",
@@ -186120,7 +186134,7 @@ ${pictures(job, ws, ws.number)}`);
186120
186134
  const denied = await refreshReview("implement");
186121
186135
  if (denied) return fail(denied);
186122
186136
  if (io.lost()) return fail("");
186123
- const runs = answerOf2(await akb(["raw", "run", "list", "--card", String(card), "--all", "--json"]))?.runs ?? [];
186137
+ const runs = answerOf2(await akb(["run", "list", "--card", String(card), "--all", "--json"]))?.runs ?? [];
186124
186138
  const spent = spentBy([...new Map([...learned, ...runsSpent(runs, since, job, io)].map((r2) => [r2.sessionId, r2])).values()], job);
186125
186139
  return {
186126
186140
  ok: true,
@@ -186171,7 +186185,7 @@ ${pictures(job, ws, ws.number)}`);
186171
186185
  let effectiveVerb = verb;
186172
186186
  const mismatchedReceipt = cloudLanguage(job) === "en" ? "The receipt belongs to a different delivery." : "\u7EED\u8DD1\u8FD4\u56DE\u4E86\u5176\u4ED6\u4EA4\u4ED8\u7684\u7ED3\u679C\uFF0C\u539F\u4EA4\u4ED8\u4FDD\u6301\u672A\u5B8C\u6210\u3002";
186173
186187
  const resumeExistingDelivery = async () => {
186174
- const restored = await launch2(["raw", "delivery", "resume", String(id3), "--json"], false, void 0, "implement");
186188
+ const restored = await launch2(["delivery", "resume", String(id3), "--json"], false, void 0, "implement");
186175
186189
  if (restored.reviewRefused) return fail(restored.reviewRefused);
186176
186190
  const resumed = answerOf2(restored);
186177
186191
  if (io.lost()) return fail("");
@@ -186191,11 +186205,11 @@ ${pictures(job, ws, ws.number)}`);
186191
186205
  const deliveryId2 = reason && reason !== "deliveryActive" ? void 0 : resumed?.deliveryId ?? resumed?.error?.args?.id;
186192
186206
  expectedDelivery = deliveryId2 ?? (reconciled?.kind === "resumable" ? reconciled.deliveryId : void 0);
186193
186207
  if (resumed?.sessionId) {
186194
- continuation = ["raw", "run", "log", resumed.sessionId];
186208
+ continuation = ["run", "log", resumed.sessionId];
186195
186209
  } else if (deliveryId2) {
186196
- const previous = answerOf2(await akb(["raw", "run", "list", "--card", String(id3), "--all", "--json"]))?.runs?.filter((r2) => ["implement", "conflict", "hook"].includes(r2.action ?? "") && r2.deliveryId === deliveryId2).sort((a2, b2) => (b2.startedAt ?? 0) - (a2.startedAt ?? 0))[0];
186210
+ const previous = answerOf2(await akb(["run", "list", "--card", String(id3), "--all", "--json"]))?.runs?.filter((r2) => ["implement", "conflict", "hook"].includes(r2.action ?? "") && r2.deliveryId === deliveryId2).sort((a2, b2) => (b2.startedAt ?? 0) - (a2.startedAt ?? 0))[0];
186197
186211
  if (previous) {
186198
- continuation = ["raw", "run", "resume", previous.sessionId, "--require-session"];
186212
+ continuation = ["run", "resume", previous.sessionId, "--require-session"];
186199
186213
  }
186200
186214
  }
186201
186215
  return void 0;
@@ -186203,11 +186217,11 @@ ${pictures(job, ws, ws.number)}`);
186203
186217
  if (io.flowRun) {
186204
186218
  expectedDelivery = io.flowRun.deliveryId;
186205
186219
  if (expectedDelivery) effectiveVerb = "implement";
186206
- continuation = io.repairDelivery ? ["raw", "run", "resume", io.flowRun.id, "--require-session"] : recoveryArgs(io.flowRun);
186220
+ continuation = io.repairDelivery ? ["run", "resume", io.flowRun.id, "--require-session"] : recoveryArgs(io.flowRun);
186207
186221
  } else if (reconciled?.kind === "running") {
186208
186222
  expectedDelivery = reconciled.deliveryId;
186209
186223
  if (expectedDelivery) effectiveVerb = "implement";
186210
- continuation = ["raw", "run", "log", reconciled.sessionId];
186224
+ continuation = ["run", "log", reconciled.sessionId];
186211
186225
  } else if (reconciled?.kind === "resumable") {
186212
186226
  const denied = hasReview ? await refreshReview("revise") : void 0;
186213
186227
  if (denied) return fail(denied);
@@ -186223,7 +186237,7 @@ ${pictures(job, ws, ws.number)}`);
186223
186237
  const done = await resumeExistingDelivery();
186224
186238
  if (done) return done;
186225
186239
  } else {
186226
- const released = await akb(["raw", "delivery", "release", String(id3), "--json"]);
186240
+ const released = await akb(["delivery", "release", String(id3), "--json"]);
186227
186241
  if (released.code !== 0) {
186228
186242
  io.show(`[recovery] failed to release delivery lock${reconciled.deliveryId ? ` (delivery ${reconciled.deliveryId})` : ""}: ${refusal3(released)}
186229
186243
  `);
@@ -186238,7 +186252,7 @@ ${pictures(job, ws, ws.number)}`);
186238
186252
  const done = await resumeExistingDelivery();
186239
186253
  if (done) return done;
186240
186254
  } else if (verb === "implement" && text3) {
186241
- const resolved = await launch2(["raw", "card", "resolve", String(id3), "--follow", "--events", "--json", "--", text3], true);
186255
+ const resolved = await launch2(["task", "resolve", String(id3), "--follow", "--events", "--json", "--", text3], true);
186242
186256
  if (resolved.reviewRefused) return fail(resolved.reviewRefused);
186243
186257
  if (io.lost()) return fail("");
186244
186258
  if (isRejected()) ran = resolved;
@@ -186252,12 +186266,13 @@ ${pictures(job, ws, ws.number)}`);
186252
186266
  const fresh = (fromTranscript = false) => {
186253
186267
  const carry = carryArgs(effectiveVerb, fromTranscript);
186254
186268
  const costFrom = carry.includes("--session") && typeof job.resumeCostUsd === "number" ? { [SESSION_COST_ENV]: String(job.resumeCostUsd) } : void 0;
186255
- return launch2(["raw", "card", effectiveVerb, String(id3), "--follow", "--events", "--json", ...carry, ...note ? ["--", note] : []], true, costFrom, effectiveVerb);
186269
+ const command = effectiveVerb === "approve" ? ["raw", "card", "approve"] : ["task", effectiveVerb];
186270
+ return launch2([...command, String(id3), "--follow", "--events", "--json", ...carry, ...note ? ["--", note] : []], true, costFrom, effectiveVerb);
186256
186271
  };
186257
186272
  ran ??= await (continuation ? launch2([...continuation, "--follow", "--events", "--json"], true, void 0, effectiveVerb) : fresh());
186258
186273
  if (ran.reviewRefused) return fail(ran.reviewRefused);
186259
186274
  if (io.lost()) return fail("");
186260
- const readRuns = async () => answerOf2(await akb(["raw", "run", "list", "--card", String(id3), "--all", "--json"]))?.runs ?? [];
186275
+ const readRuns = async () => answerOf2(await akb(["run", "list", "--card", String(id3), "--all", "--json"]))?.runs ?? [];
186261
186276
  const lastRun = (answer2) => answer2?.lastSessionId ?? answer2?.error?.lastSessionId;
186262
186277
  let answer = answerOf2(ran);
186263
186278
  let runs = await readRuns();
@@ -186342,7 +186357,7 @@ ${pictures(job, ws, ws.number)}`);
186342
186357
  const card = akbCardOf(ws) ?? flow.card;
186343
186358
  if (!card) return { ok: true, report: {} };
186344
186359
  for (const delivery of checkoutsOf(ws, card)) {
186345
- const ran = await akb(["raw", "delivery", "cancel", delivery, "--json"], true);
186360
+ const ran = await akb(["delivery", "cancel", delivery, "--json"], true);
186346
186361
  if (ran.code !== 0) return fail(refusal3(ran));
186347
186362
  }
186348
186363
  return { ok: true, report: { card } };
@@ -186368,7 +186383,7 @@ function landingOf(delivery) {
186368
186383
  async function confirmFlowStopped(ws, job, deps) {
186369
186384
  const id2 = akbCardOf(ws) ?? job.number;
186370
186385
  if (!id2) return false;
186371
- const ran = await runAkb(deps.akb, ["raw", "run", "list", "--card", String(id2), "--all", "--json", "--board", ws.board], { cwd: ws.cwd, board: ws.board });
186386
+ const ran = await runAkb(deps.akb, ["run", "list", "--card", String(id2), "--all", "--json", "--board", ws.board], { cwd: ws.cwd, board: ws.board });
186372
186387
  const runs = answerOf2(ran)?.runs;
186373
186388
  return !!runs && runs.every((r2) => r2.status !== "running" && (r2.managedProcess ? connectionStopped(r2.agentPid ? { pid: r2.agentPid, identity: r2.agentIdentity } : void 0) : processesStopped(
186374
186389
  runMark(r2.sessionId, r2.startedAt),
@@ -186383,7 +186398,7 @@ async function flowRunEvidence(ws, job, deps, execution = job.id, prior) {
186383
186398
  }, track() {
186384
186399
  }, onStop() {
186385
186400
  }, lost: () => false });
186386
- const ran = await akb(["raw", "run", "list", "--all", "--json", ...id2 ? ["--card", String(id2)] : []]);
186401
+ const ran = await akb(["run", "list", "--all", "--json", ...id2 ? ["--card", String(id2)] : []]);
186387
186402
  const allRuns = answerOf2(ran)?.runs;
186388
186403
  if (!allRuns) return { stopped: false };
186389
186404
  const owned = allRuns.filter((run3) => run3.cloudExecution?.machine === deps.machineId && (run3.cloudExecution.job === execution || run3.sessionId === prior?.id && run3.cloudExecution.job === prior.from));
@@ -188202,7 +188217,7 @@ async function runClaimedStep(job, deps, track, keep2, lease, scope, replyStream
188202
188217
  if (!job.flow && !job.review) {
188203
188218
  void refreshCatalog();
188204
188219
  const attachments = writeAttachments(job);
188205
- const head2 = (syncDiagnostic ? syncDiagnostic + "\n\n" : "") + (job.taskReview ? reviewBoundary(job.taskReview) + "\n\n" : "") + folderLines(job.agent ? null : ws) + (ws ? "\n\n" + conflictPrompt(ws.board) : "") + (ws && !job.agent ? "\n\n" + taskStudioContext(ws, !job.resume) : "") + attachments.text;
188220
+ const head2 = (syncDiagnostic ? syncDiagnostic + "\n\n" : "") + (job.taskReview ? reviewBoundary(job.taskReview) + "\n\n" : "") + folderLines(job.agent ? null : ws) + (ws ? "\n\n" + conflictPrompt(ws.board) : "") + (ws && !job.agent ? "\n\n" + taskStudioContext(ws, !job.resume, deps.akb.canonicalCommands === true) : "") + attachments.text;
188206
188221
  const file3 = writeTranscript(job, attachmentsOf(job));
188207
188222
  const transcript = file3 ? `
188208
188223
 
@@ -190022,7 +190037,7 @@ function startRunner(options) {
190022
190037
  if (card) {
190023
190038
  if (job.flow && job.flow.verb !== "discard") {
190024
190039
  const reconciled = answerOf2(
190025
- await runAkb(deps().akb(), ["raw", "delivery", "reconcile", String(card), "--json", "--board", ws.board], { cwd: ws.cwd, board: ws.board })
190040
+ await runAkb(deps().akb(), ["delivery", "reconcile", String(card), "--json", "--board", ws.board], { cwd: ws.cwd, board: ws.board })
190026
190041
  );
190027
190042
  if (reconciled?.kind === "running" && reconciled.deliveryId) return;
190028
190043
  }
package/dist/settings.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.108 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.109 — 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;
@@ -61045,8 +61045,8 @@ function cloudProblem(response, body) {
61045
61045
  }
61046
61046
 
61047
61047
  // src/protocol.ts
61048
- var VERSION = true ? "0.6.108" : "0.0.0";
61049
- var AKB_VERSION = true ? "0.11.88" : "0.0.0";
61048
+ var VERSION = true ? "0.6.109" : "0.0.0";
61049
+ var AKB_VERSION = true ? "0.11.89" : "0.0.0";
61050
61050
 
61051
61051
  // ../cli/src/lib/agent/harnesses/antigravity.ts
61052
61052
  import fs7 from "node:fs";
@@ -63569,8 +63569,9 @@ function createTail(log) {
63569
63569
  // ../cli/package.json
63570
63570
  var package_default = {
63571
63571
  name: "wildcrane",
63572
- version: "0.11.88",
63572
+ version: "0.11.89",
63573
63573
  akbContract: 29,
63574
+ canonicalCommands: true,
63574
63575
  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.",
63575
63576
  keywords: [
63576
63577
  "kanban",
@@ -65380,6 +65381,7 @@ function boardLockName(kanban, root2) {
65380
65381
  const name = from && !from.startsWith("..") ? from : path14.basename(kanban);
65381
65382
  return `${name.split(path14.sep).join("-")}.lock`;
65382
65383
  }
65384
+ var shellWord = (value) => /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, "\\$&")}"`;
65383
65385
  var BOARD_FLAG = "";
65384
65386
  function setBoard(kanban, root2, flag) {
65385
65387
  REPO_ROOT = path14.resolve(root2);
@@ -65425,7 +65427,7 @@ function setBoard(kanban, root2, flag) {
65425
65427
  }
65426
65428
  function setBoardRoot(root2, named = false) {
65427
65429
  const project = path14.resolve(root2);
65428
- return setBoard(path14.join(project, "docs", "kanban"), project, named ? ` --dir ${project}` : "");
65430
+ return setBoard(path14.join(project, "docs", "kanban"), project, named ? ` --dir ${shellWord(project)}` : "");
65429
65431
  }
65430
65432
  setBoardRoot(process.cwd());
65431
65433
 
@@ -67655,6 +67657,7 @@ var bundledAkb = (dist = HERE) => ({
67655
67657
  command: process.execPath,
67656
67658
  args: akbArgs(path27.join(dist, "akb", "bin", "ai4kanban.mjs"), dist),
67657
67659
  version: AKB_VERSION,
67660
+ canonicalCommands: true,
67658
67661
  shim: path27.join(akbHome(), BUNDLED_SHIM)
67659
67662
  });
67660
67663
  var quote = (s) => /^[\w./:@=-]+$/.test(s) ? s : `"${s}"`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane-runner",
3
- "version": "0.6.108",
3
+ "version": "0.6.109",
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/",