wildcrane-runner 0.6.108 → 0.6.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ai4kanban 0.11.88 — built by runner/scripts/build.mjs. Do not edit.
2
+ // ai4kanban 0.11.90 — built by runner/scripts/build.mjs. Do not edit.
3
3
  import { createRequire as __ai4kanbanRequire } from 'node:module'
4
4
  const require = __ai4kanbanRequire(import.meta.url)
5
5
  var __create = Object.create;
@@ -339,11 +339,11 @@ function setBoard(kanban, root2, flag) {
339
339
  }
340
340
  function setBoardRoot(root2, named2 = false) {
341
341
  const project2 = path2.resolve(root2);
342
- return setBoard(path2.join(project2, "docs", "kanban"), project2, named2 ? ` --dir ${project2}` : "");
342
+ return setBoard(path2.join(project2, "docs", "kanban"), project2, named2 ? ` --dir ${shellWord(project2)}` : "");
343
343
  }
344
344
  function setBoardDir(board2, root2) {
345
345
  const folder2 = path2.resolve(board2);
346
- return setBoard(folder2, root2 ?? projectRootOf(folder2), ` --board ${folder2}`);
346
+ return setBoard(folder2, root2 ?? projectRootOf(folder2), ` --board ${shellWord(folder2)}`);
347
347
  }
