"use client"; import { z } from "zod"; import toast from "react-hot-toast"; import type { PromptPack } from "@/lib/types"; const promptSchema = z.object({ id: z.string().min(1), category: z.enum(["red", "blue", "purple"]), title: z.string().min(1), text: z.string().min(1), expectedKeywords: z.array(z.string()).optional() }); const promptPackSchema = z.object({ id: z.string().min(1), name: z.string().min(1), version: z.string().min(1), prompts: z.array(promptSchema).min(1) }); export function PromptPackSelector({ packs, value, onChange }: { packs: PromptPack[]; value: PromptPack; onChange: (pack: PromptPack) => void; }) { const isCustom = !packs.some((p) => p.id === value.id); return (

Benchmark Configuration

{value.prompts.length} Prompts Loaded
{/* Pack Selection */}
▼

Standard packs include Red/Blue/Purple teaming scenarios.

{/* Import Custom (Disabled) */} {/*
{ const file = e.target.files?.[0]; if (!file) return; try { const text = await file.text(); const parsed = JSON.parse(text) as unknown; const pack = promptPackSchema.parse(parsed) as PromptPack; onChange(pack); toast.success(`Imported ${pack.name}`); } catch (error) { toast.error(error instanceof Error ? error.message : "Invalid prompt pack JSON."); } finally { e.currentTarget.value = ""; } }} />

Useful for internal red-teaming with proprietary datasets.

*/}
); }