@agent-inspect/mcp-server 6.31.4 → 6.31.5
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/{chunk-OGX7RS23.mjs → chunk-FUNPQPC3.mjs} +63 -13
- package/dist/chunk-FUNPQPC3.mjs.map +1 -0
- package/dist/cli.cjs +61 -11
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +61 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-OGX7RS23.mjs.map +0 -1
|
@@ -6694,6 +6694,19 @@ var EXPORT_PAYLOAD_VERSION = "0.1.2";
|
|
|
6694
6694
|
|
|
6695
6695
|
// packages/core/src/safety/url-redaction.ts
|
|
6696
6696
|
var HTTP_URL = /^https?:\/\/[^\s]+$/i;
|
|
6697
|
+
var CONNECTION_PROTOCOLS = /* @__PURE__ */ new Set([
|
|
6698
|
+
"postgres:",
|
|
6699
|
+
"postgresql:",
|
|
6700
|
+
"mysql:",
|
|
6701
|
+
"mariadb:",
|
|
6702
|
+
"mongodb:",
|
|
6703
|
+
"mongodb+srv:",
|
|
6704
|
+
"redis:",
|
|
6705
|
+
"rediss:",
|
|
6706
|
+
"amqp:",
|
|
6707
|
+
"amqps:"
|
|
6708
|
+
]);
|
|
6709
|
+
var CONNECTION_URI = /^(?:postgres|postgresql|mysql|mariadb|mongodb(?:\+srv)?|rediss?|amqps?):\/\/[^\s]+$/i;
|
|
6697
6710
|
var UUID_SEGMENT = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
6698
6711
|
var HEX_SEGMENT = /^[0-9a-f]{12,}$/i;
|
|
6699
6712
|
var NUMERIC_SEGMENT = /^\d{5,}$/;
|
|
@@ -6701,14 +6714,25 @@ var OPAQUE_SEGMENT = /^[A-Za-z0-9_-]{20,}$/;
|
|
|
6701
6714
|
function looksLikeHttpUrl(value) {
|
|
6702
6715
|
return HTTP_URL.test(value.trim());
|
|
6703
6716
|
}
|
|
6704
|
-
function
|
|
6717
|
+
function looksLikeConnectionUri(value) {
|
|
6718
|
+
return CONNECTION_URI.test(value.trim());
|
|
6719
|
+
}
|
|
6720
|
+
function looksLikeUrlForRedaction(value) {
|
|
6721
|
+
return looksLikeHttpUrl(value) || looksLikeConnectionUri(value);
|
|
6722
|
+
}
|
|
6723
|
+
function parseRedactableUrl(value) {
|
|
6705
6724
|
try {
|
|
6706
6725
|
const url = new URL(value.trim());
|
|
6707
|
-
|
|
6726
|
+
if (url.protocol === "http:" || url.protocol === "https:") return url;
|
|
6727
|
+
if (CONNECTION_PROTOCOLS.has(url.protocol)) return url;
|
|
6728
|
+
return void 0;
|
|
6708
6729
|
} catch {
|
|
6709
6730
|
return void 0;
|
|
6710
6731
|
}
|
|
6711
6732
|
}
|
|
6733
|
+
function isHttpProtocol(protocol) {
|
|
6734
|
+
return protocol === "http:" || protocol === "https:";
|
|
6735
|
+
}
|
|
6712
6736
|
function isIdentifierSegment(segment) {
|
|
6713
6737
|
if (UUID_SEGMENT.test(segment)) return true;
|
|
6714
6738
|
if (HEX_SEGMENT.test(segment)) return true;
|
|
@@ -6746,15 +6770,16 @@ function redactUrlString(value, options) {
|
|
|
6746
6770
|
credentialRedacted: false,
|
|
6747
6771
|
identifiersMasked: false
|
|
6748
6772
|
};
|
|
6749
|
-
if (!
|
|
6750
|
-
const url =
|
|
6773
|
+
if (!looksLikeUrlForRedaction(value)) return unchanged;
|
|
6774
|
+
const url = parseRedactableUrl(value);
|
|
6751
6775
|
if (!url) return unchanged;
|
|
6752
6776
|
const replacement = options.replacement ?? "[REDACTED]";
|
|
6753
6777
|
const idPlaceholder = options.idPlaceholder ?? "[id]";
|
|
6778
|
+
const http = isHttpProtocol(url.protocol);
|
|
6754
6779
|
let credentialRedacted = url.username.length > 0 || url.password.length > 0;
|
|
6755
6780
|
let identifiersMasked = false;
|
|
6756
6781
|
let pathname = url.pathname;
|
|
6757
|
-
if (options.maskPathIds === true) {
|
|
6782
|
+
if (http && options.maskPathIds === true) {
|
|
6758
6783
|
pathname = url.pathname.split("/").map((segment) => {
|
|
6759
6784
|
if (segment.length === 0 || !isIdentifierSegment(decodeParam(segment))) {
|
|
6760
6785
|
return segment;
|
|
@@ -7552,6 +7577,19 @@ function valueContainsKeyValueSecret(value) {
|
|
|
7552
7577
|
|
|
7553
7578
|
// packages/redact/src/url-redaction.ts
|
|
7554
7579
|
var HTTP_URL2 = /^https?:\/\/[^\s]+$/i;
|
|
7580
|
+
var CONNECTION_PROTOCOLS2 = /* @__PURE__ */ new Set([
|
|
7581
|
+
"postgres:",
|
|
7582
|
+
"postgresql:",
|
|
7583
|
+
"mysql:",
|
|
7584
|
+
"mariadb:",
|
|
7585
|
+
"mongodb:",
|
|
7586
|
+
"mongodb+srv:",
|
|
7587
|
+
"redis:",
|
|
7588
|
+
"rediss:",
|
|
7589
|
+
"amqp:",
|
|
7590
|
+
"amqps:"
|
|
7591
|
+
]);
|
|
7592
|
+
var CONNECTION_URI2 = /^(?:postgres|postgresql|mysql|mariadb|mongodb(?:\+srv)?|rediss?|amqps?):\/\/[^\s]+$/i;
|
|
7555
7593
|
var UUID_SEGMENT2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
7556
7594
|
var HEX_SEGMENT2 = /^[0-9a-f]{12,}$/i;
|
|
7557
7595
|
var NUMERIC_SEGMENT2 = /^\d{5,}$/;
|
|
@@ -7559,14 +7597,25 @@ var OPAQUE_SEGMENT2 = /^[A-Za-z0-9_-]{20,}$/;
|
|
|
7559
7597
|
function looksLikeHttpUrl2(value) {
|
|
7560
7598
|
return HTTP_URL2.test(value.trim());
|
|
7561
7599
|
}
|
|
7562
|
-
function
|
|
7600
|
+
function looksLikeConnectionUri2(value) {
|
|
7601
|
+
return CONNECTION_URI2.test(value.trim());
|
|
7602
|
+
}
|
|
7603
|
+
function looksLikeUrlForRedaction2(value) {
|
|
7604
|
+
return looksLikeHttpUrl2(value) || looksLikeConnectionUri2(value);
|
|
7605
|
+
}
|
|
7606
|
+
function parseRedactableUrl2(value) {
|
|
7563
7607
|
try {
|
|
7564
7608
|
const url = new URL(value.trim());
|
|
7565
|
-
|
|
7609
|
+
if (url.protocol === "http:" || url.protocol === "https:") return url;
|
|
7610
|
+
if (CONNECTION_PROTOCOLS2.has(url.protocol)) return url;
|
|
7611
|
+
return void 0;
|
|
7566
7612
|
} catch {
|
|
7567
7613
|
return void 0;
|
|
7568
7614
|
}
|
|
7569
7615
|
}
|
|
7616
|
+
function isHttpProtocol2(protocol) {
|
|
7617
|
+
return protocol === "http:" || protocol === "https:";
|
|
7618
|
+
}
|
|
7570
7619
|
function isIdentifierSegment2(segment) {
|
|
7571
7620
|
if (UUID_SEGMENT2.test(segment)) return true;
|
|
7572
7621
|
if (HEX_SEGMENT2.test(segment)) return true;
|
|
@@ -7604,15 +7653,16 @@ function redactUrlString2(value, options) {
|
|
|
7604
7653
|
credentialRedacted: false,
|
|
7605
7654
|
identifiersMasked: false
|
|
7606
7655
|
};
|
|
7607
|
-
if (!
|
|
7608
|
-
const url =
|
|
7656
|
+
if (!looksLikeUrlForRedaction2(value)) return unchanged;
|
|
7657
|
+
const url = parseRedactableUrl2(value);
|
|
7609
7658
|
if (!url) return unchanged;
|
|
7610
7659
|
const replacement = options.replacement ?? "[REDACTED]";
|
|
7611
7660
|
const idPlaceholder = options.idPlaceholder ?? "[id]";
|
|
7661
|
+
const http = isHttpProtocol2(url.protocol);
|
|
7612
7662
|
let credentialRedacted = url.username.length > 0 || url.password.length > 0;
|
|
7613
7663
|
let identifiersMasked = false;
|
|
7614
7664
|
let pathname = url.pathname;
|
|
7615
|
-
if (options.maskPathIds === true) {
|
|
7665
|
+
if (http && options.maskPathIds === true) {
|
|
7616
7666
|
pathname = url.pathname.split("/").map((segment) => {
|
|
7617
7667
|
if (segment.length === 0 || !isIdentifierSegment2(decodeParam2(segment))) {
|
|
7618
7668
|
return segment;
|
|
@@ -8062,7 +8112,7 @@ var Redactor2 = class {
|
|
|
8062
8112
|
return applyRule(rule, value, this.#replacement);
|
|
8063
8113
|
}
|
|
8064
8114
|
}
|
|
8065
|
-
if (typeof value === "string" &&
|
|
8115
|
+
if (typeof value === "string" && looksLikeUrlForRedaction2(value)) {
|
|
8066
8116
|
const url = redactUrlString2(value, {
|
|
8067
8117
|
sensitiveKeys: this.#sensitiveKeys,
|
|
8068
8118
|
isSensitiveValue: (candidate) => this.#detect(candidate, key, path16) !== void 0,
|
|
@@ -9031,5 +9081,5 @@ async function runReadOnlyMcpServer(options = {}) {
|
|
|
9031
9081
|
}
|
|
9032
9082
|
|
|
9033
9083
|
export { MCP_MAX_REQUEST_BYTES, MCP_PROTOCOL_VERSION, MCP_SERVER_INSTRUCTIONS, READ_ONLY_TOOLS, TRACE_DATA_UNTRUSTED_WARNING, callReadOnlyTool, createMcpServerContext, handleMcpProtocolLine, runReadOnlyMcpServer };
|
|
9034
|
-
//# sourceMappingURL=chunk-
|
|
9035
|
-
//# sourceMappingURL=chunk-
|
|
9084
|
+
//# sourceMappingURL=chunk-FUNPQPC3.mjs.map
|
|
9085
|
+
//# sourceMappingURL=chunk-FUNPQPC3.mjs.map
|