braintrust 3.24.0 → 3.25.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 (47) hide show
  1. package/dev/dist/index.d.mts +5 -0
  2. package/dev/dist/index.d.ts +5 -0
  3. package/dev/dist/index.js +2614 -1567
  4. package/dev/dist/index.mjs +2037 -990
  5. package/dist/apply-auto-instrumentation.js +200 -199
  6. package/dist/apply-auto-instrumentation.mjs +8 -7
  7. package/dist/auto-instrumentations/bundler/esbuild.cjs +596 -462
  8. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  9. package/dist/auto-instrumentations/bundler/next.cjs +596 -462
  10. package/dist/auto-instrumentations/bundler/next.mjs +3 -3
  11. package/dist/auto-instrumentations/bundler/rollup.cjs +596 -462
  12. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  13. package/dist/auto-instrumentations/bundler/vite.cjs +596 -462
  14. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  15. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +596 -462
  16. package/dist/auto-instrumentations/bundler/webpack.cjs +596 -462
  17. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  18. package/dist/auto-instrumentations/{chunk-BURMPO7L.mjs → chunk-7P6563SW.mjs} +1 -1
  19. package/dist/auto-instrumentations/{chunk-F43DNLPD.mjs → chunk-CZ24KNHT.mjs} +569 -442
  20. package/dist/auto-instrumentations/{chunk-GSZHTAQW.mjs → chunk-JPVCUKTY.mjs} +30 -21
  21. package/dist/auto-instrumentations/hook.mjs +648 -476
  22. package/dist/auto-instrumentations/index.cjs +568 -442
  23. package/dist/auto-instrumentations/index.mjs +1 -1
  24. package/dist/browser.d.mts +7 -0
  25. package/dist/browser.d.ts +7 -0
  26. package/dist/browser.js +2022 -971
  27. package/dist/browser.mjs +2022 -971
  28. package/dist/{chunk-XE5FS7QY.mjs → chunk-2SANLSWX.mjs} +1375 -597
  29. package/dist/{chunk-7F6GCRHH.mjs → chunk-ABR2QWDP.mjs} +702 -456
  30. package/dist/{chunk-SU6EHKJV.js → chunk-GSIDVFE6.js} +2176 -1398
  31. package/dist/{chunk-7AUY2XWX.js → chunk-P25IOOU4.js} +704 -458
  32. package/dist/cli.js +2005 -958
  33. package/dist/edge-light.js +2022 -971
  34. package/dist/edge-light.mjs +2022 -971
  35. package/dist/index.d.mts +7 -0
  36. package/dist/index.d.ts +7 -0
  37. package/dist/index.js +447 -402
  38. package/dist/index.mjs +72 -27
  39. package/dist/instrumentation/index.d.mts +5 -0
  40. package/dist/instrumentation/index.d.ts +5 -0
  41. package/dist/instrumentation/index.js +1990 -981
  42. package/dist/instrumentation/index.mjs +1990 -981
  43. package/dist/vitest-evals-reporter.js +16 -16
  44. package/dist/vitest-evals-reporter.mjs +2 -2
  45. package/dist/workerd.js +2022 -971
  46. package/dist/workerd.mjs +2022 -971
  47. package/package.json +2 -2
@@ -4,11 +4,11 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkSU6EHKJVjs = require('./chunk-SU6EHKJV.js');
8
- require('./chunk-7AUY2XWX.js');
7
+ var _chunkGSIDVFE6js = require('./chunk-GSIDVFE6.js');
8
+ require('./chunk-P25IOOU4.js');
9
9
 
10
10
  // src/wrappers/vitest-evals/reporter.ts
11
- _chunkSU6EHKJVjs.configureNode.call(void 0, );
11
+ _chunkGSIDVFE6js.configureNode.call(void 0, );
12
12
  var RESERVED_NORMALIZED_SPAN_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
13
13
  "name",
14
14
  "type",
