bitfab 0.65.11 → 0.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/autoTrace-CQw0qMBt.cjs.map +1 -1
  2. package/dist/autoTrace-O40k8f5M.js.map +1 -1
  3. package/dist/autoTrace.d.cts +2 -0
  4. package/dist/autoTrace.d.ts +2 -0
  5. package/dist/{babelPlugin-C70OxrqA.js → babelPlugin-CBjx6aJe.js} +28 -3
  6. package/dist/babelPlugin-CBjx6aJe.js.map +1 -0
  7. package/dist/{babelPlugin-Nta4-VcL.cjs → babelPlugin-ZR9ilYct.cjs} +28 -3
  8. package/dist/babelPlugin-ZR9ilYct.cjs.map +1 -0
  9. package/dist/{http-DdlELWcL.js → http-CcYPHER5.js} +2 -2
  10. package/dist/http-CcYPHER5.js.map +1 -0
  11. package/dist/{http-CFwCJQyF.cjs → http-CxT_WDAh.cjs} +2 -2
  12. package/dist/http-CxT_WDAh.cjs.map +1 -0
  13. package/dist/{index-CUstKXuW.d.cts → index-BFgtvRni.d.cts} +224 -61
  14. package/dist/{index-CUstKXuW.d.ts → index-BFgtvRni.d.ts} +224 -61
  15. package/dist/index.cjs +3 -2
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +3 -3
  19. package/dist/node.cjs +3 -2
  20. package/dist/node.d.cts +2 -2
  21. package/dist/node.d.ts +2 -2
  22. package/dist/node.js +3 -3
  23. package/dist/{registryCommand-Cr7m6Vif.js → registryCommand-Dk4Y1ZgW.js} +2 -2
  24. package/dist/registryCommand-Dk4Y1ZgW.js.map +1 -0
  25. package/dist/replayCli.js +1 -1
  26. package/dist/seedCli.js +1 -1
  27. package/dist/{src-lTOsAt47.js → src-CFDoTgXw.js} +180 -55
  28. package/dist/src-CFDoTgXw.js.map +1 -0
  29. package/dist/{src-mV-7DNLd.cjs → src-DXmdXbOL.cjs} +185 -54
  30. package/dist/src-DXmdXbOL.cjs.map +1 -0
  31. package/dist/transform/babel.cjs +1 -1
  32. package/dist/transform/babel.d.cts +1 -0
  33. package/dist/transform/babel.d.ts +1 -0
  34. package/dist/transform/babel.js +1 -1
  35. package/dist/transform/loaderRuntime.cjs +2 -2
  36. package/dist/transform/loaderRuntime.js +2 -2
  37. package/dist/transform/nodeLoader.js +27 -2
  38. package/dist/transform/nodeLoader.js.map +1 -1
  39. package/dist/transform/swc.cjs +1 -1
  40. package/dist/transform/swc.js +1 -1
  41. package/dist/transform/unplugin.cjs +2 -2
  42. package/dist/transform/unplugin.js +2 -2
  43. package/dist/{transform-BcyUocwm.js → transform-DP1qnD8u.js} +2 -2
  44. package/dist/{transform-BcyUocwm.js.map → transform-DP1qnD8u.js.map} +1 -1
  45. package/dist/{transform-BjxHGGKc.cjs → transform-D_pSvPJc.cjs} +2 -2
  46. package/dist/{transform-BjxHGGKc.cjs.map → transform-D_pSvPJc.cjs.map} +1 -1
  47. package/package.json +1 -1
  48. package/dist/babelPlugin-C70OxrqA.js.map +0 -1
  49. package/dist/babelPlugin-Nta4-VcL.cjs.map +0 -1
  50. package/dist/http-CFwCJQyF.cjs.map +0 -1
  51. package/dist/http-DdlELWcL.js.map +0 -1
  52. package/dist/registryCommand-Cr7m6Vif.js.map +0 -1
  53. package/dist/src-lTOsAt47.js.map +0 -1
  54. package/dist/src-mV-7DNLd.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  const require_bamlPeer = require("./bamlPeer-BUoZgNxZ.cjs");
