braintrust 3.28.0 → 3.29.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.
- package/README.md +1 -1
- package/dev/dist/index.d.mts +356 -7
- package/dev/dist/index.d.ts +356 -7
- package/dev/dist/index.js +1815 -1548
- package/dev/dist/index.mjs +1054 -787
- package/dist/apply-auto-instrumentation.js +297 -264
- package/dist/apply-auto-instrumentation.mjs +84 -51
- package/dist/auto-instrumentations/bundler/esbuild.cjs +43 -5
- package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
- package/dist/auto-instrumentations/bundler/next.cjs +43 -5
- package/dist/auto-instrumentations/bundler/next.mjs +3 -3
- package/dist/auto-instrumentations/bundler/rollup.cjs +43 -5
- package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
- package/dist/auto-instrumentations/bundler/vite.cjs +43 -5
- package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +43 -5
- package/dist/auto-instrumentations/bundler/webpack.cjs +43 -5
- package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
- package/dist/auto-instrumentations/{chunk-NP7V4XB2.mjs → chunk-AOIYCVEL.mjs} +32 -2
- package/dist/auto-instrumentations/{chunk-26PKVUKB.mjs → chunk-DKTGDNA7.mjs} +12 -4
- package/dist/auto-instrumentations/{chunk-HD35AM3M.mjs → chunk-OMCZ3MV2.mjs} +1 -1
- package/dist/auto-instrumentations/hook.mjs +952 -133
- package/dist/auto-instrumentations/index.cjs +32 -2
- package/dist/auto-instrumentations/index.mjs +1 -1
- package/dist/browser.d.mts +760 -22
- package/dist/browser.d.ts +760 -22
- package/dist/browser.js +1661 -848
- package/dist/browser.mjs +1661 -848
- package/dist/{chunk-BBE7SNRV.js → chunk-6Z5S7VOU.js} +143 -23
- package/dist/{chunk-ZHUHZWFY.mjs → chunk-7FA6VP2S.mjs} +140 -20
- package/dist/{chunk-UPFNQCGB.mjs → chunk-M6XPNJC4.mjs} +1144 -931
- package/dist/{chunk-OBBWQW6K.js → chunk-XLLGRXGR.js} +2335 -2122
- package/dist/cli.js +5134 -1090
- package/dist/edge-light.js +1661 -848
- package/dist/edge-light.mjs +1661 -848
- package/dist/index.d.mts +760 -22
- package/dist/index.d.ts +760 -22
- package/dist/index.js +1054 -567
- package/dist/index.mjs +514 -27
- package/dist/instrumentation/index.d.mts +548 -9
- package/dist/instrumentation/index.d.ts +548 -9
- package/dist/instrumentation/index.js +1975 -765
- package/dist/instrumentation/index.mjs +1975 -765
- package/dist/vitest-evals-reporter.js +16 -16
- package/dist/vitest-evals-reporter.mjs +2 -2
- package/dist/workerd.js +1661 -848
- package/dist/workerd.mjs +1661 -848
- package/package.json +1 -1
- package/util/dist/index.d.mts +42 -0
- package/util/dist/index.d.ts +42 -0
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkXLLGRXGRjs = require('./chunk-XLLGRXGR.js');
|
|
8
|
+
require('./chunk-6Z5S7VOU.js');
|
|
9
9
|
|
|
10
10
|
// src/wrappers/vitest-evals/reporter.ts
|
|
11
|
-
|
|
11
|
+
_chunkXLLGRXGRjs.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
|
|
46
|
+
await _chunkXLLGRXGRjs.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 =
|
|
62
|
+
this.experiment = _chunkXLLGRXGRjs.initExperiment.call(void 0, {
|
|
63
63
|
...projectId ? { projectId } : { project: projectName },
|
|
64
64
|
experiment: experimentName,
|
|
65
65
|
metadata: this.options.metadata,
|
|
@@ -274,7 +274,7 @@ function logToolCallSpans(rootSpan, calls) {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
function readEvalTaskMeta(input) {
|
|
277
|
-
if (!
|
|
277
|
+
if (!_chunkXLLGRXGRjs.isObject.call(void 0, input)) return void 0;
|
|
278
278
|
const evalMeta = readEvalMeta(input.eval);
|
|
279
279
|
const harnessMeta = readHarnessMeta(input.harness);
|
|
280
280
|
if (!evalMeta && !harnessMeta) return void 0;
|
|
@@ -284,7 +284,7 @@ function readEvalTaskMeta(input) {
|
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
function readEvalMeta(input) {
|
|
287
|
-
if (!
|
|
287
|
+
if (!_chunkXLLGRXGRjs.isObject.call(void 0, input)) return void 0;
|
|
288
288
|
const avgScore = readFiniteOrNull(input.avgScore);
|
|
289
289
|
const scores = Array.isArray(input.scores) ? input.scores.map(readEvalScore).filter(isDefined) : void 0;
|
|
290
290
|
const toolCalls = Array.isArray(input.toolCalls) ? input.toolCalls.map(readToolCall).filter(isDefined) : void 0;
|
|
@@ -298,23 +298,23 @@ function readEvalMeta(input) {
|
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
300
|
function readEvalScore(input) {
|
|
301
|
-
if (!
|
|
301
|
+
if (!_chunkXLLGRXGRjs.isObject.call(void 0, input)) return void 0;
|
|
302
302
|
const score = readFiniteOrNull(input.score);
|
|
303
303
|
return {
|
|
304
304
|
...typeof input.name === "string" ? { name: input.name } : {},
|
|
305
305
|
...score !== void 0 ? { score } : {},
|
|
306
|
-
...
|
|
306
|
+
..._chunkXLLGRXGRjs.isObject.call(void 0, input.metadata) ? { metadata: input.metadata } : {}
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
309
|
function readHarnessMeta(input) {
|
|
310
|
-
if (!
|
|
310
|
+
if (!_chunkXLLGRXGRjs.isObject.call(void 0, input)) return void 0;
|
|
311
311
|
return {
|
|
312
312
|
...typeof input.name === "string" ? { name: input.name } : {},
|
|
313
|
-
...
|
|
313
|
+
..._chunkXLLGRXGRjs.isObject.call(void 0, input.run) ? { run: input.run } : {}
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
316
|
function readToolCall(input) {
|
|
317
|
-
if (!
|
|
317
|
+
if (!_chunkXLLGRXGRjs.isObject.call(void 0, input)) return void 0;
|
|
318
318
|
return input;
|
|
319
319
|
}
|
|
320
320
|
function filteredNormalizedSpanAttributes(attributes) {
|
|
@@ -374,10 +374,10 @@ function epochSeconds(value) {
|
|
|
374
374
|
}
|
|
375
375
|
function logReporterError(span, error) {
|
|
376
376
|
if (error instanceof Error) {
|
|
377
|
-
|
|
377
|
+
_chunkXLLGRXGRjs.logError.call(void 0, span, error);
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
380
|
-
if (
|
|
380
|
+
if (_chunkXLLGRXGRjs.isObject.call(void 0, error)) {
|
|
381
381
|
const message = typeof error.message === "string" ? error.message : void 0;
|
|
382
382
|
const stack = typeof error.stack === "string" ? error.stack : void 0;
|
|
383
383
|
if (message !== void 0 || stack !== void 0) {
|
|
@@ -389,10 +389,10 @@ ${stack}` : message
|
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
|
|
392
|
+
_chunkXLLGRXGRjs.logError.call(void 0, span, error);
|
|
393
393
|
}
|
|
394
394
|
function formatErrorMessage(error) {
|
|
395
|
-
if (
|
|
395
|
+
if (_chunkXLLGRXGRjs.isObject.call(void 0, error)) {
|
|
396
396
|
if (typeof error.message === "string") return error.message;
|
|
397
397
|
if (typeof error.stack === "string") return error.stack;
|
|
398
398
|
}
|