@juspay/neurolink 7.29.0 → 7.29.2

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 (61) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cli/commands/config.d.ts +3 -3
  3. package/dist/cli/commands/mcp.js +25 -0
  4. package/dist/cli/factories/commandFactory.d.ts +1 -0
  5. package/dist/cli/factories/commandFactory.js +115 -21
  6. package/dist/cli/index.js +8 -0
  7. package/dist/core/factory.js +77 -4
  8. package/dist/factories/providerFactory.js +3 -0
  9. package/dist/factories/providerRegistry.js +2 -2
  10. package/dist/lib/core/factory.js +77 -4
  11. package/dist/lib/factories/providerFactory.js +3 -0
  12. package/dist/lib/factories/providerRegistry.js +2 -2
  13. package/dist/lib/mcp/externalServerManager.js +13 -14
  14. package/dist/lib/mcp/flexibleToolValidator.d.ts +50 -0
  15. package/dist/lib/mcp/flexibleToolValidator.js +161 -0
  16. package/dist/lib/mcp/toolRegistry.d.ts +2 -2
  17. package/dist/lib/mcp/toolRegistry.js +25 -50
  18. package/dist/lib/neurolink.d.ts +299 -4
  19. package/dist/lib/neurolink.js +434 -73
  20. package/dist/lib/providers/amazonBedrock.d.ts +47 -6
  21. package/dist/lib/providers/amazonBedrock.js +282 -23
  22. package/dist/lib/providers/aws/credentialProvider.d.ts +58 -0
  23. package/dist/lib/providers/aws/credentialProvider.js +267 -0
  24. package/dist/lib/providers/aws/credentialTester.d.ts +49 -0
  25. package/dist/lib/providers/aws/credentialTester.js +394 -0
  26. package/dist/lib/providers/googleVertex.js +13 -4
  27. package/dist/lib/proxy/awsProxyIntegration.d.ts +23 -0
  28. package/dist/lib/proxy/awsProxyIntegration.js +285 -0
  29. package/dist/lib/proxy/proxyFetch.d.ts +9 -5
  30. package/dist/lib/proxy/proxyFetch.js +232 -98
  31. package/dist/lib/proxy/utils/noProxyUtils.d.ts +39 -0
  32. package/dist/lib/proxy/utils/noProxyUtils.js +149 -0
  33. package/dist/lib/types/providers.d.ts +43 -0
  34. package/dist/lib/utils/providerConfig.d.ts +1 -0
  35. package/dist/lib/utils/providerConfig.js +2 -1
  36. package/dist/lib/utils/providerHealth.js +123 -5
  37. package/dist/mcp/externalServerManager.js +13 -14
  38. package/dist/mcp/flexibleToolValidator.d.ts +50 -0
  39. package/dist/mcp/flexibleToolValidator.js +161 -0
  40. package/dist/mcp/toolRegistry.d.ts +2 -2
  41. package/dist/mcp/toolRegistry.js +25 -50
  42. package/dist/neurolink.d.ts +299 -4
  43. package/dist/neurolink.js +434 -73
  44. package/dist/providers/amazonBedrock.d.ts +47 -6
  45. package/dist/providers/amazonBedrock.js +282 -23
  46. package/dist/providers/aws/credentialProvider.d.ts +58 -0
  47. package/dist/providers/aws/credentialProvider.js +267 -0
  48. package/dist/providers/aws/credentialTester.d.ts +49 -0
  49. package/dist/providers/aws/credentialTester.js +394 -0
  50. package/dist/providers/googleVertex.js +13 -4
  51. package/dist/proxy/awsProxyIntegration.d.ts +23 -0
  52. package/dist/proxy/awsProxyIntegration.js +285 -0
  53. package/dist/proxy/proxyFetch.d.ts +9 -5
  54. package/dist/proxy/proxyFetch.js +232 -98
  55. package/dist/proxy/utils/noProxyUtils.d.ts +39 -0
  56. package/dist/proxy/utils/noProxyUtils.js +149 -0
  57. package/dist/types/providers.d.ts +43 -0
  58. package/dist/utils/providerConfig.d.ts +1 -0
  59. package/dist/utils/providerConfig.js +2 -1
  60. package/dist/utils/providerHealth.js +123 -5
  61. package/package.json +5 -1
