@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.
Files changed (190) hide show
  1. package/CHANGELOG.md +21 -9
  2. package/README.md +123 -126
  3. package/dist/agent/direct-tools.d.ts +6 -6
  4. package/dist/cli/commands/config.d.ts +3 -3
  5. package/dist/cli/commands/mcp.js +8 -7
  6. package/dist/cli/factories/command-factory.d.ts +4 -0
  7. package/dist/cli/factories/command-factory.js +63 -8
  8. package/dist/cli/index.js +87 -140
  9. package/dist/core/base-provider.d.ts +423 -0
  10. package/dist/core/base-provider.js +376 -0
  11. package/dist/core/constants.d.ts +2 -1
  12. package/dist/core/constants.js +2 -1
  13. package/dist/core/dynamic-models.d.ts +6 -6
  14. package/dist/core/evaluation.d.ts +19 -80
  15. package/dist/core/evaluation.js +185 -484
  16. package/dist/core/factory.d.ts +3 -3
  17. package/dist/core/factory.js +31 -91
  18. package/dist/core/service-registry.d.ts +47 -0
  19. package/dist/core/service-registry.js +112 -0
  20. package/dist/core/types.d.ts +8 -1
  21. package/dist/factories/compatibility-factory.js +1 -1
  22. package/dist/factories/provider-factory.d.ts +72 -0
  23. package/dist/factories/provider-factory.js +144 -0
  24. package/dist/factories/provider-registry.d.ts +38 -0
  25. package/dist/factories/provider-registry.js +107 -0
  26. package/dist/index.d.ts +4 -3
  27. package/dist/index.js +2 -4
  28. package/dist/lib/agent/direct-tools.d.ts +6 -6
  29. package/dist/lib/core/base-provider.d.ts +423 -0
  30. package/dist/lib/core/base-provider.js +376 -0
  31. package/dist/lib/core/constants.d.ts +2 -1
  32. package/dist/lib/core/constants.js +2 -1
  33. package/dist/lib/core/dynamic-models.d.ts +6 -6
  34. package/dist/lib/core/evaluation.d.ts +19 -80
  35. package/dist/lib/core/evaluation.js +185 -484
  36. package/dist/lib/core/factory.d.ts +3 -3
  37. package/dist/lib/core/factory.js +30 -91
  38. package/dist/lib/core/service-registry.d.ts +47 -0
  39. package/dist/lib/core/service-registry.js +112 -0
  40. package/dist/lib/core/types.d.ts +8 -1
  41. package/dist/lib/factories/compatibility-factory.js +1 -1
  42. package/dist/lib/factories/provider-factory.d.ts +72 -0
  43. package/dist/lib/factories/provider-factory.js +144 -0
  44. package/dist/lib/factories/provider-registry.d.ts +38 -0
  45. package/dist/lib/factories/provider-registry.js +107 -0
  46. package/dist/lib/index.d.ts +4 -3
  47. package/dist/lib/index.js +2 -4
  48. package/dist/lib/mcp/client.d.ts +1 -0
  49. package/dist/lib/mcp/client.js +1 -0
  50. package/dist/lib/mcp/config.js +28 -3
  51. package/dist/lib/mcp/context-manager.d.ts +1 -0
  52. package/dist/lib/mcp/context-manager.js +8 -4
  53. package/dist/lib/mcp/function-calling.d.ts +13 -0
  54. package/dist/lib/mcp/function-calling.js +134 -35
  55. package/dist/lib/mcp/initialize-tools.d.ts +1 -1
  56. package/dist/lib/mcp/initialize-tools.js +45 -1
  57. package/dist/lib/mcp/initialize.js +16 -6
  58. package/dist/lib/mcp/neurolink-mcp-client.d.ts +1 -0
  59. package/dist/lib/mcp/neurolink-mcp-client.js +21 -5
  60. package/dist/lib/mcp/servers/agent/direct-tools-server.d.ts +8 -0
  61. package/dist/lib/mcp/servers/agent/direct-tools-server.js +109 -0
  62. package/dist/lib/mcp/servers/ai-providers/ai-core-server.js +3 -1
  63. package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
  64. package/dist/lib/mcp/unified-registry.d.ts +4 -0
  65. package/dist/lib/mcp/unified-registry.js +42 -9
  66. package/dist/lib/neurolink.d.ts +156 -117
  67. package/dist/lib/neurolink.js +619 -404
  68. package/dist/lib/providers/amazon-bedrock.d.ts +32 -0
  69. package/dist/lib/providers/amazon-bedrock.js +143 -0
  70. package/dist/lib/providers/analytics-helper.js +7 -4
  71. package/dist/lib/providers/anthropic-baseprovider.d.ts +23 -0
  72. package/dist/lib/providers/anthropic-baseprovider.js +114 -0
  73. package/dist/lib/providers/anthropic.d.ts +19 -43
  74. package/dist/lib/providers/anthropic.js +82 -306
  75. package/dist/lib/providers/azure-openai.d.ts +20 -0
  76. package/dist/lib/providers/azure-openai.js +89 -0
  77. package/dist/lib/providers/function-calling-provider.d.ts +64 -2
  78. package/dist/lib/providers/function-calling-provider.js +208 -9
  79. package/dist/lib/providers/google-ai-studio.d.ts +23 -0
  80. package/dist/lib/providers/google-ai-studio.js +107 -0
  81. package/dist/lib/providers/google-vertex.d.ts +47 -0
  82. package/dist/lib/providers/google-vertex.js +205 -0
  83. package/dist/lib/providers/huggingFace.d.ts +32 -25
  84. package/dist/lib/providers/huggingFace.js +97 -431
  85. package/dist/lib/providers/index.d.ts +9 -9
  86. package/dist/lib/providers/index.js +9 -9
  87. package/dist/lib/providers/mcp-provider.js +24 -5
  88. package/dist/lib/providers/mistral.d.ts +42 -0
  89. package/dist/lib/providers/mistral.js +160 -0
  90. package/dist/lib/providers/ollama.d.ts +52 -36
  91. package/dist/lib/providers/ollama.js +297 -520
  92. package/dist/lib/providers/openAI.d.ts +19 -18
  93. package/dist/lib/providers/openAI.js +76 -275
  94. package/dist/lib/sdk/tool-extension.d.ts +181 -0
  95. package/dist/lib/sdk/tool-extension.js +283 -0
  96. package/dist/lib/sdk/tool-registration.d.ts +95 -0
  97. package/dist/lib/sdk/tool-registration.js +167 -0
  98. package/dist/lib/services/streaming/streaming-manager.js +11 -10
  99. package/dist/lib/services/websocket/websocket-server.js +12 -11
  100. package/dist/lib/telemetry/telemetry-service.js +8 -7
  101. package/dist/lib/types/generate-types.d.ts +1 -0
  102. package/dist/lib/types/mcp-types.d.ts +116 -0
  103. package/dist/lib/types/mcp-types.js +5 -0
  104. package/dist/lib/types/stream-types.d.ts +30 -18
  105. package/dist/lib/types/universal-provider-options.d.ts +87 -0
  106. package/dist/lib/types/universal-provider-options.js +53 -0
  107. package/dist/mcp/client.d.ts +1 -0
  108. package/dist/mcp/client.js +1 -0
  109. package/dist/mcp/config.js +28 -3
  110. package/dist/mcp/context-manager.d.ts +1 -0
  111. package/dist/mcp/context-manager.js +8 -4
  112. package/dist/mcp/function-calling.d.ts +13 -0
  113. package/dist/mcp/function-calling.js +134 -35
  114. package/dist/mcp/initialize-tools.d.ts +1 -1
  115. package/dist/mcp/initialize-tools.js +45 -1
  116. package/dist/mcp/initialize.js +16 -6
  117. package/dist/mcp/neurolink-mcp-client.d.ts +1 -0
  118. package/dist/mcp/neurolink-mcp-client.js +21 -5
  119. package/dist/mcp/servers/agent/direct-tools-server.d.ts +8 -0
  120. package/dist/mcp/servers/agent/direct-tools-server.js +109 -0
  121. package/dist/mcp/servers/ai-providers/ai-core-server.js +3 -1
  122. package/dist/mcp/servers/ai-providers/ai-workflow-tools.d.ts +2 -2
  123. package/dist/mcp/unified-registry.d.ts +4 -0
  124. package/dist/mcp/unified-registry.js +42 -9
  125. package/dist/neurolink.d.ts +156 -117
  126. package/dist/neurolink.js +619 -404
  127. package/dist/providers/amazon-bedrock.d.ts +32 -0
  128. package/dist/providers/amazon-bedrock.js +143 -0
  129. package/dist/providers/analytics-helper.js +7 -4
  130. package/dist/providers/anthropic-baseprovider.d.ts +23 -0
  131. package/dist/providers/anthropic-baseprovider.js +114 -0
  132. package/dist/providers/anthropic.d.ts +19 -43
  133. package/dist/providers/anthropic.js +81 -305
  134. package/dist/providers/azure-openai.d.ts +20 -0
  135. package/dist/providers/azure-openai.js +89 -0
  136. package/dist/providers/function-calling-provider.d.ts +64 -2
  137. package/dist/providers/function-calling-provider.js +208 -9
  138. package/dist/providers/google-ai-studio.d.ts +23 -0
  139. package/dist/providers/google-ai-studio.js +108 -0
  140. package/dist/providers/google-vertex.d.ts +47 -0
  141. package/dist/providers/google-vertex.js +205 -0
  142. package/dist/providers/huggingFace.d.ts +32 -25
  143. package/dist/providers/huggingFace.js +96 -430
  144. package/dist/providers/index.d.ts +9 -9
  145. package/dist/providers/index.js +9 -9
  146. package/dist/providers/mcp-provider.js +24 -5
  147. package/dist/providers/mistral.d.ts +42 -0
  148. package/dist/providers/mistral.js +160 -0
  149. package/dist/providers/ollama.d.ts +52 -36
  150. package/dist/providers/ollama.js +297 -519
  151. package/dist/providers/openAI.d.ts +19 -18
  152. package/dist/providers/openAI.js +76 -276
  153. package/dist/sdk/tool-extension.d.ts +181 -0
  154. package/dist/sdk/tool-extension.js +283 -0
  155. package/dist/sdk/tool-registration.d.ts +95 -0
  156. package/dist/sdk/tool-registration.js +168 -0
  157. package/dist/services/streaming/streaming-manager.js +11 -10
  158. package/dist/services/websocket/websocket-server.js +12 -11
  159. package/dist/telemetry/telemetry-service.js +8 -7
  160. package/dist/types/generate-types.d.ts +1 -0
  161. package/dist/types/mcp-types.d.ts +116 -0
  162. package/dist/types/mcp-types.js +5 -0
  163. package/dist/types/stream-types.d.ts +30 -18
  164. package/dist/types/universal-provider-options.d.ts +87 -0
  165. package/dist/types/universal-provider-options.js +53 -0
  166. package/package.json +12 -5
  167. package/dist/lib/providers/agent-enhanced-provider.d.ts +0 -93
  168. package/dist/lib/providers/agent-enhanced-provider.js +0 -605
  169. package/dist/lib/providers/amazonBedrock.d.ts +0 -28
  170. package/dist/lib/providers/amazonBedrock.js +0 -364
  171. package/dist/lib/providers/azureOpenAI.d.ts +0 -42
  172. package/dist/lib/providers/azureOpenAI.js +0 -347
  173. package/dist/lib/providers/googleAIStudio.d.ts +0 -42
  174. package/dist/lib/providers/googleAIStudio.js +0 -364
  175. package/dist/lib/providers/googleVertexAI.d.ts +0 -34
  176. package/dist/lib/providers/googleVertexAI.js +0 -547
  177. package/dist/lib/providers/mistralAI.d.ts +0 -37
  178. package/dist/lib/providers/mistralAI.js +0 -325
  179. package/dist/providers/agent-enhanced-provider.d.ts +0 -93
  180. package/dist/providers/agent-enhanced-provider.js +0 -606
  181. package/dist/providers/amazonBedrock.d.ts +0 -28
  182. package/dist/providers/amazonBedrock.js +0 -364
  183. package/dist/providers/azureOpenAI.d.ts +0 -42
  184. package/dist/providers/azureOpenAI.js +0 -348
  185. package/dist/providers/googleAIStudio.d.ts +0 -42
  186. package/dist/providers/googleAIStudio.js +0 -364
  187. package/dist/providers/googleVertexAI.d.ts +0 -34
  188. package/dist/providers/googleVertexAI.js +0 -547
  189. package/dist/providers/mistralAI.d.ts +0 -37
  190. package/dist/providers/mistralAI.js +0 -325
