@juspay/neurolink 12.14.7 → 12.14.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "12.14.7",
3
+ "version": "12.14.8",
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": {
@@ -85,6 +85,19 @@ export async function checkProxyTelemetry({
85
85
  logs?.otel?.initialized && logs.diskEnabled === false ? "pass" : "fail",
86
86
  { initialized: logs?.otel?.initialized, diskEnabled: logs?.diskEnabled },
87
87
  );
88
+ const supervisor = runtime.observability?.supervisor;
89
+ const supervisorProcess = supervisor?.process;
90
+ const workerProcess = runtime.observability?.process;
91
+ /** @param {import("../../src/lib/types/index.js").ProxyProcessTelemetrySnapshot | undefined} process */
92
+ const otelProcess = (process) => process?.configuredSink === "otel" &&
93
+ process.lifecycleSink === "otel" && process.otelInitialized &&
94
+ process.stdio?.stdout === "non_file" && process.stdio?.stderr === "non_file";
95
+ add("worker_process_logging", !workerProcess ? "unverified" : otelProcess(workerProcess) ? "pass" : "fail", workerProcess ?? { reason: "process_telemetry_missing" });
96
+ add("supervisor_logging",
97
+ supervisor?.status === "not_applicable" && !runtime.autoUpdate?.supervisorPid ? "pass" :
98
+ supervisor?.status !== "available" ? "unverified" :
99
+ supervisorProcess?.pid === runtime.autoUpdate?.supervisorPid && otelProcess(supervisorProcess) ? "pass" : "fail",
100
+ supervisor ?? { status: "unavailable", reason: "supervisor_telemetry_missing" });
88
101
  /** @type {Array<{kind: string, dropped: number, exportUnconfirmed: number, outstanding: number, capacity: number, recentFailures?: unknown, failureHistoryEvicted?: number}>} */
89
102
  const failures = (logs?.otel?.queues ?? []).map(
90
103
  (
@@ -101,7 +114,7 @@ export async function checkProxyTelemetry({
101
114
  );
102
115
  add(
103
116
  "producer_delivery",
104
- ["metadata", "body"].every((kind) =>
117
+ ["metadata", "bodies"].every((kind) =>
105
118
  failures.some((q) => q.kind === kind),
106
119
  ) &&
107
120
  failures.every(
@@ -155,8 +168,10 @@ export async function checkProxyTelemetry({
155
168
  for (const kind of ["request_final", "body_capture_index", "lifecycle"]) {
156
169
  const result = await queryProxyHistory({
157
170
  ...backend,
158
- startTime,
159
- endTime,
171
+ // Capture publication is asynchronous. Include its bounded settling
172
+ // window, and a request-start margin, when reconciling phases to finals.
173
+ startTime: kind === "body_capture_index" ? Math.max(0, startTime - 120e6) : startTime,
174
+ endTime: kind === "body_capture_index" ? Math.min(Date.now() * 1000, endTime + 120e6) : endTime,
160
175
  kind,
161
176
  maxRows,
162
177
  fetchImpl,
@@ -175,7 +190,7 @@ export async function checkProxyTelemetry({
175
190
  ) {
176
191
  throw new Error("Stored telemetry metadata has an invalid schema");
177
192
  }
178
- return value;
193
+ return { ...value, recordedAtMicroseconds: Number(row._timestamp) };
179
194
  });
180
195
  }
181
196
  const finals = history.request_final,
@@ -291,7 +306,26 @@ export async function checkProxyTelemetry({
291
306
  : "fail",
292
307
  coverage,
293
308
  );
294
- const indexes = history.body_capture_index;
309
+ const indexes = history.body_capture_index.filter((row) =>
310
+ (row.recordedAtMicroseconds ?? -1) >= startTime &&
311
+ (row.recordedAtMicroseconds ?? Infinity) < endTime);
312
+ /** @type {Map<string | undefined, Set<string | undefined>>} */
313
+ const phasesByRequest = new Map();
314
+ for (const index of history.body_capture_index) {
315
+ let phases = phasesByRequest.get(index.requestId);
316
+ if (!phases) { phases = new Set(); phasesByRequest.set(index.requestId, phases); }
317
+ phases.add(index.phase);
318
+ }
319
+ const captureFinals = finals.filter((row) => row.path && ["/v1/messages", "/backend-api/codex/responses", "/v1/responses"].includes(row.path));
320
+ const missingCapturePhases = captureFinals.flatMap((row) => {
321
+ // A request may have started outside the selected interval. Its response
322
+ // capture still has to be present when this final is inside the interval.
323
+ return phasesByRequest.get(row.requestId)?.has("client_response") ? [] : [{ requestId: row.requestId, missingPhase: "client_response" }];
324
+ });
325
+ add("request_capture_coverage", !captureFinals.length ? "unverified" : missingCapturePhases.length ? "fail" : "pass", {
326
+ finals: finals.length, eligibleFinals: captureFinals.length, missing: missingCapturePhases.length,
327
+ examples: missingCapturePhases.slice(0, 50), omitted: Math.max(0, missingCapturePhases.length - 50),
328
+ });
295
329
  /** @type {Record<string, number>} */
296
330
  const byDelivery = Object.create(null);
297
331
  for (const row of indexes) {