@vibecheck-ai/mcp 24.6.8 → 24.6.11

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 (41) hide show
  1. package/README.md +1 -1
  2. package/dist/APITruthEngine-IZRR3NT5-LPFUOMLD.js +9 -0
  3. package/dist/CredentialsEngine-B66ANCBB-HY5ZQTSX.js +9 -0
  4. package/dist/EnvVarEngine-ZFNW2XKP-6HRTZULP.js +9 -0
  5. package/dist/ErrorHandlingEngine-VAHVDVFG-3GDGRN3U.js +11 -0
  6. package/dist/FrameworkPackEngine-RRBJW4MC-KH7WRXXS.js +12 -0
  7. package/dist/GhostRouteEngine-UMYBCOCL-MSZOPVZY.js +9 -0
  8. package/dist/LogicGapEngine-OK5UKZQ5-YGXZDERB.js +11 -0
  9. package/dist/PhantomDepEngine-HQEXAS25-TRVEXBMF.js +10 -0
  10. package/dist/SecurityEngine-MVMRPKLH-BNP7IC46.js +9 -0
  11. package/dist/VersionHallucinationEngine-673DJ26J-BD4SK6JX.js +9 -0
  12. package/dist/chokidar-CI5VJY5M.js +2414 -0
  13. package/dist/chunk-43XAAYST.js +863 -0
  14. package/dist/chunk-5DADZJ3D.js +650 -0
  15. package/dist/chunk-DDTUTWRY.js +605 -0
  16. package/dist/chunk-DGNNNAVK.js +304 -0
  17. package/dist/chunk-F34MHA6A.js +772 -0
  18. package/dist/chunk-FGMVY5QW.js +42 -0
  19. package/dist/chunk-G3FQJC2H.js +1968 -0
  20. package/dist/chunk-J52EUKKW.js +196 -0
  21. package/dist/chunk-JZSHXEYP.js +915 -0
  22. package/dist/chunk-LQSBUKYZ.js +551 -0
  23. package/dist/chunk-MUP4JXOF.js +219 -0
  24. package/dist/chunk-NR36RTVO.js +152 -0
  25. package/dist/chunk-QFDZMUGO.js +213300 -0
  26. package/dist/chunk-QGPX6H6L.js +3044 -0
  27. package/dist/chunk-QYXENOVK.js +499 -0
  28. package/dist/chunk-RNFMO5GH.js +8861 -0
  29. package/dist/chunk-RR5ETBSV.js +66 -0
  30. package/dist/chunk-YWUMPN4Z.js +53 -0
  31. package/dist/dist-HFMJ3GIR.js +1091 -0
  32. package/dist/dist-JUOVMQEA.js +9 -0
  33. package/dist/dist-NXITTS32-O3XLWR6T.js +386 -0
  34. package/dist/dist-OUJKMVTB.js +22 -0
  35. package/dist/fingerprint-NOJ7TDB6-K6SB7LCZ.js +9 -0
  36. package/dist/index.js +4735 -3577
  37. package/dist/semantic-WW6XVII4.js +8544 -0
  38. package/dist/transformers.node-K4WKH4PR.js +45809 -0
  39. package/dist/tree-sitter-AGICL65I.js +1412 -0
  40. package/dist/tree-sitter-H5E7LKR4-MKO3NNLJ.js +9 -0
  41. package/package.json +7 -6
