wildcrane 0.11.12 → 0.11.14

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.
Files changed (2) hide show
  1. package/dist/kanban.mjs +11 -9
  2. package/package.json +1 -1
package/dist/kanban.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ai4kanban 0.11.12 — built from the CLI's TypeScript sources by cli/scripts/build.mjs.
2
+ // ai4kanban 0.11.14 — built from the CLI's TypeScript sources by cli/scripts/build.mjs.
3
3
  // Do not edit: every change belongs in cli/src/, and a build overwrites this file.
4
4
  import { createRequire as __ai4kanbanRequire } from 'node:module'
5
5
  const require = __ai4kanbanRequire(import.meta.url)
@@ -5515,7 +5515,7 @@ var init_package = __esm({
5515
5515
  "package.json"() {
5516
5516
  package_default = {
5517
5517
  name: "wildcrane",
5518
- version: "0.11.12",
5518
+ version: "0.11.14",
5519
5519
  akbContract: 5,
5520
5520
  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.",
5521
5521
  keywords: [
@@ -24320,7 +24320,7 @@ function buildFlow(req, program2) {
24320
24320
  }
24321
24321
  case "approve": {
24322
24322
  facts.push(...stageField(card.meta));
24323
- close.push(...stageClose(card.meta));
24323
+ close.push(...stageClose(card.meta), `${raw} update ${req.id} --status ready \u2014 once the card validates`);
24324
24324
  break;
24325
24325
  }
24326
24326
  case "edit": {
@@ -27535,10 +27535,12 @@ async function cmdStartRun(action, args, opts, program2 = "akb") {
27535
27535
  }
27536
27536
  const inside2 = insideRun();
27537
27537
  if (inside2 && action === "approve") die("only the user approves a round \u2014 stop here and leave the card for them.", { kind: "run-refused", action });
27538
- const project = action === "approve" ? runnerProject(KANBAN) : null;
27538
+ const runnerApprove = action === "approve" && workspaceTask() !== null;
27539
+ const project = action === "approve" && !runnerApprove ? runnerProject(KANBAN) : null;
27539
27540
  if (project) return await approveInCloud(project, req.id);
27540
27541
  if (action === "approve") sayIfHeld(req, program2);
27541
- const runnable = action === "refine" ? refinementRequest(req) : action === "approve" ? approvalRequest(req) : req;
27542
+ const card = runnerApprove ? findCard(req.id) : null;
27543
+ 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;
27542
27544
  if ("error" in runnable) die(runnable.error, { kind: "run-refused", action });
27543
27545
  if (inside2 && action === "refine" && !print) return queueRefine(inside2, req);
27544
27546
  if (inside2 && action === "implement" && planningRun(inside2)) {
@@ -27927,7 +27929,7 @@ async function followRun(sessionId, already = "", program2 = "akb", events = fal
27927
27929
  last = await followOne(current, printed, events);
27928
27930
  seen.add(current.sessionId);
27929
27931
  printed = 0;
27930
- const deliveryId2 = last.deliveryId ?? first.deliveryId;
27932
+ const deliveryId2 = first.deliveryId ?? last.deliveryId;
27931
27933
  const next = nextInFlow(first, current.sessionId, seen) ?? (deliveryId2 ? await moveDelivery(deliveryId2, idle) : void 0);
27932
27934
  if (next === void 0) break;
27933
27935
  if (next === null) {
@@ -27948,7 +27950,7 @@ async function followRun(sessionId, already = "", program2 = "akb", events = fal
27948
27950
  }
27949
27951
  say("");
27950
27952
  say(runLine(last, program2));
27951
- const deliveryId = last.deliveryId ?? first.deliveryId;
27953
+ const deliveryId = first.deliveryId ?? last.deliveryId;
27952
27954
  const delivery = deliveryId ? deliveryOutcome(deliveryId) : void 0;
27953
27955
  if (delivery) say(`delivery ${delivery.id}: ${delivery.line}`);
27954
27956
  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;
@@ -28014,7 +28016,7 @@ async function followOne(view, already, events) {
28014
28016
  }
28015
28017
  function nextInFlow(first, after2, seen) {
28016
28018
  const runs = readRuns();
28017
- 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];
28019
+ 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];
28018
28020
  return next ? { ...next } : void 0;
28019
28021
  }
28020
28022
  async function moveDelivery(deliveryId, idle) {
@@ -28034,7 +28036,7 @@ async function moveDelivery(deliveryId, idle) {
28034
28036
  const ask2 = await advanceLanding();
28035
28037
  if (!ask2) return null;
28036
28038
  const started = await startRun(ask2);
28037
- return "error" in started ? null : { ...started.run };
28039
+ return "error" in started || started.run.deliveryId !== deliveryId ? null : { ...started.run };
28038
28040
  }
28039
28041
  function deliveryOutcome(deliveryId) {
28040
28042
  const delivery = findDelivery(deliveryId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane",
3
- "version": "0.11.12",
3
+ "version": "0.11.14",
4
4
  "akbContract": 5,
5
5
  "description": "WildCrane's `akb` command — scaffold the Markdown board under docs/kanban/, put an agent on a card, and carry the flows the agent works by.",
6
6
  "keywords": [