@vibecheckai/cli 3.5.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/bin/registry.js +174 -449
  2. package/bin/runners/cli-utils.js +33 -2
  3. package/bin/runners/context/generators/cursor.js +2 -49
  4. package/bin/runners/context/generators/mcp.js +13 -15
  5. package/bin/runners/context/proof-context.js +1 -248
  6. package/bin/runners/lib/analysis-core.js +180 -198
  7. package/bin/runners/lib/analyzers.js +241 -2212
  8. package/bin/runners/lib/cli-output.js +210 -242
  9. package/bin/runners/lib/detectors-v2.js +785 -547
  10. package/bin/runners/lib/entitlements-v2.js +431 -161
  11. package/bin/runners/lib/error-handler.js +9 -16
  12. package/bin/runners/lib/global-flags.js +0 -37
  13. package/bin/runners/lib/html-proof-report.js +700 -350
  14. package/bin/runners/lib/missions/plan.js +6 -46
  15. package/bin/runners/lib/missions/templates.js +0 -232
  16. package/bin/runners/lib/route-truth.js +322 -1167
  17. package/bin/runners/lib/scan-output.js +467 -493
  18. package/bin/runners/lib/ship-output.js +27 -280
  19. package/bin/runners/lib/terminal-ui.js +700 -310
  20. package/bin/runners/lib/truth.js +321 -1004
  21. package/bin/runners/lib/unified-output.js +158 -162
  22. package/bin/runners/lib/upsell.js +204 -104
  23. package/bin/runners/runAIAgent.js +10 -5
  24. package/bin/runners/runAllowlist.js +324 -0
  25. package/bin/runners/runAuth.js +94 -344
  26. package/bin/runners/runCheckpoint.js +45 -43
  27. package/bin/runners/runContext.js +24 -139
  28. package/bin/runners/runDoctor.js +101 -136
  29. package/bin/runners/runEvidencePack.js +219 -0
  30. package/bin/runners/runFix.js +71 -82
  31. package/bin/runners/runGuard.js +119 -606
  32. package/bin/runners/runInit.js +60 -22
  33. package/bin/runners/runInstall.js +281 -0
  34. package/bin/runners/runLabs.js +341 -0
  35. package/bin/runners/runMcp.js +62 -139
  36. package/bin/runners/runPolish.js +83 -282
  37. package/bin/runners/runPromptFirewall.js +12 -5
  38. package/bin/runners/runProve.js +58 -33
  39. package/bin/runners/runReality.js +58 -81
  40. package/bin/runners/runReport.js +7 -34
  41. package/bin/runners/runRuntime.js +8 -5
  42. package/bin/runners/runScan.js +844 -219
  43. package/bin/runners/runShip.js +59 -721
  44. package/bin/runners/runValidate.js +11 -24
  45. package/bin/runners/runWatch.js +76 -131
  46. package/bin/vibecheck.js +69 -295
  47. package/mcp-server/ARCHITECTURE.md +339 -0
  48. package/mcp-server/__tests__/cache.test.ts +313 -0
  49. package/mcp-server/__tests__/executor.test.ts +239 -0
  50. package/mcp-server/__tests__/fixtures/exclusion-test/.cache/webpack/cache.pack +1 -0
  51. package/mcp-server/__tests__/fixtures/exclusion-test/.next/server/chunk.js +3 -0
  52. package/mcp-server/__tests__/fixtures/exclusion-test/.turbo/cache.json +3 -0
  53. package/mcp-server/__tests__/fixtures/exclusion-test/.venv/lib/env.py +3 -0
  54. package/mcp-server/__tests__/fixtures/exclusion-test/dist/bundle.js +3 -0
  55. package/mcp-server/__tests__/fixtures/exclusion-test/package.json +5 -0
  56. package/mcp-server/__tests__/fixtures/exclusion-test/src/app.ts +5 -0
  57. package/mcp-server/__tests__/fixtures/exclusion-test/venv/lib/config.py +4 -0
  58. package/mcp-server/__tests__/ids.test.ts +345 -0
  59. package/mcp-server/__tests__/integration/tools.test.ts +410 -0
  60. package/mcp-server/__tests__/registry.test.ts +365 -0
  61. package/mcp-server/__tests__/sandbox.test.ts +323 -0
  62. package/mcp-server/__tests__/schemas.test.ts +372 -0
  63. package/mcp-server/benchmarks/run-benchmarks.ts +304 -0
  64. package/mcp-server/examples/doctor.request.json +14 -0
  65. package/mcp-server/examples/doctor.response.json +53 -0
  66. package/mcp-server/examples/error.response.json +15 -0
  67. package/mcp-server/examples/scan.request.json +14 -0
  68. package/mcp-server/examples/scan.response.json +108 -0
  69. package/mcp-server/handlers/tool-handler.ts +671 -0
  70. package/mcp-server/index-v1.js +698 -0
  71. package/mcp-server/index-v3.ts +293 -0
  72. package/mcp-server/index.js +1080 -1757
  73. package/mcp-server/index.old.js +4137 -0
  74. package/mcp-server/lib/cache.ts +341 -0
  75. package/mcp-server/lib/errors.ts +346 -0
  76. package/mcp-server/lib/executor.ts +792 -0
  77. package/mcp-server/lib/ids.ts +238 -0
  78. package/mcp-server/lib/logger.ts +368 -0
  79. package/mcp-server/lib/metrics.ts +365 -0
  80. package/mcp-server/lib/sandbox.ts +337 -0
  81. package/mcp-server/lib/validator.ts +229 -0
  82. package/mcp-server/package-lock.json +165 -0
  83. package/mcp-server/package.json +32 -7
  84. package/mcp-server/premium-tools.js +2 -2
  85. package/mcp-server/registry/tools.json +476 -0
  86. package/mcp-server/schemas/error-envelope.schema.json +125 -0
  87. package/mcp-server/schemas/finding.schema.json +167 -0
  88. package/mcp-server/schemas/report-artifact.schema.json +88 -0
  89. package/mcp-server/schemas/run-request.schema.json +75 -0
  90. package/mcp-server/schemas/verdict.schema.json +168 -0
  91. package/mcp-server/tier-auth.d.ts +71 -0
  92. package/mcp-server/tier-auth.js +371 -183
  93. package/mcp-server/truth-context.js +90 -131
  94. package/mcp-server/truth-firewall-tools.js +1000 -1611
  95. package/mcp-server/tsconfig.json +34 -0
  96. package/mcp-server/vibecheck-tools.js +2 -2
  97. package/mcp-server/vitest.config.ts +16 -0
  98. package/package.json +3 -4
  99. package/bin/runners/lib/agent-firewall/ai/false-positive-analyzer.js +0 -474
  100. package/bin/runners/lib/agent-firewall/change-packet/builder.js +0 -488
  101. package/bin/runners/lib/agent-firewall/change-packet/schema.json +0 -228
  102. package/bin/runners/lib/agent-firewall/change-packet/store.js +0 -200
  103. package/bin/runners/lib/agent-firewall/claims/claim-types.js +0 -21
  104. package/bin/runners/lib/agent-firewall/claims/extractor.js +0 -303
  105. package/bin/runners/lib/agent-firewall/claims/patterns.js +0 -24
  106. package/bin/runners/lib/agent-firewall/critic/index.js +0 -151
  107. package/bin/runners/lib/agent-firewall/critic/judge.js +0 -432
  108. package/bin/runners/lib/agent-firewall/critic/prompts.js +0 -305
  109. package/bin/runners/lib/agent-firewall/evidence/auth-evidence.js +0 -88
  110. package/bin/runners/lib/agent-firewall/evidence/contract-evidence.js +0 -75
  111. package/bin/runners/lib/agent-firewall/evidence/env-evidence.js +0 -127
  112. package/bin/runners/lib/agent-firewall/evidence/resolver.js +0 -102
  113. package/bin/runners/lib/agent-firewall/evidence/route-evidence.js +0 -213
  114. package/bin/runners/lib/agent-firewall/evidence/side-effect-evidence.js +0 -145
  115. package/bin/runners/lib/agent-firewall/fs-hook/daemon.js +0 -19
  116. package/bin/runners/lib/agent-firewall/fs-hook/installer.js +0 -87
  117. package/bin/runners/lib/agent-firewall/fs-hook/watcher.js +0 -184
  118. package/bin/runners/lib/agent-firewall/git-hook/pre-commit.js +0 -163
  119. package/bin/runners/lib/agent-firewall/ide-extension/cursor.js +0 -107
  120. package/bin/runners/lib/agent-firewall/ide-extension/vscode.js +0 -68
  121. package/bin/runners/lib/agent-firewall/ide-extension/windsurf.js +0 -66
  122. package/bin/runners/lib/agent-firewall/interceptor/base.js +0 -304
  123. package/bin/runners/lib/agent-firewall/interceptor/cursor.js +0 -35
  124. package/bin/runners/lib/agent-firewall/interceptor/vscode.js +0 -35
  125. package/bin/runners/lib/agent-firewall/interceptor/windsurf.js +0 -34
  126. package/bin/runners/lib/agent-firewall/lawbook/distributor.js +0 -465
  127. package/bin/runners/lib/agent-firewall/lawbook/evaluator.js +0 -604
  128. package/bin/runners/lib/agent-firewall/lawbook/index.js +0 -304
  129. package/bin/runners/lib/agent-firewall/lawbook/registry.js +0 -514
  130. package/bin/runners/lib/agent-firewall/lawbook/schema.js +0 -420
  131. package/bin/runners/lib/agent-firewall/learning/learning-engine.js +0 -849
  132. package/bin/runners/lib/agent-firewall/logger.js +0 -141
  133. package/bin/runners/lib/agent-firewall/policy/default-policy.json +0 -90
  134. package/bin/runners/lib/agent-firewall/policy/engine.js +0 -103
  135. package/bin/runners/lib/agent-firewall/policy/loader.js +0 -451
  136. package/bin/runners/lib/agent-firewall/policy/rules/auth-drift.js +0 -50
  137. package/bin/runners/lib/agent-firewall/policy/rules/contract-drift.js +0 -50
  138. package/bin/runners/lib/agent-firewall/policy/rules/fake-success.js +0 -86
  139. package/bin/runners/lib/agent-firewall/policy/rules/ghost-env.js +0 -162
  140. package/bin/runners/lib/agent-firewall/policy/rules/ghost-route.js +0 -189
  141. package/bin/runners/lib/agent-firewall/policy/rules/scope.js +0 -93
  142. package/bin/runners/lib/agent-firewall/policy/rules/unsafe-side-effect.js +0 -57
  143. package/bin/runners/lib/agent-firewall/policy/schema.json +0 -183
  144. package/bin/runners/lib/agent-firewall/policy/verdict.js +0 -54
  145. package/bin/runners/lib/agent-firewall/proposal/extractor.js +0 -394
  146. package/bin/runners/lib/agent-firewall/proposal/index.js +0 -212
  147. package/bin/runners/lib/agent-firewall/proposal/schema.js +0 -251
  148. package/bin/runners/lib/agent-firewall/proposal/validator.js +0 -386
  149. package/bin/runners/lib/agent-firewall/reality/index.js +0 -332
  150. package/bin/runners/lib/agent-firewall/reality/state.js +0 -625
  151. package/bin/runners/lib/agent-firewall/reality/watcher.js +0 -322
  152. package/bin/runners/lib/agent-firewall/risk/index.js +0 -173
  153. package/bin/runners/lib/agent-firewall/risk/scorer.js +0 -328
  154. package/bin/runners/lib/agent-firewall/risk/thresholds.js +0 -321
  155. package/bin/runners/lib/agent-firewall/risk/vectors.js +0 -421
  156. package/bin/runners/lib/agent-firewall/simulator/diff-simulator.js +0 -472
  157. package/bin/runners/lib/agent-firewall/simulator/import-resolver.js +0 -346
  158. package/bin/runners/lib/agent-firewall/simulator/index.js +0 -181
  159. package/bin/runners/lib/agent-firewall/simulator/route-validator.js +0 -380
  160. package/bin/runners/lib/agent-firewall/time-machine/incident-correlator.js +0 -661
  161. package/bin/runners/lib/agent-firewall/time-machine/index.js +0 -267
  162. package/bin/runners/lib/agent-firewall/time-machine/replay-engine.js +0 -436
  163. package/bin/runners/lib/agent-firewall/time-machine/state-reconstructor.js +0 -490
  164. package/bin/runners/lib/agent-firewall/time-machine/timeline-builder.js +0 -530
  165. package/bin/runners/lib/agent-firewall/truthpack/index.js +0 -67
  166. package/bin/runners/lib/agent-firewall/truthpack/loader.js +0 -137
  167. package/bin/runners/lib/agent-firewall/unblock/planner.js +0 -337
  168. package/bin/runners/lib/agent-firewall/utils/ignore-checker.js +0 -118
  169. package/bin/runners/lib/api-client.js +0 -269
  170. package/bin/runners/lib/audit-logger.js +0 -532
  171. package/bin/runners/lib/authority/authorities/architecture.js +0 -364
  172. package/bin/runners/lib/authority/authorities/compliance.js +0 -341
  173. package/bin/runners/lib/authority/authorities/human.js +0 -343
  174. package/bin/runners/lib/authority/authorities/quality.js +0 -420
  175. package/bin/runners/lib/authority/authorities/security.js +0 -228
  176. package/bin/runners/lib/authority/index.js +0 -293
  177. package/bin/runners/lib/authority-badge.js +0 -425
  178. package/bin/runners/lib/bundle/bundle-intelligence.js +0 -846
  179. package/bin/runners/lib/cli-charts.js +0 -368
  180. package/bin/runners/lib/cli-config-display.js +0 -405
  181. package/bin/runners/lib/cli-demo.js +0 -275
  182. package/bin/runners/lib/cli-errors.js +0 -438
  183. package/bin/runners/lib/cli-help-formatter.js +0 -439
  184. package/bin/runners/lib/cli-interactive-menu.js +0 -509
  185. package/bin/runners/lib/cli-prompts.js +0 -441
  186. package/bin/runners/lib/cli-scan-cards.js +0 -362
  187. package/bin/runners/lib/compliance-reporter.js +0 -710
  188. package/bin/runners/lib/conductor/index.js +0 -671
  189. package/bin/runners/lib/easy/README.md +0 -123
  190. package/bin/runners/lib/easy/index.js +0 -140
  191. package/bin/runners/lib/easy/interactive-wizard.js +0 -788
  192. package/bin/runners/lib/easy/one-click-firewall.js +0 -564
  193. package/bin/runners/lib/easy/zero-config-reality.js +0 -714
  194. package/bin/runners/lib/engines/accessibility-engine.js +0 -390
  195. package/bin/runners/lib/engines/api-consistency-engine.js +0 -467
  196. package/bin/runners/lib/engines/ast-cache.js +0 -99
  197. package/bin/runners/lib/engines/async-patterns-engine.js +0 -444
  198. package/bin/runners/lib/engines/bundle-size-engine.js +0 -433
  199. package/bin/runners/lib/engines/code-quality-engine.js +0 -255
  200. package/bin/runners/lib/engines/confidence-scoring.js +0 -276
  201. package/bin/runners/lib/engines/console-logs-engine.js +0 -115
  202. package/bin/runners/lib/engines/context-detection.js +0 -264
  203. package/bin/runners/lib/engines/cross-file-analysis-engine.js +0 -533
  204. package/bin/runners/lib/engines/database-patterns-engine.js +0 -429
  205. package/bin/runners/lib/engines/dead-code-engine.js +0 -198
  206. package/bin/runners/lib/engines/deprecated-api-engine.js +0 -226
  207. package/bin/runners/lib/engines/duplicate-code-engine.js +0 -354
  208. package/bin/runners/lib/engines/empty-catch-engine.js +0 -260
  209. package/bin/runners/lib/engines/env-variables-engine.js +0 -458
  210. package/bin/runners/lib/engines/error-handling-engine.js +0 -437
  211. package/bin/runners/lib/engines/false-positive-prevention.js +0 -630
  212. package/bin/runners/lib/engines/file-filter.js +0 -131
  213. package/bin/runners/lib/engines/framework-adapters/index.js +0 -607
  214. package/bin/runners/lib/engines/framework-detection.js +0 -508
  215. package/bin/runners/lib/engines/hardcoded-secrets-engine.js +0 -251
  216. package/bin/runners/lib/engines/import-order-engine.js +0 -429
  217. package/bin/runners/lib/engines/mock-data-engine.js +0 -315
  218. package/bin/runners/lib/engines/naming-conventions-engine.js +0 -544
  219. package/bin/runners/lib/engines/noise-reduction-engine.js +0 -452
  220. package/bin/runners/lib/engines/orchestrator.js +0 -334
  221. package/bin/runners/lib/engines/parallel-processor.js +0 -71
  222. package/bin/runners/lib/engines/performance-issues-engine.js +0 -405
  223. package/bin/runners/lib/engines/react-patterns-engine.js +0 -457
  224. package/bin/runners/lib/engines/security-vulnerabilities-engine.js +0 -571
  225. package/bin/runners/lib/engines/todo-fixme-engine.js +0 -115
  226. package/bin/runners/lib/engines/type-aware-engine.js +0 -376
  227. package/bin/runners/lib/engines/unsafe-regex-engine.js +0 -225
  228. package/bin/runners/lib/engines/vibecheck-engines/README.md +0 -53
  229. package/bin/runners/lib/engines/vibecheck-engines/index.js +0 -124
  230. package/bin/runners/lib/engines/vibecheck-engines/lib/ai-hallucination-engine.js +0 -806
  231. package/bin/runners/lib/engines/vibecheck-engines/lib/hardcoded-secrets-engine.js +0 -439
  232. package/bin/runners/lib/engines/vibecheck-engines/lib/smart-fix-engine.js +0 -577
  233. package/bin/runners/lib/engines/vibecheck-engines/lib/vibe-score-engine.js +0 -543
  234. package/bin/runners/lib/engines/vibecheck-engines/package.json +0 -13
  235. package/bin/runners/lib/engines/vibecheck-engines.js +0 -514
  236. package/bin/runners/lib/enhanced-features/index.js +0 -305
  237. package/bin/runners/lib/enhanced-output.js +0 -631
  238. package/bin/runners/lib/enterprise.js +0 -300
  239. package/bin/runners/lib/exit-codes.js +0 -275
  240. package/bin/runners/lib/fingerprint.js +0 -377
  241. package/bin/runners/lib/firewall/command-validator.js +0 -351
  242. package/bin/runners/lib/firewall/config.js +0 -341
  243. package/bin/runners/lib/firewall/content-validator.js +0 -519
  244. package/bin/runners/lib/firewall/index.js +0 -101
  245. package/bin/runners/lib/firewall/path-validator.js +0 -256
  246. package/bin/runners/lib/help-formatter.js +0 -413
  247. package/bin/runners/lib/intelligence/cross-repo-intelligence.js +0 -817
  248. package/bin/runners/lib/logger.js +0 -38
  249. package/bin/runners/lib/mcp-utils.js +0 -425
  250. package/bin/runners/lib/output/index.js +0 -1022
  251. package/bin/runners/lib/policy-engine.js +0 -652
  252. package/bin/runners/lib/polish/autofix/accessibility-fixes.js +0 -333
  253. package/bin/runners/lib/polish/autofix/async-handlers.js +0 -273
  254. package/bin/runners/lib/polish/autofix/dead-code.js +0 -280
  255. package/bin/runners/lib/polish/autofix/imports-optimizer.js +0 -344
  256. package/bin/runners/lib/polish/autofix/index.js +0 -200
  257. package/bin/runners/lib/polish/autofix/remove-consoles.js +0 -209
  258. package/bin/runners/lib/polish/autofix/strengthen-types.js +0 -245
  259. package/bin/runners/lib/polish/backend-checks.js +0 -148
  260. package/bin/runners/lib/polish/documentation-checks.js +0 -111
  261. package/bin/runners/lib/polish/frontend-checks.js +0 -168
  262. package/bin/runners/lib/polish/index.js +0 -71
  263. package/bin/runners/lib/polish/infrastructure-checks.js +0 -131
  264. package/bin/runners/lib/polish/library-detection.js +0 -175
  265. package/bin/runners/lib/polish/performance-checks.js +0 -100
  266. package/bin/runners/lib/polish/security-checks.js +0 -148
  267. package/bin/runners/lib/polish/utils.js +0 -203
  268. package/bin/runners/lib/prompt-builder.js +0 -540
  269. package/bin/runners/lib/proof-certificate.js +0 -634
  270. package/bin/runners/lib/reality/accessibility-audit.js +0 -946
  271. package/bin/runners/lib/reality/api-contract-validator.js +0 -1012
  272. package/bin/runners/lib/reality/chaos-engineering.js +0 -1084
  273. package/bin/runners/lib/reality/performance-tracker.js +0 -1077
  274. package/bin/runners/lib/reality/scenario-generator.js +0 -1404
  275. package/bin/runners/lib/reality/visual-regression.js +0 -852
  276. package/bin/runners/lib/reality-profiler.js +0 -717
  277. package/bin/runners/lib/replay/flight-recorder-viewer.js +0 -1160
  278. package/bin/runners/lib/review/ai-code-review.js +0 -832
  279. package/bin/runners/lib/rules/custom-rule-engine.js +0 -985
  280. package/bin/runners/lib/sbom-generator.js +0 -641
  281. package/bin/runners/lib/scan-output-enhanced.js +0 -512
  282. package/bin/runners/lib/security/owasp-scanner.js +0 -939
  283. package/bin/runners/lib/ship-output-enterprise.js +0 -239
  284. package/bin/runners/lib/unified-cli-output.js +0 -777
  285. package/bin/runners/lib/validators/contract-validator.js +0 -283
  286. package/bin/runners/lib/validators/dead-export-detector.js +0 -279
  287. package/bin/runners/lib/validators/dep-audit.js +0 -245
  288. package/bin/runners/lib/validators/env-validator.js +0 -319
  289. package/bin/runners/lib/validators/index.js +0 -120
  290. package/bin/runners/lib/validators/license-checker.js +0 -252
  291. package/bin/runners/lib/validators/route-validator.js +0 -290
  292. package/bin/runners/runAgent.d.ts +0 -5
  293. package/bin/runners/runAgent.js +0 -164
  294. package/bin/runners/runApprove.js +0 -1233
  295. package/bin/runners/runAuthority.js +0 -528
  296. package/bin/runners/runClassify.js +0 -862
  297. package/bin/runners/runConductor.js +0 -772
  298. package/bin/runners/runContainer.js +0 -366
  299. package/bin/runners/runContext.d.ts +0 -4
  300. package/bin/runners/runEasy.js +0 -410
  301. package/bin/runners/runFirewall.d.ts +0 -5
  302. package/bin/runners/runFirewall.js +0 -137
  303. package/bin/runners/runFirewallHook.d.ts +0 -5
  304. package/bin/runners/runFirewallHook.js +0 -59
  305. package/bin/runners/runIaC.js +0 -372
  306. package/bin/runners/runPolish.d.ts +0 -4
  307. package/bin/runners/runProof.zip +0 -0
  308. package/bin/runners/runTruth.d.ts +0 -5
  309. package/bin/runners/runTruth.js +0 -104
  310. package/bin/runners/runVibe.js +0 -791
  311. package/mcp-server/HARDENING_SUMMARY.md +0 -299
  312. package/mcp-server/agent-firewall-interceptor.js +0 -500
  313. package/mcp-server/authority-tools.js +0 -569
  314. package/mcp-server/conductor/conflict-resolver.js +0 -588
  315. package/mcp-server/conductor/execution-planner.js +0 -544
  316. package/mcp-server/conductor/index.js +0 -377
  317. package/mcp-server/conductor/lock-manager.js +0 -615
  318. package/mcp-server/conductor/request-queue.js +0 -550
  319. package/mcp-server/conductor/session-manager.js +0 -500
  320. package/mcp-server/conductor/tools.js +0 -510
  321. package/mcp-server/lib/api-client.cjs +0 -13
  322. package/mcp-server/lib/logger.cjs +0 -30
  323. package/mcp-server/logger.js +0 -173
  324. package/mcp-server/tools-v3.js +0 -1039
  325. package/mcp-server/tools.js +0 -495
  326. package/mcp-server/vibecheck-mcp-server-3.2.0.tgz +0 -0
