feat: add compact styled output for TODO tools

TODO tools (todo_read, todo_write) now display with a cleaner, more
compact format:

- Styled header: " ● todo_read" or " ● todo_write"
- Tree-style prefixes for content lines (│ and └)
- Checkbox conversion: "- [ ]" → □, "- [x]" → ■
- Dimmed content for visual distinction
- No timing footer (cleaner output)

Changes:
- Add print_todo_compact() method to UiWriter trait
- Implement print_todo_compact() in ConsoleUiWriter
- Update todo.rs to call print_todo_compact() instead of line-by-line output
- Skip tool header, output header, and timing for TODO tools in agent streaming
This commit is contained in:
Dhanji R. Prasanna
2026-01-13 10:58:55 +05:30
parent 4c36cc058c
commit 8dcb7a3dba
4 changed files with 92 additions and 31 deletions

View File

@@ -46,6 +46,15 @@ pub trait UiWriter: Send + Sync {
false
}
/// Print a compact TODO tool output with styled content
/// Format: " ● todo_read" header, then styled content lines, no timing
/// content: None for empty, Some(content) for TODO content
/// is_write: true for todo_write, false for todo_read
/// Returns true if handled, false to fall back to normal format
fn print_todo_compact(&self, _content: Option<&str>, _is_write: bool) -> bool {
false
}
/// Print tool execution timing
fn print_tool_timing(&self, duration_str: &str, tokens_delta: u32, context_percentage: f32);