wildcrane-runner 0.6.120 → 0.6.122

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.120 — built by runner/scripts/build.mjs. Do not edit.
1
+ // wildcrane-runner 0.6.122 — 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;
@@ -40959,6 +40959,7 @@ function withSystemProxy(env2 = process.env, platform = process.platform, read3
40959
40959
 
40960
40960
  // src/proxy.ts
40961
40961
  var LOOPBACK = "localhost,127.0.0.1,[::1]";
40962
+ var withLoopback = (value) => [value, LOOPBACK].filter(Boolean).join(",");
40962
40963
  var HOST_PROXY_ENV = "WILDCRANE_HOST_PROXY";
40963
40964
  var HOST = null;
40964
40965
  var current = {};
@@ -40979,7 +40980,7 @@ function followProxy(read3) {
40979
40980
  const route = {
40980
40981
  httpProxy,
40981
40982
  httpsProxy: current.HTTPS_PROXY || current.https_proxy || httpProxy,
40982
- noProxy: [current.NO_PROXY ?? current.no_proxy, LOOPBACK].filter(Boolean).join(",")
40983
+ noProxy: withLoopback(current.NO_PROXY ?? current.no_proxy)
40983
40984
  };
40984
40985
  const key = JSON.stringify(route);
40985
40986
  if (key !== applied) {
@@ -41418,10 +41419,8 @@ function landSections(body, previews) {
41418
41419
  const start = heading.index;
41419
41420
  const end = start + heading[0].length;
41420
41421
  if (!/^ {0,3}##[ \t]+Land(?:[ \t]+#+)?[ \t]*$/.test(visible.slice(start, end))) return [];
41421
- return [{
41422
- offset: start + heading[0].indexOf("#"),
41423
- empty: !visible.slice(end, headings[index + 1]?.index).replace(comments, "").trim()
41424
- }];
41422
+ const text2 = visible.slice(end, headings[index + 1]?.index).replace(comments, "").trim();
41423
+ return [{ offset: start + heading[0].indexOf("#"), empty: !text2, text: text2 }];
41425
41424
  });
41426
41425
  }
41427
41426
  function parseStudioFile(id, source, from, { requirePreviewCopy = false, requireLand = false } = {}) {
@@ -41756,13 +41755,13 @@ function cloudProblem(response, body) {
41756
41755
  }
41757
41756
 
41758
41757
  // src/protocol.ts
41759
- var VERSION = true ? "0.6.120" : "0.0.0";
41760
- var AKB_VERSION = true ? "0.11.102" : "0.0.0";
41758
+ var VERSION = true ? "0.6.122" : "0.0.0";
41759
+ var AKB_VERSION = true ? "0.11.104" : "0.0.0";
41761
41760
 
41762
41761
  // ../cli/src/lib/agent/harnesses/antigravity.ts
41763
41762
  import fs10 from "node:fs";
41764
41763
  import path12 from "node:path";
41765
- import { createHash as createHash4 } from "node:crypto";
41764
+ import { createHash as createHash5 } from "node:crypto";
41766
41765
  import { spawnSync as spawnSync2 } from "node:child_process";
41767
41766
 
41768
41767
  // ../cli/src/lib/agent/locate.ts
@@ -42274,7 +42273,7 @@ function rootAbove(board) {
42274
42273
  var NESTED_STATE = /(^|[/\\])\.akb[/\\](?:(?:boards|hidden-boards)[/\\])?\.akb(?=[/\\]|$)/;
42275
42274
  var InvalidBoardStatePath = class extends BoardError {
42276
42275
  constructor(file2, state, id) {
42277
- const use = state ? `Use ${state}${id ? ` or an .assets/${id}/\u2026 reference` : ""}.` : "Use the board\u2019s project-local state directory.";
42276
+ const use = state ? `Use ${state}${id ? ` or an asset:<path> reference` : ""}.` : "Use the board\u2019s project-local state directory.";
42278
42277
  super(`Invalid nested board state path: ${file2}. ${use}`, { kind: "board-state-path" });
42279
42278
  }
42280
42279
  };
@@ -42306,7 +42305,6 @@ function stateLayout(board, root2) {
42306
42305
  function projectStateDir(board, root2 = stateRootOf(board)) {
42307
42306
  return stateLayout(board, root2).state;
42308
42307
  }
42309
- var cloudBoardOf = (project) => path8.join(project, ".akb", "kanban");
42310
42308
  function hasLegacyProjectState(board, root2 = stateRootOf(board)) {
42311
42309
  const { legacy } = stateLayout(board, root2);
42312
42310
  return legacy.some((dir) => fs7.lstatSync(dir, { throwIfNoEntry: false }));
@@ -42625,7 +42623,22 @@ ${files.map((file2) => `- ${file2}`).join("\n")}` : "";
42625
42623
  import fs9 from "node:fs";
42626
42624
 
42627
42625
  // ../cli/src/lib/agent/wire/events.ts
42626
+ import { createHash as createHash4 } from "node:crypto";
42628
42627
  var TOOL_KINDS = ["read", "edit", "delete", "move", "search", "execute", "fetch", "other"];
42628
+ var isPollingTool = (title) => /^(?:.*\.)?(?:command_status|wait(?:_5_seconds|_agent)?|TaskOutput)$/i.test(title);
42629
+ var toolOutput = (text2) => text2.split(/\r?\n/).map((line) => line.trim()).filter(
42630
+ (line) => line && !/^(?:\[?heartbeat\]?(?:\b|\s|$)|(?:status:\s*)?(?:(?:command|task) (?:is )?(?:still )?running|running|in[_ ]progress|pending)[.!]?$)/i.test(line)
42631
+ ).join("\n");
42632
+ function progressSnapshots() {
42633
+ const seen = /* @__PURE__ */ new Set();
42634
+ return (key, text2) => {
42635
+ if (!text2) return false;
42636
+ const digest = createHash4("sha256").update(key).update("\0").update(text2).digest("base64");
42637
+ if (seen.has(digest)) return false;
42638
+ seen.add(digest);
42639
+ return true;
42640
+ };
42641
+ }
42629
42642
  var toolKind = (v) => TOOL_KINDS.includes(str2(v)) ? v : "other";
42630
42643
  function targetOf(raw) {
42631
42644
  const line = raw.split("\n")[0].trim();
@@ -42663,6 +42676,8 @@ function createEventCollector() {
42663
42676
  let queue = [];
42664
42677
  let said = "";
42665
42678
  let activity = 0;
42679
+ const fresh = progressSnapshots();
42680
+ const polls = /* @__PURE__ */ new Map();
42666
42681
  const todoCalls = /* @__PURE__ */ new Set();
42667
42682
  const held2 = /* @__PURE__ */ new Map();
42668
42683
  let todos = [];
@@ -42681,6 +42696,9 @@ function createEventCollector() {
42681
42696
  progress: () => {
42682
42697
  activity++;
42683
42698
  },
42699
+ progressSnapshot(key, text2) {
42700
+ if (fresh(key, toolOutput(text2))) activity++;
42701
+ },
42684
42702
  submitted() {
42685
42703
  queue.push({ kind: "phase", data: { phase: "submitted", at: (/* @__PURE__ */ new Date()).toISOString() } });
42686
42704
  },
@@ -42702,6 +42720,8 @@ function createEventCollector() {
42702
42720
  todoCalls.add(id);
42703
42721
  return;
42704
42722
  }
42723
+ const title = str2(u.title);
42724
+ if (isPollingTool(title)) polls.set(id, `${title}:${str2(obj2(u.rawInput).task_id) || str2(obj2(u.rawInput).CommandId)}`);
42705
42725
  const target = targetIn(u);
42706
42726
  const subagent = /^(?:Task|Agent|delegate_task|spawn_agent)$/i.test(str2(u.title)) || !!obj2(u.rawInput).subagent_type;
42707
42727
  const data = { toolCallId: id, title: str2(u.title) || "tool", kind: toolKind(u.kind), status: str2(u.status) || "pending", ...subagent ? { subagent: true } : {}, ...target ? { target } : {} };
@@ -42717,7 +42737,9 @@ function createEventCollector() {
42717
42737
  return;
42718
42738
  }
42719
42739
  release(id, targetIn(u));
42720
- const result = contentText(u.content);
42740
+ const result = contentText(u.content) || str2(obj2(u.rawOutput).output) || str2(u.rawOutput);
42741
+ const poll = polls.get(id);
42742
+ if (poll && fresh(poll, toolOutput(result))) activity++;
42721
42743
  if (!u.status && !result) return;
42722
42744
  queue.push({
42723
42745
  kind: "tool_call_update",
@@ -42925,8 +42947,8 @@ function createTail(log) {
42925
42947
  // ../cli/package.json
42926
42948
  var package_default = {
42927
42949
  name: "wildcrane",
42928
- version: "0.11.102",
42929
- akbContract: 35,
42950
+ version: "0.11.104",
42951
+ akbContract: 39,
42930
42952
  canonicalCommands: true,
42931
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.",
42932
42954
  keywords: [
@@ -43693,11 +43715,22 @@ function createAntigravityRenderer(expectedSession, cwd = process.cwd()) {
43693
43715
  let out = "";
43694
43716
  if (!calls.has(id)) {
43695
43717
  calls.add(id);
43696
- events.toolCall(id, name, KINDS[name] ?? "other", target);
43718
+ if (["invoke_subagent", "browser_subagent"].includes(name)) events.subagent(id, target || name);
43719
+ else events.toolCall(id, name, KINDS[name] ?? "other", target);
43697
43720
  out = `
43698
43721
  \u23FA ${name}${target ? ` ${target}` : ""}
43699
43722
  `;
43700
43723
  }
43724
+ const output2 = str2(tool.output);
43725
+ if (isPollingTool(name)) {
43726
+ const command = str2(p.CommandId) || str2(p.CommandID) || name;
43727
+ const commandOutput = /(?:^|\n)Command output:\s*([\s\S]*)/.exec(output2)?.[1].trim();
43728
+ const exit = /(?:^|\n)(Command exited with code -?\d+\.)/.exec(output2)?.[1];
43729
+ if (commandOutput) events.progressSnapshot(`command:${command}`, commandOutput);
43730
+ if (exit) events.progressSnapshot(`exit:${command}`, exit);
43731
+ } else if (!["DONE", "ERROR", "CANCELED", "INTERRUPTED"].includes(str2(step.state))) {
43732
+ events.progressSnapshot(id, output2);
43733
+ }
43701
43734
  const error = obj2(tool.error);
43702
43735
  const reason = str2(error.message) || str2(error.type);
43703
43736
  if (["DONE", "ERROR", "CANCELED", "INTERRUPTED"].includes(str2(step.state)) && !closed.has(id)) {
@@ -43715,7 +43748,7 @@ ${imageError(target, reason || str2(step.state))}
43715
43748
  imageErrors.delete(file2);
43716
43749
  }
43717
43750
  }
43718
- events.toolResult(id, failed ? "failed" : "completed", str2(tool.output) || reason);
43751
+ events.toolResult(id, failed ? "failed" : "completed", output2 || reason);
43719
43752
  }
43720
43753
  return out;
43721
43754
  }
@@ -43829,7 +43862,7 @@ function systemPrompt(text2, _argv, env2) {
43829
43862
  const rule = `${text2}
43830
43863
 
43831
43864
  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.`;
43832
- const hash = createHash4("sha256").update(rule).digest("hex").slice(0, 16);
43865
+ const hash = createHash5("sha256").update(rule).digest("hex").slice(0, 16);
43833
43866
  const root2 = path12.join(machineHome(), "prompts", `antigravity-${hash}`);
43834
43867
  const file2 = path12.join(root2, ".agents", "rules", "language.md");
43835
43868
  fs10.mkdirSync(path12.dirname(file2), { recursive: true });
@@ -44081,6 +44114,7 @@ function createStreamRenderer() {
44081
44114
  const plans = /* @__PURE__ */ new Set();
44082
44115
  const subagents = /* @__PURE__ */ new Map();
44083
44116
  const detached = /* @__PURE__ */ new Set();
44117
+ const taskUsage = /* @__PURE__ */ new Map();
44084
44118
  const endSubagent = (id, status2) => {
44085
44119
  if (subagents.get(id) !== false) return;
44086
44120
  subagents.set(id, true);
@@ -44092,8 +44126,18 @@ function createStreamRenderer() {
44092
44126
  if (!ev) return `${line}
44093
44127
  `;
44094
44128
  if (model === void 0) model = eventModel(ev);
44095
- if (str2(ev.parent_tool_use_id)) return "";
44096
- if (ev.type === "assistant" || ev.type === "stream_event" && obj2(ev.event).type === "content_block_delta") events.progress();
44129
+ const parent = str2(ev.parent_tool_use_id);
44130
+ const content = obj2(ev.message).content;
44131
+ const streamEvent = obj2(ev.event);
44132
+ const delta = obj2(streamEvent.delta);
44133
+ if (ev.type === "stream_event" && streamEvent.type === "content_block_delta" && (str2(delta.text) || str2(delta.thinking) || str2(delta.partial_json))) events.progress();
44134
+ if (parent) {
44135
+ if (["assistant", "user"].includes(str2(ev.type)) && Array.isArray(content)) {
44136
+ const useful = content.map(obj2).filter((block) => !!str2(block.text).trim() || !!str2(block.thinking).trim() || block.type === "tool_use" || block.type === "tool_result" && !!resultText(block.content).trim());
44137
+ if (useful.length) events.progressSnapshot(parent, JSON.stringify(useful));
44138
+ }
44139
+ return "";
44140
+ }
44097
44141
  switch (ev.type) {
44098
44142
  case "assistant": {
44099
44143
  apiFailure = typeof ev.error === "string" ? providerFailure({ type: ev.error }, "Claude could not complete the request.") : void 0;
@@ -44109,6 +44153,8 @@ function createStreamRenderer() {
44109
44153
 
44110
44154
  `);
44111
44155
  events.message(b.text);
44156
+ } else if (b?.type === "thinking" && str2(b.thinking).trim()) {
44157
+ events.progressSnapshot("thinking", str2(b.thinking));
44112
44158
  } else if (b?.type === "tool_use" && typeof b.name === "string") {
44113
44159
  out.push(`\u23FA ${b.name}${argHint(b.input, ARG_KEYS)}
44114
44160
  `);
@@ -44128,8 +44174,8 @@ function createStreamRenderer() {
44128
44174
  return out.join("");
44129
44175
  }
44130
44176
  case "user": {
44131
- const content = obj2(ev.message).content;
44132
- for (const raw of Array.isArray(content) ? content : []) {
44177
+ const content2 = obj2(ev.message).content;
44178
+ for (const raw of Array.isArray(content2) ? content2 : []) {
44133
44179
  const b = obj2(raw);
44134
44180
  if (b.type !== "tool_result" || plans.has(str2(b.tool_use_id))) continue;
44135
44181
  if (subagents.has(str2(b.tool_use_id))) {
@@ -44173,8 +44219,20 @@ function createStreamRenderer() {
44173
44219
  if (ev.subtype === "task_notification" && subagents.has(str2(ev.tool_use_id))) {
44174
44220
  endSubagent(str2(ev.tool_use_id), str2(ev.status) === "completed" ? "completed" : "failed");
44175
44221
  }
44176
- if (ev.subtype === "task_notification" && backgrounded.has(str2(ev.task_id)) && str2(ev.summary)) {
44177
- return `\u23FA ${str2(ev.summary)}
44222
+ const task = str2(ev.task_id);
44223
+ if (ev.subtype === "task_progress" && task) {
44224
+ const usage2 = obj2(ev.usage);
44225
+ const previous = taskUsage.get(task) ?? { tokens: 0, tools: 0 };
44226
+ const tokens = Math.max(previous.tokens, Number(usage2.total_tokens) || 0);
44227
+ const tools = Math.max(previous.tools, Number(usage2.tool_uses) || 0);
44228
+ if (tokens > previous.tokens || tools > previous.tools) {
44229
+ taskUsage.set(task, { tokens, tools });
44230
+ events.progress();
44231
+ }
44232
+ }
44233
+ if (ev.subtype === "task_notification" && backgrounded.delete(task)) {
44234
+ events.progress();
44235
+ if (str2(ev.summary)) return `\u23FA ${str2(ev.summary)}
44178
44236
  `;
44179
44237
  }
44180
44238
  return "";
@@ -44514,23 +44572,20 @@ function createCodexStreamRenderer(carried = false) {
44514
44572
  const started = /* @__PURE__ */ new Set();
44515
44573
  const background = createBackgroundTasks();
44516
44574
  const subagents = /* @__PURE__ */ new Set();
44517
- const collabItems = /* @__PURE__ */ new Set();
44518
- const collab = (item, done) => {
44575
+ const collab = (item) => {
44519
44576
  if (item.type !== "collab_tool_call") return;
44520
- const key = `${str2(item.id)}:${done}`;
44521
- if (collabItems.has(key)) return;
44522
- collabItems.add(key);
44523
44577
  for (const [id, raw] of Object.entries(obj2(item.agents_states))) {
44524
44578
  const state = obj2(raw);
44525
44579
  const status2 = str2(state.status);
44526
44580
  if (!["pending_init", "running", "completed", "interrupted", "errored", "shutdown", "not_found"].includes(status2)) continue;
44527
44581
  const previous = background.results().find((t2) => t2.id === id);
44528
- if (["shutdown", "not_found"].includes(status2) && previous && previous.status !== "running") continue;
44582
+ const running = status2 === "pending_init" || status2 === "running";
44583
+ if ((running || ["shutdown", "not_found"].includes(status2)) && previous && previous.status !== "running") continue;
44529
44584
  if (!subagents.has(id)) {
44530
44585
  subagents.add(id);
44531
44586
  events.subagent(`agent:${id}`, str2(item.prompt) || "Agent");
44532
44587
  }
44533
- const running = status2 === "pending_init" || status2 === "running";
44588
+ if (running) events.progressSnapshot(`agent:${id}`, str2(state.message));
44534
44589
  const failed = !running && status2 !== "completed";
44535
44590
  if (background.update(id, running ? "running" : failed ? "failed" : "completed", str2(state.message)) && !running) {
44536
44591
  events.toolResult(`agent:${id}`, failed ? "failed" : "completed", str2(state.message));
@@ -44563,15 +44618,21 @@ function createCodexStreamRenderer(carried = false) {
44563
44618
  if (!threadId) threadId = str2(ev.thread_id).trim() || void 0;
44564
44619
  return "";
44565
44620
  case "item.started":
44566
- collab(obj2(ev.item), false);
44621
+ collab(obj2(ev.item));
44567
44622
  itemEvents(events, started, obj2(ev.item), false);
44568
44623
  return renderStarted(obj2(ev.item));
44569
- case "item.updated":
44570
- if (obj2(ev.item).type === "todo_list") itemEvents(events, started, obj2(ev.item), false);
44624
+ case "item.updated": {
44625
+ const item = obj2(ev.item);
44626
+ collab(item);
44627
+ if (item.type === "todo_list") itemEvents(events, started, item, false);
44628
+ if (item.type === "command_execution" && started.has(str2(item.id))) {
44629
+ events.progressSnapshot(`command:${str2(item.id)}`, str2(item.aggregated_output));
44630
+ }
44571
44631
  return "";
44632
+ }
44572
44633
  case "item.completed": {
44573
44634
  const item = obj2(ev.item);
44574
- collab(item, true);
44635
+ collab(item);
44575
44636
  if (item.type === "mcp_tool_call" && !/view_image|read_image|open_image/.test(str2(item.tool))) {
44576
44637
  const content = obj2(item.result).content;
44577
44638
  for (const block of Array.isArray(content) ? content : []) {
@@ -44840,7 +44901,8 @@ function createKimiStreamRenderer(cwd, resumeId) {
44840
44901
  `;
44841
44902
  switch (row.role) {
44842
44903
  case "assistant": {
44843
- events.progress();
44904
+ const thought = str2(row.reasoning_content);
44905
+ if (thought) events.progressSnapshot("reasoning", thought);
44844
44906
  const said = str2(row.content).trim();
44845
44907
  if (said) final = said;
44846
44908
  if (said) events.message(said);
@@ -44937,7 +44999,7 @@ function modelOf2(ref) {
44937
44999
  const provider = str2(model.providerId);
44938
45000
  return provider ? `${provider}/${id}` : id;
44939
45001
  }
44940
- function createParts(tail) {
45002
+ function createParts(tail, activity) {
44941
45003
  const written = /* @__PURE__ */ new Map();
44942
45004
  const tools = /* @__PURE__ */ new Set();
44943
45005
  const named = /* @__PURE__ */ new Map();
@@ -44946,6 +45008,7 @@ function createParts(tail) {
44946
45008
  const fresh = text2.startsWith(before) ? text2.slice(before.length) : text2;
44947
45009
  if (!fresh) return;
44948
45010
  written.set(partId, text2);
45011
+ activity();
44949
45012
  if (kind === "reasoning" || kind === "thought") tail.thought(fresh);
44950
45013
  else tail.text(fresh);
44951
45014
  };
@@ -44957,7 +45020,10 @@ function createParts(tail) {
44957
45020
  const partId = str2(part.partId);
44958
45021
  if (type === "text" || type === "reasoning" || type === "thought") {
44959
45022
  if (partId) say(partId, type, str2(part.text));
44960
- else tail.text(str2(part.text));
45023
+ else if (str2(part.text)) {
45024
+ activity();
45025
+ tail.text(str2(part.text));
45026
+ }
44961
45027
  return;
44962
45028
  }
44963
45029
  if (type !== "tool") return;
@@ -44981,14 +45047,18 @@ function createParts(tail) {
44981
45047
  const delta = str2(event2.delta);
44982
45048
  if (!delta) return;
44983
45049
  written.set(partId, (written.get(partId) ?? "") + delta);
45050
+ activity();
44984
45051
  if (field === "reasoning") tail.thought(delta);
44985
45052
  else tail.text(delta);
44986
45053
  },
44987
45054
  /** A piece of the turn, as `model.streaming` sends it. */
44988
45055
  streaming(payload) {
44989
45056
  const kind = str2(payload.kind);
44990
- if (kind === "text_delta") return tail.text(str2(payload.delta));
44991
- if (kind === "reasoning_delta") return tail.thought(str2(payload.delta));
45057
+ const delta = str2(payload.delta);
45058
+ if (delta && (kind === "text_delta" || kind === "reasoning_delta")) {
45059
+ activity();
45060
+ return kind === "text_delta" ? tail.text(delta) : tail.thought(delta);
45061
+ }
44992
45062
  if (kind !== "tool_call") return;
44993
45063
  const callId = str2(payload.toolCallId);
44994
45064
  const name = str2(payload.toolName) || "tool";
@@ -45028,7 +45098,7 @@ function stopped(io, why) {
45028
45098
  }
45029
45099
  async function oneTurn2(io, options) {
45030
45100
  const tail = createTail(io.log);
45031
- const parts = createParts(tail);
45101
+ const parts = createParts(tail, () => io.activity?.());
45032
45102
  const activityEvents = createEventCollector();
45033
45103
  const activeCalls = /* @__PURE__ */ new Set();
45034
45104
  let live = false;
@@ -45055,7 +45125,6 @@ async function oneTurn2(io, options) {
45055
45125
  const part = obj2(payload.part);
45056
45126
  const state = obj2(part.state);
45057
45127
  const type = str2(envelope.type);
45058
- if (["part.delta", "model.streaming"].includes(type) && str2(payload.delta)) io.activity?.();
45059
45128
  const id = str2(payload.toolCallId) || str2(part.callId) || str2(part.partId);
45060
45129
  const name = str2(payload.toolName) || str2(part.tool) || str2(state.title);
45061
45130
  if (id && name && !activeCalls.has(id)) {
@@ -45064,7 +45133,21 @@ async function oneTurn2(io, options) {
45064
45133
  else activityEvents.toolCall(id, name, /^(?:bash|shell|execute|run_command|terminal)$/i.test(name) ? "execute" : "other");
45065
45134
  }
45066
45135
  const status2 = str2(state.status) || str2(payload.kind);
45067
- if (id && ["completed", "error", "result"].includes(status2)) activityEvents.toolResult(id, status2 === "error" ? "failed" : "completed", "");
45136
+ const output2 = str2(state.output) || str2(payload.output);
45137
+ if (type === "part.delta" && payload.field === "output") {
45138
+ const before = activityEvents.activity();
45139
+ activityEvents.progressSnapshot(id || str2(payload.partId), str2(payload.delta));
45140
+ if (activityEvents.activity() > before) io.activity?.();
45141
+ }
45142
+ if (id && ["completed", "error", "result"].includes(status2)) {
45143
+ activityEvents.toolResult(id, status2 === "error" ? "failed" : "completed", output2);
45144
+ } else if (id && output2) {
45145
+ activityEvents.update({
45146
+ sessionUpdate: "tool_call_update",
45147
+ toolCallId: id,
45148
+ content: [{ type: "content", content: { text: output2 } }]
45149
+ });
45150
+ }
45068
45151
  for (const e of activityEvents.events()) io.event?.(e);
45069
45152
  }
45070
45153
  event(envelope, parts, tail, live, ended);
@@ -45133,6 +45216,7 @@ async function oneTurn2(io, options) {
45133
45216
  });
45134
45217
  const before = io.resumeId ? await tokensOf(rpc, sessionId) : ZERO_USAGE;
45135
45218
  live = true;
45219
+ io.event?.({ kind: "phase", data: { phase: "submitted", at: (/* @__PURE__ */ new Date()).toISOString() } });
45136
45220
  const accepted = await rpc.call("session/send", { sessionId, content: io.prompt });
45137
45221
  if (accepted.accepted === false) throw new Error("the agent would not take the prompt");
45138
45222
  const done = await finished;
@@ -45214,9 +45298,8 @@ function decide2(params, tail) {
45214
45298
 
45215
45299
  // ../cli/src/lib/agent/idle.ts
45216
45300
  var IDLE_MS = 5 * 6e4;
45217
- var IDLE_ERROR = "No response for 5 minutes (idle timeout).";
45301
+ var IDLE_ERROR = "No verifiable progress for 5 minutes (idle timeout).";
45218
45302
  var IDLE_FAILURE = { code: "idle_timeout", source: "runtime", summary: IDLE_ERROR };
45219
- var PROVIDER_RETRY_MS = { announcement: 10 * 6e4, episode: 30 * 6e4 };
45220
45303
 
45221
45304
  // ../cli/src/lib/agent/wire/codex.ts
45222
45305
  import { randomUUID } from "node:crypto";
@@ -45545,6 +45628,7 @@ async function run(io, options, count2) {
45545
45628
  const offered = /* @__PURE__ */ new Map();
45546
45629
  const snapshot = (w) => JSON.stringify([w.threadId, w.processId, w.status, w.exitCode, w.result]);
45547
45630
  const childEvents = /* @__PURE__ */ new Map();
45631
+ const freshOutput = progressSnapshots();
45548
45632
  const seenItems = /* @__PURE__ */ new Set();
45549
45633
  const completedTurns = /* @__PURE__ */ new Set();
45550
45634
  const historicalTurns = /* @__PURE__ */ new Set();
@@ -45579,6 +45663,9 @@ async function run(io, options, count2) {
45579
45663
  io.stdout.off("close", closed);
45580
45664
  io.stdin.off("error", inputFailed);
45581
45665
  if (settlement) flushMessages(work.work().some((w) => !w.intentionalStop && !["running", "unknown"].includes(w.status) && presented.get(w.id) !== snapshot(w)));
45666
+ if (classified?.code === "codex_ownership_unconfirmed") {
45667
+ cleanup = { ...cleanup, status: "unconfirmed", detail: classified.detail ?? classified.summary };
45668
+ }
45582
45669
  cleanup.items = work.work().map(({ id, threadId: threadId2, processId, status: status3, disposition }) => ({ id, threadId: threadId2, processId, status: status3, disposition }));
45583
45670
  io.log(renderer.flush());
45584
45671
  const usage = ownUsage(total, baseline);
@@ -45639,7 +45726,9 @@ async function run(io, options, count2) {
45639
45726
  io.idleSignal?.addEventListener("abort", idle, { once: true });
45640
45727
  const childUpdates = () => {
45641
45728
  for (const w of work.entries.values()) {
45642
- if (w.kind !== "agent" || childEvents.get(w.id) === w.status) continue;
45729
+ if (w.kind !== "agent") continue;
45730
+ if (w.status === "running" && freshOutput(w.id, toolOutput(w.result))) io.activity?.();
45731
+ if (childEvents.get(w.id) === w.status) continue;
45643
45732
  if (!childEvents.has(w.id)) io.event?.({ kind: "tool_call", data: { toolCallId: w.id, title: "Agent", kind: "other", status: "in_progress", subagent: true } });
45644
45733
  if (w.status !== "running") io.event?.({ kind: "tool_call_update", data: { toolCallId: w.id, status: w.status === "completed" ? "completed" : "failed", result: w.result } });
45645
45734
  childEvents.set(w.id, w.status);
@@ -45877,7 +45966,26 @@ async function run(io, options, count2) {
45877
45966
  armCleanup();
45878
45967
  if (source === threadId && obj2(p.item).type !== "agentMessage") item(obj2(p.item), msg.method === "item/completed", false);
45879
45968
  }
45880
- if (source !== threadId) {
45969
+ const turnId = str2(p.turnId) || str2(obj2(p.turn).id);
45970
+ const main = source === threadId;
45971
+ const live = main ? !historicalTurns.has(turnId) && (!currentTurn2 || !turnId || currentTurn2 === turnId) : work.entries.get(`agent:${source}`)?.status === "running";
45972
+ const delta = str2(p.delta);
45973
+ if (submitted && live && delta) {
45974
+ if (["item/agentMessage/delta", "item/plan/delta", "item/reasoning/summaryTextDelta", "item/reasoning/textDelta"].includes(msg.method ?? "")) {
45975
+ if (main) {
45976
+ if (msg.method?.startsWith("item/reasoning/")) thinking();
45977
+ else recovered();
45978
+ }
45979
+ io.activity?.();
45980
+ }
45981
+ const terminal = terminalKey(source, str2(p.itemId));
45982
+ if (msg.method === "item/commandExecution/outputDelta" && work.entries.get(terminal)?.status === "running" && freshOutput(terminal, toolOutput(delta))) io.activity?.();
45983
+ }
45984
+ if (!main) {
45985
+ if (live && msg.method === "item/completed") {
45986
+ const item2 = obj2(p.item);
45987
+ if (freshOutput(`${source}:${str2(item2.id)}`, toolOutput(str2(item2.text) || str2(item2.aggregatedOutput)))) io.activity?.();
45988
+ }
45881
45989
  if (msg.method === "turn/completed") {
45882
45990
  work.observeTurn(source, obj2(p.turn));
45883
45991
  armCleanup();
@@ -45885,13 +45993,7 @@ async function run(io, options, count2) {
45885
45993
  childUpdates();
45886
45994
  return;
45887
45995
  }
45888
- const turnId = str2(p.turnId) || str2(obj2(p.turn).id);
45889
- if (historicalTurns.has(turnId) || currentTurn2 && turnId && currentTurn2 !== turnId) return;
45890
- if (submitted && ["item/agentMessage/delta", "item/plan/delta", "item/reasoning/summaryTextDelta", "item/reasoning/textDelta"].includes(msg.method ?? "") && str2(p.delta)) {
45891
- if (msg.method?.startsWith("item/reasoning/")) thinking();
45892
- else recovered();
45893
- io.activity?.();
45894
- }
45996
+ if (!live) return;
45895
45997
  if (msg.method === "turn/started") {
45896
45998
  if (!submitted || completedTurns.has(turnId)) return;
45897
45999
  currentTurn2 = turnId;
@@ -45993,7 +46095,6 @@ async function run(io, options, count2) {
45993
46095
  waiting = true;
45994
46096
  io.event?.({ kind: "log", data: { text: failure2.summary } });
45995
46097
  }
45996
- io.activity?.();
45997
46098
  await delay(500, void 0, { signal: io.signal });
45998
46099
  preparingUntil = Date.now() + CONVERSATION_MS.prepare;
45999
46100
  }
@@ -47450,7 +47551,7 @@ var removeFolder = (machineId2, project) => request("POST", `/v1/runner/folders/
47450
47551
  var import_yaml8 = __toESM(require_dist(), 1);
47451
47552
 
47452
47553
  // ../cli/src/lib/agent/cloud-studios.ts
47453
- import { createHash as createHash5, randomUUID as randomUUID2 } from "node:crypto";
47554
+ import { createHash as createHash6, randomUUID as randomUUID2 } from "node:crypto";
47454
47555
  import fs17 from "node:fs";
47455
47556
  import path21 from "node:path";
47456
47557
 
@@ -47588,7 +47689,7 @@ function readJson(file2) {
47588
47689
  return null;
47589
47690
  }
47590
47691
  }
47591
- var filesHash = (files) => createHash5("sha256").update(hashInput(files)).digest("hex");
47692
+ var filesHash = (files) => createHash6("sha256").update(hashInput(files)).digest("hex");
47592
47693
  var readVersion = (id, version) => {
47593
47694
  const held2 = readJson(versionFile(id, version));
47594
47695
  return held2?.id === id && held2.version === version && isStudioFiles(held2.files) && (!held2.filesSha256 || filesHash(held2.files) === held2.filesSha256) ? held2 : null;
@@ -47816,7 +47917,7 @@ var holdsDir = () => path24.join(runnerHome(), "holds");
47816
47917
  var holdFile = (dir) => path24.join(holdsDir(), `${crypto4.createHash("sha256").update(dir).digest("hex")}.${process.pid}`);
47817
47918
  function paused(dir) {
47818
47919
  try {
47819
- const file2 = path24.join(projectStateDir(cloudBoardOf(dir)), SESSIONS_FILE);
47920
+ const file2 = path24.join(projectStateDir(path24.join(akbDir(dir), "kanban")), SESSIONS_FILE);
47820
47921
  const held2 = JSON.parse(fs20.readFileSync(file2, "utf8"));
47821
47922
  return (held2.deliveries ?? []).some((d) => d.status === "active");
47822
47923
  } catch {
@@ -47842,14 +47943,14 @@ function busy(dir) {
47842
47943
  }
47843
47944
  function conflicted(dir) {
47844
47945
  try {
47845
- return pendingConflicts(cloudBoardOf(dir)).length > 0;
47946
+ return pendingConflicts(path24.join(dir, ".akb", "kanban")).length > 0;
47846
47947
  } catch {
47847
47948
  return true;
47848
47949
  }
47849
47950
  }
47850
47951
  function legacyState(dir) {
47851
47952
  try {
47852
- return hasLegacyProjectState(cloudBoardOf(dir));
47953
+ return hasLegacyProjectState(path24.join(akbDir(dir), "kanban"));
47853
47954
  } catch {
47854
47955
  return true;
47855
47956
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wildcrane-runner",
3
- "version": "0.6.120",
3
+ "version": "0.6.122",
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/",