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§
Sourcefn detect(&self, root: &Path) -> AdapterDetection
fn detect(&self, root: &Path) -> AdapterDetection
Detect whether the tool is in use at root (or in the user’s home).
Sourcefn 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 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.
Sourcefn 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 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).
Sourcefn 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 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.
Sourcefn 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,
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.