@juspay/neurolink 9.59.6 → 9.60.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 (59) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +11 -7
  3. package/dist/adapters/providerImageAdapter.js +52 -2
  4. package/dist/browser/neurolink.min.js +352 -352
  5. package/dist/cli/factories/commandFactory.js +15 -1
  6. package/dist/cli/utils/interactiveSetup.js +64 -0
  7. package/dist/constants/contextWindows.d.ts +5 -1
  8. package/dist/constants/contextWindows.js +67 -3
  9. package/dist/constants/enums.d.ts +52 -0
  10. package/dist/constants/enums.js +63 -0
  11. package/dist/core/baseProvider.d.ts +15 -6
  12. package/dist/core/baseProvider.js +28 -0
  13. package/dist/factories/providerRegistry.js +25 -1
  14. package/dist/lib/adapters/providerImageAdapter.js +52 -2
  15. package/dist/lib/constants/contextWindows.d.ts +5 -1
  16. package/dist/lib/constants/contextWindows.js +67 -3
  17. package/dist/lib/constants/enums.d.ts +52 -0
  18. package/dist/lib/constants/enums.js +63 -0
  19. package/dist/lib/core/baseProvider.d.ts +15 -6
  20. package/dist/lib/core/baseProvider.js +28 -0
  21. package/dist/lib/factories/providerRegistry.js +25 -1
  22. package/dist/lib/providers/deepseek.d.ts +29 -0
  23. package/dist/lib/providers/deepseek.js +216 -0
  24. package/dist/lib/providers/index.d.ts +4 -0
  25. package/dist/lib/providers/index.js +4 -0
  26. package/dist/lib/providers/llamaCpp.d.ts +34 -0
  27. package/dist/lib/providers/llamaCpp.js +315 -0
  28. package/dist/lib/providers/lmStudio.d.ts +34 -0
  29. package/dist/lib/providers/lmStudio.js +306 -0
  30. package/dist/lib/providers/nvidiaNim.d.ts +31 -0
  31. package/dist/lib/providers/nvidiaNim.js +354 -0
  32. package/dist/lib/proxy/proxyFetch.d.ts +9 -0
  33. package/dist/lib/proxy/proxyFetch.js +6 -1
  34. package/dist/lib/types/providers.d.ts +37 -2
  35. package/dist/lib/types/providers.js +1 -1
  36. package/dist/lib/utils/modelChoices.js +68 -4
  37. package/dist/lib/utils/pricing.d.ts +5 -0
  38. package/dist/lib/utils/pricing.js +94 -3
  39. package/dist/lib/utils/providerConfig.d.ts +16 -0
  40. package/dist/lib/utils/providerConfig.js +82 -0
  41. package/dist/providers/deepseek.d.ts +29 -0
  42. package/dist/providers/deepseek.js +215 -0
  43. package/dist/providers/index.d.ts +4 -0
  44. package/dist/providers/index.js +4 -0
  45. package/dist/providers/llamaCpp.d.ts +34 -0
  46. package/dist/providers/llamaCpp.js +314 -0
  47. package/dist/providers/lmStudio.d.ts +34 -0
  48. package/dist/providers/lmStudio.js +305 -0
  49. package/dist/providers/nvidiaNim.d.ts +31 -0
  50. package/dist/providers/nvidiaNim.js +353 -0
  51. package/dist/proxy/proxyFetch.d.ts +9 -0
  52. package/dist/proxy/proxyFetch.js +6 -1
  53. package/dist/types/providers.d.ts +37 -2
  54. package/dist/utils/modelChoices.js +68 -4
  55. package/dist/utils/pricing.d.ts +5 -0
  56. package/dist/utils/pricing.js +94 -3
  57. package/dist/utils/providerConfig.d.ts +16 -0
  58. package/dist/utils/providerConfig.js +82 -0
  59. package/package.json +19 -12
@@ -224,6 +224,67 @@ const PRICING = {
224
224
  output: 0.15 / 1_000_000,
225
225
  },
226
226
  },
