{"version":3,"file":"register-lazy.mjs","names":[],"sources":["../../../../../../../ai/src/testing/register-lazy.ts"],"sourcesContent":["// Lazy bridge for the vitest-coupled matcher registration.\n//\n// WHY: `@warlock.js/ai`'s root barrel (`src/index.ts`) is the package's\n// only public entry, and it is loaded by every production consumer.\n// `./matchers` statically imports `vitest` (a devDependency) at module\n// top to call `expect.extend`, so pulling it into the eager barrel would\n// force `vitest` to resolve in production — where it is not installed —\n// and crash the import. This wrapper defers that import to call time via\n// a dynamic `import()`, mirroring the package's optional-peer discipline,\n// so `registerAiMatchers` can ship on the root barrel while staying inert\n// (and `vitest`-free) until a test actually invokes it.\n\n/**\n * Register the `@warlock.js/ai` custom Vitest matchers\n * (`toRouteTo` / `toConverge` / `toPassStep` / `toOutputShape`) on the\n * global `expect`. Call once from test code before using them. The\n * underlying `vitest`-coupled implementation is imported lazily on the\n * first call, so importing `@warlock.js/ai` in production never pulls in\n * `vitest`. Idempotent — the underlying registration is itself a no-op on\n * repeat calls.\n *\n * @example\n * import { registerAiMatchers } from \"@warlock.js/ai\";\n * await registerAiMatchers();\n *\n * expect(await supervisor.execute(input)).toRouteTo(\"critic\");\n */\nexport async function registerAiMatchers(): Promise<void> {\n  const { registerAiMatchers: register } = await import(\"./matchers\");\n\n  register();\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,eAAsB,qBAAoC;CACxD,MAAM,EAAE,oBAAoB,aAAa,MAAM,OAAO;CAEtD,SAAS;AACX"}