main
Caleb Add the Rust source, flow definition, assets and install scripts cf9809b
//! Every command answers the AI the same way: `OK: <what happened>` or `ERROR: <what is wrong>`,
//! then `Hint:` lines that depend on this project and this run. Exit 1 on ERROR.

use std::io::Write;

pub fn ok(msg: &str, hints: &[String]) {
    let mut o = std::io::stdout();
    let _ = writeln!(o, "OK: {msg}");
    for h in hints.iter().filter(|h| !h.is_empty()) { let _ = writeln!(o, "Hint: {h}"); }
}

pub fn err(msg: &str, hints: &[String]) -> ! {
    let mut o = std::io::stdout();
    let _ = writeln!(o, "ERROR: {msg}");
    for h in hints.iter().filter(|h| !h.is_empty()) { let _ = writeln!(o, "Hint: {h}"); }
    std::process::exit(1)
}