/**
 * Finite public contract for the rich overview dashboard surface.
 *
 * Unlike the thin `overview` surface (one bounded status per area), this
 * projection composes the operational headline the dashboard renders: spend
 * vs. budget, agent-slot usage, a bounded list of active runs with per-run
 * cost, and a failure-by-reason breakdown. Every figure is derived read-only
 * from local SQLite run + runtime-event data; no new capture path exists.
 *
 * All numbers are finite and non-negative; costs are rounded to cents. Free
 * text (run titles) flows through the same redaction helper as the run
 * projection, so no raw source payload, path, prompt, or token can surface.
 */
export const OVERVIEW_DASHBOARD_PROJECTION_PUBLIC_SOURCE = "overview-dashboard";
export const OVERVIEW_DASHBOARD_REASON_CODES = [
    "ok",
    "partial-data",
    "stale-data",
    "no-data",
];
/** The run statuses that count as an operational failure / policy block. */
export const OVERVIEW_FAILURE_REASON_CODES = [
    "failed",
    "blocked-budget",
    "blocked-timeout",
    "blocked-concurrency",
];
/** Maximum active runs returned inline; overflow is reported via the count. */
export const OVERVIEW_ACTIVE_RUNS_LIMIT = 20;
/** Fixed, non-free-text copy for each failure reason bucket. */
export const OVERVIEW_FAILURE_REASON_LABELS = {
    failed: "Failed",
    "blocked-budget": "Budget cap",
    "blocked-timeout": "Time cap",
    "blocked-concurrency": "Concurrency cap",
};
/** Round a USD figure to whole cents, guarding against FP drift. */
export function roundUsd(value) {
    if (!Number.isFinite(value) || value <= 0)
        return 0;
    return Math.round(value * 100) / 100;
}
