@bitfab/sdk 0.47.0 → 0.50.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): Promise<StartReplayResponse>;
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>;
560
560
  /**
561
561
  * Fetch an external span by ID.
562
562
  * Blocking GET request.
@@ -1259,6 +1259,8 @@ declare class DatasetsClient {
1259
1259
 
1260
1260
  type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
1261
1261
  type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
1262
+ type LabelStatus = "labeled" | "skipped" | "unlabeled";
1263
+ type LabelSource = "human" | "agent";
1262
1264
  type LabelTarget = ({
1263
1265
  traceId: string;
1264
1266
  originalTraceId?: never;
@@ -1285,11 +1287,72 @@ type LabelOutcome = {
1285
1287
  traceId: string;
1286
1288
  action: LabelAction;
1287
1289
  };
1290
+ type HumanLabelUpdate = {
1291
+ traceId: string;
1292
+ assertionId?: string;
1293
+ label: boolean;
1294
+ annotation: string;
1295
+ confidence?: LabelConfidence;
1296
+ };
1297
+ type HumanLabelOutcome = {
1298
+ traceId: string;
1299
+ assertionId: string | null;
1300
+ label: boolean;
1301
+ action: "set";
1302
+ };
1303
+ type AssertionVerdict = {
1304
+ assertionId: string;
1305
+ assertion: string | null;
1306
+ labelStatus: LabelStatus;
1307
+ label: boolean | null;
1308
+ annotation: string | null;
1309
+ confidence: LabelConfidence | null;
1310
+ labelSource: LabelSource;
1311
+ approved: boolean;
1312
+ };
1313
+ type TraceLabels = {
1314
+ traceId: string;
1315
+ labelStatus: LabelStatus;
1316
+ label: boolean | null;
1317
+ annotation: string | null;
1318
+ approved: boolean;
1319
+ passed: number;
1320
+ failed: number;
1321
+ assertions: AssertionVerdict[];
1322
+ };
1288
1323
  declare class LabelsClient {
1289
1324
  private readonly httpClient;
1290
1325
  constructor(httpClient: HttpClient);
1291
1326
  save(update: LabelUpdate, testRunId?: string): Promise<LabelOutcome>;
1292
1327
  saveAll(updates: LabelUpdate[], testRunId?: string): Promise<LabelOutcome[]>;
1328
+ saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
1329
+ saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
1330
+ get(traceId: string): Promise<TraceLabels | null>;
1331
+ getAll(traceIds: string[]): Promise<TraceLabels[]>;
1332
+ }
1333
+
1334
+ type GraderLabelSource = "human" | "live_grader";
1335
+ type GraderLabel = {
1336
+ traceId: string;
1337
+ graderId: string;
1338
+ graderName: string | null;
1339
+ graderStatus: string;
1340
+ label: boolean | null;
1341
+ labelReason: string | null;
1342
+ failureDiagnostic: string | null;
1343
+ labelConfidence: LabelConfidence | null;
1344
+ source: GraderLabelSource;
1345
+ evaluatedAt: string | null;
1346
+ };
1347
+ type GetGraderLabelsParams = {
1348
+ traceIds?: string[];
1349
+ graderId?: string;
1350
+ limit?: number;
1351
+ };
1352
+ declare class GradersClient {
1353
+ private readonly httpClient;
1354
+ constructor(httpClient: HttpClient);
1355
+ getLabels(params: GetGraderLabelsParams): Promise<GraderLabel[]>;
1293
1356
  }
1294
1357
 
1295
1358
  /**
@@ -1660,6 +1723,18 @@ interface ReplayOptions {
1660
1723
  * organization and trace function, otherwise the server rejects the replay.
1661
1724
  */
1662
1725
  graderIds?: string[];
1726
+ /**
1727
+ * Replay only the selected traces that carry at least one assertion.
1728
+ *
1729
+ * Narrows whatever `limit`, `traceIds` or `datasetId` selected, so a run that
1730
+ * measures assertion outcomes does not pay to re-execute traces nothing can
1731
+ * grade. The server applies it as part of selection, which is what makes it
1732
+ * compose with `limit`: `{ limit: 10, onlyWithAssertions: true }` is the ten
1733
+ * most recent traces that HAVE assertions, not the ten most recent filtered
1734
+ * down to however few do. An archived assertion does not count, and a
1735
+ * selection that narrows to nothing replays nothing.
1736
+ */
1737
+ onlyWithAssertions?: boolean;
1663
1738
  /**
1664
1739
  * Reshape recorded inputs before they are spread into `fn`.
1665
1740
  *
@@ -2554,6 +2629,7 @@ declare class Bitfab {
2554
2629
  readonly datasets: DatasetsClient;
2555
2630
  readonly traces: TracesClient;
2556
2631
  readonly labels: LabelsClient;
2632
+ readonly graders: GradersClient;
2557
2633
  private readonly bamlClient;
2558
2634
  private readonly dbSnapshot;
2559
2635
  private readonly autoTracePolicyRefreshes;
@@ -3199,7 +3275,7 @@ declare class BitfabFunction {
3199
3275
  /**
3200
3276
  * SDK version from package.json (injected at build time)
3201
3277
  */
