export type GitRebaseBranchPermission = "git:read" | "git:write" | "filesystem:read" | "filesystem:write";
export type GitRebaseBranchGuard = {
    allowed?: boolean;
    accepted?: boolean;
    reason?: string;
};
export type GitRebaseBranchContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: GitRebaseBranchGuard;
    allowedRepositoryRoots?: readonly string[];
    grantedPermissions?: readonly GitRebaseBranchPermission[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type GitRebaseBranchTarget = {
    repositoryPath: string;
    upstreamRef: string;
    branchName?: string;
    ontoRef?: string;
    keepBase: boolean;
    autosquash: boolean;
    interactive: boolean;
};
export type GitRebaseBranchRequest = {
    target?: Partial<GitRebaseBranchTarget>;
    context?: GitRebaseBranchContext;
    provider?: GitRebaseBranchProvider;
    timeoutMs?: number;
    metadata?: Readonly<Record<string, unknown>>;
    runtimeId?: string;
    invocationId?: string;
    repositoryPath?: string;
    upstreamRef?: string;
    upstream?: string;
    branchName?: string;
    branch?: string;
    ref?: string;
    ontoRef?: string;
    onto?: string;
    keepBase?: boolean;
    autosquash?: boolean;
    interactive?: boolean;
    dryRun?: boolean;
};
export type GitRebaseBranchRuntimeEntry = {
    owner: "runtime";
    port: "BaseToolExecutorPort.git.runGit";
    method: "runGit";
    binary: "git";
    argvMode: "fixed-rebase-branch-history-mutation";
    allowedSubcommand: "rebase";
};
export type GitRebaseBranchRisk = {
    category: "history-mutation";
    riskLevel: "risky";
    mutatesRepository: true;
    mutatesWorkingTree: true;
    mutatesIndex: true;
    rewritesHistory: true;
    mayCreateConflicts: true;
    spawnsProcess: true;
    requiresTapApproval: true;
    runtimeOwnsExecution: true;
};
export type GitRebaseBranchEnvelope = {
    parser: "git-rebase-output-v1";
    upstreamRef: string;
    branchName?: string;
    ontoRef?: string;
    keepBase: boolean;
    autosquash: boolean;
    interactive: boolean;
    exitCode?: number;
    stdoutLineCount: number;
    stderrLineCount: number;
    rebaseHint?: string;
    rebaseCompleted: boolean;
    conflictDetected: boolean;
    rebaseStopped: boolean;
};
export type GitRebaseBranchOutput = {
    kind: "agentCore.basicTool.git.rebaseBranch";
    target: GitRebaseBranchTarget;
    runtimeEntry: GitRebaseBranchRuntimeEntry;
    risk: GitRebaseBranchRisk;
    gitArgs: readonly string[];
    commandPreview: readonly string[];
    timeoutMs: number;
    dryRun: boolean;
    executionBlocked: boolean;
    providerCalled: boolean;
    exitCode?: number;
    stdout?: string;
    stderr?: string;
    permissionsRequired: readonly GitRebaseBranchPermission[];
    unsafeSideEffects: true;
    rebasesBranch: true;
    resultEnvelope: GitRebaseBranchEnvelope;
};
export type GitRebaseBranchPlan = {
    toolId: "git.rebaseBranch";
    toolKind: "git.rebaseBranch";
    capability: "rebase-branch";
    runtimeId: string;
    invocationId: string;
    repositoryPath: string;
    upstreamRef: string;
    branchName?: string;
    ontoRef?: string;
    keepBase: boolean;
    autosquash: boolean;
    interactive: boolean;
    gitArgs: readonly string[];
    commandPreview: readonly string[];
    requiredPermissions: readonly GitRebaseBranchPermission[];
    runtimeEntry: GitRebaseBranchRuntimeEntry;
    risk: GitRebaseBranchRisk;
    dispatch: "dry-run" | "runtime-git-executor";
    dryRun: boolean;
    wouldMutateWorkingTree: true;
    wouldMutateIndex: true;
    wouldRewriteHistory: true;
    unsafeSideEffects: true;
    outputEnvelope: {
        stdoutPreview: "";
        stderrPreview: "";
        parsed: false;
    };
    audit: {
        guard: "git-rebase-runtime-guard";
        event: "basicTool.git.rebaseBranch.planned";
        governanceRequired: true;
        tapCanWrap: true;
        metadata: Readonly<Record<string, unknown>>;
    };
};
export type GitRebaseBranchErrorBoundary = "input" | "scope" | "permission" | "governance" | "provider";
export type GitRebaseBranchErrorCode = "MISSING_REPOSITORY_PATH" | "MISSING_UPSTREAM_REF" | "INVALID_ARGUMENT" | "INVALID_CONTEXT" | "UNSAFE_REF" | "INVALID_TIMEOUT" | "SCOPE_REJECTED" | "PERMISSION_DENIED" | "GOVERNANCE_REJECTED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_REJECTED";
export type GitRebaseBranchError = {
    code: GitRebaseBranchErrorCode;
    message: string;
    boundary: GitRebaseBranchErrorBoundary;
    publicSafe: true;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type GitRebaseBranchAuditEvent = {
    type: string;
    toolId: "git.rebaseBranch";
    invocationId: string;
    dryRun: boolean;
    repositoryPath?: string;
    metadata: Readonly<Record<string, unknown>>;
};
export type GitRebaseBranchResult = {
    ok: true;
    toolId: "git.rebaseBranch";
    output: GitRebaseBranchOutput;
    plan: GitRebaseBranchPlan;
    audit: readonly GitRebaseBranchAuditEvent[];
    events: readonly string[];
} | {
    ok: false;
    toolId: "git.rebaseBranch";
    error: GitRebaseBranchError;
    audit: readonly GitRebaseBranchAuditEvent[];
    events: readonly string[];
};
export type GitRebaseBranchProviderRequest = {
    repositoryPath: string;
    args: readonly string[];
    timeoutMs?: number;
};
export type GitRebaseBranchProviderResult = {
    exitCode: number;
    stdout: string;
    stderr: string;
};
export type GitRebaseBranchProvider = (request: GitRebaseBranchProviderRequest, context: GitRebaseBranchContext) => GitRebaseBranchProviderResult | Promise<GitRebaseBranchProviderResult>;
export declare const gitRebaseBranchDescriptor: {
    readonly toolId: "git.rebaseBranch";
    readonly toolKind: "git.rebaseBranch";
    readonly capability: "rebase-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 parseGitRebaseBranchResult(providerResult: GitRebaseBranchProviderResult | undefined, target: GitRebaseBranchTarget): GitRebaseBranchEnvelope;
export declare function planGitBranchRebase(request?: GitRebaseBranchRequest): GitRebaseBranchResult;
export declare const planGitRebaseBranch: typeof planGitBranchRebase;
export declare function executeGitRebaseBranch(request?: GitRebaseBranchRequest): Promise<GitRebaseBranchResult>;
