@bitfab/sdk 0.38.5 → 0.38.6

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/index.d.cts CHANGED
@@ -2183,8 +2183,9 @@ declare class Bitfab {
2183
2183
  * Decorate a class method as an automatically expanded trace root.
2184
2184
  *
2185
2185
  * Build instrumentation turns repository functions called beneath this
2186
- * method into nested spans. Every generated span preserves structure; only
2187
- * function IDs selected by the capture policy include inputs and output.
2186
+ * method into nested spans that capture inputs, outputs, and errors by
2187
+ * default. A confirmed capture policy can narrow rich capture to selected
2188
+ * function IDs.
2188
2189
  * Without a compatible build transform, this still records the decorated
2189
2190
  * method as a normal rich root span but cannot discover child calls.
2190
2191
  *
@@ -2198,8 +2199,10 @@ declare class Bitfab {
2198
2199
  *
2199
2200
  * This is the function-oriented equivalent of {@link Bitfab.trace}. Build
2200
2201
  * instrumentation turns repository functions called beneath the wrapped
2201
- * function into nested spans. Without a compatible transform, this still
2202
- * records one normal rich root span and runs the function unchanged.
2202
+ * function into nested spans that capture inputs, outputs, and errors by
2203
+ * default. A confirmed capture policy can narrow rich capture to selected
2204
+ * function IDs. Without a compatible transform, this still records one
2205
+ * normal rich root span and runs the function unchanged.
2203
2206
  *
2204
2207
  * @param traceFunctionKey - Groups traces and their capture policy.
2205
2208
  * @param optionsOrFn - Options or the workflow entrypoint to wrap.
@@ -2786,7 +2789,7 @@ declare class BitfabFunction {
2786
2789
  /**
2787
2790
  * SDK version from package.json (injected at build time)
2788
2791
  */
2789
- declare const __version__ = "0.38.5";
2792
+ declare const __version__ = "0.38.6";
2790
2793
 
2791
2794
  /**
2792
2795
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -2183,8 +2183,9 @@ declare class Bitfab {
2183
2183
  * Decorate a class method as an automatically expanded trace root.
2184
2184
  *
2185
2185
  * Build instrumentation turns repository functions called beneath this
2186
- * method into nested spans. Every generated span preserves structure; only
2187
- * function IDs selected by the capture policy include inputs and output.
2186
+ * method into nested spans that capture inputs, outputs, and errors by
2187
+ * default. A confirmed capture policy can narrow rich capture to selected
2188
+ * function IDs.
2188
2189
  * Without a compatible build transform, this still records the decorated
2189
2190
  * method as a normal rich root span but cannot discover child calls.
2190
2191
  *
@@ -2198,8 +2199,10 @@ declare class Bitfab {
2198
2199
  *
2199
2200
  * This is the function-oriented equivalent of {@link Bitfab.trace}. Build
2200
2201
  * instrumentation turns repository functions called beneath the wrapped
2201
- * function into nested spans. Without a compatible transform, this still
2202
- * records one normal rich root span and runs the function unchanged.
2202
+ * function into nested spans that capture inputs, outputs, and errors by
2203
+ * default. A confirmed capture policy can narrow rich capture to selected
2204
+ * function IDs. Without a compatible transform, this still records one
2205
+ * normal rich root span and runs the function unchanged.
2203
2206
  *
2204
2207
  * @param traceFunctionKey - Groups traces and their capture policy.
2205
2208
  * @param optionsOrFn - Options or the workflow entrypoint to wrap.
@@ -2786,7 +2789,7 @@ declare class BitfabFunction {
2786
2789
  /**
2787
2790
  * SDK version from package.json (injected at build time)
2788
2791
  */
2789
- declare const __version__ = "0.38.5";
2792
+ declare const __version__ = "0.38.6";
2790
2793
 
2791
2794
  /**
2792
2795
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -12,8 +12,8 @@ import {
12
12
  getCurrentReplayBranch,
13
13
  getCurrentSpan,
14
14
  getCurrentTrace
15
- } from "./chunk-Z3GIZGS5.js";
16
- import "./chunk-J47KPS77.js";
15
+ } from "./chunk-P2MYK27A.js";
16
+ import "./chunk-ZUD7OFYB.js";
17
17
  import {
18
18
  BITFAB_PROGRESS_PREFIX,
19
19
  BitfabError,
@@ -26,7 +26,7 @@ import {
26
26
  flushTraces,
27
27
  reportReplayProgress,
28
28
  serializeReplayResult
29
- } from "./chunk-VVI573UU.js";
29
+ } from "./chunk-QTTKZMHM.js";
30
30
  import "./chunk-H6LZRFMN.js";
31
31
  export {
32
32
  BITFAB_PROGRESS_PREFIX,
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.38.5";
91
+ __version__ = "0.38.6";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -3894,11 +3894,18 @@ function currentAutoTraceScope() {
3894
3894
  }
3895
3895
  function __setBitfabAutoTraceCapturePolicy(client, traceFunctionKey, functionIds) {
3896
3896
  const policies = autoTraceState.capturePolicies.get(client) ?? /* @__PURE__ */ new Map();
3897
+ if (functionIds === void 0) {
3898
+ policies.delete(traceFunctionKey);
3899
+ if (policies.size === 0) {
3900
+ autoTraceState.capturePolicies.delete(client);
3901
+ }
3902
+ return;
3903
+ }
3897
3904
  policies.set(traceFunctionKey, new Set(functionIds));
3898
3905
  autoTraceState.capturePolicies.set(client, policies);
3899
3906
  }
3900
3907
  function getAutoTraceCapturePolicy(client, traceFunctionKey) {
3901
- return autoTraceState.capturePolicies.get(client)?.get(traceFunctionKey) ?? /* @__PURE__ */ new Set();
3908
+ return autoTraceState.capturePolicies.get(client)?.get(traceFunctionKey);
3902
3909
  }
3903
3910
 
3904
3911
  // src/optionalPeer.ts
@@ -5687,8 +5694,9 @@ var Bitfab = class {
5687
5694
  * Decorate a class method as an automatically expanded trace root.
5688
5695
  *
5689
5696
  * Build instrumentation turns repository functions called beneath this
5690
- * method into nested spans. Every generated span preserves structure; only
5691
- * function IDs selected by the capture policy include inputs and output.
5697
+ * method into nested spans that capture inputs, outputs, and errors by
5698
+ * default. A confirmed capture policy can narrow rich capture to selected
5699
+ * function IDs.
5692
5700
  * Without a compatible build transform, this still records the decorated
5693
5701
  * method as a normal rich root span but cannot discover child calls.
5694
5702
  *
@@ -5898,7 +5906,7 @@ var Bitfab = class {
5898
5906
  type: nodeConfiguration?.type ?? "function",
5899
5907
  captureWhen: "nested",
5900
5908
  functionId: definition.id,
5901
- captureContent: nodeConfiguration !== void 0 || capturePolicy.has(definition.id),
5909
+ captureContent: nodeConfiguration !== void 0 || capturePolicy === void 0 || capturePolicy.has(definition.id),
5902
5910
  autoTraceDefinition: definition,
5903
5911
  ...nodeConfiguration?.testRunId !== void 0 && {
5904
5912
  testRunId: nodeConfiguration.testRunId
@@ -5963,7 +5971,11 @@ var Bitfab = class {
5963
5971
  const functionIds = Array.isArray(policy.functionIds) ? policy.functionIds.filter(
5964
5972
  (id) => typeof id === "string" && id.startsWith(`${AUTO_TRACE_PROTOCOL}:`)
5965
5973
  ).slice(0, DEFAULT_AUTO_TRACE_MAX_SPANS) : [];
5966
- __setBitfabAutoTraceCapturePolicy(this, traceFunctionKey, functionIds);
5974
+ __setBitfabAutoTraceCapturePolicy(
5975
+ this,
5976
+ traceFunctionKey,
5977
+ policy.revision === null ? void 0 : functionIds
5978
+ );
5967
5979
  state.refreshAfter = Date.now() + AUTO_TRACE_POLICY_REFRESH_MS;
5968
5980
  }).catch(() => {
5969
5981
  state.refreshAfter = Date.now() + AUTO_TRACE_POLICY_RETRY_MS;