firewalla-mcp-server
Version:
Model Context Protocol (MCP) server for Firewalla MSP API - Provides real-time network monitoring, security analysis, and firewall management through 28 specialized tools compatible with any MCP client
111 lines • 2.97 kB
TypeScript
/**
* Progressive Validator for Firewalla MCP Server
* Provides step-by-step validation guidance for complex queries
*/
import type { SEARCH_FIELDS } from '../search/types.js';
import { type FormattedErrorReport } from './error-formatter.js';
type EntityType = keyof typeof SEARCH_FIELDS;
/**
* Validation step types
*/
export type ValidationStep = 'basicSyntax' | 'fieldExistence' | 'operatorCompatibility' | 'semanticCorrectness' | 'performanceOptimization';
/**
* Step validation result
*/
export interface StepValidationResult {
step: ValidationStep;
isValid: boolean;
errors: string[];
warnings: string[];
suggestions: string[];
progress: number;
}
/**
* Progressive validation result
*/
export interface ProgressiveValidationResult {
isValid: boolean;
currentStep?: ValidationStep;
error?: FormattedErrorReport;
nextSteps?: string[];
progress: number;
allValidations?: Record<ValidationStep, StepValidationResult>;
overallGuidance?: string;
}
export declare class ProgressiveValidator {
private static readonly STEP_CONFIGS;
/**
* Validate query with progressive guidance
*/
static validateWithProgression(query: string, entityType: EntityType): ProgressiveValidationResult;
/**
* Validate basic syntax
*/
private static validateBasicSyntax;
/**
* Validate field existence and compatibility
*/
private static validateFields;
/**
* Validate operator compatibility
*/
private static validateOperators;
/**
* Validate semantic correctness
*/
private static validateSemantics;
/**
* Validate performance characteristics
*/
private static validatePerformance;
/**
* Find first critical failure
*/
private static findFirstCriticalFailure;
/**
* Calculate overall progress
*/
private static calculateProgress;
/**
* Get next steps guidance
*/
private static getNextSteps;
/**
* Generate overall guidance message
*/
private static generateOverallGuidance;
/**
* Generate optimization guidance for valid queries
*/
private static generateOptimizationGuidance;
/**
* Create error report for failed step
*/
private static createStepErrorReport;
/**
* Get error type for validation step
*/
private static getErrorTypeForStep;
/**
* Find contradictory conditions in query
*/
private static findContradictions;
/**
* Find redundant conditions
*/
private static findRedundancies;
/**
* Find impossible range conditions
*/
private static findImpossibleRanges;
/**
* Suggest semantic optimizations
*/
private static suggestSemanticOptimizations;
/**
* Calculate query complexity score
*/
private static calculateQueryComplexity;
}
export {};
//# sourceMappingURL=progressive-validator.d.ts.map