@juspay/neurolink 10.8.5 → 10.8.6
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 +6 -0
- package/dist/browser/neurolink.min.js +403 -403
- package/dist/lib/proxy/modelRouter.d.ts +10 -0
- package/dist/lib/proxy/modelRouter.js +17 -0
- package/dist/lib/proxy/proxyConfig.js +46 -0
- package/dist/lib/proxy/routingPolicy.d.ts +4 -2
- package/dist/lib/proxy/routingPolicy.js +8 -5
- package/dist/lib/proxy/runtimeConfig.js +2 -0
- package/dist/lib/server/routes/claudeProxyRoutes.d.ts +52 -1
- package/dist/lib/server/routes/claudeProxyRoutes.js +467 -221
- package/dist/lib/server/routes/openaiProxyRoutes.js +1 -1
- package/dist/lib/types/proxy.d.ts +24 -0
- package/dist/lib/types/subscription.d.ts +4 -0
- package/dist/proxy/modelRouter.d.ts +10 -0
- package/dist/proxy/modelRouter.js +17 -0
- package/dist/proxy/proxyConfig.js +46 -0
- package/dist/proxy/routingPolicy.d.ts +4 -2
- package/dist/proxy/routingPolicy.js +8 -5
- package/dist/proxy/runtimeConfig.js +2 -0
- package/dist/server/routes/claudeProxyRoutes.d.ts +52 -1
- package/dist/server/routes/claudeProxyRoutes.js +467 -221
- package/dist/server/routes/openaiProxyRoutes.js +1 -1
- package/dist/types/proxy.d.ts +24 -0
- package/dist/types/subscription.d.ts +4 -0
- package/package.json +1 -1
|
@@ -321,7 +321,7 @@ export function createOpenAIProxyRoutes(modelRouter, basePath = "", loopbackPort
|
|
|
321
321
|
model: targetModel,
|
|
322
322
|
}, requestModelRouter?.getFallbackChain() ?? [], body.model,
|
|
323
323
|
// The classifier only reads fields present on both types.
|
|
324
|
-
adapted);
|
|
324
|
+
adapted, requestModelRouter?.isAutoFallbackEnabled?.() ?? false);
|
|
325
325
|
const attempts = plan.attempts;
|
|
326
326
|
// --- Optional tracing ---
|
|
327
327
|
let tracer;
|
package/dist/types/proxy.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export type ModelRouterInterface = {
|
|
|
29
29
|
resolve(requestedModel: string): RouteResult;
|
|
30
30
|
isClaudeTarget(requestedModel: string): boolean;
|
|
31
31
|
getFallbackChain(): FallbackEntry[];
|
|
32
|
+
isAutoFallbackEnabled?(): boolean;
|
|
33
|
+
getMaxInflightPerAccount?(): number;
|
|
32
34
|
getModelMappings?: () => ModelMapping[];
|
|
33
35
|
getPassthroughModels?: () => string[];
|
|
34
36
|
};
|
|
@@ -639,6 +641,27 @@ export type AnthropicSuccessResult = {
|
|
|
639
641
|
};
|
|
640
642
|
} | {
|
|
641
643
|
response: Response | unknown;
|
|
644
|
+
holdsAccountAdmission?: boolean;
|
|
645
|
+
};
|
|
646
|
+
/** A release handle for one in-flight request admitted to an OAuth account. */
|
|
647
|
+
export type AccountAdmissionLease = {
|
|
648
|
+
release(): void;
|
|
649
|
+
};
|
|
650
|
+
/** A cancellable queued request for per-account admission capacity. */
|
|
651
|
+
export type QueuedAccountAdmission = {
|
|
652
|
+
accountKey: string;
|
|
653
|
+
promise: Promise<AccountAdmissionLease>;
|
|
654
|
+
cancel(): void;
|
|
655
|
+
};
|
|
656
|
+
/** One queued request waiting for per-account admission capacity. */
|
|
657
|
+
export type AccountAdmissionWaiter = {
|
|
658
|
+
capacity: number;
|
|
659
|
+
resolve: (lease: AccountAdmissionLease) => void;
|
|
660
|
+
};
|
|
661
|
+
/** In-process request admission state for an OAuth account. */
|
|
662
|
+
export type AccountAdmissionState = {
|
|
663
|
+
active: number;
|
|
664
|
+
waiters: AccountAdmissionWaiter[];
|
|
642
665
|
};
|
|
643
666
|
/** Result of buffering only enough upstream SSE to make a retry-safe decision. */
|
|
644
667
|
export type AnthropicStreamPreflightResult = {
|
|
@@ -669,6 +692,7 @@ export type ParsedSSEBuffer = {
|
|
|
669
692
|
};
|
|
670
693
|
export type AnthropicAuthRetryResult = {
|
|
671
694
|
response?: Response | unknown;
|
|
695
|
+
holdsAccountAdmission?: boolean;
|
|
672
696
|
continueLoop: boolean;
|
|
673
697
|
lastError: unknown;
|
|
674
698
|
authFailureMessage: string | null;
|
|
@@ -908,6 +908,10 @@ export type ProxyRoutingConfig = {
|
|
|
908
908
|
strategy: "round-robin" | "fill-first";
|
|
909
909
|
modelMappings: ModelMapping[];
|
|
910
910
|
fallbackChain: FallbackEntry[];
|
|
911
|
+
/** Permit a last-resort provider chosen by the translation layer. Disabled by default. */
|
|
912
|
+
autoFallback?: boolean;
|
|
913
|
+
/** Maximum in-flight upstream requests per OAuth account. Defaults to two. */
|
|
914
|
+
maxInflightPerAccount?: number;
|
|
911
915
|
passthroughModels?: string[];
|
|
912
916
|
/** Enable quota-aware fill-first account ordering. Defaults to true. */
|
|
913
917
|
quotaRouting?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "10.8.
|
|
3
|
+
"version": "10.8.6",
|
|
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": {
|