aien-sovereign-core
Autonomous sovereign intelligence engine and runtime core for NVIDIA DGX Spark
Brought by drakestapleton
aien-sovereign-core / crates / aien-cli / src / ui.rs
| 1 | use colored::*; |
| 2 | use std::io::{stdout, Write}; |
| 3 | use crate::telemetry::get_gpu_telemetry; |
| 4 | |
| 5 | pub fn print_banner() { |
| 6 | println!("{}", "╭────────────────────────────────────────────────────────────────────────────╮".cyan().bold()); |
| 7 | println!("{}", "│ ⚡ AIEN • Autonomous Intelligence & Execution Node (NVIDIA DGX Spark) │".cyan().bold()); |
| 8 | println!("{}", "│ Grace Blackwell GB10 • Modular MAX 26.5 • Resident Seat: Port 18006 │".cyan()); |
| 9 | println!("{}", "╰────────────────────────────────────────────────────────────────────────────╯".cyan().bold()); |
| 10 | print_status_bar(); |
| 11 | println!(); |
| 12 | } |
| 13 | |
| 14 | pub fn print_status_bar() { |
| 15 | let gpu = get_gpu_telemetry(); |
| 16 | let used_gb = gpu.used_mb as f64 / 1024.0; |
| 17 | let total_gb = gpu.total_mb as f64 / 1024.0; |
| 18 | |
| 19 | let status = format!( |
| 20 | "[GPU: {}°C | {:.1}/{:.1} GB] • Seat: atlas-lightning-omni (:18006) • Mask: AIEN • Swarm: aien-hive", |
| 21 | gpu.temp_c, used_gb, total_gb |
| 22 | ); |
| 23 | println!("{}", status.black().on_cyan().bold()); |
| 24 | } |
| 25 | |
| 26 | pub fn print_tool_start(tool_name: &str, summary: &str) { |
| 27 | print!("{} {}", "⚙ [Executing:".yellow().bold(), format!("{}({})]...", tool_name, summary).yellow()); |
| 28 | let _ = stdout().flush(); |
| 29 | } |
| 30 | |
| 31 | pub fn print_tool_done(tool_name: &str, elapsed_ms: u128, success: bool) { |
| 32 | if success { |
| 33 | println!("\r{}", format!("✓ [{}] Done ({}ms)", tool_name, elapsed_ms).green().bold()); |
| 34 | } else { |
| 35 | println!("\r{}", format!("✗ [{}] Failed ({}ms)", tool_name, elapsed_ms).red().bold()); |
| 36 | } |
| 37 | let _ = stdout().flush(); |
| 38 | } |
| 39 | |
| 40 | pub fn print_safety_prompt(cmd: &str) -> bool { |
| 41 | println!("\n{}", "⚠ [SAFETY GATE] AIEN requested high-risk operation:".red().bold()); |
| 42 | println!(" {}", cmd.yellow()); |
| 43 | print!("{}", "Do you approve execution? [y/N]: ".bold()); |
| 44 | let _ = stdout().flush(); |
| 45 | |
| 46 | let mut input = String::new(); |
| 47 | if std::io::stdin().read_line(&mut input).is_ok() { |
| 48 | let trimmed = input.trim().to_lowercase(); |
| 49 | return trimmed == "y" || trimmed == "yes"; |
| 50 | } |
| 51 | false |
| 52 | } |