/**
 * SmartPerfetto Iteration Strategy Planner
 *
 * Phase 1.4: Intelligent iteration decision-making
 *
 * This agent decides what to do after each analysis iteration based on:
 * - Current evaluation results
 * - Previous analysis findings
 * - User intent and expectations
 * - Resource constraints
 *
 * Strategies:
 * - 'continue': Keep executing remaining skills
 * - 'deep_dive': Focus analysis on a specific area that needs more investigation
 * - 'pivot': Change analysis direction based on discoveries
 * - 'conclude': Sufficient information gathered, generate final answer
 */
import { Evaluation, StageResult, Intent, Finding } from '../types';
import { ModelRouter } from '../core/modelRouter';
/**
 * Available iteration strategies
 */
export type IterationStrategy = 'continue' | 'deep_dive' | 'pivot' | 'conclude';
/**
 * Context passed to the strategy planner
 */
export interface IterationContext {
    /** Session ID (optional, for telemetry/logging) */
    sessionId?: string;
    /** Trace ID (optional, for telemetry/logging) */
    traceId?: string;
    /** Current evaluation results */
    evaluation: Evaluation;
    /** Previous stage results */
    previousResults: StageResult[];
    /** Original user intent */
    intent: Intent;
    /** Current iteration count */
    iterationCount: number;
    /** Maximum allowed iterations */
    maxIterations: number;
    /** All findings collected so far */
    allFindings: Finding[];
}
/**
 * Strategy decision output
 */
export interface StrategyDecision {
    /** Chosen strategy */
    strategy: IterationStrategy;
    /** Confidence in this decision (0-1) */
    confidence: number;
    /** Reasoning for this decision */
    reasoning: string;
    /** For 'deep_dive': which area to focus on */
    focusArea?: string;
    /** For 'pivot': new direction to take */
    newDirection?: string;
    /** Additional skills to invoke */
    additionalSkills?: string[];
    /** Priority actions to take */
    priorityActions?: string[];
}
/**
 * Configuration for the strategy planner
 */
export interface StrategyPlannerConfig {
    /** Minimum quality score to consider concluding */
    minQualityForConclusion: number;
    /** Minimum completeness score to consider concluding */
    minCompletenessForConclusion: number;
    /** Threshold for deep dive (findings with high severity) */
    deepDiveThreshold: number;
    /** Whether to allow AI-driven decisions */
    useAIDecisions: boolean;
    /** 【P1 Fix】连续无改进的最大次数（超过后强制结束） */
    maxConsecutiveNoProgress: number;
    /** 【P1 Fix】最小分数改进阈值（低于此阈值视为无改进） */
    minScoreImprovementThreshold: number;
}
/**
 * Iteration Strategy Planner
 *
 * Makes intelligent decisions about how to proceed after each analysis iteration.
 * This replaces the simple "passed/not passed" binary logic with nuanced strategy selection.
 */
export declare class IterationStrategyPlanner {
    private config;
    private modelRouter;
    private scoreHistory;
    private consecutiveNoProgressCount;
    constructor(modelRouter: ModelRouter, config?: Partial<StrategyPlannerConfig>);
    /**
     * 【P1 Fix】重置进度跟踪（新会话开始时调用）
     */
    resetProgressTracking(): void;
    /**
     * Plan the next iteration strategy based on current context
     */
    planNextIteration(context: IterationContext): Promise<StrategyDecision>;
    /**
     * 【P1 Fix】检测无进展情况
     * 如果连续多次迭代评估分数无明显提升，则强制结束
     */
    private checkNoProgress;
    /**
     * Check if analysis should conclude based on hard thresholds
     */
    private shouldConclude;
    /**
     * Get AI-driven strategy decision
     */
    private getAIDecision;
    /**
     * Build prompt for AI decision making
     */
    private buildDecisionPrompt;
    /**
     * Validate and normalize AI decision
     */
    private validateDecision;
    /**
     * Get heuristic-based strategy decision (fallback)
     */
    private getHeuristicDecision;
    /**
     * Get recommended skills for a focus area
     */
    getSkillsForFocusArea(focusArea: string): string[];
    /**
     * Update configuration
     */
    updateConfig(config: Partial<StrategyPlannerConfig>): void;
}
/**
 * Factory function
 */
export declare function createIterationStrategyPlanner(modelRouter: ModelRouter, config?: Partial<StrategyPlannerConfig>): IterationStrategyPlanner;
export default IterationStrategyPlanner;
//# sourceMappingURL=iterationStrategyPlanner.d.ts.map