@cortexguardai/mcp
Version:
A Node.js-based MCP adapter for seamless integration with AI development environments.
69 lines • 2.07 kB
TypeScript
import { Config } from './types.js';
/**
* Logging utilities with configurable verbosity
*/
export declare class Logger {
verbose: boolean;
constructor(verbose?: boolean);
info(message: string, ...args: any[]): void;
warn(message: string, ...args: any[]): void;
error(message: string, ...args: any[]): void;
debug(message: string, ...args: any[]): void;
setVerbose(verbose: boolean): void;
}
/**
* Validation utilities
*/
export declare class Validator {
private static readonly UUID_REGEX;
private static readonly URL_REGEX;
static isValidUUID(uuid: string): boolean;
static isValidURL(url: string): boolean;
static isValidTimeout(timeout: number): boolean;
static isValidToken(token: string): boolean;
static validateConfig(config: Config): string[];
}
/**
* Content-Length framing utilities
*/
export declare class FramingUtils {
private static readonly HEADER_SEPARATOR;
private static readonly LINE_SEPARATOR;
static frameMessage(content: string): string;
static parseFramedMessage(buffer: Buffer): {
message: string;
remaining: Buffer;
} | null;
}
/**
* JSON utilities with error handling
*/
export declare class JsonUtils {
static safeStringify(obj: any): string;
static safeParse(json: string): any;
}
/**
* Error handling utilities
*/
export declare class ErrorUtils {
static isNetworkError(error: any): boolean;
static isTimeoutError(error: any): boolean;
static getErrorMessage(error: any): string;
static sanitizeError(error: any): any;
}
/**
* Performance monitoring utilities
*/
export declare class PerfUtils {
private static timers;
static startTimer(name: string): void;
static endTimer(name: string): number;
static measureAsync<T>(name: string, fn: () => Promise<T>): Promise<T>;
}
/**
* Retry utilities for network operations
*/
export declare class RetryUtils {
static withRetry<T>(operation: () => Promise<T>, maxRetries?: number, baseDelay?: number): Promise<T>;
}
//# sourceMappingURL=utils.d.ts.map