pub struct Runtime {
pub bus: EventBus,
pub registry: ExtensionRegistry,
/* private fields */
}Fields§
§bus: EventBus§registry: ExtensionRegistryImplementations§
Source§impl Runtime
impl Runtime
Sourcepub async fn fork_thread(
&self,
request: ForkThreadRequest,
) -> Result<ForkThreadOutcome>
pub async fn fork_thread( &self, request: ForkThreadRequest, ) -> Result<ForkThreadOutcome>
Forks parent_thread_id into a new child thread backed by a fresh
workspace fork of the parent workspace.
Sourcepub async fn remove_thread_workspace_fork(
&self,
thread_id: &ThreadId,
confirm_path: &str,
) -> Result<WorkspaceFork>
pub async fn remove_thread_workspace_fork( &self, thread_id: &ThreadId, confirm_path: &str, ) -> Result<WorkspaceFork>
Removes the workspace fork behind a forked thread. Destructive and
explicit: confirm_path must match the fork workspace exactly. The
thread itself is kept (status flips to Removed) so the conversation
stays readable.
Source§impl Runtime
impl Runtime
Sourcepub fn fork_providers(&self) -> Vec<ForkProviderDescriptor>
pub fn fork_providers(&self) -> Vec<ForkProviderDescriptor>
Lists registered fork providers.
Sourcepub fn fork_provider(&self, provider_id: &str) -> Result<Arc<dyn ForkProvider>>
pub fn fork_provider(&self, provider_id: &str) -> Result<Arc<dyn ForkProvider>>
Resolves a fork provider with an actionable error naming the available ids.
Sourcepub async fn create_workspace_fork(
&self,
provider_id: &str,
request: ForkRequest,
) -> Result<WorkspaceFork>
pub async fn create_workspace_fork( &self, provider_id: &str, request: ForkRequest, ) -> Result<WorkspaceFork>
Creates a workspace fork after host-side validation.
pub async fn list_workspace_forks( &self, provider_id: &str, source_workspace: &Path, ) -> Result<Vec<WorkspaceFork>>
pub async fn resume_workspace_fork( &self, provider_id: &str, id: &ForkId, ) -> Result<WorkspaceFork>
Sourcepub async fn remove_workspace_fork(
&self,
provider_id: &str,
id: &ForkId,
policy: RemoveForkPolicy,
) -> Result<RemoveForkResult>
pub async fn remove_workspace_fork( &self, provider_id: &str, id: &ForkId, policy: RemoveForkPolicy, ) -> Result<RemoveForkResult>
Removes a fork; destructive and always path-confirmed by the provider contract.
Source§impl Runtime
impl Runtime
pub async fn thread_goal_get( &self, thread_id: &ThreadId, ) -> Result<Option<ThreadGoal>>
pub async fn thread_goal_set( &self, thread_id: &ThreadId, patch: ThreadGoalPatch, ) -> Result<Option<ThreadGoal>>
pub async fn thread_goal_clear(&self, thread_id: &ThreadId) -> Result<bool>
pub async fn apply_external_goal_set_effects( self: &Arc<Self>, previous_goal: Option<ThreadGoal>, goal: Option<ThreadGoal>, ) -> Result<Option<ThreadId>>
pub async fn continue_active_goal_if_idle( self: &Arc<Self>, thread_id: ThreadId, ) -> Result<Option<ThreadId>>
Source§impl Runtime
impl Runtime
pub async fn list_roadmaps(&self) -> Result<Vec<DocumentSummary>>
pub async fn open_roadmap(&self, path: &str) -> Result<Document>
pub async fn focus_roadmap_task(&self, path: &str, task_id: &str) -> Result<()>
pub async fn set_roadmap_task( &self, path: &str, task_id: &str, checked: bool, evidence: &str, ) -> Result<()>
pub async fn validate_roadmap(&self, path: &str) -> Result<ValidationResult>
pub async fn list_roadmap_threads( &self, path: &str, ) -> Result<Vec<ThreadAttachment>>
pub async fn spawn_roadmap_thread( &self, path: &str, task_id: &str, ) -> Result<ThreadAttachment>
pub async fn attach_roadmap_thread( &self, path: &str, task_id: &str, thread_id: &str, title: Option<String>, ) -> Result<ThreadAttachment>
pub async fn enter_roadmap_mode(&self, path: &str) -> Result<()>
Source§impl Runtime
impl Runtime
pub fn new(registry: ExtensionRegistry, config: RuntimeConfig) -> Result<Self>
pub fn from_engine(engine: Arc<dyn InferenceEngine>) -> Result<Self>
pub fn fake() -> Result<Self>
pub fn subscribe_events(&self) -> Receiver<EventEnvelope>
pub fn registry(&self) -> &ExtensionRegistry
pub fn media_generation(&self) -> Arc<MediaGenerationService>
pub fn context_artifacts(&self) -> ContextArtifactStore
pub async fn execute_workflow_tool( &self, thread_id: ThreadId, tool_name: &str, arguments: Value, ) -> Result<ToolResult>
pub async fn status(&self) -> RuntimeConfig
pub async fn set_skills(&self, skills: SkillRegistry)
pub async fn skills_snapshot(&self) -> SkillRegistry
pub fn workspace(&self) -> PathBuf
pub async fn set_remote_runner_destination( &self, destination: Option<RunnerDestination>, )
pub async fn set_file_backed_dynamic_context( &self, enabled: bool, ) -> RuntimeConfig
pub async fn set_command_shell(&self, shell: String) -> RuntimeConfig
pub async fn pending_plan_exit(&self) -> Option<PendingPlanExit>
pub async fn set_policy_mode( &self, mode: PolicyMode, reason: Option<String>, ) -> Result<RuntimeConfig>
pub async fn set_hosted_web_search( &self, mode: HostedWebSearchMode, ) -> Result<RuntimeConfig>
pub async fn record_pending_plan_exit(&self, pending: PendingPlanExit)
pub async fn resolve_pending_plan_exit( &self, request_id: &str, approved: bool, ) -> Result<Option<PendingPlanExit>>
pub async fn resolve_tool_approval( &self, approval_id: &str, approved: bool, ) -> Result<bool>
pub async fn request_app_server_tool_approval( &self, call: ToolCall, reason: Option<String>, ) -> Result<bool>
Sourcepub async fn resolve_external_tool_call(
&self,
request_id: &str,
resolution: ExternalToolResolution,
) -> Result<bool>
pub async fn resolve_external_tool_call( &self, request_id: &str, resolution: ExternalToolResolution, ) -> Result<bool>
Completes a pending host-executed tool call (tools/resolve). Returns false when the
request id is unknown, already resolved, timed out, or cancelled by a turn interrupt.
pub async fn resolve_user_input( &self, request_id: &str, answers: Value, ) -> Result<bool>
pub async fn select_provider( &self, provider: String, model: Option<String>, reasoning: Option<String>, ) -> Result<RuntimeConfig>
pub async fn preview_provider_selection( &self, provider: String, model: Option<String>, reasoning: Option<String>, ) -> Result<RuntimeConfig>
pub async fn effective_reasoning(&self) -> String
pub fn effective_reasoning_for_config(cfg: &RuntimeConfig) -> String
pub async fn set_dynamic_workflow_effort( &self, effort_profile: DynamicWorkflowEffortProfile, ) -> RuntimeConfig
pub async fn dynamic_workflow_trigger_decision( &self, message: &str, ) -> WorkflowTriggerDecision
pub async fn create_thread( &self, title: Option<String>, ) -> Result<ThreadMetadata>
Sourcepub async fn validate_thread_runner_selection(
&self,
selection: ThreadRunnerSelection,
) -> Result<()>
pub async fn validate_thread_runner_selection( &self, selection: ThreadRunnerSelection, ) -> Result<()>
Validates a runner selection without creating a thread; the placeholder destination id only appears in error messages.
pub async fn create_thread_with( &self, req: CreateThreadRequest, ) -> Result<ThreadMetadata>
pub async fn list_threads(&self) -> Result<Vec<ThreadMetadata>>
pub async fn list_threads_page( &self, options: ThreadListOptions, ) -> Result<ThreadListPage>
pub async fn load_thread_metadata( &self, thread_id: &str, ) -> Result<Option<ThreadMetadata>>
pub async fn archive_thread(&self, thread_id: &str) -> Result<bool>
pub async fn start_team(&self, req: TeamStartRequest) -> Result<TeamState>
pub async fn list_teams(&self) -> Vec<TeamState>
pub async fn read_team(&self, team_id: &str) -> Option<TeamState>
pub async fn start_team_member( &self, team_id: &str, req: TeamMemberStartRequest, ) -> Result<TeamState>
pub async fn message_team_member( self: &Arc<Self>, team_id: &str, member_id: &str, message: String, ) -> Result<TurnId>
pub async fn set_team_member_policy_mode( &self, team_id: &str, member_id: &str, policy_mode: PolicyMode, ) -> Result<TeamState>
pub async fn interrupt_team_member( &self, team_id: &str, member_id: &str, ) -> Result<Option<TurnId>>
pub async fn close_team_member( &self, team_id: &str, member_id: &str, ) -> Result<TeamMemberDescriptor>
pub async fn cleanup_team(&self, team_id: &str, force: bool) -> Result<bool>
pub async fn effective_policy_mode_for_thread( &self, thread_id: &str, ) -> PolicyMode
pub async fn load_thread( &self, thread_id: &ThreadId, ) -> Result<Option<ThreadSnapshot>>
pub async fn workspace_for_thread(&self, thread_id: &ThreadId) -> Result<String>
pub async fn set_thread_selection_mode( &self, thread_id: &ThreadId, selection_mode: ModelSelectionMode, ) -> Result<()>
pub fn start_turn( self: &Arc<Self>, req: StartTurnRequest, ) -> BoxFuture<'_, Result<TurnId>>
Sourcepub async fn active_turn_count(&self) -> usize
pub async fn active_turn_count(&self) -> usize
Number of currently running turns across all threads. Hosted runtime pools use this to avoid evicting tenants with active work.
pub async fn active_turn_for_thread( &self, thread_id: &ThreadId, ) -> Option<TurnId>
pub async fn thread_activity(&self, thread_id: &ThreadId) -> ThreadActivity
pub async fn interrupt_turn( &self, thread_id: ThreadId, turn_id: TurnId, ) -> Result<()>
pub async fn steer_turn( &self, thread_id: ThreadId, turn_id: TurnId, message: String, images: Vec<InputImage>, ) -> Result<()>
pub async fn tool_specs(&self) -> Vec<ToolSpec>
pub fn subagent_definitions(&self) -> Vec<SubagentDefinition>
pub async fn emit(&self, event: RoderEvent) -> EventEnvelope
Sourcepub async fn record_thread_item_event_kind(
&self,
thread_id: &ThreadId,
turn_id: &TurnId,
timestamp: OffsetDateTime,
kind: ThreadItemEventKind,
) -> Result<ThreadItemEvent>
pub async fn record_thread_item_event_kind( &self, thread_id: &ThreadId, turn_id: &TurnId, timestamp: OffsetDateTime, kind: ThreadItemEventKind, ) -> Result<ThreadItemEvent>
Records a projected thread item event and persists it through the configured thread store.
App-server protocol notification bridges currently call this after translating runtime
events into item events. Headless runtime consumers that subscribe to RoderEvent directly
must make the same call if they need the derived item event stream persisted.
pub async fn thread_item_exists( &self, thread_id: &ThreadId, turn_id: &TurnId, item_id: &str, ) -> Result<bool>
pub async fn current_reasoning_item_id( &self, thread_id: &ThreadId, turn_id: &TurnId, ) -> Result<Option<String>>
pub async fn latest_transcript_item_index( &self, thread_id: &ThreadId, turn_id: &TurnId, ) -> Result<Option<usize>>
Auto Trait Implementations§
impl !Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl !UnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
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<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.