/**
 * Tool-use metrics — derived purely from trace data.
 *
 * No scoring assumptions: consumers supply optional ground-truth tool
 * selections per turn + optional "information used downstream" signals.
 * Without those, we still compute descriptive metrics (error rate,
 * retry rate, duplicate-call rate) that are useful on their own.
 */
import type { Span } from './trace/schema';
import type { TraceStore } from './trace/store';
export interface ToolUseMetrics {
    runId: string;
    totalCalls: number;
    byTool: Record<string, ToolStats>;
    errorRate: number;
    /** Ratio of calls with identical (toolName, argHash) already seen earlier in the same run. */
    duplicateRate: number;
    /** Ratio of error calls followed by ≥1 retry on same tool. */
    retryRate: number;
    /** Optional: of the calls agent made, fraction the evaluator marked as "correct selection". */
    selectionAccuracy?: number;
}
export interface ToolStats {
    calls: number;
    errors: number;
    avgLatencyMs: number;
    duplicates: number;
}
export interface ToolUseOptions {
    /** Map of spanId → whether the evaluator judged the tool selection correct. Optional. */
    selectionLabels?: Record<string, boolean>;
}
export declare function computeToolUseMetrics(store: TraceStore, runId: string, options?: ToolUseOptions): Promise<ToolUseMetrics>;
export type { Span };
//# sourceMappingURL=tool-use-metrics.d.ts.map