import { RuntimeAgentService } from './runtime-agent.service.abstract.js';
import { SessionCommandHelper } from '../session/index.js';
import { type RuntimeType } from '../../constants.js';
/**
 * Gemini CLI specific runtime service implementation.
 * Handles Gemini CLI initialization, detection, and interaction patterns.
 */
export declare class GeminiRuntimeService extends RuntimeAgentService {
    constructor(sessionHelper: SessionCommandHelper, projectRoot: string);
    /**
     * Gemini CLI can show an interactive trust gate on first launch:
     * "Do you trust this folder?".
     * Auto-accept the default "Trust folder" option so startup does not stall.
     */
    waitForRuntimeReady(sessionName: string, timeout: number, checkInterval?: number): Promise<boolean>;
    protected getRuntimeType(): RuntimeType;
    /**
     * Gemini CLI specific detection using '/' command
     */
    protected detectRuntimeSpecific(sessionName: string): Promise<boolean>;
    /**
     * Gemini CLI specific ready patterns
     */
    protected getRuntimeReadyPatterns(): string[];
    private isGeminiTrustPrompt;
    /**
     * Gemini CLI specific exit patterns for runtime exit detection.
     *
     * Includes both clean exit patterns (e.g. "Agent powering down") and
     * failure patterns that indicate the CLI is stuck or crashed and needs
     * recovery (e.g. API quota exhaustion, network errors).
     *
     * @returns Array of RegExp patterns that match runtime exit or failure output
     */
    protected getRuntimeExitPatterns(): RegExp[];
    /**
     * Gemini CLI specific error patterns
     */
    protected getRuntimeErrorPatterns(): string[];
    /**
     * Post-initialization hook for Gemini CLI.
     * Adds ~/.crewly to the directory allowlist and ensures MCP server
     * configuration (e.g., playwright) is present in the project directory.
     *
     * @param sessionName - PTY session name
     * @param targetProjectPath - Optional target project path for MCP config.
     *                            Falls back to this.projectRoot if not provided.
     */
    postInitialize(sessionName: string, targetProjectPath?: string, additionalAllowlistPaths?: string[]): Promise<void>;
    /**
     * Ensure Gemini CLI MCP server configuration exists in the project directory.
     *
     * Creates or merges `.gemini/settings.json` with required MCP servers.
     * Delegates to the shared `ensureMcpConfig` in the base class.
     *
     * @param projectPath - Project directory where `.gemini/settings.json` will be created
     */
    ensureGeminiMcpConfig(projectPath: string): Promise<void>;
    /**
     * Ensure the project root `.env` file contains GEMINI_API_KEY.
     * Gemini CLI reads this key from `.env` in the working directory.
     * If the key exists in the process environment but not in `.env`, append it.
     * Also ensures `.gitignore` includes `.env` to prevent accidental commits.
     *
     * @param projectPath - Project directory where `.env` will be created/updated
     */
    private ensureGeminiEnvFile;
    /**
     * Ensure Gemini trusted folders contain the required paths.
     * Gemini blocks `/directory add` for paths that are not pre-trusted.
     * Delegates to the shared addGeminiTrustedFolders utility.
     */
    private ensureGeminiTrustedFolders;
    /**
     * Check if Gemini CLI is installed and configured
     */
    checkGeminiInstallation(): Promise<{
        isInstalled: boolean;
        version?: string;
        message: string;
    }>;
    /**
     * Initialize Gemini in an existing session
     */
    initializeGeminiInSession(sessionName: string): Promise<{
        success: boolean;
        message: string;
    }>;
    /**
     * Add a single project path to Gemini CLI allowlist
     * Uses '/directory add' command after Gemini CLI is running
     */
    addProjectToAllowlist(sessionName: string, projectPath: string): Promise<{
        success: boolean;
        message: string;
    }>;
    /**
     * Heuristic to detect text that is still sitting in Gemini's input box.
     * This indicates the message was typed but Enter was not processed.
     */
    private isTextLikelyStuckAtPrompt;
    /**
     * Detect whether Gemini CLI output indicates a path is already allowlisted.
     */
    private isPathAlreadyAllowlisted;
    /**
     * Add multiple project paths to Gemini CLI allowlist
     * Attempts a single batched slash command first, then falls back to
     * per-path commands for resiliency.
     */
    addMultipleProjectsToAllowlist(sessionName: string, projectPaths: string[]): Promise<{
        success: boolean;
        message: string;
        results: Array<{
            path: string;
            success: boolean;
            error?: string;
        }>;
    }>;
    /**
     * Send a single batched `/directory add` command with comma-separated paths.
     */
    private addProjectsToAllowlistBatch;
    /**
     * Wait until Gemini's slash-command queue is idle and the prompt is ready
     * for normal text input.
     */
    private waitForSlashQueueToDrain;
}
//# sourceMappingURL=gemini-runtime.service.d.ts.map