/**
 * Codex CLI Session Repository
 *
 * Infrastructure implementation of IAgentSessionRepository for OpenAI Codex CLI.
 * Reads JSONL session rollout files from `$CODEX_HOME/sessions/` (or `~/.codex/sessions/`
 * when CODEX_HOME is not set) and the session index from `$CODEX_HOME/session_index.jsonl`.
 *
 * Directory structure:
 *   $CODEX_HOME/session_index.jsonl          — one JSON object per line with {id, thread_name, updated_at}
 *   $CODEX_HOME/sessions/YYYY/MM/DD/rollout-<timestamp>-<session-id>.jsonl
 *
 * Rollout file events:
 *   - session_meta: session metadata (id, cwd, cli_version, model_provider)
 *   - event_msg:    lifecycle events (task_started, etc.)
 *   - response_item: messages (role: user/assistant/developer), function_call, function_call_output
 *   - turn_context:  per-turn context (cwd, model, sandbox_policy)
 */
import type { AgentSession } from '../../../../domain/generated/output.js';
import type { IAgentSessionRepository, ListSessionsOptions, GetSessionOptions } from '../../../../application/ports/output/agents/agent-session-repository.interface.js';
export declare class CodexCliSessionRepository implements IAgentSessionRepository {
    private readonly basePath;
    constructor(basePath?: string);
    /**
     * Resolve the Codex home directory.
     * Uses CODEX_HOME env var if set, otherwise defaults to ~/.codex
     */
    static resolveCodexHome(): string;
    isSupported(): boolean;
    list(options?: ListSessionsOptions): Promise<AgentSession[]>;
    findById(id: string, options?: GetSessionOptions): Promise<AgentSession | null>;
    /** Read and parse the session_index.jsonl file */
    private readSessionIndex;
    /** Convert a session index entry to a lightweight AgentSession */
    private indexEntryToSession;
    /**
     * Recursively collect all rollout .jsonl files from the sessions/ directory.
     * Structure: sessions/YYYY/MM/DD/rollout-<timestamp>-<id>.jsonl
     */
    private collectSessionFiles;
    /** Recursively walk a directory tree collecting .jsonl rollout files */
    private walkDirectory;
    /**
     * Extract session ID from a rollout filename.
     * Format: rollout-YYYY-MM-DDTHH-MM-SS-<session-id>.jsonl
     * The session ID is the UUID portion after the timestamp.
     */
    private extractSessionIdFromFilename;
    /**
     * Find a session rollout file by ID.
     * Scans the sessions/ directory recursively for a file containing the given ID.
     */
    private findSessionFile;
    /**
     * Parse a Codex CLI rollout JSONL file into an AgentSession.
     */
    private parseRolloutFile;
    /** Extract text from Codex content blocks */
    private extractTextFromContent;
    /** Replace home directory prefix with ~ */
    private abbreviatePath;
}
//# sourceMappingURL=codex-cli-session.repository.d.ts.map