wildcrane-runner 0.6.120 → 0.6.121

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.102 — built by runner/scripts/build.mjs. Do not edit.
2
+ // ai4kanban 0.11.103 — 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;
@@ -925,11 +925,6 @@ function stateLayout(board, root2) {
925
925
  function projectStateDir(board, root2 = stateRootOf(board)) {
926
926
  return stateLayout(board, root2).state;
927
927
  }
928
- function prepareCloudBoard(project2) {
929
- const board = cloudBoardOf(project2);
930
- ensureProjectState(board);
931
- fs2.mkdirSync(board, { recursive: true });
932
- }
933
928
  function hasRunningSession(dir) {
934
929
  try {
935
930
  const store = JSON.parse(fs2.readFileSync(path3.join(dir, SESSIONS_FILE), "utf8"));
@@ -1027,7 +1022,7 @@ function recordedBoard(dir) {
1027
1022
  return null;
1028
1023
  }
1029
1024
  }
1030
- var RECORD, SESSIONS_FILE, SESSIONS_FOLDER, ASSETS_FOLDER, SESSIONS_LOCK, INDEX_LOCK, UI_CONFIG_FILE, missing, NESTED_STATE, InvalidBoardStatePath, cloudBoardOf;
1025
+ var RECORD, SESSIONS_FILE, SESSIONS_FOLDER, ASSETS_FOLDER, SESSIONS_LOCK, INDEX_LOCK, UI_CONFIG_FILE, missing, NESTED_STATE, InvalidBoardStatePath;
1031
1026
  var init_project = __esm({
1032
1027
  "../cli/src/lib/machine/project.ts"() {
1033
1028
  "use strict";
@@ -1047,7 +1042,6 @@ var init_project = __esm({
1047
1042
  super(`Invalid nested board state path: ${file2}. ${use}`, { kind: "board-state-path" });
1048
1043
  }
1049
1044
  };
1050
- cloudBoardOf = (project2) => path3.join(project2, ".akb", "kanban");
1051
1045
  }
1052
1046
  });
1053
1047
 
@@ -1670,8 +1664,8 @@ function removeClaim(dir, token2) {
1670
1664
  throw err;
1671
1665
  }
1672
1666
  }
1673
- function tryLock(dir, createParent = true) {
1674
- if (createParent) fs10.mkdirSync(path11.dirname(dir), { recursive: true });
1667
+ function tryLock(dir) {
1668
+ fs10.mkdirSync(path11.dirname(dir), { recursive: true });
1675
1669
  const token2 = `${process.pid}-${randomUUID2()}`;
1676
1670
  const candidate = fs10.mkdtempSync(`${dir}.`);
1677
1671
  try {
@@ -3028,17 +3022,17 @@ var require_visit = __commonJS({
3028
3022
  visit2.BREAK = BREAK;
3029
3023
  visit2.SKIP = SKIP;
3030
3024
  visit2.REMOVE = REMOVE;
3031
- function visit_(key, node2, visitor, path90) {
3032
- const ctrl = callVisitor(key, node2, visitor, path90);
3025
+ function visit_(key, node2, visitor, path89) {
3026
+ const ctrl = callVisitor(key, node2, visitor, path89);
3033
3027
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
3034
- replaceNode(key, path90, ctrl);
3035
- return visit_(key, ctrl, visitor, path90);
3028
+ replaceNode(key, path89, ctrl);
3029
+ return visit_(key, ctrl, visitor, path89);
3036
3030
  }
3037
3031
  if (typeof ctrl !== "symbol") {
3038
3032
  if (identity.isCollection(node2)) {
3039
- path90 = Object.freeze(path90.concat(node2));
3033
+ path89 = Object.freeze(path89.concat(node2));
3040
3034
  for (let i = 0; i < node2.items.length; ++i) {
3041
- const ci = visit_(i, node2.items[i], visitor, path90);
3035
+ const ci = visit_(i, node2.items[i], visitor, path89);
3042
3036
  if (typeof ci === "number")
3043
3037
  i = ci - 1;
3044
3038
  else if (ci === BREAK)
@@ -3049,13 +3043,13 @@ var require_visit = __commonJS({
3049
3043
  }
3050
3044
  }
3051
3045
  } else if (identity.isPair(node2)) {
3052
- path90 = Object.freeze(path90.concat(node2));
3053
- const ck = visit_("key", node2.key, visitor, path90);
3046
+ path89 = Object.freeze(path89.concat(node2));
3047
+ const ck = visit_("key", node2.key, visitor, path89);
3054
3048
  if (ck === BREAK)
3055
3049
  return BREAK;
3056
3050
  else if (ck === REMOVE)
3057
3051
  node2.key = null;
3058
- const cv = visit_("value", node2.value, visitor, path90);
3052
+ const cv = visit_("value", node2.value, visitor, path89);
3059
3053
  if (cv === BREAK)
3060
3054
  return BREAK;
3061
3055
  else if (cv === REMOVE)
@@ -3076,17 +3070,17 @@ var require_visit = __commonJS({
3076
3070
  visitAsync.BREAK = BREAK;
3077
3071
  visitAsync.SKIP = SKIP;
3078
3072
  visitAsync.REMOVE = REMOVE;
3079
- async function visitAsync_(key, node2, visitor, path90) {
3080
- const ctrl = await callVisitor(key, node2, visitor, path90);
3073
+ async function visitAsync_(key, node2, visitor, path89) {
3074
+ const ctrl = await callVisitor(key, node2, visitor, path89);
3081
3075
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
3082
- replaceNode(key, path90, ctrl);
3083
- return visitAsync_(key, ctrl, visitor, path90);
3076
+ replaceNode(key, path89, ctrl);
3077
+ return visitAsync_(key, ctrl, visitor, path89);
3084
3078
  }
3085
3079
  if (typeof ctrl !== "symbol") {
3086
3080
  if (identity.isCollection(node2)) {
3087
- path90 = Object.freeze(path90.concat(node2));
3081
+ path89 = Object.freeze(path89.concat(node2));
3088
3082
  for (let i = 0; i < node2.items.length; ++i) {
3089
- const ci = await visitAsync_(i, node2.items[i], visitor, path90);
3083
+ const ci = await visitAsync_(i, node2.items[i], visitor, path89);
3090
3084
  if (typeof ci === "number")
3091
3085
  i = ci - 1;
3092
3086
  else if (ci === BREAK)
@@ -3097,13 +3091,13 @@ var require_visit = __commonJS({
3097
3091
  }
3098
3092
  }
3099
3093
  } else if (identity.isPair(node2)) {
3100
- path90 = Object.freeze(path90.concat(node2));
3101
- const ck = await visitAsync_("key", node2.key, visitor, path90);
3094
+ path89 = Object.freeze(path89.concat(node2));
3095
+ const ck = await visitAsync_("key", node2.key, visitor, path89);
3102
3096
  if (ck === BREAK)
3103
3097
  return BREAK;
3104
3098
  else if (ck === REMOVE)
3105
3099
  node2.key = null;
3106
- const cv = await visitAsync_("value", node2.value, visitor, path90);
3100
+ const cv = await visitAsync_("value", node2.value, visitor, path89);
3107
3101
  if (cv === BREAK)
3108
3102
  return BREAK;
3109
3103
  else if (cv === REMOVE)
@@ -3130,23 +3124,23 @@ var require_visit = __commonJS({
3130
3124
  }
3131
3125
  return visitor;
3132
3126
  }
3133
- function callVisitor(key, node2, visitor, path90) {
3127
+ function callVisitor(key, node2, visitor, path89) {
3134
3128
  if (typeof visitor === "function")
3135
- return visitor(key, node2, path90);
3129
+ return visitor(key, node2, path89);
3136
3130
  if (identity.isMap(node2))
3137
- return visitor.Map?.(key, node2, path90);
3131
+ return visitor.Map?.(key, node2, path89);
3138
3132
  if (identity.isSeq(node2))
3139
- return visitor.Seq?.(key, node2, path90);
3133
+ return visitor.Seq?.(key, node2, path89);
3140
3134
  if (identity.isPair(node2))
3141
- return visitor.Pair?.(key, node2, path90);
3135
+ return visitor.Pair?.(key, node2, path89);
3142
3136
  if (identity.isScalar(node2))
3143
- return visitor.Scalar?.(key, node2, path90);
3137
+ return visitor.Scalar?.(key, node2, path89);
3144
3138
  if (identity.isAlias(node2))
3145
- return visitor.Alias?.(key, node2, path90);
3139
+ return visitor.Alias?.(key, node2, path89);
3146
3140
  return void 0;
3147
3141
  }
3148
- function replaceNode(key, path90, node2) {
3149
- const parent = path90[path90.length - 1];
3142
+ function replaceNode(key, path89, node2) {
3143
+ const parent = path89[path89.length - 1];
3150
3144
  if (identity.isCollection(parent)) {
3151
3145
  parent.items[key] = node2;
3152
3146
  } else if (identity.isPair(parent)) {
@@ -3758,10 +3752,10 @@ var require_Collection = __commonJS({
3758
3752
  var createNode = require_createNode();
3759
3753
  var identity = require_identity();
3760
3754
  var Node = require_Node();
3761
- function collectionFromPath(schema, path90, value) {
3755
+ function collectionFromPath(schema, path89, value) {
3762
3756
  let v = value;
3763
- for (let i = path90.length - 1; i >= 0; --i) {
3764
- const k = path90[i];
3757
+ for (let i = path89.length - 1; i >= 0; --i) {
3758
+ const k = path89[i];
3765
3759
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
3766
3760
  const a = [];
3767
3761
  a[k] = v;
@@ -3780,7 +3774,7 @@ var require_Collection = __commonJS({
3780
3774
  sourceObjects: /* @__PURE__ */ new Map()
3781
3775
  });
3782
3776
  }
3783
- var isEmptyPath = (path90) => path90 == null || typeof path90 === "object" && !!path90[Symbol.iterator]().next().done;
3777
+ var isEmptyPath = (path89) => path89 == null || typeof path89 === "object" && !!path89[Symbol.iterator]().next().done;
3784
3778
  var Collection = class extends Node.NodeBase {
3785
3779
  constructor(type, schema) {
3786
3780
  super(type);
@@ -3810,11 +3804,11 @@ var require_Collection = __commonJS({
3810
3804
  * be a Pair instance or a `{ key, value }` object, which may not have a key
3811
3805
  * that already exists in the map.
3812
3806
  */
3813
- addIn(path90, value) {
3814
- if (isEmptyPath(path90))
3807
+ addIn(path89, value) {
3808
+ if (isEmptyPath(path89))
3815
3809
  this.add(value);
3816
3810
  else {
3817
- const [key, ...rest] = path90;
3811
+ const [key, ...rest] = path89;
3818
3812
  const node2 = this.get(key, true);
3819
3813
  if (identity.isCollection(node2))
3820
3814
  node2.addIn(rest, value);
@@ -3828,8 +3822,8 @@ var require_Collection = __commonJS({
3828
3822
  * Removes a value from the collection.
3829
3823
  * @returns `true` if the item was found and removed.
3830
3824
  */
3831
- deleteIn(path90) {
3832
- const [key, ...rest] = path90;
3825
+ deleteIn(path89) {
3826
+ const [key, ...rest] = path89;
3833
3827
  if (rest.length === 0)
3834
3828
  return this.delete(key);
3835
3829
  const node2 = this.get(key, true);
@@ -3843,8 +3837,8 @@ var require_Collection = __commonJS({
3843
3837
  * scalar values from their surrounding node; to disable set `keepScalar` to
3844
3838
  * `true` (collections are always returned intact).
3845
3839
  */
3846
- getIn(path90, keepScalar) {
3847
- const [key, ...rest] = path90;
3840
+ getIn(path89, keepScalar) {
3841
+ const [key, ...rest] = path89;
3848
3842
  const node2 = this.get(key, true);
3849
3843
  if (rest.length === 0)
3850
3844
  return !keepScalar && identity.isScalar(node2) ? node2.value : node2;
@@ -3862,8 +3856,8 @@ var require_Collection = __commonJS({
3862
3856
  /**
3863
3857
  * Checks if the collection includes a value with the key `key`.
3864
3858
  */
3865
- hasIn(path90) {
3866
- const [key, ...rest] = path90;
3859
+ hasIn(path89) {
3860
+ const [key, ...rest] = path89;
3867
3861
  if (rest.length === 0)
3868
3862
  return this.has(key);
3869
3863
  const node2 = this.get(key, true);
@@ -3873,8 +3867,8 @@ var require_Collection = __commonJS({
3873
3867
  * Sets a value in this collection. For `!!set`, `value` needs to be a
3874
3868
  * boolean to add/remove the item from the set.
3875
3869
  */
3876
- setIn(path90, value) {
3877
- const [key, ...rest] = path90;
3870
+ setIn(path89, value) {
3871
+ const [key, ...rest] = path89;
3878
3872
  if (rest.length === 0) {
3879
3873
  this.set(key, value);
3880
3874
  } else {
@@ -6389,9 +6383,9 @@ var require_Document = __commonJS({
6389
6383
  this.contents.add(value);
6390
6384
  }
6391
6385
  /** Adds a value to the document. */
6392
- addIn(path90, value) {
6386
+ addIn(path89, value) {
6393
6387
  if (assertCollection(this.contents))
6394
- this.contents.addIn(path90, value);
6388
+ this.contents.addIn(path89, value);
6395
6389
  }
6396
6390
  /**
6397
6391
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -6466,14 +6460,14 @@ var require_Document = __commonJS({
6466
6460
  * Removes a value from the document.
6467
6461
  * @returns `true` if the item was found and removed.
6468
6462
  */
6469
- deleteIn(path90) {
6470
- if (Collection.isEmptyPath(path90)) {
6463
+ deleteIn(path89) {
6464
+ if (Collection.isEmptyPath(path89)) {
6471
6465
  if (this.contents == null)
6472
6466
  return false;
6473
6467
  this.contents = null;
6474
6468
  return true;
6475
6469
  }
6476
- return assertCollection(this.contents) ? this.contents.deleteIn(path90) : false;
6470
+ return assertCollection(this.contents) ? this.contents.deleteIn(path89) : false;
6477
6471
  }
6478
6472
  /**
6479
6473
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -6488,10 +6482,10 @@ var require_Document = __commonJS({
6488
6482
  * scalar values from their surrounding node; to disable set `keepScalar` to
6489
6483
  * `true` (collections are always returned intact).
6490
6484
  */
6491
- getIn(path90, keepScalar) {
6492
- if (Collection.isEmptyPath(path90))
6485
+ getIn(path89, keepScalar) {
6486
+ if (Collection.isEmptyPath(path89))
6493
6487
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
6494
- return identity.isCollection(this.contents) ? this.contents.getIn(path90, keepScalar) : void 0;
6488
+ return identity.isCollection(this.contents) ? this.contents.getIn(path89, keepScalar) : void 0;
6495
6489
  }
6496
6490
  /**
6497
6491
  * Checks if the document includes a value with the key `key`.
@@ -6502,10 +6496,10 @@ var require_Document = __commonJS({
6502
6496
  /**
6503
6497
  * Checks if the document includes a value at `path`.
6504
6498
  */
6505
- hasIn(path90) {
6506
- if (Collection.isEmptyPath(path90))
6499
+ hasIn(path89) {
6500
+ if (Collection.isEmptyPath(path89))
6507
6501
  return this.contents !== void 0;
6508
- return identity.isCollection(this.contents) ? this.contents.hasIn(path90) : false;
6502
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path89) : false;
6509
6503
  }
6510
6504
  /**
6511
6505
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -6522,13 +6516,13 @@ var require_Document = __commonJS({
6522
6516
  * Sets a value in this document. For `!!set`, `value` needs to be a
6523
6517
  * boolean to add/remove the item from the set.
6524
6518
  */
6525
- setIn(path90, value) {
6526
- if (Collection.isEmptyPath(path90)) {
6519
+ setIn(path89, value) {
6520
+ if (Collection.isEmptyPath(path89)) {
6527
6521
  this.contents = value;
6528
6522
  } else if (this.contents == null) {
6529
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path90), value);
6523
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path89), value);
6530
6524
  } else if (assertCollection(this.contents)) {
6531
- this.contents.setIn(path90, value);
6525
+ this.contents.setIn(path89, value);
6532
6526
  }
6533
6527
  }
6534
6528
  /**
@@ -8489,9 +8483,9 @@ var require_cst_visit = __commonJS({
8489
8483
  visit2.BREAK = BREAK;
8490
8484
  visit2.SKIP = SKIP;
8491
8485
  visit2.REMOVE = REMOVE;
8492
- visit2.itemAtPath = (cst, path90) => {
8486
+ visit2.itemAtPath = (cst, path89) => {
8493
8487
  let item = cst;
8494
- for (const [field2, index] of path90) {
8488
+ for (const [field2, index] of path89) {
8495
8489
  const tok = item?.[field2];
8496
8490
  if (tok && "items" in tok) {
8497
8491
  item = tok.items[index];
@@ -8500,23 +8494,23 @@ var require_cst_visit = __commonJS({
8500
8494
  }
8501
8495
  return item;
8502
8496
  };
8503
- visit2.parentCollection = (cst, path90) => {
8504
- const parent = visit2.itemAtPath(cst, path90.slice(0, -1));
8505
- const field2 = path90[path90.length - 1][0];
8497
+ visit2.parentCollection = (cst, path89) => {
8498
+ const parent = visit2.itemAtPath(cst, path89.slice(0, -1));
8499
+ const field2 = path89[path89.length - 1][0];
8506
8500
  const coll = parent?.[field2];
8507
8501
  if (coll && "items" in coll)
8508
8502
  return coll;
8509
8503
  throw new Error("Parent collection not found");
8510
8504
  };
8511
- function _visit(path90, item, visitor) {
8512
- let ctrl = visitor(item, path90);
8505
+ function _visit(path89, item, visitor) {
8506
+ let ctrl = visitor(item, path89);
8513
8507
  if (typeof ctrl === "symbol")
8514
8508
  return ctrl;
8515
8509
  for (const field2 of ["key", "value"]) {
8516
8510
  const token2 = item[field2];
8517
8511
  if (token2 && "items" in token2) {
8518
8512
  for (let i = 0; i < token2.items.length; ++i) {
8519
- const ci = _visit(Object.freeze(path90.concat([[field2, i]])), token2.items[i], visitor);
8513
+ const ci = _visit(Object.freeze(path89.concat([[field2, i]])), token2.items[i], visitor);
8520
8514
  if (typeof ci === "number")
8521
8515
  i = ci - 1;
8522
8516
  else if (ci === BREAK)
@@ -8527,10 +8521,10 @@ var require_cst_visit = __commonJS({
8527
8521
  }
8528
8522
  }
8529
8523
  if (typeof ctrl === "function" && field2 === "key")
8530
- ctrl = ctrl(item, path90);
8524
+ ctrl = ctrl(item, path89);
8531
8525
  }
8532
8526
  }
8533
- return typeof ctrl === "function" ? ctrl(item, path90) : ctrl;
8527
+ return typeof ctrl === "function" ? ctrl(item, path89) : ctrl;
8534
8528
  }
8535
8529
  exports.visit = visit2;
8536
8530
  }
@@ -13498,8 +13492,8 @@ var require_utils = __commonJS({
13498
13492
  }
13499
13493
  return ind;
13500
13494
  }
13501
- function removeDotSegments(path90) {
13502
- let input2 = path90;
13495
+ function removeDotSegments(path89) {
13496
+ let input2 = path89;
13503
13497
  const output2 = [];
13504
13498
  let nextSlash = -1;
13505
13499
  let len = 0;
@@ -13573,11 +13567,11 @@ var require_utils = __commonJS({
13573
13567
  }
13574
13568
  return output2.join("");
13575
13569
  }
13576
- function removeDotSegmentsRelative(path90) {
13577
- if (path90 === "" || path90[0] === "/") {
13578
- return removeDotSegments(path90);
13570
+ function removeDotSegmentsRelative(path89) {
13571
+ if (path89 === "" || path89[0] === "/") {
13572
+ return removeDotSegments(path89);
13579
13573
  }
13580
- const segments = path90.split("/");
13574
+ const segments = path89.split("/");
13581
13575
  const last = segments.length - 1;
13582
13576
  const output2 = [];
13583
13577
  let trailingDirectory = false;
@@ -13940,8 +13934,8 @@ var require_schemes = __commonJS({
13940
13934
  }
13941
13935
  if (wsComponent.resourceName) {
13942
13936
  const queryIndex = wsComponent.resourceName.indexOf("?");
13943
- const path90 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
13944
- wsComponent.path = path90 && path90 !== "/" ? path90 : void 0;
13937
+ const path89 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
13938
+ wsComponent.path = path89 && path89 !== "/" ? path89 : void 0;
13945
13939
  wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
13946
13940
  wsComponent.resourceName = void 0;
13947
13941
  }
@@ -17218,7 +17212,7 @@ function landSections(body, previews) {
17218
17212
  }
17219
17213
  function parseStudioFile(id2, source2, from, { requirePreviewCopy = false, requireLand = false } = {}) {
17220
17214
  const problems = [];
17221
- const fail2 = (offset, path90, code, message, hint2) => problems.push({ file: from, ...sourcePosition(source2, offset), path: path90, code, message, hint: hint2 });
17215
+ const fail2 = (offset, path89, code, message, hint2) => problems.push({ file: from, ...sourcePosition(source2, offset), path: path89, code, message, hint: hint2 });
17222
17216
  const result = () => ({ problem: problems.map((p) => `${p.file}:${p.line}:${p.column} ${p.path}: ${p.code} \u2014 ${p.message}. ${p.hint}`).join("\n"), problems });
17223
17217
  if (!STUDIO_ID.test(id2)) fail2(0, "id", "studio-schema", `Invalid Studio ID ${id2}`, "Use lowercase letters, digits and dashes.");
17224
17218
  const front = /^---\r?\n([^]*?)\r?\n---(?:\r?\n|$)/.exec(source2);
@@ -17391,9 +17385,9 @@ function studioSkills(files) {
17391
17385
  return typeof skill === "string" ? [] : [skill];
17392
17386
  });
17393
17387
  }
17394
- function studioFileBody(path90, text4) {
17395
- if (isStudioScreenshot(path90)) {
17396
- const prefix = studioScreenshotPrefix(path90);
17388
+ function studioFileBody(path89, text4) {
17389
+ if (isStudioScreenshot(path89)) {
17390
+ const prefix = studioScreenshotPrefix(path89);
17397
17391
  if (text4.startsWith(prefix)) {
17398
17392
  const data = text4.slice(prefix.length);
17399
17393
  if (/^[A-Za-z0-9+/]*={0,2}$/.test(data) && data.length % 4 === 0) {
@@ -17597,7 +17591,7 @@ var init_studio_files = __esm({
17597
17591
  skillFile = (name) => "skills/" + name + "/SKILL.md";
17598
17592
  isStudioGuide = (file2) => /^(?:README|ABOUT)(?:\.[a-zA-Z0-9-]+)?\.md$/.test(file2);
17599
17593
  isAboutFile = (file2) => /^ABOUT(\.[a-z]{2})?\.md$/.test(file2) || isStudioScreenshot(file2);
17600
- studioScreenshotPrefix = (path90) => "data:" + (path90.endsWith(".png") ? "image/png" : /\.jpe?g$/.test(path90) ? "image/jpeg" : "image/webp") + ";base64,";
17594
+ studioScreenshotPrefix = (path89) => "data:" + (path89.endsWith(".png") ? "image/png" : /\.jpe?g$/.test(path89) ? "image/jpeg" : "image/webp") + ";base64,";
17601
17595
  studioFilesProblems = (value, official = false) => inspect(value, official).problems;
17602
17596
  }
17603
17597
  });
@@ -17750,18 +17744,18 @@ var init_file_limits = __esm({
17750
17744
  });
17751
17745
 
17752
17746
  // ../cli/src/lib/shared/board-files.ts
17753
- function isBoardPath(path90) {
17754
- if (!path90 || path90.length > 500 || path90.startsWith("/") || path90.includes("\\") || path90.includes("\0")) return false;
17755
- if (path90.split("/").some((part) => !part || part === "." || part === "..")) return false;
17756
- if (path90 === "todo/README.md" || path90.split("/").includes(".sync")) return false;
17757
- if (path90.startsWith("studios/")) return true;
17758
- if (SETTINGS.includes(path90)) return true;
17759
- if (path90.startsWith("rules/")) return isSettingsPath(path90);
17760
- if (path90.startsWith("assets/")) return taskOfAssets(path90) !== null;
17761
- return ROOTS.some((root2) => path90.startsWith(root2)) && path90.endsWith(".md");
17762
- }
17763
- function numberOfCard(path90) {
17764
- const n = ROOT.exec(path90)?.[1] ?? CARD.exec(path90)?.[1];
17747
+ function isBoardPath(path89) {
17748
+ if (!path89 || path89.length > 500 || path89.startsWith("/") || path89.includes("\\") || path89.includes("\0")) return false;
17749
+ if (path89.split("/").some((part) => !part || part === "." || part === "..")) return false;
17750
+ if (path89 === "todo/README.md" || path89.split("/").includes(".sync")) return false;
17751
+ if (path89.startsWith("studios/")) return true;
17752
+ if (SETTINGS.includes(path89)) return true;
17753
+ if (path89.startsWith("rules/")) return isSettingsPath(path89);
17754
+ if (path89.startsWith("assets/")) return taskOfAssets(path89) !== null;
17755
+ return ROOTS.some((root2) => path89.startsWith(root2)) && path89.endsWith(".md");
17756
+ }
17757
+ function numberOfCard(path89) {
17758
+ const n = ROOT.exec(path89)?.[1] ?? CARD.exec(path89)?.[1];
17765
17759
  return n ? Number(n) : null;
17766
17760
  }
17767
17761
  function studioConfigText(config2, legacy2) {
@@ -17775,17 +17769,17 @@ var init_board_files = __esm({
17775
17769
  init_file_limits();
17776
17770
  ROOTS = ["todo/", ".archive/", "memory/", "studios/", "triage/", "assets/", "rules/"];
17777
17771
  SETTINGS = ["modules.md", "config.md"];
17778
- isSettingsPath = (path90) => SETTINGS.includes(path90) || path90 === projectConfigFile || isStudioConfigPath(path90) || /^rules\/(?:proposer|project-writer|dismissal-reviewer|memory-pruner)\.md$/.test(path90);
17772
+ isSettingsPath = (path89) => SETTINGS.includes(path89) || path89 === projectConfigFile || isStudioConfigPath(path89) || /^rules\/(?:proposer|project-writer|dismissal-reviewer|memory-pruner)\.md$/.test(path89);
17779
17773
  CARD = /^(?:todo|\.archive)\/(?:[^/]+\/)*(\d+)-[^/]*\.md$/;
17780
17774
  ROOT = /^(?:todo|\.archive)\/(?:[^/]+\/)*(\d+)-[^/]+\/root\.md$/;
17781
17775
  assetsFile = (task) => `assets/${task}.json`;
17782
- taskOfAssets = (path90) => /^assets\/(task_[0-9a-f]+)\.json$/.exec(path90)?.[1] ?? null;
17776
+ taskOfAssets = (path89) => /^assets\/(task_[0-9a-f]+)\.json$/.exec(path89)?.[1] ?? null;
17783
17777
  studioFolder = (id2) => id2.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
17784
17778
  studioName = (id2) => id2.startsWith("wf_builtin_") ? id2.slice("wf_builtin_".length).replace(/_/g, "-") : studioFolder(id2);
17785
17779
  projectConfigFile = "rules/config.md";
17786
17780
  studioConfigFile = (id2) => `rules/studios/${studioName(id2)}/config.md`;
17787
17781
  legacyStudioRuleFile = (id2) => `rules/studios/${studioName(id2)}.md`;
17788
- isStudioConfigPath = (path90) => /^rules\/studios\/[^/]+(?:\/config)?\.md$/.test(path90);
17782
+ isStudioConfigPath = (path89) => /^rules\/studios\/[^/]+(?:\/config)?\.md$/.test(path89);
17789
17783
  studioConfigConflict = (config2, legacy2) => !!config2?.trim() && !!legacy2?.trim() && config2.trim() !== legacy2.trim();
17790
17784
  }
17791
17785
  });
@@ -19334,8 +19328,8 @@ var init_card_lines = __esm({
19334
19328
  });
19335
19329
 
19336
19330
  // ../cli/src/lib/shared/card-structure.ts
19337
- function problem(file2, line, path90, code, message, hint2) {
19338
- return { file: file2, line, column: 1, path: path90, code, message, hint: hint2 };
19331
+ function problem(file2, line, path89, code, message, hint2) {
19332
+ return { file: file2, line, column: 1, path: path89, code, message, hint: hint2 };
19339
19333
  }
19340
19334
  function cardHeaderProblems(file2, text4, context, strict = false) {
19341
19335
  const lines = text4.replace(/\r\n/g, "\n").split("\n");
@@ -19343,7 +19337,7 @@ function cardHeaderProblems(file2, text4, context, strict = false) {
19343
19337
  const { meta: meta3 } = parseFrontmatter(text4);
19344
19338
  const fields2 = /* @__PURE__ */ new Map();
19345
19339
  const problems = [];
19346
- const add2 = (line, path90, code, message, hint2) => problems.push(problem(file2, line, path90, code, message, hint2));
19340
+ const add2 = (line, path89, code, message, hint2) => problems.push(problem(file2, line, path89, code, message, hint2));
19347
19341
  if (!meta3) {
19348
19342
  add2(1, "frontmatter", "frontmatter", "Expected a leading --- frontmatter block and its closing ---", "Restore both delimiters.");
19349
19343
  return { lines, end: end2, meta: meta3, problems, fields: fields2 };
@@ -20664,10 +20658,10 @@ function mergeDefs(...defs) {
20664
20658
  function cloneDef(schema) {
20665
20659
  return mergeDefs(schema._zod.def);
20666
20660
  }
20667
- function getElementAtPath(obj3, path90) {
20668
- if (!path90)
20661
+ function getElementAtPath(obj3, path89) {
20662
+ if (!path89)
20669
20663
  return obj3;
20670
- return path90.reduce((acc, key) => acc?.[key], obj3);
20664
+ return path89.reduce((acc, key) => acc?.[key], obj3);
20671
20665
  }
20672
20666
  function promiseAllObject(promisesObj) {
20673
20667
  const keys = Object.keys(promisesObj);
@@ -20926,11 +20920,11 @@ function explicitlyAborted(x, startIndex = 0) {
20926
20920
  }
20927
20921
  return false;
20928
20922
  }
20929
- function prefixIssues(path90, issues) {
20923
+ function prefixIssues(path89, issues) {
20930
20924
  return issues.map((iss) => {
20931
20925
  var _a3;
20932
20926
  (_a3 = iss).path ?? (_a3.path = []);
20933
- iss.path.unshift(path90);
20927
+ iss.path.unshift(path89);
20934
20928
  return iss;
20935
20929
  });
20936
20930
  }
@@ -21463,16 +21457,16 @@ function flattenError(error62, mapper = (issue2) => issue2.message) {
21463
21457
  }
21464
21458
  function formatError(error62, mapper = (issue2) => issue2.message) {
21465
21459
  const fieldErrors = { _errors: [] };
21466
- const processError = (error63, path90 = []) => {
21460
+ const processError = (error63, path89 = []) => {
21467
21461
  for (const issue2 of error63.issues) {
21468
21462
  if (issue2.code === "invalid_union" && issue2.errors.length) {
21469
- issue2.errors.map((issues) => processError({ issues }, [...path90, ...issue2.path]));
21463
+ issue2.errors.map((issues) => processError({ issues }, [...path89, ...issue2.path]));
21470
21464
  } else if (issue2.code === "invalid_key") {
21471
- processError({ issues: issue2.issues }, [...path90, ...issue2.path]);
21465
+ processError({ issues: issue2.issues }, [...path89, ...issue2.path]);
21472
21466
  } else if (issue2.code === "invalid_element") {
21473
- processError({ issues: issue2.issues }, [...path90, ...issue2.path]);
21467
+ processError({ issues: issue2.issues }, [...path89, ...issue2.path]);
21474
21468
  } else {
21475
- const fullpath = [...path90, ...issue2.path];
21469
+ const fullpath = [...path89, ...issue2.path];
21476
21470
  if (fullpath.length === 0) {
21477
21471
  fieldErrors._errors.push(mapper(issue2));
21478
21472
  } else {
@@ -21511,17 +21505,17 @@ function formatError(error62, mapper = (issue2) => issue2.message) {
21511
21505
  }
21512
21506
  function treeifyError(error62, mapper = (issue2) => issue2.message) {
21513
21507
  const result = { errors: [] };
21514
- const processError = (error63, path90 = []) => {
21508
+ const processError = (error63, path89 = []) => {
21515
21509
  var _a3;
21516
21510
  for (const issue2 of error63.issues) {
21517
21511
  if (issue2.code === "invalid_union" && issue2.errors.length) {
21518
- issue2.errors.map((issues) => processError({ issues }, [...path90, ...issue2.path]));
21512
+ issue2.errors.map((issues) => processError({ issues }, [...path89, ...issue2.path]));
21519
21513
  } else if (issue2.code === "invalid_key") {
21520
- processError({ issues: issue2.issues }, [...path90, ...issue2.path]);
21514
+ processError({ issues: issue2.issues }, [...path89, ...issue2.path]);
21521
21515
  } else if (issue2.code === "invalid_element") {
21522
- processError({ issues: issue2.issues }, [...path90, ...issue2.path]);
21516
+ processError({ issues: issue2.issues }, [...path89, ...issue2.path]);
21523
21517
  } else {
21524
- const fullpath = [...path90, ...issue2.path];
21518
+ const fullpath = [...path89, ...issue2.path];
21525
21519
  if (fullpath.length === 0) {
21526
21520
  result.errors.push(mapper(issue2));
21527
21521
  continue;
@@ -21560,8 +21554,8 @@ function treeifyError(error62, mapper = (issue2) => issue2.message) {
21560
21554
  }
21561
21555
  function toDotPath(_path) {
21562
21556
  const segs = [];
21563
- const path90 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
21564
- for (const seg of path90) {
21557
+ const path89 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
21558
+ for (const seg of path89) {
21565
21559
  if (typeof seg === "number")
21566
21560
  segs.push(`[${seg}]`);
21567
21561
  else if (typeof seg === "symbol")
@@ -39593,13 +39587,13 @@ function resolveRef(ref, ctx) {
39593
39587
  if (!ref.startsWith("#")) {
39594
39588
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
39595
39589
  }
39596
- const path90 = ref.slice(1).split("/").filter(Boolean);
39597
- if (path90.length === 0) {
39590
+ const path89 = ref.slice(1).split("/").filter(Boolean);
39591
+ if (path89.length === 0) {
39598
39592
  return ctx.rootSchema;
39599
39593
  }
39600
39594
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
39601
- if (path90[0] === defsKey) {
39602
- const key = path90[1] === void 0 ? void 0 : decodeJSONPointerSegment(path90[1]);
39595
+ if (path89[0] === defsKey) {
39596
+ const key = path89[1] === void 0 ? void 0 : decodeJSONPointerSegment(path89[1]);
39603
39597
  if (!key || !ctx.defs[key]) {
39604
39598
  throw new Error(`Reference not found: ${ref}`);
39605
39599
  }
@@ -41372,8 +41366,8 @@ var init_package = __esm({
41372
41366
  "../cli/package.json"() {
41373
41367
  package_default = {
41374
41368
  name: "wildcrane",
41375
- version: "0.11.102",
41376
- akbContract: 35,
41369
+ version: "0.11.103",
41370
+ akbContract: 36,
41377
41371
  canonicalCommands: true,
41378
41372
  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.",
41379
41373
  keywords: [
@@ -42854,14 +42848,14 @@ function collectSources(sources2, card, host2) {
42854
42848
  const active2 = /* @__PURE__ */ new Set();
42855
42849
  const out = [];
42856
42850
  const visit2 = (src, types, owner, partial2 = false) => {
42857
- const [path90] = splitFileReference(src);
42851
+ const [path89] = splitFileReference(src);
42858
42852
  let resolved;
42859
42853
  try {
42860
- resolved = host2.resolve(path90, owner);
42854
+ resolved = host2.resolve(path89, owner);
42861
42855
  } catch (error62) {
42862
42856
  if (owner !== card) return { key: null, error: why(error62) };
42863
42857
  if (!nodes.has(src)) {
42864
- const node3 = { key: src, file: null, kind: kindAt(path90, types), error: why(error62), problems: [], dependencies: /* @__PURE__ */ new Map(), aliases: /* @__PURE__ */ new Set([src]) };
42858
+ const node3 = { key: src, file: null, kind: kindAt(path89, types), error: why(error62), problems: [], dependencies: /* @__PURE__ */ new Map(), aliases: /* @__PURE__ */ new Set([src]) };
42865
42859
  nodes.set(src, node3);
42866
42860
  out.push(node3);
42867
42861
  }
@@ -44867,6 +44861,7 @@ function cmdInspect(id2) {
44867
44861
  const result = {
44868
44862
  id: id2,
44869
44863
  card,
44864
+ asset_folder: path47.join(ASSETS, String(id2)),
44870
44865
  previews: fact("previews", () => Object.entries(progress).map(([agent, p]) => ({
44871
44866
  agent,
44872
44867
  currentStageId: p.currentStageId,
@@ -45964,8 +45959,8 @@ var init_tail = __esm({
45964
45959
  import fs54 from "node:fs";
45965
45960
  function whereHint(update2, title) {
45966
45961
  const locations = Array.isArray(update2.locations) ? update2.locations : [];
45967
- const path90 = str4(obj2(locations[0]).path);
45968
- return path90 && !title.includes(path90) ? hint(path90) : "";
45962
+ const path89 = str4(obj2(locations[0]).path);
45963
+ return path89 && !title.includes(path89) ? hint(path89) : "";
45969
45964
  }
45970
45965
  function saidBy(update2) {
45971
45966
  const content = Array.isArray(update2.content) ? update2.content : [];
@@ -47367,10 +47362,10 @@ function findRollout(threadId) {
47367
47362
  }
47368
47363
  for (const name of names2) {
47369
47364
  if (!name.startsWith("rollout-") || !name.endsWith(tail)) continue;
47370
- const path90 = join2(dir, name);
47365
+ const path89 = join2(dir, name);
47371
47366
  try {
47372
- const at = statSync2(path90).mtimeMs;
47373
- if (!newest2 || at > newest2.at) newest2 = { path: path90, at };
47367
+ const at = statSync2(path89).mtimeMs;
47368
+ if (!newest2 || at > newest2.at) newest2 = { path: path89, at };
47374
47369
  } catch {
47375
47370
  }
47376
47371
  }
@@ -47378,11 +47373,11 @@ function findRollout(threadId) {
47378
47373
  return newest2?.path;
47379
47374
  }
47380
47375
  function readCodexRunFacts(threadId) {
47381
- const path90 = findRollout(threadId);
47382
- if (!path90) return void 0;
47376
+ const path89 = findRollout(threadId);
47377
+ if (!path89) return void 0;
47383
47378
  let raw;
47384
47379
  try {
47385
- raw = readFileSync2(path90, "utf8");
47380
+ raw = readFileSync2(path89, "utf8");
47386
47381
  } catch {
47387
47382
  return void 0;
47388
47383
  }
@@ -47508,8 +47503,8 @@ function renderCompleted(item) {
47508
47503
  const changes = Array.isArray(item.changes) ? item.changes : [];
47509
47504
  return changes.map((raw) => {
47510
47505
  const change2 = obj2(raw);
47511
- const path90 = str4(change2.path);
47512
- return path90 ? `\u23FA ${str4(change2.kind) || "change"}(${path90})
47506
+ const path89 = str4(change2.path);
47507
+ return path89 ? `\u23FA ${str4(change2.kind) || "change"}(${path89})
47513
47508
  ` : "";
47514
47509
  }).join("");
47515
47510
  }
@@ -47847,10 +47842,10 @@ function readKimiRunFacts(sessionId) {
47847
47842
  const total = { input: 0, cacheCreation: 0, cacheRead: 0, output: 0 };
47848
47843
  let model;
47849
47844
  let holding = 0;
47850
- for (const { path: path90, main } of wireFiles(entry.sessionDir)) {
47845
+ for (const { path: path89, main } of wireFiles(entry.sessionDir)) {
47851
47846
  let raw;
47852
47847
  try {
47853
- raw = readFileSync3(path90, "utf8");
47848
+ raw = readFileSync3(path89, "utf8");
47854
47849
  } catch {
47855
47850
  continue;
47856
47851
  }
@@ -48938,7 +48933,7 @@ async function run(io, options, count3) {
48938
48933
  startupTimer = setTimeout(() => {
48939
48934
  if (!started) io.event?.({ kind: "log", data: { text: "[conversation] start_unconfirmed" } });
48940
48935
  }, CONVERSATION_MS.start);
48941
- await bounded(rpc.call("turn/start", { threadId, input: [{ type: "text", text: text4 }, ...images.map((path90) => ({ type: "localImage", path: path90 }))] }), CONVERSATION_MS.start, "Codex turn/start timed out; submission outcome is unknown.").catch((error62) => {
48936
+ await bounded(rpc.call("turn/start", { threadId, input: [{ type: "text", text: text4 }, ...images.map((path89) => ({ type: "localImage", path: path89 }))] }), CONVERSATION_MS.start, "Codex turn/start timed out; submission outcome is unknown.").catch((error62) => {
48942
48937
  if (!started) throw error62;
48943
48938
  });
48944
48939
  };
@@ -54851,7 +54846,7 @@ var require_command = __commonJS({
54851
54846
  "../cli/node_modules/commander/lib/command.js"(exports) {
54852
54847
  var EventEmitter = __require("node:events").EventEmitter;
54853
54848
  var childProcess = __require("node:child_process");
54854
- var path90 = __require("node:path");
54849
+ var path89 = __require("node:path");
54855
54850
  var fs93 = __require("node:fs");
54856
54851
  var process2 = __require("node:process");
54857
54852
  var { Argument: Argument2, humanReadableArgName } = require_argument();
@@ -55851,9 +55846,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
55851
55846
  let launchWithNode = false;
55852
55847
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
55853
55848
  function findFile(baseDir, baseName) {
55854
- const localBin = path90.resolve(baseDir, baseName);
55849
+ const localBin = path89.resolve(baseDir, baseName);
55855
55850
  if (fs93.existsSync(localBin)) return localBin;
55856
- if (sourceExt.includes(path90.extname(baseName))) return void 0;
55851
+ if (sourceExt.includes(path89.extname(baseName))) return void 0;
55857
55852
  const foundExt = sourceExt.find(
55858
55853
  (ext) => fs93.existsSync(`${localBin}${ext}`)
55859
55854
  );
@@ -55871,17 +55866,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
55871
55866
  } catch {
55872
55867
  resolvedScriptPath = this._scriptPath;
55873
55868
  }
55874
- executableDir = path90.resolve(
55875
- path90.dirname(resolvedScriptPath),
55869
+ executableDir = path89.resolve(
55870
+ path89.dirname(resolvedScriptPath),
55876
55871
  executableDir
55877
55872
  );
55878
55873
  }
55879
55874
  if (executableDir) {
55880
55875
  let localFile = findFile(executableDir, executableFile);
55881
55876
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
55882
- const legacyName = path90.basename(
55877
+ const legacyName = path89.basename(
55883
55878
  this._scriptPath,
55884
- path90.extname(this._scriptPath)
55879
+ path89.extname(this._scriptPath)
55885
55880
  );
55886
55881
  if (legacyName !== this._name) {
55887
55882
  localFile = findFile(
@@ -55892,7 +55887,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
55892
55887
  }
55893
55888
  executableFile = localFile || executableFile;
55894
55889
  }
55895
- launchWithNode = sourceExt.includes(path90.extname(executableFile));
55890
+ launchWithNode = sourceExt.includes(path89.extname(executableFile));
55896
55891
  let proc;
55897
55892
  if (process2.platform !== "win32") {
55898
55893
  if (launchWithNode) {
@@ -56739,7 +56734,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
56739
56734
  * @return {Command}
56740
56735
  */
56741
56736
  nameFromFilename(filename) {
56742
- this._name = path90.basename(filename, path90.extname(filename));
56737
+ this._name = path89.basename(filename, path89.extname(filename));
56743
56738
  return this;
56744
56739
  }
56745
56740
  /**
@@ -56753,9 +56748,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
56753
56748
  * @param {string} [path]
56754
56749
  * @return {(string|null|Command)}
56755
56750
  */
56756
- executableDir(path91) {
56757
- if (path91 === void 0) return this._executableDir;
56758
- this._executableDir = path91;
56751
+ executableDir(path90) {
56752
+ if (path90 === void 0) return this._executableDir;
56753
+ this._executableDir = path90;
56759
56754
  return this;
56760
56755
  }
56761
56756
  /**
@@ -57436,11 +57431,11 @@ function conflictPrompt(board, work = "Continue the original work from its saved
57436
57431
  work
57437
57432
  ].join("\n") : "";
57438
57433
  }
57439
- async function withSyncLock(board, work, state) {
57440
- const lock = path67.join(state ?? migrateProjectState(board), "board-sync.lock");
57434
+ async function withSyncLock(board, work) {
57435
+ const lock = path67.join(migrateProjectState(board), "board-sync.lock");
57441
57436
  const until = Date.now() + 6e4;
57442
57437
  let release;
57443
- while (!(release = tryLock(lock, state === void 0))) {
57438
+ while (!(release = tryLock(lock))) {
57444
57439
  if (Date.now() >= until) throw new BoardError("Another process is synchronizing this board. Try again.", { kind: "board-busy" });
57445
57440
  await new Promise((resolve2) => setTimeout(resolve2, 25));
57446
57441
  }
@@ -57964,7 +57959,7 @@ function findBoardUpward(from, move) {
57964
57959
  for (; ; ) {
57965
57960
  if (hasBoard(dir)) return { root: dir, board: path69.join(dir, "docs", "kanban") };
57966
57961
  if (isBoardDir(dir)) return { root: projectRootOf(dir), board: dir };
57967
- const kept2 = cloudBoardOf(dir);
57962
+ const kept2 = path69.join(dir, ".akb", "kanban");
57968
57963
  if (move !== MAKES_A_BOARD && fs68.existsSync(path69.join(kept2, "todo"))) return { root: dir, board: kept2 };
57969
57964
  const up = path69.dirname(dir);
57970
57965
  if (up === dir) return null;
@@ -57989,7 +57984,7 @@ function resolveBoard(move, { board, dir, cwd, installHint }) {
57989
57984
  if (dir !== null) {
57990
57985
  const root2 = path69.resolve(dir);
57991
57986
  if (!fs68.existsSync(root2)) die(`no such folder: ${root2}`, { kind: "no-such-folder", dir: root2 });
57992
- const kept2 = cloudBoardOf(root2);
57987
+ const kept2 = path69.join(root2, ".akb", "kanban");
57993
57988
  if (!hasBoard(root2) && move !== MAKES_A_BOARD && fs68.existsSync(path69.join(kept2, "todo"))) return whole({ root: root2, board: kept2 }, move);
57994
57989
  if (!hasBoard(root2) && move !== MAKES_A_BOARD) {
57995
57990
  die(`no board in ${root2} \u2014 it has no docs/kanban/. ${installHint}.`, {
@@ -58225,7 +58220,7 @@ function readableFile(file2) {
58225
58220
  function taskFiles(task, board, location) {
58226
58221
  const local = board && runnerProject(board) === task.project ? localTaskRecord(board, task.id) : null;
58227
58222
  const chat_file = /^task_[\w-]+$/.test(task.id) ? readableFile(taskChatFile(task.id)) : null;
58228
- if (!local) return { card_file: null, chat_file, discussion_file: null, approved_inputs_file: null, delivery: null, config_files: [] };
58223
+ if (!local) return { card_file: null, asset_folder: null, chat_file, discussion_file: null, approved_inputs_file: null, delivery: null, config_files: [] };
58229
58224
  useBoard({ root: projectRootOf(local.board), board: local.board, named: true }, false, true);
58230
58225
  const found2 = fs70.existsSync(path71.join(local.board, "todo")) && locate(local.number) || locateArchived(local.number);
58231
58226
  const card_file = found2 ? readableFile(found2.kind === "group" ? path71.join(found2.target, "root.md") : found2.target) : null;
@@ -58236,6 +58231,7 @@ function taskFiles(task, board, location) {
58236
58231
  const config_files = [projectConfigFile, ...studio2 ? [studioConfigFile(studio2), legacyStudioRuleFile(studio2)] : []].map((file2) => readableFile(path71.join(local.board, file2))).filter((file2) => file2 !== null);
58237
58232
  return {
58238
58233
  card_file,
58234
+ asset_folder: path71.join(ASSETS, String(local.number)),
58239
58235
  chat_file,
58240
58236
  discussion_file: readableFile(path71.join(local.board, ".sync", `${local.task}.discussion`, "discussion.md")),
58241
58237
  approved_inputs_file: current ? readableFile(process.env[SAVED_PREVIEW_FILE_ENV]) : null,
@@ -58330,6 +58326,7 @@ async function taskShow(id2, location = {}) {
58330
58326
  say(`${task.key} ${task.title}`);
58331
58327
  say(`${task.status}${task.studio ? ` ${task.studio.name}` : ""} ${taskUrl(task.key)}`);
58332
58328
  if (files.card_file || task.studio) say(`Card file: ${files.card_file ?? "unavailable on this computer"}`);
58329
+ if (files.asset_folder) say(`Asset folder: ${files.asset_folder}`);
58333
58330
  if (card) say(`
58334
58331
  ${card.body.trim()}`);
58335
58332
  else if (task.studio) say("The card has not been generated yet.");
@@ -59951,7 +59948,7 @@ async function asJson(res) {
59951
59948
  return value;
59952
59949
  }
59953
59950
  function entries(value) {
59954
- return Array.isArray(value) && value.every((entry) => isRecord(entry) && hasText(entry.path) && !/[\\:\0]/.test(entry.path) && entry.path.split("/").every((part) => !!part && part !== "." && part !== "..") && typeof entry.size === "number" && Number.isSafeInteger(entry.size) && entry.size >= 0 && (entry.sha256 === void 0 || typeof entry.sha256 === "string" && /^[a-f0-9]{64}$/.test(entry.sha256)));
59951
+ return Array.isArray(value) && value.every((entry) => isRecord(entry) && hasText(entry.path) && !/[\\:\0]/.test(entry.path) && entry.path.split("/").every((part) => !!part && part !== "." && part !== "..") && typeof entry.size === "number" && Number.isSafeInteger(entry.size) && entry.size >= 0 && (entry.sha256 === void 0 || typeof entry.sha256 === "string" && /^[a-f0-9]{64}$/.test(entry.sha256)) && (entry.url === void 0 || hasText(entry.url)));
59955
59952
  }
59956
59953
  async function downloadEntries(name, kind, files, to, fallback) {
59957
59954
  if (!SLUG.test(name)) throw cloudError(invalidResponse("a valid template name"));
@@ -59969,12 +59966,12 @@ async function downloadEntries(name, kind, files, to, fallback) {
59969
59966
  return refuse4(CORRUPT, fallback, invalidResponse(expected));
59970
59967
  });
59971
59968
  if (file2.sha256 && createHash8("sha256").update(bytes).digest("hex") !== file2.sha256) refuse4(CORRUPT, fallback, invalidResponse(expected));
59972
- fetched.push({ out, bytes });
59969
+ fetched.push({ out, bytes, url: file2.url });
59973
59970
  }
59974
59971
  if (fetched.length) fs76.mkdirSync(to, { recursive: true });
59975
- return fetched.map(({ out, bytes }) => {
59972
+ return fetched.map(({ out, bytes, url: url2 }) => {
59976
59973
  fs76.writeFileSync(out, bytes);
59977
- say(out);
59974
+ say(url2 ? `${out} (${url2})` : out);
59978
59975
  return out;
59979
59976
  });
59980
59977
  }
@@ -60003,9 +60000,13 @@ async function templateSearch(opts, program2) {
60003
60000
  const { templates } = await asJson(await ask(`?${query}`, {}, WITHOUT));
60004
60001
  if (templates.length === 0) say("No template matches.");
60005
60002
  for (const t of templates) {
60006
- say(`${t.name} \u2014 ${t.title} [${t.access}]`);
60003
+ const scope = t.website?.scope;
60004
+ const details = [t.access, scope, t.revision ? `rev ${t.revision}` : void 0].filter(Boolean).join(", ");
60005
+ say(`${t.name} \u2014 ${t.title} [${details}]`);
60007
60006
  say(` ${t.summary}`);
60008
- say(` tags: ${t.tags.join(", ") || "-"} \xB7 previews: ${t.previews.map((p) => p.path).join(", ") || "-"}`);
60007
+ if (t.pageUrl) say(` page: ${t.pageUrl}`);
60008
+ const previewList = t.previews.map((p) => p.url ? `${p.path} (${p.url})` : p.path).join(", ") || "-";
60009
+ say(` tags: ${t.tags.join(", ") || "-"} \xB7 previews: ${previewList}`);
60009
60010
  for (const l of t.description.split("\n")) say(` ${l}`);
60010
60011
  }
60011
60012
  return { templates };
@@ -60013,13 +60014,27 @@ async function templateSearch(opts, program2) {
60013
60014
  async function templatePreview(name, opts, program2) {
60014
60015
  if (!opts.to) usage2("Missing --to.", `${program2} template preview <name> --to <dir>`);
60015
60016
  const at = encodeURIComponent(name);
60016
- const { previews } = requireResponse(
60017
+ const { previews, revision, pageUrl } = requireResponse(
60017
60018
  await asJson(await ask(`/${at}/previews`, {}, WITHOUT)),
60018
60019
  "the template preview list",
60019
- (value) => entries(value.previews)
60020
+ (value) => entries(value.previews) && (value.revision === void 0 || hasText(value.revision)) && (value.pageUrl === void 0 || hasText(value.pageUrl))
60020
60021
  );
60021
60022
  if (previews.length === 0) say("This template has no preview.");
60022
- return { name, previews: await downloadEntries(name, "previews", previews, opts.to, WITHOUT) };
60023
+ const written = await downloadEntries(name, "previews", previews, opts.to, WITHOUT);
60024
+ if (pageUrl) say(`page: ${pageUrl}`);
60025
+ return {
60026
+ name,
60027
+ ...revision !== void 0 && { revision },
60028
+ ...pageUrl !== void 0 && { pageUrl },
60029
+ previews: written,
60030
+ files: previews.map((p, i) => ({
60031
+ path: p.path,
60032
+ file: written[i],
60033
+ size: p.size,
60034
+ ...p.sha256 !== void 0 && { sha256: p.sha256 },
60035
+ ...p.url !== void 0 && { url: p.url }
60036
+ }))
60037
+ };
60023
60038
  }
60024
60039
  async function templateGet(name, opts, program2) {
60025
60040
  if (!opts.to) usage2("Missing --to.", `${program2} template get <name> --to <dir>`);
@@ -60028,7 +60043,7 @@ async function templateGet(name, opts, program2) {
60028
60043
  const { template } = requireResponse(
60029
60044
  await asJson(await ask(`/${at}`, {}, WITHOUT)),
60030
60045
  "the template file list",
60031
- (value) => isRecord(value.template) && entries(value.template.files)
60046
+ (value) => isRecord(value.template) && entries(value.template.files) && (value.template.previews === void 0 || entries(value.template.previews))
60032
60047
  );
60033
60048
  const fetched = [];
60034
60049
  for (const f of template.files) {
@@ -60053,7 +60068,19 @@ async function templateGet(name, opts, program2) {
60053
60068
  fs76.writeFileSync(f.out, f.bytes);
60054
60069
  }
60055
60070
  say(`Fetched ${name}: ${fetched.length} files into ${to}`);
60056
- return { name, to, files: template.files.map((f) => f.path) };
60071
+ if (template.pageUrl) say(`page: ${template.pageUrl}`);
60072
+ for (const p of template.previews ?? []) {
60073
+ if (p.url) say(`preview: ${p.path} (${p.url})`);
60074
+ }
60075
+ return {
60076
+ name,
60077
+ to,
60078
+ files: template.files.map((f) => f.path),
60079
+ ...template.title !== void 0 && { title: template.title },
60080
+ ...template.revision !== void 0 && { revision: template.revision },
60081
+ ...template.pageUrl !== void 0 && { pageUrl: template.pageUrl },
60082
+ ...template.previews !== void 0 && { previews: template.previews }
60083
+ };
60057
60084
  }
60058
60085
  async function templateSource(name, opts) {
60059
60086
  const at = encodeURIComponent(name);
@@ -64347,7 +64374,7 @@ var init_archive2 = __esm({
64347
64374
  var board_default;
64348
64375
  var init_board2 = __esm({
64349
64376
  "../cli/src/guide/board.md"() {
64350
- 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/ `config.md` \u2014 project defaults; `studios/<studio>/config.md` \u2014 Studio configuration\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\nWrite task assets to `docs/kanban/.assets/<id>/` and link them as `.assets/<id>/\u2026` in the card.\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\nUse `akb task show <task>` for the current card, Review, Preview references and saved materials.\nCheck the current Studio instructions, shared rules and project and Studio configurations before\nworking. Read linked files, applicable Preview definitions, component documentation and memory\nas needed. Write results in matching Preview blocks and preserve unrelated work. When reading scoped\npreferences for a specific output, match its configuration to the current action and the task's\nproject (`akb task show <id> --json`).\n\nReread configuration before Land and after a Setup answer. Studio preferences override project\ndefaults for the same key. Ask through `akb guide update-questions` when a required Setup choice\nfirst matters. Pause the dependent action and use declared defaults for optional choices.\nCheck required credentials on the executing Runner without printing secrets. Use a read-only\ncheck when available. If missing or invalid, ask the user to configure them locally or follow\nthe Studio's fallback. Keep credentials out of cards, configuration, synced files and logs. Do not write memory in task runs.\n\n## Preview selection\n\n- **Read the Studio first**: before choosing Previews, read its `STUDIO.md` (`akb studio file <studio> STUDIO.md`), relevant linked files, and its configuration (`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";
64377
+ 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/ `config.md` \u2014 project defaults; `studios/<studio>/config.md` \u2014 Studio configuration\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\nUse `akb task show <task>` for the current card, Review, Preview references and saved materials.\nCheck the current Studio instructions, shared rules and project and Studio configurations before\nworking. Read linked files, applicable Preview definitions, component documentation and memory\nas needed. Write results in matching Preview blocks and preserve unrelated work. When reading scoped\npreferences for a specific output, match its configuration to the current action and the task's\nproject (`akb task show <id> --json`).\n\nSave task assets in the `Asset folder` shown by `akb task show <id>` and reference them as\n`.assets/<id>/\u2026` in the card. Keep `todo/.assets/` clear.\n\nReread configuration before Land and after a Setup answer. Studio preferences override project\ndefaults for the same key. Ask through `akb guide update-questions` when a required Setup choice\nfirst matters. Pause the dependent action and use declared defaults for optional choices.\nCheck required credentials on the executing Runner without printing secrets. Use a read-only\ncheck when available. If missing or invalid, ask the user to configure them locally or follow\nthe Studio's fallback. Keep credentials out of cards, configuration, synced files and logs. Do not write memory in task runs.\n\n## Preview selection\n\n- **Read the Studio first**: before choosing Previews, read its `STUDIO.md` (`akb studio file <studio> STUDIO.md`), relevant linked files, and its configuration (`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";
64351
64378
  }
64352
64379
  });
64353
64380
 
@@ -64459,7 +64486,7 @@ var init_refine = __esm({
64459
64486
  var reflect_default;
64460
64487
  var init_reflect = __esm({
64461
64488
  "../cli/src/guide/reflect.md"() {
64462
- 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.\n\n## Filter\n\n- **Evidence**: verify each candidate against the current project and skip resolved issues or unsupported guesses.\n- **Impact**: skip minor or low-impact work and propose only issues with concrete impact that warrant a separate task.\n- **Duplicates**: check open tasks (`akb board list`), pending items in `docs/kanban/triage/`, and the rest of this batch; skip work already covered. If shipped work invalidates an open task\'s plan, run `akb task revise <id> "<the change and why>"`.\n- **Prior decisions**: skip 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\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, with its evidence and impact. Submit nothing if no candidate qualifies.\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';
64489
+ 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.\n\n## Filter\n\n- **Evidence**: verify each candidate against current project state or deliverables, citing specific evidence and skipping resolved or unsupported items.\n- **Impact**: propose a separate task only for material impact on users, workflows, deliverables, or stated project goals\u2014never minor polish or speculation.\n- **Duplicates**: compare requested outcomes with open tasks (`akb board list`), pending triage, and the rest of this batch; skip work they already cover. If shipped work invalidates an open task\'s plan, run `akb task revise <id> "<the change and why>"`.\n- **Prior decisions**: skip 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`. Revisit a low-value dismissal only when new evidence establishes material impact.\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 qualifying proposal. Submit nothing if none qualify.\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';
64463
64490
  }
64464
64491
  });
64465
64492
 
@@ -68996,7 +69023,6 @@ import { fileURLToPath as fileURLToPath5 } from "node:url";
68996
69023
 
68997
69024
  // ../cli/src/lib/cli/akb.ts
68998
69025
  init_agent2();
68999
- import path89 from "node:path";
69000
69026
 
69001
69027
  // ../cli/src/lib/cli/setup.ts
69002
69028
  import fs91 from "node:fs";
@@ -69144,13 +69170,11 @@ function declareSetup(program2, cli) {
69144
69170
 
69145
69171
  // ../cli/src/lib/cli/akb.ts
69146
69172
  init_shared2();
69147
- init_project();
69148
69173
  function buildAkbProgram(cli) {
69149
69174
  const program2 = withShared(newCommand(cli.program));
69150
69175
  program2.description("set up a board, and put an agent to work on it.").helpCommand("help [command]", "this list, or one command in full");
69151
69176
  declareSetup(program2, cli);
69152
69177
  declareRuns(program2, cli);
69153
- program2.command("__prepare-board", { hidden: true }).argument("<project>").action((project2) => prepareCloudBoard(path89.resolve(cli.cwd, project2)));
69154
69178
  return program2;
69155
69179
  }
69156
69180
 
@@ -69158,11 +69182,12 @@ function buildAkbProgram(cli) {
69158
69182
  init_shared2();
69159
69183
  init_usage();
69160
69184
  init_board_cli();
69185
+ var WATCH = "__watch";
69161
69186
  async function runAgent2(argv, options = {}) {
69162
69187
  const { program: program2 = "akb", cwd = process.cwd(), installHint = BOARD_LINK_HINT } = options;
69163
69188
  const raw = rawArgv(argv);
69164
69189
  if (raw) return runBoard(raw, { program: `${program2} raw`, cwd, installHint });
69165
- if (argv[0] !== "__watch" && argv[0] !== "__prepare-board") reportAppOpen();
69190
+ if (argv[0] !== WATCH) reportAppOpen();
69166
69191
  return runProgram(buildAkbProgram({ program: program2, cwd, installHint }), argv, program2);
69167
69192
  }
69168
69193