Skip to main content

InProcessRuntime

Struct InProcessRuntime 

Source
pub struct InProcessRuntime { /* private fields */ }
Expand description

Public in-process runtime backed by either in-memory or custom stores.

This runtime is intended for embedders who want to execute Everruns harnesses inside their own process while controlling capabilities, harness definitions, and driver registrations directly in Rust.

Implementations§

Source§

impl InProcessRuntime

Source

pub fn builder() -> InProcessRuntimeBuilder

Create a builder for the in-process runtime.

Source

pub fn default_session_id(&self) -> Option<SessionId>

Return the default session id seeded by InProcessRuntimeBuilder::single_session, if one was configured.

Source

pub async fn run_turn( &self, session_id: SessionId, input: impl Into<InputMessage>, ) -> Result<TurnResult>

Execute one turn for an existing session.

The input message is stored in the runtime history, an input.message event is emitted, and the turn then executes the shared core input -> reason -> act state machine.

Source

pub async fn run_text_turn( &self, session_id: SessionId, text: impl Into<String>, ) -> Result<TurnResult>

Source

pub async fn messages(&self, session_id: SessionId) -> Result<Vec<Message>>

Load the current message history for a session.

Source

pub async fn read_file( &self, session_id: SessionId, path: &str, ) -> Result<Option<SessionFile>>

Read a file from the in-memory session filesystem.

Source

pub async fn load_context( &self, session_id: SessionId, ) -> Result<AssembledTurnContext>

Assemble the current runtime context for a session without executing a turn.

Source

pub async fn events(&self) -> Result<Vec<Event>>

Return all collected events from the runtime event bus.

Event buses that do not retain events return an empty Vec (see EventBus::collected_events).

Source

pub async fn execute_command( &self, session_id: SessionId, request: ExecuteCommandRequest, ) -> Result<CommandResult>

Execute a system command declared by a registered capability.

Looks up the first capability whose commands() includes the named command (in capability-resolution order) and delegates to its execute_command. Returns an error if no capability declares the requested name. The coding-CLI example uses this for /model (provided by ModelSwitcherCapability) so the dispatch path stays inside the capability instead of the TUI’s local handle_command branches.

Source

pub async fn list_commands( &self, session_id: SessionId, ) -> Result<Vec<CommandDescriptor>>

List slash commands available for a session.

Resolves the session’s harness/agent capability chain and aggregates commands declared via Capability::commands, deduplicated by name (first occurrence wins, matching the order of resolved capabilities). This is the embedded equivalent of the server’s GET /v1/sessions/{id}/commands system-commands list — skill commands are not included here because skills are discovered via the platform filesystem rather than the capability registry.

Trait Implementations§

Source§

impl Clone for InProcessRuntime

Source§

fn clone(&self) -> InProcessRuntime

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl RuntimeHostAdapter for InProcessRuntime

Source§

fn get_agent<'life0, 'async_trait>( &'life0 self, _org_id: i64, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<Option<Agent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_harness<'life0, 'async_trait>( &'life0 self, _org_id: i64, harness_id: HarnessId, ) -> Pin<Box<dyn Future<Output = Result<Option<Harness>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn set_session_status<'life0, 'async_trait>( &'life0 self, _org_id: i64, session_id: SessionId, _status: SessionStatus, ) -> Pin<Box<dyn Future<Output = Result<Session>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn load_turn_context<'life0, 'async_trait>( &'life0 self, _org_id: i64, session_id: SessionId, ) -> Pin<Box<dyn Future<Output = Result<RuntimeHostTurnContext>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn mcp_executor<'life0, 'async_trait>( &'life0 self, _org_id: i64, session_id: SessionId, ) -> Pin<Box<dyn Future<Output = Option<Arc<McpExecutor>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

MCP executor routing mcp_* tool calls for this session, if the host configures MCP (specs/runtime-mcp.md D4). Default: None, so hosts without scoped MCP servers keep the plain tool registry unchanged.
Source§

fn capability_registry(&self) -> CapabilityRegistry

Source§

fn driver_registry(&self) -> DriverRegistry

Source§

fn harness_store(&self, _org_id: i64) -> Arc<dyn HarnessStore>

Source§

fn agent_store(&self, _org_id: i64) -> Arc<dyn AgentStore>

Source§

fn session_store(&self, _org_id: i64) -> Arc<dyn SessionStore>

Source§

fn session_mutator(&self, _org_id: i64) -> Arc<dyn SessionMutator>

Source§

fn provider_store(&self, _org_id: i64) -> Arc<dyn LlmProviderStore>

Source§

fn message_store(&self) -> Arc<dyn MessageRetriever>

Source§

fn event_emitter(&self) -> Arc<dyn EventEmitter>

Source§

fn file_store(&self) -> Arc<dyn SessionFileSystem>

Source§

fn storage_store(&self) -> Option<Arc<dyn SessionStorageStore>>

Source§

fn utility_llm_service(&self) -> Option<Arc<dyn UtilityLlmService>>

Source§

fn egress_service(&self) -> Option<Arc<dyn EgressService>>

Source§

fn memory_store(&self, _org_id: i64) -> Option<Arc<dyn MemoryStoreBackend>>

Source§

fn image_resolver(&self, _org_id: i64) -> Option<Arc<dyn ImageResolver>>

Source§

fn image_artifact_store( &self, _org_id: i64, ) -> Option<Arc<dyn ImageArtifactStore>>

Source§

fn provider_credential_store( &self, _org_id: i64, ) -> Option<Arc<dyn ProviderCredentialStore>>

Source§

fn connection_resolver(&self) -> Option<Arc<dyn UserConnectionResolver>>

Source§

fn sqldb_store(&self) -> Option<SessionSqlDbStoreRef>

Source§

fn leased_resource_store(&self) -> Option<Arc<dyn LeasedResourceStore>>

Source§

fn session_resource_registry(&self) -> Option<Arc<dyn SessionResourceRegistry>>

Source§

fn schedule_store(&self, _org_id: i64) -> Option<Arc<dyn SessionScheduleStore>>

Source§

fn platform_store( &self, _org_id: i64, _session_id: SessionId, ) -> Option<Arc<dyn PlatformStore>>

Source§

fn budget_checker( &self, _org_id: i64, _agent_id: Option<AgentId>, ) -> Option<Arc<dyn BudgetChecker>>

Source§

fn payment_authority( &self, _org_id: i64, _agent_id: Option<AgentId>, ) -> Option<Arc<dyn PaymentAuthority>>

Source§

fn outbound_tool_rate_limiter( &self, _org_id: i64, ) -> Option<Arc<dyn OutboundToolRateLimiter>>

Per-org outbound tool-call rate limiter (TM-TOOL-009). Default: None (no rate limiting — suitable for in-process / test environments).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more