@bitfab/sdk 0.62.4 → 0.62.6

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.
Files changed (35) hide show
  1. package/cloudReplay.py +374 -125
  2. package/dist/{chunk-RWFSEGYV.js → chunk-76V36XSD.js} +6 -3
  3. package/dist/{chunk-RWFSEGYV.js.map → chunk-76V36XSD.js.map} +1 -1
  4. package/dist/{chunk-5OCYY7L3.js → chunk-MUN7Z5AA.js} +6 -3
  5. package/dist/{chunk-5OCYY7L3.js.map → chunk-MUN7Z5AA.js.map} +1 -1
  6. package/dist/{chunk-TUUW3GO7.js → chunk-NFZOXIBD.js} +21 -3
  7. package/dist/chunk-NFZOXIBD.js.map +1 -0
  8. package/dist/{chunk-JJB7IIJ6.js → chunk-NY7AOJAS.js} +78 -6
  9. package/dist/chunk-NY7AOJAS.js.map +1 -0
  10. package/dist/{chunk-ORLA7356.js → chunk-THZ34ROP.js} +4 -3
  11. package/dist/chunk-THZ34ROP.js.map +1 -0
  12. package/dist/{http-GCA6TXVO.js → http-MBLTSPM3.js} +2 -2
  13. package/dist/{http-76MIRRRJ.js → http-XN22RMH6.js} +2 -2
  14. package/dist/index.cjs +80 -3
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +113 -3
  17. package/dist/index.d.ts +113 -3
  18. package/dist/index.js +5 -3
  19. package/dist/node.cjs +80 -3
  20. package/dist/node.cjs.map +1 -1
  21. package/dist/node.d.cts +1 -1
  22. package/dist/node.d.ts +1 -1
  23. package/dist/node.js +5 -3
  24. package/dist/node.js.map +1 -1
  25. package/dist/{replay-P5IXIFNC.js → replay-NS7XCL7L.js} +3 -3
  26. package/dist/replayCli.js +3 -3
  27. package/dist/replayCli.js.map +1 -1
  28. package/dist/seedCli.js +2 -2
  29. package/package.json +1 -1
  30. package/dist/chunk-JJB7IIJ6.js.map +0 -1
  31. package/dist/chunk-ORLA7356.js.map +0 -1
  32. package/dist/chunk-TUUW3GO7.js.map +0 -1
  33. /package/dist/{http-76MIRRRJ.js.map → http-MBLTSPM3.js.map} +0 -0
  34. /package/dist/{http-GCA6TXVO.js.map → http-XN22RMH6.js.map} +0 -0
  35. /package/dist/{replay-P5IXIFNC.js.map → replay-NS7XCL7L.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -697,7 +697,7 @@ declare class HttpClient {
697
697
  * Start a replay session by fetching historical traces.
698
698
  * Blocking call - creates an experiment and returns lightweight item references.
699
699
  */
700
- 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, judgeAssertions?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string): Promise<StartReplayResponse>;
700
+ 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, judgeAssertions?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>): Promise<StartReplayResponse>;
701
701
  resumeReplay(experimentId: string, traceFunctionKey: string, codeChangeFiles?: CodeChangeFile[] | null, force?: boolean): Promise<ResumeReplayResponse>;
