@bitfab/sdk 0.28.2 → 0.28.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/{chunk-3PCOUZZP.js → chunk-B262VQWF.js} +2 -2
- package/dist/chunk-B262VQWF.js.map +1 -0
- package/dist/{chunk-NZFPJRD3.js → chunk-KYDQQPIS.js} +18 -18
- package/dist/chunk-KYDQQPIS.js.map +1 -0
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +2 -2
- package/dist/node.cjs +16 -16
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/node.js.map +1 -1
- package/dist/{replay-PZKPWKMV.js → replay-4NJCYW4H.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-3PCOUZZP.js.map +0 -1
- package/dist/chunk-NZFPJRD3.js.map +0 -1
- /package/dist/{replay-PZKPWKMV.js.map → replay-4NJCYW4H.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -644,7 +644,7 @@ __export(index_exports, {
|
|
|
644
644
|
module.exports = __toCommonJS(index_exports);
|
|
645
645
|
|
|
646
646
|
// src/version.generated.ts
|
|
647
|
-
var __version__ = "0.28.
|
|
647
|
+
var __version__ = "0.28.3";
|
|
648
648
|
|
|
649
649
|
// src/constants.ts
|
|
650
650
|
var DEFAULT_SERVICE_URL = "https://bitfab.ai";
|
|
@@ -957,7 +957,7 @@ var HttpClient = class {
|
|
|
957
957
|
}
|
|
958
958
|
/**
|
|
959
959
|
* Start a replay session by fetching historical traces.
|
|
960
|
-
* Blocking call
|
|
960
|
+
* Blocking call - creates a test run and returns lightweight item references.
|
|
961
961
|
*/
|
|
962
962
|
async startReplay(traceFunctionKey, limit, traceIds, name, codeChangeDescription, codeChangeFiles, includeDbBranchLease, experimentGroupId, datasetId) {
|
|
963
963
|
const payload = { traceFunctionKey };
|
|
@@ -1075,7 +1075,7 @@ var HttpClient = class {
|
|
|
1075
1075
|
}
|
|
1076
1076
|
/**
|
|
1077
1077
|
* Ask the server to materialize a per-trace DB branch lease from a
|
|
1078
|
-
* captured `dbSnapshotRef`. Blocking
|
|
1078
|
+
* captured `dbSnapshotRef`. Blocking - the resolver creates a Neon
|
|
1079
1079
|
* snapshot + preview branch and polls operations to readiness, which
|
|
1080
1080
|
* can take seconds.
|
|
1081
1081
|
*/
|
|
@@ -1215,7 +1215,7 @@ var BitfabClaudeAgentHandler = class {
|
|
|
1215
1215
|
// Synthetic root span (handler-only replay). When an `input` is supplied to
|
|
1216
1216
|
// wrapQuery/wrapResponse, the handler emits a root `agent` span carrying that
|
|
1217
1217
|
// input, so a handler-instrumented run is replayable WITHOUT an enclosing
|
|
1218
|
-
// withSpan
|
|
1218
|
+
// withSpan - matching the LangGraph handler, which records the graph input as
|
|
1219
1219
|
// its root. The prompt is not present anywhere in the message stream, so it
|
|
1220
1220
|
// must be handed in explicitly.
|
|
1221
1221
|
this.hasRootInput = false;
|
|
@@ -1489,7 +1489,7 @@ var BitfabClaudeAgentHandler = class {
|
|
|
1489
1489
|
* SDK's `wrapResponse` (which wraps `ClaudeSDKClient.receiveResponse()`);
|
|
1490
1490
|
* in TypeScript, prefer `wrapQuery` around `query()`.
|
|
1491
1491
|
*
|
|
1492
|
-
* Pass `{ input }` (the prompt) to record a replayable root span
|
|
1492
|
+
* Pass `{ input }` (the prompt) to record a replayable root span - see
|
|
1493
1493
|
* `wrapQuery`.
|
|
1494
1494
|
*/
|
|
1495
1495
|
async *wrapResponse(stream, opts) {
|
|
@@ -1502,8 +1502,8 @@ var BitfabClaudeAgentHandler = class {
|
|
|
1502
1502
|
* Tool and subagent spans are captured separately via the hooks injected
|
|
1503
1503
|
* by `instrumentOptions` into the `options` passed to `query()`.
|
|
1504
1504
|
*
|
|
1505
|
-
* Pass `{ input }`
|
|
1506
|
-
*
|
|
1505
|
+
* Pass `{ input }` - the prompt (or the serializable args that produced it)
|
|
1506
|
+
* - to make a handler-only run replayable: the handler records a root `agent`
|
|
1507
1507
|
* span with that input, so `replay(key, fn)` can re-feed it. Omit it only
|
|
1508
1508
|
* when an enclosing `withSpan` already supplies the replayable root.
|
|
1509
1509
|
*
|
|
@@ -2615,7 +2615,7 @@ var BitfabOpenAIAgentHandler = class {
|
|
|
2615
2615
|
* argument, so `replay(key, fn)` re-feeds it), and the run's `finalOutput`
|
|
2616
2616
|
* is recorded as the root output. For streaming runs (`{ stream: true }`),
|
|
2617
2617
|
* the result is handed back immediately and the final output is recorded
|
|
2618
|
-
* once the stream completes
|
|
2618
|
+
* once the stream completes - first-byte latency is untouched.
|
|
2619
2619
|
*
|
|
2620
2620
|
* The process-wide tracing processor (`getOpenAiTracingProcessor`) must still
|
|
2621
2621
|
* be registered: it captures the LLM/tool/handoff spans that nest beneath
|
|
@@ -2708,7 +2708,7 @@ var ReplayEnvironment = class {
|
|
|
2708
2708
|
}
|
|
2709
2709
|
/**
|
|
2710
2710
|
* Record on the replay context that customer code obtained the branch
|
|
2711
|
-
* URL. Only `databaseUrl` and `snapshot()` count
|
|
2711
|
+
* URL. Only `databaseUrl` and `snapshot()` count - `active`, `readOnly`
|
|
2712
2712
|
* and friends inspect the lease without exposing the connection string,
|
|
2713
2713
|
* so they don't prove the replayed code could have connected to the
|
|
2714
2714
|
* branch.
|
|
@@ -3433,7 +3433,7 @@ var Bitfab = class {
|
|
|
3433
3433
|
if (this.explicitlyEnabled && !this.apiKeyWarned) {
|
|
3434
3434
|
this.apiKeyWarned = true;
|
|
3435
3435
|
console.warn(
|
|
3436
|
-
"Bitfab: apiKey is empty
|
|
3436
|
+
"Bitfab: apiKey is empty - tracing is disabled. Provide a valid API key to enable tracing."
|
|
3437
3437
|
);
|
|
3438
3438
|
}
|
|
3439
3439
|
return void 0;
|
|
@@ -3697,7 +3697,7 @@ var Bitfab = class {
|
|
|
3697
3697
|
* Wrap a BAML client method to automatically capture prompt and LLM metadata.
|
|
3698
3698
|
*
|
|
3699
3699
|
* Creates a BAML Collector, calls the method through a tracked client,
|
|
3700
|
-
* then extracts rendered messages and token usage
|
|
3700
|
+
* then extracts rendered messages and token usage - calling setPrompt()
|
|
3701
3701
|
* and addContext() on the current span automatically.
|
|
3702
3702
|
*
|
|
3703
3703
|
* The BAML client can be provided in the constructor or passed explicitly:
|
|
@@ -4084,7 +4084,7 @@ var Bitfab = class {
|
|
|
4084
4084
|
* Get a detached handle to a previously-created trace, looked up by the
|
|
4085
4085
|
* caller-supplied id (the same id passed at trace creation).
|
|
4086
4086
|
*
|
|
4087
|
-
* The returned handle is not tied to AsyncLocalStorage
|
|
4087
|
+
* The returned handle is not tied to AsyncLocalStorage - each method sends
|
|
4088
4088
|
* to the server immediately. Useful for adding context to a trace from a
|
|
4089
4089
|
* different process or thread than the one that created it.
|
|
4090
4090
|
*
|
|
@@ -4265,7 +4265,7 @@ var Bitfab = class {
|
|
|
4265
4265
|
* plain callable: plain callables are wrapped internally so each replayed
|
|
4266
4266
|
* invocation records a trace tied to the test run. The plain-callable form
|
|
4267
4267
|
* is how handler-instrumented workflows (LangGraph/LangChain, Claude Agent
|
|
4268
|
-
* SDK) replay
|
|
4268
|
+
* SDK) replay - those record traces under a key with no `withSpan`-wrapped
|
|
4269
4269
|
* root in the app.
|
|
4270
4270
|
*
|
|
4271
4271
|
* @param traceFunctionKey - The trace function key to replay
|
|
@@ -4417,7 +4417,7 @@ var BitfabFunction = class {
|
|
|
4417
4417
|
return this.client.getLangGraphCallbackHandler(this.traceFunctionKey);
|
|
4418
4418
|
}
|
|
4419
4419
|
/**
|
|
4420
|
-
* Alias of {@link getLangGraphCallbackHandler}
|
|
4420
|
+
* Alias of {@link getLangGraphCallbackHandler} - LangChain and LangGraph
|
|
4421
4421
|
* share one callback system, so the same bound handler serves both.
|
|
4422
4422
|
*
|
|
4423
4423
|
* @returns A LangChain callback handler for this client and key
|
|
@@ -4432,7 +4432,7 @@ var BitfabFunction = class {
|
|
|
4432
4432
|
* Unlike the other methods on this handle, `wrapBAML` does NOT use the bound
|
|
4433
4433
|
* key: it opens no span of its own. It enriches the *current* span (via
|
|
4434
4434
|
* `getCurrentSpan().setPrompt()` / `addContext()`), so call it inside a
|
|
4435
|
-
* function wrapped by this handle's `withSpan`
|
|
4435
|
+
* function wrapped by this handle's `withSpan` - the bound key keys that
|
|
4436
4436
|
* wrapper, and the BAML prompt/metadata attach to it.
|
|
4437
4437
|
*
|
|
4438
4438
|
* @param methodOrClient - Either a BAML method (uses constructor bamlClient) or the BAML client instance
|