@bitfab/sdk 0.44.0 → 0.44.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/dist/index.d.cts CHANGED
@@ -647,6 +647,32 @@ interface TokenUsage {
647
647
  cached: number | null;
648
648
  total: number | null;
649
649
  }
650
+ interface TraceOutlineSpanError {
651
+ source: string;
652
+ error: string;
653
+ step?: string;
654
+ }
655
+ interface TraceOutlineSpan {
656
+ spanId: string;
657
+ name: string | null;
658
+ type: string;
659
+ traceFunctionKey: string | null;
660
+ durationMs: number | null;
661
+ tokens: TokenUsage | null;
662
+ model: string | null;
663
+ errors: TraceOutlineSpanError[] | null;
664
+ mocked: boolean;
665
+ children: TraceOutlineSpan[];
666
+ }
667
+ interface TraceOutline {
668
+ traceId: string;
669
+ name: string | null;
670
+ status: string;
671
+ traceFunctionKey: string | null;
672
+ durationMs: number | null;
673
+ spanCount: number;
674
+ spans: TraceOutlineSpan[];
675
+ }
650
676
  /**
651
677
  * Describes a single file edited as part of a code change.
652
678
  *
@@ -746,6 +772,8 @@ interface CompleteReplayResponse {
746
772
  * `ReplayItem.tokens`. Absent on servers that predate this field.
747
773
  */
748
774
  tokens?: Record<string, TokenUsage | null>;
775
+ traceOutlines?: Record<string, TraceOutline>;
776
+ originalTraceOutlines?: Record<string, TraceOutline>;
749
777
  /**
750
778
  * Number of traces the server has persisted for this test run at
751
779
  * completion time. Lets the SDK distinguish "uploads failed" from
@@ -1693,6 +1721,8 @@ interface ReplayProgressItem {
1693
1721
  model?: string | null;
1694
1722
  dbSnapshotRef?: DbSnapshotRef | null;
1695
1723
  dbBranchTimings?: DbBranchTimings | null;
1724
+ traceOutline?: TraceOutline | null;
1725
+ originalTraceOutline?: TraceOutline | null;
1696
1726
  }
1697
1727
  /**
1698
1728
  * @deprecated Use {@link ReplayItemFinishProgress}. This legacy shape also
@@ -1844,6 +1874,8 @@ interface ReplayItem<T> {
1844
1874
  * no snapshot ref, or against a server that predates timings.
1845
1875
  */
1846
1876
  dbBranchTimings: DbBranchTimings | null;
1877
+ traceOutline: TraceOutline | null;
1878
+ originalTraceOutline: TraceOutline | null;
1847
1879
  }
1848
1880
 