package/CHANGELOG.md CHANGED
@@ -1,30 +1,40 @@
1
- # [5.1.0](https://github.com/juspay/neurolink/compare/v5.0.0...v5.1.0) (2025-07-13)
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
- * **core:** complete unified multimodal AI platform architecture with generate/stream unification ([846e409](https://github.com/juspay/neurolink/commit/846e409a4a77024ddee9961c9b5049bc99f8335e))
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.0.0](https://github.com/juspay/neurolink/compare/v4.2.0...v5.0.0) (2025-07-11)
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
- * refactor(cli)!: remove agent-generate command, unify CLI to single generate command ([9c034b7](https://github.com/juspay/neurolink/commit/9c034b7b5a8df3b861fccae0e617c5aa4c85a903))
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
- ### Bug Fixes
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
- * **scripts:** update docs:generate to use docs:validate instead of removed docs:sync ([3277bab](https://github.com/juspay/neurolink/commit/3277bab3eb1cec24a60fe28bf3897fce63d83d3a))
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
- * agent-generate command has been removed
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
  [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue)](https://www.typescriptlang.org/)
8
8
  [![CI](https://github.com/juspay/neurolink/workflows/CI/badge.svg)](https://github.com/juspay/neurolink/actions)
9
9
 
10
- > Enterprise AI Development Platform with real-time capabilities, advanced telemetry, and universal provider support. Production-ready with TypeScript support.
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, real-time WebSocket infrastructure, and optional enterprise telemetry. Available as both a **programmatic SDK** and **professional CLI tool**. Extracted from production use at Juspay.
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
- - **🌐 Real-time WebSocket Infrastructure** - Professional-grade streaming with session management
17
- - **šŸ“Š Advanced Telemetry** - Optional OpenTelemetry monitoring with zero overhead when disabled
18
- - **šŸ’¬ Enhanced Chat Services** - Dual-mode SSE + WebSocket support for enterprise applications
19
- - **šŸ—ļø Enterprise Architecture** - Production-ready scaling with connection pooling and optimization
20
- - **šŸ”„ Automatic Backup/Restore** - Timestamped backups with hash verification
21
- - **āœ… Config Validation** - Comprehensive validation with suggestions
22
- - **šŸ—ļø Factory-First MCP** - Lighthouse-compatible architecture (99% compatible)
23
- - **šŸ”§ Type Safety** - Industry-standard TypeScript interfaces
24
- - **⚔ Performance** - Tool execution <1ms, pipeline execution ~22ms
25
- - **šŸ›”ļø Error Recovery** - Graceful failures with auto-restore
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
- ## āœ… LATEST UPDATE: Stream Function Migration Complete (2025-01-12)
40
+ ## āœ… Stream Function Migration Complete (2025-01-12)
28
41
 
29
- **NeuroLink now uses `stream()` as the primary streaming function with future-ready multi-modal interface.**
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
- prompt: "Write a haiku about programming",
98
+ input: { text: "Write a haiku about programming" },
86
99
  timeout: "30s",
87
100
  });
88
101
 
89
- console.log(result.text);
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({ prompt: "Hello" }); // Original
100
- const result2 = await provider.generate({ prompt: "Hello" }); // Matches CLI 'generate'
101
- const result3 = await provider.gen({ prompt: "Hello" }); // Matches CLI '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
- prompt: "Write a short story about AI",
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({ prompt: "Write a poem" });
114
- const joke = await provider.gen({ prompt: "Tell me a joke" });
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
- prompt: "Write a business proposal",
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
- // šŸ†• NEW: Enhanced Evaluation with Domain Awareness
159
- import {
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 (v1.11.1) āœ… **PRODUCTION READY**
278
+ ## šŸ› ļø MCP Integration Status āœ… **BUILT-IN TOOLS WORKING**
292
279
 
293
- | Component | Status | Description |
294
- | ------------------- | ------------------ | ---------------------------------------------------------- |
295
- | Built-in Tools | āœ… **Working** | Time tool, utilities - fully functional |
296
- | External Discovery | āœ… **Working** | 58+ MCP servers auto-discovered from all AI tools |
297
- | Tool Execution | āœ… **Working** | Real-time AI tool calling with built-in tools |
298
- | **External Tools** | āœ… **SOLVED** | **Two-step tool calling fixed - human-readable responses** |
299
- | **CLI Integration** | āœ… **READY** | **Production-ready AI assistant with external tools** |
300
- | External Activation | šŸ”§ **Development** | Discovery complete, activation protocol in progress |
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
- # Alternative short form
309
- npx @juspay/neurolink gen "What time is it?" --debug
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
- # Test tool discovery
312
- npx @juspay/neurolink generate "What tools do you have access to?" --debug
303
+ ### šŸ”§ SDK Custom Tool Registration (NEW!)
313
304
 
314
- # Alternative short form
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
- # Test external server discovery
318
- npx @juspay/neurolink mcp discover --format table
319
- # Shows all discovered MCP servers from Claude, VS Code, Cursor, etc.
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.text });
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 | Auth Method | Free Tier |
502
- | -------------------- | ---------------------------- | ------------------ | --------- |
503
- | **OpenAI** | GPT-4o, GPT-4o-mini | API Key | āŒ |
504
- | **Google AI Studio** | Gemini 1.5/2.0 Flash/Pro | API Key | āœ… |
505
- | **Amazon Bedrock** | Claude 3.5/3.7 Sonnet | AWS Credentials | āŒ |
506
- | **Google Vertex AI** | Gemini 2.5 Flash | Service Account | āŒ |
507
- | **Anthropic** | Claude 3.5 Sonnet | API Key | āŒ |
508
- | **Azure OpenAI** | GPT-4, GPT-3.5 | API Key + Endpoint | āŒ |
509
- | **Hugging Face** šŸ†• | 100,000+ models | API Key | āœ… |
510
- | **Ollama** šŸ†• | Llama 2, Code Llama, Mistral | None (Local) | āœ… |
511
- | **Mistral AI** šŸ†• | Tiny, Small, Medium, Large | API Key | āœ… |
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
- ### šŸ”§ NEW: Programmatic MCP Server Management
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
- // Add any MCP-compatible server
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
- **Perfect for:**
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
- - **External Service Integration**: Bitbucket, Slack, Jira, databases
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;
@@ -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 displayTable(discoveryResult) {
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 displaySummary(discoveryResult) {
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 getStatusIcon(status) {
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
  */