import { type ChildProcess } from "node:child_process";
export interface OpenCodeAuth {
    password: string;
    baseUrl: string;
    authHeader: string;
}
export interface OpenCodeProcess {
    process: ChildProcess;
    auth: OpenCodeAuth;
    stop: () => Promise<void>;
}
/**
 * Spawn an OpenCode server process with retries and health check.
 *
 * - Generates a random password for HTTP Basic auth
 * - Spawns `opencode serve --port <port>` with OPENCODE_SERVER_PASSWORD env
 * - Waits for GET /global/health to return 200
 * - Retries up to 3 times on failure
 *
 * @param port Port to bind to (default: config opencode.port or 4096)
 * @returns OpenCodeProcess with the child process, auth info, and stop function
 */
export declare function spawnOpenCode(port?: number): Promise<OpenCodeProcess>;
//# sourceMappingURL=spawn.d.ts.map