route-claudecode
Version:
Advanced routing and transformation system for Claude Code outputs to multiple AI providers
121 lines • 4.14 kB
TypeScript
/**
* Universal Pipeline Debug System for Claude Code Router
* Specialized for Gemini Tool Calling Pipeline Debug & Analysis
*
* Project owner: Jason Zhang
*
* This system provides comprehensive debugging infrastructure for ANY pipeline type:
* - API routing pipelines
* - Data processing pipelines
* - CI/CD workflow pipelines
* - Message queue pipelines
* - Transformation pipelines
*
* Core Features:
* - Universal debug hook integration
* - Hierarchical data capture & storage
* - Pipeline replay capabilities
* - Comprehensive testing matrix generation
* - Generic problem isolation framework
*/
export interface PipelineStep {
stepId: string;
stepName: string;
description: string;
inputData?: any;
outputData?: any;
errorData?: any;
timestamp: number;
duration?: number;
metadata?: Record<string, any>;
}
export interface PipelineDebugSession {
sessionId: string;
pipelineType: 'gemini-tool-calling' | 'openai-tool-calling' | 'anthropic-processing' | 'data-transformation' | 'custom';
testScriptName: string;
startTime: number;
endTime?: number;
steps: PipelineStep[];
summary?: PipelineDebugSummary;
}
export interface PipelineDebugSummary {
totalSteps: number;
successfulSteps: number;
failedSteps: number;
totalDuration: number;
failurePoint?: string;
errorDetails?: any;
dataCaptureSummary: DataCaptureSummary;
}
export interface DataCaptureSummary {
inputDataSize: number;
outputDataSize: number;
intermediateDataCount: number;
replayDataAvailable: boolean;
storageLocation: string;
}
export interface TestMatrixEntry {
testId: string;
testName: string;
pipelineType: string;
inputVariations: any[];
expectedOutputs: any[];
testConditions: Record<string, any>;
priority: 'critical' | 'high' | 'medium' | 'low';
}
export declare class UniversalPipelineDebugger {
private debugDataDir;
private currentSession?;
private debugEnabled;
constructor(debugDataDir?: string);
/**
* Initialize debug session with --debug flag support
* Non-intrusive: only activates when explicitly enabled
*/
initializeDebugSession(pipelineType: PipelineDebugSession['pipelineType'], testScriptName: string, enableDebug?: boolean): Promise<string>;
/**
* Capture pipeline step data with complete input/output preservation
* Works for ANY pipeline step type
*/
captureStepData(stepId: string, stepName: string, description: string, inputData: any, outputData?: any, errorData?: any, metadata?: Record<string, any>): Promise<void>;
/**
* Generate comprehensive testing matrix for pipeline validation
* Adapts to different pipeline types automatically
*/
generateTestingMatrix(pipelineType: string, currentRules?: any[]): Promise<TestMatrixEntry[]>;
/**
* Create pipeline replay mechanism for any captured data
* Enables precise problem reproduction
*/
replayPipelineStep(stepId: string, sessionId?: string, modifiedInput?: any): Promise<any>;
/**
* Analyze pipeline for problem isolation
* Generic framework that works across pipeline types
*/
analyzePipelineProblems(sessionId?: string): Promise<{
problemNodes: string[];
recommendedTests: string[];
isolationStrategy: string;
nextSteps: string[];
}>;
/**
* Complete debug session and generate comprehensive summary
*/
completeSession(): Promise<PipelineDebugSummary | null>;
private generateGeminiToolCallTestMatrix;
private generateOpenAIToolCallTestMatrix;
private generateAnthropicProcessingTestMatrix;
private generateGenericPipelineTestMatrix;
private createSessionDirectory;
private getSessionDirectory;
private persistStepData;
private loadStepData;
private saveSession;
private loadSession;
private saveTestMatrix;
private sanitizeData;
private removeSensitiveFields;
private calculateTotalDataSize;
}
export default UniversalPipelineDebugger;
//# sourceMappingURL=universal-pipeline-debug.d.ts.map