/** * The seat record: each seat's week, folded from the runs' durable event logs (studio's weekly * 1:1 per agent). `GET /roster/record?days=7`. * * Nothing new is stored. The fold reads what the engine already records per run: * * - who ran a unit: `unitDistributed.cli`, moved by `unitReassigned.newCli`; a unit no frame * names falls back to the unit row's `assigned_cli`; * - units run: the distinct units a seat was dispatched on (`unitDispatched`) inside the window; * - first pass: the unit's FIRST `gateEvaluated` in the window passed (`combined` and no `denial`); * `gated` is how many units had a gate evaluation at all; * - rework: a unit dispatched more than once (a retry or a send-back) or given a * `unitReworkAmended`, counted against the seat that ran its first dispatch; * - stalls: distinct units that went quiet (`workerStalled`, the engine's or the daemon * watchdog's), against the seat running the unit then; * - benched: runs whose `benched_seats` names the seat, with the reasons; * - cost: the sum of `cliUsage.costUsd` where a price was known; `null` when none was. * * The window is by event time (`ts`, millis). A run that ended before the window opened is not * read at all; the reads are capped at {@link SEAT_RECORD_RUN_CAP} runs, newest first, and the * answer says when the cap cut. */ import type { RecordedEvent, SeatRecord, SeatRecordResponse, SessionView } from '../core/types.js'; export declare const SEAT_RECORD_DEFAULT_DAYS = 7; export declare const SEAT_RECORD_MAX_DAYS = 90; export declare const SEAT_RECORD_RUN_CAP = 200; /** Whether a run can have any event inside the window: it ended in it, or has not ended. */ export declare function runTouchesWindow(view: SessionView, since: number): boolean; /** Fold one run's events into the seat map. `since` is the window start, unix millis. */ export declare function foldRunIntoSeats(seats: Map, view: SessionView, events: readonly RecordedEvent[], since: number): void; /** * The whole read: pick the runs that can touch the window (newest first, capped), read each log, * fold. `readEvents` answers `null` when the engine has no event-log binding — the caller turns * that into a 503 (a missing binding is not an empty week). */ export declare function seatRecord(views: readonly SessionView[], readEvents: (runId: string) => Promise, opts: { days: number; now: number; }): Promise; //# sourceMappingURL=seat-record.d.ts.map