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

162 lines (160 loc) 4.89 kB
interface CommandOption { flags: string; description: string; defaultValue?: string | boolean | string[]; } interface ChatOptions { profile?: string; act?: string; verbose?: boolean; session?: string; newSession?: boolean; listSessions?: boolean; deleteSession?: string; exportSessions?: boolean | string; renameSession?: string; newTitle?: string; limit?: number; fromDate?: string; toDate?: string; format?: 'json' | 'table' | 'summary'; stats?: boolean; backup?: string; restore?: string; batchDelete?: string; archive?: boolean; } interface SessionManager { handleSessionStart(options: ChatOptions): Promise<string>; createNewSession(profile: string, title?: string): Promise<string>; continueSession(sessionId: string, profile: string): Promise<EnhancedChatSession>; getRecentSessions(profile: string, limit?: number): Promise<ChatSession[]>; displaySessionSelection(sessions: ChatSession[]): Promise<string | null>; listSessions(options: ListSessionsOptions): Promise<void>; deleteSession(sessionId: string, options: DeleteSessionOptions): Promise<boolean>; renameSession(sessionId: string, newTitle: string): Promise<boolean>; exportSessions(options: ExportSessionsOptions): Promise<string>; } interface EnhancedChatSession { sessionId: string; profile: string; title?: string; messages: ChatMessage[]; displaySessionInfo(): void; displayConversationHistory(limit?: number): void; addUserMessage(content: string): Promise<void>; addAssistantMessage(content: string, metadata: MessageMetadata): Promise<void>; updateSessionTitle(title: string): Promise<void>; getSessionStats(): SessionStats; } interface ChatSession { id: string; profile: string; type?: 'ask' | 'chat' | 'exec'; title?: string; description?: string; status?: 'active' | 'archived' | 'paused' | 'pending' | 'completed' | 'failed'; createdAt: string; updatedAt: string; lastAccessedAt?: string; messageCount: number; query?: string; filesProcessed?: any; contentFiltered?: boolean; conversationContext?: any; maxMessages?: number; isPrivate?: boolean; tags?: any; } interface ChatMessage { id: string; sessionId: string; role: 'user' | 'assistant' | 'system'; content: string; timestamp: string; provider: string; model: string; temperature?: number; maxTokens?: number; metadata?: any; messageOrder?: number; processingTime?: number; tokenUsage?: any; parentMessageId?: string; isEdited?: boolean; editHistory?: any; reactions?: any; } interface MessageMetadata { provider: string; model: string; temperature?: number; maxTokens?: number; [key: string]: any; } interface SessionSelectionResult { action: 'new' | 'continue' | 'exit'; sessionId?: string; } interface SessionDisplayInfo { id: string; title: string; profile: string; createdAt: string; updatedAt: string; messageCount: number; lastActivity: string; age: string; } interface SessionStats { messageCount: number; createdAt: string; updatedAt: string; duration: string; providers: string[]; models: string[]; } interface ListSessionsOptions { profile?: string; limit?: number; fromDate?: string; toDate?: string; format?: 'table' | 'json' | 'summary'; type?: 'ask' | 'chat'; } interface DeleteSessionOptions { force?: boolean; confirm?: boolean; } interface ExportSessionsOptions { format: 'json' | 'markdown'; output?: string; sessions?: string[]; profile?: string; fromDate?: string; toDate?: string; } interface SessionError extends Error { code: string; sessionId?: string; profile?: string; } declare class SessionNotFoundError extends Error implements SessionError { code: string; sessionId: string; profile: string; constructor(sessionId: string, profile: string); } declare class ProfileMismatchError extends Error implements SessionError { code: string; sessionId: string; profile: string; expectedProfile: string; constructor(sessionId: string, expectedProfile: string, actualProfile: string); } declare class DatabaseConnectionError extends Error implements SessionError { code: string; cause?: Error; constructor(message: string, cause?: Error); } export { type ChatMessage, type ChatOptions, type ChatSession, type CommandOption, DatabaseConnectionError, type DeleteSessionOptions, type EnhancedChatSession, type ExportSessionsOptions, type ListSessionsOptions, type MessageMetadata, ProfileMismatchError, type SessionDisplayInfo, type SessionError, type SessionManager, SessionNotFoundError, type SessionSelectionResult, type SessionStats };