thoughtmcp
Version:
AI that thinks more like humans do - MCP server with human-like cognitive architecture for enhanced reasoning, memory, and self-monitoring
97 lines • 3.1 kB
TypeScript
/**
* Debug Controller for Component-Level Inspection
*
* Provides debugging capabilities for cognitive components including
* state inspection, performance monitoring, and interactive debugging.
*/
import { CognitiveComponent, ComponentStatus } from "../interfaces/cognitive.js";
import { CognitiveVisualizer } from "./CognitiveVisualizer.js";
import { CognitiveContext, DebugMode } from "./logger.js";
export interface DebugSession {
id: string;
start_time: number;
components: Map<string, ComponentDebugInfo>;
breakpoints: Set<string>;
step_mode: boolean;
current_step: number;
}
export interface ComponentDebugInfo {
component_name: string;
status: ComponentStatus;
state_snapshot: Record<string, unknown>;
performance_metrics: {
avg_processing_time: number;
memory_usage: number;
error_count: number;
call_count: number;
};
last_input?: unknown;
last_output?: unknown;
last_error?: Error;
}
export interface BreakpointCondition {
component?: string;
confidence_threshold?: number;
processing_time_threshold?: number;
error_condition?: boolean;
custom_condition?: (context: CognitiveContext) => boolean;
}
export declare class DebugController {
private logger;
private visualizer;
private debugSessions;
private globalBreakpoints;
private componentInspectors;
/**
* Start a new debug session
*/
startDebugSession(sessionId: string, debugMode?: DebugMode): DebugSession;
/**
* End a debug session and generate report
*/
endDebugSession(sessionId: string): {
session: DebugSession;
report: string;
visualization_data: string;
};
/**
* Register a component for debugging
*/
registerComponent(sessionId: string, component: CognitiveComponent): void;
/**
* Set a breakpoint with conditions
*/
setBreakpoint(name: string, condition: BreakpointCondition): void;
/**
* Remove a breakpoint
*/
removeBreakpoint(name: string): void;
/**
* Check if execution should break at current context
*/
shouldBreak(component: string, context: CognitiveContext): boolean;
/**
* Step through execution (for step mode debugging)
*/
step(sessionId: string): void;
/**
* Inspect component state
*/
inspectComponent(sessionId: string, componentName: string): ComponentDebugInfo | null;
/**
* Get all components in session
*/
getSessionComponents(sessionId: string): ComponentDebugInfo[];
/**
* Generate cognitive flow visualization for session
*/
generateFlowVisualization(sessionId: string, format?: "ascii" | "mermaid"): string;
/**
* Get performance heatmap for session
*/
getPerformanceHeatmap(sessionId: string): ReturnType<CognitiveVisualizer["generatePerformanceHeatmap"]>;
private evaluateBreakpointCondition;
private generateDebugReport;
}
export declare function createDebugController(): DebugController;
//# sourceMappingURL=DebugController.d.ts.map