bitfab 0.58.2 → 0.58.4

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.
Files changed (32) hide show
  1. package/dist/{chunk-PHYROCVC.js → chunk-32ZY3DYR.js} +6 -3
  2. package/dist/{chunk-PHYROCVC.js.map → chunk-32ZY3DYR.js.map} +1 -1
  3. package/dist/{chunk-5JYY2MMV.js → chunk-IVF7JQHF.js} +38 -13
  4. package/dist/chunk-IVF7JQHF.js.map +1 -0
  5. package/dist/{chunk-LZN66ADL.js → chunk-KADON3SF.js} +6 -3
  6. package/dist/{chunk-LZN66ADL.js.map → chunk-KADON3SF.js.map} +1 -1
  7. package/dist/{chunk-Q4UM7ILD.js → chunk-NSD5YKCE.js} +4 -3
  8. package/dist/chunk-NSD5YKCE.js.map +1 -0
  9. package/dist/{chunk-TTVWUP6D.js → chunk-UOW7VDNB.js} +3 -3
  10. package/dist/chunk-UOW7VDNB.js.map +1 -0
  11. package/dist/{http-T3PDEXD6.js → http-TIOONTDB.js} +2 -2
  12. package/dist/{http-MBEZN2GX.js → http-XQGMIDFR.js} +2 -2
  13. package/dist/index.cjs +39 -10
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +14 -5
  16. package/dist/index.d.ts +14 -5
  17. package/dist/index.js +3 -3
  18. package/dist/node.cjs +39 -10
  19. package/dist/node.cjs.map +1 -1
  20. package/dist/node.d.cts +1 -1
  21. package/dist/node.d.ts +1 -1
  22. package/dist/node.js +3 -3
  23. package/dist/{replay-KVUPPFKI.js → replay-CUHT4GUT.js} +3 -3
  24. package/dist/replayCli.js +2 -2
  25. package/dist/seedCli.js +2 -2
  26. package/package.json +1 -1
  27. package/dist/chunk-5JYY2MMV.js.map +0 -1
  28. package/dist/chunk-Q4UM7ILD.js.map +0 -1
  29. package/dist/chunk-TTVWUP6D.js.map +0 -1
  30. /package/dist/{http-MBEZN2GX.js.map → http-TIOONTDB.js.map} +0 -0
  31. /package/dist/{http-T3PDEXD6.js.map → http-XQGMIDFR.js.map} +0 -0
  32. /package/dist/{replay-KVUPPFKI.js.map → replay-CUHT4GUT.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -602,7 +602,7 @@ declare class HttpClient {
602
602
  * Start a replay session by fetching historical traces.
603
603
  * Blocking call - creates a test run and returns lightweight item references.
604
604
  */
605
- startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean): Promise<StartReplayResponse>;
605
+ startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, judgeAssertions?: boolean): Promise<StartReplayResponse>;
606
606
  /**
607
607
  * Fetch an external span by ID.
608
608
  * Blocking GET request.
@@ -1366,9 +1366,10 @@ type AssertionEvidenceParameter = {
1366
1366
  name: string;
1367
1367
  type: "string" | "number" | "boolean" | "object" | "array" | "null" | "unknown";
1368
1368
  };
1369
- type PotentialAssertionEvidence = {
1369
+ type AssertionLabelEvidence = {
1370
1370
  spanId: string;
1371
1371
  text: string;
1372
+ sourceField: string;
1372
1373
  spanName: string | null;
1373
1374
  parameters: AssertionEvidenceParameter[];
1374
1375
  spanType: "llm" | "agent" | "function" | "guardrail" | "handoff" | "custom";
@@ -1511,7 +1512,7 @@ declare class LabelsClient {
1511
1512
  get(traceId: string): Promise<TraceLabels | null>;
1512
1513
  getAll(traceIds: string[]): Promise<TraceLabels[]>;
1513
1514
  /** Generate suggested evidence for an assertion on an original or replay trace. */
1514
- generateLabelEvidence(traceId: string, assertionId: string): Promise<PotentialAssertionEvidence[]>;
1515
+ generateLabelEvidence(traceId: string, assertionId: string): Promise<AssertionLabelEvidence[]>;
1515
1516
  }
1516
1517
 
1517
1518
  type GraderLabelSource = "human" | "live_grader";
