route-claudecode
Version:
Advanced routing and transformation system for Claude Code outputs to multiple AI providers
39 lines • 1.26 kB
TypeScript
/**
* 错误跟踪器 - 专门处理错误日志和分析
* 整合原有的PipelineDebugger错误处理功能
*/
import { UnifiedLogger } from './unified-logger';
export interface ToolCallError {
requestId: string;
errorMessage: string;
transformationStage: string;
provider: string;
model: string;
context: any;
port: number;
}
export interface StandardizedError {
port: number;
provider: string;
model: string;
key: string;
errorCode: number;
reason: string;
requestId: string;
}
export declare class ErrorTracker {
private logger;
private recentErrors;
private maxRecentErrors;
constructor(logger: UnifiedLogger);
logToolCallError(error: ToolCallError): void;
logStandardizedError(error: StandardizedError): void;
logGeneralError(message: string, error: Error | any, requestId?: string, stage?: string, context?: any): void;
detectToolCallInText(text: string, requestId: string, transformationStage: string, provider: string, model: string): boolean;
private redactKey;
private addToRecentErrors;
getRecentErrors(count?: number): any[];
getErrorStats(): any;
clearOldErrors(maxAgeMs?: number): number;
}
//# sourceMappingURL=error-tracker.d.ts.map