11import * as fs from "fs"
22
3- import { command , run , number , option } from "cmd-ts"
3+ import { run , command , option , flag , number , boolean } from "cmd-ts"
44
5- import { exercisesPath } from "../exercises/index.js"
5+ import { EVALS_REPO_PATH } from "../exercises/index.js"
66
7+ import { runCi } from "./runCi.js"
78import { runEvals } from "./runEvals.js"
8- import { processTask } from "./processTask .js"
9+ import { processTask } from "./runTask .js"
910
1011const main = async ( ) => {
1112 await run (
@@ -14,25 +15,22 @@ const main = async () => {
1415 description : "Execute an eval run." ,
1516 version : "0.0.0" ,
1617 args : {
18+ ci : flag ( { type : boolean , long : "ci" , defaultValue : ( ) => false } ) ,
1719 runId : option ( { type : number , long : "runId" , short : "r" , defaultValue : ( ) => - 1 } ) ,
1820 taskId : option ( { type : number , long : "taskId" , short : "t" , defaultValue : ( ) => - 1 } ) ,
1921 } ,
2022 handler : async ( args ) => {
21- const { runId, taskId } = args
22-
23- if ( runId === - 1 && taskId === - 1 ) {
24- throw new Error ( "Either runId or taskId must be provided." )
25- }
26-
27- if ( runId !== - 1 && taskId !== - 1 ) {
28- throw new Error ( "Only one of runId or taskId must be provided." )
29- }
23+ const { runId, taskId, ci } = args
3024
3125 try {
32- if ( runId !== - 1 ) {
26+ if ( ci ) {
27+ await runCi ( { concurrency : 3 , exercisesPerLanguage : 5 } )
28+ } else if ( runId !== - 1 ) {
3329 await runEvals ( runId )
34- } else {
30+ } else if ( taskId !== - 1 ) {
3531 await processTask ( { taskId } )
32+ } else {
33+ throw new Error ( "Either runId or taskId must be provided." )
3634 }
3735 } catch ( error ) {
3836 console . error ( error )
@@ -46,9 +44,9 @@ const main = async () => {
4644 process . exit ( 0 )
4745}
4846
49- if ( ! fs . existsSync ( exercisesPath ) ) {
47+ if ( ! fs . existsSync ( EVALS_REPO_PATH ) ) {
5048 console . error (
51- `Exercises do not exist at ${ exercisesPath } . Please run "git clone https://github.com/RooCodeInc/Roo-Code-Evals.git evals".` ,
49+ `Exercises do not exist at ${ EVALS_REPO_PATH } . Please run "git clone https://github.com/RooCodeInc/Roo-Code-Evals.git evals".` ,
5250 )
5351
5452 process . exit ( 1 )
0 commit comments