import { type ChildProcessByStdio } from 'node:child_process';
import type { Readable } from 'node:stream';
import { AdkError } from '@botpress/analytics';
import { type Agent0OpenCodeRuntimeRenderOptions } from './engine.js';
type Agent0OpenCodeChildProcess = ChildProcessByStdio<null, Readable, Readable>;
export interface Agent0OpenCodeServerAuth {
    username: string;
    password: string;
}
export interface Agent0OpenCodeProcessOptions extends Agent0OpenCodeRuntimeRenderOptions {
    cwd?: string;
    env?: NodeJS.ProcessEnv;
    binaryPath?: string;
    serverUsername?: string;
    serverPassword?: string;
    startupTimeoutMs?: number;
    signal?: AbortSignal;
    onLog?: (message: string) => void;
}
export interface Agent0OpenCodeProcess {
    baseURL: string;
    authHeaders: Record<string, string>;
    renderedOpenCodeConfigHash: string;
    pid?: number;
    stop: () => Promise<void>;
}
export declare class Agent0OpenCodeStartupTimeoutError extends AdkError<'AGENT0_OPENCODE_STARTUP_TIMEOUT'> {
    readonly timeoutMs: number;
    readonly startupOutput?: string;
    constructor(timeoutMs: number, options?: {
        cause?: unknown;
        startupOutput?: string;
    });
}
export interface Agent0OpenCodeBinaryResolveOptions {
    homeDir?: string;
    version?: string;
    fetch?: typeof fetch;
    onLog?: (message: string) => void;
    findNodeModulesBinary?: () => string | null;
}
export declare function sanitizeAgent0OpenCodeBaseEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
export declare function buildAgent0OpenCodeProcessEnv(options: {
    baseEnv: NodeJS.ProcessEnv;
    runtimeEnv: Record<string, string>;
    serverAuth: Agent0OpenCodeServerAuth;
}): NodeJS.ProcessEnv;
export declare function buildAgent0OpenCodeAuthHeaders(auth: Agent0OpenCodeServerAuth): Record<string, string>;
export declare function resolveAgent0OpenCodeBinary(options?: Agent0OpenCodeBinaryResolveOptions): Promise<string>;
export declare function startAgent0OpenCodeProcess(options: Agent0OpenCodeProcessOptions): Promise<Agent0OpenCodeProcess>;
export declare function stopAgent0OpenCodeProcess(child: Agent0OpenCodeChildProcess): Promise<void>;
export {};
//# sourceMappingURL=process.d.ts.map