Skip to main content

VersionAdapter

Trait VersionAdapter 

Source
pub trait VersionAdapter: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn detect<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ExecutorVersion, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn capabilities_for(
        &self,
        version: &ExecutorVersion,
    ) -> ExecutorCapabilities;
    fn build_args(
        &self,
        prompt: &str,
        caps: &ExecutorCapabilities,
        compat_mode: CompatMode,
    ) -> Vec<String>;
    fn parse_output(
        &self,
        raw_stdout: &str,
        raw_stderr: &str,
        exit_code: i32,
    ) -> ParsedOutput;
}
Expand description

Trait for adapting spawn invocations to a particular executor’s version.

Required Methods§

Source

fn name(&self) -> &'static str

Logical name of the executor (e.g. “codex”, “claude”, “opencode”).

Source

fn detect<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ExecutorVersion, AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Detect the version by invoking <executor> --version and parsing the output.

Source

fn capabilities_for(&self, version: &ExecutorVersion) -> ExecutorCapabilities

Returns the capability matrix for the given version.

Source

fn build_args( &self, prompt: &str, caps: &ExecutorCapabilities, compat_mode: CompatMode, ) -> Vec<String>

Build the CLI invocation arguments for a given prompt and capabilities.

Source

fn parse_output( &self, raw_stdout: &str, raw_stderr: &str, exit_code: i32, ) -> ParsedOutput

Parses the executor output into structured items.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§