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/settings.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;
@@ -27370,8 +27370,8 @@ async function stopExecutors() {
27370
27370
  }
27371
27371
 
27372
27372
  // src/protocol.ts
27373
- var VERSION = true ? "0.6.86" : "0.0.0";
27374
- var AKB_VERSION = true ? "0.11.69" : "0.0.0";
27373
+ var VERSION = true ? "0.6.87" : "0.0.0";
27374
+ var AKB_VERSION = true ? "0.11.70" : "0.0.0";
27375
27375
 
27376
27376
  // src/api.ts
27377
27377
  var RUNTIMES = ["claude-code", "codex", "cursor", "opencode", "kimi", "dsh", "zcode", "grok", "antigravity"];
@@ -27866,7 +27866,6 @@ import path8 from "node:path";
27866
27866
  var STUDIO_FILE = "STUDIO.md";
27867
27867
  var MCP_FILE = "mcp.json";
27868
27868
  var CARD_TEMPLATE_FILE = "CARD.md";
27869
- var SHARED_DIR = "shared/";
27870
27869
  var VERSION_FILE = "version.json";
27871
27870
  var KB = 1024;
27872
27871
  var FILE_LIMITS = { file: 2 * KB * KB, total: 2 * KB * KB, count: 500, path: 512 };
@@ -28011,32 +28010,12 @@ var OFFICIAL = path9.dirname(fileURLToPath(import.meta.url));
28011
28010
  var dirs = (dir) => fs7.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name).sort();
28012
28011
  var hashOf = (files) => crypto2.createHash("sha256").update(hashInput(files)).digest("hex");
