import type { ApiProvider, CallApiContextParams, CallApiOptionsParams, ProviderResponse } from '../../types/index';
import type { EnvOverrides } from '../../types/env';
/**
 * OpenAI Codex SDK Provider
 *
 * This provider requires the @openai/codex-sdk package, which may have a
 * proprietary license and is not installed by default. Users must install it separately:
 *   npm install @openai/codex-sdk
 *
 * Key features:
 * - Thread-based conversations with persistence in ~/.codex/sessions
 * - Native JSON schema output with Zod support
 * - Git repository requirement for safety (can be disabled)
 * - Custom binary path override support
 * - Streaming events for real-time progress
 *
 * Thread Management:
 * - No persist_threads: Creates ephemeral thread per call (default)
 * - With persist_threads: Pools threads by cache key for reuse
 * - With thread_id: Resumes specific thread from ~/.codex/sessions
 */
export interface OpenAICodexSDKConfig {
    apiKey?: string;
    /**
     * Working directory for Codex to operate in
     * Defaults to process.cwd()
     */
    working_dir?: string;
    /**
     * Additional directories the agent can access beyond the working directory.
     * Maps to --add-dir flag in Codex CLI.
     */
    additional_directories?: string[];
    /**
     * Skip Git repository check (Codex requires Git by default)
     */
    skip_git_repo_check?: boolean;
    /**
     * Path to custom codex binary
     */
    codex_path_override?: string;
    /**
     * Model to use (e.g., 'gpt-5.1-codex', 'gpt-4o', 'o3-mini')
     */
    model?: string;
    /**
     * Fallback model if primary model fails
     */
    fallback_model?: string;
    /**
     * Maximum tokens for response
     */
    max_tokens?: number;
    /**
     * Maximum tokens for tool output (default: 10000)
     * Controls how much output from tool calls is included in the context.
     */
    tool_output_token_limit?: number;
    /**
     * Thread management
     */
    thread_id?: string;
    persist_threads?: boolean;
    thread_pool_size?: number;
    /**
     * Output schema for structured JSON responses
     * Supports plain JSON schema or Zod schemas converted with zod-to-json-schema
     */
    output_schema?: Record<string, any>;
    /**
     * Environment variables to pass to Codex CLI
     * By default inherits Node.js process.env
     */
    cli_env?: Record<string, string>;
    /**
     * Custom system instructions
     */
    system_prompt?: string;
    /**
     * Enable streaming events (default: false for simplicity)
     */
    enable_streaming?: boolean;
}
export declare class OpenAICodexSDKProvider implements ApiProvider {
    static OPENAI_MODELS: string[];
    config: OpenAICodexSDKConfig;
    env?: EnvOverrides;
    apiKey?: string;
    private providerId;
    private codexModule?;
    private codexInstance?;
    private threads;
    constructor(options?: {
        id?: string;
        config?: OpenAICodexSDKConfig;
        env?: EnvOverrides;
    });
    id(): string;
    getApiKey(): string | undefined;
    toString(): string;
    cleanup(): Promise<void>;
    private prepareEnvironment;
    private validateWorkingDirectory;
    private getOrCreateThread;
    private runStreaming;
    private generateCacheKey;
    callApi(prompt: string, context?: CallApiContextParams, callOptions?: CallApiOptionsParams): Promise<ProviderResponse>;
}
//# sourceMappingURL=codex-sdk.d.ts.map