bitfab 0.57.4 → 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.
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,8 +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[]>;
1386
- /** Suggest evidence for a whole-trace or assertion label. Currently returns an empty list. */
1387
- getLabelEvidence(traceId: string, assertionId?: string): Promise<Justification>;
1503
+ /** Generate suggested evidence for an assertion on an original or replay trace. */
1504
+ generateLabelEvidence(traceId: string, assertionId: string): Promise<PotentialAssertionEvidence[]>;
1388
1505
  }
1389
1506
 
1390
1507
  type GraderLabelSource = "human" | "live_grader";
@@ -2296,111 +2413,6 @@ declare class BitfabRivetIntegration<TContext extends object = RivetContextLike>
2296
2413
  private createQueueIterator;
2297
2414
  }
2298
2415
 
2299
- type TraceTargetOccurrence = "first" | "last" | number;
2300
- type TraceTarget = {
2301
- kind: "output";
2302
- } | {
2303
- kind: "span";
2304
- name: string;
2305
- occurrence?: TraceTargetOccurrence;
2306
- };
2307
- type TraceAssertionSource = "human" | "agent";
2308
- type TraceSearchFilters = {
2309
- callerMetadata?: Record<string, string>;
2310
- name?: string;
2311
- nameContains?: string;
2312
- };
2313
- type TraceSearchParams = TraceSearchFilters & ({
2314
- callerMetadata: Record<string, string>;
2315
- } | {
2316
- name: string;
2317
- } | {
2318
- nameContains: string;
2319
- }) & {
2320
- traceFunctionKey?: string;
2321
- cursor?: string | null;
2322
- limit?: number;
2323
- };
2324
- type TraceSearchResult = {
2325
- traces: Array<{
2326
- id: string;
2327
- traceFunctionKey: string | null;
2328
- name: string | null;
2329
- status: "pending" | "completed" | "failed" | "dropped";
2330
- createdAt: string;
2331
- callerMetadata: Record<string, string>;
2332
- }>;
2333
- nextCursor: string | null;
2334
- hasMore: boolean;
2335
- };
2336
- type TraceAssertion = {
2337
- id: string;
2338
- traceId: string;
2339
- assertion: string;
2340
- humanNote: string | null;
2341
- category_assertion_id: string | null;
2342
- category: AssertionCategorySummary | null;
2343
- passCriteria: string | null;
2344
- failCriteria: string | null;
2345
- targetOnEvaluatedTrace: TraceTarget | null;
2346
- source: TraceAssertionSource;
2347
- /** Why this assertion is right for its trace, span by span. */
2348
- justification: Justification | null;
2349
- /** Why its assigned category is the right one, span by span. */
2350
- categoryJustification: Justification | null;
2351
- createdAt: string;
2352
- updatedAt: string;
2353
- } & ApprovalFields;
2354
- type SaveAssertion = {
2355
- /** Omit to preserve the category, or pass null to clear it. */
2356
- category_assertion_id?: string | null;
2357
- id?: string;
2358
- assertion: string;
2359
- passCriteria?: string | null;
2360
- failCriteria?: string | null;
2361
- targetOnEvaluatedTrace?: TraceTarget | null;
2362
- /**
2363
- * Why this assertion is right for this trace, one entry per span it rests on.
2364
- * Cite spans on this trace only. Omit on an edit to preserve it.
2365
- */
2366
- justification?: Justification | null;
2367
- /**
2368
- * Why `category_assertion_id` is the right category. Changing the category
2369
- * clears it. Omit on an edit to preserve it.
2370
- */
2371
- categoryJustification?: Justification | null;
2372
- };
2373
- type TraceAssertionsResult = {
2374
- assertions: TraceAssertion[];
2375
- inheritedFrom: string | null;
2376
- };
2377
- type TraceAssertionsUpdate = {
2378
- traceId: string;
2379
- assertions: SaveAssertion[];
2380
- };
2381
- type SaveAssertionsParams = {
2382
- traceId: string;
2383
- assertions: SaveAssertion[];
2384
- source?: TraceAssertionSource;
2385
- };
2386
- type SaveAssertionsAllParams = {
2387
- updates: TraceAssertionsUpdate[];
2388
- source?: TraceAssertionSource;
2389
- };
2390
- type ArchiveAssertionsParams = {
2391
- traceId: string;
2392
- assertionIds: string[];
2393
- };
2394
- declare class TracesClient {
2395
- private readonly httpClient;
2396
- constructor(httpClient: HttpClient);
2397
- search(params: TraceSearchParams): Promise<TraceSearchResult>;
2398
- getAssertions(traceId: string): Promise<TraceAssertionsResult>;
2399
- saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
2400
- saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
2401
- archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
2402
- }
2403
-
2404
2416
  /**
2405
2417
  * Tracing utilities for external trace submission to Bitfab.
2406
2418
  *
@@ -3610,7 +3622,7 @@ interface CommitRef {
3610
3622
  /**
3611
3623
  * SDK version from package.json (injected at build time)
3612
3624
  */
