@opencodehub/ingestion 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (563) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +69 -0
  3. package/dist/extract/index.d.ts +8 -0
  4. package/dist/extract/index.d.ts.map +1 -0
  5. package/dist/extract/index.js +6 -0
  6. package/dist/extract/index.js.map +1 -0
  7. package/dist/extract/orm-detector.d.ts +19 -0
  8. package/dist/extract/orm-detector.d.ts.map +1 -0
  9. package/dist/extract/orm-detector.js +209 -0
  10. package/dist/extract/orm-detector.js.map +1 -0
  11. package/dist/extract/property-access.d.ts +76 -0
  12. package/dist/extract/property-access.d.ts.map +1 -0
  13. package/dist/extract/property-access.js +260 -0
  14. package/dist/extract/property-access.js.map +1 -0
  15. package/dist/extract/receiver-resolver.d.ts +86 -0
  16. package/dist/extract/receiver-resolver.d.ts.map +1 -0
  17. package/dist/extract/receiver-resolver.js +77 -0
  18. package/dist/extract/receiver-resolver.js.map +1 -0
  19. package/dist/extract/route-detector-java.d.ts +29 -0
  20. package/dist/extract/route-detector-java.d.ts.map +1 -0
  21. package/dist/extract/route-detector-java.js +190 -0
  22. package/dist/extract/route-detector-java.js.map +1 -0
  23. package/dist/extract/route-detector-nestjs.d.ts +30 -0
  24. package/dist/extract/route-detector-nestjs.d.ts.map +1 -0
  25. package/dist/extract/route-detector-nestjs.js +134 -0
  26. package/dist/extract/route-detector-nestjs.js.map +1 -0
  27. package/dist/extract/route-detector-python.d.ts +28 -0
  28. package/dist/extract/route-detector-python.d.ts.map +1 -0
  29. package/dist/extract/route-detector-python.js +100 -0
  30. package/dist/extract/route-detector-python.js.map +1 -0
  31. package/dist/extract/route-detector-rails.d.ts +28 -0
  32. package/dist/extract/route-detector-rails.d.ts.map +1 -0
  33. package/dist/extract/route-detector-rails.js +162 -0
  34. package/dist/extract/route-detector-rails.js.map +1 -0
  35. package/dist/extract/route-detector.d.ts +45 -0
  36. package/dist/extract/route-detector.d.ts.map +1 -0
  37. package/dist/extract/route-detector.js +467 -0
  38. package/dist/extract/route-detector.js.map +1 -0
  39. package/dist/extract/tool-detector.d.ts +26 -0
  40. package/dist/extract/tool-detector.d.ts.map +1 -0
  41. package/dist/extract/tool-detector.js +364 -0
  42. package/dist/extract/tool-detector.js.map +1 -0
  43. package/dist/extract/types.d.ts +89 -0
  44. package/dist/extract/types.d.ts.map +1 -0
  45. package/dist/extract/types.js +11 -0
  46. package/dist/extract/types.js.map +1 -0
  47. package/dist/index.d.ts +10 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +10 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/parse/cobol-regex.d.ts +85 -0
  52. package/dist/parse/cobol-regex.d.ts.map +1 -0
  53. package/dist/parse/cobol-regex.js +355 -0
  54. package/dist/parse/cobol-regex.js.map +1 -0
  55. package/dist/parse/grammar-registry.d.ts +115 -0
  56. package/dist/parse/grammar-registry.d.ts.map +1 -0
  57. package/dist/parse/grammar-registry.js +278 -0
  58. package/dist/parse/grammar-registry.js.map +1 -0
  59. package/dist/parse/index.d.ts +14 -0
  60. package/dist/parse/index.d.ts.map +1 -0
  61. package/dist/parse/index.js +10 -0
  62. package/dist/parse/index.js.map +1 -0
  63. package/dist/parse/language-detector.d.ts +17 -0
  64. package/dist/parse/language-detector.d.ts.map +1 -0
  65. package/dist/parse/language-detector.js +104 -0
  66. package/dist/parse/language-detector.js.map +1 -0
  67. package/dist/parse/parse-worker.d.ts +24 -0
  68. package/dist/parse/parse-worker.d.ts.map +1 -0
  69. package/dist/parse/parse-worker.js +230 -0
  70. package/dist/parse/parse-worker.js.map +1 -0
  71. package/dist/parse/types.d.ts +49 -0
  72. package/dist/parse/types.d.ts.map +1 -0
  73. package/dist/parse/types.js +11 -0
  74. package/dist/parse/types.js.map +1 -0
  75. package/dist/parse/unified-queries.d.ts +37 -0
  76. package/dist/parse/unified-queries.d.ts.map +1 -0
  77. package/dist/parse/unified-queries.js +623 -0
  78. package/dist/parse/unified-queries.js.map +1 -0
  79. package/dist/parse/wasm-fallback.d.ts +88 -0
  80. package/dist/parse/wasm-fallback.d.ts.map +1 -0
  81. package/dist/parse/wasm-fallback.js +258 -0
  82. package/dist/parse/wasm-fallback.js.map +1 -0
  83. package/dist/parse/worker-pool.d.ts +48 -0
  84. package/dist/parse/worker-pool.d.ts.map +1 -0
  85. package/dist/parse/worker-pool.js +97 -0
  86. package/dist/parse/worker-pool.js.map +1 -0
  87. package/dist/pipeline/dep-parsers/go.d.ts +25 -0
  88. package/dist/pipeline/dep-parsers/go.d.ts.map +1 -0
  89. package/dist/pipeline/dep-parsers/go.js +146 -0
  90. package/dist/pipeline/dep-parsers/go.js.map +1 -0
  91. package/dist/pipeline/dep-parsers/index.d.ts +17 -0
  92. package/dist/pipeline/dep-parsers/index.d.ts.map +1 -0
  93. package/dist/pipeline/dep-parsers/index.js +16 -0
  94. package/dist/pipeline/dep-parsers/index.js.map +1 -0
  95. package/dist/pipeline/dep-parsers/maven.d.ts +24 -0
  96. package/dist/pipeline/dep-parsers/maven.d.ts.map +1 -0
  97. package/dist/pipeline/dep-parsers/maven.js +131 -0
  98. package/dist/pipeline/dep-parsers/maven.js.map +1 -0
  99. package/dist/pipeline/dep-parsers/npm.d.ts +30 -0
  100. package/dist/pipeline/dep-parsers/npm.d.ts.map +1 -0
  101. package/dist/pipeline/dep-parsers/npm.js +309 -0
  102. package/dist/pipeline/dep-parsers/npm.js.map +1 -0
  103. package/dist/pipeline/dep-parsers/nuget.d.ts +24 -0
  104. package/dist/pipeline/dep-parsers/nuget.d.ts.map +1 -0
  105. package/dist/pipeline/dep-parsers/nuget.js +178 -0
  106. package/dist/pipeline/dep-parsers/nuget.js.map +1 -0
  107. package/dist/pipeline/dep-parsers/python.d.ts +21 -0
  108. package/dist/pipeline/dep-parsers/python.d.ts.map +1 -0
  109. package/dist/pipeline/dep-parsers/python.js +369 -0
  110. package/dist/pipeline/dep-parsers/python.js.map +1 -0
  111. package/dist/pipeline/dep-parsers/rust.d.ts +18 -0
  112. package/dist/pipeline/dep-parsers/rust.d.ts.map +1 -0
  113. package/dist/pipeline/dep-parsers/rust.js +134 -0
  114. package/dist/pipeline/dep-parsers/rust.js.map +1 -0
  115. package/dist/pipeline/dep-parsers/spdx-normalize.d.ts +15 -0
  116. package/dist/pipeline/dep-parsers/spdx-normalize.d.ts.map +1 -0
  117. package/dist/pipeline/dep-parsers/spdx-normalize.js +31 -0
  118. package/dist/pipeline/dep-parsers/spdx-normalize.js.map +1 -0
  119. package/dist/pipeline/dep-parsers/types.d.ts +63 -0
  120. package/dist/pipeline/dep-parsers/types.d.ts.map +1 -0
  121. package/dist/pipeline/dep-parsers/types.js +56 -0
  122. package/dist/pipeline/dep-parsers/types.js.map +1 -0
  123. package/dist/pipeline/gitignore-stack.d.ts +44 -0
  124. package/dist/pipeline/gitignore-stack.d.ts.map +1 -0
  125. package/dist/pipeline/gitignore-stack.js +69 -0
  126. package/dist/pipeline/gitignore-stack.js.map +1 -0
  127. package/dist/pipeline/gitignore.d.ts +67 -0
  128. package/dist/pipeline/gitignore.d.ts.map +1 -0
  129. package/dist/pipeline/gitignore.js +210 -0
  130. package/dist/pipeline/gitignore.js.map +1 -0
  131. package/dist/pipeline/index.d.ts +53 -0
  132. package/dist/pipeline/index.d.ts.map +1 -0
  133. package/dist/pipeline/index.js +29 -0
  134. package/dist/pipeline/index.js.map +1 -0
  135. package/dist/pipeline/orchestrator.d.ts +105 -0
  136. package/dist/pipeline/orchestrator.d.ts.map +1 -0
  137. package/dist/pipeline/orchestrator.js +175 -0
  138. package/dist/pipeline/orchestrator.js.map +1 -0
  139. package/dist/pipeline/ownership-helpers/drift.d.ts +41 -0
  140. package/dist/pipeline/ownership-helpers/drift.d.ts.map +1 -0
  141. package/dist/pipeline/ownership-helpers/drift.js +122 -0
  142. package/dist/pipeline/ownership-helpers/drift.js.map +1 -0
  143. package/dist/pipeline/ownership-helpers/gini-community.d.ts +24 -0
  144. package/dist/pipeline/ownership-helpers/gini-community.d.ts.map +1 -0
  145. package/dist/pipeline/ownership-helpers/gini-community.js +32 -0
  146. package/dist/pipeline/ownership-helpers/gini-community.js.map +1 -0
  147. package/dist/pipeline/ownership-helpers/git-blame-batcher.d.ts +71 -0
  148. package/dist/pipeline/ownership-helpers/git-blame-batcher.d.ts.map +1 -0
  149. package/dist/pipeline/ownership-helpers/git-blame-batcher.js +178 -0
  150. package/dist/pipeline/ownership-helpers/git-blame-batcher.js.map +1 -0
  151. package/dist/pipeline/ownership-helpers/line-overlap.d.ts +35 -0
  152. package/dist/pipeline/ownership-helpers/line-overlap.d.ts.map +1 -0
  153. package/dist/pipeline/ownership-helpers/line-overlap.js +62 -0
  154. package/dist/pipeline/ownership-helpers/line-overlap.js.map +1 -0
  155. package/dist/pipeline/ownership-helpers/orphan.d.ts +73 -0
  156. package/dist/pipeline/ownership-helpers/orphan.d.ts.map +1 -0
  157. package/dist/pipeline/ownership-helpers/orphan.js +117 -0
  158. package/dist/pipeline/ownership-helpers/orphan.js.map +1 -0
  159. package/dist/pipeline/phases/accesses.d.ts +44 -0
  160. package/dist/pipeline/phases/accesses.d.ts.map +1 -0
  161. package/dist/pipeline/phases/accesses.js +194 -0
  162. package/dist/pipeline/phases/accesses.js.map +1 -0
  163. package/dist/pipeline/phases/annotate.d.ts +28 -0
  164. package/dist/pipeline/phases/annotate.d.ts.map +1 -0
  165. package/dist/pipeline/phases/annotate.js +60 -0
  166. package/dist/pipeline/phases/annotate.js.map +1 -0
  167. package/dist/pipeline/phases/cochange.d.ts +42 -0
  168. package/dist/pipeline/phases/cochange.d.ts.map +1 -0
  169. package/dist/pipeline/phases/cochange.js +0 -0
  170. package/dist/pipeline/phases/cochange.js.map +1 -0
  171. package/dist/pipeline/phases/communities.d.ts +34 -0
  172. package/dist/pipeline/phases/communities.d.ts.map +1 -0
  173. package/dist/pipeline/phases/communities.js +412 -0
  174. package/dist/pipeline/phases/communities.js.map +1 -0
  175. package/dist/pipeline/phases/complexity.d.ts +50 -0
  176. package/dist/pipeline/phases/complexity.d.ts.map +1 -0
  177. package/dist/pipeline/phases/complexity.js +794 -0
  178. package/dist/pipeline/phases/complexity.js.map +1 -0
  179. package/dist/pipeline/phases/confidence-demote.d.ts +23 -0
  180. package/dist/pipeline/phases/confidence-demote.d.ts.map +1 -0
  181. package/dist/pipeline/phases/confidence-demote.js +113 -0
  182. package/dist/pipeline/phases/confidence-demote.js.map +1 -0
  183. package/dist/pipeline/phases/content-cache.d.ts +166 -0
  184. package/dist/pipeline/phases/content-cache.d.ts.map +1 -0
  185. package/dist/pipeline/phases/content-cache.js +323 -0
  186. package/dist/pipeline/phases/content-cache.js.map +1 -0
  187. package/dist/pipeline/phases/coverage-parsers/cobertura.d.ts +25 -0
  188. package/dist/pipeline/phases/coverage-parsers/cobertura.d.ts.map +1 -0
  189. package/dist/pipeline/phases/coverage-parsers/cobertura.js +139 -0
  190. package/dist/pipeline/phases/coverage-parsers/cobertura.js.map +1 -0
  191. package/dist/pipeline/phases/coverage-parsers/coverage-py.d.ts +25 -0
  192. package/dist/pipeline/phases/coverage-parsers/coverage-py.d.ts.map +1 -0
  193. package/dist/pipeline/phases/coverage-parsers/coverage-py.js +51 -0
  194. package/dist/pipeline/phases/coverage-parsers/coverage-py.js.map +1 -0
  195. package/dist/pipeline/phases/coverage-parsers/jacoco.d.ts +32 -0
  196. package/dist/pipeline/phases/coverage-parsers/jacoco.d.ts.map +1 -0
  197. package/dist/pipeline/phases/coverage-parsers/jacoco.js +98 -0
  198. package/dist/pipeline/phases/coverage-parsers/jacoco.js.map +1 -0
  199. package/dist/pipeline/phases/coverage-parsers/lcov.d.ts +21 -0
  200. package/dist/pipeline/phases/coverage-parsers/lcov.d.ts.map +1 -0
  201. package/dist/pipeline/phases/coverage-parsers/lcov.js +104 -0
  202. package/dist/pipeline/phases/coverage-parsers/lcov.js.map +1 -0
  203. package/dist/pipeline/phases/coverage-parsers/types.d.ts +27 -0
  204. package/dist/pipeline/phases/coverage-parsers/types.d.ts.map +1 -0
  205. package/dist/pipeline/phases/coverage-parsers/types.js +39 -0
  206. package/dist/pipeline/phases/coverage-parsers/types.js.map +1 -0
  207. package/dist/pipeline/phases/coverage.d.ts +39 -0
  208. package/dist/pipeline/phases/coverage.d.ts.map +1 -0
  209. package/dist/pipeline/phases/coverage.js +154 -0
  210. package/dist/pipeline/phases/coverage.js.map +1 -0
  211. package/dist/pipeline/phases/cross-file.d.ts +40 -0
  212. package/dist/pipeline/phases/cross-file.d.ts.map +1 -0
  213. package/dist/pipeline/phases/cross-file.js +411 -0
  214. package/dist/pipeline/phases/cross-file.js.map +1 -0
  215. package/dist/pipeline/phases/dead-code.d.ts +28 -0
  216. package/dist/pipeline/phases/dead-code.d.ts.map +1 -0
  217. package/dist/pipeline/phases/dead-code.js +157 -0
  218. package/dist/pipeline/phases/dead-code.js.map +1 -0
  219. package/dist/pipeline/phases/default-set.d.ts +24 -0
  220. package/dist/pipeline/phases/default-set.d.ts.map +1 -0
  221. package/dist/pipeline/phases/default-set.js +133 -0
  222. package/dist/pipeline/phases/default-set.js.map +1 -0
  223. package/dist/pipeline/phases/dependencies.d.ts +59 -0
  224. package/dist/pipeline/phases/dependencies.d.ts.map +1 -0
  225. package/dist/pipeline/phases/dependencies.js +281 -0
  226. package/dist/pipeline/phases/dependencies.js.map +1 -0
  227. package/dist/pipeline/phases/embedder-pool.d.ts +31 -0
  228. package/dist/pipeline/phases/embedder-pool.d.ts.map +1 -0
  229. package/dist/pipeline/phases/embedder-pool.js +79 -0
  230. package/dist/pipeline/phases/embedder-pool.js.map +1 -0
  231. package/dist/pipeline/phases/embedder-worker.d.ts +28 -0
  232. package/dist/pipeline/phases/embedder-worker.d.ts.map +1 -0
  233. package/dist/pipeline/phases/embedder-worker.js +43 -0
  234. package/dist/pipeline/phases/embedder-worker.js.map +1 -0
  235. package/dist/pipeline/phases/embeddings.d.ts +117 -0
  236. package/dist/pipeline/phases/embeddings.d.ts.map +1 -0
  237. package/dist/pipeline/phases/embeddings.js +697 -0
  238. package/dist/pipeline/phases/embeddings.js.map +1 -0
  239. package/dist/pipeline/phases/fetches.d.ts +47 -0
  240. package/dist/pipeline/phases/fetches.d.ts.map +1 -0
  241. package/dist/pipeline/phases/fetches.js +207 -0
  242. package/dist/pipeline/phases/fetches.js.map +1 -0
  243. package/dist/pipeline/phases/incremental-helper.d.ts +96 -0
  244. package/dist/pipeline/phases/incremental-helper.d.ts.map +1 -0
  245. package/dist/pipeline/phases/incremental-helper.js +125 -0
  246. package/dist/pipeline/phases/incremental-helper.js.map +1 -0
  247. package/dist/pipeline/phases/incremental-scope.d.ts +67 -0
  248. package/dist/pipeline/phases/incremental-scope.d.ts.map +1 -0
  249. package/dist/pipeline/phases/incremental-scope.js +225 -0
  250. package/dist/pipeline/phases/incremental-scope.js.map +1 -0
  251. package/dist/pipeline/phases/markdown.d.ts +29 -0
  252. package/dist/pipeline/phases/markdown.d.ts.map +1 -0
  253. package/dist/pipeline/phases/markdown.js +298 -0
  254. package/dist/pipeline/phases/markdown.js.map +1 -0
  255. package/dist/pipeline/phases/mro.d.ts +24 -0
  256. package/dist/pipeline/phases/mro.d.ts.map +1 -0
  257. package/dist/pipeline/phases/mro.js +303 -0
  258. package/dist/pipeline/phases/mro.js.map +1 -0
  259. package/dist/pipeline/phases/openapi.d.ts +52 -0
  260. package/dist/pipeline/phases/openapi.d.ts.map +1 -0
  261. package/dist/pipeline/phases/openapi.js +285 -0
  262. package/dist/pipeline/phases/openapi.js.map +1 -0
  263. package/dist/pipeline/phases/orm.d.ts +26 -0
  264. package/dist/pipeline/phases/orm.d.ts.map +1 -0
  265. package/dist/pipeline/phases/orm.js +183 -0
  266. package/dist/pipeline/phases/orm.js.map +1 -0
  267. package/dist/pipeline/phases/ownership.d.ts +88 -0
  268. package/dist/pipeline/phases/ownership.d.ts.map +1 -0
  269. package/dist/pipeline/phases/ownership.js +479 -0
  270. package/dist/pipeline/phases/ownership.js.map +1 -0
  271. package/dist/pipeline/phases/parse.d.ts +63 -0
  272. package/dist/pipeline/phases/parse.d.ts.map +1 -0
  273. package/dist/pipeline/phases/parse.js +994 -0
  274. package/dist/pipeline/phases/parse.js.map +1 -0
  275. package/dist/pipeline/phases/processes.d.ts +47 -0
  276. package/dist/pipeline/phases/processes.d.ts.map +1 -0
  277. package/dist/pipeline/phases/processes.js +620 -0
  278. package/dist/pipeline/phases/processes.js.map +1 -0
  279. package/dist/pipeline/phases/profile.d.ts +33 -0
  280. package/dist/pipeline/phases/profile.d.ts.map +1 -0
  281. package/dist/pipeline/phases/profile.js +91 -0
  282. package/dist/pipeline/phases/profile.js.map +1 -0
  283. package/dist/pipeline/phases/repo-node.d.ts +112 -0
  284. package/dist/pipeline/phases/repo-node.d.ts.map +1 -0
  285. package/dist/pipeline/phases/repo-node.js +272 -0
  286. package/dist/pipeline/phases/repo-node.js.map +1 -0
  287. package/dist/pipeline/phases/risk-snapshot.d.ts +34 -0
  288. package/dist/pipeline/phases/risk-snapshot.d.ts.map +1 -0
  289. package/dist/pipeline/phases/risk-snapshot.js +63 -0
  290. package/dist/pipeline/phases/risk-snapshot.js.map +1 -0
  291. package/dist/pipeline/phases/routes.d.ts +31 -0
  292. package/dist/pipeline/phases/routes.d.ts.map +1 -0
  293. package/dist/pipeline/phases/routes.js +262 -0
  294. package/dist/pipeline/phases/routes.js.map +1 -0
  295. package/dist/pipeline/phases/sbom.d.ts +45 -0
  296. package/dist/pipeline/phases/sbom.d.ts.map +1 -0
  297. package/dist/pipeline/phases/sbom.js +289 -0
  298. package/dist/pipeline/phases/sbom.js.map +1 -0
  299. package/dist/pipeline/phases/scan.d.ts +54 -0
  300. package/dist/pipeline/phases/scan.d.ts.map +1 -0
  301. package/dist/pipeline/phases/scan.js +340 -0
  302. package/dist/pipeline/phases/scan.js.map +1 -0
  303. package/dist/pipeline/phases/scip-index.d.ts +54 -0
  304. package/dist/pipeline/phases/scip-index.d.ts.map +1 -0
  305. package/dist/pipeline/phases/scip-index.js +469 -0
  306. package/dist/pipeline/phases/scip-index.js.map +1 -0
  307. package/dist/pipeline/phases/structure.d.ts +21 -0
  308. package/dist/pipeline/phases/structure.d.ts.map +1 -0
  309. package/dist/pipeline/phases/structure.js +115 -0
  310. package/dist/pipeline/phases/structure.js.map +1 -0
  311. package/dist/pipeline/phases/summarize.d.ts +126 -0
  312. package/dist/pipeline/phases/summarize.d.ts.map +1 -0
  313. package/dist/pipeline/phases/summarize.js +401 -0
  314. package/dist/pipeline/phases/summarize.js.map +1 -0
  315. package/dist/pipeline/phases/temporal-helpers/branch-divergence.d.ts +42 -0
  316. package/dist/pipeline/phases/temporal-helpers/branch-divergence.d.ts.map +1 -0
  317. package/dist/pipeline/phases/temporal-helpers/branch-divergence.js +96 -0
  318. package/dist/pipeline/phases/temporal-helpers/branch-divergence.js.map +1 -0
  319. package/dist/pipeline/phases/temporal-helpers/churn-decay.d.ts +22 -0
  320. package/dist/pipeline/phases/temporal-helpers/churn-decay.d.ts.map +1 -0
  321. package/dist/pipeline/phases/temporal-helpers/churn-decay.js +32 -0
  322. package/dist/pipeline/phases/temporal-helpers/churn-decay.js.map +1 -0
  323. package/dist/pipeline/phases/temporal-helpers/conventional-commits.d.ts +21 -0
  324. package/dist/pipeline/phases/temporal-helpers/conventional-commits.d.ts.map +1 -0
  325. package/dist/pipeline/phases/temporal-helpers/conventional-commits.js +37 -0
  326. package/dist/pipeline/phases/temporal-helpers/conventional-commits.js.map +1 -0
  327. package/dist/pipeline/phases/temporal-helpers/gini.d.ts +32 -0
  328. package/dist/pipeline/phases/temporal-helpers/gini.d.ts.map +1 -0
  329. package/dist/pipeline/phases/temporal-helpers/gini.js +78 -0
  330. package/dist/pipeline/phases/temporal-helpers/gini.js.map +1 -0
  331. package/dist/pipeline/phases/temporal-helpers/revert-detect.d.ts +14 -0
  332. package/dist/pipeline/phases/temporal-helpers/revert-detect.d.ts.map +1 -0
  333. package/dist/pipeline/phases/temporal-helpers/revert-detect.js +25 -0
  334. package/dist/pipeline/phases/temporal-helpers/revert-detect.js.map +1 -0
  335. package/dist/pipeline/phases/temporal-helpers/test-pair.d.ts +18 -0
  336. package/dist/pipeline/phases/temporal-helpers/test-pair.d.ts.map +1 -0
  337. package/dist/pipeline/phases/temporal-helpers/test-pair.js +119 -0
  338. package/dist/pipeline/phases/temporal-helpers/test-pair.js.map +1 -0
  339. package/dist/pipeline/phases/temporal.d.ts +65 -0
  340. package/dist/pipeline/phases/temporal.d.ts.map +1 -0
  341. package/dist/pipeline/phases/temporal.js +621 -0
  342. package/dist/pipeline/phases/temporal.js.map +1 -0
  343. package/dist/pipeline/phases/tools.d.ts +21 -0
  344. package/dist/pipeline/phases/tools.d.ts.map +1 -0
  345. package/dist/pipeline/phases/tools.js +118 -0
  346. package/dist/pipeline/phases/tools.js.map +1 -0
  347. package/dist/pipeline/profile-detectors/api-contracts.d.ts +18 -0
  348. package/dist/pipeline/profile-detectors/api-contracts.d.ts.map +1 -0
  349. package/dist/pipeline/profile-detectors/api-contracts.js +78 -0
  350. package/dist/pipeline/profile-detectors/api-contracts.js.map +1 -0
  351. package/dist/pipeline/profile-detectors/framework-detector.d.ts +11 -0
  352. package/dist/pipeline/profile-detectors/framework-detector.d.ts.map +1 -0
  353. package/dist/pipeline/profile-detectors/framework-detector.js +11 -0
  354. package/dist/pipeline/profile-detectors/framework-detector.js.map +1 -0
  355. package/dist/pipeline/profile-detectors/frameworks-catalog.d.ts +7 -0
  356. package/dist/pipeline/profile-detectors/frameworks-catalog.d.ts.map +1 -0
  357. package/dist/pipeline/profile-detectors/frameworks-catalog.js +7 -0
  358. package/dist/pipeline/profile-detectors/frameworks-catalog.js.map +1 -0
  359. package/dist/pipeline/profile-detectors/frameworks.d.ts +7 -0
  360. package/dist/pipeline/profile-detectors/frameworks.d.ts.map +1 -0
  361. package/dist/pipeline/profile-detectors/frameworks.js +7 -0
  362. package/dist/pipeline/profile-detectors/frameworks.js.map +1 -0
  363. package/dist/pipeline/profile-detectors/iac.d.ts +22 -0
  364. package/dist/pipeline/profile-detectors/iac.d.ts.map +1 -0
  365. package/dist/pipeline/profile-detectors/iac.js +97 -0
  366. package/dist/pipeline/profile-detectors/iac.js.map +1 -0
  367. package/dist/pipeline/profile-detectors/languages.d.ts +18 -0
  368. package/dist/pipeline/profile-detectors/languages.d.ts.map +1 -0
  369. package/dist/pipeline/profile-detectors/languages.js +60 -0
  370. package/dist/pipeline/profile-detectors/languages.js.map +1 -0
  371. package/dist/pipeline/profile-detectors/manifests.d.ts +7 -0
  372. package/dist/pipeline/profile-detectors/manifests.d.ts.map +1 -0
  373. package/dist/pipeline/profile-detectors/manifests.js +7 -0
  374. package/dist/pipeline/profile-detectors/manifests.js.map +1 -0
  375. package/dist/pipeline/profile-detectors/src-dirs.d.ts +17 -0
  376. package/dist/pipeline/profile-detectors/src-dirs.d.ts.map +1 -0
  377. package/dist/pipeline/profile-detectors/src-dirs.js +89 -0
  378. package/dist/pipeline/profile-detectors/src-dirs.js.map +1 -0
  379. package/dist/pipeline/profile-detectors/variant-detectors.d.ts +7 -0
  380. package/dist/pipeline/profile-detectors/variant-detectors.d.ts.map +1 -0
  381. package/dist/pipeline/profile-detectors/variant-detectors.js +7 -0
  382. package/dist/pipeline/profile-detectors/variant-detectors.js.map +1 -0
  383. package/dist/pipeline/runner.d.ts +54 -0
  384. package/dist/pipeline/runner.d.ts.map +1 -0
  385. package/dist/pipeline/runner.js +247 -0
  386. package/dist/pipeline/runner.js.map +1 -0
  387. package/dist/pipeline/types.d.ts +235 -0
  388. package/dist/pipeline/types.d.ts.map +1 -0
  389. package/dist/pipeline/types.js +15 -0
  390. package/dist/pipeline/types.js.map +1 -0
  391. package/dist/providers/c.d.ts +3 -0
  392. package/dist/providers/c.d.ts.map +1 -0
  393. package/dist/providers/c.js +162 -0
  394. package/dist/providers/c.js.map +1 -0
  395. package/dist/providers/cobol.d.ts +19 -0
  396. package/dist/providers/cobol.d.ts.map +1 -0
  397. package/dist/providers/cobol.js +44 -0
  398. package/dist/providers/cobol.js.map +1 -0
  399. package/dist/providers/cpp.d.ts +3 -0
  400. package/dist/providers/cpp.d.ts.map +1 -0
  401. package/dist/providers/cpp.js +200 -0
  402. package/dist/providers/cpp.js.map +1 -0
  403. package/dist/providers/csharp.d.ts +3 -0
  404. package/dist/providers/csharp.d.ts.map +1 -0
  405. package/dist/providers/csharp.js +292 -0
  406. package/dist/providers/csharp.js.map +1 -0
  407. package/dist/providers/dart.d.ts +3 -0
  408. package/dist/providers/dart.d.ts.map +1 -0
  409. package/dist/providers/dart.js +214 -0
  410. package/dist/providers/dart.js.map +1 -0
  411. package/dist/providers/definition-ids.d.ts +18 -0
  412. package/dist/providers/definition-ids.d.ts.map +1 -0
  413. package/dist/providers/definition-ids.js +23 -0
  414. package/dist/providers/definition-ids.js.map +1 -0
  415. package/dist/providers/extract-helpers.d.ts +60 -0
  416. package/dist/providers/extract-helpers.d.ts.map +1 -0
  417. package/dist/providers/extract-helpers.js +296 -0
  418. package/dist/providers/extract-helpers.js.map +1 -0
  419. package/dist/providers/extraction-types.d.ts +85 -0
  420. package/dist/providers/extraction-types.d.ts.map +1 -0
  421. package/dist/providers/extraction-types.js +13 -0
  422. package/dist/providers/extraction-types.js.map +1 -0
  423. package/dist/providers/go.d.ts +3 -0
  424. package/dist/providers/go.d.ts.map +1 -0
  425. package/dist/providers/go.js +359 -0
  426. package/dist/providers/go.js.map +1 -0
  427. package/dist/providers/http-detect.d.ts +44 -0
  428. package/dist/providers/http-detect.d.ts.map +1 -0
  429. package/dist/providers/http-detect.js +307 -0
  430. package/dist/providers/http-detect.js.map +1 -0
  431. package/dist/providers/index.d.ts +38 -0
  432. package/dist/providers/index.d.ts.map +1 -0
  433. package/dist/providers/index.js +33 -0
  434. package/dist/providers/index.js.map +1 -0
  435. package/dist/providers/java.d.ts +3 -0
  436. package/dist/providers/java.d.ts.map +1 -0
  437. package/dist/providers/java.js +259 -0
  438. package/dist/providers/java.js.map +1 -0
  439. package/dist/providers/javascript.d.ts +3 -0
  440. package/dist/providers/javascript.d.ts.map +1 -0
  441. package/dist/providers/javascript.js +139 -0
  442. package/dist/providers/javascript.js.map +1 -0
  443. package/dist/providers/kotlin.d.ts +3 -0
  444. package/dist/providers/kotlin.d.ts.map +1 -0
  445. package/dist/providers/kotlin.js +175 -0
  446. package/dist/providers/kotlin.js.map +1 -0
  447. package/dist/providers/php.d.ts +3 -0
  448. package/dist/providers/php.d.ts.map +1 -0
  449. package/dist/providers/php.js +218 -0
  450. package/dist/providers/php.js.map +1 -0
  451. package/dist/providers/python-accesses.d.ts +9 -0
  452. package/dist/providers/python-accesses.d.ts.map +1 -0
  453. package/dist/providers/python-accesses.js +22 -0
  454. package/dist/providers/python-accesses.js.map +1 -0
  455. package/dist/providers/python.d.ts +3 -0
  456. package/dist/providers/python.d.ts.map +1 -0
  457. package/dist/providers/python.js +323 -0
  458. package/dist/providers/python.js.map +1 -0
  459. package/dist/providers/registry.d.ts +4 -0
  460. package/dist/providers/registry.d.ts.map +1 -0
  461. package/dist/providers/registry.js +46 -0
  462. package/dist/providers/registry.js.map +1 -0
  463. package/dist/providers/resolution/c3.d.ts +6 -0
  464. package/dist/providers/resolution/c3.d.ts.map +1 -0
  465. package/dist/providers/resolution/c3.js +76 -0
  466. package/dist/providers/resolution/c3.js.map +1 -0
  467. package/dist/providers/resolution/context.d.ts +38 -0
  468. package/dist/providers/resolution/context.d.ts.map +1 -0
  469. package/dist/providers/resolution/context.js +45 -0
  470. package/dist/providers/resolution/context.js.map +1 -0
  471. package/dist/providers/resolution/first-wins.d.ts +3 -0
  472. package/dist/providers/resolution/first-wins.d.ts.map +1 -0
  473. package/dist/providers/resolution/first-wins.js +27 -0
  474. package/dist/providers/resolution/first-wins.js.map +1 -0
  475. package/dist/providers/resolution/mro.d.ts +16 -0
  476. package/dist/providers/resolution/mro.d.ts.map +1 -0
  477. package/dist/providers/resolution/mro.js +14 -0
  478. package/dist/providers/resolution/mro.js.map +1 -0
  479. package/dist/providers/resolution/none.d.ts +3 -0
  480. package/dist/providers/resolution/none.d.ts.map +1 -0
  481. package/dist/providers/resolution/none.js +11 -0
  482. package/dist/providers/resolution/none.js.map +1 -0
  483. package/dist/providers/resolution/python-all-filter.d.ts +25 -0
  484. package/dist/providers/resolution/python-all-filter.d.ts.map +1 -0
  485. package/dist/providers/resolution/python-all-filter.js +64 -0
  486. package/dist/providers/resolution/python-all-filter.js.map +1 -0
  487. package/dist/providers/resolution/resolver-strategy.d.ts +42 -0
  488. package/dist/providers/resolution/resolver-strategy.d.ts.map +1 -0
  489. package/dist/providers/resolution/resolver-strategy.js +50 -0
  490. package/dist/providers/resolution/resolver-strategy.js.map +1 -0
  491. package/dist/providers/resolution/single-inheritance.d.ts +3 -0
  492. package/dist/providers/resolution/single-inheritance.d.ts.map +1 -0
  493. package/dist/providers/resolution/single-inheritance.js +21 -0
  494. package/dist/providers/resolution/single-inheritance.js.map +1 -0
  495. package/dist/providers/resolution/stack-graphs/__fixtures__/mock-tree.d.ts +16 -0
  496. package/dist/providers/resolution/stack-graphs/__fixtures__/mock-tree.d.ts.map +1 -0
  497. package/dist/providers/resolution/stack-graphs/__fixtures__/mock-tree.js +50 -0
  498. package/dist/providers/resolution/stack-graphs/__fixtures__/mock-tree.js.map +1 -0
  499. package/dist/providers/resolution/stack-graphs/glue.d.ts +15 -0
  500. package/dist/providers/resolution/stack-graphs/glue.d.ts.map +1 -0
  501. package/dist/providers/resolution/stack-graphs/glue.js +44 -0
  502. package/dist/providers/resolution/stack-graphs/glue.js.map +1 -0
  503. package/dist/providers/resolution/stack-graphs/node-edge-builder.d.ts +30 -0
  504. package/dist/providers/resolution/stack-graphs/node-edge-builder.d.ts.map +1 -0
  505. package/dist/providers/resolution/stack-graphs/node-edge-builder.js +366 -0
  506. package/dist/providers/resolution/stack-graphs/node-edge-builder.js.map +1 -0
  507. package/dist/providers/resolution/stack-graphs/partial-path-engine.d.ts +9 -0
  508. package/dist/providers/resolution/stack-graphs/partial-path-engine.d.ts.map +1 -0
  509. package/dist/providers/resolution/stack-graphs/partial-path-engine.js +152 -0
  510. package/dist/providers/resolution/stack-graphs/partial-path-engine.js.map +1 -0
  511. package/dist/providers/resolution/stack-graphs/rule-parser.d.ts +11 -0
  512. package/dist/providers/resolution/stack-graphs/rule-parser.d.ts.map +1 -0
  513. package/dist/providers/resolution/stack-graphs/rule-parser.js +247 -0
  514. package/dist/providers/resolution/stack-graphs/rule-parser.js.map +1 -0
  515. package/dist/providers/resolution/stack-graphs/types.d.ts +93 -0
  516. package/dist/providers/resolution/stack-graphs/types.d.ts.map +1 -0
  517. package/dist/providers/resolution/stack-graphs/types.js +11 -0
  518. package/dist/providers/resolution/stack-graphs/types.js.map +1 -0
  519. package/dist/providers/resolution/stack-graphs-python.d.ts +27 -0
  520. package/dist/providers/resolution/stack-graphs-python.d.ts.map +1 -0
  521. package/dist/providers/resolution/stack-graphs-python.js +104 -0
  522. package/dist/providers/resolution/stack-graphs-python.js.map +1 -0
  523. package/dist/providers/resolution/stack-graphs-ts.d.ts +134 -0
  524. package/dist/providers/resolution/stack-graphs-ts.d.ts.map +1 -0
  525. package/dist/providers/resolution/stack-graphs-ts.js +372 -0
  526. package/dist/providers/resolution/stack-graphs-ts.js.map +1 -0
  527. package/dist/providers/ruby.d.ts +3 -0
  528. package/dist/providers/ruby.d.ts.map +1 -0
  529. package/dist/providers/ruby.js +259 -0
  530. package/dist/providers/ruby.js.map +1 -0
  531. package/dist/providers/rust.d.ts +3 -0
  532. package/dist/providers/rust.d.ts.map +1 -0
  533. package/dist/providers/rust.js +318 -0
  534. package/dist/providers/rust.js.map +1 -0
  535. package/dist/providers/swift.d.ts +3 -0
  536. package/dist/providers/swift.d.ts.map +1 -0
  537. package/dist/providers/swift.js +177 -0
  538. package/dist/providers/swift.js.map +1 -0
  539. package/dist/providers/test-helpers.d.ts +24 -0
  540. package/dist/providers/test-helpers.d.ts.map +1 -0
  541. package/dist/providers/test-helpers.js +33 -0
  542. package/dist/providers/test-helpers.js.map +1 -0
  543. package/dist/providers/ts-shared.d.ts +30 -0
  544. package/dist/providers/ts-shared.d.ts.map +1 -0
  545. package/dist/providers/ts-shared.js +328 -0
  546. package/dist/providers/ts-shared.js.map +1 -0
  547. package/dist/providers/tsx.d.ts +7 -0
  548. package/dist/providers/tsx.d.ts.map +1 -0
  549. package/dist/providers/tsx.js +79 -0
  550. package/dist/providers/tsx.js.map +1 -0
  551. package/dist/providers/types.d.ts +166 -0
  552. package/dist/providers/types.d.ts.map +1 -0
  553. package/dist/providers/types.js +7 -0
  554. package/dist/providers/types.js.map +1 -0
  555. package/dist/providers/typescript-family-accesses.d.ts +14 -0
  556. package/dist/providers/typescript-family-accesses.d.ts.map +1 -0
  557. package/dist/providers/typescript-family-accesses.js +27 -0
  558. package/dist/providers/typescript-family-accesses.js.map +1 -0
  559. package/dist/providers/typescript.d.ts +9 -0
  560. package/dist/providers/typescript.d.ts.map +1 -0
  561. package/dist/providers/typescript.js +84 -0
  562. package/dist/providers/typescript.js.map +1 -0
  563. package/package.json +108 -0
