UNPKG

rawi

Version:

Rawi (راوي) is the developer-friendly AI CLI that brings the power of 12 major AI providers directly to your terminal. With seamless shell integration, persistent conversations, and 200+ specialized prompt templates, Rawi transforms your command line into

31 lines (28 loc) 1.4 kB
import { ChatSession, ChatHistoryOptions, ChatMessage, HistoryStats } from '../shared/types.js'; declare class DatabaseAdapter { private client; private dbPath; constructor(); private ensureConfigDir; private ensureDatabaseFileExists; ensureDatabaseInitialized(): Promise<void>; private initialize; createSession(profile: string, title?: string): Promise<string>; getSession(sessionId: string): Promise<ChatSession | null>; getSessions(options?: ChatHistoryOptions): Promise<ChatSession[]>; deleteSession(sessionId: string): Promise<boolean>; updateSessionTitle(sessionId: string, title: string): Promise<boolean>; addMessage(sessionId: string, role: 'user' | 'assistant', content: string, provider: string, model: string, temperature?: number, maxTokens?: number, metadata?: any): Promise<string>; getMessages(sessionId: string, limit?: number): Promise<ChatMessage[]>; searchMessages(options?: ChatHistoryOptions): Promise<ChatMessage[]>; getStats(profile?: string): Promise<HistoryStats>; deleteOldSessions(profile: string, days: number): Promise<number>; vacuum(): Promise<void>; exportChatHistory(options?: ChatHistoryOptions): Promise<{ sessions: ChatSession[]; messages: Record<string, ChatMessage[]>; stats: HistoryStats; }>; close(): Promise<void>; } export { DatabaseAdapter };