@agentchatme/agent-core 0.3.0 → 0.4.0

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.
@@ -0,0 +1,283 @@
1
+ import {
2
+ log,
3
+ spawnCommand,
4
+ spawnCommandSync
5
+ } from "./chunk-NCSF3CCV.js";
6
+
7
+ // src/integration/spawn-run.ts
8
+ var DEFAULT_GRACE_MS = 5e3;
9
+ var DEFAULT_DRAIN_MS = 2e3;
10
+ var DEFAULT_ABANDON_MS = 5e3;
11
+ var STDERR_TAIL_CHARS = 400;
12
+ function redactDiagnostic(value, max = STDERR_TAIL_CHARS) {
13
+ return value.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g, "").replace(/\b(api[_ -]?key\s*[:=]\s*)\S+/gi, "$1[redacted]").replace(/\b(Bearer)\s+[A-Za-z0-9._~-]{8,}\b/gi, "$1 [redacted]").replace(/\bac_[A-Za-z0-9_-]{8,}\b/g, "[redacted AgentChat key]").replace(/\bsk-[A-Za-z0-9_-]{8,}\b/g, "[redacted key]").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, "").replace(/\s+/g, " ").trim().slice(-max);
14
+ }
15
+ var KILL_TIMEOUT_MS = 5e3;
16
+ function killProcessTree(child, signal) {
17
+ if (child.pid === void 0) return;
18
+ try {
19
+ if (process.platform === "win32") {
20
+ spawnCommandSync("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
21
+ windowsHide: true,
22
+ stdio: "ignore",
23
+ timeout: KILL_TIMEOUT_MS
24
+ });
25
+ } else {
26
+ process.kill(-child.pid, signal);
27
+ }
28
+ } catch {
29
+ try {
30
+ child.kill(signal);
31
+ } catch {
32
+ }
33
+ }
34
+ }
35
+ function fileTime(ms) {
36
+ return String((BigInt(Math.round(ms)) + 11644473600000n) * 10000n);
37
+ }
38
+ var WINDOWS_SWEEP_TIMEOUT_MS = 6e4;
39
+ function sweepWindowsDescendants(rootPid, aliveFromMs, aliveUntilMs, options = {}) {
40
+ if (process.platform !== "win32" || !Number.isInteger(rootPid) || rootPid <= 0) return Promise.resolve(null);
41
+ const script = [
42
+ "$ErrorActionPreference = 'Continue'",
43
+ // Progress records ('Preparing modules for first use') would reach stderr as CLIXML.
44
+ "$ProgressPreference = 'SilentlyContinue'",
45
+ `$from = [DateTime]::FromFileTime(${fileTime(aliveFromMs - 1e3)})`,
46
+ `$until = [DateTime]::FromFileTime(${fileTime(aliveUntilMs + 1e3)})`,
47
+ "Write-Output ('window ' + $from.ToUniversalTime().ToString('o') + ' ' + $until.ToUniversalTime().ToString('o'))",
48
+ `foreach ($p in @(Get-CimInstance Win32_Process -Filter 'ParentProcessId=${rootPid}')) {`,
49
+ " Write-Output ('candidate ' + $p.ProcessId + ' ' + $p.CreationDate.ToUniversalTime().ToString('o'))",
50
+ " if ($p.CreationDate -ge $from -and $p.CreationDate -le $until) {",
51
+ " & taskkill.exe /T /F /PID $p.ProcessId 2>&1 | Out-Null",
52
+ " Write-Output ('kill ' + $p.ProcessId + ' ' + $LASTEXITCODE)",
53
+ " }",
54
+ "}"
55
+ ].join("\n");
56
+ return new Promise((resolve) => {
57
+ let stdout = "";
58
+ let stderr = "";
59
+ let timedOut = false;
60
+ let done = false;
61
+ const finish = (exitCode) => {
62
+ if (done) return;
63
+ done = true;
64
+ clearTimeout(timer);
65
+ const lines = stdout.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
66
+ resolve({
67
+ exitCode,
68
+ timedOut,
69
+ candidates: lines.filter((l) => l.startsWith("candidate ")).map((l) => l.slice("candidate ".length)),
70
+ killed: lines.filter((l) => l.startsWith("kill ")).map((l) => l.split(" ")).map(([, pid, code]) => ({ pid: Number(pid), code: Number(code) })),
71
+ window: lines.find((l) => l.startsWith("window "))?.slice("window ".length) ?? null,
72
+ stderr: redactDiagnostic(stderr)
73
+ });
74
+ };
75
+ let sweeper;
76
+ try {
77
+ sweeper = spawnCommand(
78
+ "powershell.exe",
79
+ ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", Buffer.from(script, "utf16le").toString("base64")],
80
+ { stdio: ["ignore", "pipe", "pipe"], windowsHide: true }
81
+ );
82
+ } catch (err) {
83
+ stderr = String(err);
84
+ finish(null);
85
+ return;
86
+ }
87
+ const timer = setTimeout(() => {
88
+ timedOut = true;
89
+ try {
90
+ sweeper.kill();
91
+ } catch {
92
+ }
93
+ finish(null);
94
+ }, options.timeoutMs ?? WINDOWS_SWEEP_TIMEOUT_MS);
95
+ timer.unref?.();
96
+ sweeper.stdout?.on("data", (c) => {
97
+ stdout = (stdout + String(c)).slice(-16e3);
98
+ });
99
+ sweeper.stderr?.on("data", (c) => {
100
+ stderr = (stderr + String(c)).slice(-4e3);
101
+ });
102
+ sweeper.on("error", (err) => {
103
+ stderr += String(err);
104
+ finish(null);
105
+ });
106
+ sweeper.on("close", (code) => finish(code));
107
+ });
108
+ }
109
+ function describeWindowsSweep(sweep) {
110
+ const killed = sweep.killed.map((k) => `${k.pid} (taskkill ${k.code})`).join(", ") || "none";
111
+ return `windows leftover sweep: exit ${sweep.exitCode ?? (sweep.timedOut ? "timed out" : "none")}; window ${sweep.window ?? "?"}; children seen ${sweep.candidates.length > 0 ? sweep.candidates.join(", ") : "none"}; killed ${killed}${sweep.stderr ? `; stderr: ${sweep.stderr}` : ""}`;
112
+ }
113
+ function spawnRun(spec) {
114
+ const started = Date.now();
115
+ const graceMs = spec.graceMs ?? DEFAULT_GRACE_MS;
116
+ const drainMs = spec.drainMs ?? DEFAULT_DRAIN_MS;
117
+ const abandonMs = spec.abandonMs ?? DEFAULT_ABANDON_MS;
118
+ return new Promise((resolve) => {
119
+ let settled = false;
120
+ let stdoutBytes = 0;
121
+ let stderrTail = "";
122
+ let timedOut = false;
123
+ let interrupted = false;
124
+ let terminating = false;
125
+ let exited = null;
126
+ const timers = /* @__PURE__ */ new Set();
127
+ let onAbort = null;
128
+ let child = null;
129
+ const later = (ms, fn) => {
130
+ const timer = setTimeout(() => {
131
+ timers.delete(timer);
132
+ fn();
133
+ }, ms);
134
+ timers.add(timer);
135
+ };
136
+ const finish = (outcome) => {
137
+ if (settled) return;
138
+ settled = true;
139
+ for (const timer of timers) clearTimeout(timer);
140
+ timers.clear();
141
+ if (onAbort) spec.signal?.removeEventListener("abort", onAbort);
142
+ resolve({ ...outcome, durationMs: Date.now() - started });
143
+ };
144
+ const detach = () => {
145
+ if (child === null) return;
146
+ for (const stream of [child.stdin, child.stdout, child.stderr]) {
147
+ try {
148
+ stream?.destroy();
149
+ } catch {
150
+ }
151
+ }
152
+ try {
153
+ child.unref();
154
+ } catch {
155
+ }
156
+ };
157
+ const classify = (code, signal, note) => {
158
+ const tail = redactDiagnostic(stderrTail);
159
+ const extra = `${note ? ` (${note})` : ""}${tail ? `: ${tail}` : ""}`;
160
+ if (timedOut) {
161
+ return { state: "timed_out", exitCode: code, detail: `run exceeded its ${Math.round(spec.budgetMs / 1e3)} s budget and was killed${extra}` };
162
+ }
163
+ if (interrupted) {
164
+ return { state: "failed", exitCode: code, detail: `interrupted \u2014 the integration was stopping; the tray stays unread for the next run${extra}` };
165
+ }
166
+ if (code === 0) return note ? { state: "ok", exitCode: 0, detail: note } : { state: "ok", exitCode: 0 };
167
+ const exit = code === null ? `signal ${signal ?? "unknown"}` : `exit ${code}`;
168
+ if (stdoutBytes === 0) return { state: "not_started", exitCode: code, detail: `${exit} with nothing on stdout${extra}` };
169
+ return { state: "failed", exitCode: code, detail: `${exit}${extra}` };
170
+ };
171
+ if (spec.signal?.aborted) {
172
+ finish({ state: "not_started", exitCode: null, detail: "interrupted before the runtime was started" });
173
+ return;
174
+ }
175
+ try {
176
+ child = spawnCommand(spec.command, [...spec.args], {
177
+ cwd: spec.cwd,
178
+ env: spec.env,
179
+ stdio: [spec.stdin === null ? "ignore" : "pipe", "pipe", "pipe"],
180
+ detached: process.platform !== "win32",
181
+ windowsHide: true,
182
+ ...spec.shell === true ? { shell: true } : {}
183
+ });
184
+ } catch (err) {
185
+ finish({ state: "not_started", exitCode: null, detail: redactDiagnostic(String(err)) });
186
+ return;
187
+ }
188
+ const proc = child;
189
+ if (spec.onStarted) {
190
+ const onStarted = spec.onStarted;
191
+ proc.once("spawn", () => {
192
+ try {
193
+ onStarted();
194
+ } catch {
195
+ }
196
+ });
197
+ }
198
+ proc.stdout?.on("data", (chunk) => {
199
+ stdoutBytes += chunk.length;
200
+ });
201
+ proc.stderr?.on("data", (chunk) => {
202
+ stderrTail = (stderrTail + String(chunk)).slice(-4 * STDERR_TAIL_CHARS);
203
+ });
204
+ proc.stdout?.on("error", () => void 0);
205
+ proc.stderr?.on("error", () => void 0);
206
+ if (spec.stdin !== null && proc.stdin) {
207
+ proc.stdin.on("error", () => {
208
+ });
209
+ try {
210
+ proc.stdin.write(spec.stdin);
211
+ proc.stdin.end();
212
+ } catch {
213
+ }
214
+ }
215
+ const terminate = () => {
216
+ if (terminating || settled) return;
217
+ terminating = true;
218
+ killProcessTree(proc, "SIGTERM");
219
+ later(graceMs, () => {
220
+ if (settled) return;
221
+ killProcessTree(proc, "SIGKILL");
222
+ later(abandonMs, () => {
223
+ if (settled) return;
224
+ if (exited !== null) return;
225
+ detach();
226
+ const tail = redactDiagnostic(stderrTail);
227
+ const why = `the run did not end ${Math.round((graceMs + abandonMs) / 1e3)} s after it was signalled (SIGKILL included) \u2014 abandoned so the next wake can run${tail ? `: ${tail}` : ""}`;
228
+ finish(
229
+ timedOut ? { state: "timed_out", exitCode: null, detail: `run exceeded its ${Math.round(spec.budgetMs / 1e3)} s budget; ${why}` } : { state: "failed", exitCode: null, detail: `interrupted \u2014 ${why}` }
230
+ );
231
+ });
232
+ });
233
+ };
234
+ later(spec.budgetMs, () => {
235
+ if (exited !== null) return;
236
+ timedOut = true;
237
+ terminate();
238
+ });
239
+ if (spec.signal) {
240
+ onAbort = () => {
241
+ if (settled) return;
242
+ interrupted = true;
243
+ terminate();
244
+ };
245
+ spec.signal.addEventListener("abort", onAbort, { once: true });
246
+ }
247
+ proc.on("error", (err) => {
248
+ finish({ state: "not_started", exitCode: null, detail: redactDiagnostic(String(err)) });
249
+ });
250
+ proc.on("exit", (code, signal) => {
251
+ exited = { code, signal, at: Date.now() };
252
+ later(drainMs, () => {
253
+ if (settled || exited === null) return;
254
+ killProcessTree(proc, "SIGKILL");
255
+ if (proc.pid !== void 0) {
256
+ void sweepWindowsDescendants(proc.pid, started, exited.at).then((sweep) => {
257
+ if (sweep !== null) (sweep.exitCode === 0 ? log.info : log.warn)(describeWindowsSweep(sweep));
258
+ });
259
+ }
260
+ detach();
261
+ finish(
262
+ classify(
263
+ exited.code,
264
+ exited.signal,
265
+ process.platform === "win32" ? "a process the run started kept its output open after it exited; its children were swept (taskkill) and the run detached from it \u2014 a process the sweep cannot see can survive" : "a process the run started kept its output open after it exited; the run's process group was signalled (SIGKILL) and the run detached from it \u2014 a process that left the group can survive"
266
+ )
267
+ );
268
+ });
269
+ });
270
+ proc.on("close", (code, signal) => {
271
+ finish(classify(code, signal, null));
272
+ });
273
+ });
274
+ }
275
+
276
+ export {
277
+ redactDiagnostic,
278
+ WINDOWS_SWEEP_TIMEOUT_MS,
279
+ sweepWindowsDescendants,
280
+ describeWindowsSweep,
281
+ spawnRun
282
+ };
283
+ //# sourceMappingURL=chunk-TH6XOVA3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/integration/spawn-run.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process'\nimport { spawnCommand, spawnCommandSync } from '../util/spawn.js'\nimport type { RunOutcome } from './runner.js'\nimport { log } from '../util/log.js'\n\n// ─── Spawning one headless run ──────────────────────────────────────────────\n//\n// Shared by every runner: start the runtime's headless command, feed it the\n// prompt, bound it, classify the exit. The run's OUTPUT IS DISCARDED — stdout\n// is counted, never kept, never parsed, never logged. A run's text can quote\n// peer messages, and the integration reads no message content, ever. The only\n// thing retained is a short, credential-redacted tail of stderr for the\n// failure diagnostic, because \"exited 1\" alone has cost days of debugging.\n//\n// Classification: `ok` on exit 0; `timed_out` when the budget killed it;\n// `failed` when it was interrupted or exited non-zero after writing to stdout;\n// `not_started` when it exited non-zero with NOTHING ON STDOUT — a signed-out\n// CLI, a bad flag, a missing config all print their complaint on stderr and\n// quit, and they are \"the runtime did not get going\", stderr or not. The\n// stderr tail rides along in the detail either way.\n//\n// The run is spawned as its own process group (detached) so the whole tree\n// can be signalled at once: on the budget, and when the integration is stopping\n// (`signal`) — a daemon that exits with a run still going orphans a model call\n// that nobody will read and that the restarted daemon would run again.\n\n// A run must never hang the worker that started it. Two ways a child can\n// outlive its own classification, both seen with real runtimes:\n//\n// * the run's process exits, but something it started still holds its\n// stdout/stderr (a helper spawned with inherited pipes, an MCP server\n// that daemonised): Node's `close` waits for every holder of the pipes,\n// so it never comes. After `exit`, `close` gets DRAIN_MS; then the\n// run's process group is signalled (SIGKILL), the pipes are dropped, and\n// the run is classified by the exit it did make. A process that left the\n// group (`setsid`, a daemonising helper) is not reached by that signal\n// and can survive the run; the pipes are let go either way. Windows has\n// no process groups: there the run's orphaned children are swept\n// (`sweepWindowsDescendants`, best effort). Observed on Windows: a child\n// that inherited the run's stdio does not keep it open past the run's\n// exit, so `close` usually comes and this path is the fallback.\n// * a SIGKILL that does not end it (a process that escaped the group with\n// `setsid` and still holds the pipes; a process stuck in the kernel):\n// ABANDON_MS after the SIGKILL the pipes are dropped, the child is\n// unref'd, and the run is classified `timed_out` / `failed` as the\n// budget or the interrupt said — the worker moves on.\n\nconst DEFAULT_GRACE_MS = 5_000\n/** After the run's process exited: how long its pipes get to close before the run is detached from them. */\nconst DEFAULT_DRAIN_MS = 2_000\n/** After the SIGKILL: how long before a run that still has not ended is abandoned. */\nconst DEFAULT_ABANDON_MS = 5_000\nconst STDERR_TAIL_CHARS = 400\n\nexport interface SpawnRunSpec {\n readonly command: string\n readonly args: readonly string[]\n readonly cwd: string\n readonly env: NodeJS.ProcessEnv\n /**\n * Run `command` through the platform shell (`/bin/sh -c`, `cmd.exe /d /s /c`)\n * with no `args`: for a command line the OWNER configured. Nothing derived\n * from a wake or a message is ever part of it.\n */\n readonly shell?: boolean\n /** Written to the child's stdin and closed; `null` closes stdin at once. */\n readonly stdin: string | null\n /** Kill past this. */\n readonly budgetMs: number\n /** SIGTERM first; SIGKILL this long after. */\n readonly graceMs?: number\n /** After the process exited, how long its pipes may stay open before the run is detached from them. */\n readonly drainMs?: number\n /** After the SIGKILL, how long before a run that has still not ended is abandoned. */\n readonly abandonMs?: number\n /**\n * Aborting it SIGTERMs the run's process group (SIGKILL after `graceMs`);\n * the outcome is `failed` with an \"interrupted\" detail.\n */\n readonly signal?: AbortSignal\n /** Called once when the child process has been spawned (`RunRequest.onStarted`). */\n readonly onStarted?: () => void\n}\n\n/** Strip anything key-shaped or terminal-styled from a diagnostic, and bound it. */\nexport function redactDiagnostic(value: string, max = STDERR_TAIL_CHARS): string {\n return value\n .replace(/\\u001B\\[[0-?]*[ -/]*[@-~]/g, '')\n .replace(/\\b(api[_ -]?key\\s*[:=]\\s*)\\S+/gi, '$1[redacted]')\n .replace(/\\b(Bearer)\\s+[A-Za-z0-9._~-]{8,}\\b/gi, '$1 [redacted]')\n .replace(/\\bac_[A-Za-z0-9_-]{8,}\\b/g, '[redacted AgentChat key]')\n .replace(/\\bsk-[A-Za-z0-9_-]{8,}\\b/g, '[redacted key]')\n .replace(/[\\u0000-\\u0008\\u000B\\u000C\\u000E-\\u001F\\u007F]/g, '')\n .replace(/\\s+/g, ' ')\n .trim()\n .slice(-max)\n}\n\n/** Bounds every synchronous kill: a stuck `taskkill` must not hold the worker it protects. */\nconst KILL_TIMEOUT_MS = 5_000\n\nfunction killProcessTree(child: ChildProcess, signal: NodeJS.Signals): void {\n if (child.pid === undefined) return\n try {\n if (process.platform === 'win32') {\n // The tree under a live root. A root that has exited is not found by\n // taskkill (Windows keeps no tree for it); `sweepWindowsDescendants`\n // covers that case.\n spawnCommandSync('taskkill', ['/pid', String(child.pid), '/T', '/F'], {\n windowsHide: true,\n stdio: 'ignore',\n timeout: KILL_TIMEOUT_MS,\n })\n } else {\n // Negative pid = the process group the child leads (spawned detached).\n process.kill(-child.pid, signal)\n }\n } catch {\n try {\n child.kill(signal)\n } catch {\n /* already gone */\n }\n }\n}\n\n/** Epoch ms → a Windows FILETIME (100 ns ticks since 1601), for PowerShell's `[DateTime]::FromFileTime`. */\nfunction fileTime(ms: number): string {\n return String((BigInt(Math.round(ms)) + 11_644_473_600_000n) * 10_000n)\n}\n\n/** What one Windows sweep saw and did, for the log line and for tests. */\nexport interface WindowsSweep {\n /** PowerShell's exit code; null when it was killed past its deadline or could not start. */\n readonly exitCode: number | null\n readonly timedOut: boolean\n /** Every child of the root the sweep saw, as `<pid> <created ISO>`, in or out of the window. */\n readonly candidates: string[]\n /** Pids it ran `taskkill /T /F` on, with taskkill's exit code. */\n readonly killed: Array<{ pid: number; code: number }>\n /** The window it used, ISO. */\n readonly window: string | null\n /** stderr, bounded. */\n readonly stderr: string\n}\n\n/** A cold PowerShell on a busy runner takes seconds to start (seen: ~30 s on windows-latest the first time); past this the sweep is given up. */\nexport const WINDOWS_SWEEP_TIMEOUT_MS = 60_000\n\n/**\n * Windows: kill the processes an exited run left behind — its direct\n * children, which keep the dead run's pid as their `ParentProcessId` (Windows\n * does not reparent), created while the run was alive (so a reused pid cannot\n * pick up a stranger's children), each with its own tree. Best effort, and\n * never waited for by the run: `spawnRun` only logs the result. A\n * `powershell -EncodedCommand` (no quoting to get wrong), bounded by\n * `timeoutMs`. Resolves null off Windows.\n */\nexport function sweepWindowsDescendants(\n rootPid: number,\n aliveFromMs: number,\n aliveUntilMs: number,\n options: { timeoutMs?: number } = {},\n): Promise<WindowsSweep | null> {\n if (process.platform !== 'win32' || !Number.isInteger(rootPid) || rootPid <= 0) return Promise.resolve(null)\n const script = [\n \"$ErrorActionPreference = 'Continue'\",\n // Progress records ('Preparing modules for first use') would reach stderr as CLIXML.\n \"$ProgressPreference = 'SilentlyContinue'\",\n `$from = [DateTime]::FromFileTime(${fileTime(aliveFromMs - 1_000)})`,\n `$until = [DateTime]::FromFileTime(${fileTime(aliveUntilMs + 1_000)})`,\n \"Write-Output ('window ' + $from.ToUniversalTime().ToString('o') + ' ' + $until.ToUniversalTime().ToString('o'))\",\n `foreach ($p in @(Get-CimInstance Win32_Process -Filter 'ParentProcessId=${rootPid}')) {`,\n \" Write-Output ('candidate ' + $p.ProcessId + ' ' + $p.CreationDate.ToUniversalTime().ToString('o'))\",\n ' if ($p.CreationDate -ge $from -and $p.CreationDate -le $until) {',\n ' & taskkill.exe /T /F /PID $p.ProcessId 2>&1 | Out-Null',\n \" Write-Output ('kill ' + $p.ProcessId + ' ' + $LASTEXITCODE)\",\n ' }',\n '}',\n ].join('\\n')\n return new Promise<WindowsSweep>((resolve) => {\n let stdout = ''\n let stderr = ''\n let timedOut = false\n let done = false\n const finish = (exitCode: number | null): void => {\n if (done) return\n done = true\n clearTimeout(timer)\n const lines = stdout.split(/\\r?\\n/).map((l) => l.trim()).filter((l) => l.length > 0)\n resolve({\n exitCode,\n timedOut,\n candidates: lines.filter((l) => l.startsWith('candidate ')).map((l) => l.slice('candidate '.length)),\n killed: lines\n .filter((l) => l.startsWith('kill '))\n .map((l) => l.split(' '))\n .map(([, pid, code]) => ({ pid: Number(pid), code: Number(code) })),\n window: lines.find((l) => l.startsWith('window '))?.slice('window '.length) ?? null,\n stderr: redactDiagnostic(stderr),\n })\n }\n let sweeper: ChildProcess\n try {\n sweeper = spawnCommand(\n 'powershell.exe',\n ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand', Buffer.from(script, 'utf16le').toString('base64')],\n { stdio: ['ignore', 'pipe', 'pipe'], windowsHide: true },\n )\n } catch (err) {\n stderr = String(err)\n finish(null)\n return\n }\n const timer = setTimeout(() => {\n timedOut = true\n try {\n sweeper.kill()\n } catch {\n /* gone */\n }\n finish(null)\n }, options.timeoutMs ?? WINDOWS_SWEEP_TIMEOUT_MS)\n timer.unref?.()\n sweeper.stdout?.on('data', (c: Buffer | string) => {\n stdout = (stdout + String(c)).slice(-16_000)\n })\n sweeper.stderr?.on('data', (c: Buffer | string) => {\n stderr = (stderr + String(c)).slice(-4_000)\n })\n sweeper.on('error', (err) => {\n stderr += String(err)\n finish(null)\n })\n sweeper.on('close', (code) => finish(code))\n })\n}\n\n/** One line for the log: what a sweep found and did. */\nexport function describeWindowsSweep(sweep: WindowsSweep): string {\n const killed = sweep.killed.map((k) => `${k.pid} (taskkill ${k.code})`).join(', ') || 'none'\n return `windows leftover sweep: exit ${sweep.exitCode ?? (sweep.timedOut ? 'timed out' : 'none')}; window ${sweep.window ?? '?'}; children seen ${sweep.candidates.length > 0 ? sweep.candidates.join(', ') : 'none'}; killed ${killed}${sweep.stderr ? `; stderr: ${sweep.stderr}` : ''}`\n}\n\n/** Start the command, wait for it, classify. Never throws, and always resolves. */\nexport function spawnRun(spec: SpawnRunSpec): Promise<RunOutcome> {\n const started = Date.now()\n const graceMs = spec.graceMs ?? DEFAULT_GRACE_MS\n const drainMs = spec.drainMs ?? DEFAULT_DRAIN_MS\n const abandonMs = spec.abandonMs ?? DEFAULT_ABANDON_MS\n return new Promise<RunOutcome>((resolve) => {\n let settled = false\n let stdoutBytes = 0\n let stderrTail = ''\n let timedOut = false\n let interrupted = false\n let terminating = false\n let exited: { code: number | null; signal: NodeJS.Signals | null; at: number } | null = null\n const timers = new Set<ReturnType<typeof setTimeout>>()\n let onAbort: (() => void) | null = null\n let child: ChildProcess | null = null\n\n const later = (ms: number, fn: () => void): void => {\n const timer = setTimeout(() => {\n timers.delete(timer)\n fn()\n }, ms)\n timers.add(timer)\n }\n\n const finish = (outcome: Omit<RunOutcome, 'durationMs'>): void => {\n if (settled) return\n settled = true\n for (const timer of timers) clearTimeout(timer)\n timers.clear()\n if (onAbort) spec.signal?.removeEventListener('abort', onAbort)\n resolve({ ...outcome, durationMs: Date.now() - started })\n }\n\n /** Stop waiting on the child's pipes and let the event loop forget it. */\n const detach = (): void => {\n if (child === null) return\n for (const stream of [child.stdin, child.stdout, child.stderr]) {\n try {\n stream?.destroy()\n } catch {\n /* already gone */\n }\n }\n try {\n child.unref()\n } catch {\n /* already gone */\n }\n }\n\n /** The outcome for an exit the run did make; `note` says why `close` was not waited for. */\n const classify = (code: number | null, signal: NodeJS.Signals | null, note: string | null): Omit<RunOutcome, 'durationMs'> => {\n const tail = redactDiagnostic(stderrTail)\n const extra = `${note ? ` (${note})` : ''}${tail ? `: ${tail}` : ''}`\n if (timedOut) {\n return { state: 'timed_out', exitCode: code, detail: `run exceeded its ${Math.round(spec.budgetMs / 1000)} s budget and was killed${extra}` }\n }\n if (interrupted) {\n return { state: 'failed', exitCode: code, detail: `interrupted — the integration was stopping; the tray stays unread for the next run${extra}` }\n }\n if (code === 0) return note ? { state: 'ok', exitCode: 0, detail: note } : { state: 'ok', exitCode: 0 }\n const exit = code === null ? `signal ${signal ?? 'unknown'}` : `exit ${code}`\n // Nothing on stdout: the runtime did not get going (missing, refused\n // to start, auth gate). Whatever it complained about is in the tail.\n if (stdoutBytes === 0) return { state: 'not_started', exitCode: code, detail: `${exit} with nothing on stdout${extra}` }\n return { state: 'failed', exitCode: code, detail: `${exit}${extra}` }\n }\n\n if (spec.signal?.aborted) {\n finish({ state: 'not_started', exitCode: null, detail: 'interrupted before the runtime was started' })\n return\n }\n\n try {\n child = spawnCommand(spec.command, [...spec.args], {\n cwd: spec.cwd,\n env: spec.env,\n stdio: [spec.stdin === null ? 'ignore' : 'pipe', 'pipe', 'pipe'],\n detached: process.platform !== 'win32',\n windowsHide: true,\n ...(spec.shell === true ? { shell: true } : {}),\n })\n } catch (err) {\n finish({ state: 'not_started', exitCode: null, detail: redactDiagnostic(String(err)) })\n return\n }\n const proc: ChildProcess = child\n\n if (spec.onStarted) {\n const onStarted = spec.onStarted\n proc.once('spawn', () => {\n try {\n onStarted()\n } catch {\n /* the callback belongs to the caller; a failure there is not the run's */\n }\n })\n }\n\n proc.stdout?.on('data', (chunk: Buffer | string) => {\n stdoutBytes += chunk.length // counted, never kept\n })\n proc.stderr?.on('data', (chunk: Buffer | string) => {\n stderrTail = (stderrTail + String(chunk)).slice(-4 * STDERR_TAIL_CHARS)\n })\n // A pipe torn down under us (detach, a dying child) must never surface as\n // an unhandled 'error' event.\n proc.stdout?.on('error', () => undefined)\n proc.stderr?.on('error', () => undefined)\n\n if (spec.stdin !== null && proc.stdin) {\n proc.stdin.on('error', () => {\n /* the child closed stdin early; the exit code tells the story */\n })\n try {\n proc.stdin.write(spec.stdin)\n proc.stdin.end()\n } catch {\n /* handled by the close path */\n }\n }\n\n const terminate = (): void => {\n if (terminating || settled) return\n terminating = true\n killProcessTree(proc, 'SIGTERM')\n later(graceMs, () => {\n if (settled) return\n killProcessTree(proc, 'SIGKILL')\n later(abandonMs, () => {\n if (settled) return\n // Exited but the pipes stayed open: the drain timer owns that case.\n if (exited !== null) return\n detach()\n const tail = redactDiagnostic(stderrTail)\n const why = `the run did not end ${Math.round((graceMs + abandonMs) / 1000)} s after it was signalled (SIGKILL included) — abandoned so the next wake can run${tail ? `: ${tail}` : ''}`\n finish(\n timedOut\n ? { state: 'timed_out', exitCode: null, detail: `run exceeded its ${Math.round(spec.budgetMs / 1000)} s budget; ${why}` }\n : { state: 'failed', exitCode: null, detail: `interrupted — ${why}` },\n )\n })\n })\n }\n\n later(spec.budgetMs, () => {\n // A run that already exited ended inside its budget; only its pipes\n // are late, and the drain timer owns that.\n if (exited !== null) return\n timedOut = true\n terminate()\n })\n\n if (spec.signal) {\n onAbort = (): void => {\n if (settled) return\n interrupted = true\n terminate()\n }\n spec.signal.addEventListener('abort', onAbort, { once: true })\n }\n\n proc.on('error', (err) => {\n finish({ state: 'not_started', exitCode: null, detail: redactDiagnostic(String(err)) })\n })\n\n proc.on('exit', (code, signal) => {\n exited = { code, signal, at: Date.now() }\n // `close` follows once every holder of the pipes is gone. A process the\n // run started that still holds them must not hold the worker.\n later(drainMs, () => {\n if (settled || exited === null) return\n // The run is over; what is left of it is a leftover: its process\n // group on POSIX; on Windows its orphaned children (no groups there).\n killProcessTree(proc, 'SIGKILL')\n if (proc.pid !== undefined) {\n // Never awaited: the run's outcome does not wait for the sweep.\n void sweepWindowsDescendants(proc.pid, started, exited.at).then((sweep) => {\n if (sweep !== null) (sweep.exitCode === 0 ? log.info : log.warn)(describeWindowsSweep(sweep))\n })\n }\n detach()\n finish(\n classify(\n exited.code,\n exited.signal,\n process.platform === 'win32'\n ? 'a process the run started kept its output open after it exited; its children were swept (taskkill) and the run detached from it — a process the sweep cannot see can survive'\n : 'a process the run started kept its output open after it exited; the run\\'s process group was signalled (SIGKILL) and the run detached from it — a process that left the group can survive',\n ),\n )\n })\n })\n\n proc.on('close', (code, signal) => {\n finish(classify(code, signal, null))\n })\n })\n}\n"],"mappings":";;;;;;;AA+CA,IAAM,mBAAmB;AAEzB,IAAM,mBAAmB;AAEzB,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB;AAiCnB,SAAS,iBAAiB,OAAe,MAAM,mBAA2B;AAC/E,SAAO,MACJ,QAAQ,8BAA8B,EAAE,EACxC,QAAQ,mCAAmC,cAAc,EACzD,QAAQ,wCAAwC,eAAe,EAC/D,QAAQ,6BAA6B,0BAA0B,EAC/D,QAAQ,6BAA6B,gBAAgB,EACrD,QAAQ,mDAAmD,EAAE,EAC7D,QAAQ,QAAQ,GAAG,EACnB,KAAK,EACL,MAAM,CAAC,GAAG;AACf;AAGA,IAAM,kBAAkB;AAExB,SAAS,gBAAgB,OAAqB,QAA8B;AAC1E,MAAI,MAAM,QAAQ,OAAW;AAC7B,MAAI;AACF,QAAI,QAAQ,aAAa,SAAS;AAIhC,uBAAiB,YAAY,CAAC,QAAQ,OAAO,MAAM,GAAG,GAAG,MAAM,IAAI,GAAG;AAAA,QACpE,aAAa;AAAA,QACb,OAAO;AAAA,QACP,SAAS;AAAA,MACX,CAAC;AAAA,IACH,OAAO;AAEL,cAAQ,KAAK,CAAC,MAAM,KAAK,MAAM;AAAA,IACjC;AAAA,EACF,QAAQ;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