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
1 lines • 6.47 kB
Source Map (JSON)
{"version":3,"sources":["/home/mkabumattar/work/withrawi/rawi/dist/chunk-RFF4VG5F.cjs","../src/cli/commands/chat/types.ts"],"names":["SessionNotFoundError","sessionId","profile","ProfileMismatchError","expectedProfile","actualProfile","DatabaseConnectionError","message","cause"],"mappings":"AAAA;ACkLO,IAAMA,CAAAA,WAAN,MAAA,QAAmC,KAA8B,gBACtE,IAAA,CAAO,oBAAA,WAIP,CAAYC,CAAAA,CAAmBC,CAAAA,CAAiB,CAC9C,KAAA,CAAM,CAAA,SAAA,EAAYD,CAAS,CAAA,yBAAA,EAA4BC,CAAO,CAAA,CAAA,CAAG,qCAAA,CACjE,IAAA,CAAK,SAAA,CAAYD,CAAAA,CACjB,IAAA,CAAK,OAAA,CAAUC,CAAAA,CACf,IAAA,CAAK,IAAA,CAAO,sBACd,CACF,UAAA,CAEaC,CAAAA,wBAAN,MAAA,QAAmC,KAA8B,iBACtE,IAAA,CAAO,mBAAA,WAKP,CACEF,CAAAA,CACAG,CAAAA,CACAC,CAAAA,CACA,CACA,KAAA,CACE,CAAA,SAAA,EAAYJ,CAAS,CAAA,sBAAA,EAAyBI,CAAa,CAAA,QAAA,EAAWD,CAAe,CAAA,CAAA,CACvF,uCAAA,CACA,IAAA,CAAK,SAAA,CAAYH,CAAAA,CACjB,IAAA,CAAK,OAAA,CAAUI,CAAAA,CACf,IAAA,CAAK,eAAA,CAAkBD,CAAAA,CACvB,IAAA,CAAK,IAAA,CAAO,sBACd,CACF,WAAA,CAEaE,CAAAA,wBAAN,MAAA,QAAsC,KAA8B,iBACzE,IAAA,CAAO,4BAAA,WAGP,CAAYC,CAAAA,CAAiBC,CAAAA,CAAe,CAC1C,KAAA,CAAM,CAAA,2BAAA,EAA8BD,CAAO,CAAA,CAAA;ADvN8gB","file":"/home/mkabumattar/work/withrawi/rawi/dist/chunk-RFF4VG5F.cjs","sourcesContent":[null,"export interface CommandOption {\n flags: string;\n description: string;\n defaultValue?: string | boolean | string[];\n}\n\nexport interface ChatOptions {\n profile?: string;\n act?: string;\n verbose?: boolean;\n\n session?: string;\n newSession?: boolean;\n listSessions?: boolean;\n deleteSession?: string;\n exportSessions?: boolean | string;\n renameSession?: string;\n newTitle?: string;\n\n limit?: number;\n fromDate?: string;\n toDate?: string;\n format?: 'json' | 'table' | 'summary';\n\n stats?: boolean;\n backup?: string;\n restore?: string;\n batchDelete?: string;\n archive?: boolean;\n}\n\nexport interface SessionManager {\n handleSessionStart(options: ChatOptions): Promise<string>;\n createNewSession(profile: string, title?: string): Promise<string>;\n continueSession(\n sessionId: string,\n profile: string,\n ): Promise<EnhancedChatSession>;\n\n getRecentSessions(profile: string, limit?: number): Promise<ChatSession[]>;\n displaySessionSelection(sessions: ChatSession[]): Promise<string | null>;\n\n listSessions(options: ListSessionsOptions): Promise<void>;\n deleteSession(\n sessionId: string,\n options: DeleteSessionOptions,\n ): Promise<boolean>;\n renameSession(sessionId: string, newTitle: string): Promise<boolean>;\n exportSessions(options: ExportSessionsOptions): Promise<string>;\n}\n\nexport interface EnhancedChatSession {\n sessionId: string;\n profile: string;\n title?: string;\n messages: ChatMessage[];\n\n displaySessionInfo(): void;\n displayConversationHistory(limit?: number): void;\n\n addUserMessage(content: string): Promise<void>;\n addAssistantMessage(\n content: string,\n metadata: MessageMetadata,\n ): Promise<void>;\n\n updateSessionTitle(title: string): Promise<void>;\n getSessionStats(): SessionStats;\n}\n\nexport interface ChatSession {\n id: string;\n profile: string;\n type?: 'ask' | 'chat' | 'exec';\n title?: string;\n description?: string;\n status?:\n | 'active'\n | 'archived'\n | 'paused'\n | 'pending'\n | 'completed'\n | 'failed';\n createdAt: string;\n updatedAt: string;\n lastAccessedAt?: string;\n messageCount: number;\n query?: string;\n filesProcessed?: any;\n contentFiltered?: boolean;\n conversationContext?: any;\n maxMessages?: number;\n isPrivate?: boolean;\n tags?: any;\n}\n\nexport interface ChatMessage {\n id: string;\n sessionId: string;\n role: 'user' | 'assistant' | 'system';\n content: string;\n timestamp: string;\n provider: string;\n model: string;\n temperature?: number;\n maxTokens?: number;\n metadata?: any;\n messageOrder?: number;\n processingTime?: number;\n tokenUsage?: any;\n parentMessageId?: string;\n isEdited?: boolean;\n editHistory?: any;\n reactions?: any;\n}\n\nexport interface MessageMetadata {\n provider: string;\n model: string;\n temperature?: number;\n maxTokens?: number;\n [key: string]: any;\n}\n\nexport interface SessionSelectionResult {\n action: 'new' | 'continue' | 'exit';\n sessionId?: string;\n}\n\nexport interface SessionDisplayInfo {\n id: string;\n title: string;\n profile: string;\n createdAt: string;\n updatedAt: string;\n messageCount: number;\n lastActivity: string;\n age: string;\n}\n\nexport interface SessionStats {\n messageCount: number;\n createdAt: string;\n updatedAt: string;\n duration: string;\n providers: string[];\n models: string[];\n}\n\nexport interface ListSessionsOptions {\n profile?: string;\n limit?: number;\n fromDate?: string;\n toDate?: string;\n format?: 'table' | 'json' | 'summary';\n type?: 'ask' | 'chat';\n}\n\nexport interface DeleteSessionOptions {\n force?: boolean;\n confirm?: boolean;\n}\n\nexport interface ExportSessionsOptions {\n format: 'json' | 'markdown';\n output?: string;\n sessions?: string[];\n profile?: string;\n fromDate?: string;\n toDate?: string;\n}\n\nexport interface SessionError extends Error {\n code: string;\n sessionId?: string;\n profile?: string;\n}\n\nexport class SessionNotFoundError extends Error implements SessionError {\n code = 'SESSION_NOT_FOUND';\n sessionId: string;\n profile: string;\n\n constructor(sessionId: string, profile: string) {\n super(`Session '${sessionId}' not found for profile '${profile}'`);\n this.sessionId = sessionId;\n this.profile = profile;\n this.name = 'SessionNotFoundError';\n }\n}\n\nexport class ProfileMismatchError extends Error implements SessionError {\n code = 'PROFILE_MISMATCH';\n sessionId: string;\n profile: string;\n expectedProfile: string;\n\n constructor(\n sessionId: string,\n expectedProfile: string,\n actualProfile: string,\n ) {\n super(\n `Session '${sessionId}' belongs to profile '${actualProfile}', not '${expectedProfile}'`,\n );\n this.sessionId = sessionId;\n this.profile = actualProfile;\n this.expectedProfile = expectedProfile;\n this.name = 'ProfileMismatchError';\n }\n}\n\nexport class DatabaseConnectionError extends Error implements SessionError {\n code = 'DATABASE_CONNECTION_ERROR';\n cause?: Error;\n\n constructor(message: string, cause?: Error) {\n super(`Database connection error: ${message}`);\n this.name = 'DatabaseConnectionError';\n this.cause = cause;\n }\n}\n"]}