Documentation Index
Fetch the complete documentation index at: https://smithers.sh/llms.txt
Use this file to discover all available pages before exploring further.
// Props
import { DriftDetector } from "smithers-orchestrator";
type DriftDetectorProps = {
id?: string; // default "drift"; ids {id}-capture, {id}-compare
captureAgent: AgentLike;
compareAgent: AgentLike;
captureOutput: OutputTarget;
compareOutput: OutputTarget; // include `drifted: boolean`
baseline: unknown;
alertIf?: (comparison: any) => boolean; // override the default `drifted` check
alert?: ReactElement;
poll?: { intervalMs: number; maxPolls?: number }; // default maxPolls = 100
skipIf?: boolean;
};
<Workflow name="api-drift-check">
<DriftDetector
captureAgent={snapshotAgent}
compareAgent={diffAgent}
captureOutput={outputs.capture}
compareOutput={outputs.compare}
baseline={{ endpoints: ["/users", "/orders"], schemaHash: "abc123" }}
alert={
<Task id="notify" output={outputs.notify} agent={slackAgent}>
API drift detected — notify the team.
</Task>
}
/>
</Workflow>
Notes
- Without
poll, the component runs once; with poll, it wraps in a Loop.
- Without
alert, the component compares but takes no action on drift.