import { type AuthorityPolicyConfig } from "../../policy/authority.ts"; export interface WorktreeSetup { cwd: string; worktrees: WorktreeInfo[]; baseCommit: string; capturedDiffs?: WorktreeDiff[]; } export interface WorktreeInfo { path: string; agentCwd: string; branch: string; index: number; nodeModulesLinked: boolean; syntheticPaths: string[]; } export interface WorktreeDiff { index: number; agent: string; branch: string; diffStat: string; filesChanged: number; insertions: number; deletions: number; patchPath: string; error?: string; } export interface WorktreeCleanupTask { index: number; path: string; branch: string; worktreeRemoved: boolean; branchRemoved: boolean; preserved?: boolean; reason?: string; errors?: string[]; } export type WorktreeCleanupIntent = { kind: "preserve"; capturedDiffs?: WorktreeDiff[]; handoffManifestPath?: string; } | { kind: "discard"; authorization: { kind: "policy"; policy?: AuthorityPolicyConfig; } | { kind: "confirmed"; policy?: AuthorityPolicyConfig; }; } | { kind: "setup-rollback"; }; export interface WorktreeCleanupReport { state: "complete" | "partial"; tasks: WorktreeCleanupTask[]; pruned: boolean; errors?: string[]; } interface WorktreeTaskCwdConflict { index: number; agent: string; cwd: string; } interface WorktreeSetupHookConfig { hookPath: string; timeoutMs?: number; } interface CreateWorktreesOptions { agents?: string[]; setupHook?: WorktreeSetupHookConfig; baseDir?: string; } export declare function findWorktreeTaskCwdConflict(tasks: ReadonlyArray<{ agent: string; cwd?: string; }>, sharedCwd: string): WorktreeTaskCwdConflict | undefined; export declare function formatWorktreeTaskCwdConflict(conflict: WorktreeTaskCwdConflict, sharedCwd: string): string; export declare function resolveExpectedWorktreeAgentCwd(cwd: string, runId: string, index: number, baseDir?: string): string; export declare function createWorktrees(cwd: string, runId: string, count: number, options?: CreateWorktreesOptions): WorktreeSetup; export declare function diffWorktrees(setup: WorktreeSetup, agents: string[], diffsDir: string): WorktreeDiff[]; export declare function cleanupWorktrees(setup: WorktreeSetup, intent?: WorktreeCleanupIntent): WorktreeCleanupReport; export declare function formatWorktreeDiffSummary(diffs: WorktreeDiff[]): string; export {}; //# sourceMappingURL=worktree.d.ts.map