vibecheck-score 0.1.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 (87) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +217 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/output/confirm.d.ts +3 -0
  6. package/dist/output/confirm.d.ts.map +1 -0
  7. package/dist/output/confirm.js +37 -0
  8. package/dist/output/confirm.js.map +1 -0
  9. package/dist/output/narrative.d.ts +3 -0
  10. package/dist/output/narrative.d.ts.map +1 -0
  11. package/dist/output/narrative.js +94 -0
  12. package/dist/output/narrative.js.map +1 -0
  13. package/dist/output/terminal.d.ts +4 -0
  14. package/dist/output/terminal.d.ts.map +1 -0
  15. package/dist/output/terminal.js +95 -0
  16. package/dist/output/terminal.js.map +1 -0
  17. package/dist/scanners/agents.d.ts +7 -0
  18. package/dist/scanners/agents.d.ts.map +1 -0
  19. package/dist/scanners/agents.js +95 -0
  20. package/dist/scanners/agents.js.map +1 -0
  21. package/dist/scanners/deploy.d.ts +7 -0
  22. package/dist/scanners/deploy.d.ts.map +1 -0
  23. package/dist/scanners/deploy.js +139 -0
  24. package/dist/scanners/deploy.js.map +1 -0
  25. package/dist/scanners/environment.d.ts +7 -0
  26. package/dist/scanners/environment.d.ts.map +1 -0
  27. package/dist/scanners/environment.js +110 -0
  28. package/dist/scanners/environment.js.map +1 -0
  29. package/dist/scanners/index.d.ts +7 -0
  30. package/dist/scanners/index.d.ts.map +1 -0
  31. package/dist/scanners/index.js +23 -0
  32. package/dist/scanners/index.js.map +1 -0
  33. package/dist/scanners/mcp.d.ts +7 -0
  34. package/dist/scanners/mcp.d.ts.map +1 -0
  35. package/dist/scanners/mcp.js +138 -0
  36. package/dist/scanners/mcp.js.map +1 -0
  37. package/dist/scanners/memory.d.ts +7 -0
  38. package/dist/scanners/memory.d.ts.map +1 -0
  39. package/dist/scanners/memory.js +131 -0
  40. package/dist/scanners/memory.js.map +1 -0
  41. package/dist/scanners/orchestration.d.ts +7 -0
  42. package/dist/scanners/orchestration.d.ts.map +1 -0
  43. package/dist/scanners/orchestration.js +99 -0
  44. package/dist/scanners/orchestration.js.map +1 -0
  45. package/dist/scanners/repositories.d.ts +7 -0
  46. package/dist/scanners/repositories.d.ts.map +1 -0
  47. package/dist/scanners/repositories.js +301 -0
  48. package/dist/scanners/repositories.js.map +1 -0
  49. package/dist/scanners/security.d.ts +7 -0
  50. package/dist/scanners/security.d.ts.map +1 -0
  51. package/dist/scanners/security.js +113 -0
  52. package/dist/scanners/security.js.map +1 -0
  53. package/dist/scanners/social.d.ts +7 -0
  54. package/dist/scanners/social.d.ts.map +1 -0
  55. package/dist/scanners/social.js +68 -0
  56. package/dist/scanners/social.js.map +1 -0
  57. package/dist/scanners/universal-file.d.ts +10 -0
  58. package/dist/scanners/universal-file.d.ts.map +1 -0
  59. package/dist/scanners/universal-file.js +526 -0
  60. package/dist/scanners/universal-file.js.map +1 -0
  61. package/dist/scanners/utils.d.ts +6 -0
  62. package/dist/scanners/utils.d.ts.map +1 -0
  63. package/dist/scanners/utils.js +51 -0
  64. package/dist/scanners/utils.js.map +1 -0
  65. package/dist/scanners/workspace.d.ts +3 -0
  66. package/dist/scanners/workspace.d.ts.map +1 -0
  67. package/dist/scanners/workspace.js +59 -0
  68. package/dist/scanners/workspace.js.map +1 -0
  69. package/dist/scoring/engine.d.ts +11 -0
  70. package/dist/scoring/engine.d.ts.map +1 -0
  71. package/dist/scoring/engine.js +85 -0
  72. package/dist/scoring/engine.js.map +1 -0
  73. package/dist/scoring/tiers.d.ts +11 -0
  74. package/dist/scoring/tiers.d.ts.map +1 -0
  75. package/dist/scoring/tiers.js +20 -0
  76. package/dist/scoring/tiers.js.map +1 -0
  77. package/dist/taxonomy/classifier.d.ts +9 -0
  78. package/dist/taxonomy/classifier.d.ts.map +1 -0
  79. package/dist/taxonomy/classifier.js +44 -0
  80. package/dist/taxonomy/classifier.js.map +1 -0
  81. package/dist/taxonomy/registry.json +189 -0
  82. package/dist/types.d.ts +109 -0
  83. package/dist/types.d.ts.map +1 -0
  84. package/dist/types.js +58 -0
  85. package/dist/types.js.map +1 -0
  86. package/package.json +44 -0
  87. package/src/taxonomy/registry.json +189 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/scanners/deploy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAS1C,qBAAa,aAAc,YAAW,OAAO;IAC3C,IAAI,SAAY;IAEV,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CAqJlC"}
