import type { BaseToolLspTextEdit } from "../../../../../agentCore/agent_executionEngine/basic_toolLayer/baseTools/baseToolExecutorPort.js";
export type CodeEditGate = {
    accepted?: boolean;
    allowed?: boolean;
    reason?: string;
};
export type CodeEditContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    workspaceRoot?: string;
    allowedRoots?: readonly string[];
    guard?: CodeEditGate;
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type CodeEditReadResult = {
    content: string;
    truncated?: boolean;
    encoding?: string;
};
export type CodeEditWriteResult = {
    bytesWritten: number;
};
export type CodeEditDeleteResult = {
    deleted: boolean;
};
export type CodeEditFormatResult = {
    content: string;
    editsCount: number;
};
export type CodeEditProvider = {
    readText?(request: {
        targetPath: string;
        encoding?: string;
        maxBytes?: number;
        context?: Readonly<Record<string, unknown>>;
    }): Promise<CodeEditReadResult>;
    writeText?(request: {
        targetPath: string;
        content: string;
        encoding?: string;
        context?: Readonly<Record<string, unknown>>;
    }): Promise<CodeEditWriteResult>;
    deletePath?(request: {
        targetPath: string;
        recursive?: boolean;
        context?: Readonly<Record<string, unknown>>;
    }): Promise<CodeEditDeleteResult>;
    formatText?(request: {
        targetPath: string;
        content: string;
        languageHint?: string;
        range?: {
            startLine: number;
            endLine: number;
        };
        options?: {
            tabSize?: number;
            insertSpaces?: boolean;
        };
        context?: Readonly<Record<string, unknown>>;
    }): Promise<CodeEditFormatResult>;
};
export type CodeEditNormalizedPath = {
    ok: true;
    path: string;
} | {
    ok: false;
    code: "MISSING_TARGET_PATH" | "TARGET_OUT_OF_SCOPE";
    message: string;
};
export type CodeEditScopeResult = {
    ok: true;
    acceptedScopes: readonly string[];
} | {
    ok: false;
    code: "SCOPE_DENIED";
    message: string;
};
export declare function isRecord(value: unknown): value is Record<string, unknown>;
export declare function cleanList(values: readonly string[] | undefined): readonly string[];
export declare function byteLength(value: string): number;
export declare function sha256Text(value: string): string;
export declare function normalizeRelativeTargetPath(targetPath: string | undefined, toolId: string): CodeEditNormalizedPath;
export declare function resolveScopes(requestedScopes: readonly string[] | undefined, allowedScopes: readonly string[] | undefined, toolId: string): CodeEditScopeResult;
export declare function shouldDryRun(requestDryRun: boolean | undefined, contextDryRun: boolean | undefined): boolean;
export declare function gateRejected(...gates: readonly (CodeEditGate | undefined)[]): CodeEditGate | undefined;
export declare function hasExecutionApproval(...gates: readonly (CodeEditGate | undefined)[]): boolean;
export declare function providerFailureMessage(toolId: string): string;
export declare function providerUnavailableMessage(toolId: string, capability: string): string;
export declare function replaceOccurrences(content: string, searchText: string, replacementText: string, occurrence: "first" | "all", maxReplacements: number): {
    content: string;
    replacements: number;
};
export declare function deleteLineRange(content: string, range: {
    startLine: number;
    endLine: number;
}): {
    content: string;
    deletedLines: number;
};
export declare function isValidPositiveRange(range: {
    startLine: number;
    endLine: number;
} | undefined): boolean;
export declare function applyLspTextEdits(content: string, edits: readonly BaseToolLspTextEdit[]): string;
