From d75e273d7b19824b08cf8a5c81ea31bdcf47e0d5 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Wed, 3 Jun 2026 17:15:11 +0200 Subject: [PATCH] feat: Export `LocalTrace` --- .changeset/full-cars-lick.md | 5 +++++ js/smoke/shared/src/suites/import-verification.ts | 10 +++++++++- js/src/exports.ts | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .changeset/full-cars-lick.md diff --git a/.changeset/full-cars-lick.md b/.changeset/full-cars-lick.md new file mode 100644 index 000000000..9555d4cf8 --- /dev/null +++ b/.changeset/full-cars-lick.md @@ -0,0 +1,5 @@ +--- +"braintrust": minor +--- + +feat: Export `LocalTrace` diff --git a/js/smoke/shared/src/suites/import-verification.ts b/js/smoke/shared/src/suites/import-verification.ts index 7bd478c59..492ba2f0e 100644 --- a/js/smoke/shared/src/suites/import-verification.ts +++ b/js/smoke/shared/src/suites/import-verification.ts @@ -63,6 +63,7 @@ export interface BraintrustModule { traced?: unknown; traceable?: unknown; wrapTraced?: unknown; + LocalTrace?: unknown; updateSpan?: unknown; withCurrent?: unknown; @@ -266,6 +267,13 @@ export const testTracingExports = register( assertDefined(module.wrapTraced, "wrapTraced must exist"); assertType(module.wrapTraced, "function", "wrapTraced must be a function"); + assertDefined(module.LocalTrace, "LocalTrace must exist"); + assertType( + module.LocalTrace, + "function", + "LocalTrace must be a function/class", + ); + assertDefined(module.updateSpan, "updateSpan must exist"); assertType(module.updateSpan, "function", "updateSpan must be a function"); @@ -276,7 +284,7 @@ export const testTracingExports = register( "withCurrent must be a function", ); - return "Tracing exports verified (5 exports)"; + return "Tracing exports verified (6 exports)"; }, ); diff --git a/js/src/exports.ts b/js/src/exports.ts index 5712559b2..ee9f7a205 100644 --- a/js/src/exports.ts +++ b/js/src/exports.ts @@ -261,7 +261,7 @@ export { } from "./prompt-schemas"; export type { Trace, SpanData, GetThreadOptions } from "./trace"; -export { SpanFetcher, CachedSpanFetcher } from "./trace"; +export { SpanFetcher, CachedSpanFetcher, LocalTrace } from "./trace"; export type { ParentExperimentIds,