@vibecheckai/cli 3.0.4 → 3.0.7
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/bin/dev/run-v2-torture.js +30 -0
- package/bin/runners/context/index.js +1 -1
- package/bin/runners/lib/analyzers.js +38 -0
- package/bin/runners/lib/assets/vibecheck-logo.png +0 -0
- package/bin/runners/lib/contracts/auth-contract.js +8 -0
- package/bin/runners/lib/contracts/env-contract.js +3 -0
- package/bin/runners/lib/contracts/external-contract.js +10 -2
- package/bin/runners/lib/contracts/route-contract.js +7 -0
- package/bin/runners/lib/contracts.js +804 -0
- package/bin/runners/lib/detectors-v2.js +703 -0
- package/bin/runners/lib/drift.js +425 -0
- package/bin/runners/lib/entitlements-v2.js +3 -1
- package/bin/runners/lib/entitlements.js +11 -3
- package/bin/runners/lib/env-resolver.js +417 -0
- package/bin/runners/lib/extractors/client-calls.js +990 -0
- package/bin/runners/lib/extractors/fastify-route-dump.js +573 -0
- package/bin/runners/lib/extractors/fastify-routes.js +426 -0
- package/bin/runners/lib/extractors/index.js +363 -0
- package/bin/runners/lib/extractors/next-routes.js +524 -0
- package/bin/runners/lib/extractors/proof-graph.js +431 -0
- package/bin/runners/lib/extractors/route-matcher.js +451 -0
- package/bin/runners/lib/extractors/truthpack-v2.js +377 -0
- package/bin/runners/lib/extractors/ui-bindings.js +547 -0
- package/bin/runners/lib/findings-schema.js +281 -0
- package/bin/runners/lib/html-report.js +650 -0
- package/bin/runners/lib/missions/templates.js +45 -0
- package/bin/runners/lib/policy.js +295 -0
- package/bin/runners/lib/reality/correlation-detectors.js +359 -0
- package/bin/runners/lib/reality/index.js +318 -0
- package/bin/runners/lib/reality/request-hashing.js +416 -0
- package/bin/runners/lib/reality/request-mapper.js +453 -0
- package/bin/runners/lib/reality/safety-rails.js +463 -0
- package/bin/runners/lib/reality/semantic-snapshot.js +408 -0
- package/bin/runners/lib/reality/toast-detector.js +393 -0
- package/bin/runners/lib/report-html.js +5 -0
- package/bin/runners/lib/report-templates.js +5 -0
- package/bin/runners/lib/report.js +135 -0
- package/bin/runners/lib/route-truth.js +10 -10
- package/bin/runners/lib/schema-validator.js +350 -0
- package/bin/runners/lib/schemas/contracts.schema.json +160 -0
- package/bin/runners/lib/schemas/finding.schema.json +100 -0
- package/bin/runners/lib/schemas/mission-pack.schema.json +206 -0
- package/bin/runners/lib/schemas/proof-graph.schema.json +176 -0
- package/bin/runners/lib/schemas/reality-report.schema.json +162 -0
- package/bin/runners/lib/schemas/share-pack.schema.json +180 -0
- package/bin/runners/lib/schemas/ship-report.schema.json +117 -0
- package/bin/runners/lib/schemas/truthpack-v2.schema.json +303 -0
- package/bin/runners/lib/schemas/validator.js +438 -0
- package/bin/runners/lib/ui.js +562 -0
- package/bin/runners/lib/verdict-engine.js +628 -0
- package/bin/runners/runAIAgent.js +228 -1
- package/bin/runners/runBadge.js +181 -1
- package/bin/runners/runCtx.js +7 -2
- package/bin/runners/runCtxDiff.js +301 -0
- package/bin/runners/runGuard.js +168 -0
- package/bin/runners/runInitGha.js +78 -15
- package/bin/runners/runLabs.js +341 -0
- package/bin/runners/runLaunch.js +180 -1
- package/bin/runners/runMdc.js +203 -1
- package/bin/runners/runProof.zip +0 -0
- package/bin/runners/runProve.js +23 -0
- package/bin/runners/runReplay.js +114 -84
- package/bin/runners/runScan.js +111 -32
- package/bin/runners/runShip.js +23 -2
- package/bin/runners/runTruthpack.js +9 -7
- package/bin/runners/runValidate.js +161 -1
- package/bin/vibecheck.js +416 -770
- package/mcp-server/.guardrail/audit/audit.log.jsonl +2 -0
- package/mcp-server/.specs/architecture.mdc +90 -0
- package/mcp-server/.specs/security.mdc +30 -0
- package/mcp-server/README.md +252 -0
- package/mcp-server/agent-checkpoint.js +364 -0
- package/mcp-server/architect-tools.js +707 -0
- package/mcp-server/audit-mcp.js +206 -0
- package/mcp-server/codebase-architect-tools.js +838 -0
- package/mcp-server/consolidated-tools.js +804 -0
- package/mcp-server/hygiene-tools.js +428 -0
- package/mcp-server/index-v1.js +698 -0
- package/mcp-server/index.js +2092 -0
- package/mcp-server/index.old.js +4137 -0
- package/mcp-server/intelligence-tools.js +664 -0
- package/mcp-server/intent-drift-tools.js +873 -0
- package/mcp-server/mdc-generator.js +298 -0
- package/mcp-server/package-lock.json +165 -0
- package/mcp-server/package.json +47 -0
- package/mcp-server/premium-tools.js +1275 -0
- package/mcp-server/test-mcp.js +108 -0
- package/mcp-server/test-tools.js +36 -0
- package/mcp-server/tier-auth.js +147 -0
- package/mcp-server/tools/index.js +72 -0
- package/mcp-server/tools-reorganized.ts +244 -0
- package/mcp-server/truth-context.js +581 -0
- package/mcp-server/truth-firewall-tools.js +1500 -0
- package/mcp-server/vibecheck-2.0-tools.js +748 -0
- package/mcp-server/vibecheck-tools.js +1075 -0
- package/package.json +10 -8
- package/bin/guardrail.js +0 -834
- package/bin/runners/runAudit.js +0 -2
- package/bin/runners/runAutopilot.js +0 -2
- package/bin/runners/runCertify.js +0 -2
- package/bin/runners/runDashboard.js +0 -10
- package/bin/runners/runEnhancedShip.js +0 -2
- package/bin/runners/runFixPacks.js +0 -2
- package/bin/runners/runNaturalLanguage.js +0 -3
- package/bin/runners/runProof.js +0 -2
- package/bin/runners/runRealitySniff.js +0 -2
- package/bin/runners/runUpgrade.js +0 -2
- package/bin/runners/runVerifyAgentOutput.js +0 -2
|
@@ -0,0 +1,108 @@
|
|
|
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);
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Server Tier Authentication & Authorization
|
|
3
|
+
*
|
|
4
|
+
* Provides tier checking for MCP tools based on API keys
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import fs from "fs/promises";
|
|
8
|
+
import path from "path";
|
|
9
|
+
import os from "os";
|
|
10
|
+
|
|
11
|
+
// Tier definitions
|
|
12
|
+
export const TIERS = {
|
|
13
|
+
free: {
|
|
14
|
+
name: 'Free',
|
|
15
|
+
features: ['verify', 'quality', 'hallucination'],
|
|
16
|
+
limits: { scans: 10, projects: 1 }
|
|
17
|
+
},
|
|
18
|
+
starter: {
|
|
19
|
+
name: 'Starter',
|
|
20
|
+
features: ['verify', 'quality', 'hallucination', 'smells', 'breaking'],
|
|
21
|
+
limits: { scans: 100, projects: 3 }
|
|
22
|
+
},
|
|
23
|
+
pro: {
|
|
24
|
+
name: 'Professional',
|
|
25
|
+
features: ['verify', 'quality', 'hallucination', 'smells', 'breaking', 'mdc'],
|
|
26
|
+
limits: { scans: 1000, projects: 10 }
|
|
27
|
+
},
|
|
28
|
+
enterprise: {
|
|
29
|
+
name: 'Enterprise',
|
|
30
|
+
features: ['verify', 'quality', 'hallucination', 'smells', 'breaking', 'mdc'],
|
|
31
|
+
limits: { scans: -1, projects: -1 } // unlimited
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Load user configuration from ~/.vibecheck/credentials.json
|
|
37
|
+
*/
|
|
38
|
+
async function loadUserConfig() {
|
|
39
|
+
try {
|
|
40
|
+
const configPath = path.join(os.homedir(), '.vibecheck', 'credentials.json');
|
|
41
|
+
const configData = await fs.readFile(configPath, 'utf-8');
|
|
42
|
+
return JSON.parse(configData);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Determine tier from API key
|
|
50
|
+
*/
|
|
51
|
+
function getTierFromApiKey(apiKey) {
|
|
52
|
+
if (!apiKey) return 'free';
|
|
53
|
+
|
|
54
|
+
if (apiKey.startsWith('gr_starter_')) return 'starter';
|
|
55
|
+
if (apiKey.startsWith('gr_pro_')) return 'pro';
|
|
56
|
+
if (apiKey.startsWith('gr_ent_')) return 'enterprise';
|
|
57
|
+
if (apiKey.startsWith('gr_free_')) return 'free';
|
|
58
|
+
|
|
59
|
+
return 'free'; // default for unknown keys
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if user has access to a specific feature
|
|
64
|
+
*/
|
|
65
|
+
export async function checkFeatureAccess(featureName, providedApiKey = null) {
|
|
66
|
+
// Try to load user config
|
|
67
|
+
const userConfig = await loadUserConfig();
|
|
68
|
+
const apiKey = providedApiKey || userConfig?.apiKey;
|
|
69
|
+
|
|
70
|
+
if (!apiKey) {
|
|
71
|
+
return {
|
|
72
|
+
hasAccess: false,
|
|
73
|
+
tier: 'free',
|
|
74
|
+
reason: 'No API key provided. Run: vibecheck auth --key YOUR_API_KEY',
|
|
75
|
+
upgradeUrl: 'https://vibecheckai.dev/pricing'
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const tier = getTierFromApiKey(apiKey);
|
|
80
|
+
const tierConfig = TIERS[tier];
|
|
81
|
+
|
|
82
|
+
if (!tierConfig.features.includes(featureName)) {
|
|
83
|
+
const requiredTier = Object.entries(TIERS).find(([_, config]) =>
|
|
84
|
+
config.features.includes(featureName)
|
|
85
|
+
)?.[0];
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
hasAccess: false,
|
|
89
|
+
tier,
|
|
90
|
+
reason: `${featureName} requires ${requiredTier} tier or higher`,
|
|
91
|
+
upgradeUrl: 'https://vibecheckai.dev/pricing'
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
hasAccess: true,
|
|
97
|
+
tier,
|
|
98
|
+
reason: 'Access granted'
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Middleware for MCP tool handlers
|
|
104
|
+
*/
|
|
105
|
+
export function withTierCheck(featureName, handler) {
|
|
106
|
+
return async (args) => {
|
|
107
|
+
const access = await checkFeatureAccess(featureName, args?.apiKey);
|
|
108
|
+
|
|
109
|
+
if (!access.hasAccess) {
|
|
110
|
+
return {
|
|
111
|
+
content: [{
|
|
112
|
+
type: "text",
|
|
113
|
+
text: `🚫 UPGRADE REQUIRED\n\n${access.reason}\n\nUpgrade at: ${access.upgradeUrl}`
|
|
114
|
+
}],
|
|
115
|
+
isError: true
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Add tier info to args for the handler
|
|
120
|
+
args._tier = access.tier;
|
|
121
|
+
return handler(args);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Get current user info
|
|
127
|
+
*/
|
|
128
|
+
export async function getUserInfo() {
|
|
129
|
+
const config = await loadUserConfig();
|
|
130
|
+
if (!config) {
|
|
131
|
+
return {
|
|
132
|
+
authenticated: false,
|
|
133
|
+
tier: 'free',
|
|
134
|
+
message: 'Not authenticated. Run: vibecheck auth --key YOUR_API_KEY'
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const tier = getTierFromApiKey(config.apiKey);
|
|
139
|
+
return {
|
|
140
|
+
authenticated: true,
|
|
141
|
+
tier,
|
|
142
|
+
email: config.email,
|
|
143
|
+
authenticatedAt: config.authenticatedAt,
|
|
144
|
+
features: TIERS[tier].features,
|
|
145
|
+
limits: TIERS[tier].limits
|
|
146
|
+
};
|
|
147
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools Index - Single Entry Point for All Tools
|
|
3
|
+
*
|
|
4
|
+
* This module exports all MCP tools in a unified structure.
|
|
5
|
+
* Internal modules are organized by category but presented as one toolset.
|
|
6
|
+
*
|
|
7
|
+
* Tool Categories:
|
|
8
|
+
* - Core: scan, ship, reality, fix, prove, report
|
|
9
|
+
* - Truth: ctx, guard, validate_claim, compile_context
|
|
10
|
+
* - AI: checkpoint, architect, intelligence
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* import { ALL_TOOLS, handleTool } from './tools/index.js';
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// Re-export consolidated tools as the primary interface
|
|
17
|
+
export { CONSOLIDATED_TOOLS, handleConsolidatedTool } from '../consolidated-tools.js';
|
|
18
|
+
|
|
19
|
+
// Re-export truth firewall (hallucination stopper)
|
|
20
|
+
export { TRUTH_FIREWALL_TOOLS, handleTruthFirewallTool } from '../truth-firewall-tools.js';
|
|
21
|
+
|
|
22
|
+
// Re-export truth context
|
|
23
|
+
export { TRUTH_CONTEXT_TOOLS, handleTruthContextTool } from '../truth-context.js';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get all recommended tools (consolidated + truth firewall)
|
|
27
|
+
*/
|
|
28
|
+
export function getRecommendedTools() {
|
|
29
|
+
const { CONSOLIDATED_TOOLS } = require('../consolidated-tools.js');
|
|
30
|
+
const { TRUTH_FIREWALL_TOOLS } = require('../truth-firewall-tools.js');
|
|
31
|
+
return [...CONSOLIDATED_TOOLS, ...TRUTH_FIREWALL_TOOLS];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Handle any tool call by routing to the appropriate handler
|
|
36
|
+
*/
|
|
37
|
+
export async function handleToolCall(toolName, args) {
|
|
38
|
+
// Route to consolidated handler first
|
|
39
|
+
const { handleConsolidatedTool, CONSOLIDATED_TOOLS } = await import('../consolidated-tools.js');
|
|
40
|
+
const consolidatedNames = CONSOLIDATED_TOOLS.map(t => t.name);
|
|
41
|
+
|
|
42
|
+
if (consolidatedNames.includes(toolName)) {
|
|
43
|
+
return handleConsolidatedTool(toolName, args);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Route to truth firewall
|
|
47
|
+
const { handleTruthFirewallTool, TRUTH_FIREWALL_TOOLS } = await import('../truth-firewall-tools.js');
|
|
48
|
+
const firewallNames = TRUTH_FIREWALL_TOOLS.map(t => t.name);
|
|
49
|
+
|
|
50
|
+
if (firewallNames.includes(toolName)) {
|
|
51
|
+
return handleTruthFirewallTool(toolName, args);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Route to truth context
|
|
55
|
+
const { handleTruthContextTool, TRUTH_CONTEXT_TOOLS } = await import('../truth-context.js');
|
|
56
|
+
const contextNames = TRUTH_CONTEXT_TOOLS.map(t => t.name);
|
|
57
|
+
|
|
58
|
+
if (contextNames.includes(toolName)) {
|
|
59
|
+
return handleTruthContextTool(toolName, args);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
throw new Error(`Unknown tool: ${toolName}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Tool categories for documentation
|
|
67
|
+
*/
|
|
68
|
+
export const TOOL_CATEGORIES = {
|
|
69
|
+
core: ['vibecheck.scan', 'vibecheck.ship', 'vibecheck.reality', 'vibecheck.fix', 'vibecheck.prove', 'vibecheck.report'],
|
|
70
|
+
truth: ['vibecheck.ctx', 'vibecheck.get_truthpack', 'vibecheck.validate_claim', 'vibecheck.compile_context'],
|
|
71
|
+
guard: ['vibecheck.guard', 'vibecheck.check_route', 'vibecheck.check_env', 'vibecheck.check_auth'],
|
|
72
|
+
};
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools Reorganized into 5 Groups
|
|
3
|
+
*
|
|
4
|
+
* Truth, Impact, Standards, Security, Workflow
|
|
5
|
+
* ~20 tools total, grouped for sanity
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const TRUTH_TOOLS = [
|
|
9
|
+
{
|
|
10
|
+
name: 'repo_map',
|
|
11
|
+
description: 'Get complete repository map (structure, files, relationships)',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'symbols_exists',
|
|
21
|
+
description: 'Check if symbol exists in codebase',
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
symbol: { type: 'string', description: 'Symbol name to check' },
|
|
26
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'symbols_find',
|
|
32
|
+
description: 'Find symbol definition location',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
symbol: { type: 'string', description: 'Symbol name' },
|
|
37
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'symbols_fuzzy',
|
|
43
|
+
description: 'Fuzzy search for symbols',
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: 'object',
|
|
46
|
+
properties: {
|
|
47
|
+
query: { type: 'string', description: 'Search query' },
|
|
48
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'versions_allowed',
|
|
54
|
+
description: 'Check if dependency version is allowed',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
package: { type: 'string', description: 'Package name' },
|
|
59
|
+
version: { type: 'string', description: 'Version to check' },
|
|
60
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
export const IMPACT_TOOLS = [
|
|
67
|
+
{
|
|
68
|
+
name: 'graph_related',
|
|
69
|
+
description: 'Get blast radius - files affected by changes',
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
properties: {
|
|
73
|
+
file: { type: 'string', description: 'File path' },
|
|
74
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
export const STANDARDS_TOOLS = [
|
|
81
|
+
{
|
|
82
|
+
name: 'patterns_pick',
|
|
83
|
+
description: 'Pick appropriate pattern from codebase',
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: 'object',
|
|
86
|
+
properties: {
|
|
87
|
+
patternType: { type: 'string', description: 'Type of pattern needed' },
|
|
88
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'architecture_check',
|
|
94
|
+
description: 'Check code against architecture patterns',
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
properties: {
|
|
98
|
+
code: { type: 'string', description: 'Code to check' },
|
|
99
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'boundary_check',
|
|
105
|
+
description: 'Check if code respects architectural boundaries',
|
|
106
|
+
inputSchema: {
|
|
107
|
+
type: 'object',
|
|
108
|
+
properties: {
|
|
109
|
+
file: { type: 'string', description: 'File path' },
|
|
110
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
export const SECURITY_TOOLS = [
|
|
117
|
+
{
|
|
118
|
+
name: 'antipatterns_scan',
|
|
119
|
+
description: 'Scan for code smells and security footguns',
|
|
120
|
+
inputSchema: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
properties: {
|
|
123
|
+
file: { type: 'string', description: 'File path' },
|
|
124
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'antipatterns_check',
|
|
130
|
+
description: 'Check specific code against antipatterns',
|
|
131
|
+
inputSchema: {
|
|
132
|
+
type: 'object',
|
|
133
|
+
properties: {
|
|
134
|
+
code: { type: 'string', description: 'Code to check' },
|
|
135
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'vulnerabilities_scan',
|
|
141
|
+
description: 'Scan dependencies for vulnerabilities',
|
|
142
|
+
inputSchema: {
|
|
143
|
+
type: 'object',
|
|
144
|
+
properties: {
|
|
145
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'vulnerability_check',
|
|
151
|
+
description: 'Check specific package/version for vulnerabilities',
|
|
152
|
+
inputSchema: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
properties: {
|
|
155
|
+
package: { type: 'string', description: 'Package name' },
|
|
156
|
+
version: { type: 'string', description: 'Version' },
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
|
|
162
|
+
export const WORKFLOW_TOOLS = [
|
|
163
|
+
{
|
|
164
|
+
name: 'scope_declare',
|
|
165
|
+
description: 'Declare intent/scope before writing code',
|
|
166
|
+
inputSchema: {
|
|
167
|
+
type: 'object',
|
|
168
|
+
properties: {
|
|
169
|
+
intent: { type: 'string', description: 'What you intend to do' },
|
|
170
|
+
scope: { type: 'string', description: 'Scope of changes' },
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'scope_check',
|
|
176
|
+
description: 'Check if code changes align with declared scope',
|
|
177
|
+
inputSchema: {
|
|
178
|
+
type: 'object',
|
|
179
|
+
properties: {
|
|
180
|
+
code: { type: 'string', description: 'Code to check' },
|
|
181
|
+
declaredScope: { type: 'string', description: 'Originally declared scope' },
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'autopilot',
|
|
187
|
+
description: 'Intent classification and autopilot suggestions',
|
|
188
|
+
inputSchema: {
|
|
189
|
+
type: 'object',
|
|
190
|
+
properties: {
|
|
191
|
+
intent: { type: 'string', description: 'User intent' },
|
|
192
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: 'verify_fast',
|
|
198
|
+
description: 'Fast pre-write verification',
|
|
199
|
+
inputSchema: {
|
|
200
|
+
type: 'object',
|
|
201
|
+
properties: {
|
|
202
|
+
code: { type: 'string', description: 'Code to verify' },
|
|
203
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: 'verify_deep',
|
|
209
|
+
description: 'Deep verification with runtime checks',
|
|
210
|
+
inputSchema: {
|
|
211
|
+
type: 'object',
|
|
212
|
+
properties: {
|
|
213
|
+
code: { type: 'string', description: 'Code to verify' },
|
|
214
|
+
projectPath: { type: 'string', description: 'Project path' },
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
];
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* All tools grouped
|
|
222
|
+
*/
|
|
223
|
+
export const ALL_MCP_TOOLS = [
|
|
224
|
+
...TRUTH_TOOLS,
|
|
225
|
+
...IMPACT_TOOLS,
|
|
226
|
+
...STANDARDS_TOOLS,
|
|
227
|
+
...SECURITY_TOOLS,
|
|
228
|
+
...WORKFLOW_TOOLS,
|
|
229
|
+
];
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Tool response format (world-class rules)
|
|
233
|
+
*/
|
|
234
|
+
export interface ToolResponse {
|
|
235
|
+
verdict: 'PASS' | 'FAIL' | 'WARN' | 'INDEX_REQUIRED';
|
|
236
|
+
proof: any; // Evidence/proof data
|
|
237
|
+
nextAction: string; // What to do next
|
|
238
|
+
latency?: number; // Tool execution time in ms
|
|
239
|
+
blockedHallucination?: boolean; // Did this prevent a hallucination?
|
|
240
|
+
prevented?: {
|
|
241
|
+
type: 'symbol' | 'route' | 'version' | 'boundary';
|
|
242
|
+
value: string;
|
|
243
|
+
};
|
|
244
|
+
}
|