/** * @fractary/faber - Repo Manager * * High-level repository operations combining Git CLI and platform APIs. */ import { RepoConfig, Branch, BranchCreateOptions, BranchDeleteOptions, BranchListOptions, BranchForwardOptions, BranchForwardResult, Commit, CommitOptions, CommitListOptions, GitStatus, PullRequest, PRCreateOptions, PRUpdateOptions, PRListOptions, PRMergeOptions, PRReviewOptions, Tag, TagCreateOptions, TagListOptions, Worktree, WorktreeCreateOptions, WorktreeCleanupOptions, PushOptions, PullOptions } from '../common/types'; import { WorktreeCleanupResult, DiffOptions } from './types'; /** * Repository Manager * * Combines local Git operations with remote platform operations. */ export declare class RepoManager { private git; private provider; private config; private cwd; constructor(config?: RepoConfig, cwd?: string); /** * Load repo configuration from project * * Transforms the YAML handler-based config format into the flat RepoConfig * that the rest of the class expects. */ private loadConfig; /** * Get the current platform */ get platform(): string; /** * Get repository status */ getStatus(): GitStatus; /** * Get current branch name */ getCurrentBranch(): string; /** * Check if working directory has uncommitted changes */ isDirty(): boolean; /** * Check if working directory is clean */ isClean(): boolean; /** * Get diff */ getDiff(options?: DiffOptions): string; /** * Get the branch name for a specific environment * * @param envId Environment identifier (e.g., "production", "test", "staging") * @returns Branch name or undefined if environment is not configured */ getBranchForEnvironment(envId: string): string | undefined; /** * Get the environment ID for a given branch name * * @param branchName The branch name to look up * @returns Environment ID (e.g., "production") or undefined */ getEnvironmentForBranch(branchName: string): string | undefined; /** * Check if the current branch is an environment branch (production, test, etc.) */ isEnvironmentBranch(branchName?: string): boolean; /** * Create a new branch */ createBranch(name: string, options?: BranchCreateOptions): Promise; /** * Delete a branch */ deleteBranch(name: string, options?: BranchDeleteOptions): Promise; /** * List branches */ listBranches(options?: BranchListOptions): Promise; /** * Get a specific branch */ getBranch(name: string): Promise; /** * Checkout a branch */ checkout(branch: string): void; /** * Stage files */ stage(patterns: string[]): void; /** * Stage all changes */ stageAll(): void; /** * Unstage files */ unstage(patterns: string[]): void; /** * Create a commit */ commit(options: CommitOptions): Commit; /** * Get a commit by ref */ getCommit(ref: string): Commit; /** * List commits */ listCommits(options?: CommitListOptions): Commit[]; /** * Push to remote */ push(options?: PushOptions): void; /** * Pull from remote */ pull(options?: PullOptions): void; /** * Fetch from remote */ fetch(remote?: string): void; /** * Create a pull request */ createPR(options: PRCreateOptions): Promise; /** * Get a pull request */ getPR(number: number): Promise; /** * Get CI check statuses for a pull request. * Returns an empty array if the provider does not support this. */ getPRCheckStatuses(number: number): Promise<{ name: string; status: string; conclusion: string | null; }[]>; /** * Update a pull request */ updatePR(number: number, options: PRUpdateOptions): Promise; /** * List pull requests */ listPRs(options?: PRListOptions): Promise; /** * Merge a pull request */ mergePR(number: number, options?: PRMergeOptions): Promise; /** * Add a comment to a pull request */ addPRComment(number: number, body: string): Promise; /** * Request review on a pull request */ requestReview(number: number, reviewers: string[]): Promise; /** * Approve a pull request */ approvePR(number: number, comment?: string): Promise; /** * Review a pull request */ reviewPR(number: number, options: PRReviewOptions): Promise; /** * Forward (merge) a source branch into a target branch. * The source branch and any open PRs remain untouched. */ forwardBranch(options: BranchForwardOptions): Promise; /** * Create a tag */ createTag(name: string, options?: TagCreateOptions): void; /** * Delete a tag */ deleteTag(name: string): void; /** * Push a tag */ pushTag(name: string, remote?: string): void; /** * List tags */ listTags(options?: TagListOptions): Tag[]; /** * Create a worktree */ createWorktree(options: WorktreeCreateOptions): Worktree; /** * List worktrees */ listWorktrees(): Worktree[]; /** * Remove a worktree */ removeWorktree(path: string, force?: boolean): void; /** * Prune stale worktrees */ pruneWorktrees(): void; /** * Cleanup worktrees */ cleanupWorktrees(options?: WorktreeCleanupOptions): Promise; /** * Generate a semantic branch name */ generateBranchName(options: { type: 'feature' | 'fix' | 'chore' | 'docs' | 'refactor'; description: string; workId?: string; }): string; /** * Get organization name from git remote * * Extracts the organization name from the git remote URL. * Falls back to 'local' if no remote or extraction fails. * * @returns Organization name or 'local' */ getOrganization(): Promise; /** * Get project name from git remote or directory * * Extracts the project name from the git remote URL. * Falls back to directory basename if no remote. * * @returns Project name */ getProjectName(): Promise; } //# sourceMappingURL=manager.d.ts.map