227
+ deepseek: {
228
+ "deepseek-chat": {
229
+ input: 0.27 / 1_000_000,
230
+ output: 1.1 / 1_000_000,
231
+ cacheRead: 0.07 / 1_000_000,
232
+ },
233
+ "deepseek-reasoner": {
234
+ input: 0.55 / 1_000_000,
235
+ output: 2.19 / 1_000_000,
236
+ cacheRead: 0.14 / 1_000_000,
237
+ },
238
+ },
239
+ "nvidia-nim": {
240
+ "meta/llama-3.3-70b-instruct": {
241
+ input: 0.4 / 1_000_000,
242
+ output: 0.4 / 1_000_000,
243
+ },
244
+ "meta/llama-3.1-405b-instruct": {
245
+ input: 1.79 / 1_000_000,
246
+ output: 1.79 / 1_000_000,
247
+ },
248
+ "meta/llama-3.1-70b-instruct": {
249
+ input: 0.4 / 1_000_000,
250
+ output: 0.4 / 1_000_000,
251
+ },
252
+ "meta/llama-3.2-90b-vision-instruct": {
253
+ input: 0.5 / 1_000_000,
254
+ output: 0.5 / 1_000_000,
255
+ },
256
+ "nvidia/llama-3.3-nemotron-super-49b-v1": {
257
+ input: 0.3 / 1_000_000,
258
+ output: 0.3 / 1_000_000,
259
+ },
260
+ "deepseek-ai/deepseek-r1": {
261
+ input: 0.55 / 1_000_000,
262
+ output: 2.19 / 1_000_000,
263
+ },
264
+ "mistralai/mixtral-8x22b-instruct-v0.1": {
265
+ input: 0.6 / 1_000_000,
266
+ output: 0.6 / 1_000_000,
267
+ },
268
+ "mistralai/mixtral-8x7b-instruct-v0.1": {
269
+ input: 0.24 / 1_000_000,
270
+ output: 0.24 / 1_000_000,
271
+ },
272
+ "microsoft/phi-4": { input: 0.07 / 1_000_000, output: 0.07 / 1_000_000 },
273
+ "google/gemma-3-27b-it": {
274
+ input: 0.07 / 1_000_000,
275
+ output: 0.07 / 1_000_000,
276
+ },
277
+ },
278
+ "lm-studio": {
279
+ // Local inference — there is no upstream USD price. Reporting a fabricated
280
+ // symbolic rate here misstated spend in analytics/spans, so the rate is
281
+ // explicitly zero. `calculateCost()` returns 0 for zero rates and the CLI
282
+ // / span renderers already treat 0 as "no billable cost" (no $ shown).
283
+ _default: { input: 0, output: 0 },
284
+ },
285
+ llamacpp: {
286
+ _default: { input: 0, output: 0 },
287
+ },
227
288
  };
