UNPKG

rawi

Version:

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

45 lines (42 loc) 1.94 kB
import { ChatSession, ChatHistoryOptions, ChatMessage, HistoryStats } from '../shared/types.cjs'; declare class DatabaseAdapter { #private; constructor(); ensureDatabaseInitialized(): Promise<void>; createSession(profile: string, title?: string, type?: 'ask' | 'chat' | 'exec'): 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' | 'system', 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; }>; private ensureActTemplatesTable; createActTemplate(template: { id: string; label: string; category: string; description: string; template: string; }): Promise<void>; updateActTemplate(id: string, updates: Partial<{ label: string; category: string; description: string; template: string; }>): Promise<boolean>; deleteActTemplate(id: string): Promise<boolean>; getActTemplate(id: string): Promise<any | null>; listActTemplates(customOnly?: boolean): Promise<any[]>; templateExists(id: string): Promise<boolean>; close(): Promise<void>; } export { DatabaseAdapter };