Expand description
§Leviath Runtime
ECS-based agent execution engine using bevy_ecs.
The runtime manages agent lifecycle, context window management, task scheduling, and inference execution through a game-loop-inspired architecture where agents are entities and their behaviors are systems.
Re-exports§
pub use components::AgentState;pub use components::AgentStatus;pub use components::ContextWindow;pub use components::ParentRef;pub use components::SubAgentChildren;pub use fanout::FanOutSpawner;pub use fanout::FanOutSpawnerRes;pub use inference_pool::InferencePoolConfig;pub use inference_pool::InferencePools;pub use provider_creds::ProviderCreds;pub use provider_creds::build_provider_registry;pub use taint::TaintGate;pub use tool_bridge::BoxedToolExec;
Modules§
- components
- ECS components for agent state and execution.
- context_
setup - Context-window setup helpers shared by the ECS pipeline’s spawner and stage-entry.
- control_
socket - The local control transport: newline-delimited JSON
ControlRequest/ControlResponseframes between clients (the TUI/CLI) and the world host, over a platform-native local socket. - custom_
region - Runtime side of script-backed custom regions (
RegionKind::Custom). - dynamic_
interaction - Agent-initiated dynamic interaction tools:
present_for_review,ask_user_text,ask_user_choice,ask_user_confirm,edit_document. - fanout
- Fan-out stage handling as ECS systems.
- host
- The world host: the daemon-side wrapper that owns a single
PipelineWorld, maps stable run ids to ECS entities, and interleaves external control operations with driving the world - all on one task, so there is never any locking around the world. - inference_
pool - Per-model inference concurrency pools.
- interaction_
hub - In-memory interaction hub - the shared-world replacement for the imperative
worker’s
pending.json/response.jsonfile polling. - interaction_
points - Declarative stage-boundary interaction points (
StageMode::InteractivePoints). - persistence
- Agent-state persistence: turning a live ECS agent into the on-disk snapshot
the dashboard/API read (
meta.json+context.jsonunder the run directory). - pipeline
- The ECS pipeline (Phase 2): components + systems that drive every agent through check-input → infer → tools → apply → repeat, entirely as data.
- provider_
creds - Decoupled provider credentials + registry construction.
- restore
- Restart recovery: bring a freshly-spawned agent back to its persisted running state so the daemon resumes it where it stopped.
- script_
provider - Lazy, hot-reloading resolution of Rhai script providers.
- taint
- Taint gate checking for tool execution.
- telemetry
- Observability as an ECS system: watch the components every other system
already writes and narrate them into the installed
TelemetrySink. - title
- One-shot run-title generation.
- tool_
bridge - The async worker side of the ECS tool stage - the sync-ECS ↔ async-I/O bridge for tool execution.
- world
- The pipeline driver: a single
PipelineWorldthat hosts every agent as ECS data and ticks thecrate::pipelinesystems over all of them - the traditional-game-loop core of the shared world.
Structs§
- Provider
Registry - Registry of inference providers, keyed by provider name (e.g.
"anthropic"). - Retry
Policy - How a transient inference failure is retried before the agent is failed.