3202
- declare const __version__ = "0.47.0";
3278
+ declare const __version__ = "0.50.0";
3203
3279
 
3204
3280
  /**
3205
3281
  * Constants for the Bitfab SDK.
@@ -3329,4 +3405,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3329
3405
  run?: boolean;
3330
3406
  }): Promise<SeedResult>;
3331
3407
 
3332
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, 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 GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LabelAction, type LabelConfidence, type LabelOutcome, 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 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 };
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 };
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): Promise<StartReplayResponse>;
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>;
560
560
  /**
561
561
  * Fetch an external span by ID.
562
562
  * Blocking GET request.
@@ -1259,6 +1259,8 @@ declare class DatasetsClient {
1259
1259
 
1260
1260
  type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
1261
1261
  type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
1262
+ type LabelStatus = "labeled" | "skipped" | "unlabeled";
1263
+ type LabelSource = "human" | "agent";
1262
1264
  type LabelTarget = ({
1263
1265
  traceId: string;
1264
1266
  originalTraceId?: never;
@@ -1285,11 +1287,72 @@ type LabelOutcome = {
1285
1287
  traceId: string;
1286
1288
  action: LabelAction;
1287
1289
  };
1290
+ type HumanLabelUpdate = {
1291
+ traceId: string;
1292
+ assertionId?: string;
1293
+ label: boolean;
1294
+ annotation: string;
1295
+ confidence?: LabelConfidence;
1296
+ };
1297
+ type HumanLabelOutcome = {
1298
+ traceId: string;
1299
+ assertionId: string | null;
1300
+ label: boolean;
1301
+ action: "set";
1302
+ };
1303
+ type AssertionVerdict = {
1304
+ assertionId: string;
1305
+ assertion: string | null;
1306
+ labelStatus: LabelStatus;
1307
+ label: boolean | null;
1308
+ annotation: string | null;
1309
+ confidence: LabelConfidence | null;
1310
+ labelSource: LabelSource;
1311
+ approved: boolean;
1312
+ };
1313
+ type TraceLabels = {
1314
+ traceId: string;
1315
+ labelStatus: LabelStatus;
1316
+ label: boolean | null;
1317
+ annotation: string | null;
1318
+ approved: boolean;
1319
+ passed: number;
1320
+ failed: number;
1321
+ assertions: AssertionVerdict[];
1322
+ };
1288
1323
  declare class LabelsClient {
1289
1324
  private readonly httpClient;
1290
1325
  constructor(httpClient: HttpClient);
1291
1326
  save(update: LabelUpdate, testRunId?: string): Promise<LabelOutcome>;
1292
1327
  saveAll(updates: LabelUpdate[], testRunId?: string): Promise<LabelOutcome[]>;
1328
+ saveHuman(update: HumanLabelUpdate): Promise<HumanLabelOutcome>;
1329
+ saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
1330
+ get(traceId: string): Promise<TraceLabels | null>;
1331
+ getAll(traceIds: string[]): Promise<TraceLabels[]>;
1332
+ }
1333
+
1334
+ type GraderLabelSource = "human" | "live_grader";
1335
+ type GraderLabel = {
1336
+ traceId: string;
1337
+ graderId: string;
1338
+ graderName: string | null;
1339
+ graderStatus: string;
1340
+ label: boolean | null;
1341
+ labelReason: string | null;
1342
+ failureDiagnostic: string | null;
1343
+ labelConfidence: LabelConfidence | null;
1344
+ source: GraderLabelSource;
1345
+ evaluatedAt: string | null;
1346
+ };
1347
+ type GetGraderLabelsParams = {
1348
+ traceIds?: string[];
1349
+ graderId?: string;
1350
+ limit?: number;
1351
+ };
1352
+ declare class GradersClient {
1353
+ private readonly httpClient;
1354
+ constructor(httpClient: HttpClient);
1355
+ getLabels(params: GetGraderLabelsParams): Promise<GraderLabel[]>;
1293
1356
  }
1294
1357
 
1295
1358
  /**
@@ -1660,6 +1723,18 @@ interface ReplayOptions {
1660
1723
  * organization and trace function, otherwise the server rejects the replay.
1661
1724
  */
