@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,2 @@
1
+ export declare function registerBuiltinInfraAdapters(): void;
2
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/infra/register.ts"],"names":[],"mappings":"AAmCA,wBAAgB,4BAA4B,IAAI,IAAI,CA8CnD"}
@@ -0,0 +1,81 @@
1
+ // builtin infra-adapter registration.
2
+ //
3
+ // Registration ORDER is the conflict-resolution priority for the merge step
4
+ // (registry.ts): the first-registered adapter wins a `declared`-vs-`declared`
5
+ // tie. The locked order is CF → Supabase → Terraform: a provider-specific
6
+ // config (wrangler.toml, supabase/config.toml) is more authoritative about its
7
+ // own resources than a generic Terraform `cloudflare_*` / `supabase_*` block,
8
+ // and Terraform is the universal fallback. / slot their adapters
9
+ // into this list in priority order.
10
+ //
11
+ // `registerInfraAdapter` is idempotent on name (replaces), so calling this more
12
+ // than once across a process is safe.
13
+ import { registerInfraAdapter } from './registry.js';
14
+ import { cloudflareAdapter } from './cloudflare/cloudflare.js';
15
+ import { supabaseAdapter } from './supabase/supabase.js';
16
+ import { dockerComposeAdapter } from './compose/compose.js';
17
+ import { netlifyAdapter } from './netlify/netlify.js';
18
+ import { firebaseAdapter } from './firebase/firebase.js';
19
+ import { convexAdapter } from './convex/convex.js';
20
+ import { vercelAdapter } from './vercel/vercel.js';
21
+ import { flyAdapter } from './fly/fly.js';
22
+ import { renderAdapter } from './render/render.js';
23
+ import { railwayAdapter } from './railway/railway.js';
24
+ import { herokuAdapter } from './heroku/heroku.js';
25
+ import { digitaloceanAdapter } from './digitalocean/digitalocean.js';
26
+ import { kamalAdapter } from './kamal/kamal.js';
27
+ import { sstAdapter } from './sst/sst.js';
28
+ import { pulumiAdapter } from './pulumi/pulumi.js';
29
+ import { opentofuAdapter } from './opentofu/opentofu.js';
30
+ import { awsAdapter } from './aws/aws.js';
31
+ import { gcpAdapter } from './gcp/gcp.js';
32
+ import { azureAdapter } from './azure/azure.js';
33
+ import { terraformAdapter } from './terraform/terraform.js';
34
+ export function registerBuiltinInfraAdapters() {
35
+ registerInfraAdapter(cloudflareAdapter);
36
+ registerInfraAdapter(supabaseAdapter);
37
+ // docker-compose — a self-hosted container declaration; its id space
38
+ // (`compose:service:*`) is disjoint from the cloud adapters, so order is
39
+ // cosmetic, but it sits with the specific provider configs ahead of the
40
+ // generic IaC fallbacks.
41
+ registerInfraAdapter(dockerComposeAdapter);
42
+ // Netlify before Vercel: netlify.toml is the explicit, stronger frontend-host
43
+ // signal, so it's listed ahead of Vercel's bare `next.config.*` detection. (Their
44
+ // id spaces are disjoint, so this is intent-documenting; the attribution win comes
45
+ // from Netlify emitting sourceRoots where the Vercel next.config path doesn't.)
46
+ registerInfraAdapter(netlifyAdapter);
47
+ // Firebase — a BaaS like Supabase; disjoint id space (`firebase:*`), grouped
48
+ // with the other provider-specific configs ahead of the generic IaC fallbacks.
49
+ registerInfraAdapter(firebaseAdapter);
50
+ // Convex — a reactive-TS BaaS like Supabase/Firebase; disjoint id
51
+ // space (`convex:*`), grouped with the provider-specific configs ahead of the
52
+ // generic IaC fallbacks. Source-based (functions ARE code), no image resolver.
53
+ registerInfraAdapter(convexAdapter);
54
+ registerInfraAdapter(vercelAdapter);
55
+ registerInfraAdapter(flyAdapter);
56
+ registerInfraAdapter(renderAdapter);
57
+ registerInfraAdapter(railwayAdapter);
58
+ registerInfraAdapter(herokuAdapter);
59
+ // DigitalOcean App Platform — keyed off the `.do/` app spec (NOT bare app.yaml,
60
+ // which GCP App Engine owns). Disjoint id space (`digitalocean:*`).
61
+ registerInfraAdapter(digitaloceanAdapter);
62
+ // Kamal — Docker-to-VPS deploy; self-hosted-container-shaped like
63
+ // docker-compose. Keyed off config/deploy.yml (path-scoped); disjoint id space
64
+ // (`kamal:*`), so order is cosmetic — no detect() overlap with other adapters.
65
+ registerInfraAdapter(kamalAdapter);
66
+ // SST v3 "Ion" — config-as-code IaC like Pulumi (ts-morph over
67
+ // sst.config.ts); disjoint id space (`sst:*`). Triggers only on sst.config.*,
68
+ // so no detect() double-fire with Pulumi (Pulumi.yaml) or Terraform (*.tf);
69
+ // grouped with the code-IaC adapters ahead of the generic fallbacks.
70
+ registerInfraAdapter(sstAdapter);
71
+ registerInfraAdapter(pulumiAdapter);
72
+ registerInfraAdapter(opentofuAdapter);
73
+ registerInfraAdapter(awsAdapter);
74
+ registerInfraAdapter(gcpAdapter);
75
+ registerInfraAdapter(azureAdapter);
76
+ // Terraform last — the universal fallback. A provider-specific config
77
+ // (wrangler.toml, supabase/config.toml) is more authoritative about its own
78
+ // resources than a generic `cloudflare_*` / `supabase_*` Terraform block.
79
+ registerInfraAdapter(terraformAdapter);
80
+ }
81
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/infra/register.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,0EAA0E;AAC1E,+EAA+E;AAC/E,8EAA8E;AAC9E,iEAAiE;AACjE,oCAAoC;AACpC,EAAE;AACF,gFAAgF;AAChF,sCAAsC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UA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cAAc,CAAC,CAAC;IACrC,oBAAoB,CAAC,aAAa,CAAC,CAAC;IACpC,gFAAgF;IAChF,oEAAoE;IACpE,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;IAC1C,kEAAkE;IAClE,+EAA+E;IAC/E,+EAA+E;IAC/E,oBAAoB,CAAC,YAAY,CAAC,CAAC;IACnC,+DAA+D;IAC/D,8EAA8E;IAC9E,4EAA4E;IAC5E,qEAAqE;IACrE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACjC,oBAAoB,CAAC,aAAa,CAAC,CAAC;IACpC,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACtC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACjC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACjC,oBAAoB,CAAC,YAAY,CAAC,CAAC;IACnC,sEAAsE;IACtE,4EAA4E;IAC5E,0EAA0E;IAC1E,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,64 @@
1
+ import type { InfraAdapter, InfraGraph, MergedInfraGraph } from './types.js';
2
+ /**
3
+ * Register an adapter. Idempotent on `name` — re-registering replaces the
4
+ * existing entry (useful for tests that swap a mock implementation).
5
+ * Insertion order is the conflict-priority order for the merge step.
6
+ */
7
+ export declare function registerInfraAdapter(adapter: InfraAdapter): void;
8
+ /** Read-only view of registered adapters in registration order. */
9
+ export declare function listInfraAdapters(): readonly InfraAdapter[];
10
+ /**
11
+ * the `scansSourcePath` predicates of every registered adapter that
12
+ * (a) declares one AND (b) `detect()`-positive on `repoDir` — i.e. the
13
+ * source-grep adapters ACTIVE for this repo. The diff-driven hosted walk
14
+ * (container.ts) ORs these into its carry/re-extract decision so a source-only
15
+ * change a source-scanner would read forces an infra re-extract instead of
16
+ * reusing the stale carried graph.
17
+ *
18
+ * Detection runs in parallel (cheap file-exists checks), exactly like
19
+ * runInfraAdapters. Computed ONCE per re-extract (not per checkpoint): a diff
20
+ * that would flip an adapter's detect() necessarily touches its config/IaC
21
+ * trigger (supabase/**, package.json, next.config.*, vercel.json), all of which
22
+ * already force a re-extract (diffTouchesInfra / config-invalidator) — after
23
+ * which the walk recomputes this set. So a config-only adapter never starts
24
+ * scanning source mid-walk without us noticing.
25
+ */
26
+ export declare function activeSourceScanners(repoDir: string): Promise<Array<(path: string) => boolean>>;
27
+ /** Test helper — wipe the registry between specs. Never call from production. */
28
+ export declare function clearInfraAdapters(): void;
29
+ /**
30
+ * Run every `detect()`-positive adapter against `repoDir` and merge the
31
+ * outputs. Detection runs in parallel (cheap file-exists checks),
32
+ * extraction runs serially (cheap IO + parsing, but several adapters
33
+ * touching the same files saturates the kernel cache faster serially
34
+ * than in parallel — and serial keeps log output legible).
35
+ *
36
+ * If no adapter detects the repo, returns an empty MergedInfraGraph anchored
37
+ * at `repoDir` — the caller (assemble.ts) should still produce a snapshot;
38
+ * the infra layer just contributes nothing.
39
+ */
40
+ export declare function runInfraAdapters(repoDir: string): Promise<MergedInfraGraph>;
41
+ /**
42
+ * Merge per-adapter InfraGraphs into one. Conflict policy:
43
+ *
44
+ * * Node id collisions resolve in favor of the higher-provenance node
45
+ * (declared > inferred > llm-classified). Ties on provenance resolve in
46
+ * favor of the earlier-listed graph (= earlier-registered adapter).
47
+ *
48
+ * * Edges dedupe on (source, target, kind) — two adapters describing the
49
+ * same Worker → Queue write produce one edge. Adapter-specific metadata
50
+ * from the LOSING duplicate is dropped.
51
+ *
52
+ * * ClassificationRef refs deduped on (provider, resourceType, forNodeId).
53
+ *
54
+ * Node ids are NAMESPACED by adapter (`<adapter>:<node.id>`) before merging,
55
+ * which means raw id collisions only happen if the same adapter emits the
56
+ * same id twice — that's an adapter bug, not a merge concern, and we throw.
57
+ */
58
+ export declare function mergeInfraGraphs(graphs: InfraGraph[], root: string): MergedInfraGraph;
59
+ /**
60
+ * Edges whose `source` or `target` resolves to neither a merged infra node nor
61
+ * a member of `knownIds`. Empty result = every endpoint is accounted for.
62
+ */
63
+ export declare function validateMergedGraph(merged: MergedInfraGraph, knownIds?: ReadonlySet<string>): MergedInfraGraph['edges'];
64
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/infra/registry.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAEV,YAAY,EACZ,UAAU,EAEV,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAQpB;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAIhE;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,IAAI,SAAS,YAAY,EAAE,CAE3D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAQ3C;AAED,iFAAiF;AACjF,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAKD;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAWjF;AAYD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,UAAU,EAAE,EACpB,IAAI,EAAE,MAAM,GACX,gBAAgB,CA4ElB;AAcD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,GAAE,WAAW,CAAC,MAAM,CAAa,GACxC,gBAAgB,CAAC,OAAO,CAAC,CAI3B"}
@@ -0,0 +1,205 @@
1
+ // Adapter registry + merge.
2
+ //
3
+ // One ingest = run every detect()-positive InfraAdapter against the repo
4
+ // dir, collect their InfraGraphs, dedupe + reconcile via mergeInfraGraphs,
5
+ // then run any open ClassificationRef through before handing the
6
+ // MergedInfraGraph to the assemble step.
7
+ //
8
+ // Adapters run in REGISTRATION ORDER, and registration order is the
9
+ // conflict-resolution priority for `declared` vs `declared` ties: the
10
+ // first-registered adapter wins. Today that's CF → Supabase → Terraform.
11
+ // Rationale (per the ticket): wrangler.toml is more specific
12
+ // about Cloudflare resources than a Terraform `cloudflare_*` resource is;
13
+ // Terraform is the universal fallback. Same logic applies to Supabase
14
+ // (config.toml beats Terraform).
15
+ //
16
+ // `declared > inferred > llm-classified` is the inverse priority on
17
+ // provenance — a higher-priority provenance always wins regardless of
18
+ // adapter order. Two adapters both `declared` a node → adapter-order tie
19
+ // break (above). One `declared`, one `llm-classified` → declared wins.
20
+ // ---------------------------------------------------------------------------
21
+ // Adapter registration.
22
+ const REGISTERED = [];
23
+ /**
24
+ * Register an adapter. Idempotent on `name` — re-registering replaces the
25
+ * existing entry (useful for tests that swap a mock implementation).
26
+ * Insertion order is the conflict-priority order for the merge step.
27
+ */
28
+ export function registerInfraAdapter(adapter) {
29
+ const existing = REGISTERED.findIndex((a) => a.name === adapter.name);
30
+ if (existing >= 0)
31
+ REGISTERED[existing] = adapter;
32
+ else
33
+ REGISTERED.push(adapter);
34
+ }
35
+ /** Read-only view of registered adapters in registration order. */
36
+ export function listInfraAdapters() {
37
+ return REGISTERED;
38
+ }
39
+ /**
40
+ * the `scansSourcePath` predicates of every registered adapter that
41
+ * (a) declares one AND (b) `detect()`-positive on `repoDir` — i.e. the
42
+ * source-grep adapters ACTIVE for this repo. The diff-driven hosted walk
43
+ * (container.ts) ORs these into its carry/re-extract decision so a source-only
44
+ * change a source-scanner would read forces an infra re-extract instead of
45
+ * reusing the stale carried graph.
46
+ *
47
+ * Detection runs in parallel (cheap file-exists checks), exactly like
48
+ * runInfraAdapters. Computed ONCE per re-extract (not per checkpoint): a diff
49
+ * that would flip an adapter's detect() necessarily touches its config/IaC
50
+ * trigger (supabase/**, package.json, next.config.*, vercel.json), all of which
51
+ * already force a re-extract (diffTouchesInfra / config-invalidator) — after
52
+ * which the walk recomputes this set. So a config-only adapter never starts
53
+ * scanning source mid-walk without us noticing.
54
+ */
55
+ export async function activeSourceScanners(repoDir) {
56
+ const scanners = REGISTERED.filter((a) => typeof a.scansSourcePath === 'function');
57
+ const detections = await Promise.all(scanners.map(async (a) => ({ adapter: a, detected: await a.detect(repoDir) })));
58
+ return detections
59
+ .filter((d) => d.detected)
60
+ .map((d) => (path) => d.adapter.scansSourcePath(path));
61
+ }
62
+ /** Test helper — wipe the registry between specs. Never call from production. */
63
+ export function clearInfraAdapters() {
64
+ REGISTERED.length = 0;
65
+ }
66
+ // ---------------------------------------------------------------------------
67
+ // Run + merge.
68
+ /**
69
+ * Run every `detect()`-positive adapter against `repoDir` and merge the
70
+ * outputs. Detection runs in parallel (cheap file-exists checks),
71
+ * extraction runs serially (cheap IO + parsing, but several adapters
72
+ * touching the same files saturates the kernel cache faster serially
73
+ * than in parallel — and serial keeps log output legible).
74
+ *
75
+ * If no adapter detects the repo, returns an empty MergedInfraGraph anchored
76
+ * at `repoDir` — the caller (assemble.ts) should still produce a snapshot;
77
+ * the infra layer just contributes nothing.
78
+ */
79
+ export async function runInfraAdapters(repoDir) {
80
+ const detections = await Promise.all(REGISTERED.map(async (a) => ({ adapter: a, detected: await a.detect(repoDir) })));
81
+ const matched = detections.filter((d) => d.detected).map((d) => d.adapter);
82
+ const graphs = [];
83
+ for (const adapter of matched) {
84
+ graphs.push(await adapter.extract(repoDir));
85
+ }
86
+ return mergeInfraGraphs(graphs, repoDir);
87
+ }
88
+ // ---------------------------------------------------------------------------
89
+ // Pure merge — exported separately for tests + for callers that already
90
+ // have the per-adapter outputs in hand.
91
+ const PROVENANCE_PRIORITY = {
92
+ declared: 3,
93
+ inferred: 2,
94
+ 'llm-classified': 1,
95
+ };
96
+ /**
97
+ * Merge per-adapter InfraGraphs into one. Conflict policy:
98
+ *
99
+ * * Node id collisions resolve in favor of the higher-provenance node
100
+ * (declared > inferred > llm-classified). Ties on provenance resolve in
101
+ * favor of the earlier-listed graph (= earlier-registered adapter).
102
+ *
103
+ * * Edges dedupe on (source, target, kind) — two adapters describing the
104
+ * same Worker → Queue write produce one edge. Adapter-specific metadata
105
+ * from the LOSING duplicate is dropped.
106
+ *
107
+ * * ClassificationRef refs deduped on (provider, resourceType, forNodeId).
108
+ *
109
+ * Node ids are NAMESPACED by adapter (`<adapter>:<node.id>`) before merging,
110
+ * which means raw id collisions only happen if the same adapter emits the
111
+ * same id twice — that's an adapter bug, not a merge concern, and we throw.
112
+ */
113
+ export function mergeInfraGraphs(graphs, root) {
114
+ const byId = new Map();
115
+ for (let g = 0; g < graphs.length; g++) {
116
+ const graph = graphs[g];
117
+ const seenLocal = new Set();
118
+ for (const raw of graph.nodes) {
119
+ if (seenLocal.has(raw.id)) {
120
+ throw new Error(`infra adapter '${graph.adapter}' emitted duplicate node id '${raw.id}'`);
121
+ }
122
+ seenLocal.add(raw.id);
123
+ const namespaced = { ...raw, id: `${graph.adapter}:${raw.id}` };
124
+ const existing = byId.get(namespaced.id);
125
+ if (!existing) {
126
+ byId.set(namespaced.id, { node: namespaced, graphOrder: g });
127
+ continue;
128
+ }
129
+ const incoming = PROVENANCE_PRIORITY[namespaced.provenance];
130
+ const incumbent = PROVENANCE_PRIORITY[existing.node.provenance];
131
+ if (incoming > incumbent) {
132
+ byId.set(namespaced.id, { node: namespaced, graphOrder: g });
133
+ }
134
+ else if (incoming === incumbent && g < existing.graphOrder) {
135
+ // Higher-priority adapter (earlier-registered) wins on ties.
136
+ byId.set(namespaced.id, { node: namespaced, graphOrder: g });
137
+ }
138
+ // Otherwise existing wins; nothing to do.
139
+ }
140
+ }
141
+ // 2. Edges — namespace endpoints, dedupe on (source, target, kind).
142
+ //
143
+ // Endpoints can be either an adapter-local infra node id, or a code-side
144
+ // module id (set during later cross-graph join). We prefix infra-local
145
+ // refs; anything that doesn't match a known infra node id is left
146
+ // untouched so the cross-graph join can bind it.
147
+ //
148
+ // PR #7 review #7: pre-compute the local-id set once per graph instead
149
+ // of `.some()`-scanning the nodes array per edge. The naive form is
150
+ // O(edges × nodes); at 's 10-adapter fan-out with one Terraform
151
+ // graph carrying thousands of resources, that compounded every ingest.
152
+ const edgeKey = (s, t, k) => `${s}→${t}:${k}`;
153
+ const edges = new Map();
154
+ for (const graph of graphs) {
155
+ const localIds = new Set(graph.nodes.map((n) => n.id));
156
+ for (const e of graph.edges) {
157
+ const src = localIds.has(e.source) ? `${graph.adapter}:${e.source}` : e.source;
158
+ const tgt = localIds.has(e.target) ? `${graph.adapter}:${e.target}` : e.target;
159
+ const key = edgeKey(src, tgt, e.kind);
160
+ if (!edges.has(key))
161
+ edges.set(key, { ...e, source: src, target: tgt });
162
+ }
163
+ }
164
+ // 3. ClassificationRefs — same namespacing for `forNodeId`, dedupe on
165
+ // the (provider, resourceType, forNodeId) triple.
166
+ const classKey = (p, rt, f) => `${p}/${rt}/${f}`;
167
+ const classRefs = new Map();
168
+ for (const graph of graphs) {
169
+ for (const c of graph.classificationsNeeded) {
170
+ const forNs = `${graph.adapter}:${c.forNodeId}`;
171
+ const key = classKey(c.provider, c.resourceType, forNs);
172
+ if (!classRefs.has(key)) {
173
+ classRefs.set(key, { ...c, forNodeId: forNs });
174
+ }
175
+ }
176
+ }
177
+ return {
178
+ root,
179
+ nodes: [...byId.values()].map((t) => t.node),
180
+ edges: [...edges.values()],
181
+ classificationsNeeded: [...classRefs.values()],
182
+ };
183
+ }
184
+ // ---------------------------------------------------------------------------
185
+ // Post-merge validation gate.
186
+ //
187
+ // `mergeInfraGraphs` deliberately leaves unresolved edge endpoints untouched
188
+ // (a Terraform `depends_on` may point at a code module the cross-graph join
189
+ // binds later). It is NOT the validation gate — this is (PR #7 review #8).
190
+ // Once the full id space is known (post-join, /12), the caller passes the
191
+ // code-module ids in `knownIds`; any edge endpoint that still doesn't resolve
192
+ // is an adapter bug (a typo'd `depends_on`, a dangling ref) rather than a
193
+ // pending join. Returns those offending edges so tests can assert on an empty
194
+ // result and the join step can fail loud instead of rendering a phantom node.
195
+ /**
196
+ * Edges whose `source` or `target` resolves to neither a merged infra node nor
197
+ * a member of `knownIds`. Empty result = every endpoint is accounted for.
198
+ */
199
+ export function validateMergedGraph(merged, knownIds = new Set()) {
200
+ const ids = new Set(merged.nodes.map((n) => n.id));
201
+ for (const id of knownIds)
202
+ ids.add(id);
203
+ return merged.edges.filter((e) => !ids.has(e.source) || !ids.has(e.target));
204
+ }
205
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/infra/registry.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,kEAAkE;AAClE,yCAAyC;AACzC,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,yEAAyE;AACzE,8DAA8D;AAC9D,0EAA0E;AAC1E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,yEAAyE;AACzE,uEAAuE;AAWvE,8EAA8E;AAC9E,wBAAwB;AAExB,MAAM,UAAU,GAAmB,EAAE,CAAC;AAEtC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAqB;IACxD,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,IAAI,QAAQ,IAAI,CAAC;QAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;;QAC7C,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAe;IAEf,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,eAAe,KA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this repo-relative path one an infra adapter would read? */
2
+ export declare function isInfraRelevantPath(path: string): boolean;
3
+ /** Do any of a diff's paths touch infra-relevant CONFIG/IaC files? */
4
+ export declare function diffTouchesInfra(paths: readonly string[]): boolean;
5
+ /**
6
+ * the source-aware carry/re-extract decision for the hosted walk.
7
+ *
8
+ * True iff the diff touches a CONFIG/IaC infra path (diffTouchesInfra) OR a
9
+ * SOURCE path that one of the ACTIVE source-grep adapters reads. `sourceScanners`
10
+ * is the list of `scansSourcePath` predicates for the adapters whose detect()
11
+ * is positive on this repo (registry.activeSourceScanners) — pass an empty list
12
+ * (or omit) for a repo with no source-grep adapter, and this collapses to
13
+ * `diffTouchesInfra`, preserving the carry optimization for config-only stacks.
14
+ */
15
+ export declare function diffTouchesInfraWithSources(paths: readonly string[], sourceScanners?: ReadonlyArray<(path: string) => boolean>): boolean;
16
+ //# sourceMappingURL=relevance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relevance.d.ts","sourceRoot":"","sources":["../../src/infra/relevance.ts"],"names":[],"mappings":"AAwGA,kEAAkE;AAClE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOzD;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAElE;AAED;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,cAAc,GAAE,aAAa,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAM,GAC5D,OAAO,CAIT"}
@@ -0,0 +1,132 @@
1
+ // Stage A — infra-relevance gate for diff-driven ingestion.
2
+ //
3
+ // Decides whether a checkpoint's diff could change the INFRA topology: only
4
+ // then is an infra re-extraction warranted; otherwise the previous
5
+ // checkpoint's infra graph is reused.
6
+ //
7
+ // TWO classes of trigger ( fix):
8
+ // 1. CONFIG/IaC paths — `diffTouchesInfra` below. Every adapter reads these;
9
+ // a config-DECLARED adapter (Cloudflare, Terraform, Fly, …) reads ONLY
10
+ // these, so a checkpoint that touches none can safely carry that adapter's
11
+ // graph.
12
+ // 2. SOURCE paths a source-grep adapter reads — `diffTouchesInfraWithSources`.
13
+ // This is the carry-invariant fix: it is FALSE that "infra adapters read
14
+ // only config/IaC." The Supabase adapter greps app `.ts/.tsx/.js/…` for
15
+ // `.from(`/`.auth`/`.storage`/`.realtime` (→ app→Postgres edges + the
16
+ // Auth/Storage/Realtime nodes), and the Vercel adapter reads
17
+ // `app/**/route.ts`, `pages/api/**`, `middleware.ts`. A `supabase.from(...)`
18
+ // added in plain `src/**` changes the infra graph, so it MUST force a
19
+ // re-extract — otherwise the carried graph silently drops the new
20
+ // node/edge until the next full re-seed. This is acute on example-app,
21
+ // which has NO supabase/config.toml: its WHOLE Supabase topology is
22
+ // source-grep-derived, exactly the signal `diffTouchesInfra` alone misses.
23
+ // The source globs are NOT hard-coded here — they come from the active
24
+ // adapters' own `scansSourcePath` predicates (registry.activeSourceScanners)
25
+ // so the gate can't drift from what the adapters actually read.
26
+ //
27
+ // The CONFIG pattern list is DERIVED from the registered adapters' detect()/file
28
+ // matchers (scripts/ingest/infra/*):
29
+ // cloudflare → wrangler.toml/jsonc/json supabase → supabase/**
30
+ // terraform → *.tf, *.tfvars opentofu → *.tofu(.json), tofu.tfvars
31
+ // vercel → vercel.json, next.config.* fly → fly.toml
32
+ // netlify → netlify.toml firebase → firebase.json, .firebaserc
33
+ // convex → convex.json (; convex/** source via scansSourcePath)
34
+ // render → render.yaml/yml railway → railway.json/toml, nixpacks.toml, Procfile
35
+ // heroku → Procfile, app.json, heroku.yml pulumi → Pulumi.yaml
36
+ // sst → sst.config.ts/.mjs/.js
37
+ // aws → *.template.json, serverless.yml/yaml, samconfig.toml, template.yaml/yml, cdk.json
38
+ // gcp → app.yaml, cloudbuild.yaml azure → *.bicep, function.json, host.json
39
+ // digitalocean → .do/*.y(a)ml app spec (path-scoped, NOT bare app.yaml)
40
+ // kamal → config/deploy(.<env>)?.y(a)ml (path-scoped, NOT bare deploy.yml)
41
+ // + generic container signals: Dockerfile*, docker-compose*/compose* (.ya?ml), .dockerignore
42
+ // (the docker-compose adapter — reads these compose files)
43
+ // + root Vite SPA signal: vite.config.* — Cloudflare now reads it (+
44
+ // index.html) to emit the Pages frontend unit + its `src/**` source root. Only
45
+ // vite.config is gated (index.html is a noisy basename; a SPA appearing always
46
+ // lands a vite.config, so this still catches it).
47
+ //
48
+ // DELIBERATELY NARROWER than the broadest adapters (gcp/azure scan every
49
+ // *.yaml): a "rerun infra" false-negative only delays an infra-topology update
50
+ // to the next full extract, while matching every yaml would fire the gate on
51
+ // CI workflows and i18n files constantly, making it useless. Conservative
52
+ // where it's cheap (well-known names), not where it's noisy.
53
+ //
54
+ // NOTE: the HOSTED container pipeline now DOES run infra extraction
55
+ // (container.ts → extractCheckpointInfra). This gate is the per-checkpoint
56
+ // carry/re-extract decision + observability counter for that walk.
57
+ const INFRA_BASENAME_RE = new RegExp('^(' +
58
+ [
59
+ 'wrangler\\.(toml|jsonc|json)',
60
+ 'netlify\\.toml', //
61
+ 'firebase\\.json', //
62
+ '\\.firebaserc', //
63
+ 'convex\\.json', // Convex config (functions-dir override); the
64
+ // convex/** source signal is covered by scansSourcePath
65
+ 'vercel\\.json',
66
+ 'next\\.config\\.[^/]+',
67
+ 'fly\\.toml',
68
+ 'render\\.ya?ml',
69
+ 'railway\\.(json|toml)',
70
+ 'nixpacks\\.toml',
71
+ 'Procfile',
72
+ 'app\\.json',
73
+ 'heroku\\.yml',
74
+ 'Pulumi\\.ya?ml',
75
+ 'sst\\.config\\.[^/]+', // SST v3 Ion config (sst.config.ts/.mjs/.js)
76
+ 'serverless\\.ya?ml',
77
+ 'samconfig\\.toml',
78
+ 'template\\.ya?ml',
79
+ 'cdk\\.json',
80
+ 'app\\.yaml',
81
+ 'cloudbuild\\.ya?ml',
82
+ 'function\\.json',
83
+ 'host\\.json',
84
+ 'tofu\\.tfvars',
85
+ 'Dockerfile[^/]*',
86
+ 'docker-compose[^/]*\\.ya?ml',
87
+ 'compose(\\.[^/]+)?\\.ya?ml', // Compose Spec default filename (compose.yaml / compose.prod.yml)
88
+ '\\.dockerignore',
89
+ 'vite\\.config\\.[^/]+',
90
+ ].join('|') +
91
+ ')$');
92
+ const INFRA_EXTENSION_RE = /\.(tf|tf\.json|tfvars|tofu|tofu\.json|bicep)$/;
93
+ /** A DO App Platform spec under `.do/` — path-scoped, NOT bare app.yaml. */
94
+ const DO_SPEC_RE = /(^|\/)\.do\/[^/]+\.ya?ml$/;
95
+ /** A Kamal config — path-scoped `config/deploy(.<env>)?.y(a)ml`, NOT a
96
+ * bare `deploy.yml` basename (CI workflows use that). */
97
+ const KAMAL_SPEC_RE = /(^|\/)config\/deploy(\.[A-Za-z0-9_-]+)?\.ya?ml$/;
98
+ /** Is this repo-relative path one an infra adapter would read? */
99
+ export function isInfraRelevantPath(path) {
100
+ if (path === 'supabase' || path.startsWith('supabase/'))
101
+ return true;
102
+ if (DO_SPEC_RE.test(path))
103
+ return true;
104
+ if (KAMAL_SPEC_RE.test(path))
105
+ return true;
106
+ if (INFRA_EXTENSION_RE.test(path))
107
+ return true;
108
+ const base = path.split('/').pop() ?? path;
109
+ return INFRA_BASENAME_RE.test(base);
110
+ }
111
+ /** Do any of a diff's paths touch infra-relevant CONFIG/IaC files? */
112
+ export function diffTouchesInfra(paths) {
113
+ return paths.some(isInfraRelevantPath);
114
+ }
115
+ /**
116
+ * the source-aware carry/re-extract decision for the hosted walk.
117
+ *
118
+ * True iff the diff touches a CONFIG/IaC infra path (diffTouchesInfra) OR a
119
+ * SOURCE path that one of the ACTIVE source-grep adapters reads. `sourceScanners`
120
+ * is the list of `scansSourcePath` predicates for the adapters whose detect()
121
+ * is positive on this repo (registry.activeSourceScanners) — pass an empty list
122
+ * (or omit) for a repo with no source-grep adapter, and this collapses to
123
+ * `diffTouchesInfra`, preserving the carry optimization for config-only stacks.
124
+ */
125
+ export function diffTouchesInfraWithSources(paths, sourceScanners = []) {
126
+ if (diffTouchesInfra(paths))
127
+ return true;
128
+ if (sourceScanners.length === 0)
129
+ return false;
130
+ return paths.some((p) => sourceScanners.some((scans) => scans(p)));
131
+ }
132
+ //# sourceMappingURL=relevance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relevance.js","sourceRoot":"","sources":["../../src/infra/relevance.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,4EAA4E;AAC5E,mEAAmE;AACnE,sCAAsC;AACtC,EAAE;AACF,iCAAiC;AACjC,+EAA+E;AAC/E,4EAA4E;AAC5E,gFAAgF;AAChF,cAAc;AACd,iFAAiF;AACjF,8EAA8E;AAC9E,6EAA6E;AAC7E,2EAA2E;AAC3E,kEAAkE;AAClE,kFAAkF;AAClF,2EAA2E;AAC3E,uEAAuE;AACvE,4EAA4E;AAC5E,yEAAyE;AACzE,gFAAgF;AAChF,4EAA4E;AAC5E,kFAAkF;AAClF,qEAAqE;AACrE,EAAE;AACF,iFAAiF;AACjF,qCAAqC;AACrC,4EAA4E;AAC5E,2FAA2F;AAC3F,yEAAyE;AACzE,4EAA4E;AAC5E,sEAAsE;AACtE,2GAA2G;AAC3G,4EAA4E;AAC5E,wCAAwC;AACxC,mGAAmG;AACnG,kGAAkG;AAClG,0EAA0E;AAC1E,kFAAkF;AAClF,+FAA+F;AAC/F,+DAA+D;AAC/D,uEAAuE;AACvE,mFAAmF;AACnF,mFAAmF;AACnF,sDAAsD;AACtD,EAAE;AACF,yEAAyE;AACzE,+EAA+E;AAC/E,6EAA6E;AAC7E,0EAA0E;AAC1E,6DAA6D;AAC7D,EAAE;AACF,oEAAoE;AACpE,2EAA2E;AAC3E,mEAAmE;AAEnE,MAAM,iBAAiB,GAAG,IAAI,MAAM,CAClC,IAAI;IACF;QACE,8BAA8B;QAC9B,gBAAgB,EAAE,GAAG;QACrB,iBAAiB,EAAE,GAAG;QACtB,eAAe,EAAE,GAAG;QACpB,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,mBAAmB,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAAwB,EACxB,iBAA2D,EAAE;IAE7D,IAAI,gBAAgB,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC"}
@@ -0,0 +1,76 @@
1
+ export type RenderServiceType = 'web' | 'worker' | 'cron' | 'pserv' | 'static';
2
+ export interface RenderEnvVar {
3
+ key?: string;
4
+ /** Literal string value. */
5
+ value?: string;
6
+ /** Auto-generated secret — treat as metadata only. */
7
+ generateValue?: boolean;
8
+ /** fromDatabase: { name: string; property: string } — the service reads from a db. */
9
+ fromDatabase?: {
10
+ name?: string;
11
+ property?: string;
12
+ };
13
+ /** fromService: { name: string; type: string; property: string } — reads a peer's prop. */
14
+ fromService?: {
15
+ name?: string;
16
+ type?: string;
17
+ property?: string;
18
+ };
19
+ }
20
+ export interface RenderService {
21
+ name: string;
22
+ type: RenderServiceType;
23
+ /**
24
+ * The original type string from the YAML, preserved verbatim.
25
+ * Equals `type` for known service types; differs when an unrecognised type
26
+ * caused the parser to fall back to 'web' so the metadata can record the
27
+ * actual declared value rather than the fallback.
28
+ */
29
+ rawType: string;
30
+ /** Runtime: node | python | ruby | go | rust | elixir | docker */
31
+ runtime?: string;
32
+ buildCommand?: string;
33
+ startCommand?: string;
34
+ /** Build plan tier. */
35
+ plan?: string;
36
+ /** The git branch to track. */
37
+ branch?: string;
38
+ autoDeploy?: boolean;
39
+ /**
40
+ * the monorepo base dir Render runs build/start from (the service's
41
+ * source root). Repo-relative.
42
+ */
43
+ rootDir?: string;
44
+ /** Docker runtime — path to the Dockerfile (its dir is the build context). */
45
+ dockerfilePath?: string;
46
+ /** Docker runtime — explicit build-context dir (overrides the Dockerfile's dir). */
47
+ dockerContext?: string;
48
+ envVars: RenderEnvVar[];
49
+ /** Routes for static sites. */
50
+ routes?: Array<{
51
+ type?: string;
52
+ source?: string;
53
+ destination?: string;
54
+ }>;
55
+ }
56
+ export interface RenderDatabase {
57
+ /** Logical name used as the target for fromDatabase references. */
58
+ name: string;
59
+ plan?: string;
60
+ region?: string;
61
+ postgresMajorVersion?: number | string;
62
+ databaseName?: string;
63
+ user?: string;
64
+ }
65
+ export interface RenderRedis {
66
+ name: string;
67
+ plan?: string;
68
+ region?: string;
69
+ }
70
+ export interface RenderConfig {
71
+ services: RenderService[];
72
+ databases: RenderDatabase[];
73
+ redis: RenderRedis[];
74
+ }
75
+ export declare function parseRenderConfig(yamlText: string): RenderConfig;
76
+ //# sourceMappingURL=render-parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-parse.d.ts","sourceRoot":"","sources":["../../../src/infra/render/render-parse.ts"],"names":[],"mappings":"AAwBA,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE/E,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sFAAsF;IACtF,YAAY,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,2FAA2F;IAC3F,WAAW,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CA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