braintrust 3.19.0 → 3.21.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/NOTICE +20 -0
- package/README.md +2 -0
- package/dev/dist/index.d.mts +309 -199
- package/dev/dist/index.d.ts +309 -199
- package/dev/dist/index.js +2833 -987
- package/dev/dist/index.mjs +2294 -448
- package/dist/apply-auto-instrumentation.js +781 -199
- package/dist/apply-auto-instrumentation.mjs +588 -6
- package/dist/auto-instrumentations/bundler/esbuild.cjs +594 -2
- 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 +3 -3
- package/dist/auto-instrumentations/bundler/next.cjs +594 -2
- package/dist/auto-instrumentations/bundler/next.mjs +4 -4
- package/dist/auto-instrumentations/bundler/rollup.cjs +594 -2
- package/dist/auto-instrumentations/bundler/rollup.d.mts +2 -2
- package/dist/auto-instrumentations/bundler/rollup.d.ts +2 -2
- package/dist/auto-instrumentations/bundler/rollup.mjs +3 -3
- package/dist/auto-instrumentations/bundler/vite.cjs +594 -2
- 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 +3 -3
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +593 -9
- package/dist/auto-instrumentations/bundler/webpack-loader.d.ts +68 -1
- package/dist/auto-instrumentations/bundler/webpack.cjs +594 -2
- 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 +4 -4
- package/dist/auto-instrumentations/{chunk-W4E36GIW.mjs → chunk-BRQX23KL.mjs} +16 -0
- package/dist/auto-instrumentations/chunk-M6DLIJ2Z.mjs +784 -0
- package/dist/auto-instrumentations/{chunk-K74TZGGM.mjs → chunk-T6J4C7LX.mjs} +1 -1
- package/dist/auto-instrumentations/{chunk-S4374IP6.mjs → chunk-TKRPRPGD.mjs} +4 -6
- package/dist/auto-instrumentations/chunk-VT6DDNKM.mjs +856 -0
- package/dist/auto-instrumentations/hook.mjs +749 -45
- package/dist/auto-instrumentations/index.cjs +16 -0
- package/dist/auto-instrumentations/index.d.mts +2 -3
- package/dist/auto-instrumentations/index.d.ts +2 -3
- package/dist/auto-instrumentations/index.mjs +1 -1
- package/dist/auto-instrumentations/loader/cjs-patch.cjs +578 -4
- package/dist/auto-instrumentations/loader/cjs-patch.d.mts +1 -1
- package/dist/auto-instrumentations/loader/cjs-patch.d.ts +1 -1
- package/dist/auto-instrumentations/loader/cjs-patch.mjs +3 -7
- package/dist/auto-instrumentations/loader/esm-hook.mjs +2 -6
- package/dist/auto-instrumentations/{plugin-D7nDswtC.d.mts → plugin-D0KHwSJv.d.mts} +1 -1
- package/dist/auto-instrumentations/{plugin-D7nDswtC.d.ts → plugin-G6fgxk1b.d.ts} +1 -1
- package/dist/auto-instrumentations/types-RNPaKi9o.d.mts +70 -0
- package/dist/auto-instrumentations/types-RNPaKi9o.d.ts +70 -0
- package/dist/browser.d.mts +1369 -848
- package/dist/browser.d.ts +1369 -848
- package/dist/browser.js +2735 -473
- package/dist/browser.mjs +2735 -473
- package/dist/{chunk-LPC4W2WX.js → chunk-BFGIH2ZJ.js} +4 -0
- package/dist/{chunk-37RLJF2U.js → chunk-FY7DAKA5.js} +3149 -1273
- package/dist/{chunk-Y7W7WP6H.mjs → chunk-KMGUTPB7.mjs} +4 -0
- package/dist/{chunk-VEQ2PCMC.mjs → chunk-O2P765XK.mjs} +2399 -523
- package/dist/cli.js +2267 -412
- package/dist/edge-light.d.mts +1 -1
- package/dist/edge-light.d.ts +1 -1
- package/dist/edge-light.js +2735 -473
- package/dist/edge-light.mjs +2735 -473
- package/dist/index.d.mts +1848 -1327
- package/dist/index.d.ts +1848 -1327
- package/dist/index.js +754 -352
- package/dist/index.mjs +448 -46
- package/dist/instrumentation/index.d.mts +119 -21
- package/dist/instrumentation/index.d.ts +119 -21
- package/dist/instrumentation/index.js +2345 -512
- package/dist/instrumentation/index.mjs +2344 -512
- package/dist/vitest-evals-reporter.js +16 -16
- package/dist/vitest-evals-reporter.mjs +2 -2
- package/dist/workerd.d.mts +1 -1
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +2735 -473
- package/dist/workerd.mjs +2735 -473
- package/licenses/import-in-the-middle/LICENSE +201 -0
- package/licenses/import-in-the-middle/LICENSE-3rdparty.csv +4 -0
- package/licenses/import-in-the-middle/NOTICE +34 -0
- package/licenses/orchestrion-js/LICENSE +202 -0
- package/licenses/orchestrion-js/LICENSE-3rdparty.csv +8 -0
- package/licenses/orchestrion-js/NOTICE +3 -0
- package/licenses/require-in-the-middle/LICENSE +23 -0
- package/package.json +13 -4
- package/util/dist/index.d.mts +1 -0
- package/util/dist/index.d.ts +1 -0
- package/util/dist/index.js +4 -4
- package/util/dist/index.mjs +2 -2
- package/dist/auto-instrumentations/chunk-J57YF7WS.mjs +0 -208
- package/dist/auto-instrumentations/chunk-QFMACSOL.mjs +0 -280
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
applySpecialCasePatch
|
|
3
|
-
|
|
2
|
+
applySpecialCasePatch,
|
|
3
|
+
create
|
|
4
|
+
} from "../chunk-M6DLIJ2Z.mjs";
|
|
4
5
|
import {
|
|
5
6
|
getPackageName,
|
|
6
7
|
getPackageVersion
|
|
7
8
|
} from "../chunk-P5YLNB2A.mjs";
|
|
8
9
|
|
|
9
10
|
// src/auto-instrumentations/loader/cjs-patch.ts
|
|
10
|
-
import {
|
|
11
|
-
create
|
|
12
|
-
} from "@apm-js-collab/code-transformer";
|
|
13
11
|
import * as NodeModule from "module";
|
|
14
12
|
import { sep } from "path";
|
|
15
13
|
import moduleDetailsFromPath from "module-details-from-path";
|
|
@@ -66,8 +64,6 @@ var ModulePatch = class {
|
|
|
66
64
|
args[0] = transformedCode?.code;
|
|
67
65
|
} catch (error) {
|
|
68
66
|
console.warn(`Error transforming module ${filename}:`, error);
|
|
69
|
-
} finally {
|
|
70
|
-
transformer.free();
|
|
71
67
|
}
|
|
72
68
|
}
|
|
73
69
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applySpecialCasePatch,
|
|
3
|
+
create,
|
|
3
4
|
getPackageName,
|
|
4
5
|
getPackageVersion,
|
|
5
6
|
isSpecialCaseTarget
|
|
6
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-VT6DDNKM.mjs";
|
|
7
8
|
|
|
8
9
|
// src/auto-instrumentations/loader/esm-hook.mts
|
|
9
10
|
import { readFile } from "fs/promises";
|
|
10
11
|
import { fileURLToPath } from "url";
|
|
11
12
|
import { extname, sep } from "path";
|
|
12
|
-
import {
|
|
13
|
-
create
|
|
14
|
-
} from "@apm-js-collab/code-transformer";
|
|
15
13
|
import moduleDetailsFromPath from "module-details-from-path";
|
|
16
14
|
var instrumentator;
|
|
17
15
|
var packages;
|
|
@@ -110,8 +108,6 @@ async function load(url, context, nextLoad) {
|
|
|
110
108
|
result.shortCircuit = true;
|
|
111
109
|
} catch (err) {
|
|
112
110
|
console.warn(`Error transforming module ${url}:`, err);
|
|
113
|
-
} finally {
|
|
114
|
-
transformer.free();
|
|
115
111
|
}
|
|
116
112
|
}
|
|
117
113
|
return result;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kind of function.
|
|
3
|
+
*/
|
|
4
|
+
type FunctionKind = "Sync" | "Async" | "Callback";
|
|
5
|
+
interface FunctionQueryBase {
|
|
6
|
+
kind: FunctionKind;
|
|
7
|
+
index?: number | null;
|
|
8
|
+
callbackIndex?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Describes which function to instrument.
|
|
12
|
+
*/
|
|
13
|
+
type FunctionQuery = (FunctionQueryBase & {
|
|
14
|
+
className: string;
|
|
15
|
+
methodName: string;
|
|
16
|
+
isExportAlias?: boolean;
|
|
17
|
+
}) | (FunctionQueryBase & {
|
|
18
|
+
className: string;
|
|
19
|
+
privateMethodName: string;
|
|
20
|
+
isExportAlias?: boolean;
|
|
21
|
+
}) | (FunctionQueryBase & {
|
|
22
|
+
methodName: string;
|
|
23
|
+
}) | (FunctionQueryBase & {
|
|
24
|
+
functionName: string;
|
|
25
|
+
isExportAlias?: boolean;
|
|
26
|
+
}) | (FunctionQueryBase & {
|
|
27
|
+
objectName: string;
|
|
28
|
+
propertyName: string;
|
|
29
|
+
}) | FunctionQueryBase;
|
|
30
|
+
/**
|
|
31
|
+
* Configuration for injecting instrumentation code.
|
|
32
|
+
*/
|
|
33
|
+
interface InstrumentationConfig {
|
|
34
|
+
/**
|
|
35
|
+
* The name of the diagnostics channel to publish to.
|
|
36
|
+
*/
|
|
37
|
+
channelName: string;
|
|
38
|
+
/**
|
|
39
|
+
* The module matcher to identify the module and file to instrument.
|
|
40
|
+
*/
|
|
41
|
+
module: ModuleMatcher;
|
|
42
|
+
/**
|
|
43
|
+
* The function query to identify the function to instrument.
|
|
44
|
+
*/
|
|
45
|
+
functionQuery: FunctionQuery;
|
|
46
|
+
/**
|
|
47
|
+
* Optional raw esquery selector. When provided, this selector is used instead
|
|
48
|
+
* of deriving one from functionQuery.
|
|
49
|
+
*/
|
|
50
|
+
astQuery?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Describes the module and file path you would like to match.
|
|
54
|
+
*/
|
|
55
|
+
interface ModuleMatcher {
|
|
56
|
+
/**
|
|
57
|
+
* The name of the module you want to match.
|
|
58
|
+
*/
|
|
59
|
+
name: string;
|
|
60
|
+
/**
|
|
61
|
+
* The semver range that you want to match.
|
|
62
|
+
*/
|
|
63
|
+
versionRange: string;
|
|
64
|
+
/**
|
|
65
|
+
* The path of the file you want to match from the module root.
|
|
66
|
+
*/
|
|
67
|
+
filePath: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type { InstrumentationConfig as I };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kind of function.
|
|
3
|
+
*/
|
|
4
|
+
type FunctionKind = "Sync" | "Async" | "Callback";
|
|
5
|
+
interface FunctionQueryBase {
|
|
6
|
+
kind: FunctionKind;
|
|
7
|
+
index?: number | null;
|
|
8
|
+
callbackIndex?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Describes which function to instrument.
|
|
12
|
+
*/
|
|
13
|
+
type FunctionQuery = (FunctionQueryBase & {
|
|
14
|
+
className: string;
|
|
15
|
+
methodName: string;
|
|
16
|
+
isExportAlias?: boolean;
|
|
17
|
+
}) | (FunctionQueryBase & {
|
|
18
|
+
className: string;
|
|
19
|
+
privateMethodName: string;
|
|
20
|
+
isExportAlias?: boolean;
|
|
21
|
+
}) | (FunctionQueryBase & {
|
|
22
|
+
methodName: string;
|
|
23
|
+
}) | (FunctionQueryBase & {
|
|
24
|
+
functionName: string;
|
|
25
|
+
isExportAlias?: boolean;
|
|
26
|
+
}) | (FunctionQueryBase & {
|
|
27
|
+
objectName: string;
|
|
28
|
+
propertyName: string;
|
|
29
|
+
}) | FunctionQueryBase;
|
|
30
|
+
/**
|
|
31
|
+
* Configuration for injecting instrumentation code.
|
|
32
|
+
*/
|
|
33
|
+
interface InstrumentationConfig {
|
|
34
|
+
/**
|
|
35
|
+
* The name of the diagnostics channel to publish to.
|
|
36
|
+
*/
|
|
37
|
+
channelName: string;
|
|
38
|
+
/**
|
|
39
|
+
* The module matcher to identify the module and file to instrument.
|
|
40
|
+
*/
|
|
41
|
+
module: ModuleMatcher;
|
|
42
|
+
/**
|
|
43
|
+
* The function query to identify the function to instrument.
|
|
44
|
+
*/
|
|
45
|
+
functionQuery: FunctionQuery;
|
|
46
|
+
/**
|
|
47
|
+
* Optional raw esquery selector. When provided, this selector is used instead
|
|
48
|
+
* of deriving one from functionQuery.
|
|
49
|
+
*/
|
|
50
|
+
astQuery?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Describes the module and file path you would like to match.
|
|
54
|
+
*/
|
|
55
|
+
interface ModuleMatcher {
|
|
56
|
+
/**
|
|
57
|
+
* The name of the module you want to match.
|
|
58
|
+
*/
|
|
59
|
+
name: string;
|
|
60
|
+
/**
|
|
61
|
+
* The semver range that you want to match.
|
|
62
|
+
*/
|
|
63
|
+
versionRange: string;
|
|
64
|
+
/**
|
|
65
|
+
* The path of the file you want to match from the module root.
|
|
66
|
+
*/
|
|
67
|
+
filePath: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type { InstrumentationConfig as I };
|