@ai-capabilities-suite/mcp-debugger-core
Version:
Core debugging engine for Node.js and TypeScript applications. Provides Inspector Protocol integration, breakpoint management, variable inspection, execution control, profiling, hang detection, and source map support.
88 lines (87 loc) • 2.01 kB
TypeScript
/**
* Variable formatting customization for debug output
* Supports custom formatters, pretty-printing, truncation, and user-defined display rules
*/
export interface FormatterOptions {
maxDepth?: number;
maxLength?: number;
maxArrayLength?: number;
maxStringLength?: number;
indent?: number;
showHidden?: boolean;
showTypes?: boolean;
customFormatters?: Map<string, CustomFormatter>;
}
export interface CustomFormatter {
test: (value: any) => boolean;
format: (value: any, options: FormatterOptions) => string;
}
export interface FormattedValue {
value: string;
type: string;
truncated: boolean;
}
/**
* Formats variables for display in debugging output
*/
export declare class VariableFormatter {
private options;
private customFormatters;
constructor(options?: FormatterOptions);
/**
* Format a value for display
*/
format(value: any, depth?: number): FormattedValue;
/**
* Format a string value
*/
private formatString;
/**
* Format a function
*/
private formatFunction;
/**
* Format an array
*/
private formatArray;
/**
* Format an object
*/
private formatObject;
/**
* Format an error
*/
private formatError;
/**
* Format a Map
*/
private formatMap;
/**
* Format a Set
*/
private formatSet;
/**
* Check if output should be pretty-printed
*/
private shouldPrettyPrint;
/**
* Truncate string if it exceeds max length
*/
private truncateIfNeeded;
/**
* Register a custom formatter
*/
registerFormatter(name: string, formatter: CustomFormatter): void;
/**
* Unregister a custom formatter
*/
unregisterFormatter(name: string): boolean;
/**
* Update formatting options
*/
updateOptions(options: Partial<FormatterOptions>): void;
/**
* Get current options
*/
getOptions(): FormatterOptions;
}