@agent-inspect/mcp-server 5.0.0 → 5.1.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 +88 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +88 -88
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -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) {
|