import { loadTierData } from "./tier-data.js"; export { loadTierData }; import type { Config } from "./config.js"; import type { ModelCatalog } from "./catalog.js"; import type { CredentialSource, CredentialState } from "./authEnv.js"; import type { PingLoop, ModelHealthSummary } from "./ping/cadence.js"; export interface CapabilityScore { bfcl_overall: number | null; bfcl_multi_turn: number | null; bfcl_irrelevance: number | null; arena_rating: number | null; arena_rank: number | null; composite_rank: number | null; /** Leaderboard row these scores came from, and how confidently. A `fuzzy` match is a DIFFERENT * model whose name contains this one's (glm-5.2 → glm-5.2-max), so the scores are indicative, * not this model's. Without this the substitution is invisible. */ matched_name: string | null; match: "exact" | "fuzzy" | null; } interface RegistryModel { id: string; /** Best-effort leaderboard match (null when no confident match — matching is fuzzy). */ capability: CapabilityScore | null; health?: ModelHealthSummary; } export interface RegistryCredential { credentialId: string; label: string; authEnv: string | null; enabled: boolean; models: readonly string[] | null; state: CredentialState; source: CredentialSource | null; has_key: boolean; } interface RegistryProvider { base: string; kind: "openai" | "anthropic"; authEnv?: string; /** Whether any enabled provider credential slot can make an attempt. */ has_key: boolean; /** openai providers only: did the live /models catalog return anything (reachable + authorized)? */ reachable: boolean | null; models: RegistryModel[]; /** Credential identity and resolution diagnostics; values are never exposed. */ credentials: RegistryCredential[]; } export interface RegistryView { generated_at: string; /** How to address a backend: namespace a request model "provider/model" (a dispatcher names the * exact model), or let routing map by Claude tier / default (dumb-client convenience). */ routing: { default: string | string[]; tiers: Record; }; providers: Record; capability_source: { present: boolean; synced_at?: string; note: string; /** Full raw leaderboard dataset, so a consumer can run a finer join than the best-effort one above. */ models?: Array>; }; } export { type TierData } from "./tier-data.js"; /** * Fuzzy, conservative join of a backend model id to a leaderboard record. Leaderboard * names ("GLM-4.6 (FC)") and API ids ("z-ai/glm-5.2") don't share a key, so this matches * the API id's last path segment against a normalized leaderboard name — preferring a * miss (null capability) over a wrong score. Consumers wanting a better join use the full * dataset in capability_source.models. */ export declare function joinCapability(modelId: string, byNorm: Array<{ norm: string; rec: Record; }>, exactByNorm?: ReadonlyMap>): CapabilityScore | null; /** Build the discovery view: providers × live models (best-effort capability) + routing + raw scores. */ export declare function buildRegistry(cfg: Config, catalog: ModelCatalog, opts?: { now?: string; pingLoop?: PingLoop; }): Promise;