/** * Migration Tool — 移植自 OpenSpec migration.ts (20KB) * * 版本迁移工具: * - 从旧版本升级到新版本 * - 目录结构迁移 * - 配置文件迁移 * - 支持 --dry-run 预览 * - 自动备份 */ export interface MigrationStep { name: string; description: string; fromVersion: string; toVersion: string; execute(projectRoot: string, dryRun?: boolean): Promise; } export interface MigrationResult { success: boolean; steps: { name: string; status: 'executed' | 'skipped' | 'failed' | 'previewed'; message: string; }[]; currentVersion: string; targetVersion: string; backupPath?: string; } export interface DryRunResult { pendingSteps: { name: string; description: string; fromVersion: string; toVersion: string; }[]; currentVersion: string; targetVersion: string; } export declare class MigrationRunner { private projectRoot; constructor(projectRoot: string); /** * 获取当前版本 */ getCurrentVersion(): string; /** * 检查需要执行的迁移 * * @param targetVersion - 目标版本(与 run() 保持一致),默认为最高迁移的目标版本 */ getPendingMigrations(targetVersion?: string): MigrationStep[]; /** * 预览迁移(dry-run) * * 显示将要执行的迁移步骤,但不实际执行 */ dryRun(targetVersion?: string): DryRunResult; /** * 创建备份 * * 在执行迁移前备份关键配置文件 */ createBackup(): string | null; /** * 运行所有待执行的迁移 */ run(targetVersion?: string, options?: { dryRun?: boolean; backup?: boolean; }): Promise; /** * 运行指定迁移步骤 */ runStep(stepName: string): Promise; /** * 列出所有可用的迁移 */ listMigrations(): MigrationStep[]; } //# sourceMappingURL=index.d.ts.map