/** Drop the cache. Tests that swap the global provider need this. */ export declare function resetRuntimeMetrics(): void; export interface TokenUsageSample { readonly promptTokens: number; readonly completionTokens: number; /** Prompt tokens served from the provider's cache. */ readonly cachedTokens?: number; /** Prompt tokens written into the provider's cache. */ readonly cacheWriteTokens?: number; } /** * Record what a turn cost, split by token type. * * Cache reads and writes are recorded as their own types rather than * folded into `input`. They bill differently — a read is a fraction of the * input rate and a write is a premium on it — so a total that hides them * cannot explain a bill, which is the main thing anyone asks a token * metric. */ export declare function recordTokenUsage(model: string, usage: TokenUsageSample): void; /** * Record a tool call. * * `errorType` carries WHY a call failed rather than only that it did. A * flat success rate cannot separate a tool that is broken from one whose * input the model keeps getting wrong, and those need different fixes. */ export declare function recordToolCall(toolName: string, success: boolean, errorType?: string, durationMs?: number): void; /** * Record how long the first content delta took to arrive. * * Recorded at the first delta rather than at the end of the request, * because the two are not the same measurement and only this one tracks * what a person waiting actually experiences. */ export declare function recordTimeToFirstToken(model: string, durationMs: number): void; /** Record how long a whole turn took, keyed by how it settled. */ export declare function recordTurnDuration(status: string, durationMs: number): void; /** Record how long one model request took. */ export declare function recordModelDuration(model: string, durationMs: number, errorType?: string): void; //# sourceMappingURL=metrics.d.ts.map