wildcrane-runner 0.6.15 → 0.6.17

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,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ai4kanban 0.11.12 — built by runner/scripts/build.mjs. Do not edit.
2
+ // ai4kanban 0.11.14 — built by runner/scripts/build.mjs. Do not edit.
3
3
  import { createRequire as __ai4kanbanRequire } from 'node:module'
4
4
  const require = __ai4kanbanRequire(import.meta.url)
5
5
  var __create = Object.create;
@@ -5514,7 +5514,7 @@ var init_package = __esm({
5514
5514
  "../cli/package.json"() {
5515
5515
  package_default = {
5516
5516
  name: "wildcrane",
5517
- version: "0.11.12",
5517
+ version: "0.11.14",
5518
5518
  akbContract: 5,
5519
5519
  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.",
5520
5520
  keywords: [
@@ -24319,7 +24319,7 @@ function buildFlow(req, program2) {
24319
24319
  }
24320
24320
  case "approve": {
24321
24321
  facts.push(...stageField(card.meta));
24322
- close.push(...stageClose(card.meta));
24322
+ close.push(...stageClose(card.meta), `${raw} update ${req.id} --status ready \u2014 once the card validates`);
24323
24323
  break;
24324
24324
  }
24325
24325
  case "edit": {
@@ -27534,10 +27534,12 @@ async function cmdStartRun(action, args, opts, program2 = "akb") {
27534
27534
  }
27535
27535
  const inside2 = insideRun();
27536
27536
  if (inside2 && action === "approve") die("only the user approves a round \u2014 stop here and leave the card for them.", { kind: "run-refused", action });
27537
- const project = action === "approve" ? runnerProject(KANBAN) : null;
27537
+ const runnerApprove = action === "approve" && workspaceTask() !== null;
27538
+ const project = action === "approve" && !runnerApprove ? runnerProject(KANBAN) : null;
27538
27539
  if (project) return await approveInCloud(project, req.id);
27539
27540
  if (action === "approve") sayIfHeld(req, program2);
27540
- const runnable = action === "refine" ? refinementRequest(req) : action === "approve" ? approvalRequest(req) : req;
27541
+ const card = runnerApprove ? findCard(req.id) : null;
27542
+ const runnable = card && !awaitingApproval(card) ? { action: "clarify", id: card.id, title: card.title, notes: req.notes, refineRound: 1 } : action === "refine" ? refinementRequest(req) : action === "approve" ? approvalRequest(req) : req;
27541
27543
  if ("error" in runnable) die(runnable.error, { kind: "run-refused", action });
27542
27544
  if (inside2 && action === "refine" && !print) return queueRefine(inside2, req);
27543
27545
  if (inside2 && action === "implement" && planningRun(inside2)) {
@@ -27926,7 +27928,7 @@ async function followRun(sessionId, already = "", program2 = "akb", events = fal
27926
27928
  last = await followOne(current, printed, events);
27927
27929
  seen.add(current.sessionId);
27928
27930
  printed = 0;
27929
- const deliveryId2 = last.deliveryId ?? first.deliveryId;
27931
+ const deliveryId2 = first.deliveryId ?? last.deliveryId;
27930
27932
  const next = nextInFlow(first, current.sessionId, seen) ?? (deliveryId2 ? await moveDelivery(deliveryId2, idle) : void 0);
27931
27933
  if (next === void 0) break;
27932
27934
  if (next === null) {
@@ -27947,7 +27949,7 @@ async function followRun(sessionId, already = "", program2 = "akb", events = fal
27947
27949
  }
27948
27950
  say("");
27949
27951
  say(runLine(last, program2));
27950
- const deliveryId = last.deliveryId ?? first.deliveryId;
27952
+ const deliveryId = first.deliveryId ?? last.deliveryId;
27951
27953
  const delivery = deliveryId ? deliveryOutcome(deliveryId) : void 0;
27952
27954
  if (delivery) say(`delivery ${delivery.id}: ${delivery.line}`);
27953
27955
  const failed = last.status !== "done" ? `run ${short(last.sessionId)} ended ${last.status}${last.error ? `: ${last.error}` : ""}` : delivery && delivery.status !== "finished" ? `delivery ${delivery.id} did not land${idle.timedOut ? ` \u2014 nothing moved it for ${ago(follow.idleMs)}` : ""}: ${delivery.line}` : void 0;
@@ -28013,7 +28015,7 @@ async function followOne(view, already, events) {
28013
28015
  }
28014
28016
  function nextInFlow(first, after2, seen) {
28015
28017
  const runs = readRuns();
28016
- const next = runs.filter((r) => !seen.has(r.sessionId) && r.action !== "sub" && r.startedAt >= first.startedAt).filter((r) => r.resumedFrom === after2 || !!first.flowId && r.flowId === first.flowId).sort((a, b) => a.startedAt - b.startedAt)[0];
28018
+ const next = runs.filter((r) => !seen.has(r.sessionId) && r.action !== "sub" && r.startedAt >= first.startedAt).filter((r) => !first.deliveryId || !r.deliveryId || r.deliveryId === first.deliveryId).filter((r) => r.resumedFrom === after2 || !!first.flowId && r.flowId === first.flowId).sort((a, b) => a.startedAt - b.startedAt)[0];
28017
28019
  return next ? { ...next } : void 0;
28018
28020
  }
28019
28021
  async function moveDelivery(deliveryId, idle) {
@@ -28033,7 +28035,7 @@ async function moveDelivery(deliveryId, idle) {
28033
28035
  const ask2 = await advanceLanding();
28034
28036
  if (!ask2) return null;
28035
28037
  const started = await startRun(ask2);
28036
- return "error" in started ? null : { ...started.run };
28038
+ return "error" in started || started.run.deliveryId !== deliveryId ? null : { ...started.run };
28037
28039
  }
28038
28040
  function deliveryOutcome(deliveryId) {
28039
28041
  const delivery = findDelivery(deliveryId);
@@ -1 +1 @@
1
- {"name":"wildcrane","version":"0.11.12","akbContract":5,"type":"module","private":true}
1
+ {"name":"wildcrane","version":"0.11.14","akbContract":5,"type":"module","private":true}
package/dist/launcher.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.15 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.17 — 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
 
@@ -107,7 +107,7 @@ function status(line) {
107
107
  }
108
108
 
109
109
  // src/protocol.ts
110
- var VERSION = true ? "0.6.15" : "0.0.0";
110
+ var VERSION = true ? "0.6.17" : "0.0.0";
111
111
  var EXIT_REFUSED = 10;
112
112
  var EXIT_OUTDATED = 11;
113
113
  var EXIT_UPDATE = 12;
package/dist/runner.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.15 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.17 — 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;
@@ -84435,8 +84435,8 @@ function status(line) {
84435
84435
  }
84436
84436
 
84437
84437
  // src/protocol.ts
84438
- var VERSION = true ? "0.6.15" : "0.0.0";
84439
- var AKB_VERSION = true ? "0.11.12" : "0.0.0";
84438
+ var VERSION = true ? "0.6.17" : "0.0.0";
84439
+ var AKB_VERSION = true ? "0.11.14" : "0.0.0";
84440
84440
  var AKB_CONTRACT = true ? 5 : 0;
84441
84441
  var EXIT_REFUSED = 10;
84442
84442
  var EXIT_OUTDATED = 11;
@@ -85923,7 +85923,7 @@ function createTail(log) {
85923
85923
  // ../cli/package.json
85924
85924
  var package_default = {
85925
85925
  name: "wildcrane",
85926
- version: "0.11.12",
85926
+ version: "0.11.14",
85927
85927
  akbContract: 5,
85928
85928
  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.",
85929
85929
  keywords: [
@@ -92827,6 +92827,7 @@ ${draftLine(ws)}
92827
92827
  if (verb === "revise" && !text3) return fail("Say what to change.");
92828
92828
  let note = verb === "resolve" || verb === "revise" ? text3 : "";
92829
92829
  let continuation;
92830
+ let expectedDelivery;
92830
92831
  if (verb === "implement" && flow.resume) {
92831
92832
  const restored = await akb(["delivery", "resume", String(id2), "--json"]);
92832
92833
  const resumed = answerOf2(restored);
@@ -92835,6 +92836,7 @@ ${draftLine(ws)}
92835
92836
  if (restored.code !== 0 && resumed?.error?.reason !== "deliveryActive") return fail(resumed?.error?.message ?? refusal(restored));
92836
92837
  const deliveryId = resumed?.deliveryId ?? resumed?.error?.args?.id;
92837
92838
  if (!deliveryId) return fail("\u627E\u4E0D\u5230\u4E0A\u6B21\u6784\u5EFA\u7684\u4EA4\u4ED8\u8BB0\u5F55\uFF0C\u65E0\u6CD5\u6062\u590D\u539F\u5BF9\u8BDD\u3002");
92839
+ expectedDelivery = deliveryId;
92838
92840
  const previous = answerOf2(await akb(["run", "list", "--card", String(id2), "--all", "--json"]))?.runs?.filter((r2) => ["implement", "conflict", "hook"].includes(r2.action ?? "") && r2.deliveryId === deliveryId).sort((a3, b2) => (b2.startedAt ?? 0) - (a3.startedAt ?? 0))[0];
92839
92841
  if (!previous) return fail("\u627E\u4E0D\u5230\u4E0A\u6B21\u6784\u5EFA\u7684\u8FD0\u884C\u8BB0\u5F55\uFF0C\u65E0\u6CD5\u6062\u590D\u539F\u5BF9\u8BDD\u3002");
92840
92842
  continuation = previous.status === "done" ? ["run", "log", previous.sessionId] : ["run", "resume", previous.sessionId, "--require-session"];
@@ -92846,6 +92848,9 @@ ${draftLine(ws)}
92846
92848
  const ran = await akb(continuation ? [...continuation, "--follow", "--events", "--json"] : ["card", verb, String(id2), "--follow", "--events", "--json", ...carryArgs(verb), ...note ? ["--", note] : []], true);
92847
92849
  if (io.lost()) return fail("");
92848
92850
  const answer = answerOf2(ran);
92851
+ if (expectedDelivery && answer?.delivery?.id && answer.delivery.id !== expectedDelivery) {
92852
+ return fail("\u7EED\u8DD1\u8FD4\u56DE\u4E86\u5176\u4ED6\u4EA4\u4ED8\u7684\u7ED3\u679C\uFF0C\u539F\u4EA4\u4ED8\u4FDD\u6301\u672A\u5B8C\u6210\u3002");
92853
+ }
92849
92854
  if (verb === "implement") {
92850
92855
  const ending = deliveryEnding(ws, answer?.delivery?.id ?? answer?.error?.delivery?.id);
92851
92856
  if (ending) return ending;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane-runner",
3
- "version": "0.6.15",
3
+ "version": "0.6.17",
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": "FSL-1.1-ALv2",
6
6
  "homepage": "https://wildcrane.ai/",