import { AgentStatus } from '../agents/types'; /** How an agent stands relative to the newest version we can actually see. */ export type FleetPluginState = /** Probe still in flight for this agent. */ 'loading' /** Installed, and at the newest version any agent reports. */ | 'up-to-date' /** Installed, but behind the newest version any agent reports. */ | 'outdated' /** Reachable, plugin simply absent. */ | 'not-installed' /** The agent could not be reached / returned an error — state unknown. */ | 'unreachable'; /** Minimum agent shape the matrix needs — matches `useCachedInitialData().agents`. */ export interface FleetMatrixAgentInput { id: string; name: string; hostname: string; isActive: boolean; lastHeartbeat?: string | null; tunnelUrl?: string | null; tunnelStatus?: string | null; } /** Capability flags the agent itself reports for an installed plugin. */ export interface ReportedPluginFacts { pluginName: string; description: string | null; installedAt: string | null; loaded: boolean; hasCliSetup: boolean; hasServerStart: boolean; hasServerStop: boolean; } export interface FleetMatrixRow { agentId: string; agentName: string; hostname: string; agentStatus: AgentStatus; state: FleetPluginState; /** Version reported installed on this agent, or null when absent/unknown. */ installedVersion: string | null; /** Version this agent's catalog offers for the package, when it lists it. */ catalogVersion: string | null; /** Facts the agent reports about its installed copy — null when not installed. */ facts: ReportedPluginFacts | null; /** Tags this agent's catalog carries for the package. */ tags: readonly string[]; /** Probe failure message, already user-safe. */ error: string | null; } export interface UseFleetPluginMatrixResult { rows: readonly FleetMatrixRow[]; /** True while at least one agent probe is in flight. */ loading: boolean; /** True until the first full sweep has settled. */ initialLoading: boolean; /** Newest version observed anywhere on the fleet (catalog or installed). */ latestVersion: string | null; /** Every distinct version observed, newest first. Feeds the rollout picker. */ knownVersions: readonly string[]; /** Facts from the first agent that actually has the plugin installed. */ reportedFacts: ReportedPluginFacts | null; /** Tags from the first agent whose catalog lists the package. */ tags: readonly string[]; installedCount: number; loadedCount: number; outdatedCount: number; unreachableCount: number; refreshAll: () => void; refreshAgent: (agentId: string) => void; } /** * Numeric-dotted version compare. Returns <0 when `a` is older than `b`. * Pre-release suffixes (`1.2.3-rc.1`) are stripped before comparing and a * bare pre-release loses a tie against the plain release, which is the * conservative reading for "is this agent behind?". */ export declare function compareVersions(a: string, b: string): number; export declare function useFleetPluginMatrix(packageName: string | null, agents: readonly FleetMatrixAgentInput[]): UseFleetPluginMatrixResult;