bitfab 0.64.29 → 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 (39) hide show
  1. package/cloudReplay.py +3 -5
  2. package/dist/{chunk-E2N56K23.js → chunk-2A4MMF2B.js} +2 -2
  3. package/dist/{chunk-LOR3CWDQ.js → chunk-6FFC55V5.js} +4 -4
  4. package/dist/chunk-6FFC55V5.js.map +1 -0
  5. package/dist/{chunk-W2AQ56UP.js → chunk-BTCULORS.js} +42 -14
  6. package/dist/chunk-BTCULORS.js.map +1 -0
  7. package/dist/{chunk-W5DDLKC5.js → chunk-CYF5LGHB.js} +2 -2
  8. package/dist/{chunk-24JBL2FV.js → chunk-UKQOBPTJ.js} +2 -2
  9. package/dist/chunk-UKQOBPTJ.js.map +1 -0
  10. package/dist/{chunk-RC6IC2EL.js → chunk-YXRWWUSR.js} +2 -2
  11. package/dist/chunk-YXRWWUSR.js.map +1 -0
  12. package/dist/{http-S33OM4NK.js → http-EIX65EBE.js} +2 -2
  13. package/dist/{http-6UJ47MDP.js → http-UAXBI747.js} +2 -2
  14. package/dist/index.cjs +38 -9
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +76 -43
  17. package/dist/index.d.ts +76 -43
  18. package/dist/index.js +5 -3
  19. package/dist/node.cjs +38 -9
  20. package/dist/node.cjs.map +1 -1
  21. package/dist/node.d.cts +1 -1
  22. package/dist/node.d.ts +1 -1
  23. package/dist/node.js +5 -3
  24. package/dist/node.js.map +1 -1
  25. package/dist/{replay-MBMPKUFX.js → replay-EVDUMCAS.js} +3 -3
  26. package/dist/{replay-RSAJN6YA.js → replay-U65EXYUR.js} +3 -3
  27. package/dist/replayCli.js +3 -3
  28. package/dist/seedCli.js +3 -3
  29. package/package.json +1 -1
  30. package/dist/chunk-24JBL2FV.js.map +0 -1
  31. package/dist/chunk-LOR3CWDQ.js.map +0 -1
  32. package/dist/chunk-RC6IC2EL.js.map +0 -1
  33. package/dist/chunk-W2AQ56UP.js.map +0 -1
  34. /package/dist/{chunk-E2N56K23.js.map → chunk-2A4MMF2B.js.map} +0 -0
  35. /package/dist/{chunk-W5DDLKC5.js.map → chunk-CYF5LGHB.js.map} +0 -0
  36. /package/dist/{http-6UJ47MDP.js.map → http-EIX65EBE.js.map} +0 -0
  37. /package/dist/{http-S33OM4NK.js.map → http-UAXBI747.js.map} +0 -0
  38. /package/dist/{replay-MBMPKUFX.js.map → replay-EVDUMCAS.js.map} +0 -0
  39. /package/dist/{replay-RSAJN6YA.js.map → replay-U65EXYUR.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.29";
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.29";
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
@@ -20,6 +20,7 @@ import {
20
20
  BitfabOpenAITracingProcessor,
21
21
  BitfabRivetIntegration,
22
22
  BitfabVercelAiHandler,
23
+ CategoriesClient,
23
24
  DatasetsClient,
24
25
  ExperimentsClient,
25
26
  GraderRerunError,
@@ -37,7 +38,7 @@ import {
37
38
  getCurrentTrace,
38
39
  reseedFromRegistry,
39
40
  seedFromRegistry
40
- } from "./chunk-W2AQ56UP.js";
41
+ } from "./chunk-BTCULORS.js";
41
42
  import "./chunk-YWXQM6J3.js";
42
43
  import {
43
44
  BITFAB_PROGRESS_PREFIX,
@@ -46,7 +47,7 @@ import {
46
47
  ReplayError,
47
48
  reportReplayProgress,
48
49
  serializeReplayResult
49
- } from "./chunk-E2N56K23.js";
50
+ } from "./chunk-2A4MMF2B.js";
50
51
  import {
51
52
  BitfabError,
52
53
  DEFAULT_SERVICE_URL,
@@ -54,7 +55,7 @@ import {
54
55
  MixedTracingError,
55
56
  __version__,
56
57
  flushTraces
57
- } from "./chunk-24JBL2FV.js";
58
+ } from "./chunk-UKQOBPTJ.js";
58
59
  import "./chunk-MT36GJMW.js";
59
60
  export {
60
61
  AssertionCategoriesClient,
@@ -72,6 +73,7 @@ export {
72
73
  BitfabOpenAITracingProcessor,
73
74
  BitfabRivetIntegration,
74
75
  BitfabVercelAiHandler,
76
+ CategoriesClient,
75
77
  DEFAULT_SERVICE_URL,
76
78
  DatasetsClient,
77
79
  DbBranchReplayError,
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.64.29";
100
+ __version__ = "0.65.0";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -5383,6 +5383,7 @@ __export(node_exports, {
5383
5383
  BitfabOpenAITracingProcessor: () => BitfabOpenAITracingProcessor,
5384
5384
  BitfabRivetIntegration: () => BitfabRivetIntegration,
5385
5385
  BitfabVercelAiHandler: () => BitfabVercelAiHandler,
5386
+ CategoriesClient: () => CategoriesClient,
5386
5387
  DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
5387
5388
  DatasetsClient: () => DatasetsClient,
5388
5389
  DbBranchReplayError: () => DbBranchReplayError,
@@ -5420,9 +5421,9 @@ registerAsyncLocalStorageClass(
5420
5421
  import_node_async_hooks.AsyncLocalStorage
5421
5422
  );
5422
5423
 
5423
- // src/assertionCategories.ts
5424
- var CATEGORIES_PATH = "/api/sdk/assertionCategories";
5425
- var AssertionCategoriesClient = class {
5424
+ // src/categories.ts
5425
+ var CATEGORIES_PATH = "/api/sdk/categories";
5426
+ var CategoriesClient = class {
5426
5427
  constructor(httpClient) {
5427
5428
  this.httpClient = httpClient;
5428
5429
  }
@@ -5449,6 +5450,7 @@ var AssertionCategoriesClient = class {
5449
5450
  return response.category;
5450
5451
  }
5451
5452
  };
5453
+ var AssertionCategoriesClient = CategoriesClient;
5452
5454
 
5453
5455
  // src/claudeAgentSdk.ts
5454
5456
  init_constants();
@@ -9048,6 +9050,27 @@ function draftsInGenerationOrder(assertions, assertionIds) {
9048
9050
  return assertion === void 0 ? [] : [assertion];
9049
9051
  });
9050
9052
  }
9053
+ function withCategoryId(assertion) {
9054
+ const categoryId = assertion.category_id ?? assertion.category_assertion_id ?? null;
9055
+ return {
9056
+ ...assertion,
9057
+ category_id: categoryId,
9058
+ category_assertion_id: categoryId
9059
+ };
9060
+ }
9061
+ function withCategoryIds(assertions) {
9062
+ return assertions.map(withCategoryId);
9063
+ }
9064
+ function toWireAssertion({
9065
+ category_assertion_id,
9066
+ ...assertion
9067
+ }) {
9068
+ const categoryId = assertion.category_id === void 0 ? category_assertion_id : assertion.category_id;
9069
+ if (categoryId === void 0) {
9070
+ return assertion;
9071
+ }
9072
+ return { ...assertion, category_id: categoryId };
9073
+ }
9051
9074
  function traceAssertionsPath(traceId, suffix = "") {
9052
9075
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
9053
9076
  }
@@ -9062,9 +9085,10 @@ var TracesClient = class {
9062
9085
  return this.httpClient.request(SEARCH_PATH, params);
9063
9086
  }
9064
9087
  async getAssertions(traceId) {
9065
- return this.httpClient.get(
9088
+ const result = await this.httpClient.get(
9066
9089
  traceAssertionsPath(traceId)
9067
9090
  );
9091
+ return { ...result, assertions: withCategoryIds(result.assertions) };
9068
9092
  }
9069
9093
  async saveAssertions(params) {
9070
9094
  return this.saveAssertionsAll({
@@ -9077,10 +9101,13 @@ var TracesClient = class {
9077
9101
  return [];
9078
9102
  }
9079
9103
  const response = await this.httpClient.request(ASSERTIONS_PATH, {
9080
- updates: params.updates,
9104
+ updates: params.updates.map((update) => ({
9105
+ ...update,
9106
+ assertions: update.assertions.map(toWireAssertion)
9107
+ })),
9081
9108
  source: params.source ?? "agent"
9082
9109
  });
9083
- return response.assertions;
9110
+ return withCategoryIds(response.assertions);
9084
9111
  }
9085
9112
  async generateAssertions(traceId, options = {}) {
9086
9113
  const started = await this.httpClient.request(
@@ -9092,7 +9119,7 @@ var TracesClient = class {
9092
9119
  }
9093
9120
  );
9094
9121
  if (isGenerationFinished(traceId, started.generation)) {
9095
- return started.assertions;
9122
+ return withCategoryIds(started.assertions);
9096
9123
  }
9097
9124
  const timeoutMs = options.timeoutMs ?? DEFAULT_GENERATION_TIMEOUT_MS;
9098
9125
  const deadline = Date.now() + timeoutMs;
@@ -10115,7 +10142,8 @@ var Bitfab = class {
10115
10142
  this.simulationPlan.refresh();
10116
10143
  }
10117
10144
  this.datasets = new DatasetsClient(this.httpClient);
10118
- this.assertionCategories = new AssertionCategoriesClient(this.httpClient);
10145
+ this.categories = new CategoriesClient(this.httpClient);
10146
+ this.assertionCategories = this.categories;
10119
10147
  this.organizationMembers = new OrganizationMembersClient(this.httpClient);
10120
10148
  this.traces = new TracesClient(this.httpClient);
10121
10149
  this.spans = new SpansClient(this.httpClient);
@@ -12438,6 +12466,7 @@ assertAsyncStorageRegistered();
12438
12466
  BitfabOpenAITracingProcessor,
12439
12467
  BitfabRivetIntegration,
12440
12468
  BitfabVercelAiHandler,
12469
+ CategoriesClient,
12441
12470
  DEFAULT_SERVICE_URL,
12442
12471
  DatasetsClient,
12443
12472
  DbBranchReplayError,