@juspay/neurolink 7.33.1 → 7.33.3

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 (54) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/constants/index.d.ts +192 -0
  3. package/dist/constants/index.js +195 -0
  4. package/dist/constants/performance.d.ts +366 -0
  5. package/dist/constants/performance.js +389 -0
  6. package/dist/constants/retry.d.ts +224 -0
  7. package/dist/constants/retry.js +266 -0
  8. package/dist/constants/timeouts.d.ts +225 -0
  9. package/dist/constants/timeouts.js +182 -0
  10. package/dist/constants/tokens.d.ts +234 -0
  11. package/dist/constants/tokens.js +314 -0
  12. package/dist/core/types.d.ts +268 -0
  13. package/dist/core/types.js +153 -0
  14. package/dist/lib/constants/index.d.ts +192 -0
  15. package/dist/lib/constants/index.js +195 -0
  16. package/dist/lib/constants/performance.d.ts +366 -0
  17. package/dist/lib/constants/performance.js +389 -0
  18. package/dist/lib/constants/retry.d.ts +224 -0
  19. package/dist/lib/constants/retry.js +266 -0
  20. package/dist/lib/constants/timeouts.d.ts +225 -0
  21. package/dist/lib/constants/timeouts.js +182 -0
  22. package/dist/lib/constants/tokens.d.ts +234 -0
  23. package/dist/lib/constants/tokens.js +314 -0
  24. package/dist/lib/core/types.d.ts +268 -0
  25. package/dist/lib/core/types.js +153 -0
  26. package/dist/lib/mcp/externalServerManager.d.ts +18 -3
  27. package/dist/lib/mcp/externalServerManager.js +125 -3
  28. package/dist/lib/models/modelRegistry.d.ts +1 -1
  29. package/dist/lib/models/modelRegistry.js +63 -37
  30. package/dist/lib/neurolink.d.ts +1 -1
  31. package/dist/lib/neurolink.js +38 -36
  32. package/dist/lib/providers/azureOpenai.d.ts +1 -1
  33. package/dist/lib/providers/azureOpenai.js +2 -1
  34. package/dist/lib/utils/providerConfig.d.ts +25 -0
  35. package/dist/lib/utils/providerConfig.js +24 -3
  36. package/dist/lib/utils/providerHealth.d.ts +1 -1
  37. package/dist/lib/utils/providerHealth.js +40 -33
  38. package/dist/lib/utils/providerSetupMessages.js +7 -6
  39. package/dist/lib/utils/providerUtils.js +16 -24
  40. package/dist/mcp/externalServerManager.d.ts +18 -3
  41. package/dist/mcp/externalServerManager.js +125 -3
  42. package/dist/models/modelRegistry.d.ts +1 -1
  43. package/dist/models/modelRegistry.js +63 -37
  44. package/dist/neurolink.d.ts +1 -1
  45. package/dist/neurolink.js +38 -36
  46. package/dist/providers/azureOpenai.d.ts +1 -1
  47. package/dist/providers/azureOpenai.js +2 -1
  48. package/dist/utils/providerConfig.d.ts +25 -0
  49. package/dist/utils/providerConfig.js +24 -3
  50. package/dist/utils/providerHealth.d.ts +1 -1
  51. package/dist/utils/providerHealth.js +40 -33
  52. package/dist/utils/providerSetupMessages.js +7 -6
  53. package/dist/utils/providerUtils.js +16 -24
  54. package/package.json +1 -1
@@ -5,6 +5,7 @@
5
5
  import { AIProviderFactory } from "../core/factory.js";
6
6
  import { logger } from "./logger.js";
7
7
  import { ProviderHealthChecker } from "./providerHealth.js";
