@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.
- package/bin/cli-hygiene.js +241 -0
- package/bin/dev/run-v2-torture.js +30 -0
- package/bin/guardrail.js +843 -0
- package/bin/runners/cli-utils.js +1070 -0
- package/bin/runners/context/ai-task-decomposer.js +337 -0
- package/bin/runners/context/analyzer.js +462 -0
- package/bin/runners/context/api-contracts.js +427 -0
- package/bin/runners/context/context-diff.js +342 -0
- package/bin/runners/context/context-pruner.js +291 -0
- package/bin/runners/context/dependency-graph.js +414 -0
- package/bin/runners/context/generators/claude.js +107 -0
- package/bin/runners/context/generators/codex.js +108 -0
- package/bin/runners/context/generators/copilot.js +119 -0
- package/bin/runners/context/generators/cursor.js +514 -0
- package/bin/runners/context/generators/mcp.js +151 -0
- package/bin/runners/context/generators/windsurf.js +180 -0
- package/bin/runners/context/git-context.js +302 -0
- package/bin/runners/context/index.js +1042 -0
- package/bin/runners/context/insights.js +173 -0
- package/bin/runners/context/mcp-server/generate-rules.js +337 -0
- package/bin/runners/context/mcp-server/index.js +1176 -0
- package/bin/runners/context/mcp-server/package.json +24 -0
- package/bin/runners/context/memory.js +200 -0
- package/bin/runners/context/monorepo.js +215 -0
- package/bin/runners/context/multi-repo-federation.js +404 -0
- package/bin/runners/context/patterns.js +253 -0
- package/bin/runners/context/proof-context.js +972 -0
- package/bin/runners/context/security-scanner.js +303 -0
- package/bin/runners/context/semantic-search.js +350 -0
- package/bin/runners/context/shared.js +264 -0
- package/bin/runners/context/team-conventions.js +310 -0
- package/bin/runners/lib/ai-bridge.js +416 -0
- package/bin/runners/lib/analysis-core.js +271 -0
- package/bin/runners/lib/analyzers.js +579 -0
- package/bin/runners/lib/assets/vibecheck-logo.png +0 -0
- package/bin/runners/lib/audit-bridge.js +391 -0
- package/bin/runners/lib/auth-truth.js +193 -0
- package/bin/runners/lib/auth.js +215 -0
- package/bin/runners/lib/backup.js +62 -0
- package/bin/runners/lib/billing.js +107 -0
- package/bin/runners/lib/claims.js +118 -0
- package/bin/runners/lib/cli-ui.js +540 -0
- package/bin/runners/lib/compliance-bridge-new.js +0 -0
- package/bin/runners/lib/compliance-bridge.js +165 -0
- package/bin/runners/lib/contracts/auth-contract.js +202 -0
- package/bin/runners/lib/contracts/env-contract.js +181 -0
- package/bin/runners/lib/contracts/external-contract.js +206 -0
- package/bin/runners/lib/contracts/guard.js +168 -0
- package/bin/runners/lib/contracts/index.js +89 -0
- package/bin/runners/lib/contracts/plan-validator.js +311 -0
- package/bin/runners/lib/contracts/route-contract.js +199 -0
- package/bin/runners/lib/contracts.js +804 -0
- package/bin/runners/lib/detect.js +89 -0
- package/bin/runners/lib/detectors-v2.js +703 -0
- package/bin/runners/lib/doctor/autofix.js +254 -0
- package/bin/runners/lib/doctor/index.js +37 -0
- package/bin/runners/lib/doctor/modules/dependencies.js +325 -0
- package/bin/runners/lib/doctor/modules/index.js +46 -0
- package/bin/runners/lib/doctor/modules/network.js +250 -0
- package/bin/runners/lib/doctor/modules/project.js +312 -0
- package/bin/runners/lib/doctor/modules/runtime.js +224 -0
- package/bin/runners/lib/doctor/modules/security.js +348 -0
- package/bin/runners/lib/doctor/modules/system.js +213 -0
- package/bin/runners/lib/doctor/modules/vibecheck.js +394 -0
- package/bin/runners/lib/doctor/reporter.js +262 -0
- package/bin/runners/lib/doctor/service.js +262 -0
- package/bin/runners/lib/doctor/types.js +113 -0
- package/bin/runners/lib/doctor/ui.js +263 -0
- package/bin/runners/lib/doctor-enhanced.js +233 -0
- package/bin/runners/lib/doctor-v2.js +608 -0
- package/bin/runners/lib/drift.js +425 -0
- package/bin/runners/lib/enforcement.js +72 -0
- package/bin/runners/lib/entitlements.js +8 -3
- package/bin/runners/lib/env-resolver.js +417 -0
- package/bin/runners/lib/extractors/client-calls.js +990 -0
- package/bin/runners/lib/extractors/fastify-route-dump.js +573 -0
- package/bin/runners/lib/extractors/fastify-routes.js +426 -0
- package/bin/runners/lib/extractors/index.js +363 -0
- package/bin/runners/lib/extractors/next-routes.js +524 -0
- package/bin/runners/lib/extractors/proof-graph.js +431 -0
- package/bin/runners/lib/extractors/route-matcher.js +451 -0
- package/bin/runners/lib/extractors/truthpack-v2.js +377 -0
- package/bin/runners/lib/extractors/ui-bindings.js +547 -0
- package/bin/runners/lib/findings-schema.js +281 -0
- package/bin/runners/lib/html-report.js +650 -0
- package/bin/runners/lib/missions/templates.js +45 -0
- package/bin/runners/lib/policy.js +295 -0
- package/bin/runners/lib/reality/correlation-detectors.js +359 -0
- package/bin/runners/lib/reality/index.js +318 -0
- package/bin/runners/lib/reality/request-hashing.js +416 -0
- package/bin/runners/lib/reality/request-mapper.js +453 -0
- package/bin/runners/lib/reality/safety-rails.js +463 -0
- package/bin/runners/lib/reality/semantic-snapshot.js +408 -0
- package/bin/runners/lib/reality/toast-detector.js +393 -0
- package/bin/runners/lib/route-truth.js +10 -10
- package/bin/runners/lib/schema-validator.js +350 -0
- package/bin/runners/lib/schemas/contracts.schema.json +160 -0
- package/bin/runners/lib/schemas/finding.schema.json +100 -0
- package/bin/runners/lib/schemas/mission-pack.schema.json +206 -0
- package/bin/runners/lib/schemas/proof-graph.schema.json +176 -0
- package/bin/runners/lib/schemas/reality-report.schema.json +162 -0
- package/bin/runners/lib/schemas/share-pack.schema.json +180 -0
- package/bin/runners/lib/schemas/ship-report.schema.json +117 -0
- package/bin/runners/lib/schemas/truthpack-v2.schema.json +303 -0
- package/bin/runners/lib/schemas/validator.js +438 -0
- package/bin/runners/lib/verdict-engine.js +628 -0
- package/bin/runners/runAIAgent.js +228 -1
- package/bin/runners/runBadge.js +181 -1
- package/bin/runners/runCtxDiff.js +301 -0
- package/bin/runners/runInitGha.js +78 -15
- package/bin/runners/runLaunch.js +180 -1
- package/bin/runners/runProve.js +23 -0
- package/bin/runners/runReplay.js +114 -84
- package/bin/runners/runScan.js +111 -32
- package/bin/runners/runShip.js +23 -2
- package/bin/runners/runTruthpack.js +9 -7
- package/bin/runners/runValidate.js +161 -1
- package/bin/vibecheck.js +6 -1
- 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
|
+
};
|