driftdetect-core 0.7.1 → 0.8.1

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 (466) hide show
  1. package/dist/boundaries/types.d.ts +1 -1
  2. package/dist/boundaries/types.d.ts.map +1 -1
  3. package/dist/call-graph/analysis/graph-builder.d.ts.map +1 -1
  4. package/dist/call-graph/analysis/graph-builder.js +2 -0
  5. package/dist/call-graph/analysis/graph-builder.js.map +1 -1
  6. package/dist/call-graph/extractors/cpp-data-access-extractor.d.ts +37 -0
  7. package/dist/call-graph/extractors/cpp-data-access-extractor.d.ts.map +1 -0
  8. package/dist/call-graph/extractors/cpp-data-access-extractor.js +467 -0
  9. package/dist/call-graph/extractors/cpp-data-access-extractor.js.map +1 -0
  10. package/dist/call-graph/extractors/cpp-hybrid-extractor.d.ts +89 -0
  11. package/dist/call-graph/extractors/cpp-hybrid-extractor.d.ts.map +1 -0
  12. package/dist/call-graph/extractors/cpp-hybrid-extractor.js +541 -0
  13. package/dist/call-graph/extractors/cpp-hybrid-extractor.js.map +1 -0
  14. package/dist/call-graph/extractors/index.d.ts +8 -1
  15. package/dist/call-graph/extractors/index.d.ts.map +1 -1
  16. package/dist/call-graph/extractors/index.js +9 -1
  17. package/dist/call-graph/extractors/index.js.map +1 -1
  18. package/dist/call-graph/extractors/regex/cpp-regex.d.ts +46 -0
  19. package/dist/call-graph/extractors/regex/cpp-regex.d.ts.map +1 -0
  20. package/dist/call-graph/extractors/regex/cpp-regex.js +325 -0
  21. package/dist/call-graph/extractors/regex/cpp-regex.js.map +1 -0
  22. package/dist/call-graph/extractors/regex/index.d.ts +2 -0
  23. package/dist/call-graph/extractors/regex/index.d.ts.map +1 -1
  24. package/dist/call-graph/extractors/regex/index.js +16 -0
  25. package/dist/call-graph/extractors/regex/index.js.map +1 -1
  26. package/dist/call-graph/extractors/regex/rust-regex.d.ts +45 -0
  27. package/dist/call-graph/extractors/regex/rust-regex.d.ts.map +1 -0
  28. package/dist/call-graph/extractors/regex/rust-regex.js +517 -0
  29. package/dist/call-graph/extractors/regex/rust-regex.js.map +1 -0
  30. package/dist/call-graph/extractors/rust-data-access-extractor.d.ts +35 -0
  31. package/dist/call-graph/extractors/rust-data-access-extractor.d.ts.map +1 -0
  32. package/dist/call-graph/extractors/rust-data-access-extractor.js +349 -0
  33. package/dist/call-graph/extractors/rust-data-access-extractor.js.map +1 -0
  34. package/dist/call-graph/extractors/rust-extractor.d.ts +125 -0
  35. package/dist/call-graph/extractors/rust-extractor.d.ts.map +1 -0
  36. package/dist/call-graph/extractors/rust-extractor.js +604 -0
  37. package/dist/call-graph/extractors/rust-extractor.js.map +1 -0
  38. package/dist/call-graph/extractors/rust-hybrid-extractor.d.ts +119 -0
  39. package/dist/call-graph/extractors/rust-hybrid-extractor.d.ts.map +1 -0
  40. package/dist/call-graph/extractors/rust-hybrid-extractor.js +548 -0
  41. package/dist/call-graph/extractors/rust-hybrid-extractor.js.map +1 -0
  42. package/dist/call-graph/index.d.ts +2 -0
  43. package/dist/call-graph/index.d.ts.map +1 -1
  44. package/dist/call-graph/index.js +4 -0
  45. package/dist/call-graph/index.js.map +1 -1
  46. package/dist/call-graph/streaming-builder.d.ts +60 -0
  47. package/dist/call-graph/streaming-builder.d.ts.map +1 -0
  48. package/dist/call-graph/streaming-builder.js +204 -0
  49. package/dist/call-graph/streaming-builder.js.map +1 -0
  50. package/dist/call-graph/types.d.ts +1 -1
  51. package/dist/call-graph/types.d.ts.map +1 -1
  52. package/dist/call-graph/unified-provider.d.ts +72 -0
  53. package/dist/call-graph/unified-provider.d.ts.map +1 -0
  54. package/dist/call-graph/unified-provider.js +502 -0
  55. package/dist/call-graph/unified-provider.js.map +1 -0
  56. package/dist/constants/extractors/regex/rust-regex.d.ts +43 -0
  57. package/dist/constants/extractors/regex/rust-regex.d.ts.map +1 -0
  58. package/dist/constants/extractors/regex/rust-regex.js +370 -0
  59. package/dist/constants/extractors/regex/rust-regex.js.map +1 -0
  60. package/dist/constants/types.d.ts +1 -1
  61. package/dist/constants/types.d.ts.map +1 -1
  62. package/dist/constants/types.js.map +1 -1
  63. package/dist/constraints/store/constraint-store.d.ts.map +1 -1
  64. package/dist/constraints/store/constraint-store.js +2 -0
  65. package/dist/constraints/store/constraint-store.js.map +1 -1
  66. package/dist/constraints/types.d.ts +1 -1
  67. package/dist/constraints/types.d.ts.map +1 -1
  68. package/dist/constraints/types.js +2 -0
  69. package/dist/constraints/types.js.map +1 -1
  70. package/dist/context/context-generator.d.ts +38 -0
  71. package/dist/context/context-generator.d.ts.map +1 -0
  72. package/dist/context/context-generator.js +392 -0
  73. package/dist/context/context-generator.js.map +1 -0
  74. package/dist/context/index.d.ts +13 -0
  75. package/dist/context/index.d.ts.map +1 -0
  76. package/dist/context/index.js +14 -0
  77. package/dist/context/index.js.map +1 -0
  78. package/dist/context/package-detector.d.ts +53 -0
  79. package/dist/context/package-detector.d.ts.map +1 -0
  80. package/dist/context/package-detector.js +672 -0
  81. package/dist/context/package-detector.js.map +1 -0
  82. package/dist/context/types.d.ts +258 -0
  83. package/dist/context/types.d.ts.map +1 -0
  84. package/dist/context/types.js +10 -0
  85. package/dist/context/types.js.map +1 -0
  86. package/dist/cpp/cpp-analyzer.d.ts +179 -0
  87. package/dist/cpp/cpp-analyzer.d.ts.map +1 -0
  88. package/dist/cpp/cpp-analyzer.js +532 -0
  89. package/dist/cpp/cpp-analyzer.js.map +1 -0
  90. package/dist/cpp/index.d.ts +9 -0
  91. package/dist/cpp/index.d.ts.map +1 -0
  92. package/dist/cpp/index.js +9 -0
  93. package/dist/cpp/index.js.map +1 -0
  94. package/dist/decisions/analyzer/decision-mining-analyzer.d.ts.map +1 -1
  95. package/dist/decisions/analyzer/decision-mining-analyzer.js +4 -0
  96. package/dist/decisions/analyzer/decision-mining-analyzer.js.map +1 -1
  97. package/dist/decisions/types.d.ts +1 -1
  98. package/dist/decisions/types.d.ts.map +1 -1
  99. package/dist/environment/extractors/cpp-env-extractor.d.ts +58 -0
  100. package/dist/environment/extractors/cpp-env-extractor.d.ts.map +1 -0
  101. package/dist/environment/extractors/cpp-env-extractor.js +298 -0
  102. package/dist/environment/extractors/cpp-env-extractor.js.map +1 -0
  103. package/dist/environment/extractors/index.d.ts +2 -0
  104. package/dist/environment/extractors/index.d.ts.map +1 -1
  105. package/dist/environment/extractors/index.js +2 -0
  106. package/dist/environment/extractors/index.js.map +1 -1
  107. package/dist/environment/extractors/rust-env-extractor.d.ts +58 -0
  108. package/dist/environment/extractors/rust-env-extractor.d.ts.map +1 -0
  109. package/dist/environment/extractors/rust-env-extractor.js +297 -0
  110. package/dist/environment/extractors/rust-env-extractor.js.map +1 -0
  111. package/dist/environment/index.d.ts +1 -1
  112. package/dist/environment/index.d.ts.map +1 -1
  113. package/dist/environment/index.js +1 -1
  114. package/dist/environment/index.js.map +1 -1
  115. package/dist/environment/types.d.ts +2 -2
  116. package/dist/environment/types.d.ts.map +1 -1
  117. package/dist/environment/types.js.map +1 -1
  118. package/dist/index.d.ts +15 -3
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +62 -2
  121. package/dist/index.js.map +1 -1
  122. package/dist/licensing/feature-guard.d.ts +103 -0
  123. package/dist/licensing/feature-guard.d.ts.map +1 -0
  124. package/dist/licensing/feature-guard.js +195 -0
  125. package/dist/licensing/feature-guard.js.map +1 -0
  126. package/dist/licensing/index.d.ts +46 -0
  127. package/dist/licensing/index.d.ts.map +1 -0
  128. package/dist/licensing/index.js +47 -0
  129. package/dist/licensing/index.js.map +1 -0
  130. package/dist/licensing/license-manager.d.ts +88 -0
  131. package/dist/licensing/license-manager.d.ts.map +1 -0
  132. package/dist/licensing/license-manager.js +251 -0
  133. package/dist/licensing/license-manager.js.map +1 -0
  134. package/dist/licensing/license-validator.d.ts +60 -0
  135. package/dist/licensing/license-validator.d.ts.map +1 -0
  136. package/dist/licensing/license-validator.js +300 -0
  137. package/dist/licensing/license-validator.js.map +1 -0
  138. package/dist/licensing/types.d.ts +76 -0
  139. package/dist/licensing/types.d.ts.map +1 -0
  140. package/dist/licensing/types.js +51 -0
  141. package/dist/licensing/types.js.map +1 -0
  142. package/dist/parsers/tree-sitter/cpp-loader.d.ts +51 -0
  143. package/dist/parsers/tree-sitter/cpp-loader.d.ts.map +1 -0
  144. package/dist/parsers/tree-sitter/cpp-loader.js +162 -0
  145. package/dist/parsers/tree-sitter/cpp-loader.js.map +1 -0
  146. package/dist/parsers/tree-sitter/index.d.ts +6 -0
  147. package/dist/parsers/tree-sitter/index.d.ts.map +1 -1
  148. package/dist/parsers/tree-sitter/index.js +16 -0
  149. package/dist/parsers/tree-sitter/index.js.map +1 -1
  150. package/dist/parsers/tree-sitter/rust-loader.d.ts +50 -0
  151. package/dist/parsers/tree-sitter/rust-loader.d.ts.map +1 -0
  152. package/dist/parsers/tree-sitter/rust-loader.js +161 -0
  153. package/dist/parsers/tree-sitter/rust-loader.js.map +1 -0
  154. package/dist/parsers/tree-sitter/tree-sitter-cpp-parser.d.ts +198 -0
  155. package/dist/parsers/tree-sitter/tree-sitter-cpp-parser.d.ts.map +1 -0
  156. package/dist/parsers/tree-sitter/tree-sitter-cpp-parser.js +671 -0
  157. package/dist/parsers/tree-sitter/tree-sitter-cpp-parser.js.map +1 -0
  158. package/dist/parsers/tree-sitter/tree-sitter-rust-parser.d.ts +180 -0
  159. package/dist/parsers/tree-sitter/tree-sitter-rust-parser.d.ts.map +1 -0
  160. package/dist/parsers/tree-sitter/tree-sitter-rust-parser.js +478 -0
  161. package/dist/parsers/tree-sitter/tree-sitter-rust-parser.js.map +1 -0
  162. package/dist/parsers/types.d.ts +1 -1
  163. package/dist/parsers/types.d.ts.map +1 -1
  164. package/dist/patterns/adapters/pattern-store-adapter.d.ts.map +1 -1
  165. package/dist/patterns/adapters/pattern-store-adapter.js +35 -10
  166. package/dist/patterns/adapters/pattern-store-adapter.js.map +1 -1
  167. package/dist/quality-gates/gates/base-gate.d.ts +71 -0
  168. package/dist/quality-gates/gates/base-gate.d.ts.map +1 -0
  169. package/dist/quality-gates/gates/base-gate.js +178 -0
  170. package/dist/quality-gates/gates/base-gate.js.map +1 -0
  171. package/dist/quality-gates/gates/constraint-verification/constraint-verification-gate.d.ts +62 -0
  172. package/dist/quality-gates/gates/constraint-verification/constraint-verification-gate.d.ts.map +1 -0
  173. package/dist/quality-gates/gates/constraint-verification/constraint-verification-gate.js +255 -0
  174. package/dist/quality-gates/gates/constraint-verification/constraint-verification-gate.js.map +1 -0
  175. package/dist/quality-gates/gates/constraint-verification/index.d.ts +7 -0
  176. package/dist/quality-gates/gates/constraint-verification/index.d.ts.map +1 -0
  177. package/dist/quality-gates/gates/constraint-verification/index.js +7 -0
  178. package/dist/quality-gates/gates/constraint-verification/index.js.map +1 -0
  179. package/dist/quality-gates/gates/custom-rules/custom-rules-gate.d.ts +73 -0
  180. package/dist/quality-gates/gates/custom-rules/custom-rules-gate.d.ts.map +1 -0
  181. package/dist/quality-gates/gates/custom-rules/custom-rules-gate.js +351 -0
  182. package/dist/quality-gates/gates/custom-rules/custom-rules-gate.js.map +1 -0
  183. package/dist/quality-gates/gates/custom-rules/index.d.ts +7 -0
  184. package/dist/quality-gates/gates/custom-rules/index.d.ts.map +1 -0
  185. package/dist/quality-gates/gates/custom-rules/index.js +7 -0
  186. package/dist/quality-gates/gates/custom-rules/index.js.map +1 -0
  187. package/dist/quality-gates/gates/impact-simulation/impact-simulation-gate.d.ts +61 -0
  188. package/dist/quality-gates/gates/impact-simulation/impact-simulation-gate.d.ts.map +1 -0
  189. package/dist/quality-gates/gates/impact-simulation/impact-simulation-gate.js +318 -0
  190. package/dist/quality-gates/gates/impact-simulation/impact-simulation-gate.js.map +1 -0
  191. package/dist/quality-gates/gates/impact-simulation/index.d.ts +7 -0
  192. package/dist/quality-gates/gates/impact-simulation/index.d.ts.map +1 -0
  193. package/dist/quality-gates/gates/impact-simulation/index.js +7 -0
  194. package/dist/quality-gates/gates/impact-simulation/index.js.map +1 -0
  195. package/dist/quality-gates/gates/index.d.ts +13 -0
  196. package/dist/quality-gates/gates/index.d.ts.map +1 -0
  197. package/dist/quality-gates/gates/index.js +13 -0
  198. package/dist/quality-gates/gates/index.js.map +1 -0
  199. package/dist/quality-gates/gates/pattern-compliance/index.d.ts +7 -0
  200. package/dist/quality-gates/gates/pattern-compliance/index.d.ts.map +1 -0
  201. package/dist/quality-gates/gates/pattern-compliance/index.js +7 -0
  202. package/dist/quality-gates/gates/pattern-compliance/index.js.map +1 -0
  203. package/dist/quality-gates/gates/pattern-compliance/pattern-compliance-gate.d.ts +61 -0
  204. package/dist/quality-gates/gates/pattern-compliance/pattern-compliance-gate.d.ts.map +1 -0
  205. package/dist/quality-gates/gates/pattern-compliance/pattern-compliance-gate.js +261 -0
  206. package/dist/quality-gates/gates/pattern-compliance/pattern-compliance-gate.js.map +1 -0
  207. package/dist/quality-gates/gates/regression-detection/index.d.ts +7 -0
  208. package/dist/quality-gates/gates/regression-detection/index.d.ts.map +1 -0
  209. package/dist/quality-gates/gates/regression-detection/index.js +7 -0
  210. package/dist/quality-gates/gates/regression-detection/index.js.map +1 -0
  211. package/dist/quality-gates/gates/regression-detection/regression-detection-gate.d.ts +69 -0
  212. package/dist/quality-gates/gates/regression-detection/regression-detection-gate.d.ts.map +1 -0
  213. package/dist/quality-gates/gates/regression-detection/regression-detection-gate.js +330 -0
  214. package/dist/quality-gates/gates/regression-detection/regression-detection-gate.js.map +1 -0
  215. package/dist/quality-gates/gates/security-boundary/index.d.ts +7 -0
  216. package/dist/quality-gates/gates/security-boundary/index.d.ts.map +1 -0
  217. package/dist/quality-gates/gates/security-boundary/index.js +7 -0
  218. package/dist/quality-gates/gates/security-boundary/index.js.map +1 -0
  219. package/dist/quality-gates/gates/security-boundary/security-boundary-gate.d.ts +65 -0
  220. package/dist/quality-gates/gates/security-boundary/security-boundary-gate.d.ts.map +1 -0
  221. package/dist/quality-gates/gates/security-boundary/security-boundary-gate.js +307 -0
  222. package/dist/quality-gates/gates/security-boundary/security-boundary-gate.js.map +1 -0
  223. package/dist/quality-gates/index.d.ts +35 -0
  224. package/dist/quality-gates/index.d.ts.map +1 -0
  225. package/dist/quality-gates/index.js +43 -0
  226. package/dist/quality-gates/index.js.map +1 -0
  227. package/dist/quality-gates/orchestrator/gate-orchestrator.d.ts +79 -0
  228. package/dist/quality-gates/orchestrator/gate-orchestrator.d.ts.map +1 -0
  229. package/dist/quality-gates/orchestrator/gate-orchestrator.js +314 -0
  230. package/dist/quality-gates/orchestrator/gate-orchestrator.js.map +1 -0
  231. package/dist/quality-gates/orchestrator/gate-registry.d.ts +53 -0
  232. package/dist/quality-gates/orchestrator/gate-registry.d.ts.map +1 -0
  233. package/dist/quality-gates/orchestrator/gate-registry.js +141 -0
  234. package/dist/quality-gates/orchestrator/gate-registry.js.map +1 -0
  235. package/dist/quality-gates/orchestrator/index.d.ts +10 -0
  236. package/dist/quality-gates/orchestrator/index.d.ts.map +1 -0
  237. package/dist/quality-gates/orchestrator/index.js +10 -0
  238. package/dist/quality-gates/orchestrator/index.js.map +1 -0
  239. package/dist/quality-gates/orchestrator/parallel-executor.d.ts +35 -0
  240. package/dist/quality-gates/orchestrator/parallel-executor.d.ts.map +1 -0
  241. package/dist/quality-gates/orchestrator/parallel-executor.js +70 -0
  242. package/dist/quality-gates/orchestrator/parallel-executor.js.map +1 -0
  243. package/dist/quality-gates/orchestrator/result-aggregator.d.ts +27 -0
  244. package/dist/quality-gates/orchestrator/result-aggregator.d.ts.map +1 -0
  245. package/dist/quality-gates/orchestrator/result-aggregator.js +70 -0
  246. package/dist/quality-gates/orchestrator/result-aggregator.js.map +1 -0
  247. package/dist/quality-gates/policy/default-policies.d.ts +14 -0
  248. package/dist/quality-gates/policy/default-policies.d.ts.map +1 -0
  249. package/dist/quality-gates/policy/default-policies.js +266 -0
  250. package/dist/quality-gates/policy/default-policies.js.map +1 -0
  251. package/dist/quality-gates/policy/index.d.ts +9 -0
  252. package/dist/quality-gates/policy/index.d.ts.map +1 -0
  253. package/dist/quality-gates/policy/index.js +9 -0
  254. package/dist/quality-gates/policy/index.js.map +1 -0
  255. package/dist/quality-gates/policy/policy-evaluator.d.ts +43 -0
  256. package/dist/quality-gates/policy/policy-evaluator.d.ts.map +1 -0
  257. package/dist/quality-gates/policy/policy-evaluator.js +136 -0
  258. package/dist/quality-gates/policy/policy-evaluator.js.map +1 -0
  259. package/dist/quality-gates/policy/policy-loader.d.ts +72 -0
  260. package/dist/quality-gates/policy/policy-loader.d.ts.map +1 -0
  261. package/dist/quality-gates/policy/policy-loader.js +228 -0
  262. package/dist/quality-gates/policy/policy-loader.js.map +1 -0
  263. package/dist/quality-gates/reporters/github-reporter.d.ts +19 -0
  264. package/dist/quality-gates/reporters/github-reporter.d.ts.map +1 -0
  265. package/dist/quality-gates/reporters/github-reporter.js +49 -0
  266. package/dist/quality-gates/reporters/github-reporter.js.map +1 -0
  267. package/dist/quality-gates/reporters/gitlab-reporter.d.ts +20 -0
  268. package/dist/quality-gates/reporters/gitlab-reporter.d.ts.map +1 -0
  269. package/dist/quality-gates/reporters/gitlab-reporter.js +42 -0
  270. package/dist/quality-gates/reporters/gitlab-reporter.js.map +1 -0
  271. package/dist/quality-gates/reporters/index.d.ts +12 -0
  272. package/dist/quality-gates/reporters/index.d.ts.map +1 -0
  273. package/dist/quality-gates/reporters/index.js +12 -0
  274. package/dist/quality-gates/reporters/index.js.map +1 -0
  275. package/dist/quality-gates/reporters/json-reporter.d.ts +18 -0
  276. package/dist/quality-gates/reporters/json-reporter.d.ts.map +1 -0
  277. package/dist/quality-gates/reporters/json-reporter.js +51 -0
  278. package/dist/quality-gates/reporters/json-reporter.js.map +1 -0
  279. package/dist/quality-gates/reporters/reporter-interface.d.ts +35 -0
  280. package/dist/quality-gates/reporters/reporter-interface.d.ts.map +1 -0
  281. package/dist/quality-gates/reporters/reporter-interface.js +22 -0
  282. package/dist/quality-gates/reporters/reporter-interface.js.map +1 -0
  283. package/dist/quality-gates/reporters/sarif-reporter.d.ts +22 -0
  284. package/dist/quality-gates/reporters/sarif-reporter.d.ts.map +1 -0
  285. package/dist/quality-gates/reporters/sarif-reporter.js +85 -0
  286. package/dist/quality-gates/reporters/sarif-reporter.js.map +1 -0
  287. package/dist/quality-gates/reporters/text-reporter.d.ts +18 -0
  288. package/dist/quality-gates/reporters/text-reporter.d.ts.map +1 -0
  289. package/dist/quality-gates/reporters/text-reporter.js +92 -0
  290. package/dist/quality-gates/reporters/text-reporter.js.map +1 -0
  291. package/dist/quality-gates/store/gate-run-store.d.ts +37 -0
  292. package/dist/quality-gates/store/gate-run-store.d.ts.map +1 -0
  293. package/dist/quality-gates/store/gate-run-store.js +104 -0
  294. package/dist/quality-gates/store/gate-run-store.js.map +1 -0
  295. package/dist/quality-gates/store/index.d.ts +8 -0
  296. package/dist/quality-gates/store/index.d.ts.map +1 -0
  297. package/dist/quality-gates/store/index.js +8 -0
  298. package/dist/quality-gates/store/index.js.map +1 -0
  299. package/dist/quality-gates/store/snapshot-store.d.ts +41 -0
  300. package/dist/quality-gates/store/snapshot-store.d.ts.map +1 -0
  301. package/dist/quality-gates/store/snapshot-store.js +117 -0
  302. package/dist/quality-gates/store/snapshot-store.js.map +1 -0
  303. package/dist/quality-gates/types.d.ts +992 -0
  304. package/dist/quality-gates/types.d.ts.map +1 -0
  305. package/dist/quality-gates/types.js +14 -0
  306. package/dist/quality-gates/types.js.map +1 -0
  307. package/dist/rust/index.d.ts +7 -0
  308. package/dist/rust/index.d.ts.map +1 -0
  309. package/dist/rust/index.js +8 -0
  310. package/dist/rust/index.js.map +1 -0
  311. package/dist/rust/rust-analyzer.d.ts +185 -0
  312. package/dist/rust/rust-analyzer.d.ts.map +1 -0
  313. package/dist/rust/rust-analyzer.js +538 -0
  314. package/dist/rust/rust-analyzer.js.map +1 -0
  315. package/dist/scanner/file-walker.d.ts.map +1 -1
  316. package/dist/scanner/file-walker.js +11 -0
  317. package/dist/scanner/file-walker.js.map +1 -1
  318. package/dist/simulation/simulation-engine.d.ts +6 -0
  319. package/dist/simulation/simulation-engine.d.ts.map +1 -1
  320. package/dist/simulation/simulation-engine.js +6 -0
  321. package/dist/simulation/simulation-engine.js.map +1 -1
  322. package/dist/speculative/types.d.ts +1 -1
  323. package/dist/speculative/types.d.ts.map +1 -1
  324. package/dist/speculative/types.js +2 -0
  325. package/dist/speculative/types.js.map +1 -1
  326. package/dist/store/project-config.d.ts +19 -0
  327. package/dist/store/project-config.d.ts.map +1 -1
  328. package/dist/store/project-config.js.map +1 -1
  329. package/dist/telemetry/index.d.ts +10 -0
  330. package/dist/telemetry/index.d.ts.map +1 -0
  331. package/dist/telemetry/index.js +11 -0
  332. package/dist/telemetry/index.js.map +1 -0
  333. package/dist/telemetry/telemetry-client.d.ts +127 -0
  334. package/dist/telemetry/telemetry-client.d.ts.map +1 -0
  335. package/dist/telemetry/telemetry-client.js +373 -0
  336. package/dist/telemetry/telemetry-client.js.map +1 -0
  337. package/dist/telemetry/types.d.ts +160 -0
  338. package/dist/telemetry/types.d.ts.map +1 -0
  339. package/dist/telemetry/types.js +27 -0
  340. package/dist/telemetry/types.js.map +1 -0
  341. package/dist/test-topology/extractors/cpp-test-extractor.d.ts +38 -0
  342. package/dist/test-topology/extractors/cpp-test-extractor.d.ts.map +1 -0
  343. package/dist/test-topology/extractors/cpp-test-extractor.js +507 -0
  344. package/dist/test-topology/extractors/cpp-test-extractor.js.map +1 -0
  345. package/dist/test-topology/extractors/index.d.ts +2 -0
  346. package/dist/test-topology/extractors/index.d.ts.map +1 -1
  347. package/dist/test-topology/extractors/index.js +2 -0
  348. package/dist/test-topology/extractors/index.js.map +1 -1
  349. package/dist/test-topology/extractors/regex/index.d.ts +1 -0
  350. package/dist/test-topology/extractors/regex/index.d.ts.map +1 -1
  351. package/dist/test-topology/extractors/regex/index.js +4 -0
  352. package/dist/test-topology/extractors/regex/index.js.map +1 -1
  353. package/dist/test-topology/extractors/regex/rust-test-regex.d.ts +66 -0
  354. package/dist/test-topology/extractors/regex/rust-test-regex.d.ts.map +1 -0
  355. package/dist/test-topology/extractors/regex/rust-test-regex.js +565 -0
  356. package/dist/test-topology/extractors/regex/rust-test-regex.js.map +1 -0
  357. package/dist/test-topology/extractors/rust-test-extractor.d.ts +49 -0
  358. package/dist/test-topology/extractors/rust-test-extractor.d.ts.map +1 -0
  359. package/dist/test-topology/extractors/rust-test-extractor.js +422 -0
  360. package/dist/test-topology/extractors/rust-test-extractor.js.map +1 -0
  361. package/dist/test-topology/hybrid-test-topology-analyzer.d.ts.map +1 -1
  362. package/dist/test-topology/hybrid-test-topology-analyzer.js +2 -0
  363. package/dist/test-topology/hybrid-test-topology-analyzer.js.map +1 -1
  364. package/dist/test-topology/test-topology-analyzer.d.ts.map +1 -1
  365. package/dist/test-topology/test-topology-analyzer.js +2 -0
  366. package/dist/test-topology/test-topology-analyzer.js.map +1 -1
  367. package/dist/test-topology/types.d.ts +2 -2
  368. package/dist/test-topology/types.d.ts.map +1 -1
  369. package/dist/unified-provider/integration/unified-scanner.d.ts.map +1 -1
  370. package/dist/unified-provider/integration/unified-scanner.js +3 -0
  371. package/dist/unified-provider/integration/unified-scanner.js.map +1 -1
  372. package/dist/unified-provider/matching/diesel-matcher.d.ts +33 -0
  373. package/dist/unified-provider/matching/diesel-matcher.d.ts.map +1 -0
  374. package/dist/unified-provider/matching/diesel-matcher.js +210 -0
  375. package/dist/unified-provider/matching/diesel-matcher.js.map +1 -0
  376. package/dist/unified-provider/matching/index.d.ts +3 -1
  377. package/dist/unified-provider/matching/index.d.ts.map +1 -1
  378. package/dist/unified-provider/matching/index.js +4 -1
  379. package/dist/unified-provider/matching/index.js.map +1 -1
  380. package/dist/unified-provider/matching/matcher-registry.d.ts.map +1 -1
  381. package/dist/unified-provider/matching/matcher-registry.js +7 -2
  382. package/dist/unified-provider/matching/matcher-registry.js.map +1 -1
  383. package/dist/unified-provider/matching/seaorm-matcher.d.ts +35 -0
  384. package/dist/unified-provider/matching/seaorm-matcher.d.ts.map +1 -0
  385. package/dist/unified-provider/matching/seaorm-matcher.js +200 -0
  386. package/dist/unified-provider/matching/seaorm-matcher.js.map +1 -0
  387. package/dist/unified-provider/matching/sqlx-matcher.d.ts +19 -24
  388. package/dist/unified-provider/matching/sqlx-matcher.d.ts.map +1 -1
  389. package/dist/unified-provider/matching/sqlx-matcher.js +171 -149
  390. package/dist/unified-provider/matching/sqlx-matcher.js.map +1 -1
  391. package/dist/unified-provider/normalization/cpp-normalizer.d.ts +62 -0
  392. package/dist/unified-provider/normalization/cpp-normalizer.d.ts.map +1 -0
  393. package/dist/unified-provider/normalization/cpp-normalizer.js +581 -0
  394. package/dist/unified-provider/normalization/cpp-normalizer.js.map +1 -0
  395. package/dist/unified-provider/normalization/index.d.ts +2 -0
  396. package/dist/unified-provider/normalization/index.d.ts.map +1 -1
  397. package/dist/unified-provider/normalization/index.js +11 -1
  398. package/dist/unified-provider/normalization/index.js.map +1 -1
  399. package/dist/unified-provider/normalization/rust-normalizer.d.ts +71 -0
  400. package/dist/unified-provider/normalization/rust-normalizer.d.ts.map +1 -0
  401. package/dist/unified-provider/normalization/rust-normalizer.js +670 -0
  402. package/dist/unified-provider/normalization/rust-normalizer.js.map +1 -0
  403. package/dist/unified-provider/parsing/parser-registry.d.ts.map +1 -1
  404. package/dist/unified-provider/parsing/parser-registry.js +62 -1
  405. package/dist/unified-provider/parsing/parser-registry.js.map +1 -1
  406. package/dist/unified-provider/provider/unified-language-provider.js +1 -1
  407. package/dist/unified-provider/provider/unified-language-provider.js.map +1 -1
  408. package/dist/unified-provider/types.d.ts +1 -1
  409. package/dist/unified-provider/types.d.ts.map +1 -1
  410. package/dist/wrappers/index.d.ts.map +1 -1
  411. package/dist/wrappers/index.js +2 -0
  412. package/dist/wrappers/index.js.map +1 -1
  413. package/dist/wrappers/integration/adapter.d.ts.map +1 -1
  414. package/dist/wrappers/integration/adapter.js +2 -0
  415. package/dist/wrappers/integration/adapter.js.map +1 -1
  416. package/dist/wrappers/integration/scanner.d.ts.map +1 -1
  417. package/dist/wrappers/integration/scanner.js +2 -0
  418. package/dist/wrappers/integration/scanner.js.map +1 -1
  419. package/dist/wrappers/primitives/registry.d.ts +18 -0
  420. package/dist/wrappers/primitives/registry.d.ts.map +1 -1
  421. package/dist/wrappers/primitives/registry.js +190 -0
  422. package/dist/wrappers/primitives/registry.js.map +1 -1
  423. package/dist/wrappers/types.d.ts +1 -1
  424. package/dist/wrappers/types.d.ts.map +1 -1
  425. package/package.json +5 -2
  426. package/LICENSE +0 -21
  427. package/dist/lake/lake.bak/index-store.d.ts +0 -82
  428. package/dist/lake/lake.bak/index-store.d.ts.map +0 -1
  429. package/dist/lake/lake.bak/index-store.js +0 -357
  430. package/dist/lake/lake.bak/index-store.js.map +0 -1
  431. package/dist/lake/lake.bak/index.d.ts +0 -81
  432. package/dist/lake/lake.bak/index.d.ts.map +0 -1
  433. package/dist/lake/lake.bak/index.js +0 -114
  434. package/dist/lake/lake.bak/index.js.map +0 -1
  435. package/dist/lake/lake.bak/manifest-store.d.ts +0 -51
  436. package/dist/lake/lake.bak/manifest-store.d.ts.map +0 -1
  437. package/dist/lake/lake.bak/manifest-store.js +0 -347
  438. package/dist/lake/lake.bak/manifest-store.js.map +0 -1
  439. package/dist/lake/lake.bak/query-engine.d.ts +0 -112
  440. package/dist/lake/lake.bak/query-engine.d.ts.map +0 -1
  441. package/dist/lake/lake.bak/query-engine.js +0 -370
  442. package/dist/lake/lake.bak/query-engine.js.map +0 -1
  443. package/dist/lake/lake.bak/types.d.ts +0 -428
  444. package/dist/lake/lake.bak/types.d.ts.map +0 -1
  445. package/dist/lake/lake.bak/types.js +0 -46
  446. package/dist/lake/lake.bak/types.js.map +0 -1
  447. package/dist/lake/lake.bak/view-materializer.d.ts +0 -70
  448. package/dist/lake/lake.bak/view-materializer.d.ts.map +0 -1
  449. package/dist/lake/lake.bak/view-materializer.js +0 -314
  450. package/dist/lake/lake.bak/view-materializer.js.map +0 -1
  451. package/dist/lake/lake.bak/view-store.d.ts +0 -57
  452. package/dist/lake/lake.bak/view-store.d.ts.map +0 -1
  453. package/dist/lake/lake.bak/view-store.js +0 -348
  454. package/dist/lake/lake.bak/view-store.js.map +0 -1
  455. package/dist/unified-provider/migration/deprecated-extractors.d.ts +0 -104
  456. package/dist/unified-provider/migration/deprecated-extractors.d.ts.map +0 -1
  457. package/dist/unified-provider/migration/deprecated-extractors.js +0 -129
  458. package/dist/unified-provider/migration/deprecated-extractors.js.map +0 -1
  459. package/dist/unified-provider/migration/deprecated-scanner.d.ts +0 -40
  460. package/dist/unified-provider/migration/deprecated-scanner.d.ts.map +0 -1
  461. package/dist/unified-provider/migration/deprecated-scanner.js +0 -49
  462. package/dist/unified-provider/migration/deprecated-scanner.js.map +0 -1
  463. package/dist/unified-provider/migration/index.d.ts +0 -41
  464. package/dist/unified-provider/migration/index.d.ts.map +0 -1
  465. package/dist/unified-provider/migration/index.js +0 -43
  466. package/dist/unified-provider/migration/index.js.map +0 -1
