Skip to content
626 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";
56import { NotFound } from "./components/not-found";
57import { usesAppShell } from "./lib/chrome";
Usage, Billing settings and prepaid AI credit; fixes from the UX audit58import { 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 all59import { billing, inbox, projects } from "./lib/services.server";
Fast pages, required checks on the branch, self-hosted runners, honest incidents60import { countsFor, readableRepos } from "./lib/access.server";
61import { shortCache } from "./lib/cache.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look62import { getViewer, viewerMiddleware } from "./lib/session.server";
Navigation: the workspace's own page with tabs, pins and recent in the sidebar63import { shortcutOf, workspaceProjects } from "./lib/workspace-projects.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look64import { registrationMode } from "./lib/registration.server";
Merge branch 'worktree-agent-aaf03bdceac799c89'65import { addresses } from "./lib/addresses.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look66import { useSignUpCopy } from "./lib/registration";
Usage, Billing settings and prepaid AI credit; fixes from the UX audit67import { RELOADED_KEY, reloadFixes } from "./lib/stale-build";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look68
Initial g1t: services, event bus, intents and attempts69
70export const links: Route.LinksFunction = () => [
The fleet: g1t's new mark71 { rel: "icon", href: "/favicon.ico", sizes: "32x32" },
Initial g1t: services, event bus, intents and attempts72 { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
The fleet: g1t's new mark73 { rel: "icon", type: "image/png", sizes: "192x192", href: "/icon-192.png" },
74 { rel: "apple-touch-icon", href: "/apple-touch-icon.png" },
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look75 // The text and headline faces are wanted on every page, so they start
76 // loading with the stylesheet; mono waits until something uses it.
77 { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
78 { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
Initial g1t: services, event bus, intents and attempts79];
80
81export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware];
82
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put83export async function loader({ context, params, request }: Route.LoaderArgs) {
Agents as a team: lifecycle, merge queue, billing and a new shell84 const user = getViewer(context);
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put85 const chosen = readCookie(request.headers.get("cookie"), WORKSPACE_COOKIE);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look86 // What sign-up buttons say: Request access while g1t is invite-only.
87 const [shell, mode] = await Promise.all([
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)88 // An account still confirming its address sees only the pages that
89 // allows (lib/confirm-gate.ts), in the visitor's frame.
90 user && !awaitsConfirmation(user)
Usage, Billing settings and prepaid AI credit; fixes from the UX audit91 ? shellFor(user, params, chosen, context).catch((error: unknown) => {
92 // A sidebar that could not be read is no reason to lose the page,
93 // or to draw it as if they were signed out.
94 console.error("root: the sidebar could not be read", error);
95 return bareShell(user, params, chosen);
96 })
97 : visitorShell(params, context),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look98 user ? Promise.resolve(null) : registrationMode(),
99 ]);
Merge branch 'worktree-agent-aaf03bdceac799c89'100 // Where this g1t lives, for clone lines, agent setup and link previews.
101 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 put102}
103
104/**
105 * The sidebar for someone not signed in: nothing of their own, only the
106 * open counts of the project being looked at. One call, and only in a
107 * project; it answers the same for a private project as a missing one.
108 */
Fast pages, required checks on the branch, self-hosted runners, honest incidents109async 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 put110 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
Fast pages, required checks on the branch, self-hosted runners, honest incidents111 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 put112 return {
113 workspace: null,
114 repos: [],
115 repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null,
116 limit: null,
117 monthUsageMicros: null,
118 };
Initial g1t: services, event bus, intents and attempts119}
120
Usage, Billing settings and prepaid AI credit; fixes from the UX audit121/** The sidebar from what the session already says, with no service asked. */
122function bareShell(user: User, params: { owner?: string; repo?: string }, chosen: string | null): ShellData {
123 return {
124 workspace: workspaceFor(user.workspaces ?? [], chosen, params),
125 repos: [],
126 repo: null,
127 limit: null,
128 monthUsageMicros: null,
129 };
130}
131
Agents as a team: lifecycle, merge queue, billing and a new shell132/**
133 * The sidebar only changes with the workspace or repository being looked
134 * at, or after something was submitted: not on every page within them.
135 */
136export function shouldRevalidate({
137 currentParams,
138 nextParams,
139 formMethod,
140 defaultShouldRevalidate,
141}: ShouldRevalidateFunctionArgs) {
142 if (formMethod && formMethod !== "GET") return defaultShouldRevalidate;
143 return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo;
144}
145
146/**
Usage, Billing settings and prepaid AI credit; fixes from the UX audit147 * The sidebar: the workspace whose pages or project these are when it is
148 * one of yours, else the one you chose (lib/workspace-choice.ts); its
149 * projects; and the repository being looked at.
Agents as a team: lifecycle, merge queue, billing and a new shell150 */
151async function shellFor(
152 user: User,
153 params: { owner?: string; repo?: string },
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put154 chosen: string | null,
Fast pages, required checks on the branch, self-hosted runners, honest incidents155 context: Route.LoaderArgs["context"],
Agents as a team: lifecycle, merge queue, billing and a new shell156): Promise<ShellData> {
157 const memberships = user.workspaces ?? [];
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put158 const workspace = workspaceFor(memberships, chosen, params);
Agents as a team: lifecycle, merge queue, billing and a new shell159 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 request160 const now = new Date();
161 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
Fast pages, required checks on the branch, self-hosted runners, honest incidents162 // What the sidebar shows of the workspace changes rarely: kept for a few
163 // seconds per person and workspace, except just after they changed
164 // something (lib/cache.server.ts).
165 const kept = <T,>(what: string, load: () => Promise<T>) =>
166 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 sidebar167 const [listed, counts, status, usage, limit, entitlements, shared, unread, shortcuts] = await Promise.all([
168 // Every project, for the palette and the count; the sidebar lists only
169 // the person's pinned and recent ones (lib/pins.ts).
170 workspace ? workspaceProjects(workspace.slug, user) : Promise.resolve(null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents171 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 processor172 // Whether billing is on, without reading the account: that asks the
173 // card processor about the workspace's cards, too slow for every page.
174 kept("status", () => billing.status()).catch(() => null),
Usage, Billing settings and prepaid AI credit; fixes from the UX audit175 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)).catch(() => null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents176 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
177 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
178 sharedRepos(user),
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all179 // The bell's count: one query, never kept, so marking an item shows at once.
180 inbox.counts(user.username).catch(() => null),
Navigation: the workspace's own page with tabs, pins and recent in the sidebar181 // Never kept: opening a project moves it up Recent.
182 workspace ? projects.shortcuts(workspace.slug, user).catch(() => null) : Promise.resolve(null),
Agents as a team: lifecycle, merge queue, billing and a new shell183 ]);
184 return {
185 workspace,
Projects: what a workspace builds and runs, first on every page186 // 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 sidebar187 repos: listed?.ok ? listed.value.map(shortcutOf) : [],
188 pinned: (shortcuts?.pinned ?? []).map(shortcutOf),
189 recent: (shortcuts?.recent ?? []).map(shortcutOf),
Agents as a team: lifecycle, merge queue, billing and a new shell190 repo:
191 path && counts?.ok
192 ? {
193 ...path,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look194 // Until the repository's own page says what their role is.
195 member: hasAccessIn(user, path.namespace),
Agents as a team: lifecycle, merge queue, billing and a new shell196 issues: counts.value.issues,
197 pulls: counts.value.pulls,
198 }
199 : null,
Billing accounts, terms and enterprises; g1t is no longer free200 // Where the workspace stands against its usage limit, once billing is on.
201 limit:
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor202 status?.enabled && limit?.ok
Billing accounts, terms and enterprises; g1t is no longer free203 ? {
204 exposureMicros: limit.value.exposureMicros,
205 ceilingMicros: limit.value.ceilingMicros,
206 state: limit.value.state,
207 comped: limit.value.trust === "internal",
208 }
209 : null,
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor210 free: Boolean(status?.free),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look211 // A spend spike or a hold pauses new compute: the shell says so on every page.
212 compute:
213 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
214 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
215 : null,
216 shared,
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all217 inbox: unread,
Usage while free is shown at cost; agents get rustfmt and clippy218 // 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 audit219 // Usage at price, the one figure every page shows.
220 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 shell221 };
222}
223
Usage, Billing settings and prepaid AI credit; fixes from the UX audit224/**
225 * How long the sidebar's workspace answers are kept: as long as someone's
226 * own changes read fresh anyway (lib/perf.ts `PRIMARY_WINDOW_SECONDS`).
227 */
228const SHELL_TTL_MS = 30_000;
Fast pages, required checks on the branch, self-hosted runners, honest incidents229
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look230/** Most repositories listed under Shared with you. */
231const MAX_SHARED = 20;
232
233/**
234 * Repositories shared with the user in workspaces they do not belong to,
235 * by their grants: only those, never the workspace's other repositories.
236 */
237async function sharedRepos(user: User): Promise<ShellData["shared"]> {
238 const outside = new Set(sharedWorkspaces(user));
239 if (outside.size === 0) return [];
240 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 incidents241 const found = await readableRepos(ids, user);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look242 return found
Fast pages, required checks on the branch, self-hosted runners, honest incidents243 .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 look244 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
245}
246
API and MCP server, Rust identity service, registration, site redesign247function HeaderLink({ to, children }: { to: string; children: React.ReactNode }) {
248 return (
249 <NavLink
250 to={to}
251 className={({ isActive }) =>
252 `rounded-md px-2.5 py-1.5 text-sm transition-colors hover:bg-raised hover:text-fg ${
253 isActive ? "text-fg" : "text-muted"
254 }`
255 }
256 >
257 {children}
258 </NavLink>
259 );
260}
261
Search across all of g1t, Explore, and a command palette262/** What the palette offers someone without the app's sidebar. */
263const PUBLIC_COMMANDS: PaletteCommand[] = [
264 { label: "Explore", hint: "Public projects", to: "/explore", icon: <Compass size={15} /> },
265 { label: "Search g1t", hint: "Repositories, code, issues, people", to: "/search", icon: <Search size={15} /> },
266 { label: "Pricing", to: "/pricing", icon: <CreditCard size={15} /> },
267 { label: "Documentation", to: "https://docs.g1t.sh/", icon: <BookOpen size={15} /> },
268 { label: "Sign in", to: "/login", icon: <LogIn size={15} /> },
269 { label: "Sign up", to: "/register", icon: <Plus size={15} /> },
270];
271
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look272/** Sign up, or Request access while g1t is invite-only. */
273function SignUpButton() {
274 const copy = useSignUpCopy();
275 return <ButtonLink to="/register">{copy.primary}</ButtonLink>;
276}
277
Email verification, password reset, and Git for AI scale positioning278function Header({ user }: { user: User | null | undefined }) {
Acceptance checks in sandboxes, line comments and review verdicts279 const submit = useSubmit();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look280 const signUp = useSignUpCopy();
Search across all of g1t, Explore, and a command palette281 const [palette, setPalette] = useState(false);
282 usePaletteShortcut(() => setPalette((open) => !open));
283 const params = useParams();
284 const repo = params.owner && params.repo ? `${params.owner}/${params.repo}` : null;
API and MCP server, Rust identity service, registration, site redesign285 return (
286 <header className="sticky top-0 z-40 border-b border-line bg-surface/85 backdrop-blur">
287 <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 look288 <Link to="/" aria-label="g1t home" className="mr-2 flex">
API and MCP server, Rust identity service, registration, site redesign289 <Logo />
290 </Link>
291 <Form action="/search" role="search" className="relative hidden grow sm:block sm:max-w-xs">
292 <Search
293 size={14}
294 className="pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-faint"
295 />
296 <input
297 name="q"
Agents as a team: lifecycle, merge queue, billing and a new shell298 {...notACredential()}
Search across all of g1t, Explore, and a command palette299 placeholder="Search g1t"
300 aria-label="Search g1t"
301 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 redesign302 />
Usage, Billing settings and prepaid AI credit; fixes from the UX audit303 <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 redesign304 </Form>
Search across all of g1t, Explore, and a command palette305 <button
306 type="button"
307 aria-label="Search g1t"
308 onClick={() => setPalette(true)}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look309 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 palette310 >
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look311 <Search size={18} />
Search across all of g1t, Explore, and a command palette312 </button>
313 <CommandPalette
314 open={palette}
315 onOpenChange={setPalette}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look316 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 palette317 repo={repo}
318 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look319 <nav aria-label="Main" className="hidden items-center gap-0.5 sm:flex">
API and MCP server, Rust identity service, registration, site redesign320 <HeaderLink to="/explore">Explore</HeaderLink>
Prices keep themselves current with what g1t pays321 <HeaderLink to="/pricing">Pricing</HeaderLink>
Docs as their own app; shared theme package322 <HeaderLink to="https://docs.g1t.sh/">Docs</HeaderLink>
API and MCP server, Rust identity service, registration, site redesign323 </nav>
324 <div className="ml-auto flex items-center gap-2">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look325 {/* On a phone the links fold into one menu, so the bar fits. */}
326 <DropdownMenu>
327 <DropdownMenuTrigger
328 aria-label="Menu"
Usage, Billing settings and prepaid AI credit; fixes from the UX audit329 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 look330 >
331 <Menu size={18} />
332 </DropdownMenuTrigger>
333 <DropdownMenuContent align="end" className="w-52">
334 <DropdownMenuItem asChild className="min-h-11">
335 <Link to="/explore">
336 <Compass />
337 Explore
338 </Link>
339 </DropdownMenuItem>
340 <DropdownMenuItem asChild className="min-h-11">
341 <Link to="/pricing">
342 <CreditCard />
343 Pricing
344 </Link>
345 </DropdownMenuItem>
346 <DropdownMenuItem asChild className="min-h-11">
347 <Link to="https://docs.g1t.sh/">
348 <BookOpen />
349 Docs
350 </Link>
351 </DropdownMenuItem>
352 {!user && (
353 <>
354 <DropdownMenuSeparator />
355 <DropdownMenuItem asChild className="min-h-11">
356 <Link to="/login">
357 <LogIn />
358 Sign in
359 </Link>
360 </DropdownMenuItem>
361 </>
362 )}
363 </DropdownMenuContent>
364 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign365 {user ? (
366 <>
367 <Link
368 to="/new"
Projects live: fixes from walking them end to end369 aria-label="New project"
API and MCP server, Rust identity service, registration, site redesign370 className="rounded-md border border-line p-1.5 text-muted transition-colors hover:border-line-strong hover:text-fg"
371 >
372 <Plus size={16} />
373 </Link>
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)374 <DropdownMenu>
375 <DropdownMenuTrigger
376 aria-label="Account menu"
Usage, Billing settings and prepaid AI credit; fixes from the UX audit377 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 redesign378 >
Workspace names and icons, and a component kit for every control379 <Avatar name={user.username} image={user.avatar} size={24} />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)380 <ChevronDown size={14} className="text-faint" />
381 </DropdownMenuTrigger>
382 <DropdownMenuContent align="end" className="w-56">
383 <DropdownMenuLabel>
384 Signed in as{" "}
385 <span className="font-mono font-medium text-fg">
386 {user.username}
387 </span>
388 </DropdownMenuLabel>
389 <DropdownMenuSeparator />
Workspaces own repositories390 {(user.workspaces ?? []).map((membership) => (
391 <DropdownMenuItem asChild key={membership.slug}>
392 <Link to={`/${membership.slug}`}>
Workspace names and icons, and a component kit for every control393 <Avatar name={membership.slug} image={membership.avatar} size={16} square />
394 <span className="min-w-0 truncate">{membership.name || membership.slug}</span>
Workspaces own repositories395 </Link>
396 </DropdownMenuItem>
397 ))}
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)398 <DropdownMenuItem asChild>
Workspaces own repositories399 <Link to="/workspaces/new">
400 <Plus />
401 New workspace
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)402 </Link>
403 </DropdownMenuItem>
Workspaces own repositories404 <DropdownMenuSeparator />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)405 <DropdownMenuItem asChild>
406 <Link to="/">
407 <LayoutDashboard />
408 Mission control
409 </Link>
410 </DropdownMenuItem>
411 <DropdownMenuItem asChild>
412 <Link to="/new">
413 <Plus />
Projects live: fixes from walking them end to end414 New project
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)415 </Link>
416 </DropdownMenuItem>
417 <DropdownMenuSeparator />
418 <DropdownMenuItem asChild>
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas419 <Link to="/settings/profile">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)420 <Settings />
421 Settings
422 </Link>
423 </DropdownMenuItem>
424 <DropdownMenuItem asChild>
Docs as their own app; shared theme package425 <Link to="https://docs.g1t.sh/quickstart/">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)426 <BookOpen />
427 Documentation
428 </Link>
429 </DropdownMenuItem>
430 <DropdownMenuSeparator />
Acceptance checks in sandboxes, line comments and review verdicts431 {/* Submitted from here: the menu closes on select, and a button
432 that has left the page cannot submit a form. */}
433 <DropdownMenuItem
434 onSelect={() => submit(null, { method: "post", action: "/logout" })}
435 >
436 <LogOut />
437 Sign out
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)438 </DropdownMenuItem>
439 </DropdownMenuContent>
440 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign441 </>
442 ) : (
443 <>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look444 <span className="hidden sm:contents">
445 <HeaderLink to="/login">Sign in</HeaderLink>
446 </span>
447 <SignUpButton />
API and MCP server, Rust identity service, registration, site redesign448 </>
449 )}
450 </div>
451 </div>
452 </header>
453 );
454}
455
Usage, Billing settings and prepaid AI credit; fixes from the UX audit456/**
457 * The root's data as the browser last had it. When a navigation fails in a
458 * way that takes the root's data with it, the error is still drawn in the
459 * person's own frame, signed in, not the visitor's. Never kept on the
460 * server, where one module serves everyone.
461 */
462let lastRoot: Awaited<ReturnType<typeof loader>> | undefined;
463
Initial g1t: services, event bus, intents and attempts464export function Layout({ children }: { children: React.ReactNode }) {
465 // Undefined when the root loader itself failed.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit466 const loaded = useRouteLoaderData<typeof loader>("root");
467 const inBrowser = typeof document !== "undefined";
468 if (loaded && inBrowser) lastRoot = loaded;
469 const root = loaded ?? (inBrowser ? lastRoot : undefined);
Agents as a team: lifecycle, merge queue, billing and a new shell470 const user = root?.user;
Merge branch 'worktree-agent-a985c01f43538af01'471 const { pathname, search } = useLocation();
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas472 // Drawn around the error page too: a 404 keeps the sidebar out of a
473 // project or workspace the viewer cannot see.
474 const error = useRouteError();
475 const missing = isRouteErrorResponse(error) && error.status === 404;
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look476 // The billing page shows the full banner itself.
477 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
Fast pages, required checks on the branch, self-hosted runners, honest incidents478 <SpikeBanner
479 compact
480 slug={root.shell.workspace.slug}
481 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
482 owner={root.shell.compute.owner}
483 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look484 );
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)485 // On the few pages an account still confirming its address can open
486 // besides /confirm-email (policies, support, signing in): the way back.
487 const verify = user && awaitsConfirmation(user) && pathname !== "/confirm-email" && (
488 <p
489 role="status"
Agents as a team: lifecycle, merge queue, billing and a new shell490 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"
491 >
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)492 <span>Confirm your email address to start using g1t.</span>
493 <Link to="/confirm-email" className="font-medium underline underline-offset-4">
494 Enter your code
495 </Link>
496 </p>
Agents as a team: lifecycle, merge queue, billing and a new shell497 );
Merge main (membership, two-factor, GitHub repo roles) into tokens498 // A workspace that requires two-factor authentication of someone who
499 // has not turned it on: they keep their place, and cannot use it yet.
500 const held = user?.held && user.held.length > 0 && pathname !== "/settings/two-factor" && <PolicyNotice held={user.held} />;
Merge branch 'worktree-agent-aca4790ea223aa235'501 const leaving = useLeaving();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look502 const banner =
Merge main (membership, two-factor, GitHub repo roles) into tokens503 paused || verify || held ? (
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look504 <>
505 {paused}
506 {verify}
Merge main (membership, two-factor, GitHub repo roles) into tokens507 {held}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look508 </>
509 ) : null;
Initial g1t: services, event bus, intents and attempts510 return (
511 <html lang="en">
512 <head>
513 <meta charSet="utf-8" />
514 <meta name="viewport" content="width=device-width, initial-scale=1" />
Dark gray base with lavender as an accent, and a live outcome view for plans515 <meta name="theme-color" content="#0f0f11" />
Put the stylesheet at the top of the head, before React Router's preloads516 {/* The stylesheet before everything React Router preloads, so a slow
517 connection paints sooner (docs/research/css-shipping.md). */}
Give the stylesheet a precedence so React places it before preloads518 <link rel="stylesheet" href={appCss} precedence="default" />
Initial g1t: services, event bus, intents and attempts519 <Meta />
520 <Links />
521 </head>
API and MCP server, Rust identity service, registration, site redesign522 <body className="flex min-h-screen flex-col">
Usage, Billing settings and prepaid AI credit; fixes from the UX audit523 {/* The first stop for the keyboard: past the menus, to the page. */}
524 <a
525 href="#content"
526 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]"
527 >
528 Skip to content
529 </a>
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)530 {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 quotas531 <AppShell user={user ?? null} shell={root.shell} missing={missing} banner={banner}>
Agents as a team: lifecycle, merge queue, billing and a new shell532 {children}
533 </AppShell>
534 ) : (
535 <>
536 <Progress />
537 <Header user={user} />
538 {banner}
Usage, Billing settings and prepaid AI credit; fixes from the UX audit539 <div id="content" tabIndex={-1} {...leaving} className={`grow outline-none ${leaving.className}`}>
Merge branch 'worktree-agent-aca4790ea223aa235'540 {children}
541 </div>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look542 <SiteFooter user={user} />
Agents as a team: lifecycle, merge queue, billing and a new shell543 </>
Email verification, password reset, and Git for AI scale positioning544 )}
Initial g1t: services, event bus, intents and attempts545 <ScrollRestoration />
546 <Scripts />
547 </body>
548 </html>
549 );
550}
551
552export default function App() {
553 return <Outlet />;
554}
555
556export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
Usage, Billing settings and prepaid AI credit; fixes from the UX audit557 const location = useLocation();
558 const matches = useMatches();
559 // A tab left open across a deploy: load the address again as a whole
560 // page, once, rather than show an error the reload fixes.
561 const reload = reloadFixes({
562 error,
563 status: isRouteErrorResponse(error) ? error.status : undefined,
564 // The first page a tab loads has the key "default"; a client navigation's is its own.
565 clientNavigation: location.key !== "default",
566 caughtByCatchAll: matches.at(-1)?.id === "routes/not-found",
567 });
568 const href = location.pathname + location.search + location.hash;
569 useEffect(() => {
570 if (!reload) return;
571 try {
572 if (sessionStorage.getItem(RELOADED_KEY) === href) return;
573 sessionStorage.setItem(RELOADED_KEY, href);
574 } catch {
575 // No session storage: reload anyway; a document load never asks again.
576 }
577 window.location.assign(href);
578 }, [reload, href]);
579 if (reload) {
580 return (
581 <main className="mx-auto max-w-xl px-4 py-32 text-center text-sm text-muted" aria-busy="true">
582 <title>Loading · g1t</title>
583 Loading the latest version of g1t…
584 </main>
585 );
586 }
587
API and MCP server, Rust identity service, registration, site redesign588 let title = "Something went wrong";
589 let details = "An unexpected error occurred. Try again in a moment.";
Initial g1t: services, event bus, intents and attempts590 let stack: string | undefined;
591
592 if (isRouteErrorResponse(error)) {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put593 // The same page for something private and something missing.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit594 if (error.status === 404) {
595 return (
596 <>
597 <title>Not found · g1t</title>
598 <NotFound data={error.data} />
599 </>
600 );
601 }
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put602 if (typeof error.data === "string" && error.data) {
API and MCP server, Rust identity service, registration, site redesign603 details = error.data;
604 }
605 } else if (import.meta.env.DEV && error instanceof Error) {
Initial g1t: services, event bus, intents and attempts606 details = error.message;
607 stack = error.stack;
608 }
609
610 return (
API and MCP server, Rust identity service, registration, site redesign611 <main className="mx-auto max-w-xl px-4 py-32 text-center">
612 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
613 <p className="mt-3 text-muted">{details}</p>
614 <div className="mt-8">
615 <ButtonLink to="/" variant="quiet">
616 Back to home
617 </ButtonLink>
618 </div>
Initial g1t: services, event bus, intents and attempts619 {stack && (
API and MCP server, Rust identity service, registration, site redesign620 <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 attempts621 <code>{stack}</code>
622 </pre>
623 )}
624 </main>
625 );
626}

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