summaryrefslogtreecommitdiffstats
path: root/src/ui.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ui.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ui.rs b/src/ui.rs
index 03e8dbe..fe0264b 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -109,7 +109,7 @@ impl<W: Write> Sink for Renderer<W> {
109 } 109 }
110} 110}
111 111
112pub fn tool_line(step: usize, name: &str, args: &serde_json::Value, include_detail: bool) { 112pub fn tool_line(label: &str, name: &str, args: &serde_json::Value, include_detail: bool) {
113 let detail = match name { 113 let detail = match name {
114 "bash" => args 114 "bash" => args
115 .get("cmd") 115 .get("cmd")
@@ -132,7 +132,7 @@ pub fn tool_line(step: usize, name: &str, args: &serde_json::Value, include_deta
132 .unwrap_or("") 132 .unwrap_or("")
133 .to_string(), 133 .to_string(),
134 }; 134 };
135 let head = paint("1;36", &format!("● [{step}] {name}")); 135 let head = paint("1;36", &format!("● [{label}] {name}"));
136 if include_detail && !detail.is_empty() { 136 if include_detail && !detail.is_empty() {
137 println!("{head} {detail}"); 137 println!("{head} {detail}");
138 } else { 138 } else {
@@ -141,13 +141,18 @@ pub fn tool_line(step: usize, name: &str, args: &serde_json::Value, include_deta
141 let _ = std::io::stdout().flush(); 141 let _ = std::io::stdout().flush();
142} 142}
143 143
144pub fn tool_result(summary: &str, aborted: bool) { 144pub fn tool_result(label: &str, summary: &str, aborted: bool) {
145 let text = if aborted { 145 let text = if aborted {
146 "aborted".to_string() 146 "aborted".to_string()
147 } else { 147 } else {
148 crate::provider::truncate(summary.trim(), 100) 148 crate::provider::truncate(summary.trim(), 100)
149 }; 149 };
150 println!(" {} {}", paint("2", "└"), paint("2", &text)); 150 println!(
151 " {} {} {}",
152 paint("2", &format!("[{label}] └")),
153 paint("2", &text),
154 ""
155 );
151 let _ = std::io::stdout().flush(); 156 let _ = std::io::stdout().flush();
152} 157}
153 158