/**
 * LLM-Driven Strategy Selector
 *
 * Replaces hardcoded keyword matching with semantic understanding via LLM.
 * This enables:
 * 1. Understanding variant expressions ("列表滚动很卡" vs "RecyclerView 有问题")
 * 2. Contextual strategy selection based on trace metadata
 * 3. Confidence-based ranking of strategy candidates
 * 4. Graceful fallback when no strategy matches
 *
 * Design principles:
 * - LLM provides semantic understanding, not execution
 * - Strategy descriptions are injected into the prompt
 * - Trace context (available tables, time range) aids selection
 * - Falls back to hypothesis-driven analysis when confidence is low
 */
import { ModelRouter } from './modelRouter';
import type { StagedAnalysisStrategy } from '../strategies/types';
import type { Intent } from '../types';
/**
 * Trace context provided to help LLM understand what data is available
 */
export interface TraceContext {
    /** Available Perfetto tables in this trace */
    availableTables: string[];
    /** Trace time range in nanoseconds */
    timeRange?: {
        start: string;
        end: string;
    };
    /** Process names found in trace */
    processes: string[];
    /** Whether the trace contains frame/scrolling data */
    hasFrameData: boolean;
    /** Whether the trace contains CPU scheduling data */
    hasCpuData: boolean;
    /** Whether the trace contains memory/GC data */
    hasMemoryData: boolean;
    /** Whether the trace contains Binder/IPC data */
    hasBinderData: boolean;
}
/**
 * Strategy candidate with confidence score
 */
export interface StrategyCandidate {
    /** Strategy identifier */
    strategyId: string;
    /** Confidence score 0-1 */
    confidence: number;
    /** LLM's reasoning for this selection */
    reasoning: string;
    /** Required capabilities (tables/data) for this strategy */
    requiredCapabilities: string[];
}
/**
 * Result of LLM strategy selection
 */
export interface StrategySelectionResult {
    /** Top candidate (null if no good match) */
    selected: StrategyCandidate | null;
    /** All evaluated candidates, sorted by confidence */
    candidates: StrategyCandidate[];
    /** Whether to fall back to hypothesis-driven analysis */
    shouldFallback: boolean;
    /** Reason for fallback (if applicable) */
    fallbackReason?: string;
}
/**
 * Strategy definition for LLM prompt injection
 */
export interface StrategyDefinition {
    id: string;
    name: string;
    description: string;
    triggerPatterns: string[];
    requiredCapabilities: string[];
}
/**
 * LLM-driven strategy selector that uses semantic understanding
 * to match user queries to analysis strategies.
 */
export declare class LLMStrategySelector {
    private modelRouter;
    constructor(modelRouter: ModelRouter);
    /**
     * Select the best strategy for a given query using LLM semantic understanding.
     *
     * @param query - User's natural language query
     * @param intent - Parsed intent from intent understanding phase
     * @param availableStrategies - List of registered strategies
     * @param traceContext - Metadata about the loaded trace
     * @returns Selection result with ranked candidates
     */
    selectStrategy(query: string, intent: Intent, availableStrategies: StrategyDefinition[], traceContext: TraceContext): Promise<StrategySelectionResult>;
    /**
     * Build the LLM prompt for strategy selection.
     */
    private buildSelectionPrompt;
    /**
     * Process LLM response into structured result.
     */
    private processLLMResponse;
    /**
     * Get default fallback reason based on candidate state.
     */
    private getDefaultFallbackReason;
}
/**
 * Convert StagedAnalysisStrategy to StrategyDefinition for LLM prompt.
 */
export declare function strategyToDefinition(strategy: StagedAnalysisStrategy): StrategyDefinition;
/**
 * Detect trace context by querying available tables.
 */
export declare function detectTraceContext(traceProcessorService: any, traceId: string): Promise<TraceContext>;
/**
 * Create an LLM strategy selector instance.
 */
export declare function createLLMStrategySelector(modelRouter: ModelRouter): LLMStrategySelector;
export default LLMStrategySelector;
//# sourceMappingURL=strategySelector.d.ts.map