@vibecheckai/cli 3.9.1 โ 4.0.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 +1 -1
- package/bin/runners/context/generators/cursor-enhanced.js +99 -13
- package/mcp-server/.eslintrc.json +24 -0
- package/mcp-server/README.md +425 -135
- package/mcp-server/SPEC.md +583 -0
- package/mcp-server/configs/README.md +172 -0
- package/mcp-server/configs/claude-desktop-pro.json +31 -0
- package/mcp-server/configs/claude-desktop-with-workspace.json +25 -0
- package/mcp-server/configs/claude-desktop.json +19 -0
- package/mcp-server/configs/cursor-mcp.json +21 -0
- package/mcp-server/configs/windsurf-mcp.json +17 -0
- package/mcp-server/mcp-config.example.json +9 -0
- package/mcp-server/package.json +49 -34
- package/mcp-server/src/cli.ts +185 -0
- package/mcp-server/src/index.ts +85 -0
- package/mcp-server/src/server.ts +1933 -0
- package/mcp-server/src/services/cache-service.ts +466 -0
- package/mcp-server/src/services/cli-service.ts +345 -0
- package/mcp-server/src/services/context-manager.ts +717 -0
- package/mcp-server/src/services/firewall-service.ts +662 -0
- package/mcp-server/src/services/git-service.ts +671 -0
- package/mcp-server/src/services/index.ts +52 -0
- package/mcp-server/src/services/prompt-builder-service.ts +1031 -0
- package/mcp-server/src/services/session-service.ts +550 -0
- package/mcp-server/src/services/tier-service.ts +470 -0
- package/mcp-server/src/types.ts +351 -0
- package/mcp-server/tsconfig.json +16 -27
- package/package.json +6 -6
- package/mcp-server/.guardrail/audit/audit.log.jsonl +0 -2
- package/mcp-server/.specs/architecture.mdc +0 -90
- package/mcp-server/.specs/security.mdc +0 -30
- package/mcp-server/HARDENING_SUMMARY.md +0 -299
- package/mcp-server/agent-checkpoint.js +0 -364
- package/mcp-server/agent-firewall-interceptor.js +0 -500
- package/mcp-server/architect-tools.js +0 -707
- package/mcp-server/audit-mcp.js +0 -206
- package/mcp-server/authority-tools.js +0 -569
- package/mcp-server/codebase-architect-tools.js +0 -838
- package/mcp-server/conductor/conflict-resolver.js +0 -588
- package/mcp-server/conductor/execution-planner.js +0 -544
- package/mcp-server/conductor/index.js +0 -377
- package/mcp-server/conductor/lock-manager.js +0 -615
- package/mcp-server/conductor/request-queue.js +0 -550
- package/mcp-server/conductor/session-manager.js +0 -500
- package/mcp-server/conductor/tools.js +0 -510
- package/mcp-server/consolidated-tools.js +0 -1170
- package/mcp-server/deprecation-middleware.js +0 -282
- package/mcp-server/handlers/index.ts +0 -15
- package/mcp-server/handlers/tool-handler.ts +0 -593
- package/mcp-server/hygiene-tools.js +0 -428
- package/mcp-server/index-v1.js +0 -698
- package/mcp-server/index.js +0 -2940
- package/mcp-server/intelligence-tools.js +0 -664
- package/mcp-server/intent-drift-tools.js +0 -873
- package/mcp-server/intent-firewall-interceptor.js +0 -529
- package/mcp-server/lib/api-client.cjs +0 -13
- package/mcp-server/lib/cache-wrapper.cjs +0 -383
- package/mcp-server/lib/error-envelope.js +0 -138
- package/mcp-server/lib/executor.ts +0 -499
- package/mcp-server/lib/index.ts +0 -29
- package/mcp-server/lib/logger.cjs +0 -30
- package/mcp-server/lib/rate-limiter.js +0 -166
- package/mcp-server/lib/sandbox.test.ts +0 -519
- package/mcp-server/lib/sandbox.ts +0 -395
- package/mcp-server/lib/types.ts +0 -267
- package/mcp-server/logger.js +0 -173
- package/mcp-server/manifest.json +0 -473
- package/mcp-server/mdc-generator.js +0 -298
- package/mcp-server/premium-tools.js +0 -1275
- package/mcp-server/proof-tools.js +0 -571
- package/mcp-server/registry/tool-registry.js +0 -586
- package/mcp-server/registry/tools.json +0 -619
- package/mcp-server/registry.test.ts +0 -340
- package/mcp-server/test-mcp.js +0 -108
- package/mcp-server/test-tools.js +0 -36
- package/mcp-server/tests/tier-gating.test.js +0 -297
- package/mcp-server/tier-auth.js +0 -767
- package/mcp-server/tools/index.js +0 -72
- package/mcp-server/tools-reorganized.ts +0 -244
- package/mcp-server/tools-v3.js +0 -1004
- package/mcp-server/truth-context.js +0 -622
- package/mcp-server/truth-firewall-tools.js +0 -2183
- package/mcp-server/vibecheck-2.0-tools.js +0 -761
- package/mcp-server/vibecheck-mcp-server-3.2.0.tgz +0 -0
- package/mcp-server/vibecheck-tools.js +0 -1075
|
@@ -1,340 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Registry Tests
|
|
3
|
-
*
|
|
4
|
-
* Ensures every tool in the registry has:
|
|
5
|
-
* - Valid input/output schemas
|
|
6
|
-
* - CLI mapping with command
|
|
7
|
-
* - Proper tier assignment
|
|
8
|
-
* - Required metadata
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { describe, it, expect, beforeAll } from "vitest";
|
|
12
|
-
import * as fs from "node:fs";
|
|
13
|
-
import * as path from "node:path";
|
|
14
|
-
import { fileURLToPath } from "node:url";
|
|
15
|
-
import Ajv from "ajv";
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
getAllTools,
|
|
19
|
-
getToolByName,
|
|
20
|
-
listToolNames,
|
|
21
|
-
getToolsByTier,
|
|
22
|
-
getToolsByCategory,
|
|
23
|
-
validateRegistry,
|
|
24
|
-
} from "./handlers/tool-handler.js";
|
|
25
|
-
import type { ToolDefinition } from "./lib/types.js";
|
|
26
|
-
|
|
27
|
-
// ESM __dirname equivalent
|
|
28
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
29
|
-
const __dirname = path.dirname(__filename);
|
|
30
|
-
|
|
31
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
32
|
-
// TEST SETUP
|
|
33
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
34
|
-
|
|
35
|
-
const AjvClass = Ajv.default || Ajv;
|
|
36
|
-
const ajv = new AjvClass({ allErrors: true, strict: false });
|
|
37
|
-
|
|
38
|
-
// Load registry directly for raw tests
|
|
39
|
-
const registryPath = path.join(__dirname, "registry/tools.json");
|
|
40
|
-
let rawRegistry: { tools: Record<string, ToolDefinition> };
|
|
41
|
-
|
|
42
|
-
beforeAll(() => {
|
|
43
|
-
const content = fs.readFileSync(registryPath, "utf-8");
|
|
44
|
-
rawRegistry = JSON.parse(content);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
48
|
-
// REGISTRY STRUCTURE TESTS
|
|
49
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
50
|
-
|
|
51
|
-
describe("Registry Structure", () => {
|
|
52
|
-
it("should load registry file", () => {
|
|
53
|
-
expect(rawRegistry).toBeDefined();
|
|
54
|
-
expect(rawRegistry.tools).toBeDefined();
|
|
55
|
-
expect(Object.keys(rawRegistry.tools).length).toBeGreaterThan(0);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it("should have valid JSON schema structure", () => {
|
|
59
|
-
// Registry itself should be valid JSON
|
|
60
|
-
expect(() => JSON.stringify(rawRegistry)).not.toThrow();
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it("should pass validateRegistry check", () => {
|
|
64
|
-
const result = validateRegistry();
|
|
65
|
-
expect(result.errors).toEqual([]);
|
|
66
|
-
expect(result.valid).toBe(true);
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
71
|
-
// TOOL DEFINITION TESTS
|
|
72
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
73
|
-
|
|
74
|
-
describe("Tool Definitions", () => {
|
|
75
|
-
const tools = getAllTools();
|
|
76
|
-
|
|
77
|
-
it("should have at least one tool", () => {
|
|
78
|
-
expect(tools.length).toBeGreaterThan(0);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
describe.each(tools.map((t) => [t.name, t] as const))("%s", (name: string, tool: ToolDefinition) => {
|
|
82
|
-
// Required Fields
|
|
83
|
-
it("should have name matching key", () => {
|
|
84
|
-
expect(tool.name).toBe(name);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it("should have description", () => {
|
|
88
|
-
expect(tool.description).toBeDefined();
|
|
89
|
-
expect(tool.description.length).toBeGreaterThan(10);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it("should have valid tier", () => {
|
|
93
|
-
expect(["free", "pro"]).toContain(tool.tier);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it("should have valid category", () => {
|
|
97
|
-
const validCategories = ["scan", "proof", "authority", "report", "setup", "account", "conductor", "firewall"];
|
|
98
|
-
expect(validCategories).toContain(tool.category);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// Schema Tests
|
|
102
|
-
describe("Input Schema", () => {
|
|
103
|
-
it("should have inputSchema", () => {
|
|
104
|
-
expect(tool.inputSchema).toBeDefined();
|
|
105
|
-
expect(tool.inputSchema.type).toBe("object");
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it("should have valid inputSchema (compiles)", () => {
|
|
109
|
-
expect(() => ajv.compile(tool.inputSchema)).not.toThrow();
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it("should have properties defined", () => {
|
|
113
|
-
expect(tool.inputSchema.properties).toBeDefined();
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it("should have additionalProperties set to false", () => {
|
|
117
|
-
expect(tool.inputSchema.additionalProperties).toBe(false);
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
describe("Output Schema", () => {
|
|
122
|
-
it("should have outputSchema", () => {
|
|
123
|
-
expect(tool.outputSchema).toBeDefined();
|
|
124
|
-
expect(tool.outputSchema.type).toBe("object");
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it("should have valid outputSchema (compiles)", () => {
|
|
128
|
-
expect(() => ajv.compile(tool.outputSchema)).not.toThrow();
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
// CLI Mapping Tests
|
|
133
|
-
describe("CLI Mapping", () => {
|
|
134
|
-
it("should have cli mapping", () => {
|
|
135
|
-
expect(tool.cli).toBeDefined();
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
it("should have cli.command", () => {
|
|
139
|
-
expect(tool.cli.command).toBeDefined();
|
|
140
|
-
expect(tool.cli.command.length).toBeGreaterThan(0);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it("should have cli.argMap", () => {
|
|
144
|
-
expect(tool.cli.argMap).toBeDefined();
|
|
145
|
-
expect(typeof tool.cli.argMap).toBe("object");
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it("should map all input properties to CLI flags", () => {
|
|
149
|
-
const inputProps = Object.keys(tool.inputSchema.properties || {});
|
|
150
|
-
const mappedProps = Object.keys(tool.cli.argMap);
|
|
151
|
-
|
|
152
|
-
// Every input property should have a mapping (can be empty string for positional)
|
|
153
|
-
for (const prop of inputProps) {
|
|
154
|
-
// projectPath is commonly mapped, but we allow unmapped internal props
|
|
155
|
-
if (!["projectPath"].includes(prop)) {
|
|
156
|
-
expect(mappedProps).toContain(prop);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
it("should have --json in fixedFlags", () => {
|
|
162
|
-
expect(tool.cli.fixedFlags).toContain("--json");
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it("should have reasonable timeout", () => {
|
|
166
|
-
expect(tool.cli.timeoutMs).toBeGreaterThan(0);
|
|
167
|
-
expect(tool.cli.timeoutMs).toBeLessThanOrEqual(900000); // Max 15 minutes
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
174
|
-
// TIER DISTRIBUTION TESTS
|
|
175
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
176
|
-
|
|
177
|
-
describe("Tier Distribution", () => {
|
|
178
|
-
it("should have free tools", () => {
|
|
179
|
-
const freeTools = getToolsByTier("free");
|
|
180
|
-
expect(freeTools.length).toBeGreaterThan(0);
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it("should have pro tools", () => {
|
|
184
|
-
const proTools = getToolsByTier("pro");
|
|
185
|
-
expect(proTools.length).toBeGreaterThan(0);
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
it("free tools should include scan, report, doctor, classify", () => {
|
|
189
|
-
const freeTools = getToolsByTier("free").map((t: ToolDefinition) => t.name);
|
|
190
|
-
expect(freeTools).toContain("vibecheck.scan");
|
|
191
|
-
expect(freeTools).toContain("vibecheck.report");
|
|
192
|
-
expect(freeTools).toContain("vibecheck.doctor");
|
|
193
|
-
expect(freeTools).toContain("vibecheck.classify");
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
it("pro tools should include ship, fix, prove, reality", () => {
|
|
197
|
-
const proTools = getToolsByTier("pro").map((t: ToolDefinition) => t.name);
|
|
198
|
-
expect(proTools).toContain("vibecheck.ship");
|
|
199
|
-
expect(proTools).toContain("vibecheck.fix");
|
|
200
|
-
expect(proTools).toContain("vibecheck.prove");
|
|
201
|
-
expect(proTools).toContain("vibecheck.reality");
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
206
|
-
// CATEGORY TESTS
|
|
207
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
208
|
-
|
|
209
|
-
describe("Categories", () => {
|
|
210
|
-
it("should have tools in scan category", () => {
|
|
211
|
-
const scanTools = getToolsByCategory("scan");
|
|
212
|
-
expect(scanTools.length).toBeGreaterThan(0);
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it("should have tools in proof category", () => {
|
|
216
|
-
const proofTools = getToolsByCategory("proof");
|
|
217
|
-
expect(proofTools.length).toBeGreaterThan(0);
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
it("should have tools in setup category", () => {
|
|
221
|
-
const setupTools = getToolsByCategory("setup");
|
|
222
|
-
expect(setupTools.length).toBeGreaterThan(0);
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
|
|
226
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
227
|
-
// ALIAS TESTS
|
|
228
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
229
|
-
|
|
230
|
-
describe("Aliases", () => {
|
|
231
|
-
it("should resolve tool by alias", () => {
|
|
232
|
-
// vibecheck.scan has alias "scan"
|
|
233
|
-
const tool = getToolByName("scan");
|
|
234
|
-
expect(tool).not.toBeNull();
|
|
235
|
-
expect(tool?.name).toBe("vibecheck.scan");
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
it("should resolve tool by another alias", () => {
|
|
239
|
-
// vibecheck.ship has alias "verdict"
|
|
240
|
-
const tool = getToolByName("verdict");
|
|
241
|
-
expect(tool).not.toBeNull();
|
|
242
|
-
expect(tool?.name).toBe("vibecheck.ship");
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
it("should return null for unknown tool", () => {
|
|
246
|
-
const tool = getToolByName("nonexistent-tool");
|
|
247
|
-
expect(tool).toBeNull();
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
it("aliases should be unique across all tools", () => {
|
|
251
|
-
const allAliases: string[] = [];
|
|
252
|
-
const tools = getAllTools();
|
|
253
|
-
|
|
254
|
-
for (const tool of tools) {
|
|
255
|
-
if (tool.aliases) {
|
|
256
|
-
for (const alias of tool.aliases) {
|
|
257
|
-
expect(allAliases).not.toContain(alias);
|
|
258
|
-
allAliases.push(alias);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
266
|
-
// CLI COMMAND MAPPING TESTS
|
|
267
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
268
|
-
|
|
269
|
-
describe("CLI Command Mapping", () => {
|
|
270
|
-
const VALID_CLI_COMMANDS = new Set([
|
|
271
|
-
// From bin/registry.js
|
|
272
|
-
"init", "doctor", "watch", "scan", "report", "context", "classify",
|
|
273
|
-
"login", "logout", "whoami", "allowlist", "evidence-pack", "labs",
|
|
274
|
-
"ship", "fix", "prove", "reality", "gate", "guard", "mcp",
|
|
275
|
-
"checkpoint", "approve", "polish",
|
|
276
|
-
]);
|
|
277
|
-
|
|
278
|
-
it("all tools should map to valid CLI commands", () => {
|
|
279
|
-
const tools = getAllTools();
|
|
280
|
-
|
|
281
|
-
for (const tool of tools) {
|
|
282
|
-
expect(VALID_CLI_COMMANDS.has(tool.cli.command)).toBe(true);
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
288
|
-
// SCHEMA COMPLETENESS TESTS
|
|
289
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
290
|
-
|
|
291
|
-
describe("Schema Completeness", () => {
|
|
292
|
-
it("all input properties should have descriptions", () => {
|
|
293
|
-
const tools = getAllTools();
|
|
294
|
-
|
|
295
|
-
for (const tool of tools) {
|
|
296
|
-
const props = tool.inputSchema.properties || {};
|
|
297
|
-
for (const [_propName, propSchema] of Object.entries(props)) {
|
|
298
|
-
expect((propSchema as { description?: string }).description).toBeDefined();
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
it("all input properties should have types", () => {
|
|
304
|
-
const tools = getAllTools();
|
|
305
|
-
|
|
306
|
-
for (const tool of tools) {
|
|
307
|
-
const props = tool.inputSchema.properties || {};
|
|
308
|
-
for (const [_propName, propSchema] of Object.entries(props)) {
|
|
309
|
-
expect((propSchema as { type?: string }).type).toBeDefined();
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
it("scan-related tools should output findings array", () => {
|
|
315
|
-
const scanTools = ["vibecheck.scan", "vibecheck.ship"];
|
|
316
|
-
|
|
317
|
-
for (const toolName of scanTools) {
|
|
318
|
-
const tool = getToolByName(toolName);
|
|
319
|
-
expect(tool).not.toBeNull();
|
|
320
|
-
expect(tool?.outputSchema.properties?.findings).toBeDefined();
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
326
|
-
// LISTING TESTS
|
|
327
|
-
// โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
328
|
-
|
|
329
|
-
describe("Tool Listing", () => {
|
|
330
|
-
it("listToolNames should return all tool names", () => {
|
|
331
|
-
const names = listToolNames();
|
|
332
|
-
const tools = getAllTools();
|
|
333
|
-
|
|
334
|
-
expect(names.length).toBe(tools.length);
|
|
335
|
-
|
|
336
|
-
for (const tool of tools) {
|
|
337
|
-
expect(names).toContain(tool.name);
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
});
|
package/mcp-server/test-mcp.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* MCP Server Test Script
|
|
4
|
-
* Tests that all tools are properly registered and can be invoked
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { spawn } from 'child_process';
|
|
8
|
-
import { fileURLToPath } from 'url';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
|
|
11
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
-
const __dirname = path.dirname(__filename);
|
|
13
|
-
|
|
14
|
-
console.log('๐งช Testing vibecheck MCP Server...\n');
|
|
15
|
-
|
|
16
|
-
// Test 1: Import all modules
|
|
17
|
-
async function testImports() {
|
|
18
|
-
console.log('1๏ธโฃ Testing module imports...');
|
|
19
|
-
try {
|
|
20
|
-
const { INTELLIGENCE_TOOLS } = await import('./intelligence-tools.js');
|
|
21
|
-
const { VIBECHECK_TOOLS } = await import('./vibecheck-tools.js');
|
|
22
|
-
const { AGENT_CHECKPOINT_TOOLS } = await import('./agent-checkpoint.js');
|
|
23
|
-
const { ARCHITECT_TOOLS } = await import('./architect-tools.js');
|
|
24
|
-
const { CODEBASE_ARCHITECT_TOOLS } = await import('./codebase-architect-tools.js');
|
|
25
|
-
const { VIBECHECK_2_TOOLS } = await import('./vibecheck-2.0-tools.js');
|
|
26
|
-
const { intentDriftTools } = await import('./intent-drift-tools.js');
|
|
27
|
-
const { mdcGeneratorTool } = await import('./mdc-generator.js');
|
|
28
|
-
|
|
29
|
-
console.log(` โ
Intelligence tools: ${INTELLIGENCE_TOOLS.length}`);
|
|
30
|
-
console.log(` โ
vibecheck tools: ${VIBECHECK_TOOLS.length}`);
|
|
31
|
-
console.log(` โ
Checkpoint tools: ${AGENT_CHECKPOINT_TOOLS.length}`);
|
|
32
|
-
console.log(` โ
Architect tools: ${ARCHITECT_TOOLS.length}`);
|
|
33
|
-
console.log(` โ
Codebase Architect tools: ${CODEBASE_ARCHITECT_TOOLS.length}`);
|
|
34
|
-
console.log(` โ
vibecheck 2.0 tools: ${VIBECHECK_2_TOOLS.length}`);
|
|
35
|
-
console.log(` โ
Intent Drift tools: ${intentDriftTools.length}`);
|
|
36
|
-
console.log(` โ
MDC Generator tool: ${mdcGeneratorTool.name}`);
|
|
37
|
-
|
|
38
|
-
const totalTools = INTELLIGENCE_TOOLS.length + VIBECHECK_TOOLS.length +
|
|
39
|
-
AGENT_CHECKPOINT_TOOLS.length + ARCHITECT_TOOLS.length +
|
|
40
|
-
CODEBASE_ARCHITECT_TOOLS.length + VIBECHECK_2_TOOLS.length +
|
|
41
|
-
intentDriftTools.length + 1;
|
|
42
|
-
|
|
43
|
-
console.log(`\n ๐ Total tools available: ${totalTools}\n`);
|
|
44
|
-
return true;
|
|
45
|
-
} catch (error) {
|
|
46
|
-
console.log(` โ Import failed: ${error.message}`);
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Test 2: Verify tier auth
|
|
52
|
-
async function testTierAuth() {
|
|
53
|
-
console.log('2๏ธโฃ Testing tier authentication...');
|
|
54
|
-
try {
|
|
55
|
-
const tierAuth = await import('./tier-auth.js');
|
|
56
|
-
console.log(` โ
Tiers available: ${Object.keys(tierAuth.TIERS).join(', ')}`);
|
|
57
|
-
console.log(` โ
Tier auth module loaded successfully`);
|
|
58
|
-
return true;
|
|
59
|
-
} catch (error) {
|
|
60
|
-
console.log(` โ Tier auth failed: ${error.message}`);
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Test 3: Verify audit trail
|
|
66
|
-
async function testAudit() {
|
|
67
|
-
console.log('3๏ธโฃ Testing audit trail...');
|
|
68
|
-
try {
|
|
69
|
-
const { emitToolInvoke, emitToolComplete } = await import('./audit-mcp.js');
|
|
70
|
-
console.log(` โ
Audit functions available`);
|
|
71
|
-
return true;
|
|
72
|
-
} catch (error) {
|
|
73
|
-
console.log(` โ Audit failed: ${error.message}`);
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Run all tests
|
|
79
|
-
async function runTests() {
|
|
80
|
-
const results = [];
|
|
81
|
-
|
|
82
|
-
results.push(await testImports());
|
|
83
|
-
results.push(await testTierAuth());
|
|
84
|
-
results.push(await testAudit());
|
|
85
|
-
|
|
86
|
-
console.log('\n' + '='.repeat(50));
|
|
87
|
-
const passed = results.filter(r => r).length;
|
|
88
|
-
const total = results.length;
|
|
89
|
-
|
|
90
|
-
if (passed === total) {
|
|
91
|
-
console.log(`โ
All ${total} tests passed!`);
|
|
92
|
-
console.log('\n๐ MCP Server is ready for use!\n');
|
|
93
|
-
console.log('To use with Claude Desktop, add to claude_desktop_config.json:');
|
|
94
|
-
console.log(`{
|
|
95
|
-
"mcpServers": {
|
|
96
|
-
"vibecheck": {
|
|
97
|
-
"command": "node",
|
|
98
|
-
"args": ["${__dirname.replace(/\\/g, '/')}/index.js"]
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}`);
|
|
102
|
-
} else {
|
|
103
|
-
console.log(`โ ${total - passed}/${total} tests failed`);
|
|
104
|
-
process.exit(1);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
runTests().catch(console.error);
|
package/mcp-server/test-tools.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Test individual MCP tools
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { VIBECHECK_TOOLS } from './vibecheck-tools.js';
|
|
7
|
-
import { INTELLIGENCE_TOOLS } from './intelligence-tools.js';
|
|
8
|
-
|
|
9
|
-
console.log('๐ง Testing MCP Server Tools...\n');
|
|
10
|
-
|
|
11
|
-
// List all available tools
|
|
12
|
-
console.log('Available vibecheck Tools:');
|
|
13
|
-
VIBECHECK_TOOLS.forEach(tool => {
|
|
14
|
-
console.log(` - ${tool.name}: ${tool.description}`);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
console.log('\nAvailable Intelligence Tools:');
|
|
18
|
-
INTELLIGENCE_TOOLS.forEach(tool => {
|
|
19
|
-
console.log(` - ${tool.name}: ${tool.description}`);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
// Test a simple tool function
|
|
23
|
-
console.log('\n๐งช Testing tool execution...');
|
|
24
|
-
|
|
25
|
-
// Test vibecheck.mdc function
|
|
26
|
-
try {
|
|
27
|
-
const { handleVibecheckTool } = await import('./vibecheck-tools.js');
|
|
28
|
-
const result = await handleVibecheckTool('vibecheck.mdc', {
|
|
29
|
-
path: process.cwd(),
|
|
30
|
-
output: 'test-output.mdc'
|
|
31
|
-
});
|
|
32
|
-
console.log('โ
vibecheck.mdc tool executed successfully');
|
|
33
|
-
console.log('Result:', JSON.stringify(result, null, 2));
|
|
34
|
-
} catch (error) {
|
|
35
|
-
console.log('โ Tool execution failed:', error.message);
|
|
36
|
-
}
|