@vibecheckai/cli 3.6.1 → 3.8.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.
Files changed (105) hide show
  1. package/README.md +135 -63
  2. package/bin/_deprecations.js +447 -19
  3. package/bin/_router.js +1 -1
  4. package/bin/registry.js +347 -280
  5. package/bin/runners/context/generators/cursor-enhanced.js +2439 -0
  6. package/bin/runners/lib/agent-firewall/enforcement/gateway.js +1059 -0
  7. package/bin/runners/lib/agent-firewall/enforcement/index.js +98 -0
  8. package/bin/runners/lib/agent-firewall/enforcement/mode.js +318 -0
  9. package/bin/runners/lib/agent-firewall/enforcement/orchestrator.js +484 -0
  10. package/bin/runners/lib/agent-firewall/enforcement/proof-artifact.js +418 -0
  11. package/bin/runners/lib/agent-firewall/enforcement/schemas/change-event.schema.json +173 -0
  12. package/bin/runners/lib/agent-firewall/enforcement/schemas/intent.schema.json +181 -0
  13. package/bin/runners/lib/agent-firewall/enforcement/schemas/verdict.schema.json +222 -0
  14. package/bin/runners/lib/agent-firewall/enforcement/verdict-v2.js +333 -0
  15. package/bin/runners/lib/agent-firewall/index.js +200 -0
  16. package/bin/runners/lib/agent-firewall/integration/index.js +20 -0
  17. package/bin/runners/lib/agent-firewall/integration/ship-gate.js +437 -0
  18. package/bin/runners/lib/agent-firewall/intent/alignment-engine.js +622 -0
  19. package/bin/runners/lib/agent-firewall/intent/auto-detect.js +426 -0
  20. package/bin/runners/lib/agent-firewall/intent/index.js +102 -0
  21. package/bin/runners/lib/agent-firewall/intent/schema.js +352 -0
  22. package/bin/runners/lib/agent-firewall/intent/store.js +283 -0
  23. package/bin/runners/lib/agent-firewall/interception/fs-interceptor.js +502 -0
  24. package/bin/runners/lib/agent-firewall/interception/index.js +23 -0
  25. package/bin/runners/lib/agent-firewall/policy/rules/fake-success.js +31 -38
  26. package/bin/runners/lib/agent-firewall/policy/rules/ghost-env.js +68 -3
  27. package/bin/runners/lib/agent-firewall/policy/rules/ghost-route.js +4 -2
  28. package/bin/runners/lib/agent-firewall/risk/thresholds.js +5 -4
  29. package/bin/runners/lib/agent-firewall/session/collector.js +451 -0
  30. package/bin/runners/lib/agent-firewall/session/index.js +26 -0
  31. package/bin/runners/lib/artifact-envelope.js +540 -0
  32. package/bin/runners/lib/auth-shared.js +977 -0
  33. package/bin/runners/lib/checkpoint.js +941 -0
  34. package/bin/runners/lib/cleanup/engine.js +571 -0
  35. package/bin/runners/lib/cleanup/index.js +53 -0
  36. package/bin/runners/lib/cleanup/output.js +375 -0
  37. package/bin/runners/lib/cleanup/rules.js +1060 -0
  38. package/bin/runners/lib/doctor/diagnosis-receipt.js +454 -0
  39. package/bin/runners/lib/doctor/failure-signatures.js +526 -0
  40. package/bin/runners/lib/doctor/fix-script.js +336 -0
  41. package/bin/runners/lib/doctor/modules/build-tools.js +453 -0
  42. package/bin/runners/lib/doctor/modules/index.js +62 -3
  43. package/bin/runners/lib/doctor/modules/os-quirks.js +706 -0
  44. package/bin/runners/lib/doctor/modules/repo-integrity.js +485 -0
  45. package/bin/runners/lib/doctor/safe-repair.js +384 -0
  46. package/bin/runners/lib/engines/attack-detector.js +1192 -0
  47. package/bin/runners/lib/entitlements-v2.js +2 -2
  48. package/bin/runners/lib/error-messages.js +1 -1
  49. package/bin/runners/lib/missions/briefing.js +427 -0
  50. package/bin/runners/lib/missions/checkpoint.js +753 -0
  51. package/bin/runners/lib/missions/hardening.js +851 -0
  52. package/bin/runners/lib/missions/plan.js +421 -32
  53. package/bin/runners/lib/missions/safety-gates.js +645 -0
  54. package/bin/runners/lib/missions/schema.js +478 -0
  55. package/bin/runners/lib/packs/bundle.js +675 -0
  56. package/bin/runners/lib/packs/evidence-pack.js +671 -0
  57. package/bin/runners/lib/packs/pack-factory.js +837 -0
  58. package/bin/runners/lib/packs/permissions-pack.js +686 -0
  59. package/bin/runners/lib/packs/proof-graph-pack.js +779 -0
  60. package/bin/runners/lib/report-output.js +6 -6
  61. package/bin/runners/lib/safelist/index.js +96 -0
  62. package/bin/runners/lib/safelist/integration.js +334 -0
  63. package/bin/runners/lib/safelist/matcher.js +696 -0
  64. package/bin/runners/lib/safelist/schema.js +948 -0
  65. package/bin/runners/lib/safelist/store.js +438 -0
  66. package/bin/runners/lib/schemas/ship-manifest.schema.json +251 -0
  67. package/bin/runners/lib/ship-gate.js +832 -0
  68. package/bin/runners/lib/ship-manifest.js +1153 -0
  69. package/bin/runners/lib/ship-output.js +1 -1
  70. package/bin/runners/lib/unified-cli-output.js +710 -383
  71. package/bin/runners/lib/upsell.js +3 -3
  72. package/bin/runners/lib/why-tree.js +650 -0
  73. package/bin/runners/runAllowlist.js +33 -4
  74. package/bin/runners/runApprove.js +240 -1122
  75. package/bin/runners/runAudit.js +692 -0
  76. package/bin/runners/runAuth.js +325 -29
  77. package/bin/runners/runCheckpoint.js +442 -494
  78. package/bin/runners/runCleanup.js +343 -0
  79. package/bin/runners/runDoctor.js +269 -19
  80. package/bin/runners/runFix.js +411 -32
  81. package/bin/runners/runForge.js +411 -0
  82. package/bin/runners/runIntent.js +906 -0
  83. package/bin/runners/runKickoff.js +878 -0
  84. package/bin/runners/runLaunch.js +2000 -0
  85. package/bin/runners/runLink.js +785 -0
  86. package/bin/runners/runMcp.js +1741 -837
  87. package/bin/runners/runPacks.js +2089 -0
  88. package/bin/runners/runPolish.js +41 -0
  89. package/bin/runners/runSafelist.js +1190 -0
  90. package/bin/runners/runScan.js +21 -9
  91. package/bin/runners/runShield.js +1282 -0
  92. package/bin/runners/runShip.js +395 -16
  93. package/bin/vibecheck.js +34 -6
  94. package/mcp-server/README.md +117 -158
  95. package/mcp-server/handlers/tool-handler.ts +3 -3
  96. package/mcp-server/index.js +16 -0
  97. package/mcp-server/intent-firewall-interceptor.js +529 -0
  98. package/mcp-server/manifest.json +473 -0
  99. package/mcp-server/package.json +1 -1
  100. package/mcp-server/registry/tool-registry.js +315 -523
  101. package/mcp-server/registry/tools.json +442 -428
  102. package/mcp-server/tier-auth.js +164 -16
  103. package/mcp-server/tools-v3.js +70 -16
  104. package/package.json +1 -1
  105. package/bin/runners/runProof.zip +0 -0
