scip-query 0.24.0 → 0.26.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 (661) hide show
  1. package/CHANGELOG.md +247 -1
  2. package/README.md +111 -124
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-PRVFAGTQ.js +2 -0
  5. package/dist/call-graph-DVPAQV2F.js +2 -0
  6. package/dist/{call-graph-evidence-BociKRpF.d.ts → call-graph-evidence-CUtj8V2I.d.ts} +1 -1
  7. package/dist/chunk-2FSBGL5P.js +2 -0
  8. package/dist/chunk-2HLAFUCY.js +2 -0
  9. package/dist/chunk-2IWUT6CJ.js +3 -0
  10. package/dist/chunk-2KNN7GTQ.js +2 -0
  11. package/dist/chunk-2LHXRE2B.js +8 -0
  12. package/dist/{chunk-E65ELFKU.js → chunk-2YXE77TJ.js} +2 -2
  13. package/dist/chunk-36SGVCGX.js +2 -0
  14. package/dist/chunk-3ABBFPTP.js +2 -0
  15. package/dist/chunk-3IVFU4FD.js +3 -0
  16. package/dist/chunk-3JIQS44J.js +7 -0
  17. package/dist/chunk-3ZRB6DNK.js +7 -0
  18. package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
  19. package/dist/{chunk-BHKK5RJY.js → chunk-4BHGBMNO.js} +2 -2
  20. package/dist/chunk-4BP3UBDG.js +2 -0
  21. package/dist/chunk-4D6RO7G4.js +2 -0
  22. package/dist/chunk-4FEWQ6RH.js +2 -0
  23. package/dist/chunk-4IGEOBG7.js +2 -0
  24. package/dist/chunk-4QZXBUKC.js +2 -0
  25. package/dist/chunk-4WBDEVX2.js +4 -0
  26. package/dist/chunk-4WCUBZU3.js +8 -0
  27. package/dist/chunk-4WTUBQ36.js +40 -0
  28. package/dist/chunk-4XQ4O6IM.js +3 -0
  29. package/dist/chunk-55UQAMZO.js +4 -0
  30. package/dist/chunk-5D2LVK7O.js +125 -0
  31. package/dist/chunk-5IYJ56TT.js +2 -0
  32. package/dist/chunk-5PLMJC7Q.js +2 -0
  33. package/dist/chunk-5TNQJUR2.js +5 -0
  34. package/dist/chunk-62BDNPMI.js +2 -0
  35. package/dist/chunk-64DZ5TXR.js +7 -0
  36. package/dist/chunk-65245JCM.js +2 -0
  37. package/dist/chunk-6FFVZZL4.js +2 -0
  38. package/dist/chunk-6KO5JHAR.js +2 -0
  39. package/dist/chunk-6LRXOOSX.js +2 -0
  40. package/dist/chunk-6LSEIIF7.js +2 -0
  41. package/dist/chunk-6YMNWD3H.js +6 -0
  42. package/dist/chunk-72AD6ZRR.js +5 -0
  43. package/dist/chunk-73AAKPUC.js +4 -0
  44. package/dist/chunk-76CZ77DF.js +2 -0
  45. package/dist/chunk-7VPEEAAG.js +2 -0
  46. package/dist/chunk-7WTPQ4NX.js +14 -0
  47. package/dist/chunk-7Y5T6XDP.js +2 -0
  48. package/dist/chunk-A2IIGFMJ.js +5 -0
  49. package/dist/chunk-AB5KCTEV.js +2 -0
  50. package/dist/chunk-AC566WBP.js +6 -0
  51. package/dist/chunk-AGWFSTXC.js +3 -0
  52. package/dist/chunk-AOSIYPTA.js +2 -0
  53. package/dist/chunk-AUVEWPIF.js +2 -0
  54. package/dist/chunk-B56T42J3.js +25 -0
  55. package/dist/chunk-BIQEF5NE.js +2 -0
  56. package/dist/chunk-BL6XJKTA.js +3 -0
  57. package/dist/chunk-BMKOQJRI.js +2 -0
  58. package/dist/chunk-BOZ4EXBB.js +3 -0
  59. package/dist/chunk-BUTWYEPH.js +2 -0
  60. package/dist/chunk-BZB4QPIP.js +2 -0
  61. package/dist/{chunk-6ILKOOGH.js → chunk-CE357GEE.js} +4 -4
  62. package/dist/chunk-CFN45HFP.js +2 -0
  63. package/dist/chunk-CFYMZFXT.js +368 -0
  64. package/dist/chunk-CN5EH7O3.js +2 -0
  65. package/dist/chunk-D254DNNQ.js +4 -0
  66. package/dist/chunk-D3FDISIC.js +2 -0
  67. package/dist/chunk-D3NX5XIE.js +3 -0
  68. package/dist/chunk-DA7RPPDF.js +3 -0
  69. package/dist/chunk-DDMC3FON.js +3 -0
  70. package/dist/chunk-DIO3FUSG.js +2 -0
  71. package/dist/chunk-DJ2NNSUK.js +3 -0
  72. package/dist/chunk-DKYQIM3C.js +18 -0
  73. package/dist/{chunk-OHIV323X.js → chunk-DOOEL2IV.js} +2 -2
  74. package/dist/chunk-DVFP6PZI.js +2 -0
  75. package/dist/chunk-E3FDPXZK.js +2 -0
  76. package/dist/chunk-E7YNJLCB.js +2 -0
  77. package/dist/chunk-EFGW5JPH.js +2 -0
  78. package/dist/chunk-EJVTR244.js +13 -0
  79. package/dist/chunk-EOV7RTRZ.js +2 -0
  80. package/dist/chunk-ETOIKRHO.js +2 -0
  81. package/dist/chunk-EYK3ZAO2.js +3 -0
  82. package/dist/chunk-F2V2LPET.js +52 -0
  83. package/dist/chunk-F4LUHJTF.js +2 -0
  84. package/dist/chunk-F4PUT6IT.js +2 -0
  85. package/dist/chunk-F56GCXXS.js +5 -0
  86. package/dist/chunk-FC2EVQRM.js +2 -0
  87. package/dist/chunk-FL7NBMHP.js +3 -0
  88. package/dist/chunk-FMRN2TRL.js +3 -0
  89. package/dist/chunk-FVULPZDF.js +20 -0
  90. package/dist/chunk-GCKCF5FL.js +43 -0
  91. package/dist/chunk-GH2PYF46.js +2 -0
  92. package/dist/chunk-GHJAGXIP.js +2 -0
  93. package/dist/{chunk-2GJSD5GY.js → chunk-GMVSHUKZ.js} +2 -2
  94. package/dist/chunk-GS6KDO4R.js +2 -0
  95. package/dist/chunk-GUUBXNN7.js +2 -0
  96. package/dist/chunk-GVWX5T43.js +80 -0
  97. package/dist/chunk-GZKFETP5.js +2 -0
  98. package/dist/chunk-H4EQHO6J.js +9 -0
  99. package/dist/chunk-H73WY2RM.js +2 -0
  100. package/dist/chunk-H75GSPRV.js +60 -0
  101. package/dist/chunk-HDR3AHSV.js +61 -0
  102. package/dist/chunk-HQBSL74Y.js +2 -0
  103. package/dist/chunk-HRRFKWPZ.js +2 -0
  104. package/dist/chunk-HXENDJC6.js +2 -0
  105. package/dist/chunk-IIBAZNSW.js +21 -0
  106. package/dist/chunk-INLMWEUU.js +12 -0
  107. package/dist/chunk-IWQPAF4F.js +2 -0
  108. package/dist/chunk-IZJ6YUKP.js +35 -0
  109. package/dist/chunk-J2TMAIN5.js +60 -0
  110. package/dist/chunk-J5FJMODQ.js +142 -0
  111. package/dist/chunk-J7HZPIO3.js +2 -0
  112. package/dist/chunk-JEVRKFRL.js +2 -0
  113. package/dist/chunk-JFXSGAEB.js +30 -0
  114. package/dist/chunk-JVRTHGFS.js +3 -0
  115. package/dist/chunk-JYWEX7RR.js +360 -0
  116. package/dist/chunk-K3YL22N6.js +2 -0
  117. package/dist/chunk-K4CN7GXK.js +12 -0
  118. package/dist/chunk-K5TBVXU4.js +30 -0
  119. package/dist/chunk-KDDIE2DP.js +9 -0
  120. package/dist/chunk-KHWRRPV4.js +2 -0
  121. package/dist/chunk-KI6NBKDY.js +14 -0
  122. package/dist/chunk-KU3QRSTH.js +2 -0
  123. package/dist/chunk-KZBJWZJB.js +2 -0
  124. package/dist/chunk-L7GFM3NP.js +3 -0
  125. package/dist/chunk-LMO6PK3V.js +35 -0
  126. package/dist/chunk-LN4YXJJU.js +2 -0
  127. package/dist/chunk-LOVIZBJ4.js +43 -0
  128. package/dist/chunk-LPCRK4A2.js +11 -0
  129. package/dist/chunk-MMHZKBFA.js +2 -0
  130. package/dist/{chunk-A4WEAK35.js → chunk-MOQQBQRD.js} +2 -2
  131. package/dist/chunk-N2WN6I3L.js +2 -0
  132. package/dist/chunk-N3ORQT7L.js +2 -0
  133. package/dist/chunk-NAZ3RAIW.js +2 -0
  134. package/dist/chunk-NDUNO5JQ.js +2 -0
  135. package/dist/chunk-NEIWRNAZ.js +4 -0
  136. package/dist/chunk-NJJMVD65.js +2 -0
  137. package/dist/chunk-NLOQOBXI.js +20 -0
  138. package/dist/chunk-NOLZOVCU.js +2 -0
  139. package/dist/chunk-NOWINRRN.js +2 -0
  140. package/dist/chunk-NZAXKGRL.js +16 -0
  141. package/dist/chunk-O2C4UILI.js +2 -0
  142. package/dist/chunk-O3RHA6ZT.js +3 -0
  143. package/dist/chunk-O4UZSPPI.js +3 -0
  144. package/dist/chunk-OGFV2BUX.js +2 -0
  145. package/dist/chunk-OZCJXZK6.js +499 -0
  146. package/dist/chunk-P6ODM7BY.js +2 -0
  147. package/dist/{chunk-GHNPACNP.js → chunk-PAVGPRHJ.js} +2 -2
  148. package/dist/chunk-PH52RA7D.js +2 -0
  149. package/dist/chunk-PKN354TH.js +3 -0
  150. package/dist/chunk-PWOASWEG.js +11 -0
  151. package/dist/chunk-QIWXRW72.js +2 -0
  152. package/dist/chunk-QJRMOK5N.js +2 -0
  153. package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
  154. package/dist/chunk-QXEUDXBT.js +3 -0
  155. package/dist/chunk-QYUVVBMR.js +6 -0
  156. package/dist/chunk-QZ7KQZRN.js +2 -0
  157. package/dist/chunk-R6LQBUDH.js +2 -0
  158. package/dist/chunk-RBS42E55.js +20 -0
  159. package/dist/chunk-RSJKPCFX.js +26 -0
  160. package/dist/chunk-S6CZA3MV.js +2 -0
  161. package/dist/chunk-STMVAHJP.js +2 -0
  162. package/dist/chunk-SYVPTTVW.js +2 -0
  163. package/dist/chunk-T6DK3ZP7.js +2 -0
  164. package/dist/chunk-TKD34PHN.js +4 -0
  165. package/dist/chunk-TNNQFH7W.js +2 -0
  166. package/dist/chunk-TNV7SSUF.js +2 -0
  167. package/dist/chunk-TO7ZR3EH.js +8 -0
  168. package/dist/chunk-TOU3CHK4.js +2 -0
  169. package/dist/chunk-TRBI4UKT.js +2 -0
  170. package/dist/chunk-TZCVNCAN.js +4 -0
  171. package/dist/chunk-U4LZA5LL.js +3 -0
  172. package/dist/chunk-U5RIG3JP.js +3 -0
  173. package/dist/chunk-UP5KXN2I.js +2 -0
  174. package/dist/chunk-UQFR3NDH.js +5 -0
  175. package/dist/chunk-UXYXF7GV.js +2 -0
  176. package/dist/chunk-VB3GOKOS.js +2 -0
  177. package/dist/{chunk-4FR6GQIT.js → chunk-VF5JZICY.js} +2 -2
  178. package/dist/chunk-VTY3VK6E.js +2 -0
  179. package/dist/chunk-VX2O4RIS.js +2 -0
  180. package/dist/chunk-WKPV2TDZ.js +2 -0
  181. package/dist/chunk-WOFQ5DTB.js +2 -0
  182. package/dist/chunk-WS4C6TCK.js +2 -0
  183. package/dist/chunk-WXU3DGPU.js +2 -0
  184. package/dist/{chunk-ATXPTSEI.js → chunk-X6RMKHJQ.js} +7 -7
  185. package/dist/{chunk-44IETFOU.js → chunk-XHMN6ZX7.js} +2 -2
  186. package/dist/chunk-XHTVFLWW.js +2 -0
  187. package/dist/chunk-XKIDJCIK.js +2 -0
  188. package/dist/chunk-XTYTYZPT.js +2 -0
  189. package/dist/chunk-Y2JHHTTA.js +2 -0
  190. package/dist/chunk-YGVRMGYN.js +4 -0
  191. package/dist/chunk-YNQCGEQE.js +2 -0
  192. package/dist/chunk-YOQVEXVE.js +14 -0
  193. package/dist/chunk-YRT2WLYY.js +2 -0
  194. package/dist/chunk-YTAP5Y2G.js +2 -0
  195. package/dist/chunk-YTYWI7VB.js +2 -0
  196. package/dist/chunk-YULZRALL.js +2 -0
  197. package/dist/chunk-Z33WQG4Q.js +2 -0
  198. package/dist/chunk-ZGTYGDMF.js +16 -0
  199. package/dist/chunk-ZHMRSZFD.js +43 -0
  200. package/dist/chunk-ZHSP366W.js +10 -0
  201. package/dist/chunk-ZIBYCYKK.js +7 -0
  202. package/dist/chunk-ZLADLUE6.js +3 -0
  203. package/dist/chunk-ZO4YXUT6.js +4 -0
  204. package/dist/{chunk-MZPXPSUJ.js → chunk-ZR4HBC2H.js} +2 -2
  205. package/dist/cli-main.js +6 -6
  206. package/dist/cli.js +1 -1
  207. package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
  208. package/dist/code-IL5WH3NZ.js +2 -0
  209. package/dist/code-result-json-ANTBEDFP.js +4 -0
  210. package/dist/command-descriptors-HEEMDHTU.js +222 -0
  211. package/dist/deps-EOWFC6FD.js +2 -0
  212. package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
  213. package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
  214. package/dist/files-K4AI3JUM.js +2 -0
  215. package/dist/{health-BI2a9WPy.d.ts → health-BtfmNrfa.d.ts} +5 -79
  216. package/dist/hierarchy-6W5NDIFI.js +2 -0
  217. package/dist/imports-WH365QY4.js +2 -0
  218. package/dist/index.d.ts +13 -1
  219. package/dist/index.js +1 -1
  220. package/dist/members-K3PHMF5S.js +2 -0
  221. package/dist/methods-E7KVMBX4.js +2 -0
  222. package/dist/output-continuation-command-BJSY67SN.js +3 -0
  223. package/dist/output-pagination-UZJ5ACIX.js +24 -0
  224. package/dist/postinstall.js +1 -1
  225. package/dist/project-reindex-EP24WT4X.js +3 -0
  226. package/dist/queries/affected.js +1 -1
  227. package/dist/queries/architecture.d.ts +15 -4
  228. package/dist/queries/architecture.js +1 -1
  229. package/dist/queries/bottlenecks.js +1 -1
  230. package/dist/queries/by-kind.js +1 -1
  231. package/dist/queries/call-graph.d.ts +1 -1
  232. package/dist/queries/call-graph.js +1 -1
  233. package/dist/queries/change-surface.d.ts +1 -0
  234. package/dist/queries/change-surface.js +1 -1
  235. package/dist/queries/cleanup-plan.d.ts +3 -3
  236. package/dist/queries/cleanup-plan.js +1 -1
  237. package/dist/queries/co-change.js +1 -1
  238. package/dist/queries/code.d.ts +1 -1
  239. package/dist/queries/code.js +1 -1
  240. package/dist/queries/complexity.d.ts +6 -3
  241. package/dist/queries/complexity.js +1 -1
  242. package/dist/queries/context.d.ts +1 -7
  243. package/dist/queries/context.js +1 -1
  244. package/dist/queries/coupling.js +1 -1
  245. package/dist/queries/cycles.js +1 -1
  246. package/dist/queries/dead.js +1 -1
  247. package/dist/queries/decorative-checkers.js +1 -1
  248. package/dist/queries/dependence-slice.d.ts +46 -22
  249. package/dist/queries/dependence-slice.js +1 -1
  250. package/dist/queries/dependency-depth.d.ts +1 -7
  251. package/dist/queries/dependency-depth.js +1 -1
  252. package/dist/queries/deps.js +1 -1
  253. package/dist/queries/diff-impact.d.ts +3 -1
  254. package/dist/queries/diff-impact.js +1 -1
  255. package/dist/queries/doc-drift.js +1 -1
  256. package/dist/queries/drift.d.ts +1 -1
  257. package/dist/queries/drift.js +1 -1
  258. package/dist/queries/duplicate-bodies.d.ts +1 -1
  259. package/dist/queries/duplicate-bodies.js +1 -1
  260. package/dist/queries/entry-map.d.ts +2 -4
  261. package/dist/queries/entry-map.js +1 -1
  262. package/dist/queries/evidence.d.ts +121 -61
  263. package/dist/queries/evidence.js +1 -1
  264. package/dist/queries/fan.js +1 -1
  265. package/dist/queries/files.js +1 -1
  266. package/dist/queries/health.d.ts +1 -1
  267. package/dist/queries/health.js +1 -1
  268. package/dist/queries/hierarchy.d.ts +2 -2
  269. package/dist/queries/hierarchy.js +1 -1
  270. package/dist/queries/hotspots.d.ts +1 -1
  271. package/dist/queries/hotspots.js +1 -1
  272. package/dist/queries/imports.d.ts +1 -0
  273. package/dist/queries/imports.js +1 -1
  274. package/dist/queries/incomplete-migration.d.ts +3 -3
  275. package/dist/queries/incomplete-migration.js +1 -1
  276. package/dist/queries/index.d.ts +15 -64
  277. package/dist/queries/index.js +1 -1
  278. package/dist/queries/locality-candidates.d.ts +4 -4
  279. package/dist/queries/locality-candidates.js +1 -1
  280. package/dist/queries/members.d.ts +2 -2
  281. package/dist/queries/members.js +1 -1
  282. package/dist/queries/methods.js +1 -1
  283. package/dist/queries/not-implemented.d.ts +2 -6
  284. package/dist/queries/not-implemented.js +1 -1
  285. package/dist/queries/outline.js +1 -1
  286. package/dist/queries/passthrough-candidates.js +1 -1
  287. package/dist/queries/react-component-duplicates.js +1 -1
  288. package/dist/queries/react-hook-candidates.js +1 -1
  289. package/dist/queries/react-large-component-pressure.js +1 -1
  290. package/dist/queries/recent-duplicates.js +1 -1
  291. package/dist/queries/redundant-reexports.d.ts +4 -14
  292. package/dist/queries/redundant-reexports.js +1 -1
  293. package/dist/queries/refs.d.ts +4 -1
  294. package/dist/queries/refs.js +1 -1
  295. package/dist/queries/review.d.ts +188 -0
  296. package/dist/queries/review.js +2 -0
  297. package/dist/queries/similar-files.d.ts +7 -10
  298. package/dist/queries/similar-files.js +1 -1
  299. package/dist/queries/similar-signatures.js +1 -1
  300. package/dist/queries/similar.d.ts +19 -1
  301. package/dist/queries/similar.js +1 -1
  302. package/dist/queries/slice-cohesion.d.ts +205 -0
  303. package/dist/queries/slice-cohesion.js +2 -0
  304. package/dist/queries/source-inspection.d.ts +6 -202
  305. package/dist/queries/source-inspection.js +1 -1
  306. package/dist/queries/source-search.d.ts +2 -3
  307. package/dist/queries/source-search.js +1 -1
  308. package/dist/queries/stats.d.ts +1 -0
  309. package/dist/queries/stats.js +1 -1
  310. package/dist/queries/surface.js +1 -1
  311. package/dist/queries/symbols.js +1 -1
  312. package/dist/queries/system.d.ts +4 -2
  313. package/dist/queries/system.js +1 -1
  314. package/dist/queries/test-quality.d.ts +1 -1
  315. package/dist/queries/test-quality.js +1 -1
  316. package/dist/queries/twin-drift.d.ts +1 -1
  317. package/dist/queries/twin-drift.js +1 -1
  318. package/dist/queries/unused-imports.js +1 -1
  319. package/dist/queries/unused-params.d.ts +3 -15
  320. package/dist/queries/unused-params.js +1 -1
  321. package/dist/queries/vue-component-duplicates.js +1 -1
  322. package/dist/queries/vue-composable-candidates.js +1 -1
  323. package/dist/queries/vue-large-view-pressure.js +1 -1
  324. package/dist/query-service-fastpath.js +5 -5
  325. package/dist/query-service-server.js +4 -4
  326. package/dist/refs-CCBJG7WK.js +2 -0
  327. package/dist/refs-pagination-DRNLVU4S.js +2 -0
  328. package/dist/reindex-worker.js +79 -29
  329. package/dist/reindex.js +45 -45
  330. package/dist/repository-cache-worker.js +2 -0
  331. package/dist/runtime.d.ts +8 -8
  332. package/dist/runtime.js +3 -4
  333. package/dist/rust-semantic-session-server.js +1 -1
  334. package/dist/rust-semantic-session-worker.js +1 -1
  335. package/dist/rust-semantic-worker.js +1 -1
  336. package/dist/service-queries-2WAJI7R6.js +6 -0
  337. package/dist/source-inspection-91U9zdO3.d.ts +341 -0
  338. package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
  339. package/dist/stats-G7DIV6VU.js +2 -0
  340. package/dist/surface-IO55UALI.js +2 -0
  341. package/dist/system-ZBMSHJXU.js +2 -0
  342. package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
  343. package/dist/typescript-indexer.js +2 -0
  344. package/dist/typescript-mailbox-worker.js +1 -1
  345. package/dist/watch-server.js +3 -3
  346. package/docs/AGENT_GUIDE.md +19 -128
  347. package/docs/CLI_JSON_OUTPUT.md +21 -17
  348. package/docs/COMMAND_REFERENCE.md +34 -49
  349. package/docs/CURRENT_COMMANDS.md +123 -0
  350. package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
  351. package/docs/DETECTOR_GUIDE.md +27 -23
  352. package/docs/PRODUCT_VISION.md +135 -0
  353. package/docs/PROPERTY_TESTING.md +73 -0
  354. package/docs/REVIEW.md +76 -0
  355. package/docs/SKILLS.md +51 -0
  356. package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
  357. package/docs/accuracy-audit-checklist.md +34 -0
  358. package/docs/analyzer-inventory.md +2 -2
  359. package/package.json +18 -80
  360. package/scripts/evidence-product-contract.mjs +7 -3
  361. package/scripts/record-review-coverage.mjs +118 -0
  362. package/scripts/scip-windows-provenance.mjs +29 -19
  363. package/skills/scip-architecture-review/SKILL.md +57 -0
  364. package/skills/scip-architecture-review/agents/openai.yaml +4 -0
  365. package/skills/scip-architecture-review/references/design-checks.md +17 -0
  366. package/skills/scip-explore/SKILL.md +15 -59
  367. package/skills/scip-explore/agents/openai.yaml +3 -3
  368. package/skills/scip-explore/references/external-evidence.md +2 -2
  369. package/skills/scip-explore/references/information-model.md +26 -29
  370. package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
  371. package/skills/scip-integrity-audit/SKILL.md +53 -181
  372. package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
  373. package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
  374. package/skills/scip-plan/SKILL.md +39 -65
  375. package/skills/scip-plan/agents/openai.yaml +2 -2
  376. package/skills/scip-query/SKILL.md +28 -81
  377. package/skills/scip-query/agents/openai.yaml +2 -2
  378. package/skills/scip-query/references/command-guide.md +169 -0
  379. package/skills/scip-setup/SKILL.md +4 -2
  380. package/skills/scip-setup/agents/openai.yaml +3 -3
  381. package/dist/by-kind-H3P6BR5G.js +0 -2
  382. package/dist/call-graph-VTG2CUOQ.js +0 -2
  383. package/dist/chunk-26CT72HM.js +0 -2
  384. package/dist/chunk-2BMSSRBH.js +0 -2
  385. package/dist/chunk-2M2LSIMY.js +0 -7
  386. package/dist/chunk-2N6WBNDC.js +0 -29
  387. package/dist/chunk-2OOY75BW.js +0 -2
  388. package/dist/chunk-2USA3S3P.js +0 -3
  389. package/dist/chunk-2VAHDDLM.js +0 -133
  390. package/dist/chunk-2XWIUW5Z.js +0 -455
  391. package/dist/chunk-35NLDRZC.js +0 -2
  392. package/dist/chunk-3AF4TUFK.js +0 -3
  393. package/dist/chunk-3D4BOXW6.js +0 -20
  394. package/dist/chunk-3LO4FST5.js +0 -16
  395. package/dist/chunk-3WTY4LP2.js +0 -3
  396. package/dist/chunk-3Z5AMSK6.js +0 -29
  397. package/dist/chunk-4KBTHJLP.js +0 -2
  398. package/dist/chunk-5BIKR67W.js +0 -2
  399. package/dist/chunk-5PROPLHI.js +0 -2
  400. package/dist/chunk-5V7EPTII.js +0 -2
  401. package/dist/chunk-62LPZCBQ.js +0 -3
  402. package/dist/chunk-64O2JHQA.js +0 -2
  403. package/dist/chunk-6D4F5VWG.js +0 -10
  404. package/dist/chunk-6ERFBC3X.js +0 -3
  405. package/dist/chunk-6MFXCMZC.js +0 -2
  406. package/dist/chunk-6O7FACKB.js +0 -2
  407. package/dist/chunk-6TS3KOXR.js +0 -2
  408. package/dist/chunk-76QOU4PK.js +0 -3
  409. package/dist/chunk-7DUI77BN.js +0 -2
  410. package/dist/chunk-7F45LJKI.js +0 -2
  411. package/dist/chunk-7F7T6DCR.js +0 -2
  412. package/dist/chunk-7H6VHWWJ.js +0 -2
  413. package/dist/chunk-7HXT6YLU.js +0 -5
  414. package/dist/chunk-7KCZELVM.js +0 -2
  415. package/dist/chunk-7R4V5ES6.js +0 -6
  416. package/dist/chunk-7RIRIADH.js +0 -7
  417. package/dist/chunk-7ZLWLOGT.js +0 -2
  418. package/dist/chunk-AADQLOQ4.js +0 -38
  419. package/dist/chunk-AN76MGUE.js +0 -2
  420. package/dist/chunk-ANLNLY66.js +0 -2
  421. package/dist/chunk-AX7IDVFT.js +0 -2
  422. package/dist/chunk-B3X6KU75.js +0 -2
  423. package/dist/chunk-B7MPDEAK.js +0 -3
  424. package/dist/chunk-BBB5FBX4.js +0 -2
  425. package/dist/chunk-BJT7LSPK.js +0 -3
  426. package/dist/chunk-BJWFVAA5.js +0 -2
  427. package/dist/chunk-BKVWUP7Y.js +0 -2
  428. package/dist/chunk-BKZYTLGE.js +0 -35
  429. package/dist/chunk-BL6DCHQP.js +0 -2
  430. package/dist/chunk-BOW7SSQH.js +0 -43
  431. package/dist/chunk-C4RHHCKL.js +0 -7
  432. package/dist/chunk-C7C6AKAT.js +0 -117
  433. package/dist/chunk-CD6M6LS2.js +0 -16
  434. package/dist/chunk-CFE6PSG6.js +0 -2
  435. package/dist/chunk-CFNIGQMT.js +0 -2
  436. package/dist/chunk-CKBUBRYD.js +0 -2
  437. package/dist/chunk-CZW5MZ5B.js +0 -2
  438. package/dist/chunk-DBBZ63ZX.js +0 -2
  439. package/dist/chunk-DBN7DMJB.js +0 -18
  440. package/dist/chunk-DUULLZHZ.js +0 -3
  441. package/dist/chunk-DV5Y5NOS.js +0 -2
  442. package/dist/chunk-DZOIKCTM.js +0 -3
  443. package/dist/chunk-E4PKTOL3.js +0 -2
  444. package/dist/chunk-E7QR35ST.js +0 -2
  445. package/dist/chunk-EFSXAINW.js +0 -2
  446. package/dist/chunk-EHVEIEQN.js +0 -18
  447. package/dist/chunk-EHYDXE3Z.js +0 -2
  448. package/dist/chunk-EP63Y6LD.js +0 -2
  449. package/dist/chunk-EPX6NQN6.js +0 -4
  450. package/dist/chunk-ETC674NS.js +0 -5
  451. package/dist/chunk-F5GSBHC6.js +0 -3
  452. package/dist/chunk-FH3DGXC6.js +0 -2
  453. package/dist/chunk-FI7VGOR4.js +0 -16
  454. package/dist/chunk-FJF6VO2P.js +0 -2
  455. package/dist/chunk-FLMTCX5R.js +0 -2
  456. package/dist/chunk-FVFDOIM3.js +0 -2
  457. package/dist/chunk-G2HU5WRN.js +0 -2
  458. package/dist/chunk-G4ALYS4J.js +0 -2
  459. package/dist/chunk-G56I7K4W.js +0 -26
  460. package/dist/chunk-GC4DG2V5.js +0 -2
  461. package/dist/chunk-GG45PK4S.js +0 -4
  462. package/dist/chunk-GINH3YQU.js +0 -20
  463. package/dist/chunk-GTZZVLKJ.js +0 -2
  464. package/dist/chunk-GXXW5ZHH.js +0 -2
  465. package/dist/chunk-H5EXS3HM.js +0 -2
  466. package/dist/chunk-HAXXKRTD.js +0 -4
  467. package/dist/chunk-HEZWBAZY.js +0 -2
  468. package/dist/chunk-HMEWLMML.js +0 -2
  469. package/dist/chunk-HOBOVYPO.js +0 -11
  470. package/dist/chunk-HRFQ6GW5.js +0 -8
  471. package/dist/chunk-HX4X7KG3.js +0 -2
  472. package/dist/chunk-HYT2R7LX.js +0 -4
  473. package/dist/chunk-IKQVBVQL.js +0 -40
  474. package/dist/chunk-IW5XQG5G.js +0 -2
  475. package/dist/chunk-J6GLBBRK.js +0 -4
  476. package/dist/chunk-J7A4PWFX.js +0 -3
  477. package/dist/chunk-JCSAZ35V.js +0 -2
  478. package/dist/chunk-JDU2IV3A.js +0 -2
  479. package/dist/chunk-JFMEXGFE.js +0 -2
  480. package/dist/chunk-JFMI5SGB.js +0 -4
  481. package/dist/chunk-JJP37RGX.js +0 -57
  482. package/dist/chunk-JZ2A7LDM.js +0 -5
  483. package/dist/chunk-KMVGRIO2.js +0 -2
  484. package/dist/chunk-KNLQGXVH.js +0 -80
  485. package/dist/chunk-KVQCECPR.js +0 -2
  486. package/dist/chunk-KXXORBZ2.js +0 -4
  487. package/dist/chunk-L5KYH6U3.js +0 -35
  488. package/dist/chunk-L6XHYJPZ.js +0 -21
  489. package/dist/chunk-L7KTFEAV.js +0 -43
  490. package/dist/chunk-LDXHR5EL.js +0 -23
  491. package/dist/chunk-LEECKFCJ.js +0 -2
  492. package/dist/chunk-MHGDSBFX.js +0 -2
  493. package/dist/chunk-MLQVVDG3.js +0 -74
  494. package/dist/chunk-MOKUWRHO.js +0 -3
  495. package/dist/chunk-MPYAPMNE.js +0 -2
  496. package/dist/chunk-MTDBHTSF.js +0 -2
  497. package/dist/chunk-MV6SPXCR.js +0 -7
  498. package/dist/chunk-MWN53KRN.js +0 -60
  499. package/dist/chunk-MXNGIEPU.js +0 -3
  500. package/dist/chunk-N55KIE46.js +0 -2
  501. package/dist/chunk-NB4D3BNM.js +0 -2
  502. package/dist/chunk-NGKBOT6G.js +0 -23
  503. package/dist/chunk-NJGKXKQF.js +0 -2
  504. package/dist/chunk-NJQISBL4.js +0 -8
  505. package/dist/chunk-NJT3ZEKY.js +0 -16
  506. package/dist/chunk-NKMKZP6A.js +0 -2
  507. package/dist/chunk-NODFZ6ED.js +0 -2
  508. package/dist/chunk-NSM5IEVW.js +0 -2
  509. package/dist/chunk-NTGUVNR2.js +0 -3
  510. package/dist/chunk-NU3KFF2O.js +0 -57
  511. package/dist/chunk-NWLVNU66.js +0 -557
  512. package/dist/chunk-NYKZMCRC.js +0 -4
  513. package/dist/chunk-O6BUXZEH.js +0 -6
  514. package/dist/chunk-ODPDP7A4.js +0 -3
  515. package/dist/chunk-OIAPEKMT.js +0 -3
  516. package/dist/chunk-OIOC5EHF.js +0 -3
  517. package/dist/chunk-ONPPQM4G.js +0 -2
  518. package/dist/chunk-OUHEZBYI.js +0 -2
  519. package/dist/chunk-OVGYW7UD.js +0 -29
  520. package/dist/chunk-OYKU4B3Y.js +0 -2
  521. package/dist/chunk-POBJ6FR2.js +0 -5
  522. package/dist/chunk-PSZPMMWN.js +0 -2
  523. package/dist/chunk-PXTRBKRK.js +0 -3
  524. package/dist/chunk-Q5JRIHT3.js +0 -4
  525. package/dist/chunk-Q7ATHARX.js +0 -2
  526. package/dist/chunk-Q7CSKIDM.js +0 -5
  527. package/dist/chunk-QBQE7ZJ5.js +0 -3
  528. package/dist/chunk-QH22UIXP.js +0 -5
  529. package/dist/chunk-QXCKQTKR.js +0 -60
  530. package/dist/chunk-RBAD4GJ2.js +0 -13
  531. package/dist/chunk-RMDPFPNW.js +0 -2
  532. package/dist/chunk-ROPJDEJZ.js +0 -4
  533. package/dist/chunk-RVZC6TJE.js +0 -2
  534. package/dist/chunk-S4QZBKSR.js +0 -3
  535. package/dist/chunk-SCPMZ73U.js +0 -2
  536. package/dist/chunk-SIAP5RGI.js +0 -73
  537. package/dist/chunk-SIX4RFR3.js +0 -3
  538. package/dist/chunk-SKKXTABJ.js +0 -16
  539. package/dist/chunk-SSRFUQBD.js +0 -2
  540. package/dist/chunk-SYVJEEUJ.js +0 -3
  541. package/dist/chunk-T3CZAZSI.js +0 -8
  542. package/dist/chunk-T6DWDI5E.js +0 -3
  543. package/dist/chunk-T6HRIROJ.js +0 -7
  544. package/dist/chunk-TAA7HXHE.js +0 -2
  545. package/dist/chunk-TJ2JQYT3.js +0 -2
  546. package/dist/chunk-TULNMD5T.js +0 -368
  547. package/dist/chunk-U2FPY5XA.js +0 -3
  548. package/dist/chunk-U3SXIMII.js +0 -38
  549. package/dist/chunk-U6KCHXJ4.js +0 -2
  550. package/dist/chunk-UH3XSKS5.js +0 -9
  551. package/dist/chunk-UIFUZVCC.js +0 -2
  552. package/dist/chunk-UXKURIVI.js +0 -2
  553. package/dist/chunk-V2RBODHL.js +0 -2
  554. package/dist/chunk-VBKUWB6N.js +0 -2
  555. package/dist/chunk-VBV6ALJE.js +0 -2
  556. package/dist/chunk-VDGFWCQV.js +0 -2
  557. package/dist/chunk-VDSDOEWF.js +0 -2
  558. package/dist/chunk-VZPWVCLN.js +0 -20
  559. package/dist/chunk-WDSFQDPN.js +0 -2
  560. package/dist/chunk-WFA35BGR.js +0 -7
  561. package/dist/chunk-WLMP3OCW.js +0 -2
  562. package/dist/chunk-WSA52GOR.js +0 -2
  563. package/dist/chunk-WYPL7GF7.js +0 -2
  564. package/dist/chunk-X3YVZAKZ.js +0 -5
  565. package/dist/chunk-X6OGVFIT.js +0 -2
  566. package/dist/chunk-XDAUYDFT.js +0 -2
  567. package/dist/chunk-XKXTR6ZI.js +0 -9
  568. package/dist/chunk-Y5DFAW5W.js +0 -4
  569. package/dist/chunk-YSYPDRD5.js +0 -3
  570. package/dist/chunk-ZFVPWH62.js +0 -5
  571. package/dist/chunk-ZGIHTH27.js +0 -2
  572. package/dist/chunk-ZGIQN2SX.js +0 -2
  573. package/dist/chunk-ZHG4WAHR.js +0 -12
  574. package/dist/chunk-ZKB2XUEN.js +0 -4
  575. package/dist/chunk-ZLMXIQLC.js +0 -21
  576. package/dist/chunk-ZMCQIHI4.js +0 -2
  577. package/dist/code-TAVIKWJI.js +0 -2
  578. package/dist/code-result-json-5FEFQCAQ.js +0 -2
  579. package/dist/command-descriptors-7BKH53Y3.js +0 -343
  580. package/dist/dataflow-GFBTVDH3.js +0 -2
  581. package/dist/dependence-slice-GWGQCODG.js +0 -2
  582. package/dist/deps-4QHVDPYA.js +0 -2
  583. package/dist/direct-navigation-4UBC6HNW.js +0 -3
  584. package/dist/entry-map-QCTF4RVY.js +0 -2
  585. package/dist/files-M2UBF5HJ.js +0 -2
  586. package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
  587. package/dist/hierarchy-2UIHRLW4.js +0 -2
  588. package/dist/imports-WIE3YZOB.js +0 -2
  589. package/dist/members-YKD636DA.js +0 -2
  590. package/dist/methods-VDF4IMYG.js +0 -2
  591. package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
  592. package/dist/output-continuation-command-4UMDOOLO.js +0 -3
  593. package/dist/output-pagination-2GME6OPY.js +0 -19
  594. package/dist/project-reindex-XEQTRCV5.js +0 -3
  595. package/dist/queries/anchors.d.ts +0 -123
  596. package/dist/queries/anchors.js +0 -2
  597. package/dist/queries/complexity-hotspots.d.ts +0 -40
  598. package/dist/queries/complexity-hotspots.js +0 -2
  599. package/dist/queries/convergence.d.ts +0 -33
  600. package/dist/queries/convergence.js +0 -2
  601. package/dist/queries/dataflow.d.ts +0 -77
  602. package/dist/queries/dataflow.js +0 -2
  603. package/dist/queries/deep-chains.d.ts +0 -5
  604. package/dist/queries/deep-chains.js +0 -2
  605. package/dist/queries/extract-candidates.d.ts +0 -79
  606. package/dist/queries/extract-candidates.js +0 -2
  607. package/dist/queries/isolated.d.ts +0 -24
  608. package/dist/queries/isolated.js +0 -2
  609. package/dist/queries/plan-context.d.ts +0 -33
  610. package/dist/queries/plan-context.js +0 -2
  611. package/dist/queries/reference-neighborhood.d.ts +0 -4
  612. package/dist/queries/reference-neighborhood.js +0 -2
  613. package/dist/queries/reference-reachability.d.ts +0 -48
  614. package/dist/queries/reference-reachability.js +0 -2
  615. package/dist/queries/self-audit.d.ts +0 -69
  616. package/dist/queries/self-audit.js +0 -2
  617. package/dist/queries/similar-chains.d.ts +0 -48
  618. package/dist/queries/similar-chains.js +0 -2
  619. package/dist/queries/slice.d.ts +0 -4
  620. package/dist/queries/slice.js +0 -2
  621. package/dist/queries/stale-abstractions.d.ts +0 -72
  622. package/dist/queries/stale-abstractions.js +0 -2
  623. package/dist/queries/system-map.d.ts +0 -449
  624. package/dist/queries/system-map.js +0 -2
  625. package/dist/queries/trace.js +0 -2
  626. package/dist/queries/twin-ab.d.ts +0 -66
  627. package/dist/queries/twin-ab.js +0 -2
  628. package/dist/queries/value-flow.d.ts +0 -43
  629. package/dist/queries/value-flow.js +0 -2
  630. package/dist/queries/wrapper-candidates.d.ts +0 -49
  631. package/dist/queries/wrapper-candidates.js +0 -2
  632. package/dist/refs-JNK5CLM7.js +0 -2
  633. package/dist/refs-pagination-6BLRYGMV.js +0 -2
  634. package/dist/slice-PHPVNCWX.js +0 -2
  635. package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
  636. package/dist/stats-OOJ74B32.js +0 -2
  637. package/dist/surface-MQX5MPIV.js +0 -2
  638. package/dist/symbol-resolution-DBLVXLBC.js +0 -2
  639. package/dist/system-JOPKV4OG.js +0 -2
  640. package/dist/trace-I2P2YFH4.js +0 -2
  641. package/dist/value-flow-JJVMF7NP.js +0 -2
  642. package/skills/concrete-plan/SKILL.md +0 -8
  643. package/skills/concrete-plan/agents/openai.yaml +0 -4
  644. package/skills/conductor/SKILL.md +0 -110
  645. package/skills/conductor/agents/openai.yaml +0 -4
  646. package/skills/principal-maintainability-review/SKILL.md +0 -273
  647. package/skills/principal-maintainability-review/agents/openai.yaml +0 -4
  648. package/skills/scip-calibrate/SKILL.md +0 -102
  649. package/skills/scip-calibrate/agents/openai.yaml +0 -4
  650. package/skills/scip-claim-audit/SKILL.md +0 -113
  651. package/skills/scip-claim-audit/agents/openai.yaml +0 -4
  652. package/skills/scip-probe-reachability/SKILL.md +0 -93
  653. package/skills/scip-probe-reachability/agents/openai.yaml +0 -4
  654. package/skills/scip-root-cause/SKILL.md +0 -160
  655. package/skills/scip-root-cause/agents/openai.yaml +0 -4
  656. package/skills/scip-system-compression/SKILL.md +0 -252
  657. package/skills/scip-system-compression/agents/openai.yaml +0 -4
  658. package/skills/scip-system-compression/references/compression-atlas.md +0 -116
  659. package/skills/scip-system-compression/references/compression-patterns.md +0 -87
  660. package/skills/scip-twin-drift/SKILL.md +0 -109
  661. package/skills/scip-twin-drift/agents/openai.yaml +0 -4