@@ -1951,6 +1952,12 @@ interface ReplayOptions {
1951
1952
  * replays nothing.
1952
1953
  */
1953
1954
  onlyWithAssertions?: boolean;
1955
+ /**
1956
+ * Judge every approved assertion on each replay as it finishes and save the
1957
+ * verdict as that assertion's agent label. Off unless asked: each judgement
1958
+ * costs model calls.
1959
+ */
1960
+ judgeAssertions?: boolean;
1954
1961
  /**
1955
1962
  * Reshape recorded inputs before they are spread into `fn`.
1956
1963
  *
@@ -3365,6 +3372,8 @@ declare class Bitfab {
3365
3372
  * Queued on the client's span transport; delivery is the transport's job.
3366
3373
  */
3367
3374
  private sendTraceCompletion;
3375
+ private sendsSpanOnCompletion;
3376
+ private nearestCapturedAncestorSpanIdOf;
3368
3377
  private contentOffBySimulationPlan;
3369
3378
  /**
3370
3379
  * Send a wrapper span from function execution.
@@ -3650,7 +3659,7 @@ interface CommitRef {
3650
3659
  /**
3651
3660
  * SDK version from package.json (injected at build time)
3652
3661
  */
3653
- declare const __version__ = "0.58.2";
3662
+ declare const __version__ = "0.58.4";
3654
3663
 
3655
3664
  /**
3656
3665
  * Constants for the Bitfab SDK.
@@ -3789,4 +3798,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3789
3798
  run?: boolean;
3790
3799
  }): Promise<SeedResult>;
3791
3800
 
3792
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, 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 Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, 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 OrganizationMember, OrganizationMembersClient, type PotentialAssertionEvidence, 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, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, 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 TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
3801
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, 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 Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, 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 OrganizationMember, OrganizationMembersClient, 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, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, 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 TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
package/dist/index.d.ts CHANGED
@@ -602,7 +602,7 @@ declare class HttpClient {
602
602
  * Start a replay session by fetching historical traces.
603
603
  * Blocking call - creates a test run and returns lightweight item references.
604
604
  */
605
- startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean): Promise<StartReplayResponse>;
605
+ startReplay(traceFunctionKey: string, limit: number | undefined, traceIds?: string[], name?: string, codeChangeDescription?: string | null, codeChangeFiles?: CodeChangeFile[] | null, includeDbBranchLease?: boolean, experimentGroupId?: string, datasetIds?: string[], graderIds?: string[], dbBranchSettings?: DbBranchSettings, attempts?: number, includeOriginalMetadata?: boolean, onlyWithAssertions?: boolean, judgeAssertions?: boolean): Promise<StartReplayResponse>;
606
606
  /**
607
607
  * Fetch an external span by ID.
608
608
  * Blocking GET request.
@@ -1366,9 +1366,10 @@ type AssertionEvidenceParameter = {
1366
1366
  name: string;
1367
1367
  type: "string" | "number" | "boolean" | "object" | "array" | "null" | "unknown";
1368
1368
  };
1369
- type PotentialAssertionEvidence = {
1369
+ type AssertionLabelEvidence = {
1370
1370
  spanId: string;
1371
1371
  text: string;
1372
+ sourceField: string;
1372
1373
  spanName: string | null;
1373
1374
  parameters: AssertionEvidenceParameter[];
1374
1375
  spanType: "llm" | "agent" | "function" | "guardrail" | "handoff" | "custom";
@@ -1511,7 +1512,7 @@ declare class LabelsClient {
1511
1512
  get(traceId: string): Promise<TraceLabels | null>;
1512
1513
  getAll(traceIds: string[]): Promise<TraceLabels[]>;
1513
1514
  /** Generate suggested evidence for an assertion on an original or replay trace. */
1514
- generateLabelEvidence(traceId: string, assertionId: string): Promise<PotentialAssertionEvidence[]>;
1515
+ generateLabelEvidence(traceId: string, assertionId: string): Promise<AssertionLabelEvidence[]>;
1515
1516
  }
1516
1517
 
1517
1518
  type GraderLabelSource = "human" | "live_grader";
