feat: Add event-based automation triggers (#2537)

This commit is contained in:
Dermot Duffy
2026-06-30 17:45:13 -07:00
committed by dermotduffy
parent b701366762
commit a31816c168
109 changed files with 4607 additions and 1623 deletions
+16
View File
@@ -0,0 +1,16 @@
// Returned by `addListener`; invoke it to stop listening.
export type UnlistenCallback = () => void;
// A source of health information: the current failures (of some domain-specific
// shape `F`) and a way to observe changes to them.
interface HealthInterface<F> {
getFailures(): F[];
addListener(listener: () => void): UnlistenCallback;
}
// Health that also supports a user-driven retry of whatever is currently
// failing. Separate from HealthInterface because observation and recovery are
// distinct capabilities: a read-only health source has nothing to retry.
export interface RecoverableHealthInterface<F> extends HealthInterface<F> {
retry(): void;
}