bitfab 0.54.4 → 0.54.5

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.
@@ -18,7 +18,7 @@ import {
18
18
  serializeValue,
19
19
  toJsonSafe,
20
20
  toJsonSafeReport
21
- } from "./chunk-YO332W7L.js";
21
+ } from "./chunk-3O5MS4XJ.js";
22
22
  import {
23
23
  BitfabError,
24
24
  DEFAULT_SERVICE_URL,
@@ -35,7 +35,7 @@ import {
35
35
  recordCallerTraceMetadata,
36
36
  retireTraceMetadata,
37
37
  warnOnce
38
- } from "./chunk-UJRT3MLT.js";
38
+ } from "./chunk-GVK7AES5.js";
39
39
  import {
40
40
  __privateAdd,
41
41
  __privateGet,
@@ -76,45 +76,6 @@ var AssertionCategoriesClient = class {
76
76
  }
77
77
  };
78
78
 
79
- // src/assertions.ts
80
- var ASSERTIONS_PATH = "/api/sdk/traces/assertions";
81
- function traceAssertionsPath(traceId, suffix = "") {
82
- return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
83
- }
84
- var TracesClient = class {
85
- constructor(httpClient) {
86
- this.httpClient = httpClient;
87
- }
88
- async getAssertions(traceId) {
89
- return this.httpClient.get(
90
- traceAssertionsPath(traceId)
91
- );
92
- }
93
- async saveAssertions(params) {
94
- return this.saveAssertionsAll({
95
- updates: [{ traceId: params.traceId, assertions: params.assertions }],
96
- source: params.source
97
- });
98
- }
99
- async saveAssertionsAll(params) {
100
- if (params.updates.length === 0) {
101
- return [];
102
- }
103
- const response = await this.httpClient.request(ASSERTIONS_PATH, {
104
- updates: params.updates,
105
- source: params.source ?? "agent"
106
- });
107
- return response.assertions;
108
- }
109
- async archiveAssertions(params) {
110
- const response = await this.httpClient.request(
111
- traceAssertionsPath(params.traceId, "/archive"),
112
- { assertionIds: params.assertionIds }
113
- );
114
- return response.archived;
115
- }
116
- };
117
-
118
79
  // src/processorPayload.ts
119
80
  var SERIALIZATION_DEGRADED_STEP = "serialization_degraded";
120
81
  function degradedError(dropped) {
@@ -2545,6 +2506,55 @@ var StreamFinalizationError = class extends Error {
2545
2506
  }
2546
2507
  };
2547
2508
 
2509
+ // src/traces.ts
2510
+ var ASSERTIONS_PATH = "/api/sdk/traces/assertions";
2511
+ var SEARCH_PATH = "/api/sdk/traces/search";
2512
+ function traceAssertionsPath(traceId, suffix = "") {
2513
+ return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
2514
+ }
2515
+ var TracesClient = class {
2516
+ constructor(httpClient) {
2517
+ this.httpClient = httpClient;
2518
+ }
2519
+ /**
2520
+ * Search traces by exact caller metadata.
2521
+ *
2522
+ * Keys and values are matched case-insensitively. Up to 10 supplied pairs
2523
+ * must match. Use `nextCursor` from the result to fetch another page.
2524
+ */
2525
+ async search(params) {
2526
+ return this.httpClient.request(SEARCH_PATH, params);
2527
+ }
2528
+ async getAssertions(traceId) {
2529
+ return this.httpClient.get(
2530
+ traceAssertionsPath(traceId)
2531
+ );
2532
+ }
2533
+ async saveAssertions(params) {
2534
+ return this.saveAssertionsAll({
2535
+ updates: [{ traceId: params.traceId, assertions: params.assertions }],
2536
+ source: params.source
2537
+ });
2538
+ }
2539
+ async saveAssertionsAll(params) {
2540
+ if (params.updates.length === 0) {
2541
+ return [];
2542
+ }
2543
+ const response = await this.httpClient.request(ASSERTIONS_PATH, {
2544
+ updates: params.updates,
2545
+ source: params.source ?? "agent"
2546
+ });
2547
+ return response.assertions;
2548
+ }
2549
+ async archiveAssertions(params) {
2550
+ const response = await this.httpClient.request(
2551
+ traceAssertionsPath(params.traceId, "/archive"),
2552
+ { assertionIds: params.assertionIds }
2553
+ );
2554
+ return response.archived;
2555
+ }
2556
+ };
2557
+
2548
2558
  // src/tracing.ts
2549
2559
  var BitfabOpenAITracingProcessor = class {
2550
2560
  /**
@@ -5167,7 +5177,7 @@ var Bitfab = class {
5167
5177
  await runWithSeedContext({ traceId }, async () => target(...args));
5168
5178
  } finally {
5169
5179
  try {
5170
- const { flushTraces: flushTraces2 } = await import("./http-72OO3GAV.js");
5180
+ const { flushTraces: flushTraces2 } = await import("./http-RW2JO6TU.js");
5171
5181
  await flushTraces2(3e4);
5172
5182
  } finally {
5173
5183
  unrecorded = activeTraceStates.delete(traceId);
@@ -5226,7 +5236,7 @@ var Bitfab = class {
5226
5236
  `Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
5227
5237
  );
5228
5238
  }
5229
- const { replay: doReplay } = await import("./replay-2VG6C4O4.js");
5239
+ const { replay: doReplay } = await import("./replay-MHYULXCH.js");
5230
5240
  return doReplay(
5231
5241
  this.httpClient,
5232
5242
  this.serviceUrl,
@@ -5510,7 +5520,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
5510
5520
  sessionId: seedCase.sessionId
5511
5521
  })
5512
5522
  );
5513
- const { flushTraces: flushTraces2 } = await import("./http-72OO3GAV.js");
5523
+ const { flushTraces: flushTraces2 } = await import("./http-RW2JO6TU.js");
5514
5524
  await flushTraces2(3e4);
5515
5525
  return { pipeline, traceFunctionKey, traceIds };
5516
5526
  }
@@ -5527,7 +5537,6 @@ function resolveTraceFunctionKey(registration) {
5527
5537
 
5528
5538
  export {
5529
5539
  AssertionCategoriesClient,
5530
- TracesClient,
5531
5540
  BitfabClaudeAgentHandler,
5532
5541
  DatasetsClient,
5533
5542
  SUPPORTED_PROVIDERS,
@@ -5536,6 +5545,7 @@ export {
5536
5545
  BitfabLangGraphCallbackHandler,
5537
5546
  BitfabLangGraphIntegration,
5538
5547
  BitfabOpenAIAgentHandler,
5548
+ TracesClient,
5539
5549
  BitfabOpenAITracingProcessor,
5540
5550
  BitfabVercelAiHandler,
5541
5551
  getCurrentSpan,
@@ -5548,4 +5558,4 @@ export {
5548
5558
  reseedFromRegistry,
5549
5559
  seedFromRegistry
5550
5560
  };
5551
- //# sourceMappingURL=chunk-WFNCKWDC.js.map
5561
+ //# sourceMappingURL=chunk-NATC7L2W.js.map