Skip to content

Interface: IVCSProvider

Makaio Framework


Makaio Framework / contracts / IVCSProvider

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:77

VCS provider capability for source control platform integration.

Enables GitHub, GitLab, Bitbucket, and other version control systems to be pluggable providers of VCS functionality.

This interface defines both the core Phase 1 methods and Phase 2 optional extension seams for write operations.

class GitHubVCSProvider implements IVCSProvider {
readonly id = 'github-vcs';
readonly displayName = 'GitHub';
readonly capabilityId = 'vcs';
async getRepository(repoPath: string) {
// Detect GitHub repo and return metadata
}
async getPullRequests(repoPath: string, branch: string) {
// Fetch PRs via GitHub API
}
// Phase 2: Optional write operations
async createPullRequest?(repoPath: string, options: CreatePROptions) {
// Create PR via GitHub API
}
}

readonly capabilityId: "vcs"

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:79

Capability identifier - must be ‘vcs’


readonly displayName: string

Defined in: ../../../packages/contracts/src/capability/types.ts:11

Human-readable name for display in UI

ICapabilityProvider.displayName


readonly id: string

Defined in: ../../../packages/contracts/src/capability/types.ts:9

Unique identifier for this provider instance

ICapabilityProvider.id


readonly optional providerKey?: string

Defined in: ../../../packages/contracts/src/capability/types.ts:17

Stable provider identity used for joins across registries.

Unlike id, this should remain stable across runtime re-registration.

ICapabilityProvider.providerKey

optional createPullRequest(repoPath, options): Promise<{ additions?: number; author: string; baseBranch: string; branch: string; changedFiles?: number; commentCount?: number; createdAt: string; deletions?: number; draft: boolean; head?: { ref: string; sha: string; } | null; id: string; mergedAt: string | null; number: number; reviewCount?: number; state: "merged" | "closed" | "open"; title: string; updatedAt: string; url: string; }>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:168

Create a new pull request (Phase 2).

Optional method for providers that support PR creation.

string

Local filesystem path to the repository

CreatePROptions

PR creation options

Promise<{ additions?: number; author: string; baseBranch: string; branch: string; changedFiles?: number; commentCount?: number; createdAt: string; deletions?: number; draft: boolean; head?: { ref: string; sha: string; } | null; id: string; mergedAt: string | null; number: number; reviewCount?: number; state: "merged" | "closed" | "open"; title: string; updatedAt: string; url: string; }>

Created pull request information


optional createReviewComment(repoPath, prNumber, path, line, commitId, body, side?): Promise<{ author: string; body: string; createdAt: string; diffHunk?: string | null; id: number; inReplyToId: number | null; isResolved?: boolean | null; line: number | null; path: string | null; threadId?: string | null; updatedAt: string; }>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:228

Post a new inline comment on a file:line (Phase 2).

Optional method for providers that support inline code comments.

string

Local filesystem path to the repository

number

Pull request number

string

File path relative to repo root

number

Line number (1-based)

string

Commit SHA the comment refers to

string

Comment body text

"LEFT" | "RIGHT"

Which side of diff (LEFT=base, RIGHT=head)

Promise<{ author: string; body: string; createdAt: string; diffHunk?: string | null; id: number; inReplyToId: number | null; isResolved?: boolean | null; line: number | null; path: string | null; threadId?: string | null; updatedAt: string; }>

Created comment


getChecks(repoPath, commitSha): Promise<object[]>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:133

Get CI/CD check runs for a commit.

Returns the status of CI/CD workflows and checks for a given commit.

string

Local filesystem path to the repository

string

Commit SHA to get checks for

Promise<object[]>

Array of check runs


getPRsForFile(repoPath, filePath): Promise<object[]>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:121

Get open PRs that have changes affecting a specific file.

string

Local filesystem path to the repository

string

Path to file relative to repo root

Promise<object[]>

Array of pull requests affecting the file


getPullRequest(repoPath, prNumber): Promise<{ additions?: number; assignees: string[]; author: string; baseBranch: string; body: string | null; branch: string; changedFiles?: number; commentCount?: number; createdAt: string; deletions?: number; draft: boolean; head?: { ref: string; sha: string; } | null; id: string; labels: string[]; mergeable: boolean | null; mergeableState?: string; mergedAt: string | null; number: number; requestedReviewers: string[]; reviewCount?: number; reviews: object[]; state: "merged" | "closed" | "open"; title: string; updatedAt: string; url: string; }>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:113

Get detailed information about a specific pull request.

Returns full PR details including reviews, labels, and assignees.

string

Local filesystem path to the repository

number

Pull request number

