pub trait Connector {
// Required methods
fn detect(&self) -> DetectionResult;
fn scan(
&self,
ctx: &ScanContext,
) -> Result<Vec<NormalizedConversation>, Error>;
// Provided methods
fn supports_streaming_scan(&self) -> bool { ... }
fn discover_source_files(
&self,
_ctx: &ScanContext,
) -> Result<Vec<DiscoveredSourceFile>, Error> { ... }
fn scan_with_callback(
&self,
ctx: &ScanContext,
on_conversation: &mut dyn FnMut(NormalizedConversation) -> Result<(), Error>,
) -> Result<(), Error> { ... }
}Expand description
The interface that all agent connectors implement.
Each connector knows how to detect whether a particular coding agent is installed and how to scan its conversation history.
Required Methods§
Sourcefn detect(&self) -> DetectionResult
fn detect(&self) -> DetectionResult
Detect whether this agent is installed on the system.
Sourcefn scan(&self, ctx: &ScanContext) -> Result<Vec<NormalizedConversation>, Error>
fn scan(&self, ctx: &ScanContext) -> Result<Vec<NormalizedConversation>, Error>
Scan conversation history for this agent.
Provided Methods§
Sourcefn supports_streaming_scan(&self) -> bool
fn supports_streaming_scan(&self) -> bool
Whether this connector implements true callback-based streaming.
Connectors that return true guarantee scan_with_callback() does not
first materialize the full corpus via scan().
Sourcefn discover_source_files(
&self,
_ctx: &ScanContext,
) -> Result<Vec<DiscoveredSourceFile>, Error>
fn discover_source_files( &self, _ctx: &ScanContext, ) -> Result<Vec<DiscoveredSourceFile>, Error>
Discover the raw source files this connector will consume for a scan.
Implementations must use the same provider-specific root expansion,
filtering, and deduplication logic as scan() / scan_with_callback().
The contract is intentionally file-oriented and pre-parse: callers such
as CASS can mirror precious source artifacts before parser failures,
malformed records, or projection bugs can make a session invisible.
Sourcefn scan_with_callback(
&self,
ctx: &ScanContext,
on_conversation: &mut dyn FnMut(NormalizedConversation) -> Result<(), Error>,
) -> Result<(), Error>
fn scan_with_callback( &self, ctx: &ScanContext, on_conversation: &mut dyn FnMut(NormalizedConversation) -> Result<(), Error>, ) -> Result<(), Error>
Scan conversation history and emit conversations incrementally.
Connectors that can stream their traversal should override this to avoid
materializing their full corpus in memory. The default implementation
preserves current behavior by delegating to scan().