import type { ContentBlock, McpSettings } from "./types.ts"; export declare const DEFAULT_MCP_OUTPUT_MAX_BYTES: number; export declare const DEFAULT_MCP_OUTPUT_MAX_LINES = 2000; export declare const DEFAULT_MCP_DETAILS_MAX_BYTES: number; export interface McpOutputGuardDetails { truncated: true; originalBytes: number; returnedBytes: number; originalLines: number; returnedLines: number; /** Number of image content blocks returned untouched alongside the truncated text. */ imageBlocksPassedThrough?: number; fullOutputPath?: string; writeError?: string; } export interface McpResultSummary { omitted: true; reason: string; isError: boolean; contentBlocks: number; contentSummary: Array>; structuredContent?: Record; meta?: Record; extraFields?: Array>; rawResultBytes: number; fullResultPath?: string; resultWriteError?: string; } export interface McpOutputGuardOptions { enabled?: boolean; prefix?: string; suffix?: string; emptyTextFallback?: string; maxBytes?: number; maxLines?: number; detailsMaxBytes?: number; /** * Raw MCP result to expose as details.mcpResult. Kept raw when its JSON * fits detailsMaxBytes (or when the guard is disabled); otherwise replaced * with a compact summary and spilled to a temp file. Omit for call sites * whose details never carried the raw result (e.g. direct tools). */ rawMcpResult?: unknown; } export interface GuardedMcpOutput { content: ContentBlock[]; outputGuard?: McpOutputGuardDetails; mcpResult?: unknown; } export declare function resolveMcpOutputGuardOptions(settings?: McpSettings): Pick; /** Spread helper for tool-result details: includes mcpResult/outputGuard only when present. */ export declare function guardedMcpDetails(guarded: GuardedMcpOutput): Record; /** * Bound model-facing MCP output. Text output is capped at maxBytes/maxLines and * spilled to a temp file when oversized. Image blocks pass through untouched — * they are delivered to the provider as native image content, not text context. */ export declare function guardMcpOutput(content: ContentBlock[], options?: McpOutputGuardOptions): Promise;