/** * Shared tool result persistence and truncation logic. * * When a tool result exceeds a size threshold, the full content is saved to a * file in /tmp/wave-tool-results/ and the model receives a * preview with the file path so it can use the Read tool to access the full output. */ /** * Get (and create if needed) the tool-results directory. * Uses /tmp/wave-tool-results/ for simplicity and automatic OS cleanup. */ export declare function getToolResultsDir(): string; /** * Persist full tool output to a file in the tool-results directory. * Returns the file path on success, or undefined on failure. */ export declare function persistToolResult(content: string, prefix?: string): string | undefined; /** * Generate a preview from content: first `previewSize` characters with ellipsis. */ export declare function generatePreview(content: string, previewSize?: number): string; /** * Build the wrapper message that the model sees. * * Example output: * * Output too large (150,000 characters). Full output saved to: /tmp/wave-tool-results/mcp_server_tool_12345.txt * Preview (first 2,048 characters): * {preview content} * ... * */ export declare function buildPersistedOutputMessage(totalChars: number, filePath: string, preview: string): string; /** * Process tool result: if content exceeds maxChars, persist to file and return * truncated content with wrapper. Otherwise return unchanged. * * This is the main entry point for both MCP and bash tools. * * @param content - The tool result content * @param maxChars - Maximum characters before persistence kicks in (defaults to DEFAULT_MAX_RESULT_SIZE_CHARS) * @param prefix - File name prefix for the persisted file (e.g. "bash", "mcp") * @returns The content to send to the model (either original or persisted-output wrapper) */ export declare function processToolResult(content: string, maxChars?: number, prefix?: string): string;