/**
 * GitWorktreeDriver — reference implementation of
 * {@link WorkspaceBackendDriver} backed by `git worktree`.
 *
 * See session-hierarchy.md §7.2 (Git-worktree reference backend).
 *
 * Safety: every subprocess invocation uses `execFile` with an argv array —
 * no shell interpolation — so caller-supplied `label`/`baseRef` strings
 * cannot escape their argument slot. Failures surface as
 * {@link WorkspaceBackendError} carrying the underlying cause.
 */
import type { WorkspaceRef } from '../../types/workspace/ref.js';
import type { Logger } from '../../utils/logger.js';
import type { BranchWorkspaceParams, CreateWorkspaceParams, WorkspaceBackendDriver, WorkspaceInspection } from './driver.js';
/**
 * Minimal shape of `execFile`'s promisified result — allows tests to stub
 * via dependency injection without pulling in the full `ChildProcess` type.
 */
export interface ExecFileResult {
    stdout: string;
    stderr: string;
}
/**
 * Async exec callable used by {@link GitWorktreeDriver}. Matches the shape
 * of `promisify(execFile)` for the argv-array overload. Injected via the
 * constructor so tests can stub without touching `child_process`.
 */
export type ExecFile = (file: string, args: readonly string[]) => Promise<ExecFileResult>;
/**
 * Configuration for {@link GitWorktreeDriver}.
 */
export interface GitWorktreeDriverConfig {
    /** Absolute path to the repo root whose `.git` backs the worktrees. */
    repoRoot: string;
    /**
     * Directory (absolute) where worktree checkouts live. Defaults to
     * `{repoRoot}/.namzu/worktrees` per session-hierarchy.md §7.2.
     */
    worktreesDir?: string;
    logger: Logger;
    /** Test-seam: inject a stub `execFile` implementation. */
    execFile?: ExecFile;
}
export declare class GitWorktreeDriver implements WorkspaceBackendDriver {
    readonly kind: "git-worktree";
    private readonly repoRoot;
    private readonly worktreesDir;
    private readonly log;
    private readonly exec;
    constructor(config: GitWorktreeDriverConfig);
    create(params: CreateWorkspaceParams): Promise<WorkspaceRef>;
    branch(source: WorkspaceRef, params: BranchWorkspaceParams): Promise<WorkspaceRef>;
    dispose(ref: WorkspaceRef): Promise<void>;
    inspect(ref: WorkspaceRef): Promise<WorkspaceInspection>;
}
/**
 * Parses `git worktree list --porcelain` output, returning the record for
 * `worktreePath` or `null` when absent. Exported for tests.
 */
export declare function parseWorktreeList(stdout: string, worktreePath: string): {
    path: string;
    head?: string;
    branch?: string;
} | null;
//# sourceMappingURL=git-worktree.d.ts.map