UNPKG

@simonecoelhosfo/optimizely-mcp-server

Version:

Optimizely MCP Server for AI assistants with integrated CLI tools

52 lines 1.92 kB
/** * Dependency Validator for Optimizely Entities * * This validator ensures that entity dependencies are satisfied before operations proceed. * It provides prescriptive guidance when dependencies are missing, following the operational * sequencing patterns defined in cursor agent rules. * * Key Dependencies: * - Audiences require Attributes to exist first * - Metrics require Events to exist first * - Experiments require Metrics (which require Events) * - Flags may require Variations and Variables */ export interface DependencyCheck { entityType: string; field: string; dependsOn: string; extractKey: (value: any) => string | string[]; errorMessage: (key: string) => string; prescriptiveGuidance: (key: string, projectId: string) => string; } export declare class DependencyValidator { private static dependencies; /** * Check dependencies for an entity and return prescriptive guidance if missing */ static checkDependencies(entityType: string, data: Record<string, any>, projectId: string, apiHelper?: any): Promise<{ isValid: boolean; errors: Array<{ field: string; missingDependency: string; prescriptiveGuidance: string; }>; }>; /** * Generate prescriptive guidance for a specific error */ static generateGuidanceForError(entityType: string, errorMessage: string, projectId: string, operation?: string): string | null; /** * Format error response for MCP client consumption */ static formatMCPError(operation: string, entityType: string, errorMessage: string, projectId: string): { error: string; prescriptiveGuidance?: string; nextSteps?: string[]; }; /** * Extract actionable next steps from prescriptive guidance */ private static extractNextSteps; } //# sourceMappingURL=DependencyValidator.d.ts.map