@bitfab/sdk 0.44.0 → 0.45.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-XYMG2FH7.js → chunk-GN6E2IBU.js} +59 -6
- package/dist/chunk-GN6E2IBU.js.map +1 -0
- package/dist/{chunk-3WIN3VU3.js → chunk-H4WJUUZH.js} +13 -5
- package/dist/chunk-H4WJUUZH.js.map +1 -0
- package/dist/{chunk-AX6EZPGH.js → chunk-SILI6DDS.js} +2 -2
- package/dist/{chunk-AX6EZPGH.js.map → chunk-SILI6DDS.js.map} +1 -1
- package/dist/{chunk-6JTVCM2L.js → chunk-TCOD5O2B.js} +2 -2
- package/dist/{chunk-6JTVCM2L.js.map → chunk-TCOD5O2B.js.map} +1 -1
- package/dist/{http-QWUWDTFN.js → http-E7RYN3BX.js} +2 -2
- package/dist/{http-Q4TSO32V.js → http-QGTV3X7R.js} +2 -2
- package/dist/index.cjs +67 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +153 -34
- package/dist/index.d.ts +153 -34
- package/dist/index.js +7 -3
- package/dist/node.cjs +67 -4
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +7 -3
- package/dist/node.js.map +1 -1
- package/dist/{replay-RPB6CT6M.js → replay-PQSTJRPU.js} +3 -3
- package/dist/replayCli.js +2 -2
- package/dist/replayCli.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3WIN3VU3.js.map +0 -1
- package/dist/chunk-XYMG2FH7.js.map +0 -1
- /package/dist/{http-Q4TSO32V.js.map → http-E7RYN3BX.js.map} +0 -0
- /package/dist/{http-QWUWDTFN.js.map → http-QGTV3X7R.js.map} +0 -0
- /package/dist/{replay-RPB6CT6M.js.map → replay-PQSTJRPU.js.map} +0 -0
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
serializeValue,
|
|
15
15
|
toJsonSafe,
|
|
16
16
|
toJsonSafeReport
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-H4WJUUZH.js";
|
|
18
18
|
import {
|
|
19
19
|
BitfabError,
|
|
20
20
|
DEFAULT_SERVICE_URL,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
MixedTracingError,
|
|
23
23
|
getReplayContext,
|
|
24
24
|
warnOnce
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-TCOD5O2B.js";
|
|
26
26
|
import {
|
|
27
27
|
__privateAdd,
|
|
28
28
|
__privateGet,
|
|
@@ -32,6 +32,33 @@ import {
|
|
|
32
32
|
isAsyncStorageInitDone
|
|
33
33
|
} from "./chunk-H6LZRFMN.js";
|
|
34
34
|
|
|
35
|
+
// src/assertions.ts
|
|
36
|
+
function expectationsPath(traceId, suffix = "") {
|
|
37
|
+
return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
|
|
38
|
+
}
|
|
39
|
+
var TracesClient = class {
|
|
40
|
+
constructor(httpClient) {
|
|
41
|
+
this.httpClient = httpClient;
|
|
42
|
+
}
|
|
43
|
+
async getAssertions(traceId) {
|
|
44
|
+
return this.httpClient.get(expectationsPath(traceId));
|
|
45
|
+
}
|
|
46
|
+
async saveAssertions(params) {
|
|
47
|
+
const response = await this.httpClient.request(expectationsPath(params.traceId), {
|
|
48
|
+
assertions: params.assertions,
|
|
49
|
+
source: params.source ?? "agent"
|
|
50
|
+
});
|
|
51
|
+
return response.assertions;
|
|
52
|
+
}
|
|
53
|
+
async archiveAssertions(params) {
|
|
54
|
+
const response = await this.httpClient.request(
|
|
55
|
+
expectationsPath(params.traceId, "/archive"),
|
|
56
|
+
{ assertionIds: params.assertionIds }
|
|
57
|
+
);
|
|
58
|
+
return response.archived;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
35
62
|
// src/processorPayload.ts
|
|
36
63
|
var SERIALIZATION_DEGRADED_STEP = "serialization_degraded";
|
|
37
64
|
function degradedError(dropped) {
|
|
@@ -1133,6 +1160,28 @@ function buildSnapshotRef(config, sdkWallClockBeforeFn) {
|
|
|
1133
1160
|
};
|
|
1134
1161
|
}
|
|
1135
1162
|
|
|
1163
|
+
// src/labels.ts
|
|
1164
|
+
var LABELS_PATH = "/api/sdk/traces/labels";
|
|
1165
|
+
var LabelsClient = class {
|
|
1166
|
+
constructor(httpClient) {
|
|
1167
|
+
this.httpClient = httpClient;
|
|
1168
|
+
}
|
|
1169
|
+
async save(params) {
|
|
1170
|
+
const response = await this.httpClient.request(
|
|
1171
|
+
LABELS_PATH,
|
|
1172
|
+
{
|
|
1173
|
+
labels: params.labels,
|
|
1174
|
+
...params.testRunId === void 0 ? {} : { testRunId: params.testRunId }
|
|
1175
|
+
}
|
|
1176
|
+
);
|
|
1177
|
+
return response.labels;
|
|
1178
|
+
}
|
|
1179
|
+
async saveOne(update, testRunId) {
|
|
1180
|
+
const [outcome] = await this.save({ labels: [update], testRunId });
|
|
1181
|
+
return outcome;
|
|
1182
|
+
}
|
|
1183
|
+
};
|
|
1184
|
+
|
|
1136
1185
|
// src/langgraph.ts
|
|
1137
1186
|
var LANGSMITH_HIDDEN_TAG = "langsmith:hidden";
|
|
1138
1187
|
var CHAIN_RUN_TYPES = /* @__PURE__ */ new Set(["chain", "parser", "prompt"]);
|
|
@@ -2883,6 +2932,8 @@ var Bitfab = class {
|
|
|
2883
2932
|
timeout: this.timeout
|
|
2884
2933
|
});
|
|
2885
2934
|
this.datasets = new DatasetsClient(this.httpClient);
|
|
2935
|
+
this.traces = new TracesClient(this.httpClient);
|
|
2936
|
+
this.labels = new LabelsClient(this.httpClient);
|
|
2886
2937
|
}
|
|
2887
2938
|
/**
|
|
2888
2939
|
* Decorate a class method as an automatically expanded trace root.
|
|
@@ -4449,7 +4500,7 @@ var Bitfab = class {
|
|
|
4449
4500
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
4450
4501
|
} finally {
|
|
4451
4502
|
try {
|
|
4452
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
4503
|
+
const { flushTraces: flushTraces2 } = await import("./http-E7RYN3BX.js");
|
|
4453
4504
|
await flushTraces2(3e4);
|
|
4454
4505
|
} finally {
|
|
4455
4506
|
unrecorded = activeTraceStates.delete(traceId);
|
|
@@ -4477,7 +4528,7 @@ var Bitfab = class {
|
|
|
4477
4528
|
`Function is wrapped with trace function key '${wrappedKey}' but replay was called with '${traceFunctionKey}'. Pass matching keys, or pass the unwrapped function to replay it under the explicit key.`
|
|
4478
4529
|
);
|
|
4479
4530
|
}
|
|
4480
|
-
const { replay: doReplay } = await import("./replay-
|
|
4531
|
+
const { replay: doReplay } = await import("./replay-PQSTJRPU.js");
|
|
4481
4532
|
return doReplay(
|
|
4482
4533
|
this.httpClient,
|
|
4483
4534
|
this.serviceUrl,
|
|
@@ -4743,7 +4794,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
4743
4794
|
sessionId: seedCase.sessionId
|
|
4744
4795
|
})
|
|
4745
4796
|
);
|
|
4746
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
4797
|
+
const { flushTraces: flushTraces2 } = await import("./http-E7RYN3BX.js");
|
|
4747
4798
|
await flushTraces2(3e4);
|
|
4748
4799
|
return { pipeline, traceFunctionKey, traceIds };
|
|
4749
4800
|
}
|
|
@@ -4759,9 +4810,11 @@ function resolveTraceFunctionKey(registration) {
|
|
|
4759
4810
|
}
|
|
4760
4811
|
|
|
4761
4812
|
export {
|
|
4813
|
+
TracesClient,
|
|
4762
4814
|
BitfabClaudeAgentHandler,
|
|
4763
4815
|
DatasetsClient,
|
|
4764
4816
|
SUPPORTED_PROVIDERS,
|
|
4817
|
+
LabelsClient,
|
|
4765
4818
|
BitfabLangGraphCallbackHandler,
|
|
4766
4819
|
BitfabLangGraphIntegration,
|
|
4767
4820
|
BitfabOpenAIAgentHandler,
|
|
@@ -4776,4 +4829,4 @@ export {
|
|
|
4776
4829
|
defineReplayRegistry,
|
|
4777
4830
|
seedFromRegistry
|
|
4778
4831
|
};
|
|
4779
|
-
//# sourceMappingURL=chunk-
|
|
4832
|
+
//# sourceMappingURL=chunk-GN6E2IBU.js.map
|