@orkestrel/process 0.0.9 → 0.0.10

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