/** * Spawn a process and stream its stdout/stderr as an async generator. */ import type { ExecutionResult, StreamChunk } from './types.js'; /** * Options for {@link streamProcess}. */ export interface StreamProcessOptions { /** Maximum execution time in seconds. */ timeout?: number | undefined; /** Abort signal to cancel execution. */ signal?: AbortSignal | undefined; /** Custom error message when the spawned binary is not found (ENOENT). */ enoentMessage?: string | undefined; } /** * Spawn a command and stream its stdout/stderr, yielding the final result. * * Bridges Node.js event emitters to an async generator. Chunks are * yielded incrementally as the process produces output. The final * yield is an ExecutionResult with the exit code and complete output. * * All listeners are attached synchronously before any await to prevent * missed events from fast-completing processes. * * @param command - The binary to spawn. * @param args - Arguments to pass to the binary. * @param options - Timeout, abort signal, and ENOENT handling options. * @returns An async generator yielding StreamChunks followed by a final ExecutionResult. */ export declare function streamProcess(command: string, args: string[], options?: StreamProcessOptions): AsyncGenerator; //# sourceMappingURL=stream-process.d.ts.map