@juspay/neurolink 12.4.4 → 12.5.1

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 (51) hide show
  1. package/CHANGELOG.md +1 -5
  2. package/dist/adapters/providerImageAdapter.js +43 -19
  3. package/dist/browser/neurolink.min.js +414 -414
  4. package/dist/cli/commands/setup.d.ts +12 -7
  5. package/dist/cli/commands/setup.js +17 -16
  6. package/dist/constants/contextWindows.js +23 -95
  7. package/dist/constants/enums.d.ts +111 -216
  8. package/dist/constants/enums.js +124 -240
  9. package/dist/factories/providerDescriptors.d.ts +2 -4
  10. package/dist/factories/providerDescriptors.js +83 -127
  11. package/dist/hitl/hitlManager.d.ts +14 -0
  12. package/dist/hitl/hitlManager.js +16 -0
  13. package/dist/models/manifestRegistry.js +53 -4
  14. package/dist/neurolink.d.ts +37 -0
  15. package/dist/neurolink.js +39 -0
  16. package/dist/providers/catalog/cerebras.json +75 -0
  17. package/dist/providers/catalog/cloudflare.json +121 -0
  18. package/dist/providers/catalog/fireworks.json +124 -0
  19. package/dist/providers/catalog/groq.json +127 -0
  20. package/dist/providers/catalog/index.generated.d.ts +3 -0
  21. package/dist/providers/catalog/index.generated.js +33 -0
  22. package/dist/providers/catalog/loader.d.ts +6 -0
  23. package/dist/providers/catalog/loader.js +115 -0
  24. package/dist/providers/catalog/mistral.json +244 -0
  25. package/dist/providers/catalog/perplexity.json +103 -0
  26. package/dist/providers/catalog/provider-catalog.schema.json +351 -0
  27. package/dist/providers/catalog/sambanova.json +129 -0
  28. package/dist/providers/catalog/schema.d.ts +123 -0
  29. package/dist/providers/catalog/schema.js +310 -0
  30. package/dist/providers/catalog/together-ai.json +172 -0
  31. package/dist/providers/catalog/xai.json +108 -0
  32. package/dist/providers/openaiCompatCatalog.d.ts +13 -13
  33. package/dist/providers/openaiCompatCatalog.js +15 -326
  34. package/dist/types/hitl.d.ts +2 -0
  35. package/dist/types/index.d.ts +2 -0
  36. package/dist/types/index.js +2 -0
  37. package/dist/types/providerCatalog.d.ts +149 -0
  38. package/dist/types/providerCatalog.generated.d.ts +2 -0
  39. package/dist/types/providerCatalog.generated.js +1 -0
  40. package/dist/types/providerCatalog.js +7 -0
  41. package/dist/types/providers.d.ts +14 -14
  42. package/dist/utils/modelChoices.d.ts +11 -3
  43. package/dist/utils/modelChoices.js +84 -190
  44. package/dist/utils/pricing.js +92 -127
  45. package/dist/utils/providerConfig.d.ts +1 -1
  46. package/dist/utils/providerConfig.js +24 -108
  47. package/package.json +2 -1
  48. package/dist/models/manifests/cerebras.d.ts +0 -9
  49. package/dist/models/manifests/cerebras.js +0 -19
  50. package/dist/models/manifests/sambanova.d.ts +0 -11
  51. package/dist/models/manifests/sambanova.js +0 -42
@@ -6,7 +6,21 @@
6
6
  * Extended with Claude subscription OAuth support
7
7
  */
8
8
  import { logger } from "./logger.js";
9
+ import { getCatalogJsonEntries, buildCatalogConfigOptions, } from "../providers/catalog/loader.js";
9
10
  // Re-export subscription types for convenience
