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,14 @@
1
+ /**
2
+ * JavaScript/TypeScript AST parser.
3
+ *
4
+ * Uses @typescript-eslint/typescript-estree which handles both JS and TS
5
+ * files using the TypeScript compiler's parser in tolerant mode.
6
+ */
7
+ import type { ParsedSourceFile, SupportedLanguage } from '../../ast/astTypes';
8
+ /**
9
+ * Parse a JS or TS source file using @typescript-eslint/typescript-estree.
10
+ *
11
+ * Never throws. Sets `parseError` if parsing fails so the caller can fall back.
12
+ */
13
+ export declare function parseJsTs(filePath: string, content: string, language?: SupportedLanguage): ParsedSourceFile;
14
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/languages/javascript/parser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE9E;;;;GAIG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,iBAAgC,GACzC,gBAAgB,CAsBlB"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ * JavaScript/TypeScript AST parser.
4
+ *
5
+ * Uses @typescript-eslint/typescript-estree which handles both JS and TS
6
+ * files using the TypeScript compiler's parser in tolerant mode.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.parseJsTs = parseJsTs;
10
+ /**
11
+ * Parse a JS or TS source file using @typescript-eslint/typescript-estree.
12
+ *
13
+ * Never throws. Sets `parseError` if parsing fails so the caller can fall back.
14
+ */
15
+ function parseJsTs(filePath, content, language = 'typescript') {
16
+ try {
17
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
18
+ const { parse } = require('@typescript-eslint/typescript-estree');
19
+ const ast = parse(content, {
20
+ jsx: filePath.endsWith('.jsx') || filePath.endsWith('.tsx'),
21
+ range: true,
22
+ loc: true,
23
+ // tolerant: do not throw on recoverable syntax errors in test files
24
+ errorOnUnknownASTType: false,
25
+ allowInvalidAST: true,
26
+ });
27
+ return { filePath, language, ast, content };
28
+ }
29
+ catch (err) {
30
+ return {
31
+ filePath,
32
+ language,
33
+ ast: null,
34
+ content,
35
+ parseError: err instanceof Error ? err : new Error(String(err)),
36
+ };
37
+ }
38
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * JavaScript/TypeScript symbol resolver.
3
+ *
4
+ * Walks a @typescript-eslint/typescript-estree AST and extracts:
5
+ * - top-level const/let/var declarations with string literal values
6
+ * - TypeScript enum declarations with string member values
7
+ * - object property constants: const Routes = { USERS: '/users' }
8
+ *
9
+ * The extracted symbols are stored in a flat map keyed by identifier name
10
+ * (for simple constants) or "Object.MEMBER" notation (for object properties
11
+ * and enum members) so that call-site references like `Routes.USERS` resolve.
12
+ */
13
+ import type { SemanticSymbol } from '../../ast/astTypes';
14
+ type AstNode = any;
15
+ /**
16
+ * Extract all statically-known string symbols from the AST.
17
+ * Returns two maps:
18
+ * constants — module-level named constants
19
+ * localVariables — function-scoped variables (populated per-function by callResolver)
20
+ */
21
+ export declare function extractSymbols(ast: AstNode): {
22
+ constants: Map<string, SemanticSymbol>;
23
+ localVariables: Map<string, SemanticSymbol>;
24
+ };
25
+ /**
26
+ * Resolve a token (variable name or dotted path) against a symbol map.
27
+ * e.g. "Routes.USERS" → "/users"
28
+ */
29
+ export declare function resolveSymbol(token: string, constants: Map<string, SemanticSymbol>, localVars?: Map<string, SemanticSymbol>): string | undefined;
30
+ export {};
31
+ //# sourceMappingURL=symbolResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbolResolver.d.ts","sourceRoot":"","sources":["../../../../src/languages/javascript/symbolResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,KAAK,OAAO,GAAG,GAAG,CAAC;AAEnB;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG;IAC5C,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACvC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC7C,CAWA;AA8JD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,EACtC,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,GACtC,MAAM,GAAG,SAAS,CAQpB"}
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+ /**
3
+ * JavaScript/TypeScript symbol resolver.
4
+ *
5
+ * Walks a @typescript-eslint/typescript-estree AST and extracts:
6
+ * - top-level const/let/var declarations with string literal values
7
+ * - TypeScript enum declarations with string member values
8
+ * - object property constants: const Routes = { USERS: '/users' }
9
+ *
10
+ * The extracted symbols are stored in a flat map keyed by identifier name
11
+ * (for simple constants) or "Object.MEMBER" notation (for object properties
12
+ * and enum members) so that call-site references like `Routes.USERS` resolve.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.extractSymbols = extractSymbols;
16
+ exports.resolveSymbol = resolveSymbol;
17
+ /**
18
+ * Extract all statically-known string symbols from the AST.
19
+ * Returns two maps:
20
+ * constants — module-level named constants
21
+ * localVariables — function-scoped variables (populated per-function by callResolver)
22
+ */
23
+ function extractSymbols(ast) {
24
+ const constants = new Map();
25
+ const localVariables = new Map();
26
+ if (!ast || !ast.body)
27
+ return { constants, localVariables };
28
+ for (const node of ast.body) {
29
+ visitTopLevelNode(node, constants);
30
+ }
31
+ return { constants, localVariables };
32
+ }
33
+ function visitTopLevelNode(node, map) {
34
+ var _a, _b, _c;
35
+ if (!node)
36
+ return;
37
+ switch (node.type) {
38
+ case 'VariableDeclaration':
39
+ for (const decl of (_a = node.declarations) !== null && _a !== void 0 ? _a : []) {
40
+ extractVariableDecl(decl, (_b = node.kind) !== null && _b !== void 0 ? _b : 'var', map);
41
+ }
42
+ break;
43
+ case 'ExportNamedDeclaration':
44
+ if (node.declaration)
45
+ visitTopLevelNode(node.declaration, map);
46
+ break;
47
+ case 'TSEnumDeclaration':
48
+ extractTsEnum(node, map);
49
+ break;
50
+ case 'ExpressionStatement':
51
+ // module.exports = { ... }
52
+ if (((_c = node.expression) === null || _c === void 0 ? void 0 : _c.type) === 'AssignmentExpression') {
53
+ extractModuleExports(node.expression, map);
54
+ }
55
+ break;
56
+ }
57
+ }
58
+ function extractVariableDecl(decl, kind, map) {
59
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
60
+ if (!(decl === null || decl === void 0 ? void 0 : decl.id) || !decl.init)
61
+ return;
62
+ const name = decl.id.name;
63
+ if (!name)
64
+ return;
65
+ const line = (_b = (_a = decl.id.loc) === null || _a === void 0 ? void 0 : _a.start) === null || _b === void 0 ? void 0 : _b.line;
66
+ // Simple string: const USERS = '/users'
67
+ if (decl.init.type === 'Literal' && typeof decl.init.value === 'string') {
68
+ map.set(name, {
69
+ name,
70
+ kind: kind,
71
+ value: decl.init.value,
72
+ resolvedValue: decl.init.value,
73
+ line,
74
+ });
75
+ return;
76
+ }
77
+ // Template literal with no expressions: const USERS = `/users`
78
+ if (decl.init.type === 'TemplateLiteral' &&
79
+ ((_c = decl.init.expressions) === null || _c === void 0 ? void 0 : _c.length) === 0 &&
80
+ ((_d = decl.init.quasis) === null || _d === void 0 ? void 0 : _d.length) === 1) {
81
+ const raw = (_k = (_g = (_f = (_e = decl.init.quasis[0]) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.cooked) !== null && _g !== void 0 ? _g : (_j = (_h = decl.init.quasis[0]) === null || _h === void 0 ? void 0 : _h.value) === null || _j === void 0 ? void 0 : _j.raw) !== null && _k !== void 0 ? _k : '';
82
+ map.set(name, { name, kind: kind, value: raw, resolvedValue: raw, line });
83
+ return;
84
+ }
85
+ // Object literal with string properties: const Routes = { USERS: '/users' }
86
+ if (decl.init.type === 'ObjectExpression') {
87
+ extractObjectProps(name, decl.init, kind, map);
88
+ return;
89
+ }
90
+ // "as const" satisfies pattern: treat the inner value
91
+ if (decl.init.type === 'TSAsExpression' || decl.init.type === 'TSSatisfiesExpression') {
92
+ const inner = { ...decl, init: decl.init.expression };
93
+ extractVariableDecl(inner, kind, map);
94
+ return;
95
+ }
96
+ }
97
+ function extractObjectProps(prefix, objNode, kind, map) {
98
+ var _a, _b, _c, _d, _e, _f, _g, _h;
99
+ for (const prop of (_a = objNode.properties) !== null && _a !== void 0 ? _a : []) {
100
+ if (prop.type !== 'Property' && prop.type !== 'ObjectProperty')
101
+ continue;
102
+ const keyName = (_c = (_b = prop.key) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : (_d = prop.key) === null || _d === void 0 ? void 0 : _d.value;
103
+ if (!keyName)
104
+ continue;
105
+ const fullName = `${prefix}.${keyName}`;
106
+ const line = (_f = (_e = prop.loc) === null || _e === void 0 ? void 0 : _e.start) === null || _f === void 0 ? void 0 : _f.line;
107
+ if (((_g = prop.value) === null || _g === void 0 ? void 0 : _g.type) === 'Literal' && typeof prop.value.value === 'string') {
108
+ map.set(fullName, {
109
+ name: fullName,
110
+ kind: 'const',
111
+ value: prop.value.value,
112
+ resolvedValue: prop.value.value,
113
+ line,
114
+ });
115
+ }
116
+ else if (((_h = prop.value) === null || _h === void 0 ? void 0 : _h.type) === 'ObjectExpression') {
117
+ // Nested objects: const Routes = { USER: { LIST: '/users' } }
118
+ extractObjectProps(fullName, prop.value, kind, map);
119
+ }
120
+ }
121
+ }
122
+ function extractTsEnum(node, map) {
123
+ var _a, _b, _c, _d, _e, _f, _g, _h;
124
+ const enumName = (_a = node.id) === null || _a === void 0 ? void 0 : _a.name;
125
+ if (!enumName)
126
+ return;
127
+ for (const member of (_b = node.members) !== null && _b !== void 0 ? _b : []) {
128
+ const memberName = (_d = (_c = member.id) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : (_e = member.id) === null || _e === void 0 ? void 0 : _e.value;
129
+ if (!memberName)
130
+ continue;
131
+ const fullName = `${enumName}.${memberName}`;
132
+ const line = (_g = (_f = member.loc) === null || _f === void 0 ? void 0 : _f.start) === null || _g === void 0 ? void 0 : _g.line;
133
+ if (((_h = member.initializer) === null || _h === void 0 ? void 0 : _h.type) === 'Literal' && typeof member.initializer.value === 'string') {
134
+ map.set(fullName, {
135
+ name: fullName,
136
+ kind: 'enum-member',
137
+ value: member.initializer.value,
138
+ resolvedValue: member.initializer.value,
139
+ line,
140
+ });
141
+ }
142
+ }
143
+ }
144
+ function extractModuleExports(assign, map) {
145
+ var _a, _b, _c, _d, _e, _f, _g;
146
+ // module.exports = { USERS: '/users' }
147
+ const left = assign.left;
148
+ const right = assign.right;
149
+ if (((_a = left === null || left === void 0 ? void 0 : left.object) === null || _a === void 0 ? void 0 : _a.name) === 'module' &&
150
+ ((_b = left === null || left === void 0 ? void 0 : left.property) === null || _b === void 0 ? void 0 : _b.name) === 'exports' &&
151
+ (right === null || right === void 0 ? void 0 : right.type) === 'ObjectExpression') {
152
+ extractObjectProps('exports', right, 'const', map);
153
+ // Also index without prefix for default patterns
154
+ for (const prop of (_c = right.properties) !== null && _c !== void 0 ? _c : []) {
155
+ if (prop.type !== 'Property')
156
+ continue;
157
+ const keyName = (_e = (_d = prop.key) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : (_f = prop.key) === null || _f === void 0 ? void 0 : _f.value;
158
+ if (!keyName)
159
+ continue;
160
+ if (((_g = prop.value) === null || _g === void 0 ? void 0 : _g.type) === 'Literal' && typeof prop.value.value === 'string') {
161
+ map.set(keyName, {
162
+ name: keyName,
163
+ kind: 'const',
164
+ value: prop.value.value,
165
+ resolvedValue: prop.value.value,
166
+ });
167
+ }
168
+ }
169
+ }
170
+ }
171
+ /**
172
+ * Resolve a token (variable name or dotted path) against a symbol map.
173
+ * e.g. "Routes.USERS" → "/users"
174
+ */
175
+ function resolveSymbol(token, constants, localVars) {
176
+ const local = localVars === null || localVars === void 0 ? void 0 : localVars.get(token);
177
+ if ((local === null || local === void 0 ? void 0 : local.resolvedValue) !== undefined)
178
+ return local.resolvedValue;
179
+ const sym = constants.get(token);
180
+ if ((sym === null || sym === void 0 ? void 0 : sym.resolvedValue) !== undefined)
181
+ return sym.resolvedValue;
182
+ return undefined;
183
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Kotlin language analyzer.
3
+ * Reuses Java semantic builder logic since Kotlin syntax is similar for HTTP patterns.
4
+ */
5
+ import type { LanguageAnalyzer } from '../../ast/languageAnalyzer';
6
+ import type { SupportedLanguage, ParsedSourceFile, SemanticModel, ResolvedHttpInteraction, SemanticAssertion, BusinessRuleRef, FlowRef, AnalysisContext } from '../../ast/astTypes';
7
+ export declare class KotlinAnalyzer implements LanguageAnalyzer {
8
+ readonly language: SupportedLanguage;
9
+ parse(filePath: string, content: string): ParsedSourceFile;
10
+ buildSemanticModel(parsed: ParsedSourceFile, _context: AnalysisContext): SemanticModel;
11
+ extractHttpInteractions(model: SemanticModel, _context: AnalysisContext): ResolvedHttpInteraction[];
12
+ extractAssertions(model: SemanticModel): SemanticAssertion[];
13
+ extractBusinessRuleRefs(model: SemanticModel): BusinessRuleRef[];
14
+ extractFlowRefs(model: SemanticModel): FlowRef[];
15
+ }
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/languages/kotlin/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,OAAO,EACP,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAmB5B,qBAAa,cAAe,YAAW,gBAAgB;IACrD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAY;IAEhD,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAI1D,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,eAAe,GAAG,aAAa;IAqCtF,uBAAuB,CACrB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,eAAe,GACxB,uBAAuB,EAAE;IA2B5B,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,iBAAiB,EAAE;IAG5D,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,eAAe,EAAE;IAGhE,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,EAAE;CAGjD"}
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ /**
3
+ * Kotlin language analyzer.
4
+ * Reuses Java semantic builder logic since Kotlin syntax is similar for HTTP patterns.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.KotlinAnalyzer = void 0;
8
+ const parserRegistry_1 = require("../../ast/parserRegistry");
9
+ const parser_1 = require("./parser");
10
+ const semanticBuilder_1 = require("../java/semanticBuilder");
11
+ const treeSitterUtils_1 = require("../shared/treeSitterUtils");
12
+ const resolvePaths_1 = require("../../coverage/deep-analysis/resolvePaths");
13
+ class KotlinAnalyzer {
14
+ constructor() {
15
+ this.language = 'kotlin';
16
+ }
17
+ parse(filePath, content) {
18
+ return (0, parser_1.parseKotlin)(filePath, content);
19
+ }
20
+ buildSemanticModel(parsed, _context) {
21
+ var _a, _b, _c;
22
+ const astPayload = parsed.ast;
23
+ const root = (_c = (_b = (_a = astPayload === null || astPayload === void 0 ? void 0 : astPayload.tree) === null || _a === void 0 ? void 0 : _a.rootNode) !== null && _b !== void 0 ? _b : astPayload === null || astPayload === void 0 ? void 0 : astPayload.rootNode) !== null && _c !== void 0 ? _c : astPayload;
24
+ if (!root) {
25
+ return emptyModel(parsed.filePath, 'kotlin');
26
+ }
27
+ // Use Java semantic builder as base (reuses tree-sitter traversal)
28
+ const { constants, enums } = (0, semanticBuilder_1.extractJavaSymbols)(root);
29
+ // Augment with Kotlin-specific: val/var top-level properties
30
+ extractKotlinProperties(root, constants);
31
+ const functions = (0, semanticBuilder_1.extractJavaFunctions)(root, constants);
32
+ // Add Ktor-specific HTTP calls
33
+ augmentWithKtorCalls(root, constants, functions);
34
+ const assertions = (0, semanticBuilder_1.extractJavaAssertions)(root);
35
+ const businessRuleRefs = (0, semanticBuilder_1.extractJavaBusinessRuleRefs)(root);
36
+ const flowRefs = (0, semanticBuilder_1.extractJavaFlowRefs)(root);
37
+ return {
38
+ filePath: parsed.filePath,
39
+ language: 'kotlin',
40
+ localVariables: new Map(),
41
+ constants,
42
+ enums,
43
+ functions,
44
+ httpInteractions: [],
45
+ assertions,
46
+ businessRuleRefs,
47
+ flowRefs,
48
+ };
49
+ }
50
+ extractHttpInteractions(model, _context) {
51
+ var _a;
52
+ const results = [];
53
+ const seen = new Set();
54
+ for (const fn of model.functions.values()) {
55
+ for (const c of fn.bodyHttpCalls) {
56
+ const path = (_a = c.resolvedPath) !== null && _a !== void 0 ? _a : c.rawPathArg;
57
+ if (!path)
58
+ continue;
59
+ const key = `${c.method}:${path}`;
60
+ if (seen.has(key))
61
+ continue;
62
+ seen.add(key);
63
+ const normalizedPath = path.startsWith('/') ? (0, resolvePaths_1.normalizePathToTemplate)(path) : undefined;
64
+ results.push({
65
+ method: c.method,
66
+ path,
67
+ normalizedPath,
68
+ sourceFile: model.filePath,
69
+ sourceLanguage: 'kotlin',
70
+ resolutionType: c.resolutionType,
71
+ confidence: c.confidence,
72
+ });
73
+ }
74
+ }
75
+ return results;
76
+ }
77
+ extractAssertions(model) {
78
+ return model.assertions;
79
+ }
80
+ extractBusinessRuleRefs(model) {
81
+ return model.businessRuleRefs;
82
+ }
83
+ extractFlowRefs(model) {
84
+ return model.flowRefs;
85
+ }
86
+ }
87
+ exports.KotlinAnalyzer = KotlinAnalyzer;
88
+ /** Extract Kotlin val/var property declarations */
89
+ function extractKotlinProperties(root, constants) {
90
+ var _a, _b, _c;
91
+ // Kotlin tree-sitter uses property_declaration
92
+ const propDecls = (0, treeSitterUtils_1.findNodes)(root, ['property_declaration']);
93
+ for (const prop of propDecls) {
94
+ const nameNode = (_a = (0, treeSitterUtils_1.firstChildOfType)(prop, 'simple_identifier')) !== null && _a !== void 0 ? _a : (0, treeSitterUtils_1.firstChildOfType)(prop, 'identifier');
95
+ const valueNode = (0, treeSitterUtils_1.firstChildOfType)(prop, 'string_literal');
96
+ if (nameNode && valueNode) {
97
+ const name = (_b = nameNode.text) !== null && _b !== void 0 ? _b : '';
98
+ const value = (_c = (0, treeSitterUtils_1.extractStringValue)(valueNode)) !== null && _c !== void 0 ? _c : '';
99
+ if (name && value.startsWith('/')) {
100
+ constants.set(name, { name, kind: 'const', value, resolvedValue: value });
101
+ }
102
+ }
103
+ }
104
+ }
105
+ /** Detect Ktor client DSL: client.get("/path") { ... } */
106
+ function augmentWithKtorCalls(root, constants, functions) {
107
+ var _a, _b;
108
+ // Ktor uses call_expression with method name get/post/put etc.
109
+ const callExprs = (0, treeSitterUtils_1.findNodes)(root, ['call_expression', 'function_call']);
110
+ for (const call of callExprs) {
111
+ const callText = (_a = call.text) !== null && _a !== void 0 ? _a : '';
112
+ // Heuristic: detect client.METHOD("/path")
113
+ const ktorMatch = callText.match(/(?:client|httpClient)\.(get|post|put|patch|delete)\s*[\({]\s*["'`]([^"'`]+)["'`]/);
114
+ if (ktorMatch) {
115
+ const [, method, path] = ktorMatch;
116
+ const fakeCall = {
117
+ method: method.toUpperCase(),
118
+ rawPathArg: path,
119
+ resolvedPath: path,
120
+ normalizedPath: path.startsWith('/') ? (0, resolvePaths_1.normalizePathToTemplate)(path) : undefined,
121
+ resolutionType: 'direct',
122
+ confidence: 'high',
123
+ };
124
+ // Attach to a synthetic function
125
+ const syntheticFn = (_b = functions.get('_kotlin_ktor_calls')) !== null && _b !== void 0 ? _b : {
126
+ name: '_kotlin_ktor_calls',
127
+ parameters: [],
128
+ bodyHttpCalls: [],
129
+ calledFunctions: [],
130
+ };
131
+ syntheticFn.bodyHttpCalls.push(fakeCall);
132
+ functions.set('_kotlin_ktor_calls', syntheticFn);
133
+ }
134
+ void constants; // suppress unused warning
135
+ }
136
+ }
137
+ function emptyModel(filePath, language) {
138
+ return {
139
+ filePath,
140
+ language,
141
+ localVariables: new Map(),
142
+ constants: new Map(),
143
+ enums: new Map(),
144
+ functions: new Map(),
145
+ httpInteractions: [],
146
+ assertions: [],
147
+ businessRuleRefs: [],
148
+ flowRefs: [],
149
+ };
150
+ }
151
+ (0, parserRegistry_1.registerAnalyzer)('kotlin', () => new KotlinAnalyzer());
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Kotlin AST parser.
3
+ *
4
+ * Three-tier fallback:
5
+ * 1. tree-sitter-kotlin (if available on npm)
6
+ * 2. tree-sitter-java (approximate — syntax is close enough for basic detection)
7
+ * 3. parse error → orchestrator uses regex fallback
8
+ */
9
+ import type { ParsedSourceFile } from '../../ast/astTypes';
10
+ export declare function parseKotlin(filePath: string, content: string): ParsedSourceFile;
11
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/languages/kotlin/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAoC3D,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CA6B/E"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ /**
3
+ * Kotlin AST parser.
4
+ *
5
+ * Three-tier fallback:
6
+ * 1. tree-sitter-kotlin (if available on npm)
7
+ * 2. tree-sitter-java (approximate — syntax is close enough for basic detection)
8
+ * 3. parse error → orchestrator uses regex fallback
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.parseKotlin = parseKotlin;
12
+ const treeSitterUtils_1 = require("../shared/treeSitterUtils");
13
+ let cachedParser = undefined;
14
+ let parserLoaded = false;
15
+ function getKotlinParser() {
16
+ if (!parserLoaded) {
17
+ parserLoaded = true;
18
+ // Tier 1: tree-sitter-kotlin
19
+ try {
20
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
21
+ const grammar = require('tree-sitter-kotlin');
22
+ const parser = (0, treeSitterUtils_1.createParser)(grammar);
23
+ if (parser) {
24
+ cachedParser = { parser, approximate: false };
25
+ return cachedParser;
26
+ }
27
+ }
28
+ catch { /* not available */ }
29
+ // Tier 2: tree-sitter-java as approximation
30
+ try {
31
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
32
+ const grammar = require('tree-sitter-java');
33
+ const parser = (0, treeSitterUtils_1.createParser)(grammar);
34
+ if (parser) {
35
+ cachedParser = { parser, approximate: true };
36
+ return cachedParser;
37
+ }
38
+ }
39
+ catch { /* not available */ }
40
+ cachedParser = null;
41
+ }
42
+ return cachedParser;
43
+ }
44
+ function parseKotlin(filePath, content) {
45
+ const result = getKotlinParser();
46
+ if (!result) {
47
+ return {
48
+ filePath,
49
+ language: 'kotlin',
50
+ ast: null,
51
+ content,
52
+ parseError: new Error('No Kotlin parser available'),
53
+ };
54
+ }
55
+ try {
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
+ const tree = result.parser.parse(content);
58
+ return {
59
+ filePath,
60
+ language: 'kotlin',
61
+ ast: { tree, approximate: result.approximate },
62
+ content,
63
+ };
64
+ }
65
+ catch (err) {
66
+ return {
67
+ filePath,
68
+ language: 'kotlin',
69
+ ast: null,
70
+ content,
71
+ parseError: err instanceof Error ? err : new Error(String(err)),
72
+ };
73
+ }
74
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Python language analyzer using tree-sitter-python.
3
+ */
4
+ import type { LanguageAnalyzer } from '../../ast/languageAnalyzer';
5
+ import type { SupportedLanguage, ParsedSourceFile, SemanticModel, ResolvedHttpInteraction, SemanticAssertion, BusinessRuleRef, FlowRef, AnalysisContext } from '../../ast/astTypes';
6
+ export declare class PythonAnalyzer implements LanguageAnalyzer {
7
+ readonly language: SupportedLanguage;
8
+ parse(filePath: string, content: string): ParsedSourceFile;
9
+ buildSemanticModel(parsed: ParsedSourceFile, _context: AnalysisContext): SemanticModel;
10
+ extractHttpInteractions(model: SemanticModel, _ctx: AnalysisContext): ResolvedHttpInteraction[];
11
+ extractAssertions(model: SemanticModel): SemanticAssertion[];
12
+ extractBusinessRuleRefs(model: SemanticModel): BusinessRuleRef[];
13
+ extractFlowRefs(_model: SemanticModel): FlowRef[];
14
+ }
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/languages/python/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EAIb,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,OAAO,EACP,eAAe,EAChB,MAAM,oBAAoB,CAAC;AA8B5B,qBAAa,cAAe,YAAW,gBAAgB;IACrD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAY;IAEhD,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAc1D,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,eAAe,GAAG,aAAa;IAuBtF,uBAAuB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,GAAG,uBAAuB,EAAE;IAwB/F,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,iBAAiB,EAAE;IAG5D,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,eAAe,EAAE;IAGhE,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,EAAE;CAGlD"}