braintrust 3.25.0 → 3.26.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 (78) hide show
  1. package/NOTICE +6 -0
  2. package/dev/dist/index.d.mts +130 -2
  3. package/dev/dist/index.d.ts +130 -2
  4. package/dev/dist/index.js +2455 -1116
  5. package/dev/dist/index.mjs +1599 -260
  6. package/dist/apply-auto-instrumentation.js +439 -398
  7. package/dist/apply-auto-instrumentation.mjs +242 -201
  8. package/dist/auto-instrumentations/bundler/esbuild.cjs +853 -337
  9. package/dist/auto-instrumentations/bundler/esbuild.d.mts +4 -4
  10. package/dist/auto-instrumentations/bundler/esbuild.d.ts +4 -4
  11. package/dist/auto-instrumentations/bundler/esbuild.mjs +5 -8
  12. package/dist/auto-instrumentations/bundler/next.cjs +852 -356
  13. package/dist/auto-instrumentations/bundler/next.mjs +6 -29
  14. package/dist/auto-instrumentations/bundler/rollup.cjs +853 -337
  15. package/dist/auto-instrumentations/bundler/rollup.d.mts +4 -4
  16. package/dist/auto-instrumentations/bundler/rollup.d.ts +4 -4
  17. package/dist/auto-instrumentations/bundler/rollup.mjs +5 -8
  18. package/dist/auto-instrumentations/bundler/vite.cjs +853 -337
  19. package/dist/auto-instrumentations/bundler/vite.d.mts +4 -4
  20. package/dist/auto-instrumentations/bundler/vite.d.ts +4 -4
  21. package/dist/auto-instrumentations/bundler/vite.mjs +5 -8
  22. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +1006 -266
  23. package/dist/auto-instrumentations/bundler/webpack-loader.d.ts +20 -12
  24. package/dist/auto-instrumentations/bundler/webpack.cjs +853 -337
  25. package/dist/auto-instrumentations/bundler/webpack.d.mts +4 -4
  26. package/dist/auto-instrumentations/bundler/webpack.d.ts +4 -4
  27. package/dist/auto-instrumentations/bundler/webpack.mjs +5 -4
  28. package/dist/auto-instrumentations/{chunk-JPVCUKTY.mjs → chunk-6E22MYSW.mjs} +165 -73
  29. package/dist/auto-instrumentations/{chunk-VT6DDNKM.mjs → chunk-AKKPLXTP.mjs} +631 -194
  30. package/dist/auto-instrumentations/chunk-NRE4QUQR.mjs +509 -0
  31. package/dist/auto-instrumentations/{chunk-7P6563SW.mjs → chunk-V5LEODRX.mjs} +2 -6
  32. package/dist/auto-instrumentations/{chunk-M6DLIJ2Z.mjs → chunk-XYN63IG5.mjs} +124 -194
  33. package/dist/auto-instrumentations/{chunk-CZ24KNHT.mjs → chunk-XZHHE4Y3.mjs} +77 -68
  34. package/dist/auto-instrumentations/hook.mjs +247 -182
  35. package/dist/auto-instrumentations/index.cjs +557 -48
  36. package/dist/auto-instrumentations/index.d.mts +6 -2
  37. package/dist/auto-instrumentations/index.d.ts +6 -2
  38. package/dist/auto-instrumentations/index.mjs +6 -1
  39. package/dist/auto-instrumentations/loader/cjs-patch.cjs +492 -195
  40. package/dist/auto-instrumentations/loader/cjs-patch.d.mts +2 -2
  41. package/dist/auto-instrumentations/loader/cjs-patch.d.ts +2 -2
  42. package/dist/auto-instrumentations/loader/cjs-patch.mjs +3 -2
  43. package/dist/auto-instrumentations/loader/esm-hook.mjs +1 -1
  44. package/dist/auto-instrumentations/plugin-B-aZh7EP.d.ts +30 -0
  45. package/dist/auto-instrumentations/plugin-Bnj4E_6B.d.mts +30 -0
  46. package/dist/auto-instrumentations/{types-RNPaKi9o.d.mts → types-C1fVeiCp.d.mts} +1 -1
  47. package/dist/auto-instrumentations/{types-RNPaKi9o.d.ts → types-C1fVeiCp.d.ts} +1 -1
  48. package/dist/browser.d.mts +817 -197
  49. package/dist/browser.d.ts +817 -197
  50. package/dist/browser.js +1883 -265
  51. package/dist/browser.mjs +1883 -265
  52. package/dist/{chunk-ABR2QWDP.mjs → chunk-PN7EWK66.mjs} +581 -133
  53. package/dist/{chunk-GSIDVFE6.js → chunk-VRZZQPAA.js} +1670 -736
  54. package/dist/{chunk-P25IOOU4.js → chunk-VYNNEKSA.js} +586 -138
  55. package/dist/{chunk-2SANLSWX.mjs → chunk-XIZOM2HO.mjs} +1052 -118
  56. package/dist/cli.js +1601 -263
  57. package/dist/edge-light.d.mts +1 -1
  58. package/dist/edge-light.d.ts +1 -1
  59. package/dist/edge-light.js +1883 -268
  60. package/dist/edge-light.mjs +1883 -268
  61. package/dist/index.d.mts +817 -197
  62. package/dist/index.d.ts +817 -197
  63. package/dist/index.js +695 -435
  64. package/dist/index.mjs +264 -4
  65. package/dist/instrumentation/index.d.mts +130 -6
  66. package/dist/instrumentation/index.d.ts +130 -6
  67. package/dist/instrumentation/index.js +1510 -80
  68. package/dist/instrumentation/index.mjs +1510 -80
  69. package/dist/vitest-evals-reporter.js +16 -16
  70. package/dist/vitest-evals-reporter.mjs +2 -2
  71. package/dist/workerd.d.mts +1 -1
  72. package/dist/workerd.d.ts +1 -1
  73. package/dist/workerd.js +1883 -268
  74. package/dist/workerd.mjs +1883 -268
  75. package/licenses/node-diagnostics-channel/LICENSE +19 -0
  76. package/package.json +34 -35
  77. package/dist/auto-instrumentations/plugin-D0KHwSJv.d.mts +0 -44
  78. package/dist/auto-instrumentations/plugin-G6fgxk1b.d.ts +0 -44
