import type { CodeToolResult } from "../../_shared/baseToolAdapter.js";
import { type CodeEditContext, type CodeEditGate, type CodeEditProvider } from "../_shared/editCore.js";
export type CodeFormatBoundary = "input" | "contract" | "governance" | "scope" | "provider";
export type CodeFormatGate = CodeEditGate & {
    accepted: boolean;
    reason?: string;
};
export type CodeFormatRange = {
    startLine: number;
    endLine: number;
};
export type CodeFormatRequest = {
    workspaceRoot?: string;
    targetPath?: string;
    languageHint?: string;
    formatterId?: string;
    range?: CodeFormatRange;
    options?: {
        tabSize?: number;
        insertSpaces?: boolean;
    };
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    dryRun?: boolean;
    contract?: CodeFormatGate;
    governance?: CodeFormatGate;
    guard?: CodeEditGate;
    context?: CodeEditContext;
    provider?: CodeFormatProvider;
    formatter?: CodeFormatProvider;
    metadata?: Readonly<Record<string, unknown>>;
};
export type CodeFormatProvider = Pick<CodeEditProvider, "readText" | "writeText" | "formatText">;
export type CodeFormatErrorCode = "MISSING_WORKSPACE_ROOT" | "MISSING_TARGET_PATH" | "TARGET_OUT_OF_SCOPE" | "INVALID_FORMAT_RANGE" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "SCOPE_DENIED" | "REAL_SIDE_EFFECT_NOT_ALLOWED" | "APPROVAL_REQUIRED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_FAILURE";
export type CodeFormatError = {
    code: CodeFormatErrorCode;
    message: string;
    boundary: CodeFormatBoundary;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type CodeFormatPlan = {
    tool: "code.format";
    capability: "format-code";
    workspaceRoot: string;
    targetPath: string;
    languageHint?: string;
    formatterId: string;
    range?: CodeFormatRange;
    requiredPermission: "filesystem:readwrite";
    requiresTapApproval: true;
    dispatch: "dry-run";
    dryRun: true;
    wouldFormat: true;
    unsafeSideEffects: false;
    acceptedScopes: readonly string[];
    audit: {
        guard: "target-scope-and-formatter-selection";
        event: "basicTool.code.format.planned";
        metadata: Readonly<Record<string, unknown>>;
    };
};
export type CodeFormatOutput = {
    kind: "agentCore.basicTool.code.format.output";
    targetPath: string;
    languageHint?: string;
    formatterId: string;
    range?: CodeFormatRange;
    beforeBytes: number;
    afterBytes: number;
    editsCount: number;
    bytesWritten: number;
    changed: boolean;
    applied: boolean;
    dryRun: boolean;
    unsafeSideEffects: false;
};
export type CodeFormatResult = {
    ok: true;
    plan: CodeFormatPlan;
    events: readonly string[];
} | {
    ok: false;
    error: CodeFormatError;
    events: readonly string[];
};
export declare const codeFormatDescriptor: {
    readonly tool: "code.format";
    readonly capability: "format-code";
    readonly layer: "agent_executionEngine.basic_toolLayer.baseTools.codeBase.edit";
    readonly defaultDispatch: "dry-run";
    readonly requiresTapApproval: true;
    readonly unsafeSideEffects: false;
};
export declare function planCodeFormat(request?: CodeFormatRequest): CodeFormatResult;
export declare function executeCodeFormat(request?: CodeFormatRequest): Promise<CodeToolResult<CodeFormatOutput, CodeFormatErrorCode>>;
