@bitfab/sdk 0.57.5 → 0.57.6

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 (31) hide show
  1. package/dist/{chunk-4R5G55MG.js → chunk-36PIGPJ7.js} +14 -21
  2. package/dist/chunk-36PIGPJ7.js.map +1 -0
  3. package/dist/{chunk-AMILC6CQ.js → chunk-3ZKAW5PB.js} +2 -2
  4. package/dist/{chunk-NK25R6UX.js → chunk-ATJLJEG4.js} +2 -2
  5. package/dist/{chunk-NK25R6UX.js.map → chunk-ATJLJEG4.js.map} +1 -1
  6. package/dist/{chunk-2ZPZUOD6.js → chunk-EQ37ZZX5.js} +2 -2
  7. package/dist/{chunk-2ZPZUOD6.js.map → chunk-EQ37ZZX5.js.map} +1 -1
  8. package/dist/{chunk-7KY75E3I.js → chunk-RGOXYCIT.js} +3 -3
  9. package/dist/{http-N62YN7QQ.js → http-3WXYZU2G.js} +2 -2
  10. package/dist/{http-MKYC373Q.js → http-GRRJAMJR.js} +2 -2
  11. package/dist/index.cjs +9 -17
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +121 -126
  14. package/dist/index.d.ts +121 -126
  15. package/dist/index.js +3 -5
  16. package/dist/node.cjs +9 -17
  17. package/dist/node.cjs.map +1 -1
  18. package/dist/node.d.cts +1 -1
  19. package/dist/node.d.ts +1 -1
  20. package/dist/node.js +3 -5
  21. package/dist/node.js.map +1 -1
  22. package/dist/{replay-4IVG6F7L.js → replay-LZ2BS3CD.js} +3 -3
  23. package/dist/replayCli.js +2 -2
  24. package/dist/seedCli.js +2 -2
  25. package/package.json +1 -1
  26. package/dist/chunk-4R5G55MG.js.map +0 -1
  27. /package/dist/{chunk-AMILC6CQ.js.map → chunk-3ZKAW5PB.js.map} +0 -0
  28. /package/dist/{chunk-7KY75E3I.js.map → chunk-RGOXYCIT.js.map} +0 -0
  29. /package/dist/{http-MKYC373Q.js.map → http-3WXYZU2G.js.map} +0 -0
  30. /package/dist/{http-N62YN7QQ.js.map → http-GRRJAMJR.js.map} +0 -0
  31. /package/dist/{replay-4IVG6F7L.js.map → replay-LZ2BS3CD.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1303,6 +1303,123 @@ declare class DatasetsClient {
1303
1303
  getGraderRerun(datasetId: string, runId?: string): Promise<GraderRerun | null>;
1304
1304
  }
1305
1305
 
1306
+ type TraceTargetOccurrence = "first" | "last" | number;
1307
+ type TraceTarget = {
1308
+ kind: "output";
1309
+ } | {
1310
+ kind: "span";
1311
+ name: string;
1312
+ occurrence?: TraceTargetOccurrence;
1313
+ };
1314
+ type TraceAssertionSource = "human" | "agent";
1315
+ type TraceSearchFilters = {
1316
+ callerMetadata?: Record<string, string>;
1317
+ name?: string;
1318
+ nameContains?: string;
1319
+ };
1320
+ type TraceSearchParams = TraceSearchFilters & ({
1321
+ callerMetadata: Record<string, string>;
1322
+ } | {
1323
+ name: string;
1324
+ } | {
1325
+ nameContains: string;
1326
+ }) & {
1327
+ traceFunctionKey?: string;
1328
+ cursor?: string | null;
1329
+ limit?: number;
1330
+ };
1331
+ type TraceSearchResult = {
1332
+ traces: Array<{
1333
+ id: string;
1334
+ traceFunctionKey: string | null;
1335
+ name: string | null;
1336
+ status: "pending" | "completed" | "failed" | "dropped";
1337
+ createdAt: string;
1338
+ callerMetadata: Record<string, string>;
1339
+ }>;
1340
+ nextCursor: string | null;
1341
+ hasMore: boolean;
1342
+ };
1343
+ type TraceAssertion = {
1344
+ id: string;
1345
+ traceId: string;
1346
+ assertion: string;
1347
+ humanNote: string | null;
1348
+ category_assertion_id: string | null;
1349
+ category: AssertionCategorySummary | null;
1350
+ passCriteria: string | null;
1351
+ failCriteria: string | null;
1352
+ targetOnEvaluatedTrace: TraceTarget | null;
1353
+ source: TraceAssertionSource;
1354
+ /** Why this assertion is right for its trace, span by span. */
1355
+ justification: Justification | null;
1356
+ /** Why its assigned category is the right one, span by span. */
1357
+ categoryJustification: Justification | null;
1358
+ createdAt: string;
1359
+ updatedAt: string;
1360
+ } & ApprovalFields;
1361
+ type AssertionEvidenceParameter = {
1362
+ name: string;
1363
+ type: "string" | "number" | "boolean" | "object" | "array" | "null" | "unknown";
1364
+ };
1365
+ type PotentialAssertionEvidence = {
1366
+ spanId: string;
1367
+ text: string;
1368
+ spanName: string | null;
1369
+ parameters: AssertionEvidenceParameter[];
1370
+ spanType: "llm" | "agent" | "function" | "guardrail" | "handoff" | "custom";
1371
+ isMocked: boolean;
1372
+ };
1373
+ type SaveAssertion = {
1374
+ /** Omit to preserve the category, or pass null to clear it. */
1375
+ category_assertion_id?: string | null;
1376
+ id?: string;
1377
+ assertion: string;
1378
+ passCriteria?: string | null;
1379
+ failCriteria?: string | null;
1380
+ targetOnEvaluatedTrace?: TraceTarget | null;
1381
+ /**
1382
+ * Why this assertion is right for this trace, one entry per span it rests on.
1383
+ * Cite spans on this trace only. Omit on an edit to preserve it.
1384
+ */
1385
+ justification?: Justification | null;
1386
+ /**
1387
+ * Why `category_assertion_id` is the right category. Changing the category
1388
+ * clears it. Omit on an edit to preserve it.
1389
+ */
1390
+ categoryJustification?: Justification | null;
1391
+ };
1392
+ type TraceAssertionsResult = {
1393
+ assertions: TraceAssertion[];
1394
+ inheritedFrom: string | null;
1395
+ };
1396
+ type TraceAssertionsUpdate = {
1397
+ traceId: string;
1398
+ assertions: SaveAssertion[];
1399
+ };
1400
+ type SaveAssertionsParams = {
1401
+ traceId: string;
1402
+ assertions: SaveAssertion[];
1403
+ source?: TraceAssertionSource;
1404
+ };
1405
+ type SaveAssertionsAllParams = {
1406
+ updates: TraceAssertionsUpdate[];
1407
+ source?: TraceAssertionSource;
1408
+ };
1409
+ type ArchiveAssertionsParams = {
1410
+ traceId: string;
1411
+ assertionIds: string[];
1412
+ };
1413
+ declare class TracesClient {
1414
+ private readonly httpClient;
1415
+ constructor(httpClient: HttpClient);
1416
+ search(params: TraceSearchParams): Promise<TraceSearchResult>;
1417
+ getAssertions(traceId: string): Promise<TraceAssertionsResult>;
1418
+ saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
1419
+ saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
1420
+ archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
1421
+ }
1422
+
1306
1423
  type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
1307
1424
  type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
1308
1425
  type LabelStatus = "labeled" | "skipped" | "unlabeled";
@@ -1383,6 +1500,8 @@ declare class LabelsClient {
1383
1500
  saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
1384
1501
  get(traceId: string): Promise<TraceLabels | null>;
1385
1502
  getAll(traceIds: string[]): Promise<TraceLabels[]>;
1503
+ /** Generate suggested evidence for an assertion on an original or replay trace. */
1504
+ generateLabelEvidence(traceId: string, assertionId: string): Promise<PotentialAssertionEvidence[]>;
1386
1505
  }
1387
1506
 
1388
1507
  type GraderLabelSource = "human" | "live_grader";
@@ -2294,130 +2413,6 @@ declare class BitfabRivetIntegration<TContext extends object = RivetContextLike>
2294
2413
  private createQueueIterator;
2295
2414
  }