702
702
  /**
703
703
  * Fetch an external span by ID.
@@ -1397,6 +1397,114 @@ declare class DatasetsClient {
1397
1397
  getGraderRerun(datasetId: string, runId?: string): Promise<GraderRerun | null>;
1398
1398
  }
1399
1399
 
1400
+ type ExperimentStatus = "pending" | "completed" | "failed" | "interrupted";
1401
+ type ExperimentRunBy = {
1402
+ id: string;
1403
+ fullName: string | null;
1404
+ email: string | null;
1405
+ imageUrl: string | null;
1406
+ };
1407
+ type ExperimentCodeChangeTotals = {
1408
+ files: number;
1409
+ added: number;
1410
+ removed: number;
1411
+ };
1412
+ type Experiment = {
1413
+ id: string;
1414
+ name: string | null;
1415
+ notes: string | null;
1416
+ status: ExperimentStatus;
1417
+ traceFunctionKey: string | null;
1418
+ createdAt: string;
1419
+ completedAt: string | null;
1420
+ codeChangeDescription: string | null;
1421
+ codeChangeTotals: ExperimentCodeChangeTotals | null;
1422
+ experimentGroupId: string | null;
1423
+ experimentGroupName: string | null;
1424
+ datasetId: string | null;
1425
+ datasetName: string | null;
1426
+ datasetIds: string[];
1427
+ datasetNames: string[];
1428
+ attempts: number;
1429
+ plannedTraceCount: number | null;
1430
+ runBy: ExperimentRunBy | null;
1431
+ githubEmail: string | null;
1432
+ gitBranch: string | null;
1433
+ commitSha: string | null;
1434
+ baseSha: string | null;
1435
+ experimentSha: string | null;
1436
+ metadata: Record<string, string>;
1437
+ };
1438
+ type ExperimentPage = {
1439
+ experiments: Experiment[];
1440
+ nextCursor: string | null;
1441
+ hasMore: boolean;
1442
+ };
1443
+ type ListExperimentsParams = {
1444
+ datasetId?: string;
1445
+ traceFunctionKey?: string;
1446
+ gitBranch?: string;
1447
+ experimentGroupId?: string;
1448
+ status?: ExperimentStatus;
1449
+ metadata?: Record<string, string>;
1450
+ createdAfter?: Date | string;
1451
+ createdBefore?: Date | string;
1452
+ cursor?: string;
1453
+ limit?: number;
1454
+ };
1455
+ type ExperimentTally = {
1456
+ fixed: number;
1457
+ stillPassing: number;
1458
+ regressed: number;
1459
+ stillFailing: number;
1460
+ originalUnlabeled: number;
1461
+ unpaired: number;
1462
+ classified: number;
1463
+ passing: number;
1464
+ failing: number;
1465
+ };
1466
+ type ExperimentTotals = {
1467
+ total: number;
1468
+ succeeded: number;
1469
+ failed: number;
1470
+ pending: number;
1471
+ awaitingLabels: number;
1472
+ errored: number;
1473
+ withErrors: number;
1474
+ ungradable: number;
1475
+ skipped: number;
1476
+ };
1477
+ type ExperimentCategoryTally = {
1478
+ category: AssertionCategorySummary;
1479
+ labels: ExperimentTally;
1480
+ };
1481
+ type ExperimentJitter = {
1482
+ disagreeing: number;
1483
+ attempts: number;
1484
+ traces: number;
1485
+ };
1486
+ type ExperimentRollup = {
1487
+ traces: ExperimentTally;
1488
+ skippedTraces: number;
1489
+ labels: ExperimentTally;
1490
+ checks: ExperimentTally;
1491
+ categories: ExperimentCategoryTally[];
1492
+ jitter: ExperimentJitter;
1493
+ };
1494
+ type ExperimentRollupResult = {
1495
+ experimentId: string;
1496
+ totals: ExperimentTotals;
1497
+ rollup: ExperimentRollup;
1498
+ };
1499
+ declare class ExperimentsClient {
1500
+ private readonly httpClient;
1501
+ constructor(httpClient: HttpClient);
1502
+ list(params?: ListExperimentsParams): Promise<ExperimentPage>;
1503
+ get(id: string): Promise<Experiment>;
1504
+ getRollup(id: string): Promise<ExperimentRollupResult>;
1505
+ getRollupAll(ids: string[]): Promise<ExperimentRollupResult[]>;
1506
+ }
1507
+
1400
1508
  type TraceTargetOccurrence = "first" | "last" | number;
1401
1509
  type TraceTarget = {
1402
1510
  kind: "output";
@@ -2028,6 +2136,7 @@ interface ReplayOptions {
2028
2136
  * override or a forced feature flag. Kept on the experiment next to its name.
2029
2137
  */
2030
2138
  notes?: string;
2139
+ metadata?: Record<string, string>;
2031
2140
  /** Positive integer limiting parallel items. Set to 1 for sequential. Default 10. */
