entroly-mcp 1.0.86 → 1.0.88
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/index.js +7 -9
- package/launcher.test.js +57 -0
- package/package.json +3 -2
package/index.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { spawnSync } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
4
|
|
|
6
5
|
// Pass all arguments straight through to the Python MCP server
|
|
7
6
|
const args = process.argv.slice(2);
|
|
8
7
|
|
|
9
|
-
//
|
|
10
|
-
const
|
|
11
|
-
const checkStatus = spawnSync(checkCmd, ['entroly'], { stdio: 'ignore' });
|
|
8
|
+
// Launch directly so environments without `which` or `where` still work.
|
|
9
|
+
const pyProcess = spawnSync('entroly', args, { stdio: 'inherit' });
|
|
12
10
|
|
|
13
|
-
if (
|
|
11
|
+
if (pyProcess.error && pyProcess.error.code === 'ENOENT') {
|
|
14
12
|
console.error("=====================================================================");
|
|
15
13
|
console.error(" Error: 'entroly' Python package is not installed.");
|
|
16
14
|
console.error("");
|
|
@@ -25,9 +23,9 @@ if (checkStatus.status !== 0) {
|
|
|
25
23
|
process.exit(1);
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
26
|
+
if (pyProcess.error) {
|
|
27
|
+
console.error(`Error starting 'entroly': ${pyProcess.error.message}`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
32
30
|
|
|
33
31
|
process.exit(pyProcess.status !== null ? pyProcess.status : 1);
|
package/launcher.test.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const test = require('node:test');
|
|
2
|
+
const assert = require('node:assert/strict');
|
|
3
|
+
const fs = require('node:fs');
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const vm = require('node:vm');
|
|
6
|
+
|
|
7
|
+
const launcher = fs.readFileSync(path.join(__dirname, 'index.js'), 'utf8');
|
|
8
|
+
|
|
9
|
+
function invoke(result, args = []) {
|
|
10
|
+
const calls = [];
|
|
11
|
+
const errors = [];
|
|
12
|
+
let exitCode;
|
|
13
|
+
const context = {
|
|
14
|
+
require(name) {
|
|
15
|
+
assert.equal(name, 'child_process');
|
|
16
|
+
return {
|
|
17
|
+
spawnSync(...call) {
|
|
18
|
+
calls.push(call);
|
|
19
|
+
return result;
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
process: {
|
|
24
|
+
argv: ['node', 'index.js', ...args],
|
|
25
|
+
exit(code) {
|
|
26
|
+
exitCode = code;
|
|
27
|
+
throw new Error('process exited');
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
console: { error(message) { errors.push(message); } },
|
|
31
|
+
};
|
|
32
|
+
assert.throws(() => vm.runInNewContext(launcher, context), /process exited/);
|
|
33
|
+
return { calls, errors, exitCode };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
test('forwards arguments and the Python exit status in one launch', () => {
|
|
37
|
+
const { calls, exitCode } = invoke({ status: 7 }, ['serve', '--verbose']);
|
|
38
|
+
assert.equal(calls.length, 1);
|
|
39
|
+
assert.equal(calls[0][0], 'entroly');
|
|
40
|
+
assert.deepEqual(Array.from(calls[0][1]), ['serve', '--verbose']);
|
|
41
|
+
assert.equal(calls[0][2].stdio, 'inherit');
|
|
42
|
+
assert.equal(exitCode, 7);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('explains how to install the missing Python command', () => {
|
|
46
|
+
const { calls, errors, exitCode } = invoke({ status: null, error: { code: 'ENOENT' } });
|
|
47
|
+
assert.equal(calls.length, 1);
|
|
48
|
+
assert.equal(exitCode, 1);
|
|
49
|
+
assert.match(errors.join('\n'), /pip install entroly/);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('reports other launch failures instead of blaming installation', () => {
|
|
53
|
+
const { errors, exitCode } = invoke({ status: null, error: { code: 'EACCES', message: 'permission denied' } });
|
|
54
|
+
assert.equal(exitCode, 1);
|
|
55
|
+
assert.match(errors.join('\n'), /permission denied/);
|
|
56
|
+
assert.doesNotMatch(errors.join('\n'), /pip install entroly/);
|
|
57
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "entroly-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.88",
|
|
4
4
|
"mcpName": "io.github.juyterman1000/entroly",
|
|
5
5
|
"description": "MCP bridge for AI agents using Entroly Context Assurance: reduce avoidable AI token usage with evidence selection, receipts, exact recovery, and verification.",
|
|
6
6
|
"main": "index.js",
|
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
"NOTICE",
|
|
13
13
|
"README.md",
|
|
14
14
|
"index.js",
|
|
15
|
+
"launcher.test.js",
|
|
15
16
|
"bin/entroly-mcp.js"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
18
|
-
"test": "
|
|
19
|
+
"test": "node --test launcher.test.js"
|
|
19
20
|
},
|
|
20
21
|
"repository": {
|
|
21
22
|
"type": "git",
|