🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
Formatting (#133)
Marc Klingenc0489890c76a
diff --git a/src/__tests__/generations.servertest.ts b/src/__tests__/generations.servertest.tsindex a951644b47..59a0fdbfd3 100644--- a/src/__tests__/generations.servertest.ts+++ b/src/__tests__/generations.servertest.ts@@ -53,7 +53,7 @@ describe("/api/public/generations API Endpoint", () => {prompt: { key: "value" },metadata: { key: "value" },version: "2.0.0",- }+ },);expect(createGeneration.status).toBe(200);@@ -67,7 +67,7 @@ describe("/api/public/generations API Endpoint", () => {expect(dbGeneration?.traceId).toBe(traceId);expect(dbGeneration?.name).toBe("generation-name");expect(dbGeneration?.startTime).toEqual(- new Date("2021-01-01T00:00:00.000Z")+ new Date("2021-01-01T00:00:00.000Z"),);expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));expect(dbGeneration?.model).toBe("model-name");@@ -97,7 +97,7 @@ describe("/api/public/generations API Endpoint", () => {prompt: { key: "value" },metadata: { key: "value" },version: "2.0.0",- }+ },);expect(createGeneration.status).toBe(200);@@ -111,7 +111,7 @@ describe("/api/public/generations API Endpoint", () => {expect(dbGeneration?.traceId).toBe(traceId);expect(dbGeneration?.name).toBe("generation-name");expect(dbGeneration?.startTime).toEqual(- new Date("2021-01-01T00:00:00.000Z")+ new Date("2021-01-01T00:00:00.000Z"),);expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));expect(dbGeneration?.model).toBe("model-name");@@ -181,7 +181,7 @@ describe("/api/public/generations API Endpoint", () => {prompt: { key: "value" },metadata: { key: "value" },version: "2.0.0",- }+ },);expect(createGeneration.status).toBe(200);@@ -195,7 +195,7 @@ describe("/api/public/generations API Endpoint", () => {expect(dbGeneration?.traceId).toBe(dbTrace[0]?.id);expect(dbGeneration?.name).toBe("generation-name");expect(dbGeneration?.startTime).toEqual(- new Date("2021-01-01T00:00:00.000Z")+ new Date("2021-01-01T00:00:00.000Z"),);expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));expect(dbGeneration?.model).toBe("model-name");@@ -222,7 +222,7 @@ describe("/api/public/generations API Endpoint", () => {prompt: { key: "value" },metadata: { key: "value" },version: "2.0.0",- }+ },);const dbTrace = await prisma.trace.findMany({@@ -245,7 +245,7 @@ describe("/api/public/generations API Endpoint", () => {expect(dbGeneration?.traceId).toBe(dbTrace[0]?.id);expect(dbGeneration?.name).toBe(generationName);expect(dbGeneration?.startTime).toEqual(- new Date("2021-01-01T00:00:00.000Z")+ new Date("2021-01-01T00:00:00.000Z"),);expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));expect(dbGeneration?.model).toBe("model-name");@@ -272,7 +272,7 @@ describe("/api/public/generations API Endpoint", () => {prompt: { key: "value" },metadata: { key: "value" },version: "2.0.0",- }+ },);expect(createGeneration.status).toBe(200);@@ -301,7 +301,7 @@ describe("/api/public/generations API Endpoint", () => {metadata: { key: "value" },version: "2.0.0",parentObservationId: generationId,- }+ },);expect(createGeneration2.status).toBe(200);@@ -335,7 +335,7 @@ describe("/api/public/generations API Endpoint", () => {prompt: { key: "value" },metadata: { key: "value" },version: "2.0.0",- }+ },);const dbTrace = await prisma.trace.findMany({@@ -358,7 +358,7 @@ describe("/api/public/generations API Endpoint", () => {expect(dbGeneration?.traceId).toBe(dbTrace[0]?.id);expect(dbGeneration?.name).toBe(generationName);expect(dbGeneration?.startTime).toEqual(- new Date("2021-01-01T00:00:00.000Z")+ new Date("2021-01-01T00:00:00.000Z"),);expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));expect(dbGeneration?.model).toBe("model-name");@@ -385,7 +385,7 @@ describe("/api/public/generations API Endpoint", () => {prompt: { key: "value" },metadata: { key: "value" },version: "2.0.0",- }+ },);const dbGeneration = await prisma.observation.findFirstOrThrow({@@ -409,7 +409,7 @@ describe("/api/public/generations API Endpoint", () => {expect(dbGeneration?.traceId).toBe(dbTrace[0]?.id);expect(dbGeneration?.name).toBe(generationName);expect(dbGeneration?.startTime).toEqual(- new Date("2021-01-01T00:00:00.000Z")+ new Date("2021-01-01T00:00:00.000Z"),);expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));expect(dbGeneration?.model).toBe("model-name");@@ -436,7 +436,7 @@ describe("/api/public/generations API Endpoint", () => {prompt: { key: "value" },metadata: { key: "value" },version: "2.0.0",- }+ },);expect(createGeneration.status).toBe(200);@@ -447,7 +447,7 @@ describe("/api/public/generations API Endpoint", () => {{generationId: generationId,completion: "this is a great gpt response",- }+ },);expect(updateGeneration.status).toBe(200);@@ -460,7 +460,7 @@ describe("/api/public/generations API Endpoint", () => {expect(dbGeneration?.id).toBe(generationId);expect(dbGeneration?.name).toBe(generationName);expect(dbGeneration?.startTime).toEqual(- new Date("2021-01-01T00:00:00.000Z")+ new Date("2021-01-01T00:00:00.000Z"),);expect(dbGeneration?.endTime).toEqual(new Date("2021-01-01T00:00:00.000Z"));expect(dbGeneration?.model).toBe("model-name");diff --git a/src/components/grouped-score-badge.tsx b/src/components/grouped-score-badge.tsxindex 9db12aa4bf..33bb3447fb 100644--- a/src/components/grouped-score-badge.tsx+++ b/src/components/grouped-score-badge.tsx@@ -5,14 +5,17 @@ export const GroupedScoreBadges = (props: {scores: Score[];inline?: boolean;}) => {- const groupedScores = props.scores.reduce((acc, score) => {- if (!acc[score.name] || !Array.isArray(acc[score.name])) {- acc[score.name] = [score];- } else {- (acc[score.name] as Score[]).push(score);- }- return acc;- }, {} as Record<string, Score[]>);+ const groupedScores = props.scores.reduce(+ (acc, score) => {+ if (!acc[score.name] || !Array.isArray(acc[score.name])) {+ acc[score.name] = [score];+ } else {+ (acc[score.name] as Score[]).push(score);+ }+ return acc;+ },+ {} as Record<string, Score[]>,+ );return (<>@@ -31,7 +34,7 @@ export const GroupedScoreBadges = (props: {>{name}: {scores.map((s) => s.value).join(", ")}</Badge>- )+ ),)}</>);diff --git a/src/components/layouts/layout.tsx b/src/components/layouts/layout.tsxindex dcee58d0a7..d8260b05ce 100644--- a/src/components/layouts/layout.tsx+++ b/src/components/layouts/layout.tsx@@ -40,7 +40,7 @@ export default function Layout(props: PropsWithChildren) {const router = useRouter();const projectId = router.query.projectId as string | undefined;const navigation = ROUTES.filter(- ({ pathname }) => projectId || !pathname.includes("[projectId]")+ ({ pathname }) => projectId || !pathname.includes("[projectId]"),).map(({ pathname, ...rest }) => ({pathname,@@ -179,7 +179,7 @@ export default function Layout(props: PropsWithChildren) {item.current? "bg-gray-50 text-indigo-600": "text-gray-700 hover:bg-gray-50 hover:text-indigo-600",- "group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6"+ "group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6",)}><item.icon@@ -187,7 +187,7 @@ export default function Layout(props: PropsWithChildren) {item.current? "text-indigo-600": "text-gray-400 group-hover:text-indigo-600",- "h-6 w-6 shrink-0"+ "h-6 w-6 shrink-0",)}aria-hidden="true"/>@@ -222,7 +222,7 @@ export default function Layout(props: PropsWithChildren) {projectId === project.id? "bg-gray-50 text-indigo-600": "text-gray-700 hover:bg-gray-50 hover:text-indigo-600",- "group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6"+ "group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6",)}><span@@ -230,7 +230,7 @@ export default function Layout(props: PropsWithChildren) {projectId === project.id? "border-indigo-600 text-indigo-600": "border-gray-200 text-gray-400 group-hover:border-indigo-600 group-hover:text-indigo-600",- "flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border bg-white p-1 text-[0.625rem] font-medium"+ "flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border bg-white p-1 text-[0.625rem] font-medium",)}><Code />@@ -244,7 +244,7 @@ export default function Layout(props: PropsWithChildren) {"whitespace-nowrap break-keep rounded-sm border p-1 text-xs",projectId === project.id? "border-indigo-600 text-indigo-600"- : "border-gray-200 text-gray-400 group-hover:border-indigo-600 group-hover:text-indigo-600"+ : "border-gray-200 text-gray-400 group-hover:border-indigo-600 group-hover:text-indigo-600",)}>view-only@@ -283,7 +283,7 @@ export default function Layout(props: PropsWithChildren) {item.current? "bg-gray-50 text-indigo-600": "text-gray-700 hover:bg-gray-50 hover:text-indigo-600",- "group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6"+ "group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6",)}><item.icon@@ -291,7 +291,7 @@ export default function Layout(props: PropsWithChildren) {item.current? "text-indigo-600": "text-gray-400 group-hover:text-indigo-600",- "h-6 w-6 shrink-0"+ "h-6 w-6 shrink-0",)}aria-hidden="true"/>@@ -327,7 +327,7 @@ export default function Layout(props: PropsWithChildren) {projectId === project.id? "bg-gray-50 text-indigo-600": "text-gray-700 hover:bg-gray-50 hover:text-indigo-600",- "group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6"+ "group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6",)}><span@@ -335,7 +335,7 @@ export default function Layout(props: PropsWithChildren) {projectId === project.id? "border-indigo-600 text-indigo-600": "border-gray-200 text-gray-400 group-hover:border-indigo-600 group-hover:text-indigo-600",- "w-6shrink-0 flex h-6 w-6 items-center justify-center rounded-lg border bg-white p-1 text-[0.625rem] font-medium"+ "w-6shrink-0 flex h-6 w-6 items-center justify-center rounded-lg border bg-white p-1 text-[0.625rem] font-medium",)}><Code />@@ -347,7 +347,7 @@ export default function Layout(props: PropsWithChildren) {"whitespace-nowrap break-keep rounded-sm border p-1 text-xs",projectId === project.id? "border-indigo-600 text-indigo-600"- : "border-gray-200 text-gray-400 group-hover:border-indigo-600 group-hover:text-indigo-600"+ : "border-gray-200 text-gray-400 group-hover:border-indigo-600 group-hover:text-indigo-600",)}>view-only@@ -402,7 +402,7 @@ export default function Layout(props: PropsWithChildren) {onClick={() => void item.onClick()}className={cn(active ? "bg-gray-50" : "",- "block px-3 py-1 text-sm leading-6 text-gray-900"+ "block px-3 py-1 text-sm leading-6 text-gray-900",)}>{item.name}@@ -464,7 +464,7 @@ export default function Layout(props: PropsWithChildren) {onClick={() => void item.onClick()}className={cn(active ? "bg-gray-50" : "",- "block px-3 py-1 text-sm leading-6 text-gray-900"+ "block px-3 py-1 text-sm leading-6 text-gray-900",)}>{item.name}diff --git a/src/components/table/data-table-number-filter.tsx b/src/components/table/data-table-number-filter.tsxindex 81d995f439..d2c7da3f7b 100644--- a/src/components/table/data-table-number-filter.tsx+++ b/src/components/table/data-table-number-filter.tsx@@ -110,7 +110,7 @@ export function DataTableNumberFilter({"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",isSelected? "bg-primary text-primary-foreground"- : "opacity-50 [&_svg]:invisible"+ : "opacity-50 [&_svg]:invisible",)}><Check className={cn("h-4 w-4")} />diff --git a/src/components/table/data-table-select-filter.tsx b/src/components/table/data-table-select-filter.tsxindex 772f7486ec..77a076dd33 100644--- a/src/components/table/data-table-select-filter.tsx+++ b/src/components/table/data-table-select-filter.tsx@@ -96,7 +96,7 @@ export function DataTableSelectFilter({const filterValues = Array.from(selectedValues);meta.updateFunction(- filterValues.length ? filterValues : null+ filterValues.length ? filterValues : null,);}}>@@ -105,7 +105,7 @@ export function DataTableSelectFilter({"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",isSelected? "bg-primary text-primary-foreground"- : "opacity-50 [&_svg]:invisible"+ : "opacity-50 [&_svg]:invisible",)}><Check className={cn("h-4 w-4")} />diff --git a/src/components/table/data-table-toolbar.tsx b/src/components/table/data-table-toolbar.tsxindex 7109233156..7fab80cc29 100644--- a/src/components/table/data-table-toolbar.tsx+++ b/src/components/table/data-table-toolbar.tsx@@ -31,12 +31,12 @@ export function DataTableToolbar<TData, TValue>({isFiltered,}: DataTableToolbarProps<TData, TValue>) {const [searchString, setSearchString] = useState(- searchConfig?.currentQuery ?? ""+ searchConfig?.currentQuery ?? "",);const renderFilter = (column: ColumnDef<TData, TValue>,- columnOptions: TableRowOptions | undefined+ columnOptions: TableRowOptions | undefined,) => {if (!column ||@@ -108,7 +108,8 @@ export function DataTableToolbar<TData, TValue>({? columnDefs.map((column) => {const columnOptions = options.find((o) =>- o.columnId.toLowerCase() === column.meta?.label?.toLowerCase()+ o.columnId.toLowerCase() ===+ column.meta?.label?.toLowerCase(),);return renderFilter(column, columnOptions);})diff --git a/src/components/table/data-table.tsx b/src/components/table/data-table.tsxindex 2a6ecb0af3..9b2116c2a0 100644--- a/src/components/table/data-table.tsx+++ b/src/components/table/data-table.tsx@@ -81,7 +81,7 @@ export function DataTable<TData, TValue>({? null: flexRender(header.column.columnDef.header,- header.getContext()+ header.getContext(),)}</TableHead>);@@ -112,7 +112,7 @@ export function DataTable<TData, TValue>({>{flexRender(cell.column.columnDef.cell,- cell.getContext()+ cell.getContext(),)}</TableCell>))}diff --git a/src/components/table/use-cases/scores.tsx b/src/components/table/use-cases/scores.tsxindex be094bd5bb..ed9ada8fad 100644--- a/src/components/table/use-cases/scores.tsx+++ b/src/components/table/use-cases/scores.tsx@@ -107,7 +107,7 @@ export default function ScoresTable({ projectId, userId }: ScoreTableProps) {];const convertToOptions = (- options: RouterOutput["scores"]["availableFilterOptions"]+ options: RouterOutput["scores"]["availableFilterOptions"],): TableRowOptions[] => {return options.map((o) => {return {diff --git a/src/components/table/use-cases/traces.tsx b/src/components/table/use-cases/traces.tsxindex d2ad377eb3..86bf25e01e 100644--- a/src/components/table/use-cases/traces.tsx+++ b/src/components/table/use-cases/traces.tsx@@ -47,7 +47,7 @@ export default function TracesTable({}: TraceTableProps) {const filters = router.query.filter? (JSON.parse(- decodeURIComponent(router.query.filter as string)+ decodeURIComponent(router.query.filter as string),) as TraceFilterInput): {scores: null,@@ -107,12 +107,12 @@ export default function TracesTable({undefined,{scroll: false,- }+ },);};const convertToTableRow = (- trace: RouterOutput["traces"]["all"][0]+ trace: RouterOutput["traces"]["all"][0],): TraceTableRow => {return {id: trace.id,@@ -131,7 +131,7 @@ export default function TracesTable({};const convertToOptions = (- options: RouterOutput["traces"]["availableFilterOptions"]+ options: RouterOutput["traces"]["availableFilterOptions"],): TableRowOptions[] => {return options.map((o) => {return {@@ -272,7 +272,7 @@ export default function TracesTable({values: queryOptions.metadata,removeSelectedValue: (value: KeyValue) => {const newValues = selectedMetadata.filter(- (v) => v.key !== value.key && v.value !== value.value+ (v) => v.key !== value.key && v.value !== value.value,);setQueryOptions({...queryOptions,@@ -283,7 +283,7 @@ export default function TracesTable({updateFunction: (newValue: KeyValue | null) => {const mergedValues = newValue? selectedMetadata.filter(- (v) => v.key === newValue.key && v.value === newValue.value+ (v) => v.key === newValue.key && v.value === newValue.value,).length > 0? selectedMetadata: selectedMetadata.concat(newValue)diff --git a/src/components/token-usage-badge.tsx b/src/components/token-usage-badge.tsxindex 5ab9f513b2..0ce5a933e0 100644--- a/src/components/token-usage-badge.tsx+++ b/src/components/token-usage-badge.tsx@@ -17,19 +17,18 @@ export const TraceAggUsageBadge = (props: { observations: Observation[] }) => {};export const TokenUsageBadge = (- props:- | (- | {- observation: Observation;- }- | {- promptTokens: number;- completionTokens: number;- totalTokens: number;- }- ) & {- inline?: boolean;+ props: (+ | {+ observation: Observation;}+ | {+ promptTokens: number;+ completionTokens: number;+ totalTokens: number;+ }+ ) & {+ inline?: boolean;+ },) => {const usage ="observation" in propsdiff --git a/src/components/trace/ObservationPreview.tsx b/src/components/trace/ObservationPreview.tsxindex 8746f5a326..5e48996160 100644--- a/src/components/trace/ObservationPreview.tsx+++ b/src/components/trace/ObservationPreview.tsx@@ -26,7 +26,7 @@ export const ObservationPreview = (props: {currentObservationId: string | undefined;}) => {const observation = props.observations.find(- (o) => o.id === props.currentObservationId+ (o) => o.id === props.currentObservationId,);if (!observation) return <div className="flex-1">Not found</div>;return (diff --git a/src/components/trace/ObservationTree.tsx b/src/components/trace/ObservationTree.tsxindex a309f161eb..12ff566e76 100644--- a/src/components/trace/ObservationTree.tsx+++ b/src/components/trace/ObservationTree.tsx@@ -42,7 +42,7 @@ const ObservationTreeTraceNode = (props: {props.currentObservationId === undefined ||props.currentObservationId === ""? "bg-gray-100"- : "hover:bg-gray-50"+ : "hover:bg-gray-50",)}onClick={() => props.setCurrentObservationId(undefined)}>@@ -85,14 +85,14 @@ const ObservationTreeNode = (props: {"group my-1 flex flex-1 cursor-pointer flex-col gap-1 rounded-sm p-2 ",props.currentObservationId === observation.id? "bg-gray-100"- : "hover:bg-gray-50"+ : "hover:bg-gray-50",)}onClick={() => props.setCurrentObservationId(observation.id)}><div className="flex gap-2"><spanclassName={cn(- "self-start rounded-sm bg-gray-200 p-1 text-xs"+ "self-start rounded-sm bg-gray-200 p-1 text-xs",)}>{observation.type}@@ -122,7 +122,7 @@ const ObservationTreeNode = (props: {className={cn("rounded-sm text-xs",LevelColor[observation.level].bg,- LevelColor[observation.level].text+ LevelColor[observation.level].text,)}>{observation.level}@@ -133,7 +133,7 @@ const ObservationTreeNode = (props: {<div className="flex flex-wrap gap-1"><GroupedScoreBadgesscores={props.scores.filter(- (s) => s.observationId === observation.id+ (s) => s.observationId === observation.id,)}/></div>diff --git a/src/components/trace/index.tsx b/src/components/trace/index.tsxindex 822f6512f4..055f6b9930 100644--- a/src/components/trace/index.tsx+++ b/src/components/trace/index.tsx@@ -26,7 +26,7 @@ export function Trace(props: {undefined,{scroll: false,- }+ },);};diff --git a/src/components/ui/alert.tsx b/src/components/ui/alert.tsxindex 6972ae7405..68cb27c186 100644--- a/src/components/ui/alert.tsx+++ b/src/components/ui/alert.tsx@@ -1,7 +1,7 @@-import * as React from "react"-import { cva, type VariantProps } from "class-variance-authority"+import * as React from "react";+import { cva, type VariantProps } from "class-variance-authority";-import { cn } from "@/src/utils/tailwind"+import { cn } from "@/src/utils/tailwind";const alertVariants = cva("relative w-full rounded-lg border p-4 [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",@@ -16,8 +16,8 @@ const alertVariants = cva(defaultVariants: {variant: "default",},- }-)+ },+);const Alert = React.forwardRef<HTMLDivElement,@@ -29,8 +29,8 @@ const Alert = React.forwardRef<className={cn(alertVariants({ variant }), className)}{...props}/>-))-Alert.displayName = "Alert"+));+Alert.displayName = "Alert";const AlertTitle = React.forwardRef<HTMLParagraphElement,@@ -41,8 +41,8 @@ const AlertTitle = React.forwardRef<className={cn("mb-1 font-medium leading-none tracking-tight", className)}{...props}/>-))-AlertTitle.displayName = "AlertTitle"+));+AlertTitle.displayName = "AlertTitle";const AlertDescription = React.forwardRef<HTMLParagraphElement,@@ -53,7 +53,7 @@ const AlertDescription = React.forwardRef<className={cn("text-sm [&_p]:leading-relaxed", className)}{...props}/>-))-AlertDescription.displayName = "AlertDescription"+));+AlertDescription.displayName = "AlertDescription";-export { Alert, AlertTitle, AlertDescription }+export { Alert, AlertTitle, AlertDescription };diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsxindex 258424f502..0b25df5d19 100644--- a/src/components/ui/avatar.tsx+++ b/src/components/ui/avatar.tsx@@ -12,7 +12,7 @@ const Avatar = React.forwardRef<ref={ref}className={cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",- className+ className,)}{...props}/>@@ -39,7 +39,7 @@ const AvatarFallback = React.forwardRef<ref={ref}className={cn("flex h-full w-full items-center justify-center rounded-full bg-muted",- className+ className,)}{...props}/>diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsxindex 1e221be8dd..4c9a1e8ce8 100644--- a/src/components/ui/badge.tsx+++ b/src/components/ui/badge.tsx@@ -20,7 +20,7 @@ const badgeVariants = cva(defaultVariants: {variant: "default",},- }+ },);export interface BadgePropsdiff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsxindex 8171316b41..f4b30057bb 100644--- a/src/components/ui/button.tsx+++ b/src/components/ui/button.tsx@@ -32,7 +32,7 @@ const buttonVariants = cva(variant: "default",size: "default",},- }+ },);export interface ButtonProps@@ -55,7 +55,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(children,...props},- ref+ ref,) => {const Comp = asChild ? Slot : "button";return (@@ -69,7 +69,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>({loading ? <Spinner /> : children}</Comp>);- }+ },);Button.displayName = "Button";diff --git a/src/components/ui/card.tsx b/src/components/ui/card.tsxindex e81de2e867..ee8bfa1a6f 100644--- a/src/components/ui/card.tsx+++ b/src/components/ui/card.tsx@@ -11,7 +11,7 @@ const Card = React.forwardRef<ref={ref}className={cn("rounded-lg border bg-card text-card-foreground shadow-sm",- className+ className,)}{...props}/>@@ -38,7 +38,7 @@ const CardTitle = React.forwardRef<ref={ref}className={cn("text-lg font-semibold leading-none tracking-tight",- className+ className,)}{...props}/>diff --git a/src/components/ui/code.tsx b/src/components/ui/code.tsxindex 15900b6590..16b7d90215 100644--- a/src/components/ui/code.tsx+++ b/src/components/ui/code.tsx@@ -49,7 +49,7 @@ const parseJsonInput = (jsonIn: unknown): string => {) {return (jsonIn as { role: string; content: string }[]).map(- (message) => `${message.role.toUpperCase()}\n\n${message.content}`+ (message) => `${message.role.toUpperCase()}\n\n${message.content}`,).join("\n\n------\n\n");}@@ -112,7 +112,7 @@ export function CodeView(props: {className={cn("relative flex-1 whitespace-pre-wrap break-all px-4 py-3 font-mono text-xs",isCollapsed ? `line-clamp-6` : "block",- props.scrollable ? "max-h-60 overflow-y-scroll" : undefined+ props.scrollable ? "max-h-60 overflow-y-scroll" : undefined,)}>{props.content}diff --git a/src/components/ui/command.tsx b/src/components/ui/command.tsxindex 3d67a50df9..98b756a994 100644--- a/src/components/ui/command.tsx+++ b/src/components/ui/command.tsx@@ -16,7 +16,7 @@ const Command = React.forwardRef<ref={ref}className={cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",- className+ className,)}{...props}/>@@ -47,7 +47,7 @@ const CommandInput = React.forwardRef<ref={ref}className={cn("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",- className+ className,)}{...props}/>@@ -90,7 +90,7 @@ const CommandGroup = React.forwardRef<ref={ref}className={cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",- className+ className,)}{...props}/>@@ -118,7 +118,7 @@ const CommandItem = React.forwardRef<ref={ref}className={cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",- className+ className,)}{...props}/>@@ -134,7 +134,7 @@ const CommandShortcut = ({<spanclassName={cn("ml-auto text-xs tracking-widest text-muted-foreground",- className+ className,)}{...props}/>diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsxindex e48152e523..714bc74b2c 100644--- a/src/components/ui/dialog.tsx+++ b/src/components/ui/dialog.tsx@@ -30,7 +30,7 @@ const DialogOverlay = React.forwardRef<ref={ref}className={cn("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in",- className+ className,)}{...props}/>@@ -47,7 +47,7 @@ const DialogContent = React.forwardRef<ref={ref}className={cn("fixed z-50 grid w-full gap-4 overflow-hidden rounded-b-lg border bg-background p-6 shadow-lg animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",- className+ className,)}{...props}>@@ -68,7 +68,7 @@ const DialogHeader = ({<divclassName={cn("flex flex-col space-y-1.5 text-center sm:text-left",- className+ className,)}{...props}/>@@ -82,7 +82,7 @@ const DialogFooter = ({<divclassName={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",- className+ className,)}{...props}/>@@ -97,7 +97,7 @@ const DialogTitle = React.forwardRef<ref={ref}className={cn("text-lg font-semibold leading-none tracking-tight",- className+ className,)}{...props}/>diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsxindex efbf4075e3..11da9b26fd 100644--- a/src/components/ui/dropdown-menu.tsx+++ b/src/components/ui/dropdown-menu.tsx@@ -29,7 +29,7 @@ const DropdownMenuSubTrigger = React.forwardRef<className={cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",inset && "pl-8",- className+ className,)}{...props}>@@ -48,7 +48,7 @@ const DropdownMenuSubContent = React.forwardRef<ref={ref}className={cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",- className+ className,)}{...props}/>@@ -66,7 +66,7 @@ const DropdownMenuContent = React.forwardRef<sideOffset={sideOffset}className={cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",- className+ className,)}{...props}/>@@ -85,7 +85,7 @@ const DropdownMenuItem = React.forwardRef<className={cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",inset && "pl-8",- className+ className,)}{...props}/>@@ -100,7 +100,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<ref={ref}className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",- className+ className,)}checked={checked}{...props}@@ -124,7 +124,7 @@ const DropdownMenuRadioItem = React.forwardRef<ref={ref}className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",- className+ className,)}{...props}>@@ -149,7 +149,7 @@ const DropdownMenuLabel = React.forwardRef<className={cn("px-2 py-1.5 text-sm font-semibold",inset && "pl-8",- className+ className,)}{...props}/>diff --git a/src/components/ui/form.tsx b/src/components/ui/form.tsxindex c2ca9b5e56..22c0ec391f 100644--- a/src/components/ui/form.tsx+++ b/src/components/ui/form.tsx@@ -18,18 +18,18 @@ const Form = FormProvider;type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues,- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,> = {name: TName;};const FormFieldContext = React.createContext<FormFieldContextValue>(- {} as FormFieldContextValue+ {} as FormFieldContextValue,);const FormField = <TFieldValues extends FieldValues = FieldValues,- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,>({...props}: ControllerProps<TFieldValues, TName>) => {@@ -68,7 +68,7 @@ type FormItemContextValue = {};const FormItemContext = React.createContext<FormItemContextValue>(- {} as FormItemContextValue+ {} as FormItemContextValue,);const FormItem = React.forwardRef<diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsxindex 3f287fe320..d68e244c3f 100644--- a/src/components/ui/input.tsx+++ b/src/components/ui/input.tsx@@ -10,13 +10,13 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(type={type}className={cn("flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",- className+ className,)}ref={ref}{...props}/>);- }+ },);Input.displayName = "Input";diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsxindex a175c3729e..6149b605f3 100644--- a/src/components/ui/label.tsx+++ b/src/components/ui/label.tsx@@ -6,7 +6,7 @@ import { cva, type VariantProps } from "class-variance-authority";import { cn } from "@/src/utils/tailwind";const labelVariants = cva(- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",);const Label = React.forwardRef<diff --git a/src/components/ui/popover.tsx b/src/components/ui/popover.tsxindex 15a773eb0f..f8f72aed42 100644--- a/src/components/ui/popover.tsx+++ b/src/components/ui/popover.tsx@@ -20,7 +20,7 @@ const PopoverContent = React.forwardRef<sideOffset={sideOffset}className={cn("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",- className+ className,)}{...props}/>diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsxindex f0a260c87f..c8941df4e0 100644--- a/src/components/ui/select.tsx+++ b/src/components/ui/select.tsx@@ -20,7 +20,7 @@ const SelectTrigger = React.forwardRef<ref={ref}className={cn("flex h-10 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",- className+ className,)}{...props}>@@ -42,7 +42,7 @@ const SelectContent = React.forwardRef<className={cn("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-80",position === "popper" && "translate-y-1",- className+ className,)}position={position}{...props}@@ -51,7 +51,7 @@ const SelectContent = React.forwardRef<className={cn("p-1",position === "popper" &&- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",)}>{children}@@ -81,7 +81,7 @@ const SelectItem = React.forwardRef<ref={ref}className={cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",- className+ className,)}{...props}>diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsxindex 3021f03267..5efc2e4535 100644--- a/src/components/ui/separator.tsx+++ b/src/components/ui/separator.tsx@@ -11,7 +11,7 @@ const Separator = React.forwardRef<>(({ className, orientation = "horizontal", decorative = true, ...props },- ref+ ref,) => (<SeparatorPrimitive.Rootref={ref}@@ -20,11 +20,11 @@ const Separator = React.forwardRef<className={cn("shrink-0 bg-border",orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",- className+ className,)}{...props}/>- )+ ),);Separator.displayName = SeparatorPrimitive.Root.displayName;diff --git a/src/components/ui/slider.tsx b/src/components/ui/slider.tsxindex 2dc9319450..b2816f3c93 100644--- a/src/components/ui/slider.tsx+++ b/src/components/ui/slider.tsx@@ -1,9 +1,9 @@-"use client"+"use client";-import * as React from "react"-import * as SliderPrimitive from "@radix-ui/react-slider"+import * as React from "react";+import * as SliderPrimitive from "@radix-ui/react-slider";-import { cn } from "@/src/utils/tailwind"+import { cn } from "@/src/utils/tailwind";const Slider = React.forwardRef<React.ElementRef<typeof SliderPrimitive.Root>,@@ -13,7 +13,7 @@ const Slider = React.forwardRef<ref={ref}className={cn("relative flex w-full touch-none select-none items-center",- className+ className,)}{...props}>@@ -22,7 +22,7 @@ const Slider = React.forwardRef<</SliderPrimitive.Track><SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" /></SliderPrimitive.Root>-))-Slider.displayName = SliderPrimitive.Root.displayName+));+Slider.displayName = SliderPrimitive.Root.displayName;-export { Slider }+export { Slider };diff --git a/src/components/ui/table.tsx b/src/components/ui/table.tsxindex 01bc03dbd8..0bb4315a27 100644--- a/src/components/ui/table.tsx+++ b/src/components/ui/table.tsx@@ -55,7 +55,7 @@ const TableRow = React.forwardRef<ref={ref}className={cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",- className+ className,)}{...props}/>@@ -70,7 +70,7 @@ const TableHead = React.forwardRef<ref={ref}className={cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",- className+ className,)}{...props}/>diff --git a/src/components/ui/tabs.tsx b/src/components/ui/tabs.tsxindex e55e8969fa..810ac1acfc 100644--- a/src/components/ui/tabs.tsx+++ b/src/components/ui/tabs.tsx@@ -14,7 +14,7 @@ const TabsList = React.forwardRef<ref={ref}className={cn("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",- className+ className,)}{...props}/>@@ -29,7 +29,7 @@ const TabsTrigger = React.forwardRef<ref={ref}className={cn("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",- className+ className,)}{...props}/>@@ -44,7 +44,7 @@ const TabsContent = React.forwardRef<ref={ref}className={cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",- className+ className,)}{...props}/>diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsxindex da18ed18c1..4be21d8399 100644--- a/src/components/ui/textarea.tsx+++ b/src/components/ui/textarea.tsx@@ -12,13 +12,13 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(<textareaclassName={cn("flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",- className+ className,)}ref={ref}{...props}/>);- }+ },);Textarea.displayName = "Textarea";diff --git a/src/env.mjs b/src/env.mjsindex 376216bd06..c589db92df 100644--- a/src/env.mjs+++ b/src/env.mjs@@ -22,7 +22,7 @@ export const env = createEnv({? process.env.VERCEL_URL: str,// VERCEL_URL doesn't include `https` so it can't be validated as a URL- process.env.VERCEL ? z.string().min(1) : z.string().url()+ process.env.VERCEL ? z.string().min(1) : z.string().url(),),// Add `.min(1) on ID and SECRET if you want to make sure they're not empty},diff --git a/src/features/auth/lib/emailPassword.ts b/src/features/auth/lib/emailPassword.tsindex 21f3dc884b..e7c93c8ee5 100644--- a/src/features/auth/lib/emailPassword.ts+++ b/src/features/auth/lib/emailPassword.ts@@ -14,7 +14,7 @@ import { compare, hash } from "bcryptjs";export async function createUserEmailPassword(email: string,password: string,- name: string+ name: string,) {if (!isValidPassword(password))throw new Error("Password needs to be at least 8 characters long.");diff --git a/src/features/dashboard/components/BaseTimeSeriesChart.tsx b/src/features/dashboard/components/BaseTimeSeriesChart.tsxindex 270013fd05..0f95850f4d 100644--- a/src/features/dashboard/components/BaseTimeSeriesChart.tsx+++ b/src/features/dashboard/components/BaseTimeSeriesChart.tsx@@ -8,13 +8,13 @@ export function BaseTimeSeriesChart(props: {connectNulls?: boolean;}) {const labels = new Set(- props.data.flatMap((d) => d.values.map((v) => v.label))+ props.data.flatMap((d) => d.values.map((v) => v.label)),);type ChartInput = { timestamp: string } & { [key: string]: number };function transformArray(- array: { ts: number; values: { label: string; value: number }[] }[]+ array: { ts: number; values: { label: string; value: number }[] }[],): ChartInput[] {return array.map((item) => {const outputObject: ChartInput = {diff --git a/src/features/dashboard/components/charts.tsx b/src/features/dashboard/components/charts.tsxindex f7e087db47..548e930f35 100644--- a/src/features/dashboard/components/charts.tsx+++ b/src/features/dashboard/components/charts.tsx@@ -172,7 +172,7 @@ export function ChartUsage(props: {filteredData.map((row) => ({ts: row.ts,values: Object.entries(row.values ?? []).map(- ([label, value]) => ({ label, value })+ ([label, value]) => ({ label, value }),),})) ?? []}diff --git a/src/features/dashboard/server/dashboardRouter.ts b/src/features/dashboard/server/dashboardRouter.tsindex a81abb142a..a7520cbe60 100644--- a/src/features/dashboard/server/dashboardRouter.ts+++ b/src/features/dashboard/server/dashboardRouter.ts@@ -15,7 +15,7 @@ export const dashboardRouter = createTRPCRouter({z.object({projectId: z.string(),agg: z.enum(dateTimeAggregationOptions),- })+ }),).query(async ({ input, ctx }) => {// queryRawUnsafe to add input.agg to the WHERE clause@@ -80,7 +80,7 @@ export const dashboardRouter = createTRPCRouter({z.object({projectId: z.string(),agg: z.enum(dateTimeAggregationOptions),- })+ }),).query(async ({ input, ctx }) => {// queryRawUnsafe to add input.agg to the WHERE clause@@ -139,7 +139,7 @@ export const dashboardRouter = createTRPCRouter({z.object({projectId: z.string(),agg: z.enum(dateTimeAggregationOptions),- })+ }),).query(async ({ input, ctx }) => {// queryRawUnsafe to add input.agg to the WHERE clause@@ -206,7 +206,7 @@ export const dashboardRouter = createTRPCRouter({z.object({projectId: z.string(),agg: z.enum(dateTimeAggregationOptions),- })+ }),).query(async ({ input, ctx }) => {const output = await ctx.prisma.$queryRawUnsafe<diff --git a/src/features/feedback/component/FeedbackButton.tsx b/src/features/feedback/component/FeedbackButton.tsxindex dd67ef522d..931833287f 100644--- a/src/features/feedback/component/FeedbackButton.tsx+++ b/src/features/feedback/component/FeedbackButton.tsx@@ -27,7 +27,7 @@ const formSchema = z.object({});export function FeedbackButtonWrapper(- props: PropsWithChildren<{ className?: string }>+ props: PropsWithChildren<{ className?: string }>,) {const [open, setOpen] = useState(false);const session = useSession();diff --git a/src/features/feedback/server/corsMiddleware.ts b/src/features/feedback/server/corsMiddleware.tsindex ce2ebdf45e..5e5fa78a88 100644--- a/src/features/feedback/server/corsMiddleware.ts+++ b/src/features/feedback/server/corsMiddleware.ts@@ -11,7 +11,7 @@ const cors = Cors({// And to throw an error when an error happens in a middlewareexport function runFeedbackCorsMiddleware(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {return new Promise((resolve, reject) => {cors(req, res, (result: unknown) => {diff --git a/src/features/feedback/server/feedbackHandler.ts b/src/features/feedback/server/feedbackHandler.tsindex 49a81fba97..6b53818d6e 100644--- a/src/features/feedback/server/feedbackHandler.ts+++ b/src/features/feedback/server/feedbackHandler.ts@@ -4,7 +4,7 @@ import { type NextApiRequest, type NextApiResponse } from "next";// Collects feedack from users that do not use the cloud version of the appexport default async function feedbackApiHandler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runFeedbackCorsMiddleware(req, res);diff --git a/src/features/ingest/lib/usage.ts b/src/features/ingest/lib/usage.tsindex 70bc964af6..a6bc8eca75 100644--- a/src/features/ingest/lib/usage.ts+++ b/src/features/ingest/lib/usage.ts@@ -36,7 +36,7 @@ export function calculateTokenCost(totalTokens: Decimal;promptTokens: Decimal;completionTokens: Decimal;- }+ },): Decimal | undefined {const pricing = pricingList.filter((p) => p.modelName === input.model);@@ -54,7 +54,7 @@ export function calculateTokenCost(const promptPricing = pricing.find((p) => p.tokenType === "PROMPT");const completionPricing = pricing.find(- (p) => p.tokenType === "COMPLETION"+ (p) => p.tokenType === "COMPLETION",);if (promptPricing) {@@ -64,7 +64,7 @@ export function calculateTokenCost(if (completionPricing) {completionPrice = calculateValue(completionPricing.price,- input.completionTokens+ input.completionTokens,);}diff --git a/src/features/manualScoring/components/index.tsx b/src/features/manualScoring/components/index.tsxindex aa8eec17f5..8cc6b3111f 100644--- a/src/features/manualScoring/components/index.tsx+++ b/src/features/manualScoring/components/index.tsx@@ -56,7 +56,7 @@ export function ManualScoreButton({s.traceId === traceId &&(observationId !== undefined? s.observationId === observationId- : s.observationId === null)+ : s.observationId === null),);const utils = api.useContext();diff --git a/src/features/projects/components/NewProjectButton.tsx b/src/features/projects/components/NewProjectButton.tsxindex 27b8567c01..b5c14ae5db 100644--- a/src/features/projects/components/NewProjectButton.tsx+++ b/src/features/projects/components/NewProjectButton.tsx@@ -75,7 +75,7 @@ export function NewProjectButton({ size = "default" }: NewProjectButtonProps) {<PlusIconclassName={cn("-ml-0.5 mr-1.5",- size === "xs" ? "h-4 w-4" : "h-5 w-5"+ size === "xs" ? "h-4 w-4" : "h-5 w-5",)}aria-hidden="true"/>diff --git a/src/features/projects/server/projectsRouter.ts b/src/features/projects/server/projectsRouter.tsindex f5b5d38e1a..7b6d7aad60 100644--- a/src/features/projects/server/projectsRouter.ts+++ b/src/features/projects/server/projectsRouter.ts@@ -23,7 +23,7 @@ export const projectsRouter = createTRPCRouter({.input(z.object({name: z.string(),- })+ }),).mutation(async ({ input, ctx }) => {const project = await ctx.prisma.project.create({diff --git a/src/features/publicApi/server/apiScope.ts b/src/features/publicApi/server/apiScope.tsindex 03ff0b6139..149521434d 100644--- a/src/features/publicApi/server/apiScope.ts+++ b/src/features/publicApi/server/apiScope.ts@@ -9,7 +9,7 @@ type Resource = {export async function checkApiAccessScope(scope: ApiAccessScope,resources: Resource[],- action?: "score"+ action?: "score",): Promise<boolean> {// ACCESS LEVEL// If the access level is "scores", the only action allowed is "score"@@ -18,7 +18,7 @@ export async function checkApiAccessScope(// RESOURCE within project of scope// If the resource is a project, it must match the project of the scopeconst checks = await Promise.all(- resources.map((resource) => isResourceInProject(resource, scope.projectId))+ resources.map((resource) => isResourceInProject(resource, scope.projectId)),);return checks.every((result) => result);}@@ -50,7 +50,7 @@ async function isResourceInProject(resource: Resource, projectId: string) {"observation check",observationCheck,resource.id,- projectId+ projectId,);return observationCheck;diff --git a/src/features/publicApi/server/cors.ts b/src/features/publicApi/server/cors.tsindex f33f42747f..5684ab2857 100644--- a/src/features/publicApi/server/cors.ts+++ b/src/features/publicApi/server/cors.ts@@ -5,7 +5,7 @@ export function runMiddleware(req: NextApiRequest,res: NextApiResponse,// eslint-disable-next-line @typescript-eslint/ban-types- fn: Function+ fn: Function,) {return new Promise((resolve, reject) => {fn(req, res, (result: unknown) => {diff --git a/src/features/rbac/components/ProjectMembersTable.tsx b/src/features/rbac/components/ProjectMembersTable.tsxindex 6bc951c512..fe454d0ff7 100644--- a/src/features/rbac/components/ProjectMembersTable.tsx+++ b/src/features/rbac/components/ProjectMembersTable.tsx@@ -30,7 +30,7 @@ export function ProjectMembersTable({ projectId }: { projectId: string }) {},{enabled: hasReadAccess,- }+ },);const mutDeleteMembership = api.projectMembers.delete.useMutation({onSuccess: () => utils.projectMembers.invalidate(),diff --git a/src/features/rbac/server/projectMembersRouter.ts b/src/features/rbac/server/projectMembersRouter.tsindex d4e4219c48..4dda3c2d39 100644--- a/src/features/rbac/server/projectMembersRouter.ts+++ b/src/features/rbac/server/projectMembersRouter.ts@@ -8,7 +8,7 @@ export const projectMembersRouter = createTRPCRouter({.input(z.object({projectId: z.string(),- })+ }),).query(async ({ input, ctx }) => {throwIfNoAccess({@@ -44,7 +44,7 @@ export const projectMembersRouter = createTRPCRouter({z.object({projectId: z.string(),userId: z.string(),- })+ }),).mutation(async ({ input, ctx }) => {throwIfNoAccess({@@ -77,7 +77,7 @@ export const projectMembersRouter = createTRPCRouter({MembershipRole.MEMBER,MembershipRole.VIEWER,]),- })+ }),).mutation(async ({ input, ctx }) => {throwIfNoAccess({diff --git a/src/features/rbac/utils/checkAccess.ts b/src/features/rbac/utils/checkAccess.tsindex 3f9e2531de..efc3f07eee 100644--- a/src/features/rbac/utils/checkAccess.ts+++ b/src/features/rbac/utils/checkAccess.ts@@ -36,7 +36,7 @@ function hasAccess(p: HasAccessParams): boolean {: "data" in p.session? // SessionContextValuep.session.data?.user?.projects.find(- (project) => project.id === p.projectId+ (project) => project.id === p.projectId,)?.role: // Sessionp.session.user?.projects.find((project) => project.id === p.projectId)diff --git a/src/pages/api/auth/signup.ts b/src/pages/api/auth/signup.tsindex 96af540873..c6ecf71eef 100644--- a/src/pages/api/auth/signup.ts+++ b/src/pages/api/auth/signup.ts@@ -4,7 +4,7 @@ import type { NextApiRequest, NextApiResponse } from "next";export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {if (req.method !== "POST") return;@@ -27,7 +27,7 @@ export default async function handler("Signup: Error creating user",error.message,body.email,- body.name+ body.name,);res.status(422).json({ message: error.message });}diff --git a/src/pages/api/public/events.ts b/src/pages/api/public/events.tsindex 40ff2f4bf5..c55aa618d7 100644--- a/src/pages/api/public/events.ts+++ b/src/pages/api/public/events.ts@@ -23,7 +23,7 @@ const ObservationSchema = z.object({export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runMiddleware(req, res, cors);@@ -33,7 +33,7 @@ export default async function handler(// CHECK AUTHconst authCheck = await verifyAuthHeaderAndReturnScope(- req.headers.authorization+ req.headers.authorization,);if (!authCheck.validKey)return res.status(401).json({@@ -46,7 +46,7 @@ export default async function handler("trying to create observation for event, project ",authCheck.scope.projectId,", body:",- JSON.stringify(req.body, null, 2)+ JSON.stringify(req.body, null, 2),);try {diff --git a/src/pages/api/public/generations.ts b/src/pages/api/public/generations.tsindex 3d106ba1cf..cc190aa371 100644--- a/src/pages/api/public/generations.ts+++ b/src/pages/api/public/generations.ts@@ -19,7 +19,7 @@ export const GenerationsCreateSchema = z.object({modelParameters: z.record(z.string(),- z.union([z.string(), z.number(), z.boolean()]).nullish()+ z.union([z.string(), z.number(), z.boolean()]).nullish(),).nullish(),prompt: z.unknown().nullish(),@@ -48,7 +48,7 @@ const GenerationPatchSchema = z.object({modelParameters: z.record(z.string(),- z.union([z.string(), z.number(), z.boolean()]).nullish()+ z.union([z.string(), z.number(), z.boolean()]).nullish(),).nullish(),prompt: z.unknown().nullish(),@@ -68,13 +68,13 @@ const GenerationPatchSchema = z.object({export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runMiddleware(req, res, cors);// CHECK AUTHconst authCheck = await verifyAuthHeaderAndReturnScope(- req.headers.authorization+ req.headers.authorization,);if (!authCheck.validKey)return res.status(401).json({@@ -89,7 +89,7 @@ export default async function handler("trying to create observation for generation, project ",authCheck.scope.projectId,", body:",- JSON.stringify(req.body, null, 2)+ JSON.stringify(req.body, null, 2),);const obj = GenerationsCreateSchema.parse(req.body);const {@@ -170,7 +170,7 @@ export default async function handler(});if (observationWithSameId > 0)throw new Error(- "Observation with same id already exists in another project"+ "Observation with same id already exists in another project",);const newObservation = await prisma.observation.upsert({@@ -244,7 +244,7 @@ export default async function handler("trying to update observation for generation, project ",authCheck.scope.projectId,", body:",- JSON.stringify(req.body, null, 2)+ JSON.stringify(req.body, null, 2),);try {@@ -306,7 +306,7 @@ export default async function handler(});if (observationWithSameId > 0)throw new Error(- "Observation with same id already exists in another project"+ "Observation with same id already exists in another project",);const newObservation = await prisma.observation.upsert({@@ -329,8 +329,8 @@ export default async function handler(model: model ?? undefined,...Object.fromEntries(Object.entries(otherFields).filter(- ([_, v]) => v !== null && v !== undefined- )+ ([_, v]) => v !== null && v !== undefined,+ ),),projectId: authCheck.scope.projectId,},@@ -348,8 +348,8 @@ export default async function handler(model: model ?? undefined,...Object.fromEntries(Object.entries(otherFields).filter(- ([_, v]) => v !== null && v !== undefined- )+ ([_, v]) => v !== null && v !== undefined,+ ),),},});diff --git a/src/pages/api/public/health.ts b/src/pages/api/public/health.tsindex adb2db758e..bc4b7f316f 100644--- a/src/pages/api/public/health.ts+++ b/src/pages/api/public/health.ts@@ -4,7 +4,7 @@ import { type NextApiRequest, type NextApiResponse } from "next";export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runMiddleware(req, res, cors);try {diff --git a/src/pages/api/public/observations/[observationId].ts b/src/pages/api/public/observations/[observationId].tsindex 965b8772d6..85831873e6 100644--- a/src/pages/api/public/observations/[observationId].ts+++ b/src/pages/api/public/observations/[observationId].ts@@ -10,7 +10,7 @@ const GetObservationSchema = z.object({export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runMiddleware(req, res, cors);@@ -21,7 +21,7 @@ export default async function handler(// CHECK AUTHconst authCheck = await verifyAuthHeaderAndReturnScope(- req.headers.authorization+ req.headers.authorization,);if (!authCheck.validKey)return res.status(401).json({diff --git a/src/pages/api/public/scores.ts b/src/pages/api/public/scores.tsindex fc483a15b4..7431f08646 100644--- a/src/pages/api/public/scores.ts+++ b/src/pages/api/public/scores.ts@@ -25,13 +25,13 @@ const ScoresGetSchema = z.object({export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runMiddleware(req, res, cors);// CHECK AUTHconst authCheck = await verifyAuthHeaderAndReturnScope(- req.headers.authorization+ req.headers.authorization,);if (!authCheck.validKey)return res.status(401).json({@@ -46,7 +46,7 @@ export default async function handler("trying to create score, project ",authCheck.scope.projectId,", body:",- JSON.stringify(req.body, null, 2)+ JSON.stringify(req.body, null, 2),);const obj = ScoreCreateSchema.parse(req.body);@@ -75,7 +75,7 @@ export default async function handler(? [{ type: "observation" as const, id: obj.observationId }]: []),],- "score"+ "score",);if (!accessCheck)return res.status(403).json({diff --git a/src/pages/api/public/spans.ts b/src/pages/api/public/spans.tsindex 90ceb7e376..e25dfe70de 100644--- a/src/pages/api/public/spans.ts+++ b/src/pages/api/public/spans.ts@@ -37,13 +37,13 @@ const SpanPatchSchema = z.object({export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runMiddleware(req, res, cors);// CHECK AUTHconst authCheck = await verifyAuthHeaderAndReturnScope(- req.headers.authorization+ req.headers.authorization,);if (!authCheck.validKey)return res.status(401).json({@@ -58,7 +58,7 @@ export default async function handler("Trying to generate span, project ",authCheck.scope.projectId,", body:",- JSON.stringify(req.body, null, 2)+ JSON.stringify(req.body, null, 2),);const obj = SpanPostSchema.parse(req.body);const {@@ -118,7 +118,7 @@ export default async function handler(});if (observationWithSameId > 0)throw new Error(- "Observation with same id already exists in another project"+ "Observation with same id already exists in another project",);const newObservation = await prisma.observation.upsert({@@ -174,7 +174,7 @@ export default async function handler("Trying to update span, project ",authCheck.scope.projectId,", body:",- JSON.stringify(req.body, null, 2)+ JSON.stringify(req.body, null, 2),);const { spanId, endTime, ...fields } = SpanPatchSchema.parse(req.body);@@ -190,7 +190,7 @@ export default async function handler(});if (observationWithSameId > 0)throw new Error(- "Observation with same id already exists in another project"+ "Observation with same id already exists in another project",);const newObservation = await prisma.observation.upsert({@@ -203,8 +203,8 @@ export default async function handler(endTime: endTime ? new Date(endTime) : undefined,...Object.fromEntries(Object.entries(fields).filter(- ([_, v]) => v !== null && v !== undefined- )+ ([_, v]) => v !== null && v !== undefined,+ ),),projectId: authCheck.scope.projectId,},@@ -212,8 +212,8 @@ export default async function handler(endTime: endTime ? new Date(endTime) : undefined,...Object.fromEntries(Object.entries(fields).filter(- ([_, v]) => v !== null && v !== undefined- )+ ([_, v]) => v !== null && v !== undefined,+ ),),},});diff --git a/src/pages/api/public/traces.ts b/src/pages/api/public/traces.tsindex 0b7b39cf7a..a64d553576 100644--- a/src/pages/api/public/traces.ts+++ b/src/pages/api/public/traces.ts@@ -25,13 +25,13 @@ const GetTracesSchema = z.object({export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runMiddleware(req, res, cors);// CHECK AUTHconst authCheck = await verifyAuthHeaderAndReturnScope(- req.headers.authorization+ req.headers.authorization,);if (!authCheck.validKey)return res.status(401).json({@@ -46,7 +46,7 @@ export default async function handler("Trying to create trace, project ",authCheck.scope.projectId,", body:",- JSON.stringify(req.body, null, 2)+ JSON.stringify(req.body, null, 2),);const { id, name, metadata, externalId, userId, release, version } =diff --git a/src/pages/api/public/traces/[traceId].ts b/src/pages/api/public/traces/[traceId].tsindex 0af07f9bae..0ea1348f8b 100644--- a/src/pages/api/public/traces/[traceId].ts+++ b/src/pages/api/public/traces/[traceId].ts@@ -10,7 +10,7 @@ const GetTraceSchema = z.object({export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runMiddleware(req, res, cors);@@ -21,7 +21,7 @@ export default async function handler(// CHECK AUTHconst authCheck = await verifyAuthHeaderAndReturnScope(- req.headers.authorization+ req.headers.authorization,);if (!authCheck.validKey)return res.status(401).json({diff --git a/src/pages/api/public/users.ts b/src/pages/api/public/users.tsindex 95362044e9..1fdd515daa 100644--- a/src/pages/api/public/users.ts+++ b/src/pages/api/public/users.ts@@ -11,13 +11,13 @@ const GetUsersSchema = z.object({export default async function handler(req: NextApiRequest,- res: NextApiResponse+ res: NextApiResponse,) {await runMiddleware(req, res, cors);// CHECK AUTHconst authCheck = await verifyAuthHeaderAndReturnScope(- req.headers.authorization+ req.headers.authorization,);if (!authCheck.validKey)return res.status(401).json({diff --git a/src/pages/api/trpc/[trpc].ts b/src/pages/api/trpc/[trpc].tsindex 85bcefda33..32ad100b6b 100644--- a/src/pages/api/trpc/[trpc].ts+++ b/src/pages/api/trpc/[trpc].ts@@ -12,7 +12,7 @@ export default createNextApiHandler({env.NODE_ENV === "development"? ({ path, error }) => {console.error(- `❌ tRPC failed on ${path ?? "<no-path>"}: ${error.message}`+ `❌ tRPC failed on ${path ?? "<no-path>"}: ${error.message}`,);}: undefined,diff --git a/src/pages/index.tsx b/src/pages/index.tsxindex 08851ebb18..7bfc8df0dc 100644--- a/src/pages/index.tsx+++ b/src/pages/index.tsx@@ -34,9 +34,9 @@ export default function GetStartedPage() {`/project/${// eslint-disable-next-line @typescript-eslint/no-non-null-assertionprojects.data.filter(- (p) => p.id !== env.NEXT_PUBLIC_DEMO_PROJECT_ID+ (p) => p.id !== env.NEXT_PUBLIC_DEMO_PROJECT_ID,)[0]!.id- }`+ }`,);else setLoading(false);}@@ -49,7 +49,7 @@ export default function GetStartedPage() {const demoProject =env.NEXT_PUBLIC_DEMO_PROJECT_ID !== undefined && projects.data?.length? projects.data.find(- (project) => project.id === env.NEXT_PUBLIC_DEMO_PROJECT_ID+ (project) => project.id === env.NEXT_PUBLIC_DEMO_PROJECT_ID,): undefined;diff --git a/src/pages/project/[projectId]/traces/[traceId].tsx b/src/pages/project/[projectId]/traces/[traceId].tsxindex 44e5002038..d62938fbed 100644--- a/src/pages/project/[projectId]/traces/[traceId].tsx+++ b/src/pages/project/[projectId]/traces/[traceId].tsx@@ -13,13 +13,16 @@ export default function TracePage() {const trace = api.traces.byId.useQuery(traceId);- const totalCost = trace.data?.observations.reduce((acc, o) => {- if (!o.price) return acc;+ const totalCost = trace.data?.observations.reduce(+ (acc, o) => {+ if (!o.price) return acc;- return acc- ? acc.plus(o.price ? o.price : new Decimal(0))- : new Decimal(0).plus(o.price ? o.price : new Decimal(0));- }, undefined as Decimal | undefined);+ return acc+ ? acc.plus(o.price ? o.price : new Decimal(0))+ : new Decimal(0).plus(o.price ? o.price : new Decimal(0));+ },+ undefined as Decimal | undefined,+ );return (<div className="flex flex-col overflow-hidden xl:container lg:h-[calc(100vh-100px)] xl:h-[calc(100vh-50px)]">diff --git a/src/server/api/routers/scores.ts b/src/server/api/routers/scores.tsindex 7be12e6bf1..03e2a46721 100644--- a/src/server/api/routers/scores.ts+++ b/src/server/api/routers/scores.ts@@ -41,7 +41,7 @@ export const scoresRouter = createTRPCRouter({: undefined),},take: 100, // TODO: pagination- })+ }),),availableFilterOptions: protectedProjectProcedure.input(ScoreFilterOptions)@@ -113,7 +113,7 @@ export const scoresRouter = createTRPCRouter({},},},- })+ }),),create: protectedProcedure.input(@@ -123,7 +123,7 @@ export const scoresRouter = createTRPCRouter({name: z.string(),comment: z.string().optional(),observationId: z.string().optional(),- })+ }),).mutation(async ({ input, ctx }) => {const trace = await ctx.prisma.trace.findFirstOrThrow({@@ -172,7 +172,7 @@ export const scoresRouter = createTRPCRouter({id: z.string(),value: z.number(),comment: z.string().optional(),- })+ }),).mutation(async ({ input, ctx }) => {const score = await ctx.prisma.score.findFirstOrThrow({diff --git a/src/server/api/routers/traces.ts b/src/server/api/routers/traces.tsindex cdea0e5558..7ff0fd36e4 100644--- a/src/server/api/routers/traces.ts+++ b/src/server/api/routers/traces.ts@@ -36,7 +36,7 @@ export const traceRouter = createTRPCRouter({.query(async ({ input, ctx }) => {const metadataCondition = input.metadata? input.metadata.map(- (m) => Prisma.sql`AND t."metadata"->>${m.key} = ${m.value}`+ (m) => Prisma.sql`AND t."metadata"->>${m.key} = ${m.value}`,): undefined;@@ -136,8 +136,8 @@ export const traceRouter = createTRPCRouter({s."observation_id" AS "observationId"FROM "scores" sWHERE s."trace_id" IN (${Prisma.join(- traces.map((trace) => trace.id)- )})`+ traces.map((trace) => trace.id),+ )})`,): [];diff --git a/src/server/api/routers/users.ts b/src/server/api/routers/users.tsindex 93449c9de3..99439c0fe6 100644--- a/src/server/api/routers/users.ts+++ b/src/server/api/routers/users.ts@@ -91,7 +91,7 @@ export const userRouter = createTRPCRouter({return users.map((user) => ({...user,lastScore: lastScoresOfUsers.find(- (score) => score.userId === user.userId+ (score) => score.userId === user.userId,),}));}),@@ -101,7 +101,7 @@ export const userRouter = createTRPCRouter({z.object({projectId: z.string(),userId: z.string(),- })+ }),).query(async ({ input, ctx }) => {const [agg, lastScoresOfUsers] = await Promise.all([diff --git a/src/server/api/trpc.ts b/src/server/api/trpc.tsindex 45ea65b78a..5037e4fc77 100644--- a/src/server/api/trpc.ts+++ b/src/server/api/trpc.ts@@ -155,7 +155,7 @@ const enforceUserIsAuthedAndProjectMember = t.middleware(// check that the user is a member of this projectconst projectId = result.data.projectId;const sessionProject = ctx.session?.user.projects?.find(- ({ id }) => id === projectId+ ({ id }) => id === projectId,);if (!sessionProject)@@ -174,9 +174,9 @@ const enforceUserIsAuthedAndProjectMember = t.middleware(},},});- }+ },);export const protectedProjectProcedure = t.procedure.use(- enforceUserIsAuthedAndProjectMember+ enforceUserIsAuthedAndProjectMember,);diff --git a/src/server/auth.ts b/src/server/auth.tsindex 7683998bab..a15dcc7dd0 100644--- a/src/server/auth.ts+++ b/src/server/auth.ts@@ -102,7 +102,7 @@ export const authOptions: NextAuthOptions = {const isValidPassword = await verifyPassword(credentials.password,- dbUser.password+ dbUser.password,);if (!isValidPassword) throw new Error("Invalid credentials");diff --git a/src/styles/globals.css b/src/styles/globals.cssindex a615d8d14f..9ab9ee91cc 100644--- a/src/styles/globals.css+++ b/src/styles/globals.css@@ -74,7 +74,9 @@}body {@apply bg-background text-foreground;- font-feature-settings: "rlig" 1, "calt" 1;+ font-feature-settings:+ "rlig" 1,+ "calt" 1;}html,