@xenosystem/agent-interface-host 0.1.79 → 0.1.81
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.
|
@@ -36,6 +36,35 @@
|
|
|
36
36
|
* coupling was a static import of the electron-host package pulling `electron`
|
|
37
37
|
* into the shared bundle chunk — invisible to every in-process test, fatal to
|
|
38
38
|
* the built entry, and now a dynamic import gated on a window.
|
|
39
|
+
*
|
|
40
|
+
* ## 🔴 On Windows the host must inherit NOTHING from the launcher
|
|
41
|
+
*
|
|
42
|
+
* Measured 2026-09-26 in XENO Canvas: about one quit in four hung for good. Canvas ran its whole
|
|
43
|
+
* shutdown, reported `process exit 0`, and its OS process stayed up until the detached host died —
|
|
44
|
+
* which, by design, is never. The host had inherited handles belonging to Canvas's process.
|
|
45
|
+
*
|
|
46
|
+
* `spawn` cannot prevent that. libuv calls `CreateProcess` with `bInheritHandles = TRUE` so it can
|
|
47
|
+
* pass stdio, and a Windows child then inherits EVERY handle marked inheritable at that instant —
|
|
48
|
+
* not only its stdio. Node itself keeps its handles non-inheritable, but an Electron main process
|
|
49
|
+
* is also Chromium, which launches its own helpers from other threads and holds inheritable
|
|
50
|
+
* handles while it does. Launched during that window, the host takes some of them. Passing
|
|
51
|
+
* `stdio: 'ignore'` did not help (measured: still 2 in 25), because those handles are not stdio.
|
|
52
|
+
*
|
|
53
|
+
* So on Windows the host is started through ShellExecute (`Start-Process`), which never inherits
|
|
54
|
+
* handles. The measurements that settled it, 25 human-style quits each:
|
|
55
|
+
*
|
|
56
|
+
* | launch | hung quits |
|
|
57
|
+
* |-----------------------------------------------|-----------:|
|
|
58
|
+
* | `spawn` (inheriting), as before | 6–7 / 25 |
|
|
59
|
+
* | PowerShell hop that DOES inherit | 7 / 25 |
|
|
60
|
+
* | ShellExecute, inheriting nothing | 0 / 25 |
|
|
61
|
+
* | host already running, Canvas only attaches | 0 / 25 |
|
|
62
|
+
*
|
|
63
|
+
* With no pipes, the child's ready line and its own words travel through an OUTPUT FILE instead:
|
|
64
|
+
* the entry appends every protocol line and anything it writes to stderr, and this tails it. The
|
|
65
|
+
* contract is unchanged — readiness is still a signal, a failure is still quoted, a timeout still
|
|
66
|
+
* kills — only the transport differs. POSIX keeps pipes: libuv sets close-on-exec there, so
|
|
67
|
+
* nothing but stdio crosses `exec`.
|
|
39
68
|
*/
|
|
40
69
|
import { spawn } from 'node:child_process';
|
|
41
70
|
/** The line the child prints once it owns the lease and is serving. */
|
|
@@ -78,9 +107,37 @@ export interface DetachedHostSupervisorOptions {
|
|
|
78
107
|
signal: NodeJS.Signals | null;
|
|
79
108
|
output: string;
|
|
80
109
|
}) => void;
|
|
110
|
+
/**
|
|
111
|
+
* How the child is started.
|
|
112
|
+
*
|
|
113
|
+
* `no-inherit` (the default on Windows) starts it through ShellExecute so it inherits no handle
|
|
114
|
+
* from this process, and reads its protocol lines from an output file. `pipes` (the default
|
|
115
|
+
* elsewhere, and whenever `spawnFn` is injected) is `spawn` with stdout/stderr pipes.
|
|
116
|
+
*/
|
|
117
|
+
launchMode?: 'pipes' | 'no-inherit';
|
|
118
|
+
/**
|
|
119
|
+
* `no-inherit` only: where the child's output file goes. It doubles as the host's startup log —
|
|
120
|
+
* the only record of what a host said before it was serving — so callers pass the host root's
|
|
121
|
+
* `logs` directory. Defaults to a directory under the OS temp dir. The newest few are kept.
|
|
122
|
+
*/
|
|
123
|
+
outputDirectory?: string;
|
|
81
124
|
/** Injected for tests. */
|
|
82
125
|
spawnFn?: typeof spawn;
|
|
126
|
+
/** `no-inherit` only, injected for tests: starts the child and resolves its pid. */
|
|
127
|
+
launchFn?: (request: DetachedHostLaunchRequest) => Promise<number>;
|
|
128
|
+
}
|
|
129
|
+
/** What a `no-inherit` launch is asked to start. */
|
|
130
|
+
export interface DetachedHostLaunchRequest {
|
|
131
|
+
execPath: string;
|
|
132
|
+
entryPath: string;
|
|
133
|
+
env: NodeJS.ProcessEnv;
|
|
134
|
+
cwd?: string;
|
|
83
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* The environment variable naming the file a `no-inherit` child writes its protocol lines to.
|
|
138
|
+
* The entry appends every line it would print, and mirrors its stderr, into that file.
|
|
139
|
+
*/
|
|
140
|
+
export declare const DETACHED_HOST_OUTPUT_ENV = "XENO_AGENT_DETACHED_OUTPUT";
|
|
84
141
|
export declare class DetachedHostStartError extends Error {
|
|
85
142
|
/** Everything the child said, so a failure is diagnosable from one message. */
|
|
86
143
|
readonly childOutput: string;
|
|
@@ -97,4 +154,13 @@ export interface DetachedHostSupervisorHandle {
|
|
|
97
154
|
stop(): Promise<void>;
|
|
98
155
|
}
|
|
99
156
|
export declare function superviseDetachedHost(options: DetachedHostSupervisorOptions): Promise<DetachedHostSupervisorHandle>;
|
|
157
|
+
/**
|
|
158
|
+
* Starts the child through ShellExecute (`Start-Process`), which calls `CreateProcess` with
|
|
159
|
+
* `bInheritHandles = FALSE`. The PowerShell that does it is itself a short-lived `spawn` child, so
|
|
160
|
+
* whatever IT inherits is released when it exits a moment later — the host never sees any of it.
|
|
161
|
+
*
|
|
162
|
+
* Paths travel in environment variables and are removed before the host starts, so no caller value
|
|
163
|
+
* is ever interpolated into the script and the host's environment is exactly the one requested.
|
|
164
|
+
*/
|
|
165
|
+
export declare function launchWithShellExecute(request: DetachedHostLaunchRequest): Promise<number>;
|
|
100
166
|
//# sourceMappingURL=detachedHostSupervisor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detachedHostSupervisor.d.ts","sourceRoot":"","sources":["../src/detachedHostSupervisor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"detachedHostSupervisor.d.ts","sourceRoot":"","sources":["../src/detachedHostSupervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,EAAE,KAAK,EAA+B,MAAM,oBAAoB,CAAA;AA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ED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,+BAA+B,CAAA;AAEpE,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;gBAEhB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;CAKjD;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,KAAK,EAAE,uBAAuB,CAAA;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC,CAAA;IAChF,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAOD,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,4BAA4B,CAAC,CAIvC;AA6OD;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiChG"}
|
|
@@ -36,8 +36,46 @@
|
|
|
36
36
|
* coupling was a static import of the electron-host package pulling `electron`
|
|
37
37
|
* into the shared bundle chunk — invisible to every in-process test, fatal to
|
|
38
38
|
* the built entry, and now a dynamic import gated on a window.
|
|
39
|
+
*
|
|
40
|
+
* ## 🔴 On Windows the host must inherit NOTHING from the launcher
|
|
41
|
+
*
|
|
42
|
+
* Measured 2026-09-26 in XENO Canvas: about one quit in four hung for good. Canvas ran its whole
|
|
43
|
+
* shutdown, reported `process exit 0`, and its OS process stayed up until the detached host died —
|
|
44
|
+
* which, by design, is never. The host had inherited handles belonging to Canvas's process.
|
|
45
|
+
*
|
|
46
|
+
* `spawn` cannot prevent that. libuv calls `CreateProcess` with `bInheritHandles = TRUE` so it can
|
|
47
|
+
* pass stdio, and a Windows child then inherits EVERY handle marked inheritable at that instant —
|
|
48
|
+
* not only its stdio. Node itself keeps its handles non-inheritable, but an Electron main process
|
|
49
|
+
* is also Chromium, which launches its own helpers from other threads and holds inheritable
|
|
50
|
+
* handles while it does. Launched during that window, the host takes some of them. Passing
|
|
51
|
+
* `stdio: 'ignore'` did not help (measured: still 2 in 25), because those handles are not stdio.
|
|
52
|
+
*
|
|
53
|
+
* So on Windows the host is started through ShellExecute (`Start-Process`), which never inherits
|
|
54
|
+
* handles. The measurements that settled it, 25 human-style quits each:
|
|
55
|
+
*
|
|
56
|
+
* | launch | hung quits |
|
|
57
|
+
* |-----------------------------------------------|-----------:|
|
|
58
|
+
* | `spawn` (inheriting), as before | 6–7 / 25 |
|
|
59
|
+
* | PowerShell hop that DOES inherit | 7 / 25 |
|
|
60
|
+
* | ShellExecute, inheriting nothing | 0 / 25 |
|
|
61
|
+
* | host already running, Canvas only attaches | 0 / 25 |
|
|
62
|
+
*
|
|
63
|
+
* With no pipes, the child's ready line and its own words travel through an OUTPUT FILE instead:
|
|
64
|
+
* the entry appends every protocol line and anything it writes to stderr, and this tails it. The
|
|
65
|
+
* contract is unchanged — readiness is still a signal, a failure is still quoted, a timeout still
|
|
66
|
+
* kills — only the transport differs. POSIX keeps pipes: libuv sets close-on-exec there, so
|
|
67
|
+
* nothing but stdio crosses `exec`.
|
|
68
|
+
*/
|
|
69
|
+
import { spawn, execFile } from 'node:child_process';
|
|
70
|
+
import { closeSync, mkdirSync, openSync, readdirSync, readSync, rmSync, statSync } from 'node:fs';
|
|
71
|
+
import { tmpdir } from 'node:os';
|
|
72
|
+
import { join, win32 } from 'node:path';
|
|
73
|
+
import { randomUUID } from 'node:crypto';
|
|
74
|
+
/**
|
|
75
|
+
* The environment variable naming the file a `no-inherit` child writes its protocol lines to.
|
|
76
|
+
* The entry appends every line it would print, and mirrors its stderr, into that file.
|
|
39
77
|
*/
|
|
40
|
-
|
|
78
|
+
export const DETACHED_HOST_OUTPUT_ENV = 'XENO_AGENT_DETACHED_OUTPUT';
|
|
41
79
|
export class DetachedHostStartError extends Error {
|
|
42
80
|
/** Everything the child said, so a failure is diagnosable from one message. */
|
|
43
81
|
childOutput;
|
|
@@ -48,7 +86,15 @@ export class DetachedHostStartError extends Error {
|
|
|
48
86
|
}
|
|
49
87
|
}
|
|
50
88
|
const DEFAULT_READY_TIMEOUT_MS = 30_000;
|
|
89
|
+
/** Output files kept per directory: enough to read the last few starts, never an unbounded log. */
|
|
90
|
+
const KEEP_OUTPUT_FILES = 8;
|
|
91
|
+
const OUTPUT_FILE_PREFIX = 'detached-host-';
|
|
51
92
|
export async function superviseDetachedHost(options) {
|
|
93
|
+
const mode = options.launchMode
|
|
94
|
+
?? (process.platform === 'win32' && !options.spawnFn ? 'no-inherit' : 'pipes');
|
|
95
|
+
return mode === 'no-inherit' ? superviseWithoutInheritance(options) : superviseWithPipes(options);
|
|
96
|
+
}
|
|
97
|
+
async function superviseWithPipes(options) {
|
|
52
98
|
const spawnImpl = options.spawnFn ?? spawn;
|
|
53
99
|
const child = spawnImpl(options.execPath, [options.entryPath], {
|
|
54
100
|
...(options.cwd ? { cwd: options.cwd } : {}),
|
|
@@ -149,6 +195,210 @@ export async function superviseDetachedHost(options) {
|
|
|
149
195
|
},
|
|
150
196
|
};
|
|
151
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* The Windows launch: the child inherits no handle, and talks through a file.
|
|
200
|
+
*
|
|
201
|
+
* Same contract as the pipe path — resolve on the ready line, reject with the child's own words if
|
|
202
|
+
* it dies first, kill it on timeout, report its exit — with the pid polled for liveness, because
|
|
203
|
+
* there is no `ChildProcess` to raise `exit`. The exit code is not observable this way, so it is
|
|
204
|
+
* reported as `null`; the lease, not this handle, is what tells a live owner from a dead one.
|
|
205
|
+
*/
|
|
206
|
+
async function superviseWithoutInheritance(options) {
|
|
207
|
+
const directory = options.outputDirectory ?? join(tmpdir(), 'xeno-agent-host');
|
|
208
|
+
mkdirSync(directory, { recursive: true });
|
|
209
|
+
pruneOutputFiles(directory);
|
|
210
|
+
const outputPath = join(directory, `${OUTPUT_FILE_PREFIX}${new Date().toISOString().replace(/[:.]/g, '-')}-${randomUUID().slice(0, 8)}.log`);
|
|
211
|
+
closeSync(openSync(outputPath, 'a'));
|
|
212
|
+
const tail = createFileTail(outputPath);
|
|
213
|
+
let output = '';
|
|
214
|
+
const drain = () => {
|
|
215
|
+
const text = tail.read();
|
|
216
|
+
if (text) {
|
|
217
|
+
output = (output + text).slice(-65_536);
|
|
218
|
+
options.onOutput?.(text);
|
|
219
|
+
}
|
|
220
|
+
return text;
|
|
221
|
+
};
|
|
222
|
+
const launch = options.launchFn ?? launchWithShellExecute;
|
|
223
|
+
let pid;
|
|
224
|
+
try {
|
|
225
|
+
pid = await launch({
|
|
226
|
+
execPath: options.execPath,
|
|
227
|
+
entryPath: options.entryPath,
|
|
228
|
+
env: {
|
|
229
|
+
...process.env,
|
|
230
|
+
ELECTRON_RUN_AS_NODE: '1',
|
|
231
|
+
...options.env,
|
|
232
|
+
[DETACHED_HOST_OUTPUT_ENV]: outputPath,
|
|
233
|
+
},
|
|
234
|
+
...(options.cwd ? { cwd: options.cwd } : {}),
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
tail.close();
|
|
239
|
+
throw new DetachedHostStartError(`The Agent host process could not be started: ${error instanceof Error ? error.message : String(error)}`, drain());
|
|
240
|
+
}
|
|
241
|
+
let hasExited = false;
|
|
242
|
+
let settleExit = () => { };
|
|
243
|
+
const exited = new Promise((resolve) => {
|
|
244
|
+
settleExit = resolve;
|
|
245
|
+
});
|
|
246
|
+
const observeExit = () => {
|
|
247
|
+
if (hasExited)
|
|
248
|
+
return true;
|
|
249
|
+
if (processIsAlive(pid))
|
|
250
|
+
return false;
|
|
251
|
+
hasExited = true;
|
|
252
|
+
drain();
|
|
253
|
+
tail.close();
|
|
254
|
+
options.onExit?.({ code: null, signal: null, output });
|
|
255
|
+
settleExit({ code: null, signal: null });
|
|
256
|
+
return true;
|
|
257
|
+
};
|
|
258
|
+
const timeoutMs = options.readyTimeoutMs ?? DEFAULT_READY_TIMEOUT_MS;
|
|
259
|
+
const ready = await new Promise((resolve, reject) => {
|
|
260
|
+
const deadline = Date.now() + timeoutMs;
|
|
261
|
+
let buffer = '';
|
|
262
|
+
const poll = () => {
|
|
263
|
+
buffer += drain();
|
|
264
|
+
let index = buffer.indexOf('\n');
|
|
265
|
+
while (index >= 0) {
|
|
266
|
+
const signal = parseReady(buffer.slice(0, index).trim());
|
|
267
|
+
buffer = buffer.slice(index + 1);
|
|
268
|
+
if (signal) {
|
|
269
|
+
resolve(signal);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
index = buffer.indexOf('\n');
|
|
273
|
+
}
|
|
274
|
+
if (observeExit()) {
|
|
275
|
+
reject(new DetachedHostStartError('The Agent host process exited before it was ready.', output));
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
if (Date.now() >= deadline) {
|
|
279
|
+
// Killed rather than left running, exactly as on the pipe path: it may already hold the
|
|
280
|
+
// lease, and left alive it would demote every future launch of this app.
|
|
281
|
+
killQuietly(pid);
|
|
282
|
+
reject(new DetachedHostStartError(`The Agent host process did not report ready within ${timeoutMs}ms.`, output));
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
setTimeout(poll, 50);
|
|
286
|
+
};
|
|
287
|
+
poll();
|
|
288
|
+
});
|
|
289
|
+
// Keep forwarding what the host says and notice when it goes — unref'd, like the pipe path, so
|
|
290
|
+
// the launching GUI can still exit while the host keeps serving.
|
|
291
|
+
const watch = setInterval(() => {
|
|
292
|
+
drain();
|
|
293
|
+
if (observeExit())
|
|
294
|
+
clearInterval(watch);
|
|
295
|
+
}, 1_000);
|
|
296
|
+
watch.unref();
|
|
297
|
+
return {
|
|
298
|
+
ready,
|
|
299
|
+
pid,
|
|
300
|
+
exited,
|
|
301
|
+
stop: async () => {
|
|
302
|
+
if (hasExited)
|
|
303
|
+
return;
|
|
304
|
+
killQuietly(pid);
|
|
305
|
+
for (let waited = 0; !observeExit() && waited < 10_000; waited += 50) {
|
|
306
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
307
|
+
}
|
|
308
|
+
clearInterval(watch);
|
|
309
|
+
await exited;
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Starts the child through ShellExecute (`Start-Process`), which calls `CreateProcess` with
|
|
315
|
+
* `bInheritHandles = FALSE`. The PowerShell that does it is itself a short-lived `spawn` child, so
|
|
316
|
+
* whatever IT inherits is released when it exits a moment later — the host never sees any of it.
|
|
317
|
+
*
|
|
318
|
+
* Paths travel in environment variables and are removed before the host starts, so no caller value
|
|
319
|
+
* is ever interpolated into the script and the host's environment is exactly the one requested.
|
|
320
|
+
*/
|
|
321
|
+
export async function launchWithShellExecute(request) {
|
|
322
|
+
const root = request.env.SystemRoot || request.env.WINDIR || process.env.SystemRoot || process.env.WINDIR;
|
|
323
|
+
if (!root || !/^[a-z]:[\\/]/i.test(root))
|
|
324
|
+
throw new Error('SystemRoot is not set, so PowerShell cannot be located.');
|
|
325
|
+
const powershell = win32.join(root, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe');
|
|
326
|
+
const script = [
|
|
327
|
+
"$ErrorActionPreference = 'Stop'",
|
|
328
|
+
'$exe = $env:XENO_SUPERVISOR_EXEC; $entry = $env:XENO_SUPERVISOR_ENTRY; $dir = $env:XENO_SUPERVISOR_CWD',
|
|
329
|
+
'Remove-Item Env:XENO_SUPERVISOR_EXEC, Env:XENO_SUPERVISOR_ENTRY, Env:XENO_SUPERVISOR_CWD -ErrorAction SilentlyContinue',
|
|
330
|
+
"$start = @{ FilePath = $exe; ArgumentList = ('\"{0}\"' -f $entry); WindowStyle = 'Hidden'; PassThru = $true }",
|
|
331
|
+
'if ($dir) { $start.WorkingDirectory = $dir }',
|
|
332
|
+
'$child = Start-Process @start',
|
|
333
|
+
'[Console]::Out.Write($child.Id)',
|
|
334
|
+
].join('; ');
|
|
335
|
+
const stdout = await new Promise((resolve, reject) => execFile(powershell, ['-NoLogo', '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', script], {
|
|
336
|
+
env: {
|
|
337
|
+
...request.env,
|
|
338
|
+
XENO_SUPERVISOR_EXEC: request.execPath,
|
|
339
|
+
XENO_SUPERVISOR_ENTRY: request.entryPath,
|
|
340
|
+
XENO_SUPERVISOR_CWD: request.cwd ?? '',
|
|
341
|
+
},
|
|
342
|
+
encoding: 'utf8',
|
|
343
|
+
windowsHide: true,
|
|
344
|
+
timeout: 30_000,
|
|
345
|
+
maxBuffer: 64 * 1024,
|
|
346
|
+
}, (error, out, err) => error ? reject(new Error(`${error.message}${err ? ` ${String(err).trim()}` : ''}`)) : resolve(String(out))));
|
|
347
|
+
const pid = Number.parseInt(stdout.trim(), 10);
|
|
348
|
+
if (!Number.isSafeInteger(pid) || pid <= 0)
|
|
349
|
+
throw new Error(`Start-Process did not report a process id (got ${JSON.stringify(stdout.trim())}).`);
|
|
350
|
+
return pid;
|
|
351
|
+
}
|
|
352
|
+
function processIsAlive(pid) {
|
|
353
|
+
try {
|
|
354
|
+
process.kill(pid, 0);
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
catch (error) {
|
|
358
|
+
return error.code === 'EPERM';
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function killQuietly(pid) {
|
|
362
|
+
try {
|
|
363
|
+
process.kill(pid);
|
|
364
|
+
}
|
|
365
|
+
catch { /* already gone */ }
|
|
366
|
+
}
|
|
367
|
+
/** Reads what has been appended to a file since the last read. */
|
|
368
|
+
function createFileTail(path) {
|
|
369
|
+
let offset = 0;
|
|
370
|
+
let fd = openSync(path, 'r');
|
|
371
|
+
return {
|
|
372
|
+
read() {
|
|
373
|
+
if (fd === undefined)
|
|
374
|
+
return '';
|
|
375
|
+
const size = statSync(path).size;
|
|
376
|
+
if (size <= offset)
|
|
377
|
+
return '';
|
|
378
|
+
const buffer = Buffer.alloc(Math.min(size - offset, 1 << 20));
|
|
379
|
+
const bytes = readSync(fd, buffer, 0, buffer.length, offset);
|
|
380
|
+
offset += bytes;
|
|
381
|
+
return buffer.subarray(0, bytes).toString('utf8');
|
|
382
|
+
},
|
|
383
|
+
close() {
|
|
384
|
+
if (fd !== undefined)
|
|
385
|
+
closeSync(fd);
|
|
386
|
+
fd = undefined;
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
/** Keeps the newest output files in a directory, so a host that restarts daily leaves a week, not a year. */
|
|
391
|
+
function pruneOutputFiles(directory) {
|
|
392
|
+
try {
|
|
393
|
+
const files = readdirSync(directory)
|
|
394
|
+
.filter((name) => name.startsWith(OUTPUT_FILE_PREFIX) && name.endsWith('.log'))
|
|
395
|
+
.sort();
|
|
396
|
+
for (const name of files.slice(0, Math.max(0, files.length - (KEEP_OUTPUT_FILES - 1)))) {
|
|
397
|
+
rmSync(join(directory, name), { force: true });
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
catch { /* housekeeping never blocks a launch */ }
|
|
401
|
+
}
|
|
152
402
|
function parseReady(line) {
|
|
153
403
|
if (!line.startsWith('{'))
|
|
154
404
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detachedHostSupervisor.js","sourceRoot":"","sources":["../src/detachedHostSupervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAA;AA2C7D,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,+EAA+E;IACtE,WAAW,CAAQ;IAE5B,YAAY,OAAe,EAAE,WAAmB;QAC9C,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,2BAA2B,WAAW,CAAC,IAAI,EAAE,EAAE,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I,EAAE,gCAAgC;YACtC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,eAAe,EAAE,OAAO,MAAM,CAAC,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;SACzF,CAAA;IACH,CAAC;IAAC,MAAM,CAAC;QACP,0EAA0E;QAC1E,+DAA+D;QAC/D,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenosystem/agent-interface-host",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.81",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"node-pty": "^1.1.0",
|
|
37
37
|
"tar": "^7.5.20",
|
|
38
38
|
"zod": "4.4.3",
|
|
39
|
-
"@xenosystem/agent-interface-contract": "0.1.
|
|
40
|
-
"@xenosystem/agent-interface-core": "0.1.
|
|
41
|
-
"@xenosystem/capability-mcp": "0.1.
|
|
39
|
+
"@xenosystem/agent-interface-contract": "0.1.81",
|
|
40
|
+
"@xenosystem/agent-interface-core": "0.1.81",
|
|
41
|
+
"@xenosystem/capability-mcp": "0.1.81"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
44
|
"@xenosystem/acp-agent": "0.2.17",
|
|
45
|
-
"@xenosystem/agent-interface-client": "0.1.
|
|
45
|
+
"@xenosystem/agent-interface-client": "0.1.81"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@xeno-corporation/account": "0.2.0"
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@xenosystem/capability-host": "0.1.0",
|
|
57
|
-
"@xenosystem/agent-interface-client": "0.1.
|
|
57
|
+
"@xenosystem/agent-interface-client": "0.1.81"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "8ada0f02883e807eb17ddaf925b73289be09e069"
|
|
61
61
|
}
|