import type { AgentUsage } from "@automatalabs/shared-types"; import type { Cost, Usage } from "@agentclientprotocol/sdk"; export interface UsageBaseline { costAmount: number; contextUsedTokens: number; } export declare class UsageAccumulator { private promptUsage; private costAmount; private contextUsedTokens; private contextSizeTokens; /** Record the authoritative per-turn token usage from a PromptResponse. */ recordPromptUsage(usage: Usage | null | undefined): void; /** Record the latest cumulative dollar cost carried by a usage_update notification. */ recordCost(cost: Cost | null | undefined): void; /** * Record the token counts carried by a usage_update notification: `used` (tokens * currently in context) and `size` (context window). These feed `total` as a fallback * for backends that report tokens via usage_update but never via PromptResponse.usage, * so AgentUsage.total is non-zero whenever the backend reported ANY token count. */ recordContextTokens(used: number | null | undefined, size?: number | null | undefined): void; /** Snapshot the cumulative/gauge channels before a continuation turn begins. */ baseline(): UsageBaseline; /** Report only usage observed after a reopened session's replay/setup boundary. */ delta(baseline: UsageBaseline): AgentUsage; toAgentUsage(): AgentUsage; } //# sourceMappingURL=usage.d.ts.map