348
348
  function die(msg, kind) {
349
349
  throw new BoardError(msg, typeof kind === "string" ? { kind } : kind);
@@ -368,7 +368,7 @@ function useProjectState() {
368
368
  ensureAkbDir();
369
369
  return ensureProjectState(KANBAN, REPO_ROOT);
370
370
  }
371
- 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;
371
+ 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;
372
372
  var init_paths = __esm({
373
373
  "../cli/src/lib/paths.ts"() {
374
374
  "use strict";
@@ -413,6 +413,7 @@ var init_paths = __esm({
413
413
  AKB_DIR = "";
414
414
  ROOT_GITIGNORE = "";
415
415
  AKB_IGNORE_LINE = ".akb/";
416
+ shellWord = (value) => /^[\w./:@=-]+$/.test(value) ? value : `"${value.replace(/["`$\\]/g, "\\$&")}"`;
416
417
  BOARD_FLAG = "";
417
418
  setBoardRoot(process.cwd());
418
419
  rel = (p) => {
@@ -1766,18 +1767,18 @@ var init_parse = __esm({
1766
1767
  return result.issues.length === 0;
1767
1768
  };
1768
1769
  _encode = (_Err) => {
1769
- const parse4 = _parse(_Err);
1770
+ const parse5 = _parse(_Err);
1770
1771
  const fn = (schema, value, _ctx, _params) => {
1771
1772
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
1772
- return parse4(schema, value, ctx, finalizeParams(fn, _params));
1773
+ return parse5(schema, value, ctx, finalizeParams(fn, _params));
1773
1774
  };
1774
1775
  return fn;
1775
1776
  };
1776
1777
  encode = /* @__PURE__ */ _encode($ZodRealError);
1777
1778
  _decode = (_Err) => {
1778
- const parse4 = _parse(_Err);
1779
+ const parse5 = _parse(_Err);
1779
1780
  const fn = (schema, value, _ctx, _params) => {
1780
- return parse4(schema, value, _ctx, finalizeParams(fn, _params));
1781
+ return parse5(schema, value, _ctx, finalizeParams(fn, _params));
1781
1782
  };
1782
1783
  return fn;
1783
1784
  };
@@ -2702,7 +2703,7 @@ function capSize(inst, size) {
2702
2703
  if (!caps.length)
2703
2704
  return;
2704
2705
  const cap = Math.min(...caps.map((c) => c[0]));
2705
- const parse4 = inst._zod.parse;
2706
+ const parse5 = inst._zod.parse;
2706
2707
  inst._zod.parse = (payload, ctx) => {
2707
2708
  const n = size(payload.value);
2708
2709
  if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
@@ -2716,7 +2717,7 @@ function capSize(inst, size) {
2716
2717
  }
2717
2718
  }
2718
2719
  }
2719
- return parse4(payload, ctx);
2720
+ return parse5(payload, ctx);
2720
2721
  };
2721
2722
  }
2722
2723
  function handleArrayResult(result, final, index) {
@@ -20908,6 +20909,9 @@ function withoutCode(source2) {
20908
20909
  return line;
20909
20910
  }).join("").replace(/(`+)([^]*?)\1(?!`)/g, blank);
20910
20911
  }
20912
+ function agentSectionOffset(source2) {
20913
+ return /^<!--[ \t]*agent[ \t]*-->/m.exec(withoutCode(source2))?.index ?? source2.length;
20914
+ }
20911
20915
  function parsePreviewBlocks(source2, file2 = "STUDIO.md") {
20912
20916
  const blocks = [], problems = [];
20913
20917
  const masked = withoutCode(source2);
@@ -22831,8 +22835,9 @@ var init_package = __esm({
22831
22835
  "../cli/package.json"() {
22832
22836
  package_default = {
22833
22837
  name: "wildcrane",
22834
- version: "0.11.88",
22838
+ version: "0.11.90",
22835
22839
  akbContract: 29,
22840
+ canonicalCommands: true,
22836
22841
  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.",
22837
22842
  keywords: [
22838
22843
  "kanban",
@@ -25956,7 +25961,7 @@ var CONVERSATION_MS;
25956
25961
  var init_conversation = __esm({
25957
25962
  "../cli/src/lib/shared/conversation.ts"() {
25958
25963
  "use strict";
25959
- CONVERSATION_MS = { send: 15e3, claim: 3e4, prepare: 6e4, start: 15e3, startup: 12e4, quiet: 6e4, stop: 1e4 };
25964
+ CONVERSATION_MS = { send: 15e3, prepare: 6e4, start: 15e3, stop: 1e4 };
25960
25965
  }
25961
25966
  });
25962
25967
 
@@ -29091,7 +29096,7 @@ var init_types3 = __esm({
29091
29096
  isRetired = (action) => RETIRED.has(action);
29092
29097
  refusal = (reason, error62, args2) => args2 ? { error: error62, reason, args: args2 } : { error: error62, reason };
29093
29098
  NOT_COMPLETED = "The delivery has not recorded completion.";
29094
- notCompletedWhy = (deliveryId) => `${NOT_COMPLETED} Finish its unchecked todos, then run akb raw delivery complete ${deliveryId}, with --commit <sha> --branch <name> in a git project.`;
29099
+ 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.`;
29095
29100
  }
29096
29101
  });
29097
29102
 
@@ -29608,7 +29613,7 @@ before proposing so you don't re-suggest them.
29608
29613
  // Only a header: `describe-project` writes the body, and runs while there is none (#1268).
29609
29614
  "project.md": `# Project
29610
29615
 
29611
- What the project is today, from its users' side. Rewritten whole by \`akb raw describe-project\`;
29616
+ What the project is today, from its users' side. Rewritten whole by \`akb memory describe-project\`;
29612
29617
  edits here do not last.
29613
29618
  `
29614
29619
  };
@@ -29806,10 +29811,10 @@ var require_code = __commonJS({
29806
29811
  function interpolate(x) {
29807
29812
  return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x);
29808
29813
  }
29809
- function stringify(x) {
29814
+ function stringify2(x) {
29810
29815
  return new _Code(safeStringify(x));
29811
29816
  }
29812
- exports.stringify = stringify;
29817
+ exports.stringify = stringify2;
29813
29818
  function safeStringify(x) {
29814
29819
  return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
29815
29820
  }
@@ -33504,7 +33509,7 @@ var require_fast_uri = __commonJS({
33504
33509
  normalizeString(uri, options);
33505
33510
  } else if (typeof uri === "object") {
33506
33511
  uri = /** @type {T} */
33507
- parse4(serialize2(uri, options), options);
33512
+ parse5(serialize2(uri, options), options);
33508
33513
  }
33509
33514
  return uri;
33510
33515
  }
@@ -33547,8 +33552,8 @@ var require_fast_uri = __commonJS({
33547
33552
  function resolveComponent(base, relative, options, skipNormalization) {
33548
33553
  const target = {};
33549
33554
  if (!skipNormalization) {
33550
- base = parse4(serialize2(base, options), options);
33551
- relative = parse4(serialize2(relative, options), options);
33555
+ base = parse5(serialize2(base, options), options);
33556
+ relative = parse5(serialize2(relative, options), options);
33552
33557
  }
33553
33558
  options = options || {};
33554
33559
  if (!options.tolerant && relative.scheme) {
@@ -33866,7 +33871,7 @@ var require_fast_uri = __commonJS({
33866
33871
  }
33867
33872
  return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
33868
33873
  }
33869
- function parse4(uri, opts) {
33874
+ function parse5(uri, opts) {
33870
33875
  return parseWithStatus(uri, opts).parsed;
33871
33876
  }
33872
33877
  function normalizeString(uri, opts) {
@@ -33903,7 +33908,7 @@ var require_fast_uri = __commonJS({
33903
33908
  resolveComponent,
33904
33909
  equal,
33905
33910
  serialize: serialize2,
33906
- parse: parse4
33911
+ parse: parse5
33907
33912
  };
33908
33913
  module.exports = fastUri;
33909
33914
  module.exports.default = fastUri;
@@ -37891,7 +37896,7 @@ var require_stringify = __commonJS({
37891
37896
  props.push(doc.directives.tagString(tag));
37892
37897
  return props.join(" ");
37893
37898
  }
37894
- function stringify(item, ctx, onComment, onChompKeep) {
37899
+ function stringify2(item, ctx, onComment, onChompKeep) {
37895
37900
  if (identity.isPair(item))
37896
37901
  return item.toString(ctx, onComment, onChompKeep);
37897
37902
  if (identity.isAlias(item)) {
@@ -37920,7 +37925,7 @@ var require_stringify = __commonJS({
37920
37925
  ${ctx.indent}${str5}`;
37921
37926
  }
37922
37927
  exports.createStringifyContext = createStringifyContext;
37923
- exports.stringify = stringify;
37928
+ exports.stringify = stringify2;
37924
37929
  }
37925
37930
  });
37926
37931
 
@@ -37930,7 +37935,7 @@ var require_stringifyPair = __commonJS({
37930
37935
  "use strict";
37931
37936
  var identity = require_identity();
37932
37937
  var Scalar = require_Scalar();
37933
- var stringify = require_stringify();
37938
+ var stringify2 = require_stringify();
37934
37939
  var stringifyComment = require_stringifyComment();
37935
37940
  function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
37936
37941
  const { allNullValues, doc, indent: indent2, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
@@ -37952,7 +37957,7 @@ var require_stringifyPair = __commonJS({
37952
37957
  });
37953
37958
  let keyCommentDone = false;
37954
37959
  let chompKeep = false;
37955
- let str5 = stringify.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
37960
+ let str5 = stringify2.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
37956
37961
  if (!explicitKey && !ctx.inFlow && str5.length > 1024) {
37957
37962
  if (simpleKeys)
37958
37963
  throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
@@ -38004,7 +38009,7 @@ ${indent2}:`;
38004
38009
  ctx.indent = ctx.indent.substring(2);
38005
38010
  }
38006
38011
  let valueCommentDone = false;
38007
- const valueStr = stringify.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
38012
+ const valueStr = stringify2.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
38008
38013
  let ws = " ";
38009
38014
  if (keyComment || vsb || vcb) {
38010
38015
  ws = vsb ? "\n" : "";
@@ -38145,7 +38150,7 @@ var require_addPairToJSMap = __commonJS({
38145
38150
  "use strict";
38146
38151
  var log = require_log();
38147
38152
  var merge2 = require_merge();
38148
- var stringify = require_stringify();
38153
+ var stringify2 = require_stringify();
38149
38154
  var identity = require_identity();
38150
38155
  var toJS = require_toJS();
38151
38156
  function addPairToJSMap(ctx, map3, { key, value }) {
@@ -38181,7 +38186,7 @@ var require_addPairToJSMap = __commonJS({
38181
38186
  if (typeof jsKey !== "object")
38182
38187
  return String(jsKey);
38183
38188
  if (identity.isNode(key) && ctx?.doc) {
38184
- const strCtx = stringify.createStringifyContext(ctx.doc, {});
38189
+ const strCtx = stringify2.createStringifyContext(ctx.doc, {});
38185
38190
  strCtx.anchors = /* @__PURE__ */ new Set();
38186
38191
  for (const node2 of ctx.anchors.keys())
38187
38192
  strCtx.anchors.add(node2.anchor);
@@ -38248,12 +38253,12 @@ var require_stringifyCollection = __commonJS({
38248
38253
  "../cli/node_modules/yaml/dist/stringify/stringifyCollection.js"(exports) {
38249
38254
  "use strict";
38250
38255
  var identity = require_identity();
38251
- var stringify = require_stringify();
38256
+ var stringify2 = require_stringify();
38252
38257
  var stringifyComment = require_stringifyComment();
38253
38258
  function stringifyCollection(collection, ctx, options) {
38254
38259
  const flow = ctx.inFlow ?? collection.flow;
38255
- const stringify2 = flow ? stringifyFlowCollection : stringifyBlockCollection;
38256
- return stringify2(collection, ctx, options);
38260
+ const stringify3 = flow ? stringifyFlowCollection : stringifyBlockCollection;
38261
+ return stringify3(collection, ctx, options);
38257
38262
  }
38258
38263
  function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
38259
38264
  const { indent: indent2, options: { commentString } } = ctx;
@@ -38278,7 +38283,7 @@ var require_stringifyCollection = __commonJS({
38278
38283
  }
38279
38284
  }
38280
38285
  chompKeep = false;
38281
- let str6 = stringify.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
38286
+ let str6 = stringify2.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
38282
38287
  if (comment2)
38283
38288
  str6 += stringifyComment.lineComment(str6, itemIndent, commentString(comment2));
38284
38289
  if (chompKeep && comment2)
@@ -38345,7 +38350,7 @@ ${indent2}${line}` : "\n";
38345
38350
  }
38346
38351
  if (comment)
38347
38352
  reqNewline = true;
38348
- let str5 = stringify.stringify(item, itemCtx, () => comment = null);
38353
+ let str5 = stringify2.stringify(item, itemCtx, () => comment = null);
38349
38354
  reqNewline || (reqNewline = lines.length > linesAtValue || str5.includes("\n"));
38350
38355
  if (i < items.length - 1) {
38351
38356
  str5 += ",";
@@ -39706,7 +39711,7 @@ var require_stringifyDocument = __commonJS({
39706
39711
  "../cli/node_modules/yaml/dist/stringify/stringifyDocument.js"(exports) {
39707
39712
  "use strict";
39708
39713
  var identity = require_identity();
39709
- var stringify = require_stringify();
39714
+ var stringify2 = require_stringify();
39710
39715
  var stringifyComment = require_stringifyComment();
39711
39716
  function stringifyDocument(doc, options) {
39712
39717
  const lines = [];
@@ -39721,7 +39726,7 @@ var require_stringifyDocument = __commonJS({
39721
39726
  }
39722
39727
  if (hasDirectives)
39723
39728
  lines.push("---");
39724
- const ctx = stringify.createStringifyContext(doc, options);
39729
+ const ctx = stringify2.createStringifyContext(doc, options);
39725
39730
  const { commentString } = ctx.options;
39726
39731
  if (doc.commentBefore) {
39727
39732
  if (lines.length !== 1)
@@ -39743,7 +39748,7 @@ var require_stringifyDocument = __commonJS({
39743
39748
  contentComment = doc.contents.comment;
39744
39749
  }
39745
39750
  const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
39746
- let body = stringify.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
39751
+ let body = stringify2.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
39747
39752
  if (contentComment)
39748
39753
  body += stringifyComment.lineComment(body, "", commentString(contentComment));
39749
39754
  if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
@@ -39751,7 +39756,7 @@ var require_stringifyDocument = __commonJS({
39751
39756
  } else
39752
39757
  lines.push(body);
39753
39758
  } else {
39754
- lines.push(stringify.stringify(doc.contents, ctx));
39759
+ lines.push(stringify2.stringify(doc.contents, ctx));
39755
39760
  }
39756
39761
  if (doc.directives?.docEnd) {
39757
39762
  if (doc.comment) {
@@ -41887,7 +41892,7 @@ var require_cst_scalar = __commonJS({
41887
41892
  var require_cst_stringify = __commonJS({
41888
41893
  "../cli/node_modules/yaml/dist/parse/cst-stringify.js"(exports) {
41889
41894
  "use strict";
41890
- var stringify = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
41895
+ var stringify2 = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
41891
41896
  function stringifyToken(token2) {
41892
41897
  switch (token2.type) {
41893
41898
  case "block-scalar": {
@@ -41940,7 +41945,7 @@ var require_cst_stringify = __commonJS({
41940
41945
  res += stringifyToken(value);
41941
41946
  return res;
41942
41947
  }
41943
- exports.stringify = stringify;
41948
+ exports.stringify = stringify2;
41944
41949
  }
41945
41950
  });
41946
41951
 
@@ -43651,7 +43656,7 @@ var require_public_api = __commonJS({
43651
43656
  }
43652
43657
  return doc;
43653
43658
  }
43654
- function parse4(src, reviver, options) {
43659
+ function parse5(src, reviver, options) {
43655
43660
  let _reviver = void 0;
43656
43661
  if (typeof reviver === "function") {
43657
43662
  _reviver = reviver;
@@ -43670,7 +43675,7 @@ var require_public_api = __commonJS({
43670
43675
  }
43671
43676
  return doc.toJS(Object.assign({ reviver: _reviver }, options));
43672
43677
  }
43673
- function stringify(value, replacer, options) {
43678
+ function stringify2(value, replacer, options) {
43674
43679
  let _replacer = null;
43675
43680
  if (typeof replacer === "function" || Array.isArray(replacer)) {
43676
43681
  _replacer = replacer;
@@ -43692,10 +43697,10 @@ var require_public_api = __commonJS({
43692
43697
  return value.toString(options);
43693
43698
  return new Document.Document(value, _replacer, options).toString(options);
43694
43699
  }
43695
- exports.parse = parse4;
43700
+ exports.parse = parse5;
43696
43701
  exports.parseAllDocuments = parseAllDocuments;
43697
43702
  exports.parseDocument = parseDocument3;
43698
- exports.stringify = stringify;
43703
+ exports.stringify = stringify2;
43699
43704
  }
43700
43705
  });
43701
43706
 
@@ -43989,7 +43994,7 @@ var GUIDE_TOPICS;
43989
43994
  var init_guide_topics = __esm({
43990
43995
  "../cli/src/lib/shared/guide-topics.ts"() {
43991
43996
  "use strict";
43992
- GUIDE_TOPICS = ["board", "writing", "add-task", "follow-up", "discuss-goal", "troubleshoot", "card-chat", "update-studio", "implement", "settle-background", "archive", "update-questions", "refine", "revise", "resolve", "prune-memory", "review-memory", "describe-project", "review-rejections", "reflect", "write-agent", "write-prompt", "module-map"];
43997
+ GUIDE_TOPICS = ["board", "writing", "add-task", "follow-up", "discuss-goal", "troubleshoot", "card-chat", "task-ui-en", "task-ui-zh", "update-studio", "implement", "settle-background", "archive", "update-questions", "refine", "revise", "resolve", "prune-memory", "review-memory", "describe-project", "review-rejections", "reflect", "write-agent", "write-prompt", "module-map"];
43993
43998
  }
43994
43999
  });
43995
44000
 
@@ -44226,7 +44231,7 @@ function heldStudioName(name) {
44226
44231
  }
44227
44232
  function saveVersion(held4) {
44228
44233
  const file2 = versionFile(held4.id, held4.version);
44229
- if (!fs32.existsSync(file2)) writeJson(file2, { id: held4.id, version: held4.version, name: held4.name, names: held4.names, files: held4.files });
44234
+ writeJson(file2, { id: held4.id, version: held4.version, name: held4.name, names: held4.names, files: held4.files });
44230
44235
  }
44231
44236
  function savePin(task, held4) {
44232
44237
  saveVersion(held4);
@@ -44259,14 +44264,24 @@ async function versionOf(id2, version2) {
44259
44264
  return read5;
44260
44265
  }
44261
44266
  async function pinTask(task) {
44262
- const pin = readPin(task);
44263
- const held4 = pin && readVersion(pin.studio, pin.version);
44264
- if (held4 && "def" in parseStudioFile("studio", held4.files["STUDIO.md"] ?? "", "STUDIO.md")) return { ok: true, value: held4 };
44267
+ const cached3 = sessionTaskStudios.get(task);
44268
+ if (cached3) return { ok: true, value: cached3 };
44265
44269
  const read5 = await call("GET", `/v1/tasks/${encodeURIComponent(task)}/studio`);
44266
44270
  if (!read5.ok) return read5;
44267
- if (!hasText(read5.value.studio) || !isStudioVersion(read5.value.version) || !isStudioFiles(read5.value.files)) return invalid("the task\u2019s Studio version");
44268
- const value = { id: read5.value.studio, version: read5.value.version, name: read5.value.name, files: read5.value.files, historicalPreviews: read5.value.historicalPreviews };
44271
+ if (read5.value.deleted) {
44272
+ const pin = readPin(task);
44273
+ const held4 = pin && readVersion(pin.studio, pin.version);
44274
+ if (held4) {
44275
+ sessionTaskStudios.set(task, held4);
44276
+ return { ok: true, value: held4 };
44277
+ }
44278
+ return invalid("the task\u2019s Studio");
44279
+ }
44280
+ if (!hasText(read5.value.studio) || !isStudioFiles(read5.value.files)) return invalid("the task\u2019s Studio");
44281
+ const version2 = isStudioVersion(read5.value.version) ? read5.value.version : 1;
44282
+ const value = { id: read5.value.studio, version: version2, name: read5.value.name, files: read5.value.files, historicalPreviews: read5.value.historicalPreviews };
44269
44283
  savePin(task, value);
44284
+ sessionTaskStudios.set(task, value);
44270
44285
  return { ok: true, value };
44271
44286
  }
44272
44287
  async function syncStudios(force = false) {
@@ -44368,7 +44383,7 @@ function taskHistoricalPreviews() {
44368
44383
  const task = workspaceTask();
44369
44384
  return task ? Object.keys(readPin(task)?.historicalPreviews ?? {}) : [];
44370
44385
  }
44371
- var DEV, FRESH_MS, root, safe, versionFile, listFile, pinFile, readVersion, readPin, boardProject, devFolder, NEEDS_CLOUD, NOT_DOWNLOADED, verification, studioVerification, isStudioVersion, flowOf, sources, flows, cloudStudioSources, cloudFlows;
44386
+ var DEV, FRESH_MS, root, safe, versionFile, listFile, pinFile, readVersion, readPin, boardProject, devFolder, NEEDS_CLOUD, NOT_DOWNLOADED, verification, studioVerification, isStudioVersion, sessionTaskStudios, flowOf, sources, flows, cloudStudioSources, cloudFlows;
44372
44387
  var init_cloud_studios = __esm({
44373
44388
  "../cli/src/lib/agent/cloud-studios.ts"() {
44374
44389
  "use strict";
@@ -44398,6 +44413,7 @@ var init_cloud_studios = __esm({
44398
44413
  verification = { cached: false };
44399
44414
  studioVerification = () => verification;
44400
44415
  isStudioVersion = (value) => typeof value === "number" && Number.isSafeInteger(value) && value > 0;
44416
+ sessionTaskStudios = /* @__PURE__ */ new Map();
44401
44417
  flowOf = (held4) => {
44402
44418
  const id2 = studioName(held4.id);
44403
44419
  const read5 = parseStudioFile(id2, held4.files["STUDIO.md"] ?? "", `the \`${id2}\` studio`);
@@ -44547,10 +44563,10 @@ var init_flows = __esm({
44547
44563
  description: "the runtime to run on, for this run only (default: the flow's own agent's)"
44548
44564
  };
44549
44565
  CARRY_OPTIONS = [
44550
- { flags: "--new-session", description: "start planning in a new session" },
44551
- { flags: "--session <id>", description: "the agent session to carry on, over the card's own" },
44552
- { flags: "--fork", description: "with --session: start from a copy of it" },
44553
- { flags: "--transcript <file>", description: "the discussion the card came from, read when no session is carried on" }
44566
+ { internal: true, flags: "--new-session", description: "start planning in a new session" },
44567
+ { internal: true, flags: "--session <id>", description: "the agent session to carry on, over the card's own" },
44568
+ { internal: true, flags: "--fork", description: "with --session: start from a copy of it" },
44569
+ { internal: true, flags: "--transcript <file>", description: "the discussion the card came from, read when no session is carried on" }
44554
44570
  ];
44555
44571
  FLOWS = [
44556
44572
  {
@@ -44806,7 +44822,7 @@ var init_roles = __esm({
44806
44822
  value: "auto",
44807
44823
  label: "Just do them",
44808
44824
  cost: "For speed over quality",
44809
- 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.`
44825
+ 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.`
44810
44826
  },
44811
44827
  { value: "propose", label: "Ask me first", cost: "For balancing speed and quality" },
44812
44828
  {
@@ -45358,27 +45374,18 @@ var init_launch = __esm({
45358
45374
  // ../cli/src/lib/agent/command.ts
45359
45375
  import fs36 from "node:fs";
45360
45376
  import path39 from "node:path";
45361
- function selfCommand() {
45362
- const bin = path39.resolve(path39.dirname(SELF), "..", "bin", "ai4kanban.mjs");
45363
- const file2 = fs36.existsSync(bin) ? bin : SELF;
45364
- const inside2 = rel(file2);
45365
- const shortHop = !inside2.startsWith("..") && !path39.isAbsolute(inside2) && inside2.split(/[\\/]/).length <= 3;
45366
- return `node ${shortHop ? inside2 : file2}`;
45367
- }
45368
45377
  function boardCommand() {
45369
- return pathLookup()("akb") ? "akb" : selfCommand();
45370
- }
45371
- function boardCommandFor(_cardId) {
45372
- const command = pathLookup()("akb") ? "akb" : `node ${absoluteSelf()}`;
45373
- return `${command}${BOARD_FLAG || ` --dir ${REPO_ROOT}`}`;
45374
- }
45375
- function absoluteSelf() {
45378
+ const configured = process.env.AI4KANBAN_COMMAND?.trim();
45379
+ const entry = path39.basename(process.argv[1] ?? "");
45380
+ const byPath2 = entry === "kanban.mjs" || entry === "ai4kanban.mjs";
45376
45381
  const bin = path39.resolve(path39.dirname(SELF), "..", "bin", "ai4kanban.mjs");
45377
- return fs36.existsSync(bin) ? bin : SELF;
45382
+ const file2 = fs36.existsSync(bin) ? bin : SELF;
45383
+ const program2 = configured || (!byPath2 && pathLookup()("akb") ? "akb" : `node ${shellWord(file2)}`);
45384
+ return program2 + (BOARD_FLAG || ` --dir ${shellWord(REPO_ROOT)}`);
45378
45385
  }
45379
45386
  function commandNote(command) {
45380
- if (command === "akb") return "";
45381
- return `In the guides, \`akb\` means \`${command}\` here.`;
45387
+ if (command === "akb") return "Find commands with `akb help`, then read the matching subcommand\u2019s `--help`.";
45388
+ return `Find commands with \`${command} help\`, then read the matching subcommand\u2019s \`--help\`. In guides, use \`${command}\` for \`akb\`.`;
45382
45389
  }
45383
45390
  var init_command = __esm({
45384
45391
  "../cli/src/lib/agent/command.ts"() {
@@ -46157,7 +46164,7 @@ var init_pause = __esm({
46157
46164
  count2 = (n) => `${n} open question${n === 1 ? "" : "s"}`;
46158
46165
  upper = (text5) => text5 ? text5[0].toUpperCase() + text5.slice(1) : text5;
46159
46166
  end = (text5) => /[.!?)]$/.test(text5) ? text5 : `${text5}.`;
46160
- cancelCommand = (delivery) => `${boardCommand()} raw delivery cancel ${delivery.deliveryId}`;
46167
+ cancelCommand = (delivery) => `${boardCommand()} delivery cancel ${delivery.deliveryId}`;
46161
46168
  backInMotion = (delivery) => `\`${cancelCommand(delivery)}\` ends it and leaves the branch.`;
46162
46169
  }
46163
46170
  });
@@ -46431,7 +46438,7 @@ function resumeRefusal(delivery, store) {
46431
46438
  const live = store ?? readStore();
46432
46439
  const holder = activeIn(live, delivery.cardId);
46433
46440
  if (holder && holder.deliveryId !== id2) {
46434
- const command = `${boardCommand()} raw delivery cancel ${holder.deliveryId}`;
46441
+ const command = `${boardCommand()} delivery cancel ${holder.deliveryId}`;
46435
46442
  return refusal(
46436
46443
  "deliveryHeld",
46437
46444
  `delivery ${holder.deliveryId} is building #${card} now \u2014 end that one first with \`${command}\`.`,
@@ -46639,9 +46646,9 @@ function heldByDelivery(cardId2, program2) {
46639
46646
  if (insideDelivery(cardId2)) return void 0;
46640
46647
  const cmd = program2 ?? boardCommand();
46641
46648
  const state = deliveryState(delivery, openQuestions(cardId2));
46642
- const answer2 = `Answer it with \`${cmd} raw card resolve ${cardId2}\`.`;
46649
+ const answer2 = `Answer it with \`${cmd} task resolve ${cardId2}\`.`;
46643
46650
  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 `;
46644
- return `delivery ${delivery.deliveryId} ${doing}Discard on the card page, or \`${cmd} raw delivery cancel ${delivery.deliveryId}\` to end it here.`;
46651
+ return `delivery ${delivery.deliveryId} ${doing}Discard on the card page, or \`${cmd} delivery cancel ${delivery.deliveryId}\` to end it here.`;
46645
46652
  }
46646
46653
  var auditPath, activeAudits, auditRow, lastSessionRunning, localAudit, unknownDelivery, isResumable, cardStatus, openQuestions, activeIn, listDeliveries, withStudio;
46647
46654
  var init_deliveries = __esm({
@@ -47464,7 +47471,7 @@ var init_Storyboard = __esm({
47464
47471
  var Studio_default;
47465
47472
  var init_Studio = __esm({
47466
47473
  "../cli/src/components/Studio.md"() {
47467
- 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';
47474
+ 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';
47468
47475
  }
47469
47476
  });
47470
47477
 
@@ -47584,7 +47591,6 @@ var init_studio_shared = __esm({
47584
47591
  init_memory();
47585
47592
  init_paths();
47586
47593
  init_studio_files();
47587
- init_command();
47588
47594
  init_cloud_studios();
47589
47595
  }
47590
47596
  });
@@ -47599,7 +47605,7 @@ function stopReason(deliveryId) {
47599
47605
  const ids = new Set(delivery.sessions);
47600
47606
  const last = readRuns().filter((r) => ids.has(r.sessionId) && r.action === "implement" && r.status !== "running").at(-1);
47601
47607
  if (!last) return void 0;
47602
- if (last.status === "done" && delivery.status === "active") return notCompletedWhy(deliveryId);
47608
+ if (last.status === "done" && delivery.status === "active") return notCompletedWhy(deliveryId, boardCommand());
47603
47609
  if (last.status === "error" || last.status === "interrupted") return firstLine(last.error);
47604
47610
  return void 0;
47605
47611
  }
@@ -47609,7 +47615,7 @@ function resumePrompt(deliveryId, action) {
47609
47615
  }
47610
47616
  function deliveryRequirements(deliveryId, cardId2) {
47611
47617
  if (cardId2 !== null) {
47612
- return DELIVERY_RESUME_CARD.replace("%c", `${boardCommandFor(cardId2)} raw card implement ${cardId2} --print`);
47618
+ return DELIVERY_RESUME_CARD.replace("%c", `${boardCommand()} task implement ${cardId2} --print`);
47613
47619
  }
47614
47620
  const delivery = findDelivery(deliveryId);
47615
47621
  const approved = delivery?.approved.trim();
@@ -47626,6 +47632,7 @@ function restartPrompt(req, deliveryId) {
47626
47632
  if (deliveryId && req.action === "implement") return [
47627
47633
  RESTART_LEAD,
47628
47634
  `Continue delivery ${deliveryId}. ${deliveryRequirements(deliveryId, req.id ?? null)}`.trim(),
47635
+ commandNote(boardCommand()),
47629
47636
  studioRulesBlock({ ...req, deliveryId })
47630
47637
  ].filter(Boolean).join("\n\n");
47631
47638
  if (!RESTARTABLE.has(req.action)) return void 0;
@@ -47633,7 +47640,7 @@ function restartPrompt(req, deliveryId) {
47633
47640
  }
47634
47641
  function buildAsk(rawReq, notes = []) {
47635
47642
  const req = withStudio(rawReq);
47636
- const command = DELIVERY_FLOWS.has(req.action) ? boardCommandFor(req.id) : boardCommand();
47643
+ const command = boardCommand();
47637
47644
  const ask2 = [actionPrompt(req, command, notes), pictureNote(req), commandNote(command)].filter(Boolean).join(" ");
47638
47645
  return realPaths(boardText([ask2, componentsBlock(req)].filter(Boolean).join("\n\n")), req);
47639
47646
  }
@@ -47733,7 +47740,7 @@ function buildRun(req) {
47733
47740
  function answeredNote(cardId2, command) {
47734
47741
  const delivery = cardId2 === void 0 ? void 0 : activeDelivery(cardId2);
47735
47742
  if (!delivery) return "";
47736
- 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.`;
47743
+ 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.`;
47737
47744
  }
47738
47745
  function carriedNote(req) {
47739
47746
  if (req.action === "implement") {
@@ -47804,7 +47811,7 @@ function actionPrompt(req, command, notes) {
47804
47811
  case "review-memory":
47805
47812
  return [
47806
47813
  `Review what this board's conversations settled and write it into memory, following \`akb guide review-memory\`.`,
47807
- req.tasks?.length ? `The conversations are the ones \`${command} raw memory review --task ${req.tasks.join(" ")} --print\` prints.` : ""
47814
+ req.tasks?.length ? `The conversations are the ones \`${command} memory review --task ${req.tasks.join(" ")} --print\` prints.` : ""
47808
47815
  ].filter(Boolean).join(" ");
47809
47816
  // The dismissal review (#929). The flow lists the dismissals and restored ids; the guide
47810
47817
  // holds every rule.
@@ -47868,7 +47875,6 @@ var init_prompts = __esm({
47868
47875
  init_facts();
47869
47876
  init_outputs();
47870
47877
  init_archive();
47871
- init_flows();
47872
47878
  init_resolve();
47873
47879
  init_runner();
47874
47880
  init_studio_shared();
@@ -50545,12 +50551,12 @@ function validateSpec(file2, text5, id2) {
50545
50551
  if (!fields2.has(key)) add2(1, "missing-field", `Missing ${key}: in frontmatter. Restore it with the board's metadata commands.`);
50546
50552
  }
50547
50553
  const { meta: meta3 } = parseFrontmatter(text5);
50548
- 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.");
50554
+ 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.");
50549
50555
  for (const key of ["priority", "status"]) {
50550
50556
  const allowed2 = key === "status" ? STATUSES : LEVELS;
50551
50557
  const value = fields2.get(key);
50552
50558
  if (value && !allowed2.includes(value.value.replace(/^['"]|['"]$/g, ""))) {
50553
- add2(value.line, key, `Invalid ${key} ${JSON.stringify(value.value)}. Expected ${allowed2.join(", ")}; use akb raw update.`);
50559
+ add2(value.line, key, `Invalid ${key} ${JSON.stringify(value.value)}. Expected ${allowed2.join(", ")}; use akb task update.`);
50554
50560
  }
50555
50561
  }
50556
50562
  const approved = fields2.get("preview_approved");
@@ -50577,12 +50583,12 @@ function validateSpec(file2, text5, id2) {
50577
50583
  if (key === "blocked_by") {
50578
50584
  const groups = enclosingGroups(file2);
50579
50585
  for (const g of groups.filter((g2) => values.includes(String(g2)))) {
50580
- 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.`);
50586
+ 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.`);
50581
50587
  }
50582
50588
  if (id2 !== void 0 && groups.length) {
50583
50589
  for (const dep of values.filter((v) => /^\d+$/.test(v) && !groups.includes(Number(v))).map(Number)) {
50584
50590
  const cycle = dependencyCycle(id2, dep);
50585
- 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.`);
50591
+ 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>.`);
50586
50592
  }
50587
50593
  }
50588
50594
  }
@@ -50782,7 +50788,7 @@ function validateStoryboards(file2, id2, text5) {
50782
50788
  const dir = path55.join(ASSETS, String(id2));
50783
50789
  for (const [tag, tagOf, rule, fix] of [
50784
50790
  ["Storyboard", storyboardTag, "storyboard-src", "Write the JSON there or fix the path."],
50785
- ["Studio", studioTag, "studio-src", "Write it with `akb raw studio diagram <studio id> <card id>` or fix the path."]
50791
+ ["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."]
50786
50792
  ]) {
50787
50793
  for (const marker of storyboardMarkers(text5, tagOf)) {
50788
50794
  const named2 = assetName(marker.src, id2, ["json"]);
@@ -51006,7 +51012,7 @@ function validateCreate(opts) {
51006
51012
  }
51007
51013
  function cmdCreate(opts) {
51008
51014
  const { title, priority, blocked_by, related, modules, triage, studio, previews, source: source2, questions, written } = validateCreate(opts);
51009
- 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" });
51015
+ 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" });
51010
51016
  const start = opts.id;
51011
51017
  const slug = slugify2(opts.slug !== void 0 ? opts.slug : title);
51012
51018
  const fileRel = `${start}-${slug}.md`;
@@ -51077,7 +51083,7 @@ function cmdUpdate(id2, flags) {
51077
51083
  if (!found2) die(`no task with id ${id2} under ${rel(TODO)}`, { kind: "card-not-found", id: id2 });
51078
51084
  const file2 = found2.kind === "group" ? path57.join(found2.target, "root.md") : found2.target;
51079
51085
  const { meta: meta3, body } = parseFrontmatter(fs53.readFileSync(file2, "utf8"));
51080
- if (!meta3) die(`${rel(file2)} has no frontmatter \u2014 recreate it with \`akb raw create\``);
51086
+ if (!meta3) die(`${rel(file2)} has no frontmatter \u2014 restore this card from its last valid version`);
51081
51087
  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");
51082
51088
  if (flags.related !== void 0 && flags.addRelated !== void 0) die("--related replaces the list and --add-related appends to it \u2014 pass one");
51083
51089
  if (flags.source !== void 0 && flags.addSource !== void 0) die("--source replaces the list and --add-source appends to it \u2014 pass one");
@@ -51177,7 +51183,7 @@ function updateCardQuestions(id2, ops, compatibility = false) {
51177
51183
  if (!found2) die(`no task with id ${id2} under ${rel(TODO)}`, { kind: "card-not-found", id: id2 });
51178
51184
  const file2 = found2.kind === "group" ? path57.join(found2.target, "root.md") : found2.target;
51179
51185
  const { meta: meta3, body } = parseFrontmatter(fs53.readFileSync(file2, "utf8"));
51180
- if (!meta3) die(`${rel(file2)} has no frontmatter \u2014 recreate it with \`akb raw create\``);
51186
+ if (!meta3) die(`${rel(file2)} has no frontmatter \u2014 restore this card from its last valid version`);
51181
51187
  for (const op of ops) {
51182
51188
  if (!compatibility || !op.question?.agent) continue;
51183
51189
  const agent = findSpecAgent(op.question.agent);
@@ -51236,7 +51242,7 @@ var init_card = __esm({
51236
51242
  var config_default;
51237
51243
  var init_config2 = __esm({
51238
51244
  "../cli/src/templates/config.md"() {
51239
- 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";
51245
+ 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";
51240
51246
  }
51241
51247
  });
51242
51248
 
@@ -56192,23 +56198,27 @@ function movedTo(word, program2) {
56192
56198
  function unknownWord(message) {
56193
56199
  return /unknown command '([^']+)'/.exec(message)?.[1] ?? "";
56194
56200
  }
56195
- var RAW_GROUPS, MOVED;
56201
+ var MOVED;
56196
56202
  var init_moved = __esm({
56197
56203
  "../cli/src/lib/cli/moved.ts"() {
56198
56204
  "use strict";
56199
- init_flows();
56200
- RAW_GROUPS = ["card", "delivery", "run", "triage", "previews", "components", "agent", "review-dismissals", "describe-project", "reflect"];
56201
56205
  MOVED = {
56202
- ...Object.fromEntries(FLOWS.filter((flow) => !flow.internal).map((flow) => [flow.command, `raw ${flowPath(flow)}`])),
56203
- ...Object.fromEntries(RAW_GROUPS.map((word) => [word, `raw ${word}`])),
56204
- create: "raw create",
56205
- runs: "raw run list",
56206
- log: "raw run log",
56207
- stop: "raw run stop",
56208
- resume: "raw run resume",
56209
- cancel: "raw delivery cancel",
56210
- discard: "raw delivery cancel",
56211
- board: "raw",
56206
+ card: "task --help",
56207
+ create: "task create",
56208
+ refine: "task refine",
56209
+ revise: "task revise",
56210
+ resolve: "task resolve",
56211
+ implement: "task implement",
56212
+ approve: "task approve",
56213
+ previews: "studio previews",
56214
+ "review-memory": "memory review",
56215
+ "describe-project": "memory describe-project",
56216
+ runs: "run list",
56217
+ log: "run log",
56218
+ stop: "run stop",
56219
+ resume: "run resume",
56220
+ cancel: "delivery cancel",
56221
+ discard: "delivery cancel",
56212
56222
  version: "--version"
56213
56223
  };
56214
56224
  }
@@ -56383,6 +56393,99 @@ var init_shared_memory = __esm({
56383
56393
  }
56384
56394
  });
56385
56395
 
56396
+ // ../cli/src/lib/shared/coding-previews.ts
56397
+ var CODING_PREVIEWS;
56398
+ var init_coding_previews = __esm({
56399
+ "../cli/src/lib/shared/coding-previews.ts"() {
56400
+ "use strict";
56401
+ CODING_PREVIEWS = {
56402
+ "tech-stack-advisor": "tech-choices",
56403
+ "email-planner": "emails",
56404
+ "ui-designer": "ui-design",
56405
+ "api-designer": "api-docs",
56406
+ "schema-designer": "schema",
56407
+ "prompt-writer": "prompts",
56408
+ "competitor-research": "competitor-research"
56409
+ };
56410
+ }
56411
+ });
56412
+
56413
+ // ../cli/src/lib/shared/studio-migration.ts
56414
+ function migrateTask(body, previews, ids, historical = {}) {
56415
+ historical = { ...historical };
56416
+ const historicalId = (name) => {
56417
+ const id2 = `historical-${name}`;
56418
+ if (Object.values(ids).includes(id2)) throw Error(`Historical Preview ${name} collides with defined Preview ${id2}`);
56419
+ return id2;
56420
+ };
56421
+ for (const name of previews) if (!ids[name] && !Object.values(ids).includes(name) && !Object.hasOwn(historical, name)) historical[historicalId(name)] ??= { title: { en: name } };
56422
+ const marker = agentSectionOffset(body);
56423
+ const head2 = body.slice(0, marker), tail = body.slice(marker);
56424
+ const headings = [...withoutCode(head2).matchAll(/^##[ \t]+[^\n]*$/gm)];
56425
+ const groups = /* @__PURE__ */ new Map(), chunks = [];
56426
+ let at = 0;
56427
+ for (let n = 0; n < headings.length; n++) {
56428
+ const heading = headings[n], name = /^##[ \t]+By[ \t]+`([^`]+)`[ \t]+agent[ \t]*$/.exec(head2.slice(heading.index, heading.index + heading[0].length))?.[1];
56429
+ if (!name) continue;
56430
+ const end2 = headings[n + 1]?.index ?? head2.length;
56431
+ const id2 = ids[name] ?? historicalId(name);
56432
+ if (!ids[name]) historical[id2] ??= { title: { en: name } };
56433
+ const result = head2.slice(heading.index + heading[0].length, end2).trim();
56434
+ if (!result) continue;
56435
+ chunks.push({ text: head2.slice(at, heading.index) });
56436
+ const parts = groups.get(id2) ?? [];
56437
+ if (!groups.has(id2)) chunks.push({ text: `\0${id2}\0` });
56438
+ parts.push(result);
56439
+ groups.set(id2, parts);
56440
+ at = end2;
56441
+ }
56442
+ chunks.push({ text: head2.slice(at) });
56443
+ const migrated = chunks.map((c) => c.text.replace(/\u0000([^\u0000]+)\u0000/g, (_, id2) => `<Preview id="${id2}">
56444
+
56445
+ ${groups.get(id2).join("\n\n")}
56446
+
56447
+ </Preview>
56448
+
56449
+ `)).join("") + tail;
56450
+ const parsed = parsePreviewBlocks(migrated);
56451
+ if (parsed.problems.length) throw Error(parsed.problems.map((p) => p.message).join("; "));
56452
+ return { body: migrated, previews: [...new Set(previews.map((p) => ids[p] ?? (historical[`historical-${p}`] ? `historical-${p}` : p)))], historical };
56453
+ }
56454
+ function migrateHistoricalArchive(content, base) {
56455
+ const roleHeading = /^##[ \t]+By[ \t]+[^\n]*agent[ \t]*$/gm;
56456
+ if (content.search(roleHeading) < 0) return content;
56457
+ const original = parseFrontmatter(content).meta?.studio;
56458
+ const target = base ? parseFrontmatter(base).meta?.studio : void 0;
56459
+ if ([original, target].some((id2) => id2 && id2 !== "coding")) return content;
56460
+ const headings = [...withoutCode(content).matchAll(roleHeading)];
56461
+ if (!headings.length) return content;
56462
+ const ids = new Set(base ? parsePreviewBlocks(base).blocks.map((block) => block.id) : []);
56463
+ if (!ids.size && original !== "coding") return content;
56464
+ if (headings.some(({ index, 0: line }) => {
56465
+ const name = /^##[ \t]+By[ \t]+`([^`]+)`[ \t]+agent[ \t]*$/.exec(content.slice(index, index + line.length))?.[1];
56466
+ return !name || !Object.hasOwn(CODING_PREVIEWS, name) || !!ids.size && !ids.has(CODING_PREVIEWS[name]);
56467
+ })) return content;
56468
+ try {
56469
+ const migrated = migrateTask(content, [], CODING_PREVIEWS).body;
56470
+ if (withoutCode(migrated).search(roleHeading) < 0) return migrated;
56471
+ } catch {
56472
+ }
56473
+ return content;
56474
+ }
56475
+ var import_yaml9;
56476
+ var init_studio_migration = __esm({
56477
+ "../cli/src/lib/shared/studio-migration.ts"() {
56478
+ "use strict";
56479
+ init_frontmatter();
56480
+ import_yaml9 = __toESM(require_dist(), 1);
56481
+ init_parse3();
56482
+ init_studio_def();
56483
+ init_preview_blocks();
56484
+ init_coding_previews();
56485
+ init_coding_previews();
56486
+ }
56487
+ });
56488
+
56386
56489
  // ../cli/src/lib/shared/board-conflicts.ts
56387
56490
  import crypto4 from "node:crypto";
56388
56491
  import fs65 from "node:fs";
@@ -56467,7 +56570,7 @@ function conflictPrompt(board2, work = "Continue the original work from its save
56467
56570
  const records = conflictList(board2);
56468
56571
  return records.length ? [
56469
56572
  "Resolve these saved board content conflicts using `akb guide resolve-conflict` before continuing.",
56470
- ...records.map((r) => `${r.id}: ${r.paths.join(", ")}; read with akb raw conflict show ${r.id}.`),
56573
+ ...records.map((r) => `${r.id}: ${r.paths.join(", ")}; read with akb board conflict show ${r.id}.`),
56471
56574
  work
56472
56575
  ].join("\n") : "";
56473
56576
  }
@@ -56486,7 +56589,7 @@ async function withSyncLock(board2, work) {
56486
56589
  }
56487
56590
  }
56488
56591
  function refuse(record2, message, kind = "conflict") {
56489
- throw new BoardError(message, { kind, id: record2.id, read: `akb raw conflict show ${record2.id}` });
56592
+ throw new BoardError(message, { kind, id: record2.id, read: `akb board conflict show ${record2.id}` });
56490
56593
  }
56491
56594
  function resolutionOf(record2, value) {
56492
56595
  if (!value || typeof value !== "object" || Object.keys(value).join() !== "files" || !Array.isArray(value.files)) refuse(record2, 'Expected {"files":[{"path":"...","content":"..."}]} .', "invalid-usage");
@@ -56501,7 +56604,7 @@ function resolutionOf(record2, value) {
56501
56604
  if (saved.remote.content === null && saved.base.content !== null && f.content !== null && (numberOfCard(f.path) !== null || f.path.startsWith("triage/"))) refuse(record2, `This path was removed or moved: ${f.path}. Preserve the local draft outside the board.`, "cloud-refused");
56502
56605
  if (numberOfCard(f.path) !== null && f.content !== null) {
56503
56606
  const front = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(f.content)?.[1];
56504
- const parsed = (0, import_yaml9.parseDocument)(front ?? "");
56607
+ const parsed = (0, import_yaml10.parseDocument)(front ?? "");
56505
56608
  const fields2 = parsed.toJS();
56506
56609
  if (!front || parsed.errors.length || !fields2 || typeof fields2.title !== "string" || ["title", "priority", "status", "blocked_by", "related", "modules", "questions"].some((key) => !(key in fields2)) || ["blocked_by", "related", "modules", "questions"].some((key) => !Array.isArray(fields2[key])) || fields2.modules.some((v) => typeof v !== "string") || ["blocked_by", "related"].some((key) => fields2[key].some((v) => !Number.isSafeInteger(v) || Number(v) < 1))) refuse(record2, `Invalid card metadata: ${f.path}`, "invalid-usage");
56507
56610
  const meta3 = parseFrontmatter(f.content).meta;
@@ -56608,9 +56711,15 @@ async function resolveConflict(board2, project2, id2, expect, value, transport)
56608
56711
  save2(board2, r);
56609
56712
  refuse(r, "Another batch member changed locally. Read the conflict again.");
56610
56713
  }
56611
- const writes = r.files.map((f) => ({ path: f.remotePath, content: files.some((v) => v.path === f.path) ? files.find((v) => v.path === f.path).content : f.automatic ? f.automatic.content : f.local.content, base_seq: f.remote.seq }));
56714
+ const writes = r.files.map((f) => {
56715
+ const result = files.find((v) => v.path === f.path);
56716
+ const content = result ? result.content : f.automatic ? f.automatic.content : f.local.content;
56717
+ return { path: f.remotePath, base_seq: f.remote.seq, content: content !== null && f.path.startsWith(".archive/") && numberOfCard(f.path) !== null ? migrateHistoricalArchive(content, f.remote.content ?? f.base.content ?? void 0) : content };
56718
+ });
56612
56719
  r.draft = { revision: expect, files, working, writes };
56613
56720
  save2(board2, r);
56721
+ const oversized = writes.find((w) => w.content !== null && Buffer.byteLength(w.content) > BOARD_FILE_LIMIT);
56722
+ if (oversized) refuse(r, `${oversized.path} exceeds the board file limit.`, "cloud-refused");
56614
56723
  const remote2 = await transport.read(project2);
56615
56724
  if (!remote2.ok) refuse(r, remote2.error, "cloud-refused");
56616
56725
  const versions = r.files.map((f) => remote2.value.files.find((v) => v.path === f.remotePath) ?? { path: f.remotePath, seq: 0, content: null });
@@ -56646,11 +56755,11 @@ async function resolveConflict(board2, project2, id2, expect, value, transport)
56646
56755
  return { id: id2, state: r.state, receipt: r.receipt };
56647
56756
  });
56648
56757
  }
56649
- var import_yaml9, digest, folder, fileOf, pendingConflicts, conflictList;
56758
+ var import_yaml10, digest, folder, fileOf, pendingConflicts, conflictList;
56650
56759
  var init_board_conflicts = __esm({
56651
56760
  "../cli/src/lib/shared/board-conflicts.ts"() {
56652
56761
  "use strict";
56653
- import_yaml9 = __toESM(require_dist(), 1);
56762
+ import_yaml10 = __toESM(require_dist(), 1);
56654
56763
  init_shared_memory();
56655
56764
  init_io();
56656
56765
  init_lock();
@@ -56658,6 +56767,7 @@ var init_board_conflicts = __esm({
56658
56767
  init_board_files();
56659
56768
  init_tasks();
56660
56769
  init_frontmatter();
56770
+ init_studio_migration();
56661
56771
  digest = (value) => crypto4.createHash("sha256").update(JSON.stringify(value)).digest("hex");
56662
56772
  folder = (board2) => path67.join(projectStateDir(board2), "conflicts");
56663
56773
  fileOf = (board2, id2) => {
@@ -56727,7 +56837,10 @@ var init_question_options = __esm({
56727
56837
  // ../cli/src/lib/cli/board.ts
56728
56838
  var board_exports = {};
56729
56839
  __export(board_exports, {
56730
- buildBoardProgram: () => buildBoardProgram
56840
+ buildBoardProgram: () => buildBoardProgram,
56841
+ createBoardCard: () => createBoardCard,
56842
+ declareBoardMoves: () => declareBoardMoves,
56843
+ withCreateOptions: () => withCreateOptions
56731
56844
  });
56732
56845
  import crypto5 from "node:crypto";
56733
56846
  import fs66 from "node:fs";
@@ -56842,13 +56955,16 @@ function unwrap(res) {
56842
56955
  if (res.ok) return res.data;
56843
56956
  throw new BoardError(res.error, res.kind === "conflict" ? { kind: "conflict" } : { kind: "refused" });
56844
56957
  }
56845
- function buildBoardProgram(cli) {
56846
- const program2 = withShared(newCommand(cli.program));
56847
- program2.description(
56848
- "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."
56849
- ).helpCommand("help [move]", "this list, or one move in full");
56850
- const move = (name) => withShared(program2.command(name));
56851
- const conflict = move("conflict").summary("read and explicitly resolve saved board content conflicts");
56958
+ function withCreateOptions(command, legacy = false) {
56959
+ 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);
56960
+ }
56961
+ async function createBoardCard(command, cli, asked = []) {
56962
+ refuseRecurring(command);
56963
+ await dispatch("create", command, [], { ...command.opts(), asked }, cli);
56964
+ }
56965
+ function declareBoardMoves(program2, cli, groups) {
56966
+ const move = (name, parent = program2) => withShared(parent.command(name));
56967
+ const conflict = move("conflict", groups?.board).summary("read and explicitly resolve saved board content conflicts");
56852
56968
  withShared(conflict.command("list")).summary("list pending local conflicts without contacting Cloud").action(async function() {
56853
56969
  await dispatch("conflict-list", this, [], this.opts(), cli);
56854
56970
  });
@@ -56858,42 +56974,28 @@ function buildBoardProgram(cli) {
56858
56974
  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) {
56859
56975
  await dispatch("conflict-resolve", this, [id2], this.opts(), cli);
56860
56976
  });
56861
- const asked = [];
56862
- const inOrder = ordered(asked);
56863
- move("create").summary("write exactly one card \u2014 its fields, its body template and its index entry").description(
56864
- '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'
56865
- ).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() {
56866
- refuseRecurring(this);
56867
- await dispatch("create", this, [], { ...this.opts(), asked }, cli);
56868
- });
56869
- move("update").argument("<id>", ID, cardId).summary("rewrite a card's fields").description(
56977
+ const update2 = move("update", groups?.task).argument("<id>", ID, cardId).summary("rewrite a card's fields").description(
56870
56978
  "Rewrite a card's frontmatter fields. --slug renames it. Body and questions are left untouched \u2014 those have their own moves."
56871
- ).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) {
56979
+ ).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) {
56872
56980
  refuseRecurring(this);
56873
56981
  await dispatch("update", this, [String(id2)], this.opts(), cli);
56874
56982
  });
56875
- const questionOps = [];
56876
- 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) {
56877
- await dispatch("update-questions", this, [String(id2)], { ops: questionOps }, cli);
56878
- });
56879
- move("inspect").argument("<id>", ID, cardId).summary("read task facts, saved work and execution references").action(async function(id2) {
56983
+ if (!groups) update2.option("--previews <ids>", 'the Preview IDs chosen from its Studio; "" chooses none', collectList);
56984
+ move("inspect", groups?.task).argument("<id>", ID, cardId).summary("read task facts, saved work and execution references").action(async function(id2) {
56880
56985
  await dispatch("inspect", this, [String(id2)], this.opts(), cli);
56881
56986
  });
56882
- 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) {
56987
+ 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) {
56883
56988
  await dispatch("validate", this, id2 === void 0 ? [] : [String(id2)], this.opts(), cli);
56884
56989
  });
56885
- 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) {
56990
+ 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) {
56886
56991
  await dispatch("file", this, [studio, file2], this.opts(), cli);
56887
56992
  });
56888
- withShared(program2.command("agent-file", { hidden: true })).argument("<agent>").argument("<path>").action(async function(agent, file2) {
56889
- await dispatch("agent-file", this, [agent, file2], this.opts(), cli);
56890
- });
56891
- move("memory-file").argument("<name>", "the global memory").summary("print one global memory's rules, its MEMORY.md").description(
56993
+ move(groups ? "file" : "memory-file", groups?.memory).argument("<name>", "the global memory").summary("print one global memory's rules, its MEMORY.md").description(
56892
56994
  "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."
56893
56995
  ).action(async function(name) {
56894
56996
  await dispatch("memory-file", this, [name], this.opts(), cli);
56895
56997
  });
56896
- move("list").summary("the open cards: id, title, meta, summary, path \u2014 or, with --archived, the cards that landed").description(
56998
+ move("list", groups?.board).summary("the open cards: id, title, meta, summary, path \u2014 or, with --archived, the cards that landed").description(
56897
56999
  "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."
56898
57000
  ).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(
56899
57001
  "--since <time>",
@@ -56901,6 +57003,28 @@ function buildBoardProgram(cli) {
56901
57003
  ).option("--studio <id>", "with --archived: only the cards of that studio").action(async function() {
56902
57004
  await dispatch("list", this, [], this.opts(), cli);
56903
57005
  });
57006
+ }
57007
+ function buildBoardProgram(cli) {
57008
+ const program2 = withShared(newCommand(cli.program));
57009
+ program2.description(
57010
+ "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."
57011
+ ).helpCommand("help [move]", "this list, or one move in full");
57012
+ const move = (name) => withShared(program2.command(name));
57013
+ declareBoardMoves(program2, cli);
57014
+ const asked = [];
57015
+ const inOrder = ordered(asked);
57016
+ withCreateOptions(move("create"), true).summary("write exactly one card \u2014 its fields, its body template and its index entry").description(
57017
+ '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'
57018
+ ).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() {
57019
+ await createBoardCard(this, cli, asked);
57020
+ });
57021
+ const questionOps = [];
57022
+ 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) {
57023
+ await dispatch("update-questions", this, [String(id2)], { ops: questionOps }, cli);
57024
+ });
57025
+ withShared(program2.command("agent-file", { hidden: true })).argument("<agent>").argument("<path>").action(async function(agent, file2) {
57026
+ await dispatch("agent-file", this, [agent, file2], this.opts(), cli);
57027
+ });
56904
57028
  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) {
56905
57029
  await dispatch("reject", this, [String(id2)], this.opts(), cli);
56906
57030
  });
@@ -57054,16 +57178,19 @@ async function runBoard(argv, options = {}) {
57054
57178
  const { runProgram: runProgram2 } = await Promise.resolve().then(() => (init_shared2(), shared_exports));
57055
57179
  return runProgram2(buildBoardProgram2({ program: program2, cwd, installHint, version: version2, onAnswer }), argv, program2);
57056
57180
  }
57057
- function rawArgv(argv) {
57058
- const shared = [];
57181
+ function commandIndex(argv) {
57059
57182
  let i = 0;
57060
57183
  for (; i < argv.length; i++) {
57061
57184
  const arg = argv[i];
57062
- if (arg === "--json" || /^--(board|dir)=/.test(arg)) shared.push(arg);
57063
- else if ((arg === "--board" || arg === "--dir") && i + 1 < argv.length) shared.push(arg, argv[++i]);
57185
+ if (arg === "--json" || /^--(board|dir)=/.test(arg)) continue;
57186
+ if ((arg === "--board" || arg === "--dir") && i + 1 < argv.length) i++;
57064
57187
  else break;
57065
57188
  }
57066
- return argv[i] === "raw" ? [...shared, ...argv.slice(i + 1)] : null;
57189
+ return i;
57190
+ }
57191
+ function rawArgv(argv) {
57192
+ const i = commandIndex(argv);
57193
+ return argv[i] === "raw" ? [...argv.slice(0, i), ...argv.slice(i + 1)] : null;
57067
57194
  }
57068
57195
  function prose(box) {
57069
57196
  if (!box) return {};
@@ -57091,7 +57218,7 @@ function report(err, { program: program2, json: json2, box = null }) {
57091
57218
  }
57092
57219
  return err.exitCode;
57093
57220
  }
57094
- var MAKES_A_BOARD, hasBoard, isBoardDir, boardFromEnv;
57221
+ var MAKES_A_BOARD, hasBoard, isBoardDir, boardFromEnv, commandWord;
57095
57222
  var init_board_cli = __esm({
57096
57223
  "../cli/src/lib/board-cli.ts"() {
57097
57224
  "use strict";
@@ -57105,6 +57232,7 @@ var init_board_cli = __esm({
57105
57232
  const named2 = process.env.AI4KANBAN_BOARD?.trim();
57106
57233
  return named2 ? named2 : null;
57107
57234
  };
57235
+ commandWord = (argv) => argv[commandIndex(argv)] ?? "";
57108
57236
  }
57109
57237
  });
57110
57238
 
@@ -57675,18 +57803,25 @@ ${card.body.trim()}`);
57675
57803
  async function taskCreate(request2, opts, location = {}) {
57676
57804
  const text5 = request2.trim();
57677
57805
  if (!text5) die("Say what the task is.", { kind: "bad-args", exitCode: 2 });
57806
+ if (opts.review !== void 0 && opts.reviewFile !== void 0) die("Use either --review or --review-file.");
57678
57807
  const line = text5.split("\n")[0].trim();
57679
57808
  const title = line.length > 80 ? `${line.slice(0, 79)}\u2026` : line;
57680
57809
  const target = await project(opts.project, location);
57681
57810
  if (!opts.studio?.trim()) return refuse3("Choose --studio from akb studio list.", "no_studio");
57682
- const task = await cloud("POST", "/v1/tasks", {
57811
+ const body = {
57683
57812
  title,
57684
57813
  request: text5,
57685
57814
  project: target,
57686
57815
  studio: cloudStudio(opts.studio),
57687
57816
  source: "api",
57688
57817
  run: true
57689
- });
57818
+ };
57819
+ if (opts.review !== void 0) body.review_flow = opts.review;
57820
+ if (opts.reviewFile !== void 0) body.review_plan = parseReviewPlan(JSON.parse(fs71.readFileSync(opts.reviewFile, "utf8")));
57821
+ if (opts.previewDefinitionsFile !== void 0) {
57822
+ body.preview_definitions = previewDefinitionsSchema.parse(JSON.parse(fs71.readFileSync(opts.previewDefinitionsFile, "utf8")));
57823
+ }
57824
+ const task = await cloud("POST", "/v1/tasks", body);
57690
57825
  say(`Created ${task.key}: ${task.title} ${taskUrl(task.key)}`);
57691
57826
  say(`Status: ${task.status}${task.failure ? ` \u2014 ${task.failure}` : ""}`);
57692
57827
  return { ...task };
@@ -57984,6 +58119,24 @@ async function taskResume(id2, location = {}) {
57984
58119
  say(task.status === "queued" ? `Resume queued for ${task.key}.` : `Resumed ${task.key}.`);
57985
58120
  return { ...task };
57986
58121
  }
58122
+ async function resolveCloudRuntime(asked) {
58123
+ const value = asked.trim();
58124
+ if (!value) die("Specify a runtime id or name.", { kind: "bad-args", exitCode: 2 });
58125
+ if (value.startsWith("rt_")) return value;
58126
+ const list3 = await cloud("GET", "/v1/runtimes");
58127
+ requireResponse(list3, "a list of runtimes", (v) => Array.isArray(v.data));
58128
+ const matches = list3.data.filter((r) => r.name === value || r.default && value === "Global default");
58129
+ if (!matches.length) return refuse3(`No runtime named "${value}".`, "not_found");
58130
+ if (matches.length > 1) return refuse3(`Multiple runtimes are named "${value}". Use its rt_... id instead.`, "conflict");
58131
+ return matches[0].id;
58132
+ }
58133
+ async function taskRuntime(id2, runtime, location = {}) {
58134
+ const runtimeId = await resolveCloudRuntime(runtime);
58135
+ const ref = await taskRef(id2, location);
58136
+ const task = requireTask(await cloud("PATCH", `/v1/tasks/${enc(ref)}`, { runtime: runtimeId }));
58137
+ say(`Updated ${task.key} runtime to ${task.runtime_info?.name ?? runtimeId}.`);
58138
+ return { ...task };
58139
+ }
57987
58140
  async function taskStop(id2, location = {}) {
57988
58141
  const task = requireTask(await cloud("POST", `/v1/tasks/${enc(await taskRef(id2, location))}/stop`));
57989
58142
  requireResponse(task, "a stop receipt", (value) => ["running", "queued", "waiting_review", "stopped"].includes(value.status));
@@ -58378,13 +58531,11 @@ var init_goal_cloud = __esm({
58378
58531
  });
58379
58532
 
58380
58533
  // ../cli/src/lib/agent/manual.ts
58381
- var HELP_AFTER;
58534
+ var PRINT_FLOW_HELP, HELP_AFTER;
58382
58535
  var init_manual = __esm({
58383
58536
  "../cli/src/lib/agent/manual.ts"() {
58384
58537
  "use strict";
58385
- HELP_AFTER = {
58386
- /** Under every flow: print it, or run it. The one choice each of them has. */
58387
- flow: `
58538
+ PRINT_FLOW_HELP = `
58388
58539
  Print it, or run it
58389
58540
  --print print the flow to follow in the current session, filled in for this board:
58390
58541
  the card's own path, the steps it has left, the memory file its modules point
@@ -58393,7 +58544,8 @@ Print it, or run it
58393
58544
  (no flag) start a separate session with its own context.
58394
58545
 
58395
58546
  Inside a task session, board actions print their flows. Prepare requested Previews there.
58396
- `,
58547
+ `;
58548
+ HELP_AFTER = {
58397
58549
  /** Under `delivery`: what one is, which no verb of it says on its own. */
58398
58550
  deliveries: (program2) => `
58399
58551
  What a delivery is
@@ -61125,7 +61277,7 @@ var require_extension = __commonJS({
61125
61277
  if (dest[name] === void 0) dest[name] = [elem];
61126
61278
  else dest[name].push(elem);
61127
61279
  }
61128
- function parse4(header) {
61280
+ function parse5(header) {
61129
61281
  const offers = /* @__PURE__ */ Object.create(null);
61130
61282
  let params = /* @__PURE__ */ Object.create(null);
61131
61283
  let mustUnescape = false;
@@ -61265,7 +61417,7 @@ var require_extension = __commonJS({
61265
61417
  }).join(", ");
61266
61418
  }).join(", ");
61267
61419
  }
61268
- module.exports = { format, parse: parse4 };
61420
+ module.exports = { format, parse: parse5 };
61269
61421
  }
61270
61422
  });
61271
61423
 
@@ -61300,7 +61452,7 @@ var require_websocket = __commonJS({
61300
61452
  var {
61301
61453
  EventTarget: { addEventListener, removeEventListener }
61302
61454
  } = require_event_target();
61303
- var { format, parse: parse4 } = require_extension();
61455
+ var { format, parse: parse5 } = require_extension();
61304
61456
  var { toBuffer } = require_buffer_util();
61305
61457
  var kAborted = /* @__PURE__ */ Symbol("kAborted");
61306
61458
  var protocolVersions = [8, 13];
@@ -62000,7 +62152,7 @@ var require_websocket = __commonJS({
62000
62152
  }
62001
62153
  let extensions;
62002
62154
  try {
62003
- extensions = parse4(secWebSocketExtensions);
62155
+ extensions = parse5(secWebSocketExtensions);
62004
62156
  } catch (err) {
62005
62157
  const message = "Invalid Sec-WebSocket-Extensions header";
62006
62158
  abortHandshake(websocket, socket, message);
@@ -62308,7 +62460,7 @@ var require_subprotocol = __commonJS({
62308
62460
  "../cli/node_modules/ws/lib/subprotocol.js"(exports, module) {
62309
62461
  "use strict";
62310
62462
  var { tokenChars } = require_validation2();
62311
- function parse4(header) {
62463
+ function parse5(header) {
62312
62464
  const protocols = /* @__PURE__ */ new Set();
62313
62465
  let start = -1;
62314
62466
  let end2 = -1;
@@ -62344,7 +62496,7 @@ var require_subprotocol = __commonJS({
62344
62496
  protocols.add(protocol);
62345
62497
  return protocols;
62346
62498
  }
62347
- module.exports = { parse: parse4 };
62499
+ module.exports = { parse: parse5 };
62348
62500
  }
62349
62501
  });
62350
62502
 
@@ -63061,7 +63213,7 @@ var init_task_chat = __esm({
63061
63213
  var add_task_default;
63062
63214
  var init_add_task = __esm({
63063
63215
  "../cli/src/guide/add-task.md"() {
63064
- add_task_default = "# Add tasks\n\nCreate new work with `akb task create`; read its `--help` for options.\n\n- **Modules**: read `docs/kanban/modules.md` and relevant project context; follow\n `akb guide module-map` when no tag fits.\n\n## Group tasks\n\nUse a group when several tasks deliver one larger outcome; otherwise keep them independent.\n\n- **Creation**: create the root first, then its subtasks.\n- **Relationships**: link group members with `related`; use `blocked_by` for actual dependencies.\n- **Layout**: once their cards are prepared, place the root at `todo/<id>-<slug>/root.md`\n and the subtask files beside it; update their paths in `todo/README.md`.\n- **Tracking**: the root's `## Todo` lists its subtasks, one line each ending in `#<subid>`.\n\nFollow `akb guide writing` when editing a card.\n";
63216
+ add_task_default = '# Add tasks\n\nCreate new work with `akb task create`; read its `--help` for options. When setting `--review`, `--review-file`, or `--preview-definitions-file` on a request, follow "Preview selection" in `akb guide board`.\n\n- **Modules**: read `docs/kanban/modules.md` and relevant project context; follow\n `akb guide module-map` when no tag fits.\n\n## Group tasks\n\nUse a group when several tasks deliver one larger outcome; otherwise keep them independent.\n\n- **Creation**: create the root first, then its subtasks.\n- **Relationships**: link group members with `related`; use `blocked_by` for actual dependencies.\n- **Layout**: once their cards are prepared, place the root at `todo/<id>-<slug>/root.md`\n and the subtask files beside it; update their paths in `todo/README.md`.\n- **Tracking**: the root\'s `## Todo` lists its subtasks, one line each ending in `#<subid>`.\n\nFollow `akb guide writing` when editing a card.\n';
63065
63217
  }
63066
63218
  });
63067
63219
 
@@ -63069,7 +63221,7 @@ var init_add_task = __esm({
63069
63221
  var archive_default;
63070
63222
  var init_archive2 = __esm({
63071
63223
  "../cli/src/guide/archive.md"() {
63072
- 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";
63224
+ 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";
63073
63225
  }
63074
63226
  });
63075
63227
 
@@ -63077,7 +63229,7 @@ var init_archive2 = __esm({
63077
63229
  var board_default;
63078
63230
  var init_board3 = __esm({
63079
63231
  "../cli/src/guide/board.md"() {
63080
- 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";
63232
+ 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\n## Preview selection\n\n- **Read the Studio first**: before choosing Previews, read the target Studio's `STUDIO.md` (`akb studio file <studio> STUDIO.md`), any linked files it names, and its rules (`akb studio rule <studio>`).\n- **Built-in Previews first**: match deliverables that need review to the Studio's built-in Previews; never replace a built-in Preview with a custom one or mix a built-in Preview's deliverable into a custom Preview.\n- **Custom Previews as fallback**: define a custom Preview only when built-in Previews cannot cover a deliverable that needs review, and keep task plans and context in the card or goal body.\n";
63081
63233
  }
63082
63234
  });
63083
63235
 
@@ -63085,7 +63237,23 @@ var init_board3 = __esm({
63085
63237
  var card_chat_default;
63086
63238
  var init_card_chat = __esm({
63087
63239
  "../cli/src/guide/card-chat.md"() {
63088
- 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';
63240
+ card_chat_default = "# Answer a card's conversation\n\nWork only on unlocked stages. An empty plan needs no extra approval; an undecided plan allows planning only.\n\n- **Task and review**: read the current card or use `akb task show <id>` when needed. Use `akb task review <id>` for the full review state and snapshots, and before reporting a stage with its revision. Sync content and assets before reporting done.\n- **Studio and Previews**: when working on a draft, read `akb studio file <studio> STUDIO.md`, shared rules at `shared/RULES.md` when present, and workspace rules with `akb studio rule <studio>`. Use the relevant entries from `akb studio previews --studio <studio> --json` and read component usage with `akb raw components --studio <studio> --docs` when needed. Read only applicable files in the board\u2019s `memory/`.\n- **Button labels**: Quote current labels from the conversation verbatim. Otherwise, consult the task-page guide for the user's language (`akb guide task-ui-en` or `akb guide task-ui-zh`) and describe the action if its label is uncertain.\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";
63241
+ }
63242
+ });
63243
+
63244
+ // ../cli/src/guide/task-ui-en.md
63245
+ var task_ui_en_default;
63246
+ var init_task_ui_en = __esm({
63247
+ "../cli/src/guide/task-ui-en.md"() {
63248
+ task_ui_en_default = "# Task-page buttons\n\n- **Approve** \u2014 In the review flow when a prerequisite Preview is ready for approval. Dependent Previews can start once their prerequisites are approved.\n- **Execute** \u2014 In the header when the task is ready to run. Approves any ready independent Previews and starts execution.\n- **Stop** \u2014 In the header while a run is active and can be stopped.\n- **Resume** \u2014 In the run log for a stopped task or retryable failure when no run is active or queued.\n- **Discard run** \u2014 In the run log when a run can be discarded. Confirming deletes its changes and branch and keeps the task and plan.\n- **Restore** \u2014 In the header for completed or removed tasks with an available Studio. Returns the task to the board.\n";
63249
+ }
63250
+ });
63251
+
63252
+ // ../cli/src/guide/task-ui-zh.md
63253
+ var task_ui_zh_default;
63254
+ var init_task_ui_zh = __esm({
63255
+ "../cli/src/guide/task-ui-zh.md"() {
63256
+ task_ui_zh_default = "# Task-page buttons in Chinese\n\n- **\u6279\u51C6** \u2014 In the review flow when a prerequisite Preview is ready for approval. Dependent Previews can start once their prerequisites are approved.\n- **\u6267\u884C** \u2014 In the header when the task is ready to run. Approves any ready independent Previews and starts execution.\n- **\u505C\u6B62** \u2014 In the header while a run is active and can be stopped.\n- **\u7EE7\u7EED\u6267\u884C** \u2014 In the run log for a stopped task or retryable failure when no run is active or queued.\n- **\u4E22\u5F03\u8FD9\u6B21\u6267\u884C** \u2014 In the run log when a run can be discarded. Confirming deletes its changes and branch and keeps the task and plan.\n- **\u6062\u590D** \u2014 In the header for completed or removed tasks with an available Studio. Returns the task to the board.\n";
63089
63257
  }
63090
63258
  });
63091
63259
 
@@ -63109,7 +63277,7 @@ var init_describe_project = __esm({
63109
63277
  var discuss_goal_default;
63110
63278
  var init_discuss_goal = __esm({
63111
63279
  "../cli/src/guide/discuss-goal.md"() {
63112
- 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';
63280
+ 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; honor its rules\' scope.\n- **Select Previews**: follow "Preview selection" in `akb guide board`, defining a custom Preview with `--preview-definitions-file` when needed.\n- **Review** independent Previews in parallel by default. Use Studio or custom 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';
63113
63281
  }
63114
63282
  });
63115
63283
 
@@ -63117,7 +63285,7 @@ var init_discuss_goal = __esm({
63117
63285
  var follow_up_default;
63118
63286
  var init_follow_up = __esm({
63119
63287
  "../cli/src/guide/follow-up.md"() {
63120
- 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';
63288
+ 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';
63121
63289
  }
63122
63290
  });
63123
63291
 
@@ -63133,7 +63301,7 @@ var init_implement = __esm({
63133
63301
  var module_map_default;
63134
63302
  var init_module_map = __esm({
63135
63303
  "../cli/src/guide/module-map.md"() {
63136
- 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";
63304
+ 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";
63137
63305
  }
63138
63306
  });
63139
63307
 
@@ -63149,7 +63317,7 @@ var init_prune_memory = __esm({
63149
63317
  var review_memory_default;
63150
63318
  var init_review_memory = __esm({
63151
63319
  "../cli/src/guide/review-memory.md"() {
63152
- 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";
63320
+ 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";
63153
63321
  }
63154
63322
  });
63155
63323
 
@@ -63165,7 +63333,7 @@ var init_review_rejections = __esm({
63165
63333
  var refine_default;
63166
63334
  var init_refine = __esm({
63167
63335
  "../cli/src/guide/refine.md"() {
63168
- 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";
63336
+ 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**: follow "Preview selection" in `akb guide board`; attach any custom definition with `--preview-definitions-file`.\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';
63169
63337
  }
63170
63338
  });
63171
63339
 
@@ -63173,7 +63341,7 @@ var init_refine = __esm({
63173
63341
  var reflect_default;
63174
63342
  var init_reflect = __esm({
63175
63343
  "../cli/src/guide/reflect.md"() {
63176
- 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';
63344
+ 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';
63177
63345
  }
63178
63346
  });
63179
63347
 
@@ -63181,7 +63349,7 @@ var init_reflect = __esm({
63181
63349
  var resolve_default;
63182
63350
  var init_resolve2 = __esm({
63183
63351
  "../cli/src/guide/resolve.md"() {
63184
- 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';
63352
+ 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';
63185
63353
  }
63186
63354
  });
63187
63355
 
@@ -63189,7 +63357,7 @@ var init_resolve2 = __esm({
63189
63357
  var resolve_conflict_default;
63190
63358
  var init_resolve_conflict = __esm({
63191
63359
  "../cli/src/guide/resolve-conflict.md"() {
63192
- 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";
63360
+ 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";
63193
63361
  }
63194
63362
  });
63195
63363
 
@@ -63221,7 +63389,7 @@ var init_troubleshoot = __esm({
63221
63389
  var write_agent_default;
63222
63390
  var init_write_agent = __esm({
63223
63391
  "../cli/src/guide/write-agent.md"() {
63224
- 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";
63392
+ 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";
63225
63393
  }
63226
63394
  });
63227
63395
 
@@ -63237,7 +63405,7 @@ var init_write_prompt = __esm({
63237
63405
  var writing_default;
63238
63406
  var init_writing = __esm({
63239
63407
  "../cli/src/guide/writing.md"() {
63240
- 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';
63408
+ 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';
63241
63409
  }
63242
63410
  });
63243
63411
 
@@ -63270,6 +63438,8 @@ var init_guide = __esm({
63270
63438
  init_archive2();
63271
63439
  init_board3();
63272
63440
  init_card_chat();
63441
+ init_task_ui_en();
63442
+ init_task_ui_zh();
63273
63443
  init_update_studio();
63274
63444
  init_describe_project();
63275
63445
  init_discuss_goal();
@@ -63299,6 +63469,8 @@ var init_guide = __esm({
63299
63469
  { name: "discuss-goal", when: "help decide what is worth building, and shape it into goals to start as tasks", text: discuss_goal_default },
63300
63470
  { name: "troubleshoot", when: "\u5B9A\u4F4D\u8F6F\u4EF6\u6545\u969C\u7684\u6839\u56E0\u4E0E\u4FEE\u590D\u65B9\u5411", text: troubleshoot_default },
63301
63471
  { name: "card-chat", when: "answer a card's conversation, and act on what each turn settles", text: card_chat_default },
63472
+ { name: "task-ui-en", when: "look up task-page buttons in English", text: task_ui_en_default },
63473
+ { name: "task-ui-zh", when: "look up task-page buttons in Chinese", text: task_ui_zh_default },
63302
63474
  { name: "update-studio", when: "change one of this workspace's studios so new tasks run the new version", text: update_studio_default },
63303
63475
  { name: "implement", when: "build a settled card and stop cleanly on an execution blocker", text: implement_default },
63304
63476
  { name: "settle-background", when: "finish this task\u2019s remaining background work", text: settle_background_default },
@@ -63366,7 +63538,7 @@ function cmdStudioList() {
63366
63538
  return result;
63367
63539
  }
63368
63540
  function cmdStudioDiagram(_id, _card, _folder) {
63369
- die("Studios have no agent graph. Read STUDIO.md for instructions and Preview outputs.", "bad-args");
63541
+ die("Freeze a Studio draft with akb studio preview <card> --folder <draft> --base <baseline>.", "bad-args");
63370
63542
  }
63371
63543
  function cmdStudioValidate(folder2) {
63372
63544
  const dir = path76.resolve(folder2);
@@ -64069,7 +64241,7 @@ function readCard2(id2, home3 = "board") {
64069
64241
  const found2 = home3 === "archive" ? locateArchived(id2) : locate(id2) ?? (pending ? locateArchived(id2) : null);
64070
64242
  if (!found2) {
64071
64243
  die(
64072
- 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.`,
64244
+ 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.`,
64073
64245
  { kind: "card-not-found", id: id2 }
64074
64246
  );
64075
64247
  }
@@ -64082,7 +64254,7 @@ function readCard2(id2, home3 = "board") {
64082
64254
  }
64083
64255
  const { meta: meta3, body } = parseFrontmatter(text5);
64084
64256
  if (!meta3) {
64085
- die(`${rel(file2)} has no frontmatter \u2014 recreate it with \`akb raw create\` before working on it.`, {
64257
+ die(`${rel(file2)} has no frontmatter \u2014 restore this card from its last valid version before retrying.`, {
64086
64258
  kind: "card-unreadable",
64087
64259
  id: id2
64088
64260
  });
@@ -64158,7 +64330,7 @@ function approvedField(delivery) {
64158
64330
  }
64159
64331
  function workspaceField(delivery) {
64160
64332
  return field("workspace", [
64161
- `authorized project: ${REPO_ROOT}; board: ${boardCommandFor()}.`,
64333
+ `authorized project: ${REPO_ROOT}; board: ${boardCommand()}.`,
64162
64334
  ...delivery ? [
64163
64335
  `delivery ${delivery.deliveryId}; target branch: ${delivery.targetBranch ?? "inspect the project"}.`,
64164
64336
  `existing context: ${JSON.stringify({ worktree: delivery.worktree, branch: delivery.branch, base: delivery.base, landing: delivery.landing, completions: delivery.completions })}`,
@@ -64168,7 +64340,7 @@ function workspaceField(delivery) {
64168
64340
  }
64169
64341
  function answeringField(delivery, self) {
64170
64342
  const approved = delivery.approved.trim();
64171
- const say2 = (flag) => ` ${self} raw delivery answered ${delivery.deliveryId} ${flag}`;
64343
+ const say2 = (flag) => ` ${self} delivery answered ${delivery.deliveryId} ${flag}`;
64172
64344
  return [
64173
64345
  ...field("delivery", [
64174
64346
  `${delivery.deliveryId} is already building this card, from the copy below \u2014 frozen when it started.`,
@@ -64178,8 +64350,7 @@ function answeringField(delivery, self) {
64178
64350
  `judge the MEANING, not the words. Confirming an option that is already built, writing down a decision`,
64179
64351
  `the card already carries and tidying prose are all --unchanged. Adding, dropping or changing a`,
64180
64352
  `requirement is --changed \u2014 and so is confirming an implementation that contradicts the copy below,`,
64181
- `however finished it is.`,
64182
- `say nothing and the board carries on as --unchanged.`
64353
+ `however finished it is.`
64183
64354
  ]),
64184
64355
  ...field(
64185
64356
  "approved",
@@ -64235,8 +64406,7 @@ function conversationBlock(chat) {
64235
64406
  }
64236
64407
  function buildFlow(req, program2) {
64237
64408
  const delivery = deliveryFor(req);
64238
- const self = delivery?.worktree ? boardCommandFor(req.id) : `${program2}${BOARD_FLAG}`;
64239
- const raw = `${self} raw`;
64409
+ const self = boardCommand();
64240
64410
  const facts = [];
64241
64411
  const close = [];
64242
64412
  const next = [];
@@ -64265,11 +64435,11 @@ function buildFlow(req, program2) {
64265
64435
  ...settled ? ["honour the notes above as requirements \u2014 they are decisions already settled on this card, and nothing here reopens them"] : [],
64266
64436
  "tick each box in ## Todo as you finish it \u2014 they are the record of what was built",
64267
64437
  `record the delivered outcome and verification on the task \u2014 \`akb guide archive\``,
64268
- 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`
64438
+ 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`
64269
64439
  );
64270
64440
  if (card.meta.questions.length) {
64271
64441
  next.push(
64272
- `${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`
64442
+ `${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`
64273
64443
  );
64274
64444
  }
64275
64445
  break;
@@ -64278,7 +64448,7 @@ function buildFlow(req, program2) {
64278
64448
  facts.push(...stepsField(card), ...questionsField(card.meta));
64279
64449
  close.push(
64280
64450
  "settle and write the card as `akb guide refine` says",
64281
- `${raw} update ${req.id} --status ready \u2014 once the card validates`
64451
+ `${self} task update ${req.id} --status ready \u2014 once the card validates`
64282
64452
  );
64283
64453
  break;
64284
64454
  }
@@ -64289,7 +64459,7 @@ function buildFlow(req, program2) {
64289
64459
  facts.push(...answeringField(building, self));
64290
64460
  facts.push(...notesField(card));
64291
64461
  close.push(
64292
- answeredClose(building, self),
64462
+ "record the effect with one of the delivery answer commands above before closing the questions",
64293
64463
  "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"
64294
64464
  );
64295
64465
  } else {
@@ -64299,7 +64469,7 @@ function buildFlow(req, program2) {
64299
64469
  break;
64300
64470
  }
64301
64471
  case "approve": {
64302
- close.push(`${raw} update ${req.id} --status ready \u2014 once the card validates`);
64472
+ close.push(`${self} task update ${req.id} --status ready \u2014 once the card validates`);
64303
64473
  break;
64304
64474
  }
64305
64475
  case "edit": {
@@ -64310,7 +64480,7 @@ function buildFlow(req, program2) {
64310
64480
  ])
64311
64481
  );
64312
64482
  close.push(
64313
- `${raw} update ${req.id} [${EDITABLE_FIELDS}] \u2014 the fields are the command's, never hand-written`,
64483
+ `${self} task update --help \u2014 see the available card fields and edit the body separately`,
64314
64484
  ...bodyScaffoldClose()
64315
64485
  );
64316
64486
  break;
@@ -64394,7 +64564,7 @@ function buildFlow(req, program2) {
64394
64564
  case "reflect": {
64395
64565
  for (const id2 of reflectedCards(req)) readCard2(id2, "archive");
64396
64566
  close.push(
64397
- `${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`,
64567
+ `${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`,
64398
64568
  "propose nothing at all when nothing follows: that is a complete result, and most batches are it",
64399
64569
  "change nothing else \u2014 no card is created, edited or archived, and no memory file is written"
64400
64570
  );
@@ -64424,10 +64594,6 @@ function printFlow(rawReq, program2 = "akb") {
64424
64594
  });
64425
64595
  if (flow.next.length) sections.push({ head: "handing over \u2014 the action to reach for, and when:", lines: flow.next });
64426
64596
  say(flow.lead);
64427
- if (program2 !== "akb") {
64428
- say("");
64429
- say(`there is no \`akb\` on this machine \u2014 every \`akb\` below, in the flows too, is \`${program2}\` here.`);
64430
- }
64431
64597
  for (const section of sections) {
64432
64598
  say("");
64433
64599
  say(section.head);
@@ -64468,7 +64634,7 @@ function printFlow(rawReq, program2 = "akb") {
64468
64634
  ...rule ? { rule } : {}
64469
64635
  };
64470
64636
  }
64471
- var MAX_STEPS, indent, EDITABLE_FIELDS, bodyScaffoldClose, answeredClose, GUIDES_FOR, guidesFor;
64637
+ var MAX_STEPS, indent, bodyScaffoldClose, GUIDES_FOR, guidesFor;
64472
64638
  var init_flow = __esm({
64473
64639
  "../cli/src/lib/agent/flow.ts"() {
64474
64640
  "use strict";
@@ -64490,9 +64656,7 @@ var init_flow = __esm({
64490
64656
  init_env();
64491
64657
  MAX_STEPS = 12;
64492
64658
  indent = (line) => line.split("\n").map((l) => l.trim() ? ` ${l}` : "").join("\n");
64493
- EDITABLE_FIELDS = "--title|--priority|--modules|--blocked-by|--related";
64494
64659
  bodyScaffoldClose = (lead = "fill the existing") => [`${lead} body scaffold; do not rename or translate its section titles, and leave empty scaffold sections in place`];
64495
- 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`;
64496
64660
  GUIDES_FOR = {
64497
64661
  implement: ["board", "archive", "implement"],
64498
64662
  sub: [],
@@ -65522,8 +65686,8 @@ async function cmdStartRun(action, args2, opts, program2 = "akb") {
65522
65686
  const { run: run3, spawned } = started;
65523
65687
  if (!spawned) die(`couldn't start a process for run ${run3.sessionId}`, { kind: "spawn-failed" });
65524
65688
  say(`${action} \u2014 run ${run3.sessionId}${run3.deliveryId ? ` in delivery ${run3.deliveryId}` : ""}`);
65525
- say(` follow it: ${program2} raw run log ${short(run3.sessionId)} --follow${BOARD_FLAG}`);
65526
- say(` stop it: ${program2} raw run stop ${short(run3.sessionId)}${BOARD_FLAG}`);
65689
+ say(` follow it: ${boardCommand()} run log ${short(run3.sessionId)} --follow`);
65690
+ say(` stop it: ${boardCommand()} run stop ${short(run3.sessionId)}`);
65527
65691
  if (follow2) return await followStarted(run3.sessionId, program2, opts.events === true);
65528
65692
  return { sessionId: run3.sessionId, action, cardId: run3.cardId };
65529
65693
  }
@@ -65573,7 +65737,7 @@ function sayBeforeStart(req, program2) {
65573
65737
  const asked = card?.questions.length ?? 0;
65574
65738
  if (req.action === "implement" && asked) {
65575
65739
  say(
65576
- `#${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}\`.`
65740
+ `#${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}\`.`
65577
65741
  );
65578
65742
  }
65579
65743
  }
@@ -65740,7 +65904,7 @@ async function cmdSubWait(ids, waitMs = WAIT_MS2) {
65740
65904
  say("");
65741
65905
  }
65742
65906
  if (running.length) {
65743
- say(`still running: ${running.map((r) => short(r.sessionId)).join(", ")} \u2014 run \`run wait\` again.`);
65907
+ say(`still running: ${running.map((r) => short(r.sessionId)).join(", ")} \u2014 run \`${boardCommand()} run wait${ids.length ? ` ${ids.join(" ")}` : ""}\` again.`);
65744
65908
  }
65745
65909
  return {
65746
65910
  ended: ended.map((r) => ({ sessionId: r.sessionId, status: r.status, result: r.result })),
@@ -65765,7 +65929,7 @@ async function cmdRuns(opts, program2 = "akb") {
65765
65929
  }
65766
65930
  if (live.length) say("");
65767
65931
  say(
65768
- live.length ? `${live.length} running. Follow one with \`${program2} raw run log <id> --follow${BOARD_FLAG}\`.` : "nothing running."
65932
+ live.length ? `${live.length} running. Follow one with \`${boardCommand()} run log <id> --follow\`.` : "nothing running."
65769
65933
  );
65770
65934
  return { runs: shown };
65771
65935
  }
@@ -65960,8 +66124,8 @@ function runLine(r, program2 = "akb", indent2 = "") {
65960
66124
  if (r.durationMs !== void 0) bits.push(`in ${ago(r.durationMs)}`);
65961
66125
  if (r.model) bits.push(r.model);
65962
66126
  if (r.costUsd !== void 0) bits.push(`$${r.costUsd.toFixed(4)}`);
65963
- if (r.canResume) bits.push(`\u2014 continue it with \`${program2} raw run resume ${short(r.sessionId)}${BOARD_FLAG}\``);
65964
- if (r.canRetry) bits.push(`\u2014 try it again with \`${program2} raw run resume ${short(r.sessionId)}${BOARD_FLAG}\``);
66127
+ if (r.canResume) bits.push(`\u2014 continue it with \`${boardCommand()} run resume ${short(r.sessionId)}\``);
66128
+ if (r.canRetry) bits.push(`\u2014 try it again with \`${boardCommand()} run resume ${short(r.sessionId)}\``);
65965
66129
  const line = bits.join(" ");
65966
66130
  const under = [
65967
66131
  r.input && firstLine2(r.input),
@@ -66007,6 +66171,7 @@ var init_run = __esm({
66007
66171
  init_answers();
66008
66172
  init_deliveries();
66009
66173
  init_pause();
66174
+ init_command();
66010
66175
  init_flow();
66011
66176
  init_env();
66012
66177
  init_memory_review();
@@ -66677,13 +66842,16 @@ function nounOf(program2, name, summary2, description) {
66677
66842
  });
66678
66843
  }
66679
66844
  function declareRaw(program2, cli) {
66680
- const raw = `${cli.program} raw`;
66845
+ declareLocalRuns(program2, cli);
66846
+ }
66847
+ function declareLocalRuns(program2, cli, canonical) {
66848
+ const command = canonical ? cli.program : `${cli.program} raw`;
66681
66849
  const noun = (name, summary2, description) => nounOf(program2, name, summary2, description);
66682
66850
  const groups = {
66683
- card: noun(
66851
+ card: canonical?.task ?? noun(
66684
66852
  "card",
66685
66853
  "one card: build it, sharpen it, change it, finish it",
66686
- `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.`
66854
+ `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.`
66687
66855
  ),
66688
66856
  delivery: noun(
66689
66857
  "delivery",
@@ -66693,9 +66861,9 @@ function declareRaw(program2, cli) {
66693
66861
  run: noun(
66694
66862
  "run",
66695
66863
  "the agent processes \u2014 what is going, and what went",
66696
- `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.`
66864
+ `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.`
66697
66865
  ),
66698
- memory: noun("memory", "squeeze or review the memory the planning flows read"),
66866
+ memory: noun("memory", "read and maintain project memory"),
66699
66867
  // What is waiting to be sorted (#453, #499).
66700
66868
  triage: noun(
66701
66869
  "triage",
@@ -66703,11 +66871,18 @@ function declareRaw(program2, cli) {
66703
66871
  "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."
66704
66872
  )
66705
66873
  };
66706
- for (const flow of FLOWS) if (!flow.internal) declareFlow(flow.group ? groups[flow.group] : program2, flow, cli);
66707
- declareRunning(groups.run, cli);
66708
- declareDelivery(groups.delivery, cli);
66874
+ for (const flow of FLOWS) {
66875
+ if (flow.internal) continue;
66876
+ if (canonical && flow.action === "describe-project") {
66877
+ declareFlow(groups.memory, flow, cli, true);
66878
+ } else if (!canonical || flow.group === "card" && flow.action !== "approve" || flow.action === "review-memory" || flow.action === "prune-memory") {
66879
+ declareFlow(flow.group ? groups[flow.group] : program2, flow, cli, !!canonical);
66880
+ }
66881
+ }
66882
+ declareRunning(groups.run, cli, !!canonical);
66883
+ declareDelivery(groups.delivery, cli, !!canonical);
66709
66884
  groups.delivery.addHelpText("after", HELP_AFTER.deliveries(cli.program));
66710
- 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() {
66885
+ 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() {
66711
66886
  const opts = this.opts();
66712
66887
  if (this.args.length || opts.follow || opts.notes !== void 0) {
66713
66888
  return boardless(this, cli, () => die("Prepare Preview outputs in the task session using STUDIO.md.", "bad-args"));
@@ -66719,7 +66894,6 @@ function declareRaw(program2, cli) {
66719
66894
  });
66720
66895
  } else await onBoard(this, cli, () => listPreviews(opts.studio));
66721
66896
  });
66722
- declareAgent(program2, cli);
66723
66897
  const triage = groups.triage;
66724
66898
  withShared(triage.command("add")).summary("write one item into triage").description(
66725
66899
  "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."
@@ -66731,25 +66905,30 @@ function declareRaw(program2, cli) {
66731
66905
  ).argument("<source-id>", "the id to look for").action(async function(sourceId) {
66732
66906
  await onBoard(this, cli, () => cmdTriageCheck(sourceId));
66733
66907
  });
66734
- 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() {
66735
- const ctx = ctxOf(this, cli.program);
66736
- useBoard(resolveBoard("components", { board: ctx.board, dir: ctx.dir, cwd: cli.cwd, installHint: cli.installHint }), ctx.dir !== null);
66737
- await boardless(this, cli, () => cmdComponents(this.opts()));
66738
- });
66739
- const studio = noun("studio", "check a studio folder or draw its diagram");
66908
+ const studio = canonical?.studio ?? noun("studio", "check a Studio folder");
66740
66909
  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) {
66741
66910
  await onBoard(this, cli, () => cmdStudioValidate(folder2));
66742
66911
  });
66743
66912
  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) {
66744
66913
  await onBoard(this, cli, () => cmdStudioPreview(card, this.opts()));
66745
66914
  });
66746
- 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) {
66915
+ if (canonical) {
66916
+ const board2 = noun("board", "list local cards and resolve board conflicts");
66917
+ declareBoardMoves(program2, cli, { ...canonical, board: board2, memory: groups.memory });
66918
+ return;
66919
+ }
66920
+ declareAgent(program2, cli);
66921
+ 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() {
66922
+ const ctx = ctxOf(this, cli.program);
66923
+ useBoard(resolveBoard("components", { board: ctx.board, dir: ctx.dir, cwd: cli.cwd, installHint: cli.installHint }), ctx.dir !== null);
66924
+ await boardless(this, cli, () => cmdComponents(this.opts()));
66925
+ });
66926
+ 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) {
66747
66927
  await onBoard(this, cli, () => cmdStudioDiagram(id2, this.opts().folder ? id2 : card, this.opts().folder));
66748
66928
  });
66749
66929
  }
66750
66930
  function declareRuns(program2, cli) {
66751
- const ON_WEB = "Reads and writes WildCrane Cloud as the signed-in account; changes show on the web at once.";
66752
- 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() {
66931
+ 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() {
66753
66932
  this.help();
66754
66933
  });
66755
66934
  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() {
@@ -66758,8 +66937,19 @@ function declareRuns(program2, cli) {
66758
66937
  withShared(task.command("show")).argument("<task>").summary("a task and its card").action(async function(id2) {
66759
66938
  await boardless(this, cli, (_, location) => taskShow(id2, location));
66760
66939
  });
66761
- 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) {
66762
- await boardless(this, cli, (_, location) => taskCreate(request2.join(" "), this.opts(), location));
66940
+ 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").option("--review <flow>", "set a review flow using Studio Preview names").option("--review-file <path>", "JSON review nodes with after dependencies; [] needs no extra review").option("--preview-definitions-file <path>", "propose a JSON list of task Preview definitions").action(async function(request2) {
66941
+ const opts = this.opts();
66942
+ if (opts.title !== void 0) {
66943
+ if (request2.length || opts.project !== void 0 || opts.review !== void 0 || opts.reviewFile !== void 0 || opts.previewDefinitionsFile !== void 0) {
66944
+ die("Use --title with the local board, or pass a request with --project, --review, --review-file, and --preview-definitions-file.", "bad-args");
66945
+ }
66946
+ return createBoardCard(this, cli);
66947
+ }
66948
+ if (["priority", "blockedBy", "related", "modules", "slug", "triage", "source"].some((key) => opts[key] !== void 0)) {
66949
+ die("Card fields require --title.", "bad-args");
66950
+ }
66951
+ if (!request2.length) this.error("missing required argument 'request' or option '--title'", { code: "commander.missingArgument" });
66952
+ await boardless(this, cli, (_, location) => taskCreate(request2.join(" "), opts, location));
66763
66953
  });
66764
66954
  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) {
66765
66955
  await boardless(this, cli, (_, location) => taskApprove(id2, this.opts().comment, this.opts(), location));
@@ -66790,6 +66980,9 @@ function declareRuns(program2, cli) {
66790
66980
  withShared(task.command("resume")).argument("<task>").summary("continue its stopped run").action(async function(id2) {
66791
66981
  await boardless(this, cli, (_, location) => taskResume(id2, location));
66792
66982
  });
66983
+ withShared(task.command("runtime")).argument("<task>").argument("<runtime>").summary("change a task\u2019s runtime").action(async function(id2, runtime) {
66984
+ await boardless(this, cli, (_, location) => taskRuntime(id2, runtime, location));
66985
+ });
66793
66986
  withShared(task.command("stop")).argument("<task>").summary("stop its current run").action(async function(id2) {
66794
66987
  await boardless(this, cli, (_, location) => taskStop(id2, location));
66795
66988
  });
@@ -66870,7 +67063,7 @@ function declareRuns(program2, cli) {
66870
67063
  const tools = withShared(program2.command("agent")).summary("the AI tools on this MACHINE");
66871
67064
  tools.allowExcessArguments().allowUnknownOption().action(function() {
66872
67065
  if (!this.args.length) this.help();
66873
- this.error(movedTo("agent", cli.program), { code: "commander.unknownCommand" });
67066
+ this.error(`unknown command '${this.args[0]}'`, { code: "commander.unknownCommand" });
66874
67067
  });
66875
67068
  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) {
66876
67069
  await boardless(this, cli, () => cmdAgentCheck(agent));
@@ -66892,7 +67085,7 @@ function declareRuns(program2, cli) {
66892
67085
  ).allowExcessArguments().allowUnknownOption().action(async function() {
66893
67086
  const word = this.args[0];
66894
67087
  if (word === "diagram") {
66895
- this.error(`\`${cli.program} studio ${word}\` is now \`${cli.program} raw studio ${word}\`.`, { code: "commander.unknownCommand" });
67088
+ this.error(`Freeze a Studio draft with \`${cli.program} studio preview <card> --folder <draft> --base <baseline>\`.`, { code: "commander.unknownCommand" });
66896
67089
  }
66897
67090
  if (word) this.error(`unknown command '${word}'`, { code: "commander.unknownCommand" });
66898
67091
  await studioList(this, cli);
@@ -66932,6 +67125,7 @@ function declareRuns(program2, cli) {
66932
67125
  }
66933
67126
  await boardless(this, cli, (p) => cmdGuide(topic, p));
66934
67127
  });
67128
+ declareLocalRuns(program2, cli, { task, studio });
66935
67129
  program2.command("__watch", { hidden: true }).argument("<sessionId>").action(async function(sessionId) {
66936
67130
  const ctx = ctxOf(this, cli.program);
66937
67131
  const found2 = resolveBoard("runs", { board: ctx.board, dir: ctx.dir, cwd: cli.cwd, installHint: cli.installHint });
@@ -66940,7 +67134,7 @@ function declareRuns(program2, cli) {
66940
67134
  if (code !== 0) throw new BoardError(`the watcher for ${sessionId} ended with ${code}`, { kind: "watch-failed" });
66941
67135
  });
66942
67136
  }
66943
- function declareRunning(run3, cli) {
67137
+ function declareRunning(run3, cli, canonical) {
66944
67138
  const verb = (name) => withShared(run3.command(name));
66945
67139
  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() {
66946
67140
  await onBoard(this, cli, (p) => cmdRuns(this.opts(), p));
@@ -66955,7 +67149,7 @@ function declareRunning(run3, cli) {
66955
67149
  const [ids] = positional(vals);
66956
67150
  await onBoard(this, cli, () => cmdSubWait(ids ?? []));
66957
67151
  });
66958
- 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) {
67152
+ 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) {
66959
67153
  const [id2] = positional(vals);
66960
67154
  await onBoard(this, cli, (p) => cmdLog(id2, this.opts(), p));
66961
67155
  });
@@ -66963,13 +67157,13 @@ function declareRunning(run3, cli) {
66963
67157
  const [id2] = positional(vals);
66964
67158
  await onBoard(this, cli, () => cmdStop(id2));
66965
67159
  });
66966
- 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) {
67160
+ 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) {
66967
67161
  const [id2] = positional(vals);
66968
67162
  await onBoard(this, cli, () => cmdResume(id2, this.opts()));
66969
67163
  });
66970
67164
  }
66971
- function declareDelivery(delivery, cli) {
66972
- const verb = (name) => withShared(delivery.command(name));
67165
+ function declareDelivery(delivery, cli, canonical) {
67166
+ const verb = (name, internal = false) => withShared(delivery.command(name, { hidden: canonical && internal }));
66973
67167
  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) {
66974
67168
  await onBoard(this, cli, () => cmdCompleteDelivery(named2, this.opts()));
66975
67169
  });
@@ -66995,25 +67189,26 @@ function declareDelivery(delivery, cli) {
66995
67189
  const [named2] = positional(vals);
66996
67190
  await onBoard(this, cli, () => cmdResumeDelivery(named2));
66997
67191
  });
66998
- verb("reconcile").argument("<card>", "card number", cardId).summary("reconcile local delivery state for a card before recovery").action(async function(...vals) {
67192
+ verb("reconcile", true).argument("<card>", "card number", cardId).summary("reconcile local delivery state for a card before recovery").action(async function(...vals) {
66999
67193
  const [id2] = positional(vals);
67000
67194
  await onBoard(this, cli, () => cmdReconcileDelivery(id2));
67001
67195
  });
67002
- verb("release").argument("<card>", "card number", cardId).summary("safely release an active delivery write lock while preserving saved work").action(async function(...vals) {
67196
+ verb("release", true).argument("<card>", "card number", cardId).summary("safely release an active delivery write lock while preserving saved work").action(async function(...vals) {
67003
67197
  const [id2] = positional(vals);
67004
67198
  await onBoard(this, cli, () => cmdReleaseDelivery(id2));
67005
67199
  });
67006
67200
  }
67007
- function declareFlow(parent, flow, cli) {
67201
+ function declareFlow(parent, flow, cli, canonical) {
67008
67202
  const byDelivery = flow.group === "delivery";
67009
- const cmd = withShared(parent.command(flowVerb(flow)));
67203
+ const cmd = withShared(parent.command(flowVerb(flow), { hidden: canonical && flow.action === "prune-memory" }));
67010
67204
  for (const arg of splitArgs(flow.argument)) {
67011
67205
  cmd.argument(arg, argNote(arg, flow), arg.startsWith("<id") ? byDelivery ? String : cardId : void 0);
67012
67206
  }
67013
67207
  cmd.summary(flow.gloss);
67014
67208
  if (flow.more?.length) cmd.description(`${sentence(flow.gloss)} ${flow.more.join(" ")}`);
67015
- for (const option of flow.options ?? []) addFlowOption(cmd, option);
67016
- 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) {
67209
+ for (const option of flow.options ?? []) addFlowOption(cmd, option, canonical && option.internal === true);
67210
+ const showPrint = !canonical || flow.group === "card";
67211
+ 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) {
67017
67212
  const args2 = positional(vals);
67018
67213
  await onBoard(
67019
67214
  this,
@@ -67027,8 +67222,8 @@ function deliveryOf(named2) {
67027
67222
  if (!delivery) throw new BoardError(`no delivery here answers to "${named2}"`, { kind: "unknown-delivery" });
67028
67223
  return delivery;
67029
67224
  }
67030
- function addFlowOption(cmd, option) {
67031
- const declared = new Option(option.flags, option.description);
67225
+ function addFlowOption(cmd, option, hidden) {
67226
+ const declared = new Option(option.flags, option.description).hideHelp(hidden);
67032
67227
  if (option.choices) declared.argParser(oneOf(option.choices));
67033
67228
  if (option.range) declared.argParser(intInRange(option.range[0], option.range[1]));
67034
67229
  cmd.addOption(declared);
@@ -67103,7 +67298,7 @@ var init_agent2 = __esm({
67103
67298
  init_telemetry2();
67104
67299
  init_agent_check();
67105
67300
  init_harnesses();
67106
- init_moved();
67301
+ init_board2();
67107
67302
  init_question_options();
67108
67303
  init_shared2();
67109
67304
  REVIEW_FLOW_HELP = `
@@ -67275,18 +67470,12 @@ function declareSetup(program2, cli) {
67275
67470
  }
67276
67471
 
67277
67472
  // ../cli/src/lib/cli/akb.ts
67278
- init_io();
67279
67473
  init_shared2();
67280
67474
  function buildAkbProgram(cli) {
67281
67475
  const program2 = withShared(newCommand(cli.program));
67282
67476
  program2.description("set up a board, and put an agent to work on it.").helpCommand("help [command]", "this list, or one command in full");
67283
67477
  declareSetup(program2, cli);
67284
67478
  declareRuns(program2, cli);
67285
- 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() {
67286
- throw new BoardError(`\`${cli.program} raw\` is a tree of its own \u2014 this command line never reached it.`, {
67287
- kind: "unreachable"
67288
- });
67289
- });
67290
67479
  return program2;
67291
67480
  }
67292
67481
 
@@ -67305,6 +67494,7 @@ async function runAgent2(argv, options = {}) {
67305
67494
 
67306
67495
  // ../cli/src/kanban.ts
67307
67496
  init_board_cli();
67497
+ init_paths();
67308
67498
  init_version();
67309
67499
  var SELF2 = fileURLToPath4(import.meta.url);
67310
67500
  function invokedDirectly() {
@@ -67318,32 +67508,32 @@ function invokedDirectly() {
67318
67508
  }
67319
67509
  if (invokedDirectly()) {
67320
67510
  const argv = process.argv.slice(2);
67321
- const raw = rawArgv(argv);
67322
- if (argv[0] === "__watch") {
67323
- void runAgent2(argv, { program: "akb" }).then((code) => {
67324
- process.exitCode = code;
67325
- });
67326
- } else if (raw || argv[0] === "guide") {
67327
- if (argv[0] === "guide") {
67328
- void runAgent2(argv, { program: `node ${SELF2}` }).then((code) => {
67329
- process.exitCode = code;
67330
- });
67331
- } else {
67332
- void runBoard(raw ?? [], {
67333
- program: `node ${SELF2} raw`,
67334
- version: `wildcrane ${SKILL_VERSION}`
67335
- }).then((code) => {
67336
- process.exitCode = code;
67337
- });
67338
- }
67339
- } else {
67340
- void runBoard(argv, {
67341
- program: `node ${SELF2}`,
67342
- version: `wildcrane ${SKILL_VERSION}`
67343
- }).then((code) => {
67344
- process.exitCode = code;
67345
- });
67346
- }
67511
+ const program2 = `node ${shellWord(SELF2)}`;
67512
+ const word = commandWord(argv);
67513
+ const legacy = /* @__PURE__ */ new Set([
67514
+ "create",
67515
+ "update-questions",
67516
+ "conflict",
67517
+ "list",
67518
+ "inspect",
67519
+ "validate",
67520
+ "file",
67521
+ "agent-file",
67522
+ "memory-file",
67523
+ "reject",
67524
+ "init",
67525
+ "card",
67526
+ "previews",
67527
+ "components",
67528
+ "reflect",
67529
+ "review-dismissals",
67530
+ "describe-project",
67531
+ "version"
67532
+ ]);
67533
+ const result = legacy.has(word) ? runBoard(argv, { program: program2, version: `wildcrane ${SKILL_VERSION}` }) : runAgent2(argv, { program: program2 });
67534
+ void result.then((code) => {
67535
+ process.exitCode = code;
67536
+ });
67347
67537
  }
67348
67538
  export {
67349
67539
  rawArgv,