/** * Format tool results for the model context (not the UI spool). * * Philosophy: * - Full bodies stay on disk (artifact / job logs). Never invent "empty". * - Default: honest head+tail size cap — no keyword-rank "generic reduce". * - Optional structured polish only for known scanners (nmap/ffuf/…) that * extract findings; noise should already be filtered at the command. * - Long work → background job + live file; point at path, use shell.tail. */ import type { ToolCall, ToolResult } from "../types.js"; export declare function saveToolOutput(call: ToolCall, output: string): Promise; /** * Truncate long tool output for the model. When `preferErrors` is set (failed * commands), keep error-bearing lines and a heavy tail so stack traces survive. * Never ranks by CVE/port keywords (that was genericReducer — removed). */ export declare function summarizeOutput(output: string, maxChars?: number, opts?: { preferErrors?: boolean; }): { text: string; truncated: boolean; }; export declare function summarizeFetchOutput(output: string, maxChars: number, opts?: { preferErrors?: boolean; }): { text: string; truncated: boolean; }; /** One-line failure cue prepended when a tool returns ok=false. */ export declare function failureSummaryLine(result: { ok: boolean; exitCode?: number | undefined; output?: string | undefined; }): string | undefined; /** Legacy hard ceiling; effective cap comes from reliability policy (E2). */ export declare const PASSTHROUGH_CAP_CHARS_LEGACY = 400000; /** Effective default model-context cap for tool bodies (E2). */ export declare function fsPassthroughCapChars(): number; export declare function formatToolContext(call: ToolCall, result: ToolResult): string;