/** * The `faf git` URL gate and the repo name from a clone URL. No imports: the * fetch entry (faf-cli/fetch) uses these without bundling detection. */ /** * Validate + normalize a GitHub repo reference into a safe clone URL. * * A `faf git` URL is an untrusted CLI/MCP argument. This gate rejects any * shell metacharacter or whitespace, and only ever returns a URL built from a * strict allowlist pattern — defense in depth alongside the no-shell * `execFileSync` clone (which already makes argument injection structurally * impossible). Nothing carrying a metacharacter or control char ever reaches * `git`: metachars are caught here; anything else fails the allowlist below. * * Accepts: * owner/repo · github.com/owner/repo · https://github.com/owner/repo * (optional `.git` suffix, optional trailing slash; full http(s) URLs to * any host pass through with a single `.git` suffix) * * Throws on empty / malformed / unsafe input. */ export declare function normalizeGitUrl(input: string): string; /** The repo name from a normalized clone URL: .../owner/repo.git → repo. */ export declare function repoNameFromUrl(repoUrl: string): string; /** * `owner/repo` for a GitHub remote, or null for any other host or shape: * `https://github.com/o/r(.git)`, `git@github.com:o/r(.git)`, * `ssh://git@github.com/o/r(.git)` and `o/r`. Names use GitHub's characters * only (letters, digits, `.`, `_`, `-`), so the result is safe in an API path. */ export declare function githubRepoOf(remote: string, options?: { urlOnly?: boolean; }): string | null;