@juspay/neurolink 7.1.0 → 7.2.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 (92) hide show
  1. package/CHANGELOG.md +8 -2
  2. package/README.md +16 -11
  3. package/dist/cli/commands/config.d.ts +2 -2
  4. package/dist/cli/commands/config.js +22 -21
  5. package/dist/cli/commands/mcp.d.ts +79 -0
  6. package/dist/cli/commands/mcp.js +916 -0
  7. package/dist/cli/commands/models.d.ts +63 -0
  8. package/dist/cli/commands/models.js +653 -0
  9. package/dist/cli/commands/ollama.js +56 -55
  10. package/dist/cli/factories/commandFactory.d.ts +14 -0
  11. package/dist/cli/factories/commandFactory.js +346 -47
  12. package/dist/cli/index.js +25 -10
  13. package/dist/cli/utils/completeSetup.js +9 -8
  14. package/dist/cli/utils/envManager.js +7 -6
  15. package/dist/cli/utils/interactiveSetup.js +20 -19
  16. package/dist/core/analytics.js +25 -38
  17. package/dist/core/baseProvider.d.ts +8 -0
  18. package/dist/core/baseProvider.js +177 -68
  19. package/dist/core/constants.d.ts +11 -0
  20. package/dist/core/constants.js +17 -0
  21. package/dist/core/evaluation.js +25 -14
  22. package/dist/core/factory.js +19 -18
  23. package/dist/core/streamAnalytics.d.ts +65 -0
  24. package/dist/core/streamAnalytics.js +125 -0
  25. package/dist/lib/core/analytics.js +25 -38
  26. package/dist/lib/core/baseProvider.d.ts +8 -0
  27. package/dist/lib/core/baseProvider.js +177 -68
  28. package/dist/lib/core/constants.d.ts +11 -0
  29. package/dist/lib/core/constants.js +17 -0
  30. package/dist/lib/core/evaluation.js +25 -14
  31. package/dist/lib/core/factory.js +19 -18
  32. package/dist/lib/core/streamAnalytics.d.ts +65 -0
  33. package/dist/lib/core/streamAnalytics.js +125 -0
  34. package/dist/lib/models/modelRegistry.d.ts +132 -0
  35. package/dist/lib/models/modelRegistry.js +483 -0
  36. package/dist/lib/models/modelResolver.d.ts +115 -0
  37. package/dist/lib/models/modelResolver.js +467 -0
  38. package/dist/lib/neurolink.d.ts +4 -1
  39. package/dist/lib/neurolink.js +101 -67
  40. package/dist/lib/providers/anthropic.js +3 -0
  41. package/dist/lib/providers/googleAiStudio.js +13 -0
  42. package/dist/lib/providers/huggingFace.js +15 -3
  43. package/dist/lib/providers/mistral.js +19 -7
  44. package/dist/lib/providers/ollama.js +31 -7
  45. package/dist/lib/providers/openAI.js +12 -0
  46. package/dist/lib/sdk/toolRegistration.js +2 -2
  47. package/dist/lib/types/cli.d.ts +56 -1
  48. package/dist/lib/types/contextTypes.d.ts +110 -0
  49. package/dist/lib/types/contextTypes.js +176 -0
  50. package/dist/lib/types/index.d.ts +4 -1
  51. package/dist/lib/types/mcpTypes.d.ts +118 -7
  52. package/dist/lib/types/providers.d.ts +81 -0
  53. package/dist/lib/types/streamTypes.d.ts +44 -7
  54. package/dist/lib/types/tools.d.ts +9 -0
  55. package/dist/lib/types/universalProviderOptions.d.ts +3 -1
  56. package/dist/lib/types/universalProviderOptions.js +2 -1
  57. package/dist/lib/utils/logger.d.ts +7 -0
  58. package/dist/lib/utils/logger.js +11 -0
  59. package/dist/lib/utils/performance.d.ts +105 -0
  60. package/dist/lib/utils/performance.js +210 -0
  61. package/dist/lib/utils/retryHandler.d.ts +89 -0
  62. package/dist/lib/utils/retryHandler.js +269 -0
  63. package/dist/models/modelRegistry.d.ts +132 -0
  64. package/dist/models/modelRegistry.js +483 -0
  65. package/dist/models/modelResolver.d.ts +115 -0
  66. package/dist/models/modelResolver.js +468 -0
  67. package/dist/neurolink.d.ts +4 -1
  68. package/dist/neurolink.js +101 -67
  69. package/dist/providers/anthropic.js +3 -0
  70. package/dist/providers/googleAiStudio.js +13 -0
  71. package/dist/providers/huggingFace.js +15 -3
  72. package/dist/providers/mistral.js +19 -7
  73. package/dist/providers/ollama.js +31 -7
  74. package/dist/providers/openAI.js +12 -0
  75. package/dist/sdk/toolRegistration.js +2 -2
  76. package/dist/types/cli.d.ts +56 -1
  77. package/dist/types/contextTypes.d.ts +110 -0
  78. package/dist/types/contextTypes.js +177 -0
  79. package/dist/types/index.d.ts +4 -1
  80. package/dist/types/mcpTypes.d.ts +118 -7
  81. package/dist/types/providers.d.ts +81 -0
  82. package/dist/types/streamTypes.d.ts +44 -7
  83. package/dist/types/tools.d.ts +9 -0
  84. package/dist/types/universalProviderOptions.d.ts +3 -1
  85. package/dist/types/universalProviderOptions.js +3 -1
  86. package/dist/utils/logger.d.ts +7 -0
  87. package/dist/utils/logger.js +11 -0
  88. package/dist/utils/performance.d.ts +105 -0
  89. package/dist/utils/performance.js +210 -0
  90. package/dist/utils/retryHandler.d.ts +89 -0
  91. package/dist/utils/retryHandler.js +269 -0
  92. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -1,9 +1,15 @@
