/**
 * Gemini CLI Executor Service
 *
 * Infrastructure implementation of IAgentExecutor for the Gemini CLI agent.
 * Executes prompts via the `gemini` CLI subprocess with JSON output format.
 *
 * Uses constructor dependency injection for the spawn function
 * to enable testability without mocking node:child_process directly.
 */
import type { AgentType, AgentFeature, AgentConfig } from '../../../../../domain/generated/output.js';
import type { IAgentExecutor, AgentExecutionOptions, AgentExecutionResult, AgentExecutionStreamEvent } from '../../../../../application/ports/output/agents/agent-executor.interface.js';
import type { SpawnFunction } from '../types.js';
/**
 * Executor service for Gemini CLI agent.
 * Uses subprocess spawning to interact with the `gemini` CLI.
 */
export declare class GeminiCliExecutorService implements IAgentExecutor {
    private readonly spawn;
    private readonly authConfig?;
    readonly agentType: AgentType;
    /** When true, suppresses debug logging (set per-call via options.silent) */
    private silent;
    constructor(spawn: SpawnFunction, authConfig?: AgentConfig | undefined);
    /** Debug logging — writes to stdout so it appears in the worker log file */
    private log;
    supportsFeature(feature: AgentFeature): boolean;
    execute(prompt: string, options?: AgentExecutionOptions): Promise<AgentExecutionResult>;
    executeStream(prompt: string, options?: AgentExecutionOptions): AsyncIterable<AgentExecutionStreamEvent>;
    /**
     * Parse a single stream-JSON line into an AgentExecutionStreamEvent.
     * Returns null for events that should be skipped (init, user messages, unknown types).
     */
    private parseStreamEvent;
    /**
     * Patterns in stderr that indicate a fatal API error even when exit code is 0.
     * Gemini CLI sometimes exits 0 after exhausting retries on 429/5xx errors.
     */
    private static readonly FATAL_STDERR_PATTERNS;
    /**
     * Check stderr for patterns indicating fatal API errors.
     * Returns an error message if fatal patterns are found, null otherwise.
     */
    private detectFatalStderrError;
    /**
     * Extract token usage from Gemini stats structure.
     * Returns undefined if stats are missing (does not throw).
     */
    private extractUsage;
    private buildArgs;
    private buildSpawnOptions;
}
//# sourceMappingURL=gemini-cli-executor.service.d.ts.map