import { EventEmitter } from "events";
export type TaskType = "search" | "planning" | "coding" | "review" | "debug" | "docs" | "chat" | "complex";
export interface ModelConfig {
    id: string;
    name: string;
    costPer1kInput: number;
    costPer1kOutput: number;
    contextWindow: number;
    speed: "fast" | "medium" | "slow";
    capabilities: TaskType[];
}
export interface ModelRouterConfig {
    defaultModel: string;
    taskModels: Record<TaskType, string>;
    costThreshold?: number;
    autoSwitch: boolean;
    preferSpeed: boolean;
    fallbackChain?: string[];
    enableFallback: boolean;
}
export interface ModelHealth {
    modelId: string;
    available: boolean;
    lastSuccess: Date | null;
    lastFailure: Date | null;
    consecutiveFailures: number;
    cooldownUntil: Date | null;
}
/**
 * Model Router - Dynamic model selection based on task type
 */
export declare class ModelRouter extends EventEmitter {
    private config;
    private configPath;
    private currentModel;
    private sessionCost;
    private switchHistory;
    private modelHealth;
    constructor(projectRoot?: string);
    /**
     * Initialize health tracking for all known models
     */
    private initializeModelHealth;
    private loadConfig;
    private saveConfig;
    /**
     * Get the current model
     */
    getCurrentModel(): string;
    /**
     * Set the current model manually
     */
    setCurrentModel(modelId: string): boolean;
    /**
     * Select the best model for a task type
     */
    selectModelForTask(taskType: TaskType): string;
    /**
     * Detect task type from input
     */
    detectTaskType(input: string): TaskType;
    /**
     * Auto-select model based on input
     */
    autoSelectModel(input: string): string;
    private findBestModelForTask;
    private getCheapestModel;
    private switchModel;
    /**
     * Record token usage and update cost
     */
    recordUsage(inputTokens: number, outputTokens: number): number;
    /**
     * Record successful API call for a model
     */
    recordSuccess(modelId?: string): void;
    /**
     * Record failed API call for a model
     */
    recordFailure(modelId?: string, error?: unknown): void;
    /**
     * Check if a model is available (not in cooldown)
     */
    isModelAvailable(modelId: string): boolean;
    /**
     * Get next available fallback model
     */
    getNextFallback(): string | null;
    /**
     * Switch to fallback model after failure
     */
    switchToFallback(error?: unknown): string | null;
    /**
     * Get health status for all models
     */
    getModelHealthStatus(): ModelHealth[];
    /**
     * Reset health for a specific model (force it out of cooldown)
     */
    resetModelHealth(modelId: string): void;
    /**
     * Reset all model health states
     */
    resetAllModelHealth(): void;
    /**
     * Get session cost
     */
    getSessionCost(): number;
    /**
     * Reset session cost
     */
    resetSessionCost(): void;
    /**
     * Update router configuration
     */
    updateConfig(updates: Partial<ModelRouterConfig>): void;
    /**
     * Get model info
     */
    getModelInfo(modelId?: string): ModelConfig | null;
    /**
     * Get all available models
     */
    getAvailableModels(): string[];
    /**
     * Format router status
     */
    formatStatus(): string;
    /**
     * Format available models
     */
    formatAvailableModels(): string;
}
export declare function getModelRouter(projectRoot?: string): ModelRouter;
