braintrust 3.4.0 → 3.6.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 +49 -7
- package/dev/dist/index.d.ts +49 -7
- package/dev/dist/index.js +2383 -494
- package/dev/dist/index.mjs +2213 -324
- package/dist/auto-instrumentations/bundler/esbuild.cjs +289 -10
- package/dist/auto-instrumentations/bundler/esbuild.d.mts +2 -2
- package/dist/auto-instrumentations/bundler/esbuild.d.ts +2 -2
- package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
- package/dist/auto-instrumentations/bundler/rollup.cjs +289 -10
- package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
- package/dist/auto-instrumentations/bundler/vite.cjs +289 -10
- package/dist/auto-instrumentations/bundler/vite.d.mts +2 -2
- package/dist/auto-instrumentations/bundler/vite.d.ts +2 -2
- package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
- package/dist/auto-instrumentations/bundler/webpack.cjs +289 -10
- package/dist/auto-instrumentations/bundler/webpack.d.mts +2 -2
- package/dist/auto-instrumentations/bundler/webpack.d.ts +2 -2
- package/dist/auto-instrumentations/bundler/webpack.mjs +2 -2
- package/dist/auto-instrumentations/chunk-EVUKFMHG.mjs +41 -0
- package/dist/auto-instrumentations/{chunk-LVWWLUMN.mjs → chunk-F7WAXFNM.mjs} +290 -11
- package/dist/auto-instrumentations/chunk-VLEJ5AEK.mjs +41 -0
- package/dist/auto-instrumentations/{chunk-D5ZPIUEL.mjs → chunk-WOUC73KB.mjs} +3 -1
- package/dist/auto-instrumentations/hook.mjs +358 -48
- package/dist/auto-instrumentations/index.cjs +290 -10
- package/dist/auto-instrumentations/index.d.mts +3 -1
- package/dist/auto-instrumentations/index.d.ts +3 -1
- package/dist/auto-instrumentations/index.mjs +3 -1
- package/dist/auto-instrumentations/loader/cjs-patch.cjs +32 -10
- package/dist/auto-instrumentations/loader/cjs-patch.mjs +10 -5
- package/dist/auto-instrumentations/loader/esm-hook.mjs +4 -4
- package/dist/auto-instrumentations/loader/get-package-version.cjs +28 -8
- package/dist/auto-instrumentations/loader/get-package-version.d.mts +2 -1
- package/dist/auto-instrumentations/loader/get-package-version.d.ts +2 -1
- package/dist/auto-instrumentations/loader/get-package-version.mjs +3 -1
- package/dist/browser.d.mts +357 -271
- package/dist/browser.d.ts +357 -271
- package/dist/browser.js +2345 -343
- package/dist/browser.mjs +2345 -343
- package/dist/cli.js +2296 -414
- package/dist/edge-light.d.mts +1 -1
- package/dist/edge-light.d.ts +1 -1
- package/dist/edge-light.js +2292 -315
- package/dist/edge-light.mjs +2292 -315
- package/dist/index.d.mts +370 -284
- package/dist/index.d.ts +370 -284
- package/dist/index.js +2642 -638
- package/dist/index.mjs +2385 -381
- package/dist/instrumentation/index.d.mts +3 -0
- package/dist/instrumentation/index.d.ts +3 -0
- package/dist/instrumentation/index.js +1955 -198
- package/dist/instrumentation/index.mjs +1955 -198
- package/dist/workerd.d.mts +1 -1
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +2292 -315
- package/dist/workerd.mjs +2292 -315
- package/package.json +22 -6
- package/dist/auto-instrumentations/chunk-XDBPUTVE.mjs +0 -22
- package/dist/auto-instrumentations/chunk-ZEC7BCL4.mjs +0 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "braintrust",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "SDK for integrating Braintrust",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -112,6 +112,17 @@
|
|
|
112
112
|
"clean": "rm -r dist/* && rm -r dev/dist/*",
|
|
113
113
|
"docs": "npx typedoc --options typedoc.json src/node/index.ts",
|
|
114
114
|
"test": "vitest run --exclude \"src/wrappers/**/*.test.ts\" --exclude \"src/otel/**/*.test.ts\" --exclude \"smoke/**/*.test.ts\" --exclude \"src/zod/**/*.test.ts\" --exclude \"tests/api-compatibility/**\"",
|
|
115
|
+
"test:core": "pnpm prune && pnpm test",
|
|
116
|
+
"test:checks": "pnpm run test:core && pnpm run test:vitest",
|
|
117
|
+
"test:external": "pnpm run test:external:openai && pnpm run test:external:anthropic && pnpm run test:external:google-genai && pnpm run test:external:ai-sdk && pnpm run test:external:claude-agent-sdk",
|
|
118
|
+
"test:external:openai": "bash scripts/test-provider.sh test:openai openai",
|
|
119
|
+
"test:external:anthropic": "bash scripts/test-provider.sh test:anthropic @anthropic-ai/sdk",
|
|
120
|
+
"test:external:google-genai": "bash scripts/test-provider.sh test:google-genai @google/genai",
|
|
121
|
+
"test:external:ai-sdk": "pnpm run test:external:ai-sdk-v5 && pnpm run test:external:ai-sdk-v6",
|
|
122
|
+
"test:external:ai-sdk-v5": "cd src/wrappers/ai-sdk/tests/v5 && pnpm install --ignore-workspace && pnpm test",
|
|
123
|
+
"test:external:ai-sdk-v6": "cd src/wrappers/ai-sdk/tests/v6 && pnpm install --ignore-workspace && pnpm test",
|
|
124
|
+
"test:external:claude-agent-sdk": "cd src/wrappers/claude-agent-sdk && pnpm install && pnpm test",
|
|
125
|
+
"test:all": "pnpm run test:checks && pnpm run test:external",
|
|
115
126
|
"test:api-compat": "vitest run tests/api-compatibility/api-compatibility.test.ts",
|
|
116
127
|
"test:anthropic": "vitest run src/wrappers/anthropic.test.ts",
|
|
117
128
|
"test:openai": "vitest run src/wrappers/oai.test.ts",
|
|
@@ -127,9 +138,14 @@
|
|
|
127
138
|
"test:claude-agent-sdk": "pnpm --filter @braintrust/claude-agent-sdk-tests test",
|
|
128
139
|
"test:vitest": "pnpm --filter @braintrust/vitest-wrapper-tests test",
|
|
129
140
|
"test:output": "tsx scripts/test-output.ts --with-comparison --with-metrics --with-progress",
|
|
141
|
+
"bench": "npx tsx src/queue.bench.ts",
|
|
142
|
+
"publish:validate": "./scripts/validate-release.sh && pnpm install --frozen-lockfile && pnpm run build && npm publish",
|
|
130
143
|
"lint": "eslint .",
|
|
131
144
|
"fix:lint": "eslint --fix .",
|
|
132
|
-
"playground": "tsx playground.ts"
|
|
145
|
+
"playground": "tsx playground.ts",
|
|
146
|
+
"playground:auto": "mkdir -p .context && pnpm exec esbuild playground.ts --platform=node --format=esm --outfile=.context/playground.auto.mjs && node --import ./dist/auto-instrumentations/hook.mjs ./.context/playground.auto.mjs",
|
|
147
|
+
"playground:cli:push": "node dist/cli.js push playground.ts",
|
|
148
|
+
"playground:cli:eval": "node dist/cli.js eval playground.ts"
|
|
133
149
|
},
|
|
134
150
|
"author": "",
|
|
135
151
|
"license": "MIT",
|
|
@@ -163,18 +179,18 @@
|
|
|
163
179
|
"openai": "6.25.0",
|
|
164
180
|
"openapi-zod-client": "^1.18.3",
|
|
165
181
|
"rollup": "^4.28.1",
|
|
166
|
-
"vite": "^5.4.14",
|
|
167
|
-
"webpack": "^5.97.1",
|
|
168
182
|
"tar": "^7.5.2",
|
|
169
183
|
"tinybench": "^4.0.1",
|
|
170
184
|
"ts-jest": "^29.1.4",
|
|
171
185
|
"tsup": "^8.5.1",
|
|
172
|
-
"tsx": "^
|
|
186
|
+
"tsx": "^4.21.0",
|
|
173
187
|
"typedoc": "^0.25.13",
|
|
174
188
|
"typedoc-plugin-markdown": "^3.17.1",
|
|
175
189
|
"typescript": "5.4.4",
|
|
190
|
+
"vite": "^6.4.1",
|
|
176
191
|
"vite-tsconfig-paths": "^4.3.2",
|
|
177
|
-
"vitest": "^
|
|
192
|
+
"vitest": "^4.1.0",
|
|
193
|
+
"webpack": "^5.97.1",
|
|
178
194
|
"zod": "^3.25.34"
|
|
179
195
|
},
|
|
180
196
|
"dependencies": {
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// src/auto-instrumentations/loader/get-package-version.ts
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
var packageVersions = /* @__PURE__ */ new Map();
|
|
5
|
-
function getPackageVersion(baseDir) {
|
|
6
|
-
if (packageVersions.has(baseDir)) {
|
|
7
|
-
return packageVersions.get(baseDir);
|
|
8
|
-
}
|
|
9
|
-
try {
|
|
10
|
-
const packageJsonPath = join(baseDir, "package.json");
|
|
11
|
-
const jsonFile = readFileSync(packageJsonPath, "utf8");
|
|
12
|
-
const { version } = JSON.parse(jsonFile);
|
|
13
|
-
packageVersions.set(baseDir, version);
|
|
14
|
-
return version;
|
|
15
|
-
} catch {
|
|
16
|
-
return process.version.slice(1);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export {
|
|
21
|
-
getPackageVersion
|
|
22
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// src/auto-instrumentations/loader/get-package-version.ts
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
var packageVersions = /* @__PURE__ */ new Map();
|
|
5
|
-
function getPackageVersion(baseDir) {
|
|
6
|
-
if (packageVersions.has(baseDir)) {
|
|
7
|
-
return packageVersions.get(baseDir);
|
|
8
|
-
}
|
|
9
|
-
try {
|
|
10
|
-
const packageJsonPath = join(baseDir, "package.json");
|
|
11
|
-
const jsonFile = readFileSync(packageJsonPath, "utf8");
|
|
12
|
-
const { version } = JSON.parse(jsonFile);
|
|
13
|
-
packageVersions.set(baseDir, version);
|
|
14
|
-
return version;
|
|
15
|
-
} catch {
|
|
16
|
-
return process.version.slice(1);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export {
|
|
21
|
-
getPackageVersion
|
|
22
|
-
};
|