@@ -1951,6 +1952,12 @@ interface ReplayOptions {
1951
1952
  * replays nothing.
1952
1953
  */
1953
1954
  onlyWithAssertions?: boolean;
1955
+ /**
1956
+ * Judge every approved assertion on each replay as it finishes and save the
1957
+ * verdict as that assertion's agent label. Off unless asked: each judgement
1958
+ * costs model calls.
1959
+ */
1960
+ judgeAssertions?: boolean;
1954
1961
  /**
1955
1962
  * Reshape recorded inputs before they are spread into `fn`.
1956
1963
  *
@@ -3365,6 +3372,8 @@ declare class Bitfab {
3365
3372
  * Queued on the client's span transport; delivery is the transport's job.
3366
3373
  */
3367
3374
  private sendTraceCompletion;
3375
+ private sendsSpanOnCompletion;
3376
+ private nearestCapturedAncestorSpanIdOf;
3368
3377
  private contentOffBySimulationPlan;
3369
3378
  /**
3370
3379
  * Send a wrapper span from function execution.
@@ -3650,7 +3659,7 @@ interface CommitRef {
3650
3659
  /**
3651
3660
  * SDK version from package.json (injected at build time)
3652
3661
  */
3653
- declare const __version__ = "0.58.2";
3662
+ declare const __version__ = "0.58.4";
3654
3663
 
3655
3664
  /**
3656
3665
  * Constants for the Bitfab SDK.
@@ -3789,4 +3798,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3789
3798
  run?: boolean;
3790
3799
  }): Promise<SeedResult>;
3791
3800
 
3792
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, 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 Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, 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 OrganizationMember, OrganizationMembersClient, type PotentialAssertionEvidence, 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, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, 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 TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
3801
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionLabelEvidence, type AssertionVerdict, type Assignee, BITFAB_PROGRESS_PREFIX, type BamlExecutionResult, Bitfab, BitfabClaudeAgentHandler, type BitfabConfig, BitfabError, BitfabFunction, BitfabLangGraphCallbackHandler as BitfabLangChainCallbackHandler, BitfabLangGraphCallbackHandler, BitfabLangGraphIntegration, type BitfabLanguageModelMiddleware, BitfabOpenAIAgentHandler, BitfabOpenAITracingProcessor, BitfabRivetIntegration, BitfabVercelAiHandler, type CaptureSurface, type CaptureWhen, type CapturedSpan, type CodeChangeFile, type CommitRef, 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 Justification, type JustificationSpan, type LabelAction, type LabelConfidence, type LabelOutcome, type LabelSource, type LabelStatus, type LabelTarget, 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 OrganizationMember, OrganizationMembersClient, 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, type ReseedOptions, type ReseedRegistryResult, type ReseedResult, type RivetContextLike, type RivetEffectType, type RivetIntegrationOptions, SUPPORTED_PROVIDERS, type SaveAssertion, type SaveAssertionCategoryParams, 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 TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, 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, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  getCurrentTrace,
32
32
  reseedFromRegistry,
33
33
  seedFromRegistry
34
- } from "./chunk-5JYY2MMV.js";
34
+ } from "./chunk-IVF7JQHF.js";
35
35
  import "./chunk-RCHSYWKI.js";
36
36
  import {
37
37
  BITFAB_PROGRESS_PREFIX,
@@ -40,7 +40,7 @@ import {
40
40
  ReplayError,
41
41
  reportReplayProgress,
42
42
  serializeReplayResult
43
- } from "./chunk-Q4UM7ILD.js";
43
+ } from "./chunk-NSD5YKCE.js";
44
44
  import {
45
45
  BitfabError,
46
46
  DEFAULT_SERVICE_URL,
@@ -48,7 +48,7 @@ import {
48
48
  MixedTracingError,
49
49
  __version__,
50
50
  flushTraces
51
- } from "./chunk-LZN66ADL.js";
51
+ } from "./chunk-KADON3SF.js";
52
52
  import "./chunk-VCRFFCLY.js";
53
53
  export {
54
54
  AssertionCategoriesClient,
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.58.2";
100
+ __version__ = "0.58.4";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -2894,7 +2894,7 @@ var init_http = __esm({
2894
2894
  * Start a replay session by fetching historical traces.
2895
2895
  * Blocking call - creates a test run and returns lightweight item references.
2896
2896
  */
2897
- async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions) {
2897
+ async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetIds, graderIds, dbBranchSettings, attempts, includeOriginalMetadata, onlyWithAssertions, judgeAssertions) {
2898
2898
  const payload = { traceFunctionKey };
2899
2899
  if (limit !== void 0) {
2900
2900
  payload.limit = limit;
@@ -2940,6 +2940,9 @@ var init_http = __esm({
2940
2940
  if (onlyWithAssertions) {
2941
2941
  payload.onlyWithAssertions = true;
2942
2942
  }
2943
+ if (judgeAssertions) {
2944
+ payload.judgeAssertions = true;
2945
+ }
2943
2946
  const git = await resolvedGitState();
2944
2947
  if (git && !isEmptyGitState(git)) {
2945
2948
  payload.git = git;
@@ -4097,7 +4100,8 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
4097
4100
  resolveDbBranchSettings(options?.dbBranch),
4098
4101
  attempts,
4099
4102
  options?.adaptInputs !== void 0,
4100
- options?.onlyWithAssertions
4103
+ options?.onlyWithAssertions,
4104
+ options?.judgeAssertions
4101
4105
  );
4102
4106
  if (serverItems.length === 0) {
4103
4107
  try {
@@ -9828,13 +9832,23 @@ var Bitfab = class {
9828
9832
  traceFunctionKey
9829
9833
  );
9830
9834
  const openAiAgentsSpanIds = openAiAgentsSpanChain();
9835
+ const functionNameAtOpen = fn.name !== "" ? fn.name : void 0;
9831
9836
  const newContext = {
9832
9837
  traceId,
9833
9838
  spanId,
9834
9839
  contexts: [],
9840
+ spanName: options.name ?? options.nameFor?.(this) ?? qualifiedSpanName(this, functionNameAtOpen) ?? traceFunctionKey,
9841
+ rootTraceFunctionKey: rootTraceFunctionKeyOfTrace(
9842
+ traceId,
9843
+ traceFunctionKey
9844
+ ),
9845
+ instrumentation: options.instrumentation ?? "span",
9846
+ declaredNode: options.declaredNode === true,
9847
+ isRoot: isRootSpan,
9835
9848
  ...surface !== void 0 && { surface },
9836
9849
  ...openAiAgentsSpanIds.length > 0 && { openAiAgentsSpanIds }
9837
9850
  };
9851
+ const nearestCapturedAncestorSpanId = self.nearestCapturedAncestorSpanIdOf(currentStack);
9838
9852
  newStack = [...currentStack, newContext];
9839
9853
  const inputs = args;
9840
9854
  const startedAt = nowIsoTimestamp();
@@ -9861,19 +9875,16 @@ var Bitfab = class {
9861
9875
  }
9862
9876
  self.httpClient.traceCompletion.start(traceId, spanId);
9863
9877
  startedSpan = { traceId, spanId };
9864
- const functionName = fn.name !== "" ? fn.name : void 0;
9865
- const rootTraceFunctionKey = rootTraceFunctionKeyOfTrace(
9866
- traceId,
9867
- traceFunctionKey
9868
- );
9878
+ const functionName = functionNameAtOpen;
9869
9879
  const baseSpanParams = {
9870
9880
  traceFunctionKey,
9871
- rootTraceFunctionKey,
9881
+ rootTraceFunctionKey: newContext.rootTraceFunctionKey,
9872
9882
  functionName,
9873
- spanName: options.name ?? options.nameFor?.(this) ?? qualifiedSpanName(this, functionName) ?? traceFunctionKey,
9883
+ spanName: newContext.spanName,
9874
9884
  traceId,
9875
9885
  spanId,
9876
9886
  parentSpanId,
9887
+ nearestCapturedAncestorSpanId,
9877
9888
  inputs,
9878
9889
  startedAt,
9879
9890
  spanType: options.type ?? "custom",
@@ -10392,6 +10403,21 @@ var Bitfab = class {
10392
10403
  ...params.testRunId && { testRunId: params.testRunId }
10393
10404
  });
10394
10405
  }
10406
+ sendsSpanOnCompletion(context) {
10407
+ return context.isRoot || context.declaredNode || isFrameworkInstrumentation(context.instrumentation) || !this.simulationPlan.contentOffNow(
10408
+ context.rootTraceFunctionKey,
10409
+ context.spanName
10410
+ );
10411
+ }
10412
+ nearestCapturedAncestorSpanIdOf(stack) {
10413
+ for (let index = stack.length - 1; index >= 0; index -= 1) {
10414
+ const candidate = stack[index];
10415
+ if (candidate !== void 0 && this.sendsSpanOnCompletion(candidate)) {
10416
+ return candidate.spanId;
10417
+ }
10418
+ }
10419
+ return null;
10420
+ }
10395
10421
  contentOffBySimulationPlan(params) {
10396
10422
  if (params.rootTraceFunctionKey === void 0 || isFrameworkInstrumentation(params.instrumentation)) {
10397
10423
  return false;
@@ -10468,6 +10494,9 @@ var Bitfab = class {
10468
10494
  if (params.parentSpanId) {
10469
10495
  externalSpan.parent_id = params.parentSpanId;
10470
10496
  }
10497
+ if (params.nearestCapturedAncestorSpanId !== void 0 && params.nearestCapturedAncestorSpanId !== null && params.nearestCapturedAncestorSpanId !== params.parentSpanId) {
10498
+ externalSpan.nearest_captured_ancestor_id = params.nearestCapturedAncestorSpanId;
10499
+ }
10471
10500
  if (params.inputSourceSpanId) {
10472
10501
  externalSpan.input_source_span_id = params.inputSourceSpanId;
10473
10502
  }