Skip to content
316 linesCodeBlameRaw
1import { type RouteConfig, index, route } from "@react-router/dev/routes";
2
3export default [
4 index("routes/home.tsx"),
5 route("login", "routes/login.tsx"),
6 // The second step of signing in, for an account with two-factor authentication.
7 route("login/two-factor", "routes/login-two-factor.tsx"),
8 route("register", "routes/register.tsx"),
9 // An invite link: who sent it, then sign-up or joining. `invite` is reserved.
10 route("invite/:code", "routes/invite.tsx"),
11 route("logout", "routes/logout.tsx"),
12 route("verify", "routes/verify.tsx"),
13 // Where an account confirms its email address, with the code from the
14 // email; every other page sends it here until it has (lib/confirm-gate.ts).
15 route("confirm-email", "routes/confirm-email.tsx"),
16 route("forgot", "routes/forgot.tsx"),
17 route("reset", "routes/reset.tsx"),
18 route("device", "routes/device.tsx"),
19 route("oauth/authorize", "routes/oauth-authorize.tsx"),
20 route("new", "routes/new.tsx"),
21 // GitHub: signing in with it, and bringing repositories across through
22 // g1t's GitHub App. `auth` and `integrations` are reserved names.
23 route("new/github", "routes/new-github.tsx"),
24 route("auth/github", "routes/auth-github.ts"),
25 route("auth/github/callback", "routes/auth-github-callback.tsx"),
26 route("auth/github/username", "routes/auth-github-username.tsx"),
27 route("integrations/github/install", "routes/github-install.ts"),
28 route("integrations/github/setup", "routes/github-setup.tsx"),
29 // Your own settings: one page each, so links can name the one they mean.
30 // `/settings` goes to the first; an old link's `#anchor` to its page.
31 route("settings", "routes/settings/layout.tsx", [
32 index("routes/settings/index.tsx"),
33 route("profile", "routes/settings/profile.tsx"),
34 route("emails", "routes/settings/emails.tsx"),
35 route("notifications", "routes/settings/notifications.tsx"),
36 route("invites", "routes/settings/invites.tsx"),
37 route("keys", "routes/settings/keys.tsx"),
38 // Your access tokens: the list, a new one, and each one's page.
39 route("tokens", "routes/settings/tokens.tsx"),
40 route("tokens/new", "routes/settings/token-new.tsx"),
41 route("tokens/:id", "routes/settings/token.tsx"),
42 route("github", "routes/settings/github.tsx"),
43 route("applications", "routes/settings/applications.tsx"),
44 route("integrations", "routes/settings/integrations.tsx"),
45 route("two-factor", "routes/settings/two-factor.tsx"),
46 route("security-log", "routes/settings/security-log.tsx"),
47 route("account", "routes/settings/account.tsx"),
48 ]),
49 // The account menu's header: name, primary email and invites left.
50 route("settings/menu.json", "routes/settings-menu-json.ts"),
51 // People, apart from workspaces: `u` is a reserved name.
52 route("u/:username", "routes/user.tsx"),
53 // The card that opens over a person's name or avatar (lib/hovercard.ts).
54 // `-` is no workspace's name, so nothing else is ever found here.
55 route("-/hovercard/user/:username", "routes/hovercard-user.ts"),
56 // Live notifications: each tab's feed socket, and the person's
57 // notification settings as JSON (services/notify).
58 route("-/live", "routes/notify/live.ts"),
59 route("-/notify", "routes/notify/api.ts"),
60 route("explore", "routes/explore.tsx", { id: "explore" }),
61 route("pricing", "routes/pricing.tsx"),
62 route("search", "routes/search.tsx"),
63 // Each person's inbox, and what its panel in the top bar fetches.
64 route("inbox", "routes/inbox.tsx"),
65 route("inbox.json", "routes/inbox-json.ts"),
66 // What the command palette shows as someone types.
67 route("search.json", "routes/search-json.ts"),
68 route("workspaces/new", "routes/workspace/new.tsx"),
69 // Workspace invitations waiting for the person's answer. `invitations` is reserved.
70 route("invitations", "routes/invitations.tsx"),
71 // People to invite, as the People page's invite form searches them.
72 route("-/people.json", "routes/people-json.ts"),
73 // Trust pages: reserved names, like the rest above.
74 route("policies", "routes/policies.tsx"),
75 route("policies/:policy", "routes/policy.tsx"),
76 route("security", "routes/security.tsx"),
77 route("support", "routes/support.tsx"),
78 // Status moved to status.g1t.sh (apps/status); old links go there.
79 route("status", "routes/status.tsx"),
80 route("status.json", "routes/status-json.ts"),
81 route(".well-known/security.txt", "routes/security-txt.ts"),
82 // For search engines: what may be crawled, and a map of the public pages.
83 route("robots.txt", "routes/robots-txt.ts"),
84 route("sitemap.xml", "routes/sitemap-xml.ts"),
85 // Releases of the self-hosted runner and the g1t CLI, from R2.
86 route("downloads/:tool/*", "routes/downloads-runner.ts"),
87 // A workspace's own pages sit under `-`, which no repository can be named.
88 route(":owner", "routes/workspace/layout.tsx", [
89 index("routes/workspace/overview.tsx"),
90 // Its pages, each in the sidebar: Overview (above), Projects, People, Insights; Teams and Packages below.
91 route("-/projects", "routes/workspace/projects.tsx"),
92 route("-/people", "routes/workspace/people.tsx"),
93 route("-/insights", "routes/workspace/tab-soon.tsx", { id: "routes/workspace/insights" }),
94 // Pinning its projects, for the person signed in.
95 route("-/pins", "routes/workspace/pins.ts"),
96 // Pages that moved: Members is People, and the overview is the workspace.
97 route("-/members", "routes/workspace/moved.ts", { id: "routes/workspace/moved-members" }),
98 // Code's Overview: Mission control's code panels, for this workspace.
99 route("-/overview", "routes/workspace/code-overview.tsx"),
100 // The workspace itself, at a glance: members, plan and spend.
101 route("-/workspace", "routes/workspace/workspace-overview.tsx"),
102 // Teams: the list, a new one, and each team's pages.
103 route("-/teams", "routes/workspace/teams.tsx"),
104 route("-/teams/new", "routes/workspace/team-new.tsx"),
105 route("-/teams/:team", "routes/workspace/team/layout.tsx", [
106 index("routes/workspace/team/members.tsx"),
107 route("teams", "routes/workspace/team/teams.tsx"),
108 route("repositories", "routes/workspace/team/repositories.tsx"),
109 route("settings", "routes/workspace/team/settings.tsx"),
110 ]),
111 // The workspace's own access tokens: the list, a new one, and each one's page.
112 route("-/tokens", "routes/workspace/tokens.tsx"),
113 route("-/tokens/new", "routes/workspace/token-new.tsx"),
114 route("-/tokens/:id", "routes/workspace/token.tsx"),
115 // Its rules for members' personal access tokens, and approving them.
116 route("-/personal-access-tokens", "routes/workspace/personal-access-tokens.tsx"),
117 route("-/usage", "routes/workspace/usage.tsx"),
118 route("-/gateway", "routes/workspace/gateway.tsx"),
119 route("-/billing", "routes/workspace/billing.tsx"),
120 route("-/billing/entries", "routes/workspace/statement-entries.ts"),
121 route("-/billing/statement.csv", "routes/workspace/statement-csv.ts"),
122 // The integrations directory, and the setup page for each kind of
123 // provider connection: models, alerts, trackers (lib/integration-sections).
124 route("-/integrations", "routes/workspace/integrations-directory.tsx"),
125 route("-/integrations/:section", "routes/workspace/integrations.tsx"),
126 route("-/webhooks", "routes/workspace/webhooks.tsx"),
127 // The workspace's own emoji, for chat (components/emoji).
128 route("-/emoji", "routes/workspace/emoji.tsx"),
129 route("-/secrets", "routes/workspace/secrets.tsx"),
130 route("-/runners", "routes/workspace/runners.tsx"),
131 route("-/actions", "routes/workspace/actions-settings.tsx"),
132 route("-/packages", "routes/workspace/packages.tsx"),
133 route("-/packages/:ecosystem/*", "routes/workspace/package.tsx"),
134 route("-/settings", "routes/workspace/settings.tsx"),
135 // What members may do in chat: channels, emoji, default channels.
136 route("-/settings/chat", "routes/workspace/chat-settings.tsx"),
137 route("-/repositories", "routes/workspace/repositories.tsx"),
138 // Agents mode: the overview (budget, sessions, roster, spend) first, then
139 // each of the workspace's own agents and its sessions (docs/WORKSPACE.md).
140 // `new` is no agent's handle.
141 route("-/agents", "routes/workspace/agents/layout.tsx", [
142 index("routes/workspace/agents.tsx"),
143 route("new", "routes/workspace/agents/new.tsx"),
144 route(":handle", "routes/workspace/agents/agent.tsx", [
145 index("routes/workspace/agents/sessions.tsx"),
146 route("sessions/:id", "routes/workspace/agents/session.tsx"),
147 route("memory", "routes/workspace/agents/memory.tsx"),
148 route("routines", "routes/workspace/agents/routines.tsx"),
149 route("spend", "routes/workspace/agents/spend.tsx"),
150 route("activity", "routes/workspace/agents/activity.tsx"),
151 route("profile", "routes/workspace/agents/profile.tsx"),
152 ]),
153 ]),
154 // Chat mode: channels by name, direct messages by id, and what the page
155 // calls as it runs: the live socket and the JSON for sending and reading.
156 route("-/chat/live", "routes/workspace/chat/live.ts"),
157 route("-/chat/api", "routes/workspace/chat/api.ts"),
158 // A person's card in Chat: their profile and teams here.
159 route("-/chat/person/:username", "routes/workspace/chat/person.ts"),
160 route("-/chat", "routes/workspace/chat/layout.tsx", [
161 index("routes/workspace/chat/index.tsx"),
162 route("browse", "routes/workspace/chat/browse.tsx"),
163 route("dm/:id", "routes/workspace/chat/channel.tsx", { id: "routes/workspace/chat/dm" }),
164 route(":channel", "routes/workspace/chat/channel.tsx"),
165 ]),
166 // Docs mode (docs/WORKSPACE.md, "Docs"): what its pages call as they
167 // run (a page's live socket, JSON, comments, uploads, export), then
168 // Home, search, templates, the trash, a new space, and each space and
169 // page by its address. A page's address ends in its id, so renaming it
170 // keeps links working.
171 route("-/docs/live", "routes/workspace/docs/live.ts"),
172 route("-/docs/api", "routes/workspace/docs/api.ts"),
173 route("-/docs/threads/:page/*", "routes/workspace/docs/threads.ts"),
174 route("-/docs/upload", "routes/workspace/docs/upload.ts"),
175 route("-/docs/export", "routes/workspace/docs/export.ts"),
176 route("-/docs", "routes/workspace/docs/layout.tsx", [
177 index("routes/workspace/docs/home.tsx"),
178 route("search", "routes/workspace/docs/search.tsx"),
179 route("templates", "routes/workspace/docs/templates.tsx"),
180 route("trash", "routes/workspace/docs/trash.tsx"),
181 route("new", "routes/workspace/docs/new-space.tsx"),
182 // Pages possibly out of date, and a project's docs folder, read-only.
183 route("stale", "routes/workspace/docs/stale.tsx"),
184 route("repo/:repoOwner/:repoName/*", "routes/workspace/docs/repo-file.tsx"),
185 route(":space", "routes/workspace/docs/space.tsx"),
186 route(":space/settings", "routes/workspace/docs/space-settings.tsx"),
187 route(":space/:page", "routes/workspace/docs/page.tsx"),
188 ]),
189 // Home for a member without Code, and what Code's pages say to them
190 // (docs/WORKSPACE.md, "Members without Code").
191 route("-/home", "routes/workspace/home.tsx"),
192 route("-/code-access", "routes/workspace/code-access.tsx"),
193 route("-/memory", "routes/workspace/memory.tsx"),
194 route("-/context", "routes/workspace/context.tsx"),
195 route("-/security", "routes/workspace/security.tsx"),
196 route("-/security/patterns", "routes/workspace/security-patterns.tsx"),
197 route("-/security/bypass-requests", "routes/workspace/security-bypass.tsx"),
198 route("-/security/settings", "routes/workspace/security-settings.tsx"),
199 route("-/audit", "routes/workspace/audit.tsx"),
200 route("-/audit/export", "routes/workspace/audit-export.ts"),
201 route("-/guardrails", "routes/workspace/guardrails.tsx"),
202 route("-/rules", "routes/workspace/rules.tsx"),
203 route("-/rules/:id", "routes/workspace/ruleset.tsx"),
204 // What the workspace will have across its projects.
205 route("-/soon/:feature", "routes/workspace/soon.tsx"),
206 ]),
207 // Why a line is the way it is, fetched by the blame view.
208 route(":owner/:repo/why/:hash", "routes/repo/why.ts"),
209 // A project's agent runs as JSON, and stopping or messaging one.
210 route(":owner/:repo/agents.json", "routes/repo/agents-live.ts"),
211 // Its branch names, for changing the branch a pull request merges into.
212 route(":owner/:repo/branches.json", "routes/repo/branch-names.ts"),
213 // What a project's agent runs did, from the audit log, for the Agent panel.
214 route(":owner/:repo/audit.json", "routes/repo/audit-live.ts"),
215 // An invitation to a repository, answered by someone who cannot see it yet.
216 route(":owner/:repo/invitations", "routes/repo/invitations.tsx"),
217 // The Files page's About as JSON, asked again while it is first worked out.
218 route(":owner/:repo/about.json", "routes/repo/about-json.ts"),
219 // Starring it, from the header's Star button.
220 route(":owner/:repo/star", "routes/repo/star.ts"),
221 // Subscribing to its issues and pull requests, and watching it.
222 route(":owner/:repo/notifications", "routes/repo/notifications.ts"),
223 // A starter CI workflow, opened as a pull request (components/add-ci.tsx).
224 route(":owner/:repo/add-ci", "routes/repo/add-ci.ts"),
225 // A screenshot of a project's production, for its overview.
226 route(":owner/:repo/production.jpg", "routes/repo/production-screenshot.ts"),
227 // A file as it is, sent on to the usercontent origin (lib/usercontent.ts).
228 route(":owner/:repo/raw/:ref/*", "routes/repo/raw.ts"),
229 // A project: its overview first, its repository's code under Code. The
230 // 1:1 project of a repository has the repository's name, so every
231 // repository address below keeps working.
232 route(":owner/:repo", "routes/repo/layout.tsx", [
233 index("routes/repo/overview.tsx"),
234 route("code", "routes/repo/code.tsx"),
235 route("tree/:ref/*", "routes/repo/tree.tsx"),
236 route("blob/:ref/*", "routes/repo/blob.tsx"),
237 route("archive/*", "routes/repo/archive.ts"),
238 route("commits", "routes/repo/commits.tsx"),
239 route("branches", "routes/repo/branches.tsx"),
240 route("tags", "routes/repo/tags.tsx"),
241 route("releases", "routes/repo/releases.tsx"),
242 route("releases/new", "routes/repo/release-new.tsx"),
243 route("releases/tag/*", "routes/repo/release.tsx"),
244 route("contributors", "routes/repo/contributors.tsx"),
245 route("activity", "routes/repo/activity.tsx"),
246 route("stargazers", "routes/repo/stargazers.tsx"),
247 route("compare/*", "routes/repo/compare.tsx", { id: "routes/repo/compare-range" }),
248 route("compare", "routes/repo/compare.tsx"),
249 route("commit/:hash", "routes/repo/commit.tsx"),
250 // A check run reported on a commit: its report, annotations and buttons.
251 route("checks/:id", "routes/repo/check-run.tsx"),
252 route("labels", "routes/repo/labels.tsx"),
253 route("milestones", "routes/repo/milestones.tsx"),
254 route("milestones/:number", "routes/repo/milestone.tsx"),
255 route("issues", "routes/repo/issues.tsx"),
256 route("issues/new", "routes/repo/issue-new.tsx"),
257 route("issues/:number", "routes/repo/issue.tsx"),
258 route("pulls", "routes/repo/pulls.tsx"),
259 route("pulls/new", "routes/repo/pull-new.tsx"),
260 route("pull/:number", "routes/repo/pull.tsx"),
261 route("queue", "routes/repo/queue.tsx"),
262 route("agents", "routes/repo/agents.tsx"),
263 route("usage", "routes/repo/usage.tsx"),
264 route("agents/runs/:id", "routes/repo/agents-run.tsx"),
265 route("sessions", "routes/repo/sessions.tsx"),
266 route("sessions/:number", "routes/repo/session.tsx"),
267 route("memory", "routes/repo/memory.tsx"),
268 route("actions", "routes/repo/actions.tsx"),
269 route("actions/runs/:id", "routes/repo/actions-run.tsx"),
270 route("actions/runs/:id/artifacts/:name", "routes/repo/actions-artifact.ts"),
271 route("actions/jobs/:job/log", "routes/repo/actions-log.ts"),
272 route("actions/jobs/:job/log.txt", "routes/repo/actions-job-log-download.ts"),
273 route("actions/runs/:id/logs.zip", "routes/repo/actions-logs-download.ts"),
274 route("actions/workflows/:file/badge.svg", "routes/repo/actions-badge.ts"),
275 route("deployments", "routes/repo/deployments.tsx"),
276 route("deployments/:id", "routes/repo/deployment.tsx"),
277 // Security: an overview, then a page for each part. Old links to
278 // `security?tab=…` are sent on by the overview.
279 route("security", "routes/repo/security-overview.tsx"),
280 route("security/secret-scanning", "routes/repo/security-secrets.tsx"),
281 route("security/secret-scanning/patterns", "routes/repo/security-patterns.tsx"),
282 route("security/secret-scanning/:id", "routes/repo/security-secret.tsx"),
283 route("security/code-scanning", "routes/repo/security-code.tsx"),
284 route("security/code-scanning/setup", "routes/repo/security-code-setup.ts"),
285 route("security/code-scanning/:number", "routes/repo/security-code-alert.tsx"),
286 route("security/vulnerabilities", "routes/repo/security.tsx"),
287 route("security/dependency-graph", "routes/repo/security-graph.tsx"),
288 route("security/dependency-graph/sbom.json", "routes/repo/security-sbom.ts"),
289 route("security/dependency-updates", "routes/repo/security-updates.tsx"),
290 route("security/pulls/:number", "routes/repo/security-pull.tsx"),
291 route("security/settings", "routes/repo/security-settings.tsx"),
292 route("plans", "routes/repo/plans.tsx"),
293 route("plans/:id", "routes/repo/plan.tsx"),
294 route("settings", "routes/repo/settings.tsx"),
295 route("settings/repository", "routes/repo/settings-repository.tsx"),
296 route("settings/access", "routes/repo/settings-access.tsx"),
297 route("settings/keys", "routes/repo/settings-deploy-keys.tsx"),
298 route("settings/branches", "routes/repo/settings-branches.tsx"),
299 route("settings/rules", "routes/repo/settings-rules.tsx"),
300 route("settings/rules/:id", "routes/repo/settings-ruleset.tsx"),
301 route("settings/webhooks", "routes/repo/webhooks.tsx"),
302 route("settings/secrets", "routes/repo/secrets.tsx"),
303 route("settings/actions", "routes/repo/settings-actions.tsx"),
304 route("settings/environments", "routes/repo/settings-environments.tsx"),
305 route("settings/runners", "routes/repo/settings-runners.tsx"),
306 route("settings/deployments", "routes/repo/settings-deployments.tsx"),
307 route("settings/domains", "routes/repo/settings-domains.tsx"),
308 route("settings/dependencies", "routes/repo/settings-dependencies.tsx"),
309 route("settings/guardrails", "routes/repo/settings-guardrails.tsx"),
310 route("settings/agents", "routes/repo/settings-agents.tsx"),
311 // What the project will have: one page for each Soon in its menu.
312 route("soon/:feature", "routes/repo/soon.tsx"),
313 ]),
314 // Anything else: a 404 that still knows who is signed in.
315 route("*", "routes/not-found.tsx"),
316] satisfies RouteConfig;