@vibecheckai/cli 3.0.3 → 3.0.5

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 (119) hide show
  1. package/bin/cli-hygiene.js +241 -0
  2. package/bin/dev/run-v2-torture.js +30 -0
  3. package/bin/guardrail.js +843 -0
  4. package/bin/runners/cli-utils.js +1070 -0
  5. package/bin/runners/context/ai-task-decomposer.js +337 -0
  6. package/bin/runners/context/analyzer.js +462 -0
  7. package/bin/runners/context/api-contracts.js +427 -0
  8. package/bin/runners/context/context-diff.js +342 -0
  9. package/bin/runners/context/context-pruner.js +291 -0
  10. package/bin/runners/context/dependency-graph.js +414 -0
  11. package/bin/runners/context/generators/claude.js +107 -0
  12. package/bin/runners/context/generators/codex.js +108 -0
  13. package/bin/runners/context/generators/copilot.js +119 -0
  14. package/bin/runners/context/generators/cursor.js +514 -0
  15. package/bin/runners/context/generators/mcp.js +151 -0
  16. package/bin/runners/context/generators/windsurf.js +180 -0
  17. package/bin/runners/context/git-context.js +302 -0
  18. package/bin/runners/context/index.js +1042 -0
  19. package/bin/runners/context/insights.js +173 -0
  20. package/bin/runners/context/mcp-server/generate-rules.js +337 -0
  21. package/bin/runners/context/mcp-server/index.js +1176 -0
  22. package/bin/runners/context/mcp-server/package.json +24 -0
  23. package/bin/runners/context/memory.js +200 -0
  24. package/bin/runners/context/monorepo.js +215 -0
  25. package/bin/runners/context/multi-repo-federation.js +404 -0
  26. package/bin/runners/context/patterns.js +253 -0
  27. package/bin/runners/context/proof-context.js +972 -0
  28. package/bin/runners/context/security-scanner.js +303 -0
  29. package/bin/runners/context/semantic-search.js +350 -0
  30. package/bin/runners/context/shared.js +264 -0
  31. package/bin/runners/context/team-conventions.js +310 -0
  32. package/bin/runners/lib/ai-bridge.js +416 -0
  33. package/bin/runners/lib/analysis-core.js +271 -0
  34. package/bin/runners/lib/analyzers.js +579 -0
  35. package/bin/runners/lib/assets/vibecheck-logo.png +0 -0
  36. package/bin/runners/lib/audit-bridge.js +391 -0
  37. package/bin/runners/lib/auth-truth.js +193 -0
  38. package/bin/runners/lib/auth.js +215 -0
  39. package/bin/runners/lib/backup.js +62 -0
  40. package/bin/runners/lib/billing.js +107 -0
  41. package/bin/runners/lib/claims.js +118 -0
  42. package/bin/runners/lib/cli-ui.js +540 -0
  43. package/bin/runners/lib/compliance-bridge-new.js +0 -0
  44. package/bin/runners/lib/compliance-bridge.js +165 -0
  45. package/bin/runners/lib/contracts/auth-contract.js +202 -0
  46. package/bin/runners/lib/contracts/env-contract.js +181 -0
  47. package/bin/runners/lib/contracts/external-contract.js +206 -0
  48. package/bin/runners/lib/contracts/guard.js +168 -0
  49. package/bin/runners/lib/contracts/index.js +89 -0
  50. package/bin/runners/lib/contracts/plan-validator.js +311 -0
  51. package/bin/runners/lib/contracts/route-contract.js +199 -0
  52. package/bin/runners/lib/contracts.js +804 -0
  53. package/bin/runners/lib/detect.js +89 -0
  54. package/bin/runners/lib/detectors-v2.js +703 -0
  55. package/bin/runners/lib/doctor/autofix.js +254 -0
  56. package/bin/runners/lib/doctor/index.js +37 -0
  57. package/bin/runners/lib/doctor/modules/dependencies.js +325 -0
  58. package/bin/runners/lib/doctor/modules/index.js +46 -0
  59. package/bin/runners/lib/doctor/modules/network.js +250 -0
  60. package/bin/runners/lib/doctor/modules/project.js +312 -0
  61. package/bin/runners/lib/doctor/modules/runtime.js +224 -0
  62. package/bin/runners/lib/doctor/modules/security.js +348 -0
  63. package/bin/runners/lib/doctor/modules/system.js +213 -0
  64. package/bin/runners/lib/doctor/modules/vibecheck.js +394 -0
  65. package/bin/runners/lib/doctor/reporter.js +262 -0
  66. package/bin/runners/lib/doctor/service.js +262 -0
  67. package/bin/runners/lib/doctor/types.js +113 -0
  68. package/bin/runners/lib/doctor/ui.js +263 -0
  69. package/bin/runners/lib/doctor-enhanced.js +233 -0
  70. package/bin/runners/lib/doctor-v2.js +608 -0
  71. package/bin/runners/lib/drift.js +425 -0
  72. package/bin/runners/lib/enforcement.js +72 -0
  73. package/bin/runners/lib/entitlements.js +8 -3
  74. package/bin/runners/lib/env-resolver.js +417 -0
  75. package/bin/runners/lib/extractors/client-calls.js +990 -0
  76. package/bin/runners/lib/extractors/fastify-route-dump.js +573 -0
  77. package/bin/runners/lib/extractors/fastify-routes.js +426 -0
  78. package/bin/runners/lib/extractors/index.js +363 -0
  79. package/bin/runners/lib/extractors/next-routes.js +524 -0
  80. package/bin/runners/lib/extractors/proof-graph.js +431 -0
  81. package/bin/runners/lib/extractors/route-matcher.js +451 -0
  82. package/bin/runners/lib/extractors/truthpack-v2.js +377 -0
  83. package/bin/runners/lib/extractors/ui-bindings.js +547 -0
  84. package/bin/runners/lib/findings-schema.js +281 -0
  85. package/bin/runners/lib/html-report.js +650 -0
  86. package/bin/runners/lib/missions/templates.js +45 -0
  87. package/bin/runners/lib/policy.js +295 -0
  88. package/bin/runners/lib/reality/correlation-detectors.js +359 -0
  89. package/bin/runners/lib/reality/index.js +318 -0
  90. package/bin/runners/lib/reality/request-hashing.js +416 -0
  91. package/bin/runners/lib/reality/request-mapper.js +453 -0
  92. package/bin/runners/lib/reality/safety-rails.js +463 -0
  93. package/bin/runners/lib/reality/semantic-snapshot.js +408 -0
  94. package/bin/runners/lib/reality/toast-detector.js +393 -0
  95. package/bin/runners/lib/route-truth.js +10 -10
  96. package/bin/runners/lib/schema-validator.js +350 -0
  97. package/bin/runners/lib/schemas/contracts.schema.json +160 -0
  98. package/bin/runners/lib/schemas/finding.schema.json +100 -0
  99. package/bin/runners/lib/schemas/mission-pack.schema.json +206 -0
  100. package/bin/runners/lib/schemas/proof-graph.schema.json +176 -0
  101. package/bin/runners/lib/schemas/reality-report.schema.json +162 -0
  102. package/bin/runners/lib/schemas/share-pack.schema.json +180 -0
  103. package/bin/runners/lib/schemas/ship-report.schema.json +117 -0
  104. package/bin/runners/lib/schemas/truthpack-v2.schema.json +303 -0
  105. package/bin/runners/lib/schemas/validator.js +438 -0
  106. package/bin/runners/lib/verdict-engine.js +628 -0
  107. package/bin/runners/runAIAgent.js +228 -1
  108. package/bin/runners/runBadge.js +181 -1
  109. package/bin/runners/runCtxDiff.js +301 -0
  110. package/bin/runners/runInitGha.js +78 -15
  111. package/bin/runners/runLaunch.js +180 -1
  112. package/bin/runners/runProve.js +23 -0
  113. package/bin/runners/runReplay.js +114 -84
  114. package/bin/runners/runScan.js +111 -32
  115. package/bin/runners/runShip.js +23 -2
  116. package/bin/runners/runTruthpack.js +9 -7
  117. package/bin/runners/runValidate.js +161 -1
  118. package/bin/vibecheck.js +6 -1
  119. package/package.json +1 -1
