bitfab 0.62.4 → 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 (33) hide show
  1. package/dist/{chunk-GWX7C2CB.js → chunk-COFCJXSZ.js} +6 -3
  2. package/dist/{chunk-GWX7C2CB.js.map → chunk-COFCJXSZ.js.map} +1 -1
  3. package/dist/{chunk-4KCUJ5WL.js → chunk-SDEDJXKM.js} +78 -6
  4. package/dist/chunk-SDEDJXKM.js.map +1 -0
  5. package/dist/{chunk-GXD74YMV.js → chunk-SPGTIHTC.js} +21 -3
  6. package/dist/chunk-SPGTIHTC.js.map +1 -0
  7. package/dist/{chunk-IHJDEWXY.js → chunk-UUB5LHWU.js} +6 -3
  8. package/dist/{chunk-IHJDEWXY.js.map → chunk-UUB5LHWU.js.map} +1 -1
  9. package/dist/{chunk-CO2HRQEG.js → chunk-XADZNIOO.js} +4 -3
  10. package/dist/chunk-XADZNIOO.js.map +1 -0
  11. package/dist/{http-4T6FFHWZ.js → http-LM5MZIOW.js} +2 -2
  12. package/dist/{http-NSUBKKB5.js → http-TVY52JJZ.js} +2 -2
  13. package/dist/index.cjs +80 -3
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +113 -3
  16. package/dist/index.d.ts +113 -3
  17. package/dist/index.js +5 -3
  18. package/dist/node.cjs +80 -3
  19. package/dist/node.cjs.map +1 -1
  20. package/dist/node.d.cts +1 -1
  21. package/dist/node.d.ts +1 -1
  22. package/dist/node.js +5 -3
  23. package/dist/node.js.map +1 -1
  24. package/dist/{replay-I3ENLBXT.js → replay-SWPDIBQG.js} +3 -3
  25. package/dist/replayCli.js +2 -2
  26. package/dist/seedCli.js +2 -2
  27. package/package.json +1 -1
  28. package/dist/chunk-4KCUJ5WL.js.map +0 -1
  29. package/dist/chunk-CO2HRQEG.js.map +0 -1
  30. package/dist/chunk-GXD74YMV.js.map +0 -1
  31. /package/dist/{http-4T6FFHWZ.js.map → http-LM5MZIOW.js.map} +0 -0
  32. /package/dist/{http-NSUBKKB5.js.map → http-TVY52JJZ.js.map} +0 -0
  33. /package/dist/{replay-I3ENLBXT.js.map → replay-SWPDIBQG.js.map} +0 -0
@@ -17,7 +17,7 @@ import {
17
17
  serializeValue,
18
18
  toJsonSafe,
19
19
  toJsonSafeReport
20
- } from "./chunk-CO2HRQEG.js";
20
+ } from "./chunk-XADZNIOO.js";
21
21
  import {
22
22
  BitfabError,
23
23
  CONTENT_OFF_KEY,
@@ -36,7 +36,7 @@ import {
36
36
  readEnv,
37
37
  recordCallerTraceMetadata,
38
38
  retireTraceMetadata
39
- } from "./chunk-IHJDEWXY.js";
39
+ } from "./chunk-UUB5LHWU.js";
40
40
  import {
41
41
  __privateAdd,
42
42
  __privateGet,
@@ -1444,6 +1444,76 @@ function buildSnapshotRef(config, sdkWallClockBeforeFn) {
1444
1444
  };
1445
1445
  }
1446
1446
 
