codebaseiq 0.1.0 → 0.3.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 (447) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/README.md +1 -1
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/{chunk-ZMI2JSX2.js → chunk-23C5AD3B.js} +2 -2
  5. package/dist/chunk-2E6OUPCF.js +2 -0
  6. package/dist/chunk-2EDX3JT5.js +3 -0
  7. package/dist/chunk-2I2UHZET.js +2 -0
  8. package/dist/{chunk-T3DGWPXM.js → chunk-2OMXFE64.js} +2 -2
  9. package/dist/chunk-2PRONPAS.js +3 -0
  10. package/dist/{chunk-GW6Z3WGY.js → chunk-356EZBIP.js} +2 -2
  11. package/dist/{chunk-UDS562V4.js → chunk-36JC5BG2.js} +2 -2
  12. package/dist/chunk-3RR2K7EZ.js +20 -0
  13. package/dist/{chunk-JE3WZ6II.js → chunk-3RSBGWGL.js} +2 -2
  14. package/dist/{chunk-VE5AVNMP.js → chunk-3VJ3OCRE.js} +2 -2
  15. package/dist/{chunk-FDGD5AB5.js → chunk-4LK5OIPW.js} +2 -2
  16. package/dist/chunk-5DSL3NT2.js +17 -0
  17. package/dist/chunk-5FWR5HLG.js +90 -0
  18. package/dist/chunk-5IC2WZAL.js +22 -0
  19. package/dist/{chunk-MVB3DAEY.js → chunk-5IZRKWTZ.js} +2 -2
  20. package/dist/{chunk-Q65CQ4XL.js → chunk-5LL4KEHO.js} +2 -2
  21. package/dist/chunk-5T44HG5Y.js +88 -0
  22. package/dist/{chunk-TRRC4ZJ7.js → chunk-5ZI2PPI7.js} +2 -2
  23. package/dist/{chunk-7XAN6GKB.js → chunk-67VJAYVR.js} +2 -2
  24. package/dist/{chunk-MOVBWNIP.js → chunk-6BF3VYEF.js} +2 -2
  25. package/dist/chunk-6JMAVFL4.js +3 -0
  26. package/dist/chunk-6O3KXIDL.js +2 -0
  27. package/dist/{chunk-JOIRNPPY.js → chunk-6VREELBC.js} +2 -2
  28. package/dist/chunk-6WAPPQ5F.js +82 -0
  29. package/dist/{chunk-FW53T7EB.js → chunk-75KJGYX7.js} +2 -2
  30. package/dist/chunk-7GAK2F3H.js +77 -0
  31. package/dist/{chunk-UBGWN7I4.js → chunk-7JELP5YE.js} +2 -2
  32. package/dist/chunk-7UCDGXRW.js +8 -0
  33. package/dist/{chunk-L57ZKWVG.js → chunk-AEXQYQD7.js} +2 -2
  34. package/dist/chunk-AQI4N64O.js +22 -0
  35. package/dist/{chunk-ICFDQHAM.js → chunk-AURCQHSG.js} +2 -2
  36. package/dist/{chunk-I2T2LLK2.js → chunk-BBP7HVBJ.js} +2 -2
  37. package/dist/{chunk-OFBE4NGP.js → chunk-BFBIMTCJ.js} +2 -2
  38. package/dist/{chunk-JEJLSICM.js → chunk-BGGB5N53.js} +2 -2
  39. package/dist/{chunk-TIIC3ZE7.js → chunk-BRQL7AFJ.js} +2 -2
  40. package/dist/{chunk-YSNONTJ2.js → chunk-BWL3PMPT.js} +2 -2
  41. package/dist/chunk-C6WKPKCF.js +127 -0
  42. package/dist/{chunk-YESXMKX3.js → chunk-C7OUW52M.js} +2 -2
  43. package/dist/chunk-C7QWUBR2.js +545 -0
  44. package/dist/{chunk-4WKDMDEW.js → chunk-CCIYWXX6.js} +2 -2
  45. package/dist/{chunk-FAJQ7LWY.js → chunk-CIYA2KZN.js} +2 -2
  46. package/dist/{chunk-VEXUL62T.js → chunk-CR3OG6SQ.js} +2 -2
  47. package/dist/{chunk-JSOYNVWH.js → chunk-CVHOQONG.js} +2 -2
  48. package/dist/{chunk-LU3BMVH2.js → chunk-CW6AXOLR.js} +2 -2
  49. package/dist/{chunk-TXXOEMZJ.js → chunk-D53LWANR.js} +2 -2
  50. package/dist/{chunk-DO6WQD2T.js → chunk-D62CTZX6.js} +2 -2
  51. package/dist/{chunk-N3IQCBCF.js → chunk-D7AZAOZX.js} +2 -2
  52. package/dist/{chunk-RDBI2RXU.js → chunk-D7DOB27N.js} +7 -7
  53. package/dist/chunk-DAKIGMIK.js +21 -0
  54. package/dist/chunk-DDN2F6GB.js +2 -0
  55. package/dist/chunk-DUKHVPU5.js +4 -0
  56. package/dist/chunk-DVWO7RBC.js +2 -0
  57. package/dist/{chunk-HKQUXIFO.js → chunk-E52K4L2W.js} +2 -2
  58. package/dist/chunk-EIBGSU2R.js +2 -0
  59. package/dist/chunk-EN4AHLL3.js +3 -0
  60. package/dist/chunk-EQNMD62X.js +51 -0
  61. package/dist/{chunk-ENCCHKM6.js → chunk-EXZ7VLRY.js} +4 -4
  62. package/dist/{chunk-NEDP5RFQ.js → chunk-F3QSL4W2.js} +2 -2
  63. package/dist/{chunk-O6QTXQPJ.js → chunk-F74LZWCE.js} +2 -2
  64. package/dist/{chunk-BH5F2Q4O.js → chunk-FEIZXBLH.js} +2 -2
  65. package/dist/chunk-FH5WG4LE.js +2 -0
  66. package/dist/{chunk-BVAJLC5A.js → chunk-FOZ74V56.js} +2 -2
  67. package/dist/{chunk-L4NRUAGJ.js → chunk-FQTIFWLR.js} +2 -2
  68. package/dist/chunk-FTTV7IRX.js +355 -0
  69. package/dist/chunk-FWQGH2N2.js +2 -0
  70. package/dist/{chunk-CAUCPUOF.js → chunk-GDHWOA57.js} +2 -2
  71. package/dist/{chunk-6MUIJMVL.js → chunk-GIDCP7KV.js} +2 -2
  72. package/dist/{chunk-ZV3JV5G5.js → chunk-GL6UTNUB.js} +2 -2
  73. package/dist/chunk-GP7C5VAE.js +2 -0
  74. package/dist/{chunk-FQKZWM4L.js → chunk-GQLDYCWS.js} +5 -5
  75. package/dist/chunk-GQXXOS55.js +2 -0
  76. package/dist/{chunk-H3LGFZVK.js → chunk-GUFPEFBG.js} +2 -2
  77. package/dist/{chunk-NNOKTMZT.js → chunk-GV2CEZCW.js} +2 -2
  78. package/dist/{chunk-FETNQCFO.js → chunk-GVAF222T.js} +2 -2
  79. package/dist/chunk-GWYZVVKY.js +21 -0
  80. package/dist/{chunk-7FND7D7N.js → chunk-HENP2O4A.js} +2 -2
  81. package/dist/{chunk-LZYFLFEH.js → chunk-HINZQKSY.js} +2 -2
  82. package/dist/{chunk-RR7SX44N.js → chunk-HQA7EBSK.js} +2 -2
  83. package/dist/{chunk-XMQ23E27.js → chunk-HVFB3PME.js} +2 -2
  84. package/dist/chunk-I22IZYDI.js +2 -0
  85. package/dist/chunk-ICUL7XRT.js +21 -0
  86. package/dist/{chunk-CQP3THUZ.js → chunk-IHSLIIL3.js} +2 -2
  87. package/dist/{chunk-34WBMAYK.js → chunk-ITSJMNUD.js} +2 -2
  88. package/dist/{chunk-PX4RYAAK.js → chunk-IZDPGOZR.js} +2 -2
  89. package/dist/chunk-J3GLP7Q5.js +3 -0
  90. package/dist/{chunk-CVYSU6BX.js → chunk-J7AMBVWF.js} +2 -2
  91. package/dist/{chunk-Y6KHROC3.js → chunk-JCMFBF4Z.js} +2 -2
  92. package/dist/chunk-JFIA2JI3.js +3 -0
  93. package/dist/chunk-JLZLLLW5.js +3 -0
  94. package/dist/{chunk-5PUWMSDU.js → chunk-JSNTHRLQ.js} +2 -2
  95. package/dist/{chunk-C6SBF2WH.js → chunk-JX6ZWDOS.js} +2 -2
  96. package/dist/{chunk-4XTAUQFD.js → chunk-JYI7CV25.js} +2 -2
  97. package/dist/chunk-K7JLSGCJ.js +8 -0
  98. package/dist/{chunk-XWUOUWYI.js → chunk-KPZGTB2O.js} +2 -2
  99. package/dist/{chunk-VXYS3FZD.js → chunk-LKUTSP4G.js} +2 -2
  100. package/dist/{chunk-GTXSJDCO.js → chunk-LMTSB3TB.js} +2 -2
  101. package/dist/chunk-LONKINMJ.js +543 -0
  102. package/dist/{chunk-WMPRTGH2.js → chunk-LQHYYIOB.js} +2 -2
  103. package/dist/{chunk-VUIYB2V3.js → chunk-LZSQ6X7E.js} +2 -2
  104. package/dist/{chunk-ST7V3SKN.js → chunk-M2Y6PCFE.js} +2 -2
  105. package/dist/chunk-MEUHIDI3.js +7 -0
  106. package/dist/{chunk-OZYRSMSH.js → chunk-MHWMEZDA.js} +2 -2
  107. package/dist/{chunk-RKEJ6VTF.js → chunk-MQW6SJ4P.js} +2 -2
  108. package/dist/{chunk-J77SU6VA.js → chunk-MSI3K7PJ.js} +2 -2
  109. package/dist/chunk-MVRGB4KJ.js +278 -0
  110. package/dist/{chunk-DQMDCD24.js → chunk-MZNMASFM.js} +2 -2
  111. package/dist/{chunk-ID63777H.js → chunk-NBCQZSGR.js} +2 -2
  112. package/dist/chunk-NBZKSTXP.js +2 -0
  113. package/dist/{chunk-SZD2KF7Q.js → chunk-NCJILOAK.js} +2 -2
  114. package/dist/{chunk-C7QOQX32.js → chunk-NDKOVQFG.js} +2 -2
  115. package/dist/{chunk-UNBY47BC.js → chunk-NEWHKGVD.js} +2 -2
  116. package/dist/{chunk-PYAB5SM6.js → chunk-O2M3VNDY.js} +2 -2
  117. package/dist/chunk-OFGOOL6U.js +3 -0
  118. package/dist/{chunk-SWHMHUKF.js → chunk-OQUCBKOI.js} +2 -2
  119. package/dist/{chunk-7MGU3HPH.js → chunk-P4NVCOM7.js} +2 -2
  120. package/dist/{chunk-ANFVSJWQ.js → chunk-PFC44E6D.js} +2 -2
  121. package/dist/{chunk-EZNMUY67.js → chunk-PHNCEUXX.js} +2 -2
  122. package/dist/{chunk-4FC325IF.js → chunk-PTQPPPG2.js} +2 -2
  123. package/dist/chunk-PUVNH4PO.js +3 -0
  124. package/dist/chunk-Q23IMHXS.js +343 -0
  125. package/dist/chunk-Q3ZCQY2Y.js +3 -0
  126. package/dist/{chunk-KMITESMT.js → chunk-Q4XEU3UH.js} +2 -2
  127. package/dist/{chunk-QKPLA6IC.js → chunk-QEOWONKY.js} +2 -2
  128. package/dist/{chunk-BJ6SQAEN.js → chunk-QMOZZ2VX.js} +2 -2
  129. package/dist/chunk-RCIGX23V.js +60 -0
  130. package/dist/{chunk-IOP6FWIM.js → chunk-RIYJ4L33.js} +2 -2
  131. package/dist/chunk-RJVAPMHF.js +14 -0
  132. package/dist/chunk-SB7NASHU.js +2 -0
  133. package/dist/{chunk-UZGZB3VB.js → chunk-SGMNWYTH.js} +2 -2
  134. package/dist/chunk-SMDIEDM4.js +27 -0
  135. package/dist/chunk-SV2LEFVM.js +2 -0
  136. package/dist/chunk-SX72EVMY.js +3 -0
  137. package/dist/chunk-T5X7DK6C.js +3 -0
  138. package/dist/{chunk-6NW7MU72.js → chunk-T6MQNNAC.js} +2 -2
  139. package/dist/chunk-T75DS2E6.js +21 -0
  140. package/dist/{chunk-HRWGYWRJ.js → chunk-TEANKHUU.js} +2 -2
  141. package/dist/chunk-TJBOJUVN.js +3 -0
  142. package/dist/{chunk-XLQ3GLWZ.js → chunk-TJWVT4DO.js} +2 -2
  143. package/dist/{chunk-7NVGT435.js → chunk-TNJGTQWO.js} +2 -2
  144. package/dist/{chunk-NE6IU5ZD.js → chunk-TOTWJZIX.js} +2 -2
  145. package/dist/{chunk-PBI2LFKH.js → chunk-TPO7XC5Z.js} +2 -2
  146. package/dist/{chunk-HPJRBHVT.js → chunk-U33PMPNW.js} +2 -2
  147. package/dist/{chunk-QHRNXP3C.js → chunk-U7NUXDQO.js} +2 -2
  148. package/dist/chunk-UC2FD2PS.js +4 -0
  149. package/dist/{chunk-PIOMTC27.js → chunk-UQE4XFSA.js} +2 -2
  150. package/dist/chunk-UQYQBLJX.js +5 -0
  151. package/dist/{chunk-KWVHSKHK.js → chunk-USOAJHY7.js} +2 -2
  152. package/dist/{chunk-GCHRX4YW.js → chunk-UW6KD57C.js} +2 -2
  153. package/dist/{chunk-PTAWHLVJ.js → chunk-VGWZ4MOY.js} +2 -2
  154. package/dist/{chunk-XME3HPXZ.js → chunk-VWYGCMV5.js} +2 -2
  155. package/dist/{chunk-AKB7V7TV.js → chunk-W7YLRXZE.js} +2 -2
  156. package/dist/{chunk-SYDJMPES.js → chunk-WK2IQJPK.js} +2 -2
  157. package/dist/{chunk-RBAS5ZHI.js → chunk-WWCV4E6J.js} +2 -2
  158. package/dist/{chunk-OL6KJP3N.js → chunk-XMJ53WG4.js} +2 -2
  159. package/dist/chunk-XN3EKMLI.js +4 -0
  160. package/dist/chunk-XQAVQVIL.js +3 -0
  161. package/dist/{chunk-IJ4HMYBE.js → chunk-XQPPURLQ.js} +2 -2
  162. package/dist/{chunk-OVTS4DKB.js → chunk-YHPG3S2U.js} +2 -2
  163. package/dist/{chunk-WOQBZPIF.js → chunk-YRKP7PM7.js} +2 -2
  164. package/dist/chunk-YT4DVWUV.js +11 -0
  165. package/dist/chunk-YTJHCGYB.js +61 -0
  166. package/dist/chunk-Z35GOVEH.js +2 -0
  167. package/dist/{chunk-OLF4MA5W.js → chunk-Z6RL7XOE.js} +4 -4
  168. package/dist/{chunk-UP3BUZR5.js → chunk-ZAFGY22Q.js} +2 -2
  169. package/dist/{chunk-CO5R3UNA.js → chunk-ZB4C5TTR.js} +2 -2
  170. package/dist/{chunk-ZZXSWSN6.js → chunk-ZNH33XIB.js} +2 -2
  171. package/dist/{chunk-EMNIHCRB.js → chunk-ZQ62NNKN.js} +2 -2
  172. package/dist/cli-context-FJL2JHOE.js +3 -0
  173. package/dist/cli-context-PQNWHMCQ.js +2 -0
  174. package/dist/cli-program-UO7PZD6V.js +7 -0
  175. package/dist/cli.js +1 -1
  176. package/dist/{code-DlqpBDd0.d.ts → code-DfX3xeWy.d.ts} +1 -1
  177. package/dist/code-viewer-KIXEYQNJ.js +12 -0
  178. package/dist/code-viewer-VHLBLIUM.js +11 -0
  179. package/dist/command-descriptors-F5P2V3NW.js +335 -0
  180. package/dist/command-descriptors-YCLATF5I.js +337 -0
  181. package/dist/{config-types-BNoC96J3.d.ts → config-types-D6X5S68_.d.ts} +50 -0
  182. package/dist/{db-D7sauVFH.d.ts → db-BoG_PWYH.d.ts} +2 -2
  183. package/dist/direct-navigation-4XJTXIDT.js +2 -0
  184. package/dist/direct-navigation-J5MVYYAD.js +3 -0
  185. package/dist/{graph-evidence-BIFqyisO.d.ts → graph-evidence-D1jx1Cql.d.ts} +1 -1
  186. package/dist/{health-DJaZXg8I.d.ts → health-DkYBS5BI.d.ts} +1 -1
  187. package/dist/index.d.ts +2 -2
  188. package/dist/index.js +1 -1
  189. package/dist/invocation-command-descriptors-RWV4VAI4.js +2 -0
  190. package/dist/invocation-command-descriptors-U76PN7IY.js +3 -0
  191. package/dist/{scip-cli-B7N3haxa.d.ts → maintenance-types-CdL5eQii.d.ts} +2 -21
  192. package/dist/output-continuation-command-BL25S26S.js +3 -0
  193. package/dist/output-continuation-command-BTETTXEC.js +2 -0
  194. package/dist/postinstall.js +1 -1
  195. package/dist/project-reindex-CRJU3IFG.js +2 -0
  196. package/dist/project-reindex-TQFCOA2O.js +3 -0
  197. package/dist/queries/affected.d.ts +2 -2
  198. package/dist/queries/affected.js +1 -1
  199. package/dist/queries/anchors.d.ts +2 -2
  200. package/dist/queries/anchors.js +1 -1
  201. package/dist/queries/architecture.d.ts +2 -2
  202. package/dist/queries/architecture.js +1 -1
  203. package/dist/queries/bottlenecks.d.ts +2 -2
  204. package/dist/queries/bottlenecks.js +1 -1
  205. package/dist/queries/by-kind.d.ts +2 -2
  206. package/dist/queries/by-kind.js +1 -1
  207. package/dist/queries/call-graph.d.ts +2 -2
  208. package/dist/queries/call-graph.js +1 -1
  209. package/dist/queries/change-surface.d.ts +2 -2
  210. package/dist/queries/change-surface.js +1 -1
  211. package/dist/queries/cleanup-plan.d.ts +2 -2
  212. package/dist/queries/cleanup-plan.js +1 -1
  213. package/dist/queries/co-change.d.ts +2 -2
  214. package/dist/queries/co-change.js +1 -1
  215. package/dist/queries/code.d.ts +3 -3
  216. package/dist/queries/code.js +1 -1
  217. package/dist/queries/complexity-hotspots.d.ts +2 -2
  218. package/dist/queries/complexity-hotspots.js +1 -1
  219. package/dist/queries/complexity.d.ts +2 -2
  220. package/dist/queries/complexity.js +1 -1
  221. package/dist/queries/context.d.ts +2 -2
  222. package/dist/queries/context.js +1 -1
  223. package/dist/queries/convergence.d.ts +2 -2
  224. package/dist/queries/convergence.js +1 -1
  225. package/dist/queries/coupling.d.ts +2 -2
  226. package/dist/queries/coupling.js +1 -1
  227. package/dist/queries/cycles.d.ts +2 -2
  228. package/dist/queries/cycles.js +1 -1
  229. package/dist/queries/dataflow.d.ts +2 -2
  230. package/dist/queries/dataflow.js +1 -1
  231. package/dist/queries/dead.d.ts +2 -2
  232. package/dist/queries/dead.js +1 -1
  233. package/dist/queries/decorative-checkers.d.ts +2 -2
  234. package/dist/queries/decorative-checkers.js +1 -1
  235. package/dist/queries/deep-chains.d.ts +2 -2
  236. package/dist/queries/deep-chains.js +1 -1
  237. package/dist/queries/dependence-slice.d.ts +3 -3
  238. package/dist/queries/dependence-slice.js +1 -1
  239. package/dist/queries/dependency-depth.d.ts +2 -2
  240. package/dist/queries/dependency-depth.js +1 -1
  241. package/dist/queries/deps.d.ts +2 -2
  242. package/dist/queries/deps.js +1 -1
  243. package/dist/queries/diff-impact.d.ts +2 -2
  244. package/dist/queries/diff-impact.js +1 -1
  245. package/dist/queries/doc-drift.d.ts +2 -2
  246. package/dist/queries/doc-drift.js +1 -1
  247. package/dist/queries/drift.d.ts +2 -2
  248. package/dist/queries/drift.js +1 -1
  249. package/dist/queries/duplicate-bodies.d.ts +2 -2
  250. package/dist/queries/duplicate-bodies.js +1 -1
  251. package/dist/queries/entry-map.d.ts +2 -2
  252. package/dist/queries/entry-map.js +1 -1
  253. package/dist/queries/evidence.d.ts +3 -3
  254. package/dist/queries/evidence.js +1 -1
  255. package/dist/queries/extract-candidates.d.ts +2 -2
  256. package/dist/queries/extract-candidates.js +1 -1
  257. package/dist/queries/fan.d.ts +2 -2
  258. package/dist/queries/fan.js +1 -1
  259. package/dist/queries/files.d.ts +2 -2
  260. package/dist/queries/files.js +1 -1
  261. package/dist/queries/health.d.ts +3 -3
  262. package/dist/queries/health.js +1 -1
  263. package/dist/queries/hierarchy.d.ts +2 -2
  264. package/dist/queries/hierarchy.js +1 -1
  265. package/dist/queries/hotspots.d.ts +2 -2
  266. package/dist/queries/hotspots.js +1 -1
  267. package/dist/queries/imports.d.ts +2 -2
  268. package/dist/queries/imports.js +1 -1
  269. package/dist/queries/incomplete-migration.d.ts +2 -2
  270. package/dist/queries/incomplete-migration.js +1 -1
  271. package/dist/queries/index.d.ts +5 -5
  272. package/dist/queries/index.js +1 -1
  273. package/dist/queries/isolated.d.ts +2 -2
  274. package/dist/queries/isolated.js +1 -1
  275. package/dist/queries/locality-candidates.d.ts +2 -2
  276. package/dist/queries/locality-candidates.js +1 -1
  277. package/dist/queries/members.d.ts +2 -2
  278. package/dist/queries/members.js +1 -1
  279. package/dist/queries/methods.d.ts +2 -2
  280. package/dist/queries/methods.js +1 -1
  281. package/dist/queries/not-implemented.d.ts +2 -2
  282. package/dist/queries/not-implemented.js +1 -1
  283. package/dist/queries/outline.d.ts +2 -2
  284. package/dist/queries/outline.js +1 -1
  285. package/dist/queries/passthrough-candidates.d.ts +2 -2
  286. package/dist/queries/passthrough-candidates.js +1 -1
  287. package/dist/queries/plan-context.d.ts +2 -2
  288. package/dist/queries/plan-context.js +1 -1
  289. package/dist/queries/react-component-duplicates.d.ts +2 -2
  290. package/dist/queries/react-component-duplicates.js +1 -1
  291. package/dist/queries/react-hook-candidates.d.ts +2 -2
  292. package/dist/queries/react-hook-candidates.js +1 -1
  293. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  294. package/dist/queries/react-large-component-pressure.js +1 -1
  295. package/dist/queries/recent-duplicates.d.ts +2 -2
  296. package/dist/queries/recent-duplicates.js +1 -1
  297. package/dist/queries/redundant-reexports.d.ts +2 -2
  298. package/dist/queries/redundant-reexports.js +1 -1
  299. package/dist/queries/reference-neighborhood.d.ts +2 -2
  300. package/dist/queries/reference-neighborhood.js +1 -1
  301. package/dist/queries/reference-reachability.d.ts +2 -2
  302. package/dist/queries/reference-reachability.js +1 -1
  303. package/dist/queries/refs.d.ts +2 -2
  304. package/dist/queries/refs.js +1 -1
  305. package/dist/queries/self-audit.d.ts +2 -2
  306. package/dist/queries/self-audit.js +1 -1
  307. package/dist/queries/similar-chains.d.ts +2 -2
  308. package/dist/queries/similar-chains.js +1 -1
  309. package/dist/queries/similar-files.d.ts +2 -2
  310. package/dist/queries/similar-files.js +1 -1
  311. package/dist/queries/similar-signatures.d.ts +2 -2
  312. package/dist/queries/similar-signatures.js +1 -1
  313. package/dist/queries/similar.d.ts +2 -2
  314. package/dist/queries/similar.js +1 -1
  315. package/dist/queries/slice.d.ts +2 -2
  316. package/dist/queries/slice.js +1 -1
  317. package/dist/queries/source-inspection.d.ts +4 -4
  318. package/dist/queries/source-inspection.js +1 -1
  319. package/dist/queries/source-search.d.ts +2 -2
  320. package/dist/queries/source-search.js +1 -1
  321. package/dist/queries/stale-abstractions.d.ts +2 -2
  322. package/dist/queries/stale-abstractions.js +1 -1
  323. package/dist/queries/stats.d.ts +2 -2
  324. package/dist/queries/surface.d.ts +2 -2
  325. package/dist/queries/surface.js +1 -1
  326. package/dist/queries/symbols.d.ts +2 -2
  327. package/dist/queries/symbols.js +1 -1
  328. package/dist/queries/system-map.d.ts +2 -2
  329. package/dist/queries/system-map.js +1 -1
  330. package/dist/queries/system.d.ts +2 -2
  331. package/dist/queries/system.js +1 -1
  332. package/dist/queries/test-quality.d.ts +2 -2
  333. package/dist/queries/test-quality.js +1 -1
  334. package/dist/queries/trace.d.ts +2 -2
  335. package/dist/queries/trace.js +1 -1
  336. package/dist/queries/twin-ab.d.ts +2 -2
  337. package/dist/queries/twin-ab.js +1 -1
  338. package/dist/queries/twin-drift.d.ts +2 -2
  339. package/dist/queries/twin-drift.js +1 -1
  340. package/dist/queries/unused-imports.d.ts +2 -2
  341. package/dist/queries/unused-imports.js +1 -1
  342. package/dist/queries/unused-params.d.ts +2 -2
  343. package/dist/queries/unused-params.js +1 -1
  344. package/dist/queries/value-flow.d.ts +3 -3
  345. package/dist/queries/value-flow.js +1 -1
  346. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  347. package/dist/queries/vue-component-duplicates.js +1 -1
  348. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  349. package/dist/queries/vue-composable-candidates.js +1 -1
  350. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  351. package/dist/queries/vue-large-view-pressure.js +1 -1
  352. package/dist/queries/wrapper-candidates.d.ts +2 -2
  353. package/dist/queries/wrapper-candidates.js +1 -1
  354. package/dist/reindex-worker.js +2 -2
  355. package/dist/reindex.d.ts +3 -5
  356. package/dist/reindex.js +72 -33
  357. package/dist/runtime.d.ts +23 -4
  358. package/dist/runtime.js +3 -3
  359. package/dist/rust-semantic-session-server.js +1 -1
  360. package/dist/rust-semantic-session-worker.js +1 -1
  361. package/dist/rust-semantic-worker.js +1 -1
  362. package/dist/sentinel-ensure-command-OSWGCFFL.js +3 -0
  363. package/dist/sentinel-ensure-command-SPW7XQLB.js +2 -0
  364. package/dist/sentinel-hook.js +39 -0
  365. package/dist/sentinel-worker.js +16 -0
  366. package/dist/typescript-mailbox-worker.js +1 -1
  367. package/dist/watch-server.js +6 -6
  368. package/docs/COMMAND_REFERENCE.md +5 -3
  369. package/docs/INDEX_GENERATIONS.md +2 -2
  370. package/docs/NPM_RELEASE.md +323 -0
  371. package/docs/schemas/npm-release-state.schema.json +4 -13
  372. package/docs/schemas/project-config.schema.json +159 -0
  373. package/package.json +10 -14
  374. package/skills/codebaseiq/SKILL.md +1 -1
  375. package/skills/concrete-plan/SKILL.md +1 -1
  376. package/ui/view/api.js +450 -0
  377. package/ui/view/app.js +394 -0
  378. package/ui/view/builder.js +323 -0
  379. package/ui/view/file-panel.js +170 -0
  380. package/ui/view/focus.js +379 -0
  381. package/ui/view/index.html +54 -0
  382. package/ui/view/map.js +424 -0
  383. package/ui/view/styles.css +1125 -0
  384. package/dist/chunk-2Q2LW5JW.js +0 -14
  385. package/dist/chunk-2X7V4HS4.js +0 -88
  386. package/dist/chunk-3IER7Q6H.js +0 -12
  387. package/dist/chunk-3JSXXYTZ.js +0 -345
  388. package/dist/chunk-476NR5B7.js +0 -2
  389. package/dist/chunk-5VKBFZZU.js +0 -3
  390. package/dist/chunk-6BQ3DSPK.js +0 -2
  391. package/dist/chunk-6CS3UQTN.js +0 -3
  392. package/dist/chunk-6OAHRI2D.js +0 -6
  393. package/dist/chunk-ADTBPVUZ.js +0 -21
  394. package/dist/chunk-BFFZDZQV.js +0 -2
  395. package/dist/chunk-BMYOV5GP.js +0 -77
  396. package/dist/chunk-C74PPYLA.js +0 -3
  397. package/dist/chunk-CWONGW6P.js +0 -3
  398. package/dist/chunk-DDZ7VHWV.js +0 -20
  399. package/dist/chunk-DR2LURYU.js +0 -3
  400. package/dist/chunk-ECQBG7PW.js +0 -564
  401. package/dist/chunk-EF2R3WNQ.js +0 -2
  402. package/dist/chunk-FM5BPL4V.js +0 -60
  403. package/dist/chunk-G6XFR4ZL.js +0 -4
  404. package/dist/chunk-GTIYTDRE.js +0 -562
  405. package/dist/chunk-HOA5YGOH.js +0 -3
  406. package/dist/chunk-KUW32IRO.js +0 -2
  407. package/dist/chunk-LTA3BRZX.js +0 -2
  408. package/dist/chunk-NAUD7LCA.js +0 -2
  409. package/dist/chunk-NCZUNH3E.js +0 -109
  410. package/dist/chunk-NNJ2KZZG.js +0 -4
  411. package/dist/chunk-NNO6A2PO.js +0 -2
  412. package/dist/chunk-OGTFJ3XD.js +0 -2
  413. package/dist/chunk-Q5ELPRKQ.js +0 -2
  414. package/dist/chunk-Q72QSKXC.js +0 -308
  415. package/dist/chunk-QCN62RTF.js +0 -3
  416. package/dist/chunk-QW7EP6WI.js +0 -21
  417. package/dist/chunk-RU65DDUP.js +0 -215
  418. package/dist/chunk-SELM5MER.js +0 -2
  419. package/dist/chunk-SMRBZ6EC.js +0 -2
  420. package/dist/chunk-SNNWPCN7.js +0 -4
  421. package/dist/chunk-TFZB6XTM.js +0 -239
  422. package/dist/chunk-UCD3H3UZ.js +0 -5
  423. package/dist/chunk-UXM43C7T.js +0 -3
  424. package/dist/chunk-VFY6Y2H6.js +0 -61
  425. package/dist/chunk-WE5RZHZ7.js +0 -5
  426. package/dist/chunk-YMGZZEW4.js +0 -2
  427. package/dist/chunk-YVCIMIOC.js +0 -12
  428. package/dist/chunk-Z54RD7VL.js +0 -3
  429. package/dist/chunk-ZKX2FRS6.js +0 -15
  430. package/dist/cli-context-3SNLDYBM.js +0 -3
  431. package/dist/cli-context-T3B7W6GG.js +0 -2
  432. package/dist/cli-program-YNOXO72B.js +0 -7
  433. package/dist/command-descriptors-6AOUKWW7.js +0 -346
  434. package/dist/command-descriptors-ZFKJSRUP.js +0 -344
  435. package/dist/direct-navigation-DP4LVMRX.js +0 -3
  436. package/dist/direct-navigation-FLUS3BT6.js +0 -2
  437. package/dist/invocation-command-descriptors-QT2JMY5J.js +0 -3
  438. package/dist/invocation-command-descriptors-YN4QJEAX.js +0 -2
  439. package/dist/output-continuation-command-2V2SL4TD.js +0 -2
  440. package/dist/output-continuation-command-65J5IP3O.js +0 -3
  441. package/dist/project-reindex-5JOKXAXT.js +0 -2
  442. package/dist/project-reindex-UQBIKO4M.js +0 -3
  443. package/docs/WINDOWS_SIDECAR_RELEASE.md +0 -424
  444. package/docs/schemas/windows-sidecar-provenance.schema.json +0 -137
  445. package/scripts/build-codebaseiq-windows.mjs +0 -197
  446. package/scripts/codebaseiq-windows-provenance.mjs +0 -364
  447. package/scripts/verify-codebaseiq-windows.mjs +0 -29