@@ -0,0 +1,89 @@
1
+ // bin/runners/lib/detect.js
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+ const fg = require("fast-glob");
5
+
6
+ function fileExists(root, rel) {
7
+ return fs.existsSync(path.join(root, rel));
8
+ }
9
+
10
+ function detectPackageManager(root) {
11
+ if (fileExists(root, "pnpm-lock.yaml")) return "pnpm";
12
+ if (fileExists(root, "yarn.lock")) return "yarn";
13
+ if (fileExists(root, "package-lock.json")) return "npm";
14
+ return "npm";
15
+ }
16
+
17
+ function detectNext(root, pkg) {
18
+ const deps = { ...(pkg.dependencies || {}), ...(pkg.devDependencies || {}) };
19
+ const hasDep = !!deps.next;
20
+ const hasConfig = fileExists(root, "next.config.js") || fileExists(root, "next.config.mjs") || fileExists(root, "next.config.ts");
21
+ const hasApp = fileExists(root, "app") || fileExists(root, "src/app");
22
+ const hasPages = fileExists(root, "pages") || fileExists(root, "src/pages");
23
+ return { enabled: hasDep || hasConfig || hasApp || hasPages, hasDep, hasConfig, hasApp, hasPages };
24
+ }
25
+
26
+ function detectFastify(root, pkg) {
27
+ const deps = { ...(pkg.dependencies || {}), ...(pkg.devDependencies || {}) };
28
+ const hasDep = !!deps.fastify;
29
+ return { enabled: hasDep, hasDep };
30
+ }
31
+
32
+ function scoreFastifyEntry(code, rel) {
33
+ let s = 0;
34
+ if (/\bfastify\s*\(/.test(code)) s += 10;
35
+ if (/from\s+['"]fastify['"]|require\(['"]fastify['"]\)/.test(code)) s += 8;
36
+ if (/\baddHook\s*\(/.test(code)) s += 2;
37
+ if (/\bregister\s*\(/.test(code)) s += 2;
38
+ if (/\.(listen|ready)\s*\(/.test(code)) s += 10;
39
+ if (/createServer|http\.createServer/.test(code)) s += 1;
40
+ if (rel.includes("server")) s += 2;
41
+ if (rel.includes("api")) s += 1;
42
+ if (rel.endsWith(".ts")) s += 1;
43
+ return s;
44
+ }
45
+
46
+ async function detectFastifyEntry(root) {
47
+ const common = [
48
+ "src/server.ts", "src/server.js",
49
+ "server.ts", "server.js",
50
+ "src/index.ts", "src/index.js",
51
+ "index.ts", "index.js",
52
+ "src/app.ts", "src/app.js",
53
+ "app.ts", "app.js"
54
+ ];
55
+
56
+ for (const rel of common) {
57
+ const abs = path.join(root, rel);
58
+ if (!fs.existsSync(abs)) continue;
59
+ const code = fs.readFileSync(abs, "utf8");
60
+ if (/\bfastify\s*\(/.test(code)) return rel;
61
+ }
62
+
63
+ const files = await fg(["**/*.{ts,js}"], {
64
+ cwd: root,
65
+ onlyFiles: true,
66
+ absolute: false,
67
+ ignore: ["**/node_modules/**", "**/.next/**", "**/dist/**", "**/build/**"]
68
+ });
69
+
70
+ let best = null;
71
+ for (const rel of files.slice(0, 800)) {
72
+ const abs = path.join(root, rel);
73
+ let code;
74
+ try { code = fs.readFileSync(abs, "utf8"); } catch { continue; }
75
+ if (!/\bfastify\s*\(/.test(code)) continue;
76
+
77
+ const s = scoreFastifyEntry(code, rel);
78
+ if (!best || s > best.score) best = { rel, score: s };
79
+ }
80
+
81
+ return best?.rel || null;
82
+ }
83
+
84
+ module.exports = {
85
+ detectPackageManager,
86
+ detectNext,
87
+ detectFastify,
88
+ detectFastifyEntry
89
+ };