codecrucible-synth
Version:
Production-Ready AI Development Platform with Multi-Voice Synthesis, Smithery MCP Integration, Enterprise Security, and Zero-Timeout Reliability
132 lines • 3.74 kB
TypeScript
/**
* SynthesisCoordinator - Application Layer Implementation
* Replaces integrated-system.ts with proper DI-based architecture
*
* Living Spiral Applied:
* - COLLAPSE: Centralized request coordination without tight coupling
* - COUNCIL: Multiple service orchestration through interfaces
* - SYNTHESIS: Unified response formation from multiple sources
* - REBIRTH: Clean execution with proper error handling
* - REFLECTION: Performance monitoring and quality assessment
*
* Council Perspectives:
* - Architect: Clean separation between application and infrastructure layers
* - Maintainer: Testable, mockable dependencies through DI
* - Security Guardian: All requests pass through security validation
* - Performance Engineer: Efficient resource utilization and caching
* - Explorer: Extensible architecture for new features
*/
import { EventEmitter } from 'events';
import { DependencyContainer } from '../di/dependency-container.js';
export interface ApplicationRequest {
id?: string;
prompt: string;
voice?: string;
model?: string;
temperature?: number;
maxTokens?: number;
stream?: boolean;
useTools?: boolean;
context?: Record<string, any>;
metadata?: Record<string, any>;
}
export interface ApplicationResponse {
id: string;
requestId?: string;
content: string;
synthesis: {
mode: 'single' | 'multi-voice' | 'collaborative';
voices: string[];
conflicts: any[];
consensus: {
agreement: number;
convergence: number;
stability: number;
diversity: number;
};
finalDecision: {
method: string;
reasoning: string;
confidence: number;
alternatives: number;
time: number;
};
};
metadata: {
processingTime: number;
voicesConsulted: number;
modelsUsed: string[];
totalTokens: number;
cachingUsed: boolean;
ragUsed: boolean;
workflowUsed: boolean;
costEstimate: number;
};
quality: {
overall: number;
accuracy: number;
completeness: number;
relevance: number;
creativity: number;
};
performance: {
responseTime: number;
tokenRate: number;
cacheHitRate: number;
resourceUsage: {
memory: number;
cpu: number;
};
};
}
export declare class SynthesisCoordinator extends EventEmitter {
private container;
private initialized;
private startTime;
constructor(container: DependencyContainer);
/**
* Initialize the synthesis coordinator
*/
initialize(): Promise<void>;
/**
* Process application request through synthesis pipeline
*/
processRequest(request: ApplicationRequest): Promise<ApplicationResponse>;
/**
* Synthesize enhanced response from basic model response
*/
private synthesizeResponse;
/**
* Create error response in standard format
*/
private createErrorResponse;
/**
* Verify all required dependencies are available
*/
private verifyDependencies;
/**
* Record performance metrics
*/
private recordPerformance;
/**
* Calculate token processing rate
*/
private calculateTokenRate;
/**
* Get current memory usage
*/
private getMemoryUsage;
/**
* Generate unique request ID
*/
private generateRequestId;
/**
* Get system status
*/
getStatus(): Promise<{
initialized: boolean;
uptime: number;
dependencies: Record<string, boolean>;
}>;
}
//# sourceMappingURL=synthesis-coordinator.d.ts.map