@agent-inspect/mcp-server 5.0.0 → 5.2.0

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.mjs CHANGED
@@ -1525,7 +1525,7 @@ function summarize(findings, diagnostics) {
1525
1525
  errors: diagnostics.filter((item) => item.severity === "error").length
1526
1526
  };
1527
1527
  }
1528
- function eventEvidence(event, path12) {
1528
+ function eventEvidence(event, path13) {
1529
1529
  return {
1530
1530
  runId: event.runId,
1531
1531
  eventId: event.eventId,
@@ -3704,6 +3704,94 @@ function openTrace(input, options = {}) {
3704
3704
  return readTrace(input, options);
3705
3705
  }
3706
3706
 
3707
+ // packages/core/src/exporters/helpers.ts
3708
+ var REDACT_SUBSTRINGS = [
3709
+ "authorization",
3710
+ "cookie",
3711
+ "token",
3712
+ "apikey",
3713
+ "password",
3714
+ "secret",
3715
+ "email"
3716
+ ];
3717
+ function shouldRedactKey(key) {
3718
+ const k = key.toLowerCase();
3719
+ for (const s of REDACT_SUBSTRINGS) {
3720
+ if (k.includes(s)) return true;
3721
+ }
3722
+ return false;
3723
+ }
3724
+ function safeString(value, maxLength) {
3725
+ if (value === null || value === void 0) return "";
3726
+ let s;
3727
+ if (typeof value === "string") s = value;
3728
+ else if (typeof value === "number" || typeof value === "boolean") s = String(value);
3729
+ else s = stableJson(value, false);
3730
+ if (maxLength !== void 0 && maxLength >= 0 && s.length > maxLength) {
3731
+ return `${s.slice(0, maxLength)}\u2026`;
3732
+ }
3733
+ return s;
3734
+ }
3735
+ function escapeMarkdown(value) {
3736
+ return value.replace(/\|/g, "\\|").replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\n/g, " ");
3737
+ }
3738
+ function sortKeysDeep(input) {
3739
+ if (input === null || typeof input !== "object") return input;
3740
+ if (Array.isArray(input)) return input.map(sortKeysDeep);
3741
+ const o = input;
3742
+ const out = {};
3743
+ for (const k of Object.keys(o).sort()) {
3744
+ out[k] = sortKeysDeep(o[k]);
3745
+ }
3746
+ return out;
3747
+ }
3748
+ function stableJson(value, pretty) {
3749
+ const sorted = sortKeysDeep(value);
3750
+ return pretty === true ? JSON.stringify(sorted, null, 2) : JSON.stringify(sorted);
3751
+ }
3752
+ function compactAttributes3(attrs, options) {
3753
+ if (attrs === void 0) return {};
3754
+ const maxLen = options?.maxLength ?? 500;
3755
+ const out = {};
3756
+ for (const key of Object.keys(attrs).sort()) {
3757
+ if (shouldRedactKey(key)) {
3758
+ out[key] = "[REDACTED]";
3759
+ continue;
3760
+ }
3761
+ const v = attrs[key];
3762
+ out[key] = compactValue(v, maxLen);
3763
+ }
3764
+ return out;
3765
+ }
3766
+ function compactValue(value, maxLen, redacted) {
3767
+ if (value === null || typeof value !== "object") {
3768
+ return typeof value === "string" ? safeString(value, maxLen) : value;
3769
+ }
3770
+ if (Array.isArray(value)) {
3771
+ const arr = value.slice(0, 20).map((x) => compactValue(x, maxLen));
3772
+ if (value.length > 20) arr.push(`\u2026(+${value.length - 20} more)`);
3773
+ return arr;
3774
+ }
3775
+ const o = value;
3776
+ const inner = {};
3777
+ for (const k of Object.keys(o)) {
3778
+ if (shouldRedactKey(k)) inner[k] = "[REDACTED]";
3779
+ else inner[k] = compactValue(o[k], maxLen);
3780
+ }
3781
+ return inner;
3782
+ }
3783
+ function flattenTree(tree) {
3784
+ const out = [];
3785
+ function walk(nodes) {
3786
+ for (const n of nodes) {
3787
+ out.push(n);
3788
+ if (n.children.length > 0) walk(n.children);
3789
+ }
3790
+ }
3791
+ walk(tree.children);
3792
+ return out;
3793
+ }
3794
+
3707
3795
  // packages/core/src/diff/comparable.ts
3708
3796
  function extractOutputPreview(meta) {
3709
3797
  if (meta === void 0) return void 0;
@@ -3803,94 +3891,6 @@ function manualTraceEventsToComparableRun(events) {
3803
3891
  };
3804
3892
  }
3805
3893
 
3806
- // packages/core/src/exporters/helpers.ts
3807
- var REDACT_SUBSTRINGS = [
3808
- "authorization",
3809
- "cookie",
3810
- "token",
3811
- "apikey",
3812
- "password",
3813
- "secret",
3814
- "email"
3815
- ];
3816
- function shouldRedactKey(key) {
3817
- const k = key.toLowerCase();
3818
- for (const s of REDACT_SUBSTRINGS) {
3819
- if (k.includes(s)) return true;
3820
- }
3821
- return false;
3822
- }
3823
- function safeString(value, maxLength) {
3824
- if (value === null || value === void 0) return "";
3825
- let s;
3826
- if (typeof value === "string") s = value;
3827
- else if (typeof value === "number" || typeof value === "boolean") s = String(value);
3828
- else s = stableJson(value, false);
3829
- if (maxLength !== void 0 && maxLength >= 0 && s.length > maxLength) {
3830
- return `${s.slice(0, maxLength)}\u2026`;
3831
- }
3832
- return s;
3833
- }
3834
- function escapeMarkdown(value) {
3835
- return value.replace(/\|/g, "\\|").replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\n/g, " ");
3836
- }
3837
- function sortKeysDeep(input) {
3838
- if (input === null || typeof input !== "object") return input;
3839
- if (Array.isArray(input)) return input.map(sortKeysDeep);
3840
- const o = input;
3841
- const out = {};
3842
- for (const k of Object.keys(o).sort()) {
3843
- out[k] = sortKeysDeep(o[k]);
3844
- }
3845
- return out;
3846
- }
3847
- function stableJson(value, pretty) {
3848
- const sorted = sortKeysDeep(value);
3849
- return pretty === true ? JSON.stringify(sorted, null, 2) : JSON.stringify(sorted);
3850
- }
3851
- function compactAttributes3(attrs, options) {
3852
- if (attrs === void 0) return {};
3853
- const maxLen = options?.maxLength ?? 500;
3854
- const out = {};
3855
- for (const key of Object.keys(attrs).sort()) {
3856
- if (shouldRedactKey(key)) {
3857
- out[key] = "[REDACTED]";
3858
- continue;
3859
- }
3860
- const v = attrs[key];
3861
- out[key] = compactValue(v, maxLen);
3862
- }
3863
- return out;
3864
- }
3865
- function compactValue(value, maxLen, redacted) {
3866
- if (value === null || typeof value !== "object") {
3867
- return typeof value === "string" ? safeString(value, maxLen) : value;
3868
- }
3869
- if (Array.isArray(value)) {
3870
- const arr = value.slice(0, 20).map((x) => compactValue(x, maxLen));
3871
- if (value.length > 20) arr.push(`\u2026(+${value.length - 20} more)`);
3872
- return arr;
3873
- }
3874
- const o = value;
3875
- const inner = {};
3876
- for (const k of Object.keys(o)) {
3877
- if (shouldRedactKey(k)) inner[k] = "[REDACTED]";
3878
- else inner[k] = compactValue(o[k], maxLen);
3879
- }
3880
- return inner;
3881
- }
3882
- function flattenTree(tree) {
3883
- const out = [];
3884
- function walk(nodes) {
3885
- for (const n of nodes) {
3886
- out.push(n);
3887
- if (n.children.length > 0) walk(n.children);
3888
- }
3889
- }
3890
- walk(tree.children);
3891
- return out;
3892
- }
3893
-
3894
3894
  // packages/core/src/diff/engine.ts
3895
3895
  var DEFAULT_THRESHOLD_MS = 0;
3896
3896
  function pathSeg(step, index) {
@@ -3931,13 +3931,13 @@ function pairSteps(left, right) {
3931
3931
  return pairs;
3932
3932
  }
3933
3933
  function compareLeafSteps(L, R, segments, opts, out) {
3934
- const path12 = buildPath(segments);
3934
+ const path13 = buildPath(segments);
3935
3935
  if (L.name !== R.name) {
3936
3936
  out.push({
3937
3937
  kind: "structure",
3938
3938
  severity: "warning",
3939
3939
  message: "Step name differs",
3940
- path: path12,
3940
+ path: path13,
3941
3941
  left: L.name,
3942
3942
  right: R.name
3943
3943
  });
@@ -3947,7 +3947,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
3947
3947
  kind: "step-type",
3948
3948
  severity: "warning",
3949
3949
  message: "Step type differs",
3950
- path: path12,
3950
+ path: path13,
3951
3951
  left: L.type,
3952
3952
  right: R.type
3953
3953
  });
@@ -3957,7 +3957,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
3957
3957
  kind: "step-status",
3958
3958
  severity: "warning",
3959
3959
  message: "Step status differs",
3960
- path: path12,
3960
+ path: path13,
3961
3961
  left: L.status,
3962
3962
  right: R.status
3963
3963
  });
@@ -3969,7 +3969,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
3969
3969
  kind: "error",
3970
3970
  severity: "error",
3971
3971
  message: "Step error message differs",
3972
- path: path12,
3972
+ path: path13,
3973
3973
  left: le || void 0,
3974
3974
  right: re || void 0
3975
3975
  });
@@ -3987,7 +3987,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
3987
3987
  kind: "duration",
3988
3988
  severity: "info",
3989
3989
  message: "Step duration differs",
3990
- path: path12,
3990
+ path: path13,
3991
3991
  left: ld,
3992
3992
  right: rd
3993
3993
  });
@@ -4000,7 +4000,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
4000
4000
  kind: "metadata",
4001
4001
  severity: "info",
4002
4002
  message: "Step metadata differs",
4003
- path: path12,
4003
+ path: path13,
4004
4004
  left: L.metadata,
4005
4005
  right: R.metadata
4006
4006
  });
@@ -4012,7 +4012,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
4012
4012
  kind: "output",
4013
4013
  severity: "info",
4014
4014
  message: "Output preview differs",
4015
- path: path12,
4015
+ path: path13,
4016
4016
  left: L.outputPreview,
4017
4017
  right: R.outputPreview
4018
4018
  });