Skip to main content

mobius_gateway/
lib.rs

1//! Authenticated, frontend-neutral access to independent möbius chats.
2
3mod assembly;
4pub mod auth;
5pub mod bots;
6pub mod client;
7mod cloudflare;
8pub mod command;
9mod computer_runtime;
10pub mod config;
11mod extensions;
12mod host;
13mod middleware_manifest;
14mod provider_catalog;
15mod publication;
16pub mod sandbox;
17pub mod server;
18pub mod wire;
19
20pub use extensions::MAX_EXTENSION_SOURCE_BYTES;
21
22/// Errors returned by the gateway library.
23#[derive(Debug, thiserror::Error)]
24pub enum Error {
25    #[error("gateway configuration error: {0}")]
26    Config(String),
27    #[error("gateway protocol error: {0}")]
28    Protocol(String),
29    #[error("gateway authentication failed")]
30    Unauthorized,
31    #[error(transparent)]
32    Mobius(#[from] mobius::Error),
33    #[error(transparent)]
34    Io(#[from] std::io::Error),
35    #[error(transparent)]
36    Json(#[from] serde_json::Error),
37    #[error("Bot storage error")]
38    Sqlite(#[from] rusqlite::Error),
39}
40
41/// Result type shared by gateway modules.
42pub type Result<T> = std::result::Result<T, Error>;