wildcrane-runner 0.6.67 → 0.6.69

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/plugin.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // wildcrane-runner 0.6.67 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.69 — 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;
@@ -73825,8 +73825,8 @@ function machineId() {
73825
73825
  var machineName = () => os3.hostname().replace(/\.local$/, "");
73826
73826
 
73827
73827
  // src/protocol.ts
73828
- var VERSION = true ? "0.6.67" : "0.0.0";
73829
- var AKB_VERSION = true ? "0.11.53" : "0.0.0";
73828
+ var VERSION = true ? "0.6.69" : "0.0.0";
73829
+ var AKB_VERSION = true ? "0.11.55" : "0.0.0";
73830
73830
  var EXIT_REFUSED = 10;
73831
73831
  var EXIT_OUTDATED = 11;
73832
73832
  var EXIT_UPDATE = 12;
@@ -73870,6 +73870,37 @@ exec ${shellLine} "$@"
73870
73870
  }
73871
73871
  var KEEP = 256 * 1024;
73872
73872
 
73873
+ // src/settings-control.ts
73874
+ import fs5 from "node:fs";
73875
+ import path6 from "node:path";
73876
+ var directory = () => path6.join(runnerHome(), "executors");
73877
+ var epochFile = () => path6.join(runnerHome(), "account-generation");
73878
+ function accountGeneration() {
73879
+ try {
73880
+ return fs5.readFileSync(epochFile(), "utf8");
73881
+ } catch {
73882
+ return "";
73883
+ }
73884
+ }
73885
+ async function stopExecutors() {
73886
+ fs5.mkdirSync(runnerHome(), { recursive: true, mode: 448 });
73887
+ fs5.writeFileSync(epochFile(), `${Date.now()}-${process.pid}`, { mode: 384 });
73888
+ for (let n = 0; n < 160; n++) {
73889
+ const active = fs5.existsSync(directory()) ? fs5.readdirSync(directory()).filter((name) => {
73890
+ try {
73891
+ process.kill(Number(name.split(".")[0]), 0);
73892
+ return true;
73893
+ } catch {
73894
+ fs5.rmSync(path6.join(directory(), name), { force: true });
73895
+ return false;
73896
+ }
73897
+ }) : [];
73898
+ if (!active.length) return true;
73899
+ await new Promise((resolve2) => setTimeout(resolve2, 100));
73900
+ }
73901
+ return false;
73902
+ }
73903
+
73873
73904
  // src/goals.ts
