/**
 * GitHub Repository Service Interface
 *
 * Output port for GitHub repository operations via the gh CLI.
 * Implementations manage authentication checks, repository cloning,
 * user repository listing, and GitHub URL parsing.
 */
// ---------------------------------------------------------------------------
// Error classes
// ---------------------------------------------------------------------------
/**
 * Thrown when the GitHub CLI is not authenticated.
 */
export class GitHubAuthError extends Error {
    constructor(message, cause) {
        super(message);
        this.name = 'GitHubAuthError';
        Object.setPrototypeOf(this, new.target.prototype);
        if (cause)
            this.cause = cause;
    }
}
/**
 * Thrown when a `gh repo clone` operation fails.
 */
export class GitHubCloneError extends Error {
    constructor(message, cause) {
        super(message);
        this.name = 'GitHubCloneError';
        Object.setPrototypeOf(this, new.target.prototype);
        if (cause)
            this.cause = cause;
    }
}
/**
 * Thrown when a GitHub URL cannot be parsed into owner/repo.
 */
export class GitHubUrlParseError extends Error {
    constructor(message, cause) {
        super(message);
        this.name = 'GitHubUrlParseError';
        Object.setPrototypeOf(this, new.target.prototype);
        if (cause)
            this.cause = cause;
    }
}
/**
 * Thrown when listing the user's GitHub repositories fails.
 */
export class GitHubRepoListError extends Error {
    constructor(message, cause) {
        super(message);
        this.name = 'GitHubRepoListError';
        Object.setPrototypeOf(this, new.target.prototype);
        if (cause)
            this.cause = cause;
    }
}
/**
 * Thrown when checking the viewer's permission on a repository fails.
 */
export class GitHubPermissionError extends Error {
    constructor(message, cause) {
        super(message);
        this.name = 'GitHubPermissionError';
        Object.setPrototypeOf(this, new.target.prototype);
        if (cause)
            this.cause = cause;
    }
}
/**
 * Thrown when a fork operation fails.
 */
export class GitHubForkError extends Error {
    constructor(message, cause) {
        super(message);
        this.name = 'GitHubForkError';
        Object.setPrototypeOf(this, new.target.prototype);
        if (cause)
            this.cause = cause;
    }
}
