bitfab 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
@@ -326,9 +326,12 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options) {
326
326
  }
327
327
  }
328
328
  if (options?.limit !== void 0 && options?.traceIds !== void 0) {
329
- throw new BitfabError(
330
- "Pass either limit or traceIds, not both: an explicit trace ID list already determines how many traces replay."
331
- );
329
+ try {
330
+ console.warn(
331
+ "Bitfab: limit is ignored when traceIds is passed: the explicit trace ID list already determines how many traces replay."
332
+ );
333
+ } catch {
334
+ }
332
335
  }
333
336
  await replayContextReady;
334
337
  const {
@@ -425,6 +428,7 @@ __export(index_exports, {
425
428
  BitfabClaudeAgentHandler: () => BitfabClaudeAgentHandler,
426
429
  BitfabError: () => BitfabError,
427
430
  BitfabFunction: () => BitfabFunction,
431
+ BitfabLangChainCallbackHandler: () => BitfabLangGraphCallbackHandler,
428
432
  BitfabLangGraphCallbackHandler: () => BitfabLangGraphCallbackHandler,
429
433
  BitfabOpenAITracingProcessor: () => BitfabOpenAITracingProcessor,
430
434
  DEFAULT_SERVICE_URL: () => DEFAULT_SERVICE_URL,
@@ -438,7 +442,7 @@ __export(index_exports, {
438
442
  module.exports = __toCommonJS(index_exports);
439
443
 
440
444
  // src/version.generated.ts
441
- var __version__ = "0.16.0";
445
+ var __version__ = "0.16.2";
442
446
 
443
447
  // src/constants.ts
444
448
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -2725,6 +2729,24 @@ var Bitfab = class {
2725
2729
  }
2726
2730
  });
2727
2731
  }
2732
+ /**
2733
+ * Get a LangChain callback handler for tracing.
2734
+ *
2735
+ * Alias of {@link getLangGraphCallbackHandler}: LangChain chains and
2736
+ * LangGraph graphs share the same callback system, so one handler serves
2737
+ * both.
2738
+ *
2739
+ * ```typescript
2740
+ * const handler = client.getLangChainCallbackHandler("my-chain");
2741
+ * const result = await chain.invoke(input, { callbacks: [handler] });
2742
+ * ```
2743
+ *
2744
+ * @param traceFunctionKey - Groups traces under this key in Bitfab
2745
+ * @returns A BitfabLangGraphCallbackHandler configured for this client
2746
+ */
2747
+ getLangChainCallbackHandler(traceFunctionKey) {
2748
+ return this.getLangGraphCallbackHandler(traceFunctionKey);
2749
+ }
2728
2750
  /**
2729
2751
  * Get a Claude Agent SDK handler for tracing.
2730
2752
  *
@@ -3228,9 +3250,9 @@ var Bitfab = class {
3228
3250
  *
3229
3251
  * @param traceFunctionKey - The trace function key to replay
3230
3252
  * @param fn - The function to replay (must be the return value of `withSpan`)
3231
- * @param options - Optional replay options. `limit` and `traceIds` are
3232
- * mutually exclusive an explicit ID list already determines how many
3233
- * traces replay, so passing both throws a BitfabError.
3253
+ * @param options - Optional replay options. When `traceIds` is passed,
3254
+ * `limit` is ignored (with a warning): an explicit ID list already
3255
+ * determines how many traces replay.
3234
3256
  * @returns ReplayResult with items, testRunId, and testRunUrl
3235
3257
  */
3236
3258
  async replay(traceFunctionKey, fn, options) {
@@ -3304,6 +3326,7 @@ var BitfabFunction = class {
3304
3326
  BitfabClaudeAgentHandler,
3305
3327
  BitfabError,
3306
3328
  BitfabFunction,
3329
+ BitfabLangChainCallbackHandler,
3307
3330
  BitfabLangGraphCallbackHandler,
3308
3331
  BitfabOpenAITracingProcessor,
3309
3332
  DEFAULT_SERVICE_URL,