1mod admin;
21mod app;
22mod auth;
23mod cli;
24mod compose;
25mod config;
26mod formats;
27mod history;
28mod init;
29mod logging;
30mod mcp;
31mod mcp_login;
32mod mcp_oauth;
33mod mcp_tools;
34mod models;
35mod network;
36mod redact;
37mod report;
38mod requests;
39mod rules;
40mod tool_loop;
41mod vendors;
42
43pub use app::{App, DEFAULT_LISTEN, ReloadError, Reloaded, shutdown_signal};
44pub use auth::Trusted;
45pub use cli::{execute, run};
46pub use config::{
47 Auth, Commit, Config, DEFAULT_FILE, Pick, PluginsConfig, Price, ProviderConfig, ProxyVendor,
48 RequestLogConfig, RouteConfig, RouteTarget, RouteWhen, RoutingConfig, Source, no_keys_message,
49};
50pub use init::starter_config;
51pub use logging::LogFormat;
52pub use mcp::McpConfig;
53pub use mcp_oauth::OAuthConfig;
54pub use network::{NetworkConfig, Proxy};
55
56pub const VERSION: &str = env!("CARGO_PKG_VERSION");
58
59#[derive(Debug, Clone, PartialEq, Eq)]
62pub struct Error {
63 message: String,
64}
65
66impl Error {
67 pub fn new(message: impl Into<String>) -> Self {
68 Self {
69 message: message.into(),
70 }
71 }
72}
73
74impl std::fmt::Display for Error {
75 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
76 f.write_str(&self.message)
77 }
78}
79
80impl std::error::Error for Error {}
81
82impl From<respan_gateway_core::Fault> for Error {
83 fn from(fault: respan_gateway_core::Fault) -> Self {
84 Self::new(fault.message())
85 }
86}