import { type ChildProcess } from "node:child_process"; export interface RpcClientProcessOptions { cliPath: string; cliArgs: string[]; cwd?: string; env?: Record; runtimeExecutable?: string; runtimeArgs?: string[]; interactiveEngine: boolean; /** Credential handed to the engine child through the bootstrap file, never argv or env. */ interactiveEngineApiKey?: string; } export declare function createRpcClientProcessEnvironment(overrides?: Record, baseEnv?: NodeJS.ProcessEnv): NodeJS.ProcessEnv; export declare function spawnRpcClientProcess(options: RpcClientProcessOptions): ChildProcess; /** * How long a SIGTERMed interactive engine may spend running extension * `session_shutdown` handlers before its guardian and then a tree kill take over. * Builtin shutdown (MCP servers, durable workflow storage) routinely exceeds a * few hundred milliseconds on a loaded machine. */ export declare const ENGINE_SHUTDOWN_GRACE_MS = 5000; export declare function terminateRpcClientProcess(child: ChildProcess, processTree: boolean): Promise; export declare function createInteractiveJsonlOptions(enabled: boolean): { maxBytesPerTurn?: number; }; /** * CLI args for a replacement engine child: drop whatever session flag the * previous generation carried and bind the replacement to `sessionId`, so a * restart resumes the same conversation instead of starting a fresh one. */ export declare function restartCliArgs(args: readonly string[] | undefined, sessionId: string | undefined, sessionDirectory?: string): string[]; /** Keep only the tail of a child's stderr, so a noisy child cannot grow the host. */ export declare function appendBoundedStderr(existing: string, chunk: string): string; /** Batch noisy child output outside the pipe callback without filesystem work. */ export declare function createStderrReporter(report: (message: string) => void): (data: string) => void; //# sourceMappingURL=rpc-client-process.d.ts.map