/**
 * OpenAI ChatKit Provider
 *
 * Evaluates ChatKit workflows deployed via Agent Builder using Playwright
 * to interact with the ChatKit web component.
 *
 * ChatKit workflows created in OpenAI's Agent Builder don't expose a direct
 * REST API for sending messages. Instead, they require interaction through
 * the ChatKit web component, which this provider automates using Playwright.
 *
 * Prerequisites:
 *   - Playwright installed: npm install playwright && npx playwright install chromium
 *   - OPENAI_API_KEY environment variable set
 *
 * Usage:
 *   providers:
 *     - id: openai:chatkit:wf_68ffb83dbfc88190a38103c2bb9f421003f913035dbdb131
 *       config:
 *         version: '3'           # Optional: workflow version
 *         timeout: 120000        # Optional: response timeout in ms (default: 120000)
 *         headless: true         # Optional: run browser headless (default: true)
 *
 * Performance Notes:
 *   - Each evaluation spawns a browser instance, so it's slower than REST APIs
 *   - For reliable results, use --max-concurrency 1 to avoid resource contention
 *   - First test may be slower due to browser launch and ChatKit initialization
 *
 * Troubleshooting:
 *   - "Playwright not found": Run `npx playwright install chromium`
 *   - Timeout errors: Increase timeout config or use --max-concurrency 1
 *   - Empty responses: The workflow may not generate text for some inputs
 */
import { OpenAiGenericProvider } from './index';
import type { OpenAiChatKitOptions } from './chatkit-types';
import type { CallApiContextParams, CallApiOptionsParams, ProviderResponse } from '../../types/index';
import type { EnvOverrides } from '../../types/env';
/**
 * Clean up assistant response text by removing noise and artifacts.
 * This includes Cloudflare scripts, approval UI text, user echo, and JSON classification prefixes.
 */
declare function cleanAssistantResponse(text: string): string;
export declare class OpenAiChatKitProvider extends OpenAiGenericProvider {
    private chatKitConfig;
    private browser;
    private context;
    private page;
    private server;
    private serverPort;
    private initialized;
    private static defaultUserId;
    private static getDefaultUserId;
    constructor(workflowId: string, options?: {
        config?: OpenAiChatKitOptions;
        id?: string;
        env?: EnvOverrides;
    });
    id(): string;
    toString(): string;
    /**
     * Initialize the browser and ChatKit page
     */
    private initialize;
    /**
     * Shutdown method for providerRegistry cleanup
     */
    shutdown(): Promise<void>;
    /**
     * Clean up browser resources
     */
    cleanup(): Promise<void>;
    /**
     * Call the ChatKit workflow with the given prompt
     */
    callApi(prompt: string, _context?: CallApiContextParams, _callApiOptions?: CallApiOptionsParams): Promise<ProviderResponse>;
    /**
     * Pool-based callApi for better concurrency support.
     * Uses a shared browser with multiple contexts instead of separate browsers.
     */
    private callApiWithPool;
}
export { cleanAssistantResponse };
//# sourceMappingURL=chatkit.d.ts.map