pub trait RuntimeHostAdapter:
Send
+ Sync
+ Clone
+ 'static {
Show 39 methods
// Required methods
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;
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 ProviderStore> ⓘ;
fn message_store(&self) -> Arc<dyn MessageRetriever> ⓘ;
fn event_emitter(&self) -> Arc<dyn EventEmitter> ⓘ;
fn file_store(&self) -> Arc<dyn SessionFileSystem> ⓘ;
// Provided methods
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 utility_llm_service(&self) -> Option<Arc<dyn UtilityLlmService>> { ... }
fn egress_service(&self) -> Option<Arc<dyn EgressService>> { ... }
fn storage_store(&self) -> Option<Arc<dyn SessionStorageStore>> { ... }
fn knowledge_store(&self) -> Option<Arc<dyn KnowledgeStore>> { ... }
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 session_task_registry(&self) -> Option<Arc<dyn SessionTaskRegistry>> { ... }
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 knowledge_index_search(
&self,
_org_id: i64,
) -> Option<Arc<dyn KnowledgeIndexSearch>> { ... }
fn budget_checker(
&self,
_org_id: i64,
_agent_id: Option<AgentId>,
) -> Option<Arc<dyn BudgetChecker>> { ... }
fn payment_authority(
&self,
_org_id: i64,
_agent_id: Option<AgentId>,
) -> Option<Arc<dyn PaymentAuthority>> { ... }
fn outbound_tool_rate_limiter(
&self,
_org_id: i64,
) -> Option<Arc<dyn OutboundToolRateLimiter>> { ... }
fn durable_tool_result_store(
&self,
) -> Option<Arc<dyn DurableToolResultStore>> { ... }
fn subagent_spawn_store(&self) -> Option<Arc<dyn SubagentSpawnStore>> { ... }
fn stream_heartbeater(&self) -> Option<Arc<dyn StreamHeartbeater>> { ... }
fn partial_stream_store(&self) -> Option<Arc<dyn PartialStreamStore>> { ... }
fn reasoning_effort_handle(
&self,
_session_id: SessionId,
) -> Option<ReasoningEffortHandle> { ... }
fn provider_stall_timeout(&self) -> Option<Duration> { ... }
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 { ... }
}Expand description
Public adapter contract for server-backed or durable runtime hosts.
everruns-runtime owns shared host orchestration for both embedded and
durable execution. That includes phase execution (input -> reason -> act),
lifecycle emission, and the generic turn-strategy decisions used by durable
or custom hosts.
Host crates implement this trait to provide persistence, session-lifecycle plumbing, event delivery, and their own orchestration backend. The durable engine itself remains outside this crate.
Required Methods§
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,
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 ProviderStore> ⓘ
fn message_store(&self) -> Arc<dyn MessageRetriever> ⓘ
fn event_emitter(&self) -> Arc<dyn EventEmitter> ⓘ
fn file_store(&self) -> Arc<dyn SessionFileSystem> ⓘ
Provided Methods§
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 utility_llm_service(&self) -> Option<Arc<dyn UtilityLlmService>>
fn egress_service(&self) -> Option<Arc<dyn EgressService>>
fn storage_store(&self) -> Option<Arc<dyn SessionStorageStore>>
Sourcefn knowledge_store(&self) -> Option<Arc<dyn KnowledgeStore>>
fn knowledge_store(&self) -> Option<Arc<dyn KnowledgeStore>>
Knowledge store backing the search_knowledge tool. Default: none.
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 session_task_registry(&self) -> Option<Arc<dyn SessionTaskRegistry>>
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>>
Sourcefn knowledge_index_search(
&self,
_org_id: i64,
) -> Option<Arc<dyn KnowledgeIndexSearch>>
fn knowledge_index_search( &self, _org_id: i64, ) -> Option<Arc<dyn KnowledgeIndexSearch>>
Get the Knowledge Index search service for the search_index tool.
Org-scoped; returns None when retrieval is not available (e.g. gRPC
workers without a search RPC, or in-memory test backends).
fn budget_checker( &self, _org_id: i64, _agent_id: Option<AgentId>, ) -> Option<Arc<dyn BudgetChecker>>
Sourcefn 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>>
Per-org outbound tool-call rate limiter (TM-TOOL-009).
Default: None (no rate limiting — suitable for in-process / test environments).
Sourcefn durable_tool_result_store(&self) -> Option<Arc<dyn DurableToolResultStore>>
fn durable_tool_result_store(&self) -> Option<Arc<dyn DurableToolResultStore>>
Per-turn durable tool result store for act-activity idempotency (EVE-530).
Default: None (no durable claim/settle — every execution runs tools fresh).
Sourcefn subagent_spawn_store(&self) -> Option<Arc<dyn SubagentSpawnStore>>
fn subagent_spawn_store(&self) -> Option<Arc<dyn SubagentSpawnStore>>
Durable subagent spawn handle store for reattach on reclaim (EVE-535).
Default: None (no spawn dedup — dev/test mode or hosts without durable execution).
Sourcefn stream_heartbeater(&self) -> Option<Arc<dyn StreamHeartbeater>>
fn stream_heartbeater(&self) -> Option<Arc<dyn StreamHeartbeater>>
Stream-liveness heartbeater for the Reason activity (EVE-531).
Default: None (no heartbeats sent — durable workers supply one).
Sourcefn partial_stream_store(&self) -> Option<Arc<dyn PartialStreamStore>>
fn partial_stream_store(&self) -> Option<Arc<dyn PartialStreamStore>>
Partial-stream store for ContinuePartial recovery (EVE-532).
Default: None (no recovery; in-memory and dev hosts use this default).
Sourcefn reasoning_effort_handle(
&self,
_session_id: SessionId,
) -> Option<ReasoningEffortHandle>
fn reasoning_effort_handle( &self, _session_id: SessionId, ) -> Option<ReasoningEffortHandle>
Live, turn-scoped reasoning-effort handle for the given session (EVE-595).
When a host returns a handle, the Reason activity re-reads it on every
LLM step and the Act activity hands the same instance to each tool’s
ToolContext. A tool can then change effort mid-turn and have subsequent
LLM steps in the same turn observe it. Hosts MUST return the same
handle instance for a session across reason/act activities of one turn.
Default: None (effort is resolved solely from message controls).
Sourcefn provider_stall_timeout(&self) -> Option<Duration>
fn provider_stall_timeout(&self) -> Option<Duration>
Provider stall timeout for the Reason activity (EVE-531).
Default: None (use built-in 120s default).
Sourcefn 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 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".