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, 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.
AgentBuilder
Fluent builder behind Agent::builder.
AgentInstructionsConfig
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 reference to a capability implementation plus per-agent JSON.
CapabilitySpec
The normalized 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
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.
EnvironmentBuilder
EnvironmentSessionBuilder
A not-yet-running Session with its Environment selected.
EventStream
A live feed of SessionEvents for one Session.
FileSystem
Activate the session filesystem with its default configuration.
FunctionTool
A custom agent tool backed by an async function or closure.
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)
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.
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
ReasoningContentPart
One provider-issued reasoning artifact, ordered in Message.content alongside text and tool calls.
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.
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.
Skills
Activate workspace skill discovery with its default configuration.
StatelessTodoList
Activate the conversation-backed todo list with its default configuration.
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 deferred tool-loading 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.
TurnStartContext
Context passed to an on_turn_start handler.
Workspace
One logical workspace opened through a provider.
WorkspaceBinding
Provider-owned data sufficient to reopen the exact recorded head.
WorkspaceCheckpoint
Provider-neutral checkpoint metadata.
WorkspaceDescriptor
Provider-neutral identity and base metadata for a logical workspace.
WorkspaceDiff
Provider-neutral diff summary for one mutable head.
WorkspaceHead
One stable, reopenable mutable view of a workspace.
WorkspaceHeadBuilder
Builder for explicit isolated or shared heads.
WorkspaceHeadDescriptor
Provider-neutral identity and base metadata for a head.
WorkspaceHeadId
Stable identity of one mutable workspace head.
WorkspaceHeadRequest
Request to create or fork one head.
WorkspaceHeadResource
A provider-produced head resource before the Framework attaches lifecycle.
WorkspaceHeadStatus
Provider-neutral mutable-head status.
WorkspacePolicy
A validated, composable workspace access policy.
WorkspacePolicyBuilder
Builder for a custom WorkspacePolicy.
WorkspacePolicyError
Invalid policy configuration or a denied workspace operation.
WorkspaceProviderId
Stable, provider-defined SPI identifier.

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.
ExecutionPhase
Execution phase for assistant messages in multi-step tool-calling flows.
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
PhaseSource
Where a message’s ExecutionPhase came from.
ReasoningEffort
Reasoning effort level for models that support it
ReasoningText
Readable reasoning text, in the form the provider actually exposes.
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.
SessionEnvironmentError
Why an Environment could not be fixed to a Session.
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.
WorkspaceError
Errors exposed by workspace providers and lifecycle operations.
WorkspaceHeadAccess
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§

ChatDriver
Trait for LLM drivers
IntoCapability
Convert an application value into one 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.
WorkspaceProvider
Open service-provider interface for physical workspace implementations.

Type Aliases§

InMemoryEngine
Compatibility name for the application-owned process-local engine.
LlmResponseStream
Type alias for the LLM response stream
Provider
Public application-facing name for a runtime provider.
SessionId
Session ID
WorkspaceId
Workspace ID (org-scoped named Workspace — see knowledge/runtime-resources/workspace.md)

Attribute Macros§

tool
Turn a typed async function into an agent tool.