Skip to main content

Crate bitrouter

Crate bitrouter 

Source
Expand description

§bitrouter (library)

Assembly layer: turns a bitrouter_sdk::config::Config into a running bitrouter_sdk::App, and carries the management-command logic. This is the home of v0’s load_builtin_plugins equivalent.

Assembly sits above the SDK and the plugins (plugins → sdk, sdk never depends back) — see. The bin target (main.rs) is the CLI/TUI entry point and a thin shell over this lib.

Re-exports§

pub use assemble::Assembled;
pub use assemble::build_app;
pub use assemble::build_app_with_path;

Modules§

agent_proxy
bitrouter agent-proxy <agent_id> — stdio bridge between a downstream ACP consumer (e.g. an editor) and an upstream agent process configured under agents: in bitrouter.yaml.
agents
bitrouter agents — lifecycle CLI for upstream ACP agents.
assemble
Assembly: turn a parsed Config into a running App.
auth
OSS auth — brvk_ virtual-key authentication, the Authenticated event, and the users + api_keys tables.
commands
Management command logic — the implementations behind the CLI subcommands. Kept in the lib so it is testable and so a future desktop front-end can reuse it without dragging in the binary.
daemon
Daemon control over a Unix domain socket.
db
Database layer: connection handling and schema migrations.
error_report
User-facing CLI diagnostics — replaces anyhow’s default Debug rendering ("Error: …\n\nCaused by:\n …") with a tighter, actionable presentation.
metering
OSS metering — pipeline-observed cost data captured to local SQLite.
paths
Config source resolution for the OSS binary.
policy
OSS policy engine — per-API-key model allow/deny, spend ceiling, expiry, tool-access rules, request-rate limits.
reload
AppReloader — the daemon’s config hot-reload fan-out.
style
Shared terminal styling — ANSI palette + TTY / NO_COLOR gating — used by every user-facing CLI surface (error reports, status reports, future report-style output). Centralising the palette and the TTY-detection logic keeps the look consistent across surfaces and means a future “force colour” / theme toggle only has to change one place.
tools
bitrouter tools — introspection over the configured MCP servers.

Constants§

VERSION
Crate version string, surfaced by bitrouter --version.