@orkestrel/process 0.0.9 → 0.0.11

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.
@@ -1,9 +1,9 @@
1
- import { EmitterErrorHandler } from '@orkestrel/emitter';
2
- import { EmitterHooks } from '@orkestrel/emitter';
3
- import { EmitterInterface } from '@orkestrel/emitter';
1
+ import type { EmitterErrorHandler } from '@orkestrel/emitter';
2
+ import type { EmitterHooks } from '@orkestrel/emitter';
3
+ import type { EmitterInterface } from '@orkestrel/emitter';
4
4
 
5
5
  /**
6
- * Creates the failure raised when a manager launch reuses a live id.
6
+ * Creates the `duplicate`-coded failure raised when a manager launch reuses a live id.
7
7
  *
8
8
  * @param id - The id already occupied by a live child
9
9
  * @returns A typed duplicate-id failure
@@ -25,7 +25,8 @@ export declare function createDuplicateError(id: string): ProcessError;
25
25
  export declare function createExecuteError(result: ExecuteResult, cause?: unknown): ProcessError;
26
26
 
27
27
  /**
28
- * Creates the failure raised when a public input is refused before anything is spawned.
28
+ * Creates the `invalid`-coded failure raised when a public input is refused before anything is
29
+ * spawned.
29
30
  *
30
31
  * @param subject - The rejected input named as the caller wrote it, such as `option 'grace'`
31
32
  * @param value - The rejected value, carried as `context.value`
@@ -39,7 +40,8 @@ export declare function createExecuteError(result: ExecuteResult, cause?: unknow
39
40
  export declare function createInvalidError(subject: string, value: unknown): ProcessError;
40
41
 
41
42
  /**
42
- * Creates the failure raised when a launch is attempted on a registry that is being destroyed.
43
+ * Creates the `protocol`-coded failure raised when a launch is attempted on a registry that is
44
+ * being destroyed.
43
45
  *
44
46
  * @param id - The id the refused launch asked for
45
47
  * @returns A typed protocol failure
@@ -47,33 +49,33 @@ export declare function createInvalidError(subject: string, value: unknown): Pro
47
49
  export declare function createProtocolError(id: string): ProcessError;
48
50
 
49
51
  /**
50
- * Options for a detached fire-and-forget spawn.
52
+ * Configures a detached fire-and-forget spawn.
51
53
  *
52
54
  * @remarks
53
55
  * A detached child owns no stdio and is never awaited, so the contract carries only the directory it
54
56
  * starts in. Its environment comes from the command's own `environment` and `isolated`.
55
57
  */
56
58
  export declare interface DetachOptions {
57
- /** The working directory. Default: the current working directory. */
59
+ /** Names the working directory. Default: the current working directory. */
58
60
  readonly workspace?: string;
59
61
  }
60
62
 
61
63
  /**
62
- * Lookup inputs for resolving a command file to an executable path.
64
+ * Supplies the lookup inputs for resolving a command file to an executable path.
63
65
  *
64
66
  * @remarks
65
67
  * `workspace` is searched before `PATH`, matching Windows command semantics. `environment` is the
66
68
  * child's effective environment, so the lookup reads the same `PATH` and `PATHEXT` the child will.
67
69
  */
68
70
  export declare interface ExecutableOptions {
69
- /** The directory searched first. Default: the current working directory. */
71
+ /** Names the directory searched first. Default: the current working directory. */
70
72
  readonly workspace?: string;
71
- /** The child's effective environment. Default: the parent process environment. */
73
+ /** Holds the child's effective environment. Default: the parent process environment. */
72
74
  readonly environment?: Readonly<Record<string, string | undefined>>;
73
75
  }
74
76
 
75
77
  /**
76
- * The captured bytes and terminal facts one settled {@link ExecuteResult} is built from.
78
+ * Represents the captured bytes and terminal facts one settled {@link ExecuteResult} is built from.
77
79
  *
78
80
  * @remarks
79
81
  * Each byte field is trimmed to `limit` on a code-point boundary when the result is built, so a
@@ -81,13 +83,15 @@ export declare interface ExecutableOptions {
81
83
  * that ended the run, when one did; its presence alone marks the run failed.
82
84
  */
