Expand description
The application-facing crate for the Everruns Framework.
Build agents, attach provider configuration, select model ids, add typed tools, run isolated multi-turn sessions, bind backend-owned workspace heads through Environments, read bounded history, resume typed session identities, observe events, cancel work, and inspect the next model context without constructing an execution host. Default features stay offline; the deterministic simulator needs no credentials or network. The default registry advertises only portable capabilities; hosted knowledge, delegation, task, hook, and platform-management implementations require an explicit Everruns Platform host.
everruns is the primary Rust library in the
Everruns ecosystem. Ordinary applications begin
here; advanced execution hosts use everruns plus
everruns-host and focused sibling crates.
§Example
Run one simulated turn, importing only everruns:
use everruns::{Agent, Engine, Model};
let agent = Agent::builder()
.instructions("You are a helpful assistant.")
.model(Model::simulated("4"))
.build()
.expect("valid agent");
let engine = Engine::new();
let result = engine.create(agent).send_and_wait("What is 2 + 2?").await?;
assert!(result.success);
assert_eq!(result.response, "4");Re-exports§
pub use decisions::Answers;pub use decisions::Decision;pub use decisions::Decisions;pub use decisions::DecisionsError;pub use llm::Completion;pub use llm::CompletionError;pub use models::CatalogError;pub use models::ModelInfo;
Modules§
- approval
- Stability: alpha — may change without a major bump; see
stability. Stability: alpha — may change without a major bump; seestability. - ask_
user - Stability: stable — no breaking change without a major bump; see
stability. Stable host contract and values for structured in-process questions. - capability
- Stable service-provider interface for advanced, code-defined capabilities.
- decisions
- Stability: alpha — may change without a major bump; see
stability. Stability: alpha — may change without a major bump; seestability. - llm
- Stability: stable — no breaking change without a major bump; see
stability. Stability: stable — no breaking change without a major bump; seestability. - models
- Stability: alpha — may change without a major bump; see
stability. Stability: alpha — may change without a major bump; seestability. - prelude
- The common path: everything needed to describe an agent and run turns.
- providers
- Real LLM provider configuration for the facade.
- stability
- Stability tiers and the marking convention. Stability tiers for the framework surface: what each marker promises.
- work
- Session-owned background work, scheduling, cancellation, and wakes. Session-owned background work and wakes.
Structs§
- Agent
- The immutable, validated description of an agent.
- Agent
Builder - Fluent builder behind
Agent::builder. - Agent
Instructions Config - Agent
Start Context - Context passed to an
on_agent_starthandler. - Bearer
Auth - Static
Authorization: Bearer …authentication. - Cancellation
Token - A handle for cancelling an in-flight turn.
- Capability
Ref - A reference to a capability implementation plus per-agent JSON.
- Capability
Spec - The normalized value produced by
IntoCapability. - Compaction
Config - Application-facing context-compaction policy.
- Completion
Context - Context passed to an
on_completionhandler. - Compute
Capabilities - What a target can actually do.
- Containment
- What a command may touch, and who enforces it.
- Context
Message - One message in an inspected session context.
- Controls
- Runtime controls for message processing
- Cost
Tier - A pricing tier that activates above a context token threshold. For example, OpenAI charges higher rates for prompts exceeding 200K tokens.
- Credential
Form Schema - Describes the form fields and instructions for entering a credential.
- Decision
Outcome - The result of one evaluation.
- Decision
Request - One evaluation: state plus the questions to ask about it.
- Discovered
Model - Model information discovered from a provider’s list_models API
- Driver
Config - Everything a
DriverFactoryreceives to build a driver instance. - Driver
Descriptor - A registered provider driver: identity, declared services, the credential shape its providers must supply, and per-service factories.
- Driver
Id - Open string identifier retained as the 0.17.x integration-kind name.
- Driver
Registry - Registry for LLM drivers
- Engine
- Application-owned session execution engine.
- Engine
Builder - Configures an application-owned
Engine. - EnvCredential
Provider - A
CredentialProviderthat reads a driver’s declared variables from the process environment. - Environment
- Session execution resources: the workspace head every file tool addresses, the compute that runs commands against it, and what that compute may touch.
- Environment
Builder - Environment
Session Builder - A not-yet-running Session with its Environment selected.
- Event
Filter - Selects the event types delivered to an
EventListener. - Event
Stream - A live feed of
SessionEvents for oneSession. - Exec
Request - One command to run.
- Exec
Result - What one command did.
- File
System - Activate the session filesystem with its default configuration.
- Form
Field - A single form field.
- Function
Tool - A custom agent tool backed by an async function or closure.
- Harness
- A reusable description of what an agent runs on.
- Harness
Builder - Fluent builder behind
Harness::builder. - Harness
Environment Session Builder - A not-yet-running Session with its Harness and Environment selected.
- Harness
Session Builder - A not-yet-running Session with its Harness selected.
- History
Cursor - Opaque continuation token for a stable session-history snapshot.
- History
Cursor Parse Error - A string could not be parsed as a
HistoryCursor. - History
Page - One bounded page of a session conversation.
- History
Pages - Lazy, fused reader for all pages in one stable history snapshot.
- History
Query - Owned builder for one bounded, stable session-history snapshot.
- Hook
Failure - A lifecycle handler failure surfaced by the Framework.
- Host
Backends - Non-filesystem backend bundle supplied to an execution host.
- Image
Content Part - Image content part (base64 or URL)
- Initial
File - Starter file copied into a new session from an agent or harness.
- Input
Message - Input message for creating a new message
- Listener
Stats - Delivery counters for one Engine listener.
- LlmCall
Config - Configuration for an LLM call
- LlmCall
Config Builder - Builder for LlmCallConfig with fluent API
- LlmCompletion
Metadata - Metadata about LLM completion Contains token usage and completion information from the LLM response.
- LlmError
- LLM provider error with a semantic kind attached by the driver.
- LlmResponse
- Response from an LLM call (non-streaming)
- LlmSim
Config - Configuration for the LlmSim driver.
- McpServer
- A scoped MCP server available to an agent.
- Model
- A model selected for an
Agent. - Model
Cost - Cost information for the model (per million tokens)
- Model
Limits - Token limits for the model
- Model
Modalities - Model modalities for input and output
- Model
Profile - LLM Model Profile describing model capabilities Based on models.dev structure (https://models.dev/api.json)
- Observer
Report - Result of a deadline-bounded Engine observer shutdown.
- Observer
Stats - Snapshot of Engine observer delivery counters.
- Plugin
Error - Failure while reading or compiling a local plugin directory.
- Provider
Auth Request - Immutable request material available to an authentication implementation.
- Provider
Credentials - Credentials resolved for a single driver.
- Provider
Endpoint - Endpoint and authentication policy handed to a wire driver.
- Provider
Key - Open, normalized identity used by model specifications to select a provider.
- Reasoning
Config - Reasoning configuration for the model
- Reasoning
Content Part - One provider-issued reasoning artifact, ordered in
Message.contentalongside text and tool calls. - RunOptions
- Options controlling a single
Session::run_with. - Sent
Message - Receipt returned once
Session::sendaccepts a message. - Session
- A live, multi-turn conversation with an
Agent. - Session
Context - The effective context a session will send to its model on the next turn.
- Session
Event - A single observed event from a running
Session. - Session
Message - One application-facing message in a
HistoryPage. - SimTool
Call - A single tool call inside a scripted turn.
- Skills
- Activate workspace skill discovery with its default configuration.
- Stateless
Todo List - Activate the conversation-backed todo list with its default configuration.
- Static
Header Auth - Static authentication carried in one named header.
- Tool
Call - Tool call from LLM response
- Tool
Call Context - What a
FunctionToolhandler knows about the call it is serving. - Tool
EndContext - Context passed to an
on_tool_endhandler. - Tool
Info - A model-visible tool in an inspected session context.
- Tool
Response - A ready-to-return structured tool result.
- Tool
Search - Model-adaptive deferred tool-loading configuration.
- Tool
Start Context - Context passed to an
on_tool_starthandler. - Turn
- The outcome of a single
Session::runturn. - Turn
Handle - A cloneable handle to one active or completed turn.
- Turn
Start Context - Context passed to an
on_turn_starthandler. - Workspace
- One logical workspace opened through a backend.
- Workspace
Backend Id - Stable, backend-defined SPI identifier.
- Workspace
Binding - Backend-owned data sufficient to reopen the exact recorded head.
- Workspace
Checkpoint - Backend-neutral checkpoint metadata.
- Workspace
Descriptor - Backend-neutral identity and base metadata for a logical workspace.
- Workspace
Diff - Backend-neutral diff summary for one mutable head.
- Workspace
Head - One stable, reopenable mutable view of a workspace.
- Workspace
Head Builder - Builder for explicit isolated or shared heads.
- Workspace
Head Descriptor - Backend-neutral identity and base metadata for a head.
- Workspace
Head Id - Stable identity of one mutable workspace head.
- Workspace
Head Request - Request to create or fork one head.
- Workspace
Head Resource - A backend-produced head resource before the Framework attaches lifecycle.
- Workspace
Head Status - Backend-neutral mutable-head status.
- Workspace
Policy - A validated, composable workspace access policy.
- Workspace
Policy Builder - Builder for a custom
WorkspacePolicy. - Workspace
Policy Error - Invalid policy configuration or a denied workspace operation.
- Workspace
Provider Id - Stable, backend-defined SPI identifier.
Enums§
- Agent
Loop Error - Errors that can occur during agent loop execution
- Billing
Pressure Reason - Machine-readable reason for provider billing pressure.
- Build
Error - Why an
AgentBuildercould not produce anAgent. - Cancel
Error - Why a turn handle could not cancel its turn.
- Compaction
Strategy - Strategy used when a conversation outgrows the model context.
- Compute
Error - Why compute could not do what was asked.
- Compute
Kind - The shape of a compute target, independent of any one provider.
- Containment
Level - How much of the host a command may reach.
- Content
Part - A part of message content - can be text, image, image_file, tool_call, or tool_result
- Decision
Answer - One typed answer.
- Decision
Question - One typed question.
- Durability
- How much of the working filesystem survives losing the compute.
- EnvCredential
Error - Why a driver could not be configured from the environment.
- Environment
Error - Why an Environment could not be assembled.
- Event
Stream Error - Why an
EventStreamcould not deliver the next event losslessly. - Execution
Phase - Execution phase for assistant messages in multi-step tool-calling flows.
- Field
Type - Input field type for rendering.
- Harness
Build Error - Why a
HarnessBuildercould not produce aHarness. - History
Error - Why a bounded session-history request could not be completed.
- Hook
Point - A typed Framework lifecycle point.
- LlmContent
Part - A single content part within a message
- LlmError
Kind - Semantic classification of an LLM provider error, assigned by the driver
at the provider boundary where the HTTP status and response body are still
available. Downstream consumers prefer this over re-parsing error strings;
LlmErrorKind::Otherfalls back to string classification (classify_runtime_error_message) so untyped errors keep working. - LlmStream
Event - Events emitted during LLM streaming
- Message
Role - Message role in the conversation
- Modality
- Modality type (text, image, audio, video)
- Model
Vendor - Vendor / brand that authored a model. Independent of the provider type that serves it (the same model may be offered by several providers or gateways). Primarily drives UI iconography.
- Network
Policy - Outbound network policy for commands.
- OnExhausted
- Behavior when a scripted config has consumed all turns.
- Phase
Source - Where a message’s
ExecutionPhasecame from. - Reasoning
Effort - Reasoning effort level for models that support it
- Reasoning
Text - Readable reasoning text, in the form the provider actually exposes.
- Resume
Error - Why an existing Framework session could not be resumed.
- RunError
- Why a
Session::runcould not complete. - Send
Disposition - How
Session::sendrouted an accepted message. - Session
Environment Error - Why an Environment could not be fixed to a Session.
- Session
Event Kind - The event-specific payload of a
SessionEvent. - SimError
- Error to inject for a scripted turn.
- SimTurn
- A single scripted assistant turn.
- Tool
- A closure-backed function tool accepted by
AgentBuilder::tool. - Tool
Definition - Tool definition in agent configuration
- Turn
Stop Reason - Stable reason a turn stopped, independent of provider-specific strings.
- Workspace
Error - Errors exposed by workspace backends and lifecycle operations.
- Workspace
Head Access - Whether a head is intended for one session or intentionally shared.
Constants§
- EVENT_
STREAM_ CAPACITY - Capacity of the per-session broadcast channel that backs
EventStream. - OBSERVER_
QUEUE_ CAPACITY - Default number of pending events retained for each Engine listener.
Traits§
- Chat
Driver - Trait for LLM drivers
- Compute
- A target that can run commands against a workspace head.
- Compute
Session - A connected target, ready to run commands.
- Credential
Provider - A source of provider credentials, injected by the caller.
- Decisions
Service - Host-owned service answering typed questions.
- Event
Listener - Receives projected events from every session owned by an Engine.
- Into
Capability - Convert an application value into one capability registration.
- Into
Hook Result - Convert a lifecycle handler’s output into the Framework hook result.
- Into
Tool - Conversion into a
ToolforAgentBuilder::tool. - Into
Tool Result - Converts a handler’s success value into the engine’s tool-result shape.
- Provider
Auth - Resolves authentication for each outbound provider request.
- Workspace
Backend - Open interface for physical workspace implementations.
- Workspace
Provider - Open interface for physical workspace implementations.
Functions§
- provider_
from_ env - Build a chat
Providerfor a driver from the variables that driver declares.
Type Aliases§
- Boxed
Chat Driver - Boxed chat driver for dynamic dispatch
- InMemory
Engine - Compatibility name for the application-owned process-local engine.
- LlmMessage
Deprecated - Pre-0.31 name of
Message. - LlmMessage
Content Deprecated - Pre-0.31 name of
MessageContent. - LlmMessage
Role Deprecated - Pre-0.31 name of
MessageRole. - LlmResponse
Stream - Type alias for the LLM response stream
- Provider
- Public application-facing name for a runtime provider.
- Session
Id - Session ID
- Workspace
Id - Workspace ID (org-scoped named Workspace — see
knowledge/runtime-resources/workspace.md)
Attribute Macros§
- tool
- Turn a typed async function into an agent tool.