/** * Conversation history management for Grok CLI * Handles conversation persistence, loading, and continuation */ import type { Session, ChatMessage } from '../types'; export interface ConversationHistory { id: string; startTime: Date; lastUpdateTime: Date; cwd: string; messageCount: number; firstMessage: string; lastMessage: string; filePath: string; } export interface HistorySession { session: Session; messages: ChatMessage[]; metadata: { totalMessages: number; startTime: Date; lastUpdateTime: Date; cwd: string; }; } /** * History manager for conversation persistence */ export declare class HistoryManager { private historyDir; private historyIndex; private conversations; constructor(); /** * Initialize history directory and load conversation index */ initialize(): Promise; /** * Save a conversation session to history */ saveConversation(session: Session, messages: ChatMessage[]): Promise; /** * Load a conversation from history */ loadConversation(sessionId: string): Promise; /** * Get the most recent conversation */ getLastConversation(): Promise; /** * List recent conversations */ getRecentConversations(limit?: number): Promise; /** * Search conversations by content */ searchConversations(query: string, limit?: number): Promise; /** * Delete a conversation from history */ deleteConversation(sessionId: string): Promise; /** * Get conversation statistics */ getStatistics(): Promise<{ totalConversations: number; totalMessages: number; oldestConversation: Date | null; newestConversation: Date | null; avgMessagesPerConversation: number; }>; /** * Clean up old conversations */ cleanupOldConversations(maxAge?: number): Promise; /** * Export conversation history */ exportConversations(outputPath: string): Promise; /** * Load conversation index from disk */ private loadConversationIndex; /** * Save conversation index to disk */ private saveConversationIndex; /** * Get history directory path */ getHistoryDir(): string; } //# sourceMappingURL=history.d.ts.map