UNPKG

mushcode-mcp-server

Version:

A specialized Model Context Protocol server for MUSHCODE development assistance. Provides AI-powered code generation, validation, optimization, and examples for MUD development.

68 lines 2.21 kB
/** * Pattern matching algorithms for code generation and validation */ import { MushcodePattern, PatternMatch, SecurityRule, CodeExample } from '../types/knowledge.js'; import { MushcodeKnowledgeBase } from './base.js'; /** * Pattern matching service for MUSHCODE knowledge base */ export declare class PatternMatcher { private knowledgeBase; constructor(knowledgeBase: MushcodeKnowledgeBase); /** * Find patterns matching a natural language description */ findPatternsForGeneration(description: string, serverType?: string, functionType?: string, difficulty?: string): PatternMatch[]; /** * Find security rules that match code patterns */ findSecurityViolations(code: string, serverType?: string): SecurityRule[]; /** * Find patterns similar to existing code for optimization suggestions */ findOptimizationPatterns(code: string, serverType?: string): PatternMatch[]; /** * Find examples that demonstrate similar functionality */ findSimilarExamples(code: string, serverType?: string, limit?: number): CodeExample[]; /** * Extract meaningful terms from MUSHCODE for pattern matching */ private extractCodeTerms; /** * Calculate relevance between code terms and a pattern */ private calculateCodePatternRelevance; /** * Calculate relevance between code terms and an example */ private calculateExampleCodeRelevance; /** * Get matched terms between code and pattern */ private getCodeMatchedTerms; /** * Find patterns by exact name match */ findPatternByName(name: string): MushcodePattern | undefined; /** * Find patterns by tag */ findPatternsByTag(tag: string): MushcodePattern[]; /** * Find patterns that are related to a given pattern */ findRelatedPatterns(patternId: string): MushcodePattern[]; /** * Find patterns with similar tags */ private findPatternsBySimilarTags; /** * Validate pattern template syntax */ validatePatternTemplate(template: string): { valid: boolean; errors: string[]; }; } //# sourceMappingURL=matcher.d.ts.map