@bitfab/sdk 0.28.7 → 0.28.9

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
@@ -1015,12 +1015,14 @@ interface CurrentTrace {
1015
1015
  */
1016
1016
  addContext(context: Record<string, unknown>): void;
1017
1017
  /**
1018
- * Flag this trace to be dropped. When the trace completes, the server scrubs
1019
- * its payloads (trace, external trace, and all spans) and marks it `dropped`
1020
- * instead of `completed`, retaining only a skeleton audit record. Use this to
1021
- * discard runs you never want stored (e.g. health checks, or a run you know
1022
- * contains sensitive data). Takes effect at trace completion; a trace that is
1023
- * flagged but never completes is not scrubbed.
1018
+ * Flag this trace to be dropped. Once flagged, spans that complete afterward
1019
+ * are not uploaded at all, and when the trace completes the server scrubs any
1020
+ * payloads that already raced out (trace, external trace, and sibling spans),
1021
+ * marking it `dropped` instead of `completed` and retaining only a skeleton
1022
+ * audit record. Use this to discard runs you never want stored (e.g. health
1023
+ * checks, or a run you know contains sensitive data). Takes effect
1024
+ * immediately for later spans; the server-side scrub takes effect at trace
1025
+ * completion, so a trace that is flagged but never completes is not scrubbed.
1024
1026
  */
1025
1027
  drop(): void;
1026
1028
  }
@@ -1612,7 +1614,7 @@ declare class BitfabFunction {
1612
1614
  /**
1613
1615
  * SDK version from package.json (injected at build time)
1614
1616
  */
1615
- declare const __version__ = "0.28.7";
1617
+ declare const __version__ = "0.28.9";
1616
1618
 
1617
1619
  /**
1618
1620
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -1015,12 +1015,14 @@ interface CurrentTrace {
1015
1015
  */
1016
1016
  addContext(context: Record<string, unknown>): void;
1017
1017
  /**
1018
- * Flag this trace to be dropped. When the trace completes, the server scrubs
1019
- * its payloads (trace, external trace, and all spans) and marks it `dropped`
1020
- * instead of `completed`, retaining only a skeleton audit record. Use this to
1021
- * discard runs you never want stored (e.g. health checks, or a run you know
1022
- * contains sensitive data). Takes effect at trace completion; a trace that is
1023
- * flagged but never completes is not scrubbed.
1018
+ * Flag this trace to be dropped. Once flagged, spans that complete afterward
1019
+ * are not uploaded at all, and when the trace completes the server scrubs any
1020
+ * payloads that already raced out (trace, external trace, and sibling spans),
1021
+ * marking it `dropped` instead of `completed` and retaining only a skeleton
1022
+ * audit record. Use this to discard runs you never want stored (e.g. health
1023
+ * checks, or a run you know contains sensitive data). Takes effect
1024
+ * immediately for later spans; the server-side scrub takes effect at trace
1025
+ * completion, so a trace that is flagged but never completes is not scrubbed.
1024
1026
  */
1025
1027
  drop(): void;
1026
1028
  }
@@ -1612,7 +1614,7 @@ declare class BitfabFunction {
1612
1614
  /**
1613
1615
  * SDK version from package.json (injected at build time)
1614
1616
  */
1615
- declare const __version__ = "0.28.7";
1617
+ declare const __version__ = "0.28.9";
1616
1618
 
1617
1619
  /**
1618
1620
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  flushTraces,
15
15
  getCurrentSpan,
16
16
  getCurrentTrace
17
- } from "./chunk-TIMBGA3A.js";
17
+ } from "./chunk-VQ4GMKQ7.js";
18
18
  import {
19
19
  BITFAB_PROGRESS_PREFIX,
20
20
  BitfabError,
package/dist/node.cjs CHANGED
@@ -697,7 +697,7 @@ registerAsyncLocalStorageClass(
697
697
  );
698
698
 
699
699
  // src/version.generated.ts
700
- var __version__ = "0.28.7";
700
+ var __version__ = "0.28.9";
701
701
 
702
702
  // src/constants.ts
703
703
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -3976,13 +3976,16 @@ var Bitfab = class {
3976
3976
  }
3977
3977
  try {
3978
3978
  const endedAt = (/* @__PURE__ */ new Date()).toISOString();
3979
- const spanPromise = self.sendWrapperSpan({
3979
+ const traceDropped = activeTraceStates.get(traceId)?.dropped === true;
3980
+ const spanPromise = traceDropped ? Promise.resolve() : self.sendWrapperSpan({
3980
3981
  ...baseSpanParams,
3981
3982
  ...params,
3982
3983
  contexts: newContext.contexts,
3983
3984
  prompt: newContext.prompt,
3984
3985
  endedAt,
3985
- ...replayCtx?.testRunId && { testRunId: replayCtx.testRunId },
3986
+ ...replayCtx?.testRunId && {
3987
+ testRunId: replayCtx.testRunId
3988
+ },
3986
3989
  ...replayCtx?.inputSourceSpanId && {
3987
3990
  inputSourceSpanId: replayCtx.inputSourceSpanId
3988
3991
  }
@@ -4070,7 +4073,7 @@ var Bitfab = class {
4070
4073
  meta: mockSpan.outputMeta
4071
4074
  });
4072
4075
  }
4073
- void sendSpan({ result: output });
4076
+ void sendSpan({ result: output, mocked: true });
4074
4077
  if (fnReturnsPromise) {
4075
4078
  return Promise.resolve(output);
4076
4079
  }
@@ -4322,7 +4325,8 @@ var Bitfab = class {
4322
4325
  sourceTraceId: params.traceId,
4323
4326
  traceFunctionKey: params.traceFunctionKey,
4324
4327
  rawSpan: externalSpan,
4325
- ...params.testRunId && { testRunId: params.testRunId }
4328
+ ...params.testRunId && { testRunId: params.testRunId },
4329
+ ...params.mocked && { mocked: true }
4326
4330
  });
4327
4331
  }
4328
4332
  /**