@vibecheckai/cli 3.7.0 → 3.9.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 (118) 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 +634 -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/interceptor/base.js +7 -3
  26. package/bin/runners/lib/agent-firewall/session/collector.js +451 -0
  27. package/bin/runners/lib/agent-firewall/session/index.js +26 -0
  28. package/bin/runners/lib/artifact-envelope.js +540 -0
  29. package/bin/runners/lib/auth-shared.js +977 -0
  30. package/bin/runners/lib/checkpoint.js +941 -0
  31. package/bin/runners/lib/cleanup/engine.js +571 -0
  32. package/bin/runners/lib/cleanup/index.js +53 -0
  33. package/bin/runners/lib/cleanup/output.js +375 -0
  34. package/bin/runners/lib/cleanup/rules.js +1060 -0
  35. package/bin/runners/lib/doctor/diagnosis-receipt.js +454 -0
  36. package/bin/runners/lib/doctor/failure-signatures.js +526 -0
  37. package/bin/runners/lib/doctor/fix-script.js +336 -0
  38. package/bin/runners/lib/doctor/modules/build-tools.js +453 -0
  39. package/bin/runners/lib/doctor/modules/index.js +62 -3
  40. package/bin/runners/lib/doctor/modules/os-quirks.js +706 -0
  41. package/bin/runners/lib/doctor/modules/repo-integrity.js +485 -0
  42. package/bin/runners/lib/doctor/safe-repair.js +384 -0
  43. package/bin/runners/lib/engine/ast-cache.js +210 -210
  44. package/bin/runners/lib/engine/auth-extractor.js +211 -211
  45. package/bin/runners/lib/engine/billing-extractor.js +112 -112
  46. package/bin/runners/lib/engine/enforcement-extractor.js +100 -100
  47. package/bin/runners/lib/engine/env-extractor.js +207 -207
  48. package/bin/runners/lib/engine/express-extractor.js +208 -208
  49. package/bin/runners/lib/engine/extractors.js +849 -849
  50. package/bin/runners/lib/engine/index.js +207 -207
  51. package/bin/runners/lib/engine/repo-index.js +514 -514
  52. package/bin/runners/lib/engine/types.js +124 -124
  53. package/bin/runners/lib/engines/attack-detector.js +1192 -0
  54. package/bin/runners/lib/entitlements-v2.js +2 -2
  55. package/bin/runners/lib/missions/briefing.js +427 -0
  56. package/bin/runners/lib/missions/checkpoint.js +753 -0
  57. package/bin/runners/lib/missions/hardening.js +851 -0
  58. package/bin/runners/lib/missions/plan.js +421 -32
  59. package/bin/runners/lib/missions/safety-gates.js +645 -0
  60. package/bin/runners/lib/missions/schema.js +478 -0
  61. package/bin/runners/lib/packs/bundle.js +675 -0
  62. package/bin/runners/lib/packs/evidence-pack.js +671 -0
  63. package/bin/runners/lib/packs/pack-factory.js +837 -0
  64. package/bin/runners/lib/packs/permissions-pack.js +686 -0
  65. package/bin/runners/lib/packs/proof-graph-pack.js +779 -0
  66. package/bin/runners/lib/safelist/index.js +96 -0
  67. package/bin/runners/lib/safelist/integration.js +334 -0
  68. package/bin/runners/lib/safelist/matcher.js +696 -0
  69. package/bin/runners/lib/safelist/schema.js +948 -0
  70. package/bin/runners/lib/safelist/store.js +438 -0
  71. package/bin/runners/lib/schemas/ship-manifest.schema.json +251 -0
  72. package/bin/runners/lib/ship-gate.js +832 -0
  73. package/bin/runners/lib/ship-manifest.js +1153 -0
  74. package/bin/runners/lib/ship-output.js +1 -1
  75. package/bin/runners/lib/unified-cli-output.js +710 -383
  76. package/bin/runners/lib/upsell.js +3 -3
  77. package/bin/runners/lib/why-tree.js +650 -0
  78. package/bin/runners/runAllowlist.js +33 -4
  79. package/bin/runners/runApprove.js +240 -1122
  80. package/bin/runners/runAudit.js +692 -0
  81. package/bin/runners/runAuth.js +325 -29
  82. package/bin/runners/runCheckpoint.js +442 -494
  83. package/bin/runners/runCleanup.js +343 -0
  84. package/bin/runners/runDoctor.js +269 -19
  85. package/bin/runners/runFix.js +411 -32
  86. package/bin/runners/runForge.js +411 -0
  87. package/bin/runners/runIntent.js +906 -0
  88. package/bin/runners/runKickoff.js +878 -0
  89. package/bin/runners/runLaunch.js +2000 -0
  90. package/bin/runners/runLink.js +785 -0
  91. package/bin/runners/runMcp.js +1741 -837
  92. package/bin/runners/runPacks.js +2089 -0
  93. package/bin/runners/runPolish.js +41 -0
  94. package/bin/runners/runReality.js +178 -1
  95. package/bin/runners/runSafelist.js +1190 -0
  96. package/bin/runners/runScan.js +21 -9
  97. package/bin/runners/runShield.js +1282 -0
  98. package/bin/runners/runShip.js +395 -16
  99. package/bin/vibecheck.js +34 -6
  100. package/mcp-server/README.md +117 -158
  101. package/mcp-server/handlers/index.ts +2 -2
  102. package/mcp-server/handlers/tool-handler.ts +50 -11
  103. package/mcp-server/index.js +16 -0
  104. package/mcp-server/intent-firewall-interceptor.js +529 -0
  105. package/mcp-server/lib/executor.ts +5 -5
  106. package/mcp-server/lib/index.ts +14 -4
  107. package/mcp-server/lib/sandbox.test.ts +4 -4
  108. package/mcp-server/lib/sandbox.ts +2 -2
  109. package/mcp-server/manifest.json +473 -0
  110. package/mcp-server/package.json +1 -1
  111. package/mcp-server/registry/tool-registry.js +315 -523
  112. package/mcp-server/registry/tools.json +442 -428
  113. package/mcp-server/registry.test.ts +18 -12
  114. package/mcp-server/tier-auth.js +68 -11
  115. package/mcp-server/tools-v3.js +70 -16
  116. package/mcp-server/tsconfig.json +1 -0
  117. package/package.json +2 -1
  118. package/bin/runners/runProof.zip +0 -0
