Skip to main content

Crate everruns

Crate everruns 

Source
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.
AgentBuilder
Fluent builder behind Agent::builder.
AgentStartContext
Context passed to an on_agent_start handler.
BearerAuth
Static Authorization: Bearer … authentication.
CancellationToken
A handle for cancelling an in-flight turn.
CapabilityRef
A dynamic reference to a capability implementation plus per-agent JSON.
CapabilityRegistry
Registry that holds all available capability implementations.
CapabilitySpec
The normalized Framework value produced by IntoCapability.
CompactionConfig
Application-facing context-compaction policy.
CompletionContext
Context passed to an on_completion handler.
ContextMessage
One message in an inspected session context.
Controls
Runtime controls for message processing
EventStream
A live feed of SessionEvents for one Session.
FunctionTool
A custom agent tool backed by an async function or closure.
HarnessBuilder
Builds a Harness with runtime-friendly defaults.
HistoryCursor
Opaque continuation token for a stable session-history snapshot.
HistoryCursorParseError
A string could not be parsed as a HistoryCursor.
HistoryPage
One bounded page of a session conversation.
HistoryPages
Lazy, fused reader for all pages in one stable history snapshot.
HistoryQuery
Owned builder for one bounded, stable session-history snapshot.
HookFailure
A lifecycle handler failure surfaced by the Framework.
ImageContentPart
Image content part (base64 or URL)
InProcessRuntime
Public in-process runtime backed by either in-memory or custom stores.
InProcessRuntimeBuilder
Builder for the public in-process runtime.
InitialFile
Starter file copied into a new session from an agent or harness.
InputMessage
Input message for creating a new message
LlmCallConfig
Configuration for an LLM call
LlmCompletionMetadata
Metadata about LLM completion
LlmMessage
Message format for LLM calls (provider-agnostic)
LlmSimConfig
Configuration for the LlmSim driver
McpServer
A scoped MCP server available to an agent.
Model
A model selected for an Agent.
ModelSpec
A model name paired with the runtime provider that serves it.
PlatformDefinition
Shared definition of the Everruns platform surface.
PluginError
Failure while reading or compiling a local plugin directory.
ProviderAuthRequest
Immutable request material available to an authentication implementation.
ProviderEndpoint
Endpoint and authentication policy handed to a wire driver.
ProviderKey
Open, normalized identity used by model specifications to select a provider.
ReasoningConfig
Reasoning configuration for the model
RunOptions
Options controlling a single Session::run_with.
SentMessage
Receipt returned once Session::send accepts a message.
Session
A live, multi-turn conversation with an Agent.
SessionBuilder
Builds a Session with runtime-friendly defaults.
SessionContext
The effective context a session will send to its model on the next turn.
SessionEvent
A single observed event from a running Session.
SessionMessage
One application-facing message in a HistoryPage.
SingleSessionBuilder
High-level builder for seeding one harness, one agent, and one session.
StaticHeaderAuth
Static authentication carried in one named header.
ToolCall
Tool call from LLM response
ToolEndContext
Context passed to an on_tool_end handler.
ToolInfo
A model-visible tool in an inspected session context.
ToolResponse
A ready-to-return structured tool result.
ToolSearch
Model-adaptive tool-search capability configuration.
ToolStartContext
Context passed to an on_tool_start handler.
Turn
The outcome of a single Session::run turn.
TurnHandle
A cloneable handle to one active or completed turn.
TurnResult
TurnStartContext
Context passed to an on_turn_start handler.
WorkspacePolicy
A validated, composable workspace access policy.
WorkspacePolicyBuilder
Builder for a custom WorkspacePolicy.
WorkspacePolicyError
Invalid policy configuration or a denied workspace operation.

Enums§

AgentLoopError
Errors that can occur during agent loop execution
BuildError
Why an AgentBuilder could not produce an Agent.
CancelError
Why a turn handle could not cancel its turn.
CompactionStrategy
Strategy used when a conversation outgrows the model context.
ContentPart
A part of message content - can be text, image, image_file, tool_call, or tool_result
EventStreamError
Why an EventStream could not deliver the next event losslessly.
HistoryError
Why a bounded session-history request could not be completed.
HookPoint
A typed Framework lifecycle point.
LlmStreamEvent
Events emitted during LLM streaming
MessageRole
Message role in the conversation
ResumeError
Why an existing Framework session could not be resumed.
RunError
Why a Session::run could not complete.
SendDisposition
How Session::send routed an accepted message.
SessionEventKind
The event-specific payload of a SessionEvent.
Tool
A closure-backed function tool accepted by AgentBuilder::tool.
TurnStopReason
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§

ChatDriver
Trait for LLM drivers
IntoCapability
Convert an application value into one Framework capability registration.
IntoHookResult
Convert a lifecycle handler’s output into the Framework hook result.
IntoTool
Conversion into a Tool for AgentBuilder::tool.
IntoToolResult
Converts a handler’s success value into the engine’s tool-result shape.
ProviderAuth
Resolves authentication for each outbound provider request.

Type Aliases§

LlmResponseStream
Type alias for the LLM response stream
Provider
Public application-facing name for a runtime provider.
ProviderRegistry
Public registry name for runtime provider instances.
SessionId
Session ID

Attribute Macros§

tool
Turn a typed async function into an agent tool.