3613
- declare const __version__ = "0.57.4";
3625
+ declare const __version__ = "0.57.6";
3614
3626
 
3615
3627
  /**
3616
3628
  * Constants for the Bitfab SDK.
@@ -3749,4 +3761,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3749
3761
  run?: boolean;
3750
3762
  }): Promise<SeedResult>;
3751
3763
 
3752
- 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 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 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 };
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,8 +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[]>;
1386
- /** Suggest evidence for a whole-trace or assertion label. Currently returns an empty list. */
1387
- getLabelEvidence(traceId: string, assertionId?: string): Promise<Justification>;
1503
+ /** Generate suggested evidence for an assertion on an original or replay trace. */
1504
+ generateLabelEvidence(traceId: string, assertionId: string): Promise<PotentialAssertionEvidence[]>;
1388
1505
  }
1389
1506
 
1390
1507
  type GraderLabelSource = "human" | "live_grader";
@@ -2296,111 +2413,6 @@ declare class BitfabRivetIntegration<TContext extends object = RivetContextLike>
2296
2413
  private createQueueIterator;
2297
2414
  }
2298
2415
 
2299
- type TraceTargetOccurrence = "first" | "last" | number;
2300
- type TraceTarget = {
2301
- kind: "output";
2302
- } | {
2303
- kind: "span";
2304
- name: string;
2305
- occurrence?: TraceTargetOccurrence;
2306
- };
2307
- type TraceAssertionSource = "human" | "agent";
2308
- type TraceSearchFilters = {
2309
- callerMetadata?: Record<string, string>;
2310
- name?: string;
2311
- nameContains?: string;
2312
- };
2313
- type TraceSearchParams = TraceSearchFilters & ({
2314
- callerMetadata: Record<string, string>;
2315
- } | {
2316
- name: string;
2317
- } | {
2318
- nameContains: string;
2319
- }) & {
2320
- traceFunctionKey?: string;
2321
- cursor?: string | null;
2322
- limit?: number;
2323
- };
2324
- type TraceSearchResult = {
2325
- traces: Array<{
2326
- id: string;
2327
- traceFunctionKey: string | null;
2328
- name: string | null;
2329
- status: "pending" | "completed" | "failed" | "dropped";
2330
- createdAt: string;
2331
- callerMetadata: Record<string, string>;
2332
- }>;
2333
- nextCursor: string | null;
2334
- hasMore: boolean;
2335
- };
2336
- type TraceAssertion = {
2337
- id: string;
2338
- traceId: string;
2339
- assertion: string;
2340
- humanNote: string | null;
2341
- category_assertion_id: string | null;
2342
- category: AssertionCategorySummary | null;
2343
- passCriteria: string | null;
2344
- failCriteria: string | null;
2345
- targetOnEvaluatedTrace: TraceTarget | null;
2346
- source: TraceAssertionSource;
2347
- /** Why this assertion is right for its trace, span by span. */
2348
- justification: Justification | null;
2349
- /** Why its assigned category is the right one, span by span. */
2350
- categoryJustification: Justification | null;
2351
- createdAt: string;
2352
- updatedAt: string;
2353
- } & ApprovalFields;
2354
- type SaveAssertion = {
2355
- /** Omit to preserve the category, or pass null to clear it. */
2356
- category_assertion_id?: string | null;
2357
- id?: string;
2358
- assertion: string;
2359
- passCriteria?: string | null;
2360
- failCriteria?: string | null;
2361
- targetOnEvaluatedTrace?: TraceTarget | null;
2362
- /**
2363
- * Why this assertion is right for this trace, one entry per span it rests on.
2364
- * Cite spans on this trace only. Omit on an edit to preserve it.
2365
- */
2366
- justification?: Justification | null;
2367
- /**
2368
- * Why `category_assertion_id` is the right category. Changing the category
2369
- * clears it. Omit on an edit to preserve it.
2370
- */
2371
- categoryJustification?: Justification | null;
2372
- };
2373
- type TraceAssertionsResult = {
2374
- assertions: TraceAssertion[];
2375
- inheritedFrom: string | null;
2376
- };
2377
- type TraceAssertionsUpdate = {
2378
- traceId: string;
2379
- assertions: SaveAssertion[];
2380
- };
2381
- type SaveAssertionsParams = {
2382
- traceId: string;
2383
- assertions: SaveAssertion[];
2384
- source?: TraceAssertionSource;
2385
- };
2386
- type SaveAssertionsAllParams = {
2387
- updates: TraceAssertionsUpdate[];
2388
- source?: TraceAssertionSource;
2389
- };
2390
- type ArchiveAssertionsParams = {
2391
- traceId: string;
2392
- assertionIds: string[];
2393
- };
2394
- declare class TracesClient {
2395
- private readonly httpClient;
2396
- constructor(httpClient: HttpClient);
2397
- search(params: TraceSearchParams): Promise<TraceSearchResult>;
2398
- getAssertions(traceId: string): Promise<TraceAssertionsResult>;
2399
- saveAssertions(params: SaveAssertionsParams): Promise<TraceAssertion[]>;
2400
- saveAssertionsAll(params: SaveAssertionsAllParams): Promise<TraceAssertion[]>;
2401
- archiveAssertions(params: ArchiveAssertionsParams): Promise<string[]>;
2402
- }
2403
-
2404
2416
  /**
2405
2417
  * Tracing utilities for external trace submission to Bitfab.
2406
2418
  *
@@ -3610,7 +3622,7 @@ interface CommitRef {
3610
3622
  /**
3611
3623
  * SDK version from package.json (injected at build time)
3612
3624
  */