@@ -1,207 +1,207 @@
1
- // bin/runners/lib/engine/index.js
2
- // Main entry point for the vNext scanner engine
3
-
4
- const { RepoIndex, DEFAULT_IGNORE, PREFILTER_TOKENS } = require("./repo-index");
5
- const { ASTCache, globalASTCache, DEFAULT_PARSER_OPTIONS } = require("./ast-cache");
6
- const {
7
- extractNextAppRoutes,
8
- extractNextPagesRoutes,
9
- extractClientRefs,
10
- extractFastifyRoutes,
11
- detectFastifyEntries,
12
- canonicalizeMethod,
13
- canonicalizePath,
14
- joinPaths,
15
- } = require("./extractors");
16
- const {
17
- extractEnvUsage,
18
- extractEnvDeclared,
19
- buildEnvTruthV2,
20
- } = require("./env-extractor");
21
- const { buildBillingTruthV2 } = require("./billing-extractor");
22
- const { buildAuthTruthV2 } = require("./auth-extractor");
23
- const { buildEnforcementTruthV2 } = require("./enforcement-extractor");
24
- const { extractExpressRoutes } = require("./express-extractor");
25
-
26
- /**
27
- * Create a RepoIndex for a repository
28
- *
29
- * @param {string} repoRoot - Absolute path to repo root
30
- * @param {Object} [options]
31
- * @param {string[]} [options.ignorePatterns] - Additional ignore patterns
32
- * @param {boolean} [options.buildTokenIndex] - Whether to build token index (default: true)
33
- * @returns {Promise<RepoIndex>}
34
- *
35
- * @example
36
- * const index = await createIndex('/path/to/repo');
37
- * console.log(`Indexed ${index.stats.totalFiles} files in ${index.stats.indexTimeMs}ms`);
38
- * console.log('Detected frameworks:', Array.from(index.signals.detectedFrameworks));
39
- */
40
- async function createIndex(repoRoot, options = {}) {
41
- const index = new RepoIndex(repoRoot, options);
42
- await index.build();
43
- return index;
44
- }
45
-
46
- /**
47
- * Log index summary for debugging
48
- * @param {RepoIndex} index
49
- */
50
- function logIndexSummary(index) {
51
- const frameworks = Array.from(index.signals.detectedFrameworks).join(", ") || "none";
52
-
53
- console.log(`📁 RepoIndex Summary:`);
54
- console.log(` Files: ${index.stats.totalFiles}`);
55
- console.log(` Size: ${(index.stats.totalSize / 1024 / 1024).toFixed(2)} MB`);
56
- console.log(` Time: ${index.stats.indexTimeMs}ms`);
57
- console.log(` Frameworks: ${frameworks}`);
58
-
59
- if (index.signals.hasNextApp || index.signals.hasNextPages) {
60
- console.log(` Next.js: app=${index.signals.hasNextApp}, pages=${index.signals.hasNextPages}`);
61
- }
62
- if (index.signals.hasOpenAPI) {
63
- console.log(` OpenAPI: detected`);
64
- }
65
- if (index.signals.hasGraphQL) {
66
- console.log(` GraphQL: detected`);
67
- }
68
- }
69
-
70
- /**
71
- * Get files that need Fastify scanning (prefiltered)
72
- * @param {RepoIndex} index
73
- * @returns {string[]} - Absolute paths
74
- */
75
- function getFastifyFiles(index) {
76
- if (!index.hasFramework("fastify")) return [];
77
-
78
- return index.getByAnyToken([
79
- "fastify",
80
- "Fastify",
81
- "register",
82
- ]).filter(abs => {
83
- const ext = abs.split(".").pop();
84
- return ["ts", "tsx", "js", "jsx", "mjs", "cjs"].includes(ext);
85
- });
86
- }
87
-
88
- /**
89
- * Get files that need Express scanning (prefiltered)
90
- * @param {RepoIndex} index
91
- * @returns {string[]} - Absolute paths
92
- */
93
- function getExpressFiles(index) {
94
- if (!index.hasFramework("express")) return [];
95
-
96
- return index.getByAnyToken([
97
- "express",
98
- "Express",
99
- "app.get",
100
- "app.post",
101
- "router.get",
102
- "router.post",
103
- ]).filter(abs => {
104
- const ext = abs.split(".").pop();
105
- return ["ts", "tsx", "js", "jsx", "mjs", "cjs"].includes(ext);
106
- });
107
- }
108
-
109
- /**
110
- * Get files that need client ref scanning (prefiltered)
111
- * @param {RepoIndex} index
112
- * @returns {string[]} - Absolute paths
113
- */
114
- function getClientRefFiles(index) {
115
- return index.getByAnyToken([
116
- "fetch(",
117
- "axios",
118
- "useSWR",
119
- "useQuery",
120
- ]).filter(abs => {
121
- const ext = abs.split(".").pop();
122
- return ["ts", "tsx", "js", "jsx", "mjs", "cjs"].includes(ext);
123
- });
124
- }
125
-
126
- /**
127
- * Get files that need env var scanning (prefiltered)
128
- * @param {RepoIndex} index
129
- * @returns {string[]} - Absolute paths
130
- */
131
- function getEnvFiles(index) {
132
- return index.getByAnyToken([
133
- "process.env",
134
- "import.meta.env",
135
- "os.environ",
136
- "getenv",
137
- ]);
138
- }
139
-
140
- /**
141
- * Get Next.js app router route files
142
- * @param {RepoIndex} index
143
- * @returns {import('./types').FileRecord[]}
144
- */
145
- function getNextAppRoutes(index) {
146
- return index.files.filter(f =>
147
- f.rel.includes("/app/") &&
148
- f.rel.includes("/api/") &&
149
- /route\.(ts|tsx|js|jsx)$/.test(f.rel)
150
- );
151
- }
152
-
153
- /**
154
- * Get Next.js pages router API files
155
- * @param {RepoIndex} index
156
- * @returns {import('./types').FileRecord[]}
157
- */
158
- function getNextPagesRoutes(index) {
159
- return index.files.filter(f =>
160
- f.rel.includes("/pages/api/") &&
161
- /\.(ts|tsx|js|jsx)$/.test(f.rel) &&
162
- !f.rel.includes("/_")
163
- );
164
- }
165
-
166
- module.exports = {
167
- // Core classes
168
- RepoIndex,
169
- ASTCache,
170
-
171
- // Factory functions
172
- createIndex,
173
-
174
- // Optimized extractors (use RepoIndex)
175
- extractNextAppRoutes,
176
- extractNextPagesRoutes,
177
- extractClientRefs,
178
- extractFastifyRoutes,
179
- detectFastifyEntries,
180
- extractEnvUsage,
181
- extractEnvDeclared,
182
- buildEnvTruthV2,
183
- buildBillingTruthV2,
184
- buildAuthTruthV2,
185
- buildEnforcementTruthV2,
186
- extractExpressRoutes,
187
-
188
- // Utilities
189
- logIndexSummary,
190
- getFastifyFiles,
191
- getExpressFiles,
192
- getClientRefFiles,
193
- getEnvFiles,
194
- getNextAppRoutes,
195
- getNextPagesRoutes,
196
- canonicalizeMethod,
197
- canonicalizePath,
198
- joinPaths,
199
-
200
- // Shared instances
201
- globalASTCache,
202
-
203
- // Constants
204
- DEFAULT_IGNORE,
205
- PREFILTER_TOKENS,
206
- DEFAULT_PARSER_OPTIONS,
207
- };
1
+ // bin/runners/lib/engine/index.js
2
+ // Main entry point for the vNext scanner engine
3
+
4
+ const { RepoIndex, DEFAULT_IGNORE, PREFILTER_TOKENS } = require("./repo-index");
5
+ const { ASTCache, globalASTCache, DEFAULT_PARSER_OPTIONS } = require("./ast-cache");
6
+ const {
7
+ extractNextAppRoutes,
8
+ extractNextPagesRoutes,
9
+ extractClientRefs,
10
+ extractFastifyRoutes,
11
+ detectFastifyEntries,
12
+ canonicalizeMethod,
13
+ canonicalizePath,
14
+ joinPaths,
15
+ } = require("./extractors");
16
+ const {
17
+ extractEnvUsage,
18
+ extractEnvDeclared,
19
+ buildEnvTruthV2,
20
+ } = require("./env-extractor");
21
+ const { buildBillingTruthV2 } = require("./billing-extractor");
22
+ const { buildAuthTruthV2 } = require("./auth-extractor");
23
+ const { buildEnforcementTruthV2 } = require("./enforcement-extractor");
24
+ const { extractExpressRoutes } = require("./express-extractor");
25
+
26
+ /**
27
+ * Create a RepoIndex for a repository
28
+ *
29
+ * @param {string} repoRoot - Absolute path to repo root
30
+ * @param {Object} [options]
31
+ * @param {string[]} [options.ignorePatterns] - Additional ignore patterns
32
+ * @param {boolean} [options.buildTokenIndex] - Whether to build token index (default: true)
33
+ * @returns {Promise<RepoIndex>}
34
+ *
35
+ * @example
36
+ * const index = await createIndex('/path/to/repo');
37
+ * console.log(`Indexed ${index.stats.totalFiles} files in ${index.stats.indexTimeMs}ms`);
38
+ * console.log('Detected frameworks:', Array.from(index.signals.detectedFrameworks));
39
+ */
40
+ async function createIndex(repoRoot, options = {}) {
41
+ const index = new RepoIndex(repoRoot, options);
42
+ await index.build();
43
+ return index;
44
+ }
45
+
46
+ /**
47
+ * Log index summary for debugging
48
+ * @param {RepoIndex} index
49
+ */
50
+ function logIndexSummary(index) {
51
+ const frameworks = Array.from(index.signals.detectedFrameworks).join(", ") || "none";
52
+
53
+ console.log(`📁 RepoIndex Summary:`);
54
+ console.log(` Files: ${index.stats.totalFiles}`);
55
+ console.log(` Size: ${(index.stats.totalSize / 1024 / 1024).toFixed(2)} MB`);
56
+ console.log(` Time: ${index.stats.indexTimeMs}ms`);
57
+ console.log(` Frameworks: ${frameworks}`);
58
+
59
+ if (index.signals.hasNextApp || index.signals.hasNextPages) {
60
+ console.log(` Next.js: app=${index.signals.hasNextApp}, pages=${index.signals.hasNextPages}`);
61
+ }
62
+ if (index.signals.hasOpenAPI) {
63
+ console.log(` OpenAPI: detected`);
64
+ }
65
+ if (index.signals.hasGraphQL) {
66
+ console.log(` GraphQL: detected`);
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Get files that need Fastify scanning (prefiltered)
72
+ * @param {RepoIndex} index
73
+ * @returns {string[]} - Absolute paths
74
+ */
75
+ function getFastifyFiles(index) {
76
+ if (!index.hasFramework("fastify")) return [];
77
+
78
+ return index.getByAnyToken([
79
+ "fastify",
80
+ "Fastify",
81
+ "register",
82
+ ]).filter(abs => {
83
+ const ext = abs.split(".").pop();
84
+ return ["ts", "tsx", "js", "jsx", "mjs", "cjs"].includes(ext);
85
+ });
86
+ }
87
+
88
+ /**
89
+ * Get files that need Express scanning (prefiltered)
90
+ * @param {RepoIndex} index
91
+ * @returns {string[]} - Absolute paths
92
+ */
93
+ function getExpressFiles(index) {
94
+ if (!index.hasFramework("express")) return [];
95
+
96
+ return index.getByAnyToken([
97
+ "express",
98
+ "Express",
99
+ "app.get",
100
+ "app.post",
101
+ "router.get",
102
+ "router.post",
103
+ ]).filter(abs => {
104
+ const ext = abs.split(".").pop();
105
+ return ["ts", "tsx", "js", "jsx", "mjs", "cjs"].includes(ext);
106
+ });
107
+ }
108
+
109
+ /**
110
+ * Get files that need client ref scanning (prefiltered)
111
+ * @param {RepoIndex} index
112
+ * @returns {string[]} - Absolute paths
113
+ */
114
+ function getClientRefFiles(index) {
115
+ return index.getByAnyToken([
116
+ "fetch(",
117
+ "axios",
118
+ "useSWR",
119
+ "useQuery",
120
+ ]).filter(abs => {
121
+ const ext = abs.split(".").pop();
122
+ return ["ts", "tsx", "js", "jsx", "mjs", "cjs"].includes(ext);
123
+ });
124
+ }
125
+
126
+ /**
127
+ * Get files that need env var scanning (prefiltered)
128
+ * @param {RepoIndex} index
129
+ * @returns {string[]} - Absolute paths
130
+ */
131
+ function getEnvFiles(index) {
132
+ return index.getByAnyToken([
133
+ "process.env",
134
+ "import.meta.env",
135
+ "os.environ",
136
+ "getenv",
137
+ ]);
138
+ }
139
+
140
+ /**
141
+ * Get Next.js app router route files
142
+ * @param {RepoIndex} index
143
+ * @returns {import('./types').FileRecord[]}
144
+ */
145
+ function getNextAppRoutes(index) {
146
+ return index.files.filter(f =>
147
+ f.rel.includes("/app/") &&
148
+ f.rel.includes("/api/") &&
149
+ /route\.(ts|tsx|js|jsx)$/.test(f.rel)
150
+ );
151
+ }
152
+
153
+ /**
154
+ * Get Next.js pages router API files
155
+ * @param {RepoIndex} index
156
+ * @returns {import('./types').FileRecord[]}
157
+ */
158
+ function getNextPagesRoutes(index) {
159
+ return index.files.filter(f =>
160
+ f.rel.includes("/pages/api/") &&
161
+ /\.(ts|tsx|js|jsx)$/.test(f.rel) &&
162
+ !f.rel.includes("/_")
163
+ );
164
+ }
165
+
166
+ module.exports = {
167
+ // Core classes
168
+ RepoIndex,
169
+ ASTCache,
170
+
171
+ // Factory functions
172
+ createIndex,
173
+
174
+ // Optimized extractors (use RepoIndex)
175
+ extractNextAppRoutes,
176
+ extractNextPagesRoutes,
177
+ extractClientRefs,
178
+ extractFastifyRoutes,
179
+ detectFastifyEntries,
180
+ extractEnvUsage,
181
+ extractEnvDeclared,
182
+ buildEnvTruthV2,
183
+ buildBillingTruthV2,
184
+ buildAuthTruthV2,
185
+ buildEnforcementTruthV2,
186
+ extractExpressRoutes,
187
+
188
+ // Utilities
189
+ logIndexSummary,
190
+ getFastifyFiles,
191
+ getExpressFiles,
192
+ getClientRefFiles,
193
+ getEnvFiles,
194
+ getNextAppRoutes,
195
+ getNextPagesRoutes,
196
+ canonicalizeMethod,
197
+ canonicalizePath,
198
+ joinPaths,
199
+
200
+ // Shared instances
201
+ globalASTCache,
202
+
203
+ // Constants
204
+ DEFAULT_IGNORE,
205
+ PREFILTER_TOKENS,
206
+ DEFAULT_PARSER_OPTIONS,
207
+ };