@juspay/neurolink 11.3.1 → 11.4.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 (132) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/dist/constants/enums.d.ts +1 -0
  3. package/dist/constants/enums.js +5 -1
  4. package/dist/lib/constants/enums.d.ts +1 -0
  5. package/dist/lib/constants/enums.js +5 -1
  6. package/dist/lib/models/manifestRegistry.d.ts +33 -0
  7. package/dist/lib/models/manifestRegistry.js +174 -0
  8. package/dist/lib/models/manifests/anthropic.d.ts +9 -0
  9. package/dist/lib/models/manifests/anthropic.js +346 -0
  10. package/dist/lib/models/manifests/azure.d.ts +2 -0
  11. package/dist/lib/models/manifests/azure.js +87 -0
  12. package/dist/lib/models/manifests/bedrock.d.ts +2 -0
  13. package/dist/lib/models/manifests/bedrock.js +75 -0
  14. package/dist/lib/models/manifests/cloudflare.d.ts +8 -0
  15. package/dist/lib/models/manifests/cloudflare.js +19 -0
  16. package/dist/lib/models/manifests/cohere.d.ts +8 -0
  17. package/dist/lib/models/manifests/cohere.js +19 -0
  18. package/dist/lib/models/manifests/deepseek.d.ts +8 -0
  19. package/dist/lib/models/manifests/deepseek.js +19 -0
  20. package/dist/lib/models/manifests/fireworks.d.ts +8 -0
  21. package/dist/lib/models/manifests/fireworks.js +19 -0
  22. package/dist/lib/models/manifests/google-ai.d.ts +2 -0
  23. package/dist/lib/models/manifests/google-ai.js +28 -0
  24. package/dist/lib/models/manifests/groq.d.ts +8 -0
  25. package/dist/lib/models/manifests/groq.js +19 -0
  26. package/dist/lib/models/manifests/huggingface.d.ts +8 -0
  27. package/dist/lib/models/manifests/huggingface.js +19 -0
  28. package/dist/lib/models/manifests/ideogram.d.ts +8 -0
  29. package/dist/lib/models/manifests/ideogram.js +19 -0
  30. package/dist/lib/models/manifests/jina.d.ts +8 -0
  31. package/dist/lib/models/manifests/jina.js +19 -0
  32. package/dist/lib/models/manifests/litellm.d.ts +8 -0
  33. package/dist/lib/models/manifests/litellm.js +19 -0
  34. package/dist/lib/models/manifests/llamacpp.d.ts +8 -0
  35. package/dist/lib/models/manifests/llamacpp.js +19 -0
  36. package/dist/lib/models/manifests/lm-studio.d.ts +8 -0
  37. package/dist/lib/models/manifests/lm-studio.js +19 -0
  38. package/dist/lib/models/manifests/mistral.d.ts +2 -0
  39. package/dist/lib/models/manifests/mistral.js +50 -0
  40. package/dist/lib/models/manifests/nvidia-nim.d.ts +8 -0
  41. package/dist/lib/models/manifests/nvidia-nim.js +19 -0
  42. package/dist/lib/models/manifests/ollama.d.ts +2 -0
  43. package/dist/lib/models/manifests/ollama.js +72 -0
  44. package/dist/lib/models/manifests/openai-compatible.d.ts +8 -0
  45. package/dist/lib/models/manifests/openai-compatible.js +19 -0
  46. package/dist/lib/models/manifests/openai.d.ts +11 -0
  47. package/dist/lib/models/manifests/openai.js +560 -0
  48. package/dist/lib/models/manifests/openrouter.d.ts +8 -0
  49. package/dist/lib/models/manifests/openrouter.js +19 -0
  50. package/dist/lib/models/manifests/perplexity.d.ts +8 -0
  51. package/dist/lib/models/manifests/perplexity.js +19 -0
  52. package/dist/lib/models/manifests/recraft.d.ts +8 -0
  53. package/dist/lib/models/manifests/recraft.js +19 -0
  54. package/dist/lib/models/manifests/replicate.d.ts +8 -0
  55. package/dist/lib/models/manifests/replicate.js +19 -0
  56. package/dist/lib/models/manifests/sagemaker.d.ts +8 -0
  57. package/dist/lib/models/manifests/sagemaker.js +19 -0
  58. package/dist/lib/models/manifests/stability.d.ts +8 -0
  59. package/dist/lib/models/manifests/stability.js +19 -0
  60. package/dist/lib/models/manifests/together-ai.d.ts +8 -0
  61. package/dist/lib/models/manifests/together-ai.js +19 -0
  62. package/dist/lib/models/manifests/vertex.d.ts +8 -0
  63. package/dist/lib/models/manifests/vertex.js +19 -0
  64. package/dist/lib/models/manifests/voyage.d.ts +8 -0
  65. package/dist/lib/models/manifests/voyage.js +19 -0
  66. package/dist/lib/models/manifests/xai.d.ts +8 -0
  67. package/dist/lib/models/manifests/xai.js +19 -0
  68. package/dist/lib/types/model.d.ts +77 -0
  69. package/dist/models/manifestRegistry.d.ts +33 -0
  70. package/dist/models/manifestRegistry.js +173 -0
  71. package/dist/models/manifests/anthropic.d.ts +9 -0
  72. package/dist/models/manifests/anthropic.js +345 -0
  73. package/dist/models/manifests/azure.d.ts +2 -0
  74. package/dist/models/manifests/azure.js +86 -0
  75. package/dist/models/manifests/bedrock.d.ts +2 -0
  76. package/dist/models/manifests/bedrock.js +74 -0
  77. package/dist/models/manifests/cloudflare.d.ts +8 -0
  78. package/dist/models/manifests/cloudflare.js +18 -0
  79. package/dist/models/manifests/cohere.d.ts +8 -0
  80. package/dist/models/manifests/cohere.js +18 -0
  81. package/dist/models/manifests/deepseek.d.ts +8 -0
  82. package/dist/models/manifests/deepseek.js +18 -0
  83. package/dist/models/manifests/fireworks.d.ts +8 -0
  84. package/dist/models/manifests/fireworks.js +18 -0
  85. package/dist/models/manifests/google-ai.d.ts +2 -0
  86. package/dist/models/manifests/google-ai.js +27 -0
  87. package/dist/models/manifests/groq.d.ts +8 -0
  88. package/dist/models/manifests/groq.js +18 -0
  89. package/dist/models/manifests/huggingface.d.ts +8 -0
  90. package/dist/models/manifests/huggingface.js +18 -0
  91. package/dist/models/manifests/ideogram.d.ts +8 -0
  92. package/dist/models/manifests/ideogram.js +18 -0
  93. package/dist/models/manifests/jina.d.ts +8 -0
  94. package/dist/models/manifests/jina.js +18 -0
  95. package/dist/models/manifests/litellm.d.ts +8 -0
  96. package/dist/models/manifests/litellm.js +18 -0
  97. package/dist/models/manifests/llamacpp.d.ts +8 -0
  98. package/dist/models/manifests/llamacpp.js +18 -0
  99. package/dist/models/manifests/lm-studio.d.ts +8 -0
  100. package/dist/models/manifests/lm-studio.js +18 -0
  101. package/dist/models/manifests/mistral.d.ts +2 -0
  102. package/dist/models/manifests/mistral.js +49 -0
  103. package/dist/models/manifests/nvidia-nim.d.ts +8 -0
  104. package/dist/models/manifests/nvidia-nim.js +18 -0
  105. package/dist/models/manifests/ollama.d.ts +2 -0
  106. package/dist/models/manifests/ollama.js +71 -0
  107. package/dist/models/manifests/openai-compatible.d.ts +8 -0
  108. package/dist/models/manifests/openai-compatible.js +18 -0
  109. package/dist/models/manifests/openai.d.ts +11 -0
  110. package/dist/models/manifests/openai.js +559 -0
  111. package/dist/models/manifests/openrouter.d.ts +8 -0
  112. package/dist/models/manifests/openrouter.js +18 -0
  113. package/dist/models/manifests/perplexity.d.ts +8 -0
  114. package/dist/models/manifests/perplexity.js +18 -0
  115. package/dist/models/manifests/recraft.d.ts +8 -0
  116. package/dist/models/manifests/recraft.js +18 -0
  117. package/dist/models/manifests/replicate.d.ts +8 -0
  118. package/dist/models/manifests/replicate.js +18 -0
  119. package/dist/models/manifests/sagemaker.d.ts +8 -0
  120. package/dist/models/manifests/sagemaker.js +18 -0
  121. package/dist/models/manifests/stability.d.ts +8 -0
  122. package/dist/models/manifests/stability.js +18 -0
  123. package/dist/models/manifests/together-ai.d.ts +8 -0
  124. package/dist/models/manifests/together-ai.js +18 -0
  125. package/dist/models/manifests/vertex.d.ts +8 -0
  126. package/dist/models/manifests/vertex.js +18 -0
  127. package/dist/models/manifests/voyage.d.ts +8 -0
  128. package/dist/models/manifests/voyage.js +18 -0
  129. package/dist/models/manifests/xai.d.ts +8 -0
  130. package/dist/models/manifests/xai.js +18 -0
  131. package/dist/types/model.d.ts +77 -0
  132. package/package.json +3 -2
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Minimal manifest: sagemaker has no MODEL_REGISTRY entries today, so
3
+ * only the provider-wide fallback is known. Named models can be added here
4
+ * incrementally without touching any consumer — see Task 5 of the model
5
+ * metadata consolidation plan.
6
+ */
7
+ export const sagemakerManifest = {
8
+ defaultContextWindow: 128000,
9
+ models: {
10
+ _default: {
11
+ aliases: [],
12
+ contextWindow: 128000,
13
+ maxOutputTokens: 64000,
14
+ vision: false,
15
+ functionCalling: false,
16
+ },
17
+ },
18
+ };
@@ -0,0 +1,8 @@
1
+ import type { ProviderModelManifest } from "../../types/index.js";
2
+ /**
3
+ * Minimal manifest: stability has no MODEL_REGISTRY entries today, so
4
+ * only the provider-wide fallback is known. Named models can be added here
5
+ * incrementally without touching any consumer — see Task 5 of the model
6
+ * metadata consolidation plan.
7
+ */
8
+ export declare const stabilityManifest: ProviderModelManifest;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Minimal manifest: stability has no MODEL_REGISTRY entries today, so
3
+ * only the provider-wide fallback is known. Named models can be added here
4
+ * incrementally without touching any consumer — see Task 5 of the model
5
+ * metadata consolidation plan.
6
+ */
7
+ export const stabilityManifest = {
8
+ defaultContextWindow: 2000,
9
+ models: {
10
+ _default: {
11
+ aliases: [],
12
+ contextWindow: 2000,
13
+ maxOutputTokens: 2000,
14
+ vision: false,
15
+ functionCalling: false,
16
+ },
17
+ },
18
+ };
@@ -0,0 +1,8 @@
1
+ import type { ProviderModelManifest } from "../../types/index.js";
2
+ /**
3
+ * Minimal manifest: together-ai has no MODEL_REGISTRY entries today, so
4
+ * only the provider-wide fallback is known. Named models can be added here
5
+ * incrementally without touching any consumer — see Task 5 of the model
6
+ * metadata consolidation plan.
7
+ */
8
+ export declare const togetherAiManifest: ProviderModelManifest;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Minimal manifest: together-ai has no MODEL_REGISTRY entries today, so
3
+ * only the provider-wide fallback is known. Named models can be added here
4
+ * incrementally without touching any consumer — see Task 5 of the model
5
+ * metadata consolidation plan.
6
+ */
7
+ export const togetherAiManifest = {
8
+ defaultContextWindow: 128000,
9
+ models: {
10
+ _default: {
11
+ aliases: [],
12
+ contextWindow: 128000,
13
+ maxOutputTokens: 64000,
14
+ vision: false,
15
+ functionCalling: false,
16
+ },
17
+ },
18
+ };
@@ -0,0 +1,8 @@
1
+ import type { ProviderModelManifest } from "../../types/index.js";
2
+ /**
3
+ * Minimal manifest: vertex has no MODEL_REGISTRY entries today, so
4
+ * only the provider-wide fallback is known. Named models can be added here
5
+ * incrementally without touching any consumer — see Task 5 of the model
6
+ * metadata consolidation plan.
7
+ */
8
+ export declare const vertexManifest: ProviderModelManifest;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Minimal manifest: vertex has no MODEL_REGISTRY entries today, so
3
+ * only the provider-wide fallback is known. Named models can be added here
4
+ * incrementally without touching any consumer — see Task 5 of the model
5
+ * metadata consolidation plan.
6
+ */
7
+ export const vertexManifest = {
8
+ defaultContextWindow: 1048576,
9
+ models: {
10
+ _default: {
11
+ aliases: [],
12
+ contextWindow: 1048576,
13
+ maxOutputTokens: 64000,
14
+ vision: false,
15
+ functionCalling: false,
16
+ },
17
+ },
18
+ };
@@ -0,0 +1,8 @@
1
+ import type { ProviderModelManifest } from "../../types/index.js";
2
+ /**
3
+ * Minimal manifest: voyage has no MODEL_REGISTRY entries today, so
4
+ * only the provider-wide fallback is known. Named models can be added here
5
+ * incrementally without touching any consumer — see Task 5 of the model
6
+ * metadata consolidation plan.
7
+ */
8
+ export declare const voyageManifest: ProviderModelManifest;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Minimal manifest: voyage has no MODEL_REGISTRY entries today, so
3
+ * only the provider-wide fallback is known. Named models can be added here
4
+ * incrementally without touching any consumer — see Task 5 of the model
5
+ * metadata consolidation plan.
6
+ */
7
+ export const voyageManifest = {
8
+ defaultContextWindow: 32000,
9
+ models: {
10
+ _default: {
11
+ aliases: [],
12
+ contextWindow: 32000,
13
+ maxOutputTokens: 32000,
14
+ vision: false,
15
+ functionCalling: false,
16
+ },
17
+ },
18
+ };
@@ -0,0 +1,8 @@
1
+ import type { ProviderModelManifest } from "../../types/index.js";
2
+ /**
3
+ * Minimal manifest: xai has no MODEL_REGISTRY entries today, so
4
+ * only the provider-wide fallback is known. Named models can be added here
5
+ * incrementally without touching any consumer — see Task 5 of the model
6
+ * metadata consolidation plan.
7
+ */
8
+ export declare const xaiManifest: ProviderModelManifest;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Minimal manifest: xai has no MODEL_REGISTRY entries today, so
3
+ * only the provider-wide fallback is known. Named models can be added here
4
+ * incrementally without touching any consumer — see Task 5 of the model
5
+ * metadata consolidation plan.
6
+ */
7
+ export const xaiManifest = {
8
+ defaultContextWindow: 131072,
9
+ models: {
10
+ _default: {
11
+ aliases: [],
12
+ contextWindow: 131072,
13
+ maxOutputTokens: 64000,
14
+ vision: false,
15
+ functionCalling: false,
16
+ },
17
+ },
18
+ };
@@ -263,3 +263,80 @@ export type ModelRoutingOptions = {
263
263
  /** Fallback strategy if primary choice fails */
264
264
  fallbackStrategy?: "fast" | "reasoning" | "auto";
265
265
  };
