@martinloop/mcp 0.8.9 → 0.9.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/README.md +2 -0
- package/dist/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/server-validation.js +2 -3
- package/dist/server.d.ts +1 -0
- package/dist/server.js +181 -24
- package/dist/tools/get-status.d.ts +3 -0
- package/dist/tools/get-status.js +11 -2
- package/dist/tools/logs.d.ts +2 -0
- package/dist/tools/logs.js +25 -3
- package/dist/tools/run-controls.d.ts +51 -6
- package/dist/tools/run-controls.js +905 -35
- package/dist/tools/run-loop.js +7 -0
- package/dist/vendor/adapters/process-supervisor.d.ts +12 -0
- package/dist/vendor/adapters/process-supervisor.js +40 -2
- package/dist/vendor/adapters/verifier-only.js +4 -0
- package/dist/vendor/contracts/index.d.ts +8 -0
- package/dist/vendor/contracts/index.js +1 -0
- package/dist/vendor/contracts/swarm-timing.d.ts +7 -0
- package/dist/vendor/contracts/swarm-timing.js +22 -0
- package/dist/vendor/core/index.d.ts +37 -2
- package/dist/vendor/core/index.js +120 -14
- package/dist/vendor/core/persistence/index.d.ts +1 -1
- package/dist/vendor/core/persistence/index.js +1 -1
- package/dist/vendor/core/persistence/integrity.d.ts +1 -0
- package/dist/vendor/core/persistence/integrity.js +1 -1
- package/dist/vendor/core/policy.js +11 -1
- package/dist/vendor/core/resume.d.ts +25 -1
- package/dist/vendor/core/resume.js +187 -13
- package/dist/vendor/core/rollback.d.ts +14 -0
- package/dist/vendor/core/rollback.js +91 -34
- package/dist/vendor/core/swarm/live-runtime.js +2 -0
- package/dist/vendor/core/verified-handoff.js +62 -2
- package/package.json +3 -7
- package/server.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: MartinLoop contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
|
+
import { posix, win32 } from "node:path";
|
|
4
5
|
// ---------------------------------------------------------------------------
|
|
5
6
|
// Mapping: granular TestIntegrityStatus → public TestIntegrityVerdict
|
|
6
7
|
//
|
|
@@ -88,6 +89,65 @@ export function deriveVerifiedHandoffLifecycleTruth(loop) {
|
|
|
88
89
|
evidenceAvailable: true,
|
|
89
90
|
};
|
|
90
91
|
}
|
|
92
|
+
function sameOptionalVerifierFilesystemPath(actual, expected) {
|
|
93
|
+
if (actual === undefined || expected === undefined) {
|
|
94
|
+
return actual === expected;
|
|
95
|
+
}
|
|
96
|
+
return sameVerifierFilesystemPath(actual, expected);
|
|
97
|
+
}
|
|
98
|
+
function classifyVerifierFilesystemPath(value) {
|
|
99
|
+
// Persisted Windows bindings are expected to be drive-absolute or UNC.
|
|
100
|
+
// Do not use win32.isAbsolute() here because it also classifies POSIX-style
|
|
101
|
+
// root paths such as "/repo" as Windows root-relative paths.
|
|
102
|
+
if (/^[A-Za-z]:[\\/]/u.test(value) || /^\\\\/u.test(value) || /^\/\//u.test(value)) {
|
|
103
|
+
return "windows";
|
|
104
|
+
}
|
|
105
|
+
if (value.startsWith("/")) {
|
|
106
|
+
return "posix";
|
|
107
|
+
}
|
|
108
|
+
return "relative";
|
|
109
|
+
}
|
|
110
|
+
function stripTrailingVerifierSeparators(value, kind) {
|
|
111
|
+
if (kind === "windows") {
|
|
112
|
+
// Preserve drive roots (C:\\) and UNC share roots while removing harmless
|
|
113
|
+
// trailing separators from ordinary persisted paths.
|
|
114
|
+
if (/^[a-z]:\\$/iu.test(value) || /^\\\\[^\\]+\\[^\\]+\\?$/u.test(value)) {
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
return value.replace(/[\\/]+$/u, "");
|
|
118
|
+
}
|
|
119
|
+
if (kind === "posix") {
|
|
120
|
+
return value === "/" ? value : value.replace(/\/+$/u, "");
|
|
121
|
+
}
|
|
122
|
+
return value;
|
|
123
|
+
}
|
|
124
|
+
function normalizeVerifierFilesystemPath(value) {
|
|
125
|
+
const kind = classifyVerifierFilesystemPath(value);
|
|
126
|
+
if (kind === "windows") {
|
|
127
|
+
return {
|
|
128
|
+
kind,
|
|
129
|
+
value: stripTrailingVerifierSeparators(win32.normalize(value), kind).toLowerCase(),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if (kind === "posix") {
|
|
133
|
+
return {
|
|
134
|
+
kind,
|
|
135
|
+
value: stripTrailingVerifierSeparators(posix.normalize(value), kind),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
// Relative verifier bindings are legacy/non-canonical. Normalize only their
|
|
139
|
+
// separators/dot segments and keep comparison case-sensitive/fail-closed.
|
|
140
|
+
return {
|
|
141
|
+
kind,
|
|
142
|
+
value: stripTrailingVerifierSeparators(posix.normalize(value.replace(/\\/gu, "/")), kind),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function sameVerifierFilesystemPath(actual, expected) {
|
|
146
|
+
const normalizedActual = normalizeVerifierFilesystemPath(actual);
|
|
147
|
+
const normalizedExpected = normalizeVerifierFilesystemPath(expected);
|
|
148
|
+
return (normalizedActual.kind === normalizedExpected.kind &&
|
|
149
|
+
normalizedActual.value === normalizedExpected.value);
|
|
150
|
+
}
|
|
91
151
|
export function verifierActuallyPassed(evidence, expected) {
|
|
92
152
|
if (!evidence?.passed || !evidence.binding || !evidence.steps) {
|
|
93
153
|
return false;
|
|
@@ -98,8 +158,8 @@ export function verifierActuallyPassed(evidence, expected) {
|
|
|
98
158
|
if (evidence.binding.runId !== expected.runId ||
|
|
99
159
|
evidence.binding.workspaceId !== expected.workspaceId ||
|
|
100
160
|
(evidence.binding.attemptId ?? undefined) !== (expected.attemptId ?? undefined) ||
|
|
101
|
-
evidence.binding.cwd
|
|
102
|
-
(evidence.binding.runsRoot
|
|
161
|
+
!sameVerifierFilesystemPath(evidence.binding.cwd, expected.cwd) ||
|
|
162
|
+
!sameOptionalVerifierFilesystemPath(evidence.binding.runsRoot, expected.runsRoot) ||
|
|
103
163
|
(evidence.binding.executionProfile ?? undefined) !== (expected.executionProfile ?? undefined) ||
|
|
104
164
|
JSON.stringify(evidence.binding.allowedNetworkDomains ?? []) !== JSON.stringify(expected.allowedNetworkDomains ?? []) ||
|
|
105
165
|
JSON.stringify(evidence.binding.commands) !== JSON.stringify(expected.commands)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@martinloop/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"mcpName": "io.github.Keesan12/martin-loop",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -74,13 +74,9 @@
|
|
|
74
74
|
"mcpb:smoke": "node ./mcpb/smoke-mcpb.mjs"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
77
|
+
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
78
78
|
"@open-policy-agent/opa-wasm": "^1.10.0",
|
|
79
|
-
"
|
|
80
|
-
"@opentelemetry/exporter-logs-otlp-http": "^0.214.0",
|
|
81
|
-
"@opentelemetry/resources": "^2.6.1",
|
|
82
|
-
"@opentelemetry/sdk-logs": "^0.214.0",
|
|
83
|
-
"ts-morph": "^21.0.0"
|
|
79
|
+
"zod": "^4.6.7"
|
|
84
80
|
},
|
|
85
81
|
"devDependencies": {
|
|
86
82
|
"@anthropic-ai/mcpb": "2.1.2",
|
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.
|
|
10
|
+
"version": "0.9.0",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "@martinloop/mcp",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.9.0",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|