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

198 lines 6.16 kB
/** * Enhanced Multi-Content Layer Service * * Extends the existing layer system to support specialists alongside * atomic topics, enabling companies/teams/projects to have custom specialists * that override or supplement the base specialist personas. */ import { MultiContentKnowledgeLayer, EnhancedLayerLoadResult, SpecialistQueryContext, MultiLayerSpecialistResult, SpecialistResolutionStrategy } from '../types/enhanced-layer-types.js'; import { AtomicTopic, TopicSearchParams, TopicSearchResult } from '../types/bc-knowledge.js'; import { SpecialistDefinition } from './specialist-loader.js'; export declare class MultiContentLayerService { private readonly specialistResolutionStrategy; private layers; private layerPriorities; private contentCache; private initialized; private availableMcps; constructor(specialistResolutionStrategy?: SpecialistResolutionStrategy); /** * Set available MCP servers for conditional topic filtering */ setAvailableMcps(mcps: string[]): void; /** * Get currently available MCP servers */ getAvailableMcps(): string[]; /** * Filter topic based on conditional_mcp frontmatter */ private shouldIncludeTopic; /** * Add a layer to the service */ addLayer(layer: MultiContentKnowledgeLayer): void; /** * Initialize all layers */ initialize(): Promise<Map<string, EnhancedLayerLoadResult>>; /** * Get a specialist by ID with layer resolution */ getSpecialist(specialistId: string): Promise<SpecialistDefinition | null>; /** * Get all specialists across all layers with resolution */ getAllSpecialists(): Promise<SpecialistDefinition[]>; /** * Suggest specialists based on context across all layers */ suggestSpecialists(context: string, queryContext?: SpecialistQueryContext, limit?: number): Promise<MultiLayerSpecialistResult>; /** * Get specialists from a specific layer */ getSpecialistsByLayer(layerName: string): Promise<SpecialistDefinition[]>; /** * Get layer statistics including specialist counts */ getLayerStatistics(): Record<string, any>; /** * Resolve specialist conflicts between layers */ private resolveSpecialistConflict; /** * Merge two specialist definitions */ private mergeSpecialists; /** * Extend specialist with additional capabilities */ private extendSpecialist; /** * Calculate specialist relevance score */ private calculateSpecialistScore; /** * Get match reasons for a specialist suggestion */ private getMatchReasons; /** * Get collaboration options for a specialist */ private getCollaborationOptions; /** * Get cross-layer collaboration opportunities */ private getCrossLayerCollaboration; /** * Find which layer a specialist comes from */ private findSpecialistSourceLayer; /** * Update layer priority ordering */ private updateLayerPriorities; /** * Cache management */ private getCachedContent; private setCachedContent; private clearCache; /** * Search topics across all layers */ searchTopics(params: TopicSearchParams): Promise<TopicSearchResult[]>; /** * Find specialists by query across all layers */ findSpecialistsByQuery(query: string): Promise<SpecialistDefinition[]>; /** * Check if specialist matches query using token-based matching * * Fixes Issue #17: Complex compound questions now tokenized for matching. * Instead of requiring full query as substring, matches any individual token. */ private matchesSpecialistQuery; /** * Ask a specialist a question (simulated consultation) */ askSpecialist(question: string, preferredSpecialist?: string): Promise<any>; /** * Find specialist by ID across all layers */ private findSpecialistById; /** * Check if topic matches search criteria */ private matchesSearchCriteria; /** * Calculate relevance score for topic */ private calculateRelevanceScore; /** * Convert topic to search result */ private topicToSearchResult; /** * Get a specific layer by name (adapted from LayerService) */ getLayer(layerName: string): MultiContentKnowledgeLayer | null; /** * Get all layers (adapted from LayerService) */ getLayers(): MultiContentKnowledgeLayer[]; /** * Get all available topic IDs from all layers (adapted from LayerService) */ getAllTopicIds(): string[]; /** * Resolve a topic with layer override logic (adapted from LayerService) */ resolveTopic(topicId: string): Promise<any | null>; /** * Get all resolved topics (adapted from LayerService) */ getAllResolvedTopics(): Promise<AtomicTopic[]>; /** * Get overridden topics statistics (adapted from LayerService) */ getOverriddenTopics(): any; /** * Get layer statistics - adapts new enhanced statistics to old LayerStatistics format */ getStatistics(): Array<{ name: string; priority: number; enabled: boolean; topicCount: number; indexCount: number; lastLoaded?: Date; loadTimeMs?: number; memoryUsage?: { topics: number; indexes: number; total: number; }; }>; /** * Initialize from configuration (adapted from LayerService) */ initializeFromConfiguration(config: any): Promise<Map<string, EnhancedLayerLoadResult>>; /** * Get session storage configuration (adapted from LayerService) */ getSessionStorageConfig(): any; /** * Refresh cache (adapted from LayerService) */ refreshCache(): Promise<void>; /** * Get cache statistics (adapted from LayerService) */ getCacheStats(): any; /** * Dispose of all layers */ dispose(): Promise<void>; } //# sourceMappingURL=multi-content-layer-service.d.ts.map