ai-usagebar 1.14.0

Omarchy/Waybar widgets + TUI for tracking multi-provider AI plan usage
Documentation
//! Open `ai-usagebar-tui` in a real console. The TUI occupies a terminal;
//! spawning it without one just flashes nothing.

use std::process::Command;

pub fn open() {
    let Some(tui) = resolve_tui() else {
        return;
    };
    if Command::new("wt.exe").args(["-e", &tui]).spawn().is_ok() {
        return;
    }
    let _ = Command::new("conhost.exe").arg(&tui).spawn();
}

fn resolve_tui() -> Option<String> {
    if let Ok(exe) = std::env::current_exe()
        && let Some(dir) = exe.parent()
    {
        let sibling = dir.join("ai-usagebar-tui.exe");
        if sibling.is_file() {
            return Some(sibling.to_string_lossy().into_owned());
        }
    }
    if let Ok(home) = crate::cache::home_dir() {
        let cargo = home.join(".cargo").join("bin").join("ai-usagebar-tui.exe");
        if cargo.is_file() {
            return Some(cargo.to_string_lossy().into_owned());
        }
    }
    Some("ai-usagebar-tui.exe".into())
}