/**
 * Tool-call log entry construction — shared by the Anthropic and OpenAI loops.
 *
 * Both backends record every tool invocation in a `ToolCallEntry[]` that the
 * provider exposes as `metadata.toolCalls`. Centralizing entry construction
 * keeps error capture consistent: a failed call records a structured `error`
 * (and `errorCode` when the thrown error carried a JSON-RPC code) rather than
 * encoding the failure only inside the `output` string.
 */
import type { BoundedToolOutput } from "./tool-output-bound.js";
import type { ToolCallEntry, ToolCallTiming } from "./types.js";
/**
 * Build a log entry for a completed tool call.
 *
 * `output` is the (possibly truncated) content the model actually saw. `error`
 * is set when the MCP server returned an `isError` result — the error text
 * lives in `output`, and recording it on `error` lets assertions and telemetry
 * read it without re-parsing the output. When `bound.truncated` is set, the
 * entry records that the model saw a truncated copy plus the original size, so
 * a degraded run is distinguishable from a clean one.
 */
export declare function toolResultEntry(name: string, input: unknown, output: string, error: string | undefined, bound?: BoundedToolOutput, timing?: ToolCallTiming): ToolCallEntry;
/**
 * Bound a tool result, record it, and return the content to feed back to the
 * model. Shared by every tool-loop backend so the context-window guard is
 * transport-agnostic: the raw content is capped at `maxOutputChars`, the
 * (possibly truncated) copy is appended to `log`, and a truncation is logged
 * to stderr so a degraded run is visible. Returns the bounded content.
 */
export declare function recordBoundedToolResult(log: ToolCallEntry[], name: string, input: unknown, rawContent: string, error: string | undefined, maxOutputChars: number | undefined, timing?: ToolCallTiming): string;
/**
 * Build a log entry for a tool call that threw before returning a result
 * (transport failure, protocol error). MCP `McpError`s carry a numeric
 * JSON-RPC `code` (e.g. `-32602`); capture it as `errorCode` when present.
 */
export declare function toolErrorEntry(name: string, input: unknown, err: unknown, timing?: ToolCallTiming): ToolCallEntry;
