/** * Worktree registry storage for ARCS projects. * * Maps plans to their dedicated git worktrees (one plan = one tree). * The registry is a plain JSON file (`worktrees.json`) in the project * data directory; git state itself is never consulted here — callers * cross-check registry rows against `git worktree list`. */ export interface WorktreeEntry { planId: string; /** Absolute path to the worktree checkout. */ path: string; /** Branch checked out in the worktree (e.g. `arcs/`). */ branch: string; /** Commit the worktree branched from, when known. */ baseCommit?: string; createdAt: string; } export interface UpsertWorktreeInput { planId: string; path: string; branch: string; baseCommit?: string; } export declare const WORKTREES_FILE = "worktrees.json"; /** * Read all worktree registrations for a project. Missing or corrupt file * yields an empty registry (fail open); malformed rows are skipped. */ export declare function readWorktreeRegistry(projectDir: string): Promise; /** * Insert or update a worktree registration keyed by normalized plan id. * Existing `createdAt` is preserved on update; path/branch/baseCommit are * refreshed. Returns the persisted row. */ export declare function upsertWorktreeEntry(projectDir: string, input: UpsertWorktreeInput): Promise; /** * Remove the registration for a plan. Returns true if a row was removed, * false when the plan had no registration. */ export declare function removeWorktreeEntry(projectDir: string, planId: string): Promise; /** Find the worktree registered for a plan, if any. */ export declare function findWorktreeByPlan(projectDir: string, planId: string): Promise; export interface PathCollision { /** Normalized path claimed by more than one registry row. */ path: string; planIds: string[]; } /** * Detect registry rows claiming the same resolved path across different * plans (or duplicated rows for one plan). Healthy registries return []. */ export declare function findPathCollisions(entries: WorktreeEntry[]): PathCollision[]; //# sourceMappingURL=worktree-store.d.ts.map