/** * Diagnose GitHub "create" failures that are really auth/access problems. * * GitHub returns **404 Not Found** (not 403) when a token's account cannot even * SEE a repo — so a token in `.env` whose account lacks write access to the * target repo surfaces as a confusing `gh: Not Found (HTTP 404)` at * issue/milestone create. This module turns that into a clear, actionable error * naming the token's account and the repo it can't write. */ export interface GitHubAccessFacts { /** Login of the account the token belongs to, or null if the token is invalid. */ login: string | null; /** Whether that account can push to owner/repo; null when it couldn't be determined. */ canPush: boolean | null; owner: string; repo: string; } /** Minimal exec-result shape (matches execFileNoThrow / execWithBudget). */ export interface ExecResult { stdout: string; stderr: string; exitCode: number; } export type ExecFn = (command: string, args: string[], options?: { env?: NodeJS.ProcessEnv; }) => Promise; /** * True if a gh CLI error string looks like an access/permission failure. * 404 Not Found is included on purpose: GitHub masks "no access" as 404. */ export declare function isLikelyAccessError(raw: string | undefined): boolean; /** * Build a clear, actionable error message for a failed GitHub create, or null * when the failure is not an auth/access problem (callers then fall back to the * raw error). Returns null when the token's account demonstrably CAN push, so a * genuine missing resource isn't misreported as an auth issue. */ export declare function explainGitHubAccessError(rawError: string, facts: GitHubAccessFacts): string | null; /** * Resolve the token account's login + whether it can push to owner/repo, using * the gh CLI with the same token env the failing call used. Best-effort: any * probe that fails leaves its field null/false instead of throwing. */ export declare function resolveGitHubAccessFacts(exec: ExecFn, env: NodeJS.ProcessEnv | undefined, owner: string, repo: string): Promise<{ login: string | null; canPush: boolean | null; }>; //# sourceMappingURL=github-access-error.d.ts.map