export type GitMergeBranchPermission = "git:read" | "git:write" | "filesystem:read" | "filesystem:write";
export type GitMergeBranchMode = "default" | "ff-only" | "no-ff" | "squash";
export type GitMergeBranchGuard = {
    allowed?: boolean;
    accepted?: boolean;
    reason?: string;
};
export type GitMergeBranchContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: GitMergeBranchGuard;
    allowedRepositoryRoots?: readonly string[];
    grantedPermissions?: readonly GitMergeBranchPermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type GitMergeBranchTarget = {
    repositoryPath: string;
    sourceBranch: string;
    mode: GitMergeBranchMode;
    commitMessage?: string;
    noCommit: boolean;
    allowUnrelatedHistories: boolean;
};
export type GitMergeBranchRequest = {
    target?: Partial<GitMergeBranchTarget>;
    context?: GitMergeBranchContext;
    provider?: GitMergeBranchProvider;
    timeoutMs?: number;
    metadata?: Readonly<Record<string, unknown>>;
    runtimeId?: string;
    invocationId?: string;
    repositoryPath?: string;
    sourceBranch?: string;
    branchName?: string;
    ref?: string;
    mode?: GitMergeBranchMode;
    commitMessage?: string;
    message?: string;
    noCommit?: boolean;
    allowUnrelatedHistories?: boolean;
    dryRun?: boolean;
};
export type GitMergeBranchRuntimeEntry = {
    owner: "runtime";
    port: "BaseToolExecutorPort.git.runGit";
    method: "runGit";
    binary: "git";
    argvMode: "fixed-merge-branch-history-mutation";
    allowedSubcommand: "merge";
};
export type GitMergeBranchRisk = {
    category: "history-mutation";
    riskLevel: "risky";
    mutatesRepository: true;
    mutatesWorkingTree: true;
    mutatesIndex: true;
    mayCreateCommit: boolean;
    mayCreateConflicts: true;
    spawnsProcess: true;
    requiresTapApproval: true;
    runtimeOwnsExecution: true;
};
export type GitMergeBranchEnvelope = {
    parser: "git-merge-output-v1";
    sourceBranch: string;
    mode: GitMergeBranchMode;
    noCommit: boolean;
    allowUnrelatedHistories: boolean;
    exitCode?: number;
    stdoutLineCount: number;
    stderrLineCount: number;
    mergeHint?: string;
    fastForward: boolean;
    conflictDetected: boolean;
    mergeCommitCreated: boolean;
};
export type GitMergeBranchOutput = {
    kind: "agentCore.basicTool.git.mergeBranch";
    target: GitMergeBranchTarget;
    runtimeEntry: GitMergeBranchRuntimeEntry;
    risk: GitMergeBranchRisk;
    gitArgs: readonly string[];
    commandPreview: readonly string[];
    timeoutMs: number;
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled: boolean;
    exitCode?: number;
    stdout?: string;
    stderr?: string;
    permissionsRequired: readonly GitMergeBranchPermission[];
    unsafeSideEffects: true;
    mergesBranch: true;
    resultEnvelope: GitMergeBranchEnvelope;
};
export type GitMergeBranchPlan = {
    toolId: "git.mergeBranch";
    toolKind: "git.mergeBranch";
    capability: "merge-branch";
    runtimeId: string;
    invocationId: string;
    repositoryPath: string;
    sourceBranch: string;
    mode: GitMergeBranchMode;
    commitMessage?: string;
    noCommit: boolean;
    allowUnrelatedHistories: boolean;
    gitArgs: readonly string[];
    commandPreview: readonly string[];
    requiredPermissions: readonly GitMergeBranchPermission[];
    runtimeEntry: GitMergeBranchRuntimeEntry;
    risk: GitMergeBranchRisk;
    dispatch: "dry-run" | "runtime-git-executor";
    dryRun: boolean;
    wouldMutateWorkingTree: true;
    wouldMutateIndex: true;
    unsafeSideEffects: true;
    outputEnvelope: {
        stdoutPreview: "";
        stderrPreview: "";
        parsed: false;
    };
    audit: {
        guard: "git-merge-runtime-guard";
        event: "basicTool.git.mergeBranch.planned";
        governanceRequired: true;
        tapCanWrap: true;
        metadata: Readonly<Record<string, unknown>>;
    };
};
export type GitMergeBranchErrorBoundary = "input" | "scope" | "permission" | "governance" | "provider";
export type GitMergeBranchErrorCode = "MISSING_REPOSITORY_PATH" | "MISSING_BRANCH_NAME" | "INVALID_ARGUMENT" | "INVALID_CONTEXT" | "UNSAFE_BRANCH_REF" | "INVALID_TIMEOUT" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "GOVERNANCE_REJECTED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED";
export type GitMergeBranchError = {
    code: GitMergeBranchErrorCode;
    message: string;
    boundary: GitMergeBranchErrorBoundary;
    publicSafe: true;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type GitMergeBranchAuditEvent = {
    type: string;
    toolId: "git.mergeBranch";
    invocationId: string;
    dryRun: boolean;
    repositoryPath?: string;
    metadata: Readonly<Record<string, unknown>>;
};
export type GitMergeBranchResult = {
    ok: true;
    toolId: "git.mergeBranch";
    output: GitMergeBranchOutput;
    plan: GitMergeBranchPlan;
    audit: readonly GitMergeBranchAuditEvent[];
    events: readonly string[];
} | {
    ok: false;
    toolId: "git.mergeBranch";
    error: GitMergeBranchError;
    audit: readonly GitMergeBranchAuditEvent[];
    events: readonly string[];
};
export type GitMergeBranchProviderRequest = {
    repositoryPath: string;
    args: readonly string[];
    timeoutMs?: number;
};
export type GitMergeBranchProviderResult = {
    exitCode: number;
    stdout: string;
    stderr: string;
};
export type GitMergeBranchProvider = (request: GitMergeBranchProviderRequest, context: GitMergeBranchContext) => GitMergeBranchProviderResult | Promise<GitMergeBranchProviderResult>;
export declare const gitMergeBranchDescriptor: {
    readonly toolId: "git.mergeBranch";
    readonly toolKind: "git.mergeBranch";
    readonly capability: "merge-branch";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.gitBase.branch";
    readonly defaultDryRun: true;
    readonly defaultDispatch: "dry-run";
    readonly tapOwnsApproval: true;
    readonly requiresTapApproval: true;
    readonly runtimeEntryPort: "BaseToolExecutorPort.git.runGit";
    readonly operationRisk: "history-mutation";
    readonly permissionsRequired: readonly ["git:read", "git:write", "filesystem:read", "filesystem:write"];
    readonly defaultTimeoutMs: 30000;
    readonly maxTimeoutMs: 600000;
    readonly unsafeSideEffects: true;
};
export declare function parseGitMergeBranchResult(providerResult: GitMergeBranchProviderResult | undefined, target: GitMergeBranchTarget): GitMergeBranchEnvelope;
export declare function planGitBranchMerge(request?: GitMergeBranchRequest): GitMergeBranchResult;
export declare const planGitMergeBranch: typeof planGitBranchMerge;
export declare function executeGitMergeBranch(request?: GitMergeBranchRequest): Promise<GitMergeBranchResult>;
