@juspay/neurolink 1.9.0 → 1.11.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 +41 -31
- package/README.md +17 -1
- package/dist/agent/direct-tools.d.ts +9 -9
- package/dist/cli/commands/agent-generate.d.ts +1 -2
- package/dist/cli/commands/agent-generate.js +5 -8
- package/dist/cli/commands/config.d.ts +2 -2
- package/dist/cli/commands/config.js +1 -1
- package/dist/cli/commands/mcp.js +91 -100
- package/dist/cli/commands/ollama.d.ts +2 -7
- package/dist/cli/commands/ollama.js +5 -8
- package/dist/cli/index.js +263 -258
- package/dist/core/factory.js +11 -12
- package/dist/index.d.ts +24 -1
- package/dist/index.js +36 -1
- package/dist/lib/agent/direct-tools.d.ts +9 -9
- package/dist/lib/core/factory.js +11 -12
- package/dist/lib/index.d.ts +24 -1
- package/dist/lib/index.js +36 -1
- package/dist/lib/mcp/adapters/plugin-bridge.d.ts +39 -0
- package/dist/lib/mcp/adapters/plugin-bridge.js +82 -0
- package/dist/lib/mcp/auto-discovery.d.ts +38 -96
- package/dist/lib/mcp/auto-discovery.js +100 -744
- package/dist/lib/mcp/client.js +4 -4
- package/dist/lib/mcp/context-manager.js +72 -1
- package/dist/lib/mcp/contracts/mcp-contract.d.ts +162 -0
- package/dist/lib/mcp/contracts/mcp-contract.js +58 -0
- package/dist/lib/mcp/core/plugin-manager.d.ts +45 -0
- package/dist/lib/mcp/core/plugin-manager.js +110 -0
- package/dist/lib/mcp/demo/plugin-demo.d.ts +20 -0
- package/dist/lib/mcp/demo/plugin-demo.js +116 -0
- package/dist/lib/mcp/ecosystem.d.ts +75 -0
- package/dist/lib/mcp/ecosystem.js +161 -0
- package/dist/lib/mcp/external-client.d.ts +88 -0
- package/dist/lib/mcp/external-client.js +323 -0
- package/dist/lib/mcp/external-manager.d.ts +112 -0
- package/dist/lib/mcp/external-manager.js +302 -0
- package/dist/lib/mcp/factory.d.ts +4 -4
- package/dist/lib/mcp/function-calling.js +59 -34
- package/dist/lib/mcp/index.d.ts +39 -184
- package/dist/lib/mcp/index.js +72 -150
- package/dist/lib/mcp/initialize.js +5 -5
- package/dist/lib/mcp/logging.d.ts +27 -60
- package/dist/lib/mcp/logging.js +77 -165
- package/dist/lib/mcp/neurolink-mcp-client.js +31 -3
- package/dist/lib/mcp/orchestrator.d.ts +1 -1
- package/dist/lib/mcp/orchestrator.js +13 -12
- package/dist/lib/mcp/plugin-manager.d.ts +98 -0
- package/dist/lib/mcp/plugin-manager.js +294 -0
- package/dist/lib/mcp/plugins/core/filesystem-mcp.d.ts +35 -0
- package/dist/lib/mcp/plugins/core/filesystem-mcp.js +139 -0
- package/dist/lib/mcp/plugins/filesystem-mcp.d.ts +36 -0
- package/dist/lib/mcp/plugins/filesystem-mcp.js +54 -0
- package/dist/lib/mcp/registry.d.ts +26 -167
- package/dist/lib/mcp/registry.js +31 -354
- package/dist/lib/mcp/security-manager.d.ts +85 -0
- package/dist/lib/mcp/security-manager.js +344 -0
- package/dist/lib/mcp/servers/ai-providers/ai-analysis-tools.js +1 -1
- package/dist/lib/mcp/servers/ai-providers/ai-core-server.js +1 -1
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.js +1 -1
- package/dist/lib/mcp/tool-integration.d.ts +4 -14
- package/dist/lib/mcp/tool-integration.js +43 -21
- package/dist/lib/mcp/tool-registry.d.ts +66 -0
- package/dist/lib/mcp/tool-registry.js +160 -0
- package/dist/lib/mcp/unified-mcp.d.ts +123 -0
- package/dist/lib/mcp/unified-mcp.js +246 -0
- package/dist/lib/mcp/unified-registry.d.ts +42 -229
- package/dist/lib/mcp/unified-registry.js +96 -1346
- package/dist/lib/neurolink.d.ts +3 -4
- package/dist/lib/neurolink.js +18 -19
- package/dist/lib/providers/agent-enhanced-provider.js +2 -2
- package/dist/lib/providers/amazonBedrock.js +2 -2
- package/dist/lib/providers/anthropic.js +3 -3
- package/dist/lib/providers/azureOpenAI.js +3 -3
- package/dist/lib/providers/function-calling-provider.js +34 -25
- package/dist/lib/providers/googleAIStudio.js +3 -3
- package/dist/lib/providers/googleVertexAI.js +2 -2
- package/dist/lib/providers/huggingFace.js +2 -2
- package/dist/lib/providers/mcp-provider.js +33 -5
- package/dist/lib/providers/mistralAI.js +2 -2
- package/dist/lib/providers/ollama.js +17 -2
- package/dist/lib/providers/openAI.js +2 -2
- package/dist/lib/utils/providerUtils-fixed.d.ts +8 -0
- package/dist/lib/utils/providerUtils-fixed.js +75 -0
- package/dist/lib/utils/providerUtils.d.ts +8 -1
- package/dist/lib/utils/providerUtils.js +10 -1
- package/dist/mcp/adapters/plugin-bridge.d.ts +39 -0
- package/dist/mcp/adapters/plugin-bridge.js +82 -0
- package/dist/mcp/auto-discovery.d.ts +38 -96
- package/dist/mcp/auto-discovery.js +100 -745
- package/dist/mcp/client.js +4 -4
- package/dist/mcp/context-manager.js +72 -1
- package/dist/mcp/contracts/mcp-contract.d.ts +162 -0
- package/dist/mcp/contracts/mcp-contract.js +58 -0
- package/dist/mcp/core/plugin-manager.d.ts +45 -0
- package/dist/mcp/core/plugin-manager.js +110 -0
- package/dist/mcp/demo/plugin-demo.d.ts +20 -0
- package/dist/mcp/demo/plugin-demo.js +116 -0
- package/dist/mcp/ecosystem.d.ts +75 -0
- package/dist/mcp/ecosystem.js +162 -0
- package/dist/mcp/external-client.d.ts +88 -0
- package/dist/mcp/external-client.js +323 -0
- package/dist/mcp/external-manager.d.ts +112 -0
- package/dist/mcp/external-manager.js +302 -0
- package/dist/mcp/factory.d.ts +4 -4
- package/dist/mcp/function-calling.js +59 -34
- package/dist/mcp/index.d.ts +39 -184
- package/dist/mcp/index.js +72 -150
- package/dist/mcp/initialize.js +5 -5
- package/dist/mcp/logging.d.ts +27 -60
- package/dist/mcp/logging.js +77 -165
- package/dist/mcp/neurolink-mcp-client.js +31 -3
- package/dist/mcp/orchestrator.d.ts +1 -1
- package/dist/mcp/orchestrator.js +13 -12
- package/dist/mcp/plugin-manager.d.ts +98 -0
- package/dist/mcp/plugin-manager.js +295 -0
- package/dist/mcp/plugins/core/filesystem-mcp.d.ts +35 -0
- package/dist/mcp/plugins/core/filesystem-mcp.js +139 -0
- package/dist/mcp/plugins/core/neurolink-mcp.json +17 -0
- package/dist/mcp/plugins/filesystem-mcp.d.ts +36 -0
- package/dist/mcp/plugins/filesystem-mcp.js +54 -0
- package/dist/mcp/registry.d.ts +26 -167
- package/dist/mcp/registry.js +31 -354
- package/dist/mcp/security-manager.d.ts +85 -0
- package/dist/mcp/security-manager.js +344 -0
- package/dist/mcp/servers/ai-providers/ai-analysis-tools.js +1 -1
- package/dist/mcp/servers/ai-providers/ai-core-server.js +1 -1
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.js +1 -1
- package/dist/mcp/tool-integration.d.ts +4 -14
- package/dist/mcp/tool-integration.js +43 -21
- package/dist/mcp/tool-registry.d.ts +66 -0
- package/dist/mcp/tool-registry.js +160 -0
- package/dist/mcp/unified-mcp.d.ts +123 -0
- package/dist/mcp/unified-mcp.js +246 -0
- package/dist/mcp/unified-registry.d.ts +42 -229
- package/dist/mcp/unified-registry.js +96 -1345
- package/dist/neurolink.d.ts +3 -4
- package/dist/neurolink.js +18 -19
- package/dist/providers/agent-enhanced-provider.js +2 -2
- package/dist/providers/amazonBedrock.js +2 -2
- package/dist/providers/anthropic.js +3 -3
- package/dist/providers/azureOpenAI.js +3 -3
- package/dist/providers/function-calling-provider.js +34 -25
- package/dist/providers/googleAIStudio.js +3 -3
- package/dist/providers/googleVertexAI.js +2 -2
- package/dist/providers/huggingFace.js +2 -2
- package/dist/providers/mcp-provider.js +33 -5
- package/dist/providers/mistralAI.js +2 -2
- package/dist/providers/ollama.js +17 -2
- package/dist/providers/openAI.js +2 -2
- package/dist/utils/providerUtils-fixed.d.ts +8 -0
- package/dist/utils/providerUtils-fixed.js +75 -0
- package/dist/utils/providerUtils.d.ts +8 -1
- package/dist/utils/providerUtils.js +10 -1
- package/package.json +28 -20
|
@@ -1,269 +1,82 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Combines manual configuration, auto-discovery, and default tool registry
|
|
4
|
-
* Provides intelligent server selection with configurable priorities
|
|
2
|
+
* Unified MCP Registry - Combines Multiple Registration Sources
|
|
5
3
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import type {
|
|
4
|
+
import type { DiscoveredMCP, ExecutionContext } from "./contracts/mcp-contract.js";
|
|
5
|
+
import type { DiscoveryOptions } from "./auto-discovery.js";
|
|
6
|
+
import { MCPToolRegistry, type ToolInfo, type ToolExecutionResult } from "./tool-registry.js";
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
8
|
+
* Unified registry combining multiple sources
|
|
10
9
|
*/
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
args?: string[];
|
|
15
|
-
env?: Record<string, string>;
|
|
16
|
-
cwd?: string;
|
|
17
|
-
transport: "stdio" | "sse";
|
|
18
|
-
url?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Enhanced MCP configuration with auto-discovery settings
|
|
22
|
-
*/
|
|
23
|
-
export interface EnhancedMCPConfig {
|
|
24
|
-
mcpServers: Record<string, MCPServerConfig>;
|
|
25
|
-
autoDiscovery?: {
|
|
26
|
-
enabled?: boolean;
|
|
27
|
-
sources?: string[];
|
|
28
|
-
autoRegister?: boolean;
|
|
29
|
-
excludeServers?: string[];
|
|
30
|
-
preferManualConfig?: boolean;
|
|
31
|
-
};
|
|
32
|
-
defaultRegistry?: {
|
|
33
|
-
enabled?: boolean;
|
|
34
|
-
includeBuiltInTools?: boolean;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Server source information
|
|
39
|
-
*/
|
|
40
|
-
export interface ServerSource {
|
|
41
|
-
type: "manual" | "auto" | "default";
|
|
42
|
-
priority: number;
|
|
43
|
-
metadata?: Record<string, unknown>;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Unified server entry
|
|
47
|
-
*/
|
|
48
|
-
export interface UnifiedServerEntry {
|
|
49
|
-
id: string;
|
|
50
|
-
config?: MCPServerConfig;
|
|
51
|
-
server?: NeuroLinkMCPServer;
|
|
52
|
-
source: ServerSource;
|
|
53
|
-
status: "available" | "unavailable" | "unknown" | "activated";
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Unified execution options
|
|
57
|
-
*/
|
|
58
|
-
export interface UnifiedExecutionOptions {
|
|
59
|
-
preferredSource?: "manual" | "auto" | "default";
|
|
60
|
-
fallbackEnabled?: boolean;
|
|
61
|
-
validateBeforeExecution?: boolean;
|
|
62
|
-
timeoutMs?: number;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Unified MCP Registry that combines all sources
|
|
66
|
-
*/
|
|
67
|
-
export declare class UnifiedMCPRegistry {
|
|
68
|
-
private configPath;
|
|
69
|
-
private config;
|
|
10
|
+
export declare class UnifiedMCPRegistry extends MCPToolRegistry {
|
|
11
|
+
private autoDiscoveryEnabled;
|
|
12
|
+
private autoDiscoveredServers;
|
|
70
13
|
private manualServers;
|
|
71
|
-
private
|
|
72
|
-
private defaultServers;
|
|
73
|
-
private autoRegistryInstance;
|
|
74
|
-
private lastAutoDiscovery;
|
|
75
|
-
private autoDiscoveryCacheMs;
|
|
76
|
-
private _isInitialized;
|
|
77
|
-
constructor(configPath?: string);
|
|
78
|
-
/**
|
|
79
|
-
* Check if the registry has been initialized
|
|
80
|
-
*/
|
|
81
|
-
get isInitialized(): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Load MCP configuration with defaults
|
|
84
|
-
*/
|
|
85
|
-
private loadConfig;
|
|
86
|
-
/**
|
|
87
|
-
* Save configuration to file
|
|
88
|
-
*/
|
|
89
|
-
private saveConfig;
|
|
90
|
-
/**
|
|
91
|
-
* Initialize the unified registry by loading all server sources
|
|
92
|
-
*/
|
|
93
|
-
initialize(): Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* Mark all discovered servers as available for lazy activation
|
|
96
|
-
*/
|
|
97
|
-
private markServersAsAvailable;
|
|
98
|
-
/**
|
|
99
|
-
* Load manual servers from configuration
|
|
100
|
-
*/
|
|
101
|
-
private loadManualServers;
|
|
102
|
-
/**
|
|
103
|
-
* Load auto-discovered servers
|
|
104
|
-
*/
|
|
105
|
-
private loadAutoDiscoveredServers;
|
|
106
|
-
/**
|
|
107
|
-
* Load default registry tools
|
|
108
|
-
*/
|
|
109
|
-
private loadDefaultRegistryTools;
|
|
110
|
-
/**
|
|
111
|
-
* Execute a tool using unified registry with fallback
|
|
112
|
-
*/
|
|
113
|
-
executeTool(toolName: string, params: unknown, context: NeuroLinkExecutionContext, options?: UnifiedExecutionOptions): Promise<ToolResult>;
|
|
114
|
-
/**
|
|
115
|
-
* Execute tool from specific source
|
|
116
|
-
*/
|
|
117
|
-
private executeFromSource;
|
|
118
|
-
/**
|
|
119
|
-
* Execute tool from manual configuration
|
|
120
|
-
*/
|
|
121
|
-
private executeFromManualConfig;
|
|
122
|
-
/**
|
|
123
|
-
* Execute MCP tool using manual server configuration
|
|
124
|
-
*/
|
|
125
|
-
private executeMCPTool;
|
|
126
|
-
/**
|
|
127
|
-
* Execute tool from auto-registered servers
|
|
128
|
-
*/
|
|
129
|
-
private executeFromAutoRegistry;
|
|
14
|
+
private availableServers;
|
|
130
15
|
/**
|
|
131
|
-
*
|
|
16
|
+
* Initialize with auto-discovery
|
|
132
17
|
*/
|
|
133
|
-
|
|
18
|
+
initialize(options?: DiscoveryOptions): Promise<void>;
|
|
134
19
|
/**
|
|
135
|
-
*
|
|
20
|
+
* Enable or disable auto-discovery
|
|
136
21
|
*/
|
|
137
|
-
|
|
22
|
+
setAutoDiscovery(enabled: boolean): void;
|
|
138
23
|
/**
|
|
139
|
-
*
|
|
24
|
+
* Refresh discovery
|
|
140
25
|
*/
|
|
141
|
-
|
|
142
|
-
source?: "manual" | "auto" | "default";
|
|
143
|
-
}): Promise<Array<{
|
|
144
|
-
name: string;
|
|
145
|
-
server: string;
|
|
146
|
-
source: "manual" | "auto" | "default";
|
|
147
|
-
description?: string;
|
|
148
|
-
category?: string;
|
|
149
|
-
isImplemented?: boolean;
|
|
150
|
-
}>>;
|
|
26
|
+
refresh(options?: DiscoveryOptions): Promise<void>;
|
|
151
27
|
/**
|
|
152
|
-
*
|
|
153
|
-
*/
|
|
154
|
-
listAllServers(): UnifiedServerEntry[];
|
|
155
|
-
/**
|
|
156
|
-
* Get total server count across all sources
|
|
28
|
+
* Get total server count
|
|
157
29
|
*/
|
|
158
30
|
getTotalServerCount(): number;
|
|
159
31
|
/**
|
|
160
|
-
*
|
|
32
|
+
* Get available server count
|
|
161
33
|
*/
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Remove a manual server configuration
|
|
165
|
-
*/
|
|
166
|
-
removeManualServer(serverId: string): boolean;
|
|
34
|
+
getAvailableServerCount(): number;
|
|
167
35
|
/**
|
|
168
|
-
*
|
|
36
|
+
* Get auto-discovered servers
|
|
169
37
|
*/
|
|
170
|
-
|
|
38
|
+
getAutoDiscoveredServers(): DiscoveredMCP[];
|
|
171
39
|
/**
|
|
172
|
-
*
|
|
40
|
+
* Get manual servers
|
|
173
41
|
*/
|
|
174
|
-
|
|
42
|
+
getManualServers(): Map<string, any>;
|
|
175
43
|
/**
|
|
176
|
-
*
|
|
44
|
+
* List all tools from all registered plugins
|
|
177
45
|
*/
|
|
178
|
-
|
|
46
|
+
listAllTools(): Promise<ToolInfo[]>;
|
|
179
47
|
/**
|
|
180
|
-
*
|
|
48
|
+
* Execute a tool through the registry
|
|
181
49
|
*/
|
|
182
|
-
|
|
183
|
-
manual: {
|
|
184
|
-
servers: number;
|
|
185
|
-
tools: number;
|
|
186
|
-
};
|
|
187
|
-
auto: {
|
|
188
|
-
servers: number;
|
|
189
|
-
tools: number;
|
|
190
|
-
};
|
|
191
|
-
default: {
|
|
192
|
-
servers: number;
|
|
193
|
-
tools: number;
|
|
194
|
-
};
|
|
195
|
-
total: {
|
|
196
|
-
servers: number;
|
|
197
|
-
tools: number;
|
|
198
|
-
};
|
|
199
|
-
};
|
|
50
|
+
executeTool(toolName: string, args: any, context: ExecutionContext): Promise<ToolExecutionResult>;
|
|
200
51
|
/**
|
|
201
|
-
*
|
|
52
|
+
* Lazily activate a server by ID
|
|
202
53
|
*/
|
|
203
|
-
|
|
54
|
+
lazyActivateServer(serverId: string): Promise<boolean>;
|
|
204
55
|
/**
|
|
205
|
-
*
|
|
56
|
+
* Register a manual server
|
|
206
57
|
*/
|
|
207
|
-
|
|
58
|
+
registerManualServer(id: string, server: any): void;
|
|
208
59
|
/**
|
|
209
|
-
* Get
|
|
60
|
+
* Get registry statistics
|
|
210
61
|
*/
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
auto: {
|
|
217
|
-
servers: number;
|
|
218
|
-
tools: number;
|
|
219
|
-
};
|
|
220
|
-
default: {
|
|
62
|
+
getStats(): Promise<{
|
|
63
|
+
total: number;
|
|
64
|
+
bySource: Record<string, number>;
|
|
65
|
+
byType: Record<string, number>;
|
|
66
|
+
manual?: {
|
|
221
67
|
servers: number;
|
|
222
|
-
tools: number;
|
|
223
68
|
};
|
|
224
|
-
|
|
69
|
+
auto?: {
|
|
225
70
|
servers: number;
|
|
226
|
-
tools: number;
|
|
227
71
|
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
* Activate discovered servers by testing connectivity and loading available tools
|
|
231
|
-
*/
|
|
232
|
-
private activateDiscoveredServers;
|
|
233
|
-
/**
|
|
234
|
-
* Activate a single server by testing connectivity and loading tools
|
|
235
|
-
*/
|
|
236
|
-
private activateServer;
|
|
237
|
-
/**
|
|
238
|
-
* Test server connectivity
|
|
239
|
-
*/
|
|
240
|
-
private testServerConnectivity;
|
|
241
|
-
/**
|
|
242
|
-
* Load tools from a server
|
|
243
|
-
*/
|
|
244
|
-
private loadServerTools;
|
|
245
|
-
/**
|
|
246
|
-
* Properly cleanup child process and its streams to prevent hanging
|
|
247
|
-
*/
|
|
248
|
-
private cleanupChildProcess;
|
|
249
|
-
/**
|
|
250
|
-
* Create a server instance from config and tools
|
|
251
|
-
*/
|
|
252
|
-
private createServerInstance;
|
|
253
|
-
/**
|
|
254
|
-
* Get count of activated servers
|
|
255
|
-
*/
|
|
256
|
-
getAvailableServerCount(): number;
|
|
257
|
-
/**
|
|
258
|
-
* Get count of tools from activated servers
|
|
259
|
-
*/
|
|
260
|
-
private getActivatedToolCount;
|
|
72
|
+
tools?: number;
|
|
73
|
+
}>;
|
|
261
74
|
/**
|
|
262
|
-
*
|
|
75
|
+
* Clear all registries
|
|
263
76
|
*/
|
|
264
|
-
|
|
77
|
+
clear(): void;
|
|
265
78
|
}
|
|
266
79
|
/**
|
|
267
80
|
* Default unified registry instance
|
|
268
81
|
*/
|
|
269
|
-
export declare const
|
|
82
|
+
export declare const unifiedRegistry: UnifiedMCPRegistry;
|