@juspay/neurolink 12.49.17 → 12.49.18
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/agent/agent.js +21 -0
- package/dist/browser/neurolink.min.js +277 -277
- package/dist/core/analytics.js +3 -18
- package/dist/core/evaluationProviders.d.ts +2 -7
- package/dist/core/evaluationProviders.js +1 -1
- package/dist/core/modules/TelemetryHandler.d.ts +3 -11
- package/dist/core/modules/TelemetryHandler.js +6 -29
- package/dist/types/agentNetwork.d.ts +8 -0
- package/dist/types/evaluationProviders.d.ts +6 -0
- package/dist/utils/pricing.js +16 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## [12.49.
|
|
1
|
+
## [12.49.18](https://github.com/juspay/neurolink/compare/v12.49.17...v12.49.18) (2026-10-10)
|
|
2
2
|
|
|
3
3
|
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
- **(BZ-
|
|
5
|
+
- **(BZ-6758):** preserve unknown pricing and agent cost estimates ([ea1bc28](https://github.com/juspay/neurolink/commit/ea1bc28aedd918c978354a62cb13019136fdfcb7))
|
|
6
6
|
|
|
7
7
|
## [11.2.3](https://github.com/juspay/neurolink/compare/v11.2.2...v11.2.3) (2026-08-19)
|
|
8
8
|
|
package/dist/agent/agent.js
CHANGED
|
@@ -159,6 +159,7 @@ export class Agent {
|
|
|
159
159
|
content: result.content || "",
|
|
160
160
|
object: parsedOutput,
|
|
161
161
|
usage: result.usage,
|
|
162
|
+
cost: result.analytics?.cost,
|
|
162
163
|
toolsUsed: result.toolsUsed,
|
|
163
164
|
// Real per-call records straight from the tool loop (N2)
|
|
164
165
|
toolExecutions: result.toolExecutions,
|
|
@@ -281,6 +282,13 @@ export class Agent {
|
|
|
281
282
|
this.lastExecutionTime = duration;
|
|
282
283
|
this.executionCount++;
|
|
283
284
|
this.totalExecutionTime += duration;
|
|
285
|
+
let cost;
|
|
286
|
+
try {
|
|
287
|
+
cost = (await streamResult.analytics)?.cost;
|
|
288
|
+
}
|
|
289
|
+
catch {
|
|
290
|
+
logger.warn(`[Agent:${this.id}] Stream cost analytics unavailable`);
|
|
291
|
+
}
|
|
284
292
|
this.emitter.emit("agent:complete", {
|
|
285
293
|
agentId: this.id,
|
|
286
294
|
traceId,
|
|
@@ -292,6 +300,7 @@ export class Agent {
|
|
|
292
300
|
agentId: this.id,
|
|
293
301
|
content: fullContent,
|
|
294
302
|
usage: streamResult.usage,
|
|
303
|
+
cost,
|
|
295
304
|
duration,
|
|
296
305
|
timestamp: Date.now(),
|
|
297
306
|
traceId,
|
|
@@ -371,6 +380,12 @@ export class Agent {
|
|
|
371
380
|
// toolFilter delegates to BaseProvider.applyToolFiltering() natively
|
|
372
381
|
...(this.tools && this.tools.length > 0 && { toolFilter: this.tools }),
|
|
373
382
|
maxSteps: options?.maxSteps ?? this.maxSteps,
|
|
383
|
+
...(options?.enableAnalytics !== undefined && {
|
|
384
|
+
enableAnalytics: options.enableAnalytics,
|
|
385
|
+
}),
|
|
386
|
+
...(options?.maxBudgetUsd !== undefined && {
|
|
387
|
+
maxBudgetUsd: options.maxBudgetUsd,
|
|
388
|
+
}),
|
|
374
389
|
requestId: traceId,
|
|
375
390
|
// Turn budget + cancellation, forwarded verbatim to generate() — the
|
|
376
391
|
// machinery (wrap-up nudge, stall watchdog, honest stopReason) lives
|
|
@@ -409,6 +424,12 @@ export class Agent {
|
|
|
409
424
|
// toolFilter delegates to BaseProvider.applyToolFiltering() natively
|
|
410
425
|
...(this.tools && this.tools.length > 0 && { toolFilter: this.tools }),
|
|
411
426
|
maxSteps: options?.maxSteps ?? this.maxSteps,
|
|
427
|
+
...(options?.enableAnalytics !== undefined && {
|
|
428
|
+
enableAnalytics: options.enableAnalytics,
|
|
429
|
+
}),
|
|
430
|
+
...(options?.maxBudgetUsd !== undefined && {
|
|
431
|
+
maxBudgetUsd: options.maxBudgetUsd,
|
|
432
|
+
}),
|
|
412
433
|
// Turn budget + cancellation, forwarded verbatim to stream()
|
|
413
434
|
...(options?.abortSignal && { abortSignal: options.abortSignal }),
|
|
414
435
|
...(options?.timeout !== undefined && { timeout: options.timeout }),
|