/**
 * Trace Statistics Utilities
 *
 * Shared helper functions for calculating trace statistics.
 * Used by TraceFlowView.
 */
import { CategorizedSpan, SpanCategory } from '../../types/index.js';
/**
 * Category statistics for trace analysis
 */
export interface CategoryStats {
    category: SpanCategory;
    count: number;
    totalDuration: number;
    percentage: number;
}
/**
 * Tool usage information
 */
export interface ToolInfo {
    name: string;
    count: number;
    totalDuration: number;
}
/**
 * Extract tool name from a span
 */
export declare function extractToolName(span: CategorizedSpan): string | null;
/**
 * Flatten span tree and collect all spans
 */
export declare function flattenSpans(spans: CategorizedSpan[]): CategorizedSpan[];
/**
 * Calculate category statistics from spans
 *
 * Percentages are calculated relative to the sum of all category durations,
 * not trace duration, because spans can overlap (LLM calls inside AGENT spans).
 * This ensures percentages naturally sum to 100%.
 */
export declare function calculateCategoryStats(spans: CategorizedSpan[], _totalDuration: number): CategoryStats[];
/**
 * Extract unique tools with usage stats
 */
export declare function extractToolStats(spans: CategorizedSpan[]): ToolInfo[];
//# sourceMappingURL=traceStats.d.ts.map