Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions app/api/chat/route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { openai } from "@ai-sdk/openai";
import {
streamText,
convertToModelMessages,
type UIMessage,
} from "ai";
import { streamText, convertToModelMessages, type UIMessage } from "ai";

export async function POST(req: Request) {
const { messages }: { messages: UIMessage[] } = await req.json();
Expand Down
153 changes: 153 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 80,
"lineEnding": "lf"
},
"assist": {
"enabled": false
},
"linter": {
"enabled": true,
"domains": {
"react": "all",
"next": "all"
},
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
"noArrayIndexKey": "off",
"noEmptyInterface": "off",
"useIterableCallbackReturn": "off",
"noThenProperty": "off",
"noConfusingVoidType": "off",
"noImplicitAnyLet": "off",
"noAssignInExpressions": "off",
"noRedeclare": "off",
"noConfusingLabels": {
"level": "error",
"options": {
"allowedLabels": ["DEV"]
}
},
"noDoubleEquals": "off",
"noPrototypeBuiltins": "off",
"noDocumentCookie": "off"
},
"style": {
"noNamespace": "off",
"useImportType": "off",
"noNonNullAssertion": "off",
"useComponentExportOnlyModules": "off"
},
"correctness": {
"noUnusedVariables": {
"level": "warn",
"options": {
"ignoreRestSiblings": true
}
},
"useExhaustiveDependencies": "off",
"useHookAtTopLevel": "off",
"noSwitchDeclarations": "off",
"noUnsafeOptionalChaining": "off",
"useUniqueElementIds": "off"
},
"complexity": {
"noForEach": "off",
"noBannedTypes": "off",
"noUselessConstructor": "off",
"noStaticOnlyClass": "off",
"useArrowFunction": "off",
"noThisInStatic": "off",
"useFlatMap": "off",
"useLiteralKeys": "off"
},
"a11y": {
"useKeyWithClickEvents": "off",
"noSvgWithoutTitle": "off",
"noStaticElementInteractions": "off",
"useFocusableInteractive": "off",
"useButtonType": "off",
"useSemanticElements": "off"
},
"security": {
"noDangerouslySetInnerHtml": "off"
},
"performance": {
"noImgElement": "off"
},
"nursery": {
"useSortedClasses": {
"fix": "safe",
"level": "error",
"options": {
"attributes": ["className"],
"functions": ["clsx", "cva", "tw", "twMerge", "cn", "twJoin", "tv"]
}
}
}
}
},
"javascript": {
"formatter": {
"enabled": true,
"quoteStyle": "double",
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"attributePosition": "auto"
},
"parser": {
"unsafeParameterDecoratorsEnabled": true
}
},
"json": {
"formatter": {
"enabled": true,
"trailingCommas": "none"
},
"parser": {
"allowComments": true,
"allowTrailingCommas": false
}
},
"css": {
"parser": {
"cssModules": false,
"tailwindDirectives": true
},
"formatter": {
"enabled": false
},
"linter": {
"enabled": false
}
},
"files": {
"includes": [
"**",
"!**/dist",
"!**/node_modules",
"!**/.next",
"!**/.vercel",
"!**/out",
"!**/.source",
"!**/next-env.d.ts"
]
}
}
6 changes: 3 additions & 3 deletions components/assistant-ui/attachment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const AttachmentPreviewDialog: FC<PropsWithChildren> = ({ children }) => {
>
{children}
</DialogTrigger>
<DialogContent className="aui-attachment-preview-dialog-content p-2 sm:max-w-3xl [&_svg]:text-background [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&>button]:!ring-0 [&>button]:hover:[&_svg]:text-destructive">
<DialogContent className="aui-attachment-preview-dialog-content [&>button]:!ring-0 p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive">
<DialogTitle className="aui-sr-only sr-only">
Image Attachment Preview
</DialogTitle>
Expand Down Expand Up @@ -190,7 +190,7 @@ const AttachmentRemove: FC = () => {
<AttachmentPrimitive.Remove asChild>
<TooltipIconButton
tooltip="Remove file"
className="aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm hover:!bg-white [&_svg]:text-black hover:[&_svg]:text-destructive"
className="aui-attachment-tile-remove hover:!bg-white absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm [&_svg]:text-black hover:[&_svg]:text-destructive"
side="top"
>
<XIcon className="aui-attachment-remove-icon size-3 dark:stroke-[2.5px]" />
Expand Down Expand Up @@ -225,7 +225,7 @@ export const ComposerAddAttachment: FC = () => {
side="bottom"
variant="ghost"
size="icon"
className="aui-composer-add-attachment size-[34px] rounded-full p-1 text-xs font-semibold hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30"
className="aui-composer-add-attachment size-[34px] rounded-full p-1 font-semibold text-xs hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30"
aria-label="Add Attachment"
>
<PlusIcon className="aui-attachment-add-icon size-5 stroke-[1.5px]" />
Expand Down
14 changes: 7 additions & 7 deletions components/assistant-ui/markdown-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const CodeHeader: FC<CodeHeaderProps> = ({ language, code }) => {
};

return (
<div className="aui-code-header-root mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-muted-foreground/15 px-4 py-2 text-sm font-semibold text-foreground dark:bg-muted-foreground/20">
<div className="aui-code-header-root mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-muted-foreground/15 px-4 py-2 font-semibold text-foreground text-sm dark:bg-muted-foreground/20">
<span className="aui-code-header-language lowercase [&>span]:text-xs">
{language}
</span>
Expand Down Expand Up @@ -70,7 +70,7 @@ const defaultComponents = memoizeMarkdownComponents({
h1: ({ className, ...props }) => (
<h1
className={cn(
"aui-md-h1 mb-8 scroll-m-20 text-4xl font-extrabold tracking-tight last:mb-0",
"aui-md-h1 mb-8 scroll-m-20 font-extrabold text-4xl tracking-tight last:mb-0",
className,
)}
{...props}
Expand All @@ -79,7 +79,7 @@ const defaultComponents = memoizeMarkdownComponents({
h2: ({ className, ...props }) => (
<h2
className={cn(
"aui-md-h2 mt-8 mb-4 scroll-m-20 text-3xl font-semibold tracking-tight first:mt-0 last:mb-0",
"aui-md-h2 mt-8 mb-4 scroll-m-20 font-semibold text-3xl tracking-tight first:mt-0 last:mb-0",
className,
)}
{...props}
Expand All @@ -88,7 +88,7 @@ const defaultComponents = memoizeMarkdownComponents({
h3: ({ className, ...props }) => (
<h3
className={cn(
"aui-md-h3 mt-6 mb-4 scroll-m-20 text-2xl font-semibold tracking-tight first:mt-0 last:mb-0",
"aui-md-h3 mt-6 mb-4 scroll-m-20 font-semibold text-2xl tracking-tight first:mt-0 last:mb-0",
className,
)}
{...props}
Expand All @@ -97,7 +97,7 @@ const defaultComponents = memoizeMarkdownComponents({
h4: ({ className, ...props }) => (
<h4
className={cn(
"aui-md-h4 mt-6 mb-4 scroll-m-20 text-xl font-semibold tracking-tight first:mt-0 last:mb-0",
"aui-md-h4 mt-6 mb-4 scroll-m-20 font-semibold text-xl tracking-tight first:mt-0 last:mb-0",
className,
)}
{...props}
Expand All @@ -106,7 +106,7 @@ const defaultComponents = memoizeMarkdownComponents({
h5: ({ className, ...props }) => (
<h5
className={cn(
"aui-md-h5 my-4 text-lg font-semibold first:mt-0 last:mb-0",
"aui-md-h5 my-4 font-semibold text-lg first:mt-0 last:mb-0",
className,
)}
{...props}
Expand Down Expand Up @@ -205,7 +205,7 @@ const defaultComponents = memoizeMarkdownComponents({
pre: ({ className, ...props }) => (
<pre
className={cn(
"aui-md-pre overflow-x-auto !rounded-t-none rounded-b-lg bg-black p-4 text-white",
"aui-md-pre !rounded-t-none overflow-x-auto rounded-b-lg bg-black p-4 text-white",
className,
)}
{...props}
Expand Down
6 changes: 3 additions & 3 deletions components/assistant-ui/reasoning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const GradientFade: FC<{ className?: string }> = ({ className }) => (
className={cn(
"aui-reasoning-fade pointer-events-none absolute inset-x-0 bottom-0 z-10 h-16",
"bg-[linear-gradient(to_top,var(--color-background),transparent)]",
"animate-in fade-in-0",
"fade-in-0 animate-in",
"group-data-[state=open]/collapsible-content:animate-out",
"group-data-[state=open]/collapsible-content:fade-out-0",
"group-data-[state=open]/collapsible-content:delay-[calc(var(--animation-duration)*0.75)]", // calc for timing the delay
Expand All @@ -102,7 +102,7 @@ const ReasoningTrigger: FC<{ active: boolean; className?: string }> = ({
}) => (
<CollapsibleTrigger
className={cn(
"aui-reasoning-trigger group/trigger -mb-2 flex max-w-[75%] items-center gap-2 py-2 text-sm text-muted-foreground transition-colors hover:text-foreground",
"aui-reasoning-trigger group/trigger -mb-2 flex max-w-[75%] items-center gap-2 py-2 text-muted-foreground text-sm transition-colors hover:text-foreground",
className,
)}
>
Expand Down Expand Up @@ -147,7 +147,7 @@ const ReasoningContent: FC<
> = ({ className, children, "aria-busy": ariaBusy }) => (
<CollapsibleContent
className={cn(
"aui-reasoning-content relative overflow-hidden text-sm text-muted-foreground outline-none",
"aui-reasoning-content relative overflow-hidden text-muted-foreground text-sm outline-none",
"group/collapsible-content ease-out",
"data-[state=closed]:animate-collapsible-up",
"data-[state=open]:animate-collapsible-down",
Expand Down
2 changes: 1 addition & 1 deletion components/assistant-ui/thread-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const ThreadListSkeleton: FC = () => {

const ThreadListItem: FC = () => {
return (
<ThreadListItemPrimitive.Root className="aui-thread-list-item flex items-center gap-2 rounded-lg transition-all hover:bg-muted focus-visible:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none data-active:bg-muted">
<ThreadListItemPrimitive.Root className="aui-thread-list-item flex items-center gap-2 rounded-lg transition-all hover:bg-muted focus-visible:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-active:bg-muted">
<ThreadListItemPrimitive.Trigger className="aui-thread-list-item-trigger flex-grow px-3 py-2 text-start">
<ThreadListItemTitle />
</ThreadListItemPrimitive.Trigger>
Expand Down
Loading