codebaseiq 0.1.0 → 0.2.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 (422) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/{chunk-DQMDCD24.js → chunk-27PHVDKL.js} +2 -2
  4. package/dist/{chunk-ZMI2JSX2.js → chunk-2DMVFAY7.js} +2 -2
  5. package/dist/{chunk-5PUWMSDU.js → chunk-2E6BTWER.js} +2 -2
  6. package/dist/{chunk-YESXMKX3.js → chunk-2F5ERMNI.js} +2 -2
  7. package/dist/chunk-2VKB5CMA.js +60 -0
  8. package/dist/{chunk-NNJ2KZZG.js → chunk-327YK6TB.js} +4 -4
  9. package/dist/chunk-347TXATM.js +2 -0
  10. package/dist/{chunk-VEXUL62T.js → chunk-35YYZD3D.js} +2 -2
  11. package/dist/chunk-36WRYYTE.js +3 -0
  12. package/dist/chunk-37TKC6MB.js +2 -0
  13. package/dist/{chunk-FAJQ7LWY.js → chunk-3AC56WAR.js} +2 -2
  14. package/dist/{chunk-JE3WZ6II.js → chunk-3NUZVLR7.js} +2 -2
  15. package/dist/{chunk-UZGZB3VB.js → chunk-3XFJUWJE.js} +2 -2
  16. package/dist/{chunk-OVTS4DKB.js → chunk-4AOOSCZ7.js} +2 -2
  17. package/dist/{chunk-LU3BMVH2.js → chunk-4IFISPQW.js} +2 -2
  18. package/dist/chunk-4NHWNAWQ.js +11 -0
  19. package/dist/chunk-4O52YNKL.js +5 -0
  20. package/dist/{chunk-HPJRBHVT.js → chunk-54K6556S.js} +2 -2
  21. package/dist/{chunk-HRWGYWRJ.js → chunk-57GCCPLS.js} +2 -2
  22. package/dist/{chunk-J77SU6VA.js → chunk-57KEZDPT.js} +2 -2
  23. package/dist/{chunk-OFBE4NGP.js → chunk-57KFVPVZ.js} +2 -2
  24. package/dist/{chunk-WOQBZPIF.js → chunk-5BDK6QC3.js} +2 -2
  25. package/dist/{chunk-7MGU3HPH.js → chunk-5IO2APSS.js} +2 -2
  26. package/dist/chunk-5NJPH3QZ.js +61 -0
  27. package/dist/{chunk-GW6Z3WGY.js → chunk-5WXOEJ4G.js} +2 -2
  28. package/dist/chunk-5XEVXVTK.js +3 -0
  29. package/dist/{chunk-RR7SX44N.js → chunk-6OVNYYY4.js} +2 -2
  30. package/dist/{chunk-ZV3JV5G5.js → chunk-6SDEQTVY.js} +2 -2
  31. package/dist/{chunk-EF2R3WNQ.js → chunk-6URCE5QY.js} +2 -2
  32. package/dist/{chunk-UCD3H3UZ.js → chunk-6ZV5EDUT.js} +2 -2
  33. package/dist/{chunk-C6SBF2WH.js → chunk-77GHPR2R.js} +2 -2
  34. package/dist/{chunk-YVCIMIOC.js → chunk-7R64XY4Y.js} +2 -2
  35. package/dist/{chunk-VXYS3FZD.js → chunk-7Z7HCZ7J.js} +2 -2
  36. package/dist/{chunk-CO5R3UNA.js → chunk-A67HT5FR.js} +2 -2
  37. package/dist/{chunk-UDS562V4.js → chunk-A7XQT7MH.js} +2 -2
  38. package/dist/{chunk-RDBI2RXU.js → chunk-ACZDU5GK.js} +2 -2
  39. package/dist/{chunk-FETNQCFO.js → chunk-AM5SUGHF.js} +2 -2
  40. package/dist/{chunk-NNOKTMZT.js → chunk-B2E3HZ2A.js} +2 -2
  41. package/dist/{chunk-CVYSU6BX.js → chunk-BH5CE4LN.js} +2 -2
  42. package/dist/chunk-BLKYYQ7C.js +543 -0
  43. package/dist/{chunk-4WKDMDEW.js → chunk-BX2U3QQV.js} +2 -2
  44. package/dist/{chunk-ZKX2FRS6.js → chunk-CANBLFVQ.js} +2 -2
  45. package/dist/{chunk-SMRBZ6EC.js → chunk-CCRZLRWJ.js} +2 -2
  46. package/dist/chunk-CDWSLAPN.js +21 -0
  47. package/dist/chunk-CIVYHK7U.js +22 -0
  48. package/dist/{chunk-L57ZKWVG.js → chunk-CMXW7MFV.js} +2 -2
  49. package/dist/{chunk-T3DGWPXM.js → chunk-CSZOQ7YO.js} +2 -2
  50. package/dist/{chunk-ZZXSWSN6.js → chunk-CWMHWD56.js} +2 -2
  51. package/dist/{chunk-6NW7MU72.js → chunk-CZEIHYMP.js} +2 -2
  52. package/dist/{chunk-DO6WQD2T.js → chunk-D62CTZX6.js} +2 -2
  53. package/dist/{chunk-XWUOUWYI.js → chunk-DFPAZXLU.js} +2 -2
  54. package/dist/{chunk-MOVBWNIP.js → chunk-DKJXK3HA.js} +2 -2
  55. package/dist/{chunk-XMQ23E27.js → chunk-DLC6JDN7.js} +2 -2
  56. package/dist/chunk-DUKHVPU5.js +4 -0
  57. package/dist/{chunk-ID63777H.js → chunk-DVYG3JTA.js} +2 -2
  58. package/dist/{chunk-NE6IU5ZD.js → chunk-EFFMFK7C.js} +2 -2
  59. package/dist/{chunk-I2T2LLK2.js → chunk-EM5UHLAM.js} +2 -2
  60. package/dist/chunk-EN4AHLL3.js +3 -0
  61. package/dist/chunk-EXMVF3JR.js +3 -0
  62. package/dist/{chunk-SWHMHUKF.js → chunk-FEBLLMTL.js} +2 -2
  63. package/dist/chunk-FIXYHQ3W.js +3 -0
  64. package/dist/{chunk-RKEJ6VTF.js → chunk-FLLXYUOL.js} +2 -2
  65. package/dist/{chunk-KWVHSKHK.js → chunk-FPDL2TUB.js} +2 -2
  66. package/dist/chunk-FQA3KIFX.js +17 -0
  67. package/dist/chunk-FWY2PRIF.js +3 -0
  68. package/dist/chunk-FY5V4V4F.js +2 -0
  69. package/dist/chunk-G2XUZCF2.js +88 -0
  70. package/dist/{chunk-QHRNXP3C.js → chunk-GXVDTHFC.js} +2 -2
  71. package/dist/{chunk-6MUIJMVL.js → chunk-H3CKAL6P.js} +2 -2
  72. package/dist/chunk-H5QXP63L.js +2 -0
  73. package/dist/{chunk-VUIYB2V3.js → chunk-HBQGKMM3.js} +2 -2
  74. package/dist/{chunk-PYAB5SM6.js → chunk-HBXZAGY6.js} +2 -2
  75. package/dist/{chunk-NNO6A2PO.js → chunk-HCMQZPEO.js} +2 -2
  76. package/dist/{chunk-Q65CQ4XL.js → chunk-HHBBGWES.js} +2 -2
  77. package/dist/{chunk-GTXSJDCO.js → chunk-HIEXRDJF.js} +2 -2
  78. package/dist/{chunk-4FC325IF.js → chunk-HYKSLTAR.js} +2 -2
  79. package/dist/{chunk-XLQ3GLWZ.js → chunk-I2KP4AGR.js} +2 -2
  80. package/dist/chunk-I5FCDTK2.js +2 -0
  81. package/dist/{chunk-QKPLA6IC.js → chunk-I645ZF75.js} +2 -2
  82. package/dist/{chunk-FDGD5AB5.js → chunk-IBM3F2BJ.js} +2 -2
  83. package/dist/{chunk-Q72QSKXC.js → chunk-IEL6Q5W3.js} +38 -38
  84. package/dist/{chunk-NCZUNH3E.js → chunk-IGQQUENU.js} +12 -12
  85. package/dist/chunk-IGYAZPRX.js +4 -0
  86. package/dist/chunk-IOVPAZWP.js +3 -0
  87. package/dist/{chunk-OL6KJP3N.js → chunk-IVJJNVSX.js} +2 -2
  88. package/dist/{chunk-AKB7V7TV.js → chunk-IWAMYGPN.js} +2 -2
  89. package/dist/chunk-IYBIBMPF.js +90 -0
  90. package/dist/{chunk-IOP6FWIM.js → chunk-J24VICI5.js} +2 -2
  91. package/dist/{chunk-C7QOQX32.js → chunk-JN5LIBT3.js} +2 -2
  92. package/dist/{chunk-O6QTXQPJ.js → chunk-JOALNFY3.js} +2 -2
  93. package/dist/{chunk-GCHRX4YW.js → chunk-JUO3Z644.js} +2 -2
  94. package/dist/{chunk-BJ6SQAEN.js → chunk-JXHLB7TP.js} +2 -2
  95. package/dist/{chunk-IJ4HMYBE.js → chunk-JYX5UZSZ.js} +2 -2
  96. package/dist/chunk-K2O7SBAU.js +2 -0
  97. package/dist/{chunk-OLF4MA5W.js → chunk-K5G7SPAG.js} +2 -2
  98. package/dist/{chunk-YSNONTJ2.js → chunk-KDYQQJ6X.js} +2 -2
  99. package/dist/{chunk-7NVGT435.js → chunk-KM4QRWI5.js} +2 -2
  100. package/dist/{chunk-HKQUXIFO.js → chunk-KNV5VFDV.js} +2 -2
  101. package/dist/chunk-L3YSDLNB.js +2 -0
  102. package/dist/{chunk-EZNMUY67.js → chunk-LAGDJXFY.js} +2 -2
  103. package/dist/{chunk-ENCCHKM6.js → chunk-LY2NB5XR.js} +4 -4
  104. package/dist/chunk-M4EVGA5S.js +14 -0
  105. package/dist/chunk-M7LAIM77.js +127 -0
  106. package/dist/{chunk-BVAJLC5A.js → chunk-MRGTCMDK.js} +2 -2
  107. package/dist/{chunk-OZYRSMSH.js → chunk-MT5W4DUG.js} +2 -2
  108. package/dist/{chunk-VE5AVNMP.js → chunk-MTMF4N7F.js} +2 -2
  109. package/dist/chunk-N3Q3AWGW.js +545 -0
  110. package/dist/{chunk-TXXOEMZJ.js → chunk-NDGTJHQN.js} +2 -2
  111. package/dist/chunk-NIO346UL.js +2 -0
  112. package/dist/chunk-NJA4MMBD.js +2 -0
  113. package/dist/{chunk-7FND7D7N.js → chunk-NK76RSB6.js} +2 -2
  114. package/dist/{chunk-H3LGFZVK.js → chunk-NTRW52UR.js} +2 -2
  115. package/dist/{chunk-JOIRNPPY.js → chunk-OJFLPVBP.js} +2 -2
  116. package/dist/{chunk-KMITESMT.js → chunk-OMBRP7BB.js} +2 -2
  117. package/dist/{chunk-UP3BUZR5.js → chunk-OVKZM2XI.js} +2 -2
  118. package/dist/{chunk-MVB3DAEY.js → chunk-PARCKE3Q.js} +2 -2
  119. package/dist/{chunk-CAUCPUOF.js → chunk-PFPHS4NO.js} +2 -2
  120. package/dist/chunk-PHPQ24UG.js +22 -0
  121. package/dist/chunk-PLZXWZHY.js +77 -0
  122. package/dist/{chunk-34WBMAYK.js → chunk-PNVZIJ57.js} +2 -2
  123. package/dist/{chunk-SYDJMPES.js → chunk-QKVTWODE.js} +2 -2
  124. package/dist/{chunk-FW53T7EB.js → chunk-QLTFXVUI.js} +2 -2
  125. package/dist/{chunk-PBI2LFKH.js → chunk-QMGWSEPL.js} +2 -2
  126. package/dist/{chunk-CQP3THUZ.js → chunk-QVHZB75Z.js} +2 -2
  127. package/dist/{chunk-6BQ3DSPK.js → chunk-QVWDQTMG.js} +2 -2
  128. package/dist/{chunk-ST7V3SKN.js → chunk-RCPZOPV6.js} +2 -2
  129. package/dist/chunk-RJWAB4VR.js +345 -0
  130. package/dist/chunk-RRPK327J.js +20 -0
  131. package/dist/chunk-RVYLJDXC.js +21 -0
  132. package/dist/chunk-RWKEXCHU.js +3 -0
  133. package/dist/{chunk-L4NRUAGJ.js → chunk-S5SKXCND.js} +2 -2
  134. package/dist/{chunk-RBAS5ZHI.js → chunk-S64NCE2Z.js} +2 -2
  135. package/dist/{chunk-WMPRTGH2.js → chunk-SF34QLK2.js} +2 -2
  136. package/dist/{chunk-ANFVSJWQ.js → chunk-SJZQ2PTZ.js} +2 -2
  137. package/dist/{chunk-4XTAUQFD.js → chunk-SRY26ITJ.js} +2 -2
  138. package/dist/chunk-SV2LEFVM.js +2 -0
  139. package/dist/{chunk-7XAN6GKB.js → chunk-T3YFIJ5P.js} +2 -2
  140. package/dist/chunk-T55YPJGB.js +3 -0
  141. package/dist/chunk-TAJ6UGCO.js +21 -0
  142. package/dist/{chunk-PIOMTC27.js → chunk-TUTSO7UZ.js} +2 -2
  143. package/dist/{chunk-FQKZWM4L.js → chunk-U24M5RQM.js} +5 -5
  144. package/dist/{chunk-XME3HPXZ.js → chunk-U2XX3BT4.js} +2 -2
  145. package/dist/{chunk-SZD2KF7Q.js → chunk-UWB5WMC2.js} +2 -2
  146. package/dist/{chunk-6CS3UQTN.js → chunk-VCL7FK3E.js} +2 -2
  147. package/dist/{chunk-N3IQCBCF.js → chunk-VCWAJPXQ.js} +2 -2
  148. package/dist/{chunk-LZYFLFEH.js → chunk-VG55NFXF.js} +2 -2
  149. package/dist/{chunk-PTAWHLVJ.js → chunk-VLTUX4IF.js} +2 -2
  150. package/dist/{chunk-JEJLSICM.js → chunk-VVCBMH5O.js} +2 -2
  151. package/dist/{chunk-JSOYNVWH.js → chunk-VYZQZ4ZN.js} +2 -2
  152. package/dist/chunk-W3FK73MD.js +8 -0
  153. package/dist/{chunk-UNBY47BC.js → chunk-W6C6QTXJ.js} +2 -2
  154. package/dist/chunk-WH5SYOMD.js +2 -0
  155. package/dist/chunk-WJOQC4P7.js +7 -0
  156. package/dist/chunk-WO47BIPY.js +3 -0
  157. package/dist/chunk-WOOTEWQT.js +239 -0
  158. package/dist/{chunk-UBGWN7I4.js → chunk-X5I2BQGX.js} +2 -2
  159. package/dist/{chunk-PX4RYAAK.js → chunk-XNUWRTYM.js} +2 -2
  160. package/dist/{chunk-ICFDQHAM.js → chunk-XUJM6474.js} +2 -2
  161. package/dist/chunk-XYLV727H.js +21 -0
  162. package/dist/{chunk-TRRC4ZJ7.js → chunk-YFQPWKHR.js} +2 -2
  163. package/dist/{chunk-NEDP5RFQ.js → chunk-YIOQJ45A.js} +2 -2
  164. package/dist/{chunk-Y6KHROC3.js → chunk-YXJ4IAHH.js} +2 -2
  165. package/dist/chunk-YYFV32WR.js +3 -0
  166. package/dist/{chunk-BH5F2Q4O.js → chunk-ZB3V5QM7.js} +2 -2
  167. package/dist/chunk-ZJZQ7Q2Q.js +3 -0
  168. package/dist/{chunk-EMNIHCRB.js → chunk-ZNQCR656.js} +2 -2
  169. package/dist/{chunk-TIIC3ZE7.js → chunk-ZOEDRCR4.js} +2 -2
  170. package/dist/cli-context-TSADTXLB.js +2 -0
  171. package/dist/cli-context-XEPPF4RX.js +3 -0
  172. package/dist/cli-program-KJGQEM72.js +7 -0
  173. package/dist/cli.js +1 -1
  174. package/dist/{code-DlqpBDd0.d.ts → code-CDe-mIjx.d.ts} +1 -1
  175. package/dist/code-viewer-YGDON6SY.js +12 -0
  176. package/dist/code-viewer-ZCTHXQ5C.js +11 -0
  177. package/dist/command-descriptors-5VAB2MZX.js +335 -0
  178. package/dist/command-descriptors-EAHKIRAG.js +337 -0
  179. package/dist/{config-types-BNoC96J3.d.ts → config-types-D6X5S68_.d.ts} +50 -0
  180. package/dist/{db-D7sauVFH.d.ts → db-DmRNdCtm.d.ts} +1 -1
  181. package/dist/direct-navigation-B3SGOOBW.js +2 -0
  182. package/dist/direct-navigation-ZL362KXF.js +3 -0
  183. package/dist/{graph-evidence-BIFqyisO.d.ts → graph-evidence-Bs54NWws.d.ts} +1 -1
  184. package/dist/{health-DJaZXg8I.d.ts → health-BnzbSLCE.d.ts} +1 -1
  185. package/dist/index.d.ts +2 -2
  186. package/dist/index.js +1 -1
  187. package/dist/invocation-command-descriptors-CSUGUHTT.js +2 -0
  188. package/dist/invocation-command-descriptors-PPVZOIE5.js +3 -0
  189. package/dist/output-continuation-command-FTVVBVSN.js +2 -0
  190. package/dist/output-continuation-command-ITPRC3YV.js +3 -0
  191. package/dist/project-reindex-7HZSLLLY.js +3 -0
  192. package/dist/project-reindex-NGM3DYBN.js +2 -0
  193. package/dist/queries/affected.d.ts +2 -2
  194. package/dist/queries/affected.js +1 -1
  195. package/dist/queries/anchors.d.ts +2 -2
  196. package/dist/queries/anchors.js +1 -1
  197. package/dist/queries/architecture.d.ts +2 -2
  198. package/dist/queries/architecture.js +1 -1
  199. package/dist/queries/bottlenecks.d.ts +2 -2
  200. package/dist/queries/bottlenecks.js +1 -1
  201. package/dist/queries/by-kind.d.ts +2 -2
  202. package/dist/queries/by-kind.js +1 -1
  203. package/dist/queries/call-graph.d.ts +2 -2
  204. package/dist/queries/call-graph.js +1 -1
  205. package/dist/queries/change-surface.d.ts +2 -2
  206. package/dist/queries/change-surface.js +1 -1
  207. package/dist/queries/cleanup-plan.d.ts +2 -2
  208. package/dist/queries/cleanup-plan.js +1 -1
  209. package/dist/queries/co-change.d.ts +2 -2
  210. package/dist/queries/co-change.js +1 -1
  211. package/dist/queries/code.d.ts +3 -3
  212. package/dist/queries/code.js +1 -1
  213. package/dist/queries/complexity-hotspots.d.ts +2 -2
  214. package/dist/queries/complexity-hotspots.js +1 -1
  215. package/dist/queries/complexity.d.ts +2 -2
  216. package/dist/queries/complexity.js +1 -1
  217. package/dist/queries/context.d.ts +2 -2
  218. package/dist/queries/context.js +1 -1
  219. package/dist/queries/convergence.d.ts +2 -2
  220. package/dist/queries/convergence.js +1 -1
  221. package/dist/queries/coupling.d.ts +2 -2
  222. package/dist/queries/coupling.js +1 -1
  223. package/dist/queries/cycles.d.ts +2 -2
  224. package/dist/queries/cycles.js +1 -1
  225. package/dist/queries/dataflow.d.ts +2 -2
  226. package/dist/queries/dataflow.js +1 -1
  227. package/dist/queries/dead.d.ts +2 -2
  228. package/dist/queries/dead.js +1 -1
  229. package/dist/queries/decorative-checkers.d.ts +2 -2
  230. package/dist/queries/decorative-checkers.js +1 -1
  231. package/dist/queries/deep-chains.d.ts +2 -2
  232. package/dist/queries/deep-chains.js +1 -1
  233. package/dist/queries/dependence-slice.d.ts +3 -3
  234. package/dist/queries/dependence-slice.js +1 -1
  235. package/dist/queries/dependency-depth.d.ts +2 -2
  236. package/dist/queries/dependency-depth.js +1 -1
  237. package/dist/queries/deps.d.ts +2 -2
  238. package/dist/queries/deps.js +1 -1
  239. package/dist/queries/diff-impact.d.ts +2 -2
  240. package/dist/queries/diff-impact.js +1 -1
  241. package/dist/queries/doc-drift.d.ts +2 -2
  242. package/dist/queries/doc-drift.js +1 -1
  243. package/dist/queries/drift.d.ts +2 -2
  244. package/dist/queries/drift.js +1 -1
  245. package/dist/queries/duplicate-bodies.d.ts +2 -2
  246. package/dist/queries/duplicate-bodies.js +1 -1
  247. package/dist/queries/entry-map.d.ts +2 -2
  248. package/dist/queries/entry-map.js +1 -1
  249. package/dist/queries/evidence.d.ts +3 -3
  250. package/dist/queries/evidence.js +1 -1
  251. package/dist/queries/extract-candidates.d.ts +2 -2
  252. package/dist/queries/extract-candidates.js +1 -1
  253. package/dist/queries/fan.d.ts +2 -2
  254. package/dist/queries/fan.js +1 -1
  255. package/dist/queries/files.d.ts +2 -2
  256. package/dist/queries/files.js +1 -1
  257. package/dist/queries/health.d.ts +3 -3
  258. package/dist/queries/health.js +1 -1
  259. package/dist/queries/hierarchy.d.ts +2 -2
  260. package/dist/queries/hierarchy.js +1 -1
  261. package/dist/queries/hotspots.d.ts +2 -2
  262. package/dist/queries/hotspots.js +1 -1
  263. package/dist/queries/imports.d.ts +2 -2
  264. package/dist/queries/imports.js +1 -1
  265. package/dist/queries/incomplete-migration.d.ts +2 -2
  266. package/dist/queries/incomplete-migration.js +1 -1
  267. package/dist/queries/index.d.ts +5 -5
  268. package/dist/queries/index.js +1 -1
  269. package/dist/queries/isolated.d.ts +2 -2
  270. package/dist/queries/isolated.js +1 -1
  271. package/dist/queries/locality-candidates.d.ts +2 -2
  272. package/dist/queries/locality-candidates.js +1 -1
  273. package/dist/queries/members.d.ts +2 -2
  274. package/dist/queries/members.js +1 -1
  275. package/dist/queries/methods.d.ts +2 -2
  276. package/dist/queries/methods.js +1 -1
  277. package/dist/queries/not-implemented.d.ts +2 -2
  278. package/dist/queries/not-implemented.js +1 -1
  279. package/dist/queries/outline.d.ts +2 -2
  280. package/dist/queries/outline.js +1 -1
  281. package/dist/queries/passthrough-candidates.d.ts +2 -2
  282. package/dist/queries/passthrough-candidates.js +1 -1
  283. package/dist/queries/plan-context.d.ts +2 -2
  284. package/dist/queries/plan-context.js +1 -1
  285. package/dist/queries/react-component-duplicates.d.ts +2 -2
  286. package/dist/queries/react-component-duplicates.js +1 -1
  287. package/dist/queries/react-hook-candidates.d.ts +2 -2
  288. package/dist/queries/react-hook-candidates.js +1 -1
  289. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  290. package/dist/queries/react-large-component-pressure.js +1 -1
  291. package/dist/queries/recent-duplicates.d.ts +2 -2
  292. package/dist/queries/recent-duplicates.js +1 -1
  293. package/dist/queries/redundant-reexports.d.ts +2 -2
  294. package/dist/queries/redundant-reexports.js +1 -1
  295. package/dist/queries/reference-neighborhood.d.ts +2 -2
  296. package/dist/queries/reference-neighborhood.js +1 -1
  297. package/dist/queries/reference-reachability.d.ts +2 -2
  298. package/dist/queries/reference-reachability.js +1 -1
  299. package/dist/queries/refs.d.ts +2 -2
  300. package/dist/queries/refs.js +1 -1
  301. package/dist/queries/self-audit.d.ts +2 -2
  302. package/dist/queries/self-audit.js +1 -1
  303. package/dist/queries/similar-chains.d.ts +2 -2
  304. package/dist/queries/similar-chains.js +1 -1
  305. package/dist/queries/similar-files.d.ts +2 -2
  306. package/dist/queries/similar-files.js +1 -1
  307. package/dist/queries/similar-signatures.d.ts +2 -2
  308. package/dist/queries/similar-signatures.js +1 -1
  309. package/dist/queries/similar.d.ts +2 -2
  310. package/dist/queries/similar.js +1 -1
  311. package/dist/queries/slice.d.ts +2 -2
  312. package/dist/queries/slice.js +1 -1
  313. package/dist/queries/source-inspection.d.ts +4 -4
  314. package/dist/queries/source-inspection.js +1 -1
  315. package/dist/queries/source-search.d.ts +2 -2
  316. package/dist/queries/source-search.js +1 -1
  317. package/dist/queries/stale-abstractions.d.ts +2 -2
  318. package/dist/queries/stale-abstractions.js +1 -1
  319. package/dist/queries/stats.d.ts +2 -2
  320. package/dist/queries/surface.d.ts +2 -2
  321. package/dist/queries/surface.js +1 -1
  322. package/dist/queries/symbols.d.ts +2 -2
  323. package/dist/queries/symbols.js +1 -1
  324. package/dist/queries/system-map.d.ts +2 -2
  325. package/dist/queries/system-map.js +1 -1
  326. package/dist/queries/system.d.ts +2 -2
  327. package/dist/queries/system.js +1 -1
  328. package/dist/queries/test-quality.d.ts +2 -2
  329. package/dist/queries/test-quality.js +1 -1
  330. package/dist/queries/trace.d.ts +2 -2
  331. package/dist/queries/trace.js +1 -1
  332. package/dist/queries/twin-ab.d.ts +2 -2
  333. package/dist/queries/twin-ab.js +1 -1
  334. package/dist/queries/twin-drift.d.ts +2 -2
  335. package/dist/queries/twin-drift.js +1 -1
  336. package/dist/queries/unused-imports.d.ts +2 -2
  337. package/dist/queries/unused-imports.js +1 -1
  338. package/dist/queries/unused-params.d.ts +2 -2
  339. package/dist/queries/unused-params.js +1 -1
  340. package/dist/queries/value-flow.d.ts +3 -3
  341. package/dist/queries/value-flow.js +1 -1
  342. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  343. package/dist/queries/vue-component-duplicates.js +1 -1
  344. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  345. package/dist/queries/vue-composable-candidates.js +1 -1
  346. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  347. package/dist/queries/vue-large-view-pressure.js +1 -1
  348. package/dist/queries/wrapper-candidates.d.ts +2 -2
  349. package/dist/queries/wrapper-candidates.js +1 -1
  350. package/dist/reindex-worker.js +1 -1
  351. package/dist/reindex.d.ts +3 -3
  352. package/dist/reindex.js +31 -31
  353. package/dist/runtime.d.ts +24 -4
  354. package/dist/runtime.js +3 -3
  355. package/dist/rust-semantic-session-server.js +1 -1
  356. package/dist/rust-semantic-session-worker.js +1 -1
  357. package/dist/rust-semantic-worker.js +1 -1
  358. package/dist/{scip-cli-B7N3haxa.d.ts → scip-cli-BRFKkHQn.d.ts} +1 -1
  359. package/dist/sentinel-ensure-command-KYYULCFU.js +2 -0
  360. package/dist/sentinel-ensure-command-RIZA3RY7.js +3 -0
  361. package/dist/sentinel-hook.js +39 -0
  362. package/dist/sentinel-worker.js +16 -0
  363. package/dist/typescript-mailbox-worker.js +1 -1
  364. package/dist/watch-server.js +6 -6
  365. package/docs/COMMAND_REFERENCE.md +5 -3
  366. package/docs/schemas/project-config.schema.json +159 -0
  367. package/package.json +9 -5
  368. package/skills/codebaseiq/SKILL.md +1 -1
  369. package/skills/concrete-plan/SKILL.md +1 -1
  370. package/ui/view/api.js +450 -0
  371. package/ui/view/app.js +394 -0
  372. package/ui/view/builder.js +323 -0
  373. package/ui/view/file-panel.js +170 -0
  374. package/ui/view/focus.js +379 -0
  375. package/ui/view/index.html +54 -0
  376. package/ui/view/map.js +424 -0
  377. package/ui/view/styles.css +1125 -0
  378. package/dist/chunk-2X7V4HS4.js +0 -88
  379. package/dist/chunk-3IER7Q6H.js +0 -12
  380. package/dist/chunk-3JSXXYTZ.js +0 -345
  381. package/dist/chunk-476NR5B7.js +0 -2
  382. package/dist/chunk-5VKBFZZU.js +0 -3
  383. package/dist/chunk-ADTBPVUZ.js +0 -21
  384. package/dist/chunk-BFFZDZQV.js +0 -2
  385. package/dist/chunk-BMYOV5GP.js +0 -77
  386. package/dist/chunk-C74PPYLA.js +0 -3
  387. package/dist/chunk-CWONGW6P.js +0 -3
  388. package/dist/chunk-DDZ7VHWV.js +0 -20
  389. package/dist/chunk-DR2LURYU.js +0 -3
  390. package/dist/chunk-ECQBG7PW.js +0 -564
  391. package/dist/chunk-FM5BPL4V.js +0 -60
  392. package/dist/chunk-G6XFR4ZL.js +0 -4
  393. package/dist/chunk-GTIYTDRE.js +0 -562
  394. package/dist/chunk-HOA5YGOH.js +0 -3
  395. package/dist/chunk-KUW32IRO.js +0 -2
  396. package/dist/chunk-LTA3BRZX.js +0 -2
  397. package/dist/chunk-NAUD7LCA.js +0 -2
  398. package/dist/chunk-OGTFJ3XD.js +0 -2
  399. package/dist/chunk-Q5ELPRKQ.js +0 -2
  400. package/dist/chunk-QCN62RTF.js +0 -3
  401. package/dist/chunk-QW7EP6WI.js +0 -21
  402. package/dist/chunk-RU65DDUP.js +0 -215
  403. package/dist/chunk-SELM5MER.js +0 -2
  404. package/dist/chunk-SNNWPCN7.js +0 -4
  405. package/dist/chunk-TFZB6XTM.js +0 -239
  406. package/dist/chunk-UXM43C7T.js +0 -3
  407. package/dist/chunk-VFY6Y2H6.js +0 -61
  408. package/dist/chunk-WE5RZHZ7.js +0 -5
  409. package/dist/chunk-Z54RD7VL.js +0 -3
  410. package/dist/cli-context-3SNLDYBM.js +0 -3
  411. package/dist/cli-context-T3B7W6GG.js +0 -2
  412. package/dist/cli-program-YNOXO72B.js +0 -7
  413. package/dist/command-descriptors-6AOUKWW7.js +0 -346
  414. package/dist/command-descriptors-ZFKJSRUP.js +0 -344
  415. package/dist/direct-navigation-DP4LVMRX.js +0 -3
  416. package/dist/direct-navigation-FLUS3BT6.js +0 -2
  417. package/dist/invocation-command-descriptors-QT2JMY5J.js +0 -3
  418. package/dist/invocation-command-descriptors-YN4QJEAX.js +0 -2
  419. package/dist/output-continuation-command-2V2SL4TD.js +0 -2
  420. package/dist/output-continuation-command-65J5IP3O.js +0 -3
  421. package/dist/project-reindex-5JOKXAXT.js +0 -2
  422. package/dist/project-reindex-UQBIKO4M.js +0 -3