2032
2141
  maxConcurrency?: number;
2033
2142
  /**
@@ -3163,6 +3272,7 @@ declare class Bitfab {
3163
3272
  readonly traces: TracesClient;
3164
3273
  readonly labels: LabelsClient;
3165
3274
  readonly graders: GradersClient;
3275
+ readonly experiments: ExperimentsClient;
3166
3276
  private readonly bamlClient;
3167
3277
  private readonly dbSnapshot;
3168
3278
  private readonly simulationPlan;
@@ -3867,7 +3977,7 @@ interface CommitRef {
3867
3977
  /**
3868
3978
  * SDK version from package.json (injected at build time)
3869
3979
  */
3870
- declare const __version__ = "0.62.4";
3980
+ declare const __version__ = "0.62.6";
3871
3981
 
3872
3982
  /**
3873
3983
  * Constants for the Bitfab SDK.
@@ -4006,4 +4116,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
4006
4116
  run?: boolean;
4007
4117
  }): Promise<SeedResult>;
4008
4118
 
4009
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, 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 GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, 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 OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, 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 TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
4119
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, 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 Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, 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 TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
package/dist/index.d.ts CHANGED
@@ -697,7 +697,7 @@ declare class HttpClient {
697
697
  * Start a replay session by fetching historical traces.
698
698
  * Blocking call - creates an experiment and returns lightweight item references.
699
699
  */
700
- 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, judgeAssertions?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string): Promise<StartReplayResponse>;
700
+ 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, judgeAssertions?: boolean, experimentalSelectiveReplay?: SelectiveReplayOptions, notes?: string, metadata?: Record<string, string>): Promise<StartReplayResponse>;
701
701
  resumeReplay(experimentId: string, traceFunctionKey: string, codeChangeFiles?: CodeChangeFile[] | null, force?: boolean): Promise<ResumeReplayResponse>;
