@bitfab/sdk 0.38.8 → 0.38.9
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-VCGFTX2G.js → chunk-2I5TFNGK.js} +2 -2
- package/dist/{chunk-VCGFTX2G.js.map → chunk-2I5TFNGK.js.map} +1 -1
- package/dist/{chunk-CKOOG3TW.js → chunk-B4XXAK74.js} +18 -8
- package/dist/chunk-B4XXAK74.js.map +1 -0
- package/dist/index.cjs +18 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/node.cjs +18 -6
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +2 -2
- package/dist/{replay-L2OSAP6N.js → replay-EC7CQOO3.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-CKOOG3TW.js.map +0 -1
- /package/dist/{replay-L2OSAP6N.js.map → replay-EC7CQOO3.js.map} +0 -0
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
toJsonSafe,
|
|
20
20
|
toJsonSafeReport,
|
|
21
21
|
warnOnce
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-2I5TFNGK.js";
|
|
23
23
|
import {
|
|
24
24
|
__privateAdd,
|
|
25
25
|
__privateGet,
|
|
@@ -83,9 +83,19 @@ function finalizeTracePayload(payload) {
|
|
|
83
83
|
return result;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
// src/timestamp.ts
|
|
87
|
+
var lastTimestampMicros = 0;
|
|
88
|
+
function nowIsoTimestamp() {
|
|
89
|
+
const wallClockMicros = Date.now() * 1e3;
|
|
90
|
+
lastTimestampMicros = Math.max(wallClockMicros, lastTimestampMicros + 1);
|
|
91
|
+
const milliseconds = Math.floor(lastTimestampMicros / 1e3);
|
|
92
|
+
const remainingMicros = lastTimestampMicros % 1e3;
|
|
93
|
+
return new Date(milliseconds).toISOString().replace("Z", `${remainingMicros.toString().padStart(3, "0")}Z`);
|
|
94
|
+
}
|
|
95
|
+
|
|
86
96
|
// src/claudeAgentSdk.ts
|
|
87
97
|
function nowIso() {
|
|
88
|
-
return (
|
|
98
|
+
return nowIsoTimestamp();
|
|
89
99
|
}
|
|
90
100
|
var safeSerialize = toJsonSafe;
|
|
91
101
|
function extractContentBlocks(content) {
|
|
@@ -964,7 +974,7 @@ var LANGGRAPH_METADATA_KEYS = [
|
|
|
964
974
|
"langgraph_checkpoint_ns"
|
|
965
975
|
];
|
|
966
976
|
function nowIso2() {
|
|
967
|
-
return (
|
|
977
|
+
return nowIsoTimestamp();
|
|
968
978
|
}
|
|
969
979
|
function normalizeChainStartArgs(parentRunIdOrRunType, runTypeOrRunName, runNameOrParentRunId) {
|
|
970
980
|
if (parentRunIdOrRunType && CHAIN_RUN_TYPES.has(parentRunIdOrRunType)) {
|
|
@@ -2559,7 +2569,7 @@ function getCurrentTrace() {
|
|
|
2559
2569
|
if (!traceState) {
|
|
2560
2570
|
traceState = {
|
|
2561
2571
|
traceId,
|
|
2562
|
-
startedAt: (
|
|
2572
|
+
startedAt: nowIsoTimestamp(),
|
|
2563
2573
|
contexts: []
|
|
2564
2574
|
};
|
|
2565
2575
|
activeTraceStates.set(traceId, traceState);
|
|
@@ -3493,7 +3503,7 @@ var Bitfab = class {
|
|
|
3493
3503
|
const newContext = { traceId, spanId, contexts: [] };
|
|
3494
3504
|
newStack = [...currentStack, newContext];
|
|
3495
3505
|
const inputs = args;
|
|
3496
|
-
const startedAt = (
|
|
3506
|
+
const startedAt = nowIsoTimestamp();
|
|
3497
3507
|
const replayCtxAtStart = getReplayContext();
|
|
3498
3508
|
const testRunId = replayCtxAtStart?.testRunId ?? options.testRunId;
|
|
3499
3509
|
if (isRootSpan && !activeTraceStates.has(traceId)) {
|
|
@@ -3528,7 +3538,7 @@ var Bitfab = class {
|
|
|
3528
3538
|
const sendSpan = async (params) => {
|
|
3529
3539
|
const replayCtx = getReplayContext();
|
|
3530
3540
|
try {
|
|
3531
|
-
const endedAt = (
|
|
3541
|
+
const endedAt = nowIsoTimestamp();
|
|
3532
3542
|
const traceDropped = activeTraceStates.get(traceId)?.dropped === true;
|
|
3533
3543
|
if (!traceDropped) {
|
|
3534
3544
|
self.sendWrapperSpan({
|
|
@@ -4102,7 +4112,7 @@ var Bitfab = class {
|
|
|
4102
4112
|
`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.`
|
|
4103
4113
|
);
|
|
4104
4114
|
}
|
|
4105
|
-
const { replay: doReplay } = await import("./replay-
|
|
4115
|
+
const { replay: doReplay } = await import("./replay-EC7CQOO3.js");
|
|
4106
4116
|
return doReplay(
|
|
4107
4117
|
this.httpClient,
|
|
4108
4118
|
this.serviceUrl,
|
|
@@ -4355,4 +4365,4 @@ export {
|
|
|
4355
4365
|
finalizers,
|
|
4356
4366
|
defineReplayRegistry
|
|
4357
4367
|
};
|
|
4358
|
-
//# sourceMappingURL=chunk-
|
|
4368
|
+
//# sourceMappingURL=chunk-B4XXAK74.js.map
|