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

Navigation: the workspace's own page with tabs, pins and recent in the sidebar1/**
Merge branch 'worktree-agent-ad7c6d88d93adc817'2 * A workspace's pages and where the sidebar finds them. `g1t.sh/<workspace>`
3 * is the workspace's own page, its header and overview; Projects, Packages,
4 * Teams, People, Insights and Settings are pages of their own under `-/`,
5 * each reached from the sidebar and each with its own heading. The sidebar
6 * is always the current workspace's.
Navigation: the workspace's own page with tabs, pins and recent in the sidebar7 */
8
Merge branch 'worktree-agent-ad7c6d88d93adc817'9/** The workspace's pages a person moves between, and which the sidebar lists. */
10export type WorkspacePageKey = "overview" | "projects" | "packages" | "teams" | "people" | "insights";
Navigation: the workspace's own page with tabs, pins and recent in the sidebar11
Merge branch 'worktree-agent-ad7c6d88d93adc817'12/** Those pages under `-/`: the overview is the workspace's own address. */
13export const WORKSPACE_PAGES = ["projects", "packages", "teams", "people", "insights"] as const;
Navigation: the workspace's own page with tabs, pins and recent in the sidebar14
Merge branch 'worktree-agent-ad7c6d88d93adc817'15/**
16 * Which of those pages a path is, under `/<workspace>`: null for the
Agents mode: an overview of every agent's work and spend, and each agent's sessions, memory, routines, spend, activity and versions17 * workspace's other pages (settings, Usage and the rest), for
Merge branch 'worktree-agent-ad7c6d88d93adc817'18 * one package's or one team's page, and for anything else.
19 */
20export function workspacePage(pathname: string, slug: string): WorkspacePageKey | null {
21 const parts = pagePath(pathname).split("/").filter(Boolean);
22 if (parts[0]?.toLowerCase() !== slug.toLowerCase()) return null;
23 if (parts.length === 1) return "overview";
24 if (parts[1] !== "-" || parts.length !== 3) return null;
25 return (WORKSPACE_PAGES as readonly string[]).includes(parts[2]!) ? (parts[2] as WorkspacePageKey) : null;
26}
Navigation: the workspace's own page with tabs, pins and recent in the sidebar27
The Runners page shows the machines a workspace's agents and workflow jobs run on, in Workspace under Compute: g1t's cloud beside your own runners, what each is running now with a link to it, what's waiting, this month's machine time and its cost (your own runners' free), where agent work and workflow jobs run, adding a runner, and groups; runner_activity in Actions says what runs where, work handed to your runners keeps its agent run, and the self-hosted runners guide says how.28/**
29 * The workspace's pages that its Settings row drills into. Runners is not
30 * one: it is a page of Workspace mode's own, at `-/runners`.
31 */
Merge branch 'worktree-agent-ad7c6d88d93adc817'32export const SETTINGS_PAGES = [
33 "settings",
34 "repositories",
35 "tokens",
Merge rulesets: branch and tag rules, agent-first, enforced on push and merge36 "rules",
Merge branch 'worktree-agent-ad7c6d88d93adc817'37 "guardrails",
38 "secrets",
Merge branch 'worktree-agent-a3abfcce648e87dca'39 "actions",
Merge branch 'worktree-agent-ad7c6d88d93adc817'40 "integrations",
41 "webhooks",
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)42 "emoji",
Merge branch 'worktree-agent-ad7c6d88d93adc817'43 "billing",
44 "audit",
45] as const;
Navigation: the workspace's own page with tabs, pins and recent in the sidebar46
Merge branch 'worktree-agent-ad7c6d88d93adc817'47/** `?tab=` as people write it, from the tabs the workspace page once had: the page it means. */
Navigation: the workspace's own page with tabs, pins and recent in the sidebar48const TAB_WORDS: Record<string, string> = {
49 overview: "",
50 projects: "-/projects",
51 repositories: "-/projects",
52 repos: "-/projects",
53 packages: "-/packages",
54 people: "-/people",
People and teams are front and centre: one directory of people and agents with presence, local time, titles, teams and what each owns; profiles with manager and reports and the agents they work with; an org chart with each team's agents beside the person who leads it; and teams of any mix, with a lead, a channel, a budget agents keep to and the agents on them. Every agent is told its teams each turn (who leads, who owns what, who's around and who to page), and the team page shows exactly what. Member management is Members and invites; the people and teams guide says how.55 members: "-/members",
Navigation: the workspace's own page with tabs, pins and recent in the sidebar56 teams: "-/teams",
57 insights: "-/insights",
Merge branch 'worktree-agent-ad7c6d88d93adc817'58 settings: "-/settings",
Navigation: the workspace's own page with tabs, pins and recent in the sidebar59};
60
61/** Workspace pages that moved, by their old name under `-/`. */
62const MOVED: Record<string, string> = {
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.63 home: "-/today",
Navigation: the workspace's own page with tabs, pins and recent in the sidebar64 "soon/teams": "-/teams",
65 "soon/insights": "-/insights",
66};
67
The Marketplace adds what g1t doesn't do and connects what you already use: extensions (Mail, Support, CRM, Recruiting, On-call, and bridges to a helpdesk, CRM or ERP you run, all Soon), starter kits, and integrations connected by the workspace or by each person; agents aren't installed there. Agent templates live in Agents, as starting points you configure, at Agents → Templates, and the Marketplace's old agent addresses lead there. The marketplace and agents guides say how.68/** Workspace pages that moved with everything under them, by their old name under `-/`: the rest of the path follows. */
69const MOVED_UNDER: Record<string, string> = {
70 // Agent templates were the Marketplace's Agents tab.
71 "marketplace/agents": "-/agents/templates",
72};
73
Billing: credits with a kind and expiry, discounts instead of comped, and safer charging74/** The page a request is for: a click's data request ends in `.data`. */
75export function pagePath(pathname: string): string {
76 return pathname.replace(/\.data$/, "").replace(/\/+$/, "") || "/";
77}
78
Navigation: the workspace's own page with tabs, pins and recent in the sidebar79/**
Merge branch 'worktree-agent-a8385d293d42c913a'80 * The page at `pathname` under the workspace `slug` instead of its first
81 * segment, keeping its query: where an old name or an alias leads. A click
82 * asks for the page's data at `<path>.data?_routes=…`; the address given is
83 * the page's own, which the browser then asks for as usual.
84 */
85export function underWorkspace(pathname: string, search: string, slug: string): string {
86 const params = new URLSearchParams(search);
87 params.delete("_routes");
88 const query = params.toString();
89 const segments = pagePath(pathname).split("/");
90 // segments[0] is the empty string before the leading slash.
91 segments[1] = slug;
92 return `${segments.join("/")}${query ? `?${query}` : ""}`;
93}
94
95/**
Navigation: the workspace's own page with tabs, pins and recent in the sidebar96 * Where an old address of a workspace's pages is now, keeping its query;
97 * null when it has not moved. `/<workspace>?tab=projects` and the like
Merge branch 'worktree-agent-ad7c6d88d93adc817'98 * open that page.
Navigation: the workspace's own page with tabs, pins and recent in the sidebar99 */
100export function workspaceRedirect(pathname: string, search = ""): string | null {
Billing: credits with a kind and expiry, discounts instead of comped, and safer charging101 // A click asks for the page's data at `<path>.data?_routes=…`; the page
102 // is the same one a full load asks for.
103 const params = new URLSearchParams(search);
104 params.delete("_routes");
105 search = params.toString();
106 const parts = pagePath(pathname).split("/").filter(Boolean);
Navigation: the workspace's own page with tabs, pins and recent in the sidebar107 const slug = parts[0];
108 if (!slug) return null;
109 if (parts.length === 1 && params.has("tab")) {
110 const to = TAB_WORDS[(params.get("tab") ?? "").toLowerCase()];
111 if (to === undefined) return null;
112 params.delete("tab");
113 const rest = params.toString();
114 return `/${slug}${to ? `/${to}` : ""}${rest ? `?${rest}` : ""}`;
115 }
116 if (parts[1] !== "-") return null;
The Marketplace adds what g1t doesn't do and connects what you already use: extensions (Mail, Support, CRM, Recruiting, On-call, and bridges to a helpdesk, CRM or ERP you run, all Soon), starter kits, and integrations connected by the workspace or by each person; agents aren't installed there. Agent templates live in Agents, as starting points you configure, at Agents → Templates, and the Marketplace's old agent addresses lead there. The marketplace and agents guides say how.117 const rest = parts.slice(2).join("/");
118 const under = Object.keys(MOVED_UNDER).find((from) => rest === from || rest.startsWith(`${from}/`));
119 const to = under ? `${MOVED_UNDER[under]}${rest.slice(under.length)}` : MOVED[rest];
Navigation: the workspace's own page with tabs, pins and recent in the sidebar120 if (to === undefined) return null;
121 return `/${slug}${to ? `/${to}` : ""}${search && search !== "?" ? (search.startsWith("?") ? search : `?${search}`) : ""}`;
122}
Chat and workspace agents: channels, DMs and named agents you talk to123
124/**
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.125 * The dock's modes. Today is the front page;
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.126 * Chat, Agents, Code and Artifacts are where work happens; Notifications
127 * spans them; People is who belongs; Workspace is the workspace itself:
128 * its money, policies and settings; Apps is everything installed that you
129 * can use. `account` is your own settings, under the avatar. `site` is
130 * g1t's own public pages (a profile, Explore, Search): no workspace's, so
131 * no mode is lit and no mode's sidebar sits beside them. Each mode has a
132 * sidebar of its own, or none, and which one is lit follows the address.
Chat and workspace agents: channels, DMs and named agents you talk to133 */
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.134export type ModeKey =
135 | "today"
136 | "chat"
137 | "notifications"
138 | "agents"
139 | "code"
140 | "artifacts"
141 | "people"
142 | "workspace"
143 | "apps"
144 | "account"
145 | "site";
Chat and workspace agents: channels, DMs and named agents you talk to146
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)147/** Workspace pages under `-/`, by the mode they belong to. Anything else of the workspace's is Code's. */
148const PAGE_MODES: Record<string, ModeKey> = {
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.149 today: "today",
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)150 chat: "chat",
Artifacts is a mode in the rail, the shell and the phone's tab bar in place of Docs: its home lists everything you can open by day or as cards under All, Yours and Shared with you, with search, filters and tiles to start a doc (slides, designs and dashboards say they are coming soon), and its sidebar holds favorites, spaces, Private, Shared, projects' docs and the trash.151 artifacts: "artifacts",
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)152 agents: "agents",
153 context: "agents",
154 memory: "agents",
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.155 apps: "apps",
The Marketplace is where a workspace finds what to add, reached from Apps: the agent catalog of roles with who already does each job and Add to workspace; every integration with whether it's connected; g1t's own extensions, listed as Soon; and requests, where members ask and owners add or turn down, each told by a notification. Underneath, an extension is a manifest (publisher and tier, source and version from a tag, scopes, the domains its data goes to, its page on g1tusercontent.com, no price) and an install pins its version with an off switch, a budget and the audit log. Apps lists only what was added from the Marketplace, with pins; g1t's own pages stay in their sidebars, and AI Gateway joins Workspace's. The marketplace guide says how.156 marketplace: "apps",
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.157 people: "people",
158 members: "people",
159 teams: "people",
People and teams are front and centre: one directory of people and agents with presence, local time, titles, teams and what each owns; profiles with manager and reports and the agents they work with; an org chart with each team's agents beside the person who leads it; and teams of any mix, with a lead, a channel, a budget agents keep to and the agents on them. Every agent is told its teams each turn (who leads, who owns what, who's around and who to page), and the team page shows exactly what. Member management is Members and invites; the people and teams guide says how.160 "org-chart": "people",
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)161 workspace: "workspace",
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.162 spend: "workspace",
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)163 usage: "workspace",
164 gateway: "workspace",
165 billing: "workspace",
166 integrations: "workspace",
167 guardrails: "workspace",
168 rules: "workspace",
169 audit: "workspace",
170 settings: "workspace",
171 repositories: "workspace",
172 tokens: "workspace",
173 "personal-access-tokens": "workspace",
174 secrets: "workspace",
175 actions: "workspace",
176 runners: "workspace",
177 webhooks: "workspace",
178 emoji: "workspace",
179};
180
Chat controls, public profiles, shadcn selects, and no Docs tab in a project181/** First segments that are g1t's own pages, never a workspace: none is any mode's. */
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)182const SITE_PAGES = new Set(["explore", "search", "support", "policies", "security", "status", "u", "invite", "workspaces"]);
183
184/**
185 * The mode a path is in, for the workspace `slug`. A repository (anyone's)
186 * and a new project are Code's; g1t's own pages (Explore, search, a
Chat controls, public profiles, shadcn selects, and no Docs tab in a project187 * profile) are `site`: public, and no workspace's mode.
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)188 */
Chat and workspace agents: channels, DMs and named agents you talk to189export function modeOf(pathname: string, slug: string | null): ModeKey {
190 const path = pagePath(pathname);
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.191 if (path === "/") return "today";
192 if (path === "/notifications" || path.startsWith("/notifications/")) return "notifications";
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)193 if (path === "/settings" || path.startsWith("/settings/")) return "account";
Chat and workspace agents: channels, DMs and named agents you talk to194 const parts = path.split("/").filter(Boolean);
Chat controls, public profiles, shadcn selects, and no Docs tab in a project195 if (SITE_PAGES.has(parts[0] ?? "")) return "site";
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)196 if (slug && parts[0]?.toLowerCase() === slug.toLowerCase()) {
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.197 if (parts.length === 1) return "today";
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)198 if (parts[1] === "-") {
199 // The workspace's security settings are a policy; its alerts are Code's.
200 if (parts[2] === "security" && parts[3] === "settings") return "workspace";
201 return PAGE_MODES[parts[2] ?? ""] ?? "code";
202 }
Chat and workspace agents: channels, DMs and named agents you talk to203 }
204 return "code";
205}
206
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.207/** Where each mode's button in the dock goes, in the workspace `slug`. */
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)208export function modeHome(mode: ModeKey, slug: string): string {
Chat and workspace agents: channels, DMs and named agents you talk to209 switch (mode) {
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.210 case "today":
211 return todayPath(slug);
212 case "notifications":
213 return "/notifications";
Chat and workspace agents: channels, DMs and named agents you talk to214 case "chat":
215 return `/${slug}/-/chat`;
Artifacts is a mode in the rail, the shell and the phone's tab bar in place of Docs: its home lists everything you can open by day or as cards under All, Yours and Shared with you, with search, filters and tiles to start a doc (slides, designs and dashboards say they are coming soon), and its sidebar holds favorites, spaces, Private, Shared, projects' docs and the trash.216 case "artifacts":
217 return `/${slug}/-/artifacts`;
Chat and workspace agents: channels, DMs and named agents you talk to218 case "agents":
219 return `/${slug}/-/agents`;
220 case "code":
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)221 return `/${slug}/-/overview`;
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.222 case "people":
223 return `/${slug}/-/people`;
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)224 case "workspace":
225 return `/${slug}/-/workspace`;
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.226 case "apps":
227 return `/${slug}/-/apps`;
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)228 case "account":
229 return "/settings";
Chat controls, public profiles, shadcn selects, and no Docs tab in a project230 case "site":
231 return "/explore";
Chat and workspace agents: channels, DMs and named agents you talk to232 }
233}
234
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.235/** A workspace's front page: Today. */
236export function todayPath(slug: string): string {
237 return `/${slug}/-/today`;
238}
239
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)240/**
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.241 * Where g1t's front door (`/`) and a workspace's own address lead someone
242 * in the workspace `slug`: Today, or Code's Overview when the query asks
243 * for its panels (a tab, or `?agent=new` to put an agent on something).
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)244 */
245export function homePath(slug: string, search = ""): string {
246 const params = new URLSearchParams(search);
247 params.delete("_routes");
248 params.delete("index");
249 const query = params.toString();
250 if (params.has("agent") || params.has("tab") || params.has("sort")) return `/${slug}/-/overview?${query}`;
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.251 return todayPath(slug);
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)252}
253
Chat and workspace agents: channels, DMs and named agents you talk to254/** The page a member without Code access sees in place of anything of Code's. */
255export function codeAccessPath(slug: string, from?: string): string {
256 return `/${slug}/-/code-access${from ? `?from=${encodeURIComponent(from)}` : ""}`;
257}
258
259/** The workspace pages under `-/` that are Code's: closed to a member without Code access. */
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)260const CODE_PAGES = new Set(["overview", "projects", "repositories", "packages", "security", "rules", "runners", "actions", "context", "memory", "insights", "soon"]);
Chat and workspace agents: channels, DMs and named agents you talk to261
262/**
263 * Where a member without Code access goes instead of `pathname`, or null
264 * when the page is open to them. `noCode` is the workspaces (by slug) where
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.265 * they lack it; `chosen` is the one they are in. g1t's front door (`/`) is
266 * Today in that workspace, and so is the workspace's own address; its
267 * Code pages and every repository page is the page that says to ask an
268 * owner.
Chat and workspace agents: channels, DMs and named agents you talk to269 */
270export function codeGate(pathname: string, search: string, noCode: readonly string[], chosen: string | null): string | null {
271 if (noCode.length === 0) return null;
272 const path = pagePath(pathname);
273 if (path === "/") {
274 const slug = chosen && noCode.includes(chosen.toLowerCase()) ? chosen.toLowerCase() : null;
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.275 return slug ? todayPath(slug) : null;
Chat and workspace agents: channels, DMs and named agents you talk to276 }
277 const parts = path.split("/").filter(Boolean);
278 const slug = parts[0]?.toLowerCase();
279 if (!slug || !noCode.includes(slug)) return null;
280 const from = `${path}${search && search !== "?" ? search : ""}`;
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.281 // The workspace's own page is Today.
282 if (parts.length === 1) return todayPath(slug);
Chat and workspace agents: channels, DMs and named agents you talk to283 if (parts[1] === "-") return CODE_PAGES.has(parts[2] ?? "") ? codeAccessPath(slug, from) : null;
284 // A repository, and everything in it.
285 return codeAccessPath(slug, from);
286}

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