@juspay/neurolink 12.7.7 → 12.7.9
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 +2 -2
- package/dist/browser/neurolink.min.js +364 -361
- package/dist/mcp/externalServerManager.d.ts +41 -1
- package/dist/mcp/externalServerManager.js +172 -39
- package/dist/mcp/mcpClientFactory.d.ts +24 -2
- package/dist/mcp/mcpClientFactory.js +89 -66
- package/dist/server/routes/claudeProxyRoutes.d.ts +4 -5
- package/dist/server/routes/claudeProxyRoutes.js +18 -5
- package/dist/types/externalMcp.d.ts +12 -2
- package/package.json +3 -2
|
@@ -604,11 +604,10 @@ function minutesUntil(untilMs, now) {
|
|
|
604
604
|
return Math.max(0, Math.round((untilMs - now) / 60000));
|
|
605
605
|
}
|
|
606
606
|
/**
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
* 429, except when the provider explicitly enables paid overage.
|
|
607
|
+
* Reconcile quota-backed cooldowns against a fresh provider observation. A
|
|
608
|
+
* rejected window parks the account until its reset; an allowed observation for
|
|
609
|
+
* that same window releases an earlier cooldown whose reset timestamp was
|
|
610
|
+
* stale. Transient and authentication cooldowns are intentionally untouched.
|
|
612
611
|
*/
|
|
613
612
|
function reconcileCooldownFromQuota(state, quota, now, policy = overagePolicy) {
|
|
614
613
|
const overageAvailable = isOverageUsable(quota, policy);
|
|
@@ -641,6 +640,20 @@ function reconcileCooldownFromQuota(state, quota, now, policy = overagePolicy) {
|
|
|
641
640
|
reason = "unified";
|
|
642
641
|
}
|
|
643
642
|
if (until === undefined) {
|
|
643
|
+
const recoveredQuotaCooldown = !!state.coolingUntil &&
|
|
644
|
+
((state.coolingReason === "weekly" && quota.weeklyStatus === "allowed") ||
|
|
645
|
+
(state.coolingReason === "session" &&
|
|
646
|
+
quota.sessionStatus === "allowed") ||
|
|
647
|
+
(state.coolingReason === "unified" &&
|
|
648
|
+
quota.unifiedStatus === "allowed"));
|
|
649
|
+
if (recoveredQuotaCooldown && state.coolingUntil) {
|
|
650
|
+
const previousCoolingUntil = state.coolingUntil;
|
|
651
|
+
const previousCoolingReason = state.coolingReason;
|
|
652
|
+
state.coolingUntil = undefined;
|
|
653
|
+
state.coolingReason = undefined;
|
|
654
|
+
logger.always(`[proxy] clearing ${previousCoolingReason} cooldown from fresh provider quota`);
|
|
655
|
+
return { kind: "cleared", coolingUntil: previousCoolingUntil };
|
|
656
|
+
}
|
|
644
657
|
return null;
|
|
645
658
|
}
|
|
646
659
|
const clamped = clampCooldownUntil(until, now, reason);
|
|
@@ -51,8 +51,13 @@ export type ExternalMCPServerConfig = {
|
|
|
51
51
|
export type ExternalMCPServerInstance = {
|
|
52
52
|
/** Server configuration */
|
|
53
53
|
config: ExternalMCPServerConfig;
|
|
54
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Child process handle. Always null for stdio servers: the SDK transport
|
|
56
|
+
* owns the process and does not expose the handle. Use `pid`.
|
|
57
|
+
*/
|
|
55
58
|
process: ChildProcess | null;
|
|
59
|
+
/** OS process id of the stdio server, once connected */
|
|
60
|
+
pid?: number;
|
|
56
61
|
/** MCP client instance */
|
|
57
62
|
client: Client | null;
|
|
58
63
|
/** Transport instance */
|
|
@@ -305,8 +310,13 @@ export type ExternalMCPManagerConfig = {
|
|
|
305
310
|
* active server management (process handles, clients, metrics, etc.)
|
|
306
311
|
*/
|
|
307
312
|
export type RuntimeMCPServerInfo = MCPServerInfo & {
|
|
308
|
-
/**
|
|
313
|
+
/**
|
|
314
|
+
* Child process handle. Always null for stdio servers: the SDK transport
|
|
315
|
+
* owns the process and does not expose the handle. Use `pid`.
|
|
316
|
+
*/
|
|
309
317
|
process: import("child_process").ChildProcess | null;
|
|
318
|
+
/** OS process id of the stdio server, once connected */
|
|
319
|
+
pid?: number;
|
|
310
320
|
/** MCP client instance for communication */
|
|
311
321
|
client: Client | null;
|
|
312
322
|
/** Transport instance (renamed from 'transport' to avoid conflict with MCPServerInfo.transport) */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "12.7.
|
|
3
|
+
"version": "12.7.9",
|
|
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": {
|
|
@@ -84,7 +84,8 @@
|
|
|
84
84
|
"test:mcp:http": "pnpm exec tsx test/continuous-test-suite-mcp-http.ts",
|
|
85
85
|
"test:mcp:sdk": "pnpm exec tsx test/continuous-test-suite-mcp-sdk.ts",
|
|
86
86
|
"test:mcp:cli": "pnpm exec tsx test/continuous-test-suite-mcp-cli.ts",
|
|
87
|
-
"test:mcp:
|
|
87
|
+
"test:mcp:stdio-lifecycle": "pnpm exec tsx test/continuous-test-suite-mcp-stdio-lifecycle.ts",
|
|
88
|
+
"test:mcp:full": "pnpm run test:mcp:infra && pnpm run test:mcp:spans && pnpm run test:mcp:stdio-lifecycle && pnpm run test:mcp:sdk && pnpm run test:mcp:cli && pnpm run test:mcp:http",
|
|
88
89
|
"test:media": "pnpm exec tsx test/continuous-test-suite-media-gen.ts",
|
|
89
90
|
"test:media-registry-collisions": "pnpm exec tsx test/continuous-test-suite-media-registry-collisions.ts",
|
|
90
91
|
"test:memory": "pnpm exec tsx test/continuous-test-suite-memory.ts",
|