braintrust 3.13.0 → 3.15.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 -8
- package/dev/dist/index.d.ts +6 -8
- package/dev/dist/index.js +1399 -1466
- package/dev/dist/index.mjs +971 -1038
- package/dist/apply-auto-instrumentation.js +208 -188
- package/dist/apply-auto-instrumentation.mjs +40 -20
- package/dist/auto-instrumentations/bundler/esbuild.cjs +230 -40
- package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -1
- package/dist/auto-instrumentations/bundler/next.cjs +230 -40
- package/dist/auto-instrumentations/bundler/next.mjs +3 -2
- package/dist/auto-instrumentations/bundler/rollup.cjs +230 -40
- package/dist/auto-instrumentations/bundler/rollup.mjs +2 -1
- package/dist/auto-instrumentations/bundler/vite.cjs +230 -40
- package/dist/auto-instrumentations/bundler/vite.mjs +2 -1
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +13 -39
- package/dist/auto-instrumentations/bundler/webpack.cjs +230 -40
- package/dist/auto-instrumentations/bundler/webpack.mjs +3 -2
- package/dist/auto-instrumentations/{chunk-WFEUJACP.mjs → chunk-CNQ7BUKN.mjs} +1 -1
- package/dist/auto-instrumentations/chunk-J57YF7WS.mjs +208 -0
- package/dist/auto-instrumentations/chunk-QFMACSOL.mjs +280 -0
- package/dist/auto-instrumentations/{chunk-GJOO4ESL.mjs → chunk-VXJONZVX.mjs} +28 -40
- package/dist/auto-instrumentations/hook.mjs +7985 -46
- package/dist/auto-instrumentations/loader/cjs-patch.cjs +194 -4
- package/dist/auto-instrumentations/loader/cjs-patch.mjs +13 -27
- package/dist/auto-instrumentations/loader/esm-hook.mjs +24 -10
- package/dist/browser.d.mts +138 -26
- package/dist/browser.d.ts +138 -26
- package/dist/browser.js +898 -1063
- package/dist/browser.mjs +898 -1063
- package/dist/{chunk-75IQCUB2.mjs → chunk-O4ZIWXO3.mjs} +179 -25
- package/dist/{chunk-26JGOELH.js → chunk-VMBQETG3.js} +179 -25
- package/dist/cli.js +990 -1077
- package/dist/edge-light.d.mts +1 -1
- package/dist/edge-light.d.ts +1 -1
- package/dist/edge-light.js +898 -1063
- package/dist/edge-light.mjs +898 -1063
- package/dist/index.d.mts +138 -26
- package/dist/index.d.ts +138 -26
- package/dist/index.js +1690 -1825
- package/dist/index.mjs +918 -1053
- package/dist/instrumentation/index.d.mts +18 -9
- package/dist/instrumentation/index.d.ts +18 -9
- package/dist/instrumentation/index.js +711 -1038
- package/dist/instrumentation/index.mjs +710 -1038
- package/dist/workerd.d.mts +1 -1
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +898 -1063
- package/dist/workerd.mjs +898 -1063
- package/package.json +1 -7
- package/dist/auto-instrumentations/chunk-MWZXZQUO.mjs +0 -81
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "braintrust",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "SDK for integrating Braintrust",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -162,17 +162,13 @@
|
|
|
162
162
|
"author": "",
|
|
163
163
|
"license": "MIT",
|
|
164
164
|
"devDependencies": {
|
|
165
|
-
"@ai-sdk/anthropic": "2.0.37",
|
|
166
165
|
"@anthropic-ai/sdk": "^0.60.0",
|
|
167
|
-
"@google/adk": "^0.6.1",
|
|
168
|
-
"@google/genai": "^1.25.0",
|
|
169
166
|
"@nodelib/fs.walk": "^1.2.8",
|
|
170
167
|
"@types/argparse": "^2.0.14",
|
|
171
168
|
"@types/async": "^3.2.24",
|
|
172
169
|
"@types/cli-progress": "^3.11.5",
|
|
173
170
|
"@types/cors": "^2.8.17",
|
|
174
171
|
"@types/express": "^5.0.0",
|
|
175
|
-
"@types/graceful-fs": "^4.1.9",
|
|
176
172
|
"@types/http-errors": "^2.0.4",
|
|
177
173
|
"@types/mustache": "^4.2.5",
|
|
178
174
|
"@types/node": "^20.10.5",
|
|
@@ -182,7 +178,6 @@
|
|
|
182
178
|
"@typescript-eslint/parser": "^8.49.0",
|
|
183
179
|
"ai": "^6.0.0",
|
|
184
180
|
"async": "^3.2.5",
|
|
185
|
-
"autoevals": "^0.0.131",
|
|
186
181
|
"cross-env": "^7.0.3",
|
|
187
182
|
"eslint-plugin-node-import": "^1.0.5",
|
|
188
183
|
"openai": "6.25.0",
|
|
@@ -214,7 +209,6 @@
|
|
|
214
209
|
"esbuild": "0.28.0",
|
|
215
210
|
"eventsource-parser": "^1.1.2",
|
|
216
211
|
"express": "^5.2.1",
|
|
217
|
-
"graceful-fs": "^4.2.11",
|
|
218
212
|
"http-errors": "^2.0.0",
|
|
219
213
|
"minimatch": "^10.2.5",
|
|
220
214
|
"module-details-from-path": "^1.0.4",
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// src/auto-instrumentations/loader/get-package-version.ts
|
|
2
|
-
import { readFileSync, realpathSync } from "fs";
|
|
3
|
-
import { join } from "path";
|
|
4
|
-
var packageVersions = /* @__PURE__ */ new Map();
|
|
5
|
-
var packageNames = /* @__PURE__ */ new Map();
|
|
6
|
-
function readPackageJson(baseDir) {
|
|
7
|
-
try {
|
|
8
|
-
const packageJsonPath = join(baseDir, "package.json");
|
|
9
|
-
const jsonFile = readFileSync(packageJsonPath, "utf8");
|
|
10
|
-
return JSON.parse(jsonFile);
|
|
11
|
-
} catch {
|
|
12
|
-
return void 0;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function resolvePackageBaseDir(baseDir) {
|
|
16
|
-
try {
|
|
17
|
-
return realpathSync(baseDir);
|
|
18
|
-
} catch {
|
|
19
|
-
return baseDir;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function readPackageJsonWithFallback(baseDir) {
|
|
23
|
-
const packageJson = readPackageJson(baseDir);
|
|
24
|
-
if (packageJson) {
|
|
25
|
-
return packageJson;
|
|
26
|
-
}
|
|
27
|
-
const resolvedBaseDir = resolvePackageBaseDir(baseDir);
|
|
28
|
-
if (resolvedBaseDir === baseDir) {
|
|
29
|
-
return void 0;
|
|
30
|
-
}
|
|
31
|
-
return readPackageJson(resolvedBaseDir);
|
|
32
|
-
}
|
|
33
|
-
function getPackageVersion(baseDir) {
|
|
34
|
-
if (packageVersions.has(baseDir)) {
|
|
35
|
-
return packageVersions.get(baseDir);
|
|
36
|
-
}
|
|
37
|
-
const packageJson = readPackageJsonWithFallback(baseDir);
|
|
38
|
-
if (typeof packageJson?.version === "string") {
|
|
39
|
-
packageVersions.set(baseDir, packageJson.version);
|
|
40
|
-
return packageJson.version;
|
|
41
|
-
}
|
|
42
|
-
return process.version.slice(1);
|
|
43
|
-
}
|
|
44
|
-
function getPackageName(baseDir) {
|
|
45
|
-
if (packageNames.has(baseDir)) {
|
|
46
|
-
return packageNames.get(baseDir);
|
|
47
|
-
}
|
|
48
|
-
const packageJson = readPackageJsonWithFallback(baseDir);
|
|
49
|
-
if (typeof packageJson?.name === "string") {
|
|
50
|
-
packageNames.set(baseDir, packageJson.name);
|
|
51
|
-
return packageJson.name;
|
|
52
|
-
}
|
|
53
|
-
return void 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// src/auto-instrumentations/loader/openai-api-promise-patch.ts
|
|
57
|
-
var OPENAI_API_PROMISE_PATCH = `
|
|
58
|
-
;(function __btPatchAPIPromise() {
|
|
59
|
-
if (typeof APIPromise === "undefined" || APIPromise.prototype.__btParsePatched) return;
|
|
60
|
-
APIPromise.prototype.__btParsePatched = true;
|
|
61
|
-
var _origThen = APIPromise.prototype.then;
|
|
62
|
-
APIPromise.prototype.then = function __btThen(onfulfilled, onrejected) {
|
|
63
|
-
if (!this.__btParseWrapped && Object.prototype.hasOwnProperty.call(this, "parseResponse")) {
|
|
64
|
-
this.__btParseWrapped = true;
|
|
65
|
-
var _origParse = this.parseResponse;
|
|
66
|
-
var _cached;
|
|
67
|
-
this.parseResponse = function() {
|
|
68
|
-
if (!_cached) _cached = _origParse.apply(this, arguments);
|
|
69
|
-
return _cached;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
return _origThen.call(this, onfulfilled, onrejected);
|
|
73
|
-
};
|
|
74
|
-
})();
|
|
75
|
-
`;
|
|
76
|
-
|
|
77
|
-
export {
|
|
78
|
-
getPackageVersion,
|
|
79
|
-
getPackageName,
|
|
80
|
-
OPENAI_API_PROMISE_PATCH
|
|
81
|
-
};
|