wildcrane 0.11.88 → 0.11.89

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/kanban.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ai4kanban 0.11.88 — built from the CLI's TypeScript sources by cli/scripts/build.mjs.
2
+ // ai4kanban 0.11.89 — 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)
@@ -340,11 +340,11 @@ function setBoard(kanban, root2, flag) {
340
340
  }
341
341
  function setBoardRoot(root2, named2 = false) {
342
342
  const project2 = path2.resolve(root2);
343
- return setBoard(path2.join(project2, "docs", "kanban"), project2, named2 ? ` --dir ${project2}` : "");
343
+ return setBoard(path2.join(project2, "docs", "kanban"), project2, named2 ? ` --dir ${shellWord(project2)}` : "");
344
344
  }
345
345
  function setBoardDir(board2, root2) {
346
346
  const folder2 = path2.resolve(board2);
347
- return setBoard(folder2, root2 ?? projectRootOf(folder2), ` --board ${folder2}`);
347
+ return setBoard(folder2, root2 ?? projectRootOf(folder2), ` --board ${shellWord(folder2)}`);
348
348
  }
349
349
  function die(msg, kind) {
350
350
  throw new BoardError(msg, typeof kind === "string" ? { kind } : kind);
@@ -369,7 +369,7 @@ function useProjectState() {
369
369
  ensureAkbDir();
370
370
  return ensureProjectState(KANBAN, REPO_ROOT);
371
371
  }
372
- var REPO_ROOT, KANBAN, TODO, ARCHIVE, REJECTIONS_TO_REVIEW, ARCHIVE_MD, README, MODULES_MD, CONFIG, KANBAN_GITIGNORE, RELEASES, RELEASE_SUMMARIES, AGENTS, STUDIOS, ASSETS, BOARD_STATE, MEMORY, AGENT_MEMORY, PROJECT_MD, LOCK, UI_CONFIG, ENV_FILE, SESSIONS, SESSIONS_DIR, SESSIONS_LOCK2, INDEX_LOCK2, DELIVERIES, PLANS, PLANS_ARCHIVE, RULES, TRIAGE, SIGNALS_ARCHIVED, SIGNALS_DISMISSED, SIGNALS_FILES, SIGNALS_OLD_INBOX, SIGNALS_OLD_HANDLED, AKB_DIR, ROOT_GITIGNORE, AKB_IGNORE_LINE, BOARD_FLAG, rel, BOARD_PATH_IN_TEXT, ASSETS_PATH_IN_TEXT, BOARD_STATE_IN_TEXT;
372
+ var REPO_ROOT, KANBAN, TODO, ARCHIVE, REJECTIONS_TO_REVIEW, ARCHIVE_MD, README, MODULES_MD, CONFIG, KANBAN_GITIGNORE, RELEASES, RELEASE_SUMMARIES, AGENTS, STUDIOS, ASSETS, BOARD_STATE, MEMORY, AGENT_MEMORY, PROJECT_MD, LOCK, UI_CONFIG, ENV_FILE, SESSIONS, SESSIONS_DIR, SESSIONS_LOCK2, INDEX_LOCK2, DELIVERIES, PLANS, PLANS_ARCHIVE, RULES, TRIAGE, SIGNALS_ARCHIVED, SIGNALS_DISMISSED, SIGNALS_FILES, SIGNALS_OLD_INBOX, SIGNALS_OLD_HANDLED, AKB_DIR, ROOT_GITIGNORE, AKB_IGNORE_LINE, shellWord, BOARD_FLAG, rel, BOARD_PATH_IN_TEXT, ASSETS_PATH_IN_TEXT, BOARD_STATE_IN_TEXT;
373
373
  var init_paths = __esm({
374
374
  "src/lib/paths.ts"() {
375
375
  "use strict";
@@ -414,6 +414,7 @@ var init_paths = __esm({
414
414
  AKB_DIR = "";
415
415
  ROOT_GITIGNORE = "";
416
416
  AKB_IGNORE_LINE = ".akb/";
417
+ shellWord = (value) => /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, "\\$&")}"`;
417
418
  BOARD_FLAG = "";
418
419
  setBoardRoot(process.cwd());
419
420
  rel = (p) => {
@@ -22832,8 +22833,9 @@ var init_package = __esm({
22832
22833
  "package.json"() {
22833
22834
  package_default = {
22834
22835
  name: "wildcrane",
22835
- version: "0.11.88",
22836
+ version: "0.11.89",
22836
22837
  akbContract: 29,
22838
+ canonicalCommands: true,
22837
22839
  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.",
22838
22840
  keywords: [
22839
22841
  "kanban",
@@ -29092,7 +29094,7 @@ var init_types3 = __esm({
29092
29094
  isRetired = (action) => RETIRED.has(action);
29093
29095
  refusal = (reason, error62, args2) => args2 ? { error: error62, reason, args: args2 } : { error: error62, reason };
29094
29096
  NOT_COMPLETED = "The delivery has not recorded completion.";
29095
- notCompletedWhy = (deliveryId) => `${NOT_COMPLETED} Finish its unchecked todos, then run akb raw delivery complete ${deliveryId}, with --commit <sha> --branch <name> in a git project.`;
29097
+ notCompletedWhy = (deliveryId, command = "akb") => `${NOT_COMPLETED} Finish its unchecked todos, then run ${command} delivery complete ${deliveryId}, with --commit <sha> --branch <name> in a git project.`;
29096
29098
  }
29097
29099
  });
29098
29100
 
@@ -29609,7 +29611,7 @@ before proposing so you don't re-suggest them.
29609
29611
  // Only a header: `describe-project` writes the body, and runs while there is none (#1268).
29610
29612
  "project.md": `# Project
29611
29613
 
29612
- What the project is today, from its users' side. Rewritten whole by \`akb raw describe-project\`;
29614
+ What the project is today, from its users' side. Rewritten whole by \`akb memory describe-project\`;
29613
29615
  edits here do not last.
29614
29616
  `
29615
29617
  };
@@ -44548,10 +44550,10 @@ var init_flows = __esm({
44548
44550
  description: "the runtime to run on, for this run only (default: the flow's own agent's)"
44549
44551
  };
44550
44552
  CARRY_OPTIONS = [
44551
- { flags: "--new-session", description: "start planning in a new session" },
44552
- { flags: "--session <id>", description: "the agent session to carry on, over the card's own" },
44553
- { flags: "--fork", description: "with --session: start from a copy of it" },
44554
- { flags: "--transcript <file>", description: "the discussion the card came from, read when no session is carried on" }
44553
+ { internal: true, flags: "--new-session", description: "start planning in a new session" },
44554
+ { internal: true, flags: "--session <id>", description: "the agent session to carry on, over the card's own" },
44555
+ { internal: true, flags: "--fork", description: "with --session: start from a copy of it" },
44556
+ { internal: true, flags: "--transcript <file>", description: "the discussion the card came from, read when no session is carried on" }
44555
44557
  ];
44556
44558
  FLOWS = [
44557
44559
  {
@@ -44807,7 +44809,7 @@ var init_roles = __esm({
44807
44809
  value: "auto",
44808
44810
  label: "Just do them",
44809
44811
  cost: "For speed over quality",
44810
- 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.`
44812
+ 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.`
44811
44813
  },
44812
44814
  { value: "propose", label: "Ask me first", cost: "For balancing speed and quality" },
44813
44815
  {
@@ -45359,27 +45361,18 @@ var init_launch = __esm({
45359
45361
  // src/lib/agent/command.ts
45360
45362
  import fs36 from "node:fs";
45361
45363
  import path39 from "node:path";
45362
- function selfCommand() {
45363
- const bin = path39.resolve(path39.dirname(SELF), "..", "bin", "ai4kanban.mjs");
45364
- const file2 = fs36.existsSync(bin) ? bin : SELF;
45365
- const inside2 = rel(file2);
45366
- const shortHop = !inside2.startsWith("..") && !path39.isAbsolute(inside2) && inside2.split(/[\\/]/).length <= 3;
45367
- return `node ${shortHop ? inside2 : file2}`;
45368
- }
45369
45364
  function boardCommand() {
45370
- return pathLookup()("akb") ? "akb" : selfCommand();
45371
- }
45372
- function boardCommandFor(_cardId) {
45373
- const command = pathLookup()("akb") ? "akb" : `node ${absoluteSelf()}`;
45374
- return `${command}${BOARD_FLAG || ` --dir ${REPO_ROOT}`}`;
45375
- }
45376
- function absoluteSelf() {
45365
+ const configured = process.env.AI4KANBAN_COMMAND?.trim();
45366
+ const entry = path39.basename(process.argv[1] ?? "");
45367
+ const byPath2 = entry === "kanban.mjs" || entry === "ai4kanban.mjs";
45377
45368
  const bin = path39.resolve(path39.dirname(SELF), "..", "bin", "ai4kanban.mjs");
45378
- return fs36.existsSync(bin) ? bin : SELF;
45369
+ const file2 = fs36.existsSync(bin) ? bin : SELF;
45370
+ const program2 = configured || (!byPath2 && pathLookup()("akb") ? "akb" : `node ${shellWord(file2)}`);
45371
+ return program2 + (BOARD_FLAG || ` --dir ${shellWord(REPO_ROOT)}`);
45379
45372
  }
45380
45373
  function commandNote(command) {
45381
- if (command === "akb") return "";
45382
- return `In the guides, \`akb\` means \`${command}\` here.`;
45374
+ if (command === "akb") return "Find commands with `akb help`, then read the matching subcommand\u2019s `--help`.";
45375
+ return `Find commands with \`${command} help\`, then read the matching subcommand\u2019s \`--help\`. In guides, use \`${command}\` for \`akb\`.`;
45383
45376
  }
45384
45377
  var init_command = __esm({
45385
45378
  "src/lib/agent/command.ts"() {
@@ -46158,7 +46151,7 @@ var init_pause = __esm({
46158
46151
  count2 = (n) => `${n} open question${n === 1 ? "" : "s"}`;
46159
46152
  upper = (text5) => text5 ? text5[0].toUpperCase() + text5.slice(1) : text5;
46160
46153
  end = (text5) => /[.!?)]$/.test(text5) ? text5 : `${text5}.`;
46161
- cancelCommand = (delivery) => `${boardCommand()} raw delivery cancel ${delivery.deliveryId}`;
46154
+ cancelCommand = (delivery) => `${boardCommand()} delivery cancel ${delivery.deliveryId}`;
46162
46155
  backInMotion = (delivery) => `\`${cancelCommand(delivery)}\` ends it and leaves the branch.`;
46163
46156
  }
46164
46157
  });
@@ -46432,7 +46425,7 @@ function resumeRefusal(delivery, store) {
46432
46425
  const live = store ?? readStore();
46433
46426
  const holder = activeIn(live, delivery.cardId);
46434
46427
  if (holder && holder.deliveryId !== id2) {
46435
- const command = `${boardCommand()} raw delivery cancel ${holder.deliveryId}`;
46428
+ const command = `${boardCommand()} delivery cancel ${holder.deliveryId}`;
46436
46429
  return refusal(
46437
46430
  "deliveryHeld",
46438
46431
  `delivery ${holder.deliveryId} is building #${card} now \u2014 end that one first with \`${command}\`.`,
@@ -46640,9 +46633,9 @@ function heldByDelivery(cardId2, program2) {
46640
46633
  if (insideDelivery(cardId2)) return void 0;
46641
46634
  const cmd = program2 ?? boardCommand();
46642
46635
  const state = deliveryState(delivery, openQuestions(cardId2));
46643
- const answer2 = `Answer it with \`${cmd} raw card resolve ${cardId2}\`.`;
46636
+ const answer2 = `Answer it with \`${cmd} task resolve ${cardId2}\`.`;
46644
46637
  const doing = state.paused ? `is waiting on you on #${cardId2} \u2014 ${state.line} \u2014 so the board won't change the card. ${answer2} Or take the card back with ` : `is in flight on #${cardId2} \u2014 it is building the card as it was approved when it started, so the board won't change it. Take the card back with `;
46645
- return `delivery ${delivery.deliveryId} ${doing}Discard on the card page, or \`${cmd} raw delivery cancel ${delivery.deliveryId}\` to end it here.`;
46638
+ return `delivery ${delivery.deliveryId} ${doing}Discard on the card page, or \`${cmd} delivery cancel ${delivery.deliveryId}\` to end it here.`;
46646
46639
  }
46647
46640
  var auditPath, activeAudits, auditRow, lastSessionRunning, localAudit, unknownDelivery, isResumable, cardStatus, openQuestions, activeIn, listDeliveries, withStudio;
46648
46641
  var init_deliveries = __esm({
@@ -47465,7 +47458,7 @@ var init_Storyboard = __esm({
47465
47458
  var Studio_default;
47466
47459
  var init_Studio = __esm({
47467
47460
  "src/components/Studio.md"() {
47468
- 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';
47461
+ 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';
47469
47462
  }
47470
47463
  });
47471
47464
 
@@ -47585,7 +47578,6 @@ var init_studio_shared = __esm({
47585
47578
  init_memory();
47586
47579
  init_paths();
47587
47580
  init_studio_files();
47588
- init_command();
47589
47581
  init_cloud_studios();
47590
47582
  }
47591
47583
  });
@@ -47600,7 +47592,7 @@ function stopReason(deliveryId) {
47600
47592
  const ids = new Set(delivery.sessions);
47601
47593
  const last = readRuns().filter((r) => ids.has(r.sessionId) && r.action === "implement" && r.status !== "running").at(-1);
47602
47594
  if (!last) return void 0;
47603
- if (last.status === "done" && delivery.status === "active") return notCompletedWhy(deliveryId);
47595
+ if (last.status === "done" && delivery.status === "active") return notCompletedWhy(deliveryId, boardCommand());
47604
47596
  if (last.status === "error" || last.status === "interrupted") return firstLine(last.error);
47605
47597
  return void 0;
47606
47598
  }
@@ -47610,7 +47602,7 @@ function resumePrompt(deliveryId, action) {
47610
47602
  }
47611
47603
  function deliveryRequirements(deliveryId, cardId2) {
47612
47604
  if (cardId2 !== null) {
47613
- return DELIVERY_RESUME_CARD.replace("%c", `${boardCommandFor(cardId2)} raw card implement ${cardId2} --print`);
47605
+ return DELIVERY_RESUME_CARD.replace("%c", `${boardCommand()} task implement ${cardId2} --print`);
47614
47606
  }
47615
47607
  const delivery = findDelivery(deliveryId);
47616
47608
  const approved = delivery?.approved.trim();
@@ -47627,6 +47619,7 @@ function restartPrompt(req, deliveryId) {
47627
47619
  if (deliveryId && req.action === "implement") return [
47628
47620
  RESTART_LEAD,
47629
47621
  `Continue delivery ${deliveryId}. ${deliveryRequirements(deliveryId, req.id ?? null)}`.trim(),
47622
+ commandNote(boardCommand()),
47630
47623
  studioRulesBlock({ ...req, deliveryId })
47631
47624
  ].filter(Boolean).join("\n\n");
47632
47625
  if (!RESTARTABLE.has(req.action)) return void 0;
@@ -47634,7 +47627,7 @@ function restartPrompt(req, deliveryId) {
47634
47627
  }
47635
47628
  function buildAsk(rawReq, notes = []) {
47636
47629
  const req = withStudio(rawReq);
47637
- const command = DELIVERY_FLOWS.has(req.action) ? boardCommandFor(req.id) : boardCommand();
47630
+ const command = boardCommand();
47638
47631
  const ask2 = [actionPrompt(req, command, notes), pictureNote(req), commandNote(command)].filter(Boolean).join(" ");
47639
47632
  return realPaths(boardText([ask2, componentsBlock(req)].filter(Boolean).join("\n\n")), req);
47640
47633
  }
@@ -47734,7 +47727,7 @@ function buildRun(req) {
47734
47727
  function answeredNote(cardId2, command) {
47735
47728
  const delivery = cardId2 === void 0 ? void 0 : activeDelivery(cardId2);
47736
47729
  if (!delivery) return "";
47737
- return `Delivery ${delivery.deliveryId} is already building this card. Once your answers are on it, say what they did to what it was approved to build: \`${command} raw delivery answered ${delivery.deliveryId} --changed|--unchanged "<why>"\`, before you drop the questions. Judge the meaning, not the words \u2014 say nothing and the board carries the build on as unchanged.`;
47730
+ return `Record how the answers affect delivery ${delivery.deliveryId} before closing the questions. Run \`${command} delivery answered ${delivery.deliveryId} --changed "<why>"\` if the approved requirements changed, or \`${command} delivery answered ${delivery.deliveryId} --unchanged "<why>"\` otherwise.`;
47738
47731
  }
47739
47732
  function carriedNote(req) {
47740
47733
  if (req.action === "implement") {
@@ -47805,7 +47798,7 @@ function actionPrompt(req, command, notes) {
47805
47798
  case "review-memory":
47806
47799
  return [
47807
47800
  `Review what this board's conversations settled and write it into memory, following \`akb guide review-memory\`.`,
47808
- req.tasks?.length ? `The conversations are the ones \`${command} raw memory review --task ${req.tasks.join(" ")} --print\` prints.` : ""
47801
+ req.tasks?.length ? `The conversations are the ones \`${command} memory review --task ${req.tasks.join(" ")} --print\` prints.` : ""
47809
47802
  ].filter(Boolean).join(" ");
47810
47803
  // The dismissal review (#929). The flow lists the dismissals and restored ids; the guide
47811
47804
  // holds every rule.
@@ -47869,7 +47862,6 @@ var init_prompts = __esm({
47869
47862
  init_facts();
47870
47863
  init_outputs();
47871
47864
  init_archive();
47872
- init_flows();
47873
47865
  init_resolve();
47874
47866
  init_runner();
47875
47867
  init_studio_shared();
@@ -50546,12 +50538,12 @@ function validateSpec(file2, text5, id2) {
50546
50538
  if (!fields2.has(key)) add2(1, "missing-field", `Missing ${key}: in frontmatter. Restore it with the board's metadata commands.`);
50547
50539
  }
50548
50540
  const { meta: meta3 } = parseFrontmatter(text5);
50549
- if (typeof meta3?.title !== "string" || !meta3.title.trim()) add2(fields2.get("title")?.line ?? 1, "title", "The title is empty. Set a non-empty title with akb raw update.");
50541
+ if (typeof meta3?.title !== "string" || !meta3.title.trim()) add2(fields2.get("title")?.line ?? 1, "title", "The title is empty. Set a non-empty title with akb task update.");
50550
50542
  for (const key of ["priority", "status"]) {
50551
50543
  const allowed2 = key === "status" ? STATUSES : LEVELS;
50552
50544
  const value = fields2.get(key);
50553
50545
  if (value && !allowed2.includes(value.value.replace(/^['"]|['"]$/g, ""))) {
50554
- add2(value.line, key, `Invalid ${key} ${JSON.stringify(value.value)}. Expected ${allowed2.join(", ")}; use akb raw update.`);
50546
+ add2(value.line, key, `Invalid ${key} ${JSON.stringify(value.value)}. Expected ${allowed2.join(", ")}; use akb task update.`);
50555
50547
  }
50556
50548
  }
50557
50549
  const approved = fields2.get("preview_approved");
@@ -50578,12 +50570,12 @@ function validateSpec(file2, text5, id2) {
50578
50570
  if (key === "blocked_by") {
50579
50571
  const groups = enclosingGroups(file2);
50580
50572
  for (const g of groups.filter((g2) => values.includes(String(g2)))) {
50581
- add2(field2.line, "dependency-cycle", `blocked_by names #${g}, a group this card is in; the group waits for this card, so neither can finish. Remove it with akb raw update.`);
50573
+ add2(field2.line, "dependency-cycle", `blocked_by names #${g}, a group this card is in; the group waits for this card, so neither can finish. Remove it with akb task update.`);
50582
50574
  }
50583
50575
  if (id2 !== void 0 && groups.length) {
50584
50576
  for (const dep of values.filter((v) => /^\d+$/.test(v) && !groups.includes(Number(v))).map(Number)) {
50585
50577
  const cycle = dependencyCycle(id2, dep);
50586
- if (cycle) add2(field2.line, "dependency-cycle", `blocked_by #${dep} makes a cycle: ${cycle.map((n) => `#${n}`).join(" \u2192 ")}. Drop one link with akb raw update <id> --blocked-by.`);
50578
+ if (cycle) add2(field2.line, "dependency-cycle", `blocked_by #${dep} makes a cycle: ${cycle.map((n) => `#${n}`).join(" \u2192 ")}. Set the remaining blockers with akb task update <id> --blocked-by <ids>.`);
50587
50579
  }
50588
50580
  }
50589
50581
  }
@@ -50783,7 +50775,7 @@ function validateStoryboards(file2, id2, text5) {
50783
50775
  const dir = path55.join(ASSETS, String(id2));
50784
50776
  for (const [tag, tagOf, rule, fix] of [
50785
50777
  ["Storyboard", storyboardTag, "storyboard-src", "Write the JSON there or fix the path."],
50786
- ["Studio", studioTag, "studio-src", "Write it with `akb raw studio diagram <studio id> <card id>` or fix the path."]
50778
+ ["Studio", studioTag, "studio-src", "Fix the path or freeze the draft with `akb studio preview <card> --folder <draft> --base <baseline>` and use the returned Studio tag."]
50787
50779
  ]) {
50788
50780
  for (const marker of storyboardMarkers(text5, tagOf)) {
50789
50781
  const named2 = assetName(marker.src, id2, ["json"]);
@@ -51007,7 +50999,7 @@ function validateCreate(opts) {
51007
50999
  }
51008
51000
  function cmdCreate(opts) {
51009
51001
  const { title, priority, blocked_by, related, modules, triage, studio, previews, source: source2, questions, written } = validateCreate(opts);
51010
- if (opts.id === void 0) die("\u8BF7\u901A\u8FC7 `akb raw create` \u521B\u5EFA\u5361\u7247\uFF0C\u7531 Cloud \u5206\u914D\u7F16\u53F7", { kind: "needs-cloud" });
51002
+ if (opts.id === void 0) die('\u8BF7\u901A\u8FC7 `akb task create --title "<title>"` \u521B\u5EFA\u5361\u7247\uFF0C\u7531 Cloud \u5206\u914D\u7F16\u53F7', { kind: "needs-cloud" });
51011
51003
  const start = opts.id;
51012
51004
  const slug = slugify2(opts.slug !== void 0 ? opts.slug : title);
51013
51005
  const fileRel = `${start}-${slug}.md`;
@@ -51078,7 +51070,7 @@ function cmdUpdate(id2, flags) {
51078
51070
  if (!found2) die(`no task with id ${id2} under ${rel(TODO)}`, { kind: "card-not-found", id: id2 });
51079
51071
  const file2 = found2.kind === "group" ? path57.join(found2.target, "root.md") : found2.target;
51080
51072
  const { meta: meta3, body } = parseFrontmatter(fs53.readFileSync(file2, "utf8"));
51081
- if (!meta3) die(`${rel(file2)} has no frontmatter \u2014 recreate it with \`akb raw create\``);
51073
+ if (!meta3) die(`${rel(file2)} has no frontmatter \u2014 restore this card from its last valid version`);
51082
51074
  if (flags.blockedBy !== void 0 && flags.addBlockedBy !== void 0) die("--blocked-by replaces the list and --add-blocked-by appends to it \u2014 pass one");
51083
51075
  if (flags.related !== void 0 && flags.addRelated !== void 0) die("--related replaces the list and --add-related appends to it \u2014 pass one");
51084
51076
  if (flags.source !== void 0 && flags.addSource !== void 0) die("--source replaces the list and --add-source appends to it \u2014 pass one");
@@ -51178,7 +51170,7 @@ function updateCardQuestions(id2, ops, compatibility = false) {
51178
51170
  if (!found2) die(`no task with id ${id2} under ${rel(TODO)}`, { kind: "card-not-found", id: id2 });
51179
51171
  const file2 = found2.kind === "group" ? path57.join(found2.target, "root.md") : found2.target;
51180
51172
  const { meta: meta3, body } = parseFrontmatter(fs53.readFileSync(file2, "utf8"));
51181
- if (!meta3) die(`${rel(file2)} has no frontmatter \u2014 recreate it with \`akb raw create\``);
51173
+ if (!meta3) die(`${rel(file2)} has no frontmatter \u2014 restore this card from its last valid version`);
51182
51174
  for (const op of ops) {
51183
51175
  if (!compatibility || !op.question?.agent) continue;
51184
51176
  const agent = findSpecAgent(op.question.agent);
@@ -51237,7 +51229,7 @@ var init_card = __esm({
51237
51229
  var config_default;
51238
51230
  var init_config2 = __esm({
51239
51231
  "src/templates/config.md"() {
51240
- config_default = "# Configuration\n\nThis file holds your board's settings. `akb raw init` seeds it at `docs/kanban/config.md`,\nand an update never touches it.\n\n- **Stale after** \u2014 30 days\n _(how long a card may sit untouched before `akb raw list --stale` calls it stuck.)_\n";
51232
+ config_default = "# Configuration\n\nThis file holds your board's settings. `akb update` restores it if it is missing.\n\n- **Stale after** \u2014 30 days\n _(how long a card may sit untouched before `akb board list --stale` calls it stuck.)_\n";
51241
51233
  }
51242
51234
  });
51243
51235
 
@@ -56193,23 +56185,27 @@ function movedTo(word, program2) {
56193
56185
  function unknownWord(message) {
56194
56186
  return /unknown command '([^']+)'/.exec(message)?.[1] ?? "";
56195
56187
  }
56196
- var RAW_GROUPS, MOVED;
56188
+ var MOVED;
56197
56189
  var init_moved = __esm({
56198
56190
  "src/lib/cli/moved.ts"() {
56199
56191
  "use strict";
56200
- init_flows();
56201
- RAW_GROUPS = ["card", "delivery", "run", "triage", "previews", "components", "agent", "review-dismissals", "describe-project", "reflect"];
56202
56192
  MOVED = {
56203
- ...Object.fromEntries(FLOWS.filter((flow) => !flow.internal).map((flow) => [flow.command, `raw ${flowPath(flow)}`])),
56204
- ...Object.fromEntries(RAW_GROUPS.map((word) => [word, `raw ${word}`])),
56205
- create: "raw create",
56206
- runs: "raw run list",
56207
- log: "raw run log",
56208
- stop: "raw run stop",
56209
- resume: "raw run resume",
56210
- cancel: "raw delivery cancel",
56211
- discard: "raw delivery cancel",
56212
- board: "raw",
56193
+ card: "task --help",
56194
+ create: "task create",
56195
+ refine: "task refine",
56196
+ revise: "task revise",
56197
+ resolve: "task resolve",
56198
+ implement: "task implement",
56199
+ approve: "task approve",
56200
+ previews: "studio previews",
56201
+ "review-memory": "memory review",
56202
+ "describe-project": "memory describe-project",
56203
+ runs: "run list",
56204
+ log: "run log",
56205
+ stop: "run stop",
56206
+ resume: "run resume",
56207
+ cancel: "delivery cancel",
56208
+ discard: "delivery cancel",
56213
56209
  version: "--version"
56214
56210
  };
56215
56211
  }
@@ -56468,7 +56464,7 @@ function conflictPrompt(board2, work = "Continue the original work from its save
56468
56464
  const records = conflictList(board2);
56469
56465
  return records.length ? [
56470
56466
  "Resolve these saved board content conflicts using `akb guide resolve-conflict` before continuing.",
56471
- ...records.map((r) => `${r.id}: ${r.paths.join(", ")}; read with akb raw conflict show ${r.id}.`),
56467
+ ...records.map((r) => `${r.id}: ${r.paths.join(", ")}; read with akb board conflict show ${r.id}.`),
56472
56468
  work
56473
56469
  ].join("\n") : "";
56474
56470
  }
@@ -56487,7 +56483,7 @@ async function withSyncLock(board2, work) {
56487
56483
  }
56488
56484
  }
56489
56485
  function refuse(record2, message, kind = "conflict") {
56490
- throw new BoardError(message, { kind, id: record2.id, read: `akb raw conflict show ${record2.id}` });
56486
+ throw new BoardError(message, { kind, id: record2.id, read: `akb board conflict show ${record2.id}` });
56491
56487
  }
56492
56488
  function resolutionOf(record2, value) {
56493
56489
  if (!value || typeof value !== "object" || Object.keys(value).join() !== "files" || !Array.isArray(value.files)) refuse(record2, 'Expected {"files":[{"path":"...","content":"..."}]} .', "invalid-usage");
@@ -56728,7 +56724,10 @@ var init_question_options = __esm({
56728
56724
  // src/lib/cli/board.ts
56729
56725
  var board_exports = {};
56730
56726
  __export(board_exports, {
56731
- buildBoardProgram: () => buildBoardProgram
56727
+ buildBoardProgram: () => buildBoardProgram,
56728
+ createBoardCard: () => createBoardCard,
56729
+ declareBoardMoves: () => declareBoardMoves,
56730
+ withCreateOptions: () => withCreateOptions
56732
56731
  });
56733
56732
  import crypto5 from "node:crypto";
56734
56733
  import fs66 from "node:fs";
@@ -56843,13 +56842,16 @@ function unwrap(res) {
56843
56842
  if (res.ok) return res.data;
56844
56843
  throw new BoardError(res.error, res.kind === "conflict" ? { kind: "conflict" } : { kind: "refused" });
56845
56844
  }
56846
- function buildBoardProgram(cli) {
56847
- const program2 = withShared(newCommand(cli.program));
56848
- program2.description(
56849
- "the local board and the commands an agent uses inside a run; a person never has to type one. They own a card's frontmatter \u2014 write and edit only a card's body."
56850
- ).helpCommand("help [move]", "this list, or one move in full");
56851
- const move = (name) => withShared(program2.command(name));
56852
- const conflict = move("conflict").summary("read and explicitly resolve saved board content conflicts");
56845
+ function withCreateOptions(command, legacy = false) {
56846
+ return command.addOption(new Option("--title <title>", "write a local card with a Cloud-assigned number").makeOptionMandatory(legacy)).option("--studio <id>", "the Studio from `akb studio list`").option("--priority <level>", `how much it matters: ${LEVELS.join(" | ")} (default: med)`, oneOf(LEVELS)).option("--blocked-by <ids>", "ids of open cards this one waits on", collectList).option("--related <ids>", "ids of open cards this one relates to", collectList).option("--modules <names>", "the parts of the project it touches, validated against modules.md", collectList).option("--slug <slug>", "the filename to write it under (default: from the title)").option("--triage <source-id>", "the triage item this card is made of").option("--source <ref>", "where it came from: a plan's path, plan:<id>, #<id> or a URL. Repeatable", collect2);
56847
+ }
56848
+ async function createBoardCard(command, cli, asked = []) {
56849
+ refuseRecurring(command);
56850
+ await dispatch("create", command, [], { ...command.opts(), asked }, cli);
56851
+ }
56852
+ function declareBoardMoves(program2, cli, groups) {
56853
+ const move = (name, parent = program2) => withShared(parent.command(name));
56854
+ const conflict = move("conflict", groups?.board).summary("read and explicitly resolve saved board content conflicts");
56853
56855
  withShared(conflict.command("list")).summary("list pending local conflicts without contacting Cloud").action(async function() {
56854
56856
  await dispatch("conflict-list", this, [], this.opts(), cli);
56855
56857
  });
@@ -56859,42 +56861,28 @@ function buildBoardProgram(cli) {
56859
56861
  withShared(conflict.command("resolve <id>")).summary("submit explicit results for the entire original batch").requiredOption("--expect <revision>", "the credential just returned by conflict show").requiredOption("--file <path>", "UTF-8 JSON with each conflicting path and final content; null deletes").action(async function(id2) {
56860
56862
  await dispatch("conflict-resolve", this, [id2], this.opts(), cli);
56861
56863
  });
56862
- const asked = [];
56863
- const inOrder = ordered(asked);
56864
- move("create").summary("write exactly one card \u2014 its fields, its body template and its index entry").description(
56865
- 'Write exactly ONE card: allocate its id, write its frontmatter and a body template, and index it. There is no separate id-reservation mode. --blocked-by and --related take ids of existing open cards; for a group, create the root first, then create each subtask related to its id (see "Group tasks" in `akb guide add-task`). The script owns the frontmatter and writes the body scaffold; fill only the body by hand. Without --id, Cloud assigns the number in the linked project (no source task required). A failed local write can resume the same creation without making another Cloud task. Missing or invalid project links and denied access exit with code 1 using the existing error envelope. --body-file accepts a short draft or full card body. Invalid bodies fail before allocating a task or writing a card, with repair instructions. Cloud moves the card on by itself once it reaches the board: do not refine it here. Example: akb raw create --title "Add a delete command" --studio coding --body-file /tmp/delete-command.md'
56866
- ).requiredOption("--title <title>", "what the card is called").addOption(new Option("--recurring").hideHelp()).option("--priority <level>", `how much it matters: ${LEVELS.join(" | ")} (default: med)`, oneOf(LEVELS)).option("--blocked-by <ids>", "ids of open cards this one waits on", collectList).option("--related <ids>", "ids of open cards this one relates to", collectList).option("--modules <names>", "the parts of the project it touches, validated against modules.md", collectList).option("--question <text>", "an open question; needs its --option choices. Repeatable; follow `akb guide update-questions`", inOrder("question")).option("--option <text>", "a choice for the --question before it", inOrder("option")).option("--recommended-option <text>", "a choice for the --question before it, ticked to start", inOrder("recommended-option")).option("--mode <mode>", "how many choices the --question before it takes: single | multi", inOrder("mode")).option("--slug <slug>", "the filename to write it under (default: from the title)").option("--no-body", "write the frontmatter and no body template").option("--body-file <path>", "a short draft or full card body, written to a file first").addOption(new Option("--cadence <cadence>").hideHelp()).option("--studio <id>", "the studio it runs through (`akb studio list`). Required when the board has more than one, except inside a task run, which uses the task's own").option("--previews <ids>", 'the Preview IDs chosen from its Studio; "" chooses none', collectList).addOption(new Option("--id <n>", "the number Cloud gave this card's task; for the Runner").argParser(cardId).hideHelp()).option("--triage <source-id>", "the triage item this card is made of, so the item is never carded twice").option("--source <ref>", "where it came from: a plan's path, plan:<id>, #<id> or a URL. Repeatable", collect2).action(async function() {
56867
- refuseRecurring(this);
56868
- await dispatch("create", this, [], { ...this.opts(), asked }, cli);
56869
- });
56870
- move("update").argument("<id>", ID, cardId).summary("rewrite a card's fields").description(
56864
+ const update2 = move("update", groups?.task).argument("<id>", ID, cardId).summary("rewrite a card's fields").description(
56871
56865
  "Rewrite a card's frontmatter fields. --slug renames it. Body and questions are left untouched \u2014 those have their own moves."
56872
- ).option("--title <title>", "what the card is called").option("--priority <level>", LEVELS.join(" | "), oneOf(LEVELS)).option("--status <status>", STATUSES.join(" | "), oneOf(STATUSES)).option("--blocked-by <ids>", "ids of open cards this one waits on", collectList).option("--related <ids>", "ids of open cards this one relates to", collectList).option("--add-blocked-by <ids>", "append ids to blocked_by, keeping the ids already there", collectList).option("--add-related <ids>", "append ids to related, keeping the ids already there", collectList).option("--modules <names>", "the parts of the project it touches", collectList).option("--source <ref>", `where it came from: a plan's path, plan:<id>, #<id> or a URL. Repeatable; "" clears the list`, collect2).option("--add-source <ref>", "append one source, keeping the ones already there. Repeatable", collect2).option("--previews <ids>", 'the Preview IDs chosen from its Studio; "" chooses none', collectList).option("--slug <slug>", "rename the file").option("--studio <id>", "the studio it runs through. The card goes back to todo and is re-planned").addOption(new Option("--cadence <cadence>").hideHelp()).action(async function(id2) {
56866
+ ).option("--title <title>", "what the card is called").option("--priority <level>", LEVELS.join(" | "), oneOf(LEVELS)).option("--status <status>", STATUSES.join(" | "), oneOf(STATUSES)).option("--blocked-by <ids>", "ids of open cards this one waits on", collectList).option("--related <ids>", "ids of open cards this one relates to", collectList).option("--add-blocked-by <ids>", "append ids to blocked_by, keeping the ids already there", collectList).option("--add-related <ids>", "append ids to related, keeping the ids already there", collectList).option("--modules <names>", "the parts of the project it touches", collectList).option("--source <ref>", `where it came from: a plan's path, plan:<id>, #<id> or a URL. Repeatable; "" clears the list`, collect2).option("--add-source <ref>", "append one source, keeping the ones already there. Repeatable", collect2).option("--slug <slug>", "rename the file").option("--studio <id>", "the studio it runs through. The card goes back to todo and is re-planned").addOption(new Option("--cadence <cadence>").hideHelp()).action(async function(id2) {
56873
56867
  refuseRecurring(this);
56874
56868
  await dispatch("update", this, [String(id2)], this.opts(), cli);
56875
56869
  });
56876
- const questionOps = [];
56877
- withQuestionOptions(withShared(program2.command("update-questions", { hidden: true })).argument("<id>", ID, cardId).summary("edit open questions on a local card (compatibility)").description("For older Runner instructions. Use akb task update-questions.\nSee akb guide update-questions."), questionOps).action(async function(id2) {
56878
- await dispatch("update-questions", this, [String(id2)], { ops: questionOps }, cli);
56879
- });
56880
- move("inspect").argument("<id>", ID, cardId).summary("read task facts, saved work and execution references").action(async function(id2) {
56870
+ if (!groups) update2.option("--previews <ids>", 'the Preview IDs chosen from its Studio; "" chooses none', collectList);
56871
+ move("inspect", groups?.task).argument("<id>", ID, cardId).summary("read task facts, saved work and execution references").action(async function(id2) {
56881
56872
  await dispatch("inspect", this, [String(id2)], this.opts(), cli);
56882
56873
  });
56883
- move("validate").argument("[id]", ID, cardId).summary("validate card format and report file, line, and repair instructions").description("Check one card, or every open card when no id is given. Reads only; exits non-zero with detailed errors until the format is valid.").action(async function(id2) {
56874
+ move("validate", groups?.task).argument("[id]", ID, cardId).summary("validate card format and report file, line, and repair instructions").description("Check one card, or every open card when no id is given. Reads only; exits non-zero with detailed errors until the format is valid.").action(async function(id2) {
56884
56875
  await dispatch("validate", this, id2 === void 0 ? [] : [String(id2)], this.opts(), cli);
56885
56876
  });
56886
- move("file").argument("<studio>", "the studio, e.g. blog-post").argument("<path>", "the path inside the Studio folder").summary("print one file of a studio").description("In a task's run, reads the version the task is pinned to; otherwise the current one.").action(async function(studio, file2) {
56877
+ move("file", groups?.studio).argument("<studio>", "the studio, e.g. blog-post").argument("<path>", "the path inside the Studio folder").summary("print one file of a studio").description("In a task's run, reads the version the task is pinned to; otherwise the current one.").action(async function(studio, file2) {
56887
56878
  await dispatch("file", this, [studio, file2], this.opts(), cli);
56888
56879
  });
56889
- withShared(program2.command("agent-file", { hidden: true })).argument("<agent>").argument("<path>").action(async function(agent, file2) {
56890
- await dispatch("agent-file", this, [agent, file2], this.opts(), cli);
56891
- });
56892
- move("memory-file").argument("<name>", "the global memory").summary("print one global memory's rules, its MEMORY.md").description(
56880
+ move(groups ? "file" : "memory-file", groups?.memory).argument("<name>", "the global memory").summary("print one global memory's rules, its MEMORY.md").description(
56893
56881
  "A run is told which global memories its agent keeps and reads one's rules when the work calls for it. A built-in memory's rules ship inside the command, so this is the only way to open them."
56894
56882
  ).action(async function(name) {
56895
56883
  await dispatch("memory-file", this, [name], this.opts(), cli);
56896
56884
  });
56897
- move("list").summary("the open cards: id, title, meta, summary, path \u2014 or, with --archived, the cards that landed").description(
56885
+ move("list", groups?.board).summary("the open cards: id, title, meta, summary, path \u2014 or, with --archived, the cards that landed").description(
56898
56886
  "The open cards at a glance \u2014 one block per card with its id, title, meta (status, priority, blockers, open questions), summary line and file path.\n\n`--stale` asks the other question: which cards have sat untouched past the board's **Stale after** setting (config.md, 30 days by default), stalest first, each with the days it has sat and what is holding it \u2014 a blocker, an unanswered question, or a build. Age is the date git last saw the card's file; group roots and cards git cannot date are left out.\n\n`--archived` answers \"which cards landed in this period\": one block per landing, oldest first, with the card id, title, studio, landing time, landed commit and the archived card file (blank when the file is no longer in .archive/, e.g. deleted by hand; a card the daily cleanup deletes goes with its finished delivery and is not listed). Only cards the board landed are listed \u2014 a card archived by hand, committed by hand, or built by a studio that leaves files instead of a commit is not among them."
56899
56887
  ).option("-m, --module <name>", "only the cards tagged with that module, validated against modules.md").option("--stale", "only the cards untouched past the threshold, stalest first, with the days each has sat").option("--archived", "the cards that landed and were archived, oldest first, each with its landed commit").option(
56900
56888
  "--since <time>",
@@ -56902,6 +56890,28 @@ function buildBoardProgram(cli) {
56902
56890
  ).option("--studio <id>", "with --archived: only the cards of that studio").action(async function() {
56903
56891
  await dispatch("list", this, [], this.opts(), cli);
56904
56892
  });
56893
+ }
56894
+ function buildBoardProgram(cli) {
56895
+ const program2 = withShared(newCommand(cli.program));
56896
+ program2.description(
56897
+ "the local board and the commands an agent uses inside a run; a person never has to type one. They own a card's frontmatter \u2014 write and edit only a card's body."
56898
+ ).helpCommand("help [move]", "this list, or one move in full");
56899
+ const move = (name) => withShared(program2.command(name));
56900
+ declareBoardMoves(program2, cli);
56901
+ const asked = [];
56902
+ const inOrder = ordered(asked);
56903
+ withCreateOptions(move("create"), true).summary("write exactly one card \u2014 its fields, its body template and its index entry").description(
56904
+ 'Write exactly ONE card: allocate its id, write its frontmatter and a body template, and index it. There is no separate id-reservation mode. --blocked-by and --related take ids of existing open cards; for a group, create the root first, then create each subtask related to its id (see "Group tasks" in `akb guide add-task`). The script owns the frontmatter and writes the body scaffold; fill only the body by hand. Without --id, Cloud assigns the number in the linked project (no source task required). A failed local write can resume the same creation without making another Cloud task. Missing or invalid project links and denied access exit with code 1 using the existing error envelope. --body-file accepts a short draft or full card body. Invalid bodies fail before allocating a task or writing a card, with repair instructions. Cloud moves the card on by itself once it reaches the board: do not refine it here. Example: akb raw create --title "Add a delete command" --studio coding --body-file /tmp/delete-command.md'
56905
+ ).addOption(new Option("--recurring").hideHelp()).addOption(new Option("--cadence <cadence>").hideHelp()).option("--question <text>", "an open question; needs its --option choices", inOrder("question")).option("--option <text>", "a choice for the preceding --question", inOrder("option")).option("--recommended-option <text>", "a choice ticked to start", inOrder("recommended-option")).option("--mode <mode>", "single or multi", inOrder("mode")).option("--no-body", "write only the frontmatter").option("--body-file <path>", "read a draft or full card body from a file").option("--previews <ids>", "the Preview IDs from its Studio", collectList).addOption(new Option("--id <n>", "the number Cloud gave this card's task; for the Runner").argParser(cardId).hideHelp()).action(async function() {
56906
+ await createBoardCard(this, cli, asked);
56907
+ });
56908
+ const questionOps = [];
56909
+ withQuestionOptions(withShared(program2.command("update-questions", { hidden: true })).argument("<id>", ID, cardId).summary("edit open questions on a local card (compatibility)").description("For older Runner instructions. Use akb task update-questions.\nSee akb guide update-questions."), questionOps).action(async function(id2) {
56910
+ await dispatch("update-questions", this, [String(id2)], { ops: questionOps }, cli);
56911
+ });
56912
+ withShared(program2.command("agent-file", { hidden: true })).argument("<agent>").argument("<path>").action(async function(agent, file2) {
56913
+ await dispatch("agent-file", this, [agent, file2], this.opts(), cli);
56914
+ });
56905
56915
  move("reject").argument("<id>", ID, cardId).summary("legacy local removal; use task remove").description("Use akb task remove to remove the current task or a Cloud task. This compatibility command always removes a card from the local board.").option("--discard", "just drop it: nothing learns from it").option("--reason <text>", "why, kept on the archived card as `rejected_reason` and shown on its page").action(async function(id2) {
56906
56916
  await dispatch("reject", this, [String(id2)], this.opts(), cli);
56907
56917
  });
@@ -57055,16 +57065,19 @@ async function runBoard(argv, options = {}) {
57055
57065
  const { runProgram: runProgram2 } = await Promise.resolve().then(() => (init_shared2(), shared_exports));
57056
57066
  return runProgram2(buildBoardProgram2({ program: program2, cwd, installHint, version: version2, onAnswer }), argv, program2);
57057
57067
  }
57058
- function rawArgv(argv) {
57059
- const shared = [];
57068
+ function commandIndex(argv) {
57060
57069
  let i = 0;
57061
57070
  for (; i < argv.length; i++) {
57062
57071
  const arg = argv[i];
57063
- if (arg === "--json" || /^--(board|dir)=/.test(arg)) shared.push(arg);
57064
- else if ((arg === "--board" || arg === "--dir") && i + 1 < argv.length) shared.push(arg, argv[++i]);
57072
+ if (arg === "--json" || /^--(board|dir)=/.test(arg)) continue;
57073
+ if ((arg === "--board" || arg === "--dir") && i + 1 < argv.length) i++;
57065
57074
  else break;
57066
57075
  }
57067
- return argv[i] === "raw" ? [...shared, ...argv.slice(i + 1)] : null;
57076
+ return i;
57077
+ }
57078
+ function rawArgv(argv) {
57079
+ const i = commandIndex(argv);
57080
+ return argv[i] === "raw" ? [...argv.slice(0, i), ...argv.slice(i + 1)] : null;
57068
57081
  }
57069
57082
  function prose(box) {
57070
57083
  if (!box) return {};
@@ -57092,7 +57105,7 @@ function report(err, { program: program2, json: json2, box = null }) {
57092
57105
  }
57093
57106
  return err.exitCode;
57094
57107
  }
57095
- var MAKES_A_BOARD, hasBoard, isBoardDir, boardFromEnv;
57108
+ var MAKES_A_BOARD, hasBoard, isBoardDir, boardFromEnv, commandWord;
57096
57109
  var init_board_cli = __esm({
57097
57110
  "src/lib/board-cli.ts"() {
57098
57111
  "use strict";
@@ -57106,6 +57119,7 @@ var init_board_cli = __esm({
57106
57119
  const named2 = process.env.AI4KANBAN_BOARD?.trim();
57107
57120
  return named2 ? named2 : null;
57108
57121
  };
57122
+ commandWord = (argv) => argv[commandIndex(argv)] ?? "";
57109
57123
  }
57110
57124
  });
57111
57125
 
@@ -58379,13 +58393,11 @@ var init_goal_cloud = __esm({
58379
58393
  });
58380
58394
 
58381
58395
  // src/lib/agent/manual.ts
58382
- var HELP_AFTER;
58396
+ var PRINT_FLOW_HELP, HELP_AFTER;
58383
58397
  var init_manual = __esm({
58384
58398
  "src/lib/agent/manual.ts"() {
58385
58399
  "use strict";
58386
- HELP_AFTER = {
58387
- /** Under every flow: print it, or run it. The one choice each of them has. */
58388
- flow: `
58400
+ PRINT_FLOW_HELP = `
58389
58401
  Print it, or run it
58390
58402
  --print print the flow to follow in the current session, filled in for this board:
58391
58403
  the card's own path, the steps it has left, the memory file its modules point
@@ -58394,7 +58406,8 @@ Print it, or run it
58394
58406
  (no flag) start a separate session with its own context.
58395
58407
 
58396
58408
  Inside a task session, board actions print their flows. Prepare requested Previews there.
58397
- `,
58409
+ `;
58410
+ HELP_AFTER = {
58398
58411
  /** Under `delivery`: what one is, which no verb of it says on its own. */
58399
58412
  deliveries: (program2) => `
58400
58413
  What a delivery is
@@ -63070,7 +63083,7 @@ var init_add_task = __esm({
63070
63083
  var archive_default;
63071
63084
  var init_archive2 = __esm({
63072
63085
  "src/guide/archive.md"() {
63073
- archive_default = "# Finish a task\n\n## Record the outcome\n\nRecord the delivered outcome and verification on the task. Do not write independent memory.\n\n## Archive the card\n\nVerify the approved requirements and outputs. Leave unmet work unchecked and handle blockers\nthrough `akb guide implement`.\n\nFor an active delivery, run `akb raw delivery complete <id>` and follow the handoff. For Git\nprojects, supply `--commit <full-sha> --branch <target>`. If interrupted, inspect the recorded\nresult and retry the same completion.\n\nOutside an active delivery, use `akb task archive <task>`. The current Runner task archives\nlocally and synchronizes afterward. Other tasks archive in Cloud before the command returns.\nUse `akb task remove <task> [reason...]` to remove a task.\n";
63086
+ archive_default = "# Finish a task\n\n## Record the outcome\n\nRecord the delivered outcome and verification on the task. Do not write independent memory.\n\n## Archive the card\n\nVerify the approved requirements and outputs. Leave unmet work unchecked and handle blockers\nthrough `akb guide implement`.\n\nFor an active delivery, run `akb delivery complete <id>` and follow the handoff. For Git\nprojects, supply `--commit <full-sha> --branch <target>`. If interrupted, inspect the recorded\nresult and retry the same completion.\n\nOutside an active delivery, use `akb task archive <task>`. The current Runner task archives\nlocally and synchronizes afterward. Other tasks archive in Cloud before the command returns.\nUse `akb task remove <task> [reason...]` to remove a task.\n";
63074
63087
  }
63075
63088
  });
63076
63089
 
@@ -63078,7 +63091,7 @@ var init_archive2 = __esm({
63078
63091
  var board_default;
63079
63092
  var init_board3 = __esm({
63080
63093
  "src/guide/board.md"() {
63081
- board_default = "# How this board works\n\nThese rules apply to every card studio. Read them once; each studio's guide covers\nthe remaining details.\n\n## Layout\n\n```\ndocs/kanban/\n\u251C\u2500\u2500 todo/ open tasks\n\u2502 \u251C\u2500\u2500 README.md the index \u2014 read it first\n\u2502 \u2514\u2500\u2500 <id>-<slug>.md\n\u2502 one card per file; a group keeps its cards in one folder\n\u251C\u2500\u2500 rules/ `studios/<studio>.md` \u2014 Studio notes, set with `akb studio rule`\n\u2502 `<agent>.md` \u2014 project background-task instructions, set with\n\u2502 `akb studio instructions`\n\u251C\u2500\u2500 triage/ items waiting to be sorted, one file each \u2014 not cards. Only\n\u2502 \u2502 Cloud's sort or Refine idea on the web's Triage page turns one\n\u2502 \u2502 into a card; `akb raw triage check <source-id>` finds an existing one\n\u2502 \u251C\u2500\u2500 archived/ items a card was made of\n\u2502 \u251C\u2500\u2500 dismissed/ items ignored, with the reason\n\u2502 \u2514\u2500\u2500 files/ dropped-in files\n\u2514\u2500\u2500 modules.md one line per module \u2014 `akb guide module-map` writes it\n```\n\n## Task ID\n\nEvery task's id is the number at the front of its filename (`04-plan-cap-enforcement.md` \u2192\nid 4): its Cloud task's number (`WC-4`). Only Cloud assigns one.\n\n## Never hand-write a card's frontmatter\n\n`akb raw update`, `akb task update-questions` and `akb raw conflict resolve` manage a card's frontmatter,\nincluding its `previews`. Edit only the card's **body** by hand. `akb raw help`\nlists all operations; `akb raw help <move>` explains one operation.\n\n## Content conflicts\n\nFor synchronization conflicts, follow `akb guide resolve-conflict`.\n\n## Inside a board run\n\nA board run carries `KANBAN_RUN` in its environment. Never unset or bypass it (for example\n`env -u KANBAN_RUN`): when a command only prints a flow, follow the printed flow.\n\n## Group task\n\nA group lives in `todo/<id>-<slug>/`: `root.md` tracks the whole job and each subtask is its\nown card beside it; `akb guide add-task` says how to build one. The root's `## Todo` lists the\nsubtasks, one line each ending in `#<subid>`: archiving a subtask ticks its line, rejecting\none strikes it through, and resolving the last line archives the root in the same run, with\nany open question or unticked todo of its own. A board a Runner keeps leaves that close to\nCloud, which waits for the root to be queued with no step on it. A root listing no subtasks is\nonly closed by hand.\n\n## Task context\n\nContinue from the task's saved discussion, results and approved requirements. Follow explicit\nproject and Studio rules. Read relevant memory on demand; do not write memory in task runs.\n";
63094
+ board_default = "# How this board works\n\nThese rules apply to every card studio. Read them once; each studio's guide covers\nthe remaining details.\n\n## Layout\n\n```\ndocs/kanban/\n\u251C\u2500\u2500 todo/ open tasks\n\u2502 \u251C\u2500\u2500 README.md the index \u2014 read it first\n\u2502 \u2514\u2500\u2500 <id>-<slug>.md\n\u2502 one card per file; a group keeps its cards in one folder\n\u251C\u2500\u2500 rules/ `studios/<studio>.md` \u2014 Studio notes, set with `akb studio rule`\n\u2502 `<agent>.md` \u2014 project background-task instructions, set with\n\u2502 `akb studio instructions`\n\u251C\u2500\u2500 triage/ items waiting to be sorted, one file each \u2014 not cards. Only\n\u2502 \u2502 Cloud's sort or Refine idea on the web's Triage page turns one\n\u2502 \u2502 into a card; `akb triage check <source-id>` finds an existing one\n\u2502 \u251C\u2500\u2500 archived/ items a card was made of\n\u2502 \u251C\u2500\u2500 dismissed/ items ignored, with the reason\n\u2502 \u2514\u2500\u2500 files/ dropped-in files\n\u2514\u2500\u2500 modules.md one line per module \u2014 `akb guide module-map` writes it\n```\n\n## Task ID\n\nEvery task's id is the number at the front of its filename (`04-plan-cap-enforcement.md` \u2192\nid 4): its Cloud task's number (`WC-4`). Only Cloud assigns one.\n\n## Never hand-write a card's frontmatter\n\nEdit the card body directly. Use `akb task update` for card fields,\n`akb task update-questions` for questions, and `akb task review` for the review plan.\n\nFind commands with `akb help`, then read the matching subcommand's `--help`.\n\n## Content conflicts\n\nFor synchronization conflicts, follow `akb guide resolve-conflict`.\n\n## Inside a board run\n\nA board run carries `KANBAN_RUN` in its environment. Never unset or bypass it (for example\n`env -u KANBAN_RUN`): when a command only prints a flow, follow the printed flow.\n\n## Group task\n\nA group lives in `todo/<id>-<slug>/`: `root.md` tracks the whole job and each subtask is its\nown card beside it; `akb guide add-task` says how to build one. The root's `## Todo` lists the\nsubtasks, one line each ending in `#<subid>`: archiving a subtask ticks its line, rejecting\none strikes it through, and resolving the last line archives the root in the same run, with\nany open question or unticked todo of its own. A board a Runner keeps leaves that close to\nCloud, which waits for the root to be queued with no step on it. A root listing no subtasks is\nonly closed by hand.\n\n## Task context\n\nContinue from the task's saved discussion, results and approved requirements. Follow explicit\nproject and Studio rules. Read relevant memory on demand; do not write memory in task runs.\n";
63082
63095
  }
63083
63096
  });
63084
63097
 
@@ -63086,7 +63099,7 @@ var init_board3 = __esm({
63086
63099
  var card_chat_default;
63087
63100
  var init_card_chat = __esm({
63088
63101
  "src/guide/card-chat.md"() {
63089
- card_chat_default = '# Answer a card\'s conversation\n\nRead the task\u2019s review plan and work only on unlocked stages. An empty plan needs no extra approval; an undecided plan allows planning only.\n\n- **Where the task stands**: read `akb task show <id>` and `akb task review <id>`.\n- **Button labels**: name actions by their labels on the page, in the user\'s language: "Approve" or "Approve, start \u2026" (\u6279\u51C6 / \u6279\u51C6\uFF0C\u5F00\u59CB\u2026), "Resume" (\u7EED\u8DD1), "Start again" (\u91CD\u65B0\u53D1\u8D77).\n\n- **Change requirements or drafts**: when the user changes the scope, expected behavior, or draft, use `akb raw card revise <id> --print "<change>"`.\n- **Record an answer**: when the user answers an open question on the card, use `akb raw card resolve <id> --print`.\n- **Manage open questions**: when a decision needs the user\'s input, follow `akb guide update-questions` and use `akb task update-questions <task>` to edit the question list.\n- **Change card fields**: when the user changes metadata such as priority, modules, or dependencies, use `akb raw update <id>`.\n- **Previews**: prepare or revise only requested outputs, using the task-bound Studio\u2019s Preview instructions and supplied component documentation. Before changing approved output, invalidate its stage with `akb task review <id> --revise-from <stage> --revision <n>`. Preserve unrelated work.\n- **Create a separate task**: when the user asks to capture work unrelated to this card, follow `akb guide add-task`.\n- **Split this card**: when the user asks to break this card\'s outcome into subtasks, follow the group procedure in `akb guide add-task`.\n- **Change a studio**: use `akb guide update-studio` for shared Studio instructions; a correction to this card\'s draft alone stays on this card.\n- **Check card edits**: after writing a card, run `akb raw validate <id>` and fix what it reports.\n- **Anything else**: for a request this guide does not cover, read `akb help` once, then the matching command\'s `--help`.\n\nReply in plain, natural language. Do not write memory, including through any flow this conversation starts.\n\n- **Approve**: only on an explicit request, use `akb task approve <id> --stage <stage> --revision <reviewed revision>`. In a reply this commits after successful synchronization. Finish the reply without further edits or waiting. Never substitute the latest revision for the one reviewed.\n- **Change the plan**: submit a complete replacement with `akb task review <id> --file <json> --revision <n>`. It takes effect immediately. Answers to questions never approve work.\n';
63102
+ card_chat_default = '# Answer a card\'s conversation\n\nRead the task\u2019s review plan and work only on unlocked stages. An empty plan needs no extra approval; an undecided plan allows planning only.\n\n- **Where the task stands**: read `akb task show <id>` and `akb task review <id>`.\n- **Button labels**: name actions by their labels on the page, in the user\'s language: "Approve" or "Approve, start \u2026" (\u6279\u51C6 / \u6279\u51C6\uFF0C\u5F00\u59CB\u2026), "Resume" (\u7EED\u8DD1), "Start again" (\u91CD\u65B0\u53D1\u8D77).\n\n- **Change requirements or drafts**: when the user changes the scope, expected behavior, or draft, use `akb task revise <id> "<change>" --print`.\n- **Record an answer**: when the user answers an open question on the card, use `akb task resolve <id> --print`.\n- **Manage open questions**: when a decision needs the user\'s input, follow `akb guide update-questions` and use `akb task update-questions <task>` to edit the question list.\n- **Change card fields**: when the user changes metadata such as priority, modules, or dependencies, use `akb task update <id>`.\n- **Previews**: prepare or revise only requested outputs, using the task-bound Studio\u2019s Preview instructions and supplied component documentation. Before changing approved output, invalidate its stage with `akb task review <id> --revise-from <stage> --revision <n>`. Preserve unrelated work.\n- **Create a separate task**: when the user asks to capture work unrelated to this card, follow `akb guide add-task`.\n- **Split this card**: when the user asks to break this card\'s outcome into subtasks, follow the group procedure in `akb guide add-task`.\n- **Change a studio**: use `akb guide update-studio` for shared Studio instructions; a correction to this card\'s draft alone stays on this card.\n- **Check card edits**: after writing a card, run `akb task validate <id>` and fix what it reports.\n- **Anything else**: for a request this guide does not cover, read `akb help` once, then the matching command\'s `--help`.\n\nReply in plain, natural language. Do not write memory, including through any flow this conversation starts.\n\n- **Approve**: only on an explicit request, use `akb task approve <id> --stage <stage> --revision <reviewed revision>`. In a reply this commits after successful synchronization. Finish the reply without further edits or waiting. Never substitute the latest revision for the one reviewed.\n- **Change the plan**: submit a complete replacement with `akb task review <id> --file <json> --revision <n>`. It takes effect immediately. Answers to questions never approve work.\n';
63090
63103
  }
63091
63104
  });
63092
63105
 
@@ -63110,7 +63123,7 @@ var init_describe_project = __esm({
63110
63123
  var discuss_goal_default;
63111
63124
  var init_discuss_goal = __esm({
63112
63125
  "src/guide/discuss-goal.md"() {
63113
- discuss_goal_default = '# Discuss a goal\n\nResearch how the requested outcome can be achieved before defining a Goal. Explain viable approaches and key tradeoffs in the discussion, then save the requested outcome and acceptance criteria.\n\n- **Investigations**: finish checks and diagnosis here; save a change only when findings establish it. Report unverified work plainly.\n- **Goals**: save independent deliverables separately. Update existing goals rather than duplicate them.\n- **Studio**: choose the fitting installed Studio, preferring the user\'s choice; read its Additional Notes with `akb studio rule <studio>` and honor their scope.\n- **Select Previews**: read the chosen Studio\'s `STUDIO.md` with `akb raw file <studio> STUDIO.md` and linked Studio files as needed with `akb raw file <studio> <path>`. Match deliverables that need review to Studio Previews. Define a Goal Preview for a result that needs review and lacks a Studio Preview.\n- **Review** independent Previews in parallel by default. Use Studio or Goal Preview names, e.g. `--review \'Tech choices + UI design\'`. Add `->` when the next group needs the previous group\'s approvals. Verify the saved plan.\n- **Review state**: pass `--review \'\'` for no extra approval, leave the plan undecided while a decision is missing, and omit the option when keeping a saved plan.\n- **Decisions**: ask only about choices the user must make, and recommend an option.\n- **Save**: in a web discussion, use `akb goal` in the current session, including on retry. Say the goal is ready to save when the reply ends. If the command still fails, say it was not saved.\n- **Start**: the user starts each Goal from the page; its effective review arrangement governs output approval. Confirm changes to task-specific Preview definitions before making the affected output.\n- **Communication**: the remote user sees tasks and previews. Use plain words and button labels, omitting internal paths, commands and tools.\n\n## Goal format\n\nUse exactly these three fields on create and update. Include only what the user requested or confirmed.\n\nPass the one-line title separately with `--title`. Use this template for `--body-file`:\n\n```markdown\n<The requested outcome in at most 150 words.>\n\n## Done when\n\n- <A verifiable condition for the requested outcome.>\n```\n\n\n## Custom Preview definitions\n\nPass a JSON array with `--preview-definitions-file`. Use a stable ID, English and Chinese titles, and concise requirements. Omit the file to keep definitions, or pass `[]` to clear them.\n\n```json\n[{\n "id": "accessibility-report",\n "title": {"en": "Accessibility report", "zh": "\u65E0\u969C\u788D\u68C0\u67E5\u62A5\u544A"},\n "instructions": "Check keyboard navigation, visible focus and contrast. Include steps to reproduce issues."\n}]\n```\n\nUse the title in a Flow such as `--review \'UI design -> Accessibility report\'` when preparation requires an earlier approval.\n';
63126
+ discuss_goal_default = '# Discuss a goal\n\nResearch how the requested outcome can be achieved before defining a Goal. Explain viable approaches and key tradeoffs in the discussion, then save the requested outcome and acceptance criteria.\n\n- **Investigations**: finish checks and diagnosis here; save a change only when findings establish it. Report unverified work plainly.\n- **Goals**: save independent deliverables separately. Update existing goals rather than duplicate them.\n- **Studio**: choose the fitting installed Studio, preferring the user\'s choice; read its Additional Notes with `akb studio rule <studio>` and honor their scope.\n- **Select Previews**: read the chosen Studio\'s `STUDIO.md` with `akb studio file <studio> STUDIO.md` and linked Studio files as needed with `akb studio file <studio> <path>`. Match deliverables that need review to Studio Previews. Define a Goal Preview for a result that needs review and lacks a Studio Preview.\n- **Review** independent Previews in parallel by default. Use Studio or Goal Preview names, e.g. `--review \'Tech choices + UI design\'`. Add `->` when the next group needs the previous group\'s approvals. Verify the saved plan.\n- **Review state**: pass `--review \'\'` for no extra approval, leave the plan undecided while a decision is missing, and omit the option when keeping a saved plan.\n- **Decisions**: ask only about choices the user must make, and recommend an option.\n- **Save**: in a web discussion, use `akb goal` in the current session, including on retry. Say the goal is ready to save when the reply ends. If the command still fails, say it was not saved.\n- **Start**: the user starts each Goal from the page; its effective review arrangement governs output approval. Confirm changes to task-specific Preview definitions before making the affected output.\n- **Communication**: the remote user sees tasks and previews. Use plain words and button labels, omitting internal paths, commands and tools.\n\n## Goal format\n\nUse exactly these three fields on create and update. Include only what the user requested or confirmed.\n\nPass the one-line title separately with `--title`. Use this template for `--body-file`:\n\n```markdown\n<The requested outcome in at most 150 words.>\n\n## Done when\n\n- <A verifiable condition for the requested outcome.>\n```\n\n\n## Custom Preview definitions\n\nPass a JSON array with `--preview-definitions-file`. Use a stable ID, English and Chinese titles, and concise requirements. Omit the file to keep definitions, or pass `[]` to clear them.\n\n```json\n[{\n "id": "accessibility-report",\n "title": {"en": "Accessibility report", "zh": "\u65E0\u969C\u788D\u68C0\u67E5\u62A5\u544A"},\n "instructions": "Check keyboard navigation, visible focus and contrast. Include steps to reproduce issues."\n}]\n```\n\nUse the title in a Flow such as `--review \'UI design -> Accessibility report\'` when preparation requires an earlier approval.\n';
63114
63127
  }
63115
63128
  });
63116
63129
 
@@ -63118,7 +63131,7 @@ var init_discuss_goal = __esm({
63118
63131
  var follow_up_default;
63119
63132
  var init_follow_up = __esm({
63120
63133
  "src/guide/follow-up.md"() {
63121
- follow_up_default = '# Handle follow-up work\n\nUse when planning or implementation discovers additional work.\n\n- **Current task**: finish required work on this card; queue independent follow-ups in triage, then resume the original task.\n- **Drop what was turned down**: queue nothing that\n `docs/kanban/memory/agents/planner/rejected.md` or\n `docs/kanban/memory/agents/planner/*/rejected.md` turns down.\n- **Existing card**: when only another open card needs changing, run `akb raw card revise <id> "<the change and why>"`.\n- **Queue it**: use the command below; skip an item the command reports as already there.\n- **Studio**: use the source card\'s `studio:`, or the id from `akb studio list` that fits the work when it has none.\n\n```text\nakb raw triage add --title "<one line>" --slug <short-english-slug> --source "#<id>" --studio <studio> --text "<body>"\n```\n\n## Write the item\n\nWrite each item\'s title and body in the **Goal format** of `akb guide discuss-goal`.\n';
63134
+ follow_up_default = '# Handle follow-up work\n\nUse when planning or implementation discovers additional work.\n\n- **Current task**: finish required work on this card; queue independent follow-ups in triage, then resume the original task.\n- **Drop what was turned down**: queue nothing that\n `docs/kanban/memory/agents/planner/rejected.md` or\n `docs/kanban/memory/agents/planner/*/rejected.md` turns down.\n- **Existing card**: when only another open card needs changing, run `akb task revise <id> "<the change and why>"`.\n- **Queue it**: use the command below; skip an item the command reports as already there.\n- **Studio**: use the source card\'s `studio:`, or the id from `akb studio list` that fits the work when it has none.\n\n```text\nakb triage add --title "<one line>" --slug <short-english-slug> --source "#<id>" --studio <studio> --text "<body>"\n```\n\n## Write the item\n\nWrite each item\'s title and body in the **Goal format** of `akb guide discuss-goal`.\n';
63122
63135
  }
63123
63136
  });
63124
63137
 
@@ -63134,7 +63147,7 @@ var init_implement = __esm({
63134
63147
  var module_map_default;
63135
63148
  var init_module_map = __esm({
63136
63149
  "src/guide/module-map.md"() {
63137
- module_map_default = "# The module map\n\nWrite and repair `docs/kanban/modules.md` \u2014 a plain list of the project's modules.\n\nA module is a part of the project developed independently of other parts. Modules may\nshare folders. Keep a single-purpose project as one module; before code exists, define\nseparate modules only for parts the plan explicitly treats as independent.\n\n## Examples\n\nA repo with `server/`, `packages/core/`, `web/`, `cli/`, and `docs/` might map to:\n\n```\n- **api** \u2014 the backend server and its shared core. `server/`, `packages/core/`.\n- **web-app** \u2014 the browser app users sign into. `web/`.\n- **cli** \u2014 the command-line client. `cli/`.\n- **docs** \u2014 the public documentation site. `docs/`.\n```\n\nThe server and core change together, so they share one module.\n\n## Repair\n\n- **Update the map**: Correct outdated entries. Split a module when the code or plans show\n that it now contains independently developed parts, even if its description still covers\n them. If the user reports an incorrect map, rebuild it from the current code and plans.\n- **Update cards and memory**: After changing modules, update affected open cards with\n `akb raw update <id> --modules <names>`. Follow the section below when splitting memory.\n\n## Split module memory\n\nA module's planning memory is its folder, `docs/kanban/memory/agents/planner/<module>/`. Create\nthe new module's folder and move into each of its files the entries that belong to it. Split\nentries that cover both; keep shared rules with the module responsible for them. Rename the\nfolder when a module is renamed, and fold its files into the folder that inherits the work when\none is removed. A module may not be named `decisions`, `rejected` or `redesign`.\n";
63150
+ module_map_default = "# The module map\n\nWrite and repair `docs/kanban/modules.md` \u2014 a plain list of the project's modules.\n\nA module is a part of the project developed independently of other parts. Modules may\nshare folders. Keep a single-purpose project as one module; before code exists, define\nseparate modules only for parts the plan explicitly treats as independent.\n\n## Examples\n\nA repo with `server/`, `packages/core/`, `web/`, `cli/`, and `docs/` might map to:\n\n```\n- **api** \u2014 the backend server and its shared core. `server/`, `packages/core/`.\n- **web-app** \u2014 the browser app users sign into. `web/`.\n- **cli** \u2014 the command-line client. `cli/`.\n- **docs** \u2014 the public documentation site. `docs/`.\n```\n\nThe server and core change together, so they share one module.\n\n## Repair\n\n- **Update the map**: Correct outdated entries. Split a module when the code or plans show\n that it now contains independently developed parts, even if its description still covers\n them. If the user reports an incorrect map, rebuild it from the current code and plans.\n- **Update cards and memory**: After changing modules, update affected open cards with\n `akb task update <id> --modules <names>`. Follow the section below when splitting memory.\n\n## Split module memory\n\nA module's planning memory is its folder, `docs/kanban/memory/agents/planner/<module>/`. Create\nthe new module's folder and move into each of its files the entries that belong to it. Split\nentries that cover both; keep shared rules with the module responsible for them. Rename the\nfolder when a module is renamed, and fold its files into the folder that inherits the work when\none is removed. A module may not be named `decisions`, `rejected` or `redesign`.\n";
63138
63151
  }
63139
63152
  });
63140
63153
 
@@ -63150,7 +63163,7 @@ var init_prune_memory = __esm({
63150
63163
  var review_memory_default;
63151
63164
  var init_review_memory = __esm({
63152
63165
  "src/guide/review-memory.md"() {
63153
- review_memory_default = "# Review what the conversations settled\n\nRead each conversation given to you right through, then write what it settled into memory.\n\nChats and planning flows write no memory themselves. One turn cannot see where an exchange\nis going, so a \"what if\" thrown out and taken back three turns later used to land as a\ndecision. You read the whole exchange, so you can tell a decision from a passing thought \u2014\nand that judgement is the whole job.\n\n- **Read what you are given**: each card comes in its own `<conversation>` block: its summary,\n its `Worth noting` and `Overruled by the user` lines, then its chat and the comments the user\n left reviewing it, when it had any, the user's words as written and the agent's replies,\n oldest first. The card is archived, so it is complete and reviewed this once; open no card or\n transcript file.\n- **Keep them apart**: judge each block by itself; what one conversation settled never\n becomes a note for another's card or Studio.\n- **Keep a high bar**: a conversation that settled nothing earns no note, and most do not;\n writing nothing is a complete result.\n- **Only what the user settled**: a durable preference, constraint, decision or correction\n they stated. Your own proposal is not their decision, and neither is a question, a \"what\n if\", or a direction the conversation then moved off.\n- **Take the last word**: where they said one thing and then another, the later one stands.\n Where a note already in the file says what they have since overturned, rewrite that note in\n place \u2014 never leave both and never add a second.\n- **Honour \"don't record this\"**: told in the conversation not to record something, write no\n note for it. If one is already there from an earlier review, delete it now.\n- **Where it goes**: a durable choice goes in the planner's `decisions.md` as one\n `**<key>**: <call>` line under the topic that fits, without its rationale; a design lesson\n goes in its `redesign.md` under the relevant topic as\n `- \u274C **<mistake>** \u2192 \u2705 <what the design should be instead, one line>.`, written as guidance\n for future tasks, not a history of the fix. Both go in the folder of the module each\n conversation is listed with. Each conversation names its `studio` and\n involved `previews`. Read `akb raw file <studio> STUDIO.md`; when it has a memory policy,\n follow it for settled feedback on the affected Previews, preserving its scopes. Without a\n Preview memory policy, create no Preview memory; retain planner/module memory duties.\n Distill settled feedback into reusable preferences (dos) and corrections (don'ts), retaining\n their scope; never copy raw reviews.\n- **What the card settled**: the summary says what the card was about and earns no note. A\n `Worth noting` line is a decision the user approved, by answering it or letting it stand, so\n it can be a choice but never a correction, and it earns a planner note only where the user's\n own words in the conversation back it; a line under\n `Overruled by the user` is a call the user reversed, so it goes in `redesign.md`: the relevant\n Preview's when its Studio policy provides for it, otherwise the planner's.\n- **Change nothing else**: no card, no open question, no code. The memory\n files are the whole of what this run writes.\n- **Say what you wrote**: finish by reporting each conversation you read, and for each the\n notes you added, rewrote, deleted, or that you wrote none.\n";
63166
+ review_memory_default = "# Review what the conversations settled\n\nRead each conversation given to you right through, then write what it settled into memory.\n\nChats and planning flows write no memory themselves. One turn cannot see where an exchange\nis going, so a \"what if\" thrown out and taken back three turns later used to land as a\ndecision. You read the whole exchange, so you can tell a decision from a passing thought \u2014\nand that judgement is the whole job.\n\n- **Read what you are given**: each card comes in its own `<conversation>` block: its summary,\n its `Worth noting` and `Overruled by the user` lines, then its chat and the comments the user\n left reviewing it, when it had any, the user's words as written and the agent's replies,\n oldest first. The card is archived, so it is complete and reviewed this once; open no card or\n transcript file.\n- **Keep them apart**: judge each block by itself; what one conversation settled never\n becomes a note for another's card or Studio.\n- **Keep a high bar**: a conversation that settled nothing earns no note, and most do not;\n writing nothing is a complete result.\n- **Only what the user settled**: a durable preference, constraint, decision or correction\n they stated. Your own proposal is not their decision, and neither is a question, a \"what\n if\", or a direction the conversation then moved off.\n- **Take the last word**: where they said one thing and then another, the later one stands.\n Where a note already in the file says what they have since overturned, rewrite that note in\n place \u2014 never leave both and never add a second.\n- **Honour \"don't record this\"**: told in the conversation not to record something, write no\n note for it. If one is already there from an earlier review, delete it now.\n- **Where it goes**: a durable choice goes in the planner's `decisions.md` as one\n `**<key>**: <call>` line under the topic that fits, without its rationale; a design lesson\n goes in its `redesign.md` under the relevant topic as\n `- \u274C **<mistake>** \u2192 \u2705 <what the design should be instead, one line>.`, written as guidance\n for future tasks, not a history of the fix. Both go in the folder of the module each\n conversation is listed with. Each conversation names its `studio` and\n involved `previews`. Read `akb studio file <studio> STUDIO.md`; when it has a memory policy,\n follow it for settled feedback on the affected Previews, preserving its scopes. Without a\n Preview memory policy, create no Preview memory; retain planner/module memory duties.\n Distill settled feedback into reusable preferences (dos) and corrections (don'ts), retaining\n their scope; never copy raw reviews.\n- **What the card settled**: the summary says what the card was about and earns no note. A\n `Worth noting` line is a decision the user approved, by answering it or letting it stand, so\n it can be a choice but never a correction, and it earns a planner note only where the user's\n own words in the conversation back it; a line under\n `Overruled by the user` is a call the user reversed, so it goes in `redesign.md`: the relevant\n Preview's when its Studio policy provides for it, otherwise the planner's.\n- **Change nothing else**: no card, no open question, no code. The memory\n files are the whole of what this run writes.\n- **Say what you wrote**: finish by reporting each conversation you read, and for each the\n notes you added, rewrote, deleted, or that you wrote none.\n";
63154
63167
  }
63155
63168
  });
63156
63169
 
@@ -63166,7 +63179,7 @@ var init_review_rejections = __esm({
63166
63179
  var refine_default;
63167
63180
  var init_refine = __esm({
63168
63181
  "src/guide/refine.md"() {
63169
- refine_default = "# Refine a card\n\nPlan one card until it is buildable.\n\n- **Unchecked cards**: check cards with `triage:` and empty `## Scope` against the project, rejecting obsolete or completed work with `akb task remove <id> \"<evidence>\"` and stopping.\n- **Other obsolete or completed cards**: ask whether to discard, run no previews, and stop.\n- **Groups**: preserve subtask coverage and progress, fill gaps without duplication, and do not mark the parent ready merely because its split is complete.\n- **Verification**: plan representative checks for the outcome, project rules and material risks, confirm prerequisites, and keep optional coverage optional.\n- **Review**: read `akb task review <id>`. If undecided, submit `--review <flow>` with Preview names or `--file <json>` with Preview IDs, plus `--revision <n>`. Use `--review ''` when no extra review is needed. Work only on dispatched, unlocked nodes and continue independent work during review.\n- **Preview selection**: choose Studio Previews for drafts or results that need review. For a requested result the Studio lacks, attach its definition with `--preview-definitions-file`. Keep task context in the card body.\n- **Previews**: prepare only the unlocked nodes\u2019 outputs per the Studio\u2019s `<Preview>` blocks. Before revising an approved output, use `--revise-from <stage> --revision <n>`; preserve unrelated outputs and approvals.\n- **Submit**: synchronize body and assets, then report `--stage <id> --status done --revision <n>`. Re-read after conflicts; obtain output approval at the required stages.\n- **Delivery**: the Studio's delivery flow handles separate implementation and its checks.\n- **References**: rewrite mentions of cards no longer on the board.\n- **Decisions**: settle choices supported by evidence and ask only as `akb guide update-questions` allows.\n- **Card**: follow studio rules and `akb guide writing`, fixing all errors from `akb raw validate <id>`.\n- **Ready**: when validated and buildable with prerequisites settled, run `akb raw update <id> --status ready`; otherwise leave blockers as open questions.\n\nFollow the printed closing steps. Wait only for required approvals; completion still requires Studio delivery checks.\n";
63182
+ refine_default = "# Refine a card\n\nPlan one card until it is buildable.\n\n- **Unchecked cards**: check cards with `triage:` and empty `## Scope` against the project, rejecting obsolete or completed work with `akb task remove <id> \"<evidence>\"` and stopping.\n- **Other obsolete or completed cards**: ask whether to discard, run no previews, and stop.\n- **Groups**: preserve subtask coverage and progress, fill gaps without duplication, and do not mark the parent ready merely because its split is complete.\n- **Verification**: plan representative checks for the outcome, project rules and material risks, confirm prerequisites, and keep optional coverage optional.\n- **Review**: read `akb task review <id>`. If undecided, submit `--review <flow>` with Preview names or `--file <json>` with Preview IDs, plus `--revision <n>`. Use `--review ''` when no extra review is needed. Work only on dispatched, unlocked nodes and continue independent work during review.\n- **Preview selection**: choose Studio Previews for drafts or results that need review. For a requested result the Studio lacks, attach its definition with `--preview-definitions-file`. Keep task context in the card body.\n- **Previews**: prepare only the unlocked nodes\u2019 outputs per the Studio\u2019s `<Preview>` blocks. Before revising an approved output, use `--revise-from <stage> --revision <n>`; preserve unrelated outputs and approvals.\n- **Submit**: synchronize body and assets, then report `--stage <id> --status done --revision <n>`. Re-read after conflicts; obtain output approval at the required stages.\n- **Delivery**: the Studio's delivery flow handles separate implementation and its checks.\n- **References**: rewrite mentions of cards no longer on the board.\n- **Decisions**: settle choices supported by evidence and ask only as `akb guide update-questions` allows.\n- **Card**: follow studio rules and `akb guide writing`, fixing all errors from `akb task validate <id>`.\n- **Ready**: when validated and buildable with prerequisites settled, run `akb task update <id> --status ready`; otherwise leave blockers as open questions.\n\nFollow the printed closing steps. Wait only for required approvals; completion still requires Studio delivery checks.\n";
63170
63183
  }
63171
63184
  });
63172
63185
 
@@ -63174,7 +63187,7 @@ var init_refine = __esm({
63174
63187
  var reflect_default;
63175
63188
  var init_reflect = __esm({
63176
63189
  "src/guide/reflect.md"() {
63177
- reflect_default = '# Reflect on completed cards\n\n## Read\n\nRead each given `<card>` in full and check its own `shipped` content; keep cards separate.\nFind needs the work left behind or revealed, and verify them in the project. Proposing nothing is fine.\n\n## Filter\n\n- **Duplicates**: check `akb raw list` and `akb raw triage check <source-id>`; propose shared work only once.\n- **Exclude**: skip unsupported guesses, work rejected in `docs/kanban/memory/agents/planner/rejected.md` or its module folders, and calls the user reversed, in any `redesign.md` under `docs/kanban/memory/agents/` or under a card\'s `Overruled by the user`.\n- **Existing cards**: when shipped work invalidates an open card\'s plan, run `akb raw card revise <id> "<the change and why>"` instead of proposing an item.\n\n## Write\n\nWrite each item\'s title and body in the **Goal format** of `akb guide discuss-goal`; write the body to a temporary Markdown file and end it with the source card\'s archive path.\nWrite one triage item per proposal. Exploratory ideas are welcome; identify small chores as such.\nUse the source card\'s `studio:`, or the id from `akb studio list` that fits the work when it has none.\n\n```text\nakb raw triage add --title "<one line>" --slug <short-english-slug> --source "#<id>" --studio <studio> --file <body.md>\n```\n\nBriefly report what you proposed and what you skipped, with reasons.\n';
63190
+ reflect_default = '# Reflect on completed cards\n\n## Read\n\nRead each given `<card>` in full and check its own `shipped` content; keep cards separate.\nFind needs the work left behind or revealed, and verify them in the project. Proposing nothing is fine.\n\n## Filter\n\n- **Duplicates**: check `akb board list` and `akb triage check <source-id>`; propose shared work only once.\n- **Exclude**: skip unsupported guesses, work rejected in `docs/kanban/memory/agents/planner/rejected.md` or its module folders, and calls the user reversed, in any `redesign.md` under `docs/kanban/memory/agents/` or under a card\'s `Overruled by the user`.\n- **Existing cards**: when shipped work invalidates an open card\'s plan, run `akb task revise <id> "<the change and why>"` instead of proposing an item.\n\n## Write\n\nWrite each item\'s title and body in the **Goal format** of `akb guide discuss-goal`; write the body to a temporary Markdown file and end it with the source card\'s archive path.\nWrite one triage item per proposal. Exploratory ideas are welcome; identify small chores as such.\nUse the source card\'s `studio:`, or the id from `akb studio list` that fits the work when it has none.\n\n```text\nakb triage add --title "<one line>" --slug <short-english-slug> --source "#<id>" --studio <studio> --file <body.md>\n```\n\nBriefly report what you proposed and what you skipped, with reasons.\n';
63178
63191
  }
63179
63192
  });
63180
63193
 
@@ -63182,7 +63195,7 @@ var init_reflect = __esm({
63182
63195
  var resolve_default;
63183
63196
  var init_resolve2 = __esm({
63184
63197
  "src/guide/resolve.md"() {
63185
- resolve_default = '# Resolve questions\n\nApply the answers the user supplied to existing open questions. Leave every unanswered\nquestion unchanged. While applying answers, do not research, choose for the user, raise\nanother question, or change project code.\n\n## Apply each answer\n\n1. Match each supplied answer to its open question. If the answer is missing or unclear,\n leave that question open.\n2. Follow `akb guide writing`. Merge the answer into the existing decision, keep only the\n selected choice, remove obsolete or contradictory text, preserve completed work, and add\n newly required work as unchecked todos. When the answer changes an agent\'s section, read\n that agent\'s rules first, as "Preview ownership" there says.\n\nWhen an answer accepts a step the user was asked to review and asks for no changes, tick that\nstep\'s review todo; an answer asking for changes leaves it unticked.\n\nWhen an answer chooses to discard the card, first run `akb raw delivery cancel <delivery>` if a\ndelivery is in flight, then `akb task remove <id> "<why>" --discard`, and stop. Skip every\nremaining step of this guide.\n\nWhen an answer sends an agent\'s (`agent:`) section back for rework that the user must confirm\nagain, keep or `--update` the question instead of dropping it. Once no question is left for\nthat agent, request each matching agent listed below it whose section is missing or says it\nis waiting.\n\nWhen an answer selects one of several options in a Preview block, remove the rejected\noptions and their spec-tmp files.\n\n## Say what the answers did to a build in flight\n\nA delivery builds the card as it was approved when it started, and applying answers is the\nonly thing that rewrites that card underneath it. You read the question and you wrote the\nanswer, so you are the only one who can tell a confirmation from a change \u2014 the board reads\nyour conclusion and never the card\'s text.\n\n```text\nakb raw delivery answered <delivery> --unchanged "<why>"\nakb raw delivery answered <delivery> --changed "<why>"\n```\n\n- **Record it before you drop the questions**: dropping the last one is what puts the board\n back in motion, and until the conclusion is written the build does not land.\n- **Judge the meaning, not the words**: confirming an option that is already built, writing\n down a decision the card already carries, and tidying prose are all `--unchanged`.\n Adding, dropping or changing a requirement is `--changed`.\n- **A wrong implementation confirmed is still a change**: an answer that blesses work\n contradicting the approved copy is `--changed`, however finished that work is.\n- **One conclusion per round**: it covers every answer you applied in this session. The\n delivery a `--changed` reopens starts on the card as it then reads, with none of its own.\n\n`akb raw card implement <id> --print` prints the delivery\'s id and the copy it is building.\nNothing to record when no delivery is in flight.\n\n## Curate the human half\n\nPut each answer `akb guide writing` places in `Worth noting` in that section; put other\nnecessary lasting decisions below the boundary.\n\nRe-read the whole human half against the same rule. Remove or move down entries that\nfail it, repeat scope, or overlap another entry. Merge entries governed by one decision. One to\nthree independent items is normal; every additional item needs distinct user-facing stakes.\n\n## Close the answered questions\n\nSave the body and any delivery conclusion first. Drop only the questions whose answers\nare fully applied. Runner synchronizes the updated body and question list together.\n\n```text\nakb task update-questions <task> --drop <n[,n...]>\n```\n\n## Refine\n\nIf any question remains open, stop and leave the card waiting. When a delivery is in flight,\nnever refine \u2014 even if `--changed` updated requirements, execution resumes directly from the\nupdated card.\n\nOnce no question is left and no delivery is building the card, refine it in this session by\n`akb guide refine`, which decides readiness:\n\n- **Partial**: when the card was refined before, revisit only what the answers changed.\n- **Full**: when the answers reshape the card or its `## Scope` is still the creation scaffold.\n';
63198
+ resolve_default = '# Resolve questions\n\nApply the answers the user supplied to existing open questions. Leave every unanswered\nquestion unchanged. While applying answers, do not research, choose for the user, raise\nanother question, or change project code.\n\n## Apply each answer\n\n1. Match each supplied answer to its open question. If the answer is missing or unclear,\n leave that question open.\n2. Follow `akb guide writing`. Merge the answer into the existing decision, keep only the\n selected choice, remove obsolete or contradictory text, preserve completed work, and add\n newly required work as unchecked todos. When the answer changes an agent\'s section, read\n that agent\'s rules first, as "Preview ownership" there says.\n\nWhen an answer accepts a step the user was asked to review and asks for no changes, tick that\nstep\'s review todo; an answer asking for changes leaves it unticked.\n\nWhen an answer chooses to discard the card, first run `akb delivery cancel <delivery>` if a\ndelivery is in flight, then `akb task remove <id> "<why>" --discard`, and stop. Skip every\nremaining step of this guide.\n\nWhen an answer sends an agent\'s (`agent:`) section back for rework that the user must confirm\nagain, keep or `--update` the question instead of dropping it. Once no question is left for\nthat agent, request each matching agent listed below it whose section is missing or says it\nis waiting.\n\nWhen an answer selects one of several options in a Preview block, remove the rejected\noptions and their spec-tmp files.\n\n## Say what the answers did to a build in flight\n\nA delivery builds the card as it was approved when it started, and applying answers is the\nonly thing that rewrites that card underneath it. You read the question and you wrote the\nanswer, so you are the only one who can tell a confirmation from a change \u2014 the board reads\nyour conclusion and never the card\'s text.\n\n```text\nakb delivery answered <delivery> --unchanged "<why>"\nakb delivery answered <delivery> --changed "<why>"\n```\n\n- **Record it before you drop the questions**: dropping the last one is what puts the board\n back in motion, and until the conclusion is written the build does not land.\n- **Judge the meaning, not the words**: confirming an option that is already built, writing\n down a decision the card already carries, and tidying prose are all `--unchanged`.\n Adding, dropping or changing a requirement is `--changed`.\n- **A wrong implementation confirmed is still a change**: an answer that blesses work\n contradicting the approved copy is `--changed`, however finished that work is.\n- **One conclusion per round**: it covers every answer you applied in this session. The\n delivery a `--changed` reopens starts on the card as it then reads, with none of its own.\n\n`akb task implement <id> --print` prints the delivery\'s id and the copy it is building.\nNothing to record when no delivery is in flight.\n\n## Curate the human half\n\nPut each answer `akb guide writing` places in `Worth noting` in that section; put other\nnecessary lasting decisions below the boundary.\n\nRe-read the whole human half against the same rule. Remove or move down entries that\nfail it, repeat scope, or overlap another entry. Merge entries governed by one decision. One to\nthree independent items is normal; every additional item needs distinct user-facing stakes.\n\n## Close the answered questions\n\nSave the body and any delivery conclusion first. Drop only the questions whose answers\nare fully applied. Runner synchronizes the updated body and question list together.\n\n```text\nakb task update-questions <task> --drop <n[,n...]>\n```\n\n## Refine\n\nIf any question remains open, stop and leave the card waiting. When a delivery is in flight,\nnever refine \u2014 even if `--changed` updated requirements, execution resumes directly from the\nupdated card.\n\nOnce no question is left and no delivery is building the card, refine it in this session by\n`akb guide refine`, which decides readiness:\n\n- **Partial**: when the card was refined before, revisit only what the answers changed.\n- **Full**: when the answers reshape the card or its `## Scope` is still the creation scaffold.\n';
63186
63199
  }
63187
63200
  });
63188
63201
 
@@ -63190,7 +63203,7 @@ var init_resolve2 = __esm({
63190
63203
  var resolve_conflict_default;
63191
63204
  var init_resolve_conflict = __esm({
63192
63205
  "src/guide/resolve-conflict.md"() {
63193
- resolve_conflict_default = "# Resolve board content conflicts\n\n- **Read**: use `akb raw conflict list`, then `akb raw conflict show <id>` to read the saved three-way versions, current local work and affected batch; follow the files' ownership rules.\n- **Decide**: reconcile the intended meaning using the task and relevant decisions; use `akb guide update-questions` only for a material choice the evidence cannot settle.\n- **Submit**: write a temporary JSON resolution with one `path` and final `content` for each conflicting file, using `null` for deletion, then run `akb raw conflict resolve <id> --expect <revision> --file <path>` with the revision just read.\n- **Changed facts**: if the command reports changed versions, read the conflict again and reconsider the result; do not refresh away local work or blindly repeat the old resolution.\n- **Continue**: after confirmed synchronization, continue the original work.\n- **Blocked**: when you cannot resolve a conflict or confirm its submission, preserve the content, draft, ID, reason and next check; report the obstacle without claiming success, and honor a user stop.\n";
63206
+ resolve_conflict_default = "# Resolve board content conflicts\n\n- **Read**: use `akb board conflict list`, then `akb board conflict show <id>` to read the saved three-way versions, current local work and affected batch; follow the files' ownership rules.\n- **Decide**: reconcile the intended meaning using the task and relevant decisions; use `akb guide update-questions` only for a material choice the evidence cannot settle.\n- **Submit**: write a temporary JSON resolution with one `path` and final `content` for each conflicting file, using `null` for deletion, then run `akb board conflict resolve <id> --expect <revision> --file <path>` with the revision just read.\n- **Changed facts**: if the command reports changed versions, read the conflict again and reconsider the result; do not refresh away local work or blindly repeat the old resolution.\n- **Continue**: after confirmed synchronization, continue the original work.\n- **Blocked**: when you cannot resolve a conflict or confirm its submission, preserve the content, draft, ID, reason and next check; report the obstacle without claiming success, and honor a user stop.\n";
63194
63207
  }
63195
63208
  });
63196
63209
 
@@ -63222,7 +63235,7 @@ var init_troubleshoot = __esm({
63222
63235
  var write_agent_default;
63223
63236
  var init_write_agent = __esm({
63224
63237
  "src/guide/write-agent.md"() {
63225
- write_agent_default = "# Studio instructions\n\nDefine Studio work in `STUDIO.md`, with optional Preview blocks and matching display metadata.\nRead `akb guide update-studio` to create or revise a Studio. Studio outputs have no `AGENT.md`\nor separate role configuration. Validate the complete folder with `akb raw studio validate`.\n";
63238
+ write_agent_default = "# Studio instructions\n\nDefine Studio work in `STUDIO.md`, with optional Preview blocks and matching display metadata.\nRead `akb guide update-studio` to create or revise a Studio. Studio outputs have no `AGENT.md`\nor separate role configuration. Validate the complete folder with `akb studio validate <folder>`.\n";
63226
63239
  }
63227
63240
  });
63228
63241
 
@@ -63238,7 +63251,7 @@ var init_write_prompt = __esm({
63238
63251
  var writing_default;
63239
63252
  var init_writing = __esm({
63240
63253
  "src/guide/writing.md"() {
63241
- writing_default = '# Write a card\n\nA card has a **human half** for review and a folded **agent half** for implementation.\nUse this order and keep the English section titles and empty scaffold sections:\n\n```text\n<One short paragraph: the problem and the intended result.>\n\n## Worth noting <- user\'s answers first, then material decisions; empty if none\n- **<decision>**: <chosen behavior and main cost in one sentence>\n\n## Worth noting after implementation\n- **<decision>**: <chosen behavior and main cost in one sentence>\n <- settled by the build; omit when empty; no logs or open questions\n\n<Preview id="<id>"> <- requested deliverable\n<result Markdown and assets>\n</Preview>\n\n<!-- agent --> <- folded content starts here\n\n## Scope <- requirements, not rationale\n### Done when <- acceptance checklist, when supplied\n- [ ] <observable result>\n\n## Todo <- implementation only; finish planning before writing steps\n- [ ] <one build step>\n\n## Decided by the agent <- other decisions and non-obvious findings the build needs\n- **<decision>**: <answer and required action>\n### Overruled by the user <- superseded decisions, always last\n```\n\n- **Decisions**: use the material-decision test in `akb guide update-questions` for Worth noting;\n merge entries governed by one policy and keep only the decision and its main cost.\n- **Delivery boundary**: Worth noting after implementation never changes approved scope or\n blocks an ongoing delivery; the build must fix deviations or refer them to the user.\n- **Preview sections**: use matching Preview tags and a stable Studio ID; keep the ID when revising.\n The app supplies localized titles and icons. Group files of one deliverable with Set.\n- **Previews**: read the relevant Studio `<Preview>` block and needed references before revising\n its section and assets in place.\n- **Preview presentation**: at every review point, show the deliverable directly; omit surrounding\n introductions, summaries and notes unless requested or needed for review, keeping necessary\n context brief and stating it once.\n- **Preserve work**: leave checked todos and supplied Done when checklists unchanged; append a\n todo to reverse completed work, and move user-overruled decisions to Overruled by the user\n until the card leaves no room to repeat them.\n- **Writing**: write clear behavior and necessary tradeoffs for a fresh reader, keep the human\n half self-contained, and state each fact once.\n- **Agent half**: keep only implementation-critical information not stated elsewhere; omit\n process logs and routine implementation planning, and leave unneeded sections empty.\n- **Frontmatter**: never edit frontmatter by hand; use `akb raw update` or `akb task update-questions`.\n- **Validate**: run `akb raw validate <id>` after edits and fix every reported file and line.\n';
63254
+ writing_default = '# Write a card\n\nA card has a **human half** for review and a folded **agent half** for implementation.\nUse this order and keep the English section titles and empty scaffold sections:\n\n```text\n<One short paragraph: the problem and the intended result.>\n\n## Worth noting <- user\'s answers first, then material decisions; empty if none\n- **<decision>**: <chosen behavior and main cost in one sentence>\n\n## Worth noting after implementation\n- **<decision>**: <chosen behavior and main cost in one sentence>\n <- settled by the build; omit when empty; no logs or open questions\n\n<Preview id="<id>"> <- requested deliverable\n<result Markdown and assets>\n</Preview>\n\n<!-- agent --> <- folded content starts here\n\n## Scope <- requirements, not rationale\n### Done when <- acceptance checklist, when supplied\n- [ ] <observable result>\n\n## Todo <- implementation only; finish planning before writing steps\n- [ ] <one build step>\n\n## Decided by the agent <- other decisions and non-obvious findings the build needs\n- **<decision>**: <answer and required action>\n### Overruled by the user <- superseded decisions, always last\n```\n\n- **Decisions**: use the material-decision test in `akb guide update-questions` for Worth noting;\n merge entries governed by one policy and keep only the decision and its main cost.\n- **Delivery boundary**: Worth noting after implementation never changes approved scope or\n blocks an ongoing delivery; the build must fix deviations or refer them to the user.\n- **Preview sections**: use matching Preview tags and a stable Studio ID; keep the ID when revising.\n The app supplies localized titles and icons. Group files of one deliverable with Set.\n- **Previews**: read the relevant Studio `<Preview>` block and needed references before revising\n its section and assets in place.\n- **Preview presentation**: at every review point, show the deliverable directly; omit surrounding\n introductions, summaries and notes unless requested or needed for review, keeping necessary\n context brief and stating it once.\n- **Preserve work**: leave checked todos and supplied Done when checklists unchanged; append a\n todo to reverse completed work, and move user-overruled decisions to Overruled by the user\n until the card leaves no room to repeat them.\n- **Writing**: write clear behavior and necessary tradeoffs for a fresh reader, keep the human\n half self-contained, and state each fact once.\n- **Agent half**: keep only implementation-critical information not stated elsewhere; omit\n process logs and routine implementation planning, and leave unneeded sections empty.\n- **Frontmatter**: never edit frontmatter by hand; use `akb task update` or `akb task update-questions`.\n- **Validate**: run `akb task validate <id>` after edits and fix every reported file and line.\n';
63242
63255
  }
63243
63256
  });
63244
63257
 
@@ -63367,7 +63380,7 @@ function cmdStudioList() {
63367
63380
  return result;
63368
63381
  }
63369
63382
  function cmdStudioDiagram(_id, _card, _folder) {
63370
- die("Studios have no agent graph. Read STUDIO.md for instructions and Preview outputs.", "bad-args");
63383
+ die("Freeze a Studio draft with akb studio preview <card> --folder <draft> --base <baseline>.", "bad-args");
63371
63384
  }
63372
63385
  function cmdStudioValidate(folder2) {
63373
63386
  const dir = path76.resolve(folder2);
@@ -64070,7 +64083,7 @@ function readCard2(id2, home3 = "board") {
64070
64083
  const found2 = home3 === "archive" ? locateArchived(id2) : locate(id2) ?? (pending ? locateArchived(id2) : null);
64071
64084
  if (!found2) {
64072
64085
  die(
64073
- home3 === "archive" ? `no card #${id2} in ${rel(ARCHIVE)}. A reflection reads the card the archive holds.` : `no card #${id2} on this board. \`akb raw list\` says what is open.`,
64086
+ home3 === "archive" ? `no card #${id2} in ${rel(ARCHIVE)}. A reflection reads the card the archive holds.` : `no card #${id2} on this board. \`akb board list\` says what is open.`,
64074
64087
  { kind: "card-not-found", id: id2 }
64075
64088
  );
64076
64089
  }
@@ -64083,7 +64096,7 @@ function readCard2(id2, home3 = "board") {
64083
64096
  }
64084
64097
  const { meta: meta3, body } = parseFrontmatter(text5);
64085
64098
  if (!meta3) {
64086
- die(`${rel(file2)} has no frontmatter \u2014 recreate it with \`akb raw create\` before working on it.`, {
64099
+ die(`${rel(file2)} has no frontmatter \u2014 restore this card from its last valid version before retrying.`, {
64087
64100
  kind: "card-unreadable",
64088
64101
  id: id2
64089
64102
  });
@@ -64159,7 +64172,7 @@ function approvedField(delivery) {
64159
64172
  }
64160
64173
  function workspaceField(delivery) {
64161
64174
  return field("workspace", [
64162
- `authorized project: ${REPO_ROOT}; board: ${boardCommandFor()}.`,
64175
+ `authorized project: ${REPO_ROOT}; board: ${boardCommand()}.`,
64163
64176
  ...delivery ? [
64164
64177
  `delivery ${delivery.deliveryId}; target branch: ${delivery.targetBranch ?? "inspect the project"}.`,
64165
64178
  `existing context: ${JSON.stringify({ worktree: delivery.worktree, branch: delivery.branch, base: delivery.base, landing: delivery.landing, completions: delivery.completions })}`,
@@ -64169,7 +64182,7 @@ function workspaceField(delivery) {
64169
64182
  }
64170
64183
  function answeringField(delivery, self) {
64171
64184
  const approved = delivery.approved.trim();
64172
- const say2 = (flag) => ` ${self} raw delivery answered ${delivery.deliveryId} ${flag}`;
64185
+ const say2 = (flag) => ` ${self} delivery answered ${delivery.deliveryId} ${flag}`;
64173
64186
  return [
64174
64187
  ...field("delivery", [
64175
64188
  `${delivery.deliveryId} is already building this card, from the copy below \u2014 frozen when it started.`,
@@ -64179,8 +64192,7 @@ function answeringField(delivery, self) {
64179
64192
  `judge the MEANING, not the words. Confirming an option that is already built, writing down a decision`,
64180
64193
  `the card already carries and tidying prose are all --unchanged. Adding, dropping or changing a`,
64181
64194
  `requirement is --changed \u2014 and so is confirming an implementation that contradicts the copy below,`,
64182
- `however finished it is.`,
64183
- `say nothing and the board carries on as --unchanged.`
64195
+ `however finished it is.`
64184
64196
  ]),
64185
64197
  ...field(
64186
64198
  "approved",
@@ -64236,8 +64248,7 @@ function conversationBlock(chat) {
64236
64248
  }
64237
64249
  function buildFlow(req, program2) {
64238
64250
  const delivery = deliveryFor(req);
64239
- const self = delivery?.worktree ? boardCommandFor(req.id) : `${program2}${BOARD_FLAG}`;
64240
- const raw = `${self} raw`;
64251
+ const self = boardCommand();
64241
64252
  const facts = [];
64242
64253
  const close = [];
64243
64254
  const next = [];
@@ -64266,11 +64277,11 @@ function buildFlow(req, program2) {
64266
64277
  ...settled ? ["honour the notes above as requirements \u2014 they are decisions already settled on this card, and nothing here reopens them"] : [],
64267
64278
  "tick each box in ## Todo as you finish it \u2014 they are the record of what was built",
64268
64279
  `record the delivered outcome and verification on the task \u2014 \`akb guide archive\``,
64269
- delivery ? `${self} raw delivery complete ${delivery.deliveryId} \u2014 finish your step and follow its handoff; software steps in a git project supply --commit <full-sha> --branch <target>` : `${self} task archive ${req.id} \u2014 once every box is ticked and the card's goal is met`
64280
+ delivery ? `${self} delivery complete ${delivery.deliveryId} \u2014 finish your step and follow its handoff; software steps in a git project supply --commit <full-sha> --branch <target>` : `${self} task archive ${req.id} \u2014 once every box is ticked and the card's goal is met`
64270
64281
  );
64271
64282
  if (card.meta.questions.length) {
64272
64283
  next.push(
64273
- `${self} raw card resolve ${req.id} --print \u2014 first: the card has open questions, and building on a guess is what they are there to stop`
64284
+ `${self} task resolve ${req.id} --print \u2014 first: the card has open questions, and building on a guess is what they are there to stop`
64274
64285
  );
64275
64286
  }
64276
64287
  break;
@@ -64279,7 +64290,7 @@ function buildFlow(req, program2) {
64279
64290
  facts.push(...stepsField(card), ...questionsField(card.meta));
64280
64291
  close.push(
64281
64292
  "settle and write the card as `akb guide refine` says",
64282
- `${raw} update ${req.id} --status ready \u2014 once the card validates`
64293
+ `${self} task update ${req.id} --status ready \u2014 once the card validates`
64283
64294
  );
64284
64295
  break;
64285
64296
  }
@@ -64290,7 +64301,7 @@ function buildFlow(req, program2) {
64290
64301
  facts.push(...answeringField(building, self));
64291
64302
  facts.push(...notesField(card));
64292
64303
  close.push(
64293
- answeredClose(building, self),
64304
+ "record the effect with one of the delivery answer commands above before closing the questions",
64294
64305
  "do not run `refine` while a delivery is in flight \u2014 even if requirements changed, the build carries on in execution once all questions are dropped"
64295
64306
  );
64296
64307
  } else {
@@ -64300,7 +64311,7 @@ function buildFlow(req, program2) {
64300
64311
  break;
64301
64312
  }
64302
64313
  case "approve": {
64303
- close.push(`${raw} update ${req.id} --status ready \u2014 once the card validates`);
64314
+ close.push(`${self} task update ${req.id} --status ready \u2014 once the card validates`);
64304
64315
  break;
64305
64316
  }
64306
64317
  case "edit": {
@@ -64311,7 +64322,7 @@ function buildFlow(req, program2) {
64311
64322
  ])
64312
64323
  );
64313
64324
  close.push(
64314
- `${raw} update ${req.id} [${EDITABLE_FIELDS}] \u2014 the fields are the command's, never hand-written`,
64325
+ `${self} task update --help \u2014 see the available card fields and edit the body separately`,
64315
64326
  ...bodyScaffoldClose()
64316
64327
  );
64317
64328
  break;
@@ -64395,7 +64406,7 @@ function buildFlow(req, program2) {
64395
64406
  case "reflect": {
64396
64407
  for (const id2 of reflectedCards(req)) readCard2(id2, "archive");
64397
64408
  close.push(
64398
- `${self} raw triage add --title ".." --slug <short-english-slug> --source "#<id>" --studio <that card's studio> --text ".." \u2014 one call per proposal, each naming the archived file of the card it traces to`,
64409
+ `${self} triage add --title ".." --slug <short-english-slug> --source "#<id>" --studio <studio-id> --text ".." \u2014 one call per proposal, each naming the archived file of the card it traces to`,
64399
64410
  "propose nothing at all when nothing follows: that is a complete result, and most batches are it",
64400
64411
  "change nothing else \u2014 no card is created, edited or archived, and no memory file is written"
64401
64412
  );
@@ -64425,10 +64436,6 @@ function printFlow(rawReq, program2 = "akb") {
64425
64436
  });
64426
64437
  if (flow.next.length) sections.push({ head: "handing over \u2014 the action to reach for, and when:", lines: flow.next });
64427
64438
  say(flow.lead);
64428
- if (program2 !== "akb") {
64429
- say("");
64430
- say(`there is no \`akb\` on this machine \u2014 every \`akb\` below, in the flows too, is \`${program2}\` here.`);
64431
- }
64432
64439
  for (const section of sections) {
64433
64440
  say("");
64434
64441
  say(section.head);
@@ -64469,7 +64476,7 @@ function printFlow(rawReq, program2 = "akb") {
64469
64476
  ...rule ? { rule } : {}
64470
64477
  };
64471
64478
  }
64472
- var MAX_STEPS, indent, EDITABLE_FIELDS, bodyScaffoldClose, answeredClose, GUIDES_FOR, guidesFor;
64479
+ var MAX_STEPS, indent, bodyScaffoldClose, GUIDES_FOR, guidesFor;
64473
64480
  var init_flow = __esm({
64474
64481
  "src/lib/agent/flow.ts"() {
64475
64482
  "use strict";
@@ -64491,9 +64498,7 @@ var init_flow = __esm({
64491
64498
  init_env();
64492
64499
  MAX_STEPS = 12;
64493
64500
  indent = (line) => line.split("\n").map((l) => l.trim() ? ` ${l}` : "").join("\n");
64494
- EDITABLE_FIELDS = "--title|--priority|--modules|--blocked-by|--related";
64495
64501
  bodyScaffoldClose = (lead = "fill the existing") => [`${lead} body scaffold; do not rename or translate its section titles, and leave empty scaffold sections in place`];
64496
- answeredClose = (delivery, self) => `${self} raw delivery answered ${delivery.deliveryId} --changed|--unchanged "<why>" \u2014 before you drop the questions; dropping the last one with nothing said carries the build on as --unchanged`;
64497
64502
  GUIDES_FOR = {
64498
64503
  implement: ["board", "archive", "implement"],
64499
64504
  sub: [],
@@ -65523,8 +65528,8 @@ async function cmdStartRun(action, args2, opts, program2 = "akb") {
65523
65528
  const { run: run3, spawned } = started;
65524
65529
  if (!spawned) die(`couldn't start a process for run ${run3.sessionId}`, { kind: "spawn-failed" });
65525
65530
  say(`${action} \u2014 run ${run3.sessionId}${run3.deliveryId ? ` in delivery ${run3.deliveryId}` : ""}`);
65526
- say(` follow it: ${program2} raw run log ${short(run3.sessionId)} --follow${BOARD_FLAG}`);
65527
- say(` stop it: ${program2} raw run stop ${short(run3.sessionId)}${BOARD_FLAG}`);
65531
+ say(` follow it: ${boardCommand()} run log ${short(run3.sessionId)} --follow`);
65532
+ say(` stop it: ${boardCommand()} run stop ${short(run3.sessionId)}`);
65528
65533
  if (follow2) return await followStarted(run3.sessionId, program2, opts.events === true);
65529
65534
  return { sessionId: run3.sessionId, action, cardId: run3.cardId };
65530
65535
  }
@@ -65574,7 +65579,7 @@ function sayBeforeStart(req, program2) {
65574
65579
  const asked = card?.questions.length ?? 0;
65575
65580
  if (req.action === "implement" && asked) {
65576
65581
  say(
65577
- `#${req.id} has ${asked} open question${asked === 1 ? "" : "s"} \u2014 it is built, then holds at landing until ${asked === 1 ? "it is" : "they are"} answered. Answer first with \`${program2} raw card resolve ${req.id}\`.`
65582
+ `#${req.id} has ${asked} open question${asked === 1 ? "" : "s"} \u2014 it is built, then holds at landing until ${asked === 1 ? "it is" : "they are"} answered. Answer first with \`${boardCommand()} task resolve ${req.id}\`.`
65578
65583
  );
65579
65584
  }
65580
65585
  }
@@ -65741,7 +65746,7 @@ async function cmdSubWait(ids, waitMs = WAIT_MS2) {
65741
65746
  say("");
65742
65747
  }
65743
65748
  if (running.length) {
65744
- say(`still running: ${running.map((r) => short(r.sessionId)).join(", ")} \u2014 run \`run wait\` again.`);
65749
+ say(`still running: ${running.map((r) => short(r.sessionId)).join(", ")} \u2014 run \`${boardCommand()} run wait${ids.length ? ` ${ids.join(" ")}` : ""}\` again.`);
65745
65750
  }
65746
65751
  return {
65747
65752
  ended: ended.map((r) => ({ sessionId: r.sessionId, status: r.status, result: r.result })),
@@ -65766,7 +65771,7 @@ async function cmdRuns(opts, program2 = "akb") {
65766
65771
  }
65767
65772
  if (live.length) say("");
65768
65773
  say(
65769
- live.length ? `${live.length} running. Follow one with \`${program2} raw run log <id> --follow${BOARD_FLAG}\`.` : "nothing running."
65774
+ live.length ? `${live.length} running. Follow one with \`${boardCommand()} run log <id> --follow\`.` : "nothing running."
65770
65775
  );
65771
65776
  return { runs: shown };
65772
65777
  }
@@ -65961,8 +65966,8 @@ function runLine(r, program2 = "akb", indent2 = "") {
65961
65966
  if (r.durationMs !== void 0) bits.push(`in ${ago(r.durationMs)}`);
65962
65967
  if (r.model) bits.push(r.model);
65963
65968
  if (r.costUsd !== void 0) bits.push(`$${r.costUsd.toFixed(4)}`);
65964
- if (r.canResume) bits.push(`\u2014 continue it with \`${program2} raw run resume ${short(r.sessionId)}${BOARD_FLAG}\``);
65965
- if (r.canRetry) bits.push(`\u2014 try it again with \`${program2} raw run resume ${short(r.sessionId)}${BOARD_FLAG}\``);
65969
+ if (r.canResume) bits.push(`\u2014 continue it with \`${boardCommand()} run resume ${short(r.sessionId)}\``);
65970
+ if (r.canRetry) bits.push(`\u2014 try it again with \`${boardCommand()} run resume ${short(r.sessionId)}\``);
65966
65971
  const line = bits.join(" ");
65967
65972
  const under = [
65968
65973
  r.input && firstLine2(r.input),
@@ -66008,6 +66013,7 @@ var init_run = __esm({
66008
66013
  init_answers();
66009
66014
  init_deliveries();
66010
66015
  init_pause();
66016
+ init_command();
66011
66017
  init_flow();
66012
66018
  init_env();
66013
66019
  init_memory_review();
@@ -66678,13 +66684,16 @@ function nounOf(program2, name, summary2, description) {
66678
66684
  });
66679
66685
  }
66680
66686
  function declareRaw(program2, cli) {
66681
- const raw = `${cli.program} raw`;
66687
+ declareLocalRuns(program2, cli);
66688
+ }
66689
+ function declareLocalRuns(program2, cli, canonical) {
66690
+ const command = canonical ? cli.program : `${cli.program} raw`;
66682
66691
  const noun = (name, summary2, description) => nounOf(program2, name, summary2, description);
66683
66692
  const groups = {
66684
- card: noun(
66693
+ card: canonical?.task ?? noun(
66685
66694
  "card",
66686
66695
  "one card: build it, sharpen it, change it, finish it",
66687
- `Every verb here takes the card\u2019s id. A card with a delivery in flight refuses all of them but \`implement\` \u2014 \`${raw} delivery cancel\` is what hands it back.`
66696
+ `Every verb here takes the card\u2019s id. A card with a delivery in flight refuses all of them but \`implement\` \u2014 \`${command} delivery cancel\` is what hands it back.`
66688
66697
  ),
66689
66698
  delivery: noun(
66690
66699
  "delivery",
@@ -66694,9 +66703,9 @@ function declareRaw(program2, cli) {
66694
66703
  run: noun(
66695
66704
  "run",
66696
66705
  "the agent processes \u2014 what is going, and what went",
66697
- `A run is one agent working once. A delivery is made of several, so ending a run leaves the delivery in flight \u2014 \`${raw} delivery cancel\` is what ends that.`
66706
+ `A run is one agent working once. A delivery is made of several, so ending a run leaves the delivery in flight \u2014 \`${command} delivery cancel\` is what ends that.`
66698
66707
  ),
66699
- memory: noun("memory", "squeeze or review the memory the planning flows read"),
66708
+ memory: noun("memory", "read and maintain project memory"),
66700
66709
  // What is waiting to be sorted (#453, #499).
66701
66710
  triage: noun(
66702
66711
  "triage",
@@ -66704,11 +66713,18 @@ function declareRaw(program2, cli) {
66704
66713
  "What is in triage is not a task: it never enters the card list, is never scheduled, and counts towards nothing. Triage is `docs/kanban/triage/`, one file each, with `archived/` for what became a card and `dismissed/` for what was ignored. The board UI is where items are read, made into cards, ignored and restored."
66705
66714
  )
66706
66715
  };
66707
- for (const flow of FLOWS) if (!flow.internal) declareFlow(flow.group ? groups[flow.group] : program2, flow, cli);
66708
- declareRunning(groups.run, cli);
66709
- declareDelivery(groups.delivery, cli);
66716
+ for (const flow of FLOWS) {
66717
+ if (flow.internal) continue;
66718
+ if (canonical && flow.action === "describe-project") {
66719
+ declareFlow(groups.memory, flow, cli, true);
66720
+ } else if (!canonical || flow.group === "card" && flow.action !== "approve" || flow.action === "review-memory" || flow.action === "prune-memory") {
66721
+ declareFlow(flow.group ? groups[flow.group] : program2, flow, cli, !!canonical);
66722
+ }
66723
+ }
66724
+ declareRunning(groups.run, cli, !!canonical);
66725
+ declareDelivery(groups.delivery, cli, !!canonical);
66710
66726
  groups.delivery.addHelpText("after", HELP_AFTER.deliveries(cli.program));
66711
- withShared(program2.command("previews")).allowExcessArguments().summary("list Preview output IDs and instructions").addOption(new Option("-f, --follow").hideHelp()).addOption(new Option("--notes <text>").hideHelp()).addOption(new Option("--print").hideHelp()).option("--triggers", "query Studio Previews for a Goal").option("--studio <id>", "Preview outputs of this Studio").option("--workspace <id>", "the workspace whose studios to query").action(async function() {
66727
+ withShared((canonical?.studio ?? program2).command("previews")).allowExcessArguments().summary("list Preview output IDs and instructions").addOption(new Option("-f, --follow").hideHelp()).addOption(new Option("--notes <text>").hideHelp()).addOption(new Option("--print").hideHelp()).addOption(new Option("--triggers", "query Studio Previews for a Goal").hideHelp(!!canonical)).option("--studio <id>", "Preview outputs of this Studio").addOption(new Option("--workspace <id>", "the workspace whose studios to query").hideHelp(!!canonical)).action(async function() {
66712
66728
  const opts = this.opts();
66713
66729
  if (this.args.length || opts.follow || opts.notes !== void 0) {
66714
66730
  return boardless(this, cli, () => die("Prepare Preview outputs in the task session using STUDIO.md.", "bad-args"));
@@ -66720,7 +66736,6 @@ function declareRaw(program2, cli) {
66720
66736
  });
66721
66737
  } else await onBoard(this, cli, () => listPreviews(opts.studio));
66722
66738
  });
66723
- declareAgent(program2, cli);
66724
66739
  const triage = groups.triage;
66725
66740
  withShared(triage.command("add")).summary("write one item into triage").description(
66726
66741
  "One item, from words you already have \u2014 no endpoint, and nothing is pulled. The body is `--text` for a line or two, `--file <path>` when it is longer. `--source` says where it came from, and a reflection puts the card that prompted it there. It is not a task: it waits in triage until somebody sorts it. One already waiting, or already made into a card, is refused and told where it is; one only ignored is taken, and its `dismissed/` record is left alone."
@@ -66732,25 +66747,30 @@ function declareRaw(program2, cli) {
66732
66747
  ).argument("<source-id>", "the id to look for").action(async function(sourceId) {
66733
66748
  await onBoard(this, cli, () => cmdTriageCheck(sourceId));
66734
66749
  });
66735
- withShared(program2.command("components")).summary("list an agent or studio\u2019s Preview Components and their usage").option("--studio <id>", "all components used by a studio").option("--docs", "include component usage documentation").action(async function() {
66736
- const ctx = ctxOf(this, cli.program);
66737
- useBoard(resolveBoard("components", { board: ctx.board, dir: ctx.dir, cwd: cli.cwd, installHint: cli.installHint }), ctx.dir !== null);
66738
- await boardless(this, cli, () => cmdComponents(this.opts()));
66739
- });
66740
- const studio = noun("studio", "check a studio folder or draw its diagram");
66750
+ const studio = canonical?.studio ?? noun("studio", "check a Studio folder");
66741
66751
  withShared(studio.command("validate")).argument("<folder>", "a studio folder containing STUDIO.md").summary("validate the complete Studio definition and its references").action(async function(folder2) {
66742
66752
  await onBoard(this, cli, () => cmdStudioValidate(folder2));
66743
66753
  });
66744
66754
  withShared(studio.command("preview")).argument("<card>", "the card to review the Studio on", cardId).requiredOption("--folder <draft>", "the complete draft Studio folder").requiredOption("--base <baseline>", "the baseline folder, or empty for a new Studio").summary("freeze Studio files and print Studio and attachment previews").action(async function(card) {
66745
66755
  await onBoard(this, cli, () => cmdStudioPreview(card, this.opts()));
66746
66756
  });
66747
- withShared(studio.command("diagram")).argument("<id-or-card>", "studio id, or card number with --folder").argument("[card]", "the card whose asset folder gets studio.json").option("--folder <folder>", "read a local studio folder").summary("write the studio's diagram to .assets/<card>/studio.json and print the <Studio> tag that shows it").action(async function(id2, card) {
66757
+ if (canonical) {
66758
+ const board2 = noun("board", "list local cards and resolve board conflicts");
66759
+ declareBoardMoves(program2, cli, { ...canonical, board: board2, memory: groups.memory });
66760
+ return;
66761
+ }
66762
+ declareAgent(program2, cli);
66763
+ withShared(program2.command("components")).summary("list an agent or studio\u2019s Preview Components and their usage").option("--studio <id>", "all components used by a studio").option("--docs", "include component usage documentation").action(async function() {
66764
+ const ctx = ctxOf(this, cli.program);
66765
+ useBoard(resolveBoard("components", { board: ctx.board, dir: ctx.dir, cwd: cli.cwd, installHint: cli.installHint }), ctx.dir !== null);
66766
+ await boardless(this, cli, () => cmdComponents(this.opts()));
66767
+ });
66768
+ withShared(studio.command("diagram", { hidden: true })).argument("<id-or-card>", "studio id, or card number with --folder").argument("[card]", "the card whose asset folder gets studio.json").option("--folder <folder>", "read a local studio folder").summary("write the studio's diagram to .assets/<card>/studio.json and print the <Studio> tag that shows it").action(async function(id2, card) {
66748
66769
  await onBoard(this, cli, () => cmdStudioDiagram(id2, this.opts().folder ? id2 : card, this.opts().folder));
66749
66770
  });
66750
66771
  }
66751
66772
  function declareRuns(program2, cli) {
66752
- const ON_WEB = "Reads and writes WildCrane Cloud as the signed-in account; changes show on the web at once.";
66753
- const task = withShared(program2.command("task")).summary("see where WildCrane tasks stand; list, create, approve, stop, resume, remove and restore them").description(`${ON_WEB} <task> is WC-12, task_\u2026, or just 12 in a linked folder.`).action(function() {
66773
+ const task = withShared(program2.command("task")).summary("manage Cloud tasks and work on local cards").description("Manage tasks. Check subcommand help for whether it works on this board or in Cloud.").action(function() {
66754
66774
  this.help();
66755
66775
  });
66756
66776
  withShared(task.command("list")).summary("list tasks").option("--project <id>", "the project; default: this folder\u2019s linked one").option("--workspace <id>", "every project of a workspace").option("--status <status>", "queued, running, waiting_review, done, failed, cancelled or stopped").action(async function() {
@@ -66759,8 +66779,19 @@ function declareRuns(program2, cli) {
66759
66779
  withShared(task.command("show")).argument("<task>").summary("a task and its card").action(async function(id2) {
66760
66780
  await boardless(this, cli, (_, location) => taskShow(id2, location));
66761
66781
  });
66762
- withShared(task.command("create")).argument("<request...>", "what the task should do").summary("create a task and prepare its card asynchronously").option("--project <id>", "the project; default: this folder\u2019s linked one").option("--studio <id>", "required: a name `akb studio list` shows").action(async function(request2) {
66763
- await boardless(this, cli, (_, location) => taskCreate(request2.join(" "), this.opts(), location));
66782
+ withCreateOptions(withShared(task.command("create"))).argument("[request...]", "what the task should do").summary("prepare a task from a request or write a local card from a title").description("Pass a request to prepare a Cloud task asynchronously. Use --title to allocate a number in Cloud and immediately write a card and its index entry to this board. Use --studio with a request. Card fields apply to --title and --project applies to a request. Edit the saved body separately.").option("--project <id>", "for a request: the project; default: this folder\u2019s linked one").action(async function(request2) {
66783
+ const opts = this.opts();
66784
+ if (opts.title !== void 0) {
66785
+ if (request2.length || opts.project !== void 0) {
66786
+ die("Use --title with the local board, or pass a request and optionally --project.", "bad-args");
66787
+ }
66788
+ return createBoardCard(this, cli);
66789
+ }
66790
+ if (["priority", "blockedBy", "related", "modules", "slug", "triage", "source"].some((key) => opts[key] !== void 0)) {
66791
+ die("Card fields require --title.", "bad-args");
66792
+ }
66793
+ if (!request2.length) this.error("missing required argument 'request' or option '--title'", { code: "commander.missingArgument" });
66794
+ await boardless(this, cli, (_, location) => taskCreate(request2.join(" "), opts, location));
66764
66795
  });
66765
66796
  withShared(task.command("approve")).argument("<task>").summary("approve the current review point").option("--stage <id>", "the reviewed node").requiredOption("--revision <n>", "the stage version you reviewed").option("--comment <text>", "a note with the approval").action(async function(id2) {
66766
66797
  await boardless(this, cli, (_, location) => taskApprove(id2, this.opts().comment, this.opts(), location));
@@ -66871,7 +66902,7 @@ function declareRuns(program2, cli) {
66871
66902
  const tools = withShared(program2.command("agent")).summary("the AI tools on this MACHINE");
66872
66903
  tools.allowExcessArguments().allowUnknownOption().action(function() {
66873
66904
  if (!this.args.length) this.help();
66874
- this.error(movedTo("agent", cli.program), { code: "commander.unknownCommand" });
66905
+ this.error(`unknown command '${this.args[0]}'`, { code: "commander.unknownCommand" });
66875
66906
  });
66876
66907
  withShared(tools.command("check")).summary("whether WildCrane can run an agent here, and what is missing; exits 1 until it can").argument("<agent>", HARNESSES.map((h) => h.name).join(", ")).action(async function(agent) {
66877
66908
  await boardless(this, cli, () => cmdAgentCheck(agent));
@@ -66893,7 +66924,7 @@ function declareRuns(program2, cli) {
66893
66924
  ).allowExcessArguments().allowUnknownOption().action(async function() {
66894
66925
  const word = this.args[0];
66895
66926
  if (word === "diagram") {
66896
- this.error(`\`${cli.program} studio ${word}\` is now \`${cli.program} raw studio ${word}\`.`, { code: "commander.unknownCommand" });
66927
+ this.error(`Freeze a Studio draft with \`${cli.program} studio preview <card> --folder <draft> --base <baseline>\`.`, { code: "commander.unknownCommand" });
66897
66928
  }
66898
66929
  if (word) this.error(`unknown command '${word}'`, { code: "commander.unknownCommand" });
66899
66930
  await studioList(this, cli);
@@ -66933,6 +66964,7 @@ function declareRuns(program2, cli) {
66933
66964
  }
66934
66965
  await boardless(this, cli, (p) => cmdGuide(topic, p));
66935
66966
  });
66967
+ declareLocalRuns(program2, cli, { task, studio });
66936
66968
  program2.command("__watch", { hidden: true }).argument("<sessionId>").action(async function(sessionId) {
66937
66969
  const ctx = ctxOf(this, cli.program);
66938
66970
  const found2 = resolveBoard("runs", { board: ctx.board, dir: ctx.dir, cwd: cli.cwd, installHint: cli.installHint });
@@ -66941,7 +66973,7 @@ function declareRuns(program2, cli) {
66941
66973
  if (code !== 0) throw new BoardError(`the watcher for ${sessionId} ended with ${code}`, { kind: "watch-failed" });
66942
66974
  });
66943
66975
  }
66944
- function declareRunning(run3, cli) {
66976
+ function declareRunning(run3, cli, canonical) {
66945
66977
  const verb = (name) => withShared(run3.command(name));
66946
66978
  verb("list").summary("what is running, and what ran lately").description("A creation run with no card fails even if the agent exits with code 0. Failure reason, triage source and cost are kept. In JSON the run reports status: error and ok: false; the outer ok describes this query. A successful query exits with code 0.").option("-c, --card <id>", "only the runs on that card", cardId).option("-a, --all", "every run this board has kept, not just the last ten").action(async function() {
66947
66979
  await onBoard(this, cli, (p) => cmdRuns(this.opts(), p));
@@ -66956,7 +66988,7 @@ function declareRunning(run3, cli) {
66956
66988
  const [ids] = positional(vals);
66957
66989
  await onBoard(this, cli, () => cmdSubWait(ids ?? []));
66958
66990
  });
66959
- verb("log").argument("[id]", RUN_ID, String).summary("one run's log").description("Shows the failure reason, any triage source and recorded cost. A creation run with no card fails even if the agent exits with code 0. Non-following queries exit with code 0; following a failed run exits with code 1. Example: akb raw run log abc12345 --follow").option("-f, --follow", "keep printing it until the run ends").option("--events", "with --follow: print its structured events, one JSON object per line").option("--full", "all of it, rather than the tail").action(async function(...vals) {
66991
+ verb("log").argument("[id]", RUN_ID, String).summary("one run's log").description("Shows the failure reason, any triage source and recorded cost. A creation run with no card fails even if the agent exits with code 0. Non-following queries exit with code 0; following a failed run exits with code 1. Example: akb run log abc12345 --follow").option("-f, --follow", "keep printing it until the run ends").option("--events", "with --follow: print its structured events, one JSON object per line").option("--full", "all of it, rather than the tail").action(async function(...vals) {
66960
66992
  const [id2] = positional(vals);
66961
66993
  await onBoard(this, cli, (p) => cmdLog(id2, this.opts(), p));
66962
66994
  });
@@ -66964,13 +66996,13 @@ function declareRunning(run3, cli) {
66964
66996
  const [id2] = positional(vals);
66965
66997
  await onBoard(this, cli, () => cmdStop(id2));
66966
66998
  });
66967
- verb("resume").argument("[id]", RUN_ID, String).summary("continue a run from its saved work").description("Continue the saved session. Use --fresh to explicitly take over saved work when the original session is unavailable.").option("-f, --follow", "watch its log instead of returning").option("--events", "with --follow: print its structured events, one JSON object per line").option("--fresh", "explicitly take over saved work in a new session").option("--require-session", "require the original session").action(async function(...vals) {
66999
+ verb("resume").argument("[id]", RUN_ID, String).summary("continue a run from its saved work").description("Continue the saved session. Use --fresh to explicitly take over saved work when the original session is unavailable.").option("-f, --follow", "watch its log instead of returning").option("--events", "with --follow: print its structured events, one JSON object per line").option("--fresh", "explicitly take over saved work in a new session").addOption(new Option("--require-session", "require the original session").hideHelp(canonical)).action(async function(...vals) {
66968
67000
  const [id2] = positional(vals);
66969
67001
  await onBoard(this, cli, () => cmdResume(id2, this.opts()));
66970
67002
  });
66971
67003
  }
66972
- function declareDelivery(delivery, cli) {
66973
- const verb = (name) => withShared(delivery.command(name));
67004
+ function declareDelivery(delivery, cli, canonical) {
67005
+ const verb = (name, internal = false) => withShared(delivery.command(name, { hidden: canonical && internal }));
66974
67006
  verb("complete").argument("<delivery>", DELIVERY).summary("record the current step result and finish its handoff").option("--commit <sha>", "the full landed commit hash").option("--branch <name>", "the target branch containing that commit").action(async function(named2) {
66975
67007
  await onBoard(this, cli, () => cmdCompleteDelivery(named2, this.opts()));
66976
67008
  });
@@ -66996,25 +67028,26 @@ function declareDelivery(delivery, cli) {
66996
67028
  const [named2] = positional(vals);
66997
67029
  await onBoard(this, cli, () => cmdResumeDelivery(named2));
66998
67030
  });
66999
- verb("reconcile").argument("<card>", "card number", cardId).summary("reconcile local delivery state for a card before recovery").action(async function(...vals) {
67031
+ verb("reconcile", true).argument("<card>", "card number", cardId).summary("reconcile local delivery state for a card before recovery").action(async function(...vals) {
67000
67032
  const [id2] = positional(vals);
67001
67033
  await onBoard(this, cli, () => cmdReconcileDelivery(id2));
67002
67034
  });
67003
- verb("release").argument("<card>", "card number", cardId).summary("safely release an active delivery write lock while preserving saved work").action(async function(...vals) {
67035
+ verb("release", true).argument("<card>", "card number", cardId).summary("safely release an active delivery write lock while preserving saved work").action(async function(...vals) {
67004
67036
  const [id2] = positional(vals);
67005
67037
  await onBoard(this, cli, () => cmdReleaseDelivery(id2));
67006
67038
  });
67007
67039
  }
67008
- function declareFlow(parent, flow, cli) {
67040
+ function declareFlow(parent, flow, cli, canonical) {
67009
67041
  const byDelivery = flow.group === "delivery";
67010
- const cmd = withShared(parent.command(flowVerb(flow)));
67042
+ const cmd = withShared(parent.command(flowVerb(flow), { hidden: canonical && flow.action === "prune-memory" }));
67011
67043
  for (const arg of splitArgs(flow.argument)) {
67012
67044
  cmd.argument(arg, argNote(arg, flow), arg.startsWith("<id") ? byDelivery ? String : cardId : void 0);
67013
67045
  }
67014
67046
  cmd.summary(flow.gloss);
67015
67047
  if (flow.more?.length) cmd.description(`${sentence(flow.gloss)} ${flow.more.join(" ")}`);
67016
- for (const option of flow.options ?? []) addFlowOption(cmd, option);
67017
- cmd.addOption(new Option("-p, --print", "say what to do and start nothing").conflicts("follow")).option("-f, --follow", "watch the log instead of returning").option("--events", "with --follow: print its structured events, one JSON object per line").addHelpText("after", HELP_AFTER.flow).action(async function(...vals) {
67048
+ for (const option of flow.options ?? []) addFlowOption(cmd, option, canonical && option.internal === true);
67049
+ const showPrint = !canonical || flow.group === "card";
67050
+ cmd.addOption(new Option("-p, --print", "say what to do and start nothing").conflicts("follow").hideHelp(!showPrint)).addOption(new Option("-f, --follow", "watch the log instead of returning").hideHelp(canonical)).addOption(new Option("--events", "with --follow: print its structured events, one JSON object per line").hideHelp(canonical)).addHelpText("after", showPrint ? PRINT_FLOW_HELP : "").action(async function(...vals) {
67018
67051
  const args2 = positional(vals);
67019
67052
  await onBoard(
67020
67053
  this,
@@ -67028,8 +67061,8 @@ function deliveryOf(named2) {
67028
67061
  if (!delivery) throw new BoardError(`no delivery here answers to "${named2}"`, { kind: "unknown-delivery" });
67029
67062
  return delivery;
67030
67063
  }
67031
- function addFlowOption(cmd, option) {
67032
- const declared = new Option(option.flags, option.description);
67064
+ function addFlowOption(cmd, option, hidden) {
67065
+ const declared = new Option(option.flags, option.description).hideHelp(hidden);
67033
67066
  if (option.choices) declared.argParser(oneOf(option.choices));
67034
67067
  if (option.range) declared.argParser(intInRange(option.range[0], option.range[1]));
67035
67068
  cmd.addOption(declared);
@@ -67104,7 +67137,7 @@ var init_agent2 = __esm({
67104
67137
  init_telemetry2();
67105
67138
  init_agent_check();
67106
67139
  init_harnesses();
67107
- init_moved();
67140
+ init_board2();
67108
67141
  init_question_options();
67109
67142
  init_shared2();
67110
67143
  REVIEW_FLOW_HELP = `
@@ -67276,18 +67309,12 @@ function declareSetup(program2, cli) {
67276
67309
  }
67277
67310
 
67278
67311
  // src/lib/cli/akb.ts
67279
- init_io();
67280
67312
  init_shared2();
67281
67313
  function buildAkbProgram(cli) {
67282
67314
  const program2 = withShared(newCommand(cli.program));
67283
67315
  program2.description("set up a board, and put an agent to work on it.").helpCommand("help [command]", "this list, or one command in full");
67284
67316
  declareSetup(program2, cli);
67285
67317
  declareRuns(program2, cli);
67286
- program2.command("raw").argument("[move...]").summary("the local board, and the commands an agent uses inside a run").description(`Every move: \`${cli.program} raw help\`. A person never has to type one.`).action(function() {
67287
- throw new BoardError(`\`${cli.program} raw\` is a tree of its own \u2014 this command line never reached it.`, {
67288
- kind: "unreachable"
67289
- });
67290
- });
67291
67318
  return program2;
67292
67319
  }
67293
67320
 
@@ -67306,6 +67333,7 @@ async function runAgent2(argv, options = {}) {
67306
67333
 
67307
67334
  // src/kanban.ts
67308
67335
  init_board_cli();
67336
+ init_paths();
67309
67337
  init_version();
67310
67338
  var SELF2 = fileURLToPath4(import.meta.url);
67311
67339
  function invokedDirectly() {
@@ -67319,32 +67347,32 @@ function invokedDirectly() {
67319
67347
  }
67320
67348
  if (invokedDirectly()) {
67321
67349
  const argv = process.argv.slice(2);
67322
- const raw = rawArgv(argv);
67323
- if (argv[0] === "__watch") {
67324
- void runAgent2(argv, { program: "akb" }).then((code) => {
67325
- process.exitCode = code;
67326
- });
67327
- } else if (raw || argv[0] === "guide") {
67328
- if (argv[0] === "guide") {
67329
- void runAgent2(argv, { program: `node ${SELF2}` }).then((code) => {
67330
- process.exitCode = code;
67331
- });
67332
- } else {
67333
- void runBoard(raw ?? [], {
67334
- program: `node ${SELF2} raw`,
67335
- version: `wildcrane ${SKILL_VERSION}`
67336
- }).then((code) => {
67337
- process.exitCode = code;
67338
- });
67339
- }
67340
- } else {
67341
- void runBoard(argv, {
67342
- program: `node ${SELF2}`,
67343
- version: `wildcrane ${SKILL_VERSION}`
67344
- }).then((code) => {
67345
- process.exitCode = code;
67346
- });
67347
- }
67350
+ const program2 = `node ${shellWord(SELF2)}`;
67351
+ const word = commandWord(argv);
67352
+ const legacy = /* @__PURE__ */ new Set([
67353
+ "create",
67354
+ "update-questions",
67355
+ "conflict",
67356
+ "list",
67357
+ "inspect",
67358
+ "validate",
67359
+ "file",
67360
+ "agent-file",
67361
+ "memory-file",
67362
+ "reject",
67363
+ "init",
67364
+ "card",
67365
+ "previews",
67366
+ "components",
67367
+ "reflect",
67368
+ "review-dismissals",
67369
+ "describe-project",
67370
+ "version"
67371
+ ]);
67372
+ const result = legacy.has(word) ? runBoard(argv, { program: program2, version: `wildcrane ${SKILL_VERSION}` }) : runAgent2(argv, { program: program2 });
67373
+ void result.then((code) => {
67374
+ process.exitCode = code;
67375
+ });
67348
67376
  }
67349
67377
  export {
67350
67378
  rawArgv,