import type { StructuredError } from "../errors/structured-errors.js"; export type MigrationOp = { op: "add_field"; path: string; default: unknown; } | { op: "remove_field"; path: string; } | { op: "rename_field"; path: string; newName: string; } | { op: "set_field"; path: string; value: unknown; }; export interface Migration { from: string; to: string; ops: MigrationOp[]; } export interface MigrationSuccess { ok: true; ast: unknown; fromVersion: string; toVersion: string; migrationsApplied: number; } export interface MigrationFailure { ok: false; errors: StructuredError[]; } export type MigrationResult = MigrationSuccess | MigrationFailure; export declare const CURRENT_SCHEMA_VERSION = "1.1"; export declare const MINIMUM_SCHEMA_VERSION = "1.0"; export declare const MIGRATION_REGISTRY: Migration[]; /** * Apply a single migration's ops to an AST. * Returns the transformed AST (deep-cloned, original not mutated). */ export declare function applyMigration(ast: unknown, migration: Migration): MigrationResult; /** * Detect the schema version of an AST and apply all necessary migrations * to bring it to CURRENT_SCHEMA_VERSION. * * If the AST has no `schemaVersion` field, assumes "1.0". * Returns the migrated AST with version metadata. */ export declare function migrateToLatest(ast: unknown): MigrationResult; //# sourceMappingURL=migrate.d.ts.map