soma_gateway/lib.rs
1// Render per-item feature-requirement badges when rustdoc runs on nightly with
2// `--cfg docsrs` (docs.rs posture; locally via `cargo xtask doc --docsrs-cfg`).
3// Inert under the stable CI doc gate: stable rustdoc never sets `docsrs`.
4#![cfg_attr(docsrs, feature(doc_auto_cfg))]
5//! Reusable MCP aggregation gateway runtime.
6//!
7//! This crate intentionally starts with a narrow public surface. Runtime modules
8//! are added phase by phase behind tests that enforce the dependency direction.
9
10#[cfg(feature = "codemode")]
11pub mod codemode_journal;
12pub mod config;
13pub mod dispatch_helpers;
14pub mod gateway;
15pub mod registry;
16pub mod usage;
17
18pub use soma_mcp_client::{net, process, security, upstream};
19
20/// Crate version from Cargo metadata.
21pub const VERSION: &str = env!("CARGO_PKG_VERSION");
22
23/// Optional feature names that product crates may enable.
24pub const FEATURE_NAMES: &[&str] = &[
25 "oauth",
26 "codemode",
27 "openapi",
28 "palette",
29 "protected-routes",
30];
31
32/// Whether the optional upstream OAuth adapter is compiled in.
33pub const OAUTH_ENABLED: bool = cfg!(feature = "oauth");
34
35/// Whether the optional Code Mode gateway adapter is compiled in.
36pub const CODEMODE_ENABLED: bool = cfg!(feature = "codemode");
37
38/// Whether the optional OpenAPI gateway adapter is compiled in.
39pub const OPENAPI_ENABLED: bool = cfg!(feature = "openapi");
40
41/// Whether the optional palette projection adapter is compiled in.
42pub const PALETTE_ENABLED: bool = cfg!(feature = "palette");
43
44/// Whether protected-route support is compiled in.
45pub const PROTECTED_ROUTES_ENABLED: bool = cfg!(feature = "protected-routes");
46
47#[cfg(test)]
48#[path = "lib_tests.rs"]
49mod tests;