@neuralaxis/vibedoctor 0.3.0 → 0.3.1
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 +37 -11
- package/dist/cli/commands/setup.js +1 -1
- package/dist/mcp/server.js +50 -28
- package/package.json +16 -9
package/README.md
CHANGED
|
@@ -4,23 +4,25 @@
|
|
|
4
4
|
<img src="website/public/logo-lockup.png" alt="VibeDoctor, a NeuralAxis product" width="360" />
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
**A
|
|
7
|
+
**A health check for AI-written code. Your AI says it's done. Is it?**
|
|
8
8
|
**Give VibeDoctor a repository. It figures out what applies, runs the diagnosis, and tells you or your coding agent what to fix first.**
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Website: **[vibedoctor.in](https://vibedoctor.in/)** · [What it checks](https://vibedoctor.in/checks/) · [DPDP readiness scan](https://vibedoctor.in/dpdp/)
|
|
11
|
+
|
|
12
|
+
VibeDoctor scans vibe-coded JavaScript, TypeScript, Python, and mixed repositories for leaked keys, broken API routes, swallowed errors, vulnerable packages, personal data in logs and LLM prompts, and the usual code-health, testing, and maintainability problems. Works with Cursor, Claude Code, Codex, and GitHub Copilot. It combines engine output into one ranked report, one normalized finding format, and a fix-next plan that humans and coding agents can use without interpreting a wall of unrelated logs.
|
|
11
13
|
|
|
12
14
|
```bash
|
|
13
|
-
npx @neuralaxis/vibedoctor scan
|
|
15
|
+
npx @neuralaxis/vibedoctor scan --full
|
|
14
16
|
```
|
|
15
17
|
|
|
16
18
|
That is the default path: full applicable diagnosis, local by default. Missing or failed scanners are reported as incomplete evidence, never silently counted as a clean result.
|
|
17
19
|
|
|
18
|
-
The public product site lives in [`website/`](website/README.md) and deploys from GitHub Pages.
|
|
20
|
+
The public product site, [vibedoctor.in](https://vibedoctor.in/), lives in [`website/`](website/README.md) and deploys from GitHub Pages.
|
|
19
21
|
|
|
20
22
|
## Start here
|
|
21
23
|
|
|
22
24
|
```bash
|
|
23
|
-
npx @neuralaxis/vibedoctor scan
|
|
25
|
+
npx @neuralaxis/vibedoctor scan --full
|
|
24
26
|
```
|
|
25
27
|
|
|
26
28
|
That is enough for a first diagnosis. VibeDoctor detects the repository, runs the capabilities that apply, correlates overlapping evidence, and ranks what to fix first.
|
|
@@ -28,7 +30,7 @@ That is enough for a first diagnosis. VibeDoctor detects the repository, runs th
|
|
|
28
30
|
For an AI coding agent:
|
|
29
31
|
|
|
30
32
|
```bash
|
|
31
|
-
npx @neuralaxis/vibedoctor scan --report agent-json
|
|
33
|
+
npx @neuralaxis/vibedoctor scan --full --report agent-json
|
|
32
34
|
```
|
|
33
35
|
|
|
34
36
|
Optional narrower runs:
|
|
@@ -37,7 +39,6 @@ Optional narrower runs:
|
|
|
37
39
|
| --- | --- |
|
|
38
40
|
| Fast profile | `npx @neuralaxis/vibedoctor scan --quick` |
|
|
39
41
|
| Git-changed files | `npx @neuralaxis/vibedoctor scan --changed` |
|
|
40
|
-
| Explicit full alias | `npx @neuralaxis/vibedoctor scan --full` |
|
|
41
42
|
| Agent repair plan file | `npx @neuralaxis/vibedoctor agent-plan --format markdown` |
|
|
42
43
|
| India DPDP technical readiness | `npx @neuralaxis/vibedoctor dpdp scan --full` |
|
|
43
44
|
|
|
@@ -245,6 +246,17 @@ vibedoctor mcp
|
|
|
245
246
|
|
|
246
247
|
It exposes structured operations for changed and full scans, report retrieval, finding explanations, safe fixes, repair plans, verification, privacy review, and DPDP technical readiness. Generated agent configs include MCP wiring where the target supports it.
|
|
247
248
|
|
|
249
|
+
The stdio transport uses newline-delimited JSON, as required by MCP. Existing clients using VibeDoctor's earlier `Content-Length` framing are still supported.
|
|
250
|
+
|
|
251
|
+
For container-based MCP introspection (including Glama), build the repository's Dockerfile and run it with stdin attached:
|
|
252
|
+
|
|
253
|
+
```sh
|
|
254
|
+
docker build -t vibedoctor-mcp .
|
|
255
|
+
docker run --rm -i vibedoctor-mcp
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
The container runs as a non-root user in an empty `/workspace`. To scan a project, mount that project at `/workspace` with permissions appropriate to the operations you intend to use. Optional external scanners are not bundled; scan coverage reports any unavailable engines.
|
|
259
|
+
|
|
248
260
|
## Privacy Review
|
|
249
261
|
|
|
250
262
|
Privacy Review is deterministic-first and advisory by default. Evidence stored in reports is masked or classified instead of preserving raw PII.
|
|
@@ -376,8 +388,8 @@ Human-review-only DPDP items do not fail CI. Configure `checks.dpdp.fail_on_seve
|
|
|
376
388
|
| --- | --- |
|
|
377
389
|
| Initialize configuration | `vibedoctor init` |
|
|
378
390
|
| Plan or apply scanner setup | `vibedoctor setup` / `vibedoctor setup --apply` |
|
|
379
|
-
| Full applicable diagnosis | `vibedoctor scan` |
|
|
380
|
-
|
|
|
391
|
+
| Full applicable diagnosis (default) | `vibedoctor scan --full` |
|
|
392
|
+
| Narrower quick or changed-files run | `vibedoctor scan --quick` / `--changed` |
|
|
381
393
|
| Scan selected categories | `vibedoctor scan --category dead_code,leftovers` |
|
|
382
394
|
| Render a fresh full report | `vibedoctor report --json`, `--html`, `--markdown`, `--sarif`, or `--agent` |
|
|
383
395
|
| Apply supported safe fixes | `vibedoctor fix --safe` |
|
|
@@ -414,7 +426,7 @@ Core scanning and report generation run locally and do not require a hosted Vibe
|
|
|
414
426
|
|
|
415
427
|
## Development
|
|
416
428
|
|
|
417
|
-
Requirements: Node.js
|
|
429
|
+
Requirements: Node.js 20.19 or newer and npm 10.x.
|
|
418
430
|
|
|
419
431
|
```bash
|
|
420
432
|
npm test
|
|
@@ -426,7 +438,7 @@ npm pack --dry-run
|
|
|
426
438
|
Useful local commands:
|
|
427
439
|
|
|
428
440
|
```bash
|
|
429
|
-
npm run dev -- scan --
|
|
441
|
+
npm run dev -- scan --full
|
|
430
442
|
npm run dev -- agent init --targets all
|
|
431
443
|
npm run dev -- agent plugin --targets all --force
|
|
432
444
|
```
|
|
@@ -446,3 +458,17 @@ npm run dev -- agent plugin --targets all --force
|
|
|
446
458
|
## License
|
|
447
459
|
|
|
448
460
|
VibeDoctor is licensed under GPL-3.0-or-later.
|
|
461
|
+
|
|
462
|
+
### Homepage arcade
|
|
463
|
+
|
|
464
|
+
The homepage includes a small **DO NOT PRESS** button that opens SHIP IT!, a
|
|
465
|
+
15-second bug-catching game. It needs no login, backend, or extra dependencies.
|
|
466
|
+
Golden bugs earn three points; a personal best is stored locally when available.
|
|
467
|
+
Sound is off by default. Keyboard controls, reduced motion, and pausing while the
|
|
468
|
+
tab is hidden are supported. The result screen offers replay, a friend challenge,
|
|
469
|
+
and the real scan command. The arcade is implemented in
|
|
470
|
+
`website/src/components/ShipItArcade.astro`; the homepage imports it below the hero.
|
|
471
|
+
|
|
472
|
+
Validate website changes with `npm run check`, `npm run test:arcade`, and
|
|
473
|
+
`npm run build` in `website/`. The arcade test exercises game logic with a
|
|
474
|
+
deterministic clock and minimal DOM; it does not replace browser layout checks.
|
|
@@ -276,7 +276,7 @@ function renderPlan({ plan, include, installResults = [], postInstall }) {
|
|
|
276
276
|
lines.push(" - Manually install lizard or semgrep (shown above with one-line hints) for deeper complexity + rule-based checks");
|
|
277
277
|
lines.push(" - Add jscpd (npm) if you want duplication heatmaps for large refactors");
|
|
278
278
|
lines.push("");
|
|
279
|
-
lines.push("Tip: Re-run `vibedoctor scan --
|
|
279
|
+
lines.push("Tip: Re-run `vibedoctor scan --full` (or `scan --quick` for a narrower pass) after changes to see updated health + findings.");
|
|
280
280
|
}
|
|
281
281
|
return `${lines.join("\n")}\n`;
|
|
282
282
|
}
|
package/dist/mcp/server.js
CHANGED
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runMcpServer = runMcpServer;
|
|
4
4
|
const tools_1 = require("./tools");
|
|
5
|
-
|
|
5
|
+
const { version } = require("../../package.json");
|
|
6
|
+
function writeMessage(payload, framing) {
|
|
6
7
|
const body = JSON.stringify(payload);
|
|
7
|
-
process.stdout.write(`Content-Length: ${Buffer.byteLength(body, "utf8")}\r\n\r\n${body}`);
|
|
8
|
+
process.stdout.write(framing === "newline" ? `${body}\n` : `Content-Length: ${Buffer.byteLength(body, "utf8")}\r\n\r\n${body}`);
|
|
8
9
|
}
|
|
9
|
-
function writeResult(id, result) {
|
|
10
|
+
function writeResult(id, result, framing) {
|
|
10
11
|
writeMessage({
|
|
11
12
|
jsonrpc: "2.0",
|
|
12
13
|
id,
|
|
13
14
|
result
|
|
14
|
-
});
|
|
15
|
+
}, framing);
|
|
15
16
|
}
|
|
16
|
-
function writeError(id, code, message) {
|
|
17
|
+
function writeError(id, code, message, framing) {
|
|
17
18
|
writeMessage({
|
|
18
19
|
jsonrpc: "2.0",
|
|
19
20
|
id,
|
|
@@ -21,12 +22,25 @@ function writeError(id, code, message) {
|
|
|
21
22
|
code,
|
|
22
23
|
message
|
|
23
24
|
}
|
|
24
|
-
});
|
|
25
|
+
}, framing);
|
|
25
26
|
}
|
|
26
27
|
function parseMessages(buffer) {
|
|
27
28
|
const messages = [];
|
|
28
29
|
let cursor = buffer;
|
|
29
30
|
while (cursor.length > 0) {
|
|
31
|
+
// Standard MCP stdio uses one JSON message per line. Preserve the original
|
|
32
|
+
// header framing for clients that already use VibeDoctor's legacy transport.
|
|
33
|
+
const prefix = cursor.subarray(0, Math.min(cursor.length, 15)).toString("ascii").toLowerCase();
|
|
34
|
+
if (!"content-length:".startsWith(prefix) && !prefix.startsWith("content-length:")) {
|
|
35
|
+
const lineEnd = cursor.indexOf("\n");
|
|
36
|
+
if (lineEnd === -1)
|
|
37
|
+
break;
|
|
38
|
+
const body = cursor.subarray(0, lineEnd).toString("utf8").trim();
|
|
39
|
+
cursor = cursor.subarray(lineEnd + 1);
|
|
40
|
+
if (body)
|
|
41
|
+
messages.push({ body, framing: "newline" });
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
30
44
|
const headerEnd = cursor.indexOf("\r\n\r\n");
|
|
31
45
|
if (headerEnd === -1) {
|
|
32
46
|
break;
|
|
@@ -42,16 +56,16 @@ function parseMessages(buffer) {
|
|
|
42
56
|
if (cursor.length < bodyEnd) {
|
|
43
57
|
break;
|
|
44
58
|
}
|
|
45
|
-
messages.push(
|
|
59
|
+
messages.push({ body: cursor.subarray(bodyStart, bodyEnd).toString("utf8"), framing: "content-length" });
|
|
46
60
|
cursor = cursor.subarray(bodyEnd);
|
|
47
61
|
}
|
|
48
62
|
return { messages, remaining: cursor };
|
|
49
63
|
}
|
|
50
|
-
async function handleRequest(root, request) {
|
|
64
|
+
async function handleRequest(root, request, framing) {
|
|
51
65
|
const id = request.id ?? null;
|
|
52
66
|
if (!request.method) {
|
|
53
67
|
if (request.id !== undefined) {
|
|
54
|
-
writeError(id, -32600, "Invalid request");
|
|
68
|
+
writeError(id, -32600, "Invalid request", framing);
|
|
55
69
|
}
|
|
56
70
|
return;
|
|
57
71
|
}
|
|
@@ -62,17 +76,17 @@ async function handleRequest(root, request) {
|
|
|
62
76
|
protocolVersion: "2024-11-05",
|
|
63
77
|
serverInfo: {
|
|
64
78
|
name: "vibedoctor",
|
|
65
|
-
version
|
|
79
|
+
version
|
|
66
80
|
},
|
|
67
81
|
capabilities: {
|
|
68
82
|
tools: {}
|
|
69
83
|
}
|
|
70
|
-
});
|
|
84
|
+
}, framing);
|
|
71
85
|
return;
|
|
72
86
|
case "notifications/initialized":
|
|
73
87
|
return;
|
|
74
88
|
case "ping":
|
|
75
|
-
writeResult(id, {});
|
|
89
|
+
writeResult(id, {}, framing);
|
|
76
90
|
return;
|
|
77
91
|
case "tools/list":
|
|
78
92
|
writeResult(id, {
|
|
@@ -81,17 +95,17 @@ async function handleRequest(root, request) {
|
|
|
81
95
|
description: tool.description,
|
|
82
96
|
inputSchema: tool.inputSchema
|
|
83
97
|
}))
|
|
84
|
-
});
|
|
98
|
+
}, framing);
|
|
85
99
|
return;
|
|
86
100
|
case "tools/call": {
|
|
87
101
|
const toolName = request.params?.name;
|
|
88
102
|
if (typeof toolName !== "string") {
|
|
89
|
-
writeError(id, -32602, "Tool name is required");
|
|
103
|
+
writeError(id, -32602, "Tool name is required", framing);
|
|
90
104
|
return;
|
|
91
105
|
}
|
|
92
106
|
const tool = tools_1.mcpTools.find((candidate) => candidate.name === toolName);
|
|
93
107
|
if (!tool) {
|
|
94
|
-
writeError(id, -32601, `Unknown tool: ${toolName}
|
|
108
|
+
writeError(id, -32601, `Unknown tool: ${toolName}`, framing);
|
|
95
109
|
return;
|
|
96
110
|
}
|
|
97
111
|
const args = request.params?.arguments;
|
|
@@ -104,38 +118,46 @@ async function handleRequest(root, request) {
|
|
|
104
118
|
}
|
|
105
119
|
],
|
|
106
120
|
structuredContent: result
|
|
107
|
-
});
|
|
121
|
+
}, framing);
|
|
108
122
|
return;
|
|
109
123
|
}
|
|
110
124
|
default:
|
|
111
|
-
|
|
125
|
+
if (request.id !== undefined)
|
|
126
|
+
writeError(id, -32601, `Unsupported method: ${request.method}`, framing);
|
|
112
127
|
}
|
|
113
128
|
}
|
|
114
129
|
catch (error) {
|
|
115
130
|
const message = error instanceof Error ? error.message : String(error);
|
|
116
|
-
writeError(id, -32000, message);
|
|
131
|
+
writeError(id, -32000, message, framing);
|
|
117
132
|
}
|
|
118
133
|
}
|
|
119
134
|
async function runMcpServer(root) {
|
|
120
135
|
let buffer = Buffer.alloc(0);
|
|
121
|
-
|
|
136
|
+
for await (const chunk of process.stdin) {
|
|
122
137
|
try {
|
|
123
138
|
buffer = Buffer.concat([buffer, chunk]);
|
|
124
139
|
const parsed = parseMessages(buffer);
|
|
125
140
|
buffer = parsed.remaining;
|
|
126
|
-
for (const
|
|
127
|
-
|
|
141
|
+
for (const { body, framing } of parsed.messages) {
|
|
142
|
+
let request;
|
|
143
|
+
try {
|
|
144
|
+
request = JSON.parse(body);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
writeError(null, -32700, "Invalid JSON", framing);
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (typeof request !== "object" || request === null || Array.isArray(request)) {
|
|
151
|
+
writeError(null, -32600, "Invalid request", framing);
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
await handleRequest(root, request, framing);
|
|
128
155
|
}
|
|
129
156
|
}
|
|
130
157
|
catch (error) {
|
|
131
158
|
const message = error instanceof Error ? error.message : String(error);
|
|
132
|
-
writeError(null, -32700, message);
|
|
159
|
+
writeError(null, -32700, message, "newline");
|
|
133
160
|
buffer = Buffer.alloc(0);
|
|
134
161
|
}
|
|
135
|
-
}
|
|
136
|
-
process.stdin.resume();
|
|
137
|
-
await new Promise((resolve) => {
|
|
138
|
-
process.stdin.on("end", () => resolve());
|
|
139
|
-
process.stdin.on("close", () => resolve());
|
|
140
|
-
});
|
|
162
|
+
}
|
|
141
163
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neuralaxis/vibedoctor",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Health diagnosis and fix planning for JS, TS, Python, and mixed repositories.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"publishConfig": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"package.json"
|
|
26
26
|
],
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">=20"
|
|
29
29
|
},
|
|
30
30
|
"packageManager": "npm@10.8.2",
|
|
31
31
|
"keywords": [
|
|
@@ -33,7 +33,14 @@
|
|
|
33
33
|
"cli",
|
|
34
34
|
"static-analysis",
|
|
35
35
|
"technical-debt",
|
|
36
|
-
"agent-tools"
|
|
36
|
+
"agent-tools",
|
|
37
|
+
"vibe-coding",
|
|
38
|
+
"ai-generated-code",
|
|
39
|
+
"security",
|
|
40
|
+
"secrets",
|
|
41
|
+
"privacy",
|
|
42
|
+
"dpdp",
|
|
43
|
+
"mcp"
|
|
37
44
|
],
|
|
38
45
|
"scripts": {
|
|
39
46
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
@@ -52,25 +59,25 @@
|
|
|
52
59
|
"type": "git",
|
|
53
60
|
"url": "git+https://github.com/neural-axis/VibeDoctor.git"
|
|
54
61
|
},
|
|
55
|
-
"homepage": "https://
|
|
62
|
+
"homepage": "https://vibedoctor.in",
|
|
56
63
|
"bugs": {
|
|
57
64
|
"url": "https://github.com/neural-axis/VibeDoctor/issues"
|
|
58
65
|
},
|
|
59
66
|
"dependencies": {
|
|
60
67
|
"commander": "^14.0.0",
|
|
61
|
-
"minimatch": "^
|
|
68
|
+
"minimatch": "^11.0.9",
|
|
62
69
|
"yaml": "^2.8.1"
|
|
63
70
|
},
|
|
64
71
|
"devDependencies": {
|
|
65
72
|
"@biomejs/biome": "^2.5.0",
|
|
66
73
|
"@types/node": "^24.0.1",
|
|
67
|
-
"@vitest/coverage-v8": "^
|
|
74
|
+
"@vitest/coverage-v8": "^4.1.12",
|
|
68
75
|
"jscpd": "^5.0.9",
|
|
69
|
-
"knip": "^6.
|
|
76
|
+
"knip": "^6.48.0",
|
|
70
77
|
"tsx": "^4.20.3",
|
|
71
78
|
"typescript": "^5.8.3",
|
|
72
|
-
"vite": "^7.3.
|
|
73
|
-
"vitest": "^
|
|
79
|
+
"vite": "^7.3.8",
|
|
80
|
+
"vitest": "^4.1.12"
|
|
74
81
|
},
|
|
75
82
|
"overrides": {
|
|
76
83
|
"esbuild": "0.28.1"
|