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
|
@@ -1227,8 +1227,6 @@ function isInstrumentationIntegrationDisabled(integrations, ...names) {
|
|
|
1227
1227
|
var DefaultAsyncLocalStorage = class {
|
|
1228
1228
|
constructor() {
|
|
1229
1229
|
}
|
|
1230
|
-
enterWith(_) {
|
|
1231
|
-
}
|
|
1232
1230
|
run(_, callback) {
|
|
1233
1231
|
return callback();
|
|
1234
1232
|
}
|
|
@@ -1336,6 +1334,7 @@ var INSTRUMENTATION_NAMES = {
|
|
|
1336
1334
|
CLOUDFLARE_THINK: "cloudflare-think",
|
|
1337
1335
|
COHERE: "cohere",
|
|
1338
1336
|
CURSOR_SDK: "cursor-sdk",
|
|
1337
|
+
DEEPSEEK_HARNESS: "deepseek-harness",
|
|
1339
1338
|
EVE: "eve",
|
|
1340
1339
|
FLUE: "flue",
|
|
1341
1340
|
GENKIT: "genkit",
|
|
@@ -1367,6 +1366,10 @@ var aiSDKChannels = defineChannels(
|
|
|
1367
1366
|
channelName: "generateText",
|
|
1368
1367
|
kind: "async"
|
|
1369
1368
|
}),
|
|
1369
|
+
generateImage: channel({
|
|
1370
|
+
channelName: "generateImage",
|
|
1371
|
+
kind: "async"
|
|
1372
|
+
}),
|
|
1370
1373
|
streamText: channel({
|
|
1371
1374
|
channelName: "streamText",
|
|
1372
1375
|
kind: "async"
|
|
@@ -1506,6 +1509,33 @@ var aiSDKConfigs = [
|
|
|
1506
1509
|
kind: "Async"
|
|
1507
1510
|
}
|
|
1508
1511
|
},
|
|
1512
|
+
// generateImage - stable in v6+, experimental alias in v5
|
|
1513
|
+
...[
|
|
1514
|
+
{
|
|
1515
|
+
functionName: "generateImage",
|
|
1516
|
+
versionRange: ">=6.0.0 <8.0.0",
|
|
1517
|
+
isExportAlias: false
|
|
1518
|
+
},
|
|
1519
|
+
{
|
|
1520
|
+
functionName: "experimental_generateImage",
|
|
1521
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
1522
|
+
isExportAlias: true
|
|
1523
|
+
}
|
|
1524
|
+
].flatMap(
|
|
1525
|
+
({ functionName, versionRange: versionRange2, isExportAlias }) => ["dist/index.mjs", "dist/index.js"].map((filePath) => ({
|
|
1526
|
+
channelName: aiSDKChannels.generateImage.channelName,
|
|
1527
|
+
module: {
|
|
1528
|
+
name: "ai",
|
|
1529
|
+
versionRange: versionRange2,
|
|
1530
|
+
filePath
|
|
1531
|
+
},
|
|
1532
|
+
functionQuery: {
|
|
1533
|
+
functionName,
|
|
1534
|
+
kind: "Async",
|
|
1535
|
+
...isExportAlias ? { isExportAlias } : {}
|
|
1536
|
+
}
|
|
1537
|
+
}))
|
|
1538
|
+
),
|
|
1509
1539
|
// streamText - async function (v3 only, before the sync refactor in v4)
|
|
1510
1540
|
{
|
|
1511
1541
|
channelName: aiSDKChannels.streamText.channelName,
|
|
@@ -4925,6 +4955,14 @@ function getDefaultInstrumentationConfigs({
|
|
|
4925
4955
|
...additionalInstrumentations ?? []
|
|
4926
4956
|
];
|
|
4927
4957
|
}
|
|
4958
|
+
function getDefaultAutoInstrumentationConfigs(additionalInstrumentations) {
|
|
4959
|
+
return getDefaultInstrumentationConfigs({
|
|
4960
|
+
additionalInstrumentations,
|
|
4961
|
+
disabledIntegrationConfig: readDisabledInstrumentationEnvConfig(
|
|
4962
|
+
process.env.BRAINTRUST_DISABLE_INSTRUMENTATION
|
|
4963
|
+
).integrations
|
|
4964
|
+
});
|
|
4965
|
+
}
|
|
4928
4966
|
|
|
4929
4967
|
// src/auto-instrumentations/loader/mastra-observability-patch.ts
|
|
4930
4968
|
var MASTRA_EXPORTER_FACTORY_GLOBAL = "__braintrustMastraExporterFactory";
|
|
@@ -5191,9 +5229,9 @@ function getModuleVersion(basedir) {
|
|
|
5191
5229
|
}
|
|
5192
5230
|
var matcherCache = /* @__PURE__ */ new Map();
|
|
5193
5231
|
function getMatcher(options) {
|
|
5194
|
-
const allInstrumentations =
|
|
5195
|
-
|
|
5196
|
-
|
|
5232
|
+
const allInstrumentations = getDefaultAutoInstrumentationConfigs(
|
|
5233
|
+
options.instrumentations
|
|
5234
|
+
);
|
|
5197
5235
|
const configHash = JSON.stringify({ allInstrumentations });
|
|
5198
5236
|
if (matcherCache.has(configHash)) {
|
|
5199
5237
|
return matcherCache.get(configHash);
|
|
@@ -1244,8 +1244,6 @@ function isInstrumentationIntegrationDisabled(integrations, ...names) {
|
|
|
1244
1244
|
var DefaultAsyncLocalStorage = class {
|
|
1245
1245
|
constructor() {
|
|
1246
1246
|
}
|
|
1247
|
-
enterWith(_) {
|
|
1248
|
-
}
|
|
1249
1247
|
run(_, callback) {
|
|
1250
1248
|
return callback();
|
|
1251
1249
|
}
|
|
@@ -1353,6 +1351,7 @@ var INSTRUMENTATION_NAMES = {
|
|
|
1353
1351
|
CLOUDFLARE_THINK: "cloudflare-think",
|
|
1354
1352
|
COHERE: "cohere",
|
|
1355
1353
|
CURSOR_SDK: "cursor-sdk",
|
|
1354
|
+
DEEPSEEK_HARNESS: "deepseek-harness",
|
|
1356
1355
|
EVE: "eve",
|
|
1357
1356
|
FLUE: "flue",
|
|
1358
1357
|
GENKIT: "genkit",
|
|
@@ -1384,6 +1383,10 @@ var aiSDKChannels = defineChannels(
|
|
|
1384
1383
|
channelName: "generateText",
|
|
1385
1384
|
kind: "async"
|
|
1386
1385
|
}),
|
|
1386
|
+
generateImage: channel({
|
|
1387
|
+
channelName: "generateImage",
|
|
1388
|
+
kind: "async"
|
|
1389
|
+
}),
|
|
1387
1390
|
streamText: channel({
|
|
1388
1391
|
channelName: "streamText",
|
|
1389
1392
|
kind: "async"
|
|
@@ -1523,6 +1526,33 @@ var aiSDKConfigs = [
|
|
|
1523
1526
|
kind: "Async"
|
|
1524
1527
|
}
|
|
1525
1528
|
},
|
|
1529
|
+
// generateImage - stable in v6+, experimental alias in v5
|
|
1530
|
+
...[
|
|
1531
|
+
{
|
|
1532
|
+
functionName: "generateImage",
|
|
1533
|
+
versionRange: ">=6.0.0 <8.0.0",
|
|
1534
|
+
isExportAlias: false
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
functionName: "experimental_generateImage",
|
|
1538
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
1539
|
+
isExportAlias: true
|
|
1540
|
+
}
|
|
1541
|
+
].flatMap(
|
|
1542
|
+
({ functionName, versionRange: versionRange2, isExportAlias }) => ["dist/index.mjs", "dist/index.js"].map((filePath) => ({
|
|
1543
|
+
channelName: aiSDKChannels.generateImage.channelName,
|
|
1544
|
+
module: {
|
|
1545
|
+
name: "ai",
|
|
1546
|
+
versionRange: versionRange2,
|
|
1547
|
+
filePath
|
|
1548
|
+
},
|
|
1549
|
+
functionQuery: {
|
|
1550
|
+
functionName,
|
|
1551
|
+
kind: "Async",
|
|
1552
|
+
...isExportAlias ? { isExportAlias } : {}
|
|
1553
|
+
}
|
|
1554
|
+
}))
|
|
1555
|
+
),
|
|
1526
1556
|
// streamText - async function (v3 only, before the sync refactor in v4)
|
|
1527
1557
|
{
|
|
1528
1558
|
channelName: aiSDKChannels.streamText.channelName,
|
|
@@ -4942,6 +4972,14 @@ function getDefaultInstrumentationConfigs({
|
|
|
4942
4972
|
...additionalInstrumentations ?? []
|
|
4943
4973
|
];
|
|
4944
4974
|
}
|
|
4975
|
+
function getDefaultAutoInstrumentationConfigs(additionalInstrumentations) {
|
|
4976
|
+
return getDefaultInstrumentationConfigs({
|
|
4977
|
+
additionalInstrumentations,
|
|
4978
|
+
disabledIntegrationConfig: readDisabledInstrumentationEnvConfig(
|
|
4979
|
+
process.env.BRAINTRUST_DISABLE_INSTRUMENTATION
|
|
4980
|
+
).integrations
|
|
4981
|
+
});
|
|
4982
|
+
}
|
|
4945
4983
|
|
|
4946
4984
|
// src/auto-instrumentations/loader/mastra-observability-patch.ts
|
|
4947
4985
|
var MASTRA_EXPORTER_FACTORY_GLOBAL = "__braintrustMastraExporterFactory";
|
|
@@ -5208,9 +5246,9 @@ function getModuleVersion(basedir) {
|
|
|
5208
5246
|
}
|
|
5209
5247
|
var unplugin = (0, import_unplugin.createUnplugin)((options = {}) => {
|
|
5210
5248
|
const browser = options.browser ?? options.useDiagnosticChannelCompatShim ?? false;
|
|
5211
|
-
const allInstrumentations =
|
|
5212
|
-
|
|
5213
|
-
|
|
5249
|
+
const allInstrumentations = getDefaultAutoInstrumentationConfigs(
|
|
5250
|
+
options.instrumentations
|
|
5251
|
+
);
|
|
5214
5252
|
const instrumentationMatcher = create(allInstrumentations);
|
|
5215
5253
|
return {
|
|
5216
5254
|
name: "code-transformer",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
braintrustWebpackPlugin,
|
|
3
3
|
webpackPlugin
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-OMCZ3MV2.mjs";
|
|
5
|
+
import "../chunk-DKTGDNA7.mjs";
|
|
6
|
+
import "../chunk-AOIYCVEL.mjs";
|
|
7
7
|
import "../chunk-I55G56ZL.mjs";
|
|
8
8
|
import "../chunk-JPUFNW7X.mjs";
|
|
9
9
|
import "../chunk-P5YLNB2A.mjs";
|
|
@@ -6,8 +6,6 @@ import {
|
|
|
6
6
|
var DefaultAsyncLocalStorage = class {
|
|
7
7
|
constructor() {
|
|
8
8
|
}
|
|
9
|
-
enterWith(_) {
|
|
10
|
-
}
|
|
11
9
|
run(_, callback) {
|
|
12
10
|
return callback();
|
|
13
11
|
}
|
|
@@ -115,6 +113,7 @@ var INSTRUMENTATION_NAMES = {
|
|
|
115
113
|
CLOUDFLARE_THINK: "cloudflare-think",
|
|
116
114
|
COHERE: "cohere",
|
|
117
115
|
CURSOR_SDK: "cursor-sdk",
|
|
116
|
+
DEEPSEEK_HARNESS: "deepseek-harness",
|
|
118
117
|
EVE: "eve",
|
|
119
118
|
FLUE: "flue",
|
|
120
119
|
GENKIT: "genkit",
|
|
@@ -676,6 +675,10 @@ var aiSDKChannels = defineChannels(
|
|
|
676
675
|
channelName: "generateText",
|
|
677
676
|
kind: "async"
|
|
678
677
|
}),
|
|
678
|
+
generateImage: channel({
|
|
679
|
+
channelName: "generateImage",
|
|
680
|
+
kind: "async"
|
|
681
|
+
}),
|
|
679
682
|
streamText: channel({
|
|
680
683
|
channelName: "streamText",
|
|
681
684
|
kind: "async"
|
|
@@ -815,6 +818,33 @@ var aiSDKConfigs = [
|
|
|
815
818
|
kind: "Async"
|
|
816
819
|
}
|
|
817
820
|
},
|
|
821
|
+
// generateImage - stable in v6+, experimental alias in v5
|
|
822
|
+
...[
|
|
823
|
+
{
|
|
824
|
+
functionName: "generateImage",
|
|
825
|
+
versionRange: ">=6.0.0 <8.0.0",
|
|
826
|
+
isExportAlias: false
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
functionName: "experimental_generateImage",
|
|
830
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
831
|
+
isExportAlias: true
|
|
832
|
+
}
|
|
833
|
+
].flatMap(
|
|
834
|
+
({ functionName, versionRange: versionRange2, isExportAlias }) => ["dist/index.mjs", "dist/index.js"].map((filePath) => ({
|
|
835
|
+
channelName: aiSDKChannels.generateImage.channelName,
|
|
836
|
+
module: {
|
|
837
|
+
name: "ai",
|
|
838
|
+
versionRange: versionRange2,
|
|
839
|
+
filePath
|
|
840
|
+
},
|
|
841
|
+
functionQuery: {
|
|
842
|
+
functionName,
|
|
843
|
+
kind: "Async",
|
|
844
|
+
...isExportAlias ? { isExportAlias } : {}
|
|
845
|
+
}
|
|
846
|
+
}))
|
|
847
|
+
),
|
|
818
848
|
// streamText - async function (v3 only, before the sync refactor in v4)
|
|
819
849
|
{
|
|
820
850
|
channelName: aiSDKChannels.streamText.channelName,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
openRouterConfigs,
|
|
28
28
|
openaiConfigs,
|
|
29
29
|
piCodingAgentConfigs
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-AOIYCVEL.mjs";
|
|
31
31
|
import {
|
|
32
32
|
applySpecialCasePatch,
|
|
33
33
|
create
|
|
@@ -485,6 +485,14 @@ function getDefaultInstrumentationConfigs({
|
|
|
485
485
|
...additionalInstrumentations ?? []
|
|
486
486
|
];
|
|
487
487
|
}
|
|
488
|
+
function getDefaultAutoInstrumentationConfigs(additionalInstrumentations) {
|
|
489
|
+
return getDefaultInstrumentationConfigs({
|
|
490
|
+
additionalInstrumentations,
|
|
491
|
+
disabledIntegrationConfig: readDisabledInstrumentationEnvConfig(
|
|
492
|
+
process.env.BRAINTRUST_DISABLE_INSTRUMENTATION
|
|
493
|
+
).integrations
|
|
494
|
+
});
|
|
495
|
+
}
|
|
488
496
|
|
|
489
497
|
// src/auto-instrumentations/bundler/plugin.ts
|
|
490
498
|
function getModuleVersion(basedir) {
|
|
@@ -500,9 +508,9 @@ function getModuleVersion(basedir) {
|
|
|
500
508
|
}
|
|
501
509
|
var unplugin = createUnplugin((options = {}) => {
|
|
502
510
|
const browser = options.browser ?? options.useDiagnosticChannelCompatShim ?? false;
|
|
503
|
-
const allInstrumentations =
|
|
504
|
-
|
|
505
|
-
|
|
511
|
+
const allInstrumentations = getDefaultAutoInstrumentationConfigs(
|
|
512
|
+
options.instrumentations
|
|
513
|
+
);
|
|
506
514
|
const instrumentationMatcher = create(allInstrumentations);
|
|
507
515
|
return {
|
|
508
516
|
name: "code-transformer",
|