Expand description
Shared turn planning and Input/Reason/Act execution for hosts in the Everruns ecosystem.
TurnExecution owns the serializable state machine shared by every
execution driver. Given a parsed ActivityOutcome and host-resolved
HostFacts, it returns the next TurnPlan and ordered
TurnLifecycleEffects. Framework applications use everruns; this
focused crate lets in-process, durable, and custom hosts share one turn
model.
Planning is sans I/O: hosts pass resolved facts and perform returned
lifecycle effects. The execution phases are portable async algorithms over
injected core/provider contracts such as everruns_core::MessageRetriever,
everruns_core::EventEmitter, and everruns_core::ToolExecutor. The
crate does not select stores, transports, processes, or deployment services.
Execution is the driver boundary. everruns-host implements it with
process-local state; everruns-durable implements it with checkpointed
state between scheduled activities. Both share phase behavior and turn
transitions without introducing an engine-to-host dependency.
§Example
use everruns_engine::{TurnPlan, TurnState};
fn accepts_plan(_state: &TurnState, _plan: &TurnPlan) {}Modules§
- native_
async - Opt-in native-call coordinator for streaming hosts. Normal Reason/Act hosts keep synchronous execution unless they install this coordinator explicitly.
Structs§
- ActAtom
- Atom that executes a batch of tool calls via the [
tool_scheduler] - ActInput
- Input for ActAtom
- ActOutcome
- Parsed
actactivity output the planner decides over. - ActPlan
- Engine-owned act scheduling payload.
- ActResult
- Result of the ActAtom
- ActScheduling
Facts - Session facts the host pre-resolves for the reason→act scheduling case.
- Client
Side Tool Hook - Hook that handles client-side tool calls from the ReasonResult.
- Connection
Setup Hook - Hook that detects tools requiring user connection setup and emits
synthetic
setup_connectiontool calls so the client can prompt the user. - Execution
Context - Correlation and resource identity for one execution phase within a turn.
- Execution
Transition - One engine decision and the ordered lifecycle effects it requires.
- Host
Facts - Host-resolved facts the engine needs but cannot fetch itself.
- Input
Atom - Atom that retrieves user input for a turn
- Input
Atom Input - Input for InputAtom
- Input
Atom Result - Result of the InputAtom
- Native
Execution Counts - Internal continuations accounted as part of one scheduled Reason activity.
- Output
Hard Limit Hook - Infrastructure hook that enforces a hard 64 KiB ceiling on tool result text.
- Reason
Atom - Atom that calls the LLM model for reasoning
- Reason
Input - Input for ReasonAtom
- Reason
Result - Result of the ReasonAtom
- Tool
Call Result - Result of a single tool call execution
- Turn
Execution - Default stateful implementation of the shared turn execution contract.
- Turn
State - Host-owned state carried across turn phases.
Enums§
- Activity
Outcome - Typed, parsed activity output the engine plans the next step from.
- Phase
Effect - One effect produced during Input/Reason/Act execution.
- Post
ActAction - Action a post-act hook wants ActAtom to perform.
- Turn
Lifecycle Effect - A lifecycle side effect the engine decided must be recorded, described as data rather than performed.
- Turn
Plan - Generic next-step decision for a host turn.
Traits§
- Execution
- Common contract implemented by immediate and durable turn executions.
- Phase
Effect Sink - Host-applied sink for live phase effects.
- Post
ActHook - Hook that runs after ActAtom finishes executing tools.
Functions§
- configured_
max_ tool_ concurrency - Resolve the effective tool concurrency cap, honoring the
EVERRUNS_ACT_MAX_TOOL_CONCURRENCYenv override (clamped to >= 1). - plan_
after_ act - Plan the next step after an
actactivity finishes. - plan_
after_ process_ input - Plan the reason step that follows a completed
process_inputactivity. - plan_
after_ reason - Plan the next step after a
reasonactivity finishes. - plan_
next_ turn - Plan the next host step after an activity finishes.
- reason_
schedules_ act - Does this reason outcome schedule an act phase?