/** * Project Migration Utility * Handles migration of conversation history when project directories are renamed */ import { type SQLiteManager } from "../storage/SQLiteManager.js"; export interface OldFolder { folderPath: string; folderName: string; storedProjectPath: string | null; stats: { conversations: number; messages: number; lastActivity: number | null; }; score: number; } export interface ValidationResult { valid: boolean; errors: string[]; stats?: { conversations: number; messages: number; files: number; }; } export interface MigrationResult { success: boolean; filesCopied: number; databaseUpdated: boolean; message: string; } interface ScoreFactors { pathScore: number; folderScore: number; hasDatabase: boolean; jsonlCount: number; } export declare class ProjectMigration { private projectsDir; private sqliteManager; private db; constructor(sqliteManager?: SQLiteManager, projectsDir?: string); private buildFolderCandidates; private selectBestCandidate; private getProjectStats; private resolveProjectId; /** * Get the projects directory (for use by other classes) */ getProjectsDir(): string; /** * Discover old conversation folders using combined approach */ discoverOldFolders(currentProjectPath: string): Promise; /** * Validate migration is safe and possible */ validateMigration(sourceFolder: string, targetFolder: string, mode?: "migrate" | "merge"): ValidationResult; /** * Execute migration (copy files and update database) */ executeMigration(sourceFolder: string, targetFolder: string, oldProjectPath: string, newProjectPath: string, dryRun: boolean, mode?: "migrate" | "merge"): Promise; private copyAllJsonlFiles; private copyNewJsonlFiles; private backupDatabase; private updateProjectReferences; /** * Score path similarity */ scorePath(currentPath: string, oldPath: string): number; /** * Score folder name similarity */ scoreFolderName(expected: string, actual: string): number; /** * Calculate overall score from multiple factors */ calculateOverallScore(factors: ScoreFactors): number; } export {}; //# sourceMappingURL=ProjectMigration.d.ts.map