Promise<{ additions?: number; assignees: string[]; author: string; baseBranch: string; body: string | null; branch: string; changedFiles?: number; commentCount?: number; createdAt: string; deletions?: number; draft: boolean; head?: { ref: string; sha: string; } | null; id: string; labels: string[]; mergeable: boolean | null; mergeableState?: string; mergedAt: string | null; number: number; requestedReviewers: string[]; reviewCount?: number; reviews: object[]; state: "merged" | "closed" | "open"; title: string; updatedAt: string; url: string; }>

Detailed pull request information


getPullRequests(repoPath, branch): Promise<object[]>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:103

List pull requests for a repository branch.

Returns summary information for PRs, suitable for list views.

string

Local filesystem path to the repository

string

Branch name to filter by (empty for all branches)

Promise<object[]>

Array of pull request summaries


getRepository(repoPath): Promise<{ defaultBranch?: string; owner: string; provider: string; repo: string; url: string; } | null>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:91

Get repository metadata for a local filesystem path.

Detects if the given path is a VCS repository and returns metadata about the remote repository (provider, owner, repo name, etc.).

string

Local filesystem path to the repository

Promise<{ defaultBranch?: string; owner: string; provider: string; repo: string; url: string; } | null>

Repository metadata, or null if not a VCS repository


getReviewComments(repoPath, prNumber): Promise<object[]>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:156

Get review comments for a pull request.

Returns both inline code comments and general PR comments.

string

Local filesystem path to the repository

number

Pull request number

Promise<object[]>

Array of review comments


getStatuses(repoPath, commitSha): Promise<object[]>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:144

Get commit statuses for a commit (legacy status API).

Returns statuses reported via the commit status API (e.g., CodeRabbit). Distinct from check runs which come from GitHub Actions / Apps.

string

Local filesystem path to the repository

string

Commit SHA to get statuses for

Promise<object[]>

Array of commit statuses


optional getWriteCapability(repoPath): Promise<{ canWrite: boolean; level: "none" | "read" | "triage" | "write" | "maintain" | "admin"; }>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:256

Get write capability level for current user (Phase 2).

Optional method for checking user’s write permissions.

string

Local filesystem path to the repository

Promise<{ canWrite: boolean; level: "none" | "read" | "triage" | "write" | "maintain" | "admin"; }>

Permission capability


optional mergePullRequest(repoPath, prNumber, options?): Promise<void>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:199

Merge a pull request (Phase 2).

Optional method for providers that support PR merging.

string

Local filesystem path to the repository

number

Pull request number

MergeOptions

Merge options

Promise<void>


optional postComment(repoPath, prNumber, body): Promise<{ author: string; body: string; createdAt: string; diffHunk?: string | null; id: number; inReplyToId: number | null; isResolved?: boolean | null; line: number | null; path: string | null; threadId?: string | null; updatedAt: string; }>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:179

Post a comment on a pull request (Phase 2).

Optional method for providers that support posting comments.

string

Local filesystem path to the repository

number

Pull request number

string

Comment body text

Promise<{ author: string; body: string; createdAt: string; diffHunk?: string | null; id: number; inReplyToId: number | null; isResolved?: boolean | null; line: number | null; path: string | null; threadId?: string | null; updatedAt: string; }>

Created comment information


optional replyToComment(repoPath, prNumber, commentId, body): Promise<{ author: string; body: string; createdAt: string; diffHunk?: string | null; id: number; inReplyToId: number | null; isResolved?: boolean | null; line: number | null; path: string | null; threadId?: string | null; updatedAt: string; }>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:213

Reply to an existing review comment (Phase 2).

Optional method for providers that support comment replies.

string

Local filesystem path to the repository

number

Pull request number

number

ID of the comment to reply to

string

Reply body text

Promise<{ author: string; body: string; createdAt: string; diffHunk?: string | null; id: number; inReplyToId: number | null; isResolved?: boolean | null; line: number | null; path: string | null; threadId?: string | null; updatedAt: string; }>

Created reply comment


optional requestReview(repoPath, prNumber, reviewers): Promise<void>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:189

Request reviews from users for a pull request (Phase 2).

Optional method for providers that support review requests.

string

Local filesystem path to the repository

number

Pull request number

string[]

Usernames to request reviews from

Promise<void>


optional resolveThread(repoPath, prNumber, threadId): Promise<void>

Defined in: ../../../packages/contracts/src/capabilities/vcs/types.ts:247

Resolve a review thread (Phase 2).

Optional method for providers that support thread resolution. Uses GraphQL for GitHub (resolveReviewThread mutation).

string

Local filesystem path to the repository

number

Pull request number

string

Thread ID (GraphQL node ID)

Promise<void>


optional validate(): Promise<{ error?: string; valid: boolean; }>

Defined in: ../../../packages/contracts/src/capability/types.ts:22

Optional validation method to check provider configuration/credentials.

Promise<{ error?: string; valid: boolean; }>

Validation result with optional error message

ICapabilityProvider.validate