AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(builder): Add Supabase Auth, session and sign in UI (#7655)
Krzysztof Czerwinskica9c52f76aa3
diff --git a/rnd/autogpt_builder/.env.example b/rnd/autogpt_builder/.env.exampleindex 0fd967dcab..e494243c60 100644--- a/rnd/autogpt_builder/.env.example+++ b/rnd/autogpt_builder/.env.example@@ -1 +1,12 @@AGPT_SERVER_URL=http://localhost:8000/api++## Supabase credentials+## YOU ONLY NEED THEM IF YOU WANT TO USE SUPABASE USER AUTHENTICATION+## If you're using self-hosted version then you most likely don't need to set this+# NEXT_PUBLIC_SUPABASE_URL=your-project-url+# NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key++## OAuth Callback URL+## This should be {domain}/auth/callback+## Only used if you're using Supabase and OAuth+AUTH_CALLBACK_URL=http://localhost:3000/auth/callbackdiff --git a/rnd/autogpt_builder/package.json b/rnd/autogpt_builder/package.jsonindex 5595461014..be61827b42 100644--- a/rnd/autogpt_builder/package.json+++ b/rnd/autogpt_builder/package.json@@ -19,6 +19,8 @@"@radix-ui/react-slot": "^1.1.0","@radix-ui/react-switch": "^1.1.0","@radix-ui/react-tooltip": "^1.1.2",+ "@supabase/ssr": "^0.4.0",+ "@supabase/supabase-js": "^2.45.0","ajv": "^8.17.1","class-variance-authority": "^0.7.0","clsx": "^2.1.1",@@ -32,6 +34,7 @@"react-day-picker": "^8.10.1","react-dom": "^18","react-hook-form": "^7.52.1",+ "react-icons": "^5.2.1","react-markdown": "^9.0.1","react-modal": "^3.16.1","reactflow": "^11.11.4",diff --git a/rnd/autogpt_builder/src/app/auth/auth-code-error/page.tsx b/rnd/autogpt_builder/src/app/auth/auth-code-error/page.tsxnew file mode 100644index 0000000000..97ceec5468--- /dev/null+++ b/rnd/autogpt_builder/src/app/auth/auth-code-error/page.tsx@@ -0,0 +1,34 @@+"use client";++import { useEffect, useState } from 'react';++export default function AuthErrorPage() {+ const [errorType, setErrorType] = useState<string | null>(null);+ const [errorCode, setErrorCode] = useState<string | null>(null);+ const [errorDescription, setErrorDescription] = useState<string | null>(null);++ useEffect(() => {+ // This code only runs on the client side+ if (typeof window !== 'undefined') {+ const hash = window.location.hash.substring(1); // Remove the leading '#'+ const params = new URLSearchParams(hash);++ setErrorType(params.get('error'));+ setErrorCode(params.get('error_code'));+ setErrorDescription(params.get('error_description')?.replace(/\+/g, ' ') ?? null); // Replace '+' with space+ }+ }, []);++ if (!errorType && !errorCode && !errorDescription) {+ return <div>Loading...</div>;+ }++ return (+ <div>+ <h1>Authentication Error</h1>+ {errorType && <p>Error Type: {errorType}</p>}+ {errorCode && <p>Error Code: {errorCode}</p>}+ {errorDescription && <p>Error Description: {errorDescription}</p>}+ </div>+ );+}diff --git a/rnd/autogpt_builder/src/app/auth/callback/route.ts b/rnd/autogpt_builder/src/app/auth/callback/route.tsnew file mode 100644index 0000000000..d26b7a5245--- /dev/null+++ b/rnd/autogpt_builder/src/app/auth/callback/route.ts@@ -0,0 +1,36 @@+import { NextResponse } from 'next/server'+import { createServerClient } from '@/lib/supabase/server'++// Handle the callback to complete the user session login+export async function GET(request: Request) {+ const { searchParams, origin } = new URL(request.url)+ const code = searchParams.get('code')+ // if "next" is in param, use it as the redirect URL+ const next = searchParams.get('next') ?? '/profile'++ if (code) {+ const supabase = createServerClient()++ if (!supabase) {+ return NextResponse.redirect(`${origin}/error`)+ }++ const { data, error } = await supabase.auth.exchangeCodeForSession(code)+ // data.session?.refresh_token is available if you need to store it for later use+ if (!error) {+ const forwardedHost = request.headers.get('x-forwarded-host') // original origin before load balancer+ const isLocalEnv = process.env.NODE_ENV === 'development'+ if (isLocalEnv) {+ // we can be sure that there is no load balancer in between, so no need to watch for X-Forwarded-Host+ return NextResponse.redirect(`${origin}${next}`)+ } else if (forwardedHost) {+ return NextResponse.redirect(`https://${forwardedHost}${next}`)+ } else {+ return NextResponse.redirect(`${origin}${next}`)+ }+ }+ }++ // return the user to an error page with instructions+ return NextResponse.redirect(`${origin}/auth/auth-code-error`)+}diff --git a/rnd/autogpt_builder/src/app/auth/confirm/route.ts b/rnd/autogpt_builder/src/app/auth/confirm/route.tsnew file mode 100644index 0000000000..dc341adabf--- /dev/null+++ b/rnd/autogpt_builder/src/app/auth/confirm/route.ts@@ -0,0 +1,33 @@+import { type EmailOtpType } from '@supabase/supabase-js'+import { type NextRequest } from 'next/server'++import { redirect } from 'next/navigation'+import { createServerClient } from '@/lib/supabase/server'++// Email confirmation route+export async function GET(request: NextRequest) {+ const { searchParams } = new URL(request.url)+ const token_hash = searchParams.get('token_hash')+ const type = searchParams.get('type') as EmailOtpType | null+ const next = searchParams.get('next') ?? '/'++ if (token_hash && type) {+ const supabase = createServerClient()++ if (!supabase) {+ redirect('/error')+ }++ const { error } = await supabase.auth.verifyOtp({+ type,+ token_hash,+ })+ if (!error) {+ // redirect user to specified redirect URL or root of app+ redirect(next)+ }+ }++ // redirect the user to an error page with some instructions+ redirect('/error')+}diff --git a/rnd/autogpt_builder/src/app/error/page.tsx b/rnd/autogpt_builder/src/app/error/page.tsxnew file mode 100644index 0000000000..752b8bac14--- /dev/null+++ b/rnd/autogpt_builder/src/app/error/page.tsx@@ -0,0 +1,3 @@+export default function ErrorPage() {+ return <p>Sorry, something went wrong</p>+}diff --git a/rnd/autogpt_builder/src/app/layout.tsx b/rnd/autogpt_builder/src/app/layout.tsxindex 24f882ed57..423f8e860b 100644--- a/rnd/autogpt_builder/src/app/layout.tsx+++ b/rnd/autogpt_builder/src/app/layout.tsx@@ -1,19 +1,19 @@import React from 'react';import type { Metadata } from "next";import { Inter } from "next/font/google";--import "./globals.css";-import { Providers } from "@/app/providers";import {NavBar} from "@/components/NavBar";import {cn} from "@/lib/utils";+import "./globals.css";+const inter = Inter({ subsets: ["latin"] });export const metadata: Metadata = {title: "NextGen AutoGPT",description: "Your one stop shop to creating AI Agents",};+export default function RootLayout({children,}: Readonly<{diff --git a/rnd/autogpt_builder/src/app/login/actions.ts b/rnd/autogpt_builder/src/app/login/actions.tsnew file mode 100644index 0000000000..114da537a4--- /dev/null+++ b/rnd/autogpt_builder/src/app/login/actions.ts@@ -0,0 +1,54 @@+'use server'+import { revalidatePath } from 'next/cache'+import { redirect } from 'next/navigation'+import { createServerClient } from '@/lib/supabase/server'+import { z } from 'zod'++const loginFormSchema = z.object({+ email: z.string().email().min(2).max(64),+ password: z.string().min(6).max(64),+})++export async function login(values: z.infer<typeof loginFormSchema>) {+ const supabase = createServerClient()++ if (!supabase) {+ redirect('/error')+ }++ // We are sure that the values are of the correct type because zod validates the form+ const { data, error } = await supabase.auth.signInWithPassword(values)++ if (error) {+ return error.message+ }++ if (data.session) {+ await supabase.auth.setSession(data.session);+ }++ revalidatePath('/', 'layout')+ redirect('/profile')+}++export async function signup(values: z.infer<typeof loginFormSchema>) {+ const supabase = createServerClient()++ if (!supabase) {+ redirect('/error')+ }++ // We are sure that the values are of the correct type because zod validates the form+ const { data, error } = await supabase.auth.signUp(values)++ if (error) {+ return error.message+ }++ if (data.session) {+ await supabase.auth.setSession(data.session);+ }++ revalidatePath('/', 'layout')+ redirect('/profile')+}diff --git a/rnd/autogpt_builder/src/app/login/page.tsx b/rnd/autogpt_builder/src/app/login/page.tsxnew file mode 100644index 0000000000..9900d3fc40--- /dev/null+++ b/rnd/autogpt_builder/src/app/login/page.tsx@@ -0,0 +1,168 @@+"use client";+import useUser from '@/hooks/useUser';+import { login, signup } from './actions'+import { Button } from '@/components/ui/button';+import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form';+import { useForm } from 'react-hook-form';+import { Input } from '@/components/ui/input';+import { z } from "zod"+import { zodResolver } from "@hookform/resolvers/zod"+import { PasswordInput } from '@/components/PasswordInput';+import { FaGoogle, FaGithub, FaDiscord, FaSpinner } from "react-icons/fa";+import { useState } from 'react';+import { useSupabase } from '@/components/SupabaseProvider';+import { useRouter } from 'next/navigation';++const loginFormSchema = z.object({+ email: z.string().email().min(2).max(64),+ password: z.string().min(6).max(64),+})++export default function LoginPage() {+ const { supabase, isLoading: isSupabaseLoading } = useSupabase();+ const { user, isLoading: isUserLoading } = useUser();+ const [feedback, setFeedback] = useState<string | null>(null);+ const router = useRouter();+ const [isLoading, setIsLoading] = useState(false);++ const form = useForm<z.infer<typeof loginFormSchema>>({+ resolver: zodResolver(loginFormSchema),+ defaultValues: {+ email: "",+ password: "",+ },+ })++ if (user) {+ console.log('User exists, redirecting to profile')+ router.push('/profile')+ }++ if (isUserLoading || isSupabaseLoading || user) {+ return (+ <div className="flex justify-center items-center h-[80vh]">+ <FaSpinner className="mr-2 h-16 w-16 animate-spin"/>+ </div>+ );+ }++ if (!supabase) {+ return <div>User accounts are disabled because Supabase client is unavailable</div>+ }++ async function handleSignInWithProvider(provider: 'google' | 'github' | 'discord') {+ const { data, error } = await supabase!.auth.signInWithOAuth({+ provider: provider,+ options: {+ redirectTo: process.env.AUTH_CALLBACK_URL ?? `http://localhost:3000/auth/callback`,+ // Get Google provider_refresh_token+ // queryParams: {+ // access_type: 'offline',+ // prompt: 'consent',+ // },+ },+ })++ if (!error) {+ setFeedback(null)+ return+ }+ setFeedback(error.message)+ }++ const onLogin = async (data: z.infer<typeof loginFormSchema>) => {+ setIsLoading(true)+ const error = await login(data)+ setIsLoading(false)+ if (error) {+ setFeedback(error)+ return+ }+ setFeedback(null)+ }++ const onSignup = async (data: z.infer<typeof loginFormSchema>) => {+ if (await form.trigger()) {+ setIsLoading(true)+ const error = await signup(data)+ setIsLoading(false)+ if (error) {+ setFeedback(error)+ return+ }+ setFeedback(null)+ }+ }++ return (+ <div className="flex items-center justify-center h-[80vh]">+ <div className="w-full max-w-md p-8 rounded-lg shadow-md space-y-6">+ <div className='mb-6 space-y-2'>+ <Button className="w-full" onClick={() => handleSignInWithProvider('google')} variant="outline" type="button" disabled={isLoading}>+ <FaGoogle className="mr-2 h-4 w-4" />+ Sign in with Google+ </Button>+ <Button className="w-full" onClick={() => handleSignInWithProvider('github')} variant="outline" type="button" disabled={isLoading}>+ <FaGithub className="mr-2 h-4 w-4" />+ Sign in with GitHub+ </Button>+ <Button className="w-full" onClick={() => handleSignInWithProvider('discord')} variant="outline" type="button" disabled={isLoading}>+ <FaDiscord className="mr-2 h-4 w-4" />+ Sign in with Discord+ </Button>+ </div>+ <Form {...form}>+ <form onSubmit={form.handleSubmit(onLogin)}>+ <FormField+ control={form.control}+ name="email"+ render={({ field }) => (+ <FormItem className='mb-4'>+ <FormLabel>Email</FormLabel>+ <FormControl>+ <Input placeholder="[email protected]" {...field} />+ </FormControl>+ <FormMessage />+ </FormItem>+ )}+ />+ <FormField+ control={form.control}+ name="password"+ render={({ field }) => (+ <FormItem>+ <FormLabel>Password</FormLabel>+ <FormControl>+ <PasswordInput placeholder="password" {...field} />+ </FormControl>+ <FormDescription>+ Password needs to be at least 6 characters long+ </FormDescription>+ <FormMessage />+ </FormItem>+ )}+ />+ <div className='flex w-full space-x-4 mt-6 mb-6'>+ <Button className='w-1/2 flex justify-center' type="submit" disabled={isLoading}>+ Log in+ </Button>+ <Button+ className='w-1/2 flex justify-center'+ variant='outline'+ type="button"+ onClick={form.handleSubmit(onSignup)}+ disabled={isLoading}+ >+ Sign up+ </Button>+ </div>+ </form>+ <p className='text-red-500 text-sm'>{feedback}</p>+ <p className='text-primary text-center text-sm'>+ By continuing you agree to everything+ </p>+ </Form>+ </div>+ </div>+ )+}diff --git a/rnd/autogpt_builder/src/app/profile/page.tsx b/rnd/autogpt_builder/src/app/profile/page.tsxnew file mode 100644index 0000000000..373c5b606b--- /dev/null+++ b/rnd/autogpt_builder/src/app/profile/page.tsx@@ -0,0 +1,33 @@+"use client";++import { useSupabase } from '@/components/SupabaseProvider';+import { Button } from '@/components/ui/button'+import useUser from '@/hooks/useUser';+import { useRouter } from 'next/navigation';+import { FaSpinner } from 'react-icons/fa';++export default function PrivatePage() {+ const { user, isLoading, error } = useUser()+ const { supabase } = useSupabase()+ const router = useRouter()++ if (isLoading) {+ return (+ <div className="flex justify-center items-center h-[80vh]">+ <FaSpinner className="mr-2 h-16 w-16 animate-spin" />+ </div>+ );+ }++ if (error || !user || !supabase) {+ router.push('/login')+ return null+ }++ return (+ <div>+ <p>Hello {user.email}</p>+ <Button onClick={() => supabase.auth.signOut()}>Log out</Button>+ </div>+ )+}diff --git a/rnd/autogpt_builder/src/app/providers.tsx b/rnd/autogpt_builder/src/app/providers.tsxindex b07beb96d0..2758c5beb5 100644--- a/rnd/autogpt_builder/src/app/providers.tsx+++ b/rnd/autogpt_builder/src/app/providers.tsx@@ -4,11 +4,14 @@ import * as React from 'react'import { ThemeProvider as NextThemesProvider } from 'next-themes'import { ThemeProviderProps } from 'next-themes/dist/types'import { TooltipProvider } from '@/components/ui/tooltip'+import SupabaseProvider from '@/components/SupabaseProvider'export function Providers({ children, ...props }: ThemeProviderProps) {- return (- <NextThemesProvider {...props}>- <TooltipProvider>{children}</TooltipProvider>- </NextThemesProvider>- )-}\ No newline at end of file+ return (+ <NextThemesProvider {...props}>+ <SupabaseProvider>+ <TooltipProvider>{children}</TooltipProvider>+ </SupabaseProvider>+ </NextThemesProvider>+ )+}diff --git a/rnd/autogpt_builder/src/components/NavBar.tsx b/rnd/autogpt_builder/src/components/NavBar.tsxindex 9a0ef90031..feac7added 100644--- a/rnd/autogpt_builder/src/components/NavBar.tsx+++ b/rnd/autogpt_builder/src/components/NavBar.tsx@@ -1,99 +1,98 @@import {- DropdownMenu,- DropdownMenuContent, DropdownMenuItem,- DropdownMenuTrigger+ DropdownMenu,+ DropdownMenuContent, DropdownMenuItem,+ DropdownMenuTrigger} from "@/components/ui/dropdown-menu";import Link from "next/link";-import { Menu } from "lucide-react";-import { Button } from "@/components/ui/button";+import { CircleUser, Menu, SquareActivity, Workflow } from "lucide-react";+import { Button, buttonVariants } from "@/components/ui/button";import React from "react";import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";import { Pencil1Icon, TimerIcon } from "@radix-ui/react-icons";import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";import Image from "next/image";+import getServerUser from "@/hooks/getServerUser";+import ProfileDropdown from "./ProfileDropdown";-export function NavBar() {- return (- <header className="sticky top-0 flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6">- <div className="flex items-center gap-4 flex-1">- <Sheet>- <SheetTrigger asChild>- <Button- variant="outline"- size="icon"- className="shrink-0 md:hidden"- >- <Menu className="size-5"/>- <span className="sr-only">Toggle navigation menu</span>- </Button>- </SheetTrigger>- <SheetContent side="left">- <nav className="grid gap-6 text-lg font-medium">- <Link- href="/monitor"- className="text-muted-foreground hover:text-foreground flex flex-row gap-2 "- >- <TimerIcon className="size-6" /> Monitor- </Link>- <Link- href="/build"- className="text-muted-foreground hover:text-foreground flex flex-row gap-2"- >- <Pencil1Icon className="size-6"/> Build- </Link>- </nav>- </SheetContent>- </Sheet>- <nav className="hidden md:flex md:flex-row md:items-center md:gap-5 lg:gap-6">- <Link- href="/monitor"- className="text-muted-foreground hover:text-foreground flex flex-row gap-2 items-center"- >- <TimerIcon className="size-4"/> Monitor- </Link>- <Link- href="/build"- className="text-muted-foreground hover:text-foreground flex flex-row gap-2 items-center"- >- <Pencil1Icon className="size-4"/> Build- </Link>- </nav>- </div>- <div className="flex-1 flex justify-center relative">- <a- className="pointer-events-auto flex place-items-center gap-2"- href="https://news.agpt.co/"- target="_blank"- rel="noopener noreferrer"- >- By{" "}- <Image- src="/AUTOgpt_Logo_dark.png"- alt="AutoGPT Logo"- width={100}- height={20}- priority- />- </a>- </div>- <div className="flex items-center gap-4 flex-1 justify-end">- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="ghost" className="size-8">- <Avatar>- <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn"/>- <AvatarFallback>CN</AvatarFallback>- </Avatar>- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <DropdownMenuItem>Profile</DropdownMenuItem>- <DropdownMenuItem>Settings</DropdownMenuItem>- <DropdownMenuItem>Switch Workspace</DropdownMenuItem>- <DropdownMenuItem>Log out</DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>- </div>- </header>- );-}\ No newline at end of file+export async function NavBar() {+ const isAvailable = Boolean(+ process.env.NEXT_PUBLIC_SUPABASE_URL && process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY+ );+ const { user } = await getServerUser();++ return (+ <header className="sticky top-0 flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6">+ <div className="flex items-center gap-4 flex-1">+ <Sheet>+ <SheetTrigger asChild>+ <Button+ variant="outline"+ size="icon"+ className="shrink-0 md:hidden"+ >+ <Menu className="size-5" />+ <span className="sr-only">Toggle navigation menu</span>+ </Button>+ </SheetTrigger>+ <SheetContent side="left">+ <nav className="grid gap-6 text-lg font-medium">+ <Link+ href="/monitor"+ className="text-muted-foreground hover:text-foreground flex flex-row gap-2 "+ >+ <SquareActivity className="size-6" /> Monitor+ </Link>+ <Link+ href="/build"+ className="text-muted-foreground hover:text-foreground flex flex-row gap-2"+ >+ <Workflow className="size-6" /> Build+ </Link>+ </nav>+ </SheetContent>+ </Sheet>+ <nav className="hidden md:flex md:flex-row md:items-center md:gap-5 lg:gap-6">+ <Link+ href="/monitor"+ className="text-muted-foreground hover:text-foreground flex flex-row gap-2 items-center"+ >+ <SquareActivity className="size-4" /> Monitor+ </Link>+ <Link+ href="/build"+ className="text-muted-foreground hover:text-foreground flex flex-row gap-2 items-center"+ >+ <Workflow className="size-4" /> Build+ </Link>+ </nav>+ </div>+ <div className="flex-1 flex justify-center relative">+ <a+ className="pointer-events-auto flex place-items-center gap-2"+ href="https://news.agpt.co/"+ target="_blank"+ rel="noopener noreferrer"+ >+ By{" "}+ <Image+ src="/AUTOgpt_Logo_dark.png"+ alt="AutoGPT Logo"+ width={100}+ height={20}+ priority+ />+ </a>+ </div>+ <div className="flex items-center gap-4 flex-1 justify-end">+ {isAvailable && !user &&+ <Link+ href="/login"+ className="text-muted-foreground hover:text-foreground flex flex-row gap-2 items-center"+ >+ Log In<CircleUser className="size-5" />+ </Link>}+ {isAvailable && user && <ProfileDropdown />}+ </div>+ </header>+ );+}diff --git a/rnd/autogpt_builder/src/components/PasswordInput.tsx b/rnd/autogpt_builder/src/components/PasswordInput.tsxnew file mode 100644index 0000000000..9631913bbf--- /dev/null+++ b/rnd/autogpt_builder/src/components/PasswordInput.tsx@@ -0,0 +1,59 @@+import { forwardRef, useState } from "react"+import { EyeIcon, EyeOffIcon } from "lucide-react"+import { Button } from "@/components/ui/button"+import { Input, InputProps } from "@/components/ui/input"+import { cn } from "@/lib/utils"++const PasswordInput = forwardRef<HTMLInputElement, InputProps>(+ ({ className, ...props }, ref) => {+ const [showPassword, setShowPassword] = useState(false)+ const disabled = props.value === "" || props.value === undefined || props.disabled++ return (+ <div className="relative">+ <Input+ type={showPassword ? "text" : "password"}+ className={cn("hide-password-toggle pr-10", className)}+ ref={ref}+ {...props}+ />+ <Button+ type="button"+ variant="ghost"+ size="sm"+ className="absolute top-0 right-0 h-full px-3 py-2 hover:bg-transparent"+ onClick={() => setShowPassword((prev) => !prev)}+ disabled={disabled}+ >+ {showPassword && !disabled ? (+ <EyeIcon+ className="w-4 h-4"+ aria-hidden="true"+ />+ ) : (+ <EyeOffIcon+ className="w-4 h-4"+ aria-hidden="true"+ />+ )}+ <span className="sr-only">+ {showPassword ? "Hide password" : "Show password"}+ </span>+ </Button>++ {/* hides browsers password toggles */}+ <style>{`+ .hide-password-toggle::-ms-reveal,+ .hide-password-toggle::-ms-clear {+ visibility: hidden;+ pointer-events: none;+ display: none;+ }+ `}</style>+ </div>+ )+ },+)+PasswordInput.displayName = "PasswordInput"++export { PasswordInput }diff --git a/rnd/autogpt_builder/src/components/ProfileDropdown.tsx b/rnd/autogpt_builder/src/components/ProfileDropdown.tsxnew file mode 100644index 0000000000..3dc54b10d0--- /dev/null+++ b/rnd/autogpt_builder/src/components/ProfileDropdown.tsx@@ -0,0 +1,33 @@+"use client";+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";+import {+ DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger+} from "@/components/ui/dropdown-menu";+import { Button } from "./ui/button";+import { useSupabase } from "./SupabaseProvider";+import { useRouter } from "next/navigation";+import useUser from "@/hooks/useUser";++const ProfileDropdown = () => {+ const { supabase } = useSupabase();+ const router = useRouter();++ return (+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" className="h-8 w-8 rounded-full">+ <Avatar>+ <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />+ <AvatarFallback>CN</AvatarFallback>+ </Avatar>+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuItem onClick={() => router.push('profile')}>Profile</DropdownMenuItem>+ <DropdownMenuItem onClick={() => supabase?.auth.signOut()}>Log out</DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ )+}++export default ProfileDropdown;diff --git a/rnd/autogpt_builder/src/components/SupabaseProvider.tsx b/rnd/autogpt_builder/src/components/SupabaseProvider.tsxnew file mode 100644index 0000000000..95263d003d--- /dev/null+++ b/rnd/autogpt_builder/src/components/SupabaseProvider.tsx@@ -0,0 +1,60 @@+"use client";++import { createClient } from '@/lib/supabase/client';+import { SupabaseClient } from '@supabase/supabase-js';+import { useRouter } from 'next/navigation';+import { createContext, useContext, useEffect, useState } from 'react';++type SupabaseContextType = {+ supabase: SupabaseClient | null;+ isLoading: boolean;+};++const Context = createContext<SupabaseContextType | undefined>(undefined);++export default function SupabaseProvider({+ children+}: {+ children: React.ReactNode+}) {+ const [supabase, setSupabase] = useState<SupabaseClient | null>(null);+ const [isLoading, setIsLoading] = useState(true);+ const router = useRouter();++ useEffect(() => {+ const initializeSupabase = async () => {+ setIsLoading(true);+ const client = createClient();+ setSupabase(client);+ setIsLoading(false);++ if (client) {+ const {+ data: { subscription },+ } = client.auth.onAuthStateChange(() => {+ router.refresh();+ });++ return () => {+ subscription.unsubscribe();+ };+ }+ };++ initializeSupabase();+ }, [router]);++ return (+ <Context.Provider value={{ supabase, isLoading }}>+ {children}+ </Context.Provider>+ );+}++export const useSupabase = () => {+ const context = useContext(Context);+ if (context === undefined) {+ throw new Error('useSupabase must be used inside SupabaseProvider');+ }+ return context;+};diff --git a/rnd/autogpt_builder/src/hooks/getServerUser.ts b/rnd/autogpt_builder/src/hooks/getServerUser.tsnew file mode 100644index 0000000000..ebc646bd2e--- /dev/null+++ b/rnd/autogpt_builder/src/hooks/getServerUser.ts@@ -0,0 +1,21 @@+import { createServerClient } from "@/lib/supabase/server";++const getServerUser = async () => {+ const supabase = createServerClient();++ if (!supabase) {+ return { user: null, error: 'Failed to create Supabase client' };+ }++ try {+ const { data, error } = await supabase.auth.getUser();+ if (error) {+ return { user: null, error: error.message };+ }+ return { user: data.user, error: null };+ } catch (error) {+ return { user: null, error: (error as Error).message };+ }+};++export default getServerUser;diff --git a/rnd/autogpt_builder/src/hooks/useUser.ts b/rnd/autogpt_builder/src/hooks/useUser.tsnew file mode 100644index 0000000000..9c3756ed03--- /dev/null+++ b/rnd/autogpt_builder/src/hooks/useUser.ts@@ -0,0 +1,47 @@+"use client";++import { useEffect, useState } from 'react';+import { User, Session } from '@supabase/supabase-js';+import { useSupabase } from '@/components/SupabaseProvider';++const useUser = () => {+ const { supabase, isLoading: isSupabaseLoading } = useSupabase();+ const [user, setUser] = useState<User | null>(null);+ const [session, setSession] = useState<Session | null>(null);+ const [isLoading, setIsLoading] = useState(true);+ const [error, setError] = useState<string | null>(null);++ useEffect(() => {+ if (isSupabaseLoading || !supabase) {+ return;+ }++ const fetchUser = async () => {+ try {+ setIsLoading(true);+ const { data: { user } } = await supabase.auth.getUser();+ const { data: { session } } = await supabase.auth.getSession();+ setUser(user);+ setSession(session);+ } catch (e) {+ setError('Failed to fetch user data');+ } finally {+ setIsLoading(false);+ }+ };++ fetchUser();++ const { data: { subscription } } = supabase.auth.onAuthStateChange((_event, session) => {+ setSession(session);+ setUser(session?.user ?? null);+ setIsLoading(false);+ });++ return () => subscription.unsubscribe();+ }, [supabase, isSupabaseLoading]);++ return { user, session, isLoading: isLoading || isSupabaseLoading, error };+};++export default useUser;diff --git a/rnd/autogpt_builder/src/lib/supabase/client.ts b/rnd/autogpt_builder/src/lib/supabase/client.tsnew file mode 100644index 0000000000..218a421e43--- /dev/null+++ b/rnd/autogpt_builder/src/lib/supabase/client.ts@@ -0,0 +1,13 @@+import { createBrowserClient } from '@supabase/ssr'++export function createClient() {+ try {+ return createBrowserClient(+ process.env.NEXT_PUBLIC_SUPABASE_URL!,+ process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!+ )+ }+ catch (error) {+ return null;+ }+}diff --git a/rnd/autogpt_builder/src/lib/supabase/middleware.ts b/rnd/autogpt_builder/src/lib/supabase/middleware.tsnew file mode 100644index 0000000000..d6307ce5eb--- /dev/null+++ b/rnd/autogpt_builder/src/lib/supabase/middleware.ts@@ -0,0 +1,76 @@+import { createServerClient } from '@supabase/ssr'+import { NextResponse, type NextRequest } from 'next/server'++export async function updateSession(request: NextRequest) {+ let supabaseResponse = NextResponse.next({+ request,+ })++ const isAvailable = Boolean(+ process.env.NEXT_PUBLIC_SUPABASE_URL && process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY+ );++ if (!isAvailable) {+ return supabaseResponse+ }++ try {+ const supabase = createServerClient(+ process.env.NEXT_PUBLIC_SUPABASE_URL!,+ process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,+ {+ cookies: {+ getAll() {+ return request.cookies.getAll()+ },+ setAll(cookiesToSet) {+ cookiesToSet.forEach(({ name, value, options }) => request.cookies.set(name, value))+ supabaseResponse = NextResponse.next({+ request,+ })+ cookiesToSet.forEach(({ name, value, options }) =>+ supabaseResponse.cookies.set(name, value, options)+ )+ },+ },+ }+ )++ // IMPORTANT: Avoid writing any logic between createServerClient and+ // supabase.auth.getUser(). A simple mistake could make it very hard to debug+ // issues with users being randomly logged out.++ const {+ data: { user },+ } = await supabase.auth.getUser()++ if (+ !user &&+ !request.nextUrl.pathname.startsWith('/login') &&+ !request.nextUrl.pathname.startsWith('/auth')+ ) {+ // no user, potentially respond by redirecting the user to the login page+ const url = request.nextUrl.clone()+ url.pathname = '/login'+ // return NextResponse.redirect(url)+ }++ // IMPORTANT: You *must* return the supabaseResponse object as it is. If you're+ // creating a new response object with NextResponse.next() make sure to:+ // 1. Pass the request in it, like so:+ // const myNewResponse = NextResponse.next({ request })+ // 2. Copy over the cookies, like so:+ // myNewResponse.cookies.setAll(supabaseResponse.cookies.getAll())+ // 3. Change the myNewResponse object to fit your needs, but avoid changing+ // the cookies!+ // 4. Finally:+ // return myNewResponse+ // If this is not done, you may be causing the browser and server to go out+ // of sync and terminate the user's session prematurely!+ }+ catch (error) {+ console.error('Failed to run Supabase middleware', error)+ }++ return supabaseResponse+}diff --git a/rnd/autogpt_builder/src/lib/supabase/server.ts b/rnd/autogpt_builder/src/lib/supabase/server.tsnew file mode 100644index 0000000000..b22d30e274--- /dev/null+++ b/rnd/autogpt_builder/src/lib/supabase/server.ts@@ -0,0 +1,34 @@+import { createServerClient as createClient, type CookieOptions } from '@supabase/ssr'+import { cookies } from 'next/headers'++export function createServerClient() {+ const cookieStore = cookies()++ try {+ return createClient(+ process.env.NEXT_PUBLIC_SUPABASE_URL!,+ process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,+ {+ cookies: {+ getAll() {+ return cookieStore.getAll()+ },+ setAll(cookiesToSet) {+ try {+ cookiesToSet.forEach(({ name, value, options }) =>+ cookieStore.set(name, value, options)+ )+ } catch {+ // The `setAll` method was called from a Server Component.+ // This can be ignored if you have middleware refreshing+ // user sessions.+ }+ },+ },+ }+ )+ }+ catch (error) {+ return null;+ }+}diff --git a/rnd/autogpt_builder/src/middleware.ts b/rnd/autogpt_builder/src/middleware.tsnew file mode 100644index 0000000000..afe29b6081--- /dev/null+++ b/rnd/autogpt_builder/src/middleware.ts@@ -0,0 +1,19 @@+import { updateSession } from '@/lib/supabase/middleware'+import { type NextRequest } from 'next/server'++export async function middleware(request: NextRequest) {+ return await updateSession(request)+}++export const config = {+ matcher: [+ /*+ * Match all request paths except for the ones starting with:+ * - _next/static (static files)+ * - _next/image (image optimization files)+ * - favicon.ico (favicon file)+ * Feel free to modify this pattern to include more paths.+ */+ '/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',+ ],+}diff --git a/rnd/autogpt_builder/yarn.lock b/rnd/autogpt_builder/yarn.lockindex 768df16b2a..e66cff7192 100644--- a/rnd/autogpt_builder/yarn.lock+++ b/rnd/autogpt_builder/yarn.lock@@ -606,11 +606,82 @@classcat "^5.0.3"zustand "^4.4.1"+"@rollup/rollup-linux-x64-gnu@^4.9.5":+ version "4.19.1"+ resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.1.tgz#0af2b6541ab0f4954d2c4f96bcdc7947420dd28c"+ integrity sha512-XUXeI9eM8rMP8aGvii/aOOiMvTs7xlCosq9xCjcqI9+5hBxtjDpD+7Abm1ZhVIFE1J2h2VIg0t2DX/gjespC2Q==+"@rushstack/eslint-patch@^1.3.3":version "1.10.3"resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.10.3.tgz#391d528054f758f81e53210f1a1eebcf1a8b1d20"integrity sha512-qC/xYId4NMebE6w/V33Fh9gWxLgURiNYgVNObbJl2LZv0GUUItCcCqC5axQSwRaAgaxl2mELq1rMzlswaQ0Zxg==+"@supabase/[email protected]":+ version "2.64.4"+ resolved "https://registry.yarnpkg.com/@supabase/auth-js/-/auth-js-2.64.4.tgz#f27fdabf1ebd1b532ceb57e8bbe66969ee09cfba"+ integrity sha512-9ITagy4WP4FLl+mke1rchapOH0RQpf++DI+WSG2sO1OFOZ0rW3cwAM0nCrMOxu+Zw4vJ4zObc08uvQrXx590Tg==+ dependencies:+ "@supabase/node-fetch" "^2.6.14"++"@supabase/[email protected]":+ version "2.4.1"+ resolved "https://registry.yarnpkg.com/@supabase/functions-js/-/functions-js-2.4.1.tgz#373e75f8d3453bacd71fb64f88d7a341d7b53ad7"+ integrity sha512-8sZ2ibwHlf+WkHDUZJUXqqmPvWQ3UHN0W30behOJngVh/qHHekhJLCFbh0AjkE9/FqqXtf9eoVvmYgfCLk5tNA==+ dependencies:+ "@supabase/node-fetch" "^2.6.14"++"@supabase/[email protected]", "@supabase/node-fetch@^2.6.14":+ version "2.6.15"+ resolved "https://registry.yarnpkg.com/@supabase/node-fetch/-/node-fetch-2.6.15.tgz#731271430e276983191930816303c44159e7226c"+ integrity sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==+ dependencies:+ whatwg-url "^5.0.0"++"@supabase/[email protected]":+ version "1.15.8"+ resolved "https://registry.yarnpkg.com/@supabase/postgrest-js/-/postgrest-js-1.15.8.tgz#827aaa408cdbc89e67d0a758e7a545ac86e34312"+ integrity sha512-YunjXpoQjQ0a0/7vGAvGZA2dlMABXFdVI/8TuVKtlePxyT71sl6ERl6ay1fmIeZcqxiuFQuZw/LXUuStUG9bbg==+ dependencies:+ "@supabase/node-fetch" "^2.6.14"++"@supabase/[email protected]":+ version "2.10.2"+ resolved "https://registry.yarnpkg.com/@supabase/realtime-js/-/realtime-js-2.10.2.tgz#c2b42d17d723d2d2a9146cfad61dc3df1ce3127e"+ integrity sha512-qyCQaNg90HmJstsvr2aJNxK2zgoKh9ZZA8oqb7UT2LCh3mj9zpa3Iwu167AuyNxsxrUE8eEJ2yH6wLCij4EApA==+ dependencies:+ "@supabase/node-fetch" "^2.6.14"+ "@types/phoenix" "^1.5.4"+ "@types/ws" "^8.5.10"+ ws "^8.14.2"++"@supabase/ssr@^0.4.0":+ version "0.4.0"+ resolved "https://registry.yarnpkg.com/@supabase/ssr/-/ssr-0.4.0.tgz#3ecb607e5346e6e09d50c106c2335db0e97903dd"+ integrity sha512-6WS3NUvHDhCPAFN2kJ79AQDO8+M9fJ7y2fYpxgZqIuJEpnnGsHDNnB5Xnv8CiaJIuRU+0pKboy62RVZBMfZ0Lg==+ dependencies:+ cookie "^0.6.0"+ optionalDependencies:+ "@rollup/rollup-linux-x64-gnu" "^4.9.5"++"@supabase/[email protected]":+ version "2.6.0"+ resolved "https://registry.yarnpkg.com/@supabase/storage-js/-/storage-js-2.6.0.tgz#0fa5e04db760ed7f78e4394844a6d409e537adc5"+ integrity sha512-REAxr7myf+3utMkI2oOmZ6sdplMZZ71/2NEIEMBZHL9Fkmm3/JnaOZVSRqvG4LStYj2v5WhCruCzuMn6oD/Drw==+ dependencies:+ "@supabase/node-fetch" "^2.6.14"++"@supabase/supabase-js@^2.45.0":+ version "2.45.0"+ resolved "https://registry.yarnpkg.com/@supabase/supabase-js/-/supabase-js-2.45.0.tgz#d0778ab1a5a3ba2f4207e6c87cc6e288786ca0e5"+ integrity sha512-j66Mfs8RhzCQCKxKogAFQYH9oNhRmgIdKk6pexguI2Oc7hi+nL9UNJug5aL1tKnBdaBM3h65riPLQSdL6sWa3Q==+ dependencies:+ "@supabase/auth-js" "2.64.4"+ "@supabase/functions-js" "2.4.1"+ "@supabase/node-fetch" "2.6.15"+ "@supabase/postgrest-js" "1.15.8"+ "@supabase/realtime-js" "2.10.2"+ "@supabase/storage-js" "2.6.0"+"@swc/counter@^0.1.3":version "0.1.3"resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9"@@ -882,6 +953,13 @@resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433"integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==+"@types/node@*":+ version "22.0.0"+ resolved "https://registry.yarnpkg.com/@types/node/-/node-22.0.0.tgz#04862a2a71e62264426083abe1e27e87cac05a30"+ integrity sha512-VT7KSYudcPOzP5Q0wfbowyNLaVR8QWUdw+088uFWwfvpY6uCWaXpqV6ieLAu9WBcnTa7H4Z5RLK8I5t2FuOcqw==+ dependencies:+ undici-types "~6.11.1"+"@types/node@^20":version "20.14.9"resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.9.tgz#12e8e765ab27f8c421a1820c99f5f313a933b420"@@ -889,6 +967,11 @@dependencies:undici-types "~5.26.4"+"@types/phoenix@^1.5.4":+ version "1.6.5"+ resolved "https://registry.yarnpkg.com/@types/phoenix/-/phoenix-1.6.5.tgz#5654e14ec7ad25334a157a20015996b6d7d2075e"+ integrity sha512-xegpDuR+z0UqG9fwHqNoy3rI7JDlvaPh2TY47Fl80oq6g+hXT+c/LEuE43X48clZ6lOfANl5WrPur9fYO1RJ/w==+"@types/prop-types@*":version "15.7.12"resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6"@@ -926,6 +1009,13 @@resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.10.tgz#04ffa7f406ab628f7f7e97ca23e290cd8ab15efc"integrity sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==+"@types/ws@^8.5.10":+ version "8.5.12"+ resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.12.tgz#619475fe98f35ccca2a2f6c137702d85ec247b7e"+ integrity sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==+ dependencies:+ "@types/node" "*"+"@typescript-eslint/parser@^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0":version "7.2.0"resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.2.0.tgz#44356312aea8852a3a82deebdacd52ba614ec07a"@@ -1366,6 +1456,11 @@ [email protected]:resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==+cookie@^0.6.0:+ version "0.6.0"+ resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"+ integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==+cross-spawn@^7.0.0, cross-spawn@^7.0.2:version "7.0.3"resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"@@ -3546,6 +3641,11 @@ react-hook-form@^7.52.1:resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.52.1.tgz#ec2c96437b977f8b89ae2d541a70736c66284852"integrity sha512-uNKIhaoICJ5KQALYZ4TOaOLElyM+xipord+Ha3crEFhTntdLvWZqVY49Wqd/0GiVCA/f9NjemLeiNPjG7Hpurg==+react-icons@^5.2.1:+ version "5.2.1"+ resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-5.2.1.tgz#28c2040917b2a2eda639b0f797bff1888e018e4a"+ integrity sha512-zdbW5GstTzXaVKvGSyTaBalt7HSfuK5ovrzlpyiWHAFXndXTdd/1hdDHI4xBM1Mn7YriT6aqESucFl9kEXzrdw==+react-is@^16.10.2, react-is@^16.13.1:version "16.13.1"resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"@@ -4131,6 +4231,11 @@ to-regex-range@^5.0.1:dependencies:is-number "^7.0.0"+tr46@~0.0.3:+ version "0.0.3"+ resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"+ integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==+trim-lines@^3.0.0:version "3.0.1"resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338"@@ -4242,6 +4347,11 @@ undici-types@~5.26.4:resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==+undici-types@~6.11.1:+ version "6.11.1"+ resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.11.1.tgz#432ea6e8efd54a48569705a699e62d8f4981b197"+ integrity sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ==+unified@^11.0.0:version "11.0.5"resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.5.tgz#f66677610a5c0a9ee90cab2b8d4d66037026d9e1"@@ -4377,6 +4487,19 @@ warning@^4.0.3:dependencies:loose-envify "^1.0.0"+webidl-conversions@^3.0.0:+ version "3.0.1"+ resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"+ integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==++whatwg-url@^5.0.0:+ version "5.0.0"+ resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"+ integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==+ dependencies:+ tr46 "~0.0.3"+ webidl-conversions "^3.0.0"+which-boxed-primitive@^1.0.2:version "1.0.2"resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"@@ -4462,6 +4585,11 @@ wrappy@1:resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==+ws@^8.14.2:+ version "8.18.0"+ resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc"+ integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==+yaml@^2.3.4:version "2.4.5"resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.5.tgz#60630b206dd6d84df97003d33fc1ddf6296cca5e"