/**
 * CLI command implementations for `neotoma mirror`.
 *
 * Delegates to `src/services/canonical_mirror.ts` for filesystem writes and
 * `src/services/canonical_markdown.ts` for rendering. This module only handles
 * command parsing, user interaction, and formatted output.
 */
import { MirrorConfig, MirrorKind, rebuildMirror } from "../../services/canonical_mirror.js";
import type { NeotomaApiClient } from "../../shared/api_client.js";
export interface MirrorRebuildOptions {
    kind?: string;
    entityType?: string;
    entityId?: string;
    clean?: boolean;
    profileId?: string;
    /** When provided, profile rebuilds fetch entity data from the HTTP API. */
    apiClient?: NeotomaApiClient;
}
export interface MirrorEnableOptions {
    path?: string;
    kinds?: string;
    git?: boolean;
    noGit?: boolean;
    gitignore?: boolean;
    noGitignore?: boolean;
}
export interface MirrorGitignoreResult {
    /** Absolute path of the enclosing git repo, or `null` when the mirror path is not inside a repo. */
    repo_root: string | null;
    /** Absolute path of the `.gitignore` file that was (or would be) updated. `null` when no repo was found. */
    gitignore_path: string | null;
    /** Repo-root-relative entry written to `.gitignore` (trailing slash included). `null` when no repo was found. */
    entry: string | null;
    /** True when the helper appended the entry, false when it was already present or when no repo was found. */
    added: boolean;
    /** True when the entry was already present in `.gitignore`. */
    already_present: boolean;
}
export interface MirrorRebuildResult {
    config: {
        enabled: boolean;
        path: string;
        kinds: MirrorKind[];
        git_enabled: boolean;
    };
    report: Awaited<ReturnType<typeof rebuildMirror>>;
}
export declare function runMirrorRebuild(options: MirrorRebuildOptions): Promise<MirrorRebuildResult>;
export interface MirrorStatusResult {
    enabled: boolean;
    path: string;
    absolute_path: string;
    kinds: MirrorKind[];
    git_enabled: boolean;
    counts: Record<MirrorKind, number>;
}
export declare function runMirrorStatus(): Promise<MirrorStatusResult>;
export interface MirrorConfigResult {
    enabled: boolean;
    path: string;
    absolute_path: string;
    kinds: MirrorKind[];
    git_enabled: boolean;
    gitignore?: MirrorGitignoreResult | null;
}
export declare function runMirrorEnable(options: MirrorEnableOptions): Promise<MirrorConfigResult>;
export declare function runMirrorDisable(): Promise<MirrorConfigResult>;
export declare function formatMirrorStatus(status: MirrorStatusResult): string;
export declare function formatRebuildReport(result: MirrorRebuildResult): string;
export declare function formatMirrorConfig(cfg: MirrorConfigResult): string;
/**
 * Walk up from `startDir` looking for a `.git` directory (or file, for
 * worktrees). Returns the path of the containing repo root, or `null` when
 * no enclosing repo is found before reaching the filesystem root or the user's
 * HOME directory. The HOME boundary prevents an accidental match on a
 * dotfiles repo that encompasses the entire home directory.
 */
export declare function findEnclosingGitRepo(startDir: string): string | null;
/**
 * Idempotently append the resolved mirror path to the enclosing repo's
 * `.gitignore`. Returns a structured result describing what was done.
 */
export declare function ensureMirrorGitignored(cfg?: MirrorConfig): MirrorGitignoreResult;
/**
 * Detect whether the mirror path is already ignored by the enclosing git
 * repo. Read-only; does not mutate `.gitignore`. Used by `neotoma doctor`.
 */
export declare function checkMirrorGitignoreStatus(cfg?: MirrorConfig): {
    inside_git_repo: boolean;
    git_repo_root: string | null;
    gitignored: boolean;
};
export declare function runMirrorGitignore(): Promise<MirrorGitignoreResult>;
export declare function formatMirrorGitignore(result: MirrorGitignoreResult | null): string;
//# sourceMappingURL=mirror.d.ts.map