@backthread/extractor 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 (379) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +83 -0
  3. package/dist/cluster/domain-grouping.d.ts +113 -0
  4. package/dist/cluster/domain-grouping.d.ts.map +1 -0
  5. package/dist/cluster/domain-grouping.js +277 -0
  6. package/dist/cluster/domain-grouping.js.map +1 -0
  7. package/dist/cluster/grouping-gate.d.ts +54 -0
  8. package/dist/cluster/grouping-gate.d.ts.map +1 -0
  9. package/dist/cluster/grouping-gate.js +0 -0
  10. package/dist/cluster/grouping-gate.js.map +1 -0
  11. package/dist/cluster/louvain.d.ts +88 -0
  12. package/dist/cluster/louvain.d.ts.map +1 -0
  13. package/dist/cluster/louvain.js +674 -0
  14. package/dist/cluster/louvain.js.map +1 -0
  15. package/dist/cluster/overrides.d.ts +19 -0
  16. package/dist/cluster/overrides.d.ts.map +1 -0
  17. package/dist/cluster/overrides.js +32 -0
  18. package/dist/cluster/overrides.js.map +1 -0
  19. package/dist/cluster/subsystem.d.ts +45 -0
  20. package/dist/cluster/subsystem.d.ts.map +1 -0
  21. package/dist/cluster/subsystem.js +299 -0
  22. package/dist/cluster/subsystem.js.map +1 -0
  23. package/dist/cluster/workspaces.d.ts +64 -0
  24. package/dist/cluster/workspaces.d.ts.map +1 -0
  25. package/dist/cluster/workspaces.js +739 -0
  26. package/dist/cluster/workspaces.js.map +1 -0
  27. package/dist/extract.d.ts +52 -0
  28. package/dist/extract.d.ts.map +1 -0
  29. package/dist/extract.js +48 -0
  30. package/dist/extract.js.map +1 -0
  31. package/dist/framework/celery/celery.d.ts +17 -0
  32. package/dist/framework/celery/celery.d.ts.map +1 -0
  33. package/dist/framework/celery/celery.js +524 -0
  34. package/dist/framework/celery/celery.js.map +1 -0
  35. package/dist/framework/contribute-step.d.ts +38 -0
  36. package/dist/framework/contribute-step.d.ts.map +1 -0
  37. package/dist/framework/contribute-step.js +403 -0
  38. package/dist/framework/contribute-step.js.map +1 -0
  39. package/dist/framework/detect-step.d.ts +8 -0
  40. package/dist/framework/detect-step.d.ts.map +1 -0
  41. package/dist/framework/detect-step.js +54 -0
  42. package/dist/framework/detect-step.js.map +1 -0
  43. package/dist/framework/detect-util.d.ts +24 -0
  44. package/dist/framework/detect-util.d.ts.map +1 -0
  45. package/dist/framework/detect-util.js +59 -0
  46. package/dist/framework/detect-util.js.map +1 -0
  47. package/dist/framework/django/django.d.ts +22 -0
  48. package/dist/framework/django/django.d.ts.map +1 -0
  49. package/dist/framework/django/django.js +940 -0
  50. package/dist/framework/django/django.js.map +1 -0
  51. package/dist/framework/fastapi/fastapi.d.ts +27 -0
  52. package/dist/framework/fastapi/fastapi.d.ts.map +1 -0
  53. package/dist/framework/fastapi/fastapi.js +477 -0
  54. package/dist/framework/fastapi/fastapi.js.map +1 -0
  55. package/dist/framework/faststream/faststream.d.ts +19 -0
  56. package/dist/framework/faststream/faststream.d.ts.map +1 -0
  57. package/dist/framework/faststream/faststream.js +765 -0
  58. package/dist/framework/faststream/faststream.js.map +1 -0
  59. package/dist/framework/flask/flask.d.ts +17 -0
  60. package/dist/framework/flask/flask.d.ts.map +1 -0
  61. package/dist/framework/flask/flask.js +507 -0
  62. package/dist/framework/flask/flask.js.map +1 -0
  63. package/dist/framework/graphql/graphql.d.ts +17 -0
  64. package/dist/framework/graphql/graphql.d.ts.map +1 -0
  65. package/dist/framework/graphql/graphql.js +708 -0
  66. package/dist/framework/graphql/graphql.js.map +1 -0
  67. package/dist/framework/grpc/grpc.d.ts +22 -0
  68. package/dist/framework/grpc/grpc.d.ts.map +1 -0
  69. package/dist/framework/grpc/grpc.js +618 -0
  70. package/dist/framework/grpc/grpc.js.map +1 -0
  71. package/dist/framework/litestar/litestar.d.ts +17 -0
  72. package/dist/framework/litestar/litestar.d.ts.map +1 -0
  73. package/dist/framework/litestar/litestar.js +536 -0
  74. package/dist/framework/litestar/litestar.js.map +1 -0
  75. package/dist/framework/nest/nest.d.ts +19 -0
  76. package/dist/framework/nest/nest.d.ts.map +1 -0
  77. package/dist/framework/nest/nest.js +613 -0
  78. package/dist/framework/nest/nest.js.map +1 -0
  79. package/dist/framework/next/next.d.ts +22 -0
  80. package/dist/framework/next/next.d.ts.map +1 -0
  81. package/dist/framework/next/next.js +449 -0
  82. package/dist/framework/next/next.js.map +1 -0
  83. package/dist/framework/node/node.d.ts +24 -0
  84. package/dist/framework/node/node.d.ts.map +1 -0
  85. package/dist/framework/node/node.js +1009 -0
  86. package/dist/framework/node/node.js.map +1 -0
  87. package/dist/framework/orchestrator/orchestrator.d.ts +34 -0
  88. package/dist/framework/orchestrator/orchestrator.d.ts.map +1 -0
  89. package/dist/framework/orchestrator/orchestrator.js +691 -0
  90. package/dist/framework/orchestrator/orchestrator.js.map +1 -0
  91. package/dist/framework/orm/orm.d.ts +61 -0
  92. package/dist/framework/orm/orm.d.ts.map +1 -0
  93. package/dist/framework/orm/orm.js +620 -0
  94. package/dist/framework/orm/orm.js.map +1 -0
  95. package/dist/framework/python/analyze.d.ts +38 -0
  96. package/dist/framework/python/analyze.d.ts.map +1 -0
  97. package/dist/framework/python/analyze.js +98 -0
  98. package/dist/framework/python/analyze.js.map +1 -0
  99. package/dist/framework/python/py-ast.d.ts +130 -0
  100. package/dist/framework/python/py-ast.d.ts.map +1 -0
  101. package/dist/framework/python/py-ast.js +344 -0
  102. package/dist/framework/python/py-ast.js.map +1 -0
  103. package/dist/framework/python-orm/python-orm.d.ts +19 -0
  104. package/dist/framework/python-orm/python-orm.d.ts.map +1 -0
  105. package/dist/framework/python-orm/python-orm.js +516 -0
  106. package/dist/framework/python-orm/python-orm.js.map +1 -0
  107. package/dist/framework/react-native/react-native.d.ts +35 -0
  108. package/dist/framework/react-native/react-native.d.ts.map +1 -0
  109. package/dist/framework/react-native/react-native.js +1181 -0
  110. package/dist/framework/react-native/react-native.js.map +1 -0
  111. package/dist/framework/register.d.ts +2 -0
  112. package/dist/framework/register.d.ts.map +1 -0
  113. package/dist/framework/register.js +59 -0
  114. package/dist/framework/register.js.map +1 -0
  115. package/dist/framework/registry.d.ts +31 -0
  116. package/dist/framework/registry.d.ts.map +1 -0
  117. package/dist/framework/registry.js +70 -0
  118. package/dist/framework/registry.js.map +1 -0
  119. package/dist/framework/routing/expo-router.d.ts +31 -0
  120. package/dist/framework/routing/expo-router.d.ts.map +1 -0
  121. package/dist/framework/routing/expo-router.js +356 -0
  122. package/dist/framework/routing/expo-router.js.map +1 -0
  123. package/dist/framework/routing/index.d.ts +4 -0
  124. package/dist/framework/routing/index.d.ts.map +1 -0
  125. package/dist/framework/routing/index.js +16 -0
  126. package/dist/framework/routing/index.js.map +1 -0
  127. package/dist/framework/routing/next-router.d.ts +45 -0
  128. package/dist/framework/routing/next-router.d.ts.map +1 -0
  129. package/dist/framework/routing/next-router.js +378 -0
  130. package/dist/framework/routing/next-router.js.map +1 -0
  131. package/dist/framework/routing/route-tree.d.ts +73 -0
  132. package/dist/framework/routing/route-tree.d.ts.map +1 -0
  133. package/dist/framework/routing/route-tree.js +120 -0
  134. package/dist/framework/routing/route-tree.js.map +1 -0
  135. package/dist/framework/types.d.ts +230 -0
  136. package/dist/framework/types.d.ts.map +1 -0
  137. package/dist/framework/types.js +25 -0
  138. package/dist/framework/types.js.map +1 -0
  139. package/dist/graph/cross-language.d.ts +11 -0
  140. package/dist/graph/cross-language.d.ts.map +1 -0
  141. package/dist/graph/cross-language.js +123 -0
  142. package/dist/graph/cross-language.js.map +1 -0
  143. package/dist/graph/extract.d.ts +13 -0
  144. package/dist/graph/extract.d.ts.map +1 -0
  145. package/dist/graph/extract.js +79 -0
  146. package/dist/graph/extract.js.map +1 -0
  147. package/dist/graph/file-graph.d.ts +186 -0
  148. package/dist/graph/file-graph.d.ts.map +1 -0
  149. package/dist/graph/file-graph.js +427 -0
  150. package/dist/graph/file-graph.js.map +1 -0
  151. package/dist/graph/http-callsites.d.ts +14 -0
  152. package/dist/graph/http-callsites.d.ts.map +1 -0
  153. package/dist/graph/http-callsites.js +107 -0
  154. package/dist/graph/http-callsites.js.map +1 -0
  155. package/dist/graph/incremental.d.ts +122 -0
  156. package/dist/graph/incremental.d.ts.map +1 -0
  157. package/dist/graph/incremental.js +448 -0
  158. package/dist/graph/incremental.js.map +1 -0
  159. package/dist/graph/language.d.ts +31 -0
  160. package/dist/graph/language.d.ts.map +1 -0
  161. package/dist/graph/language.js +146 -0
  162. package/dist/graph/language.js.map +1 -0
  163. package/dist/graph/noise-filter.d.ts +46 -0
  164. package/dist/graph/noise-filter.d.ts.map +1 -0
  165. package/dist/graph/noise-filter.js +199 -0
  166. package/dist/graph/noise-filter.js.map +1 -0
  167. package/dist/graph/python-adapter.d.ts +36 -0
  168. package/dist/graph/python-adapter.d.ts.map +1 -0
  169. package/dist/graph/python-adapter.js +402 -0
  170. package/dist/graph/python-adapter.js.map +1 -0
  171. package/dist/graph/python-manifest.d.ts +22 -0
  172. package/dist/graph/python-manifest.d.ts.map +1 -0
  173. package/dist/graph/python-manifest.js +137 -0
  174. package/dist/graph/python-manifest.js.map +1 -0
  175. package/dist/graph/python-stdlib.d.ts +2 -0
  176. package/dist/graph/python-stdlib.d.ts.map +1 -0
  177. package/dist/graph/python-stdlib.js +53 -0
  178. package/dist/graph/python-stdlib.js.map +1 -0
  179. package/dist/graph/ts-morph-adapter.d.ts +65 -0
  180. package/dist/graph/ts-morph-adapter.d.ts.map +1 -0
  181. package/dist/graph/ts-morph-adapter.js +265 -0
  182. package/dist/graph/ts-morph-adapter.js.map +1 -0
  183. package/dist/graph/types.d.ts +37 -0
  184. package/dist/graph/types.d.ts.map +1 -0
  185. package/dist/graph/types.js +50 -0
  186. package/dist/graph/types.js.map +1 -0
  187. package/dist/index.d.ts +45 -0
  188. package/dist/index.d.ts.map +1 -0
  189. package/dist/index.js +51 -0
  190. package/dist/index.js.map +1 -0
  191. package/dist/infra/aws/aws-parse.d.ts +39 -0
  192. package/dist/infra/aws/aws-parse.d.ts.map +1 -0
  193. package/dist/infra/aws/aws-parse.js +149 -0
  194. package/dist/infra/aws/aws-parse.js.map +1 -0
  195. package/dist/infra/aws/aws.d.ts +6 -0
  196. package/dist/infra/aws/aws.d.ts.map +1 -0
  197. package/dist/infra/aws/aws.js +425 -0
  198. package/dist/infra/aws/aws.js.map +1 -0
  199. package/dist/infra/azure/azure-parse.d.ts +73 -0
  200. package/dist/infra/azure/azure-parse.d.ts.map +1 -0
  201. package/dist/infra/azure/azure-parse.js +178 -0
  202. package/dist/infra/azure/azure-parse.js.map +1 -0
  203. package/dist/infra/azure/azure.d.ts +12 -0
  204. package/dist/infra/azure/azure.d.ts.map +1 -0
  205. package/dist/infra/azure/azure.js +673 -0
  206. package/dist/infra/azure/azure.js.map +1 -0
  207. package/dist/infra/cloudflare/cloudflare.d.ts +50 -0
  208. package/dist/infra/cloudflare/cloudflare.d.ts.map +1 -0
  209. package/dist/infra/cloudflare/cloudflare.js +382 -0
  210. package/dist/infra/cloudflare/cloudflare.js.map +1 -0
  211. package/dist/infra/cloudflare/wrangler-parse.d.ts +6 -0
  212. package/dist/infra/cloudflare/wrangler-parse.d.ts.map +1 -0
  213. package/dist/infra/cloudflare/wrangler-parse.js +278 -0
  214. package/dist/infra/cloudflare/wrangler-parse.js.map +1 -0
  215. package/dist/infra/compose/compose-parse.d.ts +24 -0
  216. package/dist/infra/compose/compose-parse.d.ts.map +1 -0
  217. package/dist/infra/compose/compose-parse.js +77 -0
  218. package/dist/infra/compose/compose-parse.js.map +1 -0
  219. package/dist/infra/compose/compose.d.ts +12 -0
  220. package/dist/infra/compose/compose.d.ts.map +1 -0
  221. package/dist/infra/compose/compose.js +201 -0
  222. package/dist/infra/compose/compose.js.map +1 -0
  223. package/dist/infra/convex/convex-parse.d.ts +28 -0
  224. package/dist/infra/convex/convex-parse.d.ts.map +1 -0
  225. package/dist/infra/convex/convex-parse.js +74 -0
  226. package/dist/infra/convex/convex-parse.js.map +1 -0
  227. package/dist/infra/convex/convex.d.ts +18 -0
  228. package/dist/infra/convex/convex.d.ts.map +1 -0
  229. package/dist/infra/convex/convex.js +199 -0
  230. package/dist/infra/convex/convex.js.map +1 -0
  231. package/dist/infra/digitalocean/digitalocean.d.ts +33 -0
  232. package/dist/infra/digitalocean/digitalocean.d.ts.map +1 -0
  233. package/dist/infra/digitalocean/digitalocean.js +204 -0
  234. package/dist/infra/digitalocean/digitalocean.js.map +1 -0
  235. package/dist/infra/firebase/firebase.d.ts +43 -0
  236. package/dist/infra/firebase/firebase.d.ts.map +1 -0
  237. package/dist/infra/firebase/firebase.js +271 -0
  238. package/dist/infra/firebase/firebase.js.map +1 -0
  239. package/dist/infra/fly/fly-parse.d.ts +52 -0
  240. package/dist/infra/fly/fly-parse.d.ts.map +1 -0
  241. package/dist/infra/fly/fly-parse.js +114 -0
  242. package/dist/infra/fly/fly-parse.js.map +1 -0
  243. package/dist/infra/fly/fly.d.ts +15 -0
  244. package/dist/infra/fly/fly.d.ts.map +1 -0
  245. package/dist/infra/fly/fly.js +265 -0
  246. package/dist/infra/fly/fly.js.map +1 -0
  247. package/dist/infra/gcp/gcp-parse.d.ts +24 -0
  248. package/dist/infra/gcp/gcp-parse.d.ts.map +1 -0
  249. package/dist/infra/gcp/gcp-parse.js +123 -0
  250. package/dist/infra/gcp/gcp-parse.js.map +1 -0
  251. package/dist/infra/gcp/gcp.d.ts +10 -0
  252. package/dist/infra/gcp/gcp.d.ts.map +1 -0
  253. package/dist/infra/gcp/gcp.js +502 -0
  254. package/dist/infra/gcp/gcp.js.map +1 -0
  255. package/dist/infra/heroku/heroku-parse.d.ts +33 -0
  256. package/dist/infra/heroku/heroku-parse.d.ts.map +1 -0
  257. package/dist/infra/heroku/heroku-parse.js +63 -0
  258. package/dist/infra/heroku/heroku-parse.js.map +1 -0
  259. package/dist/infra/heroku/heroku.d.ts +24 -0
  260. package/dist/infra/heroku/heroku.d.ts.map +1 -0
  261. package/dist/infra/heroku/heroku.js +253 -0
  262. package/dist/infra/heroku/heroku.js.map +1 -0
  263. package/dist/infra/image-resolve.d.ts +56 -0
  264. package/dist/infra/image-resolve.d.ts.map +1 -0
  265. package/dist/infra/image-resolve.js +229 -0
  266. package/dist/infra/image-resolve.js.map +1 -0
  267. package/dist/infra/infra-step.d.ts +39 -0
  268. package/dist/infra/infra-step.d.ts.map +1 -0
  269. package/dist/infra/infra-step.js +57 -0
  270. package/dist/infra/infra-step.js.map +1 -0
  271. package/dist/infra/k8s/index.d.ts +78 -0
  272. package/dist/infra/k8s/index.d.ts.map +1 -0
  273. package/dist/infra/k8s/index.js +251 -0
  274. package/dist/infra/k8s/index.js.map +1 -0
  275. package/dist/infra/kamal/kamal-parse.d.ts +23 -0
  276. package/dist/infra/kamal/kamal-parse.d.ts.map +1 -0
  277. package/dist/infra/kamal/kamal-parse.js +66 -0
  278. package/dist/infra/kamal/kamal-parse.js.map +1 -0
  279. package/dist/infra/kamal/kamal.d.ts +17 -0
  280. package/dist/infra/kamal/kamal.d.ts.map +1 -0
  281. package/dist/infra/kamal/kamal.js +162 -0
  282. package/dist/infra/kamal/kamal.js.map +1 -0
  283. package/dist/infra/netlify/netlify.d.ts +33 -0
  284. package/dist/infra/netlify/netlify.d.ts.map +1 -0
  285. package/dist/infra/netlify/netlify.js +247 -0
  286. package/dist/infra/netlify/netlify.js.map +1 -0
  287. package/dist/infra/opentofu/opentofu.d.ts +3 -0
  288. package/dist/infra/opentofu/opentofu.d.ts.map +1 -0
  289. package/dist/infra/opentofu/opentofu.js +157 -0
  290. package/dist/infra/opentofu/opentofu.js.map +1 -0
  291. package/dist/infra/pulumi/pulumi-parse.d.ts +60 -0
  292. package/dist/infra/pulumi/pulumi-parse.d.ts.map +1 -0
  293. package/dist/infra/pulumi/pulumi-parse.js +155 -0
  294. package/dist/infra/pulumi/pulumi-parse.js.map +1 -0
  295. package/dist/infra/pulumi/pulumi.d.ts +23 -0
  296. package/dist/infra/pulumi/pulumi.d.ts.map +1 -0
  297. package/dist/infra/pulumi/pulumi.js +260 -0
  298. package/dist/infra/pulumi/pulumi.js.map +1 -0
  299. package/dist/infra/railway/railway-parse.d.ts +54 -0
  300. package/dist/infra/railway/railway-parse.d.ts.map +1 -0
  301. package/dist/infra/railway/railway-parse.js +200 -0
  302. package/dist/infra/railway/railway-parse.js.map +1 -0
  303. package/dist/infra/railway/railway.d.ts +19 -0
  304. package/dist/infra/railway/railway.d.ts.map +1 -0
  305. package/dist/infra/railway/railway.js +397 -0
  306. package/dist/infra/railway/railway.js.map +1 -0
  307. package/dist/infra/register.d.ts +2 -0
  308. package/dist/infra/register.d.ts.map +1 -0
  309. package/dist/infra/register.js +81 -0
  310. package/dist/infra/register.js.map +1 -0
  311. package/dist/infra/registry.d.ts +64 -0
  312. package/dist/infra/registry.d.ts.map +1 -0
  313. package/dist/infra/registry.js +205 -0
  314. package/dist/infra/registry.js.map +1 -0
  315. package/dist/infra/relevance.d.ts +16 -0
  316. package/dist/infra/relevance.d.ts.map +1 -0
  317. package/dist/infra/relevance.js +132 -0
  318. package/dist/infra/relevance.js.map +1 -0
  319. package/dist/infra/render/render-parse.d.ts +76 -0
  320. package/dist/infra/render/render-parse.d.ts.map +1 -0
  321. package/dist/infra/render/render-parse.js +155 -0
  322. package/dist/infra/render/render-parse.js.map +1 -0
  323. package/dist/infra/render/render.d.ts +11 -0
  324. package/dist/infra/render/render.d.ts.map +1 -0
  325. package/dist/infra/render/render.js +303 -0
  326. package/dist/infra/render/render.js.map +1 -0
  327. package/dist/infra/sst/sst-parse.d.ts +25 -0
  328. package/dist/infra/sst/sst-parse.d.ts.map +1 -0
  329. package/dist/infra/sst/sst-parse.js +45 -0
  330. package/dist/infra/sst/sst-parse.js.map +1 -0
  331. package/dist/infra/sst/sst.d.ts +19 -0
  332. package/dist/infra/sst/sst.d.ts.map +1 -0
  333. package/dist/infra/sst/sst.js +236 -0
  334. package/dist/infra/sst/sst.js.map +1 -0
  335. package/dist/infra/supabase/supabase-parse.d.ts +34 -0
  336. package/dist/infra/supabase/supabase-parse.d.ts.map +1 -0
  337. package/dist/infra/supabase/supabase-parse.js +113 -0
  338. package/dist/infra/supabase/supabase-parse.js.map +1 -0
  339. package/dist/infra/supabase/supabase.d.ts +15 -0
  340. package/dist/infra/supabase/supabase.d.ts.map +1 -0
  341. package/dist/infra/supabase/supabase.js +198 -0
  342. package/dist/infra/supabase/supabase.js.map +1 -0
  343. package/dist/infra/terraform/hcl-parse.d.ts +34 -0
  344. package/dist/infra/terraform/hcl-parse.d.ts.map +1 -0
  345. package/dist/infra/terraform/hcl-parse.js +203 -0
  346. package/dist/infra/terraform/hcl-parse.js.map +1 -0
  347. package/dist/infra/terraform/terraform.d.ts +14 -0
  348. package/dist/infra/terraform/terraform.d.ts.map +1 -0
  349. package/dist/infra/terraform/terraform.js +264 -0
  350. package/dist/infra/terraform/terraform.js.map +1 -0
  351. package/dist/infra/types.d.ts +151 -0
  352. package/dist/infra/types.d.ts.map +1 -0
  353. package/dist/infra/types.js +14 -0
  354. package/dist/infra/types.js.map +1 -0
  355. package/dist/infra/vercel/vercel-parse.d.ts +70 -0
  356. package/dist/infra/vercel/vercel-parse.d.ts.map +1 -0
  357. package/dist/infra/vercel/vercel-parse.js +194 -0
  358. package/dist/infra/vercel/vercel-parse.js.map +1 -0
  359. package/dist/infra/vercel/vercel.d.ts +30 -0
  360. package/dist/infra/vercel/vercel.d.ts.map +1 -0
  361. package/dist/infra/vercel/vercel.js +523 -0
  362. package/dist/infra/vercel/vercel.js.map +1 -0
  363. package/dist/infra/walk.d.ts +36 -0
  364. package/dist/infra/walk.d.ts.map +1 -0
  365. package/dist/infra/walk.js +85 -0
  366. package/dist/infra/walk.js.map +1 -0
  367. package/dist/safety.d.ts +13 -0
  368. package/dist/safety.d.ts.map +1 -0
  369. package/dist/safety.js +67 -0
  370. package/dist/safety.js.map +1 -0
  371. package/dist/types.d.ts +47 -0
  372. package/dist/types.d.ts.map +1 -0
  373. package/dist/types.js +111 -0
  374. package/dist/types.js.map +1 -0
  375. package/dist/version.d.ts +2 -0
  376. package/dist/version.d.ts.map +1 -0
  377. package/dist/version.js +35 -0
  378. package/dist/version.js.map +1 -0
  379. package/package.json +65 -0
