/**
 * Backup and restore core module.
 *
 * Produces full-`.cleo/` snapshots containing tasks.db, brain.db, config.json
 * and project-info.json using the safest available method for each file type:
 *
 *   - SQLite databases: `VACUUM INTO` via the live native handle (see
 *     {@link ../store/sqlite-backup.ts}). This is the ONLY safe way to
 *     snapshot a WAL-mode SQLite database while it is open — raw filesystem
 *     copies can capture torn writes or stale WAL frames.
 *
 *   - JSON files: atomic tmp-then-rename via {@link atomicWrite} so a partial
 *     write can never corrupt the backup target.
 *
 * Snapshots are recorded under `.cleo/backups/{type}/` with a JSON sidecar
 * (`{backupId}.meta.json`) enumerating which files were captured and how.
 * Restores read the same sidecars and materialize each file back into the
 * live `.cleo/` directory.
 *
 * This is the backing store for the `cleo backup` and `cleo restore backup`
 * CLI verbs (see packages/cleo/src/cli/commands/backup.ts and restore.ts).
 *
 * @task T4783
 * @task T5158 — extended to use VACUUM INTO for .db files and atomicWrite for JSON
 */
/** Result shape returned by {@link createBackup}. */
export interface BackupResult {
    /** Unique backup identifier (timestamped). */
    backupId: string;
    /** Absolute path to the directory containing the snapshot files. */
    path: string;
    /** ISO-8601 timestamp when the backup was created. */
    timestamp: string;
    /** Backup category (`snapshot`, `safety`, `migration`). */
    type: string;
    /** Files that were successfully captured into this backup. */
    files: string[];
}
/** Result shape returned by {@link restoreBackup}. */
export interface RestoreResult {
    /** Whether any files were actually restored (false if none matched). */
    restored: boolean;
    /** The backup identifier that was restored. */
    backupId: string;
    /** ISO-8601 timestamp of the original backup. */
    timestamp: string;
    /** File names that were successfully restored back into `.cleo/`. */
    filesRestored: string[];
}
/**
 * Create a backup of the canonical CLEO data files.
 *
 * Produces safe copies via VACUUM INTO (for SQLite) and atomicWrite
 * (for JSON) into `.cleo/backups/{type}/`. Writes a `{backupId}.meta.json`
 * sidecar describing the snapshot.
 *
 * Opens both `tasks.db` and `brain.db` through their canonical drizzle
 * accessors before snapshotting so that the native DB handles are live
 * when `safeSqliteSnapshot` asks for them. This makes the function
 * self-contained — callers do not need to pre-open the DBs.
 *
 * Async because opening the database engines requires async migration
 * reconciliation (ADR-012). The CLI dispatch layer awaits this result.
 */
export declare function createBackup(projectRoot: string, opts?: {
    type?: string;
    note?: string;
}): Promise<BackupResult>;
/** A single backup entry returned by listSystemBackups. */
export interface BackupEntry {
    /** Unique backup identifier (timestamped). */
    backupId: string;
    /** Backup category (`snapshot`, `safety`, `migration`). */
    type: string;
    /** ISO-8601 timestamp when the backup was created. */
    timestamp: string;
    /** Optional human-readable note attached at creation time. */
    note?: string;
    /** File names captured in this backup. */
    files: string[];
}
/**
 * List all available system backups (snapshot, safety, migration types).
 * Reads `.meta.json` sidecar files written by createBackup.
 * This is a pure read operation — it does not modify any files.
 * @task T4783
 */
export declare function listSystemBackups(projectRoot: string): BackupEntry[];
/**
 * Restore a backup into the live `.cleo/` directory.
 *
 * This operation overwrites the in-place copies of the files recorded in
 * the backup's sidecar. SQLite files are restored via a plain `copyFileSync`
 * because restore runs BEFORE the next CLEO process opens the database — no
 * WAL is active at that point — so a filesystem copy is safe. Callers must
 * ensure no CLEO process is concurrently writing to the target database.
 *
 * JSON files are restored via `atomicWrite` (tmp-then-rename) so a crash
 * mid-restore cannot produce a truncated config.
 */
export declare function restoreBackup(projectRoot: string, params: {
    backupId: string;
    force?: boolean;
}): RestoreResult;
//# sourceMappingURL=backup.d.ts.map