/** * ToolFormatter - Clean, structured formatting for tool calls and results * * Uses a clean, hierarchical format: * ● ToolName(params) * ⎿ Result summary * Line-wrapped details with proper indentation * * Design principles: * - Bullet (●) for tool actions * - Tree connector (⎿) for results * - Automatic line wrapping at 80 chars * - Diff display for file edits with line numbers * - Clean, copy-paste friendly output * * @module ToolFormatter */ import type { ParsedDiff, DiffChunk as CoreDiffChunk, DiffLine as CoreDiffLine } from '@nexus-cortex/core'; export type DiffContent = ParsedDiff; export type DiffChunk = CoreDiffChunk; export type DiffLine = CoreDiffLine; export { parseUnifiedDiff, generateAndParseDiff } from '@nexus-cortex/core'; export interface ToolCall { name: string; params?: Record; } export interface ToolResult { summary?: string; details?: string; diff?: DiffContent; error?: string; } export interface FileContent { file: string; content: string; lineCount: number; preview?: boolean; } /** * ToolFormatter - Formats tool calls and results in a clean, structured way */ export declare class ToolFormatter { private theme; constructor(); /** * Get current terminal width (or fallback to 80) */ private getTerminalWidth; /** * Formats a tool call header * * Format: ● ToolName(param1, param2) */ formatToolCall(tool: ToolCall): string; /** * Formats a tool result * * Format: * ⎿ Summary text * Additional details wrapped at 80 chars */ formatToolResult(result: ToolResult): string; /** * Formats an error result */ private formatError; /** * Formats tool parameters for display */ private formatParams; /** * Wraps text to fit within max width */ private wrapText; /** * Formats a file diff with line numbers and +/- indicators * New style with box drawing characters and line numbers on left * Optionally includes "Edit file" header */ formatDiff(diff: DiffContent, showEditHeader?: boolean): string; /** * Formats a single diff line with new style (no background, cleaner) */ private formatDiffLineNew; /** * Formats file content preview with line numbers * Matches WritePreview component style: "+ Creating filename (N lines, X KB) [language]" */ formatFileContent(fileContent: FileContent): string; /** * Wrap code line to fit width, breaking at logical points */ private wrapCodeLine; /** * Formats a simple status line * * Format: * ⎿ Read 15 lines * ⎿ Found 1 file (ctrl+o to expand) */ formatStatus(message: string): string; } //# sourceMappingURL=ToolFormatter.d.ts.map