11
+ /**
12
+ * Looks up a JSON catalog entry by id and derives its ProviderConfigOptions.
13
+ * Backs the 9 catalog providers' create<Name>Config() delegations below —
14
+ * the JSON catalog (src/lib/providers/catalog/<id>.json) is their single
15
+ * source of truth.
16
+ */
17
+ function catalogConfigOptions(id) {
18
+ const entry = getCatalogJsonEntries().find((e) => e.id === id);
19
+ if (!entry) {
20
+ throw new Error(`Unknown catalog provider id: ${id}`);
21
+ }
22
+ return buildCatalogConfigOptions(entry);
23
+ }
10
24
  /**
11
25
  * API key format validation patterns (extracted from advanced validation system)
12
26
  * Exported for use across the codebase to replace scattered regex patterns
@@ -303,17 +317,7 @@ export function createHuggingFaceConfig() {
303
317
  * Creates Mistral provider configuration
304
318
  */
305
319
  export function createMistralConfig() {
306
- return {
307
- providerName: "Mistral",
308
- envVarName: "MISTRAL_API_KEY",
309
- setupUrl: "https://console.mistral.ai/",
310
- description: "API key",
311
- instructions: [
312
- "1. Visit: https://console.mistral.ai/",
313
- "2. Create or sign in to your account",
314
- "3. Generate a new API key",
315
- ],
316
- };
320
+ return catalogConfigOptions("mistral");
317
321
  }
318
322
  /**
319
323
  * Creates AWS Access Key configuration for Bedrock
@@ -438,66 +442,22 @@ export function createNvidiaNimConfig() {
438
442
  * Creates xAI Grok provider configuration.
439
443
  */
440
444
  export function createXaiConfig() {
441
- return {
442
- providerName: "xAI",
443
- envVarName: "XAI_API_KEY",
444
- setupUrl: "https://console.x.ai/",
445
- description: "API key",
446
- instructions: [
447
- "1. Visit: https://console.x.ai/",
448
- "2. Sign in with your xAI account",
449
- "3. Create an API key",
450
- "4. Set XAI_API_KEY in your .env file",
451
- ],
452
- };
445
+ return catalogConfigOptions("xai");
453
446
  }
454
447
  /**
455
- * Creates Cerebras provider configuration.
448
+ * Creates SambaNova provider configuration.
456
449
  */
457
450
  export function createSambanovaConfig() {
458
- return {
459
- providerName: "SambaNova",
460
- envVarName: "SAMBANOVA_API_KEY",
461
- setupUrl: "https://cloud.sambanova.ai/apis",
462
- description: "API key",
463
- instructions: [
464
- "1. Visit: https://cloud.sambanova.ai (Google/Microsoft OAuth works)",
465
- "2. Complete the profile step; note new accounts have NO free allowance — a payment method and purchased credits are required before calls succeed",
466
- "3. Create an API key under API Keys",
467
- "4. Set SAMBANOVA_API_KEY in your .env file",
468
- ],
469
- };
451
+ return catalogConfigOptions("sambanova");
470
452
  }
471
453
  export function createCerebrasConfig() {
472
- return {
473
- providerName: "Cerebras",
474
- envVarName: "CEREBRAS_API_KEY",
475
- setupUrl: "https://cloud.cerebras.ai",
476
- description: "API key",
477
- instructions: [
478
- "1. Visit: https://cloud.cerebras.ai",
479
- "2. Sign in or create a free Cerebras account",
480
- "3. Create an API key under API Keys",
481
- "4. Set CEREBRAS_API_KEY in your .env file",
482
- ],
483
- };
454
+ return catalogConfigOptions("cerebras");
484
455
  }
485
456
  /**
486
457
  * Creates Groq provider configuration.
487
458
  */
488
459
  export function createGroqConfig() {
489
- return {
490
- providerName: "Groq",
491
- envVarName: "GROQ_API_KEY",
492
- setupUrl: "https://console.groq.com/keys",
493
- description: "API key",
494
- instructions: [
495
- "1. Visit: https://console.groq.com/keys",
496
- "2. Sign in to your Groq account",
497
- "3. Create a new API key",
498
- "4. Set GROQ_API_KEY in your .env file",
499
- ],
500
- };
460
+ return catalogConfigOptions("groq");
501
461
  }
