scip-query 0.23.0 → 0.24.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 (432) hide show
  1. package/CHANGELOG.md +244 -1
  2. package/README.md +2 -0
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/by-kind-H3P6BR5G.js +2 -0
  5. package/dist/call-graph-VTG2CUOQ.js +2 -0
  6. package/dist/call-graph-evidence-BociKRpF.d.ts +19 -0
  7. package/dist/chunk-2BMSSRBH.js +2 -0
  8. package/dist/{chunk-WIWY3CRX.js → chunk-2GJSD5GY.js} +2 -2
  9. package/dist/{chunk-W5OXRYGE.js → chunk-2M2LSIMY.js} +3 -3
  10. package/dist/{chunk-2LDBDR6J.js → chunk-2N6WBNDC.js} +2 -2
  11. package/dist/{chunk-HOENASQM.js → chunk-2USA3S3P.js} +2 -2
  12. package/dist/chunk-2VAHDDLM.js +133 -0
  13. package/dist/chunk-2XWIUW5Z.js +455 -0
  14. package/dist/chunk-3D4BOXW6.js +20 -0
  15. package/dist/{chunk-BBCIS4DX.js → chunk-3LO4FST5.js} +2 -2
  16. package/dist/chunk-3WTY4LP2.js +3 -0
  17. package/dist/{chunk-UXW33INU.js → chunk-3Z5AMSK6.js} +2 -2
  18. package/dist/{chunk-4ILJCCXV.js → chunk-44IETFOU.js} +2 -2
  19. package/dist/chunk-4FR6GQIT.js +2 -0
  20. package/dist/chunk-4KBTHJLP.js +2 -0
  21. package/dist/{chunk-SSK6LDPC.js → chunk-5BIKR67W.js} +2 -2
  22. package/dist/{chunk-IHGQTTVW.js → chunk-5PROPLHI.js} +2 -2
  23. package/dist/{chunk-TA3QKLLU.js → chunk-5V7EPTII.js} +2 -2
  24. package/dist/{chunk-JS4PGXMV.js → chunk-62LPZCBQ.js} +2 -2
  25. package/dist/{chunk-DBRSYFXR.js → chunk-64O2JHQA.js} +2 -2
  26. package/dist/chunk-6D4F5VWG.js +10 -0
  27. package/dist/{chunk-BHVUJOCQ.js → chunk-6ERFBC3X.js} +2 -2
  28. package/dist/{chunk-ILTDAWEF.js → chunk-6ILKOOGH.js} +2 -2
  29. package/dist/chunk-6MFXCMZC.js +2 -0
  30. package/dist/chunk-6O7FACKB.js +2 -0
  31. package/dist/{chunk-XDQMU3BT.js → chunk-6TS3KOXR.js} +2 -2
  32. package/dist/{chunk-YI2AWIHC.js → chunk-76QOU4PK.js} +2 -2
  33. package/dist/{chunk-7CYG22FH.js → chunk-7DUI77BN.js} +2 -2
  34. package/dist/{chunk-IDFEUFKS.js → chunk-7F7T6DCR.js} +2 -2
  35. package/dist/chunk-7H6VHWWJ.js +2 -0
  36. package/dist/chunk-7HXT6YLU.js +5 -0
  37. package/dist/{chunk-DIRJWYBM.js → chunk-7R4V5ES6.js} +4 -4
  38. package/dist/{chunk-SZHGTCPP.js → chunk-7RIRIADH.js} +2 -2
  39. package/dist/chunk-7ZLWLOGT.js +2 -0
  40. package/dist/{chunk-M2O5NY6W.js → chunk-A4WEAK35.js} +2 -2
  41. package/dist/chunk-AADQLOQ4.js +38 -0
  42. package/dist/{chunk-OLNV6I6U.js → chunk-AN76MGUE.js} +2 -2
  43. package/dist/chunk-ANLNLY66.js +2 -0
  44. package/dist/chunk-ATXPTSEI.js +81 -0
  45. package/dist/{chunk-YPWBKGFU.js → chunk-AX7IDVFT.js} +2 -2
  46. package/dist/chunk-B7MPDEAK.js +3 -0
  47. package/dist/chunk-BBB5FBX4.js +2 -0
  48. package/dist/{chunk-6I6L7Z62.js → chunk-BHKK5RJY.js} +2 -2
  49. package/dist/chunk-BJWFVAA5.js +2 -0
  50. package/dist/{chunk-UHFYCMZO.js → chunk-BKZYTLGE.js} +2 -2
  51. package/dist/chunk-BL6DCHQP.js +2 -0
  52. package/dist/{chunk-TEBQMNVI.js → chunk-BOW7SSQH.js} +2 -2
  53. package/dist/{chunk-OWOOWNJ5.js → chunk-C4RHHCKL.js} +2 -2
  54. package/dist/{chunk-N2ZSIIGR.js → chunk-C7C6AKAT.js} +6 -6
  55. package/dist/chunk-CD6M6LS2.js +16 -0
  56. package/dist/chunk-CFE6PSG6.js +2 -0
  57. package/dist/{chunk-6V5CNXL6.js → chunk-CFNIGQMT.js} +2 -2
  58. package/dist/{chunk-GUFSG5TX.js → chunk-CKBUBRYD.js} +2 -2
  59. package/dist/{chunk-4WNW27SX.js → chunk-CZW5MZ5B.js} +2 -2
  60. package/dist/chunk-DBBZ63ZX.js +2 -0
  61. package/dist/{chunk-HCXEQRFF.js → chunk-DBN7DMJB.js} +2 -2
  62. package/dist/{chunk-6PQNKL3G.js → chunk-DUULLZHZ.js} +2 -2
  63. package/dist/{chunk-Z4CDXYNQ.js → chunk-DV5Y5NOS.js} +2 -2
  64. package/dist/chunk-DZOIKCTM.js +3 -0
  65. package/dist/chunk-E4PKTOL3.js +2 -0
  66. package/dist/{chunk-EG2CPZMJ.js → chunk-E65ELFKU.js} +2 -2
  67. package/dist/{chunk-CNO7TOKL.js → chunk-E7QR35ST.js} +2 -2
  68. package/dist/{chunk-3D3QG236.js → chunk-EFSXAINW.js} +2 -2
  69. package/dist/{chunk-IL676XCC.js → chunk-EHVEIEQN.js} +2 -2
  70. package/dist/{chunk-BE7ZZTMC.js → chunk-EHYDXE3Z.js} +2 -2
  71. package/dist/{chunk-LXABEJX3.js → chunk-EP63Y6LD.js} +2 -2
  72. package/dist/{chunk-QU5XRYB5.js → chunk-EPX6NQN6.js} +2 -2
  73. package/dist/{chunk-FESCRNVV.js → chunk-ETC674NS.js} +2 -2
  74. package/dist/{chunk-OSSESPDX.js → chunk-F5GSBHC6.js} +2 -2
  75. package/dist/chunk-FH3DGXC6.js +2 -0
  76. package/dist/{chunk-YEN6CYC7.js → chunk-FI7VGOR4.js} +2 -2
  77. package/dist/chunk-FJF6VO2P.js +2 -0
  78. package/dist/{chunk-FRUSVINH.js → chunk-FLMTCX5R.js} +2 -2
  79. package/dist/chunk-FVFDOIM3.js +2 -0
  80. package/dist/{chunk-PJFGPYTU.js → chunk-G2HU5WRN.js} +2 -2
  81. package/dist/{chunk-FIQRSHVM.js → chunk-G4ALYS4J.js} +2 -2
  82. package/dist/{chunk-UVGEWT4Y.js → chunk-G56I7K4W.js} +2 -2
  83. package/dist/{chunk-WOIKCX6A.js → chunk-GC4DG2V5.js} +2 -2
  84. package/dist/chunk-GG45PK4S.js +4 -0
  85. package/dist/{chunk-XBGWL66K.js → chunk-GHNPACNP.js} +2 -2
  86. package/dist/{chunk-IICPE7B2.js → chunk-GINH3YQU.js} +2 -2
  87. package/dist/{chunk-HLZTEXRA.js → chunk-GTZZVLKJ.js} +2 -2
  88. package/dist/chunk-GXXW5ZHH.js +2 -0
  89. package/dist/{chunk-B5D7QPBE.js → chunk-HAXXKRTD.js} +2 -2
  90. package/dist/chunk-HEZWBAZY.js +2 -0
  91. package/dist/chunk-HMEWLMML.js +2 -0
  92. package/dist/{chunk-QUU5OBVK.js → chunk-HOBOVYPO.js} +2 -2
  93. package/dist/{chunk-XGZEP6GR.js → chunk-HRFQ6GW5.js} +2 -2
  94. package/dist/{chunk-MPQ4OTBM.js → chunk-HX4X7KG3.js} +2 -2
  95. package/dist/{chunk-FDLOBR6P.js → chunk-HYT2R7LX.js} +2 -2
  96. package/dist/chunk-IKQVBVQL.js +40 -0
  97. package/dist/chunk-J6GLBBRK.js +4 -0
  98. package/dist/{chunk-ZTI4SBFV.js → chunk-J7A4PWFX.js} +2 -2
  99. package/dist/{chunk-OSR2GEHQ.js → chunk-JCSAZ35V.js} +2 -2
  100. package/dist/{chunk-ESIQ66Z7.js → chunk-JDU2IV3A.js} +2 -2
  101. package/dist/chunk-JFMI5SGB.js +4 -0
  102. package/dist/{chunk-W6STWDQI.js → chunk-JJP37RGX.js} +2 -2
  103. package/dist/chunk-JZ2A7LDM.js +5 -0
  104. package/dist/chunk-KNLQGXVH.js +80 -0
  105. package/dist/chunk-KVQCECPR.js +2 -0
  106. package/dist/{chunk-SQXRS7BG.js → chunk-KXXORBZ2.js} +2 -2
  107. package/dist/{chunk-DIUFNHRJ.js → chunk-L5KYH6U3.js} +2 -2
  108. package/dist/chunk-L6XHYJPZ.js +21 -0
  109. package/dist/{chunk-2GRUZAQF.js → chunk-L7KTFEAV.js} +2 -2
  110. package/dist/{chunk-QBE3YX64.js → chunk-LDXHR5EL.js} +2 -2
  111. package/dist/{chunk-HEHOQQKH.js → chunk-MHGDSBFX.js} +2 -2
  112. package/dist/{chunk-PWWAJSKV.js → chunk-MLQVVDG3.js} +2 -2
  113. package/dist/chunk-MOKUWRHO.js +3 -0
  114. package/dist/{chunk-VQILFTEH.js → chunk-MPYAPMNE.js} +2 -2
  115. package/dist/{chunk-UICY4GTQ.js → chunk-MV6SPXCR.js} +2 -2
  116. package/dist/{chunk-HYO3NP5Q.js → chunk-MZPXPSUJ.js} +2 -2
  117. package/dist/{chunk-VZRNID6A.js → chunk-N55KIE46.js} +2 -2
  118. package/dist/{chunk-YF5IB2LF.js → chunk-NB4D3BNM.js} +2 -2
  119. package/dist/{chunk-VVZSBTSU.js → chunk-NGKBOT6G.js} +2 -2
  120. package/dist/{chunk-NJITK2GP.js → chunk-NJGKXKQF.js} +2 -2
  121. package/dist/chunk-NJQISBL4.js +8 -0
  122. package/dist/{chunk-T4N4P2K5.js → chunk-NJT3ZEKY.js} +2 -2
  123. package/dist/{chunk-FPYLNQPT.js → chunk-NKMKZP6A.js} +2 -2
  124. package/dist/chunk-NODFZ6ED.js +2 -0
  125. package/dist/{chunk-BRV7PIFF.js → chunk-NSM5IEVW.js} +2 -2
  126. package/dist/{chunk-3WR4E3A3.js → chunk-NTGUVNR2.js} +2 -2
  127. package/dist/{chunk-VUPHCS7Y.js → chunk-NU3KFF2O.js} +2 -2
  128. package/dist/chunk-NWLVNU66.js +557 -0
  129. package/dist/{chunk-D4N5SQ2M.js → chunk-NYKZMCRC.js} +2 -2
  130. package/dist/{chunk-VNLGKHS6.js → chunk-O6BUXZEH.js} +2 -2
  131. package/dist/chunk-ODPDP7A4.js +3 -0
  132. package/dist/{chunk-JTQVMR42.js → chunk-OHIV323X.js} +2 -2
  133. package/dist/chunk-OIAPEKMT.js +3 -0
  134. package/dist/chunk-OIOC5EHF.js +3 -0
  135. package/dist/{chunk-YBGKCQIS.js → chunk-ONPPQM4G.js} +2 -2
  136. package/dist/{chunk-64BFSI5I.js → chunk-OUHEZBYI.js} +2 -2
  137. package/dist/{chunk-L6PJPETJ.js → chunk-OVGYW7UD.js} +2 -2
  138. package/dist/{chunk-I55I7XXP.js → chunk-OYKU4B3Y.js} +2 -2
  139. package/dist/{chunk-J66VOFW6.js → chunk-POBJ6FR2.js} +2 -2
  140. package/dist/{chunk-CWFP7GM5.js → chunk-PSZPMMWN.js} +2 -2
  141. package/dist/chunk-PXTRBKRK.js +3 -0
  142. package/dist/{chunk-HKGFPJ4T.js → chunk-Q5JRIHT3.js} +2 -2
  143. package/dist/{chunk-P42EIXTA.js → chunk-Q7ATHARX.js} +2 -2
  144. package/dist/{chunk-JYR66JN5.js → chunk-Q7CSKIDM.js} +2 -2
  145. package/dist/{chunk-TRNAEQ6P.js → chunk-QBQE7ZJ5.js} +2 -2
  146. package/dist/{chunk-DULC3QFP.js → chunk-QH22UIXP.js} +2 -2
  147. package/dist/chunk-QXCKQTKR.js +60 -0
  148. package/dist/{chunk-ODDUPDP7.js → chunk-RBAD4GJ2.js} +5 -5
  149. package/dist/{chunk-IZDPJ2QI.js → chunk-RMDPFPNW.js} +2 -2
  150. package/dist/chunk-ROPJDEJZ.js +4 -0
  151. package/dist/{chunk-EKV5HX33.js → chunk-RVZC6TJE.js} +2 -2
  152. package/dist/{chunk-XFA4SSO3.js → chunk-S4QZBKSR.js} +2 -2
  153. package/dist/{chunk-D2DHWI3D.js → chunk-SCPMZ73U.js} +2 -2
  154. package/dist/{chunk-PZL5T7SU.js → chunk-SIAP5RGI.js} +2 -2
  155. package/dist/{chunk-7IWV2EG3.js → chunk-SIX4RFR3.js} +2 -2
  156. package/dist/{chunk-DYGHBZ2N.js → chunk-SKKXTABJ.js} +2 -2
  157. package/dist/{chunk-F7DY272B.js → chunk-SSRFUQBD.js} +2 -2
  158. package/dist/chunk-SYVJEEUJ.js +3 -0
  159. package/dist/{chunk-FGA2U4OR.js → chunk-T3CZAZSI.js} +2 -2
  160. package/dist/chunk-T3I6NHBH.js +2 -0
  161. package/dist/{chunk-EQHFIL6T.js → chunk-T6DWDI5E.js} +2 -2
  162. package/dist/chunk-T6HRIROJ.js +7 -0
  163. package/dist/{chunk-GSP44ENC.js → chunk-TAA7HXHE.js} +2 -2
  164. package/dist/{chunk-BQGB4HBD.js → chunk-TJ2JQYT3.js} +2 -2
  165. package/dist/{chunk-XPDPNWTQ.js → chunk-TULNMD5T.js} +19 -19
  166. package/dist/chunk-U2FPY5XA.js +3 -0
  167. package/dist/chunk-U3SXIMII.js +38 -0
  168. package/dist/{chunk-NOGJXYFO.js → chunk-U6KCHXJ4.js} +2 -2
  169. package/dist/chunk-UH3XSKS5.js +9 -0
  170. package/dist/{chunk-AFHTBORT.js → chunk-UIFUZVCC.js} +2 -2
  171. package/dist/{chunk-7BWFZPPZ.js → chunk-UXKURIVI.js} +2 -2
  172. package/dist/{chunk-2E7CX53V.js → chunk-V2RBODHL.js} +2 -2
  173. package/dist/{chunk-KLFEXGQA.js → chunk-VBKUWB6N.js} +2 -2
  174. package/dist/{chunk-WUN6KBHV.js → chunk-VBV6ALJE.js} +2 -2
  175. package/dist/{chunk-GZIUDL6G.js → chunk-VDGFWCQV.js} +2 -2
  176. package/dist/chunk-VDSDOEWF.js +2 -0
  177. package/dist/{chunk-WDNVY4E7.js → chunk-VZPWVCLN.js} +2 -2
  178. package/dist/chunk-WDSFQDPN.js +2 -0
  179. package/dist/{chunk-CIYLO6SI.js → chunk-WFA35BGR.js} +2 -2
  180. package/dist/{chunk-LMZ5PRUV.js → chunk-WLMP3OCW.js} +2 -2
  181. package/dist/{chunk-3SVF22I5.js → chunk-WSA52GOR.js} +2 -2
  182. package/dist/{chunk-VMPRET3I.js → chunk-X3YVZAKZ.js} +2 -2
  183. package/dist/{chunk-GYIZ4NXB.js → chunk-X6OGVFIT.js} +2 -2
  184. package/dist/{chunk-6HFCYNYE.js → chunk-XKXTR6ZI.js} +2 -2
  185. package/dist/{chunk-6VVV4WRR.js → chunk-Y5DFAW5W.js} +2 -2
  186. package/dist/chunk-YSYPDRD5.js +3 -0
  187. package/dist/{chunk-TQPCBMWT.js → chunk-ZFVPWH62.js} +2 -2
  188. package/dist/chunk-ZGIHTH27.js +2 -0
  189. package/dist/{chunk-OR2E3AGZ.js → chunk-ZGIQN2SX.js} +2 -2
  190. package/dist/{chunk-WNTFFKAX.js → chunk-ZHG4WAHR.js} +2 -2
  191. package/dist/{chunk-DTZCKZEU.js → chunk-ZKB2XUEN.js} +2 -2
  192. package/dist/chunk-ZLMXIQLC.js +21 -0
  193. package/dist/chunk-ZMCQIHI4.js +2 -0
  194. package/dist/cli-main.js +2 -2
  195. package/dist/code-TAVIKWJI.js +2 -0
  196. package/dist/code-result-json-5FEFQCAQ.js +2 -0
  197. package/dist/{command-descriptors-P34VABY5.js → command-descriptors-7BKH53Y3.js} +124 -124
  198. package/dist/dataflow-GFBTVDH3.js +2 -0
  199. package/dist/dependence-slice-GWGQCODG.js +2 -0
  200. package/dist/deps-4QHVDPYA.js +2 -0
  201. package/dist/direct-navigation-4UBC6HNW.js +3 -0
  202. package/dist/entry-map-QCTF4RVY.js +2 -0
  203. package/dist/files-M2UBF5HJ.js +2 -0
  204. package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
  205. package/dist/{health-CPp2Jf1Z.d.ts → health-BI2a9WPy.d.ts} +60 -2
  206. package/dist/hierarchy-2UIHRLW4.js +2 -0
  207. package/dist/imports-WIE3YZOB.js +2 -0
  208. package/dist/index.d.ts +1 -1
  209. package/dist/index.js +1 -1
  210. package/dist/members-YKD636DA.js +2 -0
  211. package/dist/methods-VDF4IMYG.js +2 -0
  212. package/dist/output-continuation-command-4UMDOOLO.js +3 -0
  213. package/dist/output-pagination-2GME6OPY.js +19 -0
  214. package/dist/postinstall.js +1 -1
  215. package/dist/project-reindex-XEQTRCV5.js +3 -0
  216. package/dist/queries/affected.js +1 -1
  217. package/dist/queries/anchors.d.ts +1 -1
  218. package/dist/queries/anchors.js +1 -1
  219. package/dist/queries/architecture.js +1 -1
  220. package/dist/queries/bottlenecks.js +1 -1
  221. package/dist/queries/by-kind.js +1 -1
  222. package/dist/queries/call-graph.d.ts +2 -0
  223. package/dist/queries/call-graph.js +1 -1
  224. package/dist/queries/change-surface.js +1 -1
  225. package/dist/queries/cleanup-plan.js +1 -1
  226. package/dist/queries/co-change.d.ts +20 -2
  227. package/dist/queries/co-change.js +1 -1
  228. package/dist/queries/code.js +1 -1
  229. package/dist/queries/complexity-hotspots.js +1 -1
  230. package/dist/queries/complexity.js +1 -1
  231. package/dist/queries/context.js +1 -1
  232. package/dist/queries/convergence.js +1 -1
  233. package/dist/queries/coupling.js +1 -1
  234. package/dist/queries/cycles.js +1 -1
  235. package/dist/queries/dataflow.js +1 -1
  236. package/dist/queries/dead.d.ts +2 -0
  237. package/dist/queries/dead.js +1 -1
  238. package/dist/queries/decorative-checkers.js +1 -1
  239. package/dist/queries/deep-chains.js +1 -1
  240. package/dist/queries/dependence-slice.js +1 -1
  241. package/dist/queries/dependency-depth.js +1 -1
  242. package/dist/queries/deps.js +1 -1
  243. package/dist/queries/diff-impact.js +1 -1
  244. package/dist/queries/doc-drift.js +1 -1
  245. package/dist/queries/drift.js +1 -1
  246. package/dist/queries/duplicate-bodies.d.ts +28 -1
  247. package/dist/queries/duplicate-bodies.js +1 -1
  248. package/dist/queries/entry-map.d.ts +1 -1
  249. package/dist/queries/entry-map.js +1 -1
  250. package/dist/queries/evidence.js +1 -1
  251. package/dist/queries/extract-candidates.d.ts +50 -23
  252. package/dist/queries/extract-candidates.js +1 -1
  253. package/dist/queries/fan.js +1 -1
  254. package/dist/queries/files.js +1 -1
  255. package/dist/queries/health.d.ts +1 -1
  256. package/dist/queries/health.js +1 -1
  257. package/dist/queries/hierarchy.js +1 -1
  258. package/dist/queries/hotspots.js +1 -1
  259. package/dist/queries/imports.js +1 -1
  260. package/dist/queries/incomplete-migration.js +1 -1
  261. package/dist/queries/index.d.ts +4 -3
  262. package/dist/queries/index.js +1 -1
  263. package/dist/queries/isolated.js +1 -1
  264. package/dist/queries/locality-candidates.js +1 -1
  265. package/dist/queries/members.js +1 -1
  266. package/dist/queries/methods.js +1 -1
  267. package/dist/queries/not-implemented.js +1 -1
  268. package/dist/queries/outline.js +1 -1
  269. package/dist/queries/passthrough-candidates.d.ts +9 -1
  270. package/dist/queries/passthrough-candidates.js +1 -1
  271. package/dist/queries/plan-context.js +1 -1
  272. package/dist/queries/react-component-duplicates.d.ts +19 -3
  273. package/dist/queries/react-component-duplicates.js +1 -1
  274. package/dist/queries/react-hook-candidates.d.ts +22 -3
  275. package/dist/queries/react-hook-candidates.js +1 -1
  276. package/dist/queries/react-large-component-pressure.d.ts +17 -3
  277. package/dist/queries/react-large-component-pressure.js +1 -1
  278. package/dist/queries/recent-duplicates.js +1 -1
  279. package/dist/queries/redundant-reexports.js +1 -1
  280. package/dist/queries/reference-neighborhood.js +1 -1
  281. package/dist/queries/reference-reachability.js +1 -1
  282. package/dist/queries/refs.js +1 -1
  283. package/dist/queries/self-audit.d.ts +7 -1
  284. package/dist/queries/self-audit.js +1 -1
  285. package/dist/queries/similar-chains.js +1 -1
  286. package/dist/queries/similar-files.js +1 -1
  287. package/dist/queries/similar-signatures.js +1 -1
  288. package/dist/queries/similar.js +1 -1
  289. package/dist/queries/slice.js +1 -1
  290. package/dist/queries/source-inspection.js +1 -1
  291. package/dist/queries/source-search.js +1 -1
  292. package/dist/queries/stale-abstractions.js +1 -1
  293. package/dist/queries/surface.js +1 -1
  294. package/dist/queries/symbols.js +1 -1
  295. package/dist/queries/system-map.d.ts +1 -1
  296. package/dist/queries/system-map.js +1 -1
  297. package/dist/queries/system.js +1 -1
  298. package/dist/queries/test-quality.js +1 -1
  299. package/dist/queries/trace.js +1 -1
  300. package/dist/queries/twin-ab.js +1 -1
  301. package/dist/queries/twin-drift.d.ts +22 -6
  302. package/dist/queries/twin-drift.js +1 -1
  303. package/dist/queries/unused-imports.js +1 -1
  304. package/dist/queries/unused-params.js +1 -1
  305. package/dist/queries/value-flow.js +1 -1
  306. package/dist/queries/vue-component-duplicates.js +1 -1
  307. package/dist/queries/vue-composable-candidates.js +1 -1
  308. package/dist/queries/vue-large-view-pressure.js +1 -1
  309. package/dist/queries/wrapper-candidates.d.ts +16 -1
  310. package/dist/queries/wrapper-candidates.js +1 -1
  311. package/dist/query-service-fastpath.js +5 -5
  312. package/dist/query-service-server.js +2 -2
  313. package/dist/refs-JNK5CLM7.js +2 -0
  314. package/dist/refs-pagination-6BLRYGMV.js +2 -0
  315. package/dist/reindex-worker.js +10 -10
  316. package/dist/reindex.js +18 -18
  317. package/dist/runtime.js +4 -4
  318. package/dist/rust-semantic-session-server.js +1 -1
  319. package/dist/rust-semantic-session-worker.js +1 -1
  320. package/dist/rust-semantic-worker.js +1 -1
  321. package/dist/slice-PHPVNCWX.js +2 -0
  322. package/dist/surface-MQX5MPIV.js +2 -0
  323. package/dist/{symbol-resolution-WD5EU5JE.js → symbol-resolution-DBLVXLBC.js} +2 -2
  324. package/dist/system-JOPKV4OG.js +2 -0
  325. package/dist/trace-I2P2YFH4.js +2 -0
  326. package/dist/typescript-mailbox-worker.js +1 -1
  327. package/dist/value-flow-JJVMF7NP.js +2 -0
  328. package/dist/watch-server.js +3 -3
  329. package/docs/COMMAND_REFERENCE.md +2 -2
  330. package/docs/DETECTOR_GUIDE.md +51 -12
  331. package/docs/accuracy-audit-checklist.md +36 -13
  332. package/docs/locality-analyzer-design.md +9 -9
  333. package/package.json +2 -2
  334. package/skills/conductor/SKILL.md +110 -0
  335. package/skills/conductor/agents/openai.yaml +4 -0
  336. package/skills/principal-maintainability-review/SKILL.md +273 -0
  337. package/skills/principal-maintainability-review/agents/openai.yaml +4 -0
  338. package/skills/scip-calibrate/SKILL.md +102 -0
  339. package/skills/scip-calibrate/agents/openai.yaml +4 -0
  340. package/skills/scip-claim-audit/SKILL.md +113 -0
  341. package/skills/scip-claim-audit/agents/openai.yaml +4 -0
  342. package/skills/scip-probe-reachability/SKILL.md +93 -0
  343. package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
  344. package/skills/scip-root-cause/SKILL.md +160 -0
  345. package/skills/scip-root-cause/agents/openai.yaml +4 -0
  346. package/skills/scip-system-compression/SKILL.md +252 -0
  347. package/skills/scip-system-compression/agents/openai.yaml +4 -0
  348. package/skills/scip-system-compression/references/compression-atlas.md +116 -0
  349. package/skills/scip-system-compression/references/compression-patterns.md +87 -0
  350. package/skills/scip-twin-drift/SKILL.md +109 -0
  351. package/skills/scip-twin-drift/agents/openai.yaml +4 -0
  352. package/dist/by-kind-XI2CSWEY.js +0 -2
  353. package/dist/call-graph-UONR6JR5.js +0 -2
  354. package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
  355. package/dist/chunk-2R3V3PSD.js +0 -4
  356. package/dist/chunk-2WC2OEDO.js +0 -4
  357. package/dist/chunk-3FHOF22C.js +0 -21
  358. package/dist/chunk-3JKSW6LJ.js +0 -2
  359. package/dist/chunk-3L2ZBPEX.js +0 -133
  360. package/dist/chunk-3PJABJSU.js +0 -2
  361. package/dist/chunk-4FTZ4P5G.js +0 -2
  362. package/dist/chunk-4UX2F3JX.js +0 -2
  363. package/dist/chunk-5ENOG4VP.js +0 -61
  364. package/dist/chunk-66DVSJQG.js +0 -455
  365. package/dist/chunk-AVRYW5OZ.js +0 -2
  366. package/dist/chunk-BDUVI7TO.js +0 -3
  367. package/dist/chunk-CEEZJXEF.js +0 -2
  368. package/dist/chunk-CJZXN4NU.js +0 -2
  369. package/dist/chunk-COF23M5F.js +0 -2
  370. package/dist/chunk-DHUIOLDT.js +0 -2
  371. package/dist/chunk-DRENNWRG.js +0 -2
  372. package/dist/chunk-E5R6AQ73.js +0 -40
  373. package/dist/chunk-E73UNJTF.js +0 -38
  374. package/dist/chunk-EVFUMY4R.js +0 -3
  375. package/dist/chunk-FBN2FGXG.js +0 -2
  376. package/dist/chunk-FFRKR4EQ.js +0 -2
  377. package/dist/chunk-GAS2LJMP.js +0 -3
  378. package/dist/chunk-HVF5VBG6.js +0 -2
  379. package/dist/chunk-JGKUET5J.js +0 -3
  380. package/dist/chunk-JWTGMPIT.js +0 -80
  381. package/dist/chunk-KFOYCQAJ.js +0 -9
  382. package/dist/chunk-KYSDI3GE.js +0 -5
  383. package/dist/chunk-LDVT66YM.js +0 -2
  384. package/dist/chunk-LQRQN2XA.js +0 -2
  385. package/dist/chunk-MNV5FSBW.js +0 -3
  386. package/dist/chunk-MV3CDXPI.js +0 -38
  387. package/dist/chunk-N5B2NILC.js +0 -5
  388. package/dist/chunk-NOYBFVJA.js +0 -554
  389. package/dist/chunk-NWQXSFFU.js +0 -3
  390. package/dist/chunk-OLIWTZI3.js +0 -3
  391. package/dist/chunk-PP7KNN7L.js +0 -2
  392. package/dist/chunk-PU7T5QYQ.js +0 -2
  393. package/dist/chunk-QGVTFRY2.js +0 -7
  394. package/dist/chunk-QOJONDS7.js +0 -2
  395. package/dist/chunk-RBLQNW26.js +0 -20
  396. package/dist/chunk-RTQ7NEKG.js +0 -81
  397. package/dist/chunk-TPFHAQ2G.js +0 -2
  398. package/dist/chunk-TQZV7KV4.js +0 -2
  399. package/dist/chunk-TY7CRN3Z.js +0 -2
  400. package/dist/chunk-W7CXK74K.js +0 -2
  401. package/dist/chunk-WB3WYIRE.js +0 -4
  402. package/dist/chunk-WK46TNUM.js +0 -3
  403. package/dist/chunk-WYCTJDVR.js +0 -2
  404. package/dist/chunk-XRYABF57.js +0 -8
  405. package/dist/chunk-YPWHBBIS.js +0 -2
  406. package/dist/chunk-YSH6U3L4.js +0 -3
  407. package/dist/chunk-YU5DZUZI.js +0 -10
  408. package/dist/chunk-YWO5DDRC.js +0 -16
  409. package/dist/chunk-ZF5KHH7C.js +0 -2
  410. package/dist/chunk-ZOHS7AQV.js +0 -21
  411. package/dist/code-MI6F2TTU.js +0 -2
  412. package/dist/code-result-json-FXALY4HE.js +0 -2
  413. package/dist/dataflow-4KEMJPC6.js +0 -2
  414. package/dist/dependence-slice-R7FPWD5M.js +0 -2
  415. package/dist/deps-7EMQUYUT.js +0 -2
  416. package/dist/direct-navigation-6YO234F2.js +0 -3
  417. package/dist/entry-map-KOOLR26E.js +0 -2
  418. package/dist/files-OPIPJIGZ.js +0 -2
  419. package/dist/hierarchy-QPD2CAER.js +0 -2
  420. package/dist/imports-M6HUXRXC.js +0 -2
  421. package/dist/members-I5MEFOCT.js +0 -2
  422. package/dist/methods-5JYGGHXA.js +0 -2
  423. package/dist/output-continuation-command-UPQAAKBP.js +0 -3
  424. package/dist/output-pagination-3OFL2MJV.js +0 -19
  425. package/dist/project-reindex-UKKQ5PLS.js +0 -3
  426. package/dist/refs-PSU4JZZW.js +0 -2
  427. package/dist/refs-pagination-JG6CJMRC.js +0 -2
  428. package/dist/slice-HYRATV64.js +0 -2
  429. package/dist/surface-VTGDYWF5.js +0 -2
  430. package/dist/system-LRQNFOR2.js +0 -2
  431. package/dist/trace-F4B6OLL4.js +0 -2
  432. package/dist/value-flow-VRPZY72V.js +0 -2
