/**
 * `neotoma db migrate-env-split` — detect and repair dev/prod database splits.
 *
 * The problem: before v0.13.x, npm-installed Neotoma defaulted to the development
 * database (neotoma.db) instead of the production database (neotoma.prod.db).
 * Agents using the CLI could accumulate real user data in the wrong file.
 *
 * The command:
 *   1. Inspects both DB files for user-contributed row counts (observations, sources,
 *      entities via snapshots).
 *   2. In the common case (dev has data, prod is empty/absent): atomically renames
 *      dev → prod after writing a timestamped backup.
 *   3. In the merge case (both have data): refuses and emits clear instructions —
 *      full merge is a separate, more invasive operation.
 *   4. --dry-run always safe; --yes required to write anything.
 *   5. Idempotent: re-running after a successful migration reports "no action needed".
 */
export interface DbInfo {
    path: string;
    exists: boolean;
    /** User-contributed observation rows (excludes bootstrap schema seeds). */
    observation_count: number;
    /** Rows in the snapshots table (proxy for distinct entities with data). */
    snapshot_count: number;
    /** Rows in the sources table. */
    source_count: number;
}
export type EnvSplitStatus = "no_data" | "prod_only" | "dev_only" | "both_have_data" | "dev_empty_prod_empty";
export interface EnvSplitReport {
    status: EnvSplitStatus;
    dev: DbInfo;
    prod: DbInfo;
    /** Set when status === "dev_only": path the dev DB would be renamed to. */
    rename_target?: string;
    /** Set when status === "dev_only": backup path written before rename. */
    backup_path?: string;
}
export interface MigrateEnvSplitResult extends EnvSplitReport {
    action_taken: "none" | "renamed" | "dry_run_would_rename";
    backup_written: boolean;
    renamed: boolean;
}
/** Build DbInfo for both DB files in the given dataDir. */
export declare function inspectEnvSplit(dataDir: string): EnvSplitReport;
export interface MigrateEnvSplitOptions {
    dataDir: string;
    dryRun: boolean;
    yes: boolean;
    /** Injected for tests to capture output without hitting stdout. */
    write?: (s: string) => void;
}
/**
 * Detect and (optionally) repair a dev/prod env split.
 * Returns a structured result for programmatic callers (tests, JSON output).
 */
export declare function migrateEnvSplit(opts: MigrateEnvSplitOptions): Promise<MigrateEnvSplitResult>;
/** Lightweight summary for use in doctor output and startup warnings. */
export interface EnvSplitWarning {
    has_split: boolean;
    dev_observations: number;
    dev_sources: number;
    prod_observations: number;
    prod_sources: number;
    suggested_action: string | null;
}
export declare function detectEnvSplitWarning(dataDir: string): EnvSplitWarning;
//# sourceMappingURL=db_migrate_env_split.d.ts.map