import { type Config, type ConfigStalenessReport, type ProviderTierType } from "./config.js"; import type { CircuitBreaker } from "./circuit-breaker.js"; import type { WriterHealth } from "./dashboard-contract.js"; export interface ProviderTelemetry { provider: string; displayName: string; kind: string; /** * The provider's declared tier (`providers..tierType`), else its preset's, else `null`. * * ⚠ `null`, never a guessed `"free"`. Until 2026-09-10 an undeclared tier fell back to `"free"`, * so `/telemetry` called the paid `deepseek` provider free while `assessCost` treated the same * provider as `unknown` — the closed-vocabulary fall-through to the STRONGER claim that CLAUDE.md * records. Unknown stays null. */ tierType: ProviderTierType | null; signupUrl?: string | undefined; hasKey: boolean; isHealthy: boolean | null; stabilityScore: number | null; /** Unique provider/model deployments; credential cells are intentionally deduplicated. */ observedTargets: number; lastStatus?: number | undefined; cooldownRemainingMs: number; } export interface TelemetryReport { timestamp: string; /** Version loaded by the running relay process; "unknown" only for an unversioned embed. */ version: string; activeProvidersCount: number; healthyProvidersCount: number; unmeasuredProvidersCount: number; freeProvidersCount: number; mixedProvidersCount: number; subscriptionProvidersCount: number; providers: ProviderTelemetry[]; routingTiers: Record; /** * The metering subsystem's writer health, from the store's `writerHealth()` accessor * (backlog item 19): when the store's last flush failed or the writer lease was * refused, this names the stop so "no spend since noon" cannot be mistaken for * "no traffic since noon". Null when no ledger is attached to the reporter (a bare * programmatic proxy): unknown stays null, never a fabricated state. */ accounting: WriterHealth | null; /** Does the config file on disk still match what this process loaded? See `configStaleness()` * in config.ts — the relay does not hot-reload, so this is how an operator (or the CLI's own * stderr notice) finds out an edit has not taken effect. */ config: ConfigStalenessReport; } /** Aggregate live telemetry and health status across all configured providers. */ export declare function getTelemetryReport(cfg: Config, cb: CircuitBreaker, now?: number, accounting?: WriterHealth | null, version?: string): TelemetryReport;