@bitfab/sdk 0.28.0 → 0.28.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.
package/dist/index.d.cts CHANGED
@@ -680,6 +680,8 @@ interface ReplayOptions {
680
680
  }
681
681
  /** Running totals reported to {@link ReplayOptions.onProgress} as replay proceeds. */
682
682
  interface ReplayProgress {
683
+ /** Test run ID created for this replay. */
684
+ testRunId?: string;
683
685
  /** Items that have finished so far, whether they succeeded or errored. */
684
686
  completed: number;
685
687
  /** Total number of items in this replay run. */
@@ -697,9 +699,21 @@ interface ReplayProgress {
697
699
  * {@link ReplayResult}.
698
700
  */
699
701
  item?: {
702
+ /** Source (historical) trace ID being replayed. */
700
703
  traceId: string | null;
704
+ /** Local SDK replay trace ID, before the server maps it to a row ID. */
705
+ replayTraceId?: string | null;
706
+ /** Deserialized inputs from the original trace. */
707
+ input?: unknown[];
708
+ /** The result returned by the replayed function, or undefined on error. */
709
+ result?: unknown;
710
+ /** The original output from the historical trace. */
711
+ originalOutput?: unknown;
701
712
  error: string | null;
702
713
  durationMs: number | null;
714
+ tokens?: TokenUsage | null;
715
+ model?: string | null;
716
+ dbSnapshotRef?: DbSnapshotRef | null;
703
717
  };
704
718
  }
705
719
  /**
@@ -1589,7 +1603,7 @@ declare class BitfabFunction {
1589
1603
  /**
1590
1604
  * SDK version from package.json (injected at build time)
1591
1605
  */
1592
- declare const __version__ = "0.28.0";
1606
+ declare const __version__ = "0.28.2";
1593
1607
 
1594
1608
  /**
1595
1609
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -680,6 +680,8 @@ interface ReplayOptions {
680
680
  }
681
681
  /** Running totals reported to {@link ReplayOptions.onProgress} as replay proceeds. */
682
682
  interface ReplayProgress {
683
+ /** Test run ID created for this replay. */
684
+ testRunId?: string;
683
685
  /** Items that have finished so far, whether they succeeded or errored. */
684
686
  completed: number;
685
687
  /** Total number of items in this replay run. */
@@ -697,9 +699,21 @@ interface ReplayProgress {
697
699
  * {@link ReplayResult}.
698
700
  */
699
701
  item?: {
702
+ /** Source (historical) trace ID being replayed. */
700
703
  traceId: string | null;
704
+ /** Local SDK replay trace ID, before the server maps it to a row ID. */
705
+ replayTraceId?: string | null;
706
+ /** Deserialized inputs from the original trace. */
707
+ input?: unknown[];
708
+ /** The result returned by the replayed function, or undefined on error. */
709
+ result?: unknown;
710
+ /** The original output from the historical trace. */
711
+ originalOutput?: unknown;
701
712
  error: string | null;
702
713
  durationMs: number | null;
714
+ tokens?: TokenUsage | null;
715
+ model?: string | null;
716
+ dbSnapshotRef?: DbSnapshotRef | null;
703
717
  };
704
718
  }
705
719
  /**
@@ -1589,7 +1603,7 @@ declare class BitfabFunction {
1589
1603
  /**
1590
1604
  * SDK version from package.json (injected at build time)
1591
1605
  */
1592
- declare const __version__ = "0.28.0";
1606
+ declare const __version__ = "0.28.2";
1593
1607
 
1594
1608
  /**
1595
1609
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -14,12 +14,12 @@ import {
14
14
  flushTraces,
15
15
  getCurrentSpan,
16
16
  getCurrentTrace
17
- } from "./chunk-RS5Z6YXY.js";
17
+ } from "./chunk-NZFPJRD3.js";
18
18
  import {
19
19
  BITFAB_PROGRESS_PREFIX,
20
20
  BitfabError,
21
21
  reportReplayProgress
22
- } from "./chunk-MD4XQGAF.js";
22
+ } from "./chunk-3PCOUZZP.js";
23
23
  export {
24
24
  BITFAB_PROGRESS_PREFIX,
25
25
  Bitfab,
package/dist/node.cjs CHANGED
@@ -358,7 +358,7 @@ function buildMockTree(rootNode) {
358
358
  function walk(node) {
359
359
  const key = node.traceFunctionKey;
360
360
  if (key) {
361
- const name = node.spanName;
361
+ const name = node.spanName || key;
362
362
  const counterKey = `${key}:${name}`;
363
363
  const index = counters.get(counterKey) ?? 0;
364
364
  counters.set(counterKey, index + 1);
@@ -536,6 +536,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
536
536
  }
537
537
  try {
538
538
  options?.onProgress?.({
539
+ testRunId,
539
540
  completed,
540
541
  total,
541
542
  succeeded,
@@ -545,8 +546,15 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
545
546
  // that just settled. The item's own traceId is the new replay
546
547
  // trace and is assigned later (below), so use the server item.
547
548
  traceId: serverItems[index]?.traceId ?? null,
549
+ replayTraceId: item.traceId,
550
+ input: item.input,
551
+ result: item.result,
552
+ originalOutput: item.originalOutput,
548
553
  error: item.error,
549
- durationMs: item.durationMs
554
+ durationMs: item.durationMs,
555
+ tokens: item.tokens,
556
+ model: item.model,
557
+ dbSnapshotRef: item.dbSnapshotRef
550
558
  }
551
559
  });
552
560
  } catch {
@@ -650,7 +658,7 @@ registerAsyncLocalStorageClass(
650
658
  );
651
659
 
652
660
  // src/version.generated.ts
653
- var __version__ = "0.28.0";
661
+ var __version__ = "0.28.2";
654
662
 
655
663
  // src/constants.ts
656
664
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";