/** * File Organizer MCP Server v3.4.2 * Duplicate Finder Service * * Advanced duplicate detection, scoring, and safe deletion. */ import type { FileWithSize } from "../types.js"; export type RecommendationStrategy = "newest" | "oldest" | "best_location" | "best_name"; export interface ScoredFile { path: string; score: number; reasons: string[]; } export interface AnalyzedDuplicateGroup { hash: string; size_bytes: number; file_count: number; files: ScoredFile[]; recommended_keep: string; recommended_delete: string[]; wasted_space_bytes: number; } export interface DeletionResult { deleted: string[]; failed: { path: string; error: string; }[]; manifestPath?: string; } export declare class DuplicateFinderService { private hashCalculator; private rollbackService; private fileScanner; constructor(); /** * Find duplicates and score them for recommendation */ findWithScoring(files: FileWithSize[], strategy?: RecommendationStrategy, options?: { timeoutMs?: number; }): Promise; /** * Score a file based on strategy * Higher score = Better to KEEP */ private scoreFile; /** * Safely delete files with verification and manifest * * @param filesToDelete - Array of file paths to delete * @param options - Deletion options * @param options.createBackupManifest - Create backup and rollback manifest (default: true) * @param options.autoVerify - Automatically verify duplicates exist before deletion (default: false, WARNING: disabling verification may cause data loss) */ deleteFiles(filesToDelete: string[], options?: { createBackupManifest?: boolean; autoVerify?: boolean; }): Promise; /** * Verify that duplicates exist for files being deleted * Scans parent directories to ensure at least one copy remains * * @param filesToDelete - Files that will be deleted * @returns Object with valid files (have duplicates) and invalid files (no duplicates) */ private verifyDuplicatesExist; } //# sourceMappingURL=duplicate-finder.service.d.ts.map