mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
94 lines • 3.22 kB
TypeScript
/**
* ADR Discovery Utilities
*
* Utilities for discovering and analyzing existing ADRs in the project
*/
import { BasicTimeline, TimelineExtractionOptions, AdrWorkQueue } from './adr-timeline-types.js';
/**
* Represents a discovered Architectural Decision Record
*/
export interface DiscoveredAdr {
/** Filename of the ADR file */
filename: string;
/** Title extracted from the ADR */
title: string;
/** Status of the decision (proposed, accepted, deprecated, etc.) */
status: string;
/** Date when the decision was made */
date: string | undefined;
/** Full file path to the ADR */
path: string;
/** Full content of the ADR file (optional) */
content?: string;
/** Context section of the ADR */
context?: string;
/** Decision section of the ADR */
decision?: string;
/** Consequences section of the ADR */
consequences?: string;
/** Additional metadata about the ADR */
metadata?: {
/** ADR number or identifier */
number?: string;
/** Category or domain of the decision */
category?: string;
/** Tags for categorization */
tags?: string[];
};
/** Timeline information (creation, updates, staleness) */
timeline?: BasicTimeline;
}
/**
* Options for ADR discovery
*/
export interface AdrDiscoveryOptions {
/** Include full ADR content */
includeContent?: boolean;
/** Include timeline analysis */
includeTimeline?: boolean;
/** Timeline extraction options */
timelineOptions?: TimelineExtractionOptions;
/** Generate action items */
generateActions?: boolean;
/** Threshold profile for action generation */
thresholdProfile?: string;
/** Auto-detect project context */
autoDetectContext?: boolean;
}
/**
* Result of ADR discovery operation
*/
export interface AdrDiscoveryResult {
/** Directory where ADRs were discovered */
directory: string;
/** Total number of ADRs found */
totalAdrs: number;
/** Array of discovered ADRs */
adrs: DiscoveredAdr[];
/** Summary statistics of discovered ADRs */
summary: {
/** Count of ADRs by status */
byStatus: Record<string, number>;
/** Count of ADRs by category */
byCategory: Record<string, number>;
/** Total actions required (if generateActions=true) */
totalActionsRequired?: number;
/** Critical actions (if generateActions=true) */
criticalActions?: number;
};
/** Recommendations for improving ADR management */
recommendations: string[];
/** Action queue (if generateActions=true) */
actionQueue?: AdrWorkQueue;
}
/**
* Discover ADRs in a directory using file system operations
*
* @param adrDirectory - Relative path to ADR directory
* @param projectPath - Root path of the project
* @param options - Discovery options
* @returns Promise resolving to ADR discovery results
* @throws McpAdrError if directory access fails or parsing errors occur
*/
export declare function discoverAdrsInDirectory(adrDirectory: string, projectPath: string, options?: AdrDiscoveryOptions): Promise<AdrDiscoveryResult>;
//# sourceMappingURL=adr-discovery.d.ts.map