@kynver-app/runtime 0.1.18 → 0.1.19
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/cli.js +133 -69
- package/dist/cli.js.map +4 -4
- package/dist/index.js +136 -72
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -16,6 +16,10 @@ function fail(message) {
|
|
|
16
16
|
console.error(message);
|
|
17
17
|
process.exit(1);
|
|
18
18
|
}
|
|
19
|
+
function hiddenSpawnOptions(opts) {
|
|
20
|
+
if (process.platform !== "win32") return opts;
|
|
21
|
+
return { windowsHide: true, ...opts };
|
|
22
|
+
}
|
|
19
23
|
function required(value, name) {
|
|
20
24
|
if (!value) fail(`missing ${name}`);
|
|
21
25
|
return value;
|
|
@@ -392,12 +396,12 @@ var DEFAULT_CRITICAL_FREE_BYTES = 15 * 1024 * 1024 * 1024;
|
|
|
392
396
|
var DEFAULT_MAX_USED_PERCENT = 80;
|
|
393
397
|
var DEFAULT_HARD_MAX_USED_PERCENT = 90;
|
|
394
398
|
function observeRunnerDiskGate(input = {}) {
|
|
395
|
-
const
|
|
399
|
+
const path17 = input.diskPath?.trim() || "/";
|
|
396
400
|
const warnBelowBytes = input.diskFreeWarnBytes ?? DEFAULT_WARN_FREE_BYTES;
|
|
397
401
|
const criticalBelowBytes = input.diskFreeCriticalBytes ?? DEFAULT_CRITICAL_FREE_BYTES;
|
|
398
402
|
const maxUsedPercent = input.diskMaxUsedPercent ?? DEFAULT_MAX_USED_PERCENT;
|
|
399
403
|
const hardMaxUsedPercent = input.diskHardMaxUsedPercent ?? DEFAULT_HARD_MAX_USED_PERCENT;
|
|
400
|
-
const stats = statfsSync(
|
|
404
|
+
const stats = statfsSync(path17);
|
|
401
405
|
const freeBytes = Number(stats.bavail) * Number(stats.bsize);
|
|
402
406
|
const totalBytes = Number(stats.blocks) * Number(stats.bsize);
|
|
403
407
|
const usedPercent = totalBytes > 0 ? (totalBytes - freeBytes) / totalBytes * 100 : 100;
|
|
@@ -417,7 +421,7 @@ function observeRunnerDiskGate(input = {}) {
|
|
|
417
421
|
}
|
|
418
422
|
return {
|
|
419
423
|
ok,
|
|
420
|
-
path:
|
|
424
|
+
path: path17,
|
|
421
425
|
freeBytes,
|
|
422
426
|
totalBytes,
|
|
423
427
|
usedPercent,
|
|
@@ -963,8 +967,8 @@ function observeRunnerResourceGate(input) {
|
|
|
963
967
|
}
|
|
964
968
|
|
|
965
969
|
// src/supervisor.ts
|
|
966
|
-
import { existsSync as
|
|
967
|
-
import
|
|
970
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync3 } from "node:fs";
|
|
971
|
+
import path10 from "node:path";
|
|
968
972
|
|
|
969
973
|
// src/prompt.ts
|
|
970
974
|
function buildPrompt(input) {
|
|
@@ -1082,12 +1086,12 @@ var claudeProvider = {
|
|
|
1082
1086
|
"--include-partial-messages",
|
|
1083
1087
|
opts.prompt
|
|
1084
1088
|
],
|
|
1085
|
-
{
|
|
1089
|
+
hiddenSpawnOptions({
|
|
1086
1090
|
cwd: opts.worktreePath,
|
|
1087
1091
|
detached: true,
|
|
1088
1092
|
stdio: ["ignore", stdoutFd, stderrFd],
|
|
1089
1093
|
env: scrubClaudeEnv(process.env)
|
|
1090
|
-
}
|
|
1094
|
+
})
|
|
1091
1095
|
);
|
|
1092
1096
|
closeSync(stdoutFd);
|
|
1093
1097
|
closeSync(stderrFd);
|
|
@@ -1100,33 +1104,80 @@ var claudeProvider = {
|
|
|
1100
1104
|
};
|
|
1101
1105
|
|
|
1102
1106
|
// src/providers/cursor.ts
|
|
1103
|
-
import { closeSync as closeSync2, existsSync as
|
|
1107
|
+
import { closeSync as closeSync2, existsSync as existsSync8, openSync as openSync2 } from "node:fs";
|
|
1104
1108
|
import { spawn as spawn2 } from "node:child_process";
|
|
1109
|
+
import path7 from "node:path";
|
|
1110
|
+
|
|
1111
|
+
// src/providers/cursor-windows.ts
|
|
1112
|
+
import { existsSync as existsSync7, readdirSync as readdirSync3 } from "node:fs";
|
|
1105
1113
|
import path6 from "node:path";
|
|
1106
|
-
var
|
|
1107
|
-
function
|
|
1114
|
+
var CURSOR_VERSION_DIR = /^\d{4}\.\d{1,2}\.\d{1,2}-[a-f0-9]+$/i;
|
|
1115
|
+
function parseCursorVersionSortKey(versionName) {
|
|
1116
|
+
const datePart = versionName.split("-")[0];
|
|
1117
|
+
const parts = datePart.split(".");
|
|
1118
|
+
if (parts.length !== 3) return null;
|
|
1119
|
+
const [year, month, day] = parts;
|
|
1120
|
+
if (!year || !month || !day) return null;
|
|
1121
|
+
return Number(`${year}${month.padStart(2, "0")}${day.padStart(2, "0")}`);
|
|
1122
|
+
}
|
|
1123
|
+
function pickLatestCursorVersionDir(agentRoot) {
|
|
1124
|
+
const versionsRoot = path6.join(agentRoot, "versions");
|
|
1108
1125
|
if (!existsSync7(versionsRoot)) return null;
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1126
|
+
let bestDir = null;
|
|
1127
|
+
let bestKey = -1;
|
|
1128
|
+
for (const entry of readdirSync3(versionsRoot, { withFileTypes: true })) {
|
|
1129
|
+
if (!entry.isDirectory() || !CURSOR_VERSION_DIR.test(entry.name)) continue;
|
|
1130
|
+
const key = parseCursorVersionSortKey(entry.name);
|
|
1131
|
+
if (key == null || key <= bestKey) continue;
|
|
1132
|
+
bestKey = key;
|
|
1133
|
+
bestDir = path6.join(versionsRoot, entry.name);
|
|
1134
|
+
}
|
|
1135
|
+
return bestDir;
|
|
1136
|
+
}
|
|
1137
|
+
function resolveWindowsCursorBundled(agentRoot) {
|
|
1138
|
+
const root = agentRoot?.trim() || path6.join(process.env.LOCALAPPDATA || "", "cursor-agent");
|
|
1139
|
+
const directNode = path6.join(root, "node.exe");
|
|
1140
|
+
const directIndex = path6.join(root, "index.js");
|
|
1141
|
+
if (existsSync7(directNode) && existsSync7(directIndex)) {
|
|
1142
|
+
return { nodeExe: directNode, indexJs: directIndex, versionDir: root };
|
|
1143
|
+
}
|
|
1144
|
+
const versionDir = pickLatestCursorVersionDir(root);
|
|
1145
|
+
if (!versionDir) return null;
|
|
1113
1146
|
const nodeExe = path6.join(versionDir, "node.exe");
|
|
1114
1147
|
const indexJs = path6.join(versionDir, "index.js");
|
|
1115
1148
|
if (!existsSync7(nodeExe) || !existsSync7(indexJs)) return null;
|
|
1116
|
-
return {
|
|
1149
|
+
return { nodeExe, indexJs, versionDir };
|
|
1117
1150
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1151
|
+
|
|
1152
|
+
// src/providers/cursor.ts
|
|
1153
|
+
var DEFAULT_CURSOR_MODEL = "composer-2.5";
|
|
1154
|
+
function bundledSpawnTarget(nodeExe, indexJs, versionDir) {
|
|
1155
|
+
return {
|
|
1156
|
+
executable: nodeExe,
|
|
1157
|
+
prefixArgs: [indexJs],
|
|
1158
|
+
shell: false,
|
|
1159
|
+
detached: true,
|
|
1160
|
+
bundledVersionDir: versionDir
|
|
1161
|
+
};
|
|
1124
1162
|
}
|
|
1125
1163
|
function resolveCursorSpawn(agentBin) {
|
|
1126
|
-
if (process.platform === "win32"
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1129
|
-
|
|
1164
|
+
if (process.platform === "win32") {
|
|
1165
|
+
const isCursorWrapper = /\.(cmd|bat)$/i.test(agentBin);
|
|
1166
|
+
const isBundledNode = /node\.exe$/i.test(agentBin) && existsSync8(path7.join(path7.dirname(agentBin), "index.js"));
|
|
1167
|
+
const isDefaultShim = agentBin === "agent";
|
|
1168
|
+
if (isCursorWrapper || isBundledNode || isDefaultShim) {
|
|
1169
|
+
const bundled = isCursorWrapper ? resolveWindowsCursorBundled(path7.dirname(agentBin)) : isBundledNode ? {
|
|
1170
|
+
nodeExe: agentBin,
|
|
1171
|
+
indexJs: path7.join(path7.dirname(agentBin), "index.js"),
|
|
1172
|
+
versionDir: path7.dirname(agentBin)
|
|
1173
|
+
} : resolveWindowsCursorBundled();
|
|
1174
|
+
if (bundled) {
|
|
1175
|
+
return bundledSpawnTarget(bundled.nodeExe, bundled.indexJs, bundled.versionDir);
|
|
1176
|
+
}
|
|
1177
|
+
throw new Error(
|
|
1178
|
+
"Cursor Agent on Windows has no headless bundled node.exe under %LOCALAPPDATA%\\cursor-agent\\versions\\\u2026. Run `agent login` / update Cursor Agent CLI, use `--provider claude`, or set KYNVER_CURSOR_AGENT_ROOT to the cursor-agent folder."
|
|
1179
|
+
);
|
|
1180
|
+
}
|
|
1130
1181
|
}
|
|
1131
1182
|
return { executable: agentBin, prefixArgs: [], shell: false, detached: true };
|
|
1132
1183
|
}
|
|
@@ -1134,11 +1185,23 @@ function resolveAgentBin() {
|
|
|
1134
1185
|
const configured = process.env.KYNVER_CURSOR_AGENT_BIN?.trim() || process.env.CURSOR_AGENT_BIN?.trim();
|
|
1135
1186
|
if (configured) return configured;
|
|
1136
1187
|
if (process.platform === "win32") {
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1188
|
+
const bundled = resolveWindowsCursorBundled(
|
|
1189
|
+
process.env.KYNVER_CURSOR_AGENT_ROOT?.trim() || void 0
|
|
1190
|
+
);
|
|
1191
|
+
if (bundled) return bundled.nodeExe;
|
|
1192
|
+
const localAgent = path7.join(process.env.LOCALAPPDATA || "", "cursor-agent", "agent.cmd");
|
|
1193
|
+
if (existsSync8(localAgent)) return localAgent;
|
|
1139
1194
|
}
|
|
1140
1195
|
return "agent";
|
|
1141
1196
|
}
|
|
1197
|
+
function cursorWorkerEnv(agentBin, spawnTarget) {
|
|
1198
|
+
return {
|
|
1199
|
+
...process.env,
|
|
1200
|
+
CI: "1",
|
|
1201
|
+
NO_COLOR: "1",
|
|
1202
|
+
...spawnTarget.bundledVersionDir ? { CURSOR_INVOKED_AS: path7.basename(agentBin) || "agent.cmd" } : {}
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1142
1205
|
var cursorProvider = {
|
|
1143
1206
|
name: "cursor",
|
|
1144
1207
|
defaultModel: DEFAULT_CURSOR_MODEL,
|
|
@@ -1171,16 +1234,13 @@ var cursorProvider = {
|
|
|
1171
1234
|
model,
|
|
1172
1235
|
opts.prompt
|
|
1173
1236
|
],
|
|
1174
|
-
{
|
|
1237
|
+
hiddenSpawnOptions({
|
|
1175
1238
|
cwd: opts.worktreePath,
|
|
1176
1239
|
detached: spawnTarget.detached,
|
|
1177
1240
|
shell: spawnTarget.shell,
|
|
1178
1241
|
stdio: ["ignore", stdoutFd, stderrFd],
|
|
1179
|
-
env:
|
|
1180
|
-
|
|
1181
|
-
...spawnTarget.prefixArgs.length > 0 ? { CURSOR_INVOKED_AS: path6.basename(agentBin) } : {}
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1242
|
+
env: cursorWorkerEnv(agentBin, spawnTarget)
|
|
1243
|
+
})
|
|
1184
1244
|
);
|
|
1185
1245
|
closeSync2(stdoutFd);
|
|
1186
1246
|
closeSync2(stderrFd);
|
|
@@ -1212,12 +1272,12 @@ function resolveWorkerProvider(name) {
|
|
|
1212
1272
|
|
|
1213
1273
|
// src/auto-complete.ts
|
|
1214
1274
|
import { spawn as spawn3 } from "node:child_process";
|
|
1215
|
-
import { existsSync as
|
|
1216
|
-
import
|
|
1275
|
+
import { existsSync as existsSync9, openSync as openSync3, closeSync as closeSync3 } from "node:fs";
|
|
1276
|
+
import path9 from "node:path";
|
|
1217
1277
|
import { fileURLToPath } from "node:url";
|
|
1218
1278
|
|
|
1219
1279
|
// src/worker-ops.ts
|
|
1220
|
-
import
|
|
1280
|
+
import path8 from "node:path";
|
|
1221
1281
|
async function postCompletion(url, secret, body) {
|
|
1222
1282
|
const res = await fetch(url, {
|
|
1223
1283
|
method: "POST",
|
|
@@ -1340,7 +1400,7 @@ async function completeWorker(args) {
|
|
|
1340
1400
|
function workerStatus(args) {
|
|
1341
1401
|
const worker = loadWorker(String(args.run), String(args.name));
|
|
1342
1402
|
const status = computeWorkerStatus(worker);
|
|
1343
|
-
writeJson(
|
|
1403
|
+
writeJson(path8.join(worker.workerDir, "last-status.json"), status);
|
|
1344
1404
|
console.log(JSON.stringify(status, null, 2));
|
|
1345
1405
|
}
|
|
1346
1406
|
function runStatus(args) {
|
|
@@ -1348,7 +1408,7 @@ function runStatus(args) {
|
|
|
1348
1408
|
const names = Object.keys(run.workers || {});
|
|
1349
1409
|
const workers = names.map((name) => {
|
|
1350
1410
|
const worker = readJson(
|
|
1351
|
-
|
|
1411
|
+
path8.join(runDirectory(run.id), "workers", safeSlug(name), "worker.json"),
|
|
1352
1412
|
void 0
|
|
1353
1413
|
);
|
|
1354
1414
|
if (!worker) {
|
|
@@ -1384,7 +1444,7 @@ function runStatus(args) {
|
|
|
1384
1444
|
needsAttention: workers.filter((w) => w.attention && w.attention !== "ok" && w.attention !== "done").map((w) => w.worker),
|
|
1385
1445
|
workers
|
|
1386
1446
|
};
|
|
1387
|
-
writeJson(
|
|
1447
|
+
writeJson(path8.join(runDirectory(run.id), "last-board.json"), board);
|
|
1388
1448
|
console.log(JSON.stringify(board, null, 2));
|
|
1389
1449
|
}
|
|
1390
1450
|
function tailWorker(args) {
|
|
@@ -1523,12 +1583,12 @@ async function autoCompleteWorkerCli(raw) {
|
|
|
1523
1583
|
}
|
|
1524
1584
|
}
|
|
1525
1585
|
function resolveDefaultCliPath() {
|
|
1526
|
-
return
|
|
1586
|
+
return path9.join(fileURLToPath(new URL(".", import.meta.url)), "cli.js");
|
|
1527
1587
|
}
|
|
1528
1588
|
function spawnCompletionSidecar(opts) {
|
|
1529
1589
|
const cliPath = opts.cliPath ?? resolveDefaultCliPath();
|
|
1530
|
-
if (!
|
|
1531
|
-
const logPath =
|
|
1590
|
+
if (!existsSync9(cliPath)) return void 0;
|
|
1591
|
+
const logPath = path9.join(opts.workerDir, "auto-complete.log");
|
|
1532
1592
|
let logFd;
|
|
1533
1593
|
try {
|
|
1534
1594
|
logFd = openSync3(logPath, "a");
|
|
@@ -1554,11 +1614,15 @@ function spawnCompletionSidecar(opts) {
|
|
|
1554
1614
|
if (opts.baseUrl) args.push("--base-url", opts.baseUrl);
|
|
1555
1615
|
if (opts.secret) args.push("--secret", opts.secret);
|
|
1556
1616
|
try {
|
|
1557
|
-
const child = spawn3(
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1617
|
+
const child = spawn3(
|
|
1618
|
+
nodeExecutable,
|
|
1619
|
+
args,
|
|
1620
|
+
hiddenSpawnOptions({
|
|
1621
|
+
detached: true,
|
|
1622
|
+
stdio,
|
|
1623
|
+
env: process.env
|
|
1624
|
+
})
|
|
1625
|
+
);
|
|
1562
1626
|
if (logFd !== void 0) closeSync3(logFd);
|
|
1563
1627
|
child.unref();
|
|
1564
1628
|
return { pid: child.pid, logPath, cliPath };
|
|
@@ -1597,16 +1661,16 @@ function spawnWorkerProcess(run, opts) {
|
|
|
1597
1661
|
launchModel = preflight.model;
|
|
1598
1662
|
}
|
|
1599
1663
|
const { worktreesDir } = getPaths();
|
|
1600
|
-
const workerDir =
|
|
1664
|
+
const workerDir = path10.join(runDirectory(run.id), "workers", name);
|
|
1601
1665
|
mkdirSync3(workerDir, { recursive: true });
|
|
1602
|
-
const worktreePath =
|
|
1666
|
+
const worktreePath = path10.join(worktreesDir, run.id, name);
|
|
1603
1667
|
const branch = opts.branch || `agent/${run.id}/${name}`;
|
|
1604
|
-
if (
|
|
1668
|
+
if (existsSync10(worktreePath)) throw new Error(`worktree path already exists: ${worktreePath}`);
|
|
1605
1669
|
git(run.repo, ["fetch", "origin", "--prune"], { allowFailure: true });
|
|
1606
1670
|
git(run.repo, ["worktree", "add", "-b", branch, worktreePath, run.baseCommit], { throwError: true });
|
|
1607
|
-
const stdoutPath =
|
|
1608
|
-
const stderrPath =
|
|
1609
|
-
const heartbeatPath =
|
|
1671
|
+
const stdoutPath = path10.join(workerDir, "stdout.jsonl");
|
|
1672
|
+
const stderrPath = path10.join(workerDir, "stderr.log");
|
|
1673
|
+
const heartbeatPath = path10.join(workerDir, "heartbeat.jsonl");
|
|
1610
1674
|
const prompt = buildPrompt({
|
|
1611
1675
|
task: opts.task,
|
|
1612
1676
|
ownedPaths: opts.ownedPaths || [],
|
|
@@ -1655,7 +1719,7 @@ function spawnWorkerProcess(run, opts) {
|
|
|
1655
1719
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1656
1720
|
};
|
|
1657
1721
|
saveWorker(run.id, worker);
|
|
1658
|
-
run.workers = { ...run.workers || {}, [name]: { workerDir, statusPath:
|
|
1722
|
+
run.workers = { ...run.workers || {}, [name]: { workerDir, statusPath: path10.join(workerDir, "worker.json") } };
|
|
1659
1723
|
run.status = "running";
|
|
1660
1724
|
saveRun(run);
|
|
1661
1725
|
if (worker.agentOsId && worker.taskId) {
|
|
@@ -1869,7 +1933,7 @@ async function dispatchRun(args) {
|
|
|
1869
1933
|
}
|
|
1870
1934
|
|
|
1871
1935
|
// src/sweep.ts
|
|
1872
|
-
import
|
|
1936
|
+
import path11 from "node:path";
|
|
1873
1937
|
async function sweepRun(args) {
|
|
1874
1938
|
const pipeline = args.pipeline === true || args.pipeline === "true";
|
|
1875
1939
|
try {
|
|
@@ -1881,7 +1945,7 @@ async function sweepRun(args) {
|
|
|
1881
1945
|
const releasedLocalOrphans = [];
|
|
1882
1946
|
for (const name of Object.keys(run.workers || {})) {
|
|
1883
1947
|
const worker = readJson(
|
|
1884
|
-
|
|
1948
|
+
path11.join(runDirectory(run.id), "workers", safeSlug(name), "worker.json"),
|
|
1885
1949
|
void 0
|
|
1886
1950
|
);
|
|
1887
1951
|
if (!worker || !worker.dispatched || !worker.taskId) continue;
|
|
@@ -1924,11 +1988,11 @@ async function sweepRun(args) {
|
|
|
1924
1988
|
}
|
|
1925
1989
|
|
|
1926
1990
|
// src/worktree.ts
|
|
1927
|
-
import { existsSync as
|
|
1928
|
-
import
|
|
1991
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync4 } from "node:fs";
|
|
1992
|
+
import path13 from "node:path";
|
|
1929
1993
|
|
|
1930
1994
|
// src/validate.ts
|
|
1931
|
-
import
|
|
1995
|
+
import path12 from "node:path";
|
|
1932
1996
|
var RUN_ID_RE = /^[a-z0-9][a-z0-9._-]{0,127}$/i;
|
|
1933
1997
|
function validateRunId(runId) {
|
|
1934
1998
|
const trimmed = runId.trim();
|
|
@@ -1936,7 +2000,7 @@ function validateRunId(runId) {
|
|
|
1936
2000
|
return trimmed;
|
|
1937
2001
|
}
|
|
1938
2002
|
function validateRepo(repo) {
|
|
1939
|
-
const resolved =
|
|
2003
|
+
const resolved = path12.resolve(repo);
|
|
1940
2004
|
if (resolved.includes("..")) throw new Error("repo path must not contain .. segments");
|
|
1941
2005
|
return resolved;
|
|
1942
2006
|
}
|
|
@@ -1947,7 +2011,7 @@ function createRun(args) {
|
|
|
1947
2011
|
ensureGitRepo(repo);
|
|
1948
2012
|
const id = args.id ? validateRunId(String(args.id)) : timestampSlug(String(args.name || "run"));
|
|
1949
2013
|
const dir = runDirectory(id);
|
|
1950
|
-
if (
|
|
2014
|
+
if (existsSync11(dir)) failExists(`run already exists: ${id}`);
|
|
1951
2015
|
mkdirSync4(dir, { recursive: true });
|
|
1952
2016
|
const base = String(args.base || "origin/main");
|
|
1953
2017
|
const baseCommit = git(repo, ["rev-parse", base]).trim();
|
|
@@ -1961,12 +2025,12 @@ function createRun(args) {
|
|
|
1961
2025
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1962
2026
|
workers: {}
|
|
1963
2027
|
};
|
|
1964
|
-
writeJson(
|
|
2028
|
+
writeJson(path13.join(dir, "run.json"), run);
|
|
1965
2029
|
console.log(JSON.stringify({ runId: id, runDir: dir, repo, base, baseCommit }, null, 2));
|
|
1966
2030
|
}
|
|
1967
2031
|
function listRuns() {
|
|
1968
2032
|
const { runsDir } = getPaths();
|
|
1969
|
-
const rows = listRunIds(runsDir).map((id) => readJson(
|
|
2033
|
+
const rows = listRunIds(runsDir).map((id) => readJson(path13.join(runDirectory(id), "run.json"), void 0)).filter(Boolean).map((run) => ({
|
|
1970
2034
|
id: run.id,
|
|
1971
2035
|
name: run.name,
|
|
1972
2036
|
status: run.status,
|
|
@@ -1981,10 +2045,10 @@ function failExists(message) {
|
|
|
1981
2045
|
}
|
|
1982
2046
|
|
|
1983
2047
|
// src/pipeline-tick.ts
|
|
1984
|
-
import
|
|
2048
|
+
import path16 from "node:path";
|
|
1985
2049
|
|
|
1986
2050
|
// src/finalize.ts
|
|
1987
|
-
import
|
|
2051
|
+
import path14 from "node:path";
|
|
1988
2052
|
var ACTIVE_RUN_STATUSES = /* @__PURE__ */ new Set(["running", "dispatching", "pending", "queued"]);
|
|
1989
2053
|
function terminalStatusFor(run) {
|
|
1990
2054
|
const names = Object.keys(run.workers || {});
|
|
@@ -1994,7 +2058,7 @@ function terminalStatusFor(run) {
|
|
|
1994
2058
|
let anyCompletionBlocked = false;
|
|
1995
2059
|
for (const name of names) {
|
|
1996
2060
|
const worker = readJson(
|
|
1997
|
-
|
|
2061
|
+
path14.join(runDirectory(run.id), "workers", safeSlug(name), "worker.json"),
|
|
1998
2062
|
void 0
|
|
1999
2063
|
);
|
|
2000
2064
|
if (!worker) continue;
|
|
@@ -2027,7 +2091,7 @@ function finalizeStaleRuns() {
|
|
|
2027
2091
|
}
|
|
2028
2092
|
|
|
2029
2093
|
// src/plan-progress-daemon-sync.ts
|
|
2030
|
-
import
|
|
2094
|
+
import path15 from "node:path";
|
|
2031
2095
|
|
|
2032
2096
|
// src/plan-progress-sync.ts
|
|
2033
2097
|
async function syncPlanProgress(args) {
|
|
@@ -2051,7 +2115,7 @@ async function syncActiveWorkerPlanProgress(runId, args) {
|
|
|
2051
2115
|
const outcomes = [];
|
|
2052
2116
|
for (const name of Object.keys(run.workers || {})) {
|
|
2053
2117
|
const worker = readJson(
|
|
2054
|
-
|
|
2118
|
+
path15.join(runDirectory(run.id), "workers", safeSlug(name), "worker.json"),
|
|
2055
2119
|
void 0
|
|
2056
2120
|
);
|
|
2057
2121
|
if (!worker?.dispatched || !worker.taskId) continue;
|
|
@@ -2105,7 +2169,7 @@ async function completeFinishedWorkers(runId, args) {
|
|
|
2105
2169
|
const outcomes = [];
|
|
2106
2170
|
for (const name of Object.keys(run.workers || {})) {
|
|
2107
2171
|
const worker = readJson(
|
|
2108
|
-
|
|
2172
|
+
path16.join(runDirectory(run.id), "workers", safeSlug(name), "worker.json"),
|
|
2109
2173
|
void 0
|
|
2110
2174
|
);
|
|
2111
2175
|
if (!worker?.taskId) continue;
|