@@ -1,5 +1,5 @@
1
- import{a as ze}from"./chunk-L57ZKWVG.js";import{b as Te,c as ge}from"./chunk-SMRBZ6EC.js";import{c as Be}from"./chunk-XLQ3GLWZ.js";import{d as we}from"./chunk-JEJLSICM.js";import{i as qe}from"./chunk-FQKZWM4L.js";import{c as Ke}from"./chunk-7FND7D7N.js";import{d as Ge,e as $e,f as Xe}from"./chunk-CVYSU6BX.js";import{a as U}from"./chunk-TIIC3ZE7.js";import{A as Ne,d as te,i as oe,t as be}from"./chunk-FETNQCFO.js";import{f as Q}from"./chunk-O6QTXQPJ.js";import{v as Re}from"./chunk-BMYOV5GP.js";var Ue=4,yn=3,fn=12,pn=48,bn=64,J=10,V=6,gn=24,Sn=320,Pe=6,vn=12,An=1,Mn=4,Ln=7,Dn=12,ke="source-construct:",Cn=96,Rn=32,We=4,wn=32,Tn=8,je=new Set(["a","an","and","are","as","at","be","become","becomes","by","can","does","for","from","how","in","into","is","it","its","of","on","or","that","the","their","then","this","through","to","what","when","where","which","with"]);function Nt(e,n,s={}){let a=Pn(n),r=ft(n);if(a.length===0)throw new Error("Anchor discovery requires at least one non-trivial repository term.");let o=s.limit??Ue,t=s.full===!0;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`anchor group limit must be a positive safe integer; received ${o}`);let i=new Ke(e),d=i.scopedDefinitions(s.scope).filter(g=>!oe(g.symbol)),l=[...d],c=new Map(l.map(g=>[g.symbol,g])),m=new Map;for(let g of d)He(m,g,a);let u=Be(e,{scope:s.scope});for(let g of u.files){let fe=be(e,g.relativePath).filter(_=>!oe(_.symbol));if(fe.length===0)continue;let ne=cn(g.text);for(let _=0;_<ne.length;_+=1){let pe=T(ne[_]??""),ae=a.filter(O=>pe.has(O));if(ae.length===0)continue;let D=Ne(fe,_);if(!(!D||oe(D.symbol)))for(let O of ae)le(m,D,O,"source",g.relativePath,_)}}let h=Ye(m),y=[...m.values()].map(g=>Se(g,h,r)).sort(R),b=xn(u.files,y,a),v=-1;for(let g of b){let z=be(e,g.relativePath),fe=z.filter(D=>!oe(D.symbol)),ne=Q(e,g.relativePath)?.callables??[],_=new Map,pe=D=>{let O=`${D.startLine}\0${D.endLine}\0${D.name}`,Y=_.get(O);if(Y)return Y;let N=In(g.relativePath,z,D,()=>v--);return N?(_.set(O,N),l.push(N),c.set(N.symbol,N),He(m,N,a),N):null};for(let D of ne){let O=T(D.name);a.some(Y=>O.has(Y))&&pe(D)}if(ne.length===0)continue;let ae=cn(g.text);for(let D=0;D<ae.length;D+=1){let O=T(ae[D]??""),Y=a.filter(Ce=>O.has(Ce));if(Y.length===0)continue;let N=En(ne,D),ce=N?pe(N):null;if(!ce)continue;let Oe=Qe(fe,D);if(Qe(Oe?[Oe,ce]:[ce],D)?.symbol===ce.symbol)for(let Ce of Y)le(m,ce,Ce,"source",g.relativePath,D)}}let S=Ye(m),M=new Map(u.files.map(g=>[g.relativePath,g.text.split(/\r?\n/u)]));for(let g of m.values()){let z=M.get(g.definition.relativePath);z&&(g.sourceCharacters=z.slice(g.definition.startLine,g.definition.endLine+1).join(`
2
- `).length)}let f=[...m.values()].map(g=>Se(g,S,r)).sort(R),C=Math.min(f.length,Math.max(fn,o*yn)),A=t?f:re([...f.slice(0,C),...[...f].sort(xe).slice(0,Math.max(pn,C)),...ct(f,a),...lt(f,a,S)]),P=A.length,I=A.map(g=>c.get(g.symbol)).filter(g=>g?.isFunctionLike===!0),H=Fn(l),E=kn(e,i,A,I,c,H,new Set(m.keys()),s.semantic!==!1),B=Nn(E,A,m,S,c),F=Gn(B,S,a),K=Zn(e,i,E,m,S,l,c,s.semantic!==!1),L=[...Xn(e,i,B,c,S,s.semantic!==!1),...F,...B,...K].map(g=>({...g,queryPathMatches:mt(g)})).sort((g,z)=>Z(g,z,S)),k=t?L:ut(L,o,S),p=a.filter(g=>S.has(g)),w=a.filter(g=>!S.has(g)),ee=Math.max(0,f.length-P),ye=Math.max(0,L.length-k.length)+ee,hn=t?f.length:Math.min(f.length,o+Ue);return{query:n,queryPathFragments:r,normalizedTerms:a,matchedTerms:p,unmatchedTerms:w,groups:k,candidateRoots:f,candidateRootCount:f.length,analyzedRootCount:P,omittedRootCount:ee,omittedGroupCount:ye,scannedFiles:u.files.length,scannedBytes:u.scannedBytes,recoveryCommand:ye===0?null:`codebaseiq anchors ${Le(n)}${s.scope?` --scope ${Le(s.scope)}`:""} --limit ${hn}`}}function Pn(e){let n=De(e).filter(s=>!je.has(s.toLocaleLowerCase())).map(_e).filter(s=>s.length>=3&&!je.has(s));return[...new Set(n)]}function He(e,n,s){let a=T(n.leaf),r=T(n.relativePath),o=T(n.documentation??"");for(let i of s)a.has(i)&&le(e,n,i,"symbol"),r.has(i)&&le(e,n,i,"path"),o.has(i)&&le(e,n,i,"documentation");let t=e.get(n.symbol);t&&(t.symbolPhraseLength=bt(n.leaf,s))}function le(e,n,s,a,r,o){let t=e.get(n.symbol)??{definition:n,matches:new Map,symbolPhraseLength:0},i=t.matches.get(s)??{sources:new Set,locations:new Map};i.sources.add(a),r!==void 0&&o!==void 0&&i.locations.set(`${r}\0${o}`,{file:r,line:o}),t.matches.set(s,i),e.set(n.symbol,t)}function Ye(e){let n=new Map;for(let s of e.values())for(let a of s.matches.keys())n.set(a,(n.get(a)??0)+1);return n}function In(e,n,s,a){let r=n[0]?.documentId;if(r===void 0||n.find(i=>i.isFunctionLike&&i.leaf===s.name&&i.startLine===s.startLine&&i.endLine===s.endLine))return null;let t=a();return{documentId:r,symbolId:t,symbol:`${ke}${e}:${s.startLine}:${s.endLine}:${s.name}`,relativePath:e,startLine:s.startLine,startChar:0,endLine:s.endLine,endChar:0,leaf:s.name,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}}function xn(e,n,s){let a=new Set(n.slice(0,Cn).map(t=>t.file)),r=new Set(s),o=e.map(t=>{let i=T(t.relativePath),d=t.relativePath.slice(t.relativePath.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),l=T(d),c=[...i].filter(u=>r.has(u)).length,m=[...l].filter(u=>r.has(u)).length;return{file:t,score:m*4+c}}).filter(t=>t.score>0).sort((t,i)=>i.score-t.score||x(U(t.file.relativePath))-x(U(i.file.relativePath))||t.file.relativePath.localeCompare(i.file.relativePath)).slice(0,Rn);for(let t of o)a.add(t.file.relativePath);return e.filter(t=>a.has(t.relativePath))}function En(e,n){return e.filter(s=>s.startLine<=n&&s.endLine>=n).sort((s,a)=>s.endLine-s.startLine-(a.endLine-a.startLine)||s.startLine-a.startLine)[0]}function Fn(e){let n=new Map;for(let s of e){if(!G(s))continue;let a=`${s.relativePath}\0${$(s.leaf)}`,r=n.get(a)??[];r.push(s),n.set(a,r)}return n}function Qe(e,n){return e.filter(s=>s.startLine<=n&&s.endLine>=n).sort((s,a)=>s.endLine-s.startLine-(a.endLine-a.startLine)||Number(G(a))-Number(G(s))||s.startLine-a.startLine||s.symbol.localeCompare(a.symbol))[0]}function G(e){return e.symbol.startsWith(ke)}function W(e){return G(e)?e.leaf:te(e.symbol)}function Se(e,n,s=[]){let a=e.definition,r=[...e.matches.entries()].map(([l,c])=>({term:l,sources:[...c.sources].sort(gt),locations:[...c.locations.values()].sort(un).slice(0,3)})).sort((l,c)=>l.term.localeCompare(c.term)),o=r.filter(l=>l.sources.some(c=>c!=="source")).map(l=>l.term),t=r.filter(l=>l.sources.includes("symbol")).map(l=>l.term),i=r.reduce((l,c)=>l+1/Math.max(1,n.get(c.term)??1),0),d=r.filter(l=>l.sources.includes("symbol")).reduce((l,c)=>l+1/Math.max(1,n.get(c.term)??1),0);return{symbol:a.symbol,label:W(a),leaf:a.leaf,file:a.relativePath,line:a.startLine,endLine:a.endLine,kind:a.isFunctionLike?"callable":a.isTypeLike?"type":"symbol",fileKind:U(a.relativePath),matches:r,focusLocations:At(e,n),matchedTerms:r.map(l=>l.term),symbolMatchedTerms:t,symbolPhraseLength:e.symbolPhraseLength,identityMatchedTerms:o,rarity:i,symbolRarity:d,queryPathMatches:pt(a.relativePath,s),...e.sourceCharacters===void 0?{}:{sourceCharacters:e.sourceCharacters}}}function kn(e,n,s,a,r,o,t,i){let d=a.filter(b=>!G(b)),l=n.calleeMap(d,{additive:!1,semantic:i}),c=new Map,m=new Map;for(let b of s){let v=r.get(b.symbol),S=v?G(v)?Ve(e,v,r,o,1):ve(e,v,l.get(v.symbolId)??[],r,1,t):[];c.set(b.symbol,S);for(let M of S){let f=r.get(M.toSymbol);f?.isFunctionLike&&(!v||!G(v)||G(f))&&m.set(f.symbol,f)}}let u=[...m.values()],h=n.calleeMap(u.filter(b=>!G(b)),{additive:!1,semantic:i}),y=new Map;for(let b of u)y.set(b.symbol,G(b)?Ve(e,b,r,o,2):ve(e,b,h.get(b.symbolId)??[],r,2,t));return s.map(b=>{let v=c.get(b.symbol)??[],S=v.flatMap(f=>y.get(f.toSymbol)??[]),M=q([...v,...S]);return{root:b,relations:M,nodeSymbols:new Set([b.symbol,...M.flatMap(f=>[f.fromSymbol,f.toSymbol])])}})}function ve(e,n,s,a,r,o=new Set){let t=new Map;for(let i of s){let d=a.get(i.symbol);if(!d?.isFunctionLike||d.symbol===n.symbol||i.source==="ast-callsite"&&!On(e,n,d,i.callsiteLine))continue;let l=t.get(d.symbol);(!l||yt(i,l)<0)&&t.set(d.symbol,i)}return[...t.entries()].map(([i,d])=>{let l=a.get(i);return{kind:"call",fromSymbol:n.symbol,fromLabel:te(n.symbol),fromFile:n.relativePath,toSymbol:l.symbol,toLabel:te(l.symbol),toFile:l.relativePath,depth:r,strength:Fe(d.source),evidence:d.source,callsiteLine:d.callsiteLine??_n(e,n,l)}}).sort((i,d)=>Number(o.has(d.toSymbol))-Number(o.has(i.toSymbol))||X(i,d)).slice(0,bn)}function Ve(e,n,s,a,r){let o=ge(e,n.relativePath,n.startLine,n.endLine).targets.flatMap(t=>{let i=s.get(t.definition.symbol)??t.definition;return!i.isFunctionLike||i.symbol===n.symbol?[]:[{kind:"call",fromSymbol:n.symbol,fromLabel:W(n),fromFile:n.relativePath,toSymbol:i.symbol,toLabel:W(i),toFile:i.relativePath,depth:r,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:t.sourceLine}]});for(let t of Te(e,n.relativePath,{ranges:[{startLine:n.startLine,endLine:n.endLine}],excludeIndexedTargets:!1}).targets){let i=[...a.get(`${t.targetFile}\0${$(t.calleeLeaf)}`)??[],...be(e,t.targetFile).filter(d=>d.isFunctionLike&&$(d.leaf)===t.calleeLeaf)].find(d=>d.startLine===t.targetStartLine&&d.endLine===t.targetEndLine);!i||i.symbol===n.symbol||o.push({kind:"call",fromSymbol:n.symbol,fromLabel:W(n),fromFile:n.relativePath,toSymbol:i.symbol,toLabel:W(i),toFile:i.relativePath,depth:r,strength:t.strength==="exact"?"exact":"derived",evidence:"ast-member-import-candidate",callsiteLine:t.line})}for(let t of Q(e,n.relativePath)?.callSites??[]){if(t.line<n.startLine||t.line>n.endLine||t.memberAccess)continue;let i=(a.get(`${n.relativePath}\0${$(t.calleeLeaf)}`)??[]).filter(l=>l.symbol!==n.symbol);if(i.length!==1)continue;let d=i[0];o.push({kind:"call",fromSymbol:n.symbol,fromLabel:W(n),fromFile:n.relativePath,toSymbol:d.symbol,toLabel:W(d),toFile:d.relativePath,depth:r,strength:"derived",evidence:"ast-callsite",callsiteLine:t.line})}return q(o).sort(X)}function _n(e,n,s){let a=$(s.leaf);return Q(e,n.relativePath)?.callSites.find(r=>r.line>=n.startLine&&r.line<=n.endLine&&$(r.calleeLeaf)===a)?.line??null}function On(e,n,s,a){if(a===void 0)return!1;let r=$(s.leaf);return Q(e,n.relativePath)?.callSites.some(o=>o.line===a&&$(o.calleeLeaf)===r)??!1}function $(e){return e.replace(/^#/u,"").replace(/\(\)$/u,"")}function Nn(e,n,s,a,r){let o=new Map(n.map((c,m)=>[c.symbol,m])),t=n.map((c,m)=>m),i=c=>{let m=c;for(;t[m]!==m;)m=t[m];for(;t[c]!==c;){let u=t[c];t[c]=m,c=u}return m},d=(c,m)=>{let u=i(c),h=i(m);u!==h&&(t[h]=u)};for(let c of e){let m=o.get(c.root.symbol);if(m!==void 0)for(let u of c.nodeSymbols){let h=o.get(u);h!==void 0&&d(m,h)}}let l=new Map;for(let c=0;c<n.length;c+=1){let m=i(c),u=l.get(m)??[];u.push(n[c]),l.set(m,u)}return[...l.values()].map((c,m)=>{let u=new Set(c.map(f=>f.symbol)),h=q(e.filter(f=>u.has(f.root.symbol)).flatMap(f=>f.relations)).sort(X),y=new Map(c.map(f=>[f.symbol,f]));for(let f of new Set(h.flatMap(C=>[C.fromSymbol,C.toSymbol]))){let C=s.get(f);if(C)y.has(f)||y.set(f,Se(C,a));else{let A=r.get(f);A&&y.set(f,dn(A))}}let b=st(c,h,y),v=c.filter(f=>h.some(C=>C.fromSymbol===f.symbol)).length,S=[...new Set(c.flatMap(f=>f.matchedTerms))].sort(),M=rt(h,b,u,y);return{id:`anchor-set:${m+1}:${me(c[0])}`,kind:"connected-flow",roots:[...c].sort(R),keyAnchors:b,candidateOwnerCount:b.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[],matchedTerms:S,relations:M,relationCount:h.length,orchestrationRootCount:v,omittedRelations:Math.max(0,h.length-J),systemMapCommand:he(b,h,S)}})}function Gn(e,n,s){let a=new Map(s.map((o,t)=>[o,t])),r=[];for(let o=0;o<e.length;o+=1){let t=e[o],i=Ze(t);if(i.size!==0)for(let d=o+1;d<e.length;d+=1){let l=e[d],c=Ze(l),m=[...i].filter(A=>c.has(A));if(m.length===0||![...i].some(A=>!c.has(A))||![...c].some(A=>!i.has(A)))continue;let u=$n(t,l);if(u.length<2)continue;let h=q([...t.relations,...l.relations]).sort(X),y=h.slice(0,J),b=re([...t.roots,...l.roots]).sort(R),v=[...new Set([...t.matchedTerms,...l.matchedTerms])].sort(),S=m.sort((A,P)=>(a.get(A)??Number.MAX_SAFE_INTEGER)-(a.get(P)??Number.MAX_SAFE_INTEGER)||A.localeCompare(P)),M=+(t.relationCount>0)+ +(l.relationCount>0),f=+((t.orchestrationRootCount??0)>0)+ +((l.orchestrationRootCount??0)>0),C=Math.min(...S.map(A=>n.get(A)??Number.MAX_SAFE_INTEGER));r.push({sharedOrder:Math.min(...S.map(A=>a.get(A)??Number.MAX_SAFE_INTEGER)),sharedFrequency:C,connectedSides:M,orchestrationSides:f,group:{id:`parallel-paths:${me(t.roots[0])}:${me(l.roots[0])}`,kind:"parallel-paths",roots:b,keyAnchors:u,candidateOwnerCount:u.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[...t.upstreamEntries,...l.upstreamEntries],matchedTerms:v,relations:y,relationCount:h.length,parallelConnectedSides:M,parallelOrchestrationSides:f,parallelSharedPathTerms:S,parallelSharedPathFrequency:C,orchestrationRootCount:(t.orchestrationRootCount??0)+(l.orchestrationRootCount??0),omittedRelations:Math.max(0,h.length-y.length),systemMapCommand:he(u,h,v)}})}}return r.sort((o,t)=>o.sharedFrequency-t.sharedFrequency||t.orchestrationSides-o.orchestrationSides||t.connectedSides-o.connectedSides||o.sharedOrder-t.sharedOrder||t.group.matchedTerms.length-o.group.matchedTerms.length||Z(o.group,t.group,n)).slice(0,Dn).map(o=>o.group)}function Ze(e){return new Set(e.roots.flatMap(n=>n.matches.filter(s=>s.sources.includes("path")).map(s=>s.term)))}function $n(e,n){return re([Je(e),Je(n)].filter(s=>s!==void 0))}function Je(e){let n=new Set(e.keyAnchors.map(a=>a.symbol)),s=new Map;for(let a of e.relations)!n.has(a.fromSymbol)||!n.has(a.toSymbol)||s.set(a.fromSymbol,(s.get(a.fromSymbol)??0)+1);return[...e.keyAnchors].sort((a,r)=>+((s.get(r.symbol)??0)>0)-+((s.get(a.symbol)??0)>0)||en(r)-en(a)||r.identityMatchedTerms.length-a.identityMatchedTerms.length||r.symbolMatchedTerms.length-a.symbolMatchedTerms.length||(s.get(r.symbol)??0)-(s.get(a.symbol)??0)||R(a,r))[0]}function en(e){return e.matchedTerms.length+e.identityMatchedTerms.length*2+(e.queryPathMatches?.length??0)*4}function Xn(e,n,s,a,r,o){let t=qe(e);if(!t||t.links.length===0||s.length<2)return[];let i=new Map(t.observations.map(h=>[h.id,h])),d=new Map,l=new Map,c=[...s].sort((h,y)=>Z(h,y,r)).slice(0,vn),m=t.links.filter(h=>h.strength!=="candidate").sort((h,y)=>j(y.strength)-j(h.strength)||y.matchedKeyParts.length-h.matchedKeyParts.length||h.id.localeCompare(y.id));for(let h of c)for(let y of m){let b=i.get(y.from),v=i.get(y.to);if(!b||!v||!Kn(h,b,a))continue;let S=qn(h,b,a);if(!S)continue;let M=d.get(v.id)??Un(e,n,v,a,o,Mn);if(d.set(v.id,M),M.reachedSymbols.size===0)continue;let f=s.filter(L=>L.id!==h.id&&Bn(L).some(k=>M.reachedSymbols.has(k))&&Ie(S,L)>=2).sort((L,k)=>Ie(S,k)-Ie(S,L)||Z(L,k,r)).slice(0,An);if(f.length===0)continue;let C=[h.id,b.id,...f.map(L=>L.id).sort()].join("\0");if(l.has(C))continue;let A=new Set(f.flatMap(ue)),P=Qn(de(v),A,M.relations);if(P.length===0)continue;let I=Yn(b,v,y.joinRule,y.matchedKeyParts,y.strength),H=q([I,...M.relations,...h.relations,...f.flatMap(L=>L.relations)]),E=Vn([I,...P],H,h,f),B=re([S,...f.flatMap(L=>L.roots)]).sort(R),F=re([S,...f.flatMap(L=>L.keyAnchors)]).slice(0,Ln),K=[...new Set([...S.matchedTerms,...f.flatMap(L=>L.matchedTerms)])].sort(),ie=zn(e,n,S,a,o);B.length===0||F.length<2||l.set(C,{id:`cross-boundary-set:${me(S)}:${l.size+1}`,kind:"cross-boundary-flow",roots:B,keyAnchors:F,candidateOwnerCount:F.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:ie,matchedTerms:K,relations:E,relationCount:H.length,omittedRelations:Math.max(0,H.length-E.length),systemMapCommand:he(F,H,K)})}let u=new Map;for(let[h,y]of l){let b=h.slice(0,h.indexOf("\0")),v=u.get(b);(!v||Z(y,v,r)<0)&&u.set(b,y)}return[...u.values()]}function Kn(e,n,s){let a=new Set(ue(e));return n.owner.symbol&&a.has(n.owner.symbol)?!0:[...a].map(r=>s.get(r)).some(r=>r?.relativePath===n.source.file&&r.startLine<=n.source.startLine&&r.endLine>=n.source.endLine)}function qn(e,n,s){let a=re([...e.roots,...e.keyAnchors]);if(n.owner.symbol){let r=a.find(o=>o.symbol===n.owner.symbol);if(r)return r}return a.find(r=>{let o=s.get(r.symbol);return o?.relativePath===n.source.file&&o.startLine<=n.source.startLine&&o.endLine>=n.source.endLine})??null}function ue(e){return[...new Set([...e.roots.map(n=>n.symbol),...e.keyAnchors.map(n=>n.symbol),...e.relations.flatMap(n=>[n.fromSymbol,n.toSymbol])])]}function Bn(e){return[...new Set([...e.roots,...e.keyAnchors].map(n=>n.symbol))]}function Ie(e,n){let s=T(e.leaf),a=[...n.roots,...n.keyAnchors].map(o=>T(o.leaf)),r=0;for(let o of a){let t=0;for(let i of s)o.has(i)&&(t+=1);r=Math.max(r,t)}return r}function zn(e,n,s,a,r){let o=a.get(s.symbol);if(!o?.isFunctionLike)return[];let t=n.callerFileMap([o],{semantic:r,sourceFallback:!0}).get(o.symbolId);if(!t)return[];let i=T(s.leaf);return[...t].filter(d=>d!==s.file&&U(d)!=="test").flatMap(d=>{let l=Q(e,d);return(l?.callSites??[]).filter(c=>$(c.calleeLeaf)===$(s.leaf)).flatMap(c=>{let m=(l?.callables??[]).filter(h=>h.startLine<=c.line&&h.endLine>=c.line).sort((h,y)=>h.endLine-h.startLine-(y.endLine-y.startLine)||h.startLine-y.startLine)[0];if(!m)return[];let u=[...T(m.name)].filter(h=>i.has(h)).length;return u>=2?[{name:m.name,file:d,line:m.startLine,endLine:m.endLine,callsiteLine:c.line,overlap:u}]:[]})}).sort((d,l)=>l.overlap-d.overlap||d.file.localeCompare(l.file)||d.line-l.line).slice(0,1).map(({name:d,file:l,line:c,endLine:m,callsiteLine:u})=>({name:d,file:l,line:c,endLine:m,callsiteLine:u}))}function Un(e,n,s,a,r,o){let t=Wn(e,s,a),i=t.map(({definition:u,evidence:h,line:y})=>({kind:"call",fromSymbol:de(s),fromLabel:Ae(s),fromFile:s.source.file,toSymbol:u.symbol,toLabel:te(u.symbol),toFile:u.relativePath,depth:1,strength:h==="scip-occurrence-callsite"?"exact":"derived",evidence:h,callsiteLine:y})),d=jn(e,s);i.push(...d.relations);let l=ln([...t.map(u=>u.definition),...d.definitions]),c=l,m=new Set(c.map(u=>u.symbol));for(let u=2;u<=o+1&&c.length>0;u+=1){let h=n.calleeMap(c,{additive:!1,semantic:r}),y=new Map;for(let b of c){let v=ve(e,b,h.get(b.symbolId)??[],a,u);i.push(...v);for(let S of v){let M=a.get(S.toSymbol);M?.isFunctionLike&&!m.has(M.symbol)&&y.set(M.symbol,M)}}c=[...y.values()];for(let b of c)m.add(b.symbol)}return{entryDefinitions:l,relations:q(i),reachedSymbols:new Set([...l.map(u=>u.symbol),...i.flatMap(u=>[u.fromSymbol,u.toSymbol])])}}function Wn(e,n,s){let a=n.owner.symbol?s.get(n.owner.symbol):void 0;if(a?.isFunctionLike&&!oe(a.symbol))return[{definition:a,evidence:"scip-occurrence-callsite",line:n.source.startLine}];let r=Re(e,n.source.file),o=we(e,n.source.file,0,Math.max(0,r.length-1),[n.source.startLine]),t=ge(e,n.source.file,o.startLine,o.endLine).targets.map(c=>({definition:c.definition,evidence:"scip-occurrence-callsite",line:c.sourceLine})),i=Q(e,n.source.file),d=Xe(e),l=(i?.callSites??[]).flatMap(c=>{if(c.line<o.startLine||c.line>o.endLine)return[];let m=Ge(n.source.file,d.get(c.calleeLeaf)??[]),u=$e(e,n.source.file,m,c.memberAccess,c.calleeQualifier),h=u?s.get(u.symbol):void 0;return h?.isFunctionLike?[{definition:h,evidence:"ast-callsite",line:c.line}]:[]});return Hn([...t,...l])}function jn(e,n){let s=Re(e,n.source.file),a=we(e,n.source.file,0,Math.max(0,s.length-1),[n.source.startLine]),r=Te(e,n.source.file,{ranges:[a],excludeIndexedTargets:!1}).targets,o=[],t=[];for(let i of r){let d=`source-construct:${i.targetFile}:${i.targetStartLine}:${i.targetEndLine}:${i.calleeLeaf}`;t.push({kind:"call",fromSymbol:de(n),fromLabel:Ae(n),fromFile:n.source.file,toSymbol:d,toLabel:i.calleeLeaf,toFile:i.targetFile,depth:1,strength:"derived",evidence:"ast-member-import-candidate",callsiteLine:i.line});let l=ge(e,i.targetFile,i.targetStartLine,i.targetEndLine).targets;for(let c of l)o.push(c.definition),t.push({kind:"call",fromSymbol:d,fromLabel:i.calleeLeaf,fromFile:i.targetFile,toSymbol:c.definition.symbol,toLabel:te(c.definition.symbol),toFile:c.definition.relativePath,depth:2,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:c.sourceLine})}return{definitions:ln(o),relations:q(t)}}function Hn(e){return[...new Map(e.map(n=>[n.definition.symbol,n])).values()]}function ln(e){return[...new Map(e.map(n=>[n.symbol,n])).values()]}function de(e){return e.owner.symbol??e.id}function Ae(e){return e.owner.name??`${e.source.file}:${e.source.startLine+1}`}function Yn(e,n,s,a,r){return{kind:"runtime-boundary",fromSymbol:de(e),fromLabel:Ae(e),fromFile:e.source.file,toSymbol:de(n),toLabel:Ae(n),toFile:n.source.file,depth:1,strength:r,evidence:`runtime-boundary:${s}`,callsiteLine:e.source.startLine,runtimeBoundaryKey:a.map(o=>`${o.name}=${o.value}`).join(" ")}}function Qn(e,n,s){let a=new Map;for(let t of s){let i=a.get(t.fromSymbol)??[];i.push(t),a.set(t.fromSymbol,i)}let r=[{symbol:e,path:[]}],o=new Set([e]);for(;r.length>0;){let t=r.shift();if(t.path.length>0&&n.has(t.symbol))return t.path;for(let i of(a.get(t.symbol)??[]).sort(X))o.has(i.toSymbol)||(o.add(i.toSymbol),r.push({symbol:i.toSymbol,path:[...t.path,i]}))}return[]}function Vn(e,n,s,a){let r=q(e),o=new Set([s,...a].flatMap(t=>[...ue(t),...t.keyAnchors.map(i=>i.symbol)]));for(let t of n){if(r.length>=J)break;!o.has(t.fromSymbol)&&!o.has(t.toSymbol)||r.some(i=>i.fromSymbol===t.fromSymbol&&i.toSymbol===t.toSymbol)||r.push(t)}return r.slice(0,J)}function Zn(e,n,s,a,r,o,t,i){let d=s.filter(c=>!c.root.symbol.startsWith(ke)).map(c=>({root:c.root,relations:c.relations.filter(m=>m.depth===1&&m.fromSymbol===c.root.symbol)}));return Jn(d).flatMap((c,m)=>{let u=new Set(c.map(p=>p.root.symbol)),h=new Map;for(let p of c)for(let w of new Set(p.relations.map(ee=>ee.toSymbol)))h.set(w,(h.get(w)??0)+1);let y=[...h].filter(([,p])=>p>=2).sort(([p,w],[ee,ye])=>ye-w||et(p,ee,a,r,t)).map(([p])=>t.get(p)).filter(p=>p?.isFunctionLike===!0).slice(0,gn);if(y.length===0)return[];let b=n.callerFileMap(y,{semantic:i,sourceFallback:!0}),v=new Set;for(let p of y){v.add(p.relativePath);for(let w of b.get(p.symbolId)??[])v.add(w)}let S=o.filter(p=>p.isFunctionLike&&v.has(p.relativePath)).sort(nt).slice(0,Sn),M=n.calleeMap(S,{additive:!1,semantic:i}),f=new Set(y.map(p=>p.symbol)),C=q(S.flatMap(p=>ve(e,p,M.get(p.symbolId)??[],t,1,f).filter(w=>f.has(w.toSymbol)))),A=new Map;for(let p of C){let w=A.get(p.fromSymbol)??new Set;w.add(p.toSymbol),A.set(p.fromSymbol,w)}let P=new Set([...A].filter(([p,w])=>w.size>=2||u.has(p)).map(([p])=>p)),I=C.filter(p=>P.has(p.fromSymbol));if(P.size<2||I.length===0)return[];let E=[...new Set(I.map(p=>p.toSymbol))].map(p=>Me(p,a,r,t)).filter(p=>p!==null).sort(R),B=[...P].map(p=>Me(p,a,r,t)).filter(p=>p!==null),F=tt(B,I),K=F.slice(0,Pe),ie=F.slice(Pe);if(E.length===0||K.length===0)return[];let L=[...new Set([...E.flatMap(p=>p.matchedTerms),...c.flatMap(p=>p.root.matchedTerms)])].sort(),k=ot(I,K);return[{id:`effect-owner-set:${m+1}:${me(E[0])}`,kind:"shared-callee-owners",roots:E,keyAnchors:K,candidateOwnerCount:F.length,omittedCandidateOwners:ie,ownerRecoveryCommands:Mt(ie,Pe),upstreamEntries:[],matchedTerms:L,relations:k,relationCount:I.length,omittedRelations:Math.max(0,I.length-k.length),systemMapCommand:he(K,I,L)}]})}function Jn(e){let n=e.map((t,i)=>i),s=t=>{for(;n[t]!==t;)n[t]=n[n[t]],t=n[t];return t},a=(t,i)=>{let d=s(t),l=s(i);d!==l&&(n[l]=d)},r=e.map(t=>new Set(t.relations.map(i=>i.toSymbol)));for(let t=0;t<e.length;t+=1)for(let i=t+1;i<e.length;i+=1){let d=0;for(let l of r[t]??[])if((r[i]??new Set).has(l)&&(d+=1),d>=2)break;d>=2&&a(t,i)}let o=new Map;for(let t=0;t<e.length;t+=1){let i=s(t),d=o.get(i)??[];d.push(e[t]),o.set(i,d)}return[...o.values()].filter(t=>t.length>=2)}function et(e,n,s,a,r){let o=Me(e,s,a,r),t=Me(n,s,a,r);return o?t?R(o,t):-1:t?1:e.localeCompare(n)}function nt(e,n){return x(U(e.relativePath))-x(U(n.relativePath))||e.relativePath.localeCompare(n.relativePath)||e.startLine-n.startLine}function Me(e,n,s,a){let r=n.get(e);if(r)return Se(r,s);let o=a.get(e);return o?dn(o):null}function tt(e,n){let s=new Map;for(let r of n){let o=s.get(r.toSymbol)??new Set;o.add(r.fromSymbol),s.set(r.toSymbol,o)}let a=new Map;for(let r of n){let o=s.get(r.toSymbol)?.size??1;a.set(r.fromSymbol,(a.get(r.fromSymbol)??0)+o*o)}return[...e].sort((r,o)=>Number(r.leaf.startsWith("#"))-Number(o.leaf.startsWith("#"))||o.identityMatchedTerms.length-r.identityMatchedTerms.length||(a.get(o.symbol)??0)-(a.get(r.symbol)??0)||R(r,o))}function ot(e,n){let s=new Map(n.map((t,i)=>[t.symbol,i])),a=n.map(t=>e.filter(i=>i.fromSymbol===t.symbol).sort(X)),r=[],o=0;for(;r.length<J&&a.some(t=>o<t.length);){for(let t of a){let i=t[o];if(i&&r.push(i),r.length>=J)break}o+=1}return r.sort((t,i)=>s.get(t.fromSymbol)-s.get(i.fromSymbol)||X(t,i))}function rt(e,n,s,a){let r=new Map(n.map((i,d)=>[i.symbol,d])),o=new Map;for(let i of e)o.set(i.fromSymbol,(o.get(i.fromSymbol)??0)+1);return[...e].sort((i,d)=>{let l=c=>{let m=0;return r.has(c.fromSymbol)&&(m+=100),s.has(c.toSymbol)&&(m+=60),m+=Math.min(40,(o.get(c.toSymbol)??0)*8),(a.get(c.toSymbol)?.matchedTerms.length??0)>0&&(m+=25),c.fromFile!==c.toFile&&(m+=15),c.strength==="exact"&&(m+=5),m};return l(d)-l(i)||X(i,d)}).slice(0,J).sort((i,d)=>(r.get(i.fromSymbol)??V)-(r.get(d.fromSymbol)??V)||i.depth-d.depth||(i.callsiteLine??Number.MAX_SAFE_INTEGER)-(d.callsiteLine??Number.MAX_SAFE_INTEGER)||X(i,d))}function dn(e){return{symbol:e.symbol,label:W(e),leaf:e.leaf,file:e.relativePath,line:e.startLine,endLine:e.endLine,kind:e.isFunctionLike?"callable":e.isTypeLike?"type":"symbol",fileKind:U(e.relativePath),matches:[],focusLocations:[],matchedTerms:[],symbolMatchedTerms:[],symbolPhraseLength:0,identityMatchedTerms:[],rarity:0,symbolRarity:0}}function st(e,n,s){let a=[...e].sort(R),r=[],o=new Map;for(let c of n)o.set(c.fromSymbol,(o.get(c.fromSymbol)??0)+1);let t=new Set,i=new Set,d=c=>{if(!(!c||r.some(m=>m.symbol===c.symbol))){r.push(c);for(let m of c.matchedTerms)t.add(m);for(let m of c.symbolMatchedTerms)i.add(m)}},l=a.filter(c=>c.symbolPhraseLength>=2&&(o.get(c.symbol)??0)>=2);for(;r.length<Math.min(2,V);){let c=l.filter(m=>!r.some(u=>u.symbol===m.symbol)).sort((m,u)=>u.symbolMatchedTerms.filter(h=>!i.has(h)).length-m.symbolMatchedTerms.filter(h=>!i.has(h)).length||u.symbolPhraseLength-m.symbolPhraseLength||(o.get(u.symbol)??0)-(o.get(m.symbol)??0)||xe(m,u))[0];if(!c||r.length>0&&c.symbolMatchedTerms.every(m=>i.has(m)))break;d(c)}if(d(a[0]),r.length>=2){let c=it(r[0].symbol,r[1].symbol,n,s);for(let m of c?.slice(1,-1)??[]){if(r.length>=V)break;d(s.get(m))}if(r.length<V){let m=new Set(r.map(y=>y.symbol)),u=new Set(n.filter(y=>y.depth===1&&m.has(y.fromSymbol)&&m.has(y.toSymbol)).map(y=>y.fromSymbol)),h=n.filter(y=>y.depth===1&&u.has(y.fromSymbol)&&!m.has(y.toSymbol)).map(y=>({relation:y,candidate:s.get(y.toSymbol)})).filter(y=>y.candidate!==void 0&&y.candidate.symbolPhraseLength>=2&&y.candidate.symbolMatchedTerms.length>=2).sort((y,b)=>(o.get(y.relation.fromSymbol)??0)-(o.get(b.relation.fromSymbol)??0)||xe(y.candidate,b.candidate))[0]?.candidate;d(h)}}else for(;r.length<Math.min(3,V);){let c=a.filter(m=>!r.some(u=>u.symbol===m.symbol)).sort((m,u)=>u.matchedTerms.filter(h=>!t.has(h)).length-m.matchedTerms.filter(h=>!t.has(h)).length||R(m,u))[0];if(!c||c.matchedTerms.every(m=>t.has(m)))break;d(c)}for(;r.length>=2&&r.length<V;){let c=new Set(r.map(u=>u.symbol)),m=[...s.values()].filter(u=>!c.has(u.symbol)&&(o.get(u.symbol)??0)>0&&n.some(h=>c.has(h.fromSymbol)&&h.toSymbol===u.symbol)).sort((u,h)=>h.identityMatchedTerms.length-u.identityMatchedTerms.length||h.symbolMatchedTerms.length-u.symbolMatchedTerms.length||h.matchedTerms.length-u.matchedTerms.length||(o.get(h.symbol)??0)-(o.get(u.symbol)??0)||R(u,h))[0];if(!m)break;d(m)}if(r.length<2){let c=r[0],m=c?a.filter(u=>u.symbol!==c.symbol).map(u=>({root:u,path:at(u.symbol,c.symbol,n)})).filter(u=>u.path!==null).sort((u,h)=>+(h.root.file!==c.file)-+(u.root.file!==c.file)||u.path.length-h.path.length||R(u.root,h.root))[0]?.root:void 0;d(m)}return r}function it(e,n,s,a){let r=new Map;for(let i of s){let d=r.get(i.fromSymbol)??new Set;d.add(i.toSymbol),r.set(i.fromSymbol,d);let l=r.get(i.toSymbol)??new Set;l.add(i.fromSymbol),r.set(i.toSymbol,l)}let o=[{path:[e],cost:0}],t=new Map([[e,0]]);for(;o.length>0;){o.sort((c,m)=>c.cost-m.cost||c.path.length-m.path.length);let{path:i,cost:d}=o.shift(),l=i.at(-1);if(l===n)return i;for(let c of r.get(l)??[]){let m=a.get(c),u=c===n?1:!m||m.matchedTerms.length===0?9:m.symbolPhraseLength>=2?1:m.identityMatchedTerms.length>=2?2:4,h=d+u;h>=(t.get(c)??Number.POSITIVE_INFINITY)||(t.set(c,h),o.push({path:[...i,c],cost:h}))}}return null}function at(e,n,s){let a=new Map;for(let t of s){let i=a.get(t.fromSymbol)??[];i.push(t.toSymbol),a.set(t.fromSymbol,i)}let r=[[e]],o=new Set([e]);for(;r.length>0;){let t=r.shift(),i=t.at(-1);if(i===n)return t;for(let d of a.get(i)??[])o.has(d)||(o.add(d),r.push([...t,d]))}return null}function R(e,n){return(n.queryPathMatches?.length??0)-(e.queryPathMatches?.length??0)||n.identityMatchedTerms.length-e.identityMatchedTerms.length||n.matchedTerms.length-e.matchedTerms.length||n.rarity-e.rarity||se(e.kind)-se(n.kind)||x(e.fileKind)-x(n.fileKind)||e.file.localeCompare(n.file)||e.line-n.line}function xe(e,n){return n.symbolPhraseLength-e.symbolPhraseLength||n.symbolMatchedTerms.length-e.symbolMatchedTerms.length||se(e.kind)-se(n.kind)||n.symbolRarity-e.symbolRarity||R(e,n)}function ct(e,n){return n.flatMap(s=>{let a=e.filter(t=>t.matchedTerms.includes(s)).sort((t,i)=>dt(t,i,s)),r=[],o=new Set;for(let t of a)if(!o.has(t.file)&&(r.push(t),o.add(t.file),r.length>=We))return r;for(let t of a)if(!r.some(i=>i.symbol===t.symbol)&&(r.push(t),r.length>=We))break;return r})}function lt(e,n,s){let a=new Set(n),r=new Map;for(let o of e){if(o.kind!=="callable")continue;let t=o.file.slice(o.file.lastIndexOf("/")+1).replace(/\.[^.]+$/u,"");if(![...T(t)].some(d=>a.has(d)))continue;let i=r.get(o.file)??[];i.push(o),r.set(o.file,i)}return[...r.entries()].map(([o,t])=>{let i=o.slice(o.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),d=[...T(i)].filter(l=>a.has(l));return{file:o,fileCandidates:t,sharedFrequency:Math.min(...d.map(l=>s.get(l)??Number.MAX_SAFE_INTEGER))}}).sort((o,t)=>x(o.fileCandidates[0].fileKind)-x(t.fileCandidates[0].fileKind)||o.sharedFrequency-t.sharedFrequency||o.file.localeCompare(t.file)).flatMap(({fileCandidates:o})=>[...o].sort(R).slice(0,Tn)).slice(0,wn)}function dt(e,n,s){return nn(e,s)-nn(n,s)||x(e.fileKind)-x(n.fileKind)||n.symbolPhraseLength-e.symbolPhraseLength||se(e.kind)-se(n.kind)||R(e,n)}function nn(e,n){let s=e.matches.find(a=>a.term===n)?.sources??[];return Math.min(...s.map(Ee),Number.MAX_SAFE_INTEGER)}function re(e){return[...new Map(e.map(n=>[n.symbol,n])).values()]}function Z(e,n,s){let a=new Set(e.roots.flatMap(o=>o.symbolMatchedTerms)),r=new Set(n.roots.flatMap(o=>o.symbolMatchedTerms));return(n.queryPathMatches?.length??0)-(e.queryPathMatches?.length??0)||sn(e.kind)-sn(n.kind)||on(e)-on(n)||rn(e)-rn(n)||(e.kind==="parallel-paths"&&n.kind==="parallel-paths"?(e.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)-(n.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)||(n.parallelOrchestrationSides??0)-(e.parallelOrchestrationSides??0)||(n.parallelSharedPathTerms?.length??0)-(e.parallelSharedPathTerms?.length??0):0)||tn(n,s)-tn(e,s)||n.matchedTerms.length-e.matchedTerms.length||Math.max(...n.roots.map(o=>o.symbolPhraseLength))-Math.max(...e.roots.map(o=>o.symbolPhraseLength))||r.size-a.size||R(e.roots[0],n.roots[0])||n.roots.length-e.roots.length||e.relationCount-n.relationCount||e.id.localeCompare(n.id)}function tn(e,n){return e.matchedTerms.reduce((s,a)=>s+1/Math.max(1,n.get(a)??1),0)}function mt(e){return[...new Set(e.roots.flatMap(n=>n.queryPathMatches??[]))].sort()}function on(e){let n=e.keyAnchors.length>0?e.keyAnchors:e.roots;return Math.max(...n.map(s=>x(s.fileKind)))}function rn(e){return e.kind==="parallel-paths"?2-(e.parallelConnectedSides??0):e.kind!=="connected-flow"||e.relationCount>0?0:1}function ut(e,n,s){let a=e.slice(0,n);if(n<2||a.some(o=>o.kind==="shared-callee-owners"))return a;let r=e.filter(o=>o.kind==="shared-callee-owners");for(let o of a){if(o.kind==="shared-callee-owners"||o.kind==="parallel-paths")continue;let t=new Set(ue(o)),i=r.map(l=>({group:l,overlap:ht(l,t)})).filter(({overlap:l})=>l>0).sort(({group:l,overlap:c},{group:m,overlap:u})=>u-c||Z(l,m,s))[0]?.group;if(!i)continue;let d=a.length-1;for(;d>=0&&a[d]===o;)d-=1;return d<0?a:(a[d]=i,[...a].sort((l,c)=>Z(l,c,s)))}return a}function ht(e,n){return ue(e).filter(s=>n.has(s)).length}function sn(e){switch(e){case"cross-boundary-flow":return 0;case"parallel-paths":case"connected-flow":return 1;case"shared-callee-owners":return 2}}function X(e,n){return e.depth-n.depth||j(n.strength)-j(e.strength)||e.fromLabel.localeCompare(n.fromLabel)||e.toLabel.localeCompare(n.toLabel)||(e.callsiteLine??Number.MAX_SAFE_INTEGER)-(n.callsiteLine??Number.MAX_SAFE_INTEGER)}function yt(e,n){return j(Fe(n.source))-j(Fe(e.source))||(e.callsiteLine??Number.MAX_SAFE_INTEGER)-(n.callsiteLine??Number.MAX_SAFE_INTEGER)||e.symbol.localeCompare(n.symbol)}function q(e){let n=new Map;for(let s of e){let a=`${s.fromSymbol}\0${s.toSymbol}`,r=n.get(a);(!r||X(s,r)<0)&&n.set(a,s)}return[...n.values()]}function De(e){return e.replace(/([\p{Ll}\d])([\p{Lu}])/gu,"$1 $2").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").match(/[\p{L}\d]+/gu)??[]}function ft(e){let n=e.match(/[\p{L}\d_.-]+(?:\/[\p{L}\d_.-]+)+/gu)??[];return[...new Set(n.map(s=>s.replace(/[.;:!?]+$/gu,"").toLocaleLowerCase()))]}function pt(e,n){let s=e.replace(/\\/gu,"/").toLocaleLowerCase();return n.filter(a=>{let r=s.indexOf(a);if(r<0)return!1;let o=r===0?"/":s[r-1],t=s[r+a.length];return o==="/"&&(t===void 0||t==="/")})}function bt(e,n){let s=De(e).map(_e),a=0;for(let r=0;r<s.length;r+=1)for(let o=0;o<n.length;o+=1){let t=0;for(;r+t<s.length&&o+t<n.length&&s[r+t]===n[o+t];)t+=1;a=Math.max(a,t)}return a}function T(e){return new Set(De(e).flatMap(mn).filter(n=>n.length>=3))}function mn(e){let n=_e(e);return n.length>4&&n.endsWith("e")?[n,n.slice(0,-1)]:[n]}function _e(e){let n=e.toLocaleLowerCase();return n.length>5&&n.endsWith("ies")?`${n.slice(0,-3)}y`:n.length>4&&n.endsWith("ied")?`${n.slice(0,-3)}y`:n.length>4&&n.endsWith("ed")?an(n.slice(0,-2)):n.length>5&&n.endsWith("ing")?an(n.slice(0,-3)):n.length>4&&n.endsWith("ers")||n.length>3&&n.endsWith("s")&&!n.endsWith("ss")?n.slice(0,-1):n}function an(e){if(e.length<2)return e;let n=e.at(-1),s=e.at(-2);return n===s&&!"aeiou".includes(n)?e.slice(0,-1):e}function cn(e){if(e.length===0)return[];let n=e.split(`
1
+ import{a as Ue}from"./chunk-AEXQYQD7.js";import{b as xe,c as Se}from"./chunk-FWQGH2N2.js";import{c as ze}from"./chunk-TJWVT4DO.js";import{d as Te}from"./chunk-BGGB5N53.js";import{i as Be}from"./chunk-GQLDYCWS.js";import{c as We}from"./chunk-HENP2O4A.js";import{d as Xe,e as Ke,f as qe}from"./chunk-J7AMBVWF.js";import{a as z}from"./chunk-BRQL7AFJ.js";import{A as $e,d as te,i as oe,t as ge}from"./chunk-GVAF222T.js";import{f as Q}from"./chunk-F74LZWCE.js";import{x as we}from"./chunk-7GAK2F3H.js";var Pe=new Set(["a","an","and","are","as","at","be","become","becomes","by","can","does","for","from","how","in","into","is","it","its","of","on","or","that","the","their","then","this","through","to","what","when","where","which","with"]);function le(e){return e.replace(/([\p{Ll}\d])([\p{Lu}])/gu,"$1 $2").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").match(/[\p{L}\d]+/gu)??[]}function T(e){return new Set(le(e).flatMap(Ie).filter(n=>n.length>=3))}function Ie(e){let n=ve(e);return n.length>4&&n.endsWith("e")?[n,n.slice(0,-1)]:[n]}function ve(e){let n=e.toLocaleLowerCase();return n.length>5&&n.endsWith("ies")?`${n.slice(0,-3)}y`:n.length>4&&n.endsWith("ied")?`${n.slice(0,-3)}y`:n.length>4&&n.endsWith("ed")?je(n.slice(0,-2)):n.length>5&&n.endsWith("ing")?je(n.slice(0,-3)):n.length>4&&n.endsWith("ers")||n.length>3&&n.endsWith("s")&&!n.endsWith("ss")?n.slice(0,-1):n}function je(e){if(e.length<2)return e;let n=e.at(-1),s=e.at(-2);return n===s&&!"aeiou".includes(n)?e.slice(0,-1):e}var He=4,yn=3,fn=12,pn=48,bn=64,J=10,V=6,gn=24,Sn=320,Ee=6,vn=12,An=1,Mn=4,Ln=7,Dn=12,Ne="source-construct:",Cn=96,Rn=32,Ye=4,wn=32,Tn=8;function $t(e,n,s={}){let a=xn(n),r=ft(n);if(a.length===0)throw new Error("Anchor discovery requires at least one non-trivial repository term.");let o=s.limit??He,t=s.full===!0;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`anchor group limit must be a positive safe integer; received ${o}`);let i=new We(e),d=i.scopedDefinitions(s.scope).filter(g=>!oe(g.symbol)),l=[...d],c=new Map(l.map(g=>[g.symbol,g])),m=new Map;for(let g of d)Qe(m,g,a);let u=ze(e,{scope:s.scope});for(let g of u.files){let pe=ge(e,g.relativePath).filter(_=>!oe(_.symbol));if(pe.length===0)continue;let ne=ln(g.text);for(let _=0;_<ne.length;_+=1){let be=T(ne[_]??""),ae=a.filter(O=>be.has(O));if(ae.length===0)continue;let D=$e(pe,_);if(!(!D||oe(D.symbol)))for(let O of ae)de(m,D,O,"source",g.relativePath,_)}}let h=Ve(m),y=[...m.values()].map(g=>Ae(g,h,r)).sort(R),b=In(u.files,y,a),v=-1;for(let g of b){let B=ge(e,g.relativePath),pe=B.filter(D=>!oe(D.symbol)),ne=Q(e,g.relativePath)?.callables??[],_=new Map,be=D=>{let O=`${D.startLine}\0${D.endLine}\0${D.name}`,Y=_.get(O);if(Y)return Y;let N=Pn(g.relativePath,B,D,()=>v--);return N?(_.set(O,N),l.push(N),c.set(N.symbol,N),Qe(m,N,a),N):null};for(let D of ne){let O=T(D.name);a.some(Y=>O.has(Y))&&be(D)}if(ne.length===0)continue;let ae=ln(g.text);for(let D=0;D<ae.length;D+=1){let O=T(ae[D]??""),Y=a.filter(Re=>O.has(Re));if(Y.length===0)continue;let N=En(ne,D),ce=N?be(N):null;if(!ce)continue;let Ge=Ze(pe,D);if(Ze(Ge?[Ge,ce]:[ce],D)?.symbol===ce.symbol)for(let Re of Y)de(m,ce,Re,"source",g.relativePath,D)}}let S=Ve(m),M=new Map(u.files.map(g=>[g.relativePath,g.text.split(/\r?\n/u)]));for(let g of m.values()){let B=M.get(g.definition.relativePath);B&&(g.sourceCharacters=B.slice(g.definition.startLine,g.definition.endLine+1).join(`
2
+ `).length)}let f=[...m.values()].map(g=>Ae(g,S,r)).sort(R),C=Math.min(f.length,Math.max(fn,o*yn)),A=t?f:re([...f.slice(0,C),...[...f].sort(ke).slice(0,Math.max(pn,C)),...ct(f,a),...lt(f,a,S)]),x=A.length,P=A.map(g=>c.get(g.symbol)).filter(g=>g?.isFunctionLike===!0),H=Fn(l),E=kn(e,i,A,P,c,H,new Set(m.keys()),s.semantic!==!1),W=Nn(E,A,m,S,c),F=Gn(W,S,a),K=Zn(e,i,E,m,S,l,c,s.semantic!==!1),L=[...Xn(e,i,W,c,S,s.semantic!==!1),...F,...W,...K].map(g=>({...g,queryPathMatches:mt(g)})).sort((g,B)=>Z(g,B,S)),k=t?L:ut(L,o,S),p=a.filter(g=>S.has(g)),w=a.filter(g=>!S.has(g)),ee=Math.max(0,f.length-x),fe=Math.max(0,L.length-k.length)+ee,hn=t?f.length:Math.min(f.length,o+He);return{query:n,queryPathFragments:r,normalizedTerms:a,matchedTerms:p,unmatchedTerms:w,groups:k,candidateRoots:f,candidateRootCount:f.length,analyzedRootCount:x,omittedRootCount:ee,omittedGroupCount:fe,scannedFiles:u.files.length,scannedBytes:u.scannedBytes,recoveryCommand:fe===0?null:`codebaseiq anchors ${Ce(n)}${s.scope?` --scope ${Ce(s.scope)}`:""} --limit ${hn}`}}function xn(e){let n=le(e).filter(s=>!Pe.has(s.toLocaleLowerCase())).map(ve).filter(s=>s.length>=3&&!Pe.has(s));return[...new Set(n)]}function Qe(e,n,s){let a=T(n.leaf),r=T(n.relativePath),o=T(n.documentation??"");for(let i of s)a.has(i)&&de(e,n,i,"symbol"),r.has(i)&&de(e,n,i,"path"),o.has(i)&&de(e,n,i,"documentation");let t=e.get(n.symbol);t&&(t.symbolPhraseLength=bt(n.leaf,s))}function de(e,n,s,a,r,o){let t=e.get(n.symbol)??{definition:n,matches:new Map,symbolPhraseLength:0},i=t.matches.get(s)??{sources:new Set,locations:new Map};i.sources.add(a),r!==void 0&&o!==void 0&&i.locations.set(`${r}\0${o}`,{file:r,line:o}),t.matches.set(s,i),e.set(n.symbol,t)}function Ve(e){let n=new Map;for(let s of e.values())for(let a of s.matches.keys())n.set(a,(n.get(a)??0)+1);return n}function Pn(e,n,s,a){let r=n[0]?.documentId;if(r===void 0||n.find(i=>i.isFunctionLike&&i.leaf===s.name&&i.startLine===s.startLine&&i.endLine===s.endLine))return null;let t=a();return{documentId:r,symbolId:t,symbol:`${Ne}${e}:${s.startLine}:${s.endLine}:${s.name}`,relativePath:e,startLine:s.startLine,startChar:0,endLine:s.endLine,endChar:0,leaf:s.name,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}}function In(e,n,s){let a=new Set(n.slice(0,Cn).map(t=>t.file)),r=new Set(s),o=e.map(t=>{let i=T(t.relativePath),d=t.relativePath.slice(t.relativePath.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),l=T(d),c=[...i].filter(u=>r.has(u)).length,m=[...l].filter(u=>r.has(u)).length;return{file:t,score:m*4+c}}).filter(t=>t.score>0).sort((t,i)=>i.score-t.score||I(z(t.file.relativePath))-I(z(i.file.relativePath))||t.file.relativePath.localeCompare(i.file.relativePath)).slice(0,Rn);for(let t of o)a.add(t.file.relativePath);return e.filter(t=>a.has(t.relativePath))}function En(e,n){return e.filter(s=>s.startLine<=n&&s.endLine>=n).sort((s,a)=>s.endLine-s.startLine-(a.endLine-a.startLine)||s.startLine-a.startLine)[0]}function Fn(e){let n=new Map;for(let s of e){if(!G(s))continue;let a=`${s.relativePath}\0${$(s.leaf)}`,r=n.get(a)??[];r.push(s),n.set(a,r)}return n}function Ze(e,n){return e.filter(s=>s.startLine<=n&&s.endLine>=n).sort((s,a)=>s.endLine-s.startLine-(a.endLine-a.startLine)||Number(G(a))-Number(G(s))||s.startLine-a.startLine||s.symbol.localeCompare(a.symbol))[0]}function G(e){return e.symbol.startsWith(Ne)}function U(e){return G(e)?e.leaf:te(e.symbol)}function Ae(e,n,s=[]){let a=e.definition,r=[...e.matches.entries()].map(([l,c])=>({term:l,sources:[...c.sources].sort(gt),locations:[...c.locations.values()].sort(un).slice(0,3)})).sort((l,c)=>l.term.localeCompare(c.term)),o=r.filter(l=>l.sources.some(c=>c!=="source")).map(l=>l.term),t=r.filter(l=>l.sources.includes("symbol")).map(l=>l.term),i=r.reduce((l,c)=>l+1/Math.max(1,n.get(c.term)??1),0),d=r.filter(l=>l.sources.includes("symbol")).reduce((l,c)=>l+1/Math.max(1,n.get(c.term)??1),0);return{symbol:a.symbol,label:U(a),leaf:a.leaf,file:a.relativePath,line:a.startLine,endLine:a.endLine,kind:a.isFunctionLike?"callable":a.isTypeLike?"type":"symbol",fileKind:z(a.relativePath),matches:r,focusLocations:At(e,n),matchedTerms:r.map(l=>l.term),symbolMatchedTerms:t,symbolPhraseLength:e.symbolPhraseLength,identityMatchedTerms:o,rarity:i,symbolRarity:d,queryPathMatches:pt(a.relativePath,s),...e.sourceCharacters===void 0?{}:{sourceCharacters:e.sourceCharacters}}}function kn(e,n,s,a,r,o,t,i){let d=a.filter(b=>!G(b)),l=n.calleeMap(d,{additive:!1,semantic:i}),c=new Map,m=new Map;for(let b of s){let v=r.get(b.symbol),S=v?G(v)?Je(e,v,r,o,1):Me(e,v,l.get(v.symbolId)??[],r,1,t):[];c.set(b.symbol,S);for(let M of S){let f=r.get(M.toSymbol);f?.isFunctionLike&&(!v||!G(v)||G(f))&&m.set(f.symbol,f)}}let u=[...m.values()],h=n.calleeMap(u.filter(b=>!G(b)),{additive:!1,semantic:i}),y=new Map;for(let b of u)y.set(b.symbol,G(b)?Je(e,b,r,o,2):Me(e,b,h.get(b.symbolId)??[],r,2,t));return s.map(b=>{let v=c.get(b.symbol)??[],S=v.flatMap(f=>y.get(f.toSymbol)??[]),M=q([...v,...S]);return{root:b,relations:M,nodeSymbols:new Set([b.symbol,...M.flatMap(f=>[f.fromSymbol,f.toSymbol])])}})}function Me(e,n,s,a,r,o=new Set){let t=new Map;for(let i of s){let d=a.get(i.symbol);if(!d?.isFunctionLike||d.symbol===n.symbol||i.source==="ast-callsite"&&!On(e,n,d,i.callsiteLine))continue;let l=t.get(d.symbol);(!l||yt(i,l)<0)&&t.set(d.symbol,i)}return[...t.entries()].map(([i,d])=>{let l=a.get(i);return{kind:"call",fromSymbol:n.symbol,fromLabel:te(n.symbol),fromFile:n.relativePath,toSymbol:l.symbol,toLabel:te(l.symbol),toFile:l.relativePath,depth:r,strength:Oe(d.source),evidence:d.source,callsiteLine:d.callsiteLine??_n(e,n,l)}}).sort((i,d)=>Number(o.has(d.toSymbol))-Number(o.has(i.toSymbol))||X(i,d)).slice(0,bn)}function Je(e,n,s,a,r){let o=Se(e,n.relativePath,n.startLine,n.endLine).targets.flatMap(t=>{let i=s.get(t.definition.symbol)??t.definition;return!i.isFunctionLike||i.symbol===n.symbol?[]:[{kind:"call",fromSymbol:n.symbol,fromLabel:U(n),fromFile:n.relativePath,toSymbol:i.symbol,toLabel:U(i),toFile:i.relativePath,depth:r,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:t.sourceLine}]});for(let t of xe(e,n.relativePath,{ranges:[{startLine:n.startLine,endLine:n.endLine}],excludeIndexedTargets:!1}).targets){let i=[...a.get(`${t.targetFile}\0${$(t.calleeLeaf)}`)??[],...ge(e,t.targetFile).filter(d=>d.isFunctionLike&&$(d.leaf)===t.calleeLeaf)].find(d=>d.startLine===t.targetStartLine&&d.endLine===t.targetEndLine);!i||i.symbol===n.symbol||o.push({kind:"call",fromSymbol:n.symbol,fromLabel:U(n),fromFile:n.relativePath,toSymbol:i.symbol,toLabel:U(i),toFile:i.relativePath,depth:r,strength:t.strength==="exact"?"exact":"derived",evidence:"ast-member-import-candidate",callsiteLine:t.line})}for(let t of Q(e,n.relativePath)?.callSites??[]){if(t.line<n.startLine||t.line>n.endLine||t.memberAccess)continue;let i=(a.get(`${n.relativePath}\0${$(t.calleeLeaf)}`)??[]).filter(l=>l.symbol!==n.symbol);if(i.length!==1)continue;let d=i[0];o.push({kind:"call",fromSymbol:n.symbol,fromLabel:U(n),fromFile:n.relativePath,toSymbol:d.symbol,toLabel:U(d),toFile:d.relativePath,depth:r,strength:"derived",evidence:"ast-callsite",callsiteLine:t.line})}return q(o).sort(X)}function _n(e,n,s){let a=$(s.leaf);return Q(e,n.relativePath)?.callSites.find(r=>r.line>=n.startLine&&r.line<=n.endLine&&$(r.calleeLeaf)===a)?.line??null}function On(e,n,s,a){if(a===void 0)return!1;let r=$(s.leaf);return Q(e,n.relativePath)?.callSites.some(o=>o.line===a&&$(o.calleeLeaf)===r)??!1}function $(e){return e.replace(/^#/u,"").replace(/\(\)$/u,"")}function Nn(e,n,s,a,r){let o=new Map(n.map((c,m)=>[c.symbol,m])),t=n.map((c,m)=>m),i=c=>{let m=c;for(;t[m]!==m;)m=t[m];for(;t[c]!==c;){let u=t[c];t[c]=m,c=u}return m},d=(c,m)=>{let u=i(c),h=i(m);u!==h&&(t[h]=u)};for(let c of e){let m=o.get(c.root.symbol);if(m!==void 0)for(let u of c.nodeSymbols){let h=o.get(u);h!==void 0&&d(m,h)}}let l=new Map;for(let c=0;c<n.length;c+=1){let m=i(c),u=l.get(m)??[];u.push(n[c]),l.set(m,u)}return[...l.values()].map((c,m)=>{let u=new Set(c.map(f=>f.symbol)),h=q(e.filter(f=>u.has(f.root.symbol)).flatMap(f=>f.relations)).sort(X),y=new Map(c.map(f=>[f.symbol,f]));for(let f of new Set(h.flatMap(C=>[C.fromSymbol,C.toSymbol]))){let C=s.get(f);if(C)y.has(f)||y.set(f,Ae(C,a));else{let A=r.get(f);A&&y.set(f,mn(A))}}let b=st(c,h,y),v=c.filter(f=>h.some(C=>C.fromSymbol===f.symbol)).length,S=[...new Set(c.flatMap(f=>f.matchedTerms))].sort(),M=rt(h,b,u,y);return{id:`anchor-set:${m+1}:${ue(c[0])}`,kind:"connected-flow",roots:[...c].sort(R),keyAnchors:b,candidateOwnerCount:b.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[],matchedTerms:S,relations:M,relationCount:h.length,orchestrationRootCount:v,omittedRelations:Math.max(0,h.length-J),systemMapCommand:ye(b,h,S)}})}function Gn(e,n,s){let a=new Map(s.map((o,t)=>[o,t])),r=[];for(let o=0;o<e.length;o+=1){let t=e[o],i=en(t);if(i.size!==0)for(let d=o+1;d<e.length;d+=1){let l=e[d],c=en(l),m=[...i].filter(A=>c.has(A));if(m.length===0||![...i].some(A=>!c.has(A))||![...c].some(A=>!i.has(A)))continue;let u=$n(t,l);if(u.length<2)continue;let h=q([...t.relations,...l.relations]).sort(X),y=h.slice(0,J),b=re([...t.roots,...l.roots]).sort(R),v=[...new Set([...t.matchedTerms,...l.matchedTerms])].sort(),S=m.sort((A,x)=>(a.get(A)??Number.MAX_SAFE_INTEGER)-(a.get(x)??Number.MAX_SAFE_INTEGER)||A.localeCompare(x)),M=+(t.relationCount>0)+ +(l.relationCount>0),f=+((t.orchestrationRootCount??0)>0)+ +((l.orchestrationRootCount??0)>0),C=Math.min(...S.map(A=>n.get(A)??Number.MAX_SAFE_INTEGER));r.push({sharedOrder:Math.min(...S.map(A=>a.get(A)??Number.MAX_SAFE_INTEGER)),sharedFrequency:C,connectedSides:M,orchestrationSides:f,group:{id:`parallel-paths:${ue(t.roots[0])}:${ue(l.roots[0])}`,kind:"parallel-paths",roots:b,keyAnchors:u,candidateOwnerCount:u.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[...t.upstreamEntries,...l.upstreamEntries],matchedTerms:v,relations:y,relationCount:h.length,parallelConnectedSides:M,parallelOrchestrationSides:f,parallelSharedPathTerms:S,parallelSharedPathFrequency:C,orchestrationRootCount:(t.orchestrationRootCount??0)+(l.orchestrationRootCount??0),omittedRelations:Math.max(0,h.length-y.length),systemMapCommand:ye(u,h,v)}})}}return r.sort((o,t)=>o.sharedFrequency-t.sharedFrequency||t.orchestrationSides-o.orchestrationSides||t.connectedSides-o.connectedSides||o.sharedOrder-t.sharedOrder||t.group.matchedTerms.length-o.group.matchedTerms.length||Z(o.group,t.group,n)).slice(0,Dn).map(o=>o.group)}function en(e){return new Set(e.roots.flatMap(n=>n.matches.filter(s=>s.sources.includes("path")).map(s=>s.term)))}function $n(e,n){return re([nn(e),nn(n)].filter(s=>s!==void 0))}function nn(e){let n=new Set(e.keyAnchors.map(a=>a.symbol)),s=new Map;for(let a of e.relations)!n.has(a.fromSymbol)||!n.has(a.toSymbol)||s.set(a.fromSymbol,(s.get(a.fromSymbol)??0)+1);return[...e.keyAnchors].sort((a,r)=>+((s.get(r.symbol)??0)>0)-+((s.get(a.symbol)??0)>0)||tn(r)-tn(a)||r.identityMatchedTerms.length-a.identityMatchedTerms.length||r.symbolMatchedTerms.length-a.symbolMatchedTerms.length||(s.get(r.symbol)??0)-(s.get(a.symbol)??0)||R(a,r))[0]}function tn(e){return e.matchedTerms.length+e.identityMatchedTerms.length*2+(e.queryPathMatches?.length??0)*4}function Xn(e,n,s,a,r,o){let t=Be(e);if(!t||t.links.length===0||s.length<2)return[];let i=new Map(t.observations.map(h=>[h.id,h])),d=new Map,l=new Map,c=[...s].sort((h,y)=>Z(h,y,r)).slice(0,vn),m=t.links.filter(h=>h.strength!=="candidate").sort((h,y)=>j(y.strength)-j(h.strength)||y.matchedKeyParts.length-h.matchedKeyParts.length||h.id.localeCompare(y.id));for(let h of c)for(let y of m){let b=i.get(y.from),v=i.get(y.to);if(!b||!v||!Kn(h,b,a))continue;let S=qn(h,b,a);if(!S)continue;let M=d.get(v.id)??zn(e,n,v,a,o,Mn);if(d.set(v.id,M),M.reachedSymbols.size===0)continue;let f=s.filter(L=>L.id!==h.id&&Wn(L).some(k=>M.reachedSymbols.has(k))&&Fe(S,L)>=2).sort((L,k)=>Fe(S,k)-Fe(S,L)||Z(L,k,r)).slice(0,An);if(f.length===0)continue;let C=[h.id,b.id,...f.map(L=>L.id).sort()].join("\0");if(l.has(C))continue;let A=new Set(f.flatMap(he)),x=Qn(me(v),A,M.relations);if(x.length===0)continue;let P=Yn(b,v,y.joinRule,y.matchedKeyParts,y.strength),H=q([P,...M.relations,...h.relations,...f.flatMap(L=>L.relations)]),E=Vn([P,...x],H,h,f),W=re([S,...f.flatMap(L=>L.roots)]).sort(R),F=re([S,...f.flatMap(L=>L.keyAnchors)]).slice(0,Ln),K=[...new Set([...S.matchedTerms,...f.flatMap(L=>L.matchedTerms)])].sort(),ie=Bn(e,n,S,a,o);W.length===0||F.length<2||l.set(C,{id:`cross-boundary-set:${ue(S)}:${l.size+1}`,kind:"cross-boundary-flow",roots:W,keyAnchors:F,candidateOwnerCount:F.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:ie,matchedTerms:K,relations:E,relationCount:H.length,omittedRelations:Math.max(0,H.length-E.length),systemMapCommand:ye(F,H,K)})}let u=new Map;for(let[h,y]of l){let b=h.slice(0,h.indexOf("\0")),v=u.get(b);(!v||Z(y,v,r)<0)&&u.set(b,y)}return[...u.values()]}function Kn(e,n,s){let a=new Set(he(e));return n.owner.symbol&&a.has(n.owner.symbol)?!0:[...a].map(r=>s.get(r)).some(r=>r?.relativePath===n.source.file&&r.startLine<=n.source.startLine&&r.endLine>=n.source.endLine)}function qn(e,n,s){let a=re([...e.roots,...e.keyAnchors]);if(n.owner.symbol){let r=a.find(o=>o.symbol===n.owner.symbol);if(r)return r}return a.find(r=>{let o=s.get(r.symbol);return o?.relativePath===n.source.file&&o.startLine<=n.source.startLine&&o.endLine>=n.source.endLine})??null}function he(e){return[...new Set([...e.roots.map(n=>n.symbol),...e.keyAnchors.map(n=>n.symbol),...e.relations.flatMap(n=>[n.fromSymbol,n.toSymbol])])]}function Wn(e){return[...new Set([...e.roots,...e.keyAnchors].map(n=>n.symbol))]}function Fe(e,n){let s=T(e.leaf),a=[...n.roots,...n.keyAnchors].map(o=>T(o.leaf)),r=0;for(let o of a){let t=0;for(let i of s)o.has(i)&&(t+=1);r=Math.max(r,t)}return r}function Bn(e,n,s,a,r){let o=a.get(s.symbol);if(!o?.isFunctionLike)return[];let t=n.callerFileMap([o],{semantic:r,sourceFallback:!0}).get(o.symbolId);if(!t)return[];let i=T(s.leaf);return[...t].filter(d=>d!==s.file&&z(d)!=="test").flatMap(d=>{let l=Q(e,d);return(l?.callSites??[]).filter(c=>$(c.calleeLeaf)===$(s.leaf)).flatMap(c=>{let m=(l?.callables??[]).filter(h=>h.startLine<=c.line&&h.endLine>=c.line).sort((h,y)=>h.endLine-h.startLine-(y.endLine-y.startLine)||h.startLine-y.startLine)[0];if(!m)return[];let u=[...T(m.name)].filter(h=>i.has(h)).length;return u>=2?[{name:m.name,file:d,line:m.startLine,endLine:m.endLine,callsiteLine:c.line,overlap:u}]:[]})}).sort((d,l)=>l.overlap-d.overlap||d.file.localeCompare(l.file)||d.line-l.line).slice(0,1).map(({name:d,file:l,line:c,endLine:m,callsiteLine:u})=>({name:d,file:l,line:c,endLine:m,callsiteLine:u}))}function zn(e,n,s,a,r,o){let t=Un(e,s,a),i=t.map(({definition:u,evidence:h,line:y})=>({kind:"call",fromSymbol:me(s),fromLabel:Le(s),fromFile:s.source.file,toSymbol:u.symbol,toLabel:te(u.symbol),toFile:u.relativePath,depth:1,strength:h==="scip-occurrence-callsite"?"exact":"derived",evidence:h,callsiteLine:y})),d=jn(e,s);i.push(...d.relations);let l=dn([...t.map(u=>u.definition),...d.definitions]),c=l,m=new Set(c.map(u=>u.symbol));for(let u=2;u<=o+1&&c.length>0;u+=1){let h=n.calleeMap(c,{additive:!1,semantic:r}),y=new Map;for(let b of c){let v=Me(e,b,h.get(b.symbolId)??[],a,u);i.push(...v);for(let S of v){let M=a.get(S.toSymbol);M?.isFunctionLike&&!m.has(M.symbol)&&y.set(M.symbol,M)}}c=[...y.values()];for(let b of c)m.add(b.symbol)}return{entryDefinitions:l,relations:q(i),reachedSymbols:new Set([...l.map(u=>u.symbol),...i.flatMap(u=>[u.fromSymbol,u.toSymbol])])}}function Un(e,n,s){let a=n.owner.symbol?s.get(n.owner.symbol):void 0;if(a?.isFunctionLike&&!oe(a.symbol))return[{definition:a,evidence:"scip-occurrence-callsite",line:n.source.startLine}];let r=we(e,n.source.file),o=Te(e,n.source.file,0,Math.max(0,r.length-1),[n.source.startLine]),t=Se(e,n.source.file,o.startLine,o.endLine).targets.map(c=>({definition:c.definition,evidence:"scip-occurrence-callsite",line:c.sourceLine})),i=Q(e,n.source.file),d=qe(e),l=(i?.callSites??[]).flatMap(c=>{if(c.line<o.startLine||c.line>o.endLine)return[];let m=Xe(n.source.file,d.get(c.calleeLeaf)??[]),u=Ke(e,n.source.file,m,c.memberAccess,c.calleeQualifier),h=u?s.get(u.symbol):void 0;return h?.isFunctionLike?[{definition:h,evidence:"ast-callsite",line:c.line}]:[]});return Hn([...t,...l])}function jn(e,n){let s=we(e,n.source.file),a=Te(e,n.source.file,0,Math.max(0,s.length-1),[n.source.startLine]),r=xe(e,n.source.file,{ranges:[a],excludeIndexedTargets:!1}).targets,o=[],t=[];for(let i of r){let d=`source-construct:${i.targetFile}:${i.targetStartLine}:${i.targetEndLine}:${i.calleeLeaf}`;t.push({kind:"call",fromSymbol:me(n),fromLabel:Le(n),fromFile:n.source.file,toSymbol:d,toLabel:i.calleeLeaf,toFile:i.targetFile,depth:1,strength:"derived",evidence:"ast-member-import-candidate",callsiteLine:i.line});let l=Se(e,i.targetFile,i.targetStartLine,i.targetEndLine).targets;for(let c of l)o.push(c.definition),t.push({kind:"call",fromSymbol:d,fromLabel:i.calleeLeaf,fromFile:i.targetFile,toSymbol:c.definition.symbol,toLabel:te(c.definition.symbol),toFile:c.definition.relativePath,depth:2,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:c.sourceLine})}return{definitions:dn(o),relations:q(t)}}function Hn(e){return[...new Map(e.map(n=>[n.definition.symbol,n])).values()]}function dn(e){return[...new Map(e.map(n=>[n.symbol,n])).values()]}function me(e){return e.owner.symbol??e.id}function Le(e){return e.owner.name??`${e.source.file}:${e.source.startLine+1}`}function Yn(e,n,s,a,r){return{kind:"runtime-boundary",fromSymbol:me(e),fromLabel:Le(e),fromFile:e.source.file,toSymbol:me(n),toLabel:Le(n),toFile:n.source.file,depth:1,strength:r,evidence:`runtime-boundary:${s}`,callsiteLine:e.source.startLine,runtimeBoundaryKey:a.map(o=>`${o.name}=${o.value}`).join(" ")}}function Qn(e,n,s){let a=new Map;for(let t of s){let i=a.get(t.fromSymbol)??[];i.push(t),a.set(t.fromSymbol,i)}let r=[{symbol:e,path:[]}],o=new Set([e]);for(;r.length>0;){let t=r.shift();if(t.path.length>0&&n.has(t.symbol))return t.path;for(let i of(a.get(t.symbol)??[]).sort(X))o.has(i.toSymbol)||(o.add(i.toSymbol),r.push({symbol:i.toSymbol,path:[...t.path,i]}))}return[]}function Vn(e,n,s,a){let r=q(e),o=new Set([s,...a].flatMap(t=>[...he(t),...t.keyAnchors.map(i=>i.symbol)]));for(let t of n){if(r.length>=J)break;!o.has(t.fromSymbol)&&!o.has(t.toSymbol)||r.some(i=>i.fromSymbol===t.fromSymbol&&i.toSymbol===t.toSymbol)||r.push(t)}return r.slice(0,J)}function Zn(e,n,s,a,r,o,t,i){let d=s.filter(c=>!c.root.symbol.startsWith(Ne)).map(c=>({root:c.root,relations:c.relations.filter(m=>m.depth===1&&m.fromSymbol===c.root.symbol)}));return Jn(d).flatMap((c,m)=>{let u=new Set(c.map(p=>p.root.symbol)),h=new Map;for(let p of c)for(let w of new Set(p.relations.map(ee=>ee.toSymbol)))h.set(w,(h.get(w)??0)+1);let y=[...h].filter(([,p])=>p>=2).sort(([p,w],[ee,fe])=>fe-w||et(p,ee,a,r,t)).map(([p])=>t.get(p)).filter(p=>p?.isFunctionLike===!0).slice(0,gn);if(y.length===0)return[];let b=n.callerFileMap(y,{semantic:i,sourceFallback:!0}),v=new Set;for(let p of y){v.add(p.relativePath);for(let w of b.get(p.symbolId)??[])v.add(w)}let S=o.filter(p=>p.isFunctionLike&&v.has(p.relativePath)).sort(nt).slice(0,Sn),M=n.calleeMap(S,{additive:!1,semantic:i}),f=new Set(y.map(p=>p.symbol)),C=q(S.flatMap(p=>Me(e,p,M.get(p.symbolId)??[],t,1,f).filter(w=>f.has(w.toSymbol)))),A=new Map;for(let p of C){let w=A.get(p.fromSymbol)??new Set;w.add(p.toSymbol),A.set(p.fromSymbol,w)}let x=new Set([...A].filter(([p,w])=>w.size>=2||u.has(p)).map(([p])=>p)),P=C.filter(p=>x.has(p.fromSymbol));if(x.size<2||P.length===0)return[];let E=[...new Set(P.map(p=>p.toSymbol))].map(p=>De(p,a,r,t)).filter(p=>p!==null).sort(R),W=[...x].map(p=>De(p,a,r,t)).filter(p=>p!==null),F=tt(W,P),K=F.slice(0,Ee),ie=F.slice(Ee);if(E.length===0||K.length===0)return[];let L=[...new Set([...E.flatMap(p=>p.matchedTerms),...c.flatMap(p=>p.root.matchedTerms)])].sort(),k=ot(P,K);return[{id:`effect-owner-set:${m+1}:${ue(E[0])}`,kind:"shared-callee-owners",roots:E,keyAnchors:K,candidateOwnerCount:F.length,omittedCandidateOwners:ie,ownerRecoveryCommands:Mt(ie,Ee),upstreamEntries:[],matchedTerms:L,relations:k,relationCount:P.length,omittedRelations:Math.max(0,P.length-k.length),systemMapCommand:ye(K,P,L)}]})}function Jn(e){let n=e.map((t,i)=>i),s=t=>{for(;n[t]!==t;)n[t]=n[n[t]],t=n[t];return t},a=(t,i)=>{let d=s(t),l=s(i);d!==l&&(n[l]=d)},r=e.map(t=>new Set(t.relations.map(i=>i.toSymbol)));for(let t=0;t<e.length;t+=1)for(let i=t+1;i<e.length;i+=1){let d=0;for(let l of r[t]??[])if((r[i]??new Set).has(l)&&(d+=1),d>=2)break;d>=2&&a(t,i)}let o=new Map;for(let t=0;t<e.length;t+=1){let i=s(t),d=o.get(i)??[];d.push(e[t]),o.set(i,d)}return[...o.values()].filter(t=>t.length>=2)}function et(e,n,s,a,r){let o=De(e,s,a,r),t=De(n,s,a,r);return o?t?R(o,t):-1:t?1:e.localeCompare(n)}function nt(e,n){return I(z(e.relativePath))-I(z(n.relativePath))||e.relativePath.localeCompare(n.relativePath)||e.startLine-n.startLine}function De(e,n,s,a){let r=n.get(e);if(r)return Ae(r,s);let o=a.get(e);return o?mn(o):null}function tt(e,n){let s=new Map;for(let r of n){let o=s.get(r.toSymbol)??new Set;o.add(r.fromSymbol),s.set(r.toSymbol,o)}let a=new Map;for(let r of n){let o=s.get(r.toSymbol)?.size??1;a.set(r.fromSymbol,(a.get(r.fromSymbol)??0)+o*o)}return[...e].sort((r,o)=>Number(r.leaf.startsWith("#"))-Number(o.leaf.startsWith("#"))||o.identityMatchedTerms.length-r.identityMatchedTerms.length||(a.get(o.symbol)??0)-(a.get(r.symbol)??0)||R(r,o))}function ot(e,n){let s=new Map(n.map((t,i)=>[t.symbol,i])),a=n.map(t=>e.filter(i=>i.fromSymbol===t.symbol).sort(X)),r=[],o=0;for(;r.length<J&&a.some(t=>o<t.length);){for(let t of a){let i=t[o];if(i&&r.push(i),r.length>=J)break}o+=1}return r.sort((t,i)=>s.get(t.fromSymbol)-s.get(i.fromSymbol)||X(t,i))}function rt(e,n,s,a){let r=new Map(n.map((i,d)=>[i.symbol,d])),o=new Map;for(let i of e)o.set(i.fromSymbol,(o.get(i.fromSymbol)??0)+1);return[...e].sort((i,d)=>{let l=c=>{let m=0;return r.has(c.fromSymbol)&&(m+=100),s.has(c.toSymbol)&&(m+=60),m+=Math.min(40,(o.get(c.toSymbol)??0)*8),(a.get(c.toSymbol)?.matchedTerms.length??0)>0&&(m+=25),c.fromFile!==c.toFile&&(m+=15),c.strength==="exact"&&(m+=5),m};return l(d)-l(i)||X(i,d)}).slice(0,J).sort((i,d)=>(r.get(i.fromSymbol)??V)-(r.get(d.fromSymbol)??V)||i.depth-d.depth||(i.callsiteLine??Number.MAX_SAFE_INTEGER)-(d.callsiteLine??Number.MAX_SAFE_INTEGER)||X(i,d))}function mn(e){return{symbol:e.symbol,label:U(e),leaf:e.leaf,file:e.relativePath,line:e.startLine,endLine:e.endLine,kind:e.isFunctionLike?"callable":e.isTypeLike?"type":"symbol",fileKind:z(e.relativePath),matches:[],focusLocations:[],matchedTerms:[],symbolMatchedTerms:[],symbolPhraseLength:0,identityMatchedTerms:[],rarity:0,symbolRarity:0}}function st(e,n,s){let a=[...e].sort(R),r=[],o=new Map;for(let c of n)o.set(c.fromSymbol,(o.get(c.fromSymbol)??0)+1);let t=new Set,i=new Set,d=c=>{if(!(!c||r.some(m=>m.symbol===c.symbol))){r.push(c);for(let m of c.matchedTerms)t.add(m);for(let m of c.symbolMatchedTerms)i.add(m)}},l=a.filter(c=>c.symbolPhraseLength>=2&&(o.get(c.symbol)??0)>=2);for(;r.length<Math.min(2,V);){let c=l.filter(m=>!r.some(u=>u.symbol===m.symbol)).sort((m,u)=>u.symbolMatchedTerms.filter(h=>!i.has(h)).length-m.symbolMatchedTerms.filter(h=>!i.has(h)).length||u.symbolPhraseLength-m.symbolPhraseLength||(o.get(u.symbol)??0)-(o.get(m.symbol)??0)||ke(m,u))[0];if(!c||r.length>0&&c.symbolMatchedTerms.every(m=>i.has(m)))break;d(c)}if(d(a[0]),r.length>=2){let c=it(r[0].symbol,r[1].symbol,n,s);for(let m of c?.slice(1,-1)??[]){if(r.length>=V)break;d(s.get(m))}if(r.length<V){let m=new Set(r.map(y=>y.symbol)),u=new Set(n.filter(y=>y.depth===1&&m.has(y.fromSymbol)&&m.has(y.toSymbol)).map(y=>y.fromSymbol)),h=n.filter(y=>y.depth===1&&u.has(y.fromSymbol)&&!m.has(y.toSymbol)).map(y=>({relation:y,candidate:s.get(y.toSymbol)})).filter(y=>y.candidate!==void 0&&y.candidate.symbolPhraseLength>=2&&y.candidate.symbolMatchedTerms.length>=2).sort((y,b)=>(o.get(y.relation.fromSymbol)??0)-(o.get(b.relation.fromSymbol)??0)||ke(y.candidate,b.candidate))[0]?.candidate;d(h)}}else for(;r.length<Math.min(3,V);){let c=a.filter(m=>!r.some(u=>u.symbol===m.symbol)).sort((m,u)=>u.matchedTerms.filter(h=>!t.has(h)).length-m.matchedTerms.filter(h=>!t.has(h)).length||R(m,u))[0];if(!c||c.matchedTerms.every(m=>t.has(m)))break;d(c)}for(;r.length>=2&&r.length<V;){let c=new Set(r.map(u=>u.symbol)),m=[...s.values()].filter(u=>!c.has(u.symbol)&&(o.get(u.symbol)??0)>0&&n.some(h=>c.has(h.fromSymbol)&&h.toSymbol===u.symbol)).sort((u,h)=>h.identityMatchedTerms.length-u.identityMatchedTerms.length||h.symbolMatchedTerms.length-u.symbolMatchedTerms.length||h.matchedTerms.length-u.matchedTerms.length||(o.get(h.symbol)??0)-(o.get(u.symbol)??0)||R(u,h))[0];if(!m)break;d(m)}if(r.length<2){let c=r[0],m=c?a.filter(u=>u.symbol!==c.symbol).map(u=>({root:u,path:at(u.symbol,c.symbol,n)})).filter(u=>u.path!==null).sort((u,h)=>+(h.root.file!==c.file)-+(u.root.file!==c.file)||u.path.length-h.path.length||R(u.root,h.root))[0]?.root:void 0;d(m)}return r}function it(e,n,s,a){let r=new Map;for(let i of s){let d=r.get(i.fromSymbol)??new Set;d.add(i.toSymbol),r.set(i.fromSymbol,d);let l=r.get(i.toSymbol)??new Set;l.add(i.fromSymbol),r.set(i.toSymbol,l)}let o=[{path:[e],cost:0}],t=new Map([[e,0]]);for(;o.length>0;){o.sort((c,m)=>c.cost-m.cost||c.path.length-m.path.length);let{path:i,cost:d}=o.shift(),l=i.at(-1);if(l===n)return i;for(let c of r.get(l)??[]){let m=a.get(c),u=c===n?1:!m||m.matchedTerms.length===0?9:m.symbolPhraseLength>=2?1:m.identityMatchedTerms.length>=2?2:4,h=d+u;h>=(t.get(c)??Number.POSITIVE_INFINITY)||(t.set(c,h),o.push({path:[...i,c],cost:h}))}}return null}function at(e,n,s){let a=new Map;for(let t of s){let i=a.get(t.fromSymbol)??[];i.push(t.toSymbol),a.set(t.fromSymbol,i)}let r=[[e]],o=new Set([e]);for(;r.length>0;){let t=r.shift(),i=t.at(-1);if(i===n)return t;for(let d of a.get(i)??[])o.has(d)||(o.add(d),r.push([...t,d]))}return null}function R(e,n){return(n.queryPathMatches?.length??0)-(e.queryPathMatches?.length??0)||n.identityMatchedTerms.length-e.identityMatchedTerms.length||n.matchedTerms.length-e.matchedTerms.length||n.rarity-e.rarity||se(e.kind)-se(n.kind)||I(e.fileKind)-I(n.fileKind)||e.file.localeCompare(n.file)||e.line-n.line}function ke(e,n){return n.symbolPhraseLength-e.symbolPhraseLength||n.symbolMatchedTerms.length-e.symbolMatchedTerms.length||se(e.kind)-se(n.kind)||n.symbolRarity-e.symbolRarity||R(e,n)}function ct(e,n){return n.flatMap(s=>{let a=e.filter(t=>t.matchedTerms.includes(s)).sort((t,i)=>dt(t,i,s)),r=[],o=new Set;for(let t of a)if(!o.has(t.file)&&(r.push(t),o.add(t.file),r.length>=Ye))return r;for(let t of a)if(!r.some(i=>i.symbol===t.symbol)&&(r.push(t),r.length>=Ye))break;return r})}function lt(e,n,s){let a=new Set(n),r=new Map;for(let o of e){if(o.kind!=="callable")continue;let t=o.file.slice(o.file.lastIndexOf("/")+1).replace(/\.[^.]+$/u,"");if(![...T(t)].some(d=>a.has(d)))continue;let i=r.get(o.file)??[];i.push(o),r.set(o.file,i)}return[...r.entries()].map(([o,t])=>{let i=o.slice(o.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),d=[...T(i)].filter(l=>a.has(l));return{file:o,fileCandidates:t,sharedFrequency:Math.min(...d.map(l=>s.get(l)??Number.MAX_SAFE_INTEGER))}}).sort((o,t)=>I(o.fileCandidates[0].fileKind)-I(t.fileCandidates[0].fileKind)||o.sharedFrequency-t.sharedFrequency||o.file.localeCompare(t.file)).flatMap(({fileCandidates:o})=>[...o].sort(R).slice(0,Tn)).slice(0,wn)}function dt(e,n,s){return on(e,s)-on(n,s)||I(e.fileKind)-I(n.fileKind)||n.symbolPhraseLength-e.symbolPhraseLength||se(e.kind)-se(n.kind)||R(e,n)}function on(e,n){let s=e.matches.find(a=>a.term===n)?.sources??[];return Math.min(...s.map(_e),Number.MAX_SAFE_INTEGER)}function re(e){return[...new Map(e.map(n=>[n.symbol,n])).values()]}function Z(e,n,s){let a=new Set(e.roots.flatMap(o=>o.symbolMatchedTerms)),r=new Set(n.roots.flatMap(o=>o.symbolMatchedTerms));return(n.queryPathMatches?.length??0)-(e.queryPathMatches?.length??0)||cn(e.kind)-cn(n.kind)||sn(e)-sn(n)||an(e)-an(n)||(e.kind==="parallel-paths"&&n.kind==="parallel-paths"?(e.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)-(n.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)||(n.parallelOrchestrationSides??0)-(e.parallelOrchestrationSides??0)||(n.parallelSharedPathTerms?.length??0)-(e.parallelSharedPathTerms?.length??0):0)||rn(n,s)-rn(e,s)||n.matchedTerms.length-e.matchedTerms.length||Math.max(...n.roots.map(o=>o.symbolPhraseLength))-Math.max(...e.roots.map(o=>o.symbolPhraseLength))||r.size-a.size||R(e.roots[0],n.roots[0])||n.roots.length-e.roots.length||e.relationCount-n.relationCount||e.id.localeCompare(n.id)}function rn(e,n){return e.matchedTerms.reduce((s,a)=>s+1/Math.max(1,n.get(a)??1),0)}function mt(e){return[...new Set(e.roots.flatMap(n=>n.queryPathMatches??[]))].sort()}function sn(e){let n=e.keyAnchors.length>0?e.keyAnchors:e.roots;return Math.max(...n.map(s=>I(s.fileKind)))}function an(e){return e.kind==="parallel-paths"?2-(e.parallelConnectedSides??0):e.kind!=="connected-flow"||e.relationCount>0?0:1}function ut(e,n,s){let a=e.slice(0,n);if(n<2||a.some(o=>o.kind==="shared-callee-owners"))return a;let r=e.filter(o=>o.kind==="shared-callee-owners");for(let o of a){if(o.kind==="shared-callee-owners"||o.kind==="parallel-paths")continue;let t=new Set(he(o)),i=r.map(l=>({group:l,overlap:ht(l,t)})).filter(({overlap:l})=>l>0).sort(({group:l,overlap:c},{group:m,overlap:u})=>u-c||Z(l,m,s))[0]?.group;if(!i)continue;let d=a.length-1;for(;d>=0&&a[d]===o;)d-=1;return d<0?a:(a[d]=i,[...a].sort((l,c)=>Z(l,c,s)))}return a}function ht(e,n){return he(e).filter(s=>n.has(s)).length}function cn(e){switch(e){case"cross-boundary-flow":return 0;case"parallel-paths":case"connected-flow":return 1;case"shared-callee-owners":return 2}}function X(e,n){return e.depth-n.depth||j(n.strength)-j(e.strength)||e.fromLabel.localeCompare(n.fromLabel)||e.toLabel.localeCompare(n.toLabel)||(e.callsiteLine??Number.MAX_SAFE_INTEGER)-(n.callsiteLine??Number.MAX_SAFE_INTEGER)}function yt(e,n){return j(Oe(n.source))-j(Oe(e.source))||(e.callsiteLine??Number.MAX_SAFE_INTEGER)-(n.callsiteLine??Number.MAX_SAFE_INTEGER)||e.symbol.localeCompare(n.symbol)}function q(e){let n=new Map;for(let s of e){let a=`${s.fromSymbol}\0${s.toSymbol}`,r=n.get(a);(!r||X(s,r)<0)&&n.set(a,s)}return[...n.values()]}function ft(e){let n=e.match(/[\p{L}\d_.-]+(?:\/[\p{L}\d_.-]+)+/gu)??[];return[...new Set(n.map(s=>s.replace(/[.;:!?]+$/gu,"").toLocaleLowerCase()))]}function pt(e,n){let s=e.replace(/\\/gu,"/").toLocaleLowerCase();return n.filter(a=>{let r=s.indexOf(a);if(r<0)return!1;let o=r===0?"/":s[r-1],t=s[r+a.length];return o==="/"&&(t===void 0||t==="/")})}function bt(e,n){let s=le(e).map(ve),a=0;for(let r=0;r<s.length;r+=1)for(let o=0;o<n.length;o+=1){let t=0;for(;r+t<s.length&&o+t<n.length&&s[r+t]===n[o+t];)t+=1;a=Math.max(a,t)}return a}function ln(e){if(e.length===0)return[];let n=e.split(`
3
3
  `);return e.endsWith(`
4
- `)&&n.pop(),n}function gt(e,n){return Ee(e)-Ee(n)}function Ee(e){switch(e){case"symbol":return 0;case"path":return 1;case"documentation":return 2;case"source":return 3}}function se(e){return e==="callable"?0:e==="type"?1:2}function x(e){switch(e){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function Fe(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function j(e){return e==="exact"?2:1}function un(e,n){return e.file.localeCompare(n.file)||e.line-n.line}function me(e){return`${e.file}:${e.line+1}`}function he(e,n=[],s=[]){let a=e.map(t=>`--symbol ${Le(`${t.file}:${t.line+1}-${t.endLine+1}`)}`),r=new Set(e.map(t=>t.symbol)),o=e.flatMap(t=>(t.sourceCharacters??0)>ze?St(t,n,s,r).map(i=>`--focus-at ${Le(`${i.file}:${i.line+1}`)}`):[]);return`codebaseiq system-map ${[...a,...o,"--relation call","--relation runtime-boundary"].join(" ")}`}function St(e,n,s,a){let r=new Set(s),o=n.filter(l=>l.fromSymbol===e.symbol&&l.callsiteLine!==null&&l.callsiteLine>=e.line&&l.callsiteLine<=e.endLine).map(l=>({file:e.file,line:l.callsiteLine,connectsAnchor:a.has(l.toSymbol),overlap:new Set(De(vt(l.toLabel)).flatMap(mn).filter(c=>r.has(c))).size,strength:l.strength})).filter(l=>l.overlap>0).sort((l,c)=>Number(c.connectsAnchor)-Number(l.connectsAnchor)||c.overlap-l.overlap||l.line-c.line||j(c.strength)-j(l.strength)),t=o.filter(l=>l.connectsAnchor),i=[...t.length>0?t:o,...t.length>0?[]:e.focusLocations.map(l=>({...l,connectsAnchor:!1,overlap:0,strength:"derived"}))],d=[];for(let l of i)if(!d.some(c=>c.file===l.file&&c.line===l.line)&&(d.push({file:l.file,line:l.line}),d.length>=3))break;return d}function vt(e){return e.slice(Math.max(e.lastIndexOf(":"),e.lastIndexOf("."))+1)}function At(e,n){let s=new Map;for(let[o,t]of e.matches)for(let i of t.locations.values()){if(i.file!==e.definition.relativePath||i.line<e.definition.startLine||i.line>e.definition.endLine)continue;let d=`${i.file}\0${i.line}`,l=s.get(d)??{...i,matchedTerms:new Set};l.matchedTerms.add(o),s.set(d,l)}let a=[...s.values()].sort((o,t)=>t.matchedTerms.size-o.matchedTerms.size||[...t.matchedTerms].reduce((i,d)=>i+1/Math.max(1,n.get(d)??1),0)-[...o.matchedTerms].reduce((i,d)=>i+1/Math.max(1,n.get(d)??1),0)||un(o,t)),r=[];for(let o of a)if(!r.some(t=>t.file===o.file&&Math.abs(t.line-o.line)<8)&&(r.push(o),r.length>=3))break;return r.map(o=>({file:o.file,line:o.line,matchedTerms:[...o.matchedTerms].sort()}))}function Mt(e,n){let s=[];for(let a=0;a<e.length;a+=n)s.push(he(e.slice(a,a+n)));return s}function Le(e){return`'${e.replaceAll("'",`'"'"'`)}'`}export{Nt as a,Pn as b};
5
- //# sourceMappingURL=chunk-ENCCHKM6.js.map
4
+ `)&&n.pop(),n}function gt(e,n){return _e(e)-_e(n)}function _e(e){switch(e){case"symbol":return 0;case"path":return 1;case"documentation":return 2;case"source":return 3}}function se(e){return e==="callable"?0:e==="type"?1:2}function I(e){switch(e){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function Oe(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function j(e){return e==="exact"?2:1}function un(e,n){return e.file.localeCompare(n.file)||e.line-n.line}function ue(e){return`${e.file}:${e.line+1}`}function ye(e,n=[],s=[]){let a=e.map(t=>`--symbol ${Ce(`${t.file}:${t.line+1}-${t.endLine+1}`)}`),r=new Set(e.map(t=>t.symbol)),o=e.flatMap(t=>(t.sourceCharacters??0)>Ue?St(t,n,s,r).map(i=>`--focus-at ${Ce(`${i.file}:${i.line+1}`)}`):[]);return`codebaseiq system-map ${[...a,...o,"--relation call","--relation runtime-boundary"].join(" ")}`}function St(e,n,s,a){let r=new Set(s),o=n.filter(l=>l.fromSymbol===e.symbol&&l.callsiteLine!==null&&l.callsiteLine>=e.line&&l.callsiteLine<=e.endLine).map(l=>({file:e.file,line:l.callsiteLine,connectsAnchor:a.has(l.toSymbol),overlap:new Set(le(vt(l.toLabel)).flatMap(Ie).filter(c=>r.has(c))).size,strength:l.strength})).filter(l=>l.overlap>0).sort((l,c)=>Number(c.connectsAnchor)-Number(l.connectsAnchor)||c.overlap-l.overlap||l.line-c.line||j(c.strength)-j(l.strength)),t=o.filter(l=>l.connectsAnchor),i=[...t.length>0?t:o,...t.length>0?[]:e.focusLocations.map(l=>({...l,connectsAnchor:!1,overlap:0,strength:"derived"}))],d=[];for(let l of i)if(!d.some(c=>c.file===l.file&&c.line===l.line)&&(d.push({file:l.file,line:l.line}),d.length>=3))break;return d}function vt(e){return e.slice(Math.max(e.lastIndexOf(":"),e.lastIndexOf("."))+1)}function At(e,n){let s=new Map;for(let[o,t]of e.matches)for(let i of t.locations.values()){if(i.file!==e.definition.relativePath||i.line<e.definition.startLine||i.line>e.definition.endLine)continue;let d=`${i.file}\0${i.line}`,l=s.get(d)??{...i,matchedTerms:new Set};l.matchedTerms.add(o),s.set(d,l)}let a=[...s.values()].sort((o,t)=>t.matchedTerms.size-o.matchedTerms.size||[...t.matchedTerms].reduce((i,d)=>i+1/Math.max(1,n.get(d)??1),0)-[...o.matchedTerms].reduce((i,d)=>i+1/Math.max(1,n.get(d)??1),0)||un(o,t)),r=[];for(let o of a)if(!r.some(t=>t.file===o.file&&Math.abs(t.line-o.line)<8)&&(r.push(o),r.length>=3))break;return r.map(o=>({file:o.file,line:o.line,matchedTerms:[...o.matchedTerms].sort()}))}function Mt(e,n){let s=[];for(let a=0;a<e.length;a+=n)s.push(ye(e.slice(a,a+n)));return s}function Ce(e){return`'${e.replaceAll("'",`'"'"'`)}'`}export{$t as a,xn as b};
5
+ //# sourceMappingURL=chunk-EXZ7VLRY.js.map
@@ -1,4 +1,4 @@
1
- import{A as f,G as u}from"./chunk-NNJ2KZZG.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
1
+ import{A as f,G as u}from"./chunk-UC2FD2PS.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
2
2
  `)}function A(n,t){let r=n.trimStart();if(!r||r.startsWith("#"))return n;let e=n.slice(0,n.length-r.length),i=r.startsWith("!"),o=i?r.slice(1):r;if(!o||o.startsWith("#"))return n;let s=o.startsWith("/"),a=s?o.slice(1):o,p=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${t}/${a}`:`${t}/**/${a}`;return`${e}${i?"!":""}${p}`}var F=`
3
3
  # Dependencies
4
4
  node_modules/
@@ -57,4 +57,4 @@ Thumbs.db
57
57
  # Type definitions (often noise in queries)
58
58
  *.d.ts
59
59
  `;function g(n,t,r){let e=x(t,r);if(!e)return!1;try{return n.ignores(e)}catch{return!1}}function x(n,t){if(!t||t===".")return null;if(!m(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=m(t)?t:S(n,t),e=T(n,r).replaceAll("\\","/");return!e||e==="."||e.startsWith("..")?null:e}export{E as a};
60
- //# sourceMappingURL=chunk-NEDP5RFQ.js.map
60
+ //# sourceMappingURL=chunk-F3QSL4W2.js.map
@@ -1,4 +1,4 @@
1
- import{A as G,B as Je,C as D,D as Y,E as Ke,F as ye,G as Xe,H as Qe,e as Me,f as ve,g as _,h as $e,i as Ue,j as qe,k as B,l as Be,m as H,n as ze,o as Ve,p as We,q as F,r as J,s as A,t as de,u as ge,v as S,w as Se,x as He,y as he,z as Q}from"./chunk-ADTBPVUZ.js";import{a as Oe,e as q,h as se,j as W,p as xe,r as K,t as X,u as L}from"./chunk-BMYOV5GP.js";import{c as ne}from"./chunk-NNJ2KZZG.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function At(e){return e.replace(/'''[\s\S]*?'''/g,k).replace(/"""[\s\S]*?"""/g,k).replace(/#.*$/gm,k).replace(/\/\/.*$/gm,k).replace(/\/\*[\s\S]*?\*\//g,k).replace(/`(?:\\[\s\S]|[^`])*`/g,k).replace(/'(?:\\.|[^'\\\r\n])*'/g,k).replace(/"(?:\\.|[^"\\\r\n])*"/g,k)}function Vn(e){return Ge(e,{maskStrings:!1})}function Wn(e){return Ge(e,{maskStrings:!0})}function Ge(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
1
+ import{A as G,B as Je,C as D,D as Y,E as Ke,F as ye,G as Xe,H as Qe,e as Me,f as ve,g as _,h as $e,i as Ue,j as qe,k as B,l as Be,m as H,n as ze,o as Ve,p as We,q as F,r as J,s as A,t as de,u as ge,v as S,w as Se,x as He,y as he,z as Q}from"./chunk-ICUL7XRT.js";import{c as Oe,g as q,j as se,l as W,r as xe,t as K,v as X,w as L}from"./chunk-7GAK2F3H.js";import{c as ne}from"./chunk-UC2FD2PS.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function At(e){return e.replace(/'''[\s\S]*?'''/g,k).replace(/"""[\s\S]*?"""/g,k).replace(/#.*$/gm,k).replace(/\/\/.*$/gm,k).replace(/\/\*[\s\S]*?\*\//g,k).replace(/`(?:\\[\s\S]|[^`])*`/g,k).replace(/'(?:\\.|[^'\\\r\n])*'/g,k).replace(/"(?:\\.|[^"\\\r\n])*"/g,k)}function Vn(e){return Ge(e,{maskStrings:!1})}function Wn(e){return Ge(e,{maskStrings:!0})}function Ge(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
2
2
  `,n),a=i===-1?s:i;t+=be(e,n,a),n=a;continue}if(e[n]==="/"&&e[n+1]==="*"){let i=e.indexOf("*/",n+2),a=i===-1?s:i+2;t+=be(e,n,a),n=a;continue}let o=e[n];if(o==="`"||o==="'"||o==='"'){let i=o,a=n+1;for(;a<s;){if(e[a]==="\\"){a+=2;continue}if(e[a]===i){a+=1;break}if(i!=="`"&&e[a]===`
3
3
  `)break;a+=1}t+=r.maskStrings?be(e,n,a):e.slice(n,a),n=a;continue}t+=o,n+=1}return t}function be(e,r,t){let n="";for(let s=r;s<t;s+=1)n+=e[s]===`
4
4
  `?`
@@ -10,4 +10,4 @@ import{A as G,B as Je,C as D,D as Y,E as Ke,F as ye,G as Xe,H as Qe,e as Me,f as
10
10
  `:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ae(e,s);n+=lt(e.slice(s,i)),s=i;continue}if(o==='"'){let i=te(e,s,0).index;n+=lt(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Rr(e){let r=0;for(;r<e.length&&(r=Le(e,r),!(r>=e.length));){let t=pe(e,r);if(!t){r+=1;continue}if(Sr(t.form))return t.form;r=t.index}return null}function pe(e,r){let t=Le(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Tr(e,t);if(e.startsWith("#_",t)){let s=pe(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Pe(e[t]);)t+=1;let n=e[t];return n?n==="("?Te(e,t,"list",")"):n==="["?Te(e,t,"vector","]"):n==="{"?Te(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:te(e,t,0).index},index:te(e,t,0).index}:Fr(e,t):null}function Tr(e,r){let t=e.startsWith("#?@",r)?3:2,n=pe(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Er(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Er(e){let r=[];for(let t=0;t<e.length;t+=2){let n=P(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Te(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=Le(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=pe(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Fr(e,r){let t=r;for(;t<e.length&&!_e(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function Le(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=ae(e,t);continue}break}return t}function lt(e){return e.replace(/[^\r\n]/g," ")}function ut(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=w(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:Se(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?z(c,i):[]})}return n}function mt(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:Se(e,r,o)})}return n}function ft(e,r,t){return ce(e,r,{csharp:n=>Lr(e,r,n),vb:n=>Ar(e,r,n)},()=>{let n=Ve(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[R(e,r,o,p,u,m,S(e,p,B))]})},t)}function Ar(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(d(p,u,S(e,l,B),n,c?"namespace":"named"))}return s}function Lr(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(d(p,u,S(e,l,B),n,a?"namespace":"named"))}return s}var kr=q("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function dt(e,r){return kr.get(e,r,()=>{let t=new Set,n=L(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}function ke(e,r,t){return C(e,r,n=>jr(e,r,n),()=>wr(e,r,t),t)}function wr(e,r,t){return Wr(t).flatMap(n=>Hr(e,r,n.clause,n.specifier,n.start,n.end,t))}function jr(e,r,t){let n=Dr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Or(e,r,t,o,n));return s}function Dr(e,r,t){let n=g(t,new Set(["import_statement"]));if(G(r))for(let s of dt(e,r))n.add(s);return n}function Or(e,r,t,n,s){let o=qr(n);if(!o)return[];let i=F(e,r,o),a=b(n,"import_clause");return a?Mr(t,a,i,s,Br(n.text)):[M("*",i)]}function Mr(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(vr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=$r(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Ur(i,t,n,s));return o}function vr(e,r,t,n){return d("default",e,r,t,"default",{isTypeOnly:n})}function $r(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=Vr(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function Ur(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(d(c,l,r,t,"named",{isTypeOnly:n||zr(o.text)}))}return s}function qr(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function Br(e){return/^\s*import\s+type\b/.test(e)}function zr(e){return/^\s*type\b/.test(e.trim())}function Vr(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function Wr(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function Hr(e,r,t,n,s,o,i){let a=F(e,r,n),c=w(i,s,o);return t?Jr(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=z(c,p.localName);return v(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?M(p.importedName,p.sourcePath):E(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[M("*",a)]}function Jr(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=Kr(n),i=[];return s&&i.push(...gt(s,t)),o&&i.push(...gt(o,t)),i}function gt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function Kr(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function we(e,r,t){let n=D(e,r);return n?en(e,r,n):Xr(e,r,t)}function Xr(e,r,t){return[...Qr(e,r,t),...Gr(e,r,t),...Yr(e,r,t)]}function Qr(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>Zr(u.trim())).filter(u=>!!u),l=V(t,o.index),p=V(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:F(e,r,a),names:c,startLine:l,endLine:p})}return n}function Gr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:F(e,r,i),names:o[1]?[o[1]]:[],startLine:a,endLine:c})}return n}function Yr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:F(e,r,i),names:[],startLine:a,endLine:c})}return n}function Zr(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function V(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function en(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=tn(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=rn(s,o,i,a);n.push(c)}return n}function tn(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return F(e,r,s.text)}function rn(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}let o=b(e,"namespace_export");if(o){let i=o.namedChildren.find(a=>a.type==="identifier"||a.type==="type_identifier")?.text;return{kind:"star-as",sourcePath:r,names:i?[i]:[],startLine:t,endLine:n}}return{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function St(e,r,t){return ce(e,r,{java:n=>nn(e,r,n),kotlin:n=>sn(e,r,n),scala:n=>on(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?an(e,r,o,s):[]}),t)}function nn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(v("*",S(e,l,_)));continue}let p=l.split(".").pop()??l;s.push(d(p,p,S(e,l,_),n))}return s}function sn(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(f=>f.type==="identifier");if(!i)continue;let a=o.namedChildren.some(f=>f.type==="wildcard_import"),c=o.namedChildren.find(f=>f.type==="import_alias");if(a){s.push(v("*",S(e,i.text,_)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(d(p,m,S(e,l,_),n))}return s}function on(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(v("*",S(e,c,_)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,f]=u.namedChildren;if(!m)continue;let h=m.text,$=f?.text??h;if(h==="_")continue;s.push(d(h,$,S(e,`${c}.${h}`,_),n))}else if(u.type==="identifier"){let m=u.text;s.push(d(m,m,S(e,`${c}.${m}`,_),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(d(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,_),n))}return s}function an(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[R(e,r,n,m,p,u)]})}return[R(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function xt(e,r,t){return C(e,r,n=>cn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[R(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}),t)}function cn(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(d(a,c,S(e,i.replace(/\\/g,"."),H),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=ht(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=ht(c,"");l&&o(u,l,p)}}return s}function ht(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function bt(e,r,t){return C(e,r,n=>ln(e,r,n),()=>un(t).flatMap(n=>fn(e,r,n,t)),t)}function ln(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=yt(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=pn(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=yt(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function yt(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function pn(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function un(e){let r=e.split(`
11
11
  `),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=Ne(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
12
12
  ${m}`,l+=1+m.length,p+=Ne(m),n+=m.length+1}let u=mn(c);u&&t.push({...u,start:a,end:l})}return t}function mn(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function fn(e,r,t,n){let s=w(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),f=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=z(s,f);return[{importedName:m,localName:f,sourcePath:h,kind:"namespace",used:x(s,f)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as dn}from"path";function Nt(e,r,t){return C(e,r,n=>Sn(e,r,n),()=>gn(e,r,t),t)}function gn(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?de(e,r,i):null;if(a){let c=It(i);return[E(c,c,a,x(s,c))]}return[M(i,a)]})}function Sn(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(f=>f.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(f=>f.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?de(e,r,u):null;if(m){let f=It(u);s.push(d(f,f,m,n))}else s.push(M(u,m))}return s}function It(e){return Qe(dn(e).replace(/\.[^.]+$/,""),/_/)}function Ct(e,r,t){return C(e,r,n=>hn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?xn(e,r,o,s):[]}),t)}function hn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of re(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=A(e,r,a.qualifiedName)??A(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(d(a.importedName,a.localName,c,n))}}return s}function re(e,r){switch(e.type){case"identifier":case"super":case"crate":{let t=e.text;return[{qualifiedName:ue(r,t),importedName:t,localName:t}]}case"self":{let t=r.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:r||"self",importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:ue(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=ue(r,t.text),o=[];for(let i of n.namedChildren)o.push(...re(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...re(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=re(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:ue(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function ue(e,r){return e?r?`${e}::${r}`:e:r}function xn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let f=m.trim();if(!f)return[];if(f==="self"){let fe=p.split("::").filter(Boolean).pop();return fe?[R(e,r,n,p,fe,fe)]:[]}let[h,$]=f.split(/\s+as\s+/),U=h?.trim();if(!U)return[];let Et=($??U.split("::").pop()??U).trim(),Ft=`${p}::${U}`.replace(/::::/g,"::");return[R(e,r,n,Ft,U.split("::").pop()??U,Et,A(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=A(e,r,a)??A(e,r,a.split("::").slice(0,-1).join("::"));return[R(e,r,n,a,a.split("::").pop()??a,c,l)]}function Pt(e,r,t){let n=D(e,r);if(n)return yn(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Nn(e,r,i))}return s}function yn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!bn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of re(o,""))i.importedName&&n.push(je(e,r,i.qualifiedName))}return n}function bn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Nn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[je(e,r,l)]})}return[je(e,r,n)]}function je(e,r,t){return{specifier:t,sourcePath:A(e,r,t)??A(e,r,t.split("::").slice(0,-1).join("::"))}}function j({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function _t(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var In={language:"javascript",extensions:Me,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:ke,parseReExports:we},Cn=j({language:"python",extensions:ve,imports:"ast-with-regex-fallback",parseImports:bt}),Pn=j({language:"jvm",extensions:_,imports:"ast-dispatch-with-regex-fallback",parseImports:St}),_n={language:"rust",extensions:$e,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Ct,parseExports:Pt},Rn=j({language:"ruby",extensions:Ue,imports:"ast-with-regex-fallback",parseImports:Nt}),Tn=j({language:"c/cpp",extensions:qe,imports:"ast-with-regex-fallback",parseImports:ct}),En=j({language:"dotnet",extensions:B,imports:"ast-dispatch-with-regex-fallback",parseImports:ft}),Fn={language:"dart",extensions:Be,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:ut,parseExports:mt},An=j({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:xt}),Ln=j({language:"clojure",extensions:ze,imports:"regex-only",parseImports:pt}),kn=[In,Cn,Pn,_n,Rn,Tn,En,Fn,An,Ln];function me(e){return _t(kn,e)}var De={clearGroups:["whole-project","source-file"]},wn=q("source-imports",De),jn=q("source-exports",De),Dn=q("source-reexports",De),Rt=K({kind:"source-imports",invalidation:X("source-imports"),serialize:On,deserialize:Mn}),Tt=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:vn,deserialize:$n});function Qo(e,r){let t=ne(r);return Dn.get(e,t,()=>{let n=me(t);if(!n?.parseReExports)return[];let s=L(e,t);if(!s)return[];let o=W(e,t,s),i=he(e),a=Tt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return Tt.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Go(e,r){let t=ne(r);return wn.get(e,t,()=>{let n=me(t);if(!n)return[];let s=L(e,t);if(!s)return[];let o=W(e,t,s),i=he(e),a=Rt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return Rt.write(e,t,o,{resolutionFingerprint:i,imports:c}),c})}function Yo(e,r){let t=ne(r);return jn.get(e,t,()=>{let n=me(t);if(!n?.parseExports)return[];let s=L(e,t);return s?n.parseExports(e,t,s):[]})}function On(e){return JSON.stringify(e)}function Mn(e){try{let r=JSON.parse(e);return!xe(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function vn(e){return JSON.stringify(e)}function $n(e){try{let r=JSON.parse(e);return!xe(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,At as b,Vn as c,Wn as d,Ne as e,T as f,Zt as g,sr as h,or as i,cr as j,lr as k,pr as l,ur as m,ue as n,Qo as o,Go as p,Yo as q};
13
- //# sourceMappingURL=chunk-O6QTXQPJ.js.map
13
+ //# sourceMappingURL=chunk-F74LZWCE.js.map
@@ -1,2 +1,2 @@
1
- import{b as i}from"./chunk-UDS562V4.js";function l(n,o,s,t={}){let e=i(n,o,s,t);return e?{symbolA:e.symbolA,symbolB:e.symbolB,similarity:e.similarity,sharedCallees:e.sharedEvidence,uniqueToA:e.uniqueToA,uniqueToB:e.uniqueToB,consolidationStrategy:e.consolidationStrategy}:null}export{l as a};
2
- //# sourceMappingURL=chunk-BH5F2Q4O.js.map
1
+ import{b as i}from"./chunk-36JC5BG2.js";function l(n,o,s,t={}){let e=i(n,o,s,t);return e?{symbolA:e.symbolA,symbolB:e.symbolB,similarity:e.similarity,sharedCallees:e.sharedEvidence,uniqueToA:e.uniqueToA,uniqueToB:e.uniqueToB,consolidationStrategy:e.consolidationStrategy}:null}export{l as a};
2
+ //# sourceMappingURL=chunk-FEIZXBLH.js.map
@@ -0,0 +1,2 @@
1
+ import{b as I}from"./chunk-DAKIGMIK.js";import{bb as v,ib as s,lb as E,mb as V}from"./chunk-LONKINMJ.js";import{c as y}from"./chunk-ZZ3MWF33.js";import{fa as h,pa as S,w}from"./chunk-MEUHIDI3.js";import{G as x}from"./chunk-UQYQBLJX.js";var ce={defaultRole:"repository-observation"};function pe(e,n=[]){return{defaultRole:e,...n.length>0?{rules:n}:{}}}function k(e,n){for(let t of e.rules??[]){if(t.when.kind==="option-present"){let r=n.options[t.when.name];if(r!==void 0&&r!==!1)return t.role;continue}if((t.when.kind==="argument"?n.args[t.when.index]:n.options[t.when.name])===t.when.equals)return t.role}return e.defaultRole}function fe(e){return[...new Set([e.defaultRole,...(e.rules??[]).map(n=>n.role)])]}function A(e){return e==="repository-observation"||e==="repository-preview"||e==="composite"}import{AsyncLocalStorage as z}from"async_hooks";var U=1,j=1;var F={policyId:"codebaseiq:unresolved-repository-policy",policyVersion:j,permission:"not-established",reasons:["No repository action policy was supplied for this claim."]};function N(e){return{schemaVersion:U,origin:e.contract.origin,coverage:$(e.coverage),producerValidation:e.contract.producerValidation,stateAuthority:w(e.receipt,e.receipt),repositoryPolicy:e.repositoryPolicy??F,...e.contract.families?{families:e.contract.families}:{}}}function $(e){return e?e.complete===!0?{state:"complete",returned:e.returned,totalKnown:!0,total:e.total??e.returned,omitted:0}:e.totalKnown?{state:"partial",returned:e.returned,totalKnown:!0,...e.total===void 0?{}:{total:e.total},...e.omitted===void 0?{}:{omitted:e.omitted}}:{state:"unknown",returned:e.returned,totalKnown:!1}:{state:"unknown",returned:0,totalKnown:!1}}var W="codebaseiq-result";var G=1,Y=1,_=1,L=1;function M(e){let n=e.resultSchemaVersion??Y;if(!X(n))throw new Error("CLI result schema version must be a positive safe integer.");let{producerVersion:t,...o}=e;return{kind:W,schemaVersion:G,producer:{name:"codebaseiq",version:t},resultSchemaVersion:n,...o}}function J(e,n){return JSON.stringify(e,null,n?0:2)}function X(e){return Number.isSafeInteger(e)&&Number(e)>0}var P=Symbol("option-value-source"),T=new Map,D=new Map,B=new Map,H=new z;function Ie(e,n){return H.run(e,n)}function ke(e){T=new Map(e)}function Ae(e){D=new Map(e)}function Ne(e){B=new Map(e)}function m(e){return(...n)=>{let{args:t,opts:o}=le(n);S(r=>{I(r.generation.identity),e({db:r,args:t,opts:o})})}}function R(e,n){return m(t=>{let o=V(t.db,e,d(t.opts,"full"),{quiet:d(t.opts,"json")});n({...t,budget:o})})}function _e(e){return m(n=>c(n,e,{kind:"list"}))}function Le(e){return m(n=>c(n,e,{kind:"table",headers:e.headers,dashWidths:e.dashWidths}))}function Me(e){return m(n=>c(n,e,{kind:"grouped",key:e.key}))}function Z(e){return m(n=>b(n,e))}function Je(e){return Z({commandName:e.commandName,query:e.query,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(n,t)=>s.sectionedReport(e.sections(n,t)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}function ee(e,n){return R(e,t=>b(t,{...n,commandName:n.commandName??e}))}function Pe(e,n){return ee(e,{commandName:n.commandName??e,query:n.query,emptyMessage:n.emptyMessage,heuristicLabel:n.heuristicLabel,before:n.before,render:(t,o)=>s.sectionedReport(n.sections(t,o)),toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,after:n.after})}function Te(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"list"}))}function De(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"grouped",key:n.key}))}function Be(e,n){return String(e[n])}function He(e,n){let t=e[n];return typeof t=="string"?[t]:Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function Q(e,n){let t=e[n];return typeof t=="number"?t:void 0}function d(e,n){return!!e[n]}function Ke(e,n){let t=e[n];return Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Ue(e,n,t){return Q(e,n)??t}function je(e,n,t){let o=Q(e,n),r=o!==void 0&&ne(e,n)!=="default";if(d(e,"full")){if(r)throw new Error("--full cannot be combined with --limit. Use --full for all findings, or --limit N for a capped report.");return Number.MAX_SAFE_INTEGER}return o??t}function ne(e,n){return e[P]?.(n)}function c(e,n,t){b(e,{commandName:n.commandName,query:n.query,emptyMessage:(o,r)=>o.length===0&&n.emptyMessage?n.emptyMessage(r):void 0,heuristicLabel:n.heuristicLabel,render:(o,r)=>{t.kind==="list"?s.list(o,i=>n.format(i,r)):t.kind==="table"?s.table(t.headers,o.map(i=>n.format(i,r)),t.dashWidths):s.groupedByFile(o,i=>n.format(i,r),t.key?i=>t.key(i,r):void 0)},toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,before:n.before,after:n.after})}function b(e,n){let t=n.query(e);if(d(e.opts,"json")){if(!n.commandName)throw new Error("JSON output requires a command name so its result contract can be identified.");oe(n.commandName,e.args,e.opts,n.toJson?n.toJson(t,e):t,{analysisBudget:te(e),coverage:n.coverage?.(t,e),agentResult:n.agentResult?.(t,e),resultSchemaVersion:n.resultSchemaVersion});return}let o=n.emptyMessage?.(t,e);if(o){s.empty(o);return}n.heuristicLabel&&E(n.heuristicLabel),n.before?.(t,e),n.render(t,e),n.after?.(t,e)}function te(e){return e.budget?.analysisBudget}function oe(e,n,t,o,r={}){let i=T.get(e),a=D.get(e),u=B.get(e),p=a?k(a.operation,{args:n,options:t}):void 0,f=H.getStore();if(f!==void 0&&p!==void 0&&f!==p)throw new Error(`Command ${e} changed operation role during execution: selected ${f}, rendered ${p}.`);let g=f??p,O=de(o),C=r.coverage??ae(a,o,r.analysisBudget),l=C&&O&&!C.resolution?{...C,resolution:O}:C;if(l&&ie(l),d(t,"resultOnly")){let K=Object.hasOwn(r,"resultOnly")?r.resultOnly:o;y(JSON.stringify(K,null,d(t,"compact")?0:2));return}let q=M({producerVersion:x,command:e,...g?{operationRole:g}:{},...i?{evidence:i}:{},...r.analysisBudget?{analysisBudget:r.analysisBudget}:{},args:ue(n),options:t,result:o,...l?{coverage:l}:{},...r.agentResult!==void 0?{agentResult:r.agentResult}:{},...re(g,i,r.analysisBudget,l,u,r.observationReceipt),...r.resultSchemaVersion===void 0?{}:{resultSchemaVersion:r.resultSchemaVersion}});y(J(q,d(t,"compact")))}function re(e,n,t,o,r,i){if(!e||!A(e))return{};let a=h(),u=i??(a?v({projectRoot:a.config.projectRoot,db:a,...r?{observedSourceKinds:r.observedSources}:{}}):void 0);return u?{evidenceContext:{schemaVersion:_,operationRole:e,receipt:u,analysisManifest:{schemaVersion:L,...n?{evidence:n}:{},...t?{analysisBudget:t}:{},...o?{coverage:o}:{},...r?{claimQualification:N({contract:r,receipt:u,...o?{coverage:o}:{}})}:{}}}}:{}}function ie(e){if(!Number.isSafeInteger(e.returned)||e.returned<0)throw new Error("Invocation coverage returned count must be a non-negative safe integer.");if(e.complete!==!0&&e.complete!==!1&&e.complete!==null)throw new Error("Invocation coverage complete must be true, false, or null.");if(e.complete===!0){if(!e.totalKnown)throw new Error("Complete invocation coverage must know its total.");if(!Number.isSafeInteger(e.total)||e.total!==e.returned)throw new Error("Complete invocation coverage total must equal returned.");if(e.omitted!==0)throw new Error("Complete invocation coverage cannot omit results.");if(e.omittedIdentities!==void 0)throw new Error("Complete invocation coverage cannot name omitted identities.");if(e.continuation!==void 0)throw new Error("Complete invocation coverage cannot provide a continuation.")}else if(e.totalKnown){if(e.complete!==!1)throw new Error("Known incomplete invocation coverage must set complete to false.");if(!Number.isSafeInteger(e.total)||e.total<e.returned)throw new Error("Known invocation coverage total must be a safe integer at least as large as returned.");let n=e.total-e.returned;if(e.omitted!==n)throw new Error("Known invocation coverage omitted count must equal total minus returned.");if(n===0)throw new Error("Known incomplete invocation coverage must omit at least one result.");if(e.omittedIdentities&&e.omittedIdentities.length!==n)throw new Error("Omitted identity count must equal the disclosed omitted count.")}else{if(e.total!==void 0||e.omitted!==void 0)throw new Error("Unknown invocation coverage cannot claim a total or omitted count.");if(e.omittedIdentities!==void 0)throw new Error("Unknown invocation coverage cannot claim omitted identities.")}if(e.continuation&&(e.continuation.cursor.length===0||e.continuation.indexGeneration.length===0))throw new Error("Invocation coverage continuation requires a cursor and index generation.");if(e.resolution){if(!Number.isSafeInteger(e.resolution.totalCandidates)||e.resolution.totalCandidates<0)throw new Error("Invocation resolution candidate count must be a non-negative safe integer.");if(e.resolution.state==="exact"&&e.resolution.totalCandidates!==1)throw new Error("Exact invocation resolution must name exactly one candidate.");if(e.resolution.state==="missing"&&e.resolution.totalCandidates!==0)throw new Error("Missing invocation resolution cannot name candidates.");if(e.resolution.state==="ambiguous"&&e.resolution.totalCandidates<2)throw new Error("Ambiguous invocation resolution must name at least two candidates.")}}function ae(e,n,t){if(!e)return;let o=se(e,n);return e.coverage==="complete"?{complete:!0,totalKnown:!0,returned:o,total:o,omitted:0}:e.coverage==="sampled"?{complete:!1,totalKnown:!1,returned:o}:e.coverage==="bounded"&&t?{complete:!1,totalKnown:!1,returned:o}:{complete:null,totalKnown:!1,returned:o}}function se(e,n){let t=e.resultUnits??{kind:"report"};if(t.kind==="rows")return Array.isArray(n)?n.length:0;if(t.kind==="field"){if(!n||typeof n!="object")return 0;let o=n[t.field];return Array.isArray(o)?o.length:o==null?0:1}return n==null?0:1}function de(e){if(!e||typeof e!="object"||Array.isArray(e))return;let n=e;if(n.matched===!1)return{state:"missing",totalCandidates:0};if(n.matched!==!0||!Number.isSafeInteger(n.totalMatches))return;let t=n.totalMatches;return t<=0?{state:"missing",totalCandidates:0}:t===1?{state:"exact",totalCandidates:t}:{state:"ambiguous",totalCandidates:t}}function ue(e){return e.filter(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean")}function le(e){if(e.length===0)return{args:[],opts:{}};let n=e[e.length-1];return{args:e.slice(0,-1),opts:me(n)}}function me(e){if(!e||typeof e!="object")return{};let n=e,t=typeof n.optsWithGlobals=="function"?n.optsWithGlobals.bind(n):typeof n.opts=="function"?n.opts.bind(n):null;if(t){let o=t();return!o||typeof o!="object"?{}:(typeof n.getOptionValueSource=="function"&&Object.defineProperty(o,P,{value:r=>n.getOptionValueSource(r),enumerable:!1}),o)}return e}export{ce as a,pe as b,k as c,fe as d,Ie as e,ke as f,Ae as g,Ne as h,m as i,R as j,_e as k,Le as l,Me as m,Z as n,Je as o,ee as p,Pe as q,Te as r,De as s,Be as t,He as u,Qe as v,qe as w,Q as x,d as y,Ke as z,Ue as A,je as B,ne as C,oe as D,le as E,me as F};
2
+ //# sourceMappingURL=chunk-FH5WG4LE.js.map
@@ -1,7 +1,7 @@
1
- import{b as k}from"./chunk-OZYRSMSH.js";import{c as D}from"./chunk-7FND7D7N.js";import{m as S}from"./chunk-CVYSU6BX.js";import{f as v,h as L}from"./chunk-C7QOQX32.js";import{d as h,t as y}from"./chunk-FETNQCFO.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
1
+ import{b as k}from"./chunk-MHWMEZDA.js";import{c as D}from"./chunk-HENP2O4A.js";import{m as S}from"./chunk-J7AMBVWF.js";import{f as v,h as L}from"./chunk-NDKOVQFG.js";import{d as h,t as y}from"./chunk-GVAF222T.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
2
2
  FROM global_symbols gs
3
3
  JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
4
4
  JOIN documents d ON d.id = der.document_id
5
5
  WHERE gs.symbol = ?
6
6
  LIMIT 1`,n);return s?y(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=y(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
7
- //# sourceMappingURL=chunk-BVAJLC5A.js.map
7
+ //# sourceMappingURL=chunk-FOZ74V56.js.map
@@ -1,4 +1,4 @@
1
- import{a as G}from"./chunk-QOKYJ33H.js";import{a as O,c as z}from"./chunk-7FND7D7N.js";import{j as $}from"./chunk-6CS3UQTN.js";import{d as k,g as S,i as j}from"./chunk-FETNQCFO.js";import{C as A}from"./chunk-ADTBPVUZ.js";import{f as _}from"./chunk-CWONGW6P.js";import{aa as C,h as b}from"./chunk-NNJ2KZZG.js";import{execFileSync as g}from"child_process";import{existsSync as ne}from"fs";import{basename as W}from"path";var ie="Unable to compute git diff.",se={semanticConsumers:$,sourceFallbackConsumers:O},w={resolveCommit:C,readBatch({projectRoot:e,resolvedBase:i,relativePaths:t}){let n=t.map(a=>`${i}:./${a}
1
+ import{a as G}from"./chunk-QOKYJ33H.js";import{a as O,c as z}from"./chunk-HENP2O4A.js";import{j as $}from"./chunk-J3GLP7Q5.js";import{d as k,g as S,i as j}from"./chunk-GVAF222T.js";import{C as A}from"./chunk-ICUL7XRT.js";import{f as _}from"./chunk-SX72EVMY.js";import{ba as C,h as b}from"./chunk-UC2FD2PS.js";import{execFileSync as g}from"child_process";import{existsSync as ne}from"fs";import{basename as W}from"path";var ie="Unable to compute git diff.",se={semanticConsumers:$,sourceFallbackConsumers:O},w={resolveCommit:C,readBatch({projectRoot:e,resolvedBase:i,relativePaths:t}){let n=t.map(a=>`${i}:./${a}
2
2
  `).join("");return g("git",["cat-file","--batch"],{cwd:e,input:n,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"],windowsHide:!0})}};function Ze(e,i={}){let t=i.plan??ae(e,i);return t.note?ce(t.note,t.changedFileLines):t.changedFiles.length===0?le(t.changedFileLines):oe(t.changedFiles,[re(e,t.changedFiles,t.changedFiles,t.changedRanges)])}function ae(e,i={}){let{base:t="HEAD"}=i;try{let n=C(e.config.projectRoot,t),a=de(e.config.projectRoot,n),s=a.changedFileLines,o=be(e,s),r=ye(e,a.changedRanges);return{changedFileLines:s,changedFiles:o,changedRanges:r,renamedFiles:ge(e.config.projectRoot,n,o,a),note:s.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:ie}}}function re(e,i,t,n=[],a={}){let s=a.evidenceRuntime??se,o=new z(e),r=new Set(t),l=G(n),u=[],d=new Map,c=i.flatMap(f=>o.definitionsForFile(f)).filter(Ne),m=c.filter(f=>Ce(f,l)),p=ve(e,c,m,l),y=Ie([...m,...p.definitions]).sort((f,h)=>f.relativePath.localeCompare(h.relativePath)||f.startLine-h.startLine),B=y.map(f=>f.symbolId),M=Pe(e,B),ee=Ee(e,B,t),R=y.filter(f=>(M.get(f.symbolId)??0)===0),P=q("semantic-consumers",R.length,()=>s.semanticConsumers(e,R)),E=P.values,T=R.filter(f=>(E.get(f.symbolId)?.size??0)===0),N=q("source-fallback-consumers",T.length,()=>s.sourceFallbackConsumers(e,T)),te=N.values;for(let f of y)Fe(e,f,r,u,d,E.get(f.symbolId)??new Set,te.get(f.symbolId)??new Set,M.get(f.symbolId)??0,ee.get(f.symbolId)??new Set);return{changedSymbols:u,consumerEntries:[...d.entries()].map(([f,h])=>({file:f,symbols:[...h].sort()})),attributionNotes:p.notes,evidenceTiers:[P.status,N.status]}}function oe(e,i){let t=new Map,n=i.flatMap(r=>r.changedSymbols),a=i.flatMap(r=>r.attributionNotes??[]),s=Be(i);for(let r of i)for(let l of r.consumerEntries){let u=t.get(l.file);u||(u=new Set,t.set(l.file,u));for(let d of l.symbols)u.add(d)}let o=Te(t);return{changedFiles:[...e],changedSymbols:n,affectedConsumers:o,attributionNotes:a,evidenceTiers:s,summary:{totalChangedFiles:e.length,totalChangedSymbols:n.length,totalAffectedFiles:o.length}}}function ce(e,i=[]){return{changedFiles:i,changedSymbols:[],affectedConsumers:[],attributionNotes:[],evidenceTiers:X(),summary:{totalChangedFiles:i.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function le(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],attributionNotes:[],evidenceTiers:X(),summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function de(e,i){let t=g("git",["diff","--name-status","--find-renames",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:67108864,windowsHide:!0}),n=g("git",["diff","--name-status","--find-renames","--cached",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024,windowsHide:!0}),a=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024,windowsHide:!0}),s=g("git",["diff","--unified=0",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024,windowsHide:!0}),o=g("git",["diff","--unified=0","--cached",i,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024,windowsHide:!0}),r=pe([t,n]);return{changedFileLines:[...new Set([...r.changedFiles,...V(a)])],changedRanges:K([...U(s),...U(o)]),renamedFiles:r.renamedFiles,deletedFiles:r.deletedFiles}}function ue(e,i,t){let n=typeof e=="string"?{projectRoot:e,base:i,relativePath:t}:e;if(typeof n.projectRoot!="string"||typeof n.base!="string"||typeof n.relativePath!="string")throw new TypeError("fileContentAtBase requires projectRoot, base, and relativePath.");let a={projectRoot:n.projectRoot,base:n.base,relativePath:n.relativePath},{relativePath:s}=a,o=J(a);if(o.state==="unavailable")throw new Error(`Base content unavailable for ${s}: ${o.reason}`);return o.state==="present"?o.content:null}function J(e,i=w){return Z(e.relativePath),x({projectRoot:e.projectRoot,base:e.base,relativePaths:[e.relativePath]},i).get(e.relativePath)??{state:"unavailable",reason:`Base-content lookup omitted ${e.relativePath}.`}}function x(e,i=w){for(let o of e.relativePaths)Z(o);let t=[...new Set(e.relativePaths)];if(t.length===0)return new Map;let n;try{n=i.resolveCommit(e.projectRoot,e.base)}catch(o){return v(t,D(o))}let a;try{a=i.readBatch({projectRoot:e.projectRoot,resolvedBase:n,relativePaths:t})}catch(o){return v(t,D(o))}let s;try{s=me(a,t)}catch(o){return v(t,`Malformed git cat-file batch output: ${D(o)}`)}return new Map(t.map(o=>{let r=s.get(o)??null;return[o,r===null?{state:"absent"}:{state:"present",content:r}]}))}function fe(e,i=w){let t=x({projectRoot:e.projectRoot,base:e.base,relativePaths:e.preloadPaths??[]},i);return n=>(t.has(n)||t.set(n,J({projectRoot:e.projectRoot,base:e.base,relativePath:n},i)),t.get(n)??{state:"unavailable",reason:`Base-content reader omitted ${n}.`})}function Ve(e,i,t=[]){let n=typeof e=="string"?{projectRoot:e,base:i,preloadPaths:t}:e;if(typeof n.projectRoot!="string"||typeof n.base!="string")throw new TypeError("createBaseContentReader requires projectRoot and base.");let a={projectRoot:n.projectRoot,base:n.base,preloadPaths:n.preloadPaths},s=fe(a);return o=>{let r=s(o);if(r.state==="unavailable")throw new Error(`Base content unavailable for ${o}: ${r.reason}`);return r.state==="present"?r.content:null}}function Ye(e,i=e.changedFiles){let t=new Map(e.renamedFiles.map(n=>[n.to,n.from]));return[...new Set(i.map(n=>t.get(n)??n))]}function Ke(e,i,t){let n=typeof e=="string"?{projectRoot:e,base:i,relativePaths:t}:e;if(typeof n.projectRoot!="string"||typeof n.base!="string"||!Array.isArray(n.relativePaths))throw new TypeError("fileContentsAtBase requires projectRoot, base, and relativePaths.");let a=x(n),s=new Map;for(let[o,r]of a){if(r.state==="unavailable")throw new Error(`Base content unavailable for ${o}: ${r.reason}`);s.set(o,r.state==="present"?r.content:null)}return s}function Z(e){b(e)}function v(e,i){return new Map(e.map(t=>[t,{state:"unavailable",reason:i}]))}function D(e){let t=(e instanceof Error?e.message:String(e)).replaceAll(/\s+/g," ").trim().slice(0,500);return t===""?"Git base-content lookup failed without a reason.":t}function me(e,i){let t=new Map,n=0;for(let a of i){let s=e.indexOf(10,n);if(s<0)throw new Error("git cat-file batch output ended before object header");let o=e.subarray(n,s).toString("utf-8");if(n=s+1,o.endsWith(" missing")){t.set(a,null);continue}let r=/^[0-9a-f]+ ([^ ]+) (\d+)$/.exec(o);if(!r)throw new Error(`unexpected git cat-file batch header: ${o}`);let[,l,u]=r,d=Number(u);if(!Number.isFinite(d)||d<0)throw new Error(`unexpected git cat-file batch size: ${o}`);if(n+d>e.length)throw new Error("git cat-file batch output ended before blob payload");let c=e.subarray(n,n+d);t.set(a,l==="blob"?c.toString("utf-8"):null),n+=d,e[n]===10&&(n+=1)}return t}function ge(e,i,t,n){if(t.length===0)return[];let a=new Map,s=new Set;for(let r of n.renamedFiles)t.includes(r.to)&&(a.set(r.to,r),s.add(r.from));let o=n.deletedFiles;if(o.length===0)return[...a.values()].sort((r,l)=>r.to.localeCompare(l.to));for(let r of t){if(a.has(r)||!ne(`${e}/${r}`))continue;let l=o.filter(c=>!s.has(c)).filter(c=>W(c)===W(r));if(l.length===0)continue;let u=_(e,r),d=l.map(c=>({from:c,to:r,similarity:he(ue({projectRoot:e,base:i,relativePath:c})??"",u)})).sort((c,m)=>m.similarity-c.similarity)[0];d&&d.similarity>=.45&&(a.set(r,d),s.add(d.from))}return[...a.values()].sort((r,l)=>r.to.localeCompare(l.to))}function pe(e){let i=new Set,t=new Map,n=new Set;for(let a of e.flatMap(s=>V(s))){let[s,o,r]=a.split(" ");if(!(!s||!o)){if(s.startsWith("R")&&r){i.add(r),t.set(r,{from:o,to:r,similarity:Number(s.slice(1))/100});continue}i.add(o),s.startsWith("D")&&n.add(o)}}return{changedFiles:[...i],renamedFiles:[...t.values()],deletedFiles:[...n]}}function he(e,i){let t=new Set(H(e)),n=new Set(H(i));if(t.size===0&&n.size===0)return 1;if(t.size===0||n.size===0)return 0;let a=0;for(let s of t)n.has(s)&&(a+=1);return 2*a/(t.size+n.size)}function H(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function V(e){return e.split(`
3
3
  `).map(i=>i.trim()).filter(i=>i.length>0)}function be(e,i){let t=Y(e),n=[];for(let a of i){let s=t(a);s&&!e.isIgnored(s)&&n.push(s)}return n}function ye(e,i){let t=Y(e),n=[];for(let a of i){let s=t(a.file);s&&!e.isIgnored(s)&&n.push({...a,file:s})}return K(n)}function Y(e){let t=e.all(`SELECT relative_path FROM documents
4
4
  ORDER BY id`).map(a=>a.relative_path).map(a=>({path:a,normalized:b(a)})),n=new Map;for(let a of t){let s=n.get(a.normalized);n.set(a.normalized,s===void 0||s===a.path?a.path:null)}return a=>{let s=b(a),o=n.get(s);if(o)return o;let r=t.filter(l=>l.normalized.endsWith(s));return r.length===1?r[0].path:null}}function U(e){let i=[],t=null;for(let n of e.split(`
@@ -15,4 +15,4 @@ import{a as G}from"./chunk-QOKYJ33H.js";import{a as O,c as z}from"./chunk-7FND7D
15
15
  AND m.role != 1
16
16
  AND ref_d.relative_path NOT IN (${t.map(()=>"?").join(",")})
17
17
  ${e.pathExclusionsFor("ref_d")}`,...i,...t),a=new Map;for(let s of n){let o=a.get(s.symbol_id);o||(o=new Set,a.set(s.symbol_id,o)),o.add(s.relative_path)}return a}function I(e,i,t,n,a){if(e.isIgnored(n)||i.has(n))return;let s=t.get(n);s||(s=new Set,t.set(n,s)),s.add(a)}function Te(e){return[...e.entries()].map(([i,t])=>({file:i,consumedSymbols:t.size})).sort((i,t)=>t.consumedSymbols-i.consumedSymbols)}function Ne(e){return!(j(e.symbol)||e.parentTypeName!==null&&!S(e.symbol))}function _e(e,i){return S(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&i>0}export{ie as a,Ze as b,ae as c,re as d,oe as e,ue as f,J as g,x as h,fe as i,Ve as j,Ye as k,Ke as l,Se as m};
18
- //# sourceMappingURL=chunk-L4NRUAGJ.js.map
18
+ //# sourceMappingURL=chunk-FQTIFWLR.js.map