2296
2415
 
2297
- type TraceTargetOccurrence = "first" | "last" | number;
2298
- type TraceTarget = {
2299
- kind: "output";
2300
- } | {
2301
- kind: "span";
2302
- name: string;
2303
- occurrence?: TraceTargetOccurrence;
2304
- };
2305
- type TraceAssertionSource = "human" | "agent";
2306
- type TraceSearchFilters = {
2307
- callerMetadata?: Record<string, string>;
2308
- name?: string;
2309
- nameContains?: string;
2310
- };
2311
- type TraceSearchParams = TraceSearchFilters & ({
2312
- callerMetadata: Record<string, string>;
2313
- } | {
2314
- name: string;
2315
- } | {
2316
- nameContains: string;
2317
- }) & {
2318
- traceFunctionKey?: string;
2319
- cursor?: string | null;
2320
- limit?: number;
2321
- };
2322
- type TraceSearchResult = {
2323
- traces: Array<{
2324
- id: string;
2325
- traceFunctionKey: string | null;
2326
- name: string | null;
2327
- status: "pending" | "completed" | "failed" | "dropped";
2328
- createdAt: string;
2329
- callerMetadata: Record<string, string>;
2330
- }>;
2331
- nextCursor: string | null;
2332
- hasMore: boolean;
2333
- };
2334
- type TraceAssertion = {
2335
- id: string;
2336
- traceId: string;
2337
- assertion: string;
2338
- humanNote: string | null;
2339
- category_assertion_id: string | null;
2340
- category: AssertionCategorySummary | null;
2341
- passCriteria: string | null;
2342
- failCriteria: string | null;
2343
- targetOnEvaluatedTrace: TraceTarget | null;
2344
- source: TraceAssertionSource;
2345
- /** Why this assertion is right for its trace, span by span. */
2346
- justification: Justification | null;
2347
- /** Why its assigned category is the right one, span by span. */
2348
- categoryJustification: Justification | null;
2349
- createdAt: string;
2350
- updatedAt: string;
2351
- } & ApprovalFields;
2352
- type AssertionEvidenceParameter = {
2353
- name: string;
2354
- type: "string" | "number" | "boolean" | "object" | "array" | "null" | "unknown";
2355
- };
2356
- type PotentialAssertionEvidence = {
2357
- spanId: string;
2358
- text: string;
2359
- spanName: string | null;
2360
- parameters: AssertionEvidenceParameter[];
2361
- spanType: "llm" | "agent" | "function" | "guardrail" | "handoff" | "custom";
2362
- isMocked: boolean;
2363
- };
2364
- type SaveAssertion = {
2365
- /** Omit to preserve the category, or pass null to clear it. */
2366
- category_assertion_id?: string | null;
2367
- id?: string;
2368
- assertion: string;
2369
- passCriteria?: string | null;
2370
- failCriteria?: string | null;
2371
- targetOnEvaluatedTrace?: TraceTarget | null;
2372
- /**
2373
- * Why this assertion is right for this trace, one entry per span it rests on.
2374
- * Cite spans on this trace only. Omit on an edit to preserve it.
2375
- */
2376
- justification?: Justification | null;
2377
- /**
2378
- * Why `category_assertion_id` is the right category. Changing the category
2379
- * clears it. Omit on an edit to preserve it.
2380
- */
2381
- categoryJustification?: Justification | null;
2382
- };
2383
- type TraceAssertionsResult = {
2384
- assertions: TraceAssertion[];
2385
- inheritedFrom: string | null;
2386
- };
2387
- type TraceAssertionsUpdate = {
2388
- traceId: string;
2389
- assertions: SaveAssertion[];
2390
- };
2391
- type SaveAssertionsParams = {
2392
- traceId: string;
2393
- assertions: SaveAssertion[];
2394
- source?: TraceAssertionSource;
2395
- };
2396
- type SaveAssertionsAllParams = {
2397
- updates: TraceAssertionsUpdate[];
2398
- source?: TraceAssertionSource;
2399
- };
2400
- type ArchiveAssertionsParams = {
2401
- traceId: string;
2402
- assertionIds: string[];
2403
- };
2404
- declare class TraceAssertionsClient {
2405
- private readonly httpClient;
2406
- constructor(httpClient: HttpClient);
2407
- /** Suggest evidence for an assertion, enriched with its span context. */
2408
- getAssertionEvidence(assertionId: string): Promise<PotentialAssertionEvidence[]>;
2409
- }
2410
- declare class TracesClient {
2411
- private readonly httpClient;
2412
- readonly assertions: TraceAssertionsClient;
2413
- constructor(httpClient: HttpClient);
2414
- search(params: TraceSearchParams): Promise<TraceSearchResult>;
2415
- getAssertions(traceId: string): Promise<TraceAssertionsResult>;
2416
- saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
2417
- saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
2418
- archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
2419
- }
2420
-
2421
2416
  /**
2422
2417
  * Tracing utilities for external trace submission to Bitfab.
2423
2418
  *
@@ -3627,7 +3622,7 @@ interface CommitRef {
3627
3622
  /**
3628
3623
  * SDK version from package.json (injected at build time)
3629
3624
  */