266
+ /**
267
+ * A single model's metadata inside a provider's manifest. This is the one
268
+ * canonical shape every model-metadata consumer (context windows, pricing,
269
+ * MODEL_REGISTRY, vision capability, output-token ceilings) is intended to
270
+ * migrate onto — this PR is purely additive and does not yet move any
271
+ * consumer over.
272
+ *
273
+ * `pricingPerMTok` is optional by design: a model with no verified price
274
+ * (e.g. a just-announced model pricing.ts hasn't priced yet) must not report
275
+ * a fabricated rate. Absence here means "unknown", not "free" — callers that
276
+ * need to distinguish "free" from "unknown" already have `hasPricing()`
277
+ * (src/lib/utils/pricing.ts) for that.
278
+ */
279
+ export type ProviderModelManifestEntry = {
280
+ /** Alternate identifiers that resolve to this canonical model id. */
281
+ aliases: string[];
282
+ /** Human-readable name. Falls back to a mechanical id-derived name when absent. */
283
+ displayName?: string;
284
+ contextWindow: number;
285
+ maxOutputTokens: number;
286
+ pricingPerMTok?: {
287
+ input: number;
288
+ output: number;
289
+ cacheRead?: number;
290
+ cacheWrite?: number;
291
+ };
292
+ vision: boolean;
293
+ nativeAudio?: boolean;
294
+ functionCalling: boolean;
295
+ reasoning?: boolean;
296
+ jsonMode?: boolean;
297
+ /**
298
+ * Whether the model accepts classic sampling parameters (temperature/topP).
299
+ * Mirrors ModelCapabilities.samplingParams (src/lib/types/model.ts:131) —
300
+ * unset means supported.
301
+ */
302
+ samplingParams?: boolean;
303
+ /**
304
+ * Hand-tuned ModelInfo.performance/useCases/category values, carried
305
+ * forward verbatim for the ids that already had a MODEL_REGISTRY entry
306
+ * before this migration. Absent for every id that never had one — those
307
+ * get performance/useCases/category derived mechanically instead (see
308
+ * Task 9's buildModelRegistryFromManifests). Never populate this for a
309
+ * genuinely new model: mechanical derivation is the correct default, and
310
+ * a fabricated "curated" value would be worse than an honestly-derived one.
311
+ */
312
+ curated?: {
313
+ performance?: ModelPerformance;
314
+ useCases?: UseCaseSuitability;
315
+ category?: ModelInfo["category"];
316
+ };
317
+ };
318
+ /**
319
+ * A regex-driven patch applied to an unlisted, gateway-shaped model id that
320
+ * matches `pattern` (e.g. "vertex_ai/claude-sonnet-5@20260203"). Generalizes
321
+ * the pattern VISION_FAMILY_RULES (src/lib/adapters/providerImageAdapter.ts)
322
+ * and SAMPLING_PARAM_REJECTING_FAMILIES (src/lib/models/modelRegistry.ts)
323
+ * already use independently, keyed per-provider instead of globally.
324
+ */
325
+ export type ManifestFamilyRule = {
326
+ pattern: RegExp;
327
+ patch: Partial<ProviderModelManifestEntry>;
328
+ };
329
+ /**
330
+ * One provider's complete model manifest: every model NeuroLink knows about
331
+ * for that provider, plus the provider-wide fallback used when a caller
332
+ * passes a model id the manifest has never seen (a symbolic/local provider
333
+ * model, or a brand-new release the manifest hasn't been updated for yet).
334
+ */
335
+ export type ProviderModelManifest = {
336
+ /** Used for `_default`-key lookups and providers with no named-model list. */
337
+ defaultContextWindow: number;
338
+ /** Applied, in order, to the resolved entry (see manifestRegistry.ts). */
339
+ familyRules?: ManifestFamilyRule[];
340
+ /** Keyed by canonical model id (the same id `ModelInfo.id` / AIProvider calls use). */
341
+ models: Record<string, ProviderModelManifestEntry>;
342
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "11.3.1",
3
+ "version": "11.4.0",
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": {
@@ -100,6 +100,7 @@
100
100
  "test:openai-compat-catalog": "npx tsx test/continuous-test-suite-openai-compat-catalog.ts",
101
101
  "test:provider-descriptors": "npx tsx test/continuous-test-suite-provider-descriptors.ts",
102
102
  "test:provider-structure": "npx tsx test/continuous-test-suite-provider-structure.ts",
103
+ "test:model-manifests": "npx tsx test/continuous-test-suite-model-manifests.ts",
103
104
  "test:provider-fallback": "npx tsx test/continuous-test-suite-provider-fallback.ts",
104
105
  "test:provider-fallback-latency": "npx tsx test/continuous-test-suite-provider-fallback-latency.ts",
105
106
  "test:provider-wiring": "npx tsx test/continuous-test-suite-provider-wiring.ts",
@@ -196,7 +197,7 @@
196
197
  "quality:metrics": "tsx scripts/quality-metrics.ts",
197
198
  "quality:report": "pnpm run quality:metrics && echo 'Quality metrics saved to quality-metrics.json'",
198
199
  "pre-commit": "lint-staged",
199
- "pre-push": "pnpm run build && pnpm run test:providers-mocked && pnpm run test:provider-structure",
200
+ "pre-push": "pnpm run build && pnpm run test:providers-mocked && pnpm run test:provider-structure && pnpm run test:model-manifests",
200
201
  "check:all": "pnpm run lint && pnpm run format --check && pnpm run validate && pnpm run validate:commit",
201
202
  "test:file-formats": "npx tsx test/continuous-test-suite-file-formats.ts",
202
203
  "test:multimodal": "pnpm run test:file-formats && pnpm run test:multimodal:sdk",