/** * Pull Request Repository Interface. * * Unlike Memory/Task repositories which use MCP for writes, * the PR repository writes directly to Neo4j for immediate persistence. * * PRs are user-scoped (group_id: "user:") not project-scoped. * * @see .dev/features/github-pr.md for full specification */ import type { IPullRequest, IGitHubIssue, IPrCheck, IPrComment, IPullRequestInput, IGitHubIssueInput, IPullRequestWithRelations } from '../types/IPullRequest'; /** * Query options for PR repository. */ export interface IPullRequestQueryOptions { readonly limit?: number; readonly offset?: number; readonly repo?: string; } /** * Result from PR queries. */ export interface IPullRequestQueryResult { readonly items: readonly IPullRequest[]; readonly hasMore: boolean; } /** * Reader interface for PR repository. */ export interface IPullRequestRepositoryReader { /** * Get the user ID for PR storage (from git config). * Returns format: "user:" */ getUserId(): Promise; /** * Find a specific PR. */ findPr(userId: string, repo: string, prNumber: number): Promise; /** * Find all watched PRs for a user. */ findWatchedPrs(userId: string, options?: IPullRequestQueryOptions): Promise; /** * Find a specific issue. */ findIssue(userId: string, repo: string, issueNumber: number): Promise; /** * Find all issues linked to a PR. */ findIssuesByPr(userId: string, repo: string, prNumber: number): Promise; /** * Find all PRs that close an issue. */ findPrsByIssue(userId: string, repo: string, issueNumber: number): Promise; /** * Find all checks for a PR. */ findChecksByPr(userId: string, repo: string, prNumber: number): Promise; /** * Find all comments for a PR. */ findCommentsByPr(userId: string, repo: string, prNumber: number): Promise; /** * Get PR with all related entities (issues, checks, comments). */ getPrWithRelations(userId: string, repo: string, prNumber: number): Promise; } /** * Writer interface for PR repository. */ export interface IPullRequestRepositoryWriter { /** * Create or update a PR. */ upsertPr(userId: string, pr: IPullRequestInput): Promise; /** * Create or update an issue. */ upsertIssue(userId: string, issue: IGitHubIssueInput): Promise; /** * Create or update a check. */ upsertCheck(userId: string, repo: string, prNumber: number, check: Omit): Promise; /** * Create or update a comment. */ upsertComment(userId: string, repo: string, prNumber: number, comment: Omit): Promise; /** * Link a PR to issues (creates CLOSES relationships). */ linkPrToIssues(userId: string, repo: string, prNumber: number, issueNumbers: readonly number[]): Promise; /** * Update PR watching status. */ setWatching(userId: string, repo: string, prNumber: number, watching: boolean): Promise; /** * Update PR poll timestamp. */ updateLastPolled(userId: string, repo: string, prNumber: number): Promise; /** * Delete a PR and its relationships. */ deletePr(userId: string, repo: string, prNumber: number): Promise; } /** * Capabilities interface for PR repository. */ export interface IPullRequestRepositoryCapabilities { /** * PR repository supports writes (unlike read-only Memory/Task Neo4j repos). */ supportsWrite(): boolean; /** * PR repository supports relationship queries. */ supportsRelationships(): boolean; } /** * Full PR repository interface. */ export interface IPullRequestRepository extends IPullRequestRepositoryReader, IPullRequestRepositoryWriter, IPullRequestRepositoryCapabilities { } //# sourceMappingURL=IPullRequestRepository.d.ts.map