@@ -1,358 +1,220 @@
1
1
  /**
2
- * Single Source of Truth for MCP Tool Registry
2
+ * MCP Tool Registry - Canonical Tools Only
3
3
  *
4
- * Defines all MCP tools with:
5
- * - Input/output schemas (JSON Schema)
6
- * - Tier requirements (free/pro)
7
- * - Timeouts
8
- * - Rate limits
9
- * - Option-level gates
4
+ * ═══════════════════════════════════════════════════════════════════════════════
5
+ * VERSION 4.0.0 - CLEAN & TIGHT
6
+ * ═══════════════════════════════════════════════════════════════════════════════
10
7
  *
11
- * This registry is used for:
12
- * - Input validation
13
- * - Output validation (warnings)
14
- * - Tier enforcement
15
- * - Timeout configuration
16
- * - Rate limit configuration
8
+ * Single source of truth for all MCP tools.
9
+ * No legacy aliases. No deprecated mappings.
10
+ *
11
+ * @version 4.1.0
17
12
  */
18
13
 
19
14
  const Ajv = require('ajv');
20
15
  const ajv = new Ajv({ allErrors: true, strict: false });
21
16
 
22
- // Note: Tool tier definitions are defined here in TOOL_REGISTRY
23
- // This is the single source of truth - tier-auth.js references this for consistency
24
-
25
- /**
26
- * Tool Definition Schema
27
- * @typedef {Object} ToolDefinition
28
- * @property {string} name - Tool name
29
- * @property {string} description - Tool description
30
- * @property {'free'|'pro'} tier - Required tier
31
- * @property {string} category - Tool category
32
- * @property {object} inputSchema - JSON Schema for input validation
33
- * @property {object} outputSchema - JSON Schema for output validation (optional)
34
- * @property {Array<{name: string, tier?: 'pro', description: string}>} options - Option-level gates
35
- * @property {{perMinute: number, perHour?: number}} rateLimit - Rate limit override (optional)
36
- * @property {number} timeout - Timeout in milliseconds
37
- */
38
-
39
17
  /**
40
- * Tool Registry - Single Source of Truth
18
+ * Tool Registry - Canonical Tools Only
41
19
  */
