pub trait AgentBackend: Send + Sync {
// Required methods
fn setup(&self, folder: &Path) -> Result<(), AgentBackendError>;
fn build_command<'request>(
&'request self,
request: BuildCommandRequest<'request>,
) -> Result<Command, AgentBackendError>;
}Expand description
Builds and configures external agent CLI commands.
Required Methods§
Sourcefn setup(&self, folder: &Path) -> Result<(), AgentBackendError>
fn setup(&self, folder: &Path) -> Result<(), AgentBackendError>
Performs one-time setup in an agent folder before first run.
§Errors
Returns an error when one-time backend setup cannot be completed.
Sourcefn build_command<'request>(
&'request self,
request: BuildCommandRequest<'request>,
) -> Result<Command, AgentBackendError>
fn build_command<'request>( &'request self, request: BuildCommandRequest<'request>, ) -> Result<Command, AgentBackendError>
Builds one provider transport command.
CLI-backed providers return the per-turn subprocess command. App-server providers return the long-lived runtime command that owns later RPC turn execution.
§Errors
Returns an error when prompt rendering or provider argument construction fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".