UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

21 lines (20 loc) • 921 B
import type { HealthFinding } from "./machine-health.js"; /** * Turns the stream of health reads into phone pushes: one push when a `high` * finding id first appears, nothing while it stays, and again only if it * clears and comes back after `REPEAT_AFTER_MS`. At most `MAX_PER_HOUR` * pushes an hour across all ids, so a bad morning is a few alerts, not a * storm. State is in memory: a Hook restart may repeat a standing alert once. */ export declare const REPEAT_AFTER_MS: number; export declare const MAX_PER_HOUR = 3; export declare const ALERT_CHECK_MS: number; export declare class HealthAlerts { private readonly notify; private active; private lastPushed; private sent; constructor(notify: (finding: HealthFinding) => Promise<unknown>); /** The findings that were pushed for this read. */ observe(findings: readonly HealthFinding[] | undefined, now: number): HealthFinding[]; }