bitfab 0.23.2 → 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/{chunk-EQI6ZJC3.js → chunk-26MUT4IP.js} +57 -2
- package/dist/chunk-26MUT4IP.js.map +1 -0
- package/dist/{chunk-PP5K6RIU.js → chunk-S3PN26RH.js} +322 -206
- package/dist/chunk-S3PN26RH.js.map +1 -0
- package/dist/index.cjs +393 -205
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -8
- package/dist/index.d.ts +24 -8
- package/dist/index.js +2 -2
- package/dist/node.cjs +393 -205
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +0 -1
- package/dist/node.d.ts +0 -1
- package/dist/node.js +2 -2
- package/dist/{replay-V6RPJYXZ.js → replay-CQIU2ITL.js} +4 -3
- package/dist/replay-CQIU2ITL.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-EQI6ZJC3.js.map +0 -1
- package/dist/chunk-PP5K6RIU.js.map +0 -1
- package/dist/replay-V6RPJYXZ.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Agent, AgentInputItem, RunState, NonStreamRunOptions, RunResult, StreamRunOptions, StreamedRunResult, Trace, Span } 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
|
|
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
|
/**
|
|
@@ -708,7 +712,19 @@ interface ReplayResult<T> {
|
|
|
708
712
|
* This module provides utilities for sending external traces (e.g., from OpenAI API calls)
|
|
709
713
|
* to Bitfab for monitoring and analysis.
|
|
710
714
|
*/
|
|
711
|
-
|
|
715
|
+
interface Trace {
|
|
716
|
+
traceId: string;
|
|
717
|
+
toJSON(): unknown;
|
|
718
|
+
}
|
|
719
|
+
interface Span<_T = any> {
|
|
720
|
+
traceId?: string;
|
|
721
|
+
toJSON(): unknown;
|
|
722
|
+
spanData?: {
|
|
723
|
+
type?: string;
|
|
724
|
+
_input?: unknown;
|
|
725
|
+
_response?: unknown;
|
|
726
|
+
} | null;
|
|
727
|
+
}
|
|
712
728
|
interface TraceResponse {
|
|
713
729
|
traceId: string;
|
|
714
730
|
status: "success";
|
|
@@ -1358,7 +1374,7 @@ declare class BitfabFunction {
|
|
|
1358
1374
|
/**
|
|
1359
1375
|
* SDK version from package.json (injected at build time)
|
|
1360
1376
|
*/
|
|
1361
|
-
declare const __version__ = "0.
|
|
1377
|
+
declare const __version__ = "0.24.0";
|
|
1362
1378
|
|
|
1363
1379
|
/**
|
|
1364
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, Trace, Span } 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
|
|
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
|
/**
|
|
@@ -708,7 +712,19 @@ interface ReplayResult<T> {
|
|
|
708
712
|
* This module provides utilities for sending external traces (e.g., from OpenAI API calls)
|
|
709
713
|
* to Bitfab for monitoring and analysis.
|
|
710
714
|
*/
|
|
711
|
-
|
|
715
|
+
interface Trace {
|
|
716
|
+
traceId: string;
|
|
717
|
+
toJSON(): unknown;
|
|
718
|
+
}
|
|
719
|
+
interface Span<_T = any> {
|
|
720
|
+
traceId?: string;
|
|
721
|
+
toJSON(): unknown;
|
|
722
|
+
spanData?: {
|
|
723
|
+
type?: string;
|
|
724
|
+
_input?: unknown;
|
|
725
|
+
_response?: unknown;
|
|
726
|
+
} | null;
|
|
727
|
+
}
|
|
712
728
|
interface TraceResponse {
|
|
713
729
|
traceId: string;
|
|
714
730
|
status: "success";
|
|
@@ -1358,7 +1374,7 @@ declare class BitfabFunction {
|
|
|
1358
1374
|
/**
|
|
1359
1375
|
* SDK version from package.json (injected at build time)
|
|
1360
1376
|
*/
|
|
1361
|
-
declare const __version__ = "0.
|
|
1377
|
+
declare const __version__ = "0.24.0";
|
|
1362
1378
|
|
|
1363
1379
|
/**
|
|
1364
1380
|
* Constants for the Bitfab SDK.
|
package/dist/index.js
CHANGED
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
flushTraces,
|
|
24
24
|
getCurrentSpan,
|
|
25
25
|
getCurrentTrace
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-S3PN26RH.js";
|
|
27
27
|
import {
|
|
28
28
|
BitfabError
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-26MUT4IP.js";
|
|
30
30
|
export {
|
|
31
31
|
Bitfab,
|
|
32
32
|
BitfabClaudeAgentHandler,
|