wildcrane 0.11.9 → 0.11.10

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 +17 -11
  2. package/package.json +2 -2
package/dist/kanban.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ai4kanban 0.11.9 — built from the CLI's TypeScript sources by cli/scripts/build.mjs.
2
+ // ai4kanban 0.11.10 — 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)
@@ -5478,8 +5478,8 @@ var init_package = __esm({
5478
5478
  "package.json"() {
5479
5479
  package_default = {
5480
5480
  name: "wildcrane",
5481
- version: "0.11.9",
5482
- akbContract: 4,
5481
+ version: "0.11.10",
5482
+ akbContract: 5,
5483
5483
  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.",
5484
5484
  keywords: [
5485
5485
  "kanban",
@@ -18994,7 +18994,7 @@ function requestOf(record) {
18994
18994
  pictures: record.pictures
18995
18995
  };
18996
18996
  }
18997
- async function openResume(id) {
18997
+ async function openResume(id, requireSession = false) {
18998
18998
  const restore = [];
18999
18999
  const runs = withRuns((all2) => {
19000
19000
  reap(all2, [], restore);
@@ -19014,6 +19014,9 @@ async function openResume(id) {
19014
19014
  if (refused) return refused;
19015
19015
  }
19016
19016
  const retrying = lacksSession(prev);
19017
+ if (requireSession && !resumeSessionId(prev)) {
19018
+ return refusal("runNoSession", "the original conversation cannot be resumed; no new conversation was started");
19019
+ }
19017
19020
  const ask2 = retrying && prev.status !== "stopped" ? retryAsk(prev) : void 0;
19018
19021
  if (retrying && !ask2) return refusal("runNoSession", "that run never reported a session id to continue by");
19019
19022
  const ended = endedDeliveryRefusal(prev);
@@ -22516,7 +22519,7 @@ function localBoard() {
22516
22519
  const no = checkWrite({ board: true }, env2, boardRevision());
22517
22520
  if (no) return no;
22518
22521
  const res = await resumeDelivery(deliveryId);
22519
- if (!res.ok) return opRefused(new Error(res.error || "the delivery could not be carried on"));
22522
+ if (!res.ok) return { ...opRefused(new Error(res.error || "the delivery could not be carried on")), reason: res.reason, args: res.args };
22520
22523
  return opOk(boardRevision(), { deliveryId: res.deliveryId, landed: res.landed, carryOn: res.carryOn });
22521
22524
  },
22522
22525
  async discardDelivery(deliveryId, env2) {
@@ -23648,8 +23651,8 @@ function open2(req, sessionId) {
23648
23651
  markSpawned(run2.sessionId, pid);
23649
23652
  return { run: run2, spawned: pid !== void 0 };
23650
23653
  }
23651
- async function startResume(id) {
23652
- const opened = await openResume(id);
23654
+ async function startResume(id, requireSession = false) {
23655
+ const opened = await openResume(id, requireSession);
23653
23656
  if ("error" in opened) return opened;
23654
23657
  const pid = spawnWatcher(opened.run.sessionId);
23655
23658
  markSpawned(opened.run.sessionId, pid);
@@ -27589,13 +27592,13 @@ function readRequest(action, args, opts) {
27589
27592
  return { req, follow: follow2, print };
27590
27593
  }
27591
27594
  async function cmdResume(id, opts) {
27592
- const opened = await startResume(id ?? "last");
27595
+ const opened = await startResume(id ?? "last", opts.requireSession);
27593
27596
  if ("error" in opened) die(opened.error, { kind: "run-refused" });
27594
27597
  const { run: run2 } = opened;
27595
27598
  if (!opened.spawned) die(`couldn't start a process for run ${run2.sessionId}`, { kind: "spawn-failed" });
27596
27599
  const within = run2.deliveryId ? ` in delivery ${run2.deliveryId}` : "";
27597
27600
  say(run2.resumedFrom ? `continuing ${short(run2.resumedFrom)} \u2014 run ${run2.sessionId}${within}` : `trying again \u2014 run ${run2.sessionId}${within}`);
27598
- if (opts.follow === true) return await followStarted(run2.sessionId, "akb");
27601
+ if (opts.follow === true) return await followStarted(run2.sessionId, "akb", opts.events === true);
27599
27602
  return { sessionId: run2.sessionId, resumedFrom: run2.resumedFrom };
27600
27603
  }
27601
27604
  async function cmdCancel(named2) {
@@ -27609,7 +27612,10 @@ async function cmdCancel(named2) {
27609
27612
  }
27610
27613
  async function cmdResumeDelivery(named2) {
27611
27614
  const res = await resumeBoardDelivery(named2);
27612
- if (!res.ok) die(res.error ?? "that delivery could not be carried on", { kind: "run-refused" });
27615
+ if (!res.ok) die(res.error ?? "that delivery could not be carried on", {
27616
+ kind: "run-refused",
27617
+ ...res.kind === "refused" ? { reason: res.reason, args: res.args } : {}
27618
+ });
27613
27619
  if (res.landed) {
27614
27620
  say(`delivery ${res.deliveryId} is done \u2014 its changes were already on the target branch.`);
27615
27621
  return { deliveryId: res.deliveryId, landed: true };
@@ -28604,7 +28610,7 @@ function declareRunning(run2, cli) {
28604
28610
  });
28605
28611
  verb("resume").argument("[id]", RUN_ID, String).summary("continue a run that failed, was cut off or was stopped").description(
28606
28612
  "The one command that reaches past the board: it picks the coding agent's own session back up \u2014 the conversation it was having, with everything it had already read \u2014 while the board counts the work as a fresh run. Before resuming a creation with no card, check sign-in, project access and connection. A refusal starts no run and leaves triage unchanged. Keep the triage source and request identity; reuse any task already created in Cloud. Repairing an existing card creates no other task. Example: akb run resume abc12345"
28607
- ).option("-f, --follow", "watch its log instead of returning").action(async function(...vals) {
28613
+ ).option("-f, --follow", "watch its log instead of returning").option("--events", "with --follow: print its structured events, one JSON object per line").option("--require-session", "refuse if the original conversation cannot be resumed").action(async function(...vals) {
28608
28614
  const [id] = positional(vals);
28609
28615
  await onBoard2(this, cli, () => cmdResume(id, this.opts()));
28610
28616
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wildcrane",
3
- "version": "0.11.9",
4
- "akbContract": 4,
3
+ "version": "0.11.10",
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": [
7
7
  "kanban",