g1t/apps/web/app/root.tsx

535 lines21,148 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Initial g1t: services, event bus, intents and attempts1import {
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)2 BookOpen,
3 ChevronDown,
Search across all of g1t, Explore, and a command palette4 Compass,
5 CreditCard,
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)6 LayoutDashboard,
Search across all of g1t, Explore, and a command palette7 LogIn,
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)8 LogOut,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look9 Menu,
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)10 Plus,
11 Search,
12 Settings,
13} from "lucide-react";
Fast pages, required checks on the branch, self-hosted runners, honest incidents14import { useState } from "react";
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)15import {
Initial g1t: services, event bus, intents and attempts16 Form,
17 isRouteErrorResponse,
18 Link,
19 Links,
20 Meta,
API and MCP server, Rust identity service, registration, site redesign21 NavLink,
Initial g1t: services, event bus, intents and attempts22 Outlet,
23 Scripts,
24 ScrollRestoration,
Agents as a team: lifecycle, merge queue, billing and a new shell25 type ShouldRevalidateFunctionArgs,
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put26 useLocation,
Search across all of g1t, Explore, and a command palette27 useParams,
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas28 useRouteError,
Initial g1t: services, event bus, intents and attempts29 useRouteLoaderData,
Acceptance checks in sandboxes, line comments and review verdicts30 useSubmit,
Initial g1t: services, event bus, intents and attempts31} from "react-router";
32
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look33import { type User, hasAccessIn, sharedWorkspaces } from "@g1t/contracts";
Email verification, password reset, and Git for AI scale positioning34
Initial g1t: services, event bus, intents and attempts35import type { Route } from "./+types/root";
Load the stylesheet first; plain legal contact details36import appCss from "./app.css?url";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look37import displayFont from "@g1t/theme/fonts/bricolage-grotesque-latin.woff2?url";
38import sansFont from "@g1t/theme/fonts/hanken-grotesk-latin.woff2?url";
Initial g1t: services, event bus, intents and attempts39import { Logo } from "./components/logo";
Agents as a team: lifecycle, merge queue, billing and a new shell40import { Avatar, ButtonLink, notACredential } from "./components/ui";
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)41import {
42 DropdownMenu,
43 DropdownMenuContent,
44 DropdownMenuItem,
45 DropdownMenuLabel,
46 DropdownMenuSeparator,
47 DropdownMenuTrigger,
48} from "./components/ui/dropdown-menu";
Agents as a team: lifecycle, merge queue, billing and a new shell49import { AppShell, Progress, type ShellData } from "./components/shell";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look50import { SiteFooter } from "./components/footer";
Fast pages, required checks on the branch, self-hosted runners, honest incidents51import { SpikeBanner } from "./components/spike-banner";
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put52import { readCookie } from "./lib/mission";
53import { WORKSPACE_COOKIE, workspaceFor } from "./lib/workspace-choice";
54import { NotFound } from "./components/not-found";
55import { usesAppShell } from "./lib/chrome";
Search across all of g1t, Explore, and a command palette56import { CommandPalette, type PaletteCommand, usePaletteShortcut } from "./components/command-palette";
Fast pages, required checks on the branch, self-hosted runners, honest incidents57import { billing, projects } from "./lib/services.server";
58import { countsFor, readableRepos } from "./lib/access.server";
59import { shortCache } from "./lib/cache.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look60import { getViewer, viewerMiddleware } from "./lib/session.server";
61import { registrationMode } from "./lib/registration.server";
62import { useSignUpCopy } from "./lib/registration";
63
Initial g1t: services, event bus, intents and attempts64
65export const links: Route.LinksFunction = () => [
The fleet: g1t's new mark66 { rel: "icon", href: "/favicon.ico", sizes: "32x32" },
Initial g1t: services, event bus, intents and attempts67 { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
The fleet: g1t's new mark68 { rel: "icon", type: "image/png", sizes: "192x192", href: "/icon-192.png" },
69 { rel: "apple-touch-icon", href: "/apple-touch-icon.png" },
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look70 // The text and headline faces are wanted on every page, so they start
71 // loading with the stylesheet; mono waits until something uses it.
72 { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
73 { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
Initial g1t: services, event bus, intents and attempts74];
75
76export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware];
77
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put78export async function loader({ context, params, request }: Route.LoaderArgs) {
Agents as a team: lifecycle, merge queue, billing and a new shell79 const user = getViewer(context);
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put80 const chosen = readCookie(request.headers.get("cookie"), WORKSPACE_COOKIE);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look81 // What sign-up buttons say: Request access while g1t is invite-only.
82 const [shell, mode] = await Promise.all([
Fast pages, required checks on the branch, self-hosted runners, honest incidents83 user ? shellFor(user, params, chosen, context) : visitorShell(params, context),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look84 user ? Promise.resolve(null) : registrationMode(),
85 ]);
86 return { user, shell, inviteOnly: mode !== "open" };
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put87}
88
89/**
90 * The sidebar for someone not signed in: nothing of their own, only the
91 * open counts of the project being looked at. One call, and only in a
92 * project; it answers the same for a private project as a missing one.
93 */
Fast pages, required checks on the branch, self-hosted runners, honest incidents94async function visitorShell(params: { owner?: string; repo?: string }, context: Route.LoaderArgs["context"]): Promise<ShellData> {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put95 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
Fast pages, required checks on the branch, self-hosted runners, honest incidents96 const counts = path ? await countsFor(context, params) : null;
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put97 return {
98 workspace: null,
99 repos: [],
100 repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null,
101 limit: null,
102 monthUsageMicros: null,
103 };
Initial g1t: services, event bus, intents and attempts104}
105
Agents as a team: lifecycle, merge queue, billing and a new shell106/**
107 * The sidebar only changes with the workspace or repository being looked
108 * at, or after something was submitted: not on every page within them.
109 */
110export function shouldRevalidate({
111 currentParams,
112 nextParams,
113 formMethod,
114 defaultShouldRevalidate,
115}: ShouldRevalidateFunctionArgs) {
116 if (formMethod && formMethod !== "GET") return defaultShouldRevalidate;
117 return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo;
118}
119
120/**
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put121 * The sidebar: the workspace you chose (lib/workspace-choice.ts), or the
122 * one whose own pages these are; its projects; and the repository being
123 * looked at. A project in another workspace does not switch it.
Agents as a team: lifecycle, merge queue, billing and a new shell124 */
125async function shellFor(
126 user: User,
127 params: { owner?: string; repo?: string },
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put128 chosen: string | null,
Fast pages, required checks on the branch, self-hosted runners, honest incidents129 context: Route.LoaderArgs["context"],
Agents as a team: lifecycle, merge queue, billing and a new shell130): Promise<ShellData> {
131 const memberships = user.workspaces ?? [];
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put132 const workspace = workspaceFor(memberships, chosen, params);
Agents as a team: lifecycle, merge queue, billing and a new shell133 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
Usage, like a hosting provider's: what agents cost, per day, task, repository and pull request134 const now = new Date();
135 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
Fast pages, required checks on the branch, self-hosted runners, honest incidents136 // What the sidebar shows of the workspace changes rarely: kept for a few
137 // seconds per person and workspace, except just after they changed
138 // something (lib/cache.server.ts).
139 const kept = <T,>(what: string, load: () => Promise<T>) =>
140 workspace ? shortCache(`shell:${what}:${user.id}:${workspace.slug}`, SHELL_TTL_MS, load) : Promise.resolve(null);
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor141 const [listed, counts, status, usage, limit, entitlements, shared] = await Promise.all([
Fast pages, required checks on the branch, self-hosted runners, honest incidents142 kept("projects", () => projects.list(workspace!.slug, user)),
143 path ? countsFor(context, params) : Promise.resolve(null),
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor144 // Whether billing is on, without reading the account: that asks the
145 // card processor about the workspace's cards, too slow for every page.
146 kept("status", () => billing.status()).catch(() => null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents147 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)),
148 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
149 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
150 sharedRepos(user),
Agents as a team: lifecycle, merge queue, billing and a new shell151 ]);
152 return {
153 workspace,
Projects: what a workspace builds and runs, first on every page154 // Projects are what the sidebar lists: what the workspace builds and runs.
155 repos: listed?.ok
156 ? listed.value.map((project) => ({
157 namespace: project.workspace,
158 name: project.slug,
159 title: project.name,
160 isPrivate: project.private,
161 }))
162 : [],
Agents as a team: lifecycle, merge queue, billing and a new shell163 repo:
164 path && counts?.ok
165 ? {
166 ...path,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look167 // Until the repository's own page says what their role is.
168 member: hasAccessIn(user, path.namespace),
Agents as a team: lifecycle, merge queue, billing and a new shell169 issues: counts.value.issues,
170 pulls: counts.value.pulls,
171 }
172 : null,
Billing accounts, terms and enterprises; g1t is no longer free173 // Where the workspace stands against its usage limit, once billing is on.
174 limit:
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor175 status?.enabled && limit?.ok
Billing accounts, terms and enterprises; g1t is no longer free176 ? {
177 exposureMicros: limit.value.exposureMicros,
178 ceilingMicros: limit.value.ceilingMicros,
179 state: limit.value.state,
180 comped: limit.value.trust === "internal",
181 }
182 : null,
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor183 free: Boolean(status?.free),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look184 // A spend spike or a hold pauses new compute: the shell says so on every page.
185 compute:
186 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
187 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
188 : null,
189 shared,
Usage while free is shown at cost; agents get rustfmt and clippy190 // While g1t is free every charge is zero, so usage is shown at cost.
191 monthUsageMicros: usage?.ok ? (usage.value.free ? usage.value.usedMicros : usage.value.spentMicros) : null,
Agents as a team: lifecycle, merge queue, billing and a new shell192 };
193}
194
Fast pages, required checks on the branch, self-hosted runners, honest incidents195/** How long one isolate keeps the sidebar's workspace answers. */
196const SHELL_TTL_MS = 15_000;
197
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look198/** Most repositories listed under Shared with you. */
199const MAX_SHARED = 20;
200
201/**
202 * Repositories shared with the user in workspaces they do not belong to,
203 * by their grants: only those, never the workspace's other repositories.
204 */
205async function sharedRepos(user: User): Promise<ShellData["shared"]> {
206 const outside = new Set(sharedWorkspaces(user));
207 if (outside.size === 0) return [];
208 const ids = (user.grants ?? []).filter((grant) => outside.has(grant.workspace)).map((grant) => grant.repo_id).slice(0, MAX_SHARED);
Fast pages, required checks on the branch, self-hosted runners, honest incidents209 const found = await readableRepos(ids, user);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look210 return found
Fast pages, required checks on the branch, self-hosted runners, honest incidents211 .map((repo) => ({ namespace: repo.namespace, name: repo.name, isPrivate: repo.isPrivate }))
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look212 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
213}
214
API and MCP server, Rust identity service, registration, site redesign215function HeaderLink({ to, children }: { to: string; children: React.ReactNode }) {
216 return (
217 <NavLink
218 to={to}
219 className={({ isActive }) =>
220 `rounded-md px-2.5 py-1.5 text-sm transition-colors hover:bg-raised hover:text-fg ${
221 isActive ? "text-fg" : "text-muted"
222 }`
223 }
224 >
225 {children}
226 </NavLink>
227 );
228}
229
Search across all of g1t, Explore, and a command palette230/** What the palette offers someone without the app's sidebar. */
231const PUBLIC_COMMANDS: PaletteCommand[] = [
232 { label: "Explore", hint: "Public projects", to: "/explore", icon: <Compass size={15} /> },
233 { label: "Search g1t", hint: "Repositories, code, issues, people", to: "/search", icon: <Search size={15} /> },
234 { label: "Pricing", to: "/pricing", icon: <CreditCard size={15} /> },
235 { label: "Documentation", to: "https://docs.g1t.sh/", icon: <BookOpen size={15} /> },
236 { label: "Sign in", to: "/login", icon: <LogIn size={15} /> },
237 { label: "Sign up", to: "/register", icon: <Plus size={15} /> },
238];
239
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look240/** Sign up, or Request access while g1t is invite-only. */
241function SignUpButton() {
242 const copy = useSignUpCopy();
243 return <ButtonLink to="/register">{copy.primary}</ButtonLink>;
244}
245
Email verification, password reset, and Git for AI scale positioning246function Header({ user }: { user: User | null | undefined }) {
Acceptance checks in sandboxes, line comments and review verdicts247 const submit = useSubmit();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look248 const signUp = useSignUpCopy();
Search across all of g1t, Explore, and a command palette249 const [palette, setPalette] = useState(false);
250 usePaletteShortcut(() => setPalette((open) => !open));
251 const params = useParams();
252 const repo = params.owner && params.repo ? `${params.owner}/${params.repo}` : null;
API and MCP server, Rust identity service, registration, site redesign253 return (
254 <header className="sticky top-0 z-40 border-b border-line bg-surface/85 backdrop-blur">
255 <div className="mx-auto flex h-14 max-w-6xl items-center gap-2 px-4">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look256 <Link to="/" aria-label="g1t home" className="mr-2 flex">
API and MCP server, Rust identity service, registration, site redesign257 <Logo />
258 </Link>
259 <Form action="/search" role="search" className="relative hidden grow sm:block sm:max-w-xs">
260 <Search
261 size={14}
262 className="pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-faint"
263 />
264 <input
265 name="q"
Agents as a team: lifecycle, merge queue, billing and a new shell266 {...notACredential()}
Search across all of g1t, Explore, and a command palette267 placeholder="Search g1t"
268 aria-label="Search g1t"
269 className="w-full rounded-md border border-line bg-bg py-1.5 pr-12 pl-8 text-sm outline-none transition-colors placeholder:text-faint hover:border-line-strong focus:border-accent-dim"
API and MCP server, Rust identity service, registration, site redesign270 />
Search across all of g1t, Explore, and a command palette271 <kbd className="pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded bg-raised px-1.5 font-mono text-[0.625rem] text-muted ring-1 ring-line">
272 ⌘K
273 </kbd>
API and MCP server, Rust identity service, registration, site redesign274 </Form>
Search across all of g1t, Explore, and a command palette275 <button
276 type="button"
277 aria-label="Search g1t"
278 onClick={() => setPalette(true)}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look279 className="flex size-10 items-center justify-center rounded-md text-muted transition-colors hover:bg-raised hover:text-fg sm:hidden"
Search across all of g1t, Explore, and a command palette280 >
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look281 <Search size={18} />
Search across all of g1t, Explore, and a command palette282 </button>
283 <CommandPalette
284 open={palette}
285 onOpenChange={setPalette}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look286 commands={user ? [{ label: "Mission control", to: "/", icon: <LayoutDashboard size={15} /> }, ...PUBLIC_COMMANDS.slice(0, 4)] : PUBLIC_COMMANDS.map((command) => (command.to === "/register" ? { ...command, label: signUp.primary } : command))}
Search across all of g1t, Explore, and a command palette287 repo={repo}
288 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look289 <nav aria-label="Main" className="hidden items-center gap-0.5 sm:flex">
API and MCP server, Rust identity service, registration, site redesign290 <HeaderLink to="/explore">Explore</HeaderLink>
Prices keep themselves current with what g1t pays291 <HeaderLink to="/pricing">Pricing</HeaderLink>
Docs as their own app; shared theme package292 <HeaderLink to="https://docs.g1t.sh/">Docs</HeaderLink>
API and MCP server, Rust identity service, registration, site redesign293 </nav>
294 <div className="ml-auto flex items-center gap-2">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look295 {/* On a phone the links fold into one menu, so the bar fits. */}
296 <DropdownMenu>
297 <DropdownMenuTrigger
298 aria-label="Menu"
299 className="flex size-10 items-center justify-center rounded-md text-muted outline-none transition-colors hover:bg-raised hover:text-fg data-[state=open]:bg-raised data-[state=open]:text-fg sm:hidden"
300 >
301 <Menu size={18} />
302 </DropdownMenuTrigger>
303 <DropdownMenuContent align="end" className="w-52">
304 <DropdownMenuItem asChild className="min-h-11">
305 <Link to="/explore">
306 <Compass />
307 Explore
308 </Link>
309 </DropdownMenuItem>
310 <DropdownMenuItem asChild className="min-h-11">
311 <Link to="/pricing">
312 <CreditCard />
313 Pricing
314 </Link>
315 </DropdownMenuItem>
316 <DropdownMenuItem asChild className="min-h-11">
317 <Link to="https://docs.g1t.sh/">
318 <BookOpen />
319 Docs
320 </Link>
321 </DropdownMenuItem>
322 {!user && (
323 <>
324 <DropdownMenuSeparator />
325 <DropdownMenuItem asChild className="min-h-11">
326 <Link to="/login">
327 <LogIn />
328 Sign in
329 </Link>
330 </DropdownMenuItem>
331 </>
332 )}
333 </DropdownMenuContent>
334 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign335 {user ? (
336 <>
337 <Link
338 to="/new"
Projects live: fixes from walking them end to end339 aria-label="New project"
API and MCP server, Rust identity service, registration, site redesign340 className="rounded-md border border-line p-1.5 text-muted transition-colors hover:border-line-strong hover:text-fg"
341 >
342 <Plus size={16} />
343 </Link>
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)344 <DropdownMenu>
345 <DropdownMenuTrigger
346 aria-label="Account menu"
347 className="flex items-center gap-1.5 rounded-md p-1 outline-none transition-colors hover:bg-raised data-[state=open]:bg-raised"
API and MCP server, Rust identity service, registration, site redesign348 >
Workspace names and icons, and a component kit for every control349 <Avatar name={user.username} image={user.avatar} size={24} />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)350 <ChevronDown size={14} className="text-faint" />
351 </DropdownMenuTrigger>
352 <DropdownMenuContent align="end" className="w-56">
353 <DropdownMenuLabel>
354 Signed in as{" "}
355 <span className="font-mono font-medium text-fg">
356 {user.username}
357 </span>
358 </DropdownMenuLabel>
359 <DropdownMenuSeparator />
Workspaces own repositories360 {(user.workspaces ?? []).map((membership) => (
361 <DropdownMenuItem asChild key={membership.slug}>
362 <Link to={`/${membership.slug}`}>
Workspace names and icons, and a component kit for every control363 <Avatar name={membership.slug} image={membership.avatar} size={16} square />
364 <span className="min-w-0 truncate">{membership.name || membership.slug}</span>
Workspaces own repositories365 </Link>
366 </DropdownMenuItem>
367 ))}
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)368 <DropdownMenuItem asChild>
Workspaces own repositories369 <Link to="/workspaces/new">
370 <Plus />
371 New workspace
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)372 </Link>
373 </DropdownMenuItem>
Workspaces own repositories374 <DropdownMenuSeparator />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)375 <DropdownMenuItem asChild>
376 <Link to="/">
377 <LayoutDashboard />
378 Mission control
379 </Link>
380 </DropdownMenuItem>
381 <DropdownMenuItem asChild>
382 <Link to="/new">
383 <Plus />
Projects live: fixes from walking them end to end384 New project
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)385 </Link>
386 </DropdownMenuItem>
387 <DropdownMenuSeparator />
388 <DropdownMenuItem asChild>
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas389 <Link to="/settings/profile">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)390 <Settings />
391 Settings
392 </Link>
393 </DropdownMenuItem>
394 <DropdownMenuItem asChild>
Docs as their own app; shared theme package395 <Link to="https://docs.g1t.sh/quickstart/">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)396 <BookOpen />
397 Documentation
398 </Link>
399 </DropdownMenuItem>
400 <DropdownMenuSeparator />
Acceptance checks in sandboxes, line comments and review verdicts401 {/* Submitted from here: the menu closes on select, and a button
402 that has left the page cannot submit a form. */}
403 <DropdownMenuItem
404 onSelect={() => submit(null, { method: "post", action: "/logout" })}
405 >
406 <LogOut />
407 Sign out
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)408 </DropdownMenuItem>
409 </DropdownMenuContent>
410 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign411 </>
412 ) : (
413 <>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look414 <span className="hidden sm:contents">
415 <HeaderLink to="/login">Sign in</HeaderLink>
416 </span>
417 <SignUpButton />
API and MCP server, Rust identity service, registration, site redesign418 </>
419 )}
420 </div>
421 </div>
422 </header>
423 );
424}
425
Initial g1t: services, event bus, intents and attempts426export function Layout({ children }: { children: React.ReactNode }) {
427 // Undefined when the root loader itself failed.
Agents as a team: lifecycle, merge queue, billing and a new shell428 const root = useRouteLoaderData<typeof loader>("root");
429 const user = root?.user;
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put430 const { pathname } = useLocation();
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas431 // Drawn around the error page too: a 404 keeps the sidebar out of a
432 // project or workspace the viewer cannot see.
433 const error = useRouteError();
434 const missing = isRouteErrorResponse(error) && error.status === 404;
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look435 // The billing page shows the full banner itself.
436 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
Fast pages, required checks on the branch, self-hosted runners, honest incidents437 <SpikeBanner
438 compact
439 slug={root.shell.workspace.slug}
440 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
441 owner={root.shell.compute.owner}
442 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look443 );
444 const verify = user && !user.verified && (
Agents as a team: lifecycle, merge queue, billing and a new shell445 <Form
446 method="post"
447 action="/verify"
448 className="flex flex-wrap items-center justify-center gap-x-3 gap-y-1 border-b border-warn/30 bg-warn/10 px-4 py-2 text-sm"
449 >
450 <span>
451 Confirm your email address to create repositories and push. We
452 sent you a link.
453 </span>
454 <button type="submit" className="font-medium underline underline-offset-4">
455 Send it again
456 </button>
457 </Form>
458 );
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look459 const banner =
460 paused || verify ? (
461 <>
462 {paused}
463 {verify}
464 </>
465 ) : null;
Initial g1t: services, event bus, intents and attempts466 return (
467 <html lang="en">
468 <head>
469 <meta charSet="utf-8" />
470 <meta name="viewport" content="width=device-width, initial-scale=1" />
Dark gray base with lavender as an accent, and a live outcome view for plans471 <meta name="theme-color" content="#0f0f11" />
Put the stylesheet at the top of the head, before React Router's preloads472 {/* The stylesheet before everything React Router preloads, so a slow
473 connection paints sooner (docs/research/css-shipping.md). */}
Give the stylesheet a precedence so React places it before preloads474 <link rel="stylesheet" href={appCss} precedence="default" />
Initial g1t: services, event bus, intents and attempts475 <Meta />
476 <Links />
477 </head>
API and MCP server, Rust identity service, registration, site redesign478 <body className="flex min-h-screen flex-col">
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put479 {root?.shell && usesAppShell(pathname, user != null) ? (
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas480 <AppShell user={user ?? null} shell={root.shell} missing={missing} banner={banner}>
Agents as a team: lifecycle, merge queue, billing and a new shell481 {children}
482 </AppShell>
483 ) : (
484 <>
485 <Progress />
486 <Header user={user} />
487 {banner}
488 <div className="grow">{children}</div>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look489 <SiteFooter user={user} />
Agents as a team: lifecycle, merge queue, billing and a new shell490 </>
Email verification, password reset, and Git for AI scale positioning491 )}
Initial g1t: services, event bus, intents and attempts492 <ScrollRestoration />
493 <Scripts />
494 </body>
495 </html>
496 );
497}
498
499export default function App() {
500 return <Outlet />;
501}
502
503export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
API and MCP server, Rust identity service, registration, site redesign504 let title = "Something went wrong";
505 let details = "An unexpected error occurred. Try again in a moment.";
Initial g1t: services, event bus, intents and attempts506 let stack: string | undefined;
507
508 if (isRouteErrorResponse(error)) {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put509 // The same page for something private and something missing.
510 if (error.status === 404) return <NotFound data={error.data} />;
511 if (typeof error.data === "string" && error.data) {
API and MCP server, Rust identity service, registration, site redesign512 details = error.data;
513 }
514 } else if (import.meta.env.DEV && error instanceof Error) {
Initial g1t: services, event bus, intents and attempts515 details = error.message;
516 stack = error.stack;
517 }
518
519 return (
API and MCP server, Rust identity service, registration, site redesign520 <main className="mx-auto max-w-xl px-4 py-32 text-center">
521 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
522 <p className="mt-3 text-muted">{details}</p>
523 <div className="mt-8">
524 <ButtonLink to="/" variant="quiet">
525 Back to home
526 </ButtonLink>
527 </div>
Initial g1t: services, event bus, intents and attempts528 {stack && (
API and MCP server, Rust identity service, registration, site redesign529 <pre className="mt-8 overflow-x-auto rounded-lg border border-line p-4 text-left text-xs">
Initial g1t: services, event bus, intents and attempts530 <code>{stack}</code>
531 </pre>
532 )}
533 </main>
534 );
535}