@bitfab/sdk 0.76.0 → 0.76.1

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.
@@ -1,5 +1,5 @@
1
1
  const require_bamlPeer = require("./bamlPeer-5Ohpq8q9.cjs");
2
- const require_http = require("./http-CWOvmnGL.cjs");
2
+ const require_http = require("./http-ykHGNcju.cjs");
3
3
  const require_autoTrace = require("./autoTrace-pZKu5Nk2.cjs");
4
4
  const require_optionalPeer = require("./optionalPeer-CUH756lt.cjs");
5
5
  let superjson = require("superjson");
@@ -5863,10 +5863,12 @@ function isSpanType(value) {
5863
5863
  const noOpSpan = {
5864
5864
  id: "",
5865
5865
  traceId: "",
5866
+ traceFunctionKeys: [],
5866
5867
  addContext() {},
5867
5868
  setPrompt() {}
5868
5869
  };
5869
5870
  const noOpTrace = {
5871
+ traceFunctionKey: "",
5870
5872
  setSessionId() {},
5871
5873
  setName() {},
5872
5874
  setMetadata() {},
@@ -5881,6 +5883,9 @@ function currentTraceRootSpan() {
5881
5883
  if (context?.isRoot && context.traceId === traceId) return context;
5882
5884
  }
5883
5885
  }
5886
+ function activeTraceFunctionKeys(stack) {
5887
+ return [.../* @__PURE__ */ new Set([...require_autoTrace.currentAutoTraceEntries().map((entry) => entry.context.traceFunctionKey), ...stack.map((context) => context.traceFunctionKey)])];
5888
+ }
5884
5889
  function getCurrentSpan() {
5885
5890
  const stack = getSpanStack();
5886
5891
  const current = stack[stack.length - 1];
@@ -5888,6 +5893,7 @@ function getCurrentSpan() {
5888
5893
  return {
5889
5894
  id: current.spanId,
5890
5895
  traceId: current.traceId,
5896
+ traceFunctionKeys: activeTraceFunctionKeys(stack),
5891
5897
  addContext(context) {
5892
5898
  try {
5893
5899
  if (typeof context !== "object" || context === null) return;
@@ -5927,6 +5933,7 @@ function getCurrentTrace() {
5927
5933
  return traceState;
5928
5934
  };
5929
5935
  return {
5936
+ traceFunctionKey: current.rootTraceFunctionKey,
5930
5937
  setSessionId(sessionId) {
5931
5938
  try {
5932
5939
  const traceState = getOrCreateTraceState();
@@ -6663,6 +6670,7 @@ var Bitfab = class {
6663
6670
  spanId,
6664
6671
  details: options.spanDetails ?? { contexts: [] },
6665
6672
  spanName: options.name ?? options.nameFor?.(this) ?? qualifiedSpanName(this, functionNameAtOpen) ?? traceFunctionKey,
6673
+ traceFunctionKey,
6666
6674
  rootTraceFunctionKey: rootTraceFunctionKeyOfTrace(traceId, traceFunctionKey),
6667
6675
  instrumentation: options.instrumentation ?? "span",
6668
6676
  declaredNode: options.declaredNode === true,
@@ -7232,7 +7240,7 @@ var Bitfab = class {
7232
7240
  await runWithSeedContext({ traceId }, async () => target(...args));
7233
7241
  } finally {
7234
7242
  try {
7235
- const { flushTraces } = await Promise.resolve().then(() => require("./http-CWOvmnGL.cjs")).then((n) => n.http_exports);
7243
+ const { flushTraces } = await Promise.resolve().then(() => require("./http-ykHGNcju.cjs")).then((n) => n.http_exports);
7236
7244
  await flushTraces(3e4);
7237
7245
  } finally {
7238
7246
  unrecorded = activeTraceStates.delete(traceId);
@@ -7450,7 +7458,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
7450
7458
  metadata: seedCase.metadata,
7451
7459
  sessionId: seedCase.sessionId
7452
7460
  }));
7453
- const { flushTraces } = await Promise.resolve().then(() => require("./http-CWOvmnGL.cjs")).then((n) => n.http_exports);
7461
+ const { flushTraces } = await Promise.resolve().then(() => require("./http-ykHGNcju.cjs")).then((n) => n.http_exports);
7454
7462
  await flushTraces(3e4);
7455
7463
  return {
7456
7464
  pipeline,
@@ -7700,4 +7708,4 @@ Object.defineProperty(exports, "serializeReplayResult", {
7700
7708
  }
7701
7709
  });
7702
7710
 
7703
- //# sourceMappingURL=src-CxsswRYd.cjs.map
7711
+ //# sourceMappingURL=src-CLkegn-P.cjs.map