diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-15 17:16:08 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-15 17:16:08 +0100 |
| commit | 14e56289391ea95b493c2a20c87f8d88047aa051 (patch) | |
| tree | d0acf1cc35369688d92c781e31fb7afc30c38b7a /src/ui.rs | |
| parent | 0.5.3: session locking, UTF-8 and size guards for edit, correct character widths (diff) | |
| download | agent686-14e56289391ea95b493c2a20c87f8d88047aa051.tar.gz agent686-14e56289391ea95b493c2a20c87f8d88047aa051.zip | |
0.6.0: transcript viewer, turn summary, yolo floor, model/version records
- --show renders a session without locking it
- status line summarises writes, commands and denials per turn
- sessions record harness version; model switches are appended and listed
- --yolo refuses $HOME and / unless AGENT686_ALLOW_HOME=1
Diffstat (limited to 'src/ui.rs')
| -rw-r--r-- | src/ui.rs | 26 |
1 files changed, 25 insertions, 1 deletions
| @@ -150,7 +150,14 @@ pub fn tool_result(summary: &str, aborted: bool) { | |||
| 150 | let _ = std::io::stdout().flush(); | 150 | let _ = std::io::stdout().flush(); |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | pub fn status(steps: usize, elapsed: Duration, outcome: &Outcome) { | 153 | #[derive(Debug, Default, Clone, Copy)] |
| 154 | pub struct Summary { | ||
| 155 | pub writes: usize, | ||
| 156 | pub commands: usize, | ||
| 157 | pub denied: usize, | ||
| 158 | } | ||
| 159 | |||
| 160 | pub fn status(steps: usize, elapsed: Duration, outcome: &Outcome, summary: &Summary) { | ||
| 154 | let mut parts = vec![ | 161 | let mut parts = vec![ |
| 155 | if steps == 1 { | 162 | if steps == 1 { |
| 156 | "1 step".to_string() | 163 | "1 step".to_string() |
| @@ -159,6 +166,23 @@ pub fn status(steps: usize, elapsed: Duration, outcome: &Outcome) { | |||
| 159 | }, | 166 | }, |
| 160 | format!("{:.1}s", elapsed.as_secs_f64()), | 167 | format!("{:.1}s", elapsed.as_secs_f64()), |
| 161 | ]; | 168 | ]; |
| 169 | if summary.writes > 0 { | ||
| 170 | parts.push(format!( | ||
| 171 | "{} write{}", | ||
| 172 | summary.writes, | ||
| 173 | if summary.writes == 1 { "" } else { "s" } | ||
| 174 | )); | ||
| 175 | } | ||
| 176 | if summary.commands > 0 { | ||
| 177 | parts.push(format!( | ||
| 178 | "{} command{}", | ||
| 179 | summary.commands, | ||
| 180 | if summary.commands == 1 { "" } else { "s" } | ||
| 181 | )); | ||
| 182 | } | ||
| 183 | if summary.denied > 0 { | ||
| 184 | parts.push(format!("{} denied", summary.denied)); | ||
| 185 | } | ||
| 162 | let (input, output) = outcome.tokens(); | 186 | let (input, output) = outcome.tokens(); |
| 163 | if let (Some(i), Some(o)) = (input, output) { | 187 | if let (Some(i), Some(o)) = (input, output) { |
| 164 | parts.push(format!("{i} in · {o} out")); | 188 | parts.push(format!("{i} in · {o} out")); |
