@juspay/neurolink 10.8.1 → 10.8.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 CHANGED
@@ -1,3 +1,15 @@
1
+ ## [10.8.3](https://github.com/juspay/neurolink/compare/v10.8.2...v10.8.3) (2026-07-31)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **(sdk):** fast-fail provider errors to fallback orchestration ([2156f16](https://github.com/juspay/neurolink/commit/2156f166d275f5e62cfd1523b7ec1384b6f000df))
6
+
7
+ ## [10.8.2](https://github.com/juspay/neurolink/compare/v10.8.1...v10.8.2) (2026-07-31)
8
+
9
+ ### Bug Fixes
10
+
11
+ - **(sdk):** anthropic proxy User-Agent spoof and non-abort providerFallback widening ([8fdc9bd](https://github.com/juspay/neurolink/commit/8fdc9bd98f8fe487898f9a4534dc2e354d3539bc))
12
+
1
13
  ## [10.8.1](https://github.com/juspay/neurolink/compare/v10.8.0...v10.8.1) (2026-07-30)
2
14
 
3
15
  ### Bug Fixes
@@ -45,6 +45,30 @@ const IMAGE_LIMITS = {
45
45
  * through and let the underlying provider surface errors if needed.
46
46
  */
47
47
  const PROXY_PROVIDERS = new Set(["litellm", "openrouter"]);
48
+ /**
49
+ * Family-level vision rules, checked ONLY after a model id misses the exact
50
+ * VISION_CAPABILITIES allowlist for its provider. Kept as patterns (mirroring
51
+ * SAMPLING_PARAM_REJECTING_FAMILIES in modelRegistry.ts) because gateway ids
52
+ * carry arbitrary prefixes/suffixes (`vertex_ai/claude-sonnet-5@20260203`,
53
+ * `claude-opus-4-7-20260115`) that exact entries can't cover.
54
+ *
55
+ * Matches name-first Claude ids (claude-{opus,sonnet,haiku}-N…) with major
56
+ * version ≥ 4 — e.g. `claude-sonnet-5`, `claude-opus-5`, `claude-opus-4-7`,
57
+ * `claude-haiku-4-5` — all of which are vision-capable, plus the
58
+ * Fable/Mythos-class models (`claude-fable-5`, `claude-mythos-5`).
59
+ *
60
+ * Legacy number-first 3.x ids (`claude-3-5-haiku`, `claude-3-haiku`, …)
61
+ * deliberately do NOT match: the family word follows the version there, and
62
+ * claude-3-5-haiku — the last non-vision Claude — must stay rejected.
63
+ */
64
+ const CLAUDE_MODERN_VISION_FAMILIES = [
65
+ /claude-(?:opus|sonnet|haiku)-(?:[4-9]|\d{2,})/i,
66
+ /claude-(?:fable|mythos)-\d/i,
67
+ ];
68
+ const VISION_FAMILY_RULES = {
69
+ anthropic: CLAUDE_MODERN_VISION_FAMILIES,
70
+ vertex: CLAUDE_MODERN_VISION_FAMILIES,
71
+ };
48
72
  /**
49
73
  * Normalize provider name/alias to its canonical form for vision checks.
50
74
  */
@@ -597,6 +621,13 @@ export class ProviderImageAdapter {
597
621
  static supportsVision(provider, model) {
598
622
  try {
599
623
  const normalizedProvider = normalizeVisionProvider(provider);
624
+ // Anthropic behind a proxy (ANTHROPIC_BASE_URL set) routes to whatever
625
+ // the proxy exposes — capability gating is the upstream's job. Mirrors
626
+ // the validateModelAccess tier-check bypass in providers/anthropic.ts.
627
+ if (normalizedProvider === "anthropic" &&
628
+ process.env.ANTHROPIC_BASE_URL) {
629
+ return true;
630
+ }
600
631
  const supportedModels = VISION_CAPABILITIES[normalizedProvider];
601
632
  if (!supportedModels) {
602
633
  return false;
@@ -612,6 +643,10 @@ export class ProviderImageAdapter {
612
643
  return true; // Provider supports vision, but need to check specific model
613
644
  }
614
645
  const modelMatched = supportedModels.some((supportedModel) => model.toLowerCase().includes(supportedModel.toLowerCase()));
646
+ if (!modelMatched &&
647
+ VISION_FAMILY_RULES[normalizedProvider]?.some((rule) => rule.test(model))) {
648
+ return true;
649
+ }
615
650
  // Proxy providers route to arbitrary underlying models — pass through if
616
651
  // the model isn't in the known allowlist.
617
652
  if (!modelMatched && PROXY_PROVIDERS.has(normalizedProvider)) {