@@ -0,0 +1,19 @@
1
+ Copyright Node.js contributors. All rights reserved.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to
5
+ deal in the Software without restriction, including without limitation the
6
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ sell copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
+ IN THE SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braintrust",
3
- "version": "3.25.0",
3
+ "version": "3.26.0",
4
4
  "description": "SDK for integrating Braintrust",
5
5
  "repository": {
6
6
  "type": "git",
@@ -141,37 +141,6 @@
141
141
  "NOTICE",
142
142
  "licenses/**/*"
143
143
  ],
144
- "scripts": {
145
- "postinstall": "node ./scripts/install.js",
146
- "build": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" tsup",
147
- "check:typings": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
148
- "watch": "tsup --watch",
149
- "clean": "rm -r dist/* && rm -r dev/dist/* && rm -r util/dist/*",
150
- "docs": "typedoc --options typedoc.json src/node/index.ts",
151
- "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/**\"",
152
- "test:core": "pnpm prune && pnpm test",
153
- "test:checks": "pnpm run test:core && pnpm run test:vitest",
154
- "test:all": "pnpm run test:checks",
155
- "test:api-compat": "vitest run tests/api-compatibility/api-compatibility.test.ts",
156
- "test:otel": "vitest run --dir src/otel",
157
- "test:otel-no-deps": "vitest run src/otel/otel-no-deps.test.ts --reporter=verbose",
158
- "test:ai-sdk-v1": "vitest run src/wrappers/ai-sdk-v1.test.ts",
159
- "test:ai-sdk-v2": "vitest run src/wrappers/ai-sdk-v2.test.ts src/wrappers/ai-sdk-v1.test.ts",
160
- "test:ai-sdk-v3": "vitest run src/wrappers/ai-sdk-v3.test.ts",
161
- "test:zod-v3": "vitest run src/zod/zod-v3-serialization.test.ts",
162
- "test:zod-v4": "vitest run src/zod/zod-v4-serialization.test.ts",
163
- "test:mastra": "vitest run src/wrappers/mastra.test.ts",
164
- "test:vitest": "pnpm --filter @braintrust/vitest-wrapper-tests test",
165
- "test:output": "tsx scripts/test-output.ts --with-comparison --with-metrics --with-progress",
166
- "bench": "tsx src/queue.bench.ts",
167
- "lint": "eslint .",
168
- "fix:lint": "eslint --fix .",
169
- "playground": "tsx playground.ts",
170
- "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",
171
- "playground:cli:push": "node dist/cli.js push playground.ts",
172
- "playground:cli:eval": "node dist/cli.js eval playground.ts",
173
- "yalc:publish": "yalc publish"
174
- },
175
144
  "author": "",
