/** * Sanitizes session ID to prevent shell injection attacks * Only allows alphanumeric characters, underscores, and hyphens */ export declare function sanitizeSessionId({ sessionId }: { sessionId: string; }): string; /** * Safely finds a session JSONL file using filesystem APIs instead of shell commands * Sanitizes input to prevent injection attacks */ export declare function findSessionJsonl({ sessionId }: { sessionId: string; }): Promise; export interface JsonlMessage { id: string; timestamp: number; usage?: { input_tokens?: number; output_tokens?: number; cache_creation_input_tokens?: number; cache_read_input_tokens?: number; cache_creation?: { ephemeral_5m_input_tokens?: number; ephemeral_1h_input_tokens?: number; }; }; content?: any; isSidechain?: boolean; } export interface TranscriptMessage { type?: string; usage?: JsonlMessage['usage']; message?: { usage?: JsonlMessage['usage']; id?: string; }; id?: string; uuid?: string; timestamp?: string; isSidechain?: boolean; } export declare class JsonlReader { /** * Reads all messages from JSONL file synchronously (for smaller files) */ static parseJsonl(filePath: string): JsonlMessage[]; /** * Streams through JSONL file and processes each message (for larger files) */ static streamMessages(filePath: string, processor: (msg: TranscriptMessage, lineNumber: number) => T | null): Promise; /** * Reads the last message from JSONL file that matches criteria */ static readLastMessage(filePath: string, filter?: (msg: TranscriptMessage) => boolean): Promise; /** * Helper to parse a single JSONL line consistently */ private static parseJsonlLine; } export declare function parseJsonl(filePath: string): JsonlMessage[]; export declare function findJsonlPath(sessionId: string): string | null; /** * Securely scan Claude projects directory for JSONL files * Returns file information with sanitized paths */ export interface JsonlFileInfo { sessionId: string; projectDir: string; filePath: string; lastModified: Date; } export declare function scanClaudeProjects(): JsonlFileInfo[]; //# sourceMappingURL=jsonl-utils.d.ts.map