import { type PressureAssessment, type PressureHysteresisState } from "../diagnostics/contract.js"; import { type SupervisorCapability, type SupervisorPressureRecord } from "../supervisor/contract.js"; import { type ResourceDiskSample, type ResourceHostSample, type ResourceIoSample, type ResourceMachineSample, type ResourceOomSample, type ResourcePressureSample, type ResourceProcessSample, type ResourceSnapshot } from "./contract.js"; export declare const RESOURCE_STATUS_STALE_MS = 15000; export declare const RESOURCE_STATUS_MAX_BYTES: number; export declare const RESOURCE_STATUS_PROCESS_LIMIT = 20; export declare const RESOURCE_HOST_STATUS_STALE_MS = 30000; export interface ResourceStatus { schema_version: 2; state: "fresh" | "stale" | "unavailable"; reason: string | null; sampled_at: string | null; sample_age_ms: number | null; stale_after_ms: number; platform: NodeJS.Platform | null; namespace: ResourceSnapshot["namespace"]; support: ResourceSnapshot["support"] | null; writer: { running: boolean; stale: boolean; }; /** * The one published pressure assessment, read from the observer's record so * this surface, the prompt notice, the dashboard, and a diagnostic bundle all * report the same answer for the same input. */ assessment: PressureAssessment; /** The state the sample before the published one carried forward. */ prior_hysteresis: PressureHysteresisState | null; /** Where the assessment came from, and why it is missing when it is. */ assessment_capability: SupervisorCapability; machine: ResourceMachineSample | null; disks: ResourceDiskSample[]; pressure: ResourcePressureSample | null; oom: ResourceOomSample | null; io: ResourceIoSample | null; host: ResourceHostSample | null; processes?: Array>; processes_omitted?: number; } /** A bounded cache-only read. Never samples the OS or starts the writer. */ export declare function readResourceStatus(coordRoot: string, options?: { nowMs?: number; includeProcesses?: boolean; }): ResourceStatus; export declare function formatResourceSummary(status: ResourceStatus): string; export declare function formatResourceStatus(status: ResourceStatus, bin: string): string; export declare const PRESSURE_RECORD_MAX_BYTES: number; export interface PublishedPressure { assessment: PressureAssessment; prior_hysteresis: PressureHysteresisState | null; capability: SupervisorCapability; record: SupervisorPressureRecord | null; } /** * Read the assessment the observer published. Bounded, cache only, and never a * computation: a missing, stale, or malformed record yields `unknown` with the * reason stated, because a gap in the evidence is not a measurement of health. */ export declare function readPublishedPressure(coordRoot: string, nowMs?: number, writer?: ResourceStatus["writer"]): PublishedPressure; //# sourceMappingURL=status.d.ts.map