@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.
- package/CHANGELOG.md +8 -0
- package/dist/constants/index.d.ts +192 -0
- package/dist/constants/index.js +195 -0
- package/dist/constants/performance.d.ts +366 -0
- package/dist/constants/performance.js +389 -0
- package/dist/constants/retry.d.ts +224 -0
- package/dist/constants/retry.js +266 -0
- package/dist/constants/timeouts.d.ts +225 -0
- package/dist/constants/timeouts.js +182 -0
- package/dist/constants/tokens.d.ts +234 -0
- package/dist/constants/tokens.js +314 -0
- package/dist/core/types.d.ts +268 -0
- package/dist/core/types.js +153 -0
- package/dist/lib/constants/index.d.ts +192 -0
- package/dist/lib/constants/index.js +195 -0
- package/dist/lib/constants/performance.d.ts +366 -0
- package/dist/lib/constants/performance.js +389 -0
- package/dist/lib/constants/retry.d.ts +224 -0
- package/dist/lib/constants/retry.js +266 -0
- package/dist/lib/constants/timeouts.d.ts +225 -0
- package/dist/lib/constants/timeouts.js +182 -0
- package/dist/lib/constants/tokens.d.ts +234 -0
- package/dist/lib/constants/tokens.js +314 -0
- package/dist/lib/core/types.d.ts +268 -0
- package/dist/lib/core/types.js +153 -0
- package/dist/lib/mcp/externalServerManager.d.ts +18 -3
- package/dist/lib/mcp/externalServerManager.js +125 -3
- package/dist/lib/models/modelRegistry.d.ts +1 -1
- package/dist/lib/models/modelRegistry.js +63 -37
- package/dist/lib/neurolink.d.ts +1 -1
- package/dist/lib/neurolink.js +38 -36
- package/dist/lib/providers/azureOpenai.d.ts +1 -1
- package/dist/lib/providers/azureOpenai.js +2 -1
- package/dist/lib/utils/providerConfig.d.ts +25 -0
- package/dist/lib/utils/providerConfig.js +24 -3
- package/dist/lib/utils/providerHealth.d.ts +1 -1
- package/dist/lib/utils/providerHealth.js +40 -33
- package/dist/lib/utils/providerSetupMessages.js +7 -6
- package/dist/lib/utils/providerUtils.js +16 -24
- package/dist/mcp/externalServerManager.d.ts +18 -3
- package/dist/mcp/externalServerManager.js +125 -3
- package/dist/models/modelRegistry.d.ts +1 -1
- package/dist/models/modelRegistry.js +63 -37
- package/dist/neurolink.d.ts +1 -1
- package/dist/neurolink.js +38 -36
- package/dist/providers/azureOpenai.d.ts +1 -1
- package/dist/providers/azureOpenai.js +2 -1
- package/dist/utils/providerConfig.d.ts +25 -0
- package/dist/utils/providerConfig.js +24 -3
- package/dist/utils/providerHealth.d.ts +1 -1
- package/dist/utils/providerHealth.js +40 -33
- package/dist/utils/providerSetupMessages.js +7 -6
- package/dist/utils/providerUtils.js +16 -24
- 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 "
|
|
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 (!
|
|
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 (
|
|
263
|
-
result.invalidVars.push(
|
|
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 (
|
|
275
|
-
result.invalidVars.push(
|
|
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 (
|
|
288
|
-
result.invalidVars.push(
|
|
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 (
|
|
306
|
-
result.invalidVars.push(
|
|
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 (
|
|
318
|
-
result.invalidVars.push(
|
|
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 (
|
|
330
|
-
result.invalidVars.push(
|
|
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 "
|
|
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.
|
|
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",
|