@@ -8,6 +8,7 @@ import { zodResolver } from "@hookform/resolvers/zod"
88import fuzzysort from "fuzzysort"
99import { toast } from "sonner"
1010import { X , Rocket , Check , ChevronsUpDown , HardDriveUpload , CircleCheck } from "lucide-react"
11+ import { Dialog , DialogContent , DialogTitle , DialogFooter } from "@/components/ui/dialog"
1112
1213import { globalSettingsSchema , providerSettingsSchema , rooCodeDefaults } from "@evals/types"
1314
@@ -83,6 +84,10 @@ export function NewRun() {
8384
8485 const [ model , suite , settings ] = watch ( [ "model" , "suite" , "settings" , "concurrency" ] )
8586
87+ const [ systemPromptDialogOpen , setSystemPromptDialogOpen ] = useState ( false )
88+ const [ systemPrompt , setSystemPrompt ] = useState ( "" )
89+ const systemPromptRef = useRef < HTMLTextAreaElement > ( null )
90+
8691 const onSubmit = useCallback (
8792 async ( values : FormValues ) => {
8893 try {
@@ -97,13 +102,13 @@ export function NewRun() {
97102 values . settings = { ...( values . settings || { } ) , openRouterModelId }
98103 }
99104
100- const { id } = await createRun ( values )
105+ const { id } = await createRun ( { ... values , systemPrompt } )
101106 router . push ( `/runs/${ id } ` )
102107 } catch ( e ) {
103108 toast . error ( e instanceof Error ? e . message : "An unknown error occurred." )
104109 }
105110 } ,
106- [ mode , model , models . data , router ] ,
111+ [ mode , model , models . data , router , systemPrompt ] ,
107112 )
108113
109114 const onFilterModels = useCallback (
@@ -313,6 +318,10 @@ export function NewRun() {
313318 ) }
314319 < FormMessage />
315320 </ FormItem >
321+
322+ < Button type = "button" variant = "secondary" onClick = { ( ) => setSystemPromptDialogOpen ( true ) } >
323+ Import Foot Gun System Prompt
324+ </ Button >
316325 </ div >
317326
318327 < FormField
@@ -394,6 +403,21 @@ export function NewRun() {
394403 onClick = { ( ) => router . push ( "/" ) } >
395404 < X className = "size-6" />
396405 </ Button >
406+ < Dialog open = { systemPromptDialogOpen } onOpenChange = { setSystemPromptDialogOpen } >
407+ < DialogContent >
408+ < DialogTitle > Import Foot Gun System Prompt</ DialogTitle >
409+ < textarea
410+ ref = { systemPromptRef }
411+ value = { systemPrompt }
412+ onChange = { ( e ) => setSystemPrompt ( e . target . value ) }
413+ placeholder = "Paste or type your system prompt here..."
414+ className = "w-full min-h-[120px] border rounded p-2"
415+ />
416+ < DialogFooter >
417+ < Button onClick = { ( ) => setSystemPromptDialogOpen ( false ) } > Done</ Button >
418+ </ DialogFooter >
419+ </ DialogContent >
420+ </ Dialog >
397421 </ >
398422 )
399423}
0 commit comments