3613
- declare const __version__ = "0.57.4";
3625
+ declare const __version__ = "0.57.6";
3614
3626
 
3615
3627
  /**
3616
3628
  * Constants for the Bitfab SDK.
@@ -3749,4 +3761,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
3749
3761
  run?: boolean;
3750
3762
  }): Promise<SeedResult>;
3751
3763
 
3752
- 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 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 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 };
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
@@ -30,7 +30,7 @@ import {
30
30
  getCurrentTrace,
31
31
  reseedFromRegistry,
32
32
  seedFromRegistry
33
- } from "./chunk-JRGN2HRU.js";
33
+ } from "./chunk-ICL6RSND.js";
34
34
  import "./chunk-RCHSYWKI.js";
35
35
  import {
36
36
  BITFAB_PROGRESS_PREFIX,
@@ -39,7 +39,7 @@ import {
39
39
  ReplayError,
40
40
  reportReplayProgress,
41
41
  serializeReplayResult
42
- } from "./chunk-FWTA2X72.js";
42
+ } from "./chunk-GT4IDECP.js";
43
43
  import {
44
44
  BitfabError,
45
45
  DEFAULT_SERVICE_URL,
@@ -47,7 +47,7 @@ import {
47
47
  MixedTracingError,
48
48
  __version__,
49
49
  flushTraces
50
- } from "./chunk-DAXBPYIY.js";
50
+ } from "./chunk-UTBA3ASY.js";
51
51
  import "./chunk-VCRFFCLY.js";
52
52
  export {
53
53
  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.57.4";
100
+ __version__ = "0.57.6";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -6001,7 +6001,9 @@ init_http();
6001
6001
  // src/labels.ts
6002
6002
  var LABELS_PATH = "/api/sdk/traces/labels";
6003
6003
  var HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
6004
- var LABEL_EVIDENCE_PATH = "/api/sdk/traces/labels/label-evidence";
6004
+ function labelEvidencePath(traceId, assertionId) {
6005
+ return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions/${encodeURIComponent(assertionId)}/evidence`;
6006
+ }
6005
6007
  var LabelsClient = class {
6006
6008
  constructor(httpClient) {
6007
6009
  this.httpClient = httpClient;
@@ -6050,15 +6052,9 @@ var LabelsClient = class {
6050
6052
  );
6051
6053
  return response.labels;
6052
6054
  }
6053
- /** Suggest evidence for a whole-trace or assertion label. Currently returns an empty list. */
6054
- async getLabelEvidence(traceId, assertionId) {
6055
- const query = new URLSearchParams({ traceId });
6056
- if (assertionId !== void 0) {
6057
- query.set("assertionId", assertionId);
6058
- }
6059
- const response = await this.httpClient.get(
6060
- `${LABEL_EVIDENCE_PATH}?${query.toString()}`
6061
- );
6055
+ /** Generate suggested evidence for an assertion on an original or replay trace. */
6056
+ async generateLabelEvidence(traceId, assertionId) {
6057
+ const response = await this.httpClient.get(labelEvidencePath(traceId, assertionId));
6062
6058
  return response.evidence;
6063
6059
  }
6064
6060
  };