1662
1725
  graderIds?: string[];
1726
+ /**
1727
+ * Replay only the selected traces that carry at least one assertion.
1728
+ *
1729
+ * Narrows whatever `limit`, `traceIds` or `datasetId` selected, so a run that
1730
+ * measures assertion outcomes does not pay to re-execute traces nothing can
1731
+ * grade. The server applies it as part of selection, which is what makes it
1732
+ * compose with `limit`: `{ limit: 10, onlyWithAssertions: true }` is the ten
1733
+ * most recent traces that HAVE assertions, not the ten most recent filtered
1734
+ * down to however few do. An archived assertion does not count, and a
1735
+ * selection that narrows to nothing replays nothing.
1736
+ */
1737
+ onlyWithAssertions?: boolean;
1663
1738
  /**
1664
1739
  * Reshape recorded inputs before they are spread into `fn`.
1665
1740
  *
@@ -2554,6 +2629,7 @@ declare class Bitfab {
2554
2629
  readonly datasets: DatasetsClient;
2555
2630
  readonly traces: TracesClient;
2556
2631
  readonly labels: LabelsClient;
2632
+ readonly graders: GradersClient;
2557
2633
  private readonly bamlClient;
2558
2634
  private readonly dbSnapshot;
2559
2635
  private readonly autoTracePolicyRefreshes;
@@ -3199,7 +3275,7 @@ declare class BitfabFunction {
3199
3275
  /**
3200
3276
  * SDK version from package.json (injected at build time)
3201
3277
  */
3202
- declare const __version__ = "0.47.0";
3278
+ declare const __version__ = "0.50.0";
3203
3279
 
