/**
 * Drill-Down Resolver
 *
 * Resolves drill-down queries to FocusIntervals using a multi-source resolution pipeline.
 * The goal is to avoid re-running global discovery when we already have the target entity.
 *
 * Resolution Priority:
 * 1. Explicit structured input (UI click payload / ReferencedEntity.value / extractedParams)
 * 2. Session cache (EntityStore) built from prior results
 * 3. Findings details (historical, but often incomplete)
 * 4. Lightweight trace SQL enrichment (1 query per entity)
 * 5. Return null - caller should ask user or run overview first
 *
 * This module is called by the orchestrator when:
 * - intent.followUpType === 'drill_down'
 * - frame_id / session_id / startup_id is present in the query
 */
import type { Intent } from '../types';
import type { EnhancedSessionContext } from '../context/enhancedSessionContext';
import type { FollowUpResolution } from './followUpHandler';
import type { FocusInterval } from '../strategies/types';
import { DrillDownEntityType } from '../config/drillDownRegistry';
export type ResolutionSource = 'explicit' | 'cache' | 'finding' | 'enrichment' | 'fallback';
/**
 * Trace of how an entity was resolved - for observability
 */
export interface DrillDownResolutionTrace {
    entityType: DrillDownEntityType;
    entityId: string;
    used: ResolutionSource[];
    enriched: boolean;
    reason?: string;
    enrichmentQuery?: string;
}
/**
 * Result of drill-down resolution
 */
export interface DrillDownResolved {
    intervals: FocusInterval[];
    traces: DrillDownResolutionTrace[];
}
/**
 * TraceProcessorService interface (duck-typed to avoid circular imports)
 */
interface TraceProcessorServiceLike {
    query?: (traceId: string, sql: string) => Promise<{
        columns: string[];
        rows: any[][];
    }>;
    executeQuery?: (...args: any[]) => Promise<{
        columns: string[];
        rows: any[][];
    }>;
}
/**
 * Resolve drill-down targets to FocusIntervals.
 *
 * @param intent - Understood user intent with referencedEntities
 * @param followUp - FollowUpResolution from followUpHandler
 * @param sessionContext - Session context with EntityStore
 * @param traceProcessorService - For enrichment queries (optional)
 * @param traceId - Current trace ID for enrichment
 * @returns Resolved intervals and traces, or null if resolution failed
 */
export declare function resolveDrillDown(intent: Intent, followUp: FollowUpResolution, sessionContext: EnhancedSessionContext, traceProcessorService?: TraceProcessorServiceLike, traceId?: string): Promise<DrillDownResolved | null>;
export {};
//# sourceMappingURL=drillDownResolver.d.ts.map