/** * ClassifierRouter — the single "classify → pick model + tools → run" engine. * * Given a request snapshot it (1) classifies difficulty (heuristic or a cheap * LLM), (2) selects the best provider/model from the host-declared base pool — * cheaper/faster for easy tiers, more capable for hard tiers — enriching pool * members with real cost/quality metadata from the model registry, and * (3) narrows the tool set via per-difficulty directives or classifier hints. * * Pure of provider imports (mirrors ModelPool): the LLM caller is injected. * The only data dependency is the read-only `ModelResolver` registry lookup, * used purely for metadata enrichment and never for provider construction. */ import type { ClassifierRouterConfig, ClassifierRouterDecision, ClassifierRouterDeps, ClassifierRouterInput } from "../types/index.js"; export declare class ClassifierRouter { private readonly config; private readonly deps; private readonly metaCache; constructor(config: ClassifierRouterConfig, deps?: ClassifierRouterDeps); /** * Classify the request and produce a combined model + tool decision, or * `null` when nothing should change. Never throws (fails open). */ route(input: ClassifierRouterInput): Promise; /** Run the configured strategy; LLM falls back to heuristic on failure. */ private classify; /** * Build LLM-facing model descriptors + an id→member map so the classifier can * pick a model directly. Works for ANY pool, registry-backed or not. */ private buildCandidates; /** * Resolve the ranked model list for a decision. Prefers the LLM's direct pick * (`selectedModelId`); otherwise falls back to difficulty-based tierMap / * metadata scoring. */ private selectModels; /** Candidate members for a difficulty: explicit tierMap or eligible pool. */ private candidatesFor; /** Drop members that cannot satisfy the required capabilities (lenient). */ private filterByCapabilities; /** Rank candidates best-first for the difficulty's strategy. */ private rank; /** Tool narrowing: per-difficulty directive, then classifier hints. */ private selectTools; /** * Resolve cost/quality/capabilities for a member. Declared values win; * gaps are filled from the model registry (by model name/alias) when known. * Results are cached per (provider/model) for the router's lifetime. */ private metaFor; }