702
702
  /**
703
703
  * Fetch an external span by ID.
@@ -1397,6 +1397,114 @@ declare class DatasetsClient {
1397
1397
  getGraderRerun(datasetId: string, runId?: string): Promise<GraderRerun | null>;
1398
1398
  }
1399
1399
 
1400
+ type ExperimentStatus = "pending" | "completed" | "failed" | "interrupted";
1401
+ type ExperimentRunBy = {
1402
+ id: string;
1403
+ fullName: string | null;
1404
+ email: string | null;
1405
+ imageUrl: string | null;
1406
+ };
1407
+ type ExperimentCodeChangeTotals = {
1408
+ files: number;
1409
+ added: number;
1410
+ removed: number;
1411
+ };
1412
+ type Experiment = {
1413
+ id: string;
1414
+ name: string | null;
1415
+ notes: string | null;
1416
+ status: ExperimentStatus;
1417
+ traceFunctionKey: string | null;
1418
+ createdAt: string;
1419
+ completedAt: string | null;
1420
+ codeChangeDescription: string | null;
1421
+ codeChangeTotals: ExperimentCodeChangeTotals | null;
1422
+ experimentGroupId: string | null;
1423
+ experimentGroupName: string | null;
1424
+ datasetId: string | null;
1425
+ datasetName: string | null;
1426
+ datasetIds: string[];
1427
+ datasetNames: string[];
1428
+ attempts: number;
1429
+ plannedTraceCount: number | null;
1430
+ runBy: ExperimentRunBy | null;
1431
+ githubEmail: string | null;
1432
+ gitBranch: string | null;
1433
+ commitSha: string | null;
1434
+ baseSha: string | null;
1435
+ experimentSha: string | null;
1436
+ metadata: Record<string, string>;
1437
+ };
1438
+ type ExperimentPage = {
1439
+ experiments: Experiment[];
1440
+ nextCursor: string | null;
1441
+ hasMore: boolean;
1442
+ };
1443
+ type ListExperimentsParams = {
1444
+ datasetId?: string;
1445
+ traceFunctionKey?: string;
1446
+ gitBranch?: string;
1447
+ experimentGroupId?: string;
1448
+ status?: ExperimentStatus;
1449
+ metadata?: Record<string, string>;
1450
+ createdAfter?: Date | string;
1451
+ createdBefore?: Date | string;
1452
+ cursor?: string;
1453
+ limit?: number;
1454
+ };
1455
+ type ExperimentTally = {
1456
+ fixed: number;
1457
+ stillPassing: number;
1458
+ regressed: number;
1459
+ stillFailing: number;
1460
+ originalUnlabeled: number;
1461
+ unpaired: number;
1462
+ classified: number;
1463
+ passing: number;
1464
+ failing: number;
1465
+ };
1466
+ type ExperimentTotals = {
1467
+ total: number;
1468
+ succeeded: number;
1469
+ failed: number;
1470
+ pending: number;
1471
+ awaitingLabels: number;
1472
+ errored: number;
1473
+ withErrors: number;
1474
+ ungradable: number;
1475
+ skipped: number;
1476
+ };
1477
+ type ExperimentCategoryTally = {
1478
+ category: AssertionCategorySummary;
1479
+ labels: ExperimentTally;
1480
+ };
1481
+ type ExperimentJitter = {
1482
+ disagreeing: number;
1483
+ attempts: number;
1484
+ traces: number;
1485
+ };
1486
+ type ExperimentRollup = {
1487
+ traces: ExperimentTally;
1488
+ skippedTraces: number;
1489
+ labels: ExperimentTally;
1490
+ checks: ExperimentTally;
1491
+ categories: ExperimentCategoryTally[];
1492
+ jitter: ExperimentJitter;
1493
+ };
1494
+ type ExperimentRollupResult = {
1495
+ experimentId: string;
1496
+ totals: ExperimentTotals;
1497
+ rollup: ExperimentRollup;
1498
+ };
1499
+ declare class ExperimentsClient {
1500
+ private readonly httpClient;
1501
+ constructor(httpClient: HttpClient);
1502
+ list(params?: ListExperimentsParams): Promise<ExperimentPage>;
1503
+ get(id: string): Promise<Experiment>;
1504
+ getRollup(id: string): Promise<ExperimentRollupResult>;
1505
+ getRollupAll(ids: string[]): Promise<ExperimentRollupResult[]>;
1506
+ }
1507
+
1400
1508
  type TraceTargetOccurrence = "first" | "last" | number;
1401
1509
  type TraceTarget = {
1402
1510
  kind: "output";
@@ -2028,6 +2136,7 @@ interface ReplayOptions {
2028
2136
  * override or a forced feature flag. Kept on the experiment next to its name.
2029
2137
  */
2030
2138
  notes?: string;
2139
+ metadata?: Record<string, string>;
2031
2140
  /** Positive integer limiting parallel items. Set to 1 for sequential. Default 10. */
2032
2141
  maxConcurrency?: number;
2033
2142
  /**
@@ -3163,6 +3272,7 @@ declare class Bitfab {
3163
3272
  readonly traces: TracesClient;
3164
3273
  readonly labels: LabelsClient;
3165
3274
  readonly graders: GradersClient;
3275
+ readonly experiments: ExperimentsClient;
3166
3276
  private readonly bamlClient;
3167
3277
  private readonly dbSnapshot;
3168
3278
  private readonly simulationPlan;
@@ -3867,7 +3977,7 @@ interface CommitRef {
3867
3977
  /**
3868
3978
  * SDK version from package.json (injected at build time)
3869
3979
  */
3870
- declare const __version__ = "0.62.4";
3980
+ declare const __version__ = "0.62.6";
3871
3981
 
