/** * OpenKernel — Capability Router * * Workers never request "Gemini" — they request capabilities + preferences * ("coding, reasoning >90, context >128K"). The router decides the best * model + provider. * * Routing score (spec: "Intelligent Router"): * capability + benchmark + reliability + speed + available quota * + context + policy weight − cost * * Every policy auto-routes across all healthy providers. The single exception * is the `offline` mode, which is LOCKED to local providers. */ import type { ProviderInfo, ProviderModel, RoutingDecision, RoutingRequest } from './types.js'; import type { Logger } from './types.js'; export declare class CapabilityRouter { private logger; constructor(logger: Logger); route(request: RoutingRequest): Promise; rank(request: RoutingRequest): Array; /** Public benchmark estimate for a model (0–100) — used by recovery/escalation. */ benchmarkFor(model: ProviderModel): number; /** * Pick a strictly MORE capable model than the current one for the same * capabilities — the verification-failure escalation ladder. Ranks candidates * whose benchmark exceeds the current model's, preferring the highest * benchmark (tie-broken by overall score). Returns null at the ceiling. */ escalate(request: RoutingRequest, currentProviderId?: string, currentModelId?: string): (RoutingDecision & { benchmarkScore: number; }) | null; private scoreCandidates; private capabilityScore; /** * Reasoning/quality contribution in [0,1]. Honors the worker preference * "reasoning >= N": a model that clears the bar gets full credit for its * benchmark; one below the bar is proportionally discounted. */ private benchmarkScore; /** * Estimate a 0–100 reasoning/quality benchmark for a model. Uses an explicit * `benchmarkScore` when the provider supplies one; otherwise infers it from * parameter size, model family, and context length. */ private estimateBenchmark; private parseParamSize; private contextScore; private costScore; private costPreferenceMultiplier; private buildReason; }