@@ -0,0 +1,671 @@
1
+ /**
2
+ * Tree-Sitter C++ Parser Utilities
3
+ *
4
+ * Provides C++-specific parsing utilities built on tree-sitter.
5
+ * Handles C++ syntax including:
6
+ * - Functions and methods
7
+ * - Classes, structs, and enums
8
+ * - Templates and specializations
9
+ * - Namespaces
10
+ * - Virtual functions and inheritance
11
+ * - Smart pointers and RAII patterns
12
+ * - Operator overloading
13
+ *
14
+ * @license Apache-2.0
15
+ */
16
+ import { isCppTreeSitterAvailable, createCppParser } from './cpp-loader.js';
17
+ // ============================================================================
18
+ // Parser Class
19
+ // ============================================================================
20
+ /**
21
+ * C++-specific tree-sitter parser
22
+ */
23
+ export class CppTreeSitterParser {
24
+ parser = null;
25
+ currentAccessSpecifier = 'none';
26
+ currentNamespace = '';
27
+ /**
28
+ * Check if tree-sitter-cpp is available
29
+ */
30
+ static isAvailable() {
31
+ return isCppTreeSitterAvailable();
32
+ }
33
+ /**
34
+ * Parse C++ source code
35
+ */
36
+ parse(source) {
37
+ const result = {
38
+ functions: [],
39
+ classes: [],
40
+ enums: [],
41
+ namespaces: [],
42
+ includes: [],
43
+ macros: [],
44
+ errors: [],
45
+ };
46
+ if (!isCppTreeSitterAvailable()) {
47
+ result.errors.push('Tree-sitter-cpp is not available');
48
+ return result;
49
+ }
50
+ try {
51
+ if (!this.parser) {
52
+ this.parser = createCppParser();
53
+ }
54
+ const tree = this.parser.parse(source);
55
+ this.currentNamespace = '';
56
+ this.currentAccessSpecifier = 'none';
57
+ this.visitNode(tree.rootNode, result, source);
58
+ }
59
+ catch (error) {
60
+ result.errors.push(error instanceof Error ? error.message : 'Unknown parse error');
61
+ }
62
+ return result;
63
+ }
64
+ /**
65
+ * Visit a node and extract information
66
+ */
67
+ visitNode(node, result, source) {
68
+ switch (node.type) {
69
+ case 'function_definition':
70
+ this.extractFunction(node, result, source);
71
+ break;
72
+ case 'declaration':
73
+ this.extractDeclaration(node, result, source);
74
+ break;
75
+ case 'class_specifier':
76
+ case 'struct_specifier':
77
+ this.extractClass(node, result, source);
78
+ break;
79
+ case 'enum_specifier':
80
+ this.extractEnum(node, result);
81
+ break;
82
+ case 'namespace_definition':
83
+ this.extractNamespace(node, result, source);
84
+ return; // Don't recurse, handled internally
85
+ case 'preproc_include':
86
+ this.extractInclude(node, result);
87
+ break;
88
+ case 'preproc_def':
89
+ case 'preproc_function_def':
90
+ this.extractMacro(node, result);
91
+ break;
92
+ case 'access_specifier':
93
+ this.updateAccessSpecifier(node);
94
+ break;
95
+ case 'template_declaration':
96
+ this.extractTemplateDeclaration(node, result, source);
97
+ return; // Don't recurse, handled internally
98
+ default:
99
+ // Recurse into children
100
+ for (const child of node.children) {
101
+ this.visitNode(child, result, source);
102
+ }
103
+ }
104
+ }
105
+ /**
106
+ * Extract function information
107
+ */
108
+ extractFunction(node, result, _source) {
109
+ const declaratorNode = node.childForFieldName('declarator');
110
+ if (!declaratorNode)
111
+ return;
112
+ const { name, className } = this.extractFunctionName(declaratorNode);
113
+ if (!name)
114
+ return;
115
+ const typeNode = node.childForFieldName('type');
116
+ const fn = {
117
+ name,
118
+ qualifiedName: this.buildQualifiedName(name, className),
119
+ isVirtual: this.hasSpecifier(node, 'virtual'),
120
+ isPureVirtual: this.isPureVirtual(node),
121
+ isStatic: this.hasSpecifier(node, 'static'),
122
+ isConst: this.isConstMethod(declaratorNode),
123
+ isNoexcept: this.hasNoexcept(declaratorNode),
124
+ isConstexpr: this.hasSpecifier(node, 'constexpr'),
125
+ isInline: this.hasSpecifier(node, 'inline'),
126
+ isExplicit: this.hasSpecifier(node, 'explicit'),
127
+ accessSpecifier: this.currentAccessSpecifier,
128
+ parameters: this.extractParameters(declaratorNode),
129
+ templateParams: [],
130
+ startLine: node.startPosition.row + 1,
131
+ endLine: node.endPosition.row + 1,
132
+ };
133
+ if (typeNode) {
134
+ fn.returnType = this.extractType(typeNode);
135
+ }
136
+ if (className) {
137
+ fn.className = className;
138
+ }
139
+ if (this.currentNamespace) {
140
+ fn.namespaceName = this.currentNamespace;
141
+ }
142
+ result.functions.push(fn);
143
+ }
144
+ /**
145
+ * Extract declaration (function declarations, variable declarations)
146
+ */
147
+ extractDeclaration(node, result, source) {
148
+ // Check if this is a function declaration
149
+ const declaratorNode = node.childForFieldName('declarator');
150
+ if (declaratorNode && this.isFunctionDeclarator(declaratorNode)) {
151
+ this.extractFunctionDeclaration(node, result, source);
152
+ }
153
+ }
154
+ /**
155
+ * Extract function declaration (prototype)
156
+ */
157
+ extractFunctionDeclaration(node, result, _source) {
158
+ const declaratorNode = node.childForFieldName('declarator');
159
+ if (!declaratorNode)
160
+ return;
161
+ const { name, className } = this.extractFunctionName(declaratorNode);
162
+ if (!name)
163
+ return;
164
+ const typeNode = node.childForFieldName('type');
165
+ const fn = {
166
+ name,
167
+ qualifiedName: this.buildQualifiedName(name, className),
168
+ isVirtual: this.hasSpecifier(node, 'virtual'),
169
+ isPureVirtual: this.isPureVirtual(node),
170
+ isStatic: this.hasSpecifier(node, 'static'),
171
+ isConst: this.isConstMethod(declaratorNode),
172
+ isNoexcept: this.hasNoexcept(declaratorNode),
173
+ isConstexpr: this.hasSpecifier(node, 'constexpr'),
174
+ isInline: this.hasSpecifier(node, 'inline'),
175
+ isExplicit: this.hasSpecifier(node, 'explicit'),
176
+ accessSpecifier: this.currentAccessSpecifier,
177
+ parameters: this.extractParameters(declaratorNode),
178
+ templateParams: [],
179
+ startLine: node.startPosition.row + 1,
180
+ endLine: node.endPosition.row + 1,
181
+ };
182
+ if (typeNode) {
183
+ fn.returnType = this.extractType(typeNode);
184
+ }
185
+ if (className) {
186
+ fn.className = className;
187
+ }
188
+ if (this.currentNamespace) {
189
+ fn.namespaceName = this.currentNamespace;
190
+ }
191
+ result.functions.push(fn);
192
+ }
193
+ /**
194
+ * Extract class/struct information
195
+ */
196
+ extractClass(node, result, source) {
197
+ const nameNode = node.childForFieldName('name');
198
+ if (!nameNode)
199
+ return;
200
+ const name = nameNode.text;
201
+ const kind = node.type === 'class_specifier' ? 'class' : 'struct';
202
+ const bodyNode = node.childForFieldName('body');
203
+ const cls = {
204
+ name,
205
+ kind,
206
+ isTemplate: false,
207
+ templateParams: [],
208
+ baseClasses: this.extractBaseClasses(node),
209
+ methods: [],
210
+ virtualMethods: [],
211
+ fields: [],
212
+ accessSpecifier: this.currentAccessSpecifier,
213
+ startLine: node.startPosition.row + 1,
214
+ endLine: node.endPosition.row + 1,
215
+ };
216
+ if (this.currentNamespace) {
217
+ cls.namespaceName = this.currentNamespace;
218
+ }
219
+ // Set default access specifier based on class/struct
220
+ const savedAccessSpecifier = this.currentAccessSpecifier;
221
+ this.currentAccessSpecifier = kind === 'class' ? 'private' : 'public';
222
+ // Extract members from body
223
+ if (bodyNode) {
224
+ this.extractClassMembers(bodyNode, cls, result, source);
225
+ }
226
+ this.currentAccessSpecifier = savedAccessSpecifier;
227
+ result.classes.push(cls);
228
+ }
229
+ /**
230
+ * Extract class members
231
+ */
232
+ extractClassMembers(bodyNode, cls, result, source) {
233
+ for (const child of bodyNode.children) {
234
+ switch (child.type) {
235
+ case 'access_specifier':
236
+ this.updateAccessSpecifier(child);
237
+ break;
238
+ case 'function_definition':
239
+ this.extractFunction(child, result, source);
240
+ const fnName = this.extractFunctionNameFromNode(child);
241
+ if (fnName) {
242
+ cls.methods.push(fnName);
243
+ if (this.hasSpecifier(child, 'virtual')) {
244
+ cls.virtualMethods.push(fnName);
245
+ }
246
+ }
247
+ break;
248
+ case 'declaration':
249
+ if (this.isFunctionDeclarator(child.childForFieldName('declarator'))) {
250
+ this.extractFunctionDeclaration(child, result, source);
251
+ const declName = this.extractFunctionNameFromNode(child);
252
+ if (declName) {
253
+ cls.methods.push(declName);
254
+ if (this.hasSpecifier(child, 'virtual')) {
255
+ cls.virtualMethods.push(declName);
256
+ }
257
+ }
258
+ }
259
+ else {
260
+ // Field declaration
261
+ const field = this.extractField(child);
262
+ if (field) {
263
+ cls.fields.push(field);
264
+ }
265
+ }
266
+ break;
267
+ case 'field_declaration':
268
+ const fieldDecl = this.extractField(child);
269
+ if (fieldDecl) {
270
+ cls.fields.push(fieldDecl);
271
+ }
272
+ break;
273
+ case 'template_declaration':
274
+ this.extractTemplateDeclaration(child, result, source);
275
+ break;
276
+ }
277
+ }
278
+ }
279
+ /**
280
+ * Extract enum information
281
+ */
282
+ extractEnum(node, result) {
283
+ const nameNode = node.childForFieldName('name');
284
+ const bodyNode = node.childForFieldName('body');
285
+ const name = nameNode?.text ?? '';
286
+ const isScoped = this.isScopedEnum(node);
287
+ const enumDef = {
288
+ name,
289
+ isScoped,
290
+ values: [],
291
+ startLine: node.startPosition.row + 1,
292
+ endLine: node.endPosition.row + 1,
293
+ };
294
+ // Extract underlying type
295
+ const baseNode = node.childForFieldName('base');
296
+ if (baseNode) {
297
+ enumDef.underlyingType = baseNode.text;
298
+ }
299
+ if (this.currentNamespace) {
300
+ enumDef.namespaceName = this.currentNamespace;
301
+ }
302
+ // Extract enum values
303
+ if (bodyNode) {
304
+ for (const child of bodyNode.children) {
305
+ if (child.type === 'enumerator') {
306
+ const valueName = child.childForFieldName('name')?.text;
307
+ const valueExpr = child.childForFieldName('value')?.text;
308
+ if (valueName) {
309
+ enumDef.values.push({
310
+ name: valueName,
311
+ value: valueExpr,
312
+ line: child.startPosition.row + 1,
313
+ });
314
+ }
315
+ }
316
+ }
317
+ }
318
+ result.enums.push(enumDef);
319
+ }
320
+ /**
321
+ * Extract namespace information
322
+ */
323
+ extractNamespace(node, result, source) {
324
+ const nameNode = node.childForFieldName('name');
325
+ const bodyNode = node.childForFieldName('body');
326
+ const name = nameNode?.text ?? '';
327
+ const isAnonymous = !nameNode;
328
+ result.namespaces.push({
329
+ name,
330
+ isAnonymous,
331
+ startLine: node.startPosition.row + 1,
332
+ endLine: node.endPosition.row + 1,
333
+ });
334
+ // Save and update namespace context
335
+ const savedNamespace = this.currentNamespace;
336
+ this.currentNamespace = this.currentNamespace
337
+ ? `${this.currentNamespace}::${name}`
338
+ : name;
339
+ // Process namespace body
340
+ if (bodyNode) {
341
+ for (const child of bodyNode.children) {
342
+ this.visitNode(child, result, source);
343
+ }
344
+ }
345
+ this.currentNamespace = savedNamespace;
346
+ }
347
+ /**
348
+ * Extract include directive
349
+ */
350
+ extractInclude(node, result) {
351
+ const pathNode = node.childForFieldName('path');
352
+ if (!pathNode)
353
+ return;
354
+ const pathText = pathNode.text;
355
+ const isSystem = pathText.startsWith('<');
356
+ const path = pathText.replace(/^[<"]|[>"]$/g, '');
357
+ result.includes.push({
358
+ path,
359
+ isSystem,
360
+ line: node.startPosition.row + 1,
361
+ });
362
+ }
363
+ /**
364
+ * Extract macro definition
365
+ */
366
+ extractMacro(node, result) {
367
+ const nameNode = node.childForFieldName('name');
368
+ if (!nameNode)
369
+ return;
370
+ const macro = {
371
+ name: nameNode.text,
372
+ line: node.startPosition.row + 1,
373
+ };
374
+ // Extract parameters for function-like macros
375
+ const paramsNode = node.childForFieldName('parameters');
376
+ if (paramsNode) {
377
+ macro.parameters = [];
378
+ for (const child of paramsNode.children) {
379
+ if (child.type === 'identifier') {
380
+ macro.parameters.push(child.text);
381
+ }
382
+ }
383
+ }
384
+ // Extract body
385
+ const valueNode = node.childForFieldName('value');
386
+ if (valueNode) {
387
+ macro.body = valueNode.text;
388
+ }
389
+ result.macros.push(macro);
390
+ }
391
+ /**
392
+ * Extract template declaration
393
+ */
394
+ extractTemplateDeclaration(node, result, source) {
395
+ const paramsNode = node.childForFieldName('parameters');
396
+ const templateParams = paramsNode ? this.extractTemplateParams(paramsNode) : [];
397
+ // Find the templated declaration
398
+ for (const child of node.children) {
399
+ if (child.type === 'function_definition') {
400
+ this.extractFunction(child, result, source);
401
+ // Add template params to the last function
402
+ if (result.functions.length > 0) {
403
+ result.functions[result.functions.length - 1].templateParams = templateParams;
404
+ }
405
+ }
406
+ else if (child.type === 'declaration') {
407
+ this.extractDeclaration(child, result, source);
408
+ if (result.functions.length > 0) {
409
+ result.functions[result.functions.length - 1].templateParams = templateParams;
410
+ }
411
+ }
412
+ else if (child.type === 'class_specifier' || child.type === 'struct_specifier') {
413
+ this.extractClass(child, result, source);
414
+ // Add template params to the last class
415
+ if (result.classes.length > 0) {
416
+ const lastClass = result.classes[result.classes.length - 1];
417
+ lastClass.isTemplate = true;
418
+ lastClass.templateParams = templateParams;
419
+ }
420
+ }
421
+ }
422
+ }
423
+ // ============================================================================
424
+ // Helper Methods
425
+ // ============================================================================
426
+ extractFunctionName(declaratorNode) {
427
+ let name = null;
428
+ let className = null;
429
+ const visit = (n) => {
430
+ if (n.type === 'identifier') {
431
+ name = n.text;
432
+ }
433
+ else if (n.type === 'field_identifier') {
434
+ name = n.text;
435
+ }
436
+ else if (n.type === 'qualified_identifier') {
437
+ const parts = n.text.split('::');
438
+ name = parts[parts.length - 1] ?? null;
439
+ if (parts.length > 1) {
440
+ className = parts.slice(0, -1).join('::');
441
+ }
442
+ }
443
+ else if (n.type === 'destructor_name') {
444
+ name = n.text;
445
+ }
446
+ else if (n.type === 'operator_name') {
447
+ name = n.text;
448
+ }
449
+ else if (n.type === 'function_declarator') {
450
+ const innerDeclarator = n.childForFieldName('declarator');
451
+ if (innerDeclarator) {
452
+ visit(innerDeclarator);
453
+ }
454
+ }
455
+ else if (n.type === 'pointer_declarator' || n.type === 'reference_declarator') {
456
+ for (const child of n.children) {
457
+ visit(child);
458
+ }
459
+ }
460
+ };
461
+ visit(declaratorNode);
462
+ return { name, className };
463
+ }
464
+ extractFunctionNameFromNode(node) {
465
+ const declaratorNode = node.childForFieldName('declarator');
466
+ if (!declaratorNode)
467
+ return null;
468
+ const { name } = this.extractFunctionName(declaratorNode);
469
+ return name;
470
+ }
471
+ buildQualifiedName(name, className) {
472
+ const parts = [];
473
+ if (this.currentNamespace) {
474
+ parts.push(this.currentNamespace);
475
+ }
476
+ if (className) {
477
+ parts.push(className);
478
+ }
479
+ parts.push(name);
480
+ return parts.join('::');
481
+ }
482
+ extractParameters(declaratorNode) {
483
+ const params = [];
484
+ const findParams = (n) => {
485
+ if (n.type === 'function_declarator') {
486
+ return n.childForFieldName('parameters');
487
+ }
488
+ for (const child of n.children) {
489
+ const result = findParams(child);
490
+ if (result)
491
+ return result;
492
+ }
493
+ return null;
494
+ };
495
+ const paramsNode = findParams(declaratorNode);
496
+ if (!paramsNode)
497
+ return params;
498
+ for (const child of paramsNode.children) {
499
+ if (child.type === 'parameter_declaration') {
500
+ const typeNode = child.childForFieldName('type');
501
+ const declarator = child.childForFieldName('declarator');
502
+ const defaultValue = child.childForFieldName('default_value');
503
+ const typeText = typeNode?.text ?? 'unknown';
504
+ let name = 'unnamed';
505
+ if (declarator) {
506
+ const { name: paramName } = this.extractFunctionName(declarator);
507
+ if (paramName)
508
+ name = paramName;
509
+ }
510
+ params.push({
511
+ name,
512
+ type: typeText,
513
+ hasDefault: !!defaultValue,
514
+ defaultValue: defaultValue?.text,
515
+ isConst: typeText.includes('const'),
516
+ isReference: typeText.includes('&') && !typeText.includes('&&'),
517
+ isPointer: typeText.includes('*'),
518
+ isRvalueRef: typeText.includes('&&'),
519
+ });
520
+ }
521
+ }
522
+ return params;
523
+ }
524
+ extractTemplateParams(paramsNode) {
525
+ const params = [];
526
+ for (const child of paramsNode.children) {
527
+ if (child.type === 'type_parameter_declaration') {
528
+ const nameNode = child.childForFieldName('name');
529
+ const defaultNode = child.childForFieldName('default_type');
530
+ params.push({
531
+ name: nameNode?.text ?? 'T',
532
+ kind: 'type',
533
+ default: defaultNode?.text,
534
+ });
535
+ }
536
+ else if (child.type === 'parameter_declaration') {
537
+ const typeNode = child.childForFieldName('type');
538
+ const declarator = child.childForFieldName('declarator');
539
+ params.push({
540
+ name: declarator?.text ?? 'N',
541
+ kind: 'non-type',
542
+ constraint: typeNode?.text,
543
+ });
544
+ }
545
+ else if (child.type === 'template_template_parameter_declaration') {
546
+ const nameNode = child.childForFieldName('name');
547
+ params.push({
548
+ name: nameNode?.text ?? 'Template',
549
+ kind: 'template',
550
+ });
551
+ }
552
+ }
553
+ return params;
554
+ }
555
+ extractBaseClasses(node) {
556
+ const bases = [];
557
+ for (const child of node.children) {
558
+ if (child.type === 'base_class_clause') {
559
+ for (const baseChild of child.children) {
560
+ if (baseChild.type === 'type_identifier' || baseChild.type === 'qualified_identifier') {
561
+ let accessSpecifier = 'private';
562
+ let isVirtual = false;
563
+ // Check siblings for access specifier and virtual
564
+ let sibling = baseChild.previousSibling;
565
+ while (sibling) {
566
+ if (sibling.text === 'public')
567
+ accessSpecifier = 'public';
568
+ else if (sibling.text === 'protected')
569
+ accessSpecifier = 'protected';
570
+ else if (sibling.text === 'private')
571
+ accessSpecifier = 'private';
572
+ else if (sibling.text === 'virtual')
573
+ isVirtual = true;
574
+ sibling = sibling.previousSibling;
575
+ }
576
+ bases.push({
577
+ name: baseChild.text,
578
+ accessSpecifier,
579
+ isVirtual,
580
+ });
581
+ }
582
+ }
583
+ }
584
+ }
585
+ return bases;
586
+ }
587
+ extractField(node) {
588
+ const typeNode = node.childForFieldName('type');
589
+ const declaratorNode = node.childForFieldName('declarator');
590
+ if (!declaratorNode)
591
+ return null;
592
+ const { name } = this.extractFunctionName(declaratorNode);
593
+ if (!name)
594
+ return null;
595
+ const typeText = typeNode?.text ?? 'unknown';
596
+ return {
597
+ name,
598
+ type: typeText,
599
+ accessSpecifier: this.currentAccessSpecifier === 'none' ? 'private' : this.currentAccessSpecifier,
600
+ isStatic: this.hasSpecifier(node, 'static'),
601
+ isConst: typeText.includes('const'),
602
+ isMutable: this.hasSpecifier(node, 'mutable'),
603
+ };
604
+ }
605
+ extractType(typeNode) {
606
+ return typeNode.text;
607
+ }
608
+ hasSpecifier(node, specifier) {
609
+ for (const child of node.children) {
610
+ if (child.type === 'storage_class_specifier' || child.type === 'type_qualifier') {
611
+ if (child.text === specifier)
612
+ return true;
613
+ }
614
+ if (child.text === specifier)
615
+ return true;
616
+ }
617
+ return false;
618
+ }
619
+ isPureVirtual(node) {
620
+ // Look for = 0 at the end
621
+ const text = node.text;
622
+ return /=\s*0\s*;?\s*$/.test(text);
623
+ }
624
+ isConstMethod(declaratorNode) {
625
+ // Look for const after the parameter list
626
+ const text = declaratorNode.text;
627
+ return /\)\s*const/.test(text);
628
+ }
629
+ hasNoexcept(declaratorNode) {
630
+ const text = declaratorNode.text;
631
+ return text.includes('noexcept');
632
+ }
633
+ isFunctionDeclarator(node) {
634
+ if (!node)
635
+ return false;
636
+ const visit = (n) => {
637
+ if (n.type === 'function_declarator')
638
+ return true;
639
+ for (const child of n.children) {
640
+ if (visit(child))
641
+ return true;
642
+ }
643
+ return false;
644
+ };
645
+ return visit(node);
646
+ }
647
+ isScopedEnum(node) {
648
+ for (const child of node.children) {
649
+ if (child.text === 'class' || child.text === 'struct') {
650
+ return true;
651
+ }
652
+ }
653
+ return false;
654
+ }
655
+ updateAccessSpecifier(node) {
656
+ const text = node.text.replace(':', '').trim();
657
+ if (text === 'public')
658
+ this.currentAccessSpecifier = 'public';
659
+ else if (text === 'protected')
660
+ this.currentAccessSpecifier = 'protected';
661
+ else if (text === 'private')
662
+ this.currentAccessSpecifier = 'private';
663
+ }
664
+ }
665
+ /**
666
+ * Create a C++ tree-sitter parser instance
667
+ */
668
+ export function createCppTreeSitterParser() {
669
+ return new CppTreeSitterParser();
670
+ }
671
+ //# sourceMappingURL=tree-sitter-cpp-parser.js.map