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.
Files changed (50) hide show
  1. package/dev/dist/index.d.mts +6 -8
  2. package/dev/dist/index.d.ts +6 -8
  3. package/dev/dist/index.js +1399 -1466
  4. package/dev/dist/index.mjs +971 -1038
  5. package/dist/apply-auto-instrumentation.js +208 -188
  6. package/dist/apply-auto-instrumentation.mjs +40 -20
  7. package/dist/auto-instrumentations/bundler/esbuild.cjs +230 -40
  8. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -1
  9. package/dist/auto-instrumentations/bundler/next.cjs +230 -40
  10. package/dist/auto-instrumentations/bundler/next.mjs +3 -2
  11. package/dist/auto-instrumentations/bundler/rollup.cjs +230 -40
  12. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -1
  13. package/dist/auto-instrumentations/bundler/vite.cjs +230 -40
  14. package/dist/auto-instrumentations/bundler/vite.mjs +2 -1
  15. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +13 -39
  16. package/dist/auto-instrumentations/bundler/webpack.cjs +230 -40
  17. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -2
  18. package/dist/auto-instrumentations/{chunk-WFEUJACP.mjs → chunk-CNQ7BUKN.mjs} +1 -1
  19. package/dist/auto-instrumentations/chunk-J57YF7WS.mjs +208 -0
  20. package/dist/auto-instrumentations/chunk-QFMACSOL.mjs +280 -0
  21. package/dist/auto-instrumentations/{chunk-GJOO4ESL.mjs → chunk-VXJONZVX.mjs} +28 -40
  22. package/dist/auto-instrumentations/hook.mjs +7985 -46
  23. package/dist/auto-instrumentations/loader/cjs-patch.cjs +194 -4
  24. package/dist/auto-instrumentations/loader/cjs-patch.mjs +13 -27
  25. package/dist/auto-instrumentations/loader/esm-hook.mjs +24 -10
  26. package/dist/browser.d.mts +138 -26
  27. package/dist/browser.d.ts +138 -26
  28. package/dist/browser.js +898 -1063
  29. package/dist/browser.mjs +898 -1063
  30. package/dist/{chunk-75IQCUB2.mjs → chunk-O4ZIWXO3.mjs} +179 -25
  31. package/dist/{chunk-26JGOELH.js → chunk-VMBQETG3.js} +179 -25
  32. package/dist/cli.js +990 -1077
  33. package/dist/edge-light.d.mts +1 -1
  34. package/dist/edge-light.d.ts +1 -1
  35. package/dist/edge-light.js +898 -1063
  36. package/dist/edge-light.mjs +898 -1063
  37. package/dist/index.d.mts +138 -26
  38. package/dist/index.d.ts +138 -26
  39. package/dist/index.js +1690 -1825
  40. package/dist/index.mjs +918 -1053
  41. package/dist/instrumentation/index.d.mts +18 -9
  42. package/dist/instrumentation/index.d.ts +18 -9
  43. package/dist/instrumentation/index.js +711 -1038
  44. package/dist/instrumentation/index.mjs +710 -1038
  45. package/dist/workerd.d.mts +1 -1
  46. package/dist/workerd.d.ts +1 -1
  47. package/dist/workerd.js +898 -1063
  48. package/dist/workerd.mjs +898 -1063
  49. package/package.json +1 -7
  50. 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.13.0",
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
- };