mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
100 lines • 3.75 kB
TypeScript
import { IntentSnapshot, TodoSyncState, KnowledgeGraphSnapshot } from '../types/knowledge-graph-schemas.js';
export declare class KnowledgeGraphManager {
private cacheDir;
private snapshotsFile;
private syncStateFile;
private memoryScoring;
constructor();
ensureCacheDirectory(): Promise<void>;
loadKnowledgeGraph(): Promise<KnowledgeGraphSnapshot>;
saveKnowledgeGraph(snapshot: KnowledgeGraphSnapshot): Promise<void>;
createIntent(humanRequest: string, parsedGoals: string[], priority?: 'high' | 'medium' | 'low'): Promise<string>;
addToolExecution(intentId: string, toolName: string, parameters: Record<string, any>, result: Record<string, any>, success: boolean, todoTasksCreated?: string[], todoTasksModified?: string[], error?: string): Promise<void>;
addMemoryExecution(toolName: string, action: string, entityType: string, success: boolean, details?: Record<string, any>): Promise<void>;
private updateMemoryAnalytics;
updateIntentStatus(intentId: string, status: 'planning' | 'executing' | 'completed' | 'failed'): Promise<void>;
updateTodoSnapshot(intentId: string, todoContent: string): Promise<void>;
getSyncState(): Promise<TodoSyncState>;
updateSyncState(updates: Partial<TodoSyncState>): Promise<void>;
getIntentById(intentId: string): Promise<IntentSnapshot | null>;
getActiveIntents(): Promise<IntentSnapshot[]>;
getIntentsByStatus(status: 'planning' | 'executing' | 'completed' | 'failed'): Promise<IntentSnapshot[]>;
private getDefaultSyncState;
private updateAnalytics;
calculateTodoMdHash(todoPath: string): Promise<string>;
detectTodoChanges(todoPath: string): Promise<{
hasChanges: boolean;
currentHash: string;
lastHash: string;
}>;
/**
* Update score tracking for an intent after tool execution
*/
private updateScoreTracking;
/**
* Get score trends for an intent
*/
getIntentScoreTrends(intentId: string): Promise<{
initialScore: number;
currentScore: number;
progress: number;
componentTrends: Record<string, number>;
scoreHistory: Array<{
timestamp: string;
score: number;
triggerEvent: string;
}>;
}>;
/**
* Get overall project score trends
*/
getProjectScoreTrends(): Promise<{
currentScore: number;
scoreHistory: Array<{
timestamp: string;
score: number;
triggerEvent: string;
intentId?: string;
}>;
averageImprovement: number;
topImpactingIntents: Array<{
intentId: string;
humanRequest: string;
scoreImprovement: number;
}>;
}>;
/**
* Record project structure analysis to knowledge graph
*/
recordProjectStructure(structureSnapshot: {
projectPath: string;
analysisDepth: string;
recursiveDepth: string;
technologyFocus: string[];
analysisScope: string[];
includeEnvironment: boolean;
timestamp: string;
structureData: any;
}): Promise<void>;
/**
* Calculate memory-based health score from knowledge graph
*/
private calculateMemoryScore;
/**
* Extract memory representations from knowledge graph
*/
private extractMemoriesFromKG;
/**
* Calculate retrieval metrics from tool execution patterns
*/
private calculateRetrievalMetrics;
/**
* Build entity graph from knowledge graph
*/
private buildEntityGraph;
/**
* Calculate relevance score for an intent
*/
private calculateIntentRelevance;
}
//# sourceMappingURL=knowledge-graph-manager.d.ts.map