@juspay/neurolink 10.8.2 → 10.8.4
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 +12 -0
- package/dist/adapters/providerImageAdapter.js +35 -0
- package/dist/browser/neurolink.min.js +363 -363
- package/dist/core/baseProvider.js +25 -0
- package/dist/lib/adapters/providerImageAdapter.js +35 -0
- package/dist/lib/core/baseProvider.js +25 -0
- package/dist/lib/neurolink.js +27 -5
- package/dist/lib/providers/anthropic.js +9 -0
- package/dist/lib/providers/googleVertex.js +4 -0
- package/dist/lib/providers/openaiChatCompletionsClient.js +9 -0
- package/dist/lib/types/config.d.ts +16 -11
- package/dist/lib/types/generate.d.ts +5 -3
- package/dist/lib/types/providers.d.ts +2 -0
- package/dist/lib/types/stream.d.ts +6 -5
- package/dist/lib/utils/providerRetry.d.ts +25 -2
- package/dist/lib/utils/providerRetry.js +88 -14
- package/dist/neurolink.js +27 -5
- package/dist/providers/anthropic.js +9 -0
- package/dist/providers/googleVertex.js +4 -0
- package/dist/providers/openaiChatCompletionsClient.js +9 -0
- package/dist/types/config.d.ts +16 -11
- package/dist/types/generate.d.ts +5 -3
- package/dist/types/providers.d.ts +2 -0
- package/dist/types/stream.d.ts +6 -5
- package/dist/utils/providerRetry.d.ts +25 -2
- package/dist/utils/providerRetry.js +88 -14
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [10.8.4](https://github.com/juspay/neurolink/compare/v10.8.3...v10.8.4) (2026-08-01)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **(providers):** add provider-base-class AST lint rule and continuous test suite validation ([#1177](https://github.com/juspay/neurolink/issues/1177)) ([caadc40](https://github.com/juspay/neurolink/commit/caadc40828fee2d395e13872e9cd55c7d2efe47d))
|
|
6
|
+
|
|
7
|
+
## [10.8.3](https://github.com/juspay/neurolink/compare/v10.8.2...v10.8.3) (2026-07-31)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **(sdk):** fast-fail provider errors to fallback orchestration ([2156f16](https://github.com/juspay/neurolink/commit/2156f166d275f5e62cfd1523b7ec1384b6f000df))
|
|
12
|
+
|
|
1
13
|
## [10.8.2](https://github.com/juspay/neurolink/compare/v10.8.1...v10.8.2) (2026-07-31)
|
|
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)) {
|