mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
183 lines • 5.1 kB
TypeScript
/**
* Authoritative source definition
*/
export interface AuthoritativeSource {
type: 'documentation' | 'repository' | 'specification' | 'examples' | 'community';
url: string;
purpose: string;
priority: number;
requiredForDeployment: boolean;
queryInstructions: string;
}
/**
* Deployment phase definition
*/
export interface DeploymentPhase {
order: number;
name: string;
description: string;
estimatedDuration: string;
canParallelize: boolean;
prerequisites: string[];
commands: Array<{
description: string;
command: string;
expectedExitCode?: number;
}>;
}
/**
* Validation check definition
*/
export interface ValidationCheck {
id: string;
name: string;
description: string;
command: string;
expectedExitCode?: number;
severity: 'critical' | 'error' | 'warning' | 'info';
failureMessage: string;
remediationSteps: string[];
}
/**
* Dynamic pattern loaded from YAML
*/
export interface DynamicPattern {
version: string;
id: string;
name: string;
description: string;
composition?: {
infrastructure?: string;
runtime?: string;
protocol?: string;
strategy?: string;
};
authoritativeSources: AuthoritativeSource[];
baseCodeRepository?: {
url: string;
purpose: string;
integrationInstructions: string;
requiredFiles?: string[];
scriptEntrypoint?: string;
};
dependencies?: Array<{
name: string;
type: 'buildtime' | 'runtime';
required: boolean;
installCommand?: string;
verificationCommand?: string;
}>;
configurations?: Array<{
path: string;
purpose: string;
required: boolean;
canAutoGenerate?: boolean;
template?: string;
}>;
secrets?: Array<{
name: string;
purpose: string;
environmentVariable?: string;
required: boolean;
}>;
infrastructure?: Array<{
component: string;
purpose: string;
required: boolean;
minimumVersion?: string;
setupCommands?: string[];
healthCheckCommand?: string;
alternatives?: string[];
}>;
deploymentPhases: DeploymentPhase[];
validationChecks?: ValidationCheck[];
healthChecks?: Array<{
name: string;
endpoint: string;
interval?: number;
timeout?: number;
healthyThreshold?: number;
unhealthyThreshold?: number;
}>;
environmentOverrides?: Array<{
environment: 'development' | 'staging' | 'production';
overrides: Record<string, any>;
}>;
metadata: {
source: string;
lastUpdated: string;
maintainer?: string;
tags: string[];
contributors?: Array<{
name: string;
github?: string;
}>;
changeLog?: Array<{
version: string;
date: string;
changes: string[];
}>;
};
detectionHints?: {
requiredFiles?: string[];
optionalFiles?: string[];
confidence?: Record<string, number>;
};
}
/**
* Loads and manages dynamic patterns from YAML files
*/
export declare class PatternLoader {
private logger;
private patternsDir;
private cache;
constructor(patternsDir?: string);
/**
* Load a pattern from YAML file by ID
* @param patternId - Pattern identifier (filename without .yaml)
* @returns Loaded pattern or null if not found
*/
loadPattern(patternId: string): Promise<DynamicPattern | null>;
/**
* Load pattern by composition (infrastructure + runtime)
* @param infrastructure - Infrastructure platform
* @param runtime - Runtime environment (optional)
* @returns Loaded pattern or null if not found
*/
loadPatternByComposition(infrastructure: string, runtime?: string): Promise<DynamicPattern | null>;
/**
* List all available patterns
* @returns Array of pattern IDs
*/
listPatterns(): Promise<string[]>;
/**
* List patterns by category
* @param category - Pattern category (composite, infrastructure, runtime, protocol)
* @returns Array of pattern IDs in that category
*/
listPatternsByCategory(category: 'composite' | 'infrastructure' | 'runtime' | 'protocol'): Promise<string[]>;
/**
* Validate pattern structure
* @param pattern - Pattern to validate
* @throws Error if validation fails
*/
private validatePattern;
/**
* Clear pattern cache
* Useful for testing or reloading patterns
*/
clearCache(): void;
/**
* Get pattern from cache
* @param patternId - Pattern identifier
* @returns Cached pattern or null
*/
getCachedPattern(patternId: string): DynamicPattern | null;
/**
* Check if a pattern is cached
* @param patternId - Pattern identifier
* @returns True if cached
*/
isCached(patternId: string): boolean;
}
//# sourceMappingURL=pattern-loader.d.ts.map