@@ -1,4 +1,4 @@
1
- import{a as y}from"./chunk-J66VOFW6.js";import{a as v}from"./chunk-WYCTJDVR.js";import{q as S}from"./chunk-YEN6CYC7.js";import{a as b}from"./chunk-HOENASQM.js";import{Q as p,R as g,i as d}from"./chunk-3L2ZBPEX.js";import{c as u,d as f,g as m}from"./chunk-DRENNWRG.js";function q(e,t,i={}){let n=T(e,t,i);return{definitions:n.definitions,referencedBy:n.referencedBy.map(r=>({relativePath:r.relativePath,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingShort}))}}function T(e,t,i={}){let n=R(e,t,i);return{definitions:n.definitions,referencedBy:n.referencedBy}}function R(e,t,i={}){let n=b(e,t);if(!n)return{definitions:[],referencedBy:[],referenceEvidence:[],claimSupport:null};let r=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),c=g(r?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:K(c,r?.display_name??null,n.symbol),source:B(e,n.relativePath,n.startLine,n.endLine)}],h=i.referenceContext??2,s=S(e,n,{semantic:i.semantic,semanticEvidence:v}).map(l=>{let a=y(e,l.file,l.line,h,f(n.symbol));return{relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?u(l.enclosingSymbol):"(top-level)",provenance:l.provenance,sourceStartLine:a?.startLine??null,sourceEndLine:a?.endLine??null,source:a?.source??null,sourceKind:a?.kind??"unavailable"}}),E=s.map(x);return{definitions:o,referencedBy:E,referenceEvidence:s.map(l=>({relativePath:l.relativePath,line:l.line,provenance:l.provenance,sourceKind:l.sourceKind})),claimSupport:P(s)}}function x(e){return{relativePath:e.relativePath,line:e.line,enclosingSymbol:e.enclosingSymbol,enclosingShort:e.enclosingShort,sourceStartLine:e.sourceStartLine,sourceEndLine:e.sourceEndLine,source:e.source}}function P(e){let t="resolved source-attributed or SCIP-indexed references to this exact symbol",i=["Dynamic dispatch, reflection, generated calls, and unindexed source are outside this scope."],n=e.filter(c=>c.sourceKind!=="complete-call-expression"&&c.sourceKind!=="non-call-reference"),r="direct, statically visible call expressions among the resolved reference sites";return{referenceAbsence:{status:"eligible",scope:t,limitations:i},callsitePredicates:n.length===0?{status:"eligible",scope:r,limitations:i}:{status:"ineligible",scope:r,reason:`${n.length} reference site(s) lack one unambiguous complete call expression.`,followup:L(n)}}}function L(e){let t=[...new Set(e.map(i=>`${i.relativePath}:${i.line+1}`))];return t.length===0||t.length>24?null:`scip-query inspect ${t.map(i=>`--at ${C(i)}`).join(" ")} --view behavior`}function C(e){return`'${e.replaceAll("'","'\\''")}'`}function B(e,t,i,n){let r=d(e,t);if(!r)return null;let o=r.split(`
1
+ import{a as y}from"./chunk-POBJ6FR2.js";import{a as v}from"./chunk-WDSFQDPN.js";import{q as S}from"./chunk-FI7VGOR4.js";import{a as b}from"./chunk-2USA3S3P.js";import{Q as p,R as g,i as d}from"./chunk-2VAHDDLM.js";import{c as u,d as f,g as m}from"./chunk-BL6DCHQP.js";function q(e,t,i={}){let n=T(e,t,i);return{definitions:n.definitions,referencedBy:n.referencedBy.map(r=>({relativePath:r.relativePath,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingShort}))}}function T(e,t,i={}){let n=R(e,t,i);return{definitions:n.definitions,referencedBy:n.referencedBy}}function R(e,t,i={}){let n=b(e,t);if(!n)return{definitions:[],referencedBy:[],referenceEvidence:[],claimSupport:null};let r=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),c=g(r?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:K(c,r?.display_name??null,n.symbol),source:B(e,n.relativePath,n.startLine,n.endLine)}],h=i.referenceContext??2,s=S(e,n,{semantic:i.semantic,semanticEvidence:v}).map(l=>{let a=y(e,l.file,l.line,h,f(n.symbol));return{relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?u(l.enclosingSymbol):"(top-level)",provenance:l.provenance,sourceStartLine:a?.startLine??null,sourceEndLine:a?.endLine??null,source:a?.source??null,sourceKind:a?.kind??"unavailable"}}),E=s.map(x);return{definitions:o,referencedBy:E,referenceEvidence:s.map(l=>({relativePath:l.relativePath,line:l.line,provenance:l.provenance,sourceKind:l.sourceKind})),claimSupport:P(s)}}function x(e){return{relativePath:e.relativePath,line:e.line,enclosingSymbol:e.enclosingSymbol,enclosingShort:e.enclosingShort,sourceStartLine:e.sourceStartLine,sourceEndLine:e.sourceEndLine,source:e.source}}function P(e){let t="resolved source-attributed or SCIP-indexed references to this exact symbol",i=["Dynamic dispatch, reflection, generated calls, and unindexed source are outside this scope."],n=e.filter(c=>c.sourceKind!=="complete-call-expression"&&c.sourceKind!=="non-call-reference"),r="direct, statically visible call expressions among the resolved reference sites";return{referenceAbsence:{status:"eligible",scope:t,limitations:i},callsitePredicates:n.length===0?{status:"eligible",scope:r,limitations:i}:{status:"ineligible",scope:r,reason:`${n.length} reference site(s) lack one unambiguous complete call expression.`,followup:L(n)}}}function L(e){let t=[...new Set(e.map(i=>`${i.relativePath}:${i.line+1}`))];return t.length===0||t.length>24?null:`scip-query inspect ${t.map(i=>`--at ${C(i)}`).join(" ")} --view behavior`}function C(e){return`'${e.replaceAll("'","'\\''")}'`}function B(e,t,i,n){let r=d(e,t);if(!r)return null;let o=r.split(`
2
2
  `).slice(i,n+1).join(`
3
3
  `).trimEnd();return o.length>0?o:null}function K(e,t,i){let n=p(e);if(n&&!A(n))return n;let r=(t??"").trim();return r?m(i)&&!r.endsWith("()")?`${r}()`:r:u(i)}function A(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{q as a,T as b,R as c};
4
- //# sourceMappingURL=chunk-D4N5SQ2M.js.map
4
+ //# sourceMappingURL=chunk-NYKZMCRC.js.map
@@ -1,6 +1,6 @@
1
- import{a as ie}from"./chunk-2LDBDR6J.js";import{a as oe}from"./chunk-FDLOBR6P.js";import{b as D}from"./chunk-7BWFZPPZ.js";import{a as te}from"./chunk-D2DHWI3D.js";import{b as ne}from"./chunk-2R3V3PSD.js";import{a as W,b as ee}from"./chunk-EG2CPZMJ.js";import{b as Q}from"./chunk-CWFP7GM5.js";import{f as V}from"./chunk-JGKUET5J.js";import{a as H}from"./chunk-ZF5KHH7C.js";import{a as q}from"./chunk-QUU5OBVK.js";import{b as Y}from"./chunk-DHUIOLDT.js";import{a as X}from"./chunk-6HFCYNYE.js";import{d as Z}from"./chunk-M2O5NY6W.js";import{b as K}from"./chunk-BRV7PIFF.js";import{a as J}from"./chunk-T4N4P2K5.js";import{a as w}from"./chunk-TQPCBMWT.js";import{a as G}from"./chunk-YU5DZUZI.js";import{a as j,c as z}from"./chunk-OSSESPDX.js";import{b as $}from"./chunk-NJITK2GP.js";import{e as P,t as A}from"./chunk-N2ZSIIGR.js";import{y as U}from"./chunk-JWTGMPIT.js";function se(n){let e=new Set(n.filter(o=>o.definition?.isFunctionLike).map(o=>`${o.role}:${o.definition.relativePath}`));return n.flatMap(o=>o.definition?!o.definition.isFunctionLike&&e.has(`${o.role}:${o.definition.relativePath}`)?[]:[{definition:o.definition,role:o.role}]:[])}var me=6,I=10,M=3,T=8,de=.7,re=24,_=200,fe=12,le=80,ce=600;function Ze(n,e,o={}){let l=o.impactDepth??3,a=o.sliceDepth??3,u=o.semantic,c=Ee(e)?Ce(n,e):null,S=c?c.primary?.symbol??null:e,{traceResult:r,callGraphResult:C,complexityResult:R,dataflowResult:t,backwardSliceResult:d,forwardSliceResult:s,affectedResults:p,reuseCandidates:b,targetSymbol:i,affectedConsumerReuse:y}=ye(n,S,o,l,a),h=f("change-surface",e,()=>q(n,e,{semantic:u}),m=>({symbols:m?.symbols.length??0,externalConsumers:m?.totalExternalConsumers??0})),x=f("system",e,()=>oe(n,e),m=>({files:m.files.length,symbols:m.symbols.length})),L=x.files.length===1,B=f("deps",e,()=>L?x.dependsOn.map(m=>({relativePath:m,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):W(n,e),m=>({files:m.length,reusedSystem:L})),k=f("rdeps",e,()=>L?x.dependedOnBy.map(m=>({relativePath:m,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):ee(n,e),m=>({files:m.length,reusedSystem:L})),N=f("surface",e,()=>ie(n,e),m=>({consumers:m.length})),g={symbol:r.definitions.length>0||r.referencedBy.length>0||C!==null||R!==null||t!==null||d!==null||s!==null||p.length>0,file:h!==null||B.length>0||k.length>0,module:x.files.length>0||x.symbols.length>0||N.length>0},E=[];c&&!c.primary&&c.callableCount>1&&E.push(`File target has ${c.callableCount} callable symbols; use one callable name for compiler-resolved flow.`);let F=[...new Set(r.referencedBy.map(m=>m.relativePath))];F.length>0&&F.every(m=>$(m)==="test")&&E.push("Only test references were found for this target. For replacement or retirement work, map the currently wired owner or one production entry point before planning; this target does not describe the live affected surface."),!g.symbol&&!g.file&&!g.module&&E.push("No symbol, file, or module matched target.");let O=h?.file??r.definitions[0]?.relativePath??null;return{target:e,...c?.primary?{primaryCallable:{symbol:c.primary.symbol,shortName:P(c.primary.symbol),file:c.primary.relativePath}}:{},matched:g,history:f("history",O??e,()=>ge(n,O,o.gitHead)),trace:pe(r),callGraph:C,complexity:R,dataflow:t,backwardSlice:d,forwardSlice:s,affected:p,changeSurface:h,deps:B,rdeps:k,system:x,surface:N,reuseCandidates:b,affectedConsumerReuse:y,sourcePacket:be(n,i,r,y,b),warnings:E}}function ye(n,e,o,l,a){let u=o.semantic,c=e?f("trace",e,()=>ne(n,e,{semantic:u,referenceContext:fe}),i=>({definitions:i.definitions.length,references:i.referencedBy.length})):{definitions:[],referencedBy:[],claimSupport:null},S=e?f("call-graph",e,()=>H(n,e,{semantic:u}),i=>({callers:i?.callers.length??0,callees:i?.callees.length??0})):null,r=e?f("complexity",e,()=>J(n,e,{semantic:u}),i=>({callees:i?.calleeCount??0})):null,C=e?f("dataflow",e,()=>Q(n,e,{semantic:u}),i=>({references:i?.usageSites.length??0,producers:i?.producers.length??0,consumers:i?.consumers.length??0})):null,R=e?f("backward-slice",e,()=>D(n,e,{direction:"backward",maxDepth:a,semantic:u}),i=>({maxDepth:a,connectedSymbols:i?.connectedSymbols.length??0})):null,t=e?f("forward-slice",e,()=>D(n,e,{direction:"forward",maxDepth:a,semantic:u}),i=>({maxDepth:a,connectedSymbols:i?.connectedSymbols.length??0})):null,d=e?f("affected",e,()=>G(n,e,{maxDepth:l,scope:o.scope}),i=>({maxDepth:l,affectedSymbols:i.length})):[],s=e?f("reuse-candidates",e,()=>w(n,e,{minSimilarity:.4,limit:5,semantic:u,sourceCandidateMode:"target-pruned"}),i=>({candidates:i.length,direct:i.filter(y=>y.actionTier==="direct").length})):[],p=e?j(n,e)?.symbol??null:null,b=e?f("affected-consumer-reuse",e,()=>Se(c,p,i=>w(n,i,{minSimilarity:.4,limit:I,semantic:u,sourceCandidateMode:"target-pruned"}),{consumerLimit:me,perConsumerSearchLimit:I,perConsumerCandidateLimit:M,candidateLimit:T}),i=>({totalConsumers:i.coverage.totalConsumers,analyzedConsumers:i.coverage.analyzedConsumers,candidates:i.candidates.length})):Le();return{traceResult:c,callGraphResult:S,complexityResult:r,dataflowResult:C,backwardSliceResult:R,forwardSliceResult:t,affectedResults:d,reuseCandidates:s,targetSymbol:p,affectedConsumerReuse:b}}function pe(n){return{definitions:n.definitions,referencedBy:n.referencedBy.map(e=>({relativePath:e.relativePath,line:e.line,enclosingSymbol:e.enclosingSymbol,enclosingShort:e.enclosingShort}))}}function Ce(n,e){let o=K(n,e);if(o.length!==1)return{primary:null,callableCount:0};let l=A(n,o[0]).filter(c=>c.isFunctionLike),a=l.filter(c=>c.enclosingSymbol===null),u=a.length>0?a:l;return{primary:u.length===1?u[0]:null,callableCount:u.length}}function be(n,e,o,l,a){let u=[...e?[{definition:ae(n,e),role:"target"}]:[],...[...l.candidates.map(t=>t.candidate),...a].map(t=>({definition:ae(n,t.symbolB),role:"reuse-candidate"}))],c=new Map;for(let t of se(u)){if(c.has(t.definition.symbol))continue;let d=t.role==="target"?_:le,s=t.definition.endLine<=t.definition.startLine?Z(n,t.definition.relativePath,t.definition.startLine,d):null,p=s?.unitType?s.source:V(n,t.definition);if(!p)continue;let b=p.split(`
1
+ import{a as ie}from"./chunk-3Z5AMSK6.js";import{a as oe}from"./chunk-KXXORBZ2.js";import{b as D}from"./chunk-UXKURIVI.js";import{a as te}from"./chunk-SCPMZ73U.js";import{b as ne}from"./chunk-ROPJDEJZ.js";import{a as W,b as ee}from"./chunk-E65ELFKU.js";import{b as Q}from"./chunk-PSZPMMWN.js";import{g as V}from"./chunk-OIOC5EHF.js";import{a as H}from"./chunk-VDSDOEWF.js";import{a as q}from"./chunk-HOBOVYPO.js";import{c as Y}from"./chunk-KVQCECPR.js";import{a as X}from"./chunk-XKXTR6ZI.js";import{d as Z}from"./chunk-A4WEAK35.js";import{b as K}from"./chunk-NSM5IEVW.js";import{a as J}from"./chunk-NJT3ZEKY.js";import{a as w}from"./chunk-ZFVPWH62.js";import{a as G}from"./chunk-6D4F5VWG.js";import{a as j,c as z}from"./chunk-F5GSBHC6.js";import{b as $}from"./chunk-FLMTCX5R.js";import{e as P,v as A}from"./chunk-C7C6AKAT.js";import{y as U}from"./chunk-KNLQGXVH.js";function se(n){let e=new Set(n.filter(o=>o.definition?.isFunctionLike).map(o=>`${o.role}:${o.definition.relativePath}`));return n.flatMap(o=>o.definition?!o.definition.isFunctionLike&&e.has(`${o.role}:${o.definition.relativePath}`)?[]:[{definition:o.definition,role:o.role}]:[])}var me=6,I=10,M=3,T=8,de=.7,re=24,_=200,fe=12,le=80,ce=600;function Ze(n,e,o={}){let l=o.impactDepth??3,a=o.sliceDepth??3,u=o.semantic,c=Ee(e)?Ce(n,e):null,S=c?c.primary?.symbol??null:e,{traceResult:r,callGraphResult:C,complexityResult:R,dataflowResult:t,backwardSliceResult:d,forwardSliceResult:s,affectedResults:p,reuseCandidates:b,targetSymbol:i,affectedConsumerReuse:y}=ye(n,S,o,l,a),h=f("change-surface",e,()=>q(n,e,{semantic:u}),m=>({symbols:m?.symbols.length??0,externalConsumers:m?.totalExternalConsumers??0})),x=f("system",e,()=>oe(n,e),m=>({files:m.files.length,symbols:m.symbols.length})),L=x.files.length===1,B=f("deps",e,()=>L?x.dependsOn.map(m=>({relativePath:m,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):W(n,e),m=>({files:m.length,reusedSystem:L})),k=f("rdeps",e,()=>L?x.dependedOnBy.map(m=>({relativePath:m,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):ee(n,e),m=>({files:m.length,reusedSystem:L})),N=f("surface",e,()=>ie(n,e),m=>({consumers:m.length})),g={symbol:r.definitions.length>0||r.referencedBy.length>0||C!==null||R!==null||t!==null||d!==null||s!==null||p.length>0,file:h!==null||B.length>0||k.length>0,module:x.files.length>0||x.symbols.length>0||N.length>0},E=[];c&&!c.primary&&c.callableCount>1&&E.push(`File target has ${c.callableCount} callable symbols; use one callable name for compiler-resolved flow.`);let F=[...new Set(r.referencedBy.map(m=>m.relativePath))];F.length>0&&F.every(m=>$(m)==="test")&&E.push("Only test references were found for this target. For replacement or retirement work, map the currently wired owner or one production entry point before planning; this target does not describe the live affected surface."),!g.symbol&&!g.file&&!g.module&&E.push("No symbol, file, or module matched target.");let O=h?.file??r.definitions[0]?.relativePath??null;return{target:e,...c?.primary?{primaryCallable:{symbol:c.primary.symbol,shortName:P(c.primary.symbol),file:c.primary.relativePath}}:{},matched:g,history:f("history",O??e,()=>ge(n,O,o.gitHead)),trace:pe(r),callGraph:C,complexity:R,dataflow:t,backwardSlice:d,forwardSlice:s,affected:p,changeSurface:h,deps:B,rdeps:k,system:x,surface:N,reuseCandidates:b,affectedConsumerReuse:y,sourcePacket:be(n,i,r,y,b),warnings:E}}function ye(n,e,o,l,a){let u=o.semantic,c=e?f("trace",e,()=>ne(n,e,{semantic:u,referenceContext:fe}),i=>({definitions:i.definitions.length,references:i.referencedBy.length})):{definitions:[],referencedBy:[],claimSupport:null},S=e?f("call-graph",e,()=>H(n,e,{semantic:u}),i=>({callers:i?.callers.length??0,callees:i?.callees.length??0})):null,r=e?f("complexity",e,()=>J(n,e,{semantic:u}),i=>({callees:i?.calleeCount??0})):null,C=e?f("dataflow",e,()=>Q(n,e,{semantic:u}),i=>({references:i?.usageSites.length??0,producers:i?.producers.length??0,consumers:i?.consumers.length??0})):null,R=e?f("backward-slice",e,()=>D(n,e,{direction:"backward",maxDepth:a,semantic:u}),i=>({maxDepth:a,connectedSymbols:i?.connectedSymbols.length??0})):null,t=e?f("forward-slice",e,()=>D(n,e,{direction:"forward",maxDepth:a,semantic:u}),i=>({maxDepth:a,connectedSymbols:i?.connectedSymbols.length??0})):null,d=e?f("affected",e,()=>G(n,e,{maxDepth:l,scope:o.scope}),i=>({maxDepth:l,affectedSymbols:i.length})):[],s=e?f("reuse-candidates",e,()=>w(n,e,{minSimilarity:.4,limit:5,semantic:u,sourceCandidateMode:"target-pruned"}),i=>({candidates:i.length,direct:i.filter(y=>y.actionTier==="direct").length})):[],p=e?j(n,e)?.symbol??null:null,b=e?f("affected-consumer-reuse",e,()=>Se(c,p,i=>w(n,i,{minSimilarity:.4,limit:I,semantic:u,sourceCandidateMode:"target-pruned"}),{consumerLimit:me,perConsumerSearchLimit:I,perConsumerCandidateLimit:M,candidateLimit:T}),i=>({totalConsumers:i.coverage.totalConsumers,analyzedConsumers:i.coverage.analyzedConsumers,candidates:i.candidates.length})):Le();return{traceResult:c,callGraphResult:S,complexityResult:r,dataflowResult:C,backwardSliceResult:R,forwardSliceResult:t,affectedResults:d,reuseCandidates:s,targetSymbol:p,affectedConsumerReuse:b}}function pe(n){return{definitions:n.definitions,referencedBy:n.referencedBy.map(e=>({relativePath:e.relativePath,line:e.line,enclosingSymbol:e.enclosingSymbol,enclosingShort:e.enclosingShort}))}}function Ce(n,e){let o=K(n,e);if(o.length!==1)return{primary:null,callableCount:0};let l=A(n,o[0]).filter(c=>c.isFunctionLike),a=l.filter(c=>c.enclosingSymbol===null),u=a.length>0?a:l;return{primary:u.length===1?u[0]:null,callableCount:u.length}}function be(n,e,o,l,a){let u=[...e?[{definition:ae(n,e),role:"target"}]:[],...[...l.candidates.map(t=>t.candidate),...a].map(t=>({definition:ae(n,t.symbolB),role:"reuse-candidate"}))],c=new Map;for(let t of se(u)){if(c.has(t.definition.symbol))continue;let d=t.role==="target"?_:le,s=t.definition.endLine<=t.definition.startLine?Z(n,t.definition.relativePath,t.definition.startLine,d):null,p=s?.unitType?s.source:V(n,t.definition);if(!p)continue;let b=p.split(`
2
2
  `),i=Math.min(b.length,d),y=s?.unitType?s.startLine:t.definition.startLine;c.set(t.definition.symbol,{role:t.role,symbol:t.definition.symbol,shortName:P(t.definition.symbol),file:t.definition.relativePath,startLine:y,endLine:y+i-1,source:b.slice(0,i).join(`
3
3
  `),omittedLines:(s?.unitType?s.omittedLines:0)+Math.max(0,b.length-i)})}let S=new Map;for(let t of o.referencedBy){if(t.source===void 0||t.source===null||t.sourceStartLine===void 0||t.sourceStartLine===null||t.sourceEndLine===void 0||t.sourceEndLine===null)continue;let d=`${t.relativePath}:${t.sourceStartLine}-${t.sourceEndLine}`,s=S.get(d);if(s){s.focusLines=[...new Set([...s.focusLines??[],t.line])].sort((p,b)=>p-b);continue}S.set(d,{role:"consumer",symbol:t.enclosingSymbol??`${t.relativePath}:${t.line}`,shortName:t.enclosingShort,file:t.relativePath,startLine:t.sourceStartLine,endLine:t.sourceEndLine,source:t.source,omittedLines:0,focusLines:[t.line]})}let r=[...[...c.values()].filter(t=>t.role==="target"),...S.values(),...[...c.values()].filter(t=>t.role==="reuse-candidate")],C=[],R=ce;for(let t of r){if(C.length>=re||R<=0)break;let d=t.source.split(`
4
4
  `),s=Math.min(d.length,R);C.push({...t,endLine:t.startLine+s-1,source:d.slice(0,s).join(`
5
5
  `),omittedLines:t.omittedLines+Math.max(0,d.length-s),...t.focusLines?{focusLines:t.focusLines.filter(p=>p<=t.startLine+s-1)}:{}}),R-=s}return{slices:C,candidateSlices:r.length,omittedSlices:Math.max(0,r.length-C.length),maxSlices:re,maxLinesPerSlice:_,maxTotalLines:ce,targetLineLimit:_,consumerContextLines:fe,reuseLineLimit:le}}function ae(n,e){let o=z(n,e);return o?A(n,o.relativePath).find(l=>l.symbol===e)??null:null}function Se(n,e,o,l={}){let a=v(l.consumerLimit,me),u=v(l.perConsumerSearchLimit,I),c=v(l.perConsumerCandidateLimit,M),S=v(l.candidateLimit,T),r=Re(n),C=r.slice(0,a),R=new Set(r.map(s=>s.symbol));e&&R.add(e);let t=new Map;for(let s of C){let p=o(s.symbol).slice(0,u),b=0;for(let i of p){let y=he(i,s.symbol);if(!y||R.has(y.symbolB))continue;let h=t.get(y.symbolB);if(h?(h.consumers.some(x=>x.symbol===s.symbol)||h.consumers.push(s),y.similarity>h.candidate.similarity&&(h.candidate=y)):t.set(y.symbolB,{candidate:y,consumers:[s]}),b+=1,b>=c)break}}let d=[...t.values()].filter(s=>s.candidate.actionTier==="direct"||s.candidate.similarity>=de||s.consumers.length>1).sort(xe).slice(0,S);return{candidates:d,coverage:{totalConsumers:r.length,analyzedConsumers:C.length,omittedConsumers:Math.max(0,r.length-C.length),perConsumerSearchLimit:u,perConsumerCandidateLimit:c,candidateLimit:S,returnedCandidates:d.length}}}function Re(n){let e=new Map;for(let o of n.referencedBy){if(!o.enclosingSymbol)continue;let l=e.get(o.enclosingSymbol);if(l){l.referenceCount+=1;continue}e.set(o.enclosingSymbol,{symbol:o.enclosingSymbol,shortName:P(o.enclosingSymbol)||o.enclosingShort,file:o.relativePath,referenceCount:1})}return[...e.values()].sort((o,l)=>l.referenceCount-o.referenceCount||o.symbol.localeCompare(l.symbol))}function he(n,e){return n.symbolA===e?n:n.symbolB!==e?null:{...n,symbolA:n.symbolB,shortNameA:n.shortNameB,fileA:n.fileB,symbolB:n.symbolA,shortNameB:n.shortNameA,fileB:n.fileA,uniqueToA:n.uniqueToB,uniqueToB:n.uniqueToA}}function xe(n,e){let o=ue(e.candidate.actionTier)-ue(n.candidate.actionTier);if(o!==0)return o;let l=e.consumers.length-n.consumers.length;if(l!==0)return l;let a=e.candidate.similarity-n.candidate.similarity;return a!==0?a:n.candidate.symbolB.localeCompare(e.candidate.symbolB)}function ue(n){return n==="direct"?1:0}function v(n,e){return typeof n=="number"&&Number.isFinite(n)?Math.max(1,Math.floor(n)):e}function Le(){return{candidates:[],coverage:{totalConsumers:0,analyzedConsumers:0,omittedConsumers:0,perConsumerSearchLimit:I,perConsumerCandidateLimit:M,candidateLimit:T,returnedCandidates:0}}}function f(n,e,o,l=()=>({})){let a;return U(`context.${n}`,()=>(a=o(),a),()=>({target:e,...l(a)}))}function ge(n,e,o){let l={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return l;let a=X(n,o?{head:o}:{}),u=f("history.churn",e,()=>a.fileChurn(),r=>({files:r?.size??0}));if(!u)return l;let c=f("history.co-change",e,()=>Y(n,e,{limit:5,...o?{head:o}:{}}),r=>({commits:r.commitsAnalyzed,partners:r.findings.length})),S=f("history.suppressions",e,()=>te(n).byFile.get(e)??0,r=>({suppressions:r}));return{available:!0,file:e,churn:u.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:c.findings.map(r=>({file:r.fileA===e?r.fileB:r.fileA,together:r.together,confidence:r.confidence,subjectContext:r.subjectContext})),suppressionsInFile:S}}function Ee(n){return n.includes("/")||n.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(n)}export{Ze as a,Se as b};
6
- //# sourceMappingURL=chunk-VNLGKHS6.js.map
6
+ //# sourceMappingURL=chunk-O6BUXZEH.js.map
@@ -0,0 +1,3 @@
1
+ import{b as m}from"./chunk-2OOY75BW.js";import{a as p}from"./chunk-JFMEXGFE.js";import{$ as P,X as d,aa as h}from"./chunk-7HXT6YLU.js";import{g as f}from"./chunk-7F45LJKI.js";import{realpathSync as c}from"fs";import{basename as x,dirname as L,join as T,relative as I,sep as O}from"path";import{fileURLToPath as S,pathToFileURL as y}from"url";function F(n,e){return e==="."||e==="./"?y(c(n)).href:y(d(n,e).absolutePath).href}function b(n,e){let r=S(e);return I(c(n),v(r)).split(O).join("/")}function v(n){try{return c(n)}catch{try{return T(c(L(n)),x(n))}catch{return n}}}function H(n,e,r){return{textDocument:{uri:F(n,e.relativePath)},position:z(n,e),context:{includeDeclaration:r}}}function z(n,e){let r={line:e.startLine,character:e.startChar??0};try{return M(P(n,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(t){if(!h(t))throw t;return r}}function M(n,e,r={line:e.startLine,character:e.startChar??0}){let t=n.split(/\r?\n/),o=t[e.startLine];if(o===void 0||e.leaf.length===0)return r;let i=Math.max(0,Math.min(r.character,o.length)),s=o.indexOf(e.leaf,i);if(s>=0)return{line:e.startLine,character:u(s,e.leaf)};let a=o.indexOf(e.leaf);if(a>=0)return{line:e.startLine,character:u(a,e.leaf)};let l=D(t,e.startLine,e.leaf);return l||r}function u(n,e){return n+Math.max(0,e.length-2)}function D(n,e,r){for(let t of[-1,1,-2,2]){let o=e+t;if(o<0||o>=n.length)continue;let i=n[o].indexOf(r);if(i>=0)return{line:o,character:u(i,r)}}return null}function K(n,e){return e.map(r=>({file:b(n,r.uri),line:r.range.start.line,column:r.range.start.character}))}function X(n){let e=new Map;for(let r of n)e.set(`${r.file}\0${r.line}\0${r.column}`,r);return[...e.values()].sort((r,t)=>{let o=r.file.localeCompare(t.file);return o!==0?o:r.line!==t.line?r.line-t.line:r.column-t.column})}import{randomUUID as E}from"crypto";import{readdirSync as $,rmSync as j,writeFileSync as A}from"fs";import{join as g}from"path";var R="rust-analyzer-owner-",w=".json",U=16*1024;function Z(n,e){if(!n||!e.rootIdentity)return null;let r=g(n,`${R}${e.rootPid}-${E()}${w}`),t={version:1,rootIdentity:e.rootIdentity,ownsProcessGroup:e.ownsProcessGroup};return A(r,`${JSON.stringify(t)}
2
+ `,{encoding:"utf8",mode:384,flag:"wx"}),r}function ee(n){n&&j(n,{force:!0})}async function re(n,e){if(!n)return[];let r;try{r=$(n)}catch{return[]}let t=r.filter(s=>s.startsWith(R)&&s.endsWith(w)).map(s=>g(n,s)),o=[],i=[];for(let s of t){let a=C(s);a?i.push(a):o.push({reaped:!1,reason:"identity-unavailable",detail:`Rust analyzer ownership record ${s} could not be validated.`})}return o.push(...await Promise.all(i.map(s=>m(s,e)))),o}function C(n){try{let e=f(n,{maxBytes:U,inputKind:"rust-analyzer process ownership record"}),r=JSON.parse(e),t=p(r.rootIdentity);return r.version!==1||!t||typeof r.ownsProcessGroup!="boolean"?null:{rootPid:t.pid,rootIdentity:t,ownsProcessGroup:r.ownsProcessGroup,knownMembers:new Map([[t.pid,t]])}}catch{return null}}export{Z as a,ee as b,re as c,F as d,b as e,H as f,K as g,X as h};
3
+ //# sourceMappingURL=chunk-ODPDP7A4.js.map
@@ -1,2 +1,2 @@
1
- import{d}from"./chunk-B3X6KU75.js";import{P as p}from"./chunk-ZOHS7AQV.js";function y(t,e={}){let{minTotalLines:i=800,minTemplateLines:n=300,minScriptLines:r=300,minStyleLines:u=500,limit:o=20,scope:a,scanLimit:l,filePattern:m}=e;return p(t).vueProfiles({scope:a,scanLimit:l}).filter(s=>!m||s.file.includes(m)).map(s=>L(s,{minTotalLines:i,minTemplateLines:n,minScriptLines:r,minStyleLines:u})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(t,e){let i=d(t,b(e),"total"),{reasons:n}=i;if(n.length===0)return null;let r=i.dominantPressure,u=i.pressureKinds.includes("total")?[...new Set([...i.pressureKinds,r])]:i.pressureKinds,o=g(t.file),a=x(r,o),l=t.totalLines+t.delegatedComposableLines;return{file:t.file,totalLines:l,sfcLines:t.sfcLines,templateLines:t.templateLines,scriptLines:t.scriptLines,styleLines:t.styleLines,externalScriptLines:t.externalScriptLines,externalScriptPaths:t.externalScriptPaths,customBlockLines:t.customBlockLines,delegatedComposableLines:t.delegatedComposableLines,delegatedComposablePaths:t.delegatedComposablePaths,dominantPressure:r,pressureKinds:u,contextKind:o,recommendationKind:a,recommendation:f(a,o),reasons:n,loc:l}}function b(t){return[{axis:"total",value:e=>e.totalLines+e.delegatedComposableLines,qualifies:(e,i)=>i>=t.minTotalLines,reason:(e,i)=>e.delegatedComposableLines>0?`${i} total line(s) (${e.totalLines} component + ${e.delegatedComposableLines} delegated composable line(s) across ${e.delegatedComposablePaths.length} file(s))`:`${i} total component line(s)`,dominantEligible:!1},{axis:"template",value:e=>e.templateLines,qualifies:(e,i)=>i>=t.minTemplateLines,reason:(e,i)=>`${i} template line(s)`},{axis:"script",value:e=>e.scriptLines-e.externalScriptLines,qualifies:e=>e.scriptLines>=t.minScriptLines,reason:e=>`${e.scriptLines} script line(s)`},{axis:"style",value:e=>e.styleLines,qualifies:(e,i)=>i>=t.minStyleLines,reason:(e,i)=>`${i} style line(s)`},{axis:"external-script",value:e=>e.externalScriptLines,qualifies:(e,i)=>i>=t.minScriptLines},{axis:"custom-block",value:e=>e.customBlockLines,qualifies:()=>!1}]}function g(t){return t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(n=>w.has(n))||/(?:view|page|route)\.vue$/i.test(t)||/(?:^|\/)(views|pages|routes)\//i.test(t)?"route-page":"component"}function x(t,e){return t==="style"?"style-decomposition":t==="template"?"template-decomposition":t==="external-script"?"external-script-boundary":t==="custom-block"?"custom-block-review":e==="route-page"?"route-page-decomposition":t==="script"?"script-behavior-extraction":"total-size-review"}function f(t,e){switch(t){case"template-decomposition":return e==="route-page"?"Split route template sections into named panels before extracting script behavior.":"Split repeated template sections into named presentational components.";case"script-behavior-extraction":return"Extract independent script behavior into composables, controllers, or feature modules.";case"style-decomposition":return"Review UI/style decomposition; move repeated styling to component or style primitives, not composables.";case"external-script-boundary":return"Review the external script boundary and split controller/composable modules by workflow.";case"custom-block-review":return"Review custom block ownership before splitting template or script code.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"total-size-review":return"Review the largest block first, then split by the dominant reason to change."}}var w=new Set(["landing","page","pages","route","routes","view","views"]);export{y as a};
2
- //# sourceMappingURL=chunk-JTQVMR42.js.map
1
+ import{d}from"./chunk-B3X6KU75.js";import{Q as p}from"./chunk-ZLMXIQLC.js";function y(t,e={}){let{minTotalLines:i=800,minTemplateLines:n=300,minScriptLines:r=300,minStyleLines:u=500,limit:o=20,scope:a,scanLimit:l,filePattern:m}=e;return p(t).vueProfiles({scope:a,scanLimit:l}).filter(s=>!m||s.file.includes(m)).map(s=>L(s,{minTotalLines:i,minTemplateLines:n,minScriptLines:r,minStyleLines:u})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(t,e){let i=d(t,b(e),"total"),{reasons:n}=i;if(n.length===0)return null;let r=i.dominantPressure,u=i.pressureKinds.includes("total")?[...new Set([...i.pressureKinds,r])]:i.pressureKinds,o=g(t.file),a=x(r,o),l=t.totalLines+t.delegatedComposableLines;return{file:t.file,totalLines:l,sfcLines:t.sfcLines,templateLines:t.templateLines,scriptLines:t.scriptLines,styleLines:t.styleLines,externalScriptLines:t.externalScriptLines,externalScriptPaths:t.externalScriptPaths,customBlockLines:t.customBlockLines,delegatedComposableLines:t.delegatedComposableLines,delegatedComposablePaths:t.delegatedComposablePaths,dominantPressure:r,pressureKinds:u,contextKind:o,recommendationKind:a,recommendation:f(a,o),reasons:n,loc:l}}function b(t){return[{axis:"total",value:e=>e.totalLines+e.delegatedComposableLines,qualifies:(e,i)=>i>=t.minTotalLines,reason:(e,i)=>e.delegatedComposableLines>0?`${i} total line(s) (${e.totalLines} component + ${e.delegatedComposableLines} delegated composable line(s) across ${e.delegatedComposablePaths.length} file(s))`:`${i} total component line(s)`,dominantEligible:!1},{axis:"template",value:e=>e.templateLines,qualifies:(e,i)=>i>=t.minTemplateLines,reason:(e,i)=>`${i} template line(s)`},{axis:"script",value:e=>e.scriptLines-e.externalScriptLines,qualifies:e=>e.scriptLines>=t.minScriptLines,reason:e=>`${e.scriptLines} script line(s)`},{axis:"style",value:e=>e.styleLines,qualifies:(e,i)=>i>=t.minStyleLines,reason:(e,i)=>`${i} style line(s)`},{axis:"external-script",value:e=>e.externalScriptLines,qualifies:(e,i)=>i>=t.minScriptLines},{axis:"custom-block",value:e=>e.customBlockLines,qualifies:()=>!1}]}function g(t){return t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(n=>w.has(n))||/(?:view|page|route)\.vue$/i.test(t)||/(?:^|\/)(views|pages|routes)\//i.test(t)?"route-page":"component"}function x(t,e){return t==="style"?"style-decomposition":t==="template"?"template-decomposition":t==="external-script"?"external-script-boundary":t==="custom-block"?"custom-block-review":e==="route-page"?"route-page-decomposition":t==="script"?"script-behavior-extraction":"total-size-review"}function f(t,e){switch(t){case"template-decomposition":return e==="route-page"?"Split route template sections into named panels before extracting script behavior.":"Split repeated template sections into named presentational components.";case"script-behavior-extraction":return"Extract independent script behavior into composables, controllers, or feature modules.";case"style-decomposition":return"Review UI/style decomposition; move repeated styling to component or style primitives, not composables.";case"external-script-boundary":return"Review the external script boundary and split controller/composable modules by workflow.";case"custom-block-review":return"Review custom block ownership before splitting template or script code.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"total-size-review":return"Review the largest block first, then split by the dominant reason to change."}}var w=new Set(["landing","page","pages","route","routes","view","views"]);export{y as a};
2
+ //# sourceMappingURL=chunk-OHIV323X.js.map
@@ -0,0 +1,3 @@
1
+ import{a as me}from"./chunk-E7QR35ST.js";import{a as de}from"./chunk-4FR6GQIT.js";import{b as ue}from"./chunk-BOJ5SVE2.js";import{c as T}from"./chunk-2BMSSRBH.js";import{a as N}from"./chunk-BJWFVAA5.js";import{j as le}from"./chunk-YSYPDRD5.js";import{g as ae,h as ce}from"./chunk-U3SXIMII.js";import{i as oe}from"./chunk-SKKXTABJ.js";import{a as ie,b as re,c as se}from"./chunk-KK7GPALL.js";import{e as ee,f as te,h as ne}from"./chunk-NJQISBL4.js";import{b as Q}from"./chunk-FLMTCX5R.js";import{E as R,d as Z,e as $,i as G,j as J,k as K,l as q,m as V,u as X,z as Y}from"./chunk-C7C6AKAT.js";import{y as H}from"./chunk-RBAD4GJ2.js";import{A as z,E as _,a as E}from"./chunk-ZLMXIQLC.js";import{c as U,e as j,h as I,k as W}from"./chunk-ETC674NS.js";import{b as P,i as B,y as b}from"./chunk-KNLQGXVH.js";import{d as w}from"./chunk-JZ2A7LDM.js";var S=new WeakMap,fe=U({kind:"definition-exclusions",invalidation:j("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:Te});function ye(e,t){let n=z(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let i=I(e,t);if(!i)return[];let s=B(e,t,i),c=fe.read(e,t,s);if(c)return c;let u=n==="rust"?je(e,t):Me(e,t);return fe.write(e,t,s,u),u}function Te(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(ke);return n.some(r=>r===null)?null:n}catch{return null}}function ke(e){if(!e||typeof e!="object")return null;let t=e;if(typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"||t.containerName!==void 0&&typeof t.containerName!="string")return null;let n=t.disposition===void 0?Ye(t.reason):t.disposition;return n!=="exclude"&&n!=="implicit-usage"?null:{startLine:t.startLine,endLine:t.endLine,reason:t.reason,disposition:n,...t.containerName?{containerName:t.containerName}:{}}}var be=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),Ae=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Fe=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Me(e,t){let n=I(e,t);if(!n||!Oe(n))return[];let r=_(e,t);if(!r)return[];let i=S.get(r);if(i)return i;let s=!1,c=r.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let o=d.namedChild(0);if(!o)continue;let a=o.type==="member_expression"?o.namedChild(o.namedChildCount-1)?.text:o.text;if(a&&be.has(a)){s=!0;break}}let u=[];s&&u.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)",disposition:"exclude"});for(let l of c.namedChildren){let d=null,o=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,o=l;else if(l.type==="export_statement"){let a=l.namedChild(0);a?.type==="function_declaration"&&(d=a.namedChild(0)?.text??null,o=a)}else if(l.type==="lexical_declaration"){let a=l.namedChild(0);if(a?.type==="variable_declarator"){let p=a.namedChild(0)?.text,f=a.namedChild(1);p&&(f?.type==="arrow_function"||f?.type==="function_expression")&&(d=p,o=a)}}d&&/^use[A-Z]/.test(d)&&o&&u.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"React custom hook (use*)",disposition:"exclude"})}return u.push(...ge(r,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),S.set(r,u),u}function Oe(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of be)if(e.includes(n)){t=!0;break}return t&&Ae.test(e)?!0:e.includes("use")&&Fe.test(e)}var Be=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Ue(e){return Be.test(e)}function ge(e,t,n){let r=[],i=s=>{if(t.has(s.type)&&s.parent){let u=s.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===s.startIndex&&u[d].type===s.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let o=u[d];if(n.has(o.type)){if(Ue(o.text)){r.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"scip-query suppression comment",disposition:"exclude"});break}continue}if(!(o.type==="attribute_item"||o.type==="inner_attribute_item"))break}}for(let c of s.namedChildren)i(c)};return i(e.rootNode),r}function je(e,t){let n=_(e,t);if(!n)return[];let r=S.get(n);if(r)return r;let i=[],s=We(n);return s?(S.set(n,s),s):(he(n.rootNode,i,!1,!1),i.push(...ge(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),i.push(...Ve(n.rootNode)),S.set(n,i),i)}function We(e){return Qe(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)",disposition:"exclude"}]:null}function he(e,t,n,r){let i=n,s=r;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)",disposition:"implicit-usage"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(s=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)",disposition:"implicit-usage"})),e.type==="function_item"||e.type==="function_signature_item"?ze(e,t,n,r):r&&qe(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)",disposition:"implicit-usage"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?He(e,t,n):e.type==="mod_item"&&k(e).some(c=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(c))&&(i=!0);for(let c of e.namedChildren)he(c,t,i,s)}function ze(e,t,n,r){let i=k(e),s=null;r?s={reason:"trait impl method (dynamic dispatch)",disposition:"implicit-usage"}:n&&(s={reason:"inside #[cfg(test)] mod",disposition:"exclude"});for(let c of i){if(xe(c)){s={reason:"#[allow(dead_code)]",disposition:"exclude"};break}let u=Je(c);if(u){s=u;break}}s&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:s.reason,disposition:s.disposition})}function He(e,t,n){let r=k(e),i=e.namedChildren.find(s=>s.type==="type_identifier")?.text;r.some(Ke)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(...)] - generated impl may access fields",disposition:"implicit-usage",containerName:i}),r.some(xe)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",disposition:"exclude",containerName:i}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",disposition:"exclude",containerName:i})}function k(e){let t=e.parent;if(!t)return[];let n=t.children,r=-1;for(let s=0;s<n.length;s+=1)if(n[s].startIndex===e.startIndex&&n[s].type===e.type){r=s;break}if(r<=0)return[];let i=[];for(let s=r-1;s>=0;s-=1){let c=n[s];if(c.type==="attribute_item"||c.type==="inner_attribute_item")i.push(c.text);else{if(c.type==="line_comment"||c.type==="block_comment")continue;break}}return i}var Ze=new Set(["test","bench","tokio::test","async_std::test"]),$e=new Set(["no_mangle","export_name","link_name","used","macro_export","proc_macro","proc_macro_derive","proc_macro_attribute"]),Ge=new Set(["allow","warn","deny","forbid","cfg","cfg_attr","doc","inline","cold","must_use","deprecated","repr","derive","automatically_derived","non_exhaustive","path","link","link_section","global_allocator","panic_handler"]);function Je(e){if(/#\[\s*cfg\s*\(\s*test\s*\)/.test(e))return{reason:"#[cfg(test)]",disposition:"exclude"};let t=Xe(e);return t?Ze.has(t)?{reason:`#[${t}]`,disposition:"exclude"}:$e.has(t)?{reason:`Rust ABI/export attribute #[${t}]`,disposition:"implicit-usage"}:Ge.has(t)?null:{reason:`Rust attribute macro #[${t}]`,disposition:"implicit-usage"}:null}function Ke(e){return/#\[\s*derive\s*\(/.test(e)}function xe(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function qe(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ve(e){let t=et(e);if(t.size===0)return[];let n=[];for(let r of e.descendantsOfType("mod_item")){let i=r.childForFieldName("name")?.text;i&&t.has(i)&&n.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:'attribute `with = "..."` module - body may be invoked via reflection',disposition:"implicit-usage",containerName:i})}return n}function Xe(e){let t=/^#!?\[\s*([A-Za-z_][A-Za-z0-9_]*(?:\s*::\s*[A-Za-z_][A-Za-z0-9_]*)*)/.exec(e);return t?t[1].replace(/\s+/g,""):null}function Ye(e){return e==="#[tauri::command]"||e==="#[command]"||e==="#[wasm_bindgen]"||e==="#[no_mangle]"||e==="#[napi]"||e==="#[pyfunction]"||e==="#[pymethod]"||e==="#[pyo3]"||e==="#[doc(hidden)]"||e.startsWith("trait ")||e.startsWith("#[derive(<reflective>)]")||e.startsWith("#[derive(...)]")||e.startsWith('serde `with = "')||e.startsWith('attribute `with = "')||e.startsWith("Rust attribute macro #[")||e.startsWith("Rust ABI/export attribute #[")?"implicit-usage":"exclude"}function Qe(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var pe=/\bwith\s*=\s*"([^"]+)"/g;function et(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){pe.lastIndex=0;let r;for(;(r=pe.exec(n.text))!==null;){let i=r[1],s=i.split("::").pop()??i;s&&t.add(s)}}return t}function _e(e){let t=A(e);return(n,r,i,s)=>t(n,r,i,s)?.disposition==="exclude"}function A(e){let t=new Map,n=r=>{let i=t.get(r);if(i)return i;let s=ye(e,r),c=new Map;for(let u of s){if(!u.containerName)continue;let l=c.get(u.containerName)??[];l.push(u),c.set(u.containerName,l)}return i={ranges:s,containers:c},t.set(r,i),i};return(r,i,s,c)=>{let u=n(r),l=[];for(let o of u.ranges)i>=o.startLine&&i<=o.endLine&&l.push(o);let d=new Set;c&&d.add(c);for(let o of R(s))d.add(o);for(let o of d){let a=u.containers.get(o);a&&l.push(...a)}return tt(l)}}function tt(e){if(e.length===0)return null;let n=e.find(r=>r.disposition==="exclude")??e[0];return{disposition:n.disposition,reason:n.reason}}function Lt(e,t={}){P(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function Se(e,t,n={}){P(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function Ee(e,t){if(t.isIgnoredPath(e.relativePath))return y("ignored-file");if(K(e.symbol))return y("module-like-symbol");if(!C(e.symbol))return y("non-value-symbol");if(!e.isFunctionLike&&e.enclosingSymbol&&C(e.enclosingSymbol))return y("nested-non-callable-value");if(!t.includeTests&&!nt(e.relativePath))return y("test-file");if(!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName))return y("excluded-file-region");let n=$(e.symbol);if(n==="<constructor>")return y("implicit-constructor");if(e.symbol.startsWith("scip-python ")){if(n==="__all__")return y("python-runtime-metadata");if(/^__[^_].*__$/.test(n))return y("python-protocol-member")}return t.isDeclarationOnlyCallable()?y("declaration-only-callable"):t.isFrameworkContractCallable()?y("framework-contract-member"):q(e.symbol)?y("rust-trait-impl-member"):V(e.symbol)?y("rust-test-module"):!t.includeMembers&&!it(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}}function nt(e){return Q(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function C(e){return J(e)||e.endsWith("().")||e.endsWith(".")}function it(e){return G(e.symbol)||R(e.symbol).length===0}function Re(){return new Map}function Ce(e,t,n){let r=new Map;for(let i of ie(e,n))e.isIgnored(i.relative_path)||t.has(i.relative_path)||D(r,i.symbol_id,i.relative_path,i.ref_count,"scip-mention");return r}function ve(e,t,n,r={}){let i=new Set;if(r.conservative||n.size===0){for(let s of se(e,t))i.add(s.symbol_id);return i}for(let s of re(e,t))e.isIgnored(s.relative_path)||n.has(s.relative_path)||i.add(s.symbol_id);return i}function F(e,t){let n=e.get(t);if(!n)return!1;for(let r of n.values())if(r.occurrences>0)return!0;return!1}function v(e,t,n){let r=e.get(t);if(!r)return!1;for(let[i,s]of r)if(i!==n&&s.occurrences>0)return!0;return!1}function De(e){return e?.occurrences??0}function D(e,t,n,r,i="source-fallback"){if(r<=0)return;let s=we(e,t,n);s.occurrences+=r,s.sources.add(i)}function Le(e,t,n,r,i){if(r<=0)return;let s=we(e,t,n);s.occurrences=Math.max(r,s.occurrences),s.sources.add(i)}function we(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=r.get(n);return i||(i={occurrences:0,sources:new Set},r.set(n,i)),i}var rt=64,st=300;function nn(e,t={}){let{scope:n,minLoc:r=1,includeTests:i=!1,skipBarrels:s=!1,includeMembers:c=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,o=0,a=b("dead.candidates",()=>{let m=ue(ot(e,{scope:n,minLoc:r,includeTests:i,includeMembers:c}),l);return o=m.length,m},()=>({definitions:o})),p=0,f=s?b("dead.inactive-barrels",()=>{let m=new Set(ee(e));return p=m.size,m},()=>({paths:p})):new Set,x=0,g=u?Re():b("dead.mention-reference-counts",()=>{let m=Ce(e,f,a.map(L=>L.symbolId));return x=m.size,m},()=>({definitions:a.length,symbolsWithReferences:x})),M=0,Ie=u?b("dead.mentioned-symbol-ids",()=>{let m=ve(e,a.map(L=>L.symbolId),f,{conservative:f.size===0});return M=m.size,m},()=>({definitions:a.length,referencedSymbols:M})):new Set,h=u?a.filter(m=>!Ie.has(m.symbolId)):a.filter(m=>!v(g,m.symbolId,m.relativePath));u?b("dead.source-fallback.dead-code-only",()=>ft(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0})):b("dead.source-fallback.ast",()=>mt(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0}));let O=u?h.filter(m=>!F(g,m.symbolId)):h.filter(m=>!v(g,m.symbolId,m.relativePath));b("dead.caller-map-supplement",()=>gt(e,O,g,{inactiveBarrelPaths:f,includeSemantic:!u&&d}),()=>({definitions:O.length,semantic:!u&&d}));let Ne=u?h.filter(m=>!F(g,m.symbolId)):a;return dt(e,lt(Ne,g))}function ot(e,t){let n=_e(e),r=[];for(let i of Y(e,{scope:t.scope,symbolMatches:C,sqlPrefilter:"function-like"}))Ee(i,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:n,isDeclarationOnlyCallable:()=>ct(e,i),isFrameworkContractCallable:()=>me(e,i)}).accepted&&r.push(i);return r}var at=["method_signature","abstract_method_signature","call_signature","construct_signature"];function ct(e,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let n=_(e,t.relativePath);if(n)return n.rootNode.descendantsOfType([...at]).some(i=>i.startPosition.row<=t.startLine&&i.endPosition.row>=t.endLine);let r=W(e,t.relativePath).slice(t.startLine,t.endLine+1).join(`
2
+ `).trim();return r.endsWith(";")&&!r.includes("=>")&&!r.includes("{")}function lt(e,t){return e.map(n=>ut(n,t)).filter(n=>n.cross_file_refs===0).sort((n,r)=>r.loc-n.loc||n.relative_path.localeCompare(r.relative_path)||n.start_line-r.start_line)}function ut(e,t){let n=t.get(e.symbolId)??new Map,r=De(n.get(e.relativePath)),i=0;for(let[s,c]of n)s!==e.relativePath&&(i+=c.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,parent_type_name:e.parentTypeName,same_file_refs:r,cross_file_refs:i}}function dt(e,t){let n=A(e),r=[],i=0,s=0,c=0,u=0,l=0,d=0,o=0;for(let a of t){if(e.isIgnored(a.relative_path))continue;if(te(e,a.relative_path)){u++;continue}if(de(a.relative_path)){d++;continue}if(ne(e,a.symbol,a.relative_path)){l++;continue}let p=n(a.relative_path,a.start_line,a.symbol,a.parent_type_name),f=p?.disposition==="implicit-usage"?p.reason:void 0,x=f?"implicit-usage":a.same_file_refs===0?"dead-code":"file-internal";x==="dead-code"?i++:x==="file-internal"?s++:c++,o+=a.loc,r.push({relativePath:a.relative_path,startLine:a.start_line,endLine:a.end_line,loc:a.loc,symbol:a.symbol,shortName:Z(a.symbol),sameFileRefs:a.same_file_refs,kind:x,...f?{implicitUsageReason:f}:{}})}return{symbols:r,counts:{total:r.length,deadCode:i,fileInternal:s,implicitUsage:c,loc:o},applicability:{entrySurfaceExcluded:u,externalRootExcluded:l,generatedArtifactExcluded:d,implicitUsageSignals:c},totalCount:r.length,deadCodeCount:i,fileInternalCount:s,implicitUsageCount:c,totalLoc:o}}function mt(e,t,n,r){if(t.length===0)return;let i=new T(e),s=new Set(t.map(l=>l.symbolId)),c=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(i.sourceFiles());for(let l of E(e))u.add(l);i.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:l=>r.inactiveBarrelPaths.has(l)},l=>{s.has(l.target.symbolId)&&(yt(e,l)||D(n,l.target.symbolId,l.sourceFile,bt(l),"source-fallback"))})}function ft(e,t,n,r){if(t.length===0)return;let i=new T(e),s=X(t),c=new Set(i.sourceFiles());for(let o of E(e))c.add(o);let u=new Set(s.keys()),l=new Map,d=o=>{let a=l.get(o);return a||(a=oe(e,o),l.set(o,a)),a};i.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:o=>r.inactiveBarrelPaths.has(o),resolveTargets:({sourceFile:o,name:a,kind:p})=>{let f=s.get(a);return f?pt(o,a,f,()=>d(o),{permissive:p!=="cross-language-dispatch"}):[]},afterPath:o=>{l.delete(o),Se(e,o)}},o=>{let a=o.kind==="identifier"&&o.sourceFile===o.target.relativePath?Math.max(0,o.occurrences-1):o.occurrences;o.kind==="identifier"&&Pe(e,{sourceFile:o.sourceFile,name:o.name,target:o.target,occurrences:a})||D(n,o.target.symbolId,o.sourceFile,a,"source-fallback")})}function pt(e,t,n,r,i){let s=n.filter(d=>d.relativePath===e);if(s.length>0)return s;if(!i.permissive&&n.length===1)return[...n];let c=r(),u=c.get(t);if(u)for(let d of u){let o=n.filter(a=>w(d,a.relativePath));if(o.length>0)return o}let l=new Set;for(let d of c.values())for(let o of d)l.add(o);for(let d of l){let o=n.filter(a=>w(d,a.relativePath));if(o.length>0&&o.length===n.length)return o}return i.permissive?[...n]:[]}function yt(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&Pe(e,t)}function bt(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function Pe(e,t){return t.occurrences>1?!1:H(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function gt(e,t,n,r){let i=r.includeSemantic!==!1,s=i&&t.length>=rt&&E(e).length>=st,c=(o,a)=>{a===o.relativePath||e.isIgnored(a)||r.inactiveBarrelPaths.has(a)||Le(n,o.symbolId,a,1,"caller-map")};if(s?b("dead.caller-map.per-symbol-non-semantic",()=>{let o=ce(e,t,{semantic:!1,semanticEvidence:N});for(let a of t){let p=o.get(a.symbolId)??[];for(let f of p)c(a,f.file)}},()=>({definitions:t.length,semantic:!1,batched:!0})):b("dead.caller-map.per-symbol",()=>{for(let o of t){let a=ae(e,o,{semantic:i,semanticEvidence:N});if(a.length!==0)for(let p of a)c(o,p.file)}},()=>({definitions:t.length,semantic:i})),!s)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let o=t.filter(a=>!v(n,a.symbolId,a.relativePath));return u=o.length,o},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=le(e,l);for(let o of l){let a=d.get(o.symbolId);if(a)for(let p of a)c(o,p)}}export{Lt as a,nn as b};
3
+ //# sourceMappingURL=chunk-OIAPEKMT.js.map
@@ -0,0 +1,3 @@
1
+ import{b as E}from"./chunk-FJF6VO2P.js";import{c as d}from"./chunk-XKXTR6ZI.js";import{b as L}from"./chunk-BOJ5SVE2.js";import{a as m}from"./chunk-BGBBVSH4.js";import{j as x}from"./chunk-NJQISBL4.js";import{b}from"./chunk-FLMTCX5R.js";import{d as B,e as D,w as h}from"./chunk-C7C6AKAT.js";import{b as g}from"./chunk-RBAD4GJ2.js";import{k as f,n as y}from"./chunk-ETC674NS.js";import{createHash as G}from"crypto";var C=3;function Q(e,t={}){return T(e,t).groups}function T(e,t={}){let{scope:n,maxLoc:i=15,minLoc:o=C,limit:r,scanLimit:s}=t,a=d(e),l=v(e,{scope:n,maxLoc:i,scanLimit:s}).map(p=>P(e,p,a,o)).filter(p=>p!==null),{groups:u,exclusions:c}=F(e,M(l));return{groups:r?u.slice(0,r):u,exclusions:c}}var W=/^(?:GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD|default|loader|action|load|actions)$/;function F(e,t){let n=new Map,i=(r,s)=>{let a=n.get(r);a?a.count+=1:n.set(r,{reason:r,detail:s,count:1})},o=[];for(let r of t){let s=[];for(let a of r.functions){let l=O(e,a);if(l){i(l.reason,l.detail);continue}s.push(a)}s.length<2||new Set(s.map(a=>a.file)).size<2||o.push({hash:r.hash,canonical:s[0],functions:s})}return{groups:o,exclusions:[...n.values()].sort((r,s)=>r.reason.localeCompare(s.reason))}}function O(e,t){let n=D(t.symbol);return n.startsWith("<")&&n.endsWith(">")?{reason:"synthetic-members",detail:"duplicate constructors and other compiler-named members every class carries"}:b(t.file)==="test"?{reason:"test-file-members",detail:"duplicate bodies in test files (fixture reuse, not product duplication)"}:W.test(n)&&x(t.file)?{reason:"framework-route-exports",detail:"duplicate route-file verb exports whose identical glue the framework convention dictates"}:E(e,t.file)?{reason:"ui-kit-members",detail:"duplicate bodies in vendored UI-kit directories generated from one template"}:null}function Z(e,t,n={}){let{scope:i,maxLoc:o=15,minLoc:r=C,scanLimit:s}=n,a=d(e),l=v(e,{scope:i,maxLoc:o,scanLimit:s}).map(c=>P(e,c,a,r)).filter(c=>c!==null),u=l.find(c=>c.symbol===t);return u?l.filter(c=>c.symbol!==u.symbol&&c.normalizedBody===u.normalizedBody&&c.file!==u.file).sort(I).map(({normalizedBody:c,...p})=>p):[]}function w(e){let t=k(e);return g(t).replace(/\s+/g,"")}function M(e){let t=new Map;for(let i of e){if(i.normalizedBody.length<8)continue;let o=H(i.normalizedBody),r=t.get(o)??[];r.push(i),t.set(o,r)}let n=[];for(let[i,o]of t){let r=new Set(o.map(a=>a.file));if(o.length<2||r.size<2)continue;let s=[...o].sort(I).map(({normalizedBody:a,...l})=>l);n.push({hash:i,canonical:s[0],functions:s})}return n.sort((i,o)=>{let r=o.functions.length-i.functions.length;if(r!==0)return r;let s=z(o)-z(i);return s!==0?s:i.canonical.file.localeCompare(o.canonical.file)}),n}function v(e,t){let n=h(e,{scope:t.scope}).filter(i=>i.isFunctionLike&&!e.isIgnored(i.relativePath)).filter(i=>!y(e,i.relativePath,i.startLine,"similar")).filter(i=>m(i)<=t.maxLoc);return n.sort((i,o)=>m(o)-m(i)||i.relativePath.localeCompare(o.relativePath)),L(n,t.scanLimit)}function P(e,t,n,i){let o=A(e,t);if(!o||_(o)<i)return null;let r=R(e,t);return r?{symbol:t.symbol,shortName:B(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:n?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function R(e,t){let n=A(e,t);return n&&w(n)||null}function A(e,t){let n=f(e,t.relativePath);return n.length===0?null:n.slice(t.startLine,t.endLine+1).join(`
2
+ `)}function k(e){let t=0;for(let n=0;n<e.length;n+=1){let i=e[n];if(i==="("||i==="[")t+=1;else if(i===")"||i==="]")t=Math.max(0,t-1);else if(i==="{"){if(t===0)return S(e,n);t+=1}else if(i==="}")t=Math.max(0,t-1);else if(t===0&&i==="="&&e[n+1]===">"){let o=e.slice(n+2).trimStart();return o.startsWith("{")?S(o,0):o.replace(/;+\s*$/,"")}}return e}function S(e,t){let n=e.lastIndexOf("}");return n>t?e.slice(t+1,n):e}function _(e){return k(e).split(/\r?\n/).map(n=>n.trim()).filter(n=>n.length>0).length}function H(e){return G("sha256").update(e).digest("hex").slice(0,16)}function I(e,t){let n=e.ageCommits??-1;return(t.ageCommits??-1)-n||e.file.localeCompare(t.file)||e.startLine-t.startLine}function z(e){return e.functions.reduce((t,n)=>t+n.loc,0)}export{Q as a,T as b,Z as c,w as d,M as e,R as f,A as g,k as h};
3
+ //# sourceMappingURL=chunk-OIOC5EHF.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-4FTZ4P5G.js";import{r as o}from"./chunk-KYSDI3GE.js";function g(e,r){return s(e).filter(t=>c({pattern:r,relativePath:t})).map(t=>({relativePath:t}))}function c(e,r){let t=typeof e=="string"?{pattern:e,relativePath:r}:e;if(typeof t.pattern!="string"||typeof t.relativePath!="string")throw new TypeError("pathMatchesGlob requires pattern and relativePath.");let n=o(t.pattern),a=o(t.relativePath);if(!/[*?]/.test(n))return a.includes(n);let l=n.includes("/")?n:`**/${n}`;return i(l.split("/"),a.split("/"))}function i(e,r){if(e.length===0)return r.length===0;let[t,...n]=e;return t==="**"?i(n,r)||r.length>0&&i(e,r.slice(1)):r.length===0||!f(t??"",r[0]??"")?!1:i(n,r.slice(1))}function f(e,r){let t="^";for(let n of e)n==="*"?t+="[^/]*":n==="?"?t+="[^/]":t+=p(n);return t+="$",new RegExp(t).test(r)}function p(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}export{g as a,c as b};
2
- //# sourceMappingURL=chunk-YBGKCQIS.js.map
1
+ import{a as s}from"./chunk-ZGIQN2SX.js";import{f as o}from"./chunk-JZ2A7LDM.js";function g(e,r){return s(e).filter(t=>c({pattern:r,relativePath:t})).map(t=>({relativePath:t}))}function c(e,r){let t=typeof e=="string"?{pattern:e,relativePath:r}:e;if(typeof t.pattern!="string"||typeof t.relativePath!="string")throw new TypeError("pathMatchesGlob requires pattern and relativePath.");let n=o(t.pattern),a=o(t.relativePath);if(!/[*?]/.test(n))return a.includes(n);let l=n.includes("/")?n:`**/${n}`;return i(l.split("/"),a.split("/"))}function i(e,r){if(e.length===0)return r.length===0;let[t,...n]=e;return t==="**"?i(n,r)||r.length>0&&i(e,r.slice(1)):r.length===0||!f(t??"",r[0]??"")?!1:i(n,r.slice(1))}function f(e,r){let t="^";for(let n of e)n==="*"?t+="[^/]*":n==="?"?t+="[^/]":t+=p(n);return t+="$",new RegExp(t).test(r)}function p(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}export{g as a,c as b};
2
+ //# sourceMappingURL=chunk-ONPPQM4G.js.map
@@ -1,2 +1,2 @@
1
- import{e as f}from"./chunk-2WC2OEDO.js";import{a as L}from"./chunk-HOENASQM.js";import{C as l,p as a}from"./chunk-3L2ZBPEX.js";import{c as i,d as b,e as u,k as c}from"./chunk-DRENNWRG.js";function S(o,s){let t=L(o,s);if(!t)return[];let e=new f(o).definitionsForFile(t.relativePath).filter(r=>r.symbol!==t.symbol).filter(r=>c(t.symbol,r.symbol)).sort((r,m)=>r.startLine-m.startLine||r.endLine-m.endLine).map(r=>({symbol:r.symbol,shortName:i(r.symbol),startLine:r.startLine,endLine:r.endLine,kind:u(r.symbol)??"unknown"}));return a(t.relativePath)!=="clojure"?e:d(e,y(o,t))}function y(o,s){let t=b(s.symbol);if(!t)return[];let n=i(s.symbol);return(l(o,s.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({symbol:`${s.symbol}${e.memberName}().`,shortName:`${n}:${e.memberName}()`,startLine:e.startLine,endLine:e.endLine,kind:e.memberKind}))}function d(o,s){let t=new Map;for(let n of[...o,...s])t.set(`${n.shortName}:${n.startLine}:${n.endLine}`,n);return[...t.values()].sort((n,e)=>n.startLine-e.startLine||n.endLine-e.endLine)}export{S as a};
2
- //# sourceMappingURL=chunk-64BFSI5I.js.map
1
+ import{e as f}from"./chunk-JFMI5SGB.js";import{a as L}from"./chunk-2USA3S3P.js";import{C as l,p as a}from"./chunk-2VAHDDLM.js";import{c as i,d as b,e as u,k as c}from"./chunk-BL6DCHQP.js";function S(o,s){let t=L(o,s);if(!t)return[];let e=new f(o).definitionsForFile(t.relativePath).filter(r=>r.symbol!==t.symbol).filter(r=>c(t.symbol,r.symbol)).sort((r,m)=>r.startLine-m.startLine||r.endLine-m.endLine).map(r=>({symbol:r.symbol,shortName:i(r.symbol),startLine:r.startLine,endLine:r.endLine,kind:u(r.symbol)??"unknown"}));return a(t.relativePath)!=="clojure"?e:d(e,y(o,t))}function y(o,s){let t=b(s.symbol);if(!t)return[];let n=i(s.symbol);return(l(o,s.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({symbol:`${s.symbol}${e.memberName}().`,shortName:`${n}:${e.memberName}()`,startLine:e.startLine,endLine:e.endLine,kind:e.memberKind}))}function d(o,s){let t=new Map;for(let n of[...o,...s])t.set(`${n.shortName}:${n.startLine}:${n.endLine}`,n);return[...t.values()].sort((n,e)=>n.startLine-e.startLine||n.endLine-e.endLine)}export{S as a};
2
+ //# sourceMappingURL=chunk-OUHEZBYI.js.map
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{A as R,C as ce,F as P,a as y,b as re,i as k,j as ie,v as T,w as se,y as j,z as ae}from"./chunk-6PQNKL3G.js";import{Kb as Z,Yb as h,Zb as ee,_b as C,ac as E,pc as te,q as H,r as X,rc as ne,vc as oe,y as w}from"./chunk-NOYBFVJA.js";import{$c as D,_b as q,ad as x,cd as I,ld as _,md as Q,od as Y,tc as L,xc as z}from"./chunk-66DVSJQG.js";function de(t,n,e){if(!Number.isSafeInteger(e.limit)||e.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=D(t,n);if(!o)return{rows:[],hasMore:!1,producer:e.producer??"source-keyset",semanticEnrichment:!1};if(e.producer==="complete-only"||e.semantic===!0||o.relativePath.endsWith(".rb"))return B(t,n,e);let s=_(t,o);if(!s)return B(t,n,e);let i=ue(t,o),c=De(t,i),a=[],l=e.producer==="source-keyset";for(let u of c){if(e.after&&u<e.after.relativePath)continue;e.instrumentation?.fileScanned?.(u);let p=Q(t,s,u);p.length>0&&(l=!0);let d=new Set(p);i?.relativePath===u&&d.add(i.line);for(let m of[...d].sort((f,Ne)=>f-Ne)){let f={relativePath:u,line:m};if(!(e.after&&b(f,e.after)<=0)&&(a.push(f),e.instrumentation?.rowAccepted?.(f),l&&a.length>e.limit))return le(a,e.limit)}}return l?le(a,e.limit):B(t,n,e,i)}function b(t,n){return(t.relativePath<n.relativePath?-1:t.relativePath>n.relativePath?1:0)||t.line-n.line}function le(t,n){return{rows:t.slice(0,n),hasMore:t.length>n,producer:"source-keyset",semanticEnrichment:!1}}function B(t,n,e,o){let r=D(t,n),s=e.semantic===!0||r?.relativePath.endsWith(".rb")?w(t,n,{semantic:e.semantic}):Le(t,n,o),i=Ie(s).filter(c=>!e.after||b(c,e.after)>0);for(let c of i.slice(0,e.limit+1))e.instrumentation?.rowAccepted?.(c);return{rows:i.slice(0,e.limit),hasMore:i.length>e.limit,producer:"complete-only",semanticEnrichment:e.semantic===!0}}function Le(t,n,e){let o=D(t,n);if(!o)return[];let r=e===void 0?ue(t,o):e,s=Y(t,o).map(i=>({relativePath:i.file,line:i.line}));return r?[r,...s]:s}function ue(t,n){return!z(n.symbol)&&!t.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function De(t,n){let e=q(t);return!n||e.includes(n.relativePath)?e:[...e,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function Ie(t){let n=new Map;for(let e of t)n.set(`${e.relativePath}\0${e.line}`,e);return[...n.values()].sort(b)}import{InvalidArgumentError as v}from"commander";var gt=Z,ke=/^[+-]?\d+$/u,Ae=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,pt=(t=>G(t,"an integer")),me=(t=>{let n=G(t,"a non-negative integer");if(n<0)throw new v(`Expected a non-negative integer, got "${t}".`);return n}),fe=(t=>{let n=G(t,"a positive integer");if(n<1)throw new v(`Expected a positive integer, got "${t}".`);return n}),ht=(t=>{if(!Ae.test(t))throw new v(`Expected a number, got "${t}".`);let n=Number(t);if(!Number.isFinite(n))throw new v(`Expected a finite number, got "${t}".`);return n});function G(t,n){if(!ke.test(t))throw new v(`Expected ${n}, got "${t}".`);let e=Number(t);if(!Number.isSafeInteger(e))throw new v(`Expected ${n}, got "${t}".`);return e}function g(t,n,e,...o){return o.length>0?{flags:t,description:n,parser:e,defaultValue:o[0]}:{flags:t,description:n,parser:e}}function Me(){return g("--json","Output as JSON for programmatic consumption")}function Te(){return g("--compact","Emit minified one-line JSON (use with --json)")}function je(){return g("--result-only","Emit only the command-owned result (use with --json)")}function ge(t=[]){return A(t)}function A(t=[]){let n=[Me(),je(),Te()],e=new Set(n.map(o=>o.flags));return[...t.filter(o=>!e.has(o.flags)),...n]}function $(t,n=[]){return{category:t,examples:n}}function Ct(t,n){return{origin:"mixed",observedSources:t,producerValidation:{status:"not-evaluated"},families:n}}function yt(t,n){return{origin:t,observedSources:n,producerValidation:{status:"not-evaluated"}}}function Rt(t,n,e){return{id:t,selector:n,origin:{kind:"fixed",origin:e}}}function bt(t,n,e,o){return{id:t,selector:n,origin:{kind:"result-field",field:e,values:o}}}function O(t,n,e,o,r,s,i){return{answers:typeof t=="string"?[t]:t,returns:typeof n=="string"?[n]:n,inputs:e,coverage:o,operation:s,semantic:i,...r?{scope:r}:{}}}function vt(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,F(i.join(" "),c.join("; "),["This command establishes only its declared result units and evidence contract."],void 0,{outputCost:o==="complete"?"bounded":"variable"}))}function pe(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,Be(c.join("; "),["This command does not establish repository graph relationships unless its result says so explicitly."]))}function he(t,n,e={ranking:"identity-only"}){return{kind:"locator",locates:t,nonClaims:n,outputCost:"small",frontierClosure:["evidence","inspect","code"],...e}}function St(t){return{kind:"graph-projection",outputCost:"bounded",frontierClosure:["inspect","code"],...t}}function Ce(t,n,e,o={}){return{kind:"source-read",reads:t,nonClaims:n,outputCost:"potentially-large",frontierClosure:[],...e?{compatibility:e}:{},...o}}function F(t,n,e,o,r={}){return{kind:"analysis",analysis:t,resultMeaning:n,nonClaims:e,outputCost:"bounded",frontierClosure:["inspect","code"],...o?{compatibility:o}:{},...r}}function Be(t,n,e,o={}){return{kind:"maintenance",effect:t,nonClaims:n,outputCost:"variable",frontierClosure:[],...e?{compatibility:e}:{},...o}}function V(t){return Buffer.from(JSON.stringify(t),"utf8").toString("base64url")}function M(t){return t.generation.identity}function J(t){return"after"in t?V({version:2,...t}):V({version:1,...t})}function ye(t,n){let e=Ve(t);if(!Ge(e)&&!Fe(e))throw new Error("Invalid result cursor. Run the command again without --cursor.");return Je(e,n),e}function Ge(t){if(!t||typeof t!="object")return!1;let n=t;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Fe(t){if(!t||typeof t!="object")return!1;let n=t,e=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!e&&typeof e.relativePath=="string"&&e.relativePath.length>0&&Number.isSafeInteger(e.line)&&(e.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Ve(t){try{return JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function Je(t,n){if(t.command!==n.command||t.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(t.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function N(t,n){let e=x(t,n);return e.match?{matched:!0,resolved:{symbol:e.match.symbol,shortName:L(e.match.symbol),relativePath:e.match.relativePath},otherMatches:e.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:e.total}:{matched:!1,suggestions:I(t,n,5)}}function Re(t){let n=t.entries[0];return t.requested===1&&n?.status==="matched"&&n.kind==="source"&&(!n.rangeCoverage||n.rangeCoverage.referencedDefinitions===0)&&n.results.length===1?n.results[0]:null}function be(t,n,e){if(!e)return N(t,n);let o={file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
2
+ import{A as R,C as ce,F as P,a as y,b as re,i as k,j as ie,v as T,w as se,y as j,z as ae}from"./chunk-DUULLZHZ.js";import{Kb as Z,Yb as h,Zb as ee,_b as C,ac as E,pc as te,q as H,r as X,rc as ne,vc as oe,y as w}from"./chunk-NWLVNU66.js";import{Bc as z,ac as q,dd as D,ed as x,gd as I,pd as _,qd as Q,sd as Y,vc as L}from"./chunk-2XWIUW5Z.js";function de(t,n,e){if(!Number.isSafeInteger(e.limit)||e.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=D(t,n);if(!o)return{rows:[],hasMore:!1,producer:e.producer??"source-keyset",semanticEnrichment:!1};if(e.producer==="complete-only"||e.semantic===!0||o.relativePath.endsWith(".rb"))return B(t,n,e);let s=_(t,o);if(!s)return B(t,n,e);let i=ue(t,o),c=De(t,i),a=[],l=e.producer==="source-keyset";for(let u of c){if(e.after&&u<e.after.relativePath)continue;e.instrumentation?.fileScanned?.(u);let p=Q(t,s,u);p.length>0&&(l=!0);let d=new Set(p);i?.relativePath===u&&d.add(i.line);for(let m of[...d].sort((f,Ne)=>f-Ne)){let f={relativePath:u,line:m};if(!(e.after&&b(f,e.after)<=0)&&(a.push(f),e.instrumentation?.rowAccepted?.(f),l&&a.length>e.limit))return le(a,e.limit)}}return l?le(a,e.limit):B(t,n,e,i)}function b(t,n){return(t.relativePath<n.relativePath?-1:t.relativePath>n.relativePath?1:0)||t.line-n.line}function le(t,n){return{rows:t.slice(0,n),hasMore:t.length>n,producer:"source-keyset",semanticEnrichment:!1}}function B(t,n,e,o){let r=D(t,n),s=e.semantic===!0||r?.relativePath.endsWith(".rb")?w(t,n,{semantic:e.semantic}):Le(t,n,o),i=Ie(s).filter(c=>!e.after||b(c,e.after)>0);for(let c of i.slice(0,e.limit+1))e.instrumentation?.rowAccepted?.(c);return{rows:i.slice(0,e.limit),hasMore:i.length>e.limit,producer:"complete-only",semanticEnrichment:e.semantic===!0}}function Le(t,n,e){let o=D(t,n);if(!o)return[];let r=e===void 0?ue(t,o):e,s=Y(t,o).map(i=>({relativePath:i.file,line:i.line}));return r?[r,...s]:s}function ue(t,n){return!z(n.symbol)&&!t.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function De(t,n){let e=q(t);return!n||e.includes(n.relativePath)?e:[...e,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function Ie(t){let n=new Map;for(let e of t)n.set(`${e.relativePath}\0${e.line}`,e);return[...n.values()].sort(b)}import{InvalidArgumentError as v}from"commander";var gt=Z,ke=/^[+-]?\d+$/u,Ae=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,pt=(t=>G(t,"an integer")),me=(t=>{let n=G(t,"a non-negative integer");if(n<0)throw new v(`Expected a non-negative integer, got "${t}".`);return n}),fe=(t=>{let n=G(t,"a positive integer");if(n<1)throw new v(`Expected a positive integer, got "${t}".`);return n}),ht=(t=>{if(!Ae.test(t))throw new v(`Expected a number, got "${t}".`);let n=Number(t);if(!Number.isFinite(n))throw new v(`Expected a finite number, got "${t}".`);return n});function G(t,n){if(!ke.test(t))throw new v(`Expected ${n}, got "${t}".`);let e=Number(t);if(!Number.isSafeInteger(e))throw new v(`Expected ${n}, got "${t}".`);return e}function g(t,n,e,...o){return o.length>0?{flags:t,description:n,parser:e,defaultValue:o[0]}:{flags:t,description:n,parser:e}}function Me(){return g("--json","Output as JSON for programmatic consumption")}function Te(){return g("--compact","Emit minified one-line JSON (use with --json)")}function je(){return g("--result-only","Emit only the command-owned result (use with --json)")}function ge(t=[]){return A(t)}function A(t=[]){let n=[Me(),je(),Te()],e=new Set(n.map(o=>o.flags));return[...t.filter(o=>!e.has(o.flags)),...n]}function $(t,n=[]){return{category:t,examples:n}}function Ct(t,n){return{origin:"mixed",observedSources:t,producerValidation:{status:"not-evaluated"},families:n}}function yt(t,n){return{origin:t,observedSources:n,producerValidation:{status:"not-evaluated"}}}function Rt(t,n,e){return{id:t,selector:n,origin:{kind:"fixed",origin:e}}}function bt(t,n,e,o){return{id:t,selector:n,origin:{kind:"result-field",field:e,values:o}}}function O(t,n,e,o,r,s,i){return{answers:typeof t=="string"?[t]:t,returns:typeof n=="string"?[n]:n,inputs:e,coverage:o,operation:s,semantic:i,...r?{scope:r}:{}}}function vt(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,F(i.join(" "),c.join("; "),["This command establishes only its declared result units and evidence contract."],void 0,{outputCost:o==="complete"?"bounded":"variable"}))}function pe(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,Be(c.join("; "),["This command does not establish repository graph relationships unless its result says so explicitly."]))}function he(t,n,e={ranking:"identity-only"}){return{kind:"locator",locates:t,nonClaims:n,outputCost:"small",frontierClosure:["evidence","inspect","code"],...e}}function St(t){return{kind:"graph-projection",outputCost:"bounded",frontierClosure:["inspect","code"],...t}}function Ce(t,n,e,o={}){return{kind:"source-read",reads:t,nonClaims:n,outputCost:"potentially-large",frontierClosure:[],...e?{compatibility:e}:{},...o}}function F(t,n,e,o,r={}){return{kind:"analysis",analysis:t,resultMeaning:n,nonClaims:e,outputCost:"bounded",frontierClosure:["inspect","code"],...o?{compatibility:o}:{},...r}}function Be(t,n,e,o={}){return{kind:"maintenance",effect:t,nonClaims:n,outputCost:"variable",frontierClosure:[],...e?{compatibility:e}:{},...o}}function V(t){return Buffer.from(JSON.stringify(t),"utf8").toString("base64url")}function M(t){return t.generation.identity}function J(t){return"after"in t?V({version:2,...t}):V({version:1,...t})}function ye(t,n){let e=Ve(t);if(!Ge(e)&&!Fe(e))throw new Error("Invalid result cursor. Run the command again without --cursor.");return Je(e,n),e}function Ge(t){if(!t||typeof t!="object")return!1;let n=t;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Fe(t){if(!t||typeof t!="object")return!1;let n=t,e=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!e&&typeof e.relativePath=="string"&&e.relativePath.length>0&&Number.isSafeInteger(e.line)&&(e.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Ve(t){try{return JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function Je(t,n){if(t.command!==n.command||t.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(t.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function N(t,n){let e=x(t,n);return e.match?{matched:!0,resolved:{symbol:e.match.symbol,shortName:L(e.match.symbol),relativePath:e.match.relativePath},otherMatches:e.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:e.total}:{matched:!1,suggestions:I(t,n,5)}}function Re(t){let n=t.entries[0];return t.requested===1&&n?.status==="matched"&&n.kind==="source"&&(!n.rangeCoverage||n.rangeCoverage.referencedDefinitions===0)&&n.results.length===1?n.results[0]:null}function be(t,n,e){if(!e)return N(t,n);let o={file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
3
3
  `).map((i,c)=>({line:S(e.startLine+c),text:i}))},r=N(t,n),s=r.totalMatches??0;return!r.matched||!r.resolved||s<=1?o:{...o,resolution:{selected:r.resolved,alternatives:r.otherMatches??[],totalMatches:s}}}function ve(t){return{requested:t.requested,matched:t.matched,ambiguous:t.ambiguous,missing:t.missing,entries:t.entries.map(n=>({selector:n.selector,status:n.status,kind:n.kind,totalCandidates:n.totalCandidates,sources:n.results.map(e=>({file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
4
4
  `).map((o,r)=>({line:S(e.startLine+r),text:o}))})),definitions:n.definitions,...n.fileCoverage?{fileCoverage:n.fileCoverage}:{},...n.rangeCoverage?{rangeCoverage:n.rangeCoverage}:{},candidates:n.candidates,omittedCandidates:n.omittedCandidates,suggestions:n.suggestions,...n.reason?{reason:n.reason}:{}})),literalValues:t.bindingClosure.inline}}function S(t){return t+1}function Se(t,n){let e=x(t,n),o=Ke(e);for(let r of o)console.log(r)}function xe(t,n,e="No results found for resolved symbol."){return x(t,n).match?e:U(n,I(t,n,5))}function K(t,n,e,o){return{...N(t,n),[o]:e}}function U(t,n){let e=`No definition matched '${t}'.`;return n.length>0?`${e} Suggestions: ${n.join(", ")}`:e}function Ke(t){if(!t.match||t.total<=1)return[];let n=t.match,e=Math.max(0,t.total-1),o=[`Resolved: ${L(n.symbol)} (${n.relativePath}) -- ${e} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=t.candidates.slice(0,3);return r.length>0&&o.push(`Alternates: ${r.map(s=>`${s.shortName} (${s.relativePath}:${h(s.startLine)})`).join("; ")}`),o.push(""),o}var Ue=k(({db:t,args:n,opts:e})=>{let o=T(n,0),r=R(e,"signatures"),s=H(t,o);if(R(e,"json")){P("outline",n,e,s);return}if(console.log(`\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550
5
5
  file=${JSON.stringify(o)}; signatures=${r?"shown":"hidden"}`),s.length===0){console.log(`
@@ -26,4 +26,4 @@ ${f}continue with --cursor ${d.cursor}`)}});function qe(t,n,e){let o=w(t,n,{sema
26
26
  `)}
27
27
  `}function Pe(t,n){let e=n.flatMap(r=>r.freshness?[r.freshness]:[]);if(t.push("","\u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550"," Source bodies are exact working-tree bytes; compiler identity and bindings are limited to reported semantic coverage."),e.length===0){t.push(" No source-freshness overlay was available.");return}let o={aligned:e.filter(r=>r.semantic.state==="aligned").length,stale:e.filter(r=>r.semantic.state==="stale").length,unavailable:e.filter(r=>r.semantic.state==="unavailable").length};t.push(` Freshness: ${e.length}/${n.length} text current; semantics ${o.aligned} aligned, ${o.stale} stale, ${o.unavailable} unavailable.`)}function $e(t,n,e){if(e){t.push(te({relativePath:n.relativePath,startLine:n.startLine,source:n.source,sessionPolicy:"exact-unit",ownerSymbol:n.shortName,headerSuffix:` ${n.shortName} [${n.language??"unknown"}]`,indent:"",sourceIndent:" ",showFocusMarker:!1,lineNumberWidth:4,blankAfterHeader:!0}));return}t.push(`${C(n.relativePath,n.startLine,n.endLine)} ${n.shortName} [${n.language??"unknown"}]`,"");let o=n.source.split(`
28
28
  `);for(let r=0;r<o.length;r++)t.push(` ${String(h(n.startLine+r)).padStart(4)} ${o[r]}`)}function tt(t,n){let e=n.fileCoverage;if(!e||(t.push(` ${n.selector} \u2014 ${e.returnedBodies} source body(ies) cover ${e.returnedDefinitions}/${e.totalDefinitions} indexed definition(s); ${e.omittedDefinitions} omitted definition(s) disclosed below.`,` basis: ${e.basis}; members=${e.members}`),e.omittedLedger.length===0))return;t.push(" OMITTED FILE-LOCAL DEFINITIONS");for(let r of e.omittedLedger){let s=r.signature?` \u2014 ${Ee(r.signature)}`:"",i=r.nestedDefinitions>0?` (+${r.nestedDefinitions} nested definition(s))`:"";t.push(` ${" ".repeat(r.depth)}${C(r.relativePath,r.startLine,r.endLine)} ${r.shortName}${s}${i}`)}let o=e.omittedLedger.filter(r=>r.depth===0);for(let r=0;r<o.length;r+=24){let s=o.slice(r,r+24);t.push(` Read omitted units together: scip-query code ${s.map(i=>W(`${i.relativePath}:${h(i.startLine)}-${h(i.endLine)}`)).join(" ")}`)}}function nt(t,n){t.push(` ${n.selector} \u2014 ${n.totalCandidates} candidate(s); ${n.results.length>0?"all candidate bodies returned above":"no body selected"}.`);for(let e of n.candidates)t.push(` ${C(e.relativePath,e.startLine,e.endLine)} ${e.shortName}`);n.omittedCandidates>0&&t.push(` ... ${n.omittedCandidates} additional candidate identity(ies).`),n.candidates.length>0&&t.push(` Read shown candidates together: scip-query code ${n.candidates.map(e=>W(`${e.relativePath}:${h(e.startLine)}-${h(e.endLine)}`)).join(" ")}`)}function Oe(t,n){if(!(!n||n.inline.length===0)){t.push("","LITERAL VALUES");for(let e of n.inline)t.push(` inline ${e.name} @ ${C(e.relativePath,e.startLine,e.endLine)}`),t.push(` ${e.source??""}`)}}function ot(t,n){let e=n.entries.flatMap(d=>d.fileCoverage?[d.fileCoverage]:[]),o=n.entries.flatMap(d=>d.rangeCoverage?[d.rangeCoverage]:[]);if(e.length===0&&o.length===0){t.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550",` ${n.requested}/${n.requested} selector(s) resolved to shown source bodies; referenced definitions and runtime relationships are not claimed. Source lines use absolute file line numbers and are citation-ready.`);return}let r=e.reduce((d,m)=>d+m.returnedBodies,0),s=e.reduce((d,m)=>d+m.returnedDefinitions,0),i=e.reduce((d,m)=>d+m.totalDefinitions,0),c=e.reduce((d,m)=>d+m.omittedDefinitions,0),a=o.reduce((d,m)=>d+m.referencedDefinitions,0),l=o.reduce((d,m)=>d+m.returnedDefinitions,0),u=o.reduce((d,m)=>d+m.omittedDefinitions,0),p=[...e.length>0?[`${e.length} file selector(s) returned ${r} source body(ies) covering ${s}/${i} indexed definition(s); ${c} file-local definition(s) omitted and disclosed`]:[],...o.length>0?[`${o.length} range selector(s) covered ${l}/${a} statically attributed same-file definition(s); ${u} referenced definition(s) omitted and disclosed`]:[]];t.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550",` ${n.requested}/${n.requested} selectors resolved; ${p.join("; ")}. Source lines use absolute file line numbers and are citation-ready.`)}function W(t){return`'${t.replaceAll("'","'\\''")}'`}var Qt=[{id:"session",command:"session",description:"Show evidence already delivered in this agent exploration session",options:[g("--reset","Clear this agent exploration-session ledger")],agent:pe("Which indexed source ranges and graph facts have already been delivered in this exploration session?","prior command ordinals, exact source ranges, and content-bound graph receipts",[],"complete","repository",re("repository-observation",[{when:{kind:"option",name:"reset",equals:!0},role:"mutation"}])),renderShape:"custom",docs:$("Navigation"),handler:Ye},{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:ge([g("--full","Run unbounded semantic analysis on large indexes"),g("-n, --limit <n>","Maximum reference sites to return",fe),g("--cursor <cursor>","Continue a prior bounded result (implies --limit 50 when omitted)")]),budget:"semantic",agent:{operation:y,answers:["Which files reference this symbol?","Is this symbol used anywhere, or only defined?"],returns:["referencing file paths","reference line numbers grouped by file"],inputs:["symbol"],coverage:"bounded",semantic:F("Resolve the exact reference sites attributed to one compiler symbol identity.","Referencing file paths and reference line numbers grouped by file.",["Reference sites do not establish runtime execution, data flow, or task relevance."]),contrasts:[{command:"imported-by",distinction:"imported-by lists files importing the symbol; refs covers every reference site, imported or not."},{command:"affected",distinction:"refs is one hop out; affected is the transitive closure of what could break."}]},renderShape:"grouped-by-file",docs:$("Navigation",["scip-query refs login"]),handler:We},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:{...O("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete",void 0,y,he(["file","symbol","construct"],["File ownership and nesting do not establish execution or task relevance."],{ranking:"identity-only",manualInput:"One exact current project file path.",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay."})),contrasts:[{command:"search",distinction:"outline enumerates constructs in one known file; search locates exact text across current project text."},{command:"code",distinction:"outline returns identities and ranges; code materializes exact source for selected identities."}]},options:A([g("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:$("Navigation"),handler:Ue},{id:"code",command:"code <selectors...>",description:"Read exact definitions, ranges with local call closure, or file export surfaces",agent:{...O("What exact source defines these symbols, ranges, or file surfaces?","per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",[["symbol","file"]],"complete",void 0,y,Ce(["construct","exact-source"],["Source materialization does not establish callers, runtime reachability, or task relevance by itself."],void 0,{manualInput:"One or more exact symbols, file:line ranges, or file paths.",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed."})),resultUnits:{kind:"field",field:"code"},contrasts:[{command:"inspect",distinction:"code materializes complete exact source; inspect batches bounded behavior or source gaps."},{command:"outline",distinction:"code reads selected implementations; outline enumerates file structure without reading every body."}]},options:A([g("-C, --context <n>","Extra lines of context above/below",me,0),g("--members <exported|all>","For file selectors, return the exported surface or the complete file",void 0,"exported")]),renderShape:"custom",docs:$("Navigation",["scip-query code parseRequest handleRequest","scip-query code src/api.ts src/web.ts"]),handler:Qe}];export{gt as a,pt as b,me as c,fe as d,ht as e,g as f,Te as g,ge as h,A as i,$ as j,Ct as k,yt as l,Rt as m,bt as n,O as o,vt as p,pe as q,he as r,St as s,Ce as t,F as u,N as v,Se as w,xe as x,K as y,Qt as z};
29
- //# sourceMappingURL=chunk-L6PJPETJ.js.map
29
+ //# sourceMappingURL=chunk-OVGYW7UD.js.map
@@ -1,2 +1,2 @@
1
- import{a as x}from"./chunk-CNO7TOKL.js";import{b as g}from"./chunk-BOJ5SVE2.js";import{c as k}from"./chunk-CJZXN4NU.js";import{a as n}from"./chunk-BGBBVSH4.js";import{i as v}from"./chunk-NWQXSFFU.js";import{b as L}from"./chunk-NJITK2GP.js";import{d as S}from"./chunk-N2ZSIIGR.js";import{y as a}from"./chunk-JWTGMPIT.js";function E(c,f={}){let{scope:P,minLoc:F=3,scanLimit:d}=f,l=new k(c),b=f.semantic!==!1,y=0,m=a("isolated.candidates",()=>{let s=g(l.productionCallableDefinitions({scope:P,minLoc:F,excludeEntrySurfaces:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:typeof d=="number"&&d>0}),d).filter(R=>!x(c,R));return y=s.length,s},()=>({definitions:y})),p=0,i=a("isolated.strict-callees",()=>{let e=l.symbolsWithNonSelfCallees(m,{additive:!1,semantic:!1});return p=e.size,e},()=>({definitions:m.length,symbols:p})),r=m.filter(e=>!i.has(e.symbolId)),C=0,N=a("isolated.scip-callers",()=>{let e=l.crossFileCallerMap(r,{semantic:!1});return C=e.size,e},()=>({definitions:r.length,symbols:C})),o=new Set(N.keys());for(let e of l.frameworkReferencedSymbolIds(r))o.add(e);let t=r.filter(e=>!o.has(e.symbolId));if(b&&t.length>0){for(let e of v(c,t).keys())o.add(e);for(let e of l.symbolsWithNonSelfCallees(t,{additive:!1,semantic:!0}))i.add(e);t=t.filter(e=>!o.has(e.symbolId)).filter(e=>!i.has(e.symbolId))}let h=0,W=a("isolated.source-fallback-callers",()=>{let e=l.sourceFallbackCallerFiles(t,{skipPath:s=>L(s)==="test"});return h=e.size,e},()=>({definitions:t.length,symbols:h}));for(let e of W.keys())o.add(e);let u=t.filter(e=>!o.has(e.symbolId)),I=0,M=a("isolated.additive-callees",()=>{let e=l.symbolsWithNonSelfCallees(u,{additive:!0,semantic:b});return I=e.size,e},()=>({definitions:u.length,symbols:I}));for(let e of M)i.add(e);return u.filter(e=>!i.has(e.symbolId)).sort((e,s)=>n(s)-n(e)||e.relativePath.localeCompare(s.relativePath)||e.startLine-s.startLine).map(e=>({symbol:e.symbol,shortName:S(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:n(e)}))}export{E as a};
2
- //# sourceMappingURL=chunk-I55I7XXP.js.map
1
+ import{a as x}from"./chunk-E7QR35ST.js";import{b as g}from"./chunk-BOJ5SVE2.js";import{c as k}from"./chunk-2BMSSRBH.js";import{a as n}from"./chunk-BGBBVSH4.js";import{i as v}from"./chunk-YSYPDRD5.js";import{b as L}from"./chunk-FLMTCX5R.js";import{d as S}from"./chunk-C7C6AKAT.js";import{y as a}from"./chunk-KNLQGXVH.js";function E(c,f={}){let{scope:P,minLoc:F=3,scanLimit:d}=f,l=new k(c),b=f.semantic!==!1,y=0,m=a("isolated.candidates",()=>{let s=g(l.productionCallableDefinitions({scope:P,minLoc:F,excludeEntrySurfaces:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:typeof d=="number"&&d>0}),d).filter(R=>!x(c,R));return y=s.length,s},()=>({definitions:y})),p=0,i=a("isolated.strict-callees",()=>{let e=l.symbolsWithNonSelfCallees(m,{additive:!1,semantic:!1});return p=e.size,e},()=>({definitions:m.length,symbols:p})),r=m.filter(e=>!i.has(e.symbolId)),C=0,N=a("isolated.scip-callers",()=>{let e=l.crossFileCallerMap(r,{semantic:!1});return C=e.size,e},()=>({definitions:r.length,symbols:C})),o=new Set(N.keys());for(let e of l.frameworkReferencedSymbolIds(r))o.add(e);let t=r.filter(e=>!o.has(e.symbolId));if(b&&t.length>0){for(let e of v(c,t).keys())o.add(e);for(let e of l.symbolsWithNonSelfCallees(t,{additive:!1,semantic:!0}))i.add(e);t=t.filter(e=>!o.has(e.symbolId)).filter(e=>!i.has(e.symbolId))}let h=0,W=a("isolated.source-fallback-callers",()=>{let e=l.sourceFallbackCallerFiles(t,{skipPath:s=>L(s)==="test"});return h=e.size,e},()=>({definitions:t.length,symbols:h}));for(let e of W.keys())o.add(e);let u=t.filter(e=>!o.has(e.symbolId)),I=0,M=a("isolated.additive-callees",()=>{let e=l.symbolsWithNonSelfCallees(u,{additive:!0,semantic:b});return I=e.size,e},()=>({definitions:u.length,symbols:I}));for(let e of M)i.add(e);return u.filter(e=>!i.has(e.symbolId)).sort((e,s)=>n(s)-n(e)||e.relativePath.localeCompare(s.relativePath)||e.startLine-s.startLine).map(e=>({symbol:e.symbol,shortName:S(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:n(e)}))}export{E as a};
2
+ //# sourceMappingURL=chunk-OYKU4B3Y.js.map
@@ -1,5 +1,5 @@
1
- import{g as x}from"./chunk-B5D7QPBE.js";import{l as m,y as b}from"./chunk-3L2ZBPEX.js";var y=new Set(["call","call_expression","command","command_call","function_call_expression","invocation_expression","macro_invocation","method_call","method_invocation","new_expression","object_creation_expression"]);function h(n,e,t,r){if(!Number.isSafeInteger(t)||t<0)return null;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`contextLines must be a non-negative safe integer; received ${r}`);let i=m(n,e);if(i.length===0||t>=i.length)return null;let o=Math.max(0,t-r),c=Math.min(i.length-1,t+r);return{relativePath:e,startLine:o,endLine:c,focusLine:t,source:i.slice(o,c+1).join(`
1
+ import{g as x}from"./chunk-HAXXKRTD.js";import{l as m,y as b}from"./chunk-2VAHDDLM.js";var y=new Set(["call","call_expression","command","command_call","function_call_expression","invocation_expression","macro_invocation","method_call","method_invocation","new_expression","object_creation_expression"]);function h(n,e,t,r){if(!Number.isSafeInteger(t)||t<0)return null;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`contextLines must be a non-negative safe integer; received ${r}`);let i=m(n,e);if(i.length===0||t>=i.length)return null;let o=Math.max(0,t-r),c=Math.min(i.length-1,t+r);return{relativePath:e,startLine:o,endLine:c,focusLine:t,source:i.slice(o,c+1).join(`
2
2
  `)}}function F(n,e,t,r,i){let o=h(n,e,t,r);if(!o)return null;let c=b(n,e)?.rootNode??null;if(!c)return{...o,kind:"bounded-context"};let s=_(c,t,i);if(s.length!==1)return{...o,kind:s.length===0?"non-call-reference":"bounded-context"};let l=s[0],a=m(n,e),u=Math.max(0,l.startPosition.row),S=l.endPosition.column===0?l.endPosition.row-1:l.endPosition.row,p=Math.min(a.length-1,Math.max(u,S));return{relativePath:e,startLine:u,endLine:p,focusLine:t,source:a.slice(u,p+1).join(`
3
3
  `),kind:"complete-call-expression"}}function L(n,e,t,r,i=6){if(!Number.isSafeInteger(r)||r<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${r}`);let o=m(n,e);if(o.length===0||t<0||t>=o.length)return null;let c=x(n,e,t);if(!c){let d=h(n,e,t,i);return d?{...d,unitType:null,unitStartLine:d.startLine,unitEndLine:d.endLine,omittedLines:0}:null}let s=c.startLine,l=c.endLine,a=l-s+1,u=Math.min(a,r),S=t-s-Math.floor(u/2),p=Math.max(0,Math.min(a-u,S)),f=s+p,g=f+u-1;return{relativePath:e,startLine:f,endLine:g,focusLine:t,source:o.slice(f,g+1).join(`
4
4
  `),unitType:c.type,unitStartLine:s,unitEndLine:l,omittedLines:a-u}}function _(n,e,t){let r=[];return N(n,e,t,r),r.filter(i=>!r.some(o=>o!==i&&o.startIndex>=i.startIndex&&o.endIndex<=i.endIndex))}function N(n,e,t,r){if(M(n,e)){y.has(n.type)&&w(n)===t&&r.push(n);for(let i of n.namedChildren)N(i,e,t,r)}}function w(n){let e=n.childForFieldName("function")??n.childForFieldName("constructor")??n.childForFieldName("method")??n.childForFieldName("name")??n.namedChild(0);return e?e.text.match(/[\p{L}_$][\p{L}\p{N}_$!?-]*/gu)?.at(-1)??null:null}function M(n,e){return n.startPosition.row<=e&&n.endPosition.row>=e}export{F as a,L as b};
5
- //# sourceMappingURL=chunk-J66VOFW6.js.map
5
+ //# sourceMappingURL=chunk-POBJ6FR2.js.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-BOJ5SVE2.js";import{a as m}from"./chunk-W7CXK74K.js";import{a as b,b as S}from"./chunk-E73UNJTF.js";import{o as y}from"./chunk-DYGHBZ2N.js";import{a as f}from"./chunk-OSSESPDX.js";import{d as r}from"./chunk-N2ZSIIGR.js";function u(o,l,t={}){let i=f(o,l);if(!i)return null;let g=[{file:i.relativePath,line:i.startLine}],s=y(o,i,{semantic:t.semantic,semanticEvidence:m}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{outgoingCalls:c,incomingCalls:n}=h(o,i,s,{semantic:t.semantic!==!1});return{symbol:i.symbol,shortName:r(i.symbol),relativePath:i.relativePath,definitionSites:g.filter(e=>!o.isIgnored(e.file)),referenceSites:s,outgoingCalls:c.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),incomingCalls:n.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function A(o,l,t={}){let i=u(o,l,t);return i?{symbol:i.symbol,shortName:i.shortName,relativePath:i.relativePath,definitionSites:i.definitionSites,usageSites:i.referenceSites,producers:i.outgoingCalls,consumers:i.incomingCalls}:null}function h(o,l,t,i){let g=a(b(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m}).map(n=>({symbol:n.symbol,file:n.file}))),s=a(S(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m})),c=s.length>0?s:a(t.map(n=>({symbol:n.enclosingSymbol==="(top-level)"?n.file:n.enclosingSymbol,file:n.file})));return{outgoingCalls:g,incomingCalls:c}}export{u as a,A as b};
2
- //# sourceMappingURL=chunk-CWFP7GM5.js.map
1
+ import{c as a}from"./chunk-BOJ5SVE2.js";import{a as m}from"./chunk-BJWFVAA5.js";import{f as b,g as S}from"./chunk-U3SXIMII.js";import{o as y}from"./chunk-SKKXTABJ.js";import{a as f}from"./chunk-F5GSBHC6.js";import{d as r}from"./chunk-C7C6AKAT.js";function u(o,l,t={}){let i=f(o,l);if(!i)return null;let g=[{file:i.relativePath,line:i.startLine}],s=y(o,i,{semantic:t.semantic,semanticEvidence:m}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{outgoingCalls:c,incomingCalls:n}=h(o,i,s,{semantic:t.semantic!==!1});return{symbol:i.symbol,shortName:r(i.symbol),relativePath:i.relativePath,definitionSites:g.filter(e=>!o.isIgnored(e.file)),referenceSites:s,outgoingCalls:c.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),incomingCalls:n.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function A(o,l,t={}){let i=u(o,l,t);return i?{symbol:i.symbol,shortName:i.shortName,relativePath:i.relativePath,definitionSites:i.definitionSites,usageSites:i.referenceSites,producers:i.outgoingCalls,consumers:i.incomingCalls}:null}function h(o,l,t,i){let g=a(b(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m}).map(n=>({symbol:n.symbol,file:n.file}))),s=a(S(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m})),c=s.length>0?s:a(t.map(n=>({symbol:n.enclosingSymbol==="(top-level)"?n.file:n.enclosingSymbol,file:n.file})));return{outgoingCalls:g,incomingCalls:c}}export{u as a,A as b};
2
+ //# sourceMappingURL=chunk-PSZPMMWN.js.map
@@ -0,0 +1,3 @@
1
+ import{b as Z}from"./chunk-7H6VHWWJ.js";import{f as q}from"./chunk-Y5DFAW5W.js";import{e as B}from"./chunk-BOJ5SVE2.js";import{c as Y}from"./chunk-2BMSSRBH.js";import{b as _}from"./chunk-U3SXIMII.js";import{d as Q,f as V}from"./chunk-SKKXTABJ.js";import{v as T}from"./chunk-C7C6AKAT.js";import{n as O}from"./chunk-RBAD4GJ2.js";import{k as M}from"./chunk-ETC674NS.js";var ae=6;function ee(e,n,t){return`${e}\0${n}\0${t??n}`}function Ee(e,n,t,a={}){let o=a.limit??ae;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${o}`);let u=a.sourceAllowed??(()=>!0),d=new Map(n.nodes.map(c=>[c.id,c])),f=new Set(t.steps.map(c=>c.nodeId)),r=new Set(t.steps.flatMap(c=>{let g=z(d.get(c.nodeId));return g?[g]:[]})),h=new Set;for(let c of t.steps)for(let g of c.behavior?.supportingDeclarations??[])r.add(g.symbol),h.add(ee(g.file,g.line,g.endLine));let b=c=>c.symbol!==null&&r.has(c.symbol)||h.has(ee(c.file,c.line,c.endLine)),y=new Map(t.steps.flatMap(c=>{if(!c.location)return[];let g=z(d.get(c.nodeId));if(!g)return[];let w=T(e,c.location.file).find(R=>R.symbol===g);return w?[[c.id,w]]:[]})),x=new Y(e).calleeMap([...y.values()],{additive:!1,semantic:!0}),l=[],i=new Set,C=new Set,m=0,A=0,L=0,S=0,I=0,p=0,s=0,N=0;for(let c of t.steps){if(!c.location||!c.behavior)continue;let g=ce(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b});l.push(...g.candidates),p+=g.upstreamCandidates,N+=g.runtimeCandidates,s+=g.resultCandidates;let w=de(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},i);l.push(...w);let R=ue(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},{evidencedCallsiteKeys:i,consideredCandidateKeys:C,calleeMap:x,stepDefinition:y.get(c.id)});l.push(...R.candidates),m+=R.scannedBehaviorSteps,A+=R.visibleCallsites,L+=R.identityCandidateCallsites,S+=R.ambiguousCallsites,I+=R.unresolvedCallsites}return oe(e,l,t.steps,o,{scannedBehaviorSteps:m,visibleCallsites:A,graphEvidencedCallsites:i.size,identityCandidateCallsites:L,ambiguousCallsites:S,unresolvedCallsites:I,upstreamCandidates:p,resultCandidates:s,runtimeCandidates:N},a.selectionTerms)}function ce(e,n){let t=[],a=0,o=0,u=0;if(!e.location||!e.behavior)return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u};let d=n.topology.edges.filter(r=>["call","runtime-boundary"].includes(r.kind)&&(r.fromNodeId===e.nodeId||r.toNodeId===e.nodeId)&&r.disposition!=="excluded"&&r.disposition!=="unsupported");for(let r of d){let h=r.toNodeId===e.nodeId,b=h?r.fromNodeId:r.toNodeId;if(n.returnedNodeIds.has(b))continue;let y=n.nodeById.get(b);if(!y?.location||!n.sourceAllowed(y.location.file))continue;let x=r.kind==="call"?G(n.db,y):X(y);if(!x||n.alternativeAlreadyReturned(x))continue;let l=H(r,y.location.file)??y.location,i=M(n.db,l.file)[l.line]?.trim(),C=h?"upstream":"downstream",m=r.kind==="runtime-boundary"?h?"runtime-producer":"runtime-consumer":h?"caller":"callee",A=W(r.evidence),L=K(y);t.push({anchor:{id:E(e.id,l.line,y.id),status:A,source:"graph-relation",direction:C,causalRole:m,relationKind:r.kind,fromStepId:e.id,fromLabel:e.label,callsite:{file:l.file,line:l.line,endLine:l.endLine??l.line,text:i||`${y.label} \u2192 ${e.label}`,signals:["call"],calleeLeaf:L},alternatives:[x],alternativeCount:1,evidence:r.evidence}}),h&&(a+=1),r.kind==="runtime-boundary"&&(u+=1)}let f=n.topology.edges.filter(r=>r.kind==="reference"&&r.fromNodeId===e.nodeId&&r.disposition!=="excluded"&&r.disposition!=="unsupported"&&!n.returnedNodeIds.has(r.toNodeId));for(let r of f){let h=n.nodeById.get(r.toNodeId);if(!h?.location||!n.sourceAllowed(h.location.file))continue;let b=G(n.db,h);if(!b||n.alternativeAlreadyReturned(b))continue;let y=K(h),x=H(r,e.location.file)?.line,l=e.behavior.lines.find(m=>(x===void 0||x>=m.line&&x<=m.endLine)&&m.text.includes(y));if(!l)continue;let i=le(l.signals),C=W(r.evidence);t.push({anchor:{id:E(e.id,l.line,h.id),status:C,source:"graph-relation",direction:"downstream",causalRole:i,relationKind:"reference",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:l.line,endLine:l.endLine,text:l.text,signals:l.signals,calleeLeaf:y},alternatives:[b],alternativeCount:1,evidence:r.evidence}}),i==="result-callback"&&(o+=1)}return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u}}function de(e,n,t){let a=[];if(!e.location)return a;let o=_(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line),u=M(n.db,e.location.file),d=q(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line);for(let f of o.targets){if(!n.sourceAllowed(f.definition.relativePath))continue;let r=k(e.location.file,f.sourceLine,f.calleeLeaf);if(t.has(r))continue;t.add(r);let h=U(d.get(f.sourceLine)),b={symbol:f.definition.symbol,label:f.definition.leaf,file:f.definition.relativePath,line:f.definition.startLine,endLine:f.definition.endLine};n.alternativeAlreadyReturned(b)||a.push({anchor:{id:E(e.id,f.sourceLine,f.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:f.sourceLine,endLine:f.sourceLine,text:u[f.sourceLine]?.trim()||`${f.calleeLeaf}()`,signals:h,calleeLeaf:f.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:f.definition.symbol,location:{file:e.location.file,line:f.sourceLine}}]}})}return a}function ue(e,n,t){let a={candidates:[],scannedBehaviorSteps:0,visibleCallsites:0,identityCandidateCallsites:0,ambiguousCallsites:0,unresolvedCallsites:0};if(!e.location||!e.behavior)return a;let o=e.behavior.lines.filter(i=>i.signals.includes("call"));if(o.length===0)return a;let u=[],d=0,f=0,r=0,h=(O(n.db,e.location.file)?.callSites??[]).filter(i=>o.some(C=>i.line>=C.line&&i.line<=C.endLine)),b=n.topology.edges.filter(i=>i.kind==="call"&&i.fromNodeId===e.nodeId&&i.disposition!=="excluded"&&i.disposition!=="unsupported"),y=new Map;for(let i of b){let C=n.nodeById.get(i.toNodeId);if(!C)continue;let m=K(C);y.set(m,(y.get(m)??0)+1)}let x=me(n.db,t.stepDefinition?t.calleeMap.get(t.stepDefinition.symbolId)??[]:[]),l=he(x);for(let i of x){if(!n.sourceAllowed(i.alternative.file)||n.alternativeAlreadyReturned(i.alternative))continue;let C=B(i.alternative.label),m=te(h,o,C,i.row.callsiteLine,l.get(C)===1);if(!m)continue;let A=$(o,m.line,C);if(!A)continue;let L=k(e.location.file,m.line,C);if(t.evidencedCallsiteKeys.has(L))continue;t.evidencedCallsiteKeys.add(L);let S=se(i.row.source);u.push({anchor:{id:E(e.id,m.line,i.alternative.symbol??i.alternative.file),status:S,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:A.line,endLine:A.endLine,text:A.text,signals:A.signals,calleeLeaf:C},alternatives:[i.alternative],alternativeCount:1,evidence:[{method:i.row.source,strength:S,identity:i.row.symbol,location:{file:e.location.file,line:m.line}}]}})}for(let i of b){if(n.returnedNodeIds.has(i.toNodeId))continue;let C=n.nodeById.get(i.toNodeId);if(!C?.location||!n.sourceAllowed(C.location.file))continue;let m=K(C),A=i.evidence.find(N=>{let c=N.location;return c!==null&&c.file===e.location?.file&&c.line>=0})?.location?.line,L=te(h,o,m,A,y.get(m)===1);if(!L)continue;let S=$(o,L.line,m);if(!S)continue;let I=k(e.location.file,L.line,m);if(t.evidencedCallsiteKeys.has(I))continue;t.evidencedCallsiteKeys.add(I);let p=X(C);if(!p||n.alternativeAlreadyReturned(p))continue;let s=W(i.evidence);u.push({anchor:{id:E(e.id,L.line,C.id),status:s,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:S.line,endLine:S.endLine,text:S.text,signals:S.signals,calleeLeaf:m},alternatives:[p],alternativeCount:1,evidence:i.evidence}})}for(let i of h){let C=k(e.location.file,i.line,i.calleeLeaf);if(t.evidencedCallsiteKeys.has(C))continue;let m=$(o,i.line,i.calleeLeaf);if(!m)continue;let A=Q(e.location.file,V(n.db).get(i.calleeLeaf)??[]).flatMap(p=>T(n.db,p.file).filter(s=>s.symbol===p.symbol&&s.isFunctionLike)).filter(p=>n.sourceAllowed(p.relativePath)&&!n.alternativeAlreadyReturned({symbol:p.symbol,label:p.leaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})),L=D(A.map(p=>({symbol:p.symbol,label:p.leaf??i.calleeLeaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})));if(L.length===0){r+=1;continue}let S=`${e.id}\0${i.line}\0${i.calleeLeaf}`;if(t.consideredCandidateKeys.has(S))continue;t.consideredCandidateKeys.add(S);let I=L.length>1;I?f+=1:d+=1,u.push({anchor:{id:E(e.id,i.line,i.calleeLeaf),status:I?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:m.line,endLine:m.endLine,text:m.text,signals:m.signals,calleeLeaf:i.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}return{candidates:u,scannedBehaviorSteps:1,visibleCallsites:h.length,identityCandidateCallsites:d,ambiguousCallsites:f,unresolvedCallsites:r}}function ke(e,n,t){let a=new Map(n.nodes.map(o=>[o.id,o]));for(let o of t.steps)if(!(!o.behavior||!o.location))for(let u of n.edges){if(u.kind!=="reference"||u.fromNodeId!==o.nodeId||u.disposition==="excluded"||u.disposition==="unsupported")continue;let d=a.get(u.toNodeId);if(!d?.location||!G(e,d))continue;let f=K(d),r=H(u,o.location.file)?.line,h=o.behavior.lines.find(b=>(r===void 0||r>=b.line&&r<=b.endLine)&&b.text.includes(f));!h||le(h.signals)!=="result-callback"||u.semantics?.some(({family:b,subtype:y})=>b==="control"&&y==="result-callback")||(u.semantics=[...u.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function le(e){return e.includes("call")&&e.some(n=>["return","mutation","shape","spread","binding"].includes(n))?"result-callback":"callable-reference"}function Me(e,n,t={}){let a=t.limit??ae;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let o=t.sourceAllowed??(()=>!0),u=[],d=n.map((l,i)=>({id:l.id,nodeId:l.id,order:i,role:"anchor",kind:"source-construct",label:l.label,location:{file:l.file,line:l.startLine,endLine:l.endLine},behavior:null})),f=n.map(l=>({file:l.file,startLine:l.startLine,endLine:l.endLine})),r=0,h=0,b=0,y=0,x=0;for(let l of n){let i=M(e,l.file),m=(O(e,l.file)?.callSites??[]).filter(s=>s.line>=l.startLine&&s.line<=l.endLine);r+=m.length;let A=q(e,l.file,l.startLine,l.endLine),L=_(e,l.file,l.startLine,l.endLine),S=new Set;for(let s of L.targets){if(!o(s.definition.relativePath)||f.some(w=>w.file===s.definition.relativePath&&w.startLine<=s.definition.startLine&&w.endLine>=s.definition.endLine))continue;let N=k(l.file,s.sourceLine,s.calleeLeaf);S.add(N);let c=U(A.get(s.sourceLine)),g={symbol:s.definition.symbol,label:s.definition.leaf,file:s.definition.relativePath,line:s.definition.startLine,endLine:s.definition.endLine};u.push({anchor:{id:E(l.id,s.sourceLine,s.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:s.sourceLine,endLine:s.sourceLine,text:i[s.sourceLine]?.trim()||`${s.calleeLeaf}()`,signals:c,calleeLeaf:s.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:s.definition.symbol,location:{file:l.file,line:s.sourceLine}}]}})}h+=L.resolvedCallsites;let I=Z(e,l.file,{ranges:[{startLine:l.startLine,endLine:l.endLine}]}),p=new Map;for(let s of I.targets){let N=m.find(w=>w.line===s.line)?.calleeLeaf??s.calleeLeaf,c=k(l.file,s.line,N),g=p.get(c)??[];g.push(s),p.set(c,g)}for(let[s,N]of p){if(S.has(s))continue;S.add(s);let c=N.filter(v=>o(v.targetFile)&&!f.some(j=>j.file===v.targetFile&&j.startLine<=v.targetStartLine&&j.endLine>=v.targetEndLine));if(c.length===0)continue;let g=c[0],w=m.find(v=>v.line===g.line)?.calleeLeaf??g.calleeLeaf,R=U(A.get(g.line)),P=D(c.map(v=>({symbol:v.targetSymbol??null,label:v.calleeLeaf,file:v.targetFile,line:v.targetStartLine,endLine:v.targetEndLine}))),J=c.some(v=>(v.resolutionAlternativeCount??0)>1)?"candidate":c.every(v=>v.strength==="exact")?"exact":"derived";u.push({anchor:{id:E(l.id,g.line,P.map(v=>`${v.file}:${v.line}`).join("|")),status:P.length>1?"ambiguous":J,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:g.line,endLine:g.line,text:i[g.line]?.trim()||`${g.calleeLeaf}()`,signals:R,calleeLeaf:w},alternatives:P.slice(0,3),alternativeCount:P.length,evidence:c.map(v=>({method:v.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":v.resolution==="factory-callback-member"?"ast-factory-callback-callsite":v.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:J,identity:v.targetSymbol??`${v.targetFile}:${v.targetStartLine}-${v.targetEndLine}`,location:{file:l.file,line:g.line}}))}})}h+=p.size;for(let s of m){let N=k(l.file,s.line,s.calleeLeaf);S.has(N)||(x+=1)}}return oe(e,u,d,a,{scannedBehaviorSteps:n.length,visibleCallsites:r,graphEvidencedCallsites:h,identityCandidateCallsites:b,ambiguousCallsites:y,unresolvedCallsites:x,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function oe(e,n,t,a,o,u=[]){let d=ge(n).sort(re),f=d.filter(i=>fe(e,i)).slice(0,a),r=new Set(f.map(i=>i.anchor.id)),h=d.filter(i=>!r.has(i.anchor.id)),b=f.map(i=>i.anchor),y=h.map(i=>i.anchor),x=D(b.flatMap(i=>i.alternativeCount===1?i.alternatives:[])),l=D(y.flatMap(i=>i.alternativeCount===1?i.alternatives:[]));return{anchors:b,withheldAnchors:y,candidateAnchors:d.length,omittedAnchors:Math.max(0,d.length-b.length),...o,inspectCommand:x.length===0?null:`scip-query inspect ${x.map(ie).join(" ")} --view behavior`,remainingInspectCommands:pe(l,8).map(i=>`scip-query inspect ${i.map(ie).join(" ")} --view behavior`)}}function re(e,n){let t=e.anchor.alternatives[0],a=n.anchor.alternatives[0];return F(e.anchor.status)-F(n.anchor.status)||(e.anchor.direction??"").localeCompare(n.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(n.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(n.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(n.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(n.anchor.callsite.file)||e.anchor.callsite.line-n.anchor.callsite.line||(t?.file??"").localeCompare(a?.file??"")||(t?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(n.anchor.id)}function fe(e,n){if(n.anchor.alternativeCount!==1)return!0;let t=n.anchor.alternatives[0],a=t.endLine??t.line;return M(e,t.file).slice(t.line,a+1).join(`
2
+ `).length<=2e4}function U(e){return e?.includes("call")?[...e]:["call",...e??[]]}function me(e,n){let t=new Map;for(let a of n){let o=T(e,a.file).find(f=>f.symbol===a.symbol&&f.isFunctionLike);if(!o)continue;let u={symbol:o.symbol,label:o.leaf,file:o.relativePath,line:o.startLine,endLine:o.endLine},d=t.get(o.symbol);!d||ne(a.source)>ne(d.row.source)?t.set(o.symbol,{row:{...a,...a.callsiteLine===void 0&&d?.row.callsiteLine!==void 0?{callsiteLine:d.row.callsiteLine}:{}},alternative:u}):d.row.callsiteLine===void 0&&a.callsiteLine!==void 0&&t.set(o.symbol,{...d,row:{...d.row,callsiteLine:a.callsiteLine}})}return[...t.values()]}function he(e){let n=new Map;for(let t of e){let a=B(t.alternative.label);n.set(a,(n.get(a)??0)+1)}return n}function se(e){return e==="semantic-callee"||e==="scip-chunk"||e==="scip-occurrence"?"exact":"derived"}function ne(e){return se(e)==="exact"?2:1}function $(e,n,t){return e.find(a=>n>=a.line&&n<=a.endLine&&a.text.includes(t))??e.find(a=>n>=a.line&&n<=a.endLine)??null}function te(e,n,t,a,o){if(a!==void 0)return e.find(d=>d.line===a&&d.calleeLeaf===t&&$(n,d.line,t)!==null)??null;let u=e.filter(d=>d.calleeLeaf===t&&$(n,d.line,d.calleeLeaf)!==null);return o&&u.length===1?u[0]:null}function K(e){let n=e.attributes.leaf;if(typeof n=="string"&&n.length>0)return B(n);let t=e.label.slice(e.label.lastIndexOf(":")+1);return B(t)}function z(e){if(e?.kind!=="symbol"||!e.id.startsWith("symbol:"))return null;try{return decodeURIComponent(e.id.slice(7))}catch{return null}}function X(e){return e.location?{symbol:z(e),label:e.label,file:e.location.file,line:e.location.line,endLine:e.location.endLine??null}:null}function G(e,n){let t=X(n);return t?.symbol&&T(e,t.file).some(o=>o.symbol===t.symbol&&o.isFunctionLike)?t:null}function H(e,n){return e.evidence.find(t=>t.location?.file===n)?.location??e.evidence.find(t=>t.location!==null)?.location??null}function W(e){let n={exact:5,derived:4,mixed:3,candidate:2,unknown:1};return e.reduce((t,a)=>n[a.strength]>n[t]?a.strength:t,"unknown")}function ge(e){let n=new Map;for(let t of e){let o=t.anchor.alternatives[0]?.symbol??`${t.anchor.callsite.file}:${t.anchor.callsite.line}:${t.anchor.callsite.calleeLeaf}`,u=n.get(o);(!u||be(t,u)<0)&&n.set(o,t)}return[...n.values()]}function be(e,n){return F(e.anchor.status)-F(n.anchor.status)||e.anchor.alternativeCount-n.anchor.alternativeCount||re(e,n)}function F(e){return{exact:0,derived:1,mixed:2,candidate:3,unknown:4,ambiguous:5}[e]}function D(e){let n=new Map;for(let t of e)n.set(t.symbol??`${t.file}:${t.line}`,t);return[...n.values()].sort((t,a)=>t.file.localeCompare(a.file)||t.line-a.line||t.label.localeCompare(a.label))}function ie(e){return`--at ${ve(`${e.file}:${e.line+1}`)}`}function pe(e,n){let t=[];for(let a=0;a<e.length;a+=n)t.push(e.slice(a,a+n));return t}function ve(e){return`'${e.replaceAll("'","'\\''")}'`}function k(e,n,t){return`${e}\0${n}\0${t}`}function E(e,n,t){return["next-anchor",e,String(n),t].map(encodeURIComponent).join(":")}export{Ee as a,ke as b,Me as c};
3
+ //# sourceMappingURL=chunk-PXTRBKRK.js.map
@@ -1,4 +1,4 @@
1
- import{a as v,b as L,c as $,d as B}from"./chunk-HLZTEXRA.js";import{a as K}from"./chunk-WUN6KBHV.js";import{b as D,c as A}from"./chunk-CJZXN4NU.js";import{a as g}from"./chunk-BGBBVSH4.js";import{h as R}from"./chunk-XRYABF57.js";import{b as M}from"./chunk-NJITK2GP.js";import{b as k,d as F,e as b}from"./chunk-N2ZSIIGR.js";import{u as w}from"./chunk-ODDUPDP7.js";import{h as C}from"./chunk-FESCRNVV.js";function me(t,e){let{scope:n,minLoc:s=3,maxLoc:i=80,limit:r=30,includeLowConfidence:l=!1,scanLimit:o}=e??{},m=e?.semantic!==!1,a=new A(t),d=a.scopedDefinitions(n),y=Q(a,n),p={high:0,medium:1,low:2};return K({candidates:()=>O(t,a,d,{minLoc:s,maxLoc:i}),orderCandidates:(c,u)=>g(u)-g(c)||c.relativePath.localeCompare(u.relativePath),scanLimit:o,profile:{name:"stale-abstractions"},prepare:c=>{let u=U(c),f=W(t,a,c,u,{semantic:m}),h=c.filter(x=>{if(a.hasSuppressionComment(x))return!1;let I=S(t,x,f,u);return I.realConsumers.length<=1&&!I.transitivelyReachable&&j(x,I.realConsumers.length,y)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,d,h,{semantic:m}),candidateIndex:u}},evaluate:(c,u)=>{if(a.hasSuppressionComment(c)||u.singletonBackedClassIds.has(c.symbolId))return null;let f=S(t,c,u.consumerFileMap,u.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!j(f.definition,f.realConsumers.length,y))return null;let h=V(t,f);return!l&&h.confidence==="low"?null:h},orderResults:(c,u)=>p[c.confidence]-p[u.confidence]||u.loc-c.loc||c.file.localeCompare(u.file)||c.startLine-u.startLine,limit:r})}function O(t,e,n,s){return n.filter(i=>i.isTypeLike&&g(i)>=s.minLoc).filter(i=>g(i)<=s.maxLoc).filter(i=>!t.isIgnored(i.relativePath)).filter(i=>!i.relativePath.endsWith(".d.ts")).filter(i=>M(i.relativePath)!=="test").filter(i=>!R(t,i.symbol,i.relativePath)).filter(i=>!X(i.symbol))}function T(t,e,n,s){return L(v(t,e).forDefinitions(n,{semantic:s.semantic,sourceFallback:s.sourceFallback}))}function W(t,e,n,s,i){let r=T(t,e,n,{semantic:!1,sourceFallback:!1}),l=n.filter(a=>{let d=S(t,a,r,s);return d.realConsumers.length<=1&&!(d.realConsumers.length>0&&P(a.relativePath))}),o=i.semantic&&l.length>0?D(r,T(t,e,l,{semantic:!0,sourceFallback:!1})):r,m=l.filter(a=>S(t,a,o,s).realConsumers.length<=1);return D(o,T(t,e,m,{semantic:!1,sourceFallback:!0}))}function U(t){let e=new Map;for(let n of t){let s=e.get(n.relativePath);s||(s=new Map,e.set(n.relativePath,s));let i=b(n.symbol);i&&s.set(i,n)}return e}function S(t,e,n,s){let r=[...n.get(e.symbolId)??new Set].filter(d=>d!==e.relativePath&&!t.isIgnored(d)),{realConsumers:l,barrelConsumers:o,importOnlyConsumers:m}=$(t,e,r),a=Y(t,e,n,s);return{definition:e,realConsumers:l,barrelConsumers:o+m,transitivelyReachable:a}}function V(t,e){let n=E(t,e.definition.relativePath,e.definition.startLine),s=P(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:i,reason:r}=ne(e.realConsumers.length,n,s),l=z(e.realConsumers.length,n,s);return{symbol:e.definition.symbol,shortName:F(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:g(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:s,confidence:i,reason:r,actionTier:l.actionTier,stalenessKind:l.stalenessKind,recommendation:l.recommendation}}function z(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,s,i){let r=_(t,Z(n),s),l=r.map(a=>a.singleton);if(r.length===0)return new Set;let o=L(v(t,e).forDefinitions(l,{semantic:i.semantic,sourceFallback:!0})),m=new Set;for(let{singleton:a,classId:d}of r)G(t,a,o)&&m.add(d);return m}function Z(t){let e=new Map;for(let n of t){let s=b(n.symbol);s&&e.set(N(n.relativePath,s),n)}return e}function _(t,e,n){let s=[];for(let i of n){let r=q(t,e,i);r&&s.push({singleton:r,classId:i.symbolId})}return s}function q(t,e,n){if(E(t,n.relativePath,n.startLine)!=="class")return null;let s=b(n.symbol);if(!s)return null;let i=J(t,n.relativePath,s);return i?e.get(N(n.relativePath,i))??null:null}function G(t,e,n){let s=b(e.symbol),i=n.get(e.symbolId);return!s||!i?!1:[...i].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!B(t,r,s))}function N(t,e){return`${t}\0${e}`}function J(t,e,n){let s=C(t,e);if(!s)return null;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${i}\\s*\\(`);return s.match(r)?.[1]??null}function Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=k(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let s=n[n.length-1],i=n[n.length-2];return s?.suffix==="type"&&i?.suffix==="type"}function P(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(P(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,s){let i=w(t,e.relativePath),r=b(e.symbol);if(!r)return!1;let l=s.get(e.relativePath);if(!l)return!1;let o=[...i.get(r)??[]],m=new Set;for(;o.length>0;){let a=o.pop();if(m.has(a))continue;m.add(a);let d=l.get(a);if(!d)continue;let y=n.get(d.symbolId);if(y){for(let p of y)if(p!==e.relativePath&&!t.isIgnored(p))return!0}for(let p of i.get(a)??[])o.push(p)}return!1}function E(t,e,n){let s=C(t,e);if(!s)return"other";let i=s.split(`
1
+ import{a as v,b as L,c as $,d as B}from"./chunk-GTZZVLKJ.js";import{a as K}from"./chunk-VBV6ALJE.js";import{b as D,c as A}from"./chunk-2BMSSRBH.js";import{a as g}from"./chunk-BGBBVSH4.js";import{h as R}from"./chunk-NJQISBL4.js";import{b as M}from"./chunk-FLMTCX5R.js";import{b as k,d as F,e as b}from"./chunk-C7C6AKAT.js";import{u as w}from"./chunk-RBAD4GJ2.js";import{h as C}from"./chunk-ETC674NS.js";function me(t,e){let{scope:n,minLoc:s=3,maxLoc:i=80,limit:r=30,includeLowConfidence:l=!1,scanLimit:o}=e??{},m=e?.semantic!==!1,a=new A(t),d=a.scopedDefinitions(n),y=Q(a,n),p={high:0,medium:1,low:2};return K({candidates:()=>O(t,a,d,{minLoc:s,maxLoc:i}),orderCandidates:(c,u)=>g(u)-g(c)||c.relativePath.localeCompare(u.relativePath),scanLimit:o,profile:{name:"stale-abstractions"},prepare:c=>{let u=U(c),f=W(t,a,c,u,{semantic:m}),h=c.filter(x=>{if(a.hasSuppressionComment(x))return!1;let I=S(t,x,f,u);return I.realConsumers.length<=1&&!I.transitivelyReachable&&j(x,I.realConsumers.length,y)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,d,h,{semantic:m}),candidateIndex:u}},evaluate:(c,u)=>{if(a.hasSuppressionComment(c)||u.singletonBackedClassIds.has(c.symbolId))return null;let f=S(t,c,u.consumerFileMap,u.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!j(f.definition,f.realConsumers.length,y))return null;let h=V(t,f);return!l&&h.confidence==="low"?null:h},orderResults:(c,u)=>p[c.confidence]-p[u.confidence]||u.loc-c.loc||c.file.localeCompare(u.file)||c.startLine-u.startLine,limit:r})}function O(t,e,n,s){return n.filter(i=>i.isTypeLike&&g(i)>=s.minLoc).filter(i=>g(i)<=s.maxLoc).filter(i=>!t.isIgnored(i.relativePath)).filter(i=>!i.relativePath.endsWith(".d.ts")).filter(i=>M(i.relativePath)!=="test").filter(i=>!R(t,i.symbol,i.relativePath)).filter(i=>!X(i.symbol))}function T(t,e,n,s){return L(v(t,e).forDefinitions(n,{semantic:s.semantic,sourceFallback:s.sourceFallback}))}function W(t,e,n,s,i){let r=T(t,e,n,{semantic:!1,sourceFallback:!1}),l=n.filter(a=>{let d=S(t,a,r,s);return d.realConsumers.length<=1&&!(d.realConsumers.length>0&&P(a.relativePath))}),o=i.semantic&&l.length>0?D(r,T(t,e,l,{semantic:!0,sourceFallback:!1})):r,m=l.filter(a=>S(t,a,o,s).realConsumers.length<=1);return D(o,T(t,e,m,{semantic:!1,sourceFallback:!0}))}function U(t){let e=new Map;for(let n of t){let s=e.get(n.relativePath);s||(s=new Map,e.set(n.relativePath,s));let i=b(n.symbol);i&&s.set(i,n)}return e}function S(t,e,n,s){let r=[...n.get(e.symbolId)??new Set].filter(d=>d!==e.relativePath&&!t.isIgnored(d)),{realConsumers:l,barrelConsumers:o,importOnlyConsumers:m}=$(t,e,r),a=Y(t,e,n,s);return{definition:e,realConsumers:l,barrelConsumers:o+m,transitivelyReachable:a}}function V(t,e){let n=E(t,e.definition.relativePath,e.definition.startLine),s=P(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:i,reason:r}=ne(e.realConsumers.length,n,s),l=z(e.realConsumers.length,n,s);return{symbol:e.definition.symbol,shortName:F(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:g(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:s,confidence:i,reason:r,actionTier:l.actionTier,stalenessKind:l.stalenessKind,recommendation:l.recommendation}}function z(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,s,i){let r=_(t,Z(n),s),l=r.map(a=>a.singleton);if(r.length===0)return new Set;let o=L(v(t,e).forDefinitions(l,{semantic:i.semantic,sourceFallback:!0})),m=new Set;for(let{singleton:a,classId:d}of r)G(t,a,o)&&m.add(d);return m}function Z(t){let e=new Map;for(let n of t){let s=b(n.symbol);s&&e.set(N(n.relativePath,s),n)}return e}function _(t,e,n){let s=[];for(let i of n){let r=q(t,e,i);r&&s.push({singleton:r,classId:i.symbolId})}return s}function q(t,e,n){if(E(t,n.relativePath,n.startLine)!=="class")return null;let s=b(n.symbol);if(!s)return null;let i=J(t,n.relativePath,s);return i?e.get(N(n.relativePath,i))??null:null}function G(t,e,n){let s=b(e.symbol),i=n.get(e.symbolId);return!s||!i?!1:[...i].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!B(t,r,s))}function N(t,e){return`${t}\0${e}`}function J(t,e,n){let s=C(t,e);if(!s)return null;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${i}\\s*\\(`);return s.match(r)?.[1]??null}function Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=k(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let s=n[n.length-1],i=n[n.length-2];return s?.suffix==="type"&&i?.suffix==="type"}function P(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(P(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,s){let i=w(t,e.relativePath),r=b(e.symbol);if(!r)return!1;let l=s.get(e.relativePath);if(!l)return!1;let o=[...i.get(r)??[]],m=new Set;for(;o.length>0;){let a=o.pop();if(m.has(a))continue;m.add(a);let d=l.get(a);if(!d)continue;let y=n.get(d.symbolId);if(y){for(let p of y)if(p!==e.relativePath&&!t.isIgnored(p))return!0}for(let p of i.get(a)??[])o.push(p)}return!1}function E(t,e,n){let s=C(t,e);if(!s)return"other";let i=s.split(`
2
2
  `),r=Math.max(0,n-2),l=Math.min(i.length-1,n+2);for(let o=r;o<=l;o++){let a=(i[o]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function ee(t,e){let n=C(t,e.relativePath);if(!n)return!1;let s=b(e.symbol);if(!s)return!1;let i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${i}\\b`),l=n.split(`
3
3
  `);for(let o=0;o<l.length;o++)if(!(o>=e.startLine&&o<=e.endLine)&&r.test(l[o]??""))return!0;return!1}function ne(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{me as a};
4
- //# sourceMappingURL=chunk-HKGFPJ4T.js.map
4
+ //# sourceMappingURL=chunk-Q5JRIHT3.js.map
@@ -1,2 +1,2 @@
1
- import{a as k}from"./chunk-FIQRSHVM.js";import{c as R,d as E}from"./chunk-JFMEXGFE.js";import{h as S}from"./chunk-7F45LJKI.js";import{randomUUID as q}from"crypto";import{getHeapStatistics as V}from"v8";import{resolve as H}from"path";import{createRequire as L}from"module";import{dirname as I,isAbsolute as j,relative as P,resolve as m,sep as b}from"path";var u=L(import.meta.url),_=1,D="0.4.0";function z(){try{let t=M();if(!t.available)return t;let{packageRoot:e}=t,r=u.resolve("typescript",{paths:[e]}),i=u(r),{FileIndexer:n}=u(m(e,"dist/src/FileIndexer.js")),{Input:s}=u(m(e,"dist/src/Input.js")),{Packages:o}=u(m(e,"dist/src/Packages.js")),c=u(m(e,"dist/src/scip.js"));if(!n||!s||!o||!c.scip?.Document||!c.scip.Index)return{available:!1,reason:"scip-typescript document runtime has an unsupported module shape"};let a={packageVersion:t.packageVersion,typescript:i,Document:c.scip.Document,Index:c.scip.Index,FileIndexer:n,Input:s,Packages:o};return{available:!0,runtime:a,producerIdentity:x(a)}}catch(t){return{available:!1,reason:`scip-typescript document runtime unavailable: ${t instanceof Error?t.message:String(t)}`}}}function J(){let t=M();return t.available?{available:!0,packageVersion:t.packageVersion,typescriptVersion:t.typescriptVersion,producerIdentity:t.producerIdentity}:t}function M(){try{let t=u.resolve("@sourcegraph/scip-typescript/package.json"),e=JSON.parse(S(t,"scip-typescript package manifest"));if(e.version!==D)return{available:!1,reason:`unsupported scip-typescript version ${String(e.version??"unknown")}; expected ${D}`};let r=I(t),i=u.resolve("typescript/package.json",{paths:[r]}),n=JSON.parse(S(i,"TypeScript package manifest"));return typeof n.version!="string"||!n.version?{available:!1,reason:"scip-typescript TypeScript compiler version is unavailable"}:{available:!0,packageRoot:r,packageVersion:e.version,typescriptVersion:n.version,producerIdentity:C(e.version,n.version)}}catch(t){return{available:!1,reason:`scip-typescript document producer unavailable: ${t instanceof Error?t.message:String(t)}`}}}function A(t){let e=t.runtime===void 0?z():t.runtime===null?{available:!1,reason:"scip-typescript document runtime unavailable"}:{available:!0,runtime:t.runtime,producerIdentity:x(t.runtime)};return e.available?{available:!0,emitter:new T(t,e.runtime)}:e}var T=class{producerIdentity;workspaceRoot;tsconfigPath;projectRoot;maxFileByteSize;runtime;host;config=null;includedFiles=new Set;program=null;checker=null;symbolTable=new Map;constructorTable=new Map;packages;fragments=new Map;stats={initializations:0,programUpdates:0,documentsEmitted:0,documentsRemoved:0,sourceNodesReused:0,sourceNodesReplaced:0,symbolEntriesPruned:0};constructor(e,r){this.workspaceRoot=m(e.workspaceRoot),this.tsconfigPath=m(this.workspaceRoot,e.tsconfigPath),this.projectRoot=e.projectRoot??O(this.workspaceRoot,I(this.tsconfigPath)),this.maxFileByteSize=e.maxFileByteSize??1024*1024,this.runtime=r,this.producerIdentity=x(r);let i=v(r.typescript,this.tsconfigPath);this.config=i,this.host=new w(r.typescript,i.options,this.workspaceRoot),this.packages=new r.Packages(this.projectRoot)}initialize(){let e=performance.now();this.initializeProgram();let r=[];for(let i of this.program.getSourceFiles())this.includedFiles.has(f(i.fileName))&&r.push(this.emitSourceFile(i));return this.result(r,e)}advance(e){if(!this.program||!this.checker||!this.config)return this.initializeAndAdvance(e);let r=performance.now(),i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);if(this.fragments.clear(),i.length===0&&n.length===0)return this.validateAffectedPaths(s),this.result(this.emitAffectedFiles(s),r);let o=v(this.runtime.typescript,this.tsconfigPath);this.config=o,this.includedFiles=new Set(o.fileNames.map(f));let c=this.program,a=new Map;for(let d of[...i,...n]){let p=y(this.workspaceRoot,d),l=c.getSourceFile(p);l&&(a.set(d,l),this.stats.symbolEntriesPruned+=F(this.symbolTable,l),this.stats.symbolEntriesPruned+=F(this.constructorTable,l)),this.host.invalidate(p)}this.program=this.runtime.typescript.createProgram(o.fileNames,o.options,this.host.compilerHost,c),this.checker=this.program.getTypeChecker(),this.stats.programUpdates+=1,this.validateIncrementalPaths(i,n,s),this.stats.documentsRemoved+=n.length;for(let[d,p]of a)this.program.getSourceFile(y(this.workspaceRoot,d))===p?this.stats.sourceNodesReused+=1:this.stats.sourceNodesReplaced+=1;return this.result(this.emitAffectedFiles(s),r)}fragment(e){return this.fragments.get(g(e))??null}snapshotStats(){return{...this.stats}}initializeAndAdvance(e){let r=performance.now();this.initializeProgram();let i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);return this.fragments.clear(),this.validateIncrementalPaths(i,n,s,!0),this.stats.documentsRemoved+=n.length,this.result(this.emitAffectedFiles(s),r)}initializeProgram(){let e=this.config??v(this.runtime.typescript,this.tsconfigPath);this.includedFiles=new Set(e.fileNames.map(f)),this.program=this.runtime.typescript.createProgram(e.fileNames,e.options,this.host.compilerHost),this.checker=this.program.getTypeChecker(),this.stats.initializations+=1}validateIncrementalPaths(e,r,i,n=!1){if(!n&&e.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires a modified or removed file");if(i.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires an affected or removed file");for(let s of e){let o=y(this.workspaceRoot,s);if(!this.program?.getSourceFile(o))throw new Error(`modified TypeScript dependency is unavailable to the configured project: ${s}`)}for(let s of r){let o=y(this.workspaceRoot,s);if(this.program?.getSourceFile(o))throw new Error(`removed TypeScript source is still present in the configured project: ${s}`)}this.validateAffectedPaths(i)}validateAffectedPaths(e){for(let r of e){let i=y(this.workspaceRoot,r);if(!this.includedFiles.has(f(i)))throw new Error(`affected TypeScript file is outside the configured project: ${r}`)}}emitAffectedFiles(e){return e.map(r=>{let i=this.program.getSourceFile(y(this.workspaceRoot,r));if(!i)throw new Error(`affected TypeScript source is unavailable: ${r}`);return this.emitSourceFile(i)})}emitSourceFile(e){if(!this.checker)throw new Error("TypeScript document emitter is not initialized");let r=g(P(this.workspaceRoot,e.fileName)),i=new this.runtime.Document({relative_path:r,occurrences:[]});if(new this.runtime.FileIndexer(this.checker,{cwd:this.workspaceRoot,projectRoot:this.projectRoot,projectDisplayName:this.projectRoot,maxFileByteSizeNumber:this.maxFileByteSize},new this.runtime.Input(e.fileName,e.getText()),i,this.symbolTable,this.constructorTable,this.packages,e).index(),this.stats.documentsEmitted+=1,i.occurrences.length===0)return this.fragments.delete(r),this.stats.documentsRemoved+=1,{relativePath:r,bytes:null,occurrences:0,symbols:i.symbols.length,referenceFragments:[]};let s=i.serializeBinary();return this.fragments.set(r,s),{relativePath:r,bytes:s,occurrences:i.occurrences.length,symbols:i.symbols.length,referenceFragments:U(r,i)}}result(e,r){return{producerIdentity:this.producerIdentity,fragments:e,durationMs:performance.now()-r,stats:this.snapshotStats()}}};function U(t,e){let r=new Map;for(let i of e.occurrences){if(!i.symbol||(i.symbol_roles&1)!==0||i.range.length<3)continue;let n=i.range[0],s=i.range[1];if(!Number.isInteger(n)||!Number.isInteger(s))continue;let o={targetSymbol:i.symbol,location:{file:t,line:n,column:s}};r.set(`${i.symbol}\0${n}\0${s}`,o)}return[...r.values()].sort((i,n)=>i.targetSymbol.localeCompare(n.targetSymbol)||i.location.line-n.location.line||i.location.column-n.location.column)}var w=class{compilerHost;sourceFiles=new Map;constructor(e,r,i){let n=e.createCompilerHost(r),s=n.getSourceFile.bind(n);this.compilerHost={...n,getCurrentDirectory:()=>i,getSourceFile:(o,c,a,d)=>{let p=f(o);if(this.sourceFiles.has(p))return this.sourceFiles.get(p);let l=s(o,c,a,d);return this.sourceFiles.set(p,l),l}}}invalidate(e){this.sourceFiles.delete(f(e))}};function v(t,e){let r=t.readConfigFile(e,t.sys.readFile);if(r.error)throw new Error(t.formatDiagnostics([r.error],t.createCompilerHost({})));let i=t.parseJsonConfigFileContent(r.config,t.sys,I(e)),n=i.errors.filter(s=>s.code!==18003);if(n.length>0)throw new Error(t.formatDiagnostics(n,t.createCompilerHost({})));return i}function x(t){return C(t.packageVersion,t.typescript.version)}function C(t,e){return`scip-typescript:${t}:typescript:${e}:document-adapter:${_}`}function O(t,e){return g(P(t,e))||"."}function y(t,e){if(j(e))throw new Error(`expected a project-relative path: ${e}`);let r=m(t,e),i=t.endsWith(b)?t:`${t}${b}`;if(r!==t&&!r.startsWith(i))throw new Error(`path escapes the project root: ${e}`);return r}function h(t){return[...new Set(t.map(g))].sort()}function g(t){return t.split(b).join("/").replace(/^\.\//,"")}function f(t){return m(t)}function F(t,e){let r=0;for(let i of t.keys())if($(i)){try{if(i.getSourceFile()!==e)continue}catch{continue}t.delete(i),r+=1}return r}function $(t){return!!(t&&typeof t=="object"&&"kind"in t&&"getSourceFile"in t)}var N=class{projectRoot;currentGeneration;createEmitter;wallNow;monotonicNow;maxActiveSessions;softMemoryLimitBytes;memoryUsage;active=new Map;requests=0;sessionsCreated=0;sessionsReplaced=0;sessionsEvicted=0;lastRequestAtMs=null;lastDurationMs=null;lastError=null;unavailable=!1;constructor(e){if(this.projectRoot=H(e.projectRoot),this.currentGeneration=e.currentGeneration,this.createEmitter=e.createEmitter??A,this.wallNow=e.wallNow??e.now??Date.now,this.monotonicNow=e.monotonicNow??e.now??E,e.maxActiveSessions!==void 0&&(!Number.isInteger(e.maxActiveSessions)||e.maxActiveSessions<1))throw new Error("TypeScript index maxActiveSessions must be a positive integer.");if(this.maxActiveSessions=e.maxActiveSessions??8,e.softMemoryLimitMb!==void 0&&(!Number.isInteger(e.softMemoryLimitMb)||e.softMemoryLimitMb<1))throw new Error("TypeScript index softMemoryLimitMb must be a positive integer.");this.softMemoryLimitBytes=e.softMemoryLimitMb===void 0?null:e.softMemoryLimitMb*1024*1024,this.memoryUsage=e.memoryUsage??(()=>({heapUsedBytes:process.memoryUsage().heapUsed,heapLimitBytes:V().heap_size_limit}))}handle(e,r){let i=this.monotonicNow();try{if(this.currentGeneration()!==e)throw new Error("TypeScript index request does not match the currently published generation.");let n=this.emitterFor(r);if(n.emitter.producerIdentity!==r.producerIdentity)throw new Error("TypeScript index producer identity changed.");let s=n.emitter.snapshotStats(),o=n.emitter.advance({modifiedFiles:r.modifiedFiles,removedFiles:r.removedFiles,affectedFiles:r.affectedFiles}),c=this.monotonicNow()-i;return this.requests+=1,this.lastRequestAtMs=this.wallNow(),this.lastDurationMs=c,this.lastError=null,this.unavailable=!1,{producerIdentity:o.producerIdentity,cold:o.stats.initializations>s.initializations,durationMs:c,fragments:o.fragments.map(a=>({relativePath:a.relativePath,bytesBase64:a.bytes===null?null:Buffer.from(a.bytes).toString("base64"),occurrences:a.occurrences,symbols:a.symbols,referenceFragments:a.referenceFragments}))}}catch(n){throw this.lastError=n instanceof Error?n.message:String(n),n}}status(e){let r=[...this.active.values()].map(o=>o.emitter.snapshotStats()),i=o=>r.reduce((c,a)=>c+a[o],0),n=this.memoryUsage(),s=this.softMemoryLimitBytes!==null&&n.heapUsedBytes>=this.softMemoryLimitBytes;return{protocolVersion:k,state:this.unavailable?"unavailable":this.lastError?"error":this.active.size>0?"ready":"idle",requests:this.requests,sessionsCreated:this.sessionsCreated,sessionsReplaced:this.sessionsReplaced,sessionsEvicted:this.sessionsEvicted,activeSessions:this.active.size,maxActiveSessions:this.maxActiveSessions,heapUsedBytes:n.heapUsedBytes,heapLimitBytes:n.heapLimitBytes,...this.softMemoryLimitBytes===null?{}:{softMemoryLimitBytes:this.softMemoryLimitBytes},retireRequested:s,initializations:i("initializations"),programUpdates:i("programUpdates"),documentsEmitted:i("documentsEmitted"),documentsRemoved:i("documentsRemoved"),...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastDurationMs===null?{}:{lastDurationMs:this.lastDurationMs},...this.lastError?{lastError:this.lastError}:{},...e?{mailbox:e}:{}}}close(){this.active.clear()}emitterFor(e){let r=`${e.tsconfigPath}\0${e.projectArgument}`,i=this.active.get(r);if(i?.projectIdentity===e.projectIdentity)return this.active.delete(r),this.active.set(r,i),i;if(i)this.active.delete(r);else if(this.active.size>=this.maxActiveSessions){let o=this.active.keys().next().value;o!==void 0&&(this.active.delete(o),this.sessionsEvicted+=1)}let n=this.createEmitter({workspaceRoot:this.projectRoot,tsconfigPath:e.tsconfigPath,projectRoot:e.projectArgument});if(!n.available)throw this.unavailable=!0,new Error(n.reason);i&&(this.sessionsReplaced+=1);let s={projectIdentity:e.projectIdentity,emitter:n.emitter};return this.active.set(r,s),this.sessionsCreated+=1,s}};var se=`typescript-index-${process.pid}-${q()}`,B=R(process.pid),oe={pid:process.pid,...B?{processIdentity:B}:{}};export{J as a,N as b};
2
- //# sourceMappingURL=chunk-P42EIXTA.js.map
1
+ import{a as k}from"./chunk-G4ALYS4J.js";import{c as R,d as E}from"./chunk-JFMEXGFE.js";import{h as S}from"./chunk-7F45LJKI.js";import{randomUUID as q}from"crypto";import{getHeapStatistics as V}from"v8";import{resolve as H}from"path";import{createRequire as L}from"module";import{dirname as I,isAbsolute as j,relative as P,resolve as m,sep as b}from"path";var u=L(import.meta.url),_=1,D="0.4.0";function z(){try{let t=M();if(!t.available)return t;let{packageRoot:e}=t,r=u.resolve("typescript",{paths:[e]}),i=u(r),{FileIndexer:n}=u(m(e,"dist/src/FileIndexer.js")),{Input:s}=u(m(e,"dist/src/Input.js")),{Packages:o}=u(m(e,"dist/src/Packages.js")),c=u(m(e,"dist/src/scip.js"));if(!n||!s||!o||!c.scip?.Document||!c.scip.Index)return{available:!1,reason:"scip-typescript document runtime has an unsupported module shape"};let a={packageVersion:t.packageVersion,typescript:i,Document:c.scip.Document,Index:c.scip.Index,FileIndexer:n,Input:s,Packages:o};return{available:!0,runtime:a,producerIdentity:x(a)}}catch(t){return{available:!1,reason:`scip-typescript document runtime unavailable: ${t instanceof Error?t.message:String(t)}`}}}function J(){let t=M();return t.available?{available:!0,packageVersion:t.packageVersion,typescriptVersion:t.typescriptVersion,producerIdentity:t.producerIdentity}:t}function M(){try{let t=u.resolve("@sourcegraph/scip-typescript/package.json"),e=JSON.parse(S(t,"scip-typescript package manifest"));if(e.version!==D)return{available:!1,reason:`unsupported scip-typescript version ${String(e.version??"unknown")}; expected ${D}`};let r=I(t),i=u.resolve("typescript/package.json",{paths:[r]}),n=JSON.parse(S(i,"TypeScript package manifest"));return typeof n.version!="string"||!n.version?{available:!1,reason:"scip-typescript TypeScript compiler version is unavailable"}:{available:!0,packageRoot:r,packageVersion:e.version,typescriptVersion:n.version,producerIdentity:C(e.version,n.version)}}catch(t){return{available:!1,reason:`scip-typescript document producer unavailable: ${t instanceof Error?t.message:String(t)}`}}}function A(t){let e=t.runtime===void 0?z():t.runtime===null?{available:!1,reason:"scip-typescript document runtime unavailable"}:{available:!0,runtime:t.runtime,producerIdentity:x(t.runtime)};return e.available?{available:!0,emitter:new T(t,e.runtime)}:e}var T=class{producerIdentity;workspaceRoot;tsconfigPath;projectRoot;maxFileByteSize;runtime;host;config=null;includedFiles=new Set;program=null;checker=null;symbolTable=new Map;constructorTable=new Map;packages;fragments=new Map;stats={initializations:0,programUpdates:0,documentsEmitted:0,documentsRemoved:0,sourceNodesReused:0,sourceNodesReplaced:0,symbolEntriesPruned:0};constructor(e,r){this.workspaceRoot=m(e.workspaceRoot),this.tsconfigPath=m(this.workspaceRoot,e.tsconfigPath),this.projectRoot=e.projectRoot??O(this.workspaceRoot,I(this.tsconfigPath)),this.maxFileByteSize=e.maxFileByteSize??1024*1024,this.runtime=r,this.producerIdentity=x(r);let i=v(r.typescript,this.tsconfigPath);this.config=i,this.host=new w(r.typescript,i.options,this.workspaceRoot),this.packages=new r.Packages(this.projectRoot)}initialize(){let e=performance.now();this.initializeProgram();let r=[];for(let i of this.program.getSourceFiles())this.includedFiles.has(f(i.fileName))&&r.push(this.emitSourceFile(i));return this.result(r,e)}advance(e){if(!this.program||!this.checker||!this.config)return this.initializeAndAdvance(e);let r=performance.now(),i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);if(this.fragments.clear(),i.length===0&&n.length===0)return this.validateAffectedPaths(s),this.result(this.emitAffectedFiles(s),r);let o=v(this.runtime.typescript,this.tsconfigPath);this.config=o,this.includedFiles=new Set(o.fileNames.map(f));let c=this.program,a=new Map;for(let d of[...i,...n]){let p=y(this.workspaceRoot,d),l=c.getSourceFile(p);l&&(a.set(d,l),this.stats.symbolEntriesPruned+=F(this.symbolTable,l),this.stats.symbolEntriesPruned+=F(this.constructorTable,l)),this.host.invalidate(p)}this.program=this.runtime.typescript.createProgram(o.fileNames,o.options,this.host.compilerHost,c),this.checker=this.program.getTypeChecker(),this.stats.programUpdates+=1,this.validateIncrementalPaths(i,n,s),this.stats.documentsRemoved+=n.length;for(let[d,p]of a)this.program.getSourceFile(y(this.workspaceRoot,d))===p?this.stats.sourceNodesReused+=1:this.stats.sourceNodesReplaced+=1;return this.result(this.emitAffectedFiles(s),r)}fragment(e){return this.fragments.get(g(e))??null}snapshotStats(){return{...this.stats}}initializeAndAdvance(e){let r=performance.now();this.initializeProgram();let i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);return this.fragments.clear(),this.validateIncrementalPaths(i,n,s,!0),this.stats.documentsRemoved+=n.length,this.result(this.emitAffectedFiles(s),r)}initializeProgram(){let e=this.config??v(this.runtime.typescript,this.tsconfigPath);this.includedFiles=new Set(e.fileNames.map(f)),this.program=this.runtime.typescript.createProgram(e.fileNames,e.options,this.host.compilerHost),this.checker=this.program.getTypeChecker(),this.stats.initializations+=1}validateIncrementalPaths(e,r,i,n=!1){if(!n&&e.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires a modified or removed file");if(i.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires an affected or removed file");for(let s of e){let o=y(this.workspaceRoot,s);if(!this.program?.getSourceFile(o))throw new Error(`modified TypeScript dependency is unavailable to the configured project: ${s}`)}for(let s of r){let o=y(this.workspaceRoot,s);if(this.program?.getSourceFile(o))throw new Error(`removed TypeScript source is still present in the configured project: ${s}`)}this.validateAffectedPaths(i)}validateAffectedPaths(e){for(let r of e){let i=y(this.workspaceRoot,r);if(!this.includedFiles.has(f(i)))throw new Error(`affected TypeScript file is outside the configured project: ${r}`)}}emitAffectedFiles(e){return e.map(r=>{let i=this.program.getSourceFile(y(this.workspaceRoot,r));if(!i)throw new Error(`affected TypeScript source is unavailable: ${r}`);return this.emitSourceFile(i)})}emitSourceFile(e){if(!this.checker)throw new Error("TypeScript document emitter is not initialized");let r=g(P(this.workspaceRoot,e.fileName)),i=new this.runtime.Document({relative_path:r,occurrences:[]});if(new this.runtime.FileIndexer(this.checker,{cwd:this.workspaceRoot,projectRoot:this.projectRoot,projectDisplayName:this.projectRoot,maxFileByteSizeNumber:this.maxFileByteSize},new this.runtime.Input(e.fileName,e.getText()),i,this.symbolTable,this.constructorTable,this.packages,e).index(),this.stats.documentsEmitted+=1,i.occurrences.length===0)return this.fragments.delete(r),this.stats.documentsRemoved+=1,{relativePath:r,bytes:null,occurrences:0,symbols:i.symbols.length,referenceFragments:[]};let s=i.serializeBinary();return this.fragments.set(r,s),{relativePath:r,bytes:s,occurrences:i.occurrences.length,symbols:i.symbols.length,referenceFragments:U(r,i)}}result(e,r){return{producerIdentity:this.producerIdentity,fragments:e,durationMs:performance.now()-r,stats:this.snapshotStats()}}};function U(t,e){let r=new Map;for(let i of e.occurrences){if(!i.symbol||(i.symbol_roles&1)!==0||i.range.length<3)continue;let n=i.range[0],s=i.range[1];if(!Number.isInteger(n)||!Number.isInteger(s))continue;let o={targetSymbol:i.symbol,location:{file:t,line:n,column:s}};r.set(`${i.symbol}\0${n}\0${s}`,o)}return[...r.values()].sort((i,n)=>i.targetSymbol.localeCompare(n.targetSymbol)||i.location.line-n.location.line||i.location.column-n.location.column)}var w=class{compilerHost;sourceFiles=new Map;constructor(e,r,i){let n=e.createCompilerHost(r),s=n.getSourceFile.bind(n);this.compilerHost={...n,getCurrentDirectory:()=>i,getSourceFile:(o,c,a,d)=>{let p=f(o);if(this.sourceFiles.has(p))return this.sourceFiles.get(p);let l=s(o,c,a,d);return this.sourceFiles.set(p,l),l}}}invalidate(e){this.sourceFiles.delete(f(e))}};function v(t,e){let r=t.readConfigFile(e,t.sys.readFile);if(r.error)throw new Error(t.formatDiagnostics([r.error],t.createCompilerHost({})));let i=t.parseJsonConfigFileContent(r.config,t.sys,I(e)),n=i.errors.filter(s=>s.code!==18003);if(n.length>0)throw new Error(t.formatDiagnostics(n,t.createCompilerHost({})));return i}function x(t){return C(t.packageVersion,t.typescript.version)}function C(t,e){return`scip-typescript:${t}:typescript:${e}:document-adapter:${_}`}function O(t,e){return g(P(t,e))||"."}function y(t,e){if(j(e))throw new Error(`expected a project-relative path: ${e}`);let r=m(t,e),i=t.endsWith(b)?t:`${t}${b}`;if(r!==t&&!r.startsWith(i))throw new Error(`path escapes the project root: ${e}`);return r}function h(t){return[...new Set(t.map(g))].sort()}function g(t){return t.split(b).join("/").replace(/^\.\//,"")}function f(t){return m(t)}function F(t,e){let r=0;for(let i of t.keys())if($(i)){try{if(i.getSourceFile()!==e)continue}catch{continue}t.delete(i),r+=1}return r}function $(t){return!!(t&&typeof t=="object"&&"kind"in t&&"getSourceFile"in t)}var N=class{projectRoot;currentGeneration;createEmitter;wallNow;monotonicNow;maxActiveSessions;softMemoryLimitBytes;memoryUsage;active=new Map;requests=0;sessionsCreated=0;sessionsReplaced=0;sessionsEvicted=0;lastRequestAtMs=null;lastDurationMs=null;lastError=null;unavailable=!1;constructor(e){if(this.projectRoot=H(e.projectRoot),this.currentGeneration=e.currentGeneration,this.createEmitter=e.createEmitter??A,this.wallNow=e.wallNow??e.now??Date.now,this.monotonicNow=e.monotonicNow??e.now??E,e.maxActiveSessions!==void 0&&(!Number.isInteger(e.maxActiveSessions)||e.maxActiveSessions<1))throw new Error("TypeScript index maxActiveSessions must be a positive integer.");if(this.maxActiveSessions=e.maxActiveSessions??8,e.softMemoryLimitMb!==void 0&&(!Number.isInteger(e.softMemoryLimitMb)||e.softMemoryLimitMb<1))throw new Error("TypeScript index softMemoryLimitMb must be a positive integer.");this.softMemoryLimitBytes=e.softMemoryLimitMb===void 0?null:e.softMemoryLimitMb*1024*1024,this.memoryUsage=e.memoryUsage??(()=>({heapUsedBytes:process.memoryUsage().heapUsed,heapLimitBytes:V().heap_size_limit}))}handle(e,r){let i=this.monotonicNow();try{if(this.currentGeneration()!==e)throw new Error("TypeScript index request does not match the currently published generation.");let n=this.emitterFor(r);if(n.emitter.producerIdentity!==r.producerIdentity)throw new Error("TypeScript index producer identity changed.");let s=n.emitter.snapshotStats(),o=n.emitter.advance({modifiedFiles:r.modifiedFiles,removedFiles:r.removedFiles,affectedFiles:r.affectedFiles}),c=this.monotonicNow()-i;return this.requests+=1,this.lastRequestAtMs=this.wallNow(),this.lastDurationMs=c,this.lastError=null,this.unavailable=!1,{producerIdentity:o.producerIdentity,cold:o.stats.initializations>s.initializations,durationMs:c,fragments:o.fragments.map(a=>({relativePath:a.relativePath,bytesBase64:a.bytes===null?null:Buffer.from(a.bytes).toString("base64"),occurrences:a.occurrences,symbols:a.symbols,referenceFragments:a.referenceFragments}))}}catch(n){throw this.lastError=n instanceof Error?n.message:String(n),n}}status(e){let r=[...this.active.values()].map(o=>o.emitter.snapshotStats()),i=o=>r.reduce((c,a)=>c+a[o],0),n=this.memoryUsage(),s=this.softMemoryLimitBytes!==null&&n.heapUsedBytes>=this.softMemoryLimitBytes;return{protocolVersion:k,state:this.unavailable?"unavailable":this.lastError?"error":this.active.size>0?"ready":"idle",requests:this.requests,sessionsCreated:this.sessionsCreated,sessionsReplaced:this.sessionsReplaced,sessionsEvicted:this.sessionsEvicted,activeSessions:this.active.size,maxActiveSessions:this.maxActiveSessions,heapUsedBytes:n.heapUsedBytes,heapLimitBytes:n.heapLimitBytes,...this.softMemoryLimitBytes===null?{}:{softMemoryLimitBytes:this.softMemoryLimitBytes},retireRequested:s,initializations:i("initializations"),programUpdates:i("programUpdates"),documentsEmitted:i("documentsEmitted"),documentsRemoved:i("documentsRemoved"),...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastDurationMs===null?{}:{lastDurationMs:this.lastDurationMs},...this.lastError?{lastError:this.lastError}:{},...e?{mailbox:e}:{}}}close(){this.active.clear()}emitterFor(e){let r=`${e.tsconfigPath}\0${e.projectArgument}`,i=this.active.get(r);if(i?.projectIdentity===e.projectIdentity)return this.active.delete(r),this.active.set(r,i),i;if(i)this.active.delete(r);else if(this.active.size>=this.maxActiveSessions){let o=this.active.keys().next().value;o!==void 0&&(this.active.delete(o),this.sessionsEvicted+=1)}let n=this.createEmitter({workspaceRoot:this.projectRoot,tsconfigPath:e.tsconfigPath,projectRoot:e.projectArgument});if(!n.available)throw this.unavailable=!0,new Error(n.reason);i&&(this.sessionsReplaced+=1);let s={projectIdentity:e.projectIdentity,emitter:n.emitter};return this.active.set(r,s),this.sessionsCreated+=1,s}};var se=`typescript-index-${process.pid}-${q()}`,B=R(process.pid),oe={pid:process.pid,...B?{processIdentity:B}:{}};export{J as a,N as b};
2
+ //# sourceMappingURL=chunk-Q7ATHARX.js.map
@@ -1,5 +1,5 @@
1
- import{a as q}from"./chunk-QOKYJ33H.js";import{a as _}from"./chunk-6HFCYNYE.js";import{a as G}from"./chunk-SV2LEFVM.js";import{a as K,b as L,c as X,e as U,h as T}from"./chunk-FESCRNVV.js";import{i as H,v as z,y as $}from"./chunk-JWTGMPIT.js";import{Aa as O,Ca as S,wa as F}from"./chunk-N5B2NILC.js";function I(t,n){let e=et(t,n)??it(t,n)??rt(t,n)??ot(t,n);return st(t,e,n)}function et(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=N(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(N(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function N(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function it(t,n){if(!w(t[n]??""))return null;let e=n;for(;e>0&&w(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&w(t[i]??"");)i+=1;return{start:e,end:i}}function w(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function rt(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(E(o)!==null)break;if(P(o)!==null)return null;e-=1}if(e<0)return null;let i=E(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=E(o);if(s!==null){if(s<=i)break;r+=1;continue}if(P(o)!==null)break;r+=1}return{start:e,end:r}}function E(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function ot(t,n){let e=t[n]??"";if(W(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&V(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&V(t[r]??"");)r+=1;return{start:i,end:r}}function V(t){return P(t)===null}function P(t){return t.trim().length===0?"blank":W(t)?"heading":N(t)?"fence":w(t)?"table":E(t)!==null?"list":null}function W(t){return/^#{1,6}\s+/.test(t.trim())}function st(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
1
+ import{a as q}from"./chunk-QOKYJ33H.js";import{a as _}from"./chunk-XKXTR6ZI.js";import{a as G}from"./chunk-SV2LEFVM.js";import{a as K,b as L,c as X,e as U,h as T}from"./chunk-ETC674NS.js";import{i as H,v as z,y as $}from"./chunk-KNLQGXVH.js";import{Ba as O,Da as S,xa as F}from"./chunk-JZ2A7LDM.js";function I(t,n){let e=et(t,n)??it(t,n)??rt(t,n)??ot(t,n);return st(t,e,n)}function et(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=N(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(N(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function N(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function it(t,n){if(!w(t[n]??""))return null;let e=n;for(;e>0&&w(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&w(t[i]??"");)i+=1;return{start:e,end:i}}function w(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function rt(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(E(o)!==null)break;if(P(o)!==null)return null;e-=1}if(e<0)return null;let i=E(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=E(o);if(s!==null){if(s<=i)break;r+=1;continue}if(P(o)!==null)break;r+=1}return{start:e,end:r}}function E(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function ot(t,n){let e=t[n]??"";if(W(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&V(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&V(t[r]??"");)r+=1;return{start:i,end:r}}function V(t){return P(t)===null}function P(t){return t.trim().length===0?"blank":W(t)?"heading":N(t)?"fence":w(t)?"table":E(t)!==null?"list":null}function W(t){return/^#{1,6}\s+/.test(t.trim())}function st(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
2
2
  `).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function A(t,n){return n.filter(e=>t.includes(e))}var ct=/<!--\s*scip-query:\s*snapshot\s*-->/i;function Z(t,n){if((t.config.docs?.snapshotPaths??[]).some(r=>G(r,n)))return!0;let i=T(t,n);return i.length>0&&ct.test(i)}var J={classifyCitation:lt,citationContexts:dt,citationKindLabel:ft,citationRemediation:gt,referenceTargets:ht,hasLineAnchoredCitation:at};function at(t){return t.some(n=>(n.lineReferences?.length??0)>0)}function lt(t){let n=t.join(`
3
3
  `).toLowerCase(),e=[],i=A(n,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(i.length>0)return e.push(`configuration/example terms near citation: ${i.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:e};let r=A(n,["accepted","intentional","intentionally","retained","historical"]);if(r.length>0)return e.push(`intentional-record terms near citation: ${r.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:e};let o=A(n,["command","cli","usage","example","run","workflow"]);return o.length>0?(e.push(`guide/reference terms near citation: ${o.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:e}):(e.push(t.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:e})}function dt(t,n,e){let i=T(t,n);if(!i&&!S(t.config.projectRoot,n))return[];let r=i.split(/\r?\n/),o=e.flatMap(ut),s=[];for(let c=0;c<r.length;c+=1){let a=r[c]??"";o.some(d=>a.includes(d))&&s.push(I(r,c))}return s}function ut(t){let n=t.split("/");return[t,`./${t}`,n.slice(-3).join("/"),n.slice(-2).join("/")].filter((e,i,r)=>e.length>0&&r.indexOf(e)===i)}function ft(t){switch(t){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function gt(t,n){switch(t){case"behavioral-claim":return`Re-read ${n} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${n} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${n} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${n} is still meant to name this file.`}}function ht(t,n,e){let i=q(e),r=new Set;for(let o of n)pt(t,o,i.get(o)??[])&&r.add(o);return r}function pt(t,n,e){if(!mt.test(n)||!S(t.config.projectRoot,n))return!0;if(e.length===0)return!1;let i=O(t.config.projectRoot,n,{inputKind:"changed source file"}).split(/\r?\n/),r=yt(i);for(let o of e)for(let s=o.startLine;s<=o.endLine;s+=1)if((i[s]??"").trim()!==""&&!r.has(s))return!0;return!1}var mt=/\.(?:[cm]?[jt]sx?)$/i;function yt(t){let n=new Set,e=!1;for(let i=0;i<t.length;i+=1){let r=t[i].trim();!e&&Ct(r)&&(e=!0),e&&(n.add(i),r.endsWith(";")&&(e=!1))}return n}function Ct(t){return/^import(?:\s|$)/.test(t)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(t)}var Q=X({kind:"doc-path-evidence",invalidation:U("doc-path-evidence"),serialize:jt,deserialize:Lt}),v=/\.(?:md|mdx|rst|txt)$/i;function Dt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var bt=3,St=/([A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6})(?::([1-9][0-9]*))?\b/g;function en(t,n={}){let{doc:e,limit:i=20,minCoupling:r=bt,includeSnapshotExcluded:o=!1}=n,s=At(t,n.historyMode??"bounded");if(!s)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let a of s.docFiles){if(e!==void 0&&!a.includes(e)||e===void 0&&!Y(t,a)||e!==void 0&&!S(t.config.projectRoot,a))continue;let d=Z(t,a);if(d&&!o)continue;let{value:m,estimated:y}=xt(t,a,s.changeTimes.get(a)),g=Rt(t,a),u=new Map,{resolved:l,broken:h,citations:b}=wt(t,a,s.tracked,s.trackedBySuffix,s.everSeenInHistory),x=new Map(b.map(f=>[f.file,f]));for(let f of l){if(f===a||v.test(f))continue;let C=(s.changeTimes.get(f)??[]).filter(D=>D>m).length;if(C===0)continue;let p=x.get(f);u.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:C,...B("reference",g,p?.contexts),citationContexts:p?.contexts,citedLines:p?.lineReferences})}for(let[f,C]of s.coupling.get(a)??[]){if(C<r||!s.tracked.has(f))continue;let p=(s.changeTimes.get(f)??[]).filter(M=>M>m).length;if(p===0)continue;let D=u.get(f);D?(D.evidence="both",D.coChanges=C,Object.assign(D,B("both",g,D.citationContexts))):u.set(f,{file:f,evidence:"co-change",coChanges:C,changesSinceDocUpdate:p,...B("co-change",g)})}if(u.size===0&&h.length===0)continue;let R=[...u.values()].sort((f,C)=>C.changesSinceDocUpdate-f.changesSinceDocUpdate);c.push({doc:a,docLastChangedAt:m,staleness:R.reduce((f,C)=>f+C.changesSinceDocUpdate,0)+h.length*10,subjects:R.slice(0,8),brokenReferences:h,...d?{snapshotExcluded:!0}:{},...y?{docLastChangedAtEstimated:!0}:{}})}return c.sort((a,d)=>d.staleness-a.staleness),{available:!0,commitsAnalyzed:s.historyCommitCount,docsScanned:s.docFiles.length,findings:c.slice(0,i)}}function xt(t,n,e){if(e&&e.length>0)return{value:Math.max(...e),estimated:!1};try{return{value:Math.floor(F(t.config.projectRoot,n).mtimeMs/1e3),estimated:!0}}catch(i){if(S(t.config.projectRoot,n))throw i;return{value:0,estimated:!1}}}function Rt(t,n){let e=T(t,n).slice(0,6e3);if(!e)return{docIntent:"unknown",reasons:["doc text unavailable"]};let i=`${n}
4
4
  ${e}`.toLowerCase(),r=A(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=A(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function B(t,n,e=[]){let i=t==="co-change"||e.length===0?null:J.classifyCitation(e);return{actionTier:Tt(t,n.docIntent,i?.actionTier),docIntent:n.docIntent,docIntentReasons:n.reasons,...i?{citationKind:i.citationKind,citationKindReasons:i.reasons}:{}}}function Tt(t,n,e){return n==="historical-note"?"support":e||(t==="co-change"?"signal":"direct")}function At(t,n){let e=_(t,{historyMode:n}),i=e.commitHistory();if(!i)return null;let r=e.trackedFiles()??new Set,o=new Map,s=new Map,c=new Set;for(let a of i.commits){let d=[...new Set(a.files)],m=d.filter(g=>v.test(g)),y=d.filter(g=>!v.test(g));for(let g of d){c.add(g);let u=o.get(g)??[];u.push(a.timestamp),o.set(g,u)}for(let g of m){let u=s.get(g);u||(u=new Map,s.set(g,u));for(let l of y)u.set(l,(u.get(l)??0)+1)}}return{changeTimes:o,coupling:s,docFiles:[...r].filter(a=>v.test(a)),everSeenInHistory:c,historyCommitCount:i.commits.length,tracked:r,trackedBySuffix:tt(r)}}function rn(t,n){if(n.size===0)return[];let e=z(),i=0,r=0,o=0,s=0,c=0,a=0;return $("doc-reference.docs-citing-files",()=>{let d=_(t).trackedFiles()??new Set;i=d.size;let m=tt(d),y=Mt(n,m),g=[];for(let u of d){if(!Y(t,u))continue;e&&(r+=1);let l=T(t,u);if(!l&&!S(t.config.projectRoot,u)){e&&(o+=1);continue}if(!It(l,y)){e&&(s+=1);continue}let h=nt(t,u,l);if(!h)continue;e&&(c+=1);let b=vt(h.candidates,n,y,d,m);if(b.size===0)continue;let x=[...new Set([...b.values()].flatMap(p=>[...p]))],R=Et(h.contextsByCandidate,x),f=[...b].map(([p,D])=>({file:p,contexts:k([...D].flatMap(M=>R.get(M)??[])).slice(0,3),lineReferences:j([...D].flatMap(M=>h.lineReferencesByCandidate.get(M)??[]))})).filter(p=>p.contexts.length>0),C=[...b.keys()];if(C.length>0){e&&(a+=1);let p=C.sort();g.push({doc:u,cited:p,citations:f,citedClaims:k(f.flatMap(D=>D.contexts)).slice(0,3)})}}return g},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:a}))}function Y(t,n){return v.test(n)&&!Dt(n)&&S(t.config.projectRoot,n)}function tt(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),s=n.get(o)??[];s.push(e),n.set(o,s)}}return n}function Mt(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let s=r.slice(-o).join("/"),c=n.get(s);c?.length===1&&c[0]===i&&e.add(s)}}return e}function vt(t,n,e,i,r){let o=new Map;for(let s of t){if(!e.has(s))continue;let c;if(n.has(s))c=s;else if(i.has(s))c=s;else{let d=r.get(s);d?.length===1&&(c=d[0])}if(!c||!n.has(c))continue;let a=o.get(c)??new Set;a.add(s),o.set(c,a)}return o}function wt(t,n,e,i,r){let o=new Set,s=new Set,c=nt(t,n);if(!c)return{resolved:o,broken:[],citations:[]};let a=c.candidates,d=c.contextsByCandidate,m=c.lineReferencesByCandidate,y=new Map,g=new Map,u=(l,h)=>{let b=d.get(h);if(b&&b.length>0){let R=y.get(l)??[];R.push(...b),y.set(l,k(R).slice(0,3))}let x=m.get(h);x&&x.length>0&&g.set(l,j([...g.get(l)??[],...x]))};for(let l of a){if(e.has(l)){o.add(l),u(l,l);continue}let h=i.get(l);if(h&&h.length===1){o.add(h[0]),u(h[0],l);continue}h&&h.length>1||r.has(l)&&s.add(l)}return{resolved:o,broken:[...s],citations:[...y].map(([l,h])=>({file:l,contexts:h,lineReferences:g.get(l)}))}}function Et(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function nt(t,n,e){let i=e;if(i===void 0&&(i=T(t,n),!i&&!S(t.config.projectRoot,n)))return null;let r=H(t,n,i),o=Q.read(t,n,r);if(o)return o;let s=kt(i);return Q.write(t,n,r,s),s}function It(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function kt(t){let n=t.split(/\r?\n/),e=new Set,i=new Map,r=new Map;for(let o=0;o<n.length;o+=1){let s=n[o]??"";for(let c of s.matchAll(St)){let a=(c[1]??"").replace(/^\.?\//,"");if(a.length===0)continue;e.add(a);let d=c[2]?Number(c[2]):null;d!==null&&Number.isSafeInteger(d)&&r.set(a,j([...r.get(a)??[],d]));let m=I(n,o);if(m.length===0)continue;let y=i.get(a)??[];y.push(m),i.set(a,k(y).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i,lineReferencesByCandidate:r}}function jt(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()],lineReferencesByCandidate:[...t.lineReferencesByCandidate.entries()]};return JSON.stringify(n)}function Lt(t){try{let n=JSON.parse(t);if(!K(n))return null;let e=L(n.candidates),i=Nt(n.contextsByCandidate),r=_t(n.lineReferencesByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i),lineReferencesByCandidate:new Map(r??[])}}catch{return null}}function _t(t){if(t===void 0)return[];if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"||!Array.isArray(e[1]))return null;let i=[];for(let r of e[1]){if(typeof r!="number"||!Number.isSafeInteger(r))return null;i.push(r)}n.push([e[0],j(i)])}return n}function Nt(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=L(e[1]);if(!i)return null;n.push([e[0],i])}return n}function k(t){let n=[];for(let e of new Set(t))n.some(i=>Pt(i,e))||n.push(e);return n}function j(t){return[...new Set(t)].sort((n,e)=>n-e)}function Pt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),s=e.filter(c=>o.has(c)).length;return s>=3&&s/r>=.6}export{Dt as a,en as b,rn as c};
5
- //# sourceMappingURL=chunk-JYR66JN5.js.map
5
+ //# sourceMappingURL=chunk-Q7CSKIDM.js.map