/**
 * One-off data migration: backfill canonical `data.sections` for LEGACY
 * page-builder documents (ADR 0002).
 *
 * Pages authored in the visual page builder before compile-on-save shipped have
 * a `data._layout` tree but no flat `data.sections`. The `/resolve` read-time
 * bridge keeps them rendering, but every OTHER reader (SDK list/get, MCP,
 * search index, content graph) only sees `sections`, so those docs look empty.
 *
 * This walks every non-deleted document, and for each one that has a `_layout`
 * but no non-empty `sections`, compiles the tree with {@link layoutTreeToSections}
 * and persists the result through {@link updateDocument} (so the write is
 * versioned + audited like any other edit). It is **idempotent**: a document
 * that already has `sections` is skipped, so re-running is safe.
 *
 * DB-paged so it scales past the in-memory document count.
 */
import type { ActionContext } from '../actions.js';
export interface MigratePageBuilderSectionsOptions {
    /** Report what would change without writing. Defaults to `false`. */
    dryRun?: boolean;
    /** Page size for the DB scan. Defaults to 100. */
    batchSize?: number;
}
export interface MigratePageBuilderSectionsResult {
    /** Documents inspected. */
    scanned: number;
    /** Documents that received freshly-compiled sections. */
    migrated: number;
    /** Documents skipped (no `_layout`, already had sections, or empty layout). */
    skipped: number;
    /** IDs of the migrated documents (useful for logs / verification). */
    migratedIds: string[];
}
/**
 * Backfill `data.sections` for legacy `_layout`-only documents.
 *
 * @param ctx  An admin {@link ActionContext} (role must be allowed to update the
 *   target collections — use a system/admin user).
 */
export declare function migratePageBuilderSections(ctx: ActionContext, options?: MigratePageBuilderSectionsOptions): Promise<MigratePageBuilderSectionsResult>;
//# sourceMappingURL=migrate.d.ts.map