import { type DeviceStats } from './health.js';
import { type HostAuthSummary } from '../auth-health.js';
import type { OnlineState } from './reachability.js';
import { type FleetInventory } from './fleet-divergence.js';
import type { FleetAgentCounts } from '../fleet-status.js';
export interface FleetCliStatus {
    installed: boolean;
    path: string | null;
    error: string | null;
}
export interface FleetSyncStatus {
    agent: string;
    version: string;
    status: 'fresh' | 'stale' | 'never-synced';
    isDefault: boolean;
    divergence?: string[];
}
export interface FleetOrphanStatus {
    agent: string;
    version: string;
    commands: number;
    skills: number;
    hooks: number;
}
export interface FleetHealthRow {
    name: string;
    platform?: string;
    version?: string | null;
    stats?: DeviceStats;
    error?: string;
    skipped?: string;
    clis: Record<string, FleetCliStatus>;
    sync: FleetSyncStatus[];
    orphans: FleetOrphanStatus[];
    /** Cached auth-health rollup for this host (the Auth column). Undefined when
     *  the host has never been probed (`agents fleet ping`) or the cache is cold. */
    auth?: HostAuthSummary;
    /** Resolved online/offline verdict (from {@link deviceOnlineState}). Populated
     *  by `runFleetStatus` for the summary view; undefined in the raw grid. */
    online?: OnlineState;
    /** When this box was last seen reachable (ISO), for the "last seen …" note on
     *  an offline row. Sourced from the registry's tailscale snapshot / reachability
     *  verdict. Undefined when never recorded. */
    lastSeen?: string;
    /** This host's self-reported harness inventory (resources / agent versions /
     *  repo state) from its `doctor --json` `fleet` field, for cross-device
     *  divergence detection (RUSH-2027). Undefined for an unreachable box or an
     *  older CLI that doesn't emit it. */
    inventory?: FleetInventory;
    /** This host's live agent workload (running-agent count + per-context / per-
     *  agent breakdown), from the fleet-status mirror / read-union (RUSH-2061).
     *  Undefined when no row has been published for the host yet. */
    agents?: FleetAgentCounts;
}
export interface FleetWarning {
    kind: 'unreachable' | 'drift' | 'cli' | 'version-skew' | 'divergence';
    devices: string[];
    message: string;
}
export interface FleetHealthReport {
    generatedAt: string;
    devices: FleetHealthRow[];
    warnings: FleetWarning[];
    hasWarnings: boolean;
    hasDrift: boolean;
}
export declare function buildFleetHealthReport(rows: FleetHealthRow[], now?: Date, opts?: {
    self?: string;
}): FleetHealthReport;
export declare function renderFleetWarnings(report: FleetHealthReport): string[];
export declare function renderFleetMatrix(report: FleetHealthReport): string[];
/**
 * "as of …" line so cache-served output is honest about age and points at the
 * refresh flag. Stats age comes from `stats.fetchedAt`, auth age from the
 * cached rollup's `oldestCheckedAt`; either may be absent. Returns null when the
 * table carries no timestamped data at all (nothing to date).
 */
export declare function freshnessFooter(rows: FleetHealthRow[], now?: number): string | null;
/** Collapse a long dev build (`0.0.0-dev.<sha>[-dirty]`) to `dev`/`dev-dirty`;
 *  released semver is shown verbatim. Keeps the version column narrow and stops
 *  a single dev box from widening every row. */
export declare function shortVersion(version: string | null | undefined): string;
/** OS bucket label for grouping. Anything unrecognized falls under "Other". */
export declare function platformGroupLabel(platform: string | undefined): 'macOS' | 'Linux' | 'Windows' | 'Other';
export interface FleetAttentionItem {
    /** Leading mark: `○` offline, `⚠` config/CLI/version issue. */
    glyph: 'offline' | 'warn';
    subject: string;
    detail: string;
    /** The exact command (or instruction) that fixes it. */
    fix: string;
}
/**
 * The actionable problems only — each with the command that fixes it. Order:
 * offline boxes, CLI gaps, active-version config drift, then version skew.
 * A healthy fleet returns `[]` (the caller prints an all-clear line).
 */
export declare function buildFleetAttentionItems(report: FleetHealthReport, now?: number): FleetAttentionItem[];
/**
 * The default `agents fleet status` view (RUSH-1966): a one-line rollup, a
 * NEEDS ATTENTION list of only the actionable problems (each with its fix
 * command), quiet per-device rows grouped by OS, and an honest footer. The full
 * auth/CLI/sync grid moves behind `--verbose` ({@link renderFleetMatrix}).
 */
export declare function renderFleetSummary(report: FleetHealthReport, opts?: {
    self?: string;
    now?: number;
}): string[];