502
462
  /**
503
463
  * Creates Cohere provider configuration.
@@ -537,52 +497,19 @@ export function createReplicateConfig() {
537
497
  * Creates Together AI provider configuration.
538
498
  */
539
499
  export function createTogetherAIConfig() {
540
- return {
541
- providerName: "Together AI",
542
- envVarName: "TOGETHER_API_KEY",
543
- setupUrl: "https://api.together.xyz/settings/api-keys",
544
- description: "API key",
545
- instructions: [
546
- "1. Visit: https://api.together.xyz/settings/api-keys",
547
- "2. Sign in to your Together AI account",
548
- "3. Create a new API key",
549
- "4. Set TOGETHER_API_KEY in your .env file",
550
- ],
551
- };
500
+ return catalogConfigOptions("together-ai");
552
501
  }
553
502
  /**
554
503
  * Creates Fireworks AI provider configuration.
555
504
  */
556
505
  export function createFireworksConfig() {
557
- return {
558
- providerName: "Fireworks AI",
559
- envVarName: "FIREWORKS_API_KEY",
560
- setupUrl: "https://fireworks.ai/account/api-keys",
561
- description: "API key",
562
- instructions: [
563
- "1. Visit: https://fireworks.ai/account/api-keys",
564
- "2. Sign in to your Fireworks AI account",
565
- "3. Create a new API key",
566
- "4. Set FIREWORKS_API_KEY in your .env file",
567
- ],
568
- };
506
+ return catalogConfigOptions("fireworks");
569
507
  }
570
508
  /**
571
509
  * Creates Perplexity provider configuration.
572
510
  */
573
511
  export function createPerplexityConfig() {
574
- return {
575
- providerName: "Perplexity",
576
- envVarName: "PERPLEXITY_API_KEY",
577
- setupUrl: "https://www.perplexity.ai/settings/api",
578
- description: "API key",
579
- instructions: [
580
- "1. Visit: https://www.perplexity.ai/settings/api",
581
- "2. Sign in to your Perplexity account",
582
- "3. Create a new API key (Sonar tier)",
583
- "4. Set PERPLEXITY_API_KEY in your .env file",
584
- ],
585
- };
512
+ return catalogConfigOptions("perplexity");
586
513
  }
587
514
  /**
588
515
  * Creates Voyage AI provider configuration (embedding-only).
@@ -676,18 +603,7 @@ export function createRecraftConfig() {
676
603
  * AND `CLOUDFLARE_ACCOUNT_ID` since the endpoint is per-account.
677
604
  */
678
605
  export function createCloudflareConfig() {
679
- return {
680
- providerName: "Cloudflare Workers AI",
681
- envVarName: "CLOUDFLARE_API_KEY",
682
- setupUrl: "https://dash.cloudflare.com/profile/api-tokens",
683
- description: "API token (Workers AI Read+Write scope)",
684
- instructions: [
685
- "1. Visit: https://dash.cloudflare.com/profile/api-tokens",
686
- "2. Create a token with 'Workers AI: Read + Write' scope",
687
- "3. Set CLOUDFLARE_API_KEY in your .env file",
688
- "4. Also set CLOUDFLARE_ACCOUNT_ID (find it in the dashboard URL or under 'Account ID')",
689
- ],
690
- };
606
+ return catalogConfigOptions("cloudflare");
691
607
  }