3630
- declare const __version__ = "0.57.5";
3625
+ declare const __version__ = "0.57.6";
3631
3626
 
3632
3627
  /**
3633
3628
  * Constants for the Bitfab SDK.
@@ -3766,4 +3761,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3766
3761
  run?: boolean;
3767
3762
  }): Promise<SeedResult>;
3768
3763
 
3769
- 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, 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 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, TraceAssertionsClient, 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 };
3764
+ 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, 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 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 };
package/dist/index.d.ts CHANGED
@@ -1303,6 +1303,123 @@ declare class DatasetsClient {
1303
1303
  getGraderRerun(datasetId: string, runId?: string): Promise<GraderRerun | null>;
1304
1304
  }
1305
1305
 
1306
+ type TraceTargetOccurrence = "first" | "last" | number;
1307
+ type TraceTarget = {
1308
+ kind: "output";
1309
+ } | {
1310
+ kind: "span";
1311
+ name: string;
1312
+ occurrence?: TraceTargetOccurrence;
1313
+ };
1314
+ type TraceAssertionSource = "human" | "agent";
1315
+ type TraceSearchFilters = {
1316
+ callerMetadata?: Record<string, string>;
1317
+ name?: string;
1318
+ nameContains?: string;
1319
+ };
1320
+ type TraceSearchParams = TraceSearchFilters & ({
1321
+ callerMetadata: Record<string, string>;
1322
+ } | {
1323
+ name: string;
1324
+ } | {
1325
+ nameContains: string;
1326
+ }) & {
1327
+ traceFunctionKey?: string;
1328
+ cursor?: string | null;
1329
+ limit?: number;
1330
+ };
1331
+ type TraceSearchResult = {
1332
+ traces: Array<{
1333
+ id: string;
1334
+ traceFunctionKey: string | null;
1335
+ name: string | null;
1336
+ status: "pending" | "completed" | "failed" | "dropped";
1337
+ createdAt: string;
1338
+ callerMetadata: Record<string, string>;
1339
+ }>;
1340
+ nextCursor: string | null;
1341
+ hasMore: boolean;
1342
+ };
1343
+ type TraceAssertion = {
1344
+ id: string;
1345
+ traceId: string;
1346
+ assertion: string;
1347
+ humanNote: string | null;
1348
+ category_assertion_id: string | null;
1349
+ category: AssertionCategorySummary | null;
1350
+ passCriteria: string | null;
1351
+ failCriteria: string | null;
1352
+ targetOnEvaluatedTrace: TraceTarget | null;
1353
+ source: TraceAssertionSource;
1354
+ /** Why this assertion is right for its trace, span by span. */
1355
+ justification: Justification | null;
1356
+ /** Why its assigned category is the right one, span by span. */
1357
+ categoryJustification: Justification | null;
1358
+ createdAt: string;
1359
+ updatedAt: string;
1360
+ } & ApprovalFields;
1361
+ type AssertionEvidenceParameter = {
1362
+ name: string;
1363
+ type: "string" | "number" | "boolean" | "object" | "array" | "null" | "unknown";
1364
+ };
1365
+ type PotentialAssertionEvidence = {
1366
+ spanId: string;
1367
+ text: string;
1368
+ spanName: string | null;
1369
+ parameters: AssertionEvidenceParameter[];
1370
+ spanType: "llm" | "agent" | "function" | "guardrail" | "handoff" | "custom";
1371
+ isMocked: boolean;
1372
+ };
1373
+ type SaveAssertion = {
1374
+ /** Omit to preserve the category, or pass null to clear it. */
1375
+ category_assertion_id?: string | null;
1376
+ id?: string;
1377
+ assertion: string;
1378
+ passCriteria?: string | null;
1379
+ failCriteria?: string | null;
1380
+ targetOnEvaluatedTrace?: TraceTarget | null;
1381
+ /**
1382
+ * Why this assertion is right for this trace, one entry per span it rests on.
1383
+ * Cite spans on this trace only. Omit on an edit to preserve it.
1384
+ */
1385
+ justification?: Justification | null;
1386
+ /**
1387
+ * Why `category_assertion_id` is the right category. Changing the category
1388
+ * clears it. Omit on an edit to preserve it.
1389
+ */
1390
+ categoryJustification?: Justification | null;
1391
+ };
1392
+ type TraceAssertionsResult = {
1393
+ assertions: TraceAssertion[];
1394
+ inheritedFrom: string | null;
1395
+ };
1396
+ type TraceAssertionsUpdate = {
1397
+ traceId: string;
1398
+ assertions: SaveAssertion[];
1399
+ };
1400
+ type SaveAssertionsParams = {
1401
+ traceId: string;
1402
+ assertions: SaveAssertion[];
1403
+ source?: TraceAssertionSource;
1404
+ };
1405
+ type SaveAssertionsAllParams = {
1406
+ updates: TraceAssertionsUpdate[];
1407
+ source?: TraceAssertionSource;
1408
+ };
1409
+ type ArchiveAssertionsParams = {
1410
+ traceId: string;
1411
+ assertionIds: string[];
1412
+ };
1413
+ declare class TracesClient {
1414
+ private readonly httpClient;
1415
+ constructor(httpClient: HttpClient);
1416
+ search(params: TraceSearchParams): Promise<TraceSearchResult>;
1417
+ getAssertions(traceId: string): Promise<TraceAssertionsResult>;
1418
+ saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
1419
+ saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
1420
+ archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
1421
+ }
1422
+
1306
1423
  type LabelConfidence = "VeryLow" | "Low" | "Medium" | "High" | "VeryHigh";
