export type MigrationMode = 'resume' | 'rehydrate';
export interface MigrationEndpoint {
    host: string;
    cwd?: string;
    /** tmux pane on the source; ephemeral box slug on the target. */
    pane?: string;
    box?: string;
}
export interface MigrationRecord {
    sessionId: string;
    shortId: string;
    agent: string;
    mode: MigrationMode;
    /** true = move (the source was stopped); false = copy (--keep). */
    move: boolean;
    from: MigrationEndpoint;
    to: MigrationEndpoint;
    /** WIP branch the working tree was committed to before the move, if any. */
    branch?: string;
    /** Draft PR opened for that branch, if any. */
    wipPr?: string;
    /** ISO timestamp — passed in by the caller (the CLI has a real clock). */
    at: string;
    status: 'completed' | 'failed';
    error?: string;
}
export declare function migrationsLedgerPath(): string;
/**
 * Append one migration event. A ledger write must never break a migration that
 * otherwise succeeded, so a write failure is a visible warning, not a throw.
 * `file` is injectable for tests; production uses the default ledger path.
 */
export declare function recordMigration(rec: MigrationRecord, file?: string): void;
/** Read the whole ledger, oldest first. Blank/corrupt JSONL lines are skipped. */
export declare function readMigrations(file?: string): MigrationRecord[];
/** The most recent completed migration for a session id, or undefined. */
export declare function latestForSession(sessionId: string, file?: string): MigrationRecord | undefined;
