haematite-cli 0.21.7

The haematite command: serve a store, its door and Studio, answer MCP, query with jq, and host the store's assistant seat
Documentation
#![forbid(unsafe_code)]

use std::fs;
use std::process::Command;

#[test]
fn install_without_an_agent_reports_the_actual_launch_refusal()
-> Result<(), Box<dyn std::error::Error>> {
    let directory = tempfile::tempdir()?;
    let config = directory.path().join("serve.json");
    let bundle = directory.path().join("bundle");
    fs::write(
        &config,
        serde_json::to_vec(&serde_json::json!({
            "data_dir": directory.path().join("data"),
            "branch_cache_bytes_per_shard": 1_048_576,
            "max_frame": 1_048_576, "max_clients": 4, "max_page": 32, "timeout_ms": 30000
        }))?,
    )?;
    let output = Command::new(env!("CARGO_BIN_EXE_haematite"))
        .env_clear()
        .env("HOME", directory.path())
        .env("PATH", "/usr/bin:/bin")
        .arg("install")
        .arg("--bundle")
        .arg(&bundle)
        .arg("--config")
        .arg(config)
        .output()?;
    let stderr = String::from_utf8(output.stderr)?;
    assert!(output.status.success(), "{stderr}");
    assert!(stderr.contains("bundle_no_agent:"), "{stderr}");
    assert!(stderr.contains("haematite_mcp_agent_missing"), "{stderr}");
    assert!(!stderr.contains("bundle_no_pass"), "{stderr}");
    assert!(!stderr.contains("pass_missing"), "{stderr}");
    let report: serde_json::Value = serde_json::from_slice(&output.stdout)?;
    assert_eq!(report["files"], 9);
    assert!(bundle.join("scripts/mcp.sh").is_file());
    Ok(())
}