v0.2.13 : prompt avec emojis colores — 🗂️ repertoire, 🤖 catalogue, 🌐 externes, 📊 geres, ⚡ duree de la derniere commande, ⏲ session
This commit is contained in:
Generated
+1
-1
@@ -21,7 +21,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "agent-manager"
|
||||
version = "0.2.12"
|
||||
version = "0.2.13"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "agent-manager"
|
||||
version = "0.2.12"
|
||||
version = "0.2.13"
|
||||
edition = "2021"
|
||||
description = "Manage local AI coding agents: list, install, start, stop, update — with automatic dependency handling and a YAML-driven catalog."
|
||||
license = "MIT"
|
||||
|
||||
+35
-22
@@ -474,26 +474,39 @@ pub fn banner(app: &App, session: &ShellSession, session_id: &str) -> String {
|
||||
text
|
||||
}
|
||||
|
||||
/// One-line status shown before every prompt (Hermes-style status bar).
|
||||
/// The second parameter is the duration of the previous command (None before
|
||||
/// Color an emoji glyph (style names: green, blue, yellow, cyan).
|
||||
fn emoji(glyph: &str, style: &str, color: bool) -> String {
|
||||
if !color {
|
||||
return glyph.to_string();
|
||||
}
|
||||
match style {
|
||||
"green" => glyph.green().to_string(),
|
||||
"blue" => glyph.blue().to_string(),
|
||||
"yellow" => glyph.yellow().to_string(),
|
||||
"cyan" => glyph.cyan().to_string(),
|
||||
_ => glyph.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
/// One-line status shown before every prompt, with colored emojis:
|
||||
/// ⚙ am v0.2.13 │ 🗂️ cwd │ 73 🤖 · 12 🌐 · 0 📊 │ ⚡ 97ms │ ⏲ 32s
|
||||
/// The last parameter is the duration of the previous command (None before
|
||||
/// the first one).
|
||||
fn print_status(app: &App, session: &ShellSession, started: Instant, last: Option<Duration>) {
|
||||
fn print_status(app: &App, started: Instant, last: Option<Duration>) {
|
||||
let color = app.color();
|
||||
let sep = dim(" │ ", color);
|
||||
let cwd = shorten_head(¤t_dir_string(), 26);
|
||||
let shell_part = format!(
|
||||
"{} {}",
|
||||
bold_cyan(session.current.name, color),
|
||||
dim(&cwd, color)
|
||||
);
|
||||
let counts = dim(
|
||||
&format!(
|
||||
"{} agents · {} external · {} managed",
|
||||
agent_count(app),
|
||||
external_count(app),
|
||||
installed_count(app)
|
||||
),
|
||||
color,
|
||||
let cwd = shorten_head(¤t_dir_string(), 30);
|
||||
let folder = format!("{} {}", emoji("🗂️", "cyan", color), dim(&cwd, color));
|
||||
let counts = format!(
|
||||
"{} {} {} {} {} {} {} {}",
|
||||
dim(&agent_count(app).to_string(), color),
|
||||
emoji("🤖", "green", color),
|
||||
dim("·", color),
|
||||
dim(&external_count(app).to_string(), color),
|
||||
emoji("🌐", "blue", color),
|
||||
dim("·", color),
|
||||
dim(&installed_count(app).to_string(), color),
|
||||
emoji("📊", "yellow", color),
|
||||
);
|
||||
let last_text = match last {
|
||||
Some(d) if d.as_secs() >= 1 => format_elapsed(d),
|
||||
@@ -501,10 +514,10 @@ fn print_status(app: &App, session: &ShellSession, started: Instant, last: Optio
|
||||
Some(d) => format!("{}µs", d.as_micros()),
|
||||
None => "—".to_string(),
|
||||
};
|
||||
let last_part = dim(&format!("⚡ {last_text}"), color);
|
||||
let elapsed = dim(&format_elapsed(started.elapsed()), color);
|
||||
let last_part = format!("{} {}", emoji("⚡", "yellow", color), dim(&last_text, color));
|
||||
let elapsed = dim(&format!("⏲ {}", format_elapsed(started.elapsed())), color);
|
||||
println!(
|
||||
"{}am v{}{sep}{shell_part}{sep}{counts}{sep}{last_part}{sep}⏲ {elapsed}",
|
||||
"{}am v{}{sep}{folder}{sep}{counts}{sep}{last_part}{sep}{elapsed}",
|
||||
dim(" ⚙ ", color),
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
);
|
||||
@@ -705,7 +718,7 @@ fn run_with_editor(app: &App, session: &mut ShellSession) -> Result<i32> {
|
||||
let mut last: Option<DataTable> = None;
|
||||
let mut last_duration: Option<Duration> = None;
|
||||
loop {
|
||||
print_status(app, session, started, last_duration);
|
||||
print_status(app, started, last_duration);
|
||||
match rl.readline("❯ ") {
|
||||
Ok(line) => {
|
||||
let trimmed = line.trim().to_string();
|
||||
@@ -740,7 +753,7 @@ fn run_plain(app: &App, session: &mut ShellSession) -> Result<i32> {
|
||||
let mut last: Option<DataTable> = None;
|
||||
let mut last_duration: Option<Duration> = None;
|
||||
loop {
|
||||
print_status(app, session, started, last_duration);
|
||||
print_status(app, started, last_duration);
|
||||
eprint!("❯ ");
|
||||
std::io::stderr().flush().ok();
|
||||
let mut line = String::new();
|
||||
|
||||
Reference in New Issue
Block a user