import type { Scenario, Run, Result, ResultStatus } from "../types/index.js";
import type { Page } from "playwright";
export interface RunOptions {
    url: string;
    model?: string;
    headed?: boolean;
    parallel?: number;
    timeout?: number;
    retry?: number;
    projectId?: string;
    apiKey?: string;
    screenshotDir?: string;
    engine?: import("../types/index.js").BrowserEngine;
    personaId?: string;
    personaIds?: string[];
    samples?: number;
    flakinessThreshold?: number;
    a11y?: boolean | {
        level?: "A" | "AA" | "AAA";
    };
    selfHeal?: boolean;
    maxCostCents?: number;
    skipBudgetCheck?: boolean;
    cacheMaxAgeMs?: number;
    minimal?: boolean;
    maxTurns?: number;
    recordVideo?: boolean;
}
export interface RunEvent {
    type: "scenario:start" | "scenario:pass" | "scenario:fail" | "scenario:error" | "screenshot:captured" | "run:complete" | "step:tool_call" | "step:tool_result" | "step:thinking" | "scenario:timeout_warning";
    scenarioId?: string;
    scenarioName?: string;
    resultId?: string;
    runId?: string;
    error?: string;
    screenshotPath?: string;
    toolName?: string;
    toolInput?: Record<string, unknown>;
    toolResult?: string;
    thinking?: string;
    stepNumber?: number;
    retryAttempt?: number;
    maxRetries?: number;
    stepDurationMs?: number;
    timeoutMs?: number;
    elapsedMs?: number;
}
export type RunEventHandler = (event: RunEvent) => void;
export declare function onRunEvent(handler: RunEventHandler): void;
export declare function resolveAgentApiKeyForModel(model: string, explicitApiKey?: string, configuredAnthropicApiKey?: string): string | undefined;
export declare function resolveAgentMaxTurns(options: Pick<RunOptions, "minimal" | "maxTurns">): number;
type AgentScenarioStatus = Extract<ResultStatus, "passed" | "failed" | "error">;
export interface StructuredAssertionOutcome {
    status: AgentScenarioStatus;
    reasoning: string;
    assertionsPassed: string[];
    assertionsFailed: string[];
    assertionResults: Array<{
        type: string;
        description: string;
        passed: boolean;
        actual: string;
        error?: string;
    }>;
}
export declare function applyStructuredAssertionsToResult(input: {
    page: Page;
    scenario: Scenario;
    consoleErrors: string[];
    status: AgentScenarioStatus;
    reasoning: string;
}): Promise<StructuredAssertionOutcome>;
export declare function runSingleScenario(scenario: Scenario, runId: string, options: RunOptions): Promise<Result>;
export declare function runBatch(scenarios: Scenario[], options: RunOptions): Promise<{
    run: Run;
    results: Result[];
}>;
export declare function resolveScenariosForRun(options: RunOptions & {
    tags?: string[];
    priority?: string;
    scenarioIds?: string[];
}): Scenario[];
export declare function runByFilter(options: RunOptions & {
    tags?: string[];
    priority?: string;
    scenarioIds?: string[];
}): Promise<{
    run: Run;
    results: Result[];
}>;
/**
 * Start a run asynchronously — creates the run record immediately and returns it,
 * then executes scenarios in the background. Poll getRun(id) to check progress.
 */
export declare function startRunAsync(options: RunOptions & {
    tags?: string[];
    priority?: string;
    scenarioIds?: string[];
}): {
    runId: string;
    scenarioCount: number;
};
export {};
//# sourceMappingURL=runner.d.ts.map