export type InstrumentState = 'idle' | 'running' | 'standby' | 'connected' | 'disconnected' | 'error' export type InstrumentAlertLevel = 'info' | 'warning' | 'critical' export interface SampleInfo { file_name: string sample_id?: string | null sample_name?: string | null vial_position?: string | null injection_volume?: number | null } export interface SequenceProgress { sequence_name?: string | null current_sample: number total_samples: number elapsed_seconds?: number estimated_remaining_seconds?: number | null avg_sample_seconds?: number | null current_sample_name?: string | null current_method?: string | null estimated_finish_time?: string | Date | null sample_durations?: readonly number[] } /** @deprecated Scheduled for removal in MINT 1.4; instrument monitor types move to the mld-ms plugins. */ export interface InstrumentStatus { instrument_id: string instrument_name?: string | null monitor_id?: string | null state: InstrumentState active_method?: string | null current_sample?: SampleInfo | null sequence_progress?: SequenceProgress | null timestamp?: string | Date last_seen?: string | Date | null connected?: boolean sequence_file?: string | null sequence_row_index?: number | null current_raw_file?: string | null method_elapsed_pct?: number | null } /** A state the platform derives for an instrument: its reported state, `never` (no report yet) or `inactive`. */ export type InstrumentBadgeState = InstrumentState | 'never' | 'inactive' /** Sequence progress in a live status report; `sample_durations` covers the current sequence only. */ export type InstrumentLiveProgress = SequenceProgress & { elapsed_seconds: number sample_durations: number[] } /** The plugin that reported a live status, resolved from the plugin registry at read time. */ export interface InstrumentStatusReporter { name: string display_name: string route_prefix: string serves_instrument_alerts: boolean } /** Latest live snapshot the platform holds for one instrument (`InstrumentRecord.live_status`). */ export interface InstrumentLiveStatus { instrument_id: string /** `disconnected` once `last_seen` is older than 60 s. */ state: InstrumentState active_method?: string | null current_sample?: SampleInfo | null sequence_progress?: InstrumentLiveProgress | null has_unacknowledged_alerts: boolean has_unacknowledged_critical: boolean /** Server receive time of the latest report (ISO 8601). */ last_seen: string /** When the state last changed (ISO 8601). */ state_since: string reported_by: string /** Null when the reporting plugin is not loaded. */ reporter: InstrumentStatusReporter | null } /** An alert served by the reporting plugin at `{route_prefix}/api/instruments/{id}/alerts`. */ export interface InstrumentAlert { id: string instrument_id: string level: InstrumentAlertLevel message: string timestamp: string acknowledged: boolean acknowledged_by?: string | null acknowledged_at?: string | null } export interface InstrumentAlertList { alerts: InstrumentAlert[] total: number }