thoughtmcp
Version:
AI that thinks more like humans do - MCP server with human-like cognitive architecture for enhanced reasoning, memory, and self-monitoring
91 lines • 3.68 kB
TypeScript
/**
* Enhanced logging utilities for cognitive processing with structured cognitive context
*/
export declare enum LogLevel {
DEBUG = 0,
INFO = 1,
WARN = 2,
ERROR = 3
}
export declare enum DebugMode {
NONE = "none",
BASIC = "basic",
DETAILED = "detailed",
FULL = "full"
}
export interface CognitiveContext {
session_id?: string;
processing_mode?: string;
component_state?: Record<string, unknown>;
reasoning_step?: number;
confidence?: number;
memory_usage?: number;
processing_time?: number;
emotional_state?: Record<string, unknown>;
working_memory_load?: number;
prediction_error?: number;
metacognitive_flags?: string[];
[key: string]: unknown;
}
export interface LogEntry {
timestamp: number;
level: LogLevel;
component: string;
message: string;
context?: Record<string, unknown>;
cognitive_context?: CognitiveContext;
trace_id?: string;
parent_trace_id?: string;
}
export declare class CognitiveLogger {
private static instance;
private logLevel;
private debugMode;
private logs;
private maxLogs;
private enableVisualization;
private traceStack;
private componentFilters;
private constructor();
static getInstance(): CognitiveLogger;
private generateTraceId;
private shouldLog;
private formatLogOutput;
private formatCognitiveContext;
private log;
debug(component: string, message: string, context?: Record<string, unknown>, cognitiveContext?: CognitiveContext): void;
info(component: string, message: string, context?: Record<string, unknown>, cognitiveContext?: CognitiveContext): void;
warn(component: string, message: string, context?: Record<string, unknown>, cognitiveContext?: CognitiveContext): void;
error(component: string, message: string, context?: Record<string, unknown>, cognitiveContext?: CognitiveContext): void;
logThoughtProcess(component: string, step: number, content: string, confidence: number, processingTime: number, cognitiveContext?: Partial<CognitiveContext>): void;
logMemoryOperation(component: string, operation: string, details: string, memoryUsage?: number, cognitiveContext?: Partial<CognitiveContext>): void;
logEmotionalState(component: string, message: string, emotionalState: Record<string, unknown>, cognitiveContext?: Partial<CognitiveContext>): void;
logPredictionError(component: string, message: string, predictionError: number, cognitiveContext?: Partial<CognitiveContext>): void;
logMetacognition(component: string, message: string, flags: string[], cognitiveContext?: Partial<CognitiveContext>): void;
startTrace(traceId?: string): string;
endTrace(): string | undefined;
getCurrentTrace(): string | undefined;
getLogs(level?: LogLevel, component?: string, sessionId?: string, traceId?: string, timeRange?: {
start: number;
end: number;
}): LogEntry[];
getCognitiveTimeline(sessionId: string): LogEntry[];
getComponentDebugInfo(component: string, sessionId?: string): {
logs: LogEntry[];
stats: {
total_entries: number;
avg_processing_time?: number;
avg_confidence?: number;
error_count: number;
};
};
clearLogs(): void;
setLogLevel(level: LogLevel): void;
setDebugMode(mode: DebugMode): void;
setComponentFilters(components: string[]): void;
setVisualizationEnabled(enable: boolean): void;
private generateVisualizationData;
}
export declare const Logger: typeof CognitiveLogger;
export declare function getLogger(): CognitiveLogger;
//# sourceMappingURL=logger.d.ts.map