wildcrane-runner 0.6.86 → 0.6.87

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.86 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.87 — 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;
@@ -11867,9 +11867,9 @@ var require_schemas = __commonJS({
11867
11867
  return own3;
11868
11868
  }
11869
11869
  if (def.options) {
11870
- const sources2 = def.options.map(partPattern);
11871
- if (sources2.every(Boolean))
11872
- return `^(${sources2.map((s) => util2.cleanRegex(s)).join("|")})$`;
11870
+ const sources3 = def.options.map(partPattern);
11871
+ if (sources3.every(Boolean))
11872
+ return `^(${sources3.map((s) => util2.cleanRegex(s)).join("|")})$`;
11873
11873
  }
11874
11874
  return leafPattern(schema);
11875
11875
  }
@@ -25396,8 +25396,8 @@ var require_to_json_schema = __commonJS({
25396
25396
  exports.finalize = finalize2;
25397
25397
  var registries_js_1 = require_registries();
25398
25398
  var util_js_1 = require_util2();
25399
- function assignProps2(target, ...sources2) {
25400
- for (const source of sources2) {
25399
+ function assignProps2(target, ...sources3) {
25400
+ for (const source of sources3) {
25401
25401
  for (const key of Reflect.ownKeys(source)) {
25402
25402
  if (Object.prototype.propertyIsEnumerable.call(source, key)) {
25403
25403
  (0, util_js_1.assignProp)(target, key, source[key]);
@@ -65378,8 +65378,8 @@ function _check(fn, params) {
65378
65378
  }
65379
65379
 
65380
65380
  // node_modules/zod/v4/core/to-json-schema.js
65381
- function assignProps(target, ...sources2) {
65382
- for (const source of sources2) {
65381
+ function assignProps(target, ...sources3) {
65382
+ for (const source of sources3) {
65383
65383
  for (const key of Reflect.ownKeys(source)) {
65384
65384
  if (Object.prototype.propertyIsEnumerable.call(source, key)) {
65385
65385
  assignProp(target, key, source[key]);
@@ -73849,8 +73849,8 @@ function machineId() {
73849
73849
  var machineName = () => os3.hostname().replace(/\.local$/, "");
73850
73850
 
73851
73851
  // src/protocol.ts
73852
- var VERSION = true ? "0.6.86" : "0.0.0";
73853
- var AKB_VERSION = true ? "0.11.69" : "0.0.0";
73852
+ var VERSION = true ? "0.6.87" : "0.0.0";
73853
+ var AKB_VERSION = true ? "0.11.70" : "0.0.0";
73854
73854
  var EXIT_REFUSED = 10;
73855
73855
  var EXIT_OUTDATED = 11;
73856
73856
  var EXIT_UPDATE = 12;
@@ -74786,7 +74786,6 @@ import path10 from "node:path";
74786
74786
  var STUDIO_FILE = "STUDIO.md";
74787
74787
  var MCP_FILE = "mcp.json";
74788
74788
  var CARD_TEMPLATE_FILE = "CARD.md";
74789
- var SHARED_DIR = "shared/";
74790
74789
  var VERSION_FILE = "version.json";
74791
74790
  var KB = 1024;
74792
74791
  var FILE_LIMITS = { file: 2 * KB * KB, total: 2 * KB * KB, count: 500, path: 512 };
@@ -74931,32 +74930,12 @@ var OFFICIAL = path11.dirname(fileURLToPath2(import.meta.url));
74931
74930
  var dirs = (dir) => fs9.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
74932
74931
  var hashOf = (files) => crypto2.createHash("sha256").update(hashInput(files)).digest("hex");
74933
74932
  function packOfficial(root2 = OFFICIAL, loose = false) {
74934
- const agentsDir = path11.join(root2, "agents");
74935
- const agentFiles = Object.fromEntries(dirs(agentsDir).map((name) => {
74936
- const dir = path11.join(agentsDir, name);
74937
- return [name, readStudioFolder(dir)];
74938
- }));
74939
- for (const [name, own3] of Object.entries(loose ? {} : agentFiles)) {
74940
- const read2 = parseSpecAgent(own3["AGENT.md"] ?? "", `official/agents/${name}/AGENT.md`, (p) => own3[p] ?? null, true);
74941
- if ("problem" in read2) throw new Error(read2.problem);
74942
- }
74943
74933
  const studiosDir = path11.join(root2, "studios");
74944
74934
  return dirs(studiosDir).map((folder) => {
74945
- const dir = path11.join(studiosDir, folder);
74946
- const files = {};
74947
- for (const f of filesOf(dir).sort()) {
74948
- 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);
74949
- }
74950
- const read2 = checkStudioFiles({ [STUDIO_FILE]: files[STUDIO_FILE], ...Object.fromEntries(
74951
- Object.entries(agentFiles).flatMap(([name, own3]) => Object.entries(own3).map(([f, t2]) => [`agents/${name}/${f}`, t2]))
74952
- ) });
74953
- if (!read2.ok && !loose) throw new Error(`official/studios/${folder}: ${read2.file}: ${read2.reason}`);
74935
+ const files = readStudioFolder(path11.join(studiosDir, folder));
74954
74936
  const parsed = parseStudioFile(folder, files[STUDIO_FILE] ?? "", STUDIO_FILE);
74955
74937
  if ("problem" in parsed) throw new Error(parsed.problem);
74956
74938
  const def = parsed.def;
74957
- for (const name of [...new Set([...def.previews, ...def.land, ...def.scheduled].map((h) => h.agent))].sort()) {
74958
- for (const [f, text4] of Object.entries(agentFiles[name] ?? {})) files[`agents/${name}/${f}`] = text4;
74959
- }
74960
74939
  const checked = loose ? { ok: true } : checkStudioFiles(files, true);
74961
74940
  if (!checked.ok) throw new Error(`official/studios/${folder}: ${checked.file}: ${checked.reason}`);
74962
74941
  if (!def.names?.zh && !loose) throw new Error(`official/studios/${folder}/${STUDIO_FILE}: add its Chinese name under \`names: zh\``);
@@ -76152,8 +76131,7 @@ function modelsIn(file2, pick3, salt = "") {
76152
76131
  const stat = statSync(file2);
76153
76132
  stamp2 = `${stat.mtimeMs}:${stat.size}:${salt}`;
76154
76133
  } catch {
76155
- cached2.delete(file2);
76156
- return [];
76134
+ return cached2.get(file2)?.found ?? [];
76157
76135
  }
76158
76136
  const hit = cached2.get(file2);
76159
76137
  if (hit?.stamp === stamp2) return hit.found;
@@ -76163,8 +76141,8 @@ function modelsIn(file2, pick3, salt = "") {
76163
76141
  } catch {
76164
76142
  found = [];
76165
76143
  }
76166
- cached2.set(file2, { stamp: stamp2, found });
76167
- return found;
76144
+ if (found.length) cached2.set(file2, { stamp: stamp2, found });
76145
+ return found.length ? found : hit?.found ?? [];
76168
76146
  }
76169
76147
 
76170
76148
  // ../cli/src/lib/agent/harnesses/types.ts
@@ -76539,11 +76517,21 @@ function createAntigravityRenderer(expectedSession) {
76539
76517
  }
76540
76518
 
76541
76519
  // ../cli/src/lib/agent/harnesses/antigravity.ts
76520
+ var EFFORT_ID = /-(?:low|medium|high|xhigh|max)$/i;
76521
+ var EFFORT_NAME = /\s*\((?:low|medium|high|xhigh|max)\)$/i;
76542
76522
  function antigravityModels(output2) {
76543
- return output2.split("\n").flatMap((line) => {
76523
+ const seen = /* @__PURE__ */ new Set();
76524
+ const models = [];
76525
+ for (const line of output2.split("\n")) {
76544
76526
  const match = /^([^\s]+)\t(.+)$/.exec(line.trim());
76545
- return match ? [{ id: match[1], name: match[2] }] : [];
76546
- });
76527
+ if (!match) continue;
76528
+ const id = match[1].replace(EFFORT_ID, "");
76529
+ const name = match[2].replace(EFFORT_NAME, "").trim();
76530
+ if (seen.has(id)) continue;
76531
+ seen.add(id);
76532
+ models.push({ id, name });
76533
+ }
76534
+ return models;
76547
76535
  }
76548
76536
  function args(argv, resume) {
76549
76537
  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.");
@@ -76570,6 +76558,22 @@ var ANTIGRAVITY = {
76570
76558
  flags: ["--model"],
76571
76559
  placeholder: "model-id",
76572
76560
  help: "A model from agy models. Empty uses the CLI default; an invalid model fails the run."
76561
+ }, {
76562
+ key: "reasoning",
76563
+ agentOwned: true,
76564
+ label: "Reasoning effort",
76565
+ kind: "select",
76566
+ choices: [
76567
+ { value: "", label: "Agent's default" },
76568
+ { value: "low", label: "Low" },
76569
+ { value: "medium", label: "Medium" },
76570
+ { value: "high", label: "High" },
76571
+ { value: "xhigh", label: "Extra high (xhigh)" },
76572
+ { value: "max", label: "Max" }
76573
+ ],
76574
+ flags: ["--effort"],
76575
+ help: "Lower is quicker and cheaper, higher is slower and more careful.",
76576
+ overriddenHelp: `Not in effect: this agent's "command" in your ui.config.json already names an effort level, and that wins.`
76573
76577
  }],
76574
76578
  models() {
76575
76579
  const copy2 = locate(ANTIGRAVITY);
@@ -77722,7 +77726,7 @@ function createTail(log) {
77722
77726
  // ../cli/package.json
77723
77727
  var package_default = {
77724
77728
  name: "wildcrane",
77725
- version: "0.11.69",
77729
+ version: "0.11.70",
77726
77730
  akbContract: 17,
77727
77731
  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.",
77728
77732
  keywords: [
@@ -77979,9 +77983,9 @@ async function oneTurn(io, options) {
77979
77983
  }
77980
77984
  let model = modelOf(opened);
77981
77985
  if (options.model) {
77982
- const listed2 = obj(opened.models).currentModelId !== void 0;
77983
- const picked = listed2 ? pickedModel(opened, options.model) : void 0;
77984
- const set = listed2 ? await bounded(rpc.call("session/set_model", { sessionId, modelId: picked?.modelId ?? options.model }), preparingUntil - Date.now(), "ACP session/set_model timed out.") : await bounded(rpc.call("session/set_config_option", { sessionId, configId: "model", value: options.model }), preparingUntil - Date.now(), "ACP session/set_config_option timed out.");
77986
+ const listed = obj(opened.models).currentModelId !== void 0;
77987
+ const picked = listed ? pickedModel(opened, options.model) : void 0;
77988
+ const set = listed ? await bounded(rpc.call("session/set_model", { sessionId, modelId: picked?.modelId ?? options.model }), preparingUntil - Date.now(), "ACP session/set_model timed out.") : await bounded(rpc.call("session/set_config_option", { sessionId, configId: "model", value: options.model }), preparingUntil - Date.now(), "ACP session/set_config_option timed out.");
77985
77989
  model = picked?.name ?? modelOf(set) ?? options.model;
77986
77990
  }
77987
77991
  if (model) io.gotModel(model);
@@ -80350,10 +80354,77 @@ var HARNESSES = [CLAUDE_CODE, CODEX, CURSOR, OPENCODE, KIMI, DSH, ZCODE, GROK, A
80350
80354
  var DEFAULT_HARNESS = HARNESSES[0];
80351
80355
  checkHarnesses(HARNESSES);
80352
80356
 
80357
+ // src/model-list.ts
80358
+ var MODEL_REFRESH_MS = 3e4;
80359
+ var MODEL_TIMEOUT_MS = 15e3;
80360
+ var ModelLists = class {
80361
+ constructor(sources3, interval = MODEL_REFRESH_MS, timeout = MODEL_TIMEOUT_MS) {
80362
+ this.sources = sources3;
80363
+ this.interval = interval;
80364
+ this.timeout = timeout;
80365
+ }
80366
+ sources;
80367
+ interval;
80368
+ timeout;
80369
+ listeners = /* @__PURE__ */ new Set();
80370
+ subscribe(listener) {
80371
+ this.listeners.add(listener);
80372
+ return () => {
80373
+ this.listeners.delete(listener);
80374
+ };
80375
+ }
80376
+ entries = /* @__PURE__ */ new Map();
80377
+ async read(key, previous = [], wait = false) {
80378
+ const source = this.sources[key];
80379
+ if (!source) return previous;
80380
+ let entry = this.entries.get(key);
80381
+ if (!entry) {
80382
+ entry = { models: normalizeModels(previous), next: 0 };
80383
+ this.entries.set(key, entry);
80384
+ }
80385
+ if (!entry.models.length && previous.length) entry.models = normalizeModels(previous);
80386
+ if (!entry.pending && Date.now() >= entry.next) {
80387
+ const held2 = entry;
80388
+ const controller = new AbortController();
80389
+ held2.next = Date.now() + this.interval;
80390
+ let changed = false;
80391
+ held2.pending = new Promise((resolve2) => {
80392
+ let done = false;
80393
+ const finish = (models) => {
80394
+ if (done) return;
80395
+ done = true;
80396
+ clearTimeout(timer);
80397
+ controller.abort();
80398
+ const found = normalizeModels(models);
80399
+ if (found.length) {
80400
+ changed = JSON.stringify(found) !== JSON.stringify(held2.models);
80401
+ held2.models = found;
80402
+ }
80403
+ resolve2(held2.models);
80404
+ };
80405
+ const timer = setTimeout(() => finish([]), this.timeout);
80406
+ Promise.resolve().then(() => source(controller.signal)).then(finish, () => finish([]));
80407
+ }).finally(() => {
80408
+ held2.pending = void 0;
80409
+ if (changed) for (const listener of this.listeners) listener();
80410
+ });
80411
+ }
80412
+ return wait && entry.pending ? entry.pending : entry.models;
80413
+ }
80414
+ };
80415
+ function normalizeModels(models) {
80416
+ const seen = /* @__PURE__ */ new Set();
80417
+ return models.flatMap((model) => {
80418
+ const id = model.id.trim();
80419
+ if (!id || seen.has(id)) return [];
80420
+ seen.add(id);
80421
+ return [{ id, name: model.name.trim() || id }];
80422
+ });
80423
+ }
80424
+
80353
80425
  // src/runtimes.ts
80354
80426
  var HARNESSES2 = Object.fromEntries(RUNTIMES.map((name) => [name, HARNESSES.find((h) => h.name === name)]));
80355
80427
  var LOGIN_PROBE_MS = 5e3;
80356
- var MODELS_MS = 3e4;
80357
80428
  var LABELS = Object.fromEntries(RUNTIMES.map((name) => [name, HARNESSES2[name].label]));
80358
80429
  var hints = (runtime) => ({ login: HARNESSES2[runtime].login?.login });
80359
80430
  function commandOf(harness) {
@@ -80381,33 +80452,30 @@ async function detectRuntimes(quick = false, only) {
80381
80452
  const copy2 = locate(harness);
80382
80453
  if (!copy2) return { name, installed: false, settings };
80383
80454
  const loggedIn = harness.login ? await probeLogin(spawnName(copy2, splitCommand(harness.command)[0]), harness) : void 0;
80384
- const models = loggedIn === false || quick && SLOW.has(name) ? [] : await readModels(name);
80455
+ const models = await modelLists.read(name, name === "claude-code" ? CLAUDE_DEFAULTS : [], !quick);
80385
80456
  return { name, installed: true, ...copy2.version ? { version: copy2.version } : {}, ...loggedIn === void 0 ? {} : { loggedIn }, ...models.length ? { models } : {}, settings };
80386
80457
  })
80387
80458
  );
80388
80459
  }
80389
- var SLOW = /* @__PURE__ */ new Set(["opencode", "cursor", "antigravity"]);
80390
- var listed = (harness) => async () => (harness.models?.() ?? []).map((id) => ({ id, name: id }));
80391
- var readModels = (name) => (MODELS[name] ?? listed(HARNESSES2[name]))().catch(() => []);
80392
- var MODELS = {
80393
- "claude-code": async () => {
80394
- const cached3 = claudeModels(path30.join(process.env.CLAUDE_CONFIG_DIR || path30.join(os7.homedir(), ".claude"), "cache", "model-catalog"));
80395
- return cached3.length ? cached3 : [
80396
- { id: "opus", name: "Opus" },
80397
- { id: "sonnet", name: "Sonnet" },
80398
- { id: "haiku", name: "Haiku" }
80399
- ];
80400
- },
80401
- codex: async () => codexModels(path30.join(process.env.CODEX_HOME || path30.join(os7.homedir(), ".codex"), "models_cache.json")),
80402
- opencode: async () => opencodeModels(await output(commandOf(HARNESSES2.opencode)[0], ["models"])),
80403
- cursor: () => cursorModels(),
80404
- antigravity: async () => antigravityModels(await output(commandOf(HARNESSES2.antigravity)[0], ["models"]))
80405
- };
80460
+ var CLAUDE_DEFAULTS = ["opus", "sonnet", "haiku"].map((id) => ({ id, name: id[0].toUpperCase() + id.slice(1) }));
80461
+ var sources2 = Object.fromEntries(
80462
+ Object.entries(HARNESSES2).filter(([, harness]) => harness.models).map(([name, harness]) => [
80463
+ name,
80464
+ () => (harness.models?.() ?? []).map((id) => ({ id, name: id }))
80465
+ ])
80466
+ );
80467
+ Object.assign(sources2, {
80468
+ "claude-code": () => claudeModels(path30.join(process.env.CLAUDE_CONFIG_DIR || path30.join(os7.homedir(), ".claude"), "cache", "model-catalog")),
80469
+ codex: () => codexModels(path30.join(process.env.CODEX_HOME || path30.join(os7.homedir(), ".codex"), "models_cache.json")),
80470
+ opencode: async (signal) => opencodeModels(await output(commandOf(HARNESSES2.opencode)[0], ["models"], signal)),
80471
+ cursor: (signal) => cursorModels(signal),
80472
+ antigravity: async (signal) => antigravityModels(await output(commandOf(HARNESSES2.antigravity)[0], ["models"], signal))
80473
+ });
80474
+ var modelLists = new ModelLists(sources2);
80406
80475
  function opencodeModels(out) {
80407
80476
  return out.split("\n").map((l) => l.trim()).filter((l) => /^\S+\/\S+$/.test(l)).map((id) => ({ id, name: id }));
80408
80477
  }
80409
- function cursorModels() {
80410
- const argv = commandOf(HARNESSES2.cursor);
80478
+ function cursorModels(signal, argv = commandOf(HARNESSES2.cursor)) {
80411
80479
  return new Promise((resolve2) => {
80412
80480
  let child;
80413
80481
  try {
@@ -80416,13 +80484,19 @@ function cursorModels() {
80416
80484
  } catch {
80417
80485
  return resolve2([]);
80418
80486
  }
80487
+ let finished = false;
80419
80488
  const done = (models) => {
80420
- clearTimeout(timer);
80489
+ if (finished) return;
80490
+ finished = true;
80491
+ signal.removeEventListener("abort", aborted2);
80421
80492
  child.kill();
80422
80493
  resolve2(models);
80423
80494
  };
80424
- const timer = setTimeout(() => done([]), MODELS_MS);
80495
+ const aborted2 = () => done([]);
80496
+ signal.addEventListener("abort", aborted2, { once: true });
80497
+ if (signal.aborted) return done([]);
80425
80498
  child.on("error", () => done([]));
80499
+ child.on("close", () => done([]));
80426
80500
  const rpc = connect(child.stdout, child.stdin, (msg) => msg.id !== void 0 && rpc.refuse(msg.id, "no"), { jsonrpc: true });
80427
80501
  rpc.call("initialize", { protocolVersion: 1, clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false } }).then(() => rpc.call("session/new", { cwd: os7.tmpdir(), mcpServers: [] })).then((opened) => done(acpModels(opened))).catch(() => done([]));
80428
80502
  });
@@ -80434,7 +80508,7 @@ function acpModels(opened) {
80434
80508
  return id && id !== "default[]" ? [{ id, name: str(m.name) || id }] : [];
80435
80509
  });
80436
80510
  }
80437
- function output(command, args2) {
80511
+ function output(command, args2, signal) {
80438
80512
  return new Promise((resolve2) => {
80439
80513
  let out = "";
80440
80514
  let child;
@@ -80444,16 +80518,20 @@ function output(command, args2) {
80444
80518
  } catch {
80445
80519
  return resolve2("");
80446
80520
  }
80447
- const timer = setTimeout(() => {
80521
+ let finished = false;
80522
+ const done = (value) => {
80523
+ if (finished) return;
80524
+ finished = true;
80525
+ signal.removeEventListener("abort", aborted2);
80448
80526
  child.kill();
80449
- resolve2("");
80450
- }, MODELS_MS);
80527
+ resolve2(value);
80528
+ };
80529
+ const aborted2 = () => done("");
80530
+ signal.addEventListener("abort", aborted2, { once: true });
80531
+ if (signal.aborted) return done("");
80451
80532
  child.stdout?.on("data", (d) => out += d);
80452
- child.on("error", () => resolve2(""));
80453
- child.on("close", (code) => {
80454
- clearTimeout(timer);
80455
- resolve2(code === 0 ? out : "");
80456
- });
80533
+ child.on("error", () => done(""));
80534
+ child.on("close", (code) => done(code === 0 ? out : ""));
80457
80535
  });
80458
80536
  }
80459
80537
  function codexModels(file2) {