UNPKG

thoughtmcp

Version:

AI that thinks more like humans do - MCP server with human-like cognitive architecture for enhanced reasoning, memory, and self-monitoring

163 lines 4.93 kB
/** * Comprehensive Testing Framework for ThoughtMCP * * This framework provides a scalable, flexible testing infrastructure that supports: * - Unit testing for individual cognitive components * - Integration testing for the full cognitive pipeline * - Performance benchmarking and profiling * - Memory and resource usage monitoring * - Bias detection and validation testing * - Cognitive architecture compliance testing */ export interface TestCase<T = any> { name: string; description?: string; input: T; expected?: any; shouldThrow?: boolean; errorMessage?: string; timeout?: number; tags?: string[]; } export interface PerformanceMetrics { executionTime: number; memoryUsage: number; cpuUsage?: number; throughput?: number; } export interface CognitiveTestResult { passed: boolean; metrics: PerformanceMetrics; cognitiveCompliance: CognitiveComplianceReport; biasDetection: BiasDetectionReport; errors: Error[]; } export interface CognitiveComplianceReport { hierarchicalProcessing: boolean; dualProcessTheory: boolean; memoryIntegration: boolean; emotionalProcessing: boolean; metacognition: boolean; predictiveProcessing: boolean; stochasticProcessing: boolean; score: number; } export interface BiasDetectionReport { detectedBiases: string[]; confidenceBias: number; availabilityBias: number; confirmationBias: number; anchoringBias: number; overallBiasScore: number; } export interface TestSuite { name: string; description: string; setup?: () => Promise<void>; teardown?: () => Promise<void>; tests: TestCase[]; tags?: string[]; } /** * Main Testing Framework Class */ export declare class CognitiveTestFramework { private testSuites; private performanceBaselines; private testResults; constructor(); private initializeFramework; /** * Register a test suite with the framework */ registerSuite(suite: TestSuite): void; /** * Run all registered test suites */ runAllSuites(): Promise<Map<string, CognitiveTestResult[]>>; /** * Run a specific test suite */ runSuite(suite: TestSuite): Promise<CognitiveTestResult[]>; /** * Run an individual test case */ runTest(testCase: TestCase): Promise<CognitiveTestResult>; /** * Execute a test case with proper error handling and timeout */ private executeTest; /** * Override this method in specific test implementations */ protected runTestLogic(testCase: TestCase): any; /** * Assess cognitive architecture compliance */ private assessCognitiveCompliance; /** * Detect cognitive biases in results */ private detectBiases; private checkHierarchicalProcessing; private checkDualProcessTheory; private checkMemoryIntegration; private checkEmotionalProcessing; private checkMetacognition; private checkPredictiveProcessing; private checkStochasticProcessing; private identifyBiases; private measureConfidenceBias; private measureAvailabilityBias; private measureConfirmationBias; private measureAnchoringBias; private calculateOverallBiasScore; private estimateAccuracy; private setupGlobalMocks; private loadPerformanceBaselines; protected getMemoryUsage(): number; private getDefaultComplianceReport; private getDefaultBiasReport; /** * Generate a comprehensive test report */ generateReport(): TestReport; private calculateAverageExecutionTime; private calculateAverageMemoryUsage; private calculateAverageCognitiveCompliance; private calculateAverageBiasScore; } export interface TestReport { totalTests: number; passedTests: number; failedTests: number; averageExecutionTime: number; averageMemoryUsage: number; cognitiveComplianceScore: number; overallBiasScore: number; detailedResults: Map<string, CognitiveTestResult[]>; } /** * Specialized test framework for cognitive components */ export declare class CognitiveComponentTestFramework extends CognitiveTestFramework { protected runTestLogic(testCase: TestCase): any; } /** * Performance testing framework */ export declare class PerformanceTestFramework extends CognitiveTestFramework { private benchmarks; runPerformanceBenchmark(name: string, testFn: () => Promise<any>): Promise<PerformanceMetrics>; getBenchmarks(): Map<string, PerformanceMetrics>; } /** * Memory testing framework for cognitive memory systems */ export declare class MemoryTestFramework extends CognitiveTestFramework { testMemoryConsolidation(memorySystem: any): Promise<boolean>; testMemoryDecay(memorySystem: any): Promise<boolean>; private simulateTimePassage; } export { CognitiveTestFramework as default }; //# sourceMappingURL=TestFramework.d.ts.map