bitfab 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-IHJDEWXY.js → chunk-5QT34T7B.js} +6 -3
  3. package/dist/{chunk-IHJDEWXY.js.map → chunk-5QT34T7B.js.map} +1 -1
  4. package/dist/{chunk-CO2HRQEG.js → chunk-C2R3NEPK.js} +4 -3
  5. package/dist/chunk-C2R3NEPK.js.map +1 -0
  6. package/dist/{chunk-4KCUJ5WL.js → chunk-CP7J3VTC.js} +78 -6
  7. package/dist/chunk-CP7J3VTC.js.map +1 -0
  8. package/dist/{chunk-GXD74YMV.js → chunk-LXTDXWNK.js} +21 -3
  9. package/dist/chunk-LXTDXWNK.js.map +1 -0
  10. package/dist/{chunk-GWX7C2CB.js → chunk-PIEBUHL2.js} +6 -3
  11. package/dist/{chunk-GWX7C2CB.js.map → chunk-PIEBUHL2.js.map} +1 -1
  12. package/dist/{http-4T6FFHWZ.js → http-DJRQ2SRF.js} +2 -2
  13. package/dist/{http-NSUBKKB5.js → http-OF2227WS.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-I3ENLBXT.js → replay-SVKFFDNU.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-4KCUJ5WL.js.map +0 -1
  31. package/dist/chunk-CO2HRQEG.js.map +0 -1
  32. package/dist/chunk-GXD74YMV.js.map +0 -1
  33. /package/dist/{http-4T6FFHWZ.js.map → http-DJRQ2SRF.js.map} +0 -0
  34. /package/dist/{http-NSUBKKB5.js.map → http-OF2227WS.js.map} +0 -0
  35. /package/dist/{replay-I3ENLBXT.js.map → replay-SVKFFDNU.js.map} +0 -0
@@ -7,7 +7,7 @@ import {
7
7
  flushTraces,
8
8
  parseRetryAfterMs,
9
9
  serializePayloadBody
10
- } from "./chunk-IHJDEWXY.js";
10
+ } from "./chunk-5QT34T7B.js";
11
11
  import "./chunk-BAOIRE5T.js";
