UNPKG

@memory-bank/mcp

Version:

Memory-enabled Co-Pilot (MCP) server for managing project documentation and context

134 lines 4.94 kB
import type { GlobalTagIndex } from '@memory-bank/schemas'; export interface TagIndex { schema: string; metadata: { updatedAt: string; documentCount: number; fullRebuild: boolean; context: string; }; index: Record<string, string[]>; } import { DocumentPath } from '../../../domain/entities/DocumentPath.js'; import { MemoryDocument } from '../../../domain/entities/MemoryDocument.js'; import { Tag } from '../../../domain/entities/Tag.js'; import type { IGlobalMemoryBankRepository } from '../../../domain/repositories/IGlobalMemoryBankRepository.js'; import type { IConfigProvider } from '../../config/index.js'; import type { IFileSystemService } from '../../storage/interfaces/IFileSystemService.js'; import { FileSystemMemoryBankRepositoryBase } from './FileSystemMemoryBankRepositoryBase.js'; /** * File system implementation of global memory bank repository * Using component-based approach with responsibility segregation */ export declare class FileSystemGlobalMemoryBankRepository extends FileSystemMemoryBankRepositoryBase implements IGlobalMemoryBankRepository { protected readonly configProvider: IConfigProvider; private readonly componentLogger; private readonly documentOps; private readonly tagOps; private readonly pathOps; private readonly bulkOps; private globalMemoryPath; private language; /** * Constructor * @param fileSystemService File system service * @param configProvider Configuration provider */ constructor(fileSystemService: IFileSystemService, configProvider: IConfigProvider); /** * Ensure default structure exists */ private ensureDefaultStructure; /** * Get document from global memory bank * @param path Document path * @returns Promise resolving to document if found, null otherwise */ getDocument(path: DocumentPath): Promise<MemoryDocument | null>; /** * Save document to global memory bank * @param document Document to save * @returns Promise resolving when done */ saveDocument(document: MemoryDocument): Promise<void>; /** * Delete document from global memory bank * @param path Document path * @returns Promise resolving to boolean indicating success */ deleteDocument(path: DocumentPath): Promise<boolean>; /** * List all documents in global memory bank * @returns Promise resolving to array of document paths */ listDocuments(): Promise<DocumentPath[]>; /** * Find documents by tags in global memory bank * @param tags Tags to search for * @returns Promise resolving to array of matching documents */ findDocumentsByTags(tags: Tag[]): Promise<MemoryDocument[]>; /** * Refresh all tag indexes (internal helper) */ private refreshTagIndex; /** * Validate global memory bank structure * @returns Promise resolving to boolean indicating if structure is valid */ validateStructure(): Promise<boolean>; /** * Save tag index for global memory bank * @param tagIndex Tag index to save * @returns Promise resolving when done */ saveTagIndex(tagIndex: GlobalTagIndex): Promise<void>; /** * Get tag index for global memory bank * @returns Promise resolving to tag index if found, null otherwise */ getTagIndex(): Promise<GlobalTagIndex | null>; /** * Update tags index in global memory bank (legacy method) * @returns Promise resolving when done * @deprecated Use saveTagIndex instead */ updateTagsIndex(): Promise<void>; /** * Find documents by tags in global memory bank using index * @param tags Tags to search for * @param matchAll If true, documents must have all tags (AND); if false, any tag (OR) * @returns Promise resolving to array of document paths */ findDocumentPathsByTagsUsingIndex(tags: Tag[], matchAll?: boolean): Promise<DocumentPath[]>; /** * Setup repository with configuration * This should be called before using the repository */ private setup; /** * Get default templates based on current language */ private get defaultStructure(); /** * Get English templates for default structure * @returns Record of file paths to template content */ private getEnglishTemplates; /** * Get Japanese templates for default structure * @returns Record of file paths to template content */ private getJapaneseTemplates; /** * Get Chinese templates for default structure * @returns Record of file paths to template content */ private getChineseTemplates; /** * Initialize global memory bank * @returns Promise resolving when initialization is complete */ initialize(): Promise<void>; } //# sourceMappingURL=FileSystemGlobalMemoryBankRepository.d.ts.map