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 attempts | 1 | import { |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 2 | BookOpen, |
| 3 | ChevronDown, | |
| Search across all of g1t, Explore, and a command palette | 4 | 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 palette | 7 | 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 look | 9 | Menu, |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 10 | Plus, |
| 11 | Search, | |
| 12 | Settings, | |
| 13 | } from "lucide-react"; | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 14 | import { useState } from "react"; |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 15 | import { |
| Initial g1t: services, event bus, intents and attempts | 16 | Form, |
| 17 | isRouteErrorResponse, | |
| 18 | Link, | |
| 19 | Links, | |
| 20 | Meta, | |
| API and MCP server, Rust identity service, registration, site redesign | 21 | NavLink, |
| Initial g1t: services, event bus, intents and attempts | 22 | Outlet, |
| 23 | Scripts, | |
| 24 | ScrollRestoration, | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 25 | type ShouldRevalidateFunctionArgs, |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 26 | useLocation, |
| Search across all of g1t, Explore, and a command palette | 27 | useParams, |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 28 | useRouteError, |
| Initial g1t: services, event bus, intents and attempts | 29 | useRouteLoaderData, |
| Acceptance checks in sandboxes, line comments and review verdicts | 30 | useSubmit, |
| Initial g1t: services, event bus, intents and attempts | 31 | } from "react-router"; |
| 32 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 33 | import { type User, hasAccessIn, sharedWorkspaces } from "@g1t/contracts"; |
| Email verification, password reset, and Git for AI scale positioning | 34 | |
| Initial g1t: services, event bus, intents and attempts | 35 | import type { Route } from "./+types/root"; |
| Load the stylesheet first; plain legal contact details | 36 | import appCss from "./app.css?url"; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 37 | import displayFont from "@g1t/theme/fonts/bricolage-grotesque-latin.woff2?url"; |
| 38 | import sansFont from "@g1t/theme/fonts/hanken-grotesk-latin.woff2?url"; | |
| Initial g1t: services, event bus, intents and attempts | 39 | import { Logo } from "./components/logo"; |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 40 | import { Avatar, ButtonLink, notACredential } from "./components/ui"; |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 41 | import { |
| 42 | DropdownMenu, | |
| 43 | DropdownMenuContent, | |
| 44 | DropdownMenuItem, | |
| 45 | DropdownMenuLabel, | |
| 46 | DropdownMenuSeparator, | |
| 47 | DropdownMenuTrigger, | |
| 48 | } from "./components/ui/dropdown-menu"; | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 49 | import { AppShell, Progress, type ShellData } from "./components/shell"; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 50 | import { SiteFooter } from "./components/footer"; |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 51 | import { SpikeBanner } from "./components/spike-banner"; |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 52 | import { readCookie } from "./lib/mission"; |
| 53 | import { WORKSPACE_COOKIE, workspaceFor } from "./lib/workspace-choice"; | |
| 54 | import { NotFound } from "./components/not-found"; | |
| 55 | import { usesAppShell } from "./lib/chrome"; | |
| Search across all of g1t, Explore, and a command palette | 56 | import { CommandPalette, type PaletteCommand, usePaletteShortcut } from "./components/command-palette"; |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 57 | import { billing, projects } from "./lib/services.server"; |
| 58 | import { countsFor, readableRepos } from "./lib/access.server"; | |
| 59 | import { shortCache } from "./lib/cache.server"; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 60 | import { getViewer, viewerMiddleware } from "./lib/session.server"; |
| 61 | import { registrationMode } from "./lib/registration.server"; | |
| 62 | import { useSignUpCopy } from "./lib/registration"; | |
| 63 | ||
| Initial g1t: services, event bus, intents and attempts | 64 | |
| 65 | export const links: Route.LinksFunction = () => [ | |
| The fleet: g1t's new mark | 66 | { rel: "icon", href: "/favicon.ico", sizes: "32x32" }, |
| Initial g1t: services, event bus, intents and attempts | 67 | { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" }, |
| The fleet: g1t's new mark | 68 | { rel: "icon", type: "image/png", sizes: "192x192", href: "/icon-192.png" }, |
| 69 | { rel: "apple-touch-icon", href: "/apple-touch-icon.png" }, | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 70 | // The text and headline faces are wanted on every page, so they start |
| 71 | // loading with the stylesheet; mono waits until something uses it. | |
| 72 | { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, | |
| 73 | { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, | |
| Initial g1t: services, event bus, intents and attempts | 74 | ]; |
| 75 | ||
| 76 | export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware]; | |
| 77 | ||
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 78 | export async function loader({ context, params, request }: Route.LoaderArgs) { |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 79 | const user = getViewer(context); |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 80 | const chosen = readCookie(request.headers.get("cookie"), WORKSPACE_COOKIE); |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 81 | // What sign-up buttons say: Request access while g1t is invite-only. |
| 82 | const [shell, mode] = await Promise.all([ | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 83 | user ? shellFor(user, params, chosen, context) : visitorShell(params, context), |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 84 | user ? Promise.resolve(null) : registrationMode(), |
| 85 | ]); | |
| 86 | return { user, shell, inviteOnly: mode !== "open" }; | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 87 | } |
| 88 | ||
| 89 | /** | |
| 90 | * The sidebar for someone not signed in: nothing of their own, only the | |
| 91 | * open counts of the project being looked at. One call, and only in a | |
| 92 | * project; it answers the same for a private project as a missing one. | |
| 93 | */ | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 94 | async 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 put | 95 | const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null; |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 96 | 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 put | 97 | return { |
| 98 | workspace: null, | |
| 99 | repos: [], | |
| 100 | repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null, | |
| 101 | limit: null, | |
| 102 | monthUsageMicros: null, | |
| 103 | }; | |
| Initial g1t: services, event bus, intents and attempts | 104 | } |
| 105 | ||
| Agents as a team: lifecycle, merge queue, billing and a new shell | 106 | /** |
| 107 | * The sidebar only changes with the workspace or repository being looked | |
| 108 | * at, or after something was submitted: not on every page within them. | |
| 109 | */ | |
| 110 | export function shouldRevalidate({ | |
| 111 | currentParams, | |
| 112 | nextParams, | |
| 113 | formMethod, | |
| 114 | defaultShouldRevalidate, | |
| 115 | }: ShouldRevalidateFunctionArgs) { | |
| 116 | if (formMethod && formMethod !== "GET") return defaultShouldRevalidate; | |
| 117 | return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo; | |
| 118 | } | |
| 119 | ||
| 120 | /** | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 121 | * The sidebar: the workspace you chose (lib/workspace-choice.ts), or the |
| 122 | * one whose own pages these are; its projects; and the repository being | |
| 123 | * looked at. A project in another workspace does not switch it. | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 124 | */ |
| 125 | async function shellFor( | |
| 126 | user: User, | |
| 127 | params: { owner?: string; repo?: string }, | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 128 | chosen: string | null, |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 129 | context: Route.LoaderArgs["context"], |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 130 | ): Promise<ShellData> { |
| 131 | const memberships = user.workspaces ?? []; | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 132 | const workspace = workspaceFor(memberships, chosen, params); |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 133 | 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 request | 134 | const now = new Date(); |
| 135 | const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString(); | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 136 | // What the sidebar shows of the workspace changes rarely: kept for a few |
| 137 | // seconds per person and workspace, except just after they changed | |
| 138 | // something (lib/cache.server.ts). | |
| 139 | const kept = <T,>(what: string, load: () => Promise<T>) => | |
| 140 | workspace ? shortCache(`shell:${what}:${user.id}:${workspace.slug}`, SHELL_TTL_MS, load) : Promise.resolve(null); | |
| 141 | const [listed, counts, account, usage, limit, entitlements, shared] = await Promise.all([ | |
| 142 | kept("projects", () => projects.list(workspace!.slug, user)), | |
| 143 | path ? countsFor(context, params) : Promise.resolve(null), | |
| 144 | kept("account", () => billing.account(workspace!.slug, user)), | |
| 145 | kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)), | |
| 146 | kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null), | |
| 147 | kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null), | |
| 148 | sharedRepos(user), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 149 | ]); |
| 150 | return { | |
| 151 | workspace, | |
| Projects: what a workspace builds and runs, first on every page | 152 | // Projects are what the sidebar lists: what the workspace builds and runs. |
| 153 | repos: listed?.ok | |
| 154 | ? listed.value.map((project) => ({ | |
| 155 | namespace: project.workspace, | |
| 156 | name: project.slug, | |
| 157 | title: project.name, | |
| 158 | isPrivate: project.private, | |
| 159 | })) | |
| 160 | : [], | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 161 | repo: |
| 162 | path && counts?.ok | |
| 163 | ? { | |
| 164 | ...path, | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 165 | // Until the repository's own page says what their role is. |
| 166 | member: hasAccessIn(user, path.namespace), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 167 | issues: counts.value.issues, |
| 168 | pulls: counts.value.pulls, | |
| 169 | } | |
| 170 | : null, | |
| Billing accounts, terms and enterprises; g1t is no longer free | 171 | // Where the workspace stands against its usage limit, once billing is on. |
| 172 | limit: | |
| 173 | account?.ok && account.value.status.enabled && limit?.ok | |
| 174 | ? { | |
| 175 | exposureMicros: limit.value.exposureMicros, | |
| 176 | ceilingMicros: limit.value.ceilingMicros, | |
| 177 | state: limit.value.state, | |
| 178 | comped: limit.value.trust === "internal", | |
| 179 | } | |
| 180 | : null, | |
| Free while g1t is being built out; agents can check out their own forks | 181 | free: account?.ok ? Boolean(account.value.status.free) : false, |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 182 | // A spend spike or a hold pauses new compute: the shell says so on every page. |
| 183 | compute: | |
| 184 | workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open") | |
| 185 | ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" } | |
| 186 | : null, | |
| 187 | shared, | |
| Usage while free is shown at cost; agents get rustfmt and clippy | 188 | // While g1t is free every charge is zero, so usage is shown at cost. |
| 189 | monthUsageMicros: usage?.ok ? (usage.value.free ? usage.value.usedMicros : usage.value.spentMicros) : null, | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 190 | }; |
| 191 | } | |
| 192 | ||
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 193 | /** How long one isolate keeps the sidebar's workspace answers. */ |
| 194 | const SHELL_TTL_MS = 15_000; | |
| 195 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 196 | /** Most repositories listed under Shared with you. */ |
| 197 | const MAX_SHARED = 20; | |
| 198 | ||
| 199 | /** | |
| 200 | * Repositories shared with the user in workspaces they do not belong to, | |
| 201 | * by their grants: only those, never the workspace's other repositories. | |
| 202 | */ | |
| 203 | async function sharedRepos(user: User): Promise<ShellData["shared"]> { | |
| 204 | const outside = new Set(sharedWorkspaces(user)); | |
| 205 | if (outside.size === 0) return []; | |
| 206 | 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 incidents | 207 | const found = await readableRepos(ids, user); |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 208 | return found |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 209 | .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 look | 210 | .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`)); |
| 211 | } | |
| 212 | ||
| API and MCP server, Rust identity service, registration, site redesign | 213 | function HeaderLink({ to, children }: { to: string; children: React.ReactNode }) { |
| 214 | return ( | |
| 215 | <NavLink | |
| 216 | to={to} | |
| 217 | className={({ isActive }) => | |
| 218 | `rounded-md px-2.5 py-1.5 text-sm transition-colors hover:bg-raised hover:text-fg ${ | |
| 219 | isActive ? "text-fg" : "text-muted" | |
| 220 | }` | |
| 221 | } | |
| 222 | > | |
| 223 | {children} | |
| 224 | </NavLink> | |
| 225 | ); | |
| 226 | } | |
| 227 | ||
| Search across all of g1t, Explore, and a command palette | 228 | /** What the palette offers someone without the app's sidebar. */ |
| 229 | const PUBLIC_COMMANDS: PaletteCommand[] = [ | |
| 230 | { label: "Explore", hint: "Public projects", to: "/explore", icon: <Compass size={15} /> }, | |
| 231 | { label: "Search g1t", hint: "Repositories, code, issues, people", to: "/search", icon: <Search size={15} /> }, | |
| 232 | { label: "Pricing", to: "/pricing", icon: <CreditCard size={15} /> }, | |
| 233 | { label: "Documentation", to: "https://docs.g1t.sh/", icon: <BookOpen size={15} /> }, | |
| 234 | { label: "Sign in", to: "/login", icon: <LogIn size={15} /> }, | |
| 235 | { label: "Sign up", to: "/register", icon: <Plus size={15} /> }, | |
| 236 | ]; | |
| 237 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 238 | /** Sign up, or Request access while g1t is invite-only. */ |
| 239 | function SignUpButton() { | |
| 240 | const copy = useSignUpCopy(); | |
| 241 | return <ButtonLink to="/register">{copy.primary}</ButtonLink>; | |
| 242 | } | |
| 243 | ||
| Email verification, password reset, and Git for AI scale positioning | 244 | function Header({ user }: { user: User | null | undefined }) { |
| Acceptance checks in sandboxes, line comments and review verdicts | 245 | const submit = useSubmit(); |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 246 | const signUp = useSignUpCopy(); |
| Search across all of g1t, Explore, and a command palette | 247 | const [palette, setPalette] = useState(false); |
| 248 | usePaletteShortcut(() => setPalette((open) => !open)); | |
| 249 | const params = useParams(); | |
| 250 | const repo = params.owner && params.repo ? `${params.owner}/${params.repo}` : null; | |
| API and MCP server, Rust identity service, registration, site redesign | 251 | return ( |
| 252 | <header className="sticky top-0 z-40 border-b border-line bg-surface/85 backdrop-blur"> | |
| 253 | <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 look | 254 | <Link to="/" aria-label="g1t home" className="mr-2 flex"> |
| API and MCP server, Rust identity service, registration, site redesign | 255 | <Logo /> |
| 256 | </Link> | |
| 257 | <Form action="/search" role="search" className="relative hidden grow sm:block sm:max-w-xs"> | |
| 258 | <Search | |
| 259 | size={14} | |
| 260 | className="pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-faint" | |
| 261 | /> | |
| 262 | <input | |
| 263 | name="q" | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 264 | {...notACredential()} |
| Search across all of g1t, Explore, and a command palette | 265 | placeholder="Search g1t" |
| 266 | aria-label="Search g1t" | |
| 267 | 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 redesign | 268 | /> |
| Search across all of g1t, Explore, and a command palette | 269 | <kbd className="pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 rounded bg-raised px-1.5 font-mono text-[0.625rem] text-muted ring-1 ring-line"> |
| 270 | ⌘K | |
| 271 | </kbd> | |
| API and MCP server, Rust identity service, registration, site redesign | 272 | </Form> |
| Search across all of g1t, Explore, and a command palette | 273 | <button |
| 274 | type="button" | |
| 275 | aria-label="Search g1t" | |
| 276 | onClick={() => setPalette(true)} | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 277 | 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 palette | 278 | > |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 279 | <Search size={18} /> |
| Search across all of g1t, Explore, and a command palette | 280 | </button> |
| 281 | <CommandPalette | |
| 282 | open={palette} | |
| 283 | onOpenChange={setPalette} | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 284 | 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 palette | 285 | repo={repo} |
| 286 | /> | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 287 | <nav aria-label="Main" className="hidden items-center gap-0.5 sm:flex"> |
| API and MCP server, Rust identity service, registration, site redesign | 288 | <HeaderLink to="/explore">Explore</HeaderLink> |
| Prices keep themselves current with what g1t pays | 289 | <HeaderLink to="/pricing">Pricing</HeaderLink> |
| Docs as their own app; shared theme package | 290 | <HeaderLink to="https://docs.g1t.sh/">Docs</HeaderLink> |
| API and MCP server, Rust identity service, registration, site redesign | 291 | </nav> |
| 292 | <div className="ml-auto flex items-center gap-2"> | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 293 | {/* On a phone the links fold into one menu, so the bar fits. */} |
| 294 | <DropdownMenu> | |
| 295 | <DropdownMenuTrigger | |
| 296 | aria-label="Menu" | |
| 297 | className="flex size-10 items-center justify-center rounded-md text-muted outline-none transition-colors hover:bg-raised hover:text-fg data-[state=open]:bg-raised data-[state=open]:text-fg sm:hidden" | |
| 298 | > | |
| 299 | <Menu size={18} /> | |
| 300 | </DropdownMenuTrigger> | |
| 301 | <DropdownMenuContent align="end" className="w-52"> | |
| 302 | <DropdownMenuItem asChild className="min-h-11"> | |
| 303 | <Link to="/explore"> | |
| 304 | <Compass /> | |
| 305 | Explore | |
| 306 | </Link> | |
| 307 | </DropdownMenuItem> | |
| 308 | <DropdownMenuItem asChild className="min-h-11"> | |
| 309 | <Link to="/pricing"> | |
| 310 | <CreditCard /> | |
| 311 | Pricing | |
| 312 | </Link> | |
| 313 | </DropdownMenuItem> | |
| 314 | <DropdownMenuItem asChild className="min-h-11"> | |
| 315 | <Link to="https://docs.g1t.sh/"> | |
| 316 | <BookOpen /> | |
| 317 | Docs | |
| 318 | </Link> | |
| 319 | </DropdownMenuItem> | |
| 320 | {!user && ( | |
| 321 | <> | |
| 322 | <DropdownMenuSeparator /> | |
| 323 | <DropdownMenuItem asChild className="min-h-11"> | |
| 324 | <Link to="/login"> | |
| 325 | <LogIn /> | |
| 326 | Sign in | |
| 327 | </Link> | |
| 328 | </DropdownMenuItem> | |
| 329 | </> | |
| 330 | )} | |
| 331 | </DropdownMenuContent> | |
| 332 | </DropdownMenu> | |
| API and MCP server, Rust identity service, registration, site redesign | 333 | {user ? ( |
| 334 | <> | |
| 335 | <Link | |
| 336 | to="/new" | |
| Projects live: fixes from walking them end to end | 337 | aria-label="New project" |
| API and MCP server, Rust identity service, registration, site redesign | 338 | className="rounded-md border border-line p-1.5 text-muted transition-colors hover:border-line-strong hover:text-fg" |
| 339 | > | |
| 340 | <Plus size={16} /> | |
| 341 | </Link> | |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 342 | <DropdownMenu> |
| 343 | <DropdownMenuTrigger | |
| 344 | aria-label="Account menu" | |
| 345 | className="flex items-center gap-1.5 rounded-md p-1 outline-none transition-colors hover:bg-raised data-[state=open]:bg-raised" | |
| API and MCP server, Rust identity service, registration, site redesign | 346 | > |
| Workspace names and icons, and a component kit for every control | 347 | <Avatar name={user.username} image={user.avatar} size={24} /> |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 348 | <ChevronDown size={14} className="text-faint" /> |
| 349 | </DropdownMenuTrigger> | |
| 350 | <DropdownMenuContent align="end" className="w-56"> | |
| 351 | <DropdownMenuLabel> | |
| 352 | Signed in as{" "} | |
| 353 | <span className="font-mono font-medium text-fg"> | |
| 354 | {user.username} | |
| 355 | </span> | |
| 356 | </DropdownMenuLabel> | |
| 357 | <DropdownMenuSeparator /> | |
| Workspaces own repositories | 358 | {(user.workspaces ?? []).map((membership) => ( |
| 359 | <DropdownMenuItem asChild key={membership.slug}> | |
| 360 | <Link to={`/${membership.slug}`}> | |
| Workspace names and icons, and a component kit for every control | 361 | <Avatar name={membership.slug} image={membership.avatar} size={16} square /> |
| 362 | <span className="min-w-0 truncate">{membership.name || membership.slug}</span> | |
| Workspaces own repositories | 363 | </Link> |
| 364 | </DropdownMenuItem> | |
| 365 | ))} | |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 366 | <DropdownMenuItem asChild> |
| Workspaces own repositories | 367 | <Link to="/workspaces/new"> |
| 368 | <Plus /> | |
| 369 | New workspace | |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 370 | </Link> |
| 371 | </DropdownMenuItem> | |
| Workspaces own repositories | 372 | <DropdownMenuSeparator /> |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 373 | <DropdownMenuItem asChild> |
| 374 | <Link to="/"> | |
| 375 | <LayoutDashboard /> | |
| 376 | Mission control | |
| 377 | </Link> | |
| 378 | </DropdownMenuItem> | |
| 379 | <DropdownMenuItem asChild> | |
| 380 | <Link to="/new"> | |
| 381 | <Plus /> | |
| Projects live: fixes from walking them end to end | 382 | New project |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 383 | </Link> |
| 384 | </DropdownMenuItem> | |
| 385 | <DropdownMenuSeparator /> | |
| 386 | <DropdownMenuItem asChild> | |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 387 | <Link to="/settings/profile"> |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 388 | <Settings /> |
| 389 | Settings | |
| 390 | </Link> | |
| 391 | </DropdownMenuItem> | |
| 392 | <DropdownMenuItem asChild> | |
| Docs as their own app; shared theme package | 393 | <Link to="https://docs.g1t.sh/quickstart/"> |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 394 | <BookOpen /> |
| 395 | Documentation | |
| 396 | </Link> | |
| 397 | </DropdownMenuItem> | |
| 398 | <DropdownMenuSeparator /> | |
| Acceptance checks in sandboxes, line comments and review verdicts | 399 | {/* Submitted from here: the menu closes on select, and a button |
| 400 | that has left the page cannot submit a form. */} | |
| 401 | <DropdownMenuItem | |
| 402 | onSelect={() => submit(null, { method: "post", action: "/logout" })} | |
| 403 | > | |
| 404 | <LogOut /> | |
| 405 | Sign out | |
| Account dropdown, llms.txt onboarding, hosted agent runner (not yet deployed) | 406 | </DropdownMenuItem> |
| 407 | </DropdownMenuContent> | |
| 408 | </DropdownMenu> | |
| API and MCP server, Rust identity service, registration, site redesign | 409 | </> |
| 410 | ) : ( | |
| 411 | <> | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 412 | <span className="hidden sm:contents"> |
| 413 | <HeaderLink to="/login">Sign in</HeaderLink> | |
| 414 | </span> | |
| 415 | <SignUpButton /> | |
| API and MCP server, Rust identity service, registration, site redesign | 416 | </> |
| 417 | )} | |
| 418 | </div> | |
| 419 | </div> | |
| 420 | </header> | |
| 421 | ); | |
| 422 | } | |
| 423 | ||
| Initial g1t: services, event bus, intents and attempts | 424 | export function Layout({ children }: { children: React.ReactNode }) { |
| 425 | // Undefined when the root loader itself failed. | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 426 | const root = useRouteLoaderData<typeof loader>("root"); |
| 427 | const user = root?.user; | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 428 | const { pathname } = useLocation(); |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 429 | // Drawn around the error page too: a 404 keeps the sidebar out of a |
| 430 | // project or workspace the viewer cannot see. | |
| 431 | const error = useRouteError(); | |
| 432 | const missing = isRouteErrorResponse(error) && error.status === 404; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 433 | // The billing page shows the full banner itself. |
| 434 | const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && ( | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 435 | <SpikeBanner |
| 436 | compact | |
| 437 | slug={root.shell.workspace.slug} | |
| 438 | entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }} | |
| 439 | owner={root.shell.compute.owner} | |
| 440 | /> | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 441 | ); |
| 442 | const verify = user && !user.verified && ( | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 443 | <Form |
| 444 | method="post" | |
| 445 | action="/verify" | |
| 446 | 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" | |
| 447 | > | |
| 448 | <span> | |
| 449 | Confirm your email address to create repositories and push. We | |
| 450 | sent you a link. | |
| 451 | </span> | |
| 452 | <button type="submit" className="font-medium underline underline-offset-4"> | |
| 453 | Send it again | |
| 454 | </button> | |
| 455 | </Form> | |
| 456 | ); | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 457 | const banner = |
| 458 | paused || verify ? ( | |
| 459 | <> | |
| 460 | {paused} | |
| 461 | {verify} | |
| 462 | </> | |
| 463 | ) : null; | |
| Initial g1t: services, event bus, intents and attempts | 464 | return ( |
| 465 | <html lang="en"> | |
| 466 | <head> | |
| 467 | <meta charSet="utf-8" /> | |
| 468 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| Dark gray base with lavender as an accent, and a live outcome view for plans | 469 | <meta name="theme-color" content="#0f0f11" /> |
| Put the stylesheet at the top of the head, before React Router's preloads | 470 | {/* The stylesheet before everything React Router preloads, so a slow |
| 471 | connection paints sooner (docs/research/css-shipping.md). */} | |
| Give the stylesheet a precedence so React places it before preloads | 472 | <link rel="stylesheet" href={appCss} precedence="default" /> |
| Initial g1t: services, event bus, intents and attempts | 473 | <Meta /> |
| 474 | <Links /> | |
| 475 | </head> | |
| API and MCP server, Rust identity service, registration, site redesign | 476 | <body className="flex min-h-screen flex-col"> |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 477 | {root?.shell && usesAppShell(pathname, user != null) ? ( |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 478 | <AppShell user={user ?? null} shell={root.shell} missing={missing} banner={banner}> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 479 | {children} |
| 480 | </AppShell> | |
| 481 | ) : ( | |
| 482 | <> | |
| 483 | <Progress /> | |
| 484 | <Header user={user} /> | |
| 485 | {banner} | |
| 486 | <div className="grow">{children}</div> | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 487 | <SiteFooter user={user} /> |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 488 | </> |
| Email verification, password reset, and Git for AI scale positioning | 489 | )} |
| Initial g1t: services, event bus, intents and attempts | 490 | <ScrollRestoration /> |
| 491 | <Scripts /> | |
| 492 | </body> | |
| 493 | </html> | |
| 494 | ); | |
| 495 | } | |
| 496 | ||
| 497 | export default function App() { | |
| 498 | return <Outlet />; | |
| 499 | } | |
| 500 | ||
| 501 | export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { | |
| API and MCP server, Rust identity service, registration, site redesign | 502 | let title = "Something went wrong"; |
| 503 | let details = "An unexpected error occurred. Try again in a moment."; | |
| Initial g1t: services, event bus, intents and attempts | 504 | let stack: string | undefined; |
| 505 | ||
| 506 | if (isRouteErrorResponse(error)) { | |
| Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put | 507 | // The same page for something private and something missing. |
| 508 | if (error.status === 404) return <NotFound data={error.data} />; | |
| 509 | if (typeof error.data === "string" && error.data) { | |
| API and MCP server, Rust identity service, registration, site redesign | 510 | details = error.data; |
| 511 | } | |
| 512 | } else if (import.meta.env.DEV && error instanceof Error) { | |
| Initial g1t: services, event bus, intents and attempts | 513 | details = error.message; |
| 514 | stack = error.stack; | |
| 515 | } | |
| 516 | ||
| 517 | return ( | |
| API and MCP server, Rust identity service, registration, site redesign | 518 | <main className="mx-auto max-w-xl px-4 py-32 text-center"> |
| 519 | <h1 className="text-2xl font-semibold tracking-tight">{title}</h1> | |
| 520 | <p className="mt-3 text-muted">{details}</p> | |
| 521 | <div className="mt-8"> | |
| 522 | <ButtonLink to="/" variant="quiet"> | |
| 523 | Back to home | |
| 524 | </ButtonLink> | |
| 525 | </div> | |
| Initial g1t: services, event bus, intents and attempts | 526 | {stack && ( |
| API and MCP server, Rust identity service, registration, site redesign | 527 | <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 attempts | 528 | <code>{stack}</code> |
| 529 | </pre> | |
| 530 | )} | |
| 531 | </main> | |
| 532 | ); | |
| 533 | } |