@bitfab/sdk 0.16.0 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -317,9 +317,12 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
317
317
  }
318
318
  }
319
319
  if (options?.limit !== void 0 && options?.traceIds !== void 0) {
320
- throw new BitfabError(
321
- "Pass either limit or traceIds, not both: an explicit trace ID list already determines how many traces replay."
322
- );
320
+ try {
321
+ console.warn(
322
+ "Bitfab: limit is ignored when traceIds is passed: the explicit trace ID list already determines how many traces replay."
323
+ );
324
+ } catch {
325
+ }
323
326
  }
324
327
  await replayContextReady;
325
328
  const {
@@ -416,6 +419,7 @@ __export(index_exports, {
416
419
  BitfabClaudeAgentHandler: () => BitfabClaudeAgentHandler,
417
420
  BitfabError: () => BitfabError,
418
421
  BitfabFunction: () => BitfabFunction,
422
+ BitfabLangChainCallbackHandler: () => BitfabLangGraphCallbackHandler,
419
423
  BitfabLangGraphCallbackHandler: () => BitfabLangGraphCallbackHandler,
420
424
  BitfabOpenAITracingProcessor: () => BitfabOpenAITracingProcessor,
421
425
  DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
@@ -429,7 +433,7 @@ __export(index_exports, {
429
433
  module.exports = __toCommonJS(index_exports);
430
434
 
431
435
  // src/version.generated.ts
432
- var __version__ = "0.16.0";
436
+ var __version__ = "0.16.2";
433
437
 
434
438
  // src/constants.ts
435
439
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -2716,6 +2720,24 @@ var Bitfab = class {
2716
2720
  }
2717
2721
  });
2718
2722
  }
2723
+ /**
2724
+ * Get a LangChain callback handler for tracing.
2725
+ *
2726
+ * Alias of {@link getLangGraphCallbackHandler}: LangChain chains and
2727
+ * LangGraph graphs share the same callback system, so one handler serves
2728
+ * both.
2729
+ *
2730
+ * ```typescript
2731
+ * const handler = client.getLangChainCallbackHandler("my-chain");
2732
+ * const result = await chain.invoke(input, { callbacks: [handler] });
2733
+ * ```
2734
+ *
2735
+ * @param traceFunctionKey - Groups traces under this key in Bitfab
2736
+ * @returns A BitfabLangGraphCallbackHandler configured for this client
2737
+ */
2738
+ getLangChainCallbackHandler(traceFunctionKey) {
2739
+ return this.getLangGraphCallbackHandler(traceFunctionKey);
2740
+ }
2719
2741
  /**
2720
2742
  * Get a Claude Agent SDK handler for tracing.
2721
2743
  *
@@ -3219,9 +3241,9 @@ var Bitfab = class {
3219
3241
  *
3220
3242
  * @param traceFunctionKey - The trace function key to replay
3221
3243
  * @param fn - The function to replay (must be the return value of `withSpan`)
3222
- * @param options - Optional replay options. `limit` and `traceIds` are
3223
- * mutually exclusive an explicit ID list already determines how many
3224
- * traces replay, so passing both throws a BitfabError.
3244
+ * @param options - Optional replay options. When `traceIds` is passed,
3245
+ * `limit` is ignored (with a warning): an explicit ID list already
3246
+ * determines how many traces replay.
3225
3247
  * @returns ReplayResult with items, testRunId, and testRunUrl
3226
3248
  */
3227
3249
  async replay(traceFunctionKey, fn, options) {
@@ -3295,6 +3317,7 @@ var BitfabFunction = class {
3295
3317
  BitfabClaudeAgentHandler,
3296
3318
  BitfabError,
3297
3319
  BitfabFunction,
3320
+ BitfabLangChainCallbackHandler,
3298
3321
  BitfabLangGraphCallbackHandler,
3299
3322
  BitfabOpenAITracingProcessor,
3300
3323
  DEFAULT_SERVICE_URL,