kova-api 0.4.0

Kova HTTP API: health probe, embedded GUI, and engine endpoints
Documentation
//! kova-api: HTTP API.
//!
//! `GET /health` — liveness probe.
//! `GET /` — embedded GUI (from `kova-gui`).
//! `GET /pipeline/state` / `GET /pipeline/events` / `POST /pipeline/research`
//! — engine endpoints, wired in via [`engine::router_with_engine`].

pub mod engine;
pub mod gui;

use axum::{routing::get, Router};

/// Build the base API router (health + GUI).
pub fn router() -> Router {
    Router::new()
        .route("/health", get(gui::health))
        .route("/", get(gui::index))
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn router_builds() {
        let _ = router();
    }

    #[tokio::test]
    async fn health_payload_is_ok() {
        let v = gui::health().await.0;
        assert_eq!(v["status"], "ok");
        assert_eq!(v["service"], "kova");
    }

    #[tokio::test]
    async fn index_serves_embedded_gui() {
        let (_, html) = gui::index().await;
        assert!(html.contains("Kova"));
    }
}