/**
 * useTokenCounter Hook
 * Tracks token usage during streaming with live estimates
 *
 * Accumulation strategy for multi-step turns:
 * - lastInputTokens: Input tokens from the most recent LLM call (not summed to avoid double-counting)
 * - cumulativeOutputTokens: Sum of output tokens across all LLM calls in the turn
 * - currentSegmentEstimate: Estimated tokens for current streaming segment
 * - Display = lastInput + cumulativeOutput + currentEstimate
 *
 * This approach avoids double-counting shared context (system prompt, history) across
 * multiple LLM calls in a single turn while accurately capturing output generation.
 *
 * For queued messages: Tokens continue accumulating (same turn)
 * Reset only when isActive transitions false→true (new turn)
 */
import type { TuiAgentBackend } from '../agent-backend.js';
export interface TokenCounterOptions {
    /** DextoAgent instance for event bus access */
    agent: TuiAgentBackend;
    /** Whether counting is active (should only run during processing) */
    isActive: boolean;
}
export interface TokenCounterResult {
    /** Total actual tokens (lastInput + cumulativeOutput) */
    totalActualTokens: number;
    /** Estimated tokens for current streaming segment */
    currentSegmentEstimate: number;
    /** Combined display count (actual + current estimate) */
    displayCount: number;
    /** Whether the display includes an estimate component */
    includesEstimate: boolean;
    /** Formatted display string (e.g., "~125 tokens" or "125 tokens") */
    formatted: string;
}
/**
 * Hook that tracks token usage during LLM streaming
 *
 * Tracks tokens across multi-step turns (text → tool → text → tool)
 * using: lastInputTokens + cumulativeOutputTokens to avoid double-counting.
 *
 * @param options - Configuration options
 * @returns Token counts (actual + current segment estimate)
 */
export declare function useTokenCounter({ agent, isActive }: TokenCounterOptions): TokenCounterResult;
//# sourceMappingURL=useTokenCounter.d.ts.map