import { type GitHubRemoteIdentity } from './identity.js'; import { type ShellRunner } from '../../lib/shell.js'; export interface GitHubSourceRemote extends GitHubRemoteIdentity { url: string; } export declare const DEFAULT_VERCEL_SANDBOX_CWD = "/vercel/sandbox"; /** * Git sources are seeded by @vercel/sandbox below the session's default cwd * using the normalized repository name. Keep every command and terminal in * that same directory, including after a resumed session. */ export declare function resolveVercelRepositoryCwd(sandboxCwd: string | undefined, normalizedRepository: string): string; export type GitHubSourceErrorCode = 'github_origin_resolution_failed' | 'github_origin_invalid' | 'github_credentials_unavailable' | 'github_branch_invalid' | 'github_source_access_denied' | 'github_source_resolution_failed' | 'github_default_branch_unavailable' | 'github_branch_probe_failed'; export declare class GitHubSourceError extends Error { readonly operation: "source"; readonly code: GitHubSourceErrorCode; readonly status?: number; constructor(code: GitHubSourceErrorCode, message: string, status?: number); } export interface GitSource { type: 'git'; url: string; revision: string; username: 'x-access-token'; password: string; } export interface GitHubSourcePlan { remote: GitHubSourceRemote; defaultBranch: string; requestedBranch: string; requestedBranchExists: boolean; needsBranchSetup: boolean; source: GitSource; warning: string; } export interface ResolveGitHubSourceOptions { repoRoot: string; branch: string; env?: Record; shellRunner?: ShellRunner; } export interface ResolveGitHubTokenOptions { repoRoot: string; env?: Record; shellRunner?: ShellRunner; } export interface ResolveGitHubSourceOriginOptions { repoRoot: string; env?: Record; shellRunner?: ShellRunner; } /** Resolve only the local canonical GitHub origin; no remote branch or token query is made. */ export declare function resolveGitHubSourceOrigin(options: ResolveGitHubSourceOriginOptions): Promise; /** Normalize an origin accepted by the remote-first GitHub provider. */ export declare function normalizeGitHubSourceRemote(remote: string): GitHubSourceRemote; export declare const REMOTE_SOURCE_WARNING = "Vercel uses the authenticated GitHub origin; local dirty files and unpushed commits are not copied to the cloud sandbox."; export declare function renderRemoteSourceNotice(): string; export declare function resolveGitHubToken(options: ResolveGitHubTokenOptions): Promise; export declare function resolveGitHubSource(options: ResolveGitHubSourceOptions): Promise; export declare function parseRemoteDefaultBranch(output: string): string; export declare function remoteBranchOutputContains(output: string, branch: string): boolean; export interface GitHubRevisionSelection { revision: string; requestedBranch: string; defaultBranch: string; needsBranchSetup: boolean; } export declare function selectGitHubRevision(input: { requestedBranch: string; defaultBranch: string; requestedBranchExists: boolean; }): GitHubRevisionSelection; export declare function normalizeRequestedSourceBranch(branch: string): string;