/** * Output Formatter Utility * Standardizes command output with nextActions array * @requirement REQ-MDC-OPTIMIZATION-002 */ export interface NextAction { type: 'command' | 'read_file' | 'check_state'; action: string; reason: string; required?: boolean; } export interface CommandOutput { status: 'success' | 'error'; data?: any; nextActions?: NextAction[]; error?: string; exitCode?: number; } /** * Error type enumeration * Maps error messages to specific error types for context-aware repair instructions * @requirement REPAIR-INSTRUCTIONS-001 - Error type detection */ export type ErrorType = 'NO_ACTIVE_TASK' | 'NO_WORKFLOW_STATE' | 'INVALID_WORKFLOW_STATE' | 'INVALID_STATE_TRANSITION' | 'WRONG_STATE' | 'CANNOT_COMMIT_AT_STATE' | 'REQUIRED_FILES_MISSING' | 'FILE_NOT_FOUND' | 'VALIDATION_FAILED' | 'GENERIC'; /** * Format command output with nextActions */ export declare function formatCommandOutput(result: any, nextActions?: NextAction[], options?: { json?: boolean; silent?: boolean; }): string; /** * Detect error type from error message * Maps error messages to specific error types for context-aware repair instructions * @requirement REPAIR-INSTRUCTIONS-001 - Error type detection */ export declare function detectErrorType(error: Error): ErrorType; /** * Display repair instructions for human-readable output * Formats nextActions array as a readable list of steps to fix errors * @requirement REPAIR-INSTRUCTIONS-002 - Display repair instructions */ export declare function displayRepairInstructions(nextActions: NextAction[], options?: { prefix?: string; indent?: number; }): void; /** * Display error with repair instructions * Handles both JSON and non-JSON output formats * @requirement REPAIR-INSTRUCTIONS-003 - Display error with repair */ export declare function displayErrorWithRepair(error: Error, nextActions?: NextAction[], options?: { json?: boolean; silent?: boolean; }): void; /** * Format error output * @requirement REPAIR-INSTRUCTIONS-004 - Update formatErrorOutput to return empty string for non-JSON */ export declare function formatErrorOutput(error: Error, nextActions?: NextAction[], options?: { json?: boolean; silent?: boolean; }): string;