bc-code-intelligence-mcp
Version:
BC Code Intelligence MCP Server - Complete Specialist Bundle with AI-driven expert consultation, seamless handoffs, and context-preserving workflows
175 lines • 5.41 kB
TypeScript
/**
* BC Code Intelligence MCP Client SDK
*
* TypeScript/JavaScript SDK for connecting to BC Code Intelligence MCP servers
* with full type safety, intelligent caching, and developer-friendly APIs.
*/
import { EventEmitter } from 'events';
export interface BCCodeIntelClientConfig {
server_command: string;
server_args?: string[];
auto_reconnect?: boolean;
request_timeout_ms?: number;
cache_enabled?: boolean;
cache_ttl_seconds?: number;
debug_logging?: boolean;
}
export interface TopicSearchOptions {
tags?: string[];
domain?: string;
difficulty?: 'beginner' | 'intermediate' | 'advanced' | 'expert';
code_context?: string;
bc_version?: string;
limit?: number;
}
export interface SmartSearchOptions extends TopicSearchOptions {
user_context?: {
current_domain?: string;
difficulty_preference?: 'beginner' | 'intermediate' | 'advanced' | 'expert';
recent_topics?: string[];
project_type?: 'new' | 'maintenance' | 'optimization' | 'migration';
};
include_layer_info?: boolean;
layer_filter?: string[];
}
export interface BCCodeIntelTopic {
id: string;
title: string;
domain: string;
difficulty: string;
tags: string[];
prerequisites: string[];
related_topics: string[];
bc_versions: string;
estimated_time?: string;
content: string;
word_count: number;
last_modified: string;
relevance_score?: number;
samples?: {
file_path: string;
code: string;
};
layer_info?: {
source_layer: string;
is_override: boolean;
overridden_count: number;
};
relevance_reasons?: string[];
recommendation_strength?: 'high' | 'medium' | 'low';
}
export interface CodeAnalysisOptions {
code_snippet: string;
analysis_type?: 'performance' | 'validation' | 'architecture' | 'general';
suggest_topics?: boolean;
bc_version?: string;
}
export interface SystemStatus {
overall_health: 'healthy' | 'degraded' | 'unhealthy';
configuration_loaded: boolean;
layers_active: number;
total_topics: number;
cache_hit_rate: number;
uptime_seconds: number;
}
export declare class BCCodeIntelClient extends EventEmitter {
private readonly config;
private client;
private transport;
private connected;
private cache;
private reconnectTimer?;
constructor(config: BCCodeIntelClientConfig);
/**
* Connect to the BC Code Intelligence MCP server
*/
connect(): Promise<void>;
/**
* Disconnect from the server
*/
disconnect(): Promise<void>;
/**
* Search for BC knowledge topics
*/
searchTopics(query: string, options?: TopicSearchOptions): Promise<BCCodeIntelTopic[]>;
/**
* Advanced layered search with AI-powered recommendations
*/
smartSearch(query: string, options?: SmartSearchOptions): Promise<BCCodeIntelTopic[]>;
/**
* Get a specific topic by ID
*/
getTopic(topicId: string, includeSamples?: boolean): Promise<BCCodeIntelTopic | null>;
/**
* Analyze AL code and get recommendations
*/
analyzeCode(options: CodeAnalysisOptions): Promise<any>;
/**
* Get optimization workflow for a scenario
*/
getOptimizationWorkflow(scenario: string, constraints?: string[]): Promise<any>;
/**
* Get system status and health information
*/
getSystemStatus(): Promise<SystemStatus>;
/**
* Get layer information and statistics
*/
getLayerInfo(includeStatistics?: boolean): Promise<any>;
/**
* Resolve topic across layers to see override information
*/
resolveTopicLayers(topicId: string): Promise<any>;
/**
* Get comprehensive system analytics
*/
getSystemAnalytics(): Promise<any>;
/**
* Reload server configuration (useful for development)
*/
reloadConfiguration(force?: boolean): Promise<any>;
/**
* Get available MCP tools from the server
*/
getAvailableTools(): Promise<any[]>;
/**
* Health check - verify connection and basic functionality
*/
healthCheck(): Promise<{
healthy: boolean;
latency_ms: number;
error?: string;
}>;
/**
* Batch operations for efficiency
*/
batchGetTopics(topicIds: string[]): Promise<(BCCodeIntelTopic | null)[]>;
/**
* Smart topic recommendations based on current context
*/
getRecommendations(currentTopic: string, maxRecommendations?: number): Promise<any[]>;
/**
* Export client configuration (sanitized)
*/
getClientConfig(): Omit<BCCodeIntelClientConfig, 'debug_logging'>;
/**
* Check if client is connected
*/
isConnected(): boolean;
callTool(toolName: string, args: any): Promise<any>;
private ensureConnected;
private scheduleReconnect;
}
/**
* Convenience factory function for creating BC Code Intelligence clients
*/
export declare function createBCCodeIntelClient(config: BCCodeIntelClientConfig): BCCodeIntelClient;
/**
* Default configuration for common scenarios
*/
export declare const BCCodeIntelClientDefaults: {
local: (serverPath?: string) => BCCodeIntelClientConfig;
development: (serverPath?: string) => BCCodeIntelClientConfig;
production: (serverPath: string) => BCCodeIntelClientConfig;
};
//# sourceMappingURL=bc-code-intel-client.d.ts.map