UNPKG

mcp-adr-analysis-server

Version:

MCP server for analyzing Architectural Decision Records and project architecture

112 lines 3.45 kB
/** * Metadata for tool context documents */ export interface ToolContextMetadata { toolName: string; toolVersion: string; generated: string; projectPath: string; projectName: string; status: 'success' | 'failed' | 'partial'; confidence?: number; } /** * Decision record within a context document */ export interface Decision { decision: string; rationale: string; alternatives?: string[]; } /** * Learning record from tool execution */ export interface Learnings { successes: string[]; failures: string[]; recommendations: string[]; environmentSpecific: string[]; } /** * Related documents and references */ export interface RelatedDocuments { adrs: string[]; configs: string[]; otherContexts: string[]; } /** * Complete tool context document structure */ export interface ToolContextDocument { metadata: ToolContextMetadata; quickReference: string; executionSummary: { status: string; confidence?: number; keyFindings: string[]; }; detectedContext: Record<string, any>; generatedArtifacts?: string[]; keyDecisions?: Decision[]; learnings?: Learnings; relatedDocuments?: RelatedDocuments; rawData?: any; } /** * Manages creation, storage, and retrieval of tool context documents */ export declare class ToolContextManager { private contextDir; private logger; constructor(projectPath: string); /** * Initialize context directory structure */ initialize(): Promise<void>; /** * Save a context document to the appropriate category * @param category - Category subdirectory (bootstrap, deployment, etc.) * @param document - Context document to save * @returns Path to the saved document */ saveContext(category: string, document: ToolContextDocument): Promise<string>; /** * Load the latest context document for a category * @param category - Category to load from * @returns Context document or null if not found */ loadLatestContext(category: string): Promise<ToolContextDocument | null>; /** * Load a specific context document by timestamp * @param category - Category to search in * @param timestamp - Timestamp identifier * @returns Context document or null if not found */ loadContextByTimestamp(category: string, timestamp: string): Promise<ToolContextDocument | null>; /** * List all context documents in a category * @param category - Category to list * @returns Array of filenames */ listContexts(category: string): Promise<string[]>; /** * Update the latest.md symlink or copy for a category * @param category - Category directory * @param filePath - Path to the latest context document */ updateLatestSymlink(category: string, filePath: string): Promise<void>; /** * Clean up old context documents, keeping only the most recent N * @param category - Category to clean up * @param keepCount - Number of recent contexts to keep (default: 10) */ cleanupOldContexts(category: string, keepCount?: number): Promise<void>; /** * Generate markdown content from a context document * @param document - Context document to convert * @returns Markdown string */ generateMarkdown(document: ToolContextDocument): string; } //# sourceMappingURL=context-document-manager.d.ts.map