3872
3982
  /**
3873
3983
  * Constants for the Bitfab SDK.
@@ -4006,4 +4116,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
4006
4116
  run?: boolean;
4007
4117
  }): Promise<SeedResult>;
4008
4118
 
4009
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, 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 GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, 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 OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, 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 TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
4119
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, 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 Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, type LabelUpdate, LabelsClient, type LangGraphIntegrationOptions, type ListDatasetsParams, type ListExperimentsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type OrganizationMember, OrganizationMembersClient, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, type SaveAssertionsAllParams, type SaveAssertionsParams, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, 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 TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  BitfabRivetIntegration,
13
13
  BitfabVercelAiHandler,
14
14
  DatasetsClient,
15
+ ExperimentsClient,
15
16
  GraderRerunError,
16
17
  GraderRerunTimeoutError,
17
18
  GradersClient,
@@ -26,7 +27,7 @@ import {
26
27
  getCurrentTrace,
27
28
  reseedFromRegistry,
28
29
  seedFromRegistry
29
- } from "./chunk-JJB7IIJ6.js";
30
+ } from "./chunk-NY7AOJAS.js";
30
31
  import "./chunk-K4XCWQBC.js";
31
32
  import {
32
33
  BITFAB_PROGRESS_PREFIX,
@@ -35,7 +36,7 @@ import {
35
36
  ReplayError,
36
37
  reportReplayProgress,
37
38
  serializeReplayResult
38
- } from "./chunk-ORLA7356.js";
39
+ } from "./chunk-THZ34ROP.js";
39
40
  import {
40
41
  BitfabError,
41
42
  DEFAULT_SERVICE_URL,
@@ -43,7 +44,7 @@ import {
43
44
  MixedTracingError,
44
45
  __version__,
45
46
  flushTraces
46
- } from "./chunk-5OCYY7L3.js";
47
+ } from "./chunk-MUN7Z5AA.js";
47
48
  import "./chunk-BAOIRE5T.js";
48
49
  export {
49
50
  AssertionCategoriesClient,
@@ -64,6 +65,7 @@ export {
64
65
  DEFAULT_SERVICE_URL,
65
66
  DatasetsClient,
66
67
  DbBranchReplayError,
68
+ ExperimentsClient,
67
69
  GraderRerunError,
68
70
  GraderRerunTimeoutError,
69
71
  GradersClient,
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.62.4";
91
+ __version__ = "0.62.6";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -2892,7 +2892,7 @@ var init_http = __esm({
2892
2892
  * Start a replay session by fetching historical traces.
2893
2893
  * Blocking call - creates an experiment and returns lightweight item references.
2894
2894
  */
