import { type NodeFs } from '../node-fs.js';
import { type GitRunner } from '../project.js';
/** The filesystem this module needs. Injectable so the scan is testable. */
export interface LinkFs {
    /** Entry names in a directory. A missing/unreadable dir yields `[]`. */
    readdir(path: string): Promise<string[]>;
    /** True when `path` is a directory (following symlinks). Any error reads as `false`. */
    isDirectory(path: string): Promise<boolean>;
    /** True when anything exists at `path`, symlinks included (no link following). */
    entryExists(path: string): Promise<boolean>;
    /** Recursive. */
    mkdir(path: string): Promise<void>;
    /** Create a directory symlink at `path` pointing to `target`. */
    symlinkDir(target: string, path: string): Promise<void>;
}
/** The `node:fs/promises` implementation of {@link LinkFs}. */
export declare function nodeLinkFs(): LinkFs;
/**
 * Every `node_modules` directory in `repo`, as repo-relative paths, down to
 * {@link MAX_DEPTH}. Sorted, so the linking order (and any log of it) is stable.
 */
export declare function findDependencyDirs(repo: string, fs?: LinkFs): Promise<string[]>;
/**
 * Symlink `repo`'s dependency trees into `worktree` at the same relative paths.
 * Returns the paths linked. Best-effort throughout: a worktree with no deps is a
 * worse run, not a failed one, so a link that cannot be made is skipped rather
 * than thrown. An existing entry is left alone (the agent may have installed already).
 */
export declare function linkDependencies(repo: string, worktree: string, fs?: LinkFs): Promise<string[]>;
/**
 * Make git ignore the dependency links (#738). A repo's `.gitignore` says `node_modules/`, and
 * a trailing slash matches a *directory* only — the links {@link linkDependencies} makes are
 * symlinks, so they are not covered, and they show up as untracked in every agent's worktree.
 * That is not cosmetic: the agent runs `git add -A`, so the agent would commit dangling absolute
 * symlinks into its branch and onto the PR.
 *
 * A slash-free `node_modules` in the repo-level exclude ({@link excludeFromGit}) covers the
 * symlink form in every worktree, and the main checkout is unaffected in practice: its
 * `node_modules` is a real directory, already ignored by the same name.
 *
 * Best-effort: an agent whose links are merely untracked is still an agent.
 */
export declare function excludeDependencyLinks(repo: string, fs?: NodeFs, agent?: GitRunner): Promise<void>;
//# sourceMappingURL=worktree-deps.d.ts.map