import type { PortableTool } from "../portable-tool.js";
export declare const WORKTREE_TOOL_NAME: "worktree";
export type WorktreeAction = "enter" | "exit" | "list";
export interface WorktreeToolParams {
    /** Action: enter (create worktree), exit (leave worktree), list (show all) */
    action: WorktreeAction;
    /** Branch/worktree name (for enter). kebab-case, max 64 chars. */
    name?: string;
    /** For exit: 'keep' retains the worktree, 'remove' deletes it */
    exitAction?: "keep" | "remove";
    /** Required true to discard uncommitted changes on exit with remove */
    discardChanges?: boolean;
}
export declare const WORKTREE_TOOL_SCHEMA: {
    readonly type: "object";
    readonly properties: {
        readonly action: {
            readonly type: "string";
            readonly enum: readonly ["enter", "exit", "list"];
            readonly description: string;
        };
        readonly name: {
            readonly type: "string";
            readonly description: string;
        };
        readonly exitAction: {
            readonly type: "string";
            readonly enum: readonly ["keep", "remove"];
            readonly description: "For exit: 'keep' retains the worktree for later use; 'remove' deletes it.";
        };
        readonly discardChanges: {
            readonly type: "boolean";
            readonly description: string;
        };
    };
    readonly required: readonly ["action"];
};
export interface WorktreeInfo {
    name: string;
    path: string;
    branch: string;
    isCurrent: boolean;
    hasChanges: boolean;
    unpushedCommits: number;
}
export interface WorktreeResult {
    success: boolean;
    worktree?: WorktreeInfo;
    worktrees?: WorktreeInfo[];
    previousCwd?: string;
    error?: string;
}
/**
 * Host-provided git worktree backend.
 * Manages worktree creation, switching, and cleanup.
 */
export interface WorktreeToolDeps {
    /** Create a new worktree and switch session cwd */
    enterWorktree(name?: string): Promise<WorktreeResult>;
    /** Exit worktree (keep or remove) */
    exitWorktree(action: "keep" | "remove", discardChanges?: boolean): Promise<WorktreeResult>;
    /** List all worktrees */
    listWorktrees(): Promise<WorktreeResult>;
    /** Check if currently in a worktree */
    isInWorktree(): boolean;
    /** Get current worktree info */
    currentWorktree?(): WorktreeInfo | null;
}
export declare function createWorktreeTool(deps: WorktreeToolDeps): PortableTool<WorktreeToolParams>;
