pub trait AgentControl: Send + Sync {
// Required methods
fn send_input(&self, text: &str) -> Result<()>;
fn cancel(&self) -> Result<()>;
fn kill(&self) -> Result<()>;
fn resolve_permission(&self, req: &str, decision: Decision) -> Result<()>;
fn transport(&self) -> &'static str;
// Provided methods
fn send_input_with(
&self,
text: &str,
attachments: &[Attachment],
) -> Result<()> { ... }
fn sleep(&self) -> Result<()> { ... }
fn wake(&self) -> Result<()> { ... }
fn resolve_question(&self, id: &str, answers: &[String]) -> Result<()> { ... }
fn pid(&self) -> Option<u32> { ... }
fn set_config(
&self,
model: Option<&str>,
effort: Option<&str>,
) -> Result<Option<String>> { ... }
}Expand description
Control handle for a running session.
Required Methods§
Sourcefn send_input(&self, text: &str) -> Result<()>
fn send_input(&self, text: &str) -> Result<()>
Sends user input / prompt text.
Provided Methods§
Sourcefn send_input_with(&self, text: &str, attachments: &[Attachment]) -> Result<()>
fn send_input_with(&self, text: &str, attachments: &[Attachment]) -> Result<()>
Sends a prompt with files/images attached. By default inlines attachments into text; adapters supporting image blocks override this.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".