@@ -43,7 +43,7 @@ var BraintrustVitestEvalsReporter = class {
43
43
  for (const { test, meta } of evalTests) {
44
44
  logEvalTest(experiment, test, meta);
45
45
  }
46
- await _chunkSU6EHKJVjs.summarizeAndFlush.call(void 0, experiment, {
46
+ await _chunkGSIDVFE6js.summarizeAndFlush.call(void 0, experiment, {
47
47
  displaySummary: this.options.displaySummary
48
48
  });
49
49
  this.experiment = void 0;
@@ -59,7 +59,7 @@ var BraintrustVitestEvalsReporter = class {
59
59
  );
60
60
  }
61
61
  const experimentName = _nullishCoalesce(this.options.experimentName, () => ( `vitest-evals-${(/* @__PURE__ */ new Date()).toISOString()}`));
62
- this.experiment = _chunkSU6EHKJVjs.initExperiment.call(void 0, {
62
+ this.experiment = _chunkGSIDVFE6js.initExperiment.call(void 0, {
63
63
  ...projectId ? { projectId } : { project: projectName },
64
64
  experiment: experimentName,
65
65
  metadata: this.options.metadata,
@@ -273,7 +273,7 @@ function logToolCallSpans(rootSpan, calls) {
273
273
  }
274
274
  }
275
275
  function readEvalTaskMeta(input) {
276
- if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
276
+ if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
277
277
  const evalMeta = readEvalMeta(input.eval);
278
278
  const harnessMeta = readHarnessMeta(input.harness);
279
279
  if (!evalMeta && !harnessMeta) return void 0;
@@ -283,7 +283,7 @@ function readEvalTaskMeta(input) {
283
283
  };
284
284
  }
285
285
  function readEvalMeta(input) {
286
- if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
286
+ if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
287
287
  const avgScore = readFiniteOrNull(input.avgScore);
288
288
  const scores = Array.isArray(input.scores) ? input.scores.map(readEvalScore).filter(isDefined) : void 0;
289
289
  const toolCalls = Array.isArray(input.toolCalls) ? input.toolCalls.map(readToolCall).filter(isDefined) : void 0;
@@ -296,23 +296,23 @@ function readEvalMeta(input) {
296
296
  };
297
297
  }
298
298
  function readEvalScore(input) {
299
- if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
299
+ if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
300
300
  const score = readFiniteOrNull(input.score);
301
301
  return {
302
302
  ...typeof input.name === "string" ? { name: input.name } : {},
303
303
  ...score !== void 0 ? { score } : {},
304
- ..._chunkSU6EHKJVjs.isObject.call(void 0, input.metadata) ? { metadata: input.metadata } : {}
304
+ ..._chunkGSIDVFE6js.isObject.call(void 0, input.metadata) ? { metadata: input.metadata } : {}
305
305
  };
306
306
  }
307
307
  function readHarnessMeta(input) {
308
- if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
308
+ if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
309
309
  return {
310
310
  ...typeof input.name === "string" ? { name: input.name } : {},
311
- ..._chunkSU6EHKJVjs.isObject.call(void 0, input.run) ? { run: input.run } : {}
311
+ ..._chunkGSIDVFE6js.isObject.call(void 0, input.run) ? { run: input.run } : {}
312
312
  };
313
313
  }
314
314
  function readToolCall(input) {
315
- if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
315
+ if (!_chunkGSIDVFE6js.isObject.call(void 0, input)) return void 0;
316
316
  return input;
317
317
  }
318
318
  function filteredNormalizedSpanAttributes(attributes) {
@@ -372,10 +372,10 @@ function epochSeconds(value) {
372
372
  }
373
373
  function logReporterError(span, error) {
374
374
  if (error instanceof Error) {
375
- _chunkSU6EHKJVjs.logError.call(void 0, span, error);
375
+ _chunkGSIDVFE6js.logError.call(void 0, span, error);
376
376
  return;
377
377
  }
378
- if (_chunkSU6EHKJVjs.isObject.call(void 0, error)) {
378
+ if (_chunkGSIDVFE6js.isObject.call(void 0, error)) {
379
379
  const message = typeof error.message === "string" ? error.message : void 0;
380
380
  const stack = typeof error.stack === "string" ? error.stack : void 0;
381
381
  if (message !== void 0 || stack !== void 0) {
@@ -387,10 +387,10 @@ ${stack}` : message
387
387
  return;
388
388
  }
389
389
  }
390
- _chunkSU6EHKJVjs.logError.call(void 0, span, error);
390
+ _chunkGSIDVFE6js.logError.call(void 0, span, error);
391
391
  }
392
392
  function formatErrorMessage(error) {
393
- if (_chunkSU6EHKJVjs.isObject.call(void 0, error)) {
393
+ if (_chunkGSIDVFE6js.isObject.call(void 0, error)) {
394
394
  if (typeof error.message === "string") return error.message;
395
395
  if (typeof error.stack === "string") return error.stack;
396
396
  }
@@ -4,8 +4,8 @@ import {
4
4
  isObject,
5
5
  logError,
6
6
  summarizeAndFlush
7
- } from "./chunk-XE5FS7QY.mjs";
8
- import "./chunk-7F6GCRHH.mjs";
7
+ } from "./chunk-2SANLSWX.mjs";
8
+ import "./chunk-ABR2QWDP.mjs";
9
9
 
10
10
  // src/wrappers/vitest-evals/reporter.ts
11
11
  configureNode();