/**
 * Token tracking plugin for input/output tokens.
 *
 * Accumulates per-turn token usage (input_tokens + cache_read_input_tokens
 * + cache_creation_input_tokens = total input; output_tokens = output).
 * Respects the dedup flag from TurnCounterPlugin. Cache breakdown (r/5m/1h)
 * is tracked by CacheTrackerPlugin for reporting and pricing.
 */
import type { Middleware, MiddlewareContext, MiddlewareStore, SDKMessage, SDKUsage } from '../types';
export interface TokenData {
    phaseInput: number;
    phaseOutput: number;
    totalInput: number;
    totalOutput: number;
    /** The raw usage object from the last non-duplicate assistant message */
    lastUsage: SDKUsage | null;
    /** Per-phase token snapshots */
    phaseSnapshots: Array<{
        phase: string;
        inputTokens: number;
        outputTokens: number;
        /** Number of turns in this phase that had usage (SDK may not report all) */
        messagesWithUsage: number;
    }>;
}
export declare class TokenTrackerPlugin implements Middleware {
    readonly name = "tokens";
    private phaseInput;
    private phaseOutput;
    private totalInput;
    private totalOutput;
    private lastUsage;
    private phaseSnapshots;
    private currentPhase;
    private phaseMessagesWithUsage;
    onMessage(message: SDKMessage, ctx: MiddlewareContext, store: MiddlewareStore): void;
    onPhaseTransition(fromPhase: string, toPhase: string, _ctx: MiddlewareContext, store: MiddlewareStore): void;
    onFinalize(resultMessage: SDKMessage, _totalDurationMs: number, _ctx: MiddlewareContext, store: MiddlewareStore): void;
    private getData;
}
