Skip to main content

SessionManager

Struct SessionManager 

Source
pub struct SessionManager { /* private fields */ }
Expand description

SessionManager wraps all core state for the MCP server.

Implementations§

Source§

impl SessionManager

Source

pub fn new(data_dir: &str) -> EvolveResult<Self>

Create a new session manager with optional persistent data directory.

Source

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.

Source

pub fn get_pattern(&self, id: &str) -> EvolveResult<&Pattern>

Get a pattern by ID.

Source

pub fn search_patterns(&self, query: &str) -> Vec<&Pattern>

Search patterns by query.

Source

pub fn list_patterns(&self) -> Vec<&Pattern>

List all patterns.

Source

pub fn delete_pattern(&mut self, id: &str) -> EvolveResult<Pattern>

Delete a pattern by ID.

Source

pub fn match_signature( &self, signature: &FunctionSignature, context: &MatchContext, limit: usize, ) -> EvolveResult<Vec<MatchResult>>

Match a function signature against stored patterns.

Source

pub fn match_context( &self, signature: &FunctionSignature, context: &MatchContext, limit: usize, ) -> EvolveResult<Vec<MatchResult>>

Match patterns with surrounding context.

Source

pub fn crystallize( &mut self, execution: &SuccessfulExecution, ) -> EvolveResult<Vec<Pattern>>

Crystallize successful code into patterns.

Source

pub fn compose( &self, pattern_ids: &[String], bindings: &HashMap<String, String>, ) -> EvolveResult<CompositionResult>

Compose multiple patterns together.

Source

pub fn coverage( &self, signatures: &[FunctionSignature], threshold: f64, ) -> CoverageReport

Get pattern coverage for a set of function signatures.

Source

pub fn confidence(&self, pattern_id: &str) -> EvolveResult<ConfidenceReport>

Get confidence score for a pattern.

Source

pub fn update_usage( &mut self, pattern_id: &str, domain: &str, success: bool, ) -> EvolveResult<()>

Update usage statistics for a pattern.

Source

pub fn optimize(&mut self) -> EvolveResult<OptimizationSummary>

Optimize pattern storage.

Source

pub fn get_body( &self, signature: &FunctionSignature, context: &MatchContext, ) -> EvolveResult<Option<(String, String, f64)>>

Get the function body from the best matching pattern.

Source

pub fn pattern_count(&self) -> usize

Total pattern count.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more