UNPKG

bc-code-intelligence-mcp

Version:

BC Code Intelligence MCP Server - Complete Specialist Bundle with AI-driven expert consultation, seamless handoffs, and context-preserving workflows

135 lines 4.09 kB
/** * Enhanced Layer Service * * Central service for managing and resolving knowledge from multiple layers. * Supports configuration-driven layer loading with git repositories, * handles layer initialization, topic resolution with override logic, and * provides unified access to layered knowledge system. */ import { AtomicTopic, TopicSearchParams, TopicSearchResult } from '../types/bc-knowledge.js'; import { IKnowledgeLayer, LayerLoadResult, LayerResolutionResult, LayerSystemConfig } from '../types/layer-types.js'; import { BCCodeIntelConfiguration, ConfigLayerLoadResult } from '../types/index.js'; import { SessionStorageConfig } from '../types/session-types.js'; export declare class LayerService { private readonly embeddedPath; private readonly projectPath; private readonly config; private layers; private initialized; private loadResults; private topicCache; private searchIndex; private cacheManager; constructor(embeddedPath?: string, projectPath?: string, config?: Partial<LayerSystemConfig>); /** * Initialize layers from BCKB configuration */ initializeFromConfiguration(config: BCCodeIntelConfiguration): Promise<ConfigLayerLoadResult[]>; /** * Initialize the default layer stack (legacy method) */ private initializeLayers; /** * Initialize all layers */ initialize(): Promise<LayerLoadResult[]>; /** * Initialize a single layer */ private initializeLayer; /** * Create a layer from configuration */ private createLayerFromConfig; /** * Get location string for a layer configuration */ private getLayerLocation; /** * Build resolution index after configuration-based initialization */ private buildResolutionIndex; /** * Get session storage configuration from layers * Higher priority layers override lower priority ones */ getSessionStorageConfig(): SessionStorageConfig | undefined; /** * Build unified search index across all layers */ private buildUnifiedSearchIndex; /** * Resolve a topic with layer override logic */ resolveTopic(topicId: string): Promise<LayerResolutionResult | null>; /** * Get all available topic IDs from all layers */ getAllTopicIds(): string[]; /** * Search topics across all layers */ searchTopics(params: TopicSearchParams): Promise<TopicSearchResult[]>; /** * Get layer statistics */ getLayerStatistics(): { layers: import("../types/layer-types.js").LayerStatistics[]; total: { layers: number; totalTopics: number; totalIndexes: number; memoryUsage: number; }; }; /** * Get topics that are overridden in higher layers */ getOverriddenTopics(): { [topicId: string]: LayerResolutionResult; }; /** * Refresh layer cache (useful for development) */ refreshCache(): Promise<void>; /** * Get cache statistics for monitoring */ getCacheStats(): { advanced_cache_enabled: boolean; } | { hits: number; misses: number; evictions: number; total_requests: number; hit_rate: number; memory_usage_bytes: number; cache_size: number; advanced_cache_enabled: boolean; }; /** * Get a specific layer by name */ getLayer(layerName: string): IKnowledgeLayer | null; /** * Get all layers */ getLayers(): IKnowledgeLayer[]; private getTopicLayer; private getTopicFromLayer; private topicToSearchResult; private filterByBCVersion; /** * Get source type for cache TTL determination */ private getSourceTypeForLayer; /** * Get all topics from all layers with resolution applied */ getAllResolvedTopics(): Promise<AtomicTopic[]>; /** * Warm up cache with frequently accessed topics */ private warmUpCache; } //# sourceMappingURL=layer-service.d.ts.map