Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | "drift" | ID prefix for generated task ids ({id}-capture, {id}-compare). |
captureAgent | AgentLike | (required) | Agent that captures the current state snapshot. |
compareAgent | AgentLike | (required) | Agent that compares current state against the baseline. |
captureOutput | OutputTarget | (required) | Output schema for the captured state. |
compareOutput | OutputTarget | (required) | Output schema for comparison. Should include drifted: boolean and significance: string. |
baseline | unknown | (required) | Static baseline data (object, string, etc.) to compare against. |
alertIf | (comparison) => boolean | undefined | Custom condition for firing the alert. If omitted, the drifted field from the comparison output is used. |
alert | ReactElement | undefined | Element to render when drift is detected (e.g. a <Task> that sends a notification). |
poll | { intervalMs: number, maxPolls?: number } | undefined | If set, wraps the detector in a <Loop> for periodic polling. maxPolls defaults to 100 when poll is provided but maxPolls is omitted. |
skipIf | boolean | false | Skip the entire component. Returns null. |
What it builds
<DriftDetector> composes primitives into the following tree:
poll is provided, the entire Sequence is wrapped in a Loop.
Basic usage
Poll mode
Poll periodically to detect drift over time:Custom alert condition
UsealertIf to override the default drifted check:
Generated task ids
With the defaultid prefix of "drift":
| Task | ID |
|---|---|
| Capture | drift-capture |
| Compare | drift-compare |
| Poll loop | drift-poll |
id prop:
Notes
<DriftDetector>is a composite component. It renders a tree of<Sequence>,<Task>,<Branch>, and optionally<Loop>.- The
compareOutputschema should includedrifted: booleanso the default alert condition works. If you usealertIf, any schema shape is fine. - Without
alert, the component captures and compares but takes no action on drift. - Without
poll, the component runs once. Usepollfor continuous monitoring.