@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.
- package/CHANGELOG.md +8 -2
- package/README.md +16 -11
- package/dist/cli/commands/config.d.ts +2 -2
- package/dist/cli/commands/config.js +22 -21
- package/dist/cli/commands/mcp.d.ts +79 -0
- package/dist/cli/commands/mcp.js +916 -0
- package/dist/cli/commands/models.d.ts +63 -0
- package/dist/cli/commands/models.js +653 -0
- package/dist/cli/commands/ollama.js +56 -55
- package/dist/cli/factories/commandFactory.d.ts +14 -0
- package/dist/cli/factories/commandFactory.js +346 -47
- package/dist/cli/index.js +25 -10
- package/dist/cli/utils/completeSetup.js +9 -8
- package/dist/cli/utils/envManager.js +7 -6
- package/dist/cli/utils/interactiveSetup.js +20 -19
- package/dist/core/analytics.js +25 -38
- package/dist/core/baseProvider.d.ts +8 -0
- package/dist/core/baseProvider.js +177 -68
- package/dist/core/constants.d.ts +11 -0
- package/dist/core/constants.js +17 -0
- package/dist/core/evaluation.js +25 -14
- package/dist/core/factory.js +19 -18
- package/dist/core/streamAnalytics.d.ts +65 -0
- package/dist/core/streamAnalytics.js +125 -0
- package/dist/lib/core/analytics.js +25 -38
- package/dist/lib/core/baseProvider.d.ts +8 -0
- package/dist/lib/core/baseProvider.js +177 -68
- package/dist/lib/core/constants.d.ts +11 -0
- package/dist/lib/core/constants.js +17 -0
- package/dist/lib/core/evaluation.js +25 -14
- package/dist/lib/core/factory.js +19 -18
- package/dist/lib/core/streamAnalytics.d.ts +65 -0
- package/dist/lib/core/streamAnalytics.js +125 -0
- package/dist/lib/models/modelRegistry.d.ts +132 -0
- package/dist/lib/models/modelRegistry.js +483 -0
- package/dist/lib/models/modelResolver.d.ts +115 -0
- package/dist/lib/models/modelResolver.js +467 -0
- package/dist/lib/neurolink.d.ts +4 -1
- package/dist/lib/neurolink.js +101 -67
- package/dist/lib/providers/anthropic.js +3 -0
- package/dist/lib/providers/googleAiStudio.js +13 -0
- package/dist/lib/providers/huggingFace.js +15 -3
- package/dist/lib/providers/mistral.js +19 -7
- package/dist/lib/providers/ollama.js +31 -7
- package/dist/lib/providers/openAI.js +12 -0
- package/dist/lib/sdk/toolRegistration.js +2 -2
- package/dist/lib/types/cli.d.ts +56 -1
- package/dist/lib/types/contextTypes.d.ts +110 -0
- package/dist/lib/types/contextTypes.js +176 -0
- package/dist/lib/types/index.d.ts +4 -1
- package/dist/lib/types/mcpTypes.d.ts +118 -7
- package/dist/lib/types/providers.d.ts +81 -0
- package/dist/lib/types/streamTypes.d.ts +44 -7
- package/dist/lib/types/tools.d.ts +9 -0
- package/dist/lib/types/universalProviderOptions.d.ts +3 -1
- package/dist/lib/types/universalProviderOptions.js +2 -1
- package/dist/lib/utils/logger.d.ts +7 -0
- package/dist/lib/utils/logger.js +11 -0
- package/dist/lib/utils/performance.d.ts +105 -0
- package/dist/lib/utils/performance.js +210 -0
- package/dist/lib/utils/retryHandler.d.ts +89 -0
- package/dist/lib/utils/retryHandler.js +269 -0
- package/dist/models/modelRegistry.d.ts +132 -0
- package/dist/models/modelRegistry.js +483 -0
- package/dist/models/modelResolver.d.ts +115 -0
- package/dist/models/modelResolver.js +468 -0
- package/dist/neurolink.d.ts +4 -1
- package/dist/neurolink.js +101 -67
- package/dist/providers/anthropic.js +3 -0
- package/dist/providers/googleAiStudio.js +13 -0
- package/dist/providers/huggingFace.js +15 -3
- package/dist/providers/mistral.js +19 -7
- package/dist/providers/ollama.js +31 -7
- package/dist/providers/openAI.js +12 -0
- package/dist/sdk/toolRegistration.js +2 -2
- package/dist/types/cli.d.ts +56 -1
- package/dist/types/contextTypes.d.ts +110 -0
- package/dist/types/contextTypes.js +177 -0
- package/dist/types/index.d.ts +4 -1
- package/dist/types/mcpTypes.d.ts +118 -7
- package/dist/types/providers.d.ts +81 -0
- package/dist/types/streamTypes.d.ts +44 -7
- package/dist/types/tools.d.ts +9 -0
- package/dist/types/universalProviderOptions.d.ts +3 -1
- package/dist/types/universalProviderOptions.js +3 -1
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.js +11 -0
- package/dist/utils/performance.d.ts +105 -0
- package/dist/utils/performance.js +210 -0
- package/dist/utils/retryHandler.d.ts +89 -0
- package/dist/utils/retryHandler.js +269 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
# [7.
|
|
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
|
-
|
|
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:
|
|
27
|
+
## ā
LATEST UPDATE: Advanced Features & Performance Optimization Complete (2025-08-03)
|
|
28
28
|
|
|
29
|
-
**NeuroLink
|
|
29
|
+
**NeuroLink Phase 3 implementation delivers comprehensive system polish and production-ready performance.**
|
|
30
30
|
|
|
31
|
-
- ā
**
|
|
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
|
-
> **
|
|
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" --
|
|
71
|
-
npx @juspay/neurolink generate "Write code" --
|
|
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
|
-
|
|
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
|
-
|
|
156
|
+
logger.always(chalk.green(`ā
Configuration saved to ${this.configFile}`));
|
|
156
157
|
}
|
|
157
158
|
catch (error) {
|
|
158
|
-
|
|
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
|
-
|
|
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
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
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
|
-
|
|
651
|
+
logger.always(` ${chalk.green("ā
")} ${name.toUpperCase()}`);
|
|
651
652
|
if ("model" in config) {
|
|
652
|
-
|
|
653
|
+
logger.always(` Model: ${chalk.white(config.model)}`);
|
|
653
654
|
}
|
|
654
655
|
}
|
|
655
656
|
});
|
|
656
|
-
|
|
657
|
-
|
|
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
|
-
|
|
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
|
+
}
|