@memory-bank/mcp
Version:
Memory-enabled Co-Pilot (MCP) server for managing project documentation and context
55 lines • 2.69 kB
TypeScript
import { BranchInfo } from '../../domain/entities/BranchInfo.js';
import { IDocumentRepository } from '../../domain/repositories/IDocumentRepository.js';
import { IBranchMemoryBankRepository } from '../../domain/repositories/IBranchMemoryBankRepository.js';
import { IGlobalMemoryBankRepository } from '../../domain/repositories/IGlobalMemoryBankRepository.js';
import type { IGitService } from '../../infrastructure/git/IGitService.js';
import type { IConfigProvider } from '../../infrastructure/config/interfaces/IConfigProvider.js';
/**
* Helper service that selects the appropriate repository based on scope and branch name.
* Also handles branch name auto-detection in project mode.
*/
export declare class DocumentRepositorySelector {
private readonly branchRepository;
private readonly globalRepository;
private readonly gitService;
private readonly configProvider;
private readonly componentLogger;
/**
* Constructor
* @param branchRepository Branch memory bank repository
* @param globalRepository Global memory bank repository
* @param gitService Git service for branch detection
* @param configProvider Configuration provider
*/
constructor(branchRepository: IBranchMemoryBankRepository, globalRepository: IGlobalMemoryBankRepository, gitService: IGitService, configProvider: IConfigProvider);
/**
* Get the appropriate repository based on scope and branch name
* @param scope 'branch' or 'global'
* @param branchName Optional branch name (will be auto-detected in project mode if not provided)
* @returns Promise resolving to repository and branch info (if applicable)
* @throws ApplicationError if scope is invalid or branch name cannot be determined
*/
getRepository(scope: 'branch' | 'global', branchName?: string): Promise<{
repository: IDocumentRepository;
branchInfo?: BranchInfo;
}>;
/**
* Create an adapter that implements IDocumentRepository for branch repository
* @param branchInfo Branch information
* @returns IDocumentRepository adapter
*/
private createBranchRepositoryAdapter;
/**
* Create an adapter that implements IDocumentRepository for global repository
* @returns IDocumentRepository adapter
*/
private createGlobalRepositoryAdapter;
/**
* Resolve branch name, auto-detecting from Git in project mode if not provided
* @param branchName Optional branch name
* @returns Promise resolving to branch name
* @throws ApplicationError if branch name cannot be determined
*/
private resolveBranchName;
}
//# sourceMappingURL=DocumentRepositorySelector.d.ts.map