@juspay/neurolink 10.8.12 → 10.8.13

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.
@@ -16,6 +16,14 @@
16
16
  import { z } from "zod";
17
17
  import { logger } from "../../utils/logger.js";
18
18
  import { findSchemaIssue, sanitizeToolParameters } from "./schemaSanitizer.js";
19
+ /**
20
+ * Default hard cap per MCP tool call.
21
+ *
22
+ * Chosen to sit well inside a conversational turn: a realtime voice user is
23
+ * waiting in silence while a tool runs, so a call that has not returned in
24
+ * 30s has already failed as far as the conversation is concerned.
25
+ */
26
+ const DEFAULT_TOOL_TIMEOUT_MS = 30_000;
19
27
  /**
20
28
  * The fields of an MCP tool result we render: text content parts and the error
21
29
  * flag. The result crosses a network boundary from an external MCP server, so it
@@ -86,7 +94,7 @@ function registerToolAliases(toolContext, mcpToolName, handler) {
86
94
  * filtering is needed.
87
95
  */
88
96
  export async function buildRealtimeMcpTools(params) {
89
- const { mcpUrl, authToken, xContext, publishEvent, requestConfirmation } = params;
97
+ const { mcpUrl, authToken, xContext, publishEvent, requestConfirmation, toolTimeoutMs = DEFAULT_TOOL_TIMEOUT_MS, } = params;
90
98
  const { llm } = await import("@livekit/agents");
91
99
  const { Client: McpClient } = await import("@modelcontextprotocol/sdk/client/index.js");
92
100
  const { StreamableHTTPClientTransport } = await import("@modelcontextprotocol/sdk/client/streamableHttp.js");
@@ -141,10 +149,14 @@ export async function buildRealtimeMcpTools(params) {
141
149
  publishEvent("tool-start", { name: mcpTool.name });
142
150
  const startedAt = Date.now();
143
151
  try {
152
+ // Third argument is RequestOptions; the SDK aborts the in-flight
153
+ // request when `timeout` elapses. Without it a stalled server holds
154
+ // the turn open indefinitely — Gemini blocks on the function
155
+ // result, so the user hears nothing at all rather than an error.
144
156
  const result = await client.callTool({
145
157
  name: mcpTool.name,
146
158
  arguments: args ?? {},
147
- });
159
+ }, undefined, { timeout: toolTimeoutMs });
148
160
  const text = mcpResultToText(result);
149
161
  logger.info("realtime.tool.result", {
150
162
  tool: mcpTool.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "10.8.12",
3
+ "version": "10.8.13",
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": {
@@ -218,7 +218,13 @@
218
218
  "pre-push": "pnpm run validate:commit && pnpm run validate:env && pnpm run validate && pnpm run test:ci",
219
219
  "check:all": "pnpm run lint && pnpm run format --check && pnpm run validate && pnpm run validate:commit",
220
220
  "test:litellm-context:vitest": "pnpm exec vitest run test/litellmContextWindows.test.ts",
221
- "test:step-budget-guard:vitest": "pnpm exec vitest run test/stepBudgetGuard.test.ts"
221
+ "test:step-budget-guard:vitest": "pnpm exec vitest run test/stepBudgetGuard.test.ts",
222
+ "test:audio": "npx tsx test/continuous-test-suite-audio.ts",
223
+ "test:office": "npx tsx test/continuous-test-suite-office.ts",
224
+ "test:tts:unit": "npx tsx test/continuous-test-suite-tts-unit.ts",
225
+ "test:video": "npx tsx test/continuous-test-suite-video.ts",
226
+ "test:multimodal": "pnpm run test:audio && pnpm run test:video && pnpm run test:office && pnpm run test:tts:unit && pnpm run test:multimodal:sdk",
227
+ "test:multimodal:sdk": "npx tsx test/continuous-test-suite-multimodal-sdk.ts"
222
228
  },
223
229
  "files": [
224
230
  "dist",