Skip to main content

Crate roboticus_server

Crate roboticus_server 

Source
Expand description

§roboticus-server

Top-level binary crate that assembles all Roboticus workspace crates into a single runtime. The bootstrap() function initializes the database, wallet, LLM pipeline, agent loop, channel adapters, and background daemons, then returns an axum Router ready to serve.

§Key Types

  • AppState – Shared application state passed to all route handlers
  • PersonalityState – Loaded personality files (OS, firmware, identity)
  • EventBus – Tokio broadcast channel for WebSocket event push

§Modules

  • api – REST API mount point, build_router(), route modules
  • auth – API key authentication middleware layer
  • rate_limit – Global + per-IP rate limiting (sliding window)
  • dashboard – Embedded SPA serving (compile-time or filesystem)
  • ws – WebSocket upgrade and event broadcasting
  • cli/ – CLI command handlers (serve, status, sessions, memory, wallet, etc.)
  • daemon – Daemon install, status, uninstall
  • migrate/ – Migration engine, skill import/export
  • plugins – Plugin registry initialization and loading

§Bootstrap Sequence

  1. Parse CLI → load config → init DB → load wallet → generate HMAC secret
  2. Init LLM client + router + embedding → load semantic cache
  3. Init agent loop + tool registry + memory retriever
  4. Register channel adapters (Telegram, WhatsApp, Discord, Signal)
  5. Spawn background daemons (heartbeat, cron, cache flush, ANN rebuild)
  6. Build axum router with auth + CORS + rate limiting

Re-exports§

pub use roboticus_api as api_crate;

Modules§

abuse
Abuse signal aggregation and enforcement.
api
auth
cli
config_maintenance
config_runtime
cron_runtime
daemon
dashboard
migrate
plugins
rate_limit
Global API rate limiting (fixed window, Clone-friendly for axum Router).
state_hygiene
ws
ws_ticket
Short-lived, single-use tickets for WebSocket authentication.

Structs§

AppState
EventBus
PersonalityState
Holds the composed personality text plus metadata for status display.
TicketStore
In-memory store for short-lived WebSocket upgrade tickets.

Functions§

bootstrap
Builds the application state and router from config. Used by the binary and by tests.
bootstrap_with_config_path
build_dashboard_html
build_mcp_router
Builds an axum Router that serves the MCP protocol endpoint.
build_public_router
Routes that must be accessible without API key authentication (webhooks from external services, discovery endpoints).
build_router
dashboard_handler
enable_stderr_logging
ws_route
Returns an axum GET route handler that upgrades the connection to WebSocket.