1849
1881
  interface ReplayResult<T> {
@@ -3082,7 +3114,7 @@ declare class BitfabFunction {
3082
3114
  /**
3083
3115
  * SDK version from package.json (injected at build time)
3084
3116
  */
3085
- declare const __version__ = "0.44.0";
3117
+ declare const __version__ = "0.44.1";
3086
3118
 
3087
3119
  /**
3088
3120
  * Constants for the Bitfab SDK.
@@ -3212,4 +3244,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3212
3244
  run?: boolean;
3213
3245
  }): Promise<SeedResult>;
3214
3246
 
3215
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
3247
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
package/dist/index.d.ts CHANGED
@@ -647,6 +647,32 @@ interface TokenUsage {
647
647
  cached: number | null;
648
648
  total: number | null;
649
649
  }
650
+ interface TraceOutlineSpanError {
651
+ source: string;
652
+ error: string;
653
+ step?: string;
654
+ }
655
+ interface TraceOutlineSpan {
656
+ spanId: string;
657
+ name: string | null;
658
+ type: string;
659
+ traceFunctionKey: string | null;
660
+ durationMs: number | null;
661
+ tokens: TokenUsage | null;
662
+ model: string | null;
663
+ errors: TraceOutlineSpanError[] | null;
664
+ mocked: boolean;
665
+ children: TraceOutlineSpan[];
666
+ }
667
+ interface TraceOutline {
668
+ traceId: string;
669
+ name: string | null;
670
+ status: string;
671
+ traceFunctionKey: string | null;
672
+ durationMs: number | null;
673
+ spanCount: number;
674
+ spans: TraceOutlineSpan[];
675
+ }
650
676
  /**
651
677
  * Describes a single file edited as part of a code change.
652
678
  *
@@ -746,6 +772,8 @@ interface CompleteReplayResponse {
746
772
  * `ReplayItem.tokens`. Absent on servers that predate this field.
747
773
  */
748
774
  tokens?: Record<string, TokenUsage | null>;
775
+ traceOutlines?: Record<string, TraceOutline>;
776
+ originalTraceOutlines?: Record<string, TraceOutline>;
749
777
  /**
750
778
  * Number of traces the server has persisted for this test run at
751
779
  * completion time. Lets the SDK distinguish "uploads failed" from
@@ -1693,6 +1721,8 @@ interface ReplayProgressItem {
1693
1721
  model?: string | null;
1694
1722
  dbSnapshotRef?: DbSnapshotRef | null;
1695
1723
  dbBranchTimings?: DbBranchTimings | null;
1724
+ traceOutline?: TraceOutline | null;
1725
+ originalTraceOutline?: TraceOutline | null;
1696
1726
  }
1697
1727
  /**
1698
1728
  * @deprecated Use {@link ReplayItemFinishProgress}. This legacy shape also
@@ -1844,6 +1874,8 @@ interface ReplayItem<T> {
1844
1874
  * no snapshot ref, or against a server that predates timings.
1845
1875
  */
1846
1876
  dbBranchTimings: DbBranchTimings | null;
1877
+ traceOutline: TraceOutline | null;
1878
+ originalTraceOutline: TraceOutline | null;
1847
1879
  }
1848
1880
 
1849
1881
  interface ReplayResult<T> {
@@ -3082,7 +3114,7 @@ declare class BitfabFunction {
3082
3114
  /**
3083
3115
  * SDK version from package.json (injected at build time)
3084
3116
  */
3085
- declare const __version__ = "0.44.0";
3117
+ declare const __version__ = "0.44.1";
3086
3118
 
3087
3119
  /**
3088
3120
  * Constants for the Bitfab SDK.
@@ -3212,4 +3244,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3212
3244
  run?: boolean;
3213
3245
  }): Promise<SeedResult>;
3214
3246
 
3215
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
3247
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CurrentSpan, type CurrentTrace, DEFAULT_SERVICE_URL, type Dataset, type DatasetGraderRef, type DatasetTraceIds, DatasetsClient, type DbBranchOptions, DbBranchReplayError, type DbBranchTimings, type DbSnapshotConfig, type DbSnapshotProvider, type DbSnapshotRef, type DetachedTrace, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, HttpClient, type LangGraphIntegrationOptions, type ListDatasetsParams, MixedTracingError, type MockOverride, type MockOverrideCtx, type MockOverrideInput, type MockOverrideResolver, type MockStrategy, type MockValue, NO_MOCK_OVERRIDE, type NodeMatcher, type NodeMethodDecorator, type NodeOptions, type ProviderDefinition, type RemoveDatasetGradersResult, type RemoveDatasetTracesResult, ReplayBranch, ReplayError, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayOptions, type ReplayOptionsFactory, type ReplayProgress, type ReplayProgressItem, type ReplayRegistration, type ReplayRegistry, type ReplayRegistryContext, type ReplayRegistryOptions, type ReplayResult, type RerunGradersOptions, type RerunGradersResult, SUPPORTED_PROVIDERS, type SaveDatasetParams, type SaveDatasetResult, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, type TokenUsage, type TraceIngestionType, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  getCurrentSpan,
16
16
  getCurrentTrace,
17
17
  seedFromRegistry
18
- } from "./chunk-XYMG2FH7.js";
18
+ } from "./chunk-RZF5XSM6.js";
19
19
  import "./chunk-ZUD7OFYB.js";
20
20
  import {
21
21
  BITFAB_PROGRESS_PREFIX,
@@ -24,7 +24,7 @@ import {
24
24
  ReplayError,
25
25
  reportReplayProgress,
26
26
  serializeReplayResult
27
- } from "./chunk-3WIN3VU3.js";
27
+ } from "./chunk-SMWYCJH6.js";
28
28
  import {
29
29
  BitfabError,
30
30
  DEFAULT_SERVICE_URL,
@@ -32,7 +32,7 @@ import {
32
32
  MixedTracingError,
33
33
  __version__,
34
34
  flushTraces
35
- } from "./chunk-6JTVCM2L.js";
35
+ } from "./chunk-XTX66R4I.js";
36
36
  import "./chunk-H6LZRFMN.js";
37
37
  export {
38
38
  BITFAB_PROGRESS_PREFIX,
package/dist/node.cjs CHANGED
@@ -88,7 +88,7 @@ var __version__, __packageName__;
88
88
  var init_version_generated = __esm({
89
89
  "src/version.generated.ts"() {
90
90
  "use strict";
91
- __version__ = "0.44.0";
91
+ __version__ = "0.44.1";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -2726,7 +2726,9 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
2726
2726
  tokens: null,
2727
2727
  model: serverItem.originalModel ?? serverItem.model ?? null,
2728
2728
  dbSnapshotRef: dbSnapshotRef ?? null,
2729
- dbBranchTimings: dbBranchTimings ?? null
2729
+ dbBranchTimings: dbBranchTimings ?? null,
2730
+ traceOutline: null,
2731
+ originalTraceOutline: null
2730
2732
  };
2731
2733
  }
2732
2734
  try {
@@ -2810,7 +2812,9 @@ async function processItem(httpClient, serverItem, fn, testRunId, mockStrategy,
2810
2812
  tokens: null,
2811
2813
  model: originalModel,
2812
2814
  dbSnapshotRef: dbSnapshotRef ?? null,
2813
- dbBranchTimings: dbBranchTimings ?? null
2815
+ dbBranchTimings: dbBranchTimings ?? null,
2816
+ traceOutline: null,
2817
+ originalTraceOutline: null
2814
2818
  };
2815
2819
  }
2816
2820
  async function waitForReplayPersistence(httpClient, testRunId, replayedTraceIds) {
@@ -3065,7 +3069,9 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
3065
3069
  tokens: item.tokens,
3066
3070
  model: item.model,
3067
3071
  dbSnapshotRef: item.dbSnapshotRef,
3068
- dbBranchTimings: item.dbBranchTimings
3072
+ dbBranchTimings: item.dbBranchTimings,
3073
+ traceOutline: item.traceOutline,
3074
+ originalTraceOutline: item.originalTraceOutline
3069
3075
  }
3070
3076
  });
3071
3077
  } catch {
@@ -3145,7 +3151,9 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
3145
3151
  }
3146
3152
  if (mapped !== void 0) {
3147
3153
  item.tokens = replayTokens?.[mapped] ?? null;
3154
+ item.traceOutline = completeResult.traceOutlines?.[mapped] ?? null;
3148
3155
  }
3156
+ item.originalTraceOutline = completeResult.originalTraceOutlines?.[item.originalTraceId] ?? null;
3149
3157
  }
3150
3158
  if (completedCount > 0 && missing.length === completedCount) {
3151
3159
  const serverCount = completeResult.traceCount !== void 0 ? ` The server persisted ${completeResult.traceCount} trace(s) for this run.` : "";