3204
3280
  /**
3205
3281
  * Constants for the Bitfab SDK.
@@ -3329,4 +3405,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3329
3405
  run?: boolean;
3330
3406
  }): Promise<SeedResult>;
3331
3407
 
3332
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, 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 GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LabelAction, type LabelConfidence, type LabelOutcome, 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 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 };
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 };
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  BitfabOpenAITracingProcessor,
9
9
  BitfabVercelAiHandler,
10
10
  DatasetsClient,
11
+ GradersClient,
11
12
  LabelsClient,
12
13
  SUPPORTED_PROVIDERS,
13
14
  TracesClient,
@@ -17,7 +18,7 @@ import {
17
18
  getCurrentSpan,
18
19
  getCurrentTrace,
19
20
  seedFromRegistry
20
- } from "./chunk-LP2CN7SZ.js";
21
+ } from "./chunk-BT4RNCQL.js";
21
22
  import "./chunk-ZUD7OFYB.js";
22
23
  import {
23
24
  BITFAB_PROGRESS_PREFIX,
@@ -26,7 +27,7 @@ import {
26
27
  ReplayError,
27
28
  reportReplayProgress,
28
29
  serializeReplayResult
29
- } from "./chunk-G52ZQTWU.js";
30
+ } from "./chunk-6LG3OFIX.js";
30
31
  import {
31
32
  BitfabError,
32
33
  DEFAULT_SERVICE_URL,
@@ -34,7 +35,7 @@ import {
34
35
  MixedTracingError,
35
36
  __version__,
36
37
  flushTraces
37
- } from "./chunk-YKHZGYAC.js";
38
+ } from "./chunk-XZDYNFI5.js";
38
39
  import "./chunk-H6LZRFMN.js";
39
40
  export {
40
41
  BITFAB_PROGRESS_PREFIX,
@@ -51,6 +52,7 @@ export {
51
52
  DEFAULT_SERVICE_URL,
52
53
  DatasetsClient,
53
54
  DbBranchReplayError,
55
+ GradersClient,
54
56
  HttpClient,
55
57
  LabelsClient,
56
58
  MixedTracingError,
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.47.0";
91
+ __version__ = "0.50.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) {
1857
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetId, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
1858
1858
  const payload = { traceFunctionKey };
1859
1859
  if (limit !== void 0) {
1860
1860
  payload.limit = limit;
@@ -1893,6 +1893,9 @@ var init_http = __esm({
1893
1893
  if (includeOriginalMetadata) {
1894
1894
  payload.includeOriginalMetadata = true;
1895
1895
  }
1896
+ if (onlyWithAssertions) {
1897
+ payload.onlyWithAssertions = true;
1898
+ }
1896
1899
  const timeout = includeDbBranchLease ? REPLAY_DB_BRANCH_REQUEST_TIMEOUT_MS : 3e4;
1897
1900
  return this.request("/api/sdk/replay/start", payload, {
1898
1901
  timeout
@@ -2958,7 +2961,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2958
2961
  options?.graderIds,
2959
2962
  resolveDbBranchSettings(options?.dbBranch),
2960
2963
  attempts,
2961
- options?.adaptInputs !== void 0
2964
+ options?.adaptInputs !== void 0,
2965
+ options?.onlyWithAssertions
2962
2966
  );
2963
2967
  if (serverItems.length === 0) {
2964
2968
  try {
@@ -3275,6 +3279,7 @@ __export(node_exports, {
3275
3279
  DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
3276
3280
  DatasetsClient: () => DatasetsClient,
3277
3281
  DbBranchReplayError: () => DbBranchReplayError,
3282
+ GradersClient: () => GradersClient,
3278
3283
  HttpClient: () => HttpClient,
3279
3284
  LabelsClient: () => LabelsClient,
3280
3285
  MixedTracingError: () => MixedTracingError,
@@ -4577,10 +4582,45 @@ function buildSnapshotRef(config, sdkWallClockBeforeFn) {
4577
4582
 
4578
4583
  // src/client.ts
4579
4584
  init_errors();
4585
+
4586
+ // src/graders.ts
4587
+ init_errors();
4588
+ var GRADER_LABELS_PATH = "/api/sdk/graderLabels";
4589
+ var GradersClient = class {
4590
+ constructor(httpClient) {
4591
+ this.httpClient = httpClient;
4592
+ }
4593
+ async getLabels(params) {
4594
+ const hasTraceIds = params.traceIds !== void 0 && params.traceIds.length > 0;
4595
+ const hasGraderId = params.graderId !== void 0;
4596
+ if (!hasTraceIds && !hasGraderId) {
4597
+ throw new BitfabError(
4598
+ "Pass traceIds, graderId, or both: there is nothing to read otherwise."
4599
+ );
4600
+ }
4601
+ const query = new URLSearchParams();
4602
+ if (params.traceIds !== void 0 && params.traceIds.length > 0) {
4603
+ query.set("traceIds", params.traceIds.join(","));
4604
+ }
4605
+ if (params.graderId !== void 0) {
4606
+ query.set("graderId", params.graderId);
4607
+ }
4608
+ if (params.limit !== void 0) {
4609
+ query.set("limit", String(params.limit));
4610
+ }
4611
+ const response = await this.httpClient.get(
4612
+ `${GRADER_LABELS_PATH}?${query.toString()}`
4613
+ );
4614
+ return response.labels;
4615
+ }
4616
+ };
4617
+
4618
+ // src/client.ts
4580
4619
  init_http();
4581
4620
 
4582
4621
  // src/labels.ts
4583
4622
  var LABELS_PATH = "/api/sdk/traces/labels";
4623
+ var HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
4584
4624
  var LabelsClient = class {
4585
4625
  constructor(httpClient) {
4586
4626
  this.httpClient = httpClient;
@@ -4599,6 +4639,28 @@ var LabelsClient = class {
4599
4639
  );
4600
4640
  return response.labels;
4601
4641
  }
4642
+ async saveHuman(update) {
4643
+ const [outcome] = await this.saveHumanAll([update]);
4644
+ return outcome;
4645
+ }
4646
+ async saveHumanAll(updates) {
4647
+ const response = await this.httpClient.request(HUMAN_LABELS_PATH, { labels: updates });
4648
+ return response.labels;
4649
+ }
4650
+ async get(traceId) {
4651
+ const [labels] = await this.getAll([traceId]);
4652
+ return labels ?? null;
4653
+ }
4654
+ async getAll(traceIds) {
4655
+ if (traceIds.length === 0) {
4656
+ return [];
4657
+ }
4658
+ const query = new URLSearchParams({ traceIds: traceIds.join(",") });
4659
+ const response = await this.httpClient.get(
4660
+ `${LABELS_PATH}?${query.toString()}`
4661
+ );
4662
+ return response.labels;
4663
+ }
4602
4664
  };
4603
4665
 
4604
4666
  // src/langgraph.ts
@@ -6376,6 +6438,7 @@ var Bitfab = class {
6376
6438
  this.datasets = new DatasetsClient(this.httpClient);
6377
6439
  this.traces = new TracesClient(this.httpClient);
6378
6440
  this.labels = new LabelsClient(this.httpClient);
6441
+ this.graders = new GradersClient(this.httpClient);
6379
6442
  }
6380
6443
  /**
6381
6444
  * Decorate a class method as an automatically expanded trace root.
@@ -8280,6 +8343,7 @@ assertAsyncStorageRegistered();
8280
8343
  DEFAULT_SERVICE_URL,
8281
8344
  DatasetsClient,
8282
8345
  DbBranchReplayError,
8346
+ GradersClient,
8283
8347
  HttpClient,
8284
8348
  LabelsClient,
8285
8349
  MixedTracingError,