12
12
  export {
13
13
  BitfabError,
@@ -19,4 +19,4 @@ export {
19
19
  parseRetryAfterMs,
20
20
  serializePayloadBody
21
21
  };
22
- //# sourceMappingURL=http-4T6FFHWZ.js.map
22
+ //# sourceMappingURL=http-DJRQ2SRF.js.map
@@ -7,7 +7,7 @@ import {
7
7
  flushTraces,
8
8
  parseRetryAfterMs,
9
9
  serializePayloadBody
10
- } from "./chunk-GWX7C2CB.js";
10
+ } from "./chunk-PIEBUHL2.js";
11
11
  export {
12
12
  BitfabError,
13
13
  HttpClient,
@@ -18,4 +18,4 @@ export {
18
18
  parseRetryAfterMs,
19
19
  serializePayloadBody
20
20
  };
21
- //# sourceMappingURL=http-NSUBKKB5.js.map
21
+ //# sourceMappingURL=http-OF2227WS.js.map
package/dist/index.cjs CHANGED
@@ -51,7 +51,7 @@ var __version__, __packageName__;
51
51
  var init_version_generated = __esm({
52
52
  "src/version.generated.ts"() {
53
53
  "use strict";
54
- __version__ = "0.62.4";
54
+ __version__ = "0.62.6";
55
55
  __packageName__ = "bitfab";
56
56
  }
57
57
  });
@@ -2894,7 +2894,7 @@ var init_http = __esm({
2894
2894
  * Start a replay session by fetching historical traces.
2895
2895
  * Blocking call - creates an experiment and returns lightweight item references.
2896
2896
  */
2897
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, judgeAssertions, experimentalSelectiveReplay, notes) {
2897
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, judgeAssertions, experimentalSelectiveReplay, notes, metadata) {
2898
2898
  const payload = { traceFunctionKey };
2899
2899
  if (experimentalSelectiveReplay !== void 0) {
2900
2900
  payload.experimentalSelectiveReplay = experimentalSelectiveReplay;
@@ -2911,6 +2911,9 @@ var init_http = __esm({
2911
2911
  if (notes !== void 0) {
2912
2912
  payload.notes = notes;
2913
2913
  }
2914
+ if (metadata !== void 0) {
2915
+ payload.metadata = metadata;
2916
+ }
2914
2917
  if (codeChangeDescription !== void 0) {
2915
2918
  payload.codeChangeDescription = codeChangeDescription;
2916
2919
  }
@@ -4684,7 +4687,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
4684
4687
  options?.onlyWithAssertions,
4685
4688
  options?.judgeAssertions,
4686
4689
  options?.experimentalSelectiveReplay,
4687
- options?.notes
4690
+ options?.notes,
4691
+ options?.metadata
4688
4692
  );
4689
4693
  if (started.items.length === 0) {
4690
4694
  try {
@@ -5131,6 +5135,7 @@ __export(index_exports, {
5131
5135
  DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
5132
5136
  DatasetsClient: () => DatasetsClient,
5133
5137
  DbBranchReplayError: () => DbBranchReplayError,
5138
+ ExperimentsClient: () => ExperimentsClient,
5134
5139
  GraderRerunError: () => GraderRerunError,
5135
5140
  GraderRerunTimeoutError: () => GraderRerunTimeoutError,
5136
5141
  GradersClient: () => GradersClient,
@@ -6745,6 +6750,76 @@ function buildSnapshotRef(config, sdkWallClockBeforeFn) {
6745
6750
  // src/client.ts
6746
6751
  init_errors();
6747
6752
 
6753
+ // src/experiments.ts
6754
+ var EXPERIMENTS_PATH = "/api/sdk/experiments";
6755
+ function isoTimestamp(value) {
6756
+ return value instanceof Date ? value.toISOString() : value;
6757
+ }
6758
+ function buildListQuery(params) {
6759
+ const query = new URLSearchParams();
6760
+ if (params.datasetId !== void 0) {
6761
+ query.set("datasetId", params.datasetId);
6762
+ }
6763
+ if (params.traceFunctionKey !== void 0) {
6764
+ query.set("traceFunctionKey", params.traceFunctionKey);
6765
+ }
6766
+ if (params.gitBranch !== void 0) {
6767
+ query.set("gitBranch", params.gitBranch);
6768
+ }
6769
+ if (params.experimentGroupId !== void 0) {
6770
+ query.set("experimentGroupId", params.experimentGroupId);
6771
+ }
6772
+ if (params.status !== void 0) {
6773
+ query.set("status", params.status);
6774
+ }
6775
+ if (params.metadata !== void 0) {
6776
+ query.set("metadata", JSON.stringify(params.metadata));
6777
+ }
6778
+ if (params.createdAfter !== void 0) {
6779
+ query.set("createdAfter", isoTimestamp(params.createdAfter));
6780
+ }
6781
+ if (params.createdBefore !== void 0) {
6782
+ query.set("createdBefore", isoTimestamp(params.createdBefore));
6783
+ }
6784
+ if (params.cursor !== void 0) {
6785
+ query.set("cursor", params.cursor);
6786
+ }
6787
+ if (params.limit !== void 0) {
6788
+ query.set("limit", String(params.limit));
6789
+ }
6790
+ const encoded = query.toString();
6791
+ return encoded.length === 0 ? "" : `?${encoded}`;
6792
+ }
6793
+ var ExperimentsClient = class {
6794
+ constructor(httpClient) {
6795
+ this.httpClient = httpClient;
6796
+ }
6797
+ async list(params = {}) {
6798
+ return this.httpClient.get(
6799
+ `${EXPERIMENTS_PATH}${buildListQuery(params)}`
6800
+ );
6801
+ }
6802
+ async get(id) {
6803
+ const response = await this.httpClient.get(
6804
+ `${EXPERIMENTS_PATH}/${encodeURIComponent(id)}`
6805
+ );
6806
+ return response.experiment;
6807
+ }
6808
+ async getRollup(id) {
6809
+ return this.httpClient.get(
6810
+ `${EXPERIMENTS_PATH}/${encodeURIComponent(id)}/rollup`
6811
+ );
6812
+ }
6813
+ async getRollupAll(ids) {
6814
+ if (ids.length === 0) {
6815
+ return [];
6816
+ }
6817
+ const query = new URLSearchParams({ experimentIds: ids.join(",") });
6818
+ const response = await this.httpClient.get(`${EXPERIMENTS_PATH}/rollups?${query.toString()}`);
6819
+ return response.rollups;
6820
+ }
6821
+ };
6822
+
6748
6823
  // src/graders.ts
6749
6824
  init_errors();
6750
6825
  var GRADER_LABELS_PATH = "/api/sdk/graderLabels";
@@ -9659,6 +9734,7 @@ var Bitfab = class {
9659
9734
  this.traces = new TracesClient(this.httpClient);
9660
9735
  this.labels = new LabelsClient(this.httpClient);
9661
9736
  this.graders = new GradersClient(this.httpClient);
9737
+ this.experiments = new ExperimentsClient(this.httpClient);
9662
9738
  }
9663
9739
  /**
9664
9740
  * Decorate a class method as an automatically expanded trace root.
@@ -11939,6 +12015,7 @@ function resolveTraceFunctionKey(registration) {
11939
12015
  DEFAULT_SERVICE_URL,
11940
12016
  DatasetsClient,
11941
12017
  DbBranchReplayError,
12018
+ ExperimentsClient,
11942
12019
  GraderRerunError,
11943
12020
  GraderRerunTimeoutError,
11944
12021
  GradersClient,