bitfab 0.24.0 → 0.24.1

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/dist/index.cjs CHANGED
@@ -414,7 +414,10 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
414
414
  originalOutput,
415
415
  error,
416
416
  durationMs: serverItem.durationMs ?? null,
417
- tokens: serverItem.tokens ?? null,
417
+ // Filled in by replay() from the complete-replay response once the
418
+ // replay traces are persisted and their spans aggregated server-side.
419
+ // Null here (and on older servers) means "replay tokens not known".
420
+ tokens: null,
418
421
  model: serverItem.model ?? null,
419
422
  dbSnapshotRef: serverItem.dbSnapshotRef ?? null
420
423
  };
@@ -488,6 +491,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
488
491
  const resultItems = await mapWithConcurrency(tasks, maxConcurrency);
489
492
  const completeResult = await httpClient.completeReplay(testRunId);
490
493
  const serverTraceIds = completeResult.traceIds;
494
+ const replayTokens = completeResult.tokens;
491
495
  if (serverTraceIds === void 0) {
492
496
  try {
493
497
  console.warn(
@@ -510,6 +514,9 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
510
514
  missing.push(item.traceId);
511
515
  }
512
516
  }
517
+ if (mapped !== void 0) {
518
+ item.tokens = replayTokens?.[mapped] ?? null;
519
+ }
513
520
  item.traceId = mapped ?? null;
514
521
  }
515
522
  }
@@ -568,7 +575,7 @@ __export(index_exports, {
568
575
  module.exports = __toCommonJS(index_exports);
569
576
 
570
577
  // src/version.generated.ts
571
- var __version__ = "0.24.0";
578
+ var __version__ = "0.24.1";
572
579
 
573
580
  // src/constants.ts
574
581
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";