UNPKG

tree-ast-grep-mcp

Version:

Simple, direct ast-grep wrapper for AI coding agents. Zero abstractions, maximum performance.

73 lines 2.63 kB
import { ValidationResult } from '../types/errors.js'; /** * Validates ast-grep patterns and emits structured diagnostics for tool consumers. */ export declare class EnhancedPatternValidator { private workspaceRoot; /** * Persist workspace context for language specific validation. */ constructor(workspaceRoot: string); /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ validatePattern(pattern: string, language?: string, context?: any): ValidationResult; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ validateNestedPattern(primaryPattern: string, insidePattern?: string, hasPattern?: string, notPattern?: string, language?: string): ValidationResult; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private validateMetavariables; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private extractAndValidateMetavariables; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private assessPatternReliability; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private validateLanguageSpecificPattern; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private validatePythonPattern; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private validateJavaScriptPattern; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private validateJavaPattern; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private isValidContainerPattern; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private checkPatternCompatibility; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private classifyPattern; /** * Validate an ast-grep pattern and gather structured diagnostics for tooling. */ private assessPatternComplexity; private checkLanguageCompatibility; private validateSyntax; private isFunctionPattern; private isClassPattern; private isImportPattern; private isExceptionPattern; private isVariablePattern; private isNestedPattern; private isValidJavaScriptClassPattern; } //# sourceMappingURL=pattern-validator.d.ts.map