route-claudecode
Version:
Advanced routing and transformation system for Claude Code outputs to multiple AI providers
111 lines • 3.59 kB
TypeScript
/**
* 统一预处理器(向后兼容包装器)
* 现在使用统一兼容性预处理器,移除了补丁系统依赖
* 保持原有API接口以确保兼容性
*/
export interface UnifiedPatchPreprocessorConfig {
enabled: boolean;
debugMode: boolean;
forceAllInputs: boolean;
bypassConditions: string[];
performanceTracking: boolean;
cacheResults: boolean;
validateFinishReason: boolean;
strictFinishReasonValidation: boolean;
}
export declare class UnifiedPatchPreprocessor {
private compatibilityProcessor;
private logger;
private config;
constructor(port?: number, config?: Partial<UnifiedPatchPreprocessorConfig>);
/**
* 统一预处理入口:处理输入阶段数据
*/
preprocessInput(inputData: any, provider: string, model: string, requestId: string): Promise<any>;
/**
* 统一预处理入口:处理响应阶段数据
*/
preprocessResponse(responseData: any, provider: string, model: string, requestId: string): Promise<any>;
/**
* 统一预处理入口:处理流式数据块
*/
preprocessStreaming(chunkData: any, provider: string, model: string, requestId: string): Promise<any>;
/**
* 清理资源
*/
cleanup(): void;
/**
* 获取性能指标
*/
getPerformanceMetrics(): {
totalProcessed: number;
totalDuration: number;
byStage: {
input: {
count: number;
duration: number;
};
response: {
count: number;
duration: number;
};
streaming: {
count: number;
duration: number;
};
};
};
/**
* 向后兼容:滑动窗口工具检测
* @deprecated 现在由统一兼容性预处理器处理
*/
private slidingWindowToolDetection;
/**
* 向后兼容:强制工具调用检测
* @deprecated 现在由统一兼容性预处理器处理
*/
private forceToolCallDetection;
/**
* 向后兼容:ShuaiHong格式补丁
* @deprecated 现在由统一兼容性预处理器处理
*/
private applyShuaiHongFormatPatch;
/**
* 向后兼容:LMStudio工具调用解析
* @deprecated 现在由统一兼容性预处理器处理
*/
private parseLMStudioToolCalls;
/**
* 向后兼容:强制finish reason覆盖
* @deprecated 现在由统一兼容性预处理器处理
*/
private forceFinishReasonOverride;
/**
* 向后兼容:验证finish reason
* @deprecated 现在由统一兼容性预处理器处理
*/
private validateFinishReason;
/**
* 向后兼容:检测异常响应
* @deprecated 现在由统一兼容性预处理器处理
*/
private detectAbnormalResponse;
/**
* 向后兼容:生成错误信息
* @deprecated 现在由统一兼容性预处理器处理
*/
private generateErrorMessage;
}
/**
* 获取或创建统一预处理器实例
*/
export declare function getUnifiedPatchPreprocessor(port?: number, config?: Partial<UnifiedPatchPreprocessorConfig>): UnifiedPatchPreprocessor;
/**
* 创建新的统一预处理器实例
*/
export declare function createUnifiedPatchPreprocessor(port?: number, config?: Partial<UnifiedPatchPreprocessorConfig>): UnifiedPatchPreprocessor;
/**
* 重置统一预处理器实例
*/
export declare function resetUnifiedPatchPreprocessor(port?: number): void;
//# sourceMappingURL=unified-patch-preprocessor.d.ts.map