import type { Page } from "@playwright/test";
import type OpenAI from "openai";
import { type AIGateway } from "../config";
export type RunCUALoopOptions = {
    page: Page;
    /** Initial natural-language instruction sent to the model. */
    instruction: string;
    /** Maximum number of computer_call turns before giving up. */
    maxSteps: number;
    /** Abort the loop when this signal fires (maps to step/user-flow timeouts). */
    abortSignal?: AbortSignal;
    /** Callback fired with any reasoning text surfaced in the model output. */
    onReasoning?: (reasoning: string) => void;
    /** Optional override client (used by tests). */
    client?: OpenAI;
    /** Resolved per-call gateway. Must be "none" for CUA. Defaults to "none". */
    gateway?: AIGateway;
};
/**
 * CUA action-loop.
 *
 * Protocol (OpenAI Responses API):
 *   1. Send initial instruction + the built-in `computer` tool.
 *   2. Read response.output for a `computer_call` item — if absent, the model is done.
 *   3. Execute each action in the call's `actions` array via Playwright.
 *   4. Take a screenshot, send it back as `computer_call_output` with the same
 *      `call_id`, chaining via `previous_response_id`.
 *   5. Loop until no more `computer_call` items (or maxSteps / abort).
 */
export declare function runCUALoop({ page, instruction, maxSteps, abortSignal, onReasoning, client, gateway, }: RunCUALoopOptions): Promise<string>;