@@ -0,0 +1,448 @@
1
+ // Stage A — the diff-driven incremental extraction ENGINE.
2
+ //
3
+ // Owns a ts-morph Project + a FileGraphState (file-graph.ts) across a merge
4
+ // walk's checkpoints. The walk seeds it ONCE (full extract, or the
5
+ // extraction_cache's serialized file graph with ZERO symbol work), then PATCHES
6
+ // it per checkpoint from `git diff --name-status` — re-running the expensive
7
+ // type-checker call-edge extraction only on the changed files + the dependents
8
+ // that can observe the change (computeCallPatchUnit), and re-resolving import
9
+ // specifiers fresh wherever the tree's shape moved.
10
+ //
11
+ // WHY the working tree stays checked out per checkpoint: import/call resolution
12
+ // is the ts-morph compiler's (Bundler resolution, tsconfig paths, extensionless
13
+ // + .js→.ts mapping). Re-implementing it against a bare tree index would risk
14
+ // silent divergence from a full extract — the one thing Stage A must not do.
15
+ // `git checkout` between adjacent merges only rewrites the changed paths, so
16
+ // the checkout itself is already O(diff); what this engine eliminates is the
17
+ // O(repo) parse + symbol-resolution per checkpoint.
18
+ //
19
+ // Patch modes per checkpoint:
20
+ // * content-only diff (M) → refresh just those SourceFiles in the live
21
+ // Project (no re-parse of anything else; resolution can't move when the
22
+ // tree shape is unchanged).
23
+ // * shape diff (A/D/T) → rebuild the Project from disk (syntactic parse,
24
+ // seconds) + re-resolve EVERY file's imports (cheap) — catching "an
25
+ // existing `./util` import now resolves to the new file" exactly like a
26
+ // full extract would. Call extraction still runs only on the patch unit.
27
+ // * config invalidator → the caller runs a FULL re-seed instead (the
28
+ // correctness valve; tsconfig/package/lockfiles can move resolution
29
+ // globally).
30
+ //
31
+ // EQUIVALENCE CONTRACT: at every checkpoint the patched graph must equal a
32
+ // fresh full extract of the same tree — guarded by incremental-equivalence
33
+ // fixture test. See file-graph.ts for the STEP-1 finding + the documented
34
+ // residual (deep type-dispatch chains), healed by invalidators + Stage B
35
+ // reconciliation.
36
+ import { resolve } from 'node:path';
37
+ import { classifyDiff, computeCallPatchUnit, deserializeFileGraph, graphFromState, serializeFileGraph, } from './file-graph.js';
38
+ import { filterNoise, summarizeNoise } from './noise-filter.js';
39
+ import { addAllSourceFiles, buildExtractionProject, extractFileCalls, extractFileImportsRecord, extractFileRecord, toId, } from './ts-morph-adapter.js';
40
+ export class IncrementalExtractor {
41
+ project = null;
42
+ state = null;
43
+ /**
44
+ * Stage B — paths whose records were (RE)COMPUTED this boot: exactly
45
+ * the rows worth upserting into the blob parse-cache at boot end. Patch-unit
46
+ * members + full-extract files only — NOT imports-only-refreshed files (their
47
+ * cached record's stale-resolved imports only feed the moved-bindings check
48
+ * on reuse, which re-validates against the live tree anyway; marking them
49
+ * would upsert the whole repo every boot for nothing). Paths that leave the
50
+ * state (deleted files) are dropped — their blobs aren't in the final tree.
51
+ */
52
+ dirty = new Set();
53
+ /**
54
+ * log the noise-filter policy at most ONCE per engine lifetime (=
55
+ * once per boot). The filter runs on every seed/patch return (so the
56
+ * clustering-bound graph is always clean), but a per-checkpoint log line would
57
+ * spam the merge walk with the same drop every checkpoint. Logging once — at
58
+ * the first checkpoint that drops anything, whether that's a seed or a patch —
59
+ * keeps the house rule (never a silent cap) without the noise.
60
+ */
61
+ noiseLogged = false;
62
+ /**
63
+ * drop tests/generated/build/config/stories/mocks/types from the
64
+ * clustering-bound graph. Deterministic + pure; the carried FileGraphState is
65
+ * left intact (filtering is an OUTPUT concern only — incremental patching, the
66
+ * blob cache, and the Stage-A/B equivalence contract are unaffected).
67
+ */
68
+ applyNoiseFilter(graph) {
69
+ const { graph: filtered, dropped } = filterNoise(graph);
70
+ if (dropped.total > 0 && !this.noiseLogged) {
71
+ console.log(` ⊘ ${summarizeNoise(dropped)}`);
72
+ this.noiseLogged = true;
73
+ }
74
+ return filtered;
75
+ }
76
+ /** Is there a carried state to patch from? */
77
+ get hasState() {
78
+ return this.state !== null;
79
+ }
80
+ /** The FULL commit sha the carried state corresponds to (diff base). */
81
+ get headSha() {
82
+ return this.state?.headSha ?? null;
83
+ }
84
+ /**
85
+ * Adopt a serialized file graph (the extraction_cache seed) — ZERO parsing.
86
+ * Returns false (and stays unseeded) when the payload isn't usable.
87
+ */
88
+ adoptCache(serialized) {
89
+ const state = deserializeFileGraph(serialized);
90
+ if (!state)
91
+ return false;
92
+ this.state = state;
93
+ this.project = null; // built lazily on the first patch
94
+ this.dirty.clear(); // nothing recomputed — every record came from the cache
95
+ return true;
96
+ }
97
+ /**
98
+ * Adopt a ground-truth state DIRECTLY (the Stage-B reconciliation heal —
99
+ * container.ts swaps in a fresh full extract's state when drift is found).
100
+ * The caller marks the drifted paths dirty itself (markDirty) so the heal
101
+ * reaches the blob cache; the engine's existing dirty set stays valid (non-
102
+ * drifted records are identical by definition of the diff).
103
+ */
104
+ adoptState(state) {
105
+ this.state = state;
106
+ this.project = null; // rebuilt lazily on the next patch
107
+ for (const path of this.dirty) {
108
+ if (!(path in state.files))
109
+ this.dirty.delete(path);
110
+ }
111
+ }
112
+ /** Paths whose records were (re)computed this boot — the blob-cache upserts. */
113
+ dirtyPaths() {
114
+ return [...this.dirty];
115
+ }
116
+ /** Forget the dirty set (call after a successful blob-cache upsert). */
117
+ clearDirty() {
118
+ this.dirty.clear();
119
+ }
120
+ /** Mark paths dirty (the reconciliation heal's drifted set). */
121
+ markDirty(paths) {
122
+ for (const p of paths)
123
+ this.dirty.add(p);
124
+ }
125
+ /** The carried record for a path (blob-cache row material), or null. */
126
+ recordFor(path) {
127
+ return this.state?.files[path] ?? null;
128
+ }
129
+ /** The carried state (reconciliation comparator input). Do not mutate. */
130
+ stateSnapshot() {
131
+ if (!this.state)
132
+ throw new Error('IncrementalExtractor.stateSnapshot before seed');
133
+ return this.state;
134
+ }
135
+ /**
136
+ * Full extract at the current working tree (the seed, or the config-
137
+ * invalidator fallback). Same work as the batch adapter — kept for the
138
+ * boot's FIRST checkpoint when no usable cache seed exists.
139
+ */
140
+ seedFull(repoDir, headSha) {
141
+ const root = resolve(repoDir);
142
+ // release any prior Project BEFORE building its replacement so the
143
+ // old ts-morph AST + resolution state is collectible during the (re)build,
144
+ // instead of two full Projects coexisting. That transient ~2x heap is what
145
+ // OOM-aborted the container (exit 134) when a large monorepo's window hit a
146
+ // config invalidator and re-entered seedFull mid-walk.
147
+ this.project = null;
148
+ const project = buildExtractionProject(root);
149
+ addAllSourceFiles(project, root);
150
+ const sourceFiles = project.getSourceFiles();
151
+ const internalIds = new Set(sourceFiles.map((sf) => toId(root, sf.getFilePath())));
152
+ const files = {};
153
+ for (const sf of sourceFiles) {
154
+ files[toId(root, sf.getFilePath())] = extractFileRecord(sf, root, internalIds);
155
+ }
156
+ this.project = project;
157
+ this.state = { headSha, files };
158
+ // Everything was recomputed → everything is blob-cache upsert material;
159
+ // previously-dirty paths that left the tree drop with the new state.
160
+ this.dirty = new Set(Object.keys(files));
161
+ return {
162
+ graph: this.applyNoiseFilter(graphFromState(root, this.state)),
163
+ metrics: {
164
+ mode: 'seed-full',
165
+ parsedFiles: sourceFiles.length,
166
+ callExtracted: sourceFiles.length,
167
+ carried: 0,
168
+ filesTotal: sourceFiles.length,
169
+ },
170
+ };
171
+ }
172
+ /**
173
+ * Stage B — seed from the content-addressed BLOB PARSE-CACHE: the
174
+ * cold-boot path when no carried graph exists (or its head commit is
175
+ * unreachable in the clone) but per-blob records survive in
176
+ * `file_parse_cache`. `cached` is keyed by repo-relative path and contains
177
+ * ONLY records whose blobSha already matched the current tree — the CALLER
178
+ * does the blob matching (container.ts joins lsTreeBlobs against the cache).
179
+ *
180
+ * CORRECTNESS (the patchTo argument with "diff = cache misses"): a cached
181
+ * record's CALLS are reused only when
182
+ * (a) the content is blob-identical (the caller's join),
183
+ * (b) its freshly-resolved import bindings equal the cached ones (the
184
+ * moved-bindings check below — this also heals a blob that matched at
185
+ * a DIFFERENT path, where relative specifiers resolve elsewhere), and
186
+ * (c) no re-export chain connects it to a miss (the closure).
187
+ * Imports/externals/reexports are re-resolved FRESH for every file (cheap;
188
+ * resolution must reflect THIS tree). Same documented residual as Stage A
189
+ * (deep type-dispatch chains), healed by the periodic reconciliation pass.
190
+ */
191
+ seedFromBlobCache(repoDir, headSha, cached) {
192
+ const root = resolve(repoDir);
193
+ // 1. Syntactic parse of the whole tree — unavoidable on a cold boot
194
+ // (seconds); the expensive type-checker work below is O(misses + moved).
195
+ const project = buildExtractionProject(root);
196
+ addAllSourceFiles(project, root);
197
+ const sourceFiles = project.getSourceFiles();
198
+ const internalIds = new Set(sourceFiles.map((sf) => toId(root, sf.getFilePath())));
199
+ const sfById = new Map(sourceFiles.map((sf) => [toId(root, sf.getFilePath()), sf]));
200
+ // 2. Misses = current source files without a blob-matched cached record.
201
+ const misses = [];
202
+ for (const id of internalIds) {
203
+ if (!cached.has(id))
204
+ misses.push(id);
205
+ }
206
+ // 3. Fresh import resolution for EVERY file (must be current-tree).
207
+ const freshImports = new Map(); // calls EMPTY (filled below)
208
+ for (const id of internalIds) {
209
+ const sf = sfById.get(id);
210
+ if (!sf)
211
+ continue;
212
+ freshImports.set(id, extractFileImportsRecord(sf, root, internalIds));
213
+ }
214
+ const importsView = new Map();
215
+ const reexportsView = new Map();
216
+ for (const [id, rec] of freshImports) {
217
+ importsView.set(id, rec.imports);
218
+ reexportsView.set(id, rec.reexports);
219
+ }
220
+ // The "previous" import view = the cached records' (a miss has no entry →
221
+ // computeCallPatchUnit treats it as new and pulls it into the unit).
222
+ const prevImports = new Map([...cached].map(([id, rec]) => [id, rec.imports]));
223
+ // 4. The call patch unit: misses + moved bindings + re-export closure
224
+ // importers — exactly patchTo's rule with "diff = cache misses".
225
+ const unit = computeCallPatchUnit({
226
+ added: misses,
227
+ modified: [],
228
+ deleted: [],
229
+ freshImports: importsView,
230
+ prevImports,
231
+ reexports: reexportsView,
232
+ });
233
+ // 5. Assemble: unit members pay the symbol work; the rest reuse cached
234
+ // calls (pruned to the current tree — a full extract could never emit
235
+ // an edge to a file that isn't here).
236
+ const files = {};
237
+ let callExtracted = 0;
238
+ let carried = 0;
239
+ for (const id of internalIds) {
240
+ const sf = sfById.get(id);
241
+ const base = freshImports.get(id) ?? extractFileImportsRecord(sf, root, internalIds);
242
+ if (unit.has(id)) {
243
+ files[id] = { ...base, calls: extractFileCalls(sf, root, internalIds) };
244
+ callExtracted++;
245
+ }
246
+ else {
247
+ // Non-unit ⇒ cached.has(id) by construction (every miss joined the unit).
248
+ files[id] = {
249
+ ...base,
250
+ calls: (cached.get(id)?.calls ?? []).filter((c) => internalIds.has(c.to)),
251
+ };
252
+ carried++;
253
+ }
254
+ }
255
+ this.project = project;
256
+ this.state = { headSha, files };
257
+ // Only the unit's records were (re)computed — those join the upsert set;
258
+ // carried records already live in the blob cache (that's where they came
259
+ // from). Paths no longer in the state drop (their blobs left the tree).
260
+ for (const id of unit)
261
+ this.dirty.add(id);
262
+ for (const path of this.dirty) {
263
+ if (!(path in files))
264
+ this.dirty.delete(path);
265
+ }
266
+ return {
267
+ graph: this.applyNoiseFilter(graphFromState(root, this.state)),
268
+ metrics: {
269
+ mode: 'seed-blob-cache',
270
+ parsedFiles: sourceFiles.length,
271
+ callExtracted,
272
+ carried,
273
+ filesTotal: Object.keys(files).length,
274
+ },
275
+ };
276
+ }
277
+ /**
278
+ * Patch the carried state to the tree currently checked out at `repoDir`
279
+ * (commit `headSha`), given the name-status diff from the carried head to
280
+ * this commit. The caller is responsible for the config-invalidator check
281
+ * (classifyDiff(...).invalidators → call seedFull instead).
282
+ */
283
+ patchTo(repoDir, headSha, diff) {
284
+ if (!this.state)
285
+ throw new Error('IncrementalExtractor.patchTo before seed');
286
+ const root = resolve(repoDir);
287
+ const cls = classifyDiff(diff);
288
+ const seededFromCache = this.project === null;
289
+ // --- 1. Bring the Project in line with the tree ------------------------
290
+ let parsedFiles = 0;
291
+ let rebuilt = false;
292
+ if (this.project === null || cls.shapeChanged) {
293
+ // Shape moved (or first patch after a cache seed) → rebuild from disk.
294
+ // Syntactic parse of the tree (seconds); the expensive symbol work below
295
+ // stays O(patch unit). A fresh Project also sidesteps any module-
296
+ // resolution cache staleness across adds/deletes.
297
+ // drop the prior Project BEFORE building the replacement (build
298
+ // into a local, then assign) so the old ts-morph Project is collectible
299
+ // during the rebuild instead of both coexisting — the 2x-heap transient
300
+ // that OOM-aborted the container (exit 134) on a large monorepo whose
301
+ // window hit a config invalidator. (seededFromCache was captured above.)
302
+ this.project = null;
303
+ const rebuiltProject = buildExtractionProject(root);
304
+ addAllSourceFiles(rebuiltProject, root);
305
+ this.project = rebuiltProject;
306
+ parsedFiles = rebuiltProject.getSourceFiles().length;
307
+ rebuilt = true;
308
+ }
309
+ else {
310
+ // Content-only diff → refresh exactly the modified files in place.
311
+ for (const path of cls.sourceModified) {
312
+ const abs = `${root}/${path}`;
313
+ const sf = this.project.getSourceFile(abs);
314
+ if (sf) {
315
+ sf.refreshFromFileSystemSync();
316
+ }
317
+ else {
318
+ // Defensive: the carried project should contain it; add if not.
319
+ this.project.addSourceFileAtPath(abs);
320
+ }
321
+ parsedFiles++;
322
+ }
323
+ }
324
+ const project = this.project;
325
+ const sourceFiles = project.getSourceFiles();
326
+ const internalIds = new Set(sourceFiles.map((sf) => toId(root, sf.getFilePath())));
327
+ const sfById = new Map(sourceFiles.map((sf) => [toId(root, sf.getFilePath()), sf]));
328
+ // --- 2. Import/re-export/external resolution ---------------------------
329
+ // Fresh wherever resolution can have moved: every file on a rebuild (tree
330
+ // shape changed), only the modified files on a refresh (shape unchanged ⇒
331
+ // unchanged files' specifiers bind identically). extractFileRecord also
332
+ // produces the file's calls — for files OUTSIDE the call patch unit we
333
+ // overwrite them with the carried ones below, so the expensive symbol pass
334
+ // effectively runs only where needed... except extractFileRecord computes
335
+ // calls inline. To keep symbol work O(patch unit), resolution-only files
336
+ // get a cheap imports-only pass instead.
337
+ const prevFiles = this.state.files;
338
+ const freshImports = new Map(); // imports/externals/reexports fresh; calls EMPTY (filled below)
339
+ const importsOnlyTargets = rebuilt
340
+ ? [...internalIds]
341
+ : cls.sourceModified.filter((p) => internalIds.has(p));
342
+ for (const id of importsOnlyTargets) {
343
+ const sf = sfById.get(id);
344
+ if (!sf)
345
+ continue;
346
+ freshImports.set(id, extractFileImportsRecord(sf, root, internalIds));
347
+ }
348
+ // Per-file import views for the patch-unit computation: fresh where
349
+ // recomputed, carried otherwise (valid — resolution didn't move there).
350
+ const importsView = new Map();
351
+ const reexportsView = new Map();
352
+ for (const id of internalIds) {
353
+ const fresh = freshImports.get(id);
354
+ const prev = prevFiles[id];
355
+ importsView.set(id, fresh ? fresh.imports : (prev?.imports ?? []));
356
+ reexportsView.set(id, fresh ? fresh.reexports : (prev?.reexports ?? []));
357
+ }
358
+ const prevImports = new Map(Object.entries(prevFiles).map(([id, rec]) => [id, rec.imports]));
359
+ // --- 3. The call patch unit (the expensive symbol work) ----------------
360
+ const unit = computeCallPatchUnit({
361
+ added: cls.sourceAdded.filter((p) => internalIds.has(p)),
362
+ modified: cls.sourceModified.filter((p) => internalIds.has(p)),
363
+ deleted: cls.sourceDeleted,
364
+ freshImports: importsView,
365
+ prevImports,
366
+ reexports: reexportsView,
367
+ });
368
+ // --- 4. Assemble the new state -----------------------------------------
369
+ const files = {};
370
+ let callExtracted = 0;
371
+ let carried = 0;
372
+ for (const id of internalIds) {
373
+ const sf = sfById.get(id);
374
+ if (unit.has(id)) {
375
+ // Full per-file extraction: reuse the fresh import half when it was
376
+ // already computed above, add the expensive call half.
377
+ const base = freshImports.get(id) ?? extractFileImportsRecord(sf, root, internalIds);
378
+ files[id] = { ...base, calls: extractFileCalls(sf, root, internalIds) };
379
+ callExtracted++;
380
+ this.dirty.add(id); // (re)computed → blob-cache upsert material
381
+ continue;
382
+ }
383
+ const prev = prevFiles[id];
384
+ const freshNoCalls = freshImports.get(id);
385
+ if (freshNoCalls) {
386
+ // Imports re-resolved (rebuild path) but calls carried — the unit
387
+ // computation proved this file's bindings didn't move. Prune any
388
+ // carried call edge whose target left the tree (a full extract could
389
+ // not produce it). NOT marked dirty: the record's call half came from
390
+ // the carried state, and its imports-only refresh is re-validated on
391
+ // every reuse anyway (the moved-bindings check).
392
+ files[id] = {
393
+ ...freshNoCalls,
394
+ calls: (prev?.calls ?? []).filter((c) => internalIds.has(c.to)),
395
+ };
396
+ carried++;
397
+ }
398
+ else if (prev) {
399
+ files[id] = {
400
+ ...prev,
401
+ calls: prev.calls.filter((c) => internalIds.has(c.to)),
402
+ imports: prev.imports.filter((e) => internalIds.has(e.to)),
403
+ };
404
+ carried++;
405
+ }
406
+ else {
407
+ // Shouldn't happen (a file neither carried nor in the unit) — extract
408
+ // defensively rather than dropping it.
409
+ files[id] = extractFileRecord(sf, root, internalIds);
410
+ callExtracted++;
411
+ this.dirty.add(id);
412
+ }
413
+ }
414
+ this.state = { headSha, files };
415
+ // Paths that left the state this patch are no longer upsert material.
416
+ for (const path of this.dirty) {
417
+ if (!(path in files))
418
+ this.dirty.delete(path);
419
+ }
420
+ return {
421
+ graph: this.applyNoiseFilter(graphFromState(root, this.state)),
422
+ metrics: {
423
+ mode: seededFromCache ? 'seed-cache' : rebuilt ? 'patch-rebuild' : 'patch-refresh',
424
+ parsedFiles,
425
+ callExtracted,
426
+ carried,
427
+ filesTotal: Object.keys(files).length,
428
+ },
429
+ };
430
+ }
431
+ /** Serialize the carried state for the extraction_cache fileGraph payload. */
432
+ toCachePayload(blobShaByPath) {
433
+ if (!this.state)
434
+ return null;
435
+ return serializeFileGraph(this.state, blobShaByPath);
436
+ }
437
+ /**
438
+ * The NormalizedGraph view of the carried state (test/diagnostic read).
439
+ * RAW — deliberately NOT noise-filtered: this is the carried-state
440
+ * view the equivalence tests assert against, not a clustering-bound return.
441
+ */
442
+ graphSnapshot(root) {
443
+ if (!this.state)
444
+ throw new Error('IncrementalExtractor.graphSnapshot before seed');
445
+ return graphFromState(resolve(root), this.state);
446
+ }
447
+ }
448
+ //# sourceMappingURL=incremental.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incremental.js","sourceRoot":"","sources":["../../src/graph/incremental.ts"],"names":[],"mappings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AK,CAAC,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,31 @@
1
+ import type { NormalizedGraph } from './types.js';
2
+ import { type SourceLang } from './file-graph.js';
3
+ /**
4
+ * Repo-relative POSIX paths of every source file for `lang` under `root`.
5
+ * Walks the tree directly (the Pyright adapter needs an explicit file list; it
6
+ * doesn't glob like ts-morph). Skips excluded + dot-prefixed directories and
7
+ * never follows symlinks (a symlinked dir reports isDirectory() === false), so a
8
+ * link into `.venv`/`site-packages` can't smuggle installed deps into the graph
9
+ * or escape the repo — a load-bearing part of the install-free promise.
10
+ */
11
+ export declare function listSourceFiles(root: string, lang: SourceLang): string[];
12
+ /**
13
+ * Pick the structural adapter language for `repoDir`. TS is the DEFAULT (the
14
+ * pipeline's home turf); Python is selected only when the repo is unambiguously
15
+ * Python. Manifests decide the clear cases cheaply (a Python-only manifest with
16
+ * no TS manifest → Python, and vice versa); a repo with both (or neither) falls
17
+ * back to a source-file count, so a TS app that merely ships a helper `.py`
18
+ * script still extracts as TS.
19
+ */
20
+ export declare function detectRepoLanguage(repoDir: string): SourceLang;
21
+ /**
22
+ * The languages the pipeline should extract + merge for `repoDir`. Returns ONE
23
+ * language for a single-language repo (identical to `detectRepoLanguage`, so no
24
+ * behavior change), or BOTH — dominant first (deterministic) — for a genuinely
25
+ * polyglot repo. The order is stable (count desc, then name) so the merged graph
26
+ * is deterministic.
27
+ */
28
+ export declare function detectRepoLanguages(repoDir: string): SourceLang[];
29
+ /** The language a NormalizedGraph was extracted in (derived from its file tags). */
30
+ export declare function graphLanguage(graph: NormalizedGraph): SourceLang;
31
+ //# sourceMappingURL=language.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../src/graph/language.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAKzB;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,EAAE,CA0BxE;AAoCD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAO9D;AAWD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,EAAE,CAcjE;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,UAAU,CAEhE"}
@@ -0,0 +1,146 @@
1
+ // Language detection + source-file enumeration for the extractor dispatch
2
+ //. The pipeline runs ONE structural adapter per repo; this module
3
+ // decides which (ts-morph vs Pyright) and, for the Pyright path, hands it the
4
+ // explicit list of first-party source files to parse.
5
+ //
6
+ // IMPURE by design (reads the filesystem) — kept OUT of file-graph.ts, which is
7
+ // the pure source-path policy. This module composes that policy (isSourceFilePath,
8
+ // the exclude sets) with real fs walks.
9
+ import { readdirSync, existsSync } from 'node:fs';
10
+ import { relative, resolve } from 'node:path';
11
+ import { isSourceFilePath, PYTHON_EXCLUDE_DIRS, EXCLUDE_DIRS, } from './file-graph.js';
12
+ const PYTHON_MANIFESTS = ['pyproject.toml', 'setup.py', 'setup.cfg', 'requirements.txt', 'Pipfile'];
13
+ const TS_MANIFESTS = ['package.json', 'tsconfig.json', 'tsconfig.base.json', 'jsconfig.json'];
14
+ /**
15
+ * Repo-relative POSIX paths of every source file for `lang` under `root`.
16
+ * Walks the tree directly (the Pyright adapter needs an explicit file list; it
17
+ * doesn't glob like ts-morph). Skips excluded + dot-prefixed directories and
18
+ * never follows symlinks (a symlinked dir reports isDirectory() === false), so a
19
+ * link into `.venv`/`site-packages` can't smuggle installed deps into the graph
20
+ * or escape the repo — a load-bearing part of the install-free promise.
21
+ */
22
+ export function listSourceFiles(root, lang) {
23
+ const absRoot = resolve(root);
24
+ const excludes = new Set(lang === 'python' ? PYTHON_EXCLUDE_DIRS : EXCLUDE_DIRS);
25
+ const out = [];
26
+ const walk = (dir) => {
27
+ let entries;
28
+ try {
29
+ entries = readdirSync(dir, { withFileTypes: true });
30
+ }
31
+ catch {
32
+ return; // unreadable dir — skip, never fail the whole extraction
33
+ }
34
+ for (const ent of entries) {
35
+ const abs = `${dir}/${ent.name}`;
36
+ if (ent.isDirectory()) {
37
+ if (ent.name.startsWith('.') || excludes.has(ent.name))
38
+ continue;
39
+ walk(abs);
40
+ }
41
+ else if (ent.isFile()) {
42
+ const id = relative(absRoot, abs).split(/[\\/]/).join('/');
43
+ if (isSourceFilePath(id, lang))
44
+ out.push(id);
45
+ }
46
+ // symlinks (isDirectory/isFile both false) are intentionally skipped
47
+ }
48
+ };
49
+ walk(absRoot);
50
+ return out.sort();
51
+ }
52
+ /** Count source files per language under `root` (bounded walk short-circuits). */
53
+ function countSources(root, cap = 4000) {
54
+ let ts = 0;
55
+ let python = 0;
56
+ const absRoot = resolve(root);
57
+ const tsExcl = new Set(EXCLUDE_DIRS);
58
+ const pyExcl = new Set(PYTHON_EXCLUDE_DIRS);
59
+ const walk = (dir) => {
60
+ if (ts + python >= cap)
61
+ return;
62
+ let entries;
63
+ try {
64
+ entries = readdirSync(dir, { withFileTypes: true });
65
+ }
66
+ catch {
67
+ return;
68
+ }
69
+ for (const ent of entries) {
70
+ if (ts + python >= cap)
71
+ return;
72
+ const abs = `${dir}/${ent.name}`;
73
+ if (ent.isDirectory()) {
74
+ // Skip a dir excluded by EITHER language (or dot-prefixed) — the union
75
+ // keeps the count cheap and can't misread vendored deps as source.
76
+ if (ent.name.startsWith('.') || tsExcl.has(ent.name) || pyExcl.has(ent.name))
77
+ continue;
78
+ walk(abs);
79
+ }
80
+ else if (ent.isFile()) {
81
+ const id = relative(absRoot, abs).split(/[\\/]/).join('/');
82
+ if (isSourceFilePath(id, 'ts'))
83
+ ts++;
84
+ else if (isSourceFilePath(id, 'python'))
85
+ python++;
86
+ }
87
+ }
88
+ };
89
+ walk(absRoot);
90
+ return { ts, python };
91
+ }
92
+ /**
93
+ * Pick the structural adapter language for `repoDir`. TS is the DEFAULT (the
94
+ * pipeline's home turf); Python is selected only when the repo is unambiguously
95
+ * Python. Manifests decide the clear cases cheaply (a Python-only manifest with
96
+ * no TS manifest → Python, and vice versa); a repo with both (or neither) falls
97
+ * back to a source-file count, so a TS app that merely ships a helper `.py`
98
+ * script still extracts as TS.
99
+ */
100
+ export function detectRepoLanguage(repoDir) {
101
+ const hasPy = PYTHON_MANIFESTS.some((m) => existsSync(resolve(repoDir, m)));
102
+ const hasTs = TS_MANIFESTS.some((m) => existsSync(resolve(repoDir, m)));
103
+ if (hasPy && !hasTs)
104
+ return 'python';
105
+ if (hasTs && !hasPy)
106
+ return 'ts';
107
+ const { ts, python } = countSources(repoDir);
108
+ return python > ts ? 'python' : 'ts';
109
+ }
110
+ // a language is only a FIRST-CLASS participant in the diagram when it has
111
+ // a MEANINGFUL presence — enough files (absolute) AND a big-enough share of the
112
+ // larger language. This keeps a TS repo shipping a couple of helper `.py` scripts
113
+ // (or a Python repo with a stray build script) extracting as a SINGLE language,
114
+ // byte-identical to before — only a genuinely polyglot repo (a TS frontend + a
115
+ // Python backend) triggers the multi-extract merge.
116
+ const MULTI_MIN_FILES = 5;
117
+ const MULTI_MIN_FRACTION = 0.15;
118
+ /**
119
+ * The languages the pipeline should extract + merge for `repoDir`. Returns ONE
120
+ * language for a single-language repo (identical to `detectRepoLanguage`, so no
121
+ * behavior change), or BOTH — dominant first (deterministic) — for a genuinely
122
+ * polyglot repo. The order is stable (count desc, then name) so the merged graph
123
+ * is deterministic.
124
+ */
125
+ export function detectRepoLanguages(repoDir) {
126
+ const { ts, python } = countSources(repoDir);
127
+ const all = [
128
+ { lang: 'ts', count: ts },
129
+ { lang: 'python', count: python },
130
+ ];
131
+ const counts = all.filter((l) => l.count > 0);
132
+ if (counts.length <= 1)
133
+ return [detectRepoLanguage(repoDir)];
134
+ const max = Math.max(ts, python);
135
+ const present = counts.filter((l) => l.count >= MULTI_MIN_FILES && l.count / max >= MULTI_MIN_FRACTION);
136
+ if (present.length <= 1)
137
+ return [detectRepoLanguage(repoDir)];
138
+ return present
139
+ .sort((a, b) => b.count - a.count || (a.lang < b.lang ? -1 : 1))
140
+ .map((l) => l.lang);
141
+ }
142
+ /** The language a NormalizedGraph was extracted in (derived from its file tags). */
143
+ export function graphLanguage(graph) {
144
+ return graph.files.some((f) => f.language === 'py' || f.language === 'pyi') ? 'python' : 'ts';
145
+ }
146
+ //# sourceMappingURL=language.js.map