Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime {
    pub bus: EventBus,
    pub registry: ExtensionRegistry,
    /* private fields */
}

Fields§

§bus: EventBus§registry: ExtensionRegistry

Implementations§

Source§

impl Runtime

Source

pub async fn force_compact_thread( &self, thread_id: &ThreadId, turn_id: &TurnId, preserve_hint: Option<String>, ) -> Result<ForceCompactOutcome>

Source§

impl Runtime

Source

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.

Source

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

Source

pub fn fork_providers(&self) -> Vec<ForkProviderDescriptor>

Lists registered fork providers.

Source

pub fn fork_provider(&self, provider_id: &str) -> Result<Arc<dyn ForkProvider>>

Resolves a fork provider with an actionable error naming the available ids.

Source

pub async fn create_workspace_fork( &self, provider_id: &str, request: ForkRequest, ) -> Result<WorkspaceFork>

Creates a workspace fork after host-side validation.

Source

pub async fn list_workspace_forks( &self, provider_id: &str, source_workspace: &Path, ) -> Result<Vec<WorkspaceFork>>

Source

pub async fn resume_workspace_fork( &self, provider_id: &str, id: &ForkId, ) -> Result<WorkspaceFork>

Source

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

Source

pub async fn thread_goal_get( &self, thread_id: &ThreadId, ) -> Result<Option<ThreadGoal>>

Source

pub async fn thread_goal_set( &self, thread_id: &ThreadId, patch: ThreadGoalPatch, ) -> Result<Option<ThreadGoal>>

Source

pub async fn thread_goal_clear(&self, thread_id: &ThreadId) -> Result<bool>

Source

pub async fn apply_external_goal_set_effects( self: &Arc<Self>, previous_goal: Option<ThreadGoal>, goal: Option<ThreadGoal>, ) -> Result<Option<ThreadId>>

Source

pub async fn continue_active_goal_if_idle( self: &Arc<Self>, thread_id: ThreadId, ) -> Result<Option<ThreadId>>

Source§

impl Runtime

Source

pub async fn list_roadmaps(&self) -> Result<Vec<DocumentSummary>>

Source

pub async fn open_roadmap(&self, path: &str) -> Result<Document>

Source

pub async fn focus_roadmap_task(&self, path: &str, task_id: &str) -> Result<()>

Source

pub async fn set_roadmap_task( &self, path: &str, task_id: &str, checked: bool, evidence: &str, ) -> Result<()>

Source

pub async fn validate_roadmap(&self, path: &str) -> Result<ValidationResult>

Source

pub async fn list_roadmap_threads( &self, path: &str, ) -> Result<Vec<ThreadAttachment>>

Source

pub async fn spawn_roadmap_thread( &self, path: &str, task_id: &str, ) -> Result<ThreadAttachment>

Source

pub async fn attach_roadmap_thread( &self, path: &str, task_id: &str, thread_id: &str, title: Option<String>, ) -> Result<ThreadAttachment>

Source

pub async fn enter_roadmap_mode(&self, path: &str) -> Result<()>

Source§

impl Runtime

Source

pub fn new(registry: ExtensionRegistry, config: RuntimeConfig) -> Result<Self>

Source

pub fn from_engine(engine: Arc<dyn InferenceEngine>) -> Result<Self>

Source

pub fn fake() -> Result<Self>

Source

pub fn subscribe_events(&self) -> Receiver<EventEnvelope>

Source

pub fn registry(&self) -> &ExtensionRegistry

Source

pub fn media_generation(&self) -> Arc<MediaGenerationService>

Source

pub fn context_artifacts(&self) -> ContextArtifactStore

Source

pub async fn execute_workflow_tool( &self, thread_id: ThreadId, tool_name: &str, arguments: Value, ) -> Result<ToolResult>

Source

pub async fn status(&self) -> RuntimeConfig

Source

pub async fn set_skills(&self, skills: SkillRegistry)

Source

pub async fn skills_snapshot(&self) -> SkillRegistry

Source

pub fn workspace(&self) -> PathBuf

Source

pub async fn set_remote_runner_destination( &self, destination: Option<RunnerDestination>, )

Source

pub async fn set_file_backed_dynamic_context( &self, enabled: bool, ) -> RuntimeConfig

Source

pub async fn set_command_shell(&self, shell: String) -> RuntimeConfig

Source

pub async fn pending_plan_exit(&self) -> Option<PendingPlanExit>

Source

pub async fn set_policy_mode( &self, mode: PolicyMode, reason: Option<String>, ) -> Result<RuntimeConfig>

Source

pub async fn record_pending_plan_exit(&self, pending: PendingPlanExit)

Source

pub async fn resolve_pending_plan_exit( &self, request_id: &str, approved: bool, ) -> Result<Option<PendingPlanExit>>

