@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.cjs CHANGED
@@ -1533,7 +1533,7 @@ function summarize(findings, diagnostics) {
1533
1533
  errors: diagnostics.filter((item) => item.severity === "error").length
1534
1534
  };
1535
1535
  }
1536
- function eventEvidence(event, path12) {
1536
+ function eventEvidence(event, path13) {
1537
1537
  return {
1538
1538
  runId: event.runId,
1539
1539
  eventId: event.eventId,
@@ -3712,6 +3712,94 @@ function openTrace(input, options = {}) {
3712
3712
  return readTrace(input, options);
3713
3713
  }
3714
3714
 
3715
+ // packages/core/src/exporters/helpers.ts
3716
+ var REDACT_SUBSTRINGS = [
3717
+ "authorization",
3718
+ "cookie",
3719
+ "token",
3720
+ "apikey",
3721
+ "password",
3722
+ "secret",
3723
+ "email"
3724
+ ];
3725
+ function shouldRedactKey(key) {
3726
+ const k = key.toLowerCase();
3727
+ for (const s of REDACT_SUBSTRINGS) {
3728
+ if (k.includes(s)) return true;
3729
+ }
3730
+ return false;
3731
+ }
3732
+ function safeString(value, maxLength) {
3733
+ if (value === null || value === void 0) return "";
3734
+ let s;
3735
+ if (typeof value === "string") s = value;
3736
+ else if (typeof value === "number" || typeof value === "boolean") s = String(value);
3737
+ else s = stableJson(value, false);
3738
+ if (maxLength !== void 0 && maxLength >= 0 && s.length > maxLength) {
3739
+ return `${s.slice(0, maxLength)}\u2026`;
3740
+ }
3741
+ return s;
3742
+ }
3743
+ function escapeMarkdown(value) {
3744
+ return value.replace(/\|/g, "\\|").replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\n/g, " ");
3745
+ }
3746
+ function sortKeysDeep(input) {
3747
+ if (input === null || typeof input !== "object") return input;
3748
+ if (Array.isArray(input)) return input.map(sortKeysDeep);
3749
+ const o = input;
3750
+ const out = {};
3751
+ for (const k of Object.keys(o).sort()) {
3752
+ out[k] = sortKeysDeep(o[k]);
3753
+ }
3754
+ return out;
3755
+ }
3756
+ function stableJson(value, pretty) {
3757
+ const sorted = sortKeysDeep(value);
3758
+ return pretty === true ? JSON.stringify(sorted, null, 2) : JSON.stringify(sorted);
3759
+ }
3760
+ function compactAttributes3(attrs, options) {
3761
+ if (attrs === void 0) return {};
3762
+ const maxLen = options?.maxLength ?? 500;
3763
+ const out = {};
3764
+ for (const key of Object.keys(attrs).sort()) {
3765
+ if (shouldRedactKey(key)) {
3766
+ out[key] = "[REDACTED]";
3767
+ continue;
3768
+ }
3769
+ const v = attrs[key];
3770
+ out[key] = compactValue(v, maxLen);
3771
+ }
3772
+ return out;
3773
+ }
3774
+ function compactValue(value, maxLen, redacted) {
3775
+ if (value === null || typeof value !== "object") {
3776
+ return typeof value === "string" ? safeString(value, maxLen) : value;
3777
+ }
3778
+ if (Array.isArray(value)) {
3779
+ const arr = value.slice(0, 20).map((x) => compactValue(x, maxLen));
3780
+ if (value.length > 20) arr.push(`\u2026(+${value.length - 20} more)`);
3781
+ return arr;
3782
+ }
3783
+ const o = value;
3784
+ const inner = {};
3785
+ for (const k of Object.keys(o)) {
3786
+ if (shouldRedactKey(k)) inner[k] = "[REDACTED]";
3787
+ else inner[k] = compactValue(o[k], maxLen);
3788
+ }
3789
+ return inner;
3790
+ }
3791
+ function flattenTree(tree) {
3792
+ const out = [];
3793
+ function walk(nodes) {
3794
+ for (const n of nodes) {
3795
+ out.push(n);
3796
+ if (n.children.length > 0) walk(n.children);
3797
+ }
3798
+ }
3799
+ walk(tree.children);
3800
+ return out;
3801
+ }
3802
+
3715
3803
  // packages/core/src/diff/comparable.ts
3716
3804
  function extractOutputPreview(meta) {
3717
3805
  if (meta === void 0) return void 0;
@@ -3811,94 +3899,6 @@ function manualTraceEventsToComparableRun(events) {
3811
3899
  };
3812
3900
  }
3813
3901
 
3814
- // packages/core/src/exporters/helpers.ts
3815
- var REDACT_SUBSTRINGS = [
3816
- "authorization",
3817
- "cookie",
3818
- "token",
3819
- "apikey",
3820
- "password",
3821
- "secret",
3822
- "email"
3823
- ];
3824
- function shouldRedactKey(key) {
3825
- const k = key.toLowerCase();
3826
- for (const s of REDACT_SUBSTRINGS) {
3827
- if (k.includes(s)) return true;
3828
- }
3829
- return false;
3830
- }
3831
- function safeString(value, maxLength) {
3832
- if (value === null || value === void 0) return "";
3833
- let s;
3834
- if (typeof value === "string") s = value;
3835
- else if (typeof value === "number" || typeof value === "boolean") s = String(value);
3836
- else s = stableJson(value, false);
3837
- if (maxLength !== void 0 && maxLength >= 0 && s.length > maxLength) {
3838
- return `${s.slice(0, maxLength)}\u2026`;
3839
- }
3840
- return s;
3841
- }
3842
- function escapeMarkdown(value) {
3843
- return value.replace(/\|/g, "\\|").replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\n/g, " ");
3844
- }
3845
- function sortKeysDeep(input) {
3846
- if (input === null || typeof input !== "object") return input;
3847
- if (Array.isArray(input)) return input.map(sortKeysDeep);
3848
- const o = input;
3849
- const out = {};
3850
- for (const k of Object.keys(o).sort()) {
3851
- out[k] = sortKeysDeep(o[k]);
3852
- }
3853
- return out;
3854
- }
3855
- function stableJson(value, pretty) {
3856
- const sorted = sortKeysDeep(value);
3857
- return pretty === true ? JSON.stringify(sorted, null, 2) : JSON.stringify(sorted);
3858
- }
3859
- function compactAttributes3(attrs, options) {
3860
- if (attrs === void 0) return {};
3861
- const maxLen = options?.maxLength ?? 500;
3862
- const out = {};
3863
- for (const key of Object.keys(attrs).sort()) {
3864
- if (shouldRedactKey(key)) {
3865
- out[key] = "[REDACTED]";
3866
- continue;
3867
- }
3868
- const v = attrs[key];
3869
- out[key] = compactValue(v, maxLen);
3870
- }
3871
- return out;
3872
- }
3873
- function compactValue(value, maxLen, redacted) {
3874
- if (value === null || typeof value !== "object") {
3875
- return typeof value === "string" ? safeString(value, maxLen) : value;
3876
- }
3877
- if (Array.isArray(value)) {
3878
- const arr = value.slice(0, 20).map((x) => compactValue(x, maxLen));
3879
- if (value.length > 20) arr.push(`\u2026(+${value.length - 20} more)`);
3880
- return arr;
3881
- }
3882
- const o = value;
3883
- const inner = {};
3884
- for (const k of Object.keys(o)) {
3885
- if (shouldRedactKey(k)) inner[k] = "[REDACTED]";
3886
- else inner[k] = compactValue(o[k], maxLen);
3887
- }
3888
- return inner;
3889
- }
3890
- function flattenTree(tree) {
3891
- const out = [];
3892
- function walk(nodes) {
3893
- for (const n of nodes) {
3894
- out.push(n);
3895
- if (n.children.length > 0) walk(n.children);
3896
- }
3897
- }
3898
- walk(tree.children);
3899
- return out;
3900
- }
3901
-
3902
3902
  // packages/core/src/diff/engine.ts
3903
3903
  var DEFAULT_THRESHOLD_MS = 0;
3904
3904
  function pathSeg(step, index) {
@@ -3939,13 +3939,13 @@ function pairSteps(left, right) {
3939
3939
  return pairs;
3940
3940
  }
3941
3941
  function compareLeafSteps(L, R, segments, opts, out) {
3942
- const path12 = buildPath(segments);
3942
+ const path13 = buildPath(segments);
3943
3943
  if (L.name !== R.name) {
3944
3944
  out.push({
3945
3945
  kind: "structure",
3946
3946
  severity: "warning",
3947
3947
  message: "Step name differs",
3948
- path: path12,
3948
+ path: path13,
3949
3949
  left: L.name,
3950
3950
  right: R.name
3951
3951
  });
@@ -3955,7 +3955,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
3955
3955
  kind: "step-type",
3956
3956
  severity: "warning",
3957
3957
  message: "Step type differs",
3958
- path: path12,
3958
+ path: path13,
3959
3959
  left: L.type,
3960
3960
  right: R.type
3961
3961
  });
@@ -3965,7 +3965,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
3965
3965
  kind: "step-status",
3966
3966
  severity: "warning",
3967
3967
  message: "Step status differs",
3968
- path: path12,
3968
+ path: path13,
3969
3969
  left: L.status,
3970
3970
  right: R.status
3971
3971
  });
@@ -3977,7 +3977,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
3977
3977
  kind: "error",
3978
3978
  severity: "error",
3979
3979
  message: "Step error message differs",
3980
- path: path12,
3980
+ path: path13,
3981
3981
  left: le || void 0,
3982
3982
  right: re || void 0
3983
3983
  });
@@ -3995,7 +3995,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
3995
3995
  kind: "duration",
3996
3996
  severity: "info",
3997
3997
  message: "Step duration differs",
3998
- path: path12,
3998
+ path: path13,
3999
3999
  left: ld,
4000
4000
  right: rd
4001
4001
  });
@@ -4008,7 +4008,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
4008
4008
  kind: "metadata",
4009
4009
  severity: "info",
4010
4010
  message: "Step metadata differs",
4011
- path: path12,
4011
+ path: path13,
4012
4012
  left: L.metadata,
4013
4013
  right: R.metadata
4014
4014
  });
@@ -4020,7 +4020,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
4020
4020
  kind: "output",
4021
4021
  severity: "info",
4022
4022
  message: "Output preview differs",
4023
- path: path12,
4023
+ path: path13,
4024
4024
  left: L.outputPreview,
4025
4025
  right: R.outputPreview
4026
4026
  });