#![deny(clippy::await_holding_lock)]
mod http;
mod json;
mod mcp;
mod subscribe;
mod ws;
use core_api::{MutationEvent, SharedDb};
pub use mcp::run_mcp_stdio;
#[derive(Clone, Debug)]
pub(crate) enum AuthIdentity {
Full,
Role(String),
}
#[derive(Clone)]
struct AppState {
db: SharedDb,
watch: tokio::sync::broadcast::Sender<MutationEvent>,
token: Option<String>,
role_tokens: std::collections::HashMap<String, String>,
addr: std::net::SocketAddr,
}
#[allow(deprecated)]
pub use http::{
router, router_with_auth, router_with_role_tokens, router_with_ui, serve,
serve_with_role_tokens, serve_with_ui, serve_with_ui_and_role_tokens,
};
#[cfg(feature = "embed-ui")]
pub use http::{router_with_embedded_ui, serve_with_embedded_ui};