pub struct EngineHandle<P, R> {
pub tx_op: Sender<Op>,
pub rx_event: Arc<RwLock<Receiver<Event>>>,
/* private fields */
}Expand description
Handle to communicate with the engine.
Fields§
§tx_op: Sender<Op>Send operations to the engine.
rx_event: Arc<RwLock<Receiver<Event>>>Receive events from the engine.
Implementations§
Source§impl<P, R> EngineHandle<P, R>
impl<P, R> EngineHandle<P, R>
Sourcepub fn new(
tx_op: Sender<Op>,
rx_event: Arc<RwLock<Receiver<Event>>>,
cancel_token: Arc<StdMutex<CancellationToken>>,
tx_approval: Sender<ApprovalDecision<P>>,
tx_user_input: Sender<UserInputDecision<R>>,
tx_steer: Sender<String>,
) -> Self
pub fn new( tx_op: Sender<Op>, rx_event: Arc<RwLock<Receiver<Event>>>, cancel_token: Arc<StdMutex<CancellationToken>>, tx_approval: Sender<ApprovalDecision<P>>, tx_user_input: Sender<UserInputDecision<R>>, tx_steer: Sender<String>, ) -> Self
Construct a new handle. Intended for the engine’s bootstrap path; the
returned handle is Clone, so the runtime/UI layer copies it cheaply.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Check if a request is currently cancelled.
Sourcepub async fn approve_tool_call(&self, id: impl Into<String>) -> Result<()>
pub async fn approve_tool_call(&self, id: impl Into<String>) -> Result<()>
Approve a pending tool call.
Sourcepub async fn approve_tool_call_with_options(
&self,
id: impl Into<String>,
cache_key: Option<String>,
remember_for_session: bool,
) -> Result<()>
pub async fn approve_tool_call_with_options( &self, id: impl Into<String>, cache_key: Option<String>, remember_for_session: bool, ) -> Result<()>
Approve a pending tool call and optionally remember the decision for the session.
Sourcepub async fn deny_tool_call(&self, id: impl Into<String>) -> Result<()>
pub async fn deny_tool_call(&self, id: impl Into<String>) -> Result<()>
Deny a pending tool call.
Sourcepub async fn retry_tool_with_policy(
&self,
id: impl Into<String>,
policy: P,
) -> Result<()>
pub async fn retry_tool_with_policy( &self, id: impl Into<String>, policy: P, ) -> Result<()>
Retry a tool call with an elevated sandbox policy.
Sourcepub async fn submit_user_input(
&self,
id: impl Into<String>,
response: R,
) -> Result<()>
pub async fn submit_user_input( &self, id: impl Into<String>, response: R, ) -> Result<()>
Submit a response for request_user_input.
Sourcepub async fn cancel_user_input(&self, id: impl Into<String>) -> Result<()>
pub async fn cancel_user_input(&self, id: impl Into<String>) -> Result<()>
Cancel a request_user_input prompt.
Sourcepub async fn steer(&self, content: impl Into<String>) -> Result<()>
pub async fn steer(&self, content: impl Into<String>) -> Result<()>
Steer an in-flight turn with additional user input.
Sourcepub async fn query_context_snapshot(&self) -> Result<ThreadContextSnapshot>
pub async fn query_context_snapshot(&self) -> Result<ThreadContextSnapshot>
Query TUI-aligned context usage from the live engine session.
Sourcepub async fn query_harness_task_graph(&self) -> Result<Value>
pub async fn query_harness_task_graph(&self) -> Result<Value>
Query derived long-horizon task graph from the live engine session.
Sourcepub async fn query_harness_cycles(&self) -> Result<Value>
pub async fn query_harness_cycles(&self) -> Result<Value>
Query cycle briefings and archive metadata from the live engine session.
Sourcepub async fn truncate_before_last_user_message(&self) -> Result<bool>
pub async fn truncate_before_last_user_message(&self) -> Result<bool>
Remove the last user message and everything after it (F4 / #383).
Trait Implementations§
Source§impl<P: Clone, R: Clone> Clone for EngineHandle<P, R>
impl<P: Clone, R: Clone> Clone for EngineHandle<P, R>
Source§fn clone(&self) -> EngineHandle<P, R>
fn clone(&self) -> EngineHandle<P, R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more