/** * Test helpers for asserting on AgentMetrics in agent tests. */ import type { Usage } from '../models/streaming.js'; import { AgentMetrics } from '../telemetry/meter.js'; /** * Options for building an AgentMetrics matcher. */ export interface LoopMetricsMatcher { /** * Expected number of agent loop cycles. */ cycleCount: number; /** * Expected tool names that were invoked. */ toolNames?: string[]; /** * Expected accumulated token usage. When provided, asserts exact values. * When omitted, asserts the shape with expect.any(Number). */ usage?: Usage; } /** * Creates an asymmetric matcher that validates AgentMetrics structure and values. * * @param options - Expected metric values * @returns An asymmetric matcher suitable for use in expect().toEqual() */ export declare function expectLoopMetrics(options: LoopMetricsMatcher): AgentMetrics; /** * Finds the latest data point value for a named metric from OTEL ResourceMetrics. * * Flattens the ResourceMetrics → ScopeMetrics → MetricData hierarchy and * returns the value of the last data point for the matching metric name. * For counters this is a number; for histograms it is an object with * sum, count, min, max, etc. * * @param resourceMetrics - Array of ResourceMetrics from an InMemoryMetricExporter * @param metricName - The metric descriptor name to search for * @returns The value of the last data point, or undefined if not found */ export declare function findMetricValue(resourceMetrics: { scopeMetrics: { metrics: { descriptor: { name: string; }; dataPoints: { value: unknown; }[]; }[]; }[]; }[], metricName: string): unknown; //# sourceMappingURL=metrics-helpers.d.ts.map