@bitfab/sdk 0.23.2 → 0.23.3

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.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Agent, AgentInputItem, RunState, NonStreamRunOptions, RunResult, StreamRunOptions, StreamedRunResult, Trace, Span } from '@openai/agents';
1
+ import { Agent, AgentInputItem, RunState, NonStreamRunOptions, RunResult, StreamRunOptions, StreamedRunResult } from '@openai/agents';
2
2
 
3
3
  /**
4
4
  * BAML execution utilities for the Bitfab TypeScript SDK.
@@ -708,7 +708,19 @@ interface ReplayResult<T> {
708
708
  * This module provides utilities for sending external traces (e.g., from OpenAI API calls)
709
709
  * to Bitfab for monitoring and analysis.
710
710
  */
711
-
711
+ interface Trace {
712
+ traceId: string;
713
+ toJSON(): unknown;
714
+ }
715
+ interface Span<_T = any> {
716
+ traceId?: string;
717
+ toJSON(): unknown;
718
+ spanData?: {
719
+ type?: string;
720
+ _input?: unknown;
721
+ _response?: unknown;
722
+ } | null;
723
+ }
712
724
  interface TraceResponse {
713
725
  traceId: string;
714
726
  status: "success";
@@ -1358,7 +1370,7 @@ declare class BitfabFunction {
1358
1370
  /**
1359
1371
  * SDK version from package.json (injected at build time)
1360
1372
  */
1361
- declare const __version__ = "0.23.2";
1373
+ declare const __version__ = "0.23.3";
1362
1374
 
1363
1375
  /**
1364
1376
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Agent, AgentInputItem, RunState, NonStreamRunOptions, RunResult, StreamRunOptions, StreamedRunResult, Trace, Span } from '@openai/agents';
1
+ import { Agent, AgentInputItem, RunState, NonStreamRunOptions, RunResult, StreamRunOptions, StreamedRunResult } from '@openai/agents';
2
2
 
3
3
  /**
4
4
  * BAML execution utilities for the Bitfab TypeScript SDK.
@@ -708,7 +708,19 @@ interface ReplayResult<T> {
708
708
  * This module provides utilities for sending external traces (e.g., from OpenAI API calls)
709
709
  * to Bitfab for monitoring and analysis.
710
710
  */
711
-
711
+ interface Trace {
712
+ traceId: string;
713
+ toJSON(): unknown;
714
+ }
715
+ interface Span<_T = any> {
716
+ traceId?: string;
717
+ toJSON(): unknown;
718
+ spanData?: {
719
+ type?: string;
720
+ _input?: unknown;
721
+ _response?: unknown;
722
+ } | null;
723
+ }
712
724
  interface TraceResponse {
713
725
  traceId: string;
714
726
  status: "success";
@@ -1358,7 +1370,7 @@ declare class BitfabFunction {
1358
1370
  /**
1359
1371
  * SDK version from package.json (injected at build time)
1360
1372
  */
1361
- declare const __version__ = "0.23.2";
1373
+ declare const __version__ = "0.23.3";
1362
1374
 
1363
1375
  /**
1364
1376
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  flushTraces,
15
15
  getCurrentSpan,
16
16
  getCurrentTrace
17
- } from "./chunk-PP5K6RIU.js";
17
+ } from "./chunk-CG6LVLBK.js";
18
18
  import {
19
19
  BitfabError
20
20
  } from "./chunk-EQI6ZJC3.js";
package/dist/node.cjs CHANGED
@@ -506,7 +506,7 @@ registerAsyncLocalStorageClass(
506
506
  );
507
507
 
508
508
  // src/version.generated.ts
509
- var __version__ = "0.23.2";
509
+ var __version__ = "0.23.3";
510
510
 
511
511
  // src/constants.ts
512
512
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -1447,6 +1447,16 @@ var BitfabClaudeAgentHandler = class {
1447
1447
  // src/client.ts
1448
1448
  init_asyncStorage();
1449
1449
 
1450
+ // src/optionalPeer.ts
1451
+ function importOptionalPeer(specifierParts) {
1452
+ const specifier = specifierParts.join("/");
1453
+ return import(
1454
+ /* webpackIgnore: true */
1455
+ /* @vite-ignore */
1456
+ specifier
1457
+ );
1458
+ }
1459
+
1450
1460
  // src/baml.ts
1451
1461
  var cachedBaml = null;
1452
1462
  async function loadBaml() {
@@ -1454,7 +1464,7 @@ async function loadBaml() {
1454
1464
  return cachedBaml;
1455
1465
  }
1456
1466
  try {
1457
- cachedBaml = await import("@boundaryml/baml");
1467
+ cachedBaml = await importOptionalPeer(["@boundaryml", "baml"]);
1458
1468
  return cachedBaml;
1459
1469
  } catch {
1460
1470
  throw new Error(
@@ -2297,7 +2307,10 @@ var BitfabOpenAIAgentHandler = class {
2297
2307
  this.getActiveSpanContext = config.getActiveSpanContext;
2298
2308
  }
2299
2309
  async wrapRun(agent, input, options) {
2300
- const { run } = await import("@openai/agents");
2310
+ const { run } = await importOptionalPeer([
2311
+ "@openai",
2312
+ "agents"
2313
+ ]);
2301
2314
  if (this.getActiveSpanContext?.() != null) {
2302
2315
  return run(
2303
2316
  agent,
@@ -2848,7 +2861,10 @@ async function loadCollectorClass() {
2848
2861
  return cachedCollectorClass;
2849
2862
  }
2850
2863
  try {
2851
- const baml = await import("@boundaryml/baml");
2864
+ const baml = await importOptionalPeer([
2865
+ "@boundaryml",
2866
+ "baml"
2867
+ ]);
2852
2868
  cachedCollectorClass = baml.Collector;
2853
2869
  return cachedCollectorClass;
2854
2870
  } catch {