Source

pub async fn resolve_tool_approval( &self, approval_id: &str, approved: bool, ) -> Result<bool>

Source

pub async fn request_app_server_tool_approval( &self, call: ToolCall, reason: Option<String>, ) -> Result<bool>

Source

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.

Source

pub async fn resolve_user_input( &self, request_id: &str, answers: Value, ) -> Result<bool>

Source

pub async fn select_provider( &self, provider: String, model: Option<String>, reasoning: Option<String>, ) -> Result<RuntimeConfig>

Source

pub async fn preview_provider_selection( &self, provider: String, model: Option<String>, reasoning: Option<String>, ) -> Result<RuntimeConfig>

Source

pub async fn effective_reasoning(&self) -> String

Source

pub fn effective_reasoning_for_config(cfg: &RuntimeConfig) -> String

Source

pub async fn set_dynamic_workflow_effort( &self, effort_profile: DynamicWorkflowEffortProfile, ) -> RuntimeConfig

Source

pub async fn dynamic_workflow_trigger_decision( &self, message: &str, ) -> WorkflowTriggerDecision

Source

pub async fn create_thread( &self, title: Option<String>, ) -> Result<ThreadMetadata>

Source

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.

Source

pub async fn create_thread_with( &self, req: CreateThreadRequest, ) -> Result<ThreadMetadata>

Source

pub async fn list_threads(&self) -> Result<Vec<ThreadMetadata>>

Source

pub async fn list_threads_page( &self, options: ThreadListOptions, ) -> Result<ThreadListPage>

Source

pub async fn load_thread_metadata( &self, thread_id: &str, ) -> Result<Option<ThreadMetadata>>

Source

pub async fn archive_thread(&self, thread_id: &str) -> Result<bool>

Source

pub async fn start_team(&self, req: TeamStartRequest) -> Result<TeamState>

Source

pub async fn list_teams(&self) -> Vec<TeamState>

Source

pub async fn read_team(&self, team_id: &str) -> Option<TeamState>

Source

pub async fn start_team_member( &self, team_id: &str, req: TeamMemberStartRequest, ) -> Result<TeamState>

Source

pub async fn message_team_member( self: &Arc<Self>, team_id: &str, member_id: &str, message: String, ) -> Result<TurnId>

Source

pub async fn set_team_member_policy_mode( &self, team_id: &str, member_id: &str, policy_mode: PolicyMode, ) -> Result<TeamState>

Source

pub async fn interrupt_team_member( &self, team_id: &str, member_id: &str, ) -> Result<Option<TurnId>>

Source

pub async fn close_team_member( &self, team_id: &str, member_id: &str, ) -> Result<TeamMemberDescriptor>

Source

pub async fn cleanup_team(&self, team_id: &str, force: bool) -> Result<bool>

Source

pub async fn effective_policy_mode_for_thread( &self, thread_id: &str, ) -> PolicyMode

Source

pub async fn load_thread( &self, thread_id: &ThreadId, ) -> Result<Option<ThreadSnapshot>>

Source

pub async fn workspace_for_thread(&self, thread_id: &ThreadId) -> Result<String>

Source

pub async fn set_thread_selection_mode( &self, thread_id: &ThreadId, selection_mode: ModelSelectionMode, ) -> Result<()>

Source

pub fn start_turn( self: &Arc<Self>, req: StartTurnRequest, ) -> BoxFuture<'_, Result<TurnId>>

Source

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.

Source

pub async fn active_turn_for_thread( &self, thread_id: &ThreadId, ) -> Option<TurnId>

Source

pub async fn thread_activity(&self, thread_id: &ThreadId) -> ThreadActivity

Source

pub async fn interrupt_turn( &self, thread_id: ThreadId, turn_id: TurnId, ) -> Result<()>

Source

pub async fn steer_turn( &self, thread_id: ThreadId, turn_id: TurnId, message: String, images: Vec<InputImage>, ) -> Result<()>

Source

pub async fn tool_specs(&self) -> Vec<ToolSpec>

Source

pub fn subagent_definitions(&self) -> Vec<SubagentDefinition>

Source

pub async fn emit(&self, event: RoderEvent) -> EventEnvelope

Source

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.

Source

pub async fn thread_item_exists( &self, thread_id: &ThreadId, turn_id: &TurnId, item_id: &str, ) -> Result<bool>

Source

pub async fn current_reasoning_item_id( &self, thread_id: &ThreadId, turn_id: &TurnId, ) -> Result<Option<String>>

Source

pub async fn latest_transcript_item_index( &self, thread_id: &ThreadId, turn_id: &TurnId, ) -> Result<Option<usize>>

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<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

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

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .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
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .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
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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