pub struct Agent { /* private fields */ }
Expand description
Main agent orchestrator
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn new(config: AgentConfig) -> Result<Self>
pub fn new(config: AgentConfig) -> Result<Self>
Create a new agent instance
Sourcepub async fn initialize(&mut self) -> Result<()>
pub async fn initialize(&mut self) -> Result<()>
Initialize the agent with system setup
Sourcepub fn config(&self) -> &AgentConfig
pub fn config(&self) -> &AgentConfig
Get the agent’s current configuration
Sourcepub fn session_info(&self) -> &SessionInfo
pub fn session_info(&self) -> &SessionInfo
Get session information
Sourcepub fn performance_metrics(&self) -> PerformanceMetrics
pub fn performance_metrics(&self) -> PerformanceMetrics
Get performance metrics
Sourcepub fn decision_tracker(&self) -> &DecisionTracker
pub fn decision_tracker(&self) -> &DecisionTracker
Get decision tracker reference
Sourcepub fn decision_tracker_mut(&mut self) -> &mut DecisionTracker
pub fn decision_tracker_mut(&mut self) -> &mut DecisionTracker
Get mutable decision tracker reference
Sourcepub fn error_recovery(&self) -> &ErrorRecoveryManager
pub fn error_recovery(&self) -> &ErrorRecoveryManager
Get error recovery manager reference
Sourcepub fn error_recovery_mut(&mut self) -> &mut ErrorRecoveryManager
pub fn error_recovery_mut(&mut self) -> &mut ErrorRecoveryManager
Get mutable error recovery manager reference
Sourcepub fn summarizer(&self) -> &ConversationSummarizer
pub fn summarizer(&self) -> &ConversationSummarizer
Get conversation summarizer reference
Sourcepub fn tool_registry(&self) -> Arc<ToolRegistry>
pub fn tool_registry(&self) -> Arc<ToolRegistry>
Get tool registry reference
Sourcepub fn tool_registry_mut(&mut self) -> &mut ToolRegistry
pub fn tool_registry_mut(&mut self) -> &mut ToolRegistry
Get mutable tool registry reference
Sourcepub fn tree_sitter_analyzer(&self) -> &TreeSitterAnalyzer
pub fn tree_sitter_analyzer(&self) -> &TreeSitterAnalyzer
Get tree-sitter analyzer reference
Sourcepub fn tree_sitter_analyzer_mut(&mut self) -> &mut TreeSitterAnalyzer
pub fn tree_sitter_analyzer_mut(&mut self) -> &mut TreeSitterAnalyzer
Get mutable tree-sitter analyzer reference
Sourcepub fn compaction_engine(&self) -> Arc<CompactionEngine>
pub fn compaction_engine(&self) -> Arc<CompactionEngine>
Get compaction engine reference
Sourcepub async fn make_intelligent_compaction_decision(
&self,
) -> Result<CompactionDecision>
pub async fn make_intelligent_compaction_decision( &self, ) -> Result<CompactionDecision>
Make intelligent compaction decision using context analysis
Sourcepub async fn should_compact(&self) -> Result<bool>
pub async fn should_compact(&self) -> Result<bool>
Check if compaction is needed
Sourcepub async fn compact_messages(&self) -> Result<CompactionResult>
pub async fn compact_messages(&self) -> Result<CompactionResult>
Perform intelligent message compaction
Sourcepub async fn compact_context(
&self,
context_key: &str,
context_data: &mut HashMap<String, Value>,
) -> Result<CompactionResult>
pub async fn compact_context( &self, context_key: &str, context_data: &mut HashMap<String, Value>, ) -> Result<CompactionResult>
Perform context compaction
Sourcepub async fn get_compaction_stats(&self) -> Result<CompactionStatistics>
pub async fn get_compaction_stats(&self) -> Result<CompactionStatistics>
Get compaction statistics
Sourcepub fn analyze_file_with_tree_sitter(
&mut self,
file_path: &Path,
source_code: &str,
) -> Result<CodeAnalysis>
pub fn analyze_file_with_tree_sitter( &mut self, file_path: &Path, source_code: &str, ) -> Result<CodeAnalysis>
Analyze a file using tree-sitter
Sourcepub fn update_session_stats(
&mut self,
turns: usize,
decisions: usize,
errors: usize,
)
pub fn update_session_stats( &mut self, turns: usize, decisions: usize, errors: usize, )
Update session statistics
Sourcepub fn should_compress_context(&self, context_size: usize) -> bool
pub fn should_compress_context(&self, context_size: usize) -> bool
Check if context compression is needed
Sourcepub fn generate_context_plan(
&self,
context_size: usize,
) -> ContextPreservationPlan
pub fn generate_context_plan( &self, context_size: usize, ) -> ContextPreservationPlan
Generate context preservation plan
Sourcepub fn detect_error_pattern(
&self,
error_type: &ErrorType,
time_window_seconds: u64,
) -> bool
pub fn detect_error_pattern( &self, error_type: &ErrorType, time_window_seconds: u64, ) -> bool
Check for error patterns
Sourcepub fn show_transparency_report(&self, detailed: bool)
pub fn show_transparency_report(&self, detailed: bool)
Show transparency report