bitfab 0.52.2 → 0.52.4
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-XL5M3ETX.js → chunk-34B7PVAM.js} +79 -28
- package/dist/chunk-34B7PVAM.js.map +1 -0
- package/dist/{chunk-RU7KJE2D.js → chunk-AUROMI67.js} +61 -11
- package/dist/chunk-AUROMI67.js.map +1 -0
- package/dist/chunk-HKTODDFP.js +747 -0
- package/dist/chunk-HKTODDFP.js.map +1 -0
- package/dist/{chunk-ESIEHZHQ.js → chunk-IG3CPSRQ.js} +48 -21
- package/dist/chunk-IG3CPSRQ.js.map +1 -0
- package/dist/{chunk-SIMPLMRG.js → chunk-U2D7ACC4.js} +3 -2
- package/dist/chunk-U2D7ACC4.js.map +1 -0
- package/dist/{http-2NFFBFYV.js → http-F3AXLOJT.js} +2 -2
- package/dist/{http-RULNEWBV.js → http-RFNQ7LSU.js} +2 -2
- package/dist/index.cjs +134 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -2
- package/dist/index.d.ts +36 -2
- package/dist/index.js +5 -3
- package/dist/node.cjs +134 -31
- 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 +5 -3
- package/dist/node.js.map +1 -1
- package/dist/{replay-6SQSBWLX.js → replay-ZOTYMBMD.js} +5 -3
- package/dist/replayCli.js +18 -687
- package/dist/replayCli.js.map +1 -1
- package/dist/seedCli.js +30 -0
- package/dist/seedCli.js.map +1 -0
- package/package.json +3 -2
- package/dist/chunk-ESIEHZHQ.js.map +0 -1
- package/dist/chunk-RU7KJE2D.js.map +0 -1
- package/dist/chunk-SIMPLMRG.js.map +0 -1
- package/dist/chunk-XL5M3ETX.js.map +0 -1
- /package/dist/{http-2NFFBFYV.js.map → http-F3AXLOJT.js.map} +0 -0
- /package/dist/{http-RULNEWBV.js.map → http-RFNQ7LSU.js.map} +0 -0
- /package/dist/{replay-6SQSBWLX.js.map → replay-ZOTYMBMD.js.map} +0 -0
|
@@ -8,24 +8,25 @@ import {
|
|
|
8
8
|
} from "./chunk-ZUD7OFYB.js";
|
|
9
9
|
import {
|
|
10
10
|
NO_MOCK_OVERRIDE,
|
|
11
|
+
deserializeInputs,
|
|
11
12
|
deserializeValue,
|
|
12
13
|
randomUuid,
|
|
13
14
|
resolveMockValue,
|
|
14
15
|
serializeValue,
|
|
15
16
|
toJsonSafe,
|
|
16
17
|
toJsonSafeReport
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-U2D7ACC4.js";
|
|
18
19
|
import {
|
|
19
20
|
BitfabError,
|
|
20
21
|
DEFAULT_SERVICE_URL,
|
|
21
22
|
HttpClient,
|
|
22
23
|
MixedTracingError,
|
|
23
24
|
callerTraceMetadata,
|
|
24
|
-
forgetTraceMetadata,
|
|
25
25
|
getReplayContext,
|
|
26
26
|
recordCallerTraceMetadata,
|
|
27
|
+
retireTraceMetadata,
|
|
27
28
|
warnOnce
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-34B7PVAM.js";
|
|
29
30
|
import {
|
|
30
31
|
__privateAdd,
|
|
31
32
|
__privateGet,
|
|
@@ -3942,7 +3943,7 @@ var Bitfab = class {
|
|
|
3942
3943
|
}
|
|
3943
3944
|
});
|
|
3944
3945
|
activeTraceStates.delete(traceId);
|
|
3945
|
-
|
|
3946
|
+
retireTraceMetadata(traceId);
|
|
3946
3947
|
}
|
|
3947
3948
|
} catch {
|
|
3948
3949
|
}
|
|
@@ -4135,7 +4136,7 @@ var Bitfab = class {
|
|
|
4135
4136
|
} catch (setupError) {
|
|
4136
4137
|
if (registeredTraceId) {
|
|
4137
4138
|
activeTraceStates.delete(registeredTraceId);
|
|
4138
|
-
|
|
4139
|
+
retireTraceMetadata(registeredTraceId);
|
|
4139
4140
|
}
|
|
4140
4141
|
if (setupError instanceof MixedTracingError) {
|
|
4141
4142
|
throw setupError;
|
|
@@ -4534,7 +4535,7 @@ var Bitfab = class {
|
|
|
4534
4535
|
});
|
|
4535
4536
|
} finally {
|
|
4536
4537
|
activeTraceStates.delete(traceId);
|
|
4537
|
-
|
|
4538
|
+
retireTraceMetadata(traceId);
|
|
4538
4539
|
}
|
|
4539
4540
|
return traceId;
|
|
4540
4541
|
}
|
|
@@ -4576,11 +4577,11 @@ var Bitfab = class {
|
|
|
4576
4577
|
await runWithSeedContext({ traceId }, async () => target(...args));
|
|
4577
4578
|
} finally {
|
|
4578
4579
|
try {
|
|
4579
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
4580
|
+
const { flushTraces: flushTraces2 } = await import("./http-RFNQ7LSU.js");
|
|
4580
4581
|
await flushTraces2(3e4);
|
|
4581
4582
|
} finally {
|
|
4582
4583
|
unrecorded = activeTraceStates.delete(traceId);
|
|
4583
|
-
|
|
4584
|
+
retireTraceMetadata(traceId);
|
|
4584
4585
|
}
|
|
4585
4586
|
}
|
|
4586
4587
|
if (unrecorded) {
|
|
@@ -4590,6 +4591,36 @@ var Bitfab = class {
|
|
|
4590
4591
|
}
|
|
4591
4592
|
return traceId;
|
|
4592
4593
|
}
|
|
4594
|
+
async reseedTrace(traceFunctionKey, fn, options) {
|
|
4595
|
+
const source = await this.httpClient.getReseedSource(options.traceId);
|
|
4596
|
+
if (source.traceFunctionKey !== traceFunctionKey) {
|
|
4597
|
+
throw new BitfabError(
|
|
4598
|
+
`Trace ${options.traceId} belongs to '${source.traceFunctionKey}', not '${traceFunctionKey}'.`
|
|
4599
|
+
);
|
|
4600
|
+
}
|
|
4601
|
+
const args = deserializeInputs({
|
|
4602
|
+
input: source.input,
|
|
4603
|
+
input_meta: source.inputMeta
|
|
4604
|
+
});
|
|
4605
|
+
const runTraceId = await this.seedTraceByRunning(
|
|
4606
|
+
traceFunctionKey,
|
|
4607
|
+
fn,
|
|
4608
|
+
{
|
|
4609
|
+
args,
|
|
4610
|
+
metadata: source.metadata,
|
|
4611
|
+
...source.sessionId === null ? {} : { sessionId: source.sessionId },
|
|
4612
|
+
...source.name === null ? {} : { name: source.name }
|
|
4613
|
+
}
|
|
4614
|
+
);
|
|
4615
|
+
const adopted = await this.httpClient.reseedTrace(
|
|
4616
|
+
options.traceId,
|
|
4617
|
+
runTraceId
|
|
4618
|
+
);
|
|
4619
|
+
return {
|
|
4620
|
+
traceId: adopted.traceId,
|
|
4621
|
+
previousRunTraceId: adopted.previousRunTraceId
|
|
4622
|
+
};
|
|
4623
|
+
}
|
|
4593
4624
|
async replay(traceFunctionKey, fn, options) {
|
|
4594
4625
|
const wrappedKey = fn._bitfabTraceFunctionKey;
|
|
4595
4626
|
let replayFn = fn;
|
|
@@ -4605,7 +4636,7 @@ var Bitfab = class {
|
|
|
4605
4636
|
`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.`
|
|
4606
4637
|
);
|
|
4607
4638
|
}
|
|
4608
|
-
const { replay: doReplay } = await import("./replay-
|
|
4639
|
+
const { replay: doReplay } = await import("./replay-ZOTYMBMD.js");
|
|
4609
4640
|
return doReplay(
|
|
4610
4641
|
this.httpClient,
|
|
4611
4642
|
this.serviceUrl,
|
|
@@ -4841,6 +4872,24 @@ var finalizers = {
|
|
|
4841
4872
|
function defineReplayRegistry(registry) {
|
|
4842
4873
|
return registry;
|
|
4843
4874
|
}
|
|
4875
|
+
async function reseedFromRegistry(registry, pipeline, traceIds) {
|
|
4876
|
+
const registration = registry[pipeline];
|
|
4877
|
+
if (registration === void 0) {
|
|
4878
|
+
throw new BitfabError(
|
|
4879
|
+
`Unknown pipeline '${pipeline}'. Registered: ${Object.keys(registry).join(", ")}`
|
|
4880
|
+
);
|
|
4881
|
+
}
|
|
4882
|
+
const traceFunctionKey = resolveTraceFunctionKey(registration);
|
|
4883
|
+
const reseeded = [];
|
|
4884
|
+
for (const traceId of traceIds) {
|
|
4885
|
+
reseeded.push(
|
|
4886
|
+
await registration.client.reseedTrace(traceFunctionKey, registration.fn, {
|
|
4887
|
+
traceId
|
|
4888
|
+
})
|
|
4889
|
+
);
|
|
4890
|
+
}
|
|
4891
|
+
return { pipeline, traceFunctionKey, reseeded };
|
|
4892
|
+
}
|
|
4844
4893
|
async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
4845
4894
|
const registration = registry[pipeline];
|
|
4846
4895
|
if (registration === void 0) {
|
|
@@ -4871,7 +4920,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
|
|
|
4871
4920
|
sessionId: seedCase.sessionId
|
|
4872
4921
|
})
|
|
4873
4922
|
);
|
|
4874
|
-
const { flushTraces: flushTraces2 } = await import("./http-
|
|
4923
|
+
const { flushTraces: flushTraces2 } = await import("./http-RFNQ7LSU.js");
|
|
4875
4924
|
await flushTraces2(3e4);
|
|
4876
4925
|
return { pipeline, traceFunctionKey, traceIds };
|
|
4877
4926
|
}
|
|
@@ -4905,6 +4954,7 @@ export {
|
|
|
4905
4954
|
BitfabFunction,
|
|
4906
4955
|
finalizers,
|
|
4907
4956
|
defineReplayRegistry,
|
|
4957
|
+
reseedFromRegistry,
|
|
4908
4958
|
seedFromRegistry
|
|
4909
4959
|
};
|
|
4910
|
-
//# sourceMappingURL=chunk-
|
|
4960
|
+
//# sourceMappingURL=chunk-AUROMI67.js.map
|