1307
1424
  type LabelAction = "set" | "archived" | "no-active-label" | "skipped";
1308
1425
  type LabelStatus = "labeled" | "skipped" | "unlabeled";
@@ -1383,6 +1500,8 @@ declare class LabelsClient {
1383
1500
  saveHumanAll(updates: HumanLabelUpdate[]): Promise<HumanLabelOutcome[]>;
1384
1501
  get(traceId: string): Promise<TraceLabels | null>;
1385
1502
  getAll(traceIds: string[]): Promise<TraceLabels[]>;
1503
+ /** Generate suggested evidence for an assertion on an original or replay trace. */
1504
+ generateLabelEvidence(traceId: string, assertionId: string): Promise<PotentialAssertionEvidence[]>;
1386
1505
  }
1387
1506
 
1388
1507
  type GraderLabelSource = "human" | "live_grader";
@@ -2294,130 +2413,6 @@ declare class BitfabRivetIntegration<TContext extends object = RivetContextLike>
2294
2413
  private createQueueIterator;
2295
2414
  }
2296
2415
 
2297
- type TraceTargetOccurrence = "first" | "last" | number;
2298
- type TraceTarget = {
2299
- kind: "output";
2300
- } | {
2301
- kind: "span";
2302
- name: string;
2303
- occurrence?: TraceTargetOccurrence;
2304
- };
2305
- type TraceAssertionSource = "human" | "agent";
2306
- type TraceSearchFilters = {
2307
- callerMetadata?: Record<string, string>;
2308
- name?: string;
2309
- nameContains?: string;
2310
- };
2311
- type TraceSearchParams = TraceSearchFilters & ({
2312
- callerMetadata: Record<string, string>;
2313
- } | {
2314
- name: string;
2315
- } | {
2316
- nameContains: string;
2317
- }) & {
2318
- traceFunctionKey?: string;
2319
- cursor?: string | null;
2320
- limit?: number;
2321
- };
2322
- type TraceSearchResult = {
2323
- traces: Array<{
2324
- id: string;
2325
- traceFunctionKey: string | null;
2326
- name: string | null;
2327
- status: "pending" | "completed" | "failed" | "dropped";
2328
- createdAt: string;
2329
- callerMetadata: Record<string, string>;
2330
- }>;
2331
- nextCursor: string | null;
2332
- hasMore: boolean;
2333
- };
2334
- type TraceAssertion = {
2335
- id: string;
2336
- traceId: string;
2337
- assertion: string;
2338
- humanNote: string | null;
2339
- category_assertion_id: string | null;
2340
- category: AssertionCategorySummary | null;
2341
- passCriteria: string | null;
2342
- failCriteria: string | null;
2343
- targetOnEvaluatedTrace: TraceTarget | null;
2344
- source: TraceAssertionSource;
2345
- /** Why this assertion is right for its trace, span by span. */
2346
- justification: Justification | null;
2347
- /** Why its assigned category is the right one, span by span. */
2348
- categoryJustification: Justification | null;
2349
- createdAt: string;
2350
- updatedAt: string;
2351
- } & ApprovalFields;
2352
- type AssertionEvidenceParameter = {
2353
- name: string;
2354
- type: "string" | "number" | "boolean" | "object" | "array" | "null" | "unknown";
2355
- };
2356
- type PotentialAssertionEvidence = {
2357
- spanId: string;
2358
- text: string;
2359
- spanName: string | null;
2360
- parameters: AssertionEvidenceParameter[];
2361
- spanType: "llm" | "agent" | "function" | "guardrail" | "handoff" | "custom";
2362
- isMocked: boolean;
2363
- };
2364
- type SaveAssertion = {
2365
- /** Omit to preserve the category, or pass null to clear it. */
2366
- category_assertion_id?: string | null;
2367
- id?: string;
2368
- assertion: string;
2369
- passCriteria?: string | null;
2370
- failCriteria?: string | null;
2371
- targetOnEvaluatedTrace?: TraceTarget | null;
2372
- /**
2373
- * Why this assertion is right for this trace, one entry per span it rests on.
2374
- * Cite spans on this trace only. Omit on an edit to preserve it.
2375
- */
2376
- justification?: Justification | null;
2377
- /**
2378
- * Why `category_assertion_id` is the right category. Changing the category
2379
- * clears it. Omit on an edit to preserve it.
2380
- */
2381
- categoryJustification?: Justification | null;
2382
- };
2383
- type TraceAssertionsResult = {
2384
- assertions: TraceAssertion[];
2385
- inheritedFrom: string | null;
2386
- };
2387
- type TraceAssertionsUpdate = {
2388
- traceId: string;
2389
- assertions: SaveAssertion[];
2390
- };
2391
- type SaveAssertionsParams = {
2392
- traceId: string;
2393
- assertions: SaveAssertion[];
2394
- source?: TraceAssertionSource;
2395
- };
2396
- type SaveAssertionsAllParams = {
2397
- updates: TraceAssertionsUpdate[];
2398
- source?: TraceAssertionSource;
2399
- };
2400
- type ArchiveAssertionsParams = {
2401
- traceId: string;
2402
- assertionIds: string[];
2403
- };
2404
- declare class TraceAssertionsClient {
2405
- private readonly httpClient;
2406
- constructor(httpClient: HttpClient);
2407
- /** Suggest evidence for an assertion, enriched with its span context. */
2408
- getAssertionEvidence(assertionId: string): Promise<PotentialAssertionEvidence[]>;
2409
- }
2410
- declare class TracesClient {
2411
- private readonly httpClient;
2412
- readonly assertions: TraceAssertionsClient;
2413
- constructor(httpClient: HttpClient);
2414
- search(params: TraceSearchParams): Promise<TraceSearchResult>;
2415
- getAssertions(traceId: string): Promise<TraceAssertionsResult>;
2416
- saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
2417
- saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
2418
- archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
2419
- }
2420
-
2421
2416
  /**
2422
2417
  * Tracing utilities for external trace submission to Bitfab.
2423
2418
  *
@@ -3627,7 +3622,7 @@ interface CommitRef {
3627
3622
  /**
3628
3623
  * SDK version from package.json (injected at build time)
3629
3624
  */
