Skip to content
629 linesCodeBlameRaw

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";
Usage, Billing settings and prepaid AI credit; fixes from the UX audit14import { useEffect, 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,
Usage, Billing settings and prepaid AI credit; fixes from the UX audit27 useMatches,
Search across all of g1t, Explore, and a command palette28 useParams,
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas29 useRouteError,
Initial g1t: services, event bus, intents and attempts30 useRouteLoaderData,
Acceptance checks in sandboxes, line comments and review verdicts31 useSubmit,
Initial g1t: services, event bus, intents and attempts32} from "react-router";
33
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)34import { type User, awaitsConfirmation, hasAccessIn, sharedWorkspaces } from "@g1t/contracts";
Email verification, password reset, and Git for AI scale positioning35
Initial g1t: services, event bus, intents and attempts36import type { Route } from "./+types/root";
Load the stylesheet first; plain legal contact details37import appCss from "./app.css?url";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look38import displayFont from "@g1t/theme/fonts/bricolage-grotesque-latin.woff2?url";
39import sansFont from "@g1t/theme/fonts/hanken-grotesk-latin.woff2?url";
Initial g1t: services, event bus, intents and attempts40import { Logo } from "./components/logo";
Merge branch 'worktree-agent-a985c01f43538af01'41import { Avatar, ButtonLink, SubmitButton, notACredential } from "./components/ui";
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)42import {
43 DropdownMenu,
44 DropdownMenuContent,
45 DropdownMenuItem,
46 DropdownMenuLabel,
47 DropdownMenuSeparator,
48 DropdownMenuTrigger,
49} from "./components/ui/dropdown-menu";
Merge branch 'worktree-agent-aca4790ea223aa235'50import { AppShell, Progress, type ShellData, useLeaving } from "./components/shell";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look51import { SiteFooter } from "./components/footer";
Fast pages, required checks on the branch, self-hosted runners, honest incidents52import { SpikeBanner } from "./components/spike-banner";
Merge main (membership, two-factor, GitHub repo roles) into tokens53import { PolicyNotice } from "./components/policy-notice";
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put54import { readCookie } from "./lib/mission";
55import { WORKSPACE_COOKIE, workspaceFor } from "./lib/workspace-choice";
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in56import { PageMain } from "./components/landmark";
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put57import { NotFound } from "./components/not-found";
58import { usesAppShell } from "./lib/chrome";
Usage, Billing settings and prepaid AI credit; fixes from the UX audit59import { CommandPalette, type PaletteCommand, PaletteKey, usePaletteShortcut } from "./components/command-palette";
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all60import { billing, inbox, projects } from "./lib/services.server";
Fast pages, required checks on the branch, self-hosted runners, honest incidents61import { countsFor, readableRepos } from "./lib/access.server";
62import { shortCache } from "./lib/cache.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look63import { getViewer, viewerMiddleware } from "./lib/session.server";
Navigation: the workspace's own page with tabs, pins and recent in the sidebar64import { shortcutOf, workspaceProjects } from "./lib/workspace-projects.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look65import { registrationMode } from "./lib/registration.server";
Merge branch 'worktree-agent-aaf03bdceac799c89'66import { addresses } from "./lib/addresses.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look67import { useSignUpCopy } from "./lib/registration";
Usage, Billing settings and prepaid AI credit; fixes from the UX audit68import { RELOADED_KEY, reloadFixes } from "./lib/stale-build";
Merge g1tusercontent.com: registry answers run nothing in a browser, the site's pages run only their own scripts, repository files and avatars on their own origin, raw files rate limited per address69import { useNonce } from "./lib/nonce";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look70
Initial g1t: services, event bus, intents and attempts71
72export const links: Route.LinksFunction = () => [
The fleet: g1t's new mark73 { rel: "icon", href: "/favicon.ico", sizes: "32x32" },
Initial g1t: services, event bus, intents and attempts74 { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
The fleet: g1t's new mark75 { rel: "icon", type: "image/png", sizes: "192x192", href: "/icon-192.png" },
76 { rel: "apple-touch-icon", href: "/apple-touch-icon.png" },
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look77 // The text and headline faces are wanted on every page, so they start
78 // loading with the stylesheet; mono waits until something uses it.
79 { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
80 { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
Initial g1t: services, event bus, intents and attempts81];
82
83export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware];
84
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put85export async function loader({ context, params, request }: Route.LoaderArgs) {
Agents as a team: lifecycle, merge queue, billing and a new shell86 const user = getViewer(context);
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put87 const chosen = readCookie(request.headers.get("cookie"), WORKSPACE_COOKIE);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look88 // What sign-up buttons say: Request access while g1t is invite-only.
89 const [shell, mode] = await Promise.all([
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)90 // An account still confirming its address sees only the pages that
91 // allows (lib/confirm-gate.ts), in the visitor's frame.
92 user && !awaitsConfirmation(user)
Usage, Billing settings and prepaid AI credit; fixes from the UX audit93 ? shellFor(user, params, chosen, context).catch((error: unknown) => {
94 // A sidebar that could not be read is no reason to lose the page,
95 // or to draw it as if they were signed out.
96 console.error("root: the sidebar could not be read", error);
97 return bareShell(user, params, chosen);
98 })
99 : visitorShell(params, context),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look100 user ? Promise.resolve(null) : registrationMode(),
101 ]);
Merge branch 'worktree-agent-aaf03bdceac799c89'102 // Where this g1t lives, for clone lines, agent setup and link previews.
103 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 put104}
105
106/**
107 * The sidebar for someone not signed in: nothing of their own, only the
108 * open counts of the project being looked at. One call, and only in a
109 * project; it answers the same for a private project as a missing one.
110 */
Fast pages, required checks on the branch, self-hosted runners, honest incidents111async 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 put112 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
Fast pages, required checks on the branch, self-hosted runners, honest incidents113 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 put114 return {
115 workspace: null,
116 repos: [],
117 repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null,
118 limit: null,
119 monthUsageMicros: null,
120 };
Initial g1t: services, event bus, intents and attempts121}
122
Usage, Billing settings and prepaid AI credit; fixes from the UX audit123/** The sidebar from what the session already says, with no service asked. */
124function bareShell(user: User, params: { owner?: string; repo?: string }, chosen: string | null): ShellData {
125 return {
126 workspace: workspaceFor(user.workspaces ?? [], chosen, params),
127 repos: [],
128 repo: null,
129 limit: null,
130 monthUsageMicros: null,
131 };
132}
133
Agents as a team: lifecycle, merge queue, billing and a new shell134/**
135 * The sidebar only changes with the workspace or repository being looked
136 * at, or after something was submitted: not on every page within them.
137 */
138export function shouldRevalidate({
139 currentParams,
140 nextParams,
141 formMethod,
142 defaultShouldRevalidate,
143}: ShouldRevalidateFunctionArgs) {
144 if (formMethod && formMethod !== "GET") return defaultShouldRevalidate;
145 return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo;
146}
147
148/**
Usage, Billing settings and prepaid AI credit; fixes from the UX audit149 * The sidebar: the workspace whose pages or project these are when it is
150 * one of yours, else the one you chose (lib/workspace-choice.ts); its
151 * projects; and the repository being looked at.
Agents as a team: lifecycle, merge queue, billing and a new shell152 */
153async function shellFor(
154 user: User,
155 params: { owner?: string; repo?: string },
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put156 chosen: string | null,
Fast pages, required checks on the branch, self-hosted runners, honest incidents157 context: Route.LoaderArgs["context"],
Agents as a team: lifecycle, merge queue, billing and a new shell158): Promise<ShellData> {
159 const memberships = user.workspaces ?? [];
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put160 const workspace = workspaceFor(memberships, chosen, params);
Agents as a team: lifecycle, merge queue, billing and a new shell161 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 request162 const now = new Date();
163 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
Fast pages, required checks on the branch, self-hosted runners, honest incidents164 // What the sidebar shows of the workspace changes rarely: kept for a few
165 // seconds per person and workspace, except just after they changed
166 // something (lib/cache.server.ts).
167 const kept = <T,>(what: string, load: () => Promise<T>) =>
168 workspace ? shortCache(`shell:${what}:${user.id}:${workspace.slug}`, SHELL_TTL_MS, load) : Promise.resolve(null);
Navigation: the workspace's own page with tabs, pins and recent in the sidebar169 const [listed, counts, status, usage, limit, entitlements, shared, unread, shortcuts] = await Promise.all([
170 // Every project, for the palette and the count; the sidebar lists only
171 // the person's pinned and recent ones (lib/pins.ts).
172 workspace ? workspaceProjects(workspace.slug, user) : Promise.resolve(null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents173 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 processor174 // Whether billing is on, without reading the account: that asks the
175 // card processor about the workspace's cards, too slow for every page.
176 kept("status", () => billing.status()).catch(() => null),
Usage, Billing settings and prepaid AI credit; fixes from the UX audit177 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)).catch(() => null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents178 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
179 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
180 sharedRepos(user),
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all181 // The bell's count: one query, never kept, so marking an item shows at once.
182 inbox.counts(user.username).catch(() => null),
Navigation: the workspace's own page with tabs, pins and recent in the sidebar183 // Never kept: opening a project moves it up Recent.
184 workspace ? projects.shortcuts(workspace.slug, user).catch(() => null) : Promise.resolve(null),
Agents as a team: lifecycle, merge queue, billing and a new shell185 ]);
186 return {
187 workspace,
Projects: what a workspace builds and runs, first on every page188 // Projects are what the sidebar lists: what the workspace builds and runs.
Navigation: the workspace's own page with tabs, pins and recent in the sidebar189 repos: listed?.ok ? listed.value.map(shortcutOf) : [],
190 pinned: (shortcuts?.pinned ?? []).map(shortcutOf),
191 recent: (shortcuts?.recent ?? []).map(shortcutOf),
Agents as a team: lifecycle, merge queue, billing and a new shell192 repo:
193 path && counts?.ok
194 ? {
195 ...path,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look196 // Until the repository's own page says what their role is.
197 member: hasAccessIn(user, path.namespace),
Agents as a team: lifecycle, merge queue, billing and a new shell198 issues: counts.value.issues,
199 pulls: counts.value.pulls,
200 }
201 : null,
Billing accounts, terms and enterprises; g1t is no longer free202 // Where the workspace stands against its usage limit, once billing is on.
203 limit:
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor204 status?.enabled && limit?.ok
Billing accounts, terms and enterprises; g1t is no longer free205 ? {
206 exposureMicros: limit.value.exposureMicros,
207 ceilingMicros: limit.value.ceilingMicros,
208 state: limit.value.state,
209 comped: limit.value.trust === "internal",
210 }
211 : null,
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor212 free: Boolean(status?.free),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look213 // A spend spike or a hold pauses new compute: the shell says so on every page.
214 compute:
215 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
216 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
217 : null,
218 shared,
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all219 inbox: unread,
Usage while free is shown at cost; agents get rustfmt and clippy220 // While g1t is free every charge is zero, so usage is shown at cost.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit221 // Usage at price, the one figure every page shows.
222 monthUsageMicros: usage?.ok ? (usage.value.free ? usage.value.usedMicros : (usage.value.priceMicros ?? usage.value.spentMicros)) : null,
Agents as a team: lifecycle, merge queue, billing and a new shell223 };
224}
225
Usage, Billing settings and prepaid AI credit; fixes from the UX audit226/**
227 * How long the sidebar's workspace answers are kept: as long as someone's
228 * own changes read fresh anyway (lib/perf.ts `PRIMARY_WINDOW_SECONDS`).
229 */
230const SHELL_TTL_MS = 30_000;
Fast pages, required checks on the branch, self-hosted runners, honest incidents231
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look232/** Most repositories listed under Shared with you. */
233const MAX_SHARED = 20;
234
235/**
236 * Repositories shared with the user in workspaces they do not belong to,
237 * by their grants: only those, never the workspace's other repositories.
238 */
239async function sharedRepos(user: User): Promise<ShellData["shared"]> {
240 const outside = new Set(sharedWorkspaces(user));
241 if (outside.size === 0) return [];
242 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 incidents243 const found = await readableRepos(ids, user);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look244 return found
Fast pages, required checks on the branch, self-hosted runners, honest incidents245 .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 look246 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
247}
248
API and MCP server, Rust identity service, registration, site redesign249function HeaderLink({ to, children }: { to: string; children: React.ReactNode }) {
250 return (
251 <NavLink
252 to={to}
253 className={({ isActive }) =>
254 `rounded-md px-2.5 py-1.5 text-sm transition-colors hover:bg-raised hover:text-fg ${
255 isActive ? "text-fg" : "text-muted"
256 }`
257 }
258 >
259 {children}
260 </NavLink>
261 );
262}
263
Search across all of g1t, Explore, and a command palette264/** What the palette offers someone without the app's sidebar. */
265const PUBLIC_COMMANDS: PaletteCommand[] = [
266 { label: "Explore", hint: "Public projects", to: "/explore", icon: <Compass size={15} /> },
267 { label: "Search g1t", hint: "Repositories, code, issues, people", to: "/search", icon: <Search size={15} /> },
268 { label: "Pricing", to: "/pricing", icon: <CreditCard size={15} /> },
269 { label: "Documentation", to: "https://docs.g1t.sh/", icon: <BookOpen size={15} /> },
270 { label: "Sign in", to: "/login", icon: <LogIn size={15} /> },
271 { label: "Sign up", to: "/register", icon: <Plus size={15} /> },
272];
273
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look274/** Sign up, or Request access while g1t is invite-only. */
275function SignUpButton() {
276 const copy = useSignUpCopy();
277 return <ButtonLink to="/register">{copy.primary}</ButtonLink>;
278}
279
Email verification, password reset, and Git for AI scale positioning280function Header({ user }: { user: User | null | undefined }) {
Acceptance checks in sandboxes, line comments and review verdicts281 const submit = useSubmit();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look282 const signUp = useSignUpCopy();
Search across all of g1t, Explore, and a command palette283 const [palette, setPalette] = useState(false);
284 usePaletteShortcut(() => setPalette((open) => !open));
285 const params = useParams();
286 const repo = params.owner && params.repo ? `${params.owner}/${params.repo}` : null;
API and MCP server, Rust identity service, registration, site redesign287 return (
288 <header className="sticky top-0 z-40 border-b border-line bg-surface/85 backdrop-blur">
289 <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 look290 <Link to="/" aria-label="g1t home" className="mr-2 flex">
API and MCP server, Rust identity service, registration, site redesign291 <Logo />
292 </Link>
293 <Form action="/search" role="search" className="relative hidden grow sm:block sm:max-w-xs">
294 <Search
295 size={14}
296 className="pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-faint"
297 />
298 <input
299 name="q"
Agents as a team: lifecycle, merge queue, billing and a new shell300 {...notACredential()}
Search across all of g1t, Explore, and a command palette301 placeholder="Search g1t"
302 aria-label="Search g1t"
303 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 redesign304 />
Usage, Billing settings and prepaid AI credit; fixes from the UX audit305 <PaletteKey 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" />
API and MCP server, Rust identity service, registration, site redesign306 </Form>
Search across all of g1t, Explore, and a command palette307 <button
308 type="button"
309 aria-label="Search g1t"
310 onClick={() => setPalette(true)}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look311 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 palette312 >
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look313 <Search size={18} />
Search across all of g1t, Explore, and a command palette314 </button>
315 <CommandPalette
316 open={palette}
317 onOpenChange={setPalette}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look318 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 palette319 repo={repo}
320 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look321 <nav aria-label="Main" className="hidden items-center gap-0.5 sm:flex">
API and MCP server, Rust identity service, registration, site redesign322 <HeaderLink to="/explore">Explore</HeaderLink>
Prices keep themselves current with what g1t pays323 <HeaderLink to="/pricing">Pricing</HeaderLink>
Docs as their own app; shared theme package324 <HeaderLink to="https://docs.g1t.sh/">Docs</HeaderLink>
API and MCP server, Rust identity service, registration, site redesign325 </nav>
326 <div className="ml-auto flex items-center gap-2">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look327 {/* On a phone the links fold into one menu, so the bar fits. */}
328 <DropdownMenu>
329 <DropdownMenuTrigger
330 aria-label="Menu"
Usage, Billing settings and prepaid AI credit; fixes from the UX audit331 className="flex size-10 items-center justify-center rounded-md text-muted outline-none transition-colors hover:bg-raised hover:text-fg focus-visible:ring-2 focus-visible:ring-accent data-[state=open]:bg-raised data-[state=open]:text-fg sm:hidden"
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look332 >
333 <Menu size={18} />
334 </DropdownMenuTrigger>
335 <DropdownMenuContent align="end" className="w-52">
336 <DropdownMenuItem asChild className="min-h-11">
337 <Link to="/explore">
338 <Compass />
339 Explore
340 </Link>
341 </DropdownMenuItem>
342 <DropdownMenuItem asChild className="min-h-11">
343 <Link to="/pricing">
344 <CreditCard />
345 Pricing
346 </Link>
347 </DropdownMenuItem>
348 <DropdownMenuItem asChild className="min-h-11">
349 <Link to="https://docs.g1t.sh/">
350 <BookOpen />
351 Docs
352 </Link>
353 </DropdownMenuItem>
354 {!user && (
355 <>
356 <DropdownMenuSeparator />
357 <DropdownMenuItem asChild className="min-h-11">
358 <Link to="/login">
359 <LogIn />
360 Sign in
361 </Link>
362 </DropdownMenuItem>
363 </>
364 )}
365 </DropdownMenuContent>
366 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign367 {user ? (
368 <>
369 <Link
370 to="/new"
Projects live: fixes from walking them end to end371 aria-label="New project"
API and MCP server, Rust identity service, registration, site redesign372 className="rounded-md border border-line p-1.5 text-muted transition-colors hover:border-line-strong hover:text-fg"
373 >
374 <Plus size={16} />
375 </Link>
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)376 <DropdownMenu>
377 <DropdownMenuTrigger
378 aria-label="Account menu"
Usage, Billing settings and prepaid AI credit; fixes from the UX audit379 className="flex items-center gap-1.5 rounded-md p-1 outline-none transition-colors hover:bg-raised focus-visible:ring-2 focus-visible:ring-accent data-[state=open]:bg-raised"
API and MCP server, Rust identity service, registration, site redesign380 >
Workspace names and icons, and a component kit for every control381 <Avatar name={user.username} image={user.avatar} size={24} />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)382 <ChevronDown size={14} className="text-faint" />
383 </DropdownMenuTrigger>
384 <DropdownMenuContent align="end" className="w-56">
385 <DropdownMenuLabel>
386 Signed in as{" "}
387 <span className="font-mono font-medium text-fg">
388 {user.username}
389 </span>
390 </DropdownMenuLabel>
391 <DropdownMenuSeparator />
Workspaces own repositories392 {(user.workspaces ?? []).map((membership) => (
393 <DropdownMenuItem asChild key={membership.slug}>
394 <Link to={`/${membership.slug}`}>
Workspace names and icons, and a component kit for every control395 <Avatar name={membership.slug} image={membership.avatar} size={16} square />
396 <span className="min-w-0 truncate">{membership.name || membership.slug}</span>
Workspaces own repositories397 </Link>
398 </DropdownMenuItem>
399 ))}
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)400 <DropdownMenuItem asChild>
Workspaces own repositories401 <Link to="/workspaces/new">
402 <Plus />
403 New workspace
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)404 </Link>
405 </DropdownMenuItem>
Workspaces own repositories406 <DropdownMenuSeparator />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)407 <DropdownMenuItem asChild>
408 <Link to="/">
409 <LayoutDashboard />
410 Mission control
411 </Link>
412 </DropdownMenuItem>
413 <DropdownMenuItem asChild>
414 <Link to="/new">
415 <Plus />
Projects live: fixes from walking them end to end416 New project
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)417 </Link>
418 </DropdownMenuItem>
419 <DropdownMenuSeparator />
420 <DropdownMenuItem asChild>
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas421 <Link to="/settings/profile">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)422 <Settings />
423 Settings
424 </Link>
425 </DropdownMenuItem>
426 <DropdownMenuItem asChild>
Docs as their own app; shared theme package427 <Link to="https://docs.g1t.sh/quickstart/">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)428 <BookOpen />
429 Documentation
430 </Link>
431 </DropdownMenuItem>
432 <DropdownMenuSeparator />
Acceptance checks in sandboxes, line comments and review verdicts433 {/* Submitted from here: the menu closes on select, and a button
434 that has left the page cannot submit a form. */}
435 <DropdownMenuItem
436 onSelect={() => submit(null, { method: "post", action: "/logout" })}
437 >
438 <LogOut />
439 Sign out
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)440 </DropdownMenuItem>
441 </DropdownMenuContent>
442 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign443 </>
444 ) : (
445 <>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look446 <span className="hidden sm:contents">
447 <HeaderLink to="/login">Sign in</HeaderLink>
448 </span>
449 <SignUpButton />
API and MCP server, Rust identity service, registration, site redesign450 </>
451 )}
452 </div>
453 </div>
454 </header>
455 );
456}
457
Usage, Billing settings and prepaid AI credit; fixes from the UX audit458/**
459 * The root's data as the browser last had it. When a navigation fails in a
460 * way that takes the root's data with it, the error is still drawn in the
461 * person's own frame, signed in, not the visitor's. Never kept on the
462 * server, where one module serves everyone.
463 */
464let lastRoot: Awaited<ReturnType<typeof loader>> | undefined;
465
Initial g1t: services, event bus, intents and attempts466export function Layout({ children }: { children: React.ReactNode }) {
Merge g1tusercontent.com: registry answers run nothing in a browser, the site's pages run only their own scripts, repository files and avatars on their own origin, raw files rate limited per address467 const nonce = useNonce();
Initial g1t: services, event bus, intents and attempts468 // Undefined when the root loader itself failed.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit469 const loaded = useRouteLoaderData<typeof loader>("root");
470 const inBrowser = typeof document !== "undefined";
471 if (loaded && inBrowser) lastRoot = loaded;
472 const root = loaded ?? (inBrowser ? lastRoot : undefined);
Agents as a team: lifecycle, merge queue, billing and a new shell473 const user = root?.user;
Merge branch 'worktree-agent-a985c01f43538af01'474 const { pathname, search } = useLocation();
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas475 // Drawn around the error page too: a 404 keeps the sidebar out of a
476 // project or workspace the viewer cannot see.
477 const error = useRouteError();
478 const missing = isRouteErrorResponse(error) && error.status === 404;
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look479 // The billing page shows the full banner itself.
480 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
Fast pages, required checks on the branch, self-hosted runners, honest incidents481 <SpikeBanner
482 compact
483 slug={root.shell.workspace.slug}
484 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
485 owner={root.shell.compute.owner}
486 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look487 );
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)488 // On the few pages an account still confirming its address can open
489 // besides /confirm-email (policies, support, signing in): the way back.
490 const verify = user && awaitsConfirmation(user) && pathname !== "/confirm-email" && (
491 <p
492 role="status"
Agents as a team: lifecycle, merge queue, billing and a new shell493 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"
494 >
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)495 <span>Confirm your email address to start using g1t.</span>
496 <Link to="/confirm-email" className="font-medium underline underline-offset-4">
497 Enter your code
498 </Link>
499 </p>
Agents as a team: lifecycle, merge queue, billing and a new shell500 );
Merge main (membership, two-factor, GitHub repo roles) into tokens501 // A workspace that requires two-factor authentication of someone who
502 // has not turned it on: they keep their place, and cannot use it yet.
503 const held = user?.held && user.held.length > 0 && pathname !== "/settings/two-factor" && <PolicyNotice held={user.held} />;
Merge branch 'worktree-agent-aca4790ea223aa235'504 const leaving = useLeaving();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look505 const banner =
Merge main (membership, two-factor, GitHub repo roles) into tokens506 paused || verify || held ? (
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look507 <>
508 {paused}
509 {verify}
Merge main (membership, two-factor, GitHub repo roles) into tokens510 {held}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look511 </>
512 ) : null;
Initial g1t: services, event bus, intents and attempts513 return (
514 <html lang="en">
515 <head>
516 <meta charSet="utf-8" />
517 <meta name="viewport" content="width=device-width, initial-scale=1" />
Dark gray base with lavender as an accent, and a live outcome view for plans518 <meta name="theme-color" content="#0f0f11" />
Put the stylesheet at the top of the head, before React Router's preloads519 {/* The stylesheet before everything React Router preloads, so a slow
520 connection paints sooner (docs/research/css-shipping.md). */}
Give the stylesheet a precedence so React places it before preloads521 <link rel="stylesheet" href={appCss} precedence="default" />
Initial g1t: services, event bus, intents and attempts522 <Meta />
Merge g1tusercontent.com: registry answers run nothing in a browser, the site's pages run only their own scripts, repository files and avatars on their own origin, raw files rate limited per address523 <Links nonce={nonce} />
Initial g1t: services, event bus, intents and attempts524 </head>
API and MCP server, Rust identity service, registration, site redesign525 <body className="flex min-h-screen flex-col">
Usage, Billing settings and prepaid AI credit; fixes from the UX audit526 {/* The first stop for the keyboard: past the menus, to the page. */}
527 <a
528 href="#content"
529 className="sr-only rounded-md bg-fg px-3 py-2 text-sm font-medium text-bg focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70]"
530 >
531 Skip to content
532 </a>
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)533 {root?.shell && usesAppShell(pathname, user != null && !awaitsConfirmation(user)) ? (
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas534 <AppShell user={user ?? null} shell={root.shell} missing={missing} banner={banner}>
Agents as a team: lifecycle, merge queue, billing and a new shell535 {children}
536 </AppShell>
537 ) : (
538 <>
539 <Progress />
540 <Header user={user} />
541 {banner}
Usage, Billing settings and prepaid AI credit; fixes from the UX audit542 <div id="content" tabIndex={-1} {...leaving} className={`grow outline-none ${leaving.className}`}>
Merge branch 'worktree-agent-aca4790ea223aa235'543 {children}
544 </div>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look545 <SiteFooter user={user} />
Agents as a team: lifecycle, merge queue, billing and a new shell546 </>
Email verification, password reset, and Git for AI scale positioning547 )}
Merge g1tusercontent.com: registry answers run nothing in a browser, the site's pages run only their own scripts, repository files and avatars on their own origin, raw files rate limited per address548 <ScrollRestoration nonce={nonce} />
549 <Scripts nonce={nonce} />
Initial g1t: services, event bus, intents and attempts550 </body>
551 </html>
552 );
553}
554
555export default function App() {
556 return <Outlet />;
557}
558
559export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
Usage, Billing settings and prepaid AI credit; fixes from the UX audit560 const location = useLocation();
561 const matches = useMatches();
562 // A tab left open across a deploy: load the address again as a whole
563 // page, once, rather than show an error the reload fixes.
564 const reload = reloadFixes({
565 error,
566 status: isRouteErrorResponse(error) ? error.status : undefined,
567 // The first page a tab loads has the key "default"; a client navigation's is its own.
568 clientNavigation: location.key !== "default",
569 caughtByCatchAll: matches.at(-1)?.id === "routes/not-found",
570 });
571 const href = location.pathname + location.search + location.hash;
572 useEffect(() => {
573 if (!reload) return;
574 try {
575 if (sessionStorage.getItem(RELOADED_KEY) === href) return;
576 sessionStorage.setItem(RELOADED_KEY, href);
577 } catch {
578 // No session storage: reload anyway; a document load never asks again.
579 }
580 window.location.assign(href);
581 }, [reload, href]);
582 if (reload) {
583 return (
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in584 <PageMain className="mx-auto max-w-xl px-4 py-32 text-center text-sm text-muted" aria-busy="true">
Usage, Billing settings and prepaid AI credit; fixes from the UX audit585 <title>Loading · g1t</title>
586 Loading the latest version of g1t…
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in587 </PageMain>
Usage, Billing settings and prepaid AI credit; fixes from the UX audit588 );
589 }
590
API and MCP server, Rust identity service, registration, site redesign591 let title = "Something went wrong";
592 let details = "An unexpected error occurred. Try again in a moment.";
Initial g1t: services, event bus, intents and attempts593 let stack: string | undefined;
594
595 if (isRouteErrorResponse(error)) {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put596 // The same page for something private and something missing.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit597 if (error.status === 404) {
598 return (
599 <>
600 <title>Not found · g1t</title>
601 <NotFound data={error.data} />
602 </>
603 );
604 }
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put605 if (typeof error.data === "string" && error.data) {
API and MCP server, Rust identity service, registration, site redesign606 details = error.data;
607 }
608 } else if (import.meta.env.DEV && error instanceof Error) {
Initial g1t: services, event bus, intents and attempts609 details = error.message;
610 stack = error.stack;
611 }
612
613 return (
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in614 <PageMain className="mx-auto max-w-xl px-4 py-32 text-center">
API and MCP server, Rust identity service, registration, site redesign615 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
616 <p className="mt-3 text-muted">{details}</p>
617 <div className="mt-8">
618 <ButtonLink to="/" variant="quiet">
619 Back to home
620 </ButtonLink>
621 </div>
Initial g1t: services, event bus, intents and attempts622 {stack && (
API and MCP server, Rust identity service, registration, site redesign623 <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 attempts624 <code>{stack}</code>
625 </pre>
626 )}
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in627 </PageMain>
Initial g1t: services, event bus, intents and attempts628 );
629}

This file's history is long; its oldest lines are credited to the oldest commit read.