github-mcp-auto-git
Version:
GitHub MCP Auto Git v3.0 - メモリ効率化・統合MCP・モジュール化完了の完全自動Git操作システム
117 lines • 3.1 kB
TypeScript
/**
* Error Recovery System - 堅牢なエラーハンドリング・リカバリー機能
* Constitutional AI原則の「Fail Fast」に基づく高度なエラー処理
*/
export declare enum ErrorLevel {
LOW = "low",
MEDIUM = "medium",
HIGH = "high",
CRITICAL = "critical"
}
export declare enum ErrorCategory {
NETWORK = "network",
FILE_SYSTEM = "file_system",
GIT_OPERATION = "git_operation",
GITHUB_API = "github_api",
SUBAGENT = "subagent",
CONFIGURATION = "configuration",
PERMISSION = "permission",
VALIDATION = "validation"
}
export interface ErrorContext {
operation: string;
timestamp: Date;
workingDir: string;
files?: string[];
attempt: number;
metadata?: Record<string, any>;
}
export interface RecoveryAction {
type: 'retry' | 'fallback' | 'skip' | 'abort' | 'manual';
description: string;
maxAttempts?: number;
delayMs?: number;
fallbackFunction?: () => Promise<any>;
}
export interface ErrorReport {
id: string;
level: ErrorLevel;
category: ErrorCategory;
message: string;
originalError: Error;
context: ErrorContext;
recoveryAction: RecoveryAction;
resolved: boolean;
resolutionTime?: number;
finalOutcome?: 'success' | 'failure' | 'partial';
}
export declare class ErrorRecoverySystem {
private errorLog;
private retryCount;
private maxRetries;
private baseDelayMs;
/**
* メインエラーハンドリング関数 - Fail Fast原則
*/
handleError<T>(error: Error, context: ErrorContext, fallbackFn?: () => Promise<T>): Promise<T>;
/**
* エラー分類とリカバリー戦略の決定
*/
private createErrorReport;
/**
* エラー分類
*/
private categorizeError;
/**
* エラーレベルの決定
*/
private determineErrorLevel;
/**
* リカバリーアクション決定
*/
private determineRecoveryAction;
/**
* リカバリーアクション実行
*/
private executeRecoveryAction;
/**
* リトライ実行
*/
private executeRetry;
/**
* フォールバック実装
*/
private createLocalOnlyFallback;
private createSubagentFallback;
/**
* ユーティリティ関数
*/
private calculateBackoffDelay;
private delay;
private generateErrorId;
private markResolved;
private logErrorToFile;
/**
* エラー統計とヘルスチェック
*/
getErrorStatistics(): {
total: number;
byLevel: Record<ErrorLevel, number>;
byCategory: Record<ErrorCategory, number>;
resolvedCount: number;
avgResolutionTime: number;
};
/**
* システムヘルスチェック
*/
checkSystemHealth(): {
status: 'healthy' | 'warning' | 'critical';
message: string;
recommendations: string[];
};
/**
* エラーログのクリーンアップ
*/
clearOldErrors(olderThanHours?: number): number;
}
//# sourceMappingURL=error-recovery.d.ts.map