@@ -0,0 +1,219 @@
1
+ import { createRequire } from 'module';
2
+ import { fileURLToPath } from 'url';
3
+ import * as path from 'path';
4
+ import { dirname } from 'path';
5
+ import { BaseEngine } from './chunk-RR5ETBSV.js';
6
+ import { computeWorkspaceFingerprint } from './chunk-FGMVY5QW.js';
7
+
8
+ createRequire(import.meta.url);
9
+ const __filename$1 = fileURLToPath(import.meta.url);
10
+ dirname(__filename$1);
11
+ var APP_DIR_RE = /(?:^|\/)app\/|^app\//;
12
+ var PAGES_DIR_RE = /(?:^|\/)pages\/|^pages\//;
13
+ var SRC_APP_RE = /(?:^|\/)src\/app\/|^src\/app\//;
14
+ var SRC_PAGES_RE = /(?:^|\/)src\/pages\/|^src\/pages\//;
15
+ function isNextAppPath(rel) {
16
+ const n = rel.replace(/\\/g, "/");
17
+ return APP_DIR_RE.test(n) || PAGES_DIR_RE.test(n) || SRC_APP_RE.test(n) || SRC_PAGES_RE.test(n);
18
+ }
19
+ function isTestOrStoryPath(rel) {
20
+ const lower = rel.toLowerCase();
21
+ return /\.(test|spec)\.[cm]?[jt]sx?$/i.test(lower) || /__tests__\//i.test(lower) || /\.stories\.[cm]?[jt]sx?$/i.test(lower);
22
+ }
23
+ function hasUseClientDirective(source) {
24
+ const lines = source.split("\n");
25
+ for (let i = 0; i < Math.min(40, lines.length); i++) {
26
+ const t = lines[i].trim();
27
+ if (!t || t.startsWith("//")) continue;
28
+ if (/^['"]use client['"]\s*;?\s*$/.test(t)) return true;
29
+ }
30
+ return false;
31
+ }
32
+ var BROWSER_GLOBAL_RE = /\bwindow\.|\bdocument\.|\blocalStorage\b|\bsessionStorage\b|\bnavigator\.(?:clipboard|geolocation)/;
33
+ var nextjsPackRules = [
34
+ {
35
+ ruleId: "NEXT001",
36
+ pack: "nextjs",
37
+ fileFilter(ctx) {
38
+ if (!ctx.fingerprint.packs.has("nextjs")) return false;
39
+ const ext = ctx.filePath.toLowerCase();
40
+ if (!/\.(tsx|jsx|ts|js)$/.test(ext)) return false;
41
+ if (!isNextAppPath(ctx.relativePath)) return false;
42
+ if (isTestOrStoryPath(ctx.relativePath)) return false;
43
+ if (/middleware\.[jt]s$/i.test(ctx.filePath)) return false;
44
+ return true;
45
+ },
46
+ run(ctx, emit) {
47
+ if (hasUseClientDirective(ctx.source)) return;
48
+ for (let i = 0; i < ctx.lines.length; i++) {
49
+ const line = ctx.lines[i];
50
+ const trimmed = line.trim();
51
+ if (trimmed.startsWith("//") || trimmed.startsWith("*")) continue;
52
+ if (!BROWSER_GLOBAL_RE.test(line)) continue;
53
+ emit({
54
+ id: "",
55
+ severity: "medium",
56
+ category: "nextjs",
57
+ file: ctx.filePath,
58
+ line: i + 1,
59
+ column: 0,
60
+ message: 'Browser-only API in a Next.js app/pages file without a "use client" directive \u2014 this may break RSC / server components.',
61
+ evidence: trimmed.slice(0, 120),
62
+ suggestion: 'Add "use client" at the top if this must run on the client, or move the logic to a Client Component and import it from the server file.',
63
+ confidence: 0.82,
64
+ autoFixable: false,
65
+ ruleId: "NEXT001"
66
+ });
67
+ return;
68
+ }
69
+ }
70
+ }
71
+ ];
72
+ function hasUseClientDirective2(source) {
73
+ const lines = source.split("\n");
74
+ for (let i = 0; i < Math.min(40, lines.length); i++) {
75
+ const t = lines[i].trim();
76
+ if (!t || t.startsWith("//")) continue;
77
+ if (/^['"]use client['"]\s*;?\s*$/.test(t)) return true;
78
+ }
79
+ return false;
80
+ }
81
+ var STRIPE_SDK_IMPORT_RE = /from\s+['"]stripe['"]|require\s*\(\s*['"]stripe['"]\s*\)/;
82
+ var stripePackRules = [
83
+ {
84
+ ruleId: "STRIPE001",
85
+ pack: "stripe",
86
+ fileFilter(ctx) {
87
+ if (!ctx.fingerprint.packs.has("stripe")) return false;
88
+ if (!/\.(tsx|jsx|ts|js)$/.test(ctx.filePath.toLowerCase())) return false;
89
+ if (!hasUseClientDirective2(ctx.source)) return false;
90
+ return STRIPE_SDK_IMPORT_RE.test(ctx.source);
91
+ },
92
+ run(ctx, emit) {
93
+ let line = 1;
94
+ for (let i = 0; i < ctx.lines.length; i++) {
95
+ if (STRIPE_SDK_IMPORT_RE.test(ctx.lines[i])) {
96
+ line = i + 1;
97
+ break;
98
+ }
99
+ }
100
+ emit({
101
+ id: "",
102
+ severity: "high",
103
+ category: "stripe",
104
+ file: ctx.filePath,
105
+ line,
106
+ column: 0,
107
+ message: 'The `stripe` Node SDK is referenced in a file marked "use client" \u2014 secret keys and server-only APIs must not ship to the browser bundle.',
108
+ evidence: ctx.lines[line - 1]?.trim().slice(0, 100) ?? "stripe",
109
+ suggestion: "Move Stripe calls to a Route Handler, Server Action, or other server-only module; use @stripe/stripe-js only for publishable-key flows on the client.",
110
+ confidence: 0.9,
111
+ autoFixable: false,
112
+ ruleId: "STRIPE001"
113
+ });
114
+ }
115
+ },
116
+ {
117
+ ruleId: "STRIPE002",
118
+ pack: "stripe",
119
+ fileFilter(ctx) {
120
+ if (!ctx.fingerprint.packs.has("stripe")) return false;
121
+ if (!/\.(tsx?|jsx?)$/.test(ctx.filePath.toLowerCase())) return false;
122
+ const s = ctx.source;
123
+ if (!/constructEvent\s*\(/.test(s)) return false;
124
+ if (!/express\.json\s*\(/.test(s) && !/bodyParser\.json\s*\(/.test(s)) return false;
125
+ return true;
126
+ },
127
+ run(ctx, emit) {
128
+ let line = 1;
129
+ for (let i = 0; i < ctx.lines.length; i++) {
130
+ if (/constructEvent\s*\(/.test(ctx.lines[i])) {
131
+ line = i + 1;
132
+ break;
133
+ }
134
+ }
135
+ emit({
136
+ id: "",
137
+ severity: "medium",
138
+ category: "stripe",
139
+ file: ctx.filePath,
140
+ line,
141
+ column: 0,
142
+ message: "Stripe `constructEvent` needs the raw request body; `express.json()` (or `bodyParser.json()`) consumes the body and can invalidate signature verification.",
143
+ evidence: ctx.lines[line - 1]?.trim().slice(0, 100) ?? "constructEvent",
144
+ suggestion: "Use `express.raw({ type: 'application/json' })` on the webhook route, or a dedicated raw body parser, and skip global JSON middleware for that path.",
145
+ confidence: 0.68,
146
+ autoFixable: false,
147
+ ruleId: "STRIPE002"
148
+ });
149
+ }
150
+ }
151
+ ];
152
+ var ALL_PACK_RULES = [...nextjsPackRules, ...stripePackRules];
153
+ var FrameworkPackEngine = class extends BaseEngine {
154
+ constructor(_workspaceRoot, _minConfidence = 0.72) {
155
+ super();
156
+ this._workspaceRoot = _workspaceRoot;
157
+ this._minConfidence = _minConfidence;
158
+ }
159
+ id = "framework_packs";
160
+ name = "Framework Pack Engine";
161
+ version = "1.0.0";
162
+ supportedExtensions = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx"]);
163
+ _fingerprint = null;
164
+ async activate() {
165
+ this._fingerprint = computeWorkspaceFingerprint(this._workspaceRoot);
166
+ }
167
+ _getFingerprint() {
168
+ if (!this._fingerprint) {
169
+ this._fingerprint = computeWorkspaceFingerprint(this._workspaceRoot);
170
+ }
171
+ return this._fingerprint;
172
+ }
173
+ async scan(delta, signal) {
174
+ const fingerprint = this._getFingerprint();
175
+ if (fingerprint.packs.size === 0) return [];
176
+ const filePath = delta.documentUri.replace(/^file:\/\//, "");
177
+ const source = delta.fullText;
178
+ const lines = delta.lines ?? source.split("\n");
179
+ const rel = path.relative(this._workspaceRoot, filePath).replace(/\\/g, "/");
180
+ const ctx = {
181
+ delta,
182
+ filePath,
183
+ relativePath: rel,
184
+ lines,
185
+ source,
186
+ fingerprint,
187
+ signal
188
+ };
189
+ const findings = [];
190
+ const emit = (partial) => {
191
+ const ruleId = partial.ruleId ?? "PACK";
192
+ const id = this.deterministicId(
193
+ filePath,
194
+ partial.line,
195
+ partial.column ?? 0,
196
+ ruleId,
197
+ partial.evidence ?? partial.message
198
+ );
199
+ return this.createFinding({
200
+ ...partial,
201
+ id,
202
+ engine: "framework_packs"
203
+ });
204
+ };
205
+ for (const rule of ALL_PACK_RULES) {
206
+ this.checkAbort(signal);
207
+ if (!fingerprint.packs.has(rule.pack)) continue;
208
+ if (!rule.fileFilter(ctx)) continue;
209
+ rule.run(ctx, (partial) => {
210
+ const f = emit(partial);
211
+ findings.push(f);
212
+ return f;
213
+ });
214
+ }
215
+ return findings.filter((f) => (f.confidence ?? 0) >= this._minConfidence);
216
+ }
217
+ };
218
+
219
+ export { FrameworkPackEngine };
@@ -0,0 +1,152 @@
1
+ import { createRequire } from 'module';
2
+ import { fileURLToPath } from 'url';
3
+ import { dirname } from 'path';
4
+
5
+ createRequire(import.meta.url);
6
+ const __filename$1 = fileURLToPath(import.meta.url);
7
+ dirname(__filename$1);
8
+
9
+ // ../engines/dist/chunk-VCMLDVRT.js
10
+ var NODE_BUILTINS = /* @__PURE__ */ new Set([
11
+ "assert",
12
+ "assert/strict",
13
+ "async_hooks",
14
+ "buffer",
15
+ "child_process",
16
+ "cluster",
17
+ "console",
18
+ "constants",
19
+ "crypto",
20
+ "dgram",
21
+ "diagnostics_channel",
22
+ "dns",
23
+ "dns/promises",
24
+ "domain",
25
+ "events",
26
+ "fs",
27
+ "fs/promises",
28
+ "http",
29
+ "http2",
30
+ "https",
31
+ "inspector",
32
+ "inspector/promises",
33
+ "module",
34
+ "net",
35
+ "os",
36
+ "path",
37
+ "path/posix",
38
+ "path/win32",
39
+ "perf_hooks",
40
+ "process",
41
+ "punycode",
42
+ "querystring",
43
+ "readline",
44
+ "readline/promises",
45
+ "repl",
46
+ "stream",
47
+ "stream/consumers",
48
+ "stream/promises",
49
+ "stream/web",
50
+ "string_decoder",
51
+ "sys",
52
+ "test",
53
+ "timers",
54
+ "timers/promises",
55
+ "tls",
56
+ "trace_events",
57
+ "tty",
58
+ "url",
59
+ "util",
60
+ "util/types",
61
+ "v8",
62
+ "vm",
63
+ "wasi",
64
+ "worker_threads",
65
+ "zlib"
66
+ ]);
67
+ var IMPORT_PATTERNS = [
68
+ /import\s+(?:\{[^}]*\}|\*\s+as\s+\w+|\w+(?:\s*,\s*(?:\{[^}]*\}|\*\s+as\s+\w+))?)[\s]*from\s+['"]([^'"]+)['"]/g,
69
+ /import\s+type\s+(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)\s+from\s+['"]([^'"]+)['"]/g,
70
+ /^[\s]*import\s+['"]([^'"]+)['"]/gm,
71
+ /import\s*\(\s*['"]([^'"]+)['"]\s*\)/g,
72
+ /require\s*\(\s*['"]([^'"]+)['"]\s*\)/g,
73
+ /export\s+(?:\{[^}]*\}|\*(?:\s+as\s+\w+)?)\s+from\s+['"]([^'"]+)['"]/g
74
+ ];
75
+ function extractPackageName(specifier) {
76
+ let rest = specifier;
77
+ let pkg;
78
+ if (rest.startsWith("@")) {
79
+ const parts = rest.split("/");
80
+ pkg = parts.length >= 2 ? `${parts[0]}/${parts[1]}` : rest;
81
+ rest = parts.slice(2).join("/");
82
+ } else {
83
+ const slash = rest.indexOf("/");
84
+ pkg = slash === -1 ? rest : rest.slice(0, slash);
85
+ rest = slash === -1 ? "" : rest.slice(slash + 1);
86
+ }
87
+ return { pkg, subpath: rest || void 0 };
88
+ }
89
+ function isRelativeOrAlias(spec) {
90
+ if (spec.startsWith(".") || spec.startsWith("/")) return true;
91
+ if (spec.startsWith("#")) return true;
92
+ if (spec === "~" || spec.startsWith("~/")) return true;
93
+ if (spec.startsWith("$")) return true;
94
+ if (spec.startsWith("@/")) return true;
95
+ if (spec.length <= 1) return true;
96
+ if (/^(?:https?|jsr|npm|data|node|bun|file|blob|wasm):/.test(spec)) return true;
97
+ return false;
98
+ }
99
+ function isNodeBuiltin(spec) {
100
+ const name = spec.replace(/^node:/, "");
101
+ return NODE_BUILTINS.has(name);
102
+ }
103
+ function extractJavaScriptNpmImports(source, preLines) {
104
+ const results = [];
105
+ const seen = /* @__PURE__ */ new Set();
106
+ const lines = preLines ?? source.split("\n");
107
+ for (let lineIdx = 0; lineIdx < lines.length; lineIdx++) {
108
+ const line = lines[lineIdx];
109
+ const trimmed = line.trimStart();
110
+ if (!trimmed) continue;
111
+ if (trimmed.startsWith("//") || trimmed.startsWith("/*") || trimmed.startsWith("*")) continue;
112
+ for (const pattern of IMPORT_PATTERNS) {
113
+ pattern.lastIndex = 0;
114
+ let match;
115
+ while ((match = pattern.exec(line)) !== null) {
116
+ const specifier = match[1];
117
+ if (isRelativeOrAlias(specifier) || isNodeBuiltin(specifier)) continue;
118
+ const { pkg, subpath } = extractPackageName(specifier);
119
+ if (seen.has(pkg)) continue;
120
+ seen.add(pkg);
121
+ const patternSource = pattern.source;
122
+ let importKind = "value";
123
+ if (patternSource.includes("type\\s+")) importKind = "type";
124
+ else if (patternSource.startsWith(`^[\\s]*import\\s+['"]`)) importKind = "side-effect";
125
+ else if (patternSource.includes("import\\s*\\(")) importKind = "dynamic";
126
+ results.push({
127
+ specifier,
128
+ packageName: pkg,
129
+ subpath,
130
+ line: lineIdx + 1,
131
+ column: match.index ?? 0,
132
+ code: trimmed,
133
+ importKind
134
+ });
135
+ }
136
+ }
137
+ }
138
+ return results;
139
+ }
140
+ function extractJavaScriptImportSpecifiersFlat(source, preLines) {
141
+ const seen = /* @__PURE__ */ new Set();
142
+ const out = [];
143
+ for (const e of extractJavaScriptNpmImports(source, preLines)) {
144
+ if (!seen.has(e.specifier)) {
145
+ seen.add(e.specifier);
146
+ out.push(e.specifier);
147
+ }
148
+ }
149
+ return out;
150
+ }
151
+
152
+ export { extractJavaScriptImportSpecifiersFlat, extractJavaScriptNpmImports, extractPackageName, isNodeBuiltin, isRelativeOrAlias };