import type { CodeToolResult } from "../../_shared/baseToolAdapter.js";
export type CodeReadBoundary = "input" | "contract" | "governance" | "scope" | "resource" | "execution" | "provider";
export type CodeReadGate = {
    accepted?: boolean;
    allowed?: boolean;
    reason?: string;
};
export type CodeReadRange = {
    startLine?: number;
    endLine?: number;
};
export type CodeReadTarget = {
    targetPath: string;
    range?: CodeReadRange;
};
export type CodeReadPayload = {
    content: string;
    encoding?: string;
    truncated?: boolean;
};
export type CodeReadProvider = (request: {
    targetPath: string;
    maxBytes: number;
    encoding: string;
    context?: CodeReadContext;
}) => CodeReadPayload | Promise<CodeReadPayload>;
export type CodeReadContext = {
    runtimeId?: string;
    sessionId?: string;
    invocationId?: string;
    dryRun?: boolean;
    guard?: CodeReadGate;
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    workspaceRoot?: string;
    allowedRoots?: readonly string[];
    auditMetadata?: Readonly<Record<string, unknown>>;
};
export type CodeReadRequest = {
    context?: CodeReadContext;
    toolCallId?: string;
    workspaceRoot?: string;
    targetPath?: string;
    targetPaths?: readonly string[];
    targets?: readonly CodeReadTarget[];
    range?: CodeReadRange;
    maxBytes?: number;
    maxBytesPerFile?: number;
    maxTotalBytes?: number;
    encoding?: string;
    includeLineNumbers?: boolean;
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    governance?: CodeReadGate;
    dryRun?: boolean;
    reader?: CodeReadProvider;
    provider?: CodeReadProvider;
    metadata?: Readonly<Record<string, unknown>>;
};
export type CodeReadErrorCode = "INVALID_REQUEST" | "MISSING_TARGET_PATH" | "ABSOLUTE_TARGET_PATH" | "TARGET_PATH_OUTSIDE_SCOPE" | "NUL_BYTE_IN_PATH" | "INVALID_TARGETS" | "INVALID_RANGE" | "INVALID_MAX_BYTES" | "INVALID_ENCODING" | "SCOPE_DENIED" | "GOVERNANCE_REJECTED" | "READER_NOT_INJECTED" | "READER_REJECTED";
export type CodeReadError = {
    code: CodeReadErrorCode;
    message: string;
    boundary: CodeReadBoundary;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type CodeReadAudit = {
    tool: "code.read";
    toolCallId: string;
    targetPath: string;
    targetPaths: readonly string[];
    workspaceRoot?: string;
    requestedScopes: readonly string[];
    acceptedScopes: readonly string[];
    dryRun: boolean;
    unsafeSideEffects: false;
    metadata: Readonly<Record<string, unknown>>;
};
export type CodeReadPlan = {
    kind: "agentCore.basicTool.code.read.plan";
    operation: "read-file-or-code-content";
    targetPath: string;
    targetPaths: readonly string[];
    range?: CodeReadRange;
    maxBytes: number;
    maxBytesPerFile: number;
    maxTotalBytes: number;
    encoding: string;
    includeLineNumbers: boolean;
    dispatch: "dry-run" | "injected-reader";
    readsFileSystemDirectly: false;
};
export type CodeReadFileOutput = {
    targetPath: string;
    content: string;
    encoding: string;
    bytes: number;
    truncated: boolean;
    range?: CodeReadRange;
};
export type CodeReadOutput = {
    kind: "agentCore.basicTool.code.read.output";
    targetPath: string;
    targetPaths: readonly string[];
    content: string;
    files: readonly CodeReadFileOutput[];
    encoding: string;
    bytes: number;
    truncated: boolean;
    unsafeSideEffects: false;
};
export type CodeReadResult = {
    ok: true;
    plan: CodeReadPlan;
    audit: CodeReadAudit;
    output?: CodeReadOutput;
    events: readonly string[];
} | {
    ok: false;
    error: CodeReadError;
    events: readonly string[];
};
export declare const codeReadDescriptor: {
    readonly tool: "code.read";
    readonly toolId: "code.read";
    readonly route: "agent_executionEngine.basic_toolLayer.baseTools.codeBase.explore";
    readonly purpose: "prepare or run a governed file/code read through an injected reader envelope";
    readonly defaultDispatch: "dry-run";
    readonly unsafeSideEffects: false;
    readonly defaultMaxBytesPerFile: number;
    readonly defaultMaxTotalBytes: number;
};
export declare function planCodeRead(request?: unknown): Promise<CodeReadResult>;
export declare function executeCodeRead(request?: CodeReadRequest): Promise<CodeToolResult<CodeReadOutput, CodeReadErrorCode>>;
