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