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