import type { FileOperationResult } from "../core/config.js";
import type { ICopyStrategy, StrategyContext } from "./strategy.interface.js";
/**
 * Copy-overwrite strategy: Replace file if exists (prompts on conflict)
 * - Create new files silently
 * - Skip identical files
 * - Prompt on differences (or auto-accept in yesMode)
 * - Backup before overwriting
 */
export declare class CopyOverwriteStrategy implements ICopyStrategy {
    readonly name: "copy-overwrite";
    /**
     * Apply copy-overwrite strategy: Create, skip, or prompt to overwrite file
     * @param sourcePath - Source file path
     * @param destPath - Destination file path
     * @param relativePath - Relative path for logging
     * @param context - Strategy context with config and callbacks
     * @returns Result of the copy-overwrite operation
     */
    apply(sourcePath: string, destPath: string, relativePath: string, context: StrategyContext): Promise<FileOperationResult>;
    /**
     * Resolve a differing managed file on a non-interactive apply.
     *
     * There is no prompt available here, so a file the project may have
     * customised is left alone and reported as `stale` — unless
     * `--refresh-templates` covers it, which is the operator deciding in advance
     * to take upstream's version.
     *
     * Lisa's own artifacts are not in that category and never wait for the flag.
     * A version bump is how the fleet takes an upgrade, and it passes no flags, so
     * gating `scripts/lisa-hooks/*` behind one meant a released security fix
     * reached nobody: the fail-open fixes in #2374 shipped while installed repos
     * kept running the vulnerable guard, until someone deleted the files by hand
     * so the create path would recreate them. Lisa owns those files outright —
     * see `isLisaOwnedTemplate` — so they refresh here, backed up first, and a
     * project that wants to keep its own copy says so in `.lisaignore`.
     *
     * That refresh is unconditional only where Lisa can prove the installed copy
     * is behind. "Differs from mine" is not that proof — it is equally consistent
     * with the host being *ahead*, which is how `acmeorga/frontend` had a guard
     * they had hardened themselves silently replaced by a weaker upstream one.
     * That classification now runs in `apply`, before any branch here is chosen,
     * so it covers the prompted routes too — see `preserveOwnedHostCopy`.
     * Anything arriving here is either not Lisa's to judge, or provably behind.
     * @param sourcePath - Packaged template path
     * @param destPath - Installed file path
     * @param relativePath - Repo-relative path for reporting
     * @param context - Strategy context with config and callbacks
     * @returns Whether the file was refreshed, preserved, or left out of date
     */
    private applyNonInteractive;
    /**
     * Hold back a replacement of a Lisa-owned artifact on every route that has
     * one, rather than on the single unattended route.
     *
     * Two conditions still let a replacement through. The file must be one Lisa
     * owns outright — a `tsconfig.json` the project customised is not Lisa's to
     * judge, and keeps its existing prompt-or-stale behaviour. And the operator
     * must not have named it to `--refresh-templates`, which is them saying in
     * advance "take upstream's version of these". That flag is the exit
     * `describePreserved` tells them to use, so it has to actually work; the
     * postinstall passes no flags, so honouring it here changes nothing for the
     * unattended fleet.
     * @param sourcePath - Packaged template path
     * @param destPath - Installed file path
     * @param relativePath - Repo-relative path for reporting
     * @param context - Strategy context with config and ledger
     * @returns A preserved result when the copy is kept, else undefined
     */
    private preserveOwnedHostCopy;
    /**
     * Hold back a Lisa-owned refresh that cannot be proved to be an upgrade.
     *
     * Returns a result only when the file is being preserved, so the caller falls
     * through to its normal refresh path in every provably-safe case — a host copy
     * that matches a past Lisa release still gets replaced, which is what keeps
     * genuine drift from accumulating forever.
     *
     * A read failure is not treated as permission to overwrite. If the installed
     * bytes cannot be read they cannot be classified, and a classifier that
     * defaults to "overwrite" when it is confused is the original defect wearing a
     * different hat.
     *
     * That sentence described the intent and not the code until now: an
     * unreadable file returned `undefined`, which is this method's word for
     * "nothing to preserve", and the caller carried straight on to the overwrite.
     * `filesIdentical` swallows its own read errors and answers "differs", so an
     * unreadable Lisa-owned guard reached here on every apply and was replaced
     * without ever being classified. Now it is kept, and the reason is named.
     * @param sourcePath - Packaged template path
     * @param destPath - Installed file path
     * @param relativePath - Repo-relative path for reporting
     * @param ledger - Known-good hashes, defaulting to Lisa's shipping history
     * @returns A `host-ahead` result when the copy is preserved, else undefined
     */
    private preserveIfHostAhead;
}
//# sourceMappingURL=copy-overwrite.d.ts.map