feat: add Watchdog recovery and drift rebuild workflows
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
import type { DriftPlanFile } from './drift-plan.js';
|
||||
|
||||
export type WatchdogState = 'open' | 'recovering' | 'attention' | 'resolved' | 'dismissed';
|
||||
export interface WatchdogIncident {
|
||||
id: string;
|
||||
server: string;
|
||||
kind: 'health' | 'drift';
|
||||
state: WatchdogState;
|
||||
summary: string;
|
||||
details: string;
|
||||
first_seen_at: string;
|
||||
last_seen_at: string;
|
||||
finished_at: string | null;
|
||||
failures: number;
|
||||
cycle: number;
|
||||
}
|
||||
export interface WatchdogEvidence {
|
||||
reason?: string;
|
||||
containerState?: string | null;
|
||||
files?: DriftPlanFile[];
|
||||
fingerprint?: string;
|
||||
}
|
||||
export interface WatchdogAction {
|
||||
id: string;
|
||||
incident_id: string;
|
||||
action: 'restart' | 'rebuild';
|
||||
operation_id: string;
|
||||
campaign_id: string | null;
|
||||
created_at: string;
|
||||
cycle: number;
|
||||
operation_state: string | null;
|
||||
operation_stage: string | null;
|
||||
operation_error: string | null;
|
||||
}
|
||||
export interface WatchdogOverview {
|
||||
enabled: boolean;
|
||||
lastScanAt: string | null;
|
||||
scanError: string | null;
|
||||
incidents: WatchdogIncident[];
|
||||
}
|
||||
export interface WatchdogDetail {
|
||||
incident: WatchdogIncident;
|
||||
events: { id: number; created_at: string; message: string }[];
|
||||
actions: WatchdogAction[];
|
||||
}
|
||||
export const watchdogStateLabels: Record<WatchdogState, string> = {
|
||||
open: 'Detected', recovering: 'Recovering', attention: 'Needs attention', resolved: 'Resolved', dismissed: 'Dismissed'
|
||||
};
|
||||
Reference in New Issue
Block a user