import type { EventBus } from '../kernel/events.js'; import type { ModelsRegistry, ResolvedModel } from '../types/models-registry.js'; import type { Usage } from '../types/provider.js'; import type { CacheStats, TokenCounter } from '../types/token-counter.js'; /** * Token counter that derives pricing from the ModelsRegistry instead of a * hardcoded table. If a model is unknown to the registry (or the registry is * unavailable) the counter still tracks token totals but reports zero cost. */ export declare class DefaultTokenCounter implements TokenCounter { private input; private output; private cacheRead; private cacheWrite; private costInput; private costOutput; private cacheSaved; private readonly registry?; private readonly providerId?; private readonly events?; private sessionId?; private priceCache; /** Most recently accounted request's tokens. Used for per-request context pressure. */ private lastInput; private lastCacheRead; private lastCacheWrite; constructor(opts?: { registry?: ModelsRegistry | undefined; providerId?: string | (() => string | undefined) | undefined; events?: EventBus | undefined; sessionId?: string | (() => string | undefined) | undefined; }); setSessionId(sessionId: string | (() => string | undefined) | undefined): void; account(usage: Usage, model?: string, providerId?: string | undefined): void; /** Synchronous variant for code paths that have already resolved the model. */ accountWithModel(usage: Usage, resolved: ResolvedModel): void; total(): Usage; currentRequestTokens(): { input: number; cacheRead: number; cacheWrite: number; }; setCurrentRequestTokens(input: number, cacheRead?: number, cacheWrite?: number): void; estimateCost(): { input: number; output: number; total: number; currency: 'USD'; }; cacheStats(): CacheStats; /** Invalidate cached prices so the next account() call fetches fresh data. */ invalidateCache(): void; private emitAccounted; private currentSessionId; private currentProviderId; reset(): void; private applyPrice; } //# sourceMappingURL=token-counter.d.ts.map