/** * Serial Monitor Health Classification * * Provides: * - evaluateMonitorHealth: Classifies bounded, redacted serial evidence. * - compileBoundedPattern: Safely compiles opt-in regular expressions. */ /** Stable monitor health states used by interactive and scheduled runs. */ export type MonitorHealthStatus = "healthy" | "degraded" | "failed" | "silent" | "disconnected" | "inconclusive"; /** Structured health result designed for change-aware automation. */ export interface MonitorHealthResult { status: MonitorHealthStatus; changed: boolean; recovered: boolean; cursor?: string; digest: string; matchedExpectations: string[]; unmatchedExpectations: string[]; matchedRejectedPatterns: string[]; evidence: string; consecutiveFailures: number; recommendedAction: string; observedAt: string; } /** Reasons an interactive task or automation should surface a health result. */ export type MonitorNotificationReason = "initial" | "failure" | "recovery" | "target_changed"; /** Change-aware notification decision for one health observation. */ export interface MonitorNotificationDecision { shouldNotify: boolean; notificationReason?: MonitorNotificationReason; } /** * Compiles a bounded pattern. Plain strings are matched literally; an `re:` * prefix opts into a restricted regular expression. * * @param pattern - Literal text or a restricted `re:` expression. * @returns Safe case-insensitive matcher. */ export declare function compileBoundedPattern(pattern: string): RegExp; /** * Classifies one bounded serial window and calculates change state. * * @param input - Serial evidence, assertions, and previous automation state. * @returns Health classification with redacted evidence. */ export declare function evaluateMonitorHealth(input: { serialOutput: string; expectedMarkers?: string[]; rejectedPatterns?: string[]; disconnected?: boolean; cursor?: string; previousDigest?: string; previousStatus?: MonitorHealthStatus; previousConsecutiveFailures?: number; observedAt?: string; }): MonitorHealthResult; /** * Decides whether a monitor result is actionable enough to notify the user. * Identical failures are emitted once, while an optional threshold suppresses * transient failures until they recur. * * @param input - Current result and prior automation state. * @returns Notification flag and stable reason. */ export declare function decideMonitorNotification(input: { automation: boolean; health: MonitorHealthResult; previousDigest?: string; targetChanged?: boolean; failureThreshold?: number; }): MonitorNotificationDecision; //# sourceMappingURL=monitor-health.d.ts.map