/** * Migrate Workflow * * Handles migration of plugins between servers with version compatibility */ import type { SourceRegistry } from '../core/sources/index.js'; import type { Plugin } from '../core/types/index.js'; /** * Migration check result for a plugin */ export interface MigrationCheck { pluginName: string; currentVersion: string; currentMcVersion?: string; targetMcVersion: string; compatible: boolean; latestCompatibleVersion?: string; requiresUpdate: boolean; downloadUrl?: string; status: 'compatible' | 'needs-update' | 'incompatible' | 'unknown'; message?: string; } /** * Migration progress event */ export interface MigrateProgress { current: number; total: number; pluginName: string; phase: 'checking' | 'downloading' | 'copying' | 'done' | 'error'; status: string; message?: string; } /** * Migration result */ export interface MigrateResult { sourceDir: string; targetDir: string; targetMcVersion: string; migrated: string[]; updated: string[]; /** * Downloaded updates that were validated + STAGED into the target's * update folder because the target server was running (Phase 4 * safe-apply, inherited from the download workflow) — these apply on the * next server restart. Reported separately from `updated` so no consumer * can claim them as already live (same contract as * BatchDownloadResult.staged / AutoUpdateSummary.staged). */ staged: string[]; skipped: string[]; incompatible: string[]; errors: Array<{ pluginName: string; error: string; }>; duration: number; backupPath?: string; /** Count of unrecognized JAR-like files found in target (e.g., .jar.old, .jar.bak) */ unrecognizedFileCount?: number; } /** * Migration options */ export interface MigrateOptions { sourceDir: string; targetDir: string; targetMcVersion: string; plugins?: Plugin[]; sourceRegistry?: SourceRegistry; downloadUpdates?: boolean; createBackup?: boolean; backupDir?: string; skipIncompatible?: boolean; forceCopy?: boolean; dryRun?: boolean; safeMode?: boolean; onProgress?: (progress: MigrateProgress) => void; /** * Optional AbortSignal — workflow stops at the next plugin boundary if fired. * Phase 3 audit, finding API [11] (April 30, 2026). */ signal?: AbortSignal; /** * Running-state probe override for the TARGET server, forwarded to the * internal downloader (tests pin staging deterministically — same seam as * AutoUpdateOptions.isTargetServerRunning). Default: detection on the * target plugins directory inside the downloader. */ isTargetServerRunning?: () => Promise; } /** * Migration workflow class */ export declare class MigrateWorkflow { private options; constructor(options: MigrateOptions); /** * Execute migration */ migrate(): Promise; /** * Internal migration implementation (wrapped by workflow lock) */ private migrateInternal; /** * Re-enable a safe-mode pre-disabled file (when plugin was skipped or errored) */ private reEnableSafeDisabled; /** * Check compatibility of a plugin with target Minecraft version */ private checkCompatibility; /** * Get migration preview */ preview(): Promise; } /** * Create a migration workflow */ export declare function createMigrateWorkflow(options: MigrateOptions): MigrateWorkflow; //# sourceMappingURL=migrate.d.ts.map