bitfab 0.51.0 → 0.52.0

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
@@ -802,11 +802,19 @@ type TraceAssertionsResult = {
802
802
  assertions: TraceAssertion[];
803
803
  inheritedFrom: string | null;
804
804
  };
805
+ type TraceAssertionsUpdate = {
806
+ traceId: string;
807
+ assertions: SaveAssertion[];
808
+ };
805
809
  type SaveAssertionsParams = {
806
810
  traceId: string;
807
811
  assertions: SaveAssertion[];
808
812
  source?: TraceAssertionSource;
809
813
  };
814
+ type SaveAssertionsAllParams = {
815
+ updates: TraceAssertionsUpdate[];
816
+ source?: TraceAssertionSource;
817
+ };
810
818
  type ArchiveAssertionsParams = {
811
819
  traceId: string;
812
820
  assertionIds: string[];
@@ -816,6 +824,7 @@ declare class TracesClient {
816
824
  constructor(httpClient: HttpClient);
817
825
  getAssertions(traceId: string): Promise<TraceAssertionsResult>;
818
826
  saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
827
+ saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
819
828
  archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
820
829
  }
821
830
 
@@ -3279,7 +3288,7 @@ declare class BitfabFunction {
3279
3288
  /**
3280
3289
  * SDK version from package.json (injected at build time)
3281
3290
  */
3282
- declare const __version__ = "0.51.0";
3291
+ declare const __version__ = "0.52.0";
3283
3292
 
3284
3293
  /**
3285
3294
  * Constants for the Bitfab SDK.
@@ -3409,4 +3418,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3409
3418
  run?: boolean;
3410
3419
  }): Promise<SeedResult>;
3411
3420
 
3412
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, type AssertionVerdict, 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 GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelUpdate, LabelsClient, 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 SaveAssertion, type SaveAssertionsParams, 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 TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
3421
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, type AssertionVerdict, 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 GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelUpdate, LabelsClient, 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 SaveAssertion, type SaveAssertionsAllParams, type SaveAssertionsParams, 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 TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, 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
@@ -802,11 +802,19 @@ type TraceAssertionsResult = {
802
802
  assertions: TraceAssertion[];
803
803
  inheritedFrom: string | null;
804
804
  };
805
+ type TraceAssertionsUpdate = {
806
+ traceId: string;
807
+ assertions: SaveAssertion[];
808
+ };
805
809
  type SaveAssertionsParams = {
806
810
  traceId: string;
807
811
  assertions: SaveAssertion[];
808
812
  source?: TraceAssertionSource;
809
813
  };
814
+ type SaveAssertionsAllParams = {
815
+ updates: TraceAssertionsUpdate[];
816
+ source?: TraceAssertionSource;
817
+ };
810
818
  type ArchiveAssertionsParams = {
811
819
  traceId: string;
812
820
  assertionIds: string[];
@@ -816,6 +824,7 @@ declare class TracesClient {
816
824
  constructor(httpClient: HttpClient);
817
825
  getAssertions(traceId: string): Promise<TraceAssertionsResult>;
818
826
  saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
827
+ saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
819
828
  archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
820
829
  }
821
830
 
@@ -3279,7 +3288,7 @@ declare class BitfabFunction {
3279
3288
  /**
3280
3289
  * SDK version from package.json (injected at build time)
3281
3290
  */
3282
- declare const __version__ = "0.51.0";
3291
+ declare const __version__ = "0.52.0";
3283
3292
 
3284
3293
  /**
3285
3294
  * Constants for the Bitfab SDK.
@@ -3409,4 +3418,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3409
3418
  run?: boolean;
3410
3419
  }): Promise<SeedResult>;
3411
3420
 
3412
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, type AssertionVerdict, 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 GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelUpdate, LabelsClient, 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 SaveAssertion, type SaveAssertionsParams, 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 TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, seedFromRegistry, serializeReplayResult };
3421
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ArchiveAssertionsParams, type AssertionVerdict, 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 GetGraderLabelsParams, type GraderLabel, type GraderLabelSource, type GraderRerun, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GradersClient, HttpClient, type HumanLabelOutcome, type HumanLabelUpdate, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelUpdate, LabelsClient, 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 SaveAssertion, type SaveAssertionsAllParams, type SaveAssertionsParams, 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 TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceOutline, type TraceOutlineSpan, type TraceOutlineSpanError, type TraceResponse, type TraceTarget, type TraceTargetOccurrence, TracesClient, 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
@@ -27,7 +27,7 @@ import {
27
27
  getCurrentSpan,
28
28
  getCurrentTrace,
29
29
  seedFromRegistry
30
- } from "./chunk-2RAX75MI.js";
30
+ } from "./chunk-KZKVSOBL.js";
31
31
  import "./chunk-ZUD7OFYB.js";
32
32
  import {
33
33
  BITFAB_PROGRESS_PREFIX,
@@ -36,7 +36,7 @@ import {
36
36
  ReplayError,
37
37
  reportReplayProgress,
38
38
  serializeReplayResult
39
- } from "./chunk-TCOMLVHK.js";
39
+ } from "./chunk-LLS4QMFH.js";
40
40
  import {
41
41
  BitfabError,
42
42
  DEFAULT_SERVICE_URL,
@@ -44,7 +44,7 @@ import {
44
44
  MixedTracingError,
45
45
  __version__,
46
46
  flushTraces
47
- } from "./chunk-4Z5FCOMO.js";
47
+ } from "./chunk-6M3EOIRH.js";
48
48
  import "./chunk-H6LZRFMN.js";
49
49
  export {
50
50
  BITFAB_PROGRESS_PREFIX,
package/dist/node.cjs CHANGED
@@ -97,7 +97,7 @@ var __version__, __packageName__;
97
97
  var init_version_generated = __esm({
98
98
  "src/version.generated.ts"() {
99
99
  "use strict";
100
- __version__ = "0.51.0";
100
+ __version__ = "0.52.0";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -3339,7 +3339,8 @@ registerAsyncLocalStorageClass(
3339
3339
  );
3340
3340
 
3341
3341
  // src/assertions.ts
3342
- function expectationsPath(traceId, suffix = "") {
3342
+ var ASSERTIONS_PATH = "/api/sdk/traces/assertions";
3343
+ function traceAssertionsPath(traceId, suffix = "") {
3343
3344
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
3344
3345
  }
3345
3346
  var TracesClient = class {
@@ -3347,18 +3348,29 @@ var TracesClient = class {
3347
3348
  this.httpClient = httpClient;
3348
3349
  }
3349
3350
  async getAssertions(traceId) {
3350
- return this.httpClient.get(expectationsPath(traceId));
3351
+ return this.httpClient.get(
3352
+ traceAssertionsPath(traceId)
3353
+ );
3351
3354
  }
3352
3355
  async saveAssertions(params) {
3353
- const response = await this.httpClient.request(expectationsPath(params.traceId), {
3354
- assertions: params.assertions,
3356
+ return this.saveAssertionsAll({
3357
+ updates: [{ traceId: params.traceId, assertions: params.assertions }],
3358
+ source: params.source
3359
+ });
3360
+ }
3361
+ async saveAssertionsAll(params) {
3362
+ if (params.updates.length === 0) {
3363
+ return [];
3364
+ }
3365
+ const response = await this.httpClient.request(ASSERTIONS_PATH, {
3366
+ updates: params.updates,
3355
3367
  source: params.source ?? "agent"
3356
3368
  });
3357
3369
  return response.assertions;
3358
3370
  }
3359
3371
  async archiveAssertions(params) {
3360
3372
  const response = await this.httpClient.request(
3361
- expectationsPath(params.traceId, "/archive"),
3373
+ traceAssertionsPath(params.traceId, "/archive"),
3362
3374
  { assertionIds: params.assertionIds }
3363
3375
  );
3364
3376
  return response.archived;