@agent-inspect/mcp-server 6.31.2 → 6.31.3

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/cli.cjs CHANGED
@@ -7194,6 +7194,11 @@ function exportOpenInference(tree, options) {
7194
7194
  function hexFrom2(seed, byteLen) {
7195
7195
  return crypto__default.default.createHash("sha256").update(seed, "utf8").digest("hex").slice(0, byteLen * 2);
7196
7196
  }
7197
+ function unixNano2(ms) {
7198
+ const whole = Math.trunc(ms);
7199
+ const fractionNs = Math.round((ms - whole) * 1e6);
7200
+ return BigInt(whole) * 1000000n + BigInt(fractionNs);
7201
+ }
7197
7202
  function stringAttr2(key, value) {
7198
7203
  return { key, value: { stringValue: value } };
7199
7204
  }
@@ -7227,10 +7232,10 @@ function exportOtlpJson(tree, options) {
7227
7232
  const ev = n.event;
7228
7233
  const spanId = hexFrom2(`${tree.runId}:${ev.eventId}`, 8);
7229
7234
  const parentSpanId = ev.parentId ? hexFrom2(`${tree.runId}:${ev.parentId}`, 8) : void 0;
7230
- const startNs = String(Math.round(ev.timestamp * 1e6));
7235
+ const startNs = String(unixNano2(ev.timestamp));
7231
7236
  let endNs;
7232
7237
  if (ev.durationMs !== void 0 && Number.isFinite(ev.durationMs)) {
7233
- endNs = String(Math.round(ev.timestamp * 1e6 + ev.durationMs * 1e6));
7238
+ endNs = String(unixNano2(ev.timestamp) + unixNano2(ev.durationMs));
7234
7239
  }
7235
7240
  const attrs2 = [
7236
7241
  stringAttr2("agent_inspect.kind", ev.kind),