228
289
  /**
229
290
  * Map of normalized provider aliases to canonical PRICING keys.
@@ -246,6 +307,12 @@ const PROVIDER_ALIASES = {
246
307
  litellm: "__cross_provider__",
247
308
  openrouter: "__cross_provider__",
248
309
  openaicompatible: "__cross_provider__",
310
+ deepseek: "deepseek",
311
+ nvidianim: "nvidia-nim",
312
+ nim: "nvidia-nim",
313
+ nvidia: "nvidia-nim",
314
+ lmstudio: "lm-studio",
315
+ llamacpp: "llamacpp",
249
316
  };
250
317
  /**
251
318
  * Look up per-token rates for a provider/model combination.
@@ -287,14 +354,19 @@ function findRates(provider, model) {
287
354
  if (providerPricing[model]) {
288
355
  return providerPricing[model];
289
356
  }
290
- // Longest-prefix match
291
- const sortedKeys = Object.keys(providerPricing).sort((a, b) => b.length - a.length);
357
+ // Longest-prefix match (skip the synthetic "_default" sentinel below)
358
+ const sortedKeys = Object.keys(providerPricing)
359
+ .filter((k) => k !== "_default")
360
+ .sort((a, b) => b.length - a.length);
292
361
  const key = sortedKeys.find((k) => model.startsWith(k));
293
362
  if (key) {
294
363
  return providerPricing[key];
295
364
  }
296
365
  // Fallback: Vertex hosts both Claude and Gemini models.
297
366
  // If no match found under "vertex", try "google" pricing for Gemini models.
367
+ // (Run BEFORE the provider-level _default fallback so that Vertex Gemini
368
+ // requests get the more specific Google rates rather than a generic Vertex
369
+ // _default if one is ever added.)
298
370
  if (normalizedProvider === "vertex" && model.startsWith("gemini")) {
299
371
  const googlePricing = PRICING["google"];
300
372
  if (googlePricing) {
@@ -308,6 +380,13 @@ function findRates(provider, model) {
308
380
  }
309
381
  }
310
382
  }
383
+ // Provider-level fallback: when a pricing table only has _default (or has
384
+ // no entry matching the specific model), use _default. This is mainly for
385
+ // local/symbolic providers (lm-studio, llamacpp) that don't enumerate per-
386
+ // model pricing.
387
+ if (providerPricing["_default"]) {
388
+ return providerPricing["_default"];
389
+ }
311
390
  return undefined;
312
391
  }
313
392
  /**
@@ -334,7 +413,19 @@ export function calculateCost(provider, model, usage) {
334
413
  * Check if pricing is available for a provider/model combination.
335
414
  * Checks the rate table directly instead of computing a cost,
336
415
  * so even very cheap models (e.g. gemini-1.5-flash) are detected correctly.
416
+ *
417
+ * Zero-rate entries (the local-provider `_default` for lm-studio / llamacpp)
418
+ * count as "no pricing" — those providers explicitly don't have an upstream
419
+ * USD price, and any caller gated by `hasPricing()` should treat them as
420
+ * non-billable rather than zero-cost-billable.
337
421
  */
338
422
  export function hasPricing(provider, model) {
339
- return findRates(provider, model) !== undefined;
423
+ const rates = findRates(provider, model);
424
+ if (!rates) {
425
+ return false;
426
+ }
427
+ return (rates.input > 0 ||
428
+ rates.output > 0 ||
429
+ (rates.cacheRead ?? 0) > 0 ||
430
+ (rates.cacheCreation ?? 0) > 0);
340
431
  }
@@ -107,6 +107,22 @@ export declare function createAzureEndpointConfig(): ProviderConfigOptions;
107
107
  * Creates OpenAI Compatible provider configuration
108
108
  */
109
109
  export declare function createOpenAICompatibleConfig(): ProviderConfigOptions;
110
+ /**
111
+ * Creates DeepSeek provider configuration
112
+ */
113
+ export declare function createDeepSeekConfig(): ProviderConfigOptions;
114
+ /**
115
+ * Creates NVIDIA NIM provider configuration
116
+ */
117
+ export declare function createNvidiaNimConfig(): ProviderConfigOptions;
118
+ /**
119
+ * Creates LM Studio provider configuration (local server)
120
+ */
121
+ export declare function createLmStudioConfig(): ProviderConfigOptions;
122
+ /**
123
+ * Creates llama.cpp provider configuration (local server)
124
+ */
125
+ export declare function createLlamaCppConfig(): ProviderConfigOptions;
110
126
  /**
111
127
  * Creates Google Vertex Project ID configuration
112
128
  */
@@ -85,6 +85,10 @@ export function validateApiKeyEnhanced(config, enableFormatValidation = false) {
85
85
  }
86
86
  }
87
87
  if (!apiKey) {
88
+ if (config.optional) {
89
+ // Local providers — base URL defaulted; treat as valid with empty value.
90
+ return { isValid: true, apiKey: "" };
91
+ }
88
92
  return {
89
93
  isValid: false,
90
94
  apiKey: "",
@@ -131,6 +135,12 @@ export function validateApiKey(config) {
131
135
  }
132
136
  }
133
137
  if (!apiKey) {
138
+ // Local providers (LM Studio, llama.cpp) treat envVarName as a base-URL
139
+ // override, not a credential. Returning "" lets callers fall back to the
140
+ // documented default URL without raising a configuration error.
141
+ if (config.optional) {
142
+ return "";
143
+ }
134
144
  throw new Error(createConfigErrorMessage(config));
135
145
  }
136
146
  return apiKey;
@@ -366,6 +376,78 @@ export function createOpenAICompatibleConfig() {
366
376
  ],
367
377
  };
