braintrust 3.23.1 → 3.24.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/dev/dist/index.d.mts +6 -0
- package/dev/dist/index.d.ts +6 -0
- package/dev/dist/index.js +902 -586
- package/dev/dist/index.mjs +320 -4
- package/dist/apply-auto-instrumentation.js +211 -189
- package/dist/apply-auto-instrumentation.mjs +23 -1
- package/dist/auto-instrumentations/bundler/esbuild.cjs +40 -0
- package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
- package/dist/auto-instrumentations/bundler/next.cjs +40 -0
- package/dist/auto-instrumentations/bundler/next.mjs +3 -3
- package/dist/auto-instrumentations/bundler/rollup.cjs +40 -0
- package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
- package/dist/auto-instrumentations/bundler/vite.cjs +40 -0
- package/dist/auto-instrumentations/bundler/vite.d.mts +1 -1
- package/dist/auto-instrumentations/bundler/vite.d.ts +1 -1
- package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +40 -0
- package/dist/auto-instrumentations/bundler/webpack.cjs +40 -0
- package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
- package/dist/auto-instrumentations/{chunk-KIMLYPRW.mjs → chunk-BURMPO7L.mjs} +1 -1
- package/dist/auto-instrumentations/{chunk-YXLNSAMJ.mjs → chunk-F43DNLPD.mjs} +40 -0
- package/dist/auto-instrumentations/{chunk-EXY7QCJD.mjs → chunk-GSZHTAQW.mjs} +1 -1
- package/dist/auto-instrumentations/hook.mjs +150 -1
- package/dist/auto-instrumentations/index.cjs +40 -0
- package/dist/auto-instrumentations/index.mjs +1 -1
- package/dist/browser.d.mts +131 -9
- package/dist/browser.d.ts +131 -9
- package/dist/browser.js +703 -65
- package/dist/browser.mjs +703 -65
- package/dist/{chunk-CDIKAHDZ.js → chunk-7AUY2XWX.js} +21 -1
- package/dist/{chunk-36IPYKMG.mjs → chunk-7F6GCRHH.mjs} +20 -0
- package/dist/{chunk-B6ZQIAK3.js → chunk-SU6EHKJV.js} +1085 -799
- package/dist/{chunk-RBXD2KYN.mjs → chunk-XE5FS7QY.mjs} +291 -5
- package/dist/cli.js +328 -8
- package/dist/edge-light.js +703 -65
- package/dist/edge-light.mjs +703 -65
- package/dist/index.d.mts +131 -9
- package/dist/index.d.ts +131 -9
- package/dist/index.js +891 -532
- package/dist/index.mjs +423 -64
- package/dist/instrumentation/index.d.mts +130 -9
- package/dist/instrumentation/index.d.ts +130 -9
- package/dist/instrumentation/index.js +601 -65
- package/dist/instrumentation/index.mjs +601 -65
- package/dist/vitest-evals-reporter.js +17 -16
- package/dist/vitest-evals-reporter.mjs +3 -2
- package/dist/workerd.js +703 -65
- package/dist/workerd.mjs +703 -65
- package/package.json +3 -3
- package/util/dist/index.js +4 -0
- package/util/dist/index.mjs +4 -0
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkSU6EHKJVjs = require('./chunk-SU6EHKJV.js');
|
|
8
|
+
require('./chunk-7AUY2XWX.js');
|
|
9
9
|
|
|
10
10
|
// src/wrappers/vitest-evals/reporter.ts
|
|
11
|
-
|
|
11
|
+
_chunkSU6EHKJVjs.configureNode.call(void 0, );
|
|
12
12
|
var RESERVED_NORMALIZED_SPAN_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
13
13
|
"name",
|
|
14
14
|
"type",
|
|
@@ -23,6 +23,7 @@ var BraintrustVitestEvalsReporter = class {
|
|
|
23
23
|
this.options = options;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
|
|
26
27
|
onInit(_vitest) {
|
|
27
28
|
}
|
|
28
29
|
async onTestRunEnd(testModules) {
|
|
@@ -42,7 +43,7 @@ var BraintrustVitestEvalsReporter = class {
|
|
|
42
43
|
for (const { test, meta } of evalTests) {
|
|
43
44
|
logEvalTest(experiment, test, meta);
|
|
44
45
|
}
|
|
45
|
-
await
|
|
46
|
+
await _chunkSU6EHKJVjs.summarizeAndFlush.call(void 0, experiment, {
|
|
46
47
|
displaySummary: this.options.displaySummary
|
|
47
48
|
});
|
|
48
49
|
this.experiment = void 0;
|
|
@@ -58,7 +59,7 @@ var BraintrustVitestEvalsReporter = class {
|
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
const experimentName = _nullishCoalesce(this.options.experimentName, () => ( `vitest-evals-${(/* @__PURE__ */ new Date()).toISOString()}`));
|
|
61
|
-
this.experiment =
|
|
62
|
+
this.experiment = _chunkSU6EHKJVjs.initExperiment.call(void 0, {
|
|
62
63
|
...projectId ? { projectId } : { project: projectName },
|
|
63
64
|
experiment: experimentName,
|
|
64
65
|
metadata: this.options.metadata,
|
|
@@ -272,7 +273,7 @@ function logToolCallSpans(rootSpan, calls) {
|
|
|
272
273
|
}
|
|
273
274
|
}
|
|
274
275
|
function readEvalTaskMeta(input) {
|
|
275
|
-
if (!
|
|
276
|
+
if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
|
|
276
277
|
const evalMeta = readEvalMeta(input.eval);
|
|
277
278
|
const harnessMeta = readHarnessMeta(input.harness);
|
|
278
279
|
if (!evalMeta && !harnessMeta) return void 0;
|
|
@@ -282,7 +283,7 @@ function readEvalTaskMeta(input) {
|
|
|
282
283
|
};
|
|
283
284
|
}
|
|
284
285
|
function readEvalMeta(input) {
|
|
285
|
-
if (!
|
|
286
|
+
if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
|
|
286
287
|
const avgScore = readFiniteOrNull(input.avgScore);
|
|
287
288
|
const scores = Array.isArray(input.scores) ? input.scores.map(readEvalScore).filter(isDefined) : void 0;
|
|
288
289
|
const toolCalls = Array.isArray(input.toolCalls) ? input.toolCalls.map(readToolCall).filter(isDefined) : void 0;
|
|
@@ -295,23 +296,23 @@ function readEvalMeta(input) {
|
|
|
295
296
|
};
|
|
296
297
|
}
|
|
297
298
|
function readEvalScore(input) {
|
|
298
|
-
if (!
|
|
299
|
+
if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
|
|
299
300
|
const score = readFiniteOrNull(input.score);
|
|
300
301
|
return {
|
|
301
302
|
...typeof input.name === "string" ? { name: input.name } : {},
|
|
302
303
|
...score !== void 0 ? { score } : {},
|
|
303
|
-
...
|
|
304
|
+
..._chunkSU6EHKJVjs.isObject.call(void 0, input.metadata) ? { metadata: input.metadata } : {}
|
|
304
305
|
};
|
|
305
306
|
}
|
|
306
307
|
function readHarnessMeta(input) {
|
|
307
|
-
if (!
|
|
308
|
+
if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
|
|
308
309
|
return {
|
|
309
310
|
...typeof input.name === "string" ? { name: input.name } : {},
|
|
310
|
-
...
|
|
311
|
+
..._chunkSU6EHKJVjs.isObject.call(void 0, input.run) ? { run: input.run } : {}
|
|
311
312
|
};
|
|
312
313
|
}
|
|
313
314
|
function readToolCall(input) {
|
|
314
|
-
if (!
|
|
315
|
+
if (!_chunkSU6EHKJVjs.isObject.call(void 0, input)) return void 0;
|
|
315
316
|
return input;
|
|
316
317
|
}
|
|
317
318
|
function filteredNormalizedSpanAttributes(attributes) {
|
|
@@ -371,10 +372,10 @@ function epochSeconds(value) {
|
|
|
371
372
|
}
|
|
372
373
|
function logReporterError(span, error) {
|
|
373
374
|
if (error instanceof Error) {
|
|
374
|
-
|
|
375
|
+
_chunkSU6EHKJVjs.logError.call(void 0, span, error);
|
|
375
376
|
return;
|
|
376
377
|
}
|
|
377
|
-
if (
|
|
378
|
+
if (_chunkSU6EHKJVjs.isObject.call(void 0, error)) {
|
|
378
379
|
const message = typeof error.message === "string" ? error.message : void 0;
|
|
379
380
|
const stack = typeof error.stack === "string" ? error.stack : void 0;
|
|
380
381
|
if (message !== void 0 || stack !== void 0) {
|
|
@@ -386,10 +387,10 @@ ${stack}` : message
|
|
|
386
387
|
return;
|
|
387
388
|
}
|
|
388
389
|
}
|
|
389
|
-
|
|
390
|
+
_chunkSU6EHKJVjs.logError.call(void 0, span, error);
|
|
390
391
|
}
|
|
391
392
|
function formatErrorMessage(error) {
|
|
392
|
-
if (
|
|
393
|
+
if (_chunkSU6EHKJVjs.isObject.call(void 0, error)) {
|
|
393
394
|
if (typeof error.message === "string") return error.message;
|
|
394
395
|
if (typeof error.stack === "string") return error.stack;
|
|
395
396
|
}
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
isObject,
|
|
5
5
|
logError,
|
|
6
6
|
summarizeAndFlush
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-XE5FS7QY.mjs";
|
|
8
|
+
import "./chunk-7F6GCRHH.mjs";
|
|
9
9
|
|
|
10
10
|
// src/wrappers/vitest-evals/reporter.ts
|
|
11
11
|
configureNode();
|
|
@@ -22,6 +22,7 @@ var BraintrustVitestEvalsReporter = class {
|
|
|
22
22
|
constructor(options = {}) {
|
|
23
23
|
this.options = options;
|
|
24
24
|
}
|
|
25
|
+
options;
|
|
25
26
|
experiment;
|
|
26
27
|
onInit(_vitest) {
|
|
27
28
|
}
|