@bitfab/sdk 0.38.1 → 0.38.3

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.
@@ -1,10 +1,7 @@
1
- var __typeError = (msg) => {
2
- throw TypeError(msg);
3
- };
4
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
5
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
6
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
7
- var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
1
+ import {
2
+ asyncStorageReady,
3
+ createAsyncLocalStorage
4
+ } from "./chunk-H6LZRFMN.js";
8
5
 
9
6
  // src/codeChange.ts
10
7
  var MAX_FILES = 60;
@@ -314,52 +311,12 @@ function encodeRequestBody(body) {
314
311
  }
315
312
 
316
313
  // src/version.generated.ts
317
- var __version__ = "0.38.1";
314
+ var __version__ = "0.38.3";
318
315
  var __packageName__ = "@bitfab/sdk";
319
316
 
320
317
  // src/constants.ts
321
318
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
322
319
 
323
- // src/asyncStorage.ts
324
- var AsyncLocalStorageClass = null;
325
- var initDone = false;
326
- function registerAsyncLocalStorageClass(cls) {
327
- if (!AsyncLocalStorageClass) {
328
- AsyncLocalStorageClass = cls;
329
- }
330
- initDone = true;
331
- }
332
- function assertAsyncStorageRegistered() {
333
- if (!AsyncLocalStorageClass) {
334
- console.warn(
335
- "Bitfab: AsyncLocalStorage not available - nested span context will not propagate."
336
- );
337
- }
338
- }
339
- var asyncStorageReady = (typeof process !== "undefined" && process.versions?.node ? (
340
- // The join trick hides "node:async_hooks" from static analysis so
341
- // bundlers that ban Node.js built-ins don't fail at build time.
342
- // webpackIgnore tells webpack/turbopack to emit a native import()
343
- // so Node.js can resolve the module at runtime.
344
- import(
345
- /* webpackIgnore: true */
346
- ["node", "async_hooks"].join(":")
347
- ).then(
348
- (mod) => {
349
- registerAsyncLocalStorageClass(mod.AsyncLocalStorage);
350
- }
351
- ).catch(() => {
352
- })
353
- ) : Promise.resolve()).then(() => {
354
- initDone = true;
355
- });
356
- function isAsyncStorageInitDone() {
357
- return initDone;
358
- }
359
- function createAsyncLocalStorage() {
360
- return AsyncLocalStorageClass ? new AsyncLocalStorageClass() : null;
361
- }
362
-
363
320
  // src/replayContext.ts
364
321
  var replayContextStorage = null;
365
322
  var REPLAY_CONTEXT_STORAGE_SYMBOL = /* @__PURE__ */ Symbol.for("bitfab.replayContextStorage");
@@ -683,7 +640,7 @@ var MAX_REQUEST_BYTES_ENV = "BITFAB_OTEL_MAX_REQUEST_BYTES";
683
640
  var EXPORT_CONCURRENCY_ENV = "BITFAB_OTEL_EXPORT_CONCURRENCY";
684
641
  var MAX_QUEUE_SIZE = 8192;
685
642
  var DIRECT_MAX_EXPORT_BATCH_SIZE = 512;
686
- var DIRECT_MAX_REQUEST_BATCH_SIZE = 8;
643
+ var DIRECT_MAX_REQUEST_BATCH_SIZE = 128;
687
644
  var DEFAULT_EXPORT_CONCURRENCY = 32;
688
645
  var MAX_EXPORT_CONCURRENCY = 64;
689
646
  var SCHEDULE_DELAY_MILLIS = 5e3;
@@ -1782,6 +1739,12 @@ var HttpClient = class {
1782
1739
  async lookupFunction(name) {
1783
1740
  return this.request("/api/sdk/functions/lookup", { name });
1784
1741
  }
1742
+ async getAutoTracePolicy(traceFunctionKey, protocol) {
1743
+ return this.request("/api/sdk/auto-trace/policy", {
1744
+ traceFunctionKey,
1745
+ protocol
1746
+ });
1747
+ }
1785
1748
  async getTraceSpan(traceId, lookup) {
1786
1749
  const searchParams = new URLSearchParams();
1787
1750
  if (lookup.id !== void 0) {
@@ -2658,6 +2621,11 @@ async function replay(httpClient, serviceUrl, traceFunctionKey, fn, options, reg
2658
2621
  );
2659
2622
  }
2660
2623
  }
2624
+ if (options?.traceIds !== void 0 && options?.datasetId !== void 0) {
2625
+ throw new BitfabError(
2626
+ "traceIds and datasetId select different replay sources and cannot be used together."
2627
+ );
2628
+ }
2661
2629
  if (options?.limit !== void 0 && options?.traceIds !== void 0) {
2662
2630
  try {
2663
2631
  console.warn(
@@ -2933,17 +2901,9 @@ async function writeReplayResultFile(result) {
2933
2901
  }
2934
2902
 
2935
2903
  export {
2936
- __privateGet,
2937
- __privateAdd,
2938
- __privateSet,
2939
2904
  __version__,
2940
2905
  DEFAULT_SERVICE_URL,
2941
2906
  BitfabError,
2942
- registerAsyncLocalStorageClass,
2943
- assertAsyncStorageRegistered,
2944
- asyncStorageReady,
2945
- isAsyncStorageInitDone,
2946
- createAsyncLocalStorage,
2947
2907
  getReplayContext,
2948
2908
  warnOnce,
2949
2909
  flushTraces,
@@ -2963,4 +2923,4 @@ export {
2963
2923
  sleepForReplayPersistence,
2964
2924
  replay
2965
2925
  };
2966
- //# sourceMappingURL=chunk-MGA7ROIK.js.map
2926
+ //# sourceMappingURL=chunk-WX6AEFCP.js.map