692
608
  /**
693
609
  * Creates Google Vertex Project ID configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "12.4.4",
3
+ "version": "12.5.1",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (connect any MCP server), voice TTS/STT/realtime, RAG, agents, memory, context compaction. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · DeepSeek · NVIDIA NIM and more.",
6
6
  "author": {
@@ -34,6 +34,7 @@
34
34
  "build:action": "ncc build src/action/index.ts -o action-dist --source-map",
35
35
  "build:cli:link": "pnpm run build:cli && pnpm link --global",
36
36
  "check:deps": "tsx scripts/check-banned-deps.ts",
37
+ "codegen:catalog": "tsx tools/codegen-catalog.ts",
37
38
  "cli": "node dist/cli/index.js",
38
39
  "preview": "vite preview",
39
40
  "prepare": "git rev-parse --git-dir > /dev/null 2>&1 && husky install || echo 'Skipping husky in non-git environment'",
@@ -1,9 +0,0 @@
1
- import type { ProviderModelManifest } from "../../types/index.js";
2
- /**
3
- * Minimal manifest: conservative floor values pending live verification —
4
- * Cerebras serves large-context models, but the free tier caps effective
5
- * context/output well below the architectural maximums, so these defaults
6
- * stay deliberately modest. Named models can be added incrementally
7
- * without touching any consumer — same pattern as groq.ts.
8
- */
9
- export declare const cerebrasManifest: ProviderModelManifest;
@@ -1,19 +0,0 @@
1
- /**
2
- * Minimal manifest: conservative floor values pending live verification —
3
- * Cerebras serves large-context models, but the free tier caps effective
4
- * context/output well below the architectural maximums, so these defaults
5
- * stay deliberately modest. Named models can be added incrementally
6
- * without touching any consumer — same pattern as groq.ts.
7
- */
8
- export const cerebrasManifest = {
9
- defaultContextWindow: 65536,
10
- models: {
11
- _default: {
12
- aliases: [],
13
- contextWindow: 65536,
14
- maxOutputTokens: 8192,
15
- vision: false,
16
- functionCalling: true,
17
- },
18
- },
19
- };
@@ -1,11 +0,0 @@
1
- import type { ProviderModelManifest } from "../../types/index.js";
2
- /**
3
- * Context windows from the vendor's SambaCloud model specifications page
4
- * (docs.sambanova.ai, checked 2026-08-27): 128K on the production mainline
5
- * (Meta-Llama-3.3-70B-Instruct, gpt-oss-120b, DeepSeek-V3.1), 192K on
6
- * MiniMax-M2.7, 32K on the DeepSeek-V3.2 preview. Max output is not
7
- * published — the 8192 floor stays deliberately conservative, same
8
- * pattern as groq.ts/cerebras.ts. gemma-4-31B-it is the one vision model
9
- * (text+image+video per the vendor page).
10
- */
11
- export declare const sambanovaManifest: ProviderModelManifest;
@@ -1,42 +0,0 @@
1
- /**
2
- * Context windows from the vendor's SambaCloud model specifications page
3
- * (docs.sambanova.ai, checked 2026-08-27): 128K on the production mainline
4
- * (Meta-Llama-3.3-70B-Instruct, gpt-oss-120b, DeepSeek-V3.1), 192K on
5
- * MiniMax-M2.7, 32K on the DeepSeek-V3.2 preview. Max output is not
6
- * published — the 8192 floor stays deliberately conservative, same
7
- * pattern as groq.ts/cerebras.ts. gemma-4-31B-it is the one vision model
8
- * (text+image+video per the vendor page).
9
- */
10
- export const sambanovaManifest = {
11
- defaultContextWindow: 131072,
12
- models: {
13
- _default: {
14
- aliases: [],
15
- contextWindow: 131072,
16
- maxOutputTokens: 8192,
17
- vision: false,
18
- functionCalling: true,
19
- },
20
- "MiniMax-M2.7": {
21
- aliases: [],
22
- contextWindow: 196608,
23
- maxOutputTokens: 8192,
24
- vision: false,
25
- functionCalling: true,
26
- },
27
- "DeepSeek-V3.2": {
28
- aliases: [],
29
- contextWindow: 32768,
30
- maxOutputTokens: 8192,
31
- vision: false,
32
- functionCalling: true,
33
- },
34
- "gemma-4-31B-it": {
35
- aliases: [],
36
- contextWindow: 131072,
37
- maxOutputTokens: 8192,
38
- vision: true,
39
- functionCalling: true,
40
- },
41
- },
42
- };