@linkshell/host 0.4.86 → 0.4.88
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/host/src/children.d.ts +43 -0
- package/dist/host/src/children.js +213 -0
- package/dist/host/src/children.js.map +1 -0
- package/dist/host/src/drivers/acp/antigravity.js +1 -1
- package/dist/host/src/drivers/acp/antigravity.js.map +1 -1
- package/dist/host/src/drivers/acp/client-services.js +2 -0
- package/dist/host/src/drivers/acp/client-services.js.map +1 -1
- package/dist/host/src/drivers/acp/connection.js +8 -2
- package/dist/host/src/drivers/acp/connection.js.map +1 -1
- package/dist/host/src/drivers/acp/driver.d.ts +1 -5
- package/dist/host/src/drivers/acp/driver.js +11 -16
- package/dist/host/src/drivers/acp/driver.js.map +1 -1
- package/dist/host/src/drivers/acp/mcp.js +2 -0
- package/dist/host/src/drivers/acp/mcp.js.map +1 -1
- package/dist/host/src/drivers/claude/activity.js +13 -0
- package/dist/host/src/drivers/claude/activity.js.map +1 -1
- package/dist/host/src/drivers/claude/driver.d.ts +15 -0
- package/dist/host/src/drivers/claude/driver.js +44 -2
- package/dist/host/src/drivers/claude/driver.js.map +1 -1
- package/dist/host/src/drivers/claude/mcp-apps.d.ts +70 -0
- package/dist/host/src/drivers/claude/mcp-apps.js +399 -0
- package/dist/host/src/drivers/claude/mcp-apps.js.map +1 -0
- package/dist/host/src/drivers/claude/task-process.d.ts +23 -0
- package/dist/host/src/drivers/claude/task-process.js +121 -0
- package/dist/host/src/drivers/claude/task-process.js.map +1 -0
- package/dist/host/src/drivers/claude/tasks.d.ts +8 -1
- package/dist/host/src/drivers/claude/tasks.js +34 -6
- package/dist/host/src/drivers/claude/tasks.js.map +1 -1
- package/dist/host/src/drivers/codex/driver.d.ts +21 -0
- package/dist/host/src/drivers/codex/driver.js +99 -12
- package/dist/host/src/drivers/codex/driver.js.map +1 -1
- package/dist/host/src/drivers/queue.d.ts +4 -0
- package/dist/host/src/drivers/queue.js +9 -0
- package/dist/host/src/drivers/queue.js.map +1 -0
- package/dist/host/src/drivers/types.d.ts +1 -1
- package/dist/host/src/fs.js +8 -8
- package/dist/host/src/fs.js.map +1 -1
- package/dist/host/src/gateway.js +3 -3
- package/dist/host/src/gateway.js.map +1 -1
- package/dist/host/src/host.js +6 -0
- package/dist/host/src/host.js.map +1 -1
- package/dist/host/src/hub.js +28 -14
- package/dist/host/src/hub.js.map +1 -1
- package/dist/host/src/ports.js +3 -3
- package/dist/host/src/ports.js.map +1 -1
- package/dist/host/src/process.d.ts +8 -2
- package/dist/host/src/process.js +37 -2
- package/dist/host/src/process.js.map +1 -1
- package/dist/host/src/rpc/mcp.d.ts +1 -1
- package/dist/host/src/rpc/mcp.js +2 -2
- package/dist/host/src/rpc/mcp.js.map +1 -1
- package/dist/host/src/rpc/server.js +5 -5
- package/dist/host/src/rpc/server.js.map +1 -1
- package/dist/host/src/screen-viewer.js +7 -7
- package/dist/host/src/screen.js +3 -3
- package/dist/host/src/screen.js.map +1 -1
- package/dist/host/src/slim.js +16 -4
- package/dist/host/src/slim.js.map +1 -1
- package/dist/host/src/store.js +8 -4
- package/dist/host/src/store.js.map +1 -1
- package/dist/host/src/terminals.js +15 -8
- package/dist/host/src/terminals.js.map +1 -1
- package/dist/host/tsconfig.tsbuildinfo +1 -1
- package/dist/wire/src/model.d.ts +4 -0
- package/dist/wire/src/model.js +4 -0
- package/dist/wire/src/model.js.map +1 -1
- package/dist/wire/src/peer.js +4 -4
- package/dist/wire/src/peer.js.map +1 -1
- package/dist/wire/src/relay-client.js +9 -9
- package/dist/wire/src/relay-client.js.map +1 -1
- package/dist/wire/src/relay.js +2 -2
- package/dist/wire/src/relay.js.map +1 -1
- package/dist/wire/src/rpc-mcp.js +5 -4
- package/dist/wire/src/rpc-mcp.js.map +1 -1
- package/dist/wire/src/rpc.d.ts +5 -0
- package/dist/wire/src/updates.js +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
export interface ChildEntry {
|
|
3
|
+
pid: number;
|
|
4
|
+
kind: string;
|
|
5
|
+
/** What was spawned, compared with `ps` so a reused pid is never mistaken for ours. */
|
|
6
|
+
argv: string[];
|
|
7
|
+
/** Wall-clock ms right after spawn returned: the process started just before. */
|
|
8
|
+
startedAt: number;
|
|
9
|
+
/** Spawned as its own process group, so its own children go with it. */
|
|
10
|
+
group: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** One file per host process: a host still shutting down never overwrites its successor's. */
|
|
13
|
+
export declare class ChildRegistry {
|
|
14
|
+
readonly runDir: string;
|
|
15
|
+
private readonly entries;
|
|
16
|
+
readonly path: string;
|
|
17
|
+
constructor(runDir: string);
|
|
18
|
+
add(entry: ChildEntry): void;
|
|
19
|
+
remove(pid: number): void;
|
|
20
|
+
list(): ChildEntry[];
|
|
21
|
+
private write;
|
|
22
|
+
/** At a clean stop: ends what the drivers' own stop paths left running, then forgets the file. */
|
|
23
|
+
close(log: (message: string) => void): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
/** Children spawned from now on are recorded under `runDir`, until the registry is closed. */
|
|
26
|
+
export declare function openChildRegistry(runDir: string): ChildRegistry;
|
|
27
|
+
/** Records a running child; returns what to call once it has exited. */
|
|
28
|
+
export declare function trackPid(pid: number | undefined, kind: string, command: string, args: readonly string[], group: boolean): () => void;
|
|
29
|
+
export declare function trackChild(child: ChildProcess, kind: string, command: string, args: readonly string[], group: boolean): void;
|
|
30
|
+
/**
|
|
31
|
+
* Ends the children earlier hosts recorded under `runDir` that are still the
|
|
32
|
+
* same processes. Call only once no other host answers on this run directory.
|
|
33
|
+
*/
|
|
34
|
+
export declare function reapOrphans(runDir: string, log: (message: string) => void): Promise<number>;
|
|
35
|
+
/**
|
|
36
|
+
* Still the process we spawned: started when we spawned it, and its command line
|
|
37
|
+
* is what we ran. A script run through its shebang shows as `node /path/script …`,
|
|
38
|
+
* so the program is looked for by name among the words, and the arguments at the end.
|
|
39
|
+
*/
|
|
40
|
+
export declare function sameProcess(entry: ChildEntry, seen: {
|
|
41
|
+
started: number;
|
|
42
|
+
command: string;
|
|
43
|
+
}): boolean;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { basename, join } from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
// A host that dies without running its stop path (SIGKILL, a crash) leaves its
|
|
6
|
+
// agents, MCP servers and agent-run commands reparented to launchd/init, where
|
|
7
|
+
// many keep running: nothing closes them, and some ignore stdin closing. Each
|
|
8
|
+
// long-lived child is written down while it runs, so the next host can end what
|
|
9
|
+
// the last one left. Windows has no `ps` to prove a pid is still the same
|
|
10
|
+
// process, so there nothing is recorded and nothing is ended.
|
|
11
|
+
const run = promisify(execFile);
|
|
12
|
+
const FILE = /^children-(\d+)\.json$/;
|
|
13
|
+
/** `ps` start times have one-second resolution, and on Linux drift with clock adjustments since boot. */
|
|
14
|
+
const START_TOLERANCE_MS = 10_000;
|
|
15
|
+
const supported = process.platform !== "win32";
|
|
16
|
+
/** One file per host process: a host still shutting down never overwrites its successor's. */
|
|
17
|
+
export class ChildRegistry {
|
|
18
|
+
runDir;
|
|
19
|
+
entries = new Map();
|
|
20
|
+
path;
|
|
21
|
+
constructor(runDir) {
|
|
22
|
+
this.runDir = runDir;
|
|
23
|
+
this.path = join(runDir, `children-${process.pid}.json`);
|
|
24
|
+
}
|
|
25
|
+
add(entry) {
|
|
26
|
+
this.entries.set(entry.pid, entry);
|
|
27
|
+
this.write();
|
|
28
|
+
}
|
|
29
|
+
remove(pid) {
|
|
30
|
+
if (this.entries.delete(pid))
|
|
31
|
+
this.write();
|
|
32
|
+
}
|
|
33
|
+
list() {
|
|
34
|
+
return [...this.entries.values()];
|
|
35
|
+
}
|
|
36
|
+
write() {
|
|
37
|
+
try {
|
|
38
|
+
const temporary = `${this.path}.tmp`;
|
|
39
|
+
writeFileSync(temporary, JSON.stringify(this.list()), { mode: 0o600 });
|
|
40
|
+
renameSync(temporary, this.path);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// The run directory went away: there is nothing left to protect.
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** At a clean stop: ends what the drivers' own stop paths left running, then forgets the file. */
|
|
47
|
+
async close(log) {
|
|
48
|
+
const index = active.indexOf(this);
|
|
49
|
+
if (index >= 0)
|
|
50
|
+
active.splice(index, 1);
|
|
51
|
+
// A second host in this process (tests only) may have had its children recorded here.
|
|
52
|
+
if (active.length === 0 && this.entries.size > 0)
|
|
53
|
+
await reap(this.list(), log, "still running at stop");
|
|
54
|
+
this.entries.clear();
|
|
55
|
+
rmSync(this.path, { force: true });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Process-wide because a host is one per process, and the spawn sites sit deep
|
|
59
|
+
// in drivers that know nothing of the host's paths.
|
|
60
|
+
const active = [];
|
|
61
|
+
/** Children spawned from now on are recorded under `runDir`, until the registry is closed. */
|
|
62
|
+
export function openChildRegistry(runDir) {
|
|
63
|
+
const registry = new ChildRegistry(runDir);
|
|
64
|
+
if (supported)
|
|
65
|
+
active.push(registry);
|
|
66
|
+
return registry;
|
|
67
|
+
}
|
|
68
|
+
/** Records a running child; returns what to call once it has exited. */
|
|
69
|
+
export function trackPid(pid, kind, command, args, group) {
|
|
70
|
+
const registry = active.at(-1);
|
|
71
|
+
if (!registry || !pid)
|
|
72
|
+
return () => { };
|
|
73
|
+
registry.add({ pid, kind, argv: [command, ...args], startedAt: Date.now(), group });
|
|
74
|
+
return () => registry.remove(pid);
|
|
75
|
+
}
|
|
76
|
+
export function trackChild(child, kind, command, args, group) {
|
|
77
|
+
if (!child.pid)
|
|
78
|
+
return;
|
|
79
|
+
child.once("exit", trackPid(child.pid, kind, command, args, group));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Ends the children earlier hosts recorded under `runDir` that are still the
|
|
83
|
+
* same processes. Call only once no other host answers on this run directory.
|
|
84
|
+
*/
|
|
85
|
+
export async function reapOrphans(runDir, log) {
|
|
86
|
+
if (!supported)
|
|
87
|
+
return 0;
|
|
88
|
+
const files = [];
|
|
89
|
+
try {
|
|
90
|
+
for (const name of readdirSync(runDir)) {
|
|
91
|
+
const match = FILE.exec(name);
|
|
92
|
+
const host = Number(match?.[1]);
|
|
93
|
+
// A host that is still alive (starting up beside us before its socket
|
|
94
|
+
// exists, or still shutting down) keeps its own. A dead host's pid that
|
|
95
|
+
// was reused only delays its record to a later start.
|
|
96
|
+
if (match && (host === process.pid || !alive(host)))
|
|
97
|
+
files.push(join(runDir, name));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return 0;
|
|
102
|
+
}
|
|
103
|
+
const entries = files.flatMap((file) => {
|
|
104
|
+
try {
|
|
105
|
+
const parsed = JSON.parse(readFileSync(file, "utf8"));
|
|
106
|
+
return Array.isArray(parsed) ? parsed.filter(validEntry) : [];
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
const ended = entries.length > 0 ? await reap(entries, log, "left by an earlier host") : 0;
|
|
113
|
+
for (const file of files)
|
|
114
|
+
rmSync(file, { force: true });
|
|
115
|
+
return ended;
|
|
116
|
+
}
|
|
117
|
+
function validEntry(value) {
|
|
118
|
+
const entry = value;
|
|
119
|
+
return !!entry && Number.isSafeInteger(entry.pid) && entry.pid > 1 && typeof entry.kind === "string"
|
|
120
|
+
&& Array.isArray(entry.argv) && entry.argv.length > 0 && entry.argv.every((part) => typeof part === "string")
|
|
121
|
+
&& typeof entry.startedAt === "number" && typeof entry.group === "boolean";
|
|
122
|
+
}
|
|
123
|
+
async function processTable() {
|
|
124
|
+
const { stdout } = await run("ps", ["-A", "-ww", "-o", "pid=,pgid=,lstart=,command="], {
|
|
125
|
+
env: { ...process.env, LC_ALL: "C", TZ: "UTC" },
|
|
126
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
127
|
+
timeout: 5000,
|
|
128
|
+
});
|
|
129
|
+
const table = new Map();
|
|
130
|
+
for (const line of stdout.split("\n")) {
|
|
131
|
+
const match = /^\s*(\d+)\s+(\d+)\s+(\w{3} \w{3} [ \d]\d \d\d:\d\d:\d\d \d{4})\s+(.*)$/.exec(line);
|
|
132
|
+
if (!match)
|
|
133
|
+
continue;
|
|
134
|
+
const started = Date.parse(`${match[3]} GMT`);
|
|
135
|
+
if (Number.isFinite(started))
|
|
136
|
+
table.set(Number(match[1]), { pgid: Number(match[2]), started, command: match[4] });
|
|
137
|
+
}
|
|
138
|
+
return table;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Still the process we spawned: started when we spawned it, and its command line
|
|
142
|
+
* is what we ran. A script run through its shebang shows as `node /path/script …`,
|
|
143
|
+
* so the program is looked for by name among the words, and the arguments at the end.
|
|
144
|
+
*/
|
|
145
|
+
export function sameProcess(entry, seen) {
|
|
146
|
+
if (Math.abs(seen.started - entry.startedAt) > START_TOLERANCE_MS)
|
|
147
|
+
return false;
|
|
148
|
+
const [program, ...args] = entry.argv;
|
|
149
|
+
const name = basename(program);
|
|
150
|
+
const command = seen.command.trimEnd();
|
|
151
|
+
if (!name || !command.split(" ").some((word) => word === program || basename(word) === name))
|
|
152
|
+
return false;
|
|
153
|
+
return args.length === 0 || command.endsWith(` ${args.join(" ")}`);
|
|
154
|
+
}
|
|
155
|
+
const alive = (pid) => {
|
|
156
|
+
try {
|
|
157
|
+
process.kill(pid, 0);
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
catch (error) {
|
|
161
|
+
return error.code === "EPERM";
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const send = (pid, signal) => {
|
|
165
|
+
try {
|
|
166
|
+
process.kill(pid, signal);
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
// Already gone.
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
/** SIGTERM, up to three seconds, then SIGKILL, for the entries `ps` confirms are still ours. */
|
|
173
|
+
async function reap(entries, log, why) {
|
|
174
|
+
let before;
|
|
175
|
+
try {
|
|
176
|
+
before = await processTable();
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return 0;
|
|
180
|
+
}
|
|
181
|
+
const ours = entries.filter((entry) => entry.pid !== process.pid && before.has(entry.pid) && sameProcess(entry, before.get(entry.pid)));
|
|
182
|
+
if (ours.length === 0)
|
|
183
|
+
return 0;
|
|
184
|
+
// Only a leader seen at the head of its own group has the group signalled.
|
|
185
|
+
const target = (entry, table) => (entry.group && table.get(entry.pid)?.pgid === entry.pid ? -entry.pid : entry.pid);
|
|
186
|
+
for (const entry of ours) {
|
|
187
|
+
log(`[host] ending ${entry.kind} (pid ${entry.pid}) ${why}`);
|
|
188
|
+
send(target(entry, before), "SIGTERM");
|
|
189
|
+
}
|
|
190
|
+
const deadline = Date.now() + 3000;
|
|
191
|
+
while (ours.some((entry) => alive(entry.pid)) && Date.now() < deadline)
|
|
192
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
193
|
+
let after;
|
|
194
|
+
try {
|
|
195
|
+
after = await processTable();
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
after = new Map();
|
|
199
|
+
}
|
|
200
|
+
const groups = new Set([...after.values()].map((seen) => seen.pgid));
|
|
201
|
+
for (const entry of ours) {
|
|
202
|
+
const seen = after.get(entry.pid);
|
|
203
|
+
if (seen && sameProcess(entry, seen))
|
|
204
|
+
send(target(entry, after), "SIGKILL");
|
|
205
|
+
// The leader went on SIGTERM but left children behind. A pid is never handed
|
|
206
|
+
// out while a group of that id exists, so with no process of that pid the
|
|
207
|
+
// group is still the one we saw a moment ago.
|
|
208
|
+
else if (!seen && entry.group && before.get(entry.pid)?.pgid === entry.pid && groups.has(entry.pid))
|
|
209
|
+
send(-entry.pid, "SIGKILL");
|
|
210
|
+
}
|
|
211
|
+
return ours.length;
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=children.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"children.js","sourceRoot":"","sources":["../../../src/children.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,0EAA0E;AAC1E,8DAA8D;AAE9D,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAmBhC,MAAM,IAAI,GAAG,wBAAwB,CAAC;AACtC,yGAAyG;AACzG,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAE/C,8FAA8F;AAC9F,MAAM,OAAO,aAAa;IAIH;IAHJ,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;IAChD,IAAI,CAAS;IAEtB,YAAqB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,YAAY,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,GAAG,CAAC,KAAiB;QACnB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,IAAI,IAAI,CAAC,OAAO,CAAC,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AAC;IACnI,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB,CAAC"}
|
|
@@ -2493,7 +2493,7 @@ export class AntigravityDriver extends AcpDriver {
|
|
|
2493
2493
|
.trim();
|
|
2494
2494
|
const imageBlocks = content.filter((block) => block.type === "image");
|
|
2495
2495
|
if (!text && imageBlocks.length === 0)
|
|
2496
|
-
throw RpcError.app("invalid_params", "
|
|
2496
|
+
throw RpcError.app("invalid_params", "没有可发送的内容");
|
|
2497
2497
|
let watcher = this.desktopWatchers.get(nativeId);
|
|
2498
2498
|
if (!watcher) {
|
|
2499
2499
|
const transcriptPath = this.transcriptPathFor(nativeId);
|