@agent-inspect/mcp-server 6.6.1 → 6.7.1
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 +41 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +40 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var readline = require('readline');
|
|
4
|
+
var fs = require('fs');
|
|
4
5
|
var path = require('path');
|
|
6
|
+
var url = require('url');
|
|
5
7
|
var async_hooks = require('async_hooks');
|
|
6
8
|
var crypto = require('crypto');
|
|
7
9
|
var promises = require('fs/promises');
|
|
8
10
|
var os = require('os');
|
|
9
11
|
require('nanoid');
|
|
10
12
|
require('chalk');
|
|
11
|
-
require('fs');
|
|
12
|
-
require('url');
|
|
13
13
|
|
|
14
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
14
15
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
|
|
16
17
|
var readline__default = /*#__PURE__*/_interopDefault(readline);
|
|
@@ -2068,7 +2069,7 @@ function summarize(findings, diagnostics) {
|
|
|
2068
2069
|
errors: diagnostics.filter((item) => item.severity === "error").length
|
|
2069
2070
|
};
|
|
2070
2071
|
}
|
|
2071
|
-
function eventEvidence(event,
|
|
2072
|
+
function eventEvidence(event, path14) {
|
|
2072
2073
|
return {
|
|
2073
2074
|
runId: event.runId,
|
|
2074
2075
|
eventId: event.eventId,
|
|
@@ -2078,7 +2079,7 @@ function eventEvidence(event, path13) {
|
|
|
2078
2079
|
kind: event.kind,
|
|
2079
2080
|
name: event.name,
|
|
2080
2081
|
status: event.status,
|
|
2081
|
-
...
|
|
2082
|
+
...path14 ? { path: path14 } : {}
|
|
2082
2083
|
};
|
|
2083
2084
|
}
|
|
2084
2085
|
function runEvidence(run) {
|
|
@@ -2101,9 +2102,9 @@ function isRecord6(value) {
|
|
|
2101
2102
|
function normalizedKey(value) {
|
|
2102
2103
|
return value.toLowerCase().replace(/[^a-z0-9_]/g, "");
|
|
2103
2104
|
}
|
|
2104
|
-
function lastPathSegment(
|
|
2105
|
-
const parts =
|
|
2106
|
-
return parts[parts.length - 1] ??
|
|
2105
|
+
function lastPathSegment(path14) {
|
|
2106
|
+
const parts = path14.split(".");
|
|
2107
|
+
return parts[parts.length - 1] ?? path14;
|
|
2107
2108
|
}
|
|
2108
2109
|
function valueType(value) {
|
|
2109
2110
|
if (Array.isArray(value)) return "array";
|
|
@@ -2117,12 +2118,12 @@ function serializedByteLength(value) {
|
|
|
2117
2118
|
return void 0;
|
|
2118
2119
|
}
|
|
2119
2120
|
}
|
|
2120
|
-
function pushValueEntries(entries, event, value,
|
|
2121
|
-
entries.push({ event, path:
|
|
2121
|
+
function pushValueEntries(entries, event, value, path14, key, depth = 0) {
|
|
2122
|
+
entries.push({ event, path: path14, key, value });
|
|
2122
2123
|
if (depth >= 8) return;
|
|
2123
2124
|
if (Array.isArray(value)) {
|
|
2124
2125
|
for (const [index, item] of value.entries()) {
|
|
2125
|
-
pushValueEntries(entries, event, item, `${
|
|
2126
|
+
pushValueEntries(entries, event, item, `${path14}.${index}`, String(index), depth + 1);
|
|
2126
2127
|
}
|
|
2127
2128
|
return;
|
|
2128
2129
|
}
|
|
@@ -2132,7 +2133,7 @@ function pushValueEntries(entries, event, value, path13, key, depth = 0) {
|
|
|
2132
2133
|
entries,
|
|
2133
2134
|
event,
|
|
2134
2135
|
value[nestedKey],
|
|
2135
|
-
`${
|
|
2136
|
+
`${path14}.${nestedKey}`,
|
|
2136
2137
|
nestedKey,
|
|
2137
2138
|
depth + 1
|
|
2138
2139
|
);
|
|
@@ -4707,13 +4708,13 @@ function pairSteps(left, right) {
|
|
|
4707
4708
|
return pairs;
|
|
4708
4709
|
}
|
|
4709
4710
|
function compareLeafSteps(L, R, segments, opts, out) {
|
|
4710
|
-
const
|
|
4711
|
+
const path14 = buildPath(segments);
|
|
4711
4712
|
if (L.name !== R.name) {
|
|
4712
4713
|
out.push({
|
|
4713
4714
|
kind: "structure",
|
|
4714
4715
|
severity: "warning",
|
|
4715
4716
|
message: "Step name differs",
|
|
4716
|
-
path:
|
|
4717
|
+
path: path14,
|
|
4717
4718
|
left: L.name,
|
|
4718
4719
|
right: R.name
|
|
4719
4720
|
});
|
|
@@ -4723,7 +4724,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
|
|
|
4723
4724
|
kind: "step-type",
|
|
4724
4725
|
severity: "warning",
|
|
4725
4726
|
message: "Step type differs",
|
|
4726
|
-
path:
|
|
4727
|
+
path: path14,
|
|
4727
4728
|
left: L.type,
|
|
4728
4729
|
right: R.type
|
|
4729
4730
|
});
|
|
@@ -4733,7 +4734,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
|
|
|
4733
4734
|
kind: "step-status",
|
|
4734
4735
|
severity: "warning",
|
|
4735
4736
|
message: "Step status differs",
|
|
4736
|
-
path:
|
|
4737
|
+
path: path14,
|
|
4737
4738
|
left: L.status,
|
|
4738
4739
|
right: R.status
|
|
4739
4740
|
});
|
|
@@ -4745,7 +4746,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
|
|
|
4745
4746
|
kind: "error",
|
|
4746
4747
|
severity: "error",
|
|
4747
4748
|
message: "Step error message differs",
|
|
4748
|
-
path:
|
|
4749
|
+
path: path14,
|
|
4749
4750
|
left: le || void 0,
|
|
4750
4751
|
right: re || void 0
|
|
4751
4752
|
});
|
|
@@ -4763,7 +4764,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
|
|
|
4763
4764
|
kind: "duration",
|
|
4764
4765
|
severity: "info",
|
|
4765
4766
|
message: "Step duration differs",
|
|
4766
|
-
path:
|
|
4767
|
+
path: path14,
|
|
4767
4768
|
left: ld,
|
|
4768
4769
|
right: rd
|
|
4769
4770
|
});
|
|
@@ -4776,7 +4777,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
|
|
|
4776
4777
|
kind: "metadata",
|
|
4777
4778
|
severity: "info",
|
|
4778
4779
|
message: "Step metadata differs",
|
|
4779
|
-
path:
|
|
4780
|
+
path: path14,
|
|
4780
4781
|
left: L.metadata,
|
|
4781
4782
|
right: R.metadata
|
|
4782
4783
|
});
|
|
@@ -4788,7 +4789,7 @@ function compareLeafSteps(L, R, segments, opts, out) {
|
|
|
4788
4789
|
kind: "output",
|
|
4789
4790
|
severity: "info",
|
|
4790
4791
|
message: "Output preview differs",
|
|
4791
|
-
path:
|
|
4792
|
+
path: path14,
|
|
4792
4793
|
left: L.outputPreview,
|
|
4793
4794
|
right: R.outputPreview
|
|
4794
4795
|
});
|
|
@@ -5870,17 +5871,17 @@ function applyRule(rule, value, replacement) {
|
|
|
5870
5871
|
}
|
|
5871
5872
|
return value;
|
|
5872
5873
|
}
|
|
5873
|
-
function childPath(
|
|
5874
|
+
function childPath(path14, key) {
|
|
5874
5875
|
if (/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key)) {
|
|
5875
|
-
return
|
|
5876
|
+
return path14 ? `${path14}.${key}` : key;
|
|
5876
5877
|
}
|
|
5877
|
-
return `${
|
|
5878
|
+
return `${path14 || "$"}[${JSON.stringify(key)}]`;
|
|
5878
5879
|
}
|
|
5879
|
-
function indexPath(
|
|
5880
|
-
return `${
|
|
5880
|
+
function indexPath(path14, index) {
|
|
5881
|
+
return `${path14 || "$"}[${index}]`;
|
|
5881
5882
|
}
|
|
5882
|
-
function makeFinding(
|
|
5883
|
-
return preview === void 0 ? { path:
|
|
5883
|
+
function makeFinding(path14, detector, action, matchKind, severity = "warning", preview) {
|
|
5884
|
+
return preview === void 0 ? { path: path14, detector, action, severity, matchKind } : { path: path14, detector, action, severity, matchKind, preview };
|
|
5884
5885
|
}
|
|
5885
5886
|
function createRedactionProfile(profile = "local") {
|
|
5886
5887
|
switch (profile) {
|
|
@@ -5949,11 +5950,11 @@ var Redactor2 = class {
|
|
|
5949
5950
|
#recordFinding(state, finding) {
|
|
5950
5951
|
if (this.#collectFindings) state.findings.push(finding);
|
|
5951
5952
|
}
|
|
5952
|
-
#redactValue(value, key,
|
|
5953
|
+
#redactValue(value, key, path14, depth, state) {
|
|
5953
5954
|
if (depth > this.#maxDepth) {
|
|
5954
5955
|
this.#recordFinding(
|
|
5955
5956
|
state,
|
|
5956
|
-
makeFinding(
|
|
5957
|
+
makeFinding(path14, "structure.maxDepth", "truncate", "value", "warning")
|
|
5957
5958
|
);
|
|
5958
5959
|
return "[Truncated]";
|
|
5959
5960
|
}
|
|
@@ -5962,19 +5963,19 @@ var Redactor2 = class {
|
|
|
5962
5963
|
if (rule) {
|
|
5963
5964
|
this.#recordFinding(
|
|
5964
5965
|
state,
|
|
5965
|
-
makeFinding(
|
|
5966
|
+
makeFinding(path14, `key.${rule.key}`, actionForRule(rule), "key", "warning")
|
|
5966
5967
|
);
|
|
5967
5968
|
return applyRule(rule, value, this.#replacement);
|
|
5968
5969
|
}
|
|
5969
5970
|
}
|
|
5970
5971
|
for (const detector of this.#detectors) {
|
|
5971
|
-
const detections = detector.detect({ path:
|
|
5972
|
+
const detections = detector.detect({ path: path14, key, value });
|
|
5972
5973
|
for (const detection of detections) {
|
|
5973
5974
|
const action = detection.action ?? "replace";
|
|
5974
5975
|
this.#recordFinding(
|
|
5975
5976
|
state,
|
|
5976
5977
|
makeFinding(
|
|
5977
|
-
|
|
5978
|
+
path14,
|
|
5978
5979
|
detector.id,
|
|
5979
5980
|
action,
|
|
5980
5981
|
detection.matchKind ?? detector.matchKind ?? "custom",
|
|
@@ -5992,7 +5993,7 @@ var Redactor2 = class {
|
|
|
5992
5993
|
const out = [];
|
|
5993
5994
|
state.seen.set(value, out);
|
|
5994
5995
|
value.forEach((item, index) => {
|
|
5995
|
-
out[index] = this.#redactValue(item, void 0, indexPath(
|
|
5996
|
+
out[index] = this.#redactValue(item, void 0, indexPath(path14, index), depth + 1, state);
|
|
5996
5997
|
});
|
|
5997
5998
|
return out;
|
|
5998
5999
|
}
|
|
@@ -6004,7 +6005,7 @@ var Redactor2 = class {
|
|
|
6004
6005
|
out[entryKey] = this.#redactValue(
|
|
6005
6006
|
entryValue,
|
|
6006
6007
|
entryKey,
|
|
6007
|
-
childPath(
|
|
6008
|
+
childPath(path14 === "$" ? "" : path14, entryKey),
|
|
6008
6009
|
depth + 1,
|
|
6009
6010
|
state
|
|
6010
6011
|
);
|
|
@@ -6440,6 +6441,12 @@ function createMcpServerContext(options = {}) {
|
|
|
6440
6441
|
}
|
|
6441
6442
|
|
|
6442
6443
|
// packages/mcp-server/src/index.ts
|
|
6444
|
+
var packageVersion = JSON.parse(
|
|
6445
|
+
fs.readFileSync(
|
|
6446
|
+
path__default.default.join(path__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), "..", "package.json"),
|
|
6447
|
+
"utf8"
|
|
6448
|
+
)
|
|
6449
|
+
).version;
|
|
6443
6450
|
async function runReadOnlyMcpServer(options = {}) {
|
|
6444
6451
|
const context = createMcpServerContext(options);
|
|
6445
6452
|
const input = options.input ?? process.stdin;
|
|
@@ -6482,7 +6489,7 @@ async function runReadOnlyMcpServer(options = {}) {
|
|
|
6482
6489
|
id,
|
|
6483
6490
|
result: {
|
|
6484
6491
|
protocolVersion: "2024-11-05",
|
|
6485
|
-
serverInfo: { name: "@agent-inspect/mcp-server", version:
|
|
6492
|
+
serverInfo: { name: "@agent-inspect/mcp-server", version: packageVersion },
|
|
6486
6493
|
capabilities: { tools: {} }
|
|
6487
6494
|
}
|
|
6488
6495
|
})
|