import { ActionStep, PageState } from '../../types'; import { ContextualStepAnalyzer } from '../analysis/contextual-analyzer'; import { StepContextManager } from '../analysis/step-context'; import { ActionPlanner } from '../planning/action-planner'; /** * Handles step refinement and retry logic with progressive strategies */ export declare class StepRefinementManager { private actionPlanner; private stepContextManager; private contextualAnalyzer?; private promptTemplate; constructor(actionPlanner: ActionPlanner, stepContextManager: StepContextManager, contextualAnalyzer?: ContextualStepAnalyzer | undefined); /** * Execute a step with retry mechanism and progressive refinement */ executeStepWithRetry(step: ActionStep, stepContext: any, pageState: PageState | undefined, maxRetries: number | undefined, executeStep: (step: ActionStep) => Promise): Promise; /** * Apply progressive refinement strategies based on attempt number */ private progressivelyRefineStep; /** * Generate alternative selector patterns for common failure cases */ private generateAlternativeSelector; /** * Use AI to refine step with error context */ private aiRefineStepWithErrorContext; /** * Check if a step needs context-aware refinement */ needsRefinement(step: ActionStep): boolean; /** * Refine a step using both previous step context and current page content */ refineStepWithContext(step: ActionStep, stepContext: any, pageState: PageState | undefined): Promise; /** * Create a context-aware prompt for step refinement */ private createContextualPrompt; }