package/bin/registry.js CHANGED
@@ -1,51 +1,42 @@
1
1
  /**
2
- * Vibecheck CLI Command Registry
2
+ * Vibecheck CLI Command Registry (LOCKED)
3
3
  *
4
4
  * Single source of truth for the public CLI surface.
5
5
  * If it isn't here, it does not exist.
6
- *
7
- * Simple 2-tier model:
8
- * - FREE ($0): Inspect & Observe
9
- * - PRO ($69/mo): Fix, Prove & Enforce
10
- *
11
- * SCAN = Quick lint (5 core engines, fast, FREE)
12
- * SHIP = Comprehensive verdict (all engines + proof cert, PRO)
13
6
  */
14
7
 
15
8
  "use strict";
16
9
 
17
10
  // ─────────────────────────────────────────────────────────────
18
- // CLI COMMANDS (22 total - 2-tier: FREE / PRO)
11
+ // CORE 13 + APPROVED EXTRAS (locked surface area)
19
12
  // ─────────────────────────────────────────────────────────────
20
13
  const ALLOWED_COMMANDS = new Set([
21
- // FREE (12) - Inspect & Observe
22
- "scan", // quick lint - 5 core engines
23
- "context", // generate truthpack + IDE rules
24
- "watch", // real-time file watching
25
- "doctor", // environment diagnostics
26
- "report", // generate HTML/SARIF reports
27
- "authority", // authority system main command
28
- "authority.list", // list available authorities
29
- "guard", // agent firewall (observe mode FREE, enforce mode PRO)
30
- "login", // authenticate
31
- "logout", // clear auth
32
- "whoami", // show current user
33
- "init", // one-time setup (legacy, redirects to context)
34
-
35
- // PRO (12) - Fix, Prove & Enforce
36
- "ship", // comprehensive - all engines, verdict, proof cert
37
- "fix", // AI-powered fixes with LLM
38
- "polish", // production hardening
39
- "reality", // playwright browser verification
40
- "prove", // full proof loop with evidence pack
41
- "gate", // CI/CD enforcement
42
- "ai-test", // AI agent for autonomous app testing
43
- "authority.approve", // get authority verdict
44
- "conductor.status", // multi-agent coordination status
45
- "conductor.register", // register AI agent
46
- "conductor.lock", // acquire file lock
47
- "conductor.unlock", // release file lock
48
- "conductor.propose", // submit change proposal
14
+ // Core 13
15
+ "init",
16
+ "doctor",
17
+ "scan",
18
+ "report",
19
+ "fix",
20
+ "watch",
21
+ "checkpoint",
22
+ "polish",
23
+ "ship",
24
+ "prove", // replaces ctx
25
+ "reality", // runtime crawl
26
+ "context",
27
+ "guard",
28
+
29
+ // Proof artifacts (new)
30
+ "evidence-pack",
31
+ "allowlist",
32
+
33
+ // Approved extras
34
+ "mcp",
35
+ "login",
36
+ "logout",
37
+ "whoami",
38
+ "ai-test",
39
+ "labs",
49
40
  ]);
