@bitfab/sdk 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
@@ -405,7 +405,10 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
405
405
  originalOutput,
406
406
  error,
407
407
  durationMs: serverItem.durationMs ?? null,
408
- tokens: serverItem.tokens ?? null,
408
+ // Filled in by replay() from the complete-replay response once the
409
+ // replay traces are persisted and their spans aggregated server-side.
410
+ // Null here (and on older servers) means "replay tokens not known".
411
+ tokens: null,
409
412
  model: serverItem.model ?? null,
410
413
  dbSnapshotRef: serverItem.dbSnapshotRef ?? null
411
414
  };
@@ -479,6 +482,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
479
482
  const resultItems = await mapWithConcurrency(tasks, maxConcurrency);
480
483
  const completeResult = await httpClient.completeReplay(testRunId);
481
484
  const serverTraceIds = completeResult.traceIds;
485
+ const replayTokens = completeResult.tokens;
482
486
  if (serverTraceIds === void 0) {
483
487
  try {
484
488
  console.warn(
@@ -501,6 +505,9 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
501
505
  missing.push(item.traceId);
502
506
  }
503
507
  }
508
+ if (mapped !== void 0) {
509
+ item.tokens = replayTokens?.[mapped] ?? null;
510
+ }
504
511
  item.traceId = mapped ?? null;
505
512
  }
506
513
  }
@@ -559,7 +566,7 @@ __export(index_exports, {
559
566
  module.exports = __toCommonJS(index_exports);
560
567
 
561
568
  // src/version.generated.ts
562
- var __version__ = "0.24.0";
569
+ var __version__ = "0.24.1";
563
570
 
564
571
  // src/constants.ts
565
572
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";