@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,402 @@
1
+ // Pyright-driven Python structural extractor — the first non-TS
2
+ // GraphExtractor. Mirrors the ts-morph adapter's contract: emit FileRecords, hand
3
+ // them to the shared graphFromState assembler, and let everything downstream
4
+ // (Louvain, stabilizeModuleIds, subsystem/domain grouping, the whole enrich stage)
5
+ // consume the identical NormalizedGraph unchanged.
6
+ //
7
+ // INSTALL-FREE + PURE-STATIC by construction — the two locked constraints:
8
+ // • We drive Pyright DIRECTLY (its ImportResolver, via a Program) as the
9
+ // semantic tier. Pyright resolves FIRST-PARTY (in-repo) imports from workspace
10
+ // source with NO venv — workspace-root + `src/` + namespace-package + relative
11
+ // resolution all work out of the box (verified). It is pure TypeScript: no
12
+ // native binary, so it runs identically local + in the destroy-on-exit
13
+ // container.
14
+ // • We use `NoAccessHost`, NOT FullAccessHost — FullAccessHost shells out to the
15
+ // host's Python interpreter to discover search paths (a subprocess + a host
16
+ // dependency + non-determinism). NoAccessHost never spawns anything and never
17
+ // touches a venv, so resolution depends ONLY on the repo's own source — the
18
+ // install-free promise, enforced. The toolchain never executes repo code
19
+ // (no setup.py, no import of target modules, no app boot).
20
+ //
21
+ // Third-party + stdlib imports resolve to nothing under NoAccessHost (there's no
22
+ // venv, and stdlib typeshed isn't on the path); we then DROP stdlib names (the
23
+ // analogue of the ts-morph Node-builtin drop) and turn the rest into EXTERNAL
24
+ // nodes — exactly the ts-morph "unresolved bare specifier = external" convention.
25
+ // Losing third-party SYMBOL resolution is expected and fine: the module/edge graph
26
+ // never needed it.
27
+ //
28
+ // Import edges are the reliable backbone. Typed cross-module CALL edges (the
29
+ // ts-morph adapter's expensive half) need a full type-evaluator pass and degrade
30
+ // to nothing here — an explicit, documented best-effort gap (import-only degrade,
31
+ // mirroring the ts-morph try/catch), left as a clean follow-on. A pure-static
32
+ // path-anchored SYNTACTIC fallback recovers first-party import edges for the rare
33
+ // repo whose root Pyright can't infer.
34
+ import { readFileSync } from 'node:fs';
35
+ import { resolve } from 'node:path';
36
+ import { createFromRealFileSystem, RealTempFile } from '@zzzen/pyright-internal/dist/common/realFileSystem.js';
37
+ import { createServiceProvider } from '@zzzen/pyright-internal/dist/common/serviceProviderExtensions.js';
38
+ import { ConfigOptions } from '@zzzen/pyright-internal/dist/common/configOptions.js';
39
+ import { NoAccessHost } from '@zzzen/pyright-internal/dist/common/host.js';
40
+ import { NullConsole } from '@zzzen/pyright-internal/dist/common/console.js';
41
+ import { Uri } from '@zzzen/pyright-internal/dist/common/uri/uri.js';
42
+ import { AnalyzerService } from '@zzzen/pyright-internal/dist/analyzer/service.js';
43
+ import { Program } from '@zzzen/pyright-internal/dist/analyzer/program.js';
44
+ import { ParseTreeWalker } from '@zzzen/pyright-internal/dist/analyzer/parseTreeWalker.js';
45
+ import { pythonExternalIdFor } from './types.js';
46
+ import { graphFromState } from './file-graph.js';
47
+ import { listSourceFiles } from './language.js';
48
+ import { PYTHON_STDLIB } from './python-stdlib.js';
49
+ // Pyright's ImportType is a `const enum` (erased at runtime), so we can't import
50
+ // it from the compiled .js — pin the value locally. BuiltIn = 0, ThirdParty = 1,
51
+ // Local = 2 (analyzer/importResult.ts). Only `Local` is a first-party candidate.
52
+ const IMPORT_TYPE_LOCAL = 2;
53
+ // Candidate source roots the syntactic fallback anchors absolute imports against —
54
+ // Pyright's own default first-party roots (workspace root, then `src/`).
55
+ // ADDS inferred package roots on top (inferSourceRoots), so a nested backend
56
+ // (`backend/app/` with imports rooted at `app`) resolves when the whole polyglot
57
+ // repo is ingested at its true root — the -deferred item, needed to make
58
+ // the multi-language merge produce a legible (not one-blob) backend.
59
+ const FALLBACK_ROOTS = ['', 'src'];
60
+ /**
61
+ * The first-party source roots for a Python file set — every default root plus
62
+ * each directory that CONTAINS a top-level package (a dir with `__init__.py`
63
+ * whose parent is not itself a package). For `backend/app/__init__.py` the
64
+ * top-level package is `backend/app` and its containing root is `backend`, so
65
+ * `from app.x import y` resolves against `backend/app/x/y.py`. Additive: a
66
+ * root-layout repo already infers `''` and a src-layout `'src'` (both defaults),
67
+ * so single-package output is unchanged; only a NESTED package gains a root.
68
+ * Deterministic (sorted).
69
+ */
70
+ export function inferSourceRoots(internalIds) {
71
+ const packageDirs = new Set();
72
+ for (const id of internalIds) {
73
+ if (id.endsWith('/__init__.py') || id.endsWith('/__init__.pyi')) {
74
+ packageDirs.add(id.slice(0, id.lastIndexOf('/')));
75
+ }
76
+ else if (id === '__init__.py' || id === '__init__.pyi') {
77
+ packageDirs.add('');
78
+ }
79
+ }
80
+ const roots = new Set(FALLBACK_ROOTS);
81
+ for (const pkgDir of packageDirs) {
82
+ const parent = pkgDir.includes('/') ? pkgDir.slice(0, pkgDir.lastIndexOf('/')) : '';
83
+ // A top-level package's parent is NOT itself a package → it's a source root.
84
+ if (!packageDirs.has(parent))
85
+ roots.add(parent);
86
+ }
87
+ return [...roots].sort();
88
+ }
89
+ /** The line-of-code count for one source file (size/centrality signal). */
90
+ function locOf(absPath) {
91
+ try {
92
+ const text = readFileSync(absPath, 'utf8');
93
+ if (text.length === 0)
94
+ return 0;
95
+ return text.split('\n').length;
96
+ }
97
+ catch {
98
+ return 0;
99
+ }
100
+ }
101
+ /** Top-level (leftmost) dotted segment of an absolute module name. */
102
+ function topLevel(moduleName) {
103
+ return moduleName.replace(/^\.+/, '').split('.')[0];
104
+ }
105
+ /**
106
+ * Pure, path-anchored SYNTACTIC resolution — the tree-sitter-fallback role
107
+ * (recover the import graph from the on-disk layout) implemented over Pyright's
108
+ * already-parsed import name, so no second parser / native grammar is needed. Used
109
+ * ONLY when Pyright resolved nothing internal. Returns a repo-relative id in
110
+ * `internalIds`, or undefined.
111
+ *
112
+ * `importName` carries leading dots for relative imports (`.util`, `..pkg.mod`);
113
+ * `fromId` is the importing file's repo-relative id. Absolute names try each
114
+ * FALLBACK_ROOT; relative names anchor on the importing file's package, ascending
115
+ * one level per leading dot beyond the first.
116
+ */
117
+ // Order candidate roots so those that are ancestor dirs of `fromId` come first
118
+ // (deepest — most specific — first), then the rest in their given order. A tie
119
+ // among non-ancestors keeps input order (deterministic). Backward-compatible: a
120
+ // root/`src`-layout file has only `''` as an ancestor, so the order is unchanged.
121
+ function orderRootsByProximity(roots, fromId) {
122
+ const fromDir = fromId.includes('/') ? fromId.slice(0, fromId.lastIndexOf('/')) : '';
123
+ const isAncestor = (r) => r === '' || fromDir === r || fromDir.startsWith(`${r}/`);
124
+ const ancestors = roots.filter(isAncestor).sort((a, b) => b.length - a.length);
125
+ const others = roots.filter((r) => !isAncestor(r));
126
+ return [...ancestors, ...others];
127
+ }
128
+ export function syntacticResolve(importName, fromId, internalIds, roots = FALLBACK_ROOTS) {
129
+ const leadingDots = importName.match(/^\.*/)?.[0].length ?? 0;
130
+ const rest = importName.slice(leadingDots);
131
+ const parts = rest.length ? rest.split('.') : [];
132
+ const candidateBases = [];
133
+ if (leadingDots === 0) {
134
+ // Try roots that are ANCESTORS of the importing file first (deepest first), so
135
+ // a `backend/app/x.py` importing `app.y` prefers its own `backend` root over a
136
+ // second, unrelated top-level `app/` package at the repo root.
137
+ for (const root of orderRootsByProximity(roots, fromId))
138
+ candidateBases.push(root);
139
+ }
140
+ else {
141
+ // Relative: start from the importing file's directory (its package), then
142
+ // ascend (leadingDots - 1) more levels. A `from . import x` (no parts) can't
143
+ // be resolved to the submodule here — Pyright's implicit-import path already
144
+ // covers it — so we only anchor the package dir.
145
+ const fromDir = fromId.includes('/') ? fromId.slice(0, fromId.lastIndexOf('/')) : '';
146
+ let segs = fromDir.length ? fromDir.split('/') : [];
147
+ const up = leadingDots - 1;
148
+ if (up > segs.length)
149
+ return undefined; // ascends past the repo root
150
+ segs = segs.slice(0, segs.length - up);
151
+ candidateBases.push(segs.join('/'));
152
+ }
153
+ if (parts.length === 0)
154
+ return undefined; // nothing concrete to anchor to
155
+ for (const base of candidateBases) {
156
+ const prefix = [base, ...parts].filter(Boolean).join('/');
157
+ for (const cand of [`${prefix}.py`, `${prefix}.pyi`, `${prefix}/__init__.py`, `${prefix}/__init__.pyi`]) {
158
+ if (internalIds.has(cand))
159
+ return cand;
160
+ }
161
+ }
162
+ return undefined;
163
+ }
164
+ /** Build a Program over `fileIds` (repo-relative posix) rooted at `absRoot`. */
165
+ function buildProgram(absRoot, fileIds) {
166
+ const tempFile = new RealTempFile();
167
+ const console = new NullConsole();
168
+ const fs = createFromRealFileSystem(tempFile, console);
169
+ const serviceProvider = createServiceProvider(fs, tempFile, console);
170
+ const rootUri = Uri.file(absRoot, serviceProvider);
171
+ const config = new ConfigOptions(rootUri);
172
+ const host = new NoAccessHost();
173
+ const importResolver = AnalyzerService.createImportResolver(serviceProvider, config, host);
174
+ // disableChecker = true: we only need parse + import resolution, never the
175
+ // type checker (call-edge type-eval is out of scope; import-only degrade).
176
+ const program = new Program(importResolver, config, serviceProvider, undefined, true);
177
+ const uriById = new Map();
178
+ for (const id of fileIds)
179
+ uriById.set(id, Uri.file(`${absRoot}/${id}`, serviceProvider));
180
+ program.addTrackedFiles([...uriById.values()]);
181
+ const relOf = (uri) => {
182
+ const p = uri.getFilePath();
183
+ const prefix = `${absRoot}/`;
184
+ return p.startsWith(prefix) ? p.slice(prefix.length) : '';
185
+ };
186
+ return { program, uriById, relOf, dispose: () => program.dispose() };
187
+ }
188
+ /**
189
+ * Extract ONE Python file: resolved internal import edges + external packages.
190
+ * `calls` is left empty (import-only degrade — see the module header). Never
191
+ * throws: a file Pyright can't parse/bind degrades to no edges rather than
192
+ * failing the whole extraction (mirrors the ts-morph adapter's defensive posture).
193
+ */
194
+ function extractFileRecord(fromId, imports, absRoot, internalIds, relOf, roots, callTargets) {
195
+ const importWeights = new Map();
196
+ const externalWeights = new Map();
197
+ const addInternal = (toId) => {
198
+ if (toId === fromId)
199
+ return; // no self-edges
200
+ if (!internalIds.has(toId))
201
+ return;
202
+ importWeights.set(toId, (importWeights.get(toId) ?? 0) + 1);
203
+ };
204
+ for (const imp of imports) {
205
+ const name = imp.importName;
206
+ if (!name)
207
+ continue;
208
+ // The module/package named by the import clause = the last resolved uri
209
+ // (Pyright returns the package chain; the leaf is the module). Plus every
210
+ // SUBMODULE actually pulled in by `from pkg import submod` — Python `__init__`
211
+ // files are usually empty (unlike TS barrels), so without these the real
212
+ // dependency on `submod` would be lost.
213
+ const internalTargets = [];
214
+ if (imp.isImportFound && imp.importType === IMPORT_TYPE_LOCAL) {
215
+ if (imp.resolvedUris.length) {
216
+ const leaf = relOf(imp.resolvedUris[imp.resolvedUris.length - 1]);
217
+ if (leaf)
218
+ internalTargets.push(leaf);
219
+ }
220
+ for (const uri of imp.implicitSubmoduleUris) {
221
+ const id = relOf(uri);
222
+ if (id)
223
+ internalTargets.push(id);
224
+ }
225
+ }
226
+ if (internalTargets.length) {
227
+ for (const id of internalTargets)
228
+ addInternal(id);
229
+ continue;
230
+ }
231
+ // Pyright resolved nothing internal → syntactic fallback (path-anchored).
232
+ const fallback = syntacticResolve(name, fromId, internalIds, roots);
233
+ if (fallback) {
234
+ addInternal(fallback);
235
+ continue;
236
+ }
237
+ // Genuinely unresolved. Relative-but-unresolved is a missing/dynamic
238
+ // first-party import, NOT an external (mirrors the ts-morph relative-skip).
239
+ // The leading dot in the module name is the authoritative signal — Pyright's
240
+ // `isRelative` flag is unset when the relative import didn't resolve, so a
241
+ // dangling `from .gone import x` would otherwise leak as `ext:gone`.
242
+ if (imp.isRelative || name.startsWith('.'))
243
+ continue;
244
+ const top = topLevel(name);
245
+ if (!top || PYTHON_STDLIB.has(top))
246
+ continue; // stdlib → substrate, dropped
247
+ const ext = pythonExternalIdFor(name);
248
+ const existing = externalWeights.get(ext.id);
249
+ if (existing)
250
+ existing.weight += 1;
251
+ else
252
+ externalWeights.set(ext.id, { specifier: ext.specifier, weight: 1 });
253
+ }
254
+ return {
255
+ loc: locOf(`${absRoot}/${fromId}`),
256
+ language: fromId.endsWith('.pyi') ? 'pyi' : 'py',
257
+ imports: [...importWeights].map(([to, weight]) => ({ to, weight })),
258
+ externals: [...externalWeights].map(([id, v]) => ({ id, specifier: v.specifier, weight: v.weight })),
259
+ calls: [...callTargets].map(([to, weight]) => ({ to, weight })),
260
+ reexports: [],
261
+ };
262
+ }
263
+ // ---------------------------------------------------------------------------
264
+ // typed call edges (best-effort). The ts-morph adapter's expensive
265
+ // half: resolve each call site's callee to its DECLARING in-repo file via
266
+ // Pyright's type evaluator (getDeclInfoForNameNode). This works with the CHECKER
267
+ // DISABLED — the evaluator resolves lazily on demand (including a method call
268
+ // through an inferred receiver type), so we get typed call edges WITHOUT the
269
+ // full-check cost (staying inside the container watchdog budget). Every
270
+ // resolution is wrapped defensively: an unresolvable / erroring call degrades to
271
+ // no edge (mirrors the ts-morph extractFileCalls try/catch — import-only fallback).
272
+ // Pinned ParseNodeType values (parseNodes.js const enum — Call=9, MemberAccess=35,
273
+ // Name=38). Kept LOCAL (the graph layer must not import the framework's py-ast).
274
+ const NODE_CALL = 9;
275
+ const NODE_MEMBER_ACCESS = 35;
276
+ const NODE_NAME = 38;
277
+ // A DETERMINISTIC per-file bound on call-site type-eval, so a pathological
278
+ // god-file (thousands of calls) can't blow the container watchdog. Set high
279
+ // enough that no ordinary file is capped; a capped file is LOGGED (no silent
280
+ // caps), and the whole file degrades to import-only (call resolution is
281
+ // best-effort). A time budget would break snapshot determinism, so we bound by
282
+ // count in the (stable) tree order instead.
283
+ const MAX_CALL_SITES_PER_FILE = 2500;
284
+ // Every CallNode in a module (recursive — nested calls count).
285
+ function collectCallNodes(tree) {
286
+ const out = [];
287
+ class Walker extends ParseTreeWalker {
288
+ visitCall(node) {
289
+ out.push(node);
290
+ return true;
291
+ }
292
+ }
293
+ new Walker().walk(tree);
294
+ return out;
295
+ }
296
+ // The callee NAME node of a call: `foo(...)` → `foo`; `obj.method(...)` → `method`.
297
+ // A more complex callee (a subscript / a call result) → undefined (skipped).
298
+ function calleeNameNode(call) {
299
+ const callee = call.d.leftExpr;
300
+ if (callee.nodeType === NODE_CALL)
301
+ return undefined; // chained call result
302
+ if (callee.nodeType === NODE_NAME)
303
+ return callee;
304
+ if (callee.nodeType === NODE_MEMBER_ACCESS) {
305
+ return callee.d.member;
306
+ }
307
+ return undefined;
308
+ }
309
+ /**
310
+ * The internal call-edge targets (target file id → weight) for one file: each
311
+ * call site's callee resolved to its declaring in-repo file. Never throws — a
312
+ * single unresolvable call is skipped, and a broken evaluator degrades the whole
313
+ * file to no call edges. Self-calls (same file) + external/stdlib targets are
314
+ * dropped; a call resolving to several decls in ONE file counts once.
315
+ */
316
+ export function extractCallTargets(fromId, tree, evaluator, internalIds, relOf) {
317
+ const weights = new Map();
318
+ const calls = collectCallNodes(tree);
319
+ if (calls.length > MAX_CALL_SITES_PER_FILE) {
320
+ // A god-file — bounding call-edge extraction to protect the watchdog. Degrade
321
+ // to import-only for it (deterministic + logged; the module is one box anyway).
322
+ console.log(` [python] ${fromId}: ${calls.length} call sites exceed the ${MAX_CALL_SITES_PER_FILE} cap — call edges skipped for this file (import-only)`);
323
+ return weights;
324
+ }
325
+ for (const call of calls) {
326
+ try {
327
+ const nameNode = calleeNameNode(call);
328
+ if (!nameNode)
329
+ continue;
330
+ const info = evaluator.getDeclInfoForNameNode(nameNode);
331
+ if (!info)
332
+ continue;
333
+ const targets = new Set();
334
+ for (const decl of info.decls) {
335
+ const toId = relOf(decl.uri);
336
+ if (toId && toId !== fromId && internalIds.has(toId))
337
+ targets.add(toId);
338
+ }
339
+ for (const t of targets)
340
+ weights.set(t, (weights.get(t) ?? 0) + 1);
341
+ }
342
+ catch {
343
+ // this call site failed to resolve — skip it (import-only degrade).
344
+ }
345
+ }
346
+ return weights;
347
+ }
348
+ export class PythonExtractor {
349
+ language = 'python';
350
+ async extract(repoDir) {
351
+ const root = resolve(repoDir);
352
+ const fileIds = listSourceFiles(root, 'python');
353
+ const internalIds = new Set(fileIds);
354
+ // the first-party source roots (defaults + inferred nested package
355
+ // roots), so a `backend/app/` package resolves when the whole repo is the root.
356
+ const roots = inferSourceRoots(internalIds);
357
+ const files = {};
358
+ if (fileIds.length === 0) {
359
+ return graphFromState(root, { headSha: '', files });
360
+ }
361
+ const { program, uriById, relOf, dispose } = buildProgram(root, fileIds);
362
+ try {
363
+ for (const id of fileIds) {
364
+ const uri = uriById.get(id);
365
+ let imports = [];
366
+ let callTargets = new Map();
367
+ try {
368
+ const sf = program.getBoundSourceFile(uri);
369
+ imports = (sf?.getImports() ?? []).map((imp) => ({
370
+ importName: imp.importName,
371
+ isImportFound: imp.isImportFound,
372
+ isRelative: imp.isRelative,
373
+ importType: imp.importType,
374
+ resolvedUris: imp.resolvedUris,
375
+ implicitSubmoduleUris: imp.filteredImplicitImports
376
+ ? [...imp.filteredImplicitImports.values()].map((v) => v.uri)
377
+ : [],
378
+ }));
379
+ // typed call edges (best-effort; degrades to none on error).
380
+ const tree = sf?.getParserOutput()?.parseTree;
381
+ if (tree && program.evaluator) {
382
+ callTargets = extractCallTargets(id, tree, program.evaluator, internalIds, relOf);
383
+ }
384
+ }
385
+ catch {
386
+ // parse/bind failed for this file — import-only degrade to no edges.
387
+ imports = [];
388
+ callTargets = new Map();
389
+ }
390
+ files[id] = extractFileRecord(id, imports, root, internalIds, relOf, roots, callTargets);
391
+ }
392
+ }
393
+ finally {
394
+ dispose();
395
+ }
396
+ // headSha is irrelevant for a one-shot batch extract; graphFromState only
397
+ // reads the per-file records.
398
+ const state = { headSha: '', files };
399
+ return graphFromState(root, state);
400
+ }
401
+ }
402
+ //# sourceMappingURL=python-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-adapter.js","sourceRoot":"","sources":["../../src/graph/python-adapter.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,kFAAkF;AAClF,6EAA6E;AAC7E,mFAAmF;AACnF,mDAAmD;AACnD,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,mFAAmF;AACnF,mFAAmF;AACnF,+EAA+E;AAC/E,2EAA2E;AAC3E,iBAAiB;AACjB,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AM,KAAK,GAAmB,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;QACrD,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ /** PEP 503 normalized distribution name: lowercase, runs of `-_.` → single `-`. */
2
+ export declare function normalizePyName(raw: string): string;
3
+ /**
4
+ * The distribution NAME from one PEP 508 / requirements requirement line:
5
+ * 'fastapi[standard]>=0.1; python_version<"3.9"' → 'fastapi'
6
+ * 'git+https://github.com/x/y#egg=foo' → 'foo'
7
+ * Returns undefined for a non-name line (blank, comment, `-r`/`-e`/option, or a
8
+ * bare URL with no `#egg=`).
9
+ */
10
+ export declare function requirementName(spec: string): string | undefined;
11
+ /**
12
+ * Every declared third-party distribution name (PEP 503 normalized) under
13
+ * `baseDir`, across the layouts the Python ecosystem actually uses:
14
+ * • PEP 621 `[project].dependencies` + `[project.optional-dependencies].*`
15
+ * • PEP 735 `[dependency-groups].*` (string entries)
16
+ * • Poetry `[tool.poetry.dependencies]`, `.dev-dependencies`, `.group.*.dependencies`
17
+ * • pip `requirements*.txt` in the dir
18
+ * Never throws. Detection asks membership (`deps.has('fastapi')`); it does not
19
+ * need versions, so only names are returned.
20
+ */
21
+ export declare function readPythonDeps(baseDir: string): Set<string>;
22
+ //# sourceMappingURL=python-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-manifest.d.ts","sourceRoot":"","sources":["../../src/graph/python-manifest.ts"],"names":[],"mappings":"AAgBA,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAchE;AAsBD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAkD3D"}
@@ -0,0 +1,137 @@
1
+ // Python manifest parsing ( FastAPI detect · workspaces) —
2
+ // install-free + deterministic. Reads dependency + workspace declarations from
3
+ // pyproject.toml / requirements*.txt WITHOUT installing anything, the Python
4
+ // analogue of the framework detect-util `readDeps` for package.json. PURE: it
5
+ // touches only the manifest, never application source (never-store-source), and
6
+ // never spawns a resolver.
7
+ //
8
+ // TOML is parsed with `smol-toml` (already in the tree as pyright-internal's own
9
+ // dep; declared as a direct devDependency so a pyright bump can't drop it). A
10
+ // malformed manifest degrades to empty rather than throwing — a broken pyproject
11
+ // must never sink detection.
12
+ import { existsSync, readFileSync, readdirSync } from 'node:fs';
13
+ import { join } from 'node:path';
14
+ import { parse as parseToml } from 'smol-toml';
15
+ /** PEP 503 normalized distribution name: lowercase, runs of `-_.` → single `-`. */
16
+ export function normalizePyName(raw) {
17
+ return raw
18
+ .trim()
19
+ .toLowerCase()
20
+ .replace(/[-_.]+/g, '-')
21
+ .replace(/^-+|-+$/g, '');
22
+ }
23
+ /**
24
+ * The distribution NAME from one PEP 508 / requirements requirement line:
25
+ * 'fastapi[standard]>=0.1; python_version<"3.9"' → 'fastapi'
26
+ * 'git+https://github.com/x/y#egg=foo' → 'foo'
27
+ * Returns undefined for a non-name line (blank, comment, `-r`/`-e`/option, or a
28
+ * bare URL with no `#egg=`).
29
+ */
30
+ export function requirementName(spec) {
31
+ let s = spec.trim();
32
+ if (!s || s.startsWith('#'))
33
+ return undefined;
34
+ // Strip a trailing inline comment (` #…`), then reject option/include lines.
35
+ const cmt = s.indexOf(' #');
36
+ if (cmt >= 0)
37
+ s = s.slice(0, cmt).trim();
38
+ if (!s || s.startsWith('-'))
39
+ return undefined;
40
+ // A URL/VCS requirement only names a package via `#egg=`.
41
+ if (s.includes('://')) {
42
+ const egg = /[#&]egg=([A-Za-z0-9._-]+)/.exec(s);
43
+ return egg ? normalizePyName(egg[1]) : undefined;
44
+ }
45
+ const m = /^([A-Za-z0-9][A-Za-z0-9._-]*)/.exec(s);
46
+ return m ? normalizePyName(m[1]) : undefined;
47
+ }
48
+ // A poetry-style dependency table: keys are distribution names (values are
49
+ // version constraints / tables). `python` is the interpreter pin, not a dep.
50
+ function addPoetryTableNames(table, into) {
51
+ if (!table || typeof table !== 'object')
52
+ return;
53
+ for (const name of Object.keys(table)) {
54
+ if (name.toLowerCase() === 'python')
55
+ continue;
56
+ const n = normalizePyName(name);
57
+ if (n)
58
+ into.add(n);
59
+ }
60
+ }
61
+ function addRequirementList(list, into) {
62
+ if (!Array.isArray(list))
63
+ return;
64
+ for (const item of list) {
65
+ if (typeof item !== 'string')
66
+ continue; // PEP 735 {include-group} entries skipped
67
+ const n = requirementName(item);
68
+ if (n)
69
+ into.add(n);
70
+ }
71
+ }
72
+ /**
73
+ * Every declared third-party distribution name (PEP 503 normalized) under
74
+ * `baseDir`, across the layouts the Python ecosystem actually uses:
75
+ * • PEP 621 `[project].dependencies` + `[project.optional-dependencies].*`
76
+ * • PEP 735 `[dependency-groups].*` (string entries)
77
+ * • Poetry `[tool.poetry.dependencies]`, `.dev-dependencies`, `.group.*.dependencies`
78
+ * • pip `requirements*.txt` in the dir
79
+ * Never throws. Detection asks membership (`deps.has('fastapi')`); it does not
80
+ * need versions, so only names are returned.
81
+ */
82
+ export function readPythonDeps(baseDir) {
83
+ const names = new Set();
84
+ try {
85
+ const pyprojectPath = join(baseDir, 'pyproject.toml');
86
+ if (existsSync(pyprojectPath)) {
87
+ const t = parseToml(readFileSync(pyprojectPath, 'utf8'));
88
+ const project = t.project ?? {};
89
+ addRequirementList(project.dependencies, names);
90
+ const optional = project['optional-dependencies'];
91
+ if (optional && typeof optional === 'object') {
92
+ for (const grp of Object.values(optional))
93
+ addRequirementList(grp, names);
94
+ }
95
+ const groups = t['dependency-groups'];
96
+ if (groups && typeof groups === 'object') {
97
+ for (const grp of Object.values(groups))
98
+ addRequirementList(grp, names);
99
+ }
100
+ const poetry = t.tool?.poetry ?? {};
101
+ addPoetryTableNames(poetry.dependencies, names);
102
+ addPoetryTableNames(poetry['dev-dependencies'], names);
103
+ const poetryGroups = poetry.group;
104
+ if (poetryGroups && typeof poetryGroups === 'object') {
105
+ for (const g of Object.values(poetryGroups)) {
106
+ addPoetryTableNames(g?.dependencies, names);
107
+ }
108
+ }
109
+ }
110
+ }
111
+ catch {
112
+ // Malformed pyproject → skip it; requirements*.txt may still name deps.
113
+ }
114
+ try {
115
+ for (const entry of readdirSync(baseDir)) {
116
+ if (!/^requirements.*\.txt$/i.test(entry))
117
+ continue;
118
+ let text;
119
+ try {
120
+ text = readFileSync(join(baseDir, entry), 'utf8');
121
+ }
122
+ catch {
123
+ continue;
124
+ }
125
+ for (const line of text.split('\n')) {
126
+ const n = requirementName(line);
127
+ if (n)
128
+ names.add(n);
129
+ }
130
+ }
131
+ }
132
+ catch {
133
+ // baseDir unreadable — return whatever pyproject gave.
134
+ }
135
+ return names;
136
+ }
137
+ //# sourceMappingURL=python-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-manifest.js","sourceRoot":"","sources":["../../src/graph/python-manifest.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,gFAAgF;AAChF,2BAA2B;AAC3B,EAAE;AACF,iFAAiF;AACjF,8EAA8E;AAC9E,iFAAiF;AACjF,6BAA6B;AAE7B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/C,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,GAAG;SACP,IAAI,EAAE;SACN,WAAW,EAAE;SACb,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;SACvB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;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AAI,CAAC,CAAC;gBAChC,IAAI,CAAC;oBAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,uDAAuD;IACzD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const PYTHON_STDLIB: ReadonlySet<string>;
2
+ //# sourceMappingURL=python-stdlib.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-stdlib.d.ts","sourceRoot":"","sources":["../../src/graph/python-stdlib.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,CAwC5C,CAAC"}