braintrust 0.0.140 → 0.0.141-dev
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/.turbo/turbo-build.log +42 -0
- package/.turbo/turbo-watch.log +1843 -0
- package/LICENSE +201 -0
- package/braintrust-0.0.141.tgz +0 -0
- package/dist/{logger.d.ts → browser.d.mts} +168 -92
- package/dist/browser.d.ts +1089 -2
- package/dist/browser.js +383 -9185
- package/dist/browser.mjs +254 -7
- package/dist/cli.js +3887 -27452
- package/dist/index.d.mts +1250 -0
- package/dist/index.d.ts +1236 -41
- package/dist/index.js +1706 -18925
- package/dist/index.mjs +255 -121
- package/package.json +40 -23
- package/tsup.config.ts +23 -0
- package/turbo.json +8 -0
- package/vitest.config.js +6 -0
- package/dist/browser-config.d.ts +0 -6
- package/dist/cli.d.ts +0 -35
- package/dist/framework.d.ts +0 -180
- package/dist/framework.test.d.ts +0 -1
- package/dist/functions.d.ts +0 -15
- package/dist/gitutil.d.ts +0 -17
- package/dist/isomorph.d.ts +0 -27
- package/dist/jest/nodeModulesPaths.d.ts +0 -15
- package/dist/jest/tryRealpath.d.ts +0 -7
- package/dist/node.d.ts +0 -1
- package/dist/progress.d.ts +0 -18
- package/dist/stackutil.d.ts +0 -8
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/util.d.ts +0 -11
- package/dist/wrappers/ai-sdk.d.ts +0 -8
- package/dist/wrappers/oai.d.ts +0 -34
- package/jest.config.js +0 -5
package/package.json
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "braintrust",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.141-dev",
|
|
4
4
|
"description": "SDK for integrating Braintrust",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
6
8
|
"browser": {
|
|
7
9
|
"./dist/index.js": "./dist/browser.js",
|
|
8
|
-
"./dist/index.d.ts": "./dist/browser.d.ts"
|
|
10
|
+
"./dist/index.d.ts": "./dist/browser.d.ts",
|
|
11
|
+
"./dist/index.mjs": "./dist/browser.mjs",
|
|
12
|
+
"./dist/index.d.mts": "./dist/browser.d.mts"
|
|
9
13
|
},
|
|
10
14
|
"bin": {
|
|
11
15
|
"braintrust": "./dist/cli.js"
|
|
12
16
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"prepublishOnly": "../../scripts/node_prepublish_sdk.py",
|
|
28
|
-
"postpublish": "../../scripts/node_postpublish_sdk.py"
|
|
17
|
+
"exports": {
|
|
18
|
+
"./package.json": "./package.json",
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.mjs",
|
|
22
|
+
"module": "./dist/index.mjs",
|
|
23
|
+
"require": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./ai-sdk": {
|
|
26
|
+
"types": "./ai-sdk/dist/index.d.ts",
|
|
27
|
+
"import": "./ai-sdk/dist/index.mjs",
|
|
28
|
+
"module": "./ai-sdk/dist/index.mjs",
|
|
29
|
+
"require": "./ai-sdk/dist/index.js"
|
|
30
|
+
}
|
|
29
31
|
},
|
|
30
32
|
"author": "",
|
|
31
33
|
"license": "MIT",
|
|
@@ -42,28 +44,43 @@
|
|
|
42
44
|
"@types/uuid": "^9.0.7",
|
|
43
45
|
"async": "^3.2.5",
|
|
44
46
|
"autoevals": "^0.0.69",
|
|
45
|
-
"jest": "^29.7.0",
|
|
46
47
|
"npm-run-all": "^4.1.5",
|
|
47
48
|
"ts-jest": "^29.1.4",
|
|
49
|
+
"tsup": "^8.0.1",
|
|
48
50
|
"typedoc": "^0.25.4",
|
|
49
51
|
"typedoc-plugin-markdown": "^3.17.1",
|
|
50
|
-
"typescript": "^5.3.3"
|
|
52
|
+
"typescript": "^5.3.3",
|
|
53
|
+
"vite-tsconfig-paths": "^4.3.2",
|
|
54
|
+
"vitest": "^1.6.0"
|
|
51
55
|
},
|
|
52
56
|
"dependencies": {
|
|
53
|
-
"@ai-sdk/provider": "^0.0.
|
|
54
|
-
"@braintrust/core": "0.0.44",
|
|
57
|
+
"@ai-sdk/provider": "^0.0.11",
|
|
55
58
|
"@next/env": "^14.2.3",
|
|
59
|
+
"@vercel/functions": "^1.0.2",
|
|
60
|
+
"ai": "^3.2.16",
|
|
56
61
|
"argparse": "^2.0.1",
|
|
57
62
|
"chalk": "^4.1.2",
|
|
58
63
|
"cli-progress": "^3.12.0",
|
|
59
64
|
"dotenv": "^16.4.5",
|
|
60
65
|
"esbuild": "^0.18.20",
|
|
66
|
+
"eventsource-parser": "^1.1.2",
|
|
61
67
|
"graceful-fs": "^4.2.11",
|
|
62
68
|
"minimatch": "^9.0.3",
|
|
63
69
|
"mustache": "^4.2.0",
|
|
64
70
|
"pluralize": "^8.0.0",
|
|
65
71
|
"simple-git": "^3.21.0",
|
|
66
72
|
"uuid": "^9.0.1",
|
|
67
|
-
"zod": "^3.22.4"
|
|
73
|
+
"zod": "^3.22.4",
|
|
74
|
+
"@braintrust/core": "0.0.45"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"zod": "^3.0.0"
|
|
78
|
+
},
|
|
79
|
+
"scripts": {
|
|
80
|
+
"build": "tsup",
|
|
81
|
+
"watch": "tsup --watch",
|
|
82
|
+
"clean": "rm -r dist/*",
|
|
83
|
+
"docs": "npx typedoc --options typedoc.json src/index.ts",
|
|
84
|
+
"test": "vitest run"
|
|
68
85
|
}
|
|
69
86
|
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
|
|
3
|
+
export default defineConfig([
|
|
4
|
+
{
|
|
5
|
+
entry: ["src/index.ts"],
|
|
6
|
+
format: ["cjs", "esm"],
|
|
7
|
+
outDir: "dist",
|
|
8
|
+
external: ["zod"],
|
|
9
|
+
dts: true,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
entry: ["src/browser.ts"],
|
|
13
|
+
format: ["cjs", "esm"],
|
|
14
|
+
outDir: "dist",
|
|
15
|
+
dts: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
entry: ["src/cli.ts"],
|
|
19
|
+
format: ["cjs"],
|
|
20
|
+
outDir: "dist",
|
|
21
|
+
external: ["esbuild"],
|
|
22
|
+
},
|
|
23
|
+
]);
|
package/turbo.json
ADDED
package/vitest.config.js
ADDED
package/dist/browser-config.d.ts
DELETED
package/dist/cli.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import * as esbuild from "esbuild";
|
|
3
|
-
import { EvaluatorDef, EvaluatorFile, ReporterDef } from "./framework";
|
|
4
|
-
interface BuildSuccess {
|
|
5
|
-
type: "success";
|
|
6
|
-
result: esbuild.BuildResult;
|
|
7
|
-
evaluator: EvaluatorFile;
|
|
8
|
-
sourceFile: string;
|
|
9
|
-
}
|
|
10
|
-
interface BuildFailure {
|
|
11
|
-
type: "failure";
|
|
12
|
-
error: Error;
|
|
13
|
-
sourceFile: string;
|
|
14
|
-
}
|
|
15
|
-
type BuildResult = BuildSuccess | BuildFailure;
|
|
16
|
-
export interface FileHandle {
|
|
17
|
-
inFile: string;
|
|
18
|
-
outFile: string;
|
|
19
|
-
bundleFile?: string;
|
|
20
|
-
rebuild: () => Promise<BuildResult>;
|
|
21
|
-
bundle: () => Promise<esbuild.BuildResult>;
|
|
22
|
-
watch: () => void;
|
|
23
|
-
destroy: () => Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
export interface EvaluatorState {
|
|
26
|
-
evaluators: {
|
|
27
|
-
sourceFile: string;
|
|
28
|
-
evaluator: EvaluatorDef<any, any, any, any>;
|
|
29
|
-
reporter: string | ReporterDef<any> | undefined;
|
|
30
|
-
}[];
|
|
31
|
-
reporters: {
|
|
32
|
-
[reporter: string]: ReporterDef<any>;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export {};
|
package/dist/framework.d.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
import { NOOP_SPAN, Experiment, ExperimentSummary, Span, EvalCase, BaseMetadata, DefaultMetadataType, currentSpan, BraintrustState } from "./logger";
|
|
3
|
-
import { Score } from "@braintrust/core";
|
|
4
|
-
import { ProgressReporter } from "./progress";
|
|
5
|
-
export type BaseExperiment<Input, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = {
|
|
6
|
-
_type: "BaseExperiment";
|
|
7
|
-
_phantom?: [Input, Expected, Metadata];
|
|
8
|
-
name?: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Use this to specify that the dataset should actually be the data from a previous (base) experiment.
|
|
12
|
-
* If you do not specify a name, Braintrust will automatically figure out the best base experiment to
|
|
13
|
-
* use based on your git history (or fall back to timestamps).
|
|
14
|
-
*
|
|
15
|
-
* @param options
|
|
16
|
-
* @param options.name The name of the base experiment to use. If unspecified, Braintrust will automatically figure out the best base
|
|
17
|
-
* using your git history (or fall back to timestamps).
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
export declare function BaseExperiment<Input = unknown, Expected = unknown, Metadata extends BaseMetadata = DefaultMetadataType>(options?: {
|
|
21
|
-
name?: string;
|
|
22
|
-
}): BaseExperiment<Input, Expected, Metadata>;
|
|
23
|
-
export type EvalData<Input, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalCase<Input, Expected, Metadata>[] | (() => EvalCase<Input, Expected, Metadata>[]) | (() => Promise<EvalCase<Input, Expected, Metadata>[]>) | AsyncGenerator<EvalCase<Input, Expected, Metadata>> | AsyncIterable<EvalCase<Input, Expected, Metadata>> | BaseExperiment<Input, Expected, Metadata> | (() => BaseExperiment<Input, Expected, Metadata>);
|
|
24
|
-
export type EvalTask<Input, Output> = ((input: Input, hooks: EvalHooks) => Promise<Output>) | ((input: Input, hooks: EvalHooks) => Output);
|
|
25
|
-
export interface EvalHooks {
|
|
26
|
-
meta: (info: Record<string, unknown>) => void;
|
|
27
|
-
span: Span;
|
|
28
|
-
}
|
|
29
|
-
export type EvalScorerArgs<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalCase<Input, Expected, Metadata> & {
|
|
30
|
-
output: Output;
|
|
31
|
-
};
|
|
32
|
-
type OneOrMoreScores = Score | number | null | Array<Score>;
|
|
33
|
-
export type EvalScorer<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = (args: EvalScorerArgs<Input, Output, Expected, Metadata>) => OneOrMoreScores | Promise<OneOrMoreScores>;
|
|
34
|
-
export type EvalResult<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = EvalCase<Input, Expected, Metadata> & {
|
|
35
|
-
output: Output;
|
|
36
|
-
scores: Record<string, number | null>;
|
|
37
|
-
error: unknown;
|
|
38
|
-
};
|
|
39
|
-
export interface Evaluator<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> {
|
|
40
|
-
/**
|
|
41
|
-
* A function that returns a list of inputs, expected outputs, and metadata.
|
|
42
|
-
*/
|
|
43
|
-
data: EvalData<Input, Expected, Metadata>;
|
|
44
|
-
/**
|
|
45
|
-
* A function that takes an input and returns an output.
|
|
46
|
-
*/
|
|
47
|
-
task: EvalTask<Input, Output>;
|
|
48
|
-
/**
|
|
49
|
-
* A set of functions that take an input, output, and expected value and return a score.
|
|
50
|
-
*/
|
|
51
|
-
scores: EvalScorer<Input, Output, Expected, Metadata>[];
|
|
52
|
-
/**
|
|
53
|
-
* An optional name for the experiment.
|
|
54
|
-
*/
|
|
55
|
-
experimentName?: string;
|
|
56
|
-
/**
|
|
57
|
-
* The number of times to run the evaluator per input. This is useful for evaluating applications that
|
|
58
|
-
* have non-deterministic behavior and gives you both a stronger aggregate measure and a sense of the
|
|
59
|
-
* variance in the results.
|
|
60
|
-
*/
|
|
61
|
-
trialCount?: number;
|
|
62
|
-
/**
|
|
63
|
-
* Optional additional metadata for the experiment.
|
|
64
|
-
*/
|
|
65
|
-
metadata?: Record<string, unknown>;
|
|
66
|
-
/**
|
|
67
|
-
* Whether the experiment should be public. Defaults to false.
|
|
68
|
-
*/
|
|
69
|
-
isPublic?: boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Whether to update an existing experiment with `experiment_name` if one exists. Defaults to false.
|
|
72
|
-
*/
|
|
73
|
-
update?: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* The duration, in milliseconds, after which to time out the evaluation.
|
|
76
|
-
* Defaults to undefined, in which case there is no timeout.
|
|
77
|
-
*/
|
|
78
|
-
timeout?: number;
|
|
79
|
-
/**
|
|
80
|
-
* The maximum number of tasks/scorers that will be run concurrently.
|
|
81
|
-
* Defaults to undefined, in which case there is no max concurrency.
|
|
82
|
-
*/
|
|
83
|
-
maxConcurrency?: number;
|
|
84
|
-
/**
|
|
85
|
-
* If specified, uses the given project ID instead of the evaluator's name to identify the project.
|
|
86
|
-
*/
|
|
87
|
-
projectId?: string;
|
|
88
|
-
/**
|
|
89
|
-
* If specified, uses the logger state to initialize Braintrust objects. If unspecified, falls back
|
|
90
|
-
* to the global state (initialized using your API key).
|
|
91
|
-
*/
|
|
92
|
-
state?: BraintrustState;
|
|
93
|
-
}
|
|
94
|
-
export type EvalResultWithSummary<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = {
|
|
95
|
-
summary: ExperimentSummary;
|
|
96
|
-
results: EvalResult<Input, Output, Expected, Metadata>[];
|
|
97
|
-
};
|
|
98
|
-
export interface ReporterOpts {
|
|
99
|
-
verbose: boolean;
|
|
100
|
-
jsonl: boolean;
|
|
101
|
-
}
|
|
102
|
-
export interface ReporterBody<EvalReport> {
|
|
103
|
-
/**
|
|
104
|
-
* A function that takes an evaluator and its result and returns a report.
|
|
105
|
-
*
|
|
106
|
-
* @param evaluator
|
|
107
|
-
* @param result
|
|
108
|
-
* @param opts
|
|
109
|
-
*/
|
|
110
|
-
reportEval(evaluator: EvaluatorDef<any, any, any, any>, result: EvalResultWithSummary<any, any, any, any>, opts: ReporterOpts): Promise<EvalReport> | EvalReport;
|
|
111
|
-
/**
|
|
112
|
-
* A function that takes all evaluator results and returns a boolean indicating
|
|
113
|
-
* whether the run was successful. If you return false, the `braintrust eval`
|
|
114
|
-
* command will exit with a non-zero status code.
|
|
115
|
-
*
|
|
116
|
-
* @param reports
|
|
117
|
-
*/
|
|
118
|
-
reportRun(reports: EvalReport[]): boolean | Promise<boolean>;
|
|
119
|
-
}
|
|
120
|
-
export type ReporterDef<EvalReport> = {
|
|
121
|
-
name: string;
|
|
122
|
-
} & ReporterBody<EvalReport>;
|
|
123
|
-
export type EvaluatorDef<Input, Output, Expected, Metadata extends BaseMetadata = DefaultMetadataType> = {
|
|
124
|
-
projectName: string;
|
|
125
|
-
evalName: string;
|
|
126
|
-
} & Evaluator<Input, Output, Expected, Metadata>;
|
|
127
|
-
export type EvaluatorFile = {
|
|
128
|
-
evaluators: {
|
|
129
|
-
[evalName: string]: {
|
|
130
|
-
evaluator: EvaluatorDef<any, any, any, any>;
|
|
131
|
-
reporter?: ReporterDef<unknown> | string;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
reporters: {
|
|
135
|
-
[reporterName: string]: ReporterDef<unknown>;
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
export type SpanContext = {
|
|
139
|
-
currentSpan: typeof currentSpan;
|
|
140
|
-
NOOP_SPAN: typeof NOOP_SPAN;
|
|
141
|
-
};
|
|
142
|
-
declare global {
|
|
143
|
-
var _evals: EvaluatorFile;
|
|
144
|
-
var _spanContext: SpanContext | undefined;
|
|
145
|
-
var _lazy_load: boolean;
|
|
146
|
-
}
|
|
147
|
-
export interface EvalOptions<EvalReport> {
|
|
148
|
-
reporter?: ReporterDef<EvalReport> | string;
|
|
149
|
-
onStart?: (metadata: Omit<ExperimentSummary, "scores" | "metrics">) => void;
|
|
150
|
-
}
|
|
151
|
-
export declare function Eval<Input, Output, Expected = void, Metadata extends BaseMetadata = DefaultMetadataType, EvalReport = boolean>(name: string, evaluator: Evaluator<Input, Output, Expected, Metadata>, reporterOrOpts?: ReporterDef<EvalReport> | string | EvalOptions<EvalReport>): Promise<EvalResultWithSummary<Input, Output, Expected, Metadata>>;
|
|
152
|
-
export declare function Reporter<EvalReport>(name: string, reporter: ReporterBody<EvalReport>): ReporterDef<EvalReport>;
|
|
153
|
-
export declare function getLoadedEvals(): EvaluatorFile;
|
|
154
|
-
export interface Filter {
|
|
155
|
-
path: string[];
|
|
156
|
-
pattern: RegExp;
|
|
157
|
-
}
|
|
158
|
-
export declare function serializeJSONWithPlainString(v: any): string;
|
|
159
|
-
export declare function deserializePlainStringAsJSON(s: string): {
|
|
160
|
-
value: any;
|
|
161
|
-
error: undefined;
|
|
162
|
-
} | {
|
|
163
|
-
value: string;
|
|
164
|
-
error: unknown;
|
|
165
|
-
};
|
|
166
|
-
export declare function parseFilters(filters: string[]): Filter[];
|
|
167
|
-
export declare function scorerName(scorer: EvalScorer<any, any, any, any>, scorer_idx: number): string;
|
|
168
|
-
export declare function runEvaluator(experiment: Experiment | null, evaluator: EvaluatorDef<any, any, any, any>, progressReporter: ProgressReporter, filters: Filter[]): Promise<EvalResultWithSummary<any, any, any, any>>;
|
|
169
|
-
export declare const error: chalk.Chalk;
|
|
170
|
-
export declare const warning: chalk.Chalk;
|
|
171
|
-
export declare function logError(e: unknown, verbose: boolean): void;
|
|
172
|
-
export declare function buildLocalSummary(evaluator: EvaluatorDef<any, any, any, any>, results: EvalResult<any, any, any, any>[]): ExperimentSummary;
|
|
173
|
-
export declare function reportFailures<Input, Output, Expected, Metadata extends BaseMetadata>(evaluator: EvaluatorDef<Input, Output, Expected, Metadata>, failingResults: EvalResult<Input, Output, Expected, Metadata>[], { verbose, jsonl }: ReporterOpts): void;
|
|
174
|
-
/**
|
|
175
|
-
* The default reporter for Braintrust evaluations. This reporter will log the results
|
|
176
|
-
* of each evaluation to the console, and will return false (i.e. fail) if any of the
|
|
177
|
-
* evaluations return an error.
|
|
178
|
-
*/
|
|
179
|
-
export declare const defaultReporter: ReporterDef<boolean>;
|
|
180
|
-
export {};
|
package/dist/framework.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/functions.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { EvaluatorState, FileHandle } from "./cli";
|
|
2
|
-
import { Experiment } from "./logger";
|
|
3
|
-
import * as esbuild from "esbuild";
|
|
4
|
-
export type EvaluatorMap = Record<string, {
|
|
5
|
-
evaluator: EvaluatorState["evaluators"][number];
|
|
6
|
-
experiment: Experiment;
|
|
7
|
-
}>;
|
|
8
|
-
export declare function uploadEvalBundles({ experimentIdToEvaluator, bundlePromises, handles, verbose, }: {
|
|
9
|
-
experimentIdToEvaluator: EvaluatorMap;
|
|
10
|
-
bundlePromises: {
|
|
11
|
-
[k: string]: Promise<esbuild.BuildResult<esbuild.BuildOptions>>;
|
|
12
|
-
};
|
|
13
|
-
handles: Record<string, FileHandle>;
|
|
14
|
-
verbose: boolean;
|
|
15
|
-
}): Promise<void>;
|
package/dist/gitutil.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { GitMetadataSettings } from "@braintrust/core";
|
|
2
|
-
/**
|
|
3
|
-
* Information about the current HEAD of the repo.
|
|
4
|
-
*/
|
|
5
|
-
export declare function currentRepo(): Promise<import("simple-git").SimpleGit | null>;
|
|
6
|
-
export declare function getPastNAncestors(n?: number, remote?: string | undefined): Promise<string[]>;
|
|
7
|
-
export declare function getRepoInfo(settings?: GitMetadataSettings): Promise<{
|
|
8
|
-
commit?: string | null | undefined;
|
|
9
|
-
branch?: string | null | undefined;
|
|
10
|
-
tag?: string | null | undefined;
|
|
11
|
-
dirty?: boolean | null | undefined;
|
|
12
|
-
author_name?: string | null | undefined;
|
|
13
|
-
author_email?: string | null | undefined;
|
|
14
|
-
commit_message?: string | null | undefined;
|
|
15
|
-
commit_time?: string | null | undefined;
|
|
16
|
-
git_diff?: string | null | undefined;
|
|
17
|
-
} | undefined>;
|
package/dist/isomorph.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { GitMetadataSettings, RepoInfo } from "@braintrust/core";
|
|
2
|
-
export interface CallerLocation {
|
|
3
|
-
caller_functionname: string;
|
|
4
|
-
caller_filename: string;
|
|
5
|
-
caller_lineno: number;
|
|
6
|
-
}
|
|
7
|
-
export interface IsoAsyncLocalStorage<T> {
|
|
8
|
-
enterWith(store: T): void;
|
|
9
|
-
run<R>(store: T | undefined, callback: () => R): R;
|
|
10
|
-
getStore(): T | undefined;
|
|
11
|
-
}
|
|
12
|
-
export interface Common {
|
|
13
|
-
getRepoInfo: (settings?: GitMetadataSettings) => Promise<RepoInfo | undefined>;
|
|
14
|
-
getPastNAncestors: () => Promise<string[]>;
|
|
15
|
-
getEnv: (name: string) => string | undefined;
|
|
16
|
-
getCallerLocation: () => CallerLocation | undefined;
|
|
17
|
-
newAsyncLocalStorage: <T>() => IsoAsyncLocalStorage<T>;
|
|
18
|
-
processOn: (event: string, handler: (code: any) => void) => void;
|
|
19
|
-
pathJoin?: (...args: string[]) => string;
|
|
20
|
-
pathDirname?: (path: string) => string;
|
|
21
|
-
mkdir?: (path: string, opts?: {
|
|
22
|
-
recursive?: boolean;
|
|
23
|
-
}) => Promise<string | undefined>;
|
|
24
|
-
writeFile?: (filename: string, data: string) => Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
declare const iso: Common;
|
|
27
|
-
export default iso;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* Adapted from: https://github.com/substack/node-resolve
|
|
8
|
-
*/
|
|
9
|
-
type NodeModulesPathsOptions = {
|
|
10
|
-
moduleDirectory?: Array<string>;
|
|
11
|
-
paths?: Array<string>;
|
|
12
|
-
};
|
|
13
|
-
export default function nodeModulesPaths(basedir: string, options: NodeModulesPathsOptions): Array<string>;
|
|
14
|
-
export declare const GlobalPaths: string[];
|
|
15
|
-
export {};
|
package/dist/node.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function configureNode(): void;
|
package/dist/progress.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface ProgressReporter {
|
|
2
|
-
start: (name: string, total: number) => void;
|
|
3
|
-
stop: () => void;
|
|
4
|
-
increment: (name: string) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare class SimpleProgressReporter {
|
|
7
|
-
start(name: string, _total: number): void;
|
|
8
|
-
stop(): void;
|
|
9
|
-
increment(_name: string): void;
|
|
10
|
-
}
|
|
11
|
-
export declare class BarProgressReporter {
|
|
12
|
-
private multiBar;
|
|
13
|
-
private bars;
|
|
14
|
-
constructor();
|
|
15
|
-
start(name: string, total: number): void;
|
|
16
|
-
stop(): void;
|
|
17
|
-
increment(name: string): void;
|
|
18
|
-
}
|
package/dist/stackutil.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CallerLocation } from "./isomorph";
|
|
2
|
-
export interface StackTraceEntry {
|
|
3
|
-
functionName: string;
|
|
4
|
-
fileName: string;
|
|
5
|
-
lineNo: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function getStackTrace(): StackTraceEntry[];
|
|
8
|
-
export declare function getCallerLocation(): CallerLocation | undefined;
|