@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
package/dist/core/factory.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GoogleVertexAI, AmazonBedrock, OpenAI, AnthropicProvider, AzureOpenAIProvider, GoogleAIStudio, HuggingFace, Ollama, MistralAI, } from "../providers/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getBestProviderSync } from "../utils/providerUtils.js";
|
|
3
3
|
import { logger } from "../utils/logger.js";
|
|
4
4
|
import { dynamicModelProvider } from "./dynamic-models.js";
|
|
5
5
|
const componentIdentifier = "aiProviderFactory";
|
|
@@ -157,16 +157,15 @@ export class AIProviderFactory {
|
|
|
157
157
|
// Wrap with MCP if enabled
|
|
158
158
|
if (enableMCP) {
|
|
159
159
|
try {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
// logger.debug(`[${functionTag}] Provider wrapped with MCP support`);
|
|
160
|
+
logger.debug(`[${functionTag}] Enabling MCP wrapping for AI integration`);
|
|
161
|
+
const { createMCPAwareProviderV3 } = await import("../providers/function-calling-provider.js");
|
|
162
|
+
provider = createMCPAwareProviderV3(provider, {
|
|
163
|
+
providerName,
|
|
164
|
+
modelName: resolvedModelName || undefined,
|
|
165
|
+
enableMCP: true,
|
|
166
|
+
enableFunctionCalling: true,
|
|
167
|
+
});
|
|
168
|
+
logger.debug(`[${functionTag}] Provider wrapped with MCP support`);
|
|
170
169
|
}
|
|
171
170
|
catch (mcpError) {
|
|
172
171
|
logger.warn(`[${functionTag}] Failed to wrap with MCP, using base provider`, {
|
|
@@ -233,7 +232,7 @@ export class AIProviderFactory {
|
|
|
233
232
|
static async createBestProvider(requestedProvider, modelName, enableMCP = true) {
|
|
234
233
|
const functionTag = "AIProviderFactory.createBestProvider";
|
|
235
234
|
try {
|
|
236
|
-
const bestProvider =
|
|
235
|
+
const bestProvider = getBestProviderSync(requestedProvider);
|
|
237
236
|
logger.debug(`[${functionTag}] Best provider selected`, {
|
|
238
237
|
requestedProvider: requestedProvider || "auto",
|
|
239
238
|
selectedProvider: bestProvider,
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, }
|
|
|
13
13
|
export { GoogleVertexAI, AmazonBedrock, OpenAI, AnthropicProvider, AzureOpenAIProvider, } from "./providers/index.js";
|
|
14
14
|
export type { ProviderName } from "./providers/index.js";
|
|
15
15
|
export { PROVIDERS, AVAILABLE_PROVIDERS } from "./providers/index.js";
|
|
16
|
-
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
16
|
+
export { getBestProviderSync as getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
17
17
|
export { NeuroLink } from "./neurolink.js";
|
|
18
18
|
export type { TextGenerationOptions, StreamTextOptions, TextGenerationResult, } from "./neurolink.js";
|
|
19
19
|
export declare const VERSION = "1.0.0";
|
|
@@ -54,3 +54,26 @@ export declare function createAIProviderWithFallback(primaryProvider?: string, f
|
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
export declare function createBestAIProvider(requestedProvider?: string, modelName?: string): Promise<import("./core/types.js").AIProvider>;
|
|
57
|
+
/**
|
|
58
|
+
* MCP (Model Context Protocol) Plugin Ecosystem
|
|
59
|
+
*
|
|
60
|
+
* Extensible plugin architecture based on research blueprint for
|
|
61
|
+
* transforming NeuroLink into a Universal AI Development Platform.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* import { mcpEcosystem, readFile, writeFile } from 'neurolink';
|
|
66
|
+
*
|
|
67
|
+
* // Initialize the ecosystem
|
|
68
|
+
* await mcpEcosystem.initialize();
|
|
69
|
+
*
|
|
70
|
+
* // List available plugins
|
|
71
|
+
* const plugins = await mcpEcosystem.list();
|
|
72
|
+
*
|
|
73
|
+
* // Use filesystem operations
|
|
74
|
+
* const content = await readFile('README.md');
|
|
75
|
+
* await writeFile('output.txt', 'Hello from MCP!');
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export { MCPEcosystem, mcpEcosystem, initializeMCPEcosystem, PluginManager, pluginManager, listMCPs, executeMCP, getMCPStats, readFile, writeFile, listFiles, createDirectory, MCP, SecurityManager, mcpLogger, FileSystemMCP, } from "./mcp/index.js";
|
|
79
|
+
export type { MCPMetadata, ExecutionContext, MCPConstructor, MCPInstance, DiscoveredMCP, LogLevel, } from "./mcp/index.js";
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, }
|
|
|
15
15
|
export { GoogleVertexAI, AmazonBedrock, OpenAI, AnthropicProvider, AzureOpenAIProvider, } from "./providers/index.js";
|
|
16
16
|
export { PROVIDERS, AVAILABLE_PROVIDERS } from "./providers/index.js";
|
|
17
17
|
// Utility exports
|
|
18
|
-
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
18
|
+
export { getBestProviderSync as getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
19
19
|
// Main NeuroLink wrapper class
|
|
20
20
|
export { NeuroLink } from "./neurolink.js";
|
|
21
21
|
// Version
|
|
@@ -60,3 +60,38 @@ export async function createAIProviderWithFallback(primaryProvider, fallbackProv
|
|
|
60
60
|
export async function createBestAIProvider(requestedProvider, modelName) {
|
|
61
61
|
return await AIProviderFactory.createBestProvider(requestedProvider, modelName);
|
|
62
62
|
}
|
|
63
|
+
// ============================================================================
|
|
64
|
+
// MCP PLUGIN ECOSYSTEM - Universal AI Development Platform
|
|
65
|
+
// ============================================================================
|
|
66
|
+
/**
|
|
67
|
+
* MCP (Model Context Protocol) Plugin Ecosystem
|
|
68
|
+
*
|
|
69
|
+
* Extensible plugin architecture based on research blueprint for
|
|
70
|
+
* transforming NeuroLink into a Universal AI Development Platform.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* import { mcpEcosystem, readFile, writeFile } from 'neurolink';
|
|
75
|
+
*
|
|
76
|
+
* // Initialize the ecosystem
|
|
77
|
+
* await mcpEcosystem.initialize();
|
|
78
|
+
*
|
|
79
|
+
* // List available plugins
|
|
80
|
+
* const plugins = await mcpEcosystem.list();
|
|
81
|
+
*
|
|
82
|
+
* // Use filesystem operations
|
|
83
|
+
* const content = await readFile('README.md');
|
|
84
|
+
* await writeFile('output.txt', 'Hello from MCP!');
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export {
|
|
88
|
+
// Core MCP ecosystem
|
|
89
|
+
MCPEcosystem, mcpEcosystem, initializeMCPEcosystem,
|
|
90
|
+
// Plugin management
|
|
91
|
+
PluginManager, pluginManager, listMCPs, executeMCP, getMCPStats,
|
|
92
|
+
// Quick filesystem operations
|
|
93
|
+
readFile, writeFile, listFiles, createDirectory,
|
|
94
|
+
// Core contracts and types
|
|
95
|
+
MCP, SecurityManager, mcpLogger,
|
|
96
|
+
// Core plugins
|
|
97
|
+
FileSystemMCP, } from "./mcp/index.js";
|
|
@@ -280,12 +280,12 @@ export declare const directAgentTools: {
|
|
|
280
280
|
pattern: z.ZodString;
|
|
281
281
|
recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
282
282
|
}, "strip", z.ZodTypeAny, {
|
|
283
|
-
pattern: string;
|
|
284
283
|
directory: string;
|
|
284
|
+
pattern: string;
|
|
285
285
|
recursive: boolean;
|
|
286
286
|
}, {
|
|
287
|
-
pattern: string;
|
|
288
287
|
directory: string;
|
|
288
|
+
pattern: string;
|
|
289
289
|
recursive?: boolean | undefined;
|
|
290
290
|
}>, {
|
|
291
291
|
success: boolean;
|
|
@@ -315,8 +315,8 @@ export declare const directAgentTools: {
|
|
|
315
315
|
count?: undefined;
|
|
316
316
|
}> & {
|
|
317
317
|
execute: (args: {
|
|
318
|
-
pattern: string;
|
|
319
318
|
directory: string;
|
|
319
|
+
pattern: string;
|
|
320
320
|
recursive: boolean;
|
|
321
321
|
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
|
|
322
322
|
success: boolean;
|
|
@@ -623,12 +623,12 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
|
|
|
623
623
|
pattern: z.ZodString;
|
|
624
624
|
recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
625
625
|
}, "strip", z.ZodTypeAny, {
|
|
626
|
-
pattern: string;
|
|
627
626
|
directory: string;
|
|
627
|
+
pattern: string;
|
|
628
628
|
recursive: boolean;
|
|
629
629
|
}, {
|
|
630
|
-
pattern: string;
|
|
631
630
|
directory: string;
|
|
631
|
+
pattern: string;
|
|
632
632
|
recursive?: boolean | undefined;
|
|
633
633
|
}>, {
|
|
634
634
|
success: boolean;
|
|
@@ -658,8 +658,8 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
|
|
|
658
658
|
count?: undefined;
|
|
659
659
|
}> & {
|
|
660
660
|
execute: (args: {
|
|
661
|
-
pattern: string;
|
|
662
661
|
directory: string;
|
|
662
|
+
pattern: string;
|
|
663
663
|
recursive: boolean;
|
|
664
664
|
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
|
|
665
665
|
success: boolean;
|
|
@@ -967,12 +967,12 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
|
|
|
967
967
|
pattern: z.ZodString;
|
|
968
968
|
recursive: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
969
969
|
}, "strip", z.ZodTypeAny, {
|
|
970
|
-
pattern: string;
|
|
971
970
|
directory: string;
|
|
971
|
+
pattern: string;
|
|
972
972
|
recursive: boolean;
|
|
973
973
|
}, {
|
|
974
|
-
pattern: string;
|
|
975
974
|
directory: string;
|
|
975
|
+
pattern: string;
|
|
976
976
|
recursive?: boolean | undefined;
|
|
977
977
|
}>, {
|
|
978
978
|
success: boolean;
|
|
@@ -1002,8 +1002,8 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
|
|
|
1002
1002
|
count?: undefined;
|
|
1003
1003
|
}> & {
|
|
1004
1004
|
execute: (args: {
|
|
1005
|
-
pattern: string;
|
|
1006
1005
|
directory: string;
|
|
1006
|
+
pattern: string;
|
|
1007
1007
|
recursive: boolean;
|
|
1008
1008
|
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
|
|
1009
1009
|
success: boolean;
|
package/dist/lib/core/factory.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GoogleVertexAI, AmazonBedrock, OpenAI, AnthropicProvider, AzureOpenAIProvider, GoogleAIStudio, HuggingFace, Ollama, MistralAI, } from "../providers/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getBestProviderSync } from "../utils/providerUtils.js";
|
|
3
3
|
import { logger } from "../utils/logger.js";
|
|
4
4
|
import { dynamicModelProvider } from "./dynamic-models.js";
|
|
5
5
|
const componentIdentifier = "aiProviderFactory";
|
|
@@ -157,16 +157,15 @@ export class AIProviderFactory {
|
|
|
157
157
|
// Wrap with MCP if enabled
|
|
158
158
|
if (enableMCP) {
|
|
159
159
|
try {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
// logger.debug(`[${functionTag}] Provider wrapped with MCP support`);
|
|
160
|
+
logger.debug(`[${functionTag}] Enabling MCP wrapping for AI integration`);
|
|
161
|
+
const { createMCPAwareProviderV3 } = await import("../providers/function-calling-provider.js");
|
|
162
|
+
provider = createMCPAwareProviderV3(provider, {
|
|
163
|
+
providerName,
|
|
164
|
+
modelName: resolvedModelName || undefined,
|
|
165
|
+
enableMCP: true,
|
|
166
|
+
enableFunctionCalling: true,
|
|
167
|
+
});
|
|
168
|
+
logger.debug(`[${functionTag}] Provider wrapped with MCP support`);
|
|
170
169
|
}
|
|
171
170
|
catch (mcpError) {
|
|
172
171
|
logger.warn(`[${functionTag}] Failed to wrap with MCP, using base provider`, {
|
|
@@ -233,7 +232,7 @@ export class AIProviderFactory {
|
|
|
233
232
|
static async createBestProvider(requestedProvider, modelName, enableMCP = true) {
|
|
234
233
|
const functionTag = "AIProviderFactory.createBestProvider";
|
|
235
234
|
try {
|
|
236
|
-
const bestProvider =
|
|
235
|
+
const bestProvider = getBestProviderSync(requestedProvider);
|
|
237
236
|
logger.debug(`[${functionTag}] Best provider selected`, {
|
|
238
237
|
requestedProvider: requestedProvider || "auto",
|
|
239
238
|
selectedProvider: bestProvider,
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, }
|
|
|
13
13
|
export { GoogleVertexAI, AmazonBedrock, OpenAI, AnthropicProvider, AzureOpenAIProvider, } from "./providers/index.js";
|
|
14
14
|
export type { ProviderName } from "./providers/index.js";
|
|
15
15
|
export { PROVIDERS, AVAILABLE_PROVIDERS } from "./providers/index.js";
|
|
16
|
-
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
16
|
+
export { getBestProviderSync as getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
17
17
|
export { NeuroLink } from "./neurolink.js";
|
|
18
18
|
export type { TextGenerationOptions, StreamTextOptions, TextGenerationResult, } from "./neurolink.js";
|
|
19
19
|
export declare const VERSION = "1.0.0";
|
|
@@ -54,3 +54,26 @@ export declare function createAIProviderWithFallback(primaryProvider?: string, f
|
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
export declare function createBestAIProvider(requestedProvider?: string, modelName?: string): Promise<import("./index.js").AIProvider>;
|
|
57
|
+
/**
|
|
58
|
+
* MCP (Model Context Protocol) Plugin Ecosystem
|
|
59
|
+
*
|
|
60
|
+
* Extensible plugin architecture based on research blueprint for
|
|
61
|
+
* transforming NeuroLink into a Universal AI Development Platform.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* import { mcpEcosystem, readFile, writeFile } from 'neurolink';
|
|
66
|
+
*
|
|
67
|
+
* // Initialize the ecosystem
|
|
68
|
+
* await mcpEcosystem.initialize();
|
|
69
|
+
*
|
|
70
|
+
* // List available plugins
|
|
71
|
+
* const plugins = await mcpEcosystem.list();
|
|
72
|
+
*
|
|
73
|
+
* // Use filesystem operations
|
|
74
|
+
* const content = await readFile('README.md');
|
|
75
|
+
* await writeFile('output.txt', 'Hello from MCP!');
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export { MCPEcosystem, mcpEcosystem, initializeMCPEcosystem, PluginManager, pluginManager, listMCPs, executeMCP, getMCPStats, readFile, writeFile, listFiles, createDirectory, MCP, SecurityManager, mcpLogger, FileSystemMCP, } from "./mcp/index.js";
|
|
79
|
+
export type { MCPMetadata, ExecutionContext, MCPConstructor, MCPInstance, DiscoveredMCP, LogLevel, } from "./mcp/index.js";
|
package/dist/lib/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, }
|
|
|
15
15
|
export { GoogleVertexAI, AmazonBedrock, OpenAI, AnthropicProvider, AzureOpenAIProvider, } from "./providers/index.js";
|
|
16
16
|
export { PROVIDERS, AVAILABLE_PROVIDERS } from "./providers/index.js";
|
|
17
17
|
// Utility exports
|
|
18
|
-
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
18
|
+
export { getBestProviderSync as getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
19
19
|
// Main NeuroLink wrapper class
|
|
20
20
|
export { NeuroLink } from "./neurolink.js";
|
|
21
21
|
// Version
|
|
@@ -60,3 +60,38 @@ export async function createAIProviderWithFallback(primaryProvider, fallbackProv
|
|
|
60
60
|
export async function createBestAIProvider(requestedProvider, modelName) {
|
|
61
61
|
return await AIProviderFactory.createBestProvider(requestedProvider, modelName);
|
|
62
62
|
}
|
|
63
|
+
// ============================================================================
|
|
64
|
+
// MCP PLUGIN ECOSYSTEM - Universal AI Development Platform
|
|
65
|
+
// ============================================================================
|
|
66
|
+
/**
|
|
67
|
+
* MCP (Model Context Protocol) Plugin Ecosystem
|
|
68
|
+
*
|
|
69
|
+
* Extensible plugin architecture based on research blueprint for
|
|
70
|
+
* transforming NeuroLink into a Universal AI Development Platform.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* import { mcpEcosystem, readFile, writeFile } from 'neurolink';
|
|
75
|
+
*
|
|
76
|
+
* // Initialize the ecosystem
|
|
77
|
+
* await mcpEcosystem.initialize();
|
|
78
|
+
*
|
|
79
|
+
* // List available plugins
|
|
80
|
+
* const plugins = await mcpEcosystem.list();
|
|
81
|
+
*
|
|
82
|
+
* // Use filesystem operations
|
|
83
|
+
* const content = await readFile('README.md');
|
|
84
|
+
* await writeFile('output.txt', 'Hello from MCP!');
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export {
|
|
88
|
+
// Core MCP ecosystem
|
|
89
|
+
MCPEcosystem, mcpEcosystem, initializeMCPEcosystem,
|
|
90
|
+
// Plugin management
|
|
91
|
+
PluginManager, pluginManager, listMCPs, executeMCP, getMCPStats,
|
|
92
|
+
// Quick filesystem operations
|
|
93
|
+
readFile, writeFile, listFiles, createDirectory,
|
|
94
|
+
// Core contracts and types
|
|
95
|
+
MCP, SecurityManager, mcpLogger,
|
|
96
|
+
// Core plugins
|
|
97
|
+
FileSystemMCP, } from "./mcp/index.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Bridge Adapter
|
|
3
|
+
* Provides compatibility layer for existing MCP integrations
|
|
4
|
+
*/
|
|
5
|
+
import type { ExecutionContext } from "../contracts/mcp-contract.js";
|
|
6
|
+
/**
|
|
7
|
+
* Bridge interface for legacy MCP compatibility
|
|
8
|
+
*/
|
|
9
|
+
export interface LegacyMCPBridge {
|
|
10
|
+
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
11
|
+
readFile: (filePath: string) => Promise<string>;
|
|
12
|
+
listFiles: (dirPath: string) => Promise<string[]>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a bridge for legacy MCP integrations
|
|
16
|
+
*/
|
|
17
|
+
export declare function createLegacyBridge(context: ExecutionContext): LegacyMCPBridge;
|
|
18
|
+
/**
|
|
19
|
+
* Enhanced execution context with bridge compatibility
|
|
20
|
+
*/
|
|
21
|
+
export declare function enhanceExecutionContext(context: ExecutionContext): ExecutionContext;
|
|
22
|
+
/**
|
|
23
|
+
* Utility function to adapt legacy MCP calls
|
|
24
|
+
*/
|
|
25
|
+
export declare function adaptLegacyMCPCall(context: ExecutionContext, operation: string, ...args: any[]): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Quick plugin factory for simple plugin creation
|
|
28
|
+
*/
|
|
29
|
+
export declare class QuickPluginFactory {
|
|
30
|
+
static create(name: string, config: any): Promise<{
|
|
31
|
+
name: string;
|
|
32
|
+
config: any;
|
|
33
|
+
initialized: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Execute plugin with enhanced context
|
|
38
|
+
*/
|
|
39
|
+
export declare function executePlugin(plugin: any, context: ExecutionContext, operation: string, ...args: any[]): Promise<any>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Bridge Adapter
|
|
3
|
+
* Provides compatibility layer for existing MCP integrations
|
|
4
|
+
*/
|
|
5
|
+
import * as path from "path";
|
|
6
|
+
/**
|
|
7
|
+
* Create a bridge for legacy MCP integrations
|
|
8
|
+
*/
|
|
9
|
+
export function createLegacyBridge(context) {
|
|
10
|
+
const basePath = process.cwd();
|
|
11
|
+
return {
|
|
12
|
+
async writeFile(filePath, content) {
|
|
13
|
+
const fullPath = path.resolve(basePath, filePath);
|
|
14
|
+
await context.secureFS.writeFile(fullPath, content);
|
|
15
|
+
},
|
|
16
|
+
async readFile(filePath) {
|
|
17
|
+
const fullPath = path.resolve(basePath, filePath);
|
|
18
|
+
const result = await context.secureFS.readFile(fullPath, "utf-8");
|
|
19
|
+
return typeof result === "string" ? result : result.toString();
|
|
20
|
+
},
|
|
21
|
+
async listFiles(dirPath) {
|
|
22
|
+
const fullPath = path.resolve(basePath, dirPath);
|
|
23
|
+
return await context.secureFS.readdir(fullPath);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Enhanced execution context with bridge compatibility
|
|
29
|
+
*/
|
|
30
|
+
export function enhanceExecutionContext(context) {
|
|
31
|
+
return {
|
|
32
|
+
...context,
|
|
33
|
+
path: {
|
|
34
|
+
join: path.join,
|
|
35
|
+
resolve: path.resolve,
|
|
36
|
+
relative: path.relative,
|
|
37
|
+
dirname: path.dirname,
|
|
38
|
+
basename: path.basename,
|
|
39
|
+
},
|
|
40
|
+
plugin: createLegacyBridge(context),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Utility function to adapt legacy MCP calls
|
|
45
|
+
*/
|
|
46
|
+
export async function adaptLegacyMCPCall(context, operation, ...args) {
|
|
47
|
+
const bridge = createLegacyBridge(context);
|
|
48
|
+
switch (operation) {
|
|
49
|
+
case "writeFile":
|
|
50
|
+
return bridge.writeFile(args[0], args[1]);
|
|
51
|
+
case "readFile":
|
|
52
|
+
return bridge.readFile(args[0]);
|
|
53
|
+
case "listFiles":
|
|
54
|
+
return bridge.listFiles(args[0]);
|
|
55
|
+
default:
|
|
56
|
+
throw new Error(`Unsupported legacy operation: ${operation}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Quick plugin factory for simple plugin creation
|
|
61
|
+
*/
|
|
62
|
+
export class QuickPluginFactory {
|
|
63
|
+
static async create(name, config) {
|
|
64
|
+
// Simple factory implementation
|
|
65
|
+
return {
|
|
66
|
+
name,
|
|
67
|
+
config,
|
|
68
|
+
initialized: true,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Execute plugin with enhanced context
|
|
74
|
+
*/
|
|
75
|
+
export async function executePlugin(plugin, context, operation, ...args) {
|
|
76
|
+
const enhancedContext = enhanceExecutionContext(context);
|
|
77
|
+
if (typeof plugin.execute === "function") {
|
|
78
|
+
return plugin.execute(enhancedContext, { operation, args });
|
|
79
|
+
}
|
|
80
|
+
// Fallback to legacy adaptation
|
|
81
|
+
return adaptLegacyMCPCall(enhancedContext, operation, ...args);
|
|
82
|
+
}
|
|
@@ -1,120 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Supports VS Code, Cursor, Claude Desktop, Windsurf, Roo Code, and generic configurations
|
|
2
|
+
* Auto-Discovery Module for MCP Plugins
|
|
3
|
+
* Handles automatic plugin discovery and registration
|
|
5
4
|
*/
|
|
6
|
-
import {
|
|
5
|
+
import type { DiscoveredMCP } from "./contracts/mcp-contract.js";
|
|
7
6
|
/**
|
|
8
|
-
*
|
|
7
|
+
* Auto-discovery configuration
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
args?: string[];
|
|
15
|
-
env?: Record<string, string>;
|
|
16
|
-
cwd?: string;
|
|
17
|
-
source: DiscoverySource;
|
|
18
|
-
configPath: string;
|
|
19
|
-
rawConfig: any;
|
|
9
|
+
interface AutoDiscoveryConfig {
|
|
10
|
+
searchPaths: string[];
|
|
11
|
+
manifestName: string;
|
|
12
|
+
maxDepth: number;
|
|
20
13
|
}
|
|
21
14
|
/**
|
|
22
|
-
*
|
|
15
|
+
* Auto-discovery service for MCP plugins
|
|
23
16
|
*/
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
priority: number;
|
|
28
|
-
description: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Discovery configuration options
|
|
32
|
-
*/
|
|
33
|
-
export interface DiscoveryOptions {
|
|
34
|
-
searchWorkspace?: boolean;
|
|
35
|
-
searchGlobal?: boolean;
|
|
36
|
-
searchCommonPaths?: boolean;
|
|
37
|
-
followSymlinks?: boolean;
|
|
38
|
-
maxDepth?: number;
|
|
39
|
-
includeInactive?: boolean;
|
|
40
|
-
preferredTools?: string[];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Discovery result
|
|
44
|
-
*/
|
|
45
|
-
export interface DiscoveryResult {
|
|
46
|
-
discovered: DiscoveredMCPServer[];
|
|
47
|
-
sources: DiscoverySource[];
|
|
48
|
-
errors: string[];
|
|
49
|
-
stats: {
|
|
50
|
-
configFilesFound: number;
|
|
51
|
-
serversDiscovered: number;
|
|
52
|
-
duplicatesRemoved: number;
|
|
53
|
-
executionTime: number;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* MCP Auto-Discovery Engine
|
|
58
|
-
*/
|
|
59
|
-
export declare class MCPAutoDiscovery {
|
|
60
|
-
private parsers;
|
|
61
|
-
/**
|
|
62
|
-
* Discover MCP servers from all common locations
|
|
63
|
-
*
|
|
64
|
-
* @param options Discovery configuration options
|
|
65
|
-
* @returns Discovery result with found servers
|
|
66
|
-
*/
|
|
67
|
-
discoverServers(options?: DiscoveryOptions): Promise<DiscoveryResult>;
|
|
68
|
-
/**
|
|
69
|
-
* Auto-register discovered servers with a registry
|
|
70
|
-
*
|
|
71
|
-
* @param registry Target MCP registry
|
|
72
|
-
* @param options Discovery options
|
|
73
|
-
* @returns Registration results
|
|
74
|
-
*/
|
|
75
|
-
autoRegisterServers(registry: MCPToolRegistry, options?: DiscoveryOptions): Promise<{
|
|
76
|
-
registered: string[];
|
|
77
|
-
failed: string[];
|
|
78
|
-
errors: string[];
|
|
79
|
-
}>;
|
|
80
|
-
/**
|
|
81
|
-
* Get standard search paths for MCP configurations
|
|
82
|
-
*/
|
|
83
|
-
private getSearchPaths;
|
|
84
|
-
/**
|
|
85
|
-
* Search a specific path for MCP configurations
|
|
86
|
-
*/
|
|
87
|
-
private searchPath;
|
|
17
|
+
export declare class AutoDiscovery {
|
|
18
|
+
private config;
|
|
19
|
+
constructor(config?: Partial<AutoDiscoveryConfig>);
|
|
88
20
|
/**
|
|
89
|
-
*
|
|
21
|
+
* Discover all available MCP plugins
|
|
90
22
|
*/
|
|
91
|
-
|
|
23
|
+
discover(): Promise<DiscoveredMCP[]>;
|
|
92
24
|
/**
|
|
93
|
-
*
|
|
25
|
+
* Discover plugins in a specific path
|
|
94
26
|
*/
|
|
95
|
-
private
|
|
27
|
+
private discoverInPath;
|
|
96
28
|
/**
|
|
97
|
-
*
|
|
29
|
+
* Load plugin from manifest
|
|
98
30
|
*/
|
|
99
|
-
private
|
|
31
|
+
private loadPlugin;
|
|
100
32
|
/**
|
|
101
|
-
*
|
|
33
|
+
* Determine plugin source based on path
|
|
102
34
|
*/
|
|
103
|
-
private
|
|
35
|
+
private determineSource;
|
|
104
36
|
}
|
|
105
37
|
/**
|
|
106
38
|
* Default auto-discovery instance
|
|
107
39
|
*/
|
|
108
|
-
export declare const
|
|
40
|
+
export declare const autoDiscovery: AutoDiscovery;
|
|
41
|
+
/**
|
|
42
|
+
* Discovery options interface
|
|
43
|
+
*/
|
|
44
|
+
export interface DiscoveryOptions {
|
|
45
|
+
searchPaths?: string[];
|
|
46
|
+
manifestName?: string;
|
|
47
|
+
maxDepth?: number;
|
|
48
|
+
includeDevPlugins?: boolean;
|
|
49
|
+
}
|
|
109
50
|
/**
|
|
110
|
-
*
|
|
51
|
+
* Discover MCP servers using auto-discovery
|
|
111
52
|
*/
|
|
112
|
-
export declare function discoverMCPServers(options?: DiscoveryOptions): Promise<
|
|
53
|
+
export declare function discoverMCPServers(options?: DiscoveryOptions): Promise<DiscoveredMCP[]>;
|
|
113
54
|
/**
|
|
114
|
-
*
|
|
55
|
+
* Auto-register discovered MCP servers
|
|
115
56
|
*/
|
|
116
|
-
export declare function autoRegisterMCPServers(
|
|
117
|
-
registered:
|
|
118
|
-
failed:
|
|
119
|
-
|
|
57
|
+
export declare function autoRegisterMCPServers(options?: DiscoveryOptions): Promise<{
|
|
58
|
+
registered: number;
|
|
59
|
+
failed: number;
|
|
60
|
+
plugins: DiscoveredMCP[];
|
|
120
61
|
}>;
|
|
62
|
+
export {};
|