g1t/crates/contracts/src/names.rs
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.
| API and MCP server, Rust identity service, registration, site redesign | 1 | /// Routes and reserved words that may not be registered as usernames. |
| 2 | const RESERVED: &[&str] = &[ | |
| Workspaces own repositories | 3 | "api", |
| 4 | "mcp", | |
| 5 | "login", | |
| 6 | "logout", | |
| 7 | "register", | |
| 8 | "new", | |
| 9 | "settings", | |
| 10 | "search", | |
| 11 | "admin", | |
| 12 | "auth", | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 13 | // g1t.sh/integrations/github/setup: where GitHub returns after an install. |
| 14 | "integrations", | |
| Issues and pull requests replace intents and attempts | 15 | "pulls", |
| 16 | "issues", | |
| Workspaces own repositories | 17 | "oauth", |
| 18 | "assets", | |
| Workspace names and icons, and a component kit for every control | 19 | "avatars", |
| Workspaces own repositories | 20 | "docs", |
| 21 | "explore", | |
| 22 | "g1t", | |
| 23 | "about", | |
| 24 | "pricing", | |
| 25 | "terms", | |
| 26 | "privacy", | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 27 | "policies", |
| 28 | "security", | |
| Workspaces own repositories | 29 | "help", |
| 30 | "support", | |
| 31 | "status", | |
| 32 | "blog", | |
| 33 | "verify", | |
| 34 | "forgot", | |
| 35 | "reset", | |
| 36 | "device", | |
| 37 | "workspaces", | |
| 38 | "u", | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 39 | // g1t.sh/invite/<code>: invite links; and the waitlist. |
| 40 | "invite", | |
| 41 | "invites", | |
| 42 | "waitlist", | |
| API and MCP server, Rust identity service, registration, site redesign | 43 | ]; |
| 44 | ||
| 45 | /// Namespaces follow GitHub's rules: letters, digits and single hyphens, | |
| 46 | /// not starting or ending with a hyphen, at most 39 characters. | |
| 47 | pub fn is_valid_namespace(value: &str) -> bool { | |
| 48 | let bytes = value.as_bytes(); | |
| 49 | !bytes.is_empty() | |
| 50 | && bytes.len() <= 39 | |
| 51 | && bytes | |
| 52 | .iter() | |
| 53 | .all(|byte| byte.is_ascii_lowercase() || byte.is_ascii_digit() || *byte == b'-') | |
| 54 | && !value.starts_with('-') | |
| 55 | && !value.ends_with('-') | |
| 56 | && !value.contains("--") | |
| 57 | && !RESERVED.contains(&value) | |
| 58 | } | |
| 59 | ||
| 60 | pub fn is_valid_repo_name(value: &str) -> bool { | |
| 61 | !value.is_empty() | |
| 62 | && value.len() <= 100 | |
| 63 | && value.bytes().all(|byte| { | |
| 64 | byte.is_ascii_lowercase() || byte.is_ascii_digit() || matches!(byte, b'.' | b'_' | b'-') | |
| 65 | }) | |
| 66 | && !value.starts_with('.') | |
| 67 | && !value.ends_with(".git") | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 68 | // `/<workspace>/-/…` holds the workspace's own pages. |
| 69 | && value != "-" | |
| API and MCP server, Rust identity service, registration, site redesign | 70 | } |