Skip to content
207 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.

Merge branch 'worktree-agent-ad7c6d88d93adc817'1import { Package, Plus } from "lucide-react";
2import { Outlet, data, redirect, useLocation, useNavigation } from "react-router";
Agents as a team: lifecycle, merge queue, billing and a new shell3
4import type { Route } from "./+types/layout";
Social cards for every page: og.g1t.sh5import { page } from "../../lib/meta";
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put6import { Avatar, ButtonLink, Pill } from "../../components/ui";
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas7import { WelcomeBanner } from "../../components/welcome";
8import { clearWelcome, welcomes } from "../../lib/invites";
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put9import { notFound } from "../../lib/not-found.server";
Agents and memory, checks and conflicts, profiles, slug renames, custom domains10import { redirectIfRenamed } from "../../lib/renamed.server";
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put11import { rememberWorkspace } from "../../lib/workspace-choice";
Merge branch 'worktree-agent-ad7c6d88d93adc817'12import { workspacePage, workspaceRedirect } from "../../lib/workspace-nav";
13import { WorkspacePageSkeleton } from "../../components/workspace-skeletons";
Agents as a team: lifecycle, merge queue, billing and a new shell14import { identity } from "../../lib/services.server";
15import { getViewer, roleIn } from "../../lib/session.server";
16
Social cards for every page: og.g1t.sh17export function meta({ loaderData, params, ...args }: Route.MetaArgs) {
18 return page(args, { title: `${loaderData?.workspace.name ?? params.owner} · g1t` });
Agents as a team: lifecycle, merge queue, billing and a new shell19}
20
Agents and memory, checks and conflicts, profiles, slug renames, custom domains21export async function loader({ params, context, request }: Route.LoaderArgs) {
Navigation: the workspace's own page with tabs, pins and recent in the sidebar22 const url = new URL(request.url);
Merge branch 'worktree-agent-ad7c6d88d93adc817'23 // `?tab=projects` and the like, from the tabs this page once had: that
24 // page's own address.
Navigation: the workspace's own page with tabs, pins and recent in the sidebar25 const moved = url.search ? workspaceRedirect(url.pathname, url.search) : null;
26 if (moved) throw redirect(moved);
27 const viewer = getViewer(context);
Merge branch 'worktree-agent-ad7c6d88d93adc817'28 const workspace = await identity.getWorkspace(params.owner);
Agents and memory, checks and conflicts, profiles, slug renames, custom domains29 if (!workspace) {
30 // A workspace's old name, after a rename: its pages are at the new one.
31 await redirectIfRenamed(request, params.owner);
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put32 throw notFound("workspace");
Agents and memory, checks and conflicts, profiles, slug renames, custom domains33 }
Navigation: the workspace's own page with tabs, pins and recent in the sidebar34 const role = roleIn(viewer, workspace.slug);
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put35 // Opening one of your workspaces makes it the one you are in.
Merge branch 'worktree-agent-ad7c6d88d93adc817'36 if (!role) return { workspace, role, welcome: false };
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put37 const secure = new URL(request.url).protocol === "https:";
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas38 const headers = new Headers({ "Set-Cookie": rememberWorkspace(workspace.slug, secure) });
39 // Just joined with an invite: welcomed once (routes/invite.tsx).
40 const welcome = welcomes(request.headers.get("cookie"), workspace.slug);
41 if (welcome) headers.append("Set-Cookie", clearWelcome(secure));
Merge branch 'worktree-agent-ad7c6d88d93adc817'42 return data({ workspace, role, welcome }, { headers });
Agents as a team: lifecycle, merge queue, billing and a new shell43}
44
A catalogue of model providers, and settings that feel like settings45/** A workspace's own pages, each with its title and what it is for. */
46const PAGES: Record<string, { title: string; about: string }> = {
Merge branch 'worktree-agent-ad7c6d88d93adc817'47 settings: { title: "General", about: "The workspace's name, icon, address and description, who can create teams, and deleting it." },
A catalogue of model providers, and settings that feel like settings48 people: {
Navigation: the workspace's own page with tabs, pins and recent in the sidebar49 title: "People",
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look50 about: "Members create repositories and have the base permission on each one. Owners are Admins on every repository, and also manage members, tokens, billing and integrations.",
51 },
Navigation: the workspace's own page with tabs, pins and recent in the sidebar52 projects: {
53 title: "Projects",
54 about: "Everything the workspace builds and runs. Search, filter and sort them, and pin the ones you use most to keep them in your sidebar.",
55 },
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar56 teams: {
57 title: "Teams",
58 about: "Groups of members, given roles on repositories together, mentioned as @workspace/team and asked to review together. Child teams inherit their parent's access.",
59 },
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look60 repositories: {
61 title: "Repositories",
62 about: "Every repository in the workspace: who can see it, whether it is archived, and the ones deleted recently.",
A catalogue of model providers, and settings that feel like settings63 },
64 tokens: {
65 title: "Access tokens",
Settings: fine-grained tokens, workspace token Admin, workspace personal access token rules66 about: "Tokens that belong to the workspace, not a person: for CI, integrations and agents that work for the whole team. Each has Write on the workspace's repositories, or Admin when an owner gives it that.",
67 },
68 "personal-access-tokens": {
69 title: "Personal access tokens",
70 about: "Which of your members' own tokens may reach the workspace and for how long, the fine-grained tokens waiting for an owner's approval, and every token that can reach it.",
A catalogue of model providers, and settings that feel like settings71 },
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member72 packages: {
73 title: "Packages",
The Packages page names every registry it has74 about: "What the workspace publishes and installs, beside its code: container images, npm, Composer, Go, Cargo, Maven, NuGet and RubyGems, with the same members, roles and tokens.",
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member75 },
A catalogue of model providers, and settings that feel like settings76 usage: { title: "Usage", about: "What the workspace's agents cost, run by run, by repository, pull request and model." },
Merge the AI Gateway: Anthropic's Messages API on a workspace's tokens77 gateway: {
78 title: "AI Gateway",
79 about: "Your own code's model requests, sent with the workspace's access tokens: each one's model, tokens, cost and status.",
80 },
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look81 billing: { title: "Billing and plans", about: "The g1t plan, the trial, your spend limit and caps, prepaying, and every charge." },
Agents and memory, checks and conflicts, profiles, slug renames, custom domains82 agents: {
83 title: "Agent fleet",
84 about: "Every agent at work across the workspace's projects: what each holds, what it is doing now, and what it has cost.",
85 },
86 memory: {
87 title: "Workspace memory",
88 about: "What holds across all of the workspace's projects, given to every agent in every one of them, beside each project's own memory.",
89 },
Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API90 context: {
91 title: "Context",
92 about: "Everything the workspace builds and runs, and what it knows: a catalog built from its projects, memory with a review queue, one search over all of it, and a scorecard for each project.",
93 },
94 audit: {
95 title: "Audit log",
96 about: "Every action agents took with their run credentials, and every change people and tokens made: by whom, on whose behalf, to what, and whether it was allowed.",
97 },
98 guardrails: {
99 title: "Guardrails",
100 about: "What agents may reach, run, spend and take in every project's sandboxes. Each project can override these under its settings.",
101 },
Webhooks: every event, to your own addresses, signed and retried102 webhooks: {
103 title: "Webhooks",
104 about: "Every repository's events, sent to your own addresses as they happen. A repository can also have its own, under its settings.",
105 },
GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs106 secrets: {
107 title: "Secrets and variables",
Secrets and variables: one list, rows per environment, for workflows and deployments108 about: "Shared with every repository, or the ones you link: read by workflows, deployments, or both. A repository's own row of the same key wins.",
GitHub Actions on g1t, part three: .g1t/workflows, the pages, the docs109 },
Fast pages, required checks on the branch, self-hosted runners, honest incidents110 runners: {
111 title: "Self-hosted runners",
112 about: "Your own machines, which run workflow jobs, and if you choose agents' work, for free. They connect out to g1t; nothing reaches in.",
113 },
Security matches the workspace's other pages and leaves out deleted repositories; every section has a name in the trail114 security: {
115 title: "Security",
116 about: "Open alerts in every project: secrets found in pushes and history, and vulnerable dependencies. Each project's Security page has the details and the security update g1t opened for each.",
117 },
A catalogue of model providers, and settings that feel like settings118 integrations: {
119 title: "Integrations",
120 about: "Model providers, alerts and trackers. Secrets are sealed when saved, and agents never see them.",
121 },
122};
123
Merge branch 'worktree-agent-ad7c6d88d93adc817'124/** A workspace page's heading: its title and what it is for. */
125function PageHeader({ title, about }: { title: string; about: string }) {
Navigation: the workspace's own page with tabs, pins and recent in the sidebar126 return (
Merge branch 'worktree-agent-ad7c6d88d93adc817'127 <header className="mb-8 border-b border-line pb-6">
128 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
129 <p className="mt-1.5 text-sm text-muted">{about}</p>
130 </header>
Navigation: the workspace's own page with tabs, pins and recent in the sidebar131 );
132}
133
Agents as a team: lifecycle, merge queue, billing and a new shell134export default function WorkspaceLayout({ loaderData }: Route.ComponentProps) {
Merge branch 'worktree-agent-ad7c6d88d93adc817'135 const { workspace, role, welcome } = loaderData;
Navigation: the workspace's own page with tabs, pins and recent in the sidebar136 const { pathname } = useLocation();
137 const going = useNavigation().location;
Merge branch 'worktree-agent-ad7c6d88d93adc817'138 // The workspace's own page is its overview. Its other pages are found
139 // from the sidebar, which lights the one you are on, and the top bar's
140 // trail leads back here; each has a heading of its own.
141 const here = workspacePage(pathname, workspace.slug);
142 // On the way to another of its pages: that page's heading and shape
143 // until it arrives.
144 const next = going && going.pathname !== pathname ? workspacePage(going.pathname, workspace.slug) : null;
145 const shown = next ?? here;
Navigation: the workspace's own page with tabs, pins and recent in the sidebar146 const parts = (pathname.split("/-/")[1] ?? "").split("/").filter(Boolean);
Merge branch 'worktree-agent-ad7c6d88d93adc817'147 if (shown !== "overview") {
148 const key = shown ?? parts[0] ?? "";
149 const heading = PAGES[key];
150 // A page within one (a single package or team) and a page that is
151 // coming (Insights) have headings of their own.
152 const titled = heading && (shown != null || parts.length === 1);
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member153 return (
154 <div className="mx-auto max-w-5xl px-4 py-10 sm:px-8">
Merge branch 'worktree-agent-ad7c6d88d93adc817'155 {titled && <PageHeader title={heading.title} about={heading.about} />}
156 {next ? <WorkspacePageSkeleton page={next} /> : <Outlet />}
A catalogue of model providers, and settings that feel like settings157 </div>
158 );
159 }
Agents as a team: lifecycle, merge queue, billing and a new shell160 return (
161 <>
Merge branch 'worktree-agent-ad7c6d88d93adc817'162 {/* The workspace's own header band, above its overview. */}
Agents as a team: lifecycle, merge queue, billing and a new shell163 <div className="border-b border-line bg-surface/60">
Merge branch 'worktree-agent-ad7c6d88d93adc817'164 <div className="mx-auto max-w-6xl px-4 py-8">
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas165 {welcome && (
166 <div className="mb-6">
167 <WelcomeBanner title={`You're in ${workspace.name}`}>
168 You joined as a {role}. Its projects, issues and agents are all here.
169 </WelcomeBanner>
170 </div>
171 )}
Agents as a team: lifecycle, merge queue, billing and a new shell172 <div className="flex flex-wrap items-center gap-4">
Workspace names and icons, and a component kit for every control173 <Avatar name={workspace.slug} image={workspace.avatar} size={52} square />
Agents as a team: lifecycle, merge queue, billing and a new shell174 <div className="min-w-0 grow">
175 <div className="flex flex-wrap items-center gap-2.5">
176 <h1 className="truncate text-2xl font-semibold tracking-tight">
177 {workspace.name}
178 </h1>
179 {role && <Pill>{role}</Pill>}
180 </div>
181 <p className="font-mono text-sm text-muted">g1t.sh/{workspace.slug}</p>
182 </div>
Merge branch 'worktree-agent-ad7c6d88d93adc817'183 {role ? (
Agents as a team: lifecycle, merge queue, billing and a new shell184 <ButtonLink to={`/new?workspace=${workspace.slug}`}>
185 <Plus size={15} />
Projects live: fixes from walking them end to end186 New project
Agents as a team: lifecycle, merge queue, billing and a new shell187 </ButtonLink>
Merge branch 'worktree-agent-ad7c6d88d93adc817'188 ) : (
189 // A visitor's sidebar is not this workspace's: its packages
190 // are a link here, as its projects are below.
191 <ButtonLink to={`/${workspace.slug}/-/packages`} variant="quiet" prefetch="intent">
192 <Package size={15} />
193 Packages
194 </ButtonLink>
Agents as a team: lifecycle, merge queue, billing and a new shell195 )}
196 </div>
197 {workspace.description && (
198 <p className="mt-4 max-w-2xl text-sm text-muted">{workspace.description}</p>
199 )}
200 </div>
201 </div>
202 <div className="mx-auto max-w-6xl px-4 py-8">
Merge branch 'worktree-agent-ad7c6d88d93adc817'203 {next ? <WorkspacePageSkeleton page="overview" /> : <Outlet />}
Agents as a team: lifecycle, merge queue, billing and a new shell204 </div>
205 </>
206 );
207}

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