-
Notifications
You must be signed in to change notification settings - Fork 42
feat: implement Nova early invite feature #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,175 @@ | ||
| "use client" | ||
|
|
||
| import { useState, useTransition, type FormEvent } from "react" | ||
| import { Check, LoaderCircle } from "lucide-react" | ||
|
|
||
| import { SendHorizontalIcon } from "@/components/animate-ui/icons/send-horizontal" | ||
| import { Button } from "@/components/ui/button" | ||
| import { Input } from "@/components/ui/input" | ||
| import { Label } from "@/components/ui/label" | ||
|
|
||
| type FormStatus = | ||
| | { type: "idle"; message: "" } | ||
| | { type: "success" | "error"; message: string } | ||
|
|
||
| export function NovaInviteForm() { | ||
| const [isPending, startTransition] = useTransition() | ||
| const [status, setStatus] = useState<FormStatus>({ type: "idle", message: "" }) | ||
|
|
||
| function handleSubmit(event: FormEvent<HTMLFormElement>) { | ||
| event.preventDefault() | ||
| const form = event.currentTarget | ||
| const formData = new FormData(form) | ||
|
|
||
| startTransition(async () => { | ||
| setStatus({ type: "idle", message: "" }) | ||
|
|
||
| try { | ||
| const response = await fetch("/api/nova/early-invite", { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ | ||
| name: formData.get("name"), | ||
| role: formData.get("role"), | ||
| email: formData.get("email"), | ||
| website: formData.get("website"), | ||
| }), | ||
| }) | ||
| const result = (await response.json()) as { | ||
| message?: string | ||
| error?: string | ||
| } | ||
|
|
||
| if (!response.ok) { | ||
| setStatus({ | ||
| type: "error", | ||
| message: result.error || "Something went wrong. Please try again.", | ||
| }) | ||
| return | ||
| } | ||
|
|
||
| form.reset() | ||
| setStatus({ | ||
| type: "success", | ||
| message: result.message || "You’re on Nova’s early invite list.", | ||
| }) | ||
| } catch { | ||
| setStatus({ | ||
| type: "error", | ||
| message: "We couldn’t reach Nova. Please try again.", | ||
| }) | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| const fieldClassName = | ||
| "h-11 rounded-lg border-white/[0.09] bg-black/20 px-3.5 text-sm shadow-inner shadow-black/10 transition-[border-color,background-color,box-shadow] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] placeholder:text-muted-foreground/30 focus-visible:border-primary/45 focus-visible:bg-black/30 focus-visible:ring-2 focus-visible:ring-primary/10 disabled:opacity-50" | ||
|
|
||
| return ( | ||
| <form onSubmit={handleSubmit} className="p-5 sm:p-7"> | ||
| <div className="grid gap-4 sm:grid-cols-2"> | ||
| <div className="space-y-2"> | ||
| <Label htmlFor="nova-name" className="font-mono text-[11px] uppercase tracking-[0.12em] text-foreground/65"> | ||
| Name | ||
| </Label> | ||
| <Input | ||
| id="nova-name" | ||
| name="name" | ||
| autoComplete="name" | ||
| placeholder="Ada Lovelace" | ||
| minLength={2} | ||
| maxLength={100} | ||
| required | ||
| disabled={isPending} | ||
| className={fieldClassName} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="space-y-2"> | ||
| <Label htmlFor="nova-role" className="font-mono text-[11px] uppercase tracking-[0.12em] text-foreground/65"> | ||
| Role | ||
| </Label> | ||
| <Input | ||
| id="nova-role" | ||
| name="role" | ||
| autoComplete="organization-title" | ||
| placeholder="Engineering lead" | ||
| minLength={2} | ||
| maxLength={120} | ||
| required | ||
| disabled={isPending} | ||
| className={fieldClassName} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="space-y-2 sm:col-span-2"> | ||
| <Label htmlFor="nova-email" className="font-mono text-[11px] uppercase tracking-[0.12em] text-foreground/65"> | ||
| Work email | ||
| </Label> | ||
| <Input | ||
| id="nova-email" | ||
| name="email" | ||
| type="email" | ||
| inputMode="email" | ||
| autoComplete="email" | ||
| placeholder="you@company.com" | ||
| maxLength={254} | ||
| required | ||
| disabled={isPending} | ||
| className={fieldClassName} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className="absolute -left-[9999px]" aria-hidden="true"> | ||
| <Label htmlFor="nova-website">Website</Label> | ||
| <Input | ||
| id="nova-website" | ||
| name="website" | ||
| tabIndex={-1} | ||
| autoComplete="off" | ||
| /> | ||
| </div> | ||
|
|
||
| <Button | ||
| type="submit" | ||
| size="lg" | ||
| disabled={isPending} | ||
| className="group mt-2 h-12 w-full rounded-lg font-mono text-xs uppercase tracking-[0.08em] shadow-[0_18px_45px_-24px_hsl(var(--primary))] transition-[transform,background-color,box-shadow] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] active:scale-[0.98] sm:col-span-2" | ||
| > | ||
| {isPending ? ( | ||
| <> | ||
| <span className="animate-spin motion-reduce:animate-none"> | ||
| <LoaderCircle /> | ||
| </span> | ||
| Sending request | ||
| </> | ||
| ) : ( | ||
| <> | ||
| Request early access | ||
| <SendHorizontalIcon size={16} aria-hidden="true" /> | ||
| </> | ||
| )} | ||
| </Button> | ||
| </div> | ||
|
|
||
| <div aria-live="polite" className="min-h-12 pt-4"> | ||
| {status.type === "success" ? ( | ||
| <p className="flex items-start gap-2 rounded-lg border border-emerald-400/15 bg-emerald-400/[0.055] px-3 py-2.5 text-sm leading-relaxed text-emerald-300"> | ||
| <Check className="mt-0.5 size-4 shrink-0" /> | ||
| {status.message} | ||
| </p> | ||
| ) : null} | ||
| {status.type === "error" ? ( | ||
| <p className="rounded-lg border border-red-400/15 bg-red-400/[0.055] px-3 py-2.5 text-sm leading-relaxed text-red-300"> | ||
| {status.message} | ||
| </p> | ||
| ) : null} | ||
| </div> | ||
|
|
||
| <p className="flex items-center justify-center gap-2 text-center text-xs leading-relaxed text-muted-foreground/50"> | ||
| <span className="size-1 rounded-full bg-primary/60" aria-hidden="true" /> | ||
| No noise. Only meaningful Nova updates. | ||
| </p> | ||
| </form> | ||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,159 @@ | ||
| import type { Metadata } from "next" | ||
| import { Bot, Check, CodeXml, MessagesSquare, Mic2 } from "lucide-react" | ||
|
|
||
| import { ClipboardListIcon } from "@/components/animate-ui/icons/clipboard-list" | ||
| import Footer from "@/components/homepage/footer" | ||
| import Navbar from "@/components/homepage/navbar" | ||
| import { NovaInviteForm } from "./nova-invite-form" | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Nova — The AI Engineer | Supercode", | ||
| description: | ||
| "Meet Nova by Supercode: an AI engineer that owns tasks, works through an agent harness, reviews code, and collaborates with your team by voice.", | ||
| openGraph: { | ||
| title: "Nova — The AI Engineer", | ||
| description: | ||
| "An accountable AI engineering teammate for implementation, code review, communication, and voice collaboration.", | ||
| url: "/nova", | ||
| }, | ||
| } | ||
|
|
||
| const capabilities = [ | ||
| { | ||
| icon: Bot, | ||
| label: "Agent harness", | ||
| detail: "Plans, executes, tests, and reports instead of stopping at suggestions.", | ||
| }, | ||
| { | ||
| icon: CodeXml, | ||
| label: "Code review", | ||
| detail: "Understands the codebase, surfaces risk, and helps move pull requests forward.", | ||
| }, | ||
| { | ||
| icon: Mic2, | ||
| label: "Voice native", | ||
| detail: "Discuss work, make decisions, and steer tasks as naturally as a teammate.", | ||
| }, | ||
| { | ||
| icon: MessagesSquare, | ||
| label: "Team connected", | ||
| detail: "Built to work where engineering teams already coordinate and communicate.", | ||
| }, | ||
| ] | ||
|
|
||
| export default function NovaPage() { | ||
| return ( | ||
| <main className="dark landing-fonts relative min-h-screen overflow-hidden bg-background text-foreground"> | ||
| <div | ||
| aria-hidden="true" | ||
| className="pointer-events-none absolute inset-0 opacity-[0.18]" | ||
| style={{ | ||
| backgroundImage: | ||
| "linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px)", | ||
| backgroundSize: "48px 48px", | ||
| maskImage: "linear-gradient(to bottom, black 10%, transparent 78%)", | ||
| }} | ||
| /> | ||
| <Navbar /> | ||
|
|
||
| <section className="relative mx-auto w-full max-w-[1240px] px-5 pb-28 pt-32 sm:px-8 sm:pt-40 lg:px-12 lg:pb-36"> | ||
| <div className="grid items-start gap-14 lg:grid-cols-[minmax(0,1.08fr)_minmax(360px,0.72fr)] lg:gap-16 xl:gap-24"> | ||
| <div className="pt-2 lg:pt-10"> | ||
| <div className="mb-8 inline-flex items-center gap-2.5 rounded-full border border-primary/20 bg-primary/[0.055] px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.2em] text-primary shadow-[inset_0_0_20px_hsl(var(--primary)/0.025)]"> | ||
| <span className="relative flex size-2 items-center justify-center"> | ||
| <span className="absolute size-2 animate-ping rounded-full bg-primary/35 motion-reduce:hidden" /> | ||
| <span className="relative size-1.5 rounded-full bg-primary" /> | ||
| </span> | ||
| Early Invite | ||
| </div> | ||
|
|
||
| {/* <p className="mb-4 font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/55"> | ||
| Supercode / 01 | ||
| </p> */} | ||
| <h1 className="max-w-4xl text-balance text-[clamp(3.35rem,7vw,6.8rem)] font-semibold leading-[0.88] tracking-[-0.065em] text-white"> | ||
| Meet Nova. | ||
| <span className="mt-2 block text-muted-foreground/60">Your AI engineer.</span> | ||
| </h1> | ||
|
|
||
| <p className="mt-8 max-w-xl text-pretty text-lg leading-8 text-muted-foreground sm:text-xl"> | ||
| Give Nova an outcome, not a prompt. It plans the work, writes and | ||
| reviews the code, runs the checks, and keeps your team in the loop. | ||
| </p> | ||
|
|
||
| <div className="mt-10 flex flex-wrap gap-x-7 gap-y-3 border-y border-white/[0.07] py-5 font-mono text-[11px] uppercase tracking-[0.12em] text-foreground/70"> | ||
| {["Owns the task", "Works in your repo", "Reports back"].map((item) => ( | ||
| <span key={item} className="flex items-center gap-2"> | ||
| <Check className="size-3.5 text-primary" aria-hidden="true" /> | ||
| {item} | ||
| </span> | ||
| ))} | ||
| </div> | ||
|
|
||
| {/* <div className="mt-10 grid gap-3 sm:grid-cols-2"> | ||
| {capabilities.map(({ icon: Icon, label, detail }, index) => ( | ||
| <article | ||
| key={label} | ||
| className="group relative overflow-hidden rounded-xl border border-white/[0.08] bg-white/[0.025] p-5 transition-[border-color,background-color,transform] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] hoverable:hover:-translate-y-0.5 hoverable:hover:border-primary/20 hoverable:hover:bg-white/[0.04]" | ||
| > | ||
| <div | ||
| aria-hidden="true" | ||
| className="absolute right-4 top-3 font-mono text-[10px] text-white/20" | ||
| > | ||
| 0{index + 1} | ||
| </div> | ||
| <div className="mb-6 flex size-9 items-center justify-center rounded-lg border border-primary/15 bg-primary/[0.055] text-primary transition-transform duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] hoverable:group-hover:scale-[1.04]"> | ||
| <Icon className="size-4" aria-hidden="true" /> | ||
| </div> | ||
| <h2 className="font-mono text-sm font-medium text-foreground"> | ||
| {label} | ||
| </h2> | ||
| <p className="mt-2 max-w-[32ch] text-sm leading-6 text-muted-foreground"> | ||
| {detail} | ||
| </p> | ||
| </article> | ||
| ))} | ||
| </div> */} | ||
|
|
||
| <div className="mt-7 flex items-center gap-3 font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground/45"> | ||
| <span className="size-1 rounded-full bg-primary/70" /> | ||
| task → plan → implement → test → review → report | ||
| </div> | ||
| </div> | ||
|
|
||
| <aside className="relative lg:sticky lg:top-50 lg:pt-10"> | ||
| <div className="relative overflow-hidden rounded-2xl border border-white/10 bg-[#171617]/90 shadow-[0_32px_100px_-40px_rgba(0,0,0,0.9)] backdrop-blur-xl"> | ||
| <div className="flex items-center gap-3 border-b border-white/[0.07] px-5 py-4 font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground/55"> | ||
| <div className="flex gap-1.5" aria-hidden="true"> | ||
| <span className="size-1.5 rounded-full bg-white/20" /> | ||
| <span className="size-1.5 rounded-full bg-white/12" /> | ||
| <span className="size-1.5 rounded-full bg-white/8" /> | ||
| </div> | ||
| <span>nova.init</span> | ||
| <span className="ml-auto text-primary/80">request access</span> | ||
| </div> | ||
| <div className="border-b border-white/[0.07] px-5 py-5 sm:px-7"> | ||
| <div className="flex items-start gap-3"> | ||
| <span className="mt-1 flex size-8 shrink-0 items-center justify-center rounded-lg border border-primary/20 bg-primary/[0.06] text-primary"> | ||
| <ClipboardListIcon size={16} aria-hidden="true" /> | ||
| </span> | ||
| <div> | ||
| <p className="text-sm font-medium text-white">Tell me where you build.</p> | ||
| <p className="mt-1 text-sm leading-6 text-muted-foreground"> | ||
| A few details help us shape the first Nova teams. | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <NovaInviteForm /> | ||
| </div> | ||
| <p className="mt-4 px-2 text-center font-mono text-[10px] uppercase tracking-[0.15em] text-muted-foreground/40"> | ||
| Private beta · Invitations sent in small batches | ||
| </p> | ||
| </aside> | ||
| </div> | ||
| </section> | ||
|
|
||
| <Footer /> | ||
| </main> | ||
| ) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Handle non-JSON HTTP responses.
response.json()throws when a proxy, redirect, or server failure returns HTML or plain text. The catch block then reports “We couldn’t reach Nova” although the server returned a response.Check
Content-Typeand handle JSON parsing failure separately. Preserveresponse.okwhen selecting the success or error state.Based on learnings, clients must not assume that an HTTP response body contains valid JSON.
🤖 Prompt for AI Agents
Source: Learnings