import * as path from "node:path"; export type GjcLaunchWorktreeMode = { enabled: false; } | { enabled: true; detached: true; name: null; } | { enabled: true; detached: false; name: string; }; export interface ParsedLaunchWorktreeMode { mode: GjcLaunchWorktreeMode; remainingArgs: string[]; } export interface GjcLaunchWorktreePlan { enabled: true; repoRoot: string; worktreePath: string; detached: boolean; baseRef: string; branchName: string | null; } export interface GjcLaunchWorktreeResult extends GjcLaunchWorktreePlan { created: boolean; reused: boolean; createdBranch: boolean; dirty?: boolean; } /** * Pure core of {@link resolveWorktreeBucket}, exported for tests. * * Injecting the home directory and path implementation lets tests exercise * Windows drive/UNC/separator semantics (`path.win32`) on any host. */ export declare function resolveWorktreeBucketForPath(repoRoot: string, envValue: string | undefined, home: string, pathApi: typeof path.posix): string; export declare function parseLaunchWorktreeMode(args: string[]): ParsedLaunchWorktreeMode; export declare function planLaunchWorktree(cwd: string, mode: GjcLaunchWorktreeMode): GjcLaunchWorktreePlan | { enabled: false; }; export declare function ensureLaunchWorktree(plan: GjcLaunchWorktreePlan | { enabled: false; }): GjcLaunchWorktreeResult | { enabled: false; }; /** Workspace worktrees must own their complete lockfile-resolved dependency graph (#4620). */ export declare function ensureReusableNodeModules(sourceRoot: string, worktreePath: string): "symlink" | "present" | "missing"; /** Result of {@link prepareLaunchWorktree}: the effective working directory, remaining args, and resolved worktree plan. */ export interface PreparedLaunchWorktree { cwd: string; args: string[]; worktree: GjcLaunchWorktreeResult | { enabled: false; }; } export declare function prepareLaunchWorktree(cwd: string, args: string[]): PreparedLaunchWorktree;