@bitfab/sdk 0.68.9 → 0.68.11
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/{http-CxIFBucn.cjs → http-BN_Ry7Wf.cjs} +8 -2
- package/dist/{http-CfayedL7.js.map → http-BN_Ry7Wf.cjs.map} +1 -1
- package/dist/{http-CfayedL7.js → http-BiyOTH78.js} +3 -3
- package/dist/http-BiyOTH78.js.map +1 -0
- package/dist/{index-DTcqG8wp.d.cts → index-Bg-oKbVP.d.cts} +3 -3
- package/dist/{index-DTcqG8wp.d.ts → index-Bg-oKbVP.d.ts} +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/node.cjs +2 -2
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +2 -2
- package/dist/registryCommand-CWxt6kPp.js.map +1 -1
- package/dist/{src-DMBEhG3p.js → src-B3hT_cMM.js} +16 -10
- package/dist/src-B3hT_cMM.js.map +1 -0
- package/dist/{src-yzu_ogdm.cjs → src-G_mEK3GW.cjs} +16 -10
- package/dist/src-G_mEK3GW.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/http-CxIFBucn.cjs.map +0 -1
- package/dist/src-DMBEhG3p.js.map +0 -1
- package/dist/src-yzu_ogdm.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_bamlPeer = require("./bamlPeer-5Ohpq8q9.cjs");
|
|
2
|
-
const require_http = require("./http-
|
|
2
|
+
const require_http = require("./http-BN_Ry7Wf.cjs");
|
|
3
3
|
const require_autoTrace = require("./autoTrace-DPWV1Xzr.cjs");
|
|
4
4
|
const require_optionalPeer = require("./optionalPeer-CUH756lt.cjs");
|
|
5
5
|
let superjson = require("superjson");
|
|
@@ -2615,7 +2615,7 @@ function leadingSystemMessages(messages) {
|
|
|
2615
2615
|
}
|
|
2616
2616
|
function serializedBytes(value) {
|
|
2617
2617
|
try {
|
|
2618
|
-
return JSON.stringify(value)
|
|
2618
|
+
return require_http.byteLength(JSON.stringify(value) ?? "");
|
|
2619
2619
|
} catch {
|
|
2620
2620
|
return;
|
|
2621
2621
|
}
|
|
@@ -2835,7 +2835,11 @@ var BitfabPiIntegration = class {
|
|
|
2835
2835
|
}
|
|
2836
2836
|
restoreIntoSession(session, messages) {
|
|
2837
2837
|
const store = session.sessionManager;
|
|
2838
|
-
if (store?.isPersisted
|
|
2838
|
+
if (typeof store?.isPersisted !== "function" || typeof store.appendMessage !== "function") {
|
|
2839
|
+
require_autoTrace.warnOnce(`pi-replay-session-unknown-store:${this.traceFunctionKey}`, `A replayed "${this.traceFunctionKey}" run used an AgentSession whose session manager has no isPersisted() or appendMessage() method, so Bitfab could not tell whether it is saved to disk and did not restore the recorded conversation into it. Build the session in your replay function with SessionManager.inMemory() to replay each turn with its history.`);
|
|
2840
|
+
return;
|
|
2841
|
+
}
|
|
2842
|
+
if (store.isPersisted()) {
|
|
2839
2843
|
require_autoTrace.warnOnce(`pi-replay-session-persisted:${this.traceFunctionKey}`, `A replayed "${this.traceFunctionKey}" run used an AgentSession saved to disk, so Bitfab did not restore the recorded conversation into it. Build the session in your replay function with SessionManager.inMemory() to replay each turn with its history.`);
|
|
2840
2844
|
return;
|
|
2841
2845
|
}
|
|
@@ -2905,15 +2909,17 @@ var BitfabPiIntegration = class {
|
|
|
2905
2909
|
const replaysContinue = this.restoredTranscript(run)?.method === "continue" && callsWithoutArguments(callArgs);
|
|
2906
2910
|
const calledMethod = replaysContinue ? "continue" : method;
|
|
2907
2911
|
if (require_http.getReplayContext() === null) this.recordTranscript(method, run.state());
|
|
2908
|
-
|
|
2912
|
+
const original = Reflect.get(target, calledMethod, target);
|
|
2913
|
+
const start = run.state().messages.length;
|
|
2914
|
+
await original.apply(receiver, replaysContinue ? [] : callArgs);
|
|
2909
2915
|
throwKeptReplayFailure();
|
|
2916
|
+
return start;
|
|
2910
2917
|
};
|
|
2911
|
-
if (this.host.activeRootTraceFunctionKey() === this.traceFunctionKey) return call(...args);
|
|
2918
|
+
if (this.host.activeRootTraceFunctionKey() === this.traceFunctionKey) return call(...args).then(() => void 0);
|
|
2912
2919
|
const callReturningFinalMessage = async (...callArgs) => {
|
|
2913
2920
|
const sessionId = run.sessionId();
|
|
2914
2921
|
if (typeof sessionId === "string" && sessionId.length > 0) this.host.setTraceSessionId(sessionId);
|
|
2915
|
-
const start =
|
|
2916
|
-
await call(...callArgs);
|
|
2922
|
+
const start = await call(...callArgs);
|
|
2917
2923
|
return lastAssistantMessageSince(run.state(), start);
|
|
2918
2924
|
};
|
|
2919
2925
|
return this.host.withSpan(this.traceFunctionKey, {
|
|
@@ -7003,7 +7009,7 @@ var Bitfab = class {
|
|
|
7003
7009
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
7004
7010
|
} finally {
|
|
7005
7011
|
try {
|
|
7006
|
-
const { flushTraces } = await Promise.resolve().then(() => require("./http-
|
|
7012
|
+
const { flushTraces } = await Promise.resolve().then(() => require("./http-BN_Ry7Wf.cjs")).then((n) => n.http_exports);
|
|
7007
7013
|
await flushTraces(3e4);
|
|
7008
7014
|
} finally {
|
|
7009
7015
|
unrecorded = activeTraceStates.delete(traceId);
|
|
@@ -7209,7 +7215,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
7209
7215
|
metadata: seedCase.metadata,
|
|
7210
7216
|
sessionId: seedCase.sessionId
|
|
7211
7217
|
}));
|
|
7212
|
-
const { flushTraces } = await Promise.resolve().then(() => require("./http-
|
|
7218
|
+
const { flushTraces } = await Promise.resolve().then(() => require("./http-BN_Ry7Wf.cjs")).then((n) => n.http_exports);
|
|
7213
7219
|
await flushTraces(3e4);
|
|
7214
7220
|
return {
|
|
7215
7221
|
pipeline,
|
|
@@ -7459,4 +7465,4 @@ Object.defineProperty(exports, "serializeReplayResult", {
|
|
|
7459
7465
|
}
|
|
7460
7466
|
});
|
|
7461
7467
|
|
|
7462
|
-
//# sourceMappingURL=src-
|
|
7468
|
+
//# sourceMappingURL=src-G_mEK3GW.cjs.map
|