@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,53 @@
1
+ // Python standard-library top-level module names — the analogue of the ts-morph
2
+ // adapter's Node `isBuiltin` drop. stdlib imports are substrate, never
3
+ // diagram nodes: when Pyright (NoAccessHost, no venv) leaves a bare import
4
+ // unresolved AND the syntactic fallback finds no in-repo file, a top-level name in
5
+ // this set is DROPPED (not emitted as an external), exactly as Node builtins are
6
+ // dropped on the TS path. A first-party module that SHADOWS a stdlib name still
7
+ // wins — it resolves to a repo file first (Pyright Local / syntactic fallback), so
8
+ // this filter only ever sees genuinely-unresolved imports.
9
+ //
10
+ // Snapshot of `sys.stdlib_module_names` from CPython 3.12 (frozen; regenerate on a
11
+ // Python major bump). A pure static list — the pipeline never runs Python.
12
+ export const PYTHON_STDLIB = new Set([
13
+ '__future__', '_abc', '_aix_support', '_ast', '_asyncio', '_bisect', '_blake2', '_bz2',
14
+ '_codecs', '_codecs_cn', '_codecs_hk', '_codecs_iso2022', '_codecs_jp', '_codecs_kr',
15
+ '_codecs_tw', '_collections', '_collections_abc', '_compat_pickle', '_compression',
16
+ '_contextvars', '_crypt', '_csv', '_ctypes', '_curses', '_curses_panel', '_datetime', '_dbm',
17
+ '_decimal', '_elementtree', '_frozen_importlib', '_frozen_importlib_external', '_functools',
18
+ '_gdbm', '_hashlib', '_heapq', '_imp', '_io', '_json', '_locale', '_lsprof', '_lzma',
19
+ '_markupbase', '_md5', '_msi', '_multibytecodec', '_multiprocessing', '_opcode', '_operator',
20
+ '_osx_support', '_overlapped', '_pickle', '_posixshmem', '_posixsubprocess', '_py_abc',
21
+ '_pydatetime', '_pydecimal', '_pyio', '_pylong', '_queue', '_random', '_scproxy', '_sha1',
22
+ '_sha2', '_sha3', '_signal', '_sitebuiltins', '_socket', '_sqlite3', '_sre', '_ssl', '_stat',
23
+ '_statistics', '_string', '_strptime', '_struct', '_symtable', '_thread', '_threading_local',
24
+ '_tkinter', '_tokenize', '_tracemalloc', '_typing', '_uuid', '_warnings', '_weakref',
25
+ '_weakrefset', '_winapi', '_wmi', '_zoneinfo', 'abc', 'aifc', 'antigravity', 'argparse',
26
+ 'array', 'ast', 'asyncio', 'atexit', 'audioop', 'base64', 'bdb', 'binascii', 'bisect',
27
+ 'builtins', 'bz2', 'cProfile', 'calendar', 'cgi', 'cgitb', 'chunk', 'cmath', 'cmd', 'code',
28
+ 'codecs', 'codeop', 'collections', 'colorsys', 'compileall', 'concurrent', 'configparser',
29
+ 'contextlib', 'contextvars', 'copy', 'copyreg', 'crypt', 'csv', 'ctypes', 'curses',
30
+ 'dataclasses', 'datetime', 'dbm', 'decimal', 'difflib', 'dis', 'doctest', 'email',
31
+ 'encodings', 'ensurepip', 'enum', 'errno', 'faulthandler', 'fcntl', 'filecmp', 'fileinput',
32
+ 'fnmatch', 'fractions', 'ftplib', 'functools', 'gc', 'genericpath', 'getopt', 'getpass',
33
+ 'gettext', 'glob', 'graphlib', 'grp', 'gzip', 'hashlib', 'heapq', 'hmac', 'html', 'http',
34
+ 'idlelib', 'imaplib', 'imghdr', 'importlib', 'inspect', 'io', 'ipaddress', 'itertools',
35
+ 'json', 'keyword', 'lib2to3', 'linecache', 'locale', 'logging', 'lzma', 'mailbox', 'mailcap',
36
+ 'marshal', 'math', 'mimetypes', 'mmap', 'modulefinder', 'msilib', 'msvcrt',
37
+ 'multiprocessing', 'netrc', 'nis', 'nntplib', 'nt', 'ntpath', 'nturl2path', 'numbers',
38
+ 'opcode', 'operator', 'optparse', 'os', 'ossaudiodev', 'pathlib', 'pdb', 'pickle',
39
+ 'pickletools', 'pipes', 'pkgutil', 'platform', 'plistlib', 'poplib', 'posix', 'posixpath',
40
+ 'pprint', 'profile', 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'pydoc_data',
41
+ 'pyexpat', 'queue', 'quopri', 'random', 're', 'readline', 'reprlib', 'resource',
42
+ 'rlcompleter', 'runpy', 'sched', 'secrets', 'select', 'selectors', 'shelve', 'shlex',
43
+ 'shutil', 'signal', 'site', 'smtplib', 'sndhdr', 'socket', 'socketserver', 'spwd', 'sqlite3',
44
+ 'sre_compile', 'sre_constants', 'sre_parse', 'ssl', 'stat', 'statistics', 'string',
45
+ 'stringprep', 'struct', 'subprocess', 'sunau', 'symtable', 'sys', 'sysconfig', 'syslog',
46
+ 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios', 'textwrap', 'this', 'threading',
47
+ 'time', 'timeit', 'tkinter', 'token', 'tokenize', 'tomllib', 'trace', 'traceback',
48
+ 'tracemalloc', 'tty', 'turtle', 'turtledemo', 'types', 'typing', 'unicodedata', 'unittest',
49
+ 'urllib', 'uu', 'uuid', 'venv', 'warnings', 'wave', 'weakref', 'webbrowser', 'winreg',
50
+ 'winsound', 'wsgiref', 'xdrlib', 'xml', 'xmlrpc', 'zipapp', 'zipfile', 'zipimport', 'zlib',
51
+ 'zoneinfo',
52
+ ]);
53
+ //# sourceMappingURL=python-stdlib.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-stdlib.js","sourceRoot":"","sources":["../../src/graph/python-stdlib.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,uEAAuE;AACvE,2EAA2E;AAC3E,mFAAmF;AACnF,iFAAiF;AACjF,gFAAgF;AAChF,mFAAmF;AACnF,2DAA2D;AAC3D,EAAE;AACF,mFAAmF;AACnF,2EAA2E;AAE3E,MAAM,CAAC,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC;IACxD,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM;IACtF,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY;IACpF,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc;IAClF,cAAc,EAAE,QAAQ,EAAE,MA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Q,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU;IAC/E,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO;IACpF,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS;IAC5F,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ;IAClF,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ;IACvF,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW;IAC1F,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW;IACjF,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU;IAC1F,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ;IACrF,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM;IAC1F,UAAU;CACX,CAAC,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { Project, type SourceFile } from 'ts-morph';
2
+ import { type GraphExtractor, type NormalizedGraph } from './types.js';
3
+ import { type FileRecord } from './file-graph.js';
4
+ export declare function toId(root: string, absPath: string): string;
5
+ /**
6
+ * Read + JSONC-parse the nearest tsconfig/jsconfig in `repoDir`, returning the
7
+ * config dir plus its raw compilerOptions baseUrl/paths — or undefined if none
8
+ * of the candidates declares either.
9
+ *
10
+ * tsconfig is JSONC, NOT strict JSON: it permits `//` + block comments AND
11
+ * trailing commas. A plain `JSON.parse` THROWS on a trailing comma, which
12
+ * silently dropped EVERY path alias on the very common real-world shape (e.g.
13
+ * Bluesky's `"paths": { "#/*": ["./src/*"], }`). We strip comments
14
+ * AND trailing commas before parsing. We do NOT follow `extends` chains (a
15
+ * deliberate non-goal — `paths` lives in the root tsconfig in practice; an
16
+ * inherited-only paths block degrades to no aliasing rather than misfiring).
17
+ * The FIRST candidate that declares baseUrl||paths wins (the config the TS
18
+ * compiler itself would load); a malformed candidate is skipped.
19
+ *
20
+ * Exported so the framework adapters (React-Native's alias reader) consume the
21
+ * SAME comment/comma tolerance — the central resolver and the adapters cannot
22
+ * drift on what counts as a parseable tsconfig.
23
+ */
24
+ export declare function readTsconfigCompilerOptions(repoDir: string): {
25
+ dir: string;
26
+ baseUrl?: string;
27
+ paths?: Record<string, string[]>;
28
+ } | undefined;
29
+ /**
30
+ * Build the install-free extraction Project for `root` (tsconfig paths/baseUrl
31
+ * read fresh — so a config-invalidator re-seed picks up resolution changes).
32
+ * Resolution settings chosen to resolve BOTH extensionless and .js-suffixed
33
+ * relative imports against .ts sources, plus tsconfig path aliases — without
34
+ * any installed dependencies.
35
+ */
36
+ export declare function buildExtractionProject(root: string): Project;
37
+ /** Add every source file under `root` to the project (the adapter's glob). */
38
+ export declare function addAllSourceFiles(project: Project, root: string): void;
39
+ /**
40
+ * Extract ONE file's CHEAP half: loc/language, resolved internal import +
41
+ * re-export targets, and external packages — an AST walk of the top-level
42
+ * declarations + module resolution, NO type-checker symbol work. `calls` is
43
+ * left empty; extractFileCalls below fills it. The incremental engine uses
44
+ * this pass alone for files whose imports must re-resolve but whose call
45
+ * bindings provably didn't move.
46
+ *
47
+ * `internalIds` is the CURRENT tree's source-file id set — resolution outside
48
+ * it (e.g. a stray .d.ts) is ignored, matching the original batch behavior.
49
+ */
50
+ export declare function extractFileImportsRecord(sf: SourceFile, root: string, internalIds: ReadonlySet<string>): FileRecord;
51
+ /**
52
+ * The EXPENSIVE half: best-effort typed call edges — resolve each call
53
+ * target's symbol to its declaring source file via the type checker.
54
+ * Internal-only (externals already captured via imports). Wrapped defensively
55
+ * — without installed types some resolutions throw; we degrade to import-only
56
+ * edges rather than fail the extraction.
57
+ */
58
+ export declare function extractFileCalls(sf: SourceFile, root: string, internalIds: ReadonlySet<string>): FileRecord['calls'];
59
+ /** Both halves: the complete per-file extraction (imports + calls). */
60
+ export declare function extractFileRecord(sf: SourceFile, root: string, internalIds: ReadonlySet<string>): FileRecord;
61
+ export declare class TsMorphExtractor implements GraphExtractor {
62
+ readonly language = "typescript";
63
+ extract(repoDir: string): Promise<NormalizedGraph>;
64
+ }
65
+ //# sourceMappingURL=ts-morph-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ts-morph-adapter.d.ts","sourceRoot":"","sources":["../../src/graph/ts-morph-adapter.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,OAAO,EAKP,KAAK,UAAU,EAEhB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAsC,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3G,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAEzB,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAOD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GACvD;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GACnE,SAAS,CAqBZ;AAiCD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAkB5D;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAItE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAC/B,UAAU,CA+CZ;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAC/B,UAAU,CAAC,OAAO,CAAC,CA6BrB;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,UAAU,CAI5G;AAUD,qBAAa,gBAAiB,YAAW,cAAc;IACrD,QAAQ,CAAC,QAAQ,gBAAgB;IAE3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAiBzD"}
@@ -0,0 +1,265 @@
1
+ // ts-morph (TS compiler API) extractor (/325) — the P3 structural adapter.
2
+ //
3
+ // INSTALL-FREE by design: we never `npm install` the target repo. Internal
4
+ // imports/calls resolve from SOURCE (the clone's own files + its tsconfig
5
+ // paths/baseUrl); anything that doesn't resolve internally is a bare specifier
6
+ // → an EXTERNAL node. This is both a feature (we want externals as nodes, not
7
+ // resolved into node_modules) and a safety property (no untrusted postinstall
8
+ // scripts run). Plain-JS repos (no tsconfig) are handled with sane defaults.
9
+ //
10
+ // Stage A: the per-file extraction is factored into exported helpers
11
+ // (buildExtractionProject / addAllSourceFiles / extractFileRecord) shared with
12
+ // the diff-driven incremental engine (incremental.ts), so the batch and
13
+ // incremental paths CANNOT drift — both produce FileRecords and assemble the
14
+ // NormalizedGraph through graphFromState. The equivalence fixture test guards
15
+ // this (full extract vs seed+patches must be identical).
16
+ import { readFileSync, existsSync } from 'node:fs';
17
+ import { relative, resolve, dirname } from 'node:path';
18
+ import { isBuiltin } from 'node:module';
19
+ import { Project, SyntaxKind, ModuleResolutionKind, ModuleKind, ScriptTarget, } from 'ts-morph';
20
+ import { externalIdFor, isRelativeSpecifier } from './types.js';
21
+ import { graphFromState, SOURCE_EXTENSIONS, EXCLUDE_DIRS, } from './file-graph.js';
22
+ export function toId(root, absPath) {
23
+ return relative(root, absPath).split(/[\\/]/).join('/');
24
+ }
25
+ function languageOf(path) {
26
+ const m = path.match(/\.([cm]?[tj]sx?)$/);
27
+ return m ? m[1] : 'ts';
28
+ }
29
+ /**
30
+ * Read + JSONC-parse the nearest tsconfig/jsconfig in `repoDir`, returning the
31
+ * config dir plus its raw compilerOptions baseUrl/paths — or undefined if none
32
+ * of the candidates declares either.
33
+ *
34
+ * tsconfig is JSONC, NOT strict JSON: it permits `//` + block comments AND
35
+ * trailing commas. A plain `JSON.parse` THROWS on a trailing comma, which
36
+ * silently dropped EVERY path alias on the very common real-world shape (e.g.
37
+ * Bluesky's `"paths": { "#/*": ["./src/*"], }`). We strip comments
38
+ * AND trailing commas before parsing. We do NOT follow `extends` chains (a
39
+ * deliberate non-goal — `paths` lives in the root tsconfig in practice; an
40
+ * inherited-only paths block degrades to no aliasing rather than misfiring).
41
+ * The FIRST candidate that declares baseUrl||paths wins (the config the TS
42
+ * compiler itself would load); a malformed candidate is skipped.
43
+ *
44
+ * Exported so the framework adapters (React-Native's alias reader) consume the
45
+ * SAME comment/comma tolerance — the central resolver and the adapters cannot
46
+ * drift on what counts as a parseable tsconfig.
47
+ */
48
+ export function readTsconfigCompilerOptions(repoDir) {
49
+ for (const name of ['tsconfig.json', 'tsconfig.base.json', 'jsconfig.json']) {
50
+ const p = resolve(repoDir, name);
51
+ if (!existsSync(p))
52
+ continue;
53
+ try {
54
+ const raw = readFileSync(p, 'utf8')
55
+ .replace(/\/\*[\s\S]*?\*\//g, '') // /* block comments */
56
+ .replace(/(^|[^:])\/\/.*$/gm, '$1') // // line comments (not the // in a URL)
57
+ .replace(/,(\s*[}\]])/g, '$1'); // trailing commas (JSONC allows; JSON.parse doesn't)
58
+ const json = JSON.parse(raw);
59
+ const co = json.compilerOptions ?? {};
60
+ if (co.baseUrl || co.paths) {
61
+ return { dir: dirname(p), baseUrl: co.baseUrl, paths: co.paths };
62
+ }
63
+ }
64
+ catch {
65
+ // Malformed candidate — try the next name, else fall through to undefined.
66
+ }
67
+ }
68
+ return undefined;
69
+ }
70
+ // Lightweight tsconfig read for path-alias resolution feeding the in-memory
71
+ // extraction Project. Returns the ABSOLUTE baseUrl + alias paths.
72
+ //
73
+ // when `paths` is declared with NO `baseUrl`, the relative `./src/*`
74
+ // targets must anchor on the tsconfig's OWN directory (the TS ≥4.1 implicit
75
+ // base). An on-disk tsconfig gives the compiler that location for free; our
76
+ // in-memory Project (compilerOptions only, no tsconfig path) does NOT, so
77
+ // ts-morph mis-anchors the relative target and every aliased internal import
78
+ // silently falls out as an EXTERNAL node — under-connecting the graph. We set
79
+ // baseUrl to the config dir explicitly to recover the standard semantics.
80
+ //
81
+ // We anchor ONLY when there are actual alias entries: an explicit `baseUrl`, or
82
+ // a NON-EMPTY `paths`. A bare `paths: {}` (no baseUrl) must stay baseUrl-less —
83
+ // setting one would switch on baseUrl-relative resolution of *bare* specifiers
84
+ // against the repo root (which TS ≥4.1 paths-without-baseUrl does NOT do), risking
85
+ // a genuine external being mis-resolved as internal.
86
+ function readTsconfigPaths(repoDir) {
87
+ const co = readTsconfigCompilerOptions(repoDir);
88
+ if (!co)
89
+ return {};
90
+ const hasAliases = co.paths != null && Object.keys(co.paths).length > 0;
91
+ const baseUrl = co.baseUrl
92
+ ? resolve(co.dir, co.baseUrl)
93
+ : hasAliases
94
+ ? co.dir // no baseUrl + non-empty paths → anchor on the tsconfig dir (TS ≥4.1)
95
+ : undefined;
96
+ return { baseUrl, paths: co.paths };
97
+ }
98
+ /**
99
+ * Build the install-free extraction Project for `root` (tsconfig paths/baseUrl
100
+ * read fresh — so a config-invalidator re-seed picks up resolution changes).
101
+ * Resolution settings chosen to resolve BOTH extensionless and .js-suffixed
102
+ * relative imports against .ts sources, plus tsconfig path aliases — without
103
+ * any installed dependencies.
104
+ */
105
+ export function buildExtractionProject(root) {
106
+ const { baseUrl, paths } = readTsconfigPaths(root);
107
+ return new Project({
108
+ skipAddingFilesFromTsConfig: true,
109
+ skipFileDependencyResolution: true,
110
+ skipLoadingLibFiles: true,
111
+ compilerOptions: {
112
+ allowJs: true,
113
+ checkJs: false,
114
+ noEmit: true,
115
+ moduleResolution: ModuleResolutionKind.Bundler,
116
+ module: ModuleKind.ESNext,
117
+ target: ScriptTarget.ESNext,
118
+ allowImportingTsExtensions: true,
119
+ baseUrl,
120
+ paths,
121
+ },
122
+ });
123
+ }
124
+ /** Add every source file under `root` to the project (the adapter's glob). */
125
+ export function addAllSourceFiles(project, root) {
126
+ const includeGlobs = [`${root}/**/*.{${SOURCE_EXTENSIONS.join(',')}}`];
127
+ const excludeGlobs = EXCLUDE_DIRS.map((d) => `!${root}/**/${d}/**`);
128
+ project.addSourceFilesAtPaths([...includeGlobs, ...excludeGlobs]);
129
+ }
130
+ /**
131
+ * Extract ONE file's CHEAP half: loc/language, resolved internal import +
132
+ * re-export targets, and external packages — an AST walk of the top-level
133
+ * declarations + module resolution, NO type-checker symbol work. `calls` is
134
+ * left empty; extractFileCalls below fills it. The incremental engine uses
135
+ * this pass alone for files whose imports must re-resolve but whose call
136
+ * bindings provably didn't move.
137
+ *
138
+ * `internalIds` is the CURRENT tree's source-file id set — resolution outside
139
+ * it (e.g. a stray .d.ts) is ignored, matching the original batch behavior.
140
+ */
141
+ export function extractFileImportsRecord(sf, root, internalIds) {
142
+ const fromId = toId(root, sf.getFilePath());
143
+ const importWeights = new Map();
144
+ const externalWeights = new Map();
145
+ const reexports = new Set();
146
+ // Static import/export declarations → import edges. Internal when the
147
+ // specifier resolves to a project source file; bare unresolved specifier →
148
+ // external node.
149
+ const decls = [...sf.getImportDeclarations(), ...sf.getExportDeclarations()];
150
+ for (const decl of decls) {
151
+ const spec = decl.getModuleSpecifierValue();
152
+ if (!spec)
153
+ continue; // e.g. bare `export { x }` with no `from`
154
+ const resolved = decl.getModuleSpecifierSourceFile();
155
+ if (resolved) {
156
+ const toId_ = toId(root, resolved.getFilePath());
157
+ if (toId_ === fromId)
158
+ continue; // ignore self-references
159
+ if (internalIds.has(toId_)) {
160
+ importWeights.set(toId_, (importWeights.get(toId_) ?? 0) + 1);
161
+ // `export … from` — the re-export surface a change propagates through
162
+ // (the incremental engine's dependents closure follows these).
163
+ if (decl.getKind() === SyntaxKind.ExportDeclaration)
164
+ reexports.add(toId_);
165
+ }
166
+ // resolved-but-outside-project (e.g. a .d.ts) → ignore
167
+ }
168
+ else if (!isRelativeSpecifier(spec) && !isBuiltin(spec)) {
169
+ // Builtins shortcut ( / , fixes ): Node builtins
170
+ // (`fs`, `node:fs`, `path`, `crypto`, …) are substrate, never diagram
171
+ // nodes. Dropping them at the source means they never become a graph
172
+ // external, never reach the LLM classifier, and never cost a token.
173
+ // `isBuiltin` matches both the bare (`fs`) and `node:`-prefixed
174
+ // (`node:fs`) forms, so the policy is uniform regardless of import style.
175
+ const ext = externalIdFor(spec);
176
+ const existing = externalWeights.get(ext.id);
177
+ if (existing)
178
+ existing.weight += 1;
179
+ else
180
+ externalWeights.set(ext.id, { specifier: ext.specifier, weight: 1 });
181
+ }
182
+ // unresolved relative specifier → skip (missing file / dynamic)
183
+ }
184
+ return {
185
+ loc: sf.getEndLineNumber(),
186
+ language: languageOf(fromId),
187
+ imports: [...importWeights].map(([to, weight]) => ({ to, weight })),
188
+ externals: [...externalWeights].map(([id, v]) => ({ id, specifier: v.specifier, weight: v.weight })),
189
+ calls: [],
190
+ reexports: [...reexports],
191
+ };
192
+ }
193
+ /**
194
+ * The EXPENSIVE half: best-effort typed call edges — resolve each call
195
+ * target's symbol to its declaring source file via the type checker.
196
+ * Internal-only (externals already captured via imports). Wrapped defensively
197
+ * — without installed types some resolutions throw; we degrade to import-only
198
+ * edges rather than fail the extraction.
199
+ */
200
+ export function extractFileCalls(sf, root, internalIds) {
201
+ const callWeights = new Map();
202
+ try {
203
+ // CallExpression (`foo()`, `obj.method()`) AND NewExpression (`new Foo()`).
204
+ // adds instantiation: `new ServiceClass()` is a real
205
+ // runtime dependency, stronger evidence than a bare import, and gives the
206
+ // edge-kind LLM more non-import signal to label `calls` over coupling.
207
+ // Both node kinds expose getExpression(); method dispatch on a typed
208
+ // receiver resolves through the PropertyAccessExpression's symbol.
209
+ const sites = [
210
+ ...sf.getDescendantsOfKind(SyntaxKind.CallExpression),
211
+ ...sf.getDescendantsOfKind(SyntaxKind.NewExpression),
212
+ ];
213
+ for (const site of sites) {
214
+ const expr = site.getExpression();
215
+ if (!expr)
216
+ continue; // malformed `new` with no callee
217
+ const sym = symbolOf(expr);
218
+ const sdecls = sym?.getDeclarations() ?? [];
219
+ for (const d of sdecls) {
220
+ const declSf = d.getSourceFile();
221
+ if (declSf === sf)
222
+ continue;
223
+ const toId_ = toId(root, declSf.getFilePath());
224
+ if (internalIds.has(toId_))
225
+ callWeights.set(toId_, (callWeights.get(toId_) ?? 0) + 1);
226
+ }
227
+ }
228
+ }
229
+ catch {
230
+ // resolution unavailable for this file — import edges still stand
231
+ }
232
+ return [...callWeights].map(([to, weight]) => ({ to, weight }));
233
+ }
234
+ /** Both halves: the complete per-file extraction (imports + calls). */
235
+ export function extractFileRecord(sf, root, internalIds) {
236
+ const rec = extractFileImportsRecord(sf, root, internalIds);
237
+ rec.calls = extractFileCalls(sf, root, internalIds);
238
+ return rec;
239
+ }
240
+ function symbolOf(expr) {
241
+ try {
242
+ return expr.getSymbol();
243
+ }
244
+ catch {
245
+ return undefined;
246
+ }
247
+ }
248
+ export class TsMorphExtractor {
249
+ language = 'typescript';
250
+ async extract(repoDir) {
251
+ const root = resolve(repoDir);
252
+ const project = buildExtractionProject(root);
253
+ addAllSourceFiles(project, root);
254
+ const sourceFiles = project.getSourceFiles();
255
+ const internalIds = new Set(sourceFiles.map((sf) => toId(root, sf.getFilePath())));
256
+ const files = {};
257
+ for (const sf of sourceFiles) {
258
+ files[toId(root, sf.getFilePath())] = extractFileRecord(sf, root, internalIds);
259
+ }
260
+ // headSha is irrelevant for a one-shot batch extract; graphFromState only
261
+ // reads the per-file records.
262
+ return graphFromState(root, { headSha: '', files });
263
+ }
264
+ }
265
+ //# sourceMappingURL=ts-morph-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ts-morph-adapter.js","sourceRoot":"","sources":["../../src/graph/ts-morph-adapter.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,EAAE;AACF,qEAAqE;AACrE,+EAA+E;AAC/E,wEAAwE;AACxE,6EAA6E;AAC7E,8EAA8E;AAC9E,yDAAyD;AAEzD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,OAAO,EACP,UAAU,EACV,oBAAoB,EACpB,UAAU,EACV,YAAY,GAGb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAA6C,MAAM,YAAY,CAAC;AAC3G,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,YAAY,GAEb,MAAM,iBAAiB,CAAC;AAEzB,MAAM,UAAU,IAAI,CAAC,IAAY,EAAE,OAAe;IAChD,OAAO,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,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W,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;QAC7C,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;QAE3F,MAAM,KAAK,GAA+B,EAAE,CAAC;QAC7C,KAAK,MAAM,EAAE,IAAI,WAAW,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QACjF,CAAC;QAED,0EAA0E;QAC1E,8BAA8B;QAC9B,OAAO,cAAc,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;CACF"}
@@ -0,0 +1,37 @@
1
+ export interface GraphFile {
2
+ id: string;
3
+ loc: number;
4
+ language: string;
5
+ }
6
+ export type EdgeKind = 'import' | 'call';
7
+ export interface GraphEdge {
8
+ from: string;
9
+ to: string;
10
+ kind: EdgeKind;
11
+ external: boolean;
12
+ weight: number;
13
+ }
14
+ export interface ExternalNode {
15
+ id: string;
16
+ specifier: string;
17
+ }
18
+ export interface NormalizedGraph {
19
+ root: string;
20
+ files: GraphFile[];
21
+ edges: GraphEdge[];
22
+ externals: ExternalNode[];
23
+ }
24
+ export interface GraphExtractor {
25
+ readonly language: string;
26
+ extract(repoDir: string): Promise<NormalizedGraph>;
27
+ }
28
+ export declare function externalIdFor(specifier: string): {
29
+ id: string;
30
+ specifier: string;
31
+ };
32
+ export declare function isRelativeSpecifier(spec: string): boolean;
33
+ export declare function pythonExternalIdFor(moduleName: string): {
34
+ id: string;
35
+ specifier: string;
36
+ };
37
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B;AAID,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACpD;AAKD,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAYlF;AAWD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAUD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAGzF"}
@@ -0,0 +1,50 @@
1
+ // The normalized graph interface (/325) — the pluggable seam of the
2
+ // extraction architecture.
3
+ //
4
+ // per-language extractor adapter → [NormalizedGraph] → clustering → LLM → DB
5
+ //
6
+ // EVERY extractor targets this shape and EVERY downstream layer (Louvain
7
+ // clustering, LLM naming, persistence) consumes only this shape. That's what
8
+ // makes multilingual support (P4: Python/Go/… adapters) ADDITIVE — a new
9
+ // adapter, not a rewrite. Structure here is DERIVED deterministically; the LLM
10
+ // never authors it (the locked /325 split).
11
+ // Collapse a bare specifier to its package node id: `@scope/pkg/sub` →
12
+ // `ext:@scope/pkg`, `pkg/sub` → `ext:pkg`. Strips Deno-style `jsr:`/`npm:`
13
+ // registry prefixes (e.g. `jsr:@supabase/functions-js` → `ext:@supabase/functions-js`).
14
+ export function externalIdFor(specifier) {
15
+ const bare = specifier.replace(/^(jsr:|npm:|node:)/, '');
16
+ const parts = bare.split('/');
17
+ const withVersion = bare.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0];
18
+ // Deno-style specifiers pin a version on the package itself
19
+ // (`npm:@supabase/supabase-js@2`, `npm:lodash@4`). Strip it so the node is the
20
+ // package, not the package+version — otherwise the `@2` is an invalid
21
+ // package-name char and the classifier's fail-loud boundary rejects it.
22
+ // The leading `@` of a scope is preserved; only a version `@` (after the name)
23
+ // is dropped.
24
+ const pkg = stripPackageVersion(withVersion);
25
+ return { id: `ext:${pkg}`, specifier: pkg };
26
+ }
27
+ // `@scope/name@1.2.3` → `@scope/name`; `lodash@4` → `lodash`.
28
+ function stripPackageVersion(pkg) {
29
+ const m = pkg.startsWith('@')
30
+ ? pkg.match(/^(@[^/]+\/[^/@]+)/)
31
+ : pkg.match(/^([^/@]+)/);
32
+ return m ? m[1] : pkg;
33
+ }
34
+ // Is a module specifier internal (relative/absolute path) vs a bare package?
35
+ export function isRelativeSpecifier(spec) {
36
+ return spec.startsWith('./') || spec.startsWith('../') || spec === '.' || spec === '..';
37
+ }
38
+ // Collapse a Python DOTTED module name to its distribution node id —
39
+ // the analogue of externalIdFor for the Pyright adapter. Python imports are
40
+ // dotted, not slash-separated: `sqlalchemy.orm` and `google.cloud.storage` both
41
+ // belong to their TOP-LEVEL import package (`sqlalchemy`, `google`), mirroring how
42
+ // `@scope/pkg/sub` collapses to `@scope/pkg` on the npm side. The top-level import
43
+ // name (what appears in source) is used as the id; the import-name→PyPI-dist alias
44
+ // (`cv2`→opencv-python, `yaml`→PyYAML) is a metadata-fetch concern, not a node id.
45
+ // A relative import (leading dot) must NEVER reach here — it's always first-party.
46
+ export function pythonExternalIdFor(moduleName) {
47
+ const top = moduleName.replace(/^\.+/, '').split('.')[0];
48
+ return { id: `ext:${top}`, specifier: top };
49
+ }
50
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,2BAA2B;AAC3B,EAAE;AACF,+EAA+E;AAC/E,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,yEAAyE;AACzE,+EAA+E;AAC/E,4CAA4C;AA8C5C,uEAAuE;AACvE,2EAA2E;AAC3E,wFAAwF;AACxF,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACzD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAClF,4DAA4D;IAC5D,+EAA+E;IAC/E,sEAAsE;IACtE,wEAAwE;IACxE,+EAA+E;IAC/E,cAAc;IACd,MAAM,GAAG,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC7C,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;AAC9C,CAAC;AAED,8DAA8D;AAC9D,SAAS,mBAAmB,CAAC,GAAW;IACtC,MAAM,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;QAC3B,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC;QAChC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAC3B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AACxB,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC;AAC1F,CAAC;AAED,qEAAqE;AACrE,4EAA4E;AAC5E,gFAAgF;AAChF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,OAAO,EAAE,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,45 @@
1
+ export { extract } from './extract.js';
2
+ export type { ExtractOptions, ExtractResult } from './extract.js';
3
+ export { EXTRACTOR_PACKAGE_VERSION } from './version.js';
4
+ export { ShortSha, ModuleId, parseModuleKind, parseEdgeKind, coerceEdgeKind, INFRA_MODULE_KINDS, MODULE_KINDS, EDGE_KINDS, FORBIDDEN_EDGE_KINDS, } from './types.js';
5
+ export type { ModuleKind, InfraModuleKind, NodeProvenance, PackageRole, EdgeKind, ForbiddenEdgeKind, Edge, } from './types.js';
6
+ export { extractGraph, mergeGraphs } from './graph/extract.js';
7
+ export { externalIdFor, isRelativeSpecifier, pythonExternalIdFor } from './graph/types.js';
8
+ export type { GraphFile, GraphEdge, ExternalNode, NormalizedGraph, GraphExtractor, } from './graph/types.js';
9
+ export { IncrementalExtractor } from './graph/incremental.js';
10
+ export type { PatchMetrics } from './graph/incremental.js';
11
+ export { SOURCE_EXTENSIONS, PYTHON_SOURCE_EXTENSIONS, EXCLUDE_DIRS, PYTHON_EXCLUDE_DIRS, isSourceFilePath, isConfigInvalidatorPath, EXTRACTOR_VERSION, graphFromState, classifyDiff, reexportClosure, computeCallPatchUnit, FILE_GRAPH_VERSION, serializeFileGraph, isValidFileRecord, deserializeFileGraph, diffFileGraphStates, } from './graph/file-graph.js';
12
+ export type { SourceLang, FileEdgeRef, FileExternalRef, FileRecord, FileGraphState, DiffEntry, ClassifiedDiff, SerializedFileGraph, } from './graph/file-graph.js';
13
+ export { listSourceFiles, detectRepoLanguage, detectRepoLanguages, graphLanguage, } from './graph/language.js';
14
+ export { NOISE_CATEGORIES, NOISE_RULES, classifyNoise, filterNoise, summarizeNoise } from './graph/noise-filter.js';
15
+ export type { NoiseCategory, NoiseRule, DroppedNoise } from './graph/noise-filter.js';
16
+ export { crossLanguageApiEdges } from './graph/cross-language.js';
17
+ export { clusterGraph, stabilizeModuleIds, detectGodNodes, betweenness, PackagePartitionCache, } from './cluster/louvain.js';
18
+ export type { ClusteredModule, ModuleEdge, ClusterResult, ClusterOptions } from './cluster/louvain.js';
19
+ export { isWorkspaceManifestPath, detectWorkspaceLayout } from './cluster/workspaces.js';
20
+ export type { WorkspacePackage, WorkspaceLayout } from './cluster/workspaces.js';
21
+ export { compileMatchers, slugify } from './cluster/overrides.js';
22
+ export type { AssignRule, LabelOverride, OverrideMap } from './cluster/overrides.js';
23
+ export { EXTERNAL_SUBSYSTEM_ID, DIR_SUBSYSTEM_PREFIX, PKG_SUBSYSTEM_PREFIX, DOMAIN_SUBSYSTEM_PREFIX, RESERVED_SUBSYSTEM_PREFIXES, bareSubsystemSlug, dominantTopLevelDir, humanizeDir, computeSubsystems, distinctSubsystems, } from './cluster/subsystem.js';
24
+ export type { Subsystem } from './cluster/subsystem.js';
25
+ export { moduleSignature, mintGroupId, namespaceModelIds, selectPending, buildFullModel, buildIncrementalModel, reconcileGroupIds, finalizeModel, groupToSubsystem, } from './cluster/domain-grouping.js';
26
+ export type { DomainGroup, ModuleAssignment, GroupingModel, ProposedGroup, LlmGrouping, ModuleSignal, } from './cluster/domain-grouping.js';
27
+ export { LAYER_NAMES, GATE_THRESHOLDS, isFrameworkSubsystemId, evaluateGroupingGate, } from './cluster/grouping-gate.js';
28
+ export type { GateModule, GroupingGateResult } from './cluster/grouping-gate.js';
29
+ export { detectFrameworkStack } from './framework/detect-step.js';
30
+ export { contributeFrameworkGraph } from './framework/contribute-step.js';
31
+ export type { FrameworkContributions } from './framework/contribute-step.js';
32
+ export { registerFrameworkAdapter, listFrameworkAdapters, clearFrameworkAdapters, detectFrameworks, } from './framework/registry.js';
33
+ export { registerBuiltinFrameworkAdapters } from './framework/register.js';
34
+ export { analyzeOrmDataModel } from './framework/orm/orm.js';
35
+ export type { OrmDataModel } from './framework/orm/orm.js';
36
+ export type { FrameworkDetectContext, DetectMatch, FrameworkManifest, FrameworkClusterView, FrameworkContext, FrameworkGroup, FrameworkGroupingPrior, FrameworkEdge, RoleTag, FrameworkClassificationRef, FrameworkAdapter, } from './framework/types.js';
37
+ export { extractInfra } from './infra/infra-step.js';
38
+ export type { ResourceTypeRef, ResourceTypeResult, ResourceTypeClassifier, InfraStepResult, } from './infra/infra-step.js';
39
+ export { registerInfraAdapter, listInfraAdapters, activeSourceScanners, clearInfraAdapters, runInfraAdapters, mergeInfraGraphs, validateMergedGraph, } from './infra/registry.js';
40
+ export { registerBuiltinInfraAdapters } from './infra/register.js';
41
+ export { isInfraRelevantPath, diffTouchesInfra, diffTouchesInfraWithSources } from './infra/relevance.js';
42
+ export type { InfraAdapter, InfraNode, InfraEdge, ClassificationRef, InfraGraph, MergedInfraGraph, } from './infra/types.js';
43
+ export { DEFAULT_BUDGET, enforceSourceBudget } from './safety.js';
44
+ export type { SafetyBudget } from './safety.js';
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,QAAQ,EACR,iBAAiB,EACjB,IAAI,GACL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3F,YAAY,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACZ,eAAe,EACf,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EACl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EAChB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAC1G,YAAY,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,51 @@
1
+ // @backthread/extractor — deterministic, install-free structural extraction for
2
+ // TypeScript and Python codebases.
3
+ //
4
+ // Turns a working tree into a structural graph: modules (with kinds, god-node
5
+ // flags, and path-derived subsystems), edges, communities, framework roles, and
6
+ // infrastructure — with ZERO LLM, database, or network. AST via ts-morph (TS)
7
+ // and Pyright's NoAccessHost (Python, pure-static, never executes repo code);
8
+ // Louvain community detection; a framework-adapter fleet; and static
9
+ // infra-config readers.
10
+ //
11
+ // The one-shot `extract()` is the convenience surface; every granular stage is
12
+ // exported too, so a host can interleave its own steps (e.g. an incremental
13
+ // diff-driven re-extract, or a warm-started cluster) between them.
14
+ // ── Composed one-shot ──
15
+ export { extract } from './extract.js';
16
+ // ── Version (for the container↔CLI version-lockstep guard) ──
17
+ export { EXTRACTOR_PACKAGE_VERSION } from './version.js';
18
+ // ── Structural type vocabulary (the domain types) ──
19
+ export { ShortSha, ModuleId, parseModuleKind, parseEdgeKind, coerceEdgeKind, INFRA_MODULE_KINDS, MODULE_KINDS, EDGE_KINDS, FORBIDDEN_EDGE_KINDS, } from './types.js';
20
+ // ── Graph: AST → normalized code graph ──
21
+ export { extractGraph, mergeGraphs } from './graph/extract.js';
22
+ export { externalIdFor, isRelativeSpecifier, pythonExternalIdFor } from './graph/types.js';
23
+ export { IncrementalExtractor } from './graph/incremental.js';
24
+ export { SOURCE_EXTENSIONS, PYTHON_SOURCE_EXTENSIONS, EXCLUDE_DIRS, PYTHON_EXCLUDE_DIRS, isSourceFilePath, isConfigInvalidatorPath, EXTRACTOR_VERSION, graphFromState, classifyDiff, reexportClosure, computeCallPatchUnit, FILE_GRAPH_VERSION, serializeFileGraph, isValidFileRecord, deserializeFileGraph, diffFileGraphStates, } from './graph/file-graph.js';
25
+ export { listSourceFiles, detectRepoLanguage, detectRepoLanguages, graphLanguage, } from './graph/language.js';
26
+ export { NOISE_CATEGORIES, NOISE_RULES, classifyNoise, filterNoise, summarizeNoise } from './graph/noise-filter.js';
27
+ export { crossLanguageApiEdges } from './graph/cross-language.js';
28
+ // ── Cluster: Louvain → modules, god-nodes, subsystems ──
29
+ export { clusterGraph, stabilizeModuleIds, detectGodNodes, betweenness, PackagePartitionCache, } from './cluster/louvain.js';
30
+ export { isWorkspaceManifestPath, detectWorkspaceLayout } from './cluster/workspaces.js';
31
+ export { compileMatchers, slugify } from './cluster/overrides.js';
32
+ export { EXTERNAL_SUBSYSTEM_ID, DIR_SUBSYSTEM_PREFIX, PKG_SUBSYSTEM_PREFIX, DOMAIN_SUBSYSTEM_PREFIX, RESERVED_SUBSYSTEM_PREFIXES, bareSubsystemSlug, dominantTopLevelDir, humanizeDir, computeSubsystems, distinctSubsystems, } from './cluster/subsystem.js';
33
+ export { moduleSignature, mintGroupId, namespaceModelIds, selectPending, buildFullModel, buildIncrementalModel, reconcileGroupIds, finalizeModel, groupToSubsystem, } from './cluster/domain-grouping.js';
34
+ export { LAYER_NAMES, GATE_THRESHOLDS, isFrameworkSubsystemId, evaluateGroupingGate, } from './cluster/grouping-gate.js';
35
+ // ── Framework adapters ──
36
+ export { detectFrameworkStack } from './framework/detect-step.js';
37
+ export { contributeFrameworkGraph } from './framework/contribute-step.js';
38
+ export { registerFrameworkAdapter, listFrameworkAdapters, clearFrameworkAdapters, detectFrameworks, } from './framework/registry.js';
39
+ export { registerBuiltinFrameworkAdapters } from './framework/register.js';
40
+ // The ORM data-model analysis (entities + relationships) a host applies onto the
41
+ // graph during assembly — the granular ORM surface, exported for hosts that
42
+ // enrich the graph with ORM structure (e.g. the ingest container's assemble step).
43
+ export { analyzeOrmDataModel } from './framework/orm/orm.js';
44
+ // ── Infra adapters (static config reads only) ──
45
+ export { extractInfra } from './infra/infra-step.js';
46
+ export { registerInfraAdapter, listInfraAdapters, activeSourceScanners, clearInfraAdapters, runInfraAdapters, mergeInfraGraphs, validateMergedGraph, } from './infra/registry.js';
47
+ export { registerBuiltinInfraAdapters } from './infra/register.js';
48
+ export { isInfraRelevantPath, diffTouchesInfra, diffTouchesInfraWithSources } from './infra/relevance.js';
49
+ // ── Safety: pre-extraction source-budget guard ──
50
+ export { DEFAULT_BUDGET, enforceSourceBudget } from './safety.js';
51
+ //# sourceMappingURL=index.js.map