Skip to content
628 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";
The site's pages run only their own scripts: a nonce policy, nosniff, a referrer policy and no framing68import { useNonce } from "./lib/nonce";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look69
Initial g1t: services, event bus, intents and attempts70
71export const links: Route.LinksFunction = () => [
The fleet: g1t's new mark72 { rel: "icon", href: "/favicon.ico", sizes: "32x32" },
Initial g1t: services, event bus, intents and attempts73 { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
The fleet: g1t's new mark74 { rel: "icon", type: "image/png", sizes: "192x192", href: "/icon-192.png" },
75 { rel: "apple-touch-icon", href: "/apple-touch-icon.png" },
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look76 // The text and headline faces are wanted on every page, so they start
77 // loading with the stylesheet; mono waits until something uses it.
78 { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
79 { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
Initial g1t: services, event bus, intents and attempts80];
81
82export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware];
83
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put84export async function loader({ context, params, request }: Route.LoaderArgs) {
Agents as a team: lifecycle, merge queue, billing and a new shell85 const user = getViewer(context);
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put86 const chosen = readCookie(request.headers.get("cookie"), WORKSPACE_COOKIE);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look87 // What sign-up buttons say: Request access while g1t is invite-only.
88 const [shell, mode] = await Promise.all([
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)89 // An account still confirming its address sees only the pages that
90 // allows (lib/confirm-gate.ts), in the visitor's frame.
91 user && !awaitsConfirmation(user)
Usage, Billing settings and prepaid AI credit; fixes from the UX audit92 ? shellFor(user, params, chosen, context).catch((error: unknown) => {
93 // A sidebar that could not be read is no reason to lose the page,
94 // or to draw it as if they were signed out.
95 console.error("root: the sidebar could not be read", error);
96 return bareShell(user, params, chosen);
97 })
98 : visitorShell(params, context),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look99 user ? Promise.resolve(null) : registrationMode(),
100 ]);
Merge branch 'worktree-agent-aaf03bdceac799c89'101 // Where this g1t lives, for clone lines, agent setup and link previews.
102 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 put103}
104
105/**
106 * The sidebar for someone not signed in: nothing of their own, only the
107 * open counts of the project being looked at. One call, and only in a
108 * project; it answers the same for a private project as a missing one.
109 */
Fast pages, required checks on the branch, self-hosted runners, honest incidents110async 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 put111 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
Fast pages, required checks on the branch, self-hosted runners, honest incidents112 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 put113 return {
114 workspace: null,
115 repos: [],
116 repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null,
117 limit: null,
118 monthUsageMicros: null,
119 };
Initial g1t: services, event bus, intents and attempts120}
121
Usage, Billing settings and prepaid AI credit; fixes from the UX audit122/** The sidebar from what the session already says, with no service asked. */
123function bareShell(user: User, params: { owner?: string; repo?: string }, chosen: string | null): ShellData {
124 return {
125 workspace: workspaceFor(user.workspaces ?? [], chosen, params),
126 repos: [],
127 repo: null,
128 limit: null,
129 monthUsageMicros: null,
130 };
131}
132
Agents as a team: lifecycle, merge queue, billing and a new shell133/**
134 * The sidebar only changes with the workspace or repository being looked
135 * at, or after something was submitted: not on every page within them.
136 */
137export function shouldRevalidate({
138 currentParams,
139 nextParams,
140 formMethod,
141 defaultShouldRevalidate,
142}: ShouldRevalidateFunctionArgs) {
143 if (formMethod && formMethod !== "GET") return defaultShouldRevalidate;
144 return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo;
145}
146
147/**
Usage, Billing settings and prepaid AI credit; fixes from the UX audit148 * The sidebar: the workspace whose pages or project these are when it is
149 * one of yours, else the one you chose (lib/workspace-choice.ts); its
150 * projects; and the repository being looked at.
Agents as a team: lifecycle, merge queue, billing and a new shell151 */
152async function shellFor(
153 user: User,
154 params: { owner?: string; repo?: string },
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put155 chosen: string | null,
Fast pages, required checks on the branch, self-hosted runners, honest incidents156 context: Route.LoaderArgs["context"],
Agents as a team: lifecycle, merge queue, billing and a new shell157): Promise<ShellData> {
158 const memberships = user.workspaces ?? [];
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put159 const workspace = workspaceFor(memberships, chosen, params);
Agents as a team: lifecycle, merge queue, billing and a new shell160 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 request161 const now = new Date();
162 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
Fast pages, required checks on the branch, self-hosted runners, honest incidents163 // What the sidebar shows of the workspace changes rarely: kept for a few
164 // seconds per person and workspace, except just after they changed
165 // something (lib/cache.server.ts).
166 const kept = <T,>(what: string, load: () => Promise<T>) =>
167 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 sidebar168 const [listed, counts, status, usage, limit, entitlements, shared, unread, shortcuts] = await Promise.all([
169 // Every project, for the palette and the count; the sidebar lists only
170 // the person's pinned and recent ones (lib/pins.ts).
171 workspace ? workspaceProjects(workspace.slug, user) : Promise.resolve(null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents172 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 processor173 // Whether billing is on, without reading the account: that asks the
174 // card processor about the workspace's cards, too slow for every page.
175 kept("status", () => billing.status()).catch(() => null),
Usage, Billing settings and prepaid AI credit; fixes from the UX audit176 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)).catch(() => null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents177 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
178 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
179 sharedRepos(user),
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all180 // The bell's count: one query, never kept, so marking an item shows at once.
181 inbox.counts(user.username).catch(() => null),
Navigation: the workspace's own page with tabs, pins and recent in the sidebar182 // Never kept: opening a project moves it up Recent.
183 workspace ? projects.shortcuts(workspace.slug, user).catch(() => null) : Promise.resolve(null),
Agents as a team: lifecycle, merge queue, billing and a new shell184 ]);
185 return {
186 workspace,
Projects: what a workspace builds and runs, first on every page187 // 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 sidebar188 repos: listed?.ok ? listed.value.map(shortcutOf) : [],
189 pinned: (shortcuts?.pinned ?? []).map(shortcutOf),
190 recent: (shortcuts?.recent ?? []).map(shortcutOf),
Agents as a team: lifecycle, merge queue, billing and a new shell191 repo:
192 path && counts?.ok
193 ? {
194 ...path,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look195 // Until the repository's own page says what their role is.
196 member: hasAccessIn(user, path.namespace),
Agents as a team: lifecycle, merge queue, billing and a new shell197 issues: counts.value.issues,
198 pulls: counts.value.pulls,
199 }
200 : null,
Billing accounts, terms and enterprises; g1t is no longer free201 // Where the workspace stands against its usage limit, once billing is on.
202 limit:
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor203 status?.enabled && limit?.ok
Billing accounts, terms and enterprises; g1t is no longer free204 ? {
205 exposureMicros: limit.value.exposureMicros,
206 ceilingMicros: limit.value.ceilingMicros,
207 state: limit.value.state,
208 comped: limit.value.trust === "internal",
209 }
210 : null,
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor211 free: Boolean(status?.free),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look212 // A spend spike or a hold pauses new compute: the shell says so on every page.
213 compute:
214 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
215 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
216 : null,
217 shared,
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all218 inbox: unread,
Usage while free is shown at cost; agents get rustfmt and clippy219 // 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 audit220 // Usage at price, the one figure every page shows.
221 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 shell222 };
223}
224
Usage, Billing settings and prepaid AI credit; fixes from the UX audit225/**
226 * How long the sidebar's workspace answers are kept: as long as someone's
227 * own changes read fresh anyway (lib/perf.ts `PRIMARY_WINDOW_SECONDS`).
228 */
229const SHELL_TTL_MS = 30_000;
Fast pages, required checks on the branch, self-hosted runners, honest incidents230
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look231/** Most repositories listed under Shared with you. */
232const MAX_SHARED = 20;
233
234/**
235 * Repositories shared with the user in workspaces they do not belong to,
236 * by their grants: only those, never the workspace's other repositories.
237 */
238async function sharedRepos(user: User): Promise<ShellData["shared"]> {
239 const outside = new Set(sharedWorkspaces(user));
240 if (outside.size === 0) return [];
241 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 incidents242 const found = await readableRepos(ids, user);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look243 return found
Fast pages, required checks on the branch, self-hosted runners, honest incidents244 .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 look245 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
246}
247
API and MCP server, Rust identity service, registration, site redesign248function HeaderLink({ to, children }: { to: string; children: React.ReactNode }) {
249 return (
250 <NavLink
251 to={to}
252 className={({ isActive }) =>
253 `rounded-md px-2.5 py-1.5 text-sm transition-colors hover:bg-raised hover:text-fg ${
254 isActive ? "text-fg" : "text-muted"
255 }`
256 }
257 >
258 {children}
259 </NavLink>
260 );
261}
262
Search across all of g1t, Explore, and a command palette263/** What the palette offers someone without the app's sidebar. */
264const PUBLIC_COMMANDS: PaletteCommand[] = [
265 { label: "Explore", hint: "Public projects", to: "/explore", icon: <Compass size={15} /> },
266 { label: "Search g1t", hint: "Repositories, code, issues, people", to: "/search", icon: <Search size={15} /> },
267 { label: "Pricing", to: "/pricing", icon: <CreditCard size={15} /> },
268 { label: "Documentation", to: "https://docs.g1t.sh/", icon: <BookOpen size={15} /> },
269 { label: "Sign in", to: "/login", icon: <LogIn size={15} /> },
270 { label: "Sign up", to: "/register", icon: <Plus size={15} /> },
271];
272
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look273/** Sign up, or Request access while g1t is invite-only. */
274function SignUpButton() {
275 const copy = useSignUpCopy();
276 return <ButtonLink to="/register">{copy.primary}</ButtonLink>;
277}
278
Email verification, password reset, and Git for AI scale positioning279function Header({ user }: { user: User | null | undefined }) {
Acceptance checks in sandboxes, line comments and review verdicts280 const submit = useSubmit();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look281 const signUp = useSignUpCopy();
Search across all of g1t, Explore, and a command palette282 const [palette, setPalette] = useState(false);
283 usePaletteShortcut(() => setPalette((open) => !open));
284 const params = useParams();
285 const repo = params.owner && params.repo ? `${params.owner}/${params.repo}` : null;
API and MCP server, Rust identity service, registration, site redesign286 return (
287 <header className="sticky top-0 z-40 border-b border-line bg-surface/85 backdrop-blur">
288 <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 look289 <Link to="/" aria-label="g1t home" className="mr-2 flex">
API and MCP server, Rust identity service, registration, site redesign290 <Logo />
291 </Link>
292 <Form action="/search" role="search" className="relative hidden grow sm:block sm:max-w-xs">
293 <Search
294 size={14}
295 className="pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-faint"
296 />
297 <input
298 name="q"
Agents as a team: lifecycle, merge queue, billing and a new shell299 {...notACredential()}
Search across all of g1t, Explore, and a command palette300 placeholder="Search g1t"
301 aria-label="Search g1t"
302 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 redesign303 />
Usage, Billing settings and prepaid AI credit; fixes from the UX audit304 <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 redesign305 </Form>
Search across all of g1t, Explore, and a command palette306 <button
307 type="button"
308 aria-label="Search g1t"
309 onClick={() => setPalette(true)}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look310 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 palette311 >
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look312 <Search size={18} />
Search across all of g1t, Explore, and a command palette313 </button>
314 <CommandPalette
315 open={palette}
316 onOpenChange={setPalette}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look317 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 palette318 repo={repo}
319 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look320 <nav aria-label="Main" className="hidden items-center gap-0.5 sm:flex">
API and MCP server, Rust identity service, registration, site redesign321 <HeaderLink to="/explore">Explore</HeaderLink>
Prices keep themselves current with what g1t pays322 <HeaderLink to="/pricing">Pricing</HeaderLink>
Docs as their own app; shared theme package323 <HeaderLink to="https://docs.g1t.sh/">Docs</HeaderLink>
API and MCP server, Rust identity service, registration, site redesign324 </nav>
325 <div className="ml-auto flex items-center gap-2">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look326 {/* On a phone the links fold into one menu, so the bar fits. */}
327 <DropdownMenu>
328 <DropdownMenuTrigger
329 aria-label="Menu"
Usage, Billing settings and prepaid AI credit; fixes from the UX audit330 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 look331 >
332 <Menu size={18} />
333 </DropdownMenuTrigger>
334 <DropdownMenuContent align="end" className="w-52">
335 <DropdownMenuItem asChild className="min-h-11">
336 <Link to="/explore">
337 <Compass />
338 Explore
339 </Link>
340 </DropdownMenuItem>
341 <DropdownMenuItem asChild className="min-h-11">
342 <Link to="/pricing">
343 <CreditCard />
344 Pricing
345 </Link>
346 </DropdownMenuItem>
347 <DropdownMenuItem asChild className="min-h-11">
348 <Link to="https://docs.g1t.sh/">
349 <BookOpen />
350 Docs
351 </Link>
352 </DropdownMenuItem>
353 {!user && (
354 <>
355 <DropdownMenuSeparator />
356 <DropdownMenuItem asChild className="min-h-11">
357 <Link to="/login">
358 <LogIn />
359 Sign in
360 </Link>
361 </DropdownMenuItem>
362 </>
363 )}
364 </DropdownMenuContent>
365 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign366 {user ? (
367 <>
368 <Link
369 to="/new"
Projects live: fixes from walking them end to end370 aria-label="New project"
API and MCP server, Rust identity service, registration, site redesign371 className="rounded-md border border-line p-1.5 text-muted transition-colors hover:border-line-strong hover:text-fg"
372 >
373 <Plus size={16} />
374 </Link>
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)375 <DropdownMenu>
376 <DropdownMenuTrigger
377 aria-label="Account menu"
Usage, Billing settings and prepaid AI credit; fixes from the UX audit378 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 redesign379 >
Workspace names and icons, and a component kit for every control380 <Avatar name={user.username} image={user.avatar} size={24} />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)381 <ChevronDown size={14} className="text-faint" />
382 </DropdownMenuTrigger>
383 <DropdownMenuContent align="end" className="w-56">
384 <DropdownMenuLabel>
385 Signed in as{" "}
386 <span className="font-mono font-medium text-fg">
387 {user.username}
388 </span>
389 </DropdownMenuLabel>
390 <DropdownMenuSeparator />
Workspaces own repositories391 {(user.workspaces ?? []).map((membership) => (
392 <DropdownMenuItem asChild key={membership.slug}>
393 <Link to={`/${membership.slug}`}>
Workspace names and icons, and a component kit for every control394 <Avatar name={membership.slug} image={membership.avatar} size={16} square />
395 <span className="min-w-0 truncate">{membership.name || membership.slug}</span>
Workspaces own repositories396 </Link>
397 </DropdownMenuItem>
398 ))}
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)399 <DropdownMenuItem asChild>
Workspaces own repositories400 <Link to="/workspaces/new">
401 <Plus />
402 New workspace
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)403 </Link>
404 </DropdownMenuItem>
Workspaces own repositories405 <DropdownMenuSeparator />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)406 <DropdownMenuItem asChild>
407 <Link to="/">
408 <LayoutDashboard />
409 Mission control
410 </Link>
411 </DropdownMenuItem>
412 <DropdownMenuItem asChild>
413 <Link to="/new">
414 <Plus />
Projects live: fixes from walking them end to end415 New project
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)416 </Link>
417 </DropdownMenuItem>
418 <DropdownMenuSeparator />
419 <DropdownMenuItem asChild>
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas420 <Link to="/settings/profile">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)421 <Settings />
422 Settings
423 </Link>
424 </DropdownMenuItem>
425 <DropdownMenuItem asChild>
Docs as their own app; shared theme package426 <Link to="https://docs.g1t.sh/quickstart/">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)427 <BookOpen />
428 Documentation
429 </Link>
430 </DropdownMenuItem>
431 <DropdownMenuSeparator />
Acceptance checks in sandboxes, line comments and review verdicts432 {/* Submitted from here: the menu closes on select, and a button
433 that has left the page cannot submit a form. */}
434 <DropdownMenuItem
435 onSelect={() => submit(null, { method: "post", action: "/logout" })}
436 >
437 <LogOut />
438 Sign out
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)439 </DropdownMenuItem>
440 </DropdownMenuContent>
441 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign442 </>
443 ) : (
444 <>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look445 <span className="hidden sm:contents">
446 <HeaderLink to="/login">Sign in</HeaderLink>
447 </span>
448 <SignUpButton />
API and MCP server, Rust identity service, registration, site redesign449 </>
450 )}
451 </div>
452 </div>
453 </header>
454 );
455}
456
Usage, Billing settings and prepaid AI credit; fixes from the UX audit457/**
458 * The root's data as the browser last had it. When a navigation fails in a
459 * way that takes the root's data with it, the error is still drawn in the
460 * person's own frame, signed in, not the visitor's. Never kept on the
461 * server, where one module serves everyone.
462 */
463let lastRoot: Awaited<ReturnType<typeof loader>> | undefined;
464
Initial g1t: services, event bus, intents and attempts465export function Layout({ children }: { children: React.ReactNode }) {
The site's pages run only their own scripts: a nonce policy, nosniff, a referrer policy and no framing466 const nonce = useNonce();
Initial g1t: services, event bus, intents and attempts467 // Undefined when the root loader itself failed.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit468 const loaded = useRouteLoaderData<typeof loader>("root");
469 const inBrowser = typeof document !== "undefined";
470 if (loaded && inBrowser) lastRoot = loaded;
471 const root = loaded ?? (inBrowser ? lastRoot : undefined);
Agents as a team: lifecycle, merge queue, billing and a new shell472 const user = root?.user;
Merge branch 'worktree-agent-a985c01f43538af01'473 const { pathname, search } = useLocation();
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas474 // Drawn around the error page too: a 404 keeps the sidebar out of a
475 // project or workspace the viewer cannot see.
476 const error = useRouteError();
477 const missing = isRouteErrorResponse(error) && error.status === 404;
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look478 // The billing page shows the full banner itself.
479 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
Fast pages, required checks on the branch, self-hosted runners, honest incidents480 <SpikeBanner
481 compact
482 slug={root.shell.workspace.slug}
483 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
484 owner={root.shell.compute.owner}
485 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look486 );
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)487 // On the few pages an account still confirming its address can open
488 // besides /confirm-email (policies, support, signing in): the way back.
489 const verify = user && awaitsConfirmation(user) && pathname !== "/confirm-email" && (
490 <p
491 role="status"
Agents as a team: lifecycle, merge queue, billing and a new shell492 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"
493 >
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)494 <span>Confirm your email address to start using g1t.</span>
495 <Link to="/confirm-email" className="font-medium underline underline-offset-4">
496 Enter your code
497 </Link>
498 </p>
Agents as a team: lifecycle, merge queue, billing and a new shell499 );
Merge main (membership, two-factor, GitHub repo roles) into tokens500 // A workspace that requires two-factor authentication of someone who
501 // has not turned it on: they keep their place, and cannot use it yet.
502 const held = user?.held && user.held.length > 0 && pathname !== "/settings/two-factor" && <PolicyNotice held={user.held} />;
Merge branch 'worktree-agent-aca4790ea223aa235'503 const leaving = useLeaving();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look504 const banner =
Merge main (membership, two-factor, GitHub repo roles) into tokens505 paused || verify || held ? (
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look506 <>
507 {paused}
508 {verify}
Merge main (membership, two-factor, GitHub repo roles) into tokens509 {held}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look510 </>
511 ) : null;
Initial g1t: services, event bus, intents and attempts512 return (
513 <html lang="en">
514 <head>
515 <meta charSet="utf-8" />
516 <meta name="viewport" content="width=device-width, initial-scale=1" />
Dark gray base with lavender as an accent, and a live outcome view for plans517 <meta name="theme-color" content="#0f0f11" />
Put the stylesheet at the top of the head, before React Router's preloads518 {/* The stylesheet before everything React Router preloads, so a slow
519 connection paints sooner (docs/research/css-shipping.md). */}
Give the stylesheet a precedence so React places it before preloads520 <link rel="stylesheet" href={appCss} precedence="default" />
Initial g1t: services, event bus, intents and attempts521 <Meta />
The site's pages run only their own scripts: a nonce policy, nosniff, a referrer policy and no framing522 <Links nonce={nonce} />
Initial g1t: services, event bus, intents and attempts523 </head>
API and MCP server, Rust identity service, registration, site redesign524 <body className="flex min-h-screen flex-col">
Usage, Billing settings and prepaid AI credit; fixes from the UX audit525 {/* The first stop for the keyboard: past the menus, to the page. */}
526 <a
527 href="#content"
528 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]"
529 >
530 Skip to content
531 </a>
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)532 {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 quotas533 <AppShell user={user ?? null} shell={root.shell} missing={missing} banner={banner}>
Agents as a team: lifecycle, merge queue, billing and a new shell534 {children}
535 </AppShell>
536 ) : (
537 <>
538 <Progress />
539 <Header user={user} />
540 {banner}
Usage, Billing settings and prepaid AI credit; fixes from the UX audit541 <div id="content" tabIndex={-1} {...leaving} className={`grow outline-none ${leaving.className}`}>
Merge branch 'worktree-agent-aca4790ea223aa235'542 {children}
543 </div>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look544 <SiteFooter user={user} />
Agents as a team: lifecycle, merge queue, billing and a new shell545 </>
Email verification, password reset, and Git for AI scale positioning546 )}
The site's pages run only their own scripts: a nonce policy, nosniff, a referrer policy and no framing547 <ScrollRestoration nonce={nonce} />
548 <Scripts nonce={nonce} />
Initial g1t: services, event bus, intents and attempts549 </body>
550 </html>
551 );
552}
553
554export default function App() {
555 return <Outlet />;
556}
557
558export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
Usage, Billing settings and prepaid AI credit; fixes from the UX audit559 const location = useLocation();
560 const matches = useMatches();
561 // A tab left open across a deploy: load the address again as a whole
562 // page, once, rather than show an error the reload fixes.
563 const reload = reloadFixes({
564 error,
565 status: isRouteErrorResponse(error) ? error.status : undefined,
566 // The first page a tab loads has the key "default"; a client navigation's is its own.
567 clientNavigation: location.key !== "default",
568 caughtByCatchAll: matches.at(-1)?.id === "routes/not-found",
569 });
570 const href = location.pathname + location.search + location.hash;
571 useEffect(() => {
572 if (!reload) return;
573 try {
574 if (sessionStorage.getItem(RELOADED_KEY) === href) return;
575 sessionStorage.setItem(RELOADED_KEY, href);
576 } catch {
577 // No session storage: reload anyway; a document load never asks again.
578 }
579 window.location.assign(href);
580 }, [reload, href]);
581 if (reload) {
582 return (
583 <main className="mx-auto max-w-xl px-4 py-32 text-center text-sm text-muted" aria-busy="true">
584 <title>Loading · g1t</title>
585 Loading the latest version of g1t…
586 </main>
587 );
588 }
589
API and MCP server, Rust identity service, registration, site redesign590 let title = "Something went wrong";
591 let details = "An unexpected error occurred. Try again in a moment.";
Initial g1t: services, event bus, intents and attempts592 let stack: string | undefined;
593
594 if (isRouteErrorResponse(error)) {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put595 // The same page for something private and something missing.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit596 if (error.status === 404) {
597 return (
598 <>
599 <title>Not found · g1t</title>
600 <NotFound data={error.data} />
601 </>
602 );
603 }
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put604 if (typeof error.data === "string" && error.data) {
API and MCP server, Rust identity service, registration, site redesign605 details = error.data;
606 }
607 } else if (import.meta.env.DEV && error instanceof Error) {
Initial g1t: services, event bus, intents and attempts608 details = error.message;
609 stack = error.stack;
610 }
611
612 return (
API and MCP server, Rust identity service, registration, site redesign613 <main className="mx-auto max-w-xl px-4 py-32 text-center">
614 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
615 <p className="mt-3 text-muted">{details}</p>
616 <div className="mt-8">
617 <ButtonLink to="/" variant="quiet">
618 Back to home
619 </ButtonLink>
620 </div>
Initial g1t: services, event bus, intents and attempts621 {stack && (
API and MCP server, Rust identity service, registration, site redesign622 <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 attempts623 <code>{stack}</code>
624 </pre>
625 )}
626 </main>
627 );
628}

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