@bitfab/sdk 0.23.3 → 0.24.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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,3 @@
1
- import { Agent, AgentInputItem, RunState, NonStreamRunOptions, RunResult, StreamRunOptions, StreamedRunResult } from '@openai/agents';
2
-
3
1
  /**
4
2
  * BAML execution utilities for the Bitfab TypeScript SDK.
5
3
  * This module provides functions to execute BAML prompts dynamically on the client side.
@@ -457,14 +455,21 @@ declare class BitfabLangGraphCallbackHandler {
457
455
  * Use both together: register the processor once at startup, then call
458
456
  * `handler.wrapRun(agent, input)` instead of `run(agent, input)`.
459
457
  */
460
-
458
+ type AgentLike = any;
459
+ type RunInput = string | unknown[] | Record<string, unknown>;
460
+ type RunOptions = {
461
+ stream?: boolean;
462
+ } & Record<string, unknown>;
463
+ type RunResultLike = {
464
+ finalOutput?: unknown;
465
+ completed?: Promise<void>;
466
+ };
461
467
  type RootSpanOptions = {
462
468
  type: "agent";
463
469
  finalize: (result: unknown) => unknown | Promise<unknown>;
464
470
  };
465
471
  type WithSpanFn = <TArgs extends unknown[], TReturn>(traceFunctionKey: string, options: RootSpanOptions, fn: (...args: TArgs) => TReturn) => (...args: TArgs) => TReturn;
466
472
  type GetActiveSpanContextFn = () => unknown | null;
467
- type RunInput<TContext, TAgent extends Agent<any, any>> = string | AgentInputItem[] | RunState<TContext, TAgent>;
468
473
  /**
469
474
  * OpenAI Agents SDK handler that records a replayable root span around a run.
470
475
  *
@@ -506,8 +511,7 @@ declare class BitfabOpenAIAgentHandler {
506
511
  * be registered: it captures the LLM/tool/handoff spans that nest beneath
507
512
  * this root.
508
513
  */
509
- wrapRun<TAgent extends Agent<any, any>, TContext = undefined>(agent: TAgent, input: RunInput<TContext, TAgent>, options?: NonStreamRunOptions<TContext>): Promise<RunResult<TContext, TAgent>>;
510
- wrapRun<TAgent extends Agent<any, any>, TContext = undefined>(agent: TAgent, input: RunInput<TContext, TAgent>, options: StreamRunOptions<TContext>): Promise<StreamedRunResult<TContext, TAgent>>;
514
+ wrapRun(agent: AgentLike, input: RunInput, options?: RunOptions): Promise<RunResultLike>;
511
515
  }
512
516
 
513
517
  /**
@@ -1370,7 +1374,7 @@ declare class BitfabFunction {
1370
1374
  /**
1371
1375
  * SDK version from package.json (injected at build time)
1372
1376
  */
1373
- declare const __version__ = "0.23.3";
1377
+ declare const __version__ = "0.24.0";
1374
1378
 
1375
1379
  /**
1376
1380
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { Agent, AgentInputItem, RunState, NonStreamRunOptions, RunResult, StreamRunOptions, StreamedRunResult } from '@openai/agents';
2
-
3
1
  /**
4
2
  * BAML execution utilities for the Bitfab TypeScript SDK.
5
3
  * This module provides functions to execute BAML prompts dynamically on the client side.
@@ -457,14 +455,21 @@ declare class BitfabLangGraphCallbackHandler {
457
455
  * Use both together: register the processor once at startup, then call
458
456
  * `handler.wrapRun(agent, input)` instead of `run(agent, input)`.
459
457
  */
460
-
458
+ type AgentLike = any;
459
+ type RunInput = string | unknown[] | Record<string, unknown>;
460
+ type RunOptions = {
461
+ stream?: boolean;
462
+ } & Record<string, unknown>;
463
+ type RunResultLike = {
464
+ finalOutput?: unknown;
465
+ completed?: Promise<void>;
466
+ };
461
467
  type RootSpanOptions = {
462
468
  type: "agent";
463
469
  finalize: (result: unknown) => unknown | Promise<unknown>;
464
470
  };
465
471
  type WithSpanFn = <TArgs extends unknown[], TReturn>(traceFunctionKey: string, options: RootSpanOptions, fn: (...args: TArgs) => TReturn) => (...args: TArgs) => TReturn;
466
472
  type GetActiveSpanContextFn = () => unknown | null;
467
- type RunInput<TContext, TAgent extends Agent<any, any>> = string | AgentInputItem[] | RunState<TContext, TAgent>;
468
473
  /**
469
474
  * OpenAI Agents SDK handler that records a replayable root span around a run.
470
475
  *
@@ -506,8 +511,7 @@ declare class BitfabOpenAIAgentHandler {
506
511
  * be registered: it captures the LLM/tool/handoff spans that nest beneath
507
512
  * this root.
508
513
  */
509
- wrapRun<TAgent extends Agent<any, any>, TContext = undefined>(agent: TAgent, input: RunInput<TContext, TAgent>, options?: NonStreamRunOptions<TContext>): Promise<RunResult<TContext, TAgent>>;
510
- wrapRun<TAgent extends Agent<any, any>, TContext = undefined>(agent: TAgent, input: RunInput<TContext, TAgent>, options: StreamRunOptions<TContext>): Promise<StreamedRunResult<TContext, TAgent>>;
514
+ wrapRun(agent: AgentLike, input: RunInput, options?: RunOptions): Promise<RunResultLike>;
511
515
  }
512
516
 
513
517
  /**
@@ -1370,7 +1374,7 @@ declare class BitfabFunction {
1370
1374
  /**
1371
1375
  * SDK version from package.json (injected at build time)
1372
1376
  */
1373
- declare const __version__ = "0.23.3";
1377
+ declare const __version__ = "0.24.0";
1374
1378
 
1375
1379
  /**
1376
1380
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -14,10 +14,10 @@ import {
14
14
  flushTraces,
15
15
  getCurrentSpan,
16
16
  getCurrentTrace
17
- } from "./chunk-CG6LVLBK.js";
17
+ } from "./chunk-S3PN26RH.js";
18
18
  import {
19
19
  BitfabError
20
- } from "./chunk-EQI6ZJC3.js";
20
+ } from "./chunk-26MUT4IP.js";
21
21
  export {
22
22
  Bitfab,
23
23
  BitfabClaudeAgentHandler,