Expand description
Daemon assembly: build a fully-wired WorldHost (world + tool service +
interaction hub + the blueprint spawner) ready to be driven by
WorldHost::serve. The async setup (provider registry, MCP connections)
happens in the binary and is passed in; this wiring is synchronous and
testable - spawning an agent through the installed spawner exercises the whole
path.
Constants§
- CURRENT_
BUILD - This CLI binary’s build id (short git hash,
-dirtywhen the tree had uncommitted changes), embedded at compile time bybuild.rs. A long-lived daemon records the build it started from; a mismatch means the installed binary is newer and the daemon is running stale code.
Functions§
- build_
host - Build the daemon’s
WorldHost: one world hosting every agent, its tool service + interaction hub, and aSpawn-op spawner that loads blueprints and registers per-agent tool state.shared_mcp/mcp_tool_defsare the MCP connections built once at startup and reused by every agent. - build_
marker_ path - Path to the file where a running daemon records its build id
(
<leviath-home>/.leviath/daemon.build). - control_
address - The daemon’s control-channel id, derived from
<leviath-home>/.leviath(honoringLEVIATH_HOME): a Unix-socket path on Unix, a named-pipe name on Windows.Noneif no home directory can be resolved. - control_
dir - The directory holding the control channel and its token.
- daemon_
build_ is_ stale - Whether a running daemon should be restarted because it is on a different build than this CLI (or recorded no build at all - e.g. it predates this check).
- read_
build_ marker - The build id a running daemon recorded, if the marker exists and is readable.
- setup_
daemon_ host - Build the daemon’s
WorldHost, doing the async startup work: build the provider registry from config and connect the shared MCP servers (both reused by every agent), then wire the host + spawner viabuild_host. - write_
build_ marker - Record
CURRENT_BUILDso the CLI can detect a stale daemon later. Best-effort - a missing marker just triggers a restart on the next command.