import type { ChildProcess, SpawnOptions } from 'node:child_process';
import type { AgentCli, AgentDefinition, VerificationCheck } from './types.js';
export interface SpawnOutcome {
    output: string;
    exitCode?: number;
    exitSignal?: string;
}
export interface SpawnCommand {
    bin: string;
    args: string[];
    env?: Record<string, string>;
}
export interface ShellOpts {
    cwd: string;
    timeoutMs?: number;
}
export interface AgentOpts extends ShellOpts {
}
export interface InteractiveOpts extends ShellOpts {
}
export interface ProcessSpawnerDeps {
    cwd: string;
}
export interface ProcessSpawner {
    spawnShell(command: string, opts: ShellOpts): Promise<SpawnOutcome>;
    spawnAgent(agent: AgentDefinition, task: string, opts: AgentOpts): Promise<SpawnOutcome>;
    spawnInteractive(agent: AgentDefinition, task: string, opts: InteractiveOpts): Promise<SpawnOutcome>;
    buildCommand(agent: AgentDefinition, task: string): SpawnCommand;
}
export declare function buildCommand(cli: AgentCli, extraArgs: string[] | undefined, task: string): string[];
export declare function spawnProcess(command: string[], options: SpawnOptions): ChildProcess;
export declare function collectOutput(process: ChildProcess): Promise<string>;
export declare function detectCompletion(output: string, verification?: VerificationCheck): boolean;
export declare function createProcessSpawner(deps: ProcessSpawnerDeps): ProcessSpawner;
//# sourceMappingURL=process-spawner.d.ts.map