bitfab 0.57.5 → 0.57.7

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 (33) hide show
  1. package/dist/{chunk-I5EG523G.js → chunk-IYGYSMSD.js} +3 -3
  2. package/dist/{chunk-WYNN6NY2.js → chunk-NRUFN7RZ.js} +26 -13
  3. package/dist/chunk-NRUFN7RZ.js.map +1 -0
  4. package/dist/{chunk-255I4PN4.js → chunk-P4R3NY2U.js} +36 -16
  5. package/dist/chunk-P4R3NY2U.js.map +1 -0
  6. package/dist/{chunk-VPZ2LTU6.js → chunk-VPU6U4WM.js} +2 -2
  7. package/dist/{chunk-YO3HKQX6.js → chunk-W3HLGZBO.js} +137 -67
  8. package/dist/chunk-W3HLGZBO.js.map +1 -0
  9. package/dist/{http-FQ76VRFF.js → http-AFLRC33F.js} +2 -2
  10. package/dist/{http-CHXMOVLK.js → http-ODKUB6M4.js} +2 -2
  11. package/dist/index.cjs +166 -77
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +125 -127
  14. package/dist/index.d.ts +125 -127
  15. package/dist/index.js +3 -5
  16. package/dist/node.cjs +166 -77
  17. package/dist/node.cjs.map +1 -1
  18. package/dist/node.d.cts +1 -1
  19. package/dist/node.d.ts +1 -1
  20. package/dist/node.js +3 -5
  21. package/dist/node.js.map +1 -1
  22. package/dist/{replay-CHM7OQ25.js → replay-2VGODDLA.js} +3 -3
  23. package/dist/replayCli.js +2 -2
  24. package/dist/seedCli.js +2 -2
  25. package/package.json +1 -1
  26. package/dist/chunk-255I4PN4.js.map +0 -1
  27. package/dist/chunk-WYNN6NY2.js.map +0 -1
  28. package/dist/chunk-YO3HKQX6.js.map +0 -1
  29. /package/dist/{chunk-I5EG523G.js.map → chunk-IYGYSMSD.js.map} +0 -0
  30. /package/dist/{chunk-VPZ2LTU6.js.map → chunk-VPU6U4WM.js.map} +0 -0
  31. /package/dist/{http-CHXMOVLK.js.map → http-AFLRC33F.js.map} +0 -0
  32. /package/dist/{http-FQ76VRFF.js.map → http-ODKUB6M4.js.map} +0 -0
  33. /package/dist/{replay-CHM7OQ25.js.map → replay-2VGODDLA.js.map} +0 -0
