/** * Input validation and sanitization functions */ /** * Enhanced input validation for MCP tools */ export declare class MCPInputValidator { /** * Validate a persona identifier (name or filename) */ static validatePersonaIdentifier(identifier: string): string; /** * Validate search query for collection */ static validateSearchQuery(query: string): string; /** * Validate collection path */ static validateCollectionPath(path: string): string; /** * Validate URL for import operations */ static validateImportUrl(url: string): string; /** * Validate expiry days for sharing */ static validateExpiryDays(days: number): number; /** * Validate boolean confirmation parameters */ static validateConfirmation(confirm: boolean, operationName: string): boolean; /** * Validate field name for edit operations */ static validateEditField(field: string): string; /** * Sanitize text for safe display output * Removes core shell metacharacters to prevent command injection in displayed messages * * Uses a conservative subset of shell metacharacters (;, &, |, `, $, parentheses) * that are most critical for command injection prevention while preserving * common punctuation like !, ?, * for better user experience in display contexts. * * @param text - Text to sanitize for display * @returns Sanitized text with core shell metacharacters removed */ static sanitizeForDisplay(text: string): string; /** * Check if hostname is a private IP address (IPv4 and IPv6) */ private static isPrivateIP; /** * Check for encoded private IP addresses that could bypass basic detection */ private static isEncodedPrivateIP; } /** * Validate and sanitize a filename */ export declare function validateFilename(filename: string): string; /** * Validate and sanitize a path */ export declare function validatePath(inputPath: string, baseDir?: string): string; /** * Validate and sanitize a username */ export declare function validateUsername(username: string): string; /** * Validate a category */ export declare function validateCategory(category: string): string; /** * Validate content size */ export declare function validateContentSize(content: string, maxSize?: number): void; /** * Comprehensive input validation before pattern matching * Validates all content types with appropriate limits */ export interface ContentValidationOptions { maxContentLength?: number; maxYamlLength?: number; maxMetadataFieldLength?: number; maxFileSize?: number; } export declare function validateInputLengths(content: string, contentType: 'full' | 'yaml' | 'metadata' | 'field', options?: ContentValidationOptions): void; /** * General input sanitization */ export declare function sanitizeInput(input: string, maxLength?: number): string; //# sourceMappingURL=InputValidator.d.ts.map