@mohantn/gate-keeper 2.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 (272) hide show
  1. package/.github/instructions/dotnet-api-integration.instructions.md +416 -0
  2. package/.github/instructions/dotnet-development.instructions.md +353 -0
  3. package/.github/instructions/dotnet-testing.instructions.md +406 -0
  4. package/.github/instructions/gate-keeper.instructions.md +91 -0
  5. package/.github/instructions/react-development.instructions.md +315 -0
  6. package/.github/instructions/react-testing-optimization.instructions.md +373 -0
  7. package/.github/instructions/uiux.instructions.md +261 -0
  8. package/LICENSE +21 -0
  9. package/README.md +181 -0
  10. package/dist/analyzer/coverage-analyzer.d.ts +126 -0
  11. package/dist/analyzer/coverage-analyzer.d.ts.map +1 -0
  12. package/dist/analyzer/coverage-analyzer.js +633 -0
  13. package/dist/analyzer/coverage-analyzer.js.map +1 -0
  14. package/dist/analyzer/csharp-analyzer.d.ts +28 -0
  15. package/dist/analyzer/csharp-analyzer.d.ts.map +1 -0
  16. package/dist/analyzer/csharp-analyzer.js +437 -0
  17. package/dist/analyzer/csharp-analyzer.js.map +1 -0
  18. package/dist/analyzer/pattern-detector.d.ts +5 -0
  19. package/dist/analyzer/pattern-detector.d.ts.map +1 -0
  20. package/dist/analyzer/pattern-detector.js +74 -0
  21. package/dist/analyzer/pattern-detector.js.map +1 -0
  22. package/dist/analyzer/refactoring-advisor.d.ts +7 -0
  23. package/dist/analyzer/refactoring-advisor.d.ts.map +1 -0
  24. package/dist/analyzer/refactoring-advisor.js +280 -0
  25. package/dist/analyzer/refactoring-advisor.js.map +1 -0
  26. package/dist/analyzer/sonar-eslint-runner.d.ts +3 -0
  27. package/dist/analyzer/sonar-eslint-runner.d.ts.map +1 -0
  28. package/dist/analyzer/sonar-eslint-runner.js +136 -0
  29. package/dist/analyzer/sonar-eslint-runner.js.map +1 -0
  30. package/dist/analyzer/sonar-rule-map.d.ts +19 -0
  31. package/dist/analyzer/sonar-rule-map.d.ts.map +1 -0
  32. package/dist/analyzer/sonar-rule-map.js +67 -0
  33. package/dist/analyzer/sonar-rule-map.js.map +1 -0
  34. package/dist/analyzer/string-analyzer.d.ts +27 -0
  35. package/dist/analyzer/string-analyzer.d.ts.map +1 -0
  36. package/dist/analyzer/string-analyzer.js +274 -0
  37. package/dist/analyzer/string-analyzer.js.map +1 -0
  38. package/dist/analyzer/typescript-analyzer.d.ts +27 -0
  39. package/dist/analyzer/typescript-analyzer.d.ts.map +1 -0
  40. package/dist/analyzer/typescript-analyzer.js +437 -0
  41. package/dist/analyzer/typescript-analyzer.js.map +1 -0
  42. package/dist/analyzer/universal-analyzer.d.ts +10 -0
  43. package/dist/analyzer/universal-analyzer.d.ts.map +1 -0
  44. package/dist/analyzer/universal-analyzer.js +155 -0
  45. package/dist/analyzer/universal-analyzer.js.map +1 -0
  46. package/dist/cache/quality-cache.d.ts +119 -0
  47. package/dist/cache/quality-cache.d.ts.map +1 -0
  48. package/dist/cache/quality-cache.js +130 -0
  49. package/dist/cache/quality-cache.js.map +1 -0
  50. package/dist/cache/sqlite-cache.d.ts +43 -0
  51. package/dist/cache/sqlite-cache.d.ts.map +1 -0
  52. package/dist/cache/sqlite-cache.js +346 -0
  53. package/dist/cache/sqlite-cache.js.map +1 -0
  54. package/dist/cli/query-repl.d.ts +37 -0
  55. package/dist/cli/query-repl.d.ts.map +1 -0
  56. package/dist/cli/query-repl.js +298 -0
  57. package/dist/cli/query-repl.js.map +1 -0
  58. package/dist/cli/repl-algorithms.d.ts +49 -0
  59. package/dist/cli/repl-algorithms.d.ts.map +1 -0
  60. package/dist/cli/repl-algorithms.js +147 -0
  61. package/dist/cli/repl-algorithms.js.map +1 -0
  62. package/dist/cli/setup-core.d.ts +38 -0
  63. package/dist/cli/setup-core.d.ts.map +1 -0
  64. package/dist/cli/setup-core.js +427 -0
  65. package/dist/cli/setup-core.js.map +1 -0
  66. package/dist/cli/setup.d.ts +25 -0
  67. package/dist/cli/setup.d.ts.map +1 -0
  68. package/dist/cli/setup.js +159 -0
  69. package/dist/cli/setup.js.map +1 -0
  70. package/dist/cli-entry.d.ts +19 -0
  71. package/dist/cli-entry.d.ts.map +1 -0
  72. package/dist/cli-entry.js +178 -0
  73. package/dist/cli-entry.js.map +1 -0
  74. package/dist/daemon/watch-mode.d.ts +41 -0
  75. package/dist/daemon/watch-mode.d.ts.map +1 -0
  76. package/dist/daemon/watch-mode.js +163 -0
  77. package/dist/daemon/watch-mode.js.map +1 -0
  78. package/dist/daemon.d.ts +24 -0
  79. package/dist/daemon.d.ts.map +1 -0
  80. package/dist/daemon.js +357 -0
  81. package/dist/daemon.js.map +1 -0
  82. package/dist/github/app.d.ts +34 -0
  83. package/dist/github/app.d.ts.map +1 -0
  84. package/dist/github/app.js +261 -0
  85. package/dist/github/app.js.map +1 -0
  86. package/dist/github/commenter.d.ts +67 -0
  87. package/dist/github/commenter.d.ts.map +1 -0
  88. package/dist/github/commenter.js +155 -0
  89. package/dist/github/commenter.js.map +1 -0
  90. package/dist/graph/dependency-graph.d.ts +28 -0
  91. package/dist/graph/dependency-graph.d.ts.map +1 -0
  92. package/dist/graph/dependency-graph.js +198 -0
  93. package/dist/graph/dependency-graph.js.map +1 -0
  94. package/dist/graph/global-graph.d.ts +65 -0
  95. package/dist/graph/global-graph.d.ts.map +1 -0
  96. package/dist/graph/global-graph.js +153 -0
  97. package/dist/graph/global-graph.js.map +1 -0
  98. package/dist/graph/graph-algorithms.d.ts +90 -0
  99. package/dist/graph/graph-algorithms.d.ts.map +1 -0
  100. package/dist/graph/graph-algorithms.js +180 -0
  101. package/dist/graph/graph-algorithms.js.map +1 -0
  102. package/dist/graph/graph-export.d.ts +68 -0
  103. package/dist/graph/graph-export.d.ts.map +1 -0
  104. package/dist/graph/graph-export.js +264 -0
  105. package/dist/graph/graph-export.js.map +1 -0
  106. package/dist/graph/graph-report.d.ts +34 -0
  107. package/dist/graph/graph-report.d.ts.map +1 -0
  108. package/dist/graph/graph-report.js +136 -0
  109. package/dist/graph/graph-report.js.map +1 -0
  110. package/dist/graph/graph-summary.d.ts +68 -0
  111. package/dist/graph/graph-summary.d.ts.map +1 -0
  112. package/dist/graph/graph-summary.js +213 -0
  113. package/dist/graph/graph-summary.js.map +1 -0
  114. package/dist/graph/graphify-ignore.d.ts +32 -0
  115. package/dist/graph/graphify-ignore.d.ts.map +1 -0
  116. package/dist/graph/graphify-ignore.js +124 -0
  117. package/dist/graph/graphify-ignore.js.map +1 -0
  118. package/dist/graph/question-suggester.d.ts +30 -0
  119. package/dist/graph/question-suggester.d.ts.map +1 -0
  120. package/dist/graph/question-suggester.js +113 -0
  121. package/dist/graph/question-suggester.js.map +1 -0
  122. package/dist/graph/relationship-extractor.d.ts +40 -0
  123. package/dist/graph/relationship-extractor.d.ts.map +1 -0
  124. package/dist/graph/relationship-extractor.js +254 -0
  125. package/dist/graph/relationship-extractor.js.map +1 -0
  126. package/dist/graph/relationship-types.d.ts +24 -0
  127. package/dist/graph/relationship-types.d.ts.map +1 -0
  128. package/dist/graph/relationship-types.js +21 -0
  129. package/dist/graph/relationship-types.js.map +1 -0
  130. package/dist/graph/surprising-connections.d.ts +39 -0
  131. package/dist/graph/surprising-connections.d.ts.map +1 -0
  132. package/dist/graph/surprising-connections.js +127 -0
  133. package/dist/graph/surprising-connections.js.map +1 -0
  134. package/dist/hook-pre-tool-use.d.ts +14 -0
  135. package/dist/hook-pre-tool-use.d.ts.map +1 -0
  136. package/dist/hook-pre-tool-use.js +167 -0
  137. package/dist/hook-pre-tool-use.js.map +1 -0
  138. package/dist/hook-receiver.d.ts +29 -0
  139. package/dist/hook-receiver.d.ts.map +1 -0
  140. package/dist/hook-receiver.js +327 -0
  141. package/dist/hook-receiver.js.map +1 -0
  142. package/dist/hooks/git-hooks.d.ts +30 -0
  143. package/dist/hooks/git-hooks.d.ts.map +1 -0
  144. package/dist/hooks/git-hooks.js +179 -0
  145. package/dist/hooks/git-hooks.js.map +1 -0
  146. package/dist/mcp/cache-preload.d.ts +29 -0
  147. package/dist/mcp/cache-preload.d.ts.map +1 -0
  148. package/dist/mcp/cache-preload.js +103 -0
  149. package/dist/mcp/cache-preload.js.map +1 -0
  150. package/dist/mcp/handlers/analysis.d.ts +4 -0
  151. package/dist/mcp/handlers/analysis.d.ts.map +1 -0
  152. package/dist/mcp/handlers/analysis.js +196 -0
  153. package/dist/mcp/handlers/analysis.js.map +1 -0
  154. package/dist/mcp/handlers/context.d.ts +25 -0
  155. package/dist/mcp/handlers/context.d.ts.map +1 -0
  156. package/dist/mcp/handlers/context.js +382 -0
  157. package/dist/mcp/handlers/context.js.map +1 -0
  158. package/dist/mcp/handlers/graph-intelligence.d.ts +26 -0
  159. package/dist/mcp/handlers/graph-intelligence.d.ts.map +1 -0
  160. package/dist/mcp/handlers/graph-intelligence.js +371 -0
  161. package/dist/mcp/handlers/graph-intelligence.js.map +1 -0
  162. package/dist/mcp/handlers/graph-query.d.ts +25 -0
  163. package/dist/mcp/handlers/graph-query.d.ts.map +1 -0
  164. package/dist/mcp/handlers/graph-query.js +410 -0
  165. package/dist/mcp/handlers/graph-query.js.map +1 -0
  166. package/dist/mcp/handlers/graph.d.ts +5 -0
  167. package/dist/mcp/handlers/graph.d.ts.map +1 -0
  168. package/dist/mcp/handlers/graph.js +283 -0
  169. package/dist/mcp/handlers/graph.js.map +1 -0
  170. package/dist/mcp/handlers/impact-format.d.ts +9 -0
  171. package/dist/mcp/handlers/impact-format.d.ts.map +1 -0
  172. package/dist/mcp/handlers/impact-format.js +189 -0
  173. package/dist/mcp/handlers/impact-format.js.map +1 -0
  174. package/dist/mcp/handlers/impact.d.ts +4 -0
  175. package/dist/mcp/handlers/impact.d.ts.map +1 -0
  176. package/dist/mcp/handlers/impact.js +139 -0
  177. package/dist/mcp/handlers/impact.js.map +1 -0
  178. package/dist/mcp/handlers/improvement.d.ts +4 -0
  179. package/dist/mcp/handlers/improvement.d.ts.map +1 -0
  180. package/dist/mcp/handlers/improvement.js +136 -0
  181. package/dist/mcp/handlers/improvement.js.map +1 -0
  182. package/dist/mcp/handlers/index.d.ts +14 -0
  183. package/dist/mcp/handlers/index.d.ts.map +1 -0
  184. package/dist/mcp/handlers/index.js +36 -0
  185. package/dist/mcp/handlers/index.js.map +1 -0
  186. package/dist/mcp/handlers/platform-installer.d.ts +10 -0
  187. package/dist/mcp/handlers/platform-installer.d.ts.map +1 -0
  188. package/dist/mcp/handlers/platform-installer.js +168 -0
  189. package/dist/mcp/handlers/platform-installer.js.map +1 -0
  190. package/dist/mcp/handlers/pr-review.d.ts +33 -0
  191. package/dist/mcp/handlers/pr-review.d.ts.map +1 -0
  192. package/dist/mcp/handlers/pr-review.js +170 -0
  193. package/dist/mcp/handlers/pr-review.js.map +1 -0
  194. package/dist/mcp/handlers/shared.d.ts +20 -0
  195. package/dist/mcp/handlers/shared.d.ts.map +1 -0
  196. package/dist/mcp/handlers/shared.js +27 -0
  197. package/dist/mcp/handlers/shared.js.map +1 -0
  198. package/dist/mcp/handlers/types.d.ts +46 -0
  199. package/dist/mcp/handlers/types.d.ts.map +1 -0
  200. package/dist/mcp/handlers/types.js +3 -0
  201. package/dist/mcp/handlers/types.js.map +1 -0
  202. package/dist/mcp/helpers.d.ts +36 -0
  203. package/dist/mcp/helpers.d.ts.map +1 -0
  204. package/dist/mcp/helpers.js +199 -0
  205. package/dist/mcp/helpers.js.map +1 -0
  206. package/dist/mcp/installer.d.ts +22 -0
  207. package/dist/mcp/installer.d.ts.map +1 -0
  208. package/dist/mcp/installer.js +341 -0
  209. package/dist/mcp/installer.js.map +1 -0
  210. package/dist/mcp/server.d.ts +111 -0
  211. package/dist/mcp/server.d.ts.map +1 -0
  212. package/dist/mcp/server.js +216 -0
  213. package/dist/mcp/server.js.map +1 -0
  214. package/dist/mcp/token-tracker.d.ts +47 -0
  215. package/dist/mcp/token-tracker.d.ts.map +1 -0
  216. package/dist/mcp/token-tracker.js +93 -0
  217. package/dist/mcp/token-tracker.js.map +1 -0
  218. package/dist/quality-loop/file-lock.d.ts +12 -0
  219. package/dist/quality-loop/file-lock.d.ts.map +1 -0
  220. package/dist/quality-loop/file-lock.js +38 -0
  221. package/dist/quality-loop/file-lock.js.map +1 -0
  222. package/dist/quality-loop/fix-worker.d.ts +44 -0
  223. package/dist/quality-loop/fix-worker.d.ts.map +1 -0
  224. package/dist/quality-loop/fix-worker.js +414 -0
  225. package/dist/quality-loop/fix-worker.js.map +1 -0
  226. package/dist/quality-loop/orchestrator.d.ts +137 -0
  227. package/dist/quality-loop/orchestrator.d.ts.map +1 -0
  228. package/dist/quality-loop/orchestrator.js +894 -0
  229. package/dist/quality-loop/orchestrator.js.map +1 -0
  230. package/dist/quality-loop/queue-manager.d.ts +45 -0
  231. package/dist/quality-loop/queue-manager.d.ts.map +1 -0
  232. package/dist/quality-loop/queue-manager.js +173 -0
  233. package/dist/quality-loop/queue-manager.js.map +1 -0
  234. package/dist/rating/rating-calculator.d.ts +15 -0
  235. package/dist/rating/rating-calculator.d.ts.map +1 -0
  236. package/dist/rating/rating-calculator.js +136 -0
  237. package/dist/rating/rating-calculator.js.map +1 -0
  238. package/dist/types/agent.d.ts +49 -0
  239. package/dist/types/agent.d.ts.map +1 -0
  240. package/dist/types/agent.js +7 -0
  241. package/dist/types/agent.js.map +1 -0
  242. package/dist/types.d.ts +156 -0
  243. package/dist/types.d.ts.map +1 -0
  244. package/dist/types.js +3 -0
  245. package/dist/types.js.map +1 -0
  246. package/dist/util/fix-text.d.ts +7 -0
  247. package/dist/util/fix-text.d.ts.map +1 -0
  248. package/dist/util/fix-text.js +13 -0
  249. package/dist/util/fix-text.js.map +1 -0
  250. package/dist/viz/graph-viz.d.ts +40 -0
  251. package/dist/viz/graph-viz.d.ts.map +1 -0
  252. package/dist/viz/graph-viz.js +332 -0
  253. package/dist/viz/graph-viz.js.map +1 -0
  254. package/dist/viz/viz-helpers.d.ts +13 -0
  255. package/dist/viz/viz-helpers.d.ts.map +1 -0
  256. package/dist/viz/viz-helpers.js +134 -0
  257. package/dist/viz/viz-helpers.js.map +1 -0
  258. package/dist/viz/viz-routes.d.ts +28 -0
  259. package/dist/viz/viz-routes.d.ts.map +1 -0
  260. package/dist/viz/viz-routes.js +333 -0
  261. package/dist/viz/viz-routes.js.map +1 -0
  262. package/dist/viz/viz-scanner.d.ts +20 -0
  263. package/dist/viz/viz-scanner.d.ts.map +1 -0
  264. package/dist/viz/viz-scanner.js +241 -0
  265. package/dist/viz/viz-scanner.js.map +1 -0
  266. package/dist/viz/viz-server.d.ts +38 -0
  267. package/dist/viz/viz-server.d.ts.map +1 -0
  268. package/dist/viz/viz-server.js +240 -0
  269. package/dist/viz/viz-server.js.map +1 -0
  270. package/package.json +89 -0
  271. package/scripts/postinstall.js +28 -0
  272. package/scripts/setup.sh +113 -0
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ /**
3
+ * Git hook script generator.
4
+ *
5
+ * Produces shell scripts for post-commit, post-checkout, and the graphify
6
+ * merge driver. Scripts are designed to be written into .git/hooks/ and
7
+ * made executable. They trigger gate-keeper analysis after commits/checkouts
8
+ * without blocking the git operation.
9
+ */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = (this && this.__importStar) || (function () {
27
+ var ownKeys = function(o) {
28
+ ownKeys = Object.getOwnPropertyNames || function (o) {
29
+ var ar = [];
30
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
31
+ return ar;
32
+ };
33
+ return ownKeys(o);
34
+ };
35
+ return function (mod) {
36
+ if (mod && mod.__esModule) return mod;
37
+ var result = {};
38
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
39
+ __setModuleDefault(result, mod);
40
+ return result;
41
+ };
42
+ })();
43
+ Object.defineProperty(exports, "__esModule", { value: true });
44
+ exports.postCommitScript = postCommitScript;
45
+ exports.postCheckoutScript = postCheckoutScript;
46
+ exports.mergeDriverScript = mergeDriverScript;
47
+ exports.installGitHooks = installGitHooks;
48
+ exports.gitAttributesEntry = gitAttributesEntry;
49
+ exports.gitConfigEntry = gitConfigEntry;
50
+ const fs = __importStar(require("fs"));
51
+ const path = __importStar(require("path"));
52
+ /** Shell script that re-analyzes changed files via the daemon (if running) */
53
+ function postCommitScript(gateKeeperDir) {
54
+ const hook = path.join(gateKeeperDir, 'dist', 'hook-receiver.js');
55
+ return `#!/bin/sh
56
+ # Gate Keeper — post-commit hook
57
+ # Re-analyzes files changed in this commit via the daemon (non-blocking).
58
+ set -e
59
+
60
+ HOOK="${hook}"
61
+ if [ ! -f "$HOOK" ]; then exit 0; fi
62
+
63
+ git diff-tree --no-commit-id -r --name-only HEAD | grep -E '\\.(ts|tsx|js|jsx|cs)$' | while read -r file; do
64
+ FULL_PATH="$(git rev-parse --show-toplevel)/$file"
65
+ if [ -f "$FULL_PATH" ]; then
66
+ echo '{"tool_name":"Write","tool_input":{"file_path":"'"$FULL_PATH"'"}}' | node "$HOOK" 2>/dev/null &
67
+ fi
68
+ done
69
+
70
+ exit 0
71
+ `;
72
+ }
73
+ /** Shell script that triggers a full re-scan after branch checkout */
74
+ function postCheckoutScript(gateKeeperDir) {
75
+ const hook = path.join(gateKeeperDir, 'dist', 'hook-receiver.js');
76
+ return `#!/bin/sh
77
+ # Gate Keeper — post-checkout hook
78
+ # Triggers a re-scan when switching branches (non-blocking).
79
+ set -e
80
+
81
+ PREV_HEAD="$1"
82
+ NEW_HEAD="$2"
83
+ BRANCH_CHECKOUT="$3"
84
+
85
+ # Only act on branch checkouts, not file checkouts
86
+ if [ "$BRANCH_CHECKOUT" != "1" ]; then exit 0; fi
87
+
88
+ HOOK="${hook}"
89
+ if [ ! -f "$HOOK" ]; then exit 0; fi
90
+
91
+ # Re-analyze files that differ between branches (non-blocking)
92
+ git diff --name-only "$PREV_HEAD" "$NEW_HEAD" | grep -E '\\.(ts|tsx|js|jsx|cs)$' | head -20 | while read -r file; do
93
+ FULL_PATH="$(git rev-parse --show-toplevel)/$file"
94
+ if [ -f "$FULL_PATH" ]; then
95
+ echo '{"tool_name":"Write","tool_input":{"file_path":"'"$FULL_PATH"'"}}' | node "$HOOK" 2>/dev/null &
96
+ fi
97
+ done
98
+
99
+ exit 0
100
+ `;
101
+ }
102
+ /** Git merge driver that union-merges graph JSON files */
103
+ function mergeDriverScript() {
104
+ return `#!/bin/sh
105
+ # Gate Keeper — graph.json merge driver
106
+ # Registers as: [merge "gate-keeper-graph"] driver = gate-keeper-merge %O %A %B
107
+ # In .gitattributes: graph.json merge=gate-keeper-graph
108
+
109
+ BASE="$1"
110
+ OURS="$2"
111
+ THEIRS="$3"
112
+
113
+ node -e "
114
+ const fs = require('fs');
115
+ const a = JSON.parse(fs.readFileSync('$OURS', 'utf8'));
116
+ const b = JSON.parse(fs.readFileSync('$THEIRS', 'utf8'));
117
+
118
+ // Union-merge nodes (take min rating on conflict)
119
+ const nodeMap = new Map(a.nodes.map(n => [n.id, n]));
120
+ for (const n of b.nodes) {
121
+ const existing = nodeMap.get(n.id);
122
+ if (existing && existing.rating !== n.rating) {
123
+ nodeMap.set(n.id, { ...n, rating: Math.min(existing.rating, n.rating) });
124
+ } else {
125
+ nodeMap.set(n.id, n);
126
+ }
127
+ }
128
+
129
+ // Union edges
130
+ const edgeSet = new Set((a.edges || []).map(e => e.source + '->' + e.target));
131
+ const edges = [...(a.edges || [])];
132
+ for (const e of (b.edges || [])) {
133
+ const key = e.source + '->' + e.target;
134
+ if (!edgeSet.has(key)) { edgeSet.add(key); edges.push(e); }
135
+ }
136
+
137
+ const merged = { ...a, nodes: [...nodeMap.values()], edges, generatedAt: Date.now() };
138
+ fs.writeFileSync('$OURS', JSON.stringify(merged, null, 2));
139
+ " 2>/dev/null
140
+
141
+ exit 0
142
+ `;
143
+ }
144
+ /**
145
+ * Install git hooks into a repository's .git/hooks/ directory.
146
+ * Returns one result entry per hook.
147
+ */
148
+ function installGitHooks(repoRoot, gateKeeperDir, force = false) {
149
+ const hooksDir = path.join(repoRoot, '.git', 'hooks');
150
+ const results = [];
151
+ if (!fs.existsSync(hooksDir)) {
152
+ throw new Error(`No .git/hooks directory at ${hooksDir}. Is this a git repository?`);
153
+ }
154
+ const hooksToInstall = [
155
+ { name: 'post-commit', content: postCommitScript(gateKeeperDir) },
156
+ { name: 'post-checkout', content: postCheckoutScript(gateKeeperDir) },
157
+ ];
158
+ for (const { name, content } of hooksToInstall) {
159
+ const hookPath = path.join(hooksDir, name);
160
+ const exists = fs.existsSync(hookPath);
161
+ if (exists && !force) {
162
+ results.push({ hook: name, path: hookPath, action: 'skipped', content });
163
+ continue;
164
+ }
165
+ fs.writeFileSync(hookPath, content, { encoding: 'utf8', mode: 0o755 });
166
+ results.push({ hook: name, path: hookPath, action: exists ? 'updated' : 'created', content });
167
+ }
168
+ return results;
169
+ }
170
+ /** Generate the .gitattributes line for the graph merge driver */
171
+ function gitAttributesEntry() {
172
+ return 'graph.json merge=gate-keeper-graph\n';
173
+ }
174
+ /** Generate the .git/config snippet for the merge driver */
175
+ function gitConfigEntry(gateKeeperDir) {
176
+ const driverPath = path.join(gateKeeperDir, 'dist', 'hooks', 'merge-driver.sh');
177
+ return `[merge "gate-keeper-graph"]\n\tname = Gate Keeper graph merge driver\n\tdriver = ${driverPath} %O %A %B\n`;
178
+ }
179
+ //# sourceMappingURL=git-hooks.js.map
@@ -0,0 +1 @@
1
+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start
3
+ * so the first 3-5 queries have zero latency.
4
+ *
5
+ * The preloader fetches the full dependency graph and key metrics, then caches
6
+ * them in memory. Subsequent queries read from this cache instead of hitting
7
+ * the daemon (HTTP round-trip).
8
+ */
9
+ export interface PreloadedData {
10
+ graph: unknown | null;
11
+ status: {
12
+ overallRating?: number;
13
+ } | null;
14
+ cycles: unknown[] | null;
15
+ loadedAt: number;
16
+ repo: string;
17
+ }
18
+ /**
19
+ * Preload graph data for `repo`. Returns the cached data.
20
+ * Subsequent calls return the cached data without re-fetching.
21
+ */
22
+ export declare function preloadForRepo(repo: string): Promise<PreloadedData>;
23
+ /**
24
+ * Invalidate the cached preload so the next call re-fetches.
25
+ */
26
+ export declare function invalidatePreload(): void;
27
+ /** Check if preloaded data exists and is fresh (< 5 minutes old). */
28
+ export declare function isPreloaded(repo: string): boolean;
29
+ //# sourceMappingURL=cache-preload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-preload.d.ts","sourceRoot":"","sources":["../../src/mcp/cache-preload.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAkBD;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBzE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGjD"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ /**
3
+ * Smart cache preload — reads graph data from the daemon at MCP session start
4
+ * so the first 3-5 queries have zero latency.
5
+ *
6
+ * The preloader fetches the full dependency graph and key metrics, then caches
7
+ * them in memory. Subsequent queries read from this cache instead of hitting
8
+ * the daemon (HTTP round-trip).
9
+ */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
22
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
23
+ }) : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = (this && this.__importStar) || (function () {
27
+ var ownKeys = function(o) {
28
+ ownKeys = Object.getOwnPropertyNames || function (o) {
29
+ var ar = [];
30
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
31
+ return ar;
32
+ };
33
+ return ownKeys(o);
34
+ };
35
+ return function (mod) {
36
+ if (mod && mod.__esModule) return mod;
37
+ var result = {};
38
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
39
+ __setModuleDefault(result, mod);
40
+ return result;
41
+ };
42
+ })();
43
+ Object.defineProperty(exports, "__esModule", { value: true });
44
+ exports.preloadForRepo = preloadForRepo;
45
+ exports.invalidatePreload = invalidatePreload;
46
+ exports.isPreloaded = isPreloaded;
47
+ const http = __importStar(require("http"));
48
+ const DAEMON_PORT = 5378;
49
+ const DEFAULT_REPO = process.cwd();
50
+ let cached = null;
51
+ function fetchApi(urlPath) {
52
+ return new Promise((resolve) => {
53
+ const req = http.get(`http://127.0.0.1:${DAEMON_PORT}${urlPath}`, { timeout: 3000 }, (res) => {
54
+ let body = '';
55
+ res.on('data', (chunk) => { body += chunk; });
56
+ res.on('end', () => {
57
+ try {
58
+ resolve(JSON.parse(body));
59
+ }
60
+ catch {
61
+ resolve(null);
62
+ }
63
+ });
64
+ });
65
+ req.on('error', () => resolve(null));
66
+ req.on('timeout', () => { req.destroy(); resolve(null); });
67
+ });
68
+ }
69
+ /**
70
+ * Preload graph data for `repo`. Returns the cached data.
71
+ * Subsequent calls return the cached data without re-fetching.
72
+ */
73
+ async function preloadForRepo(repo) {
74
+ if (cached && cached.repo === repo)
75
+ return cached;
76
+ const repoEncoded = encodeURIComponent(repo);
77
+ const [graph, status, cycles] = await Promise.all([
78
+ fetchApi(`/api/graph?repo=${repoEncoded}`),
79
+ fetchApi(`/api/status?repo=${repoEncoded}`),
80
+ fetchApi(`/api/cycles?repo=${repoEncoded}`),
81
+ ]);
82
+ cached = {
83
+ graph,
84
+ status: status,
85
+ cycles: cycles,
86
+ loadedAt: Date.now(),
87
+ repo,
88
+ };
89
+ return cached;
90
+ }
91
+ /**
92
+ * Invalidate the cached preload so the next call re-fetches.
93
+ */
94
+ function invalidatePreload() {
95
+ cached = null;
96
+ }
97
+ /** Check if preloaded data exists and is fresh (< 5 minutes old). */
98
+ function isPreloaded(repo) {
99
+ if (!cached || cached.repo !== repo)
100
+ return false;
101
+ return (Date.now() - cached.loadedAt) < 5 * 60 * 1000;
102
+ }
103
+ //# sourceMappingURL=cache-preload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-preload.js","sourceRoot":"","sources":["../../src/mcp/cache-preload.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCH,wCAkBC;AAKD,8CAEC;AAGD,kCAGC;AAhED,2CAA6B;AAE7B,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,E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,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAChD,QAAQ,CAAC,mBAAmB,WAAW,EAAE,CAAC;QAC1C,QAAQ,CAAC,oBAAoB,WAAW,EAAE,CAAC;QAC3C,QAAQ,CAAC,oBAAoB,WAAW,EAAE,CAAC;KAC5C,CAAC,CAAC;IAEH,MAAM,GAAG;QACP,KAAK;QACL,MAAM,EAAE,MAAiC;QACzC,MAAM,EAAE,MAAmB;QAC3B,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;QACpB,IAAI;KACL,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB;IAC/B,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC;AAED,qEAAqE;AACrE,SAAgB,WAAW,CAAC,IAAY;IACtC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACxD,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { McpResponse } from './shared';
2
+ export declare function handleCodebaseHealth(args: Record<string, unknown>): Promise<McpResponse>;
3
+ export declare function handleQualityRules(): Promise<McpResponse>;
4
+ //# sourceMappingURL=analysis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../../src/mcp/handlers/analysis.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkB,WAAW,EAAE,MAAM,UAAU,CAAC;AAOvD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAoF9F;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC,CA0E/D"}
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.handleCodebaseHealth = handleCodebaseHealth;
37
+ exports.handleQualityRules = handleQualityRules;
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ const universal_analyzer_1 = require("../../analyzer/universal-analyzer");
41
+ const dependency_graph_1 = require("../../graph/dependency-graph");
42
+ const helpers_1 = require("../helpers");
43
+ const shared_1 = require("./shared");
44
+ const sonar_rule_map_1 = require("../../analyzer/sonar-rule-map");
45
+ // ── Shared instance ────────────────────────────────────────
46
+ const fileAnalyzer = new universal_analyzer_1.UniversalAnalyzer();
47
+ async function handleCodebaseHealth(args) {
48
+ const maxFiles = Number(args.max_files) || 200;
49
+ const dir = String(args.directory || (0, helpers_1.findGitRoot)(process.cwd()));
50
+ if (!fs.existsSync(dir))
51
+ return (0, shared_1.text)(`Error: Directory not found: ${dir}`);
52
+ const files = (0, helpers_1.findSourceFiles)(dir, maxFiles);
53
+ if (files.length === 0)
54
+ return (0, shared_1.text)('No supported source files found in the directory.');
55
+ const analyses = [];
56
+ for (const f of files) {
57
+ const a = await fileAnalyzer.analyze(f);
58
+ if (a)
59
+ analyses.push(a);
60
+ }
61
+ const minRating = (0, helpers_1.getMinRating)();
62
+ const totalRating = analyses.reduce((s, a) => s + a.rating, 0);
63
+ const avgRating = Math.round((totalRating / analyses.length) * 10) / 10;
64
+ const sorted = [...analyses].sort((a, b) => a.rating - b.rating);
65
+ const violationCounts = new Map();
66
+ for (const a of analyses) {
67
+ for (const v of a.violations) {
68
+ violationCounts.set(v.type, (violationCounts.get(v.type) ?? 0) + 1);
69
+ }
70
+ }
71
+ const topViolations = [...violationCounts.entries()]
72
+ .sort((a, b) => b[1] - a[1])
73
+ .slice(0, 10);
74
+ const excellent = analyses.filter(a => a.rating >= 8).length;
75
+ const good = analyses.filter(a => a.rating >= 6 && a.rating < 8).length;
76
+ const poor = analyses.filter(a => a.rating < 6).length;
77
+ const passed = avgRating >= minRating;
78
+ const lines = [
79
+ '## Codebase Health Report',
80
+ `**Overall Rating: ${avgRating}/10** (${analyses.length} files) ${passed ? '✅' : '⚠️'}`,
81
+ '',
82
+ '### Rating Distribution',
83
+ `- 🟢 Excellent (≥8.0): ${excellent} files`,
84
+ `- 🟡 Needs work (6.0–7.9): ${good} files`,
85
+ `- 🔴 Poor (<6.0): ${poor} files`,
86
+ ];
87
+ if (sorted.length > 0 && sorted[0].rating < minRating) {
88
+ lines.push('', '### Worst Files');
89
+ for (const a of sorted.slice(0, 10)) {
90
+ if (a.rating >= minRating)
91
+ break;
92
+ const relPath = path.relative(dir, a.path);
93
+ lines.push(`- **${a.rating}/10** — ${relPath} (${a.violations.length} violations)`);
94
+ }
95
+ }
96
+ if (topViolations.length > 0) {
97
+ lines.push('', '### Most Common Violations');
98
+ for (const [type, count] of topViolations) {
99
+ lines.push(`- ${type}: ${count} occurrences`);
100
+ }
101
+ }
102
+ const ratingByNode = new Map();
103
+ for (const a of analyses)
104
+ ratingByNode.set(a.path, a.rating);
105
+ const knownPaths = new Set(analyses.map(a => a.path));
106
+ const edges = [];
107
+ for (const a of analyses) {
108
+ for (const d of a.dependencies) {
109
+ if (knownPaths.has(d.target))
110
+ edges.push({ source: a.path, target: d.target });
111
+ }
112
+ }
113
+ const fixOrder = (0, dependency_graph_1.topoSort)([...knownPaths], edges, ratingByNode);
114
+ const data = {
115
+ avgRating,
116
+ fileCount: analyses.length,
117
+ distribution: { excellent, good, poor },
118
+ worstFiles: sorted.slice(0, 10).filter(a => a.rating < minRating),
119
+ topViolationTypes: topViolations.map(([type, count]) => ({ type, count })),
120
+ fixOrder,
121
+ };
122
+ return (0, shared_1.envelope)('get_codebase_health', data, lines.join('\n'));
123
+ }
124
+ async function handleQualityRules() {
125
+ const minRating = (0, helpers_1.getMinRating)();
126
+ const rules = [
127
+ '## Gate Keeper Quality Rules',
128
+ '',
129
+ `**Minimum acceptable rating: ${minRating}/10**`,
130
+ '',
131
+ '### Scoring',
132
+ 'Every file starts at 10.0. Deductions:',
133
+ '- **Error** violations: −1.5 each (e.g., missing key prop, empty catch)',
134
+ '- **Warning** violations: −0.5 each (e.g., `any` usage, god class, long method)',
135
+ '- **Info** violations: −0.1 each (e.g., console.log)',
136
+ '- Cyclomatic complexity >20: −2.0',
137
+ '- Cyclomatic complexity >10: −1.0',
138
+ '- Import count >30: −2.0',
139
+ '- Import count >15: −0.5',
140
+ '- Lines of code >500: −1.5',
141
+ '- Lines of code >300: −0.5',
142
+ '- Test coverage <50%: −1.0 (+ warning violation −0.5)',
143
+ '- Test coverage 50–80%: −0.5 (+ info violation −0.1)',
144
+ '- No test coverage data for file: warning violation −0.5',
145
+ '',
146
+ '### TypeScript / JavaScript Rules',
147
+ '- **any_usage** (warning): Do not use `any`. Use specific types or `unknown`.',
148
+ '- **console_log** (info): Remove console.log/warn/error from production code.',
149
+ '- **hook_overload** (warning): React components should not have >7 hooks.',
150
+ '- **duplicate_hooks** (warning): Do not call the same hook multiple times.',
151
+ '- **missing_key** (error): Always add `key` prop in `.map()` JSX.',
152
+ '- **inline_handler** (warning): Extract inline JSX event handlers to named functions.',
153
+ '',
154
+ '### Test Coverage Rules',
155
+ '- **no_test_coverage** (warning): File has no unit test coverage in the coverage report.',
156
+ '- **low_test_coverage** (warning): Test coverage below 50% — add more tests.',
157
+ '- **moderate_test_coverage** (info): Test coverage between 50–80% — consider improving.',
158
+ '- **uncovered_lines** (info): Lists specific lines not covered by tests.',
159
+ '',
160
+ '### C# / .NET Rules',
161
+ '- **god_class** (warning): Classes with >20 methods should be split.',
162
+ '- **long_method** (warning): Methods longer than 50 lines should be refactored.',
163
+ '- **tight_coupling** (warning): Constructors/methods with >5 parameters need a parameter object.',
164
+ '- **empty_catch** (error): Never swallow exceptions with empty catch blocks.',
165
+ '',
166
+ '### Best Practices for Passing',
167
+ '1. Use specific types — never `any`.',
168
+ '2. Add `key` props to all list-rendered JSX elements.',
169
+ '3. Keep functions/methods under 50 lines.',
170
+ '4. Keep files under 300 lines (ideally under 200).',
171
+ '5. Limit parameters to 5 or fewer.',
172
+ '6. Always handle errors in catch blocks.',
173
+ '7. Remove console.log before committing.',
174
+ '8. Run tests with coverage (`--coverage`) to generate lcov.info for coverage analysis.',
175
+ '9. Aim for 80%+ test coverage on all source files.',
176
+ ];
177
+ const nativeRules = [
178
+ { ruleId: 'ts/no-any', severity: 'warning', deduction: 0.5, category: 'code_smell', description: 'Do not use `any`. Use specific types or `unknown`.', fixable: true, source: 'gate-keeper' },
179
+ { ruleId: 'ts/no-console', severity: 'info', deduction: 0.1, category: 'code_smell', description: 'Remove console.log from production code.', fixable: true, source: 'gate-keeper' },
180
+ { ruleId: 'react/hook-count', severity: 'warning', deduction: 0.5, category: 'code_smell', description: 'React components should not have >7 hooks.', fixable: false, source: 'gate-keeper' },
181
+ { ruleId: 'react/no-duplicate-hooks', severity: 'warning', deduction: 0.5, category: 'bug', description: 'Do not call the same hook multiple times.', fixable: false, source: 'gate-keeper' },
182
+ { ruleId: 'react/jsx-key', severity: 'error', deduction: 1.5, category: 'bug', description: 'Always add `key` prop in `.map()` JSX.', fixable: false, source: 'gate-keeper' },
183
+ { ruleId: 'react/no-inline-handler', severity: 'warning', deduction: 0.5, category: 'code_smell', description: 'Extract inline JSX event handlers to named functions.', fixable: false, source: 'gate-keeper' },
184
+ { ruleId: 'ts/no-todo', severity: 'warning', deduction: 0.5, category: 'code_smell', description: 'Resolve TODO/FIXME/PLACEHOLDER markers before merging.', fixable: false, source: 'gate-keeper' },
185
+ { ruleId: 'ts/tech-debt', severity: 'info', deduction: 0.1, category: 'code_smell', description: 'HACK/WORKAROUND markers — track in your issue tracker.', fixable: false, source: 'gate-keeper' },
186
+ { ruleId: 'ts/no-stub', severity: 'error', deduction: 1.5, category: 'bug', description: 'Unimplemented stubs will throw at runtime.', fixable: false, source: 'gate-keeper' },
187
+ { ruleId: 'cs/god-class', severity: 'warning', deduction: 0.5, category: 'code_smell', description: 'Classes with >20 methods should be split.', fixable: false, source: 'gate-keeper' },
188
+ { ruleId: 'cs/long-method', severity: 'warning', deduction: 0.5, category: 'code_smell', description: 'Methods longer than 50 lines should be refactored.', fixable: false, source: 'gate-keeper' },
189
+ { ruleId: 'cs/tight-coupling', severity: 'warning', deduction: 0.5, category: 'code_smell', description: 'Constructors with >5 parameters need a parameter object.', fixable: false, source: 'gate-keeper' },
190
+ { ruleId: 'cs/magic-number', severity: 'info', deduction: 0.1, category: 'code_smell', description: 'Extract magic numbers to named constants.', fixable: false, source: 'gate-keeper' },
191
+ { ruleId: 'cs/empty-catch', severity: 'error', deduction: 1.5, category: 'bug', description: 'Never swallow exceptions with empty catch blocks.', fixable: false, source: 'gate-keeper' },
192
+ ];
193
+ const rulesData = [...nativeRules, ...sonar_rule_map_1.SONARJS_RULE_LIST];
194
+ return (0, shared_1.envelope)('get_quality_rules', { minRating, rules: rulesData }, rules.join('\n'));
195
+ }
196
+ //# sourceMappingURL=analysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../../src/mcp/handlers/analysis.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,oDAoFC;AAED,gDA0EC;AAjLD,uCAAyB;AACzB,2CAA6B;AAC7B,0EAAsE;AACtE,mEAAwD;AAExD,wCAIoB;AACpB,qCAAuD;AACvD,kEAAkE;AAElE,8DAA8D;AAE9D,MAAM,YAAY,GAAG,IAAI,sCAAiB,EAAE,CAAC;AAEtC,KAAK,UAAU,oBAAoB,CAAC,IAA6B;IACtE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC;IAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,IAAA,qBAAW,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAEjE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAA,aAAI,EAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;IAE3E,MAAM,KAAK,GAAG,IAAA,yBAAe,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAA,aAAI,EAAC,mDAAmD,CAAC,CAAC;IAEzF,MAAM,QAAQ,GAAmB,EAAE,CAAC;IACpC,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACxC,IAAI,CAAC;YAAE,QAAQ,CAAC,IAAI,CAA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AE,QAAQ,EAAE,KAAK,EAAY,WAAW,EAAE,mDAAmD,EAAG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,aAAsB,EAAE;KAC3N,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,GAAG,WAAW,EAAE,GAAG,kCAAiB,CAAC,CAAC;IAEzD,OAAO,IAAA,iBAAQ,EAAC,mBAAmB,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1F,CAAC"}
@@ -0,0 +1,25 @@
1
+ export declare function handleFileContext(args: Record<string, unknown>): Promise<{
2
+ content: Array<{
3
+ type: string;
4
+ text: string;
5
+ }>;
6
+ }>;
7
+ export declare function handleDependencyGraph(args: Record<string, unknown>): Promise<{
8
+ content: Array<{
9
+ type: string;
10
+ text: string;
11
+ }>;
12
+ }>;
13
+ export declare function handleImpactAnalysis(args: Record<string, unknown>): Promise<{
14
+ content: Array<{
15
+ type: string;
16
+ text: string;
17
+ }>;
18
+ }>;
19
+ export declare function handlePredictImpactWithRemediation(args: Record<string, unknown>): Promise<{
20
+ content: Array<{
21
+ type: string;
22
+ text: string;
23
+ }>;
24
+ }>;
25
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/mcp/handlers/context.ts"],"names":[],"mappings":"AAiBA,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAiGlI;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAqFtI;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA6ErI;AAED,wBAAsB,kCAAkC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CA4GnJ"}