UNPKG

mcp-adr-analysis-server

Version:

MCP server for analyzing Architectural Decision Records and project architecture

534 lines 18.7 kB
/** * Core TypeScript interfaces for MCP ADR Analysis Server * Based on shrimp-rules.md requirements */ import { z } from 'zod'; export interface Adr { id: string; title: string; status: 'proposed' | 'accepted' | 'deprecated' | 'superseded'; date: string; context: string; decision: string; consequences: string; implementationPlan?: string; filePath: string; tags?: string[]; relatedAdrs?: string[]; } export declare const AdrSchema: z.ZodObject<{ id: z.ZodString; title: z.ZodString; status: z.ZodEnum<["proposed", "accepted", "deprecated", "superseded"]>; date: z.ZodString; context: z.ZodString; decision: z.ZodString; consequences: z.ZodString; implementationPlan: z.ZodOptional<z.ZodString>; filePath: z.ZodString; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; relatedAdrs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { status: "proposed" | "accepted" | "deprecated" | "superseded"; date: string; title: string; context: string; id: string; decision: string; consequences: string; filePath: string; tags?: string[] | undefined; implementationPlan?: string | undefined; relatedAdrs?: string[] | undefined; }, { status: "proposed" | "accepted" | "deprecated" | "superseded"; date: string; title: string; context: string; id: string; decision: string; consequences: string; filePath: string; tags?: string[] | undefined; implementationPlan?: string | undefined; relatedAdrs?: string[] | undefined; }>; export interface DetectedTechnology { name: string; category: 'framework' | 'library' | 'database' | 'cloud' | 'devops' | 'language' | 'tool'; version?: string; confidence: number; evidence: string[]; filePaths: string[]; description?: string; } export declare const DetectedTechnologySchema: z.ZodObject<{ name: z.ZodString; category: z.ZodEnum<["framework", "library", "database", "cloud", "devops", "language", "tool"]>; version: z.ZodOptional<z.ZodString>; confidence: z.ZodNumber; evidence: z.ZodArray<z.ZodString, "many">; filePaths: z.ZodArray<z.ZodString, "many">; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool"; evidence: string[]; confidence: number; name: string; filePaths: string[]; version?: string | undefined; description?: string | undefined; }, { category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool"; evidence: string[]; confidence: number; name: string; filePaths: string[]; version?: string | undefined; description?: string | undefined; }>; export interface DetectedPattern { name: string; type: 'architectural' | 'structural' | 'organizational' | 'communication' | 'testing' | 'data'; confidence: number; description: string; evidence: string[]; filePaths: string[]; suboptimal?: boolean; recommendations?: string[]; } export declare const DetectedPatternSchema: z.ZodObject<{ name: z.ZodString; type: z.ZodEnum<["architectural", "structural", "organizational", "communication", "testing", "data"]>; confidence: z.ZodNumber; description: z.ZodString; evidence: z.ZodArray<z.ZodString, "many">; filePaths: z.ZodArray<z.ZodString, "many">; suboptimal: z.ZodOptional<z.ZodBoolean>; recommendations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data"; evidence: string[]; confidence: number; name: string; filePaths: string[]; description: string; recommendations?: string[] | undefined; suboptimal?: boolean | undefined; }, { type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data"; evidence: string[]; confidence: number; name: string; filePaths: string[]; description: string; recommendations?: string[] | undefined; suboptimal?: boolean | undefined; }>; export interface ArchitecturalKnowledgeGraph { projectId: string; timestamp: string; adrs: Adr[]; technologies: DetectedTechnology[]; patterns: DetectedPattern[]; rules: Rule[]; relationships: Relationship[]; metadata: ProjectMetadata; } export interface Relationship { source: string; target: string; type: 'implements' | 'depends_on' | 'conflicts_with' | 'supersedes' | 'relates_to'; strength: number; description?: string; } export interface ProjectMetadata { name: string; description?: string; version?: string; lastAnalyzed: string; analysisVersion: string; fileCount: number; directoryCount: number; } export declare const ArchitecturalKnowledgeGraphSchema: z.ZodObject<{ projectId: z.ZodString; timestamp: z.ZodString; adrs: z.ZodArray<z.ZodObject<{ id: z.ZodString; title: z.ZodString; status: z.ZodEnum<["proposed", "accepted", "deprecated", "superseded"]>; date: z.ZodString; context: z.ZodString; decision: z.ZodString; consequences: z.ZodString; implementationPlan: z.ZodOptional<z.ZodString>; filePath: z.ZodString; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; relatedAdrs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { status: "proposed" | "accepted" | "deprecated" | "superseded"; date: string; title: string; context: string; id: string; decision: string; consequences: string; filePath: string; tags?: string[] | undefined; implementationPlan?: string | undefined; relatedAdrs?: string[] | undefined; }, { status: "proposed" | "accepted" | "deprecated" | "superseded"; date: string; title: string; context: string; id: string; decision: string; consequences: string; filePath: string; tags?: string[] | undefined; implementationPlan?: string | undefined; relatedAdrs?: string[] | undefined; }>, "many">; technologies: z.ZodArray<z.ZodObject<{ name: z.ZodString; category: z.ZodEnum<["framework", "library", "database", "cloud", "devops", "language", "tool"]>; version: z.ZodOptional<z.ZodString>; confidence: z.ZodNumber; evidence: z.ZodArray<z.ZodString, "many">; filePaths: z.ZodArray<z.ZodString, "many">; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool"; evidence: string[]; confidence: number; name: string; filePaths: string[]; version?: string | undefined; description?: string | undefined; }, { category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool"; evidence: string[]; confidence: number; name: string; filePaths: string[]; version?: string | undefined; description?: string | undefined; }>, "many">; patterns: z.ZodArray<z.ZodObject<{ name: z.ZodString; type: z.ZodEnum<["architectural", "structural", "organizational", "communication", "testing", "data"]>; confidence: z.ZodNumber; description: z.ZodString; evidence: z.ZodArray<z.ZodString, "many">; filePaths: z.ZodArray<z.ZodString, "many">; suboptimal: z.ZodOptional<z.ZodBoolean>; recommendations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data"; evidence: string[]; confidence: number; name: string; filePaths: string[]; description: string; recommendations?: string[] | undefined; suboptimal?: boolean | undefined; }, { type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data"; evidence: string[]; confidence: number; name: string; filePaths: string[]; description: string; recommendations?: string[] | undefined; suboptimal?: boolean | undefined; }>, "many">; rules: z.ZodArray<z.ZodAny, "many">; relationships: z.ZodArray<z.ZodObject<{ source: z.ZodString; target: z.ZodString; type: z.ZodEnum<["implements", "depends_on", "conflicts_with", "supersedes", "relates_to"]>; strength: z.ZodNumber; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "implements" | "depends_on" | "conflicts_with" | "supersedes" | "relates_to"; source: string; target: string; strength: number; description?: string | undefined; }, { type: "implements" | "depends_on" | "conflicts_with" | "supersedes" | "relates_to"; source: string; target: string; strength: number; description?: string | undefined; }>, "many">; metadata: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional<z.ZodString>; version: z.ZodOptional<z.ZodString>; lastAnalyzed: z.ZodString; analysisVersion: z.ZodString; fileCount: z.ZodNumber; directoryCount: z.ZodNumber; }, "strip", z.ZodTypeAny, { name: string; lastAnalyzed: string; analysisVersion: string; fileCount: number; directoryCount: number; version?: string | undefined; description?: string | undefined; }, { name: string; lastAnalyzed: string; analysisVersion: string; fileCount: number; directoryCount: number; version?: string | undefined; description?: string | undefined; }>; }, "strip", z.ZodTypeAny, { timestamp: string; metadata: { name: string; lastAnalyzed: string; analysisVersion: string; fileCount: number; directoryCount: number; version?: string | undefined; description?: string | undefined; }; technologies: { category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool"; evidence: string[]; confidence: number; name: string; filePaths: string[]; version?: string | undefined; description?: string | undefined; }[]; patterns: { type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data"; evidence: string[]; confidence: number; name: string; filePaths: string[]; description: string; recommendations?: string[] | undefined; suboptimal?: boolean | undefined; }[]; projectId: string; adrs: { status: "proposed" | "accepted" | "deprecated" | "superseded"; date: string; title: string; context: string; id: string; decision: string; consequences: string; filePath: string; tags?: string[] | undefined; implementationPlan?: string | undefined; relatedAdrs?: string[] | undefined; }[]; rules: any[]; relationships: { type: "implements" | "depends_on" | "conflicts_with" | "supersedes" | "relates_to"; source: string; target: string; strength: number; description?: string | undefined; }[]; }, { timestamp: string; metadata: { name: string; lastAnalyzed: string; analysisVersion: string; fileCount: number; directoryCount: number; version?: string | undefined; description?: string | undefined; }; technologies: { category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool"; evidence: string[]; confidence: number; name: string; filePaths: string[]; version?: string | undefined; description?: string | undefined; }[]; patterns: { type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data"; evidence: string[]; confidence: number; name: string; filePaths: string[]; description: string; recommendations?: string[] | undefined; suboptimal?: boolean | undefined; }[]; projectId: string; adrs: { status: "proposed" | "accepted" | "deprecated" | "superseded"; date: string; title: string; context: string; id: string; decision: string; consequences: string; filePath: string; tags?: string[] | undefined; implementationPlan?: string | undefined; relatedAdrs?: string[] | undefined; }[]; rules: any[]; relationships: { type: "implements" | "depends_on" | "conflicts_with" | "supersedes" | "relates_to"; source: string; target: string; strength: number; description?: string | undefined; }[]; }>; export interface AdrTask { id: string; adrId: string; title: string; description: string; status: 'pending' | 'in_progress' | 'completed' | 'blocked'; priority: 'low' | 'medium' | 'high' | 'critical'; estimatedEffort?: string; assignee?: string; dueDate?: string; dependencies?: string[]; verificationCriteria?: string; completionEvidence?: string[]; } export declare const AdrTaskSchema: z.ZodObject<{ id: z.ZodString; adrId: z.ZodString; title: z.ZodString; description: z.ZodString; status: z.ZodEnum<["pending", "in_progress", "completed", "blocked"]>; priority: z.ZodEnum<["low", "medium", "high", "critical"]>; estimatedEffort: z.ZodOptional<z.ZodString>; assignee: z.ZodOptional<z.ZodString>; dueDate: z.ZodOptional<z.ZodString>; dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; verificationCriteria: z.ZodOptional<z.ZodString>; completionEvidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { status: "pending" | "completed" | "in_progress" | "blocked"; title: string; id: string; description: string; adrId: string; priority: "medium" | "low" | "high" | "critical"; estimatedEffort?: string | undefined; assignee?: string | undefined; dueDate?: string | undefined; dependencies?: string[] | undefined; verificationCriteria?: string | undefined; completionEvidence?: string[] | undefined; }, { status: "pending" | "completed" | "in_progress" | "blocked"; title: string; id: string; description: string; adrId: string; priority: "medium" | "low" | "high" | "critical"; estimatedEffort?: string | undefined; assignee?: string | undefined; dueDate?: string | undefined; dependencies?: string[] | undefined; verificationCriteria?: string | undefined; completionEvidence?: string[] | undefined; }>; export interface Rule { id: string; name: string; description: string; type: 'architectural' | 'coding' | 'security' | 'performance' | 'documentation'; severity: 'info' | 'warning' | 'error' | 'critical'; pattern: string; message: string; source: 'adr' | 'inferred' | 'user_defined'; sourceId?: string; enabled: boolean; tags?: string[]; } export declare const RuleSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; description: z.ZodString; type: z.ZodEnum<["architectural", "coding", "security", "performance", "documentation"]>; severity: z.ZodEnum<["info", "warning", "error", "critical"]>; pattern: z.ZodString; message: z.ZodString; source: z.ZodEnum<["adr", "inferred", "user_defined"]>; sourceId: z.ZodOptional<z.ZodString>; enabled: z.ZodBoolean; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { message: string; type: "performance" | "architectural" | "coding" | "security" | "documentation"; id: string; name: string; description: string; source: "adr" | "inferred" | "user_defined"; severity: "error" | "warning" | "info" | "critical"; pattern: string; enabled: boolean; tags?: string[] | undefined; sourceId?: string | undefined; }, { message: string; type: "performance" | "architectural" | "coding" | "security" | "documentation"; id: string; name: string; description: string; source: "adr" | "inferred" | "user_defined"; severity: "error" | "warning" | "info" | "critical"; pattern: string; enabled: boolean; tags?: string[] | undefined; sourceId?: string | undefined; }>; export declare class McpAdrError extends Error { readonly code: string; readonly details?: Record<string, unknown>; constructor(message: string, code: string, details?: Record<string, unknown>); } export declare class ValidationError extends McpAdrError { constructor(message: string, details?: Record<string, unknown>); } export declare class FileSystemError extends McpAdrError { constructor(message: string, details?: Record<string, unknown>); } export declare class AnalysisError extends McpAdrError { constructor(message: string, details?: Record<string, unknown>); } export type ConfidenceLevel = 'low' | 'medium' | 'high'; export interface AnalysisResult<T> { data: T; confidence: number; timestamp: string; source: string; warnings?: string[]; errors?: string[]; } export interface CacheEntry<T> { key: string; data: T; timestamp: string; ttl: number; metadata?: Record<string, unknown>; } export type { ArchitecturalDomain, KnowledgeCategory, KnowledgeGenerationConfig, ArchitecturalContext, ProjectContext, DomainKnowledge, KnowledgeItem, KnowledgeGenerationResult } from './knowledge-generation.js'; export type { APEConfig, GenerationStrategy, EvaluationCriterion, SelectionStrategy, PromptCandidate, OptimizationResult, ToolOptimizationConfig, EvaluationResult, PerformanceMetrics } from './ape-framework.js'; export type { ReflexionConfig, TaskAttempt, ReflexionMemory, MemoryType, ReflectionDepth, LearningProgress, ReflexionResult, MemoryQuery, ToolReflexionConfig, SelfReflection, LearningOutcome } from './reflexion-framework.js'; //# sourceMappingURL=index.d.ts.map