50
41
 
51
42
  function assertAllowedOnly(obj) {
@@ -56,507 +47,241 @@ function assertAllowedOnly(obj) {
56
47
  }
57
48
 
58
49
  // ─────────────────────────────────────────────────────────────
59
- // COMMANDS - 2-Tier: FREE and PRO ($69/mo)
50
+ // COMMANDS (ALLOWED ONLY)
60
51
  // ─────────────────────────────────────────────────────────────
61
52
  const COMMANDS = {
62
- // ══════════════════════════════════════════════════════════════
63
- // FREE TIER - Inspect & Observe
64
- // ══════════════════════════════════════════════════════════════
65
-
66
- scan: {
67
- description: "Quick lint - 5 core engines, fast feedback",
68
- longDescription: "Fast static analysis using 5 core engines: secrets, mock data, console logs, type issues, and security vulnerabilities. Use for rapid feedback during development.",
53
+ // ── SETUP ───────────────────────────────────────────────────
54
+ init: {
55
+ description: "One-time setup (config + contracts + scripts)",
69
56
  tier: "free",
70
- category: "analysis",
71
- aliases: ["s", "check", "lint"],
72
- runner: () => require("./runners/runScan").runScan,
73
- examples: [
74
- { command: "vibecheck scan", description: "Quick scan with 5 core engines" },
75
- { command: "vibecheck scan --json", description: "JSON output for CI" },
76
- { command: "vibecheck scan --allowlist list", description: "View suppressed findings" },
77
- ],
78
- related: ["ship", "fix", "report"],
57
+ category: "setup",
58
+ aliases: ["setup", "configure"],
59
+ runner: () => require("./runners/runInit").runInit,
79
60
  },
80
61
 
81
- context: {
82
- description: "Generate truthpack + IDE rules (.cursorrules, MDC, Copilot)",
83
- longDescription: "Generate project-aware AI coding rules and truthpack for your IDE. Creates .cursorrules, MDC files, and other IDE configurations.",
62
+ doctor: {
63
+ description: "Environment + dependency + config health check",
84
64
  tier: "free",
85
65
  category: "setup",
86
- aliases: ["rules", "ai-rules", "mdc", "ctx", "init"],
87
- runner: () => require("./runners/runContext").runContext,
88
- examples: [
89
- { command: "vibecheck context", description: "Generate all IDE rules + truthpack" },
90
- { command: "vibecheck context --format cursor", description: ".cursorrules only" },
91
- { command: "vibecheck context --format mdc", description: "MDC files only" },
92
- ],
93
- related: ["scan", "guard"],
66
+ aliases: ["health", "diag"],
67
+ runner: () => require("./runners/runDoctor").runDoctor,
94
68
  },
95
69
 
96
70
  watch: {
97
- description: "Real-time file watching - re-runs scan on changes",
98
- longDescription: "File watcher that automatically re-runs quick scan when your code changes.",
71
+ description: "Continuous mode - re-runs on changes",
99
72
  tier: "free",
100
73
  category: "setup",
101
74
  aliases: ["w", "dev"],
102
75
  runner: () => require("./runners/runWatch").runWatch,
103
- examples: [
104
- { command: "vibecheck watch", description: "Start watching" },
105
- { command: "vibecheck watch --path ./src", description: "Watch specific directory" },
106
- ],
107
- related: ["scan"],
108
76
  },
109
77
 
110
- doctor: {
111
- description: "Environment diagnostics - config and dependency health check",
112
- longDescription: "Comprehensive diagnostics for your development environment, configuration, and dependencies.",
78
+ // ── ANALYSIS ────────────────────────────────────────────────
79
+ checkpoint: {
80
+ description: "Compare baseline vs current, hallucination scoring",
113
81
  tier: "free",
114
- category: "setup",
115
- aliases: ["health", "diag"],
116
- runner: () => require("./runners/runDoctor").runDoctor,
117
- examples: [
118
- { command: "vibecheck doctor", description: "Run all health checks" },
119
- { command: "vibecheck doctor --fix", description: "Auto-fix detected issues" },
120
- { command: "vibecheck doctor --json", description: "Output as JSON" },
121
- ],
122
- related: ["context", "scan"],
82
+ category: "analysis",
83
+ aliases: ["cp", "compare", "diff"],
84
+ caps: "basic on FREE, hallucination scoring on PRO",
85
+ runner: () => require("./runners/runCheckpoint").runCheckpoint,
86
+ },
87
+
88
+ // ── PROOF LOOP ──────────────────────────────────────────────
89
+ scan: {
90
+ description: "Route integrity & code analysis scanner",
91
+ tier: "free",
92
+ category: "proof",
93
+ aliases: ["s", "check"],
94
+ runner: () => require("./runners/runScan").runScan,
123
95
  },
124
96
 
125
97
  report: {
126
- description: "Generate HTML/SARIF reports from scan results",
127
- longDescription: "Create shareable reports from scan results in HTML, Markdown, or SARIF format.",
98
+ description: "Generate HTML/MD/SARIF reports",
128
99
  tier: "free",
129
100
  category: "output",
101
+ caps: "HTML/MD only on FREE",
130
102
  aliases: ["html", "artifact"],
131
103
  runner: () => require("./runners/runReport").runReport,
132
- examples: [
133
- { command: "vibecheck report", description: "Generate HTML report" },
134
- { command: "vibecheck report --format md", description: "Markdown report" },
135
- { command: "vibecheck report --format sarif", description: "SARIF for GitHub" },
136
- ],
137
- related: ["scan", "ship"],
138
104
  },
139
105
 
140
- "authority": {
141
- description: "Authority System - automated and human approvals",
142
- longDescription: "Request approval from built-in authorities (security, architecture, compliance, quality) or human reviewers. Use 'authority list' to see available authorities and 'authority approve' to request approval.",
106
+ fix: {
107
+ description: "AI-powered auto-fix",
143
108
  tier: "free",
144
- category: "authority",
145
- aliases: ["auth"],
146
- runner: () => require("./runners/runAuthority").runAuthority,
147
- examples: [
148
- { command: "vibecheck authority list", description: "List all authorities" },
149
- { command: "vibecheck authority approve --authority security", description: "Security review" },
150
- { command: "vibecheck authority approve -a quality -a security", description: "Multi-authority" },
151
- ],
152
- related: ["authority.list", "authority.approve", "ship"],
109
+ category: "proof",
110
+ caps: "--plan-only on FREE",
111
+ aliases: ["f", "repair"],
112
+ runner: () => require("./runners/runFix").runFix,
153
113
  },
154
114
 
155
- "authority.list": {
156
- description: "List available authorities",
157
- longDescription: "List all available authorities for code analysis and approval workflows.",
115
+ reality: {
116
+ description: "Runtime proof (browser crawl)",
158
117
  tier: "free",
159
- category: "authority",
160
- aliases: ["authorities", "auth-list"],
161
- runner: () => require("./runners/runAuthority").runAuthority,
162
- examples: [
163
- { command: "vibecheck authority list", description: "List all authorities" },
164
- ],
165
- related: ["authority", "authority.approve"],
118
+ category: "proof",
119
+ caps: "preview mode on FREE (5 pages, no auth)",
120
+ aliases: ["r", "test", "e2e"],
121
+ runner: () => async (args, ctx) => {
122
+ const { runRuntime } = require("./runners/runRuntime");
123
+ return await runRuntime(["crawl", ...args], ctx);
124
+ },
166
125
  },
167
126
 
168
- login: {
169
- description: "Authenticate with API key",
170
- longDescription: "Connect your CLI to the vibecheck API with your API key.",
127
+ ship: {
128
+ description: "Verdict engine - SHIP / WARN / BLOCK",
171
129
  tier: "free",
172
- category: "auth",
173
- aliases: ["auth", "signin"],
174
- runner: () => require("./runners/runAuth").runLogin,
175
- skipAuth: true,
176
- examples: [
177
- { command: "vibecheck login", description: "Interactive login" },
178
- { command: "vibecheck login --key YOUR_API_KEY", description: "Login with key" },
179
- ],
180
- related: ["logout", "whoami"],
130
+ category: "proof",
131
+ aliases: ["verdict", "go"],
132
+ caps: "static-only on FREE",
133
+ runner: () => require("./runners/runShip").runShip,
181
134
  },
182
135
 
183
- logout: {
184
- description: "Clear stored credentials",
185
- longDescription: "Remove stored authentication credentials from your system.",
186
- tier: "free",
187
- category: "auth",
188
- aliases: ["signout"],
189
- runner: () => require("./runners/runAuth").runLogout,
190
- skipAuth: true,
191
- examples: [
192
- { command: "vibecheck logout", description: "Clear credentials" },
193
- ],
194
- related: ["login", "whoami"],
136
+ prove: {
137
+ description: "One command reality proof - video + network evidence that your app works",
138
+ tier: "pro",
139
+ category: "proof",
140
+ aliases: ["p", "full", "all"],
141
+ caps: "video, trace, HAR recording enabled by default; CI-ready output",
142
+ runner: () => require("./runners/runProve").runProve,
195
143
  },
196
144
 
197
- whoami: {
198
- description: "Show current user and plan",
199
- longDescription: "Display information about the currently authenticated user and their subscription plan.",
145
+ // ── PROOF ARTIFACTS ─────────────────────────────────────────
146
+ "evidence-pack": {
147
+ description: "Bundle proof artifacts (videos, traces, screenshots) into shareable pack",
200
148
  tier: "free",
201
- category: "auth",
202
- aliases: ["me", "user"],
203
- runner: () => require("./runners/runAuth").runWhoami,
204
- skipAuth: true,
205
- examples: [
206
- { command: "vibecheck whoami", description: "Show user info" },
207
- ],
208
- related: ["login", "logout"],
149
+ category: "proof",
150
+ aliases: ["pack", "bundle", "evidence"],
151
+ runner: () => require("./runners/runEvidencePack").runEvidencePack,
209
152
  },
210
153
 
211
- init: {
212
- description: "One-time setup (alias for context)",
213
- longDescription: "Initialize vibecheck in your project. Alias for 'vibecheck context'.",
154
+ allowlist: {
155
+ description: "Manage finding allowlist (suppress false positives)",
214
156
  tier: "free",
215
- category: "setup",
216
- aliases: ["setup", "configure"],
217
- runner: () => require("./runners/runContext").runContext,
218
- examples: [
219
- { command: "vibecheck init", description: "Initialize project" },
220
- ],
221
- related: ["context", "doctor"],
222
- },
223
-
224
- // ══════════════════════════════════════════════════════════════
225
- // PRO TIER ($69/mo) - Fix, Prove & Enforce
226
- // ══════════════════════════════════════════════════════════════
227
-
228
- ship: {
229
- description: "Comprehensive verdict - ALL engines + route validation + proof cert",
230
- longDescription: "The final word on whether your code is ready to ship. Runs ALL 15+ analysis engines, validates routes and contracts, generates proof certificate. SHIP/WARN/BLOCK verdict.",
231
- tier: "pro",
232
- category: "analysis",
233
- aliases: ["verdict", "go", "full"],
234
- runner: () => require("./runners/runShip").runShip,
235
- examples: [
236
- { command: "vibecheck ship", description: "Get shipping verdict" },
237
- { command: "vibecheck ship --strict", description: "Fail on warnings" },
238
- { command: "vibecheck ship --badge", description: "Generate status badge" },
239
- ],
240
- related: ["scan", "prove", "fix"],
241
- },
242
-
243
- fix: {
244
- description: "AI-powered auto-fix with LLM",
245
- longDescription: "Generate AI-powered fixes for detected issues. Uses LLM to analyze and fix problems automatically.",
246
- tier: "pro",
247
- category: "repair",
248
- aliases: ["f", "repair", "autofix"],
249
- runner: () => require("./runners/runFix").runFix,
250
- examples: [
251
- { command: "vibecheck fix", description: "Generate fix missions" },
252
- { command: "vibecheck fix --apply", description: "Apply AI fixes" },
253
- { command: "vibecheck fix --loop", description: "Fix loop until clean" },
254
- ],
255
- related: ["scan", "ship", "polish"],
157
+ category: "proof",
158
+ aliases: ["allow", "ignore", "whitelist"],
159
+ runner: () => require("./runners/runAllowlist").runAllowlist,
256
160
  },
257
161
 
162
+ // ── QUALITY ────────────────────────────────────────────────
258
163
  polish: {
259
- description: "Production hardening - console removal, dead code, type strengthening",
260
- longDescription: "Automated code transformations for production readiness. Removes console statements, unused imports, strengthens types, and more - all without requiring an LLM.",
261
- tier: "pro",
262
- category: "repair",
263
- aliases: ["prod", "final", "harden"],
164
+ description: "Production polish analyzer - finds missing essentials",
165
+ tier: "free",
166
+ category: "quality",
167
+ aliases: ["quality", "finalize", "ready"],
264
168
  runner: () => require("./runners/runPolish").runPolish,
265
- examples: [
266
- { command: "vibecheck polish", description: "Dry-run - preview changes" },
267
- { command: "vibecheck polish --apply", description: "Apply all auto-fixes" },
268
- { command: "vibecheck polish --passes remove-consoles,dead-code", description: "Run specific passes" },
269
- { command: "vibecheck polish --safe-only --apply", description: "Apply only safe fixes" },
270
- { command: "vibecheck polish --list-passes", description: "List available passes" },
271
- ],
272
- related: ["ship", "fix", "scan"],
273
169
  },
274
170
 
275
- reality: {
276
- description: "Playwright browser verification - test runtime behavior",
277
- longDescription: "Verify your app's runtime behavior with Playwright-powered browser testing. Tests actual API responses, UI behavior, and auth flows.",
278
- tier: "pro",
279
- category: "verification",
280
- aliases: ["browser", "e2e", "playwright"],
281
- runner: () => require("./runners/runReality").runReality,
282
- examples: [
283
- { command: "vibecheck reality --url http://localhost:3000", description: "Test localhost" },
284
- { command: "vibecheck reality --auth email:pass", description: "With authentication" },
285
- { command: "vibecheck reality --record", description: "Record video evidence" },
286
- ],
287
- related: ["prove", "ship", "ai-test"],
288
- },
289
-
290
- "ai-test": {
291
- description: "AI agent for autonomous app testing",
292
- longDescription: "AI-powered autonomous testing that explores your app like a real user. Supports common scenarios like login, checkout, and signup flows.",
293
- tier: "pro",
294
- category: "verification",
295
- aliases: ["agent", "autonomous"],
296
- runner: () => require("./runners/runAIAgent").runAIAgent,
297
- examples: [
298
- { command: "vibecheck ai-test --url http://localhost:3000", description: "Explore app autonomously" },
299
- { command: "vibecheck ai-test --url http://localhost:3000 --scenario login", description: "Test login flow" },
300
- { command: "vibecheck ai-test --url http://localhost:3000 --headed", description: "Watch the AI test" },
301
- ],
302
- related: ["reality", "prove"],
303
- },
304
-
305
- prove: {
306
- description: "Full proof loop with evidence pack",
307
- longDescription: "Complete verification cycle: scan + reality check + evidence generation. Creates cryptographically signed proof pack.",
308
- tier: "pro",
309
- category: "verification",
310
- aliases: ["p", "verify", "evidence"],
311
- runner: () => require("./runners/runProve").runProve,
312
- examples: [
313
- { command: "vibecheck prove", description: "Run full proof loop" },
314
- { command: "vibecheck prove --url http://localhost:3000", description: "With runtime testing" },
315
- { command: "vibecheck prove --bundle", description: "Generate evidence pack" },
316
- ],
317
- related: ["ship", "reality"],
318
- },
319
-
320
- gate: {
321
- description: "CI/CD enforcement - blocks deploys on issues",
322
- longDescription: "Enforce quality gates in your CI/CD pipeline. Returns exit code 1 on failures to block deployments.",
323
- tier: "pro",
324
- category: "automation",
325
- aliases: ["ci", "enforce", "block"],
326
- runner: () => require("./runners/runGuard").runGate,
327
- examples: [
328
- { command: "vibecheck gate", description: "Run CI gate check" },
329
- { command: "vibecheck gate --strict", description: "Strict mode (fail on warnings)" },
330
- { command: "vibecheck gate --threshold 80", description: "Custom score threshold" },
331
- ],
332
- related: ["ship", "scan"],
171
+ // ── AI TRUTH ───────────────────────────────────────────────
172
+ context: {
173
+ description: "Generate IDE rules (.cursorrules, MDC, Windsurf, Copilot)",
174
+ tier: "free",
175
+ category: "truth",
176
+ aliases: ["rules", "ai-rules", "mdc"],
177
+ runner: () => require("./runners/runContext").runContext,
333
178
  },
334
179
 
335
180
  guard: {
336
- description: "Agent firewall - monitors/blocks AI agent actions",
337
- longDescription: "AI agent firewall that validates file writes, command execution, and content. Observe mode (FREE) logs violations. Enforce mode (PRO) blocks violations. Protects against forbidden paths, dangerous commands, and hallucination patterns.",
181
+ description: "AI guardrails - prompt firewall & hallucination checking",
338
182
  tier: "free",
339
- category: "firewall",
340
- skipAuth: true, // Allow observe mode without authentication
341
- aliases: ["firewall", "ai-guard"],
183
+ category: "truth",
184
+ aliases: ["ai-guard", "firewall", "validate"],
342
185
  runner: () => require("./runners/runGuard").runGuard,
343
- examples: [
344
- { command: "vibecheck guard --init", description: "Initialize firewall config" },
345
- { command: "vibecheck guard --mode observe --action write --path .env", description: "Check path (observe)" },
346
- { command: "vibecheck guard --mode enforce --action write --path .env", description: "Block write (PRO)" },
347
- { command: "vibecheck guard --action execute --command \"rm -rf /\"", description: "Validate command" },
348
- { command: "vibecheck guard --claims", description: "Verify AI claims (legacy)" },
349
- ],
350
- related: ["context", "fix", "scan"],
351
186
  },
352
187
 
353
- "authority.approve": {
354
- description: "Get authority verdict - APPROVED/REJECTED/PENDING with proofs",
355
- longDescription: "Request approval from an authority for a specific action. Returns structured verdict with evidence and findings.",
356
- tier: "pro",
357
- category: "authority",
358
- aliases: ["auth-verdict"],
359
- runner: () => {
360
- const { runAuthority } = require("./runners/runAuthority");
361
- return (args, context) => runAuthority(['approve', ...args], context);
362
- },
363
- examples: [
364
- { command: "vibecheck authority approve --authority security", description: "Security review" },
365
- { command: "vibecheck authority approve -a security -a quality", description: "Multi-authority" },
366
- { command: "vibecheck authority approve -a security --json", description: "JSON output" },
367
- ],
368
- related: ["authority", "authority.list", "ship"],
188
+ // ── AUTOMATION ─────────────────────────────────────────────
189
+ mcp: {
190
+ description: "Start MCP server for AI IDEs",
191
+ tier: "starter",
192
+ category: "automation",
193
+ aliases: [],
194
+ runner: () => require("./runners/runMcp").runMcp,
369
195
  },
370
196
 
371
- "conductor.status": {
372
- description: "Multi-agent coordination status",
373
- longDescription: "View status of registered AI agents, active locks, and pending proposals.",
197
+ "ai-test": {
198
+ description: "AI autonomous test (alias: runtime agent)",
374
199
  tier: "pro",
375
- category: "coordination",
376
- aliases: ["cstatus"],
377
- runner: () => require("./runners/runConductor").runConductorStatus,
378
- examples: [
379
- { command: "vibecheck conductor.status", description: "View coordination status" },
380
- { command: "vibecheck conductor.status --json", description: "JSON output" },
381
- ],
382
- related: ["conductor.register", "conductor.lock"],
200
+ category: "automation",
201
+ aliases: ["ai", "agent"],
202
+ runner: () => async (args, ctx) => {
203
+ const { runRuntime } = require("./runners/runRuntime");
204
+ return await runRuntime(["agent", ...args], ctx);
205
+ },
383
206
  },
384
207
 
385
- "conductor.register": {
386
- description: "Register AI agent for coordination",
387
- longDescription: "Register an AI agent with the conductor for multi-agent coordination.",
388
- tier: "pro",
389
- category: "coordination",
390
- aliases: ["cregister"],
391
- runner: () => require("./runners/runConductor").runConductorRegister,
392
- examples: [
393
- { command: "vibecheck conductor.register --name cursor", description: "Register agent" },
394
- ],
395
- related: ["conductor.status", "conductor.lock"],
208
+ // ── ACCOUNT (skipAuth) ────────────────────────────────────
209
+ login: {
210
+ description: "Authenticate with API key",
211
+ tier: "free",
212
+ category: "account",
213
+ aliases: ["auth", "signin"],
214
+ runner: () => require("./runners/runAuth").runLogin,
215
+ skipAuth: true,
396
216
  },
397
217
 
398
- "conductor.lock": {
399
- description: "Acquire file lock for exclusive editing",
400
- longDescription: "Acquire a lock on files for exclusive editing by an AI agent.",
401
- tier: "pro",
402
- category: "coordination",
403
- aliases: ["clock"],
404
- runner: () => require("./runners/runConductor").runConductorLock,
405
- examples: [
406
- { command: "vibecheck conductor.lock src/file.ts", description: "Lock file" },
407
- { command: "vibecheck conductor.lock --agent cursor src/", description: "Lock directory" },
408
- ],
409
- related: ["conductor.unlock", "conductor.status"],
218
+ logout: {
219
+ description: "Remove stored credentials",
220
+ tier: "free",
221
+ category: "account",
222
+ aliases: ["signout"],
223
+ runner: () => require("./runners/runAuth").runLogout,
224
+ skipAuth: true,
410
225
  },
411
226
 
412
- "conductor.unlock": {
413
- description: "Release file lock",
414
- longDescription: "Release a previously acquired lock on files.",
415
- tier: "pro",
416
- category: "coordination",
417
- aliases: ["cunlock"],
418
- runner: () => require("./runners/runConductor").runConductorUnlock,
419
- examples: [
420
- { command: "vibecheck conductor.unlock src/file.ts", description: "Unlock file" },
421
- { command: "vibecheck conductor.unlock --all", description: "Release all locks" },
422
- ],
423
- related: ["conductor.lock", "conductor.status"],
227
+ whoami: {
228
+ description: "Show current user and plan",
229
+ tier: "free",
230
+ category: "account",
231
+ aliases: ["me", "user"],
232
+ runner: () => require("./runners/runAuth").runWhoami,
233
+ skipAuth: true,
424
234
  },
425
235
 
426
- "conductor.propose": {
427
- description: "Submit change proposal for review",
428
- longDescription: "Submit a proposed change for review by the conductor before applying.",
429
- tier: "pro",
430
- category: "coordination",
431
- aliases: ["cpropose"],
432
- runner: () => require("./runners/runConductor").runConductorPropose,
433
- examples: [
434
- { command: "vibecheck conductor.propose --diff changes.patch", description: "Submit proposal" },
435
- ],
436
- related: ["conductor.status", "authority.approve"],
236
+ // ── EXTRAS ────────────────────────────────────────────────
237
+ labs: {
238
+ description: "Experimental features",
239
+ tier: "free",
240
+ category: "extras",
241
+ aliases: ["experimental", "beta"],
242
+ runner: () => require("./runners/runLabs").runLabs,
437
243
  },
438
244
  };
439
245
 
440
- // Validate that only allowed commands are defined
441
246
  assertAllowedOnly(COMMANDS);
442
247
 
443
248
  // ─────────────────────────────────────────────────────────────
444
- // TIER HELPERS
249
+ // DERIVED MAPS
445
250
  // ─────────────────────────────────────────────────────────────
446
- function isPro(tier) {
447
- return tier === "pro";
448
- }
449
-
450
- function requiresPro(commandName) {
451
- const cmd = COMMANDS[commandName];
452
- return cmd && cmd.tier === "pro";
453
- }
454
-
455
- function getFreeCommands() {
456
- return Object.entries(COMMANDS)
457
- .filter(([, cmd]) => cmd.tier === "free")
458
- .map(([name]) => name);
459
- }
460
-
461
- function getProCommands() {
462
- return Object.entries(COMMANDS)
463
- .filter(([, cmd]) => cmd.tier === "pro")
464
- .map(([name]) => name);
465
- }
466
-
467
- // ─────────────────────────────────────────────────────────────
468
- // BUILD DERIVED DATA STRUCTURES
469
- // ─────────────────────────────────────────────────────────────
470
-
471
- // Build alias map: { alias -> command }
472
251
  const ALIAS_MAP = {};
473
- for (const [cmdName, cmd] of Object.entries(COMMANDS)) {
474
- if (cmd.aliases) {
475
- for (const alias of cmd.aliases) {
476
- ALIAS_MAP[alias] = cmdName;
477
- }
478
- }
252
+ for (const [cmd, def] of Object.entries(COMMANDS)) {
253
+ for (const alias of def.aliases || []) ALIAS_MAP[alias] = cmd;
479
254
  }
480
255
 
481
- // All command names including aliases
482
- const ALL_COMMANDS = new Set([
256
+ const ALL_COMMANDS = [
483
257
  ...Object.keys(COMMANDS),
484
- ...Object.keys(ALIAS_MAP),
485
- ]);
258
+ ...Object.values(COMMANDS).flatMap((c) => c.aliases || []),
259
+ ];
486
260
 
487
261
  // ─────────────────────────────────────────────────────────────
488
- // GETTERS
262
+ // RUNNER LOADER
489
263
  // ─────────────────────────────────────────────────────────────
264
+ function getRunner(cmd, styles = {}) {
265
+ const def = COMMANDS[cmd];
266
+ if (!def) return null;
267
+
268
+ const red = styles.red || "";
269
+ const reset = styles.reset || "";
270
+ const errorSym = styles.errorSymbol || "✗";
490
271
 
491
- function getRunner(cmd, opts = {}) {
492
- // Resolve alias to canonical command
493
- const canonicalCmd = ALIAS_MAP[cmd] || cmd;
494
- const def = COMMANDS[canonicalCmd];
495
-
496
- if (!def) {
497
- return null;
498
- }
499
-
500
- if (!def.runner) {
501
- return null;
502
- }
503
-
504
272
  try {
505
273
  return def.runner();
506
274
  } catch (e) {
507
- if (opts.red && opts.reset) {
508
- console.error(`${opts.red}${opts.errorSymbol || '×'} Failed to load runner for ${cmd}: ${e.message}${opts.reset}`);
509
- }
510
- return null;
511
- }
512
- }
513
-
514
- function getCommand(name) {
515
- // Check direct name
516
- if (COMMANDS[name]) return COMMANDS[name];
517
-
518
- // Check alias map
519
- const canonical = ALIAS_MAP[name];
520
- if (canonical && COMMANDS[canonical]) {
521
- return { ...COMMANDS[canonical], _resolvedFrom: name, _canonicalName: canonical };
275
+ return async () => {
276
+ console.error(`${red}${errorSym}${reset} Failed to load ${cmd}: ${e.message}`);
277
+ return 1;
278
+ };
522
279
  }
523
-
524
- return null;
525
280
  }
526
281
 
527
- function resolveCommand(name) {
528
- return ALIAS_MAP[name] || name;
529
- }
530
-
531
- // ─────────────────────────────────────────────────────────────
532
- // EXPORTS
533
- // ─────────────────────────────────────────────────────────────
534
282
  module.exports = {
535
- // Core data
536
283
  COMMANDS,
537
- ALLOWED_COMMANDS,
538
284
  ALIAS_MAP,
539
285
  ALL_COMMANDS,
540
-
541
- // Tier helpers
542
- isPro,
543
- requiresPro,
544
- getFreeCommands,
545
- getProCommands,
546
-
547
- // Getters
548
286
  getRunner,
549
- getCommand,
550
- resolveCommand,
551
- listCommands: () => Object.keys(COMMANDS),
552
-
553
- getCommandsByTier: (tier) =>
554
- Object.entries(COMMANDS)
555
- .filter(([, cmd]) => cmd.tier === tier)
556
- .map(([name, cmd]) => ({ name, ...cmd })),
557
-
558
- getCommandsByCategory: (category) =>
559
- Object.entries(COMMANDS)
560
- .filter(([, cmd]) => cmd.category === category)
561
- .map(([name, cmd]) => ({ name, ...cmd })),
562
287
  };