wildcrane-runner 0.6.80 → 0.6.82
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/akb/dist/kanban.mjs +9277 -5119
- package/dist/akb/package.json +1 -1
- package/dist/akb-proxy.mjs +1 -1
- package/dist/codex-proxy.mjs +104 -35
- package/dist/codex-retained.mjs +56 -34
- package/dist/flow-worker-main.mjs +10 -7
- package/dist/launcher.mjs +7 -5
- package/dist/plugin.mjs +7 -5
- package/dist/runner.mjs +384 -268
- package/dist/settings.mjs +7 -5
- package/package.json +1 -1
package/dist/akb/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"wildcrane","version":"0.11.
|
|
1
|
+
{"name":"wildcrane","version":"0.11.66","akbContract":17,"type":"module","private":true}
|
package/dist/akb-proxy.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// wildcrane-runner 0.6.
|
|
1
|
+
// wildcrane-runner 0.6.82 — 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;
|
package/dist/codex-proxy.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// wildcrane-runner 0.6.
|
|
1
|
+
// wildcrane-runner 0.6.82 — 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;
|
|
@@ -27809,6 +27809,9 @@ function readPrivate(file) {
|
|
|
27809
27809
|
throw error;
|
|
27810
27810
|
}
|
|
27811
27811
|
}
|
|
27812
|
+
function writeLease(backend, thread, value) {
|
|
27813
|
+
writePrivate(leaseFile(backend, thread), { ...value, thread });
|
|
27814
|
+
}
|
|
27812
27815
|
async function nativeConnection(backend, onMessage) {
|
|
27813
27816
|
const unix = backend.endpoint.startsWith("unix://");
|
|
27814
27817
|
const dispatcher = unix ? new import_undici2.Agent({ connect: { socketPath: backend.endpoint.slice(7) } }) : void 0;
|
|
@@ -27862,15 +27865,88 @@ async function backgroundTerminals(rpc, threadId) {
|
|
|
27862
27865
|
if (seen.has(cursor)) throw Error("Codex repeated a terminal cursor.");
|
|
27863
27866
|
seen.add(cursor);
|
|
27864
27867
|
const page = await rpc.call("thread/backgroundTerminals/list", { threadId, ...cursor ? { cursor } : {} });
|
|
27865
|
-
|
|
27868
|
+
if (!Array.isArray(page.data) || page.nextCursor != null && typeof page.nextCursor !== "string") throw Error("Codex background terminal state is unconfirmed.");
|
|
27869
|
+
for (const value of page.data) result.push({ ...obj(value), threadId });
|
|
27866
27870
|
cursor = page.nextCursor;
|
|
27867
27871
|
} while (cursor);
|
|
27868
27872
|
return result;
|
|
27869
27873
|
}
|
|
27874
|
+
async function releaseNativeThread(connection, threadId, turnId, stopWork, unloading) {
|
|
27875
|
+
const missing = (error) => error instanceof RpcError && /thread not (?:found|loaded)/i.test(error.message);
|
|
27876
|
+
try {
|
|
27877
|
+
await bounded((async () => {
|
|
27878
|
+
if (stopWork) {
|
|
27879
|
+
if (turnId) {
|
|
27880
|
+
try {
|
|
27881
|
+
await connection.rpc.call("turn/interrupt", { threadId, turnId });
|
|
27882
|
+
} catch (error) {
|
|
27883
|
+
if (!missing(error)) throw error;
|
|
27884
|
+
}
|
|
27885
|
+
}
|
|
27886
|
+
try {
|
|
27887
|
+
await connection.rpc.call("thread/backgroundTerminals/clean", { threadId });
|
|
27888
|
+
} catch (error) {
|
|
27889
|
+
if (!(error instanceof RpcError) || error.code !== -32601 && !missing(error)) throw error;
|
|
27890
|
+
}
|
|
27891
|
+
}
|
|
27892
|
+
const unloaded = new Promise((resolve) => unloading.set(threadId, resolve));
|
|
27893
|
+
let result;
|
|
27894
|
+
try {
|
|
27895
|
+
result = await connection.rpc.call("thread/unsubscribe", { threadId });
|
|
27896
|
+
} catch (error) {
|
|
27897
|
+
if (!missing(error)) throw error;
|
|
27898
|
+
result = { status: "notLoaded" };
|
|
27899
|
+
}
|
|
27900
|
+
if (result.status === "unsubscribed") await unloaded;
|
|
27901
|
+
else if (result.status !== "notLoaded") {
|
|
27902
|
+
const snapshot = obj((await connection.rpc.call("thread/read", { threadId })).thread);
|
|
27903
|
+
if (obj(snapshot.status).type !== "notLoaded") throw Error("Codex thread unload is unconfirmed.");
|
|
27904
|
+
}
|
|
27905
|
+
})(), CODEX_TIMEOUT, "Codex thread cleanup timed out; ownership remains unconfirmed.");
|
|
27906
|
+
} finally {
|
|
27907
|
+
unloading.delete(threadId);
|
|
27908
|
+
}
|
|
27909
|
+
}
|
|
27910
|
+
|
|
27911
|
+
// src/codex-ownership.ts
|
|
27912
|
+
function executionOwner(environment) {
|
|
27913
|
+
let execution = {};
|
|
27914
|
+
try {
|
|
27915
|
+
execution = obj(JSON.parse(environment.AI4KANBAN_EXECUTION ?? "{}"));
|
|
27916
|
+
} catch {
|
|
27917
|
+
}
|
|
27918
|
+
return { run: environment.KANBAN_RUN?.trim() || void 0, task: environment.AI4KANBAN_TASK?.trim() || void 0, job: str(execution.job).trim() || void 0 };
|
|
27919
|
+
}
|
|
27920
|
+
function ownershipConflict(thread, requester, owner, status) {
|
|
27921
|
+
const describe = (value) => ({ run: value?.run ?? "unknown", task: value?.task ?? "unknown", job: value?.job ?? "unknown", pid: value?.pid ?? "unknown", lease: value?.lease ?? "unknown" });
|
|
27922
|
+
return Error(`Codex thread is already in use by another run. ${JSON.stringify({ thread, requester: describe(requester), owner: describe(owner), status })}`);
|
|
27923
|
+
}
|
|
27924
|
+
async function inspectThread(rpc, threadId) {
|
|
27925
|
+
let snapshot;
|
|
27926
|
+
try {
|
|
27927
|
+
snapshot = obj((await rpc.call("thread/read", { threadId })).thread);
|
|
27928
|
+
} catch (error) {
|
|
27929
|
+
if (!(error instanceof RpcError) || !/thread not (?:found|loaded)|no rollout found/i.test(error.message)) throw error;
|
|
27930
|
+
let cursor;
|
|
27931
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27932
|
+
do {
|
|
27933
|
+
const page = await rpc.call("thread/loaded/list", { ...cursor ? { cursor } : {} });
|
|
27934
|
+
if (!Array.isArray(page.data) || page.data.some((id) => typeof id !== "string") || page.nextCursor != null && typeof page.nextCursor !== "string") throw Error("Codex loaded threads are unconfirmed.");
|
|
27935
|
+
if (page.data.includes(threadId)) return "unverified";
|
|
27936
|
+
cursor = str(page.nextCursor) || void 0;
|
|
27937
|
+
if (cursor && seen.has(cursor)) throw Error("Codex repeated a loaded-thread cursor.");
|
|
27938
|
+
if (cursor) seen.add(cursor);
|
|
27939
|
+
} while (cursor);
|
|
27940
|
+
return "notLoaded";
|
|
27941
|
+
}
|
|
27942
|
+
const status = str(obj(snapshot.status).type);
|
|
27943
|
+
if (status === "idle" && (await backgroundTerminals(rpc, threadId)).length) return "background-work";
|
|
27944
|
+
return status;
|
|
27945
|
+
}
|
|
27870
27946
|
|
|
27871
27947
|
// src/codex-execution.ts
|
|
27872
27948
|
async function codexExecution(backend, config, environment, cwd, send) {
|
|
27873
|
-
const identity = processIdentity();
|
|
27949
|
+
const identity = { ...processIdentity(), ...executionOwner(environment) };
|
|
27874
27950
|
const lease = crypto2.randomUUID();
|
|
27875
27951
|
const settings = crypto2.createHash("sha256").update(JSON.stringify([cwd, config])).digest("hex");
|
|
27876
27952
|
const threads = /* @__PURE__ */ new Set(), active = /* @__PURE__ */ new Map(), requests = /* @__PURE__ */ new Set();
|
|
@@ -27889,15 +27965,15 @@ async function codexExecution(backend, config, environment, cwd, send) {
|
|
|
27889
27965
|
if (!id) return;
|
|
27890
27966
|
const file = leaseFile(backend, id);
|
|
27891
27967
|
const release = tryLock(file + ".lock");
|
|
27892
|
-
if (!release) throw
|
|
27968
|
+
if (!release) throw ownershipConflict(id, state(), readPrivate(file), "ownership-transfer; try again");
|
|
27893
27969
|
try {
|
|
27894
27970
|
const current = readPrivate(file);
|
|
27895
|
-
if (current && current.lease !== lease && current.lease !== previous?.lease) throw
|
|
27971
|
+
if (current && current.lease !== lease && current.lease !== previous?.lease) throw ownershipConflict(id, state(), current, liveLease(current) ? "owner-alive" : "unverified");
|
|
27896
27972
|
if (loaded) threads.add(id);
|
|
27897
|
-
|
|
27973
|
+
writeLease(backend, id, { ...state(), ...previous?.retained ? { retained: previous.retained, adopting: previous.lease } : {} });
|
|
27898
27974
|
for (const thread of threads) {
|
|
27899
27975
|
const owner = readPrivate(leaseFile(backend, thread));
|
|
27900
|
-
if (owner?.lease === lease)
|
|
27976
|
+
if (owner?.lease === lease) writeLease(backend, thread, { ...owner, threads: [...threads] });
|
|
27901
27977
|
}
|
|
27902
27978
|
} finally {
|
|
27903
27979
|
release();
|
|
@@ -27914,13 +27990,15 @@ async function codexExecution(backend, config, environment, cwd, send) {
|
|
|
27914
27990
|
const key = (value) => JSON.stringify([value.threadId, value.itemId, value.processId]);
|
|
27915
27991
|
if (actual.length !== previous.retained.kept.length || actual.some((value) => !previous.retained.kept.some((item) => key(item) === key(value)))) throw Error("The retained Codex services changed; no new work was submitted.");
|
|
27916
27992
|
} else {
|
|
27917
|
-
if (liveLease(previous)) throw
|
|
27993
|
+
if (liveLease(previous)) throw ownershipConflict(id, state(), previous, "owner-alive");
|
|
27918
27994
|
for (const thread of /* @__PURE__ */ new Set([id, ...previous.threads])) {
|
|
27919
|
-
|
|
27920
|
-
|
|
27921
|
-
|
|
27922
|
-
|
|
27923
|
-
|
|
27995
|
+
let status;
|
|
27996
|
+
try {
|
|
27997
|
+
status = await inspectThread(connection.rpc, thread);
|
|
27998
|
+
} catch {
|
|
27999
|
+
throw ownershipConflict(thread, state(), previous, "unverified");
|
|
28000
|
+
}
|
|
28001
|
+
if (status !== "idle" && status !== "notLoaded") throw ownershipConflict(thread, state(), previous, status === "active" || status === "background-work" ? "work still running; automatic replay refused" : "unverified");
|
|
27924
28002
|
}
|
|
27925
28003
|
}
|
|
27926
28004
|
}
|
|
@@ -28007,31 +28085,22 @@ async function codexExecution(backend, config, environment, cwd, send) {
|
|
|
28007
28085
|
}
|
|
28008
28086
|
};
|
|
28009
28087
|
const cleanup = async () => {
|
|
28010
|
-
await Promise.allSettled(pending);
|
|
28088
|
+
await bounded(Promise.allSettled(pending), CODEX_TIMEOUT, "Codex pending requests did not settle.");
|
|
28011
28089
|
if (keeper) return;
|
|
28012
28090
|
for (const id of requests) connection.rpc.refuse(id, "Execution disconnected.");
|
|
28013
|
-
|
|
28014
|
-
if (!owned(id))
|
|
28015
|
-
|
|
28016
|
-
if (active.has(id)) await connection.rpc.call("turn/interrupt", { threadId: id, turnId: active.get(id) });
|
|
28017
|
-
try {
|
|
28018
|
-
await connection.rpc.call("thread/backgroundTerminals/clean", { threadId: id });
|
|
28019
|
-
} catch (error) {
|
|
28020
|
-
if (!(error instanceof RpcError) || ![-32601].includes(error.code) && !/thread not found/i.test(error.message)) throw error;
|
|
28021
|
-
}
|
|
28022
|
-
}
|
|
28023
|
-
const unloaded = new Promise((resolve) => unloading.set(id, resolve));
|
|
28024
|
-
const result = await connection.rpc.call("thread/unsubscribe", { threadId: id });
|
|
28025
|
-
if (result.status === "unsubscribed") await unloaded;
|
|
28026
|
-
unloading.delete(id);
|
|
28091
|
+
const results = await Promise.allSettled([...threads].map(async (id) => {
|
|
28092
|
+
if (!owned(id)) return;
|
|
28093
|
+
await releaseNativeThread(connection, id, active.get(id), !settled, unloading);
|
|
28027
28094
|
remove(id);
|
|
28028
|
-
}
|
|
28095
|
+
}));
|
|
28096
|
+
const failure = results.find((result) => result.status === "rejected");
|
|
28097
|
+
if (failure?.status === "rejected") throw failure.reason;
|
|
28029
28098
|
};
|
|
28030
28099
|
const close = () => closing ??= (async () => {
|
|
28031
28100
|
try {
|
|
28032
|
-
await
|
|
28101
|
+
await cleanup();
|
|
28033
28102
|
} catch (error) {
|
|
28034
|
-
for (const id of threads) if (owned(id))
|
|
28103
|
+
for (const id of threads) if (owned(id)) writeLease(backend, id, { ...state(), uncertain: true });
|
|
28035
28104
|
send({ method: "wildcrane/cleanup", params: { status: "unconfirmed", lease } });
|
|
28036
28105
|
console.error(error instanceof Error ? error.message : String(error));
|
|
28037
28106
|
} finally {
|
|
@@ -28072,7 +28141,7 @@ async function codexExecution(backend, config, environment, cwd, send) {
|
|
|
28072
28141
|
const key = (value) => JSON.stringify([value.threadId, value.itemId, value.processId]);
|
|
28073
28142
|
if (new Set(kept.map(key)).size !== kept.length || actual.length !== kept.length || actual.some((value) => !kept.some((item) => key(item) === key(value)))) throw Error("Codex retained terminal state changed before handoff.");
|
|
28074
28143
|
settled = { root: str(params.threadId), execution: str(params.execution), kept };
|
|
28075
|
-
for (const thread2 of threads)
|
|
28144
|
+
for (const thread2 of threads) writeLease(backend, thread2, state());
|
|
28076
28145
|
if (kept.length) await keep();
|
|
28077
28146
|
send({ id, result: { confirmed: true, instance: backend.instance, lease } });
|
|
28078
28147
|
return;
|
|
@@ -28104,15 +28173,15 @@ async function codexExecution(backend, config, environment, cwd, send) {
|
|
|
28104
28173
|
for (const child of previous.threads) if (child !== thread) {
|
|
28105
28174
|
claim(child, true, previous);
|
|
28106
28175
|
await connection.rpc.call("thread/resume", { threadId: child });
|
|
28107
|
-
|
|
28176
|
+
writeLease(backend, child, state());
|
|
28108
28177
|
}
|
|
28109
28178
|
result.retainedThreads = [...threads].map((id2) => ({ id: id2 }));
|
|
28110
|
-
|
|
28179
|
+
writeLease(backend, thread, state());
|
|
28111
28180
|
}
|
|
28112
28181
|
if (id !== void 0) send({ id, result });
|
|
28113
28182
|
} catch (error) {
|
|
28114
28183
|
if (source && previous?.retained) for (const thread of previous.threads) {
|
|
28115
|
-
if (owned(thread))
|
|
28184
|
+
if (owned(thread)) writeLease(backend, thread, previous);
|
|
28116
28185
|
threads.delete(thread);
|
|
28117
28186
|
}
|
|
28118
28187
|
if (id !== void 0) send({ id, error: { code: error instanceof RpcError ? error.code : -32e3, message: error instanceof Error ? error.message : String(error) } });
|
package/dist/codex-retained.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// wildcrane-runner 0.6.
|
|
1
|
+
// wildcrane-runner 0.6.82 — 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;
|
|
@@ -26673,6 +26673,13 @@ ${captureLines}` : capture.stack;
|
|
|
26673
26673
|
// src/codex-retained.ts
|
|
26674
26674
|
import fs5 from "node:fs";
|
|
26675
26675
|
|
|
26676
|
+
// src/codex-native.ts
|
|
26677
|
+
import crypto from "node:crypto";
|
|
26678
|
+
import fs3 from "node:fs";
|
|
26679
|
+
var import_undici2 = __toESM(require_undici(), 1);
|
|
26680
|
+
import path4 from "node:path";
|
|
26681
|
+
import { PassThrough, Writable } from "node:stream";
|
|
26682
|
+
|
|
26676
26683
|
// ../cli/src/lib/shared/conversation.ts
|
|
26677
26684
|
function bounded(work, ms, reason) {
|
|
26678
26685
|
return new Promise((resolve, reject) => {
|
|
@@ -26687,13 +26694,6 @@ function bounded(work, ms, reason) {
|
|
|
26687
26694
|
});
|
|
26688
26695
|
}
|
|
26689
26696
|
|
|
26690
|
-
// src/codex-native.ts
|
|
26691
|
-
import crypto from "node:crypto";
|
|
26692
|
-
import fs3 from "node:fs";
|
|
26693
|
-
var import_undici2 = __toESM(require_undici(), 1);
|
|
26694
|
-
import path4 from "node:path";
|
|
26695
|
-
import { PassThrough, Writable } from "node:stream";
|
|
26696
|
-
|
|
26697
26697
|
// ../cli/src/lib/agent/connection-process.ts
|
|
26698
26698
|
import { spawnSync } from "node:child_process";
|
|
26699
26699
|
|
|
@@ -26971,6 +26971,9 @@ function readPrivate(file) {
|
|
|
26971
26971
|
throw error;
|
|
26972
26972
|
}
|
|
26973
26973
|
}
|
|
26974
|
+
function writeLease(backend, thread, value) {
|
|
26975
|
+
writePrivate(leaseFile(backend, thread), { ...value, thread });
|
|
26976
|
+
}
|
|
26974
26977
|
async function nativeConnection(backend, onMessage) {
|
|
26975
26978
|
const unix = backend.endpoint.startsWith("unix://");
|
|
26976
26979
|
const dispatcher = unix ? new import_undici2.Agent({ connect: { socketPath: backend.endpoint.slice(7) } }) : void 0;
|
|
@@ -27017,17 +27020,41 @@ async function initializeNative(connection) {
|
|
|
27017
27020
|
connection.rpc.notify("initialized");
|
|
27018
27021
|
return result;
|
|
27019
27022
|
}
|
|
27020
|
-
async function
|
|
27021
|
-
const
|
|
27022
|
-
|
|
27023
|
-
|
|
27024
|
-
|
|
27025
|
-
|
|
27026
|
-
|
|
27027
|
-
|
|
27028
|
-
|
|
27029
|
-
|
|
27030
|
-
|
|
27023
|
+
async function releaseNativeThread(connection, threadId, turnId, stopWork, unloading) {
|
|
27024
|
+
const missing = (error) => error instanceof RpcError && /thread not (?:found|loaded)/i.test(error.message);
|
|
27025
|
+
try {
|
|
27026
|
+
await bounded((async () => {
|
|
27027
|
+
if (stopWork) {
|
|
27028
|
+
if (turnId) {
|
|
27029
|
+
try {
|
|
27030
|
+
await connection.rpc.call("turn/interrupt", { threadId, turnId });
|
|
27031
|
+
} catch (error) {
|
|
27032
|
+
if (!missing(error)) throw error;
|
|
27033
|
+
}
|
|
27034
|
+
}
|
|
27035
|
+
try {
|
|
27036
|
+
await connection.rpc.call("thread/backgroundTerminals/clean", { threadId });
|
|
27037
|
+
} catch (error) {
|
|
27038
|
+
if (!(error instanceof RpcError) || error.code !== -32601 && !missing(error)) throw error;
|
|
27039
|
+
}
|
|
27040
|
+
}
|
|
27041
|
+
const unloaded = new Promise((resolve) => unloading.set(threadId, resolve));
|
|
27042
|
+
let result;
|
|
27043
|
+
try {
|
|
27044
|
+
result = await connection.rpc.call("thread/unsubscribe", { threadId });
|
|
27045
|
+
} catch (error) {
|
|
27046
|
+
if (!missing(error)) throw error;
|
|
27047
|
+
result = { status: "notLoaded" };
|
|
27048
|
+
}
|
|
27049
|
+
if (result.status === "unsubscribed") await unloaded;
|
|
27050
|
+
else if (result.status !== "notLoaded") {
|
|
27051
|
+
const snapshot = obj((await connection.rpc.call("thread/read", { threadId })).thread);
|
|
27052
|
+
if (obj(snapshot.status).type !== "notLoaded") throw Error("Codex thread unload is unconfirmed.");
|
|
27053
|
+
}
|
|
27054
|
+
})(), CODEX_TIMEOUT, "Codex thread cleanup timed out; ownership remains unconfirmed.");
|
|
27055
|
+
} finally {
|
|
27056
|
+
unloading.delete(threadId);
|
|
27057
|
+
}
|
|
27031
27058
|
}
|
|
27032
27059
|
|
|
27033
27060
|
// src/settings-control.ts
|
|
@@ -27077,7 +27104,7 @@ async function retain() {
|
|
|
27077
27104
|
state.retained = { ...state.retained, kept: state.retained.kept.filter((item) => item.threadId !== id || item.itemId !== obj(params.item).id) };
|
|
27078
27105
|
for (const thread of initial.threads) {
|
|
27079
27106
|
const current = readPrivate(leaseFile(backend, thread));
|
|
27080
|
-
if (current?.lease === lease && current.pid === process.pid)
|
|
27107
|
+
if (current?.lease === lease && current.pid === process.pid) writeLease(backend, thread, { ...state, retained: state.retained.kept.length ? state.retained : void 0 });
|
|
27081
27108
|
}
|
|
27082
27109
|
if (!state.retained.kept.length) wake();
|
|
27083
27110
|
}
|
|
@@ -27086,7 +27113,7 @@ async function retain() {
|
|
|
27086
27113
|
await initializeNative(connection);
|
|
27087
27114
|
for (const id of initial.threads) await connection.rpc.call("thread/resume", { threadId: id });
|
|
27088
27115
|
if (readPrivate(process.argv[3])?.lease !== lease) throw Error("Codex retained ownership changed during preparation.");
|
|
27089
|
-
for (const id of initial.threads)
|
|
27116
|
+
for (const id of initial.threads) writeLease(backend, id, state);
|
|
27090
27117
|
process.send?.({ ready: lease });
|
|
27091
27118
|
const timer = setInterval(() => {
|
|
27092
27119
|
const current = readPrivate(process.argv[3]);
|
|
@@ -27102,20 +27129,15 @@ async function retain() {
|
|
|
27102
27129
|
closing = true;
|
|
27103
27130
|
clearInterval(timer);
|
|
27104
27131
|
if (transferred) return;
|
|
27105
|
-
await
|
|
27106
|
-
|
|
27107
|
-
|
|
27108
|
-
|
|
27109
|
-
|
|
27110
|
-
|
|
27111
|
-
|
|
27112
|
-
const answer = await connection.rpc.call("thread/unsubscribe", { threadId: id });
|
|
27113
|
-
if (answer.status === "unsubscribed") await closed;
|
|
27114
|
-
if (readPrivate(leaseFile(backend, id))?.lease === lease) fs5.rmSync(leaseFile(backend, id), { force: true });
|
|
27115
|
-
}
|
|
27116
|
-
})(), CODEX_TIMEOUT, "Retained Codex cleanup is unconfirmed.");
|
|
27132
|
+
const results = await Promise.allSettled(initial.threads.map(async (id) => {
|
|
27133
|
+
if (readPrivate(leaseFile(backend, id))?.lease !== lease) return;
|
|
27134
|
+
await releaseNativeThread(connection, id, active.get(id), true, unloaded);
|
|
27135
|
+
if (readPrivate(leaseFile(backend, id))?.lease === lease) fs5.rmSync(leaseFile(backend, id), { force: true });
|
|
27136
|
+
}));
|
|
27137
|
+
const failure = results.find((result) => result.status === "rejected");
|
|
27138
|
+
if (failure?.status === "rejected") throw failure.reason;
|
|
27117
27139
|
} catch (error) {
|
|
27118
|
-
for (const id of initial.threads) if (readPrivate(leaseFile(backend, id))?.lease === lease)
|
|
27140
|
+
for (const id of initial.threads) if (readPrivate(leaseFile(backend, id))?.lease === lease) writeLease(backend, id, { ...state, retained: void 0, uncertain: true });
|
|
27119
27141
|
if (!closing) throw error;
|
|
27120
27142
|
} finally {
|
|
27121
27143
|
connection.close();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// wildcrane-runner 0.6.
|
|
1
|
+
// wildcrane-runner 0.6.82 — 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;
|
|
@@ -112081,7 +112081,7 @@ async function studioSnapshot(workspace, catalog, list3) {
|
|
|
112081
112081
|
}
|
|
112082
112082
|
|
|
112083
112083
|
// src/protocol.ts
|
|
112084
|
-
var AKB_VERSION = true ? "0.11.
|
|
112084
|
+
var AKB_VERSION = true ? "0.11.66" : "0.0.0";
|
|
112085
112085
|
var AKB_CONTRACT = true ? 17 : 0;
|
|
112086
112086
|
|
|
112087
112087
|
// src/secrets.ts
|
|
@@ -114720,7 +114720,7 @@ async function pushAssets(ws, record, before) {
|
|
|
114720
114720
|
}
|
|
114721
114721
|
}
|
|
114722
114722
|
if (why2) {
|
|
114723
|
-
let pin = old ? {
|
|
114723
|
+
let pin = old ? { ...old } : previous?.version ? { artifact: previous.artifact, version: previous.version, ...previous.dependencies ? { dependencies: previous.dependencies } : {} } : null;
|
|
114724
114724
|
if (!pin) {
|
|
114725
114725
|
if (!ws.cloudTask) continue;
|
|
114726
114726
|
let artifact = previous?.artifact;
|
|
@@ -114745,7 +114745,7 @@ async function pushAssets(ws, record, before) {
|
|
|
114745
114745
|
if (!art.ok) return art;
|
|
114746
114746
|
version = art.value.latest_version ?? 0;
|
|
114747
114747
|
}
|
|
114748
|
-
for (const alias of node.aliases) refs[alias] = { artifact: old.artifact, version };
|
|
114748
|
+
for (const alias of node.aliases) refs[alias] = { artifact: old.artifact, version, ...old.dependencies ? { dependencies: old.dependencies } : {} };
|
|
114749
114749
|
}
|
|
114750
114750
|
continue;
|
|
114751
114751
|
}
|
|
@@ -114790,7 +114790,7 @@ async function pushAssets(ws, record, before) {
|
|
|
114790
114790
|
record.assets[alias] = entry;
|
|
114791
114791
|
changed = true;
|
|
114792
114792
|
}
|
|
114793
|
-
refs[alias] = { artifact: entry.artifact, version: entry.version };
|
|
114793
|
+
refs[alias] = { artifact: entry.artifact, version: entry.version, ...entry.dependencies?.length || /\.(html?|css|json|tsx|tmx|tmj|tsj)$/i.test(alias) ? { dependencies: entry.dependencies ?? [] } : {} };
|
|
114794
114794
|
}
|
|
114795
114795
|
if (changed) writeRecord(ws, record);
|
|
114796
114796
|
}
|
|
@@ -116527,7 +116527,7 @@ function createTail(log) {
|
|
|
116527
116527
|
// ../cli/package.json
|
|
116528
116528
|
var package_default = {
|
|
116529
116529
|
name: "wildcrane",
|
|
116530
|
-
version: "0.11.
|
|
116530
|
+
version: "0.11.66",
|
|
116531
116531
|
akbContract: 17,
|
|
116532
116532
|
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.",
|
|
116533
116533
|
keywords: [
|
|
@@ -116572,6 +116572,7 @@ var package_default = {
|
|
|
116572
116572
|
"@types/node": "^22.20.1",
|
|
116573
116573
|
"@types/react": "^19.0.0",
|
|
116574
116574
|
"@types/react-dom": "^19.0.0",
|
|
116575
|
+
"@types/ws": "^8.18.2",
|
|
116575
116576
|
"class-variance-authority": "^0.7.1",
|
|
116576
116577
|
clsx: "^2.1.1",
|
|
116577
116578
|
esbuild: "^0.28.2",
|
|
@@ -116584,7 +116585,8 @@ var package_default = {
|
|
|
116584
116585
|
typescript: "^5.9.3"
|
|
116585
116586
|
},
|
|
116586
116587
|
dependencies: {
|
|
116587
|
-
commander: "^13.1.0"
|
|
116588
|
+
commander: "^13.1.0",
|
|
116589
|
+
ws: "^8.23.0"
|
|
116588
116590
|
}
|
|
116589
116591
|
};
|
|
116590
116592
|
|
|
@@ -122334,6 +122336,7 @@ ${prompt}` : prompt;
|
|
|
122334
122336
|
const { CLAUDE_CODE_MAX_RETRIES: _2, ...env2 } = p2.env;
|
|
122335
122337
|
p2 = { ...p2, env: env2 };
|
|
122336
122338
|
}
|
|
122339
|
+
p2 = { ...p2, env: { ...p2.env, AI4KANBAN_EXECUTION: JSON.stringify({ job: job.id, machine: deps.machineId }), AI4KANBAN_TASK: job.task ?? "" } };
|
|
122337
122340
|
return p2;
|
|
122338
122341
|
};
|
|
122339
122342
|
const carried = !!job.resume && (!job.fork || forks(job.runtime));
|
package/dist/launcher.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// wildcrane-runner 0.6.
|
|
1
|
+
// wildcrane-runner 0.6.82 — 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;
|
|
@@ -26903,8 +26903,8 @@ function saveAlphaUpdates(value) {
|
|
|
26903
26903
|
}
|
|
26904
26904
|
|
|
26905
26905
|
// src/protocol.ts
|
|
26906
|
-
var VERSION = true ? "0.6.
|
|
26907
|
-
var AKB_VERSION = true ? "0.11.
|
|
26906
|
+
var VERSION = true ? "0.6.82" : "0.0.0";
|
|
26907
|
+
var AKB_VERSION = true ? "0.11.66" : "0.0.0";
|
|
26908
26908
|
var EXIT_REFUSED = 10;
|
|
26909
26909
|
var EXIT_OUTDATED = 11;
|
|
26910
26910
|
var EXIT_UPDATE = 12;
|
|
@@ -31141,7 +31141,7 @@ function createTail(log) {
|
|
|
31141
31141
|
// ../cli/package.json
|
|
31142
31142
|
var package_default = {
|
|
31143
31143
|
name: "wildcrane",
|
|
31144
|
-
version: "0.11.
|
|
31144
|
+
version: "0.11.66",
|
|
31145
31145
|
akbContract: 17,
|
|
31146
31146
|
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.",
|
|
31147
31147
|
keywords: [
|
|
@@ -31186,6 +31186,7 @@ var package_default = {
|
|
|
31186
31186
|
"@types/node": "^22.20.1",
|
|
31187
31187
|
"@types/react": "^19.0.0",
|
|
31188
31188
|
"@types/react-dom": "^19.0.0",
|
|
31189
|
+
"@types/ws": "^8.18.2",
|
|
31189
31190
|
"class-variance-authority": "^0.7.1",
|
|
31190
31191
|
clsx: "^2.1.1",
|
|
31191
31192
|
esbuild: "^0.28.2",
|
|
@@ -31198,7 +31199,8 @@ var package_default = {
|
|
|
31198
31199
|
typescript: "^5.9.3"
|
|
31199
31200
|
},
|
|
31200
31201
|
dependencies: {
|
|
31201
|
-
commander: "^13.1.0"
|
|
31202
|
+
commander: "^13.1.0",
|
|
31203
|
+
ws: "^8.23.0"
|
|
31202
31204
|
}
|
|
31203
31205
|
};
|
|
31204
31206
|
|
package/dist/plugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// wildcrane-runner 0.6.
|
|
1
|
+
// wildcrane-runner 0.6.82 — 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;
|
|
@@ -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.
|
|
73853
|
-
var AKB_VERSION = true ? "0.11.
|
|
73852
|
+
var VERSION = true ? "0.6.82" : "0.0.0";
|
|
73853
|
+
var AKB_VERSION = true ? "0.11.66" : "0.0.0";
|
|
73854
73854
|
var EXIT_REFUSED = 10;
|
|
73855
73855
|
var EXIT_OUTDATED = 11;
|
|
73856
73856
|
var EXIT_UPDATE = 12;
|
|
@@ -77722,7 +77722,7 @@ function createTail(log) {
|
|
|
77722
77722
|
// ../cli/package.json
|
|
77723
77723
|
var package_default = {
|
|
77724
77724
|
name: "wildcrane",
|
|
77725
|
-
version: "0.11.
|
|
77725
|
+
version: "0.11.66",
|
|
77726
77726
|
akbContract: 17,
|
|
77727
77727
|
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
77728
|
keywords: [
|
|
@@ -77767,6 +77767,7 @@ var package_default = {
|
|
|
77767
77767
|
"@types/node": "^22.20.1",
|
|
77768
77768
|
"@types/react": "^19.0.0",
|
|
77769
77769
|
"@types/react-dom": "^19.0.0",
|
|
77770
|
+
"@types/ws": "^8.18.2",
|
|
77770
77771
|
"class-variance-authority": "^0.7.1",
|
|
77771
77772
|
clsx: "^2.1.1",
|
|
77772
77773
|
esbuild: "^0.28.2",
|
|
@@ -77779,7 +77780,8 @@ var package_default = {
|
|
|
77779
77780
|
typescript: "^5.9.3"
|
|
77780
77781
|
},
|
|
77781
77782
|
dependencies: {
|
|
77782
|
-
commander: "^13.1.0"
|
|
77783
|
+
commander: "^13.1.0",
|
|
77784
|
+
ws: "^8.23.0"
|
|
77783
77785
|
}
|
|
77784
77786
|
};
|
|
77785
77787
|
|