/**
 * Worktree identity migration for `@cleocode/worktree`.
 *
 * Backfills `project-info.json` into existing worktrees that were created
 * before the identity system (T11033) was deployed. New worktrees get
 * project-info.json at provision time; this module handles the legacy ones.
 *
 * @task T11036
 * @epic T10299
 * @saga T10295
 */
/**
 * Result of a single worktree identity migration.
 */
export interface MigrateWorktreeResult {
    /** Absolute path to the worktree that was checked. */
    worktreePath: string;
    /** Whether the migration actually backfilled (created) project-info.json. */
    backfilled: boolean;
    /** The projectId from the parent project's project-info.json, if present. */
    projectId?: string;
    /** The projectHash from the parent project's project-info.json, if present. */
    projectHash?: string;
    /** The resolved parent project root, if successfully discovered. */
    parentProjectRoot?: string;
    /** Human-readable error reason when migration could not proceed. */
    error?: string;
}
/**
 * Discover the parent project root from a git worktree's `.git` gitlink file.
 *
 * Git worktrees use a `.git` FILE (not directory) containing a gitdir reference:
 *   `gitdir: /path/to/main/.git/worktrees/<name>`
 *
 * From this we derive: `<gitdir>/../..` → main repo root.
 *
 * @param worktreePath - Absolute path to the worktree directory.
 * @returns The resolved main repo root, or null if it cannot be determined.
 * @internal
 */
export declare function discoverParentProjectRoot(worktreePath: string): string | null;
/**
 * Backfill `project-info.json` into a worktree that lacks it.
 *
 * Discovers the parent project root via the worktree's `.git` gitlink, reads
 * the parent's `.cleo/project-info.json`, and copies it into the worktree's
 * `.cleo/` directory. Idempotent: if project-info.json already exists, the
 * worktree is skipped with `backfilled: false`.
 *
 * @param worktreePath - Absolute path to the worktree directory.
 * @returns Migration result with backfill status and identity fields.
 *
 * @task T11036
 */
export declare function migrateWorktreeIdentity(worktreePath: string): MigrateWorktreeResult;
/**
 * Migrate ALL existing worktrees for a given project root.
 *
 * Enumerates worktrees via the XDG directory scan, then backfills
 * project-info.json into each worktree that lacks it.
 *
 * @param projectRoot - Absolute path to the project root.
 * @returns Array of migration results, one per worktree.
 *
 * @task T11036
 */
export declare function migrateAllWorktreeIdentities(projectRoot: string): MigrateWorktreeResult[];
//# sourceMappingURL=worktree-migrate.d.ts.map