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, 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.
everruns is the primary Rust library in the
Everruns ecosystem. New ordinary applications begin
here. Existing everruns-runtime 0.17.x applications should follow the
runtime migration guide.
§Example
Run one simulated turn, importing only everruns:
use everruns::{Agent, Model};
let agent = Agent::builder()
.instructions("You are a helpful assistant.")
.model(Model::simulated("4"))
.build()
.expect("valid agent");
let result = agent.session().send_and_wait("What is 2 + 2?").await?;
assert!(result.success);
assert_eq!(result.response, "4");Re-exports§
pub use everruns_core as core;pub use everruns_host as runtime;
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
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 dynamic reference to a capability implementation plus per-agent JSON.
- Capability
Registry - Registry that holds all available capability implementations.
- Capability
Spec - The normalized Framework 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
- Event
Stream - A live feed of
SessionEvents for oneSession. - Function
Tool - A custom agent tool backed by an async function or closure.
- Harness
Builder - Builds a
Harnesswith runtime-friendly defaults. - 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)
- InProcess
Runtime - Public in-process runtime backed by either in-memory or custom stores.
- InProcess
Runtime Builder - Builder for the public in-process runtime.
- 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. - Model
Spec - A model name paired with the runtime provider that serves it.
- Platform
Definition - Shared definition of the Everruns platform surface.
- 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
- 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
Builder - Builds a
Sessionwith runtime-friendly defaults. - 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. - Single
Session Builder - High-level builder for seeding one harness, one agent, and one session.
- 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 tool-search capability 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
Result - Turn
Start Context - Context passed to an
on_turn_starthandler. - 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.
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. - 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
- 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
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.
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 Framework 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.
Type Aliases§
- LlmResponse
Stream - Type alias for the LLM response stream
- Provider
- Public application-facing name for a runtime provider.
- Provider
Registry - Public registry name for runtime provider instances.
- Session
Id - Session ID
Attribute Macros§
- tool
- Turn a typed async function into an agent tool.