@bitfab/sdk 0.50.0 → 0.52.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.
@@ -802,11 +802,19 @@ type TraceAssertionsResult = {
802
802
  assertions: TraceAssertion[];
803
803
  inheritedFrom: string | null;
804
804
  };
805
+ type TraceAssertionsUpdate = {
806
+ traceId: string;
807
+ assertions: SaveAssertion[];
808
+ };
805
809
  type SaveAssertionsParams = {
806
810
  traceId: string;
807
811
  assertions: SaveAssertion[];
808
812
  source?: TraceAssertionSource;
809
813
  };
814
+ type SaveAssertionsAllParams = {
815
+ updates: TraceAssertionsUpdate[];
816
+ source?: TraceAssertionSource;
817
+ };
810
818
  type ArchiveAssertionsParams = {
811
819
  traceId: string;
812
820
  assertionIds: string[];
@@ -816,6 +824,7 @@ declare class TracesClient {
816
824
  constructor(httpClient: HttpClient);
817
825
  getAssertions(traceId: string): Promise<TraceAssertionsResult>;
818
826
  saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
827
+ saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
819
828
  archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
820
829
  }
821
830
 
@@ -1645,12 +1654,15 @@ interface DbBranchOptions {
1645
1654
  interface ReplayOptions {
1646
1655
  /**
1647
1656
  * 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.
1657
+ * `traceIds` is passed (with a warning), or when `datasetId` / `datasetIds`
1658
+ * is passed, because either source already determines how many traces replay.
1650
1659
  */
1651
1660
  limit?: number;
1652
1661
  attempts?: number;
1653
- /** Optional list of specific trace IDs to replay (max 100). Mutually exclusive with `datasetId`. */
1662
+ /**
1663
+ * Optional list of specific trace IDs to replay (max 100). Mutually exclusive
1664
+ * with `datasetId` and `datasetIds`.
1665
+ */
1654
1666
  traceIds?: string[];
1655
1667
  /** Optional display name for the resulting experiment/test run. */
1656
1668
  name?: string;
@@ -1707,13 +1719,14 @@ interface ReplayOptions {
1707
1719
  /** Group ID to associate this replay with an experiment group for live streaming in Studio. */
1708
1720
  experimentGroupId?: string;
1709
1721
  /**
1710
- * Dataset this replay runs against. Mutually exclusive with `traceIds`. When
1711
- * set, the resulting experiment is
1722
+ * Dataset this replay runs against. Mutually exclusive with `traceIds` and
1723
+ * with `datasetIds`. When set, the resulting experiment is
1712
1724
  * durably attributed to the dataset (stored on the test run), so it appears
1713
1725
  * under the dataset's experiments even if the trace lineage can't be
1714
1726
  * reconstructed. Validated server-side against the org.
1715
1727
  */
1716
1728
  datasetId?: string;
1729
+ datasetIds?: string[];
1717
1730
  /**
1718
1731
  * Graders to attach directly to this experiment (test run), independent of any
1719
1732
  * graders already on the dataset. The resulting experiment is graded by the
@@ -1726,7 +1739,7 @@ interface ReplayOptions {
1726
1739
  /**
1727
1740
  * Replay only the selected traces that carry at least one assertion.
1728
1741
  *
1729
- * Narrows whatever `limit`, `traceIds` or `datasetId` selected, so a run that
1742
+ * Narrows whatever `limit`, `traceIds` or `datasetIds` selected, so a run that
1730
1743
  * measures assertion outcomes does not pay to re-execute traces nothing can
1731
1744
  * grade. The server applies it as part of selection, which is what makes it
1732
1745
  * compose with `limit`: `{ limit: 10, onlyWithAssertions: true }` is the ten
@@ -3275,7 +3288,7 @@ declare class BitfabFunction {
3275
3288
  /**
3276
3289
  * SDK version from package.json (injected at build time)
3277
3290
  */
3278
- declare const __version__ = "0.50.0";
3291
+ declare const __version__ = "0.52.0";
3279
3292
 
3280
3293
  /**
3281
3294
  * Constants for the Bitfab SDK.
@@ -3405,4 +3418,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3405
3418
  run?: boolean;
3406
3419
  }): Promise<SeedResult>;
3407
3420
 
3408
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, type AssertionVerdict, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
3421
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, type AssertionVerdict, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
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.
@@ -802,11 +802,19 @@ type TraceAssertionsResult = {
802
802
  assertions: TraceAssertion[];
803
803
  inheritedFrom: string | null;
804
804
  };
805
+ type TraceAssertionsUpdate = {
806
+ traceId: string;
807
+ assertions: SaveAssertion[];
808
+ };
805
809
  type SaveAssertionsParams = {
806
810
  traceId: string;
807
811
  assertions: SaveAssertion[];
808
812
  source?: TraceAssertionSource;
809
813
  };
814
+ type SaveAssertionsAllParams = {
815
+ updates: TraceAssertionsUpdate[];
816
+ source?: TraceAssertionSource;
817
+ };
810
818
  type ArchiveAssertionsParams = {
811
819
  traceId: string;
812
820
  assertionIds: string[];
@@ -816,6 +824,7 @@ declare class TracesClient {
816
824
  constructor(httpClient: HttpClient);
817
825
  getAssertions(traceId: string): Promise<TraceAssertionsResult>;
818
826
  saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
827
+ saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
819
828
  archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
820
829
  }
821
830
 
@@ -1645,12 +1654,15 @@ interface DbBranchOptions {
1645
1654
  interface ReplayOptions {
1646
1655
  /**
1647
1656
  * 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.
1657
+ * `traceIds` is passed (with a warning), or when `datasetId` / `datasetIds`
1658
+ * is passed, because either source already determines how many traces replay.
1650
1659
  */
1651
1660
  limit?: number;
1652
1661
  attempts?: number;
1653
- /** Optional list of specific trace IDs to replay (max 100). Mutually exclusive with `datasetId`. */
1662
+ /**
1663
+ * Optional list of specific trace IDs to replay (max 100). Mutually exclusive
1664
+ * with `datasetId` and `datasetIds`.
1665
+ */
1654
1666
  traceIds?: string[];
1655
1667
  /** Optional display name for the resulting experiment/test run. */
1656
1668
  name?: string;
@@ -1707,13 +1719,14 @@ interface ReplayOptions {
1707
1719
  /** Group ID to associate this replay with an experiment group for live streaming in Studio. */
1708
1720
  experimentGroupId?: string;
1709
1721
  /**
1710
- * Dataset this replay runs against. Mutually exclusive with `traceIds`. When
1711
- * set, the resulting experiment is
1722
+ * Dataset this replay runs against. Mutually exclusive with `traceIds` and
1723
+ * with `datasetIds`. When set, the resulting experiment is
1712
1724
  * durably attributed to the dataset (stored on the test run), so it appears
1713
1725
  * under the dataset's experiments even if the trace lineage can't be
1714
1726
  * reconstructed. Validated server-side against the org.
1715
1727
  */
1716
1728
  datasetId?: string;
1729
+ datasetIds?: string[];
1717
1730
  /**
1718
1731
  * Graders to attach directly to this experiment (test run), independent of any
1719
1732
  * graders already on the dataset. The resulting experiment is graded by the
@@ -1726,7 +1739,7 @@ interface ReplayOptions {
1726
1739
  /**
1727
1740
  * Replay only the selected traces that carry at least one assertion.
1728
1741
  *
1729
- * Narrows whatever `limit`, `traceIds` or `datasetId` selected, so a run that
1742
+ * Narrows whatever `limit`, `traceIds` or `datasetIds` selected, so a run that
1730
1743
  * measures assertion outcomes does not pay to re-execute traces nothing can
1731
1744
  * grade. The server applies it as part of selection, which is what makes it
1732
1745
  * compose with `limit`: `{ limit: 10, onlyWithAssertions: true }` is the ten
@@ -3275,7 +3288,7 @@ declare class BitfabFunction {
3275
3288
  /**
3276
3289
  * SDK version from package.json (injected at build time)
3277
3290
  */
3278
- declare const __version__ = "0.50.0";
3291
+ declare const __version__ = "0.52.0";
3279
3292
 
3280
3293
  /**
3281
3294
  * Constants for the Bitfab SDK.
@@ -3405,4 +3418,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3405
3418
  run?: boolean;
3406
3419
  }): Promise<SeedResult>;
3407
3420
 
3408
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, type AssertionVerdict, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
3421
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, type AssertionVerdict, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  getCurrentSpan,
19
19
  getCurrentTrace,
20
20
  seedFromRegistry
21
- } from "./chunk-BT4RNCQL.js";
21
+ } from "./chunk-VEDTNQQE.js";
22
22
  import "./chunk-ZUD7OFYB.js";
23
23
  import {
24
24
  BITFAB_PROGRESS_PREFIX,
@@ -27,7 +27,7 @@ import {
27
27
  ReplayError,
28
28
  reportReplayProgress,
29
29
  serializeReplayResult
30
- } from "./chunk-6LG3OFIX.js";
30
+ } from "./chunk-SJ65MW4K.js";
31
31
  import {
32
32
  BitfabError,
33
33
  DEFAULT_SERVICE_URL,
@@ -35,7 +35,7 @@ import {
35
35
  MixedTracingError,
36
36
  __version__,
37
37
  flushTraces
38
- } from "./chunk-XZDYNFI5.js";
38
+ } from "./chunk-4EOEBN3M.js";
39
39
  import "./chunk-H6LZRFMN.js";
40
40
  export {
41
41
  BITFAB_PROGRESS_PREFIX,
package/dist/node.cjs CHANGED
@@ -88,7 +88,7 @@ var __version__, __packageName__;
88
88
  var init_version_generated = __esm({
89
89
  "src/version.generated.ts"() {
90
90
  "use strict";
91
- __version__ = "0.50.0";
91
+ __version__ = "0.52.0";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -1854,7 +1854,7 @@ var init_http = __esm({
1854
1854
  * Start a replay session by fetching historical traces.
1855
1855
  * Blocking call - creates a test run and returns lightweight item references.
1856
1856
  */
1857
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetId, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
1857
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
1858
1858
  const payload = { traceFunctionKey };
1859
1859
  if (limit !== void 0) {
1860
1860
  payload.limit = limit;
@@ -1878,8 +1878,12 @@ var init_http = __esm({
1878
1878
  if (experimentGroupId !== void 0) {
1879
1879
  payload.experimentGroupId = experimentGroupId;
1880
1880
  }
1881
- if (datasetId !== void 0) {
1882
- payload.datasetId = datasetId;
1881
+ if (datasetIds !== void 0) {
1882
+ if (datasetIds.length === 1) {
1883
+ payload.datasetId = datasetIds[0];
1884
+ } else {
1885
+ payload.datasetIds = datasetIds;
1886
+ }
1883
1887
  }
1884
1888
  if (graderIds !== void 0) {
1885
1889
  payload.graderIds = graderIds;
@@ -2481,6 +2485,23 @@ function resolveAttempts(attempts) {
2481
2485
  }
2482
2486
  return attempts;
2483
2487
  }
2488
+ function resolveDatasetIds(options) {
2489
+ if (options?.datasetId !== void 0 && options?.datasetIds !== void 0) {
2490
+ throw new BitfabError(
2491
+ "datasetId and datasetIds are the same selector: pass one dataset through datasetId, or several through datasetIds."
2492
+ );
2493
+ }
2494
+ if (options?.datasetId !== void 0) {
2495
+ return [options.datasetId];
2496
+ }
2497
+ if (options?.datasetIds === void 0) {
2498
+ return void 0;
2499
+ }
2500
+ if (options.datasetIds.length === 0) {
2501
+ throw new BitfabError("datasetIds must contain at least one dataset ID.");
2502
+ }
2503
+ return [...new Set(options.datasetIds)];
2504
+ }
2484
2505
  function dbBranchEnabled(dbBranch) {
2485
2506
  return dbBranch !== void 0 && dbBranch !== false;
2486
2507
  }
@@ -2913,9 +2934,10 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2913
2934
  );
2914
2935
  }
2915
2936
  }
2916
- if (options?.traceIds !== void 0 && options?.datasetId !== void 0) {
2937
+ const datasetIds = resolveDatasetIds(options);
2938
+ if (options?.traceIds !== void 0 && datasetIds !== void 0) {
2917
2939
  throw new BitfabError(
2918
- "traceIds and datasetId select different replay sources and cannot be used together."
2940
+ "traceIds and datasetIds select different replay sources and cannot be used together."
2919
2941
  );
2920
2942
  }
2921
2943
  if (options?.limit !== void 0 && options?.traceIds !== void 0) {
@@ -2957,7 +2979,7 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2957
2979
  // before it could report its resolved inputs.
2958
2980
  dbBranchEnabled(options?.dbBranch) && options?.dryRun !== true,
2959
2981
  options?.experimentGroupId,
2960
- options?.datasetId,
2982
+ datasetIds,
2961
2983
  options?.graderIds,
2962
2984
  resolveDbBranchSettings(options?.dbBranch),
2963
2985
  attempts,
@@ -3308,7 +3330,8 @@ registerAsyncLocalStorageClass(
3308
3330
  );
3309
3331
 
3310
3332
  // src/assertions.ts
3311
- function expectationsPath(traceId, suffix = "") {
3333
+ var ASSERTIONS_PATH = "/api/sdk/traces/assertions";
3334
+ function traceAssertionsPath(traceId, suffix = "") {
3312
3335
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
3313
3336
  }
3314
3337
  var TracesClient = class {
@@ -3316,18 +3339,29 @@ var TracesClient = class {
3316
3339
  this.httpClient = httpClient;
3317
3340
  }
3318
3341
  async getAssertions(traceId) {
3319
- return this.httpClient.get(expectationsPath(traceId));
3342
+ return this.httpClient.get(
3343
+ traceAssertionsPath(traceId)
3344
+ );
3320
3345
  }
3321
3346
  async saveAssertions(params) {
3322
- const response = await this.httpClient.request(expectationsPath(params.traceId), {
3323
- assertions: params.assertions,
3347
+ return this.saveAssertionsAll({
3348
+ updates: [{ traceId: params.traceId, assertions: params.assertions }],
3349
+ source: params.source
3350
+ });
3351
+ }
3352
+ async saveAssertionsAll(params) {
3353
+ if (params.updates.length === 0) {
3354
+ return [];
3355
+ }
3356
+ const response = await this.httpClient.request(ASSERTIONS_PATH, {
3357
+ updates: params.updates,
3324
3358
  source: params.source ?? "agent"
3325
3359
  });
3326
3360
  return response.assertions;
3327
3361
  }
3328
3362
  async archiveAssertions(params) {
3329
3363
  const response = await this.httpClient.request(
3330
- expectationsPath(params.traceId, "/archive"),
3364
+ traceAssertionsPath(params.traceId, "/archive"),
3331
3365
  { assertionIds: params.assertionIds }
3332
3366
  );
3333
3367
  return response.archived;