/** * Read-only aggregations over observability events. * * Slice B of v2.11.1. Pure functions over `readonly ObservabilityEvent[]` * — the CLI layer reads events via `readObservabilityEvents` (or * `listSessionDirsWithMetrics` for cross-session rollups) and passes * them in. Tests pass synthetic events directly. * * Aggregations: * * The dispatch / mode-gate / context / post-compact categories land * in Slice C (more hooks); for Slice B only `slice-transition` events * are emitted from the `peaks request transition` hook. Slice B * builds the read-side surface so Slice C is purely additive. */ import { type ObservabilityEvent } from './observability-service.js'; import { type DashboardMetrics, type FanoutBreakdown, type Period, type RepairCycleReport, type SliceRollup, type StatusAggregate } from './aggregation-types.js'; export { REPAIR_CYCLE_CAP } from './aggregation-types.js'; export { REPAIR_CYCLE_METRIC_VERSION } from './repair-cycle-metric.js'; export { readAllSessionEvents, readSessionEvents } from './aggregation-helpers.js'; export type { DashboardMetrics, FanoutBreakdown, LegacyQaEventCount, Period, QaRoundSummary, RepairCycleReport, SliceRollup, StatusAggregate } from './aggregation-types.js'; export declare function aggregateStatus(events: readonly ObservabilityEvent[]): StatusAggregate; export declare function aggregateSlices(events: readonly ObservabilityEvent[]): SliceRollup[]; export declare function aggregateFanout(events: readonly ObservabilityEvent[]): FanoutBreakdown; export declare function aggregateRepairCycles(events: readonly ObservabilityEvent[]): RepairCycleReport; export declare function periodStartIso(period: Period, now?: () => Date): string; export declare function filterByPeriod(events: readonly ObservabilityEvent[], period: Period, now?: () => Date): ObservabilityEvent[]; /** * Aggregate the 5 dashboard metric classes for a single session, filtered * to events with `ts >= since`. Events with unparseable timestamps are * counted (best-effort, mirrors `readObservabilityEvents` behavior). The * `token-usage` total is summed from `detail.totalTokens` (falling back to * `inputTokens + outputTokens` when the aggregate field is missing). */ export declare function aggregateDashboardMetrics(projectRoot: string, sessionId: string, since: Date): DashboardMetrics; /** * Pure-function variant used by tests: counts across an already-loaded * event list. `since` may be null to count everything. */ export declare function aggregateDashboardMetricsFromEvents(events: readonly ObservabilityEvent[], since?: Date | null): DashboardMetrics;