export type GitManageWorktreeAction = "list" | "add" | "remove" | "prune";
export type GitManageWorktreePermission = "git:read" | "git:write" | "filesystem:read" | "filesystem:write";
export type GitManageWorktreeRiskCategory = "read-only-inspection" | "workspace-mutation" | "destructive";
export type GitManageWorktreeGuard = {
    allowed?: boolean;
    accepted?: boolean;
    reason?: string;
};
export type GitManageWorktreeContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: GitManageWorktreeGuard;
    allowedRepositoryRoots?: readonly string[];
    grantedPermissions?: readonly GitManageWorktreePermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type GitManageWorktreeTarget = {
    repositoryPath: string;
    action: GitManageWorktreeAction;
    worktreePath?: string;
    targetRef?: string;
    branchName?: string;
    detach: boolean;
    force: boolean;
};
export type GitManageWorktreeRequest = {
    target?: Partial<GitManageWorktreeTarget>;
    context?: GitManageWorktreeContext;
    provider?: GitManageWorktreeProvider;
    timeoutMs?: number;
    metadata?: Readonly<Record<string, unknown>>;
    runtimeId?: string;
    invocationId?: string;
    repositoryPath?: string;
    cwd?: string;
    action?: GitManageWorktreeAction;
    worktreePath?: string;
    targetPath?: string;
    path?: string;
    targetRef?: string;
    ref?: string;
    branchName?: string;
    branch?: string;
    detach?: boolean;
    force?: boolean;
    dryRun?: boolean;
};
export type GitManageWorktreeRuntimeEntry = {
    owner: "runtime";
    port: "BaseToolExecutorPort.git.runGit";
    method: "runGit";
    binary: "git";
    argvMode: "fixed-manage-worktree";
    allowedSubcommand: "worktree";
};
export type GitManageWorktreeRisk = {
    category: GitManageWorktreeRiskCategory;
    riskLevel: "normal" | "risky" | "destructive";
    mutatesRepository: boolean;
    mutatesWorkingTree: boolean;
    mutatesFilesystem: boolean;
    managesWorktree: true;
    mayUseNetwork: false;
    spawnsProcess: true;
    requiresTapApproval: boolean;
    runtimeOwnsExecution: true;
};
export type GitWorktreeEntry = {
    path: string;
    head?: string;
    branch?: string;
    detached?: boolean;
    bare?: boolean;
    prunable?: boolean;
};
export type GitManageWorktreeEnvelope = {
    parser: "git-worktree-output-v1";
    action: GitManageWorktreeAction;
    worktreePath?: string;
    targetRef?: string;
    branchName?: string;
    exitCode?: number;
    stdoutLineCount: number;
    stderrLineCount: number;
    operationHint?: string;
    worktrees: readonly GitWorktreeEntry[];
    worktreeChanged: boolean;
};
export type GitManageWorktreeOutput = {
    kind: "agentCore.basicTool.git.manageWorktree";
    target: GitManageWorktreeTarget;
    runtimeEntry: GitManageWorktreeRuntimeEntry;
    risk: GitManageWorktreeRisk;
    gitArgs: readonly string[];
    commandPreview: readonly string[];
    timeoutMs: number;
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled: boolean;
    exitCode?: number;
    stdout?: string;
    stderr?: string;
    permissionsRequired: readonly GitManageWorktreePermission[];
    unsafeSideEffects: boolean;
    resultEnvelope: GitManageWorktreeEnvelope;
};
export type GitManageWorktreePlan = {
    toolId: "git.manageWorktree";
    toolKind: "git.manageWorktree";
    capability: "manage-worktree";
    runtimeId: string;
    invocationId: string;
    repositoryPath: string;
    action: GitManageWorktreeAction;
    gitArgs: readonly string[];
    commandPreview: readonly string[];
    requiredPermissions: readonly GitManageWorktreePermission[];
    runtimeEntry: GitManageWorktreeRuntimeEntry;
    risk: GitManageWorktreeRisk;
    dispatch: "dry-run" | "runtime-git-executor";
    dryRun: boolean;
    wouldMutateRepository: boolean;
    wouldMutateFilesystem: boolean;
    unsafeSideEffects: boolean;
    outputEnvelope: {
        stdoutPreview: "";
        stderrPreview: "";
        parsed: false;
    };
    audit: {
        guard: "git-worktree-runtime-guard";
        event: "basicTool.git.manageWorktree.planned";
        governanceRequired: boolean;
        tapCanWrap: true;
        metadata: Readonly<Record<string, unknown>>;
    };
};
export type GitManageWorktreeErrorBoundary = "input" | "scope" | "permission" | "governance" | "provider";
export type GitManageWorktreeErrorCode = "MISSING_REPOSITORY_PATH" | "MISSING_TARGET_PATH" | "MISSING_TARGET_REF" | "INVALID_ACTION" | "INVALID_ARGUMENT" | "INVALID_CONTEXT" | "INVALID_TIMEOUT" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "GOVERNANCE_REJECTED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED";
export type GitManageWorktreeError = {
    code: GitManageWorktreeErrorCode;
    message: string;
    boundary: GitManageWorktreeErrorBoundary;
    publicSafe: true;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type GitManageWorktreeAuditEvent = {
    type: string;
    toolId: "git.manageWorktree";
    invocationId: string;
    dryRun: boolean;
    repositoryPath?: string;
    metadata: Readonly<Record<string, unknown>>;
};
export type GitManageWorktreeResult = {
    ok: true;
    toolId: "git.manageWorktree";
    output: GitManageWorktreeOutput;
    plan: GitManageWorktreePlan;
    audit: readonly GitManageWorktreeAuditEvent[];
    events: readonly string[];
} | {
    ok: false;
    toolId: "git.manageWorktree";
    error: GitManageWorktreeError;
    audit: readonly GitManageWorktreeAuditEvent[];
    events: readonly string[];
};
export type GitManageWorktreeProviderRequest = {
    repositoryPath: string;
    args: readonly string[];
    timeoutMs?: number;
};
export type GitManageWorktreeProviderResult = {
    exitCode: number;
    stdout: string;
    stderr: string;
};
export type GitManageWorktreeProvider = (request: GitManageWorktreeProviderRequest, context: GitManageWorktreeContext) => GitManageWorktreeProviderResult | Promise<GitManageWorktreeProviderResult>;
export declare const gitManageWorktreeDescriptor: {
    readonly toolId: "git.manageWorktree";
    readonly toolKind: "git.manageWorktree";
    readonly capability: "manage-worktree";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.gitBase.advanced";
    readonly defaultDryRun: true;
    readonly defaultDispatch: "dry-run";
    readonly tapOwnsApproval: true;
    readonly requiresTapApproval: true;
    readonly runtimeEntryPort: "BaseToolExecutorPort.git.runGit";
    readonly operationRisk: "worktree-management";
    readonly permissionsRequired: readonly ["git:read", "filesystem:read"];
    readonly defaultTimeoutMs: 30000;
    readonly maxTimeoutMs: 600000;
};
export declare function parseGitManageWorktreeResult(providerResult: GitManageWorktreeProviderResult | undefined, target: GitManageWorktreeTarget): GitManageWorktreeEnvelope;
export declare function planGitWorktreeManagement(request?: GitManageWorktreeRequest): GitManageWorktreeResult;
export declare const planManageWorktree: typeof planGitWorktreeManagement;
export declare const planGitManageWorktree: typeof planGitWorktreeManagement;
export declare function executeGitManageWorktree(request?: GitManageWorktreeRequest): Promise<GitManageWorktreeResult>;
