/** * Base Knowledge Layer * * Abstract base class providing common functionality for all knowledge layer implementations. * ALL layers support three content types: topics, specialists, and methodologies. */ import { AtomicTopic } from '../types/bc-knowledge.js'; import { SpecialistDefinition } from '../services/specialist-loader.js'; import { IKnowledgeLayer, LayerPriority, LayerLoadResult, LayerStatistics } from '../types/layer-types.js'; import { LayerContentType } from '../types/enhanced-layer-types.js'; export declare abstract class BaseKnowledgeLayer implements IKnowledgeLayer { readonly name: string; readonly priority: LayerPriority; readonly enabled: boolean; readonly supported_content_types: LayerContentType[]; protected topics: Map; protected specialists: Map; protected methodologies: Map; protected indexes: Map; protected loadResult: LayerLoadResult | null; protected initialized: boolean; constructor(name: string, priority: LayerPriority, enabled?: boolean); /** * Initialize the layer - must be implemented by subclasses */ abstract initialize(): Promise; /** * Load topics from the layer source - must be implemented by subclasses */ protected abstract loadTopics(): Promise; /** * Load specialists from the layer source - must be implemented by subclasses */ protected abstract loadSpecialists(): Promise; /** * Load methodologies from the layer source - must be implemented by subclasses */ protected abstract loadMethodologies(): Promise; /** * Load indexes from the layer source - must be implemented by subclasses */ protected abstract loadIndexes(): Promise; /** * Check if the layer has a specific topic */ hasTopic(topicId: string): boolean; /** * Get a topic from this layer */ getTopic(topicId: string): Promise; /** * Get a topic from this layer synchronously (for already loaded topics) */ getTopicSync(topicId: string): AtomicTopic | null; /** * Get all topic IDs available in this layer */ getTopicIds(): string[]; /** * Search for topics within this layer using simple text matching */ searchTopics(query: string, limit?: number): AtomicTopic[]; /** * Generic content access methods (for MultiContentLayerService compatibility) */ /** * Check if layer has specific content by type and ID */ hasContent(type: T, id: string): boolean; /** * Get content by type and ID */ getContent(type: T, id: string): Promise; /** * Get all content IDs for a specific type */ getContentIds(type: T): string[]; /** * Search content by type */ searchContent(type: T, query: string, limit?: number): any[]; /** * Search specialists within this layer */ protected searchSpecialists(query: string, limit?: number): SpecialistDefinition[]; /** * Search methodologies within this layer */ protected searchMethodologies(query: string, limit?: number): any[]; /** * Get layer statistics */ getStatistics(): LayerStatistics; /** * Cleanup resources */ dispose(): Promise; /** * Helper to create successful load result */ protected createLoadResult(topicsLoaded: number, indexesLoaded: number, loadTimeMs: number): LayerLoadResult; /** * Helper to create error load result */ protected createErrorResult(error: string, loadTimeMs: number): LayerLoadResult; /** * Estimate memory usage of loaded topics */ private estimateTopicsMemoryUsage; /** * Estimate memory usage of loaded indexes */ private estimateIndexesMemoryUsage; /** * Validate that a topic has required structure */ protected validateTopic(topic: AtomicTopic): boolean; /** * Normalize topic ID for consistent lookup */ protected normalizeTopicId(filePath: string, basePath: string): string; /** * Get layer statistics with content type breakdown */ getEnhancedStatistics(): { name: string; priority: number; content_counts: Record; load_time_ms?: number; initialized: boolean; }; } //# sourceMappingURL=base-layer.d.ts.map