@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,186 @@
1
+ import type { NormalizedGraph } from './types.js';
2
+ /**
3
+ * The extractor languages the pipeline supports. The dispatch (graph/extract.ts)
4
+ * picks ONE per repo; every source-path predicate below is parameterized by it so
5
+ * a single implementation serves both the ts-morph (TS) and Pyright (Python,
6
+ * ) adapters. `ts` is the default everywhere the caller can't yet supply a
7
+ * language (the incremental diff classifier is TS-only today).
8
+ */
9
+ export type SourceLang = 'ts' | 'python';
10
+ /** TS/JS source extensions the ts-morph adapter parses (mirror of its SOURCE_GLOBS). */
11
+ export declare const SOURCE_EXTENSIONS: readonly ["ts", "tsx", "js", "jsx", "mts", "cts", "mjs", "cjs"];
12
+ /** Python source extensions the Pyright adapter parses (module + stub files). */
13
+ export declare const PYTHON_SOURCE_EXTENSIONS: readonly ["py", "pyi"];
14
+ /** Directories the ts-morph adapter's glob excludes (mirror of the adapter's EXCLUDE_DIRS). */
15
+ export declare const EXCLUDE_DIRS: readonly ["node_modules", "dist", "build", "out", "coverage", ".git", ".next", ".vite", ".turbo"];
16
+ /**
17
+ * Directories the Python adapter's walk excludes: virtualenvs, tool caches, egg
18
+ * builds, and vendored deps. Mirrors the TS EXCLUDE_DIRS role — none of these
19
+ * hold first-party source, and walking them would (a) misclassify installed deps
20
+ * as internal and (b) blow the install-free promise. `.`-prefixed dirs (`.venv`,
21
+ * `.tox`, `.mypy_cache`) are also caught by the dot-segment skip below, but are
22
+ * listed explicitly so the policy is self-contained.
23
+ */
24
+ export declare const PYTHON_EXCLUDE_DIRS: readonly ["__pycache__", ".venv", "venv", "env", ".tox", ".nox", ".mypy_cache", ".pytest_cache", ".ruff_cache", ".eggs", "site-packages", ".git", "build", "dist", "node_modules"];
25
+ /**
26
+ * Does a repo-relative posix path denote a file the extractor would include?
27
+ * For `ts` this mirrors the ts-morph adapter's glob EXACTLY (verified empirically
28
+ * + by the equivalence fixture): matching extension, no excluded-dir segment, and
29
+ * NO dotted segment — ts-morph's globbing skips dot-directories AND dot-files by
30
+ * default (`.storybook/x.ts`, `src/.hidden.ts` are not added), so the diff
31
+ * classifier must skip them too or a patched graph would diverge from a full
32
+ * extract. For `python` the same shape holds with `.py`/`.pyi` + the Python
33
+ * exclude set; the dot-segment skip drops `.venv`/`.tox`/… while keeping
34
+ * `__init__.py` (a `_`-prefixed name, not a dotted one).
35
+ */
36
+ export declare function isSourceFilePath(path: string, lang?: SourceLang): boolean;
37
+ /** Does a repo-relative path name a resolution-affecting config file? */
38
+ export declare function isConfigInvalidatorPath(path: string): boolean;
39
+ /**
40
+ * Stage B — the blob-cache KEY COMPONENT. A `file_parse_cache` row is
41
+ * keyed (repo_id, blob_sha, extractor_version): blob-identical content can
42
+ * only be reused while the per-file extraction SEMANTICS are unchanged. Bump
43
+ * this whenever per-file extraction OUTPUT can change for the same blob:
44
+ * adapter edge semantics (extractFileImportsRecord/extractFileCalls), the
45
+ * source globs / EXCLUDE_DIRS policy, an invalidator-policy change that alters
46
+ * output, or the FileRecord shape itself. A bump cleanly orphans every cached
47
+ * row (all lookups miss → re-parse — the once-per-version cost; saveParseCache
48
+ * GCs the orphaned versions best-effort). Version 1 is RESERVED for the
49
+ * implicit Stage-A semantics and is never written to the table.
50
+ */
51
+ export declare const EXTRACTOR_VERSION = 2;
52
+ /** A resolved internal edge out of a file (target = repo-relative file id). */
53
+ export interface FileEdgeRef {
54
+ to: string;
55
+ weight: number;
56
+ }
57
+ /** An external dependency referenced by a file (unresolved bare specifier). */
58
+ export interface FileExternalRef {
59
+ id: string;
60
+ specifier: string;
61
+ weight: number;
62
+ }
63
+ /** Everything the extractor derives from ONE source file (+ tree resolution). */
64
+ export interface FileRecord {
65
+ loc: number;
66
+ language: string;
67
+ /** Resolved internal import/export-from targets (kind 'import'). */
68
+ imports: FileEdgeRef[];
69
+ /** External packages referenced (kind 'import', external). */
70
+ externals: FileExternalRef[];
71
+ /** Resolved internal call/new targets (kind 'call') — the EXPENSIVE part. */
72
+ calls: FileEdgeRef[];
73
+ /**
74
+ * Resolved internal targets of `export … from` declarations — the re-export
75
+ * surface a change can propagate THROUGH (see computeCallPatchUnit). Subset
76
+ * of `imports` targets.
77
+ */
78
+ reexports: string[];
79
+ /** Git blob sha at the state's head (serialization only; Stage-B cache key). */
80
+ blobSha?: string;
81
+ }
82
+ /** The carried graph: a full-commit-sha head + one record per source file. */
83
+ export interface FileGraphState {
84
+ /** FULL commit sha the state corresponds to (diff base for the next patch). */
85
+ headSha: string;
86
+ files: Record<string, FileRecord>;
87
+ }
88
+ /**
89
+ * Assemble the NormalizedGraph the clustering layer consumes from a file-graph
90
+ * state. Files are emitted in SORTED path order — deterministic across
91
+ * platforms and identical between the batch and incremental paths (Louvain's
92
+ * seeded RNG consumes node insertion order, so ordering is part of output
93
+ * stability).
94
+ */
95
+ export declare function graphFromState(root: string, state: FileGraphState): NormalizedGraph;
96
+ /** One `git diff --name-status --no-renames` entry (renames arrive as D+A). */
97
+ export interface DiffEntry {
98
+ /** A=added, M=modified, D=deleted, T=type-change; anything else is rare. */
99
+ status: string;
100
+ path: string;
101
+ }
102
+ export interface ClassifiedDiff {
103
+ /** Source files added at this checkpoint. */
104
+ sourceAdded: string[];
105
+ /** Source files whose content changed. */
106
+ sourceModified: string[];
107
+ /** Source files removed. */
108
+ sourceDeleted: string[];
109
+ /** Resolution-affecting config paths touched → force a FULL extract. */
110
+ invalidators: string[];
111
+ /**
112
+ * Did the SOURCE-FILE SHAPE of the tree change (adds/deletes/type-changes)?
113
+ * Shape changes can flip OTHER files' specifier resolution (a new file an
114
+ * existing `./util` import now resolves to; a deleted target), so the engine
115
+ * rebuilds its Project + re-resolves every file's imports. Content-only
116
+ * (M) diffs can't move resolution and take the cheap refresh path.
117
+ */
118
+ shapeChanged: boolean;
119
+ }
120
+ /** Classify a checkpoint's diff entries into the engine's decision inputs. */
121
+ export declare function classifyDiff(entries: readonly DiffEntry[]): ClassifiedDiff;
122
+ /**
123
+ * Expand `seeds` (changed/deleted paths) through re-export chains: any file
124
+ * whose `reexports` include a member of the closure joins it, to fixpoint.
125
+ */
126
+ export declare function reexportClosure(seeds: ReadonlySet<string>, reexportsByFile: ReadonlyMap<string, readonly string[]>): Set<string>;
127
+ /**
128
+ * The set of files whose CALL edges must be re-extracted at this checkpoint.
129
+ * All inputs reflect the CURRENT tree (post-diff): `freshImports` are the
130
+ * just-re-resolved import edges, `prevImports` the carried ones (absent for
131
+ * new files), `reexports` the fresh re-export targets per file.
132
+ */
133
+ export declare function computeCallPatchUnit(args: {
134
+ added: readonly string[];
135
+ modified: readonly string[];
136
+ deleted: readonly string[];
137
+ /** Current files → freshly resolved import edges. */
138
+ freshImports: ReadonlyMap<string, readonly FileEdgeRef[]>;
139
+ /** Carried state's import edges (pre-diff), keyed by file. */
140
+ prevImports: ReadonlyMap<string, readonly FileEdgeRef[]>;
141
+ /** Current files → fresh re-export targets. */
142
+ reexports: ReadonlyMap<string, readonly string[]>;
143
+ }): Set<string>;
144
+ export declare const FILE_GRAPH_VERSION = 1;
145
+ export interface SerializedFileGraph {
146
+ version: number;
147
+ /** FULL commit sha the graph corresponds to. */
148
+ headSha: string;
149
+ files: Record<string, FileRecord>;
150
+ /**
151
+ * Stage B: boots since the last full-extract reconciliation pass
152
+ * (container.ts), riding the fileGraph payload because it shares the graph's
153
+ * exact lifecycle — persist_snapshot overwrites the whole extraction_cache
154
+ * payload mid-boot, and the boot-end fileGraph save re-adds both together.
155
+ * Optional + tolerated by deserializeFileGraph (older payloads lack it; the
156
+ * container reads it off the RAW serialized object, defaulting 0).
157
+ */
158
+ bootsSinceReconcile?: number;
159
+ }
160
+ export declare function serializeFileGraph(state: FileGraphState, blobShaByPath?: ReadonlyMap<string, string>): SerializedFileGraph;
161
+ /**
162
+ * Validate ONE untrusted jsonb value as a FileRecord — the per-record half of
163
+ * deserializeFileGraph's shape guard, exported ( Stage B) so the blob
164
+ * parse-cache reader (assemble/parse-cache.ts) applies the SAME rigor per row
165
+ * without duplicating it. A row failing this is treated as a cache miss, never
166
+ * an error: a corrupt cached record must degrade to a re-parse.
167
+ */
168
+ export declare function isValidFileRecord(v: unknown): v is FileRecord;
169
+ /**
170
+ * Validate + adopt a serialized file graph. Returns null for anything not
171
+ * usable as a seed (wrong version, missing head, malformed records) — the
172
+ * caller then seeds with a full extract instead. NEVER throws: a corrupt cache
173
+ * must degrade to a full extract, not fail the ingest. Unknown extra fields
174
+ * (e.g. the Stage-B `bootsSinceReconcile` counter) are TOLERATED — older and
175
+ * newer payloads must round-trip through each other's readers.
176
+ */
177
+ export declare function deserializeFileGraph(v: unknown): FileGraphState | null;
178
+ /**
179
+ * Paths whose records DIFFER between two states (union of both key sets — a
180
+ * path present in only one side counts as drifted). Comparison is ORDER-
181
+ * INSENSITIVE over the imports/externals/calls/reexports arrays (extraction
182
+ * order is not semantics) and IGNORES blobSha (a serialization tag, not
183
+ * extractor output). Pure; never throws.
184
+ */
185
+ export declare function diffFileGraphStates(a: FileGraphState, b: FileGraphState): string[];
186
+ //# sourceMappingURL=file-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-graph.d.ts","sourceRoot":"","sources":["../../src/graph/file-graph.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,eAAe,EAA2B,MAAM,YAAY,CAAC;AAK3E;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,QAAQ,CAAC;AAEzC,wFAAwF;AACxF,eAAO,MAAM,iBAAiB,iEAAkE,CAAC;AAEjG,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,wBAAyB,CAAC;AAE/D,+FAA+F;AAC/F,eAAO,MAAM,YAAY,mGAUf,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,oLAgBtB,CAAC;AAOX;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,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,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,EACrB,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1C,mBAAmB,CAOrB;AAgBD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAQ7D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAsBtE;AA4BD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,GAAG,MAAM,EAAE,CAuBlF"}
@@ -0,0 +1,427 @@
1
+ // Stage A — the PURE file-level graph model behind diff-driven
2
+ // incremental extraction.
3
+ //
4
+ // The per-merge walk used to run a FULL ts-morph extract of the whole
5
+ // repo at EVERY checkpoint — O(repo) per merge, which blew the 10-min container
6
+ // watchdog on a busy repo. Stage A makes the walk carry a FILE-LEVEL
7
+ // graph in memory: seed it once (full extract, or the extraction_cache's
8
+ // serialized copy), then per checkpoint patch it from `git diff --name-status`
9
+ // — re-running the EXPENSIVE extraction (ts-morph symbol resolution for call
10
+ // edges) only on the files the merge actually touched (+ the dependents that
11
+ // can observe the change; see computeCallPatchUnit).
12
+ //
13
+ // This module is deliberately PURE (no git, no ts-morph, no fs): the state
14
+ // shape, the NormalizedGraph assembly, the diff classification, the dependents
15
+ // closure, and the (de)serialization that rides in extraction_cache. The impure
16
+ // engine that owns the ts-morph Project lives in incremental.ts.
17
+ //
18
+ // EQUIVALENCE CONTRACT (load-bearing): a patched state at commit N must produce
19
+ // the SAME NormalizedGraph a full extract at N would — guarded by the fixture
20
+ // test in incremental-equivalence.test.ts. If you change edge semantics here or
21
+ // in the adapter, change BOTH sides and re-run that test.
22
+ /** TS/JS source extensions the ts-morph adapter parses (mirror of its SOURCE_GLOBS). */
23
+ export const SOURCE_EXTENSIONS = ['ts', 'tsx', 'js', 'jsx', 'mts', 'cts', 'mjs', 'cjs'];
24
+ /** Python source extensions the Pyright adapter parses (module + stub files). */
25
+ export const PYTHON_SOURCE_EXTENSIONS = ['py', 'pyi'];
26
+ /** Directories the ts-morph adapter's glob excludes (mirror of the adapter's EXCLUDE_DIRS). */
27
+ export const EXCLUDE_DIRS = [
28
+ 'node_modules',
29
+ 'dist',
30
+ 'build',
31
+ 'out',
32
+ 'coverage',
33
+ '.git',
34
+ '.next',
35
+ '.vite',
36
+ '.turbo',
37
+ ];
38
+ /**
39
+ * Directories the Python adapter's walk excludes: virtualenvs, tool caches, egg
40
+ * builds, and vendored deps. Mirrors the TS EXCLUDE_DIRS role — none of these
41
+ * hold first-party source, and walking them would (a) misclassify installed deps
42
+ * as internal and (b) blow the install-free promise. `.`-prefixed dirs (`.venv`,
43
+ * `.tox`, `.mypy_cache`) are also caught by the dot-segment skip below, but are
44
+ * listed explicitly so the policy is self-contained.
45
+ */
46
+ export const PYTHON_EXCLUDE_DIRS = [
47
+ '__pycache__',
48
+ '.venv',
49
+ 'venv',
50
+ 'env',
51
+ '.tox',
52
+ '.nox',
53
+ '.mypy_cache',
54
+ '.pytest_cache',
55
+ '.ruff_cache',
56
+ '.eggs',
57
+ 'site-packages',
58
+ '.git',
59
+ 'build',
60
+ 'dist',
61
+ 'node_modules',
62
+ ];
63
+ const SOURCE_EXT_RE = new RegExp(`\\.(${SOURCE_EXTENSIONS.join('|')})$`);
64
+ const PYTHON_SOURCE_EXT_RE = new RegExp(`\\.(${PYTHON_SOURCE_EXTENSIONS.join('|')})$`);
65
+ const EXCLUDE_SET = new Set(EXCLUDE_DIRS);
66
+ const PYTHON_EXCLUDE_SET = new Set(PYTHON_EXCLUDE_DIRS);
67
+ /**
68
+ * Does a repo-relative posix path denote a file the extractor would include?
69
+ * For `ts` this mirrors the ts-morph adapter's glob EXACTLY (verified empirically
70
+ * + by the equivalence fixture): matching extension, no excluded-dir segment, and
71
+ * NO dotted segment — ts-morph's globbing skips dot-directories AND dot-files by
72
+ * default (`.storybook/x.ts`, `src/.hidden.ts` are not added), so the diff
73
+ * classifier must skip them too or a patched graph would diverge from a full
74
+ * extract. For `python` the same shape holds with `.py`/`.pyi` + the Python
75
+ * exclude set; the dot-segment skip drops `.venv`/`.tox`/… while keeping
76
+ * `__init__.py` (a `_`-prefixed name, not a dotted one).
77
+ */
78
+ export function isSourceFilePath(path, lang = 'ts') {
79
+ const extRe = lang === 'python' ? PYTHON_SOURCE_EXT_RE : SOURCE_EXT_RE;
80
+ const excludes = lang === 'python' ? PYTHON_EXCLUDE_SET : EXCLUDE_SET;
81
+ if (!extRe.test(path))
82
+ return false;
83
+ for (const seg of path.split('/')) {
84
+ if (seg.startsWith('.'))
85
+ return false;
86
+ if (excludes.has(seg))
87
+ return false;
88
+ }
89
+ return true;
90
+ }
91
+ // ---------------------------------------------------------------------------
92
+ // Config invalidators (the correctness valve).
93
+ //
94
+ // These files change MODULE RESOLUTION for the INSTALL-FREE extractor
95
+ // (tsconfig/jsconfig paths/baseUrl feed the Project's compilerOptions;
96
+ // package.json's `type`/`imports`/`exports` fields affect ts-morph's Bundler
97
+ // resolution). A diff touching any of them forces a FULL re-extract at that
98
+ // checkpoint — conservative and rare.
99
+ //
100
+ // NARROWED ( item 3a): lockfiles (package-lock.json, npm-shrinkwrap
101
+ // .json, yarn.lock, pnpm-lock.yaml, bun.lockb/bun.lock, deno.lock), deno.json/
102
+ // deno.jsonc, and pnpm-workspace.yaml PROVABLY cannot affect the extractor's
103
+ // output — it never resolves into node_modules (a bare specifier that doesn't
104
+ // resolve from source is an external by design) and it ignores deno config
105
+ // entirely, so what a lockfile pins is invisible to it. Treating them as
106
+ // invalidators cost a needless full extract on every lockfile-touching merge
107
+ // (~10-15% of merges on dep-heavy repos).
108
+ // TS side: tsconfig/jsconfig paths+baseUrl and package.json type/imports/exports.
109
+ // Python side: pyproject.toml / setup.cfg / setup.py declare package-dir
110
+ // + src-layout + namespace-package settings that steer Pyright's first-party
111
+ // resolution, so a diff touching them forces a full re-extract. requirements*.txt
112
+ // / Pipfile are deliberately NOT invalidators — like TS lockfiles they only pin
113
+ // third-party deps we never install, which are invisible to the extractor. The
114
+ // basenames are language-distinct, so matching all of them unconditionally never
115
+ // changes single-language behavior.
116
+ const INVALIDATOR_BASENAME_RE = /^(tsconfig[^/]*\.json|jsconfig[^/]*\.json|package\.json|pyproject\.toml|setup\.cfg|setup\.py)$/;
117
+ /** Does a repo-relative path name a resolution-affecting config file? */
118
+ export function isConfigInvalidatorPath(path) {
119
+ const base = path.split('/').pop() ?? path;
120
+ return INVALIDATOR_BASENAME_RE.test(base);
121
+ }
122
+ /**
123
+ * Stage B — the blob-cache KEY COMPONENT. A `file_parse_cache` row is
124
+ * keyed (repo_id, blob_sha, extractor_version): blob-identical content can
125
+ * only be reused while the per-file extraction SEMANTICS are unchanged. Bump
126
+ * this whenever per-file extraction OUTPUT can change for the same blob:
127
+ * adapter edge semantics (extractFileImportsRecord/extractFileCalls), the
128
+ * source globs / EXCLUDE_DIRS policy, an invalidator-policy change that alters
129
+ * output, or the FileRecord shape itself. A bump cleanly orphans every cached
130
+ * row (all lookups miss → re-parse — the once-per-version cost; saveParseCache
131
+ * GCs the orphaned versions best-effort). Version 1 is RESERVED for the
132
+ * implicit Stage-A semantics and is never written to the table.
133
+ */
134
+ export const EXTRACTOR_VERSION = 2;
135
+ // ---------------------------------------------------------------------------
136
+ // NormalizedGraph assembly (shared by the batch adapter + the engine, so a
137
+ // patched state and a full extract produce byte-identical downstream input).
138
+ /**
139
+ * Assemble the NormalizedGraph the clustering layer consumes from a file-graph
140
+ * state. Files are emitted in SORTED path order — deterministic across
141
+ * platforms and identical between the batch and incremental paths (Louvain's
142
+ * seeded RNG consumes node insertion order, so ordering is part of output
143
+ * stability).
144
+ */
145
+ export function graphFromState(root, state) {
146
+ const paths = Object.keys(state.files).sort();
147
+ const files = paths.map((id) => ({
148
+ id,
149
+ loc: state.files[id].loc,
150
+ language: state.files[id].language,
151
+ }));
152
+ const externals = new Map();
153
+ const edges = [];
154
+ for (const id of paths) {
155
+ const rec = state.files[id];
156
+ for (const e of rec.imports) {
157
+ edges.push({ from: id, to: e.to, kind: 'import', external: false, weight: e.weight });
158
+ }
159
+ for (const x of rec.externals) {
160
+ externals.set(x.id, { id: x.id, specifier: x.specifier });
161
+ edges.push({ from: id, to: x.id, kind: 'import', external: true, weight: x.weight });
162
+ }
163
+ for (const c of rec.calls) {
164
+ edges.push({ from: id, to: c.to, kind: 'call', external: false, weight: c.weight });
165
+ }
166
+ }
167
+ return { root, files, edges, externals: [...externals.values()] };
168
+ }
169
+ /** Classify a checkpoint's diff entries into the engine's decision inputs. */
170
+ export function classifyDiff(entries) {
171
+ const sourceAdded = [];
172
+ const sourceModified = [];
173
+ const sourceDeleted = [];
174
+ const invalidators = [];
175
+ let oddStatus = false;
176
+ for (const e of entries) {
177
+ if (isConfigInvalidatorPath(e.path))
178
+ invalidators.push(e.path);
179
+ if (!isSourceFilePath(e.path))
180
+ continue;
181
+ switch (e.status) {
182
+ case 'A':
183
+ sourceAdded.push(e.path);
184
+ break;
185
+ case 'M':
186
+ sourceModified.push(e.path);
187
+ break;
188
+ case 'D':
189
+ sourceDeleted.push(e.path);
190
+ break;
191
+ default:
192
+ // T (type change: file↔symlink) or an exotic status — treat as a shape
193
+ // change so the engine rebuilds rather than guessing.
194
+ oddStatus = true;
195
+ sourceModified.push(e.path);
196
+ break;
197
+ }
198
+ }
199
+ return {
200
+ sourceAdded,
201
+ sourceModified,
202
+ sourceDeleted,
203
+ invalidators,
204
+ shapeChanged: oddStatus || sourceAdded.length > 0 || sourceDeleted.length > 0,
205
+ };
206
+ }
207
+ // ---------------------------------------------------------------------------
208
+ // The dependents closure — WHICH files need their (expensive) call edges
209
+ // re-extracted after a diff.
210
+ //
211
+ // STEP-1 finding: per-file IMPORT extraction is per-file-independent
212
+ // given tree resolution (a file's specifiers + the tree decide its import
213
+ // edges), but CALL-edge extraction is NOT — it resolves each call site's symbol
214
+ // through the type checker, so a file's call edges can change when a file it
215
+ // imports changes its exports (and, through `export … from` chains, when a
216
+ // transitively re-exported file changes). The patch unit is therefore:
217
+ //
218
+ // (a) the changed files themselves (added + modified),
219
+ // (b) any file whose freshly-resolved import TARGETS differ from the carried
220
+ // state (its specifiers now bind elsewhere — covers added/deleted targets
221
+ // and resolution shadowing uniformly, no path heuristics), and
222
+ // (c) any file that imports a member of the REEXPORT CLOSURE of the changed/
223
+ // deleted set (a barrel re-exporting a changed file propagates the
224
+ // change one hop further; the closure follows those chains to fixpoint).
225
+ //
226
+ // KNOWN RESIDUAL (documented, accepted for Stage A): a call edge that resolves
227
+ // through a TYPE returned by an intermediary (f calls a method declared in h,
228
+ // reached via a type that g returns) can change when h changes without f
229
+ // importing h or any re-export chain connecting them. Healed by the config
230
+ // invalidators (full extract) and Stage B's periodic full-extract
231
+ // reconciliation; not representable in the import graph without a full
232
+ // type-dependency graph.
233
+ /**
234
+ * Expand `seeds` (changed/deleted paths) through re-export chains: any file
235
+ * whose `reexports` include a member of the closure joins it, to fixpoint.
236
+ */
237
+ export function reexportClosure(seeds, reexportsByFile) {
238
+ const closure = new Set(seeds);
239
+ let grew = true;
240
+ while (grew) {
241
+ grew = false;
242
+ for (const [file, targets] of reexportsByFile) {
243
+ if (closure.has(file))
244
+ continue;
245
+ if (targets.some((t) => closure.has(t))) {
246
+ closure.add(file);
247
+ grew = true;
248
+ }
249
+ }
250
+ }
251
+ return closure;
252
+ }
253
+ function importTargetsKey(edges) {
254
+ return edges
255
+ .map((e) => `${e.to}|${e.weight}`)
256
+ .sort()
257
+ .join('\n');
258
+ }
259
+ /**
260
+ * The set of files whose CALL edges must be re-extracted at this checkpoint.
261
+ * All inputs reflect the CURRENT tree (post-diff): `freshImports` are the
262
+ * just-re-resolved import edges, `prevImports` the carried ones (absent for
263
+ * new files), `reexports` the fresh re-export targets per file.
264
+ */
265
+ export function computeCallPatchUnit(args) {
266
+ const unit = new Set([...args.added, ...args.modified]);
267
+ // (b) resolution moved — the file's specifiers bind to different targets now.
268
+ for (const [file, fresh] of args.freshImports) {
269
+ if (unit.has(file))
270
+ continue;
271
+ const prev = args.prevImports.get(file);
272
+ if (prev === undefined) {
273
+ unit.add(file); // not in the carried state → treat as new
274
+ continue;
275
+ }
276
+ if (importTargetsKey(fresh) !== importTargetsKey(prev))
277
+ unit.add(file);
278
+ }
279
+ // (c) imports a member of the re-export closure of the changed/deleted set.
280
+ const seeds = new Set([...args.added, ...args.modified, ...args.deleted]);
281
+ const closure = reexportClosure(seeds, args.reexports);
282
+ for (const [file, fresh] of args.freshImports) {
283
+ if (unit.has(file))
284
+ continue;
285
+ if (fresh.some((e) => closure.has(e.to)))
286
+ unit.add(file);
287
+ }
288
+ return unit;
289
+ }
290
+ // ---------------------------------------------------------------------------
291
+ // Serialization — the `fileGraph` payload extension of extraction_cache
292
+ // ( Stage A item 7). Written at the end of each boot, read as the next
293
+ // boot's seed (zero full extract when the head commit is still reachable).
294
+ //
295
+ // NOTE: this rides inside the existing jsonb `extraction_cache.payload` — fine
296
+ // at current scale (~100s of KB for a ~400-file repo). Stage B ADDS the
297
+ // content-addressed per-blob parse cache (`file_parse_cache`, keyed
298
+ // (repo_id, blob_sha, extractor_version)) as the fallback seed when this
299
+ // graph's head commit is unreachable in the clone — the two are complementary:
300
+ // this payload is the zero-parse fast path, the blob cache the O(misses)
301
+ // cold-boot path.
302
+ export const FILE_GRAPH_VERSION = 1;
303
+ export function serializeFileGraph(state, blobShaByPath) {
304
+ const files = {};
305
+ for (const [path, rec] of Object.entries(state.files)) {
306
+ const blobSha = blobShaByPath?.get(path);
307
+ files[path] = blobSha ? { ...rec, blobSha } : { ...rec };
308
+ }
309
+ return { version: FILE_GRAPH_VERSION, headSha: state.headSha, files };
310
+ }
311
+ function isEdgeRefArray(v) {
312
+ return Array.isArray(v) && v.every((e) => e && typeof e.to === 'string' && typeof e.weight === 'number');
313
+ }
314
+ function isExternalRefArray(v) {
315
+ return (Array.isArray(v) &&
316
+ v.every((e) => e && typeof e.id === 'string' && typeof e.specifier === 'string' && typeof e.weight === 'number'));
317
+ }
318
+ /**
319
+ * Validate ONE untrusted jsonb value as a FileRecord — the per-record half of
320
+ * deserializeFileGraph's shape guard, exported ( Stage B) so the blob
321
+ * parse-cache reader (assemble/parse-cache.ts) applies the SAME rigor per row
322
+ * without duplicating it. A row failing this is treated as a cache miss, never
323
+ * an error: a corrupt cached record must degrade to a re-parse.
324
+ */
325
+ export function isValidFileRecord(v) {
326
+ if (!v || typeof v !== 'object')
327
+ return false;
328
+ const r = v;
329
+ if (typeof r.loc !== 'number' || typeof r.language !== 'string')
330
+ return false;
331
+ if (!isEdgeRefArray(r.imports) || !isEdgeRefArray(r.calls))
332
+ return false;
333
+ if (!isExternalRefArray(r.externals))
334
+ return false;
335
+ if (!Array.isArray(r.reexports) || !r.reexports.every((t) => typeof t === 'string'))
336
+ return false;
337
+ return true;
338
+ }
339
+ /**
340
+ * Validate + adopt a serialized file graph. Returns null for anything not
341
+ * usable as a seed (wrong version, missing head, malformed records) — the
342
+ * caller then seeds with a full extract instead. NEVER throws: a corrupt cache
343
+ * must degrade to a full extract, not fail the ingest. Unknown extra fields
344
+ * (e.g. the Stage-B `bootsSinceReconcile` counter) are TOLERATED — older and
345
+ * newer payloads must round-trip through each other's readers.
346
+ */
347
+ export function deserializeFileGraph(v) {
348
+ if (!v || typeof v !== 'object')
349
+ return null;
350
+ const g = v;
351
+ if (g.version !== FILE_GRAPH_VERSION)
352
+ return null;
353
+ if (typeof g.headSha !== 'string' || g.headSha.length < 7)
354
+ return null;
355
+ if (!g.files || typeof g.files !== 'object' || Array.isArray(g.files))
356
+ return null;
357
+ const files = {};
358
+ for (const [path, raw] of Object.entries(g.files)) {
359
+ if (!isValidFileRecord(raw))
360
+ return null;
361
+ const r = raw;
362
+ files[path] = {
363
+ loc: r.loc,
364
+ language: r.language,
365
+ imports: r.imports,
366
+ externals: r.externals,
367
+ calls: r.calls,
368
+ reexports: r.reexports,
369
+ ...(typeof r.blobSha === 'string' ? { blobSha: r.blobSha } : {}),
370
+ };
371
+ }
372
+ return { headSha: g.headSha, files };
373
+ }
374
+ // ---------------------------------------------------------------------------
375
+ // State diffing — the Stage-B RECONCILIATION comparator ( Stage B).
376
+ //
377
+ // The walk's carried state is provably equivalent to a full extract EXCEPT for
378
+ // the documented residual (deep type-dispatch chains — see the dependents-
379
+ // closure block above). Every ~N boots the container runs a fresh full extract
380
+ // at the carried head and compares states with this helper; any drifted path
381
+ // is healed by adopting the ground truth + re-upserting its blob-cache row.
382
+ // Explicit field-by-field keys (NOT JSON.stringify of the objects): Postgres
383
+ // jsonb normalizes object key order, so a round-tripped record could stringify
384
+ // differently from a fresh one despite being identical.
385
+ function edgeRefsKey(v) {
386
+ return v
387
+ .map((e) => `${e.to}|${e.weight}`)
388
+ .sort()
389
+ .join('\n');
390
+ }
391
+ function externalRefsKey(v) {
392
+ return v
393
+ .map((e) => `${e.id}|${e.specifier}|${e.weight}`)
394
+ .sort()
395
+ .join('\n');
396
+ }
397
+ /**
398
+ * Paths whose records DIFFER between two states (union of both key sets — a
399
+ * path present in only one side counts as drifted). Comparison is ORDER-
400
+ * INSENSITIVE over the imports/externals/calls/reexports arrays (extraction
401
+ * order is not semantics) and IGNORES blobSha (a serialization tag, not
402
+ * extractor output). Pure; never throws.
403
+ */
404
+ export function diffFileGraphStates(a, b) {
405
+ const recordKey = (rec) => [
406
+ `loc:${rec.loc}`,
407
+ `lang:${rec.language}`,
408
+ `imports:${edgeRefsKey(rec.imports)}`,
409
+ `externals:${externalRefsKey(rec.externals)}`,
410
+ `calls:${edgeRefsKey(rec.calls)}`,
411
+ `reexports:${[...rec.reexports].sort().join(',')}`,
412
+ ].join('\x1f');
413
+ const drifted = [];
414
+ const allPaths = new Set([...Object.keys(a.files), ...Object.keys(b.files)]);
415
+ for (const path of [...allPaths].sort()) {
416
+ const ra = a.files[path];
417
+ const rb = b.files[path];
418
+ if (!ra || !rb) {
419
+ drifted.push(path);
420
+ continue;
421
+ }
422
+ if (recordKey(ra) !== recordKey(rb))
423
+ drifted.push(path);
424
+ }
425
+ return drifted;
426
+ }
427
+ //# sourceMappingURL=file-graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-graph.js","sourceRoot":"","sources":["../../src/graph/file-graph.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,0BAA0B;AAC1B,EAAE;AACF,sEAAsE;AACtE,gFAAgF;AAChF,qEAAqE;AACrE,yEAAyE;AACzE,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,qDAAqD;AACrD,EAAE;AACF,2EAA2E;AAC3E,+EAA+E;AAC/E,gFAAgF;AAChF,iEAAiE;AACjE,EAAE;AACF,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,0DAA0D;AAgB1D,wFAAwF;AACxF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAEjG,iFAAiF;AACjF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,KAAK,CAAU,CAAC;AAE/D,+FAA+F;AAC/F,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,cAAc;IACd,MAAM;IACN,OAAO;IACP,KAAK;IACL,UAAU;IACV,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;CACA,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,aAAa;IACb,OAAO;IACP,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,aAAa;IACb,eAAe;IACf,aAAa;IACb,OAAO;IACP,eAAe;IACf,MAAM;IACN,OAAO;IACP,MAAM;IACN,cAAc;CACN,CAAC;AAEX,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,OAAO,iBAAiB,CAAC,IAAI,C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AE,CAC5C;QACE,OAAO,GAAG,CAAC,GAAG,EAAE;QAChB,QAAQ,GAAG,CAAC,QAAQ,EAAE;QACtB,WAAW,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QACrC,aAAa,eAAe,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;QAC7C,SAAS,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACjC,aAAa,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;KACnD,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEjB,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7E,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QACxC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzB,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,SAAS;QACX,CAAC;QACD,IAAI,SAAS,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC,EAAE,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /** One frontend HTTP call site: the file it's in and the URL path it targets. */
2
+ export interface FrontendApiCall {
3
+ fileId: string;
4
+ url: string;
5
+ }
6
+ /**
7
+ * Every frontend HTTP call site under `repoDir`. Scans ALL TS/JS source
8
+ * (including generated SDKs — the noise filter drops those from the graph, but
9
+ * they hold the URL literals), so the caller can re-attribute a dropped file to a
10
+ * surviving module. Deterministic (sorted); never throws (a per-file parse error
11
+ * degrades to no calls for that file).
12
+ */
13
+ export declare function collectFrontendApiCalls(repoDir: string): FrontendApiCall[];
14
+ //# sourceMappingURL=http-callsites.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-callsites.d.ts","sourceRoot":"","sources":["../../src/graph/http-callsites.ts"],"names":[],"mappings":"AAqBA,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AA+DD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,EAAE,CAe1E"}