368
378
  }
379
+ /**
380
+ * Creates DeepSeek provider configuration
381
+ */
382
+ export function createDeepSeekConfig() {
383
+ return {
384
+ providerName: "DeepSeek",
385
+ envVarName: "DEEPSEEK_API_KEY",
386
+ setupUrl: "https://platform.deepseek.com/api_keys",
387
+ description: "API key",
388
+ instructions: [
389
+ "1. Visit: https://platform.deepseek.com/api_keys",
390
+ "2. Create or sign in to your DeepSeek account",
391
+ "3. Generate a new API key",
392
+ "4. Set DEEPSEEK_API_KEY in your .env file",
393
+ ],
394
+ };
395
+ }
396
+ /**
397
+ * Creates NVIDIA NIM provider configuration
398
+ */
399
+ export function createNvidiaNimConfig() {
400
+ return {
401
+ providerName: "NVIDIA NIM",
402
+ envVarName: "NVIDIA_NIM_API_KEY",
403
+ setupUrl: "https://build.nvidia.com/settings/api-keys",
404
+ description: "API key",
405
+ instructions: [
406
+ "1. Visit: https://build.nvidia.com/",
407
+ "2. Sign in with your NVIDIA developer account",
408
+ "3. Open Settings → API Keys",
409
+ "4. Generate a new API key (Bearer token)",
410
+ "5. Set NVIDIA_NIM_API_KEY in your .env file",
411
+ ],
412
+ };
413
+ }
414
+ /**
415
+ * Creates LM Studio provider configuration (local server)
416
+ */
417
+ export function createLmStudioConfig() {
418
+ return {
419
+ providerName: "LM Studio",
420
+ envVarName: "LM_STUDIO_BASE_URL",
421
+ setupUrl: "https://lmstudio.ai/",
422
+ description: "LM Studio server URL",
423
+ instructions: [
424
+ "1. Install LM Studio: https://lmstudio.ai/",
425
+ "2. Open LM Studio and download a model (e.g. Llama 3.2 3B Instruct)",
426
+ '3. Click "Local Server" → Start Server',
427
+ "4. Default URL is http://localhost:1234/v1 (override via LM_STUDIO_BASE_URL)",
428
+ ],
429
+ // Base URL is optional — defaults to http://localhost:1234/v1 if unset.
430
+ optional: true,
431
+ };
432
+ }
433
+ /**
434
+ * Creates llama.cpp provider configuration (local server)
435
+ */
436
+ export function createLlamaCppConfig() {
437
+ return {
438
+ providerName: "llama.cpp",
439
+ envVarName: "LLAMACPP_BASE_URL",
440
+ setupUrl: "https://github.com/ggerganov/llama.cpp",
441
+ description: "llama.cpp server URL",
442
+ instructions: [
443
+ "1. Build llama.cpp: https://github.com/ggerganov/llama.cpp#build",
444
+ "2. Run: ./llama-server -m model.gguf --port 8080",
445
+ "3. Default URL is http://localhost:8080/v1 (override via LLAMACPP_BASE_URL)",
446
+ ],
447
+ // Base URL is optional — defaults to http://localhost:8080/v1 if unset.
448
+ optional: true,
449
+ };
450
+ }
369
451
  /**
370
452
  * Creates Google Vertex Project ID configuration
371
453
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "9.59.6",
3
+ "version": "9.60.0",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "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 13 providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
6
6
  "author": {
@@ -78,11 +78,16 @@
78
78
  "test:observability": "npx tsx test/continuous-test-suite-observability.ts",
79
79
  "test:ppt": "npx tsx test/continuous-test-suite-ppt.ts",
80
80
  "test:providers": "npx tsx test/continuous-test-suite-providers.ts",
81
+ "test:new-providers": "npx tsx test/continuous-test-suite-new-providers.ts",
81
82
  "test:rag": "npx tsx test/continuous-test-suite-rag.ts",
82
83
  "test:servers": "npx tsx test/continuous-test-suite-servers.ts",
84
+ "test:tool-reliability": "npx tsx test/continuous-test-suite-tool-reliability.ts",
83
85
  "test:tracing": "npx tsx test/continuous-test-suite-tracing.ts",
84
86
  "test:tts": "npx tsx test/continuous-test-suite-tts.ts",
85
87
  "test:credentials": "tsx test/continuous-test-suite-credentials.ts",
88
+ "test:dynamic": "npx tsx test/continuous-test-suite-dynamic.ts",
89
+ "test:proxy": "npx tsx test/continuous-test-suite-proxy.ts",
90
+ "test:bugfixes": "npx tsx test/continuous-test-suite-bugfixes.ts",
86
91
  "test:workflow": "npx tsx test/continuous-test-suite-workflow.ts",
87
92
  "test:ci": "pnpm run test && pnpm run test:client",
88
93
  "test:performance": "tsx tools/testing/performanceMonitor.ts",
@@ -265,29 +270,29 @@
265
270
  },
266
271
  "optionalDependencies": {
267
272
  "@aws-sdk/client-sagemaker": "^3.1000.0",
268
- "@langfuse/otel": "^5.0.1",
269
- "@picovoice/cobra-node": "^3.0.2",
270
- "bullmq": "^5.52.2",
271
- "exceljs": "^4.4.0",
272
- "fluent-ffmpeg": "^2.1.3",
273
- "mediabunny": "^1.40.1",
274
- "music-metadata": "^11.11.2",
275
- "mammoth": "^1.11.0",
276
- "pptxgenjs": "^4.0.1",
277
- "pdf-parse": "^2.4.5",
278
- "pdf-to-img": "^5.0.0",
279
273
  "@fastify/cors": "^11.2.0",
280
274
  "@fastify/rate-limit": "^10.3.0",
281
275
  "@hono/node-server": "^1.19.9",
282
276
  "@koa/cors": "^5.0.0",
283
277
  "@koa/router": "^15.3.1",
278
+ "@langfuse/otel": "^5.0.1",
279
+ "@picovoice/cobra-node": "^3.0.2",
280
+ "bullmq": "^5.52.2",
284
281
  "cors": "^2.8.5",
282
+ "exceljs": "^4.4.0",
285
283
  "express": "^5.1.0",
286
284
  "express-rate-limit": "^8.2.1",
287
285
  "fastify": "^5.7.2",
288
286
  "ffmpeg-static": "^5.3.0",
287
+ "fluent-ffmpeg": "^2.1.3",
289
288
  "koa": "^3.1.1",
290
289
  "koa-bodyparser": "^4.4.1",
290
+ "mammoth": "^1.11.0",
291
+ "mediabunny": "^1.40.1",
292
+ "music-metadata": "^11.11.2",
293
+ "pdf-parse": "^2.4.5",
294
+ "pdf-to-img": "^5.0.0",
295
+ "pptxgenjs": "^4.0.1",
291
296
  "sharp": "^0.34.5"
292
297
  },
293
298
  "devDependencies": {
@@ -317,6 +322,7 @@
317
322
  "@types/express": "^5.0.6",
318
323
  "@types/fluent-ffmpeg": "^2.1.28",
319
324
  "@types/inquirer": "^9.0.9",
325
+ "@types/js-yaml": "^4.0.9",
320
326
  "@types/koa": "^3.0.1",
321
327
  "@types/koa-bodyparser": "^4.3.13",
322
328
  "@types/koa__cors": "^5.0.1",
@@ -334,6 +340,7 @@
334
340
  "esbuild": "^0.27.4",
335
341
  "eslint": "^10.0.2",
336
342
  "husky": "^9.1.7",
343
+ "js-yaml": "^4.1.1",
337
344
  "lint-staged": "^16.3.0",
338
345
  "playwright": "^1.58.2",
339
346
  "prettier": "^3.8.1",