package/dist/node.cjs CHANGED
@@ -97,7 +97,7 @@ var __version__, __packageName__;
97
97
  var init_version_generated = __esm({
98
98
  "src/version.generated.ts"() {
99
99
  "use strict";
100
- __version__ = "0.57.5";
100
+ __version__ = "0.57.7";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -1071,7 +1071,13 @@ var init_simulationPlan = __esm({
1071
1071
  DISABLE_SIMULATION_PLAN_ENV = "BITFAB_DISABLE_SIM_PLAN";
1072
1072
  ROOT_TRACE_FUNCTION_KEY_FIELD = "rootTraceFunctionKey";
1073
1073
  CONTENT_OFF_KEY = "content_off_by_simulation_plan";
1074
- CONTENT_KEYS = ["input", "input_meta", "output", "output_meta"];
1074
+ CONTENT_KEYS = [
1075
+ "input",
1076
+ "input_meta",
1077
+ "output",
1078
+ "output_meta",
1079
+ "prompt"
1080
+ ];
1075
1081
  SimulationPlan = class {
1076
1082
  constructor(source, enabled = true) {
1077
1083
  this.source = source;
@@ -1190,13 +1196,13 @@ var init_simulationPlan = __esm({
1190
1196
  }
1191
1197
  return this.loaded;
1192
1198
  }
1193
- send(payload, traceFunctionKey, submit) {
1199
+ send(payload, traceFunctionKey, submit, drop) {
1194
1200
  this.refresh();
1195
1201
  if (this.disabled() || traceFunctionKey === void 0 || spanNameOf(payload) === void 0 || recordedByFramework(payload)) {
1196
1202
  submit(payload);
1197
1203
  return;
1198
1204
  }
1199
- const entry = { payload, traceFunctionKey, submit };
1205
+ const entry = { payload, traceFunctionKey, submit, drop };
1200
1206
  if (this.holdingForFirstRead()) {
1201
1207
  this.hold(entry);
1202
1208
  return;
@@ -1250,6 +1256,7 @@ var init_simulationPlan = __esm({
1250
1256
  try {
1251
1257
  entry.submit(this.payloadToSend(entry));
1252
1258
  } catch (error) {
1259
+ entry.drop?.();
1253
1260
  warnOnce(
1254
1261
  "sim-plan-held-span-dropped",
1255
1262
  `a span held for the sim plan was dropped when released: ${error instanceof Error ? error.message : String(error)}`
@@ -2580,23 +2587,21 @@ var init_http = __esm({
2580
2587
  }
2581
2588
  const deadline = Date.now() + Math.max(timeoutMs, 0);
2582
2589
  this.closing = (async () => {
2583
- const released = await this.releaseHeldExternalSpans?.(
2584
- planWaitSliceMs(timeoutMs)
2590
+ liveHttpClients.delete(this);
2591
+ const settled2 = await this.settleDeferredWork(
2592
+ Math.max(0, deadline - Date.now())
2585
2593
  );
2586
2594
  this.stopSimulationPlan?.();
2595
+ this.closed = true;
2587
2596
  this.externalSpanTransform = void 0;
2588
2597
  this.externalTraceTransform = void 0;
2598
+ this.frameworkSpanStart = void 0;
2589
2599
  this.releaseHeldExternalSpans = void 0;
2590
2600
  this.stopSimulationPlan = void 0;
2591
- liveHttpClients.delete(this);
2592
- const settled2 = await this.settleDeferredWork(
2593
- Math.max(0, deadline - Date.now())
2594
- );
2595
- this.closed = true;
2596
2601
  const transport = this.traceTransport;
2597
2602
  this.traceTransport = void 0;
2598
2603
  const shutdownOk = await transport?.shutdown(Math.max(0, deadline - Date.now())) ?? true;
2599
- return released !== false && settled2 && shutdownOk;
2604
+ return settled2 && shutdownOk;
2600
2605
  })();
2601
2606
  return this.closing;
2602
2607
  }
@@ -2697,8 +2702,7 @@ var init_http = __esm({
2697
2702
  async getSimulationPlan() {
2698
2703
  return this.get(
2699
2704
  "/api/sdk/sim-plan",
2700
- SIMULATION_PLAN_READ_TIMEOUT_MS,
2701
- { Connection: "close" }
2705
+ SIMULATION_PLAN_READ_TIMEOUT_MS
2702
2706
  );
2703
2707
  }
2704
2708
  async getTraceSpan(traceId, lookup) {
@@ -2774,19 +2778,35 @@ var init_http = __esm({
2774
2778
  carrierMeta("internal_trace", body, void 0)
2775
2779
  );
2776
2780
  }
2781
+ reserveFrameworkSpan(traceId, spanId, parentSpanId) {
2782
+ try {
2783
+ this.frameworkSpanStart?.(traceId, spanId, parentSpanId ?? null);
2784
+ } catch (error) {
2785
+ warnOnce(
2786
+ "framework-span-reservation-failed",
2787
+ `a framework span could not be counted toward its trace's span limit: ${describeError(error)}`
2788
+ );
2789
+ }
2790
+ }
2777
2791
  sendExternalSpan(payload) {
2778
2792
  const ref2 = carrierRef(payload);
2779
2793
  if (ref2?.spanId !== void 0) {
2780
2794
  this.traceCompletion.record(ref2.traceId, ref2.spanId);
2781
2795
  }
2796
+ const drop = () => {
2797
+ if (ref2?.spanId !== void 0) {
2798
+ this.traceCompletion.abort(ref2.traceId, ref2.spanId);
2799
+ }
2800
+ };
2782
2801
  const gate = this.externalSpanTransform;
2783
2802
  if (gate === void 0) {
2784
2803
  this.submitExternalSpan(payload);
2785
2804
  return;
2786
2805
  }
2787
2806
  try {
2788
- gate(payload, (ready) => this.submitExternalSpan(ready));
2807
+ gate(payload, (ready) => this.submitExternalSpan(ready), drop);
2789
2808
  } catch (error) {
2809
+ drop();
2790
2810
  warnDroppedExternalSpan(error);
2791
2811
  }
2792
2812
  }
@@ -4398,7 +4418,6 @@ __export(node_exports, {
4398
4418
  NO_MOCK_OVERRIDE: () => NO_MOCK_OVERRIDE,
4399
4419
  ReplayError: () => ReplayError,
4400
4420
  SUPPORTED_PROVIDERS: () => SUPPORTED_PROVIDERS,
4401
- TraceAssertionsClient: () => TraceAssertionsClient,
4402
4421
  TracesClient: () => TracesClient,
4403
4422
  __version__: () => __version__,
4404
4423
  defineReplayRegistry: () => defineReplayRegistry,
@@ -4680,6 +4699,11 @@ var BitfabClaudeAgentHandler = class {
4680
4699
  }
4681
4700
  this.runToSpan.set(spanId, spanInfo);
4682
4701
  this.httpClient.traceCompletion.start(spanInfo.traceId, spanInfo.spanId);
4702
+ this.httpClient.reserveFrameworkSpan(
4703
+ spanInfo.traceId,
4704
+ spanInfo.spanId,
4705
+ spanInfo.parentId
4706
+ );
4683
4707
  return spanInfo;
4684
4708
  }
4685
4709
  completeSpan(spanId, output, error, extraContexts) {
@@ -4959,6 +4983,11 @@ var BitfabClaudeAgentHandler = class {
4959
4983
  this.conversationHistory.push(...this.pendingMessages);
4960
4984
  this.pendingMessages = [];
4961
4985
  this.currentLlmSpanId = randomUuid();
4986
+ this.httpClient.reserveFrameworkSpan(
4987
+ this.ensureTrace(),
4988
+ this.currentLlmSpanId,
4989
+ this.getParentId()
4990
+ );
4962
4991
  this.currentLlmMessageId = messageId ?? null;
4963
4992
  this.currentLlmContent = [];
4964
4993
  this.currentLlmModel = inner.model ?? null;
@@ -6002,6 +6031,9 @@ init_http();
6002
6031
  // src/labels.ts
6003
6032
  var LABELS_PATH = "/api/sdk/traces/labels";
6004
6033
  var HUMAN_LABELS_PATH = "/api/sdk/traces/labels/human";
6034
+ function labelEvidencePath(traceId, assertionId) {
6035
+ return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions/${encodeURIComponent(assertionId)}/evidence`;
6036
+ }
6005
6037
  var LabelsClient = class {
6006
6038
  constructor(httpClient) {
6007
6039
  this.httpClient = httpClient;
@@ -6050,6 +6082,11 @@ var LabelsClient = class {
6050
6082
  );
6051
6083
  return response.labels;
6052
6084
  }
6085
+ /** Generate suggested evidence for an assertion on an original or replay trace. */
6086
+ async generateLabelEvidence(traceId, assertionId) {
6087
+ const response = await this.httpClient.get(labelEvidencePath(traceId, assertionId));
6088
+ return response.evidence;
6089
+ }
6053
6090
  };
6054
6091
 
6055
6092
  // src/langgraph.ts
@@ -6361,6 +6398,11 @@ var BitfabLangGraphCallbackHandler = class {
6361
6398
  this.runToSpan.set(runId, spanInfo);
6362
6399
  if (spanInfo.hidden !== true) {
6363
6400
  this.httpClient.traceCompletion.start(spanInfo.traceId, spanInfo.spanId);
6401
+ this.httpClient.reserveFrameworkSpan(
6402
+ spanInfo.traceId,
6403
+ spanInfo.spanId,
6404
+ spanInfo.parentId
6405
+ );
6364
6406
  }
6365
6407
  if (isRootInvocation) {
6366
6408
  this.sendTraceStart(spanInfo);
@@ -7764,23 +7806,9 @@ var SEARCH_PATH = "/api/sdk/traces/search";
7764
7806
  function traceAssertionsPath(traceId, suffix = "") {
7765
7807
  return `/api/sdk/traces/${encodeURIComponent(traceId)}/assertions${suffix}`;
7766
7808
  }
7767
- function assertionEvidencePath(assertionId) {
7768
- return `/api/sdk/traces/assertions/${encodeURIComponent(assertionId)}/evidence`;
7769
- }
7770
- var TraceAssertionsClient = class {
7771
- constructor(httpClient) {
7772
- this.httpClient = httpClient;
7773
- }
7774
- /** Suggest evidence for an assertion, enriched with its span context. */
7775
- async getAssertionEvidence(assertionId) {
7776
- const response = await this.httpClient.get(assertionEvidencePath(assertionId));
7777
- return response.evidence;
7778
- }
7779
- };
7780
7809
  var TracesClient = class {
7781
7810
  constructor(httpClient) {
7782
7811
  this.httpClient = httpClient;
7783
- this.assertions = new TraceAssertionsClient(httpClient);
7784
7812
  }
7785
7813
  async search(params) {
7786
7814
  return this.httpClient.request(SEARCH_PATH, params);
@@ -7920,8 +7948,14 @@ var BitfabOpenAITracingProcessor = class {
7920
7948
  async onSpanStart(span) {
7921
7949
  if (span.spanId !== void 0 && span.traceId !== null && span.traceId !== void 0) {
7922
7950
  this.startedSpans.set(span.spanId, span.traceId);
7923
- const traceId = this.activeSpanMappings[span.traceId]?.traceId ?? span.traceId;
7951
+ const mapping = this.activeSpanMappings[span.traceId];
7952
+ const traceId = mapping?.traceId ?? span.traceId;
7924
7953
  this.httpClient.traceCompletion.start(traceId, span.spanId);
7954
+ this.httpClient.reserveFrameworkSpan(
7955
+ traceId,
7956
+ span.spanId,
7957
+ span.parentId ?? mapping?.spanId
7958
+ );
7925
7959
  }
7926
7960
  }
7927
7961
  /**
@@ -8308,22 +8342,68 @@ var BitfabVercelAiHandler = class {
8308
8342
 
8309
8343
  // src/client.ts
8310
8344
  init_warnOnce();
8345
+ var TRUNCATION_LIMIT_ORDER = [
8346
+ "max_depth",
8347
+ "max_spans",
8348
+ "max_captured_subtree_spans"
8349
+ ];
8311
8350
  var activeTraceStates = /* @__PURE__ */ new Map();
8312
- function fitsTraceSpanBudget(payload) {
8313
- if (!recordedByFramework(payload)) {
8314
- return true;
8351
+ var REFUSED_FRAMEWORK_SPAN_TRACES_RETAINED = 1024;
8352
+ var refusedFrameworkSpans = /* @__PURE__ */ new Map();
8353
+ function frameworkSpanRefused(traceId, spanId) {
8354
+ return refusedFrameworkSpans.get(traceId)?.has(spanId) === true;
8355
+ }
8356
+ function refuseFrameworkSpan(traceId, spanId) {
8357
+ const refused = refusedFrameworkSpans.get(traceId);
8358
+ if (refused !== void 0) {
8359
+ refused.add(spanId);
8360
+ return;
8315
8361
  }
8316
- const traceId = traceIdOf(payload);
8317
- const spanBudget = traceId === void 0 ? void 0 : activeTraceStates.get(traceId)?.spanBudget;
8318
- if (spanBudget === void 0) {
8319
- return true;
8362
+ refusedFrameworkSpans.set(traceId, /* @__PURE__ */ new Set([spanId]));
8363
+ while (refusedFrameworkSpans.size > REFUSED_FRAMEWORK_SPAN_TRACES_RETAINED) {
8364
+ const oldest = refusedFrameworkSpans.keys().next();
8365
+ if (oldest.done) {
8366
+ return;
8367
+ }
8368
+ refusedFrameworkSpans.delete(oldest.value);
8369
+ }
8370
+ }
8371
+ function reserveFrameworkSpan(traceId, spanId, parentSpanId) {
8372
+ const spanBudget = activeTraceStates.get(traceId)?.spanBudget;
8373
+ const parentRefused = parentSpanId !== null && frameworkSpanRefused(traceId, parentSpanId);
8374
+ if (!parentRefused && (spanBudget === void 0 || spanBudget.spansUsed < spanBudget.maxSpans)) {
8375
+ if (spanBudget !== void 0) {
8376
+ spanBudget.spansUsed += 1;
8377
+ }
8378
+ return;
8320
8379
  }
8321
- if (spanBudget.spansUsed >= spanBudget.maxSpans) {
8322
- spanBudget.truncate();
8380
+ refuseFrameworkSpan(traceId, spanId);
8381
+ spanBudget?.truncate("max_spans");
8382
+ }
8383
+ function isRefusedFrameworkSpan(payload) {
8384
+ if (!recordedByFramework(payload)) {
8323
8385
  return false;
8324
8386
  }
8325
- spanBudget.spansUsed += 1;
8326
- return true;
8387
+ const rawSpan = payload.rawSpan;
8388
+ const spanId = rawSpan?.id;
8389
+ if (typeof spanId !== "string") {
8390
+ return false;
8391
+ }
8392
+ const traceIds = [payload.sourceTraceId, traceIdOf(payload)];
8393
+ return traceIds.some(
8394
+ (traceId) => typeof traceId === "string" && frameworkSpanRefused(traceId, spanId)
8395
+ );
8396
+ }
8397
+ function truncationMetadata(truncation) {
8398
+ if (truncation === void 0 || truncation.limits.size === 0) {
8399
+ return void 0;
8400
+ }
8401
+ return {
8402
+ "bitfab.truncated_by": TRUNCATION_LIMIT_ORDER.filter(
8403
+ (limit) => truncation.limits.has(limit)
8404
+ ).join(","),
8405
+ "bitfab.dropped_spans": truncation.droppedSpans
8406
+ };
8327
8407
  }
8328
8408
  function rootTraceFunctionKeyOfTrace(traceId, fallback) {
8329
8409
  return activeTraceStates.get(traceId)?.traceFunctionKey ?? fallback;
@@ -8705,7 +8785,6 @@ function readBooleanEnv(name) {
8705
8785
  var DEFAULT_AUTO_TRACE_MAX_DEPTH = 30;
8706
8786
  var DEFAULT_AUTO_TRACE_MAX_SPANS = 2048;
8707
8787
  var DEFAULT_AUTO_TRACE_MAX_CAPTURED_SUBTREE_SPANS = 512;
8708
- var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
8709
8788
  function spanOwnerName(receiver) {
8710
8789
  if (typeof receiver === "function") {
8711
8790
  return receiver.name !== "" ? receiver.name : void 0;
@@ -8771,7 +8850,8 @@ var Bitfab = class {
8771
8850
  this.httpClient,
8772
8851
  config.simulationPlan ?? true
8773
8852
  );
8774
- this.httpClient.externalSpanTransform = (payload, submit) => this.applySimulationPlan(payload, submit);
8853
+ this.httpClient.externalSpanTransform = (payload, submit, drop) => this.applySimulationPlan(payload, submit, drop);
8854
+ this.httpClient.frameworkSpanStart = reserveFrameworkSpan;
8775
8855
  this.httpClient.externalTraceTransform = (payload, submit) => this.simulationPlan.sendTrace(payload, submit);
8776
8856
  this.httpClient.releaseHeldExternalSpans = (timeoutMs) => this.simulationPlan.release(timeoutMs);
8777
8857
  this.httpClient.stopSimulationPlan = () => this.simulationPlan.stop();
@@ -8967,35 +9047,31 @@ var Bitfab = class {
8967
9047
  function(...args) {
8968
9048
  self.simulationPlan.refresh();
8969
9049
  let capturedSubtreeCount = 0;
8970
- let truncated = false;
8971
- const warnTruncated = () => {
8972
- if (!truncated) {
8973
- truncated = true;
8974
- getCurrentTrace().setMetadata({
8975
- bitfabAutoTrace: {
8976
- protocol: AUTO_TRACE_PROTOCOL,
8977
- truncated: true,
8978
- maxDepth,
8979
- maxSpans,
8980
- maxCapturedSubtreeSpans
8981
- }
8982
- });
8983
- }
9050
+ const rootSpanStack = getSpanStack();
9051
+ const rootSpan = rootSpanStack[rootSpanStack.length - 1];
9052
+ const rootTraceState = rootSpan === void 0 ? void 0 : activeTraceStates.get(rootSpan.traceId);
9053
+ const truncation = rootTraceState?.truncation ?? {
9054
+ limits: /* @__PURE__ */ new Set(),
9055
+ droppedSpans: 0
9056
+ };
9057
+ const truncate = (limit) => {
9058
+ truncation.limits.add(limit);
9059
+ truncation.droppedSpans += 1;
8984
9060
  warnOnce(
8985
9061
  `auto-trace-truncated:${traceFunctionKey}`,
8986
9062
  `"${traceFunctionKey}" hit an automatic subtree capture limit (maxDepth=${maxDepth}, maxCapturedSubtreeSpans=${maxCapturedSubtreeSpans}, maxSpans=${maxSpans}); its trace is incomplete. Raise the limits, declare the calls you need with node(), or narrow the subtree with exclude.`
8987
9063
  );
8988
9064
  };
8989
- const rootSpanStack = getSpanStack();
8990
9065
  const spanBudget = {
8991
9066
  spansUsed: 1,
8992
9067
  maxSpans,
8993
- truncate: () => runWithSpanStack(rootSpanStack, warnTruncated)
9068
+ truncate
8994
9069
  };
8995
- const rootSpan = rootSpanStack[rootSpanStack.length - 1];
8996
- const rootTraceState = rootSpan === void 0 ? void 0 : activeTraceStates.get(rootSpan.traceId);
8997
- if (rootTraceState !== void 0 && rootTraceState.spanBudget === void 0) {
8998
- rootTraceState.spanBudget = spanBudget;
9070
+ if (rootTraceState !== void 0) {
9071
+ rootTraceState.truncation = truncation;
9072
+ if (rootTraceState.spanBudget === void 0) {
9073
+ rootTraceState.spanBudget = spanBudget;
9074
+ }
8999
9075
  }
9000
9076
  const spanStackOf = (entry) => entry.spanStack;
9001
9077
  const openChild = (entry, childOptions, inputs, isAsync, invokeFn) => {
@@ -9035,15 +9111,16 @@ var Bitfab = class {
9035
9111
  rootTraceFunctionKeyOfEntry(entry),
9036
9112
  spanName
9037
9113
  );
9038
- if (entry.depth < maxDepth && spanBudget.spansUsed < maxSpans && (!countsTowardCapturedSubtree || capturedSubtreeCount < maxCapturedSubtreeSpans)) {
9039
- spanBudget.spansUsed += 1;
9040
- if (countsTowardCapturedSubtree) {
9041
- capturedSubtreeCount += 1;
9042
- }
9043
- return true;
9114
+ const refusedBy = entry.depth >= maxDepth ? "max_depth" : spanBudget.spansUsed >= maxSpans ? "max_spans" : countsTowardCapturedSubtree && capturedSubtreeCount >= maxCapturedSubtreeSpans ? "max_captured_subtree_spans" : void 0;
9115
+ if (refusedBy !== void 0) {
9116
+ truncate(refusedBy);
9117
+ return false;
9044
9118
  }
9045
- runWithSpanStack(spanStackOf(entry), warnTruncated);
9046
- return false;
9119
+ spanBudget.spansUsed += 1;
9120
+ if (countsTowardCapturedSubtree) {
9121
+ capturedSubtreeCount += 1;
9122
+ }
9123
+ return true;
9047
9124
  };
9048
9125
  const autoTraceContext = {
9049
9126
  traceFunctionKey,
@@ -9170,11 +9247,17 @@ var Bitfab = class {
9170
9247
  Object.defineProperty(autoTraceRoot, "_bitfabWrappedFn", { value: fn });
9171
9248
  return autoTraceRoot;
9172
9249
  }
9173
- applySimulationPlan(payload, submit) {
9174
- if (!fitsTraceSpanBudget(payload)) {
9250
+ applySimulationPlan(payload, submit, drop) {
9251
+ if (isRefusedFrameworkSpan(payload)) {
9252
+ drop();
9175
9253
  return;
9176
9254
  }
9177
- this.simulationPlan.send(payload, rootTraceFunctionKeyOf(payload), submit);
9255
+ this.simulationPlan.send(
9256
+ payload,
9257
+ rootTraceFunctionKeyOf(payload),
9258
+ submit,
9259
+ drop
9260
+ );
9178
9261
  }
9179
9262
  /**
9180
9263
  * Flush and permanently close this client's tracing resources: its pending
@@ -9843,6 +9926,9 @@ var Bitfab = class {
9843
9926
  registeredTraceId = traceId;
9844
9927
  }
9845
9928
  self.httpClient.traceCompletion.start(traceId, spanId);
9929
+ if (isFrameworkInstrumentation(options.instrumentation)) {
9930
+ reserveFrameworkSpan(traceId, spanId, parentSpanId);
9931
+ }
9846
9932
  startedSpan = { traceId, spanId };
9847
9933
  const functionName = fn.name !== "" ? fn.name : void 0;
9848
9934
  const rootTraceFunctionKey = rootTraceFunctionKeyOfTrace(
@@ -9887,6 +9973,10 @@ var Bitfab = class {
9887
9973
  }
9888
9974
  if (isRootSpan) {
9889
9975
  const traceState = activeTraceStates.get(traceId);
9976
+ const truncated = truncationMetadata(traceState?.truncation);
9977
+ if (truncated !== void 0) {
9978
+ recordCallerTraceMetadata(traceId, truncated);
9979
+ }
9890
9980
  self.sendTraceCompletion({
9891
9981
  traceFunctionKey,
9892
9982
  traceId,
@@ -10439,7 +10529,7 @@ var Bitfab = class {
10439
10529
  ...params.captureContent && params.contexts && params.contexts.length > 0 && {
10440
10530
  contexts: params.contexts
10441
10531
  },
10442
- ...params.captureContent && params.prompt !== void 0 && { prompt: params.prompt },
10532
+ ...buildsContent && params.prompt !== void 0 && { prompt: params.prompt },
10443
10533
  ...contentOff && { [CONTENT_OFF_KEY]: true }
10444
10534
  }
10445
10535
  };
@@ -11038,7 +11128,6 @@ assertAsyncStorageRegistered();
11038
11128
  NO_MOCK_OVERRIDE,
11039
11129
  ReplayError,
11040
11130
  SUPPORTED_PROVIDERS,
11041
- TraceAssertionsClient,
11042
11131
  TracesClient,
11043
11132
  __version__,
11044
11133
  defineReplayRegistry,