73874
73905
  function goalsOf(held2) {
73875
73906
  if (held2.goals !== void 0 && held2.ideas !== void 0 && JSON.stringify(held2.goals) !== JSON.stringify(held2.ideas)) throw new Error("goals and ideas do not match.");
@@ -73963,12 +73994,12 @@ async function saveDraft(id, expectedVersion, goals) {
73963
73994
 
73964
73995
  // src/cache.ts
73965
73996
  import crypto3 from "node:crypto";
73966
- import fs12 from "node:fs";
73967
- import path14 from "node:path";
73997
+ import fs13 from "node:fs";
73998
+ import path15 from "node:path";
73968
73999
 
73969
74000
  // ../cli/src/lib/agent/cloud-studios.ts
73970
- import fs10 from "node:fs";
73971
- import path12 from "node:path";
74001
+ import fs11 from "node:fs";
74002
+ import path13 from "node:path";
73972
74003
 
73973
74004
  // ../cli/src/lib/shared/file-limits.ts
73974
74005
  var BOARD_FILE_LIMIT = 10 * 1024 * 1024;
@@ -73980,8 +74011,8 @@ var studioName = (id) => id.startsWith("wf_builtin_") ? id.slice("wf_builtin_".l
73980
74011
 
73981
74012
  // ../official/pack.ts
73982
74013
  import crypto2 from "node:crypto";
73983
- import fs6 from "node:fs";
73984
- import path7 from "node:path";
74014
+ import fs7 from "node:fs";
74015
+ import path8 from "node:path";
73985
74016
  import { fileURLToPath as fileURLToPath2 } from "node:url";
73986
74017
 
73987
74018
  // ../cli/src/lib/agents/icon.ts
@@ -74414,8 +74445,8 @@ function parseStudioFile(id, source, from) {
74414
74445
  }
74415
74446
 
74416
74447
  // ../cli/src/lib/agent/studio-folder.ts
74417
- import fs5 from "node:fs";
74418
- import path6 from "node:path";
74448
+ import fs6 from "node:fs";
74449
+ import path7 from "node:path";
74419
74450
 
74420
74451
  // ../cli/src/lib/shared/studio-files.ts
74421
74452
  var STUDIO_FILE = "STUDIO.md";
@@ -74550,34 +74581,34 @@ function inspect(value, official) {
74550
74581
  // ../cli/src/lib/agent/studio-folder.ts
74551
74582
  var MIME = { ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".webp": "image/webp" };
74552
74583
  function filesOf(dir, base = dir) {
74553
- return fs5.readdirSync(dir, { withFileTypes: true }).filter((e) => !e.name.startsWith(".")).flatMap((e) => {
74554
- const full = path6.join(dir, e.name);
74555
- return e.isDirectory() ? filesOf(full, base) : [path6.relative(base, full).split(path6.sep).join("/")];
74584
+ return fs6.readdirSync(dir, { withFileTypes: true }).filter((e) => !e.name.startsWith(".")).flatMap((e) => {
74585
+ const full = path7.join(dir, e.name);
74586
+ return e.isDirectory() ? filesOf(full, base) : [path7.relative(base, full).split(path7.sep).join("/")];
74556
74587
  });
74557
74588
  }
74558
74589
  function readStudioFile(dir, file2) {
74559
- const full = path6.join(dir, file2);
74560
- return isAboutFile(file2) && !file2.endsWith(".md") ? `data:${MIME[path6.extname(file2)]};base64,${fs5.readFileSync(full).toString("base64")}` : fs5.readFileSync(full, "utf8");
74590
+ const full = path7.join(dir, file2);
74591
+ return isAboutFile(file2) && !file2.endsWith(".md") ? `data:${MIME[path7.extname(file2)]};base64,${fs6.readFileSync(full).toString("base64")}` : fs6.readFileSync(full, "utf8");
74561
74592
  }
74562
74593
  var readStudioFolder = (dir) => Object.fromEntries(filesOf(dir).sort().map((f) => [f, readStudioFile(dir, f)]));
74563
74594
 
74564
74595
  // ../official/pack.ts
74565
- var OFFICIAL = path7.dirname(fileURLToPath2(import.meta.url));
74566
- var dirs = (dir) => fs6.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
74596
+ var OFFICIAL = path8.dirname(fileURLToPath2(import.meta.url));
74597
+ var dirs = (dir) => fs7.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
74567
74598
  var hashOf = (files) => crypto2.createHash("sha256").update(hashInput(files)).digest("hex");
74568
74599
  function packOfficial(root2 = OFFICIAL, loose = false) {
74569
- const agentsDir = path7.join(root2, "agents");
74600
+ const agentsDir = path8.join(root2, "agents");
74570
74601
  const agentFiles = Object.fromEntries(dirs(agentsDir).map((name) => {
74571
- const dir = path7.join(agentsDir, name);
74602
+ const dir = path8.join(agentsDir, name);
74572
74603
  return [name, readStudioFolder(dir)];
74573
74604
  }));
74574
74605
  for (const [name, own3] of Object.entries(loose ? {} : agentFiles)) {
74575
74606
  const read2 = parseSpecAgent(own3["AGENT.md"] ?? "", `official/agents/${name}/AGENT.md`, (p) => own3[p] ?? null, true);
74576
74607
  if ("problem" in read2) throw new Error(read2.problem);
74577
74608
  }
74578
- const studiosDir = path7.join(root2, "studios");
74609
+ const studiosDir = path8.join(root2, "studios");
74579
74610
  return dirs(studiosDir).map((folder) => {
74580
- const dir = path7.join(studiosDir, folder);
74611
+ const dir = path8.join(studiosDir, folder);
74581
74612
  const files = {};
74582
74613
  for (const f of filesOf(dir).sort()) {
74583
74614
  if (f === STUDIO_FILE || f === CARD_TEMPLATE_FILE || f === MCP_FILE || f.startsWith("skills/") || f.startsWith(SHARED_DIR) || isAboutFile(f)) files[f] = readStudioFile(dir, f);
@@ -74609,23 +74640,23 @@ function packOfficial(root2 = OFFICIAL, loose = false) {
74609
74640
  }
74610
74641
 
74611
74642
  // ../cli/src/lib/cloud/tasks.ts
74612
- import fs7 from "node:fs";
74613
- import path8 from "node:path";
74643
+ import fs8 from "node:fs";
74644
+ import path9 from "node:path";
74614
74645
  var TASK_ENV = "AI4KANBAN_TASK";
74615
74646
  function workspaceTask() {
74616
74647
  const id = process.env[TASK_ENV];
74617
74648
  return id && id.trim() ? id.trim() : null;
74618
74649
  }
74619
74650
  function runnerProject(board) {
74620
- if (path8.basename(board) !== "kanban" || path8.basename(path8.dirname(board)) !== ".akb") return null;
74621
- const linked2 = linkedProject(board, path8.dirname(path8.dirname(board)));
74651
+ if (path9.basename(board) !== "kanban" || path9.basename(path9.dirname(board)) !== ".akb") return null;
74652
+ const linked2 = linkedProject(board, path9.dirname(path9.dirname(board)));
74622
74653
  return linked2.ok ? linked2.value : null;
74623
74654
  }
74624
74655
  function linkedProject(board, root2) {
74625
- const file2 = path8.join(root2, ".akb", "base.json");
74626
- if (!fs7.existsSync(file2)) return { ok: true, value: null };
74656
+ const file2 = path9.join(root2, ".akb", "base.json");
74657
+ if (!fs8.existsSync(file2)) return { ok: true, value: null };
74627
74658
  try {
74628
- const base = JSON.parse(fs7.readFileSync(file2, "utf8"));
74659
+ const base = JSON.parse(fs8.readFileSync(file2, "utf8"));
74629
74660
  if (!base || typeof base !== "object" || base.project !== void 0 && (typeof base.project !== "string" || !base.project.trim()) || base.files !== void 0 && (!base.files || typeof base.files !== "object" || Array.isArray(base.files))) throw new Error();
74630
74661
  const projects = new Set(Object.keys(base.files ?? {}).flatMap((p) => /^projects\/([^/]+)\//.exec(p)?.[1] ?? []));
74631
74662
  if (typeof base.project === "string") projects.add(base.project);
@@ -74637,14 +74668,14 @@ function linkedProject(board, root2) {
74637
74668
  }
74638
74669
 
74639
74670
  // ../cli/src/lib/file-memo.ts
74640
- import fs8 from "node:fs";
74641
- import path9 from "node:path";
74671
+ import fs9 from "node:fs";
74672
+ import path10 from "node:path";
74642
74673
  function stamp(paths) {
74643
74674
  const parts = [];
74644
74675
  const visit = (p) => {
74645
74676
  let st;
74646
74677
  try {
74647
- st = fs8.statSync(p, { bigint: true });
74678
+ st = fs9.statSync(p, { bigint: true });
74648
74679
  } catch {
74649
74680
  parts.push(`${p}:-`);
74650
74681
  return;
@@ -74656,11 +74687,11 @@ function stamp(paths) {
74656
74687
  parts.push(`${p}/`);
74657
74688
  let names2;
74658
74689
  try {
74659
- names2 = fs8.readdirSync(p).sort();
74690
+ names2 = fs9.readdirSync(p).sort();
74660
74691
  } catch {
74661
74692
  return;
74662
74693
  }
74663
- for (const name of names2) if (name !== "node_modules" && name !== ".git") visit(path9.join(p, name));
74694
+ for (const name of names2) if (name !== "node_modules" && name !== ".git") visit(path10.join(p, name));
74664
74695
  };
74665
74696
  for (const p of paths) visit(p);
74666
74697
  return parts.join("\n");
@@ -74702,11 +74733,11 @@ function memoByFiles(paths, read2) {
74702
74733
  }
74703
74734
 
74704
74735
  // ../cli/src/lib/paths.ts
74705
- import path11 from "node:path";
74736
+ import path12 from "node:path";
74706
74737
 
74707
74738
  // ../cli/src/lib/machine/project.ts
74708
- import fs9 from "node:fs";
74709
- import path10 from "node:path";
74739
+ import fs10 from "node:fs";
74740
+ import path11 from "node:path";
74710
74741
  var SESSIONS_FILE = "sessions.json";
74711
74742
  var SESSIONS_FOLDER = "sessions";
74712
74743
  var ASSETS_FOLDER = "assets";
@@ -74715,16 +74746,16 @@ var SESSIONS_LOCK = "sessions.lock";
74715
74746
  var INDEX_LOCK = "index.lock";
74716
74747
  var UI_CONFIG_FILE = "ui.config.json";
74717
74748
  function realPathOf(dir) {
74718
- const here2 = path10.resolve(dir);
74749
+ const here2 = path11.resolve(dir);
74719
74750
  const rest = [];
74720
74751
  let at = here2;
74721
74752
  for (; ; ) {
74722
74753
  try {
74723
- return path10.join(fs9.realpathSync(at), ...rest);
74754
+ return path11.join(fs10.realpathSync(at), ...rest);
74724
74755
  } catch {
74725
- const up = path10.dirname(at);
74756
+ const up = path11.dirname(at);
74726
74757
  if (up === at) return here2;
74727
- rest.unshift(path10.basename(at));
74758
+ rest.unshift(path11.basename(at));
74728
74759
  at = up;
74729
74760
  }
74730
74761
  }
@@ -74732,23 +74763,23 @@ function realPathOf(dir) {
74732
74763
  function stateRootOf(board) {
74733
74764
  let dir = realPathOf(board);
74734
74765
  for (; ; ) {
74735
- if (fs9.existsSync(path10.join(dir, ".git"))) return dir;
74736
- const up = path10.dirname(dir);
74766
+ if (fs10.existsSync(path11.join(dir, ".git"))) return dir;
74767
+ const up = path11.dirname(dir);
74737
74768
  if (up === dir) break;
74738
74769
  dir = up;
74739
74770
  }
74740
74771
  return rootAbove(realPathOf(board));
74741
74772
  }
74742
74773
  function rootAbove(board) {
74743
- const parent = path10.dirname(board);
74744
- return ["docs", ".akb"].includes(path10.basename(parent)) ? path10.dirname(parent) : parent;
74774
+ const parent = path11.dirname(board);
74775
+ return ["docs", ".akb"].includes(path11.basename(parent)) ? path11.dirname(parent) : parent;
74745
74776
  }
74746
74777
  function projectStateDir(board, root2 = stateRootOf(board)) {
74747
- const relative = path10.relative(realPathOf(root2), realPathOf(board));
74748
- if (relative === ".." || relative.startsWith(`..${path10.sep}`) || path10.isAbsolute(relative)) {
74778
+ const relative = path11.relative(realPathOf(root2), realPathOf(board));
74779
+ if (relative === ".." || relative.startsWith(`..${path11.sep}`) || path11.isAbsolute(relative)) {
74749
74780
  throw new Error("The board must be inside its project root.");
74750
74781
  }
74751
- return path10.join(realPathOf(root2), ".akb", "boards", relative || "_root");
74782
+ return path11.join(realPathOf(root2), ".akb", "boards", relative || "_root");
74752
74783
  }
74753
74784
 
74754
74785
  // ../cli/src/lib/paths.ts
@@ -74794,73 +74825,73 @@ var SIGNALS_OLD_HANDLED = "";
74794
74825
  var AKB_DIR = "";
74795
74826
  var ROOT_GITIGNORE = "";
74796
74827
  function boardLockName(kanban, root2) {
74797
- const from = path11.relative(root2, kanban);
74798
- const name = from && !from.startsWith("..") ? from : path11.basename(kanban);
74799
- return `${name.split(path11.sep).join("-")}.lock`;
74828
+ const from = path12.relative(root2, kanban);
74829
+ const name = from && !from.startsWith("..") ? from : path12.basename(kanban);
74830
+ return `${name.split(path12.sep).join("-")}.lock`;
74800
74831
  }
74801
74832
  var BOARD_FLAG = "";
74802
74833
  function setBoard(kanban, root2, flag) {
74803
- REPO_ROOT = path11.resolve(root2);
74804
- KANBAN = path11.resolve(kanban);
74834
+ REPO_ROOT = path12.resolve(root2);
74835
+ KANBAN = path12.resolve(kanban);
74805
74836
  BOARD_FLAG = flag;
74806
- TODO = path11.join(KANBAN, "todo");
74807
- ARCHIVE = path11.join(KANBAN, ".archive");
74808
- ARCHIVE_MD = path11.join(KANBAN, "archive.md");
74809
- README = path11.join(TODO, "README.md");
74810
- MODULES_MD = path11.join(KANBAN, "modules.md");
74811
- CONFIG = path11.join(KANBAN, "config.md");
74812
- KANBAN_GITIGNORE = path11.join(KANBAN, ".gitignore");
74813
- RELEASES = path11.join(KANBAN, "releases.md");
74814
- RELEASE_SUMMARIES = path11.join(KANBAN, ".release-summaries");
74815
- AGENTS = path11.join(KANBAN, "agents");
74816
- STUDIOS = path11.join(KANBAN, "studios");
74817
- LEGACY_AGENTS = path11.join(KANBAN, "skills");
74818
- MEMORY = path11.join(KANBAN, "memory");
74819
- AGENT_MEMORY = path11.join(MEMORY, "agents");
74820
- PROJECT_MD = path11.join(MEMORY, "project.md");
74821
- LEGACY_UI_CONFIG = path11.join(KANBAN, UI_CONFIG_FILE);
74822
- LOCAL_CONFIG = path11.join(KANBAN, ".local.json");
74823
- ENV_FILE = path11.join(KANBAN, ".env");
74837
+ TODO = path12.join(KANBAN, "todo");
74838
+ ARCHIVE = path12.join(KANBAN, ".archive");
74839
+ ARCHIVE_MD = path12.join(KANBAN, "archive.md");
74840
+ README = path12.join(TODO, "README.md");
74841
+ MODULES_MD = path12.join(KANBAN, "modules.md");
74842
+ CONFIG = path12.join(KANBAN, "config.md");
74843
+ KANBAN_GITIGNORE = path12.join(KANBAN, ".gitignore");
74844
+ RELEASES = path12.join(KANBAN, "releases.md");
74845
+ RELEASE_SUMMARIES = path12.join(KANBAN, ".release-summaries");
74846
+ AGENTS = path12.join(KANBAN, "agents");
74847
+ STUDIOS = path12.join(KANBAN, "studios");
74848
+ LEGACY_AGENTS = path12.join(KANBAN, "skills");
74849
+ MEMORY = path12.join(KANBAN, "memory");
74850
+ AGENT_MEMORY = path12.join(MEMORY, "agents");
74851
+ PROJECT_MD = path12.join(MEMORY, "project.md");
74852
+ LEGACY_UI_CONFIG = path12.join(KANBAN, UI_CONFIG_FILE);
74853
+ LOCAL_CONFIG = path12.join(KANBAN, ".local.json");
74854
+ ENV_FILE = path12.join(KANBAN, ".env");
74824
74855
  const machine = projectStateDir(KANBAN, REPO_ROOT);
74825
74856
  BOARD_STATE = machine;
74826
- UI_CONFIG = path11.join(machine, UI_CONFIG_FILE);
74827
- ASSETS = path11.join(machine, ASSETS_FOLDER);
74828
- MOCKUPS = path11.join(machine, MOCKUPS_FOLDER);
74829
- SESSIONS = path11.join(machine, SESSIONS_FILE);
74830
- SESSIONS_DIR = path11.join(machine, SESSIONS_FOLDER);
74831
- SESSIONS_LOCK2 = path11.join(machine, SESSIONS_LOCK);
74832
- INDEX_LOCK2 = path11.join(machine, INDEX_LOCK);
74833
- DELIVERIES = path11.join(KANBAN, "deliveries");
74834
- RULES = path11.join(KANBAN, "rules");
74835
- PLANS = path11.join(machine, "plans");
74836
- PLANS_ARCHIVE = path11.join(PLANS, "archive");
74837
- TRIAGE = path11.join(KANBAN, "triage");
74838
- SIGNALS_ARCHIVED = path11.join(TRIAGE, "archived");
74839
- SIGNALS_DISMISSED = path11.join(TRIAGE, "dismissed");
74840
- SIGNALS_FILES = path11.join(TRIAGE, "files");
74841
- SIGNALS_OLD_INBOX = path11.join(TRIAGE, "inbox");
74842
- SIGNALS_OLD_HANDLED = path11.join(TRIAGE, "handled.md");
74843
- AKB_DIR = path11.join(REPO_ROOT, ".akb");
74844
- ROOT_GITIGNORE = path11.join(REPO_ROOT, ".gitignore");
74845
- LOCK = path11.join(AKB_DIR, boardLockName(KANBAN, REPO_ROOT));
74857
+ UI_CONFIG = path12.join(machine, UI_CONFIG_FILE);
74858
+ ASSETS = path12.join(machine, ASSETS_FOLDER);
74859
+ MOCKUPS = path12.join(machine, MOCKUPS_FOLDER);
74860
+ SESSIONS = path12.join(machine, SESSIONS_FILE);
74861
+ SESSIONS_DIR = path12.join(machine, SESSIONS_FOLDER);
74862
+ SESSIONS_LOCK2 = path12.join(machine, SESSIONS_LOCK);
74863
+ INDEX_LOCK2 = path12.join(machine, INDEX_LOCK);
74864
+ DELIVERIES = path12.join(KANBAN, "deliveries");
74865
+ RULES = path12.join(KANBAN, "rules");
74866
+ PLANS = path12.join(machine, "plans");
74867
+ PLANS_ARCHIVE = path12.join(PLANS, "archive");
74868
+ TRIAGE = path12.join(KANBAN, "triage");
74869
+ SIGNALS_ARCHIVED = path12.join(TRIAGE, "archived");
74870
+ SIGNALS_DISMISSED = path12.join(TRIAGE, "dismissed");
74871
+ SIGNALS_FILES = path12.join(TRIAGE, "files");
74872
+ SIGNALS_OLD_INBOX = path12.join(TRIAGE, "inbox");
74873
+ SIGNALS_OLD_HANDLED = path12.join(TRIAGE, "handled.md");
74874
+ AKB_DIR = path12.join(REPO_ROOT, ".akb");
74875
+ ROOT_GITIGNORE = path12.join(REPO_ROOT, ".gitignore");
74876
+ LOCK = path12.join(AKB_DIR, boardLockName(KANBAN, REPO_ROOT));
74846
74877
  return REPO_ROOT;
74847
74878
  }
74848
74879
  function setBoardRoot(root2, named = false) {
74849
- const project = path11.resolve(root2);
74850
- return setBoard(path11.join(project, "docs", "kanban"), project, named ? ` --dir ${project}` : "");
74880
+ const project = path12.resolve(root2);
74881
+ return setBoard(path12.join(project, "docs", "kanban"), project, named ? ` --dir ${project}` : "");
74851
74882
  }
74852
74883
  setBoardRoot(process.cwd());
74853
74884
 
74854
74885
  // ../cli/src/lib/agent/cloud-studios.ts
74855
74886
  var DEV = "AI4KANBAN_STUDIOS";
74856
- var root = () => path12.join(machineHome(), "studios");
74887
+ var root = () => path13.join(machineHome(), "studios");
74857
74888
  var safe = (name) => name.replace(/[^\w.@-]/g, "_");
74858
- var versionFile = (id, version2) => path12.join(root(), "versions", `${safe(id)}@${version2}.json`);
74859
- var listFile = (project) => path12.join(root(), "lists", `${safe(project)}.json`);
74860
- var pinFile = (task) => path12.join(root(), "tasks", `${safe(task)}.json`);
74889
+ var versionFile = (id, version2) => path13.join(root(), "versions", `${safe(id)}@${version2}.json`);
74890
+ var listFile = (project) => path13.join(root(), "lists", `${safe(project)}.json`);
74891
+ var pinFile = (task) => path13.join(root(), "tasks", `${safe(task)}.json`);
74861
74892
  function readJson(file2) {
74862
74893
  try {
74863
- return JSON.parse(fs10.readFileSync(file2, "utf8"));
74894
+ return JSON.parse(fs11.readFileSync(file2, "utf8"));
74864
74895
  } catch {
74865
74896
  return null;
74866
74897
  }
@@ -74903,20 +74934,20 @@ var sources = () => {
74903
74934
  var flows = memoByFiles(sources, readFlows);
74904
74935
 
74905
74936
  // src/folders.ts
74906
- import fs11 from "node:fs";
74937
+ import fs12 from "node:fs";
74907
74938
  import os4 from "node:os";
74908
- import path13 from "node:path";
74909
- var projectsFile = () => path13.join(runnerHome(), "projects.json");
74939
+ import path14 from "node:path";
74940
+ var projectsFile = () => path14.join(runnerHome(), "projects.json");
74910
74941
  function realpath(p) {
74911
74942
  try {
74912
- return fs11.realpathSync(p);
74943
+ return fs12.realpathSync(p);
74913
74944
  } catch {
74914
74945
  return null;
74915
74946
  }
74916
74947
  }
74917
74948
  function readGrants() {
74918
74949
  try {
74919
- const held2 = JSON.parse(fs11.readFileSync(projectsFile(), "utf8"));
74950
+ const held2 = JSON.parse(fs12.readFileSync(projectsFile(), "utf8"));
74920
74951
  if (!Array.isArray(held2.projects)) throw new Error("invalid_projects");
74921
74952
  return held2;
74922
74953
  } catch (error2) {
@@ -74930,23 +74961,23 @@ function listOf(held2) {
74930
74961
  return subject ? held2.accounts[subject] ?? [] : [];
74931
74962
  }
74932
74963
  function update(change) {
74933
- fs11.mkdirSync(runnerHome(), { recursive: true, mode: 448 });
74964
+ fs12.mkdirSync(runnerHome(), { recursive: true, mode: 448 });
74934
74965
  const lock = `${projectsFile()}.lock`;
74935
74966
  let fd;
74936
74967
  const until = Date.now() + 2e3;
74937
74968
  for (; ; ) {
74938
74969
  try {
74939
- fd = fs11.openSync(lock, "wx", 384);
74940
- fs11.writeFileSync(fd, String(process.pid));
74970
+ fd = fs12.openSync(lock, "wx", 384);
74971
+ fs12.writeFileSync(fd, String(process.pid));
74941
74972
  break;
74942
74973
  } catch {
74943
74974
  try {
74944
- const pid = Number(fs11.readFileSync(lock, "utf8"));
74975
+ const pid = Number(fs12.readFileSync(lock, "utf8"));
74945
74976
  if (pid > 0) {
74946
74977
  try {
74947
74978
  process.kill(pid, 0);
74948
74979
  } catch {
74949
- fs11.rmSync(lock, { force: true });
74980
+ fs12.rmSync(lock, { force: true });
74950
74981
  }
74951
74982
  }
74952
74983
  } catch {
@@ -74969,13 +75000,13 @@ function update(change) {
74969
75000
  held2.projects = after;
74970
75001
  } else held2.projects = after;
74971
75002
  const tmp = `${projectsFile()}.${process.pid}.tmp`;
74972
- fs11.writeFileSync(tmp, `${JSON.stringify(held2, null, 2)}
75003
+ fs12.writeFileSync(tmp, `${JSON.stringify(held2, null, 2)}
74973
75004
  `, { mode: 384 });
74974
- fs11.renameSync(tmp, projectsFile());
75005
+ fs12.renameSync(tmp, projectsFile());
74975
75006
  return before.filter((p) => !after.includes(p));
74976
75007
  } finally {
74977
- fs11.closeSync(fd);
74978
- fs11.rmSync(lock, { force: true });
75008
+ fs12.closeSync(fd);
75009
+ fs12.rmSync(lock, { force: true });
74979
75010
  }
74980
75011
  }
74981
75012
  function adoptLegacy() {
@@ -74990,9 +75021,9 @@ var SYSTEM_WIN = ["Windows", "Program Files", "Program Files (x86)", "ProgramDat
74990
75021
  var here = () => ({ platform: process.platform, home: os4.homedir(), resolve: realpath });
74991
75022
  function refusal(picked, where = here()) {
74992
75023
  const win = where.platform === "win32";
74993
- const p = win ? path13.win32 : path13.posix;
75024
+ const p = win ? path14.win32 : path14.posix;
74994
75025
  const real = where.resolve(picked);
74995
- if (!real || !p.isAbsolute(real) || where.resolve === realpath && !fs11.statSync(real).isDirectory()) return "missing";
75026
+ if (!real || !p.isAbsolute(real) || where.resolve === realpath && !fs12.statSync(real).isDirectory()) return "missing";
74996
75027
  const norm = (d) => {
74997
75028
  const n = p.normalize(d).replace(/[\\/]+$/, "") || p.sep;
74998
75029
  return win ? n.toLowerCase() : n;
@@ -75015,16 +75046,16 @@ function refusal(picked, where = here()) {
75015
75046
  // src/cache.ts
75016
75047
  var IDLE_MS = 7 * 24 * 60 * 6e4;
75017
75048
  var SWEEP_MS = 24 * 60 * 6e4;
75018
- var akbDir = (dir) => path14.join(dir, ".akb");
75019
- var unsentFile = (dir) => path14.join(akbDir(dir), "unsent");
75020
- var unsent = (dir) => fs12.existsSync(unsentFile(dir));
75049
+ var akbDir = (dir) => path15.join(dir, ".akb");
75050
+ var unsentFile = (dir) => path15.join(akbDir(dir), "unsent");
75051
+ var unsent = (dir) => fs13.existsSync(unsentFile(dir));
75021
75052
  var holds = /* @__PURE__ */ new Map();
75022
- var holdsDir = () => path14.join(runnerHome(), "holds");
75023
- var holdFile = (dir) => path14.join(holdsDir(), `${crypto3.createHash("sha256").update(dir).digest("hex")}.${process.pid}`);
75053
+ var holdsDir = () => path15.join(runnerHome(), "holds");
75054
+ var holdFile = (dir) => path15.join(holdsDir(), `${crypto3.createHash("sha256").update(dir).digest("hex")}.${process.pid}`);
75024
75055
  function paused(dir) {
75025
75056
  try {
75026
- const file2 = path14.join(projectStateDir(path14.join(akbDir(dir), "kanban")), SESSIONS_FILE);
75027
- const held2 = JSON.parse(fs12.readFileSync(file2, "utf8"));
75057
+ const file2 = path15.join(projectStateDir(path15.join(akbDir(dir), "kanban")), SESSIONS_FILE);
75058
+ const held2 = JSON.parse(fs13.readFileSync(file2, "utf8"));
75028
75059
  return (held2.deliveries ?? []).some((d) => d.status === "active");
75029
75060
  } catch {
75030
75061
  return false;
@@ -75032,14 +75063,14 @@ function paused(dir) {
75032
75063
  }
75033
75064
  function busy(dir) {
75034
75065
  if (holds.has(dir)) return true;
75035
- const prefix = path14.basename(holdFile(dir)).split(".")[0] + ".";
75066
+ const prefix = path15.basename(holdFile(dir)).split(".")[0] + ".";
75036
75067
  try {
75037
- return fs12.readdirSync(holdsDir()).filter((file2) => file2.startsWith(prefix)).some((file2) => {
75068
+ return fs13.readdirSync(holdsDir()).filter((file2) => file2.startsWith(prefix)).some((file2) => {
75038
75069
  try {
75039
75070
  process.kill(Number(file2.split(".")[1]), 0);
75040
75071
  return true;
75041
75072
  } catch {
75042
- fs12.rmSync(path14.join(holdsDir(), file2), { force: true });
75073
+ fs13.rmSync(path15.join(holdsDir(), file2), { force: true });
75043
75074
  return false;
75044
75075
  }
75045
75076
  });
@@ -75050,19 +75081,19 @@ function busy(dir) {
75050
75081
  var kept = (dir) => busy(dir) || unsent(dir) || paused(dir);
75051
75082
  function clearAkb(dir) {
75052
75083
  dir = realpath2(dir);
75053
- if (kept(dir) || fs12.existsSync(path14.join(akbDir(dir), "worktrees")) || fs12.existsSync(path14.join(akbDir(dir), "handoffs"))) return false;
75084
+ if (kept(dir) || fs13.existsSync(path15.join(akbDir(dir), "worktrees")) || fs13.existsSync(path15.join(akbDir(dir), "handoffs"))) return false;
75054
75085
  let entries;
75055
75086
  try {
75056
- entries = fs12.readdirSync(akbDir(dir));
75087
+ entries = fs13.readdirSync(akbDir(dir));
75057
75088
  } catch {
75058
75089
  return true;
75059
75090
  }
75060
- for (const name of entries) fs12.rmSync(path14.join(akbDir(dir), name), { recursive: true, force: true });
75091
+ for (const name of entries) fs13.rmSync(path15.join(akbDir(dir), name), { recursive: true, force: true });
75061
75092
  return true;
75062
75093
  }
75063
75094
  function realpath2(p) {
75064
75095
  try {
75065
- return fs12.realpathSync(p);
75096
+ return fs13.realpathSync(p);
75066
75097
  } catch {
75067
75098
  return p;
75068
75099
  }
@@ -75070,8 +75101,8 @@ function realpath2(p) {
75070
75101
 
75071
75102
  // src/launcher.ts
75072
75103
  import { spawn } from "node:child_process";
75073
- import fs15 from "node:fs";
75074
- import path17 from "node:path";
75104
+ import fs16 from "node:fs";
75105
+ import path18 from "node:path";
75075
75106
 
75076
75107
  // src/i18n.ts
75077
75108
  var ZH_HOLDER = { "claude-code": "Claude Code", codex: "Codex", cursor: "Cursor", dsh: "dsh", zcode: "ZCode", kimi: "Kimi Code", terminal: "\u672C\u673A\u7EC8\u7AEF" };
@@ -75132,12 +75163,12 @@ function status(line) {
75132
75163
 
75133
75164
  // src/preferences.ts
75134
75165
  import crypto4 from "node:crypto";
75135
- import fs13 from "node:fs";
75136
- import path15 from "node:path";
75137
- var file = () => path15.join(runnerHome(), "preferences.json");
75166
+ import fs14 from "node:fs";
75167
+ import path16 from "node:path";
75168
+ var file = () => path16.join(runnerHome(), "preferences.json");
75138
75169
  function read() {
75139
75170
  try {
75140
- const value = JSON.parse(fs13.readFileSync(file(), "utf8"));
75171
+ const value = JSON.parse(fs14.readFileSync(file(), "utf8"));
75141
75172
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
75142
75173
  } catch {
75143
75174
  return {};
@@ -75146,32 +75177,32 @@ function read() {
75146
75177
  var acceptAlphaUpdates = () => read().acceptAlphaUpdates === true;
75147
75178
  function saveAlphaUpdates(value) {
75148
75179
  const target = file(), temporary = `${target}.${crypto4.randomUUID()}.tmp`;
75149
- fs13.mkdirSync(runnerHome(), { recursive: true, mode: 448 });
75180
+ fs14.mkdirSync(runnerHome(), { recursive: true, mode: 448 });
75150
75181
  try {
75151
- fs13.writeFileSync(temporary, JSON.stringify({ ...read(), acceptAlphaUpdates: value }) + "\n", { mode: 384 });
75152
- fs13.renameSync(temporary, target);
75182
+ fs14.writeFileSync(temporary, JSON.stringify({ ...read(), acceptAlphaUpdates: value }) + "\n", { mode: 384 });
75183
+ fs14.renameSync(temporary, target);
75153
75184
  } finally {
75154
- fs13.rmSync(temporary, { force: true });
75185
+ fs14.rmSync(temporary, { force: true });
75155
75186
  }
75156
75187
  }
75157
75188
 
75158
75189
  // src/update.ts
75159
75190
  import crypto5 from "node:crypto";
75160
- import fs14 from "node:fs";
75161
- import path16 from "node:path";
75191
+ import fs15 from "node:fs";
75192
+ import path17 from "node:path";
75162
75193
  import zlib from "node:zlib";
75163
75194
  var PACKAGE = "wildcrane-runner";
75164
75195
  var TIMEOUT_MS2 = 6e4;
75165
- var versionsDir = () => path16.join(runnerHome(), "bin", "runner");
75166
- var legacyVersionsDir = () => path16.join(runnerHome(), "runner");
75167
- var versionDir = (version2) => path16.join(versionsDir(), version2);
75168
- var entryOf = (dir) => path16.join(dir, "dist", "runner.mjs");
75196
+ var versionsDir = () => path17.join(runnerHome(), "bin", "runner");
75197
+ var legacyVersionsDir = () => path17.join(runnerHome(), "runner");
75198
+ var versionDir = (version2) => path17.join(versionsDir(), version2);
75199
+ var entryOf = (dir) => path17.join(dir, "dist", "runner.mjs");
75169
75200
  var RUNNER = { name: PACKAGE, dirOf: versionDir, entryOf };
75170
75201
  var registry2 = () => (process.env.npm_config_registry || "https://registry.npmjs.org").replace(/\/+$/, "");
75171
75202
  var install2 = (version2, nodeVersion) => installPackage(RUNNER, version2, nodeVersion);
75172
75203
  async function installPackage(pkg, version2, nodeVersion = process.versions.node) {
75173
75204
  const dir = pkg.dirOf(version2);
75174
- if (fs14.existsSync(pkg.entryOf(dir))) return { ok: true, dir };
75205
+ if (fs15.existsSync(pkg.entryOf(dir))) return { ok: true, dir };
75175
75206
  let meta2;
75176
75207
  let tarball;
75177
75208
  try {
@@ -75192,13 +75223,13 @@ async function installPackage(pkg, version2, nodeVersion = process.versions.node
75192
75223
  if (!expected || expected !== actual) return { ok: false, why: "integrity", detail: "sha512 mismatch" };
75193
75224
  const staging = `${dir}.${process.pid}.tmp`;
75194
75225
  try {
75195
- fs14.rmSync(staging, { recursive: true, force: true });
75226
+ fs15.rmSync(staging, { recursive: true, force: true });
75196
75227
  extract(zlib.gunzipSync(tarball), staging);
75197
- if (!fs14.existsSync(pkg.entryOf(staging))) throw new Error(`the package carries no ${path16.relative(staging, pkg.entryOf(staging))}`);
75198
- fs14.rmSync(dir, { recursive: true, force: true });
75199
- fs14.renameSync(staging, dir);
75228
+ if (!fs15.existsSync(pkg.entryOf(staging))) throw new Error(`the package carries no ${path17.relative(staging, pkg.entryOf(staging))}`);
75229
+ fs15.rmSync(dir, { recursive: true, force: true });
75230
+ fs15.renameSync(staging, dir);
75200
75231
  } catch (e) {
75201
- fs14.rmSync(staging, { recursive: true, force: true });
75232
+ fs15.rmSync(staging, { recursive: true, force: true });
75202
75233
  return { ok: false, why: "integrity", detail: e instanceof Error ? e.message : String(e) };
75203
75234
  }
75204
75235
  return { ok: true, dir };
@@ -75228,12 +75259,12 @@ function extract(tar, into) {
75228
75259
  if (type !== "0" && type !== "5") continue;
75229
75260
  const relative = name.replace(/^[^/]+\//, "");
75230
75261
  if (!relative) continue;
75231
- const target = path16.resolve(into, relative);
75232
- if (!target.startsWith(path16.resolve(into) + path16.sep)) throw new Error(`refusing ${name}`);
75233
- if (type === "5") fs14.mkdirSync(target, { recursive: true });
75262
+ const target = path17.resolve(into, relative);
75263
+ if (!target.startsWith(path17.resolve(into) + path17.sep)) throw new Error(`refusing ${name}`);
75264
+ if (type === "5") fs15.mkdirSync(target, { recursive: true });
75234
75265
  else {
75235
- fs14.mkdirSync(path16.dirname(target), { recursive: true });
75236
- fs14.writeFileSync(target, body);
75266
+ fs15.mkdirSync(path17.dirname(target), { recursive: true });
75267
+ fs15.writeFileSync(target, body);
75237
75268
  }
75238
75269
  }
75239
75270
  }
@@ -75295,27 +75326,27 @@ function meets(version2, comparator) {
75295
75326
  var ASK_MS = 5e3;
75296
75327
  var CONNECT_MS = 2 * 6e4;
75297
75328
  var KEEP2 = 2;
75298
- var stateFile = () => path17.join(versionsDir(), "state.json");
75329
+ var stateFile = () => path18.join(versionsDir(), "state.json");
75299
75330
  function readState() {
75300
75331
  try {
75301
- const held2 = JSON.parse(fs15.readFileSync(stateFile(), "utf8"));
75332
+ const held2 = JSON.parse(fs16.readFileSync(stateFile(), "utf8"));
75302
75333
  return { ...held2, good: held2.good ?? [], bad: held2.bad ?? [] };
75303
75334
  } catch {
75304
75335
  return { good: [], bad: [] };
75305
75336
  }
75306
75337
  }
75307
75338
  function writeState(state2) {
75308
- fs15.mkdirSync(versionsDir(), { recursive: true });
75309
- fs15.writeFileSync(stateFile(), `${JSON.stringify(state2, null, 2)}
75339
+ fs16.mkdirSync(versionsDir(), { recursive: true });
75340
+ fs16.writeFileSync(stateFile(), `${JSON.stringify(state2, null, 2)}
75310
75341
  `);
75311
75342
  }
75312
75343
  function markGood(version2) {
75313
75344
  const state2 = readState();
75314
75345
  state2.good = [version2, ...state2.good.filter((v) => v !== version2)].slice(0, KEEP2);
75315
75346
  writeState(state2);
75316
- for (const name of fs15.readdirSync(versionsDir())) {
75317
- if (name === "state.json" || state2.good.includes(name) || name.endsWith(".tmp") || busy(path17.join(versionsDir(), name))) continue;
75318
- fs15.rmSync(path17.join(versionsDir(), name), { recursive: true, force: true });
75347
+ for (const name of fs16.readdirSync(versionsDir())) {
75348
+ if (name === "state.json" || state2.good.includes(name) || name.endsWith(".tmp") || busy(path18.join(versionsDir(), name))) continue;
75349
+ fs16.rmSync(path18.join(versionsDir(), name), { recursive: true, force: true });
75319
75350
  }
75320
75351
  }
75321
75352
  function markBad(version2) {
@@ -75349,7 +75380,7 @@ function remember(target) {
75349
75380
  writeState(state2);
75350
75381
  }
75351
75382
  function provenNewer(own3) {
75352
- const proven = readState().good.find((v) => fs15.existsSync(entryOf(versionDir(v))));
75383
+ const proven = readState().good.find((v) => fs16.existsSync(entryOf(versionDir(v))));
75353
75384
  return proven && compare(proven, own3) > 0 ? proven : null;
75354
75385
  }
75355
75386
  async function candidates(own3) {
@@ -75451,8 +75482,8 @@ function runOnce(candidate, options) {
75451
75482
  if (message.type === "connected" && !connected) {
75452
75483
  connected = true;
75453
75484
  if (timer) clearTimeout(timer);
75454
- if (candidate.entry.startsWith(versionsDir() + path17.sep)) fs15.rmSync(legacyVersionsDir(), { recursive: true, force: true });
75455
- const installed = candidate.entry.startsWith(versionsDir() + path17.sep);
75485
+ if (candidate.entry.startsWith(versionsDir() + path18.sep)) fs16.rmSync(legacyVersionsDir(), { recursive: true, force: true });
75486
+ const installed = candidate.entry.startsWith(versionsDir() + path18.sep);
75456
75487
  if (candidate.fresh || installed && !readState().good.includes(candidate.version)) markGood(candidate.version);
75457
75488
  if (candidate.fresh) status(t.updated(candidate.version));
75458
75489
  }
@@ -75508,20 +75539,20 @@ var WEB_URL = () => (process.env.WILDCRANE_WEB_URL || "https://app.wildcrane.ai"
75508
75539
  var taskUrl = (task) => `${WEB_URL()}/tasks/${encodeURIComponent(task)}`;
75509
75540
 
75510
75541
  // src/plugin-version.ts
75511
- import fs16 from "node:fs";
75542
+ import fs17 from "node:fs";
75512
75543
  import os5 from "node:os";
75513
- import path18 from "node:path";
75544
+ import path19 from "node:path";
75514
75545
  var RELEASED = "https://raw.githubusercontent.com/wildcrane-ai/wildcrane/main/plugins/claude-code/.claude-plugin/plugin.json";
75515
75546
  var TIMEOUT_MS3 = 5e3;
75516
75547
  var KEEP_MS = 6 * 60 * 6e4;
75517
75548
  var RETRY_MS = 5 * 6e4;
75518
- var pluginRoot = (host2) => (host2 === "claude-code" || host2 === "zcode") && process.env.CLAUDE_PLUGIN_ROOT || path18.resolve(path18.dirname(process.argv[1] ?? ""), "..", "..");
75519
- var CLAUDE_MANIFEST = path18.join(".claude-plugin", "plugin.json");
75520
- var MANIFEST = { "claude-code": CLAUDE_MANIFEST, zcode: CLAUDE_MANIFEST, codex: "plugin.json", grok: "plugin.json", opencode: "package.json", dsh: "package.json", cursor: path18.join(".cursor-plugin", "plugin.json"), kimi: "kimi.plugin.json" };
75549
+ var pluginRoot = (host2) => (host2 === "claude-code" || host2 === "zcode") && process.env.CLAUDE_PLUGIN_ROOT || path19.resolve(path19.dirname(process.argv[1] ?? ""), "..", "..");
75550
+ var CLAUDE_MANIFEST = path19.join(".claude-plugin", "plugin.json");
75551
+ var MANIFEST = { "claude-code": CLAUDE_MANIFEST, zcode: CLAUDE_MANIFEST, codex: "plugin.json", grok: "plugin.json", opencode: "package.json", dsh: "package.json", cursor: path19.join(".cursor-plugin", "plugin.json"), kimi: "kimi.plugin.json" };
75521
75552
  function pluginVersion(host2 = "claude-code", root2 = pluginRoot(host2)) {
75522
75553
  const file2 = MANIFEST[host2];
75523
75554
  try {
75524
- const version2 = JSON.parse(fs16.readFileSync(path18.join(root2, file2), "utf8")).version;
75555
+ const version2 = JSON.parse(fs17.readFileSync(path19.join(root2, file2), "utf8")).version;
75525
75556
  return typeof version2 === "string" ? version2 : null;
75526
75557
  } catch {
75527
75558
  return null;
@@ -75544,9 +75575,9 @@ function checkReleased(url = RELEASED, now = Date.now()) {
75544
75575
  fetching = get(url).then(releasedOf, () => null).then((value) => void (released = { at: Date.now(), value })).finally(() => fetching = null);
75545
75576
  return fetching;
75546
75577
  }
75547
- function codexSource(home4 = process.env.CODEX_HOME || path18.join(os5.homedir(), ".codex")) {
75578
+ function codexSource(home4 = process.env.CODEX_HOME || path19.join(os5.homedir(), ".codex")) {
75548
75579
  try {
75549
- const config2 = fs16.readFileSync(path18.join(home4, "config.toml"), "utf8");
75580
+ const config2 = fs17.readFileSync(path19.join(home4, "config.toml"), "utf8");
75550
75581
  const section = /^\[marketplaces\.wildcrane\][^\n]*\n((?:(?!\[)[^\n]*\n?)*)/m.exec(config2)?.[1] ?? "";
75551
75582
  const type = /^source_type\s*=\s*"(\w+)"/m.exec(section)?.[1];
75552
75583
  return type === "git" || type === "local" ? type : null;
@@ -75567,21 +75598,21 @@ async function get(url) {
75567
75598
 
75568
75599
  // src/runtimes.ts
75569
75600
  import { spawn as spawn3 } from "node:child_process";
75570
- import fs25 from "node:fs";
75601
+ import fs26 from "node:fs";
75571
75602
  import os7 from "node:os";
75572
- import path28 from "node:path";
75603
+ import path29 from "node:path";
75573
75604
 
75574
75605
  // ../cli/src/lib/agent/harnesses/antigravity.ts
75575
- import fs20 from "node:fs";
75576
- import path22 from "node:path";
75606
+ import fs21 from "node:fs";
75607
+ import path23 from "node:path";
75577
75608
  import { createHash as createHash2 } from "node:crypto";
75578
75609
  import { spawnSync as spawnSync2 } from "node:child_process";
75579
75610
 
75580
75611
  // ../cli/src/lib/agent/locate.ts
75581
75612
  import { spawn as spawn2, spawnSync } from "node:child_process";
75582
- import fs18 from "node:fs";
75613
+ import fs19 from "node:fs";
75583
75614
  import os6 from "node:os";
75584
- import path20 from "node:path";
75615
+ import path21 from "node:path";
75585
75616
 
75586
75617
  // ../cli/src/lib/agent/argv.ts
75587
75618
  function splitCommand(command) {
@@ -75620,8 +75651,8 @@ function commandBinary(command) {
75620
75651
  }
75621
75652
 
75622
75653
  // ../cli/src/lib/agent/spawnable.ts
75623
- import fs17 from "node:fs";
75624
- import path19 from "node:path";
75654
+ import fs18 from "node:fs";
75655
+ import path20 from "node:path";
75625
75656
  var META = /([()\][%!^"`<>&|;, *?])/g;
75626
75657
  function cmdArg(arg) {
75627
75658
  const quoted = `"${arg.replace(/\r?\n|\r/g, " ").replace(/(\\*)"/g, '$1$1\\"').replace(/(\\*)$/, "$1$1")}"`;
@@ -75631,21 +75662,21 @@ function cmdLine(file2, args2) {
75631
75662
  return `"${[file2.replace(META, "^$1"), ...args2.map(cmdArg)].join(" ")}"`;
75632
75663
  }
75633
75664
  function shimTarget(text4, file2) {
75634
- const dir = path19.win32.dirname(file2);
75665
+ const dir = path20.win32.dirname(file2);
75635
75666
  const found = /"%(?:~dp0|dp0%)\\?([^"%]+)"\s+%\*/i.exec(text4);
75636
75667
  if (!found || !/\\node\.exe"/i.test(text4)) return null;
75637
- const script = path19.win32.resolve(dir, found[1].replace(/\//g, "\\"));
75638
- const local = path19.win32.join(dir, "node.exe");
75668
+ const script = path20.win32.resolve(dir, found[1].replace(/\//g, "\\"));
75669
+ const local = path20.win32.join(dir, "node.exe");
75639
75670
  const nodePath = /SET "NODE_PATH=([^"]*)"/i.exec(text4)?.[1];
75640
- return { script, node: fs17.existsSync(local) ? local : "node", env: nodePath ? { NODE_PATH: nodePath } : {} };
75671
+ return { script, node: fs18.existsSync(local) ? local : "node", env: nodePath ? { NODE_PATH: nodePath } : {} };
75641
75672
  }
75642
75673
  function onWindowsPath(name, env2) {
75643
75674
  const exts = (env2.PATHEXT || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean);
75644
75675
  const key = Object.keys(env2).find((k) => k.toUpperCase() === "PATH") ?? "PATH";
75645
75676
  for (const dir of (env2[key] ?? "").split(";").filter(Boolean)) {
75646
75677
  for (const ext of exts) {
75647
- const file2 = path19.win32.join(dir, `${name}${ext.toLowerCase()}`);
75648
- if (fs17.existsSync(file2)) return file2;
75678
+ const file2 = path20.win32.join(dir, `${name}${ext.toLowerCase()}`);
75679
+ if (fs18.existsSync(file2)) return file2;
75649
75680
  }
75650
75681
  }
75651
75682
  return void 0;
@@ -75653,13 +75684,13 @@ function onWindowsPath(name, env2) {
75653
75684
  function spawnable(command, args2, options = {}, platform = process.platform) {
75654
75685
  if (platform !== "win32") return { command, args: args2, options };
75655
75686
  const env2 = options.env ?? process.env;
75656
- const file2 = path19.extname(command) || /[\\/]/.test(command) ? command : onWindowsPath(command, env2) ?? command;
75657
- const ext = path19.extname(file2).toLowerCase();
75687
+ const file2 = path20.extname(command) || /[\\/]/.test(command) ? command : onWindowsPath(command, env2) ?? command;
75688
+ const ext = path20.extname(file2).toLowerCase();
75658
75689
  const hidden = { ...options, windowsHide: true, shell: false };
75659
75690
  if (ext !== ".cmd" && ext !== ".bat") return { command: file2, args: args2, options: hidden };
75660
75691
  let text4 = "";
75661
75692
  try {
75662
- text4 = fs17.readFileSync(file2, "utf8");
75693
+ text4 = fs18.readFileSync(file2, "utf8");
75663
75694
  } catch {
75664
75695
  }
75665
75696
  const shim = shimTarget(text4, file2);
@@ -75723,7 +75754,7 @@ function pick2(copies) {
75723
75754
  }
75724
75755
  function folders(parent) {
75725
75756
  try {
75726
- return fs18.readdirSync(parent, { withFileTypes: true }).filter((one) => one.isDirectory()).map((one) => one.name);
75757
+ return fs19.readdirSync(parent, { withFileTypes: true }).filter((one) => one.isDirectory()).map((one) => one.name);
75727
75758
  } catch {
75728
75759
  return [];
75729
75760
  }
@@ -75742,29 +75773,29 @@ function byVersion(names2) {
75742
75773
  function latestIn(parent, tail = "") {
75743
75774
  let names2;
75744
75775
  try {
75745
- names2 = fs18.readdirSync(parent);
75776
+ names2 = fs19.readdirSync(parent);
75746
75777
  } catch {
75747
75778
  return [];
75748
75779
  }
75749
- return byVersion(names2.filter((name) => !name.startsWith("."))).slice(0, 2).map((name) => path20.join(parent, name, tail));
75780
+ return byVersion(names2.filter((name) => !name.startsWith("."))).slice(0, 2).map((name) => path21.join(parent, name, tail));
75750
75781
  }
75751
75782
  var env = (name) => process.env[name]?.trim() ?? "";
75752
75783
  function commonDirs() {
75753
75784
  const home4 = os6.homedir();
75754
- const under = (...parts) => path20.join(home4, ...parts);
75755
- const nodes = (root2, tail = []) => root2 ? folders(root2).map((version2) => path20.join(root2, version2, ...tail)) : [];
75785
+ const under = (...parts) => path21.join(home4, ...parts);
75786
+ const nodes = (root2, tail = []) => root2 ? folders(root2).map((version2) => path21.join(root2, version2, ...tail)) : [];
75756
75787
  if (WINDOWS2) {
75757
75788
  const [app, local, data, programs] = [env("APPDATA"), env("LOCALAPPDATA"), env("ProgramData"), env("ProgramFiles")];
75758
75789
  return [
75759
75790
  under(".local", "bin"),
75760
75791
  under(".bun", "bin"),
75761
75792
  under("scoop", "shims"),
75762
- ...app ? [path20.join(app, "npm")] : [],
75763
- ...local ? [path20.join(local, "pnpm"), path20.join(local, "Volta", "bin"), path20.join(local, "Microsoft", "WinGet", "Links")] : [],
75764
- ...data ? [path20.join(data, "chocolatey", "bin")] : [],
75765
- ...programs ? [path20.join(programs, "nodejs")] : [],
75793
+ ...app ? [path21.join(app, "npm")] : [],
75794
+ ...local ? [path21.join(local, "pnpm"), path21.join(local, "Volta", "bin"), path21.join(local, "Microsoft", "WinGet", "Links")] : [],
75795
+ ...data ? [path21.join(data, "chocolatey", "bin")] : [],
75796
+ ...programs ? [path21.join(programs, "nodejs")] : [],
75766
75797
  ...nodes(env("NVM_HOME")),
75767
- ...app ? nodes(path20.join(app, "fnm", "node-versions"), ["installation"]) : []
75798
+ ...app ? nodes(path21.join(app, "fnm", "node-versions"), ["installation"]) : []
75768
75799
  ];
75769
75800
  }
75770
75801
  const support = process.platform === "darwin" ? under("Library", "Application Support") : under(".local", "share");
@@ -75781,10 +75812,10 @@ function commonDirs() {
75781
75812
  ...env("PNPM_HOME") ? [env("PNPM_HOME")] : [],
75782
75813
  under("Library", "pnpm"),
75783
75814
  under(".local", "share", "pnpm"),
75784
- path20.join(env("VOLTA_HOME") || under(".volta"), "bin"),
75785
- ...nodes(path20.join(env("NVM_DIR") || under(".nvm"), "versions", "node"), ["bin"]),
75786
- ...nodes(path20.join(env("FNM_DIR") || path20.join(support, "fnm"), "node-versions"), ["installation", "bin"]),
75787
- ...nodes(path20.join(env("ASDF_DATA_DIR") || under(".asdf"), "installs", "nodejs"), ["bin"]),
75815
+ path21.join(env("VOLTA_HOME") || under(".volta"), "bin"),
75816
+ ...nodes(path21.join(env("NVM_DIR") || under(".nvm"), "versions", "node"), ["bin"]),
75817
+ ...nodes(path21.join(env("FNM_DIR") || path21.join(support, "fnm"), "node-versions"), ["installation", "bin"]),
75818
+ ...nodes(path21.join(env("ASDF_DATA_DIR") || under(".asdf"), "installs", "nodejs"), ["bin"]),
75788
75819
  ...nodes(under(".local", "share", "mise", "installs", "node"), ["bin"]),
75789
75820
  ...nodes(under(".nodenv", "versions"), ["bin"]),
75790
75821
  ...nodes("/usr/local/n/versions/node", ["bin"])
@@ -75792,11 +75823,11 @@ function commonDirs() {
75792
75823
  }
75793
75824
  function onPath(binary) {
75794
75825
  const names2 = WINDOWS2 ? (process.env.PATHEXT || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean).map((ext) => `${binary}${ext.toLowerCase()}`) : [binary];
75795
- return (process.env.PATH ?? "").split(path20.delimiter).filter(Boolean).flatMap((dir) => names2.map((name) => path20.join(dir, name)));
75826
+ return (process.env.PATH ?? "").split(path21.delimiter).filter(Boolean).flatMap((dir) => names2.map((name) => path21.join(dir, name)));
75796
75827
  }
75797
75828
  var isFile = (file2) => {
75798
75829
  try {
75799
- return fs18.statSync(file2).isFile();
75830
+ return fs19.statSync(file2).isFile();
75800
75831
  } catch {
75801
75832
  return false;
75802
75833
  }
@@ -75805,24 +75836,24 @@ function copyFiles(harness) {
75805
75836
  const pinned = harness.pinned?.();
75806
75837
  if (pinned && isFile(pinned)) return [{ file: pinned, entry: false }];
75807
75838
  const binary = commandBinary(harness.command);
75808
- const exe = (file2) => WINDOWS2 && !path20.extname(file2) ? [`${file2}.exe`, `${file2}.cmd`] : [file2];
75839
+ const exe = (file2) => WINDOWS2 && !path21.extname(file2) ? [`${file2}.exe`, `${file2}.cmd`] : [file2];
75809
75840
  const path_ = onPath(binary).filter(isFile);
75810
- const elsewhere2 = process.env.AI4KANBAN_PATH_ONLY ? [] : [...harness.installs?.() ?? [], ...commonDirs().map((dir) => path20.join(dir, binary))];
75841
+ const elsewhere2 = process.env.AI4KANBAN_PATH_ONLY ? [] : [...harness.installs?.() ?? [], ...commonDirs().map((dir) => path21.join(dir, binary))];
75811
75842
  const others = elsewhere2.flatMap(exe).filter(isFile);
75812
75843
  const seen = /* @__PURE__ */ new Set();
75813
75844
  return [...path_, ...others].flatMap((file2, i) => {
75814
- const real = fs18.realpathSync.native(file2);
75845
+ const real = fs19.realpathSync.native(file2);
75815
75846
  if (seen.has(real)) return [];
75816
75847
  seen.add(real);
75817
75848
  return [{ file: file2, entry: i === 0 && path_.length > 0 }];
75818
75849
  });
75819
75850
  }
75820
75851
  var answers;
75821
- var answersFile = () => path20.join(machineHome(), "agent-copies.json");
75852
+ var answersFile = () => path21.join(machineHome(), "agent-copies.json");
75822
75853
  function kept2() {
75823
75854
  if (answers) return answers;
75824
75855
  try {
75825
- answers = JSON.parse(fs18.readFileSync(answersFile(), "utf8"));
75856
+ answers = JSON.parse(fs19.readFileSync(answersFile(), "utf8"));
75826
75857
  } catch {
75827
75858
  answers = {};
75828
75859
  }
@@ -75831,16 +75862,16 @@ function kept2() {
75831
75862
  function keep(file2, answer) {
75832
75863
  kept2()[file2] = answer;
75833
75864
  try {
75834
- fs18.mkdirSync(machineHome(), { recursive: true });
75865
+ fs19.mkdirSync(machineHome(), { recursive: true });
75835
75866
  const staged = `${answersFile()}.${process.pid}`;
75836
- fs18.writeFileSync(staged, JSON.stringify(answers));
75837
- fs18.renameSync(staged, answersFile());
75867
+ fs19.writeFileSync(staged, JSON.stringify(answers));
75868
+ fs19.renameSync(staged, answersFile());
75838
75869
  } catch {
75839
75870
  }
75840
75871
  }
75841
75872
  function keyOf(file2) {
75842
- const real = fs18.realpathSync.native(file2);
75843
- const stat = fs18.statSync(real);
75873
+ const real = fs19.realpathSync.native(file2);
75874
+ const stat = fs19.statSync(real);
75844
75875
  return `${real}|${stat.size}|${stat.mtimeMs}`;
75845
75876
  }
75846
75877
  function known(file2, maxAge) {
@@ -75853,8 +75884,8 @@ function judge(code, status2, stdout, stderr) {
75853
75884
  return { starts: true, version: status2 === 0 ? versionIn(stdout) ?? versionIn(stderr) : null };
75854
75885
  }
75855
75886
  function copyEnv(file2, given = process.env) {
75856
- if (!path20.isAbsolute(file2)) return given;
75857
- return { ...given, PATH: [path20.dirname(file2), given.PATH].filter(Boolean).join(path20.delimiter) };
75887
+ if (!path21.isAbsolute(file2)) return given;
75888
+ return { ...given, PATH: [path21.dirname(file2), given.PATH].filter(Boolean).join(path21.delimiter) };
75858
75889
  }
75859
75890
  var probeOptions = (file2) => ({ cwd: os6.tmpdir(), env: copyEnv(file2), windowsHide: true, shell: false });
75860
75891
  function probe(file2) {
@@ -75951,8 +75982,8 @@ function modelsIn(file2, pick3, salt = "") {
75951
75982
 
75952
75983
  // ../cli/src/lib/agent/harnesses/types.ts
75953
75984
  import { createHash } from "node:crypto";
75954
- import fs19 from "node:fs";
75955
- import path21 from "node:path";
75985
+ import fs20 from "node:fs";
75986
+ import path22 from "node:path";
75956
75987
  var SKILL_SENTENCE = "Use the kanban skill";
75957
75988
  function namesFlag(argv, flags) {
75958
75989
  return argv.some((tok) => flags.some((flag) => tok === flag || tok.startsWith(`${flag}=`)));
@@ -75975,13 +76006,13 @@ var MCP_CONFIG = {
75975
76006
  };
75976
76007
  function machineFile(name, text4) {
75977
76008
  const suffix = createHash("sha256").update(text4).digest("hex").slice(0, 16);
75978
- const file2 = path21.join(machineHome(), "prompts", `${path21.parse(name).name}-${suffix}${path21.extname(name)}`);
76009
+ const file2 = path22.join(machineHome(), "prompts", `${path22.parse(name).name}-${suffix}${path22.extname(name)}`);
75979
76010
  try {
75980
- if (fs19.readFileSync(file2, "utf8") === text4) return file2;
76011
+ if (fs20.readFileSync(file2, "utf8") === text4) return file2;
75981
76012
  } catch {
75982
76013
  }
75983
- fs19.mkdirSync(path21.dirname(file2), { recursive: true });
75984
- fs19.writeFileSync(file2, text4);
76014
+ fs20.mkdirSync(path22.dirname(file2), { recursive: true });
76015
+ fs20.writeFileSync(file2, text4);
75985
76016
  return file2;
75986
76017
  }
75987
76018
 
@@ -76354,7 +76385,7 @@ function antigravityModels(output2) {
76354
76385
  }
76355
76386
  function args(argv, resume) {
76356
76387
  if (namesFlag(argv, ["--continue", "-c", "--conversation", "--remote-agent"])) throw new Error(translating() ? "\u8BF7\u901A\u8FC7 WildCrane \u9009\u62E9 Antigravity \u4F1A\u8BDD\uFF0C\u4E0D\u8981\u5728\u989D\u5916\u53C2\u6570\u4E2D\u6307\u5B9A\u4F1A\u8BDD\u6216\u8FDC\u7A0B\u6267\u884C\u3002" : "Antigravity: select a session through WildCrane, not extra arguments.");
76357
- if (resume && (!/^[a-f0-9-]{36}$/i.test(resume) || !fs20.existsSync(home(".gemini", "antigravity-cli", "conversations", `${resume}.db`)))) throw new Error(translating() ? "Antigravity \u4F1A\u8BDD\u4E0D\u5B58\u5728\u3002\u8BF7\u5728\u672C\u673A\u6062\u590D\u539F\u4F1A\u8BDD\u540E\u7EED\u63A5\u3002" : "Antigravity session not found. Restore the original conversation on this computer before resuming.");
76388
+ if (resume && (!/^[a-f0-9-]{36}$/i.test(resume) || !fs21.existsSync(home(".gemini", "antigravity-cli", "conversations", `${resume}.db`)))) throw new Error(translating() ? "Antigravity \u4F1A\u8BDD\u4E0D\u5B58\u5728\u3002\u8BF7\u5728\u672C\u673A\u6062\u590D\u539F\u4F1A\u8BDD\u540E\u7EED\u63A5\u3002" : "Antigravity session not found. Restore the original conversation on this computer before resuming.");
76358
76389
  const extra = resume ? ["--conversation", resume] : [];
76359
76390
  if (!namesFlag(argv, ["--output-format"])) extra.push("--output-format", "stream-json");
76360
76391
  if (!namesFlag(argv, ["--dangerously-skip-permissions"])) extra.push("--dangerously-skip-permissions");
@@ -76395,10 +76426,10 @@ var ANTIGRAVITY = {
76395
76426
 
76396
76427
  The task working directory is ${env2.PWD ?? process.cwd()}. Use it as the base for project files and commands. This additional workspace contains only language rules; do not write task output here.`;
76397
76428
  const hash = createHash2("sha256").update(rule).digest("hex").slice(0, 16);
76398
- const root2 = path22.join(machineHome(), "prompts", `antigravity-${hash}`);
76399
- const file2 = path22.join(root2, ".agents", "rules", "language.md");
76400
- fs20.mkdirSync(path22.dirname(file2), { recursive: true });
76401
- fs20.writeFileSync(file2, `---
76429
+ const root2 = path23.join(machineHome(), "prompts", `antigravity-${hash}`);
76430
+ const file2 = path23.join(root2, ".agents", "rules", "language.md");
76431
+ fs21.mkdirSync(path23.dirname(file2), { recursive: true });
76432
+ fs21.writeFileSync(file2, `---
76402
76433
  trigger: always_on
76403
76434
  ---
76404
76435
 
@@ -76501,7 +76532,7 @@ function checkHarnesses(harnesses) {
76501
76532
  }
76502
76533
 
76503
76534
  // ../cli/src/lib/agent/harnesses/claude-code.ts
76504
- import path25 from "node:path";
76535
+ import path26 from "node:path";
76505
76536
 
76506
76537
  // ../cli/src/lib/agent/wire/claude-stream.ts
76507
76538
  var ARG_KEYS = ["command", "file_path", "path", "pattern", "description", "prompt", "query", "url"];
@@ -77451,16 +77482,16 @@ function createKimiStreamRenderer(cwd, resumeId) {
77451
77482
  }
77452
77483
 
77453
77484
  // ../cli/src/lib/agent/wire/acp-cost.ts
77454
- import fs21 from "node:fs";
77455
- import path23 from "node:path";
77485
+ import fs22 from "node:fs";
77486
+ import path24 from "node:path";
77456
77487
  import { createHash as createHash3 } from "node:crypto";
77457
77488
  function acpCostFile(tool, cwd, session) {
77458
77489
  const key = createHash3("sha256").update(JSON.stringify([tool, cwd, session])).digest("hex");
77459
- return path23.join(machineHome(), "usage", "acp", `${key}.json`);
77490
+ return path24.join(machineHome(), "usage", "acp", `${key}.json`);
77460
77491
  }
77461
77492
  function readAcpCost(file2) {
77462
77493
  try {
77463
- const n = JSON.parse(fs21.readFileSync(file2, "utf8"));
77494
+ const n = JSON.parse(fs22.readFileSync(file2, "utf8"));
77464
77495
  return typeof n === "number" && Number.isFinite(n) && n >= 0 ? n : void 0;
77465
77496
  } catch {
77466
77497
  return void 0;
@@ -77469,10 +77500,10 @@ function readAcpCost(file2) {
77469
77500
  function saveAcpCost(file2, cost) {
77470
77501
  if (cost === void 0) return;
77471
77502
  try {
77472
- fs21.mkdirSync(path23.dirname(file2), { recursive: true, mode: 448 });
77503
+ fs22.mkdirSync(path24.dirname(file2), { recursive: true, mode: 448 });
77473
77504
  const tmp = `${file2}.${process.pid}.tmp`;
77474
- fs21.writeFileSync(tmp, JSON.stringify(cost), { mode: 384 });
77475
- fs21.renameSync(tmp, file2);
77505
+ fs22.writeFileSync(tmp, JSON.stringify(cost), { mode: 384 });
77506
+ fs22.renameSync(tmp, file2);
77476
77507
  } catch {
77477
77508
  }
77478
77509
  }
@@ -77493,7 +77524,7 @@ function bounded(work, ms, reason) {
77493
77524
  }
77494
77525
 
77495
77526
  // ../cli/src/lib/agent/wire/acp.ts
77496
- import fs22 from "node:fs";
77527
+ import fs23 from "node:fs";
77497
77528
 
77498
77529
  // ../cli/src/lib/agent/wire/rpc.ts
77499
77530
  var RpcError = class extends Error {
@@ -77627,7 +77658,7 @@ function createTail(log) {
77627
77658
  // ../cli/package.json
77628
77659
  var package_default = {
77629
77660
  name: "wildcrane",
77630
- version: "0.11.53",
77661
+ version: "0.11.55",
77631
77662
  akbContract: 15,
77632
77663
  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.",
77633
77664
  keywords: [
@@ -77770,7 +77801,7 @@ var STOPPED = {
77770
77801
  cancelled: "the turn was cancelled"
77771
77802
  };
77772
77803
  function mcpServersIn(file2) {
77773
- const servers = obj2(obj2(JSON.parse(fs22.readFileSync(file2, "utf8"))).mcpServers);
77804
+ const servers = obj2(obj2(JSON.parse(fs23.readFileSync(file2, "utf8"))).mcpServers);
77774
77805
  return Object.entries(servers).map(([name, raw]) => {
77775
77806
  const s = obj2(raw);
77776
77807
  return {
@@ -77973,7 +78004,7 @@ function decide(params, tail, events) {
77973
78004
  }
77974
78005
 
77975
78006
  // ../cli/src/lib/agent/wire/zcode.ts
77976
- import path24 from "node:path";
78007
+ import path25 from "node:path";
77977
78008
  function whereHint2(input, title) {
77978
78009
  const named = obj2(input);
77979
78010
  for (const key of ["command", "file_path", "path", "url", "pattern"]) {
@@ -78139,7 +78170,7 @@ async function oneTurn2(io, options) {
78139
78170
  { stringIds: true }
78140
78171
  );
78141
78172
  try {
78142
- const workspacePath = path24.resolve(io.cwd);
78173
+ const workspacePath = path25.resolve(io.cwd);
78143
78174
  const workspace = { workspacePath, workspaceKey: workspacePath };
78144
78175
  let opened;
78145
78176
  if (io.resumeId) {
@@ -78370,7 +78401,7 @@ async function run(io, options, tasks2) {
78370
78401
  if (failure4) io.event?.({ kind: "error", data: { text: failure4 } });
78371
78402
  resolve2({ ok: !failure4, error: failure4, result: renderer.result(), replyParts: renderer.replyParts?.(), usage: combinedUsage, context, costUsd, costIncomplete: child.costIncomplete || cost === void 0 && child.costUsd !== void 0 || void 0 });
78372
78403
  };
78373
- const closed = () => end("Codex closed the connection before all work and results finished.");
78404
+ const closed = () => end("Codex connection closed before all work and results finished.");
78374
78405
  io.stdout.once("close", closed);
78375
78406
  const update3 = (id, state2, title = "") => {
78376
78407
  if (ended) return;
@@ -78671,15 +78702,15 @@ var userMessage = (prompt) => `${JSON.stringify({ type: "user", message: { role:
78671
78702
  `;
78672
78703
  function claudeOnWindows() {
78673
78704
  const [local, roaming] = [process.env.LOCALAPPDATA?.trim(), process.env.APPDATA?.trim()];
78674
- const packages = local ? path25.join(local, "Packages") : "";
78705
+ const packages = local ? path26.join(local, "Packages") : "";
78675
78706
  const data = [
78676
- ...folders(packages).filter((name) => /^(\w+\.)?Claude_/i.test(name)).sort().map((name) => path25.join(packages, name, "LocalCache", "Roaming", "Claude")),
78677
- ...roaming ? [path25.join(roaming, "Claude")] : []
78707
+ ...folders(packages).filter((name) => /^(\w+\.)?Claude_/i.test(name)).sort().map((name) => path26.join(packages, name, "LocalCache", "Roaming", "Claude")),
78708
+ ...roaming ? [path26.join(roaming, "Claude")] : []
78678
78709
  ];
78679
78710
  return data.flatMap(
78680
- (dir) => latestIn(path25.join(dir, "claude-code")).flatMap((version2) => [
78681
- path25.join(version2, "claude.exe"),
78682
- ...folders(version2).map((build) => path25.join(version2, build, "claude.exe"))
78711
+ (dir) => latestIn(path26.join(dir, "claude-code")).flatMap((version2) => [
78712
+ path26.join(version2, "claude.exe"),
78713
+ ...folders(version2).map((build) => path26.join(version2, build, "claude.exe"))
78683
78714
  ])
78684
78715
  );
78685
78716
  }
@@ -78937,15 +78968,15 @@ var CLAUDE_CODE = {
78937
78968
  ...latestIn(home(".local", "share", "claude", "versions")),
78938
78969
  // The copy Claude Desktop carries.
78939
78970
  ...process.platform === "win32" ? claudeOnWindows() : latestIn(home("Library", "Application Support", "Claude", "claude-code")).flatMap(
78940
- (version2) => folders(version2).map((build) => path25.join(version2, build, "claude.app", "Contents", "MacOS", "claude"))
78971
+ (version2) => folders(version2).map((build) => path26.join(version2, build, "claude.app", "Contents", "MacOS", "claude"))
78941
78972
  )
78942
78973
  ],
78943
78974
  install: "npm install -g @anthropic-ai/claude-code"
78944
78975
  };
78945
78976
 
78946
78977
  // ../cli/src/lib/agent/harnesses/codex.ts
78947
- import fs23 from "node:fs";
78948
- import path26 from "node:path";
78978
+ import fs24 from "node:fs";
78979
+ import path27 from "node:path";
78949
78980
 
78950
78981
  // ../cli/src/lib/agent/worktree.ts
78951
78982
  import { spawnSync as spawnSync3 } from "node:child_process";
@@ -78992,10 +79023,10 @@ function codexExtraArgs(argv, cwd = REPO_ROOT) {
78992
79023
  }
78993
79024
  const flags = [...argv, ...extra];
78994
79025
  const workspaceWrite = flags.some((arg, i) => arg === "--full-auto" || arg === "--sandbox=workspace-write" || (arg === "--sandbox" || arg === "-s") && flags[i + 1] === "workspace-write");
78995
- if (workspaceWrite && path26.resolve(cwd) !== path26.resolve(REPO_ROOT)) {
79026
+ if (workspaceWrite && path27.resolve(cwd) !== path27.resolve(REPO_ROOT)) {
78996
79027
  for (const dir of [KANBAN, AKB_DIR]) {
78997
- const relative = path26.relative(cwd, dir);
78998
- if (relative === ".." || relative.startsWith(`..${path26.sep}`) || path26.isAbsolute(relative)) {
79028
+ const relative = path27.relative(cwd, dir);
79029
+ if (relative === ".." || relative.startsWith(`..${path27.sep}`) || path27.isAbsolute(relative)) {
78999
79030
  extra.push("--add-dir", dir);
79000
79031
  }
79001
79032
  }
@@ -79018,7 +79049,7 @@ function envRoot(name) {
79018
79049
  }
79019
79050
  function modified(file2) {
79020
79051
  try {
79021
- return fs23.statSync(file2).mtimeMs;
79052
+ return fs24.statSync(file2).mtimeMs;
79022
79053
  } catch {
79023
79054
  return 0;
79024
79055
  }
@@ -79044,28 +79075,28 @@ function codexOnWindows() {
79044
79075
  const local = envRoot("LOCALAPPDATA");
79045
79076
  const profile = envRoot("USERPROFILE");
79046
79077
  const programs = envRoot("ProgramFiles");
79047
- const cache = local ? path26.join(local, "OpenAI", "Codex", "bin") : "";
79048
- const releases = profile ? path26.join(profile, ".codex", "packages", "standalone", "releases") : "";
79049
- const packages = programs ? path26.join(programs, "WindowsApps") : "";
79078
+ const cache = local ? path27.join(local, "OpenAI", "Codex", "bin") : "";
79079
+ const releases = profile ? path27.join(profile, ".codex", "packages", "standalone", "releases") : "";
79080
+ const packages = programs ? path27.join(programs, "WindowsApps") : "";
79050
79081
  return [
79051
79082
  // Desktop's relocated CLI cache: a folder per build hash, newest file first.
79052
- ...byNewest(folders(cache).map((name) => path26.join(cache, name, "codex.exe"))),
79083
+ ...byNewest(folders(cache).map((name) => path27.join(cache, name, "codex.exe"))),
79053
79084
  // The separate standalone launcher, at a path with nothing variable in it.
79054
- ...local ? [path26.join(local, "Programs", "OpenAI", "Codex", "bin", "codex.exe")] : [],
79085
+ ...local ? [path27.join(local, "Programs", "OpenAI", "Codex", "bin", "codex.exe")] : [],
79055
79086
  // That launcher's release payload: a folder per version and target.
79056
79087
  ...byVersion(folders(releases).filter(ourArch)).map(
79057
- (name) => path26.join(releases, name, "bin", "codex.exe")
79088
+ (name) => path27.join(releases, name, "bin", "codex.exe")
79058
79089
  ),
79059
79090
  // Desktop's own MSIX package.
79060
79091
  ...byVersion(folders(packages).filter((name) => name.startsWith("OpenAI.Codex_")).filter(ourArch)).map(
79061
- (name) => path26.join(packages, name, "app", "resources", "codex.exe")
79092
+ (name) => path27.join(packages, name, "app", "resources", "codex.exe")
79062
79093
  )
79063
79094
  ];
79064
79095
  }
79065
79096
  function codexInstalls() {
79066
79097
  const chosen = process.env.CODEX_INSTALL_DIR?.trim();
79067
79098
  return [
79068
- ...chosen ? [path26.join(chosen, "codex")] : [],
79099
+ ...chosen ? [path27.join(chosen, "codex")] : [],
79069
79100
  ...process.platform === "win32" ? codexOnWindows() : [
79070
79101
  // macOS, where Codex now lives in the merged app — `codex-cli/bin/` since 26.928…
79071
79102
  "/Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex",
@@ -79111,7 +79142,7 @@ var CODEX = {
79111
79142
  systemPrompt(text4, argv) {
79112
79143
  if (namesFlag(argv, ["developer_instructions", "model_instructions_file"])) return {};
79113
79144
  try {
79114
- const config2 = fs23.readFileSync(path26.join(process.env.CODEX_HOME || home(".codex"), "config.toml"), "utf8");
79145
+ const config2 = fs24.readFileSync(path27.join(process.env.CODEX_HOME || home(".codex"), "config.toml"), "utf8");
79115
79146
  if (/^\s*(?:developer_instructions|model_instructions_file)\s*=/m.test(config2)) return {};
79116
79147
  } catch {
79117
79148
  }
@@ -79357,24 +79388,24 @@ var CURSOR = {
79357
79388
  };
79358
79389
 
79359
79390
  // ../cli/src/lib/agent/harnesses/dsh.ts
79360
- import fs24 from "node:fs";
79361
- import path27 from "node:path";
79391
+ import fs25 from "node:fs";
79392
+ import path28 from "node:path";
79362
79393
  function dshHome(argv) {
79363
79394
  const binary = argv[0];
79364
79395
  if (!binary) return void 0;
79365
- const names2 = process.platform === "win32" && !path27.extname(binary) ? [".exe", ".cmd"].map((ext) => binary + ext) : [binary];
79366
- const candidates2 = binary.includes("/") || binary.includes("\\") ? names2 : (process.env.PATH ?? "").split(path27.delimiter).filter(Boolean).flatMap((dir2) => names2.map((name) => path27.join(dir2, name)));
79396
+ const names2 = process.platform === "win32" && !path28.extname(binary) ? [".exe", ".cmd"].map((ext) => binary + ext) : [binary];
79397
+ const candidates2 = binary.includes("/") || binary.includes("\\") ? names2 : (process.env.PATH ?? "").split(path28.delimiter).filter(Boolean).flatMap((dir2) => names2.map((name) => path28.join(dir2, name)));
79367
79398
  let dir;
79368
79399
  try {
79369
- const found = candidates2.find((candidate) => fs24.existsSync(candidate));
79400
+ const found = candidates2.find((candidate) => fs25.existsSync(candidate));
79370
79401
  if (!found) return void 0;
79371
- const script = /\.cmd$/i.test(found) ? shimTarget(fs24.readFileSync(found, "utf8"), found)?.script : void 0;
79372
- dir = path27.dirname(fs24.realpathSync(script ?? found));
79402
+ const script = /\.cmd$/i.test(found) ? shimTarget(fs25.readFileSync(found, "utf8"), found)?.script : void 0;
79403
+ dir = path28.dirname(fs25.realpathSync(script ?? found));
79373
79404
  } catch {
79374
79405
  return void 0;
79375
79406
  }
79376
- for (let up = path27.dirname(dir); dir !== up; up = path27.dirname(dir)) {
79377
- if (fs24.existsSync(path27.join(dir, "package.json"))) return dir;
79407
+ for (let up = path28.dirname(dir); dir !== up; up = path28.dirname(dir)) {
79408
+ if (fs25.existsSync(path28.join(dir, "package.json"))) return dir;
79378
79409
  dir = up;
79379
79410
  }
79380
79411
  return void 0;
@@ -80023,14 +80054,14 @@ var listed = (harness) => async () => (harness.models?.() ?? []).map((id) => ({
80023
80054
  var readModels = (name) => (MODELS[name] ?? listed(HARNESSES2[name]))().catch(() => []);
80024
80055
  var MODELS = {
80025
80056
  "claude-code": async () => {
80026
- const cached3 = claudeModels(path28.join(process.env.CLAUDE_CONFIG_DIR || path28.join(os7.homedir(), ".claude"), "cache", "model-catalog"));
80057
+ const cached3 = claudeModels(path29.join(process.env.CLAUDE_CONFIG_DIR || path29.join(os7.homedir(), ".claude"), "cache", "model-catalog"));
80027
80058
  return cached3.length ? cached3 : [
80028
80059
  { id: "opus", name: "Opus" },
80029
80060
  { id: "sonnet", name: "Sonnet" },
80030
80061
  { id: "haiku", name: "Haiku" }
80031
80062
  ];
80032
80063
  },
80033
- codex: async () => codexModels(path28.join(process.env.CODEX_HOME || path28.join(os7.homedir(), ".codex"), "models_cache.json")),
80064
+ codex: async () => codexModels(path29.join(process.env.CODEX_HOME || path29.join(os7.homedir(), ".codex"), "models_cache.json")),
80034
80065
  opencode: async () => opencodeModels(await output(commandOf(HARNESSES2.opencode)[0], ["models"])),
80035
80066
  cursor: () => cursorModels(),
80036
80067
  antigravity: async () => antigravityModels(await output(commandOf(HARNESSES2.antigravity)[0], ["models"]))
@@ -80090,7 +80121,7 @@ function output(command, args2) {
80090
80121
  }
80091
80122
  function codexModels(file2) {
80092
80123
  try {
80093
- const cache = JSON.parse(fs25.readFileSync(file2, "utf8"));
80124
+ const cache = JSON.parse(fs26.readFileSync(file2, "utf8"));
80094
80125
  if (!Array.isArray(cache.models)) return [];
80095
80126
  return cache.models.flatMap(
80096
80127
  (m) => m.visibility === "list" && typeof m.slug === "string" && m.slug ? [{ id: m.slug, name: typeof m.display_name === "string" && m.display_name ? m.display_name : m.slug }] : []
@@ -80102,13 +80133,13 @@ function codexModels(file2) {
80102
80133
  function claudeModels(dir) {
80103
80134
  let files;
80104
80135
  try {
80105
- files = fs25.readdirSync(dir).filter((f) => f.endsWith(".json"));
80136
+ files = fs26.readdirSync(dir).filter((f) => f.endsWith(".json"));
80106
80137
  } catch {
80107
80138
  return [];
80108
80139
  }
80109
80140
  const catalogs = files.flatMap((f) => {
80110
80141
  try {
80111
- const data = obj2(JSON.parse(fs25.readFileSync(path28.join(dir, f), "utf8")));
80142
+ const data = obj2(JSON.parse(fs26.readFileSync(path29.join(dir, f), "utf8")));
80112
80143
  const catalog = obj2(data.catalog);
80113
80144
  const surface = str3(catalog.surface);
80114
80145
  return surface === "cc" || surface === "ccd" ? [{ surface, at: Number(data.fetchedAt) || 0, config: obj2(catalog.config) }] : [];
@@ -80160,8 +80191,8 @@ import path32 from "node:path";
80160
80191
 
80161
80192
  // src/kanban-skill.ts
80162
80193
  import { spawnSync as spawnSync4 } from "node:child_process";
80163
- import fs26 from "node:fs";
80164
- import path29 from "node:path";
80194
+ import fs27 from "node:fs";
80195
+ import path30 from "node:path";
80165
80196
 
80166
80197
  // ../skill/SKILL.md
80167
80198
  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 raw 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 raw agent set apiKey`.\n';
@@ -80175,24 +80206,24 @@ var CONTENT = `${SKILL_default.trimEnd()}
80175
80206
  var MANAGED = /^<!-- ai4kanban \S+ -->$/m;
80176
80207
  function prepareKanbanSkill(root2) {
80177
80208
  for (const folder of SKILL_FOLDERS) {
80178
- const dir = path29.join(root2, folder);
80179
- const file2 = path29.join(dir, "SKILL.md");
80209
+ const dir = path30.join(root2, folder);
80210
+ const file2 = path30.join(dir, "SKILL.md");
80180
80211
  try {
80181
80212
  let linked2 = false;
80182
80213
  let at = root2;
80183
80214
  for (const name of `${folder}/SKILL.md`.split("/")) {
80184
- at = path29.join(at, name);
80185
- if (fs26.lstatSync(at, { throwIfNoEntry: false })?.isSymbolicLink()) linked2 = true;
80215
+ at = path30.join(at, name);
80216
+ if (fs27.lstatSync(at, { throwIfNoEntry: false })?.isSymbolicLink()) linked2 = true;
80186
80217
  }
80187
- const held2 = fs26.existsSync(file2) ? fs26.readFileSync(file2, "utf8") : null;
80188
- const exists = fs26.lstatSync(dir, { throwIfNoEntry: false }) !== void 0;
80218
+ const held2 = fs27.existsSync(file2) ? fs27.readFileSync(file2, "utf8") : null;
80219
+ const exists = fs27.lstatSync(dir, { throwIfNoEntry: false }) !== void 0;
80189
80220
  if (linked2 || exists && !MANAGED.test(held2 ?? "")) {
80190
80221
  if (!held2?.trim()) throw new Error("\u7528\u6237\u81EA\u6709\u76EE\u5F55\u6216\u7B26\u53F7\u94FE\u63A5\u4E2D\u7F3A\u5C11\u53EF\u8BFB\u7684 SKILL.md");
80191
80222
  continue;
80192
80223
  }
80193
80224
  if (held2 !== CONTENT) {
80194
- fs26.mkdirSync(dir, { recursive: true });
80195
- fs26.writeFileSync(file2, CONTENT);
80225
+ fs27.mkdirSync(dir, { recursive: true });
80226
+ fs27.writeFileSync(file2, CONTENT);
80196
80227
  }
80197
80228
  } catch (e) {
80198
80229
  throw new Error(`\u65E0\u6CD5\u51C6\u5907 ${folder}\uFF1A${e instanceof Error ? e.message : String(e)}`);
@@ -80205,10 +80236,10 @@ function keepOutOfGit(dir, folders2 = SKILL_FOLDERS) {
80205
80236
  if (inside.status !== 0) return;
80206
80237
  const missing = [".akb/", ...folders2.map((f) => `${f}/`)].filter((p) => git2("check-ignore", "-q", p).status !== 0);
80207
80238
  if (!missing.length) return;
80208
- const exclude = path29.resolve(dir, inside.stdout.trim());
80209
- fs26.mkdirSync(path29.dirname(exclude), { recursive: true });
80210
- const held2 = fs26.existsSync(exclude) ? fs26.readFileSync(exclude, "utf8") : "";
80211
- fs26.writeFileSync(exclude, `${held2}${held2 && !held2.endsWith("\n") ? "\n" : ""}${missing.join("\n")}
80239
+ const exclude = path30.resolve(dir, inside.stdout.trim());
80240
+ fs27.mkdirSync(path30.dirname(exclude), { recursive: true });
80241
+ const held2 = fs27.existsSync(exclude) ? fs27.readFileSync(exclude, "utf8") : "";
80242
+ fs27.writeFileSync(exclude, `${held2}${held2 && !held2.endsWith("\n") ? "\n" : ""}${missing.join("\n")}
80212
80243
  `);
80213
80244
  }
80214
80245
  function installKanbanSkill(dir) {
@@ -80224,11 +80255,11 @@ function installKanbanSkill(dir) {
80224
80255
  // src/lock.ts
80225
80256
  import crypto6 from "node:crypto";
80226
80257
  import net from "node:net";
80227
- import path30 from "node:path";
80258
+ import path31 from "node:path";
80228
80259
  function lockPath() {
80229
80260
  const home4 = runnerHome();
80230
80261
  if (process.platform === "win32") return `\\\\.\\pipe\\wildcrane-${crypto6.createHash("sha256").update(home4).digest("hex").slice(0, 16)}`;
80231
- return path30.join(home4, "runner.sock");
80262
+ return path31.join(home4, "runner.sock");
80232
80263
  }
80233
80264
  function runnerSettingsSupport() {
80234
80265
  return new Promise((resolve2) => {
@@ -80260,39 +80291,6 @@ function runnerSettingsSupport() {
80260
80291
  import { spawn as spawn4 } from "node:child_process";
80261
80292
  import crypto7 from "node:crypto";
80262
80293
  import http from "node:http";
80263
-
80264
- // src/settings-control.ts
80265
- import fs27 from "node:fs";
80266
- import path31 from "node:path";
80267
- var directory = () => path31.join(runnerHome(), "executors");
80268
- var epochFile = () => path31.join(runnerHome(), "account-generation");
80269
- function accountGeneration() {
80270
- try {
80271
- return fs27.readFileSync(epochFile(), "utf8");
80272
- } catch {
80273
- return "";
80274
- }
80275
- }
80276
- async function stopExecutors() {
80277
- fs27.mkdirSync(runnerHome(), { recursive: true, mode: 448 });
80278
- fs27.writeFileSync(epochFile(), `${Date.now()}-${process.pid}`, { mode: 384 });
80279
- for (let n = 0; n < 160; n++) {
80280
- const active = fs27.existsSync(directory()) ? fs27.readdirSync(directory()).filter((name) => {
80281
- try {
80282
- process.kill(Number(name.split(".")[0]), 0);
80283
- return true;
80284
- } catch {
80285
- fs27.rmSync(path31.join(directory(), name), { force: true });
80286
- return false;
80287
- }
80288
- }) : [];
80289
- if (!active.length) return true;
80290
- await new Promise((resolve2) => setTimeout(resolve2, 100));
80291
- }
80292
- return false;
80293
- }
80294
-
80295
- // src/signin.ts
80296
80294
  var WAIT_MS = 10 * 60 * 1e3;
80297
80295
  var CRANE = "M2 55.75C2 55.69 2.69 55.09 3.55 54.37L5.09 53.1L6.61 53.1L8.13 53.1L12.49 49.87C14.9 48.07 16.83 46.58 16.77 46.53C16.75 46.47 15.56 46.64 14.15 46.89C12.74 47.13 11.55 47.3 11.53 47.24C11.47 47.19 12.02 46.22 12.71 45.06L14.01 42.96L18.21 41.34C20.53 40.45 22.41 39.65 22.41 39.57C22.41 39.49 21.27 38.55 19.92 37.5C15.92 34.4 13.13 31.31 10.86 27.47L10.01 26.01L10.53 26.18C10.84 26.26 12.96 27.2 15.28 28.25C17.6 29.32 19.53 30.12 19.59 30.07C19.64 30.01 17.68 28.69 15.25 27.11C12.8 25.57 10.56 23.97 10.31 23.58C9.15 21.95 7.25 17.5 7.25 16.46C7.25 16.26 10.01 17.95 13.38 20.18C16.77 22.45 19.73 24.38 19.95 24.49C20.42 24.74 20.25 24.57 13.9 19.02L9.18 14.88L8.6 13.36C7.72 10.96 6.97 7.54 6.97 5.77L6.97 4.14L9.4 6.46C12.66 9.61 15.56 12.01 23.57 18.25C27.32 21.18 30.5 23.72 30.64 23.91C30.8 24.08 31.68 26.51 32.6 29.3L34.28 34.35L35.72 35.65C37.54 37.3 37.98 37.47 36.85 36.09L35.96 35.01L37.12 34.71C39.11 34.21 40.16 33.52 42.54 31.12L44.8 28.8L46.02 28.96C46.71 29.07 47.56 29.07 47.95 28.96L48.67 28.8L48.67 28.25L48.67 27.69L49.27 27.69C49.63 27.69 50.1 27.58 50.32 27.42L50.71 27.17L51.01 27.42C51.18 27.56 52.78 27.86 54.58 28.08C56.37 28.3 57.86 28.52 57.94 28.58C58 28.63 56.73 28.85 55.13 29.05C53.53 29.24 50.96 29.77 49.44 30.21C47.92 30.65 46.57 31.01 46.43 31.01C46.29 31.01 44.22 32.97 41.85 35.37C37.57 39.62 34.42 42.14 30.83 44.15L29.14 45.09L25.97 45.73L22.77 46.39L14.59 51.11L6.42 55.86L4.21 55.86C2.99 55.86 2 55.8 2 55.75Z";
80298
80296
  var CREST = "M44.97 27.45C44.61 26.89 46.57 25.76 47.87 25.76C48.72 25.76 50.6 26.7 50.6 27.14C50.6 27.64 45.27 27.97 44.97 27.45Z";