pub struct SessionManager { /* private fields */ }Expand description
SessionManager wraps all core state for the MCP server.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn new(data_dir: &str) -> EvolveResult<Self>
pub fn new(data_dir: &str) -> EvolveResult<Self>
Create a new session manager with optional persistent data directory.
Sourcepub fn store_pattern(
&mut self,
name: &str,
domain: &str,
language: Language,
signature: FunctionSignature,
template: &str,
variables: Vec<PatternVariable>,
confidence: f64,
tags: Vec<String>,
) -> EvolveResult<Pattern>
pub fn store_pattern( &mut self, name: &str, domain: &str, language: Language, signature: FunctionSignature, template: &str, variables: Vec<PatternVariable>, confidence: f64, tags: Vec<String>, ) -> EvolveResult<Pattern>
Store a new pattern.
Sourcepub fn get_pattern(&self, id: &str) -> EvolveResult<&Pattern>
pub fn get_pattern(&self, id: &str) -> EvolveResult<&Pattern>
Get a pattern by ID.
Sourcepub fn search_patterns(&self, query: &str) -> Vec<&Pattern>
pub fn search_patterns(&self, query: &str) -> Vec<&Pattern>
Search patterns by query.
Sourcepub fn list_patterns(&self) -> Vec<&Pattern>
pub fn list_patterns(&self) -> Vec<&Pattern>
List all patterns.
Sourcepub fn delete_pattern(&mut self, id: &str) -> EvolveResult<Pattern>
pub fn delete_pattern(&mut self, id: &str) -> EvolveResult<Pattern>
Delete a pattern by ID.
Sourcepub fn match_signature(
&self,
signature: &FunctionSignature,
context: &MatchContext,
limit: usize,
) -> EvolveResult<Vec<MatchResult>>
pub fn match_signature( &self, signature: &FunctionSignature, context: &MatchContext, limit: usize, ) -> EvolveResult<Vec<MatchResult>>
Match a function signature against stored patterns.
Sourcepub fn match_context(
&self,
signature: &FunctionSignature,
context: &MatchContext,
limit: usize,
) -> EvolveResult<Vec<MatchResult>>
pub fn match_context( &self, signature: &FunctionSignature, context: &MatchContext, limit: usize, ) -> EvolveResult<Vec<MatchResult>>
Match patterns with surrounding context.
Sourcepub fn crystallize(
&mut self,
execution: &SuccessfulExecution,
) -> EvolveResult<Vec<Pattern>>
pub fn crystallize( &mut self, execution: &SuccessfulExecution, ) -> EvolveResult<Vec<Pattern>>
Crystallize successful code into patterns.
Sourcepub fn compose(
&self,
pattern_ids: &[String],
bindings: &HashMap<String, String>,
) -> EvolveResult<CompositionResult>
pub fn compose( &self, pattern_ids: &[String], bindings: &HashMap<String, String>, ) -> EvolveResult<CompositionResult>
Compose multiple patterns together.
Sourcepub fn coverage(
&self,
signatures: &[FunctionSignature],
threshold: f64,
) -> CoverageReport
pub fn coverage( &self, signatures: &[FunctionSignature], threshold: f64, ) -> CoverageReport
Get pattern coverage for a set of function signatures.
Sourcepub fn confidence(&self, pattern_id: &str) -> EvolveResult<ConfidenceReport>
pub fn confidence(&self, pattern_id: &str) -> EvolveResult<ConfidenceReport>
Get confidence score for a pattern.
Sourcepub fn update_usage(
&mut self,
pattern_id: &str,
domain: &str,
success: bool,
) -> EvolveResult<()>
pub fn update_usage( &mut self, pattern_id: &str, domain: &str, success: bool, ) -> EvolveResult<()>
Update usage statistics for a pattern.
Sourcepub fn optimize(&mut self) -> EvolveResult<OptimizationSummary>
pub fn optimize(&mut self) -> EvolveResult<OptimizationSummary>
Optimize pattern storage.
Sourcepub fn get_body(
&self,
signature: &FunctionSignature,
context: &MatchContext,
) -> EvolveResult<Option<(String, String, f64)>>
pub fn get_body( &self, signature: &FunctionSignature, context: &MatchContext, ) -> EvolveResult<Option<(String, String, f64)>>
Get the function body from the best matching pattern.
Sourcepub fn pattern_count(&self) -> usize
pub fn pattern_count(&self) -> usize
Total pattern count.
Auto Trait Implementations§
impl Freeze for SessionManager
impl RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl UnsafeUnpin for SessionManager
impl UnwindSafe for SessionManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more