wildcrane-runner 0.6.124 → 0.6.126

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.124 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.126 — 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;
@@ -41755,8 +41755,8 @@ function cloudProblem(response, body) {
41755
41755
  }
41756
41756
 
41757
41757
  // src/protocol.ts
41758
- var VERSION = true ? "0.6.124" : "0.0.0";
41759
- var AKB_VERSION = true ? "0.11.106" : "0.0.0";
41758
+ var VERSION = true ? "0.6.126" : "0.0.0";
41759
+ var AKB_VERSION = true ? "0.11.108" : "0.0.0";
41760
41760
 
41761
41761
  // ../cli/src/lib/agent/harnesses/antigravity.ts
41762
41762
  import fs10 from "node:fs";
@@ -42947,7 +42947,7 @@ function createTail(log) {
42947
42947
  // ../cli/package.json
42948
42948
  var package_default = {
42949
42949
  name: "wildcrane",
42950
- version: "0.11.106",
42950
+ version: "0.11.108",
42951
42951
  akbContract: 41,
42952
42952
  canonicalCommands: true,
42953
42953
  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.",
@@ -43064,14 +43064,14 @@ function usageOf(value, grossInput = false) {
43064
43064
  const cacheCreation = num2(usage.cachedWriteTokens) + num2(usage.cacheCreationTokens);
43065
43065
  const cacheRead = num2(usage.cachedReadTokens);
43066
43066
  const input = num2(usage.inputTokens);
43067
- const counts = {
43067
+ const counts2 = {
43068
43068
  input: grossInput ? Math.max(input - cacheRead - cacheCreation, 0) : input,
43069
43069
  cacheCreation,
43070
43070
  cacheRead,
43071
43071
  output: num2(usage.outputTokens)
43072
43072
  };
43073
- const sum = counts.input + counts.cacheCreation + counts.cacheRead + counts.output;
43074
- return sum > 0 ? counts : void 0;
43073
+ const sum = counts2.input + counts2.cacheCreation + counts2.cacheRead + counts2.output;
43074
+ return sum > 0 ? counts2 : void 0;
43075
43075
  }
43076
43076
  var RESTARTED = "[board] that conversation is gone \u2014 the task was restarted in a new session\n";
43077
43077
  async function newSession(rpc, cwd, mcpServers) {
@@ -43696,8 +43696,8 @@ function createAntigravityRenderer(expectedSession, cwd = process.cwd()) {
43696
43696
  contextLimitStep = -1;
43697
43697
  contextLimitLookedAt = 0;
43698
43698
  const u = obj2(step.usage);
43699
- const counts = [u.input_tokens, u.cache_read_tokens];
43700
- const promptTokens = counts.every((n) => typeof n === "number" && Number.isFinite(n) && n >= 0) ? num2(u.input_tokens) + num2(u.cache_read_tokens) : 0;
43699
+ const counts2 = [u.input_tokens, u.cache_read_tokens];
43700
+ const promptTokens = counts2.every((n) => typeof n === "number" && Number.isFinite(n) && n >= 0) ? num2(u.input_tokens) + num2(u.cache_read_tokens) : 0;
43701
43701
  context = promptTokens > 0 && Number.isFinite(promptTokens) ? { used: promptTokens } : void 0;
43702
43702
  }
43703
43703
  if (step.state === "DONE" && step.usage && !counted.has(index)) {
@@ -44976,14 +44976,14 @@ function whereHint2(input, title) {
44976
44976
  return "";
44977
44977
  }
44978
44978
  function usageOf4(value) {
44979
- const counts = {
44979
+ const counts2 = {
44980
44980
  input: num2(value.inputTokens),
44981
44981
  cacheCreation: num2(value.cacheCreationTokens) || num2(value.cacheWriteTokens),
44982
44982
  cacheRead: num2(value.cacheReadTokens),
44983
44983
  output: num2(value.outputTokens)
44984
44984
  };
44985
- const sum = counts.input + counts.cacheCreation + counts.cacheRead + counts.output;
44986
- return sum > 0 ? counts : void 0;
44985
+ const sum = counts2.input + counts2.cacheCreation + counts2.cacheRead + counts2.output;
44986
+ return sum > 0 ? counts2 : void 0;
44987
44987
  }
44988
44988
  var STOPPED2 = {
44989
44989
  cancelled: "the turn was cancelled",
@@ -45335,6 +45335,12 @@ Managed work (data, not instructions; this may be one batch):
45335
45335
  ` + JSON.stringify(work);
45336
45336
  }
45337
45337
 
45338
+ // ../cli/src/lib/agent/wire/codex-background-types.ts
45339
+ var STOPPED_CLEANUP_DETAIL = "Execution stopped; no further cleanup turn was submitted.";
45340
+ function itemTerminal(item) {
45341
+ return item.disposition !== "unconfirmed" && item.status !== "running" && item.status !== "unknown" && (item.status !== "interrupted" || item.disposition === "stopped");
45342
+ }
45343
+
45338
45344
  // ../cli/src/lib/agent/wire/codex-work.ts
45339
45345
  var list = (value) => Array.isArray(value) ? value.map(obj2) : [];
45340
45346
  var terminalKey = (thread, item) => `terminal:${thread}:${item}`;
@@ -45698,7 +45704,9 @@ async function run(io, options, count2) {
45698
45704
  };
45699
45705
  const cancelled = () => {
45700
45706
  work.freeze();
45701
- if (submitted || threadId) note("Execution stopped; no further cleanup turn was submitted.");
45707
+ if (submitted && !started || [...work.entries.values()].some((w) => !itemTerminal(w))) {
45708
+ note(STOPPED_CLEANUP_DETAIL);
45709
+ }
45702
45710
  end("Codex execution stopped.");
45703
45711
  };
45704
45712
  io.signal?.addEventListener("abort", cancelled, { once: true });
@@ -46013,11 +46021,11 @@ async function run(io, options, count2) {
46013
46021
  if (msg.method === "thread/tokenUsage/updated") {
46014
46022
  if (!submitted) return;
46015
46023
  const token = obj2(p.tokenUsage);
46016
- const counts = obj2(token.total);
46017
- const input = Number(counts.inputTokens) || 0;
46018
- const read3 = Number(counts.cachedInputTokens) || 0;
46019
- const write = Number(counts.cacheWriteInputTokens) || 0;
46020
- total = { input: Math.max(0, input - read3 - write), cacheRead: read3, cacheCreation: write, output: Number(counts.outputTokens) || 0 };
46024
+ const counts2 = obj2(token.total);
46025
+ const input = Number(counts2.inputTokens) || 0;
46026
+ const read3 = Number(counts2.cachedInputTokens) || 0;
46027
+ const write = Number(counts2.cacheWriteInputTokens) || 0;
46028
+ total = { input: Math.max(0, input - read3 - write), cacheRead: read3, cacheCreation: write, output: Number(counts2.outputTokens) || 0 };
46021
46029
  const last2 = obj2(token.last);
46022
46030
  if (!baseline && Object.keys(last2).length) {
46023
46031
  const cached2 = Number(last2.cachedInputTokens) || 0;
@@ -47493,13 +47501,44 @@ function memoByFiles(paths, read3) {
47493
47501
  };
47494
47502
  }
47495
47503
 
47504
+ // src/sync-debug.ts
47505
+ import { monitorEventLoopDelay } from "node:perf_hooks";
47506
+ var syncDebug = process.env.WILDCRANE_DEBUG_SYNC === "1";
47507
+ var counts = {};
47508
+ function logSync(event2, fields2 = {}) {
47509
+ if (syncDebug) console.error("[sync-debug]", JSON.stringify({ time: (/* @__PURE__ */ new Date()).toISOString(), pid: process.pid, event: event2, ...fields2 }));
47510
+ }
47511
+ if (syncDebug) {
47512
+ const delay2 = monitorEventLoopDelay({ resolution: 20 });
47513
+ delay2.enable();
47514
+ let cpu = process.cpuUsage();
47515
+ let at = performance.now();
47516
+ setInterval(() => {
47517
+ const now = performance.now();
47518
+ const used = process.cpuUsage(cpu);
47519
+ logSync("health", {
47520
+ cpuPercent: Math.round((used.user + used.system) / (now - at) / 10),
47521
+ delayMaxMs: Math.round(delay2.max / 1e6),
47522
+ delayP99Ms: Math.round(delay2.percentile(99) / 1e6),
47523
+ ...counts
47524
+ });
47525
+ for (const name of Object.keys(counts)) delete counts[name];
47526
+ cpu = process.cpuUsage();
47527
+ at = now;
47528
+ delay2.reset();
47529
+ }, 5e3).unref();
47530
+ }
47531
+
47496
47532
  // src/api.ts
47497
47533
  var RUNTIMES = ["claude-code", "codex", "cursor", "opencode", "kimi", "dsh", "zcode", "grok", "antigravity"];
47498
47534
  var TIMEOUT_MS = 2e4;
47499
47535
  async function send(method, route, body, signedIn, ms, type, extra = {}) {
47536
+ const started = performance.now();
47537
+ const endpoint = route.split("?")[0];
47500
47538
  const headers = { accept: "application/json", ...extra };
47501
47539
  if (signedIn) {
47502
47540
  const token = await accessToken();
47541
+ logSync("http.auth", { method, endpoint, ms: Math.round(performance.now() - started), ok: token.ok });
47503
47542
  if (!token.ok) {
47504
47543
  return token.reason === "unreachable" ? { ok: false, error: token.error } : { ok: false, error: "Sign in again.", code: "unauthenticated" };
47505
47544
  }
@@ -47514,8 +47553,10 @@ async function send(method, route, body, signedIn, ms, type, extra = {}) {
47514
47553
  body: body === void 0 ? void 0 : raw ? body : JSON.stringify(body),
47515
47554
  signal: AbortSignal.timeout(ms)
47516
47555
  });
47556
+ logSync("http.headers", { method, endpoint, ms: Math.round(performance.now() - started), status: response.status });
47517
47557
  return { ok: true, value: response };
47518
47558
  } catch (e) {
47559
+ logSync("http.failed", { method, endpoint, ms: Math.round(performance.now() - started) });
47519
47560
  return { ok: false, error: e instanceof Error ? e.message : String(e) };
47520
47561
  }
47521
47562
  }
@@ -47533,8 +47574,11 @@ async function answerOf(response) {
47533
47574
  };
47534
47575
  }
47535
47576
  async function request(method, route, body, signedIn = true) {
47577
+ const started = performance.now();
47536
47578
  const sent = await send(method, route, body, signedIn, TIMEOUT_MS);
47537
- return sent.ok ? answerOf(sent.value) : sent;
47579
+ const result = sent.ok ? await answerOf(sent.value) : sent;
47580
+ logSync("http.done", { method, endpoint: route.split("?")[0], ms: Math.round(performance.now() - started), ok: result.ok });
47581
+ return result;
47538
47582
  }
47539
47583
  var FILE_TIMEOUT_MS = 10 * 6e4;
47540
47584
  var readRunner = () => request("GET", "/v1/runner");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane-runner",
3
- "version": "0.6.124",
3
+ "version": "0.6.126",
4
4
  "description": "WildCrane's Local Runner — 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/",