bitfab 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
@@ -23,7 +23,7 @@ import {
23
23
  flushTraces,
24
24
  getCurrentSpan,
25
25
  getCurrentTrace
26
- } from "./chunk-TIMBGA3A.js";
26
+ } from "./chunk-VQ4GMKQ7.js";
27
27
  import {
28
28
  BITFAB_PROGRESS_PREFIX,
29
29
  BitfabError,
package/dist/node.cjs CHANGED
@@ -706,7 +706,7 @@ registerAsyncLocalStorageClass(
706
706
  );
707
707
 
708
708
  // src/version.generated.ts
709
- var __version__ = "0.28.7";
709
+ var __version__ = "0.28.9";
710
710
 
711
711
  // src/constants.ts
712
712
  var DEFAULT_SERVICE_URL = "https://bitfab.ai";
@@ -3985,13 +3985,16 @@ var Bitfab = class {
3985
3985
  }
3986
3986
  try {
3987
3987
  const endedAt = (/* @__PURE__ */ new Date()).toISOString();
3988
- const spanPromise = self.sendWrapperSpan({
3988
+ const traceDropped = activeTraceStates.get(traceId)?.dropped === true;
3989
+ const spanPromise = traceDropped ? Promise.resolve() : self.sendWrapperSpan({
3989
3990
  ...baseSpanParams,
3990
3991
  ...params,
3991
3992
  contexts: newContext.contexts,
3992
3993
  prompt: newContext.prompt,
3993
3994
  endedAt,
3994
- ...replayCtx?.testRunId && { testRunId: replayCtx.testRunId },
3995
+ ...replayCtx?.testRunId && {
3996
+ testRunId: replayCtx.testRunId
3997
+ },
3995
3998
  ...replayCtx?.inputSourceSpanId && {
3996
3999
  inputSourceSpanId: replayCtx.inputSourceSpanId
3997
4000
  }
@@ -4079,7 +4082,7 @@ var Bitfab = class {
4079
4082
  meta: mockSpan.outputMeta
4080
4083
  });
4081
4084
  }
4082
- void sendSpan({ result: output });
4085
+ void sendSpan({ result: output, mocked: true });
4083
4086
  if (fnReturnsPromise) {
4084
4087
  return Promise.resolve(output);
4085
4088
  }
@@ -4331,7 +4334,8 @@ var Bitfab = class {
4331
4334
  sourceTraceId: params.traceId,
4332
4335
  traceFunctionKey: params.traceFunctionKey,
4333
4336
  rawSpan: externalSpan,
4334
- ...params.testRunId && { testRunId: params.testRunId }
4337
+ ...params.testRunId && { testRunId: params.testRunId },
4338
+ ...params.mocked && { mocked: true }
4335
4339
  });
4336
4340
  }
4337
4341
  /**