1447
+ // src/experiments.ts
1448
+ var EXPERIMENTS_PATH = "/api/sdk/experiments";
1449
+ function isoTimestamp(value) {
1450
+ return value instanceof Date ? value.toISOString() : value;
1451
+ }
1452
+ function buildListQuery(params) {
1453
+ const query = new URLSearchParams();
1454
+ if (params.datasetId !== void 0) {
1455
+ query.set("datasetId", params.datasetId);
1456
+ }
1457
+ if (params.traceFunctionKey !== void 0) {
1458
+ query.set("traceFunctionKey", params.traceFunctionKey);
1459
+ }
1460
+ if (params.gitBranch !== void 0) {
1461
+ query.set("gitBranch", params.gitBranch);
1462
+ }
1463
+ if (params.experimentGroupId !== void 0) {
1464
+ query.set("experimentGroupId", params.experimentGroupId);
1465
+ }
1466
+ if (params.status !== void 0) {
1467
+ query.set("status", params.status);
1468
+ }
1469
+ if (params.metadata !== void 0) {
1470
+ query.set("metadata", JSON.stringify(params.metadata));
1471
+ }
1472
+ if (params.createdAfter !== void 0) {
1473
+ query.set("createdAfter", isoTimestamp(params.createdAfter));
1474
+ }
1475
+ if (params.createdBefore !== void 0) {
1476
+ query.set("createdBefore", isoTimestamp(params.createdBefore));
1477
+ }
1478
+ if (params.cursor !== void 0) {
1479
+ query.set("cursor", params.cursor);
1480
+ }
1481
+ if (params.limit !== void 0) {
1482
+ query.set("limit", String(params.limit));
1483
+ }
1484
+ const encoded = query.toString();
1485
+ return encoded.length === 0 ? "" : `?${encoded}`;
1486
+ }
1487
+ var ExperimentsClient = class {
1488
+ constructor(httpClient) {
1489
+ this.httpClient = httpClient;
1490
+ }
1491
+ async list(params = {}) {
1492
+ return this.httpClient.get(
1493
+ `${EXPERIMENTS_PATH}${buildListQuery(params)}`
1494
+ );
1495
+ }
1496
+ async get(id) {
1497
+ const response = await this.httpClient.get(
1498
+ `${EXPERIMENTS_PATH}/${encodeURIComponent(id)}`
1499
+ );
1500
+ return response.experiment;
1501
+ }
1502
+ async getRollup(id) {
1503
+ return this.httpClient.get(
1504
+ `${EXPERIMENTS_PATH}/${encodeURIComponent(id)}/rollup`
1505
+ );
1506
+ }
1507
+ async getRollupAll(ids) {
1508
+ if (ids.length === 0) {
1509
+ return [];
1510
+ }
1511
+ const query = new URLSearchParams({ experimentIds: ids.join(",") });
1512
+ const response = await this.httpClient.get(`${EXPERIMENTS_PATH}/rollups?${query.toString()}`);
1513
+ return response.rollups;
1514
+ }
1515
+ };
1516
+
1447
1517
  // src/graders.ts
1448
1518
  var GRADER_LABELS_PATH = "/api/sdk/graderLabels";
1449
1519
  var GradersClient = class {
@@ -4318,6 +4388,7 @@ var Bitfab = class {
4318
4388
  this.traces = new TracesClient(this.httpClient);
4319
4389
  this.labels = new LabelsClient(this.httpClient);
4320
4390
  this.graders = new GradersClient(this.httpClient);
4391
+ this.experiments = new ExperimentsClient(this.httpClient);
4321
4392
  }
4322
4393
  /**
4323
4394
  * Decorate a class method as an automatically expanded trace root.
@@ -6174,7 +6245,7 @@ var Bitfab = class {
6174
6245
  await runWithSeedContext({ traceId }, async () => target(...args));
6175
6246
  } finally {
6176
6247
  try {
6177
- const { flushTraces: flushTraces2 } = await import("./http-4T6FFHWZ.js");
6248
+ const { flushTraces: flushTraces2 } = await import("./http-LM5MZIOW.js");
6178
6249
  await flushTraces2(3e4);
6179
6250
  } finally {
6180
6251
  unrecorded = activeTraceStates.delete(traceId);
@@ -6233,7 +6304,7 @@ var Bitfab = class {
6233
6304
  `Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
6234
6305
  );
6235
6306
  }
6236
- const { replay: doReplay } = await import("./replay-I3ENLBXT.js");
6307
+ const { replay: doReplay } = await import("./replay-SWPDIBQG.js");
6237
6308
  return doReplay(
6238
6309
  this.httpClient,
6239
6310
  this.serviceUrl,
@@ -6553,7 +6624,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
6553
6624
  sessionId: seedCase.sessionId
6554
6625
  })
6555
6626
  );
6556
- const { flushTraces: flushTraces2 } = await import("./http-4T6FFHWZ.js");
6627
+ const { flushTraces: flushTraces2 } = await import("./http-LM5MZIOW.js");
6557
6628
  await flushTraces2(3e4);
6558
6629
  return { pipeline, traceFunctionKey, traceIds };
6559
6630
  }
@@ -6575,6 +6646,7 @@ export {
6575
6646
  GraderRerunTimeoutError,
6576
6647
  DatasetsClient,
6577
6648
  SUPPORTED_PROVIDERS,
6649
+ ExperimentsClient,
6578
6650
  GradersClient,
6579
6651
  LabelsClient,
6580
6652
  BitfabLangGraphCallbackHandler,
@@ -6597,4 +6669,4 @@ export {
6597
6669
  reseedFromRegistry,
6598
6670
  seedFromRegistry
6599
6671
  };
6600
- //# sourceMappingURL=chunk-4KCUJ5WL.js.map
6672
+ //# sourceMappingURL=chunk-SDEDJXKM.js.map