83
85
  export declare interface ExecuteInput {
84
- /** The diagnostic command line. */
86
+ /** Holds the diagnostic command line. */
85
87
  readonly command: string;
86
- /** The retained standard-output bytes. */
88
+ /** Holds the retained standard-output bytes. */
87
89
  readonly stdout: Uint8Array;
88
- /** The retained standard-error bytes. */
90
+ /** Holds the retained standard-error bytes. */
89
91
  readonly stderr: Uint8Array;
92
+ /** Holds the exit code. A spawn fault reports the host's negative errno for `execute` and `null` for `executeSync`. */
90
93
  readonly code: number | null;
94
+ /** Holds the terminating signal name, or `null` when the process exited on its own. */
91
95
  readonly signal: string | null;
92
96
  /** If `true`, the run's own timeout elapsed; if `false`, it did not. */
93
97
  readonly expired: boolean;
@@ -95,14 +99,14 @@ export declare interface ExecuteInput {
95
99
  readonly aborted: boolean;
96
100
  /** If `true`, a stream exceeded `limit`; if `false`, neither did. */
97
101
  readonly truncated: boolean;
98
- /** The maximum retained bytes for each stream. */
102
+ /** Sets the maximum retained bytes for each stream. */
99
103
  readonly limit: number;
100
- /** The host fault that ended the run, when one did. */
104
+ /** Carries the host fault that ended the run, when one did. */
101
105
  readonly cause?: unknown;
102
106
  }
103
107
 
104
108
  /**
105
- * Options for a one-shot run.
109
+ * Configures a one-shot run.
106
110
  *
107
111
  * @remarks
108
112
  * A run is a fire-and-collect function, not a lifecycle entity, so it carries no emitter. `strict`
@@ -117,26 +121,26 @@ export declare interface ExecuteInput {
117
121
  * that throws strands no process.
118
122
  */
119
123
  export declare interface ExecuteOptions {
120
- /** The working directory. Default: the current working directory. */
124
+ /** Names the working directory. Default: the current working directory. */
121
125
  readonly workspace?: string;
122
- /** Environment overrides merged over the parent environment; an `undefined` value unsets a key. */
126
+ /** Holds environment overrides merged over the parent environment; an `undefined` value unsets a key. */
123
127
  readonly environment?: Readonly<Record<string, string | undefined>>;
124
- /** Standard-input payload written to the child, including any NUL characters. */
128
+ /** Holds the standard-input payload written to the child, including any NUL characters. */
125
129
  readonly input?: string;
126
- /** Milliseconds before the child is terminated. `0` or omitted disables the timeout. */
130
+ /** Sets the milliseconds before the child is terminated. `0` or omitted disables the timeout. */
127
131
  readonly timeout?: number;
128
- /** Cooperative POSIX window between `SIGTERM` and `SIGKILL` when terminating. Default: {@link PROCESS_GRACE}. */
132
+ /** Sets the cooperative POSIX window between `SIGTERM` and `SIGKILL` when terminating. Default: {@link PROCESS_GRACE}. */
129
133
  readonly grace?: number;
130
- /** Aborting this signal terminates the run and reports `aborted`. */
134
+ /** Terminates the run and reports `aborted` when this signal aborts. */
131
135
  readonly signal?: AbortSignal;
132
- /** If `false`, resolve with the result on failure instead of rejecting. Default: `true`. */
136
+ /** If `true`, reject on failure; if `false`, resolve with the result instead. Default: `true`. */
133
137
  readonly strict?: boolean;
134
- /** Maximum captured bytes for stdout and for stderr, each. Default: {@link PROCESS_OUTPUT}. */
138
+ /** Sets the maximum captured bytes for stdout and for stderr, each. Default: {@link PROCESS_OUTPUT}. */
135
139
  readonly limit?: number;
136
140
  }
137
141
 
138
142
  /**
139
- * The settled outcome of a one-shot run: the buffered output and the terminal state.
143
+ * Represents the settled outcome of a one-shot run: the buffered output and the terminal state.
140
144
  *
141
145
  * @remarks
142
146
  * `failed` is `true` when the run timed out, was aborted, ended on a host fault, was ended by a
@@ -150,27 +154,28 @@ export declare interface ExecuteOptions {
150
154
  * the host's negative errno for `execute`. A spawn fault reports `null` for `executeSync`.
151
155
  */
152
156
  export declare interface ExecuteResult {
153
- /** The command line that was run, for diagnostics. */
157
+ /** Holds the command line that was run, for diagnostics. */
154
158
  readonly command: string;
155
- /** The captured standard output, byte-bounded by `limit`. */
159
+ /** Holds the captured standard output, byte-bounded by `limit`. */
156
160
  readonly stdout: string;
157
- /** The captured standard error, byte-bounded by `limit`. */
161
+ /** Holds the captured standard error, byte-bounded by `limit`. */
158
162
  readonly stderr: string;
159
- /** The exit code. A spawn fault reports the host's negative errno for `execute` and `null` for `executeSync`. */
163
+ /** Holds the exit code. A spawn fault reports the host's negative errno for `execute` and `null` for `executeSync`. */
160
164
  readonly code: number | null;
165
+ /** Holds the terminating signal name, or `null` when the process exited on its own. */
161
166
  readonly signal: string | null;
162
- /** True if the run did not complete successfully. */
167
+ /** Reports whether the run failed to complete successfully. */
163
168
  readonly failed: boolean;
164
- /** True if the run's `timeout` elapsed before completion. */
169
+ /** Reports whether the run's `timeout` elapsed before completion. */
165
170
  readonly expired: boolean;
166
- /** True if the caller's `signal` aborted the run before completion. */
171
+ /** Reports whether the caller's `signal` aborted the run before completion. */
167
172
  readonly aborted: boolean;
168
- /** True when either captured stream omitted output because it exceeded `limit`. */
173
+ /** Reports whether either captured stream omitted output because it exceeded `limit`. */
169
174
  readonly truncated: boolean;
170
175
  }
171
176
 
172
177
  /**
173
- * Options for a synchronous one-shot run.
178
+ * Configures a synchronous one-shot run.
174
179
  *
175
180
  * @remarks
176
181
  * The synchronous host offers neither a cooperative termination window nor in-flight cancellation,
@@ -181,17 +186,17 @@ export declare interface ExecuteResult {
181
186
  * `input` is standard-input payload and carries no NUL restriction.
182
187
  */
183
188
  export declare interface ExecuteSyncOptions {
184
- /** The working directory. Default: the current working directory. */
189
+ /** Names the working directory. Default: the current working directory. */
185
190
  readonly workspace?: string;
186
- /** Environment overrides merged over the parent environment; an `undefined` value unsets a key. */
191
+ /** Holds environment overrides merged over the parent environment; an `undefined` value unsets a key. */
187
192
  readonly environment?: Readonly<Record<string, string | undefined>>;
188
- /** Standard-input payload written to the child, including any NUL characters. */
193
+ /** Holds the standard-input payload written to the child, including any NUL characters. */
189
194
  readonly input?: string;
190
- /** Milliseconds before the host kills the root process alone. `0` or omitted disables the timeout. */
195
+ /** Sets the milliseconds before the host kills the root process alone. `0` or omitted disables the timeout. */
191
196
  readonly timeout?: number;
192
- /** If `false`, return the result on failure instead of throwing. Default: `true`. */
197
+ /** If `true`, throw on failure; if `false`, return the result instead. Default: `true`. */
193
198
  readonly strict?: boolean;
194
- /** Maximum captured bytes for stdout and for stderr, each. Default: {@link PROCESS_OUTPUT}. */
199
+ /** Sets the maximum captured bytes for stdout and for stderr, each. Default: {@link PROCESS_OUTPUT}. */
195
200
  readonly limit?: number;
196
201
  }
197
202
 
@@ -206,7 +211,7 @@ export declare interface ExecuteSyncOptions {
206
211
  * plain or property-only lookalike.
207
212
  *
208
213
  * @param value - The value to inspect
209
- * @returns True only for a `ProcessError` instance; false otherwise
214
+ * @returns True if the value is a `ProcessError` instance; false otherwise
210
215
  *
211
216
  * @example
212
217
  * ```ts
@@ -216,15 +221,15 @@ export declare interface ExecuteSyncOptions {
216
221
  */
217
222
  export declare function isProcessError(value: unknown): value is ProcessError;
218
223
 
219
- /** The default soft high-water mark in bytes for a supervised {@link ProcessInterface} line backlog. */
224
+ /** Names the default soft high-water mark, 10485760 bytes, for a supervised {@link ProcessInterface} line backlog. */
220
225
  export declare const PROCESS_BACKLOG = 10485760;
221
226
 
222
- /** The window in milliseconds a termination waits for the child's native exit after the final kill. */
227
+ /** Names the window, 5000 ms, a termination waits for the child's native exit after the final kill. */
223
228
  export declare const PROCESS_CONFIRMATION = 5000;
224
229
 
225
230
  /**
226
- * The default window in milliseconds the package waits for the child's read ends to close after
227
- * the child's native exit or after a termination this package initiated, before cutting them off.
231
+ * Names the default window, 1000 ms, the package waits for the child's read ends to close after the
232
+ * child's native exit or after a termination this package initiated, before cutting them off.
228
233
  *
229
234
  * @remarks
230
235
  * Measured on Windows 11 with Node v24.18.1 on 2026-08-21, spawning the `tests/src/server/fixtures`
@@ -239,26 +244,29 @@ export declare const PROCESS_CONFIRMATION = 5000;
239
244
  */
240
245
  export declare const PROCESS_DRAIN = 1000;
241
246
 
242
- /** The machine-readable failure categories a {@link ProcessError} carries, in declaration order. */
247
+ /**
248
+ * Lists the machine-readable failure categories a {@link ProcessError} carries, in declaration order:
249
+ * `spawn`, `timeout`, `input`, `duplicate`, `protocol`, and `invalid`.
250
+ */
243
251
  export declare const PROCESS_ERROR_CODES: readonly ["spawn", "timeout", "input", "duplicate", "protocol", "invalid"];
244
252
 
245
- /** The default maximum retained stderr tail in bytes for a supervised {@link ProcessInterface}. */
253
+ /** Names the default maximum retained stderr tail, 2048 bytes, for a supervised {@link ProcessInterface}. */
246
254
  export declare const PROCESS_EVIDENCE = 2048;
247
255
 
248
- /** The default cooperative POSIX window in milliseconds between `SIGTERM` and `SIGKILL` during termination. */
256
+ /** Names the default cooperative POSIX window, 5000 ms, between `SIGTERM` and `SIGKILL` during termination. */
249
257
  export declare const PROCESS_GRACE = 5000;
250
258
 
251
- /** The default maximum captured bytes for a one-shot run's stdout and stderr, each. */
259
+ /** Names the default maximum captured bytes, 10485760 each, for a one-shot run's stdout and stderr. */
252
260
  export declare const PROCESS_OUTPUT = 10485760;
253
261
 
254
- /** The executable extensions a Windows lookup applies when the environment declares no `PATHEXT`. */
262
+ /** Lists the executable extensions a Windows lookup applies when the environment declares no `PATHEXT`, `.COM;.EXE;.BAT;.CMD`. */
255
263
  export declare const PROCESS_PATHEXT = ".COM;.EXE;.BAT;.CMD";
256
264
 
257
- /** The largest timer delay in milliseconds the host schedules without truncating it to one. */
265
+ /** Names the largest timer delay, 2147483647 ms, the host schedules without truncating it to one. */
258
266
  export declare const PROCESS_TIMER = 2147483647;
259
267
 
260
268
  /**
261
- * The public contracts for `@orkestrel/process`: a typed child-process toolkit.
269
+ * Declares the public contracts for `@orkestrel/process`: a typed child-process toolkit.
262
270
  *
263
271
  * @remarks
264
272
  * The tiers divide by lifetime:
@@ -280,7 +288,7 @@ export declare const PROCESS_TIMER = 2147483647;
280
288
  * and plain `string` signal names). The Node implementations live in `@orkestrel/process/server`.
281
289
  */
282
290
  /**
283
- * One spawnable command: the executable, its argument vector, and optional environment overrides
291
+ * Represents one spawnable command: the executable, its argument vector, and optional environment overrides
284
292
  * and initial standard input.
285
293
  *
286
294
  * @remarks
@@ -298,19 +306,30 @@ export declare interface ProcessCommand {
298
306
  readonly arguments: readonly string[];
299
307
  readonly environment?: Readonly<Record<string, string | undefined>>;
300
308
  readonly input?: string;
301
- /** If `true`, exclude the parent environment; on POSIX this leaves no `PATH`, while Windows libuv still injects a host set. */
309
+ /** If `true`, exclude the parent environment; if `false` or omitted, the overrides layer over it. On POSIX `true` leaves no `PATH`, while Windows libuv still injects a host set. */
302
310
  readonly isolated?: boolean;
303
311
  }
304
312
 
305
- /** A child-process failure with a stable machine-readable category. */
313
+ /**
314
+ * Represents a child-process failure with a stable machine-readable category.
315
+ *
316
+ * @example
317
+ * ```ts
318
+ * const error = new ProcessError('git status refused', {
319
+ * code: 'invalid',
320
+ * context: { command: 'git status' },
321
+ * })
322
+ * error.code // 'invalid'
323
+ * ```
324
+ */
306
325
  export declare class ProcessError extends Error {
307
326
  readonly name = "ProcessError";
308
327
  readonly code: ProcessErrorCode;
309
328
  readonly context?: ProcessErrorContext;
310
- /** The buffered run outcome, present when a one-shot run produced the failure. */
329
+ /** Carries the buffered run outcome, present when a one-shot run produced the failure. */
311
330
  readonly result?: ExecuteResult;
312
331
  /**
313
- * Create a process error.
332
+ * Creates a process error.
314
333
  *
315
334
  * @param message - Human-readable failure description
316
335
  * @param options - Machine-readable category, optional context, optional cause, and optional run result
@@ -318,37 +337,40 @@ export declare class ProcessError extends Error {
318
337
  constructor(message: string, options: ProcessErrorOptions);
319
338
  }
320
339
 
321
- /** The machine-readable {@link ProcessError} categories, derived from {@link PROCESS_ERROR_CODES}. */
340
+ /**
341
+ * Names the machine-readable {@link ProcessError} categories, derived from {@link PROCESS_ERROR_CODES}:
342
+ * `spawn`, `timeout`, `input`, `duplicate`, `protocol`, and `invalid`.
343
+ */
322
344
  export declare type ProcessErrorCode = (typeof PROCESS_ERROR_CODES)[number];
323
345
 
324
- /** Structured context carried by a {@link ProcessError}. */
346
+ /** Represents structured context carried by a {@link ProcessError}. */
325
347
  export declare interface ProcessErrorContext {
326
- /** The registry id involved, for a manager failure. */
348
+ /** Names the registry id involved, for a manager failure. */
327
349
  readonly id?: string;
328
- /** The command line involved, for a run or spawn failure. */
350
+ /** Names the command line involved, for a run or spawn failure. */
329
351
  readonly command?: string;
330
- /** The child's exit code, when one was observed. */
352
+ /** Holds the child's exit code, when one was observed. */
331
353
  readonly code?: number | null;
332
- /** The terminating signal, when one ended the child. */
354
+ /** Names the terminating signal, when one ended the child. */
333
355
  readonly signal?: string | null;
334
- /** The rejected public input, for an input-validation failure. */
356
+ /** Carries the rejected public input, for an input-validation failure. */
335
357
  readonly value?: unknown;
336
358
  }
337
359
 
338
- /** Construction options for a {@link ProcessError}. */
360
+ /** Configures a {@link ProcessError}. */
339
361
  export declare interface ProcessErrorOptions {
340
- /** The stable machine-readable category. */
362
+ /** Names the stable machine-readable category. */
341
363
  readonly code: ProcessErrorCode;
342
- /** Structured detail about the failure. */
364
+ /** Carries structured detail about the failure. */
343
365
  readonly context?: ProcessErrorContext;
344
- /** The underlying cause, when one exists. */
366
+ /** Carries the underlying cause, when one exists. */
345
367
  readonly cause?: unknown;
346
- /** The buffered run outcome, present when an {@link ExecuteResult} produced the failure. */
368
+ /** Carries the buffered run outcome, present when an {@link ExecuteResult} produced the failure. */
347
369
  readonly result?: ExecuteResult;
348
370
  }
349
371
 
350
372
  /**
351
- * The push observation surface of a {@link ProcessInterface} — the moments a fire-and-forget
373
+ * Represents the push observation surface of a {@link ProcessInterface} — the moments a fire-and-forget
352
374
  * observer subscribes to, alongside the `lines` stream and the `exit` promise.
353
375
  *
354
376
  * @remarks
@@ -362,16 +384,16 @@ export declare interface ProcessErrorOptions {
362
384
  * routed to that handler, never emitted as this `error` event.
363
385
  */
364
386
  export declare type ProcessEventMap = {
365
- /** A decoded standard-error chunk arrived. */
387
+ /** Reports a decoded standard-error chunk arrived. */
366
388
  readonly stderr: readonly [chunk: string];
367
- /** The child or its open standard-input channel reported a fault, carrying the host cause directly or through a `protocol` {@link ProcessError}. */
389
+ /** Reports a fault from the child or its open standard-input channel, carrying the host cause directly or through a `protocol` {@link ProcessError}. */
368
390
  readonly error: readonly [error: unknown];
369
- /** The child settled — its terminal state, delivered once. */
391
+ /** Reports the child settled — its terminal state, delivered once. */
370
392
  readonly exit: readonly [exit: ProcessExit];
371
393
  };
372
394
 
373
395
  /**
374
- * The observed terminal state of a child process: its exit code or the signal that ended it, and
396
+ * Represents the observed terminal state of a child process: its exit code or the signal that ended it, and
375
397
  * how its observation ended.
376
398
  *
377
399
  * @remarks
@@ -382,16 +404,16 @@ export declare type ProcessEventMap = {
382
404
  * dropped lines and the drain bound cut stderr off.
383
405
  */
384
406
  export declare interface ProcessExit {
385
- /** The exit code, or `null` when a signal ended the process. A spawn fault reports the host's negative errno for `Process` and `execute`. */
407
+ /** Holds the exit code, or `null` when a signal ended the process. A spawn fault reports the host's negative errno for `Process` and `execute`. */
386
408
  readonly code: number | null;
387
- /** The terminating signal name, or `null` when the process exited on its own. */
409
+ /** Holds the terminating signal name, or `null` when the process exited on its own. */
388
410
  readonly signal: string | null;
389
- /** True when the terminal moment arrived because the child's streams closed; false when the `drain` bound elapsed first and later diagnostics may have existed. */
411
+ /** Reports how the terminal moment arrived: true when the child's streams closed; false when the `drain` bound elapsed first and later diagnostics may have existed. */
390
412
  readonly drained: boolean;
391
413
  }
392
414
 
393
415
  /**
394
- * One supervised child process with framed output, a bounded backlog, and bounded termination.
416
+ * Represents one supervised child process with framed output, a bounded backlog, and bounded termination.
395
417
  *
396
418
  * @remarks
397
419
  * `lines` is pumped as soon as the child writes, and it is a single-consumer stream: each line goes
@@ -426,16 +448,16 @@ export declare interface ProcessExit {
426
448
  * supervisor inside that window reads the terminal state here.
427
449
  */
428
450
  export declare interface ProcessInterface {
429
- /** The host process id, fixed when construction returns, or `undefined` when the spawn produced none. */
451
+ /** Holds the host process id, fixed when construction returns, or `undefined` when the spawn produced none. */
430
452
  readonly pid: number | undefined;
431
- /** The exit code the host recorded, or `null` while the child has not exited and when a signal ended it. A spawn fault reports the host's negative errno. */
453
+ /** Holds the exit code the host recorded, or `null` while the child has not exited and when a signal ended it. A spawn fault reports the host's negative errno. */
432
454
  readonly code: number | null;
433
- /** The terminating signal name the host recorded, or `null` while the child has not exited and when it exited on its own. */
455
+ /** Holds the terminating signal name the host recorded, or `null` while the child has not exited and when it exited on its own. */
434
456
  readonly signal: string | null;
435
- /** The typed lifecycle observation surface. */
457
+ /** Holds the typed lifecycle observation surface. */
436
458
  readonly emitter: EmitterInterface<ProcessEventMap>;
437
459
  /**
438
- * The captured stdout lines, in arrival order, for one consumer, ending at the terminal moment.
460
+ * Yields the captured stdout lines, in arrival order, for one consumer, ending at the terminal moment.
439
461
  *
440
462
  * @remarks
441
463
  * A line feed, a CRLF pair, and a bare carriage return each terminate a line, and a CRLF split
@@ -455,7 +477,7 @@ export declare interface ProcessInterface {
455
477
  */
456
478
  readonly lines: AsyncIterable<string>;
457
479
  /**
458
- * The decoded byte-bounded stderr tail.
480
+ * Holds the decoded byte-bounded stderr tail.
459
481
  *
460
482
  * @remarks
461
483
  * The live tail before the terminal moment and the frozen value after it, on every path — a
@@ -465,10 +487,10 @@ export declare interface ProcessInterface {
465
487
  * the tail as of the cutoff, and later diagnostics may have existed.
466
488
  */
467
489
  readonly evidence: string;
468
- /** True when the `lines` stream omitted output because a retention bound was reached. */
490
+ /** Reports whether the `lines` stream omitted output because a retention bound was reached. */
469
491
  readonly truncated: boolean;
470
492
  /**
471
- * True after the `exit` promise settled.
493
+ * Reports whether the `exit` promise settled.
472
494
  *
473
495
  * @remarks
474
496
  * The terminal moment has arrived: `evidence` is frozen, `lines` has ended, and the
@@ -477,7 +499,7 @@ export declare interface ProcessInterface {
477
499
  */
478
500
  readonly settled: boolean;
479
501
  /**
480
- * True after a termination began.
502
+ * Reports whether a termination began.
481
503
  *
482
504
  * @remarks
483
505
  * Monotonic. It turns true when `stop`, `destroy`, or an abort of the `signal` option begins a
@@ -488,7 +510,7 @@ export declare interface ProcessInterface {
488
510
  */
489
511
  readonly stopping: boolean;
490
512
  /**
491
- * The terminal child state, delivered once.
513
+ * Settles with the terminal child state, delivered once.
492
514
  *
493
515
  * @remarks
494
516
  * Never rejects. It settles at the terminal moment: when the child's streams close, or when the
@@ -497,7 +519,7 @@ export declare interface ProcessInterface {
497
519
  */
498
520
  readonly exit: Promise<ProcessExit>;
499
521
  /**
500
- * Write one line to the open standard-input channel.
522
+ * Writes one line to the open standard-input channel.
501
523
  *
502
524
  * @remarks
503
525
  * Never rejects. `true` means the host accepted the bytes without reporting a fault; it does not
@@ -511,11 +533,11 @@ export declare interface ProcessInterface {
511
533
  * for bytes the package is about to discard.
512
534
  *
513
535
  * @param text - The line text without its trailing newline
514
- * @returns True when the host accepted the bytes without reporting a fault; false when the channel was closed, destroyed, ended, failed, or remained unconfirmed through `delivery`
536
+ * @returns True if the host accepted the bytes without reporting a fault; false otherwise (the channel was closed, destroyed, ended, failed, or the write remained unconfirmed through `delivery`)
515
537
  */
516
538
  send(text: string): Promise<boolean>;
517
539
  /**
518
- * Terminate the child process tree, await its observed exit, and reach the terminal moment.
540
+ * Terminates the child process tree, awaits its observed exit, and reaches the terminal moment.
519
541
  *
520
542
  * @remarks
521
543
  * Never rejects. On Windows the whole tree is killed immediately through `taskkill`, with a
@@ -528,11 +550,11 @@ export declare interface ProcessInterface {
528
550
  * reaches the end of the stream instead of waiting on a child it already ended, and needs no
529
551
  * second call to release it.
530
552
  *
531
- * @returns True when the child's native exit was observed; false when the confirmation deadline elapsed without it
553
+ * @returns True if the child's native exit was observed; false otherwise (the confirmation deadline elapsed without it)
532
554
  */
533
555
  stop(): Promise<boolean>;
534
556
  /**
535
- * Stop the child, close its standard-input channel, reach the terminal moment, and destroy the
557
+ * Stops the child, closes its standard-input channel, reaches the terminal moment, and destroys the
536
558
  * observation emitter.
537
559
  *
538
560
  * @remarks
@@ -549,21 +571,21 @@ export declare interface ProcessInterface {
549
571
  }
550
572
 
551
573
  /**
552
- * The push observation surface of a {@link ProcessManagerInterface} — the fleet-level moments a
574
+ * Represents the push observation surface of a {@link ProcessManagerInterface} — the fleet-level moments a
553
575
  * fire-and-forget observer subscribes to.
554
576
  *
555
577
  * @remarks
556
578
  * Declared as a `type` alias so it satisfies the emitter's `EventMap` constraint structurally.
557
579
  */
558
580
  export declare type ProcessManagerEventMap = {
559
- /** A child was launched under its id. */
581
+ /** Reports a child launched under its id. */
560
582
  readonly launch: readonly [id: string];
561
- /** A child settled and left the registry — its id and terminal state. */
583
+ /** Reports a child settled and left the registry — its id and terminal state. */
562
584
  readonly exit: readonly [id: string, exit: ProcessExit];
563
585
  };
564
586
 
565
587
  /**
566
- * A keyed registry of live supervised child processes.
588
+ * Represents a keyed registry of live supervised child processes.
567
589
  *
568
590
  * @remarks
569
591
  * A child that settles removes itself from the registry, so `count` and `processes` reflect only
@@ -575,25 +597,25 @@ export declare type ProcessManagerEventMap = {
575
597
  * the `launch` and `exit` moments across every child.
576
598
  */
577
599
  export declare interface ProcessManagerInterface {
578
- /** The typed fleet-level observation surface. */
600
+ /** Holds the typed fleet-level observation surface. */
579
601
  readonly emitter: EmitterInterface<ProcessManagerEventMap>;
580
- /** The number of live children. */
602
+ /** Counts the live children. */
581
603
  readonly count: number;
582
604
  /**
583
- * The live child under `id`, or `undefined` when none is.
605
+ * Returns the live child under `id`, or `undefined` when none is.
584
606
  *
585
607
  * @param id - The registry key
586
608
  * @returns The child, or `undefined`
587
609
  */
588
610
  process(id: string): ProcessInterface | undefined;
589
611
  /**
590
- * A snapshot of every live child.
612
+ * Returns a snapshot of every live child.
591
613
  *
592
614
  * @returns The live children in launch order
593
615
  */
594
616
  processes(): readonly ProcessInterface[];
595
617
  /**
596
- * Spawn and register one child under `id`.
618
+ * Spawns and registers one child under `id`.
597
619
  *
598
620
  * @remarks
599
621
  * Every option is read before the child is spawned, so a caller's own option getter runs while
@@ -611,27 +633,28 @@ export declare interface ProcessManagerInterface {
611
633
  */
612
634
  launch(id: string, options: ProcessOptions): ProcessInterface;
613
635
  /**
614
- * Terminate the named children and await their exit.
636
+ * Terminates the named children, or every live child when a call names none, and awaits their
637
+ * exit.
615
638
  *
616
639
  * @param ids - The registry keys to stop
617
- * @returns True when every named child was live and its exit was confirmed; false otherwise
640
+ * @returns True if every named child was live and its exit was confirmed; false otherwise
618
641
  */
619
642
  stop(ids: readonly string[]): Promise<boolean>;
620
643
  /**
621
- * Terminate one child and await its exit.
644
+ * Terminates one child and awaits its exit.
622
645
  *
623
646
  * @param id - The registry key to stop
624
- * @returns True when the child was live and its exit was confirmed; false when the id was not live or the confirmation deadline elapsed
647
+ * @returns True if the child was live and its exit was confirmed; false otherwise (the id was not live, or the confirmation deadline elapsed)
625
648
  */
626
649
  stop(id: string): Promise<boolean>;
627
650
  /**
628
- * Terminate every live child and await their exit.
651
+ * Terminates every live child and awaits their exit.
629
652
  *
630
653
  * @returns A promise that resolves after every child stops
631
654
  */
632
655
  stop(): Promise<void>;
633
656
  /**
634
- * Stop every child, then destroy the registry emitter last.
657
+ * Stops every child, then destroys the registry emitter last.
635
658
  *
636
659
  * @remarks
637
660
  * Always resolves, and refuses a later `launch` with a {@link ProcessError} coded `protocol`.
@@ -645,7 +668,7 @@ export declare interface ProcessManagerInterface {
645
668
  }
646
669
 
647
670
  /**
648
- * Construction options for a {@link ProcessManagerInterface}.
671
+ * Configures a {@link ProcessManagerInterface}.
649
672
  *
650
673
  * @remarks
651
674
  * `on` installs initial {@link ProcessManagerEventMap} listeners and `error` receives isolated
@@ -657,7 +680,7 @@ export declare interface ProcessManagerOptions {
657
680
  }
658
681
 
659
682
  /**
660
- * Construction options for one supervised child process.
683
+ * Configures one supervised child process.
661
684
  *
662
685
  * @remarks
663
686
  * `grace` is the cooperative window between `SIGTERM` and `SIGKILL` on a POSIX host; Windows has no
@@ -685,26 +708,26 @@ export declare interface ProcessOptions {
685
708
  readonly on?: EmitterHooks<ProcessEventMap>;
686
709
  readonly error?: EmitterErrorHandler;
687
710
  readonly command: ProcessCommand;
688
- /** The working directory the child runs in. */
711
+ /** Names the working directory the child runs in. */
689
712
  readonly workspace: string;
690
- /** Cooperative POSIX window in milliseconds between `SIGTERM` and `SIGKILL`. Default: {@link PROCESS_GRACE}. */
713
+ /** Sets the cooperative POSIX window in milliseconds between `SIGTERM` and `SIGKILL`. Default: {@link PROCESS_GRACE}. */
691
714
  readonly grace?: number;
692
- /** Milliseconds the package waits for the child's read ends to close after the native exit or an initiated termination, before cutting them off; `0` cuts them off as soon as the bound is armed. Default: {@link PROCESS_DRAIN}. */
715
+ /** Sets the milliseconds the package waits for the child's read ends to close after the native exit or an initiated termination, before cutting them off; `0` cuts them off as soon as the bound is armed. Default: {@link PROCESS_DRAIN}. */
693
716
  readonly drain?: number;
694
- /** Maximum retained stderr tail in bytes. Default: {@link PROCESS_EVIDENCE}. */
717
+ /** Sets the maximum retained stderr tail in bytes. Default: {@link PROCESS_EVIDENCE}. */
695
718
  readonly evidence?: number;
696
- /** Soft high-water mark in bytes for the unconsumed `lines` backlog; termination retains at most twice this value. Default: {@link PROCESS_BACKLOG}. */
719
+ /** Sets the soft high-water mark in bytes for the unconsumed `lines` backlog; termination retains at most twice this value. Default: {@link PROCESS_BACKLOG}. */
697
720
  readonly backlog?: number;
698
- /** Milliseconds an unconfirmed {@link ProcessInterface.send} waits before resolving `false`. `0` or omitted disables the bound. */
721
+ /** Sets the milliseconds an unconfirmed {@link ProcessInterface.send} waits before resolving `false`. `0` or omitted disables the bound. */
699
722
  readonly delivery?: number;
700
723
  /** If `true`, stdin stays open for {@link ProcessInterface.send}; if `false` or omitted, stdin closes after any initial `input`. */
701
724
  readonly writable?: boolean;
702
- /** Aborting this signal terminates the child through the same bounded `stop`. */
725
+ /** Terminates the child through the same bounded `stop` when this signal aborts. */
703
726
  readonly signal?: AbortSignal;
704
727
  }
705
728
 
706
729
  /**
707
- * The push observation surface of a {@link SessionInterface} — the moments a byte-oriented observer
730
+ * Represents the push observation surface of a {@link SessionInterface} — the moments a byte-oriented observer
708
731
  * subscribes to, alongside the `ending` and `exit` promises.
709
732
  *
710
733
  * @remarks
@@ -727,18 +750,18 @@ export declare interface ProcessOptions {
727
750
  * `error` event.
728
751
  */
729
752
  export declare type SessionEventMap = {
730
- /** A standard-output chunk arrived, as an owned `Uint8Array` the consumer may keep and mutate. */
753
+ /** Reports a standard-output chunk arrived, as an owned `Uint8Array` the consumer may keep and mutate. */
731
754
  readonly stdout: readonly [chunk: Uint8Array];
732
- /** A decoded standard-error chunk arrived. */
755
+ /** Reports a decoded standard-error chunk arrived. */
733
756
  readonly stderr: readonly [chunk: string];
734
- /** The child or its open standard-input channel reported a fault, carrying the host cause directly or through a `protocol` {@link ProcessError}. */
757
+ /** Reports a fault from the child or its open standard-input channel, carrying the host cause directly or through a `protocol` {@link ProcessError}. */
735
758
  readonly error: readonly [error: unknown];
736
- /** The child settled — its terminal state, delivered once. */
759
+ /** Reports the child settled — its terminal state, delivered once. */
737
760
  readonly exit: readonly [exit: ProcessExit];
738
761
  };
739
762
 
740
763
  /**
741
- * One supervised child process read as raw bytes, with an open standard-input channel and bounded
764
+ * Represents one supervised child process read as raw bytes, with an open standard-input channel and bounded
742
765
  * termination.
743
766
  *
744
767
  * @remarks
@@ -770,16 +793,16 @@ export declare type SessionEventMap = {
770
793
  * the id.
771
794
  */
772
795
  export declare interface SessionInterface {
773
- /** The host process id, fixed when construction returns, or `undefined` when the spawn produced none. */
796
+ /** Holds the host process id, fixed when construction returns, or `undefined` when the spawn produced none. */
774
797
  readonly pid: number | undefined;
775
- /** The exit code the host recorded, or `null` while the child has not exited and when a signal ended it. A spawn fault reports the host's negative errno. */
798
+ /** Holds the exit code the host recorded, or `null` while the child has not exited and when a signal ended it. A spawn fault reports the host's negative errno. */
776
799
  readonly code: number | null;
777
- /** The terminating signal name the host recorded, or `null` while the child has not exited and when it exited on its own. */
800
+ /** Holds the terminating signal name the host recorded, or `null` while the child has not exited and when it exited on its own. */
778
801
  readonly signal: string | null;
779
- /** The typed lifecycle observation surface. */
802
+ /** Holds the typed lifecycle observation surface. */
780
803
  readonly emitter: EmitterInterface<SessionEventMap>;
781
804
  /**
782
- * The decoded byte-bounded stderr tail.
805
+ * Holds the decoded byte-bounded stderr tail.
783
806
  *
784
807
  * @remarks
785
808
  * The live tail before the terminal moment and the frozen value after it, on every path — a
@@ -789,7 +812,7 @@ export declare interface SessionInterface {
789
812
  */
790
813
  readonly evidence: string;
791
814
  /**
792
- * True after the `exit` promise settled.
815
+ * Reports whether the `exit` promise settled.
793
816
  *
794
817
  * @remarks
795
818
  * The terminal moment has arrived: `evidence` is frozen, no further `stdout` or `stderr` event
@@ -798,7 +821,7 @@ export declare interface SessionInterface {
798
821
  */
799
822
  readonly settled: boolean;
800
823
  /**
801
- * True after a termination began.
824
+ * Reports whether a termination began.
802
825
  *
803
826
  * @remarks
804
827
  * Monotonic. It turns true when `stop`, `destroy`, or an abort of the `signal` option begins a
@@ -808,7 +831,7 @@ export declare interface SessionInterface {
808
831
  */
809
832
  readonly stopping: boolean;
810
833
  /**
811
- * The child's own ending, awaited without the terminal moment's drain window.
834
+ * Settles at the child's own ending, awaited without the terminal moment's drain window.
812
835
  *
813
836
  * @remarks
814
837
  * Never rejects, and resolves no value: `code` and `signal` carry the terminal facts as soon as
@@ -821,7 +844,7 @@ export declare interface SessionInterface {
821
844
  */
822
845
  readonly ending: Promise<void>;
823
846
  /**
824
- * The terminal child state, delivered once.
847
+ * Settles with the terminal child state, delivered once.
825
848
  *
826
849
  * @remarks
827
850
  * Never rejects. It settles at the terminal moment: when the child's streams close, or when the
@@ -830,7 +853,7 @@ export declare interface SessionInterface {
830
853
  */
831
854
  readonly exit: Promise<ProcessExit>;
832
855
  /**
833
- * Write raw bytes to the open standard-input channel.
856
+ * Writes raw bytes to the open standard-input channel.
834
857
  *
835
858
  * @remarks
836
859
  * Never rejects, and adds no framing: the bytes reach the child exactly as given, with no
@@ -847,11 +870,11 @@ export declare interface SessionInterface {
847
870
  * promise settles: bytes mutated inside that window are the bytes the child receives.
848
871
  *
849
872
  * @param bytes - The payload to write, already framed by the caller
850
- * @returns True when the host accepted the bytes without reporting a fault; false when the channel was closed, destroyed, ended, failed, or remained unconfirmed through `delivery`
873
+ * @returns True if the host accepted the bytes without reporting a fault; false otherwise (the channel was closed, destroyed, ended, failed, or the write remained unconfirmed through `delivery`)
851
874
  */
852
875
  write(bytes: Uint8Array): Promise<boolean>;
853
876
  /**
854
- * Close the standard-input channel and leave the child running.
877
+ * Closes the standard-input channel and leaves the child running.
855
878
  *
856
879
  * @remarks
857
880
  * Never rejects, and terminates nothing: `stopping` stays false, no signal is sent, no drain
@@ -872,7 +895,7 @@ export declare interface SessionInterface {
872
895
  */
873
896
  end(): Promise<void>;
874
897
  /**
875
- * Terminate the child process tree, await its observed exit, and reach the terminal moment.
898
+ * Terminates the child process tree, awaits its observed exit, and reaches the terminal moment.
876
899
  *
877
900
  * @remarks
878
901
  * Never rejects. On Windows the whole tree is killed immediately through `taskkill`, with a
@@ -883,11 +906,11 @@ export declare interface SessionInterface {
883
906
  * `stdout` and `stderr` events stop, and `exit` settles. A caller that stops a child and keeps
884
907
  * listening therefore reaches the end of the stream and needs no second call to release it.
885
908
  *
886
- * @returns True when the child's native exit was observed; false when the confirmation deadline elapsed without it
909
+ * @returns True if the child's native exit was observed; false otherwise (the confirmation deadline elapsed without it)
887
910
  */
888
911
  stop(): Promise<boolean>;
889
912
  /**
890
- * Stop the child, close its standard-input channel, reach the terminal moment, and destroy the
913
+ * Stops the child, closes its standard-input channel, reaches the terminal moment, and destroys the
891
914
  * observation emitter.
892
915
  *
893
916
  * @remarks
@@ -904,7 +927,7 @@ export declare interface SessionInterface {
904
927
  }
905
928
 
906
929
  /**
907
- * Construction options for one raw byte session over a supervised child.
930
+ * Configures one raw byte session over a supervised child.
908
931
  *
909
932
  * @remarks
910
933
  * This is {@link ProcessOptions} without `backlog` and without `writable`. A session frames nothing
@@ -924,22 +947,22 @@ export declare interface SessionOptions {
924
947
  readonly on?: EmitterHooks<SessionEventMap>;
925
948
  readonly error?: EmitterErrorHandler;
926
949
  readonly command: ProcessCommand;
927
- /** The working directory the child runs in. */
950
+ /** Names the working directory the child runs in. */
928
951
  readonly workspace: string;
929
- /** Cooperative POSIX window in milliseconds between `SIGTERM` and `SIGKILL`. Default: {@link PROCESS_GRACE}. */
952
+ /** Sets the cooperative POSIX window in milliseconds between `SIGTERM` and `SIGKILL`. Default: {@link PROCESS_GRACE}. */
930
953
  readonly grace?: number;
931
- /** Milliseconds the package waits for the child's read ends to close after the native exit or an initiated termination, before cutting them off; `0` cuts them off as soon as the bound is armed. Default: {@link PROCESS_DRAIN}. */
954
+ /** Sets the milliseconds the package waits for the child's read ends to close after the native exit or an initiated termination, before cutting them off; `0` cuts them off as soon as the bound is armed. Default: {@link PROCESS_DRAIN}. */
932
955
  readonly drain?: number;
933
- /** Maximum retained stderr tail in bytes. Default: {@link PROCESS_EVIDENCE}. */
956
+ /** Sets the maximum retained stderr tail in bytes. Default: {@link PROCESS_EVIDENCE}. */
934
957
  readonly evidence?: number;
935
- /** Milliseconds an unconfirmed {@link SessionInterface.write} waits before resolving `false`. `0` or omitted disables the bound. */
958
+ /** Sets the milliseconds an unconfirmed {@link SessionInterface.write} waits before resolving `false`. `0` or omitted disables the bound. */
936
959
  readonly delivery?: number;
937
- /** Aborting this signal terminates the child through the same bounded `stop`. */
960
+ /** Terminates the child through the same bounded `stop` when this signal aborts. */
938
961
  readonly signal?: AbortSignal;
939
962
  }
940
963
 
941
964
  /**
942
- * The resolved spawn form of one command: the executable to launch, the argument vector to pass,
965
+ * Represents the resolved spawn form of one command: the executable to launch, the argument vector to pass,
943
966
  * and whether the host receives that vector verbatim.
944
967
  *
945
968
  * @remarks