42
20
  const TOOL_REGISTRY = {
43
21
  // ═══════════════════════════════════════════════════════════════════════════
44
- // FREE TOOLS
22
+ // SETUP (FREE)
45
23
  // ═══════════════════════════════════════════════════════════════════════════
46
24
 
47
- 'vibecheck.scan': {
48
- name: 'vibecheck.scan',
49
- description: 'Scan codebase for issues (routes, env, auth, security)',
50
- tier: 'free',
51
- category: 'analysis',
52
- inputSchema: {
53
- type: 'object',
54
- properties: {
55
- projectPath: { type: 'string', description: 'Project path' },
56
- categories: {
57
- type: 'array',
58
- items: { type: 'string' },
59
- description: 'Categories: routes, env, auth, billing, security',
60
- },
61
- since: {
62
- type: 'string',
63
- description: 'ISO timestamp for incremental scan',
64
- },
65
- noCache: { type: 'boolean', default: false },
66
- },
67
- },
68
- outputSchema: {
69
- type: 'object',
70
- properties: {
71
- success: { type: 'boolean' },
72
- findings: { type: 'array' },
73
- summary: { type: 'object' },
74
- cacheStats: { type: 'object' },
75
- },
76
- },
77
- options: [
78
- { name: 'autofix', tier: 'pro', description: 'Auto-fix issues' },
79
- { name: 'fix', tier: 'pro', description: 'Fix mode' },
80
- ],
81
- rateLimit: { perMinute: 10 },
82
- timeout: 300000, // 5 min
83
- },
84
-
85
- 'vibecheck.ctx': {
86
- name: 'vibecheck.ctx',
87
- description: 'Generate truth context for AI agents',
88
- tier: 'free',
89
- category: 'context',
90
- inputSchema: {
91
- type: 'object',
92
- properties: {
93
- projectPath: { type: 'string' },
94
- scope: {
95
- type: 'string',
96
- enum: ['all', 'routes', 'env', 'auth', 'billing'],
97
- default: 'all',
98
- },
99
- },
100
- },
101
- outputSchema: {
102
- type: 'object',
103
- properties: {
104
- success: { type: 'boolean' },
105
- context: { type: 'object' },
106
- },
107
- },
108
- timeout: 120000, // 2 min
109
- },
110
-
111
- 'vibecheck.verify': {
112
- name: 'vibecheck.verify',
113
- description: 'Verify AI-generated code before applying',
114
- tier: 'free',
115
- category: 'validation',
116
- inputSchema: {
117
- type: 'object',
118
- properties: {
119
- code: { type: 'string', description: 'Code to verify' },
120
- file: { type: 'string' },
121
- projectPath: { type: 'string' },
122
- },
123
- required: ['code'],
124
- },
125
- outputSchema: {
126
- type: 'object',
127
- properties: {
128
- verified: { type: 'boolean' },
129
- issues: { type: 'array' },
130
- },
131
- },
132
- timeout: 60000, // 1 min
133
- },
134
-
135
- 'vibecheck.report': {
136
- name: 'vibecheck.report',
137
- description: 'Generate reports',
25
+ 'vibecheck.link': {
26
+ name: 'vibecheck.link',
27
+ description: 'One-time project setup: config, contracts, scripts',
138
28
  tier: 'free',
139
- category: 'reporting',
29
+ category: 'setup',
140
30
  inputSchema: {
141
31
  type: 'object',
142
32
  properties: {
143
- projectPath: { type: 'string' },
144
- format: { type: 'string', enum: ['html', 'md', 'sarif', 'json'], default: 'html' },
145
- },
146
- },
147
- outputSchema: {
148
- type: 'object',
149
- properties: {
150
- success: { type: 'boolean' },
151
- report: { type: 'string' },
33
+ projectPath: { type: 'string', default: '.' },
34
+ force: { type: 'boolean', default: false },
152
35
  },
153
36
  },
154
- timeout: 120000, // 2 min
37
+ timeout: 60000,
155
38
  },
156
39
 
157
- 'vibecheck.status': {
158
- name: 'vibecheck.status',
159
- description: 'Check vibecheck status and health',
40
+ 'vibecheck.kickoff': {
41
+ name: 'vibecheck.kickoff',
42
+ description: 'Interactive guided onboarding experience',
160
43
  tier: 'free',
161
- category: 'diagnostics',
44
+ category: 'setup',
162
45
  inputSchema: {
163
46
  type: 'object',
164
47
  properties: {
165
- projectPath: { type: 'string' },
166
- },
167
- },
168
- outputSchema: {
169
- type: 'object',
170
- properties: {
171
- success: { type: 'boolean' },
172
- status: { type: 'object' },
48
+ projectPath: { type: 'string', default: '.' },
173
49
  },
174
50
  },
175
- timeout: 30000, // 30s
51
+ timeout: 120000,
176
52
  },
177
53
 
178
54
  'vibecheck.doctor': {
179
55
  name: 'vibecheck.doctor',
180
- description: 'Diagnose and fix environment issues',
56
+ description: 'Environment, dependency, and configuration health check',
181
57
  tier: 'free',
182
- category: 'diagnostics',
58
+ category: 'setup',
183
59
  inputSchema: {
184
60
  type: 'object',
185
61
  properties: {
186
- projectPath: { type: 'string' },
62
+ projectPath: { type: 'string', default: '.' },
187
63
  fix: { type: 'boolean', default: false },
188
- noCache: { type: 'boolean', default: false },
64
+ verbose: { type: 'boolean', default: false },
189
65
  },
190
66
  },
191
- outputSchema: {
192
- type: 'object',
193
- properties: {
194
- success: { type: 'boolean' },
195
- checks: { type: 'array' },
196
- cacheStats: { type: 'object' },
197
- },
198
- },
199
- timeout: 60000, // 1 min
67
+ timeout: 60000,
200
68
  },
201
69
 
202
- 'vibecheck.firewall': {
203
- name: 'vibecheck.firewall',
204
- description: 'Agent Firewall - observe mode (FREE) or enforce mode (PRO)',
70
+ // ═══════════════════════════════════════════════════════════════════════════
71
+ // ANALYSIS (FREE)
72
+ // ═══════════════════════════════════════════════════════════════════════════
73
+
74
+ 'vibecheck.audit': {
75
+ name: 'vibecheck.audit',
76
+ description: 'Analyze codebase for issues (routes, env, auth, security, dead code)',
205
77
  tier: 'free',
206
- category: 'security',
78
+ category: 'analysis',
207
79
  inputSchema: {
208
80
  type: 'object',
209
81
  properties: {
210
- action: { type: 'string', enum: ['check', 'status', 'log'] },
211
- code: { type: 'string' },
212
- file: { type: 'string' },
213
- },
214
- },
215
- outputSchema: {
216
- type: 'object',
217
- properties: {
218
- mode: { type: 'string', enum: ['observe', 'enforce'] },
219
- checked: { type: 'boolean' },
220
- violations: { type: 'array' },
82
+ projectPath: { type: 'string', default: '.' },
83
+ categories: {
84
+ type: 'array',
85
+ items: { type: 'string' },
86
+ description: 'Categories: routes, env, auth, billing, security, dead-code',
87
+ },
88
+ profile: {
89
+ type: 'string',
90
+ enum: ['quick', 'standard', 'full'],
91
+ default: 'standard',
92
+ },
221
93
  },
222
94
  },
223
95
  options: [
224
- { name: 'enforce', tier: 'pro', description: 'Enable enforce mode' },
225
- { name: 'mode', tier: 'pro', description: 'Set mode to enforce' },
96
+ { name: 'fix', tier: 'pro', description: 'Auto-fix issues' },
226
97
  ],
227
- timeout: 60000, // 1 min
98
+ rateLimit: { perMinute: 10 },
99
+ timeout: 300000,
228
100
  },
229
101
 
230
- 'authority.list': {
231
- name: 'authority.list',
232
- description: 'List available authorities',
102
+ // ═══════════════════════════════════════════════════════════════════════════
103
+ // TRUTH (FREE)
104
+ // ═══════════════════════════════════════════════════════════════════════════
105
+
106
+ 'vibecheck.forge': {
107
+ name: 'vibecheck.forge',
108
+ description: 'Generate IDE rules and AI context (.cursorrules, MDC, Copilot)',
233
109
  tier: 'free',
234
- category: 'authority',
110
+ category: 'truth',
235
111
  inputSchema: {
236
112
  type: 'object',
237
113
  properties: {
238
- tier: { type: 'string', enum: ['free', 'pro'] },
239
- },
240
- },
241
- outputSchema: {
242
- type: 'object',
243
- properties: {
244
- success: { type: 'boolean' },
245
- authorities: { type: 'array' },
114
+ projectPath: { type: 'string', default: '.' },
115
+ format: {
116
+ type: 'string',
117
+ enum: ['cursor', 'copilot', 'windsurf', 'all'],
118
+ default: 'all',
119
+ },
246
120
  },
247
121
  },
248
- timeout: 30000, // 30s
122
+ timeout: 60000,
249
123
  },
250
124
 
251
- 'authority.classify': {
252
- name: 'authority.classify',
253
- description: 'Inventory Authority - analyze duplication and legacy code',
125
+ // ═══════════════════════════════════════════════════════════════════════════
126
+ // ENFORCEMENT (FREE base, PRO options)
127
+ // ═══════════════════════════════════════════════════════════════════════════
128
+
129
+ 'vibecheck.shield': {
130
+ name: 'vibecheck.shield',
131
+ description: 'Agent Firewall - intercept, validate, enforce AI actions',
254
132
  tier: 'free',
255
- category: 'authority',
133
+ category: 'enforcement',
256
134
  inputSchema: {
257
135
  type: 'object',
258
136
  properties: {
137
+ action: {
138
+ type: 'string',
139
+ enum: ['status', 'verify', 'enforce', 'observe', 'lock', 'unlock', 'install', 'stats', 'check'],
140
+ default: 'status',
141
+ },
142
+ code: { type: 'string', description: 'Code to verify' },
143
+ file: { type: 'string', description: 'File path' },
144
+ claims: { type: 'boolean', default: false },
145
+ prompts: { type: 'boolean', default: false },
259
146
  projectPath: { type: 'string', default: '.' },
260
- includeNear: { type: 'boolean', default: true },
261
- format: { type: 'string', enum: ['json', 'table', 'markdown'], default: 'json' },
262
147
  },
263
148
  },
264
- outputSchema: {
265
- type: 'object',
266
- properties: {
267
- success: { type: 'boolean' },
268
- classification: { type: 'object' },
269
- },
270
- },
271
- timeout: 120000, // 2 min
149
+ options: [
150
+ { name: 'enforce', tier: 'pro', description: 'Enable enforce mode' },
151
+ { name: 'lock', tier: 'pro', description: 'Enable repo-lock mode' },
152
+ { name: 'install', tier: 'pro', description: 'Install IDE hooks' },
153
+ { name: 'check', tier: 'pro', description: 'v2 enforcement check' },
154
+ ],
155
+ timeout: 120000,
272
156
  },
273
157
 
274
- 'vibecheck_conductor_status': {
275
- name: 'vibecheck_conductor_status',
276
- description: 'Get multi-agent coordination status',
158
+ 'vibecheck.intent': {
159
+ name: 'vibecheck.intent',
160
+ description: 'Declare and manage AI session intent for enforcement',
277
161
  tier: 'free',
278
- category: 'conductor',
162
+ category: 'enforcement',
279
163
  inputSchema: {
280
164
  type: 'object',
281
165
  properties: {
282
- projectRoot: { type: 'string' },
283
- includeDetails: { type: 'boolean', default: false },
284
- },
285
- required: ['projectRoot'],
286
- },
287
- outputSchema: {
288
- type: 'object',
289
- properties: {
290
- success: { type: 'boolean' },
291
- status: { type: 'object' },
166
+ action: {
167
+ type: 'string',
168
+ enum: ['set', 'show', 'clear', 'history'],
169
+ default: 'show',
170
+ },
171
+ summary: { type: 'string', description: 'Intent summary (for set action)' },
172
+ constraints: { type: 'array', items: { type: 'string' } },
173
+ projectPath: { type: 'string', default: '.' },
292
174
  },
293
175
  },
294
- timeout: 30000, // 30s
176
+ timeout: 30000,
295
177
  },
296
178
 
297
179
  // ═══════════════════════════════════════════════════════════════════════════
298
- // PRO TOOLS
180
+ // PROOF (PRO)
299
181
  // ═══════════════════════════════════════════════════════════════════════════
300
182
 
301
183
  'vibecheck.ship': {
302
184
  name: 'vibecheck.ship',
303
- description: 'Get ship verdict: SHIP | WARN | BLOCK',
185
+ description: 'Verdict engine - SHIP/WARN/BLOCK with evidence-backed decision',
304
186
  tier: 'pro',
305
- category: 'verdicts',
187
+ category: 'proof',
306
188
  inputSchema: {
307
189
  type: 'object',
308
190
  properties: {
309
- projectPath: { type: 'string' },
310
- strict: { type: 'boolean' },
311
- since: { type: 'string' },
312
- noCache: { type: 'boolean', default: false },
313
- },
314
- required: ['projectPath'],
315
- },
316
- outputSchema: {
317
- type: 'object',
318
- properties: {
319
- success: { type: 'boolean' },
320
- verdict: { type: 'string', enum: ['SHIP', 'WARN', 'BLOCK'] },
321
- reasons: { type: 'array' },
322
- cacheStats: { type: 'object' },
191
+ projectPath: { type: 'string', default: '.' },
192
+ strict: { type: 'boolean', default: false },
193
+ badge: { type: 'boolean', default: false },
323
194
  },
324
195
  },
325
- rateLimit: { perMinute: 10 },
326
- timeout: 300000, // 5 min
196
+ timeout: 300000,
327
197
  },
328
198
 
329
199
  'vibecheck.fix': {
330
200
  name: 'vibecheck.fix',
331
- description: 'AI-powered fixes with proof',
201
+ description: 'AI-powered auto-fix for detected findings',
332
202
  tier: 'pro',
333
- category: 'fixes',
203
+ category: 'proof',
334
204
  inputSchema: {
335
205
  type: 'object',
336
206
  properties: {
337
- projectPath: { type: 'string' },
338
- mode: { type: 'string', enum: ['plan', 'apply', 'loop'], default: 'plan' },
207
+ projectPath: { type: 'string', default: '.' },
208
+ mode: {
209
+ type: 'string',
210
+ enum: ['plan', 'apply', 'loop'],
211
+ default: 'plan',
212
+ },
339
213
  findingIds: { type: 'array', items: { type: 'string' } },
340
- },
341
- required: ['projectPath'],
342
- },
343
- outputSchema: {
344
- type: 'object',
345
- properties: {
346
- success: { type: 'boolean' },
347
- plan: { type: 'array' },
348
- applied: { type: 'boolean' },
214
+ dryRun: { type: 'boolean', default: false },
349
215
  },
350
216
  },
351
- options: [
352
- { name: 'apply', tier: 'pro', description: 'Apply fixes' },
353
- { name: 'loop', tier: 'pro', description: 'Loop mode' },
354
- ],
355
- timeout: 600000, // 10 min
217
+ timeout: 600000,
356
218
  },
357
219
 
358
220
  'vibecheck.prove': {
@@ -363,72 +225,18 @@ const TOOL_REGISTRY = {
363
225
  inputSchema: {
364
226
  type: 'object',
365
227
  properties: {
366
- projectPath: { type: 'string' },
228
+ projectPath: { type: 'string', default: '.' },
367
229
  url: { type: 'string' },
368
230
  maxIterations: { type: 'number', default: 5 },
369
231
  recordVideo: { type: 'boolean', default: true },
370
232
  },
371
- required: ['projectPath'],
372
233
  },
373
- outputSchema: {
374
- type: 'object',
375
- properties: {
376
- success: { type: 'boolean' },
377
- proof: { type: 'object' },
378
- },
379
- },
380
- timeout: 600000, // 10 min
381
- },
382
-
383
- 'vibecheck.gate': {
384
- name: 'vibecheck.gate',
385
- description: 'CI/CD enforcement - fail builds on issues',
386
- tier: 'pro',
387
- category: 'enforcement',
388
- inputSchema: {
389
- type: 'object',
390
- properties: {
391
- projectPath: { type: 'string' },
392
- strict: { type: 'boolean' },
393
- },
394
- required: ['projectPath'],
395
- },
396
- outputSchema: {
397
- type: 'object',
398
- properties: {
399
- success: { type: 'boolean' },
400
- passed: { type: 'boolean' },
401
- },
402
- },
403
- timeout: 300000, // 5 min
404
- },
405
-
406
- 'vibecheck.badge': {
407
- name: 'vibecheck.badge',
408
- description: 'Generate ship badge',
409
- tier: 'pro',
410
- category: 'reporting',
411
- inputSchema: {
412
- type: 'object',
413
- properties: {
414
- projectPath: { type: 'string' },
415
- outputPath: { type: 'string' },
416
- },
417
- required: ['projectPath'],
418
- },
419
- outputSchema: {
420
- type: 'object',
421
- properties: {
422
- success: { type: 'boolean' },
423
- badge: { type: 'string' },
424
- },
425
- },
426
- timeout: 120000, // 2 min
234
+ timeout: 900000,
427
235
  },
428
236
 
429
237
  'vibecheck.reality': {
430
238
  name: 'vibecheck.reality',
431
- description: 'Full runtime verification with auth boundary testing',
239
+ description: 'Browser-based runtime verification with auth boundary testing',
432
240
  tier: 'pro',
433
241
  category: 'proof',
434
242
  inputSchema: {
@@ -436,263 +244,256 @@ const TOOL_REGISTRY = {
436
244
  properties: {
437
245
  url: { type: 'string' },
438
246
  auth: { type: 'string' },
439
- headed: { type: 'boolean' },
247
+ headed: { type: 'boolean', default: false },
440
248
  maxPages: { type: 'number', default: 20 },
441
249
  },
442
250
  required: ['url'],
443
251
  },
444
- outputSchema: {
445
- type: 'object',
446
- properties: {
447
- success: { type: 'boolean' },
448
- results: { type: 'array' },
449
- },
450
- },
451
- options: [
452
- { name: 'full', tier: 'pro', description: 'Full mode' },
453
- { name: 'auth', tier: 'pro', description: 'Auth boundary testing' },
454
- ],
455
- timeout: 300000, // 5 min
252
+ timeout: 600000,
456
253
  },
457
254
 
458
- 'vibecheck.ai_test': {
459
- name: 'vibecheck.ai_test',
460
- description: 'AI agent testing - autonomous exploration',
255
+ 'vibecheck.checkpoint': {
256
+ name: 'vibecheck.checkpoint',
257
+ description: 'Compare baseline vs current state',
461
258
  tier: 'pro',
462
- category: 'testing',
259
+ category: 'proof',
463
260
  inputSchema: {
464
261
  type: 'object',
465
262
  properties: {
466
- url: { type: 'string' },
467
- goal: { type: 'string' },
468
- maxActions: { type: 'number', default: 50 },
469
- },
470
- required: ['url'],
471
- },
472
- outputSchema: {
473
- type: 'object',
474
- properties: {
475
- success: { type: 'boolean' },
476
- testResults: { type: 'array' },
263
+ projectPath: { type: 'string', default: '.' },
264
+ baseline: { type: 'string' },
477
265
  },
478
266
  },
479
- timeout: 300000, // 5 min
267
+ timeout: 120000,
480
268
  },
481
269
 
482
- 'vibecheck.share': {
483
- name: 'vibecheck.share',
484
- description: 'Generate PR/review bundle',
270
+ // ═══════════════════════════════════════════════════════════════════════════
271
+ // AUTOMATION (PRO)
272
+ // ═══════════════════════════════════════════════════════════════════════════
273
+
274
+ 'vibecheck.launch': {
275
+ name: 'vibecheck.launch',
276
+ description: 'CI/CD enforcement - preflight checks and deploy gates',
485
277
  tier: 'pro',
486
- category: 'reporting',
278
+ category: 'automation',
487
279
  inputSchema: {
488
280
  type: 'object',
489
281
  properties: {
490
- projectPath: { type: 'string' },
491
- format: { type: 'string', enum: ['github', 'gitlab', 'slack', 'json'], default: 'github' },
492
- },
493
- required: ['projectPath'],
494
- },
495
- outputSchema: {
496
- type: 'object',
497
- properties: {
498
- success: { type: 'boolean' },
499
- bundle: { type: 'object' },
282
+ projectPath: { type: 'string', default: '.' },
283
+ action: {
284
+ type: 'string',
285
+ enum: ['preflight', 'prelaunch', 'check'],
286
+ default: 'preflight',
287
+ },
288
+ strict: { type: 'boolean', default: false },
500
289
  },
501
290
  },
502
- timeout: 120000, // 2 min
291
+ timeout: 300000,
503
292
  },
504
293
 
505
- 'authority.approve': {
506
- name: 'authority.approve',
507
- description: 'Execute authority & get verdict (PROCEED/STOP/DEFER)',
508
- tier: 'pro',
509
- category: 'authority',
294
+ // ═══════════════════════════════════════════════════════════════════════════
295
+ // OUTPUT (FREE base, PRO options)
296
+ // ═══════════════════════════════════════════════════════════════════════════
297
+
298
+ 'vibecheck.packs': {
299
+ name: 'vibecheck.packs',
300
+ description: 'Generate shareable artifact packs: reports, evidence, proof graphs',
301
+ tier: 'free',
302
+ category: 'output',
510
303
  inputSchema: {
511
304
  type: 'object',
512
305
  properties: {
513
- authority: { type: 'string' },
306
+ action: {
307
+ type: 'string',
308
+ enum: ['evidence', 'report', 'graph', 'permissions', 'manifest'],
309
+ default: 'evidence',
310
+ },
514
311
  projectPath: { type: 'string', default: '.' },
515
- dryRun: { type: 'boolean', default: false },
516
- },
517
- required: ['authority'],
518
- },
519
- outputSchema: {
520
- type: 'object',
521
- properties: {
522
- success: { type: 'boolean' },
523
- verdict: { type: 'string', enum: ['PROCEED', 'STOP', 'DEFER'] },
524
- proof: { type: 'object' },
312
+ format: {
313
+ type: 'string',
314
+ enum: ['html', 'md', 'sarif', 'json', 'csv', 'pdf', 'dot', 'mermaid'],
315
+ default: 'html',
316
+ },
317
+ output: { type: 'string' },
525
318
  },
526
319
  },
527
- timeout: 300000, // 5 min
320
+ timeout: 120000,
528
321
  },
529
322
 
530
- 'vibecheck_conductor_register': {
531
- name: 'vibecheck_conductor_register',
532
- description: 'Register AI agent for multi-agent coordination',
323
+ 'vibecheck.seal': {
324
+ name: 'vibecheck.seal',
325
+ description: 'Generate verification seal/badge with cryptographic attestation',
533
326
  tier: 'pro',
534
- category: 'conductor',
327
+ category: 'output',
535
328
  inputSchema: {
536
329
  type: 'object',
537
330
  properties: {
538
- agentId: { type: 'string' },
539
- projectRoot: { type: 'string' },
540
- workingFiles: { type: 'array', items: { type: 'string' } },
541
- },
542
- required: ['agentId', 'projectRoot'],
543
- },
544
- outputSchema: {
545
- type: 'object',
546
- properties: {
547
- success: { type: 'boolean' },
548
- sessionId: { type: 'string' },
331
+ projectPath: { type: 'string', default: '.' },
332
+ format: {
333
+ type: 'string',
334
+ enum: ['svg', 'png', 'json'],
335
+ default: 'svg',
336
+ },
337
+ output: { type: 'string' },
338
+ attest: { type: 'boolean', default: false },
549
339
  },
550
340
  },
551
- timeout: 30000, // 30s
341
+ timeout: 60000,
552
342
  },
553
343
 
554
- 'vibecheck_conductor_acquire_lock': {
555
- name: 'vibecheck_conductor_acquire_lock',
556
- description: 'Acquire lock on file/folder for exclusive access',
557
- tier: 'pro',
558
- category: 'conductor',
344
+ // ═══════════════════════════════════════════════════════════════════════════
345
+ // CONFIG (FREE)
346
+ // ═══════════════════════════════════════════════════════════════════════════
347
+
348
+ 'vibecheck.safelist': {
349
+ name: 'vibecheck.safelist',
350
+ description: 'Manage finding safelist for false positives',
351
+ tier: 'free',
352
+ category: 'config',
559
353
  inputSchema: {
560
354
  type: 'object',
561
355
  properties: {
562
- sessionId: { type: 'string' },
563
- path: { type: 'string' },
564
- type: { type: 'string', enum: ['exclusive', 'shared'], default: 'exclusive' },
356
+ projectPath: { type: 'string', default: '.' },
357
+ action: {
358
+ type: 'string',
359
+ enum: ['list', 'add', 'remove'],
360
+ default: 'list',
361
+ },
362
+ id: { type: 'string' },
363
+ pattern: { type: 'string' },
565
364
  reason: { type: 'string' },
566
365
  },
567
- required: ['sessionId', 'path'],
568
366
  },
569
- outputSchema: {
367
+ timeout: 30000,
368
+ },
369
+
370
+ // ═══════════════════════════════════════════════════════════════════════════
371
+ // ACCOUNT (FREE)
372
+ // ═══════════════════════════════════════════════════════════════════════════
373
+
374
+ 'vibecheck.auth': {
375
+ name: 'vibecheck.auth',
376
+ description: 'Authentication management: login, logout, whoami',
377
+ tier: 'free',
378
+ category: 'account',
379
+ inputSchema: {
570
380
  type: 'object',
571
381
  properties: {
572
- success: { type: 'boolean' },
573
- lockId: { type: 'string' },
382
+ action: {
383
+ type: 'string',
384
+ enum: ['login', 'logout', 'whoami', 'status'],
385
+ default: 'whoami',
386
+ },
387
+ apiKey: { type: 'string' },
574
388
  },
575
389
  },
576
- timeout: 30000, // 30s
390
+ timeout: 30000,
577
391
  },
578
392
 
579
- 'vibecheck_conductor_release_lock': {
580
- name: 'vibecheck_conductor_release_lock',
581
- description: 'Release a previously acquired lock',
393
+ // ═══════════════════════════════════════════════════════════════════════════
394
+ // AUTHORITY (PRO)
395
+ // ═══════════════════════════════════════════════════════════════════════════
396
+
397
+ 'vibecheck.approve': {
398
+ name: 'vibecheck.approve',
399
+ description: 'Authority verdicts - PROCEED/STOP/DEFER with proofs',
582
400
  tier: 'pro',
583
- category: 'conductor',
401
+ category: 'authority',
584
402
  inputSchema: {
585
403
  type: 'object',
586
404
  properties: {
587
- lockId: { type: 'string' },
588
- sessionId: { type: 'string' },
589
- },
590
- required: ['lockId', 'sessionId'],
591
- },
592
- outputSchema: {
593
- type: 'object',
594
- properties: {
595
- success: { type: 'boolean' },
405
+ authority: { type: 'string' },
406
+ projectPath: { type: 'string', default: '.' },
407
+ dryRun: { type: 'boolean', default: false },
596
408
  },
409
+ required: ['authority'],
597
410
  },
598
- timeout: 30000, // 30s
411
+ timeout: 300000,
599
412
  },
600
413
 
601
- 'vibecheck_conductor_propose': {
602
- name: 'vibecheck_conductor_propose',
603
- description: 'Submit change proposal for multi-agent coordination',
414
+ // ═══════════════════════════════════════════════════════════════════════════
415
+ // QUALITY (PRO)
416
+ // ═══════════════════════════════════════════════════════════════════════════
417
+
418
+ 'vibecheck.polish': {
419
+ name: 'vibecheck.polish',
420
+ description: 'Code polish and cleanup',
604
421
  tier: 'pro',
605
- category: 'conductor',
422
+ category: 'quality',
606
423
  inputSchema: {
607
424
  type: 'object',
608
425
  properties: {
609
- sessionId: { type: 'string' },
610
- proposalId: { type: 'string' },
611
- intent: { type: 'string' },
612
- operations: {
613
- type: 'array',
614
- items: {
615
- type: 'object',
616
- properties: {
617
- type: { type: 'string', enum: ['create', 'modify', 'delete', 'move'] },
618
- path: { type: 'string' },
619
- content: { type: 'string' },
620
- },
621
- },
426
+ projectPath: { type: 'string', default: '.' },
427
+ scope: {
428
+ type: 'string',
429
+ enum: ['all', 'lint', 'format', 'imports'],
430
+ default: 'all',
622
431
  },
623
- projectRoot: { type: 'string' },
624
- },
625
- required: ['sessionId', 'proposalId', 'intent', 'operations', 'projectRoot'],
626
- },
627
- outputSchema: {
628
- type: 'object',
629
- properties: {
630
- success: { type: 'boolean' },
631
- approved: { type: 'boolean' },
632
432
  },
633
433
  },
634
- timeout: 60000, // 1 min
434
+ timeout: 300000,
635
435
  },
636
436
 
637
- 'vibecheck_conductor_terminate': {
638
- name: 'vibecheck_conductor_terminate',
639
- description: 'Terminate agent session and release all locks',
640
- tier: 'pro',
641
- category: 'conductor',
437
+ // ═══════════════════════════════════════════════════════════════════════════
438
+ // LABS (FREE)
439
+ // ═══════════════════════════════════════════════════════════════════════════
440
+
441
+ 'vibecheck.labs': {
442
+ name: 'vibecheck.labs',
443
+ description: 'Access experimental features',
444
+ tier: 'free',
445
+ category: 'experimental',
642
446
  inputSchema: {
643
447
  type: 'object',
644
448
  properties: {
645
- sessionId: { type: 'string' },
646
- },
647
- required: ['sessionId'],
648
- },
649
- outputSchema: {
650
- type: 'object',
651
- properties: {
652
- success: { type: 'boolean' },
449
+ feature: { type: 'string' },
450
+ projectPath: { type: 'string', default: '.' },
653
451
  },
654
452
  },
655
- timeout: 30000, // 30s
453
+ timeout: 60000,
656
454
  },
657
455
 
658
- 'vibecheck_agent_firewall_intercept': {
659
- name: 'vibecheck_agent_firewall_intercept',
660
- description: 'Agent Firewall (Sentinel) - ENFORCE MODE',
661
- tier: 'pro',
662
- category: 'security',
456
+ // ═══════════════════════════════════════════════════════════════════════════
457
+ // MCP SERVER (FREE)
458
+ // ═══════════════════════════════════════════════════════════════════════════
459
+
460
+ 'vibecheck.health': {
461
+ name: 'vibecheck.health',
462
+ description: 'MCP server health check - returns server status, version, and diagnostics',
463
+ tier: 'free',
464
+ category: 'setup',
663
465
  inputSchema: {
664
466
  type: 'object',
665
- properties: {
666
- agentId: { type: 'string' },
667
- filePath: { type: 'string' },
668
- content: { type: 'string' },
669
- operation: { type: 'string', enum: ['create', 'modify', 'delete'], default: 'modify' },
670
- intent: { type: 'string' },
671
- projectRoot: { type: 'string' },
672
- },
673
- required: ['agentId', 'filePath', 'content'],
467
+ properties: {},
674
468
  },
675
- outputSchema: {
469
+ timeout: 5000,
470
+ },
471
+
472
+ 'vibecheck.manifest': {
473
+ name: 'vibecheck.manifest',
474
+ description: 'Get the complete tool manifest with schemas and documentation',
475
+ tier: 'free',
476
+ category: 'setup',
477
+ inputSchema: {
676
478
  type: 'object',
677
479
  properties: {
678
- allowed: { type: 'boolean' },
679
- violations: { type: 'array' },
680
- proof: { type: 'object' },
480
+ format: {
481
+ type: 'string',
482
+ enum: ['json', 'summary'],
483
+ default: 'summary',
484
+ },
681
485
  },
682
486
  },
683
- timeout: 120000, // 2 min
487
+ timeout: 5000,
684
488
  },
685
489
  };
686
490
 
687
491
  // ============================================================================
688
- // VALIDATION FUNCTIONS
492
+ // HELPER FUNCTIONS
689
493
  // ============================================================================
690
494
 
691
495
  /**
692
496
  * Validate tool input against JSON Schema
693
- * @param {string} toolName - Tool name
694
- * @param {unknown} input - Input to validate
695
- * @returns {{ valid: boolean, errors?: string[] }}
696
497
  */
697
498
  function validateToolInput(toolName, input) {
698
499
  const tool = TOOL_REGISTRY[toolName];
@@ -701,7 +502,6 @@ function validateToolInput(toolName, input) {
701
502
  }
702
503
 
703
504
  const validate = ajv.compile(tool.inputSchema);
704
-
705
505
  if (!validate(input)) {
706
506
  return {
707
507
  valid: false,
@@ -712,62 +512,29 @@ function validateToolInput(toolName, input) {
712
512
  return { valid: true };
713
513
  }
714
514
 
715
- /**
716
- * Validate tool output against JSON Schema (warns on mismatch, doesn't fail)
717
- * @param {string} toolName - Tool name
718
- * @param {unknown} output - Output to validate
719
- * @returns {{ valid: boolean, errors?: string[] }}
720
- */
721
- function validateToolOutput(toolName, output) {
722
- const tool = TOOL_REGISTRY[toolName];
723
- if (!tool || !tool.outputSchema) {
724
- return { valid: true }; // Unknown tool or no schema, skip validation
725
- }
726
-
727
- const validate = ajv.compile(tool.outputSchema);
728
-
729
- if (!validate(output)) {
730
- // Log warning but don't fail - output validation is advisory
731
- console.warn(`[MCP] Tool ${toolName} output validation failed:`, validate.errors);
732
- return {
733
- valid: false,
734
- errors: validate.errors?.map((e) => `${e.instancePath || '/'} ${e.message}`) || ['Validation failed'],
735
- };
736
- }
737
-
738
- return { valid: true };
739
- }
740
-
741
515
  /**
742
516
  * Get tool tier requirement
743
- * @param {string} toolName - Tool name
744
- * @returns {'free'|'pro'} Tier requirement (defaults to 'pro' for unknown tools)
745
517
  */
746
518
  function getToolTier(toolName) {
747
- return TOOL_REGISTRY[toolName]?.tier || 'pro'; // Default to PRO for unknown tools
519
+ return TOOL_REGISTRY[toolName]?.tier || 'pro';
748
520
  }
749
521
 
750
522
  /**
751
523
  * Get tool timeout
752
- * @param {string} toolName - Tool name
753
- * @returns {number} Timeout in milliseconds (defaults to 30000)
754
524
  */
755
525
  function getToolTimeout(toolName) {
756
- return TOOL_REGISTRY[toolName]?.timeout || 30000; // Default 30s
526
+ return TOOL_REGISTRY[toolName]?.timeout || 30000;
757
527
  }
758
528
 
759
529
  /**
760
- * Get tool rate limit override (if any)
761
- * @param {string} toolName - Tool name
762
- * @returns {{perMinute: number, perHour?: number}|null} Rate limit override or null
530
+ * Get tool rate limit
763
531
  */
764
532
  function getToolRateLimit(toolName) {
765
533
  return TOOL_REGISTRY[toolName]?.rateLimit || null;
766
534
  }
767
535
 
768
536
  /**
769
- * Get all registered tool names
770
- * @returns {string[]} Array of tool names
537
+ * Get all tool names
771
538
  */
772
539
  function getAllToolNames() {
773
540
  return Object.keys(TOOL_REGISTRY);
@@ -775,20 +542,45 @@ function getAllToolNames() {
775
542
 
776
543
  /**
777
544
  * Get tool definition
778
- * @param {string} toolName - Tool name
779
- * @returns {ToolDefinition|undefined} Tool definition
780
545
  */
781
546
  function getToolDefinition(toolName) {
782
547
  return TOOL_REGISTRY[toolName];
783
548
  }
784
549
 
550
+ /**
551
+ * Check if tool exists
552
+ */
553
+ function isValidTool(toolName) {
554
+ return toolName in TOOL_REGISTRY;
555
+ }
556
+
557
+ /**
558
+ * Get tools by tier
559
+ */
560
+ function getToolsByTier(tier) {
561
+ return Object.entries(TOOL_REGISTRY)
562
+ .filter(([, tool]) => tool.tier === tier)
563
+ .map(([name]) => name);
564
+ }
565
+
566
+ /**
567
+ * Get tools by category
568
+ */
569
+ function getToolsByCategory(category) {
570
+ return Object.entries(TOOL_REGISTRY)
571
+ .filter(([, tool]) => tool.category === category)
572
+ .map(([name]) => name);
573
+ }
574
+
785
575
  module.exports = {
786
576
  TOOL_REGISTRY,
787
577
  validateToolInput,
788
- validateToolOutput,
789
578
  getToolTier,
790
579
  getToolTimeout,
791
580
  getToolRateLimit,
792
581
  getAllToolNames,
793
582
  getToolDefinition,
583
+ isValidTool,
584
+ getToolsByTier,
585
+ getToolsByCategory,
794
586
  };