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

173 lines 4.31 kB
/** * Layer System Types * * Defines interfaces for the layered knowledge architecture where different * sources can provide and override knowledge content. */ import { AtomicTopic } from './bc-knowledge.js'; import { SessionStorageConfig } from './session-types.js'; /** * Layer priorities - lower numbers = higher priority (override earlier layers) */ export declare const enum LayerPriority { EMBEDDED = 0,// Embedded knowledge from submodule (base layer) COMPANY = 100,// Company-wide standards from git repo TEAM = 200,// Team-specific overrides from git repo PROJECT = 300 } /** * Layer source configuration */ export interface LayerSource { name: string; priority: LayerPriority; type: 'embedded' | 'git' | 'local' | 'http'; enabled: boolean; } /** * Embedded layer source (git submodule) */ export interface EmbeddedLayerSource extends LayerSource { type: 'embedded'; path: string; } /** * Git repository layer source */ export interface GitLayerSource extends LayerSource { type: 'git'; url: string; branch?: string; path?: string; credentials?: { username?: string; token?: string; }; } /** * Local directory layer source */ export interface LocalLayerSource extends LayerSource { type: 'local'; path: string; } /** * HTTP endpoint layer source */ export interface HttpLayerSource extends LayerSource { type: 'http'; baseUrl: string; headers?: Record<string, string>; } /** * Union of all layer source types */ export type AnyLayerSource = EmbeddedLayerSource | GitLayerSource | LocalLayerSource | HttpLayerSource; /** * Layer resolution result */ export interface LayerResolutionResult { topic: AtomicTopic; sourceLayer: string; isOverride: boolean; overriddenLayers: string[]; } /** * Layer loading result */ export interface LayerLoadResult { layerName: string; success: boolean; topicsLoaded: number; indexesLoaded: number; error?: string; loadTimeMs: number; } /** * Base interface for knowledge layer implementations */ export interface IKnowledgeLayer { readonly name: string; readonly priority: LayerPriority; readonly enabled: boolean; /** * Initialize the layer (load topics, indexes, etc.) */ initialize(): Promise<LayerLoadResult>; /** * Check if the layer has a specific topic */ hasTopic(topicId: string): boolean; /** * Get a topic from this layer */ getTopic(topicId: string): Promise<AtomicTopic | null>; /** * 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 */ searchTopics(query: string, limit?: number): AtomicTopic[]; /** * Get layer statistics */ getStatistics(): LayerStatistics; /** * Cleanup resources */ dispose(): Promise<void>; } /** * Layer statistics */ export interface LayerStatistics { name: string; priority: LayerPriority; enabled: boolean; topicCount: number; indexCount: number; lastLoaded?: Date; loadTimeMs?: number; memoryUsage?: { topics: number; indexes: number; total: number; }; } /** * Layer system configuration */ export interface LayerSystemConfig { layers: AnyLayerSource[]; defaultSearchLimit: number; cacheEnabled: boolean; cacheTtlMs: number; enableParallelLoading: boolean; loadTimeoutMs: number; sessionStorage?: SessionStorageConfig; } /** * Override resolution strategy */ export declare const enum OverrideStrategy { REPLACE = "replace",// Higher priority layer completely replaces lower MERGE_CONTENT = "merge_content",// Merge markdown content sections MERGE_FRONTMATTER = "merge_frontmatter",// Merge YAML frontmatter fields APPEND_CONTENT = "append_content" } /** * Override configuration for specific topics or domains */ export interface OverrideConfig { topicPattern?: string; domain?: string; strategy: OverrideStrategy; preserveOriginal?: boolean; } //# sourceMappingURL=layer-types.d.ts.map