dfa-mcp-server
Version:
DFA-based workflow MCP server for guiding LLM task completion
44 lines • 1.66 kB
TypeScript
import { WorkflowContext, TransitionAttempt, JudgeDecision } from './types.js';
export declare class ErrorFormatter {
/**
* Format a rich error message for invalid transitions
*/
static formatInvalidActionError(currentState: string, attemptedAction: string, validActions: string[], workflowName: string): string;
/**
* Format a rich error message for missing required fields
*/
static formatMissingFieldsError(missingFields: string[], currentContext: WorkflowContext, targetState: string, action: string): string;
/**
* Format judge decision for better readability
*/
static formatJudgeDecision(decision: JudgeDecision, attempt: TransitionAttempt): string;
/**
* Format validation error with context comparison
*/
static formatValidationError(violation: string, currentValue: any, expectedValue: any, fieldPath?: string): string;
/**
* Format state transition path for clarity
*/
static formatTransitionPath(fromState: string, action: string, toState: string, isValid: boolean): string;
/**
* Helper: Find similar action name (for "did you mean?" suggestions)
*/
private static findSimilarAction;
/**
* Helper: Simple Levenshtein distance for similarity matching
*/
private static levenshteinDistance;
/**
* Helper: Get example value for a field name
*/
private static getFieldExample;
/**
* Helper: Format a value for display
*/
private static formatValue;
/**
* Helper: Wrap text to specified width
*/
private static wrapText;
}
//# sourceMappingURL=error-formatter.d.ts.map