2
- const require_http = require("./http-CFwCJQyF.cjs");
2
+ const require_http = require("./http-CxT_WDAh.cjs");
3
3
  const require_autoTrace = require("./autoTrace-CQw0qMBt.cjs");
4
4
  let superjson = require("superjson");
5
5
  superjson = require_bamlPeer.__toESM(superjson, 1);
@@ -1240,52 +1240,63 @@ var ExperimentsClient = class {
1240
1240
  }
1241
1241
  };
1242
1242
  //#endregion
1243
- //#region src/graders.ts
1244
- const GRADER_LABELS_PATH = "/api/sdk/graderLabels";
1245
- var GradersClient = class {
1246
- constructor(httpClient) {
1247
- this.httpClient = httpClient;
1248
- }
1249
- async getLabels(params) {
1250
- const hasTraceIds = params.traceIds !== void 0 && params.traceIds.length > 0;
1251
- const hasGraderId = params.graderId !== void 0;
1252
- if (!hasTraceIds && !hasGraderId) throw new require_http.BitfabError("Pass traceIds, graderId, or both: there is nothing to read otherwise.");
1253
- const query = new URLSearchParams();
1254
- if (params.traceIds !== void 0 && params.traceIds.length > 0) query.set("traceIds", params.traceIds.join(","));
1255
- if (params.graderId !== void 0) query.set("graderId", params.graderId);
1256
- if (params.limit !== void 0) query.set("limit", String(params.limit));
1257
- return (await this.httpClient.get(`${GRADER_LABELS_PATH}?${query.toString()}`)).labels;
1258
- }
1259
- async saveLabel(update) {
1260
- const [outcome] = await this.saveLabelAll([update]);
1261
- return outcome;
1243
+ //#region src/verdicts.ts
1244
+ const VERDICTS_PATH = "/api/sdk/traces/verdicts";
1245
+ const HUMAN_VERDICTS_PATH = "/api/sdk/traces/verdicts/human";
1246
+ function isSkipOrArchive(fields) {
1247
+ return fields.skip === true || fields.archive === true;
1248
+ }
1249
+ function toWireVerdict(update) {
1250
+ const fields = update;
1251
+ const legacyLabel = fields.label !== void 0;
1252
+ const legacyAbstain = fields.abstain !== void 0;
1253
+ if (!legacyLabel && !legacyAbstain) return update;
1254
+ if (fields.verdict !== void 0) throw new require_http.BitfabError("Pass verdict, or the deprecated label or abstain, not both.");
1255
+ if (legacyLabel && fields.abstain === true) throw new require_http.BitfabError("Pass the deprecated label or abstain, not both. Pass verdict: \"pass\" | \"fail\" | \"abstained\" instead.");
1256
+ const { label, abstain, ...rest } = fields;
1257
+ if (!legacyLabel && abstain !== true) {
1258
+ if (isSkipOrArchive(fields)) return rest;
1259
+ throw new require_http.BitfabError("abstain: false is not a verdict. Pass verdict: \"pass\" | \"fail\" | \"abstained\" instead.");
1260
+ }
1261
+ if (legacyLabel) {
1262
+ require_autoTrace.warnOnce("deprecated-label-field", "The label field is deprecated; pass verdict: \"pass\" | \"fail\" instead.");
1263
+ return {
1264
+ ...rest,
1265
+ verdict: label === true ? "pass" : "fail"
1266
+ };
1262
1267
  }
1263
- async saveLabelAll(updates) {
1264
- return (await this.httpClient.request(GRADER_LABELS_PATH, { labels: updates })).labels;
1268
+ require_autoTrace.warnOnce("deprecated-abstain-field", "The abstain field is deprecated; pass verdict: \"abstained\" or call verdicts.abstain instead.");
1269
+ return {
1270
+ ...rest,
1271
+ verdict: "abstained"
1272
+ };
1273
+ }
1274
+ function assertAbstainedCarriesNoExtras(updates) {
1275
+ for (const update of updates) {
1276
+ const fields = update;
1277
+ if (fields.verdict !== "abstained") continue;
1278
+ const extra = fields.confidence !== void 0 ? "confidence" : fields.evidence !== void 0 ? "evidence" : null;
1279
+ if (extra !== null) throw new require_http.BitfabError(`An "abstained" verdict carries no ${extra}, since nothing was found to judge.`);
1265
1280
  }
1266
- };
1267
- //#endregion
1268
- //#region src/labels.ts
1269
- const LABELS_PATH = "/api/sdk/traces/labels";
1270
- const HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
1281
+ }
1271
1282
  function assertEveryVerdictNamesAnAssertion(updates) {
1272
1283
  const unscoped = updates.filter((update) => !("archive" in update && update.archive === true) && (typeof update.assertionId !== "string" || update.assertionId === ""));
1273
1284
  if (unscoped.length > 0) {
1274
1285
  const targets = unscoped.map((update) => update.traceId ?? update.originalTraceId);
1275
- throw new require_http.BitfabError(`Agent verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to labels.save, saveAll, skip, and abstain. Only archive may omit it, to clear an old whole-trace verdict.`);
1286
+ throw new require_http.BitfabError(`Agent verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to verdicts.save, saveAll, skip, and abstain. Only archive may omit it, to clear an old whole-trace verdict.`);
1276
1287
  }
1277
1288
  }
1278
1289
  function assertEveryHumanVerdictNamesAnAssertion(updates) {
1279
1290
  const unscoped = updates.filter((update) => typeof update.assertionId !== "string" || update.assertionId === "");
1280
1291
  if (unscoped.length > 0) {
1281
1292
  const targets = unscoped.map((update) => update.traceId);
1282
- throw new require_http.BitfabError(`Human verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to labels.saveHuman and saveHumanAll.`);
1293
+ throw new require_http.BitfabError(`Human verdicts must name an assertion: ${targets.join(", ")}. Pass the assertionId of the assertion each verdict scores to verdicts.saveHuman and saveHumanAll.`);
1283
1294
  }
1284
1295
  }
1285
- function labelEvidencePath(traceId, assertionId) {
1296
+ function verdictEvidencePath(traceId, assertionId) {
1286
1297
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions/${encodeURIComponent(assertionId)}/evidence`;
1287
1298
  }
1288
- var LabelsClient = class {
1299
+ var VerdictsClient = class {
1289
1300
  constructor(httpClient) {
1290
1301
  this.httpClient = httpClient;
1291
1302
  }
@@ -1295,10 +1306,12 @@ var LabelsClient = class {
1295
1306
  }
1296
1307
  async saveAll(updates, experimentId) {
1297
1308
  assertEveryVerdictNamesAnAssertion(updates);
1298
- return (await this.httpClient.request(LABELS_PATH, {
1299
- labels: updates,
1309
+ const verdicts = updates.map((update) => toWireVerdict(update));
1310
+ assertAbstainedCarriesNoExtras(verdicts);
1311
+ return (await this.httpClient.request(VERDICTS_PATH, {
1312
+ verdicts,
1300
1313
  ...experimentId === void 0 ? {} : require_http.experimentIdWireFields(experimentId)
1301
- })).labels;
1314
+ })).verdicts;
1302
1315
  }
1303
1316
  async skip(target, experimentId) {
1304
1317
  return this.save({
@@ -1309,7 +1322,7 @@ var LabelsClient = class {
1309
1322
  async abstain(target, experimentId) {
1310
1323
  return this.save({
1311
1324
  ...target,
1312
- abstain: true
1325
+ verdict: "abstained"
1313
1326
  }, experimentId);
1314
1327
  }
1315
1328
  async archive(target, experimentId) {
@@ -1324,19 +1337,73 @@ var LabelsClient = class {
1324
1337
  }
1325
1338
  async saveHumanAll(updates) {
1326
1339
  assertEveryHumanVerdictNamesAnAssertion(updates);
1327
- return (await this.httpClient.request(HUMAN_LABELS_PATH, { labels: updates })).labels;
1340
+ const verdicts = updates.map((update) => toWireVerdict(update));
1341
+ return (await this.httpClient.request(HUMAN_VERDICTS_PATH, { verdicts })).verdicts.map((outcome) => ({
1342
+ ...outcome,
1343
+ label: outcome.verdict === "pass"
1344
+ }));
1328
1345
  }
1329
1346
  async get(traceId) {
1330
- const [labels] = await this.getAll([traceId]);
1331
- return labels ?? null;
1347
+ const [verdicts] = await this.getAll([traceId]);
1348
+ return verdicts ?? null;
1332
1349
  }
1333
1350
  async getAll(traceIds) {
1334
1351
  if (traceIds.length === 0) return [];
1335
1352
  const query = new URLSearchParams({ traceIds: traceIds.join(",") });
1336
- return (await this.httpClient.get(`${LABELS_PATH}?${query.toString()}`)).labels;
1353
+ return (await this.httpClient.get(`${VERDICTS_PATH}?${query.toString()}`)).verdicts;
1354
+ }
1355
+ async generateEvidence(traceId, assertionId) {
1356
+ return (await this.httpClient.get(verdictEvidencePath(traceId, assertionId))).evidence;
1337
1357
  }
1338
1358
  async generateLabelEvidence(traceId, assertionId) {
1339
- return (await this.httpClient.get(labelEvidencePath(traceId, assertionId))).evidence;
1359
+ return this.generateEvidence(traceId, assertionId);
1360
+ }
1361
+ };
1362
+ const LabelsClient = VerdictsClient;
1363
+ //#endregion
1364
+ //#region src/graders.ts
1365
+ const GRADER_VERDICTS_PATH = "/api/sdk/graderVerdicts";
1366
+ function withDeprecatedGraderFields(row) {
1367
+ return {
1368
+ ...row,
1369
+ label: row.verdict === null ? null : row.verdict === "pass",
1370
+ labelReason: row.reason,
1371
+ labelConfidence: row.confidence
1372
+ };
1373
+ }
1374
+ var GradersClient = class {
1375
+ constructor(httpClient) {
1376
+ this.httpClient = httpClient;
1377
+ }
1378
+ async getVerdicts(params) {
1379
+ const hasTraceIds = params.traceIds !== void 0 && params.traceIds.length > 0;
1380
+ const hasGraderId = params.graderId !== void 0;
1381
+ if (!hasTraceIds && !hasGraderId) throw new require_http.BitfabError("Pass traceIds, graderId, or both: there is nothing to read otherwise.");
1382
+ const query = new URLSearchParams();
1383
+ if (params.traceIds !== void 0 && params.traceIds.length > 0) query.set("traceIds", params.traceIds.join(","));
1384
+ if (params.graderId !== void 0) query.set("graderId", params.graderId);
1385
+ if (params.limit !== void 0) query.set("limit", String(params.limit));
1386
+ return (await this.httpClient.get(`${GRADER_VERDICTS_PATH}?${query.toString()}`)).verdicts.map(withDeprecatedGraderFields);
1387
+ }
1388
+ async saveVerdict(update) {
1389
+ const [outcome] = await this.saveVerdictAll([update]);
1390
+ return outcome;
1391
+ }
1392
+ async saveVerdictAll(updates) {
1393
+ const verdicts = updates.map((update) => toWireVerdict(update));
1394
+ return (await this.httpClient.request(GRADER_VERDICTS_PATH, { verdicts })).verdicts.map((outcome) => ({
1395
+ ...outcome,
1396
+ label: outcome.verdict === "pass"
1397
+ }));
1398
+ }
1399
+ async getLabels(params) {
1400
+ return this.getVerdicts(params);
1401
+ }
1402
+ async saveLabel(update) {
1403
+ return this.saveVerdict(update);
1404
+ }
1405
+ async saveLabelAll(updates) {
1406
+ return this.saveVerdictAll(updates);
1340
1407
  }
1341
1408
  };
1342
1409
  //#endregion
@@ -3465,7 +3532,7 @@ async function runReplaySession(httpClient, fn, session, fullExperimentUrl, maxC
3465
3532
  throw new ReplayError(cause.message, resultItems, experimentId, fullExperimentUrl, cause);
3466
3533
  }
3467
3534
  if (missing.length > 0) try {
3468
- console.error(`Bitfab: server has no persisted trace for ${missing.length} of ${completedCount} completed replay item(s) (experiment ${experimentId}). Their replay token usage is unavailable and they cannot be labeled.`);
3535
+ console.error(`Bitfab: server has no persisted trace for ${missing.length} of ${completedCount} completed replay item(s) (experiment ${experimentId}). Their replay token usage is unavailable and they cannot be given a verdict.`);
3469
3536
  } catch {}
3470
3537
  }
3471
3538
  const result = {
@@ -4646,6 +4713,61 @@ function extractContextFromCollector(collector) {
4646
4713
  return null;
4647
4714
  }
4648
4715
  }
4716
+ const BOUND_FUNCTION_NAME_PREFIX = /^bound /;
4717
+ function discoveredSpanType(definition, nodeConfiguration) {
4718
+ const ownType = definition.baml === true ? "llm" : "function";
4719
+ if (nodeConfiguration === void 0) return ownType;
4720
+ if (definition.baml === true && nodeConfiguration.defaultType === true) return ownType;
4721
+ return nodeConfiguration.type ?? ownType;
4722
+ }
4723
+ const collectorsRecordedByAutoTrace = /* @__PURE__ */ new WeakSet();
4724
+ function isPlainObject(value) {
4725
+ return typeof value === "object" && value !== null && !Array.isArray(value);
4726
+ }
4727
+ function collectorsIn(options) {
4728
+ const collector = options.collector;
4729
+ if (collector === void 0 || collector === null) return [];
4730
+ return Array.isArray(collector) ? collector : [collector];
4731
+ }
4732
+ function recordBamlCollector(collector) {
4733
+ try {
4734
+ const prompt = extractPromptFromCollector(collector);
4735
+ if (prompt) getCurrentSpan().setPrompt(prompt);
4736
+ const metadata = extractContextFromCollector(collector);
4737
+ if (metadata) getCurrentSpan().addContext(metadata);
4738
+ } catch {}
4739
+ }
4740
+ function invokeBamlWithCollector(invokeFn, CollectorClass) {
4741
+ const collector = new CollectorClass("bitfab-baml-tracing");
4742
+ let existingCollectors = [];
4743
+ const result = invokeFn((callerOptions, clientOptions) => {
4744
+ const caller = isPlainObject(callerOptions) ? callerOptions : {};
4745
+ const client = isPlainObject(clientOptions) ? clientOptions : {};
4746
+ existingCollectors = collectorsIn(caller.collector === void 0 ? client : caller);
4747
+ return {
4748
+ ...caller,
4749
+ collector: [...existingCollectors, collector]
4750
+ };
4751
+ });
4752
+ const settle = () => {
4753
+ for (const existing of existingCollectors) if (typeof existing === "object" && existing !== null) collectorsRecordedByAutoTrace.add(existing);
4754
+ recordBamlCollector(collector);
4755
+ };
4756
+ if (result instanceof Promise) return result.then((value) => {
4757
+ settle();
4758
+ return value;
4759
+ });
4760
+ settle();
4761
+ return result;
4762
+ }
4763
+ function invokeAutoTracedBaml(invokeFn, isAsync) {
4764
+ if (cachedCollectorClass) return invokeBamlWithCollector(invokeFn, cachedCollectorClass);
4765
+ if (cachedCollectorClass === null || !isAsync) {
4766
+ loadCollectorClass();
4767
+ return invokeFn();
4768
+ }
4769
+ return loadCollectorClass().then((CollectorClass) => CollectorClass ? invokeBamlWithCollector(invokeFn, CollectorClass) : invokeFn());
4770
+ }
4649
4771
  function isSpanType(value) {
4650
4772
  return require_http.SPAN_TYPES.some((spanType) => spanType === value);
4651
4773
  }
@@ -4820,7 +4942,8 @@ var Bitfab = class {
4820
4942
  this.organizationMembers = new OrganizationMembersClient(this.httpClient);
4821
4943
  this.traces = new TracesClient(this.httpClient);
4822
4944
  this.spans = new SpansClient(this.httpClient);
4823
- this.labels = new LabelsClient(this.httpClient);
4945
+ this.verdicts = new VerdictsClient(this.httpClient);
4946
+ this.labels = this.verdicts;
4824
4947
  this.graders = new GradersClient(this.httpClient);
4825
4948
  this.experiments = new ExperimentsClient(this.httpClient);
4826
4949
  }
@@ -4868,7 +4991,7 @@ var Bitfab = class {
4868
4991
  const fn = typeof optionsOrFn === "function" ? optionsOrFn : maybeFn;
4869
4992
  if (!fn) throw new require_http.BitfabError("bitfab.withNode requires a function");
4870
4993
  const configuration = this.resolveNodeConfiguration(options);
4871
- const functionName = internalFunctionName ?? fn.name;
4994
+ const functionName = (internalFunctionName ?? fn.name).replace(BOUND_FUNCTION_NAME_PREFIX, "");
4872
4995
  if (functionName === "") throw new require_http.BitfabError("bitfab.withNode requires a named function so the subtree transform can bind its configuration to the correct call.");
4873
4996
  return this.createAutoTraceNode(configuration, fn, functionName);
4874
4997
  }
@@ -4879,6 +5002,7 @@ var Bitfab = class {
4879
5002
  return {
4880
5003
  capture,
4881
5004
  type: options.type ?? "custom",
5005
+ ...options.type === void 0 && { defaultType: true },
4882
5006
  ...options.name !== void 0 && { name: options.name },
4883
5007
  ...experimentId !== void 0 && { experimentId },
4884
5008
  ...options.mockOnReplay !== void 0 && { mockOnReplay: options.mockOnReplay },
@@ -4902,6 +5026,7 @@ var Bitfab = class {
4902
5026
  createAutoTraceRoot(traceFunctionKey, name, options, fn, rootFunctionName = "") {
4903
5027
  const self = this;
4904
5028
  self.simulationPlan.refresh();
5029
+ loadCollectorClass();
4905
5030
  const runRootFunction = (receiver, args) => require_autoTrace.runAsAutoTraceRootFunction(rootFunctionName, () => fn.apply(receiver, args));
4906
5031
  const maxDepth = autoTraceLimit(options.maxDepth, DEFAULT_AUTO_TRACE_MAX_DEPTH);
4907
5032
  const maxCapturedSubtreeSpans = autoTraceLimit(options.maxCapturedSubtreeSpans, DEFAULT_AUTO_TRACE_MAX_CAPTURED_SUBTREE_SPANS);
@@ -4975,7 +5100,7 @@ var Bitfab = class {
4975
5100
  const nodeExperimentId = nodeConfiguration === void 0 ? void 0 : resolveSpanExperimentId(nodeConfiguration);
4976
5101
  const childOptions = {
4977
5102
  name: spanName,
4978
- type: nodeConfiguration?.type ?? "function",
5103
+ type: discoveredSpanType(definition, nodeConfiguration),
4979
5104
  captureWhen: "nested",
4980
5105
  surface: "opt-out",
4981
5106
  instrumentation: "trace",
@@ -4989,7 +5114,8 @@ var Bitfab = class {
4989
5114
  ...nodeConfiguration?.replayReusable !== void 0 && { replayReusable: nodeConfiguration.replayReusable },
4990
5115
  ...nodeConfiguration?.finalize !== void 0 && { finalize: nodeConfiguration.finalize }
4991
5116
  };
4992
- return openChild(entry, childOptions, inputs, definition.async === true, invokeFn);
5117
+ const isAsync = definition.async === true;
5118
+ return openChild(entry, childOptions, inputs, isAsync, definition.baml === true ? () => invokeAutoTracedBaml(invokeFn, isAsync) : invokeFn);
4993
5119
  },
4994
5120
  invokeNestedRoot(nestedName, nestedFunctionName, inputs, invokeFn, entry, link, spanDetails) {
4995
5121
  if (excluded.has(nestedName) || excluded.has(nestedFunctionName) || !recordsSpan(entry, nestedName, true)) return invokeFn();
@@ -5260,18 +5386,17 @@ var Bitfab = class {
5260
5386
  }
5261
5387
  const result = await trackedMethod.bind(trackedClient)(...args);
5262
5388
  wrappedFn.collector = collector;
5263
- try {
5264
- const prompt = extractPromptFromCollector(collector);
5265
- if (prompt) getCurrentSpan().setPrompt(prompt);
5266
- const metadata = extractContextFromCollector(collector);
5267
- if (metadata) getCurrentSpan().addContext(metadata);
5268
- } catch {}
5389
+ if (!collectorsRecordedByAutoTrace.has(collector)) recordBamlCollector(collector);
5269
5390
  try {
5270
5391
  options?.onCollector?.(collector);
5271
5392
  } catch {}
5272
5393
  return result;
5273
5394
  };
5274
5395
  wrappedFn.collector = null;
5396
+ Object.defineProperty(wrappedFn, "name", {
5397
+ configurable: true,
5398
+ value: methodName
5399
+ });
5275
5400
  return wrappedFn;
5276
5401
  }
5277
5402
  withSpan(traceFunctionKey, optionsOrFn, maybeFn) {
@@ -5910,7 +6035,7 @@ var Bitfab = class {
5910
6035
  await runWithSeedContext({ traceId }, async () => target(...args));
5911
6036
  } finally {
5912
6037
  try {
5913
- const { flushTraces } = await Promise.resolve().then(() => require("./http-CFwCJQyF.cjs")).then((n) => n.http_exports);
6038
+ const { flushTraces } = await Promise.resolve().then(() => require("./http-CxT_WDAh.cjs")).then((n) => n.http_exports);
5914
6039
  await flushTraces(3e4);
5915
6040
  } finally {
5916
6041
  unrecorded = activeTraceStates.delete(traceId);
@@ -6098,7 +6223,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
6098
6223
  metadata: seedCase.metadata,
6099
6224
  sessionId: seedCase.sessionId
6100
6225
  }));
6101
- const { flushTraces } = await Promise.resolve().then(() => require("./http-CFwCJQyF.cjs")).then((n) => n.http_exports);
6226
+ const { flushTraces } = await Promise.resolve().then(() => require("./http-CxT_WDAh.cjs")).then((n) => n.http_exports);
6102
6227
  await flushTraces(3e4);
6103
6228
  return {
6104
6229
  pipeline,
@@ -6281,6 +6406,12 @@ Object.defineProperty(exports, "TracesClient", {
6281
6406
  return TracesClient;
6282
6407
  }
6283
6408
  });
6409
+ Object.defineProperty(exports, "VerdictsClient", {
6410
+ enumerable: true,
6411
+ get: function() {
6412
+ return VerdictsClient;
6413
+ }
6414
+ });
6284
6415
  Object.defineProperty(exports, "defineReplayRegistry", {
6285
6416
  enumerable: true,
6286
6417
  get: function() {
@@ -6336,4 +6467,4 @@ Object.defineProperty(exports, "serializeReplayResult", {
6336
6467
  }
6337
6468
  });
6338
6469
 
6339
- //# sourceMappingURL=src-mV-7DNLd.cjs.map
6470
+ //# sourceMappingURL=src-DXmdXbOL.cjs.map