@@ -0,0 +1,3 @@
1
+ import{a as Ce,b as te,d as we}from"./chunk-TZCVNCAN.js";import{a as Ee}from"./chunk-7VPEEAAG.js";import{a as xe}from"./chunk-PAVGPRHJ.js";import{a as he,c as U}from"./chunk-H73WY2RM.js";import{d as me,y as ye}from"./chunk-ZHMRSZFD.js";import{a as be,d as Se}from"./chunk-KU3QRSTH.js";import{b as pe,c as fe}from"./chunk-CN5EH7O3.js";import{k as de}from"./chunk-J5FJMODQ.js";import{c as ue}from"./chunk-GZKFETP5.js";import{a as ce}from"./chunk-HRRFKWPZ.js";import{c as ge}from"./chunk-YULZRALL.js";import{M as ee}from"./chunk-U5RIG3JP.js";function si(e,t={}){let i=new we(e).productionCallableDefinitions({scope:t.scope,requireCallableSymbol:!0,includeSuppressed:!0}),r=et(e,i),o=t.search?.trim().toLocaleLowerCase();return i.map(s=>tt(e,s,r.get(s.symbolId)??[])).filter(s=>s!==null).map(s=>s.result).filter(s=>!o||it(s).includes(o)).sort(rt)}function et(e,t){let n=t.filter(i=>Fe(e,i.relativePath)||te(e,i.symbol,i.relativePath).length>0);return ye(e,n,{semantic:!1,semanticEvidence:Ee})}function tt(e,t,n){let i=nt(e,t),r=i.length>0,o=Fe(e,t.relativePath)&&n.length===0;if(!r&&!o)return null;let s=[...i];return o&&s.push("entry-surface-without-indexed-caller"),{definition:t,result:{symbol:t.symbol,shortName:ge(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,documentation:t.documentation,confidence:i.some(a=>a!=="package-public-export")?"root":"candidate",evidence:s,observedCallerCount:n.length}}}function Fe(e,t){return Ce(e,t)||/(?:^|\/)entry\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function nt(e,t){let n=te(e,t.symbol,t.relativePath),i=[];return Te(n,["package-surface-file","transitive-package-surface"])&&xe(e,t)&&i.push("package-public-export"),n.includes("rust-public-library")&&i.push("rust-public-library"),n.includes("framework-entrypoint")&&i.push("framework-dispatched-export"),Te(n,["configured-file","configured-path-prefix","configured-qualified-var","configured-symbol-pattern"])&&i.push("configured-entry-root"),i}function Te(e,t){return t.some(n=>e.includes(n))}function it(e){return[e.symbol,e.shortName,e.file,e.documentation??"",...e.evidence].join(`
2
+ `).toLocaleLowerCase()}function rt(e,t){return Ae(e.confidence)-Ae(t.confidence)||e.file.localeCompare(t.file)||e.startLine-t.startLine||e.symbol.localeCompare(t.symbol)}function Ae(e){return e==="root"?0:1}import{join as Cn}from"path";import{createRequire as ot}from"module";import{resolve as q}from"path";var st=ot(import.meta.url),O,ve=new Map;function Pe(e,t,n){let i=at();if(!i)return V("The TypeScript compiler runtime is unavailable.");let r=ct(i,Ne(i,e,t)),o=r.getSourceFile(q(t))??r.getSourceFile(t);if(!o)return V(`The TypeScript compiler did not materialize ${t}.`);let s=r.getSyntacticDiagnostics(o);if(s.length)return V(s.map(u=>{let p=o.getLineAndCharacterOfPosition(u.start??0);return`TypeScript syntax error at ${t}:${p.line+1}: ${i.flattenDiagnosticMessageText(u.messageText," ")}`}).join("; "));let a={ts:i,sourceFile:o,checker:r.getTypeChecker(),points:new Map,edges:new Map,unsupported:new Set,nextCfgId:0},l=pt(i,o,n);if(l.length===0)return V("No function-like construct intersects the selected source range.");let c=new Map(l.map(u=>[u,mt(o,u)])),d=l.map(u=>yt(a,u,gt(i,u,c),c.get(u)));for(let u of d)Mt(a,u),en(a,u),sn(a,u);un(a,d);let f=[...a.unsupported].sort();return{points:[...a.points.values()].map(({node:u,...p})=>p).sort(gn),edges:[...a.edges.values()].sort((u,p)=>u.id.localeCompare(p.id)),coverage:{status:f.length===0?"complete":"partial",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:f}}}function at(){if(O!==void 0)return O;try{O=st("typescript")}catch{O=fe()?.ts??null}return O}var ne=null,G=null,ie=null;function Ie(e){return ne||(ne={target:e.ScriptTarget.ESNext,module:e.ModuleKind.ESNext,moduleResolution:e.ModuleResolutionKind.Bundler,skipLibCheck:!0,noResolve:!0,libReplacement:!1}),ne}var I=new Map,lt=8;function Ne(e,t,n){let i=q(n),r=I.get(i);if(r&&r.text===t)return I.delete(i),I.set(i,r),r.sourceFile;let o=e.createSourceFile(i,t,Ie(e).target,!0,dt(e,i));for(I.set(i,{text:t,sourceFile:o});I.size>lt;){let s=I.keys().next().value;if(s===void 0)break;I.delete(s)}return o}function ct(e,t){let n=t.fileName,i=t.text,r=Ie(e),o=e.createCompilerHost(r,!0),s=o.getSourceFile.bind(o),a=o.readFile.bind(o),l=o.fileExists.bind(o);if(!G||!ie){let u=o.getCurrentDirectory(),p=o.getCanonicalFileName.bind(o);G=e.createModuleResolutionCache(u,p,r),ie=e.createTypeReferenceDirectiveResolutionCache(u,p,r,G.getPackageJsonInfoCache())}let c=G,d=ie;r.types===void 0&&(r.types=e.getAutomaticTypeDirectiveNames(r,o)),o.getModuleResolutionCache=()=>c;let f=new Set(r.types??[]);return o.resolveModuleNameLiterals=(u,p,y,S,b)=>u.map(g=>f.has(ut(g.text))?e.resolveModuleName(g.text,p,S,o,c,y,e.getModeForUsageLocation(b,g,S)):{resolvedModule:void 0}),o.resolveTypeReferenceDirectiveReferences=(u,p,y,S)=>u.map(b=>e.resolveTypeReferenceDirective(typeof b=="string"?b:b.fileName,p,S,o,y,d)),o.getSourceFile=(u,p,y,S)=>{if(q(u)===n)return t;let b=ve.get(u);if(b)return b;let g=s(u,p,y,S);return g&&ve.set(u,g),g},o.readFile=u=>q(u)===n?i:a(u),o.fileExists=u=>q(u)===n||l(u),e.createProgram([n],r,o)}function ut(e){if(e.startsWith(".")||e.startsWith("/"))return"";let t=e.split("/");return e.startsWith("@")?t.length>=2?`${t[0].slice(1)}__${t[1]}`:"":t[0]??""}function dt(e,t){return/\.tsx$/iu.test(t)?e.ScriptKind.TSX:/\.[cm]?js$/iu.test(t)?e.ScriptKind.JS:/\.jsx$/iu.test(t)?e.ScriptKind.JSX:e.ScriptKind.TS}function pt(e,t,n){let i=[],r=(o,s=!1)=>{if(ke(e,o)){let a=t.getLineAndCharacterOfPosition(o.getStart(t)).line,l=t.getLineAndCharacterOfPosition(o.getEnd()).line;s||=!n||ft(t,o,a,l,n),s&&i.push(o)}o.forEachChild(a=>r(a,s))};return t.forEachChild(r),i.sort((o,s)=>o.getStart(t)-s.getStart(t))}function ft(e,t,n,i,r){if(r.startColumn===void 0||r.endColumn===void 0)return n<=r.endLine&&i>=r.startLine;let o=e.getPositionOfLineAndCharacter(r.startLine,r.startColumn),s=e.getPositionOfLineAndCharacter(r.endLine,r.endColumn);return(t.name??t).getStart(e)>=o&&t.end<=s}function ke(e,t){return e.isFunctionLike(t)&&"body"in t&&t.body!==void 0}function mt(e,t){return`callable:${encodeURIComponent(e.fileName)}:${t.getStart(e)}:${t.getEnd()}`}function gt(e,t,n){for(let i=t.parent;i;i=i.parent)if(ke(e,i)&&n.has(i))return n.get(i);return null}function yt(e,t,n,i){let r=new Map,o=E(e,r,"exit",null),s=t.body,a=o.id;if(s&&e.ts.isBlock(s))a=B(e,r,[...s.statements],o.id,{breakTarget:null,continueTarget:null,throwTarget:null,exitId:o.id});else if(s){let c=E(e,r,"statement",s);h(r,c.id,o.id),a=c.id}let l=E(e,r,"entry",t);return h(r,l.id,a),{id:i,node:t,parentId:n,cfg:r,entryId:l.id,exitId:o.id}}function B(e,t,n,i,r){let o=i;for(let s=n.length-1;s>=0;s-=1)o=L(e,t,n[s],o,r);return o}function L(e,t,n,i,r){let o=e.ts;if(o.isBlock(n))return B(e,t,[...n.statements],i,r);if(o.isIfStatement(n))return ht(e,t,n,i,r);let s=Sn(e,t,n,i,r);return s!==null?s:o.isSwitchStatement(n)?Et(e,t,n,i,r):o.isTryStatement(n)?Tt(e,t,n,i,r):o.isExpressionStatement(n)?z(e,t,n.expression,i):xt(e,t,n,i,r)??wt(e,t,n,i)}function ht(e,t,n,i,r){let o=E(e,t,"predicate",n.expression),s=L(e,t,n.thenStatement,i,r),a=n.elseStatement?L(e,t,n.elseStatement,i,r):i;return h(t,o.id,s),h(t,o.id,a),o.id}function bt(e,t,n,i,r){let o=E(e,t,"predicate",n.expression),s=L(e,t,n.statement,o.id,{...r,breakTarget:i,continueTarget:o.id});return h(t,o.id,s),h(t,o.id,i),e.ts.isDoStatement(n)?s:o.id}function St(e,t,n,i,r){let o=E(e,t,"predicate",n.condition??n),s=n.incrementor?E(e,t,"statement",n.incrementor):null;s&&h(t,s.id,o.id);let a=s?.id??o.id,l=L(e,t,n.statement,a,{...r,breakTarget:i,continueTarget:a});if(h(t,o.id,l),n.condition&&h(t,o.id,i),!n.initializer)return o.id;let c=E(e,t,"statement",n.initializer);return h(t,c.id,o.id),c.id}function Ct(e,t,n,i,r){e.unsupported.add("for-in/for-of loop variables are drawn from the iterable as a whole; per-element flow is not modeled.");let o=E(e,t,"predicate",n.expression),s=E(e,t,"statement",n.initializer),a=L(e,t,n.statement,o.id,{...r,breakTarget:i,continueTarget:o.id});return h(t,o.id,s.id),h(t,o.id,i),h(t,s.id,a),o.id}function Et(e,t,n,i,r){e.unsupported.add("switch fallthrough is represented conservatively; discriminant-to-case value refinement is unsupported.");let o=E(e,t,"predicate",n.expression),s=i,a=[];for(let l=n.caseBlock.clauses.length-1;l>=0;l-=1){let c=n.caseBlock.clauses[l];s=B(e,t,[...c.statements],s,{...r,breakTarget:i}),a.push(s)}for(let l of a)h(t,o.id,l);return h(t,o.id,i),o.id}function xt(e,t,n,i,r){let o=e.ts;if(o.isReturnStatement(n)||o.isThrowStatement(n)){let s=E(e,t,"statement",n),a=o.isThrowStatement(n)?r.throwTarget??r.exitId:r.exitId;return h(t,s.id,a),s.id}if(o.isBreakStatement(n)||o.isContinueStatement(n)){let s=o.isBreakStatement(n)?"break":"continue",a=r[`${s}Target`],l=E(e,t,"statement",n);return a||e.unsupported.add(`A ${s} statement could not be attached to a structured target.`),h(t,l.id,a??i),l.id}return null}function wt(e,t,n,i){let r=E(e,t,"statement",n);return h(t,r.id,i),r.id}function z(e,t,n,i){let r=e.ts;if(r.isParenthesizedExpression(n))return z(e,t,n.expression,i);if(r.isConditionalExpression(n)){let s=E(e,t,"predicate",n.condition);return h(t,s.id,z(e,t,n.whenTrue,i)),h(t,s.id,z(e,t,n.whenFalse,i)),s.id}if(r.isBinaryExpression(n)&&De(r,n.operatorToken.kind)){let s=E(e,t,"predicate",n.left);return h(t,s.id,i),h(t,s.id,z(e,t,n.right,i)),s.id}let o=E(e,t,"statement",n);return h(t,o.id,i),o.id}function De(e,t){return t===e.SyntaxKind.AmpersandAmpersandToken||t===e.SyntaxKind.BarBarToken||t===e.SyntaxKind.QuestionQuestionToken}function Tt(e,t,n,i,r){let o=e.ts,s=n.finallyBlock?B(e,t,[...n.finallyBlock.statements],i,r):null,a=s??i,{catchEntry:l,catchNodes:c}=At(e,t,n.catchClause,a,s,r),d=l??s??r.throwTarget,f=new Set(t.keys()),u=B(e,t,[...n.tryBlock.statements],a,{...r,throwTarget:d}),p=[...t.keys()].filter(S=>!f.has(S)),y=E(e,t,"statement",null);return h(t,y.id,u),d&&(h(t,y.id,d),Me(e,t,p,d)),s&&l&&Me(e,t,c,s),n.finallyBlock&&vt(o,n.tryBlock,n.catchClause?.block)&&e.unsupported.add("A finally block after return, break, or continue inside its try or catch is not sequenced in the local compiler CFG."),y.id}function At(e,t,n,i,r,o){let s=null,a=[];if(n){let l=new Set(t.keys()),c={...o,throwTarget:r??o.throwTarget},d=B(e,t,[...n.block.statements],i,c);if(s=d,n.variableDeclaration){let f=E(e,t,"statement",n.variableDeclaration);h(t,f.id,d),s=f.id}a=[...t.keys()].filter(f=>!l.has(f))}return{catchEntry:s,catchNodes:a}}function Me(e,t,n,i){for(let r of n)Ft(e,t.get(r))&&h(t,r,i)}function Ft(e,t){let n=t.ast;if(!n||t.kind==="exit"||t.kind==="entry")return!1;let i=e.ts;return!(i.isReturnStatement(n)||i.isThrowStatement(n)||i.isBreakOrContinueStatement(n))}function vt(e,...t){let n=!1,i=r=>{if(!(n||e.isFunctionLike(r))){if(e.isReturnStatement(r)||e.isBreakOrContinueStatement(r)){n=!0;return}r.forEachChild(i)}};for(let r of t)r&&i(r);return n}function E(e,t,n,i){let r={id:`cfg:${e.nextCfgId++}`,kind:n,ast:i,successors:new Set,predecessors:new Set,definitions:[],uses:[],displayPoint:null,invalidatesAllDefinitions:!1};return t.set(r.id,r),r}function h(e,t,n){e.get(t).successors.add(n),e.get(n).predecessors.add(t)}function Mt(e,t){let n=t.cfg.get(t.entryId);yn(e,t,n);for(let i of t.cfg.values())!i.ast||i.kind==="entry"||i.kind==="exit"||(i.kind==="predicate"&&(i.displayPoint=W(e,i.ast,"predicate",null,"predicate",t.id)),Nt(e,t,i,i.ast),Rt(e,i,i.ast),!i.displayPoint&&i.definitions.length===0&&i.uses.length===0&&(i.displayPoint=W(e,i.ast,"statement",null,fn(e,i.ast),t.id)))}function Rt(e,t,n){let i=e.ts,r=o=>{if(!i.isFunctionLike(o)){if(i.isClassDeclaration(o)||i.isClassExpression(o)){Pt(i,o)&&(e.unsupported.add("Class initialization, static blocks, and computed members can execute effects outside the local control-flow model."),t.invalidatesAllDefinitions=!0);return}It(e,o)&&(e.unsupported.add("Direct eval can read and write lexical bindings; its dynamically parsed source is not modeled."),t.invalidatesAllDefinitions=!0),o.forEachChild(r)}};r(n)}function Pt(e,t){return!!t.heritageClauses?.length||t.members.some(n=>e.isClassStaticBlockDeclaration(n)||e.isPropertyDeclaration(n)&&!!n.initializer||!!n.name&&e.isComputedPropertyName(n.name))}function It(e,t){let n=e.ts;return!n.isCallExpression(t)||!n.isIdentifier(t.expression)||t.expression.text!=="eval"?!1:(e.checker.getSymbolAtLocation(t.expression)?.declarations??[]).every(r=>r.getSourceFile().isDeclarationFile)}function Nt(e,t,n,i){let r=e.ts,o=s=>{if(!(s!==i&&r.isFunctionLike(s))&&!kt(e,t,n,s)&&!(r.isFunctionDeclaration(s)||r.isClassDeclaration(s)||r.isInterfaceDeclaration(s))){if($e(e,s)){let a=je(e,t.id,s);a&&n.uses.push(a),r.isPropertyAccessExpression(s)&&o(s.expression);return}s.forEachChild(o)}};o(i),n.uses=We(n.uses)}function kt(e,t,n,i){let r=e.ts;if(r.isVariableDeclaration(i))Bt(e,t,n,i);else if(Dt(r,i))n.uses.push(...v(e,t.id,i,n));else if(r.isBinaryExpression(i)&&qe(r,i.operatorToken.kind))Lt(e,t,n,i);else if(Be(r,i))$t(e,t,n,i);else if(r.isDeleteExpression(i))Le(e,n);else return!1;return!0}function Dt(e,t){return e.isConditionalExpression(t)||e.isBinaryExpression(t)&&De(e,t.operatorToken.kind)}function Bt(e,t,n,i){let r=e.ts,o=i.initializer??Xt(r,i);oe(e,i.initializer);let s=o?v(e,t.id,o,n):[],a=se(e,i.name,l=>s.push(...v(e,t.id,l,n)));if(n.uses.push(...s),a.length===0&&r.isIdentifier(i.name)){n.invalidatesAllDefinitions=!0,e.unsupported.add("A variable declaration could not be resolved to a compiler symbol.");return}re(e,t.id,n,a,s)}function Lt(e,t,n,i){let r=e.ts;i.operatorToken.kind===r.SyntaxKind.EqualsToken&&oe(e,i.right);let o=v(e,t.id,i.right,n);i.operatorToken.kind!==r.SyntaxKind.EqualsToken&&o.push(...v(e,t.id,i.left,n));let s=R(e,t.id,i.left,n,o);if(n.uses.push(...o),!s){n.invalidatesAllDefinitions=!0,e.unsupported.add("Dynamic assignment targets are not included in reaching definitions.");return}re(e,t.id,n,s,o)}function $t(e,t,n,i){let r=v(e,t.id,i.operand,n),o=R(e,t.id,i.operand,n,r)??[];n.uses.push(...r),re(e,t.id,n,o,r)}function re(e,t,n,i,r){let o=r.map(s=>s.point.id);for(let s of i)n.definitions.push({point:W(e,s.node,"definition",s.symbolKey,s.name,t),rhsUseIds:o,partial:s.partial??!1})}function v(e,t,n,i){let r=[],o=s=>{if(!e.ts.isFunctionLike(s)){if(e.ts.isDeleteExpression(s)){Le(e,i);return}if(Be(e.ts,s)){i.invalidatesAllDefinitions=!0;let a=e.sourceFile.getLineAndCharacterOfPosition(s.getStart(e.sourceFile));e.unsupported.add(`Nested increment/decrement at ${e.sourceFile.fileName}:${a.line+1} is not included in ordered local definition-use flow.`),o(s.operand);return}if(e.ts.isBinaryExpression(s)&&qe(e.ts,s.operatorToken.kind)){i.invalidatesAllDefinitions=!0,e.unsupported.add("Nested assignment expressions are not included in ordered local definition-use flow."),s.operatorToken.kind!==e.ts.SyntaxKind.EqualsToken&&o(s.left),o(s.right);return}if($e(e,s)){let a=je(e,t,s);a&&r.push(a),e.ts.isPropertyAccessExpression(s)&&o(s.expression);return}s.forEachChild(o)}};return o(n),We(r)}function Be(e,t){return(e.isPrefixUnaryExpression(t)||e.isPostfixUnaryExpression(t))&&(t.operator===e.SyntaxKind.PlusPlusToken||t.operator===e.SyntaxKind.MinusMinusToken)}function oe(e,t){if(!t)return;let n=jt(e.ts,t);if(n){for(let r of n)oe(e,r);return}if(!J(e,t)||!Ot(e,t))return;let i=e.sourceFile.getLineAndCharacterOfPosition(t.getStart(e.sourceFile));e.unsupported.add(`Object alias at ${e.sourceFile.fileName}:${i.line+1} is not included in local points-to flow.`)}function jt(e,t){if(e.isObjectLiteralExpression(t))return t.properties.map(i=>Kt(e,i));if(e.isArrayLiteralExpression(t))return t.elements.map(i=>e.isSpreadElement(i)?i.expression:i);if(e.isConditionalExpression(t))return[t.whenTrue,t.whenFalse];let n=Ut(e,t);return n?[n]:void 0}function Kt(e,t){if(e.isPropertyAssignment(t))return t.initializer;if(e.isShorthandPropertyAssignment(t))return t.name;if(e.isSpreadAssignment(t))return t.expression}function Ut(e,t){if(e.isParenthesizedExpression(t)||e.isAsExpression(t)||e.isSatisfiesExpression(t)||e.isNonNullExpression(t)||e.isTypeAssertionExpression(t))return t.expression}function Le(e,t){t.invalidatesAllDefinitions=!0,e.unsupported.add("Property deletion is not included in local mutation flow; prior reaching definitions are invalidated.")}function Ot(e,t){let n=e.ts,i=e.checker.getTypeAtLocation(t);return(i.isUnionOrIntersection()?i.types:[i]).some(o=>(o.flags&(n.TypeFlags.Object|n.TypeFlags.Any|n.TypeFlags.Unknown|n.TypeFlags.TypeParameter|n.TypeFlags.NonPrimitive))!==0)}function $e(e,t){if(e.ts.isPropertyAccessExpression(t))return!0;if(!e.ts.isIdentifier(t))return!1;let n=t.parent;return!(zt(e.ts,t)||e.ts.isLabeledStatement(n)||e.ts.isBreakOrContinueStatement(n)||Wt(e.ts,t))}function zt(e,t){let n=t.parent;return!!(e.isPropertyAccessExpression(n)&&n.name===t||"name"in n&&n.name===t&&qt(e,n)||e.isPropertyAssignment(n)&&n.name===t||e.isBindingElement(n)&&n.propertyName===t)}function qt(e,t){return e.isVariableDeclaration(t)||e.isParameter(t)||e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isClassDeclaration(t)||e.isMethodDeclaration(t)||e.isPropertyDeclaration(t)||e.isInterfaceDeclaration(t)||e.isTypeAliasDeclaration(t)||hn(e,t)}function Wt(e,t){for(let n=t.parent;n;n=n.parent){if(e.isExpression(n)||e.isStatement(n)||e.isSourceFile(n))return!1;if(e.isTypeNode(n))return!0}return!1}function je(e,t,n){let i=j(e,n);return i?{point:W(e,i.node,"use",i.symbolKey,i.name,t),property:e.ts.isPropertyAccessExpression(n)}:null}function se(e,t,n){let i=e.ts;if(i.isIdentifier(t)){let o=j(e,t);return o?[o]:[]}let r=[];for(let o of t.elements)i.isOmittedExpression(o)||(o.initializer&&n&&n(o.initializer),r.push(...se(e,o.name,n)));return r}function R(e,t,n,i,r){let o=e.ts,s=_t(o,n);if(s)return R(e,t,s,i,r);if(o.isIdentifier(n)||o.isPropertyAccessExpression(n)){let a=j(e,n);return a?[{...a,partial:!1}]:null}return o.isElementAccessExpression(n)?Ht(e,t,n,i,r):o.isObjectLiteralExpression(n)?Gt(e,t,n,i,r):o.isArrayLiteralExpression(n)?Jt(e,t,n,i,r):null}function _t(e,t){return e.isParenthesizedExpression(t)||e.isAsExpression(t)||e.isTypeAssertionExpression(t)||e.isNonNullExpression(t)?t.expression:null}function Ht(e,t,n,i,r){let o=j(e,n.expression);return o?(r.push(...v(e,t,n.expression,i)),r.push(...v(e,t,n.argumentExpression,i)),[{node:n,symbolKey:o.symbolKey,name:`${o.name}[\u2026]`,partial:!0}]):null}function Gt(e,t,n,i,r){let o=[];for(let s of n.properties){let a=Vt(e,t,s,i,r);if(!a)return null;o.push(...a)}return o}function Vt(e,t,n,i,r){let o=e.ts;if(o.isShorthandPropertyAssignment(n)){let s=e.checker.getShorthandAssignmentValueSymbol(n),a=s?Ke(e,s):null,l=a?[{node:n.name,symbolKey:a,name:n.name.text,partial:!1}]:null;return n.objectAssignmentInitializer&&r.push(...v(e,t,n.objectAssignmentInitializer,i)),l}return o.isPropertyAssignment(n)?R(e,t,n.initializer,i,r):o.isSpreadAssignment(n)?R(e,t,n.expression,i,r):null}function Jt(e,t,n,i,r){let o=e.ts,s=[];for(let a of n.elements){if(o.isOmittedExpression(a))continue;let l;if(o.isSpreadElement(a)?l=R(e,t,a.expression,i,r):o.isBinaryExpression(a)&&a.operatorToken.kind===o.SyntaxKind.EqualsToken?(r.push(...v(e,t,a.right,i)),l=R(e,t,a.left,i,r)):l=R(e,t,a,i,r),!l)return null;s.push(...l)}return s}function Xt(e,t){let n=t.parent;if(!n||!e.isVariableDeclarationList(n))return null;let i=n.parent;return i&&(e.isForOfStatement(i)||e.isForInStatement(i))&&i.initializer===n?i.expression:null}function j(e,t){let n=e.ts;if(n.isIdentifier(t)){let i=Yt(e,t);return i?{node:t,symbolKey:i,name:t.text}:null}if(n.isPropertyAccessExpression(t)){let i=J(e,t.expression);return i?{node:t,symbolKey:`${i.symbolKey}.${t.name.text}`,name:t.getText(e.sourceFile)}:null}return t.kind===n.SyntaxKind.ThisKeyword?{node:t,symbolKey:Qt(e,t),name:"this"}:bn(n,t)?j(e,t.expression):((n.isArrayLiteralExpression(t)||n.isObjectLiteralExpression(t))&&e.unsupported.add("Heap aggregate identity and destructured assignment are not included in local points-to flow."),null)}function J(e,t){let n=e.ts;return n.isIdentifier(t)||n.isPropertyAccessExpression(t)||t.kind===n.SyntaxKind.ThisKeyword?j(e,t):n.isParenthesizedExpression(t)||n.isNonNullExpression(t)||n.isAsExpression(t)||n.isTypeAssertionExpression(t)||n.isSatisfiesExpression(t)?J(e,t.expression):null}function Qt(e,t){let n=e.ts,i=encodeURIComponent(e.sourceFile.fileName);for(let r=t.parent;r;r=r.parent)if(!n.isArrowFunction(r)){if(n.isClassLike(r))return`symbol:${i}:${r.getStart(e.sourceFile)}:this`;if(n.isFunctionLike(r)){let o=r.parent;return o&&(n.isClassLike(o)||n.isObjectLiteralExpression(o))?`symbol:${i}:${o.getStart(e.sourceFile)}:this`:`symbol:${i}:${r.getStart(e.sourceFile)}:this`}}return`symbol:${i}:0:this`}function Yt(e,t){let n=t.parent,i=n&&e.ts.isShorthandPropertyAssignment(n)&&n.name===t?e.checker.getShorthandAssignmentValueSymbol(n)??e.checker.getSymbolAtLocation(t):e.checker.getSymbolAtLocation(t);return i?Ke(e,i):null}function Ke(e,t){let n=t;if((n.flags&e.ts.SymbolFlags.Alias)!==0)try{n=e.checker.getAliasedSymbol(n)}catch{}let i=n.valueDeclaration??n.declarations?.[0];return i?`symbol:${encodeURIComponent(i.getSourceFile().fileName)}:${i.getStart()}:${n.getName()}`:`symbol:${n.getName()}`}function W(e,t,n,i,r,o){let s=t.getStart(e.sourceFile),a=t.getEnd(),l=e.sourceFile.getLineAndCharacterOfPosition(s),c=`flow-point:${encodeURIComponent(e.sourceFile.fileName)}:${s}:${a}:${n}:${encodeURIComponent(i??r)}`,d=e.points.get(c);if(d)return d;let f={id:c,kind:n,name:r,symbolKey:i,callableId:o,start:s,end:a,line:l.line,column:l.character,node:t};return e.points.set(c,f),f}function D(e){return new Uint32Array(e+31>>>5)}function Ue(e,t){return(e[t>>>5]&1<<(t&31))!==0}function X(e,t){e[t>>>5]|=1<<(t&31)}function Zt(e,t){for(let n=0;n<e.length;n+=1){let i=e[n];for(;i!==0;){let r=i&-i;t((n<<5)+(31-Math.clz32(r))),i^=r}}}function Oe(e,t,n){let i=new Set,r=[],o=[],s=l=>{i.add(l),o.push({id:l,successors:[...n(e.get(l))],cursor:0})};for(s(t);o.length>0;){let l=o[o.length-1];if(l.cursor<l.successors.length){let c=l.successors[l.cursor];l.cursor+=1,i.has(c)||s(c)}else r.push(l.id),o.pop()}let a=r.reverse();for(let l of e.keys())i.has(l)||a.push(l);return a}function en(e,t){let n=[...t.cfg.values()].flatMap(g=>g.definitions),i=new Map;n.forEach((g,C)=>i.set(g.point.id,C));let r=rn(n),o=new Map;for(let[g,C]of r)o.set(g,C.map(T=>i.get(T.point.id)));let s=Oe(t.cfg,t.entryId,g=>g.successors),a=new Map;s.forEach((g,C)=>a.set(g,C));let l=s.map(g=>t.cfg.get(g)),c=n.length,d=l.map(()=>D(c)),f=l.map(()=>D(c));l.forEach((g,C)=>{for(let T of on(g.definitions)){if(!T.partial)for(let A of o.get(T.point.symbolKey)??[])X(f[C],A);X(d[C],i.get(T.point.id))}});let u=l.map(()=>D(c)),p=l.map(()=>D(c)),y=new Uint8Array(l.length).fill(1),S=l.map((g,C)=>C),b=0;for(;b<S.length;){let g=S[b];b+=1,y[g]=0;let C=l[g],T=u[g];T.fill(0),tn(C,a,p,T),nn(C,T,p[g],d[g],f[g])&&ze(C.successors,a,y,S)}l.forEach((g,C)=>{let T=u[C];for(let A of g.uses){let M=g.definitions.filter(w=>w.point.symbolKey===A.point.symbolKey&&w.point.start<A.point.start&&!w.rhsUseIds.includes(A.point.id)).sort((w,H)=>H.point.start-w.point.start)[0],x=M?[M]:(o.get(A.point.symbolKey??"")??[]).filter(w=>Ue(T,w)).map(w=>n[w]);for(let w of x)$(e,"reaching-definition",w.point.id,A.point.id,"exact","A CFG path reaches this use without an intervening definition.")}for(let A of g.definitions)for(let M of A.rhsUseIds)$(e,"value-source",M,A.point.id,"exact","This right-hand-side use supplies the new definition.")})}function tn(e,t,n,i){for(let r of e.predecessors){let o=n[t.get(r)];for(let s=0;s<o.length;s+=1)i[s]|=o[s]}}function nn(e,t,n,i,r){let o=!1;for(let s=0;s<n.length;s+=1){let a=(e.invalidatesAllDefinitions?i[s]:t[s]&~r[s]|i[s])>>>0;a!==n[s]&&(n[s]=a,o=!0)}return o}function ze(e,t,n,i){for(let r of e){let o=t.get(r);n[o]===0&&(n[o]=1,i.push(o))}}function rn(e){let t=new Map;for(let n of e){if(!n.point.symbolKey)continue;let i=t.get(n.point.symbolKey)??[];i.push(n),t.set(n.point.symbolKey,i)}return t}function on(e){let t=new Map;for(let n of e)n.point.symbolKey&&t.set(n.point.symbolKey,n);return[...t.values()]}function sn(e,t){let{order:n,sets:i}=an(t),r=new Map;n.forEach((s,a)=>r.set(s,a));let o=r.get(t.exitId);for(let s of t.cfg.values()){if(s.kind!=="predicate"||!s.displayPoint)continue;for(let l of s.uses)$(e,"value-source",l.point.id,s.displayPoint.id,"exact","The predicate evaluates this variable occurrence to choose its control-flow successor.");if(s.successors.size<2)continue;let a=i[r.get(s.id)];for(let l of s.successors)Zt(i[r.get(l)],c=>{if(c===o||Ue(a,c))return;let d=t.cfg.get(n[c]),f=[...d.definitions.map(u=>u.point),...d.uses.map(u=>u.point),...d.displayPoint?[d.displayPoint]:[]];for(let u of mn(f))$(e,"control-dependence",s.displayPoint.id,u.id,"exact","The target postdominates a branch successor but does not postdominate the predicate.")})}}function an(e){let t=Oe(e.cfg,e.exitId,f=>f.predecessors),n=new Map;t.forEach((f,u)=>n.set(f,u));let i=t.length,r=n.get(e.exitId),o=t.map((f,u)=>{let p=D(i);if(u===r)X(p,u);else{p.fill(4294967295);let y=p.length*32-i;y>0&&(p[p.length-1]=4294967295>>>y)}return p}),s=t.map(f=>e.cfg.get(f)),a=new Uint8Array(i).fill(1),l=s.map((f,u)=>u),c=0,d=D(i);for(;c<l.length;){let f=l[c];if(c+=1,a[f]=0,f===r)continue;let u=s[f];u.successors.size===0||(d.fill(4294967295),ln(u,n,o,d),X(d,f),!cn(o[f],d))||ze(u.predecessors,n,a,l)}return{order:t,sets:o}}function ln(e,t,n,i){for(let r of e.successors){let o=n[t.get(r)];for(let s=0;s<i.length;s+=1)i[s]&=o[s]}}function cn(e,t){let n=!1;for(let i=0;i<e.length;i+=1)t[i]!==e[i]&&(e[i]=t[i],n=!0);return n}function un(e,t){let n=new Map(t.map(r=>[r.id,r.parentId])),i=dn(t);for(let r of t)for(let o of[...r.cfg.values()].flatMap(s=>s.uses))o.point.symbolKey&&pn(e,o,i.get(o.point.symbolKey)??[],n);[...e.edges.values()].some(r=>r.kind==="closure-capture")&&e.unsupported.add("Closure capture identity is known, but invocation order and intervening writes remain candidate flow."),[...e.edges.values()].some(r=>r.kind==="field-definition-to-use")&&e.unsupported.add("Cross-callable field flow lacks receiver points-to and invocation-order analysis.")}function dn(e){let t=e.flatMap(i=>[...i.cfg.values()].flatMap(r=>r.definitions.map(o=>o.point))),n=new Map;for(let i of t){if(!i.symbolKey)continue;let r=n.get(i.symbolKey)??[];r.push(i),n.set(i.symbolKey,r)}return n}function pn(e,t,n,i){for(let r of n)Re(r.callableId,t.point.callableId,i)||Re(t.point.callableId,r.callableId,i)?$(e,"closure-capture",r.id,t.point.id,"candidate","Compiler identity proves a shared lexical binding, but closure invocation and intervening writes remain unresolved."):t.property&&r.callableId!==t.point.callableId&&$(e,"field-definition-to-use",r.id,t.point.id,"candidate","Compiler identity matches the field; cross-callable receiver and execution order remain unresolved.")}function Re(e,t,n){for(let i=n.get(t)??null;i;i=n.get(i)??null)if(i===e)return!0;return!1}function $(e,t,n,i,r,o){let s=`local-flow-edge:${t}:${encodeURIComponent(n)}:${encodeURIComponent(i)}`;e.edges.set(s,{id:s,kind:t,fromPointId:n,toPointId:i,strength:r,reason:o})}function qe(e,t){return t>=e.SyntaxKind.FirstAssignment&&t<=e.SyntaxKind.LastAssignment}function fn(e,t){let n=t.getText(e.sourceFile).replace(/\s+/gu," ").trim();return n.length>80?`${n.slice(0,77)}...`:n||e.ts.SyntaxKind[t.kind]||"statement"}function We(e){return[...new Map(e.map(t=>[t.point.id,t])).values()]}function mn(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function gn(e,t){return e.start-t.start||e.kind.localeCompare(t.kind)||e.id.localeCompare(t.id)}function V(e){return{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[e]}}}function yn(e,t,n){for(let i of t.node.parameters){let r=se(e,i.name);if(r.length===0&&e.ts.isIdentifier(i.name)){e.unsupported.add("A parameter binding could not be resolved to a compiler symbol.");continue}for(let o of r)n.definitions.push({point:W(e,o.node,"parameter-definition",o.symbolKey,o.name,t.id),rhsUseIds:[],partial:!1})}}function hn(e,t){return e.isImportSpecifier(t)||e.isImportClause(t)||e.isNamespaceImport(t)}function bn(e,t){return e.isParenthesizedExpression(t)||e.isAsExpression(t)||e.isTypeAssertionExpression(t)||e.isNonNullExpression(t)}function Sn(e,t,n,i,r){let o=e.ts;return o.isWhileStatement(n)||o.isDoStatement(n)?bt(e,t,n,i,r):o.isForStatement(n)?St(e,t,n,i,r):o.isForInStatement(n)||o.isForOfStatement(n)?Ct(e,t,n,i,r):null}var En=ue("typescript-local-flow",{clearGroups:["whole-project","source-file","semantic-provider"]});function _e(e,t,n,i,r={}){if(t=t.replace(/\\/g,"/"),!pe(t))return null;let o=`${t}\0${n}\0${i}\0${r.startColumn??""}\0${r.endColumn??""}`;return En.get(e,o,()=>{let s=de(e,t);return s?Pe(s,Cn(e.config.projectRoot,t),{startLine:n,endLine:i,...r}):{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[`Current source is unavailable for ${t}.`]}}})}function Ci(e,t,n={}){let{file:i,line:r,maxDepth:o,maxEdges:s,direction:a}=wn(t,n),l=_e(e,i,r-1,r-1),c=l?.coverage??{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:["Function-local slicing currently requires TypeScript or JavaScript source."]},d=An(l?.points??[],r,n),f=xn(c,d.length),u={kind:"dependence-slice",direction:a,criterion:t,...n.variable!==void 0?{variable:n.variable}:{},resolution:f,candidates:d,points:[],edges:[],coverage:{status:"incomplete",basis:"function-local-dependence",model:c,omittedEdges:0,omittedPoints:0,depthLimited:!1,candidateEdges:0}},p=d[0];if(f!=="matched"||!p||!l)return u;let y=new Map(l.points.map(x=>[x.id,x])),S=Fn(l,y,p.callableId,a),{selected:b,reached:g,depthFrontier:C}=vn(S,p.id,a,o);u.edges=[...b.values()].slice(0,s);let T=new Set([p.id,...u.edges.flatMap(x=>[x.fromPointId,x.toPointId])]);u.points=[...T].map(x=>y.get(x)).sort((x,w)=>x.start-w.start||x.id.localeCompare(w.id));let A=b.size-u.edges.length,M=C.size>0;return u.coverage={status:c.status!=="complete"?"incomplete":A>0||M?"bounded":"complete",basis:"function-local-dependence",model:c,omittedEdges:A,omittedPoints:g.size-T.size,depthLimited:M,candidateEdges:l.edges.filter(x=>x.strength==="candidate"&&(g.has(x.fromPointId)||g.has(x.toPointId))).length},u}function xn(e,t){return e.status==="unsupported"?"unsupported":t===1?"matched":t>1?"ambiguous":"missing"}function wn(e,t){let n=/^(.*):([1-9]\d*)$/u.exec(e);if(!n)throw new Error("A dependence slice requires an exact file:line, with --variable or --column when ambiguous. Use evidence for symbol relationships.");let i=Number(n[2]),r=t.maxDepth??Number.MAX_SAFE_INTEGER,o=t.maxEdges??200;Tn(i,t.column,r,o);let s=t.direction??"backward";if(s!=="backward"&&s!=="forward")throw new Error("Slice direction must be backward or forward.");return{file:n[1],line:i,maxDepth:r,maxEdges:o,direction:s}}function Tn(e,t,n,i){for(let[r,o]of[["line",e],["depth",n],["max-edges",i]])if(!Number.isSafeInteger(o)||o<(r==="line"?1:0))throw new RangeError(`Invalid slice ${r}: ${o}.`);if(t!==void 0&&(!Number.isSafeInteger(t)||t<1))throw new RangeError("Slice column must be a positive safe integer.")}function An(e,t,n){let i=e.filter(r=>r.line===t-1&&["use","definition","parameter-definition"].includes(r.kind)&&(n.variable===void 0||r.name===n.variable));if(n.column!==void 0){let r=n.column-1;i=i.filter(s=>r>=s.column&&r<s.column+s.end-s.start);let o=Math.min(...i.map(s=>s.end-s.start));i=i.filter(s=>s.end-s.start===o)}return i}function Fn(e,t,n,i){let r=new Map;for(let o of e.edges){if(o.strength!=="exact"||t.get(o.fromPointId)?.callableId!==n||t.get(o.toPointId)?.callableId!==n)continue;let s=i==="backward"?o.toPointId:o.fromPointId,a=r.get(s)??[];a.push(o),r.set(s,a)}return r}function vn(e,t,n,i){let r=new Set([t]),o=new Map,s=[{id:t,depth:0}],a=new Set;for(let l=0;l<s.length;l++){let c=s[l],d=e.get(c.id)??[];if(c.depth>=i){for(let f of d)a.add(f.id);continue}for(let f of d){o.set(f.id,{...f,traversalDepth:c.depth+1});let u=n==="backward"?f.fromPointId:f.toPointId;r.has(u)||(r.add(u),s.push({id:u,depth:c.depth+1}))}}for(let l of o.keys())a.delete(l);return{selected:o,reached:r,depthFrontier:a}}function Q(e){let t=new Map,n=[],i=new Map,r=new Map,o=new Set,s=[],a=0,l=u=>(e.get(u)??[]).values();function c(u,p){i.set(u,a),r.set(u,a),a+=1,s.push(u),o.add(u),p.push({node:u,iter:l(u),pendingChild:null})}function d(u){if(r.get(u)!==i.get(u))return;let p=[];for(;;){let y=s.pop();if(o.delete(y),p.push(y),t.set(y,n.length),y===u)break}n.push(p)}function f(u){let p=u[u.length-1];if(p.pendingChild!==null){let b=p.pendingChild;p.pendingChild=null,r.set(p.node,Math.min(r.get(p.node),r.get(b)))}let y=p.iter.next();if(y.done){d(p.node),u.pop();return}let S=y.value;i.has(S)?o.has(S)&&r.set(p.node,Math.min(r.get(p.node),i.get(S))):(p.pendingChild=S,c(S,u))}for(let u of e.keys()){if(i.has(u))continue;let p=[];for(c(u,p);p.length>0;)f(p)}return{components:n,componentOf:t}}function _(e,t){let n=He(e),i=He(t);if(n.endsWith("/**")){let r=n.slice(0,-3);return i===r||i.startsWith(`${r}/`)}if(n.endsWith("/*")){let r=n.slice(0,-2);if(!i.startsWith(`${r}/`))return!1;let o=i.slice(r.length+1);return o.length>0&&!o.includes("/")}return n==="**"?!0:n==="*"?i.length>0&&!i.includes("/"):n===i}function He(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"")}function Ai(e,t){let n=(e?.boundaries??[]).filter(i=>i.paths.some(r=>_(r,t)));return n.length===1?n[0].name:null}import P from"path";import{ts as N}from"@ts-morph/common";var Mn={allowJs:!0,moduleResolution:N.ModuleResolutionKind.Node10};function Rn(e,t,n){let i=new Set(e),r=new Map,o=[],s=p=>{if(r.has(p))return r.get(p);if(!(!p.endsWith(".json")||!i.has(p)))try{let y=n(p);return y!==void 0&&r.set(p,y),y}catch(y){o.push(`${p}: configuration unavailable: ${y instanceof Error?y.message:String(y)}`);return}},a=ee(N,e,s),l=Pn(t),c=In(i,l,a,o),d=new Set,f=kn(i,l,s,o,d);for(let p of e)(p==="package.json"||p.endsWith("/package.json"))&&s(p);i.has(".scipquery.json")&&s(".scipquery.json");let u=ee(N,e,p=>r.get(p));return{inputs:r,inventory:i,configs:c,packages:f,host:Dn(u,f),problems:o,architecture:Bn(r.get(".scipquery.json"),o),resolutionCaches:new Map,fileConfigs:new Map,ambiguousPackages:d}}function Pn(e){let t=new Set(["."]);for(let n of e){let i=P.posix.dirname(n);for(;!t.has(i);)t.add(i),i=P.posix.dirname(i)}return t}function In(e,t,n,i){let r=[...t].flatMap(a=>["tsconfig.json","jsconfig.json"].map(c=>P.posix.join(a,c)).filter(c=>e.has(c)).slice(0,1)),o=new Set,s=[];for(let a=0;a<r.length;a++){let l=r[a];if(o.has(l))continue;o.add(l);let c=Nn(l,n,i);if(!c)continue;let d="/"+l;s.push({file:l,directory:P.posix.dirname(d),files:new Set(c.fileNames),options:c.options});for(let f of c.projectReferences??[]){let u=f.path.endsWith(".json")?f.path:P.posix.join(f.path,"tsconfig.json");r.push(u.replace(/^\//,""))}}return s}function Nn(e,t,n){let i="/"+e,r=N.readConfigFile(i,t.readFile);if(r.error){n.push(`${e}: ${N.flattenDiagnosticMessageText(r.error.messageText," ")}`);return}let o=N.parseJsonConfigFileContent(r.config,t,P.posix.dirname(i),void 0,i);for(let s of o.errors)s.code!==18003&&s.code!==18002&&n.push(`${e}: ${N.flattenDiagnosticMessageText(s.messageText," ")}`);return o}function kn(e,t,n,i,r){let o=new Map;for(let s of t){let a=P.posix.join(s,"package.json");if(e.has(a))try{let l=JSON.parse(n(a)??"{}");if(!ce(l)||typeof l.name!="string"||r.has(l.name))continue;let c=o.get(l.name);if(c&&c!==s){i.push(`${a}: repository package name ${l.name} is also declared in ${c}.`),r.add(l.name),o.delete(l.name);continue}o.set(l.name,s)}catch{i.push(`${a}: malformed package metadata.`)}}return o}function Dn(e,t){let n=i=>{let r="/node_modules/",o=i.lastIndexOf(r);if(o<0)return i;let s=i.slice(o+r.length),a=Y(s),l=t.get(a);return l===void 0?i:P.posix.join("/",l,s.slice(a.length))};return{...e,fileExists:i=>e.fileExists(n(i)),readFile:i=>e.readFile(n(i)),directoryExists:i=>i.endsWith("/node_modules")||e.directoryExists?.(n(i))===!0,realpath:n}}function Y(e){return e.startsWith("@")?e.split("/").slice(0,2).join("/"):e.split("/")[0]}function ae(e,t){let n=e.fileConfigs.get(t);if(n)return n;let i="/"+t,r=e.configs.filter(l=>l.files.has(i)),o=r.length?r:e.configs.filter(l=>i.startsWith(l.directory.replace(/\/$/,"")+"/")),s=Math.max(...o.map(l=>l.directory.length)),a=o.length?o.filter(l=>l.directory.length===s):[{file:"",directory:"/",files:new Set,options:Mn}];return e.fileConfigs.set(t,a),a}function Ge(e,t,n){return n.startsWith(".")||n.startsWith("/")||n.startsWith("#")||e.packages.has(Y(n))?!0:ae(e,t).some(i=>Object.keys(i.options.paths??{}).some(r=>{let[o,s]=r.split("*");return s===void 0?n===r:n.startsWith(o)&&n.endsWith(s)}))}function Bn(e,t){if(e===void 0)return;let n=Se(e);if(n.kind==="malformed"||n.kind==="unsupported"){t.push(`.scipquery.json: ${n.kind==="malformed"?n.reason:"unsupported schema version"}`);return}let i=[];if(be(n.config,i),i.some(r=>r.level==="error")){t.push(...i.map(r=>`.scipquery.json ${r.path}: ${r.message}`));return}return n.config.architecture}import k from"path";import{isBuiltin as Ln}from"module";import{ts as Ve}from"@ts-morph/common";function Ui(e,t,n,i){let r=[],o=ae(n,e.fileName);for(let s of me(e,i)){let{literal:a,...l}=s,c=a?$n(n,t,e.fileName,s.specifier,o):{resolution:"dynamic"};r.push({...l,file:e.fileName,role:U(e.fileName)==="test"?"test":"production",configs:o.map(d=>d.file).filter(Boolean),...c})}return r}function $n(e,t,n,i,r){if(Ln(i))return{resolution:"builtin"};let o=jn(e,n,i);if(o)return{resolution:"excluded",target:o};if(e.ambiguousPackages.has(Y(i)))return{resolution:"ambiguous",alternatives:[]};let s=r.map(c=>{let d=e.resolutionCaches.get(c.file);return d||(d=Ve.createModuleResolutionCache("/",f=>f,{allowJs:!0,...c.options}),e.resolutionCaches.set(c.file,d)),Ve.resolveModuleName(i,"/"+n,{allowJs:!0,...c.options},e.host,d).resolvedModule?.resolvedFileName}),a=[...new Set(s.filter(c=>c!==void 0).map(c=>k.posix.normalize(e.host.realpath?.(c)??c).replace(/^\//,"")))];if(a.length>1||a.length===1&&s.some(c=>!c))return{resolution:"ambiguous",alternatives:a};let l=a[0];return l?{resolution:t.has(l)?"internal":"excluded",target:l}:Kn(e,n,i)}function jn(e,t,n){if(!n.startsWith("."))return;let i=k.posix.normalize(k.posix.join(k.posix.dirname(t),n));return e.inventory.has(i)&&!/\.[cm]?[jt]sx?$/.test(i)?i:void 0}function Kn(e,t,n){let i=k.posix.normalize(k.posix.join(k.posix.dirname(t),n));return n.startsWith(".")&&he(i)?{resolution:"excluded",excludedReason:`Requested managed output ${i}; build/install existence is not established by the source inventory.`}:{resolution:Ge(e,t,n)?"missing":"external"}}function _i(e,t,n,i={}){let r=i.scope?{scope:i.scope,limitations:["A file-filtered projection cannot establish repository-wide cycle freedom, size compliance or unused allowances. Rerun architecture without --scope for full policy evaluation."]}:{},o=e,s=Qe(e,t),a=Zn(e,n);e=a.graph;let l={excludedTestEdges:a.excludedTestEdges,basis:"production-imports-including-types",cycleMeaning:"Boundary cycles concern declared groups. File cycle members, when present, concern observed imports including types and deferred imports; neither establishes a runtime initialization failure."};if(!n||n.boundaries.length===0)return{configured:!1,dependencyRoles:l,boundaries:[],edges:[],forbiddenEdges:[],reciprocalPairs:[],cycles:[],coarseBoundaries:[],staleAllowances:[],boundaryLimits:[],fragileEdges:[],testBoundaryViolations:[],coverage:{...r,totalFiles:s.length,mappedFiles:0,unmappedFiles:s,ambiguousFiles:[]},policyCoverage:{declaredRows:0,totalBoundaries:0,missingRows:[],requiresCompletePolicy:!1,requiresCompleteCoverage:!1,requiresMinimalPolicy:!1}};let{resolved:c,filesByBoundary:d,unmappedFiles:f,ambiguousFiles:u}=Un(s,n),p=Je(e,c,n),y=new Map([...o].map(([m,F])=>[m,new Set([...F].filter(Z=>!e.get(m)?.has(Z)))])),S=Je(y,c,n),b=p,g=new Map(b.map(m=>[K(m.from,m.to),m])),C=new Map(n.boundaries.map(m=>[m.name,new Set]));for(let m of b)C.get(m.from).add(m.to);let T=On(b,g),A=Q(e).components.filter(m=>m.length>1&&new Set(m.map(F=>c.get(F)).filter(Boolean)).size>1),{components:M}=Q(C),x=M.filter(m=>m.length>1).map(m=>{let F=Wn(m,b,n.requireAcyclic===!0),Z=new Set(m),le=A.filter(Ye=>Ye.every(Ze=>Z.has(c.get(Ze)??""))).flat();return{...F,origin:le.length>0?"contains-file-cycle":"grouping-only",fileCycleMembers:[...new Set(le)].sort()}}).sort((m,F)=>F.boundaries.length-m.boundaries.length||m.boundaries.join("/").localeCompare(F.boundaries.join("/"))),w=n.allowedDependencies??{},H=n.boundaries.map(m=>m.name).filter(m=>!Object.hasOwn(w,m)).sort();return{configured:!0,dependencyRoles:l,testEdges:S,testForbiddenEdges:S.filter(m=>m.policyStatus==="forbidden"),boundaries:n.boundaries.map(m=>({name:m.name,paths:[...m.paths],fileCount:d.get(m.name).size,dependencyPolicyDeclared:Object.hasOwn(w,m.name)})).sort((m,F)=>m.name.localeCompare(F.name)),edges:p,forbiddenEdges:b.filter(m=>m.policyStatus==="forbidden"),reciprocalPairs:T,cycles:x,staleAllowances:i.scope?[]:Vn(n,[...b,...S],d),boundaryLimits:Jn(n,b,d),fragileEdges:b.filter(m=>m.fragile),testBoundaryViolations:i.testBoundaryViolations??[],coarseBoundaries:_n(e,d,i.isModuleHierarchyFile,n.requireResolvedBoundaries===!0,m=>n.boundaries.find(F=>F.name===m)?.subUnits??"directory"),coverage:{...r,totalFiles:s.length,mappedFiles:c.size,unmappedFiles:f,ambiguousFiles:u},policyCoverage:{declaredRows:n.boundaries.length-H.length,totalBoundaries:n.boundaries.length,missingRows:H,requiresCompletePolicy:n.requireCompletePolicy===!0,requiresCompleteCoverage:n.requireCompleteCoverage===!0,requiresMinimalPolicy:n.requireMinimalPolicy===!0}}}function Un(e,t){let n=new Map,i=new Map(t.boundaries.map(s=>[s.name,new Set])),r=[],o=[];for(let s of e){let a=t.boundaries.filter(l=>l.paths.some(c=>_(c,s))).map(l=>l.name).sort();if(a.length===0)r.push(s);else if(a.length>1)o.push({file:s,boundaries:a});else{let l=a[0];n.set(s,l),i.get(l).add(s)}}return{resolved:n,filesByBoundary:i,unmappedFiles:r,ambiguousFiles:o}}function On(e,t){let n=[];for(let i of e){if(i.from>=i.to)continue;let r=t.get(K(i.to,i.from));r&&n.push({boundaries:[i.from,i.to],forward:i,reverse:r})}return n}function Qe(e,t){let n=new Set(t);for(let[i,r]of e){n.add(i);for(let o of r)n.add(o)}return[...n].sort()}function zn(e,t){let n=[...e.fileEdges].sort((i,r)=>i.fromFile.localeCompare(r.fromFile)||i.toFile.localeCompare(r.toFile));return{from:e.from,to:e.to,policyStatus:qn(t,e.from,e.to),fileEdgeCount:n.length,importerCount:e.importers.size,importedFileCount:e.importedFiles.size,examples:n.slice(0,5),fragile:n.length===1}}function qn(e,t,n){return!e.allowedDependencies||!Object.hasOwn(e.allowedDependencies,t)?"undeclared":e.allowedDependencies[t].includes(n)?"allowed":"forbidden"}function Wn(e,t,n){let i=[...e].sort(),r=new Set(i),o=t.filter(a=>r.has(a.from)&&r.has(a.to)),s=Math.min(...o.map(a=>a.fileEdgeCount));return{boundaries:i,internalEdges:o,narrowestEdges:o.filter(a=>a.fileEdgeCount===s),violatesPolicy:n}}function _n(e,t,n=Xn,i=!1,r=()=>"directory"){let o=[];for(let[s,a]of t){let l=r(s)==="file"?u=>u:Qn,c=[...a].filter(u=>!n(u));if(c.length<2)continue;let{edges:d,subGraph:f}=Hn(e,c,l);for(let u of Gn(s,i,d,f))o.push(u)}return o.sort((s,a)=>a.subUnits.length-s.subUnits.length||s.boundary.localeCompare(a.boundary))}function Hn(e,t,n){let i=new Set(t),r=new Map,o=new Map;for(let s of t)o.set(n(s),new Set);for(let s of t)for(let a of e.get(s)??[]){if(!i.has(a))continue;let l=n(s),c=n(a);if(l===c)continue;let d=K(l,c),f=r.get(d);f||(f={from:l,to:c,fileEdges:[]},r.set(d,f)),f.fileEdges.push({fromFile:s,toFile:a}),o.get(l).add(c)}return{edges:r,subGraph:o}}function Gn(e,t,n,i){let r=[],{components:o}=Q(i);for(let s of o){if(s.length<2)continue;let a=new Set(s),l=[...n.values()].filter(d=>a.has(d.from)&&a.has(d.to)).map(d=>({from:d.from,to:d.to,fileEdgeCount:d.fileEdges.length,examples:d.fileEdges.slice(0,5)})).sort((d,f)=>d.from.localeCompare(f.from)||d.to.localeCompare(f.to)),c=Math.min(...l.map(d=>d.fileEdgeCount));r.push({boundary:e,violatesPolicy:t,subUnits:[...s].sort(),internalEdges:l,narrowestEdges:l.filter(d=>d.fileEdgeCount===c)})}return r}function Vn(e,t,n){let i=new Set(t.map(a=>K(a.from,a.to))),r=e.allowedDependencies??{},o=new Set(e.boundaries.map(a=>a.name)),s=[];for(let[a,l]of Object.entries(r))if(n.get(a)?.size)for(let c of l)!o.has(c)||i.has(K(a,c))||s.push({from:a,to:c});return s.sort((a,l)=>a.from.localeCompare(l.from)||a.to.localeCompare(l.to))}function Jn(e,t,n){let i=[],r=new Map;for(let o of t)r.set(o.from,(r.get(o.from)??0)+1);for(let o of e.boundaries){Xe(i,o.name,"fan-out",r.get(o.name)??0,e.maxBoundaryFanOut);let s=o.maxFiles??e.maxBoundaryFiles;Xe(i,o.name,"files",n.get(o.name)?.size??0,s)}return i.sort((o,s)=>o.boundary.localeCompare(s.boundary)||o.kind.localeCompare(s.kind))}function Xn(e){let t=U(e);return t==="test"||t==="entry"}function Qn(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function K(e,t){return`${e}\0${t}`}function Yn(e,t){return e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}function Zn(e,t){let n=new Set(Qe(e,[]).filter(o=>U(o)==="test"||/(^|\/)(fixtures|benchmarks)(\/|$)/.test(o)||(t?.testPaths??[]).some(s=>_(s,o)))),i=new Map,r=0;for(let[o,s]of e){let a=new Set;for(let l of s)n.has(o)||n.has(l)?r++:a.add(l);i.set(o,a)}return{graph:i,excludedTestEdges:r}}function Je(e,t,n){let i=new Map;for(let[r,o]of e){let s=t.get(r);if(s)for(let a of o){let l=t.get(a);if(!l||s===l)continue;let c=K(s,l),d=i.get(c);d||(d={from:s,to:l,fileEdges:[],importers:new Set,importedFiles:new Set},i.set(c,d)),d.fileEdges.push({fromFile:r,toFile:a}),d.importers.add(r),d.importedFiles.add(a)}}return[...i.values()].map(r=>zn(r,n)).sort(Yn)}function Xe(e,t,n,i,r){r!==void 0&&i>r&&e.push({boundary:t,kind:n,observed:i,limit:r})}export{Q as a,_ as b,Ai as c,Rn as d,Ui as e,_i as f,si as g,Ci as h};
3
+ //# sourceMappingURL=chunk-BOZ4EXBB.js.map
@@ -0,0 +1,2 @@
1
+ import{a as de}from"./chunk-NOWINRRN.js";import{a as le,b as ce,c as ue}from"./chunk-N2WN6I3L.js";import{b as ae}from"./chunk-6LSEIIF7.js";import{a as se}from"./chunk-BGBBVSH4.js";import{b as q}from"./chunk-KZBJWZJB.js";import{b as oe}from"./chunk-FMRN2TRL.js";import{a as v}from"./chunk-72AD6ZRR.js";import{d as ie,x as re}from"./chunk-5D2LVK7O.js";import{g as ne}from"./chunk-A2IIGFMJ.js";var Be=10,Ue=4,Ae=3,Q=5,Ie=.5,pe=80,Ke=3,D=new Set(["statement","predicate","return","throw"]),B=/^use[A-Z0-9_]/u,je=/^use(?:[A-Z0-9_]\w*)?Effect$/u,ze=/(?:^|\/)(?:scripts?|bin|tools?|tooling|migrations?|integration-tests?|e2e)\//u,Te=new Set(["get","has","at","find","findLast","findIndex","findLastIndex","includes","indexOf","lastIndexOf","keys","values","entries","forEach","map","filter","flatMap","reduce","reduceRight","some","every","slice","concat","join","toString","toJSON","toSorted","toReversed","toSpliced","with","startsWith","endsWith","match","matchAll","test","exec","search","localeCompare","trim","trimStart","trimEnd","split","replace","replaceAll","toLowerCase","toUpperCase","padStart","padEnd","charAt","charCodeAt","codePointAt","substring","repeat","normalize","isArray","from","of","assign","freeze","hasOwn","getOwnPropertyNames","stringify","parse","toFixed","toISOString","getTime","valueOf","then","catch","finally","size","length"]),fe=new Set(["map","filter","flatMap","slice","concat","keys","values","entries","from","of","toSorted","toReversed","toSpliced","with","join","reduce","reduceRight","some","every","includes","has","indexOf","lastIndexOf","findIndex","size","length","toString","toJSON","then","catch","finally","trim","split","replace","replaceAll","toLowerCase","toUpperCase","startsWith","endsWith","match","test","exec","localeCompare","padStart","padEnd","charAt","charCodeAt","codePointAt","substring","repeat","normalize"]);function Mn(e,t={}){let{scope:n,symbol:i,minLoc:r=12,minStatements:o,minClusterUnits:s,limit:a=20,scanLimit:u,onProgress:l}=t,p={files:new Map},d={minStatements:o,minClusterUnits:s,detail:t.detail??i!==void 0};if(i){let g=We(e,i);if(!g)return[];let h=ye(e,g,d,p);return h?[h]:[]}let S=new ae(e);return de({candidates:()=>S.productionCallableDefinitions({scope:n,minLoc:r,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:u,orderScanned:(g,h)=>g.relativePath.localeCompare(h.relativePath)||g.startLine-h.startLine,filterCandidate:g=>q(g.relativePath)&&!ne(e,g.relativePath,g.startLine,"extract"),profile:{name:"slice-cohesion"},onProgress:l,onProfile:t.onProfile,evaluate:g=>{let h=ye(e,g,d,p);return h?.splitCandidate?h:null},orderResults:_e,limit:a})}function _e(e,t){return me(e.actionTier)-me(t.actionTier)||Number(e.operational)-Number(t.operational)||Se(e.archetype)-Se(t.archetype)||he(e)-he(t)||ge(t)-ge(e)||t.separableStatements-e.separableStatements||t.loc-e.loc}function me(e){return e==="signal"?0:1}function Se(e){switch(e){case"calculation":return 0;case"react-hook":return 1;case"react-component":return 2;case"orchestration":return 3}}function he(e){let t=new Set(e.clusters.filter(n=>n.role==="extraction").map(n=>n.kind));return t.has("calculation")?0:t.has("operation")||t.has("hook")?1:2}function ge(e){return e.clusters.filter(t=>t.role==="extraction"&&t.narrow).reduce((t,n)=>t+n.units.length,0)}function We(e,t){let n=oe(e,t);if(n.candidates.length>0)throw new Error(`Ambiguous symbol: ${t}. Use an exact SCIP symbol or file:line.`);let i=n.match;if(!i)return null;let r=re(e,i.relativePath);return r.find(o=>o.symbolId===i.symbolId)??r.find(o=>o.symbol===i.symbol)??null}function ye(e,t,n={},i={files:new Map}){let r={minStatements:n.minStatements??Be,minClusterUnits:n.minClusterUnits??Ue},o=n.detail??!0,s=He(e,t,i);if(!s)return null;let{ts:a,sourceFile:u,callable:l,flow:p}=s,d=Ze(a,u,l,t.relativePath),S=gt(d,p,t.relativePath),g=At(d,S),h=d.units.filter(w=>D.has(w.kind)).map(w=>w.index),m=new Set(h),C=Ve(d,S,g,m),M=C.filter(w=>!w.guard),k=qt(M,h.length),L=new Set(C.flatMap(w=>w.units)),{clusters:f,preamble:b}=qe(M,L,d,S,r),c=new Set(f.flatMap(w=>w.outputs)),y=M.filter(w=>!c.has(w.id)).map(w=>w.id),T=new Set(C.flatMap(w=>w.fullSlice??[])),E=h.filter(w=>!T.has(w)&&!L.has(w)&&d.units[w].kind==="statement"),X=f.filter(w=>w.role==="extraction"),Pe=X.reduce((w,V)=>w+V.units.length,0),_=h.length>=r.minStatements&&X.length>=1,$e=[...p.coverage.unsupported],W={status:p.coverage.status==="complete"&&S.candidateEdges===0?"complete":"partial",model:"function-local-flow",basis:"typescript-local-flow-backward-slices",unsupported:$e,candidateEdges:S.candidateEdges,candidateEdgeEffect:"merge-only"},H=nn(d,M),Y=rn(_,H,f,W),De=C.filter(w=>w.guard).length,ee={body:d,flow:S,thresholds:r,archetype:H,clusters:f,preamble:b,orphans:E,guards:De,coverage:W},Re=o?C:C.map(({slice:w,fullSlice:V,...te})=>te);return{symbol:t.symbol,shortName:ie(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:se(t),archetype:H,operational:ze.test(t.relativePath),...o?{units:d.units.map(({node:w,start:V,end:te,...Oe})=>Oe)}:{},statementCount:h.length,outputs:Re,metrics:k,clusters:f,preambleOnlyOutputs:y,preamble:b,orphans:E,separableStatements:Pe,splitCandidate:_,actionTier:Y.tier,tierReason:Y.reason,evidenceReasons:on(h.length,C,k,ee),recommendation:sn(_,M,k,ee),coverage:W}}function He(e,t,n){if(!q(t.relativePath))return null;let i=le();if(!i)return null;let r=Ge(e,t.relativePath,n);if(!r)return null;let o=Qe(i,r,t);if(!o)return null;let s=ce(e,t.relativePath,t.startLine,t.endLine);return!s||s.coverage.status==="unsupported"?null:{ts:i,sourceFile:r,callable:o,flow:s}}function Ve(e,t,n,i){let r=l=>{let p=[],d=new Set,S=[...t.controlDeps[l]];for(;S.length>0;){let g=S.pop();d.has(g)||(d.add(g),e.guardPredicates.has(g)?S.push(...t.controlDeps[g]):p.push(g))}return p},o=l=>e.handlerDeps.get(l)??[],s=l=>[...t.dataDeps[l],...r(l),...o(l)],a=l=>[...t.dataDeps[l],...t.controlDeps[l],...o(l)],u=n.map(l=>{let p=Ht(l,t),d=[...be(p,s)].filter(h=>i.has(h)),S=[...be(p,a)].filter(h=>i.has(h)),g=e.guardUnits.has(l.unit)||(l.kind==="throw"||l.kind==="return")&&l.seedPoints===null&&d.every(h=>h===l.unit);return{seed:l,guard:g,slice:new Set(d),fullSlice:new Set(S)}});return Vt(u)}function qe(e,t,n,i,r){let o=new Set(Gt(e,t,n,i)),s=Ce(e,o,n,i,r);for(;;){let u=new Map;s.forEach((p,d)=>p.outputs.forEach(S=>u.set(S,d)));let l=[...o].filter(p=>{let d=new Set;for(let S of e){let g=u.get(S.id);g!==void 0&&j(S).includes(p)&&d.add(g)}return d.size<=1});if(l.length===0)break;for(let p of l)o.delete(p);s=Ce(e,o,n,i,r)}let a=[...o].sort(P);return{clusters:s,preamble:a}}function j(e){return e.slice??[]}function P(e,t){return e-t}function Ge(e,t,n){let i=n.files.get(t);if(i!==void 0)return i;let r=ue(e,t);return n.files.set(t,r),r}function Qe(e,t,n){let i=null,r=o=>{if(i)return;let s=t.getLineAndCharacterOfPosition(o.getStart(t)).line,a=t.getLineAndCharacterOfPosition(o.getEnd()).line;if(!(a<n.startLine||s>n.endLine)){if(e.isFunctionLike(o)&&"body"in o&&o.body!==void 0&&s>=n.startLine&&a<=n.endLine){i=o;return}o.forEachChild(r)}};return t.forEachChild(r),i}function Je(e,t){return e.isReturnStatement(t)?"return":e.isThrowStatement(t)?"throw":e.isBreakOrContinueStatement(t)?"jump":e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isInterfaceDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isEnumDeclaration(t)?"declaration":e.isEmptyStatement(t)?null:"statement"}function Ze(e,t,n,i){let{units:r,guardPredicates:o,guardUnits:s,enclosingPredicates:a,awaitUnits:u,handlerDeps:l}=Xe(e,t,n),{paramNames:p,localNames:d,calleeSpans:S,closureNodes:g,containers:h,aliases:m,stateSetters:C}=Ye(e,t,n),M=[];for(let c=n.parent;c;c=c.parent)e.isFunctionLike(c)&&M.push({start:c.getStart(t),end:c.getEnd()});let k=new Map;for(let c of r){if(!D.has(c.kind))continue;let y=rt(e,c.node);y.length>0&&k.set(c.index,y)}let L=n.name&&"text"in n.name?String(n.name.text):"",f=k.size>0&&(/\.[jt]sx$/iu.test(i)||B.test(L)),b={ts:e,sourceFile:t,callable:n,units:r,paramNames:p,localNames:d,guardPredicates:o,guardUnits:s,enclosingPredicates:a,awaitUnits:u,calleeSpans:S,closures:new Map,containers:h,aliases:m,enclosingRanges:M,handlerDeps:l,stateSetters:C,hookCalls:k,react:f};return b.closures=pt(b,g),b}function Xe(e,t,n){let i=[],r=new Set,o=new Set,s=[],a=new Map,u=[],l=n.body,p=(c,y)=>{let T=y.getStart(t),E=y.getEnd();i.push({index:0,kind:c,node:y,start:T,end:E,startLine:t.getLineAndCharacterOfPosition(T).line,endLine:t.getLineAndCharacterOfPosition(E).line,label:dt(t,y)}),a.set(y,[...s])},d=(c,y)=>{s.push(c),y(),s.pop()},S=c=>{p("predicate",c.expression);let y=!c.elseStatement&&lt(e,c.thenStatement,ct(e,c));y&&r.add(c.expression);let T=i.length;d(c.expression,()=>{if(m(c.thenStatement),y)for(let E of i.slice(T))o.add(E.node);c.elseStatement&&m(c.elseStatement)})},g=c=>{let y=i.length;m(c.tryBlock);let T=i.length;c.catchClause&&(c.catchClause.variableDeclaration&&p("statement",c.catchClause.variableDeclaration),m(c.catchClause.block)),c.finallyBlock&&m(c.finallyBlock),u.push({tryNodes:i.slice(y,T).map(E=>E.node),handlerNodes:i.slice(T).map(E=>E.node)})},h=c=>{if(e.isWhileStatement(c)||e.isDoStatement(c))return p("predicate",c.expression),d(c.expression,()=>m(c.statement)),!0;if(e.isForStatement(c)){c.initializer&&p("statement",c.initializer),c.condition&&p("predicate",c.condition);let y=c.condition??c;return d(y,()=>{c.incrementor&&p("statement",c.incrementor),m(c.statement)}),!0}return e.isForInStatement(c)||e.isForOfStatement(c)?(p("predicate",c.expression),d(c.expression,()=>{p("statement",c.initializer),m(c.statement)}),!0):!1},m=c=>{if(e.isBlock(c)){for(let T of c.statements)m(T);return}if(e.isIfStatement(c)){S(c);return}if(h(c))return;if(e.isSwitchStatement(c)){p("predicate",c.expression),d(c.expression,()=>{for(let T of c.caseBlock.clauses)for(let E of T.statements)m(E)});return}if(e.isTryStatement(c)){g(c);return}if(e.isLabeledStatement(c)){m(c.statement);return}let y=Je(e,c);y&&p(y,c)};if(e.isBlock(l))for(let c of l.statements)m(c);else p("return",l);i.sort((c,y)=>c.start-y.start);let C=new Map;i.forEach((c,y)=>{c.index=y,C.set(c.node,y)});let M=new Set(i.filter(c=>r.has(c.node)).map(c=>c.index)),k=new Set(i.filter(c=>o.has(c.node)).map(c=>c.index)),L=i.map(c=>(a.get(c.node)??[]).map(y=>C.get(y)).filter(y=>y!==void 0)),f=new Set(i.filter(c=>D.has(c.kind)&&ut(e,c.node)).map(c=>c.index)),b=new Map;for(let c of u){let y=c.tryNodes.map(T=>C.get(T)).filter(T=>D.has(i[T].kind));for(let T of c.handlerNodes){let E=C.get(T);b.set(E,[...b.get(E)??[],...y])}}return{units:i,guardPredicates:M,guardUnits:k,enclosingPredicates:L,awaitUnits:f,handlerDeps:b}}function Ye(e,t,n){let i=n.body,r=new Set;for(let f of n.parameters)for(let b of v(f.name))r.add(b);let o=new Set,s=new Set,a=new Map,u=new Set,l=new Map,p=new Map,d=(f,b)=>{if(!b||b===f)return;let c=l.get(f)??new Set;c.add(b),l.set(f,c)},S=(f,b)=>{for(let c of F(e,b))for(let y of f)d(y,c)},g=(f,b)=>{let c=x(e,b);if(I(e,c)){for(let y of f)u.add(y);return}S(f,c)},h=f=>{let b=v(f.name);for(let E of b)o.add(E);let c=f.initializer?x(e,f.initializer):null,y=c?tt(e,c):null;if(y&&e.isIdentifier(f.name)){a.set(f.name.text,y);return}if(f.initializer){g(b,f.initializer);let E=nt(e,f);E&&p.set(E.setter,E.state);return}let T=st(e,f);T&&S(b,x(e,T))},m=f=>{let b=x(e,f.left),c=x(e,f.right);e.isIdentifier(b)?g([b.text],f.right):e.isIdentifier(c)&&d(c.text,N(e,b))},C=f=>{let b=x(e,f.expression);if(!e.isPropertyAccessExpression(b)&&!e.isElementAccessExpression(b)||e.isPropertyAccessExpression(b)&&Te.has(b.name.text))return;let c=N(e,b);for(let y of f.arguments){let T=x(e,y);e.isIdentifier(T)&&d(T.text,c)}},M=f=>{if(e.isParameter(f)&&f.parent!==n)for(let b of v(f.name))o.add(b);else if(e.isFunctionDeclaration(f)||e.isClassDeclaration(f))et(e,f,o,a);else if(e.isCatchClause(f)&&f.variableDeclaration)for(let b of v(f.variableDeclaration.name))o.add(b)},k=f=>{e.isCallExpression(f)||e.isNewExpression(f)?s.add(`${f.expression.getStart(t)}:${f.expression.getEnd()}`):e.isTaggedTemplateExpression(f)&&s.add(`${f.tag.getStart(t)}:${f.tag.getEnd()}`)},L=f=>{e.isVariableDeclaration(f)?h(f):e.isBinaryExpression(f)&&f.operatorToken.kind===e.SyntaxKind.EqualsToken?m(f):e.isCallExpression(f)?C(f):M(f),k(f),f.forEachChild(L)};return L(i),{paramNames:r,localNames:o,calleeSpans:s,closureNodes:a,containers:u,aliases:l,stateSetters:p}}function et(e,t,n,i){t.name&&(n.add(t.name.text),e.isFunctionDeclaration(t)&&t.body&&i.set(t.name.text,t))}function tt(e,t){if(e.isArrowFunction(t)||e.isFunctionExpression(t))return t;if(e.isCallExpression(t)&&U(e,x(e,t.expression))==="useCallback"&&t.arguments.length>0){let i=x(e,t.arguments[0]);if(e.isArrowFunction(i)||e.isFunctionExpression(i))return i}return null}function nt(e,t){if(!e.isArrayBindingPattern(t.name)||!t.initializer)return null;let n=x(e,t.initializer);if(!e.isCallExpression(n))return null;let i=U(e,x(e,n.expression));return!i||!B.test(i)?null:it(e,t.name)}function it(e,t){let[n,i]=t.elements;return!n||!i||e.isOmittedExpression(n)||e.isOmittedExpression(i)||!e.isIdentifier(n.name)||!e.isIdentifier(i.name)?null:{state:n.name.text,setter:i.name.text}}function U(e,t){return e.isIdentifier(t)?t.text:e.isPropertyAccessExpression(t)?t.name.text:null}function rt(e,t){let n=[],i=r=>{if(!e.isFunctionLike(r)){if(e.isCallExpression(r)){let o=U(e,x(e,r.expression));o&&B.test(o)&&n.push(o)}r.forEachChild(i)}};return i(t),n}function I(e,t){if(e.isArrayLiteralExpression(t)||e.isObjectLiteralExpression(t)||e.isNewExpression(t))return!0;if(e.isBinaryExpression(t)){let n=t.operatorToken.kind;if(n===e.SyntaxKind.QuestionQuestionToken||n===e.SyntaxKind.BarBarToken)return I(e,x(e,t.right))}return e.isConditionalExpression(t)?I(e,x(e,t.whenTrue))||I(e,x(e,t.whenFalse)):!1}function F(e,t){let n=x(e,t);if(e.isIdentifier(n))return[n.text];if(n.kind===e.SyntaxKind.ThisKeyword)return["this"];if(e.isBinaryExpression(n)){let i=n.operatorToken.kind;return i===e.SyntaxKind.QuestionQuestionToken||i===e.SyntaxKind.BarBarToken?[...F(e,n.left),...F(e,n.right)]:[]}return e.isConditionalExpression(n)?[...F(e,n.whenTrue),...F(e,n.whenFalse)]:ot(e,n)}function ot(e,t){if(e.isPropertyAccessExpression(t))return fe.has(t.name.text)?[]:F(e,t.expression);if(e.isElementAccessExpression(t))return F(e,t.expression);if(e.isCallExpression(t)){let n=x(e,t.expression);return e.isPropertyAccessExpression(n)?fe.has(n.name.text)?[]:F(e,n.expression):[]}return[]}function st(e,t){let n=t.parent;if(!n||!e.isVariableDeclarationList(n))return null;let i=n.parent;return i&&(e.isForOfStatement(i)||e.isForInStatement(i))&&i.initializer===n?i.expression:null}function at(e,t){let n=new Set([t]),i=[t];for(;i.length>0;){let r=i.pop();if(A(e,r))for(let o of e.aliases.get(r)??[])n.has(o)||(n.add(o),i.push(o))}return n}function lt(e,t,n){let i=e.isBlock(t)?t.statements:[t];if(i.length===0)return!1;let r=i[i.length-1];if(!e.isReturnStatement(r)&&!e.isThrowStatement(r))return!1;let o=new Set(n);if(!un(e,i.slice(0,-1),o))return!1;if(!e.isReturnStatement(r)||!r.expression)return!0;let s=!1,a=u=>{s||(e.isIdentifier(u)&&Ee(e,u)&&o.has(u.text)?s=!0:u.forEachChild(a))};return a(r.expression),!s}function ct(e,t){let n=new Set;for(let i=t.parent;i&&!e.isFunctionLike(i);i=i.parent){if(!e.isIterationStatement(i,!1))continue;let r=o=>{if(e.isVariableDeclaration(o))for(let s of v(o.name))n.add(s);o.forEachChild(r)};r(i)}return n}function ut(e,t){let n=!1,i=r=>{if(!(n||e.isFunctionLike(r)&&r!==t)){if(e.isAwaitExpression(r)||e.isForOfStatement(r)&&r.awaitModifier!==void 0){n=!0;return}r.forEachChild(i)}};return i(t),n}function dt(e,t){let n=t.getText(e).replace(/\s+/gu," ").trim();return n.length>pe?`${n.slice(0,pe-3)}...`:n}function pt(e,t){let n=new Map;for(let[r,o]of t)n.set(r,mt(e,o,t));let i=!0;for(;i;){i=!1;for(let r of n.values())ht(r,n)&&(i=!0)}return n}function ft(e,t){let n=new Set;for(let r of t.parameters)for(let o of v(r.name))n.add(o);let i=r=>{if(e.isVariableDeclaration(r)||e.isParameter(r))for(let o of v(r.name))n.add(o);else(e.isFunctionDeclaration(r)||e.isClassDeclaration(r))&&r.name&&n.add(r.name.text);r.forEachChild(i)};return t.body&&i(t.body),n}function mt(e,t,n){let{ts:i}=e,r=ft(i,t),o={reads:new Set,writes:new Set,stateWrites:new Set,calls:new Set},s=a=>{if(i.isTypeNode(a))return;let u=J(e,a);u&&!r.has(u)&&o.writes.add(u),i.isCallExpression(a)&&St(e,a,r,n,o),i.isIdentifier(a)&&Ee(i,a)&&!r.has(a.text)&&o.reads.add(a.text),a.kind===i.SyntaxKind.ThisKeyword&&o.reads.add("this"),a.forEachChild(s)};return t.body&&s(t.body),o}function St(e,t,n,i,r){let o=x(e.ts,t.expression);if(!e.ts.isIdentifier(o)||n.has(o.text))return;i.has(o.text)&&r.calls.add(o.text);let s=e.stateSetters.get(o.text);s&&r.stateWrites.add(s)}function ht(e,t){let n=!1;for(let i of e.calls){let r=t.get(i);r&&(G(r.reads,e.reads)&&(n=!0),G(r.writes,e.writes)&&(n=!0),G(r.stateWrites,e.stateWrites)&&(n=!0))}return n}function G(e,t){let n=!1;for(let i of e)t.has(i)||(t.add(i),n=!0);return n}function Ee(e,t){let n=t.parent;return!(!n||dn(e,t,n)||e.isLabeledStatement(n)||e.isBreakOrContinueStatement(n))}function gt(e,t,n){let i=yt(e,t),{reachedUses:r,...o}=bt(e,t,i),s=Ct(e,i,r,o.paramReads,n),a=Ft(e);return Et(e.units,i,a,o),{...i,...o,...s,writesByUnit:a.byUnit,stateWritesByUnit:a.stateWritesByUnit}}function yt(e,t){let{units:n}=e,i=e.callable.getStart(e.sourceFile),r=e.callable.getEnd(),o=e.callable.body.getStart(e.sourceFile),s=new Map,a=new Map;for(let u of t.points){if(u.start<i||u.end>r)continue;if(s.set(u.id,u),u.start<o){a.set(u.id,-1);continue}let l=kt(n,u.start);l!==null&&a.set(u.id,l)}return{pointById:s,unitOfPoint:a}}function Me(e,t,n){let i=e.get(t);i||(i=new Set,e.set(t,i)),i.add(n)}function bt(e,t,n){let{units:i}=e,r=i.map(()=>new Set),o=i.map(()=>new Set),s=new Map,a=i.map(()=>new Set),l={dataDeps:r,controlDeps:o,pointDeps:s,paramReads:a,candidateEdges:0,reachedUses:new Set};for(let p of t.edges){let d=xt(n,p);d&&wt(p,d,l)}return e.enclosingPredicates.forEach((p,d)=>{for(let S of p)S!==d&&o[d].add(S)}),l}function xt(e,t){let{pointById:n,unitOfPoint:i}=e,r=n.get(t.fromPointId),o=n.get(t.toPointId);if(!r||!o)return null;let s=i.get(r.id),a=i.get(o.id);return s===void 0||a===void 0||a===-1?null:{from:r,to:o,fromUnit:s,toUnit:a}}function wt(e,t,n){let{from:i,to:r,fromUnit:o,toUnit:s}=t,{reachedUses:a,paramReads:u,controlDeps:l,dataDeps:p,pointDeps:d}=n;if(e.kind!=="control-dependence"&&a.add(r.id),o===-1){e.kind!=="control-dependence"&&u[s].add(z(i.name));return}o!==s&&(e.strength==="candidate"&&(n.candidateEdges+=1),e.kind==="control-dependence"?l[s].add(o):(p[s].add(o),Me(d,r.id,o)))}function Ct(e,t,n,i,r){let{units:o}=e,{pointById:s,unitOfPoint:a}=t,u=o.map(()=>new Set),l=o.map(()=>new Set),p=new Map;for(let d of s.values()){let S=a.get(d.id);if(S===void 0||S===-1)continue;if(d.kind==="definition"){mn(d,S,l,p);continue}if(d.kind!=="use"||n.has(d.id))continue;let g=Tt(e,d,r);if(!g)continue;(g.kind==="parameter"?i:u)[S].add(g.name)}return{definitionsByUnitName:p,outerReads:u,definedNames:l}}function Tt(e,t,n){if(e.calleeSpans.has(`${t.start}:${t.end}`)||t.name.includes("("))return null;let i=z(t.name);return e.paramNames.has(i)?{kind:"parameter",name:i}:e.localNames.has(i)?null:i==="this"||vt(t.symbolKey,n,e.enclosingRanges)?{kind:"outer",name:i}:null}function Et(e,t,n,i){let{writes:r,reads:o}=n,{dataDeps:s,pointDeps:a}=i,u=Mt(t);for(let l of r){let p=e[l.unit].start;for(let d of u.get(l.base)??[])d.unit===l.unit||d.start<=p||(s[d.unit].add(l.unit),Me(a,d.id,l.unit));Sn(e,l,o,p,s)}}function Mt(e){let{pointById:t,unitOfPoint:n}=e,i=new Map;for(let r of t.values()){if(r.kind!=="use")continue;let o=n.get(r.id);if(o===void 0||o===-1)continue;let s=z(r.name),a=i.get(s)??[];a.push({id:r.id,start:r.start,unit:o}),i.set(s,a)}return i}function kt(e,t){let n=0,i=e.length-1,r=-1;for(;n<=i;){let o=n+i>>1;e[o].start<=t?(r=o,n=o+1):i=o-1}return r<0?null:t<e[r].end?r:null}function z(e){let t=e.search(/[.[?!(]/u);return t<0?e:e.slice(0,t)}function Lt(e){if(!e)return null;let t=e.split(":");if(t.length<4)return null;let n=Number(t[2]);if(!Number.isSafeInteger(n))return null;try{return{fileName:decodeURIComponent(t[1]).replace(/\\/gu,"/"),offset:n}}catch{return null}}function ke(e,t,n,i){let r=Lt(e);return r?r.fileName.endsWith(t.replace(/\\/gu,"/"))&&r.offset>=n&&r.offset<i:!1}function vt(e,t,n){return n.some(i=>ke(e,t,i.start,i.end))}function Ft(e){let t=[],n=[],i=new Map,r=new Map,o=(s,a,u)=>{let l=i.get(s);l||(l={local:new Set,external:new Set},i.set(s,l));let p=u?at(e,a):new Set([a]);for(let d of p)A(e,d)?(l.local.add(d),t.push({unit:s,base:d})):(u||d!==a)&&(l.external.add(d),u&&(d==="this"||e.paramNames.has(d))&&t.push({unit:s,base:d}))};for(let s of e.units)D.has(s.kind)&&Nt(e,s,o,n,r);return{writes:t,reads:n,byUnit:i,stateWritesByUnit:r}}function Nt(e,t,n,i,r){let{ts:o}=e,s=Le(o,t.node);if(s){let u=J(e,s);u&&n(t.index,u,Rt(e,s))}for(let u of Bt(e,t.node)){for(let l of u.writes)n(t.index,l,!0);for(let l of u.reads)A(e,l)&&i.push({unit:t.index,base:l})}for(let u of Ot(e,t.node))n(t.index,u,!0);let a=Pt(e,t.node);if(a.length>0){r.set(t.index,a);for(let u of a)n(t.index,u,!0)}}function Pt(e,t){let{ts:n}=e,i=new Set,r=(o,s)=>{if(!(n.isFunctionLike(o)&&o!==t&&!s)){if(n.isCallExpression(o)){let a=x(n,o.expression);$t(e,a,i);let u=U(n,a);if(u&&je.test(u)){Dt(n,o,s,r);return}}o.forEachChild(a=>r(a,s))}};return r(t,!1),[...i]}function $t(e,t,n){let{ts:i}=e;if(i.isIdentifier(t)){let r=e.stateSetters.get(t.text);r&&n.add(r);let o=e.closures.get(t.text);if(o)for(let s of o.stateWrites)n.add(s)}}function Dt(e,t,n,i){for(let r of t.arguments){let o=x(e,r);(e.isArrowFunction(o)||e.isFunctionExpression(o))&&o.body?i(o.body,!0):i(r,n)}}function Rt(e,t){let{ts:n}=e;if(n.isCallExpression(t)||n.isDeleteExpression(t))return!0;let i=n.isBinaryExpression(t)?t.left:n.isPrefixUnaryExpression(t)||n.isPostfixUnaryExpression(t)?t.operand:null;return i!==null&&!n.isIdentifier(x(n,i))}function Ot(e,t){let{ts:n}=e,i=[],r=o=>{if(n.isCallExpression(o)||n.isNewExpression(o))for(let s of o.arguments??[]){let a=x(n,s);n.isIdentifier(a)&&e.containers.has(a.text)&&i.push(a.text)}o.forEachChild(r)};return r(t),i}function Bt(e,t){let{ts:n}=e,i=[],r=o=>{if(n.isCallExpression(o)){let s=x(n,o.expression);if(n.isIdentifier(s)){let a=e.closures.get(s.text);a&&i.push(a)}}o.forEachChild(r)};return r(t),i}function Le(e,t){let n=e.isExpressionStatement(t)?t.expression:e.isExpression(t)?t:null;return n?x(e,n):null}function x(e,t){let n=t;for(;;)if(e.isParenthesizedExpression(n)||e.isAwaitExpression(n)||e.isVoidExpression(n))n=n.expression;else if(e.isAsExpression(n)||e.isSatisfiesExpression(n)||e.isNonNullExpression(n)||e.isTypeAssertionExpression(n))n=n.expression;else return n}function J(e,t){let{ts:n}=e;return n.isBinaryExpression(t)&&Ut(n,t.operatorToken.kind)?N(n,t.left):n.isPrefixUnaryExpression(t)||n.isPostfixUnaryExpression(t)?t.operator===n.SyntaxKind.PlusPlusToken||t.operator===n.SyntaxKind.MinusMinusToken?N(n,t.operand):null:n.isDeleteExpression(t)?N(n,t.expression):n.isCallExpression(t)?pn(n,t):null}function Ut(e,t){return t>=e.SyntaxKind.FirstAssignment&&t<=e.SyntaxKind.LastAssignment}function N(e,t){let n=x(e,t);for(;;)if(e.isPropertyAccessExpression(n)||e.isElementAccessExpression(n))n=x(e,n.expression);else{if(e.isIdentifier(n))return n.text;if(n.kind===e.SyntaxKind.ThisKeyword)return"this";if(e.isCallExpression(n))n=x(e,n.expression);else return null}}function A(e,t){return t!=="this"&&!e.paramNames.has(t)&&e.localNames.has(t)}function At(e,t){let n=[],i=[...t.pointById.values()].filter(r=>r.kind==="use");for(let r of e.units)if(r.kind==="return")n.push(...It(e,r,i));else if(r.kind==="throw")n.push({id:`throw@${r.startLine+1}`,kind:"throw",label:r.label,line:r.startLine,unit:r.index,group:`throw@${r.startLine+1}`,hook:!1,seedPoints:null});else if(r.kind==="statement"){let o=Kt(e,t,r);o&&n.push(o)}return n}function It(e,t,n){let{ts:i,sourceFile:r}=e,o=t.startLine,s=i.isReturnStatement(t.node)?t.node.expression:t.node;if(!s)return[];let a=x(i,s);return i.isObjectLiteralExpression(a)&&a.properties.length>=2?a.properties.map(u=>{let l=Wt(i,r,u),p=u.getStart(r),d=u.getEnd();return{id:`return.${l}@${o+1}`,kind:"return-property",label:`return.${l}`,line:o,unit:t.index,group:`return.${l}`,hook:!1,seedPoints:n.filter(S=>S.start>=p&&S.end<=d)}}):[{id:`return@${o+1}`,kind:"return",label:"return",line:o,unit:t.index,group:"return",hook:!1,seedPoints:null}]}function ve(e,t){return{id:`write:${t}@${e.startLine+1}`,kind:"mutation",label:e.label,line:e.startLine,unit:e.index,group:`write:${t}@${e.startLine+1}`,hook:!1,seedPoints:null}}function Kt(e,t,n){let{ts:i}=e,r=Le(i,n.node);if(!r)return null;let o=J(e,r),s=t.writesByUnit.get(n.index);if(o!==null&&A(e,o)){let a=s?[...s.external]:[];return a.length>0?ve(n,a[0]):null}return i.isCallExpression(r)||i.isNewExpression(r)||i.isTaggedTemplateExpression(r)?zt(e,n,r,o,s):jt(e,n,r,o,t)}function jt(e,t,n,i,r){return i===null||i!=="this"&&!e.paramNames.has(i)&&_t(e,n,r,t)?null:ve(t,i)}function zt(e,t,n,i,r){let{ts:o,sourceFile:s}=e,a=o.isTaggedTemplateExpression(n)?n.tag:x(o,n.expression);if(i===null&&fn(e,a,r))return null;let u=K(a.getText(s)),l=o.isTaggedTemplateExpression(n)?null:U(o,a);return{id:`call:${u}@${t.startLine+1}`,kind:"effect-call",label:`${u}(\u2026)`,line:t.startLine,unit:t.index,group:`call:${u}@${t.startLine+1}`,hook:l!==null&&B.test(l),seedPoints:null}}function _t(e,t,n,i){let{ts:r}=e,o=r.isBinaryExpression(t)?t.left:r.isPrefixUnaryExpression(t)||r.isPostfixUnaryExpression(t)?t.operand:null;if(!o)return!1;let s=x(r,o);if(!r.isIdentifier(s)||!e.localNames.has(s.text))return!1;let a=n.definitionsByUnitName.get(`${i.index}\0${s.text}`);if(!a)return!0;let u=e.callable.getStart(e.sourceFile),l=e.callable.getEnd();return ke(a.symbolKey,e.sourceFile.fileName,u,l)}function Wt(e,t,n){if(e.isSpreadAssignment(n))return`...${K(n.expression.getText(t))}`;let i=n.name;return i?e.isIdentifier(i)||e.isPrivateIdentifier(i)||e.isStringLiteral(i)||e.isNumericLiteral(i)?i.text:K(i.getText(t)):K(n.getText(t))}function K(e){let t=e.replace(/\s+/gu," ").trim();return t.length>40?`${t.slice(0,37)}...`:t}function Ht(e,t){if(e.seedPoints===null)return[e.unit];let n=new Set;for(let i of e.seedPoints)for(let r of t.pointDeps.get(i.id)??[])n.add(r);return[...n]}function be(e,t){let n=new Set(e),i=[...e];for(;i.length>0;){let r=i.pop();for(let o of t(r))n.has(o)||(n.add(o),i.push(o))}return n}function Vt(e){let t=new Map,n=[];for(let o of e){if(o.guard){n.push(o);continue}let s=t.get(o.seed.group)??[];s.push(o),t.set(o.seed.group,s)}let i=new Map;e.forEach((o,s)=>i.set(o.seed.id,s));let r=[];for(let o of n)r.push({output:xe([o],!0),order:i.get(o.seed.id)});for(let o of t.values())r.push({output:xe(o,!1),order:Math.min(...o.map(s=>i.get(s.seed.id)))});return r.sort((o,s)=>o.order-s.order).map(o=>o.output)}function xe(e,t){let n=[...e].sort((s,a)=>s.seed.line-a.seed.line)[0],i=[...new Set(e.flatMap(s=>[...s.slice]))].sort(P),r=[...new Set(e.flatMap(s=>[...s.fullSlice]))].sort(P),o=[...new Set(e.map(s=>s.seed.unit))].sort(P);return{id:e.length===1?n.seed.id:`${n.seed.label}@${n.seed.line+1}`,kind:n.seed.kind,label:n.seed.label,line:n.seed.line,units:o,guard:t,hook:e.some(s=>s.seed.hook),sliceSize:i.length,fullSliceSize:r.length,slice:i,fullSlice:r}}function qt(e,t){if(e.length===0||t===0)return{tightness:0,fullTightness:0,sliceShare:0,fullSliceShare:0,overlap:0,superglue:0,glue:0};let n=we(e.map(j)),i=we(e.map(s=>s.fullSlice??[])),r=new Map;for(let s of e)for(let a of s.fullSlice??[])r.set(a,(r.get(a)??0)+1);let o=s=>s.reduce((a,u)=>a+u,0)/s.length;return{tightness:R(n.size/t),fullTightness:R(i.size/t),sliceShare:R(o(e.map(s=>s.sliceSize))/t),fullSliceShare:R(o(e.map(s=>s.fullSliceSize))/t),overlap:R(o(e.map(s=>s.sliceSize===0?0:n.size/s.sliceSize))),superglue:i.size,glue:[...r.values()].filter(s=>s>=2).length}}function we(e){if(e.length===0)return new Set;let t=new Set(e[0]);for(let n of e.slice(1)){let i=new Set(n);t=new Set([...t].filter(r=>i.has(r)))}return t}function R(e){return Math.round(e*100)/100}function Gt(e,t,n,i){let r=new Map;for(let l of e)for(let p of j(l))r.set(p,(r.get(p)??0)+1);let o=new Set;for(let l of i.writesByUnit.values())for(let p of l.local)o.add(p);let s=new Set([...r].filter(([l,p])=>p>=2&&!t.has(l)&&n.units[l].kind!=="predicate"&&![...i.definedNames[l]].some(d=>o.has(d))&&[...i.controlDeps[l]].every(d=>n.guardPredicates.has(d))&&(i.dataDeps[l].size===0||p>=e.length*Ie)).map(([l])=>l)),a=new Set,u=!0;for(;u;){u=!1;for(let l of s)a.has(l)||[...i.dataDeps[l]].every(p=>a.has(p))&&(a.add(l),u=!0)}return[...a].sort(P)}function Ce(e,t,n,i,r){let o=e.map(l=>j(l).filter(p=>!t.has(p))),s=Qt(e,o),a=[];for(let l of s.values()){let p=[...new Set(l.flatMap(d=>o[d]))].sort(P);p.length!==0&&a.push(Xt(e,l,p,t,n,i,r))}a.sort((l,p)=>p.units.length-l.units.length||en(l,p));let u=a.find(l=>l.role==="extraction");return u&&(u.role="remainder"),a}function Qt(e,t){let n=e.map((s,a)=>a),i=s=>{for(;n[s]!==s;)n[s]=n[n[s]],s=n[s];return s},r=new Map;t.forEach((s,a)=>{for(let u of s){let l=r.get(u);l===void 0?r.set(u,a):n[i(a)]=i(l)}});let o=new Map;return e.forEach((s,a)=>{let u=i(a),l=o.get(u)??[];l.push(a),o.set(u,l)}),o}function Jt(e,t,n,i){let r=new Set,o=[];for(let s of e){for(let a of i.paramReads[s])r.add(a);for(let a of i.outerReads[s])r.add(a);Zt(i,s,t,r);for(let a of n.hookCalls.get(s)??[])o.push(`${a}@${n.units[s].startLine+1}`)}return{inputs:r,hooks:o}}function Zt(e,t,n,i){for(let r of e.dataDeps[t])if(n.has(r))for(let o of e.definedNames[r])i.add(o)}function Xt(e,t,n,i,r,o,s){let{inputs:a,hooks:u}=Jt(n,i,r,o),l=t.map(h=>e[h]),p=l.every(h=>h.kind==="throw"),d=tn(n.map(h=>r.units[h])),S=d.reduce((h,m)=>h+m.endLine-m.startLine+1,0),g=n.length>=s.minClusterUnits&&!p&&S>=Ae;return{outputs:l.map(h=>h.id),units:n,lineRanges:d,inputs:[...a].sort(),kind:Yt(l,u,n.some(h=>r.awaitUnits.has(h))),role:g?"extraction":"below-threshold",narrow:a.size<=Q,hooks:u,guardOnly:p}}function Yt(e,t,n){if(t.length>0||e.some(o=>o.hook))return"hook";let i=e.some(o=>o.kind==="return"||o.kind==="return-property"),r=n||e.some(o=>o.kind==="effect-call"||o.kind==="mutation");return i?r?"operation":"calculation":"effects"}function en(e,t){return(e.lineRanges[0]?.startLine??0)-(t.lineRanges[0]?.startLine??0)}function tn(e){let t=[];for(let n of[...e].sort((i,r)=>i.startLine-r.startLine)){let i=t[t.length-1];i&&n.startLine<=i.endLine+1?i.endLine=Math.max(i.endLine,n.endLine):t.push({startLine:n.startLine,endLine:n.endLine})}return t}function nn(e,t){let n=Ne(e);return e.react?B.test(n)?"react-hook":"react-component":t.length>=Ke&&t.every(i=>i.kind==="effect-call")?"orchestration":"calculation"}function rn(e,t,n,i){if(!e)return{tier:"support",reason:"No split meets the selected output and statement thresholds."};if(i.status!=="complete")return{tier:"support",reason:`${t==="orchestration"?"Orchestration root: disjoint slices are expected. ":""}Local flow is partial (${Z(i)}), so a dropped dependency could join the clusters; the seam is unproven.`};if(t==="orchestration")return{tier:"support",reason:"The body matches an operation-sequencing pattern; disjoint slices alone do not justify splitting it."};let r=n.filter(s=>s.role==="extraction"),o=r.filter(s=>s.narrow);return o.length===0?{tier:"support",reason:`Local slices are disjoint, but each of the ${r.length} extraction(s) has more than ${Q} observed input names.`}:{tier:"signal",reason:`Local flow model complete; ${o.length} extraction(s) with at most ${Q} observed input names; review captured state and ordering before planning an extraction.`}}function Z(e){return e.unsupported[0]??"candidate dependencies or unsupported constructs present"}function on(e,t,n,i){let{body:r,flow:o,clusters:s,preamble:a,orphans:u,coverage:l}=i,p=t.filter(m=>m.guard).length,d=[`${e} statements, ${t.length-p} value output(s), ${p} guard exit(s); ${i.archetype}`,`tightness ${n.tightness.toFixed(2)} (with guards ${n.fullTightness.toFixed(2)}); overlap ${n.overlap.toFixed(2)}; local model only`];s.filter(m=>m.role!=="below-threshold").forEach((m,C)=>{d.push(`cluster ${C+1} (${m.kind}, ${m.role}): ${m.units.length} statements at ${O(m.lineRanges)} produce ${m.outputs.join(", ")}`+(m.role==="extraction"?m.inputs.length>0?`; takes ${$(m.inputs)}`:"; takes no parameters":""))});let S=s.filter(m=>m.role==="below-threshold"&&!m.guardOnly);if(S.length>0&&d.push(`${S.length} cluster(s) below --min-cluster ${i.thresholds.minClusterUnits} stay in place: ${S.map(m=>`${O(m.lineRanges)} (${m.outputs.join(", ")})`).join("; ")}`),a.length>0){let m=[...new Set(a.flatMap(C=>[...o.definedNames[C]]))];d.push(`${a.length} shared setup statement(s) derived only from inputs`+(m.length>0?`: ${$(m)}`:""))}if(u.length>0){let m=[...new Set(u.map(C=>r.units[C].startLine+1))];d.push(`${u.length} statement(s) reach no output: ${m.map(C=>`line ${C}`).join(", ")}`)}let g=[...r.handlerDeps.keys()].filter(m=>D.has(r.units[m].kind)).length;g>0&&d.push(`${g} catch/finally statement(s) were kept with the try block they handle`);let h=[...new Set([...o.stateWritesByUnit.values()].flat())];return h.length>0&&d.push(`state written at render time or in effects was treated as a dependency of later reads: ${$(h)}`),l.status!=="complete"&&d.push(`local flow partial: ${Z(l)}`),l.candidateEdges>0&&d.push(`${l.candidateEdges} candidate flow edge(s) (closure capture or field flow) were treated as dependencies; they can merge clusters but never separate them`),d}function $(e,t=8){return e.length>t?`${e.slice(0,t).join(", ")}, +${e.length-t} more`:e.join(", ")}function O(e,t=6){let n=e.map(i=>i.startLine===i.endLine?`line ${i.startLine+1}`:`lines ${i.startLine+1}-${i.endLine+1}`);return n.length>t?`${n.slice(0,t).join(", ")}, +${n.length-t} more ranges`:n.join(", ")}function sn(e,t,n,i){let{body:r,clusters:o,coverage:s,archetype:a}=i,u=Ne(r);if(!e)return an(t,n,i);let l=o.filter(m=>m.role==="extraction"),p=o.find(m=>m.role==="remainder"),d=(m,C)=>`${C+1}) ${cn(m)}: ${O(m.lineRanges)} producing ${Fe(m.outputs)}`+(m.inputs.length>0?` from (${$(m.inputs,6)})`:" from no parameters")+(m.narrow?"":` [wide interface: ${m.inputs.length} parameters]`)+(m.hooks.length>0?` [hooks: ${$(m.hooks,4)}]`:""),S=l.map(d).join("; "),g=ln(i,p);if(s.status!=="complete")return`${a==="orchestration"?"Preserve sequencing and treat it as an orchestration root. ":""}Inspect before extracting: local flow is partial (${Z(s)}). Candidate seam(s): ${S}. ${g}`.trim();if(a==="orchestration")return`${u} sequences ${l.length+1} independent operations (${S}); treat it as an orchestration root, not a cohesion defect, unless the steps serve unrelated purposes.`;let h=l.every(m=>m.kind==="effects")?" Advisory: an effect sequence may be intentional orchestration; confirm the steps serve a separate purpose before moving them.":"";return`Review a possible extraction from ${u}: ${S}. ${g}${h}`.trim()}function an(e,t,n){let{clusters:i}=n;if(e.length===0)return"No value output was found; the body has nothing to slice.";if(e.length===1)return"One value output; cohesion is trivially complete.";let r=new Set(i.flatMap(l=>l.outputs)),o=e.filter(l=>!r.has(l.id)).length,s=i.filter(l=>l.role==="below-threshold"&&!l.guardOnly),a=[];if(i.length===0)return`The ${e.length} value outputs read only shared setup derived from the inputs (${n.preamble.length} statement(s)); nothing separates them; keep the function whole.`;a.push(`The ${e.length} value outputs form ${i.length} cluster(s)`+(o>0?`, and ${o} of them read only shared setup`:""));let u=i.length===1?i[0]:null;return u&&u.outputs.length>1&&a.push(`${t.superglue} statement(s) feed every output and ${t.glue} feed more than one`+(t.superglue===0?"; the outputs are chained through shared statements, branch predicates, or state writes rather than one common root":"")),s.length>0&&a.push(`${s.length} cluster(s) stay below --min-cluster ${n.thresholds.minClusterUnits}: ${s.map(l=>O(l.lineRanges,2)).join("; ")}`),`${a.join("; ")}; keep the function whole.`}function Fe(e,t=4){let n=e.map(i=>i.replace(/@\d+$/u,""));return n.length>t?`${n.slice(0,t).join(", ")}, +${n.length-t} more`:n.join(", ")}function ln(e,t){let{flow:n,clusters:i,preamble:r,guards:o,thresholds:s}=e,a=[];if(t&&a.push(`the largest computation (${O(t.lineRanges,4)} producing ${Fe(t.outputs)})`),r.length>0){let l=[...new Set(r.flatMap(p=>[...n.definedNames[p]]))];a.push(`${r.length} shared setup statement(s)${l.length>0?` (${$(l,4)})`:""}`)}let u=i.filter(l=>l.role==="below-threshold"&&!l.guardOnly);return u.length>0&&a.push(`${u.length} smaller cluster(s) below --min-cluster ${s.minClusterUnits}`),o>0&&a.push(`${o} guard exit(s)`),a.length>0?`Stays in place: ${a.join(", ")}.`:""}function cn(e){switch(e.kind){case"calculation":return"pure calculation candidate";case"operation":return"operation candidate (awaits or effects inside; not pure)";case"hook":return"custom hook candidate (hooks stay unconditional and in order)";case"effects":return"effect sequence candidate"}}function Ne(e){let t=e.callable.name;return t&&"text"in t?String(t.text):"this function"}function un(e,t,n){for(let i of t)if(e.isVariableStatement(i))for(let r of i.declarationList.declarations)for(let o of v(r.name))n.add(o);else if(!e.isExpressionStatement(i))return!1;return!0}function dn(e,t,n){return!!(e.isPropertyAccessExpression(n)&&n.name===t||e.isPropertyAssignment(n)&&n.name===t||e.isBindingElement(n)&&n.propertyName===t||"name"in n&&n.name===t&&!e.isShorthandPropertyAssignment(n))}function pn(e,t){let n=x(e,t.expression);return e.isPropertyAccessExpression(n)?Te.has(n.name.text)?null:N(e,n):e.isElementAccessExpression(n)?N(e,n):null}function fn(e,t,n){let{ts:i}=e;if(i.isIdentifier(t)){let r=e.closures.get(t.text);if(r&&![...r.writes].some(o=>!A(e,o)))return!0}return!!(n&&n.local.size>0&&n.external.size===0)}function mn(e,t,n,i){n[t].add(z(e.name));let r=`${t}\0${e.name}`;i.has(r)||i.set(r,e)}function Sn(e,t,n,i,r){for(let o of n)o.unit===t.unit||o.base!==t.base||e[o.unit].start<=i||r[o.unit].add(t.unit)}export{Mn as a,ye as b};
2
+ //# sourceMappingURL=chunk-BUTWYEPH.js.map
@@ -0,0 +1,2 @@
1
+ import{b as c}from"./chunk-WOFQ5DTB.js";import{c as r,e as p,g as s,h as l}from"./chunk-3JIQS44J.js";import{c as a}from"./chunk-HRRFKWPZ.js";import{join as S}from"path";var u=3,b=2,x="typescript-semantic";function k(e){let n=S(e,x),i=p(n);return{...i,requestDir:i.legacyRequestDir}}function A(e){let n=JSON.parse(e),i=n.protocolVersion,o=i===b;if(!o&&i!==u||!E(n)||!o&&!M(n))throw new Error("TypeScript semantic service received an invalid mailbox request.");if(!o){let t=n,y=s("typescript-semantic-v3",{generation:t.generation,profileEnvironment:t.profileEnvironment,request:t.request});if(t.operationKey!==y)throw new Error("TypeScript semantic service received a mismatched mailbox operation identity.");return t}let m=s("typescript-semantic-v2",{id:n.id,generation:n.generation,request:n.request});return{protocolVersion:u,mailboxVersion:r,id:n.id,operationKey:m,clientId:"legacy-v2",enqueuedAtMs:n.deadlineAtMs,deadlineAtMs:n.deadlineAtMs,generation:n.generation,...n.profileEnvironment?{profileEnvironment:n.profileEnvironment}:{},request:n.request}}function E(e){return typeof e.id=="string"&&typeof e.generation=="string"&&typeof e.deadlineAtMs=="number"&&Number.isFinite(e.deadlineAtMs)&&(e.profileEnvironment===void 0||a(e.profileEnvironment))&&!!e.request&&g(e.request)}function M(e){return e.mailboxVersion===r&&typeof e.operationKey=="string"&&/^[a-f0-9]{64}$/.test(e.operationKey)&&e.id===l(e.operationKey)&&typeof e.clientId=="string"&&e.clientId!==""&&typeof e.enqueuedAtMs=="number"&&Number.isFinite(e.enqueuedAtMs)&&e.deadlineAtMs>=e.enqueuedAtMs}function g(e){if(!v(e))return!1;let n=e;switch(n.kind){case"availability":return!0;case"import-usage":return typeof n.file=="string";case"reference-fragments":return c(n.files)!==null;case"references":return T(n);case"callees":case"callee-coverage":return d(n.definitions);case"signature":return f(n.definition);default:return!1}}function d(e){return Array.isArray(e)&&e.every(f)}function f(e){if(!e||typeof e!="object")return!1;let n=e;return typeof n.symbolId=="number"&&typeof n.documentId=="number"&&typeof n.symbol=="string"&&typeof n.relativePath=="string"&&typeof n.leaf=="string"&&typeof n.startLine=="number"&&typeof n.endLine=="number"}function v(e){return!!e&&typeof e=="object"&&e!==null&&"kind"in e}function T(e){return d(e.definitions)&&(e.exact===void 0||typeof e.exact=="boolean")}export{u as a,k as b,A as c};
2
+ //# sourceMappingURL=chunk-BZB4QPIP.js.map
@@ -1,4 +1,4 @@
1
- import{a as s}from"./chunk-NSM5IEVW.js";var _=`SELECT COUNT(*) AS shared
1
+ import{c as s}from"./chunk-AOSIYPTA.js";var c=`SELECT COUNT(*) AS shared
2
2
  FROM (
3
3
  SELECT definition_m.symbol_id
4
4
  FROM documents definition_d
@@ -23,7 +23,7 @@ import{a as s}from"./chunk-NSM5IEVW.js";var _=`SELECT COUNT(*) AS shared
23
23
  JOIN documents reference_d ON reference_d.id = reference_c.document_id
24
24
  WHERE definition_d.relative_path = ?
25
25
  AND reference_d.relative_path = ?
26
- )`;function l(e,i,n){let r=s(e,i)??i,t=s(e,n)??n,o=e.get(_,r,t,t,r);return{...c(r,t,o?.shared??0)}}function N(e,i,n){return l(e,i,n)}function f(e,i={}){let{limit:n=20,scope:r}=i,t=r?"AND def_d.relative_path LIKE ? AND ref_d.relative_path LIKE ?":"",o=r?[`%${r}%`,`%${r}%`]:[];return e.all(`SELECT
26
+ )`;function l(e,n,r){let i=s(e,n),t=s(e,r);if(!i||!t)throw new Error("Coupling requires two uniquely resolved indexed files. Use exact project paths.");if(i===t)throw new Error("Coupling requires two distinct files.");let d=e.get(c,i,t,t,i);return{..._(i,t,d?.shared??0)}}function N(e,n,r){return l(e,n,r)}function f(e,n={}){let{limit:r=20,scope:i}=n,t=i?"AND instr(def_d.relative_path, ?) > 0 AND instr(ref_d.relative_path, ?) > 0":"",d=i?[i,i]:[];return e.all(`SELECT
27
27
  CASE WHEN def_d.relative_path < ref_d.relative_path THEN def_d.relative_path ELSE ref_d.relative_path END AS file1,
28
28
  CASE WHEN def_d.relative_path < ref_d.relative_path THEN ref_d.relative_path ELSE def_d.relative_path END AS file2,
29
29
  COUNT(DISTINCT gs.id) AS shared
@@ -45,5 +45,5 @@ import{a as s}from"./chunk-NSM5IEVW.js";var _=`SELECT COUNT(*) AS shared
45
45
  ${t}
46
46
  GROUP BY file1, file2
47
47
  ORDER BY shared DESC, file1, file2
48
- LIMIT ?`,...o,n).filter(d=>!e.isIgnored(d.file1)&&!e.isIgnored(d.file2)).map(d=>c(d.file1,d.file2,d.shared))}function h(e,i={}){return f(e,i)}function c(e,i,n){return{file1:e,file2:i,sharedSymbols:n,actionTier:"signal",couplingKind:"shared-symbol-coupling",evidenceReasons:[`${n} symbol(s) are defined in one file and referenced by the other`],recommendation:"Review whether the shared symbol surface is an intentional boundary or hidden coordination pressure before moving code."}}export{l as a,N as b,f as c,h as d};
49
- //# sourceMappingURL=chunk-6ILKOOGH.js.map
48
+ LIMIT ?`,...d,r).filter(o=>!e.isIgnored(o.file1)&&!e.isIgnored(o.file2)).map(o=>_(o.file1,o.file2,o.shared))}function h(e,n={}){return f(e,n)}function _(e,n,r){return{file1:e,file2:n,sharedSymbols:r,actionTier:"signal",couplingKind:"shared-symbol-coupling",evidenceReasons:[`${r} symbol(s) are defined in one file and referenced by the other`],recommendation:"Review whether the shared symbol surface is an intentional boundary or hidden coordination pressure before moving code."}}export{l as a,N as b,f as c,h as d};
49
+ //# sourceMappingURL=chunk-CE357GEE.js.map
@@ -0,0 +1,2 @@
1
+ import{b as l}from"./chunk-AOSIYPTA.js";import{a as n}from"./chunk-GCKCF5FL.js";import{D as i}from"./chunk-5D2LVK7O.js";function d(e,r){let s=l(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let o=s.filter(t=>!e.isIgnored(t)).sort(),m=i(e,o,{sort:!0}),a=n(e,"forward",s).filter(t=>!e.isIgnored(t)),p=n(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:o,symbols:m,dependsOn:a,dependedOnBy:p}}function u(e,r){return d(e,r)}export{d as a,u as b};
2
+ //# sourceMappingURL=chunk-CFN45HFP.js.map