Expand description
Host — the thin Rust shell that wires up Lua VM, Mesh, HTTP, and MCP.
§Responsibilities
- Spawn an mlua-isle
AsyncIsle(dedicated Lua VM thread with coroutine support) - Optionally connect to agent-mesh relay
- Initialize the MCP manager for stdio-based MCP server connections
- Inject all Lua stdlib bridges (
mesh.*,http.*,sh.*,tool.*,log.*,mcp.*) - Execute the user-provided Lua script via
coroutine_eval(async-aware) - Graceful shutdown (Isle + MCP servers + mesh)
Structs§
- Block
Config - Host
Context - Shared context passed into Lua bridge functions.
- Host
Tool Spec - Declarative spec for a Rust-implemented tool injected into the Lua
tool registry before the user script runs. The resulting entry is
indistinguishable from a Lua-defined tool from the script’s view:
tool.call("<name>", input),agent.run({ ... })tool dispatch, andtool.schema()enumeration all work uniformly. - Tool
Meta - Snapshot of a tool that a given
BlockConfigwill (statically) expose to the LLM. Produced byinspect_toolswithout running the script. MCP server tools are not included because they are only known after the MCPinitializehandshake completes; callers that need that view should run the script and calltool.schema()from Lua.
Enums§
- Prompt
Source - How a string payload (prompt / system context) is supplied.
- Script
Source - How the Lua script source for
run()is supplied. - Secret
KeySource - How the Ed25519 mesh identity secret key is supplied.
- Tool
Source - Origin of a tool listed by
inspect_tools.
Traits§
- Tool
Handler - Async handler invoked when the LLM (or a Lua call to
tool.call(name, ...)) targets a Rust-implemented tool supplied viaBlockConfig::host_tools.
Functions§
- inspect_
tools - Inspect the tools a
BlockConfigwill expose to the LLM without actually running the script. Returns the merged list ofhost_tools(declared in the config) and embedded-block sources. - run