diff --git a/src/agent/Cargo.lock b/src/agent/Cargo.lock index ad9e2e47cb..dd7d1c2e9b 100644 --- a/src/agent/Cargo.lock +++ b/src/agent/Cargo.lock @@ -680,22 +680,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "crossterm" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" -dependencies = [ - "bitflags", - "crossterm_winapi", - "libc", - "mio 0.8.5", - "parking_lot 0.12.1", - "signal-hook", - "signal-hook-mio", - "winapi 0.3.9", -] - [[package]] name = "crossterm" version = "0.26.1" @@ -2327,7 +2311,7 @@ dependencies = [ "clap", "cobertura", "coverage", - "crossterm 0.26.1", + "crossterm", "env_logger", "flexi_logger", "flume", @@ -2342,6 +2326,7 @@ dependencies = [ "onefuzz-telemetry", "path-absolutize", "pretty_assertions", + "ratatui", "regex", "reqwest", "reqwest-retry", @@ -2356,7 +2341,6 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util 0.7.7", - "tui", "url", "uuid", ] @@ -2851,6 +2835,19 @@ dependencies = [ "smallvec", ] +[[package]] +name = "ratatui" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce841e0486e7c2412c3740168ede33adeba8e154a15107b879d8162d77c7174e" +dependencies = [ + "bitflags", + "cassowary", + "crossterm", + "unicode-segmentation", + "unicode-width", +] + [[package]] name = "rayon" version = "1.7.0" @@ -3744,19 +3741,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "tui" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccdd26cbd674007e649a272da4475fb666d3aa0ad0531da7136db6fab0e5bad1" -dependencies = [ - "bitflags", - "cassowary", - "crossterm 0.25.0", - "unicode-segmentation", - "unicode-width", -] - [[package]] name = "typenum" version = "1.14.0" @@ -3786,9 +3770,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" diff --git a/src/agent/onefuzz-task/Cargo.toml b/src/agent/onefuzz-task/Cargo.toml index b511cc7fce..4a6145496d 100644 --- a/src/agent/onefuzz-task/Cargo.toml +++ b/src/agent/onefuzz-task/Cargo.toml @@ -48,7 +48,7 @@ thiserror = "1.0" tokio = { version = "1.28", features = ["full"] } tokio-util = { version = "0.7", features = ["full"] } tokio-stream = "0.1" -tui = { version = "0.19", default-features = false, features = ['crossterm'] } +tui = { package = "ratatui", version = "0.21.0", default-features = false, features = ['crossterm']} url = { version = "2.3", features = ["serde"] } uuid = { version = "1.3", features = ["serde", "v4"] } chrono = { version = "0.4", default-features = false, features = [ diff --git a/src/agent/onefuzz-task/src/local/common.rs b/src/agent/onefuzz-task/src/local/common.rs index 98ecc149ad..6387f9839c 100644 --- a/src/agent/onefuzz-task/src/local/common.rs +++ b/src/agent/onefuzz-task/src/local/common.rs @@ -22,7 +22,6 @@ use crate::tasks::config::CommonConfig; use crate::tasks::utils::parse_key_value; pub const SETUP_DIR: &str = "setup_dir"; -pub const EXTRA_DIR: &str = "extra_dir"; pub const INPUTS_DIR: &str = "inputs_dir"; pub const CRASHES_DIR: &str = "crashes_dir"; pub const TARGET_WORKERS: &str = "target_workers"; @@ -238,7 +237,7 @@ pub async fn build_local_context( }); let instance_id = get_uuid("instance_id", args).unwrap_or_default(); - let extra_dir = args.get_one::(EXTRA_DIR).cloned(); + // let extra_dir = args.get_one::(EXTRA_DIR).cloned(); let setup_dir = if let Some(setup_dir) = args.get_one::(SETUP_DIR) { setup_dir.clone() } else if let Some(target_exe) = args.get_one::(TARGET_EXE) { @@ -255,7 +254,7 @@ pub async fn build_local_context( task_id, instance_id, setup_dir, - extra_dir, + extra_dir: None, machine_identity: MachineIdentity { machine_id: Uuid::nil(), machine_name: "local".to_string(), diff --git a/src/agent/onefuzz-task/src/local/tui.rs b/src/agent/onefuzz-task/src/local/tui.rs index 0e290cd025..df639e189e 100644 --- a/src/agent/onefuzz-task/src/local/tui.rs +++ b/src/agent/onefuzz-task/src/local/tui.rs @@ -31,7 +31,7 @@ use tui::{ backend::CrosstermBackend, layout::{Alignment, Constraint, Corner, Direction, Layout}, style::{Color, Modifier, Style}, - text::{Span, Spans}, + text::{Line, Span}, widgets::{Block, Borders}, widgets::{Gauge, List, ListItem, ListState, Paragraph, Wrap}, Terminal, @@ -354,7 +354,7 @@ impl TerminalUi { stats_spans.pop(); } - Paragraph::new(Spans::from(stats_spans)) + Paragraph::new(Line::from(stats_spans)) .style(Style::default()) .alignment(Alignment::Left) .wrap(Wrap { trim: true }) @@ -390,7 +390,7 @@ impl TerminalUi { files_spans.pop(); } // removing the last "," - Paragraph::new(Spans::from(files_spans)) + Paragraph::new(Line::from(files_spans)) .style(Style::default()) .alignment(Alignment::Left) .wrap(Wrap { trim: true }) @@ -408,7 +408,7 @@ impl TerminalUi { Level::Trace => Style::default(), }; - ListItem::new(Spans::from(vec![ + ListItem::new(Line::from(vec![ Span::styled(format!("{level:<9}"), style), Span::raw(" "), Span::raw(log),