3630
- declare const __version__ = "0.57.5";
3625
+ declare const __version__ = "0.57.6";
3631
3626
 
3632
3627
  /**
3633
3628
  * Constants for the Bitfab SDK.
@@ -3766,4 +3761,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3766
3761
  run?: boolean;
3767
3762
  }): Promise<SeedResult>;
3768
3763
 
3769
- 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, 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 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, TraceAssertionsClient, 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 };
3764
+ 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, 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 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 };
package/dist/index.js CHANGED
@@ -13,7 +13,6 @@ import {
13
13
  GradersClient,
14
14
  LabelsClient,
15
15
  SUPPORTED_PROVIDERS,
16
- TraceAssertionsClient,
17
16
  TracesClient,
18
17
  defineReplayRegistry,
19
18
  finalizers,
@@ -22,7 +21,7 @@ import {
22
21
  getCurrentTrace,
23
22
  reseedFromRegistry,
24
23
  seedFromRegistry
25
- } from "./chunk-4R5G55MG.js";
24
+ } from "./chunk-36PIGPJ7.js";
26
25
  import "./chunk-RCHSYWKI.js";
27
26
  import {
28
27
  BITFAB_PROGRESS_PREFIX,
@@ -31,7 +30,7 @@ import {
31
30
  ReplayError,
32
31
  reportReplayProgress,
33
32
  serializeReplayResult
34
- } from "./chunk-AMILC6CQ.js";
33
+ } from "./chunk-3ZKAW5PB.js";
35
34
  import {
36
35
  BitfabError,
37
36
  DEFAULT_SERVICE_URL,
@@ -39,7 +38,7 @@ import {
39
38
  MixedTracingError,
40
39
  __version__,
41
40
  flushTraces
42
- } from "./chunk-NK25R6UX.js";
41
+ } from "./chunk-ATJLJEG4.js";
43
42
  import "./chunk-VCRFFCLY.js";
44
43
  export {
45
44
  AssertionCategoriesClient,
@@ -65,7 +64,6 @@ export {
65
64
  NO_MOCK_OVERRIDE,
66
65
  ReplayError,
67
66
  SUPPORTED_PROVIDERS,
68
- TraceAssertionsClient,
69
67
  TracesClient,
70
68
  __version__,
71
69
  defineReplayRegistry,
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.57.5";
91
+ __version__ = "0.57.6";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -4389,7 +4389,6 @@ __export(node_exports, {
4389
4389
  NO_MOCK_OVERRIDE: () => NO_MOCK_OVERRIDE,
4390
4390
  ReplayError: () => ReplayError,
4391
4391
  SUPPORTED_PROVIDERS: () => SUPPORTED_PROVIDERS,
4392
- TraceAssertionsClient: () => TraceAssertionsClient,
4393
4392
  TracesClient: () => TracesClient,
4394
4393
  __version__: () => __version__,
4395
4394
  defineReplayRegistry: () => defineReplayRegistry,
@@ -5993,6 +5992,9 @@ init_http();
5993
5992
  // src/labels.ts
5994
5993
  var LABELS_PATH = "/api/sdk/traces/labels";
5995
5994
  var HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
5995
+ function labelEvidencePath(traceId, assertionId) {
5996
+ return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions/${encodeURIComponent(assertionId)}/evidence`;
5997
+ }
5996
5998
  var LabelsClient = class {
5997
5999
  constructor(httpClient) {
5998
6000
  this.httpClient = httpClient;
@@ -6041,6 +6043,11 @@ var LabelsClient = class {
6041
6043
  );
6042
6044
  return response.labels;
6043
6045
  }
6046
+ /** Generate suggested evidence for an assertion on an original or replay trace. */
6047
+ async generateLabelEvidence(traceId, assertionId) {
6048
+ const response = await this.httpClient.get(labelEvidencePath(traceId, assertionId));
6049
+ return response.evidence;
6050
+ }
6044
6051
  };
