@martinloop/mcp 0.8.7 → 0.8.9
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/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/server-validation.js +18 -0
- package/dist/server.js +10 -1
- package/dist/tools/preflight.js +1 -1
- package/dist/tools/run-loop.d.ts +2 -0
- package/dist/tools/run-loop.js +176 -72
- package/dist/vendor/adapters/claude-cli.d.ts +4 -0
- package/dist/vendor/adapters/claude-cli.js +55 -8
- package/dist/vendor/contracts/index.d.ts +60 -2
- package/dist/vendor/contracts/index.js +34 -0
- package/dist/vendor/core/index.d.ts +50 -1
- package/dist/vendor/core/index.js +1722 -1245
- package/dist/vendor/core/policy.d.ts +18 -1
- package/dist/vendor/core/policy.js +113 -10
- package/dist/vendor/core/resume.d.ts +39 -0
- package/dist/vendor/core/resume.js +196 -0
- package/dist/vendor/core/rollback.js +43 -13
- package/dist/vendor/core/test-integrity.js +36 -13
- package/dist/vendor/core/test-surface.js +4 -1
- package/dist/vendor/core/verifier-input.d.ts +3 -1
- package/dist/vendor/core/verifier-input.js +50 -2
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -28,8 +28,11 @@ const CASE_PATTERNS = [
|
|
|
28
28
|
];
|
|
29
29
|
const SKIP_PATTERNS = [
|
|
30
30
|
/\b(?:test|it|describe|context|suite)\s*\.\s*(?:skip|todo)\b/gu,
|
|
31
|
+
/\b(?:test|it)\s*\.\s*failing\b/gu,
|
|
32
|
+
/\b(?:test|it|describe|context|suite|specify)\s*\.\s*only\b/gu,
|
|
33
|
+
/\bf(?:it|describe)\s*\(/gu,
|
|
31
34
|
/\bx(?:it|describe|test|context)\s*\(/gu,
|
|
32
|
-
/@pytest\.mark\.skip\w
|
|
35
|
+
/@pytest\.mark\.(?:skip\w*|xfail)|\bpytest\.(?:skip|xfail)\s*\(|@unittest\.(?:skip\w*|expectedFailure)|\bself\.skipTest\s*\(/gu,
|
|
33
36
|
/\bt\.Skip\w*\s*\(/gu,
|
|
34
37
|
/#\[ignore\b/gu,
|
|
35
38
|
/@Disabled\b|@Ignore\b/gu
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
/** Returns a reason when a verifier would be parsed differently from what the operator intended. */
|
|
2
|
-
export declare function describeMalformedVerifier(command: string
|
|
2
|
+
export declare function describeMalformedVerifier(command: string, options?: {
|
|
3
|
+
detectShellFold?: boolean;
|
|
4
|
+
}): string | undefined;
|
|
@@ -7,6 +7,10 @@ const MARTIN_OWNED_OPTIONS = new Set([
|
|
|
7
7
|
]);
|
|
8
8
|
const MARTIN_ENGINES = new Set(["auto", "claude", "codex", "gemini", "openai"]);
|
|
9
9
|
const MARTIN_EXECUTABLES = new Set(["martin", "martin-loop", "martin.cmd", "martin-loop.cmd"]);
|
|
10
|
+
const LAUNCHER_BOOLEAN_OPTIONS = new Set([
|
|
11
|
+
"-s", "--silent", "-y", "--yes", "--no-install", "--offline", "--prefer-offline", "--no-color"
|
|
12
|
+
]);
|
|
13
|
+
const LAUNCHER_VALUE_OPTIONS = new Set(["--cwd", "--dir", "--filter", "--package", "-p", "--workspace", "-w"]);
|
|
10
14
|
function foldedMartinOptions(tokens) {
|
|
11
15
|
const folded = [];
|
|
12
16
|
tokens.forEach((token, index) => {
|
|
@@ -24,12 +28,15 @@ function foldedMartinOptions(tokens) {
|
|
|
24
28
|
return folded;
|
|
25
29
|
}
|
|
26
30
|
/** Returns a reason when a verifier would be parsed differently from what the operator intended. */
|
|
27
|
-
export function describeMalformedVerifier(command) {
|
|
31
|
+
export function describeMalformedVerifier(command, options = {}) {
|
|
28
32
|
const quote = findUnterminatedQuote(command);
|
|
29
33
|
if (quote !== undefined)
|
|
30
34
|
return `--verify value has an unterminated quote (${quote}): ${command}`;
|
|
35
|
+
if (options.detectShellFold === false)
|
|
36
|
+
return undefined;
|
|
31
37
|
const tokens = command.trim().split(/\s+/u);
|
|
32
|
-
const
|
|
38
|
+
const executableIndex = resolveLaunchedExecutableIndex(tokens);
|
|
39
|
+
const executable = normalizeExecutableToken(tokens[executableIndex] ?? "");
|
|
33
40
|
if (MARTIN_EXECUTABLES.has(executable))
|
|
34
41
|
return undefined;
|
|
35
42
|
const swallowed = foldedMartinOptions(tokens);
|
|
@@ -39,6 +46,47 @@ export function describeMalformedVerifier(command) {
|
|
|
39
46
|
}
|
|
40
47
|
return undefined;
|
|
41
48
|
}
|
|
49
|
+
function resolveLaunchedExecutableIndex(tokens) {
|
|
50
|
+
const launcher = normalizeExecutableToken(tokens[0] ?? "");
|
|
51
|
+
if (launcher === "node")
|
|
52
|
+
return 1;
|
|
53
|
+
if (launcher === "npx" || launcher === "pnpx") {
|
|
54
|
+
return skipLauncherOptions(tokens, 1);
|
|
55
|
+
}
|
|
56
|
+
if (launcher === "pnpm" || launcher === "npm" || launcher === "yarn") {
|
|
57
|
+
const actionIndex = skipLauncherOptions(tokens, 1);
|
|
58
|
+
const action = normalizeExecutableToken(tokens[actionIndex] ?? "");
|
|
59
|
+
if (action !== "exec" && action !== "dlx")
|
|
60
|
+
return 0;
|
|
61
|
+
return skipLauncherOptions(tokens, actionIndex + 1);
|
|
62
|
+
}
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
function skipLauncherOptions(tokens, start) {
|
|
66
|
+
let index = start;
|
|
67
|
+
while (index < tokens.length) {
|
|
68
|
+
const token = tokens[index] ?? "";
|
|
69
|
+
if (token === "--" || LAUNCHER_BOOLEAN_OPTIONS.has(token) || token.startsWith("--color=")) {
|
|
70
|
+
index += 1;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (LAUNCHER_VALUE_OPTIONS.has(token)) {
|
|
74
|
+
index += 2;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if ([...LAUNCHER_VALUE_OPTIONS].some((option) => token.startsWith(`${option}=`))) {
|
|
78
|
+
index += 1;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
return index;
|
|
84
|
+
}
|
|
85
|
+
function normalizeExecutableToken(token) {
|
|
86
|
+
const unquoted = token.replace(/^["']|["']$/gu, "");
|
|
87
|
+
const basename = unquoted.split(/[\\/]/u).at(-1)?.toLowerCase() ?? "";
|
|
88
|
+
return basename.endsWith(".js") ? basename.slice(0, -3) : basename;
|
|
89
|
+
}
|
|
42
90
|
function findUnterminatedQuote(command) {
|
|
43
91
|
let quote;
|
|
44
92
|
for (let index = 0; index < command.length; index += 1) {
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"url": "https://github.com/Keesan12/martin-loop",
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.8.
|
|
10
|
+
"version": "0.8.9",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "@martinloop/mcp",
|
|
15
|
-
"version": "0.8.
|
|
15
|
+
"version": "0.8.9",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|