/**
 * Claude Code Session Repository
 *
 * Infrastructure implementation of IAgentSessionRepository for Claude Code.
 * Reads JSONL session files from ~/.claude/projects/ using a lazy stat-then-parse
 * strategy for performance: stat all files in parallel for mtime-based sorting,
 * then fully parse only the top-N files needed for the list view.
 *
 * File structure:
 *   ~/.claude/projects/<encoded-project-path>/<uuid>.jsonl
 *
 * Subagent sessions stored in subdirectories are excluded by only reading
 * depth-1 .jsonl files from each project directory.
 */
import type { AgentSession } from '../../../../domain/generated/output.js';
import type { IAgentSessionRepository, ListSessionsOptions, GetSessionOptions } from '../../../../application/ports/output/agents/agent-session-repository.interface.js';
/** Extra metadata extracted from session JSONL that isn't in the domain type */
export interface SessionMetadata {
    cliVersion?: string;
    gitBranch?: string;
    permissionMode?: string;
    userType?: string;
    toolUsage: Record<string, number>;
    userMessageCount: number;
    assistantMessageCount: number;
}
export declare class ClaudeCodeSessionRepository implements IAgentSessionRepository {
    private readonly basePath;
    constructor(basePath?: string);
    isSupported(): boolean;
    list(options?: ListSessionsOptions): Promise<AgentSession[]>;
    findById(id: string, options?: GetSessionOptions): Promise<AgentSession | null>;
    /**
     * Collect session files only from the directory matching the given project path.
     * Claude Code encodes project paths as directory names by replacing '/', '\', and '.'
     * with '-'. e.g. /home/user/.shep/repos/abc/wt/feat-x → -home-user--shep-repos-abc-wt-feat-x
     * This avoids scanning all 100+ project directories.
     */
    private collectSessionFilesForPath;
    /** Collect all depth-1 .jsonl session files with mtime from all project directories */
    private collectSessionFiles;
    /** Collect depth-1 .jsonl files from a single project directory with stat for mtime */
    private collectDepthOneJsonlFiles;
    /**
     * Find a session file by exact or prefix ID match, scanning all project directories.
     * Supports prefix matching so users can pass truncated IDs (e.g. first 8 chars).
     * Returns the match info or null if not found / ambiguous.
     */
    private findSessionFile;
    /**
     * Parse a JSONL session file into an AgentSession.
     *
     * Throws on any JSON parse failure so the caller can skip the file.
     */
    private parseSessionFile;
    /**
     * Extract plain text from message content.
     * - string content: returned as-is
     * - array content: concatenates all text blocks; falls back to tool_use summary
     */
    private extractTextContent;
    /** Replace home directory prefix with ~ in a file path */
    private abbreviatePath;
}
//# sourceMappingURL=claude-code-session.repository.d.ts.map