/** * Model router types for intelligent model selection */ type ComplexityLevel = 'easy' | 'medium' | 'hard' | 'needs_info'; type RouterMode = 'balanced' | 'aggressive'; type Provider = 'openai' | 'anthropic' | 'gemini'; interface RouterConfig { /** Morph API key (defaults to MORPH_API_KEY env var) */ apiKey?: string; /** Router API URL (defaults to https://api.morphllm.com) */ apiUrl?: string; /** Request timeout in milliseconds (default: 10000) */ timeout?: number; /** Enable debug logging */ debug?: boolean; /** Retry configuration */ retryConfig?: { maxRetries?: number; initialDelay?: number; maxDelay?: number; backoffMultiplier?: number; }; } interface RouterInput { /** User input or task description */ input: string; /** Routing mode: balanced (cheaper models) or aggressive (more capable models) */ mode?: RouterMode; } interface RouterResult { /** Selected model name */ model: string; } interface RawRouterResult { /** Raw difficulty classification */ difficulty: ComplexityLevel; } /** Classification axes returned by `/v1/router/classify`. */ type ClassifyClass = 'difficulty' | 'ambiguity' | 'domain'; type AmbiguityLevel = 'low' | 'med' | 'high'; type DomainLabel = 'general' | 'summary' | 'coding' | 'design' | 'data'; interface ClassifyInput { /** User input or task description to classify. */ input: string; /** Which axes to classify (defaults to all three). */ classes?: ClassifyClass[]; } /** A single classification axis result. */ interface Classification { class_id: number; label: L; confidence: number; meets_threshold: boolean; } /** Response from `/v1/router/classify`. Axes are present only when requested. */ interface ClassifyResult { difficulty?: Classification; ambiguity?: Classification; domain?: Classification; } export type { AmbiguityLevel, Classification, ClassifyClass, ClassifyInput, ClassifyResult, ComplexityLevel, DomainLabel, Provider, RawRouterResult, RouterConfig, RouterInput, RouterMode, RouterResult };