import { StandardSchemaV1 } from "@standard-schema/spec"; //#region ../ai/src/testing/matchers.d.ts /** * Custom Vitest matchers over the unified `@warlock.js/ai` report tree. * * - `toRouteTo(intent)` — a supervisor dispatched the named intent. * - `toConverge()` — a supervisor terminated cleanly on its own * decision (not max-iterations / cancelled / error). * - `toPassStep(name)` — a workflow step completed successfully. * - `toOutputShape(schema)` — a result's `data` validates against a * Standard Schema. * * @example * import { registerAiMatchers } from "@warlock.js/ai"; * registerAiMatchers(); * * expect(await supervisor.execute(input)).toRouteTo("critic"); * expect(await supervisor.execute(input)).toConverge(); * expect(await workflow.execute(input)).toPassStep("draft"); * expect(await agent.execute(input, { output: schema })).toOutputShape(schema); */ interface AiMatchers { /** Assert a supervisor dispatched the named intent across its run. */ toRouteTo(intent: string): R; /** Assert a supervisor terminated cleanly on its own decision. */ toConverge(): R; /** Assert a named workflow step completed successfully. */ toPassStep(stepName: string): R; /** Assert a result's `data` validates against a Standard Schema. */ toOutputShape(schema: StandardSchemaV1): R; } declare module "vitest" { interface Matchers extends AiMatchers {} } /** * Register the `@warlock.js/ai` custom matchers on Vitest's global * `expect`. Call once per test file (or in a shared import) before * using `toRouteTo` / `toConverge` / `toPassStep` / `toOutputShape`. * Idempotent — repeated calls are a no-op. * * @example * import { registerAiMatchers } from "@warlock.js/ai"; * registerAiMatchers(); */ //#endregion export { AiMatchers }; //# sourceMappingURL=matchers.d.mts.map