UNPKG

cortexweaver

Version:

CortexWeaver is a command-line interface (CLI) tool that orchestrates a swarm of specialized AI agents, powered by Claude Code and Gemini CLI, to assist in software development. It transforms a high-level project plan (plan.md) into a series of coordinate

105 lines 3.24 kB
import { CognitiveCanvas } from '../cognitive-canvas'; import { SessionManager } from '../session'; import { AgentSpawner } from './agent-spawner'; import { WorkflowManager } from './workflow-manager'; export interface ErrorContext { id: string; type: 'system_failure' | 'workflow_step_error' | 'impasse' | 'critique_failure' | 'timeout'; severity: 'low' | 'medium' | 'high' | 'critical'; errorMessage: string; step?: string; taskId: string; timestamp: string; metadata?: any; } export interface RecoveryStrategy { type: 'retry' | 'spawn_helper' | 'skip_step' | 'escalate' | 'pause_downstream'; config: any; } export interface ErrorHandlingResult { success: boolean; strategy: RecoveryStrategy; message: string; escalated?: boolean; } /** * Error Handler Strategy Manager * Contains recovery strategy implementations and error context management */ export declare class ErrorHandlerStrategies { private canvas; private sessionManager; private agentSpawner; private workflowManager; private activeCodeSavantSessions; private taskErrorHistories; private recoveryStatistics; constructor(canvas: CognitiveCanvas, sessionManager: SessionManager, agentSpawner: AgentSpawner, workflowManager: WorkflowManager); /** * Store error context in cognitive canvas */ storeErrorContext(errorContext: ErrorContext): Promise<void>; /** * Determine recovery strategy based on error context */ determineRecoveryStrategy(errorContext: ErrorContext, diagnosticResult?: any): Promise<RecoveryStrategy>; /** * Execute recovery strategy */ executeRecoveryStrategy(taskId: string, strategy: RecoveryStrategy, errorContext: ErrorContext): Promise<ErrorHandlingResult>; /** * Execute spawn helper strategy */ private executeSpawnHelper; /** * Execute retry strategy */ private executeRetry; /** * Execute pause downstream strategy */ private executePauseDownstream; /** * Pause downstream tasks based on severity */ pauseDownstreamTasks(taskId: string, severity: string): Promise<void>; /** * Get session output for task */ getSessionOutput(taskId: string): Promise<string>; /** * Determine severity from critique issues */ determineSeverity(issues: Array<{ severity: string; }>): 'low' | 'medium' | 'high'; /** * Get strength value for severity level */ private getSeverityStrength; /** * Get active CodeSavant sessions for compatibility */ getActiveCodeSavantSessions(): Set<string>; /** * Get error history for a specific task */ getTaskErrorHistory(taskId: string): any[]; /** * Get error recovery statistics */ getErrorRecoveryStatistics(): any; /** * Track error for history and statistics */ trackError(taskId: string, errorData: any): void; /** * Track successful recovery */ trackSuccessfulRecovery(taskId: string): void; /** * Add new CodeSavant session to tracking */ addCodeSavantSession(taskId: string): void; } //# sourceMappingURL=error-handler-strategies.d.ts.map