@bitfab/sdk 0.58.4 → 0.58.5

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.
Files changed (39) hide show
  1. package/dist/autoTrace.cjs +50 -4
  2. package/dist/autoTrace.cjs.map +1 -1
  3. package/dist/autoTrace.d.cts +2 -1
  4. package/dist/autoTrace.d.ts +2 -1
  5. package/dist/autoTrace.js +4 -2
  6. package/dist/{chunk-VCRFFCLY.js → chunk-BAOIRE5T.js} +20 -2
  7. package/dist/chunk-BAOIRE5T.js.map +1 -0
  8. package/dist/{chunk-3LJVTDD5.js → chunk-E25HU4YZ.js} +2 -2
  9. package/dist/{chunk-3LJVTDD5.js.map → chunk-E25HU4YZ.js.map} +1 -1
  10. package/dist/{chunk-RCHSYWKI.js → chunk-ETZUSSF6.js} +38 -8
  11. package/dist/chunk-ETZUSSF6.js.map +1 -0
  12. package/dist/{chunk-ZLAFCSCP.js → chunk-IP2AYKT7.js} +6 -21
  13. package/dist/chunk-IP2AYKT7.js.map +1 -0
  14. package/dist/{chunk-74ECLOFY.js → chunk-NNSJVCR3.js} +3 -3
  15. package/dist/{chunk-UKJ3RWVS.js → chunk-Y47DQCCK.js} +11 -11
  16. package/dist/{chunk-BVUGW7BJ.js → chunk-YGZA3H67.js} +6 -6
  17. package/dist/{http-NG5NP6PH.js → http-6K4GQC4S.js} +2 -2
  18. package/dist/{http-XTSUPZEC.js → http-PVE62D6W.js} +3 -3
  19. package/dist/index.cjs +26 -5
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +5 -5
  24. package/dist/node.cjs +26 -5
  25. package/dist/node.cjs.map +1 -1
  26. package/dist/node.js +5 -5
  27. package/dist/{replay-JHFO457Z.js → replay-6WA5GD4R.js} +4 -4
  28. package/dist/replayCli.js +2 -2
  29. package/dist/seedCli.js +2 -2
  30. package/package.json +1 -1
  31. package/dist/chunk-RCHSYWKI.js.map +0 -1
  32. package/dist/chunk-VCRFFCLY.js.map +0 -1
  33. package/dist/chunk-ZLAFCSCP.js.map +0 -1
  34. /package/dist/{chunk-74ECLOFY.js.map → chunk-NNSJVCR3.js.map} +0 -0
  35. /package/dist/{chunk-UKJ3RWVS.js.map → chunk-Y47DQCCK.js.map} +0 -0
  36. /package/dist/{chunk-BVUGW7BJ.js.map → chunk-YGZA3H67.js.map} +0 -0
  37. /package/dist/{http-NG5NP6PH.js.map → http-6K4GQC4S.js.map} +0 -0
  38. /package/dist/{http-XTSUPZEC.js.map → http-PVE62D6W.js.map} +0 -0
  39. /package/dist/{replay-JHFO457Z.js.map → replay-6WA5GD4R.js.map} +0 -0
@@ -4,12 +4,12 @@ import {
4
4
  flushTraces,
5
5
  gitRunner,
6
6
  replayContextReady,
7
- runWithReplayContext,
8
- warnOnce
9
- } from "./chunk-ZLAFCSCP.js";
7
+ runWithReplayContext
8
+ } from "./chunk-IP2AYKT7.js";
10
9
  import {
11
- runWithCaptureSuppressed
12
- } from "./chunk-VCRFFCLY.js";
10
+ runWithCaptureSuppressed,
11
+ warnOnce
12
+ } from "./chunk-BAOIRE5T.js";
13
13
 
14
14
  // src/codeChange.ts
15
15
  var MAX_FILES = 60;
@@ -1264,4 +1264,4 @@ export {
1264
1264
  sleepForReplayPersistence,
1265
1265
  replay
1266
1266
  };
