from app.git.provider import GitProvider from app.git.types import ProviderKind from .github import GitHubAdapter from .gitlab import GitLabAdapter PROVIDERS: dict[ProviderKind, type[GitProvider]] = { ProviderKind.github: GitHubAdapter, ProviderKind.gitlab: GitLabAdapter, } def get_provider(kind: ProviderKind) -> GitProvider: provider_class = PROVIDERS.get(kind) if provider_class is None: raise ValueError(f"Unsupported provider kind: {kind}") return provider_class()