1#![deny(clippy::await_holding_lock)]
2
3mod http;
4mod json;
5mod mcp;
6mod mcp_tasks;
7mod subscribe;
8mod ws;
9
10use core_api::{MutationEvent, SharedDb};
11
12pub use mcp::{run_mcp_stdio, run_mcp_stdio_with, ASSOCIATION_TOOLS, CODE_GRAPH_TOOLS};
13
14#[derive(Clone, Debug)]
20pub(crate) enum AuthIdentity {
21 Full,
23 Role(String),
25}
26
27#[derive(Clone)]
29struct AppState {
30 db: SharedDb,
31 watch: tokio::sync::broadcast::Sender<MutationEvent>,
32 token: Option<String>,
34 role_tokens: std::collections::HashMap<String, String>,
37 addr: std::net::SocketAddr,
39 tls_active: bool,
42 started_at: std::time::Instant,
44}
45
46#[cfg(feature = "tls")]
47pub use http::serve_tls;
48#[allow(deprecated)]
49pub use http::{
50 router, router_with_auth, router_with_role_tokens, router_with_ui, router_with_ui_tls, serve,
51 serve_with_role_tokens, serve_with_ui, serve_with_ui_and_role_tokens,
52};
53#[cfg(feature = "embed-ui")]
54pub use http::{router_with_embedded_ui, serve_with_embedded_ui};