Skip to main content

agent_block_core/
lib.rs

1//! agent-block-core — host runtime + Lua stdlib bridge + EventBus.
2//!
3//! Depends on `agent-block-types` (error / obs) and `agent-block-mcp`
4//! (rmcp wrapper).  The bin crate `agent-block` is a thin CLI on top.
5//!
6//! # Cargo features
7//!
8//! All three are **on by default**, so the default build (and the
9//! `agent-block` CLI) keeps the full runtime surface. SDK embedders that
10//! only need a subset can opt out with `default-features = false` and
11//! re-enable individual axes:
12//!
13//! | Feature    | Enables                                                          | Pulls in |
14//! |------------|------------------------------------------------------------------|----------|
15//! | `mesh`     | `mesh.*` Lua bridge, relay connect, Ed25519 mesh identity        | `agent-mesh-core`, `agent-mesh-sdk` |
16//! | `sqlite`   | `sql.*` / `kv.*` / `ts.*` Lua bridges (SQLite-backed)            | `rusqlite` (bundled), `mlua-batteries/{sql,kv}` |
17//! | `mcp-http` | `mcp.connect_http` (Streamable HTTP / SSE MCP transport)         | `agent-block-mcp/mcp-http` → rmcp HTTP-client transports |
18//!
19//! The stdio MCP transport (`mcp.connect`), `http.*`, `tool.*`, `sh.*`,
20//! `log.*`, `bus.*`, and the embedded StdPkg blocks are always available.
21//!
22//! When a feature is **off**:
23//! - `mesh`: the `mesh.*` bridge is not registered; `BlockConfig::relay_url`
24//!   / `secret_key` are accepted but ignored.
25//! - `sqlite`: the `sql.*` / `kv.*` / `ts.*` bridges are not registered;
26//!   `BlockConfig::sql_path` / `kv_path` / `ts_path` are accepted but ignored
27//!   (fields retained for API stability).
28//! - `mcp-http`: `mcp.connect_http` returns an explicit error when called.
29
30pub mod bridge;
31pub mod bus;
32pub mod host;
33
34pub use host::{run, BlockConfig, BlockConfigBuilder, HostContext};