bitfab 0.50.0 → 0.51.0

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
@@ -556,7 +556,7 @@ declare class HttpClient {
556
556
  * Start a replay session by fetching historical traces.
557
557
  * Blocking call - creates a test run and returns lightweight item references.
558
558
  */
559
- startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetId?: string, graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean): Promise<StartReplayResponse>;
559
+ startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean): Promise<StartReplayResponse>;
560
560
  /**
561
561
  * Fetch an external span by ID.
562
562
  * Blocking GET request.
@@ -1645,12 +1645,15 @@ interface DbBranchOptions {
1645
1645
  interface ReplayOptions {
1646
1646
  /**
1647
1647
  * Maximum number of traces to replay (1-5,000, default 5). Ignored when
1648
- * `traceIds` is passed (with a warning), or when `datasetId` is passed,
1649
- * because either source already determines how many traces replay.
1648
+ * `traceIds` is passed (with a warning), or when `datasetId` / `datasetIds`
1649
+ * is passed, because either source already determines how many traces replay.
1650
1650
  */
1651
1651
  limit?: number;
1652
1652
  attempts?: number;
1653
- /** Optional list of specific trace IDs to replay (max 100). Mutually exclusive with `datasetId`. */
1653
+ /**
1654
+ * Optional list of specific trace IDs to replay (max 100). Mutually exclusive
1655
+ * with `datasetId` and `datasetIds`.
1656
+ */
1654
1657
  traceIds?: string[];
1655
1658
  /** Optional display name for the resulting experiment/test run. */
1656
1659
  name?: string;
@@ -1707,13 +1710,14 @@ interface ReplayOptions {
1707
1710
  /** Group ID to associate this replay with an experiment group for live streaming in Studio. */
1708
1711
  experimentGroupId?: string;
1709
1712
  /**
1710
- * Dataset this replay runs against. Mutually exclusive with `traceIds`. When
1711
- * set, the resulting experiment is
1713
+ * Dataset this replay runs against. Mutually exclusive with `traceIds` and
1714
+ * with `datasetIds`. When set, the resulting experiment is
1712
1715
  * durably attributed to the dataset (stored on the test run), so it appears
1713
1716
  * under the dataset's experiments even if the trace lineage can't be
1714
1717
  * reconstructed. Validated server-side against the org.
1715
1718
  */
1716
1719
  datasetId?: string;
1720
+ datasetIds?: string[];
1717
1721
  /**
1718
1722
  * Graders to attach directly to this experiment (test run), independent of any
1719
1723
  * graders already on the dataset. The resulting experiment is graded by the
@@ -1726,7 +1730,7 @@ interface ReplayOptions {
1726
1730
  /**
1727
1731
  * Replay only the selected traces that carry at least one assertion.
1728
1732
  *
1729
- * Narrows whatever `limit`, `traceIds` or `datasetId` selected, so a run that
1733
+ * Narrows whatever `limit`, `traceIds` or `datasetIds` selected, so a run that
1730
1734
  * measures assertion outcomes does not pay to re-execute traces nothing can
1731
1735
  * grade. The server applies it as part of selection, which is what makes it
1732
1736
  * compose with `limit`: `{ limit: 10, onlyWithAssertions: true }` is the ten
@@ -3275,7 +3279,7 @@ declare class BitfabFunction {
3275
3279
  /**
3276
3280
  * SDK version from package.json (injected at build time)
3277
3281
  */
3278
- declare const __version__ = "0.50.0";
3282
+ declare const __version__ = "0.51.0";
3279
3283
 
3280
3284
  /**
3281
3285
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -556,7 +556,7 @@ declare class HttpClient {
556
556
  * Start a replay session by fetching historical traces.
557
557
  * Blocking call - creates a test run and returns lightweight item references.
558
558
  */
559
- startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetId?: string, graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean): Promise<StartReplayResponse>;
559
+ startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean): Promise<StartReplayResponse>;
560
560
  /**
561
561
  * Fetch an external span by ID.
562
562
  * Blocking GET request.
@@ -1645,12 +1645,15 @@ interface DbBranchOptions {
1645
1645
  interface ReplayOptions {
1646
1646
  /**
1647
1647
  * Maximum number of traces to replay (1-5,000, default 5). Ignored when
1648
- * `traceIds` is passed (with a warning), or when `datasetId` is passed,
1649
- * because either source already determines how many traces replay.
1648
+ * `traceIds` is passed (with a warning), or when `datasetId` / `datasetIds`
1649
+ * is passed, because either source already determines how many traces replay.
1650
1650
  */
