//#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 Promise.resolve().then(() => require("./memoryPoisoning-DsdlW8SX.cjs"));
			return new MemoryPoisoningProvider(providerOptions);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:best-of-n",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamBestOfNProvider } = await Promise.resolve().then(() => require("./bestOfN-2pD7fRQo.cjs"));
			return new RedteamBestOfNProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:crescendo",
		create: async (_providerPath, providerOptions) => {
			const { CrescendoProvider } = await Promise.resolve().then(() => require("./crescendo-nR4KiB1H.cjs"));
			return new CrescendoProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:custom" || providerPath.startsWith("promptfoo:redteam:custom:"),
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamCustomProvider } = await Promise.resolve().then(() => require("./custom-B3DH5EX9.cjs"));
			return new RedteamCustomProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:goat",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamGoatProvider } = await Promise.resolve().then(() => require("./goat-dCLHeF3v.cjs"));
			return new RedteamGoatProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:authoritative-markup-injection",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamAuthoritativeMarkupInjectionProvider } = await Promise.resolve().then(() => require("./authoritativeMarkupInjection-C76UKO5W.cjs"));
			return new RedteamAuthoritativeMarkupInjectionProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:mischievous-user",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamMischievousUserProvider } = await Promise.resolve().then(() => require("./mischievousUser-DOGOWx3S.cjs"));
			return new RedteamMischievousUserProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:iterative",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamIterativeProvider } = await Promise.resolve().then(() => require("./iterative-67DULULu.cjs"));
			return new RedteamIterativeProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:iterative:image",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamImageIterativeProvider } = await Promise.resolve().then(() => require("./iterativeImage-Cdy7v5o9.cjs"));
			return new RedteamImageIterativeProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:iterative:tree",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamIterativeTreeProvider } = await Promise.resolve().then(() => require("./iterativeTree-DkQvzdq1.cjs"));
			return new RedteamIterativeTreeProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:iterative:meta",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamIterativeMetaProvider } = await Promise.resolve().then(() => require("./iterativeMeta-CwTBT_3e.cjs"));
			return new RedteamIterativeMetaProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:hydra",
		create: async (_providerPath, providerOptions) => {
			const { HydraProvider } = await Promise.resolve().then(() => require("./hydra-D4Soy2zN.cjs"));
			return new HydraProvider(providerOptions.config);
		}
	},
	{
		test: (providerPath) => providerPath === "promptfoo:redteam:indirect-web-pwn",
		create: async (_providerPath, providerOptions) => {
			const { default: RedteamIndirectWebPwnProvider } = await Promise.resolve().then(() => require("./indirectWebPwn-BZ0kAXrg.cjs"));
			return new RedteamIndirectWebPwnProvider(providerOptions.config);
		}
	}
].map(withErrorContext);
//#endregion
exports.redteamProviderFactories = redteamProviderFactories;

//# sourceMappingURL=registry-BWpALzrP.cjs.map