/** Sandbox id of a repository's main checkout. */ export declare const MAIN_CHECKOUT_ID = "main"; /** A git checkout a sandbox can run: the main checkout or a linked worktree. */ export interface Checkout { /** * Names the sandbox. For a linked worktree its id — the name of its admin * dir under `.git/worktrees/`, which git keeps unique per repository and * which survives branch switches and detached HEADs. For the main checkout * {@link MAIN_CHECKOUT_ID}. */ id: string; /** Absolute top-level directory of this checkout. */ root: string; /** Absolute shared `.git` directory of the repository. */ commonDir: string; /** Absolute top-level directory of the main checkout. */ mainRoot: string; /** True for a linked worktree, false for the main checkout. */ linked: boolean; } /** * Pure part of checkout detection: `git rev-parse --path-format=absolute * --git-dir --git-common-dir --show-toplevel` output → Checkout. A main * checkout's git dir IS the common dir; a linked worktree's lives under it. */ export declare function parseCheckout(gitDir: string, commonDir: string, root: string): Checkout; /** The git checkout `dir` is in, or null outside git. */ export declare function detectCheckout(dir: string): Checkout | null; /** Lowercase DNS label: `[a-z0-9-]`, no leading/trailing dash, ≤ `max` chars. */ export declare function dnsLabel(value: string, max?: number): string; /** * Docker container name for a project's worktree sandbox. It doubles as the * container hostname (Docker caps those at 64 bytes) and the `.orb.local` * DNS label (63), so long names are shortened — with a hash of the full id so * two long worktree ids sharing a prefix still get distinct sandboxes. */ export declare function containerName(project: string, worktreeId: string): string; /** Expand a `sandbox.domain` template: `{name}` → checkout id, `{project}`. */ export declare function sandboxDomain(template: string, project: string, worktreeId: string): string; //# sourceMappingURL=worktree.d.ts.map