import { type Locale } from '../i18n/index.js';
export interface LandDiff {
    ok: true;
    empty: boolean;
    patch: string;
    statText: string;
    files: number;
    insertions: number;
    deletions: number;
}
export interface LandError {
    ok: false;
    error: string;
}
/** Locate the project overlay UPPER dir (= SandboxSpawn.workDir) for a session. */
export declare function upperDir(dataDir: string, sessionId: string): string;
/**
 * Compute the agent's changeset from the session's overlay upper layer, with a
 * human-readable preview (per-file `git diff --no-index` vs the real project).
 */
export declare function computeSandboxDiff(dataDir: string, sessionId: string, locale?: Locale): LandDiff | LandError;
/**
 * Apply the session's overlay upper changeset onto the real target project:
 *   - regular file in upper → mkdir -p parent, copy over the real file
 *   - symlink in upper      → recreate the link (NOT a dereferenced copy)
 *   - whiteout              → remove the corresponding real file/dir
 *   - opaque dir            → only when the dir ALSO exists in the target (= a
 *                             wholesale replace): drop the stale lower contents,
 *                             then re-create it (its surviving files arrive as
 *                             separate 'file'/'symlink' changes). A purely-new
 *                             opaque dir is just mkdir'd (never rm -rf'd).
 *
 * Two-phase for safety:
 *   1) PRE-VALIDATE every source is landable (dangling symlink, unreadable regular
 *      file, undeterminable opacity on a dir that exists in the target) BEFORE we
 *      mutate anything — so the common mid-loop failure (a dangling relative
 *      symlink) is caught up front and the real project is left untouched.
 *   2) APPLY; if a per-file op still throws (race / permission / ENOSPC), we
 *      report which files were already applied so the owner isn't told "failed"
 *      with the repo silently half-landed and no clue about its state.
 */
export declare function applySandboxDiff(targetDir: string, dataDir: string, sessionId: string, locale?: Locale): {
    ok: true;
} | LandError;
//# sourceMappingURL=sandbox-land.d.ts.map