@bitfab/sdk 0.64.30 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/{chunk-GLBBZLG2.js → chunk-3W6RLPGK.js} +4 -4
  2. package/dist/chunk-3W6RLPGK.js.map +1 -0
  3. package/dist/{chunk-PIMCRSR2.js → chunk-JIGT4NC5.js} +2 -2
  4. package/dist/{chunk-N3CG4AHU.js → chunk-JXIW4FOF.js} +2 -2
  5. package/dist/{chunk-BTCJ5XGH.js → chunk-SUXEIG4U.js} +42 -14
  6. package/dist/chunk-SUXEIG4U.js.map +1 -0
  7. package/dist/{chunk-DARYURT3.js → chunk-TNIJXUGC.js} +2 -2
  8. package/dist/chunk-TNIJXUGC.js.map +1 -0
  9. package/dist/{chunk-5H2UZ2LR.js → chunk-WW2RMMTA.js} +2 -2
  10. package/dist/chunk-WW2RMMTA.js.map +1 -0
  11. package/dist/{http-5HVQJKA7.js → http-7LTYEMJO.js} +2 -2
  12. package/dist/{http-JI7TADRE.js → http-NNVOMI63.js} +2 -2
  13. package/dist/index.cjs +38 -9
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +76 -43
  16. package/dist/index.d.ts +76 -43
  17. package/dist/index.js +5 -3
  18. package/dist/node.cjs +38 -9
  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 +5 -3
  23. package/dist/node.js.map +1 -1
  24. package/dist/{replay-FRGREQBV.js → replay-D7AN6O25.js} +3 -3
  25. package/dist/{replay-WL7ZJP3A.js → replay-L56SESG7.js} +3 -3
  26. package/dist/replayCli.js +3 -3
  27. package/dist/seedCli.js +3 -3
  28. package/package.json +1 -1
  29. package/dist/chunk-5H2UZ2LR.js.map +0 -1
  30. package/dist/chunk-BTCJ5XGH.js.map +0 -1
  31. package/dist/chunk-DARYURT3.js.map +0 -1
  32. package/dist/chunk-GLBBZLG2.js.map +0 -1
  33. /package/dist/{chunk-PIMCRSR2.js.map → chunk-JIGT4NC5.js.map} +0 -0
  34. /package/dist/{chunk-N3CG4AHU.js.map → chunk-JXIW4FOF.js.map} +0 -0
  35. /package/dist/{http-5HVQJKA7.js.map → http-7LTYEMJO.js.map} +0 -0
  36. /package/dist/{http-JI7TADRE.js.map → http-NNVOMI63.js.map} +0 -0
  37. /package/dist/{replay-FRGREQBV.js.map → replay-D7AN6O25.js.map} +0 -0
  38. /package/dist/{replay-WL7ZJP3A.js.map → replay-L56SESG7.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -22,6 +22,38 @@ type ApprovalFields = {
22
22
  approvedAt: string | null;
23
23
  };
24
24
 
25
+ /**
26
+ * BAML execution utilities for the Bitfab TypeScript SDK.
27
+ * This module provides functions to execute BAML prompts dynamically on the client side.
28
+ */
29
+ /**
30
+ * Provider definition from the server.
31
+ */
32
+ interface ProviderDefinition {
33
+ provider: string;
34
+ apiKeyEnv: string;
35
+ models: Array<{
36
+ model: string;
37
+ description: string;
38
+ }>;
39
+ }
40
+ /**
41
+ * Result of a BAML function execution with raw collector data.
42
+ */
43
+ interface BamlExecutionResult {
44
+ /** The parsed result of the function */
45
+ result: unknown;
46
+ /** Raw collector data for the server to parse */
47
+ rawCollector: Record<string, unknown> | null;
48
+ }
49
+ /**
50
+ * Type for allowed environment variables.
51
+ * Only OPENAI_API_KEY is currently supported.
52
+ */
53
+ type AllowedEnvVars = {
54
+ OPENAI_API_KEY?: string;
55
+ };
56
+
25
57
  /** A node is identified by its workflow key and span name, never its display label. */
26
58
  interface ReplayNodeIdentity {
27
59
  traceFunctionKey: string;
@@ -964,66 +996,50 @@ interface SpanTreeResponse {
964
996
  root: SpanTreeNode;
965
997
  }
966
998
 
967
- type AssertionCategorySummary = {
999
+ type CategorySummary = {
968
1000
  id: string;
969
1001
  title: string;
970
1002
  description: string;
971
1003
  };
972
- type AssertionCategory = AssertionCategorySummary & {
1004
+ type Category = CategorySummary & {
973
1005
  organizationId: string;
974
1006
  createdAt: string;
975
1007
  updatedAt: string;
976
1008
  };
977
- type SaveAssertionCategoryParams = {
1009
+ type SaveCategoryParams = {
978
1010
  id?: string;
979
1011
  title: string;
980
1012
  description?: string;
981
1013
  };
982
- /** Organization-scoped groupings for assertions. */
983
- declare class AssertionCategoriesClient {
1014
+ /** @deprecated Use {@link CategorySummary}. Same shape. */
1015
+ type AssertionCategorySummary = CategorySummary;
1016
+ /** @deprecated Use {@link Category}. Same shape. */
1017
+ type AssertionCategory = Category;
1018
+ /** @deprecated Use {@link SaveCategoryParams}. Same shape. */
1019
+ type SaveAssertionCategoryParams = SaveCategoryParams;
1020
+ /** Organization-scoped groupings for assertions and scenarios. */
1021
+ declare class CategoriesClient {
984
1022
  private readonly httpClient;
985
1023
  constructor(httpClient: HttpClient);
986
1024
  /** Create a category, or update it by ID. Omitted descriptions are preserved. */
987
- save(params: SaveAssertionCategoryParams): Promise<AssertionCategory>;
1025
+ save(params: SaveCategoryParams): Promise<Category>;
988
1026
  /** Read one category in the API key's organization. */
989
- get(id: string): Promise<AssertionCategory>;
1027
+ get(id: string): Promise<Category>;
990
1028
  /** List the organization's categories ordered by title. */
991
- list(): Promise<AssertionCategory[]>;
1029
+ list(): Promise<Category[]>;
992
1030
  /** Delete a category and clear its assignments, preserving assertions and verdicts. */
993
- delete(id: string): Promise<AssertionCategory>;
994
- }
995
-
996
- /**
997
- * BAML execution utilities for the Bitfab TypeScript SDK.
998
- * This module provides functions to execute BAML prompts dynamically on the client side.
999
- */
1000
- /**
1001
- * Provider definition from the server.
1002
- */
1003
- interface ProviderDefinition {
1004
- provider: string;
1005
- apiKeyEnv: string;
1006
- models: Array<{
1007
- model: string;
1008
- description: string;
1009
- }>;
1031
+ delete(id: string): Promise<Category>;
1010
1032
  }
1011
1033
  /**
1012
- * Result of a BAML function execution with raw collector data.
1034
+ * @deprecated Use {@link CategoriesClient}. Same class.
1035
+ * @alias
1013
1036
  */
1014
- interface BamlExecutionResult {
1015
- /** The parsed result of the function */
1016
- result: unknown;
1017
- /** Raw collector data for the server to parse */
1018
- rawCollector: Record<string, unknown> | null;
1019
- }
1037
+ declare const AssertionCategoriesClient: typeof CategoriesClient;
1020
1038
  /**
1021
- * Type for allowed environment variables.
1022
- * Only OPENAI_API_KEY is currently supported.
1039
+ * @deprecated Use {@link CategoriesClient}. Same class.
1040
+ * @alias
1023
1041
  */
1024
- type AllowedEnvVars = {
1025
- OPENAI_API_KEY?: string;
1026
- };
1042
+ type AssertionCategoriesClient = CategoriesClient;
1027
1043
 
1028
1044
  /**
1029
1045
  * Claude Agent SDK handler for Bitfab tracing.
@@ -1528,7 +1544,7 @@ type ExperimentTotals = {
1528
1544
  skipped: number;
1529
1545
  };
1530
1546
  type ExperimentCategoryTally = {
1531
- category: AssertionCategorySummary;
1547
+ category: CategorySummary;
1532
1548
  labels: ExperimentTally;
1533
1549
  };
1534
1550
  type ExperimentJitter = {
@@ -1610,8 +1626,10 @@ type TraceAssertion = {
1610
1626
  traceId: string;
1611
1627
  assertion: string;
1612
1628
  humanNote: string | null;
1629
+ category_id: string | null;
1630
+ /** @deprecated Use {@link category_id}. Same value. */
1613
1631
  category_assertion_id: string | null;
1614
- category: AssertionCategorySummary | null;
1632
+ category: CategorySummary | null;
1615
1633
  passCriteria: string | null;
1616
1634
  failCriteria: string | null;
1617
1635
  targetOnEvaluatedTrace: TraceTarget | null;
@@ -1640,6 +1658,8 @@ type AssertionLabelEvidence = {
1640
1658
  };
1641
1659
  type SaveAssertion = {
1642
1660
  /** Omit to preserve the category, or pass null to clear it. */
1661
+ category_id?: string | null;
1662
+ /** @deprecated Use {@link category_id}. Ignored when `category_id` is also set. */
1643
1663
  category_assertion_id?: string | null;
1644
1664
  id?: string;
1645
1665
  assertion: string;
@@ -1653,7 +1673,7 @@ type SaveAssertion = {
1653
1673
  */
1654
1674
  justification?: Justification | null;
1655
1675
  /**
1656
- * Why `category_assertion_id` is the right category. Changing the category
1676
+ * Why `category_id` is the right category. Changing the category
1657
1677
  * clears it. Omit on an edit to preserve it.
1658
1678
  */
1659
1679
  categoryJustification?: Justification | null;
@@ -1757,6 +1777,8 @@ type Scenario = {
1757
1777
  dataSummary: string;
1758
1778
  /** What the run actually did, or null when none has been saved. */
1759
1779
  actualOutcome: ScenarioActualOutcome | null;
1780
+ /** Every category the scenario is filed under, sorted by title. */
1781
+ categories: CategorySummary[];
1760
1782
  };
1761
1783
  type SaveScenarioHistoryEntry = Omit<ScenarioHistoryEntry, "source"> & {
1762
1784
  source?: ScenarioSource | null;
@@ -1786,6 +1808,12 @@ type SaveScenarioParams = {
1786
1808
  * Sending only this field, null included, is a valid save.
1787
1809
  */
1788
1810
  actualOutcome?: SaveScenarioActualOutcome | null;
1811
+ /**
1812
+ * Categories to file the scenario under. Replaces the whole set. Leave it
1813
+ * out to keep the current set, or pass an empty array to clear it. An id
1814
+ * outside the organization fails the save.
1815
+ */
1816
+ categoryIds?: string[];
1789
1817
  } & ({
1790
1818
  data?: SaveScenarioData;
1791
1819
  appendData?: never;
@@ -1804,6 +1832,8 @@ type SaveScenarioParams = {
1804
1832
  appendData: ScenarioDataAppend;
1805
1833
  } | {
1806
1834
  actualOutcome: SaveScenarioActualOutcome | null;
1835
+ } | {
1836
+ categoryIds: string[];
1807
1837
  });
1808
1838
  type AssertionGenerationStatus = "running" | "completed" | "failed";
1809
1839
  type AssertionGeneration = {
@@ -3537,7 +3567,10 @@ declare class Bitfab {
3537
3567
  private readonly httpClient;
3538
3568
  /** Dataset operations for the authenticated organization. */
3539
3569
  readonly datasets: DatasetsClient;
3540
- readonly assertionCategories: AssertionCategoriesClient;
3570
+ /** Organization-scoped groupings for assertions and scenarios. */
3571
+ readonly categories: CategoriesClient;
3572
+ /** @deprecated Use {@link categories}. Same client. */
3573
+ readonly assertionCategories: CategoriesClient;
3541
3574
  readonly organizationMembers: OrganizationMembersClient;
3542
3575
  readonly traces: TracesClient;
3543
3576
  readonly spans: SpansClient;
@@ -4251,7 +4284,7 @@ interface CommitRef {
4251
4284
  /**
4252
4285
  * SDK version from package.json (injected at build time)
4253
4286
  */
4254
- declare const __version__ = "0.64.30";
4287
+ declare const __version__ = "0.65.0";
4255
4288
 
4256
4289
  /**
4257
4290
  * Constants for the Bitfab SDK.
@@ -4390,4 +4423,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
4390
4423
  run?: boolean;
4391
4424
  }): Promise<SeedResult>;
4392
4425
 
4393
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, 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 Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, 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, type ListExperimentsParams, type ListedSpan, 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 ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, 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 SaveScenarioActualOutcome, type SaveScenarioData, type SaveScenarioHistoryEntry, type SaveScenarioParams, type Scenario, type ScenarioAction, type ScenarioActualOutcome, type ScenarioData, type ScenarioDataAppend, type ScenarioDataOrigin, type ScenarioHistoryEntry, type ScenarioSource, type ScenarioTrigger, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanListField, type SpanListParams, type SpanListResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, SpansClient, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type UpdateDatasetParams, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type Verdict, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
4426
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, 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, CategoriesClient, type Category, type CategorySummary, 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 Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, 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, type ListExperimentsParams, type ListedSpan, 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 ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, 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 SaveCategoryParams, type SaveDatasetParams, type SaveDatasetResult, type SaveScenarioActualOutcome, type SaveScenarioData, type SaveScenarioHistoryEntry, type SaveScenarioParams, type Scenario, type ScenarioAction, type ScenarioActualOutcome, type ScenarioData, type ScenarioDataAppend, type ScenarioDataOrigin, type ScenarioHistoryEntry, type ScenarioSource, type ScenarioTrigger, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanListField, type SpanListParams, type SpanListResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, SpansClient, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type UpdateDatasetParams, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type Verdict, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,38 @@ type ApprovalFields = {
22
22
  approvedAt: string | null;
23
23
  };
24
24
 
25
+ /**
26
+ * BAML execution utilities for the Bitfab TypeScript SDK.
27
+ * This module provides functions to execute BAML prompts dynamically on the client side.
28
+ */
29
+ /**
30
+ * Provider definition from the server.
31
+ */
32
+ interface ProviderDefinition {
33
+ provider: string;
34
+ apiKeyEnv: string;
35
+ models: Array<{
36
+ model: string;
37
+ description: string;
38
+ }>;
39
+ }
40
+ /**
41
+ * Result of a BAML function execution with raw collector data.
42
+ */
43
+ interface BamlExecutionResult {
44
+ /** The parsed result of the function */
45
+ result: unknown;
46
+ /** Raw collector data for the server to parse */
47
+ rawCollector: Record<string, unknown> | null;
48
+ }
49
+ /**
50
+ * Type for allowed environment variables.
51
+ * Only OPENAI_API_KEY is currently supported.
52
+ */
53
+ type AllowedEnvVars = {
54
+ OPENAI_API_KEY?: string;
55
+ };
56
+
25
57
  /** A node is identified by its workflow key and span name, never its display label. */
26
58
  interface ReplayNodeIdentity {
27
59
  traceFunctionKey: string;
@@ -964,66 +996,50 @@ interface SpanTreeResponse {
964
996
  root: SpanTreeNode;
965
997
  }
966
998
 
967
- type AssertionCategorySummary = {
999
+ type CategorySummary = {
968
1000
  id: string;
969
1001
  title: string;
970
1002
  description: string;
971
1003
  };
972
- type AssertionCategory = AssertionCategorySummary & {
1004
+ type Category = CategorySummary & {
973
1005
  organizationId: string;
974
1006
  createdAt: string;
975
1007
  updatedAt: string;
976
1008
  };
977
- type SaveAssertionCategoryParams = {
1009
+ type SaveCategoryParams = {
978
1010
  id?: string;
979
1011
  title: string;
980
1012
  description?: string;
981
1013
  };
982
- /** Organization-scoped groupings for assertions. */
983
- declare class AssertionCategoriesClient {
1014
+ /** @deprecated Use {@link CategorySummary}. Same shape. */
1015
+ type AssertionCategorySummary = CategorySummary;
1016
+ /** @deprecated Use {@link Category}. Same shape. */
1017
+ type AssertionCategory = Category;
1018
+ /** @deprecated Use {@link SaveCategoryParams}. Same shape. */
1019
+ type SaveAssertionCategoryParams = SaveCategoryParams;
1020
+ /** Organization-scoped groupings for assertions and scenarios. */
1021
+ declare class CategoriesClient {
984
1022
  private readonly httpClient;
985
1023
  constructor(httpClient: HttpClient);
986
1024
  /** Create a category, or update it by ID. Omitted descriptions are preserved. */
987
- save(params: SaveAssertionCategoryParams): Promise<AssertionCategory>;
1025
+ save(params: SaveCategoryParams): Promise<Category>;
988
1026
  /** Read one category in the API key's organization. */
989
- get(id: string): Promise<AssertionCategory>;
1027
+ get(id: string): Promise<Category>;
990
1028
  /** List the organization's categories ordered by title. */
991
- list(): Promise<AssertionCategory[]>;
1029
+ list(): Promise<Category[]>;
992
1030
  /** Delete a category and clear its assignments, preserving assertions and verdicts. */
993
- delete(id: string): Promise<AssertionCategory>;
994
- }
995
-
996
- /**
997
- * BAML execution utilities for the Bitfab TypeScript SDK.
998
- * This module provides functions to execute BAML prompts dynamically on the client side.
999
- */
1000
- /**
1001
- * Provider definition from the server.
1002
- */
1003
- interface ProviderDefinition {
1004
- provider: string;
1005
- apiKeyEnv: string;
1006
- models: Array<{
1007
- model: string;
1008
- description: string;
1009
- }>;
1031
+ delete(id: string): Promise<Category>;
1010
1032
  }
1011
1033
  /**
1012
- * Result of a BAML function execution with raw collector data.
1034
+ * @deprecated Use {@link CategoriesClient}. Same class.
1035
+ * @alias
1013
1036
  */
1014
- interface BamlExecutionResult {
1015
- /** The parsed result of the function */
1016
- result: unknown;
1017
- /** Raw collector data for the server to parse */
1018
- rawCollector: Record<string, unknown> | null;
1019
- }
1037
+ declare const AssertionCategoriesClient: typeof CategoriesClient;
1020
1038
  /**
1021
- * Type for allowed environment variables.
1022
- * Only OPENAI_API_KEY is currently supported.
1039
+ * @deprecated Use {@link CategoriesClient}. Same class.
1040
+ * @alias
1023
1041
  */
1024
- type AllowedEnvVars = {
1025
- OPENAI_API_KEY?: string;
1026
- };
1042
+ type AssertionCategoriesClient = CategoriesClient;
1027
1043
 
1028
1044
  /**
1029
1045
  * Claude Agent SDK handler for Bitfab tracing.
@@ -1528,7 +1544,7 @@ type ExperimentTotals = {
1528
1544
  skipped: number;
1529
1545
  };
1530
1546
  type ExperimentCategoryTally = {
1531
- category: AssertionCategorySummary;
1547
+ category: CategorySummary;
1532
1548
  labels: ExperimentTally;
1533
1549
  };
1534
1550
  type ExperimentJitter = {
@@ -1610,8 +1626,10 @@ type TraceAssertion = {
1610
1626
  traceId: string;
1611
1627
  assertion: string;
1612
1628
  humanNote: string | null;
1629
+ category_id: string | null;
1630
+ /** @deprecated Use {@link category_id}. Same value. */
1613
1631
  category_assertion_id: string | null;
1614
- category: AssertionCategorySummary | null;
1632
+ category: CategorySummary | null;
1615
1633
  passCriteria: string | null;
1616
1634
  failCriteria: string | null;
1617
1635
  targetOnEvaluatedTrace: TraceTarget | null;
@@ -1640,6 +1658,8 @@ type AssertionLabelEvidence = {
1640
1658
  };
1641
1659
  type SaveAssertion = {
1642
1660
  /** Omit to preserve the category, or pass null to clear it. */
1661
+ category_id?: string | null;
1662
+ /** @deprecated Use {@link category_id}. Ignored when `category_id` is also set. */
1643
1663
  category_assertion_id?: string | null;
1644
1664
  id?: string;
1645
1665
  assertion: string;
@@ -1653,7 +1673,7 @@ type SaveAssertion = {
1653
1673
  */
1654
1674
  justification?: Justification | null;
1655
1675
  /**
1656
- * Why `category_assertion_id` is the right category. Changing the category
1676
+ * Why `category_id` is the right category. Changing the category
1657
1677
  * clears it. Omit on an edit to preserve it.
1658
1678
  */
1659
1679
  categoryJustification?: Justification | null;
@@ -1757,6 +1777,8 @@ type Scenario = {
1757
1777
  dataSummary: string;
1758
1778
  /** What the run actually did, or null when none has been saved. */
1759
1779
  actualOutcome: ScenarioActualOutcome | null;
1780
+ /** Every category the scenario is filed under, sorted by title. */
1781
+ categories: CategorySummary[];
1760
1782
  };
1761
1783
  type SaveScenarioHistoryEntry = Omit<ScenarioHistoryEntry, "source"> & {
1762
1784
  source?: ScenarioSource | null;
@@ -1786,6 +1808,12 @@ type SaveScenarioParams = {
1786
1808
  * Sending only this field, null included, is a valid save.
1787
1809
  */
1788
1810
  actualOutcome?: SaveScenarioActualOutcome | null;
1811
+ /**
1812
+ * Categories to file the scenario under. Replaces the whole set. Leave it
1813
+ * out to keep the current set, or pass an empty array to clear it. An id
1814
+ * outside the organization fails the save.
1815
+ */
1816
+ categoryIds?: string[];
1789
1817
  } & ({
1790
1818
  data?: SaveScenarioData;
1791
1819
  appendData?: never;
@@ -1804,6 +1832,8 @@ type SaveScenarioParams = {
1804
1832
  appendData: ScenarioDataAppend;
1805
1833
  } | {
1806
1834
  actualOutcome: SaveScenarioActualOutcome | null;
1835
+ } | {
1836
+ categoryIds: string[];
1807
1837
  });
1808
1838
  type AssertionGenerationStatus = "running" | "completed" | "failed";
1809
1839
  type AssertionGeneration = {
@@ -3537,7 +3567,10 @@ declare class Bitfab {
3537
3567
  private readonly httpClient;
3538
3568
  /** Dataset operations for the authenticated organization. */
3539
3569
  readonly datasets: DatasetsClient;
3540
- readonly assertionCategories: AssertionCategoriesClient;
3570
+ /** Organization-scoped groupings for assertions and scenarios. */
3571
+ readonly categories: CategoriesClient;
3572
+ /** @deprecated Use {@link categories}. Same client. */
3573
+ readonly assertionCategories: CategoriesClient;
3541
3574
  readonly organizationMembers: OrganizationMembersClient;
3542
3575
  readonly traces: TracesClient;
3543
3576
  readonly spans: SpansClient;
@@ -4251,7 +4284,7 @@ interface CommitRef {
4251
4284
  /**
4252
4285
  * SDK version from package.json (injected at build time)
4253
4286
  */
4254
- declare const __version__ = "0.64.30";
4287
+ declare const __version__ = "0.65.0";
4255
4288
 
4256
4289
  /**
4257
4290
  * Constants for the Bitfab SDK.
@@ -4390,4 +4423,4 @@ declare function seedFromRegistry(registry: ReplayRegistry, pipeline: string, ca
4390
4423
  run?: boolean;
4391
4424
  }): Promise<SeedResult>;
4392
4425
 
4393
- export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, 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 Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, 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, type ListExperimentsParams, type ListedSpan, 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 ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, 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 SaveScenarioActualOutcome, type SaveScenarioData, type SaveScenarioHistoryEntry, type SaveScenarioParams, type Scenario, type ScenarioAction, type ScenarioActualOutcome, type ScenarioData, type ScenarioDataAppend, type ScenarioDataOrigin, type ScenarioHistoryEntry, type ScenarioSource, type ScenarioTrigger, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanListField, type SpanListParams, type SpanListResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, SpansClient, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type UpdateDatasetParams, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type Verdict, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
4426
+ export { type ActiveSpanContext, type AdaptContext, type AdaptInputsFn, type AddDatasetGradersResult, type AddDatasetTracesResult, type AllowedEnvVars, type ApprovalFields, type ApprovalState, type Approver, type ArchiveAssertionsParams, type ArchiveLabelTarget, AssertionCategoriesClient, type AssertionCategory, type AssertionCategorySummary, type AssertionEvidenceParameter, type AssertionGeneration, AssertionGenerationError, type AssertionGenerationStatus, AssertionGenerationTimeoutError, 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, CategoriesClient, type Category, type CategorySummary, 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 Experiment, type ExperimentCategoryTally, type ExperimentCodeChangeTotals, type ExperimentJitter, type ExperimentPage, type ExperimentRollup, type ExperimentRollupResult, type ExperimentRunBy, type ExperimentStatus, type ExperimentTally, type ExperimentTotals, ExperimentsClient, type GenerateAssertionsOptions, type GetGraderLabelsParams, type GraderLabel, type GraderLabelOutcome, type GraderLabelSource, type GraderLabelUpdate, type GraderRerun, GraderRerunError, type GraderRerunProgress, type GraderRerunResult, type GraderRerunStatus, GraderRerunTimeoutError, 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, type ListExperimentsParams, type ListedSpan, 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 ReplayExperiment, type ReplayInterrupt, type ReplayInterruptSignal, type ReplayItem, type ReplayItemFinishProgress, type ReplayItemStartProgress, type ReplayNodeIdentity, 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 SaveCategoryParams, type SaveDatasetParams, type SaveDatasetResult, type SaveScenarioActualOutcome, type SaveScenarioData, type SaveScenarioHistoryEntry, type SaveScenarioParams, type Scenario, type ScenarioAction, type ScenarioActualOutcome, type ScenarioData, type ScenarioDataAppend, type ScenarioDataOrigin, type ScenarioHistoryEntry, type ScenarioSource, type ScenarioTrigger, type SeedCase, type SeedCaseOptions, type SeedResult, type SeedRunOptions, type SelectiveReplayDecision, type SelectiveReplayOptions, type SelectiveReplayReport, type SpanListField, type SpanListParams, type SpanListResult, type SpanLookup, type SpanMethodDecorator, type SpanMethodDecoratorContext, type SpanNodeMeta, type SpanOccurrence, type SpanOptions, type SpanType, SpansClient, type TokenUsage, type TraceAssertion, type TraceAssertionSource, type TraceAssertionsResult, type TraceAssertionsUpdate, type TraceIngestionType, type TraceLabels, type TraceResponse, type TraceSearchFilters, type TraceSearchParams, type TraceSearchResult, type TraceTarget, type TraceTargetOccurrence, TracesClient, type TracingProcessor, type UpdateDatasetParams, type VercelCallParams, type VercelGenerateResult, type VercelStreamResult, type Verdict, type WrapBAMLOptions, type WrappedBamlFn, __version__, defineReplayRegistry, finalizers, flushTraces, getCurrentReplayBranch, getCurrentSpan, getCurrentTrace, reportReplayProgress, reseedFromRegistry, seedFromRegistry, serializeReplayResult };
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  BitfabOpenAITracingProcessor,
12
12
  BitfabRivetIntegration,
13
13
  BitfabVercelAiHandler,
14
+ CategoriesClient,
14
15
  DatasetsClient,
15
16
  ExperimentsClient,
16
17
  GraderRerunError,
@@ -28,7 +29,7 @@ import {
28
29
  getCurrentTrace,
29
30
  reseedFromRegistry,
30
31
  seedFromRegistry
31
- } from "./chunk-BTCJ5XGH.js";
32
+ } from "./chunk-SUXEIG4U.js";
32
33
  import "./chunk-YWXQM6J3.js";
33
34
  import {
34
35
  BITFAB_PROGRESS_PREFIX,
@@ -37,7 +38,7 @@ import {
37
38
  ReplayError,
38
39
  reportReplayProgress,
39
40
  serializeReplayResult
40
- } from "./chunk-PIMCRSR2.js";
41
+ } from "./chunk-JIGT4NC5.js";
41
42
  import {
42
43
  BitfabError,
43
44
  DEFAULT_SERVICE_URL,
@@ -45,7 +46,7 @@ import {
45
46
  MixedTracingError,
46
47
  __version__,
47
48
  flushTraces
48
- } from "./chunk-DARYURT3.js";
49
+ } from "./chunk-TNIJXUGC.js";
49
50
  import "./chunk-MT36GJMW.js";
50
51
  export {
51
52
  AssertionCategoriesClient,
@@ -63,6 +64,7 @@ export {
63
64
  BitfabOpenAITracingProcessor,
64
65
  BitfabRivetIntegration,
65
66
  BitfabVercelAiHandler,
67
+ CategoriesClient,
66
68
  DEFAULT_SERVICE_URL,
67
69
  DatasetsClient,
68
70
  DbBranchReplayError,
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.64.30";
91
+ __version__ = "0.65.0";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -5374,6 +5374,7 @@ __export(node_exports, {
5374
5374
  BitfabOpenAITracingProcessor: () => BitfabOpenAITracingProcessor,
5375
5375
  BitfabRivetIntegration: () => BitfabRivetIntegration,
5376
5376
  BitfabVercelAiHandler: () => BitfabVercelAiHandler,
5377
+ CategoriesClient: () => CategoriesClient,
5377
5378
  DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
5378
5379
  DatasetsClient: () => DatasetsClient,
5379
5380
  DbBranchReplayError: () => DbBranchReplayError,
@@ -5411,9 +5412,9 @@ registerAsyncLocalStorageClass(
5411
5412
  import_node_async_hooks.AsyncLocalStorage
5412
5413
  );
5413
5414
 
5414
- // src/assertionCategories.ts
5415
- var CATEGORIES_PATH = "/api/sdk/assertionCategories";
5416
- var AssertionCategoriesClient = class {
5415
+ // src/categories.ts
5416
+ var CATEGORIES_PATH = "/api/sdk/categories";
5417
+ var CategoriesClient = class {
5417
5418
  constructor(httpClient) {
5418
5419
  this.httpClient = httpClient;
5419
5420
  }
@@ -5440,6 +5441,7 @@ var AssertionCategoriesClient = class {
5440
5441
  return response.category;
5441
5442
  }
5442
5443
  };
5444
+ var AssertionCategoriesClient = CategoriesClient;
5443
5445
 
5444
5446
  // src/claudeAgentSdk.ts
5445
5447
  init_constants();
@@ -9039,6 +9041,27 @@ function draftsInGenerationOrder(assertions, assertionIds) {
9039
9041
  return assertion === void 0 ? [] : [assertion];
9040
9042
  });
9041
9043
  }
9044
+ function withCategoryId(assertion) {
9045
+ const categoryId = assertion.category_id ?? assertion.category_assertion_id ?? null;
9046
+ return {
9047
+ ...assertion,
9048
+ category_id: categoryId,
9049
+ category_assertion_id: categoryId
9050
+ };
9051
+ }
9052
+ function withCategoryIds(assertions) {
9053
+ return assertions.map(withCategoryId);
9054
+ }
9055
+ function toWireAssertion({
9056
+ category_assertion_id,
9057
+ ...assertion
9058
+ }) {
9059
+ const categoryId = assertion.category_id === void 0 ? category_assertion_id : assertion.category_id;
9060
+ if (categoryId === void 0) {
9061
+ return assertion;
9062
+ }
9063
+ return { ...assertion, category_id: categoryId };
9064
+ }
9042
9065
  function traceAssertionsPath(traceId, suffix = "") {
9043
9066
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
9044
9067
  }
@@ -9053,9 +9076,10 @@ var TracesClient = class {
9053
9076
  return this.httpClient.request(SEARCH_PATH, params);
9054
9077
  }
9055
9078
  async getAssertions(traceId) {
9056
- return this.httpClient.get(
9079
+ const result = await this.httpClient.get(
9057
9080
  traceAssertionsPath(traceId)
9058
9081
  );
9082
+ return { ...result, assertions: withCategoryIds(result.assertions) };
9059
9083
  }
9060
9084
  async saveAssertions(params) {
9061
9085
  return this.saveAssertionsAll({
@@ -9068,10 +9092,13 @@ var TracesClient = class {
9068
9092
  return [];
9069
9093
  }
9070
9094
  const response = await this.httpClient.request(ASSERTIONS_PATH, {
9071
- updates: params.updates,
9095
+ updates: params.updates.map((update) => ({
9096
+ ...update,
9097
+ assertions: update.assertions.map(toWireAssertion)
9098
+ })),
9072
9099
  source: params.source ?? "agent"
9073
9100
  });
9074
- return response.assertions;
9101
+ return withCategoryIds(response.assertions);
9075
9102
  }
9076
9103
  async generateAssertions(traceId, options = {}) {
9077
9104
  const started = await this.httpClient.request(
@@ -9083,7 +9110,7 @@ var TracesClient = class {
9083
9110
  }
9084
9111
  );
9085
9112
  if (isGenerationFinished(traceId, started.generation)) {
9086
- return started.assertions;
9113
+ return withCategoryIds(started.assertions);
9087
9114
  }
9088
9115
  const timeoutMs = options.timeoutMs ?? DEFAULT_GENERATION_TIMEOUT_MS;
9089
9116
  const deadline = Date.now() + timeoutMs;
@@ -10106,7 +10133,8 @@ var Bitfab = class {
10106
10133
  this.simulationPlan.refresh();
10107
10134
  }
10108
10135
  this.datasets = new DatasetsClient(this.httpClient);
10109
- this.assertionCategories = new AssertionCategoriesClient(this.httpClient);
10136
+ this.categories = new CategoriesClient(this.httpClient);
10137
+ this.assertionCategories = this.categories;
10110
10138
  this.organizationMembers = new OrganizationMembersClient(this.httpClient);
10111
10139
  this.traces = new TracesClient(this.httpClient);
10112
10140
  this.spans = new SpansClient(this.httpClient);
@@ -12429,6 +12457,7 @@ assertAsyncStorageRegistered();
12429
12457
  BitfabOpenAITracingProcessor,
12430
12458
  BitfabRivetIntegration,
12431
12459
  BitfabVercelAiHandler,
12460
+ CategoriesClient,
12432
12461
  DEFAULT_SERVICE_URL,
12433
12462
  DatasetsClient,
12434
12463
  DbBranchReplayError,