il2cpp-dump-analyzer-mcp
Version:
Agentic RAG system for analyzing IL2CPP dump.cs files from Unity games
72 lines (71 loc) • 2.3 kB
TypeScript
/**
* Retry configuration options
*/
export interface RetryConfig {
/** Maximum number of retry attempts */
maxAttempts?: number;
/** Initial delay between retries in milliseconds */
initialDelayMs?: number;
/** Maximum delay between retries in milliseconds */
maxDelayMs?: number;
/** Backoff multiplier for exponential backoff */
backoffMultiplier?: number;
/** Jitter factor to add randomness to delays (0-1) */
jitterFactor?: number;
/** Function to determine if an error should trigger a retry */
shouldRetry?: (error: any, attempt: number) => boolean;
/** Callback for retry attempts */
onRetry?: (error: any, attempt: number, delay: number) => void;
}
/**
* Enhanced retry manager with exponential backoff and jitter
*/
export declare class RetryManager {
private config;
constructor(config?: RetryConfig);
/**
* Execute a function with retry logic
*/
execute<T>(operation: () => Promise<T>, operationName?: string): Promise<T>;
/**
* Calculate delay with exponential backoff and jitter
*/
private calculateDelay;
/**
* Sleep for specified milliseconds
*/
private sleep;
/**
* Create a retry manager with database-specific configuration
*/
static forDatabase(customConfig?: Partial<RetryConfig>): RetryManager;
/**
* Create a retry manager for vector operations
*/
static forVectorOperations(customConfig?: Partial<RetryConfig>): RetryManager;
}
/**
* Utility function to wrap any async function with retry logic
*/
export declare function withRetry<T extends any[], R>(fn: (...args: T) => Promise<R>, config?: RetryConfig): (...args: T) => Promise<R>;
/**
* Circuit breaker pattern for database operations
*/
export declare class CircuitBreaker {
private failureThreshold;
private timeoutMs;
private monitoringPeriodMs;
private failures;
private lastFailureTime;
private state;
constructor(failureThreshold?: number, timeoutMs?: number, monitoringPeriodMs?: number);
execute<T>(operation: () => Promise<T>): Promise<T>;
private onSuccess;
private onFailure;
getState(): string;
getStats(): {
failures: number;
state: string;
lastFailureTime: number;
};
}