#![deny(clippy::await_holding_lock)]
mod http;
mod json;
mod mcp;
mod mcp_tasks;
mod subscribe;
mod ws;
use core_api::{MutationEvent, SharedDb};
pub use mcp::{run_mcp_stdio, run_mcp_stdio_with, ASSOCIATION_TOOLS, CODE_GRAPH_TOOLS};
pub const LOG_TARGET_ROOT: &str = module_path!();
#[derive(Clone, Debug)]
pub(crate) enum AuthIdentity {
Full,
Role(String),
Anonymous,
}
#[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,
tls_active: bool,
started_at: std::time::Instant,
}
#[allow(deprecated)]
pub use http::{
router, router_with_auth, router_with_role_tokens, router_with_ui, router_with_ui_tls, serve,
serve_with_role_tokens, serve_with_role_tokens_and_shutdown, serve_with_shutdown,
serve_with_ui, serve_with_ui_and_role_tokens, serve_with_ui_and_role_tokens_and_shutdown,
};
#[cfg(feature = "embed-ui")]
pub use http::{
router_with_embedded_ui, serve_with_embedded_ui, serve_with_embedded_ui_and_shutdown,
};
#[cfg(feature = "tls")]
pub use http::{serve_tls, serve_tls_with_shutdown};