@bitfab/sdk 0.65.0 → 0.65.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.
Files changed (93) hide show
  1. package/cloudReplay.py +207 -30
  2. package/dist/autoTrace.cjs +28 -0
  3. package/dist/autoTrace.cjs.map +1 -1
  4. package/dist/autoTrace.d.cts +2 -1
  5. package/dist/autoTrace.d.ts +2 -1
  6. package/dist/autoTrace.js +3 -1
  7. package/dist/{chunk-3W6RLPGK.js → chunk-BRMGNMDO.js} +4 -4
  8. package/dist/chunk-BRMGNMDO.js.map +1 -0
  9. package/dist/{chunk-WW2RMMTA.js → chunk-CLP2L5PU.js} +2 -2
  10. package/dist/{chunk-WW2RMMTA.js.map → chunk-CLP2L5PU.js.map} +1 -1
  11. package/dist/{chunk-JIGT4NC5.js → chunk-HLH7TN2A.js} +2 -2
  12. package/dist/{chunk-TNIJXUGC.js → chunk-LCV2JYXL.js} +2 -2
  13. package/dist/{chunk-TNIJXUGC.js.map → chunk-LCV2JYXL.js.map} +1 -1
  14. package/dist/{chunk-SUXEIG4U.js → chunk-NRE5CJPR.js} +29 -13
  15. package/dist/chunk-NRE5CJPR.js.map +1 -0
  16. package/dist/{chunk-MN3E2RUU.js → chunk-PTCLRG4E.js} +3 -3
  17. package/dist/{chunk-YWXQM6J3.js → chunk-QRNHRY7F.js} +28 -1
  18. package/dist/chunk-QRNHRY7F.js.map +1 -0
  19. package/dist/{chunk-IBWW3SP4.js → chunk-YVJAOGHE.js} +2 -2
  20. package/dist/{chunk-JXIW4FOF.js → chunk-Z26K57WZ.js} +2 -2
  21. package/dist/{chunk-GSHCHCB5.js → chunk-ZG6SHKEF.js} +12 -41
  22. package/dist/chunk-ZG6SHKEF.js.map +1 -0
  23. package/dist/{http-7LTYEMJO.js → http-VN52X47M.js} +2 -2
  24. package/dist/{http-NNVOMI63.js → http-WP4YPPKC.js} +2 -2
  25. package/dist/index.cjs +37 -7
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +1 -1
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +4 -4
  30. package/dist/node.cjs +37 -7
  31. package/dist/node.cjs.map +1 -1
  32. package/dist/node.js +4 -4
  33. package/dist/{replay-D7AN6O25.js → replay-463SEV53.js} +3 -3
  34. package/dist/{replay-L56SESG7.js → replay-OT4A4HVF.js} +3 -3
  35. package/dist/replayCli.js +3 -3
  36. package/dist/seedCli.js +3 -3
  37. package/dist/transform/babel.cjs +11 -40
  38. package/dist/transform/babel.cjs.map +1 -1
  39. package/dist/transform/babel.js +1 -1
  40. package/dist/transform/bun.cjs +11 -40
  41. package/dist/transform/bun.cjs.map +1 -1
  42. package/dist/transform/bun.js +3 -3
  43. package/dist/transform/esbuild.cjs +11 -40
  44. package/dist/transform/esbuild.cjs.map +1 -1
  45. package/dist/transform/esbuild.js +3 -3
  46. package/dist/transform/loaderRuntime.cjs +11 -40
  47. package/dist/transform/loaderRuntime.cjs.map +1 -1
  48. package/dist/transform/loaderRuntime.js +2 -2
  49. package/dist/transform/nest.cjs +11 -40
  50. package/dist/transform/nest.cjs.map +1 -1
  51. package/dist/transform/nest.js +3 -3
  52. package/dist/transform/next.cjs +11 -40
  53. package/dist/transform/next.cjs.map +1 -1
  54. package/dist/transform/next.js +3 -3
  55. package/dist/transform/nodeLoader.js +11 -40
  56. package/dist/transform/nodeLoader.js.map +1 -1
  57. package/dist/transform/rolldown.cjs +11 -40
  58. package/dist/transform/rolldown.cjs.map +1 -1
  59. package/dist/transform/rolldown.js +3 -3
  60. package/dist/transform/rollup.cjs +11 -40
  61. package/dist/transform/rollup.cjs.map +1 -1
  62. package/dist/transform/rollup.js +3 -3
  63. package/dist/transform/rsbuild.cjs +11 -40
  64. package/dist/transform/rsbuild.cjs.map +1 -1
  65. package/dist/transform/rsbuild.js +3 -3
  66. package/dist/transform/rspack.cjs +11 -40
  67. package/dist/transform/rspack.cjs.map +1 -1
  68. package/dist/transform/rspack.js +3 -3
  69. package/dist/transform/swc.cjs +11 -40
  70. package/dist/transform/swc.cjs.map +1 -1
  71. package/dist/transform/swc.js +2 -2
  72. package/dist/transform/unplugin.cjs +11 -40
  73. package/dist/transform/unplugin.cjs.map +1 -1
  74. package/dist/transform/unplugin.js +3 -3
  75. package/dist/transform/vite.cjs +11 -40
  76. package/dist/transform/vite.cjs.map +1 -1
  77. package/dist/transform/vite.js +3 -3
  78. package/dist/transform/webpack.cjs +11 -40
  79. package/dist/transform/webpack.cjs.map +1 -1
  80. package/dist/transform/webpack.js +3 -3
  81. package/package.json +11 -11
  82. package/dist/chunk-3W6RLPGK.js.map +0 -1
  83. package/dist/chunk-GSHCHCB5.js.map +0 -1
  84. package/dist/chunk-SUXEIG4U.js.map +0 -1
  85. package/dist/chunk-YWXQM6J3.js.map +0 -1
  86. /package/dist/{chunk-JIGT4NC5.js.map → chunk-HLH7TN2A.js.map} +0 -0
  87. /package/dist/{chunk-MN3E2RUU.js.map → chunk-PTCLRG4E.js.map} +0 -0
  88. /package/dist/{chunk-IBWW3SP4.js.map → chunk-YVJAOGHE.js.map} +0 -0
  89. /package/dist/{chunk-JXIW4FOF.js.map → chunk-Z26K57WZ.js.map} +0 -0
  90. /package/dist/{http-7LTYEMJO.js.map → http-VN52X47M.js.map} +0 -0
  91. /package/dist/{http-NNVOMI63.js.map → http-WP4YPPKC.js.map} +0 -0
  92. /package/dist/{replay-D7AN6O25.js.map → replay-463SEV53.js.map} +0 -0
  93. /package/dist/{replay-L56SESG7.js.map → replay-OT4A4HVF.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -4284,7 +4284,7 @@ interface CommitRef {
4284
4284
  /**
4285
4285
  * SDK version from package.json (injected at build time)
4286
4286
  */
4287
- declare const __version__ = "0.65.0";
4287
+ declare const __version__ = "0.65.3";
4288
4288
 
4289
4289
  /**
4290
4290
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -4284,7 +4284,7 @@ interface CommitRef {
4284
4284
  /**
4285
4285
  * SDK version from package.json (injected at build time)
4286
4286
  */
4287
- declare const __version__ = "0.65.0";
4287
+ declare const __version__ = "0.65.3";
4288
4288
 
4289
4289
  /**
4290
4290
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -29,8 +29,8 @@ import {
29
29
  getCurrentTrace,
30
30
  reseedFromRegistry,
31
31
  seedFromRegistry
32
- } from "./chunk-SUXEIG4U.js";
33
- import "./chunk-YWXQM6J3.js";
32
+ } from "./chunk-NRE5CJPR.js";
33
+ import "./chunk-QRNHRY7F.js";
34
34
  import {
35
35
  BITFAB_PROGRESS_PREFIX,
36
36
  DbBranchReplayError,
@@ -38,7 +38,7 @@ import {
38
38
  ReplayError,
39
39
  reportReplayProgress,
40
40
  serializeReplayResult
41
- } from "./chunk-JIGT4NC5.js";
41
+ } from "./chunk-HLH7TN2A.js";
42
42
  import {
43
43
  BitfabError,
44
44
  DEFAULT_SERVICE_URL,
@@ -46,7 +46,7 @@ import {
46
46
  MixedTracingError,
47
47
  __version__,
48
48
  flushTraces
49
- } from "./chunk-TNIJXUGC.js";
49
+ } from "./chunk-LCV2JYXL.js";
50
50
  import "./chunk-MT36GJMW.js";
51
51
  export {
52
52
  AssertionCategoriesClient,
package/dist/node.cjs CHANGED
@@ -88,7 +88,7 @@ var __version__, __packageName__;
88
88
  var init_version_generated = __esm({
89
89
  "src/version.generated.ts"() {
90
90
  "use strict";
91
- __version__ = "0.65.0";
91
+ __version__ = "0.65.3";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -6150,6 +6150,21 @@ function runWithAutoTraceNodeConfiguration(nodeConfiguration, fn) {
6150
6150
  }
6151
6151
  return result;
6152
6152
  }
6153
+ function runAsAutoTraceRootFunction(functionName, fn) {
6154
+ const scope = currentAutoTraceScope();
6155
+ if (!scope || scope.entries.length === 0 || functionName === "") {
6156
+ return fn();
6157
+ }
6158
+ const rootFunction = {
6159
+ name: functionName,
6160
+ entering: true
6161
+ };
6162
+ try {
6163
+ return runWithAutoTraceScope({ ...scope, rootFunction }, fn);
6164
+ } finally {
6165
+ rootFunction.entering = false;
6166
+ }
6167
+ }
6153
6168
  var SUBTREE_TRACING_DOCS_URL = "https://docs.bitfab.ai/typescript-sdk#experimental-subtree-tracing";
6154
6169
  function transformInstalled() {
6155
6170
  return autoTraceGlobal.__bitfab_auto_trace_transformed_v1__ === true;
@@ -10058,6 +10073,11 @@ function readBooleanEnv(name) {
10058
10073
  );
10059
10074
  return void 0;
10060
10075
  }
10076
+ var AUTO_TRACE_NODE_FUNCTION_NAMES = /* @__PURE__ */ new WeakMap();
10077
+ function registerAutoTraceNode(configured, functionName) {
10078
+ AUTO_TRACE_NODE_FUNCTION_NAMES.set(configured, functionName);
10079
+ return configured;
10080
+ }
10061
10081
  var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
10062
10082
  var DEFAULT_AUTO_TRACE_MAX_CAPTURED_SUBTREE_SPANS = 500;
10063
10083
  function spanOwnerName(receiver) {
@@ -10193,7 +10213,13 @@ var Bitfab = class {
10193
10213
  throw new BitfabError("bitfab.withTrace requires a function");
10194
10214
  }
10195
10215
  const name = fn.name !== "" ? fn.name : traceFunctionKey;
10196
- return this.createAutoTraceRoot(traceFunctionKey, name, options, fn);
10216
+ return this.createAutoTraceRoot(
10217
+ traceFunctionKey,
10218
+ name,
10219
+ options,
10220
+ fn,
10221
+ AUTO_TRACE_NODE_FUNCTION_NAMES.get(fn) ?? fn.name.replace(/^bound /, "")
10222
+ );
10197
10223
  }
10198
10224
  /**
10199
10225
  * Configure a transformed class method when it is discovered beneath a
@@ -10274,7 +10300,7 @@ var Bitfab = class {
10274
10300
  }
10275
10301
  createAutoTraceNode(configuration, fn, functionName) {
10276
10302
  const nodeConfiguration = { ...configuration, functionName };
10277
- return function(...args) {
10303
+ return registerAutoTraceNode(function(...args) {
10278
10304
  if (!__bitfabAutoTraceActive()) {
10279
10305
  if (enclosingSurface() === "opt-in") {
10280
10306
  throw mixedTracingError("node()", "opt-out", "opt-in");
@@ -10285,11 +10311,15 @@ var Bitfab = class {
10285
10311
  nodeConfiguration,
10286
10312
  () => fn.apply(this, args)
10287
10313
  );
10288
- };
10314
+ }, functionName);
10289
10315
  }
10290
- createAutoTraceRoot(traceFunctionKey, name, options, fn) {
10316
+ createAutoTraceRoot(traceFunctionKey, name, options, fn, rootFunctionName = "") {
10291
10317
  const self = this;
10292
10318
  self.simulationPlan.refresh();
10319
+ const runRootFunction = (receiver, args) => runAsAutoTraceRootFunction(
10320
+ rootFunctionName,
10321
+ () => fn.apply(receiver, args)
10322
+ );
10293
10323
  const maxDepth = autoTraceLimit(
10294
10324
  options.maxDepth,
10295
10325
  DEFAULT_AUTO_TRACE_MAX_DEPTH
@@ -10452,7 +10482,7 @@ var Bitfab = class {
10452
10482
  return runWithAutoTraceRootContext(
10453
10483
  autoTraceContext,
10454
10484
  getSpanStack(),
10455
- () => fn.apply(this, args)
10485
+ () => runRootFunction(this, args)
10456
10486
  );
10457
10487
  }
10458
10488
  );
@@ -10485,7 +10515,7 @@ var Bitfab = class {
10485
10515
  ),
10486
10516
  () => {
10487
10517
  if (link === void 0) {
10488
- return fn.apply(this, args);
10518
+ return runRootFunction(this, args);
10489
10519
  }
10490
10520
  const innermost = enclosing[enclosing.length - 1];
10491
10521
  const innermostNow = currentAutoTraceEntries().find(