bitfab 0.53.0 → 0.53.1
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-6IMGAODW.js → chunk-ASMHSKFS.js} +542 -32
- package/dist/chunk-ASMHSKFS.js.map +1 -0
- package/dist/{chunk-SJKWUQ3G.js → chunk-MMT5MWG5.js} +2 -2
- package/dist/{chunk-SCXR43UF.js → chunk-ZCOZHNAA.js} +101 -42
- package/dist/chunk-ZCOZHNAA.js.map +1 -0
- package/dist/{chunk-DTC6SIXW.js → chunk-ZEGNMZU7.js} +3 -3
- package/dist/{chunk-CBRO6BP7.js → chunk-ZNY2HZT3.js} +141 -29
- package/dist/chunk-ZNY2HZT3.js.map +1 -0
- package/dist/{http-SEN3PUXX.js → http-2OOKOZQ3.js} +2 -2
- package/dist/{http-KP7DVTOD.js → http-7QLUPC6F.js} +2 -2
- package/dist/index.cjs +681 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -8
- package/dist/index.d.ts +25 -8
- package/dist/index.js +3 -3
- package/dist/node.cjs +681 -88
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +3 -3
- package/dist/{replay-Y5RIJOWE.js → replay-KJKIGXRH.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-6IMGAODW.js.map +0 -1
- package/dist/chunk-CBRO6BP7.js.map +0 -1
- package/dist/chunk-SCXR43UF.js.map +0 -1
- /package/dist/{chunk-SJKWUQ3G.js.map → chunk-MMT5MWG5.js.map} +0 -0
- /package/dist/{chunk-DTC6SIXW.js.map → chunk-ZEGNMZU7.js.map} +0 -0
- /package/dist/{http-KP7DVTOD.js.map → http-2OOKOZQ3.js.map} +0 -0
- /package/dist/{http-SEN3PUXX.js.map → http-7QLUPC6F.js.map} +0 -0
- /package/dist/{replay-Y5RIJOWE.js.map → replay-KJKIGXRH.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -317,6 +317,16 @@ interface ReplayContext {
|
|
|
317
317
|
dbSnapshotAccessed?: boolean;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
+
interface SimulationPlanNode {
|
|
321
|
+
traceFunctionKey: string;
|
|
322
|
+
name: string;
|
|
323
|
+
captureContent: boolean;
|
|
324
|
+
}
|
|
325
|
+
interface SimulationPlanResponse {
|
|
326
|
+
nodes: SimulationPlanNode[];
|
|
327
|
+
}
|
|
328
|
+
type SimulationPlanSubmit = (payload: Record<string, unknown>) => void;
|
|
329
|
+
|
|
320
330
|
/**
|
|
321
331
|
* HTTP client utilities for Bitfab API requests.
|
|
322
332
|
*
|
|
@@ -399,6 +409,10 @@ declare class HttpClient {
|
|
|
399
409
|
private readonly deferredWork;
|
|
400
410
|
private closed;
|
|
401
411
|
private closing;
|
|
412
|
+
externalSpanTransform: ((payload: Record<string, unknown>, submit: SimulationPlanSubmit) => void) | undefined;
|
|
413
|
+
externalTraceTransform: ((payload: Record<string, unknown>, submit: SimulationPlanSubmit) => void) | undefined;
|
|
414
|
+
releaseHeldExternalSpans: ((timeoutMs: number) => Promise<void>) | undefined;
|
|
415
|
+
stopSimulationPlan: (() => void) | undefined;
|
|
402
416
|
constructor(config: HttpClientConfig);
|
|
403
417
|
/**
|
|
404
418
|
* Resolve the API key at the moment it is needed (request time), invoking
|
|
@@ -511,25 +525,21 @@ declare class HttpClient {
|
|
|
511
525
|
*/
|
|
512
526
|
lookupFunction<T>(name: string): Promise<T>;
|
|
513
527
|
getAutoTracePolicy<T>(traceFunctionKey: string, protocol: string): Promise<T>;
|
|
528
|
+
getSimulationPlan(): Promise<SimulationPlanResponse>;
|
|
514
529
|
getTraceSpan(traceId: string, lookup: SpanLookup): Promise<CapturedSpan | null>;
|
|
515
530
|
/**
|
|
516
531
|
* GET a JSON endpoint on the service with the client's API key. Throws a
|
|
517
532
|
* `BitfabError` carrying the status text for any non-2xx response.
|
|
518
533
|
*/
|
|
519
|
-
get<T>(endpoint: string): Promise<T>;
|
|
534
|
+
get<T>(endpoint: string, timeoutMs?: number, extraHeaders?: Record<string, string>): Promise<T>;
|
|
520
535
|
/**
|
|
521
536
|
* Queue an internal trace (from local BAML execution via `call()`) onto this
|
|
522
537
|
* client's batching transport. `functionId` moves into the payload because
|
|
523
538
|
* the OTLP carrier has no path to carry it.
|
|
524
539
|
*/
|
|
525
540
|
sendInternalTrace(functionId: string, payload: Record<string, unknown>): void;
|
|
526
|
-
/**
|
|
527
|
-
* Queue an external span (from withSpan wrapper or OpenAI tracing) onto this
|
|
528
|
-
* client's batching transport. Fire-and-forget: the transport owns delivery,
|
|
529
|
-
* so callers await `flushTraces()` or `close()` rather than a per-span
|
|
530
|
-
* promise.
|
|
531
|
-
*/
|
|
532
541
|
sendExternalSpan(payload: Record<string, unknown>): void;
|
|
542
|
+
submitExternalSpan(payload: Record<string, unknown>): void;
|
|
533
543
|
/**
|
|
534
544
|
* Queue an external trace completion (from OpenAI tracing) onto this
|
|
535
545
|
* client's batching transport. Fire-and-forget for the same reason as
|
|
@@ -537,6 +547,7 @@ declare class HttpClient {
|
|
|
537
547
|
* server-authoritative barrier in `replay.ts`, not by awaiting this call.
|
|
538
548
|
*/
|
|
539
549
|
sendExternalTrace(rawPayload: Record<string, unknown>): void;
|
|
550
|
+
submitExternalTrace(payload: Record<string, unknown>): void;
|
|
540
551
|
/**
|
|
541
552
|
* Partial update of an existing trace identified by its Bitfab trace ID.
|
|
542
553
|
* Used by the detached `client.getTrace(id)` handle.
|
|
@@ -1069,6 +1080,7 @@ type LlmSpanOptions = {
|
|
|
1069
1080
|
type: "llm";
|
|
1070
1081
|
finalize: (result: unknown) => unknown | Promise<unknown>;
|
|
1071
1082
|
surface: "inherit";
|
|
1083
|
+
instrumentation: "vercel-ai";
|
|
1072
1084
|
};
|
|
1073
1085
|
type WithSpanFn$1 = <TArgs extends unknown[], TReturn>(traceFunctionKey: string, options: LlmSpanOptions, fn: (...args: TArgs) => TReturn) => (...args: TArgs) => TReturn;
|
|
1074
1086
|
/**
|
|
@@ -1473,6 +1485,7 @@ interface SpanClient {
|
|
|
1473
1485
|
mockOnReplay?: boolean;
|
|
1474
1486
|
finalize?: (result: unknown) => unknown | Promise<unknown>;
|
|
1475
1487
|
surface?: "inherit";
|
|
1488
|
+
instrumentation?: "langgraph";
|
|
1476
1489
|
}, fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
1477
1490
|
}
|
|
1478
1491
|
interface LangGraphTool {
|
|
@@ -1580,6 +1593,7 @@ type RootSpanOptions = {
|
|
|
1580
1593
|
type: "agent";
|
|
1581
1594
|
finalize: (result: unknown) => unknown | Promise<unknown>;
|
|
1582
1595
|
surface: "inherit";
|
|
1596
|
+
instrumentation: "openai-agents";
|
|
1583
1597
|
};
|
|
1584
1598
|
type WithSpanFn = <TArgs extends unknown[], TReturn>(traceFunctionKey: string, options: RootSpanOptions, fn: (...args: TArgs) => TReturn) => (...args: TArgs) => TReturn;
|
|
1585
1599
|
type GetActiveSpanContextFn = () => unknown | null;
|
|
@@ -2522,6 +2536,7 @@ interface BitfabConfig {
|
|
|
2522
2536
|
* a branch materialized from that point.
|
|
2523
2537
|
*/
|
|
2524
2538
|
dbSnapshot?: DbSnapshotConfig;
|
|
2539
|
+
simulationPlan?: boolean;
|
|
2525
2540
|
}
|
|
2526
2541
|
/**
|
|
2527
2542
|
* Span types matching the backend enum.
|
|
@@ -2675,6 +2690,7 @@ declare class Bitfab {
|
|
|
2675
2690
|
private readonly bamlClient;
|
|
2676
2691
|
private readonly dbSnapshot;
|
|
2677
2692
|
private readonly autoTracePolicyRefreshes;
|
|
2693
|
+
private readonly simulationPlan;
|
|
2678
2694
|
/**
|
|
2679
2695
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
2680
2696
|
* to every `replay` on this client (after any per-call `mockOverride`). In
|
|
@@ -2750,6 +2766,7 @@ declare class Bitfab {
|
|
|
2750
2766
|
private resolveNodeConfiguration;
|
|
2751
2767
|
private createAutoTraceNode;
|
|
2752
2768
|
private createAutoTraceRoot;
|
|
2769
|
+
private applySimulationPlan;
|
|
2753
2770
|
private refreshAutoTraceCapturePolicy;
|
|
2754
2771
|
/**
|
|
2755
2772
|
* Flush and permanently close this client's tracing resources: its pending
|
|
@@ -3326,7 +3343,7 @@ interface CommitRef {
|
|
|
3326
3343
|
/**
|
|
3327
3344
|
* SDK version from package.json (injected at build time)
|
|
3328
3345
|
*/
|
|
3329
|
-
declare const __version__ = "0.53.
|
|
3346
|
+
declare const __version__ = "0.53.1";
|
|
3330
3347
|
|
|
3331
3348
|
/**
|
|
3332
3349
|
* Constants for the Bitfab SDK.
|
package/dist/index.d.ts
CHANGED
|
@@ -317,6 +317,16 @@ interface ReplayContext {
|
|
|
317
317
|
dbSnapshotAccessed?: boolean;
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
+
interface SimulationPlanNode {
|
|
321
|
+
traceFunctionKey: string;
|
|
322
|
+
name: string;
|
|
323
|
+
captureContent: boolean;
|
|
324
|
+
}
|
|
325
|
+
interface SimulationPlanResponse {
|
|
326
|
+
nodes: SimulationPlanNode[];
|
|
327
|
+
}
|
|
328
|
+
type SimulationPlanSubmit = (payload: Record<string, unknown>) => void;
|
|
329
|
+
|
|
320
330
|
/**
|
|
321
331
|
* HTTP client utilities for Bitfab API requests.
|
|
322
332
|
*
|
|
@@ -399,6 +409,10 @@ declare class HttpClient {
|
|
|
399
409
|
private readonly deferredWork;
|
|
400
410
|
private closed;
|
|
401
411
|
private closing;
|
|
412
|
+
externalSpanTransform: ((payload: Record<string, unknown>, submit: SimulationPlanSubmit) => void) | undefined;
|
|
413
|
+
externalTraceTransform: ((payload: Record<string, unknown>, submit: SimulationPlanSubmit) => void) | undefined;
|
|
414
|
+
releaseHeldExternalSpans: ((timeoutMs: number) => Promise<void>) | undefined;
|
|
415
|
+
stopSimulationPlan: (() => void) | undefined;
|
|
402
416
|
constructor(config: HttpClientConfig);
|
|
403
417
|
/**
|
|
404
418
|
* Resolve the API key at the moment it is needed (request time), invoking
|
|
@@ -511,25 +525,21 @@ declare class HttpClient {
|
|
|
511
525
|
*/
|
|
512
526
|
lookupFunction<T>(name: string): Promise<T>;
|
|
513
527
|
getAutoTracePolicy<T>(traceFunctionKey: string, protocol: string): Promise<T>;
|
|
528
|
+
getSimulationPlan(): Promise<SimulationPlanResponse>;
|
|
514
529
|
getTraceSpan(traceId: string, lookup: SpanLookup): Promise<CapturedSpan | null>;
|
|
515
530
|
/**
|
|
516
531
|
* GET a JSON endpoint on the service with the client's API key. Throws a
|
|
517
532
|
* `BitfabError` carrying the status text for any non-2xx response.
|
|
518
533
|
*/
|
|
519
|
-
get<T>(endpoint: string): Promise<T>;
|
|
534
|
+
get<T>(endpoint: string, timeoutMs?: number, extraHeaders?: Record<string, string>): Promise<T>;
|
|
520
535
|
/**
|
|
521
536
|
* Queue an internal trace (from local BAML execution via `call()`) onto this
|
|
522
537
|
* client's batching transport. `functionId` moves into the payload because
|
|
523
538
|
* the OTLP carrier has no path to carry it.
|
|
524
539
|
*/
|
|
525
540
|
sendInternalTrace(functionId: string, payload: Record<string, unknown>): void;
|
|
526
|
-
/**
|
|
527
|
-
* Queue an external span (from withSpan wrapper or OpenAI tracing) onto this
|
|
528
|
-
* client's batching transport. Fire-and-forget: the transport owns delivery,
|
|
529
|
-
* so callers await `flushTraces()` or `close()` rather than a per-span
|
|
530
|
-
* promise.
|
|
531
|
-
*/
|
|
532
541
|
sendExternalSpan(payload: Record<string, unknown>): void;
|
|
542
|
+
submitExternalSpan(payload: Record<string, unknown>): void;
|
|
533
543
|
/**
|
|
534
544
|
* Queue an external trace completion (from OpenAI tracing) onto this
|
|
535
545
|
* client's batching transport. Fire-and-forget for the same reason as
|
|
@@ -537,6 +547,7 @@ declare class HttpClient {
|
|
|
537
547
|
* server-authoritative barrier in `replay.ts`, not by awaiting this call.
|
|
538
548
|
*/
|
|
539
549
|
sendExternalTrace(rawPayload: Record<string, unknown>): void;
|
|
550
|
+
submitExternalTrace(payload: Record<string, unknown>): void;
|
|
540
551
|
/**
|
|
541
552
|
* Partial update of an existing trace identified by its Bitfab trace ID.
|
|
542
553
|
* Used by the detached `client.getTrace(id)` handle.
|
|
@@ -1069,6 +1080,7 @@ type LlmSpanOptions = {
|
|
|
1069
1080
|
type: "llm";
|
|
1070
1081
|
finalize: (result: unknown) => unknown | Promise<unknown>;
|
|
1071
1082
|
surface: "inherit";
|
|
1083
|
+
instrumentation: "vercel-ai";
|
|
1072
1084
|
};
|
|
1073
1085
|
type WithSpanFn$1 = <TArgs extends unknown[], TReturn>(traceFunctionKey: string, options: LlmSpanOptions, fn: (...args: TArgs) => TReturn) => (...args: TArgs) => TReturn;
|
|
1074
1086
|
/**
|
|
@@ -1473,6 +1485,7 @@ interface SpanClient {
|
|
|
1473
1485
|
mockOnReplay?: boolean;
|
|
1474
1486
|
finalize?: (result: unknown) => unknown | Promise<unknown>;
|
|
1475
1487
|
surface?: "inherit";
|
|
1488
|
+
instrumentation?: "langgraph";
|
|
1476
1489
|
}, fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
1477
1490
|
}
|
|
1478
1491
|
interface LangGraphTool {
|
|
@@ -1580,6 +1593,7 @@ type RootSpanOptions = {
|
|
|
1580
1593
|
type: "agent";
|
|
1581
1594
|
finalize: (result: unknown) => unknown | Promise<unknown>;
|
|
1582
1595
|
surface: "inherit";
|
|
1596
|
+
instrumentation: "openai-agents";
|
|
1583
1597
|
};
|
|
1584
1598
|
type WithSpanFn = <TArgs extends unknown[], TReturn>(traceFunctionKey: string, options: RootSpanOptions, fn: (...args: TArgs) => TReturn) => (...args: TArgs) => TReturn;
|
|
1585
1599
|
type GetActiveSpanContextFn = () => unknown | null;
|
|
@@ -2522,6 +2536,7 @@ interface BitfabConfig {
|
|
|
2522
2536
|
* a branch materialized from that point.
|
|
2523
2537
|
*/
|
|
2524
2538
|
dbSnapshot?: DbSnapshotConfig;
|
|
2539
|
+
simulationPlan?: boolean;
|
|
2525
2540
|
}
|
|
2526
2541
|
/**
|
|
2527
2542
|
* Span types matching the backend enum.
|
|
@@ -2675,6 +2690,7 @@ declare class Bitfab {
|
|
|
2675
2690
|
private readonly bamlClient;
|
|
2676
2691
|
private readonly dbSnapshot;
|
|
2677
2692
|
private readonly autoTracePolicyRefreshes;
|
|
2693
|
+
private readonly simulationPlan;
|
|
2678
2694
|
/**
|
|
2679
2695
|
* Mock overrides registered via {@link Bitfab.registerMockOverride}, applied
|
|
2680
2696
|
* to every `replay` on this client (after any per-call `mockOverride`). In
|
|
@@ -2750,6 +2766,7 @@ declare class Bitfab {
|
|
|
2750
2766
|
private resolveNodeConfiguration;
|
|
2751
2767
|
private createAutoTraceNode;
|
|
2752
2768
|
private createAutoTraceRoot;
|
|
2769
|
+
private applySimulationPlan;
|
|
2753
2770
|
private refreshAutoTraceCapturePolicy;
|
|
2754
2771
|
/**
|
|
2755
2772
|
* Flush and permanently close this client's tracing resources: its pending
|
|
@@ -3326,7 +3343,7 @@ interface CommitRef {
|
|
|
3326
3343
|
/**
|
|
3327
3344
|
* SDK version from package.json (injected at build time)
|
|
3328
3345
|
*/
|
|
3329
|
-
declare const __version__ = "0.53.
|
|
3346
|
+
declare const __version__ = "0.53.1";
|
|
3330
3347
|
|
|
3331
3348
|
/**
|
|
3332
3349
|
* Constants for the Bitfab SDK.
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
getCurrentTrace,
|
|
29
29
|
reseedFromRegistry,
|
|
30
30
|
seedFromRegistry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZCOZHNAA.js";
|
|
32
32
|
import "./chunk-E5BLYL5X.js";
|
|
33
33
|
import {
|
|
34
34
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
ReplayError,
|
|
38
38
|
reportReplayProgress,
|
|
39
39
|
serializeReplayResult
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-MMT5MWG5.js";
|
|
41
41
|
import {
|
|
42
42
|
BitfabError,
|
|
43
43
|
DEFAULT_SERVICE_URL,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
MixedTracingError,
|
|
46
46
|
__version__,
|
|
47
47
|
flushTraces
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-ASMHSKFS.js";
|
|
49
49
|
import "./chunk-H6LZRFMN.js";
|
|
50
50
|
export {
|
|
51
51
|
BITFAB_PROGRESS_PREFIX,
|