UNPKG

@simonecoelhosfo/optimizely-mcp-server

Version:

Optimizely MCP Server for AI assistants with integrated CLI tools

97 lines 2.84 kB
/** * Validation Middleware for Orchestration * * Integrates comprehensive validation at template creation and pre-execution stages */ import { OrchestrationTemplate } from '../types/index.js'; export interface ValidationOptions { validateStructure?: boolean; validateEntities?: boolean; validateDirectTemplate?: boolean; autoFix?: boolean; platform?: 'web' | 'feature'; } export interface ValidationReport { valid: boolean; structureValidation?: { valid: boolean; errors: string[]; warnings: string[]; }; entityValidation?: { valid: boolean; errors: Array<{ stepId: string; entityType: string; errors: string[]; }>; warnings: Array<{ stepId: string; entityType: string; warnings: string[]; }>; }; directTemplateValidation?: DirectTemplateValidation; summary: string; } export interface DirectTemplateValidation { valid: boolean; errors: string[]; warnings: string[]; suggestions: string[]; } export declare class ValidationMiddleware { private logger; private structureValidator; private entityValidator; private directTemplateValidator; constructor(); /** * Validate template at creation time */ validateTemplateCreation(template: OrchestrationTemplate, options?: ValidationOptions): Promise<ValidationReport>; /** * Validate before execution with resolved parameters */ validateBeforeExecution(template: OrchestrationTemplate, parameters: Record<string, any>, options?: ValidationOptions): Promise<ValidationReport>; /** * Validate orchestration template with direct ModelFriendlyTemplate format */ validateDirectTemplate(template: OrchestrationTemplate, options?: ValidationOptions): Promise<ValidationReport>; private validateDirectTemplateSteps; private validateTemplateStructure; private validateTemplateEntities; /** * Generate human-readable summary */ private generateSummary; /** * Format validation errors for user display */ formatErrorsForDisplay(report: ValidationReport): string; /** * Get actionable fixes for common errors */ getSuggestedFixes(report: ValidationReport): string[]; /** * Find closest match for typos */ private findClosestMatch; /** * Get cache statistics */ getCacheStats(): import("../../validation/SchemaCache.js").SchemaCacheStats; /** * Clear schema cache */ clearSchemaCache(): void; /** * Get cache memory usage */ getCacheMemoryUsage(): number; /** * Clean up expired cache entries */ cleanupCache(): number; } //# sourceMappingURL=ValidationMiddleware.d.ts.map