interface GitWorktreeContext { isGitWorktree: boolean; isSecondaryWorktree: boolean; currentWorktreeRoot: string | null; primaryWorktreeRoot: string | null; currentBranch: string | null; } export interface GitWorktreeEntry { root: string; branch: string | null; detached: boolean; } /** Reuse worktree observations only within one read-only query, never across commands. */ export declare function withGitWorktreeReadScope(operation: () => T): T; /** daemon 专用;只复用已核对元数据的查询观察,写命令不进入此作用域。 */ export declare function createGitWorktreeReadCache(): { run(projectRoot: string, operation: () => Promise, invocationCwd?: string): Promise; }; /** * Compare two paths by identity on disk. On Windows this resolves 8.3 short * names and casing through the filesystem, so the same root observed from * different sources (Node's `path.resolve` versus `git worktree list`) still * compares equal; on other platforms it compares the resolved paths. */ export declare function samePath(left: string, right: string): boolean; declare function inspectGitWorktree(projectPath: string): GitWorktreeContext; declare function listGitWorktrees(projectPath: string): GitWorktreeEntry[]; declare function listGitWorktreeRoots(projectPath: string): string[]; /** A read-only projection of one already observed worktree list. */ declare function gitWorktreeContextFromEntries(projectPath: string, entries: readonly GitWorktreeEntry[]): GitWorktreeContext | null; /** Read the branch without paying for an unrelated worktree enumeration. */ declare function currentGitBranch(projectPath: string): string | null; declare function isLocalGitBranch(projectPath: string, branch: string): boolean; declare function resolveGitRef(projectPath: string, ref: string): string | null; export { inspectGitWorktree, currentGitBranch, gitWorktreeContextFromEntries, isLocalGitBranch, listGitWorktreeRoots, listGitWorktrees, resolveGitRef, }; export type { GitWorktreeContext }; //# sourceMappingURL=git-worktree.d.ts.map