/** * Compute the canonical worktrees-by-project root used by CLEO. * * Delegates to {@link getCleoWorktreesRoot} from `@cleocode/paths` — the * XDG-path SSoT — so this module no longer duplicates the XDG fallback logic. * * @returns Absolute path to `/worktrees/`. * * @task T1591 * @task T9016 */ export declare function resolveCleoWorktreesRoot(): string; /** * Compute the per-project worktree root. * * @param projectRoot - Absolute path to the project. * @returns Absolute path to `/cleo/worktrees//`. * * @task T1591 */ export declare function resolveProjectWorktreeRoot(projectRoot: string): string; /** * Check whether the given path is inside the canonical worktrees tree. * * Project-agnostic: matches the global worktrees root, not a specific project. * * @param cwdPath - Absolute path to check. * @returns true if the path is inside `/cleo/worktrees/`. * * @task T1591 */ export declare function isInsideWorktreesRoot(cwdPath: string): boolean; /** * Extract the task ID from a worktree path. * * Path layout: `/cleo/worktrees///...` * The taskId is the path segment immediately after the projectHash. * * @param cwdPath - Absolute path inside a worktree. * @returns The task ID segment, or null if the path is not inside the worktrees root. * * @task T1591 */ export declare function extractTaskIdFromWorktreePath(cwdPath: string): string | null; /** * Resolve the agent worktree boundary for the current shim invocation. * * Strategy (in order): * 1. `CLEO_WORKTREE_ROOT` env — explicit worktree path injected by the spawn prompt. * 2. Walk up from `cwd` until a directory under `/cleo/worktrees///` * is found. * 3. Return null when not inside any worktree. * * @param cwd - Working directory at shim invocation time. * @returns The worktree root path + task ID, or null when not inside a worktree. * * @task T1591 */ export declare function resolveActiveWorktree(cwd: string): { worktreePath: string; taskId: string; } | null; /** * Check whether an absolute path lives inside the given worktree. * * @param targetPath - Absolute path to test. * @param worktreePath - Absolute path to the worktree root. * @returns true if `targetPath` is the worktree or a descendant. * * @task T1591 */ export declare function isPathInsideWorktree(targetPath: string, worktreePath: string): boolean; //# sourceMappingURL=worktree-path.d.ts.map