6045
6052
 
6046
6053
  // src/langgraph.ts
@@ -7755,23 +7762,9 @@ var SEARCH_PATH = "/api/sdk/traces/search";
7755
7762
  function traceAssertionsPath(traceId, suffix = "") {
7756
7763
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
7757
7764
  }
7758
- function assertionEvidencePath(assertionId) {
7759
- return `/api/sdk/traces/assertions/${encodeURIComponent(assertionId)}/evidence`;
7760
- }
7761
- var TraceAssertionsClient = class {
7762
- constructor(httpClient) {
7763
- this.httpClient = httpClient;
7764
- }
7765
- /** Suggest evidence for an assertion, enriched with its span context. */
7766
- async getAssertionEvidence(assertionId) {
7767
- const response = await this.httpClient.get(assertionEvidencePath(assertionId));
7768
- return response.evidence;
7769
- }
7770
- };
7771
7765
  var TracesClient = class {
7772
7766
  constructor(httpClient) {
7773
7767
  this.httpClient = httpClient;
7774
- this.assertions = new TraceAssertionsClient(httpClient);
7775
7768
  }
7776
7769
  async search(params) {
7777
7770
  return this.httpClient.request(SEARCH_PATH, params);
@@ -11029,7 +11022,6 @@ assertAsyncStorageRegistered();
11029
11022
  NO_MOCK_OVERRIDE,
11030
11023
  ReplayError,
11031
11024
  SUPPORTED_PROVIDERS,
11032
- TraceAssertionsClient,
11033
11025
  TracesClient,
11034
11026
  __version__,
11035
11027
  defineReplayRegistry,