@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.
@@ -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;
@@ -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.5",
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": {