176
145
  "license": "MIT",
177
146
  "devDependencies": {
@@ -198,7 +167,7 @@
198
167
  "eslint-plugin-node-import": "^1.0.5",
199
168
  "openai": "6.25.0",
200
169
  "rollup": "^4.60.3",
201
- "tar": "^7.5.19",
170
+ "tar": "^7.5.22",
202
171
  "tinybench": "^4.0.1",
203
172
  "ts-declaration-location": "^1.0.7",
204
173
  "tsup": "^8.5.1",
@@ -224,7 +193,6 @@
224
193
  "cli-progress": "^3.12.0",
225
194
  "cli-table3": "^0.6.5",
226
195
  "cors": "^2.8.5",
227
- "dc-browser": "^1.0.4",
228
196
  "dotenv": "^16.4.5",
229
197
  "esbuild": "0.28.1",
230
198
  "esquery": "^1.7.0",
@@ -260,5 +228,36 @@
260
228
  "access": "public",
261
229
  "registry": "https://registry.npmjs.org/",
262
230
  "provenance": true
231
+ },
232
+ "scripts": {
233
+ "postinstall": "node ./scripts/install.js",
234
+ "build": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" tsup",
235
+ "check:typings": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
236
+ "watch": "tsup --watch",
237
+ "clean": "rm -r dist/* && rm -r dev/dist/* && rm -r util/dist/*",
238
+ "docs": "typedoc --options typedoc.json src/node/index.ts",
239
+ "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/**\"",
240
+ "test:core": "pnpm prune && pnpm test",
241
+ "test:checks": "pnpm run test:core && pnpm run test:vitest",
242
+ "test:all": "pnpm run test:checks",
243
+ "test:api-compat": "vitest run tests/api-compatibility/api-compatibility.test.ts",
244
+ "test:otel": "vitest run --dir src/otel",
245
+ "test:otel-no-deps": "vitest run src/otel/otel-no-deps.test.ts --reporter=verbose",
246
+ "test:ai-sdk-v1": "vitest run src/wrappers/ai-sdk-v1.test.ts",
247
+ "test:ai-sdk-v2": "vitest run src/wrappers/ai-sdk-v2.test.ts src/wrappers/ai-sdk-v1.test.ts",
248
+ "test:ai-sdk-v3": "vitest run src/wrappers/ai-sdk-v3.test.ts",
249
+ "test:zod-v3": "vitest run src/zod/zod-v3-serialization.test.ts",
250
+ "test:zod-v4": "vitest run src/zod/zod-v4-serialization.test.ts",
251
+ "test:mastra": "vitest run src/wrappers/mastra.test.ts",
252
+ "test:vitest": "pnpm --filter @braintrust/vitest-wrapper-tests test",
253
+ "test:output": "tsx scripts/test-output.ts --with-comparison --with-metrics --with-progress",
254
+ "bench": "tsx src/queue.bench.ts",
255
+ "lint": "eslint .",
256
+ "fix:lint": "eslint --fix .",
257
+ "playground": "tsx playground.ts",
258
+ "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",
259
+ "playground:cli:push": "node dist/cli.js push playground.ts",
260
+ "playground:cli:eval": "node dist/cli.js eval playground.ts",
261
+ "yalc:publish": "yalc publish"
263
262
  }
