bitfab 0.62.3 → 0.62.5

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 +1065 -0
  2. package/dist/{chunk-E2QXILJI.js → chunk-COFCJXSZ.js} +6 -3
  3. package/dist/{chunk-E2QXILJI.js.map → chunk-COFCJXSZ.js.map} +1 -1
  4. package/dist/{chunk-BPOAXWVS.js → chunk-SDEDJXKM.js} +78 -6
  5. package/dist/chunk-SDEDJXKM.js.map +1 -0
  6. package/dist/{chunk-YKLSCOBE.js → chunk-SPGTIHTC.js} +21 -3
  7. package/dist/chunk-SPGTIHTC.js.map +1 -0
  8. package/dist/{chunk-DRRJRCVG.js → chunk-UUB5LHWU.js} +6 -3
  9. package/dist/{chunk-DRRJRCVG.js.map → chunk-UUB5LHWU.js.map} +1 -1
  10. package/dist/{chunk-T6O3MFM4.js → chunk-XADZNIOO.js} +4 -3
  11. package/dist/chunk-XADZNIOO.js.map +1 -0
  12. package/dist/{http-SWK5U3S4.js → http-LM5MZIOW.js} +2 -2
  13. package/dist/{http-GHK5JKGG.js → http-TVY52JJZ.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-BN4FM6MX.js → replay-SWPDIBQG.js} +3 -3
  26. package/dist/replayCli.js +8 -23
  27. package/dist/replayCli.js.map +1 -1
  28. package/dist/seedCli.js +2 -2
  29. package/package.json +3 -2
  30. package/dist/chunk-BPOAXWVS.js.map +0 -1
  31. package/dist/chunk-T6O3MFM4.js.map +0 -1
  32. package/dist/chunk-YKLSCOBE.js.map +0 -1
  33. /package/dist/{http-GHK5JKGG.js.map → http-LM5MZIOW.js.map} +0 -0
  34. /package/dist/{http-SWK5U3S4.js.map → http-TVY52JJZ.js.map} +0 -0
  35. /package/dist/{replay-BN4FM6MX.js.map → replay-SWPDIBQG.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.3";
3980
+ declare const __version__ = "0.62.5";
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.3";
3980
+ declare const __version__ = "0.62.5";
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
@@ -21,6 +21,7 @@ import {
21
21
  BitfabRivetIntegration,
22
22
  BitfabVercelAiHandler,
23
23
  DatasetsClient,
24
+ ExperimentsClient,
24
25
  GraderRerunError,
25
26
  GraderRerunTimeoutError,
26
27
  GradersClient,
@@ -35,7 +36,7 @@ import {
35
36
  getCurrentTrace,
36
37
  reseedFromRegistry,
37
38
  seedFromRegistry
38
- } from "./chunk-BPOAXWVS.js";
39
+ } from "./chunk-SDEDJXKM.js";
39
40
  import "./chunk-K4XCWQBC.js";
40
41
  import {
41
42
  BITFAB_PROGRESS_PREFIX,
@@ -44,7 +45,7 @@ import {
44
45
  ReplayError,
45
46
  reportReplayProgress,
46
47
  serializeReplayResult
47
- } from "./chunk-T6O3MFM4.js";
48
+ } from "./chunk-XADZNIOO.js";
48
49
  import {
49
50
  BitfabError,
50
51
  DEFAULT_SERVICE_URL,
@@ -52,7 +53,7 @@ import {
52
53
  MixedTracingError,
53
54
  __version__,
54
55
  flushTraces
55
- } from "./chunk-DRRJRCVG.js";
56
+ } from "./chunk-UUB5LHWU.js";
56
57
  import "./chunk-BAOIRE5T.js";
57
58
  export {
58
59
  AssertionCategoriesClient,
@@ -73,6 +74,7 @@ export {
73
74
  DEFAULT_SERVICE_URL,
74
75
  DatasetsClient,
75
76
  DbBranchReplayError,
77
+ ExperimentsClient,
76
78
  GraderRerunError,
77
79
  GraderRerunTimeoutError,
78
80
  GradersClient,
package/dist/node.cjs CHANGED
@@ -97,7 +97,7 @@ var __version__, __packageName__;
97
97
  var init_version_generated = __esm({
98
98
  "src/version.generated.ts"() {
99
99
  "use strict";
100
- __version__ = "0.62.3";
100
+ __version__ = "0.62.5";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -2901,7 +2901,7 @@ var init_http = __esm({
2901
2901
  * Start a replay session by fetching historical traces.
2902
2902
  * Blocking call - creates an experiment and returns lightweight item references.
2903
2903
  */
2904
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, judgeAssertions, experimentalSelectiveReplay, notes) {
2904
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, judgeAssertions, experimentalSelectiveReplay, notes, metadata) {
2905
2905
  const payload = { traceFunctionKey };
2906
2906
  if (experimentalSelectiveReplay !== void 0) {
2907
2907
  payload.experimentalSelectiveReplay = experimentalSelectiveReplay;
@@ -2918,6 +2918,9 @@ var init_http = __esm({
2918
2918
  if (notes !== void 0) {
2919
2919
  payload.notes = notes;
2920
2920
  }
2921
+ if (metadata !== void 0) {
2922
+ payload.metadata = metadata;
2923
+ }
2921
2924
  if (codeChangeDescription !== void 0) {
2922
2925
  payload.codeChangeDescription = codeChangeDescription;
2923
2926
  }
@@ -4691,7 +4694,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
4691
4694
  options?.onlyWithAssertions,
4692
4695
  options?.judgeAssertions,
4693
4696
  options?.experimentalSelectiveReplay,
4694
- options?.notes
4697
+ options?.notes,
4698
+ options?.metadata
4695
4699
  );
4696
4700
  if (started.items.length === 0) {
4697
4701
  try {
@@ -5138,6 +5142,7 @@ __export(node_exports, {
5138
5142
  DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
5139
5143
  DatasetsClient: () => DatasetsClient,
5140
5144
  DbBranchReplayError: () => DbBranchReplayError,
5145
+ ExperimentsClient: () => ExperimentsClient,
5141
5146
  GraderRerunError: () => GraderRerunError,
5142
5147
  GraderRerunTimeoutError: () => GraderRerunTimeoutError,
5143
5148
  GradersClient: () => GradersClient,
@@ -6759,6 +6764,76 @@ function buildSnapshotRef(config, sdkWallClockBeforeFn) {
6759
6764
  // src/client.ts
6760
6765
  init_errors();
6761
6766
 
6767
+ // src/experiments.ts
6768
+ var EXPERIMENTS_PATH = "/api/sdk/experiments";
6769
+ function isoTimestamp(value) {
6770
+ return value instanceof Date ? value.toISOString() : value;
6771
+ }
6772
+ function buildListQuery(params) {
6773
+ const query = new URLSearchParams();
6774
+ if (params.datasetId !== void 0) {
6775
+ query.set("datasetId", params.datasetId);
6776
+ }
6777
+ if (params.traceFunctionKey !== void 0) {
6778
+ query.set("traceFunctionKey", params.traceFunctionKey);
6779
+ }
6780
+ if (params.gitBranch !== void 0) {
6781
+ query.set("gitBranch", params.gitBranch);
6782
+ }
6783
+ if (params.experimentGroupId !== void 0) {
6784
+ query.set("experimentGroupId", params.experimentGroupId);
6785
+ }
6786
+ if (params.status !== void 0) {
6787
+ query.set("status", params.status);
6788
+ }
6789
+ if (params.metadata !== void 0) {
6790
+ query.set("metadata", JSON.stringify(params.metadata));
6791
+ }
6792
+ if (params.createdAfter !== void 0) {
6793
+ query.set("createdAfter", isoTimestamp(params.createdAfter));
6794
+ }
6795
+ if (params.createdBefore !== void 0) {
6796
+ query.set("createdBefore", isoTimestamp(params.createdBefore));
6797
+ }
6798
+ if (params.cursor !== void 0) {
6799
+ query.set("cursor", params.cursor);
6800
+ }
6801
+ if (params.limit !== void 0) {
6802
+ query.set("limit", String(params.limit));
6803
+ }
6804
+ const encoded = query.toString();
6805
+ return encoded.length === 0 ? "" : `?${encoded}`;
6806
+ }
6807
+ var ExperimentsClient = class {
6808
+ constructor(httpClient) {
6809
+ this.httpClient = httpClient;
6810
+ }
6811
+ async list(params = {}) {
6812
+ return this.httpClient.get(
6813
+ `${EXPERIMENTS_PATH}${buildListQuery(params)}`
6814
+ );
6815
+ }
6816
+ async get(id) {
6817
+ const response = await this.httpClient.get(
6818
+ `${EXPERIMENTS_PATH}/${encodeURIComponent(id)}`
6819
+ );
6820
+ return response.experiment;
6821
+ }
6822
+ async getRollup(id) {
6823
+ return this.httpClient.get(
6824
+ `${EXPERIMENTS_PATH}/${encodeURIComponent(id)}/rollup`
6825
+ );
6826
+ }
6827
+ async getRollupAll(ids) {
6828
+ if (ids.length === 0) {
6829
+ return [];
6830
+ }
6831
+ const query = new URLSearchParams({ experimentIds: ids.join(",") });
6832
+ const response = await this.httpClient.get(`${EXPERIMENTS_PATH}/rollups?${query.toString()}`);
6833
+ return response.rollups;
6834
+ }
6835
+ };
6836
+
6762
6837
  // src/graders.ts
6763
6838
  init_errors();
6764
6839
  var GRADER_LABELS_PATH = "/api/sdk/graderLabels";
@@ -9673,6 +9748,7 @@ var Bitfab = class {
9673
9748
  this.traces = new TracesClient(this.httpClient);
9674
9749
  this.labels = new LabelsClient(this.httpClient);
9675
9750
  this.graders = new GradersClient(this.httpClient);
9751
+ this.experiments = new ExperimentsClient(this.httpClient);
9676
9752
  }
9677
9753
  /**
9678
9754
  * Decorate a class method as an automatically expanded trace root.
@@ -11957,6 +12033,7 @@ assertAsyncStorageRegistered();
11957
12033
  DEFAULT_SERVICE_URL,
11958
12034
  DatasetsClient,
11959
12035
  DbBranchReplayError,
12036
+ ExperimentsClient,
11960
12037
  GraderRerunError,
11961
12038
  GraderRerunTimeoutError,
11962
12039
  GradersClient,