/**
 * JSONL file operations service
 * Handles reading and writing JSONL (JSON Lines) session files for improved performance
 */
import type { Message } from "../types/index.js";
import type { SessionMessage, SessionFilename } from "../types/session.js";
/**
 * JSONL write options
 */
export interface JsonlWriteOptions {
    atomic?: boolean;
}
/**
 * JSONL handler class for message persistence operations
 */
export declare class JsonlHandler {
    private readonly defaultWriteOptions;
    constructor();
    /**
     * Create a new session file (simplified - no metadata header)
     */
    createSession(filePath: string): Promise<void>;
    /**
     * Append a single message to JSONL file
     */
    appendMessage(filePath: string, message: Message): Promise<void>;
    /**
     * Append multiple messages to JSONL file
     */
    appendMessages(filePath: string, messages: Message[]): Promise<void>;
    /**
     * Append messages to JSONL file
     */
    append(filePath: string, messages: SessionMessage[], options?: JsonlWriteOptions): Promise<void>;
    /**
     * Read all messages from JSONL file (simplified - no metadata handling)
     */
    read(filePath: string): Promise<SessionMessage[]>;
    /**
     * Get the last message from JSONL file using efficient file reading (simplified)
     */
    getLastMessage(filePath: string): Promise<SessionMessage | null>;
    /**
     * Validate messages before writing
     */
    private validateMessages;
    /**
     * Ensure directory exists for the given file path
     */
    private ensureDirectory;
    /**
     * Parse session metadata from filename
     * @param filePath - Path to the session file
     * @returns Parsed session filename metadata
     */
    parseSessionFilename(filePath: string): SessionFilename;
    /**
     * Validate filename format
     * @param filename - Filename to validate
     * @returns True if valid, false otherwise
     */
    isValidSessionFilename(filename: string): boolean;
    /**
     * Generate simple filename for sessions
     * @param sessionId - UUID session identifier
     * @param sessionType - Type of session ("main" or "subagent")
     * @returns Generated filename
     */
    generateSessionFilename(sessionId: string, sessionType: "main" | "subagent"): string;
}
//# sourceMappingURL=jsonlHandler.d.ts.map