import { type AdapterWaitKindV3 } from "./capabilities.js"; import type { ReadLedgerV3Result } from "./reader.js"; import type { RuntimeTelemetryCapabilitiesV3 } from "./runtime-telemetry-capabilities.js"; export declare const EVENT_V3_LATENCY_PROJECTION_VERSION: "event-v3-latency-v3"; export type LatencyMetricV3 = { state: "observed"; value_ms: number; } | { state: "unknown"; known_ms: number; upper_bound_ms?: number; reasons: string[]; }; export interface ToolLatencyV3 { namespace: string; name: string; count: number; duration_ms: LatencyMetricV3; } export type ContextCoverageStateV3 = "observed" | "partial" | "unsupported" | "expected_but_missing"; export interface ContextCoverageV3 { state: ContextCoverageStateV3; event_id: string | null; reason: string | null; } export interface ResponseLatencyV3 { /** Turn start to first tool request, or terminal response for an attested no-tool turn. */ agent_action_ms: LatencyMetricV3; /** Turn start to first tool request; unknown with `no_tool_request` for no-tool turns. */ first_tool_request_ms: LatencyMetricV3; /** Last complete tool terminal to the turn terminal. */ post_tool_response_ms: LatencyMetricV3; /** Turn start to terminal response, only when an attested turn used no tools. */ no_tool_terminal_response_ms: LatencyMetricV3; method: "canonical_event_timestamps_v1"; } export type WaitKindCompletenessV3 = "complete" | "lower_bound" | "unknown" | "unsupported"; export interface WaitKindCoverageV3 { kind: AdapterWaitKindV3; started_count: number; ended_count: number; open_count: number; duration_ms: LatencyMetricV3; completeness: WaitKindCompletenessV3; reason: string | null; } export interface TurnLatencyV3 { generation_id: string; turn_id: string; terminal_event_id: string; outcome: string; wall_ms: LatencyMetricV3; tool_ms: LatencyMetricV3; tool_bound_coverage_percent: number | null; tool_ranking_eligible: boolean; command_ms: LatencyMetricV3; command_exclusive_ms: LatencyMetricV3; wait_ms: LatencyMetricV3; occupied_ms: LatencyMetricV3; inference_ms: LatencyMetricV3; response_latency: ResponseLatencyV3; harness_ms: LatencyMetricV3; slowest_hook: string | null; slowest_hook_ms: number | null; residual_ms: LatencyMetricV3; over_attributed_ms: number; context_percent: number | null; context_coverage: ContextCoverageV3; telemetry_capabilities: RuntimeTelemetryCapabilitiesV3 | null; /** Equal keys are required before a report compares telemetry-backed values. */ telemetry_evidence_key: `sha256:${string}` | null; wait_coverage_by_kind: Record; span_counts: { tool: number; command: number; wait: number; }; tool_breakdown: ToolLatencyV3[]; } export type LatencyProjectionDiagnosticCodeV3 = "duplicate_turn_terminal" | "tool_channel_unattested" | "span_outside_turn" | "recovery_bound_exceeds_turn_wall" | "over_attributed"; export interface LatencyProjectionDiagnosticV3 { code: LatencyProjectionDiagnosticCodeV3; event_id: string; } export interface LatencyProjectionV3 { projection_version: typeof EVENT_V3_LATENCY_PROJECTION_VERSION; turns: TurnLatencyV3[]; diagnostics: LatencyProjectionDiagnosticV3[]; } export declare function projectLatencyV3(read: ReadLedgerV3Result): LatencyProjectionV3; /** Reports may compare a telemetry-backed channel only inside one evidence key. */ export declare function runtimeTelemetryEvidenceKeyV3(telemetry: RuntimeTelemetryCapabilitiesV3): `sha256:${string}`; //# sourceMappingURL=latency.d.ts.map