import type { ParsedDiffFile } from "../server/utils/diff-highlighter.js";
export declare function __resetPullRequestStatusCacheForTests(): void;
export declare function __setPullRequestStatusCacheTtlForTests(ttlMs: number): void;
export declare function __resetGhPathCacheForTests(): void;
export declare function __setGhPathForTests(path: string | null): void;
export declare function listBranchSuggestions(cwd: string, options?: {
    query?: string;
    limit?: number;
}): Promise<string[]>;
export declare class NotGitRepoError extends Error {
    readonly cwd: string;
    readonly code = "NOT_GIT_REPO";
    constructor(cwd: string);
}
export declare class MergeConflictError extends Error {
    readonly baseRef: string;
    readonly currentBranch: string;
    readonly conflictFiles: string[];
    constructor(options: {
        baseRef: string;
        currentBranch: string;
        conflictFiles: string[];
    });
}
export declare class MergeFromBaseConflictError extends Error {
    readonly baseRef: string;
    readonly currentBranch: string;
    readonly conflictFiles: string[];
    constructor(options: {
        baseRef: string;
        currentBranch: string;
        conflictFiles: string[];
    });
}
export interface AheadBehind {
    ahead: number;
    behind: number;
}
export interface CheckoutStatus {
    isGit: false;
}
export type CheckoutStatusGitNonSeawork = {
    isGit: true;
    repoRoot: string;
    currentBranch: string | null;
    isDirty: boolean;
    baseRef: string | null;
    aheadBehind: AheadBehind | null;
    aheadOfOrigin: number | null;
    behindOfOrigin: number | null;
    hasRemote: boolean;
    remoteUrl: string | null;
    isSeaworkOwnedWorktree: false;
};
export type CheckoutStatusGitSeawork = {
    isGit: true;
    repoRoot: string;
    mainRepoRoot: string;
    currentBranch: string | null;
    isDirty: boolean;
    baseRef: string;
    aheadBehind: AheadBehind | null;
    aheadOfOrigin: number | null;
    behindOfOrigin: number | null;
    hasRemote: boolean;
    remoteUrl: string | null;
    isSeaworkOwnedWorktree: true;
};
export type CheckoutStatusGit = CheckoutStatusGitNonSeawork | CheckoutStatusGitSeawork;
export type CheckoutStatusResult = CheckoutStatus | CheckoutStatusGit;
export type CheckoutStatusLiteNotGit = {
    isGit: false;
    currentBranch: null;
    remoteUrl: null;
    worktreeRoot: null;
    isSeaworkOwnedWorktree: false;
    mainRepoRoot: null;
};
export type CheckoutStatusLiteGitNonSeawork = {
    isGit: true;
    currentBranch: string | null;
    remoteUrl: string | null;
    worktreeRoot: string;
    isSeaworkOwnedWorktree: false;
    mainRepoRoot: null;
};
export type CheckoutStatusLiteGitSeawork = {
    isGit: true;
    currentBranch: string | null;
    remoteUrl: string | null;
    worktreeRoot: string;
    isSeaworkOwnedWorktree: true;
    mainRepoRoot: string;
};
export type CheckoutStatusLiteResult = CheckoutStatusLiteNotGit | CheckoutStatusLiteGitNonSeawork | CheckoutStatusLiteGitSeawork;
export interface CheckoutDiffResult {
    diff: string;
    structured?: ParsedDiffFile[];
}
export interface CheckoutDiffCompare {
    mode: "uncommitted" | "base";
    baseRef?: string;
    ignoreWhitespace?: boolean;
    includeStructured?: boolean;
}
export interface MergeToBaseOptions {
    baseRef?: string;
    mode?: "merge" | "squash";
    commitMessage?: string;
}
export interface MergeFromBaseOptions {
    baseRef?: string;
    requireCleanTarget?: boolean;
}
export type CheckoutContext = {
    seaworkHome?: string;
};
export declare function getCurrentBranch(cwd: string): Promise<string | null>;
export declare function getMainRepoRoot(cwd: string): Promise<string>;
export type GitWorktreeEntry = {
    path: string;
    branchRef?: string;
    isBare?: boolean;
};
/** Check whether a path contains a `.seawork/worktrees/` segment (both `/` and `\`). */
export declare function isSeaworkWorktreePath(p: string): boolean;
/** True when `child` is strictly inside `parent` (handles both `/` and `\`). */
export declare function isDescendantPath(child: string, parent: string): boolean;
export declare function parseWorktreeList(output: string): GitWorktreeEntry[];
export declare function renameCurrentBranch(cwd: string, newName: string): Promise<{
    previousBranch: string | null;
    currentBranch: string | null;
}>;
export declare function getOriginRemoteUrl(cwd: string): Promise<string | null>;
export declare function hasOriginRemote(cwd: string): Promise<boolean>;
export declare function resolveAbsoluteGitDir(cwd: string): Promise<string | null>;
export declare function resolveRepositoryDefaultBranch(repoRoot: string): Promise<string | null>;
export declare function getCheckoutStatus(cwd: string, context?: CheckoutContext): Promise<CheckoutStatusResult>;
export declare function getCheckoutStatusLite(cwd: string, context?: CheckoutContext): Promise<CheckoutStatusLiteResult>;
export interface CheckoutShortstat {
    additions: number;
    deletions: number;
}
export declare function getCheckoutShortstat(cwd: string, context?: CheckoutContext): Promise<CheckoutShortstat | null>;
export declare function getCheckoutDiff(cwd: string, compare: CheckoutDiffCompare, context?: CheckoutContext): Promise<CheckoutDiffResult>;
export declare function commitChanges(cwd: string, options: {
    message: string;
    addAll?: boolean;
}): Promise<void>;
export declare function commitAll(cwd: string, message: string): Promise<void>;
export declare function mergeToBase(cwd: string, options?: MergeToBaseOptions, context?: CheckoutContext): Promise<void>;
export declare function mergeFromBase(cwd: string, options?: MergeFromBaseOptions, context?: CheckoutContext): Promise<void>;
export declare function pullCurrentBranch(cwd: string): Promise<void>;
export declare function pushCurrentBranch(cwd: string): Promise<void>;
export interface CreatePullRequestOptions {
    title: string;
    body?: string;
    base?: string;
    head?: string;
    draft?: boolean;
}
export interface PullRequestStatus {
    url: string;
    title: string;
    state: string;
    baseRefName: string;
    headRefName: string;
    isMerged: boolean;
}
export interface PullRequestStatusResult {
    status: PullRequestStatus | null;
    githubFeaturesEnabled: boolean;
}
export declare function resolveGhPath(): Promise<string>;
export declare function createPullRequest(cwd: string, options: CreatePullRequestOptions): Promise<{
    url: string;
    number: number;
}>;
export declare function getPullRequestStatus(cwd: string): Promise<PullRequestStatusResult>;
//# sourceMappingURL=checkout-git.d.ts.map