@centralu/host-win32-x64 0.1.0-beta.58 → 0.1.0-beta.59
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/host/bundle-info.json +2 -2
- package/host/centralu-package.json +5 -5
- package/host/main.mjs +94 -75
- package/package.json +1 -1
package/host/bundle-info.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
2
|
+
"commit": "a72bb19",
|
|
3
3
|
"protocolVersion": 1,
|
|
4
4
|
"hostProof": 1,
|
|
5
5
|
"tokenOnStdin": 1,
|
|
6
6
|
"verifiers": 1,
|
|
7
7
|
"keyPairing": 1,
|
|
8
|
-
"builtAt": "2026-11-
|
|
8
|
+
"builtAt": "2026-11-12T08:57:05.723Z",
|
|
9
9
|
"runtime": "system-node",
|
|
10
10
|
"platform": "win32",
|
|
11
11
|
"arch": "x64"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "centralu",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.59",
|
|
4
4
|
"description": "Run, watch and steer several Claude Code and Codex CLI sessions from one window",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ijun17",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"win32"
|
|
39
39
|
],
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"@centralu/darwin-arm64": "0.1.0-beta.
|
|
42
|
-
"@centralu/linux-arm64": "0.1.0-beta.
|
|
43
|
-
"@centralu/linux-x64": "0.1.0-beta.
|
|
44
|
-
"@centralu/win32-x64": "0.1.0-beta.
|
|
41
|
+
"@centralu/darwin-arm64": "0.1.0-beta.59",
|
|
42
|
+
"@centralu/linux-arm64": "0.1.0-beta.59",
|
|
43
|
+
"@centralu/linux-x64": "0.1.0-beta.59",
|
|
44
|
+
"@centralu/win32-x64": "0.1.0-beta.59"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/host/main.mjs
CHANGED
|
@@ -43046,7 +43046,7 @@ import { dirname as dirname27, join as join58 } from "node:path";
|
|
|
43046
43046
|
import { mkdirSync as mkdirSync21, readFileSync as readFileSync27, writeSync as writeSync4 } from "node:fs";
|
|
43047
43047
|
|
|
43048
43048
|
// packages/protocol/src/version.generated.ts
|
|
43049
|
-
var APP_VERSION = "0.1.0-beta.
|
|
43049
|
+
var APP_VERSION = "0.1.0-beta.59";
|
|
43050
43050
|
|
|
43051
43051
|
// packages/protocol/src/brand.ts
|
|
43052
43052
|
var APP_NAME = "Centralu";
|
|
@@ -63454,7 +63454,8 @@ var THEME_PRESETS = [
|
|
|
63454
63454
|
{ id: "dark", name: "Dark", base: "dark" },
|
|
63455
63455
|
{ id: "light", name: "Light", base: "light" },
|
|
63456
63456
|
{ id: "hc-dark", name: "High contrast dark", base: "dark" },
|
|
63457
|
-
{ id: "hc-light", name: "High contrast light", base: "light" }
|
|
63457
|
+
{ id: "hc-light", name: "High contrast light", base: "light" },
|
|
63458
|
+
{ id: "graphite", name: "Graphite", base: "dark" }
|
|
63458
63459
|
];
|
|
63459
63460
|
var ThemeFileContent = external_exports.object({
|
|
63460
63461
|
name: external_exports.string().min(1).max(80),
|
|
@@ -65270,15 +65271,15 @@ function tableReader(start3 = startServer) {
|
|
|
65270
65271
|
c.stderr.resume();
|
|
65271
65272
|
c.stdin.on("error", () => {
|
|
65272
65273
|
});
|
|
65273
|
-
const
|
|
65274
|
+
const gone2 = (e) => {
|
|
65274
65275
|
if (child !== c) return;
|
|
65275
65276
|
child = null;
|
|
65276
65277
|
const w = waiting;
|
|
65277
65278
|
waiting = null;
|
|
65278
65279
|
w?.reject(e);
|
|
65279
65280
|
};
|
|
65280
|
-
c.on("error",
|
|
65281
|
-
c.on("exit", (code2) =>
|
|
65281
|
+
c.on("error", gone2);
|
|
65282
|
+
c.on("exit", (code2) => gone2(new Error(`the process table reader ended (${code2})`)));
|
|
65282
65283
|
return c;
|
|
65283
65284
|
}
|
|
65284
65285
|
function readOnce(timeoutMs) {
|
|
@@ -65560,8 +65561,8 @@ function orphansOf(rows3, root3) {
|
|
|
65560
65561
|
return found;
|
|
65561
65562
|
}
|
|
65562
65563
|
var runFile = promisify(execFile);
|
|
65563
|
-
var leftoverOs = (run2, table = () => void 0) =>
|
|
65564
|
-
listProcesses
|
|
65564
|
+
var leftoverOs = (run2, table = () => void 0, alive2 = pidAlive) => {
|
|
65565
|
+
const listProcesses = async (timeoutMs = 6e4) => {
|
|
65565
65566
|
const warm = table();
|
|
65566
65567
|
if (warm) {
|
|
65567
65568
|
try {
|
|
@@ -65572,12 +65573,36 @@ var leftoverOs = (run2, table = () => void 0) => ({
|
|
|
65572
65573
|
}
|
|
65573
65574
|
const { stdout } = await run2(powershell(), [...POWERSHELL_ARGS, READ_ONCE], { timeout: timeoutMs, windowsHide: true });
|
|
65574
65575
|
return parseWinProcs(stdout);
|
|
65575
|
-
}
|
|
65576
|
-
|
|
65577
|
-
|
|
65578
|
-
|
|
65576
|
+
};
|
|
65577
|
+
return {
|
|
65578
|
+
listProcesses,
|
|
65579
|
+
// Asynchronous, so a tree of many processes does not hold the host's thread for each taskkill (about 40 ms each)
|
|
65580
|
+
taskkill: async (pid, alone = false, created) => {
|
|
65581
|
+
if (!alive2(pid)) throw gone(pid);
|
|
65582
|
+
if (created !== void 0 && !(await listProcesses(TASKKILL_MS)).some((r) => r.pid === pid && r.created === created)) throw gone(pid);
|
|
65583
|
+
try {
|
|
65584
|
+
await run2(systemTool2(["taskkill.exe"]), ["/PID", String(pid), ...alone ? [] : ["/T"], "/F"], { timeout: TASKKILL_MS, windowsHide: true });
|
|
65585
|
+
} catch (e) {
|
|
65586
|
+
if (!alive2(pid)) throw gone(pid);
|
|
65587
|
+
throw e;
|
|
65588
|
+
}
|
|
65589
|
+
}
|
|
65590
|
+
};
|
|
65591
|
+
};
|
|
65592
|
+
function pidAlive(pid) {
|
|
65593
|
+
try {
|
|
65594
|
+
process.kill(pid, 0);
|
|
65595
|
+
return true;
|
|
65596
|
+
} catch (e) {
|
|
65597
|
+
return errnoCode(e) === "EPERM";
|
|
65579
65598
|
}
|
|
65580
|
-
}
|
|
65599
|
+
}
|
|
65600
|
+
var ProcessGone = class extends Error {
|
|
65601
|
+
constructor(pid) {
|
|
65602
|
+
super(`process ${pid} is already gone`);
|
|
65603
|
+
}
|
|
65604
|
+
};
|
|
65605
|
+
var gone = (pid) => new ProcessGone(pid);
|
|
65581
65606
|
var warmTable;
|
|
65582
65607
|
var REAL_LEFTOVER_OS = leftoverOs(runFile, () => warmTable);
|
|
65583
65608
|
function warmProcessTable(platform = process.platform) {
|
|
@@ -65660,9 +65685,10 @@ async function endInOrder(found, by, os2) {
|
|
|
65660
65685
|
for (const r of found) {
|
|
65661
65686
|
if (r.pid === process.pid) continue;
|
|
65662
65687
|
try {
|
|
65663
|
-
await os2.taskkill(r.pid, parents.has(r.pid));
|
|
65688
|
+
await os2.taskkill(r.pid, parents.has(r.pid), r.created);
|
|
65664
65689
|
ended2.push(r.pid);
|
|
65665
65690
|
} catch (e) {
|
|
65691
|
+
if (e instanceof ProcessGone) continue;
|
|
65666
65692
|
const status = typeof e === "object" && e !== null ? "status" in e ? e.status : "code" in e ? e.code : void 0 : void 0;
|
|
65667
65693
|
if (status !== 128) console.error(`[agent-host] process ${r.pid}, left running by ${by}, could not be ended (status ${String(status)}: ${e instanceof Error ? e.message.replace(/\s+/g, " ").trim() : "unknown error"})`);
|
|
65668
65694
|
}
|
|
@@ -66681,14 +66707,7 @@ var realOsValue = {
|
|
|
66681
66707
|
),
|
|
66682
66708
|
stop,
|
|
66683
66709
|
stopAll,
|
|
66684
|
-
alive:
|
|
66685
|
-
try {
|
|
66686
|
-
process.kill(pid, 0);
|
|
66687
|
-
return true;
|
|
66688
|
-
} catch (e) {
|
|
66689
|
-
return errnoCode(e) === "EPERM";
|
|
66690
|
-
}
|
|
66691
|
-
},
|
|
66710
|
+
alive: pidAlive,
|
|
66692
66711
|
signal: (pid, signal) => {
|
|
66693
66712
|
const refused2 = signalRefusal(signal, HOST_FAMILY);
|
|
66694
66713
|
if (refused2 === "ERR_UNKNOWN_SIGNAL") throw signalError(signal, refused2);
|
|
@@ -68170,14 +68189,14 @@ var HostServer = class _HostServer {
|
|
|
68170
68189
|
for (const timer of this.handshakeTimers.values()) clearTimeout(timer);
|
|
68171
68190
|
this.handshakeTimers.clear();
|
|
68172
68191
|
const sockets = [...this.wss.clients];
|
|
68173
|
-
const
|
|
68192
|
+
const gone2 = sockets.map(
|
|
68174
68193
|
(c) => c.readyState === c.CLOSED ? Promise.resolve() : new Promise((r) => c.once("close", () => r()))
|
|
68175
68194
|
);
|
|
68176
68195
|
for (const c of sockets) c.close(CLOSE_GOING_AWAY, "host shutting down");
|
|
68177
68196
|
const cut3 = setTimeout(() => {
|
|
68178
68197
|
for (const c of sockets) c.terminate();
|
|
68179
68198
|
}, this.limits.closeGraceMs);
|
|
68180
|
-
await Promise.all(
|
|
68199
|
+
await Promise.all(gone2);
|
|
68181
68200
|
clearTimeout(cut3);
|
|
68182
68201
|
this.clients.clear();
|
|
68183
68202
|
const httpClosed = new Promise((r) => this.http.close(() => r()));
|
|
@@ -68473,7 +68492,7 @@ var HostServer = class _HostServer {
|
|
|
68473
68492
|
});
|
|
68474
68493
|
}
|
|
68475
68494
|
});
|
|
68476
|
-
let
|
|
68495
|
+
let gone2 = false;
|
|
68477
68496
|
const forget = () => {
|
|
68478
68497
|
clearTimeout(this.handshakeTimers.get(ws2));
|
|
68479
68498
|
this.handshakeTimers.delete(ws2);
|
|
@@ -68484,8 +68503,8 @@ var HostServer = class _HostServer {
|
|
|
68484
68503
|
leaving.abort();
|
|
68485
68504
|
if (this.byClient.get(client) === ws2) this.byClient.delete(client);
|
|
68486
68505
|
this.failCalls(ws2, "The connection ended before it answered");
|
|
68487
|
-
if (!authed ||
|
|
68488
|
-
|
|
68506
|
+
if (!authed || gone2) return;
|
|
68507
|
+
gone2 = true;
|
|
68489
68508
|
this.opts.onClientGone?.(client);
|
|
68490
68509
|
};
|
|
68491
68510
|
ws2.on("close", forget);
|
|
@@ -69656,9 +69675,9 @@ function runOptions(cwd, env, timeoutMs, signal) {
|
|
|
69656
69675
|
signal,
|
|
69657
69676
|
onChild: (child) => {
|
|
69658
69677
|
live.add(child);
|
|
69659
|
-
const
|
|
69660
|
-
child.once("exit",
|
|
69661
|
-
child.once("error",
|
|
69678
|
+
const gone2 = () => live.delete(child);
|
|
69679
|
+
child.once("exit", gone2);
|
|
69680
|
+
child.once("error", gone2);
|
|
69662
69681
|
}
|
|
69663
69682
|
};
|
|
69664
69683
|
}
|
|
@@ -102604,9 +102623,9 @@ var SecretStore = class {
|
|
|
102604
102623
|
*/
|
|
102605
102624
|
forgetScope(scope) {
|
|
102606
102625
|
const doc = this.read();
|
|
102607
|
-
const
|
|
102608
|
-
if (
|
|
102609
|
-
for (const key of
|
|
102626
|
+
const gone2 = Object.keys(doc).filter((key) => key.startsWith(`${scope}/`));
|
|
102627
|
+
if (gone2.length === 0) return;
|
|
102628
|
+
for (const key of gone2) delete doc[key];
|
|
102610
102629
|
this.file.write(doc);
|
|
102611
102630
|
}
|
|
102612
102631
|
/**
|
|
@@ -105128,8 +105147,8 @@ var InlineViews = class {
|
|
|
105128
105147
|
const v = this.bySession.get(sessionId)?.get(callId);
|
|
105129
105148
|
if (!v || !v.kept) refuse3("This view's result is no longer kept. Open the app instead");
|
|
105130
105149
|
if (!v.instanceId) {
|
|
105131
|
-
const
|
|
105132
|
-
if (
|
|
105150
|
+
const gone2 = this.unavailable(v.ref);
|
|
105151
|
+
if (gone2) refuse3(gone2);
|
|
105133
105152
|
if (this.deps.rt.list().find((a) => a.appId === v.ref.appId && a.projectId === v.ref.projectId)?.status === "failed") {
|
|
105134
105153
|
refuse3("This app stopped after failing repeatedly. Restart it, then reopen this view");
|
|
105135
105154
|
}
|
|
@@ -107356,8 +107375,8 @@ async function prepareWorktreeDependencies(projectCwd, worktreeCwd) {
|
|
|
107356
107375
|
if (err.code === "ENOENT") return [];
|
|
107357
107376
|
throw err;
|
|
107358
107377
|
});
|
|
107359
|
-
for (const
|
|
107360
|
-
console.error(`[worktree] link dropped (points outside the worktree): ${
|
|
107378
|
+
for (const gone2 of removed) {
|
|
107379
|
+
console.error(`[worktree] link dropped (points outside the worktree): ${gone2}`);
|
|
107361
107380
|
}
|
|
107362
107381
|
}
|
|
107363
107382
|
}
|
|
@@ -107885,8 +107904,8 @@ var WorktreeSessions = class {
|
|
|
107885
107904
|
if (err.code === "ENOENT") return [];
|
|
107886
107905
|
throw err;
|
|
107887
107906
|
});
|
|
107888
|
-
for (const
|
|
107889
|
-
problem3(`link dropped (points outside the worktree): ${
|
|
107907
|
+
for (const gone2 of landed) {
|
|
107908
|
+
problem3(`link dropped (points outside the worktree): ${gone2}`);
|
|
107890
107909
|
}
|
|
107891
107910
|
}
|
|
107892
107911
|
await prepareWorktreeDependencies(projectCwd, worktree.path).catch((err) => {
|
|
@@ -108073,7 +108092,7 @@ ${stderr.slice(0, 2e3)}`);
|
|
|
108073
108092
|
*/
|
|
108074
108093
|
async cleanUpGoneWorktree(target, cwd, branch, path2) {
|
|
108075
108094
|
const setAside = { changedFiles: 0, commits: 0 };
|
|
108076
|
-
const
|
|
108095
|
+
const gone2 = `The worktree folder was already gone (${path2})`;
|
|
108077
108096
|
await this.host.trashSession(target.id, false, false, void 0, true);
|
|
108078
108097
|
const key = canonicalKey(path2);
|
|
108079
108098
|
const listedNow = async () => (await gitWorktreeList(cwd)).some((w) => canonicalKey(w.path) === key);
|
|
@@ -108083,9 +108102,9 @@ ${stderr.slice(0, 2e3)}`);
|
|
|
108083
108102
|
await gitWorktreePrune(cwd);
|
|
108084
108103
|
entry = !had ? "git had no entry for it" : await listedNow().catch(() => true) ? "git's entry for it is still listed" : "git's entry was pruned";
|
|
108085
108104
|
} catch (e) {
|
|
108086
|
-
return { ok: true, branch, setAside, note: `${
|
|
108105
|
+
return { ok: true, branch, setAside, note: `${gone2}, but git's entry for it could not be pruned (${e.message}); branch ${branch} was left.` };
|
|
108087
108106
|
}
|
|
108088
|
-
const head = `${
|
|
108107
|
+
const head = `${gone2}; the session is in the session archive and ${entry}.`;
|
|
108089
108108
|
if (await gitRevParse(cwd, `refs/heads/${branch}`) === null) {
|
|
108090
108109
|
return { ok: true, branch, setAside, note: `${head} Branch ${branch} was already gone.` };
|
|
108091
108110
|
}
|
|
@@ -114488,10 +114507,10 @@ var DelegationWaits = class {
|
|
|
114488
114507
|
/** Resolves `gone` when a handoff gives this delegation (or start request) to another session (#693); `done` lets go */
|
|
114489
114508
|
untilHandedOver(d2) {
|
|
114490
114509
|
let leave;
|
|
114491
|
-
const
|
|
114510
|
+
const gone2 = new Promise((resolve21) => leave = () => resolve21("handedOver"));
|
|
114492
114511
|
const set3 = d2.leaving ??= /* @__PURE__ */ new Set();
|
|
114493
114512
|
set3.add(leave);
|
|
114494
|
-
return { gone, done: () => set3.delete(leave) };
|
|
114513
|
+
return { gone: gone2, done: () => set3.delete(leave) };
|
|
114495
114514
|
}
|
|
114496
114515
|
/**
|
|
114497
114516
|
* What an original that stays after a handoff hears about work the handoff gave away (#693), or undefined: where it
|
|
@@ -114762,8 +114781,8 @@ var AgentSessionActions = class {
|
|
|
114762
114781
|
if (refused2) return { ok: false, error: refused2 };
|
|
114763
114782
|
return this.flow.remote.agentSession(callerId, remote, opts, signal);
|
|
114764
114783
|
}
|
|
114765
|
-
const
|
|
114766
|
-
if (
|
|
114784
|
+
const gone2 = this.flow.handedOverAnswer(callerId, opts.sessionId);
|
|
114785
|
+
if (gone2) return gone2;
|
|
114767
114786
|
const request = this.host.children.agentStarts.get(opts.sessionId);
|
|
114768
114787
|
if (request && request.req.callerId === callerId) {
|
|
114769
114788
|
const r = await this.agentStartSession(request, opts.action, signal);
|
|
@@ -115257,10 +115276,10 @@ var RemoteAgents = class {
|
|
|
115257
115276
|
const above = !presetWithin(childPreset, this.callerPreset(callerId));
|
|
115258
115277
|
if (above || unasked && childPreset !== "auto") {
|
|
115259
115278
|
const why2 = above ? `this session now runs under ${this.callerPreset(callerId)}, below the ${childPreset} the session made there runs under` : `${machine.name} no longer takes auto from this computer (its "Allow auto from a linked computer" setting was turned off)`;
|
|
115260
|
-
const
|
|
115279
|
+
const gone2 = await reader.deleteSession(made.sessionId);
|
|
115261
115280
|
return {
|
|
115262
115281
|
ok: false,
|
|
115263
|
-
error: `${why2}, so the session made there was given no task and went to ${machine.name}'s session archive${
|
|
115282
|
+
error: `${why2}, so the session made there was given no task and went to ${machine.name}'s session archive${gone2.ok ? "" : `, or would have: it could not be deleted (${bare(gone2.error)}), so "${made.name}" stays there with no task`}. Start it again to ask the person. ${ASK_THE_PERSON}`
|
|
115264
115283
|
};
|
|
115265
115284
|
}
|
|
115266
115285
|
const label = labelOf(this.host.store.messages, caller);
|
|
@@ -118026,13 +118045,13 @@ ${lost.map((l) => `- ${l}`).join("\n")}` : local ? "Nothing else is lost: no one
|
|
|
118026
118045
|
if (refused2) return { ok: false, error: refused2 };
|
|
118027
118046
|
const now = await this.read(rpc);
|
|
118028
118047
|
const nowById = new Map(now.sessions.map((s) => [s.id, s]));
|
|
118029
|
-
const
|
|
118048
|
+
const gone2 = [];
|
|
118030
118049
|
const failed4 = [];
|
|
118031
118050
|
let deleted = 0;
|
|
118032
118051
|
for (const s of named3.sessions) {
|
|
118033
118052
|
const current = nowById.get(s.id);
|
|
118034
118053
|
if (!current || !sameRow(s, current)) {
|
|
118035
|
-
|
|
118054
|
+
gone2.push(s.name);
|
|
118036
118055
|
continue;
|
|
118037
118056
|
}
|
|
118038
118057
|
try {
|
|
@@ -118067,7 +118086,7 @@ ${lost.map((l) => `- ${l}`).join("\n")}` : local ? "Nothing else is lost: no one
|
|
|
118067
118086
|
const left = await this.read(rpc).catch(() => null) ?? now;
|
|
118068
118087
|
const arrived = left.sessions.length + left.runs.length + left.steps.length;
|
|
118069
118088
|
const parts = [`Deleted for good: ${plural(deleted, "session")}${runsDeleted ? `, ${plural(runsDeleted, "app run")}` : ""}${stepsDeleted ? `, the subagent steps of ${plural(stepsDeleted, "session")}` : ""}.`];
|
|
118070
|
-
if (
|
|
118089
|
+
if (gone2.length) parts.push(`Not what the card named when it was answered (restored, deleted or deleted again meanwhile), so left alone: ${gone2.map(shown).join(", ")}.`);
|
|
118071
118090
|
if (failed4.length) parts.push(`Stayed in the session archive: ${failed4.join("; ")}`);
|
|
118072
118091
|
if (arrived) parts.push(`The session archive now holds ${plural(left.sessions.length, "session")}, ${plural(left.runs.length, "app run")} and subagent steps of ${plural(left.steps.length, "session")}.`);
|
|
118073
118092
|
return { ok: true, text: parts.join(" ") };
|
|
@@ -123025,9 +123044,9 @@ var SessionStarts = class {
|
|
|
123025
123044
|
}
|
|
123026
123045
|
}
|
|
123027
123046
|
const t02 = Date.now();
|
|
123028
|
-
const
|
|
123047
|
+
const gone2 = await this.host.externals.externalGone(m, cwd);
|
|
123029
123048
|
const tCheck = Date.now() - t02;
|
|
123030
|
-
if (
|
|
123049
|
+
if (gone2) {
|
|
123031
123050
|
return { session: m, resumed: false, reason: externalMissingReason(this.host.toolLabel(m.tool), cwd) };
|
|
123032
123051
|
}
|
|
123033
123052
|
const apps = this.host.apps.appsFor(m);
|
|
@@ -123123,8 +123142,8 @@ var SessionStarts = class {
|
|
|
123123
123142
|
return { session: m, resumed: true };
|
|
123124
123143
|
} catch (err) {
|
|
123125
123144
|
this.host.modelWindows.forget(sessionId);
|
|
123126
|
-
const
|
|
123127
|
-
if (
|
|
123145
|
+
const gone3 = err instanceof Error && Reflect.get(err, "code") === "conversation_gone" || await withTimeout(this.host.externals.externalGone(m, cwd), 8e3, "Checking the tool").catch(() => false);
|
|
123146
|
+
if (gone3) {
|
|
123128
123147
|
return { session: m, resumed: false, reason: externalMissingReason(this.host.toolLabel(m.tool), cwd) };
|
|
123129
123148
|
}
|
|
123130
123149
|
const locked = err.code === "conversation_locked";
|
|
@@ -126166,8 +126185,8 @@ function logToolStderr(proc, label, line) {
|
|
|
126166
126185
|
}
|
|
126167
126186
|
async function stopToolProcess(proc, opts = {}) {
|
|
126168
126187
|
proc.stdin.end();
|
|
126169
|
-
const
|
|
126170
|
-
if (!
|
|
126188
|
+
const gone2 = opts.exited === true || await waitForExit(proc, opts.graceMs ?? STOP_GRACE_MS);
|
|
126189
|
+
if (!gone2) proc.kill("SIGKILL");
|
|
126171
126190
|
}
|
|
126172
126191
|
async function endToolProcess(proc, boundMs) {
|
|
126173
126192
|
proc.kill("SIGKILL");
|
|
@@ -126313,13 +126332,13 @@ var CoreSession = class {
|
|
|
126313
126332
|
watch(proc) {
|
|
126314
126333
|
this.live = proc;
|
|
126315
126334
|
let seen = false;
|
|
126316
|
-
const
|
|
126335
|
+
const gone2 = (code2, err) => {
|
|
126317
126336
|
if (seen) return;
|
|
126318
126337
|
seen = true;
|
|
126319
126338
|
this.exited(proc, code2, err);
|
|
126320
126339
|
};
|
|
126321
|
-
proc.once("exit", (code2) =>
|
|
126322
|
-
proc.on("error", (err) =>
|
|
126340
|
+
proc.once("exit", (code2) => gone2(code2));
|
|
126341
|
+
proc.on("error", (err) => gone2(null, err));
|
|
126323
126342
|
}
|
|
126324
126343
|
send(text3, opts) {
|
|
126325
126344
|
void this.enqueue(text3, opts?.id ?? null, opts?.compact === true);
|
|
@@ -130591,12 +130610,12 @@ var ClaudeSchedules = class _ClaudeSchedules {
|
|
|
130591
130610
|
}
|
|
130592
130611
|
/** The process went away and its timers with it */
|
|
130593
130612
|
release() {
|
|
130594
|
-
const
|
|
130613
|
+
const gone2 = this.live();
|
|
130595
130614
|
this.calls.clear();
|
|
130596
130615
|
this.wakeups.clear();
|
|
130597
130616
|
this.crons.clear();
|
|
130598
130617
|
this.unnamed.clear();
|
|
130599
|
-
return
|
|
130618
|
+
return gone2;
|
|
130600
130619
|
}
|
|
130601
130620
|
};
|
|
130602
130621
|
|
|
@@ -140295,14 +140314,14 @@ var KeptRuns = class {
|
|
|
140295
140314
|
*/
|
|
140296
140315
|
purgeKeptRuns(runIds) {
|
|
140297
140316
|
const tx2 = this.db.transaction(() => {
|
|
140298
|
-
let
|
|
140317
|
+
let gone2 = 0;
|
|
140299
140318
|
for (const id3 of runIds) {
|
|
140300
140319
|
this.db.prepare(`DELETE FROM app_run_messages WHERE run_id = ?`).run(id3);
|
|
140301
140320
|
this.db.prepare(`DELETE FROM app_run_subagent_messages WHERE run_id = ?`).run(id3);
|
|
140302
|
-
|
|
140321
|
+
gone2 += this.db.prepare(`DELETE FROM app_run_records WHERE run_id = ?`).run(id3).changes;
|
|
140303
140322
|
this.db.prepare(`UPDATE app_runs SET request = '', answer = NULL, output = NULL WHERE id = ? AND request IS NOT NULL`).run(id3);
|
|
140304
140323
|
}
|
|
140305
|
-
return
|
|
140324
|
+
return gone2;
|
|
140306
140325
|
});
|
|
140307
140326
|
return tx2();
|
|
140308
140327
|
}
|
|
@@ -144920,8 +144939,8 @@ var AskProjectFlow = class {
|
|
|
144920
144939
|
);
|
|
144921
144940
|
if (!opts.task && !outstanding.length) {
|
|
144922
144941
|
const named3 = (id3) => !wantedSession || id3 === wantedSession || this.host.meta.get(id3)?.name.toLowerCase() === wantedSession.toLowerCase();
|
|
144923
|
-
const
|
|
144924
|
-
if (
|
|
144942
|
+
const gone3 = [...this.host.children.handedOver].find(([id3, h]) => h.from === callerId && this.host.meta.get(id3)?.projectId === target.id && named3(id3));
|
|
144943
|
+
if (gone3) return this.host.delegationFlow.handedOverReply(callerId, gone3[0]);
|
|
144925
144944
|
}
|
|
144926
144945
|
if (!opts.task && !wantedSession && outstanding.length === 1) {
|
|
144927
144946
|
const [key2, pending2] = outstanding[0];
|
|
@@ -144940,8 +144959,8 @@ var AskProjectFlow = class {
|
|
|
144940
144959
|
const current2 = this.host.meta.get(chosen.id);
|
|
144941
144960
|
if (!current2 || current2.projectId !== target.id || !isOrdinary(current2)) return "The chosen session is no longer available";
|
|
144942
144961
|
};
|
|
144943
|
-
const
|
|
144944
|
-
if (
|
|
144962
|
+
const gone2 = available();
|
|
144963
|
+
if (gone2) return { ok: false, error: gone2 };
|
|
144945
144964
|
const consent = await this.host.ensureProjectAccess(callerId, target.id, "delegate", {
|
|
144946
144965
|
text: taskLine(opts.task),
|
|
144947
144966
|
session: { id: chosen.id, name: chosen.name }
|
|
@@ -149104,8 +149123,8 @@ function tellCard(service, giver, card, body, delivered) {
|
|
|
149104
149123
|
}
|
|
149105
149124
|
function withdrawEndedCards(records, session2, stands2) {
|
|
149106
149125
|
records.transaction(() => {
|
|
149107
|
-
const
|
|
149108
|
-
if (
|
|
149126
|
+
const gone2 = records.undeliveredCardNotices(session2).filter(({ message: { facts } }) => facts.card && !stands2(facts.card.session, facts.card.requestId));
|
|
149127
|
+
if (gone2.length) records.deleteRows(gone2.map(({ row }) => ({ messageId: row.messageId, recipient: row.recipient })));
|
|
149109
149128
|
});
|
|
149110
149129
|
}
|
|
149111
149130
|
|
|
@@ -152656,7 +152675,7 @@ function createRpcHandler(mgr2, adapters2, { settleDeletedProjects, deleteOutloo
|
|
|
152656
152675
|
} catch {
|
|
152657
152676
|
}
|
|
152658
152677
|
const name = mail?.projectName(projectId);
|
|
152659
|
-
const
|
|
152678
|
+
const gone2 = () => {
|
|
152660
152679
|
try {
|
|
152661
152680
|
mgr2.cwdOfProject(projectId);
|
|
152662
152681
|
return false;
|
|
@@ -152667,7 +152686,7 @@ function createRpcHandler(mgr2, adapters2, { settleDeletedProjects, deleteOutloo
|
|
|
152667
152686
|
try {
|
|
152668
152687
|
await mgr2.deleteProject(projectId);
|
|
152669
152688
|
} finally {
|
|
152670
|
-
if (name !== void 0 &&
|
|
152689
|
+
if (name !== void 0 && gone2()) mail?.projectDeleted(projectId, name);
|
|
152671
152690
|
}
|
|
152672
152691
|
if (cwd !== null) {
|
|
152673
152692
|
terminals2?.closeCwd(cwd);
|
|
@@ -158263,8 +158282,8 @@ var LinkedMachineConnection = class {
|
|
|
158263
158282
|
const connected = this.status === "connected";
|
|
158264
158283
|
const told = this.reportedUsed.filter((r) => (r.settled || !connected) && !this.revokedHere.has(r.credential.id)).map((r) => r.answered ? r.credential : withoutGone(r.credential));
|
|
158265
158284
|
if (!connected || !line || !all) {
|
|
158266
|
-
const
|
|
158267
|
-
return { otherCredentials:
|
|
158285
|
+
const gone2 = told.slice(0, OTHER_CREDENTIALS_SHOWN).map(({ check: _check2, own: _own, ...c }) => ({ ...c, hubsName: !!line?.pairedAs && c.label === line.pairedAs }));
|
|
158286
|
+
return { otherCredentials: gone2.length ? gone2 : null, otherCredentialsMore: 0, ownCredentialGone: this.ownCredentialTaken, credentialFileUnreadable };
|
|
158268
158287
|
}
|
|
158269
158288
|
const named3 = new Set(all.filter((c) => c.own !== true).map((c) => c.id));
|
|
158270
158289
|
const others = [...all, ...this.notPairedHere(line, all), ...told.filter((c) => !named3.has(c.id))].filter((c) => !this.isCurrent(c, line) && !this.revokedHere.has(c.id));
|
|
@@ -161645,7 +161664,7 @@ var handedToken = launch.tokenOnStdin ? await readHandedToken(process.stdin).cat
|
|
|
161645
161664
|
console.error(`[agent-host] the launcher did not hand over the token: ${e.message}`);
|
|
161646
161665
|
process.exit(1);
|
|
161647
161666
|
}) : launch.token;
|
|
161648
|
-
var BUILD = true ? "
|
|
161667
|
+
var BUILD = true ? "a72bb19" : "dev";
|
|
161649
161668
|
var { values } = parseArgs({
|
|
161650
161669
|
options: {
|
|
161651
161670
|
port: { type: "string", default: "5175" },
|
package/package.json
CHANGED