import { type RunTextCommand } from '../gh-cli/exec.mts'; /** * The environment for git: no inherited `GIT_*` variables, so `GIT_DIR` cannot redirect the check, * and the C locale, so git's diagnostics are not translated and can be classified reliably. */ export declare function isolatedGitEnv(): NodeJS.ProcessEnv; export declare const runIsolatedGit: RunTextCommand; /** * The worktree root containing `cwd`, or undefined when git reports `cwd` is not inside one (so * the server may be launched from anywhere). Any other git failure, such as a missing git binary * or an unsafe repository, is thrown with the cause rather than reported as "outside a worktree". */ export declare function launchWorktreeRoot(cwd: string, runGit: RunTextCommand): Promise; /** * The worktree paths in `git worktree list --porcelain -z` output: NUL-terminated fields, an empty * field ending each record, so a path containing a newline cannot forge a record. */ export declare function parseWorktreeList(output: string): string[]; /** * Resolves the worktree a tool call may act on. It must be an absolute path that, after * resolving symlinks, is exactly the top level of a git worktree. A subdirectory, a relative or * nonexistent path, and a non-git directory are rejected. When the server was launched inside a * repository, the path must also be one of that repository's worktrees (primary or linked), so an * unrelated `git init` directory is refused. A server launched outside any repository accepts the * top level of any worktree. Git is asked on every call, so worktrees created after the server * started are accepted and removed ones are not. Without `requested`, the launch worktree is used. */ export declare function resolveWorktree(input: { launchRoot: string | undefined; requested?: string | undefined; runGit: RunTextCommand; }): Promise;