BlueGit

ict rusty-teams

Files

rusty-teams / crates / agents / src / parse / text.rs

text.rs

text.rs 472 B Download Raw
1use super::{RunEvent, truncate};
2
3const STEP_LIMIT: usize = 80;
4
5pub(super) fn parse_line(line: &str, all_output: &mut String) -> Vec<RunEvent> {
6 all_output.push_str(line);
7 all_output.push('\n');
8 let trimmed = line.trim();
9 if trimmed.is_empty() {
10 return Vec::new();
11 }
12 vec![RunEvent::Step(truncate(trimmed, STEP_LIMIT))]
13}
14
15pub(super) fn finish(all_output: &str) -> Vec<RunEvent> {
16 vec![RunEvent::Final(all_output.trim().to_string())]
17}