@webdevtoday/grok-cli
Version:
A sophisticated CLI tool for interacting with xAI Grok 4, featuring conversation history, file reference, custom commands, memory system, and genetic development workflows
85 lines • 2.25 kB
TypeScript
/**
* Session management for Grok CLI
*/
import type { Session, ChatMessage, GrokConfig } from '../types';
import { HistoryManager } from './history';
/**
* Session manager handles conversation sessions and transcripts
*/
export declare class SessionManager {
private currentSession;
private config;
private historyManager;
constructor(config: GrokConfig);
/**
* Create a new session
*/
createSession(cwd?: string): Promise<Session>;
/**
* Load an existing session
*/
loadSession(sessionId: string): Promise<Session | null>;
/**
* Get current session
*/
getCurrentSession(): Session | null;
/**
* Add message to current session
*/
addMessage(message: ChatMessage): Promise<void>;
/**
* Save current session
*/
saveSession(): Promise<void>;
/**
* Get transcript file path for session
*/
private getTranscriptPath;
/**
* Append record to transcript file
*/
private appendToTranscript;
/**
* Update session configuration
*/
updateConfig(config: GrokConfig): void;
/**
* List recent sessions
*/
getRecentSessions(limit?: number): Promise<Session[]>;
/**
* Continue from the last conversation
*/
continueLastConversation(): Promise<Session | null>;
/**
* Continue from a specific session
*/
continueFromSession(sessionId: string): Promise<Session | null>;
/**
* Save current session to history
*/
saveToHistory(): Promise<void>;
/**
* Search conversation history
*/
searchHistory(query: string, limit?: number): Promise<import("./history").ConversationHistory[]>;
/**
* Get history statistics
*/
getHistoryStatistics(): Promise<{
totalConversations: number;
totalMessages: number;
oldestConversation: Date | null;
newestConversation: Date | null;
avgMessagesPerConversation: number;
}>;
/**
* Delete a conversation from history
*/
deleteFromHistory(sessionId: string): Promise<boolean>;
/**
* Get history manager instance
*/
getHistoryManager(): HistoryManager;
}
//# sourceMappingURL=session.d.ts.map