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.
@@ -1 +1 @@
1
- {"name":"wildcrane","version":"0.11.88","akbContract":29,"type":"module","private":true}
1
+ {"name":"wildcrane","version":"0.11.89","akbContract":29,"type":"module","private":true}
@@ -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;
@@ -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;
@@ -27531,6 +27531,7 @@ function boardLockName(kanban, root) {
27531
27531
  const name = from && !from.startsWith("..") ? from : path2.basename(kanban);
27532
27532
  return `${name.split(path2.sep).join("-")}.lock`;
27533
27533
  }
27534
+ var shellWord = (value) => /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, "\\$&")}"`;
27534
27535
  var BOARD_FLAG = "";
27535
27536
  function setBoard(kanban, root, flag) {
27536
27537
  REPO_ROOT = path2.resolve(root);
@@ -27576,7 +27577,7 @@ function setBoard(kanban, root, flag) {
27576
27577
  }
27577
27578
  function setBoardRoot(root, named = false) {
27578
27579
  const project = path2.resolve(root);
27579
- return setBoard(path2.join(project, "docs", "kanban"), project, named ? ` --dir ${project}` : "");
27580
+ return setBoard(path2.join(project, "docs", "kanban"), project, named ? ` --dir ${shellWord(project)}` : "");
27580
27581
  }
27581
27582
  setBoardRoot(process.cwd());
27582
27583
 
@@ -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;
@@ -26791,6 +26791,7 @@ function boardLockName(kanban, root) {
26791
26791
  const name = from && !from.startsWith("..") ? from : path2.basename(kanban);
26792
26792
  return `${name.split(path2.sep).join("-")}.lock`;
26793
26793
  }
26794
+ var shellWord = (value) => /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, "\\$&")}"`;
26794
26795
  var BOARD_FLAG = "";
26795
26796
  function setBoard(kanban, root, flag) {
26796
26797
  REPO_ROOT = path2.resolve(root);
@@ -26836,7 +26837,7 @@ function setBoard(kanban, root, flag) {
26836
26837
  }
26837
26838
  function setBoardRoot(root, named = false) {
26838
26839
  const project = path2.resolve(root);
26839
- return setBoard(path2.join(project, "docs", "kanban"), project, named ? ` --dir ${project}` : "");
26840
+ return setBoard(path2.join(project, "docs", "kanban"), project, named ? ` --dir ${shellWord(project)}` : "");
26840
26841
  }
26841
26842
  setBoardRoot(process.cwd());
26842
26843
 
@@ -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;
@@ -152111,6 +152111,7 @@ function boardLockName(kanban, root2) {
152111
152111
  const name = from && !from.startsWith("..") ? from : path5.basename(kanban);
152112
152112
  return `${name.split(path5.sep).join("-")}.lock`;
152113
152113
  }
152114
+ var shellWord = (value) => /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, "\\$&")}"`;
152114
152115
  var BOARD_FLAG = "";
