Skip to main content

TaskHost

Trait TaskHost 

Source
pub trait TaskHost: Send + Sync {
Show 15 methods // Provided methods fn inject_turn_input<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, _input: InjectedTurnInput, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn spawn_hidden_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _label: &'life2 str, _task: PluginSessionTask, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn await_hidden_tasks<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn spawn_managed_task<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, _spec: BackgroundTaskRegistration, _task: PluginSessionTask, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn cancel_managed_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn register_background_task<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, _spec: BackgroundTaskRegistration, _cancel: Option<LocalBackgroundTaskCancel>, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn unregister_background_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn complete_background_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, _state: BackgroundTaskState, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn transition_background_task_live_state<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, _state: BackgroundTaskState, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn list_background_tasks<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<BackgroundTaskRecord>, PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn cancel_background_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<BackgroundTaskRecord, PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn cancel_all_background_tasks<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<BackgroundTaskRecord>, PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn validate_async_handles_visible<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _handle_ids: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn transfer_async_handles<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _from_session_id: &'life1 str, _to_session_id: &'life2 str, _handle_ids: &'life3 [String], ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn cancel_unreferenced_async_handles<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _keep_handle_ids: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<Vec<BackgroundTaskRecord>, PluginError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... }
}

Provided Methods§

Source

fn inject_turn_input<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, _input: InjectedTurnInput, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Push a user-visible message into the target session’s turn-input injection bridge so it surfaces at the next iteration boundary of the current turn (or at the start of the next turn if the target is idle). Used by monitor and other wake-up flows where a note should land at the next available step rather than waiting for a brand-new task.

Source

fn spawn_hidden_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _label: &'life2 str, _task: PluginSessionTask, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn await_hidden_tasks<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn spawn_managed_task<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, _spec: BackgroundTaskRegistration, _task: PluginSessionTask, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn cancel_managed_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn register_background_task<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, _spec: BackgroundTaskRegistration, _cancel: Option<LocalBackgroundTaskCancel>, ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn unregister_background_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn complete_background_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, _state: BackgroundTaskState, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn transition_background_task_live_state<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, _state: BackgroundTaskState, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Transition a still-live background task between the non-terminal Running and Idle run states. Used by subagent hosts to reflect whether the subagent is actively working or waiting for a follow-up task.

Source

fn list_background_tasks<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<BackgroundTaskRecord>, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn cancel_background_task<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _task_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<BackgroundTaskRecord, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dispatch a kind-aware cancel for any registered background task. Monitor tasks terminate their process trees; subagent tasks close the agent subtree; other managed tasks are aborted.

Source

fn cancel_all_background_tasks<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<BackgroundTaskRecord>, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn validate_async_handles_visible<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _handle_ids: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn transfer_async_handles<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _from_session_id: &'life1 str, _to_session_id: &'life2 str, _handle_ids: &'life3 [String], ) -> Pin<Box<dyn Future<Output = Result<(), PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn cancel_unreferenced_async_handles<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _keep_handle_ids: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<Vec<BackgroundTaskRecord>, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§