Skip to main content

Adapter

Trait Adapter 

Source
pub trait Adapter: Send + Sync {
    // Required methods
    fn id(&self) -> AdapterId;
    fn detect(&self, root: &Path) -> AdapterDetection;
    fn install<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        root: &'life1 Path,
        config: &'life2 AgentConfig,
    ) -> Pin<Box<dyn Future<Output = Result<(), AdapterError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn apply_config<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        root: &'life1 Path,
        config: &'life2 AgentConfig,
    ) -> Pin<Box<dyn Future<Output = Result<(), AdapterError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn parse_session<'life0, 'async_trait>(
        &'life0 self,
        log: SessionLog,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ParsedSignal>, AdapterError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn forget<'life0, 'life1, 'async_trait>(
        &'life0 self,
        root: &'life1 Path,
    ) -> Pin<Box<dyn Future<Output = Result<(), AdapterError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Per-tool integration contract. See design doc section 4.4.

Required Methods§

Source

fn id(&self) -> AdapterId

Stable identifier (e.g., “claude-code”, “cursor”, “aider”).

Source

fn detect(&self, root: &Path) -> AdapterDetection

Detect whether the tool is in use at root (or in the user’s home).

Source

fn install<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, root: &'life1 Path, config: &'life2 AgentConfig, ) -> Pin<Box<dyn Future<Output = Result<(), AdapterError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Install hooks/config so the tool reports sessions back to Evolve. Idempotent.

Source

fn apply_config<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, root: &'life1 Path, config: &'life2 AgentConfig, ) -> Pin<Box<dyn Future<Output = Result<(), AdapterError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Write the given config into the tool’s files (inside managed-section markers).

Source

fn parse_session<'life0, 'async_trait>( &'life0 self, log: SessionLog, ) -> Pin<Box<dyn Future<Output = Result<Vec<ParsedSignal>, AdapterError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Parse a session log into fitness signals.

Source

fn forget<'life0, 'life1, 'async_trait>( &'life0 self, root: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Result<(), AdapterError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove everything this adapter installed, restoring the pre-evolve state.

Implementors§