/**
 * Model Routing Intelligence for UAP
 *
 * Routes tasks to the optimal model based on:
 * - Task classification and difficulty
 * - Model capability fingerprints (benchmarked data)
 * - Latency/accuracy/cost tradeoffs
 * - Fallback chains for resilience
 * - OPT 8: Persistent fingerprint data from SQLite
 *
 * Based on BENCHMARK_ANALYSIS.md and MODEL_BENCHMARK_RESULTS.md data.
 */
import Database from 'better-sqlite3';
export type ModelId = 'opus-4.6' | 'sonnet-4.6' | 'haiku' | 'qwen35-a3b' | 'gpt-5.4' | 'gpt-5.3-codex';
export interface CategoryStats {
    attempts: number;
    successes: number;
}
export interface ModelFingerprint {
    id: ModelId;
    strengths: string[];
    weaknesses: string[];
    avgLatencyMs: number;
    successRate: number;
    costPerTask: number;
    maxComplexity: 'easy' | 'medium' | 'hard';
    bestCategories: string[];
    categoryStats?: Record<string, CategoryStats>;
}
export interface RoutingDecision {
    primary: ModelId;
    fallback: ModelId[];
    reason: string;
    estimatedLatencyMs: number;
    estimatedSuccessRate: number;
    estimatedCost: number;
}
export interface RoutingConfig {
    preferLatency: boolean;
    preferAccuracy: boolean;
    maxCostPerTask: number;
    maxLatencyMs: number;
    availableModels: ModelId[];
}
export declare function closeAllPools(): void;
export declare function getFingerprintDb(): Database.Database;
/**
 * Failure handlers for model-specific known issues
 */
declare const FAILURE_HANDLERS: Record<string, {
    action: 'add_context' | 'reduce_context' | 'switch_model';
    context?: string;
    fallbackModel?: ModelId;
}>;
/**
 * Route a task to the best model
 */
export declare function routeTask(instruction: string, difficulty?: 'easy' | 'medium' | 'hard', config?: Partial<RoutingConfig>): RoutingDecision;
/**
 * Get failure handler for a model-specific error
 */
export declare function getFailureHandler(modelId: ModelId, errorType: string): (typeof FAILURE_HANDLERS)[string] | null;
/**
 * Get model fingerprint
 */
export declare function getModelFingerprint(modelId: ModelId): ModelFingerprint | null;
/**
 * Get all model fingerprints
 */
export declare function getAllModelFingerprints(): Record<ModelId, ModelFingerprint>;
/**
 * Update model fingerprint with new benchmark data
 */
export declare function updateModelFingerprint(modelId: ModelId, updates: Partial<Pick<ModelFingerprint, 'avgLatencyMs' | 'successRate' | 'costPerTask'>>): void;
/**
 * Record task outcome to update model fingerprints (feedback loop)
 * Call this after each task completes to improve future routing decisions
 * OPT 8: Now persists to SQLite for cross-session learning
 */
export declare function recordTaskOutcome(modelId: ModelId, success: boolean, latencyMs: number, taskCategory?: string): void;
/**
 * Get routing recommendation with explanation
 */
export declare function explainRouting(instruction: string, difficulty?: 'easy' | 'medium' | 'hard'): string;
/**
 * OPT 8: Close fingerprint database connection pool
 */
export declare function closeFingerprintDb(): void;
/**
 * OPT 8: Force reload fingerprints from database
 */
export declare function reloadFingerprints(): void;
export declare const ModelRouter: {
    routeTask: typeof routeTask;
    getFailureHandler: typeof getFailureHandler;
    getModelFingerprint: typeof getModelFingerprint;
    getAllModelFingerprints: typeof getAllModelFingerprints;
    updateModelFingerprint: typeof updateModelFingerprint;
    recordTaskOutcome: typeof recordTaskOutcome;
    explainRouting: typeof explainRouting;
    closeFingerprintDb: typeof closeFingerprintDb;
    reloadFingerprints: typeof reloadFingerprints;
};
export default ModelRouter;
//# sourceMappingURL=model-router.d.ts.map