@@ -0,0 +1,16 @@
1
+ import type { MroStrategyName } from "../types.js";
2
+ /**
3
+ * A linearization strategy for a class's method resolution order.
4
+ *
5
+ * @param classId The id of the class being linearized.
6
+ * @param bases Direct base class ids in source order.
7
+ * @param baseLinearizations Lookup function returning a previously computed
8
+ * linearization for any base id. Strategies that do
9
+ * not recurse (e.g. `none`) may ignore it.
10
+ */
11
+ export interface MroStrategy {
12
+ readonly name: MroStrategyName;
13
+ linearize(classId: string, bases: readonly string[], baseLinearizations: (id: string) => readonly string[]): readonly string[];
14
+ }
15
+ export declare function getMroStrategy(name: MroStrategyName): MroStrategy;
16
+ //# sourceMappingURL=mro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mro.d.ts","sourceRoot":"","sources":["../../../src/providers/resolution/mro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAMnD;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,SAAS,CACP,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GACpD,SAAS,MAAM,EAAE,CAAC;CACtB;AASD,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,WAAW,CAEjE"}
@@ -0,0 +1,14 @@
1
+ import { c3Strategy } from "./c3.js";
2
+ import { firstWinsStrategy } from "./first-wins.js";
3
+ import { noneStrategy } from "./none.js";
4
+ import { singleInheritanceStrategy } from "./single-inheritance.js";
5
+ const STRATEGIES = {
6
+ c3: c3Strategy,
7
+ "first-wins": firstWinsStrategy,
8
+ "single-inheritance": singleInheritanceStrategy,
9
+ none: noneStrategy,
10
+ };
11
+ export function getMroStrategy(name) {
12
+ return STRATEGIES[name];
13
+ }
14
+ //# sourceMappingURL=mro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mro.js","sourceRoot":"","sources":["../../../src/providers/resolution/mro.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAoBpE,MAAM,UAAU,GAAmD;IACjE,EAAE,EAAE,UAAU;IACd,YAAY,EAAE,iBAAiB;IAC/B,oBAAoB,EAAE,yBAAyB;IAC/C,IAAI,EAAE,YAAY;CACnB,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,IAAqB;IAClD,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { MroStrategy } from "./mro.js";
2
+ export declare const noneStrategy: MroStrategy;
3
+ //# sourceMappingURL=none.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"none.d.ts","sourceRoot":"","sources":["../../../src/providers/resolution/none.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAQ5C,eAAO,MAAM,YAAY,EAAE,WAG1B,CAAC"}
@@ -0,0 +1,11 @@
1
+ // No-op linearization. Used by languages without classical inheritance
2
+ // (Go — struct embedding is not MRO-shaped). Returns the class itself.
3
+ function linearize(classId) {
4
+ return [classId];
5
+ }
6
+ const NAME = "none";
7
+ export const noneStrategy = {
8
+ name: NAME,
9
+ linearize,
10
+ };
11
+ //# sourceMappingURL=none.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"none.js","sourceRoot":"","sources":["../../../src/providers/resolution/none.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,uEAAuE;AAKvE,SAAS,SAAS,CAAC,OAAe;IAChC,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,IAAI,GAAoB,MAAM,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,IAAI,EAAE,IAAI;IACV,SAAS;CACV,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { ResolutionCandidate } from "./context.js";
2
+ /**
3
+ * Parse `__all__ = [...]` from a Python source string.
4
+ *
5
+ * Supports three syntactic forms in common use:
6
+ * __all__ = ["a", "b"]
7
+ * __all__ = ('a', 'b')
8
+ * __all__ = ["a", "b",] # trailing comma
9
+ *
10
+ * Returns `null` when no recognisable declaration exists, which the
11
+ * caller treats as "filter is disabled".
12
+ */
13
+ export declare function parsePythonAll(source: string): readonly string[] | null;
14
+ /**
15
+ * Filter resolution candidates against a target module's `__all__` list.
16
+ *
17
+ * `targetModuleInitPath` is an absolute path to the module's `__init__.py`
18
+ * (or the module file itself). If the file can't be read we pass candidates
19
+ * through — degradation is strictly friendlier than rejection.
20
+ *
21
+ * `candidateName` is the bare Python identifier being imported (already
22
+ * stripped of any `module.` prefix).
23
+ */
24
+ export declare function filterByPythonAll(candidates: readonly ResolutionCandidate[], targetModuleInitPath: string, candidateName: string): readonly ResolutionCandidate[];
25
+ //# sourceMappingURL=python-all-filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-all-filter.d.ts","sourceRoot":"","sources":["../../../src/providers/resolution/python-all-filter.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,CAgBvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,mBAAmB,EAAE,EAC1C,oBAAoB,EAAE,MAAM,EAC5B,aAAa,EAAE,MAAM,GACpB,SAAS,mBAAmB,EAAE,CAWhC"}
@@ -0,0 +1,64 @@
1
+ // __all__ post-processor for wildcard Python imports.
2
+ //
3
+ // Upstream stack-graphs does not honour `__all__` lists; its edge model
4
+ // makes every top-level def reachable from a wildcard import. When a
5
+ // resolution candidate comes in via a wildcard path and the target
6
+ // module has an `__all__` declaration, we filter candidates down to the
7
+ // listed names only. If no `__all__` is declared we pass everything through.
8
+ import { readFileSync } from "node:fs";
9
+ /**
10
+ * Parse `__all__ = [...]` from a Python source string.
11
+ *
12
+ * Supports three syntactic forms in common use:
13
+ * __all__ = ["a", "b"]
14
+ * __all__ = ('a', 'b')
15
+ * __all__ = ["a", "b",] # trailing comma
16
+ *
17
+ * Returns `null` when no recognisable declaration exists, which the
18
+ * caller treats as "filter is disabled".
19
+ */
20
+ export function parsePythonAll(source) {
21
+ // Regex matches the right-hand-side list/tuple literal. We accept single
22
+ // or double-quoted string entries; bare identifiers and f-strings are
23
+ // deliberately ignored — they aren't part of the idiomatic pattern.
24
+ const m = /__all__\s*=\s*[[(]([\s\S]*?)[\])]/m.exec(source);
25
+ if (m === null)
26
+ return null;
27
+ const body = m[1] ?? "";
28
+ const names = [];
29
+ const item = /['"]([A-Za-z_][\w]*)['"]/g;
30
+ let match = item.exec(body);
31
+ while (match !== null) {
32
+ const name = match[1];
33
+ if (name !== undefined)
34
+ names.push(name);
35
+ match = item.exec(body);
36
+ }
37
+ return names;
38
+ }
39
+ /**
40
+ * Filter resolution candidates against a target module's `__all__` list.
41
+ *
42
+ * `targetModuleInitPath` is an absolute path to the module's `__init__.py`
43
+ * (or the module file itself). If the file can't be read we pass candidates
44
+ * through — degradation is strictly friendlier than rejection.
45
+ *
46
+ * `candidateName` is the bare Python identifier being imported (already
47
+ * stripped of any `module.` prefix).
48
+ */
49
+ export function filterByPythonAll(candidates, targetModuleInitPath, candidateName) {
50
+ let source;
51
+ try {
52
+ source = readFileSync(targetModuleInitPath, "utf8");
53
+ }
54
+ catch {
55
+ return candidates;
56
+ }
57
+ const allowed = parsePythonAll(source);
58
+ if (allowed === null)
59
+ return candidates;
60
+ if (!allowed.includes(candidateName))
61
+ return [];
62
+ return candidates;
63
+ }
64
+ //# sourceMappingURL=python-all-filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-all-filter.js","sourceRoot":"","sources":["../../../src/providers/resolution/python-all-filter.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,mEAAmE;AACnE,wEAAwE;AACxE,6EAA6E;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,yEAAyE;IACzE,sEAAsE;IACtE,oEAAoE;IACpE,MAAM,CAAC,GAAG,oCAAoC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5D,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC5B,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACxB,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,2BAA2B,CAAC;IACzC,IAAI,KAAK,GAA2B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,OAAO,KAAK,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,IAAI,KAAK,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA0C,EAC1C,oBAA4B,EAC5B,aAAqB;IAErB,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,GAAG,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IACtD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,UAAU,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;QAAE,OAAO,EAAE,CAAC;IAChD,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { LanguageProvider } from "../types.js";
2
+ import type { ResolutionCandidate, ResolutionQuery, SymbolIndex } from "./context.js";
3
+ /**
4
+ * Seam for alternative resolution backends.
5
+ *
6
+ * The MVP ships the three-tier walker as the default. v1 added the Python
7
+ * `stack-graphs` strategy; v2 extends it to the TS family. Both per-language
8
+ * implementations register under the same public name (`"stack-graphs"`);
9
+ * the `stackGraphsRouter` below dispatches per query based on
10
+ * `provider.id`, so a language provider can opt in just by setting
11
+ * `resolverStrategyName: "stack-graphs"`.
12
+ */
13
+ export interface ResolverStrategy {
14
+ readonly name: string;
15
+ resolve(q: ResolutionQuery, index: SymbolIndex): ResolutionCandidate[];
16
+ }
17
+ export declare const defaultResolver: ResolverStrategy;
18
+ /**
19
+ * Dispatch to the per-language stack-graphs backend by provider id. Providers
20
+ * outside the supported set fall through to the three-tier walker. Keeping
21
+ * the dispatch here means each language can evolve its own builder/cache
22
+ * without other languages paying any cost at query time.
23
+ */
24
+ export declare const stackGraphsRouter: ResolverStrategy;
25
+ /**
26
+ * Registry of all known resolver strategies keyed by the name that a
27
+ * language provider can opt into. Keeping this as a Record keeps misuses
28
+ * visible at type level.
29
+ */
30
+ export declare const RESOLVER_STRATEGIES: Readonly<Record<string, ResolverStrategy>>;
31
+ /**
32
+ * Resolve the strategy to use for a given language provider.
33
+ *
34
+ * Providers may expose an optional `resolverStrategyName` hook. If absent
35
+ * — or the referenced strategy isn't registered — we return the default
36
+ * walker. This lets new strategies ship incrementally without a breaking
37
+ * type-level change on every provider.
38
+ */
39
+ export declare function getResolver(provider: Pick<LanguageProvider, "id"> & {
40
+ readonly resolverStrategyName?: string;
41
+ }): ResolverStrategy;
42
+ //# sourceMappingURL=resolver-strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver-strategy.d.ts","sourceRoot":"","sources":["../../../src/providers/resolution/resolver-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKtF;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,GAAG,mBAAmB,EAAE,CAAC;CACxE;AAED,eAAO,MAAM,eAAe,EAAE,gBAG7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,gBAU/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAG1E,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GAAG;IAAE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAAE,GAClF,gBAAgB,CAKlB"}
@@ -0,0 +1,50 @@
1
+ import { resolve } from "./context.js";
2
+ import { stackGraphsPythonResolver } from "./stack-graphs-python.js";
3
+ import { stackGraphsTsResolver } from "./stack-graphs-ts.js";
4
+ export const defaultResolver = {
5
+ name: "three-tier-default",
6
+ resolve,
7
+ };
8
+ /**
9
+ * Dispatch to the per-language stack-graphs backend by provider id. Providers
10
+ * outside the supported set fall through to the three-tier walker. Keeping
11
+ * the dispatch here means each language can evolve its own builder/cache
12
+ * without other languages paying any cost at query time.
13
+ */
14
+ export const stackGraphsRouter = {
15
+ name: "stack-graphs",
16
+ resolve(q, index) {
17
+ const id = q.provider.id;
18
+ if (id === "python")
19
+ return stackGraphsPythonResolver.resolve(q, index);
20
+ if (id === "typescript" || id === "tsx" || id === "javascript") {
21
+ return stackGraphsTsResolver.resolve(q, index);
22
+ }
23
+ return defaultResolver.resolve(q, index);
24
+ },
25
+ };
26
+ /**
27
+ * Registry of all known resolver strategies keyed by the name that a
28
+ * language provider can opt into. Keeping this as a Record keeps misuses
29
+ * visible at type level.
30
+ */
31
+ export const RESOLVER_STRATEGIES = {
32
+ "three-tier-default": defaultResolver,
33
+ "stack-graphs": stackGraphsRouter,
34
+ };
35
+ /**
36
+ * Resolve the strategy to use for a given language provider.
37
+ *
38
+ * Providers may expose an optional `resolverStrategyName` hook. If absent
39
+ * — or the referenced strategy isn't registered — we return the default
40
+ * walker. This lets new strategies ship incrementally without a breaking
41
+ * type-level change on every provider.
42
+ */
43
+ export function getResolver(provider) {
44
+ const requested = provider.resolverStrategyName;
45
+ if (requested === undefined)
46
+ return defaultResolver;
47
+ const strategy = RESOLVER_STRATEGIES[requested];
48
+ return strategy ?? defaultResolver;
49
+ }
50
+ //# sourceMappingURL=resolver-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver-strategy.js","sourceRoot":"","sources":["../../../src/providers/resolution/resolver-strategy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAiB7D,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,IAAI,EAAE,oBAAoB;IAC1B,OAAO;CACR,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqB;IACjD,IAAI,EAAE,cAAc;IACpB,OAAO,CAAC,CAAC,EAAE,KAAK;QACd,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzB,IAAI,EAAE,KAAK,QAAQ;YAAE,OAAO,yBAAyB,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACxE,IAAI,EAAE,KAAK,YAAY,IAAI,EAAE,KAAK,KAAK,IAAI,EAAE,KAAK,YAAY,EAAE,CAAC;YAC/D,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA+C;IAC7E,oBAAoB,EAAE,eAAe;IACrC,cAAc,EAAE,iBAAiB;CAClC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACzB,QAAmF;IAEnF,MAAM,SAAS,GAAG,QAAQ,CAAC,oBAAoB,CAAC;IAChD,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,eAAe,CAAC;IACpD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAChD,OAAO,QAAQ,IAAI,eAAe,CAAC;AACrC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { MroStrategy } from "./mro.js";
2
+ export declare const singleInheritanceStrategy: MroStrategy;
3
+ //# sourceMappingURL=single-inheritance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-inheritance.d.ts","sourceRoot":"","sources":["../../../src/providers/resolution/single-inheritance.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAsB5C,eAAO,MAAM,yBAAyB,EAAE,WAGvC,CAAC"}
@@ -0,0 +1,21 @@
1
+ // Single-inheritance linearization for Java / C# / Kotlin. Walks the single
2
+ // parent chain by concatenating the first (and only) base's linearization.
3
+ // Throws if more than one base is supplied — callers must route interface
4
+ // resolution through a separate mechanism, not this strategy.
5
+ function linearize(classId, bases, baseLinearizations) {
6
+ if (bases.length > 1) {
7
+ throw new Error(`single-inheritance strategy received ${bases.length} bases for ${classId}; ` +
8
+ "this language does not support multiple inheritance.");
9
+ }
10
+ const parent = bases[0];
11
+ if (parent === undefined) {
12
+ return [classId];
13
+ }
14
+ return [classId, ...baseLinearizations(parent)];
15
+ }
16
+ const NAME = "single-inheritance";
17
+ export const singleInheritanceStrategy = {
18
+ name: NAME,
19
+ linearize,
20
+ };
21
+ //# sourceMappingURL=single-inheritance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-inheritance.js","sourceRoot":"","sources":["../../../src/providers/resolution/single-inheritance.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,2EAA2E;AAC3E,0EAA0E;AAC1E,8DAA8D;AAK9D,SAAS,SAAS,CAChB,OAAe,EACf,KAAwB,EACxB,kBAAqD;IAErD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,wCAAwC,KAAK,CAAC,MAAM,cAAc,OAAO,IAAI;YAC3E,sDAAsD,CACzD,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,CAAC,OAAO,EAAE,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,IAAI,GAAoB,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,yBAAyB,GAAgB;IACpD,IAAI,EAAE,IAAI;IACV,SAAS;CACV,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { MinimalTsTree } from "../node-edge-builder.js";
2
+ export interface Pos {
3
+ readonly row: number;
4
+ readonly column: number;
5
+ }
6
+ export interface MockNodeSpec {
7
+ readonly type: string;
8
+ readonly text?: string;
9
+ readonly start?: Pos;
10
+ readonly end?: Pos;
11
+ readonly namedChildren?: readonly MockNodeSpec[];
12
+ /** Named "fields" (accessed via childForFieldName). */
13
+ readonly fields?: Readonly<Record<string, MockNodeSpec>>;
14
+ }
15
+ export declare function mockTree(root: MockNodeSpec): MinimalTsTree;
16
+ //# sourceMappingURL=mock-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-tree.d.ts","sourceRoot":"","sources":["../../../../../src/providers/resolution/stack-graphs/__fixtures__/mock-tree.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE5E,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IACjD,uDAAuD;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;CAC1D;AA8CD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,aAAa,CAE1D"}
@@ -0,0 +1,50 @@
1
+ // Lightweight mock of the tree-sitter Parser.SyntaxNode surface we consume.
2
+ // Only the handful of methods the builder calls are implemented; the rest
3
+ // throw. Fixture trees are hand-assembled in tests.
4
+ class MockNode {
5
+ spec;
6
+ _namedChildren;
7
+ _fields;
8
+ constructor(spec) {
9
+ this.spec = spec;
10
+ this._namedChildren = (spec.namedChildren ?? []).map((c) => new MockNode(c));
11
+ const fields = new Map();
12
+ if (spec.fields !== undefined) {
13
+ for (const [k, v] of Object.entries(spec.fields)) {
14
+ fields.set(k, new MockNode(v));
15
+ }
16
+ }
17
+ this._fields = fields;
18
+ }
19
+ get type() {
20
+ return this.spec.type;
21
+ }
22
+ get text() {
23
+ return this.spec.text ?? "";
24
+ }
25
+ get startPosition() {
26
+ return this.spec.start ?? { row: 0, column: 0 };
27
+ }
28
+ get endPosition() {
29
+ return this.spec.end ?? this.startPosition;
30
+ }
31
+ get childCount() {
32
+ return this._namedChildren.length;
33
+ }
34
+ child(index) {
35
+ return this._namedChildren[index] ?? null;
36
+ }
37
+ childForFieldName(name) {
38
+ return this._fields.get(name) ?? null;
39
+ }
40
+ get namedChildCount() {
41
+ return this._namedChildren.length;
42
+ }
43
+ namedChild(index) {
44
+ return this._namedChildren[index] ?? null;
45
+ }
46
+ }
47
+ export function mockTree(root) {
48
+ return { rootNode: new MockNode(root) };
49
+ }
50
+ //# sourceMappingURL=mock-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-tree.js","sourceRoot":"","sources":["../../../../../src/providers/resolution/stack-graphs/__fixtures__/mock-tree.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,oDAAoD;AAmBpD,MAAM,QAAQ;IAIiB;IAHZ,cAAc,CAAsB;IACpC,OAAO,CAAgC;IAExD,YAA6B,IAAkB;QAAlB,SAAI,GAAJ,IAAI,CAAc;QAC7C,IAAI,CAAC,cAAc,GAAG,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7E,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;QAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBACjD,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IACD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IAC9B,CAAC;IACD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAClD,CAAC;IACD,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC;IAC7C,CAAC;IACD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACpC,CAAC;IACD,KAAK,CAAC,KAAa;QACjB,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IAC5C,CAAC;IACD,iBAAiB,CAAC,IAAY;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IACxC,CAAC;IACD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IACpC,CAAC;IACD,UAAU,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IAC5C,CAAC;CACF;AAED,MAAM,UAAU,QAAQ,CAAC,IAAkB;IACzC,OAAO,EAAE,QAAQ,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type MinimalTsTree } from "./node-edge-builder.js";
2
+ import { type ParsedTsg } from "./rule-parser.js";
3
+ import type { PartialPathResult, ReferenceQuery, StackGraph, TsgRule } from "./types.js";
4
+ /** Parse the rule file text once. Safe to call repeatedly. */
5
+ export declare function loadRules(source: string): ParsedTsg;
6
+ /** For tests: clear the memoized rule cache. */
7
+ export declare function resetRulesForTests(): void;
8
+ /**
9
+ * Build one stack-graph per file up front. Callers normally feed in every
10
+ * Python file in the index so cross-module resolution can hop through ROOT.
11
+ */
12
+ export declare function buildAllStackGraphs(files: ReadonlyMap<string, MinimalTsTree>, rules: readonly TsgRule[]): ReadonlyMap<string, StackGraph>;
13
+ /** Resolve a single reference, returning path results and truncation info. */
14
+ export declare function resolveViaStackGraphs(query: ReferenceQuery, graphs: ReadonlyMap<string, StackGraph>): PartialPathResult;
15
+ //# sourceMappingURL=glue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glue.d.ts","sourceRoot":"","sources":["../../../../src/providers/resolution/stack-graphs/glue.ts"],"names":[],"mappings":"AAOA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AASzF,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAInD;AAED,gDAAgD;AAChD,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,EACzC,KAAK,EAAE,SAAS,OAAO,EAAE,GACxB,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAMjC;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,cAAc,EACrB,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,GACtC,iBAAiB,CAOnB"}
@@ -0,0 +1,44 @@
1
+ // Glue layer that wires rule-parser → builder → engine into one entry point.
2
+ //
3
+ // Exposed as a small function set so the per-language resolver strategy can
4
+ // build graphs lazily per file and hand them to the partial-path engine as
5
+ // references get resolved. Nothing here knows about the ResolverStrategy
6
+ // interface — that lives in `stack-graphs-python.ts`.
7
+ import { buildStackGraph } from "./node-edge-builder.js";
8
+ import { resolveReference } from "./partial-path-engine.js";
9
+ import { parseTsg } from "./rule-parser.js";
10
+ const RULES = { parsed: null };
11
+ /** Parse the rule file text once. Safe to call repeatedly. */
12
+ export function loadRules(source) {
13
+ if (RULES.parsed !== null)
14
+ return RULES.parsed;
15
+ RULES.parsed = parseTsg(source);
16
+ return RULES.parsed;
17
+ }
18
+ /** For tests: clear the memoized rule cache. */
19
+ export function resetRulesForTests() {
20
+ RULES.parsed = null;
21
+ }
22
+ /**
23
+ * Build one stack-graph per file up front. Callers normally feed in every
24
+ * Python file in the index so cross-module resolution can hop through ROOT.
25
+ */
26
+ export function buildAllStackGraphs(files, rules) {
27
+ const out = new Map();
28
+ for (const [file, tree] of files) {
29
+ out.set(file, buildStackGraph(file, tree, rules));
30
+ }
31
+ return out;
32
+ }
33
+ /** Resolve a single reference, returning path results and truncation info. */
34
+ export function resolveViaStackGraphs(query, graphs) {
35
+ const graph = graphs.get(query.file);
36
+ if (graph === undefined)
37
+ return { results: [], truncated: false };
38
+ const key = `${query.line}:${query.column}`;
39
+ const refNodeId = graph.referenceIndex.get(key);
40
+ if (refNodeId === undefined)
41
+ return { results: [], truncated: false };
42
+ return resolveReference(graphs, query.file, refNodeId);
43
+ }
44
+ //# sourceMappingURL=glue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glue.js","sourceRoot":"","sources":["../../../../src/providers/resolution/stack-graphs/glue.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE,sDAAsD;AAEtD,OAAO,EAAE,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAkB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAQ5D,MAAM,KAAK,GAAc,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAE1C,8DAA8D;AAC9D,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC,MAAM,CAAC;IAC/C,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,KAAK,CAAC,MAAM,CAAC;AACtB,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,kBAAkB;IAChC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAyC,EACzC,KAAyB;IAEzB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC1C,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;QACjC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,qBAAqB,CACnC,KAAqB,EACrB,MAAuC;IAEvC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAClE,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;IAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChD,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACtE,OAAO,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { StackGraph, TsgRule } from "./types.js";
2
+ /**
3
+ * Minimal view of a tree-sitter node — duck-typed so we can pass either a
4
+ * real `Parser.SyntaxNode` from tree-sitter or a test fixture. Only the
5
+ * fields we use are declared; that lets fixtures omit the dozens of other
6
+ * properties.
7
+ */
8
+ export interface MinimalTsNode {
9
+ readonly type: string;
10
+ readonly text: string;
11
+ readonly startPosition: {
12
+ readonly row: number;
13
+ readonly column: number;
14
+ };
15
+ readonly endPosition: {
16
+ readonly row: number;
17
+ readonly column: number;
18
+ };
19
+ readonly childCount: number;
20
+ child(index: number): MinimalTsNode | null;
21
+ childForFieldName(name: string): MinimalTsNode | null;
22
+ readonly namedChildCount: number;
23
+ namedChild(index: number): MinimalTsNode | null;
24
+ }
25
+ export interface MinimalTsTree {
26
+ readonly rootNode: MinimalTsNode;
27
+ }
28
+ /** Build a graph for a single Python file. */
29
+ export declare function buildStackGraph(file: string, tree: MinimalTsTree, rules: readonly TsgRule[]): StackGraph;
30
+ //# sourceMappingURL=node-edge-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-edge-builder.d.ts","sourceRoot":"","sources":["../../../../src/providers/resolution/stack-graphs/node-edge-builder.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAEV,UAAU,EAIV,OAAO,EACR,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1E,QAAQ,CAAC,WAAW,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACxE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IAC3C,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;CAClC;AA4DD,8CAA8C;AAC9C,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,SAAS,OAAO,EAAE,GACxB,UAAU,CAgCZ"}