@memory-bank/mcp
Version:
Memory-enabled Co-Pilot (MCP) server for managing project documentation and context
143 lines • 5.48 kB
TypeScript
import { BranchInfo } from '../../../domain/entities/BranchInfo.js';
import { DocumentPath } from '../../../domain/entities/DocumentPath.js';
import type { IFileSystemService } from '../../storage/interfaces/IFileSystemService.js';
import type { IConfigProvider } from '../../config/index.js';
import { FileSystemMemoryBankRepositoryBase } from './FileSystemMemoryBankRepositoryBase.js';
/**
* Component responsible for path-related operations
*/
export declare class PathOperations extends FileSystemMemoryBankRepositoryBase {
private readonly basePath;
protected readonly configProvider: IConfigProvider;
/**
* Constructor
* @param basePath Base path
* @param fileSystemService File system service
* @param configProvider Configuration provider
*/
constructor(basePath: string, fileSystemService: IFileSystemService, configProvider: IConfigProvider);
/**
* Get the base path for a branch
* @param branchInfo Branch information
* @returns Base path for the branch
*/
getBranchBasePath(_branchInfo: BranchInfo): string;
/**
* Get the global base path
* @returns Global base path
*/
getGlobalBasePath(): string;
/**
* Resolve a path
* @param documentPath Document path
* @returns Full file path
*/
resolvePath(documentPath: string): string;
/**
* Resolve a branch path
* @param branchInfo Branch information
* @param documentPath Document path
* @returns Full file path
*/
resolveBranchPath(branchInfo: BranchInfo, documentPath: string): string;
/**
* Resolve a path using a specified base path
* @param basePath Base path
* @param documentPath Document path
* @returns Full file path
*/
private resolvePathWithBase;
/**
* Check if a path exists
* @param documentPath Document path
* @returns true if the path exists, false otherwise
*/
exists(documentPath: string): Promise<boolean>;
/**
* Check if a branch path exists
* @param branchInfo Branch information
* @param documentPath Document path
* @returns true if the path exists, false otherwise
*/
branchPathExists(branchInfo: BranchInfo, documentPath: string): Promise<boolean>;
/**
* Create a directory
* @param directoryPath Directory path
*/
createDirectory(directoryPath: string): Promise<void>;
/**
* Create a branch directory
* @param branchInfo Branch information
* @param directoryPath Directory path
*/
createBranchDirectory(branchInfo: BranchInfo, directoryPath: string): Promise<void>;
/**
* Check if a directory exists
* @param directoryPath Directory path
* @returns true if the directory exists, false otherwise
*/
directoryExists(directoryPath: string): Promise<boolean>;
/**
* Check if a branch directory exists
* @param branchInfo Branch information
* @param directoryPath Directory path
* @returns true if the directory exists, false otherwise
*/
branchDirectoryExists(branchInfo: BranchInfo, directoryPath: string): Promise<boolean>;
/**
* Get a list of files
* @param directoryPath Directory path
* @returns Array of file paths
*/
listFiles(directoryPath: string): Promise<string[]>;
/**
* Get a list of files in a branch
* @param branchInfo Branch information
* @param directoryPath Directory path
* @returns Array of file paths
*/
listBranchFiles(branchInfo: BranchInfo, directoryPath: string): Promise<string[]>;
/**
* Copy a file
* @param sourcePath Source path
* @param destinationPath Destination path
*/
copyFile(sourcePath: string, destinationPath: string): Promise<void>;
/**
* Copy a file between branches
* @param sourceBranchInfo Source branch information
* @param sourcePath Source path
* @param destinationBranchInfo Destination branch information
* @param destinationPath Destination path
*/
copyFileBetweenBranches(sourceBranchInfo: BranchInfo, sourcePath: string, destinationBranchInfo: BranchInfo, destinationPath: string): Promise<void>;
/**
* Move a file
* @param sourcePath Source path
* @param destinationPath Destination path
*/
moveFile(sourcePath: string, destinationPath: string): Promise<void>;
/**
* Move a file between branches
* @param sourceBranchInfo Source branch information
* @param sourcePath Source path
* @param destinationBranchInfo Destination branch information
* @param destinationPath Destination path
*/
moveFileBetweenBranches(sourceBranchInfo: BranchInfo, sourcePath: string, destinationBranchInfo: BranchInfo, destinationPath: string): Promise<void>;
/**
* Get a list of files within a specified directory
* @param directoryPath Directory path
* @param allowedExtensions Array of allowed extensions (optional, defaults to all files)
* @returns Array of file paths
*/
listFilesInDirectory(directoryPath: string, allowedExtensions?: string[]): Promise<string[]>;
/**
* Filter an array of DocumentPaths
* @param paths Array of DocumentPaths
* @param pattern Filter pattern (glob-like)
* @returns Filtered array of DocumentPaths
*/
filterPaths(paths: DocumentPath[], pattern: string): DocumentPath[];
}
//# sourceMappingURL=PathOperations.d.ts.map