mod cache;
mod catalog;
mod evaluate;
mod lang;
mod types;
#[cfg(all(feature = "fx", feature = "mcp"))]
mod fx_tools;
#[cfg(feature = "http")]
mod http;
#[cfg(feature = "mcp")]
mod mcp;
#[cfg(feature = "ratelimit")]
mod ratelimit;
pub(crate) use cache::shared_cache;
#[cfg(feature = "observability")]
pub(crate) async fn init_observability() -> Result<(), inklog::InklogError> {
let mut config = inklog::InklogConfig::default();
config.global.level = std::env::var("RUST_LOG").unwrap_or_else(|_| "warn".to_string());
config.global.format = "{timestamp} [{level}] {target} - {message}".to_string();
config.console_sink = Some(inklog::ConsoleSinkConfig {
enabled: true,
colored: true,
..inklog::ConsoleSinkConfig::default()
});
inklog::init_inklog_logger_with_config(config).await
}
#[cfg(not(feature = "observability"))]
pub(crate) async fn init_observability() {}
#[cfg(all(feature = "cli", feature = "server"))]
pub(crate) use cache::init_shared_cache;
pub use catalog::{ListFunctionsRequest, ListFunctionsResponse};
pub use evaluate::{calc_error_to_api_error, calc_error_to_api_error_i18n};
pub use types::{EvaluateRequest, EvaluateResponse, ServerError};
#[cfg(feature = "http")]
pub use http::{HttpServer, build_router};
#[cfg(feature = "mcp")]
pub use mcp::{McpServer, build_mcp_server};
#[cfg(all(test, feature = "observability"))]
mod observability_tests;