Skip to content

Commit 39b300e

Browse files
committed
More progress
1 parent 8c1a22f commit 39b300e

38 files changed

+1548
-69
lines changed

benchmark/apps/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@benchmark/db": "workspace:^",
13+
"@benchmark/types": "workspace:^",
1314
"@vscode/test-electron": "^2.4.0",
1415
"gluegun": "^5.1.2",
1516
"p-map": "^7.0.3"

benchmark/apps/cli/src/exercises.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as fs from "fs"
33

44
import { filesystem } from "gluegun"
55

6-
import { type Language, languages } from "@benchmark/db"
6+
import { type Language, languages } from "@benchmark/types"
77

88
import { exercisesPath } from "./paths.js"
99

benchmark/apps/cli/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import pMap from "p-map"
66
import { build, filesystem, GluegunPrompt, GluegunToolbox } from "gluegun"
77
import { runTests } from "@vscode/test-electron"
88

9-
import { type Language, languages, type Run, findRun, createRun, getTask, createTask, Task } from "@benchmark/db"
9+
import { type Language, languages } from "@benchmark/types"
10+
import { type Run, findRun, createRun, getTask, createTask, Task } from "@benchmark/db"
1011

1112
import { __dirname, extensionDevelopmentPath, extensionTestsPath, exercisesPath } from "./paths.js"
1213
import { getExercises } from "./exercises.js"
@@ -99,8 +100,6 @@ const runExercise = async ({ run, task }: { run: Run; task: Task }) => {
99100
launchArgs: [workspacePath, "--disable-extensions"],
100101
extensionTestsEnv: {
101102
TASK_ID: task.id.toString(),
102-
LANGUAGE: language,
103-
EXERCISE: exercise,
104103
PROMPT_PATH: promptPath,
105104
WORKSPACE_PATH: workspacePath,
106105
OPENROUTER_MODEL_ID: run.model,

benchmark/apps/web/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,20 @@
1212
"dependencies": {
1313
"@benchmark/db": "workspace:^",
1414
"@benchmark/ipc": "workspace:^",
15+
"@benchmark/types": "workspace:^",
1516
"@hookform/resolvers": "^4.1.3",
17+
"@radix-ui/react-dialog": "^1.1.6",
1618
"@radix-ui/react-label": "^2.1.2",
19+
"@radix-ui/react-popover": "^1.1.6",
1720
"@radix-ui/react-scroll-area": "^1.2.3",
1821
"@radix-ui/react-select": "^2.1.6",
22+
"@radix-ui/react-separator": "^1.1.2",
1923
"@radix-ui/react-slot": "^1.1.2",
24+
"@radix-ui/react-tabs": "^1.1.3",
2025
"@tanstack/react-query": "^5.69.0",
2126
"class-variance-authority": "^0.7.1",
2227
"clsx": "^2.1.1",
28+
"cmdk": "1.0.0",
2329
"lucide-react": "^0.479.0",
2430
"next": "15.2.2",
2531
"next-themes": "^0.4.6",

benchmark/apps/web/src/app/runs/new/new-run.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { zodResolver } from "@hookform/resolvers/zod"
77
import { z } from "zod"
88
import { X, Loader2, Rocket } from "lucide-react"
99

10+
import { languages } from "@benchmark/types"
11+
1012
import { useOpenRouterModels } from "@/hooks/use-open-router-models"
1113
import {
1214
Button,
@@ -15,15 +17,22 @@ import {
1517
FormItem,
1618
FormLabel,
1719
FormMessage,
20+
FormDescription,
1821
Select,
1922
SelectContent,
2023
SelectItem,
2124
SelectTrigger,
2225
SelectValue,
2326
Textarea,
27+
Tabs,
28+
TabsContent,
29+
TabsList,
30+
TabsTrigger,
31+
MultiSelect,
2432
} from "@/components/ui"
2533

2634
import { createRun } from "./actions"
35+
import { cn } from "@/lib/utils"
2736

2837
const formSchema = z.object({
2938
model: z.string(),
@@ -56,6 +65,9 @@ export function NewRun() {
5665
}
5766
}
5867

68+
const [selectedSuite, setSelectedSuite] = useState<"full" | "partial">("full")
69+
const [selectedExercises, setSelectedExercises] = useState<string[]>([])
70+
5971
return (
6072
<>
6173
<FormProvider {...form}>
@@ -92,6 +104,36 @@ export function NewRun() {
92104
</FormItem>
93105
)}
94106
/>
107+
108+
<FormItem>
109+
<FormLabel>Exercise Suite</FormLabel>
110+
<Tabs
111+
defaultValue="full"
112+
onValueChange={(value) => setSelectedSuite(value as "full" | "partial")}>
113+
<TabsList className="grid w-full grid-cols-2">
114+
<TabsTrigger value="full">Full</TabsTrigger>
115+
<TabsTrigger value="partial">Partial</TabsTrigger>
116+
</TabsList>
117+
</Tabs>
118+
</FormItem>
119+
120+
{selectedSuite === "partial" && (
121+
<FormItem>
122+
<FormLabel>Exercises</FormLabel>
123+
<MultiSelect
124+
options={languages.map((language) => ({
125+
value: language,
126+
label: language,
127+
}))}
128+
onValueChange={setSelectedExercises}
129+
defaultValue={selectedExercises}
130+
placeholder="Select"
131+
variant="inverted"
132+
maxCount={10}
133+
/>
134+
</FormItem>
135+
)}
136+
95137
<FormField
96138
control={form.control}
97139
name="description"
@@ -105,6 +147,7 @@ export function NewRun() {
105147
</FormItem>
106148
)}
107149
/>
150+
108151
<Button type="submit" disabled={isSubmitting}>
109152
<Rocket className="size-4" />
110153
Launch
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import * as React from "react"
2+
import { Slot } from "@radix-ui/react-slot"
3+
import { cva, type VariantProps } from "class-variance-authority"
4+
5+
import { cn } from "@/lib/utils"
6+
7+
const badgeVariants = cva(
8+
"inline-flex items-center justify-center rounded-sm border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
9+
{
10+
variants: {
11+
variant: {
12+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
13+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
14+
destructive:
15+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/70",
16+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
17+
},
18+
},
19+
defaultVariants: {
20+
variant: "default",
21+
},
22+
},
23+
)
24+
25+
function Badge({
26+
className,
27+
variant,
28+
asChild = false,
29+
...props
30+
}: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
31+
const Comp = asChild ? Slot : "span"
32+
33+
return <Comp data-slot="badge" className={cn(badgeVariants({ variant }), className)} {...props} />
34+
}
35+
36+
export { Badge, badgeVariants }
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
"use client"
2+
3+
import * as React from "react"
4+
import { Command as CommandPrimitive } from "cmdk"
5+
import { SearchIcon } from "lucide-react"
6+
7+
import { cn } from "@/lib/utils"
8+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog"
9+
10+
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
11+
return (
12+
<CommandPrimitive
13+
data-slot="command"
14+
className={cn(
15+
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-sm",
16+
className,
17+
)}
18+
{...props}
19+
/>
20+
)
21+
}
22+
23+
function CommandDialog({
24+
title = "Command Palette",
25+
description = "Search for a command to run...",
26+
children,
27+
...props
28+
}: React.ComponentProps<typeof Dialog> & {
29+
title?: string
30+
description?: string
31+
}) {
32+
return (
33+
<Dialog {...props}>
34+
<DialogHeader className="sr-only">
35+
<DialogTitle>{title}</DialogTitle>
36+
<DialogDescription>{description}</DialogDescription>
37+
</DialogHeader>
38+
<DialogContent className="overflow-hidden p-0">
39+
<Command className="[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
40+
{children}
41+
</Command>
42+
</DialogContent>
43+
</Dialog>
44+
)
45+
}
46+
47+
function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>) {
48+
return (
49+
<div data-slot="command-input-wrapper" className="flex h-9 items-center gap-2 border-b px-3">
50+
<SearchIcon className="size-4 shrink-0 opacity-50" />
51+
<CommandPrimitive.Input
52+
data-slot="command-input"
53+
className={cn(
54+
"placeholder:text-muted-foreground flex h-10 w-full rounded-sm bg-transparent py-3 outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
55+
className,
56+
)}
57+
{...props}
58+
/>
59+
</div>
60+
)
61+
}
62+
63+
function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
64+
return (
65+
<CommandPrimitive.List
66+
data-slot="command-list"
67+
className={cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className)}
68+
{...props}
69+
/>
70+
)
71+
}
72+
73+
function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
74+
return <CommandPrimitive.Empty data-slot="command-empty" className="py-6 text-center" {...props} />
75+
}
76+
77+
function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>) {
78+
return (
79+
<CommandPrimitive.Group
80+
data-slot="command-group"
81+
className={cn(
82+
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
83+
className,
84+
)}
85+
{...props}
86+
/>
87+
)
88+
}
89+
90+
function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
91+
return (
92+
<CommandPrimitive.Separator
93+
data-slot="command-separator"
94+
className={cn("bg-accent/5 -mx-1 h-px", className)}
95+
{...props}
96+
/>
97+
)
98+
}
99+
100+
function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {
101+
return (
102+
<CommandPrimitive.Item
103+
data-slot="command-item"
104+
className={cn(
105+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-xs px-2 py-1.5 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
106+
"text-foreground active:opacity-80 cursor-pointer group",
107+
className,
108+
)}
109+
{...props}
110+
/>
111+
)
112+
}
113+
114+
function CommandShortcut({ className, ...props }: React.ComponentProps<"span">) {
115+
return (
116+
<span
117+
data-slot="command-shortcut"
118+
className={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)}
119+
{...props}
120+
/>
121+
)
122+
}
123+
124+
export {
125+
Command,
126+
CommandDialog,
127+
CommandInput,
128+
CommandList,
129+
CommandEmpty,
130+
CommandGroup,
131+
CommandItem,
132+
CommandShortcut,
133+
CommandSeparator,
134+
}

0 commit comments

Comments
 (0)