@plune-ai/cli 0.39.1 → 0.39.3
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/README.md +3 -2
- package/dist/cli.cjs +406 -104
- package/dist/index.cjs +62 -6
- package/dist/index.js +57 -1
- package/dist/mcp-tools.cjs +11 -2
- package/dist/mcp-tools.d.cts +7 -2
- package/dist/mcp-tools.d.ts +7 -2
- package/dist/mcp-tools.js +10 -2
- package/dist/reporter-core.cjs +227 -6
- package/dist/reporter-core.d.cts +13 -1
- package/dist/reporter-core.d.ts +13 -1
- package/dist/reporter-core.js +222 -1
- package/package.json +1 -1
- package/skills/qa-mission/SKILL.md +28 -5
- package/skills/qa-mission/references/llm-evals.md +126 -0
- package/skills/qa-mission/references/tool-calls.md +11 -6
package/dist/cli.cjs
CHANGED
|
@@ -1102,7 +1102,29 @@ var init_prices = __esm({
|
|
|
1102
1102
|
// OpenRouter has hundreds of models and dynamic routing, so most still need a `pricing` entry
|
|
1103
1103
|
// in plune.yaml (or report cost_usd=0). Verify against OpenRouter's current rates.
|
|
1104
1104
|
"openai/gpt-4o": { input_per_1k_usd: 25e-4, output_per_1k_usd: 0.01 },
|
|
1105
|
-
"openai/gpt-4o-mini": { input_per_1k_usd: 15e-5, output_per_1k_usd: 6e-4 }
|
|
1105
|
+
"openai/gpt-4o-mini": { input_per_1k_usd: 15e-5, output_per_1k_usd: 6e-4 },
|
|
1106
|
+
// Via OpenRouter, the models the agent scenarios workflow can be run on. Source:
|
|
1107
|
+
// https://openrouter.ai/api/v1/models (`pricing`, USD per token), read on 2026-11-18, kept here
|
|
1108
|
+
// per thousand. A real OpenRouter call reports its own cost, which wins over these; they price a
|
|
1109
|
+
// dry run and any call that reports none. Long prompts may cost more on some of them.
|
|
1110
|
+
// The cheap set:
|
|
1111
|
+
"deepseek/deepseek-v4-flash": { input_per_1k_usd: 9e-5, output_per_1k_usd: 18e-5 },
|
|
1112
|
+
"qwen/qwen3.7-flash": { input_per_1k_usd: 3e-5, output_per_1k_usd: 13e-5 },
|
|
1113
|
+
"google/gemini-2.5-flash-lite": { input_per_1k_usd: 1e-4, output_per_1k_usd: 4e-4 },
|
|
1114
|
+
"mistralai/mistral-small-3.2-24b-instruct": {
|
|
1115
|
+
input_per_1k_usd: 75e-6,
|
|
1116
|
+
output_per_1k_usd: 2e-4
|
|
1117
|
+
},
|
|
1118
|
+
"openai/gpt-oss-120b": { input_per_1k_usd: 15e-5, output_per_1k_usd: 6e-4 },
|
|
1119
|
+
"anthropic/claude-haiku-5.5": { input_per_1k_usd: 1e-4, output_per_1k_usd: 5e-4 },
|
|
1120
|
+
"z-ai/glm-5.3-flash": { input_per_1k_usd: 399e-7, output_per_1k_usd: 784e-7 },
|
|
1121
|
+
// The middle set:
|
|
1122
|
+
"moonshotai/kimi-k2.6": { input_per_1k_usd: 65e-5, output_per_1k_usd: 341e-5 },
|
|
1123
|
+
"minimax/minimax-m3": { input_per_1k_usd: 3e-4, output_per_1k_usd: 12e-4 },
|
|
1124
|
+
"qwen/qwen3.7-plus": { input_per_1k_usd: 32e-5, output_per_1k_usd: 128e-5 },
|
|
1125
|
+
"google/gemini-3.8-flash": { input_per_1k_usd: 825e-6, output_per_1k_usd: 4125e-6 },
|
|
1126
|
+
"deepseek/deepseek-v4-pro": { input_per_1k_usd: 9e-4, output_per_1k_usd: 15e-4 },
|
|
1127
|
+
"openai/gpt-6.1-terra": { input_per_1k_usd: 1e-3, output_per_1k_usd: 5e-3 }
|
|
1106
1128
|
};
|
|
1107
1129
|
}
|
|
1108
1130
|
});
|
|
@@ -6856,13 +6878,13 @@ var init_catalog = __esm({
|
|
|
6856
6878
|
});
|
|
6857
6879
|
|
|
6858
6880
|
// src/mcp-testing/conformance/profile.ts
|
|
6859
|
-
var import_node_crypto2, PROFILE, manifestDigest;
|
|
6881
|
+
var import_node_crypto2, PROFILE_2026_11_2, PROFILE_2026_11_3, PROFILE, PROFILES, profileOf, manifestDigest;
|
|
6860
6882
|
var init_profile = __esm({
|
|
6861
6883
|
"src/mcp-testing/conformance/profile.ts"() {
|
|
6862
6884
|
"use strict";
|
|
6863
6885
|
init_cjs_shims();
|
|
6864
6886
|
import_node_crypto2 = require("crypto");
|
|
6865
|
-
|
|
6887
|
+
PROFILE_2026_11_2 = {
|
|
6866
6888
|
id: "plune-mcp-conformance",
|
|
6867
6889
|
version: "2026-11.2",
|
|
6868
6890
|
checks: [
|
|
@@ -6885,6 +6907,46 @@ var init_profile = __esm({
|
|
|
6885
6907
|
"stdio-stdout-clean"
|
|
6886
6908
|
]
|
|
6887
6909
|
};
|
|
6910
|
+
PROFILE_2026_11_3 = {
|
|
6911
|
+
id: "plune-mcp-conformance",
|
|
6912
|
+
version: "2026-11.3",
|
|
6913
|
+
checks: [
|
|
6914
|
+
"life-initialize-result",
|
|
6915
|
+
"life-version-negotiation",
|
|
6916
|
+
"life-capabilities-declared-served",
|
|
6917
|
+
"life-capabilities-served-declared",
|
|
6918
|
+
"life-ping-empty-result",
|
|
6919
|
+
"base-jsonrpc-parse-error",
|
|
6920
|
+
"base-unknown-method-error",
|
|
6921
|
+
"base-response-id-matches",
|
|
6922
|
+
"tools-list-shape",
|
|
6923
|
+
"tools-input-schema-valid",
|
|
6924
|
+
"tools-output-schema-valid",
|
|
6925
|
+
"tools-structured-conformant",
|
|
6926
|
+
"resources-list-shape",
|
|
6927
|
+
"resources-read-listed",
|
|
6928
|
+
"resources-templates-shape",
|
|
6929
|
+
"prompts-list-shape",
|
|
6930
|
+
"stdio-stdout-clean",
|
|
6931
|
+
"http-notification-202",
|
|
6932
|
+
"http-request-content-type",
|
|
6933
|
+
"http-response-utf8",
|
|
6934
|
+
"http-single-endpoint",
|
|
6935
|
+
"http-get-stream-or-405",
|
|
6936
|
+
"http-session-id-visible-ascii",
|
|
6937
|
+
"http-protocol-version-header-invalid-400",
|
|
6938
|
+
"http-concurrent-posts-matched",
|
|
6939
|
+
"http-sse-event-ids-unique",
|
|
6940
|
+
"http-sse-no-server-requests",
|
|
6941
|
+
"http-close-cancels",
|
|
6942
|
+
"http-session-terminated-404",
|
|
6943
|
+
"http-sse-no-broadcast",
|
|
6944
|
+
"http-origin-invalid-403"
|
|
6945
|
+
]
|
|
6946
|
+
};
|
|
6947
|
+
PROFILE = PROFILE_2026_11_3;
|
|
6948
|
+
PROFILES = [PROFILE_2026_11_2, PROFILE_2026_11_3];
|
|
6949
|
+
profileOf = (version2) => PROFILES.find((p) => p.version === version2);
|
|
6888
6950
|
manifestDigest = (ids) => (0, import_node_crypto2.createHash)("sha256").update([...ids].sort().join("\n")).digest("hex");
|
|
6889
6951
|
}
|
|
6890
6952
|
});
|
|
@@ -8468,6 +8530,7 @@ function createClient(opts) {
|
|
|
8468
8530
|
upload: (path25, bytes, contentType2) => send3("POST", path25, { body: bytes, type: contentType2 }, uploadRetries ?? DEFAULT_RETRIES),
|
|
8469
8531
|
del: (path25) => send3("DELETE", path25),
|
|
8470
8532
|
get: (path25) => send3("GET", path25),
|
|
8533
|
+
patch: (path25, body) => send3("PATCH", path25, { body: JSON.stringify(body), type: "application/json" }),
|
|
8471
8534
|
async put(url, headers, source) {
|
|
8472
8535
|
const putRetries = uploadRetries ?? 3;
|
|
8473
8536
|
let last = { ok: false, status: null, code: "network" };
|
|
@@ -8729,6 +8792,180 @@ var init_files_batch = __esm({
|
|
|
8729
8792
|
}
|
|
8730
8793
|
});
|
|
8731
8794
|
|
|
8795
|
+
// src/reporter-core/code-snapshot.ts
|
|
8796
|
+
function skipString(src, i, quote) {
|
|
8797
|
+
for (let j = i + 1; j < src.length; j += 1) {
|
|
8798
|
+
const c = src[j];
|
|
8799
|
+
if (c === "\\") j += 1;
|
|
8800
|
+
else if (c === quote) return j + 1;
|
|
8801
|
+
else if (c === "\n") return -1;
|
|
8802
|
+
}
|
|
8803
|
+
return -1;
|
|
8804
|
+
}
|
|
8805
|
+
function skipTemplate(src, i) {
|
|
8806
|
+
for (let j = i + 1; j < src.length; j += 1) {
|
|
8807
|
+
const c = src[j];
|
|
8808
|
+
if (c === "\\") j += 1;
|
|
8809
|
+
else if (c === "`") return j + 1;
|
|
8810
|
+
else if (c === "$" && src[j + 1] === "{") {
|
|
8811
|
+
const end2 = matching(src, j + 2, "}");
|
|
8812
|
+
if (end2 < 0) return -1;
|
|
8813
|
+
j = end2;
|
|
8814
|
+
}
|
|
8815
|
+
}
|
|
8816
|
+
return -1;
|
|
8817
|
+
}
|
|
8818
|
+
function skipRegex(src, i) {
|
|
8819
|
+
let inClass = false;
|
|
8820
|
+
for (let j = i + 1; j < src.length; j += 1) {
|
|
8821
|
+
const c = src[j];
|
|
8822
|
+
if (c === "\\") j += 1;
|
|
8823
|
+
else if (c === "\n") return -1;
|
|
8824
|
+
else if (c === "[") inClass = true;
|
|
8825
|
+
else if (c === "]") inClass = false;
|
|
8826
|
+
else if (c === "/" && !inClass) {
|
|
8827
|
+
let k = j + 1;
|
|
8828
|
+
while (k < src.length && /[a-z]/i.test(src[k])) k += 1;
|
|
8829
|
+
return k;
|
|
8830
|
+
}
|
|
8831
|
+
}
|
|
8832
|
+
return -1;
|
|
8833
|
+
}
|
|
8834
|
+
function matching(src, i, close) {
|
|
8835
|
+
const stack = [close];
|
|
8836
|
+
let prev = "(";
|
|
8837
|
+
while (i < src.length) {
|
|
8838
|
+
const c = src[i];
|
|
8839
|
+
const next = src[i + 1];
|
|
8840
|
+
let to = -2;
|
|
8841
|
+
if (c === "/" && next === "/") to = src.indexOf("\n", i);
|
|
8842
|
+
else if (c === "/" && next === "*")
|
|
8843
|
+
to = src.indexOf("*/", i + 2) < 0 ? -1 : src.indexOf("*/", i + 2) + 2;
|
|
8844
|
+
else if (c === "'" || c === '"') to = skipString(src, i, c);
|
|
8845
|
+
else if (c === "`") to = skipTemplate(src, i);
|
|
8846
|
+
else if (c === "/" && BEFORE_REGEX.has(prev)) to = skipRegex(src, i);
|
|
8847
|
+
if (to === -1) return -1;
|
|
8848
|
+
if (to !== -2) {
|
|
8849
|
+
if (c !== "/" || next !== "/" && next !== "*") prev = "a";
|
|
8850
|
+
i = to;
|
|
8851
|
+
continue;
|
|
8852
|
+
}
|
|
8853
|
+
if (c === "(") stack.push(")");
|
|
8854
|
+
else if (c === "[") stack.push("]");
|
|
8855
|
+
else if (c === "{") stack.push("}");
|
|
8856
|
+
else if (c === ")" || c === "]" || c === "}") {
|
|
8857
|
+
if (stack.pop() !== c) return -1;
|
|
8858
|
+
if (stack.length === 0) return i;
|
|
8859
|
+
}
|
|
8860
|
+
if (!/\s/.test(c)) prev = c;
|
|
8861
|
+
i += 1;
|
|
8862
|
+
}
|
|
8863
|
+
return -1;
|
|
8864
|
+
}
|
|
8865
|
+
function callTextAt(source, line, column) {
|
|
8866
|
+
const lines = source.split("\n");
|
|
8867
|
+
if (line < 1 || line > lines.length) return void 0;
|
|
8868
|
+
const lineStart = lines.slice(0, line - 1).reduce((n, l) => n + l.length + 1, 0);
|
|
8869
|
+
const lineEnd = lineStart + lines[line - 1].length;
|
|
8870
|
+
const heads = [];
|
|
8871
|
+
CALL.lastIndex = lineStart;
|
|
8872
|
+
for (let h = CALL.exec(source); h !== null && h.index < lineEnd; h = CALL.exec(source))
|
|
8873
|
+
heads.push(h);
|
|
8874
|
+
const at2 = column === void 0 ? -1 : lineStart + column - 1;
|
|
8875
|
+
const head = heads.find((h) => h.index <= at2 && at2 < h.index + h[0].length) ?? (heads.length === 1 ? heads[0] : void 0);
|
|
8876
|
+
if (head === void 0) return void 0;
|
|
8877
|
+
const end2 = matching(source, head.index + head[0].length, ")");
|
|
8878
|
+
if (end2 < 0) return void 0;
|
|
8879
|
+
const text6 = source.slice(head.index, end2 + 1).replace(/\r\n/g, "\n");
|
|
8880
|
+
return Buffer.byteLength(text6, "utf8") <= SNAPSHOT_MAX_BYTES ? text6 : void 0;
|
|
8881
|
+
}
|
|
8882
|
+
function maskCredentials(text6) {
|
|
8883
|
+
let out = text6;
|
|
8884
|
+
for (const { kind: kind2, re } of SHAPES) out = out.replace(re, `\u2039${kind2}\u203A`);
|
|
8885
|
+
for (const re of PLACES) {
|
|
8886
|
+
out = out.replace(re, (...args) => {
|
|
8887
|
+
const groups = args.at(-1);
|
|
8888
|
+
return `${groups.lead}${groups.q}\u2039${groups.role.toLowerCase().replace(/^[^a-z]+/, "")}\u203A${groups.q}`;
|
|
8889
|
+
});
|
|
8890
|
+
}
|
|
8891
|
+
return out.replace(HEADER_LINE, "$1$2$3\u2039header\u203A").replace(/\b(Bearer)([ \t]+)(?!‹)[\w.~+/=-]{8,}/g, "$1$2\u2039credential\u203A").replace(
|
|
8892
|
+
/\b(Basic|Token)([ \t]+)(?!‹)(?=[\w.~+/=-]*[\d=+/]|[\w.~+/=-]*[a-z][\w.~+/=-]*[A-Z])[\w.~+/=-]{8,}/g,
|
|
8893
|
+
"$1$2\u2039credential\u203A"
|
|
8894
|
+
).replace(/\b(PLUNE_[A-Z0-9_]*=)(?!‹)[^\s'"\x60;,)]+/g, "$1\u2039env-secret\u203A").replace(QUERY_PARAM, "$1\u2039credential\u203A").replace(/\b([a-z][\w+.-]*:\/\/)[^\s/@'"\x60]+@/gi, "$1\u2039credential\u203A@");
|
|
8895
|
+
}
|
|
8896
|
+
function snapshotAt(at2, files) {
|
|
8897
|
+
let source = files.get(at2.file);
|
|
8898
|
+
if (source === void 0) {
|
|
8899
|
+
try {
|
|
8900
|
+
source = (0, import_node_fs8.readFileSync)(at2.file, "utf8");
|
|
8901
|
+
} catch {
|
|
8902
|
+
source = null;
|
|
8903
|
+
}
|
|
8904
|
+
files.set(at2.file, source);
|
|
8905
|
+
}
|
|
8906
|
+
if (source === null) return void 0;
|
|
8907
|
+
const text6 = callTextAt(source, at2.line, at2.column);
|
|
8908
|
+
if (text6 === void 0) return void 0;
|
|
8909
|
+
const masked = maskCredentials(text6);
|
|
8910
|
+
return Buffer.byteLength(masked, "utf8") <= SNAPSHOT_MAX_BYTES ? masked : void 0;
|
|
8911
|
+
}
|
|
8912
|
+
var import_node_fs8, SNAPSHOT_MAX_BYTES, CALL, BEFORE_REGEX, CREDENTIAL, LITERAL, TYPING, SHAPES, PLACES, HEADER_LINE, QUERY_PARAM;
|
|
8913
|
+
var init_code_snapshot = __esm({
|
|
8914
|
+
"src/reporter-core/code-snapshot.ts"() {
|
|
8915
|
+
"use strict";
|
|
8916
|
+
init_cjs_shims();
|
|
8917
|
+
import_node_fs8 = require("fs");
|
|
8918
|
+
SNAPSHOT_MAX_BYTES = 16384;
|
|
8919
|
+
CALL = /\b(?:test|it)(?:\.(?:skip|fixme|only|fail|slow))?\s*\(/g;
|
|
8920
|
+
BEFORE_REGEX = /* @__PURE__ */ new Set([..."(,=:[!&|?{};+-*%<>~^"]);
|
|
8921
|
+
CREDENTIAL = "password|passphrase|passwd|pass|pwd|token|secret|api[-_]?key|private[-_]?key|credential|auth|session|cookie";
|
|
8922
|
+
LITERAL = String.raw`(?<q>['"\x60])(?:\\.|(?!\k<q>)[^\\\n])*\k<q>`;
|
|
8923
|
+
TYPING = "(?:fill|type|pressSequentially)";
|
|
8924
|
+
SHAPES = [
|
|
8925
|
+
{ kind: "github-token", re: /\b(?:ghp|gho|ghs|ghu)_[A-Za-z0-9]{36}\b|\bgithub_pat_\w{20,}/g },
|
|
8926
|
+
{ kind: "api-key", re: /\bsk-[\w-]{20,}/g },
|
|
8927
|
+
{ kind: "api-key", re: /\b[sr]k_(?:live|test)_[A-Za-z0-9]{10,}/g },
|
|
8928
|
+
{ kind: "npm-token", re: /\bnpm_[A-Za-z0-9]{20,}/g },
|
|
8929
|
+
{ kind: "google-key", re: /\bAIza[\w-]{30,}/g },
|
|
8930
|
+
{ kind: "plune-token", re: /\bplune_[A-Za-z0-9_]{16,}/g },
|
|
8931
|
+
{ kind: "aws-key", re: /\bAKIA[0-9A-Z]{16}\b/g },
|
|
8932
|
+
{ kind: "slack-token", re: /\bxox[abprs]-[A-Za-z0-9-]{10,}/g },
|
|
8933
|
+
{
|
|
8934
|
+
kind: "private-key",
|
|
8935
|
+
re: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g
|
|
8936
|
+
},
|
|
8937
|
+
{ kind: "jwt", re: /\beyJ[\w-]{10,}\.[\w-]{10,}\.[\w-]{10,}/g }
|
|
8938
|
+
];
|
|
8939
|
+
PLACES = [
|
|
8940
|
+
// `password = '…'`, `apiKey: "…"`, `'x-api-key': '…'`
|
|
8941
|
+
new RegExp(
|
|
8942
|
+
String.raw`(?<lead>\b(?<role>[\w$-]*(?:${CREDENTIAL})[\w$-]*)['"]?\s*[:=]\s*)${LITERAL}`,
|
|
8943
|
+
"gi"
|
|
8944
|
+
),
|
|
8945
|
+
// `setToken('…')`: the call is named for a credential
|
|
8946
|
+
new RegExp(String.raw`(?<lead>\b(?<role>[\w$]*(?:${CREDENTIAL})[\w$]*)\s*\(\s*)${LITERAL}`, "gi"),
|
|
8947
|
+
// `.fill('#password', '…')`, `.type('#pwd', '…')`: the field is named in the same call
|
|
8948
|
+
new RegExp(
|
|
8949
|
+
String.raw`(?<lead>\.${TYPING}\(\s*['"][^'"\n]*?(?<role>${CREDENTIAL})[^'"\n]*['"]\s*,\s*)${LITERAL}`,
|
|
8950
|
+
"gi"
|
|
8951
|
+
),
|
|
8952
|
+
// `getByLabel('Password').fill('…')`, `getByRole('textbox', { name: 'Password' }).type('…')`: … or
|
|
8953
|
+
// anywhere in the call the typing is chained off
|
|
8954
|
+
new RegExp(
|
|
8955
|
+
String.raw`(?<lead>\([^()\n]*?(?<role>${CREDENTIAL})[^()\n]*\)\s*\.${TYPING}\(\s*)${LITERAL}`,
|
|
8956
|
+
"gi"
|
|
8957
|
+
),
|
|
8958
|
+
// `{ name: 'session', value: '…' }`: a cookie (or any name/value pair) named for a credential
|
|
8959
|
+
new RegExp(
|
|
8960
|
+
String.raw`(?<lead>\bname\s*:\s*['"][^'"\n]*?(?<role>${CREDENTIAL})[^'"\n]*['"]\s*,\s*value\s*:\s*)${LITERAL}`,
|
|
8961
|
+
"gi"
|
|
8962
|
+
)
|
|
8963
|
+
];
|
|
8964
|
+
HEADER_LINE = /((?:^|\\[nr]|\x60)[ \t>*<+-]*['"]?)((?:proxy-)?authorization|(?:set-)?cookie|[\w-]*session[\w-]*)(['"]?[ \t]*:[ \t]*)(?![\w$.]+(?:\([^()\n]*\))?[ \t]*[,;)}\]])[^\s'"\x60\\][^\r\n'"\x60\\]*/gim;
|
|
8965
|
+
QUERY_PARAM = /([?&][\w.-]*(?:token|key|secret|password|passwd|pass|pwd|auth|signature|sig|credential|session)[\w.-]*=)(?!‹)[^&#\s'"\x60]+/gi;
|
|
8966
|
+
}
|
|
8967
|
+
});
|
|
8968
|
+
|
|
8732
8969
|
// src/reporter-core/session.ts
|
|
8733
8970
|
function nameOf(file) {
|
|
8734
8971
|
const own3 = file.name.split(/[\\/]/).pop()?.trim() || (file.path === void 0 ? "" : (0, import_node_path5.basename)(file.path));
|
|
@@ -8878,7 +9115,7 @@ function fileSender(options) {
|
|
|
8878
9115
|
if (job.body !== void 0) bytes = job.body;
|
|
8879
9116
|
else {
|
|
8880
9117
|
try {
|
|
8881
|
-
bytes = await
|
|
9118
|
+
bytes = await import_node_fs9.promises.readFile(job.path);
|
|
8882
9119
|
} catch {
|
|
8883
9120
|
return skip(kind2, job.name, "missing");
|
|
8884
9121
|
}
|
|
@@ -8933,7 +9170,7 @@ function fileSender(options) {
|
|
|
8933
9170
|
else if (job.path === void 0) return void skip(kind2, job.name, "missing");
|
|
8934
9171
|
else {
|
|
8935
9172
|
try {
|
|
8936
|
-
size = (await
|
|
9173
|
+
size = (await import_node_fs9.promises.stat(job.path)).size;
|
|
8937
9174
|
} catch {
|
|
8938
9175
|
return void skip(kind2, job.name, "missing");
|
|
8939
9176
|
}
|
|
@@ -8989,7 +9226,7 @@ function fileSender(options) {
|
|
|
8989
9226
|
else if (job.path === void 0) return void skip(job.kind, job.name, "missing");
|
|
8990
9227
|
else {
|
|
8991
9228
|
try {
|
|
8992
|
-
size = (await
|
|
9229
|
+
size = (await import_node_fs9.promises.stat(job.path)).size;
|
|
8993
9230
|
} catch {
|
|
8994
9231
|
return void skip(job.kind, job.name, "missing");
|
|
8995
9232
|
}
|
|
@@ -9163,7 +9400,7 @@ function fileSender(options) {
|
|
|
9163
9400
|
}
|
|
9164
9401
|
let data;
|
|
9165
9402
|
try {
|
|
9166
|
-
data = job.body ?? await
|
|
9403
|
+
data = job.body ?? await import_node_fs9.promises.readFile(job.path);
|
|
9167
9404
|
} catch {
|
|
9168
9405
|
skip(kind2, job.name, "missing");
|
|
9169
9406
|
continue;
|
|
@@ -9319,6 +9556,9 @@ async function startRun(passed2, declared2) {
|
|
|
9319
9556
|
let offline = token2 === "";
|
|
9320
9557
|
let done = false;
|
|
9321
9558
|
const shortened = /* @__PURE__ */ new Set();
|
|
9559
|
+
const specFiles = /* @__PURE__ */ new Map();
|
|
9560
|
+
const snapshotByKey = /* @__PURE__ */ new Map();
|
|
9561
|
+
const snapshots = /* @__PURE__ */ new Map();
|
|
9322
9562
|
function bound(keys) {
|
|
9323
9563
|
return keys.map((key) => {
|
|
9324
9564
|
const fit = boundKey(key);
|
|
@@ -9472,6 +9712,8 @@ async function startRun(passed2, declared2) {
|
|
|
9472
9712
|
const { keys: _keys, files: files2, ...rest } = pending;
|
|
9473
9713
|
submissions.push({ ...rest, testCaseId: r.id });
|
|
9474
9714
|
if (files2 !== void 0) filesByKey.set(pending.resultKey, files2);
|
|
9715
|
+
const text6 = snapshotByKey.get(pending.resultKey);
|
|
9716
|
+
if (text6 !== void 0) snapshots.set(r.id, text6);
|
|
9475
9717
|
}
|
|
9476
9718
|
if (submissions.length > 0) {
|
|
9477
9719
|
const before = stats.deferred;
|
|
@@ -9481,6 +9723,46 @@ async function startRun(passed2, declared2) {
|
|
|
9481
9723
|
}
|
|
9482
9724
|
}
|
|
9483
9725
|
}
|
|
9726
|
+
async function syncSnapshots() {
|
|
9727
|
+
if (snapshots.size === 0 || offline) return;
|
|
9728
|
+
const stored = /* @__PURE__ */ new Map();
|
|
9729
|
+
let cursor = null;
|
|
9730
|
+
do {
|
|
9731
|
+
const query = `type=automated&stability=0&limit=200${cursor === null ? "" : `&cursor=${encodeURIComponent(cursor)}`}`;
|
|
9732
|
+
const out = await client.get(`/v1/test-cases?${query}`);
|
|
9733
|
+
if (!out.ok || !Array.isArray(out.body?.testCases)) {
|
|
9734
|
+
log(`plune: could not update the code snapshots (${out.ok ? "the case list had no cases" : out.detail || out.kind}).`);
|
|
9735
|
+
return;
|
|
9736
|
+
}
|
|
9737
|
+
for (const row of out.body.testCases) {
|
|
9738
|
+
if (typeof row?.id === "string" && snapshots.has(row.id)) stored.set(row.id, row.codeSnapshotHash ?? null);
|
|
9739
|
+
}
|
|
9740
|
+
cursor = typeof out.body.nextCursor === "string" ? out.body.nextCursor : null;
|
|
9741
|
+
} while (cursor !== null && stored.size < snapshots.size);
|
|
9742
|
+
const sha = (text6) => (0, import_node_crypto4.createHash)("sha256").update(text6).digest("hex");
|
|
9743
|
+
const due = [...snapshots].filter(([id2, text6]) => stored.has(id2) && stored.get(id2) !== sha(text6)).sort(([a], [b]) => sha(`${runId}:${a}`).localeCompare(sha(`${runId}:${b}`)));
|
|
9744
|
+
let updated = 0;
|
|
9745
|
+
let refused = 0;
|
|
9746
|
+
let tried = 0;
|
|
9747
|
+
for (const [id2, text6] of due.slice(0, SNAPSHOT_UPDATES_MAX)) {
|
|
9748
|
+
tried += 1;
|
|
9749
|
+
const out = await client.patch(`/v1/test-cases/${encodeURIComponent(id2)}`, { codeSnapshot: text6 });
|
|
9750
|
+
if (out.ok) {
|
|
9751
|
+
updated += 1;
|
|
9752
|
+
continue;
|
|
9753
|
+
}
|
|
9754
|
+
if (out.kind === "auth" || out.kind === "unavailable" || out.status === 429) {
|
|
9755
|
+
log(`plune: could not update the code snapshot of test case ${id2} (${out.detail || out.kind}); the rest are left as they are.`);
|
|
9756
|
+
break;
|
|
9757
|
+
}
|
|
9758
|
+
refused += 1;
|
|
9759
|
+
}
|
|
9760
|
+
const left = due.length - tried;
|
|
9761
|
+
const parts = [`${updated} code snapshot(s) updated`];
|
|
9762
|
+
if (refused > 0) parts.push(`${refused} not updated`);
|
|
9763
|
+
if (left > 0 && tried === Math.min(due.length, SNAPSHOT_UPDATES_MAX)) parts.push(`${left} left for the next run`);
|
|
9764
|
+
if (updated + refused > 0) log(`plune: ${parts.join(", ")}`);
|
|
9765
|
+
}
|
|
9484
9766
|
const sending = /* @__PURE__ */ new Set();
|
|
9485
9767
|
let sendError;
|
|
9486
9768
|
let answered = false;
|
|
@@ -9523,6 +9805,8 @@ async function startRun(passed2, declared2) {
|
|
|
9523
9805
|
if (match.kind === "found") {
|
|
9524
9806
|
const { keys: _keys, files: files2, ...rest } = result2;
|
|
9525
9807
|
submissions.push({ ...rest, testCaseId: match.testCaseId });
|
|
9808
|
+
const text6 = snapshotByKey.get(result2.resultKey);
|
|
9809
|
+
if (text6 !== void 0) snapshots.set(match.testCaseId, text6);
|
|
9526
9810
|
if (files2 !== void 0) filesByKey.set(result2.resultKey, files2);
|
|
9527
9811
|
} else if (match.kind === "unmatched") {
|
|
9528
9812
|
stats.unresolved += 1;
|
|
@@ -9628,7 +9912,10 @@ async function startRun(passed2, declared2) {
|
|
|
9628
9912
|
return stats;
|
|
9629
9913
|
},
|
|
9630
9914
|
async add(result2) {
|
|
9631
|
-
|
|
9915
|
+
const { codeAt, ...rest } = result2;
|
|
9916
|
+
const text6 = codeAt === void 0 ? void 0 : snapshotAt(codeAt, specFiles);
|
|
9917
|
+
if (text6 !== void 0) snapshotByKey.set(result2.resultKey, text6);
|
|
9918
|
+
buffer.push({ ...rest, keys: bound(result2.keys) });
|
|
9632
9919
|
if (buffer.length >= batchSize) await flushBuffer();
|
|
9633
9920
|
},
|
|
9634
9921
|
flush,
|
|
@@ -9637,6 +9924,7 @@ async function startRun(passed2, declared2) {
|
|
|
9637
9924
|
done = true;
|
|
9638
9925
|
await flush();
|
|
9639
9926
|
await offer();
|
|
9927
|
+
await syncSnapshots();
|
|
9640
9928
|
let frozen;
|
|
9641
9929
|
if (runId !== null && !offline) {
|
|
9642
9930
|
const out = await client.post(`/v1/runs/${runId}/events`, {
|
|
@@ -9660,6 +9948,7 @@ async function startRun(passed2, declared2) {
|
|
|
9660
9948
|
done = true;
|
|
9661
9949
|
await flush();
|
|
9662
9950
|
await offer();
|
|
9951
|
+
await syncSnapshots();
|
|
9663
9952
|
let frozen;
|
|
9664
9953
|
const after = [];
|
|
9665
9954
|
const shard = env.shard;
|
|
@@ -9694,13 +9983,13 @@ async function startRun(passed2, declared2) {
|
|
|
9694
9983
|
}
|
|
9695
9984
|
};
|
|
9696
9985
|
}
|
|
9697
|
-
var import_node_crypto4,
|
|
9986
|
+
var import_node_crypto4, import_node_fs9, import_node_path5, import_node_util2, RESOLVE_CHUNK, BATCH_MAX, DISCOVER_MAX, BATCH_DEFAULT, SNAPSHOT_UPDATES_MAX, SEND_CONCURRENCY, EXPECTED_MAX, KEY_MAX, TITLE_MAX, COUNTED, SCREENSHOT_TYPES, SCREENSHOT_BYTES, SCREENSHOTS_PER_RESULT, TEXT_BYTES, TEXTS_PER_RESULT, UTF8, TYPE_BY_EXTENSION, METADATA_TYPE2, NAME_MAX, SKIPPED, BUCKET_FOUND, KINDS, codeOf2, keyId, BATCH_BYTES, ENVELOPE_BYTES;
|
|
9698
9987
|
var init_session2 = __esm({
|
|
9699
9988
|
"src/reporter-core/session.ts"() {
|
|
9700
9989
|
"use strict";
|
|
9701
9990
|
init_cjs_shims();
|
|
9702
9991
|
import_node_crypto4 = require("crypto");
|
|
9703
|
-
|
|
9992
|
+
import_node_fs9 = require("fs");
|
|
9704
9993
|
import_node_path5 = require("path");
|
|
9705
9994
|
import_node_util2 = require("util");
|
|
9706
9995
|
init_api_url();
|
|
@@ -9710,10 +9999,12 @@ var init_session2 = __esm({
|
|
|
9710
9999
|
init_failure_detail();
|
|
9711
10000
|
init_files_batch();
|
|
9712
10001
|
init_fallback();
|
|
10002
|
+
init_code_snapshot();
|
|
9713
10003
|
RESOLVE_CHUNK = 500;
|
|
9714
10004
|
BATCH_MAX = 500;
|
|
9715
10005
|
DISCOVER_MAX = 500;
|
|
9716
10006
|
BATCH_DEFAULT = 500;
|
|
10007
|
+
SNAPSHOT_UPDATES_MAX = 100;
|
|
9717
10008
|
SEND_CONCURRENCY = 4;
|
|
9718
10009
|
EXPECTED_MAX = 1e4;
|
|
9719
10010
|
KEY_MAX = 1024;
|
|
@@ -11361,6 +11652,8 @@ function pendingFrom(spec, test, result2, file, titles, ctx) {
|
|
|
11361
11652
|
keys,
|
|
11362
11653
|
title: titles.join(" \u203A "),
|
|
11363
11654
|
specRef: spec.line !== void 0 ? `${file}:${spec.line}` : file,
|
|
11655
|
+
// The test's own text is read from here for its case's code snapshot; a report from another machine names a file that is not here, and then there is none.
|
|
11656
|
+
...spec.line !== void 0 ? { codeAt: { file: attempt.testFile, line: spec.line, ...typeof spec.column === "number" ? { column: spec.column } : {} } } : {},
|
|
11364
11657
|
source: SOURCE3,
|
|
11365
11658
|
// Untouched, as everywhere: `timedOut` means what the project's map says it means, not what
|
|
11366
11659
|
// this file decided.
|
|
@@ -11404,7 +11697,7 @@ function readPlaywrightJson(source, file) {
|
|
|
11404
11697
|
const { config, suites } = parsed4;
|
|
11405
11698
|
const rootDir = typeof config?.rootDir === "string" ? config.rootDir : void 0;
|
|
11406
11699
|
const buildHref = config?.metadata?.ci?.buildHref;
|
|
11407
|
-
const repoRoot = rootDir !== void 0 && (0,
|
|
11700
|
+
const repoRoot = rootDir !== void 0 && (0, import_node_fs10.existsSync)(rootDir) ? repoRootOf(rootDir) : void 0;
|
|
11408
11701
|
const ctx = {
|
|
11409
11702
|
...rootDir !== void 0 ? { rootDir } : {},
|
|
11410
11703
|
...repoRoot !== void 0 ? { repoRoot } : {},
|
|
@@ -11423,12 +11716,12 @@ function readPlaywrightJson(source, file) {
|
|
|
11423
11716
|
function looksLikePlaywrightJson(source) {
|
|
11424
11717
|
return /^\s*\{/.test(source) && source.includes('"suites"');
|
|
11425
11718
|
}
|
|
11426
|
-
var
|
|
11719
|
+
var import_node_fs10, SOURCE3, TOKEN3, NOT_FAILED, JsonReportError;
|
|
11427
11720
|
var init_playwright_json = __esm({
|
|
11428
11721
|
"src/importers/playwright-json.ts"() {
|
|
11429
11722
|
"use strict";
|
|
11430
11723
|
init_cjs_shims();
|
|
11431
|
-
|
|
11724
|
+
import_node_fs10 = require("fs");
|
|
11432
11725
|
init_failure_detail();
|
|
11433
11726
|
init_result_key();
|
|
11434
11727
|
SOURCE3 = "playwright";
|
|
@@ -13461,8 +13754,13 @@ function pluneTool(name) {
|
|
|
13461
13754
|
function isPluneToolName(name) {
|
|
13462
13755
|
return BY_NAME.has(name);
|
|
13463
13756
|
}
|
|
13757
|
+
function offeredTo(tool2, scope) {
|
|
13758
|
+
if (scope !== "read") return true;
|
|
13759
|
+
if (tool2.write) return false;
|
|
13760
|
+
return tool2.name !== "plune_discover_tools" || PLUNE_TOOLS.some((t) => t.visibility !== "core" && !t.write);
|
|
13761
|
+
}
|
|
13464
13762
|
function defaultVisibleTools(scope) {
|
|
13465
|
-
return PLUNE_TOOLS.filter((t) => t.visibility === "core" &&
|
|
13763
|
+
return PLUNE_TOOLS.filter((t) => t.visibility === "core" && offeredTo(t, scope)).map((t) => t.name);
|
|
13466
13764
|
}
|
|
13467
13765
|
var import_zod5, MAX_VISIBLE_TOOLS, define, listPage, missionId, projectId, PLUNE_TOOLS, PLUNE_TOOL_NAMES, BY_NAME;
|
|
13468
13766
|
var init_contract = __esm({
|
|
@@ -14007,7 +14305,9 @@ function createPluneToolExecutor(opts) {
|
|
|
14007
14305
|
async plune_cases_search(i) {
|
|
14008
14306
|
const query = withoutUndefined({
|
|
14009
14307
|
...i["filters"],
|
|
14010
|
-
|
|
14308
|
+
// A full case weighs ~160 estimated tokens, so the platform's own page of up to 200 filled a model's context
|
|
14309
|
+
// in one answer; 20 a page, the rest a cursor away, unless the caller asks for more.
|
|
14310
|
+
limit: String(i["limit"] ?? 20),
|
|
14011
14311
|
cursor: i["cursor"],
|
|
14012
14312
|
stability: "0"
|
|
14013
14313
|
});
|
|
@@ -14318,7 +14618,7 @@ function createPluneMcpServer(opts, era) {
|
|
|
14318
14618
|
}
|
|
14319
14619
|
};
|
|
14320
14620
|
for (const tool2 of PLUNE_TOOLS) {
|
|
14321
|
-
if (opts.scope
|
|
14621
|
+
if (!offeredTo(tool2, opts.scope)) continue;
|
|
14322
14622
|
const handle = server2.registerTool(
|
|
14323
14623
|
tool2.name,
|
|
14324
14624
|
{
|
|
@@ -14736,8 +15036,8 @@ var init_thresholds = __esm({
|
|
|
14736
15036
|
writeFirst: 9272,
|
|
14737
15037
|
/** 2025 era, write scope, after plune_discover_tools: 22 tools, measured 10841 (10739 before the memory rules). */
|
|
14738
15038
|
writeAll: 11926,
|
|
14739
|
-
/** Read scope, either era:
|
|
14740
|
-
read:
|
|
15039
|
+
/** Read scope, either era: 7 tools, measured 2222 (2482 with plune_discover_tools, which a read token is not offered). */
|
|
15040
|
+
read: 2445,
|
|
14741
15041
|
/** 2026-07-28 era, write scope: 17 tools, the list does not change after discover; measured 8429 (8327 before the memory rules). */
|
|
14742
15042
|
modernWrite: 9272
|
|
14743
15043
|
},
|
|
@@ -16025,12 +16325,12 @@ function writeFiles(files) {
|
|
|
16025
16325
|
(f, i) => (0, import_node_path6.join)((0, import_node_path6.dirname)(f.path), `.${(0, import_node_path6.basename)(f.path)}.${process.pid}.${i}.tmp`)
|
|
16026
16326
|
);
|
|
16027
16327
|
const drop = (from) => {
|
|
16028
|
-
for (const t of temps.slice(from)) (0,
|
|
16328
|
+
for (const t of temps.slice(from)) (0, import_node_fs11.rmSync)(t, { force: true });
|
|
16029
16329
|
};
|
|
16030
16330
|
const code = (err) => err.code ?? "error";
|
|
16031
16331
|
for (const [i, f] of files.entries()) {
|
|
16032
16332
|
try {
|
|
16033
|
-
(0,
|
|
16333
|
+
(0, import_node_fs11.writeFileSync)(temps[i] ?? "", f.text);
|
|
16034
16334
|
} catch (err) {
|
|
16035
16335
|
drop(0);
|
|
16036
16336
|
throw new UsageError(`--out: could not write ${f.name} (${code(err)}); no file was written.`);
|
|
@@ -16039,7 +16339,7 @@ function writeFiles(files) {
|
|
|
16039
16339
|
const written = [];
|
|
16040
16340
|
for (const [i, f] of files.entries()) {
|
|
16041
16341
|
try {
|
|
16042
|
-
(0,
|
|
16342
|
+
(0, import_node_fs11.renameSync)(temps[i] ?? "", f.path);
|
|
16043
16343
|
written.push(f.name);
|
|
16044
16344
|
} catch (err) {
|
|
16045
16345
|
drop(i);
|
|
@@ -16216,12 +16516,12 @@ function junitXml(run) {
|
|
|
16216
16516
|
return `${lines.join("\n")}
|
|
16217
16517
|
`.replace(/^([\s\u0085]*)::/gm, "$1?::").replaceAll("##[", "##[");
|
|
16218
16518
|
}
|
|
16219
|
-
var
|
|
16519
|
+
var import_node_fs11, import_node_path6, firstLine3, COMMAND, shown, count3, detailOf2, ANNOTATION_LIMITS, MARKDOWN_ROWS, andMore, escapeData, escapeProperty, noLegacy, NOT_XML, xmlChars, xmlText, xmlAttr;
|
|
16220
16520
|
var init_report2 = __esm({
|
|
16221
16521
|
"src/mcp-testing/report/index.ts"() {
|
|
16222
16522
|
"use strict";
|
|
16223
16523
|
init_cjs_shims();
|
|
16224
|
-
|
|
16524
|
+
import_node_fs11 = require("fs");
|
|
16225
16525
|
import_node_path6 = require("path");
|
|
16226
16526
|
init_options();
|
|
16227
16527
|
init_snapshot2();
|
|
@@ -16750,12 +17050,12 @@ async function lint(flags2, server2, io, rawOut) {
|
|
|
16750
17050
|
function readExceptions(flag2, io) {
|
|
16751
17051
|
const name = flag2 ?? DEFAULT_IGNORE_FILE;
|
|
16752
17052
|
const path25 = (0, import_node_path7.resolve)(io.cwd, name);
|
|
16753
|
-
if (!(0,
|
|
17053
|
+
if (!(0, import_node_fs12.existsSync)(path25)) {
|
|
16754
17054
|
if (flag2 !== void 0) throw new UsageError(`--ignore-file: ${name} does not exist.`);
|
|
16755
17055
|
return void 0;
|
|
16756
17056
|
}
|
|
16757
17057
|
const today = io.today ?? (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
16758
|
-
return { name, ...parseExceptionsFile((0,
|
|
17058
|
+
return { name, ...parseExceptionsFile((0, import_node_fs12.readFileSync)(path25, "utf8"), name, today) };
|
|
16759
17059
|
}
|
|
16760
17060
|
async function listTools(session2) {
|
|
16761
17061
|
try {
|
|
@@ -16883,12 +17183,12 @@ function sorted(findings) {
|
|
|
16883
17183
|
(a, b) => compareLevels(b.level, a.level) || cmp(a.target.tool, b.target.tool) || cmp(a.rule, b.rule) || cmp(a.target.param ?? "", b.target.param ?? "") || cmp(a.message, b.message)
|
|
16884
17184
|
);
|
|
16885
17185
|
}
|
|
16886
|
-
var
|
|
17186
|
+
var import_node_fs12, import_node_path7, import_client8, import__, DEFAULT_IGNORE_FILE, FAIL_ON, isRecord10, NAMED_SCHEMAS2, DATA, MAX_SCHEMA_NODES, MAX_SCHEMA_DEPTH, SchemaTooBig, note, cmp;
|
|
16887
17187
|
var init_mcp_lint = __esm({
|
|
16888
17188
|
"src/cli/commands/mcp-lint.ts"() {
|
|
16889
17189
|
"use strict";
|
|
16890
17190
|
init_cjs_shims();
|
|
16891
|
-
|
|
17191
|
+
import_node_fs12 = require("fs");
|
|
16892
17192
|
import_node_path7 = require("path");
|
|
16893
17193
|
import_client8 = require("@modelcontextprotocol/client");
|
|
16894
17194
|
init_options();
|
|
@@ -17306,21 +17606,21 @@ function writeAtomically(path25, text6, shown4, flag2 = "--out") {
|
|
|
17306
17606
|
`.${(0, import_node_path8.basename)(path25)}.${process.pid}.${(0, import_node_crypto7.randomBytes)(4).toString("hex")}.tmp`
|
|
17307
17607
|
);
|
|
17308
17608
|
try {
|
|
17309
|
-
(0,
|
|
17310
|
-
(0,
|
|
17609
|
+
(0, import_node_fs13.writeFileSync)(temporary, text6, { flag: "wx" });
|
|
17610
|
+
(0, import_node_fs13.renameSync)(temporary, path25);
|
|
17311
17611
|
} catch (err) {
|
|
17312
|
-
(0,
|
|
17612
|
+
(0, import_node_fs13.rmSync)(temporary, { force: true });
|
|
17313
17613
|
const code = err.code ?? "an error";
|
|
17314
17614
|
throw new UsageError(`${flag2}: could not write ${shown4} (${code}).`);
|
|
17315
17615
|
}
|
|
17316
17616
|
}
|
|
17317
|
-
var import_node_crypto7,
|
|
17617
|
+
var import_node_crypto7, import_node_fs13, import_node_os4, import_node_path8, KEPT_FILE, isRecord11, plural5, counts2, MASK_DEPTH, MIN_ARGUMENT_LENGTH, METHOD_NOT_FOUND2;
|
|
17318
17618
|
var init_mcp_snapshot = __esm({
|
|
17319
17619
|
"src/cli/commands/mcp-snapshot.ts"() {
|
|
17320
17620
|
"use strict";
|
|
17321
17621
|
init_cjs_shims();
|
|
17322
17622
|
import_node_crypto7 = require("crypto");
|
|
17323
|
-
|
|
17623
|
+
import_node_fs13 = require("fs");
|
|
17324
17624
|
import_node_os4 = require("os");
|
|
17325
17625
|
import_node_path8 = require("path");
|
|
17326
17626
|
init_options();
|
|
@@ -17375,7 +17675,7 @@ function diffOperands(operands, rawArgs) {
|
|
|
17375
17675
|
function readSnapshotFile(name, cwd) {
|
|
17376
17676
|
let text6;
|
|
17377
17677
|
try {
|
|
17378
|
-
text6 = (0,
|
|
17678
|
+
text6 = (0, import_node_fs14.readFileSync)((0, import_node_path9.resolve)(cwd, name), "utf8");
|
|
17379
17679
|
} catch (err) {
|
|
17380
17680
|
throw new UsageError(
|
|
17381
17681
|
`${name}: cannot be read (${err.code ?? "an error"}).`
|
|
@@ -17436,12 +17736,12 @@ async function diff(flags2, operands, io, rawOut) {
|
|
|
17436
17736
|
writeReport(diffRun(report), outputs, { out: rawOut, err: io.err, cwd: io.cwd });
|
|
17437
17737
|
return report.exitCode;
|
|
17438
17738
|
}
|
|
17439
|
-
var
|
|
17739
|
+
var import_node_fs14, import_node_path9, FAIL_ON2;
|
|
17440
17740
|
var init_mcp_diff = __esm({
|
|
17441
17741
|
"src/cli/commands/mcp-diff.ts"() {
|
|
17442
17742
|
"use strict";
|
|
17443
17743
|
init_cjs_shims();
|
|
17444
|
-
|
|
17744
|
+
import_node_fs14 = require("fs");
|
|
17445
17745
|
import_node_path9 = require("path");
|
|
17446
17746
|
init_options();
|
|
17447
17747
|
init_exit_codes();
|
|
@@ -18196,13 +18496,13 @@ ${err.stderrTail.map((l) => ` ${l}
|
|
|
18196
18496
|
}
|
|
18197
18497
|
}
|
|
18198
18498
|
function readLock(path25, name, required) {
|
|
18199
|
-
if (!(0,
|
|
18499
|
+
if (!(0, import_node_fs15.existsSync)(path25)) {
|
|
18200
18500
|
if (required) throw new UsageError(`${name} does not exist; pin the server first with plune mcp pin.`);
|
|
18201
18501
|
return emptyLock();
|
|
18202
18502
|
}
|
|
18203
18503
|
let text6;
|
|
18204
18504
|
try {
|
|
18205
|
-
text6 = (0,
|
|
18505
|
+
text6 = (0, import_node_fs15.readFileSync)(path25, "utf8");
|
|
18206
18506
|
} catch (err) {
|
|
18207
18507
|
throw new UsageError(`${name}: cannot be read (${err.code ?? "an error"}).`);
|
|
18208
18508
|
}
|
|
@@ -18442,12 +18742,12 @@ async function stability(flags2, config, io, json2) {
|
|
|
18442
18742
|
`);
|
|
18443
18743
|
return exitCode2;
|
|
18444
18744
|
}
|
|
18445
|
-
var
|
|
18745
|
+
var import_node_fs15, import_node_path10, STABILITY_LIMIT, isRecord14, shown2, asciiJson, KIND, plural6, NOUN, block, primitive, renderFinding;
|
|
18446
18746
|
var init_mcp_pin = __esm({
|
|
18447
18747
|
"src/cli/commands/mcp-pin.ts"() {
|
|
18448
18748
|
"use strict";
|
|
18449
18749
|
init_cjs_shims();
|
|
18450
|
-
|
|
18750
|
+
import_node_fs15 = require("fs");
|
|
18451
18751
|
import_node_path10 = require("path");
|
|
18452
18752
|
init_options();
|
|
18453
18753
|
init_session();
|
|
@@ -28775,8 +29075,8 @@ function parseOauthConfig(source, format = "json") {
|
|
|
28775
29075
|
function loadOauthConfig(path25) {
|
|
28776
29076
|
let source;
|
|
28777
29077
|
try {
|
|
28778
|
-
if ((0,
|
|
28779
|
-
source = (0,
|
|
29078
|
+
if ((0, import_node_fs16.statSync)(path25).size > MAX_CONFIG_BYTES) throw new UsageError(tooLarge());
|
|
29079
|
+
source = (0, import_node_fs16.readFileSync)(path25, "utf8");
|
|
28780
29080
|
} catch (err) {
|
|
28781
29081
|
if (err instanceof UsageError) throw err;
|
|
28782
29082
|
const code = err.code;
|
|
@@ -28786,12 +29086,12 @@ function loadOauthConfig(path25) {
|
|
|
28786
29086
|
}
|
|
28787
29087
|
return parseOauthConfig(source, /\.ya?ml$/i.test(path25) ? "yaml" : "json");
|
|
28788
29088
|
}
|
|
28789
|
-
var
|
|
29089
|
+
var import_node_fs16, import_yaml6, TOP, REGISTRATION2, METHODS, MODES, SECRET_KEY2, ENV_NAME, isObject6, MAX_CONFIG_BYTES, tooLarge;
|
|
28790
29090
|
var init_auth_config = __esm({
|
|
28791
29091
|
"src/mcp-testing/conformance/checks/auth-config.ts"() {
|
|
28792
29092
|
"use strict";
|
|
28793
29093
|
init_cjs_shims();
|
|
28794
|
-
|
|
29094
|
+
import_node_fs16 = require("fs");
|
|
28795
29095
|
import_yaml6 = require("yaml");
|
|
28796
29096
|
init_options();
|
|
28797
29097
|
TOP = /* @__PURE__ */ new Set([
|
|
@@ -28844,7 +29144,7 @@ __export(mcp_conformance_exports, {
|
|
|
28844
29144
|
function loadFixture(path25) {
|
|
28845
29145
|
let doc;
|
|
28846
29146
|
try {
|
|
28847
|
-
doc = JSON.parse((0,
|
|
29147
|
+
doc = JSON.parse((0, import_node_fs17.readFileSync)(path25, "utf8"));
|
|
28848
29148
|
} catch (err) {
|
|
28849
29149
|
const code = err.code;
|
|
28850
29150
|
throw new UsageError(`--fixture: could not read ${path25} as JSON${code === void 0 ? "" : ` (${code})`}.`);
|
|
@@ -28901,24 +29201,24 @@ function selection(flags2) {
|
|
|
28901
29201
|
);
|
|
28902
29202
|
return { suites, entries: entries2 };
|
|
28903
29203
|
}
|
|
28904
|
-
function catalogText(entries2) {
|
|
29204
|
+
function catalogText(entries2, profile) {
|
|
28905
29205
|
const rows = entries2.map((e) => [
|
|
28906
29206
|
e.id,
|
|
28907
29207
|
e.suite,
|
|
28908
29208
|
e.kind === "check" ? `${e.level}${e.derived ? "*" : ""}` : e.kind,
|
|
28909
29209
|
e.eras.join("+"),
|
|
28910
29210
|
e.transports.join("+"),
|
|
28911
|
-
|
|
29211
|
+
profile.checks.includes(e.id) ? "scored" : ""
|
|
28912
29212
|
]);
|
|
28913
29213
|
const head = ["id", "suite", "level", "eras", "transports", "profile"];
|
|
28914
29214
|
const widths = head.map((h, i) => Math.max(h.length, ...rows.map((r) => (r[i] ?? "").length)));
|
|
28915
29215
|
const line = (r) => r.map((c, i) => c.padEnd(widths[i] ?? 0)).join(" ").trimEnd();
|
|
28916
29216
|
return `${[head, ...rows].map(line).join("\n")}
|
|
28917
29217
|
|
|
28918
|
-
${entries2.length} checks. * level derived from neighbouring provisions. Profile ${
|
|
29218
|
+
${entries2.length} checks. * level derived from neighbouring provisions. Profile ${profile.id} ${profile.version}: ${profile.checks.length} scored.
|
|
28919
29219
|
`;
|
|
28920
29220
|
}
|
|
28921
|
-
function explainText(e) {
|
|
29221
|
+
function explainText(e, profile) {
|
|
28922
29222
|
const lines = [
|
|
28923
29223
|
`${e.id}: ${e.title}`,
|
|
28924
29224
|
e.description,
|
|
@@ -28929,7 +29229,7 @@ function explainText(e) {
|
|
|
28929
29229
|
`eras: ${e.eras.join(", ")}`,
|
|
28930
29230
|
`transports: ${e.transports.join(", ")}`,
|
|
28931
29231
|
`needs a fixture: ${e.needsFixture ? "yes" : "no"}`,
|
|
28932
|
-
`in profile ${
|
|
29232
|
+
`in profile ${profile.id} ${profile.version}: ${profile.checks.includes(e.id) ? "yes, scored" : "no"}`,
|
|
28933
29233
|
...e.specRefs.map((r) => `spec: ${specUrl(r)} (${r.section})`)
|
|
28934
29234
|
];
|
|
28935
29235
|
return `${lines.join("\n")}
|
|
@@ -28937,13 +29237,15 @@ function explainText(e) {
|
|
|
28937
29237
|
}
|
|
28938
29238
|
async function conformance(flags2, server2, io, rawOut) {
|
|
28939
29239
|
const format = oneOf4("--format", flags2.format ?? "human", FORMATS);
|
|
29240
|
+
const versions = PROFILES.map((p) => p.version);
|
|
29241
|
+
const profile = profileOf(oneOf4("--profile", flags2.profile ?? PROFILE.version, versions)) ?? PROFILE;
|
|
28940
29242
|
if (flags2.listChecks === true || flags2.explain !== void 0) {
|
|
28941
29243
|
if (flags2.out !== void 0 || flags2.reporter !== void 0)
|
|
28942
29244
|
throw new UsageError("--list-checks and --explain print the catalog: --out is for a run.");
|
|
28943
29245
|
if (flags2.explain !== void 0) {
|
|
28944
29246
|
const entry2 = catalogEntry(flags2.explain);
|
|
28945
29247
|
if (entry2 === void 0) throw new UsageError(`--explain ${flags2.explain}: no such check.`);
|
|
28946
|
-
io.out(format === "json" ? json(entry2) : explainText(entry2));
|
|
29248
|
+
io.out(format === "json" ? json(entry2) : explainText(entry2, profile));
|
|
28947
29249
|
return MCP_EXIT.ok;
|
|
28948
29250
|
}
|
|
28949
29251
|
const entries3 = flags2.suite === void 0 ? CATALOG : selection(flags2).entries;
|
|
@@ -28951,9 +29253,9 @@ async function conformance(flags2, server2, io, rawOut) {
|
|
|
28951
29253
|
format === "json" ? json({
|
|
28952
29254
|
kind: "mcp-conformance-catalog",
|
|
28953
29255
|
schemaVersion: 1,
|
|
28954
|
-
profile: { id:
|
|
29256
|
+
profile: { id: profile.id, version: profile.version, manifestDigest: manifestDigest(profile.checks), checks: profile.checks },
|
|
28955
29257
|
checks: entries3
|
|
28956
|
-
}) : catalogText(entries3)
|
|
29258
|
+
}) : catalogText(entries3, profile)
|
|
28957
29259
|
);
|
|
28958
29260
|
return MCP_EXIT.ok;
|
|
28959
29261
|
}
|
|
@@ -28980,7 +29282,7 @@ async function conformance(flags2, server2, io, rawOut) {
|
|
|
28980
29282
|
const plan = requested === "both" ? ["legacy", "modern"] : requested === "auto" ? "auto" : [eraOf(requested)];
|
|
28981
29283
|
if (config.target.kind === "sse" && plan !== "auto" && plan.includes("modern"))
|
|
28982
29284
|
throw new UsageError("--protocol-version: the HTTP+SSE transport carries the legacy era only (2025-11-25 and earlier).");
|
|
28983
|
-
const base = { requested, suites, entries: entries2, fixture };
|
|
29285
|
+
const base = { requested, suites, entries: entries2, fixture, profile };
|
|
28984
29286
|
const reports = [];
|
|
28985
29287
|
if (suites.includes("oauth")) {
|
|
28986
29288
|
if (suites.length > 1) throw new UsageError("--suite oauth cannot be run together with another suite yet: run it on its own.");
|
|
@@ -29061,7 +29363,7 @@ function discoverRaw(session2, version2) {
|
|
|
29061
29363
|
const body = { jsonrpc: "2.0", id: id2, method: "server/discover", params: { _meta: modernMeta(version2) } };
|
|
29062
29364
|
return session2.raw(JSON.stringify(body), id2);
|
|
29063
29365
|
}
|
|
29064
|
-
async function measure2(config, { requested, suites, entries: entries2, fixture }, plan, io) {
|
|
29366
|
+
async function measure2(config, { requested, suites, entries: entries2, fixture, profile }, plan, io) {
|
|
29065
29367
|
const transport = config.target.kind === "stdio" ? "stdio" : "http";
|
|
29066
29368
|
const results4 = [];
|
|
29067
29369
|
let serverInfo = null;
|
|
@@ -29177,19 +29479,19 @@ async function measure2(config, { requested, suites, entries: entries2, fixture
|
|
|
29177
29479
|
}
|
|
29178
29480
|
}
|
|
29179
29481
|
}
|
|
29180
|
-
const summary = summarize2(results4);
|
|
29482
|
+
const summary = summarize2(results4, CATALOG, profile);
|
|
29181
29483
|
const bucket = new Map(BUCKETS.flatMap((k) => summary[k].map((id2) => [id2, k])));
|
|
29182
29484
|
for (const r of results4) r.bucket = bucket.get(r.id) ?? "pending";
|
|
29183
29485
|
const bySuite = {};
|
|
29184
|
-
for (const s of suites) bySuite[s] = summarize2(results4.filter((r) => r.suite === s));
|
|
29486
|
+
for (const s of suites) bySuite[s] = summarize2(results4.filter((r) => r.suite === s), CATALOG, profile);
|
|
29185
29487
|
return {
|
|
29186
29488
|
kind: "mcp-conformance-report",
|
|
29187
29489
|
schemaVersion: 1,
|
|
29188
29490
|
command: "conformance",
|
|
29189
29491
|
checkerVersion: io.clientVersion ?? "0.0.0",
|
|
29190
|
-
profileId:
|
|
29191
|
-
profileVersion:
|
|
29192
|
-
manifestDigest: manifestDigest(
|
|
29492
|
+
profileId: profile.id,
|
|
29493
|
+
profileVersion: profile.version,
|
|
29494
|
+
manifestDigest: manifestDigest(profile.checks),
|
|
29193
29495
|
protocolVersion,
|
|
29194
29496
|
protocolVersionRequested: requested,
|
|
29195
29497
|
era: plan.era,
|
|
@@ -29226,7 +29528,7 @@ function oauthSetup(flags2, cwd, env) {
|
|
|
29226
29528
|
}
|
|
29227
29529
|
return { config: flags2.config === void 0 ? {} : loadOauthConfig((0, import_node_path11.resolve)(cwd, flags2.config)), allowOrigins, env };
|
|
29228
29530
|
}
|
|
29229
|
-
async function measureOauth(config, { requested, suites, entries: entries2 }, revision, setup, io) {
|
|
29531
|
+
async function measureOauth(config, { requested, suites, entries: entries2, profile }, revision, setup, io) {
|
|
29230
29532
|
const era = eraOf(revision);
|
|
29231
29533
|
const transport = config.target.kind === "stdio" ? "stdio" : "http";
|
|
29232
29534
|
const secrets = /* @__PURE__ */ new Set();
|
|
@@ -29269,19 +29571,19 @@ async function measureOauth(config, { requested, suites, entries: entries2 }, re
|
|
|
29269
29571
|
timeouts = outcome.state === "could-not-run" && outcome.reason === "timeout" ? timeouts + 1 : 0;
|
|
29270
29572
|
results4.push(result(entry2, outcome, clean3));
|
|
29271
29573
|
}
|
|
29272
|
-
const summary = summarize2(results4);
|
|
29574
|
+
const summary = summarize2(results4, CATALOG, profile);
|
|
29273
29575
|
const bucket = new Map(BUCKETS.flatMap((k) => summary[k].map((id2) => [id2, k])));
|
|
29274
29576
|
for (const r of results4) r.bucket = bucket.get(r.id) ?? "pending";
|
|
29275
29577
|
const bySuite = {};
|
|
29276
|
-
for (const s of suites) bySuite[s] = summarize2(results4.filter((r) => r.suite === s));
|
|
29578
|
+
for (const s of suites) bySuite[s] = summarize2(results4.filter((r) => r.suite === s), CATALOG, profile);
|
|
29277
29579
|
return {
|
|
29278
29580
|
kind: "mcp-conformance-report",
|
|
29279
29581
|
schemaVersion: 1,
|
|
29280
29582
|
command: "conformance",
|
|
29281
29583
|
checkerVersion: io.clientVersion ?? "0.0.0",
|
|
29282
|
-
profileId:
|
|
29283
|
-
profileVersion:
|
|
29284
|
-
manifestDigest: manifestDigest(
|
|
29584
|
+
profileId: profile.id,
|
|
29585
|
+
profileVersion: profile.version,
|
|
29586
|
+
manifestDigest: manifestDigest(profile.checks),
|
|
29285
29587
|
protocolVersion: revision,
|
|
29286
29588
|
protocolVersionRequested: requested,
|
|
29287
29589
|
era,
|
|
@@ -29315,12 +29617,12 @@ function result(entry2, outcome, clean3) {
|
|
|
29315
29617
|
...outcome.details === void 0 ? {} : { details: outcome.details }
|
|
29316
29618
|
};
|
|
29317
29619
|
}
|
|
29318
|
-
var
|
|
29620
|
+
var import_node_fs17, import_node_path11, FORMATS, REVISION2, MAX_TEXT2, cut3, HANDSHAKE_CHECK, DISCOVER_CHECK, TIMEOUTS_IN_A_ROW, json, MODERN5, worstExit, MODERN_ERRORS, OAUTH_REVISIONS;
|
|
29319
29621
|
var init_mcp_conformance = __esm({
|
|
29320
29622
|
"src/cli/commands/mcp-conformance.ts"() {
|
|
29321
29623
|
"use strict";
|
|
29322
29624
|
init_cjs_shims();
|
|
29323
|
-
|
|
29625
|
+
import_node_fs17 = require("fs");
|
|
29324
29626
|
import_node_path11 = require("path");
|
|
29325
29627
|
init_options();
|
|
29326
29628
|
init_redact();
|
|
@@ -29464,7 +29766,7 @@ function parseJson(text6, opts) {
|
|
|
29464
29766
|
let end2 = i;
|
|
29465
29767
|
while (end2 < n && !",]} \r\n/".includes(text6[end2])) end2++;
|
|
29466
29768
|
if (end2 === i) stop("unexpected-character");
|
|
29467
|
-
if (!
|
|
29769
|
+
if (!LITERAL2.test(text6.slice(i, end2))) stop("bad-literal");
|
|
29468
29770
|
i = end2;
|
|
29469
29771
|
return { t: "other", at: at2 };
|
|
29470
29772
|
};
|
|
@@ -29494,7 +29796,7 @@ function lineLocator(text6) {
|
|
|
29494
29796
|
return { line: lo + 1, column: at2 - starts[lo] + 1 };
|
|
29495
29797
|
};
|
|
29496
29798
|
}
|
|
29497
|
-
var MAX_DEPTH3, Stop,
|
|
29799
|
+
var MAX_DEPTH3, Stop, LITERAL2, PLAIN, HEX4, ESCAPES;
|
|
29498
29800
|
var init_json_tree = __esm({
|
|
29499
29801
|
"src/mcp-testing/scan/config/json-tree.ts"() {
|
|
29500
29802
|
"use strict";
|
|
@@ -29508,7 +29810,7 @@ var init_json_tree = __esm({
|
|
|
29508
29810
|
category;
|
|
29509
29811
|
at;
|
|
29510
29812
|
};
|
|
29511
|
-
|
|
29813
|
+
LITERAL2 = /^(?:true|false|null|-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)$/;
|
|
29512
29814
|
PLAIN = /[^"\\\u0000-\u001f]*/y;
|
|
29513
29815
|
HEX4 = /^[0-9a-fA-F]{4}$/;
|
|
29514
29816
|
ESCAPES = {
|
|
@@ -30699,8 +31001,8 @@ function journalHeaders(headers) {
|
|
|
30699
31001
|
function openProbeJournal(path25) {
|
|
30700
31002
|
let fd;
|
|
30701
31003
|
try {
|
|
30702
|
-
fd = (0,
|
|
30703
|
-
if (process.platform !== "win32") (0,
|
|
31004
|
+
fd = (0, import_node_fs18.openSync)(path25, "w", 384);
|
|
31005
|
+
if (process.platform !== "win32") (0, import_node_fs18.fchmodSync)(fd, 384);
|
|
30704
31006
|
} catch {
|
|
30705
31007
|
throw new UsageError("--journal: the file cannot be opened for writing.");
|
|
30706
31008
|
}
|
|
@@ -30714,21 +31016,21 @@ function openProbeJournal(path25) {
|
|
|
30714
31016
|
if (closed) throw new Error("journal closed");
|
|
30715
31017
|
if (redact2 === void 0) throw new Error("journal not bound");
|
|
30716
31018
|
const masked = redact2.value({ ts: (/* @__PURE__ */ new Date()).toISOString(), ...line });
|
|
30717
|
-
(0,
|
|
31019
|
+
(0, import_node_fs18.writeSync)(fd, JSON.stringify(masked) + "\n");
|
|
30718
31020
|
},
|
|
30719
31021
|
close() {
|
|
30720
31022
|
if (closed) return;
|
|
30721
31023
|
closed = true;
|
|
30722
|
-
(0,
|
|
31024
|
+
(0, import_node_fs18.closeSync)(fd);
|
|
30723
31025
|
}
|
|
30724
31026
|
};
|
|
30725
31027
|
}
|
|
30726
|
-
var
|
|
31028
|
+
var import_node_fs18;
|
|
30727
31029
|
var init_journal2 = __esm({
|
|
30728
31030
|
"src/mcp-testing/scan/probes/journal.ts"() {
|
|
30729
31031
|
"use strict";
|
|
30730
31032
|
init_cjs_shims();
|
|
30731
|
-
|
|
31033
|
+
import_node_fs18 = require("fs");
|
|
30732
31034
|
init_options();
|
|
30733
31035
|
init_redact();
|
|
30734
31036
|
}
|
|
@@ -32912,12 +33214,12 @@ function shown3(cwd, path25) {
|
|
|
32912
33214
|
}
|
|
32913
33215
|
function readText(cwd, path25, flag2, limit3 = true, max = MAX_FILE_BYTES) {
|
|
32914
33216
|
const full2 = (0, import_node_path12.resolve)(cwd, path25);
|
|
32915
|
-
if (!(0,
|
|
33217
|
+
if (!(0, import_node_fs19.existsSync)(full2)) throw new UsageError(`${flag2}: ${path25} does not exist.`);
|
|
32916
33218
|
const unreadable2 = () => new UnreadableError(`${flag2}: ${safeText(shown3(cwd, path25))} cannot be read.`);
|
|
32917
33219
|
let size = 0;
|
|
32918
33220
|
if (limit3)
|
|
32919
33221
|
try {
|
|
32920
|
-
size = (0,
|
|
33222
|
+
size = (0, import_node_fs19.statSync)(full2).size;
|
|
32921
33223
|
} catch {
|
|
32922
33224
|
throw unreadable2();
|
|
32923
33225
|
}
|
|
@@ -32926,7 +33228,7 @@ function readText(cwd, path25, flag2, limit3 = true, max = MAX_FILE_BYTES) {
|
|
|
32926
33228
|
`${flag2}: ${path25} is too large to read (over ${max >= 1024 * 1024 ? `${max / 1024 / 1024} MiB` : `${max / 1024} KiB`}).`
|
|
32927
33229
|
);
|
|
32928
33230
|
try {
|
|
32929
|
-
return (0,
|
|
33231
|
+
return (0, import_node_fs19.readFileSync)(full2, "utf8");
|
|
32930
33232
|
} catch {
|
|
32931
33233
|
throw unreadable2();
|
|
32932
33234
|
}
|
|
@@ -32956,12 +33258,12 @@ function fileKeys(cwd, path25) {
|
|
|
32956
33258
|
const keys = [];
|
|
32957
33259
|
let real = full2;
|
|
32958
33260
|
try {
|
|
32959
|
-
real =
|
|
32960
|
-
const st = (0,
|
|
33261
|
+
real = import_node_fs19.realpathSync.native(full2);
|
|
33262
|
+
const st = (0, import_node_fs19.statSync)(full2, { bigint: true });
|
|
32961
33263
|
if (st.ino !== 0n) keys.push(`id:${st.dev}:${st.ino}`);
|
|
32962
33264
|
} catch {
|
|
32963
33265
|
try {
|
|
32964
|
-
real = (0, import_node_path12.join)(
|
|
33266
|
+
real = (0, import_node_path12.join)(import_node_fs19.realpathSync.native((0, import_node_path12.dirname)(full2)), (0, import_node_path12.basename)(full2));
|
|
32965
33267
|
} catch {
|
|
32966
33268
|
}
|
|
32967
33269
|
}
|
|
@@ -33108,7 +33410,7 @@ async function scan(flags2, server2, io) {
|
|
|
33108
33410
|
if ((flags2.config ?? []).length === 0 && flags2.client !== void 0) {
|
|
33109
33411
|
configRequested = true;
|
|
33110
33412
|
const path25 = CLIENT_FILES[flags2.client];
|
|
33111
|
-
if ((0,
|
|
33413
|
+
if ((0, import_node_fs19.existsSync)((0, import_node_path12.resolve)(io.cwd, path25)))
|
|
33112
33414
|
configFiles.push({
|
|
33113
33415
|
path: path25,
|
|
33114
33416
|
client: flags2.client,
|
|
@@ -33139,7 +33441,7 @@ async function scan(flags2, server2, io) {
|
|
|
33139
33441
|
}
|
|
33140
33442
|
}
|
|
33141
33443
|
const today = io.today ?? (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
33142
|
-
const ignoreName = flags2.ignoreFile ?? ((0,
|
|
33444
|
+
const ignoreName = flags2.ignoreFile ?? ((0, import_node_fs19.existsSync)((0, import_node_path12.resolve)(io.cwd, DEFAULT_SCAN_IGNORE_FILE)) ? DEFAULT_SCAN_IGNORE_FILE : void 0);
|
|
33143
33445
|
const exceptions = ignoreName === void 0 ? void 0 : {
|
|
33144
33446
|
file: shown3(io.cwd, ignoreName),
|
|
33145
33447
|
...parseScanExceptions(readText(io.cwd, ignoreName, "--ignore-file"), ignoreName, today, {
|
|
@@ -33234,12 +33536,12 @@ function planProbes(flags2, server2, io) {
|
|
|
33234
33536
|
timeoutMs: config?.timeoutMs ?? 3e4
|
|
33235
33537
|
};
|
|
33236
33538
|
}
|
|
33237
|
-
var
|
|
33539
|
+
var import_node_fs19, import_node_path12, DEFAULT_SCAN_IGNORE_FILE, CLIENT_FILES, CLIENTS2, FORMATS2, FILE_FORMATS2, TooLargeError, UnreadableError;
|
|
33238
33540
|
var init_mcp_scan = __esm({
|
|
33239
33541
|
"src/cli/commands/mcp-scan.ts"() {
|
|
33240
33542
|
"use strict";
|
|
33241
33543
|
init_cjs_shims();
|
|
33242
|
-
|
|
33544
|
+
import_node_fs19 = require("fs");
|
|
33243
33545
|
import_node_path12 = require("path");
|
|
33244
33546
|
init_session();
|
|
33245
33547
|
init_options();
|
|
@@ -34072,7 +34374,7 @@ function readMarkdown(cwd, file) {
|
|
|
34072
34374
|
const target4 = (0, import_node_path13.resolve)(cwd, file);
|
|
34073
34375
|
let size;
|
|
34074
34376
|
try {
|
|
34075
|
-
const st = (0,
|
|
34377
|
+
const st = (0, import_node_fs20.statSync)(target4);
|
|
34076
34378
|
if (!st.isFile()) return usage(`${target4} is not a file.`);
|
|
34077
34379
|
size = st.size;
|
|
34078
34380
|
} catch {
|
|
@@ -34083,7 +34385,7 @@ function readMarkdown(cwd, file) {
|
|
|
34083
34385
|
}
|
|
34084
34386
|
let text6;
|
|
34085
34387
|
try {
|
|
34086
|
-
text6 = new TextDecoder("utf-8", { fatal: true }).decode((0,
|
|
34388
|
+
text6 = new TextDecoder("utf-8", { fatal: true }).decode((0, import_node_fs20.readFileSync)(target4));
|
|
34087
34389
|
} catch {
|
|
34088
34390
|
return usage(`${target4} is not valid UTF-8. Save it as UTF-8 and try again.`);
|
|
34089
34391
|
}
|
|
@@ -34207,12 +34509,12 @@ function reportRequirementsImportFailure(err, write) {
|
|
|
34207
34509
|
write(err.message + "\n");
|
|
34208
34510
|
return err.exitCode;
|
|
34209
34511
|
}
|
|
34210
|
-
var
|
|
34512
|
+
var import_node_fs20, import_node_path13, MAX_MARKDOWN_BYTES, RequirementsImportError, usage, COLUMN_FLAGS, SECTION_FLAGS, oneOf5, TABLE_SPEC_KEYS, SPEC_HELP, SUPPORT, SHOWN4, flat2, cut4, plural8;
|
|
34211
34513
|
var init_requirements_import = __esm({
|
|
34212
34514
|
"src/cli/commands/requirements-import.ts"() {
|
|
34213
34515
|
"use strict";
|
|
34214
34516
|
init_cjs_shims();
|
|
34215
|
-
|
|
34517
|
+
import_node_fs20 = require("fs");
|
|
34216
34518
|
import_node_path13 = require("path");
|
|
34217
34519
|
init_client();
|
|
34218
34520
|
init_api_url();
|
|
@@ -34413,7 +34715,7 @@ async function loadSources(deps) {
|
|
|
34413
34715
|
let raw;
|
|
34414
34716
|
if (deps.from !== void 0) {
|
|
34415
34717
|
try {
|
|
34416
|
-
raw = (0,
|
|
34718
|
+
raw = (0, import_node_fs21.readFileSync)(deps.from, "utf8");
|
|
34417
34719
|
} catch {
|
|
34418
34720
|
throw new SyncFileError(`cannot read ${deps.from}`);
|
|
34419
34721
|
}
|
|
@@ -34465,13 +34767,13 @@ function formatVerify(r) {
|
|
|
34465
34767
|
);
|
|
34466
34768
|
return lines.join("\n") + "\n";
|
|
34467
34769
|
}
|
|
34468
|
-
var import_node_child_process4,
|
|
34770
|
+
var import_node_child_process4, import_node_fs21, TOKEN5;
|
|
34469
34771
|
var init_verify = __esm({
|
|
34470
34772
|
"src/cli/commands/verify.ts"() {
|
|
34471
34773
|
"use strict";
|
|
34472
34774
|
init_cjs_shims();
|
|
34473
34775
|
import_node_child_process4 = require("child_process");
|
|
34474
|
-
|
|
34776
|
+
import_node_fs21 = require("fs");
|
|
34475
34777
|
init_plan();
|
|
34476
34778
|
init_sync();
|
|
34477
34779
|
TOKEN5 = /@P([A-Za-z0-9_-]+)/;
|
|
@@ -34886,10 +35188,10 @@ __export(ids_exports, {
|
|
|
34886
35188
|
serializeMap: () => serializeMap
|
|
34887
35189
|
});
|
|
34888
35190
|
function readMap(file) {
|
|
34889
|
-
if (!(0,
|
|
35191
|
+
if (!(0, import_node_fs22.existsSync)(file)) return {};
|
|
34890
35192
|
let parsed4;
|
|
34891
35193
|
try {
|
|
34892
|
-
parsed4 = JSON.parse((0,
|
|
35194
|
+
parsed4 = JSON.parse((0, import_node_fs22.readFileSync)(file, "utf8"));
|
|
34893
35195
|
} catch {
|
|
34894
35196
|
throw new SyncFileError(`${file} is not valid JSON; fix or remove it, nothing was written`);
|
|
34895
35197
|
}
|
|
@@ -34937,8 +35239,8 @@ async function handleIds(deps) {
|
|
|
34937
35239
|
let written = false;
|
|
34938
35240
|
if (deps.write === true && Object.keys(plan.added).length > 0) {
|
|
34939
35241
|
try {
|
|
34940
|
-
(0,
|
|
34941
|
-
(0,
|
|
35242
|
+
(0, import_node_fs22.mkdirSync)((0, import_node_path14.dirname)(file), { recursive: true });
|
|
35243
|
+
(0, import_node_fs22.writeFileSync)(file, serializeMap({ ...current, ...plan.added }));
|
|
34942
35244
|
} catch {
|
|
34943
35245
|
throw new SyncFileError(`cannot write ${file}`);
|
|
34944
35246
|
}
|
|
@@ -34966,12 +35268,12 @@ function formatIds(r, write) {
|
|
|
34966
35268
|
);
|
|
34967
35269
|
return lines.join("\n") + "\n";
|
|
34968
35270
|
}
|
|
34969
|
-
var
|
|
35271
|
+
var import_node_fs22, import_node_path14, DEFAULT_IDS_FILE, compareKeys;
|
|
34970
35272
|
var init_ids = __esm({
|
|
34971
35273
|
"src/cli/commands/ids.ts"() {
|
|
34972
35274
|
"use strict";
|
|
34973
35275
|
init_cjs_shims();
|
|
34974
|
-
|
|
35276
|
+
import_node_fs22 = require("fs");
|
|
34975
35277
|
import_node_path14 = require("path");
|
|
34976
35278
|
init_verify();
|
|
34977
35279
|
init_sync();
|
|
@@ -34990,7 +35292,7 @@ module.exports = __toCommonJS(cli_exports);
|
|
|
34990
35292
|
init_cjs_shims();
|
|
34991
35293
|
init_api_url();
|
|
34992
35294
|
var import_commander = require("commander");
|
|
34993
|
-
var
|
|
35295
|
+
var import_node_fs23 = require("fs");
|
|
34994
35296
|
var import_node_path15 = require("path");
|
|
34995
35297
|
var import_node_url = require("url");
|
|
34996
35298
|
init_duration();
|
|
@@ -35027,7 +35329,7 @@ var rawArgsOf = (program) => program.rawArgs ?? [];
|
|
|
35027
35329
|
|
|
35028
35330
|
// src/cli.ts
|
|
35029
35331
|
var __dirname = (0, import_node_path15.dirname)((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
35030
|
-
var pkg = JSON.parse((0,
|
|
35332
|
+
var pkg = JSON.parse((0, import_node_fs23.readFileSync)((0, import_node_path15.join)(__dirname, "..", "package.json"), "utf-8"));
|
|
35031
35333
|
function toFormat(s) {
|
|
35032
35334
|
return s === "json" || s === "markdown" ? s : "console";
|
|
35033
35335
|
}
|
|
@@ -35036,7 +35338,7 @@ function shouldColor(outputPath) {
|
|
|
35036
35338
|
}
|
|
35037
35339
|
function writeReport2(text6, outputPath) {
|
|
35038
35340
|
if (outputPath !== void 0) {
|
|
35039
|
-
(0,
|
|
35341
|
+
(0, import_node_fs23.writeFileSync)(outputPath, text6);
|
|
35040
35342
|
} else {
|
|
35041
35343
|
process.stdout.write(text6 + "\n");
|
|
35042
35344
|
}
|
|
@@ -35646,7 +35948,7 @@ ${missed.map((m) => ` - ${m}`).join("\n")}
|
|
|
35646
35948
|
mcp.command("conformance").description(
|
|
35647
35949
|
"Check any MCP server against the specification, check by check, with a score: exit 1 on a failed MUST, 3 when conformance is not established"
|
|
35648
35950
|
)
|
|
35649
|
-
).option("--suite <suite>", "protocol (default), oauth, tasks or apps; repeatable", repeat).option("--check <id>", "Run only this check; repeatable", repeat).option("--protocol-version <revision>", "The revision to check against, or auto (the one the server answers with)", "auto").option("--format <format>", "What to print: human or json", "human").option("--reporter <reporter>", "junit-xml: a bare --out <path> is written as JUnit XML instead of JSON").option(
|
|
35951
|
+
).option("--suite <suite>", "protocol (default), oauth, tasks or apps; repeatable", repeat).option("--check <id>", "Run only this check; repeatable", repeat).option("--protocol-version <revision>", "The revision to check against, or auto (the one the server answers with)", "auto").option("--profile <version>", "The score profile: 2026-11.3 (default, with the Streamable HTTP checks) or 2026-11.2 (the score before them)").option("--format <format>", "What to print: human or json", "human").option("--reporter <reporter>", "junit-xml: a bare --out <path> is written as JUnit XML instead of JSON").option(
|
|
35650
35952
|
"--out <[format=]path>",
|
|
35651
35953
|
"Also write the result to this file, as json or junit-xml (default json); repeatable, one run for every file, secrets masked",
|
|
35652
35954
|
repeat
|
|
@@ -35960,7 +36262,7 @@ function isMainModule() {
|
|
|
35960
36262
|
const entry2 = process.argv[1];
|
|
35961
36263
|
if (entry2 === void 0) return false;
|
|
35962
36264
|
try {
|
|
35963
|
-
return (0,
|
|
36265
|
+
return (0, import_node_fs23.realpathSync)(entry2) === (0, import_node_fs23.realpathSync)((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
35964
36266
|
} catch {
|
|
35965
36267
|
return false;
|
|
35966
36268
|
}
|