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