UNPKG

mcp-adr-analysis-server

Version:

MCP server for analyzing Architectural Decision Records and project architecture

119 lines 4.65 kB
/** * MCP Tool for environment context analysis * Implements prompt-driven environment analysis and compliance assessment * Enhanced with Generated Knowledge Prompting (GKP) for DevOps and infrastructure expertise * Now includes memory integration for environment snapshot tracking and evolution analysis * * Following ADR-018 Atomic Tools Architecture: * - Dependency injection for testability * - No ResearchOrchestrator (deprecated) - uses direct utility calls * - Self-contained with minimal dependencies */ import { MemoryEntityManager } from '../utils/memory-entity-manager.js'; import { EnhancedLogger } from '../utils/enhanced-logging.js'; /** * Interface for research orchestrator dependency (enables DI and mocking) * @deprecated Use direct utility calls instead per ADR-018. Kept for backward compatibility. * @see Issue #310 - Dependency injection for improved testability */ export interface IResearchOrchestrator { answerResearchQuestion(question: string): Promise<{ answer: string; confidence: number; sources: any[]; metadata: { filesAnalyzed: number; duration: number; sourcesQueried: string[]; }; needsWebSearch: boolean; }>; } /** * Dependencies for EnvironmentMemoryManager (enables DI and mocking) * Uses concrete types for full compatibility with existing implementations * @see Issue #310 - Dependency injection for improved testability */ export interface EnvironmentMemoryManagerDeps { memoryManager?: MemoryEntityManager; logger?: EnhancedLogger; } /** * Environment Memory Manager for tracking environment snapshots and evolution * Supports dependency injection for improved testability * @see Issue #310 - Dependency injection for improved testability */ declare class EnvironmentMemoryManager { private memoryManager; private logger; /** * Constructor with optional dependency injection * @param deps - Optional dependencies for testing (defaults create real instances) */ constructor(deps?: EnvironmentMemoryManagerDeps); initialize(): Promise<void>; /** * Store environment snapshot as memory entity */ storeEnvironmentSnapshot(environmentType: string, configuration: any, complianceData?: any, projectPath?: string): Promise<string>; /** * Track configuration changes between snapshots */ trackConfigurationChange(previousSnapshotId: string, newSnapshotId: string, changeDescription: string, changeDetails: any): Promise<void>; /** * Analyze environment evolution over time */ analyzeEnvironmentEvolution(environmentType: string): Promise<{ snapshots: any[]; trends: any[]; recommendations: string[]; }>; /** * Compare current environment with previous snapshots */ compareWithPreviousSnapshots(currentConfiguration: any, environmentType: string): Promise<{ hasChanges: boolean; changes: any[]; regressions: any[]; improvements: any[]; }>; private identifyOptimizationOpportunities; private extractTechnicalStack; private calculateEnvironmentTrends; private calculateTechGrowth; private generateEvolutionRecommendations; private compareConfigurations; } /** * Analyze environment context and provide optimization recommendations * Enhanced with Generated Knowledge Prompting for DevOps and infrastructure expertise * Now includes memory integration for environment tracking */ /** * Dependencies for analyzeEnvironment function (enables DI and mocking) * Following ADR-018 Atomic Tools Architecture pattern. * @see Issue #310 - Dependency injection for improved testability */ export interface AnalyzeEnvironmentDeps { memoryManager?: EnvironmentMemoryManager; /** * @deprecated ResearchOrchestrator is deprecated per ADR-018. This field is kept * for backward compatibility but is no longer used. The tool now relies on * environment-analysis.js utilities directly. */ researchOrchestrator?: IResearchOrchestrator; } export declare function analyzeEnvironment(args: { projectPath?: string; adrDirectory?: string; analysisType?: 'specs' | 'containerization' | 'requirements' | 'compliance' | 'comprehensive'; currentEnvironment?: any; requirements?: any; industryStandards?: string[]; knowledgeEnhancement?: boolean; enhancedMode?: boolean; enableMemoryIntegration?: boolean; environmentType?: string; }, deps?: AnalyzeEnvironmentDeps): Promise<any>; export {}; //# sourceMappingURL=environment-analysis-tool.d.ts.map