@juspay/neurolink 9.70.7 → 9.71.0
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 +344 -344
- package/dist/lib/neurolink.js +53 -16
- package/dist/lib/providers/googleVertex.js +257 -30
- package/dist/lib/services/server/ai/observability/instrumentation.d.ts +10 -1
- package/dist/lib/services/server/ai/observability/instrumentation.js +36 -1
- package/dist/lib/telemetry/attributes.d.ts +31 -0
- package/dist/lib/telemetry/attributes.js +46 -0
- package/dist/lib/telemetry/index.d.ts +1 -1
- package/dist/lib/telemetry/index.js +1 -1
- package/dist/lib/utils/anthropicTraceSanitizer.d.ts +7 -0
- package/dist/lib/utils/anthropicTraceSanitizer.js +26 -0
- package/dist/lib/utils/mcpErrorText.d.ts +16 -0
- package/dist/lib/utils/mcpErrorText.js +36 -0
- package/dist/neurolink.js +53 -16
- package/dist/providers/googleVertex.js +257 -30
- package/dist/services/server/ai/observability/instrumentation.d.ts +10 -1
- package/dist/services/server/ai/observability/instrumentation.js +36 -1
- package/dist/telemetry/attributes.d.ts +31 -0
- package/dist/telemetry/attributes.js +46 -0
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/utils/anthropicTraceSanitizer.d.ts +7 -0
- package/dist/utils/anthropicTraceSanitizer.js +25 -0
- package/dist/utils/mcpErrorText.d.ts +16 -0
- package/dist/utils/mcpErrorText.js +36 -0
- package/package.json +2 -1
|
@@ -33,3 +33,39 @@ export function extractMcpErrorText(raw) {
|
|
|
33
33
|
.map((c) => c.text);
|
|
34
34
|
return texts.join(" ").substring(0, 500);
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* MCP tools signal failure by RETURNING `{ isError: true, ... }`, not throwing,
|
|
38
|
+
* so execute()'s try/catch never sees it. Returns a capped status message for
|
|
39
|
+
* failures (undefined for success) for the caller to set the span error level.
|
|
40
|
+
*
|
|
41
|
+
* Generic over input shape: accepts either a result object or a JSON-stringified
|
|
42
|
+
* envelope (different providers hand back different shapes), mirroring
|
|
43
|
+
* `extractMcpErrorText`. A non-JSON string has no `isError` field, so it is
|
|
44
|
+
* correctly treated as "not an error" (→ undefined).
|
|
45
|
+
*
|
|
46
|
+
* Layered on `extractMcpErrorText`: this adds the `isError === true` gate and
|
|
47
|
+
* the human-readable "MCP tool returned isError: …" prefix, while the shared
|
|
48
|
+
* helper owns the content parsing and the 500-char cap. When `isError` is set
|
|
49
|
+
* but no readable text is present, falls back to a generic message.
|
|
50
|
+
*/
|
|
51
|
+
export function extractMcpToolErrorMessage(result) {
|
|
52
|
+
let resultObj = result;
|
|
53
|
+
if (typeof resultObj === "string") {
|
|
54
|
+
try {
|
|
55
|
+
resultObj = JSON.parse(resultObj);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (!resultObj || typeof resultObj !== "object") {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
if (resultObj.isError !== true) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
const text = extractMcpErrorText(resultObj);
|
|
68
|
+
return text
|
|
69
|
+
? `MCP tool returned isError: ${text}`
|
|
70
|
+
: "MCP tool returned isError: true";
|
|
71
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.71.0",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applications with 21+ providers: OpenAI, Anthropic, Google AI Studio, Google Vertex, AWS Bedrock, Azure OpenAI, Mistral, LiteLLM, SageMaker, Hugging Face, Ollama, OpenAI-compatible, OpenRouter, DeepSeek, NVIDIA NIM, LM Studio, llama.cpp, plus voice (OpenAI TTS, ElevenLabs, Deepgram, Azure Speech).",
|
|
6
6
|
"author": {
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
"test:log-sanitize": "npx tsx test/continuous-test-suite-log-sanitize.ts",
|
|
105
105
|
"test:sse-client": "npx tsx test/continuous-test-suite-sse-client.ts",
|
|
106
106
|
"test:stream-span": "npx tsx test/continuous-test-suite-stream-span.ts",
|
|
107
|
+
"test:vertex-langfuse-spans": "npx tsx test/continuous-test-suite-vertex-langfuse-spans.ts",
|
|
107
108
|
"test:credentials": "npx tsx test/continuous-test-suite-credentials.ts",
|
|
108
109
|
"test:dynamic": "npx tsx test/continuous-test-suite-dynamic.ts",
|
|
109
110
|
"test:proxy": "npx tsx test/continuous-test-suite-proxy.ts",
|