#!/usr/bin/env node
//#region src/redteam/providers/registry.ts
/**
* Wrap a redteam factory's create() so dynamic-import failures and
* constructor errors carry the originally-requested provider path. Without
* this, a rename or broken install surfaces as a raw `ERR_MODULE_NOT_FOUND`
* pointing at an internal file path with no connection to the user's config.
*
* `cause` is assigned as a property rather than passed through the
* two-argument Error constructor so the file type-checks under both the
* root (ES2022) and the app (ES2020) tsconfig libs — the app build pulls
* backend files in through path aliases and fails otherwise.
*/
function withErrorContext(factory) {
	return {
		test: factory.test,
		create: async (providerPath, providerOptions, context) => {
			try {
				return await factory.create(providerPath, providerOptions, context);
			} catch (err) {
				const message = err instanceof Error ? err.message : String(err);
				const wrapped = /* @__PURE__ */ new Error(`Failed to load redteam provider '${providerPath}': ${message}`);
				if (err instanceof Error) wrapped.cause = err;
				throw wrapped;
			}
		}
	};
}
const redteamProviderFactories = [
	{
		test: (providerPath) => providerPath === "agentic:memory-poisoning",
		create: async (_providerPath, providerOptions) => {
			const { MemoryPoisoningProvider } = await import("./memoryPoisoning-CldQVRkv.js");
			return new MemoryPoisoningProvider(providerOptions);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:best-of-n",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamBestOfNProvider } = await import("./bestOfN-B2Z3F1cP.js");
			return new RedteamBestOfNProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:crescendo",
		create: async (_providerPath, providerOptions) => {
			const { CrescendoProvider } = await import("./crescendo-DTzRVcRn.js");
			return new CrescendoProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:custom" || providerPath.startsWith("promptfoo:redteam:custom:"),
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamCustomProvider } = await import("./custom-gCyPgNlR.js");
			return new RedteamCustomProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:goat",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamGoatProvider } = await import("./goat-Dc5bO3O0.js");
			return new RedteamGoatProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:authoritative-markup-injection",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamAuthoritativeMarkupInjectionProvider } = await import("./authoritativeMarkupInjection-SclPxOnA.js");
			return new RedteamAuthoritativeMarkupInjectionProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:mischievous-user",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamMischievousUserProvider } = await import("./mischievousUser-DCXELN-B.js");
			return new RedteamMischievousUserProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:iterative",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamIterativeProvider } = await import("./iterative-Ha9OWOMP.js");
			return new RedteamIterativeProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:iterative:image",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamImageIterativeProvider } = await import("./iterativeImage-C9XIt1_4.js");
			return new RedteamImageIterativeProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:iterative:tree",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamIterativeTreeProvider } = await import("./iterativeTree-DvmkgyPC.js");
			return new RedteamIterativeTreeProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:iterative:meta",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamIterativeMetaProvider } = await import("./iterativeMeta-CFAJUKno.js");
			return new RedteamIterativeMetaProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:hydra",
		create: async (_providerPath, providerOptions) => {
			const { HydraProvider } = await import("./hydra-UIyNDDZu.js");
			return new HydraProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:indirect-web-pwn",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamIndirectWebPwnProvider } = await import("./indirectWebPwn-Dw__HUxH.js");
			return new RedteamIndirectWebPwnProvider(providerOptions.config);
		}
	}
].map(withErrorContext);
//#endregion
export { redteamProviderFactories };

//# sourceMappingURL=registry-Dl6VUp-F.js.map