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 provider-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");Modules§
- capability
- Stable service-provider interface for advanced, code-defined capabilities.
- prelude
- The common path: everything needed to describe an agent and run turns.
- providers
- Real LLM provider configuration for the facade.
- 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. - Context
Message - One message in an inspected session context.
- Controls
- Runtime controls for message processing
- Engine
- Application-owned session execution engine.
- Environment
- Session execution resources. Workspace is first; future compute/network resources attach through the open type-keyed extension seam.
- Environment
Builder - Environment
Session Builder - A not-yet-running Session with its Environment selected.
- Event
Stream - A live feed of
SessionEvents for oneSession. - File
System - Activate the session filesystem with its default configuration.
- Function
Tool - A custom agent tool backed by an async function or closure.
- 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.
- 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
- LlmCall
Config - Configuration for an LLM call
- LlmCompletion
Metadata - Metadata about LLM completion
- LlmMessage
- Message format for LLM calls (provider-agnostic)
- LlmSim
Config - Configuration for the LlmSim driver.
- McpServer
- A scoped MCP server available to an agent.
- Model
- A model selected for an
Agent. - Plugin
Error - Failure while reading or compiling a local plugin directory.
- Provider
Auth Request - Immutable request material available to an authentication implementation.
- 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. - 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
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 provider.
- Workspace
Binding - Provider-owned data sufficient to reopen the exact recorded head.
- Workspace
Checkpoint - Provider-neutral checkpoint metadata.
- Workspace
Descriptor - Provider-neutral identity and base metadata for a logical workspace.
- Workspace
Diff - Provider-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 - Provider-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 provider-produced head resource before the Framework attaches lifecycle.
- Workspace
Head Status - Provider-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, provider-defined SPI identifier.
Enums§
- Agent
Loop Error - Errors that can occur during agent loop execution
- 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.
- Content
Part - A part of message content - can be text, image, image_file, tool_call, or tool_result
- 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.
- History
Error - Why a bounded session-history request could not be completed.
- Hook
Point - A typed Framework lifecycle point.
- LlmStream
Event - Events emitted during LLM streaming
- Message
Role - Message role in the conversation
- 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. - Tool
- A closure-backed function tool accepted by
AgentBuilder::tool. - Turn
Stop Reason - Stable reason a turn stopped, independent of provider-specific strings.
- Workspace
Error - Errors exposed by workspace providers 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.
Traits§
- Chat
Driver - Trait for LLM drivers
- 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
Provider - Open service-provider interface for physical workspace implementations.
Type Aliases§
- InMemory
Engine - Compatibility name for the application-owned process-local engine.
- 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.