openmoat 0.10.0

Policy checks for AI coding agents: decides allow, defer, ask or deny for every tool call from Claude Code, Codex, Cursor, OpenClaw, GitHub Copilot CLI, pi and Gemini CLI, configures Claude Code's, Codex's and Cursor's own OS sandboxes from the same policy, and keeps a local audit log.
//! `moat report`: how the policy behaved over a window.

use anyhow::Result;
use openmoat_hosts::Host;

use crate::cli::{Format, ReportArgs};
use crate::exit::Code;
use crate::home::Home;
use crate::render;
use crate::time;

pub fn run(args: &ReportArgs) -> Result<Code> {
    let since = time::parse_since(&args.since, time::now_ms())?;
    let store = Home::locate()?.open_audit()?;
    let summary = store.summary(since, args.host.map(Host::id))?;
    match args.format {
        Format::Json => render::json(&summary)?,
        Format::Text => render::report(&summary, &args.since)?,
    }
    Ok(Code::Ok)
}