@bitfab/sdk 0.28.9 → 0.28.10

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.
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-5E4BUIYA.js";
14
14
 
15
15
  // src/version.generated.ts
16
- var __version__ = "0.28.9";
16
+ var __version__ = "0.28.10";
17
17
 
18
18
  // src/constants.ts
19
19
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -2436,8 +2436,11 @@ var BitfabVercelAiHandler = class {
2436
2436
  var activeTraceStates = /* @__PURE__ */ new Map();
2437
2437
  var pendingSpanPromises = /* @__PURE__ */ new Map();
2438
2438
  var asyncLocalStorage = null;
2439
+ var initializeAsyncContext = () => {
2440
+ asyncLocalStorage ?? (asyncLocalStorage = createAsyncLocalStorage());
2441
+ };
2439
2442
  var asyncLocalStorageReady = asyncStorageReady.then(() => {
2440
- asyncLocalStorage = createAsyncLocalStorage();
2443
+ initializeAsyncContext();
2441
2444
  });
2442
2445
  var browserSpanStack = [];
2443
2446
  function getSpanStack() {
@@ -3206,6 +3209,7 @@ var Bitfab = class {
3206
3209
  if (!self.isTracingEnabled()) {
3207
3210
  return fn.apply(this, args);
3208
3211
  }
3212
+ initializeAsyncContext();
3209
3213
  if (!asyncLocalStorage && !isAsyncStorageInitDone()) {
3210
3214
  return asyncLocalStorageReady.then(
3211
3215
  () => wrappedFn.apply(this, args)
@@ -3881,4 +3885,4 @@ export {
3881
3885
  BitfabFunction,
3882
3886
  finalizers
3883
3887
  };
3884
- //# sourceMappingURL=chunk-VQ4GMKQ7.js.map
3888
+ //# sourceMappingURL=chunk-SK4TNXRC.js.map