1
- # [7.1.0](https://github.com/juspay/neurolink/compare/v7.0.0...v7.1.0) (2025-08-03)
1
+ # [7.2.0](https://github.com/juspay/neurolink/compare/v7.1.0...v7.2.0) (2025-08-04)
2
+
3
+
4
+ ### Features
5
+
6
+ * **core:** complete NeuroLink Phase 1-4 implementation with comprehensive verification ([37d5cb1](https://github.com/juspay/neurolink/commit/37d5cb1a494850cd564d6fbce68895997939886f))
2
7
 
8
+ # [7.1.0](https://github.com/juspay/neurolink/compare/v7.0.0...v7.1.0) (2025-08-03)
3
9
 
4
10
  ### Features
5
11
 
6
- * **core:** major CLI optimization and comprehensive core functionality overhaul ([66ad664](https://github.com/juspay/neurolink/commit/66ad6649163c21c1f5cf7dcb936af8903abc4a17))
12
+ - **core:** major CLI optimization and comprehensive core functionality overhaul ([66ad664](https://github.com/juspay/neurolink/commit/66ad6649163c21c1f5cf7dcb936af8903abc4a17))
7
13
 
8
14
  # [7.0.0](https://github.com/juspay/neurolink/compare/v6.2.1...v7.0.0) (2025-07-31)
9
15
 
package/README.md CHANGED
@@ -24,18 +24,20 @@
24
24
  - **⚔ Performance** - Fast response times with streaming support
25
25
  - **šŸ›”ļø Error Recovery** - Graceful failures with provider fallback
26
26
 
27
- ## āœ… LATEST UPDATE: Factory Pattern Refactoring Complete (2025-01-20)
27
+ ## āœ… LATEST UPDATE: Advanced Features & Performance Optimization Complete (2025-08-03)
28
28
 
29
- **NeuroLink now features a unified factory pattern architecture with automatic tool support for all providers.**
29
+ **NeuroLink Phase 3 implementation delivers comprehensive system polish and production-ready performance.**
30
30
 
31
- - āœ… **Unified Architecture**: All providers inherit from BaseProvider with built-in tool support
31
+ - āœ… **Enhanced Evaluation System**: Detailed reasoning explanations in all evaluation responses
32
+ - āœ… **Real Streaming Architecture**: Vercel AI SDK real streaming with comprehensive analytics support
33
+ - āœ… **Performance Optimization**: 68% improvement in provider status checks (16s → 5s via parallel execution)
34
+ - āœ… **Memory Management**: Automatic cleanup for operations >50MB with performance tracking
35
+ - āœ… **Edge Case Handling**: Input validation, timeout warnings, and network resilience
36
+ - āœ… **Scalability Improvements**: Retry logic, circuit breakers, and rate limiting
37
+ - āœ… **Factory Pattern Architecture**: All providers inherit from BaseProvider with built-in tool support
32
38
  - āœ… **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
39
 
38
- > **Factory Pattern**: NeuroLink uses BaseProvider inheritance to provide consistent tool support across all AI providers without code duplication.
40
+ > **Production Ready**: NeuroLink now features enterprise-grade performance optimizations, comprehensive error handling, and real streaming architecture for multi-modal future.
39
41
 
40
42
  ## āœ… Stream Function Migration Complete (2025-01-12)
41
43
 
@@ -66,11 +68,14 @@ npx @juspay/neurolink gen "Hello, AI" # Shortest form
66
68
  npx @juspay/neurolink generate "Explain AI" --provider google-ai
67
69
  npx @juspay/neurolink gen "Write code" --provider openai # Shortest form
68
70
 
69
- # šŸ†• AI Enhancement Features
70
- npx @juspay/neurolink generate "Explain AI" --enable-analytics --debug
71
- npx @juspay/neurolink generate "Write code" --enable-evaluation --debug
71
+ # šŸ†• AI Enhancement Features (Phase 3 Complete)
72
+ npx @juspay/neurolink generate "Explain AI" --enableAnalytics --debug
73
+ npx @juspay/neurolink generate "Write code" --enableEvaluation --debug
72
74
  npx @juspay/neurolink generate "Help me" --context '{"userId":"123"}' --debug
73
75
 
76
+ # šŸš€ Real Streaming with Analytics (Phase 3.2B Complete)
77
+ npx @juspay/neurolink stream "Explain quantum computing" --enableAnalytics --enableEvaluation
78
+
74
79
  npx @juspay/neurolink status
75
80
  ```
76
81
 
@@ -258,7 +258,6 @@ declare const ConfigSchema: z.ZodObject<{
258
258
  cacheStrategy?: "file" | "memory" | "redis" | undefined;
259
259
  }>>;
260
260
  }, "strip", z.ZodTypeAny, {
261
- defaultProvider: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto";
262
261
  providers: {
263
262
  bedrock?: {
264
263
  model: string;
@@ -309,6 +308,7 @@ declare const ConfigSchema: z.ZodObject<{
309
308
  apiKey?: string | undefined;
310
309
  } | undefined;
311
310
  };
311
+ defaultProvider: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto";
312
312
  profiles: Record<string, any>;
313
313
  preferences: {
314
314
  maxTokens: number;
@@ -319,7 +319,6 @@ declare const ConfigSchema: z.ZodObject<{
319
319
  cacheStrategy: "file" | "memory" | "redis";
320
320
  };
321
321
  }, {
322
- defaultProvider?: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto" | undefined;
323
322
  providers?: {
324
323
  bedrock?: {
325
324
  model?: string | undefined;
@@ -370,6 +369,7 @@ declare const ConfigSchema: z.ZodObject<{
370
369
  apiKey?: string | undefined;
371
370
  } | undefined;
372
371
  } | undefined;
372
+ defaultProvider?: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto" | undefined;
373
373
  profiles?: Record<string, any> | undefined;
374
374
  preferences?: {
375
375
  maxTokens?: number | undefined;
@@ -12,6 +12,7 @@ import os from "os";
12
12
  import chalk from "chalk";
13
13
  import { z } from "zod";
14
14
  import { CLI_LIMITS } from "../../lib/core/constants.js";
15
+ import { logger } from "../../lib/utils/logger.js";
15
16
  // Configuration schema for validation
16
17
  const ConfigSchema = z.object({
17
18
  defaultProvider: z
@@ -136,7 +137,7 @@ export class ConfigManager {
136
137
  }
137
138
  }
138
139
  catch (error) {
139
- console.warn(chalk.yellow(`āš ļø Invalid config file: ${error instanceof Error ? error.message : "Unknown error"}`));
140
+ logger.warn(chalk.yellow(`āš ļø Invalid config file: ${error instanceof Error ? error.message : "Unknown error"}`));
140
141
  }
141
142
  return ConfigSchema.parse({});
142
143
  }
@@ -152,10 +153,10 @@ export class ConfigManager {
152
153
  // Validate before saving
153
154
  const validatedConfig = ConfigSchema.parse(this.config);
154
155
  fs.writeFileSync(this.configFile, JSON.stringify(validatedConfig, null, 2));
155
- console.log(chalk.green(`āœ… Configuration saved to ${this.configFile}`));
156
+ logger.always(chalk.green(`āœ… Configuration saved to ${this.configFile}`));
156
157
  }
157
158
  catch (error) {
158
- console.error(chalk.red(`āŒ Failed to save config: ${error instanceof Error ? error.message : "Unknown error"}`));
159
+ logger.error(chalk.red(`āŒ Failed to save config: ${error instanceof Error ? error.message : "Unknown error"}`));
159
160
  process.exit(1);
160
161
  }
161
162
  }
@@ -163,7 +164,7 @@ export class ConfigManager {
163
164
  * Interactive configuration setup
164
165
  */
165
166
  async initInteractive() {
166
- console.log(chalk.blue("🧠 NeuroLink Configuration Setup\n"));
167
+ logger.always(chalk.blue("🧠 NeuroLink Configuration Setup\n"));
167
168
  try {
168
169
  // Basic preferences
169
170
  const preferences = await inquirer.prompt([
@@ -223,14 +224,14 @@ export class ConfigManager {
223
224
  await this.setupProviders();
224
225
  }
225
226
  this.saveConfig();
226
- console.log(chalk.green("\nāœ… Configuration setup complete!"));
227
- console.log(chalk.blue("šŸ’” You can modify settings anytime with: neurolink config edit"));
228
- console.log(chalk.blue("šŸ’” Test your setup with: neurolink status"));
227
+ logger.always(chalk.green("\nāœ… Configuration setup complete!"));
228
+ logger.always(chalk.blue("šŸ’” You can modify settings anytime with: neurolink config edit"));
229
+ logger.always(chalk.blue("šŸ’” Test your setup with: neurolink status"));
229
230
  }
230
231
  catch (error) {
231
232
  if (error instanceof Error &&
232
233
  error.message === "User force closed the prompt with 0 null") {
233
- console.log(chalk.yellow("\nāš ļø Setup cancelled by user"));
234
+ logger.always(chalk.yellow("\nāš ļø Setup cancelled by user"));
234
235
  process.exit(0);
235
236
  }
236
237
  throw error;
@@ -266,7 +267,7 @@ export class ConfigManager {
266
267
  * Setup individual provider
267
268
  */
268
269
  async setupProvider(provider) {
269
- console.log(chalk.blue(`\nšŸ”§ Configuring ${provider.toUpperCase()}`));
270
+ logger.always(chalk.blue(`\nšŸ”§ Configuring ${provider.toUpperCase()}`));
270
271
  switch (provider) {
271
272
  case "openai":
272
273
  await this.setupOpenAI();
@@ -638,23 +639,23 @@ export class ConfigManager {
638
639
  * Show current configuration
639
640
  */
640
641
  showConfig() {
641
- console.log(chalk.blue("šŸ“‹ Current NeuroLink Configuration\n"));
642
- console.log(chalk.cyan("General Settings:"));
643
- console.log(` Default Provider: ${chalk.white(this.config.defaultProvider)}`);
644
- console.log(` Output Format: ${chalk.white(this.config.preferences.outputFormat)}`);
645
- console.log(` Temperature: ${chalk.white(this.config.preferences.temperature)}`);
646
- console.log(` Max Tokens: ${chalk.white(this.config.preferences.maxTokens)}`);
647
- console.log(chalk.cyan("\nConfigured Providers:"));
642
+ logger.always(chalk.blue("šŸ“‹ Current NeuroLink Configuration\n"));
643
+ logger.always(chalk.cyan("General Settings:"));
644
+ logger.always(` Default Provider: ${chalk.white(this.config.defaultProvider)}`);
645
+ logger.always(` Output Format: ${chalk.white(this.config.preferences.outputFormat)}`);
646
+ logger.always(` Temperature: ${chalk.white(this.config.preferences.temperature)}`);
647
+ logger.always(` Max Tokens: ${chalk.white(this.config.preferences.maxTokens)}`);
648
+ logger.always(chalk.cyan("\nConfigured Providers:"));
648
649
  Object.entries(this.config.providers).forEach(([name, config]) => {
649
650
  if (config && Object.keys(config).length > 0) {
650
- console.log(` ${chalk.green("āœ…")} ${name.toUpperCase()}`);
651
+ logger.always(` ${chalk.green("āœ…")} ${name.toUpperCase()}`);
651
652
  if ("model" in config) {
652
- console.log(` Model: ${chalk.white(config.model)}`);
653
+ logger.always(` Model: ${chalk.white(config.model)}`);
653
654
  }
654
655
  }
655
656
  });
656
- console.log(chalk.cyan("\nConfiguration File:"));
657
- console.log(` Location: ${chalk.white(this.configFile)}`);
657
+ logger.always(chalk.cyan("\nConfiguration File:"));
658
+ logger.always(` Location: ${chalk.white(this.configFile)}`);
658
659
  }
659
660
  /**
660
661
  * Validate configuration
@@ -685,7 +686,7 @@ export class ConfigManager {
685
686
  resetConfig() {
686
687
  this.config = ConfigSchema.parse({});
687
688
  this.saveConfig();
688
- console.log(chalk.green("āœ… Configuration reset to defaults"));
689
+ logger.always(chalk.green("āœ… Configuration reset to defaults"));
689
690
  }
690
691
  }
691
692
  // Export for use in other CLI commands
@@ -0,0 +1,79 @@
1
+ /**
2
+ * MCP CLI Commands for NeuroLink
3
+ * Implements comprehensive MCP server management commands
4
+ * Part of Phase 4.2 - MCP CLI Commands
5
+ */
6
+ import type { CommandModule } from "yargs";
7
+ /**
8
+ * MCP CLI command factory
9
+ */
10
+ export declare class MCPCommandFactory {
11
+ /**
12
+ * Create the main MCP command with subcommands
13
+ */
14
+ static createMCPCommands(): CommandModule;
15
+ /**
16
+ * Create discover command (top-level command)
17
+ */
18
+ static createDiscoverCommand(): CommandModule;
19
+ /**
20
+ * Build options for list command
21
+ */
22
+ private static buildListOptions;
23
+ /**
24
+ * Build options for install command
25
+ */
26
+ private static buildInstallOptions;
27
+ /**
28
+ * Build options for add command
29
+ */
30
+ private static buildAddOptions;
31
+ /**
32
+ * Build options for test command
33
+ */
34
+ private static buildTestOptions;
35
+ /**
36
+ * Build options for exec command
37
+ */
38
+ private static buildExecOptions;
39
+ /**
40
+ * Build options for remove command
41
+ */
42
+ private static buildRemoveOptions;
43
+ /**
44
+ * Execute list command
45
+ */
46
+ private static executeList;
47
+ /**
48
+ * Execute install command
49
+ */
50
+ private static executeInstall;
51
+ /**
52
+ * Execute add command
53
+ */
54
+ private static executeAdd;
55
+ /**
56
+ * Execute test command
57
+ */
58
+ private static executeTest;
59
+ /**
60
+ * Execute exec command
61
+ */
62
+ private static executeExec;
63
+ /**
64
+ * Execute remove command
65
+ */
66
+ private static executeRemove;
67
+ /**
68
+ * Execute discover command
69
+ */
70
+ private static executeDiscover;
71
+ /**
72
+ * Discover servers from Claude Desktop configuration
73
+ */
74
+ private static discoverFromClaudeDesktop;
75
+ /**
76
+ * Discover servers from VS Code configuration
77
+ */
78
+ private static discoverFromVSCode;
79
+ }