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
impl InProcessRuntime
Sourcepub fn builder() -> InProcessRuntimeBuilder
pub fn builder() -> InProcessRuntimeBuilder
Create a builder for the in-process runtime.
Sourcepub fn default_session_id(&self) -> Option<SessionId>
pub fn default_session_id(&self) -> Option<SessionId>
Return the default session id seeded by
InProcessRuntimeBuilder::single_session, if one was configured.
Sourcepub async fn run_turn(
&self,
session_id: SessionId,
input: impl Into<InputMessage>,
) -> Result<TurnResult>
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.
pub async fn run_text_turn( &self, session_id: SessionId, text: impl Into<String>, ) -> Result<TurnResult>
Sourcepub async fn messages(&self, session_id: SessionId) -> Result<Vec<Message>>
pub async fn messages(&self, session_id: SessionId) -> Result<Vec<Message>>
Load the current message history for a session.
Sourcepub async fn read_file(
&self,
session_id: SessionId,
path: &str,
) -> Result<Option<SessionFile>>
pub async fn read_file( &self, session_id: SessionId, path: &str, ) -> Result<Option<SessionFile>>
Read a file from the in-memory session filesystem.
Sourcepub async fn load_context(
&self,
session_id: SessionId,
) -> Result<AssembledTurnContext>
pub async fn load_context( &self, session_id: SessionId, ) -> Result<AssembledTurnContext>
Assemble the current runtime context for a session without executing a turn.
Sourcepub async fn events(&self) -> Result<Vec<Event>>
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).
Sourcepub async fn execute_command(
&self,
session_id: SessionId,
request: ExecuteCommandRequest,
) -> Result<CommandResult>
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.
Sourcepub async fn list_commands(
&self,
session_id: SessionId,
) -> Result<Vec<CommandDescriptor>>
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
impl Clone for InProcessRuntime
Source§fn clone(&self) -> InProcessRuntime
fn clone(&self) -> InProcessRuntime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl RuntimeHostAdapter for InProcessRuntime
impl RuntimeHostAdapter for InProcessRuntime
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,
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,
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,
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,
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_* 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.fn capability_registry(&self) -> CapabilityRegistry
fn driver_registry(&self) -> DriverRegistry
fn harness_store(&self, _org_id: i64) -> Arc<dyn HarnessStore>
fn agent_store(&self, _org_id: i64) -> Arc<dyn AgentStore>
fn session_store(&self, _org_id: i64) -> Arc<dyn SessionStore>
fn session_mutator(&self, _org_id: i64) -> Arc<dyn SessionMutator>
fn provider_store(&self, _org_id: i64) -> Arc<dyn LlmProviderStore>
fn message_store(&self) -> Arc<dyn MessageRetriever>
fn event_emitter(&self) -> Arc<dyn EventEmitter>
fn file_store(&self) -> Arc<dyn SessionFileSystem>
fn storage_store(&self) -> Option<Arc<dyn SessionStorageStore>>
fn utility_llm_service(&self) -> Option<Arc<dyn UtilityLlmService>>
fn egress_service(&self) -> Option<Arc<dyn EgressService>>
fn memory_store(&self, _org_id: i64) -> Option<Arc<dyn MemoryStoreBackend>>
fn image_resolver(&self, _org_id: i64) -> Option<Arc<dyn ImageResolver>>
fn image_artifact_store( &self, _org_id: i64, ) -> Option<Arc<dyn ImageArtifactStore>>
fn provider_credential_store( &self, _org_id: i64, ) -> Option<Arc<dyn ProviderCredentialStore>>
fn connection_resolver(&self) -> Option<Arc<dyn UserConnectionResolver>>
fn sqldb_store(&self) -> Option<SessionSqlDbStoreRef>
fn leased_resource_store(&self) -> Option<Arc<dyn LeasedResourceStore>>
fn session_resource_registry(&self) -> Option<Arc<dyn SessionResourceRegistry>>
fn schedule_store(&self, _org_id: i64) -> Option<Arc<dyn SessionScheduleStore>>
fn platform_store( &self, _org_id: i64, _session_id: SessionId, ) -> Option<Arc<dyn PlatformStore>>
fn budget_checker( &self, _org_id: i64, _agent_id: Option<AgentId>, ) -> Option<Arc<dyn BudgetChecker>>
Source§fn outbound_tool_rate_limiter(
&self,
_org_id: i64,
) -> Option<Arc<dyn OutboundToolRateLimiter>>
fn outbound_tool_rate_limiter( &self, _org_id: i64, ) -> Option<Arc<dyn OutboundToolRateLimiter>>
None (no rate limiting — suitable for in-process / test environments).Auto Trait Implementations§
impl !RefUnwindSafe for InProcessRuntime
impl !UnwindSafe for InProcessRuntime
impl Freeze for InProcessRuntime
impl Send for InProcessRuntime
impl Sync for InProcessRuntime
impl Unpin for InProcessRuntime
impl UnsafeUnpin for InProcessRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request