wildcrane-runner 0.6.33 → 0.6.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/runner.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.33 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.35 — built by runner/scripts/build.mjs. Do not edit.
2
2
  import { createRequire as __ai4kanbanRequire } from 'node:module'
3
3
  const require = __ai4kanbanRequire(import.meta.url)
4
4
  var __create = Object.create;
@@ -111343,8 +111343,8 @@ function machineId() {
111343
111343
  var machineName = () => os2.hostname().replace(/\.local$/, "");
111344
111344
 
111345
111345
  // src/i18n.ts
111346
- var ZH_HOLDER = { "claude-code": "Claude Code", codex: "Codex", terminal: "\u672C\u673A\u7EC8\u7AEF" };
111347
- var EN_HOLDER = { "claude-code": "Claude Code", codex: "Codex", terminal: "the terminal" };
111346
+ var ZH_HOLDER = { "claude-code": "Claude Code", codex: "Codex", cursor: "Cursor", dsh: "dsh", zcode: "ZCode", kimi: "Kimi Code", terminal: "\u672C\u673A\u7EC8\u7AEF" };
111347
+ var EN_HOLDER = { "claude-code": "Claude Code", codex: "Codex", cursor: "Cursor", dsh: "dsh", zcode: "ZCode", kimi: "Kimi Code", terminal: "the terminal" };
111348
111348
  var ZH = {
111349
111349
  signIn: (url) => `\u8BF7\u5728\u6D4F\u89C8\u5668\u4E2D\u767B\u5F55 WildCrane\uFF1A
111350
111350
  ${url}`,
@@ -111400,8 +111400,8 @@ function status(line) {
111400
111400
  }
111401
111401
 
111402
111402
  // src/protocol.ts
111403
- var VERSION = true ? "0.6.33" : "0.0.0";
111404
- var AKB_VERSION = true ? "0.11.30" : "0.0.0";
111403
+ var VERSION = true ? "0.6.35" : "0.0.0";
111404
+ var AKB_VERSION = true ? "0.11.31" : "0.0.0";
111405
111405
  var AKB_CONTRACT = true ? 7 : 0;
111406
111406
  var EXIT_REFUSED = 10;
111407
111407
  var EXIT_OUTDATED = 11;
@@ -112082,6 +112082,16 @@ function eventModel(ev) {
112082
112082
  return void 0;
112083
112083
  }
112084
112084
  function whyItFailed(ev) {
112085
+ const why2 = failedWith(ev);
112086
+ const fix = USER_FIXES.find(([pattern]) => pattern.test(why2))?.[1];
112087
+ return fix ? `${why2}
112088
+ ${fix}` : why2;
112089
+ }
112090
+ var USER_FIXES = [
112091
+ [/failed to authenticate|invalid api key|oauth token|please run \/login|not logged in/i, "Sign in to Claude Code again: run `claude` and enter /login."],
112092
+ [/usage limit|credit balance is too low|quota/i, "Wait for the usage limit to reset, or add credit, then press Resume."]
112093
+ ];
112094
+ function failedWith(ev) {
112085
112095
  const errors = Array.isArray(ev.errors) ? ev.errors.map(str).filter(Boolean) : [];
112086
112096
  if (errors.length) return errors.join("; ");
112087
112097
  const named2 = str(ev.subtype) || str(ev.terminal_reason);
@@ -112926,7 +112936,7 @@ function createTail(log) {
112926
112936
  // ../cli/package.json
112927
112937
  var package_default = {
112928
112938
  name: "wildcrane",
112929
- version: "0.11.30",
112939
+ version: "0.11.31",
112930
112940
  akbContract: 7,
112931
112941
  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.",
112932
112942
  keywords: [
@@ -112939,7 +112949,7 @@ var package_default = {
112939
112949
  "markdown",
112940
112950
  "board"
112941
112951
  ],
112942
- license: "FSL-1.1-ALv2",
112952
+ license: "Apache-2.0",
112943
112953
  homepage: "https://wildcrane.ai/",
112944
112954
  repository: {
112945
112955
  type: "git",
@@ -116093,11 +116103,14 @@ import path18 from "node:path";
116093
116103
  import { fileURLToPath, pathToFileURL } from "node:url";
116094
116104
  var akbHome = () => path18.join(runnerHome(), "bin", "akb");
116095
116105
  var BUNDLED_SHIM = `bundled-${AKB_VERSION}`;
116096
- var PRELOAD = path18.join(path18.dirname(fileURLToPath(import.meta.url)), "akb-proxy.mjs");
116097
- var akbArgs = (entry) => fs14.existsSync(PRELOAD) ? ["--import", pathToFileURL(PRELOAD).href, entry] : [entry];
116098
- var bundledAkb = () => ({
116106
+ var HERE = path18.dirname(fileURLToPath(import.meta.url));
116107
+ function akbArgs(entry, dist = HERE) {
116108
+ const preload = path18.join(dist, "akb-proxy.mjs");
116109
+ return fs14.existsSync(preload) ? ["--import", pathToFileURL(preload).href, entry] : [entry];
116110
+ }
116111
+ var bundledAkb = (dist = HERE) => ({
116099
116112
  command: process.execPath,
116100
- args: akbArgs(path18.join(path18.dirname(fileURLToPath(import.meta.url)), "akb", "bin", "ai4kanban.mjs")),
116113
+ args: akbArgs(path18.join(dist, "akb", "bin", "ai4kanban.mjs"), dist),
116101
116114
  version: AKB_VERSION,
116102
116115
  shim: path18.join(akbHome(), BUNDLED_SHIM)
116103
116116
  });
@@ -116702,8 +116715,8 @@ async function reviewChats(machineId2, runtimes, now = Date.now()) {
116702
116715
  }
116703
116716
 
116704
116717
  // src/board-watch.ts
116705
- import fs33 from "node:fs";
116706
- import path37 from "node:path";
116718
+ import fs34 from "node:fs";
116719
+ import path38 from "node:path";
116707
116720
 
116708
116721
  // ../cli/src/lib/shared/board-files.ts
116709
116722
  var ROOTS = ["todo/", ".archive/", "memory/", "workflows/", "triage/", "assets/", "rules/"];
@@ -116754,7 +116767,7 @@ function cardFront(body) {
116754
116767
  }
116755
116768
 
116756
116769
  // ../artifact-sdk/src/builtin/compare.json
116757
- var compare_default = '{\n "name": "compare",\n "title": { "en": "Compare", "zh": "\u5BF9\u6BD4" },\n "types": ["compare"],\n "schema": {\n "type": "object",\n "required": ["a", "b"],\n "properties": { "a": { "type": "string" }, "b": { "type": "string" } }\n },\n "references": [\n { "json": "/a", "types": ["storyboard", "compare"] },\n { "json": "/b", "types": ["storyboard", "compare"] },\n { "json": "/shots", "types": ["storyboard", "compare"] }\n ]\n}\n';
116770
+ var compare_default = '{\n "name": "compare",\n "title": { "en": "Compare", "zh": "\u5BF9\u6BD4" },\n "types": ["compare"],\n "schema": {\n "type": "object",\n "required": ["a", "b"],\n "properties": { "a": { "type": "string" }, "b": { "type": "string" } }\n },\n "references": [\n { "json": "/a", "types": ["storyboard", "compare", "spritesheet", "workflow"] },\n { "json": "/b", "types": ["storyboard", "compare", "spritesheet", "workflow"] },\n { "json": "/shots", "types": ["storyboard", "compare", "spritesheet", "workflow"] }\n ]\n}\n';
116758
116771
 
116759
116772
  // ../artifact-sdk/src/builtin/html.json
116760
116773
  var html_default = `{
@@ -116790,7 +116803,7 @@ var markdown_default = `{
116790
116803
  var spritesheet_default = '{\n "name": "spritesheet",\n "title": { "en": "Sprite animation", "zh": "\u7CBE\u7075\u52A8\u753B" },\n "types": ["spritesheet"],\n "schema": {\n "type": "object",\n "required": ["frames", "meta"],\n "properties": {\n "frames": {\n "anyOf": [\n { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["frame"] } },\n { "type": "object", "additionalProperties": { "type": "object", "required": ["frame"] } }\n ]\n },\n "meta": {\n "type": "object",\n "required": ["app", "image"],\n "properties": { "app": { "type": "string", "pattern": "codeandweb\\\\.com/texturepacker" }, "image": { "type": "string" } }\n }\n }\n },\n "references": [{ "json": "/meta/image" }]\n}\n';
116791
116804
 
116792
116805
  // ../artifact-sdk/src/builtin/storyboard.json
116793
- var storyboard_default = '{\n "name": "storyboard",\n "title": { "en": "Storyboard", "zh": "\u5206\u955C" },\n "types": ["storyboard"],\n "schema": {\n "type": "object",\n "anyOf": [{ "required": ["shots"] }, { "required": ["slides"] }],\n "properties": {\n "shots": {\n "type": "array",\n "items": {\n "type": "object",\n "properties": { "frames": { "type": "array", "items": { "type": "object", "properties": { "src": { "type": "string" } } } } }\n }\n },\n "slides": {\n "type": "array",\n "items": {\n "type": "object",\n "properties": {\n "preview": { "type": "object", "properties": { "src": { "type": "string" } } },\n "assets": { "type": "array", "items": { "type": "string" } }\n }\n }\n }\n }\n },\n "references": [\n { "json": "/shots/*/frames/*/src" },\n { "json": "/slides/*/preview/src" },\n { "json": "/slides/*/assets/*" }\n ]\n}\n';
116806
+ var storyboard_default = '{\n "name": "storyboard",\n "title": { "en": "Storyboard", "zh": "\u5206\u955C" },\n "types": ["storyboard"],\n "schema": {\n "type": "object",\n "anyOf": [{ "required": ["shots"] }, { "required": ["slides"] }],\n "properties": {\n "shots": {\n "type": "array",\n "items": {\n "type": "object",\n "properties": { "frames": { "type": "array", "items": { "type": "object", "properties": { "src": { "type": "string" } } } } }\n }\n },\n "slides": {\n "type": "array",\n "items": {\n "type": "object",\n "properties": {\n "preview": { "type": "object", "properties": { "src": { "type": "string" } } },\n "assets": { "type": "array", "items": { "type": "string" } }\n }\n }\n }\n }\n },\n "references": [\n { "json": "/shots/*/frames/*/src", "types": ["storyboard", "compare", "spritesheet", "workflow"] },\n { "json": "/slides/*/preview/src", "types": ["storyboard", "compare", "spritesheet", "workflow"] },\n { "json": "/slides/*/assets/*" }\n ]\n}\n';
116794
116807
 
116795
116808
  // ../artifact-sdk/src/builtin/tiled.json
116796
116809
  var tiled_default = `{
@@ -116932,7 +116945,7 @@ function referencesOf(manifest, content) {
116932
116945
  // ../artifact-sdk/src/internal/references.ts
116933
116946
  var STORYBOARD = ["storyboard"];
116934
116947
  var WORKFLOW = ["workflow"];
116935
- var COMPARE = ["storyboard", "compare"];
116948
+ var ARRANGED = ["storyboard", "compare", "spritesheet", "workflow"];
116936
116949
  var ASSET = ["spritesheet", "asset"];
116937
116950
  var isObject2 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
116938
116951
  function bodyReferences(body) {
@@ -116968,7 +116981,7 @@ function bodyReferences(body) {
116968
116981
  for (const p2 of m[2].matchAll(/([\w-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g)) a2[p2[1]] = p2[2] ?? p2[3];
116969
116982
  if (m[1] === "Compare") {
116970
116983
  if (!a2.a || !a2.b) continue;
116971
- for (const k2 of ["a", "b", "shots"]) if (a2[k2]) out.push({ src: a2[k2], types: COMPARE });
116984
+ for (const k2 of ["a", "b", "shots"]) if (a2[k2]) out.push({ src: a2[k2], types: ARRANGED });
116972
116985
  } else if (a2.src) {
116973
116986
  out.push({ src: a2.src, types: m[1] === "Storyboard" ? STORYBOARD : m[1] === "Workflow" ? WORKFLOW : m[1] === "Asset" ? ASSET : [] });
116974
116987
  if (a2.variants) {
@@ -117113,10 +117126,9 @@ function collect(body, card, host) {
117113
117126
  }
117114
117127
 
117115
117128
  // src/task-folder.ts
117116
- import { spawnSync as spawnSync3 } from "node:child_process";
117117
117129
  import crypto5 from "node:crypto";
117118
- import fs32 from "node:fs";
117119
- import path36 from "node:path";
117130
+ import fs33 from "node:fs";
117131
+ import path37 from "node:path";
117120
117132
 
117121
117133
  // node_modules/node-diff3/dist/diff3.mjs
117122
117134
  function LCS(buffer1, buffer2) {
@@ -119246,9 +119258,63 @@ function renderError(error) {
119246
119258
  // src/task-folder.ts
119247
119259
  init_dress_page();
119248
119260
 
119249
- // ../cli/src/lib/agents/shared-memory.ts
119261
+ // src/kanban-skill.ts
119262
+ import { spawnSync as spawnSync3 } from "node:child_process";
119250
119263
  import fs31 from "node:fs";
119251
119264
  import path35 from "node:path";
119265
+
119266
+ // ../skill/SKILL.md
119267
+ var SKILL_default = '---\nname: kanban\ndescription: Manage the file-based task board with akb. Use for creating and planning tasks, revising or implementing cards, and managing background runs; also for "what\'s running".\n---\n\n# Kanban board\n\nThe board is worked only through `akb`. Find the command for the job in `akb help` and run\nit; never do its work by hand or from memory.\n\n- **`--print` does it here**: `akb card revise 12 --print "drop the export"` prints the whole\n flow for that card on this board; follow it to its closing steps. Without `--print` the\n same command starts a separate agent.\n- **Keys**: never read or write API keys; the user sets them with `akb agent set apiKey`.\n';
119268
+
119269
+ // src/kanban-skill.ts
119270
+ var SKILL_FOLDERS = [".claude/skills/kanban", ".agents/skills/kanban"];
119271
+ var CONTENT = `${SKILL_default.trimEnd()}
119272
+
119273
+ <!-- ai4kanban managed -->
119274
+ `;
119275
+ var MANAGED = /^<!-- ai4kanban \S+ -->$/m;
119276
+ function prepareKanbanSkill(root2) {
119277
+ for (const folder of SKILL_FOLDERS) {
119278
+ const dir = path35.join(root2, folder);
119279
+ const file2 = path35.join(dir, "SKILL.md");
119280
+ try {
119281
+ let linked = false;
119282
+ let at2 = root2;
119283
+ for (const name of `${folder}/SKILL.md`.split("/")) {
119284
+ at2 = path35.join(at2, name);
119285
+ if (fs31.lstatSync(at2, { throwIfNoEntry: false })?.isSymbolicLink()) linked = true;
119286
+ }
119287
+ const held4 = fs31.existsSync(file2) ? fs31.readFileSync(file2, "utf8") : null;
119288
+ const exists = fs31.lstatSync(dir, { throwIfNoEntry: false }) !== void 0;
119289
+ if (linked || exists && !MANAGED.test(held4 ?? "")) {
119290
+ if (!held4?.trim()) throw new Error("\u7528\u6237\u81EA\u6709\u76EE\u5F55\u6216\u7B26\u53F7\u94FE\u63A5\u4E2D\u7F3A\u5C11\u53EF\u8BFB\u7684 SKILL.md");
119291
+ continue;
119292
+ }
119293
+ if (held4 !== CONTENT) {
119294
+ fs31.mkdirSync(dir, { recursive: true });
119295
+ fs31.writeFileSync(file2, CONTENT);
119296
+ }
119297
+ } catch (e2) {
119298
+ throw new Error(`\u65E0\u6CD5\u51C6\u5907 ${folder}\uFF1A${e2 instanceof Error ? e2.message : String(e2)}`);
119299
+ }
119300
+ }
119301
+ }
119302
+ function keepOutOfGit(dir, folders2 = SKILL_FOLDERS) {
119303
+ const git3 = (...args) => spawnSync3("git", ["-C", dir, ...args], { encoding: "utf8" });
119304
+ const inside = git3("rev-parse", "--git-path", "info/exclude");
119305
+ if (inside.status !== 0) return;
119306
+ const missing = [".akb/", ...folders2.map((f2) => `${f2}/`)].filter((p2) => git3("check-ignore", "-q", p2).status !== 0);
119307
+ if (!missing.length) return;
119308
+ const exclude = path35.resolve(dir, inside.stdout.trim());
119309
+ fs31.mkdirSync(path35.dirname(exclude), { recursive: true });
119310
+ const held4 = fs31.existsSync(exclude) ? fs31.readFileSync(exclude, "utf8") : "";
119311
+ fs31.writeFileSync(exclude, `${held4}${held4 && !held4.endsWith("\n") ? "\n" : ""}${missing.join("\n")}
119312
+ `);
119313
+ }
119314
+
119315
+ // ../cli/src/lib/agents/shared-memory.ts
119316
+ import fs32 from "node:fs";
119317
+ import path36 from "node:path";
119252
119318
  function sharedMemory(board) {
119253
119319
  const declared = /* @__PURE__ */ new Map();
119254
119320
  const take = (folder, text4, builtIn) => {
@@ -119260,16 +119326,16 @@ function sharedMemory(board) {
119260
119326
  const at2 = /^([^/]+)\/AGENT\.md$/.exec(key);
119261
119327
  if (at2) take(at2[1], text4, officialAgent(at2[1]));
119262
119328
  }
119263
- const root2 = path35.join(board, "agents");
119329
+ const root2 = path36.join(board, "agents");
119264
119330
  let folders2 = [];
119265
119331
  try {
119266
- folders2 = fs31.readdirSync(root2, { withFileTypes: true }).filter((e2) => e2.isDirectory() && !e2.name.startsWith(".")).map((e2) => e2.name);
119332
+ folders2 = fs32.readdirSync(root2, { withFileTypes: true }).filter((e2) => e2.isDirectory() && !e2.name.startsWith(".")).map((e2) => e2.name);
119267
119333
  } catch {
119268
119334
  }
119269
119335
  for (const folder of folders2.sort()) {
119270
119336
  let text4 = null;
119271
119337
  try {
119272
- text4 = fs31.readFileSync(path35.join(root2, folder, "AGENT.md"), "utf8");
119338
+ text4 = fs32.readFileSync(path36.join(root2, folder, "AGENT.md"), "utf8");
119273
119339
  } catch {
119274
119340
  }
119275
119341
  take(folder, text4, false);
@@ -119294,16 +119360,16 @@ function openTaskFolder(job, projectDir2) {
119294
119360
  if (!projectDir2) throw new Error(NO_FOLDER);
119295
119361
  keepOutOfGit(projectDir2);
119296
119362
  markUsed(projectDir2);
119297
- const board = path36.join(projectDir2, ".akb", "kanban");
119298
- fs32.mkdirSync(board, { recursive: true });
119363
+ const board = path37.join(projectDir2, ".akb", "kanban");
119364
+ fs33.mkdirSync(board, { recursive: true });
119299
119365
  return { task, cloudTask: task, board, cwd: projectDir2, project: job.project, number: job.number ?? null, workflow: job.workflow ?? job.flow?.workflow ?? null };
119300
119366
  }
119301
119367
  function openAgentFolder(job, projectDir2) {
119302
119368
  if (!job.project || !job.agent) throw new Error("This job names no project.");
119303
119369
  keepOutOfGit(projectDir2);
119304
119370
  markUsed(projectDir2);
119305
- const board = path36.join(projectDir2, ".akb", "kanban");
119306
- fs32.mkdirSync(board, { recursive: true });
119371
+ const board = path37.join(projectDir2, ".akb", "kanban");
119372
+ fs33.mkdirSync(board, { recursive: true });
119307
119373
  return {
119308
119374
  task: `agent-${safe2(job.agent.workflow ? `${job.agent.workflow}-${job.agent.name}` : job.agent.name)}`,
119309
119375
  cloudTask: job.agent.tasks?.[0]?.id ?? null,
@@ -119318,13 +119384,13 @@ function openDiscussionFolder(job, projectDir2) {
119318
119384
  if (!job.project) throw new Error("This job names no project.");
119319
119385
  keepOutOfGit(projectDir2);
119320
119386
  markUsed(projectDir2);
119321
- const board = path36.join(projectDir2, ".akb", "kanban");
119322
- fs32.mkdirSync(board, { recursive: true });
119387
+ const board = path37.join(projectDir2, ".akb", "kanban");
119388
+ fs33.mkdirSync(board, { recursive: true });
119323
119389
  return { task: "discussion", cloudTask: null, board, cwd: projectDir2, project: job.project, number: null, workflow: null };
119324
119390
  }
119325
119391
  var boardFolder = (ws) => ({ task: "board", cloudTask: null, board: ws.board, cwd: ws.cwd, project: ws.project, number: null, workflow: null });
119326
119392
  function keptBoard(cwd) {
119327
- const board = path36.join(cwd, ".akb", "kanban");
119393
+ const board = path37.join(cwd, ".akb", "kanban");
119328
119394
  const base = readBase({ cwd });
119329
119395
  const project = base.project ?? /^projects\/([^/]+)\//.exec(Object.keys(base.files).find((p2) => p2.startsWith("projects/")) ?? "")?.[1];
119330
119396
  return base.head_seq === null || !project ? null : boardFolder({ board, cwd, project });
@@ -119339,64 +119405,51 @@ function inFolder(dir, work) {
119339
119405
  return next;
119340
119406
  }
119341
119407
  var safe2 = (name) => name.replace(/[^\w.-]/g, "_") || "default";
119342
- var SKILL_FOLDERS = [".claude/skills/kanban", ".agents/skills/kanban"];
119343
119408
  var SKILL_ROOTS = [".claude/skills", ".agents/skills"];
119344
- function keepOutOfGit(dir, folders2 = SKILL_FOLDERS) {
119345
- const git3 = (...args) => spawnSync3("git", ["-C", dir, ...args], { encoding: "utf8" });
119346
- const inside = git3("rev-parse", "--git-path", "info/exclude");
119347
- if (inside.status !== 0) return;
119348
- const missing = [".akb/", ...folders2.map((f2) => `${f2}/`)].filter((p2) => git3("check-ignore", "-q", p2).status !== 0);
119349
- if (!missing.length) return;
119350
- const exclude = path36.resolve(dir, inside.stdout.trim());
119351
- fs32.mkdirSync(path36.dirname(exclude), { recursive: true });
119352
- const held4 = fs32.existsSync(exclude) ? fs32.readFileSync(exclude, "utf8") : "";
119353
- fs32.writeFileSync(exclude, `${held4}${held4 && !held4.endsWith("\n") ? "\n" : ""}${missing.join("\n")}
119354
- `);
119355
- }
119356
- var cardFile = (ws) => (ws.number ? findCard(ws.board, ws.number) : null) ?? path36.join(ws.board, "todo", `${ws.number ?? 0}-task.md`);
119409
+ var cardFile = (ws) => (ws.number ? findCard(ws.board, ws.number) : null) ?? path37.join(ws.board, "todo", `${ws.number ?? 0}-task.md`);
119357
119410
  function findCard(board, number) {
119358
119411
  const named2 = new RegExp(`^${number}-`);
119359
119412
  const walk = (dir) => {
119360
119413
  let entries;
119361
119414
  try {
119362
- entries = fs32.readdirSync(dir, { withFileTypes: true });
119415
+ entries = fs33.readdirSync(dir, { withFileTypes: true });
119363
119416
  } catch {
119364
119417
  return null;
119365
119418
  }
119366
119419
  for (const e2 of entries) {
119367
119420
  if (!named2.test(e2.name)) continue;
119368
- if (e2.isFile() && e2.name.endsWith(".md")) return path36.join(dir, e2.name);
119369
- const root2 = path36.join(dir, e2.name, "root.md");
119370
- if (e2.isDirectory() && fs32.existsSync(root2)) return root2;
119421
+ if (e2.isFile() && e2.name.endsWith(".md")) return path37.join(dir, e2.name);
119422
+ const root2 = path37.join(dir, e2.name, "root.md");
119423
+ if (e2.isDirectory() && fs33.existsSync(root2)) return root2;
119371
119424
  }
119372
119425
  for (const e2 of entries) if (e2.isDirectory() && !e2.name.startsWith(".")) {
119373
- const hit = walk(path36.join(dir, e2.name));
119426
+ const hit = walk(path37.join(dir, e2.name));
119374
119427
  if (hit) return hit;
119375
119428
  }
119376
119429
  return null;
119377
119430
  };
119378
- return walk(path36.join(board, "todo")) ?? walk(path36.join(board, ".archive"));
119431
+ return walk(path37.join(board, "todo")) ?? walk(path37.join(board, ".archive"));
119379
119432
  }
119380
119433
  function akbCardOf(ws) {
119381
119434
  return ws.number && findCard(ws.board, ws.number) ? ws.number : void 0;
119382
119435
  }
119383
- var recordFile = (ws) => path36.join(ws.board, ".sync", `${ws.task}.json`);
119436
+ var recordFile = (ws) => path37.join(ws.board, ".sync", `${ws.task}.json`);
119384
119437
  function readRecord(ws) {
119385
119438
  try {
119386
- return { ...EMPTY, ...JSON.parse(fs32.readFileSync(recordFile(ws), "utf8")) };
119439
+ return { ...EMPTY, ...JSON.parse(fs33.readFileSync(recordFile(ws), "utf8")) };
119387
119440
  } catch {
119388
119441
  return structuredClone(EMPTY);
119389
119442
  }
119390
119443
  }
119391
119444
  function writeRecord(ws, record) {
119392
- fs32.mkdirSync(path36.dirname(recordFile(ws)), { recursive: true });
119393
- fs32.writeFileSync(recordFile(ws), `${JSON.stringify(record, null, 2)}
119445
+ fs33.mkdirSync(path37.dirname(recordFile(ws)), { recursive: true });
119446
+ fs33.writeFileSync(recordFile(ws), `${JSON.stringify(record, null, 2)}
119394
119447
  `);
119395
119448
  }
119396
- var baseFile = (ws) => path36.join(ws.cwd, ".akb", "base.json");
119449
+ var baseFile = (ws) => path37.join(ws.cwd, ".akb", "base.json");
119397
119450
  function readBase(ws) {
119398
119451
  try {
119399
- const base = JSON.parse(fs32.readFileSync(baseFile(ws), "utf8"));
119452
+ const base = JSON.parse(fs33.readFileSync(baseFile(ws), "utf8"));
119400
119453
  if (base.layout === "workspace") return base;
119401
119454
  } catch {
119402
119455
  }
@@ -119404,25 +119457,25 @@ function readBase(ws) {
119404
119457
  }
119405
119458
  function writeBase(ws, base) {
119406
119459
  const file2 = baseFile(ws);
119407
- fs32.mkdirSync(path36.dirname(file2), { recursive: true });
119408
- fs32.writeFileSync(`${file2}.tmp`, JSON.stringify(base));
119409
- fs32.renameSync(`${file2}.tmp`, file2);
119460
+ fs33.mkdirSync(path37.dirname(file2), { recursive: true });
119461
+ fs33.writeFileSync(`${file2}.tmp`, JSON.stringify(base));
119462
+ fs33.renameSync(`${file2}.tmp`, file2);
119410
119463
  }
119411
119464
  var hashOf2 = (bytes2) => crypto5.createHash("sha256").update(bytes2).digest("hex");
119412
119465
  function hashFile(file2) {
119413
119466
  try {
119414
- return hashOf2(fs32.readFileSync(file2));
119467
+ return hashOf2(fs33.readFileSync(file2));
119415
119468
  } catch {
119416
119469
  return null;
119417
119470
  }
119418
119471
  }
119419
119472
  function write(file2, bytes2) {
119420
- fs32.mkdirSync(path36.dirname(file2), { recursive: true });
119421
- fs32.writeFileSync(file2, bytes2);
119473
+ fs33.mkdirSync(path37.dirname(file2), { recursive: true });
119474
+ fs33.writeFileSync(file2, bytes2);
119422
119475
  }
119423
119476
  function readText(file2) {
119424
119477
  try {
119425
- return fs32.readFileSync(file2, "utf8");
119478
+ return fs33.readFileSync(file2, "utf8");
119426
119479
  } catch {
119427
119480
  return null;
119428
119481
  }
@@ -119430,14 +119483,14 @@ function readText(file2) {
119430
119483
  function filesUnder(dir, base = dir) {
119431
119484
  let entries;
119432
119485
  try {
119433
- entries = fs32.readdirSync(dir, { withFileTypes: true });
119486
+ entries = fs33.readdirSync(dir, { withFileTypes: true });
119434
119487
  } catch {
119435
119488
  return [];
119436
119489
  }
119437
119490
  return entries.flatMap((e2) => {
119438
- const full = path36.join(dir, e2.name);
119491
+ const full = path37.join(dir, e2.name);
119439
119492
  if (e2.isDirectory()) return filesUnder(full, base);
119440
- return e2.isFile() ? [path36.relative(base, full).split(path36.sep).join("/")] : [];
119493
+ return e2.isFile() ? [path37.relative(base, full).split(path37.sep).join("/")] : [];
119441
119494
  });
119442
119495
  }
119443
119496
  var kept3 = isBoardPath;
@@ -119460,18 +119513,18 @@ function assetFiles(ws, list) {
119460
119513
  return null;
119461
119514
  }
119462
119515
  };
119463
- return new Set(Object.keys(assetsOf(list)).map(at2).filter((f2) => !!f2).map((f2) => path36.relative(ws.board, f2).split(path36.sep).join("/")));
119516
+ return new Set(Object.keys(assetsOf(list)).map(at2).filter((f2) => !!f2).map((f2) => path37.relative(ws.board, f2).split(path37.sep).join("/")));
119464
119517
  }
119465
119518
  var assetsListOf = (ws, base) => base.files[rootOf(ws) + assetsFile(ws.task)]?.content;
119466
119519
  var localFiles = (ws, base) => {
119467
- const assets = /* @__PURE__ */ new Set([...assetFiles(ws, assetsListOf(ws, base)), ...assetFiles(ws, readText(path36.join(ws.board, assetsFile(ws.task))))]);
119520
+ const assets = /* @__PURE__ */ new Set([...assetFiles(ws, assetsListOf(ws, base)), ...assetFiles(ws, readText(path37.join(ws.board, assetsFile(ws.task))))]);
119468
119521
  return filesUnder(ws.board).filter((p2) => kept3(p2) && !assets.has(p2));
119469
119522
  };
119470
119523
  var SKILL_PATH = /^skills\/([a-z0-9]+(?:-[a-z0-9]+)*)\/((?:[\w.-]+\/)*[\w.-]+)$/;
119471
119524
  function pullTools(ws, record, files) {
119472
119525
  const held4 = record.tools?.skills ?? {};
119473
119526
  const ours = new Set(Object.keys(held4).map((name) => name.split("/")[1]));
119474
- const theirs = (skill) => !ours.has(skill) && SKILL_ROOTS.some((root2) => fs32.existsSync(path36.join(ws.cwd, root2, skill)));
119527
+ const theirs = (skill) => !ours.has(skill) && SKILL_ROOTS.some((root2) => fs33.existsSync(path37.join(ws.cwd, root2, skill)));
119475
119528
  const kept4 = Object.keys(files).map((name) => SKILL_PATH.exec(name)?.[1]).filter((skill) => skill && !theirs(skill));
119476
119529
  const skills = {};
119477
119530
  for (const [name, text4] of Object.entries(files)) {
@@ -119479,7 +119532,7 @@ function pullTools(ws, record, files) {
119479
119532
  if (!at2 || at2[1] === "kanban" || !kept4.includes(at2[1]) || at2[2].split("/").includes("..")) continue;
119480
119533
  skills[name] = hashOf2(text4);
119481
119534
  for (const root2 of SKILL_ROOTS) {
119482
- const file2 = path36.join(ws.cwd, root2, at2[1], at2[2]);
119535
+ const file2 = path37.join(ws.cwd, root2, at2[1], at2[2]);
119483
119536
  if (held4[name] !== skills[name] || hashFile(file2) !== skills[name]) write(file2, text4);
119484
119537
  }
119485
119538
  }
@@ -119488,8 +119541,8 @@ function pullTools(ws, record, files) {
119488
119541
  const [, skill, rest] = SKILL_PATH.exec(name) ?? [];
119489
119542
  if (!skill || !rest) continue;
119490
119543
  for (const root2 of SKILL_ROOTS) {
119491
- fs32.rmSync(path36.join(ws.cwd, root2, skill, rest), { force: true });
119492
- if (!Object.keys(skills).some((n) => n.startsWith(`skills/${skill}/`))) fs32.rmSync(path36.join(ws.cwd, root2, skill), { recursive: true, force: true });
119544
+ fs33.rmSync(path37.join(ws.cwd, root2, skill, rest), { force: true });
119545
+ if (!Object.keys(skills).some((n) => n.startsWith(`skills/${skill}/`))) fs33.rmSync(path37.join(ws.cwd, root2, skill), { recursive: true, force: true });
119493
119546
  }
119494
119547
  }
119495
119548
  const names2 = [...new Set(Object.keys(skills).map((name) => name.split("/")[1]))];
@@ -119526,57 +119579,57 @@ async function pullWorkflow(ws, record) {
119526
119579
  if (files.ok) pullTools(ws, record, files.value);
119527
119580
  }
119528
119581
  dropPlacedAgents(ws);
119529
- for (const name of Object.keys(record.agents ?? {})) fs32.rmSync(path36.join(ws.board, name), { force: true });
119582
+ for (const name of Object.keys(record.agents ?? {})) fs33.rmSync(path37.join(ws.board, name), { force: true });
119530
119583
  record.agents = {};
119531
119584
  return { ok: true, value: void 0 };
119532
119585
  }
119533
- var agentsRecord = (ws) => path36.join(ws.board, ".sync", "agents.json");
119586
+ var agentsRecord = (ws) => path37.join(ws.board, ".sync", "agents.json");
119534
119587
  function readPlaced(ws) {
119535
119588
  try {
119536
- return JSON.parse(fs32.readFileSync(agentsRecord(ws), "utf8"));
119589
+ return JSON.parse(fs33.readFileSync(agentsRecord(ws), "utf8"));
119537
119590
  } catch {
119538
119591
  return {};
119539
119592
  }
119540
119593
  }
119541
119594
  function dropPlacedAgents(ws) {
119542
119595
  const placed = readPlaced(ws);
119543
- for (const name of Object.keys(placed)) if (hashFile(path36.join(ws.board, name)) === placed[name]) fs32.rmSync(path36.join(ws.board, name), { force: true });
119544
- fs32.rmSync(agentsRecord(ws), { force: true });
119596
+ for (const name of Object.keys(placed)) if (hashFile(path37.join(ws.board, name)) === placed[name]) fs33.rmSync(path37.join(ws.board, name), { force: true });
119597
+ fs33.rmSync(agentsRecord(ws), { force: true });
119545
119598
  }
119546
119599
  function pullDraftAgents(ws, record) {
119547
119600
  if (ws.workflow !== BUILDER) return;
119548
- const root2 = path36.join(ws.board, "workflows", draftFolder(ws.task), "agents");
119601
+ const root2 = path37.join(ws.board, "workflows", draftFolder(ws.task), "agents");
119549
119602
  record.agents ??= {};
119550
119603
  for (const name of filesUnder(root2)) {
119551
- const text4 = fs32.readFileSync(path36.join(root2, name));
119604
+ const text4 = fs33.readFileSync(path37.join(root2, name));
119552
119605
  const at2 = `agents/${name}`;
119553
119606
  record.agents[at2] = hashOf2(text4);
119554
- if (hashFile(path36.join(ws.board, at2)) !== record.agents[at2]) write(path36.join(ws.board, at2), text4);
119607
+ if (hashFile(path37.join(ws.board, at2)) !== record.agents[at2]) write(path37.join(ws.board, at2), text4);
119555
119608
  }
119556
119609
  }
119557
119610
  function assetPath(ws, name, owner) {
119558
119611
  if (/^[a-z][\w+.-]*:/i.test(name) || name.startsWith("#") || name.startsWith("//")) return null;
119559
- if (path36.isAbsolute(name)) throw new Error(`absolute path: ${name}`);
119612
+ if (path37.isAbsolute(name)) throw new Error(`absolute path: ${name}`);
119560
119613
  const held4 = /^\.(assets|mockups)\//.exec(name);
119561
119614
  const state = stateDir(ws);
119562
- const root2 = held4 && state ? path36.join(state, held4[1]) : ws.board;
119563
- const file2 = held4 && state ? path36.resolve(root2, name.slice(held4[0].length)) : path36.resolve(path36.dirname(owner), name);
119564
- const roots = [ws.board, ...state ? ["assets", "mockups"].map((folder) => path36.join(state, folder, ...ws.number ? [String(ws.number)] : [])) : []];
119565
- const inside = (file3, root3) => file3.startsWith(root3 + path36.sep);
119615
+ const root2 = held4 && state ? path37.join(state, held4[1]) : ws.board;
119616
+ const file2 = held4 && state ? path37.resolve(root2, name.slice(held4[0].length)) : path37.resolve(path37.dirname(owner), name);
119617
+ const roots = [ws.board, ...state ? ["assets", "mockups"].map((folder) => path37.join(state, folder, ...ws.number ? [String(ws.number)] : [])) : []];
119618
+ const inside = (file3, root3) => file3.startsWith(root3 + path37.sep);
119566
119619
  if (!roots.some((root3) => inside(file2, root3))) throw new Error(`outside the board: ${name}`);
119567
119620
  let existing = file2;
119568
- while (!fs32.existsSync(existing) && path36.dirname(existing) !== existing) existing = path36.dirname(existing);
119569
- const real = path36.join(fs32.realpathSync(existing), path36.relative(existing, file2));
119621
+ while (!fs33.existsSync(existing) && path37.dirname(existing) !== existing) existing = path37.dirname(existing);
119622
+ const real = path37.join(fs33.realpathSync(existing), path37.relative(existing, file2));
119570
119623
  let stateParent = state;
119571
- while (stateParent && !fs32.existsSync(stateParent) && path36.dirname(stateParent) !== stateParent) stateParent = path36.dirname(stateParent);
119572
- const realState = state && stateParent ? path36.resolve(fs32.realpathSync(stateParent), path36.relative(stateParent, state)) : null;
119573
- const realRoots = [fs32.realpathSync(ws.board), ...realState ? ["assets", "mockups"].map((folder) => path36.join(realState, folder, ...ws.number ? [String(ws.number)] : [])) : []];
119624
+ while (stateParent && !fs33.existsSync(stateParent) && path37.dirname(stateParent) !== stateParent) stateParent = path37.dirname(stateParent);
119625
+ const realState = state && stateParent ? path37.resolve(fs33.realpathSync(stateParent), path37.relative(stateParent, state)) : null;
119626
+ const realRoots = [fs33.realpathSync(ws.board), ...realState ? ["assets", "mockups"].map((folder) => path37.join(realState, folder, ...ws.number ? [String(ws.number)] : [])) : []];
119574
119627
  if (!realRoots.some((root3) => real === root3 || inside(real, root3))) throw new Error(`link outside the board: ${name}`);
119575
119628
  return file2;
119576
119629
  }
119577
119630
  function cardAssetsDir(ws, id) {
119578
119631
  const state = stateDir(ws);
119579
- return state && path36.join(state, "assets", String(id));
119632
+ return state && path37.join(state, "assets", String(id));
119580
119633
  }
119581
119634
  function stateDir(ws) {
119582
119635
  try {
@@ -119618,13 +119671,13 @@ var pullChanges = (ws) => inFolder(ws.cwd, async () => {
119618
119671
  const p2 = f2.path.startsWith(root2) ? f2.path.slice(root2.length) : f2.path;
119619
119672
  const isShared = p2.startsWith(MEMORY2) && shared(p2.slice(MEMORY2.length));
119620
119673
  if (kept3(p2) && isShared === !f2.path.startsWith(root2)) {
119621
- const file2 = path36.join(ws.board, p2);
119674
+ const file2 = path37.join(ws.board, p2);
119622
119675
  const here = readText(file2);
119623
119676
  if (here !== f2.content && here !== (base.files[f2.path]?.content ?? null)) {
119624
119677
  skipped = true;
119625
119678
  continue;
119626
119679
  }
119627
- if (f2.content === null) fs32.rmSync(file2, { force: true });
119680
+ if (f2.content === null) fs33.rmSync(file2, { force: true });
119628
119681
  else if (here !== f2.content) write(file2, f2.content);
119629
119682
  }
119630
119683
  if (f2.content === null) delete base.files[f2.path];
@@ -119638,7 +119691,7 @@ var pullChanges = (ws) => inFolder(ws.cwd, async () => {
119638
119691
  async function readCloud(ws) {
119639
119692
  const base = readBase(ws);
119640
119693
  const known2 = new Set(Object.keys(base.files));
119641
- const keepDraft = new Set((base.deferred ?? []).filter((p2) => readText(path36.join(ws.board, p2)) !== (base.files[rootOf(ws) + p2]?.content ?? null)));
119694
+ const keepDraft = new Set((base.deferred ?? []).filter((p2) => readText(path37.join(ws.board, p2)) !== (base.files[rootOf(ws) + p2]?.content ?? null)));
119642
119695
  if (base.workspace === void 0) {
119643
119696
  const project = await readProject(ws.project);
119644
119697
  if (!project.ok) return project;
@@ -119656,13 +119709,13 @@ async function readCloud(ws) {
119656
119709
  writeBase(ws, base);
119657
119710
  const reset = (view2) => {
119658
119711
  for (const [p2, content] of view2) {
119659
- const file2 = path36.join(ws.board, p2);
119712
+ const file2 = path37.join(ws.board, p2);
119660
119713
  if (!keepDraft.has(p2) && kept3(p2) && readText(file2) !== content) write(file2, content);
119661
119714
  }
119662
119715
  };
119663
119716
  const view = viewOf(ws, base, sharedMemory(ws.board));
119664
119717
  const first = (p2) => isSettingsPath(p2) && !known2.has(rootOf(ws) + p2);
119665
- for (const p2 of localFiles(ws, base)) if (!keepDraft.has(p2) && !view.has(p2) && !first(p2)) fs32.rmSync(path36.join(ws.board, p2), { force: true });
119718
+ for (const p2 of localFiles(ws, base)) if (!keepDraft.has(p2) && !view.has(p2) && !first(p2)) fs33.rmSync(path37.join(ws.board, p2), { force: true });
119666
119719
  reset(view);
119667
119720
  const record = readRecord(ws);
119668
119721
  const workflow = await pullWorkflow(ws, record);
@@ -119676,18 +119729,18 @@ async function readCloud(ws) {
119676
119729
  return { ok: true, value: void 0 };
119677
119730
  }
119678
119731
  function writeIndex(board) {
119679
- const todo = path36.join(board, "todo");
119732
+ const todo = path37.join(board, "todo");
119680
119733
  const cards = [];
119681
119734
  let entries = [];
119682
119735
  try {
119683
- entries = fs32.readdirSync(todo, { withFileTypes: true });
119736
+ entries = fs33.readdirSync(todo, { withFileTypes: true });
119684
119737
  } catch {
119685
119738
  }
119686
119739
  for (const e2 of entries) {
119687
119740
  const id = /^(\d+)-/.exec(e2.name)?.[1];
119688
119741
  if (!id) continue;
119689
119742
  const link = e2.isDirectory() ? `${e2.name}/root.md` : e2.name.endsWith(".md") ? e2.name : null;
119690
- const text5 = link && readText(path36.join(todo, link));
119743
+ const text5 = link && readText(path37.join(todo, link));
119691
119744
  if (text5 === null || !link) continue;
119692
119745
  cards.push({ id: Number(id), title: cardFront(text5).title ?? e2.name.replace(/\.md$/, ""), link });
119693
119746
  }
@@ -119702,7 +119755,7 @@ the number at the front of a filename is the task id.
119702
119755
 
119703
119756
  ${list}
119704
119757
  `;
119705
- if (readText(path36.join(todo, "README.md")) !== text4) write(path36.join(todo, "README.md"), text4);
119758
+ if (readText(path37.join(todo, "README.md")) !== text4) write(path37.join(todo, "README.md"), text4);
119706
119759
  }
119707
119760
  var workspaceOf = (ws) => readBase(ws).workspace ?? null;
119708
119761
  async function pullAssets(ws, record, assets) {
@@ -119781,7 +119834,7 @@ async function pullAssets(ws, record, assets) {
119781
119834
  }
119782
119835
  if (!child) return src;
119783
119836
  dependencies.push(name2);
119784
- const back = !found.text && /^\.(assets|mockups)\//.test(name2) ? name2 : path36.relative(path36.dirname(target), child).split(path36.sep).join("/");
119837
+ const back = !found.text && /^\.(assets|mockups)\//.test(name2) ? name2 : path37.relative(path37.dirname(target), child).split(path37.sep).join("/");
119785
119838
  if (back !== src) changed = true;
119786
119839
  return back;
119787
119840
  });
@@ -119818,16 +119871,16 @@ async function readAsset(artifact, version) {
119818
119871
  return { ok: true, value: Buffer.from(typeof content === "string" ? content : JSON.stringify(content)) };
119819
119872
  }
119820
119873
  async function sentOf(file2, kind) {
119821
- const ext = path36.extname(file2).toLowerCase();
119822
- if (kind !== "html") return { bytes: fs32.readFileSync(file2), type: kind === "tiled" && ext === ".tsx" ? "application/xml" : TYPES[ext] ?? "application/octet-stream", kind };
119874
+ const ext = path37.extname(file2).toLowerCase();
119875
+ if (kind !== "html") return { bytes: fs33.readFileSync(file2), type: kind === "tiled" && ext === ".tsx" ? "application/xml" : TYPES[ext] ?? "application/octet-stream", kind };
119823
119876
  const page = await (await Promise.resolve().then(() => (init_mockup(), mockup_exports))).drawMockup(file2);
119824
119877
  return { bytes: Buffer.from(page), type: "text/html", kind };
119825
119878
  }
119826
- var undrawnPreviews = (ws) => Object.entries(assetsOf(readText(path36.join(ws.board, assetsFile(ws.task))))).flatMap(([key, ref]) => ref.error ? [`${key}: ${ref.error}`] : []);
119879
+ var undrawnPreviews = (ws) => Object.entries(assetsOf(readText(path37.join(ws.board, assetsFile(ws.task))))).flatMap(([key, ref]) => ref.error ? [`${key}: ${ref.error}`] : []);
119827
119880
  function undrawn(ws, reason) {
119828
119881
  const state = stateDir(ws);
119829
- for (const [root2, shown] of [...state ? [[path36.join(state, "assets"), ".assets"], [path36.join(state, "mockups"), ".mockups"]] : [], [ws.board, ""]]) {
119830
- reason = reason.split(`file://${root2}${path36.sep}`).join(shown && `${shown}/`).split(`${root2}${path36.sep}`).join(shown && `${shown}/`);
119882
+ for (const [root2, shown] of [...state ? [[path37.join(state, "assets"), ".assets"], [path37.join(state, "mockups"), ".mockups"]] : [], [ws.board, ""]]) {
119883
+ reason = reason.split(`file://${root2}${path37.sep}`).join(shown && `${shown}/`).split(`${root2}${path37.sep}`).join(shown && `${shown}/`);
119831
119884
  }
119832
119885
  return reason.replace(/ \(at [^)]*file:\/\/[^)]*\)$/, "").slice(0, 500);
119833
119886
  }
@@ -119850,14 +119903,14 @@ async function pushAssets(ws, record, before) {
119850
119903
  if (body === null) return { ok: true, value: void 0 };
119851
119904
  const refs = {};
119852
119905
  const canonical = (target) => {
119853
- const real = (file3) => fs32.existsSync(file3) ? fs32.realpathSync(file3) : path36.dirname(file3) === file3 ? file3 : path36.join(real(path36.dirname(file3)), path36.basename(file3));
119906
+ const real = (file3) => fs33.existsSync(file3) ? fs33.realpathSync(file3) : path37.dirname(file3) === file3 ? file3 : path37.join(real(path37.dirname(file3)), path37.basename(file3));
119854
119907
  target = real(target);
119855
119908
  const state = stateDir(ws);
119856
119909
  for (const folder of ["assets", "mockups"]) {
119857
- const root2 = state && real(path36.join(state, folder));
119858
- if (root2 && target.startsWith(root2 + path36.sep)) return `.${folder}/${path36.relative(root2, target).split(path36.sep).join("/")}`;
119910
+ const root2 = state && real(path37.join(state, folder));
119911
+ if (root2 && target.startsWith(root2 + path37.sep)) return `.${folder}/${path37.relative(root2, target).split(path37.sep).join("/")}`;
119859
119912
  }
119860
- return path36.relative(real(path36.dirname(file2)), target).split(path36.sep).join("/");
119913
+ return path37.relative(real(path37.dirname(file2)), target).split(path37.sep).join("/");
119861
119914
  };
119862
119915
  try {
119863
119916
  const graph = collect(body, file2, {
@@ -119867,11 +119920,11 @@ async function pushAssets(ws, record, before) {
119867
119920
  const target = assetPath(ws, src, owner);
119868
119921
  if (!target) return null;
119869
119922
  const key = owner === file2 && before[src] ? src : canonical(target);
119870
- if (!fs32.statSync(target, { throwIfNoEntry: false })?.isFile()) {
119923
+ if (!fs33.statSync(target, { throwIfNoEntry: false })?.isFile()) {
119871
119924
  if (before[key]) return { key, file: null };
119872
119925
  throw new Error(`file not found: ${target}`);
119873
119926
  }
119874
- return { key: canonical(fs32.realpathSync(target)), file: target };
119927
+ return { key: canonical(fs33.realpathSync(target)), file: target };
119875
119928
  },
119876
119929
  read: referenceText,
119877
119930
  retained: (key) => (record.assets[key]?.dependencies ?? []).map((src) => {
@@ -119944,7 +119997,7 @@ async function pushAssets(ws, record, before) {
119944
119997
  const unchanged = restored && previous && (previous.kind ?? out.kind) === out.kind && localHash === (previous.localHash ?? previous.hash) && [...node.dependencies.values()].every((key) => refs[key]?.artifact === before[key]?.artifact);
119945
119998
  if (!entry || !unchanged && entry.hash !== hash || entry.kind && entry.kind !== out.kind) {
119946
119999
  if (!ws.cloudTask) continue;
119947
- let artifact = previous && (previous.kind ?? kindOf(path36.extname(node.file).toLowerCase())) === out.kind ? previous.artifact : void 0;
120000
+ let artifact = previous && (previous.kind ?? kindOf(path37.extname(node.file).toLowerCase())) === out.kind ? previous.artifact : void 0;
119948
120001
  if (!artifact) {
119949
120002
  const made = await createArtifact(ws.cloudTask, node.key.slice(0, 200), out.kind);
119950
120003
  if (!made.ok) return { ...made, error: `${node.key}: ${made.error}` };
@@ -119964,24 +120017,24 @@ async function pushAssets(ws, record, before) {
119964
120017
  } catch (error) {
119965
120018
  return { ok: false, code: "bad_request", error: error instanceof Error ? error.message : String(error) };
119966
120019
  }
119967
- const list = path36.join(ws.board, assetsFile(ws.task));
119968
- if (Object.keys(refs).length || fs32.existsSync(list)) {
120020
+ const list = path37.join(ws.board, assetsFile(ws.task));
120021
+ if (Object.keys(refs).length || fs33.existsSync(list)) {
119969
120022
  if (JSON.stringify(assetsOf(readText(list))) !== JSON.stringify(refs)) write(list, assetsText(refs));
119970
120023
  }
119971
120024
  return { ok: true, value: void 0 };
119972
120025
  }
119973
120026
  function resetSorted(ws) {
119974
- for (const sub of ["dismissed", "archived"]) fs32.rmSync(path36.join(ws.board, "triage", sub), { recursive: true, force: true });
120027
+ for (const sub of ["dismissed", "archived"]) fs33.rmSync(path37.join(ws.board, "triage", sub), { recursive: true, force: true });
119975
120028
  for (const [p2, content] of viewOf(ws, readBase(ws), sharedMemory(ws.board))) {
119976
- if (/^triage\/(?:dismissed|archived)\//.test(p2)) write(path36.join(ws.board, p2), content);
120029
+ if (/^triage\/(?:dismissed|archived)\//.test(p2)) write(path37.join(ws.board, p2), content);
119977
120030
  }
119978
120031
  }
119979
120032
  function proposeItems(ws, base) {
119980
120033
  const root2 = rootOf(ws);
119981
120034
  for (const p2 of localFiles(ws, base)) {
119982
120035
  if (itemAt(p2)?.state !== "open" || base.files[root2 + p2]) continue;
119983
- const file2 = path36.join(ws.board, p2);
119984
- const content = fs32.readFileSync(file2, "utf8");
120036
+ const file2 = path37.join(ws.board, p2);
120037
+ const content = fs33.readFileSync(file2, "utf8");
119985
120038
  const said = (key) => new RegExp(`^${key}:`, "m").test(content.split(/\n---/)[0] ?? "");
119986
120039
  const fields = {
119987
120040
  ...ws.cloudTask && !said("source_task") ? { source_task: ws.cloudTask } : {},
@@ -120021,9 +120074,9 @@ async function send2(ws, job) {
120021
120074
  const record = readRecord(ws);
120022
120075
  const base = readBase(ws);
120023
120076
  const fail = (error, conflict = false, code) => ({ ok: false, conflict, error, ...code ? {} : { offline: true } });
120024
- const tasks = ws.cloudTask ? [{ folder: ws, record }] : filesUnder(path36.join(ws.board, ".sync")).filter((name) => name.endsWith(".json")).flatMap((name) => {
120077
+ const tasks = ws.cloudTask ? [{ folder: ws, record }] : filesUnder(path37.join(ws.board, ".sync")).filter((name) => name.endsWith(".json")).flatMap((name) => {
120025
120078
  try {
120026
- const held4 = JSON.parse(fs32.readFileSync(path36.join(ws.board, ".sync", name), "utf8"));
120079
+ const held4 = JSON.parse(fs33.readFileSync(path37.join(ws.board, ".sync", name), "utf8"));
120027
120080
  if (!held4.task || !TASK_ID.test(held4.task) || !held4.number) return [];
120028
120081
  return [{ folder: { ...ws, task: held4.task, cloudTask: held4.task, number: held4.number }, record: held4 }];
120029
120082
  } catch {
@@ -120035,7 +120088,7 @@ async function send2(ws, job) {
120035
120088
  const deferredLists = /* @__PURE__ */ new Set();
120036
120089
  const assetErrors = {};
120037
120090
  for (const item of tasks) {
120038
- const card = path36.relative(ws.board, cardFile(item.folder)).split(path36.sep).join("/");
120091
+ const card = path37.relative(ws.board, cardFile(item.folder)).split(path37.sep).join("/");
120039
120092
  const archived = boardSync && card.startsWith(".archive/") && base.files[rootOf(ws) + card];
120040
120093
  if (!archived) {
120041
120094
  const assets = await pushAssets(item.folder, item.record, assetsOf(assetsListOf(item.folder, base)));
@@ -120077,7 +120130,7 @@ async function send2(ws, job) {
120077
120130
  const owed = (p2) => !job.id && busy(ws.cwd) && itemAt(p2)?.state === "open" && !base.files[rootOf(ws) + p2];
120078
120131
  for (const p2 of local) {
120079
120132
  if (defer(p2) || owed(p2)) continue;
120080
- const content = fs32.readFileSync(path36.join(ws.board, p2), "utf8");
120133
+ const content = fs33.readFileSync(path37.join(ws.board, p2), "utf8");
120081
120134
  const remote2 = remoteOf(ws, shared, p2);
120082
120135
  localOf.set(remote2, p2);
120083
120136
  const held4 = base.files[remote2];
@@ -120109,15 +120162,15 @@ async function send2(ws, job) {
120109
120162
  changes.splice(at2, 1);
120110
120163
  delete base.files[theirs.path];
120111
120164
  writeBase(ws, base);
120112
- fs32.rmSync(path36.join(ws.board, p2), { force: true });
120165
+ fs33.rmSync(path37.join(ws.board, p2), { force: true });
120113
120166
  writeIndex(ws.board);
120114
120167
  continue;
120115
120168
  }
120116
120169
  if (at2 < 0) continue;
120117
120170
  const merged = itemAt(p2) ? { content: theirs.content } : mergeFile(base.files[theirs.path]?.content ?? null, changes[at2].content, theirs.content);
120118
120171
  changes[at2] = { path: theirs.path, content: merged.content, base_seq: theirs.seq };
120119
- if (merged.content === null) fs32.rmSync(path36.join(ws.board, p2), { force: true });
120120
- else write(path36.join(ws.board, p2), merged.content);
120172
+ if (merged.content === null) fs33.rmSync(path37.join(ws.board, p2), { force: true });
120173
+ else write(path37.join(ws.board, p2), merged.content);
120121
120174
  }
120122
120175
  if (!changes.length) return success(false);
120123
120176
  sent = await commitBoard(ws.project, job.id, job.machineId, changes);
@@ -120138,7 +120191,7 @@ var BUSY_MS = 3e4;
120138
120191
  function keptFolders() {
120139
120192
  let cached2 = [];
120140
120193
  try {
120141
- cached2 = fs33.readdirSync(cacheRoot()).map((name) => fs33.realpathSync(path37.join(cacheRoot(), name)));
120194
+ cached2 = fs34.readdirSync(cacheRoot()).map((name) => fs34.realpathSync(path38.join(cacheRoot(), name)));
120142
120195
  } catch {
120143
120196
  }
120144
120197
  return [.../* @__PURE__ */ new Set([...allowedProjects(), ...cached2])].flatMap((dir) => [keptBoard(dir)].filter((ws) => !!ws));
@@ -120174,8 +120227,8 @@ function watchBoards(machineId2, ms, lookMs = LOOK_MS, pullMs = PULL_MS, busyMs
120174
120227
  const watch = (ws) => {
120175
120228
  let watcher;
120176
120229
  try {
120177
- watcher = fs33.watch(ws.board, { recursive: true }, (_event, name) => {
120178
- const p2 = name && String(name).split(path37.sep).join("/");
120230
+ watcher = fs34.watch(ws.board, { recursive: true }, (_event, name) => {
120231
+ const p2 = name && String(name).split(path38.sep).join("/");
120179
120232
  const held4 = watched.get(ws.cwd);
120180
120233
  if (closed || !p2 || !isBoardPath(p2) || !held4) return;
120181
120234
  const job = busy(ws.cwd);
@@ -120238,8 +120291,8 @@ function watchBoards(machineId2, ms, lookMs = LOOK_MS, pullMs = PULL_MS, busyMs
120238
120291
 
120239
120292
  // src/diff.ts
120240
120293
  import { execFile as execFile2 } from "node:child_process";
120241
- import fs34 from "node:fs";
120242
- import path38 from "node:path";
120294
+ import fs35 from "node:fs";
120295
+ import path39 from "node:path";
120243
120296
  var FILE_BYTES = 256 * 1024;
120244
120297
  var TOTAL_BYTES = 1024 * 1024;
120245
120298
  var EMPTY_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
@@ -120256,7 +120309,7 @@ var git2 = (dir, args, maxBuffer = 4 * TOTAL_BYTES) => new Promise(
120256
120309
  function projectDir(placed, project) {
120257
120310
  if (placed) {
120258
120311
  const real = realpath3(placed);
120259
- return real && allowedProjects().some((root2) => real === root2 || real.startsWith(root2 + path38.sep)) ? real : null;
120312
+ return real && allowedProjects().some((root2) => real === root2 || real.startsWith(root2 + path39.sep)) ? real : null;
120260
120313
  }
120261
120314
  let cached2;
120262
120315
  try {
@@ -120264,11 +120317,11 @@ function projectDir(placed, project) {
120264
120317
  } catch {
120265
120318
  return null;
120266
120319
  }
120267
- return fs34.existsSync(path38.join(cached2, ".git")) ? cached2 : null;
120320
+ return fs35.existsSync(path39.join(cached2, ".git")) ? cached2 : null;
120268
120321
  }
120269
120322
  function realpath3(p2) {
120270
120323
  try {
120271
- return fs34.realpathSync(p2);
120324
+ return fs35.realpathSync(p2);
120272
120325
  } catch {
120273
120326
  return null;
120274
120327
  }
@@ -120315,20 +120368,20 @@ async function answerHint(machineId2, hint2) {
120315
120368
  // ../cli/src/lib/agent/stop.ts
120316
120369
  import { spawnSync as spawnSync4 } from "node:child_process";
120317
120370
  import { randomUUID as randomUUID2 } from "node:crypto";
120318
- import fs35 from "node:fs";
120371
+ import fs36 from "node:fs";
120319
120372
  var runMark = (sessionId) => ({ name: RUN_ENV, value: sessionId });
120320
120373
  var stopMark = () => ({ name: STOP_ENV, value: randomUUID2() });
120321
120374
  var markEnv = (env2, mark) => ({ ...env2, [mark.name]: mark.value });
120322
120375
  var WINDOWS3 = process.platform === "win32";
120323
120376
  function markedInProc(entry, strict = false) {
120324
120377
  const pids = [];
120325
- for (const name of fs35.readdirSync("/proc")) {
120378
+ for (const name of fs36.readdirSync("/proc")) {
120326
120379
  if (!/^\d+$/.test(name)) continue;
120327
120380
  try {
120328
- if (fs35.readFileSync(`/proc/${name}/environ`, "utf8").split("\0").includes(entry)) pids.push(Number(name));
120381
+ if (fs36.readFileSync(`/proc/${name}/environ`, "utf8").split("\0").includes(entry)) pids.push(Number(name));
120329
120382
  } catch (error) {
120330
120383
  if (strict && !["ENOENT", "ESRCH"].includes(error.code ?? "")) {
120331
- const stat = fs35.statSync(`/proc/${name}`, { throwIfNoEntry: false });
120384
+ const stat = fs36.statSync(`/proc/${name}`, { throwIfNoEntry: false });
120332
120385
  if (stat?.uid === process.getuid?.()) throw error;
120333
120386
  }
120334
120387
  }
@@ -120470,8 +120523,8 @@ function reviewOf(meta) {
120470
120523
  }
120471
120524
 
120472
120525
  // src/triage.ts
120473
- import fs36 from "node:fs";
120474
- import path39 from "node:path";
120526
+ import fs37 from "node:fs";
120527
+ import path40 from "node:path";
120475
120528
 
120476
120529
  // ../cli/src/lib/signals/identity.ts
120477
120530
  import { createHash as createHash2 } from "node:crypto";
@@ -120479,8 +120532,8 @@ var DERIVED = "derived-";
120479
120532
  var derivedSourceId = (seed) => `${DERIVED}${createHash2("sha256").update(seed).digest("hex").slice(0, 16)}`;
120480
120533
 
120481
120534
  // src/triage.ts
120482
- var triageDir = (board) => path39.join(board, "triage");
120483
- var rejectedDir = (board) => path39.join(board, ".archive", REJECTIONS_TO_REVIEW);
120535
+ var triageDir = (board) => path40.join(board, "triage");
120536
+ var rejectedDir = (board) => path40.join(board, ".archive", REJECTIONS_TO_REVIEW);
120484
120537
  var SCRATCH = ["dismissed", "archived"];
120485
120538
  var stamp2 = (at2) => formatStamp(at2 ? new Date(at2) : /* @__PURE__ */ new Date());
120486
120539
  function slugOf(title) {
@@ -120489,7 +120542,7 @@ function slugOf(title) {
120489
120542
  function freeName(dir, title) {
120490
120543
  const stem = slugOf(title);
120491
120544
  let name = `${stem}.md`;
120492
- for (let n = 2; fs36.existsSync(path39.join(dir, name)); n++) name = `${stem}-${n}.md`;
120545
+ for (let n = 2; fs37.existsSync(path40.join(dir, name)); n++) name = `${stem}-${n}.md`;
120493
120546
  return name;
120494
120547
  }
120495
120548
  function itemText(item, fields = {}) {
@@ -120509,17 +120562,17 @@ ${item.text.trim()}
120509
120562
  `;
120510
120563
  }
120511
120564
  function writeItem(dir, item, fields = {}) {
120512
- fs36.mkdirSync(dir, { recursive: true });
120565
+ fs37.mkdirSync(dir, { recursive: true });
120513
120566
  const name = freeName(dir, item.title);
120514
- fs36.writeFileSync(path39.join(dir, name), itemText(item, item.workflow ? { workflow: workflowName(item.workflow), ...fields } : fields));
120567
+ fs37.writeFileSync(path40.join(dir, name), itemText(item, item.workflow ? { workflow: workflowName(item.workflow), ...fields } : fields));
120515
120568
  return name;
120516
120569
  }
120517
120570
  function layOut(board, rejections) {
120518
120571
  clearLaid(board);
120519
120572
  const dir = rejectedDir(board);
120520
- fs36.mkdirSync(dir, { recursive: true });
120573
+ fs37.mkdirSync(dir, { recursive: true });
120521
120574
  for (const t2 of rejections.tasks) {
120522
- fs36.writeFileSync(path39.join(dir, `${t2.number}-${slugify(t2.title)}.md`), [
120575
+ fs37.writeFileSync(path40.join(dir, `${t2.number}-${slugify(t2.title)}.md`), [
120523
120576
  "---",
120524
120577
  `title: ${yamlScalar(t2.title)}`,
120525
120578
  "status: todo",
@@ -120534,55 +120587,15 @@ function layOut(board, rejections) {
120534
120587
  ].join("\n"));
120535
120588
  }
120536
120589
  for (const item of rejections.triage) {
120537
- const sub = path39.join(triageDir(board), item.state === "dismissed" ? "dismissed" : "archived");
120590
+ const sub = path40.join(triageDir(board), item.state === "dismissed" ? "dismissed" : "archived");
120538
120591
  const fields = item.state === "dismissed" ? { dismissed_at: stamp2(item.dismissed_at), dismissed_by: "user", ...item.dismissed_reason ? { dismissed_reason: item.dismissed_reason } : {} } : {};
120539
120592
  writeItem(sub, item, fields);
120540
120593
  }
120541
120594
  return { tasks: rejections.tasks.map((t2) => t2.id), triage: rejections.triage.map((i) => i.id) };
120542
120595
  }
120543
120596
  function clearLaid(board) {
120544
- fs36.rmSync(rejectedDir(board), { recursive: true, force: true });
120545
- for (const sub of SCRATCH) fs36.rmSync(path39.join(triageDir(board), sub), { recursive: true, force: true });
120546
- }
120547
-
120548
- // src/kanban-skill.ts
120549
- import fs37 from "node:fs";
120550
- import path40 from "node:path";
120551
-
120552
- // ../skill/SKILL.md
120553
- var SKILL_default = '---\nname: kanban\ndescription: Manage the file-based task board with akb. Use for creating and planning tasks, revising or implementing cards, and managing background runs; also for "what\'s running".\n---\n\n# Kanban board\n\nThe board is worked only through `akb`. Find the command for the job in `akb help` and run\nit; never do its work by hand or from memory.\n\n- **`--print` does it here**: `akb card revise 12 --print "drop the export"` prints the whole\n flow for that card on this board; follow it to its closing steps. Without `--print` the\n same command starts a separate agent.\n- **Keys**: never read or write API keys; the user sets them with `akb agent set apiKey`.\n';
120554
-
120555
- // src/kanban-skill.ts
120556
- var CONTENT = `${SKILL_default.trimEnd()}
120557
-
120558
- <!-- ai4kanban managed -->
120559
- `;
120560
- var MANAGED = /^<!-- ai4kanban \S+ -->$/m;
120561
- function prepareKanbanSkill(root2) {
120562
- for (const folder of SKILL_FOLDERS) {
120563
- const dir = path40.join(root2, folder);
120564
- const file2 = path40.join(dir, "SKILL.md");
120565
- try {
120566
- let linked = false;
120567
- let at2 = root2;
120568
- for (const name of `${folder}/SKILL.md`.split("/")) {
120569
- at2 = path40.join(at2, name);
120570
- if (fs37.lstatSync(at2, { throwIfNoEntry: false })?.isSymbolicLink()) linked = true;
120571
- }
120572
- const held4 = fs37.existsSync(file2) ? fs37.readFileSync(file2, "utf8") : null;
120573
- const exists = fs37.lstatSync(dir, { throwIfNoEntry: false }) !== void 0;
120574
- if (linked || exists && !MANAGED.test(held4 ?? "")) {
120575
- if (!held4?.trim()) throw new Error("\u7528\u6237\u81EA\u6709\u76EE\u5F55\u6216\u7B26\u53F7\u94FE\u63A5\u4E2D\u7F3A\u5C11\u53EF\u8BFB\u7684 SKILL.md");
120576
- continue;
120577
- }
120578
- if (held4 !== CONTENT) {
120579
- fs37.mkdirSync(dir, { recursive: true });
120580
- fs37.writeFileSync(file2, CONTENT);
120581
- }
120582
- } catch (e2) {
120583
- throw new Error(`\u65E0\u6CD5\u51C6\u5907 ${folder}\uFF1A${e2 instanceof Error ? e2.message : String(e2)}`);
120584
- }
120585
- }
120597
+ fs37.rmSync(rejectedDir(board), { recursive: true, force: true });
120598
+ for (const sub of SCRATCH) fs37.rmSync(path40.join(triageDir(board), sub), { recursive: true, force: true });
120586
120599
  }
120587
120600
 
120588
120601
  // ../cli/src/lib/skill/hook.ts
@@ -120774,7 +120787,7 @@ function deliveryEnding(ws, id, asked = false) {
120774
120787
  if (held4.status === "cancelled") {
120775
120788
  return held4.steps?.some((s) => s.step === "discarded") ? { ok: false, reason: "The build was discarded." } : { ok: false, reason: "", stopped: true };
120776
120789
  }
120777
- if (held4.status === "active" && !asked) return { ok: false, reason: firstLine(stopped2?.why) ?? NOT_COMPLETED };
120790
+ if (held4.status === "active" && !asked) return { ok: false, reason: reasonOf(stopped2?.why) ?? NOT_COMPLETED };
120778
120791
  return null;
120779
120792
  }
120780
120793
  function checkoutsOf(ws, id) {
@@ -120803,7 +120816,7 @@ var RESUME_REFUSED = {
120803
120816
  };
120804
120817
  var isArchived = (ws, id) => path43.relative(ws.board, findCard(ws.board, id) ?? ws.board).split(path43.sep)[0] === ".archive";
120805
120818
  var refusal2 = (ran) => ran.last.replace(/^akb( raw)?: /, "").slice(0, 300) || "akb stopped with an error.";
120806
- var firstLine = (text4) => (text4 ?? "").split("\n").map((l2) => l2.trim()).find(Boolean)?.slice(0, 300);
120819
+ var reasonOf = (text4) => (text4 ?? "").split("\n").map((l2) => l2.trim()).filter((l2) => l2 && !/^at\s/.test(l2)).join("\n").slice(0, 300) || void 0;
120807
120820
  function logLines(show, event2) {
120808
120821
  let held4 = "";
120809
120822
  const said = (line) => {
@@ -120912,7 +120925,7 @@ async function runReview(job, ws, tasks, deps, io) {
120912
120925
  const ran = await akb(["review-memory", "--task", ...tasks, "--follow", "--events", "--json"], true);
120913
120926
  if (io.lost()) return { ok: false, reason: "" };
120914
120927
  const answer = answerOf2(ran);
120915
- if (ran.code !== 0) return { ok: false, reason: firstLine(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal2(ran) };
120928
+ if (ran.code !== 0) return { ok: false, reason: reasonOf(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal2(ran) };
120916
120929
  const runs = answerOf2(await akb(["run", "list", "--all", "--json"]))?.runs ?? [];
120917
120930
  return { ok: true, report: { ...answer?.result?.trim() ? { reply: answer.result.trim() } : {}, ...spentBy(runs.filter((r2) => (r2.startedAt ?? 0) >= since)) } };
120918
120931
  }
@@ -120970,7 +120983,7 @@ async function runAgent(job, ws, deps, io) {
120970
120983
  const ran = await akb([...args, "--follow", "--events", "--json"], true, env2);
120971
120984
  if (io.lost()) return { ok: false, reason: "" };
120972
120985
  const answer = answerOf2(ran);
120973
- if (ran.code !== 0) return { ok: false, reason: firstLine(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal2(ran) };
120986
+ if (ran.code !== 0) return { ok: false, reason: reasonOf(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal2(ran) };
120974
120987
  const runs = answerOf2(await akb(["run", "list", "--all", "--json"]))?.runs ?? [];
120975
120988
  return { ok: true, report: { ...answer?.result?.trim() ? { reply: answer.result.trim() } : {}, ...spentBy(runs.filter((r2) => (r2.startedAt ?? 0) >= since)) } };
120976
120989
  }
@@ -121133,7 +121146,7 @@ ${draftLine(ws)}
121133
121146
  const waiting = rejected ? null : reviewOf2(cardFile(ws));
121134
121147
  const review = waiting && waiting !== true ? waiting : void 0;
121135
121148
  if (!rejected && ran.code !== 0 && !(verb === "refine" && waiting) && !(answer?.error && asked)) {
121136
- return fail(firstLine(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal2(ran));
121149
+ return fail(reasonOf(answer?.error?.message?.replace(/^run \S+ ended \w+: /, "")) ?? refusal2(ran));
121137
121150
  }
121138
121151
  const last2 = answer?.lastSessionId ?? answer?.error?.lastSessionId;
121139
121152
  const runs = answerOf2(await akb(["run", "list", "--card", String(id2), "--all", "--json"]))?.runs ?? [];
@@ -121273,7 +121286,7 @@ import net from "node:net";
121273
121286
  import path45 from "node:path";
121274
121287
  var RETRY_MS = 5e3;
121275
121288
  var KIND_MS = 1e3;
121276
- var HOLDERS = ["claude-code", "codex", "terminal"];
121289
+ var HOLDERS = ["claude-code", "codex", "cursor", "dsh", "zcode", "kimi", "terminal"];
121277
121290
  function lockPath() {
121278
121291
  const home4 = runnerHome();
121279
121292
  if (process.platform === "win32") return `\\\\.\\pipe\\wildcrane-${crypto6.createHash("sha256").update(home4).digest("hex").slice(0, 16)}`;
@@ -123108,7 +123121,7 @@ async function main() {
123108
123121
  const id = machineId();
123109
123122
  const runner = startRunner({
123110
123123
  registration: async () => ({ machineId: id, machineName: machineName(), version: VERSION, runtimes: await detectRuntimes(true) }),
123111
- kind: process.env.WILDCRANE_RUNNER_KIND === "codex" ? "codex" : process.env.WILDCRANE_RUNNER_KIND === "claude-code" ? "claude-code" : "terminal",
123124
+ kind: ["claude-code", "codex", "cursor", "dsh", "zcode", "kimi"].find((k2) => k2 === process.env.WILDCRANE_RUNNER_KIND) ?? "terminal",
123112
123125
  onConnected: () => tell({ type: "connected" }),
123113
123126
  onWaiting: () => tell({ type: "waiting" }),
123114
123127
  // Tests shorten the job poll, which stands in when Realtime is out of reach.