api-tests-coverage 1.0.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 (288) hide show
  1. package/README.md +703 -0
  2. package/config.yaml.example +227 -0
  3. package/dist/action/src/index.d.ts +2 -0
  4. package/dist/action/src/index.d.ts.map +1 -0
  5. package/dist/action/src/index.js +349 -0
  6. package/dist/action/src/prComment.d.ts +34 -0
  7. package/dist/action/src/prComment.d.ts.map +1 -0
  8. package/dist/action/src/prComment.js +146 -0
  9. package/dist/src/ast/astAnalysisOrchestrator.d.ts +36 -0
  10. package/dist/src/ast/astAnalysisOrchestrator.d.ts.map +1 -0
  11. package/dist/src/ast/astAnalysisOrchestrator.js +123 -0
  12. package/dist/src/ast/astTypes.d.ts +105 -0
  13. package/dist/src/ast/astTypes.d.ts.map +1 -0
  14. package/dist/src/ast/astTypes.js +9 -0
  15. package/dist/src/ast/languageAnalyzer.d.ts +46 -0
  16. package/dist/src/ast/languageAnalyzer.d.ts.map +1 -0
  17. package/dist/src/ast/languageAnalyzer.js +9 -0
  18. package/dist/src/ast/languageCapabilities.d.ts +24 -0
  19. package/dist/src/ast/languageCapabilities.d.ts.map +1 -0
  20. package/dist/src/ast/languageCapabilities.js +92 -0
  21. package/dist/src/ast/parseFile.d.ts +16 -0
  22. package/dist/src/ast/parseFile.d.ts.map +1 -0
  23. package/dist/src/ast/parseFile.js +65 -0
  24. package/dist/src/ast/parserRegistry.d.ts +39 -0
  25. package/dist/src/ast/parserRegistry.d.ts.map +1 -0
  26. package/dist/src/ast/parserRegistry.js +66 -0
  27. package/dist/src/buildSummary.d.ts +26 -0
  28. package/dist/src/buildSummary.d.ts.map +1 -0
  29. package/dist/src/buildSummary.js +193 -0
  30. package/dist/src/businessCoverage.d.ts +68 -0
  31. package/dist/src/businessCoverage.d.ts.map +1 -0
  32. package/dist/src/businessCoverage.js +290 -0
  33. package/dist/src/compatibilityCoverage.d.ts +83 -0
  34. package/dist/src/compatibilityCoverage.d.ts.map +1 -0
  35. package/dist/src/compatibilityCoverage.js +501 -0
  36. package/dist/src/config/defaultConfig.d.ts +9 -0
  37. package/dist/src/config/defaultConfig.d.ts.map +1 -0
  38. package/dist/src/config/defaultConfig.js +97 -0
  39. package/dist/src/config/index.d.ts +12 -0
  40. package/dist/src/config/index.d.ts.map +1 -0
  41. package/dist/src/config/index.js +37 -0
  42. package/dist/src/config/loadConfig.d.ts +29 -0
  43. package/dist/src/config/loadConfig.d.ts.map +1 -0
  44. package/dist/src/config/loadConfig.js +135 -0
  45. package/dist/src/config/mergeConfig.d.ts +15 -0
  46. package/dist/src/config/mergeConfig.d.ts.map +1 -0
  47. package/dist/src/config/mergeConfig.js +57 -0
  48. package/dist/src/config/schema.d.ts +15 -0
  49. package/dist/src/config/schema.d.ts.map +1 -0
  50. package/dist/src/config/schema.js +30 -0
  51. package/dist/src/config/types.d.ts +175 -0
  52. package/dist/src/config/types.d.ts.map +1 -0
  53. package/dist/src/config/types.js +9 -0
  54. package/dist/src/config/validateConfig.d.ts +22 -0
  55. package/dist/src/config/validateConfig.d.ts.map +1 -0
  56. package/dist/src/config/validateConfig.js +171 -0
  57. package/dist/src/config.d.ts +168 -0
  58. package/dist/src/config.d.ts.map +1 -0
  59. package/dist/src/config.js +204 -0
  60. package/dist/src/coverage/deep-analysis/callGraph.d.ts +67 -0
  61. package/dist/src/coverage/deep-analysis/callGraph.d.ts.map +1 -0
  62. package/dist/src/coverage/deep-analysis/callGraph.js +275 -0
  63. package/dist/src/coverage/deep-analysis/deepEndpointResolver.d.ts +23 -0
  64. package/dist/src/coverage/deep-analysis/deepEndpointResolver.d.ts.map +1 -0
  65. package/dist/src/coverage/deep-analysis/deepEndpointResolver.js +394 -0
  66. package/dist/src/coverage/deep-analysis/index.d.ts +17 -0
  67. package/dist/src/coverage/deep-analysis/index.d.ts.map +1 -0
  68. package/dist/src/coverage/deep-analysis/index.js +63 -0
  69. package/dist/src/coverage/deep-analysis/resolveAssertions.d.ts +60 -0
  70. package/dist/src/coverage/deep-analysis/resolveAssertions.d.ts.map +1 -0
  71. package/dist/src/coverage/deep-analysis/resolveAssertions.js +121 -0
  72. package/dist/src/coverage/deep-analysis/resolveConstants.d.ts +36 -0
  73. package/dist/src/coverage/deep-analysis/resolveConstants.d.ts.map +1 -0
  74. package/dist/src/coverage/deep-analysis/resolveConstants.js +92 -0
  75. package/dist/src/coverage/deep-analysis/resolveEnums.d.ts +55 -0
  76. package/dist/src/coverage/deep-analysis/resolveEnums.d.ts.map +1 -0
  77. package/dist/src/coverage/deep-analysis/resolveEnums.js +152 -0
  78. package/dist/src/coverage/deep-analysis/resolveMethodChains.d.ts +70 -0
  79. package/dist/src/coverage/deep-analysis/resolveMethodChains.d.ts.map +1 -0
  80. package/dist/src/coverage/deep-analysis/resolveMethodChains.js +152 -0
  81. package/dist/src/coverage/deep-analysis/resolvePaths.d.ts +80 -0
  82. package/dist/src/coverage/deep-analysis/resolvePaths.d.ts.map +1 -0
  83. package/dist/src/coverage/deep-analysis/resolvePaths.js +216 -0
  84. package/dist/src/coverage/deep-analysis/resolveRequestWrappers.d.ts +71 -0
  85. package/dist/src/coverage/deep-analysis/resolveRequestWrappers.d.ts.map +1 -0
  86. package/dist/src/coverage/deep-analysis/resolveRequestWrappers.js +226 -0
  87. package/dist/src/coverage/deep-analysis/symbolTable.d.ts +58 -0
  88. package/dist/src/coverage/deep-analysis/symbolTable.d.ts.map +1 -0
  89. package/dist/src/coverage/deep-analysis/symbolTable.js +230 -0
  90. package/dist/src/coverage/deep-analysis/types.d.ts +122 -0
  91. package/dist/src/coverage/deep-analysis/types.d.ts.map +1 -0
  92. package/dist/src/coverage/deep-analysis/types.js +21 -0
  93. package/dist/src/discovery/fileClassifier.d.ts +50 -0
  94. package/dist/src/discovery/fileClassifier.d.ts.map +1 -0
  95. package/dist/src/discovery/fileClassifier.js +238 -0
  96. package/dist/src/discovery/projectDiscovery.d.ts +66 -0
  97. package/dist/src/discovery/projectDiscovery.d.ts.map +1 -0
  98. package/dist/src/discovery/projectDiscovery.js +287 -0
  99. package/dist/src/endpointCoverage.d.ts +70 -0
  100. package/dist/src/endpointCoverage.d.ts.map +1 -0
  101. package/dist/src/endpointCoverage.js +381 -0
  102. package/dist/src/errorCoverage.d.ts +93 -0
  103. package/dist/src/errorCoverage.d.ts.map +1 -0
  104. package/dist/src/errorCoverage.js +698 -0
  105. package/dist/src/index.d.ts +3 -0
  106. package/dist/src/index.d.ts.map +1 -0
  107. package/dist/src/index.js +1441 -0
  108. package/dist/src/inference/businessRuleInference.d.ts +63 -0
  109. package/dist/src/inference/businessRuleInference.d.ts.map +1 -0
  110. package/dist/src/inference/businessRuleInference.js +268 -0
  111. package/dist/src/inference/integrationFlowInference.d.ts +56 -0
  112. package/dist/src/inference/integrationFlowInference.d.ts.map +1 -0
  113. package/dist/src/inference/integrationFlowInference.js +266 -0
  114. package/dist/src/integrationCoverage.d.ts +72 -0
  115. package/dist/src/integrationCoverage.d.ts.map +1 -0
  116. package/dist/src/integrationCoverage.js +317 -0
  117. package/dist/src/intelligence/index.d.ts +20 -0
  118. package/dist/src/intelligence/index.d.ts.map +1 -0
  119. package/dist/src/intelligence/index.js +105 -0
  120. package/dist/src/intelligence/linkageEngine.d.ts +20 -0
  121. package/dist/src/intelligence/linkageEngine.d.ts.map +1 -0
  122. package/dist/src/intelligence/linkageEngine.js +522 -0
  123. package/dist/src/intelligence/markdownReporter.d.ts +12 -0
  124. package/dist/src/intelligence/markdownReporter.d.ts.map +1 -0
  125. package/dist/src/intelligence/markdownReporter.js +265 -0
  126. package/dist/src/intelligence/riskScoring.d.ts +53 -0
  127. package/dist/src/intelligence/riskScoring.d.ts.map +1 -0
  128. package/dist/src/intelligence/riskScoring.js +181 -0
  129. package/dist/src/intelligence/types.d.ts +121 -0
  130. package/dist/src/intelligence/types.d.ts.map +1 -0
  131. package/dist/src/intelligence/types.js +8 -0
  132. package/dist/src/languageDetection.d.ts +100 -0
  133. package/dist/src/languageDetection.d.ts.map +1 -0
  134. package/dist/src/languageDetection.js +349 -0
  135. package/dist/src/languages/java/index.d.ts +16 -0
  136. package/dist/src/languages/java/index.d.ts.map +1 -0
  137. package/dist/src/languages/java/index.js +103 -0
  138. package/dist/src/languages/java/parser.d.ts +7 -0
  139. package/dist/src/languages/java/parser.d.ts.map +1 -0
  140. package/dist/src/languages/java/parser.js +50 -0
  141. package/dist/src/languages/java/semanticBuilder.d.ts +21 -0
  142. package/dist/src/languages/java/semanticBuilder.d.ts.map +1 -0
  143. package/dist/src/languages/java/semanticBuilder.js +358 -0
  144. package/dist/src/languages/javascript/annotationExtractor.d.ts +20 -0
  145. package/dist/src/languages/javascript/annotationExtractor.d.ts.map +1 -0
  146. package/dist/src/languages/javascript/annotationExtractor.js +94 -0
  147. package/dist/src/languages/javascript/assertionResolver.d.ts +18 -0
  148. package/dist/src/languages/javascript/assertionResolver.d.ts.map +1 -0
  149. package/dist/src/languages/javascript/assertionResolver.js +150 -0
  150. package/dist/src/languages/javascript/callResolver.d.ts +23 -0
  151. package/dist/src/languages/javascript/callResolver.d.ts.map +1 -0
  152. package/dist/src/languages/javascript/callResolver.js +236 -0
  153. package/dist/src/languages/javascript/httpInteractionExtractor.d.ts +23 -0
  154. package/dist/src/languages/javascript/httpInteractionExtractor.d.ts.map +1 -0
  155. package/dist/src/languages/javascript/httpInteractionExtractor.js +205 -0
  156. package/dist/src/languages/javascript/index.d.ts +20 -0
  157. package/dist/src/languages/javascript/index.d.ts.map +1 -0
  158. package/dist/src/languages/javascript/index.js +136 -0
  159. package/dist/src/languages/javascript/parser.d.ts +14 -0
  160. package/dist/src/languages/javascript/parser.d.ts.map +1 -0
  161. package/dist/src/languages/javascript/parser.js +38 -0
  162. package/dist/src/languages/javascript/symbolResolver.d.ts +31 -0
  163. package/dist/src/languages/javascript/symbolResolver.d.ts.map +1 -0
  164. package/dist/src/languages/javascript/symbolResolver.js +183 -0
  165. package/dist/src/languages/kotlin/index.d.ts +16 -0
  166. package/dist/src/languages/kotlin/index.d.ts.map +1 -0
  167. package/dist/src/languages/kotlin/index.js +151 -0
  168. package/dist/src/languages/kotlin/parser.d.ts +11 -0
  169. package/dist/src/languages/kotlin/parser.d.ts.map +1 -0
  170. package/dist/src/languages/kotlin/parser.js +74 -0
  171. package/dist/src/languages/python/index.d.ts +15 -0
  172. package/dist/src/languages/python/index.d.ts.map +1 -0
  173. package/dist/src/languages/python/index.js +293 -0
  174. package/dist/src/languages/ruby/index.d.ts +15 -0
  175. package/dist/src/languages/ruby/index.d.ts.map +1 -0
  176. package/dist/src/languages/ruby/index.js +274 -0
  177. package/dist/src/languages/shared/treeSitterUtils.d.ts +43 -0
  178. package/dist/src/languages/shared/treeSitterUtils.d.ts.map +1 -0
  179. package/dist/src/languages/shared/treeSitterUtils.js +100 -0
  180. package/dist/src/languages/typescript/index.d.ts +14 -0
  181. package/dist/src/languages/typescript/index.d.ts.map +1 -0
  182. package/dist/src/languages/typescript/index.js +25 -0
  183. package/dist/src/lib/index.d.ts +228 -0
  184. package/dist/src/lib/index.d.ts.map +1 -0
  185. package/dist/src/lib/index.js +486 -0
  186. package/dist/src/mcp/client/index.d.ts +37 -0
  187. package/dist/src/mcp/client/index.d.ts.map +1 -0
  188. package/dist/src/mcp/client/index.js +235 -0
  189. package/dist/src/mcp/config.d.ts +50 -0
  190. package/dist/src/mcp/config.d.ts.map +1 -0
  191. package/dist/src/mcp/config.js +125 -0
  192. package/dist/src/mcp/events.d.ts +24 -0
  193. package/dist/src/mcp/events.d.ts.map +1 -0
  194. package/dist/src/mcp/events.js +48 -0
  195. package/dist/src/mcp/fallback/index.d.ts +50 -0
  196. package/dist/src/mcp/fallback/index.d.ts.map +1 -0
  197. package/dist/src/mcp/fallback/index.js +216 -0
  198. package/dist/src/mcp/index.d.ts +67 -0
  199. package/dist/src/mcp/index.d.ts.map +1 -0
  200. package/dist/src/mcp/index.js +212 -0
  201. package/dist/src/mcp/normalizer.d.ts +21 -0
  202. package/dist/src/mcp/normalizer.d.ts.map +1 -0
  203. package/dist/src/mcp/normalizer.js +99 -0
  204. package/dist/src/mcp/prompts/index.d.ts +86 -0
  205. package/dist/src/mcp/prompts/index.d.ts.map +1 -0
  206. package/dist/src/mcp/prompts/index.js +304 -0
  207. package/dist/src/mcp/templates/index.d.ts +35 -0
  208. package/dist/src/mcp/templates/index.d.ts.map +1 -0
  209. package/dist/src/mcp/templates/index.js +143 -0
  210. package/dist/src/mcp/testing/mock-server/index.d.ts +47 -0
  211. package/dist/src/mcp/testing/mock-server/index.d.ts.map +1 -0
  212. package/dist/src/mcp/testing/mock-server/index.js +157 -0
  213. package/dist/src/mcp/types.d.ts +127 -0
  214. package/dist/src/mcp/types.d.ts.map +1 -0
  215. package/dist/src/mcp/types.js +8 -0
  216. package/dist/src/observability.d.ts +138 -0
  217. package/dist/src/observability.d.ts.map +1 -0
  218. package/dist/src/observability.js +519 -0
  219. package/dist/src/parameterCoverage.d.ts +75 -0
  220. package/dist/src/parameterCoverage.d.ts.map +1 -0
  221. package/dist/src/parameterCoverage.js +629 -0
  222. package/dist/src/perfResilienceCoverage.d.ts +155 -0
  223. package/dist/src/perfResilienceCoverage.d.ts.map +1 -0
  224. package/dist/src/perfResilienceCoverage.js +670 -0
  225. package/dist/src/pluginLoader.d.ts +51 -0
  226. package/dist/src/pluginLoader.d.ts.map +1 -0
  227. package/dist/src/pluginLoader.js +72 -0
  228. package/dist/src/publishing.d.ts +63 -0
  229. package/dist/src/publishing.d.ts.map +1 -0
  230. package/dist/src/publishing.js +379 -0
  231. package/dist/src/qualityGate.d.ts +58 -0
  232. package/dist/src/qualityGate.d.ts.map +1 -0
  233. package/dist/src/qualityGate.js +118 -0
  234. package/dist/src/reporting.d.ts +41 -0
  235. package/dist/src/reporting.d.ts.map +1 -0
  236. package/dist/src/reporting.js +278 -0
  237. package/dist/src/screenshots.d.ts +71 -0
  238. package/dist/src/screenshots.d.ts.map +1 -0
  239. package/dist/src/screenshots.js +141 -0
  240. package/dist/src/security/gate/index.d.ts +11 -0
  241. package/dist/src/security/gate/index.d.ts.map +1 -0
  242. package/dist/src/security/gate/index.js +65 -0
  243. package/dist/src/security/index.d.ts +30 -0
  244. package/dist/src/security/index.d.ts.map +1 -0
  245. package/dist/src/security/index.js +342 -0
  246. package/dist/src/security/normalizers/semgrep.d.ts +10 -0
  247. package/dist/src/security/normalizers/semgrep.d.ts.map +1 -0
  248. package/dist/src/security/normalizers/semgrep.js +104 -0
  249. package/dist/src/security/normalizers/trivy.d.ts +10 -0
  250. package/dist/src/security/normalizers/trivy.d.ts.map +1 -0
  251. package/dist/src/security/normalizers/trivy.js +78 -0
  252. package/dist/src/security/normalizers/zap.d.ts +10 -0
  253. package/dist/src/security/normalizers/zap.d.ts.map +1 -0
  254. package/dist/src/security/normalizers/zap.js +104 -0
  255. package/dist/src/security/scanners/semgrep.d.ts +6 -0
  256. package/dist/src/security/scanners/semgrep.d.ts.map +1 -0
  257. package/dist/src/security/scanners/semgrep.js +125 -0
  258. package/dist/src/security/scanners/trivy.d.ts +6 -0
  259. package/dist/src/security/scanners/trivy.d.ts.map +1 -0
  260. package/dist/src/security/scanners/trivy.js +115 -0
  261. package/dist/src/security/scanners/zap.d.ts +6 -0
  262. package/dist/src/security/scanners/zap.d.ts.map +1 -0
  263. package/dist/src/security/scanners/zap.js +135 -0
  264. package/dist/src/security/types.d.ts +146 -0
  265. package/dist/src/security/types.d.ts.map +1 -0
  266. package/dist/src/security/types.js +6 -0
  267. package/dist/src/securityCoverage.d.ts +116 -0
  268. package/dist/src/securityCoverage.d.ts.map +1 -0
  269. package/dist/src/securityCoverage.js +725 -0
  270. package/dist/src/summary/buildSummary.d.ts +28 -0
  271. package/dist/src/summary/buildSummary.d.ts.map +1 -0
  272. package/dist/src/summary/buildSummary.js +257 -0
  273. package/dist/src/summary/evaluateMetrics.d.ts +31 -0
  274. package/dist/src/summary/evaluateMetrics.d.ts.map +1 -0
  275. package/dist/src/summary/evaluateMetrics.js +118 -0
  276. package/dist/src/summary/index.d.ts +10 -0
  277. package/dist/src/summary/index.d.ts.map +1 -0
  278. package/dist/src/summary/index.js +22 -0
  279. package/dist/src/summary/markdownRenderer.d.ts +139 -0
  280. package/dist/src/summary/markdownRenderer.d.ts.map +1 -0
  281. package/dist/src/summary/markdownRenderer.js +459 -0
  282. package/dist/src/summary/prSummary.d.ts +24 -0
  283. package/dist/src/summary/prSummary.d.ts.map +1 -0
  284. package/dist/src/summary/prSummary.js +233 -0
  285. package/dist/src/summary/summaryTypes.d.ts +35 -0
  286. package/dist/src/summary/summaryTypes.d.ts.map +1 -0
  287. package/dist/src/summary/summaryTypes.js +27 -0
  288. package/package.json +84 -0
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ /**
3
+ * PR comment helper for the API Test Coverage Analyzer action.
4
+ *
5
+ * Detects when the action is running in a pull-request context and either
6
+ * creates or updates a single "coverage report" comment, keeping the PR
7
+ * timeline clean. The comment is identified by a hidden sentinel marker so
8
+ * subsequent runs update the same comment instead of appending new ones.
9
+ *
10
+ * Public API:
11
+ * postPrComment(token, body)
12
+ * isPrContext()
13
+ */
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ var desc = Object.getOwnPropertyDescriptor(m, k);
17
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
+ desc = { enumerable: true, get: function() { return m[k]; } };
19
+ }
20
+ Object.defineProperty(o, k2, desc);
21
+ }) : (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ }));
25
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27
+ }) : function(o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = (this && this.__importStar) || (function () {
31
+ var ownKeys = function(o) {
32
+ ownKeys = Object.getOwnPropertyNames || function (o) {
33
+ var ar = [];
34
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
35
+ return ar;
36
+ };
37
+ return ownKeys(o);
38
+ };
39
+ return function (mod) {
40
+ if (mod && mod.__esModule) return mod;
41
+ var result = {};
42
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ })();
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.isPrContext = isPrContext;
49
+ exports.readPrNumber = readPrNumber;
50
+ exports.postPrComment = postPrComment;
51
+ const fs = __importStar(require("fs"));
52
+ const core = __importStar(require("@actions/core"));
53
+ const github_1 = require("@actions/github");
54
+ /** Sentinel appended to every coverage comment so we can find + update it. */
55
+ const COMMENT_MARKER = '<!-- api-coverage-analyzer-comment -->';
56
+ /**
57
+ * Return true when the current workflow run is triggered by a pull-request
58
+ * event and all required env vars are present.
59
+ */
60
+ function isPrContext() {
61
+ var _a;
62
+ const event = (_a = process.env['GITHUB_EVENT_NAME']) !== null && _a !== void 0 ? _a : '';
63
+ // pull_request and pull_request_target both carry a PR number
64
+ return ((event === 'pull_request' || event === 'pull_request_target') &&
65
+ Boolean(process.env['GITHUB_EVENT_PATH']) &&
66
+ Boolean(process.env['GITHUB_REPOSITORY']));
67
+ }
68
+ /**
69
+ * Read the PR number from the GitHub event payload JSON file.
70
+ * Returns undefined when the file cannot be read or the number is absent.
71
+ */
72
+ function readPrNumber() {
73
+ var _a;
74
+ const eventPath = process.env['GITHUB_EVENT_PATH'];
75
+ if (!eventPath)
76
+ return undefined;
77
+ try {
78
+ const raw = fs.readFileSync(eventPath, 'utf-8');
79
+ const payload = JSON.parse(raw);
80
+ return (_a = payload.pull_request) === null || _a === void 0 ? void 0 : _a.number;
81
+ }
82
+ catch {
83
+ return undefined;
84
+ }
85
+ }
86
+ /**
87
+ * Post or update a single PR comment containing `body`.
88
+ *
89
+ * If a previous coverage comment (identified by COMMENT_MARKER) already
90
+ * exists it is updated in place; otherwise a new comment is created.
91
+ * Requires a token with `pull-requests: write` permission.
92
+ *
93
+ * @param token GitHub token (e.g. `${{ secrets.GITHUB_TOKEN }}`).
94
+ * @param body Markdown body to post.
95
+ */
96
+ async function postPrComment(token, body) {
97
+ var _a;
98
+ if (!isPrContext()) {
99
+ core.debug('Not a pull-request event – skipping PR comment.');
100
+ return;
101
+ }
102
+ const prNumber = readPrNumber();
103
+ if (!prNumber) {
104
+ core.warning('Could not determine PR number from event payload – skipping PR comment.');
105
+ return;
106
+ }
107
+ const repo = (_a = process.env['GITHUB_REPOSITORY']) !== null && _a !== void 0 ? _a : '';
108
+ const [owner, repoName] = repo.split('/');
109
+ if (!owner || !repoName) {
110
+ core.warning('GITHUB_REPOSITORY env var is not in "owner/repo" format – skipping PR comment.');
111
+ return;
112
+ }
113
+ const markedBody = `${body}\n\n${COMMENT_MARKER}`;
114
+ const octokit = (0, github_1.getOctokit)(token);
115
+ try {
116
+ // Search for an existing comment from this action
117
+ const { data: comments } = await octokit.rest.issues.listComments({
118
+ owner,
119
+ repo: repoName,
120
+ issue_number: prNumber,
121
+ });
122
+ const existing = comments.find((c) => { var _a; return (_a = c.body) === null || _a === void 0 ? void 0 : _a.includes(COMMENT_MARKER); });
123
+ if (existing) {
124
+ await octokit.rest.issues.updateComment({
125
+ owner,
126
+ repo: repoName,
127
+ comment_id: existing.id,
128
+ body: markedBody,
129
+ });
130
+ core.info(`Updated PR comment #${existing.id} on PR #${prNumber}`);
131
+ }
132
+ else {
133
+ const { data: created } = await octokit.rest.issues.createComment({
134
+ owner,
135
+ repo: repoName,
136
+ issue_number: prNumber,
137
+ body: markedBody,
138
+ });
139
+ core.info(`Created PR comment #${created.id} on PR #${prNumber}`);
140
+ }
141
+ }
142
+ catch (err) {
143
+ // Non-fatal: a missing permission or API error should not fail the build
144
+ core.warning(`Failed to post PR comment: ${err instanceof Error ? err.message : String(err)}`);
145
+ }
146
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * AST Analysis Orchestrator — primary entry point for per-file analysis.
3
+ *
4
+ * Three-tier cascade:
5
+ * Tier 1: AST parse + semantic model → confidence: high/medium
6
+ * AST yields ≥1 interactions → return them verbatim (authoritative)
7
+ * Tier 2: AST parse succeeds but yields 0 interactions AND fallbackHeuristics is true
8
+ * → run deepResolveFile(), tag all results resolutionType:'heuristic' + confidence:'low'
9
+ * Tier 3: AST disabled or parse error → existing deepResolveFile(), unchanged confidence
10
+ *
11
+ * All language modules must be imported (side-effect) before this is called
12
+ * so their analyzers are registered. Use `registerAllAnalyzers()` at startup.
13
+ */
14
+ import type { ResolvedHttpInteraction, SupportedLanguage, AnalysisContext } from './astTypes';
15
+ import type { AstAnalysisConfig } from '../config/types';
16
+ /**
17
+ * Analyze a single source file. Returns fully-resolved HTTP interactions.
18
+ *
19
+ * @param content Raw source text
20
+ * @param filePath Absolute path (used for error messages, deduplication)
21
+ * @param language Detected language (or 'auto')
22
+ * @param context Combined AST + deep-analysis config
23
+ */
24
+ export declare function analyzeFile(content: string, filePath: string, language: SupportedLanguage, context: AnalysisContext): ResolvedHttpInteraction[];
25
+ /**
26
+ * Bootstrap function — import all language analyzer modules so they
27
+ * register themselves in the parser registry. Must be called once at
28
+ * CLI/library startup before any `analyzeFile()` call.
29
+ */
30
+ export declare function registerAllAnalyzers(): void;
31
+ /**
32
+ * Build a default AnalysisContext from partial config.
33
+ * Useful for call sites that don't yet pass a full context.
34
+ */
35
+ export declare function buildAnalysisContext(astConfig?: AstAnalysisConfig, deepConfig?: any): AnalysisContext;
36
+ //# sourceMappingURL=astAnalysisOrchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astAnalysisOrchestrator.d.ts","sourceRoot":"","sources":["../../../src/ast/astAnalysisOrchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,eAAe,GACvB,uBAAuB,EAAE,CAwC3B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAO3C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,CAAC,EAAE,iBAAiB,EAE7B,UAAU,CAAC,EAAE,GAAG,GACf,eAAe,CAoBjB"}
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ /**
3
+ * AST Analysis Orchestrator — primary entry point for per-file analysis.
4
+ *
5
+ * Three-tier cascade:
6
+ * Tier 1: AST parse + semantic model → confidence: high/medium
7
+ * AST yields ≥1 interactions → return them verbatim (authoritative)
8
+ * Tier 2: AST parse succeeds but yields 0 interactions AND fallbackHeuristics is true
9
+ * → run deepResolveFile(), tag all results resolutionType:'heuristic' + confidence:'low'
10
+ * Tier 3: AST disabled or parse error → existing deepResolveFile(), unchanged confidence
11
+ *
12
+ * All language modules must be imported (side-effect) before this is called
13
+ * so their analyzers are registered. Use `registerAllAnalyzers()` at startup.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.analyzeFile = analyzeFile;
17
+ exports.registerAllAnalyzers = registerAllAnalyzers;
18
+ exports.buildAnalysisContext = buildAnalysisContext;
19
+ const parseFile_1 = require("./parseFile");
20
+ const deepEndpointResolver_1 = require("../coverage/deep-analysis/deepEndpointResolver");
21
+ const types_1 = require("../coverage/deep-analysis/types");
22
+ /**
23
+ * Analyze a single source file. Returns fully-resolved HTTP interactions.
24
+ *
25
+ * @param content Raw source text
26
+ * @param filePath Absolute path (used for error messages, deduplication)
27
+ * @param language Detected language (or 'auto')
28
+ * @param context Combined AST + deep-analysis config
29
+ */
30
+ function analyzeFile(content, filePath, language, context) {
31
+ const { astConfig, deepConfig } = context;
32
+ const fallbackEnabled = astConfig.fallbackHeuristics !== false;
33
+ // ── Tier 1: AST path ──────────────────────────────────────────────────────
34
+ if (astConfig.enabled !== false) {
35
+ const astResults = (0, parseFile_1.analyzeFileWithAst)(filePath, content, language, context);
36
+ if (astResults !== null) {
37
+ // AST parsed successfully
38
+ if (astResults.length > 0) {
39
+ // Non-empty AST result — return verbatim (authoritative)
40
+ return astResults;
41
+ }
42
+ // ── Tier 2: AST found nothing — optionally run regex fallback ────────
43
+ if (fallbackEnabled && deepConfig.enabled) {
44
+ const regexLang = language === 'auto' ? 'typescript' : language;
45
+ const heuristicResults = (0, deepEndpointResolver_1.deepResolveFile)(content, filePath, regexLang, deepConfig);
46
+ // Tag all fallback results as heuristic / low confidence
47
+ return heuristicResults.map((interaction) => ({
48
+ ...interaction,
49
+ resolutionType: 'heuristic',
50
+ confidence: 'low',
51
+ }));
52
+ }
53
+ // fallbackHeuristics: false — return the empty AST result verbatim
54
+ return astResults;
55
+ }
56
+ // null = parse error or no analyzer registered for this language.
57
+ // Fall through to Tier 3 so the file is still analysed.
58
+ }
59
+ // ── Tier 3: regex fallback ────────────────────────────────────────────────
60
+ // Only reached when AST is disabled or could not parse the file.
61
+ if (!deepConfig.enabled)
62
+ return [];
63
+ const regexLang = language === 'auto' ? 'typescript' : language;
64
+ return (0, deepEndpointResolver_1.deepResolveFile)(content, filePath, regexLang, deepConfig);
65
+ }
66
+ /**
67
+ * Bootstrap function — import all language analyzer modules so they
68
+ * register themselves in the parser registry. Must be called once at
69
+ * CLI/library startup before any `analyzeFile()` call.
70
+ */
71
+ function registerAllAnalyzers() {
72
+ try {
73
+ require('../languages/javascript/index');
74
+ }
75
+ catch { /* not available */ }
76
+ try {
77
+ require('../languages/typescript/index');
78
+ }
79
+ catch { /* not available */ }
80
+ try {
81
+ require('../languages/java/index');
82
+ }
83
+ catch { /* not available */ }
84
+ try {
85
+ require('../languages/kotlin/index');
86
+ }
87
+ catch { /* not available */ }
88
+ try {
89
+ require('../languages/python/index');
90
+ }
91
+ catch { /* not available */ }
92
+ try {
93
+ require('../languages/ruby/index');
94
+ }
95
+ catch { /* not available */ }
96
+ }
97
+ /**
98
+ * Build a default AnalysisContext from partial config.
99
+ * Useful for call sites that don't yet pass a full context.
100
+ */
101
+ function buildAnalysisContext(astConfig,
102
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
103
+ deepConfig) {
104
+ return {
105
+ astConfig: {
106
+ enabled: true,
107
+ fallbackHeuristics: true,
108
+ maxCallDepth: 4,
109
+ assertionAware: true,
110
+ languages: {
111
+ java: { enabled: true },
112
+ kotlin: { enabled: true },
113
+ python: { enabled: true },
114
+ ruby: { enabled: true },
115
+ javascript: { enabled: true },
116
+ typescript: { enabled: true },
117
+ cucumber: { enabled: true },
118
+ },
119
+ ...astConfig,
120
+ },
121
+ deepConfig: deepConfig !== null && deepConfig !== void 0 ? deepConfig : types_1.DEFAULT_DEEP_ANALYSIS_CONFIG,
122
+ };
123
+ }
@@ -0,0 +1,105 @@
1
+ /**
2
+ * AST-layer canonical types.
3
+ *
4
+ * These types define the normalized representation produced by language-specific
5
+ * parsers and consumed by the coverage engine. They are a strict superset of the
6
+ * deep-analysis layer types so all existing consumers continue to work unmodified.
7
+ */
8
+ import type { ResolutionType, ConfidenceLevel, ResolvedHttpCall, DeepAnalysisConfig } from '../coverage/deep-analysis/types';
9
+ import type { AstAnalysisConfig } from '../config/types';
10
+ export type { ResolutionType, ConfidenceLevel };
11
+ export type SupportedLanguage = 'typescript' | 'javascript' | 'java' | 'kotlin' | 'python' | 'ruby' | 'cucumber' | 'auto';
12
+ export type AssertionType = 'status-code' | 'body-field' | 'fluent-chain' | 'exception-catch' | 'none';
13
+ export interface BusinessRuleRef {
14
+ ruleId: string;
15
+ source: 'annotation' | 'decorator' | 'comment' | 'tag';
16
+ line?: number;
17
+ }
18
+ export interface FlowRef {
19
+ flowId: string;
20
+ source: 'tag' | 'comment' | 'annotation';
21
+ line?: number;
22
+ }
23
+ export interface SemanticSymbol {
24
+ name: string;
25
+ kind: 'const' | 'let' | 'var' | 'parameter' | 'field' | 'enum-member';
26
+ /** Value as written in source (may reference another symbol) */
27
+ value?: string;
28
+ /** Value after constant propagation */
29
+ resolvedValue?: string;
30
+ line?: number;
31
+ }
32
+ export interface SemanticHttpCall {
33
+ method: string;
34
+ /** Path argument as written in source — may be a variable name */
35
+ rawPathArg: string;
36
+ /** After constant/template resolution */
37
+ resolvedPath?: string;
38
+ /** After normalization to OpenAPI template form */
39
+ normalizedPath?: string;
40
+ resolutionType: ResolutionType;
41
+ confidence: ConfidenceLevel;
42
+ /** Variable name the response is assigned to, for assertion linking */
43
+ responseVariable?: string;
44
+ line?: number;
45
+ }
46
+ export interface SemanticAssertion {
47
+ assertionType: AssertionType;
48
+ /** Subject variable e.g. "response" in expect(response) */
49
+ subjectVariable?: string;
50
+ line?: number;
51
+ }
52
+ export interface SemanticFunction {
53
+ name: string;
54
+ parameters: string[];
55
+ bodyHttpCalls: SemanticHttpCall[];
56
+ calledFunctions: string[];
57
+ returnValue?: string;
58
+ /** Java/Python/TS/Kotlin decorator or annotation names */
59
+ annotations?: string[];
60
+ /** For Cucumber step definitions — the Gherkin pattern string */
61
+ cucumberPattern?: string;
62
+ }
63
+ export interface ParsedSourceFile {
64
+ filePath: string;
65
+ language: SupportedLanguage;
66
+ /** Raw AST node from the parser — shape differs per backend */
67
+ ast: any;
68
+ content: string;
69
+ parseError?: Error;
70
+ }
71
+ export interface SemanticModel {
72
+ filePath: string;
73
+ language: SupportedLanguage;
74
+ /** Per-file constants and variables keyed by their identifier name */
75
+ localVariables: Map<string, SemanticSymbol>;
76
+ constants: Map<string, SemanticSymbol>;
77
+ /** enumName → (memberName → value) */
78
+ enums: Map<string, Map<string, string>>;
79
+ /** functionName → definition */
80
+ functions: Map<string, SemanticFunction>;
81
+ /** HTTP interactions found directly in the file body (outside functions) */
82
+ httpInteractions: SemanticHttpCall[];
83
+ assertions: SemanticAssertion[];
84
+ businessRuleRefs: BusinessRuleRef[];
85
+ flowRefs: FlowRef[];
86
+ }
87
+ export interface ResolvedHttpInteraction extends ResolvedHttpCall {
88
+ assertionType?: AssertionType;
89
+ businessRuleRefs?: BusinessRuleRef[];
90
+ flowRefs?: FlowRef[];
91
+ /** Semantic parameter-test scenarios detected from builder patterns, etc. */
92
+ parameterScenarios?: string[];
93
+ /** Feature file path when resolutionType is 'cucumber-step' */
94
+ cucumberFeatureFile?: string;
95
+ /** Scenario name when resolutionType is 'cucumber-step' */
96
+ cucumberScenario?: string;
97
+ /** Response variable name for assertion linking (internal — not serialized to reports) */
98
+ responseVariable?: string;
99
+ }
100
+ export interface AnalysisContext {
101
+ deepConfig: DeepAnalysisConfig;
102
+ astConfig: AstAnalysisConfig;
103
+ projectRoot?: string;
104
+ }
105
+ //# sourceMappingURL=astTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astTypes.d.ts","sourceRoot":"","sources":["../../../src/ast/astTypes.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * AST-layer canonical types.
4
+ *
5
+ * These types define the normalized representation produced by language-specific
6
+ * parsers and consumed by the coverage engine. They are a strict superset of the
7
+ * deep-analysis layer types so all existing consumers continue to work unmodified.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,46 @@
1
+ /**
2
+ * LanguageAnalyzer contract.
3
+ *
4
+ * Every supported language must implement this interface, either directly or
5
+ * through layered composition. The interface is intentionally minimal — each
6
+ * method is pure (no side effects) and returns well-typed data.
7
+ */
8
+ import type { SupportedLanguage, ParsedSourceFile, SemanticModel, ResolvedHttpInteraction, SemanticAssertion, BusinessRuleRef, FlowRef, AnalysisContext } from './astTypes';
9
+ export interface LanguageAnalyzer {
10
+ readonly language: SupportedLanguage;
11
+ /**
12
+ * Parse a source file to a raw AST.
13
+ *
14
+ * Must never throw. Returns a `ParsedSourceFile` with `parseError` set if
15
+ * parsing fails — the orchestrator will fall back to regex analysis.
16
+ */
17
+ parse(filePath: string, content: string): ParsedSourceFile;
18
+ /**
19
+ * Walk the AST and produce a rich semantic model: symbols, call graph,
20
+ * enum values, HTTP call sites, assertion nodes.
21
+ */
22
+ buildSemanticModel(parsed: ParsedSourceFile, context: AnalysisContext): SemanticModel;
23
+ /**
24
+ * Extract fully-resolved HTTP interactions from the semantic model.
25
+ * Resolution includes constant propagation, wrapper tracing, and template
26
+ * literal expansion up to `context.astConfig.maxCallDepth` levels.
27
+ */
28
+ extractHttpInteractions(model: SemanticModel, context: AnalysisContext): ResolvedHttpInteraction[];
29
+ /**
30
+ * Extract assertion nodes from the semantic model.
31
+ * Used by the orchestrator to link assertions to HTTP interactions by
32
+ * matching `assertion.subjectVariable` against `interaction.responseVariable`.
33
+ */
34
+ extractAssertions(model: SemanticModel): SemanticAssertion[];
35
+ /**
36
+ * Extract business rule references from annotations, decorators, tags,
37
+ * or structured comments. Optional — only implement if the language supports it.
38
+ */
39
+ extractBusinessRuleRefs?(model: SemanticModel): BusinessRuleRef[];
40
+ /**
41
+ * Extract integration flow references from annotations, tags, or comments.
42
+ * Optional — only implement if the language supports it.
43
+ */
44
+ extractFlowRefs?(model: SemanticModel): FlowRef[];
45
+ }
46
+ //# sourceMappingURL=languageAnalyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languageAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/ast/languageAnalyzer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,OAAO,EACP,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IAErC;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAE3D;;;OAGG;IACH,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,GAAG,aAAa,CAAC;IAEtF;;;;OAIG;IACH,uBAAuB,CACrB,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,eAAe,GACvB,uBAAuB,EAAE,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,iBAAiB,EAAE,CAAC;IAE7D;;;OAGG;IACH,uBAAuB,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,eAAe,EAAE,CAAC;IAElE;;;OAGG;IACH,eAAe,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,EAAE,CAAC;CACnD"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * LanguageAnalyzer contract.
4
+ *
5
+ * Every supported language must implement this interface, either directly or
6
+ * through layered composition. The interface is intentionally minimal — each
7
+ * method is pure (no side effects) and returns well-typed data.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ /**
2
+ * AST-layer language capability registry.
3
+ *
4
+ * Describes what each language analyzer can do and which parser backend it uses.
5
+ * Used by the orchestrator to decide whether to attempt AST analysis for a given
6
+ * language and whether to expect assertion linking, enum resolution, etc.
7
+ */
8
+ import type { SupportedLanguage } from './astTypes';
9
+ export type ParserBackend = 'typescript-estree' | 'tree-sitter' | 'regex-fallback';
10
+ export interface LanguageCapabilities {
11
+ language: SupportedLanguage;
12
+ parserBackend: ParserBackend;
13
+ supportsSymbolResolution: boolean;
14
+ supportsCallGraph: boolean;
15
+ supportsEnumResolution: boolean;
16
+ supportsStringInterpolation: boolean;
17
+ supportsAssertionLinking: boolean;
18
+ supportsRequestBuilders: boolean;
19
+ supportsCucumber: boolean;
20
+ /** Which step-definition languages this analyzer can trace (Cucumber only) */
21
+ cucumberStepLanguages?: SupportedLanguage[];
22
+ }
23
+ export declare const LANGUAGE_CAPABILITIES: Record<string, LanguageCapabilities>;
24
+ //# sourceMappingURL=languageCapabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languageCapabilities.d.ts","sourceRoot":"","sources":["../../../src/ast/languageCapabilities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEnF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,aAAa,EAAE,aAAa,CAAC;IAC7B,wBAAwB,EAAE,OAAO,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,sBAAsB,EAAE,OAAO,CAAC;IAChC,2BAA2B,EAAE,OAAO,CAAC;IACrC,wBAAwB,EAAE,OAAO,CAAC;IAClC,uBAAuB,EAAE,OAAO,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,8EAA8E;IAC9E,qBAAqB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC7C;AAED,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAiFtE,CAAC"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ /**
3
+ * AST-layer language capability registry.
4
+ *
5
+ * Describes what each language analyzer can do and which parser backend it uses.
6
+ * Used by the orchestrator to decide whether to attempt AST analysis for a given
7
+ * language and whether to expect assertion linking, enum resolution, etc.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.LANGUAGE_CAPABILITIES = void 0;
11
+ exports.LANGUAGE_CAPABILITIES = {
12
+ typescript: {
13
+ language: 'typescript',
14
+ parserBackend: 'typescript-estree',
15
+ supportsSymbolResolution: true,
16
+ supportsCallGraph: true,
17
+ supportsEnumResolution: true,
18
+ supportsStringInterpolation: true,
19
+ supportsAssertionLinking: true,
20
+ supportsRequestBuilders: true,
21
+ supportsCucumber: false,
22
+ },
23
+ javascript: {
24
+ language: 'javascript',
25
+ parserBackend: 'typescript-estree',
26
+ supportsSymbolResolution: true,
27
+ supportsCallGraph: true,
28
+ supportsEnumResolution: false,
29
+ supportsStringInterpolation: true,
30
+ supportsAssertionLinking: true,
31
+ supportsRequestBuilders: true,
32
+ supportsCucumber: false,
33
+ },
34
+ java: {
35
+ language: 'java',
36
+ parserBackend: 'tree-sitter',
37
+ supportsSymbolResolution: true,
38
+ supportsCallGraph: true,
39
+ supportsEnumResolution: true,
40
+ supportsStringInterpolation: false,
41
+ supportsAssertionLinking: true,
42
+ supportsRequestBuilders: true,
43
+ supportsCucumber: true,
44
+ cucumberStepLanguages: ['java'],
45
+ },
46
+ kotlin: {
47
+ language: 'kotlin',
48
+ parserBackend: 'tree-sitter',
49
+ supportsSymbolResolution: true,
50
+ supportsCallGraph: true,
51
+ supportsEnumResolution: true,
52
+ supportsStringInterpolation: true,
53
+ supportsAssertionLinking: true,
54
+ supportsRequestBuilders: true,
55
+ supportsCucumber: true,
56
+ cucumberStepLanguages: ['kotlin'],
57
+ },
58
+ python: {
59
+ language: 'python',
60
+ parserBackend: 'tree-sitter',
61
+ supportsSymbolResolution: true,
62
+ supportsCallGraph: true,
63
+ supportsEnumResolution: true,
64
+ supportsStringInterpolation: true,
65
+ supportsAssertionLinking: true,
66
+ supportsRequestBuilders: false,
67
+ supportsCucumber: false,
68
+ },
69
+ ruby: {
70
+ language: 'ruby',
71
+ parserBackend: 'tree-sitter',
72
+ supportsSymbolResolution: true,
73
+ supportsCallGraph: true,
74
+ supportsEnumResolution: false,
75
+ supportsStringInterpolation: true,
76
+ supportsAssertionLinking: true,
77
+ supportsRequestBuilders: false,
78
+ supportsCucumber: true,
79
+ cucumberStepLanguages: ['ruby'],
80
+ },
81
+ cucumber: {
82
+ language: 'cucumber',
83
+ parserBackend: 'regex-fallback',
84
+ supportsSymbolResolution: false,
85
+ supportsCallGraph: false,
86
+ supportsEnumResolution: false,
87
+ supportsStringInterpolation: false,
88
+ supportsAssertionLinking: false,
89
+ supportsRequestBuilders: false,
90
+ supportsCucumber: true,
91
+ },
92
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Per-file AST analysis entry point.
3
+ *
4
+ * Attempts to parse and analyze a single source file using the registered
5
+ * LanguageAnalyzer for its language. Links assertions to HTTP interactions.
6
+ * Returns null when no analyzer is available or when parsing fails — the
7
+ * caller (astAnalysisOrchestrator) then falls back to regex analysis.
8
+ */
9
+ import type { SupportedLanguage, ResolvedHttpInteraction, AnalysisContext } from './astTypes';
10
+ /**
11
+ * Parse and semantically analyze a single source file using the AST layer.
12
+ *
13
+ * @returns `ResolvedHttpInteraction[]` on success, `null` to signal fallback.
14
+ */
15
+ export declare function analyzeFileWithAst(filePath: string, content: string, language: SupportedLanguage, context: AnalysisContext): ResolvedHttpInteraction[] | null;
16
+ //# sourceMappingURL=parseFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseFile.d.ts","sourceRoot":"","sources":["../../../src/ast/parseFile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE9F;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,EAAE,eAAe,GACvB,uBAAuB,EAAE,GAAG,IAAI,CAoDlC"}