braintrust 2.2.2 → 3.0.0-rc.33

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/README.md CHANGED
@@ -50,3 +50,22 @@ async function main() {
50
50
 
51
51
  main().catch(console.error);
52
52
  ```
53
+
54
+ ### Browser Support
55
+
56
+ **For browser-only applications, use the dedicated browser package:**
57
+
58
+ ```bash
59
+ npm install @braintrust/browser
60
+ ```
61
+
62
+ The `@braintrust/browser` package is optimized for browser environments and includes the `als-browser` polyfill for AsyncLocalStorage support. It's a standalone package with no peer dependencies.
63
+
64
+ **When to use each package:**
65
+
66
+ - **`braintrust`** (this package) - For Node.js applications, full-stack frameworks (Next.js, etc.), and edge runtimes with native AsyncLocalStorage (Cloudflare Workers, Vercel Edge)
67
+ - **`@braintrust/browser`** - For browser-only applications that need AsyncLocalStorage support in standard browsers
68
+
69
+ See the [@braintrust/browser README](../integrations/browser-js/README.md) for more details.
70
+
71
+ **Breaking change in v3.0.0:** The `braintrust/browser` subpath export has been deprecated. Browser users should migrate to the `@braintrust/browser` package.
@@ -9099,6 +9099,12 @@ type ToolFunctionDefinitionType = z.infer<typeof ToolFunctionDefinition>;
9099
9099
 
9100
9100
  type GenericFunction<Input, Output> = ((input: Input) => Output) | ((input: Input) => Promise<Output>);
9101
9101
 
9102
+ interface IsoAsyncLocalStorage<T> {
9103
+ enterWith(store: T): void;
9104
+ run<R>(store: T | undefined, callback: () => R): R;
9105
+ getStore(): T | undefined;
9106
+ }
9107
+
9102
9108
  /**
9103
9109
  * Abstract base class for ID generators
9104
9110
  */
@@ -9119,12 +9125,6 @@ declare abstract class IDGenerator {
9119
9125
 
9120
9126
  type TemplateFormat = "mustache" | "nunjucks" | "none";
9121
9127
 
9122
- interface IsoAsyncLocalStorage<T> {
9123
- enterWith(store: T): void;
9124
- run<R>(store: T | undefined, callback: () => R): R;
9125
- getStore(): T | undefined;
9126
- }
9127
-
9128
9128
  /**
9129
9129
  * Options for configuring an LRUCache instance.
9130
9130
  */
@@ -11149,8 +11149,6 @@ type InferParameters<T extends EvalParameters> = {
11149
11149
  [K in keyof T]: InferParameterValue<T[K]>;
11150
11150
  };
11151
11151
 
11152
- /// <reference lib="dom" />
11153
-
11154
11152
  declare const parametersRowSchema: z.ZodObject<{
11155
11153
  id: z.ZodString;
11156
11154
  _xact_id: z.ZodString;
@@ -11403,6 +11401,9 @@ declare class NoopSpan implements Span {
11403
11401
  declare const NOOP_SPAN: NoopSpan;
11404
11402
  declare global {
11405
11403
  var __inherited_braintrust_state: BraintrustState;
11404
+ interface Global {
11405
+ [key: symbol]: any;
11406
+ }
11406
11407
  }
11407
11408
  declare const loginSchema: z.ZodObject<{
11408
11409
  appUrl: z.ZodString;
@@ -9099,6 +9099,12 @@ type ToolFunctionDefinitionType = z.infer<typeof ToolFunctionDefinition>;
9099
9099
 
9100
9100
  type GenericFunction<Input, Output> = ((input: Input) => Output) | ((input: Input) => Promise<Output>);
9101
9101
 
9102
+ interface IsoAsyncLocalStorage<T> {
9103
+ enterWith(store: T): void;
9104
+ run<R>(store: T | undefined, callback: () => R): R;
9105
+ getStore(): T | undefined;
9106
+ }
9107
+
9102
9108
  /**
9103
9109
  * Abstract base class for ID generators
9104
9110
  */
@@ -9119,12 +9125,6 @@ declare abstract class IDGenerator {
9119
9125
 
9120
9126
  type TemplateFormat = "mustache" | "nunjucks" | "none";
9121
9127
 
9122
- interface IsoAsyncLocalStorage<T> {
9123
- enterWith(store: T): void;
9124
- run<R>(store: T | undefined, callback: () => R): R;
9125
- getStore(): T | undefined;
9126
- }
9127
-
9128
9128
  /**
9129
9129
  * Options for configuring an LRUCache instance.
9130
9130
  */
@@ -11149,8 +11149,6 @@ type InferParameters<T extends EvalParameters> = {
11149
11149
  [K in keyof T]: InferParameterValue<T[K]>;
11150
11150
  };
11151
11151
 
11152
- /// <reference lib="dom" />
11153
-
11154
11152
  declare const parametersRowSchema: z.ZodObject<{
11155
11153
  id: z.ZodString;
11156
11154
  _xact_id: z.ZodString;
@@ -11403,6 +11401,9 @@ declare class NoopSpan implements Span {
11403
11401
  declare const NOOP_SPAN: NoopSpan;
11404
11402
  declare global {
11405
11403
  var __inherited_braintrust_state: BraintrustState;
11404
+ interface Global {
11405
+ [key: symbol]: any;
11406
+ }
11406
11407
  }
11407
11408
  declare const loginSchema: z.ZodObject<{
11408
11409
  appUrl: z.ZodString;