import type { UsageMessage } from "./usage.js"; export interface RuntimeSummary { status: "loading" | "ready" | "stale" | "unavailable"; /** Sum of one native response duration per turn in the viewed session's retained history. */ milliseconds?: number | undefined; /** Display-only projection; never becomes part of the native historical subtotal. */ estimatedMilliseconds?: number | undefined; } export interface PreparedRuntime { summary: RuntimeSummary; /** Only a response/continuation at the open tail can be projected while the host is running. */ turn?: { messageID: string; started: number; milliseconds: number; }; } /** Native session metadata from the existing session read; omitted metadata is unknown. */ export interface RuntimeTime { created: number; idle?: number; } /** * OpenCode 2.0.26's TUI turnDuration/inputIndex: completed assistant time minus * the first user/synthetic input after the previous idle marker, or the nearest * input in legacy histories with no idle markers. Native session metadata with * no previous idle identifies the first turn, even before its first marker. * With no input it falls back to the assistant's creation time. * Take only the final response in each turn: * intermediate footer durations overlap and must never be added separately. * No execution-log API, client clock, child history, or additional reads. */ export declare function summarizeRuntime(messages: readonly UsageMessage[], fork?: boolean, time?: RuntimeTime): RuntimeSummary; /** Scan history once per snapshot, keeping the current turn's overlapping subtotal separate. */ export declare function prepareRuntime(messages: readonly UsageMessage[], fork?: boolean, time?: RuntimeTime): PreparedRuntime; /** Replace, rather than add to, an already-counted footer in the same steered turn. */ export declare function projectRuntime(prepared: PreparedRuntime, now: number | undefined): RuntimeSummary;