g1t/apps/web/app/root.tsx

537 lines21,299 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";
Self-hosting: the clone pack cache on S3 (MinIO, expiring), the API and MCP on their own port with PUBLIC_URL-derived addresses across the site, API and mail, scheduler --once, and smoke.sh covering pull requests from branches and forks and the merge queue62import { addresses } from "./lib/addresses.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look63import { useSignUpCopy } from "./lib/registration";
64
Initial g1t: services, event bus, intents and attempts65
66export const links: Route.LinksFunction = () => [
The fleet: g1t's new mark67 { rel: "icon", href: "/favicon.ico", sizes: "32x32" },
Initial g1t: services, event bus, intents and attempts68 { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
The fleet: g1t's new mark69 { rel: "icon", type: "image/png", sizes: "192x192", href: "/icon-192.png" },
70 { rel: "apple-touch-icon", href: "/apple-touch-icon.png" },
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look71 // The text and headline faces are wanted on every page, so they start
72 // loading with the stylesheet; mono waits until something uses it.
73 { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
74 { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
Initial g1t: services, event bus, intents and attempts75];
76
77export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware];
78
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put79export async function loader({ context, params, request }: Route.LoaderArgs) {
Agents as a team: lifecycle, merge queue, billing and a new shell80 const user = getViewer(context);
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put81 const chosen = readCookie(request.headers.get("cookie"), WORKSPACE_COOKIE);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look82 // What sign-up buttons say: Request access while g1t is invite-only.
83 const [shell, mode] = await Promise.all([
Fast pages, required checks on the branch, self-hosted runners, honest incidents84 user ? shellFor(user, params, chosen, context) : visitorShell(params, context),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look85 user ? Promise.resolve(null) : registrationMode(),
86 ]);
Self-hosting: the clone pack cache on S3 (MinIO, expiring), the API and MCP on their own port with PUBLIC_URL-derived addresses across the site, API and mail, scheduler --once, and smoke.sh covering pull requests from branches and forks and the merge queue87 // Where this g1t lives, for clone lines, agent setup and link previews.
88 return { user, shell, inviteOnly: mode !== "open", addresses: addresses() };
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put89}
90
91/**
92 * The sidebar for someone not signed in: nothing of their own, only the
93 * open counts of the project being looked at. One call, and only in a
94 * project; it answers the same for a private project as a missing one.
95 */
Fast pages, required checks on the branch, self-hosted runners, honest incidents96async 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 put97 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
Fast pages, required checks on the branch, self-hosted runners, honest incidents98 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 put99 return {
100 workspace: null,
101 repos: [],
102 repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null,
103 limit: null,
104 monthUsageMicros: null,
105 };
Initial g1t: services, event bus, intents and attempts106}
107
Agents as a team: lifecycle, merge queue, billing and a new shell108/**
109 * The sidebar only changes with the workspace or repository being looked
110 * at, or after something was submitted: not on every page within them.
111 */
112export function shouldRevalidate({
113 currentParams,
114 nextParams,
115 formMethod,
116 defaultShouldRevalidate,
117}: ShouldRevalidateFunctionArgs) {
118 if (formMethod && formMethod !== "GET") return defaultShouldRevalidate;
119 return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo;
120}
121
122/**
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put123 * The sidebar: the workspace you chose (lib/workspace-choice.ts), or the
124 * one whose own pages these are; its projects; and the repository being
125 * looked at. A project in another workspace does not switch it.
Agents as a team: lifecycle, merge queue, billing and a new shell126 */
127async function shellFor(
128 user: User,
129 params: { owner?: string; repo?: string },
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put130 chosen: string | null,
Fast pages, required checks on the branch, self-hosted runners, honest incidents131 context: Route.LoaderArgs["context"],
Agents as a team: lifecycle, merge queue, billing and a new shell132): Promise<ShellData> {
133 const memberships = user.workspaces ?? [];
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put134 const workspace = workspaceFor(memberships, chosen, params);
Agents as a team: lifecycle, merge queue, billing and a new shell135 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 request136 const now = new Date();
137 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
Fast pages, required checks on the branch, self-hosted runners, honest incidents138 // What the sidebar shows of the workspace changes rarely: kept for a few
139 // seconds per person and workspace, except just after they changed
140 // something (lib/cache.server.ts).
141 const kept = <T,>(what: string, load: () => Promise<T>) =>
142 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 processor143 const [listed, counts, status, usage, limit, entitlements, shared] = await Promise.all([
Fast pages, required checks on the branch, self-hosted runners, honest incidents144 kept("projects", () => projects.list(workspace!.slug, user)),
145 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 processor146 // Whether billing is on, without reading the account: that asks the
147 // card processor about the workspace's cards, too slow for every page.
148 kept("status", () => billing.status()).catch(() => null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents149 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)),
150 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
151 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
152 sharedRepos(user),
Agents as a team: lifecycle, merge queue, billing and a new shell153 ]);
154 return {
155 workspace,
Projects: what a workspace builds and runs, first on every page156 // Projects are what the sidebar lists: what the workspace builds and runs.
157 repos: listed?.ok
158 ? listed.value.map((project) => ({
159 namespace: project.workspace,
160 name: project.slug,
161 title: project.name,
162 isPrivate: project.private,
163 }))
164 : [],
Agents as a team: lifecycle, merge queue, billing and a new shell165 repo:
166 path && counts?.ok
167 ? {
168 ...path,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look169 // Until the repository's own page says what their role is.
170 member: hasAccessIn(user, path.namespace),
Agents as a team: lifecycle, merge queue, billing and a new shell171 issues: counts.value.issues,
172 pulls: counts.value.pulls,
173 }
174 : null,
Billing accounts, terms and enterprises; g1t is no longer free175 // Where the workspace stands against its usage limit, once billing is on.
176 limit:
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor177 status?.enabled && limit?.ok
Billing accounts, terms and enterprises; g1t is no longer free178 ? {
179 exposureMicros: limit.value.exposureMicros,
180 ceilingMicros: limit.value.ceilingMicros,
181 state: limit.value.state,
182 comped: limit.value.trust === "internal",
183 }
184 : null,
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor185 free: Boolean(status?.free),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look186 // A spend spike or a hold pauses new compute: the shell says so on every page.
187 compute:
188 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
189 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
190 : null,
191 shared,
Usage while free is shown at cost; agents get rustfmt and clippy192 // While g1t is free every charge is zero, so usage is shown at cost.
193 monthUsageMicros: usage?.ok ? (usage.value.free ? usage.value.usedMicros : usage.value.spentMicros) : null,
Agents as a team: lifecycle, merge queue, billing and a new shell194 };
195}
196
Fast pages, required checks on the branch, self-hosted runners, honest incidents197/** How long one isolate keeps the sidebar's workspace answers. */
198const SHELL_TTL_MS = 15_000;
199
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look200/** Most repositories listed under Shared with you. */
201const MAX_SHARED = 20;
202
203/**
204 * Repositories shared with the user in workspaces they do not belong to,
205 * by their grants: only those, never the workspace's other repositories.
206 */
207async function sharedRepos(user: User): Promise<ShellData["shared"]> {
208 const outside = new Set(sharedWorkspaces(user));
209 if (outside.size === 0) return [];
210 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 incidents211 const found = await readableRepos(ids, user);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look212 return found
Fast pages, required checks on the branch, self-hosted runners, honest incidents213 .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 look214 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
215}
216
API and MCP server, Rust identity service, registration, site redesign217function HeaderLink({ to, children }: { to: string; children: React.ReactNode }) {
218 return (
219 <NavLink
220 to={to}
221 className={({ isActive }) =>
222 `rounded-md px-2.5 py-1.5 text-sm transition-colors hover:bg-raised hover:text-fg ${
223 isActive ? "text-fg" : "text-muted"
224 }`
225 }
226 >
227 {children}
228 </NavLink>
229 );
230}
231
Search across all of g1t, Explore, and a command palette232/** What the palette offers someone without the app's sidebar. */
233const PUBLIC_COMMANDS: PaletteCommand[] = [
234 { label: "Explore", hint: "Public projects", to: "/explore", icon: <Compass size={15} /> },
235 { label: "Search g1t", hint: "Repositories, code, issues, people", to: "/search", icon: <Search size={15} /> },
236 { label: "Pricing", to: "/pricing", icon: <CreditCard size={15} /> },
237 { label: "Documentation", to: "https://docs.g1t.sh/", icon: <BookOpen size={15} /> },
238 { label: "Sign in", to: "/login", icon: <LogIn size={15} /> },
239 { label: "Sign up", to: "/register", icon: <Plus size={15} /> },
240];
241
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look242/** Sign up, or Request access while g1t is invite-only. */
243function SignUpButton() {
244 const copy = useSignUpCopy();
245 return <ButtonLink to="/register">{copy.primary}</ButtonLink>;
246}
247
Email verification, password reset, and Git for AI scale positioning248function Header({ user }: { user: User | null | undefined }) {
Acceptance checks in sandboxes, line comments and review verdicts249 const submit = useSubmit();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look250 const signUp = useSignUpCopy();
Search across all of g1t, Explore, and a command palette251 const [palette, setPalette] = useState(false);
252 usePaletteShortcut(() => setPalette((open) => !open));
253 const params = useParams();
254 const repo = params.owner && params.repo ? `${params.owner}/${params.repo}` : null;
API and MCP server, Rust identity service, registration, site redesign255 return (
256 <header className="sticky top-0 z-40 border-b border-line bg-surface/85 backdrop-blur">
257 <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 look258 <Link to="/" aria-label="g1t home" className="mr-2 flex">
API and MCP server, Rust identity service, registration, site redesign259 <Logo />
260 </Link>
261 <Form action="/search" role="search" className="relative hidden grow sm:block sm:max-w-xs">
262 <Search
263 size={14}
264 className="pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-faint"
265 />
266 <input
267 name="q"
Agents as a team: lifecycle, merge queue, billing and a new shell268 {...notACredential()}
Search across all of g1t, Explore, and a command palette269 placeholder="Search g1t"
270 aria-label="Search g1t"
271 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 redesign272 />
Search across all of g1t, Explore, and a command palette273 <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">
274 ⌘K
275 </kbd>
API and MCP server, Rust identity service, registration, site redesign276 </Form>
Search across all of g1t, Explore, and a command palette277 <button
278 type="button"
279 aria-label="Search g1t"
280 onClick={() => setPalette(true)}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look281 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 palette282 >
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look283 <Search size={18} />
Search across all of g1t, Explore, and a command palette284 </button>
285 <CommandPalette
286 open={palette}
287 onOpenChange={setPalette}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look288 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 palette289 repo={repo}
290 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look291 <nav aria-label="Main" className="hidden items-center gap-0.5 sm:flex">
API and MCP server, Rust identity service, registration, site redesign292 <HeaderLink to="/explore">Explore</HeaderLink>
Prices keep themselves current with what g1t pays293 <HeaderLink to="/pricing">Pricing</HeaderLink>
Docs as their own app; shared theme package294 <HeaderLink to="https://docs.g1t.sh/">Docs</HeaderLink>
API and MCP server, Rust identity service, registration, site redesign295 </nav>
296 <div className="ml-auto flex items-center gap-2">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look297 {/* On a phone the links fold into one menu, so the bar fits. */}
298 <DropdownMenu>
299 <DropdownMenuTrigger
300 aria-label="Menu"
301 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"
302 >
303 <Menu size={18} />
304 </DropdownMenuTrigger>
305 <DropdownMenuContent align="end" className="w-52">
306 <DropdownMenuItem asChild className="min-h-11">
307 <Link to="/explore">
308 <Compass />
309 Explore
310 </Link>
311 </DropdownMenuItem>
312 <DropdownMenuItem asChild className="min-h-11">
313 <Link to="/pricing">
314 <CreditCard />
315 Pricing
316 </Link>
317 </DropdownMenuItem>
318 <DropdownMenuItem asChild className="min-h-11">
319 <Link to="https://docs.g1t.sh/">
320 <BookOpen />
321 Docs
322 </Link>
323 </DropdownMenuItem>
324 {!user && (
325 <>
326 <DropdownMenuSeparator />
327 <DropdownMenuItem asChild className="min-h-11">
328 <Link to="/login">
329 <LogIn />
330 Sign in
331 </Link>
332 </DropdownMenuItem>
333 </>
334 )}
335 </DropdownMenuContent>
336 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign337 {user ? (
338 <>
339 <Link
340 to="/new"
Projects live: fixes from walking them end to end341 aria-label="New project"
API and MCP server, Rust identity service, registration, site redesign342 className="rounded-md border border-line p-1.5 text-muted transition-colors hover:border-line-strong hover:text-fg"
343 >
344 <Plus size={16} />
345 </Link>
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)346 <DropdownMenu>
347 <DropdownMenuTrigger
348 aria-label="Account menu"
349 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 redesign350 >
Workspace names and icons, and a component kit for every control351 <Avatar name={user.username} image={user.avatar} size={24} />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)352 <ChevronDown size={14} className="text-faint" />
353 </DropdownMenuTrigger>
354 <DropdownMenuContent align="end" className="w-56">
355 <DropdownMenuLabel>
356 Signed in as{" "}
357 <span className="font-mono font-medium text-fg">
358 {user.username}
359 </span>
360 </DropdownMenuLabel>
361 <DropdownMenuSeparator />
Workspaces own repositories362 {(user.workspaces ?? []).map((membership) => (
363 <DropdownMenuItem asChild key={membership.slug}>
364 <Link to={`/${membership.slug}`}>
Workspace names and icons, and a component kit for every control365 <Avatar name={membership.slug} image={membership.avatar} size={16} square />
366 <span className="min-w-0 truncate">{membership.name || membership.slug}</span>
Workspaces own repositories367 </Link>
368 </DropdownMenuItem>
369 ))}
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)370 <DropdownMenuItem asChild>
Workspaces own repositories371 <Link to="/workspaces/new">
372 <Plus />
373 New workspace
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)374 </Link>
375 </DropdownMenuItem>
Workspaces own repositories376 <DropdownMenuSeparator />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)377 <DropdownMenuItem asChild>
378 <Link to="/">
379 <LayoutDashboard />
380 Mission control
381 </Link>
382 </DropdownMenuItem>
383 <DropdownMenuItem asChild>
384 <Link to="/new">
385 <Plus />
Projects live: fixes from walking them end to end386 New project
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)387 </Link>
388 </DropdownMenuItem>
389 <DropdownMenuSeparator />
390 <DropdownMenuItem asChild>
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas391 <Link to="/settings/profile">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)392 <Settings />
393 Settings
394 </Link>
395 </DropdownMenuItem>
396 <DropdownMenuItem asChild>
Docs as their own app; shared theme package397 <Link to="https://docs.g1t.sh/quickstart/">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)398 <BookOpen />
399 Documentation
400 </Link>
401 </DropdownMenuItem>
402 <DropdownMenuSeparator />
Acceptance checks in sandboxes, line comments and review verdicts403 {/* Submitted from here: the menu closes on select, and a button
404 that has left the page cannot submit a form. */}
405 <DropdownMenuItem
406 onSelect={() => submit(null, { method: "post", action: "/logout" })}
407 >
408 <LogOut />
409 Sign out
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)410 </DropdownMenuItem>
411 </DropdownMenuContent>
412 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign413 </>
414 ) : (
415 <>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look416 <span className="hidden sm:contents">
417 <HeaderLink to="/login">Sign in</HeaderLink>
418 </span>
419 <SignUpButton />
API and MCP server, Rust identity service, registration, site redesign420 </>
421 )}
422 </div>
423 </div>
424 </header>
425 );
426}
427
Initial g1t: services, event bus, intents and attempts428export function Layout({ children }: { children: React.ReactNode }) {
429 // Undefined when the root loader itself failed.
Agents as a team: lifecycle, merge queue, billing and a new shell430 const root = useRouteLoaderData<typeof loader>("root");
431 const user = root?.user;
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put432 const { pathname } = useLocation();
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas433 // Drawn around the error page too: a 404 keeps the sidebar out of a
434 // project or workspace the viewer cannot see.
435 const error = useRouteError();
436 const missing = isRouteErrorResponse(error) && error.status === 404;
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look437 // The billing page shows the full banner itself.
438 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
Fast pages, required checks on the branch, self-hosted runners, honest incidents439 <SpikeBanner
440 compact
441 slug={root.shell.workspace.slug}
442 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
443 owner={root.shell.compute.owner}
444 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look445 );
446 const verify = user && !user.verified && (
Agents as a team: lifecycle, merge queue, billing and a new shell447 <Form
448 method="post"
449 action="/verify"
450 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"
451 >
452 <span>
453 Confirm your email address to create repositories and push. We
454 sent you a link.
455 </span>
456 <button type="submit" className="font-medium underline underline-offset-4">
457 Send it again
458 </button>
459 </Form>
460 );
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look461 const banner =
462 paused || verify ? (
463 <>
464 {paused}
465 {verify}
466 </>
467 ) : null;
Initial g1t: services, event bus, intents and attempts468 return (
469 <html lang="en">
470 <head>
471 <meta charSet="utf-8" />
472 <meta name="viewport" content="width=device-width, initial-scale=1" />
Dark gray base with lavender as an accent, and a live outcome view for plans473 <meta name="theme-color" content="#0f0f11" />
Put the stylesheet at the top of the head, before React Router's preloads474 {/* The stylesheet before everything React Router preloads, so a slow
475 connection paints sooner (docs/research/css-shipping.md). */}
Give the stylesheet a precedence so React places it before preloads476 <link rel="stylesheet" href={appCss} precedence="default" />
Initial g1t: services, event bus, intents and attempts477 <Meta />
478 <Links />
479 </head>
API and MCP server, Rust identity service, registration, site redesign480 <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 put481 {root?.shell && usesAppShell(pathname, user != null) ? (
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas482 <AppShell user={user ?? null} shell={root.shell} missing={missing} banner={banner}>
Agents as a team: lifecycle, merge queue, billing and a new shell483 {children}
484 </AppShell>
485 ) : (
486 <>
487 <Progress />
488 <Header user={user} />
489 {banner}
490 <div className="grow">{children}</div>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look491 <SiteFooter user={user} />
Agents as a team: lifecycle, merge queue, billing and a new shell492 </>
Email verification, password reset, and Git for AI scale positioning493 )}
Initial g1t: services, event bus, intents and attempts494 <ScrollRestoration />
495 <Scripts />
496 </body>
497 </html>
498 );
499}
500
501export default function App() {
502 return <Outlet />;
503}
504
505export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
API and MCP server, Rust identity service, registration, site redesign506 let title = "Something went wrong";
507 let details = "An unexpected error occurred. Try again in a moment.";
Initial g1t: services, event bus, intents and attempts508 let stack: string | undefined;
509
510 if (isRouteErrorResponse(error)) {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put511 // The same page for something private and something missing.
512 if (error.status === 404) return <NotFound data={error.data} />;
513 if (typeof error.data === "string" && error.data) {
API and MCP server, Rust identity service, registration, site redesign514 details = error.data;
515 }
516 } else if (import.meta.env.DEV && error instanceof Error) {
Initial g1t: services, event bus, intents and attempts517 details = error.message;
518 stack = error.stack;
519 }
520
521 return (
API and MCP server, Rust identity service, registration, site redesign522 <main className="mx-auto max-w-xl px-4 py-32 text-center">
523 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
524 <p className="mt-3 text-muted">{details}</p>
525 <div className="mt-8">
526 <ButtonLink to="/" variant="quiet">
527 Back to home
528 </ButtonLink>
529 </div>
Initial g1t: services, event bus, intents and attempts530 {stack && (
API and MCP server, Rust identity service, registration, site redesign531 <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 attempts532 <code>{stack}</code>
533 </pre>
534 )}
535 </main>
536 );
537}