1#![deny(clippy::await_holding_lock)]
2
3mod http;
4mod json;
5mod mcp;
6mod subscribe;
7mod ws;
8
9use core_api::{MutationEvent, SharedDb};
10
11pub use mcp::run_mcp_stdio;
12
13#[derive(Clone, Debug)]
19pub(crate) enum AuthIdentity {
20 Full,
22 Role(String),
24}
25
26#[derive(Clone)]
28struct AppState {
29 db: SharedDb,
30 watch: tokio::sync::broadcast::Sender<MutationEvent>,
31 token: Option<String>,
33 role_tokens: std::collections::HashMap<String, String>,
36 addr: std::net::SocketAddr,
38}
39
40#[allow(deprecated)]
41pub use http::{
42 router, router_with_auth, router_with_role_tokens, router_with_ui, serve,
43 serve_with_role_tokens, serve_with_ui, serve_with_ui_and_role_tokens,
44};
45#[cfg(feature = "embed-ui")]
46pub use http::{router_with_embedded_ui, serve_with_embedded_ui};