g1t/apps/web/app/root.tsx

530 lines20,831 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";
36import "./app.css";
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);
141 const [listed, counts, account, usage, limit, entitlements, shared] = await Promise.all([
142 kept("projects", () => projects.list(workspace!.slug, user)),
143 path ? countsFor(context, params) : Promise.resolve(null),
144 kept("account", () => billing.account(workspace!.slug, user)),
145 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)),
146 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
147 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
148 sharedRepos(user),
Agents as a team: lifecycle, merge queue, billing and a new shell149 ]);
150 return {
151 workspace,
Projects: what a workspace builds and runs, first on every page152 // Projects are what the sidebar lists: what the workspace builds and runs.
153 repos: listed?.ok
154 ? listed.value.map((project) => ({
155 namespace: project.workspace,
156 name: project.slug,
157 title: project.name,
158 isPrivate: project.private,
159 }))
160 : [],
Agents as a team: lifecycle, merge queue, billing and a new shell161 repo:
162 path && counts?.ok
163 ? {
164 ...path,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look165 // Until the repository's own page says what their role is.
166 member: hasAccessIn(user, path.namespace),
Agents as a team: lifecycle, merge queue, billing and a new shell167 issues: counts.value.issues,
168 pulls: counts.value.pulls,
169 }
170 : null,
Billing accounts, terms and enterprises; g1t is no longer free171 // Where the workspace stands against its usage limit, once billing is on.
172 limit:
173 account?.ok && account.value.status.enabled && limit?.ok
174 ? {
175 exposureMicros: limit.value.exposureMicros,
176 ceilingMicros: limit.value.ceilingMicros,
177 state: limit.value.state,
178 comped: limit.value.trust === "internal",
179 }
180 : null,
Free while g1t is being built out; agents can check out their own forks181 free: account?.ok ? Boolean(account.value.status.free) : false,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look182 // A spend spike or a hold pauses new compute: the shell says so on every page.
183 compute:
184 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
185 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
186 : null,
187 shared,
Usage while free is shown at cost; agents get rustfmt and clippy188 // While g1t is free every charge is zero, so usage is shown at cost.
189 monthUsageMicros: usage?.ok ? (usage.value.free ? usage.value.usedMicros : usage.value.spentMicros) : null,
Agents as a team: lifecycle, merge queue, billing and a new shell190 };
191}
192
Fast pages, required checks on the branch, self-hosted runners, honest incidents193/** How long one isolate keeps the sidebar's workspace answers. */
194const SHELL_TTL_MS = 15_000;
195
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look196/** Most repositories listed under Shared with you. */
197const MAX_SHARED = 20;
198
199/**
200 * Repositories shared with the user in workspaces they do not belong to,
201 * by their grants: only those, never the workspace's other repositories.
202 */
203async function sharedRepos(user: User): Promise<ShellData["shared"]> {
204 const outside = new Set(sharedWorkspaces(user));
205 if (outside.size === 0) return [];
206 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 incidents207 const found = await readableRepos(ids, user);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look208 return found
Fast pages, required checks on the branch, self-hosted runners, honest incidents209 .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 look210 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
211}
212
API and MCP server, Rust identity service, registration, site redesign213function HeaderLink({ to, children }: { to: string; children: React.ReactNode }) {
214 return (
215 <NavLink
216 to={to}
217 className={({ isActive }) =>
218 `rounded-md px-2.5 py-1.5 text-sm transition-colors hover:bg-raised hover:text-fg ${
219 isActive ? "text-fg" : "text-muted"
220 }`
221 }
222 >
223 {children}
224 </NavLink>
225 );
226}
227
Search across all of g1t, Explore, and a command palette228/** What the palette offers someone without the app's sidebar. */
229const PUBLIC_COMMANDS: PaletteCommand[] = [
230 { label: "Explore", hint: "Public projects", to: "/explore", icon: <Compass size={15} /> },
231 { label: "Search g1t", hint: "Repositories, code, issues, people", to: "/search", icon: <Search size={15} /> },
232 { label: "Pricing", to: "/pricing", icon: <CreditCard size={15} /> },
233 { label: "Documentation", to: "https://docs.g1t.sh/", icon: <BookOpen size={15} /> },
234 { label: "Sign in", to: "/login", icon: <LogIn size={15} /> },
235 { label: "Sign up", to: "/register", icon: <Plus size={15} /> },
236];
237
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look238/** Sign up, or Request access while g1t is invite-only. */
239function SignUpButton() {
240 const copy = useSignUpCopy();
241 return <ButtonLink to="/register">{copy.primary}</ButtonLink>;
242}
243
Email verification, password reset, and Git for AI scale positioning244function Header({ user }: { user: User | null | undefined }) {
Acceptance checks in sandboxes, line comments and review verdicts245 const submit = useSubmit();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look246 const signUp = useSignUpCopy();
Search across all of g1t, Explore, and a command palette247 const [palette, setPalette] = useState(false);
248 usePaletteShortcut(() => setPalette((open) => !open));
249 const params = useParams();
250 const repo = params.owner && params.repo ? `${params.owner}/${params.repo}` : null;
API and MCP server, Rust identity service, registration, site redesign251 return (
252 <header className="sticky top-0 z-40 border-b border-line bg-surface/85 backdrop-blur">
253 <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 look254 <Link to="/" aria-label="g1t home" className="mr-2 flex">
API and MCP server, Rust identity service, registration, site redesign255 <Logo />
256 </Link>
257 <Form action="/search" role="search" className="relative hidden grow sm:block sm:max-w-xs">
258 <Search
259 size={14}
260 className="pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-faint"
261 />
262 <input
263 name="q"
Agents as a team: lifecycle, merge queue, billing and a new shell264 {...notACredential()}
Search across all of g1t, Explore, and a command palette265 placeholder="Search g1t"
266 aria-label="Search g1t"
267 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 redesign268 />
Search across all of g1t, Explore, and a command palette269 <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">
270 ⌘K
271 </kbd>
API and MCP server, Rust identity service, registration, site redesign272 </Form>
Search across all of g1t, Explore, and a command palette273 <button
274 type="button"
275 aria-label="Search g1t"
276 onClick={() => setPalette(true)}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look277 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 palette278 >
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look279 <Search size={18} />
Search across all of g1t, Explore, and a command palette280 </button>
281 <CommandPalette
282 open={palette}
283 onOpenChange={setPalette}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look284 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 palette285 repo={repo}
286 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look287 <nav aria-label="Main" className="hidden items-center gap-0.5 sm:flex">
API and MCP server, Rust identity service, registration, site redesign288 <HeaderLink to="/explore">Explore</HeaderLink>
Prices keep themselves current with what g1t pays289 <HeaderLink to="/pricing">Pricing</HeaderLink>
Docs as their own app; shared theme package290 <HeaderLink to="https://docs.g1t.sh/">Docs</HeaderLink>
API and MCP server, Rust identity service, registration, site redesign291 </nav>
292 <div className="ml-auto flex items-center gap-2">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look293 {/* On a phone the links fold into one menu, so the bar fits. */}
294 <DropdownMenu>
295 <DropdownMenuTrigger
296 aria-label="Menu"
297 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"
298 >
299 <Menu size={18} />
300 </DropdownMenuTrigger>
301 <DropdownMenuContent align="end" className="w-52">
302 <DropdownMenuItem asChild className="min-h-11">
303 <Link to="/explore">
304 <Compass />
305 Explore
306 </Link>
307 </DropdownMenuItem>
308 <DropdownMenuItem asChild className="min-h-11">
309 <Link to="/pricing">
310 <CreditCard />
311 Pricing
312 </Link>
313 </DropdownMenuItem>
314 <DropdownMenuItem asChild className="min-h-11">
315 <Link to="https://docs.g1t.sh/">
316 <BookOpen />
317 Docs
318 </Link>
319 </DropdownMenuItem>
320 {!user && (
321 <>
322 <DropdownMenuSeparator />
323 <DropdownMenuItem asChild className="min-h-11">
324 <Link to="/login">
325 <LogIn />
326 Sign in
327 </Link>
328 </DropdownMenuItem>
329 </>
330 )}
331 </DropdownMenuContent>
332 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign333 {user ? (
334 <>
335 <Link
336 to="/new"
Projects live: fixes from walking them end to end337 aria-label="New project"
API and MCP server, Rust identity service, registration, site redesign338 className="rounded-md border border-line p-1.5 text-muted transition-colors hover:border-line-strong hover:text-fg"
339 >
340 <Plus size={16} />
341 </Link>
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)342 <DropdownMenu>
343 <DropdownMenuTrigger
344 aria-label="Account menu"
345 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 redesign346 >
Workspace names and icons, and a component kit for every control347 <Avatar name={user.username} image={user.avatar} size={24} />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)348 <ChevronDown size={14} className="text-faint" />
349 </DropdownMenuTrigger>
350 <DropdownMenuContent align="end" className="w-56">
351 <DropdownMenuLabel>
352 Signed in as{" "}
353 <span className="font-mono font-medium text-fg">
354 {user.username}
355 </span>
356 </DropdownMenuLabel>
357 <DropdownMenuSeparator />
Workspaces own repositories358 {(user.workspaces ?? []).map((membership) => (
359 <DropdownMenuItem asChild key={membership.slug}>
360 <Link to={`/${membership.slug}`}>
Workspace names and icons, and a component kit for every control361 <Avatar name={membership.slug} image={membership.avatar} size={16} square />
362 <span className="min-w-0 truncate">{membership.name || membership.slug}</span>
Workspaces own repositories363 </Link>
364 </DropdownMenuItem>
365 ))}
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)366 <DropdownMenuItem asChild>
Workspaces own repositories367 <Link to="/workspaces/new">
368 <Plus />
369 New workspace
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)370 </Link>
371 </DropdownMenuItem>
Workspaces own repositories372 <DropdownMenuSeparator />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)373 <DropdownMenuItem asChild>
374 <Link to="/">
375 <LayoutDashboard />
376 Mission control
377 </Link>
378 </DropdownMenuItem>
379 <DropdownMenuItem asChild>
380 <Link to="/new">
381 <Plus />
Projects live: fixes from walking them end to end382 New project
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)383 </Link>
384 </DropdownMenuItem>
385 <DropdownMenuSeparator />
386 <DropdownMenuItem asChild>
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas387 <Link to="/settings/profile">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)388 <Settings />
389 Settings
390 </Link>
391 </DropdownMenuItem>
392 <DropdownMenuItem asChild>
Docs as their own app; shared theme package393 <Link to="https://docs.g1t.sh/quickstart/">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)394 <BookOpen />
395 Documentation
396 </Link>
397 </DropdownMenuItem>
398 <DropdownMenuSeparator />
Acceptance checks in sandboxes, line comments and review verdicts399 {/* Submitted from here: the menu closes on select, and a button
400 that has left the page cannot submit a form. */}
401 <DropdownMenuItem
402 onSelect={() => submit(null, { method: "post", action: "/logout" })}
403 >
404 <LogOut />
405 Sign out
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)406 </DropdownMenuItem>
407 </DropdownMenuContent>
408 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign409 </>
410 ) : (
411 <>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look412 <span className="hidden sm:contents">
413 <HeaderLink to="/login">Sign in</HeaderLink>
414 </span>
415 <SignUpButton />
API and MCP server, Rust identity service, registration, site redesign416 </>
417 )}
418 </div>
419 </div>
420 </header>
421 );
422}
423
Initial g1t: services, event bus, intents and attempts424export function Layout({ children }: { children: React.ReactNode }) {
425 // Undefined when the root loader itself failed.
Agents as a team: lifecycle, merge queue, billing and a new shell426 const root = useRouteLoaderData<typeof loader>("root");
427 const user = root?.user;
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put428 const { pathname } = useLocation();
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas429 // Drawn around the error page too: a 404 keeps the sidebar out of a
430 // project or workspace the viewer cannot see.
431 const error = useRouteError();
432 const missing = isRouteErrorResponse(error) && error.status === 404;
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look433 // The billing page shows the full banner itself.
434 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
Fast pages, required checks on the branch, self-hosted runners, honest incidents435 <SpikeBanner
436 compact
437 slug={root.shell.workspace.slug}
438 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
439 owner={root.shell.compute.owner}
440 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look441 );
442 const verify = user && !user.verified && (
Agents as a team: lifecycle, merge queue, billing and a new shell443 <Form
444 method="post"
445 action="/verify"
446 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"
447 >
448 <span>
449 Confirm your email address to create repositories and push. We
450 sent you a link.
451 </span>
452 <button type="submit" className="font-medium underline underline-offset-4">
453 Send it again
454 </button>
455 </Form>
456 );
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look457 const banner =
458 paused || verify ? (
459 <>
460 {paused}
461 {verify}
462 </>
463 ) : null;
Initial g1t: services, event bus, intents and attempts464 return (
465 <html lang="en">
466 <head>
467 <meta charSet="utf-8" />
468 <meta name="viewport" content="width=device-width, initial-scale=1" />
Dark gray base with lavender as an accent, and a live outcome view for plans469 <meta name="theme-color" content="#0f0f11" />
Initial g1t: services, event bus, intents and attempts470 <Meta />
471 <Links />
472 </head>
API and MCP server, Rust identity service, registration, site redesign473 <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 put474 {root?.shell && usesAppShell(pathname, user != null) ? (
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas475 <AppShell user={user ?? null} shell={root.shell} missing={missing} banner={banner}>
Agents as a team: lifecycle, merge queue, billing and a new shell476 {children}
477 </AppShell>
478 ) : (
479 <>
480 <Progress />
481 <Header user={user} />
482 {banner}
483 <div className="grow">{children}</div>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look484 <SiteFooter user={user} />
Agents as a team: lifecycle, merge queue, billing and a new shell485 </>
Email verification, password reset, and Git for AI scale positioning486 )}
Initial g1t: services, event bus, intents and attempts487 <ScrollRestoration />
488 <Scripts />
489 </body>
490 </html>
491 );
492}
493
494export default function App() {
495 return <Outlet />;
496}
497
498export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
API and MCP server, Rust identity service, registration, site redesign499 let title = "Something went wrong";
500 let details = "An unexpected error occurred. Try again in a moment.";
Initial g1t: services, event bus, intents and attempts501 let stack: string | undefined;
502
503 if (isRouteErrorResponse(error)) {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put504 // The same page for something private and something missing.
505 if (error.status === 404) return <NotFound data={error.data} />;
506 if (typeof error.data === "string" && error.data) {
API and MCP server, Rust identity service, registration, site redesign507 details = error.data;
508 }
509 } else if (import.meta.env.DEV && error instanceof Error) {
Initial g1t: services, event bus, intents and attempts510 details = error.message;
511 stack = error.stack;
512 }
513
514 return (
API and MCP server, Rust identity service, registration, site redesign515 <main className="mx-auto max-w-xl px-4 py-32 text-center">
516 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
517 <p className="mt-3 text-muted">{details}</p>
518 <div className="mt-8">
519 <ButtonLink to="/" variant="quiet">
520 Back to home
521 </ButtonLink>
522 </div>
Initial g1t: services, event bus, intents and attempts523 {stack && (
API and MCP server, Rust identity service, registration, site redesign524 <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 attempts525 <code>{stack}</code>
526 </pre>
527 )}
528 </main>
529 );
530}