Skip to content
274 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
Merge branch 'worktree-agent-ad7c6d88d93adc817'28/** The workspace's pages that its Settings row drills into. */
29export const SETTINGS_PAGES = [
30 "settings",
31 "repositories",
32 "tokens",
Merge rulesets: branch and tag rules, agent-first, enforced on push and merge33 "rules",
Merge branch 'worktree-agent-ad7c6d88d93adc817'34 "guardrails",
35 "secrets",
Merge branch 'worktree-agent-a3abfcce648e87dca'36 "actions",
Merge branch 'worktree-agent-ad7c6d88d93adc817'37 "runners",
38 "integrations",
39 "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)40 "emoji",
Merge branch 'worktree-agent-ad7c6d88d93adc817'41 "billing",
42 "audit",
43] as const;
Navigation: the workspace's own page with tabs, pins and recent in the sidebar44
Merge branch 'worktree-agent-ad7c6d88d93adc817'45/** `?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 sidebar46const TAB_WORDS: Record<string, string> = {
47 overview: "",
48 projects: "-/projects",
49 repositories: "-/projects",
50 repos: "-/projects",
51 packages: "-/packages",
52 people: "-/people",
53 members: "-/people",
54 teams: "-/teams",
55 insights: "-/insights",
Merge branch 'worktree-agent-ad7c6d88d93adc817'56 settings: "-/settings",
Navigation: the workspace's own page with tabs, pins and recent in the sidebar57};
58
59/** Workspace pages that moved, by their old name under `-/`. */
60const 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.61 home: "-/today",
Navigation: the workspace's own page with tabs, pins and recent in the sidebar62 members: "-/people",
63 "soon/teams": "-/teams",
64 "soon/insights": "-/insights",
65};
66
Billing: credits with a kind and expiry, discounts instead of comped, and safer charging67/** The page a request is for: a click's data request ends in `.data`. */
68export function pagePath(pathname: string): string {
69 return pathname.replace(/\.data$/, "").replace(/\/+$/, "") || "/";
70}
71
Navigation: the workspace's own page with tabs, pins and recent in the sidebar72/**
Merge branch 'worktree-agent-a8385d293d42c913a'73 * The page at `pathname` under the workspace `slug` instead of its first
74 * segment, keeping its query: where an old name or an alias leads. A click
75 * asks for the page's data at `<path>.data?_routes=…`; the address given is
76 * the page's own, which the browser then asks for as usual.
77 */
78export function underWorkspace(pathname: string, search: string, slug: string): string {
79 const params = new URLSearchParams(search);
80 params.delete("_routes");
81 const query = params.toString();
82 const segments = pagePath(pathname).split("/");
83 // segments[0] is the empty string before the leading slash.
84 segments[1] = slug;
85 return `${segments.join("/")}${query ? `?${query}` : ""}`;
86}
87
88/**
Navigation: the workspace's own page with tabs, pins and recent in the sidebar89 * Where an old address of a workspace's pages is now, keeping its query;
90 * null when it has not moved. `/<workspace>?tab=projects` and the like
Merge branch 'worktree-agent-ad7c6d88d93adc817'91 * open that page.
Navigation: the workspace's own page with tabs, pins and recent in the sidebar92 */
93export function workspaceRedirect(pathname: string, search = ""): string | null {
Billing: credits with a kind and expiry, discounts instead of comped, and safer charging94 // A click asks for the page's data at `<path>.data?_routes=…`; the page
95 // is the same one a full load asks for.
96 const params = new URLSearchParams(search);
97 params.delete("_routes");
98 search = params.toString();
99 const parts = pagePath(pathname).split("/").filter(Boolean);
Navigation: the workspace's own page with tabs, pins and recent in the sidebar100 const slug = parts[0];
101 if (!slug) return null;
102 if (parts.length === 1 && params.has("tab")) {
103 const to = TAB_WORDS[(params.get("tab") ?? "").toLowerCase()];
104 if (to === undefined) return null;
105 params.delete("tab");
106 const rest = params.toString();
107 return `/${slug}${to ? `/${to}` : ""}${rest ? `?${rest}` : ""}`;
108 }
109 if (parts[1] !== "-") return null;
110 const to = MOVED[parts.slice(2).join("/")];
111 if (to === undefined) return null;
112 return `/${slug}${to ? `/${to}` : ""}${search && search !== "?" ? (search.startsWith("?") ? search : `?${search}`) : ""}`;
113}
Chat and workspace agents: channels, DMs and named agents you talk to114
115/**
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.116 * The dock's modes (docs/WORKSPACE.md, "Shell"). Today is the front page;
117 * Chat, Agents, Code and Artifacts are where work happens; Notifications
118 * spans them; People is who belongs; Workspace is the workspace itself:
119 * its money, policies and settings; Apps is everything installed that you
120 * can use. `account` is your own settings, under the avatar. `site` is
121 * g1t's own public pages (a profile, Explore, Search): no workspace's, so
122 * no mode is lit and no mode's sidebar sits beside them. Each mode has a
123 * 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 to124 */
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.125export type ModeKey =
126 | "today"
127 | "chat"
128 | "notifications"
129 | "agents"
130 | "code"
131 | "artifacts"
132 | "people"
133 | "workspace"
134 | "apps"
135 | "account"
136 | "site";
Chat and workspace agents: channels, DMs and named agents you talk to137
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)138/** Workspace pages under `-/`, by the mode they belong to. Anything else of the workspace's is Code's. */
139const 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.140 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)141 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.142 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)143 agents: "agents",
144 context: "agents",
145 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.146 apps: "apps",
147 people: "people",
148 members: "people",
149 teams: "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)150 workspace: "workspace",
151 usage: "workspace",
152 gateway: "workspace",
153 billing: "workspace",
154 integrations: "workspace",
155 guardrails: "workspace",
156 rules: "workspace",
157 audit: "workspace",
158 settings: "workspace",
159 repositories: "workspace",
160 tokens: "workspace",
161 "personal-access-tokens": "workspace",
162 secrets: "workspace",
163 actions: "workspace",
164 runners: "workspace",
165 webhooks: "workspace",
166 emoji: "workspace",
167};
168
Chat controls, public profiles, shadcn selects, and no Docs tab in a project169/** 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)170const SITE_PAGES = new Set(["explore", "search", "support", "policies", "security", "status", "u", "invite", "workspaces"]);
171
172/**
173 * The mode a path is in, for the workspace `slug`. A repository (anyone's)
174 * 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 project175 * 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)176 */
Chat and workspace agents: channels, DMs and named agents you talk to177export function modeOf(pathname: string, slug: string | null): ModeKey {
178 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.179 if (path === "/") return "today";
180 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)181 if (path === "/settings" || path.startsWith("/settings/")) return "account";
Chat and workspace agents: channels, DMs and named agents you talk to182 const parts = path.split("/").filter(Boolean);
Chat controls, public profiles, shadcn selects, and no Docs tab in a project183 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)184 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.185 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)186 if (parts[1] === "-") {
187 // The workspace's security settings are a policy; its alerts are Code's.
188 if (parts[2] === "security" && parts[3] === "settings") return "workspace";
189 return PAGE_MODES[parts[2] ?? ""] ?? "code";
190 }
Chat and workspace agents: channels, DMs and named agents you talk to191 }
192 return "code";
193}
194
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.195/** 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)196export function modeHome(mode: ModeKey, slug: string): string {
Chat and workspace agents: channels, DMs and named agents you talk to197 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.198 case "today":
199 return todayPath(slug);
200 case "notifications":
201 return "/notifications";
Chat and workspace agents: channels, DMs and named agents you talk to202 case "chat":
203 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.204 case "artifacts":
205 return `/${slug}/-/artifacts`;
Chat and workspace agents: channels, DMs and named agents you talk to206 case "agents":
207 return `/${slug}/-/agents`;
208 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)209 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.210 case "people":
211 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)212 case "workspace":
213 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.214 case "apps":
215 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)216 case "account":
217 return "/settings";
Chat controls, public profiles, shadcn selects, and no Docs tab in a project218 case "site":
219 return "/explore";
Chat and workspace agents: channels, DMs and named agents you talk to220 }
221}
222
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.223/** A workspace's front page: Today. */
224export function todayPath(slug: string): string {
225 return `/${slug}/-/today`;
226}
227
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/**
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.229 * Where g1t's front door (`/`) and a workspace's own address lead someone
230 * in the workspace `slug`: Today, or Code's Overview when the query asks
231 * 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)232 */
233export function homePath(slug: string, search = ""): string {
234 const params = new URLSearchParams(search);
235 params.delete("_routes");
236 params.delete("index");
237 const query = params.toString();
238 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.239 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)240}
241
Chat and workspace agents: channels, DMs and named agents you talk to242/** The page a member without Code access sees in place of anything of Code's. */
243export function codeAccessPath(slug: string, from?: string): string {
244 return `/${slug}/-/code-access${from ? `?from=${encodeURIComponent(from)}` : ""}`;
245}
246
247/** 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)248const 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 to249
250/**
251 * Where a member without Code access goes instead of `pathname`, or null
252 * 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.253 * they lack it; `chosen` is the one they are in. g1t's front door (`/`) is
254 * Today in that workspace, and so is the workspace's own address; its
255 * Code pages and every repository page is the page that says to ask an
256 * owner.
Chat and workspace agents: channels, DMs and named agents you talk to257 */
258export function codeGate(pathname: string, search: string, noCode: readonly string[], chosen: string | null): string | null {
259 if (noCode.length === 0) return null;
260 const path = pagePath(pathname);
261 if (path === "/") {
262 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.263 return slug ? todayPath(slug) : null;
Chat and workspace agents: channels, DMs and named agents you talk to264 }
265 const parts = path.split("/").filter(Boolean);
266 const slug = parts[0]?.toLowerCase();
267 if (!slug || !noCode.includes(slug)) return null;
268 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.269 // The workspace's own page is Today.
270 if (parts.length === 1) return todayPath(slug);
Chat and workspace agents: channels, DMs and named agents you talk to271 if (parts[1] === "-") return CODE_PAGES.has(parts[2] ?? "") ? codeAccessPath(slug, from) : null;
272 // A repository, and everything in it.
273 return codeAccessPath(slug, from);
274}

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