/** * Session Management Types for BC Code Intelligence Specialists * * Provides interfaces for persistent, contextual conversations with specialist personas. * Supports in-memory sessions by default with configurable persistence through layer system. */ export interface SessionMessage { id: string; timestamp: Date; type: 'user' | 'specialist'; specialistId?: string; content: string; metadata?: { files?: string[]; codeSnippets?: string[]; topics?: string[]; }; } export interface SessionContext { problem?: string; codebaseContext?: { files: string[]; objects: string[]; project?: string; }; methodology_context?: { methodology_id: string; methodology_title: string; current_phase: string; phase_progress: Record; confirmed_by_user: boolean; suggested_at: Date; }; solutions: string[]; recommendations: string[]; nextSteps: string[]; userPreferences: { communicationStyle?: 'detailed' | 'concise' | 'conversational'; expertiseLevel?: 'beginner' | 'intermediate' | 'expert'; preferredTopics?: string[]; workingStyle?: string; }; } export interface SpecialistSession { sessionId: string; specialistId: string; userId: string; startTime: Date; lastActivity: Date; status: 'active' | 'paused' | 'completed' | 'transferred'; messages: SessionMessage[]; messageCount: number; context: SessionContext; methodology_context?: { methodology_id: string; methodology_title: string; current_phase: string; phase_progress: Record; confirmed_by_user: boolean; suggested_at: Date; }; transferredFrom?: string; transferredTo?: string; tags?: string[]; } export interface SessionSummary { sessionId: string; specialistId: string; startTime: Date; lastActivity: Date; status: SpecialistSession['status']; messageCount: number; primaryTopics: string[]; keyInsights: string[]; } export interface SessionStorageConfig { type: 'memory' | 'file' | 'database' | 'mcp'; config?: { directory?: string; filename?: string; connectionString?: string; tableName?: string; mcpServer?: string; mcpTools?: string[]; }; retention?: { maxAge?: number; maxSessions?: number; autoCleanup?: boolean; }; privacy?: { includeMessages?: boolean; includeCode?: boolean; includeFiles?: boolean; anonymizeContent?: boolean; }; } export interface SessionStorage { createSession(session: SpecialistSession): Promise; getSession(sessionId: string): Promise; updateSession(session: SpecialistSession): Promise; deleteSession(sessionId: string): Promise; getUserSessions(userId: string): Promise; getActiveSessions(userId: string): Promise; getSpecialistSessions(specialistId: string): Promise; cleanupExpiredSessions(): Promise; getUserSessionCount(userId: string): Promise; } export interface SessionManager { startSession(specialistId: string, userId: string, initialMessage?: string): Promise; getSession(sessionId: string): Promise; continueSession(sessionId: string, message: string): Promise; transferSession(sessionId: string, toSpecialistId: string): Promise; endSession(sessionId: string): Promise; listUserSessions(userId: string): Promise; listActiveSessions(userId: string): Promise; addMessage(sessionId: string, message: SessionMessage): Promise; updateContext(sessionId: string, context: Partial): Promise; cleanupSessions(): Promise; } export interface SessionEvents { sessionStarted: (session: SpecialistSession) => void; sessionEnded: (sessionId: string) => void; sessionTransferred: (sessionId: string, fromSpecialist: string, toSpecialist: string) => void; messageAdded: (sessionId: string, message: SessionMessage) => void; } //# sourceMappingURL=session-types.d.ts.map