/** * Project Mind MCP - Database Access Layer * * Handles all SQLite operations with proper error handling. * Foundation for persistent state across sessions. */ import type { Project, ProjectConfig, SessionState, CurrentTask, SessionContext, Job, JobStatus, Epic, GitCommit, Research } from '../types/index.js'; export declare class ProjectDatabase { private db; constructor(dbPath: string); private initialize; private runMigrations; createProject(id: string, name: string, path: string, config?: Partial): Project; getProject(id: string): Project | null; getProjectByPath(path: string): Project | null; listProjects(): Project[]; updateProject(id: string, updates: Partial>): boolean; deleteProject(id: string): boolean; private mapProjectRow; saveSessionState(projectId: string, currentTask: CurrentTask, context: SessionContext): SessionState; getLatestSession(projectId: string): SessionState | null; getSession(sessionId: string): SessionState | null; deleteSession(sessionId: string): boolean; private mapSessionRow; createJob(projectId: string, operation: string, parameters?: Record): Job; updateJobProgress(jobId: number, progress: number, currentStep?: string): boolean; completeJob(jobId: number, result: unknown): boolean; failJob(jobId: number, error: string): boolean; getJob(jobId: number): Job | null; listJobs(projectId?: string, status?: JobStatus): Job[]; private mapJobRow; indexFile(projectId: string, path: string, fileType: string | null, size: number, contentHash: string, contentPreview: string, embedding: Buffer | null, metadata?: Record): number; getFileIndex(projectId: string, path: string): FileIndexRow | null; getAllFileIndices(projectId: string): FileIndexRow[]; getFilesWithEmbeddings(projectId: string): Array<{ id: number; path: string; embedding: Buffer; contentPreview: string; }>; deleteFileIndex(projectId: string, path: string): boolean; clearFileIndex(projectId: string): number; createPattern(projectId: string, name: string, problem: string, solution: string, implementation: string | null, metrics: Record | null, problemEmbedding: Buffer | null): number; getPattern(patternId: number): PatternRow | null; getAllPatterns(): PatternRow[]; getPatternsWithEmbeddings(): Array<{ id: number; name: string; projectId: string; problem: string; solution: string; embedding: Buffer; }>; getPatternsByProject(projectId: string): PatternRow[]; createPatternRelationship(fromPatternId: number, toPatternId: number, relationshipType: string, confidence?: number): boolean; getRelatedPatterns(patternId: number): Array<{ patternId: number; relationshipType: string; confidence: number; }>; logActivity(action: string, details?: Record, projectId?: string, sessionId?: string): void; createEpic(projectId: string, title: string, options?: { description?: string; priority?: string; estimatedHours?: number; tags?: string[]; dependencies?: number[]; acceptanceCriteria?: string[]; specLocation?: string; }): Epic; getEpic(id: number): Epic | null; listEpics(projectId: string, options?: { status?: string; priority?: string; limit?: number; }): Epic[]; updateEpic(id: number, updates: Partial<{ title: string; description: string; status: string; priority: string; estimatedHours: number; actualHours: number; tags: string[]; dependencies: number[]; acceptanceCriteria: string[]; specLocation: string; }>): Epic | null; getProjectStatus(projectId: string): { total: number; byStatus: Record; byPriority: Record; estimatedHours: number; actualHours: number; }; private mapEpicRow; recordCommit(projectId: string, commitHash: string, message: string, options?: { sessionId?: string; filesChanged?: string[]; stats?: { additions: number; deletions: number; files: number; }; }): GitCommit; getRecentCommits(projectId: string, limit?: number): GitCommit[]; saveResearch(projectId: string, query: string, sections: unknown[], options?: { sources?: unknown[]; keyFindings?: string[]; crossReferences?: unknown[]; }): Research; searchResearch(projectId: string, searchQuery?: string, limit?: number): Research[]; getResearch(id: string): Research | null; close(): void; } interface FileIndexRow { id: number; project_id: string; path: string; file_type: string | null; size: number; content_hash: string; content_preview: string | null; embedding: Buffer | null; metadata: string | null; indexed_at: string; } interface PatternRow { id: number; project_id: string; name: string; problem: string; solution: string; implementation: string | null; metrics: string | null; problem_embedding: Buffer | null; created_at: string; } export {}; //# sourceMappingURL=database.d.ts.map