1651
1651
  limit?: number;
1652
1652
  attempts?: number;
1653
- /** Optional list of specific trace IDs to replay (max 100). Mutually exclusive with `datasetId`. */
1653
+ /**
1654
+ * Optional list of specific trace IDs to replay (max 100). Mutually exclusive
1655
+ * with `datasetId` and `datasetIds`.
1656
+ */
1654
1657
  traceIds?: string[];
1655
1658
  /** Optional display name for the resulting experiment/test run. */
1656
1659
  name?: string;
@@ -1707,13 +1710,14 @@ interface ReplayOptions {
1707
1710
  /** Group ID to associate this replay with an experiment group for live streaming in Studio. */
1708
1711
  experimentGroupId?: string;
1709
1712
  /**
1710
- * Dataset this replay runs against. Mutually exclusive with `traceIds`. When
1711
- * set, the resulting experiment is
1713
+ * Dataset this replay runs against. Mutually exclusive with `traceIds` and
1714
+ * with `datasetIds`. When set, the resulting experiment is
1712
1715
  * durably attributed to the dataset (stored on the test run), so it appears
1713
1716
  * under the dataset's experiments even if the trace lineage can't be
1714
1717
  * reconstructed. Validated server-side against the org.
1715
1718
  */
1716
1719
  datasetId?: string;
1720
+ datasetIds?: string[];
1717
1721
  /**
1718
1722
  * Graders to attach directly to this experiment (test run), independent of any
1719
1723
  * graders already on the dataset. The resulting experiment is graded by the
@@ -1726,7 +1730,7 @@ interface ReplayOptions {
1726
1730
  /**
1727
1731
  * Replay only the selected traces that carry at least one assertion.
1728
1732
  *
1729
- * Narrows whatever `limit`, `traceIds` or `datasetId` selected, so a run that
1733
+ * Narrows whatever `limit`, `traceIds` or `datasetIds` selected, so a run that
1730
1734
  * measures assertion outcomes does not pay to re-execute traces nothing can
1731
1735
  * grade. The server applies it as part of selection, which is what makes it
1732
1736
  * compose with `limit`: `{ limit: 10, onlyWithAssertions: true }` is the ten
@@ -3275,7 +3279,7 @@ declare class BitfabFunction {
3275
3279
  /**
3276
3280
  * SDK version from package.json (injected at build time)
3277
3281
  */
3278
- declare const __version__ = "0.50.0";
3282
+ declare const __version__ = "0.51.0";
3279
3283
 
3280
3284
  /**
3281
3285
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  getCurrentSpan,
28
28
  getCurrentTrace,
29
29
  seedFromRegistry
30
- } from "./chunk-NHT7BLPJ.js";
30
+ } from "./chunk-2RAX75MI.js";
31
31
  import "./chunk-ZUD7OFYB.js";
32
32
  import {
33
33
  BITFAB_PROGRESS_PREFIX,
@@ -36,7 +36,7 @@ import {
36
36
  ReplayError,
37
37
  reportReplayProgress,
38
38
  serializeReplayResult
39
- } from "./chunk-SXHG2H6U.js";
39
+ } from "./chunk-TCOMLVHK.js";
40
40
  import {
41
41
  BitfabError,
42
42
  DEFAULT_SERVICE_URL,
@@ -44,7 +44,7 @@ import {
44
44
  MixedTracingError,
45
45
  __version__,
46
46
  flushTraces
47
- } from "./chunk-WKSZSBRQ.js";
47
+ } from "./chunk-4Z5FCOMO.js";
48
48
  import "./chunk-H6LZRFMN.js";
49
49
  export {
50
50
  BITFAB_PROGRESS_PREFIX,
package/dist/node.cjs CHANGED
@@ -97,7 +97,7 @@ var __version__, __packageName__;
97
97
  var init_version_generated = __esm({
98
98
  "src/version.generated.ts"() {
99
99
  "use strict";
100
- __version__ = "0.50.0";
100
+ __version__ = "0.51.0";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -1863,7 +1863,7 @@ var init_http = __esm({
1863
1863
  * Start a replay session by fetching historical traces.
1864
1864
  * Blocking call - creates a test run and returns lightweight item references.
1865
1865
  */
1866
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetId, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
1866
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
1867
1867
  const payload = { traceFunctionKey };
1868
1868
  if (limit !== void 0) {
1869
1869
  payload.limit = limit;
@@ -1887,8 +1887,12 @@ var init_http = __esm({
1887
1887
  if (experimentGroupId !== void 0) {
1888
1888
  payload.experimentGroupId = experimentGroupId;
1889
1889
  }
1890
- if (datasetId !== void 0) {
1891
- payload.datasetId = datasetId;
1890
+ if (datasetIds !== void 0) {
1891
+ if (datasetIds.length === 1) {
1892
+ payload.datasetId = datasetIds[0];
1893
+ } else {
1894
+ payload.datasetIds = datasetIds;
1895
+ }
1892
1896
  }
1893
1897
  if (graderIds !== void 0) {
1894
1898
  payload.graderIds = graderIds;
@@ -2490,6 +2494,23 @@ function resolveAttempts(attempts) {
2490
2494
  }
2491
2495
  return attempts;
2492
2496
  }
2497
+ function resolveDatasetIds(options) {
2498
+ if (options?.datasetId !== void 0 && options?.datasetIds !== void 0) {
2499
+ throw new BitfabError(
2500
+ "datasetId and datasetIds are the same selector: pass one dataset through datasetId, or several through datasetIds."
2501
+ );
2502
+ }
2503
+ if (options?.datasetId !== void 0) {
2504
+ return [options.datasetId];
2505
+ }
2506
+ if (options?.datasetIds === void 0) {
2507
+ return void 0;
2508
+ }
2509
+ if (options.datasetIds.length === 0) {
2510
+ throw new BitfabError("datasetIds must contain at least one dataset ID.");
2511
+ }
2512
+ return [...new Set(options.datasetIds)];
2513
+ }
2493
2514
  function dbBranchEnabled(dbBranch) {
2494
2515
  return dbBranch !== void 0 && dbBranch !== false;
2495
2516
  }
@@ -2922,9 +2943,10 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2922
2943
  );
2923
2944
  }
2924
2945
  }
2925
- if (options?.traceIds !== void 0 && options?.datasetId !== void 0) {
2946
+ const datasetIds = resolveDatasetIds(options);
2947
+ if (options?.traceIds !== void 0 && datasetIds !== void 0) {
2926
2948
  throw new BitfabError(
2927
- "traceIds and datasetId select different replay sources and cannot be used together."
2949
+ "traceIds and datasetIds select different replay sources and cannot be used together."
2928
2950
  );
2929
2951
  }
2930
2952
  if (options?.limit !== void 0 && options?.traceIds !== void 0) {
@@ -2966,7 +2988,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2966
2988
  // before it could report its resolved inputs.
2967
2989
  dbBranchEnabled(options?.dbBranch) && options?.dryRun !== true,
2968
2990
  options?.experimentGroupId,
2969
- options?.datasetId,
2991
+ datasetIds,
2970
2992
  options?.graderIds,
2971
2993
  resolveDbBranchSettings(options?.dbBranch),
2972
2994
  attempts,