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.
| Initial g1t: services, event bus, intents and attempts | 1 | // Namespaces follow GitHub's rules (no leading, trailing or doubled hyphens), |
| 2 | // so "--" can never appear inside one. | |
| 3 | const NAMESPACE = /^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}$/; | |
| 4 | const REPO_NAME = /^[a-z0-9._-]{1,100}$/; | |
| 5 | ||
| 6 | /** Routes and reserved words that may not be registered as usernames. */ | |
| 7 | const RESERVED = new Set([ | |
| 8 | "api", "mcp", "login", "logout", "register", "new", "settings", "search", | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 9 | "admin", "auth", "integrations", "pulls", "issues", "verify", "forgot", "reset", "device", "workspaces", "u", "oauth", "assets", "avatars", "docs", "explore", "about", "pricing", |
| 10 | // g1t itself, and the name its agent once went by: everything g1t does is | |
| 11 | // shown as `g1t`, so nobody else may be called either. | |
| 12 | "g1t", "g1t-agent", | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 13 | // Trust pages on g1t.sh, and names kept for them. |
| 14 | "policies", "security", "support", "status", "terms", "privacy", "help", "blog", | |
| 15 | // Invite links, and the waitlist. | |
| 16 | "invite", "invites", "waitlist", | |
| Initial g1t: services, event bus, intents and attempts | 17 | ]); |
| 18 | ||
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 19 | /** Whether `value`, whatever its case, is a name nobody can register: a route, or g1t's own. */ |
| 20 | export function isReservedName(value: string): boolean { | |
| 21 | return RESERVED.has(value.trim().toLowerCase()); | |
| 22 | } | |
| 23 | ||
| Initial g1t: services, event bus, intents and attempts | 24 | export function isValidNamespace(value: string): boolean { |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 25 | return NAMESPACE.test(value) && !isReservedName(value); |
| Initial g1t: services, event bus, intents and attempts | 26 | } |
| 27 | ||
| 28 | export function isValidRepoName(value: string): boolean { | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 29 | return ( |
| 30 | REPO_NAME.test(value) && | |
| 31 | !value.startsWith(".") && | |
| 32 | !value.endsWith(".git") && | |
| 33 | // `/<workspace>/-/…` holds the workspace's own pages. | |
| 34 | value !== "-" | |
| 35 | ); | |
| Initial g1t: services, event bus, intents and attempts | 36 | } |