@juspay/neurolink 5.1.0 ā 5.3.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 +21 -9
- package/README.md +123 -126
- package/dist/agent/direct-tools.d.ts +6 -6
- package/dist/cli/commands/config.d.ts +3 -3
- package/dist/cli/commands/mcp.js +8 -7
- package/dist/cli/factories/command-factory.d.ts +4 -0
- package/dist/cli/factories/command-factory.js +63 -8
- package/dist/cli/index.js +87 -140
- package/dist/core/base-provider.d.ts +423 -0
- package/dist/core/base-provider.js +376 -0
- package/dist/core/constants.d.ts +2 -1
- package/dist/core/constants.js +2 -1
- package/dist/core/dynamic-models.d.ts +6 -6
- package/dist/core/evaluation.d.ts +19 -80
- package/dist/core/evaluation.js +185 -484
- package/dist/core/factory.d.ts +3 -3
- package/dist/core/factory.js +31 -91
- package/dist/core/service-registry.d.ts +47 -0
- package/dist/core/service-registry.js +112 -0
- package/dist/core/types.d.ts +8 -1
- package/dist/factories/compatibility-factory.js +1 -1
- package/dist/factories/provider-factory.d.ts +72 -0
- package/dist/factories/provider-factory.js +144 -0
- package/dist/factories/provider-registry.d.ts +38 -0
- package/dist/factories/provider-registry.js +107 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +2 -4
- package/dist/lib/agent/direct-tools.d.ts +6 -6
- package/dist/lib/core/base-provider.d.ts +423 -0
- package/dist/lib/core/base-provider.js +376 -0
- package/dist/lib/core/constants.d.ts +2 -1
- package/dist/lib/core/constants.js +2 -1
- package/dist/lib/core/dynamic-models.d.ts +6 -6
- package/dist/lib/core/evaluation.d.ts +19 -80
- package/dist/lib/core/evaluation.js +185 -484
- package/dist/lib/core/factory.d.ts +3 -3
- package/dist/lib/core/factory.js +30 -91
- package/dist/lib/core/service-registry.d.ts +47 -0
- package/dist/lib/core/service-registry.js +112 -0
- package/dist/lib/core/types.d.ts +8 -1
- package/dist/lib/factories/compatibility-factory.js +1 -1
- package/dist/lib/factories/provider-factory.d.ts +72 -0
- package/dist/lib/factories/provider-factory.js +144 -0
- package/dist/lib/factories/provider-registry.d.ts +38 -0
- package/dist/lib/factories/provider-registry.js +107 -0
- package/dist/lib/index.d.ts +4 -3
- package/dist/lib/index.js +2 -4
- package/dist/lib/mcp/client.d.ts +1 -0
- package/dist/lib/mcp/client.js +1 -0
- package/dist/lib/mcp/config.js +28 -3
- package/dist/lib/mcp/context-manager.d.ts +1 -0
- package/dist/lib/mcp/context-manager.js +8 -4
- package/dist/lib/mcp/function-calling.d.ts +13 -0
- package/dist/lib/mcp/function-calling.js +134 -35
- package/dist/lib/mcp/initialize-tools.d.ts +1 -1
- package/dist/lib/mcp/initialize-tools.js +45 -1
- package/dist/lib/mcp/initialize.js +16 -6
- package/dist/lib/mcp/neurolink-mcp-client.d.ts +1 -0
- package/dist/lib/mcp/neurolink-mcp-client.js +21 -5
- package/dist/lib/mcp/servers/agent/direct-tools-server.d.ts +8 -0
- package/dist/lib/mcp/servers/agent/direct-tools-server.js +109 -0
- package/dist/lib/mcp/servers/ai-providers/ai-core-server.js +3 -1
- package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
- package/dist/lib/mcp/unified-registry.d.ts +4 -0
- package/dist/lib/mcp/unified-registry.js +42 -9
- package/dist/lib/neurolink.d.ts +156 -117
- package/dist/lib/neurolink.js +619 -404
- package/dist/lib/providers/amazon-bedrock.d.ts +32 -0
- package/dist/lib/providers/amazon-bedrock.js +143 -0
- package/dist/lib/providers/analytics-helper.js +7 -4
- package/dist/lib/providers/anthropic-baseprovider.d.ts +23 -0
- package/dist/lib/providers/anthropic-baseprovider.js +114 -0
- package/dist/lib/providers/anthropic.d.ts +19 -43
- package/dist/lib/providers/anthropic.js +82 -306
- package/dist/lib/providers/azure-openai.d.ts +20 -0
- package/dist/lib/providers/azure-openai.js +89 -0
- package/dist/lib/providers/function-calling-provider.d.ts +64 -2
- package/dist/lib/providers/function-calling-provider.js +208 -9
- package/dist/lib/providers/google-ai-studio.d.ts +23 -0
- package/dist/lib/providers/google-ai-studio.js +107 -0
- package/dist/lib/providers/google-vertex.d.ts +47 -0
- package/dist/lib/providers/google-vertex.js +205 -0
- package/dist/lib/providers/huggingFace.d.ts +32 -25
- package/dist/lib/providers/huggingFace.js +97 -431
- package/dist/lib/providers/index.d.ts +9 -9
- package/dist/lib/providers/index.js +9 -9
- package/dist/lib/providers/mcp-provider.js +24 -5
- package/dist/lib/providers/mistral.d.ts +42 -0
- package/dist/lib/providers/mistral.js +160 -0
- package/dist/lib/providers/ollama.d.ts +52 -36
- package/dist/lib/providers/ollama.js +297 -520
- package/dist/lib/providers/openAI.d.ts +19 -18
- package/dist/lib/providers/openAI.js +76 -275
- package/dist/lib/sdk/tool-extension.d.ts +181 -0
- package/dist/lib/sdk/tool-extension.js +283 -0
- package/dist/lib/sdk/tool-registration.d.ts +95 -0
- package/dist/lib/sdk/tool-registration.js +167 -0
- package/dist/lib/services/streaming/streaming-manager.js +11 -10
- package/dist/lib/services/websocket/websocket-server.js +12 -11
- package/dist/lib/telemetry/telemetry-service.js +8 -7
- package/dist/lib/types/generate-types.d.ts +1 -0
- package/dist/lib/types/mcp-types.d.ts +116 -0
- package/dist/lib/types/mcp-types.js +5 -0
- package/dist/lib/types/stream-types.d.ts +30 -18
- package/dist/lib/types/universal-provider-options.d.ts +87 -0
- package/dist/lib/types/universal-provider-options.js +53 -0
- package/dist/mcp/client.d.ts +1 -0
- package/dist/mcp/client.js +1 -0
- package/dist/mcp/config.js +28 -3
- package/dist/mcp/context-manager.d.ts +1 -0
- package/dist/mcp/context-manager.js +8 -4
- package/dist/mcp/function-calling.d.ts +13 -0
- package/dist/mcp/function-calling.js +134 -35
- package/dist/mcp/initialize-tools.d.ts +1 -1
- package/dist/mcp/initialize-tools.js +45 -1
- package/dist/mcp/initialize.js +16 -6
- package/dist/mcp/neurolink-mcp-client.d.ts +1 -0
- package/dist/mcp/neurolink-mcp-client.js +21 -5
- package/dist/mcp/servers/agent/direct-tools-server.d.ts +8 -0
- package/dist/mcp/servers/agent/direct-tools-server.js +109 -0
- package/dist/mcp/servers/ai-providers/ai-core-server.js +3 -1
- package/dist/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
- package/dist/mcp/unified-registry.d.ts +4 -0
- package/dist/mcp/unified-registry.js +42 -9
- package/dist/neurolink.d.ts +156 -117
- package/dist/neurolink.js +619 -404
- package/dist/providers/amazon-bedrock.d.ts +32 -0
- package/dist/providers/amazon-bedrock.js +143 -0
- package/dist/providers/analytics-helper.js +7 -4
- package/dist/providers/anthropic-baseprovider.d.ts +23 -0
- package/dist/providers/anthropic-baseprovider.js +114 -0
- package/dist/providers/anthropic.d.ts +19 -43
- package/dist/providers/anthropic.js +81 -305
- package/dist/providers/azure-openai.d.ts +20 -0
- package/dist/providers/azure-openai.js +89 -0
- package/dist/providers/function-calling-provider.d.ts +64 -2
- package/dist/providers/function-calling-provider.js +208 -9
- package/dist/providers/google-ai-studio.d.ts +23 -0
- package/dist/providers/google-ai-studio.js +108 -0
- package/dist/providers/google-vertex.d.ts +47 -0
- package/dist/providers/google-vertex.js +205 -0
- package/dist/providers/huggingFace.d.ts +32 -25
- package/dist/providers/huggingFace.js +96 -430
- package/dist/providers/index.d.ts +9 -9
- package/dist/providers/index.js +9 -9
- package/dist/providers/mcp-provider.js +24 -5
- package/dist/providers/mistral.d.ts +42 -0
- package/dist/providers/mistral.js +160 -0
- package/dist/providers/ollama.d.ts +52 -36
- package/dist/providers/ollama.js +297 -519
- package/dist/providers/openAI.d.ts +19 -18
- package/dist/providers/openAI.js +76 -276
- package/dist/sdk/tool-extension.d.ts +181 -0
- package/dist/sdk/tool-extension.js +283 -0
- package/dist/sdk/tool-registration.d.ts +95 -0
- package/dist/sdk/tool-registration.js +168 -0
- package/dist/services/streaming/streaming-manager.js +11 -10
- package/dist/services/websocket/websocket-server.js +12 -11
- package/dist/telemetry/telemetry-service.js +8 -7
- package/dist/types/generate-types.d.ts +1 -0
- package/dist/types/mcp-types.d.ts +116 -0
- package/dist/types/mcp-types.js +5 -0
- package/dist/types/stream-types.d.ts +30 -18
- package/dist/types/universal-provider-options.d.ts +87 -0
- package/dist/types/universal-provider-options.js +53 -0
- package/package.json +12 -5
- package/dist/lib/providers/agent-enhanced-provider.d.ts +0 -93
- package/dist/lib/providers/agent-enhanced-provider.js +0 -605
- package/dist/lib/providers/amazonBedrock.d.ts +0 -28
- package/dist/lib/providers/amazonBedrock.js +0 -364
- package/dist/lib/providers/azureOpenAI.d.ts +0 -42
- package/dist/lib/providers/azureOpenAI.js +0 -347
- package/dist/lib/providers/googleAIStudio.d.ts +0 -42
- package/dist/lib/providers/googleAIStudio.js +0 -364
- package/dist/lib/providers/googleVertexAI.d.ts +0 -34
- package/dist/lib/providers/googleVertexAI.js +0 -547
- package/dist/lib/providers/mistralAI.d.ts +0 -37
- package/dist/lib/providers/mistralAI.js +0 -325
- package/dist/providers/agent-enhanced-provider.d.ts +0 -93
- package/dist/providers/agent-enhanced-provider.js +0 -606
- package/dist/providers/amazonBedrock.d.ts +0 -28
- package/dist/providers/amazonBedrock.js +0 -364
- package/dist/providers/azureOpenAI.d.ts +0 -42
- package/dist/providers/azureOpenAI.js +0 -348
- package/dist/providers/googleAIStudio.d.ts +0 -42
- package/dist/providers/googleAIStudio.js +0 -364
- package/dist/providers/googleVertexAI.d.ts +0 -34
- package/dist/providers/googleVertexAI.js +0 -547
- package/dist/providers/mistralAI.d.ts +0 -37
- package/dist/providers/mistralAI.js +0 -325
package/CHANGELOG.md
CHANGED
|
@@ -1,30 +1,40 @@
|
|
|
1
|
-
# [5.
|
|
1
|
+
# [5.3.0](https://github.com/juspay/neurolink/compare/v5.2.0...v5.3.0) (2025-07-23)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
* **
|
|
6
|
+
* **mcp:** enhance MCP integration with comprehensive testing infrastructure and tool ecosystem improvements ([a38d845](https://github.com/juspay/neurolink/commit/a38d845032133eee098de10b966cbdd3a329fdfd))
|
|
7
7
|
|
|
8
|
-
# [5.
|
|
8
|
+
# [5.2.0](https://github.com/juspay/neurolink/compare/v5.1.0...v5.2.0) (2025-07-22)
|
|
9
9
|
|
|
10
|
+
### Features
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
- **core:** implement comprehensive factory pattern architecture with full MCP integration and provider unification ([b13963a](https://github.com/juspay/neurolink/commit/b13963aaf6f95233be8b1e9bdc69ce1b65604cdf))
|
|
12
13
|
|
|
14
|
+
# [5.1.0](https://github.com/juspay/neurolink/compare/v5.0.0...v5.1.0) (2025-07-13)
|
|
13
15
|
|
|
14
|
-
###
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- **core:** complete unified multimodal AI platform architecture with generate/stream unification ([846e409](https://github.com/juspay/neurolink/commit/846e409a4a77024ddee9961c9b5049bc99f8335e))
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
# [5.0.0](https://github.com/juspay/neurolink/compare/v4.2.0...v5.0.0) (2025-07-11)
|
|
21
|
+
|
|
22
|
+
- refactor(cli)!: remove agent-generate command, unify CLI to single generate command ([9c034b7](https://github.com/juspay/neurolink/commit/9c034b7b5a8df3b861fccae0e617c5aa4c85a903))
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
17
25
|
|
|
26
|
+
- **scripts:** update docs:generate to use docs:validate instead of removed docs:sync ([3277bab](https://github.com/juspay/neurolink/commit/3277bab3eb1cec24a60fe28bf3897fce63d83d3a))
|
|
18
27
|
|
|
19
28
|
### BREAKING CHANGES
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
- agent-generate command has been removed
|
|
22
31
|
|
|
23
|
-
The agent-generate command has been completely removed from the CLI. All
|
|
24
|
-
functionality is now available through the enhanced generate command with
|
|
32
|
+
The agent-generate command has been completely removed from the CLI. All
|
|
33
|
+
functionality is now available through the enhanced generate command with
|
|
25
34
|
tools enabled by default.
|
|
26
35
|
|
|
27
36
|
### Changes Made:
|
|
37
|
+
|
|
28
38
|
- Delete src/cli/commands/agent-generate.ts command implementation
|
|
29
39
|
- Remove agent-generate import and registration from src/cli/index.ts
|
|
30
40
|
- Update docs/CLI-GUIDE.md to remove agent-generate documentation
|
|
@@ -32,12 +42,14 @@ tools enabled by default.
|
|
|
32
42
|
- Remove agent-generate test cases from scripts/corrected-functionality-test.js
|
|
33
43
|
|
|
34
44
|
### Migration Guide:
|
|
45
|
+
|
|
35
46
|
- Replace `neurolink agent-generate "prompt"` with `neurolink generate "prompt"`
|
|
36
47
|
- Tools are enabled by default in generate command
|
|
37
48
|
- Use `--disable-tools` flag if tool-calling is not desired
|
|
38
49
|
- All previous agent-generate functionality available in generate command
|
|
39
50
|
|
|
40
51
|
### Technical Impact:
|
|
52
|
+
|
|
41
53
|
- Simplified CLI interface with single text generation command
|
|
42
54
|
- Reduced codebase complexity and maintenance overhead
|
|
43
55
|
- Enhanced generate command provides all tool-calling capabilities
|
package/README.md
CHANGED
|
@@ -7,26 +7,39 @@
|
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](https://github.com/juspay/neurolink/actions)
|
|
9
9
|
|
|
10
|
-
> Enterprise AI Development Platform with
|
|
10
|
+
> Enterprise AI Development Platform with built-in tools, universal provider support, and factory pattern architecture. Production-ready with TypeScript support.
|
|
11
11
|
|
|
12
|
-
**NeuroLink** is an Enterprise AI Development Platform that unifies 9 major AI providers with intelligent fallback
|
|
12
|
+
**NeuroLink** is an Enterprise AI Development Platform that unifies 9 major AI providers with intelligent fallback and built-in tool support. Available as both a **programmatic SDK** and **professional CLI tool**. Features 6 core tools working across all providers plus SDK custom tool registration. Extracted from production use at Juspay.
|
|
13
13
|
|
|
14
14
|
## š Enterprise Platform Features
|
|
15
15
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- **ā” Performance** -
|
|
25
|
-
- **š”ļø Error Recovery** - Graceful failures with
|
|
16
|
+
- **š Factory Pattern Architecture** - Unified provider management through BaseProvider inheritance
|
|
17
|
+
- **š§ Tools-First Design** - All providers include built-in tool support without additional configuration
|
|
18
|
+
- **š Real-time WebSocket Infrastructure** - [Coming Soon - Broken in migration, being fixed]
|
|
19
|
+
- **š Advanced Telemetry** - [Coming Soon - Broken in migration, being fixed]
|
|
20
|
+
- **š¬ Enhanced Chat Services** - [Coming Soon - Broken in migration, being fixed]
|
|
21
|
+
- **šļø Enterprise Architecture** - Production-ready with clean abstractions
|
|
22
|
+
- **š Configuration Management** - Flexible provider configuration
|
|
23
|
+
- **ā
Type Safety** - Industry-standard TypeScript interfaces
|
|
24
|
+
- **ā” Performance** - Fast response times with streaming support
|
|
25
|
+
- **š”ļø Error Recovery** - Graceful failures with provider fallback
|
|
26
|
+
|
|
27
|
+
## ā
LATEST UPDATE: Factory Pattern Refactoring Complete (2025-01-20)
|
|
28
|
+
|
|
29
|
+
**NeuroLink now features a unified factory pattern architecture with automatic tool support for all providers.**
|
|
30
|
+
|
|
31
|
+
- ā
**Unified Architecture**: All providers inherit from BaseProvider with built-in tool support
|
|
32
|
+
- ā
**Direct Tools**: Six core tools available across all providers (getCurrentTime, readFile, listDirectory, calculateMath, writeFile, searchFiles)
|
|
33
|
+
- ā
**Simplified Providers**: Removed duplicate code - providers now focus only on model-specific logic
|
|
34
|
+
- ā
**Better Testing**: 78% of providers fully working with tools (7/9 providers), 22% partial support
|
|
35
|
+
- ā
**Zero Breaking Changes**: All existing code continues working (backward compatibility)
|
|
36
|
+
- ā
**SDK Custom Tools**: Register your own tools programmatically with the SDK
|
|
37
|
+
|
|
38
|
+
> **Factory Pattern**: NeuroLink uses BaseProvider inheritance to provide consistent tool support across all AI providers without code duplication.
|
|
26
39
|
|
|
27
|
-
## ā
|
|
40
|
+
## ā
Stream Function Migration Complete (2025-01-12)
|
|
28
41
|
|
|
29
|
-
**NeuroLink
|
|
42
|
+
**NeuroLink uses `stream()` as the primary streaming function with future-ready multi-modal interface.**
|
|
30
43
|
|
|
31
44
|
- ā
**New Primary Streaming**: `stream()` with multi-modal ready interface
|
|
32
45
|
- ā
**Enhanced Generation**: `generate()` as primary generation function
|
|
@@ -82,11 +95,11 @@ const result = await neurolink.generate({
|
|
|
82
95
|
import { createBestAIProvider } from "@juspay/neurolink";
|
|
83
96
|
const provider = createBestAIProvider();
|
|
84
97
|
const providerResult = await provider.generate({
|
|
85
|
-
|
|
98
|
+
input: { text: "Write a haiku about programming" },
|
|
86
99
|
timeout: "30s",
|
|
87
100
|
});
|
|
88
101
|
|
|
89
|
-
console.log(result.
|
|
102
|
+
console.log(result.content);
|
|
90
103
|
console.log(`Used: ${result.provider}`);
|
|
91
104
|
```
|
|
92
105
|
|
|
@@ -96,22 +109,22 @@ Method aliases that match CLI command names:
|
|
|
96
109
|
|
|
97
110
|
```typescript
|
|
98
111
|
// All three methods are equivalent:
|
|
99
|
-
const result1 = await provider.generate({
|
|
100
|
-
const result2 = await provider.generate({
|
|
101
|
-
const result3 = await provider.gen({
|
|
112
|
+
const result1 = await provider.generate({ input: { text: "Hello" } }); // Original
|
|
113
|
+
const result2 = await provider.generate({ input: { text: "Hello" } }); // Matches CLI 'generate'
|
|
114
|
+
const result3 = await provider.gen({ input: { text: "Hello" } }); // Matches CLI 'gen'
|
|
102
115
|
|
|
103
116
|
// Use whichever style you prefer:
|
|
104
117
|
const provider = createBestAIProvider();
|
|
105
118
|
|
|
106
119
|
// Detailed method name
|
|
107
120
|
const story = await provider.generate({
|
|
108
|
-
|
|
121
|
+
input: { text: "Write a short story about AI" },
|
|
109
122
|
maxTokens: 200,
|
|
110
123
|
});
|
|
111
124
|
|
|
112
125
|
// CLI-style method names
|
|
113
|
-
const poem = await provider.generate({
|
|
114
|
-
const joke = await provider.gen({
|
|
126
|
+
const poem = await provider.generate({ input: { text: "Write a poem" } });
|
|
127
|
+
const joke = await provider.gen({ input: { text: "Tell me a joke" } });
|
|
115
128
|
```
|
|
116
129
|
|
|
117
130
|
### š Enhanced Usage (NEW! āØ)
|
|
@@ -140,11 +153,11 @@ import { NeuroLink } from "@juspay/neurolink";
|
|
|
140
153
|
const neurolink = new NeuroLink();
|
|
141
154
|
|
|
142
155
|
// Basic usage
|
|
143
|
-
const result = await neurolink.generate("Write a story");
|
|
156
|
+
const result = await neurolink.generate({ input: { text: "Write a story" } });
|
|
144
157
|
|
|
145
158
|
// With enhancements (NEW!)
|
|
146
159
|
const enhancedResult = await neurolink.generate({
|
|
147
|
-
|
|
160
|
+
input: { text: "Write a business proposal" },
|
|
148
161
|
enableAnalytics: true, // Get usage & cost data
|
|
149
162
|
enableEvaluation: true, // Get AI quality scores
|
|
150
163
|
context: { project: "Q1-sales" }, // Custom context
|
|
@@ -155,36 +168,8 @@ console.log("š Usage:", enhancedResult.analytics);
|
|
|
155
168
|
console.log("ā Quality:", enhancedResult.evaluation);
|
|
156
169
|
console.log("Response:", enhancedResult.content);
|
|
157
170
|
|
|
158
|
-
//
|
|
159
|
-
|
|
160
|
-
performEnhancedEvaluation,
|
|
161
|
-
createEnhancedContext,
|
|
162
|
-
} from "@juspay/neurolink";
|
|
163
|
-
|
|
164
|
-
const enhancedContext = createEnhancedContext(
|
|
165
|
-
"Write a business proposal for Q1 expansion",
|
|
166
|
-
enhancedResult.text,
|
|
167
|
-
{
|
|
168
|
-
domain: "Business development",
|
|
169
|
-
role: "Business proposal assistant",
|
|
170
|
-
toolsUsed: ["generate", "analytics-helper"],
|
|
171
|
-
conversationHistory: [
|
|
172
|
-
{ role: "user", content: "I need help with our Q1 business plan" },
|
|
173
|
-
{
|
|
174
|
-
role: "assistant",
|
|
175
|
-
content: "I can help you create a comprehensive plan",
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
},
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
const domainEvaluation = await performEnhancedEvaluation(enhancedContext);
|
|
182
|
-
console.log("šÆ Enhanced Evaluation:", domainEvaluation);
|
|
183
|
-
// {
|
|
184
|
-
// relevanceScore: 9, accuracyScore: 8, completenessScore: 9,
|
|
185
|
-
// domainAlignment: 9, terminologyAccuracy: 8, toolEffectiveness: 9,
|
|
186
|
-
// overall: 8.7, alertSeverity: 'none'
|
|
187
|
-
// }
|
|
171
|
+
// Enhanced evaluation included when enableEvaluation is true
|
|
172
|
+
// Returns basic quality scores for the generated content
|
|
188
173
|
```
|
|
189
174
|
|
|
190
175
|
### š Enterprise Real-time Features (NEW! š)
|
|
@@ -273,6 +258,8 @@ npx @juspay/neurolink status
|
|
|
273
258
|
|
|
274
259
|
## ⨠Key Features
|
|
275
260
|
|
|
261
|
+
- š **Factory Pattern Architecture** - Unified provider management with BaseProvider inheritance
|
|
262
|
+
- š§ **Tools-First Design** - All providers automatically include direct tool support (getCurrentTime, readFile, listDirectory, calculateMath, writeFile, searchFiles)
|
|
276
263
|
- š **9 AI Providers** - OpenAI, Bedrock, Vertex AI, Google AI Studio, Anthropic, Azure, Hugging Face, Ollama, Mistral AI
|
|
277
264
|
- ā” **Dynamic Model System** - Self-updating model configurations without code changes
|
|
278
265
|
- š° **Cost Optimization** - Automatic selection of cheapest models for tasks
|
|
@@ -288,16 +275,17 @@ npx @juspay/neurolink status
|
|
|
288
275
|
- š **Open Source Models** - Access 100,000+ models via Hugging Face
|
|
289
276
|
- šŖšŗ **GDPR Compliance** - European data processing with Mistral AI
|
|
290
277
|
|
|
291
|
-
## š ļø MCP Integration Status
|
|
278
|
+
## š ļø MCP Integration Status ā
**BUILT-IN TOOLS WORKING**
|
|
292
279
|
|
|
293
|
-
| Component | Status | Description
|
|
294
|
-
| ------------------- | ------------------ |
|
|
295
|
-
| Built-in Tools | ā
**Working** |
|
|
296
|
-
|
|
|
297
|
-
|
|
|
298
|
-
|
|
|
299
|
-
| **
|
|
300
|
-
|
|
|
280
|
+
| Component | Status | Description |
|
|
281
|
+
| ------------------- | ------------------ | -------------------------------------------------------- |
|
|
282
|
+
| Built-in Tools | ā
**Working** | 6 core tools fully functional across all providers |
|
|
283
|
+
| SDK Custom Tools | ā
**Working** | Register custom tools programmatically |
|
|
284
|
+
| External Discovery | š **Discovery** | 58+ MCP servers discovered from AI tools ecosystem |
|
|
285
|
+
| Tool Execution | ā
**Working** | Real-time AI tool calling with built-in tools |
|
|
286
|
+
| **External Tools** | š§ **Development** | Manual config needs one-line fix, activation in progress |
|
|
287
|
+
| **CLI Integration** | ā
**READY** | **Production-ready with built-in tools** |
|
|
288
|
+
| External Activation | š§ **Development** | Discovery complete, activation protocol in progress |
|
|
301
289
|
|
|
302
290
|
### ā
Quick MCP Test (v1.7.1)
|
|
303
291
|
|
|
@@ -305,18 +293,54 @@ npx @juspay/neurolink status
|
|
|
305
293
|
# Test built-in tools (works immediately)
|
|
306
294
|
npx @juspay/neurolink generate "What time is it?" --debug
|
|
307
295
|
|
|
308
|
-
#
|
|
309
|
-
npx @juspay/neurolink
|
|
296
|
+
# Disable tools for pure text generation
|
|
297
|
+
npx @juspay/neurolink generate "Write a poem" --disable-tools
|
|
298
|
+
|
|
299
|
+
# Discover available MCP servers
|
|
300
|
+
npx @juspay/neurolink mcp discover --format table
|
|
301
|
+
```
|
|
310
302
|
|
|
311
|
-
|
|
312
|
-
npx @juspay/neurolink generate "What tools do you have access to?" --debug
|
|
303
|
+
### š§ SDK Custom Tool Registration (NEW!)
|
|
313
304
|
|
|
314
|
-
|
|
315
|
-
npx @juspay/neurolink gen "What tools do you have access to?" --debug
|
|
305
|
+
Register your own tools programmatically with the SDK:
|
|
316
306
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
307
|
+
```typescript
|
|
308
|
+
import { NeuroLink } from "@juspay/neurolink";
|
|
309
|
+
const neurolink = new NeuroLink();
|
|
310
|
+
|
|
311
|
+
// Register a simple tool
|
|
312
|
+
neurolink.registerTool("weatherLookup", {
|
|
313
|
+
description: "Get current weather for a city",
|
|
314
|
+
parameters: z.object({
|
|
315
|
+
city: z.string().describe("City name"),
|
|
316
|
+
units: z.enum(["celsius", "fahrenheit"]).optional(),
|
|
317
|
+
}),
|
|
318
|
+
execute: async ({ city, units = "celsius" }) => {
|
|
319
|
+
// Your implementation here
|
|
320
|
+
return {
|
|
321
|
+
city,
|
|
322
|
+
temperature: 22,
|
|
323
|
+
units,
|
|
324
|
+
condition: "sunny",
|
|
325
|
+
};
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
// Use it in generation
|
|
330
|
+
const result = await neurolink.generate({
|
|
331
|
+
input: { text: "What's the weather in London?" },
|
|
332
|
+
provider: "google-ai",
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
// Register multiple tools at once
|
|
336
|
+
neurolink.registerTools({
|
|
337
|
+
stockPrice: {
|
|
338
|
+
/* tool definition */
|
|
339
|
+
},
|
|
340
|
+
calculator: {
|
|
341
|
+
/* tool definition */
|
|
342
|
+
},
|
|
343
|
+
});
|
|
320
344
|
```
|
|
321
345
|
|
|
322
346
|
## ā” Dynamic Model System (v1.8.0)
|
|
@@ -440,7 +464,7 @@ export async function POST(request: NextRequest) {
|
|
|
440
464
|
timeout: process.env.AI_TIMEOUT || "30s", // Configurable timeout
|
|
441
465
|
});
|
|
442
466
|
|
|
443
|
-
return NextResponse.json({ text: result.
|
|
467
|
+
return NextResponse.json({ text: result.content });
|
|
444
468
|
}
|
|
445
469
|
```
|
|
446
470
|
|
|
@@ -485,6 +509,7 @@ cd neurolink-demo && node server.js
|
|
|
485
509
|
|
|
486
510
|
### Advanced Features
|
|
487
511
|
|
|
512
|
+
- **[š Factory Pattern Migration](./docs/FACTORY-PATTERN-MIGRATION.md)** - Guide to the new unified provider architecture
|
|
488
513
|
- **[š MCP Foundation](./docs/MCP-FOUNDATION.md)** - Model Context Protocol architecture
|
|
489
514
|
- **[ā” Dynamic Models](./docs/DYNAMIC-MODELS.md)** - Self-updating model configurations and cost optimization
|
|
490
515
|
- **[š§ AI Analysis Tools](./docs/AI-ANALYSIS-TOOLS.md)** - Usage optimization and benchmarking
|
|
@@ -498,17 +523,24 @@ cd neurolink-demo && node server.js
|
|
|
498
523
|
|
|
499
524
|
## šļø Supported Providers & Models
|
|
500
525
|
|
|
501
|
-
| Provider | Models
|
|
502
|
-
| -------------------- |
|
|
503
|
-
| **OpenAI** | GPT-4o, GPT-4o-mini
|
|
504
|
-
| **Google AI Studio** | Gemini
|
|
505
|
-
| **Amazon Bedrock** | Claude 3.5/3.7 Sonnet
|
|
506
|
-
| **Google Vertex AI** | Gemini 2.5 Flash
|
|
507
|
-
| **Anthropic** | Claude 3.5 Sonnet
|
|
508
|
-
| **Azure OpenAI** | GPT-4, GPT-3.5
|
|
509
|
-
| **Hugging Face** š | 100,000+ models
|
|
510
|
-
| **Ollama** š | Llama 2,
|
|
511
|
-
| **Mistral AI** š | Tiny, Small, Medium, Large
|
|
526
|
+
| Provider | Models | Auth Method | Free Tier | Tool Support |
|
|
527
|
+
| -------------------- | -------------------------- | ------------------ | --------- | ------------ |
|
|
528
|
+
| **OpenAI** | GPT-4o, GPT-4o-mini | API Key | ā | ā
Full |
|
|
529
|
+
| **Google AI Studio** | Gemini 2.5 Flash/Pro | API Key | ā
| ā
Full |
|
|
530
|
+
| **Amazon Bedrock** | Claude 3.5/3.7 Sonnet | AWS Credentials | ā | ā
Full\* |
|
|
531
|
+
| **Google Vertex AI** | Gemini 2.5 Flash | Service Account | ā | ā
Full |
|
|
532
|
+
| **Anthropic** | Claude 3.5 Sonnet | API Key | ā | ā
Full |
|
|
533
|
+
| **Azure OpenAI** | GPT-4, GPT-3.5 | API Key + Endpoint | ā | ā
Full |
|
|
534
|
+
| **Hugging Face** š | 100,000+ models | API Key | ā
| ā ļø Partial |
|
|
535
|
+
| **Ollama** š | Llama 3.2, Gemma, Mistral | None (Local) | ā
| ā ļø Partial |
|
|
536
|
+
| **Mistral AI** š | Tiny, Small, Medium, Large | API Key | ā
| ā
Full |
|
|
537
|
+
|
|
538
|
+
**Tool Support Legend:**
|
|
539
|
+
|
|
540
|
+
- ā
Full: All tools working correctly
|
|
541
|
+
- ā ļø Partial: Tools visible but may not execute properly
|
|
542
|
+
- ā Limited: Issues with model or configuration
|
|
543
|
+
- \* Bedrock requires valid AWS credentials, Ollama requires specific models like gemma3n for tool support
|
|
512
544
|
|
|
513
545
|
**⨠Auto-Selection**: NeuroLink automatically chooses the best available provider based on speed, reliability, and configuration.
|
|
514
546
|
|
|
@@ -529,51 +561,16 @@ cd neurolink-demo && node server.js
|
|
|
529
561
|
- **Extensibility**: Connect external tools and services via MCP protocol
|
|
530
562
|
- **š Dynamic Server Management**: Programmatically add MCP servers at runtime
|
|
531
563
|
|
|
532
|
-
### š§
|
|
533
|
-
|
|
534
|
-
**Add external MCP servers dynamically** for enhanced tool ecosystem:
|
|
535
|
-
|
|
536
|
-
```typescript
|
|
537
|
-
import { NeuroLink } from "@juspay/neurolink";
|
|
538
|
-
const neurolink = new NeuroLink();
|
|
539
|
-
|
|
540
|
-
// Add Bitbucket integration
|
|
541
|
-
await neurolink.addMCPServer("bitbucket", {
|
|
542
|
-
command: "npx",
|
|
543
|
-
args: ["-y", "@nexus2520/bitbucket-mcp-server"],
|
|
544
|
-
env: {
|
|
545
|
-
BITBUCKET_USERNAME: "your-username",
|
|
546
|
-
BITBUCKET_APP_PASSWORD: "your-app-password",
|
|
547
|
-
},
|
|
548
|
-
});
|
|
549
|
-
|
|
550
|
-
// Add custom database connector
|
|
551
|
-
await neurolink.addMCPServer("database", {
|
|
552
|
-
command: "node",
|
|
553
|
-
args: ["./custom-db-mcp-server.js"],
|
|
554
|
-
env: { DB_CONNECTION_STRING: "postgresql://..." },
|
|
555
|
-
});
|
|
564
|
+
### š§ Programmatic MCP Server Management [Coming Soon]
|
|
556
565
|
|
|
557
|
-
|
|
558
|
-
await neurolink.addMCPServer("slack-integration", {
|
|
559
|
-
command: "npx",
|
|
560
|
-
args: ["-y", "@slack/mcp-server"],
|
|
561
|
-
env: { SLACK_BOT_TOKEN: "xoxb-..." },
|
|
562
|
-
cwd: "/tmp",
|
|
563
|
-
});
|
|
564
|
-
|
|
565
|
-
// Verify servers are registered
|
|
566
|
-
const status = await neurolink.getMCPStatus();
|
|
567
|
-
console.log("Active servers:", status.totalServers);
|
|
568
|
-
console.log("Available tools:", status.totalTools);
|
|
569
|
-
```
|
|
566
|
+
**Note**: External MCP server activation is in development. Currently available:
|
|
570
567
|
|
|
571
|
-
|
|
568
|
+
- ā
6 built-in tools working across all providers
|
|
569
|
+
- ā
SDK custom tool registration
|
|
570
|
+
- š MCP server discovery (58+ servers found)
|
|
571
|
+
- š§ External server activation (one-line fix pending)
|
|
572
572
|
|
|
573
|
-
|
|
574
|
-
- **Custom Tool Development**: Your own MCP servers
|
|
575
|
-
- **Dynamic Workflows**: Add servers based on project needs
|
|
576
|
-
- **Enterprise Applications**: Runtime tool ecosystem management
|
|
573
|
+
Manual MCP configuration (`.mcp-config.json`) support coming soon.
|
|
577
574
|
|
|
578
575
|
## š¤ Contributing
|
|
579
576
|
|
|
@@ -220,8 +220,8 @@ export declare const directAgentTools: {
|
|
|
220
220
|
mode: z.ZodDefault<z.ZodEnum<["create", "overwrite", "append"]>>;
|
|
221
221
|
}, "strip", z.ZodTypeAny, {
|
|
222
222
|
path: string;
|
|
223
|
-
mode: "create" | "overwrite" | "append";
|
|
224
223
|
content: string;
|
|
224
|
+
mode: "create" | "overwrite" | "append";
|
|
225
225
|
}, {
|
|
226
226
|
path: string;
|
|
227
227
|
content: string;
|
|
@@ -250,8 +250,8 @@ export declare const directAgentTools: {
|
|
|
250
250
|
}> & {
|
|
251
251
|
execute: (args: {
|
|
252
252
|
path: string;
|
|
253
|
-
mode: "create" | "overwrite" | "append";
|
|
254
253
|
content: string;
|
|
254
|
+
mode: "create" | "overwrite" | "append";
|
|
255
255
|
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
|
|
256
256
|
success: boolean;
|
|
257
257
|
error: string;
|
|
@@ -563,8 +563,8 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
|
|
|
563
563
|
mode: z.ZodDefault<z.ZodEnum<["create", "overwrite", "append"]>>;
|
|
564
564
|
}, "strip", z.ZodTypeAny, {
|
|
565
565
|
path: string;
|
|
566
|
-
mode: "create" | "overwrite" | "append";
|
|
567
566
|
content: string;
|
|
567
|
+
mode: "create" | "overwrite" | "append";
|
|
568
568
|
}, {
|
|
569
569
|
path: string;
|
|
570
570
|
content: string;
|
|
@@ -593,8 +593,8 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
|
|
|
593
593
|
}> & {
|
|
594
594
|
execute: (args: {
|
|
595
595
|
path: string;
|
|
596
|
-
mode: "create" | "overwrite" | "append";
|
|
597
596
|
content: string;
|
|
597
|
+
mode: "create" | "overwrite" | "append";
|
|
598
598
|
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
|
|
599
599
|
success: boolean;
|
|
600
600
|
error: string;
|
|
@@ -907,8 +907,8 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
|
|
|
907
907
|
mode: z.ZodDefault<z.ZodEnum<["create", "overwrite", "append"]>>;
|
|
908
908
|
}, "strip", z.ZodTypeAny, {
|
|
909
909
|
path: string;
|
|
910
|
-
mode: "create" | "overwrite" | "append";
|
|
911
910
|
content: string;
|
|
911
|
+
mode: "create" | "overwrite" | "append";
|
|
912
912
|
}, {
|
|
913
913
|
path: string;
|
|
914
914
|
content: string;
|
|
@@ -937,8 +937,8 @@ export declare function getToolsForCategory(category?: "basic" | "filesystem" |
|
|
|
937
937
|
}> & {
|
|
938
938
|
execute: (args: {
|
|
939
939
|
path: string;
|
|
940
|
-
mode: "create" | "overwrite" | "append";
|
|
941
940
|
content: string;
|
|
941
|
+
mode: "create" | "overwrite" | "append";
|
|
942
942
|
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
|
|
943
943
|
success: boolean;
|
|
944
944
|
error: string;
|
|
@@ -58,8 +58,8 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
58
58
|
clientEmail?: string | undefined;
|
|
59
59
|
privateKey?: string | undefined;
|
|
60
60
|
}, {
|
|
61
|
-
model?: string | undefined;
|
|
62
61
|
projectId?: string | undefined;
|
|
62
|
+
model?: string | undefined;
|
|
63
63
|
location?: string | undefined;
|
|
64
64
|
credentials?: string | undefined;
|
|
65
65
|
serviceAccountKey?: string | undefined;
|
|
@@ -198,8 +198,8 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
198
198
|
baseURL?: string | undefined;
|
|
199
199
|
} | undefined;
|
|
200
200
|
vertex?: {
|
|
201
|
-
model?: string | undefined;
|
|
202
201
|
projectId?: string | undefined;
|
|
202
|
+
model?: string | undefined;
|
|
203
203
|
location?: string | undefined;
|
|
204
204
|
credentials?: string | undefined;
|
|
205
205
|
serviceAccountKey?: string | undefined;
|
|
@@ -333,8 +333,8 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
333
333
|
baseURL?: string | undefined;
|
|
334
334
|
} | undefined;
|
|
335
335
|
vertex?: {
|
|
336
|
-
model?: string | undefined;
|
|
337
336
|
projectId?: string | undefined;
|
|
337
|
+
model?: string | undefined;
|
|
338
338
|
location?: string | undefined;
|
|
339
339
|
credentials?: string | undefined;
|
|
340
340
|
serviceAccountKey?: string | undefined;
|
package/dist/cli/commands/mcp.js
CHANGED
|
@@ -14,6 +14,7 @@ import { ContextManager } from "../../lib/mcp/context-manager.js";
|
|
|
14
14
|
import { MCPOrchestrator } from "../../lib/mcp/orchestrator.js";
|
|
15
15
|
import { initializeNeuroLinkMCP } from "../../lib/mcp/initialize.js";
|
|
16
16
|
import { mcpLogger, setGlobalMCPLogLevel } from "../../lib/mcp/logging.js";
|
|
17
|
+
// import type { LogLevel } from "../../lib/mcp/logging.js"; // Commented out as unused
|
|
17
18
|
import { defaultTimeoutManager } from "../../lib/utils/timeout-manager.js";
|
|
18
19
|
// Default MCP config file location
|
|
19
20
|
const MCP_CONFIG_FILE = path.join(process.cwd(), ".mcp-config.json");
|
|
@@ -158,7 +159,7 @@ async function listMCPServerTools(serverConfig) {
|
|
|
158
159
|
});
|
|
159
160
|
return new Promise((resolve, reject) => {
|
|
160
161
|
let responseData = "";
|
|
161
|
-
let initialized = false;
|
|
162
|
+
// let initialized = false; // Commented out as unused
|
|
162
163
|
child.stdout?.on("data", (data) => {
|
|
163
164
|
responseData += data.toString();
|
|
164
165
|
try {
|
|
@@ -168,7 +169,7 @@ async function listMCPServerTools(serverConfig) {
|
|
|
168
169
|
const response = JSON.parse(line.trim());
|
|
169
170
|
if (response.id === 1 && response.result.capabilities) {
|
|
170
171
|
// Initialize successful, now list tools
|
|
171
|
-
initialized = true;
|
|
172
|
+
// initialized = true; // Commented out as unused
|
|
172
173
|
const listToolsRequest = {
|
|
173
174
|
jsonrpc: "2.0",
|
|
174
175
|
id: 2,
|
|
@@ -232,7 +233,7 @@ export async function executeMCPTool(serverConfig, toolName, toolParams) {
|
|
|
232
233
|
});
|
|
233
234
|
return new Promise((resolve, reject) => {
|
|
234
235
|
let responseData = "";
|
|
235
|
-
let initialized = false;
|
|
236
|
+
// let initialized = false; // Commented out as unused
|
|
236
237
|
child.stdout?.on("data", (data) => {
|
|
237
238
|
responseData += data.toString();
|
|
238
239
|
try {
|
|
@@ -242,7 +243,7 @@ export async function executeMCPTool(serverConfig, toolName, toolParams) {
|
|
|
242
243
|
const response = JSON.parse(line.trim());
|
|
243
244
|
if (response.id === 1 && response.result.capabilities) {
|
|
244
245
|
// Initialize successful, now execute tool
|
|
245
|
-
initialized = true;
|
|
246
|
+
// initialized = true; // Commented out as unused
|
|
246
247
|
const toolCallRequest = {
|
|
247
248
|
jsonrpc: "2.0",
|
|
248
249
|
id: 2,
|
|
@@ -319,7 +320,7 @@ export async function executeMCPTool(serverConfig, toolName, toolParams) {
|
|
|
319
320
|
/**
|
|
320
321
|
* Display discovery results in table format
|
|
321
322
|
*/
|
|
322
|
-
function
|
|
323
|
+
function _displayTable(discoveryResult) {
|
|
323
324
|
console.log(chalk.green(`\nš Found ${discoveryResult.discovered.length} MCP servers:`));
|
|
324
325
|
console.log(chalk.gray("ā".repeat(80)));
|
|
325
326
|
discoveryResult.discovered.forEach((server, index) => {
|
|
@@ -361,7 +362,7 @@ function displayTable(discoveryResult) {
|
|
|
361
362
|
/**
|
|
362
363
|
* Display discovery results in summary format
|
|
363
364
|
*/
|
|
364
|
-
function
|
|
365
|
+
function _displaySummary(discoveryResult) {
|
|
365
366
|
console.log(chalk.green(`\nš Discovery Summary`));
|
|
366
367
|
console.log(chalk.gray("==================="));
|
|
367
368
|
console.log(`${chalk.cyan("Total servers found:")} ${discoveryResult.discovered.length}`);
|
|
@@ -430,7 +431,7 @@ function getSourceTypeIcon(sourceType) {
|
|
|
430
431
|
/**
|
|
431
432
|
* Get icon for server status
|
|
432
433
|
*/
|
|
433
|
-
function
|
|
434
|
+
function _getStatusIcon(status) {
|
|
434
435
|
const icons = {
|
|
435
436
|
available: "ā
",
|
|
436
437
|
unavailable: "ā",
|
|
@@ -7,6 +7,10 @@ export declare class CLICommandFactory {
|
|
|
7
7
|
* Create the new primary 'generate' command
|
|
8
8
|
*/
|
|
9
9
|
static createGenerateCommand(): CommandModule;
|
|
10
|
+
/**
|
|
11
|
+
* Execute provider status command
|
|
12
|
+
*/
|
|
13
|
+
executeProviderStatus(argv: any): Promise<void>;
|
|
10
14
|
/**
|
|
11
15
|
* Execute the generate command
|
|
12
16
|
*/
|