solo_api/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2
3//! Solo transports: MCP server (rmcp) and HTTP/JSON (axum).
4//!
5//! - MCP stdio: [`mcp::SoloMcpServer`] + [`mcp::serve_stdio`].
6//! - HTTP/JSON: [`http::SoloHttpState`] + [`http::serve_http`].
7//! - Auth (v0.8.0 P3): [`auth::AuthConfig`] + [`auth::AuthenticatedPrincipal`].
8//! - LLM (v0.9.0 P2): [`llm::SamplingLlmClient`] backed by the connected
9//! MCP client's `sampling/createMessage` capability.
10
11pub mod auth;
12pub mod http;
13pub mod llm;
14pub mod mcp;
15// v0.10.2 P1: transport-agnostic JSON-RPC dispatcher shared by the new
16// HTTP `/mcp` route and (eventually) the stdio loop. See
17// `docs/dev-log/0129-v0.10.2-mcp-over-http-impl.md` for the refactor.
18pub mod mcp_dispatch;
19
20#[cfg(any(test, feature = "test-support"))]
21pub mod test_support;
22
23pub use auth::{AuthConfig, AuthError, AuthenticatedPrincipal};
24pub use http::{SoloHttpState, openapi_spec, serve_http};
25pub use llm::{SamplingClient, SamplingError, SamplingLlmClient, build_sampling_steward};
26pub use mcp::{
27 ENV_MCP_PRINCIPAL_TOKEN, SoloMcpServer, resolve_mcp_principal, serve_stdio, tool_names,
28};
29pub use mcp_dispatch::{
30 JsonRpcErrorBody, JsonRpcErrorResponse, JsonRpcRequest, JsonRpcResponse, JsonRpcSuccess,
31 McpDispatcher,
32};