braintrust 3.7.0 → 3.7.1
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.js +1859 -1338
- package/dev/dist/index.mjs +1774 -1253
- package/dist/auto-instrumentations/bundler/esbuild.cjs +12 -15
- package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
- package/dist/auto-instrumentations/bundler/rollup.cjs +12 -15
- package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
- package/dist/auto-instrumentations/bundler/vite.cjs +12 -15
- package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +12 -15
- package/dist/auto-instrumentations/bundler/webpack.cjs +12 -15
- package/dist/auto-instrumentations/bundler/webpack.mjs +2 -2
- package/dist/auto-instrumentations/{chunk-ZK2IYER2.mjs → chunk-NY4CGTN6.mjs} +1 -1
- package/dist/auto-instrumentations/{chunk-AKEXR4AL.mjs → chunk-YCKND42U.mjs} +12 -15
- package/dist/auto-instrumentations/hook.mjs +12 -15
- package/dist/auto-instrumentations/index.cjs +12 -15
- package/dist/auto-instrumentations/index.mjs +1 -1
- package/dist/browser.d.mts +8 -30
- package/dist/browser.d.ts +8 -30
- package/dist/browser.js +4836 -6828
- package/dist/browser.mjs +4836 -6828
- package/dist/cli.js +1507 -986
- package/dist/edge-light.js +9173 -11163
- package/dist/edge-light.mjs +9173 -11163
- package/dist/index.d.mts +8 -30
- package/dist/index.d.ts +8 -30
- package/dist/index.js +4747 -6739
- package/dist/index.mjs +4748 -6740
- package/dist/instrumentation/index.js +1735 -1236
- package/dist/instrumentation/index.mjs +1735 -1236
- package/dist/workerd.js +9173 -11163
- package/dist/workerd.mjs +9173 -11163
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -15756,7 +15756,7 @@ interface IsoTracingChannel<M = any> extends IsoTracingChannelCollection<M> {
|
|
|
15756
15756
|
subscribe(handlers: IsoChannelHandlers<M>): void;
|
|
15757
15757
|
unsubscribe(handlers: IsoChannelHandlers<M>): boolean;
|
|
15758
15758
|
traceSync<F extends (...args: any[]) => any>(fn: F, message?: M, thisArg?: ThisParameterType<F>, ...args: Parameters<F>): ReturnType<F>;
|
|
15759
|
-
tracePromise<F extends (...args: any[]) => any
|
|
15759
|
+
tracePromise<F extends (...args: any[]) => PromiseLike<any>>(fn: F, message?: M, thisArg?: ThisParameterType<F>, ...args: Parameters<F>): ReturnType<F>;
|
|
15760
15760
|
traceCallback<F extends (...args: any[]) => any>(fn: F, position?: number, message?: M, thisArg?: ThisParameterType<F>, ...args: Parameters<F>): ReturnType<F>;
|
|
15761
15761
|
}
|
|
15762
15762
|
interface IsoChannelHandlers<M = any> {
|
|
@@ -20988,12 +20988,10 @@ interface WrapAISDKOptions {
|
|
|
20988
20988
|
denyOutputPaths?: string[];
|
|
20989
20989
|
}
|
|
20990
20990
|
/**
|
|
20991
|
-
* Wraps Vercel AI SDK methods with Braintrust tracing.
|
|
20992
|
-
* of generateText, streamText, generateObject, streamObject, Agent, experimental_Agent,
|
|
20993
|
-
* and ToolLoopAgent that automatically create spans and log inputs, outputs, and metrics.
|
|
20991
|
+
* Wraps Vercel AI SDK methods with Braintrust tracing.
|
|
20994
20992
|
*
|
|
20995
20993
|
* @param ai - The AI SDK namespace (e.g., import * as ai from "ai")
|
|
20996
|
-
* @returns
|
|
20994
|
+
* @returns AI SDK with Braintrust tracing.
|
|
20997
20995
|
*
|
|
20998
20996
|
* @example
|
|
20999
20997
|
* ```typescript
|
|
@@ -21074,9 +21072,8 @@ interface MiddlewareConfig {
|
|
|
21074
21072
|
declare function BraintrustMiddleware(config?: MiddlewareConfig): LanguageModelV2Middleware<any, any>;
|
|
21075
21073
|
|
|
21076
21074
|
/**
|
|
21077
|
-
* Wrap an `Anthropic` object (created with `new Anthropic(...)`)
|
|
21078
|
-
*
|
|
21079
|
-
* a no-op.
|
|
21075
|
+
* Wrap an `Anthropic` object (created with `new Anthropic(...)`) so calls emit
|
|
21076
|
+
* tracing-channel events that Braintrust plugins can consume.
|
|
21080
21077
|
*
|
|
21081
21078
|
* Currently, this only supports the `v4` API.
|
|
21082
21079
|
*
|
|
@@ -21094,31 +21091,12 @@ declare function wrapMastraAgent<T>(agent: T, _options?: {
|
|
|
21094
21091
|
}): T;
|
|
21095
21092
|
|
|
21096
21093
|
/**
|
|
21097
|
-
* Wraps the Claude Agent SDK with Braintrust tracing.
|
|
21098
|
-
*
|
|
21094
|
+
* Wraps the Claude Agent SDK with Braintrust tracing. Query calls only publish
|
|
21095
|
+
* tracing-channel events; the Claude Agent SDK plugin owns all span lifecycle
|
|
21096
|
+
* work, including root/task spans, LLM spans, tool spans, and sub-agent spans.
|
|
21099
21097
|
*
|
|
21100
21098
|
* @param sdk - The Claude Agent SDK module
|
|
21101
21099
|
* @returns Object with wrapped query, tool, and createSdkMcpServer functions
|
|
21102
|
-
*
|
|
21103
|
-
* @example
|
|
21104
|
-
* ```typescript
|
|
21105
|
-
* import * as claudeSDK from "@anthropic-ai/claude-agent-sdk";
|
|
21106
|
-
* import { wrapClaudeAgentSDK } from "braintrust";
|
|
21107
|
-
*
|
|
21108
|
-
* // Wrap once - returns { query, tool, createSdkMcpServer } with tracing built-in
|
|
21109
|
-
* const { query, tool, createSdkMcpServer } = wrapClaudeAgentSDK(claudeSDK);
|
|
21110
|
-
*
|
|
21111
|
-
* // Use normally - tracing is automatic
|
|
21112
|
-
* for await (const message of query({
|
|
21113
|
-
* prompt: "Hello, Claude!",
|
|
21114
|
-
* options: { model: "claude-haiku-4-5-20251001" }
|
|
21115
|
-
* })) {
|
|
21116
|
-
* console.log(message);
|
|
21117
|
-
* }
|
|
21118
|
-
*
|
|
21119
|
-
* // Tools created with wrapped tool() are automatically traced
|
|
21120
|
-
* const calculator = tool("calculator", "Does math", schema, handler);
|
|
21121
|
-
* ```
|
|
21122
21100
|
*/
|
|
21123
21101
|
declare function wrapClaudeAgentSDK<T extends object>(sdk: T): T;
|
|
21124
21102
|
|
package/dist/index.d.ts
CHANGED
|
@@ -15756,7 +15756,7 @@ interface IsoTracingChannel<M = any> extends IsoTracingChannelCollection<M> {
|
|
|
15756
15756
|
subscribe(handlers: IsoChannelHandlers<M>): void;
|
|
15757
15757
|
unsubscribe(handlers: IsoChannelHandlers<M>): boolean;
|
|
15758
15758
|
traceSync<F extends (...args: any[]) => any>(fn: F, message?: M, thisArg?: ThisParameterType<F>, ...args: Parameters<F>): ReturnType<F>;
|
|
15759
|
-
tracePromise<F extends (...args: any[]) => any
|
|
15759
|
+
tracePromise<F extends (...args: any[]) => PromiseLike<any>>(fn: F, message?: M, thisArg?: ThisParameterType<F>, ...args: Parameters<F>): ReturnType<F>;
|
|
15760
15760
|
traceCallback<F extends (...args: any[]) => any>(fn: F, position?: number, message?: M, thisArg?: ThisParameterType<F>, ...args: Parameters<F>): ReturnType<F>;
|
|
15761
15761
|
}
|
|
15762
15762
|
interface IsoChannelHandlers<M = any> {
|
|
@@ -20988,12 +20988,10 @@ interface WrapAISDKOptions {
|
|
|
20988
20988
|
denyOutputPaths?: string[];
|
|
20989
20989
|
}
|
|
20990
20990
|
/**
|
|
20991
|
-
* Wraps Vercel AI SDK methods with Braintrust tracing.
|
|
20992
|
-
* of generateText, streamText, generateObject, streamObject, Agent, experimental_Agent,
|
|
20993
|
-
* and ToolLoopAgent that automatically create spans and log inputs, outputs, and metrics.
|
|
20991
|
+
* Wraps Vercel AI SDK methods with Braintrust tracing.
|
|
20994
20992
|
*
|
|
20995
20993
|
* @param ai - The AI SDK namespace (e.g., import * as ai from "ai")
|
|
20996
|
-
* @returns
|
|
20994
|
+
* @returns AI SDK with Braintrust tracing.
|
|
20997
20995
|
*
|
|
20998
20996
|
* @example
|
|
20999
20997
|
* ```typescript
|
|
@@ -21074,9 +21072,8 @@ interface MiddlewareConfig {
|
|
|
21074
21072
|
declare function BraintrustMiddleware(config?: MiddlewareConfig): LanguageModelV2Middleware<any, any>;
|
|
21075
21073
|
|
|
21076
21074
|
/**
|
|
21077
|
-
* Wrap an `Anthropic` object (created with `new Anthropic(...)`)
|
|
21078
|
-
*
|
|
21079
|
-
* a no-op.
|
|
21075
|
+
* Wrap an `Anthropic` object (created with `new Anthropic(...)`) so calls emit
|
|
21076
|
+
* tracing-channel events that Braintrust plugins can consume.
|
|
21080
21077
|
*
|
|
21081
21078
|
* Currently, this only supports the `v4` API.
|
|
21082
21079
|
*
|
|
@@ -21094,31 +21091,12 @@ declare function wrapMastraAgent<T>(agent: T, _options?: {
|
|
|
21094
21091
|
}): T;
|
|
21095
21092
|
|
|
21096
21093
|
/**
|
|
21097
|
-
* Wraps the Claude Agent SDK with Braintrust tracing.
|
|
21098
|
-
*
|
|
21094
|
+
* Wraps the Claude Agent SDK with Braintrust tracing. Query calls only publish
|
|
21095
|
+
* tracing-channel events; the Claude Agent SDK plugin owns all span lifecycle
|
|
21096
|
+
* work, including root/task spans, LLM spans, tool spans, and sub-agent spans.
|
|
21099
21097
|
*
|
|
21100
21098
|
* @param sdk - The Claude Agent SDK module
|
|
21101
21099
|
* @returns Object with wrapped query, tool, and createSdkMcpServer functions
|
|
21102
|
-
*
|
|
21103
|
-
* @example
|
|
21104
|
-
* ```typescript
|
|
21105
|
-
* import * as claudeSDK from "@anthropic-ai/claude-agent-sdk";
|
|
21106
|
-
* import { wrapClaudeAgentSDK } from "braintrust";
|
|
21107
|
-
*
|
|
21108
|
-
* // Wrap once - returns { query, tool, createSdkMcpServer } with tracing built-in
|
|
21109
|
-
* const { query, tool, createSdkMcpServer } = wrapClaudeAgentSDK(claudeSDK);
|
|
21110
|
-
*
|
|
21111
|
-
* // Use normally - tracing is automatic
|
|
21112
|
-
* for await (const message of query({
|
|
21113
|
-
* prompt: "Hello, Claude!",
|
|
21114
|
-
* options: { model: "claude-haiku-4-5-20251001" }
|
|
21115
|
-
* })) {
|
|
21116
|
-
* console.log(message);
|
|
21117
|
-
* }
|
|
21118
|
-
*
|
|
21119
|
-
* // Tools created with wrapped tool() are automatically traced
|
|
21120
|
-
* const calculator = tool("calculator", "Does math", schema, handler);
|
|
21121
|
-
* ```
|
|
21122
21100
|
*/
|
|
21123
21101
|
declare function wrapClaudeAgentSDK<T extends object>(sdk: T): T;
|
|
21124
21102
|
|