/** * Project Identity Service * Single Responsibility: Manage project identity with deterministic IDs * * Key Features: * - Deterministic ID generation based on normalized path * - Project move detection and handling * - Duplicate cleanup * - Registry management * - Storage-mode aware (embedded SQLite or server PostgreSQL) */ export interface ProjectIdentity { id: string; projectName: string; currentPath: string; originalPath: string; aliases: string[]; status: 'active' | 'moved' | 'missing' | 'duplicate'; createdAt: string; lastSeen: string; dataStats?: { embeddings: number; entities: number; }; } export interface ProjectResolutionResult { identity: ProjectIdentity | null; action: 'use_existing' | 'create_new' | 'update_path' | 'merge_duplicate' | 'not_found'; message: string; duplicates?: ProjectIdentity[]; } export interface DuplicateCleanupResult { success: boolean; projectsCleaned: number; embeddingsMerged: number; entitiesMerged: number; errors: string[]; } export declare class ProjectIdentityService { private logger; private projectStore; private storageMode; constructor(); /** * Get or initialize the project store */ private getProjectStore; /** * Generate a deterministic project ID from normalized path * Same path always produces the same ID */ generateDeterministicId(projectPath: string): string; /** * Normalize path for consistent comparison * - Resolve to absolute path * - Convert to lowercase (for case-insensitive file systems) * - Use forward slashes */ normalizePath(projectPath: string): string; /** * Resolve project identity - main entry point * Checks for existing project, handles moves, detects duplicates */ resolveProject(projectPath: string, projectName?: string): Promise; /** * Convert Project interface to ProjectIdentity */ private projectToIdentity; /** * Update project path when a move is confirmed */ updateProjectPath(projectId: string, newPath: string, oldPath: string): Promise; /** * Clean up duplicate projects * Merges data from duplicates into the canonical (deterministic) entry */ cleanupDuplicates(projectPath: string): Promise; /** * List all projects with their data statistics */ listProjects(): Promise; /** * Find duplicates - projects with same path */ findAllDuplicates(): Promise>; } //# sourceMappingURL=project-identity-service.d.ts.map