@@ -1,3 +1,3 @@
1
- import{B as Q,c as N,d as _,e as w,g as k,h as A,i as z,n as f,o as S,r as R}from"./chunk-FETNQCFO.js";import{b as B}from"./chunk-ADTBPVUZ.js";import{e as O}from"./chunk-BMYOV5GP.js";var T=O("symbol-resolution",{clearGroups:[]});function he(e,n){return G(e,n).match}function G(e,n){return T.get(e,n,()=>{let t=W(e,n.trim()).filter(i=>!e.isIgnored(i.relative_path));if(t.length>0)return L(e,t);let o=P(e,n);if(o&&!e.isIgnored(o.relative_path))return L(e,[o]);let r=H(e,n);if(r.length>0)return L(e,r);let s=U(e,n);return s.length>0?L(e,s):J(e,n)})}function H(e,n){let t=n.trim().replace(/\(\)$/u,""),o=t.lastIndexOf(":");if(o<=0||o===t.length-1||t.startsWith("local:"))return[];let r=t.slice(o+1);if(!/^[\p{L}_$][\p{L}\p{N}_$]*$/u.test(r))return[];let s=[`/${r}().`,`/${r}.`,`/${r}#`,`#${r}().`,`#${r}.`,`/${r}/`],i=`gs.display_name = ? OR ${s.map(()=>"instr(gs.symbol, ?) > 0").join(" OR ")}`,a=[r,...s],l=f(e,{where:i,params:a,orderBy:"d.relative_path, der.start_line",limit:200}),m=l.length>0?[]:S(e,{where:i,params:a,orderBy:"d.relative_path, start_line",limit:200}),p=R(l,m).filter(u=>!e.isIgnored(u.relative_path)).filter(u=>_(u.symbol).replace(/\(\)$/u,"")===t);return[...new Map(p.map(u=>[`${u.symbol}\0${u.relative_path}`,u])).values()]}function U(e,n){let t=M(n),o=E(t);if(!o)return[];let r=`%${o.path}%`,s=o.leaf;return X(e,r,s,t)}function X(e,n,t,o){let r=R([],[...Y(e,n,t),...Z(e,n,t)]).filter(s=>!e.isIgnored(s.relative_path)).filter(s=>C(s,o)>1);return r.sort((s,i)=>C(i,o)-C(s,o)||s.end_line-s.start_line-(i.end_line-i.start_line)||s.start_line-i.start_line||s.symbol.localeCompare(i.symbol)),r}function Y(e,n,t){return f(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function Z(e,n,t){return S(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function J(e,n){let t=M(n),o=ae(n),r=oe(e,o),s=se(r,n,t).filter(a=>!e.isIgnored(a.relative_path));if(s.length>0)return L(e,s);let i=[];for(let a of r){if(e.isIgnored(a.relative_path))continue;let l=re(a,n,t,o);l<=0||i.push({row:a,score:l})}return i.sort((a,l)=>l.score-a.score||a.row.end_line-a.row.start_line-(l.row.end_line-l.row.start_line)||a.row.relative_path.localeCompare(l.row.relative_path)||a.row.symbol.localeCompare(l.row.symbol)),L(e,i.map(a=>a.row))}function L(e,n){let t=n.map(r=>Q(e,r)),o=t[0]??null;return{match:o,candidates:o?V(t,o):[],total:t.length}}function V(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let r of e){let s=`${r.symbolId}:${r.relativePath}:${r.startLine}`;if(!t.has(s)&&(t.add(s),o.push({symbol:r.symbol,shortName:_(r.symbol),relativePath:r.relativePath,startLine:r.startLine}),o.length>=5))break}return o}function P(e,n){let t=n.match(/^(.+):(\d+)(?:-(\d+))?$/);if(!t)return;let[,o,r,s]=t,i=B(e,o,{allowMultiple:!1})[0]?.relativePath;if(!i)return;let a=Math.max(0,parseInt(r,10)-1),l=s?Math.max(a,parseInt(s,10)-1):a;return ee(e,i,a,l)??te(e,i,a,l)}function ee(e,n,t,o){return f(e,{where:"d.relative_path = ? AND der.start_line <= ? AND der.end_line >= ?",params:[n,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function te(e,n,t,o){return S(e,{where:"d.relative_path = ? AND c.start_line <= ? AND c.end_line >= ?",params:[n,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function be(e,n){let t=W(e,n).find(o=>!e.isIgnored(o.relative_path));return t?Q(e,t):null}function W(e,n){let t=f(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:S(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return R(t,o)}function Se(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=ne(e,n.symbolId)[0];return t?Q(e,t):null}function ne(e,n){let t=f(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=S(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return R(t,o)}function oe(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(a=>{let l=`%${a}%`;return[l,l,l]}),r=t.join(`
1
+ import{B as Q,c as N,d as _,e as w,g as k,h as A,i as z,n as f,o as S,r as R}from"./chunk-AM5SUGHF.js";import{b as B}from"./chunk-RVYLJDXC.js";import{g as O}from"./chunk-PLZXWZHY.js";var T=O("symbol-resolution",{clearGroups:[]});function he(e,n){return G(e,n).match}function G(e,n){return T.get(e,n,()=>{let t=W(e,n.trim()).filter(i=>!e.isIgnored(i.relative_path));if(t.length>0)return L(e,t);let o=P(e,n);if(o&&!e.isIgnored(o.relative_path))return L(e,[o]);let r=H(e,n);if(r.length>0)return L(e,r);let s=U(e,n);return s.length>0?L(e,s):J(e,n)})}function H(e,n){let t=n.trim().replace(/\(\)$/u,""),o=t.lastIndexOf(":");if(o<=0||o===t.length-1||t.startsWith("local:"))return[];let r=t.slice(o+1);if(!/^[\p{L}_$][\p{L}\p{N}_$]*$/u.test(r))return[];let s=[`/${r}().`,`/${r}.`,`/${r}#`,`#${r}().`,`#${r}.`,`/${r}/`],i=`gs.display_name = ? OR ${s.map(()=>"instr(gs.symbol, ?) > 0").join(" OR ")}`,a=[r,...s],l=f(e,{where:i,params:a,orderBy:"d.relative_path, der.start_line",limit:200}),m=l.length>0?[]:S(e,{where:i,params:a,orderBy:"d.relative_path, start_line",limit:200}),p=R(l,m).filter(u=>!e.isIgnored(u.relative_path)).filter(u=>_(u.symbol).replace(/\(\)$/u,"")===t);return[...new Map(p.map(u=>[`${u.symbol}\0${u.relative_path}`,u])).values()]}function U(e,n){let t=M(n),o=E(t);if(!o)return[];let r=`%${o.path}%`,s=o.leaf;return X(e,r,s,t)}function X(e,n,t,o){let r=R([],[...Y(e,n,t),...Z(e,n,t)]).filter(s=>!e.isIgnored(s.relative_path)).filter(s=>C(s,o)>1);return r.sort((s,i)=>C(i,o)-C(s,o)||s.end_line-s.start_line-(i.end_line-i.start_line)||s.start_line-i.start_line||s.symbol.localeCompare(i.symbol)),r}function Y(e,n,t){return f(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function Z(e,n,t){return S(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function J(e,n){let t=M(n),o=ae(n),r=oe(e,o),s=se(r,n,t).filter(a=>!e.isIgnored(a.relative_path));if(s.length>0)return L(e,s);let i=[];for(let a of r){if(e.isIgnored(a.relative_path))continue;let l=re(a,n,t,o);l<=0||i.push({row:a,score:l})}return i.sort((a,l)=>l.score-a.score||a.row.end_line-a.row.start_line-(l.row.end_line-l.row.start_line)||a.row.relative_path.localeCompare(l.row.relative_path)||a.row.symbol.localeCompare(l.row.symbol)),L(e,i.map(a=>a.row))}function L(e,n){let t=n.map(r=>Q(e,r)),o=t[0]??null;return{match:o,candidates:o?V(t,o):[],total:t.length}}function V(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let r of e){let s=`${r.symbolId}:${r.relativePath}:${r.startLine}`;if(!t.has(s)&&(t.add(s),o.push({symbol:r.symbol,shortName:_(r.symbol),relativePath:r.relativePath,startLine:r.startLine}),o.length>=5))break}return o}function P(e,n){let t=n.match(/^(.+):(\d+)(?:-(\d+))?$/);if(!t)return;let[,o,r,s]=t,i=B(e,o,{allowMultiple:!1})[0]?.relativePath;if(!i)return;let a=Math.max(0,parseInt(r,10)-1),l=s?Math.max(a,parseInt(s,10)-1):a;return ee(e,i,a,l)??te(e,i,a,l)}function ee(e,n,t,o){return f(e,{where:"d.relative_path = ? AND der.start_line <= ? AND der.end_line >= ?",params:[n,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function te(e,n,t,o){return S(e,{where:"d.relative_path = ? AND c.start_line <= ? AND c.end_line >= ?",params:[n,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function be(e,n){let t=W(e,n).find(o=>!e.isIgnored(o.relative_path));return t?Q(e,t):null}function W(e,n){let t=f(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:S(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return R(t,o)}function Se(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=ne(e,n.symbolId)[0];return t?Q(e,t):null}function ne(e,n){let t=f(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=S(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return R(t,o)}function oe(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(a=>{let l=`%${a}%`;return[l,l,l]}),r=t.join(`
2
2
  AND `),s=f(e,{where:r,params:o,limit:200}),i=S(e,{where:r,params:o,limit:200});return R(s,i)}function re(e,n,t,o){let r=n.trim(),s=t,i=s.replace(/\(\)$/,""),a=n.toLowerCase(),l=t.toLowerCase(),m=l.replace(/\(\)$/,""),p=e.symbol,u=_(e.symbol),y=w(e.symbol),g=e.display_name??"",$=e.symbol.toLowerCase(),d=u.toLowerCase(),h=y.toLowerCase(),x=g.toLowerCase(),b=e.relative_path.toLowerCase(),j=/[/:.]/.test(t),I=E(t),v=I?.leaf.toLowerCase(),c=0;return(p===r||p===s)&&(c+=1150),(u===r||u===s)&&(c+=1100),g===i&&(c+=1180),y===i&&(c+=1160),(`${y}()`===r||`${y}()`===s)&&(c+=955),($===a||$===l)&&(c+=1e3),(d===a||d===l)&&(c+=950),(b===a||b===l)&&(c+=925),(b.endsWith(`/${l}`)||b.endsWith(`/${a}`))&&(c+=875),x===m&&(c+=850),h===m&&(c+=825),(`${h}()`===a||`${h}()`===l)&&(c+=820),(d.endsWith(`:${l}`)||d.endsWith(`:${m}`)||d.endsWith(`:${m}()`))&&(c+=800),$.includes(l)&&(c+=120),d.includes(l)&&(c+=140),b.includes(l)&&(c+=140),x.includes(l)&&(c+=110),o.every(q=>{let D=q.toLowerCase();return $.includes(D)||d.includes(D)||b.includes(D)||x.includes(D)})&&(c+=100+o.length*15),I&&b.includes(I.path.toLowerCase())&&(c+=360,v&&(h===v||`${h}()`===v||`${h}()`==`${v}()`)&&(c+=700),k(e.symbol)&&(c+=180)),A(e.symbol)&&h===m&&(c+=60),!j&&z(e.symbol)&&(c-=160),c-=Math.min(50,Math.max(0,e.end_line-e.start_line)),c}function E(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let o=n.slice(t+1).replace(/\(\)$/,"");return!o||o.includes(".")?null:{path:n.slice(0,t),leaf:o}}function M(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function ae(e){let n=M(e),t=n.split(/[^A-Za-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>0);return t.length>0?[...new Set(t)]:[n]}function se(e,n,t){let o=n.trim(),r=e.filter(a=>{let l=_(a.symbol),m=w(a.symbol),p=(a.display_name??"").trim();return a.symbol===o||l===o||l===t||m===o||m===t||`${m}()`===o||p===o||p===t||`${p}()`===o||C(a,t)>1||a.relative_path===o});if(r.length===0)return[];let s=t.replace(/\(\)$/u,""),i=r.filter(a=>w(a.symbol)===s);if(i.length>0){i.sort((l,m)=>F(l,m,t));let a=i.filter(l=>A(l.symbol));return a.length>0?a:i}return r.sort((a,l)=>F(a,l,t)),r}function F(e,n,t){return C(n,t)-C(e,t)||e.end_line-e.start_line-(n.end_line-n.start_line)||e.relative_path.localeCompare(n.relative_path)||e.symbol.localeCompare(n.symbol)}function C(e,n){let t=E(n);if(!t)return 0;let o=e.relative_path.toLowerCase(),r=w(e.symbol).toLowerCase(),s=t.path.toLowerCase(),i=t.leaf.toLowerCase();return o.includes(s)?r!==i?1:k(e.symbol)?N(e.symbol)===null?5:4:N(e.symbol)===null?3:2:0}function ge(e,n,t=5){let o=K(n);if(!o)return[];let r=f(e,{where:"1 = 1",orderBy:"d.relative_path, der.start_line",limit:5e3}),s=new Map;for(let i of r){if(e.isIgnored(i.relative_path))continue;let a=_(i.symbol),l=w(i.symbol),m=i.display_name??l,p=[a,l,m].filter(g=>g.trim().length>0),u=Math.min(...p.map(g=>ie(K(g),o))),y=s.get(a);(!y||u<y.distance)&&s.set(a,{shortName:a,distance:u})}return[...s.values()].sort((i,a)=>i.distance-a.distance||i.shortName.localeCompare(a.shortName)).slice(0,t).map(i=>i.shortName)}function K(e){return M(e).toLowerCase().replace(/[^a-z0-9_]+/g,"")}function ie(e,n){if(e===n)return 0;if(e.length===0)return n.length;if(n.length===0)return e.length;let t=Array.from({length:n.length+1},(o,r)=>r);for(let o=0;o<e.length;o++){let r=[o+1];for(let s=0;s<n.length;s++){let i=e[o]===n[s]?0:1;r[s+1]=Math.min(r[s]+1,t[s+1]+1,t[s]+i)}t=r}return t[n.length]}export{he as a,G as b,be as c,Se as d,ge as e};
3
- //# sourceMappingURL=chunk-UZGZB3VB.js.map
3
+ //# sourceMappingURL=chunk-3XFJUWJE.js.map
@@ -1,2 +1,2 @@
1
- import{C as s}from"./chunk-ADTBPVUZ.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
2
- //# sourceMappingURL=chunk-OVTS4DKB.js.map
1
+ import{C as s}from"./chunk-RVYLJDXC.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
2
+ //# sourceMappingURL=chunk-4AOOSCZ7.js.map
@@ -1,4 +1,4 @@
1
- import{a as $}from"./chunk-JOIRNPPY.js";import{f as C}from"./chunk-J77SU6VA.js";import{a as F,c as _}from"./chunk-UZGZB3VB.js";import{A as x,d as E,f as A,t as M}from"./chunk-FETNQCFO.js";import{z as R}from"./chunk-ADTBPVUZ.js";function q(t,o,n={}){return P(t,o,n).rows}function G(t,o,n={}){return P(t,o,n)}function P(t,o,n){let{maxDepth:r=5,scope:c}=n,a=r===Number.MAX_SAFE_INTEGER,l=a?null:500,y=F(t,o);if(!y)return{rows:[],coverage:{status:"incomplete",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:r,reachedDepth:0,perSymbolEvidenceLimit:l,remainingFrontierSymbols:0,reasons:["The requested symbol could not be resolved."],semanticEvidence:"incomplete"}};let m=[],u=new Set([y.symbolId]),s=new Set,e=[y],d=0,p=!1,h=!1,g=!1;for(let b=1;b<=r&&e.length!==0;b++){d=b;let v=[],S=C(t,e,{...a?{}:{limit:l+1},semanticEvidence:$});S.incompleteSymbolIds.size>0&&(h=!0),S.unavailableSymbolIds.size>0&&(g=!0);for(let w of e){let I=S.rows.get(w.symbolId)??[];l!==null&&I.length>l&&(p=!0);let L=l===null?I:I.slice(0,l);for(let i of T(t,w,c,L)){let N=`${i.file}|${i.shortName}`;if(i.symbolId!==null){if(u.has(i.symbolId))continue;u.add(i.symbolId)}else if(s.has(N))continue;s.add(N),m.push({symbol:i.symbol,shortName:i.shortName,file:i.file,depth:b}),i.symbolId!==null&&i.symbolMatch&&v.push(i.symbolMatch)}}e=v}m.sort((b,v)=>b.depth-v.depth||b.file.localeCompare(v.file));let D=e.length>0,f=[];return D&&f.push(`${e.length} symbol(s) remain eligible beyond depth ${r}.`),p&&f.push(`At least one symbol had more than ${l} incoming evidence row(s).`),h&&f.push("Compiler-resolved incoming evidence was incomplete for at least one traversed symbol."),g&&f.push("Compiler-resolved incoming evidence was unavailable for at least one traversed symbol."),f.length===0&&f.push("The discovered reverse evidence frontier was exhausted."),{rows:m,coverage:{status:h||g?"incomplete":D||p?"bounded":"accounted",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:r,reachedDepth:d,perSymbolEvidenceLimit:l,remainingFrontierSymbols:e.length,reasons:f,semanticEvidence:h&&g?"incomplete-and-unavailable":h?"incomplete":g?"unavailable":"complete"}}}function T(t,o,n,r){let c=r.filter(s=>!t.isIgnored(s.file)).filter(s=>!n||s.file.includes(n)),a=new Set(c.map(s=>s.file)),l=[];for(let s of k(t,o,n)){if(a.has(s))continue;let e=M(t,s),d=e.length>0?x(e,e[0].startLine):null;l.push({symbol:d?.symbol??s,file:s})}let y=[...c,...l],m=[],u=new Set;for(let s of y){let e=_(t,s.symbol);if(!e){let p=`${s.file}|${s.symbol}`;if(u.has(p))continue;u.add(p),m.push({symbolId:null,symbol:s.symbol,shortName:E(s.symbol),file:s.file,symbolMatch:null});continue}if(e.symbolId===o.symbolId||t.isIgnored(e.relativePath)||!B(e))continue;let d=`${e.symbolId}|${e.relativePath}`;u.has(d)||(u.add(d),m.push({symbolId:e.symbolId,symbol:e.symbol,shortName:E(e.symbol),file:e.relativePath,symbolMatch:e}))}return m}function k(t,o,n){let r=n?"AND consumer_d.relative_path LIKE ?":"",c=[o.symbolId,o.documentId];return n&&c.push(`%${n}%`),new Set(t.all(`SELECT DISTINCT consumer_d.relative_path
1
+ import{a as $}from"./chunk-OJFLPVBP.js";import{f as C}from"./chunk-57KEZDPT.js";import{a as F,c as _}from"./chunk-3XFJUWJE.js";import{A as x,d as E,f as A,t as M}from"./chunk-AM5SUGHF.js";import{z as R}from"./chunk-RVYLJDXC.js";function q(t,o,n={}){return P(t,o,n).rows}function G(t,o,n={}){return P(t,o,n)}function P(t,o,n){let{maxDepth:r=5,scope:c}=n,a=r===Number.MAX_SAFE_INTEGER,l=a?null:500,y=F(t,o);if(!y)return{rows:[],coverage:{status:"incomplete",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:r,reachedDepth:0,perSymbolEvidenceLimit:l,remainingFrontierSymbols:0,reasons:["The requested symbol could not be resolved."],semanticEvidence:"incomplete"}};let m=[],u=new Set([y.symbolId]),s=new Set,e=[y],d=0,p=!1,h=!1,g=!1;for(let b=1;b<=r&&e.length!==0;b++){d=b;let v=[],S=C(t,e,{...a?{}:{limit:l+1},semanticEvidence:$});S.incompleteSymbolIds.size>0&&(h=!0),S.unavailableSymbolIds.size>0&&(g=!0);for(let w of e){let I=S.rows.get(w.symbolId)??[];l!==null&&I.length>l&&(p=!0);let L=l===null?I:I.slice(0,l);for(let i of T(t,w,c,L)){let N=`${i.file}|${i.shortName}`;if(i.symbolId!==null){if(u.has(i.symbolId))continue;u.add(i.symbolId)}else if(s.has(N))continue;s.add(N),m.push({symbol:i.symbol,shortName:i.shortName,file:i.file,depth:b}),i.symbolId!==null&&i.symbolMatch&&v.push(i.symbolMatch)}}e=v}m.sort((b,v)=>b.depth-v.depth||b.file.localeCompare(v.file));let D=e.length>0,f=[];return D&&f.push(`${e.length} symbol(s) remain eligible beyond depth ${r}.`),p&&f.push(`At least one symbol had more than ${l} incoming evidence row(s).`),h&&f.push("Compiler-resolved incoming evidence was incomplete for at least one traversed symbol."),g&&f.push("Compiler-resolved incoming evidence was unavailable for at least one traversed symbol."),f.length===0&&f.push("The discovered reverse evidence frontier was exhausted."),{rows:m,coverage:{status:h||g?"incomplete":D||p?"bounded":"accounted",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:r,reachedDepth:d,perSymbolEvidenceLimit:l,remainingFrontierSymbols:e.length,reasons:f,semanticEvidence:h&&g?"incomplete-and-unavailable":h?"incomplete":g?"unavailable":"complete"}}}function T(t,o,n,r){let c=r.filter(s=>!t.isIgnored(s.file)).filter(s=>!n||s.file.includes(n)),a=new Set(c.map(s=>s.file)),l=[];for(let s of k(t,o,n)){if(a.has(s))continue;let e=M(t,s),d=e.length>0?x(e,e[0].startLine):null;l.push({symbol:d?.symbol??s,file:s})}let y=[...c,...l],m=[],u=new Set;for(let s of y){let e=_(t,s.symbol);if(!e){let p=`${s.file}|${s.symbol}`;if(u.has(p))continue;u.add(p),m.push({symbolId:null,symbol:s.symbol,shortName:E(s.symbol),file:s.file,symbolMatch:null});continue}if(e.symbolId===o.symbolId||t.isIgnored(e.relativePath)||!B(e))continue;let d=`${e.symbolId}|${e.relativePath}`;u.has(d)||(u.add(d),m.push({symbolId:e.symbolId,symbol:e.symbol,shortName:E(e.symbol),file:e.relativePath,symbolMatch:e}))}return m}function k(t,o,n){let r=n?"AND consumer_d.relative_path LIKE ?":"",c=[o.symbolId,o.documentId];return n&&c.push(`%${n}%`),new Set(t.all(`SELECT DISTINCT consumer_d.relative_path
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents consumer_d ON consumer_d.id = c.document_id
@@ -7,4 +7,4 @@ import{a as $}from"./chunk-JOIRNPPY.js";import{f as C}from"./chunk-J77SU6VA.js";
7
7
  AND c.document_id != ?
8
8
  ${t.pathExclusionsFor("consumer_d")}
9
9
  ${r}`,...c).map(a=>a.relative_path).filter(a=>!t.isIgnored(a)))}function B(t){if(t.symbol.startsWith("scip-clojure ")||R(t.relativePath)==="clojure")return!0;let o=A(t.symbol);return o==="method"||o==="type"||t.symbol.endsWith("().")}export{q as a,G as b};
10
- //# sourceMappingURL=chunk-LU3BMVH2.js.map
10
+ //# sourceMappingURL=chunk-4IFISPQW.js.map
@@ -0,0 +1,11 @@
1
+ import{c as p}from"./chunk-2VKB5CMA.js";import{basename as D}from"path";function h(){let t=new WeakMap;return{cache:t,ensure(r){let a=t.get(r);return a||(a=new Map,t.set(r,a)),a}}}function g(t,r){let{cache:a,ensure:o}=h(),i={get(e,c,s){let n=o(e);if(n.has(c))return n.get(c);let l=s();return n.set(c,l),l},invalidate(e,c){a.get(e)?.delete(c)},invalidateAll(e){a.delete(e)},size(e){return a.get(e)?.size??0}};return p({name:t,groups:r.clearGroups,clearAll:e=>i.invalidateAll(e),clearFile:(e,c)=>i.invalidate(e,c)}),i}function S(t,r){let a=new WeakMap,o={get(i,e){let c=a.get(i);if(c)return c.value;let s=e();return a.set(i,{value:s}),s},invalidate(i){a.delete(i)},has(i){return a.has(i)}};return p({name:t,groups:r.clearGroups,clearAll:i=>o.invalidate(i)}),o}var m={clearGroups:["whole-project","source-file"]};function E(t){return v(t,m)}function v(t,r){let{cache:a,ensure:o}=h(),i={get(e,c,s,n){let l=o(e),u=l.get(c);if(u&&u.source===s)return u.value;let d=n();return l.set(c,{source:s,value:d}),d},invalidate(e,c){a.get(e)?.delete(c)},invalidateAll(e){a.delete(e)}};return p({name:t,groups:r.clearGroups,clearAll:e=>i.invalidateAll(e),clearFile:(e,c)=>i.invalidate(e,c)}),i}var C=g("indexed-document-paths",{clearGroups:["whole-project"]});function x(t,r={}){let a=V(r);return[...C.get(t,a,()=>{let i=r.scope?"AND relative_path LIKE ?":"",e=r.like?"AND relative_path LIKE ?":"",c=[...r.scope?[`%${r.scope}%`]:[],...r.like?[r.like]:[]],s=t.all(`SELECT relative_path
2
+ FROM documents
3
+ WHERE 1 = 1
4
+ ${t.pathExclusionsFor("documents")}
5
+ ${i}
6
+ ${e}
7
+ ORDER BY relative_path`,...c).map(l=>l.relative_path),n=r.extensions?s.filter(l=>r.extensions.some(u=>l.toLowerCase().endsWith(u.toLowerCase()))):s;return r.includeIgnored===!1?n.filter(l=>!t.isIgnored(l)):n})]}function V(t){let r=t.extensions?[...new Set(t.extensions.map(a=>a.toLowerCase()))].sort():null;return JSON.stringify({scope:t.scope??null,like:t.like??null,extensions:r,includeIgnored:t.includeIgnored!==!1})}function K(t,r,a){let o=f(r);if(!o)return[];let i=t.all(`SELECT relative_path
8
+ FROM documents
9
+ WHERE relative_path = ?
10
+ ${t.pathExclusionsFor("documents")}`,o).filter(n=>!t.isIgnored(n.relative_path)).map(n=>({relativePath:n.relative_path,score:b(n.relative_path,o)}));if(i.length>0)return i;let e=x(t,{includeIgnored:!1}).map(n=>({relativePath:n,score:b(n,o)})).filter(n=>n.score>0).sort((n,l)=>l.score-n.score||n.relativePath.localeCompare(l.relativePath)),c=e.filter(n=>n.score>=1100);if(c.length>0)return a.allowMultiple?c:[c[0]];let s=e.filter(n=>n.score>=800);return s.length>0?a.allowMultiple?s:[s[0]]:a.allowMultiple?e:e.slice(0,1)}function b(t,r){let a=f(t),o=D(a),i=D(r),e=0;return a===r&&(e+=1200),a.endsWith(`/${r}`)&&(e+=1100),o===i&&(e+=900),a.startsWith(`${r}/`)&&(e+=850),a.includes(r)&&(e+=250),e}function f(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{g as a,S as b,E as c,v as d,x as e,K as f,f as g};
11
+ //# sourceMappingURL=chunk-4NHWNAWQ.js.map
@@ -0,0 +1,5 @@
1
+ import{closeSync as te,fstatSync as N,openSync as re,readFileSync as yt,readSync as ke}from"fs";import{createHash as St}from"crypto";var Fe=8*1024*1024,Ee=64*1024*1024,xt=512*1024*1024,bt=256*1024*1024,j=class extends Error{constructor(r,n,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function ve(e,t){ie(t.maxBytes);let r=String(e),n=re(e,"r");try{let i=N(n);De(i,t,r);let o=yt(n),s=N(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new j(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{te(n)}}function I(e,t,r="utf8"){return ve(e,t).toString(r)}function D(e,t){return I(e,{maxBytes:Fe,inputKind:t})}function Pt(e,t){return I(e,{maxBytes:Ee,inputKind:t})}function ne(e,t){ie(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=ke(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new j(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function jt(e,t,r="utf8"){return ne(e,t).toString(r)}function Ie(e,t){let r=re(e,"r");try{return ne(r,t)}finally{te(r)}}function wt(e,t,r="utf8"){return Ie(e,t).toString(r)}function z(e,t,r){ie(t.maxBytes);let n=String(e),i=re(e,"r");try{let o=N(i);De(o,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=ke(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;r(s.subarray(0,u)),a+=u}let c=N(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new j(t.inputKind,n,"changed-during-read",c.size,t.maxBytes);return a}finally{te(i)}}function Ct(e,t){let r=St("sha256");return z(e,t,n=>r.update(n)),r.digest("hex")}function De(e,t,r){if(!e.isFile())throw new j(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new j(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function ie(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function oe(e,t,r=[]){let n=se(e);if(Be.has(n)||r.some(o=>M(n,o))||t.some(o=>Le(n,o)))return"config";if(t.some(ze)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let i=Ne(n);return t.some(o=>(Me[o]??[]).includes(i))?"source":"other"}function _e(e,t,r){let n=se(e);if(Be.has(n)||r?.some(o=>M(n,o))||Le(n,t)||ze(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let i=Ne(n);return(Me[t]??[]).includes(i)}function wn(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!Re(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!Re(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(kt)?null:t}function Cn(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),i=new Set([...r.keys(),...n.keys()]),o=[];for(let a of[...i].sort()){let c=r.get(a),u=n.get(a),l=oe(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:l,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:l,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:l,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(Oe(e?.files??[])||Oe(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Ft)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Et(e,t):!0,uncertainty:[...s].sort()}}function Re(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Oe(e){return new Set(e.map(t=>t.path)).size!==e.length}function kt(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function Ft(e){return e.hash==="unreadable"||e.size<0}function Et(e,t){return Ae(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&Ae(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Ae(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((i,o)=>i===n[o])}var Be=new Set([".codebaseiq.json"]),vt={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},It={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},Te=new Map;function Le(e,t){return vt[t].some(r=>M(e,r))||It[t].some(r=>M(e,r))}function M(e,t){let r=se(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,i=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return i===r;let o=Te.get(r);if(!o){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Te.set(r,o)}return o.test(i)}function se(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ne(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function ze(e){return e==="typescript"||e==="javascript"}var Me={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{createRequire as Dt}from"module";var Rt=Dt(import.meta.url),Ge=Ot().version;function Ot(){for(let e of["../package.json","../../package.json"])try{return Rt(e)}catch{}return{version:"0.0.0"}}import{createHash as Xe,randomUUID as zt}from"crypto";import{chmodSync as Ye,existsSync as k,linkSync as Mt,lstatSync as H,readdirSync as le,realpathSync as x,unlinkSync as Gt,writeSync as Wt}from"fs";import{homedir as $t}from"os";import{basename as Ht,dirname as U,isAbsolute as qe,join as y,resolve as J}from"path";import{closeSync as At,existsSync as Tt,fsyncSync as _t,mkdirSync as Bt,openSync as Lt}from"fs";import{dirname as $e}from"path";function We(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function ae(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var R=Object.freeze({platform:process.platform,pathExists:e=>Tt(e),makeDirectory:e=>Bt(e,{recursive:!0}),openFile:(e,t,r)=>Lt(e,t,r),syncFile:e=>_t(e),closeFile:e=>At(e)});function He(e,t=R){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=$e(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=W(i,G($e(o),t));return i}function G(e,t=R){let r;try{r=t.openFile(e,"r")}catch(n){if(ae(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(ae(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function W(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{isAbsolute as Je,relative as Nt}from"path";var m=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function ce(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Tn(e){return e.replace(/\\/g,"/")}function _n(e,t){return ce(e)===ce(t)}function Ue(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let i=/^\/([A-Za-z]):(\/|$)/.exec(n);i&&(n=`/${i[1].toUpperCase()}:${n.slice(3)}`);let o=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${o}`}function Bn(e,t){return Ue(e)===Ue(t)}function S(e,t){let r=Nt(e,t);return r===""||!r.startsWith("..")&&!Je(r)}function C(e){if(!e)throw new m(e,"empty-path");if(e.includes("\0"))throw new m(e,"nul-byte");if(Je(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new m(e,"absolute-path");let t=ce(e);if(t.split("/").some(n=>n===".."))throw new m(e,"parent-traversal");if(!t||t===".")throw new m(e,"empty-path");return t}var Ve=1,A=".codebaseiq-cache-owner.json",Ut=16*1024,Qe=Object.freeze({...R,randomToken:()=>zt(),linkFile:(e,t)=>Mt(e,t),removeFile:e=>Gt(e),writeFile:(e,t,r,n)=>Wt(e,t,r,n)});function $(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function b(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Jt(e,t){let r=x(e);return Kt(r,de(r,t))}function de(e,t){let r=x(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?J(n):t?.dbPath?Yt(r,t.dbPath):qt(r)}function Ze(){let e=process.env.XDG_CACHE_HOME;return y(e||y($t(),".cache"),"codebaseiq")}function qt(e){let t=J(e);try{t=x(t)}catch{}let r=Xe("sha256").update(t).digest("hex").slice(0,12);return y(Ze(),"projects",r)}function qn(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(Ze(),"repositories",e);return rt(t),x(t)}function Kn(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Xn(e,t){let r=Jt(e,t);return{cacheDir:r,dbPath:y(r,"index.db"),indexPath:y(r,"index.scip"),metaPath:y(r,"meta.json")}}function Kt(e,t,r=Qe){return Xt(e,t,r).cacheDir}function Xt(e,t,r=Qe){let n=x(e),i=k(t)?"synced":rt(t,r),o=x(t),s=y(o,A);if(k(s))return ue(n,o),pe(s),O(o),{kind:"existing",cacheDir:o};Ke(o),tr(o),Ke(o);let c=`${JSON.stringify({schemaVersion:Ve,canonicalProjectRoot:n,canonicalCacheDir:o,creatorVersion:Ge},null,2)}
2
+ `;try{let u=rr(s,c,r),l=W(i,u);return{kind:"published",cacheDir:o,achievedDurability:l==="synced"?"directory-durable":"file-flushed",directorySync:l}}catch(u){if(ir(u))return ue(n,o),{kind:"existing",cacheDir:o};throw u}}function ue(e,t){let r=x(e),n=x(t);return Qt(n,r,n)}function Yn(e,t){return k(y(t,A))?(ue(e,t),et(t),!0):!1}function Yt(e,t){let r;try{r=C(t)}catch(s){throw s instanceof m?$(t,s.reason):s}let n=J(e,...r.split("/"));if(n===e||!S(e,n))throw $(t,"outside-project");let i=Vt(n),o=x(i);if(!S(e,o)&&o!==e)throw $(t,"symlink-escape");return n}function Vt(e){let t=e;for(;!k(t);){let r=U(t);if(r===t)throw $(e,"no-existing-ancestor");t=r}return t}function Qt(e,t,r){let n=y(e,A);if(!k(n)||H(n).isSymbolicLink())throw b(e,"missing regular ownership record");let i=H(n);if(!i.isFile()||i.size>Ut)throw b(e,"invalid ownership record file");let o=D(n,"cache ownership record"),s=Zt(o,e);if(s.canonicalProjectRoot!==t)throw b(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==r)throw b(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Xe("sha256").update(o).digest("hex"),physicalCacheDir:e}}function Zt(e,t){try{let r=JSON.parse(e);if(r.schemaVersion!==Ve||typeof r.canonicalProjectRoot!="string"||typeof r.canonicalCacheDir!="string"||typeof r.creatorVersion!="string"||!qe(r.canonicalProjectRoot)||!qe(r.canonicalCacheDir))throw new Error("invalid fields");return r}catch(r){throw b(t,`malformed ownership record: ${r instanceof Error?r.message:String(r)}`)}}function Ke(e){let t=le(e).filter(r=>r!==A&&!er(r));if(t.length>0)throw b(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function er(e){return e.startsWith(`${A}.tmp-`)||[".codebaseiq-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function tr(e){for(let t of le(e)){let r=y(e,t);try{let n=H(r);if(n.isSymbolicLink())throw b(e,`legacy cache entry ${t} is a symlink`);if(n.isDirectory())O(r);else if(n.isFile())pe(r);else throw b(e,`legacy cache entry ${t} is not a file or directory`)}catch(n){if(tt(n))continue;throw n}}O(e)}function et(e,t=!1){try{let r=H(e);if(r.isSymbolicLink())throw b(e,"managed cache tree contains a symlink");if(r.isFile()){pe(e);return}if(!r.isDirectory())throw b(e,"managed cache tree contains a special file");O(e);for(let n of le(e))et(y(e,n),!0)}catch(r){if(t&&tt(r))return;throw r}}function tt(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function rt(e,t=R){let r=He(e,t);return O(e),r}function rr(e,t,r){let n=`${e}.tmp-${process.pid}-${r.randomToken()}`,i,o=!1;try{i=r.openFile(n,"wx",384),o=!0,We(i,Buffer.from(t),r,"cache ownership record"),r.syncFile(i),r.closeFile(i),i=void 0,r.linkFile(n,e);let s=G(U(e),r);return r.removeFile(n),o=!1,W(s,G(U(e),r))}finally{if(i!==void 0)try{r.closeFile(i)}catch{}if(o)try{r.removeFile(n)}catch{}}}function O(e){process.platform!=="win32"&&Ye(e,448)}function pe(e){process.platform!=="win32"&&Ye(e,384)}function nr(e){if(k(e))return x(e);let t=[],r=e;for(;;){let n=U(r);if(n===r)return e;if(t.unshift(Ht(r)),k(n))return y(x(n),...t);r=n}}function Vn(e){return nr(J(e))}function ir(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as or}from"child_process";import{createHash as sr}from"crypto";import{existsSync as ar,lstatSync as cr,realpathSync as ur}from"fs";import{dirname as lr,isAbsolute as dr,join as pr,resolve as K}from"path";function he(){return{...process.env,GIT_OPTIONAL_LOCKS:"0",LC_ALL:"C"}}var T={run(e,t){let r=nt(e,t);return r.kind==="success"?r.output:void 0},runResult:nt},fr=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],fe=/^[0-9a-f]{40,64}$/;function ni(e,t,r=T){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let n=r.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(n.kind!=="success"||!fe.test(n.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return n.output}function ii(e,t=T){let r=t.runResult(e,fr);if(r.kind==="success"){let n=gr(r.output);if(n)return hr(n,t)}return mr(e,t)}function gr(e){let t=e.split(`
3
+ `).map(c=>c.trim());if(t.length!==5)return;let[r,n,i,o,s]=t;if(!r||!n||!i||!o||!s||!fe.test(o)||!fe.test(s))return;let a=P(r);return{root:a,gitDir:P(q(a,n)),commonDir:P(q(a,i)),headCommit:o,treeOid:s}}function hr(e,t){let r=t.run(e.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...it(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:me("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.length===0}}function mr(e,t){let r=yr(e,t);if(r.kind!=="worktree")return;let n=r.identity,i=n.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=P(q(i,o)),a=ge(t.run(i,["rev-parse","--verify","HEAD"])),c=ge(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,["status","--porcelain=v1","-z","--untracked-files=all"]);if(u!==void 0)return{...n,commonDir:s,repositoryId:me("repository",s),headCommit:a,treeOid:c,clean:u.length===0}}function yr(e,t=T){let r=t.runResult(e,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let n=r.output.trim();if(!n)return{kind:"error",message:"Git returned an empty worktree root."};let i=P(n),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=P(q(i,o));return{kind:"worktree",identity:it(i,s)}}function it(e,t){return{projectRoot:e,gitDir:t,worktreeId:me("worktree",`${e}\0${t}`)}}function oi(e,t=T){let r=t.run(e,["worktree","list","--porcelain","-z"]);return r===void 0?[]:Sr(r)}function Sr(e){let t=[],r;for(let n of e.split("\0")){if(n===""){r&&t.push(r),r=void 0;continue}let i=n.indexOf(" "),o=i<0?n:n.slice(0,i),s=i<0?"":n.slice(i+1);if(o==="worktree"){r&&t.push(r),r={path:P(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}r&&(o==="HEAD"?r.head=s:o==="branch"?r.branch=s:o==="detached"?r.detached=!0:o==="bare"?r.bare=!0:o==="prunable"?r.prunable=!0:o==="locked"&&(r.locked=!0))}return r&&t.push(r),t}function si(e,t,r=T){return ge(r.run(e,t))}function q(e,t){return dr(t)?t:K(e,t)}function P(e){try{return ur(e)}catch{return K(e)}}function me(e,t){return sr("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function ge(e){return e?.trim()||void 0}function nt(e,t){let r=or("git",["-C",e,...t],{encoding:"utf-8",env:he(),maxBuffer:52428800,stdio:["ignore","pipe","pipe"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let i=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,o=r.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&ar(K(e)))&&!xr(e)?{kind:"not-repository"}:{kind:"error",message:i}}function xr(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=K(e);for(;;){try{return cr(pr(t,".git")),!0}catch(n){let i=n.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let r=lr(t);if(r===t)return!1;t=r}}import{execFileSync as Xr}from"child_process";import{createHash as ft}from"crypto";import{closeSync as Yr,fstatSync as gt,lstatSync as be,openSync as Vr,readdirSync as Qr,readFileSync as Zr,readlinkSync as en,realpathSync as V}from"fs";import{isAbsolute as tn,join as Pe,relative as rn,resolve as nn,sep as on}from"path";import{execFileSync as ye}from"child_process";import{createHash as br}from"crypto";import{mkdirSync as Pr,renameSync as jr,writeFileSync as wr}from"fs";import{basename as Cr,dirname as kr,join as Fr}from"path";var Er="git-content-hashes.json",vr=32*1024*1024,Ir=2e5,X=3e4;function Se(){return{env:he(),encoding:"utf8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:X,killSignal:"SIGKILL"}}function ot(e){let t,r;try{t=ye("git",["-C",e,"ls-files","-s","-z","--","."],{...Se(),timeout:X}),r=ye("git",["-C",e,"status","--porcelain=v1","-z","--untracked-files=all","--no-renames","--","."],{...Se(),timeout:X})}catch{return null}let n=new Map,i=[];for(let l of t.split("\0")){if(!l)continue;let f=l.indexOf(" "),p=f>0?l.slice(0,f).split(" "):[];if(p.length!==3)continue;let[h,g,L]=p,w=l.slice(f+1);if(h!=="100644"&&h!=="100755"||L!=="0"){n.delete(w);continue}n.set(w,g),Cr(w)===".gitattributes"&&i.push(`${w}:${g}`)}let o=new Set;for(let l of r.split("\0"))l.length>=4&&l[2]===" "&&o.add(l.slice(3));let s=Dr(e,i),a=Fr(de(e),Er),c=Rr(a,s),u=new Map;return{lookup(l){if(o.has(l))return;let f=n.get(l);if(f)return u.get(f)??c.entries[f]},seed(l,f){if(o.has(l))return;let p=n.get(l);!p||c.entries[p]||u.has(p)||u.set(p,f)},persist(){if(u.size===0)return;let l=new Set(n.values()),f={};for(let[p,h]of Object.entries(c.entries))l.has(p)&&(f[p]=h);for(let[p,h]of u)f[p]=h;if(!(Object.keys(f).length>Ir))try{Pr(kr(a),{recursive:!0});let p=`${a}.${process.pid}.tmp`;wr(p,JSON.stringify({version:1,salt:s,entries:f})),jr(p,a)}catch{}}}}function Dr(e,t){let r="";try{r=ye("git",["-C",e,"config","--get-regexp","^core\\.(autocrlf|eol|safecrlf)$"],{...Se(),timeout:X})}catch{}return br("sha256").update(JSON.stringify([r.trim(),t.sort()])).digest("hex")}function Rr(e,t){let r={version:1,salt:t,entries:{}};try{let n=I(e,{maxBytes:vr,inputKind:"git-content-hash-store"}),i=JSON.parse(n);if(i.version!==1||i.salt!==t||!i.entries||typeof i.entries!="object")return r;let o={};for(let[s,a]of Object.entries(i.entries))/^[0-9a-f]{40,64}$/.test(s)&&a&&typeof a.size=="number"&&Number.isInteger(a.size)&&a.size>=0&&typeof a.hash=="string"&&/^[0-9a-f]{64}$/.test(a.hash)&&(o[s]={size:a.size,hash:a.hash});return{version:1,salt:t,entries:o}}catch{return r}}import{AsyncLocalStorage as Or}from"async_hooks";var Ar=new Or;function E(e,t){let r=Y(e);if(!r||r.missing.has(t))return;let n=r.files.get(t);if(n)return n;let i=r.readBaseFile?.(t);return i&&r.files.set(t,i),i}function v(e,t){let r=Y(e);if(r)return r.missing.has(t)?"missing":r.paths.includes(t)?"present":"missing"}function st(e,t){return Y(e)?.fingerprints.get(t)}function F(e){return Y(e)?.paths}function Y(e){let t=Ar.getStore();if(t)return t.projectRoot===P(e)?t:void 0}import{createRequire as Tr}from"module";import{existsSync as _r,readdirSync as Br,statSync as Lr}from"fs";import d from"path";var Nr=Tr(import.meta.url),at=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function zr(e,t=[]){let r=d.resolve(e),n=t.flatMap(c=>Gr(r,c));if(n.length>0)return ct(r,lt(n));let i=Mr(r),o=lt(i),s=Wr(r,o)?[r,...o]:o,a=s.length>0?s:[r];return ct(r,a)}function dt(e,t,r=[]){let n;try{n=Nr("ts-morph")}catch{return null}let i=d.resolve(e),o=t==="workspace"?zr(i,r):["."],s=new Set;for(let a of o){let c=a==="."?i:d.join(i,a),u=d.join(c,"tsconfig.json"),l=Jr(n.ts,i);if(!l.fileExists(u))return null;let f=n.ts.readConfigFile(u,l.readFile);if(f.error)return null;let p=n.ts.parseJsonConfigFileContent(f.config,l,c);if(p.errors.length>0)return null;for(let h of p.fileNames){let g=d.resolve(h);S(i,g)&&s.add(d.relative(i,g).split(d.sep).join("/"))}}return s}function ct(e,t){return[...new Set(t.map(r=>_(e,r)))].sort((r,n)=>r.localeCompare(n))}function Mr(e){let t=F(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>at.has(s)))return[];let o=d.join(e,...i.split("/"));return ut(e,o)?[d.dirname(o)]:[]});let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=Br(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=d.join(i,s.name);if(s.isDirectory()){!at.has(s.name)&&!s.name.startsWith(".")&&n.push(a);continue}s.isFile()&&ut(e,a)&&r.push(d.dirname(a))}}return r}function Gr(e,t){let r=t.trim();if(!r)return[];let n=d.resolve(e,r);if(!S(e,n))return[];let i=F(e);if(i){let o=_(e,n);if(i.includes(o)&&xe(d.basename(n)))return[d.dirname(n)];let s=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(s))?[n]:[]}try{let o=Lr(n);if(o.isDirectory())return[n];if(o.isFile()&&xe(d.basename(n)))return[d.dirname(n)]}catch{return[]}return[]}function ut(e,t){if(!xe(d.basename(t)))return!1;let r=pt(e,t);return r?d.basename(t)==="tsconfig.json"||"include"in r||"files"in r||"references"in r:!1}function xe(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function lt(e){let t=[...new Set(e.map(r=>d.resolve(r)))].sort((r,n)=>r.localeCompare(n));return t.length<=1?t:t.filter(r=>!t.some(n=>n!==r&&Kr(r,n)))}function Wr(e,t){if(t.length===0||t.some(n=>d.resolve(n)===e))return!1;let r=d.join(e,"tsconfig.json");return Hr(e,r)&&$r(e,r)}function $r(e,t){let n=pt(e,t)?.include;return Array.isArray(n)?n.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!d.extname(i))):!1}function pt(e,t){try{let r=JSON.parse(Ur(e,t));return r&&typeof r=="object"&&!Array.isArray(r)?r:null}catch{return null}}function Hr(e,t){let r=_(e,t),n=v(e,r);return n?n==="present":_r(t)}function Ur(e,t){let r=_(e,t);if(F(e)){let i=E(e,r);if(!i)throw Object.assign(new Error(`Snapshot file ${r} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return D(t,"TypeScript project config")}function Jr(e,t){let r=F(t);if(!r)return e.sys;let n=d.resolve(t),i=new Set(r),o=qr(n,r),s=e,a=c=>{let u=d.resolve(c);return S(n,u)?_(n,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(c){let u=a(c);return u===null?e.sys.fileExists(c):i.has(u)},readFile(c){let u=a(c);return u===null?e.sys.readFile(c):E(n,u)?.content.toString("utf8")},readDirectory(c,u,l,f,p){let h=d.resolve(c);return S(n,h)?s.matchFiles(h,u,l,f,e.sys.useCaseSensitiveFileNames,n,p,g=>o.get(d.resolve(g))??{files:[],directories:[]},g=>g):e.sys.readDirectory(c,u,l,f,p)}}}function qr(e,t){let r=new Map,n=new Map,i=o=>{r.has(o)||r.set(o,new Set),n.has(o)||n.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),a=e;for(let c=0;c<s.length-1;c+=1){let u=s[c];i(a),n.get(a).add(u),a=d.join(a,u),i(a)}r.get(a).add(s.at(-1))}return new Map([...r].map(([o,s])=>[o,{files:[...s].sort(),directories:[...n.get(o)??[]].sort()}]))}function _(e,t){let r=d.relative(e,t);return r?r.split(d.sep).join("/"):"."}function Kr(e,t){let r=d.relative(e,t);return!!r&&!r.startsWith("..")&&!d.isAbsolute(r)}var Q=64*1024*1024,B=class extends Error{constructor(r,n,i,o){super(`${r} ${JSON.stringify(n)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=r;this.inputPath=n;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="CODEBASEIQ_INPUT_TOO_LARGE"};function sn(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function ht(e,t,r={}){let n=C(t),i=V(e),o=nn(i,...n.split("/"));if(!S(i,o)||o===i)throw new m(t,"outside-project");let s=V(o);if(!S(i,s)||s===i)throw new m(t,"outside-project");let a=be(s);if(!a.isFile())throw new m(t,"not-a-file");let c={projectRoot:i,relativePath:n,absolutePath:s,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},u=r.maxBytes??Q;if(mt(u),c.size>u)throw new B(r.inputKind??"project file",c.relativePath,c.size,u);return c}function an(e,t,r={}){let n=C(t),i=v(e,n);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(n)} does not exist.`),{code:"ENOENT"});let c=E(e,n);if(!c)throw new m(n,"changed-during-read");let u=r.maxBytes??Q;if(mt(u),c.size>u)throw new B(r.inputKind??"project file",n,c.size,u);return Buffer.from(c.content)}let o=ht(e,t,r),s=r.maxBytes??Q,a=Vr(o.absolutePath,"r");try{let c=gt(a);if(!c.isFile()||c.dev!==o.device||c.ino!==o.inode||c.size!==o.size)throw new m(t,"changed-during-read");if(c.size>s)throw new B(r.inputKind??"project file",o.relativePath,c.size,s);let u=Zr(a),l=gt(a);if(l.dev!==c.dev||l.ino!==c.ino||l.size!==c.size||u.byteLength!==c.size)throw new m(t,"changed-during-read");return u}finally{Yr(a)}}function Bi(e,t,r={}){return an(e,t,r).toString("utf8")}function je(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function Li(e,t){try{return ht(e,t),!0}catch(r){if(je(r))return!1;throw r}}function mt(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function cn(e){return(F(e)??gn(e)??hn(e)).filter(t=>t&&!we(t)).sort()}function un(e,t={}){let r=(t.includePaths??[]).map(C),n=[...new Set([...cn(e),...r])].filter(c=>!we(c)).filter(c=>!t.language||_e(c,t.language,t.markerFiles)).filter(c=>!t.includePath||t.includePath(c)).sort(),i=V(e),o,s=()=>o??=ot(i),a=n.flatMap(c=>{let u=st(e,c);if(u)return[{path:c,size:u.fingerprintSize??u.size,hash:u.sha256}];let l=v(e,c);if(l==="present"){let g=E(e,c);if(g)return[{path:c,size:g.fingerprintSize??g.size,hash:g.sha256}]}let f=l===void 0?s():null,p=f?.lookup(c);if(p)return[{path:c,size:p.size,hash:p.hash}];let h=Pe(e,c);try{if(be(h).isSymbolicLink()){let Z=V(h),ee=rn(i,Z);if(ee===".."||ee.startsWith(`..${on}`)||tn(ee))throw new Error("external symlink");let Ce=en(h);return[{path:c,size:Buffer.byteLength(Ce),hash:ft("sha256").update("symlink\0").update(Ce).digest("hex")}]}let g=ft("sha256"),L=z(h,{inputKind:"project fingerprint input",maxBytes:Q},Z=>g.update(Z)),w=g.digest("hex");return f?.seed(c,{size:L,hash:w}),[{path:c,size:L,hash:w}]}catch(g){return je(g)?[]:[{path:c,size:-1,hash:"unreadable"}]}});return o?.persist(),a}function Ni(e,t,r){let n=pn(t,r),i=[...n.typescriptProjects.filter(s=>dn(e,s)),...n.clojureConfigPath?[n.clojureConfigPath]:[]],o=n.languages.includes("typescript")?dt(e,n.typescriptProjectMode,n.typescriptProjects):null;return{...n,files:un(e,{includePath:s=>{let a=oe(s,t,i);return a==="other"?!1:a!=="source"||!ln(s)||!o?!0:o.has(s)},includePaths:i})}}function ln(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function dn(e,t){let r;try{r=C(t)}catch{return!1}let n=v(e,r);if(n)return n==="present";try{return be(Pe(e,r)).isFile()}catch(i){if(je(i))return!1;throw i}}function pn(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:sn(t.typescriptProjects),clojureConfigPath:fn(t.clojureConfigPath)}}function fn(e){return e?.trim()||void 0}function gn(e){try{return Xr("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"}).split(`
4
+ `).filter(Boolean)}catch{return null}}function hn(e){let t=[],r=[""];for(;r.length>0;){let n=r.pop(),i=n?Pe(e,n):e,o;try{o=Qr(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){we(a)||r.push(a);continue}t.push(a)}}return t}function we(e){let t=e.split("/");return e==="meta.json"||t[0]===".codebaseiq"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(r=>mn.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var mn=new Set([".git","node_modules",".codebaseiq-cache",".codebaseiq-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{Fe as a,Ee as b,xt as c,bt as d,j as e,ve as f,I as g,D as h,Pt as i,jt as j,wt as k,z as l,Ct as m,oe as n,wn as o,Cn as p,kt as q,vt as r,We as s,ae as t,R as u,He as v,G as w,W as x,m as y,ce as z,Tn as A,_n as B,Ue as C,Bn as D,S as E,C as F,Ge as G,A as H,de as I,Ze as J,qt as K,qn as L,Kn as M,Xn as N,Yn as O,Vn as P,he as Q,T as R,ni as S,ii as T,yr as U,oi as V,si as W,q as X,P as Y,zr as Z,B as _,sn as $,ht as aa,an as ba,Bi as ca,je as da,Li as ea,cn as fa,un as ga,Ni as ha,pn as ia};
5
+ //# sourceMappingURL=chunk-4O52YNKL.js.map
@@ -1,3 +1,3 @@
1
- import{a as f}from"./chunk-UZGZB3VB.js";import{b as d,d as m}from"./chunk-FETNQCFO.js";function u(e,r){let c=f(e,r);if(!c)return[];let t=e.get(`SELECT symbol, enclosing_symbol FROM global_symbols
1
+ import{a as f}from"./chunk-3XFJUWJE.js";import{b as d,d as m}from"./chunk-AM5SUGHF.js";function u(e,r){let c=f(e,r);if(!c)return[];let t=e.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
2
  WHERE id = ? LIMIT 1`,c.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],n=t.enclosing_symbol,i=1,y=new Set([t.symbol]);for(;n&&!y.has(n)&&i<20;){y.add(n);let s=e.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",n);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:i}),n=s.enclosing_symbol,i++}if(o.length>1)return o;let b=d(t.symbol);if("kind"in b)return o;let l=b.descriptors;if(l.length<=1)return o;let h=[o[0]];for(let s=l.length-2,p=1;s>=0;s--,p++){let g=l.slice(0,s+1).map(a=>a.suffix==="method"?`${a.name}()`:a.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");h.push({symbol:g,shortName:g,depth:p})}return h}function N(e,r){return u(e,r)}export{u as a,N as b};
3
- //# sourceMappingURL=chunk-HPJRBHVT.js.map
3
+ //# sourceMappingURL=chunk-54K6556S.js.map
@@ -1,4 +1,4 @@
1
- import{a as s}from"./chunk-GTXSJDCO.js";var _=`SELECT COUNT(*) AS shared
1
+ import{a as s}from"./chunk-HIEXRDJF.js";var _=`SELECT COUNT(*) AS shared
2
2
  FROM (
3
3
  SELECT definition_m.symbol_id
4
4
  FROM documents definition_d
@@ -46,4 +46,4 @@ import{a as s}from"./chunk-GTXSJDCO.js";var _=`SELECT COUNT(*) AS shared
46
46
  GROUP BY file1, file2
47
47
  ORDER BY shared DESC, file1, file2
48
48
  LIMIT ?`,...o,n).filter(d=>!e.isIgnored(d.file1)&&!e.isIgnored(d.file2)).map(d=>c(d.file1,d.file2,d.shared))}function h(e,i={}){return f(e,i)}function c(e,i,n){return{file1:e,file2:i,sharedSymbols:n,actionTier:"signal",couplingKind:"shared-symbol-coupling",evidenceReasons:[`${n} symbol(s) are defined in one file and referenced by the other`],recommendation:"Review whether the shared symbol surface is an intentional boundary or hidden coordination pressure before moving code."}}export{l as a,N as b,f as c,h as d};
49
- //# sourceMappingURL=chunk-HRWGYWRJ.js.map
49
+ //# sourceMappingURL=chunk-57GCCPLS.js.map
@@ -1,4 +1,4 @@
1
- import{c as W,d as J,e as K,f as U,n as Q}from"./chunk-CVYSU6BX.js";import{d as z,e as Y}from"./chunk-SGX43S2L.js";import{A as B,e as F,g as G,t as j,u as H,z as $}from"./chunk-FETNQCFO.js";import{k as D,p as x}from"./chunk-O6QTXQPJ.js";import{z as A}from"./chunk-ADTBPVUZ.js";import{f as M}from"./chunk-BMYOV5GP.js";import{d as P}from"./chunk-NNJ2KZZG.js";function _e(o,n,e={}){return ee(o,n,e).rows}function ee(o,n,e={}){let t=N(o,[n],{additive:e.additive,semantic:e.semantic,semanticEvidence:e.semanticEvidence}),a=e.callableOnly?(t.rows.get(n.symbolId)??[]).filter(l=>G(l.symbol)||l.source==="ast-callsite"):t.rows.get(n.symbolId)??[];return{rows:typeof e.limit=="number"?a.slice(0,e.limit):a,semanticIncomplete:t.incompleteSymbolIds.has(n.symbolId),semanticUnavailable:t.unavailableSymbolIds.has(n.symbolId)}}function Le(o,n,e){return ne(o,n,e).rows}function ne(o,n,e){let t=Z(o,[n],e);return{rows:t.rows.get(n.symbolId)??[],semanticIncomplete:t.incompleteSymbolIds.has(n.symbolId),semanticUnavailable:t.unavailableSymbolIds.has(n.symbolId)}}function Ae(o,n,e){return Z(o,n,e).rows}function Z(o,n,e){let t=ae(o)?ce(o,n,{semantic:e.semantic!==!1,semanticEvidence:e.semanticEvidence}):se(o,e.semanticEvidence,{semantic:e.semantic!==!1});return{rows:new Map(n.map(l=>[l.symbolId,typeof e.limit=="number"?(t.rows.get(l.symbolId)??[]).slice(0,e.limit):t.rows.get(l.symbolId)??[]])),incompleteSymbolIds:new Set(n.filter(l=>t.incompleteSymbolIds.has(l.symbolId)).map(l=>l.symbolId)),unavailableSymbolIds:new Set(n.filter(l=>t.unavailableSymbolIds.has(l.symbolId)).map(l=>l.symbolId))}}var oe=M("caller-rows",{clearGroups:["whole-project"]}),te=M("caller-rows-non-semantic",{clearGroups:["whole-project"]}),ie=M("targeted-caller-strategy",{clearGroups:["whole-project"]}),le=2e4;function ae(o){return ie.get(o,()=>(o.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>le)}function se(o,n,e={}){return(e.semantic===!1?te:oe).get(o,()=>{let a=H(o),l=N(o,a,{semantic:e.semantic!==!1,semanticEvidence:n}),m=new Map;for(let c of a)m.set(c.symbol,c.symbolId);let b=new Map,f=new Map;for(let c of a){let s=l.rows.get(c.symbolId);if(!(!s||s.length===0))for(let u of s){let r=m.get(u.symbol);if(r===void 0||r===c.symbolId)continue;let i=b.get(r);i||(i=[],b.set(r,i),f.set(r,new Set));let w=`${c.symbol}|${c.relativePath}`;f.get(r).has(w)||(f.get(r).add(w),i.push({symbol:c.symbol,file:c.relativePath,source:"caller-map-inversion",callEvidence:u.source}))}}return{rows:b,incompleteSymbolIds:l.incompleteSymbolIds.size===0?new Set:new Set(a.map(c=>c.symbolId)),unavailableSymbolIds:l.unavailableSymbolIds.size===0?new Set:new Set(a.map(c=>c.symbolId))}})}function ce(o,n,e){let t=e.semantic&&e.semanticEvidence?n.flatMap(s=>{let u=re(o,s);return u?[u]:[]}):[],a=new Map(t.map(s=>[s.symbolId,s])),l=e.semantic&&e.semanticEvidence?e.semanticEvidence.referenceEvidenceMap(o,t):{rows:new Map,incompleteSymbolIds:new Set,unavailableSymbolIds:new Set},m=Q(o,n),b=new Map;for(let s of n){let u=[],r=new Set,i=d=>{if(d.symbol===s.symbol)return;let p=`${d.symbol}|${d.file}`;r.has(p)||(r.add(p),u.push(d))};for(let d of m.get(s.symbolId)??[])d.file!==s.relativePath&&i({symbol:d.enclosingSymbol??d.file,file:d.file,source:"resolved-reference"});let w=a.get(s.symbolId);if(w)for(let d of l.rows.get(w.symbolId)??[]){if(d.file===s.relativePath||o.isIgnored(d.file))continue;let p=B(j(o,d.file),d.line);i({symbol:p?.symbol??d.file,file:d.file,source:"semantic-reference"})}b.set(s.symbolId,u)}let f=new Set(l.incompleteSymbolIds),c=new Set(l.unavailableSymbolIds);if(e.semantic)for(let s of n)a.has(s.symbolId)||f.add(s.symbolId);return{rows:b,incompleteSymbolIds:f,unavailableSymbolIds:c}}function re(o,n){let e=z().join(", "),t=Y().join(", ");return o.get(`SELECT
1
+ import{c as W,d as J,e as K,f as U,n as Q}from"./chunk-BH5CE4LN.js";import{d as z,e as Y}from"./chunk-SGX43S2L.js";import{A as B,e as F,g as G,t as j,u as H,z as $}from"./chunk-AM5SUGHF.js";import{k as D,p as x}from"./chunk-JOALNFY3.js";import{z as A}from"./chunk-RVYLJDXC.js";import{h as M}from"./chunk-PLZXWZHY.js";import{d as P}from"./chunk-327YK6TB.js";function _e(o,n,e={}){return ee(o,n,e).rows}function ee(o,n,e={}){let t=N(o,[n],{additive:e.additive,semantic:e.semantic,semanticEvidence:e.semanticEvidence}),a=e.callableOnly?(t.rows.get(n.symbolId)??[]).filter(l=>G(l.symbol)||l.source==="ast-callsite"):t.rows.get(n.symbolId)??[];return{rows:typeof e.limit=="number"?a.slice(0,e.limit):a,semanticIncomplete:t.incompleteSymbolIds.has(n.symbolId),semanticUnavailable:t.unavailableSymbolIds.has(n.symbolId)}}function Le(o,n,e){return ne(o,n,e).rows}function ne(o,n,e){let t=Z(o,[n],e);return{rows:t.rows.get(n.symbolId)??[],semanticIncomplete:t.incompleteSymbolIds.has(n.symbolId),semanticUnavailable:t.unavailableSymbolIds.has(n.symbolId)}}function Ae(o,n,e){return Z(o,n,e).rows}function Z(o,n,e){let t=ae(o)?ce(o,n,{semantic:e.semantic!==!1,semanticEvidence:e.semanticEvidence}):se(o,e.semanticEvidence,{semantic:e.semantic!==!1});return{rows:new Map(n.map(l=>[l.symbolId,typeof e.limit=="number"?(t.rows.get(l.symbolId)??[]).slice(0,e.limit):t.rows.get(l.symbolId)??[]])),incompleteSymbolIds:new Set(n.filter(l=>t.incompleteSymbolIds.has(l.symbolId)).map(l=>l.symbolId)),unavailableSymbolIds:new Set(n.filter(l=>t.unavailableSymbolIds.has(l.symbolId)).map(l=>l.symbolId))}}var oe=M("caller-rows",{clearGroups:["whole-project"]}),te=M("caller-rows-non-semantic",{clearGroups:["whole-project"]}),ie=M("targeted-caller-strategy",{clearGroups:["whole-project"]}),le=2e4;function ae(o){return ie.get(o,()=>(o.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>le)}function se(o,n,e={}){return(e.semantic===!1?te:oe).get(o,()=>{let a=H(o),l=N(o,a,{semantic:e.semantic!==!1,semanticEvidence:n}),m=new Map;for(let c of a)m.set(c.symbol,c.symbolId);let b=new Map,f=new Map;for(let c of a){let s=l.rows.get(c.symbolId);if(!(!s||s.length===0))for(let u of s){let r=m.get(u.symbol);if(r===void 0||r===c.symbolId)continue;let i=b.get(r);i||(i=[],b.set(r,i),f.set(r,new Set));let w=`${c.symbol}|${c.relativePath}`;f.get(r).has(w)||(f.get(r).add(w),i.push({symbol:c.symbol,file:c.relativePath,source:"caller-map-inversion",callEvidence:u.source}))}}return{rows:b,incompleteSymbolIds:l.incompleteSymbolIds.size===0?new Set:new Set(a.map(c=>c.symbolId)),unavailableSymbolIds:l.unavailableSymbolIds.size===0?new Set:new Set(a.map(c=>c.symbolId))}})}function ce(o,n,e){let t=e.semantic&&e.semanticEvidence?n.flatMap(s=>{let u=re(o,s);return u?[u]:[]}):[],a=new Map(t.map(s=>[s.symbolId,s])),l=e.semantic&&e.semanticEvidence?e.semanticEvidence.referenceEvidenceMap(o,t):{rows:new Map,incompleteSymbolIds:new Set,unavailableSymbolIds:new Set},m=Q(o,n),b=new Map;for(let s of n){let u=[],r=new Set,i=d=>{if(d.symbol===s.symbol)return;let p=`${d.symbol}|${d.file}`;r.has(p)||(r.add(p),u.push(d))};for(let d of m.get(s.symbolId)??[])d.file!==s.relativePath&&i({symbol:d.enclosingSymbol??d.file,file:d.file,source:"resolved-reference"});let w=a.get(s.symbolId);if(w)for(let d of l.rows.get(w.symbolId)??[]){if(d.file===s.relativePath||o.isIgnored(d.file))continue;let p=B(j(o,d.file),d.line);i({symbol:p?.symbol??d.file,file:d.file,source:"semantic-reference"})}b.set(s.symbolId,u)}let f=new Set(l.incompleteSymbolIds),c=new Set(l.unavailableSymbolIds);if(e.semantic)for(let s of n)a.has(s.symbolId)||f.add(s.symbolId);return{rows:b,incompleteSymbolIds:f,unavailableSymbolIds:c}}function re(o,n){let e=z().join(", "),t=Y().join(", ");return o.get(`SELECT
2
2
  d.id AS documentId,
3
3
  gs.id AS symbolId,
4
4
  gs.symbol,
@@ -35,4 +35,4 @@ import{c as W,d as J,e as K,f as U,n as Q}from"./chunk-CVYSU6BX.js";import{d as
35
35
  ) def_chunk ON def_chunk.symbol_id = gs.id
36
36
  WHERE gs.id IN (${i.map(()=>"?").join(",")})`,...i,...i)),b=k([...n.map(i=>i.documentId),...m.flatMap(i=>i.document_id===null?[]:[i.document_id])]),f=new Map(b.flatMap(i=>o.all(`SELECT id, relative_path FROM documents
37
37
  WHERE id IN (${i.map(()=>"?").join(",")})`,...i).map(w=>[w.id,w.relative_path]))),c=new Map;for(let i of m)c.has(i.symbol_id)||c.set(i.symbol_id,{symbol:i.symbol,file:i.document_id!==null?f.get(i.document_id)??"":""});let s=new Map,u=f,r=ye(n);for(let[i,w]of r){let p=[...a.get(i)??[]].sort((y,g)=>y.start_line-g.start_line||y.end_line-g.end_line),v=[...w].sort((y,g)=>y.startLine-g.startLine||y.endLine-g.endLine),I=new Set,R=0;for(let y of v){for(;R<p.length&&p[R].start_line<=y.endLine;)I.add(p[R]),R+=1;for(let S of I)S.end_line<y.startLine&&I.delete(S);let g=new Set,O=[],_=null,q=()=>{if(_)return _;let S=u.get(y.documentId)??"",E=new Set;if(S){let L=W(o,S),C=Math.max(0,y.startLine),T=Math.min(L.length-1,y.endLine);for(let h=C;h<=T;h+=1)for(let X of L[h])E.add(X)}return _=E,E};for(let S of I){if(S.symbol_id===y.symbolId)continue;let E=c.get(S.symbol_id);if(!E)continue;if(!(S.start_line>=y.startLine&&S.end_line<=y.endLine)){if(!(S.start_line<=y.endLine&&S.end_line>=y.startLine))continue;let h=F(E.symbol);if(!h||!q().has(h))continue}let C=`${E.symbol}|${S.chunk_id}`;g.has(C)||(g.add(C),O.push({...E,chunkId:S.chunk_id,source:"scip-chunk"}))}s.set(y.symbolId,O)}}return s}var V=500;function k(o){let n=[...new Set(o)],e=[];for(let t=0;t<n.length;t+=V)e.push(n.slice(t,t+V));return e}function ye(o){let n=new Map;for(let e of o){let t=n.get(e.documentId);t?t.push(e):n.set(e.documentId,[e])}return n}function pe(o){let n=new Map;for(let[e,t]of o){let a=[];for(let l of t)a.push({symbol:l.symbol,file:l.file,chunkId:-1,source:"semantic-callee",...l.callsiteLine===void 0?{}:{callsiteLine:l.callsiteLine}});n.set(e,a)}return n}export{_e as a,ee as b,Le as c,ne as d,Ae as e,Z as f,De as g,N as h};
38
- //# sourceMappingURL=chunk-J77SU6VA.js.map
38
+ //# sourceMappingURL=chunk-57KEZDPT.js.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-DGXRDLV5.js";import{c as m}from"./chunk-7FND7D7N.js";import{a as u}from"./chunk-BGBBVSH4.js";import{d}from"./chunk-FETNQCFO.js";function k(n,l={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=l,s=new m(n);return g({candidates:()=>s.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:o=>s.calleeEvidenceMap(o,{semantic:l.semantic!==!1}),evaluate:(o,c)=>c.incompleteSymbolIds.has(o.symbolId)||c.unavailableSymbolIds.has(o.symbolId)?null:h(o,c.rows.get(o.symbolId)??[],a),orderResults:(o,c)=>c.clusters.length-o.clusters.length||c.loc-o.loc,limit:r})}function h(n,l,e){let t=new Set(l.map(c=>c.symbol));if(t.size<e)return null;let a=S(t,l),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let s=d(n.symbol),o=p(s,t.size,r.length,i);return{symbol:n.symbol,shortName:s,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:u(n),totalCallees:t.size,extractionKind:o.extractionKind,actionTier:"signal",evidenceReasons:o.evidenceReasons,recommendation:o.recommendation,clusters:i}}function p(n,l,e,t){let a=Math.max(...t.map(o=>o.callees.length)),r=Math.max(...t.map(o=>o.isolation)),i=[`${l} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],s=f(n,l,e);return s!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,s],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,l,e){if(l>=10)return`callee breadth suggests orchestration: ${l} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,l){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of l){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let s=i+1;s<r.length;s++)e.get(r[i]).add(r[s]),e.get(r[s]).add(r[i])}return e}function y(n,l){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let s=i.pop();if(!e.has(s)){e.add(s),r.add(s);for(let o of l.get(s)??[])e.has(o)||i.push(o)}}t.push(r)}return t}function C(n,l){return n.filter(e=>e.size>=3).map(e=>v(e,n,l)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,l,e){let t=new Set;for(let s of l)if(s!==n)for(let o of s)t.add(o);let a=0;for(let s of n)for(let o of e.get(s)??[])t.has(o)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(d),isolation:i}}export{k as a};
2
- //# sourceMappingURL=chunk-OFBE4NGP.js.map
1
+ import{a as g}from"./chunk-DGXRDLV5.js";import{c as m}from"./chunk-NK76RSB6.js";import{a as u}from"./chunk-BGBBVSH4.js";import{d}from"./chunk-AM5SUGHF.js";function k(n,l={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=l,s=new m(n);return g({candidates:()=>s.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:o=>s.calleeEvidenceMap(o,{semantic:l.semantic!==!1}),evaluate:(o,c)=>c.incompleteSymbolIds.has(o.symbolId)||c.unavailableSymbolIds.has(o.symbolId)?null:h(o,c.rows.get(o.symbolId)??[],a),orderResults:(o,c)=>c.clusters.length-o.clusters.length||c.loc-o.loc,limit:r})}function h(n,l,e){let t=new Set(l.map(c=>c.symbol));if(t.size<e)return null;let a=S(t,l),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let s=d(n.symbol),o=p(s,t.size,r.length,i);return{symbol:n.symbol,shortName:s,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:u(n),totalCallees:t.size,extractionKind:o.extractionKind,actionTier:"signal",evidenceReasons:o.evidenceReasons,recommendation:o.recommendation,clusters:i}}function p(n,l,e,t){let a=Math.max(...t.map(o=>o.callees.length)),r=Math.max(...t.map(o=>o.isolation)),i=[`${l} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],s=f(n,l,e);return s!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,s],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,l,e){if(l>=10)return`callee breadth suggests orchestration: ${l} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,l){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of l){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let s=i+1;s<r.length;s++)e.get(r[i]).add(r[s]),e.get(r[s]).add(r[i])}return e}function y(n,l){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let s=i.pop();if(!e.has(s)){e.add(s),r.add(s);for(let o of l.get(s)??[])e.has(o)||i.push(o)}}t.push(r)}return t}function C(n,l){return n.filter(e=>e.size>=3).map(e=>v(e,n,l)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,l,e){let t=new Set;for(let s of l)if(s!==n)for(let o of s)t.add(o);let a=0;for(let s of n)for(let o of e.get(s)??[])t.has(o)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(d),isolation:i}}export{k as a};
2
+ //# sourceMappingURL=chunk-57KFVPVZ.js.map
@@ -1,2 +1,2 @@
1
- import{f as B,g as S}from"./chunk-T3DGWPXM.js";import{b as O}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-BGBBVSH4.js";import{c as k}from"./chunk-C7QOQX32.js";import{a as L}from"./chunk-TIIC3ZE7.js";import{d as P}from"./chunk-SGX43S2L.js";import{d as I,g as z,j as D,u as $}from"./chunk-FETNQCFO.js";import{b as T,k as v,p as A}from"./chunk-O6QTXQPJ.js";import{y as _}from"./chunk-BMYOV5GP.js";import{d as p}from"./chunk-3LCDIREB.js";import{d as b}from"./chunk-NNJ2KZZG.js";var U=new Set(P());function $e(e,t={}){let{includeHomonyms:n=!1,limit:i}=t,s=X(e,t).filter(r=>r.relationship==="divergent"||n&&r.relationship==="homonym");return i?s.slice(0,i):s}function X(e,t={}){let{scope:n,minSimilarity:i=.3,scanLimit:s}=t,r=Q(e,{scope:n,scanLimit:s});return Y(r,{minSimilarity:i,isDelegatePair:De(e)}).filter(a=>!a.members.some(o=>_(e,o.file,o.startLine,"twin")))}function Y(e,t={}){let n=t.minSimilarity??.3,i=t.isDelegatePair,s=e.filter(c=>!V(c.leaf)&&!fe(c.leaf)&&L(c.file)!=="test"&&!D(c.symbol)&&!Z(c.symbol)&&!j(c.symbol,c.leaf)),{recordsByLeaf:r,recordOrder:a}=p("twin-drift.group-by-leaf",()=>q(s),()=>({records:s.length})),o=p("twin-drift.cluster-leaf-names",()=>W([...r.keys()]),()=>({leaves:r.size}));return p("twin-drift.compare-clusters",()=>{let c=[];for(let h of o){let u=J(h,r,a);if(u.length<2||new Set(u.map(f=>f.file)).size<2)continue;let m=null,R=!1,C=!1,y=new Set;for(let f=0;f<u.length;f+=1)for(let w=f+1;w<u.length;w+=1){let d=u[f],g=u[w];if(d.file===g.file||!ge(d,g)||i?.(d,g,u)||i?.(g,d,u))continue;if(R=!0,y.add(d.symbol),y.add(g.symbol),d.normalizedBody===g.normalizedBody){C=!0;continue}let M=oe(d.tokens,g.tokens);(!m||M>m.similarity)&&(m={a:d,b:g,similarity:M})}if(!R)continue;let x=u.filter(f=>y.has(f.symbol)).sort((f,w)=>f.file.localeCompare(w.file)||f.startLine-w.startLine).map(se);if(!m){c.push({leaf:G(h),relationship:C?"identical":"homonym",maxDivergence:0,members:x});continue}let N=m.similarity>=n?"divergent":"homonym";c.push({leaf:G(h),relationship:N,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:x,...N==="divergent"?{firstDivergentTokens:ae(m.a.tokens,m.b.tokens)}:{}})}return c},()=>({clusters:o.length,records:s.length})).sort((c,h)=>h.members.length-c.members.length||h.maxDivergence-c.maxDivergence||c.leaf.localeCompare(h.leaf))}function q(e){let t=new Map,n=new Map;for(let[i,s]of e.entries()){let r=t.get(s.leaf)??[];r.push(s),t.set(s.leaf,r),n.set(s,i)}return{recordsByLeaf:t,recordOrder:n}}function J(e,t,n){let i=[...e].flatMap(s=>t.get(s)??[]);return e.size>1&&i.sort((s,r)=>(n.get(s)??0)-(n.get(r)??0)),i}function Q(e,t){let n=p("twin-drift.load-definitions",()=>$(e,{scope:t.scope}).filter(r=>ee(r)&&!e.isIgnored(r.relativePath)).filter(r=>!k(r.relativePath)));p("twin-drift.sort-definitions",()=>n.sort((r,a)=>r.relativePath.localeCompare(a.relativePath)||r.startLine-a.startLine),()=>({definitions:n.length}));let i=O(n,t.scanLimit),s=p("twin-drift.select-candidates",()=>te(i),()=>({scanned:i.length}));return p("twin-drift.build-records",()=>{let r=[];for(let a of s){let o=ne(e,a);o&&r.push(o)}return r},()=>({candidates:s.length,scanned:i.length}))}function ee(e){return e.isFunctionLike?e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&U.has(e.kind):!0:!1}function te(e){let t=e.filter(r=>r.leaf&&!V(r.leaf)&&!D(r.symbol)&&!Z(r.symbol)&&!j(r.symbol,r.leaf)),n=new Map;for(let r of t){let a=n.get(r.leaf)??[];a.push(r),n.set(r.leaf,a)}let i=W([...n.keys()]),s=new Set;for(let r of i){let a=[...r].flatMap(o=>n.get(o)??[]);if(!(a.length<2)&&!(new Set(a.map(o=>o.relativePath)).size<2)&&!a.every(o=>L(o.relativePath)==="test"))for(let o of a)s.add(o)}return e.filter(r=>s.has(r))}function ne(e,t){if(!t.leaf)return null;let n=B(e,t);if(!n||!z(t.symbol)&&!re(n,t.leaf))return null;let i=T(S(n)),s=i.replace(/\s+/g,"");if(!s||s.length<8)return null;let r=i.match(ie)??[];return r.length===0?null:{leaf:t.leaf,symbol:t.symbol,shortName:I(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:E(t),normalizedBody:s,tokens:r,isThinForwarder:H(i)}}function re(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`\\b(?:const|let|var)\\s+${n}(?:\\s*:[^=]+)?\\s*=\\s*(?:async\\s*)?(?:\\([^)]*\\)|[A-Za-z_$][\\w$]*)\\s*=>`,"s").test(e)}var ie=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function se(e){return{symbol:e.symbol,shortName:e.shortName,file:e.file,startLine:e.startLine,endLine:e.endLine,loc:e.loc}}function oe(e,t){let n=new Set(e),i=new Set(t);if(n.size===0&&i.size===0)return 1;if(n.size===0||i.size===0)return 0;let s=0;for(let a of n)i.has(a)&&(s+=1);let r=n.size+i.size-s;return r===0?0:s/r}function ae(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;let s=e.slice(i,i+6).join(" "),r=t.slice(i,i+6).join(" ");return!s&&!r?"(bodies differ only in trailing length)":`A: ${s||"(end)"} | B: ${r||"(end)"}`}function W(e){let t=new Map;for(let a of e)t.set(a,a);let n=a=>{let o=a;for(;t.get(o)!==o;)o=t.get(o);let l=a;for(;t.get(l)!==o;){let c=t.get(l);t.set(l,o),l=c}return o},i=(a,o)=>{let l=n(a),c=n(o);l!==c&&t.set(l,c)},s=new Map;for(let a of e){let o=a.slice(0,2).toLowerCase(),l=s.get(o)??[];l.push(a),s.set(o,l)}for(let a of s.values())for(let o=0;o<a.length;o+=1)for(let l=o+1;l<a.length;l+=1)le(a[o],a[l])&&i(a[o],a[l]);let r=new Map;for(let a of e){let o=n(a),l=r.get(o)??new Set;l.add(a),r.set(o,l)}return[...r.values()]}function le(e,t){return e===t||e.toLowerCase()===t.toLowerCase()?!0:e.length<8||t.length<8||Math.abs(e.length-t.length)>2||ce(e.toLowerCase(),t.toLowerCase())/Math.max(e.length,t.length)<.8?!1:pe(e.toLowerCase(),t.toLowerCase(),2)}function ce(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;return i}function fe(e){return/^[A-Z][A-Z0-9_]*$/.test(e)||/^__[^_].*__$/.test(e)||ue.has(e.toLowerCase())}var ue=new Set(["main","row"]),me=new Set(["app","component","components","feature","features","impl","index","lib","route","routes","shared","src","tsx","typescript","ui"]);function Z(e){return e.startsWith("rust-analyzer ")&&/\/(?:tests?|benches?)\//.test(e)}var de=new Set(["default","new","reset"]);function j(e,t){return e.startsWith("rust-analyzer ")&&de.has(t.toLowerCase())}function ge(e,t){if(e.leaf.toLowerCase()!==t.leaf.toLowerCase()||e.leaf.length>4)return!0;let n=F(e);return[...F(t)].some(i=>n.has(i))}function F(e){let t=e.leaf.toLowerCase();return new Set(`${e.file}/${e.shortName}`.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>2&&n!==t&&!me.has(n)))}function pe(e,t,n){if(Math.abs(e.length-t.length)>n)return!1;let i=Array.from({length:t.length+1},(s,r)=>r);for(let s=1;s<=e.length;s+=1){let r=[s],a=r[0];for(let o=1;o<=t.length;o+=1){let l=e[s-1]===t[o-1]?0:1,c=Math.min(i[o]+1,r[o-1]+1,i[o-1]+l);r.push(c),a=Math.min(a,c)}if(a>n)return!1;i=r}return i[t.length]<=n}function ke(e){return H(T(S(e)))}function H(e){let t=e.trim();if(!t||he.test(t))return!1;let n=be(t);return n.length===0||n.length>2?!1:ye(n[n.length-1])}var he=/\b(?:if|else|for|while|switch|try|catch|do)\b/,we=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function ye(e){let t=e.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return we.test(t)}function be(e){let t=[],n=0,i="";for(let s of e){if(s==="("||s==="["||s==="{"?n+=1:(s===")"||s==="]"||s==="}")&&(n=Math.max(0,n-1)),s===";"&&n===0){t.push(i),i="";continue}i+=s}return i.trim()&&t.push(i),t.map(s=>s.trim()).filter(s=>s.length>0)}var Te=3;function De(e){let t=new Map;return(n,i,s)=>{if(!n.isThinForwarder)return!1;let r=`${n.symbol}\0${i.symbol}`,a=t.get(r);if(a!==void 0)return a;let o=K(e,n,i,s,Te,new Set);return t.set(r,o),o}}function K(e,t,n,i,s,r){if(s<=0||r.has(t.symbol)||(r.add(t.symbol),(v(e,t.file)??[]).filter(l=>l.line>=t.startLine&&l.line<=t.endLine&&l.calleeLeaf===n.leaf).length===0))return!1;let o=new Set(A(e,t.file).filter(l=>l.sourcePath&&(l.kind!=="namespace"||l.usedMembers.includes(n.leaf))).map(l=>l.sourcePath));if([...o].some(l=>b(l,n.file)))return!0;for(let l of i)if(!(l.symbol===t.symbol||l.symbol===n.symbol||!l.isThinForwarder)&&[...o].some(c=>b(c,l.file))&&K(e,l,n,i,s-1,r))return!0;return!1}function V(e){return e.startsWith("<")&&e.endsWith(">")}function G(e){return[...e].sort()[0]}export{$e as a,X as b,Y as c,ke as d,be as e};
2
- //# sourceMappingURL=chunk-WOQBZPIF.js.map
1
+ import{f as B,g as S}from"./chunk-CSZOQ7YO.js";import{b as O}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-BGBBVSH4.js";import{c as k}from"./chunk-JN5LIBT3.js";import{a as L}from"./chunk-ZOEDRCR4.js";import{d as P}from"./chunk-SGX43S2L.js";import{d as I,g as z,j as D,u as $}from"./chunk-AM5SUGHF.js";import{b as T,k as v,p as A}from"./chunk-JOALNFY3.js";import{A as _}from"./chunk-PLZXWZHY.js";import{d as p}from"./chunk-3LCDIREB.js";import{d as b}from"./chunk-327YK6TB.js";var U=new Set(P());function $e(e,t={}){let{includeHomonyms:n=!1,limit:i}=t,s=X(e,t).filter(r=>r.relationship==="divergent"||n&&r.relationship==="homonym");return i?s.slice(0,i):s}function X(e,t={}){let{scope:n,minSimilarity:i=.3,scanLimit:s}=t,r=Q(e,{scope:n,scanLimit:s});return Y(r,{minSimilarity:i,isDelegatePair:De(e)}).filter(a=>!a.members.some(o=>_(e,o.file,o.startLine,"twin")))}function Y(e,t={}){let n=t.minSimilarity??.3,i=t.isDelegatePair,s=e.filter(c=>!V(c.leaf)&&!fe(c.leaf)&&L(c.file)!=="test"&&!D(c.symbol)&&!Z(c.symbol)&&!j(c.symbol,c.leaf)),{recordsByLeaf:r,recordOrder:a}=p("twin-drift.group-by-leaf",()=>q(s),()=>({records:s.length})),o=p("twin-drift.cluster-leaf-names",()=>W([...r.keys()]),()=>({leaves:r.size}));return p("twin-drift.compare-clusters",()=>{let c=[];for(let h of o){let u=J(h,r,a);if(u.length<2||new Set(u.map(f=>f.file)).size<2)continue;let m=null,R=!1,C=!1,y=new Set;for(let f=0;f<u.length;f+=1)for(let w=f+1;w<u.length;w+=1){let d=u[f],g=u[w];if(d.file===g.file||!ge(d,g)||i?.(d,g,u)||i?.(g,d,u))continue;if(R=!0,y.add(d.symbol),y.add(g.symbol),d.normalizedBody===g.normalizedBody){C=!0;continue}let M=oe(d.tokens,g.tokens);(!m||M>m.similarity)&&(m={a:d,b:g,similarity:M})}if(!R)continue;let x=u.filter(f=>y.has(f.symbol)).sort((f,w)=>f.file.localeCompare(w.file)||f.startLine-w.startLine).map(se);if(!m){c.push({leaf:G(h),relationship:C?"identical":"homonym",maxDivergence:0,members:x});continue}let N=m.similarity>=n?"divergent":"homonym";c.push({leaf:G(h),relationship:N,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:x,...N==="divergent"?{firstDivergentTokens:ae(m.a.tokens,m.b.tokens)}:{}})}return c},()=>({clusters:o.length,records:s.length})).sort((c,h)=>h.members.length-c.members.length||h.maxDivergence-c.maxDivergence||c.leaf.localeCompare(h.leaf))}function q(e){let t=new Map,n=new Map;for(let[i,s]of e.entries()){let r=t.get(s.leaf)??[];r.push(s),t.set(s.leaf,r),n.set(s,i)}return{recordsByLeaf:t,recordOrder:n}}function J(e,t,n){let i=[...e].flatMap(s=>t.get(s)??[]);return e.size>1&&i.sort((s,r)=>(n.get(s)??0)-(n.get(r)??0)),i}function Q(e,t){let n=p("twin-drift.load-definitions",()=>$(e,{scope:t.scope}).filter(r=>ee(r)&&!e.isIgnored(r.relativePath)).filter(r=>!k(r.relativePath)));p("twin-drift.sort-definitions",()=>n.sort((r,a)=>r.relativePath.localeCompare(a.relativePath)||r.startLine-a.startLine),()=>({definitions:n.length}));let i=O(n,t.scanLimit),s=p("twin-drift.select-candidates",()=>te(i),()=>({scanned:i.length}));return p("twin-drift.build-records",()=>{let r=[];for(let a of s){let o=ne(e,a);o&&r.push(o)}return r},()=>({candidates:s.length,scanned:i.length}))}function ee(e){return e.isFunctionLike?e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&U.has(e.kind):!0:!1}function te(e){let t=e.filter(r=>r.leaf&&!V(r.leaf)&&!D(r.symbol)&&!Z(r.symbol)&&!j(r.symbol,r.leaf)),n=new Map;for(let r of t){let a=n.get(r.leaf)??[];a.push(r),n.set(r.leaf,a)}let i=W([...n.keys()]),s=new Set;for(let r of i){let a=[...r].flatMap(o=>n.get(o)??[]);if(!(a.length<2)&&!(new Set(a.map(o=>o.relativePath)).size<2)&&!a.every(o=>L(o.relativePath)==="test"))for(let o of a)s.add(o)}return e.filter(r=>s.has(r))}function ne(e,t){if(!t.leaf)return null;let n=B(e,t);if(!n||!z(t.symbol)&&!re(n,t.leaf))return null;let i=T(S(n)),s=i.replace(/\s+/g,"");if(!s||s.length<8)return null;let r=i.match(ie)??[];return r.length===0?null:{leaf:t.leaf,symbol:t.symbol,shortName:I(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:E(t),normalizedBody:s,tokens:r,isThinForwarder:H(i)}}function re(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`\\b(?:const|let|var)\\s+${n}(?:\\s*:[^=]+)?\\s*=\\s*(?:async\\s*)?(?:\\([^)]*\\)|[A-Za-z_$][\\w$]*)\\s*=>`,"s").test(e)}var ie=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function se(e){return{symbol:e.symbol,shortName:e.shortName,file:e.file,startLine:e.startLine,endLine:e.endLine,loc:e.loc}}function oe(e,t){let n=new Set(e),i=new Set(t);if(n.size===0&&i.size===0)return 1;if(n.size===0||i.size===0)return 0;let s=0;for(let a of n)i.has(a)&&(s+=1);let r=n.size+i.size-s;return r===0?0:s/r}function ae(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;let s=e.slice(i,i+6).join(" "),r=t.slice(i,i+6).join(" ");return!s&&!r?"(bodies differ only in trailing length)":`A: ${s||"(end)"} | B: ${r||"(end)"}`}function W(e){let t=new Map;for(let a of e)t.set(a,a);let n=a=>{let o=a;for(;t.get(o)!==o;)o=t.get(o);let l=a;for(;t.get(l)!==o;){let c=t.get(l);t.set(l,o),l=c}return o},i=(a,o)=>{let l=n(a),c=n(o);l!==c&&t.set(l,c)},s=new Map;for(let a of e){let o=a.slice(0,2).toLowerCase(),l=s.get(o)??[];l.push(a),s.set(o,l)}for(let a of s.values())for(let o=0;o<a.length;o+=1)for(let l=o+1;l<a.length;l+=1)le(a[o],a[l])&&i(a[o],a[l]);let r=new Map;for(let a of e){let o=n(a),l=r.get(o)??new Set;l.add(a),r.set(o,l)}return[...r.values()]}function le(e,t){return e===t||e.toLowerCase()===t.toLowerCase()?!0:e.length<8||t.length<8||Math.abs(e.length-t.length)>2||ce(e.toLowerCase(),t.toLowerCase())/Math.max(e.length,t.length)<.8?!1:pe(e.toLowerCase(),t.toLowerCase(),2)}function ce(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;return i}function fe(e){return/^[A-Z][A-Z0-9_]*$/.test(e)||/^__[^_].*__$/.test(e)||ue.has(e.toLowerCase())}var ue=new Set(["main","row"]),me=new Set(["app","component","components","feature","features","impl","index","lib","route","routes","shared","src","tsx","typescript","ui"]);function Z(e){return e.startsWith("rust-analyzer ")&&/\/(?:tests?|benches?)\//.test(e)}var de=new Set(["default","new","reset"]);function j(e,t){return e.startsWith("rust-analyzer ")&&de.has(t.toLowerCase())}function ge(e,t){if(e.leaf.toLowerCase()!==t.leaf.toLowerCase()||e.leaf.length>4)return!0;let n=F(e);return[...F(t)].some(i=>n.has(i))}function F(e){let t=e.leaf.toLowerCase();return new Set(`${e.file}/${e.shortName}`.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>2&&n!==t&&!me.has(n)))}function pe(e,t,n){if(Math.abs(e.length-t.length)>n)return!1;let i=Array.from({length:t.length+1},(s,r)=>r);for(let s=1;s<=e.length;s+=1){let r=[s],a=r[0];for(let o=1;o<=t.length;o+=1){let l=e[s-1]===t[o-1]?0:1,c=Math.min(i[o]+1,r[o-1]+1,i[o-1]+l);r.push(c),a=Math.min(a,c)}if(a>n)return!1;i=r}return i[t.length]<=n}function ke(e){return H(T(S(e)))}function H(e){let t=e.trim();if(!t||he.test(t))return!1;let n=be(t);return n.length===0||n.length>2?!1:ye(n[n.length-1])}var he=/\b(?:if|else|for|while|switch|try|catch|do)\b/,we=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function ye(e){let t=e.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return we.test(t)}function be(e){let t=[],n=0,i="";for(let s of e){if(s==="("||s==="["||s==="{"?n+=1:(s===")"||s==="]"||s==="}")&&(n=Math.max(0,n-1)),s===";"&&n===0){t.push(i),i="";continue}i+=s}return i.trim()&&t.push(i),t.map(s=>s.trim()).filter(s=>s.length>0)}var Te=3;function De(e){let t=new Map;return(n,i,s)=>{if(!n.isThinForwarder)return!1;let r=`${n.symbol}\0${i.symbol}`,a=t.get(r);if(a!==void 0)return a;let o=K(e,n,i,s,Te,new Set);return t.set(r,o),o}}function K(e,t,n,i,s,r){if(s<=0||r.has(t.symbol)||(r.add(t.symbol),(v(e,t.file)??[]).filter(l=>l.line>=t.startLine&&l.line<=t.endLine&&l.calleeLeaf===n.leaf).length===0))return!1;let o=new Set(A(e,t.file).filter(l=>l.sourcePath&&(l.kind!=="namespace"||l.usedMembers.includes(n.leaf))).map(l=>l.sourcePath));if([...o].some(l=>b(l,n.file)))return!0;for(let l of i)if(!(l.symbol===t.symbol||l.symbol===n.symbol||!l.isThinForwarder)&&[...o].some(c=>b(c,l.file))&&K(e,l,n,i,s-1,r))return!0;return!1}function V(e){return e.startsWith("<")&&e.endsWith(">")}function G(e){return[...e].sort()[0]}export{$e as a,X as b,Y as c,ke as d,be as e};
2
+ //# sourceMappingURL=chunk-5BDK6QC3.js.map
@@ -1,2 +1,2 @@
1
- import{b as f,c as p}from"./chunk-EF2R3WNQ.js";import{execFileSync as y}from"child_process";import{platform as I}from"os";var b=1e3,T=2*1024*1024,M=25;function v(e,n,r=S){let t=r.readIdentity(e),o=new Map;return t&&o.set(e,t),{rootPid:e,rootIdentity:t,ownsProcessGroup:n,knownMembers:o}}async function k(e,n,r=S){if(!e.rootIdentity){let a=await l(e,n.gracefulMs+n.forceMs,r);return{reaped:a,reason:a?"terminated":"identity-unavailable",detail:a?void 0:`Could not establish the birth identity of process ${e.rootPid}.`}}let t=g(e,r);if(t==="mismatch")return{reaped:!1,reason:"identity-mismatch",detail:`Process ${e.rootPid} no longer has the identity owned by this runner.`};if(t==="exited"&&!h(e,r))return{reaped:!0,reason:"terminated"};if(r.platform==="win32"){try{r.terminateWindowsTree(e.rootPid)}catch(u){let c=await l(e,n.forceMs,r);return{reaped:c,reason:c?"terminated":"signal-failed",detail:c?void 0:m(u)}}let a=await l(e,n.forceMs,r);return{reaped:a,reason:a?"terminated":"deadline"}}let o=P(e,"SIGTERM",r);if(await l(e,n.gracefulMs,r))return{reaped:!0,reason:"terminated"};let s=P(e,"SIGKILL",r);return await l(e,n.forceMs,r)?{reaped:!0,reason:"terminated"}:s?{reaped:!1,reason:s.reason,detail:s.detail}:o?{reaped:!1,reason:o.reason,detail:o.detail}:{reaped:!1,reason:"deadline",detail:`Process tree ${e.rootPid} did not exit before its termination deadline.`}}function g(e,n){let r=n.readIdentity(e.rootPid);if(!r)return"exited";if(!e.rootIdentity||!f(e.rootIdentity,r))return"mismatch";e.knownMembers.set(e.rootPid,r);for(let t of n.listDescendantPids(e.rootPid)){let o=n.readIdentity(t);o&&e.knownMembers.set(t,o)}return"owned"}function P(e,n,r){let t=g(e,r);if(t==="mismatch")return{reason:"identity-mismatch",detail:`Process ${e.rootPid} changed identity before ${n}.`};if(t==="owned"&&e.ownsProcessGroup)try{return r.signal(-e.rootPid,n),null}catch(i){if(!w(i))return{reason:"signal-failed",detail:m(i)}}let o=null;for(let i of e.knownMembers.values()){let s=r.readIdentity(i.pid);if(!(!s||!f(i,s)))try{r.signal(i.pid,n)}catch(d){!w(d)&&o===null&&(o=m(d))}}return o===null?null:{reason:"signal-failed",detail:o}}async function l(e,n,r){let t=r.now()+n;for(;h(e,r);){if(r.now()>=t)return!1;await r.sleep(Math.min(M,Math.max(1,t-r.now())))}return!0}function h(e,n){if(!e.rootIdentity&&n.isProcessAlive(e.rootPid))return!0;for(let r of e.knownMembers.values()){let t=n.readIdentity(r.pid);if(t&&f(r,t))return!0}return!!(e.ownsProcessGroup&&n.isProcessGroupAlive(e.rootPid))}function R(e){let n=y("ps",["-axo","pid=,ppid="],{encoding:"utf8",timeout:b,maxBuffer:T,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0}),r=new Map;for(let s of n.split(/\r?\n/)){let d=/^\s*(\d+)\s+(\d+)\s*$/.exec(s);if(!d)continue;let a=Number(d[1]),u=Number(d[2]),c=r.get(u)??[];c.push(a),r.set(u,c)}let t=[],o=[...r.get(e)??[]],i=new Set;for(;o.length>0;){let s=o.pop();i.has(s)||(i.add(s),t.push(s),o.push(...r.get(s)??[]))}return t}function w(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ESRCH"}function m(e){return e instanceof Error?e.message:String(e)}var S={platform:I(),now:Date.now,readIdentity:p,isProcessAlive(e){try{return process.kill(e,0),!0}catch(n){return typeof n=="object"&&n!==null&&"code"in n&&n.code==="EPERM"}},isProcessGroupAlive(e){if(this.platform==="win32")return!1;try{return process.kill(-e,0),!0}catch(n){return typeof n=="object"&&n!==null&&"code"in n&&n.code==="EPERM"}},listDescendantPids(e){if(this.platform==="win32")return[];try{return R(e)}catch{return[]}},signal(e,n){process.kill(e,n)},terminateWindowsTree(e){y("taskkill.exe",["/PID",String(e),"/T","/F"],{timeout:b,maxBuffer:T,stdio:"ignore",windowsHide:!0})},async sleep(e){await new Promise(n=>setTimeout(n,e))}};export{v as a,k as b};
2
- //# sourceMappingURL=chunk-7MGU3HPH.js.map
1
+ import{b as f,c as p}from"./chunk-6URCE5QY.js";import{execFileSync as y}from"child_process";import{platform as I}from"os";var b=1e3,T=2*1024*1024,M=25;function v(e,n,r=S){let t=r.readIdentity(e),o=new Map;return t&&o.set(e,t),{rootPid:e,rootIdentity:t,ownsProcessGroup:n,knownMembers:o}}async function k(e,n,r=S){if(!e.rootIdentity){let a=await l(e,n.gracefulMs+n.forceMs,r);return{reaped:a,reason:a?"terminated":"identity-unavailable",detail:a?void 0:`Could not establish the birth identity of process ${e.rootPid}.`}}let t=g(e,r);if(t==="mismatch")return{reaped:!1,reason:"identity-mismatch",detail:`Process ${e.rootPid} no longer has the identity owned by this runner.`};if(t==="exited"&&!h(e,r))return{reaped:!0,reason:"terminated"};if(r.platform==="win32"){try{r.terminateWindowsTree(e.rootPid)}catch(u){let c=await l(e,n.forceMs,r);return{reaped:c,reason:c?"terminated":"signal-failed",detail:c?void 0:m(u)}}let a=await l(e,n.forceMs,r);return{reaped:a,reason:a?"terminated":"deadline"}}let o=P(e,"SIGTERM",r);if(await l(e,n.gracefulMs,r))return{reaped:!0,reason:"terminated"};let s=P(e,"SIGKILL",r);return await l(e,n.forceMs,r)?{reaped:!0,reason:"terminated"}:s?{reaped:!1,reason:s.reason,detail:s.detail}:o?{reaped:!1,reason:o.reason,detail:o.detail}:{reaped:!1,reason:"deadline",detail:`Process tree ${e.rootPid} did not exit before its termination deadline.`}}function g(e,n){let r=n.readIdentity(e.rootPid);if(!r)return"exited";if(!e.rootIdentity||!f(e.rootIdentity,r))return"mismatch";e.knownMembers.set(e.rootPid,r);for(let t of n.listDescendantPids(e.rootPid)){let o=n.readIdentity(t);o&&e.knownMembers.set(t,o)}return"owned"}function P(e,n,r){let t=g(e,r);if(t==="mismatch")return{reason:"identity-mismatch",detail:`Process ${e.rootPid} changed identity before ${n}.`};if(t==="owned"&&e.ownsProcessGroup)try{return r.signal(-e.rootPid,n),null}catch(i){if(!w(i))return{reason:"signal-failed",detail:m(i)}}let o=null;for(let i of e.knownMembers.values()){let s=r.readIdentity(i.pid);if(!(!s||!f(i,s)))try{r.signal(i.pid,n)}catch(d){!w(d)&&o===null&&(o=m(d))}}return o===null?null:{reason:"signal-failed",detail:o}}async function l(e,n,r){let t=r.now()+n;for(;h(e,r);){if(r.now()>=t)return!1;await r.sleep(Math.min(M,Math.max(1,t-r.now())))}return!0}function h(e,n){if(!e.rootIdentity&&n.isProcessAlive(e.rootPid))return!0;for(let r of e.knownMembers.values()){let t=n.readIdentity(r.pid);if(t&&f(r,t))return!0}return!!(e.ownsProcessGroup&&n.isProcessGroupAlive(e.rootPid))}function R(e){let n=y("ps",["-axo","pid=,ppid="],{encoding:"utf8",timeout:b,maxBuffer:T,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0}),r=new Map;for(let s of n.split(/\r?\n/)){let d=/^\s*(\d+)\s+(\d+)\s*$/.exec(s);if(!d)continue;let a=Number(d[1]),u=Number(d[2]),c=r.get(u)??[];c.push(a),r.set(u,c)}let t=[],o=[...r.get(e)??[]],i=new Set;for(;o.length>0;){let s=o.pop();i.has(s)||(i.add(s),t.push(s),o.push(...r.get(s)??[]))}return t}function w(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ESRCH"}function m(e){return e instanceof Error?e.message:String(e)}var S={platform:I(),now:Date.now,readIdentity:p,isProcessAlive(e){try{return process.kill(e,0),!0}catch(n){return typeof n=="object"&&n!==null&&"code"in n&&n.code==="EPERM"}},isProcessGroupAlive(e){if(this.platform==="win32")return!1;try{return process.kill(-e,0),!0}catch(n){return typeof n=="object"&&n!==null&&"code"in n&&n.code==="EPERM"}},listDescendantPids(e){if(this.platform==="win32")return[];try{return R(e)}catch{return[]}},signal(e,n){process.kill(e,n)},terminateWindowsTree(e){y("taskkill.exe",["/PID",String(e),"/T","/F"],{timeout:b,maxBuffer:T,stdio:"ignore",windowsHide:!0})},async sleep(e){await new Promise(n=>setTimeout(n,e))}};export{v as a,k as b};
2
+ //# sourceMappingURL=chunk-5IO2APSS.js.map
@@ -0,0 +1,61 @@
1
+ import{a as M,b as _}from"./chunk-FWY2PRIF.js";import{a as k,g as j}from"./chunk-2VKB5CMA.js";import{a as x,b as w,ca as N,g as S,ga as D}from"./chunk-4O52YNKL.js";import he from"better-sqlite3";import{existsSync as En}from"fs";import{dirname as Tn,join as Cn,resolve as Se}from"path";import xe from"better-sqlite3";import{execFileSync as ve}from"child_process";import{existsSync as Ie,readdirSync as we}from"fs";import{extname as v,join as Ee}from"path";function $(e={}){return{id:"auxiliary-documents",facts:["auxiliary-document"],run:n=>Te({projectRoot:n.projectRoot,dbPath:n.dbPath,extensions:e.extensions,onStatus:n.onStatus})}}function Te(e){let n=new Set((e.extensions??M).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!Ie(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let t=j(e.projectRoot),r=Ce(e.projectRoot,n).filter(i=>!t.isIgnored(i)),o=new xe(k(e.dbPath));try{let i=Le(o,r),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
2
+ VALUES (?, ?, NULL, ?)`),a=o.transaction(l=>{let f=0;for(let g of l){if(i.has(g))continue;let p=N(e.projectRoot,g,{inputKind:"auxiliary source file"}),m=s.run(Pe(g),g,p);f+=Number(m.changes)}return f})(r),c={scanned:r.length,inserted:a,existing:r.length-a};return e.onStatus?.(`Augmented SQLite documents with ${a} auxiliary source file${a===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function Ce(e,n){let t=Fe(e,n);if(t)return t;let r=[],o=i=>{let s=i?Ee(e,i):e,u;try{u=we(s,{withFileTypes:!0})}catch{return}for(let a of u){if(_.has(a.name))continue;let c=i?`${i}/${a.name}`:a.name;if(a.isDirectory()){o(c);continue}n.has(v(a.name).toLowerCase())&&r.push(c)}};return o(""),r.sort()}function Fe(e,n){try{return ve("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"}).split(`
3
+ `).filter(r=>r&&n.has(v(r).toLowerCase())).sort()}catch{return null}}function Le(e,n){let t=new Set,r=500;for(let o=0;o<n.length;o+=r){let i=n.slice(o,o+r),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let u of s)t.add(u.relative_path)}return t}function Pe(e){return v(e).toLowerCase()===".vue"?"vue":v(e).replace(/^\./,"").toLowerCase()||"source"}import{writeFileSync as Oe}from"fs";function U(e,n){let t=performance.now(),r=e.run(n);return{stageId:e.id,facts:e.facts,durationMs:performance.now()-t,result:r}}async function B(e){let n=e.readFingerprint(),t=Ae(e.cachePath,n);if(t)return e.onCacheHit?.(t.result),t.result;let r=await e.compute();return Ne(e.cachePath,e.readFingerprint(),r),r}function Ae(e,n){try{let t=JSON.parse(S(e,{maxBytes:x,inputKind:"post-index augmentation cache"}));return W(t.fingerprint)===W(n)?{result:t.result}:null}catch{return null}}function Ne(e,n,t){Oe(e,`${JSON.stringify({updatedAt:new Date().toISOString(),fingerprint:n,result:t},null,2)}
4
+ `)}function W(e){return JSON.stringify(e)}import{randomUUID as Me}from"crypto";import{mkdtempSync as _e,rmSync as je,statSync as K}from"fs";import{tmpdir as $e}from"os";import{join as G}from"path";import{Worker as We}from"worker_threads";function De(){return{"missing-source-file":0,"missing-service-script":0,"no-definition":0,"same-file-definition":0,"unindexed-definition":0}}function y(){return{skippedReferences:0,skippedReferenceReasons:De(),skippedReferenceSamples:[]}}function I(e,n){e.skippedReferences+=n.skippedReferences;for(let t of Object.keys(e.skippedReferenceReasons)){e.skippedReferenceReasons[t]+=n.skippedReferenceReasons[t];for(let r of n.skippedReferenceSamples.filter(o=>o.reason===t))e.skippedReferenceSamples.filter(i=>i.reason===t&&i.sourceFile===r.sourceFile).length<2&&e.skippedReferenceSamples.push(r)}}var Ue=3e5,J=64*1024*1024,Be={createResultDirectory:()=>_e(G($e(),"codebaseiq-vue-workers-")),spawn:(e,n)=>new We(e,{workerData:n}),resultSize:e=>K(e).size,readResult:e=>S(e,{maxBytes:J,inputKind:"Vue worker result"}),removeResultDirectory:e=>je(e,{recursive:!0,force:!0})};function z(e){return e.length>=8&&Y(e.length)>1}async function X(e,n=Be){let t=Y(e.vueFiles.length),r=tn(e.vueFiles),o=on(r,t),i=new URL("./augment-vue-worker.js",import.meta.url),s=e.timeoutMs??en(),u=e.maxResultBytes??nn();H("timeoutMs",s),H("maxResultBytes",u);let a=Me(),c=n.createResultDirectory(),l=[],f,g,p;try{for(let d=0;d<o.length;d++){let b=d,L=o[d]??[],P=L.map(Ve=>Ve.taskId),O=G(c,`${b}.json`),A=n.spawn(i,{projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,tasks:L,resultPath:O,runId:a,workerId:b,taskIds:P});l.push({workerId:b,taskIds:P,resultPath:O,handle:A,completion:He(A,b)})}await Ke(l,s);let m=l.sort((d,b)=>d.workerId-b.workerId).map(d=>Je(d,a,u,n));p={occurrences:m.flatMap(d=>d.occurrences),...y()};for(let d of m)I(p,d)}catch(m){f=m}finally{let m=await Ge(l);if(m.length===0)try{n.removeResultDirectory(c)}catch(d){m.push(d)}if(m.length>0){let d=f===void 0?m:[f,...m];g=new AggregateError(d,`Vue worker cleanup failed: ${Ze(d[0])}`)}}if(g)throw g;if(f!==void 0)throw f;if(!p)throw new Error("Vue workers completed without producing a merged result.");return p}function He(e,n){return new Promise((t,r)=>{let o=!1,i=a=>{o||(o=!0,e.off("error",s),e.off("exit",u),a?r(a):t())},s=a=>{i(new Error(`Vue reference worker ${n} failed: ${a.message}`,{cause:a}))},u=a=>{i(a===0?void 0:new Error(`Vue reference worker ${n} exited with code ${a}`))};e.once("error",s),e.once("exit",u)})}async function Ke(e,n){let t;try{await Promise.race([Promise.all(e.map(r=>r.completion)),new Promise((r,o)=>{t=setTimeout(()=>o(new Error(`Vue reference workers timed out after ${(n/1e3).toFixed(3)}s`)),n),t.unref()})])}finally{t&&clearTimeout(t)}}async function Ge(e){return(await Promise.allSettled(e.map(async t=>t.handle.terminate()))).flatMap(t=>t.status==="rejected"?[t.reason]:[])}function Je(e,n,t,r){let o=r.resultSize(e.resultPath);if(!Number.isSafeInteger(o)||o<0||o>t)throw new Error(`Vue reference worker ${e.workerId} result is ${o} bytes; limit is ${t} bytes`);let i;try{i=JSON.parse(r.readResult(e.resultPath))}catch(s){throw new Error(`Vue reference worker ${e.workerId} produced invalid JSON`,{cause:s})}if(!V(i)||i.version!==1||i.runId!==n||i.workerId!==e.workerId)throw new Error(`Vue reference worker ${e.workerId} result identity does not match its assignment`);if(!Qe(i.taskIds,e.taskIds))throw new Error(`Vue reference worker ${e.workerId} result task identities do not match its assignment`);if(i.ok===!1)throw typeof i.error!="string"?new Error(`Vue reference worker ${e.workerId} failure payload is malformed`):new Error(`Vue reference worker ${e.workerId} failed: ${i.error}`);if(i.ok!==!0||!ze(i.result))throw new Error(`Vue reference worker ${e.workerId} success payload is malformed`);return i.result}function ze(e){if(!V(e)||!Array.isArray(e.occurrences)||!e.occurrences.every(Xe)||!R(e.skippedReferences)||!V(e.skippedReferenceReasons))return!1;for(let n of["missing-source-file","missing-service-script","no-definition","same-file-definition","unindexed-definition"])if(!R(e.skippedReferenceReasons[n]))return!1;return Array.isArray(e.skippedReferenceSamples)&&e.skippedReferenceSamples.every(Ye)}function Xe(e){return V(e)&&typeof e.sourceFile=="string"&&R(e.sourceLine)&&R(e.sourceStartChar)&&R(e.sourceEndChar)&&typeof e.sourceToken=="string"&&typeof e.definitionFile=="string"&&R(e.symbolId)}function Ye(e){return V(e)&&typeof e.sourceFile=="string"&&R(e.sourceLine)&&R(e.sourceStartChar)&&R(e.sourceEndChar)&&typeof e.token=="string"&&qe(e.reason)}function qe(e){return e==="missing-source-file"||e==="missing-service-script"||e==="no-definition"||e==="same-file-definition"||e==="unindexed-definition"}function R(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function V(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Qe(e,n){return Array.isArray(e)&&e.length===n.length&&e.every((t,r)=>typeof t=="string"&&t===n[r])}function H(e,n){if(!Number.isSafeInteger(n)||n<=0)throw new TypeError(`${e} must be a positive safe integer.`)}function Ze(e){return e instanceof Error?e.message:String(e)}function Y(e){let n=Number(process.env.CODEBASEIQ_AUGMENT_VUE_WORKERS??0),t=Number.isFinite(n)&&n>0?n:1;return Math.max(1,Math.min(e,t))}function en(){let e=Number(process.env.CODEBASEIQ_AUGMENT_VUE_WORKER_TIMEOUT_MS??0);return Number.isFinite(e)&&e>0?e:Ue}function nn(){let e=Number(process.env.CODEBASEIQ_AUGMENT_VUE_WORKER_RESULT_MAX_BYTES??0);return Number.isSafeInteger(e)&&e>0?e:J}function tn(e){let n=rn(),t=[];for(let r of e){let o=q(r),i=Math.max(1,Math.ceil(o/n));for(let s=0;s<i;s++)t.push({taskId:`${t.length}:${r}:${s}`,fileName:r,startOffset:Math.floor(o*s/i),endOffset:s===i-1?Number.POSITIVE_INFINITY:Math.floor(o*(s+1)/i),countFileSkip:s===0})}return t}function rn(){return Number.POSITIVE_INFINITY}function on(e,n){let t=Array.from({length:n},()=>({tasks:[],weight:0})),r=e.map(o=>({task:o,weight:sn(o)})).sort((o,i)=>i.weight-o.weight);for(let o of r){let i=t.reduce((s,u)=>u.weight<s.weight?u:s);i.tasks.push(o.task),i.weight+=o.weight}return t.map(o=>o.tasks).filter(o=>o.length>0)}function sn(e){return Number.isFinite(e.endOffset)?Math.max(1,e.endOffset-e.startOffset):Math.max(1,q(e.fileName)-e.startOffset)}function q(e){try{return K(e).size}catch{return 1}}import{createRequire as un}from"module";import{existsSync as an}from"fs";import{dirname as Q,extname as cn,join as Z,relative as ln,resolve as fn}from"path";import{pathToFileURL as dn}from"url";function gn(e){e.transaction(()=>{e.prepare(`
5
+ DELETE FROM mentions
6
+ WHERE chunk_id IN (
7
+ SELECT c.id
8
+ FROM chunks c
9
+ JOIN documents d ON d.id = c.document_id
10
+ WHERE d.language = 'vue' OR d.relative_path LIKE '%.vue'
11
+ )
12
+ `).run(),e.prepare(`
13
+ DELETE FROM chunks
14
+ WHERE document_id IN (
15
+ SELECT id
16
+ FROM documents
17
+ WHERE language = 'vue' OR relative_path LIKE '%.vue'
18
+ )
19
+ `).run()})()}function ee(e,n){return e.prepare(`
20
+ SELECT relative_path AS relativePath
21
+ FROM documents
22
+ WHERE language = 'vue' OR relative_path LIKE '%.vue'
23
+ ORDER BY relative_path
24
+ `).all().map(r=>fn(n,r.relativePath))}function ne(e,n){let{vueCore:t,ts:r,volarTs:o}=mn(e),{parsed:i,vueOptions:s}=pn(t,r,n),u=Q(n),a=t.createVueLanguagePlugin(r,i.options,s,p=>p),c=Rn(t,r,a),l=hn(u,i),{languageServiceHost:f}=o.createLanguageServiceHost(r,r.sys,c,p=>p,l),g=r.createLanguageService(f);return{ts:r,language:c,languageService:g,fileNames:i.fileNames,configDir:u}}function mn(e){let n=un(dn(Z(e,"package.json")).href);return{vueCore:E(n,"@vue/language-core",e),ts:E(n,"typescript",e),volarTs:E(n,"@volar/typescript",e)}}function pn(e,n,t){let r=n.readConfigFile(t,n.sys.readFile);if(r.error||!r.config)throw new Error(`Failed to read ${t}`);let i=e.createParsedCommandLine(n,n.sys,t).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(r.config,n.sys,Q(t),void 0,t,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function Rn(e,n,t){let r={},o=e.createLanguage([t],new Map,i=>{if(!an(i))return;let s=S(i,{maxBytes:w,inputKind:"Vue language-service source file"});r.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),t.getLanguageId(i)??xn(i))});return r.current=o,o}function hn(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function E(e,n,t){try{return e(n)}catch(r){throw(typeof r=="object"&&r!==null&&"code"in r?r.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${t}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:r}):r}}function te(e,n,t){let r=Sn(e);return o=>{if(!o.name)return null;let i=h(n,o.fileName),s=t.get(o.fileName);if(!s)return null;let u=t.positionAt(s,o.textSpan.start),a=r.get(i);if(!a)return null;let c=a.starts.find(f=>f.line===u.line&&f.displayName===o.name);if(c)return c.symbolId;let l=a.containingByLine.get(u.line);return l&&l.displayName===o.name?l.symbolId:bn(a.starts,u.line,2,o.name)}}function Sn(e){let n=e.prepare(`
25
+ SELECT
26
+ d.relative_path AS relativePath,
27
+ der.start_line AS startLine,
28
+ der.end_line AS endLine,
29
+ der.symbol_id AS symbolId,
30
+ gs.display_name AS displayName
31
+ FROM defn_enclosing_ranges der
32
+ JOIN documents d ON d.id = der.document_id
33
+ JOIN global_symbols gs ON gs.id = der.symbol_id
34
+ ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
35
+ `).all(),t=new Map;for(let r of n){let o=t.get(r.relativePath);o||(o={containingByLine:new Map,starts:[]},t.set(r.relativePath,o)),o.starts.push({line:r.startLine,symbolId:r.symbolId,displayName:r.displayName});for(let i=r.startLine;i<=r.endLine;i++)o.containingByLine.set(i,{symbolId:r.symbolId,displayName:r.displayName})}for(let r of t.values())r.starts.sort((o,i)=>o.line-i.line);return t}function bn(e,n,t,r){let o=0,i=e.length-1;for(;o<=i;){let u=Math.floor((o+i)/2);e[u].line<n?o=u+1:i=u-1}let s=null;for(let u of[i,o]){let a=e[u];if(!a||a.displayName!==r)continue;let c=Math.abs(a.line-n);c>t||(!s||c<s.distance)&&(s={distance:c,symbolId:a.symbolId})}return s?.symbolId??null}function re(e,n,t){let r=ge(n),o=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),i=e.prepare(`
36
+ INSERT OR IGNORE INTO global_symbols (symbol, display_name, kind, documentation)
37
+ VALUES (?, ?, ?, ?)
38
+ `),s=0,u=new Map;return e.transaction(()=>{for(let c of t){let l=h(n,c),f=pe(r.name,r.version,l);i.run(f,"default",7,`Vue component|${l}`);let g=me(o,r,n,c);g&&(s++,u.set(c,g))}})(),{get(c){return u.get(c)??null},syntheticSymbols:s}}function oe(e,n,t,r,o){return e.transaction(()=>(gn(e),yn(e,n,t,r),kn(e,o)))()}function yn(e,n,t,r){let o=e.prepare("SELECT id FROM documents WHERE relative_path = ?"),i=e.prepare(`
39
+ INSERT INTO chunks (document_id, chunk_index, start_line, end_line, occurrences)
40
+ VALUES (?, ?, ?, ?, X'00')
41
+ `),s=e.prepare(`
42
+ INSERT OR IGNORE INTO mentions (chunk_id, symbol_id, role)
43
+ VALUES (?, ?, 1)
44
+ `);for(let u of t){let a=r.get(u);if(!a)continue;let c=h(n,u),l=o.get(c);if(!l)continue;let f=i.run(l.id,-1,0,0);s.run(Number(f.lastInsertRowid),a)}}function ie(e,n){let t=ge(n),r=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=me(r,t,n,i);return o.set(i,s),s}}}function se(e,n,t,r,o){if(e.fileName.endsWith(".vue")){let i=r.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let u=r.language.maps.get(s,i);if(T(u,e.textSpan.start)!==null)return t.get(e.fileName)}return e.fileName.startsWith(o)?t.get(e.fileName):null}return n(e)}function ue(e){let n=new Set,t=[];for(let r of e){let o=ae(r);n.has(o)||(n.add(o),t.push(r))}return t}function ae(e){return[e.sourceFile,e.sourceLine,e.sourceStartChar,e.sourceEndChar,e.symbolId].join(":")}function kn(e,n){let t=In(e,[...new Set(n.map(a=>a.sourceFile))]),r=e.prepare(`
45
+ INSERT INTO chunks (document_id, chunk_index, start_line, end_line, occurrences)
46
+ VALUES (?, ?, ?, ?, X'00')
47
+ `),o=e.prepare(`
48
+ INSERT OR IGNORE INTO mentions (chunk_id, symbol_id, role)
49
+ VALUES (?, ?, 0)
50
+ `),i=new Set,s=0,u=0;for(let a of n){let c=ae(a);if(i.has(c))continue;i.add(c);let l=t.get(a.sourceFile);if(!l)continue;let f=r.run(l,u++,a.sourceLine,a.sourceLine),g=o.run(Number(f.lastInsertRowid),a.symbolId);s+=Number(g.changes)}return s}function*ce(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,t=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),r;for(;r=n.exec(e);){let o=r[0];t.has(o)||(yield{text:o,start:r.index,end:r.index+o.length})}}function le(e,n){for(let[t]of e.toGeneratedLocation(n,r=>!!r.navigation))return t;return null}function T(e,n){let t=e;for(let[r]of t.toSourceLocation(n,o=>!!o.navigation))return r;return null}function Vn(e,n){let t=0,r=e.lineStarts.length-1;for(;t<=r;){let i=Math.floor((t+r)/2);e.lineStarts[i]<=n?t=i+1:r=i-1}let o=Math.max(0,r);return{line:o,character:n-e.lineStarts[o]}}function fe(e,n){return h(e,n).startsWith("node_modules/")}function h(e,n){return ln(e,n).replaceAll("\\","/")}function xn(e){switch(cn(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function de(){let e=new Map;return{get(n){if(e.has(n))return e.get(n)??null;try{let t=S(n,{maxBytes:w,inputKind:"Vue source file"}),r={text:t,lineStarts:vn(t)};return e.set(n,r),r}catch{return e.set(n,null),null}},positionAt:Vn}}function vn(e){let n=[0];for(let t=0;t<e.length;t++)e.charCodeAt(t)===10&&n.push(t+1);return n}function In(e,n){let t=new Map,r=500;for(let o=0;o<n.length;o+=r){let i=n.slice(o,o+r),s=e.prepare(`SELECT id, relative_path AS relativePath FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let u of s)t.set(u.relativePath,u.id)}return t}function ge(e){try{let n=JSON.parse(S(Z(e,"package.json"),{maxBytes:x,inputKind:"project package manifest"}));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function me(e,n,t,r){let o=h(t,r),i=pe(n.name,n.version,o);return e.get(i)?.id??null}function pe(e,n,t){let r=t.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${r}/default.`}async function Ft(e){return U($(),{projectRoot:e.projectRoot,dbPath:e.dbPath}),Fn(e)}async function Fn(e){let n=Se(e.projectRoot,e.tsconfig);if(!En(n))throw new Error(`Vue tsconfig not found at ${n}`);let t=new he(k(e.dbPath));try{let r=ee(t,e.projectRoot),o=Cn(Tn(e.dbPath),"augment-vue-meta.json");return await B({cachePath:o,readFingerprint:()=>An(t,e.projectRoot,e.tsconfig),compute:()=>Ln({db:t,projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,configPath:n,vueFiles:r,onStatus:e.onStatus}),onCacheHit:i=>e.onStatus?.(`Vue references unchanged; reused ${i.resolvedReferences} cached resolved references.`)})}finally{t.close()}}async function Ln(e){let n=re(e.db,e.projectRoot,e.vueFiles),t=z(e.vueFiles)?await X({projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,vueFiles:e.vueFiles}):On(e,n);return Pn(e,n,t)}function Pn(e,n,t){let r=ue(t.occurrences),o=oe(e.db,e.projectRoot,e.vueFiles,n,r),i={vueFiles:e.vueFiles.length,resolvedReferences:r.length,resolvedReferenceSamples:Wn(e.db,r,20),insertedMentions:o,skippedReferences:t.skippedReferences,skippedReferenceReasons:t.skippedReferenceReasons,skippedReferenceSamples:$n(t.skippedReferenceSamples,20),syntheticSymbols:n.syntheticSymbols};return e.onStatus?.(`Resolved ${i.resolvedReferences} Vue references with Volar; inserted ${i.insertedMentions} mentions.`),i}function On(e,n){let t=be({db:e.db,projectRoot:e.projectRoot,configPath:e.configPath,vueSymbolLookup:n});return ye({...t,vueFiles:t.context.fileNames.filter(r=>r.endsWith(".vue"))})}function An(e,n,t){let r=e.prepare(`
51
+ SELECT
52
+ (SELECT COUNT(*) FROM documents) AS documents,
53
+ (SELECT COUNT(*) FROM global_symbols) AS symbols,
54
+ (SELECT COUNT(*) FROM chunks) AS chunks,
55
+ (SELECT COUNT(*) FROM mentions) AS mentions,
56
+ (SELECT COUNT(*) FROM defn_enclosing_ranges) AS ranges,
57
+ (SELECT MAX(id) FROM chunks) AS maxChunkId,
58
+ (SELECT MAX(id) FROM global_symbols) AS maxSymbolId
59
+ `).get();return{version:3,tsconfig:t,files:D(n),db:r}}function Lt(e){let n=Se(e.projectRoot,e.tsconfig),t=new he(k(e.dbPath),{readonly:!0});try{let r=be({db:t,projectRoot:e.projectRoot,configPath:n,vueSymbolLookup:ie(t,e.projectRoot)});return ye({vueFiles:e.vueFiles??[],tasks:e.tasks,...r})}finally{t.close()}}function be(e){let n=de();return{projectRoot:e.projectRoot,context:ne(e.projectRoot,e.configPath),symbolLookup:te(e.db,e.projectRoot,n),vueSymbolLookup:e.vueSymbolLookup,sourceReader:n}}function ye(e){let n=[],t=y(),r=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of r){let i=Nn(e,o);n.push(...i.occurrences),I(t,i)}return{occurrences:n,...t}}function Nn(e,n){let t=e.sourceReader.get(n.fileName);if(!t)return Re(e.projectRoot,n,"missing-source-file");let r=e.context.language.scripts.get(n.fileName),o=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!o)return Re(e.projectRoot,n,"missing-service-script");let i=e.context.language.maps.get(o,r),s=h(e.projectRoot,n.fileName),u=[...ce(t.text)],a={tokens:u.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(u.map(c=>[c.start,c])),tokenTextCounts:Bn(u),processedStarts:new Set};return Dn({...e,fileName:n.fileName,sourceInfo:t,sourceFile:s,map:i,tokenContext:a})}function Dn(e){let n=[],t=y();for(let r of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(r.start)||Mn(e.sourceInfo.text,r.start))continue;let o=le(e.map,r.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(l=>!fe(e.projectRoot,l.fileName));if(!s){C(t,e.sourceReader,e.sourceInfo,e.sourceFile,r,"no-definition");continue}let u=h(e.projectRoot,s.fileName),a=_n(e.sourceFile,r.text,u);if(a){C(t,e.sourceReader,e.sourceInfo,e.sourceFile,r,a);continue}let c=se(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(c===null){C(t,e.sourceReader,e.sourceInfo,e.sourceFile,r,"unindexed-definition");continue}ke(n,e.sourceReader,e.sourceInfo,e.sourceFile,r,u,c),e.tokenContext.processedStarts.add(r.start),Un(n,e,r,o,u,c)}return{occurrences:n,...t}}function Mn(e,n){let t=e.lastIndexOf(`
60
+ `,n-1)+1,r=e.slice(t,n);return/\bfrom\s+['"][^'"]*$/.test(r)||/\bimport\s*\(\s*['"][^'"]*$/.test(r)}function _n(e,n,t){return t===e?"same-file-definition":t.endsWith(".vue")&&n!==t.split("/").at(-1)?.replace(/\.vue$/,"")?"unindexed-definition":null}function Re(e,n,t){let r=y();return n.countFileSkip&&(r.skippedReferences=1,r.skippedReferenceReasons[t]=1,r.skippedReferenceSamples.push({sourceFile:h(e,n.fileName),sourceLine:0,sourceStartChar:0,sourceEndChar:0,token:"",reason:t})),{occurrences:[],...r}}function C(e,n,t,r,o,i){if(e.skippedReferences++,e.skippedReferenceReasons[i]++,e.skippedReferenceSamples.filter(u=>u.reason===i&&u.sourceFile===r).length>=2)return;let s=n.positionAt(t,o.start);e.skippedReferenceSamples.push({sourceFile:r,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+o.text.length,token:o.text,reason:i})}function F(e,n){let t=new Map;for(let i of e){let s=t.get(i.sourceFile)??[];s.push(i),t.set(i.sourceFile,s)}let r=[...t.keys()].sort(),o=[];for(let i=0;o.length<n;i++){let s=!1;for(let u of r){let a=t.get(u)?.[i];if(a&&(o.push(a),s=!0,o.length===n))break}if(!s)break}return o}function jn(e,n){let t=F(e.filter(i=>i.sourceFile!==i.definitionFile),Math.ceil(n/2)),r=new Set(t.map(i=>`${i.sourceFile}:${i.sourceLine}:${i.sourceStartChar}:${i.sourceEndChar}:${i.symbolId}`)),o=F(e.filter(i=>!r.has(`${i.sourceFile}:${i.sourceLine}:${i.sourceStartChar}:${i.sourceEndChar}:${i.symbolId}`)),n-t.length);return[...t,...o]}function $n(e,n){let t=[...new Set(e.map(o=>o.reason))].sort(),r=[];for(let[o,i]of t.entries()){let s=t.length-o,u=Math.ceil((n-r.length)/s);r.push(...F(e.filter(a=>a.reason===i),u))}return r.slice(0,n)}function Wn(e,n,t){let r=e.prepare("SELECT symbol FROM global_symbols WHERE id = ?");return jn(n,t).map(({symbolId:o,...i})=>({...i,definitionSymbol:r.get(o)?.symbol??`symbol-id:${o}`}))}function Un(e,n,t,r,o,i){if(!((n.tokenContext.tokenTextCounts.get(t.text)??0)<=1))for(let s of Hn(n.context.languageService,n.fileName,r+1,n.map,t,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(s))continue;let u=n.tokenContext.tokenByStart.get(s);u&&(ke(e,n.sourceReader,n.sourceInfo,n.sourceFile,u,o,i),n.tokenContext.processedStarts.add(s))}}function ke(e,n,t,r,o,i,s){let u=n.positionAt(t,o.start);e.push({sourceFile:r,sourceLine:u.line,sourceStartChar:u.character,sourceEndChar:u.character+o.text.length,sourceToken:o.text,definitionFile:i,symbolId:s})}function Bn(e){let n=new Map;for(let t of e)n.set(t.text,(n.get(t.text)??0)+1);return n}function Hn(e,n,t,r,o,i){let s=e.getDocumentHighlights?.(n,t,[n])??[],u=[];for(let a of s)if(a.fileName===n)for(let c of a.highlightSpans){let l=Kn(r,c.textSpan.start,i,o.text);l!==null&&u.push(l)}return u}function Kn(e,n,t,r){let o=t.get(n);if(o?.text===r)return o.start;let i=T(e,n);if(i===null)return null;let s=t.get(i);return s?.text===r?s.start:null}export{$ as a,Te as b,U as c,Ft as d,Lt as e};
61
+ //# sourceMappingURL=chunk-5NJPH3QZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-NNOKTMZT.js";function l(d,c,o){if(o.length===0)return[];let e=new Set(o),n=s(d),r=new Set;if(c==="forward")for(let t of e)for(let i of n.get(t)??[])e.has(i)||r.add(i);else for(let[t,i]of n)if(!e.has(t))for(let _ of e)i.has(_)&&r.add(t);return[...r].sort()}export{l as a};
2
- //# sourceMappingURL=chunk-GW6Z3WGY.js.map
1
+ import{a as s}from"./chunk-B2E3HZ2A.js";function l(d,c,o){if(o.length===0)return[];let e=new Set(o),n=s(d),r=new Set;if(c==="forward")for(let t of e)for(let i of n.get(t)??[])e.has(i)||r.add(i);else for(let[t,i]of n)if(!e.has(t))for(let _ of e)i.has(_)&&r.add(t);return[...r].sort()}export{l as a};
2
+ //# sourceMappingURL=chunk-5WXOEJ4G.js.map
@@ -0,0 +1,3 @@
1
+ import{h as d}from"./chunk-4O52YNKL.js";import{createHash as f,randomUUID as m}from"crypto";import{mkdirSync as h,realpathSync as S,renameSync as E,unlinkSync as b,writeFileSync as R}from"fs";import{homedir as x,tmpdir as l,userInfo as k}from"os";import{dirname as _,join as c}from"path";var C=1*1024*1024,I=4*1024*1024;function U(r=process.env){return c(r.XDG_CACHE_HOME||c(x(),".cache"),"codebaseiq")}function F(r){let t=S.native(r).replaceAll("\\","/");return process.platform==="win32"&&(t=t.toLowerCase()),f("sha256").update(t).digest("hex").slice(0,16)}function J(){try{return k().username}catch{return`uid-${typeof process.getuid=="function"?process.getuid():"unknown"}`}}var $=100,y=16,v=y+5,T="/tmp";function w(r,t=l()){let e=`codebaseiq-${f("sha256").update(r).digest("hex").slice(0,8)}`,i=c(t,e);return Buffer.byteLength(i)+1+v<=$?i:c(T,e)}function K(r,t,n=l()){let e=f("sha256").update(`${t}\0${r}`).digest("hex");return process.platform==="win32"?`\\\\.\\pipe\\codebaseiq-sentinel-${e.slice(0,32)}`:c(w(t,n),`${e.slice(0,y)}.sock`)}function g(r,t){return c(r,"sentinel","registry",`${t}.json`)}function j(r,t){return c(r,"sentinel","inbox",`${t}.jsonl`)}function L(r,t){try{let n=JSON.parse(d(g(r,t),"sentinel registry record")),{pid:e,socketPath:i,serviceVersion:a,projectRoot:s,startedAt:o,token:u}=n;if(typeof e=="number"&&Number.isInteger(e)&&e>0&&typeof i=="string"&&i.length>0&&typeof a=="string"&&typeof s=="string"&&typeof o=="string"&&typeof u=="string"&&u.length>0)return{pid:e,socketPath:i,serviceVersion:a,projectRoot:s,startedAt:o,token:u}}catch{}}function H(r,t,n){let e=g(r,t);h(_(e),{recursive:!0});let i=`${e}.tmp-${process.pid}-${m()}`;R(i,`${JSON.stringify(n)}
2
+ `,{mode:384}),E(i,e)}function Y(r,t,n){if(L(r,t)?.pid!==n)return!1;try{return b(g(r,t)),!0}catch{return!1}}function D(r){try{return process.kill(r,0),!0}catch(t){return t.code==="EPERM"}}function M(r,t){let n=Buffer.from(JSON.stringify(r),"utf8");if(n.byteLength>t)throw new Error(`sentinel frame of ${n.byteLength} bytes exceeds the ${t}-byte limit`);let e=Buffer.allocUnsafe(4+n.byteLength);return e.writeUInt32LE(n.byteLength,0),n.copy(e,4),e}function q(r,t,n){let e=Buffer.alloc(0),i=!1,a=s=>{i||(i=!0,n(new Error(s)))};return{push(s){if(!i)for(e=e.byteLength===0?s:Buffer.concat([e,s]);e.byteLength>=4;){let o=e.readUInt32LE(0);if(o>r){a(`sentinel frame of ${o} bytes exceeds the ${r}-byte limit`);return}if(e.byteLength<4+o)return;let u=e.subarray(4,4+o);e=e.subarray(4+o);let p;try{p=JSON.parse(u.toString("utf8"))}catch{a("sentinel frame carried invalid JSON");return}if(t(p),i)return}}}}export{C as a,I as b,U as c,F as d,J as e,K as f,j as g,L as h,H as i,Y as j,D as k,M as l,q as m};
3
+ //# sourceMappingURL=chunk-5XEVXVTK.js.map
@@ -1,4 +1,4 @@
1
- import{a as g}from"./chunk-GTXSJDCO.js";import{h as p}from"./chunk-6CS3UQTN.js";import{a as f}from"./chunk-UZGZB3VB.js";import{d as u,e as _,i as N}from"./chunk-FETNQCFO.js";import{p as d}from"./chunk-O6QTXQPJ.js";import{a as I,z as l}from"./chunk-ADTBPVUZ.js";import{u as b}from"./chunk-BMYOV5GP.js";import{c}from"./chunk-NNJ2KZZG.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=g(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
1
+ import{a as g}from"./chunk-HIEXRDJF.js";import{h as p}from"./chunk-VCL7FK3E.js";import{a as f}from"./chunk-3XFJUWJE.js";import{d as u,e as _,i as N}from"./chunk-AM5SUGHF.js";import{p as d}from"./chunk-JOALNFY3.js";import{a as I,z as l}from"./chunk-RVYLJDXC.js";import{w as b}from"./chunk-PLZXWZHY.js";import{c}from"./chunk-327YK6TB.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=g(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d ON c.document_id = d.id
@@ -32,4 +32,4 @@ import{a as g}from"./chunk-GTXSJDCO.js";import{h as p}from"./chunk-6CS3UQTN.js";
32
32
  WHERE imp_d.relative_path = ?
33
33
  AND m.role = 2
34
34
  ORDER BY def_d.relative_path, gs.symbol`,t).filter(n=>!e.isIgnored(n.importer));if(o.length>0){let n=r.semantic===!1?[]:p(e,t);return o.map(i=>({symbol:i.symbol,shortName:u(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||n.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function E(e,t){let r=p(e,t);return r.length>0?r.map(s=>{let o=y(s.importedName,s.localName,s.kind);return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:s.kind==="side-effect"?!0:s.isUsed}}):null}function S(e,t){let r=A(t,b(e,t));return d(e,t).map(s=>{let o=y(s.importedName,s.localName,s.kind),n=s.kind==="side-effect"||v(t,s)||r.has(s.localName??s.importedName)?!0:s.used;return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:n}})}function A(e,t){let r=new Set;if(l(e)!=="python")return r;let s=/(?:^|\n)\s*__all__\s*(?:\+?=)\s*[[(]([\s\S]*?)[\])]/g;for(let o of t.matchAll(s)){let n=o[1]??"";for(let i of n.matchAll(/(['"])([A-Za-z_]\w*)\1/g))r.add(i[2])}return r}function v(e,t){if(l(e)!=="rust"||t.used||t.kind==="side-effect")return!1;let r=t.localName??t.importedName;return r==="_"||/^[A-Z]/.test(r)}function y(e,t,r){return r==="namespace"&&e==="*"&&t?`* as ${t}`:r==="default"&&t?`default as ${t}`:r==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function $(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{Y as a,Z as b,G as c};
35
- //# sourceMappingURL=chunk-RR7SX44N.js.map
35
+ //# sourceMappingURL=chunk-6OVNYYY4.js.map
@@ -1,8 +1,8 @@
1
- import{a as D,c as L,i as H,k as O}from"./chunk-L4NRUAGJ.js";import{j as T,o as B}from"./chunk-UDS562V4.js";import{d as A}from"./chunk-NMTSZXCL.js";import{c as _}from"./chunk-7FND7D7N.js";import{d as u,e as F}from"./chunk-FETNQCFO.js";import{a as E}from"./chunk-O6QTXQPJ.js";var J=5;function le(e,n={}){let{base:o="HEAD",minContainment:a=.7,minCallees:l=3,minSiteCoverage:t=.4,maxHelpers:p=Number.POSITIVE_INFINITY,limit:c=20,scanLimit:g}=n,h=n.semantic!==!1,s=n.diffPlan??L(e,{base:o}),r={available:s.note!==D,base:o,changedFiles:s.changedFiles,helpersChecked:0,skipped:[],findings:[],...s.note?{note:s.note}:{}};if(!r.available||s.changedFiles.length===0)return r;let k=new _(e),P=new Set(s.changedFiles),$=new Map(s.renamedFiles.map(i=>[i.to,i.from]));if(n.baseContentAt&&n.baseContentResultAt)throw new Error("Specify only one of baseContentAt or baseContentResultAt.");let z=n.baseContentResultAt?n.baseContentResultAt:n.baseContentAt?Q(n.baseContentAt):H({projectRoot:e.config.projectRoot,base:o,preloadPaths:O(s)}),f=Z(k,P,$,z);if(f.unavailable)return r.available=!1,r.note=`Base content unavailable: ${f.unavailable.reason}`,r;if(f.definitions.length===0)return r;let I=f.definitions.slice(0,p);f.definitions.length>p&&(r.note=`helper scoring capped at ${p} of ${f.definitions.length} new symbols`);let d=k.calleeEvidenceMap(I,{semantic:h}),q=I.filter(i=>!d.incompleteSymbolIds.has(i.symbolId)&&!d.unavailableSymbolIds.has(i.symbolId)).map(i=>({def:i,callees:B((d.rows.get(i.symbolId)??[]).map(m=>m.symbol))}));for(let i of I)!d.incompleteSymbolIds.has(i.symbolId)&&!d.unavailableSymbolIds.has(i.symbolId)||r.skipped.push({helperShortName:u(i.symbol),helperFile:i.relativePath,reason:"compiler-resolved callee evidence is incomplete or unavailable \u2014 unsafe to score"});let V=T(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,l),scanLimit:g,semantic:h}),M);for(let{def:i,callees:m}of q){let b=u(i.symbol);if(m.size<l){r.skipped.push({helperShortName:b,helperFile:i.relativePath,reason:`fewer than ${l} meaningful callees \u2014 too small to score`});continue}let w=G(),N=Y(m,w);if(N===0){r.skipped.push({helperShortName:b,helperFile:i.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let y=ee(e,i.symbolId);if(y.length===0){r.skipped.push({helperShortName:b,helperFile:i.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}r.helpersChecked+=1;let v=K({candidateIndex:w,changed:P,helperCallees:m,helperFile:i.relativePath,helperSymbol:i.symbol,minContainment:a,minSiteCoverage:t,migratedFiles:y});v.length!==0&&(v.sort((C,S)=>j(S.migrationScope)-j(C.migrationScope)||S.containment-C.containment||S.siteCoverage-C.siteCoverage||C.file.localeCompare(S.file)),r.findings.push({helperSymbol:i.symbol,helperShortName:b,helperFile:i.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:m.size,specificHelperCalleeCount:N,migratedFiles:y.sort(),leftovers:v.slice(0,J)}))}return r.findings.sort((i,m)=>(m.leftovers[0]?.containment??0)-(i.leftovers[0]?.containment??0)||i.helperFile.localeCompare(m.helperFile)),r.findings=r.findings.slice(0,c),r}function K(e){let n=[],o=U(e.helperSymbol,e.helperFile,e.migratedFiles),a=new Set;for(let l of e.helperCallees)for(let t of e.candidateIndex.candidateIndexesByCallee.get(l)??[])a.add(t);for(let l of a){let t=e.candidateIndex.corpus[l];if(t.symbol===e.helperSymbol||e.changed.has(t.file)||t.callees.has(e.helperSymbol))continue;let p=A(e.helperCallees,t.callees);if(p<e.minContainment)continue;let c=[...e.helperCallees].filter(s=>t.callees.has(s)),g=t.callees.size===0?0:c.length/t.callees.size;if(g<e.minSiteCoverage||!c.some(s=>(e.candidateIndex.docFreq.get(s)??0)<=e.candidateIndex.ubiquityThreshold))continue;let h=W(o,t.symbol,t.file);n.push({symbol:t.symbol,shortName:u(t.symbol),file:t.file,...h,containment:p,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,t.callees.size-c.length),sharedCallees:c.map(u).sort()})}return n}function j(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,n,o){let a=new Set([...R(n),...x(F(e))]);for(let l of o)for(let t of R(l))a.add(t);return a}function W(e,n,o){let a=new Set([...R(o),...x(F(n))]);if(e.size===0||a.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let l=[...a].filter(t=>e.has(t)).sort();return l.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${l.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function R(e){return x(e.replace(/\.[^.]+$/,""))}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1&&!X.has(n))}function Y(e,n){let o=0;for(let a of e)(n.docFreq.get(a)??0)<=n.ubiquityThreshold&&(o+=1);return o}function Z(e,n,o,a){let l=[];for(let t of e.productionCallableDefinitions({files:[...n],requireFunctionLikeSymbol:!0})){if(!n.has(t.relativePath))continue;let p=o.get(t.relativePath)??t.relativePath,c=a(p);if(c.state==="unavailable")return{definitions:[],unavailable:c};(c.state==="absent"||!new RegExp(`\\b${E(t.leaf)}\\b`).test(c.content))&&l.push(t)}return{definitions:l}}function Q(e){return n=>{let o=e(n);return o===null?{state:"absent"}:{state:"present",content:o}}}function ee(e,n){return e.all(`SELECT DISTINCT ref_d.relative_path
1
+ import{a as D,c as L,i as H,k as O}from"./chunk-S5SKXCND.js";import{j as T,o as B}from"./chunk-A7XQT7MH.js";import{d as A}from"./chunk-NMTSZXCL.js";import{c as _}from"./chunk-NK76RSB6.js";import{d as u,e as F}from"./chunk-AM5SUGHF.js";import{a as E}from"./chunk-JOALNFY3.js";var J=5;function le(e,n={}){let{base:o="HEAD",minContainment:a=.7,minCallees:l=3,minSiteCoverage:t=.4,maxHelpers:p=Number.POSITIVE_INFINITY,limit:c=20,scanLimit:g}=n,h=n.semantic!==!1,s=n.diffPlan??L(e,{base:o}),r={available:s.note!==D,base:o,changedFiles:s.changedFiles,helpersChecked:0,skipped:[],findings:[],...s.note?{note:s.note}:{}};if(!r.available||s.changedFiles.length===0)return r;let k=new _(e),P=new Set(s.changedFiles),$=new Map(s.renamedFiles.map(i=>[i.to,i.from]));if(n.baseContentAt&&n.baseContentResultAt)throw new Error("Specify only one of baseContentAt or baseContentResultAt.");let z=n.baseContentResultAt?n.baseContentResultAt:n.baseContentAt?Q(n.baseContentAt):H({projectRoot:e.config.projectRoot,base:o,preloadPaths:O(s)}),f=Z(k,P,$,z);if(f.unavailable)return r.available=!1,r.note=`Base content unavailable: ${f.unavailable.reason}`,r;if(f.definitions.length===0)return r;let I=f.definitions.slice(0,p);f.definitions.length>p&&(r.note=`helper scoring capped at ${p} of ${f.definitions.length} new symbols`);let d=k.calleeEvidenceMap(I,{semantic:h}),q=I.filter(i=>!d.incompleteSymbolIds.has(i.symbolId)&&!d.unavailableSymbolIds.has(i.symbolId)).map(i=>({def:i,callees:B((d.rows.get(i.symbolId)??[]).map(m=>m.symbol))}));for(let i of I)!d.incompleteSymbolIds.has(i.symbolId)&&!d.unavailableSymbolIds.has(i.symbolId)||r.skipped.push({helperShortName:u(i.symbol),helperFile:i.relativePath,reason:"compiler-resolved callee evidence is incomplete or unavailable \u2014 unsafe to score"});let V=T(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,l),scanLimit:g,semantic:h}),M);for(let{def:i,callees:m}of q){let b=u(i.symbol);if(m.size<l){r.skipped.push({helperShortName:b,helperFile:i.relativePath,reason:`fewer than ${l} meaningful callees \u2014 too small to score`});continue}let w=G(),N=Y(m,w);if(N===0){r.skipped.push({helperShortName:b,helperFile:i.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let y=ee(e,i.symbolId);if(y.length===0){r.skipped.push({helperShortName:b,helperFile:i.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}r.helpersChecked+=1;let v=K({candidateIndex:w,changed:P,helperCallees:m,helperFile:i.relativePath,helperSymbol:i.symbol,minContainment:a,minSiteCoverage:t,migratedFiles:y});v.length!==0&&(v.sort((C,S)=>j(S.migrationScope)-j(C.migrationScope)||S.containment-C.containment||S.siteCoverage-C.siteCoverage||C.file.localeCompare(S.file)),r.findings.push({helperSymbol:i.symbol,helperShortName:b,helperFile:i.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:m.size,specificHelperCalleeCount:N,migratedFiles:y.sort(),leftovers:v.slice(0,J)}))}return r.findings.sort((i,m)=>(m.leftovers[0]?.containment??0)-(i.leftovers[0]?.containment??0)||i.helperFile.localeCompare(m.helperFile)),r.findings=r.findings.slice(0,c),r}function K(e){let n=[],o=U(e.helperSymbol,e.helperFile,e.migratedFiles),a=new Set;for(let l of e.helperCallees)for(let t of e.candidateIndex.candidateIndexesByCallee.get(l)??[])a.add(t);for(let l of a){let t=e.candidateIndex.corpus[l];if(t.symbol===e.helperSymbol||e.changed.has(t.file)||t.callees.has(e.helperSymbol))continue;let p=A(e.helperCallees,t.callees);if(p<e.minContainment)continue;let c=[...e.helperCallees].filter(s=>t.callees.has(s)),g=t.callees.size===0?0:c.length/t.callees.size;if(g<e.minSiteCoverage||!c.some(s=>(e.candidateIndex.docFreq.get(s)??0)<=e.candidateIndex.ubiquityThreshold))continue;let h=W(o,t.symbol,t.file);n.push({symbol:t.symbol,shortName:u(t.symbol),file:t.file,...h,containment:p,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,t.callees.size-c.length),sharedCallees:c.map(u).sort()})}return n}function j(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,n,o){let a=new Set([...R(n),...x(F(e))]);for(let l of o)for(let t of R(l))a.add(t);return a}function W(e,n,o){let a=new Set([...R(o),...x(F(n))]);if(e.size===0||a.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let l=[...a].filter(t=>e.has(t)).sort();return l.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${l.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function R(e){return x(e.replace(/\.[^.]+$/,""))}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1&&!X.has(n))}function Y(e,n){let o=0;for(let a of e)(n.docFreq.get(a)??0)<=n.ubiquityThreshold&&(o+=1);return o}function Z(e,n,o,a){let l=[];for(let t of e.productionCallableDefinitions({files:[...n],requireFunctionLikeSymbol:!0})){if(!n.has(t.relativePath))continue;let p=o.get(t.relativePath)??t.relativePath,c=a(p);if(c.state==="unavailable")return{definitions:[],unavailable:c};(c.state==="absent"||!new RegExp(`\\b${E(t.leaf)}\\b`).test(c.content))&&l.push(t)}return{definitions:l}}function Q(e){return n=>{let o=e(n);return o===null?{state:"absent"}:{state:"present",content:o}}}function ee(e,n){return e.all(`SELECT DISTINCT ref_d.relative_path
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents ref_d ON c.document_id = ref_d.id
5
5
  WHERE m.symbol_id = ?
6
6
  AND m.role != 1
7
7
  ${e.pathExclusionsFor("ref_d")}`,n).map(a=>a.relative_path)}export{le as a};
8
- //# sourceMappingURL=chunk-ZV3JV5G5.js.map
8
+ //# sourceMappingURL=chunk-6SDEQTVY.js.map
@@ -1,2 +1,2 @@
1
- import{k as o}from"./chunk-WE5RZHZ7.js";var f=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function l(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let t=r;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!f.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function c(r,t){return r.version===t.version&&r.pid===t.pid&&r.platform===t.platform&&r.startToken===t.startToken}import{execFileSync as m}from"child_process";import{platform as d}from"os";var s=new WeakMap,u=1e3,i=16*1024;function g(r,t=P){if(!Number.isSafeInteger(r)||r<=0)return null;if(r===process.pid){let n=s.get(t);if(n)return n}try{let n=p(r,t);if(!n)return null;let e={version:1,pid:r,platform:t.platform,startToken:n};return r===process.pid&&s.set(t,e),e}catch{return null}}function p(r,t){if(t.platform==="linux"||t.platform==="android")return y(t.readFile(`/proc/${r}/stat`));if(t.platform==="win32"){let n=`([DateTimeOffset](Get-Process -Id ${r} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return a(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",n]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?a(t.run("ps",["-p",String(r),"-o","lstart="])):null}function y(r){let t=r.lastIndexOf(")");if(t<0)return null;let e=r.slice(t+1).trim().split(/\s+/)[19];return e&&/^\d+$/.test(e)?e:null}function a(r){let t=r.trim();return t===""?null:t}var P={platform:d(),readFile(r){return o(r,{maxBytes:i,inputKind:"process identity pseudo-file"})},run(r,t){return m(r,[...t],{encoding:"utf8",timeout:u,maxBuffer:i,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0})}};function k(){return performance.now()}export{l as a,c as b,g as c,k as d};
2
- //# sourceMappingURL=chunk-EF2R3WNQ.js.map
1
+ import{k as o}from"./chunk-4O52YNKL.js";var f=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function l(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let t=r;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!f.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function c(r,t){return r.version===t.version&&r.pid===t.pid&&r.platform===t.platform&&r.startToken===t.startToken}import{execFileSync as m}from"child_process";import{platform as d}from"os";var s=new WeakMap,u=1e3,i=16*1024;function g(r,t=P){if(!Number.isSafeInteger(r)||r<=0)return null;if(r===process.pid){let n=s.get(t);if(n)return n}try{let n=p(r,t);if(!n)return null;let e={version:1,pid:r,platform:t.platform,startToken:n};return r===process.pid&&s.set(t,e),e}catch{return null}}function p(r,t){if(t.platform==="linux"||t.platform==="android")return y(t.readFile(`/proc/${r}/stat`));if(t.platform==="win32"){let n=`([DateTimeOffset](Get-Process -Id ${r} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return a(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",n]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?a(t.run("ps",["-p",String(r),"-o","lstart="])):null}function y(r){let t=r.lastIndexOf(")");if(t<0)return null;let e=r.slice(t+1).trim().split(/\s+/)[19];return e&&/^\d+$/.test(e)?e:null}function a(r){let t=r.trim();return t===""?null:t}var P={platform:d(),readFile(r){return o(r,{maxBytes:i,inputKind:"process identity pseudo-file"})},run(r,t){return m(r,[...t],{encoding:"utf8",timeout:u,maxBuffer:i,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0})}};function k(){return performance.now()}function w(){return Date.now()}export{l as a,c as b,g as c,k as d,w as e};
2
+ //# sourceMappingURL=chunk-6URCE5QY.js.map