/** * Timestamp Tracker * * Tracks file timestamps for synchronization and drift detection. * Stores and retrieves file modification times from the database. */ import type { DatabaseClient } from '../db/client.js'; /** * File timestamp record */ export interface FileTimestamp { /** Relative file path from project root */ path: string; /** Last modified time from filesystem */ modifiedTime: string; /** File size in bytes */ size: number; /** SHA-256 hash of file contents */ hash: string; /** When timestamp was last checked */ lastChecked: string; /** Git commit SHA if available */ gitCommit?: string; } /** * Timestamp tracker options */ export interface TimestampTrackerOptions { /** Project root directory */ projectRoot?: string; /** Verbose logging */ verbose?: boolean; } /** * Sync status for a file */ export interface SyncStatus { /** File path */ path: string; /** Whether file is in sync */ inSync: boolean; /** Expected vs actual modified time */ timeDiff?: number; /** Expected vs actual hash */ hashDiff?: boolean; } /** * Timestamp Tracker * * Manages file timestamps for synchronization tracking. */ export declare class TimestampTracker { private db; private projectRoot; private verbose; constructor(db: DatabaseClient, options?: TimestampTrackerOptions); /** * Record file timestamp * * @param filePath - Relative or absolute file path * @param gitCommit - Optional git commit SHA */ recordTimestamp(filePath: string, gitCommit?: string): Promise; /** * Get stored timestamp for a file * * @param filePath - Relative or absolute file path * @returns Timestamp record or null */ getTimestamp(filePath: string): Promise; /** * Check if file is in sync * * Compares current file state with stored timestamp. * * @param filePath - Relative or absolute file path * @returns Sync status */ checkSync(filePath: string): Promise; /** * Check multiple files for sync status * * @param filePaths - Array of file paths * @returns Array of sync statuses */ checkMultipleSync(filePaths: string[]): Promise; /** * Update timestamp for a file * * @param filePath - Relative or absolute file path * @param gitCommit - Optional git commit SHA */ updateTimestamp(filePath: string, gitCommit?: string): Promise; /** * Batch update timestamps for multiple files * * @param filePaths - Array of file paths * @returns Array of updated timestamps */ batchUpdateTimestamps(filePaths: string[]): Promise; /** * Remove timestamp record * * @param filePath - File path to remove */ removeTimestamp(filePath: string): Promise; /** * Get all tracked timestamps * * @returns Array of all timestamp records */ getAllTimestamps(): Promise; /** * Get stale timestamp records * * @param daysOld - Consider records older than this many days as stale * @returns Array of stale timestamps */ getStaleTimestamps(daysOld?: number): Promise; /** * Clean up old timestamp records * * @param daysOld - Remove records older than this many days * @returns Number of records removed */ cleanupOldTimestamps(daysOld?: number): Promise; /** * Get sync summary for tracked files * * @returns Summary of sync status */ getSyncSummary(): Promise<{ total: number; inSync: number; outOfSync: number; stale: number; }>; /** * Convert to relative path if absolute */ private toRelativePath; /** * Convert to absolute path if relative */ private toAbsolutePath; /** * Format file size for display */ private formatSize; /** * Format timestamp for display */ private formatTimestamp; /** * Generate detailed status report */ generateStatusReport(): Promise; } //# sourceMappingURL=timestamp-tracker.d.ts.map