@juspay/neurolink 5.3.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -2
- package/dist/chat/client-utils.d.ts +3 -0
- package/dist/chat/client-utils.js +22 -5
- package/dist/chat/index.d.ts +4 -7
- package/dist/chat/index.js +0 -8
- package/dist/chat/session-storage.d.ts +2 -2
- package/dist/chat/session.d.ts +4 -3
- package/dist/chat/session.js +1 -1
- package/dist/chat/sse-handler.js +13 -21
- package/dist/chat/types.d.ts +3 -2
- package/dist/chat/websocket-chat-handler.d.ts +4 -3
- package/dist/chat/websocket-chat-handler.js +12 -12
- package/dist/cli/commands/config.d.ts +2 -2
- package/dist/cli/commands/mcp.d.ts +3 -2
- package/dist/cli/commands/mcp.js +39 -29
- package/dist/cli/commands/ollama.js +8 -4
- package/dist/cli/factories/command-factory.d.ts +2 -1
- package/dist/cli/index.js +22 -19
- package/dist/core/analytics.d.ts +3 -2
- package/dist/core/analytics.js +16 -7
- package/dist/core/base-provider.d.ts +35 -7
- package/dist/core/base-provider.js +36 -13
- package/dist/core/defaults.d.ts +2 -1
- package/dist/core/evaluation.d.ts +4 -4
- package/dist/core/evaluation.js +17 -7
- package/dist/core/factory.d.ts +3 -2
- package/dist/core/service-registry.d.ts +4 -4
- package/dist/core/types.d.ts +11 -4
- package/dist/factories/compatibility-factory.d.ts +16 -1
- package/dist/factories/compatibility-factory.js +3 -1
- package/dist/factories/provider-factory.d.ts +5 -4
- package/dist/factories/provider-factory.js +15 -24
- package/dist/factories/provider-generate-factory.js +26 -20
- package/dist/lib/chat/client-utils.d.ts +3 -0
- package/dist/lib/chat/client-utils.js +22 -5
- package/dist/lib/chat/index.d.ts +4 -7
- package/dist/lib/chat/index.js +0 -8
- package/dist/lib/chat/session-storage.d.ts +2 -2
- package/dist/lib/chat/session.d.ts +4 -3
- package/dist/lib/chat/session.js +1 -1
- package/dist/lib/chat/sse-handler.js +13 -21
- package/dist/lib/chat/types.d.ts +3 -2
- package/dist/lib/chat/websocket-chat-handler.d.ts +4 -3
- package/dist/lib/chat/websocket-chat-handler.js +12 -12
- package/dist/lib/core/analytics.d.ts +3 -2
- package/dist/lib/core/analytics.js +16 -7
- package/dist/lib/core/base-provider.d.ts +35 -7
- package/dist/lib/core/base-provider.js +36 -13
- package/dist/lib/core/defaults.d.ts +2 -1
- package/dist/lib/core/evaluation.d.ts +4 -4
- package/dist/lib/core/evaluation.js +17 -7
- package/dist/lib/core/factory.d.ts +3 -2
- package/dist/lib/core/service-registry.d.ts +4 -4
- package/dist/lib/core/types.d.ts +11 -4
- package/dist/lib/factories/compatibility-factory.d.ts +16 -1
- package/dist/lib/factories/compatibility-factory.js +3 -1
- package/dist/lib/factories/provider-factory.d.ts +5 -4
- package/dist/lib/factories/provider-factory.js +15 -24
- package/dist/lib/factories/provider-generate-factory.js +26 -20
- package/dist/lib/mcp/adapters/plugin-bridge.d.ts +5 -4
- package/dist/lib/mcp/adapters/plugin-bridge.js +13 -6
- package/dist/lib/mcp/client.d.ts +2 -1
- package/dist/lib/mcp/client.js +12 -10
- package/dist/lib/mcp/context-manager.d.ts +1 -1
- package/dist/lib/mcp/contracts/mcp-contract.d.ts +15 -8
- package/dist/lib/mcp/core/plugin-manager.d.ts +3 -2
- package/dist/lib/mcp/core/plugin-manager.js +1 -1
- package/dist/lib/mcp/demo/plugin-demo.js +3 -1
- package/dist/lib/mcp/dynamic-chain-executor.d.ts +64 -40
- package/dist/lib/mcp/dynamic-chain-executor.js +3 -3
- package/dist/lib/mcp/dynamic-orchestrator.d.ts +14 -8
- package/dist/lib/mcp/ecosystem.d.ts +4 -4
- package/dist/lib/mcp/error-manager.d.ts +2 -2
- package/dist/lib/mcp/error-recovery.d.ts +4 -3
- package/dist/lib/mcp/external-client.d.ts +1 -1
- package/dist/lib/mcp/external-client.js +14 -10
- package/dist/lib/mcp/external-manager.d.ts +3 -3
- package/dist/lib/mcp/external-manager.js +9 -3
- package/dist/lib/mcp/factory.d.ts +7 -7
- package/dist/lib/mcp/function-calling.d.ts +3 -2
- package/dist/lib/mcp/health-monitor.d.ts +2 -1
- package/dist/lib/mcp/health-monitor.js +16 -7
- package/dist/lib/mcp/index.d.ts +5 -5
- package/dist/lib/mcp/initialize-tools.d.ts +2 -1
- package/dist/lib/mcp/initialize-tools.js +10 -2
- package/dist/lib/mcp/manager.d.ts +2 -1
- package/dist/lib/mcp/neurolink-mcp-client.js +1 -1
- package/dist/lib/mcp/orchestrator.d.ts +13 -12
- package/dist/lib/mcp/orchestrator.js +10 -8
- package/dist/lib/mcp/plugin-manager.js +4 -2
- package/dist/lib/mcp/plugins/core/filesystem-mcp.d.ts +3 -2
- package/dist/lib/mcp/plugins/core/filesystem-mcp.js +5 -2
- package/dist/lib/mcp/plugins/filesystem-mcp.d.ts +2 -1
- package/dist/lib/mcp/registry.d.ts +2 -1
- package/dist/lib/mcp/registry.js +2 -1
- package/dist/lib/mcp/security-manager.d.ts +4 -2
- package/dist/lib/mcp/servers/agent/direct-tools-server.js +18 -6
- package/dist/lib/mcp/servers/ai-providers/ai-analysis-tools.d.ts +1 -16
- package/dist/lib/mcp/servers/ai-providers/ai-analysis-tools.js +21 -17
- package/dist/lib/mcp/servers/ai-providers/ai-core-server.d.ts +2 -2
- package/dist/lib/mcp/servers/ai-providers/ai-core-server.js +15 -133
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.d.ts +1 -97
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.js +18 -18
- package/dist/lib/mcp/session-manager.d.ts +4 -3
- package/dist/lib/mcp/session-persistence.js +5 -2
- package/dist/lib/mcp/tool-integration.d.ts +3 -2
- package/dist/lib/mcp/tool-integration.js +3 -1
- package/dist/lib/mcp/tool-registry.d.ts +18 -1
- package/dist/lib/mcp/tool-registry.js +11 -8
- package/dist/lib/mcp/transport-manager.d.ts +2 -1
- package/dist/lib/mcp/transport-manager.js +5 -1
- package/dist/lib/mcp/unified-mcp.d.ts +5 -5
- package/dist/lib/mcp/unified-registry.d.ts +18 -2
- package/dist/lib/mcp/unified-registry.js +52 -3
- package/dist/lib/neurolink.d.ts +2 -2
- package/dist/lib/neurolink.js +40 -15
- package/dist/lib/providers/amazon-bedrock.d.ts +1 -1
- package/dist/lib/providers/amazon-bedrock.js +8 -7
- package/dist/lib/providers/analytics-helper.d.ts +8 -23
- package/dist/lib/providers/analytics-helper.js +95 -33
- package/dist/lib/providers/anthropic-baseprovider.d.ts +3 -3
- package/dist/lib/providers/anthropic-baseprovider.js +6 -5
- package/dist/lib/providers/anthropic.d.ts +2 -2
- package/dist/lib/providers/anthropic.js +11 -4
- package/dist/lib/providers/azure-openai.d.ts +5 -4
- package/dist/lib/providers/azure-openai.js +10 -4
- package/dist/lib/providers/function-calling-provider.d.ts +2 -2
- package/dist/lib/providers/function-calling-provider.js +1 -1
- package/dist/lib/providers/google-ai-studio.d.ts +2 -2
- package/dist/lib/providers/google-ai-studio.js +9 -3
- package/dist/lib/providers/google-vertex.d.ts +2 -2
- package/dist/lib/providers/google-vertex.js +18 -12
- package/dist/lib/providers/huggingFace.d.ts +1 -1
- package/dist/lib/providers/huggingFace.js +8 -4
- package/dist/lib/providers/mcp-provider.d.ts +3 -3
- package/dist/lib/providers/mistral.d.ts +34 -27
- package/dist/lib/providers/mistral.js +115 -107
- package/dist/lib/providers/ollama.d.ts +2 -1
- package/dist/lib/providers/ollama.js +43 -3
- package/dist/lib/providers/openAI.d.ts +1 -1
- package/dist/lib/providers/openAI.js +8 -4
- package/dist/lib/proxy/proxy-fetch.js +3 -2
- package/dist/lib/sdk/tool-extension.d.ts +12 -12
- package/dist/lib/sdk/tool-extension.js +2 -1
- package/dist/lib/sdk/tool-registration.d.ts +16 -12
- package/dist/lib/sdk/tool-registration.js +3 -2
- package/dist/lib/services/types.d.ts +5 -4
- package/dist/lib/services/websocket/websocket-server.d.ts +1 -1
- package/dist/lib/services/websocket/websocket-server.js +1 -1
- package/dist/lib/telemetry/telemetry-service.js +1 -1
- package/dist/lib/types/cli.d.ts +247 -0
- package/dist/lib/types/cli.js +22 -0
- package/dist/lib/types/common.d.ts +76 -0
- package/dist/lib/types/common.js +52 -0
- package/dist/lib/types/generate-types.d.ts +6 -6
- package/dist/lib/types/index.d.ts +12 -0
- package/dist/lib/types/index.js +12 -0
- package/dist/lib/types/mcp-types.d.ts +7 -7
- package/dist/lib/types/providers.d.ts +158 -0
- package/dist/lib/types/providers.js +23 -0
- package/dist/lib/types/stream-types.d.ts +4 -3
- package/dist/lib/types/tools.d.ts +154 -0
- package/dist/lib/types/tools.js +24 -0
- package/dist/lib/utils/logger.d.ts +5 -5
- package/dist/lib/utils/provider-validation.d.ts +2 -1
- package/dist/mcp/adapters/plugin-bridge.d.ts +5 -4
- package/dist/mcp/adapters/plugin-bridge.js +13 -6
- package/dist/mcp/client.d.ts +2 -1
- package/dist/mcp/client.js +12 -10
- package/dist/mcp/context-manager.d.ts +1 -1
- package/dist/mcp/contracts/mcp-contract.d.ts +15 -8
- package/dist/mcp/core/plugin-manager.d.ts +3 -2
- package/dist/mcp/core/plugin-manager.js +1 -1
- package/dist/mcp/demo/plugin-demo.js +3 -1
- package/dist/mcp/dynamic-chain-executor.d.ts +64 -40
- package/dist/mcp/dynamic-chain-executor.js +3 -3
- package/dist/mcp/dynamic-orchestrator.d.ts +14 -8
- package/dist/mcp/dynamic-orchestrator.js +1 -1
- package/dist/mcp/ecosystem.d.ts +4 -4
- package/dist/mcp/error-manager.d.ts +2 -2
- package/dist/mcp/error-recovery.d.ts +4 -3
- package/dist/mcp/external-client.d.ts +1 -1
- package/dist/mcp/external-client.js +14 -10
- package/dist/mcp/external-manager.d.ts +3 -3
- package/dist/mcp/external-manager.js +9 -3
- package/dist/mcp/factory.d.ts +7 -7
- package/dist/mcp/function-calling.d.ts +3 -2
- package/dist/mcp/health-monitor.d.ts +2 -1
- package/dist/mcp/health-monitor.js +16 -7
- package/dist/mcp/index.d.ts +5 -5
- package/dist/mcp/initialize-tools.d.ts +2 -1
- package/dist/mcp/initialize-tools.js +10 -2
- package/dist/mcp/manager.d.ts +2 -1
- package/dist/mcp/neurolink-mcp-client.js +1 -1
- package/dist/mcp/orchestrator.d.ts +13 -12
- package/dist/mcp/orchestrator.js +10 -8
- package/dist/mcp/plugin-manager.js +4 -2
- package/dist/mcp/plugins/core/filesystem-mcp.d.ts +3 -2
- package/dist/mcp/plugins/core/filesystem-mcp.js +5 -2
- package/dist/mcp/plugins/filesystem-mcp.d.ts +2 -1
- package/dist/mcp/registry.d.ts +2 -1
- package/dist/mcp/registry.js +2 -1
- package/dist/mcp/security-manager.d.ts +4 -2
- package/dist/mcp/servers/agent/direct-tools-server.js +19 -6
- package/dist/mcp/servers/ai-providers/ai-analysis-tools.d.ts +1 -16
- package/dist/mcp/servers/ai-providers/ai-analysis-tools.js +21 -17
- package/dist/mcp/servers/ai-providers/ai-core-server.d.ts +2 -2
- package/dist/mcp/servers/ai-providers/ai-core-server.js +15 -132
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.d.ts +1 -97
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.js +18 -18
- package/dist/mcp/session-manager.d.ts +4 -3
- package/dist/mcp/session-persistence.js +5 -2
- package/dist/mcp/tool-integration.d.ts +3 -2
- package/dist/mcp/tool-integration.js +3 -1
- package/dist/mcp/tool-registry.d.ts +18 -1
- package/dist/mcp/tool-registry.js +11 -8
- package/dist/mcp/transport-manager.d.ts +2 -1
- package/dist/mcp/transport-manager.js +5 -1
- package/dist/mcp/unified-mcp.d.ts +5 -5
- package/dist/mcp/unified-registry.d.ts +18 -2
- package/dist/mcp/unified-registry.js +52 -3
- package/dist/neurolink.d.ts +2 -2
- package/dist/neurolink.js +40 -15
- package/dist/providers/amazon-bedrock.d.ts +1 -1
- package/dist/providers/amazon-bedrock.js +8 -7
- package/dist/providers/analytics-helper.d.ts +8 -23
- package/dist/providers/analytics-helper.js +95 -33
- package/dist/providers/anthropic-baseprovider.d.ts +3 -3
- package/dist/providers/anthropic-baseprovider.js +6 -5
- package/dist/providers/anthropic.d.ts +2 -2
- package/dist/providers/anthropic.js +11 -4
- package/dist/providers/azure-openai.d.ts +5 -4
- package/dist/providers/azure-openai.js +10 -4
- package/dist/providers/function-calling-provider.d.ts +2 -2
- package/dist/providers/function-calling-provider.js +1 -1
- package/dist/providers/google-ai-studio.d.ts +2 -2
- package/dist/providers/google-ai-studio.js +9 -3
- package/dist/providers/google-vertex.d.ts +2 -2
- package/dist/providers/google-vertex.js +18 -12
- package/dist/providers/huggingFace.d.ts +1 -1
- package/dist/providers/huggingFace.js +8 -4
- package/dist/providers/mcp-provider.d.ts +3 -3
- package/dist/providers/mistral.d.ts +34 -27
- package/dist/providers/mistral.js +116 -108
- package/dist/providers/ollama.d.ts +2 -1
- package/dist/providers/ollama.js +43 -3
- package/dist/providers/openAI.d.ts +1 -1
- package/dist/providers/openAI.js +8 -4
- package/dist/proxy/proxy-fetch.js +3 -2
- package/dist/sdk/tool-extension.d.ts +12 -12
- package/dist/sdk/tool-extension.js +2 -1
- package/dist/sdk/tool-registration.d.ts +16 -12
- package/dist/sdk/tool-registration.js +3 -2
- package/dist/services/types.d.ts +5 -4
- package/dist/services/websocket/websocket-server.d.ts +1 -1
- package/dist/services/websocket/websocket-server.js +2 -1
- package/dist/telemetry/telemetry-service.js +1 -1
- package/dist/types/cli.d.ts +247 -0
- package/dist/types/cli.js +22 -0
- package/dist/types/common.d.ts +76 -0
- package/dist/types/common.js +52 -0
- package/dist/types/generate-types.d.ts +6 -6
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +12 -0
- package/dist/types/mcp-types.d.ts +7 -7
- package/dist/types/providers.d.ts +158 -0
- package/dist/types/providers.js +23 -0
- package/dist/types/stream-types.d.ts +4 -3
- package/dist/types/tools.d.ts +154 -0
- package/dist/types/tools.js +25 -0
- package/dist/utils/logger.d.ts +5 -5
- package/dist/utils/provider-validation.d.ts +2 -1
- package/package.json +2 -1
|
@@ -5,57 +5,25 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { createMCPServer } from "../../factory.js";
|
|
8
|
-
import { ServiceRegistry } from "../../../core/service-registry.js";
|
|
9
8
|
import { getBestProvider, getAvailableProviders, } from "../../../utils/providerUtils.js";
|
|
10
9
|
import { logger } from "../../../utils/logger.js";
|
|
11
|
-
import { analyzeAIUsageTool, benchmarkProviderPerformanceTool, optimizePromptParametersTool, } from "./ai-analysis-tools.js";
|
|
12
|
-
import { generateTestCasesTool, refactorCodeTool, generateDocumentationTool, debugAIOutputTool, } from "./ai-workflow-tools.js";
|
|
13
10
|
/**
|
|
14
|
-
* AI Core Server - Central hub for AI provider
|
|
15
|
-
* Provides
|
|
11
|
+
* AI Core Server - Central hub for AI provider management
|
|
12
|
+
* Provides provider selection and status checking functionality
|
|
16
13
|
*/
|
|
17
14
|
export const aiCoreServer = createMCPServer({
|
|
18
15
|
id: "neurolink-ai-core",
|
|
19
16
|
title: "NeuroLink AI Core",
|
|
20
|
-
description: "Core AI provider
|
|
17
|
+
description: "Core AI provider management with automatic fallback and status monitoring",
|
|
21
18
|
category: "ai-providers",
|
|
22
19
|
version: "1.2.0",
|
|
23
20
|
capabilities: [
|
|
24
|
-
"text-generation",
|
|
25
21
|
"provider-selection",
|
|
26
22
|
"automatic-fallback",
|
|
27
|
-
"usage-tracking",
|
|
28
23
|
"multi-provider-support",
|
|
29
|
-
"
|
|
30
|
-
"test-generation",
|
|
31
|
-
"code-refactoring",
|
|
32
|
-
"documentation-generation",
|
|
33
|
-
"ai-debugging",
|
|
24
|
+
"provider-status-monitoring",
|
|
34
25
|
],
|
|
35
26
|
});
|
|
36
|
-
/**
|
|
37
|
-
* Text Generation Input Schema
|
|
38
|
-
*/
|
|
39
|
-
const TextGenerationSchema = z.object({
|
|
40
|
-
prompt: z.string().min(1, "Prompt is required"),
|
|
41
|
-
provider: z
|
|
42
|
-
.enum([
|
|
43
|
-
"openai",
|
|
44
|
-
"bedrock",
|
|
45
|
-
"vertex",
|
|
46
|
-
"anthropic",
|
|
47
|
-
"google-ai",
|
|
48
|
-
"azure",
|
|
49
|
-
"huggingface",
|
|
50
|
-
"ollama",
|
|
51
|
-
"mistral",
|
|
52
|
-
])
|
|
53
|
-
.optional(),
|
|
54
|
-
model: z.string().optional(),
|
|
55
|
-
temperature: z.number().min(0).max(2).optional(),
|
|
56
|
-
maxTokens: z.number().positive().optional(),
|
|
57
|
-
systemPrompt: z.string().optional(),
|
|
58
|
-
});
|
|
59
27
|
/**
|
|
60
28
|
* Provider Selection Input Schema
|
|
61
29
|
*/
|
|
@@ -70,79 +38,6 @@ const ProviderSelectionSchema = z.object({
|
|
|
70
38
|
})
|
|
71
39
|
.optional(),
|
|
72
40
|
});
|
|
73
|
-
/**
|
|
74
|
-
* Register Text Generation Tool
|
|
75
|
-
* Core tool that leverages existing AIProviderFactory for text generation
|
|
76
|
-
*/
|
|
77
|
-
aiCoreServer.registerTool({
|
|
78
|
-
name: "generate",
|
|
79
|
-
description: "Generate text using AI providers with automatic fallback and provider selection",
|
|
80
|
-
category: "text-generation",
|
|
81
|
-
inputSchema: TextGenerationSchema,
|
|
82
|
-
isImplemented: true,
|
|
83
|
-
execute: async (params, context) => {
|
|
84
|
-
const startTime = Date.now();
|
|
85
|
-
try {
|
|
86
|
-
logger.debug(`[AI-Core] Starting text generation: "${params.prompt.substring(0, 50)}..."`);
|
|
87
|
-
// Use existing AIProviderFactory with best provider selection
|
|
88
|
-
const selectedProvider = params.provider || (await getBestProvider(params.provider));
|
|
89
|
-
// Get AIProviderFactory from ServiceRegistry to avoid circular dependency
|
|
90
|
-
const AIProviderFactory = await ServiceRegistry.get("AIProviderFactory");
|
|
91
|
-
const provider = await AIProviderFactory.createBestProvider(selectedProvider);
|
|
92
|
-
// Generate text using existing NeuroLink patterns
|
|
93
|
-
const result = await provider.generate({
|
|
94
|
-
prompt: params.prompt,
|
|
95
|
-
model: params.model,
|
|
96
|
-
temperature: params.temperature,
|
|
97
|
-
maxTokens: params.maxTokens,
|
|
98
|
-
systemPrompt: params.systemPrompt,
|
|
99
|
-
});
|
|
100
|
-
if (!result) {
|
|
101
|
-
throw new Error("AI provider returned null result");
|
|
102
|
-
}
|
|
103
|
-
const executionTime = Date.now() - startTime;
|
|
104
|
-
logger.debug(`[AI-Core] Text generation successful in ${executionTime}ms using ${selectedProvider}`);
|
|
105
|
-
return {
|
|
106
|
-
success: true,
|
|
107
|
-
data: {
|
|
108
|
-
text: result.content,
|
|
109
|
-
model: params.model || "default",
|
|
110
|
-
provider: selectedProvider,
|
|
111
|
-
generatedAt: new Date().toISOString(),
|
|
112
|
-
},
|
|
113
|
-
usage: {
|
|
114
|
-
tokens: result.usage?.totalTokens,
|
|
115
|
-
provider: selectedProvider,
|
|
116
|
-
model: params.model || "default",
|
|
117
|
-
executionTime,
|
|
118
|
-
},
|
|
119
|
-
metadata: {
|
|
120
|
-
toolName: "generate",
|
|
121
|
-
serverId: "neurolink-ai-core",
|
|
122
|
-
sessionId: context.sessionId,
|
|
123
|
-
timestamp: Date.now(),
|
|
124
|
-
executionTime,
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
const executionTime = Date.now() - startTime;
|
|
130
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
131
|
-
logger.debug(`[AI-Core] Text generation failed: ${errorMessage}`);
|
|
132
|
-
return {
|
|
133
|
-
success: false,
|
|
134
|
-
error: errorMessage,
|
|
135
|
-
metadata: {
|
|
136
|
-
toolName: "generate",
|
|
137
|
-
serverId: "neurolink-ai-core",
|
|
138
|
-
sessionId: context.sessionId,
|
|
139
|
-
timestamp: Date.now(),
|
|
140
|
-
executionTime,
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
41
|
/**
|
|
147
42
|
* Register Provider Selection Tool
|
|
148
43
|
* Intelligent provider selection based on requirements and availability
|
|
@@ -156,10 +51,11 @@ aiCoreServer.registerTool({
|
|
|
156
51
|
execute: async (params, context) => {
|
|
157
52
|
const startTime = Date.now();
|
|
158
53
|
try {
|
|
159
|
-
|
|
54
|
+
const typedParams = params;
|
|
55
|
+
logger.debug(`[AI-Core] Selecting provider with requirements:`, typedParams.requirements);
|
|
160
56
|
// Use existing provider selection logic
|
|
161
57
|
const availableProviders = getAvailableProviders();
|
|
162
|
-
const selectedProvider = await getBestProvider(
|
|
58
|
+
const selectedProvider = await getBestProvider(typedParams.preferred);
|
|
163
59
|
// Get provider capabilities
|
|
164
60
|
const getProviderCapabilities = (provider) => ({
|
|
165
61
|
multimodal: provider === "openai" ||
|
|
@@ -190,8 +86,8 @@ aiCoreServer.registerTool({
|
|
|
190
86
|
provider: selectedProvider,
|
|
191
87
|
available: availableProviders,
|
|
192
88
|
capabilities,
|
|
193
|
-
reason:
|
|
194
|
-
? `Preferred provider ${
|
|
89
|
+
reason: typedParams.preferred
|
|
90
|
+
? `Preferred provider ${typedParams.preferred} selected`
|
|
195
91
|
: "Best available provider selected",
|
|
196
92
|
selectedAt: new Date().toISOString(),
|
|
197
93
|
},
|
|
@@ -241,11 +137,12 @@ aiCoreServer.registerTool({
|
|
|
241
137
|
execute: async (params, context) => {
|
|
242
138
|
const startTime = Date.now();
|
|
243
139
|
try {
|
|
244
|
-
|
|
140
|
+
const typedParams = params;
|
|
141
|
+
logger.debug(`[AI-Core] Checking provider status for: ${typedParams.provider || "all providers"}`);
|
|
245
142
|
const availableProviders = getAvailableProviders();
|
|
246
143
|
const providerStatuses = [];
|
|
247
|
-
const providersToCheck =
|
|
248
|
-
? [
|
|
144
|
+
const providersToCheck = typedParams.provider
|
|
145
|
+
? [typedParams.provider]
|
|
249
146
|
: availableProviders;
|
|
250
147
|
for (const provider of providersToCheck) {
|
|
251
148
|
try {
|
|
@@ -254,7 +151,7 @@ aiCoreServer.registerTool({
|
|
|
254
151
|
providerStatuses.push({
|
|
255
152
|
provider,
|
|
256
153
|
status: isAvailable ? "available" : "unavailable",
|
|
257
|
-
capabilities:
|
|
154
|
+
capabilities: typedParams.includeCapabilities
|
|
258
155
|
? {
|
|
259
156
|
textGeneration: true,
|
|
260
157
|
multimodal: provider === "openai" ||
|
|
@@ -330,20 +227,5 @@ aiCoreServer.registerTool({
|
|
|
330
227
|
}
|
|
331
228
|
},
|
|
332
229
|
});
|
|
333
|
-
/**
|
|
334
|
-
* Register AI Analysis Tools
|
|
335
|
-
* Usage analysis, performance benchmarking, and parameter optimization
|
|
336
|
-
*/
|
|
337
|
-
aiCoreServer.registerTool(analyzeAIUsageTool);
|
|
338
|
-
aiCoreServer.registerTool(benchmarkProviderPerformanceTool);
|
|
339
|
-
aiCoreServer.registerTool(optimizePromptParametersTool);
|
|
340
|
-
/**
|
|
341
|
-
* Register AI Development Workflow Tools
|
|
342
|
-
* Test generation, code refactoring, documentation generation, and AI debugging
|
|
343
|
-
*/
|
|
344
|
-
aiCoreServer.registerTool(generateTestCasesTool);
|
|
345
|
-
aiCoreServer.registerTool(refactorCodeTool);
|
|
346
|
-
aiCoreServer.registerTool(generateDocumentationTool);
|
|
347
|
-
aiCoreServer.registerTool(debugAIOutputTool);
|
|
348
230
|
// Log successful server creation
|
|
349
|
-
logger.debug("[AI-Core] NeuroLink AI Core Server v1.2.0 created with
|
|
231
|
+
logger.debug("[AI-Core] NeuroLink AI Core Server v1.2.0 created with provider management tools:", Object.keys(aiCoreServer.tools));
|
|
@@ -2,100 +2,4 @@
|
|
|
2
2
|
* AI Development Workflow Tools
|
|
3
3
|
* Phase 1.2 Implementation - 4 specialized tools for AI development lifecycle
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
import type { NeuroLinkMCPTool } from "../../factory.js";
|
|
7
|
-
/**
|
|
8
|
-
* Generate test cases for code functions
|
|
9
|
-
*/
|
|
10
|
-
export declare const generateTestCasesTool: NeuroLinkMCPTool;
|
|
11
|
-
/**
|
|
12
|
-
* Refactor code for improved quality
|
|
13
|
-
*/
|
|
14
|
-
export declare const refactorCodeTool: NeuroLinkMCPTool;
|
|
15
|
-
/**
|
|
16
|
-
* Generate documentation from code
|
|
17
|
-
*/
|
|
18
|
-
export declare const generateDocumentationTool: NeuroLinkMCPTool;
|
|
19
|
-
/**
|
|
20
|
-
* Debug AI-generated output
|
|
21
|
-
*/
|
|
22
|
-
export declare const debugAIOutputTool: NeuroLinkMCPTool;
|
|
23
|
-
export declare const aiWorkflowTools: NeuroLinkMCPTool[];
|
|
24
|
-
export declare const workflowToolSchemas: {
|
|
25
|
-
"generate-test-cases": z.ZodObject<{
|
|
26
|
-
codeFunction: z.ZodString;
|
|
27
|
-
testTypes: z.ZodDefault<z.ZodArray<z.ZodEnum<["unit", "integration", "edge-cases", "performance", "security"]>, "many">>;
|
|
28
|
-
framework: z.ZodDefault<z.ZodEnum<["jest", "mocha", "vitest", "pytest", "unittest", "rspec"]>>;
|
|
29
|
-
coverageTarget: z.ZodDefault<z.ZodNumber>;
|
|
30
|
-
includeAsyncTests: z.ZodDefault<z.ZodBoolean>;
|
|
31
|
-
}, "strip", z.ZodTypeAny, {
|
|
32
|
-
codeFunction: string;
|
|
33
|
-
testTypes: ("integration" | "performance" | "unit" | "edge-cases" | "security")[];
|
|
34
|
-
framework: "jest" | "mocha" | "vitest" | "pytest" | "unittest" | "rspec";
|
|
35
|
-
coverageTarget: number;
|
|
36
|
-
includeAsyncTests: boolean;
|
|
37
|
-
}, {
|
|
38
|
-
codeFunction: string;
|
|
39
|
-
testTypes?: ("integration" | "performance" | "unit" | "edge-cases" | "security")[] | undefined;
|
|
40
|
-
framework?: "jest" | "mocha" | "vitest" | "pytest" | "unittest" | "rspec" | undefined;
|
|
41
|
-
coverageTarget?: number | undefined;
|
|
42
|
-
includeAsyncTests?: boolean | undefined;
|
|
43
|
-
}>;
|
|
44
|
-
"refactor-code": z.ZodObject<{
|
|
45
|
-
code: z.ZodString;
|
|
46
|
-
language: z.ZodDefault<z.ZodString>;
|
|
47
|
-
objectives: z.ZodDefault<z.ZodArray<z.ZodEnum<["readability", "performance", "maintainability", "testability", "modularity", "dry-principle", "solid-principles"]>, "many">>;
|
|
48
|
-
preserveFunctionality: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
-
styleGuide: z.ZodOptional<z.ZodString>;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
code: string;
|
|
52
|
-
language: string;
|
|
53
|
-
objectives: ("performance" | "readability" | "maintainability" | "testability" | "modularity" | "dry-principle" | "solid-principles")[];
|
|
54
|
-
preserveFunctionality: boolean;
|
|
55
|
-
styleGuide?: string | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
code: string;
|
|
58
|
-
language?: string | undefined;
|
|
59
|
-
objectives?: ("performance" | "readability" | "maintainability" | "testability" | "modularity" | "dry-principle" | "solid-principles")[] | undefined;
|
|
60
|
-
preserveFunctionality?: boolean | undefined;
|
|
61
|
-
styleGuide?: string | undefined;
|
|
62
|
-
}>;
|
|
63
|
-
"generate-documentation": z.ZodObject<{
|
|
64
|
-
code: z.ZodString;
|
|
65
|
-
language: z.ZodDefault<z.ZodString>;
|
|
66
|
-
documentationType: z.ZodDefault<z.ZodEnum<["jsdoc", "markdown", "sphinx", "doxygen", "readme"]>>;
|
|
67
|
-
includeExamples: z.ZodDefault<z.ZodBoolean>;
|
|
68
|
-
detailLevel: z.ZodDefault<z.ZodEnum<["minimal", "standard", "comprehensive"]>>;
|
|
69
|
-
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
code: string;
|
|
71
|
-
language: string;
|
|
72
|
-
documentationType: "jsdoc" | "markdown" | "sphinx" | "doxygen" | "readme";
|
|
73
|
-
includeExamples: boolean;
|
|
74
|
-
detailLevel: "minimal" | "standard" | "comprehensive";
|
|
75
|
-
}, {
|
|
76
|
-
code: string;
|
|
77
|
-
language?: string | undefined;
|
|
78
|
-
documentationType?: "jsdoc" | "markdown" | "sphinx" | "doxygen" | "readme" | undefined;
|
|
79
|
-
includeExamples?: boolean | undefined;
|
|
80
|
-
detailLevel?: "minimal" | "standard" | "comprehensive" | undefined;
|
|
81
|
-
}>;
|
|
82
|
-
"debug-ai-output": z.ZodObject<{
|
|
83
|
-
aiOutput: z.ZodString;
|
|
84
|
-
expectedBehavior: z.ZodString;
|
|
85
|
-
context: z.ZodOptional<z.ZodString>;
|
|
86
|
-
outputType: z.ZodDefault<z.ZodEnum<["code", "text", "structured-data", "conversation"]>>;
|
|
87
|
-
includeFixSuggestions: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
-
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
aiOutput: string;
|
|
90
|
-
expectedBehavior: string;
|
|
91
|
-
outputType: "text" | "code" | "structured-data" | "conversation";
|
|
92
|
-
includeFixSuggestions: boolean;
|
|
93
|
-
context?: string | undefined;
|
|
94
|
-
}, {
|
|
95
|
-
aiOutput: string;
|
|
96
|
-
expectedBehavior: string;
|
|
97
|
-
context?: string | undefined;
|
|
98
|
-
outputType?: "text" | "code" | "structured-data" | "conversation" | undefined;
|
|
99
|
-
includeFixSuggestions?: boolean | undefined;
|
|
100
|
-
}>;
|
|
101
|
-
};
|
|
5
|
+
export {};
|
|
@@ -99,7 +99,7 @@ const debugAIOutputSchema = z.object({
|
|
|
99
99
|
/**
|
|
100
100
|
* Generate test cases for code functions
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
const generateTestCasesTool = {
|
|
103
103
|
name: "generate-test-cases",
|
|
104
104
|
description: "Generate comprehensive test cases for code functions with various test types and frameworks",
|
|
105
105
|
category: "ai-workflow",
|
|
@@ -203,7 +203,7 @@ Generate 3-5 comprehensive test cases covering the requested types.`;
|
|
|
203
203
|
/**
|
|
204
204
|
* Refactor code for improved quality
|
|
205
205
|
*/
|
|
206
|
-
|
|
206
|
+
const refactorCodeTool = {
|
|
207
207
|
name: "refactor-code",
|
|
208
208
|
description: "AI-powered code refactoring for improved readability, performance, and maintainability",
|
|
209
209
|
category: "ai-workflow",
|
|
@@ -316,7 +316,7 @@ Focus on real, actionable improvements based on the specified objectives.`;
|
|
|
316
316
|
/**
|
|
317
317
|
* Generate documentation from code
|
|
318
318
|
*/
|
|
319
|
-
|
|
319
|
+
const generateDocumentationTool = {
|
|
320
320
|
name: "generate-documentation",
|
|
321
321
|
description: "Automatically generate comprehensive documentation from code",
|
|
322
322
|
category: "ai-workflow",
|
|
@@ -427,7 +427,7 @@ Focus on creating accurate, useful documentation that explains the code's purpos
|
|
|
427
427
|
/**
|
|
428
428
|
* Debug AI-generated output
|
|
429
429
|
*/
|
|
430
|
-
|
|
430
|
+
const debugAIOutputTool = {
|
|
431
431
|
name: "debug-ai-output",
|
|
432
432
|
description: "Analyze and debug AI-generated output to identify issues and suggest improvements",
|
|
433
433
|
category: "ai-workflow",
|
|
@@ -566,17 +566,17 @@ function simulateRefactoring(code, objectives, styleGuide) {
|
|
|
566
566
|
}
|
|
567
567
|
return refactored;
|
|
568
568
|
}
|
|
569
|
-
//
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
];
|
|
576
|
-
//
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
};
|
|
569
|
+
// REMOVED: Tool exports disabled to prevent provider conflicts
|
|
570
|
+
// const aiWorkflowTools = [
|
|
571
|
+
// generateTestCasesTool,
|
|
572
|
+
// refactorCodeTool,
|
|
573
|
+
// generateDocumentationTool,
|
|
574
|
+
// debugAIOutputTool,
|
|
575
|
+
// ];
|
|
576
|
+
// REMOVED: Schema exports disabled
|
|
577
|
+
// const workflowToolSchemas = {
|
|
578
|
+
// "generate-test-cases": generateTestCasesSchema,
|
|
579
|
+
// "refactor-code": refactorCodeSchema,
|
|
580
|
+
// "generate-documentation": generateDocumentationSchema,
|
|
581
|
+
// "debug-ai-output": debugAIOutputSchema,
|
|
582
|
+
// };
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Enables continuous tool calling with persistent state across executions
|
|
4
4
|
* Based on patterns from Cline's session management implementation
|
|
5
5
|
*/
|
|
6
|
+
import type { Unknown } from "../types/common.js";
|
|
6
7
|
import type { NeuroLinkExecutionContext, ToolResult } from "./factory.js";
|
|
7
8
|
import { type PersistenceOptions } from "./session-persistence.js";
|
|
8
9
|
/**
|
|
@@ -12,7 +13,7 @@ export interface OrchestratorSession {
|
|
|
12
13
|
id: string;
|
|
13
14
|
context: NeuroLinkExecutionContext;
|
|
14
15
|
toolHistory: ToolResult[];
|
|
15
|
-
state: Map<string,
|
|
16
|
+
state: Map<string, Unknown>;
|
|
16
17
|
metadata: {
|
|
17
18
|
userAgent?: string;
|
|
18
19
|
origin?: string;
|
|
@@ -95,7 +96,7 @@ export declare class SessionManager {
|
|
|
95
96
|
* @param value State value
|
|
96
97
|
* @returns Updated session or null if not found
|
|
97
98
|
*/
|
|
98
|
-
setSessionState(sessionId: string, key: string, value:
|
|
99
|
+
setSessionState(sessionId: string, key: string, value: Unknown): OrchestratorSession | null;
|
|
99
100
|
/**
|
|
100
101
|
* Get session state value
|
|
101
102
|
*
|
|
@@ -103,7 +104,7 @@ export declare class SessionManager {
|
|
|
103
104
|
* @param key State key
|
|
104
105
|
* @returns State value or undefined
|
|
105
106
|
*/
|
|
106
|
-
getSessionState(sessionId: string, key: string):
|
|
107
|
+
getSessionState(sessionId: string, key: string): Unknown;
|
|
107
108
|
/**
|
|
108
109
|
* Remove a session
|
|
109
110
|
*
|
|
@@ -91,8 +91,11 @@ export class SessionPersistence {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
// Convert state array back to Map
|
|
94
|
-
const
|
|
95
|
-
session
|
|
94
|
+
const serializedSession = fileData.session;
|
|
95
|
+
const session = {
|
|
96
|
+
...serializedSession,
|
|
97
|
+
state: new Map(serializedSession.state),
|
|
98
|
+
};
|
|
96
99
|
return session;
|
|
97
100
|
}
|
|
98
101
|
catch (error) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* MCP Tool Integration Layer
|
|
3
3
|
* Connects MCP tools to NeuroLink AI providers following Lighthouse patterns
|
|
4
4
|
*/
|
|
5
|
+
import type { Unknown } from "../types/common.js";
|
|
5
6
|
import type { NeuroLinkExecutionContext, ToolResult } from "./factory.js";
|
|
6
7
|
/**
|
|
7
8
|
* Tool Integration System
|
|
@@ -31,7 +32,7 @@ export declare class MCPToolIntegration {
|
|
|
31
32
|
/**
|
|
32
33
|
* Execute a tool by name
|
|
33
34
|
*/
|
|
34
|
-
executeTool(toolName: string, params:
|
|
35
|
+
executeTool(toolName: string, params: Unknown, serverId?: string): Promise<ToolResult>;
|
|
35
36
|
/**
|
|
36
37
|
* Enhance AI prompt with tool context
|
|
37
38
|
*/
|
|
@@ -41,7 +42,7 @@ export declare class MCPToolIntegration {
|
|
|
41
42
|
*/
|
|
42
43
|
analyzeForToolUsage(aiResponse: string): Array<{
|
|
43
44
|
toolName: string;
|
|
44
|
-
params:
|
|
45
|
+
params: Unknown;
|
|
45
46
|
confidence: number;
|
|
46
47
|
}>;
|
|
47
48
|
/**
|
|
@@ -54,7 +54,9 @@ export class MCPToolIntegration {
|
|
|
54
54
|
async initializeTools() {
|
|
55
55
|
const servers = await mcpConfig.getServers();
|
|
56
56
|
for (const server of servers) {
|
|
57
|
-
await this.registry.registerServer(server.id ||
|
|
57
|
+
await this.registry.registerServer(server.id ||
|
|
58
|
+
server.name ||
|
|
59
|
+
"unknown", server);
|
|
58
60
|
}
|
|
59
61
|
const tools = await this.registry.listTools();
|
|
60
62
|
logger.debug("[Tool Integration] Initialized with servers:", {
|
|
@@ -5,6 +5,23 @@
|
|
|
5
5
|
import type { ExecutionContext, ToolInfo } from "./contracts/mcpContract.js";
|
|
6
6
|
import type { ToolResult } from "./factory.js";
|
|
7
7
|
import { MCPRegistry } from "./registry.js";
|
|
8
|
+
interface ToolImplementation {
|
|
9
|
+
execute: (params: unknown, context?: ExecutionContext) => Promise<unknown> | unknown;
|
|
10
|
+
description?: string;
|
|
11
|
+
inputSchema?: unknown;
|
|
12
|
+
outputSchema?: unknown;
|
|
13
|
+
category?: string;
|
|
14
|
+
permissions?: string[];
|
|
15
|
+
}
|
|
16
|
+
interface ServerRegistration {
|
|
17
|
+
id?: string;
|
|
18
|
+
serverId?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
category?: string;
|
|
22
|
+
tools?: Record<string, ToolImplementation>;
|
|
23
|
+
configuration?: Record<string, unknown>;
|
|
24
|
+
}
|
|
8
25
|
export type ToolExecutionResult = ToolResult;
|
|
9
26
|
/**
|
|
10
27
|
* Tool execution options
|
|
@@ -25,7 +42,7 @@ export declare class MCPToolRegistry extends MCPRegistry {
|
|
|
25
42
|
/**
|
|
26
43
|
* Register a server with its tools (updated signature)
|
|
27
44
|
*/
|
|
28
|
-
registerServer(serverOrId: string |
|
|
45
|
+
registerServer(serverOrId: string | ServerRegistration, serverConfig?: unknown, context?: ExecutionContext): Promise<void>;
|
|
29
46
|
/**
|
|
30
47
|
* Execute a tool with enhanced context
|
|
31
48
|
*/
|
|
@@ -23,7 +23,8 @@ export class MCPToolRegistry extends MCPRegistry {
|
|
|
23
23
|
metadata: {
|
|
24
24
|
name: serverId,
|
|
25
25
|
description: typeof serverConfig === "object" && serverConfig
|
|
26
|
-
? serverConfig.description ||
|
|
26
|
+
? serverConfig.description ||
|
|
27
|
+
"No description"
|
|
27
28
|
: "No description",
|
|
28
29
|
},
|
|
29
30
|
tools: typeof serverConfig === "object" && serverConfig
|
|
@@ -37,16 +38,17 @@ export class MCPToolRegistry extends MCPRegistry {
|
|
|
37
38
|
else {
|
|
38
39
|
// New behavior: register server object
|
|
39
40
|
const server = serverOrId;
|
|
40
|
-
serverId = server.id || server.serverId || "unknown-server";
|
|
41
|
+
serverId = String(server.id || server.serverId || "unknown-server");
|
|
41
42
|
registryLogger.info(`Registering server object: ${serverId}`);
|
|
42
43
|
plugin = {
|
|
43
44
|
metadata: {
|
|
44
45
|
name: serverId,
|
|
45
|
-
description: server.description || server.title || "No description",
|
|
46
|
-
category: server.category,
|
|
46
|
+
description: String(server.description || server.title || "No description"),
|
|
47
|
+
category: String(server.category || ""),
|
|
47
48
|
},
|
|
48
49
|
tools: server.tools || {},
|
|
49
|
-
configuration: server.configuration ||
|
|
50
|
+
configuration: server.configuration ||
|
|
51
|
+
{},
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
54
|
// Call the parent register method
|
|
@@ -112,14 +114,15 @@ export class MCPToolRegistry extends MCPRegistry {
|
|
|
112
114
|
registryLogger.debug(`Executing tool '${toolName}' with args:`, args);
|
|
113
115
|
const toolResult = await toolImpl.execute(args, execContext);
|
|
114
116
|
// Add metadata to the tool result (don't double-wrap)
|
|
117
|
+
const toolResultObj = toolResult;
|
|
115
118
|
const result = {
|
|
116
|
-
...
|
|
119
|
+
...toolResultObj,
|
|
117
120
|
usage: {
|
|
118
|
-
...
|
|
121
|
+
...(toolResultObj.usage || {}),
|
|
119
122
|
executionTime: Date.now() - startTime,
|
|
120
123
|
},
|
|
121
124
|
metadata: {
|
|
122
|
-
...
|
|
125
|
+
...(toolResultObj.metadata || {}),
|
|
123
126
|
toolName,
|
|
124
127
|
serverId: tool.serverId,
|
|
125
128
|
sessionId: execContext.sessionId,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Supports stdio, SSE, and HTTP transports with reconnection logic
|
|
4
4
|
*/
|
|
5
5
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
6
|
+
import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
import { ErrorManager } from "./error-manager.js";
|
|
8
9
|
export declare const TransportConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -96,7 +97,7 @@ export declare class TransportManager {
|
|
|
96
97
|
/**
|
|
97
98
|
* Create transport based on configuration
|
|
98
99
|
*/
|
|
99
|
-
createTransport(config: TransportConfig): Promise<
|
|
100
|
+
createTransport(config: TransportConfig): Promise<Transport>;
|
|
100
101
|
/**
|
|
101
102
|
* Create stdio transport
|
|
102
103
|
*/
|
|
@@ -160,7 +160,11 @@ export class TransportManager {
|
|
|
160
160
|
async createHTTPTransport(config) {
|
|
161
161
|
// Dynamically import HTTP transport
|
|
162
162
|
const httpModule = await import("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
163
|
-
const HTTPClientTransport = httpModule.default ||
|
|
163
|
+
const HTTPClientTransport = httpModule.default ||
|
|
164
|
+
httpModule.HTTPClientTransport;
|
|
165
|
+
if (!HTTPClientTransport || typeof HTTPClientTransport !== "function") {
|
|
166
|
+
throw new Error("HTTPClientTransport constructor not found");
|
|
167
|
+
}
|
|
164
168
|
return new HTTPClientTransport(new URL(config.url), {
|
|
165
169
|
requestInit: {
|
|
166
170
|
headers: config.headers,
|
|
@@ -31,7 +31,7 @@ export interface UnifiedMCPStatus {
|
|
|
31
31
|
tools: number;
|
|
32
32
|
};
|
|
33
33
|
totalTools: number;
|
|
34
|
-
registryStats:
|
|
34
|
+
registryStats: unknown;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Unified MCP System
|
|
@@ -59,11 +59,11 @@ export declare class UnifiedMCPSystem {
|
|
|
59
59
|
/**
|
|
60
60
|
* Execute a tool from any registered server
|
|
61
61
|
*/
|
|
62
|
-
executeTool(toolName: string, params:
|
|
62
|
+
executeTool(toolName: string, params: unknown, context: NeuroLinkExecutionContext): Promise<ToolResult>;
|
|
63
63
|
/**
|
|
64
64
|
* List all available tools
|
|
65
65
|
*/
|
|
66
|
-
listTools(criteria?:
|
|
66
|
+
listTools(criteria?: unknown): Promise<import("./tool-registry.js").ToolInfo[]>;
|
|
67
67
|
/**
|
|
68
68
|
* Get tool information
|
|
69
69
|
*/
|
|
@@ -113,11 +113,11 @@ export declare function getMCPSystem(): UnifiedMCPSystem;
|
|
|
113
113
|
/**
|
|
114
114
|
* Execute a tool using the default system
|
|
115
115
|
*/
|
|
116
|
-
export declare function executeMCPTool(toolName: string, params:
|
|
116
|
+
export declare function executeMCPTool(toolName: string, params: unknown, context: NeuroLinkExecutionContext): Promise<ToolResult>;
|
|
117
117
|
/**
|
|
118
118
|
* List all available MCP tools
|
|
119
119
|
*/
|
|
120
|
-
export declare function listMCPTools(criteria?:
|
|
120
|
+
export declare function listMCPTools(criteria?: unknown): Promise<import("./tool-registry.js").ToolInfo[]>;
|
|
121
121
|
/**
|
|
122
122
|
* Get MCP tool information
|
|
123
123
|
*/
|