import { ProviderHealthManager } from './health-manager.js';
import { ProviderRegistry } from './provider-registry.js';
import { RouteLoadBalancer } from './load-balancer.js';
import { RoutingClassifier } from './classifier.js';
import { ContextAdvisor } from './context-advisor.js';
import type { ProcessedRequest, StandardizedRequest } from '../../conversion/hub/types/standardized.js';
import { type RoutingPools, type RoutingDecision, type RoutingDiagnostics, type StopMessageStateSnapshot, type PreCommandStateSnapshot, type RoutePoolTier, type RouterMetadataInput, type RoutingFeatures, type VirtualRouterConfig, type VirtualRouterContextRoutingConfig, type TargetMetadata, type ProviderFailureEvent, type ProviderErrorEvent, type ProviderSuccessEvent, type VirtualRouterHealthStore } from './types.js';
import type { RoutingInstructionState } from './routing-instructions.js';
import type { ProviderQuotaView } from './types.js';
import type { RoutingInstructionStateStoreLike } from './engine/routing-state/store.js';
import { RouteAnalytics } from './engine/route-analytics.js';
import { StickySessionManager } from './engine/sticky-session-manager.js';
import { CooldownManager } from './engine/cooldown-manager.js';
import { getStatus as getStatusImpl } from './engine-legacy/state-accessors.js';
export declare class VirtualRouterEngine {
    routing: RoutingPools;
    readonly providerRegistry: ProviderRegistry;
    readonly healthManager: ProviderHealthManager;
    loadBalancer: RouteLoadBalancer;
    classifier: RoutingClassifier;
    readonly contextAdvisor: ContextAdvisor;
    contextRouting: VirtualRouterContextRoutingConfig | undefined;
    readonly routeAnalytics: RouteAnalytics;
    stickySessionManager: StickySessionManager;
    cooldownManager: CooldownManager;
    antigravityLeasePersistence: {
        loadedOnce: boolean;
        loadedMtimeMs: number | null;
        flushTimer: ReturnType<typeof setTimeout> | null;
    };
    readonly debug: Console;
    healthConfig: VirtualRouterConfig['health'] | null;
    readonly statsCenter: import("../../index.js").StatsCenter;
    webSearchForce: boolean;
    healthStore?: VirtualRouterHealthStore;
    routingStateStore: RoutingInstructionStateStoreLike;
    routingInstructionState: Map<string, RoutingInstructionState>;
    quotaView?: ProviderQuotaView;
    /**
     * Backward-compatible test/debug surface used by existing regression scripts.
     * Keep this as a read-only view over StickySessionManager storage.
     */
    get antigravitySessionAliasStore(): Map<string, string>;
    constructor(deps?: {
        healthStore?: VirtualRouterHealthStore;
        routingStateStore?: RoutingInstructionStateStoreLike;
        quotaView?: ProviderQuotaView;
    });
    updateDeps(deps: {
        healthStore?: VirtualRouterHealthStore | null;
        routingStateStore?: RoutingInstructionStateStoreLike | null;
        quotaView?: ProviderQuotaView | null;
    }): void;
    initialize(config: VirtualRouterConfig): void;
    route(request: StandardizedRequest | ProcessedRequest, metadata: RouterMetadataInput): {
        target: TargetMetadata;
        decision: RoutingDecision;
        diagnostics: RoutingDiagnostics;
    };
    getStopMessageState(metadata: RouterMetadataInput): StopMessageStateSnapshot | null;
    getPreCommandState(metadata: RouterMetadataInput): PreCommandStateSnapshot | null;
    handleProviderFailure(event: ProviderFailureEvent): void;
    handleProviderError(event: ProviderErrorEvent): void;
    handleProviderSuccess(event: ProviderSuccessEvent): void;
    getStatus(): ReturnType<typeof getStatusImpl>;
    normalizeRouteAlias(routeName: string | undefined): string;
    buildRouteCandidates(requestedRoute: string, classificationCandidates: string[] | undefined, features: RoutingFeatures): string[];
    reorderForInlineVision(routeNames: string[]): string[];
    reorderForPreferredModel(routeNames: string[], modelId: string): string[];
    routeSupportsModel(routeName: string, modelId: string): boolean;
    routeSupportsInlineVision(routeName: string): boolean;
    sortByPriority(routeNames: string[]): string[];
    routeWeight(routeName: string): number;
    routeHasForceFlag(routeName: string): boolean;
    routeHasTargets(pools?: RoutePoolTier[]): boolean;
    hasPrimaryPool(pools?: RoutePoolTier[]): boolean;
    sortRoutePools(pools?: RoutePoolTier[]): RoutePoolTier[];
    flattenPoolTargets(pools?: RoutePoolTier[]): string[];
    markProviderCooldown(providerKey: string, cooldownMs: number | undefined): void;
    clearProviderCooldown(providerKey: string): void;
    isProviderCoolingDown(providerKey: string): boolean;
    getProviderCooldownRemainingMs(providerKey: string): number;
    restoreHealthFromStore(): void;
    buildHealthSnapshot(): import("./types.js").VirtualRouterHealthSnapshot;
    persistHealthSnapshot(): void;
    parseDirectProviderModel(model: string | undefined): {
        providerId: string;
        modelId: string;
    } | null;
    shouldFallbackDirectModelForMedia(direct: {
        providerId: string;
        modelId: string;
    }, features: RoutingFeatures): boolean;
    selectProvider(requestedRoute: string, metadata: RouterMetadataInput, classification: any, features: RoutingFeatures, routingState?: RoutingInstructionState): {
        providerKey: string;
        routeUsed: string;
        pool: string[];
        poolId?: string;
    };
    selectFromCandidates(routes: string[], metadata: RouterMetadataInput, classification: any, features: RoutingFeatures, state: RoutingInstructionState, requiredProviderKeys?: Set<string>, allowAliasRotation?: boolean): {
        providerKey: string;
        routeUsed: string;
        pool: string[];
        poolId?: string;
    };
    selectFromStickyPool(stickyKeySet: Set<string>, metadata: RouterMetadataInput, features: RoutingFeatures, state: RoutingInstructionState, allowAliasRotation?: boolean): {
        providerKey: string;
        routeUsed: string;
        pool: string[];
        poolId?: string;
    } | null;
    extractExcludedProviderKeySet(metadata: RouterMetadataInput | undefined): Set<string>;
    resolveSelectionPenalty(providerKey: string): number | undefined;
    resolveInstructionProcessModeForSelection(providerKey: string, routingState: RoutingInstructionState): 'chat' | 'passthrough' | undefined;
    resolveInstructionTarget(target: NonNullable<RoutingInstructionState['forcedTarget']>): {
        mode: 'exact' | 'filter';
        keys: string[];
    } | null;
    buildStickyRouteCandidatesFromFiltered(filteredCandidates: string[], stickyKeySet: Set<string>): string[];
    filterCandidatesByRoutingState(routes: string[], state: RoutingInstructionState): string[];
    resolveStickyKey(metadata: RouterMetadataInput): string | undefined;
    resolveSessionScope(metadata: RouterMetadataInput): string | undefined;
}