@@ -0,0 +1,139 @@
1
+ import { readdir } from "node:fs/promises";
2
+ import { classify } from "../taxonomy/classifier.js";
3
+ import { fileExists, readJsonIfExists, readFileIfExists, shellOutput } from "./utils.js";
4
+ export class DeployScanner {
5
+ name = "deploy";
6
+ async scan() {
7
+ const start = performance.now();
8
+ const findings = [];
9
+ // Deploy platform configs
10
+ const deployConfigs = [
11
+ { file: ".vercel/project.json", id: "vercel" },
12
+ { file: "vercel.json", id: "vercel" },
13
+ { file: "netlify.toml", id: "netlify" },
14
+ { file: "fly.toml", id: "fly" },
15
+ { file: "railway.json", id: "railway" },
16
+ { file: "render.yaml", id: "render" },
17
+ { file: "wrangler.toml", id: "cloudflare-workers" },
18
+ ];
19
+ const seenDeploy = new Set();
20
+ for (const { file, id } of deployConfigs) {
21
+ if (seenDeploy.has(id))
22
+ continue;
23
+ if (await fileExists(file)) {
24
+ seenDeploy.add(id);
25
+ findings.push({
26
+ id,
27
+ source: file,
28
+ confidence: "high",
29
+ });
30
+ }
31
+ }
32
+ // Docker
33
+ const dockerFiles = [
34
+ "Dockerfile",
35
+ "docker-compose.yml",
36
+ "docker-compose.yaml",
37
+ ];
38
+ for (const file of dockerFiles) {
39
+ if (await fileExists(file)) {
40
+ findings.push({
41
+ id: "docker",
42
+ source: file,
43
+ confidence: "high",
44
+ });
45
+ break;
46
+ }
47
+ }
48
+ // GitHub Actions deploy workflows
49
+ try {
50
+ const workflows = await readdir(".github/workflows");
51
+ for (const wf of workflows) {
52
+ if (!wf.endsWith(".yml") && !wf.endsWith(".yaml"))
53
+ continue;
54
+ const content = await readFileIfExists(`.github/workflows/${wf}`);
55
+ if (content &&
56
+ /deploy|release|publish|cd\b/i.test(content)) {
57
+ // Only add if we haven't already found github-actions
58
+ const hasGHA = findings.some((f) => f.id === "github-actions");
59
+ if (!hasGHA) {
60
+ findings.push({
61
+ id: "github-actions",
62
+ source: `.github/workflows/${wf}`,
63
+ confidence: "high",
64
+ details: { type: "deploy" },
65
+ });
66
+ }
67
+ break;
68
+ }
69
+ }
70
+ }
71
+ catch {
72
+ // no workflows
73
+ }
74
+ // CLI-based deploy tools
75
+ const cliChecks = [
76
+ { cmd: "which vercel", id: "vercel" },
77
+ { cmd: "which netlify", id: "netlify" },
78
+ { cmd: "which wrangler", id: "cloudflare-workers" },
79
+ ];
80
+ const cliResults = await Promise.all(cliChecks.map(({ cmd }) => shellOutput(cmd)));
81
+ for (let i = 0; i < cliChecks.length; i++) {
82
+ if (cliResults[i] && !seenDeploy.has(cliChecks[i].id)) {
83
+ seenDeploy.add(cliChecks[i].id);
84
+ findings.push({
85
+ id: cliChecks[i].id,
86
+ source: cliChecks[i].cmd,
87
+ confidence: "medium",
88
+ });
89
+ }
90
+ }
91
+ // Package.json deploy/release scripts
92
+ const pkg = await readJsonIfExists("package.json");
93
+ if (pkg?.scripts) {
94
+ const deployScripts = Object.keys(pkg.scripts).filter((s) => /deploy|release|publish|ship/i.test(s));
95
+ if (deployScripts.length > 0) {
96
+ // If no platform config found, infer from scripts
97
+ if (findings.length === 0) {
98
+ const values = deployScripts.map((s) => pkg.scripts[s]);
99
+ const combined = values.join(" ");
100
+ if (/vercel/i.test(combined)) {
101
+ findings.push({
102
+ id: "vercel",
103
+ source: "package.json",
104
+ confidence: "medium",
105
+ });
106
+ }
107
+ if (/netlify/i.test(combined)) {
108
+ findings.push({
109
+ id: "netlify",
110
+ source: "package.json",
111
+ confidence: "medium",
112
+ });
113
+ }
114
+ }
115
+ }
116
+ }
117
+ // Multi-environment detection
118
+ const envFiles = [
119
+ ".env.production",
120
+ ".env.staging",
121
+ ".env.preview",
122
+ ];
123
+ let envCount = 0;
124
+ for (const file of envFiles) {
125
+ if (await fileExists(file))
126
+ envCount++;
127
+ }
128
+ if (envCount >= 2) {
129
+ // Boost existing deploy findings — multi-env is a signal of maturity
130
+ // but we don't add a separate detection for it
131
+ }
132
+ return {
133
+ scanner: this.name,
134
+ detections: classify(findings),
135
+ duration: Math.round(performance.now() - start),
136
+ };
137
+ }
138
+ }
139
+ //# sourceMappingURL=deploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/scanners/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAmB,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAOzF,MAAM,OAAO,aAAa;IACxB,IAAI,GAAG,QAAQ,CAAC;IAEhB,KAAK,CAAC,IAAI;QACR,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAiB,EAAE,CAAC;QAElC,0BAA0B;QAC1B,MAAM,aAAa,GAAG;YACpB,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAAE,EAAE,QAAQ,EAAE;YAC9C,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,QAAQ,EAAE;YACrC,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS,EAAE;YACvC,EAAE,IAAI,EAAE,UAAU,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C9B,QAAQ,CAAC,IAAI,CAAC;4BACZ,EAAE,EAAE,SAAS;4BACb,MAAM,EAAE,cAAc;4BACtB,UAAU,EAAE,QAAQ;yBACrB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,8BAA8B;QAC9B,MAAM,QAAQ,GAAG;YACf,iBAAiB;YACjB,cAAc;YACd,cAAc;SACf,CAAC;QACF,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC5B,IAAI,MAAM,UAAU,CAAC,IAAI,CAAC;gBAAE,QAAQ,EAAE,CAAC;QACzC,CAAC;QACD,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;YAClB,qEAAqE;YACrE,+CAA+C;QACjD,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAC9B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;SAChD,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import type { ScanResult } from "../types.js";
2
+ import type { Scanner } from "./index.js";
3
+ export declare class EnvironmentScanner implements Scanner {
4
+ name: string;
5
+ scan(): Promise<ScanResult>;
6
+ }
7
+ //# sourceMappingURL=environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/scanners/environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAwB1C,qBAAa,kBAAmB,YAAW,OAAO;IAChD,IAAI,SAAiB;IAEf,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CA4FlC"}
@@ -0,0 +1,110 @@
1
+ import { classify } from "../taxonomy/classifier.js";
2
+ import { readFileIfExists, shellOutput } from "./utils.js";
3
+ const API_KEY_MAP = {
4
+ ANTHROPIC_API_KEY: "anthropic-api-key",
5
+ OPENAI_API_KEY: "openai-api-key",
6
+ GOOGLE_API_KEY: "google-api-key",
7
+ GEMINI_API_KEY: "google-api-key",
8
+ XAI_API_KEY: "xai-api-key",
9
+ MISTRAL_API_KEY: "mistral-api-key",
10
+ TOGETHER_API_KEY: "together-api-key",
11
+ GROQ_API_KEY: "groq-api-key",
12
+ FIREWORKS_API_KEY: "fireworks-api-key",
13
+ AZURE_OPENAI_API_KEY: "azure-openai-api-key",
14
+ };
15
+ const SHELL_FILES = [
16
+ "~/.zshrc",
17
+ "~/.bashrc",
18
+ "~/.zprofile",
19
+ "~/.bash_profile",
20
+ ];
21
+ export class EnvironmentScanner {
22
+ name = "environment";
23
+ async scan() {
24
+ const start = performance.now();
25
+ const findings = [];
26
+ const seen = new Set();
27
+ // Read shell config files
28
+ const contents = [];
29
+ for (const file of SHELL_FILES) {
30
+ const content = await readFileIfExists(file);
31
+ if (content)
32
+ contents.push(content);
33
+ }
34
+ const combined = contents.join("\n");
35
+ // Detect API key exports (presence only, NEVER values)
36
+ for (const [envVar, detectionId] of Object.entries(API_KEY_MAP)) {
37
+ if (seen.has(detectionId))
38
+ continue;
39
+ const pattern = new RegExp(`(export\\s+)?${envVar}\\s*=`, "m");
40
+ if (pattern.test(combined)) {
41
+ seen.add(detectionId);
42
+ findings.push({
43
+ id: detectionId,
44
+ source: "shell config",
45
+ confidence: "high",
46
+ });
47
+ }
48
+ }
49
+ // Scan .env and .env.local in CWD (key names only, never values)
50
+ const envFiles = [".env", ".env.local"];
51
+ for (const envFile of envFiles) {
52
+ const envContent = await readFileIfExists(envFile);
53
+ if (!envContent)
54
+ continue;
55
+ for (const [envVar, detectionId] of Object.entries(API_KEY_MAP)) {
56
+ if (seen.has(detectionId))
57
+ continue;
58
+ const pattern = new RegExp(`^${envVar}\\s*=`, "m");
59
+ if (pattern.test(envContent)) {
60
+ seen.add(detectionId);
61
+ findings.push({
62
+ id: detectionId,
63
+ source: envFile,
64
+ confidence: "high",
65
+ });
66
+ }
67
+ }
68
+ }
69
+ // Detect model routing aliases
70
+ const aliasPattern = /alias\s+(\w+).*model/gi;
71
+ const aliases = [];
72
+ let match;
73
+ while ((match = aliasPattern.exec(combined)) !== null) {
74
+ aliases.push(match[1]);
75
+ }
76
+ if (aliases.length > 0) {
77
+ findings.push({
78
+ id: "model-routing",
79
+ source: "shell config",
80
+ confidence: "medium",
81
+ details: { aliases },
82
+ });
83
+ }
84
+ // Check for local model runners
85
+ const [ollama, lms] = await Promise.all([
86
+ shellOutput("which ollama"),
87
+ shellOutput("which lms"),
88
+ ]);
89
+ if (ollama) {
90
+ findings.push({
91
+ id: "local-ollama",
92
+ source: "which ollama",
93
+ confidence: "high",
94
+ });
95
+ }
96
+ if (lms) {
97
+ findings.push({
98
+ id: "local-lmstudio",
99
+ source: "which lms",
100
+ confidence: "high",
101
+ });
102
+ }
103
+ return {
104
+ scanner: this.name,
105
+ detections: classify(findings),
106
+ duration: Math.round(performance.now() - start),
107
+ };
108
+ }
109
+ }
110
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/scanners/environment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAmB,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,WAAW,GAA2B;IAC1C,iBAAiB,EAAE,mBAAmB;IACtC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,YAAY,EAAE,cAAc;IAC5B,iBAAiB,EAAE,mBAAmB;IACtC,oBAAoB,E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CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACtC,WAAW,CAAC,cAAc,CAAC;YAC3B,WAAW,CAAC,WAAW,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,MAAM,EAAE,CAAC;YACX,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,cAAc;gBAClB,MAAM,EAAE,cAAc;gBACtB,UAAU,EAAE,MAAM;aACnB,CAAC,CAAC;QACL,CAAC;QACD,IAAI,GAAG,EAAE,CAAC;YACR,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,gBAAgB;gBACpB,MAAM,EAAE,WAAW;gBACnB,UAAU,EAAE,MAAM;aACnB,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAC9B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;SAChD,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import type { ScanResult } from "../types.js";
2
+ export interface Scanner {
3
+ name: string;
4
+ scan(): Promise<ScanResult>;
5
+ }
6
+ export declare function runAllScanners(scanners: Scanner[]): Promise<ScanResult[]>;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scanners/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC;CAC7B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,OAAO,EAAE,GAClB,OAAO,CAAC,UAAU,EAAE,CAAC,CA0BvB"}
@@ -0,0 +1,23 @@
1
+ export async function runAllScanners(scanners) {
2
+ const results = await Promise.allSettled(scanners.map(async (s) => {
3
+ const start = performance.now();
4
+ try {
5
+ const result = await s.scan();
6
+ return result;
7
+ }
8
+ catch (err) {
9
+ const duration = Math.round(performance.now() - start);
10
+ const msg = err instanceof Error ? err.message : String(err);
11
+ console.error(`[scanner:${s.name}] failed: ${msg}`);
12
+ return {
13
+ scanner: s.name,
14
+ detections: [],
15
+ duration,
16
+ };
17
+ }
18
+ }));
19
+ return results.map((r) => r.status === "fulfilled"
20
+ ? r.value
21
+ : { scanner: "unknown", detections: [], duration: 0 });
22
+ }
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scanners/index.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,QAAmB;IAEnB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CACtC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QACvB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC;YACvD,MAAM,GAAG,GACP,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACnD,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,aAAa,GAAG,EAAE,CAAC,CAAC;YACpD,OAAO;gBACL,OAAO,EAAE,CAAC,CAAC,IAAI;gBACf,UAAU,EAAE,EAAiB;gBAC7B,QAAQ;aACY,CAAC;QACzB,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACvB,CAAC,CAAC,MAAM,KAAK,WAAW;QACtB,CAAC,CAAC,CAAC,CAAC,KAAK;QACT,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CACxD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ScanResult } from "../types.js";
2
+ import type { Scanner } from "./index.js";
3
+ export declare class McpScanner implements Scanner {
4
+ name: string;
5
+ scan(): Promise<ScanResult>;
6
+ }
7
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/scanners/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AA4B1C,qBAAa,UAAW,YAAW,OAAO;IACxC,IAAI,SAAS;IAEP,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CAgIlC"}
@@ -0,0 +1,138 @@
1
+ import { classify } from "../taxonomy/classifier.js";
2
+ import { readJsonIfExists, shellOutput, fileExists } from "./utils.js";
3
+ const KNOWN_MCP = {
4
+ filesystem: "mcp-filesystem",
5
+ github: "mcp-github",
6
+ obsidian: "mcp-obsidian",
7
+ supabase: "mcp-supabase",
8
+ "google-drive": "mcp-google-drive",
9
+ "brave-search": "mcp-brave-search",
10
+ slack: "mcp-slack",
11
+ puppeteer: "mcp-puppeteer",
12
+ playwright: "mcp-playwright",
13
+ postgres: "mcp-postgres",
14
+ sqlite: "mcp-sqlite",
15
+ sentry: "mcp-sentry",
16
+ notion: "mcp-notion",
17
+ linear: "mcp-linear",
18
+ vercel: "mcp-vercel",
19
+ };
20
+ export class McpScanner {
21
+ name = "mcp";
22
+ async scan() {
23
+ const start = performance.now();
24
+ const findings = [];
25
+ const seen = new Set();
26
+ // Read Claude settings files (Code + Desktop)
27
+ const settingsPaths = [
28
+ "~/.claude/settings.json",
29
+ "~/.claude/settings.local.json",
30
+ "~/Library/Application Support/Claude/claude_desktop_config.json",
31
+ "~/.config/Claude/claude_desktop_config.json",
32
+ ];
33
+ for (const path of settingsPaths) {
34
+ const settings = await readJsonIfExists(path);
35
+ if (!settings?.mcpServers)
36
+ continue;
37
+ for (const key of Object.keys(settings.mcpServers)) {
38
+ const normalized = key.toLowerCase();
39
+ const knownId = KNOWN_MCP[normalized];
40
+ if (knownId && !seen.has(knownId)) {
41
+ seen.add(knownId);
42
+ findings.push({
43
+ id: knownId,
44
+ source: path,
45
+ confidence: "high",
46
+ });
47
+ }
48
+ else if (!knownId) {
49
+ const customId = `mcp-${normalized}`;
50
+ if (!seen.has(customId)) {
51
+ seen.add(customId);
52
+ findings.push({
53
+ id: customId,
54
+ source: path,
55
+ confidence: "high",
56
+ details: { type: "custom" },
57
+ });
58
+ }
59
+ }
60
+ }
61
+ // Project-scoped MCP servers
62
+ if (settings.projects) {
63
+ for (const proj of Object.values(settings.projects)) {
64
+ if (!proj.mcpServers)
65
+ continue;
66
+ for (const key of Object.keys(proj.mcpServers)) {
67
+ const normalized = key.toLowerCase();
68
+ const knownId = KNOWN_MCP[normalized];
69
+ const id = knownId ?? `mcp-${normalized}`;
70
+ if (!seen.has(id)) {
71
+ seen.add(id);
72
+ findings.push({
73
+ id,
74
+ source: `${path} (project)`,
75
+ confidence: "high",
76
+ details: knownId ? undefined : { type: "custom" },
77
+ });
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ // Read .mcp.json in CWD
84
+ const cwdMcp = await readJsonIfExists(".mcp.json");
85
+ if (cwdMcp) {
86
+ const servers = cwdMcp.mcpServers ??
87
+ cwdMcp;
88
+ for (const key of Object.keys(servers)) {
89
+ const normalized = key.toLowerCase();
90
+ const knownId = KNOWN_MCP[normalized];
91
+ const id = knownId ?? `mcp-${normalized}`;
92
+ if (!seen.has(id)) {
93
+ seen.add(id);
94
+ findings.push({
95
+ id,
96
+ source: ".mcp.json",
97
+ confidence: "high",
98
+ details: knownId ? undefined : { type: "custom" },
99
+ });
100
+ }
101
+ }
102
+ }
103
+ // Check CLI tools
104
+ const cliChecks = [
105
+ { cmd: "which claude", id: "claude-code" },
106
+ { cmd: "which codex", id: "codex-cli" },
107
+ { cmd: "which cursor", id: "cursor" },
108
+ { cmd: "which aider", id: "aider" },
109
+ { cmd: "which gemini", id: "gemini-cli" },
110
+ ];
111
+ const cliResults = await Promise.all(cliChecks.map(({ cmd }) => shellOutput(cmd)));
112
+ for (let i = 0; i < cliChecks.length; i++) {
113
+ if (cliResults[i] && !seen.has(cliChecks[i].id)) {
114
+ seen.add(cliChecks[i].id);
115
+ findings.push({
116
+ id: cliChecks[i].id,
117
+ source: cliChecks[i].cmd,
118
+ confidence: "high",
119
+ });
120
+ }
121
+ }
122
+ // Cursor directory fallback
123
+ if (!seen.has("cursor") && await fileExists("~/.cursor/")) {
124
+ seen.add("cursor");
125
+ findings.push({
126
+ id: "cursor",
127
+ source: "~/.cursor/",
128
+ confidence: "medium",
129
+ });
130
+ }
131
+ return {
132
+ scanner: this.name,
133
+ detections: classify(findings),
134
+ duration: Math.round(performance.now() - start),
135
+ };
136
+ }
137
+ }
138
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/scanners/mcp.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAmB,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQvE,MAAM,SAAS,GAA2B;IACxC,UAAU,EAAE,gBAAgB;IAC5B,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,cAAc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type { ScanResult } from "../types.js";
2
+ import type { Scanner } from "./index.js";
3
+ export declare class MemoryScanner implements Scanner {
4
+ name: string;
5
+ scan(): Promise<ScanResult>;
6
+ }
7
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/scanners/memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAW1C,qBAAa,aAAc,YAAW,OAAO;IAC3C,IAAI,SAAY;IAEV,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CA8HlC"}
@@ -0,0 +1,131 @@
1
+ import { readdir } from "node:fs/promises";
2
+ import { classify } from "../taxonomy/classifier.js";
3
+ import { fileExists, readFileIfExists, expandHome } from "./utils.js";
4
+ function tierByLineCount(lineCount) {
5
+ if (lineCount >= 100)
6
+ return "elite";
7
+ if (lineCount >= 50)
8
+ return "advanced";
9
+ if (lineCount >= 20)
10
+ return "intermediate";
11
+ return "basic";
12
+ }
13
+ export class MemoryScanner {
14
+ name = "memory";
15
+ async scan() {
16
+ const start = performance.now();
17
+ const findings = [];
18
+ // CLAUDE.md in CWD
19
+ const cwdClaudeMd = await readFileIfExists("CLAUDE.md");
20
+ if (cwdClaudeMd) {
21
+ const lines = cwdClaudeMd.split("\n").length;
22
+ const sections = (cwdClaudeMd.match(/^##?\s+/gm) ?? []).length;
23
+ findings.push({
24
+ id: "claude-md",
25
+ source: "CLAUDE.md",
26
+ confidence: "high",
27
+ details: { lineCount: lines, sections, complexity: tierByLineCount(lines) },
28
+ });
29
+ }
30
+ // Global CLAUDE.md
31
+ const globalClaudeMd = await readFileIfExists("~/.claude/CLAUDE.md");
32
+ if (globalClaudeMd && !cwdClaudeMd) {
33
+ const lines = globalClaudeMd.split("\n").length;
34
+ findings.push({
35
+ id: "claude-md",
36
+ source: "~/.claude/CLAUDE.md",
37
+ confidence: "high",
38
+ details: { lineCount: lines, complexity: tierByLineCount(lines) },
39
+ });
40
+ }
41
+ // Claude memories directory
42
+ try {
43
+ const memoriesDir = expandHome("~/.claude/memories");
44
+ const memories = await readdir(memoriesDir);
45
+ if (memories.length > 0) {
46
+ findings.push({
47
+ id: "claude-memories",
48
+ source: "~/.claude/memories/",
49
+ confidence: "high",
50
+ details: { fileCount: memories.length },
51
+ });
52
+ }
53
+ }
54
+ catch {
55
+ // directory doesn't exist
56
+ }
57
+ // Split rules
58
+ try {
59
+ const rules = await readdir(".claude/rules");
60
+ if (rules.length > 0) {
61
+ findings.push({
62
+ id: "split-rules",
63
+ source: ".claude/rules/",
64
+ confidence: "high",
65
+ details: { ruleCount: rules.length },
66
+ });
67
+ }
68
+ }
69
+ catch {
70
+ // no rules dir
71
+ }
72
+ // MEMORY.md
73
+ if (await fileExists("MEMORY.md")) {
74
+ findings.push({
75
+ id: "memory-md",
76
+ source: "MEMORY.md",
77
+ confidence: "high",
78
+ });
79
+ }
80
+ // Daily logs (YYYY-MM-DD.md pattern)
81
+ const logDirs = ["logs", "daily", ".logs", ".daily"];
82
+ for (const dir of logDirs) {
83
+ try {
84
+ const files = await readdir(dir);
85
+ const dailyLogs = files.filter((f) => /^\d{4}-\d{2}-\d{2}\.md$/.test(f));
86
+ if (dailyLogs.length > 0) {
87
+ findings.push({
88
+ id: "daily-logs",
89
+ source: `${dir}/`,
90
+ confidence: "high",
91
+ details: { logCount: dailyLogs.length },
92
+ });
93
+ break;
94
+ }
95
+ }
96
+ catch {
97
+ // dir doesn't exist
98
+ }
99
+ }
100
+ // .cursorrules
101
+ if (await fileExists(".cursorrules")) {
102
+ findings.push({
103
+ id: "cursorrules",
104
+ source: ".cursorrules",
105
+ confidence: "high",
106
+ });
107
+ }
108
+ // .windsurfrules
109
+ if (await fileExists(".windsurfrules")) {
110
+ findings.push({
111
+ id: "windsurfrules",
112
+ source: ".windsurfrules",
113
+ confidence: "high",
114
+ });
115
+ }
116
+ // Copilot instructions
117
+ if (await fileExists(".github/copilot-instructions.md")) {
118
+ findings.push({
119
+ id: "copilot-instructions",
120
+ source: ".github/copilot-instructions.md",
121
+ confidence: "high",
122
+ });
123
+ }
124
+ return {
125
+ scanner: this.name,
126
+ detections: classify(findings),
127
+ duration: Math.round(performance.now() - start),
128
+ };
129
+ }
130
+ }
131
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/scanners/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,QAAQ,EAAmB,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEtE,SAAS,eAAe,CAAC,SAAiB;IACxC,IAAI,SAAS,IAAI,GAAG;QAAE,OAAO,OAAO,CAAC;IACrC,IAAI,SAAS,IAAI,EAAE;QAAE,OAAO,UAAU,CAAC;IACvC,IAAI,SAAS,IAAI,EAAE;QAAE,OAAO,cAAc,CAAC;IAC3C,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,OAAO,aAAa;IACxB,IAAI,GAAG,QAAQ,CAAC;IAEhB,KAAK,CAAC,IAAI;QACR,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAiB,EAAE,CAAC;QAElC,mBAAmB;QACnB,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACxD,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;YAC7C,MAAM,QAAQ,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;YAC/D,QAAQ,CA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,cAAc,CAAC,EAAE,CAAC;YACrC,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,aAAa;gBACjB,MAAM,EAAE,cAAc;gBACtB,UAAU,EAAE,MAAM;aACnB,CAAC,CAAC;QACL,CAAC;QAED,iBAAiB;QACjB,IAAI,MAAM,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACvC,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,eAAe;gBACnB,MAAM,EAAE,gBAAgB;gBACxB,UAAU,EAAE,MAAM;aACnB,CAAC,CAAC;QACL,CAAC;QAED,uBAAuB;QACvB,IAAI,MAAM,UAAU,CAAC,iCAAiC,CAAC,EAAE,CAAC;YACxD,QAAQ,CAAC,IAAI,CAAC;gBACZ,EAAE,EAAE,sBAAsB;gBAC1B,MAAM,EAAE,iCAAiC;gBACzC,UAAU,EAAE,MAAM;aACnB,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAC9B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;SAChD,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import type { ScanResult } from "../types.js";
2
+ import type { Scanner } from "./index.js";
3
+ export declare class OrchestrationScanner implements Scanner {
4
+ name: string;
5
+ scan(): Promise<ScanResult>;
6
+ }
7
+ //# sourceMappingURL=orchestration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestration.d.ts","sourceRoot":"","sources":["../../src/scanners/orchestration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,qBAAa,oBAAqB,YAAW,OAAO;IAClD,IAAI,SAAmB;IAEjB,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CA2GlC"}