28013
28012
  function packOfficial(root2 = OFFICIAL, loose = false) {
28014
- const agentsDir = path9.join(root2, "agents");
28015
- const agentFiles = Object.fromEntries(dirs(agentsDir).map((name) => {
28016
- const dir = path9.join(agentsDir, name);
28017
- return [name, readStudioFolder(dir)];
28018
- }));
28019
- for (const [name, own2] of Object.entries(loose ? {} : agentFiles)) {
28020
- const read2 = parseSpecAgent(own2["AGENT.md"] ?? "", `official/agents/${name}/AGENT.md`, (p) => own2[p] ?? null, true);
28021
- if ("problem" in read2) throw new Error(read2.problem);
28022
- }
28023
28013
  const studiosDir = path9.join(root2, "studios");
28024
28014
  return dirs(studiosDir).map((folder) => {
28025
- const dir = path9.join(studiosDir, folder);
28026
- const files = {};
28027
- for (const f of filesOf(dir).sort()) {
28028
- 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);
28029
- }
28030
- const read2 = checkStudioFiles({ [STUDIO_FILE]: files[STUDIO_FILE], ...Object.fromEntries(
28031
- Object.entries(agentFiles).flatMap(([name, own2]) => Object.entries(own2).map(([f, t2]) => [`agents/${name}/${f}`, t2]))
28032
- ) });
28033
- if (!read2.ok && !loose) throw new Error(`official/studios/${folder}: ${read2.file}: ${read2.reason}`);
28015
+ const files = readStudioFolder(path9.join(studiosDir, folder));
28034
28016
  const parsed = parseStudioFile(folder, files[STUDIO_FILE] ?? "", STUDIO_FILE);
28035
28017
  if ("problem" in parsed) throw new Error(parsed.problem);
28036
28018
  const def = parsed.def;
28037
- for (const name of [...new Set([...def.previews, ...def.land, ...def.scheduled].map((h) => h.agent))].sort()) {
28038
- for (const [f, text3] of Object.entries(agentFiles[name] ?? {})) files[`agents/${name}/${f}`] = text3;
28039
- }
28040
28019
  const checked = loose ? { ok: true } : checkStudioFiles(files, true);
28041
28020
  if (!checked.ok) throw new Error(`official/studios/${folder}: ${checked.file}: ${checked.reason}`);
28042
28021
  if (!def.names?.zh && !loose) throw new Error(`official/studios/${folder}/${STUDIO_FILE}: add its Chinese name under \`names: zh\``);
@@ -28785,8 +28764,7 @@ function modelsIn(file2, pick2, salt = "") {
28785
28764
  const stat = statSync(file2);
28786
28765
  stamp2 = `${stat.mtimeMs}:${stat.size}:${salt}`;
28787
28766
  } catch {
28788
- cached.delete(file2);
28789
- return [];
28767
+ return cached.get(file2)?.found ?? [];
28790
28768
  }
28791
28769
  const hit = cached.get(file2);
28792
28770
  if (hit?.stamp === stamp2) return hit.found;
@@ -28796,8 +28774,8 @@ function modelsIn(file2, pick2, salt = "") {
28796
28774
  } catch {
28797
28775
  found = [];
28798
28776
  }
28799
- cached.set(file2, { stamp: stamp2, found });
28800
- return found;
28777
+ if (found.length) cached.set(file2, { stamp: stamp2, found });
28778
+ return found.length ? found : hit?.found ?? [];
28801
28779
  }
28802
28780
 
28803
28781
  // ../cli/src/lib/agent/harnesses/types.ts
@@ -29216,11 +29194,21 @@ function createAntigravityRenderer(expectedSession) {
29216
29194
  }
29217
29195
 
29218
29196
  // ../cli/src/lib/agent/harnesses/antigravity.ts
29197
+ var EFFORT_ID = /-(?:low|medium|high|xhigh|max)$/i;
29198
+ var EFFORT_NAME = /\s*\((?:low|medium|high|xhigh|max)\)$/i;
29219
29199
  function antigravityModels(output2) {
29220
- return output2.split("\n").flatMap((line) => {
29200
+ const seen = /* @__PURE__ */ new Set();
29201
+ const models = [];
29202
+ for (const line of output2.split("\n")) {
29221
29203
  const match = /^([^\s]+)\t(.+)$/.exec(line.trim());
29222
- return match ? [{ id: match[1], name: match[2] }] : [];
29223
- });
29204
+ if (!match) continue;
29205
+ const id = match[1].replace(EFFORT_ID, "");
29206
+ const name = match[2].replace(EFFORT_NAME, "").trim();
29207
+ if (seen.has(id)) continue;
29208
+ seen.add(id);
29209
+ models.push({ id, name });
29210
+ }
29211
+ return models;
29224
29212
  }
29225
29213
  function args(argv, resume) {
29226
29214
  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.");
@@ -29247,6 +29235,22 @@ var ANTIGRAVITY = {
29247
29235
  flags: ["--model"],
29248
29236
  placeholder: "model-id",
29249
29237
  help: "A model from agy models. Empty uses the CLI default; an invalid model fails the run."
29238
+ }, {
29239
+ key: "reasoning",
29240
+ agentOwned: true,
29241
+ label: "Reasoning effort",
29242
+ kind: "select",
29243
+ choices: [
29244
+ { value: "", label: "Agent's default" },
29245
+ { value: "low", label: "Low" },
29246
+ { value: "medium", label: "Medium" },
29247
+ { value: "high", label: "High" },
29248
+ { value: "xhigh", label: "Extra high (xhigh)" },
29249
+ { value: "max", label: "Max" }
29250
+ ],
29251
+ flags: ["--effort"],
29252
+ help: "Lower is quicker and cheaper, higher is slower and more careful.",
29253
+ overriddenHelp: `Not in effect: this agent's "command" in your ui.config.json already names an effort level, and that wins.`
29250
29254
  }],
29251
29255
  models() {
29252
29256
  const copy2 = locate(ANTIGRAVITY);
@@ -30399,7 +30403,7 @@ function createTail(log) {
30399
30403
  // ../cli/package.json
30400
30404
  var package_default = {
30401
30405
  name: "wildcrane",
30402
- version: "0.11.69",
30406
+ version: "0.11.70",
30403
30407
  akbContract: 17,
30404
30408
  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.",
30405
30409
  keywords: [
@@ -30656,9 +30660,9 @@ async function oneTurn(io, options) {
30656
30660
  }
30657
30661
  let model = modelOf(opened);
30658
30662
  if (options.model) {
30659
- const listed2 = obj(opened.models).currentModelId !== void 0;
30660
- const picked = listed2 ? pickedModel(opened, options.model) : void 0;
30661
- 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.");
30663
+ const listed = obj(opened.models).currentModelId !== void 0;
30664
+ const picked = listed ? pickedModel(opened, options.model) : void 0;
30665
+ 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.");
30662
30666
  model = picked?.name ?? modelOf(set) ?? options.model;
30663
30667
  }
30664
30668
  if (model) io.gotModel(model);
@@ -33027,10 +33031,77 @@ var HARNESSES = [CLAUDE_CODE, CODEX, CURSOR, OPENCODE, KIMI, DSH, ZCODE, GROK, A
33027
33031
  var DEFAULT_HARNESS = HARNESSES[0];
33028
33032
  checkHarnesses(HARNESSES);
33029
33033
 
33034
+ // src/model-list.ts
33035
+ var MODEL_REFRESH_MS = 3e4;
33036
+ var MODEL_TIMEOUT_MS = 15e3;
33037
+ var ModelLists = class {
33038
+ constructor(sources3, interval = MODEL_REFRESH_MS, timeout = MODEL_TIMEOUT_MS) {
33039
+ this.sources = sources3;
33040
+ this.interval = interval;
33041
+ this.timeout = timeout;
33042
+ }
33043
+ sources;
33044
+ interval;
33045
+ timeout;
33046
+ listeners = /* @__PURE__ */ new Set();
33047
+ subscribe(listener) {
33048
+ this.listeners.add(listener);
33049
+ return () => {
33050
+ this.listeners.delete(listener);
33051
+ };
33052
+ }
33053
+ entries = /* @__PURE__ */ new Map();
33054
+ async read(key, previous = [], wait = false) {
33055
+ const source = this.sources[key];
33056
+ if (!source) return previous;
33057
+ let entry = this.entries.get(key);
33058
+ if (!entry) {
33059
+ entry = { models: normalizeModels(previous), next: 0 };
33060
+ this.entries.set(key, entry);
33061
+ }
33062
+ if (!entry.models.length && previous.length) entry.models = normalizeModels(previous);
33063
+ if (!entry.pending && Date.now() >= entry.next) {
33064
+ const held2 = entry;
33065
+ const controller = new AbortController();
33066
+ held2.next = Date.now() + this.interval;
33067
+ let changed = false;
33068
+ held2.pending = new Promise((resolve2) => {
33069
+ let done = false;
33070
+ const finish = (models) => {
33071
+ if (done) return;
33072
+ done = true;
33073
+ clearTimeout(timer);
33074
+ controller.abort();
33075
+ const found = normalizeModels(models);
33076
+ if (found.length) {
33077
+ changed = JSON.stringify(found) !== JSON.stringify(held2.models);
33078
+ held2.models = found;
33079
+ }
33080
+ resolve2(held2.models);
33081
+ };
33082
+ const timer = setTimeout(() => finish([]), this.timeout);
33083
+ Promise.resolve().then(() => source(controller.signal)).then(finish, () => finish([]));
33084
+ }).finally(() => {
33085
+ held2.pending = void 0;
33086
+ if (changed) for (const listener of this.listeners) listener();
33087
+ });
33088
+ }
33089
+ return wait && entry.pending ? entry.pending : entry.models;
33090
+ }
33091
+ };
33092
+ function normalizeModels(models) {
33093
+ const seen = /* @__PURE__ */ new Set();
33094
+ return models.flatMap((model) => {
33095
+ const id = model.id.trim();
33096
+ if (!id || seen.has(id)) return [];
33097
+ seen.add(id);
33098
+ return [{ id, name: model.name.trim() || id }];
33099
+ });
33100
+ }
33101
+
33030
33102
  // src/runtimes.ts
33031
33103
  var HARNESSES2 = Object.fromEntries(RUNTIMES.map((name) => [name, HARNESSES.find((h) => h.name === name)]));
33032
33104
  var LOGIN_PROBE_MS = 5e3;
33033
- var MODELS_MS = 3e4;
33034
33105
  var LABELS = Object.fromEntries(RUNTIMES.map((name) => [name, HARNESSES2[name].label]));
33035
33106
  var hints = (runtime) => ({ login: HARNESSES2[runtime].login?.login });
33036
33107
  function commandOf(harness) {
@@ -33058,33 +33129,30 @@ async function detectRuntimes(quick = false, only) {
33058
33129
  const copy2 = locate(harness);
33059
33130
  if (!copy2) return { name, installed: false, settings };
33060
33131
  const loggedIn = harness.login ? await probeLogin(spawnName(copy2, splitCommand(harness.command)[0]), harness) : void 0;
33061
- const models = loggedIn === false || quick && SLOW.has(name) ? [] : await readModels(name);
33132
+ const models = await modelLists.read(name, name === "claude-code" ? CLAUDE_DEFAULTS : [], !quick);
33062
33133
  return { name, installed: true, ...copy2.version ? { version: copy2.version } : {}, ...loggedIn === void 0 ? {} : { loggedIn }, ...models.length ? { models } : {}, settings };
33063
33134
  })
33064
33135
  );
33065
33136
  }
33066
- var SLOW = /* @__PURE__ */ new Set(["opencode", "cursor", "antigravity"]);
33067
- var listed = (harness) => async () => (harness.models?.() ?? []).map((id) => ({ id, name: id }));
33068
- var readModels = (name) => (MODELS[name] ?? listed(HARNESSES2[name]))().catch(() => []);
33069
- var MODELS = {
33070
- "claude-code": async () => {
33071
- const cached2 = claudeModels(path26.join(process.env.CLAUDE_CONFIG_DIR || path26.join(os6.homedir(), ".claude"), "cache", "model-catalog"));
33072
- return cached2.length ? cached2 : [
33073
- { id: "opus", name: "Opus" },
33074
- { id: "sonnet", name: "Sonnet" },
33075
- { id: "haiku", name: "Haiku" }
33076
- ];
33077
- },
33078
- codex: async () => codexModels(path26.join(process.env.CODEX_HOME || path26.join(os6.homedir(), ".codex"), "models_cache.json")),
33079
- opencode: async () => opencodeModels(await output(commandOf(HARNESSES2.opencode)[0], ["models"])),
33080
- cursor: () => cursorModels(),
33081
- antigravity: async () => antigravityModels(await output(commandOf(HARNESSES2.antigravity)[0], ["models"]))
33082
- };
33137
+ var CLAUDE_DEFAULTS = ["opus", "sonnet", "haiku"].map((id) => ({ id, name: id[0].toUpperCase() + id.slice(1) }));
33138
+ var sources2 = Object.fromEntries(
33139
+ Object.entries(HARNESSES2).filter(([, harness]) => harness.models).map(([name, harness]) => [
33140
+ name,
33141
+ () => (harness.models?.() ?? []).map((id) => ({ id, name: id }))
33142
+ ])
33143
+ );
33144
+ Object.assign(sources2, {
33145
+ "claude-code": () => claudeModels(path26.join(process.env.CLAUDE_CONFIG_DIR || path26.join(os6.homedir(), ".claude"), "cache", "model-catalog")),
33146
+ codex: () => codexModels(path26.join(process.env.CODEX_HOME || path26.join(os6.homedir(), ".codex"), "models_cache.json")),
33147
+ opencode: async (signal) => opencodeModels(await output(commandOf(HARNESSES2.opencode)[0], ["models"], signal)),
33148
+ cursor: (signal) => cursorModels(signal),
33149
+ antigravity: async (signal) => antigravityModels(await output(commandOf(HARNESSES2.antigravity)[0], ["models"], signal))
33150
+ });
33151
+ var modelLists = new ModelLists(sources2);
33083
33152
  function opencodeModels(out) {
33084
33153
  return out.split("\n").map((l) => l.trim()).filter((l) => /^\S+\/\S+$/.test(l)).map((id) => ({ id, name: id }));
33085
33154
  }
33086
- function cursorModels() {
33087
- const argv = commandOf(HARNESSES2.cursor);
33155
+ function cursorModels(signal, argv = commandOf(HARNESSES2.cursor)) {
33088
33156
  return new Promise((resolve2) => {
33089
33157
  let child;
33090
33158
  try {
@@ -33093,13 +33161,19 @@ function cursorModels() {
33093
33161
  } catch {
33094
33162
  return resolve2([]);
33095
33163
  }
33164
+ let finished = false;
33096
33165
  const done = (models) => {
33097
- clearTimeout(timer);
33166
+ if (finished) return;
33167
+ finished = true;
33168
+ signal.removeEventListener("abort", aborted);
33098
33169
  child.kill();
33099
33170
  resolve2(models);
33100
33171
  };
33101
- const timer = setTimeout(() => done([]), MODELS_MS);
33172
+ const aborted = () => done([]);
33173
+ signal.addEventListener("abort", aborted, { once: true });
33174
+ if (signal.aborted) return done([]);
33102
33175
  child.on("error", () => done([]));
33176
+ child.on("close", () => done([]));
33103
33177
  const rpc = connect(child.stdout, child.stdin, (msg) => msg.id !== void 0 && rpc.refuse(msg.id, "no"), { jsonrpc: true });
33104
33178
  rpc.call("initialize", { protocolVersion: 1, clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false } }).then(() => rpc.call("session/new", { cwd: os6.tmpdir(), mcpServers: [] })).then((opened) => done(acpModels(opened))).catch(() => done([]));
33105
33179
  });
@@ -33111,7 +33185,7 @@ function acpModels(opened) {
33111
33185
  return id && id !== "default[]" ? [{ id, name: str(m.name) || id }] : [];
33112
33186
  });
33113
33187
  }
33114
- function output(command, args2) {
33188
+ function output(command, args2, signal) {
33115
33189
  return new Promise((resolve2) => {
33116
33190
  let out = "";
33117
33191
  let child;
@@ -33121,16 +33195,20 @@ function output(command, args2) {
33121
33195
  } catch {
33122
33196
  return resolve2("");
33123
33197
  }
33124
- const timer = setTimeout(() => {
33198
+ let finished = false;
33199
+ const done = (value) => {
33200
+ if (finished) return;
33201
+ finished = true;
33202
+ signal.removeEventListener("abort", aborted);
33125
33203
  child.kill();
33126
- resolve2("");
33127
- }, MODELS_MS);
33204
+ resolve2(value);
33205
+ };
33206
+ const aborted = () => done("");
33207
+ signal.addEventListener("abort", aborted, { once: true });
33208
+ if (signal.aborted) return done("");
33128
33209
  child.stdout?.on("data", (d) => out += d);
33129
- child.on("error", () => resolve2(""));
33130
- child.on("close", (code) => {
33131
- clearTimeout(timer);
33132
- resolve2(code === 0 ? out : "");
33133
- });
33210
+ child.on("error", () => done(""));
33211
+ child.on("close", (code) => done(code === 0 ? out : ""));
33134
33212
  });
33135
33213
  }
33136
33214
  function codexModels(file2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane-runner",
3
- "version": "0.6.86",
3
+ "version": "0.6.87",
4
4
  "description": "WildCrane's Local Runner \u2014 connects this computer to WildCrane and runs its jobs on your local Claude Code, Codex, OpenCode or Cursor.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://wildcrane.ai/",