8
+ import { API_KEY_FORMATS, API_KEY_LENGTHS, PROJECT_ID_FORMAT, } from "./providerConfig.js";
8
9
  /**
9
10
  * Get the best available provider based on real-time availability checks
10
11
  * Enhanced version consolidated from providerUtils-fixed.ts
@@ -123,15 +124,6 @@ async function isProviderAvailable(providerName) {
123
124
  return false;
124
125
  }
125
126
  }
126
- /**
127
- * Google Cloud Project ID validation regex
128
- * Format requirements:
129
- * - Must start with a lowercase letter
130
- * - Can contain lowercase letters, numbers, and hyphens
131
- * - Must end with a lowercase letter or number
132
- * - Total length must be 6-30 characters
133
- */
134
- const GOOGLE_CLOUD_PROJECT_ID_REGEX = /^[a-z][a-z0-9-]{4,28}[a-z0-9]$/;
135
127
  /**
136
128
  * Validate environment variable values for a provider
137
129
  * Addresses GitHub Copilot comment about adding environment variable validation
@@ -166,7 +158,7 @@ export function validateProviderEnvVars(provider) {
166
158
  validateAnthropicCredentials(result);
167
159
  break;
168
160
  case "azure":
169
- case "azureOpenai":
161
+ case "azureopenai":
170
162
  validateAzureCredentials(result);
171
163
  break;
172
164
  case "google-ai":
@@ -240,7 +232,7 @@ function validateVertexCredentials(result) {
240
232
  if (!projectId) {
241
233
  result.missingVars.push("GOOGLE_CLOUD_PROJECT_ID (or variant)");
242
234
  }
243
- else if (!GOOGLE_CLOUD_PROJECT_ID_REGEX.test(projectId)) {
235
+ else if (!PROJECT_ID_FORMAT.PATTERN.test(projectId)) {
244
236
  result.invalidVars.push("Project ID format invalid (must be 6-30 lowercase letters, digits, hyphens)");
245
237
  }
246
238
  if (!hasCredentials) {
@@ -259,8 +251,8 @@ function validateOpenAICredentials(result) {
259
251
  if (!apiKey) {
260
252
  result.missingVars.push("OPENAI_API_KEY");
261
253
  }
262
- else if (!/^sk-[A-Za-z0-9]{48,}$/.test(apiKey)) {
263
- result.invalidVars.push("OPENAI_API_KEY (should start with 'sk-' followed by 48+ characters)");
254
+ else if (!API_KEY_FORMATS.openai.test(apiKey)) {
255
+ result.invalidVars.push(`OPENAI_API_KEY (should start with 'sk-' followed by ${API_KEY_LENGTHS.OPENAI_MIN}+ characters)`);
264
256
  }
265
257
  }
266
258
  /**
@@ -271,8 +263,8 @@ function validateAnthropicCredentials(result) {
271
263
  if (!apiKey) {
272
264
  result.missingVars.push("ANTHROPIC_API_KEY");
273
265
  }
274
- else if (!/^sk-ant-[A-Za-z0-9-_]{95,}$/.test(apiKey)) {
275
- result.invalidVars.push("ANTHROPIC_API_KEY (should start with 'sk-ant-' followed by 95+ characters)");
266
+ else if (!API_KEY_FORMATS.anthropic.test(apiKey)) {
267
+ result.invalidVars.push(`ANTHROPIC_API_KEY (should start with 'sk-ant-' followed by ${API_KEY_LENGTHS.ANTHROPIC_MIN}+ characters)`);
276
268
  }
277
269
  }
278
270
  /**
@@ -284,8 +276,8 @@ function validateAzureCredentials(result) {
284
276
  if (!apiKey) {
285
277
  result.missingVars.push("AZURE_OPENAI_API_KEY");
286
278
  }
287
- else if (!/^[a-f0-9]{32}$/.test(apiKey)) {
288
- result.invalidVars.push("AZURE_OPENAI_API_KEY (should be 32 hexadecimal characters)");
279
+ else if (!API_KEY_FORMATS.azure.test(apiKey)) {
280
+ result.invalidVars.push(`AZURE_OPENAI_API_KEY (should be at least ${API_KEY_LENGTHS.AZURE_MIN} alphanumeric characters)`);
289
281
  }
290
282
  if (!endpoint) {
291
283
  result.missingVars.push("AZURE_OPENAI_ENDPOINT");
@@ -302,8 +294,8 @@ function validateGoogleAICredentials(result) {
302
294
  if (!apiKey) {
303
295
  result.missingVars.push("GOOGLE_AI_API_KEY (or GOOGLE_GENERATIVE_AI_API_KEY)");
304
296
  }
305
- else if (!/^[A-Za-z0-9_-]{39}$/.test(apiKey)) {
306
- result.invalidVars.push("GOOGLE_AI_API_KEY (should be 39 alphanumeric characters with dashes/underscores)");
297
+ else if (!API_KEY_FORMATS["google-ai"].test(apiKey)) {
298
+ result.invalidVars.push(`GOOGLE_AI_API_KEY (should be ${API_KEY_LENGTHS.GOOGLE_AI_EXACT} alphanumeric characters with dashes/underscores)`);
307
299
  }
308
300
  }
309
301
  /**
@@ -314,8 +306,8 @@ function validateHuggingFaceCredentials(result) {
314
306
  if (!apiKey) {
315
307
  result.missingVars.push("HUGGINGFACE_API_KEY (or HF_TOKEN)");
316
308
  }
317
- else if (!/^hf_[A-Za-z0-9]{37}$/.test(apiKey)) {
318
- result.invalidVars.push("HUGGINGFACE_API_KEY (should start with 'hf_' followed by 37 characters)");
309
+ else if (!API_KEY_FORMATS.huggingface.test(apiKey)) {
310
+ result.invalidVars.push(`HUGGINGFACE_API_KEY (should start with 'hf_' followed by ${API_KEY_LENGTHS.HUGGINGFACE_EXACT} characters)`);
319
311
  }
320
312
  }
321
313
  /**
@@ -326,8 +318,8 @@ function validateMistralCredentials(result) {
326
318
  if (!apiKey) {
327
319
  result.missingVars.push("MISTRAL_API_KEY");
328
320
  }
329
- else if (!/^[A-Za-z0-9]{32,}$/.test(apiKey)) {
330
- result.invalidVars.push("MISTRAL_API_KEY (should be 32+ alphanumeric characters)");
321
+ else if (!API_KEY_FORMATS.mistral.test(apiKey)) {
322
+ result.invalidVars.push(`MISTRAL_API_KEY (should be ${API_KEY_LENGTHS.MISTRAL_EXACT} alphanumeric characters)`);
331
323
  }
332
324
  }
333
325
  /**
@@ -381,7 +373,7 @@ export function hasProviderEnvVars(provider) {
381
373
  case "claude":
382
374
  return !!process.env.ANTHROPIC_API_KEY;
383
375
  case "azure":
384
- case "azureOpenai":
376
+ case "azureopenai":
385
377
  return !!process.env.AZURE_OPENAI_API_KEY;
386
378
  case "google-ai":
387
379
  case "google-studio":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "7.33.1",
3
+ "version": "7.33.3",
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",