@juspay/neurolink 9.86.1 → 9.86.2

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.
@@ -74,7 +74,9 @@ export function extractReasoningTokens(usage) {
74
74
  }
75
75
  /**
76
76
  * Extract cache creation token count from various provider formats
77
- * Supports: cacheCreationInputTokens, cacheCreationTokens
77
+ * Supports: cacheCreationInputTokens, cacheCreationTokens, and the ai@6
78
+ * normalized `inputTokenDetails.cacheWriteTokens` (the only shape the native
79
+ * direct-Anthropic path reports through generateText).
78
80
  */
79
81
  export function extractCacheCreationTokens(usage) {
80
82
  if (typeof usage.cacheCreationInputTokens === "number" &&
@@ -85,11 +87,18 @@ export function extractCacheCreationTokens(usage) {
85
87
  usage.cacheCreationTokens > 0) {
86
88
  return usage.cacheCreationTokens;
87
89
  }
90
+ if (typeof usage.inputTokenDetails?.cacheWriteTokens === "number" &&
91
+ usage.inputTokenDetails.cacheWriteTokens > 0) {
92
+ return usage.inputTokenDetails.cacheWriteTokens;
93
+ }
88
94
  return undefined;
89
95
  }
90
96
  /**
91
97
  * Extract cache read token count from various provider formats
92
- * Supports: cacheReadInputTokens, cacheReadTokens
98
+ * Supports: cacheReadInputTokens, cacheReadTokens, and the ai@6 normalized
99
+ * shapes — flat `cachedInputTokens` and nested
100
+ * `inputTokenDetails.cacheReadTokens` (the only shapes the native
101
+ * direct-Anthropic path reports through generateText).
93
102
  */
94
103
  export function extractCacheReadTokens(usage) {
95
104
  if (typeof usage.cacheReadInputTokens === "number" &&
@@ -99,6 +108,14 @@ export function extractCacheReadTokens(usage) {
99
108
  if (typeof usage.cacheReadTokens === "number" && usage.cacheReadTokens > 0) {
100
109
  return usage.cacheReadTokens;
101
110
  }
111
+ if (typeof usage.cachedInputTokens === "number" &&
112
+ usage.cachedInputTokens > 0) {
113
+ return usage.cachedInputTokens;
114
+ }
115
+ if (typeof usage.inputTokenDetails?.cacheReadTokens === "number" &&
116
+ usage.inputTokenDetails.cacheReadTokens > 0) {
117
+ return usage.inputTokenDetails.cacheReadTokens;
118
+ }
102
119
  return undefined;
103
120
  }
104
121
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "9.86.1",
3
+ "version": "9.86.2",
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": {