264
- }
263
+ }
@@ -1,44 +0,0 @@
1
- import { I as InstrumentationConfig } from './types-RNPaKi9o.mjs';
2
-
3
- interface LegacyBundlerPluginOptions {
4
- /**
5
- * Enable debug logging
6
- */
7
- debug?: boolean;
8
- /**
9
- * Additional instrumentation configs to apply
10
- */
11
- instrumentations?: InstrumentationConfig[];
12
- /**
13
- * Whether to bundle for browser environments.
14
- *
15
- * When true, uses 'dc-browser' for browser-compatible diagnostics_channel polyfill.
16
- * When false, uses Node.js built-in 'diagnostics_channel' and 'async_hooks'.
17
- * Defaults to true (assumes browser build).
18
- */
19
- browser?: boolean;
20
- }
21
- interface BundlerPluginOptions {
22
- /**
23
- * Enable debug logging
24
- */
25
- debug?: boolean;
26
- /**
27
- * Additional instrumentation configs to apply
28
- */
29
- instrumentations?: InstrumentationConfig[];
30
- /**
31
- * Use the `diagnostics_channel` compatibility shim in patched code instead
32
- * of Node.js's built-in `diagnostics_channel` module.
33
- *
34
- * Enable this for browser, edge, or worker bundles where Node's
35
- * `diagnostics_channel` module is unavailable. Leave it disabled for Node.js
36
- * bundles so transformed SDK code publishes on the native `diagnostics_channel`
37
- * registry.
38
- *
39
- * @default false
40
- */
41
- useDiagnosticChannelCompatShim?: boolean;
42
- }
43
-
44
- export type { BundlerPluginOptions as B, LegacyBundlerPluginOptions as L };
@@ -1,44 +0,0 @@
1
- import { I as InstrumentationConfig } from './types-RNPaKi9o.js';
2
-
3
- interface LegacyBundlerPluginOptions {
4
- /**
5
- * Enable debug logging
6
- */
7
- debug?: boolean;
8
- /**
9
- * Additional instrumentation configs to apply
10
- */
11
- instrumentations?: InstrumentationConfig[];
12
- /**
13
- * Whether to bundle for browser environments.
14
- *
15
- * When true, uses 'dc-browser' for browser-compatible diagnostics_channel polyfill.
16
- * When false, uses Node.js built-in 'diagnostics_channel' and 'async_hooks'.
17
- * Defaults to true (assumes browser build).
18
- */
19
- browser?: boolean;
20
- }
21
- interface BundlerPluginOptions {
22
- /**
23
- * Enable debug logging
24
- */
25
- debug?: boolean;
26
- /**
27
- * Additional instrumentation configs to apply
28
- */
29
- instrumentations?: InstrumentationConfig[];
30
- /**
31
- * Use the `diagnostics_channel` compatibility shim in patched code instead
32
- * of Node.js's built-in `diagnostics_channel` module.
33
- *
34
- * Enable this for browser, edge, or worker bundles where Node's
35
- * `diagnostics_channel` module is unavailable. Leave it disabled for Node.js
36
- * bundles so transformed SDK code publishes on the native `diagnostics_channel`
37
- * registry.
38
- *
39
- * @default false
40
- */
41
- useDiagnosticChannelCompatShim?: boolean;
42
- }
43
-
44
- export type { BundlerPluginOptions as B, LegacyBundlerPluginOptions as L };