/**
 * Migration Manager
 *
 * Handles migration from legacy JSON config (v1) to unified YAML config (v2).
 * Features:
 * - Automatic backup before migration
 * - Rollback support
 * - Settings file reference preservation (*.settings.json)
 * - Cache file restructuring
 *
 * Design: Settings remain in *.settings.json files (matching Claude's pattern)
 * while config.yaml stores references to these files.
 */
import { loadUnifiedConfig } from './unified-config-loader';
export declare function resolveManagedBackupPath(backupPath: string): string | null;
/**
 * Migration result with details about what was migrated.
 */
export interface MigrationResult {
    success: boolean;
    backupPath?: string;
    error?: string;
    migratedFiles: string[];
    warnings: string[];
}
/**
 * Check if migration from v1 to v2 is needed.
 */
export declare function needsMigration(): boolean;
/**
 * Pre-loaded config data for TOCTOU-safe migration checks.
 * Read once, use for both check and migration.
 */
export interface MigrationCheckData {
    legacyConfig: Record<string, unknown> | null;
    unifiedConfig: ReturnType<typeof loadUnifiedConfig>;
    needsMigration: boolean;
}
/**
 * Load config files once for TOCTOU-safe migration operations.
 * Returns data that can be passed to migration functions.
 */
export declare function loadMigrationCheckData(): MigrationCheckData;
/**
 * Check if there are legacy profiles that haven't been migrated to config.yaml.
 * This catches the case where config.yaml exists but is empty/missing profiles
 * that are still in config.json.
 *
 * Used by autoMigrate() to trigger inline migration when needed.
 * (Fix for issue #195 - GLM auth persistence regression)
 *
 * Note: For TOCTOU-safe operations, use loadMigrationCheckData() instead.
 */
export declare function needsProfileMigration(): boolean;
/**
 * Get list of backup directories.
 */
export declare function getBackupDirectories(): string[];
/**
 * Perform migration from v1 to v2 format.
 */
export declare function migrate(dryRun?: boolean): Promise<MigrationResult>;
/**
 * Rollback migration by restoring from backup.
 */
export declare function rollback(backupPath: string): Promise<boolean>;
/**
 * Auto-migrate on first run after update.
 * Silent if already migrated or no config exists.
 * Shows friendly message with backup location on success.
 *
 * Also handles inline profile migration when config.yaml exists but is missing
 * profiles from config.json (Fix for issue #195).
 */
export declare function autoMigrate(): Promise<void>;
//# sourceMappingURL=migration-manager.d.ts.map