import type { ChildProcessWithoutNullStreams } from "node:child_process";
import { PassThrough } from "node:stream";
import type { AgentSession, AgentStreamEvent } from "../../../agent-sdk-types.js";
type JsonObject = Record<string, unknown>;
type FakeCodexAppServerHandler = (params: unknown) => unknown;
type CodexAppServerChildProcess = ChildProcessWithoutNullStreams & {
    stdin: PassThrough;
    stdout: PassThrough;
    stderr: PassThrough;
};
export interface FakeCodexAppServer {
    readonly child: CodexAppServerChildProcess;
    readonly recordedRollbacks: JsonObject[];
    assertNoErrors(): void;
    waitForTurnStart(): Promise<JsonObject>;
    nextResponse(): Promise<string>;
    completeTurn(params?: {
        threadId?: string;
    }): void;
    requestCommandApproval(params: {
        itemId: string;
        threadId: string;
        turnId: string;
        command: string;
        cwd: string;
        reason: string;
    }): void;
    waitForCommandApprovalDecision(itemId: string): Promise<unknown>;
}
export declare function createCodexAppServerChildProcess(): CodexAppServerChildProcess;
export declare function createFakeCodexAppServer(handlers?: Record<string, FakeCodexAppServerHandler>): FakeCodexAppServer;
export declare function waitForNextPermission(session: AgentSession): Promise<Extract<AgentStreamEvent, {
    type: "permission_requested";
}>>;
export {};
//# sourceMappingURL=fake-app-server.d.ts.map