Skip to content
702 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";
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)60import { billing, chat, inbox, projects, workspaceAgents } from "./lib/services.server";
Chat and workspace agents: channels, DMs and named agents you talk to61import { unreadTotals } from "./lib/chat";
Fast pages, required checks on the branch, self-hosted runners, honest incidents62import { countsFor, readableRepos } from "./lib/access.server";
63import { shortCache } from "./lib/cache.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look64import { getViewer, viewerMiddleware } from "./lib/session.server";
Navigation: the workspace's own page with tabs, pins and recent in the sidebar65import { shortcutOf, workspaceProjects } from "./lib/workspace-projects.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look66import { registrationMode } from "./lib/registration.server";
Merge branch 'worktree-agent-aaf03bdceac799c89'67import { addresses } from "./lib/addresses.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look68import { useSignUpCopy } from "./lib/registration";
Usage, Billing settings and prepaid AI credit; fixes from the UX audit69import { 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 address70import { useNonce } from "./lib/nonce";
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)71import { LiveNotifications } from "./components/notifications/live-notifications";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look72
Initial g1t: services, event bus, intents and attempts73
74export const links: Route.LinksFunction = () => [
The fleet: g1t's new mark75 { rel: "icon", href: "/favicon.ico", sizes: "32x32" },
Initial g1t: services, event bus, intents and attempts76 { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
The fleet: g1t's new mark77 { rel: "icon", type: "image/png", sizes: "192x192", href: "/icon-192.png" },
78 { rel: "apple-touch-icon", href: "/apple-touch-icon.png" },
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)79 // Installable: name, icons and colours for "Add to Home Screen" (public/manifest.webmanifest).
80 { rel: "manifest", href: "/manifest.webmanifest" },
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look81 // The text and headline faces are wanted on every page, so they start
82 // loading with the stylesheet; mono waits until something uses it.
83 { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
84 { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
Initial g1t: services, event bus, intents and attempts85];
86
87export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware];
88
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put89export async function loader({ context, params, request }: Route.LoaderArgs) {
Agents as a team: lifecycle, merge queue, billing and a new shell90 const user = getViewer(context);
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put91 const chosen = readCookie(request.headers.get("cookie"), WORKSPACE_COOKIE);
Sign-up buttons say Sign up everywhere; only the sign-up page says registration takes an invite92 // Whether sign-up takes an invite: only the sign-up page says so.
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look93 const [shell, mode] = await Promise.all([
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)94 // An account still confirming its address sees only the pages that
95 // allows (lib/confirm-gate.ts), in the visitor's frame.
96 user && !awaitsConfirmation(user)
Usage, Billing settings and prepaid AI credit; fixes from the UX audit97 ? shellFor(user, params, chosen, context).catch((error: unknown) => {
98 // A sidebar that could not be read is no reason to lose the page,
99 // or to draw it as if they were signed out.
100 console.error("root: the sidebar could not be read", error);
101 return bareShell(user, params, chosen);
102 })
103 : visitorShell(params, context),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look104 user ? Promise.resolve(null) : registrationMode(),
105 ]);
Merge branch 'worktree-agent-aaf03bdceac799c89'106 // Where this g1t lives, for clone lines, agent setup and link previews.
107 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 put108}
109
110/**
111 * The sidebar for someone not signed in: nothing of their own, only the
112 * open counts of the project being looked at. One call, and only in a
113 * project; it answers the same for a private project as a missing one.
114 */
Fast pages, required checks on the branch, self-hosted runners, honest incidents115async 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 put116 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
Fast pages, required checks on the branch, self-hosted runners, honest incidents117 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 put118 return {
119 workspace: null,
120 repos: [],
121 repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null,
122 limit: null,
123 monthUsageMicros: null,
124 };
Initial g1t: services, event bus, intents and attempts125}
126
Usage, Billing settings and prepaid AI credit; fixes from the UX audit127/** The sidebar from what the session already says, with no service asked. */
128function bareShell(user: User, params: { owner?: string; repo?: string }, chosen: string | null): ShellData {
129 return {
130 workspace: workspaceFor(user.workspaces ?? [], chosen, params),
131 repos: [],
132 repo: null,
133 limit: null,
134 monthUsageMicros: null,
135 };
136}
137
Agents as a team: lifecycle, merge queue, billing and a new shell138/**
139 * The sidebar only changes with the workspace or repository being looked
140 * at, or after something was submitted: not on every page within them.
141 */
142export function shouldRevalidate({
143 currentParams,
144 nextParams,
145 formMethod,
146 defaultShouldRevalidate,
147}: ShouldRevalidateFunctionArgs) {
148 if (formMethod && formMethod !== "GET") return defaultShouldRevalidate;
149 return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo;
150}
151
152/**
Usage, Billing settings and prepaid AI credit; fixes from the UX audit153 * The sidebar: the workspace whose pages or project these are when it is
154 * one of yours, else the one you chose (lib/workspace-choice.ts); its
155 * projects; and the repository being looked at.
Agents as a team: lifecycle, merge queue, billing and a new shell156 */
157async function shellFor(
158 user: User,
159 params: { owner?: string; repo?: string },
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put160 chosen: string | null,
Fast pages, required checks on the branch, self-hosted runners, honest incidents161 context: Route.LoaderArgs["context"],
Agents as a team: lifecycle, merge queue, billing and a new shell162): Promise<ShellData> {
163 const memberships = user.workspaces ?? [];
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put164 const workspace = workspaceFor(memberships, chosen, params);
Agents as a team: lifecycle, merge queue, billing and a new shell165 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 request166 const now = new Date();
167 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
Fast pages, required checks on the branch, self-hosted runners, honest incidents168 // What the sidebar shows of the workspace changes rarely: kept for a few
169 // seconds per person and workspace, except just after they changed
170 // something (lib/cache.server.ts).
171 const kept = <T,>(what: string, load: () => Promise<T>) =>
172 workspace ? shortCache(`shell:${what}:${user.id}:${workspace.slug}`, SHELL_TTL_MS, load) : Promise.resolve(null);
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)173 const [listed, counts, status, usage, limit, entitlements, shared, unread, shortcuts, chatUnread, teamAgents] = await Promise.all([
Navigation: the workspace's own page with tabs, pins and recent in the sidebar174 // Every project, for the palette and the count; the sidebar lists only
175 // the person's pinned and recent ones (lib/pins.ts).
176 workspace ? workspaceProjects(workspace.slug, user) : Promise.resolve(null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents177 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 processor178 // Whether billing is on, without reading the account: that asks the
179 // card processor about the workspace's cards, too slow for every page.
180 kept("status", () => billing.status()).catch(() => null),
Usage, Billing settings and prepaid AI credit; fixes from the UX audit181 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)).catch(() => null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents182 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
183 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
184 sharedRepos(user),
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all185 // The bell's count: one query, never kept, so marking an item shows at once.
186 inbox.counts(user.username).catch(() => null),
Navigation: the workspace's own page with tabs, pins and recent in the sidebar187 // Never kept: opening a project moves it up Recent.
188 workspace ? projects.shortcuts(workspace.slug, user).catch(() => null) : Promise.resolve(null),
Chat and workspace agents: channels, DMs and named agents you talk to189 // The rail's Chat badge: never kept, and never waited on for long.
190 workspace ? chatUnreadFor(workspace.slug, user) : Promise.resolve(null),
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)191 // Home's Recent and the Agents sidebar, on every page: never waited on for long.
192 workspace ? agentsFor(workspace.slug, user) : Promise.resolve(null),
Agents as a team: lifecycle, merge queue, billing and a new shell193 ]);
194 return {
195 workspace,
Projects: what a workspace builds and runs, first on every page196 // 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 sidebar197 repos: listed?.ok ? listed.value.map(shortcutOf) : [],
198 pinned: (shortcuts?.pinned ?? []).map(shortcutOf),
199 recent: (shortcuts?.recent ?? []).map(shortcutOf),
Agents as a team: lifecycle, merge queue, billing and a new shell200 repo:
201 path && counts?.ok
202 ? {
203 ...path,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look204 // Until the repository's own page says what their role is.
205 member: hasAccessIn(user, path.namespace),
Agents as a team: lifecycle, merge queue, billing and a new shell206 issues: counts.value.issues,
207 pulls: counts.value.pulls,
208 }
209 : null,
Billing accounts, terms and enterprises; g1t is no longer free210 // Where the workspace stands against its usage limit, once billing is on.
211 limit:
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor212 status?.enabled && limit?.ok
Billing accounts, terms and enterprises; g1t is no longer free213 ? {
214 exposureMicros: limit.value.exposureMicros,
215 ceilingMicros: limit.value.ceilingMicros,
216 state: limit.value.state,
217 comped: limit.value.trust === "internal",
218 }
219 : null,
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor220 free: Boolean(status?.free),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look221 // A spend spike or a hold pauses new compute: the shell says so on every page.
222 compute:
223 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
224 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
225 : null,
226 shared,
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all227 inbox: unread,
Chat and workspace agents: channels, DMs and named agents you talk to228 chat: chatUnread,
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)229 agents: teamAgents,
Usage while free is shown at cost; agents get rustfmt and clippy230 // 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 audit231 // Usage at price, the one figure every page shows.
232 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 shell233 };
234}
235
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)236/** Starred and recent conversations Home's sidebar lists. */
237const SHELL_CONVERSATIONS = 8;
238
239/**
240 * What is unread in chat, for the rail, and the starred and latest
241 * conversations, for Home's sidebar; null when chat is slow to answer or
242 * does not.
243 */
Chat and workspace agents: channels, DMs and named agents you talk to244async function chatUnreadFor(slug: string, user: User): Promise<ShellData["chat"]> {
245 const timeout = new Promise<null>((resolve) => setTimeout(() => resolve(null), CHAT_BADGE_WAIT_MS));
246 const read = chat
247 .sidebar(slug, user)
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)248 .then((result) => {
249 if (!result.ok) return null;
250 const entries = result.value.entries;
251 const latest = [...entries].sort((a, b) => (b.channel.last_message_at ?? "").localeCompare(a.channel.last_message_at ?? ""));
252 return {
253 ...unreadTotals(entries),
254 starred: entries.filter((e) => e.starred).slice(0, SHELL_CONVERSATIONS),
255 recent: latest.slice(0, SHELL_CONVERSATIONS),
256 };
257 })
258 .catch(() => null);
259 return Promise.race([read, timeout]);
260}
261
262/** The workspace's agents, as the shell lists them; null when the agents service is slow or down. */
263async function agentsFor(slug: string, user: User): Promise<ShellData["agents"]> {
264 const timeout = new Promise<null>((resolve) => setTimeout(() => resolve(null), CHAT_BADGE_WAIT_MS));
265 const read = workspaceAgents
266 .list(slug, user)
267 .then((result) =>
268 result.ok
269 ? result.value
270 .filter((agent) => !agent.archived_at)
271 .map((agent) => ({
272 id: agent.id,
273 handle: agent.handle,
274 display_name: agent.display_name,
275 avatar: agent.avatar,
276 avatar_seed: agent.avatar_seed,
277 role: agent.role,
278 title: agent.title,
279 team: agent.team,
280 department: agent.department,
281 status: agent.status,
282 builtin: agent.builtin === true,
283 }))
284 : null,
285 )
Chat and workspace agents: channels, DMs and named agents you talk to286 .catch(() => null);
287 return Promise.race([read, timeout]);
288}
289
290/** The longest the rail's Chat badge holds up a page. */
291const CHAT_BADGE_WAIT_MS = 300;
292
Usage, Billing settings and prepaid AI credit; fixes from the UX audit293/**
294 * How long the sidebar's workspace answers are kept: as long as someone's
295 * own changes read fresh anyway (lib/perf.ts `PRIMARY_WINDOW_SECONDS`).
296 */
297const SHELL_TTL_MS = 30_000;
Fast pages, required checks on the branch, self-hosted runners, honest incidents298
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look299/** Most repositories listed under Shared with you. */
300const MAX_SHARED = 20;
301
302/**
303 * Repositories shared with the user in workspaces they do not belong to,
304 * by their grants: only those, never the workspace's other repositories.
305 */
306async function sharedRepos(user: User): Promise<ShellData["shared"]> {
307 const outside = new Set(sharedWorkspaces(user));
308 if (outside.size === 0) return [];
309 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 incidents310 const found = await readableRepos(ids, user);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look311 return found
Fast pages, required checks on the branch, self-hosted runners, honest incidents312 .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 look313 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
314}
315
API and MCP server, Rust identity service, registration, site redesign316function HeaderLink({ to, children }: { to: string; children: React.ReactNode }) {
317 return (
318 <NavLink
319 to={to}
320 className={({ isActive }) =>
321 `rounded-md px-2.5 py-1.5 text-sm transition-colors hover:bg-raised hover:text-fg ${
322 isActive ? "text-fg" : "text-muted"
323 }`
324 }
325 >
326 {children}
327 </NavLink>
328 );
329}
330
Search across all of g1t, Explore, and a command palette331/** What the palette offers someone without the app's sidebar. */
332const PUBLIC_COMMANDS: PaletteCommand[] = [
333 { label: "Explore", hint: "Public projects", to: "/explore", icon: <Compass size={15} /> },
334 { label: "Search g1t", hint: "Repositories, code, issues, people", to: "/search", icon: <Search size={15} /> },
335 { label: "Pricing", to: "/pricing", icon: <CreditCard size={15} /> },
336 { label: "Documentation", to: "https://docs.g1t.sh/", icon: <BookOpen size={15} /> },
337 { label: "Sign in", to: "/login", icon: <LogIn size={15} /> },
338 { label: "Sign up", to: "/register", icon: <Plus size={15} /> },
339];
340
Sign-up buttons say Sign up everywhere; only the sign-up page says registration takes an invite341/** Sign up: the sign-up page says whether it takes an invite. */
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look342function SignUpButton() {
343 const copy = useSignUpCopy();
344 return <ButtonLink to="/register">{copy.primary}</ButtonLink>;
345}
346
Email verification, password reset, and Git for AI scale positioning347function Header({ user }: { user: User | null | undefined }) {
Acceptance checks in sandboxes, line comments and review verdicts348 const submit = useSubmit();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look349 const signUp = useSignUpCopy();
Search across all of g1t, Explore, and a command palette350 const [palette, setPalette] = useState(false);
351 usePaletteShortcut(() => setPalette((open) => !open));
352 const params = useParams();
353 const repo = params.owner && params.repo ? `${params.owner}/${params.repo}` : null;
API and MCP server, Rust identity service, registration, site redesign354 return (
355 <header className="sticky top-0 z-40 border-b border-line bg-surface/85 backdrop-blur">
356 <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 look357 <Link to="/" aria-label="g1t home" className="mr-2 flex">
API and MCP server, Rust identity service, registration, site redesign358 <Logo />
359 </Link>
360 <Form action="/search" role="search" className="relative hidden grow sm:block sm:max-w-xs">
361 <Search
362 size={14}
363 className="pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-faint"
364 />
365 <input
366 name="q"
Agents as a team: lifecycle, merge queue, billing and a new shell367 {...notACredential()}
Search across all of g1t, Explore, and a command palette368 placeholder="Search g1t"
369 aria-label="Search g1t"
370 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 redesign371 />
Usage, Billing settings and prepaid AI credit; fixes from the UX audit372 <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 redesign373 </Form>
Search across all of g1t, Explore, and a command palette374 <button
375 type="button"
376 aria-label="Search g1t"
377 onClick={() => setPalette(true)}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look378 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 palette379 >
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look380 <Search size={18} />
Search across all of g1t, Explore, and a command palette381 </button>
382 <CommandPalette
383 open={palette}
384 onOpenChange={setPalette}
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)385 commands={user ? [{ label: "Home", 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 palette386 repo={repo}
387 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look388 <nav aria-label="Main" className="hidden items-center gap-0.5 sm:flex">
API and MCP server, Rust identity service, registration, site redesign389 <HeaderLink to="/explore">Explore</HeaderLink>
Prices keep themselves current with what g1t pays390 <HeaderLink to="/pricing">Pricing</HeaderLink>
Docs as their own app; shared theme package391 <HeaderLink to="https://docs.g1t.sh/">Docs</HeaderLink>
API and MCP server, Rust identity service, registration, site redesign392 </nav>
393 <div className="ml-auto flex items-center gap-2">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look394 {/* On a phone the links fold into one menu, so the bar fits. */}
395 <DropdownMenu>
396 <DropdownMenuTrigger
397 aria-label="Menu"
Usage, Billing settings and prepaid AI credit; fixes from the UX audit398 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 look399 >
400 <Menu size={18} />
401 </DropdownMenuTrigger>
402 <DropdownMenuContent align="end" className="w-52">
403 <DropdownMenuItem asChild className="min-h-11">
404 <Link to="/explore">
405 <Compass />
406 Explore
407 </Link>
408 </DropdownMenuItem>
409 <DropdownMenuItem asChild className="min-h-11">
410 <Link to="/pricing">
411 <CreditCard />
412 Pricing
413 </Link>
414 </DropdownMenuItem>
415 <DropdownMenuItem asChild className="min-h-11">
416 <Link to="https://docs.g1t.sh/">
417 <BookOpen />
418 Docs
419 </Link>
420 </DropdownMenuItem>
421 {!user && (
422 <>
423 <DropdownMenuSeparator />
424 <DropdownMenuItem asChild className="min-h-11">
425 <Link to="/login">
426 <LogIn />
427 Sign in
428 </Link>
429 </DropdownMenuItem>
430 </>
431 )}
432 </DropdownMenuContent>
433 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign434 {user ? (
435 <>
436 <Link
437 to="/new"
Projects live: fixes from walking them end to end438 aria-label="New project"
API and MCP server, Rust identity service, registration, site redesign439 className="rounded-md border border-line p-1.5 text-muted transition-colors hover:border-line-strong hover:text-fg"
440 >
441 <Plus size={16} />
442 </Link>
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)443 <DropdownMenu>
444 <DropdownMenuTrigger
445 aria-label="Account menu"
Usage, Billing settings and prepaid AI credit; fixes from the UX audit446 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 redesign447 >
Workspace names and icons, and a component kit for every control448 <Avatar name={user.username} image={user.avatar} size={24} />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)449 <ChevronDown size={14} className="text-faint" />
450 </DropdownMenuTrigger>
451 <DropdownMenuContent align="end" className="w-56">
452 <DropdownMenuLabel>
453 Signed in as{" "}
454 <span className="font-mono font-medium text-fg">
455 {user.username}
456 </span>
457 </DropdownMenuLabel>
458 <DropdownMenuSeparator />
Workspaces own repositories459 {(user.workspaces ?? []).map((membership) => (
460 <DropdownMenuItem asChild key={membership.slug}>
461 <Link to={`/${membership.slug}`}>
Workspace names and icons, and a component kit for every control462 <Avatar name={membership.slug} image={membership.avatar} size={16} square />
463 <span className="min-w-0 truncate">{membership.name || membership.slug}</span>
Workspaces own repositories464 </Link>
465 </DropdownMenuItem>
466 ))}
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)467 <DropdownMenuItem asChild>
Workspaces own repositories468 <Link to="/workspaces/new">
469 <Plus />
470 New workspace
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)471 </Link>
472 </DropdownMenuItem>
Workspaces own repositories473 <DropdownMenuSeparator />
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)474 <DropdownMenuItem asChild>
475 <Link to="/">
476 <LayoutDashboard />
477 Mission control
478 </Link>
479 </DropdownMenuItem>
480 <DropdownMenuItem asChild>
481 <Link to="/new">
482 <Plus />
Projects live: fixes from walking them end to end483 New project
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)484 </Link>
485 </DropdownMenuItem>
486 <DropdownMenuSeparator />
487 <DropdownMenuItem asChild>
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas488 <Link to="/settings/profile">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)489 <Settings />
490 Settings
491 </Link>
492 </DropdownMenuItem>
493 <DropdownMenuItem asChild>
Docs as their own app; shared theme package494 <Link to="https://docs.g1t.sh/quickstart/">
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)495 <BookOpen />
496 Documentation
497 </Link>
498 </DropdownMenuItem>
499 <DropdownMenuSeparator />
Acceptance checks in sandboxes, line comments and review verdicts500 {/* Submitted from here: the menu closes on select, and a button
501 that has left the page cannot submit a form. */}
502 <DropdownMenuItem
503 onSelect={() => submit(null, { method: "post", action: "/logout" })}
504 >
505 <LogOut />
506 Sign out
Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed)507 </DropdownMenuItem>
508 </DropdownMenuContent>
509 </DropdownMenu>
API and MCP server, Rust identity service, registration, site redesign510 </>
511 ) : (
512 <>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look513 <span className="hidden sm:contents">
514 <HeaderLink to="/login">Sign in</HeaderLink>
515 </span>
516 <SignUpButton />
API and MCP server, Rust identity service, registration, site redesign517 </>
518 )}
519 </div>
520 </div>
521 </header>
522 );
523}
524
Usage, Billing settings and prepaid AI credit; fixes from the UX audit525/**
526 * The root's data as the browser last had it. When a navigation fails in a
527 * way that takes the root's data with it, the error is still drawn in the
528 * person's own frame, signed in, not the visitor's. Never kept on the
529 * server, where one module serves everyone.
530 */
531let lastRoot: Awaited<ReturnType<typeof loader>> | undefined;
532
Initial g1t: services, event bus, intents and attempts533export 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 address534 const nonce = useNonce();
Initial g1t: services, event bus, intents and attempts535 // Undefined when the root loader itself failed.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit536 const loaded = useRouteLoaderData<typeof loader>("root");
537 const inBrowser = typeof document !== "undefined";
538 if (loaded && inBrowser) lastRoot = loaded;
539 const root = loaded ?? (inBrowser ? lastRoot : undefined);
Agents as a team: lifecycle, merge queue, billing and a new shell540 const user = root?.user;
Merge branch 'worktree-agent-a985c01f43538af01'541 const { pathname, search } = useLocation();
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas542 // Drawn around the error page too: a 404 keeps the sidebar out of a
543 // project or workspace the viewer cannot see.
544 const error = useRouteError();
545 const missing = isRouteErrorResponse(error) && error.status === 404;
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look546 // The billing page shows the full banner itself.
547 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
Fast pages, required checks on the branch, self-hosted runners, honest incidents548 <SpikeBanner
549 compact
550 slug={root.shell.workspace.slug}
551 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
552 owner={root.shell.compute.owner}
553 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look554 );
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)555 // On the few pages an account still confirming its address can open
556 // besides /confirm-email (policies, support, signing in): the way back.
557 const verify = user && awaitsConfirmation(user) && pathname !== "/confirm-email" && (
558 <p
559 role="status"
Agents as a team: lifecycle, merge queue, billing and a new shell560 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"
561 >
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)562 <span>Confirm your email address to start using g1t.</span>
563 <Link to="/confirm-email" className="font-medium underline underline-offset-4">
564 Enter your code
565 </Link>
566 </p>
Agents as a team: lifecycle, merge queue, billing and a new shell567 );
Merge main (membership, two-factor, GitHub repo roles) into tokens568 // A workspace that requires two-factor authentication of someone who
569 // has not turned it on: they keep their place, and cannot use it yet.
570 const held = user?.held && user.held.length > 0 && pathname !== "/settings/two-factor" && <PolicyNotice held={user.held} />;
Merge branch 'worktree-agent-aca4790ea223aa235'571 const leaving = useLeaving();
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look572 const banner =
Merge main (membership, two-factor, GitHub repo roles) into tokens573 paused || verify || held ? (
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look574 <>
575 {paused}
576 {verify}
Merge main (membership, two-factor, GitHub repo roles) into tokens577 {held}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look578 </>
579 ) : null;
Initial g1t: services, event bus, intents and attempts580 return (
581 <html lang="en">
582 <head>
583 <meta charSet="utf-8" />
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)584 <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
Dark gray base with lavender as an accent, and a live outcome view for plans585 <meta name="theme-color" content="#0f0f11" />
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)586 <meta name="apple-mobile-web-app-capable" content="yes" />
587 <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
Put the stylesheet at the top of the head, before React Router's preloads588 {/* The stylesheet before everything React Router preloads, so a slow
589 connection paints sooner (docs/research/css-shipping.md). */}
Give the stylesheet a precedence so React places it before preloads590 <link rel="stylesheet" href={appCss} precedence="default" />
Initial g1t: services, event bus, intents and attempts591 <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 address592 <Links nonce={nonce} />
Initial g1t: services, event bus, intents and attempts593 </head>
API and MCP server, Rust identity service, registration, site redesign594 <body className="flex min-h-screen flex-col">
Usage, Billing settings and prepaid AI credit; fixes from the UX audit595 {/* The first stop for the keyboard: past the menus, to the page. */}
596 <a
597 href="#content"
598 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]"
599 >
600 Skip to content
601 </a>
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)602 {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 quotas603 <AppShell user={user ?? null} shell={root.shell} missing={missing} banner={banner}>
Agents as a team: lifecycle, merge queue, billing and a new shell604 {children}
605 </AppShell>
606 ) : (
607 <>
608 <Progress />
609 <Header user={user} />
610 {banner}
Usage, Billing settings and prepaid AI credit; fixes from the UX audit611 <div id="content" tabIndex={-1} {...leaving} className={`grow outline-none ${leaving.className}`}>
Merge branch 'worktree-agent-aca4790ea223aa235'612 {children}
613 </div>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look614 <SiteFooter user={user} />
Agents as a team: lifecycle, merge queue, billing and a new shell615 </>
Email verification, password reset, and Git for AI scale positioning616 )}
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)617 {/* Live notifications for the signed-in: the feed socket, toasts, the tab's count (components/notifications). */}
618 {user && !awaitsConfirmation(user) && (
619 <LiveNotifications workspace={root?.shell?.workspace?.slug ?? null} inbox={root?.shell?.inbox?.unread ?? null} />
620 )}
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 address621 <ScrollRestoration nonce={nonce} />
622 <Scripts nonce={nonce} />
Initial g1t: services, event bus, intents and attempts623 </body>
624 </html>
625 );
626}
627
628export default function App() {
629 return <Outlet />;
630}
631
632export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
Usage, Billing settings and prepaid AI credit; fixes from the UX audit633 const location = useLocation();
634 const matches = useMatches();
635 // A tab left open across a deploy: load the address again as a whole
636 // page, once, rather than show an error the reload fixes.
637 const reload = reloadFixes({
638 error,
639 status: isRouteErrorResponse(error) ? error.status : undefined,
640 // The first page a tab loads has the key "default"; a client navigation's is its own.
641 clientNavigation: location.key !== "default",
642 caughtByCatchAll: matches.at(-1)?.id === "routes/not-found",
643 });
644 const href = location.pathname + location.search + location.hash;
645 useEffect(() => {
646 if (!reload) return;
647 try {
648 if (sessionStorage.getItem(RELOADED_KEY) === href) return;
649 sessionStorage.setItem(RELOADED_KEY, href);
650 } catch {
651 // No session storage: reload anyway; a document load never asks again.
652 }
653 window.location.assign(href);
654 }, [reload, href]);
655 if (reload) {
656 return (
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in657 <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 audit658 <title>Loading · g1t</title>
659 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 in660 </PageMain>
Usage, Billing settings and prepaid AI credit; fixes from the UX audit661 );
662 }
663
API and MCP server, Rust identity service, registration, site redesign664 let title = "Something went wrong";
665 let details = "An unexpected error occurred. Try again in a moment.";
Initial g1t: services, event bus, intents and attempts666 let stack: string | undefined;
667
668 if (isRouteErrorResponse(error)) {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put669 // The same page for something private and something missing.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit670 if (error.status === 404) {
671 return (
672 <>
673 <title>Not found · g1t</title>
674 <NotFound data={error.data} />
675 </>
676 );
677 }
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put678 if (typeof error.data === "string" && error.data) {
API and MCP server, Rust identity service, registration, site redesign679 details = error.data;
680 }
681 } else if (import.meta.env.DEV && error instanceof Error) {
Initial g1t: services, event bus, intents and attempts682 details = error.message;
683 stack = error.stack;
684 }
685
686 return (
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in687 <PageMain className="mx-auto max-w-xl px-4 py-32 text-center">
API and MCP server, Rust identity service, registration, site redesign688 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
689 <p className="mt-3 text-muted">{details}</p>
690 <div className="mt-8">
691 <ButtonLink to="/" variant="quiet">
692 Back to home
693 </ButtonLink>
694 </div>
Initial g1t: services, event bus, intents and attempts695 {stack && (
API and MCP server, Rust identity service, registration, site redesign696 <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 attempts697 <code>{stack}</code>
698 </pre>
699 )}
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in700 </PageMain>
Initial g1t: services, event bus, intents and attempts701 );
702}

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