@@ -359,9 +359,10 @@ export function createAnthropicBaseConfig() {
359
359
  // =============================================================================
360
360
  /**
361
361
  * Gets AWS Region with default fallback
362
+ * Supports both AWS_REGION and AWS_DEFAULT_REGION for broader compatibility
362
363
  */
363
364
  export function getAWSRegion() {
364
- return process.env.AWS_REGION || "us-east-1";
365
+ return (process.env.AWS_REGION || process.env.AWS_DEFAULT_REGION || "us-east-1");
365
366
  }
366
367
  /**
367
368
  * Gets AWS Session Token if available
@@ -130,6 +130,14 @@ export class ProviderHealthChecker {
130
130
  */
131
131
  static async checkEnvironmentConfiguration(providerName, healthStatus) {
132
132
  const requiredEnvVars = this.getRequiredEnvironmentVariables(providerName);
133
+ logger.debug(`[ProviderHealthChecker] Checking environment configuration for ${providerName}`, {
134
+ requiredEnvVars,
135
+ presentEnvVars: requiredEnvVars.map((envVar) => ({
136
+ name: envVar,
137
+ present: !!process.env[envVar],
138
+ hasValue: !!(process.env[envVar] && process.env[envVar].trim() !== ""),
139
+ })),
140
+ });
133
141
  let allConfigured = true;
134
142
  const missingVars = [];
135
143
  for (const envVar of requiredEnvVars) {
@@ -140,6 +148,12 @@ export class ProviderHealthChecker {
140
148
  }
141
149
  }
142
150
  healthStatus.isConfigured = allConfigured;
151
+ logger.debug(`[ProviderHealthChecker] Environment configuration result for ${providerName}`, {
152
+ isConfigured: allConfigured,
153
+ missingVars,
154
+ totalRequired: requiredEnvVars.length,
155
+ totalMissing: missingVars.length,
156
+ });
143
157
  if (!allConfigured) {
144
158
  healthStatus.configurationIssues.push(`Missing required environment variables: ${missingVars.join(", ")}`);
145
159
  healthStatus.recommendations.push(`Set the following environment variables: ${missingVars.join(", ")}`);
@@ -211,6 +225,12 @@ export class ProviderHealthChecker {
211
225
  }
212
226
  return;
213
227
  }
228
+ // Providers that don't use API keys directly
229
+ if (providerName === AIProviderName.OLLAMA ||
230
+ providerName === AIProviderName.BEDROCK) {
231
+ healthStatus.hasApiKey = true;
232
+ return;
233
+ }
214
234
  // 🔧 STANDARD HANDLING FOR OTHER PROVIDERS
215
235
  const apiKeyVar = this.getApiKeyEnvironmentVariable(providerName);
216
236
  const apiKey = process.env[apiKeyVar];
@@ -342,7 +362,9 @@ export class ProviderHealthChecker {
342
362
  case AIProviderName.GOOGLE_AI:
343
363
  return ["GOOGLE_AI_API_KEY"];
344
364
  case AIProviderName.BEDROCK:
345
- return ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_REGION"];
365
+ // Bedrock credentials are resolved via AWS SDK default provider chain.
366
+ // Region/auth validated in provider-specific checks.
367
+ return [];
346
368
  case AIProviderName.AZURE:
347
369
  return ["AZURE_OPENAI_API_KEY", "AZURE_OPENAI_ENDPOINT"];
348
370
  case AIProviderName.OLLAMA:
@@ -556,13 +578,109 @@ export class ProviderHealthChecker {
556
578
  }
557
579
  break;
558
580
  }
559
- case AIProviderName.BEDROCK:
560
- // Check AWS region
561
- if (!process.env.AWS_REGION) {
581
+ case AIProviderName.BEDROCK: {
582
+ logger.debug("Starting AWS Bedrock comprehensive health check", {
583
+ providerName,
584
+ });
585
+ // Check AWS region configuration
586
+ const awsRegion = process.env.AWS_REGION;
587
+ const validBedrockRegions = [
588
+ "us-east-1",
589
+ "us-west-2",
590
+ "ap-southeast-1",
591
+ "ap-northeast-1",
592
+ "eu-central-1",
593
+ "eu-west-1",
594
+ "ap-south-1",
595
+ ];
596
+ logger.debug("AWS Region validation", {
597
+ hasAwsRegion: !!awsRegion,
598
+ awsRegion: awsRegion || "not set",
599
+ validBedrockRegions,
600
+ });
601
+ if (!awsRegion) {
562
602
  healthStatus.configurationIssues.push("AWS_REGION not set");
563
- healthStatus.recommendations.push("Set AWS_REGION (e.g., us-east-1)");
603
+ healthStatus.recommendations.push(`Set AWS_REGION to a Bedrock-supported region: ${validBedrockRegions.join(", ")}`);
604
+ }
605
+ else if (!validBedrockRegions.includes(awsRegion)) {
606
+ healthStatus.configurationIssues.push(`AWS_REGION '${awsRegion}' may not support all Bedrock models`);
607
+ healthStatus.recommendations.push(`Consider using a primary Bedrock region: ${validBedrockRegions.slice(0, 3).join(", ")}`);
608
+ }
609
+ // Check AWS credentials configuration
610
+ const awsAccessKeyId = process.env.AWS_ACCESS_KEY_ID;
611
+ const awsSecretAccessKey = process.env.AWS_SECRET_ACCESS_KEY;
612
+ const awsSessionToken = process.env.AWS_SESSION_TOKEN;
613
+ const awsProfile = process.env.AWS_PROFILE;
614
+ logger.debug("AWS Credentials validation", {
615
+ hasAccessKeyId: !!awsAccessKeyId,
616
+ hasSecretAccessKey: !!awsSecretAccessKey,
617
+ hasSessionToken: !!awsSessionToken,
618
+ hasProfile: !!awsProfile,
619
+ authMethod: awsProfile
620
+ ? "AWS Profile"
621
+ : awsAccessKeyId
622
+ ? "Access Keys"
623
+ : "None detected",
624
+ });
625
+ if (!awsAccessKeyId && !awsProfile) {
626
+ healthStatus.configurationIssues.push("No AWS credentials found");
627
+ healthStatus.recommendations.push("Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, or configure AWS_PROFILE");
628
+ }
629
+ else if (awsAccessKeyId && !awsSecretAccessKey) {
630
+ healthStatus.configurationIssues.push("AWS_ACCESS_KEY_ID set but AWS_SECRET_ACCESS_KEY missing");
631
+ healthStatus.recommendations.push("Set AWS_SECRET_ACCESS_KEY to match your AWS_ACCESS_KEY_ID");
632
+ }
633
+ // Check for Bedrock-specific model configuration
634
+ const bedrockModel = process.env.BEDROCK_MODEL || process.env.BEDROCK_MODEL_ID;
635
+ const supportedModels = [
636
+ "anthropic.claude-3-sonnet-20240229-v1:0",
637
+ "anthropic.claude-3-haiku-20240307-v1:0",
638
+ "anthropic.claude-3-opus-20240229-v1:0",
639
+ "anthropic.claude-v2:1",
640
+ "amazon.titan-text-express-v1",
641
+ ];
642
+ logger.debug("Bedrock Model validation", {
643
+ hasBedrockModel: !!bedrockModel,
644
+ bedrockModel: bedrockModel || "not set",
645
+ supportedModels: supportedModels.slice(0, 3),
646
+ });
647
+ if (!bedrockModel) {
648
+ healthStatus.recommendations.push("Set BEDROCK_MODEL or BEDROCK_MODEL_ID for faster startup (e.g., anthropic.claude-3-sonnet-20240229-v1:0)");
649
+ }
650
+ else if (!supportedModels.some((model) => model === bedrockModel)) {
651
+ healthStatus.recommendations.push(`Consider using a popular Bedrock model: ${supportedModels.slice(0, 3).join(", ")}`);
652
+ }
653
+ // Check for additional Bedrock configuration
654
+ const bedrockEndpoint = process.env.BEDROCK_ENDPOINT_URL;
655
+ if (bedrockEndpoint) {
656
+ logger.debug("Custom Bedrock endpoint detected", {
657
+ endpoint: bedrockEndpoint,
658
+ });
659
+ if (!bedrockEndpoint.startsWith("https://")) {
660
+ healthStatus.configurationIssues.push("BEDROCK_ENDPOINT_URL should use HTTPS");
661
+ healthStatus.recommendations.push("Update BEDROCK_ENDPOINT_URL to use HTTPS protocol");
662
+ }
663
+ }
664
+ // AWS SDK Configuration checks
665
+ const awsConfig = {
666
+ maxAttempts: process.env.AWS_MAX_ATTEMPTS,
667
+ retryMode: process.env.AWS_RETRY_MODE,
668
+ defaultsMode: process.env.AWS_DEFAULTS_MODE,
669
+ };
670
+ logger.debug("AWS SDK Configuration", {
671
+ awsConfig,
672
+ hasAdvancedConfig: Object.values(awsConfig).some(Boolean),
673
+ });
674
+ if (healthStatus.configurationIssues.length === 0) {
675
+ healthStatus.hasApiKey = true;
676
+ logger.debug("AWS Bedrock configuration appears valid", {
677
+ region: awsRegion,
678
+ hasCredentials: !!(awsAccessKeyId || awsProfile),
679
+ hasModel: !!bedrockModel,
680
+ });
564
681
  }
565
682
  break;
683
+ }
566
684
  case AIProviderName.AZURE: {
567
685
  // Check Azure OpenAI endpoint
568
686
  const azureEndpoint = process.env.AZURE_OPENAI_ENDPOINT;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "7.29.0",
3
+ "version": "7.29.2",
4
4
  "description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 9 major providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
5
5
  "author": {
6
6
  "name": "Juspay Technologies",
@@ -145,8 +145,12 @@
145
145
  "@ai-sdk/openai": "^1.0.0",
146
146
  "@ai-sdk/provider": "^1.1.3",
147
147
  "@ai-sdk/provider-utils": "^2.2.8",
148
+ "@aws-sdk/client-bedrock": "^3.876.0",
149
+ "@aws-sdk/client-bedrock-runtime": "^3.876.0",
148
150
  "@aws-sdk/client-sagemaker": "^3.862.0",
149
151
  "@aws-sdk/client-sagemaker-runtime": "^3.862.0",
152
+ "@aws-sdk/credential-provider-node": "^3.876.0",
153
+ "@aws-sdk/credential-providers": "^3.876.0",
150
154
  "@aws-sdk/types": "^3.862.0",
151
155
  "@google-cloud/vertexai": "^1.10.0",
152
156
  "@google/generative-ai": "^0.24.1",