import type { RunRow } from "../rows.js"; export type SortKey = "date" | "score" | "cost" | "time" | "agent" | "suite"; export type GroupKey = "none" | "agent" | "suite"; export type GroupAggregates = { /** Latest non-null start among members. */ date: number | null; /** Mean over graded members only. */ score: number | null; /** Sum over members with known cost. */ cost: number | null; /** Sum over members with known wall time — "total machine time * spent", deliberately NOT the elapsed envelope a single run's time * column shows: group members usually span days, so an envelope * would mostly measure the gaps between runs. */ time: number | null; agent: string; suite: string; }; export type GroupHeaderRow = { kind: "groupHeader"; key: string; group: "agent" | "suite"; label: string; memberKeys: string[]; count: number; aggregates: GroupAggregates; expanded: boolean; }; export type DisplayRow = { kind: "run"; key: string; row: RunRow; } | GroupHeaderRow; export type TableState = { sort: SortKey; ascending: boolean; group: GroupKey; expandedGroupKeys: string[]; cursorKey: string | null; cursorIndexHint: number; }; export type TableProjection = { rows: DisplayRow[]; cursorIndex: number | null; cursorKey: string | null; }; export type TableAction = { kind: "move"; delta: number; } | { kind: "sortNext"; } | { kind: "sortDirection"; } | { kind: "groupNext"; } | { kind: "toggleGroup"; }; export declare function initialTableState(): TableState; export declare function projectTable(rows: RunRow[], state: TableState): TableProjection; export declare function updateTable(state: TableState, action: TableAction, rows: RunRow[]): TableState;