// Package vcs defines the shared VCS client interface and supporting types. // Platform adapters (gitea, github) implement these interfaces so the core // review logic can work with any VCS platform without platform-specific code. package vcs import "context" // PRReader can fetch pull request metadata, diffs, and changed files. type PRReader interface { GetPullRequest(ctx context.Context, owner, repo string, number int) (*PullRequest, error) GetPullRequestDiff(ctx context.Context, owner, repo string, number int) (string, error) GetPullRequestFiles(ctx context.Context, owner, repo string, number int) ([]ChangedFile, error) } // FileReader can fetch file contents and list directory entries. type FileReader interface { GetFileContent(ctx context.Context, owner, repo, path, ref string) (string, error) ListContents(ctx context.Context, owner, repo, path string) ([]ContentEntry, error) } // Reviewer can post, list, and delete pull request reviews. type Reviewer interface { PostReview(ctx context.Context, owner, repo string, number int, req ReviewRequest) (*Review, error) ListReviews(ctx context.Context, owner, repo string, number int) ([]Review, error) DeleteReview(ctx context.Context, owner, repo string, number int, reviewID int64) error } // Identity can report who the authenticated user is. type Identity interface { GetAuthenticatedUser(ctx context.Context) (string, error) } // Client is the full VCS interface: PR reads, file reads, review management, and identity. // Platform adapters (gitea, github) implement this interface. type Client interface { PRReader FileReader Reviewer Identity }