2895
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, judgeAssertions, experimentalSelectiveReplay, notes) {
2895
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, judgeAssertions, experimentalSelectiveReplay, notes, metadata) {
2896
2896
  const payload = { traceFunctionKey };
2897
2897
  if (experimentalSelectiveReplay !== void 0) {
2898
2898
  payload.experimentalSelectiveReplay = experimentalSelectiveReplay;
@@ -2909,6 +2909,9 @@ var init_http = __esm({
2909
2909
  if (notes !== void 0) {
2910
2910
  payload.notes = notes;
2911
2911
  }
2912
+ if (metadata !== void 0) {
2913
+ payload.metadata = metadata;
2914
+ }
2912
2915
  if (codeChangeDescription !== void 0) {
2913
2916
  payload.codeChangeDescription = codeChangeDescription;
2914
2917
  }
@@ -4682,7 +4685,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
4682
4685
  options?.onlyWithAssertions,
4683
4686
  options?.judgeAssertions,
4684
4687
  options?.experimentalSelectiveReplay,
4685
- options?.notes
4688
+ options?.notes,
4689
+ options?.metadata
4686
4690
  );
4687
4691
  if (started.items.length === 0) {
4688
4692
  try {
@@ -5129,6 +5133,7 @@ __export(node_exports, {
5129
5133
  DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
5130
5134
  DatasetsClient: () => DatasetsClient,
5131
5135
  DbBranchReplayError: () => DbBranchReplayError,
5136
+ ExperimentsClient: () => ExperimentsClient,
5132
5137
  GraderRerunError: () => GraderRerunError,
5133
5138
  GraderRerunTimeoutError: () => GraderRerunTimeoutError,
5134
5139
  GradersClient: () => GradersClient,
@@ -6750,6 +6755,76 @@ function buildSnapshotRef(config, sdkWallClockBeforeFn) {
6750
6755
  // src/client.ts
6751
6756
  init_errors();
6752
6757
 
6758
+ // src/experiments.ts
6759
+ var EXPERIMENTS_PATH = "/api/sdk/experiments";
6760
+ function isoTimestamp(value) {
6761
+ return value instanceof Date ? value.toISOString() : value;
6762
+ }
6763
+ function buildListQuery(params) {
6764
+ const query = new URLSearchParams();
6765
+ if (params.datasetId !== void 0) {
6766
+ query.set("datasetId", params.datasetId);
6767
+ }
6768
+ if (params.traceFunctionKey !== void 0) {
6769
+ query.set("traceFunctionKey", params.traceFunctionKey);
6770
+ }
6771
+ if (params.gitBranch !== void 0) {
6772
+ query.set("gitBranch", params.gitBranch);
6773
+ }
6774
+ if (params.experimentGroupId !== void 0) {
6775
+ query.set("experimentGroupId", params.experimentGroupId);
6776
+ }
6777
+ if (params.status !== void 0) {
6778
+ query.set("status", params.status);
6779
+ }
6780
+ if (params.metadata !== void 0) {
6781
+ query.set("metadata", JSON.stringify(params.metadata));
6782
+ }
6783
+ if (params.createdAfter !== void 0) {
6784
+ query.set("createdAfter", isoTimestamp(params.createdAfter));
6785
+ }
6786
+ if (params.createdBefore !== void 0) {
6787
+ query.set("createdBefore", isoTimestamp(params.createdBefore));
6788
+ }
6789
+ if (params.cursor !== void 0) {
6790
+ query.set("cursor", params.cursor);
6791
+ }
6792
+ if (params.limit !== void 0) {
6793
+ query.set("limit", String(params.limit));
6794
+ }
6795
+ const encoded = query.toString();
6796
+ return encoded.length === 0 ? "" : `?${encoded}`;
6797
+ }
6798
+ var ExperimentsClient = class {
6799
+ constructor(httpClient) {
6800
+ this.httpClient = httpClient;
6801
+ }
6802
+ async list(params = {}) {
6803
+ return this.httpClient.get(
6804
+ `${EXPERIMENTS_PATH}${buildListQuery(params)}`
6805
+ );
6806
+ }
6807
+ async get(id) {
6808
+ const response = await this.httpClient.get(
6809
+ `${EXPERIMENTS_PATH}/${encodeURIComponent(id)}`
6810
+ );
6811
+ return response.experiment;
6812
+ }
6813
+ async getRollup(id) {
6814
+ return this.httpClient.get(
6815
+ `${EXPERIMENTS_PATH}/${encodeURIComponent(id)}/rollup`
6816
+ );
6817
+ }
6818
+ async getRollupAll(ids) {
6819
+ if (ids.length === 0) {
6820
+ return [];
6821
+ }
6822
+ const query = new URLSearchParams({ experimentIds: ids.join(",") });
6823
+ const response = await this.httpClient.get(`${EXPERIMENTS_PATH}/rollups?${query.toString()}`);
6824
+ return response.rollups;
6825
+ }
6826
+ };
6827
+
6753
6828
  // src/graders.ts
6754
6829
  init_errors();
6755
6830
  var GRADER_LABELS_PATH = "/api/sdk/graderLabels";
@@ -9664,6 +9739,7 @@ var Bitfab = class {
9664
9739
  this.traces = new TracesClient(this.httpClient);
9665
9740
  this.labels = new LabelsClient(this.httpClient);
9666
9741
  this.graders = new GradersClient(this.httpClient);
9742
+ this.experiments = new ExperimentsClient(this.httpClient);
9667
9743
  }
9668
9744
  /**
9669
9745
  * Decorate a class method as an automatically expanded trace root.
@@ -11948,6 +12024,7 @@ assertAsyncStorageRegistered();
11948
12024
  DEFAULT_SERVICE_URL,
11949
12025
  DatasetsClient,
11950
12026
  DbBranchReplayError,
12027
+ ExperimentsClient,
11951
12028
  GraderRerunError,
11952
12029
  GraderRerunTimeoutError,
11953
12030
  GradersClient,