1267
- //# sourceMappingURL=chunk-BVUGW7BJ.js.map
1267
+ //# sourceMappingURL=chunk-YGZA3H67.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-3LJVTDD5.js";
9
+ } from "./chunk-E25HU4YZ.js";
10
10
  export {
11
11
  BitfabError,
12
12
  HttpClient,
@@ -16,4 +16,4 @@ export {
16
16
  parseRetryAfterMs,
17
17
  serializePayloadBody
18
18
  };
19
- //# sourceMappingURL=http-NG5NP6PH.js.map
19
+ //# sourceMappingURL=http-6K4GQC4S.js.map
@@ -6,8 +6,8 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-ZLAFCSCP.js";
10
- import "./chunk-VCRFFCLY.js";
9
+ } from "./chunk-IP2AYKT7.js";
10
+ import "./chunk-BAOIRE5T.js";
11
11
  export {
12
12
  BitfabError,
13
13
  HttpClient,
@@ -17,4 +17,4 @@ export {
17
17
  parseRetryAfterMs,
18
18
  serializePayloadBody
19
19
  };
20
- //# sourceMappingURL=http-XTSUPZEC.js.map
20
+ //# sourceMappingURL=http-PVE62D6W.js.map
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.58.4";
45
+ __version__ = "0.58.5";
46
46
  __packageName__ = "@bitfab/sdk";
47
47
  }
48
48
  });
@@ -5097,6 +5097,7 @@ init_asyncStorage();
5097
5097
  // src/autoTrace.ts
5098
5098
  init_asyncStorage();
5099
5099
  init_captureSuppression();
5100
+ init_warnOnce();
5100
5101
  var autoTraceGlobal = globalThis;
5101
5102
  var autoTraceState = autoTraceGlobal.__bitfabAutoTraceStateV4 ?? {
5102
5103
  storage: null,
@@ -5164,6 +5165,26 @@ function runWithAutoTraceNodeConfiguration(nodeConfiguration, fn) {
5164
5165
  }
5165
5166
  return result;
5166
5167
  }
5168
+ var SUBTREE_TRACING_DOCS_URL = "https://docs.bitfab.ai/typescript-sdk#experimental-subtree-tracing";
5169
+ function transformInstalled() {
5170
+ return autoTraceGlobal.__bitfab_auto_trace_transformed_v1__ === true;
5171
+ }
5172
+ function runsOnNode() {
5173
+ return typeof process !== "undefined" && Boolean(process.versions?.node);
5174
+ }
5175
+ function closeAutoTraceRoot() {
5176
+ autoTraceState.activeRoots -= 1;
5177
+ }
5178
+ function settleAutoTraceRoot(context) {
5179
+ closeAutoTraceRoot();
5180
+ if (transformInstalled() || !runsOnNode()) {
5181
+ return;
5182
+ }
5183
+ warnOnce(
5184
+ "auto-trace-transform-missing",
5185
+ `trace root "${context.traceFunctionKey}" recorded only its own span. No module in this build was compiled by @bitfab/transform, so calls beneath the root were not discovered. Install @bitfab/transform and add its adapter to the server build: ${SUBTREE_TRACING_DOCS_URL}`
5186
+ );
5187
+ }
5167
5188
  function runWithAutoTraceRootContext(context, spanStack, fn) {
5168
5189
  autoTraceState.activeRoots += 1;
5169
5190
  const entries = [
@@ -5174,19 +5195,19 @@ function runWithAutoTraceRootContext(context, spanStack, fn) {
5174
5195
  try {
5175
5196
  result = runWithAutoTraceScope({ entries }, fn);
5176
5197
  } catch (error) {
5177
- autoTraceState.activeRoots -= 1;
5198
+ settleAutoTraceRoot(context);
5178
5199
  throw error;
5179
5200
  }
5180
5201
  if (isAutoTraceAsyncGenerator(result)) {
5181
- autoTraceState.activeRoots -= 1;
5202
+ closeAutoTraceRoot();
5182
5203
  return wrapAutoTraceAsyncGenerator(context, spanStack, result);
5183
5204
  }
5184
5205
  if (result instanceof Promise) {
5185
5206
  return result.finally(() => {
5186
- autoTraceState.activeRoots -= 1;
5207
+ settleAutoTraceRoot(context);
5187
5208
  });
5188
5209
  }
5189
- autoTraceState.activeRoots -= 1;
5210
+ settleAutoTraceRoot(context);
5190
5211
  return result;
5191
5212
  }
5192
5213
  function invokeThroughAutoTraceEntries(entries, step, fn) {