@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
package/dist/index.cjs
CHANGED
|
@@ -42,7 +42,7 @@ var __version__, __packageName__;
|
|
|
42
42
|
var init_version_generated = __esm({
|
|
43
43
|
"src/version.generated.ts"() {
|
|
44
44
|
"use strict";
|
|
45
|
-
__version__ = "0.38.
|
|
45
|
+
__version__ = "0.38.9";
|
|
46
46
|
__packageName__ = "@bitfab/sdk";
|
|
47
47
|
}
|
|
48
48
|
});
|
|
@@ -3217,8 +3217,20 @@ function finalizeTracePayload(payload) {
|
|
|
3217
3217
|
// src/claudeAgentSdk.ts
|
|
3218
3218
|
init_randomUuid();
|
|
3219
3219
|
init_serialize();
|
|
3220
|
+
|
|
3221
|
+
// src/timestamp.ts
|
|
3222
|
+
var lastTimestampMicros = 0;
|
|
3223
|
+
function nowIsoTimestamp() {
|
|
3224
|
+
const wallClockMicros = Date.now() * 1e3;
|
|
3225
|
+
lastTimestampMicros = Math.max(wallClockMicros, lastTimestampMicros + 1);
|
|
3226
|
+
const milliseconds = Math.floor(lastTimestampMicros / 1e3);
|
|
3227
|
+
const remainingMicros = lastTimestampMicros % 1e3;
|
|
3228
|
+
return new Date(milliseconds).toISOString().replace("Z", `${remainingMicros.toString().padStart(3, "0")}Z`);
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
// src/claudeAgentSdk.ts
|
|
3220
3232
|
function nowIso() {
|
|
3221
|
-
return (
|
|
3233
|
+
return nowIsoTimestamp();
|
|
3222
3234
|
}
|
|
3223
3235
|
var safeSerialize = toJsonSafe;
|
|
3224
3236
|
function extractContentBlocks(content) {
|
|
@@ -4238,7 +4250,7 @@ var LANGGRAPH_METADATA_KEYS = [
|
|
|
4238
4250
|
"langgraph_checkpoint_ns"
|
|
4239
4251
|
];
|
|
4240
4252
|
function nowIso2() {
|
|
4241
|
-
return (
|
|
4253
|
+
return nowIsoTimestamp();
|
|
4242
4254
|
}
|
|
4243
4255
|
function normalizeChainStartArgs(parentRunIdOrRunType, runTypeOrRunName, runNameOrParentRunId) {
|
|
4244
4256
|
if (parentRunIdOrRunType && CHAIN_RUN_TYPES.has(parentRunIdOrRunType)) {
|
|
@@ -5849,7 +5861,7 @@ function getCurrentTrace() {
|
|
|
5849
5861
|
if (!traceState) {
|
|
5850
5862
|
traceState = {
|
|
5851
5863
|
traceId,
|
|
5852
|
-
startedAt: (
|
|
5864
|
+
startedAt: nowIsoTimestamp(),
|
|
5853
5865
|
contexts: []
|
|
5854
5866
|
};
|
|
5855
5867
|
activeTraceStates.set(traceId, traceState);
|
|
@@ -6783,7 +6795,7 @@ var Bitfab = class {
|
|
|
6783
6795
|
const newContext = { traceId, spanId, contexts: [] };
|
|
6784
6796
|
newStack = [...currentStack, newContext];
|
|
6785
6797
|
const inputs = args;
|
|
6786
|
-
const startedAt = (
|
|
6798
|
+
const startedAt = nowIsoTimestamp();
|
|
6787
6799
|
const replayCtxAtStart = getReplayContext();
|
|
6788
6800
|
const testRunId = replayCtxAtStart?.testRunId ?? options.testRunId;
|
|
6789
6801
|
if (isRootSpan && !activeTraceStates.has(traceId)) {
|
|
@@ -6818,7 +6830,7 @@ var Bitfab = class {
|
|
|
6818
6830
|
const sendSpan = async (params) => {
|
|
6819
6831
|
const replayCtx = getReplayContext();
|
|
6820
6832
|
try {
|
|
6821
|
-
const endedAt = (
|
|
6833
|
+
const endedAt = nowIsoTimestamp();
|
|
6822
6834
|
const traceDropped = activeTraceStates.get(traceId)?.dropped === true;
|
|
6823
6835
|
if (!traceDropped) {
|
|
6824
6836
|
self.sendWrapperSpan({
|