Skip to main content

Crate leviath_core

Crate leviath_core 

Source
Expand description

§Leviath Core

Core types and traits for the Leviath agent framework.

This crate provides the foundational types for building agents with structured, hardware-inspired context window management. It includes:

  • Regions: Typed memory regions with different lifecycle policies
  • Layouts: Complete memory maps defining how context is structured
  • Blueprints: Agent definitions including stages, models, and tools
  • Lifecycle: Policies for eviction, compaction, and context management

Re-exports§

pub use blueprint::Blueprint;
pub use blueprint::ContextTransform;
pub use blueprint::EdgeTransform;
pub use blueprint::FileTrackingConfig;
pub use blueprint::RepetitionDetectionConfig;
pub use blueprint::Stage;
pub use blueprint::StuckConfig;
pub use blueprint::ToolResultRouting;
pub use blueprint::TransitionCondition;
pub use blueprint::TransitionEdge;
pub use cache::CacheHint;
pub use credentials::CredentialStore;
pub use credentials::CredentialStoreKind;
pub use credentials::MemoryStore;
pub use credentials::mcp_account;
pub use credentials::provider_account;
pub use error::Error;
pub use error::Result;
pub use error::ValidationError;
pub use layout::BudgetSpec;
pub use layout::ContextLayout;
pub use layout::RegionDefinition;
pub use lifecycle::CompactionConfig;
pub use net::ClientTimeouts;
pub use net::UrlRejection;
pub use net::check_url;
pub use net::checked_client;
pub use net::client;
pub use net::client_builder;
pub use net::is_restricted_addr;
pub use panic_payload::panic_message;
pub use paths::agents_dir;
pub use paths::data_dir;
pub use paths::home_dir;
pub use paths::is_safe_path_component;
pub use paths::providers_dir;
pub use paths::resolves_within;
pub use paths::tools_dir;
pub use policy::AllowlistRule;
pub use policy::McpToolOverride;
pub use policy::PolicyConfig;
pub use region::ContentFormat;
pub use region::EntryKind;
pub use region::EvictionStrategy;
pub use region::Region;
pub use region::RegionEntry;
pub use region::RegionKind;
pub use region::RegionSchema;
pub use region::SerializedToolCall;
pub use sandbox::OnUnavailable;
pub use sandbox::SandboxKind;
pub use sandbox::ToolSandboxConfig;
pub use sandbox::resolve_sandbox;
pub use secrets::child_env_allowed;
pub use secrets::constant_time_eq;
pub use secrets::is_secret_header;
pub use secrets::is_sensitive_env_name;
pub use secrets::redact;
pub use secrets::script_env_allowed;
pub use taint::GateDecision;
pub use taint::GateDecisionSource;
pub use taint::GateEvent;
pub use taint::RegionTaint;
pub use taint::SecurityConfig;
pub use taint::TaintLevel;
pub use taint::ToolClassification;
pub use taint::ToolDirection;
pub use text::estimate_tokens;
pub use text::floor_char_boundary;
pub use text::truncate_at_boundary;

Modules§

blueprint
Agent blueprints and stage definitions.
cache
Cache hint types for prompt caching across providers.
config
Plain configuration value types shared across crates.
credentials
Where Leviath’s long-lived secrets live.
error
Error types for Leviath Core.
interaction
Plain value types for the worker ↔ dashboard interaction channel.
layout
Context window layouts and memory maps.
lifecycle
LLM compaction configuration for regions that summarize on overflow.
manifest
Manifest parsing for agent.leviath files.
net
Outbound-request policy: which URLs an agent-driven fetch may reach.
panic_payload
Rendering a caught panic payload as a human-readable message.
paths
Path containment, and the one definition of where Leviath’s data lives.
policy
Policy rules for taint tracking allowlists.
region
Memory region types and validation schemas.
run_archive
A portable, self-contained record of an entire agent run.
run_meta
Plain, serializable run-state data types.
sandbox
Sandboxed tool-execution configuration.
secrets
Which environment variables agent-supplied code may see.
taint
Context taint tracking types for security gating.
telemetry
The telemetry seam: pure-data lifecycle events and the sink they flow into.
text
Cutting a &str at a byte offset without splitting a character.