152115
152116
  function setBoard(kanban, root2, flag) {
152116
152117
  REPO_ROOT = path5.resolve(root2);
@@ -152156,7 +152157,7 @@ function setBoard(kanban, root2, flag) {
152156
152157
  }
152157
152158
  function setBoardRoot(root2, named = false) {
152158
152159
  const project = path5.resolve(root2);
152159
- return setBoard(path5.join(project, "docs", "kanban"), project, named ? ` --dir ${project}` : "");
152160
+ return setBoard(path5.join(project, "docs", "kanban"), project, named ? ` --dir ${shellWord(project)}` : "");
152160
152161
  }
152161
152162
  setBoardRoot(process.cwd());
152162
152163
  var rel = (p2) => {
@@ -172318,7 +172319,7 @@ function cloudProblem(response, body) {
172318
172319
  }
172319
172320
 
172320
172321
  // src/protocol.ts
172321
- var AKB_VERSION = true ? "0.11.88" : "0.0.0";
172322
+ var AKB_VERSION = true ? "0.11.89" : "0.0.0";
172322
172323
  var AKB_CONTRACT = true ? 29 : 0;
172323
172324
 
172324
172325
  // src/secrets.ts
@@ -174987,8 +174988,9 @@ function createTail(log) {
174987
174988
  // ../cli/package.json
174988
174989
  var package_default = {
174989
174990
  name: "wildcrane",
174990
- version: "0.11.88",
174991
+ version: "0.11.89",
174991
174992
  akbContract: 29,
174993
+ canonicalCommands: true,
174992
174994
  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.",
174993
174995
  keywords: [
174994
174996
  "kanban",
@@ -179279,7 +179281,7 @@ function conflictPrompt(board, work = "Continue the original work from its saved
179279
179281
  const records = conflictList(board);
179280
179282
  return records.length ? [
179281
179283
  "Resolve these saved board content conflicts using `akb guide resolve-conflict` before continuing.",
179282
- ...records.map((r2) => `${r2.id}: ${r2.paths.join(", ")}; read with akb raw conflict show ${r2.id}.`),
179284
+ ...records.map((r2) => `${r2.id}: ${r2.paths.join(", ")}; read with akb board conflict show ${r2.id}.`),
179283
179285
  work
179284
179286
  ].join("\n") : "";
179285
179287
  }
@@ -179485,6 +179487,7 @@ var bundledAkb = (dist = HERE) => ({
179485
179487
  command: process.execPath,
179486
179488
  args: akbArgs(path28.join(dist, "akb", "bin", "ai4kanban.mjs"), dist),
179487
179489
  version: AKB_VERSION,
179490
+ canonicalCommands: true,
179488
179491
  shim: path28.join(akbHome(), BUNDLED_SHIM)
179489
179492
  });
179490
179493
  var quote = (s) => /^[\w./:@=-]+$/.test(s) ? s : `"${s}"`;
@@ -179525,6 +179528,15 @@ function akbEnv(akb, board, task, language, base = process.env) {
179525
179528
  return env2;
179526
179529
  }
179527
179530
  var KEEP = 256 * 1024;
179531
+ function compatibleArgs(akb, args2) {
179532
+ if (akb.canonicalCommands) return args2;
179533
+ const [group, verb, ...rest] = args2;
179534
+ if (group === "run" || group === "delivery") return ["raw", ...args2];
179535
+ if (group === "task" && verb && ["refine", "revise", "resolve", "implement"].includes(verb)) return ["raw", "card", verb, ...rest];
179536
+ if (group === "memory" && verb === "describe-project") return ["raw", verb, ...rest];
179537
+ if (group === "memory" && verb === "review") return ["raw", ...args2];
179538
+ return args2;
179539
+ }
179528
179540
  function runAkb(akb, args2, opts) {
179529
179541
  return new Promise((resolve2) => {
179530
179542
  let out = "";
@@ -179535,7 +179547,7 @@ function runAkb(akb, args2, opts) {
179535
179547
  };
179536
179548
  let child;
179537
179549
  try {
179538
- child = spawn2(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"] });
179550
+ child = spawn2(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"] });
179539
179551
  } catch (e2) {
179540
179552
  return resolve2({ code: null, out: "", last: e2 instanceof Error ? e2.message : String(e2) });
179541
179553
  }
@@ -180049,7 +180061,7 @@ var Set_default = '# Set\n\nGroup three or more previews of one purpose: a `<Set
180049
180061
  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';
180050
180062
 
180051
180063
  // ../cli/src/components/Studio.md
180052
- 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';
180064
+ 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';
180053
180065
 
180054
180066
  // ../cli/src/components/shared.md
180055
180067
  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";
@@ -180203,10 +180215,10 @@ var RUNTIME_OPTION = {
180203
180215
  description: "the runtime to run on, for this run only (default: the flow's own agent's)"
180204
180216
  };
180205
180217
  var CARRY_OPTIONS = [
180206
- { flags: "--new-session", description: "start planning in a new session" },
180207
- { flags: "--session <id>", description: "the agent session to carry on, over the card's own" },
180208
- { flags: "--fork", description: "with --session: start from a copy of it" },
180209
- { flags: "--transcript <file>", description: "the discussion the card came from, read when no session is carried on" }
180218
+ { internal: true, flags: "--new-session", description: "start planning in a new session" },
180219
+ { internal: true, flags: "--session <id>", description: "the agent session to carry on, over the card's own" },
180220
+ { internal: true, flags: "--fork", description: "with --session: start from a copy of it" },
180221
+ { internal: true, flags: "--transcript <file>", description: "the discussion the card came from, read when no session is carried on" }
180210
180222
  ];
180211
180223
  var FLOWS = [
180212
180224
  {
@@ -180353,7 +180365,7 @@ var PROPOSER = {
180353
180365
  value: "auto",
180354
180366
  label: "Just do them",
180355
180367
  cost: "For speed over quality",
180356
- 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.`
180368
+ 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.`
180357
180369
  },
180358
180370
  { value: "propose", label: "Ask me first", cost: "For balancing speed and quality" },
180359
180371
  {
@@ -182860,7 +182872,7 @@ async function reconcileArchives(ws, base, archives, pending, machine) {
182860
182872
  }
182861
182873
  return errors;
182862
182874
  }
182863
- function taskStudioContext(ws, docs = true) {
182875
+ function taskStudioContext(ws, docs = true, canonicalCommands = true) {
182864
182876
  if (!ws.cloudTask) return "";
182865
182877
  const pin = readPin(ws.cloudTask), held5 = pin && readVersion2(pin.studio, pin.version);
182866
182878
  if (!held5) throw new Error("The task Studio version is not downloaded.");
@@ -182868,20 +182880,22 @@ function taskStudioContext(ws, docs = true) {
182868
182880
  if ("problem" in read5) throw new Error(read5.problem);
182869
182881
  const def = read5.def;
182870
182882
  const notes = readText(path38.join(ws.board, studioRuleFile(held5.id)))?.trim();
182883
+ const studioFile = canonicalCommands ? "akb studio file" : "akb raw file";
182884
+ const components = componentDocsText(allComponents());
182871
182885
  return [
182872
182886
  "<studio>",
182873
182887
  def.rules,
182874
182888
  ...def.previews.map(({ id: id2, instructions }) => `<Preview id="${id2}">
182875
182889
  ${instructions}
182876
182890
  </Preview>`),
182877
- "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.",
182891
+ `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.`,
182878
182892
  held5.files["shared/RULES.md"] ?? "",
182879
182893
  "</studio>",
182880
182894
  ...notes ? [`<rules>
182881
182895
  ${notes}
182882
182896
  </rules>`] : [],
182883
182897
  ...memoryDirectories(ws.board).map((dir) => `Memory directory: ${dir}`),
182884
- ...docs ? ["Preview Components", componentDocsText(allComponents())] : []
182898
+ ...docs ? ["Preview Components", canonicalCommands ? components : components.replace("akb studio preview", "akb raw studio preview")] : []
182885
182899
  ].filter(Boolean).join("\n\n");
182886
182900
  }
182887
182901
 
@@ -183313,11 +183327,11 @@ async function stopRuns(akb, ws, id2, since, ms) {
183313
183327
  const until = Date.now() + ms;
183314
183328
  const call2 = (args2) => runAkb(akb, [...args2, "--board", ws.board], { cwd: ws.cwd, board: ws.board });
183315
183329
  while (Date.now() < until) {
183316
- const runs = answerOf2(await call2(["raw", "run", "list", "--card", String(id2), "--all", "--json"]))?.runs;
183330
+ const runs = answerOf2(await call2(["run", "list", "--card", String(id2), "--all", "--json"]))?.runs;
183317
183331
  const live = (runs ?? []).filter((r2) => r2.status === "running" && (r2.startedAt ?? 0) >= since);
183318
183332
  if (!runs) return false;
183319
183333
  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;
183320
- for (const r2 of live) await call2(["raw", "run", "stop", r2.sessionId]);
183334
+ for (const r2 of live) await call2(["run", "stop", r2.sessionId]);
183321
183335
  await wait(250);
183322
183336
  }
183323
183337
  return false;
@@ -183481,7 +183495,7 @@ function pickRow(job, r2, machine, reports, servers, mcpFile) {
183481
183495
  return { id: r2.id, name: r2.name, harness: runtime, ...runtimeSettings(runtime, r2.model, r2.settings, r2.id, servers, mcpFile) };
183482
183496
  }
183483
183497
  function recoveryArgs(run3) {
183484
- return run3.finished ? ["raw", "run", "log", run3.id] : ["raw", "run", "resume", run3.id, "--require-session"];
183498
+ return run3.finished ? ["run", "log", run3.id] : ["run", "resume", run3.id, "--require-session"];
183485
183499
  }
183486
183500
  function runsSpent(runs, since, job, io) {
183487
183501
  const source2 = job.flow?.historical_recovery ? void 0 : job.flow?.sync_recovery_of ?? job.syncRecoveryOf ?? io.flowRun?.from;
@@ -183493,12 +183507,12 @@ async function runReview(job, ws, tasks, deps, io) {
183493
183507
  const failed = await setUp(job, ws, deps, io);
183494
183508
  if (failed) return { ok: false, reason: failed };
183495
183509
  const akb = boardAkb(job, ws, deps, io);
183496
- const args2 = io.flowRun ? recoveryArgs(io.flowRun) : ["raw", "memory", "review", "--task", ...tasks];
183510
+ const args2 = io.flowRun ? recoveryArgs(io.flowRun) : ["memory", "review", "--task", ...tasks];
183497
183511
  const ran = await akb([...args2, "--follow", "--events", "--json"], true);
183498
183512
  if (io.lost()) return { ok: false, reason: "" };
183499
183513
  const answer = answerOf2(ran);
183500
183514
  if (ran.code !== 0) return { ok: false, reason: reasonOf(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal2(ran) };
183501
- const runs = answerOf2(await akb(["raw", "run", "list", "--all", "--json"]))?.runs ?? [];
183515
+ const runs = answerOf2(await akb(["run", "list", "--all", "--json"]))?.runs ?? [];
183502
183516
  return { ok: true, report: { ...answer?.result?.trim() ? { reply: answer.result.trim() } : {}, ...spentBy(runsSpent(runs, since, job, io), job) } };
183503
183517
  }
183504
183518
  async function reviewRejections(job, ws, deps, io, refreshReview) {
@@ -183517,7 +183531,7 @@ async function reviewRejections(job, ws, deps, io, refreshReview) {
183517
183531
  const denied = await refreshReview?.();
183518
183532
  if (denied) return { runs: [], failure: denied };
183519
183533
  const ran = await akb(["raw", "review-dismissals", "--follow", "--events", "--json"], true, { AI4KANBAN_REJECTION_INPUT: scratch });
183520
- const runs = (answerOf2(await akb(["raw", "run", "list", "--all", "--json"]))?.runs ?? []).filter((r2) => (r2.startedAt ?? 0) >= since);
183534
+ const runs = (answerOf2(await akb(["run", "list", "--all", "--json"]))?.runs ?? []).filter((r2) => (r2.startedAt ?? 0) >= since);
183521
183535
  if (stopping(io)) return { runs };
183522
183536
  if (ran.code !== 0) return { runs, failure: refusal2(ran) };
183523
183537
  return { runs, laid, session: answerOf2(ran)?.agentSession };
@@ -183547,7 +183561,7 @@ async function runAgent(job, ws, deps, io) {
183547
183561
  const ran2 = await akb2([...args3, "--follow", "--events", "--json"], true);
183548
183562
  if (ran2.code !== 0 || stopping(io)) return { ok: false, reason: refusal2(ran2) };
183549
183563
  const answer2 = answerOf2(ran2);
183550
- const runs2 = answerOf2(await akb2(["raw", "run", "list", "--all", "--json"]))?.runs ?? [];
183564
+ const runs2 = answerOf2(await akb2(["run", "list", "--all", "--json"]))?.runs ?? [];
183551
183565
  return { ok: true, report: {
183552
183566
  reply: answer2?.result,
183553
183567
  session: answer2?.agentSession,
@@ -183560,14 +183574,14 @@ async function runAgent(job, ws, deps, io) {
183560
183574
  return failure2 ? { ok: false, reason: failure2 } : { ok: true, report: { session, ...spentBy(runs2, job) }, reviewed: laid };
183561
183575
  }
183562
183576
  if (name === "reflect" && !tasks?.length) return { ok: true, report: {} };
183563
- const args2 = name === "reflect" ? ["raw", "reflect", "--cards", ...tasks.map((t) => String(t.number))] : ["raw", ...name === "prune-memory" ? ["memory", "prune"] : [name]];
183577
+ const args2 = name === "reflect" ? ["raw", "reflect", "--cards", ...tasks.map((t) => String(t.number))] : name === "describe-project" ? ["memory", name] : ["raw", ...name === "prune-memory" ? ["memory", "prune"] : [name]];
183564
183578
  const akb = boardAkb(job, ws, deps, io, ws.cloudTask ?? void 0);
183565
- await akb(["raw", "run", "list", "--all", "--json"]);
183579
+ await akb(["run", "list", "--all", "--json"]);
183566
183580
  const ran = await akb([...args2, "--follow", "--events", "--json"], true);
183567
183581
  if (io.lost()) return { ok: false, reason: "" };
183568
183582
  const answer = answerOf2(ran);
183569
183583
  if (ran.code !== 0) return { ok: false, reason: reasonOf(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal2(ran) };
183570
- const runs = answerOf2(await akb(["raw", "run", "list", "--all", "--json"]))?.runs ?? [];
183584
+ const runs = answerOf2(await akb(["run", "list", "--all", "--json"]))?.runs ?? [];
183571
183585
  return { ok: true, report: { ...answer?.agentSession ? { session: answer.agentSession } : {}, ...answer?.result?.trim() ? { reply: answer.result.trim() } : {}, ...spentBy(runsSpent(runs, since, job, io), job) } };
183572
183586
  }
183573
183587
  function writeTranscript(job, dir) {
@@ -183661,7 +183675,7 @@ async function runFlow(job, ws, deps, io) {
183661
183675
  if (denied || stopping(io)) return { code: 1, out: "", last: denied || "Task preparation stopped.", reviewRefused: denied };
183662
183676
  const review = job.taskReview;
183663
183677
  const task = currentTask;
183664
- const startsDelivery = ["delivery resume", "run resume", "card implement"].includes(args2.slice(1, 3).join(" "));
183678
+ const startsDelivery = ["delivery resume", "run resume", "task implement"].includes(args2.slice(0, 2).join(" "));
183665
183679
  if (review && action === "implement" && startsDelivery) {
183666
183680
  previewDirectory ??= fs38.mkdtempSync(path42.join(os6.tmpdir(), "wildcrane-previews-"));
183667
183681
  const inputs = task?.preview_inputs;
@@ -183741,7 +183755,7 @@ ${pictures(job, ws, ws.number)}`);
183741
183755
  const MAX_ATTEMPTS = 3;
183742
183756
  let attempt = io.reconcileRetry?.get()?.attempt ?? 0;
183743
183757
  for (; ; ) {
183744
- const ran = await akb(["raw", "delivery", "reconcile", String(card), "--json"]);
183758
+ const ran = await akb(["delivery", "reconcile", String(card), "--json"]);
183745
183759
  if (stopping(io)) return { kind: "none" };
183746
183760
  const parsed = answerOf2(ran);
183747
183761
  if (ran.code === 0 && parsed?.kind && ["running", "completed", "resumable", "none"].includes(parsed.kind)) {
@@ -183771,7 +183785,7 @@ ${pictures(job, ws, ws.number)}`);
183771
183785
  if (reconciled?.kind === "unverified") {
183772
183786
  io.show(`[recovery] delivery reconciliation unverified${reconciled.deliveryId ? ` (delivery ${reconciled.deliveryId})` : ""}: ${reconciled.diagnostic}
183773
183787
  `);
183774
- const runs = answerOf2(await akb(["raw", "run", "list", "--card", String(card), "--all", "--json"]))?.runs ?? [];
183788
+ const runs = answerOf2(await akb(["run", "list", "--card", String(card), "--all", "--json"]))?.runs ?? [];
183775
183789
  return {
183776
183790
  ok: false,
183777
183791
  reason: "task_recovery_unverified",
@@ -183783,7 +183797,7 @@ ${pictures(job, ws, ws.number)}`);
183783
183797
  const denied = await refreshReview("implement");
183784
183798
  if (denied) return fail(denied);
183785
183799
  if (io.lost()) return fail("");
183786
- const runs = answerOf2(await akb(["raw", "run", "list", "--card", String(card), "--all", "--json"]))?.runs ?? [];
183800
+ const runs = answerOf2(await akb(["run", "list", "--card", String(card), "--all", "--json"]))?.runs ?? [];
183787
183801
  const spent = spentBy([...new Map([...learned, ...runsSpent(runs, since, job, io)].map((r2) => [r2.sessionId, r2])).values()], job);
183788
183802
  return {
183789
183803
  ok: true,
@@ -183834,7 +183848,7 @@ ${pictures(job, ws, ws.number)}`);
183834
183848
  let effectiveVerb = verb;
183835
183849
  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";
183836
183850
  const resumeExistingDelivery = async () => {
183837
- const restored = await launch2(["raw", "delivery", "resume", String(id3), "--json"], false, void 0, "implement");
183851
+ const restored = await launch2(["delivery", "resume", String(id3), "--json"], false, void 0, "implement");
183838
183852
  if (restored.reviewRefused) return fail(restored.reviewRefused);
183839
183853
  const resumed = answerOf2(restored);
183840
183854
  if (io.lost()) return fail("");
@@ -183854,11 +183868,11 @@ ${pictures(job, ws, ws.number)}`);
183854
183868
  const deliveryId2 = reason && reason !== "deliveryActive" ? void 0 : resumed?.deliveryId ?? resumed?.error?.args?.id;
183855
183869
  expectedDelivery = deliveryId2 ?? (reconciled?.kind === "resumable" ? reconciled.deliveryId : void 0);
183856
183870
  if (resumed?.sessionId) {
183857
- continuation = ["raw", "run", "log", resumed.sessionId];
183871
+ continuation = ["run", "log", resumed.sessionId];
183858
183872
  } else if (deliveryId2) {
183859
- 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];
183873
+ 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];
183860
183874
  if (previous) {
183861
- continuation = ["raw", "run", "resume", previous.sessionId, "--require-session"];
183875
+ continuation = ["run", "resume", previous.sessionId, "--require-session"];
183862
183876
  }
183863
183877
  }
183864
183878
  return void 0;
@@ -183866,11 +183880,11 @@ ${pictures(job, ws, ws.number)}`);
183866
183880
  if (io.flowRun) {
183867
183881
  expectedDelivery = io.flowRun.deliveryId;
183868
183882
  if (expectedDelivery) effectiveVerb = "implement";
183869
- continuation = io.repairDelivery ? ["raw", "run", "resume", io.flowRun.id, "--require-session"] : recoveryArgs(io.flowRun);
183883
+ continuation = io.repairDelivery ? ["run", "resume", io.flowRun.id, "--require-session"] : recoveryArgs(io.flowRun);
183870
183884
  } else if (reconciled?.kind === "running") {
183871
183885
  expectedDelivery = reconciled.deliveryId;
183872
183886
  if (expectedDelivery) effectiveVerb = "implement";
183873
- continuation = ["raw", "run", "log", reconciled.sessionId];
183887
+ continuation = ["run", "log", reconciled.sessionId];
183874
183888
  } else if (reconciled?.kind === "resumable") {
183875
183889
  const denied = hasReview ? await refreshReview("revise") : void 0;
183876
183890
  if (denied) return fail(denied);
@@ -183886,7 +183900,7 @@ ${pictures(job, ws, ws.number)}`);
183886
183900
  const done = await resumeExistingDelivery();
183887
183901
  if (done) return done;
183888
183902
  } else {
183889
- const released = await akb(["raw", "delivery", "release", String(id3), "--json"]);
183903
+ const released = await akb(["delivery", "release", String(id3), "--json"]);
183890
183904
  if (released.code !== 0) {
183891
183905
  io.show(`[recovery] failed to release delivery lock${reconciled.deliveryId ? ` (delivery ${reconciled.deliveryId})` : ""}: ${refusal2(released)}
183892
183906
  `);
@@ -183901,7 +183915,7 @@ ${pictures(job, ws, ws.number)}`);
183901
183915
  const done = await resumeExistingDelivery();
183902
183916
  if (done) return done;
183903
183917
  } else if (verb === "implement" && text3) {
183904
- const resolved = await launch2(["raw", "card", "resolve", String(id3), "--follow", "--events", "--json", "--", text3], true);
183918
+ const resolved = await launch2(["task", "resolve", String(id3), "--follow", "--events", "--json", "--", text3], true);
183905
183919
  if (resolved.reviewRefused) return fail(resolved.reviewRefused);
183906
183920
  if (io.lost()) return fail("");
183907
183921
  if (isRejected()) ran = resolved;
@@ -183915,12 +183929,13 @@ ${pictures(job, ws, ws.number)}`);
183915
183929
  const fresh = (fromTranscript = false) => {
183916
183930
  const carry = carryArgs(effectiveVerb, fromTranscript);
183917
183931
  const costFrom = carry.includes("--session") && typeof job.resumeCostUsd === "number" ? { [SESSION_COST_ENV]: String(job.resumeCostUsd) } : void 0;
183918
- return launch2(["raw", "card", effectiveVerb, String(id3), "--follow", "--events", "--json", ...carry, ...note ? ["--", note] : []], true, costFrom, effectiveVerb);
183932
+ const command = effectiveVerb === "approve" ? ["raw", "card", "approve"] : ["task", effectiveVerb];
183933
+ return launch2([...command, String(id3), "--follow", "--events", "--json", ...carry, ...note ? ["--", note] : []], true, costFrom, effectiveVerb);
183919
183934
  };
183920
183935
  ran ??= await (continuation ? launch2([...continuation, "--follow", "--events", "--json"], true, void 0, effectiveVerb) : fresh());
183921
183936
  if (ran.reviewRefused) return fail(ran.reviewRefused);
183922
183937
  if (io.lost()) return fail("");
183923
- const readRuns = async () => answerOf2(await akb(["raw", "run", "list", "--card", String(id3), "--all", "--json"]))?.runs ?? [];
183938
+ const readRuns = async () => answerOf2(await akb(["run", "list", "--card", String(id3), "--all", "--json"]))?.runs ?? [];
183924
183939
  const lastRun = (answer2) => answer2?.lastSessionId ?? answer2?.error?.lastSessionId;
183925
183940
  let answer = answerOf2(ran);
183926
183941
  let runs = await readRuns();
@@ -184005,7 +184020,7 @@ ${pictures(job, ws, ws.number)}`);
184005
184020
  const card = akbCardOf(ws) ?? flow.card;
184006
184021
  if (!card) return { ok: true, report: {} };
184007
184022
  for (const delivery of checkoutsOf(ws, card)) {
184008
- const ran = await akb(["raw", "delivery", "cancel", delivery, "--json"], true);
184023
+ const ran = await akb(["delivery", "cancel", delivery, "--json"], true);
184009
184024
  if (ran.code !== 0) return fail(refusal2(ran));
184010
184025
  }
184011
184026
  return { ok: true, report: { card } };
@@ -184031,7 +184046,7 @@ function landingOf(delivery) {
184031
184046
  async function confirmFlowStopped(ws, job, deps) {
184032
184047
  const id2 = akbCardOf(ws) ?? job.number;
184033
184048
  if (!id2) return false;
184034
- const ran = await runAkb(deps.akb, ["raw", "run", "list", "--card", String(id2), "--all", "--json", "--board", ws.board], { cwd: ws.cwd, board: ws.board });
184049
+ const ran = await runAkb(deps.akb, ["run", "list", "--card", String(id2), "--all", "--json", "--board", ws.board], { cwd: ws.cwd, board: ws.board });
184035
184050
  const runs = answerOf2(ran)?.runs;
184036
184051
  return !!runs && runs.every((r2) => r2.status !== "running" && (r2.managedProcess ? connectionStopped(r2.agentPid ? { pid: r2.agentPid, identity: r2.agentIdentity } : void 0) : processesStopped(
184037
184052
  runMark(r2.sessionId, r2.startedAt),
@@ -184046,7 +184061,7 @@ async function flowRunEvidence(ws, job, deps, execution = job.id, prior) {
184046
184061
  }, track() {
184047
184062
  }, onStop() {
184048
184063
  }, lost: () => false });
184049
- const ran = await akb(["raw", "run", "list", "--all", "--json", ...id2 ? ["--card", String(id2)] : []]);
184064
+ const ran = await akb(["run", "list", "--all", "--json", ...id2 ? ["--card", String(id2)] : []]);
184050
184065
  const allRuns = answerOf2(ran)?.runs;
184051
184066
  if (!allRuns) return { stopped: false };
184052
184067
  const owned = allRuns.filter((run3) => run3.cloudExecution?.machine === deps.machineId && (run3.cloudExecution.job === execution || run3.sessionId === prior?.id && run3.cloudExecution.job === prior.from));
@@ -184828,14 +184843,14 @@ function readAkbState() {
184828
184843
  return { current: null, bad: [] };
184829
184844
  }
184830
184845
  }
184831
- function contractOf(dir) {
184846
+ function packageInfo(dir) {
184832
184847
  try {
184833
- return JSON.parse(fs44.readFileSync(path48.join(dir, "package.json"), "utf8")).akbContract ?? null;
184848
+ return JSON.parse(fs44.readFileSync(path48.join(dir, "package.json"), "utf8")) ?? {};
184834
184849
  } catch {
184835
- return null;
184850
+ return {};
184836
184851
  }
184837
184852
  }
184838
- var usable = (dir) => fs44.existsSync(entryOf(dir)) && contractOf(dir) === AKB_CONTRACT;
184853
+ var usable = (dir) => fs44.existsSync(entryOf(dir)) && packageInfo(dir).akbContract === AKB_CONTRACT;
184839
184854
  function currentAkb() {
184840
184855
  const { current: current2 } = readAkbState();
184841
184856
  if (!current2) return bundledAkb();
@@ -184846,7 +184861,7 @@ function currentAkb() {
184846
184861
  fs44.utimesSync(dir, now, now);
184847
184862
  } catch {
184848
184863
  }
184849
- return { command: process.execPath, args: akbArgs(entryOf(dir)), version: current2, shim: path48.join(dir, "shim") };
184864
+ return { command: process.execPath, args: akbArgs(entryOf(dir)), version: current2, canonicalCommands: packageInfo(dir).canonicalCommands === true, shim: path48.join(dir, "shim") };
184850
184865
  }
184851
184866
 
184852
184867
  // src/chats.ts
@@ -185988,7 +186003,7 @@ async function runClaimedStep(job, deps, track, keep2, lease, scope, replyStream
185988
186003
  if (!job.flow && !job.review) {
185989
186004
  void refreshCatalog();
185990
186005
  const attachments = writeAttachments(job);
185991
- 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;
186006
+ 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;
185992
186007
  const file2 = writeTranscript(job, attachmentsOf(job));
185993
186008
  const transcript = file2 ? `
185994
186009
 
package/dist/launcher.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;
@@ -41128,8 +41128,8 @@ function saveAlphaUpdates(value) {
41128
41128
  }
41129
41129
 
41130
41130
  // src/protocol.ts
41131
- var VERSION = true ? "0.6.108" : "0.0.0";
41132
- var AKB_VERSION = true ? "0.11.88" : "0.0.0";
41131
+ var VERSION = true ? "0.6.109" : "0.0.0";
41132
+ var AKB_VERSION = true ? "0.11.89" : "0.0.0";
41133
41133
  var EXIT_REFUSED = 10;
41134
41134
  var EXIT_OUTDATED = 11;
41135
41135
  var EXIT_UPDATE = 12;
@@ -42174,6 +42174,7 @@ function boardLockName(kanban, root2) {
42174
42174
  const name = from && !from.startsWith("..") ? from : path11.basename(kanban);
42175
42175
  return `${name.split(path11.sep).join("-")}.lock`;
42176
42176
  }
42177
+ var shellWord = (value) => /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, "\\$&")}"`;
42177
42178
  var BOARD_FLAG = "";
42178
42179
  function setBoard(kanban, root2, flag) {
42179
42180
  REPO_ROOT = path11.resolve(root2);
@@ -42219,7 +42220,7 @@ function setBoard(kanban, root2, flag) {
42219
42220
  }
42220
42221
  function setBoardRoot(root2, named = false) {
42221
42222
  const project = path11.resolve(root2);
42222
- return setBoard(path11.join(project, "docs", "kanban"), project, named ? ` --dir ${project}` : "");
42223
+ return setBoard(path11.join(project, "docs", "kanban"), project, named ? ` --dir ${shellWord(project)}` : "");
42223
42224
  }
42224
42225
  setBoardRoot(process.cwd());
42225
42226
 
@@ -64609,8 +64610,9 @@ function createTail(log) {
64609
64610
  // ../cli/package.json
64610
64611
  var package_default = {
64611
64612
  name: "wildcrane",
64612
- version: "0.11.88",
64613
+ version: "0.11.89",
64613
64614
  akbContract: 29,
64615
+ canonicalCommands: true,
64614
64616
  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.",
64615
64617
  keywords: [
64616
64618
  "kanban",
@@ -68387,6 +68389,7 @@ var bundledAkb = (dist = HERE) => ({
68387
68389
  command: process.execPath,
68388
68390
  args: akbArgs(path31.join(dist, "akb", "bin", "ai4kanban.mjs"), dist),
68389
68391
  version: AKB_VERSION,
68392
+ canonicalCommands: true,
68390
68393
  shim: path31.join(akbHome(), BUNDLED_SHIM)
68391
68394
  });
68392
68395
  var quote = (s) => /^[\w./:@=-]+$/.test(s) ? s : `"${s}"`;
package/dist/plugin.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;
@@ -110291,8 +110291,9 @@ function createTail(log) {
110291
110291
  // ../cli/package.json
110292
110292
  var package_default = {
110293
110293
  name: "wildcrane",
110294
- version: "0.11.88",
110294
+ version: "0.11.89",
110295
110295
  akbContract: 29,
110296
+ canonicalCommands: true,
110296
110297
  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.",
110297
110298
  keywords: [
110298
110299
  "kanban",
@@ -112124,6 +112125,7 @@ function boardLockName(kanban, root2) {
112124
112125
  const name = from && !from.startsWith("..") ? from : path13.basename(kanban);
112125
112126
  return `${name.split(path13.sep).join("-")}.lock`;
112126
112127
  }
112128
+ var shellWord = (value) => /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, "\\$&")}"`;
112127
112129
  var BOARD_FLAG = "";
112128
112130
  function setBoard(kanban, root2, flag) {
112129
112131
  REPO_ROOT = path13.resolve(root2);
@@ -112169,7 +112171,7 @@ function setBoard(kanban, root2, flag) {
112169
112171
  }
112170
112172
  function setBoardRoot(root2, named = false) {
112171
112173
  const project = path13.resolve(root2);
112172
- return setBoard(path13.join(project, "docs", "kanban"), project, named ? ` --dir ${project}` : "");
112174
+ return setBoard(path13.join(project, "docs", "kanban"), project, named ? ` --dir ${shellWord(project)}` : "");
112173
112175
  }
112174
112176
  setBoardRoot(process.cwd());
112175
112177
 
@@ -113352,8 +113354,8 @@ function machineId() {
113352
113354
  var machineName = () => os4.hostname().replace(/\.local$/, "");
113353
113355
 
113354
113356
  // src/protocol.ts
113355
- var VERSION = true ? "0.6.108" : "0.0.0";
113356
- var AKB_VERSION = true ? "0.11.88" : "0.0.0";
113357
+ var VERSION = true ? "0.6.109" : "0.0.0";
113358
+ var AKB_VERSION = true ? "0.11.89" : "0.0.0";
113357
113359
  var EXIT_REFUSED = 10;
113358
113360
  var EXIT_OUTDATED = 11;
113359
113361
  var EXIT_UPDATE = 12;
@@ -113370,6 +113372,7 @@ var bundledAkb = (dist = HERE) => ({
113370
113372
  command: process.execPath,
113371
113373
  args: akbArgs(path18.join(dist, "akb", "bin", "ai4kanban.mjs"), dist),
113372
113374
  version: AKB_VERSION,
113375
+ canonicalCommands: true,
113373
113376
  shim: path18.join(akbHome(), BUNDLED_SHIM)
113374
113377
  });
113375
113378
  var quote = (s) => /^[\w./:@=-]+$/.test(s) ? s : `"${s}"`;