scip-query 0.10.0 → 0.10.2

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 (293) hide show
  1. package/README.md +115 -58
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/chunk-3KLLFNT4.js +2 -0
  4. package/dist/{chunk-UIWAZ2NT.js → chunk-3UVJJ6Z7.js} +1 -1
  5. package/dist/chunk-3UW7VM4H.js +62 -0
  6. package/dist/chunk-3ZYF3ELZ.js +2 -0
  7. package/dist/{chunk-MN75T4UB.js → chunk-47UA45TU.js} +2 -2
  8. package/dist/{chunk-NC4IUW25.js → chunk-4ZUJJRWT.js} +2 -2
  9. package/dist/chunk-5B53WB6E.js +4 -0
  10. package/dist/{chunk-2WEH5QHC.js → chunk-5FOPAXWY.js} +2 -2
  11. package/dist/{chunk-VZRILF2Z.js → chunk-5M4TYWVI.js} +2 -2
  12. package/dist/{chunk-QJWN6LA5.js → chunk-5QJXH6ZL.js} +5 -5
  13. package/dist/{chunk-NN3O7TPH.js → chunk-64MNV6AB.js} +1 -1
  14. package/dist/chunk-77YBOOYT.js +2 -0
  15. package/dist/chunk-7KCSELEV.js +2 -0
  16. package/dist/{chunk-ZZ2W5P3D.js → chunk-7OHWPJ5N.js} +2 -2
  17. package/dist/chunk-7S5E7KWT.js +2 -0
  18. package/dist/chunk-A3VNUGKJ.js +2 -0
  19. package/dist/{chunk-ISCKLDSS.js → chunk-A4L36SZS.js} +3 -3
  20. package/dist/{chunk-IVAIPXNO.js → chunk-AUVBR62P.js} +2 -2
  21. package/dist/chunk-AW4N6MGC.js +18 -0
  22. package/dist/{chunk-PG3ZI5IH.js → chunk-B6MJ5VQV.js} +2 -2
  23. package/dist/chunk-B75HZHUP.js +2 -0
  24. package/dist/chunk-BGBBVSH4.js +2 -0
  25. package/dist/chunk-BKDXBJDQ.js +2 -0
  26. package/dist/{chunk-AQYBOORI.js → chunk-C2QSK7E7.js} +1 -1
  27. package/dist/chunk-C3MZZ2ZN.js +2 -0
  28. package/dist/{chunk-AP5GTKSG.js → chunk-CAWSSEVM.js} +2 -2
  29. package/dist/chunk-CFL2CNIF.js +10 -0
  30. package/dist/{chunk-4HTJZC6G.js → chunk-CJJP64OC.js} +2 -2
  31. package/dist/chunk-CNTEQMHA.js +2 -0
  32. package/dist/{chunk-WEJYUS5O.js → chunk-CRU42NJU.js} +2 -2
  33. package/dist/chunk-CSWZFD46.js +2 -0
  34. package/dist/{chunk-ZOT3WUZW.js → chunk-CTCAF3YA.js} +2 -2
  35. package/dist/chunk-D322LMSA.js +5 -0
  36. package/dist/{chunk-772YYL6I.js → chunk-DAI74TJU.js} +2 -2
  37. package/dist/chunk-DE7MA6OD.js +3 -0
  38. package/dist/chunk-DJMK4DBL.js +2 -0
  39. package/dist/chunk-DRAZH77R.js +7 -0
  40. package/dist/{chunk-L2KFPRMA.js → chunk-E44ZMVNA.js} +2 -2
  41. package/dist/{chunk-BNW3Q24R.js → chunk-E7KERP7E.js} +2 -2
  42. package/dist/{chunk-QKO474FG.js → chunk-EOZIZWW4.js} +2 -2
  43. package/dist/chunk-ERHOS6AW.js +2 -0
  44. package/dist/{chunk-ADRYSISR.js → chunk-ESG4HBEF.js} +2 -2
  45. package/dist/chunk-EWC3UK4V.js +3 -0
  46. package/dist/chunk-FGCL6NDB.js +8 -0
  47. package/dist/chunk-FIB4JPEX.js +2 -0
  48. package/dist/chunk-FNRPGGVI.js +2 -0
  49. package/dist/chunk-FOQHUKNZ.js +4 -0
  50. package/dist/chunk-FPMVCDIJ.js +2 -0
  51. package/dist/chunk-FUPDW5AC.js +3 -0
  52. package/dist/chunk-G3WGZU5Q.js +2 -0
  53. package/dist/chunk-GS33KGAY.js +2 -0
  54. package/dist/chunk-GZCQTZLK.js +2 -0
  55. package/dist/{chunk-VGBSY6N7.js → chunk-HVTYSC26.js} +2 -2
  56. package/dist/{chunk-2BMFRBV6.js → chunk-ICXVNWMI.js} +2 -2
  57. package/dist/chunk-JM72FNGA.js +2 -0
  58. package/dist/chunk-KPHKX4LP.js +71 -0
  59. package/dist/{chunk-6DEX3XP6.js → chunk-LPLGJ4HO.js} +2 -2
  60. package/dist/chunk-MHK7Z53U.js +2 -0
  61. package/dist/chunk-MHTDOFV7.js +5 -0
  62. package/dist/chunk-MUULWXSJ.js +2 -0
  63. package/dist/chunk-MZ7APUFN.js +3 -0
  64. package/dist/chunk-NNDYO2DX.js +2 -0
  65. package/dist/chunk-NP5HYVLX.js +20 -0
  66. package/dist/{chunk-Y5H7TBVE.js → chunk-NVFERV4U.js} +2 -2
  67. package/dist/{chunk-LWYIGRHR.js → chunk-NXIAHE7F.js} +1 -1
  68. package/dist/chunk-O3OKSF6O.js +2 -0
  69. package/dist/chunk-O4L4AB3T.js +2 -0
  70. package/dist/chunk-OBBDKQAG.js +3 -0
  71. package/dist/chunk-OLD6PBU6.js +7 -0
  72. package/dist/{chunk-V76FCF5F.js → chunk-PFOCOG57.js} +2 -2
  73. package/dist/chunk-PVZMPG5I.js +2 -0
  74. package/dist/chunk-QLNGUWR7.js +2 -0
  75. package/dist/chunk-QSXQT3NE.js +2 -0
  76. package/dist/{chunk-OLCKSG3Y.js → chunk-QVCCLDZI.js} +2 -2
  77. package/dist/chunk-RHTJBYZ5.js +2 -0
  78. package/dist/chunk-SPE4YCOT.js +7 -0
  79. package/dist/{chunk-FVIKFWUL.js → chunk-TM6GVHA6.js} +2 -2
  80. package/dist/chunk-TO54DY4O.js +2 -0
  81. package/dist/chunk-UMNENNTX.js +2 -0
  82. package/dist/chunk-UNJG7P2I.js +2 -0
  83. package/dist/{chunk-TKDJQ2WD.js → chunk-UUBMFL3F.js} +1 -1
  84. package/dist/chunk-VAA5FFIW.js +2 -0
  85. package/dist/chunk-WDUTG2ZR.js +4 -0
  86. package/dist/chunk-X7ZY6FFF.js +4 -0
  87. package/dist/{chunk-BGRPMGTD.js → chunk-YQH353VA.js} +2 -2
  88. package/dist/chunk-YTR4CO5S.js +38 -0
  89. package/dist/chunk-YUOAAR24.js +2 -0
  90. package/dist/{chunk-YWZBKYLS.js → chunk-YYD245WG.js} +2 -2
  91. package/dist/{chunk-SCEMECW7.js → chunk-Z4VHYJ5U.js} +2 -2
  92. package/dist/chunk-ZFMPHDAT.js +4 -0
  93. package/dist/chunk-ZQLO2SCU.js +6 -0
  94. package/dist/chunk-ZSLT7NWQ.js +61 -0
  95. package/dist/cli.js +276 -271
  96. package/dist/{config-types-CGIeLEpY.d.ts → config-types-Bj4sh28g.d.ts} +37 -1
  97. package/dist/{db-DdTPetj5.d.ts → db-CTarohbZ.d.ts} +1 -1
  98. package/dist/git-history-Dao3_Pu9.d.ts +12 -0
  99. package/dist/{health-C6r2VgpA.d.ts → health-Bx0x1HAG.d.ts} +64 -4
  100. package/dist/index.d.ts +7 -6
  101. package/dist/index.js +1 -1
  102. package/dist/postinstall.js +2 -2
  103. package/dist/queries/affected.d.ts +2 -2
  104. package/dist/queries/affected.js +1 -1
  105. package/dist/queries/bottlenecks.d.ts +6 -2
  106. package/dist/queries/bottlenecks.js +1 -1
  107. package/dist/queries/by-kind.d.ts +2 -2
  108. package/dist/queries/by-kind.js +1 -1
  109. package/dist/queries/call-graph.d.ts +2 -2
  110. package/dist/queries/call-graph.js +1 -1
  111. package/dist/queries/change-surface.d.ts +2 -2
  112. package/dist/queries/change-surface.js +1 -1
  113. package/dist/queries/cleanup-plan.d.ts +2 -2
  114. package/dist/queries/cleanup-plan.js +1 -1
  115. package/dist/queries/co-change.d.ts +40 -5
  116. package/dist/queries/co-change.js +1 -1
  117. package/dist/queries/code.d.ts +2 -2
  118. package/dist/queries/code.js +1 -1
  119. package/dist/queries/complexity-hotspots.d.ts +2 -2
  120. package/dist/queries/complexity-hotspots.js +1 -1
  121. package/dist/queries/complexity.d.ts +2 -2
  122. package/dist/queries/complexity.js +1 -1
  123. package/dist/queries/convergence.d.ts +2 -2
  124. package/dist/queries/convergence.js +1 -1
  125. package/dist/queries/coupling.d.ts +6 -2
  126. package/dist/queries/coupling.js +1 -1
  127. package/dist/queries/cycles.d.ts +2 -2
  128. package/dist/queries/cycles.js +1 -1
  129. package/dist/queries/dataflow.d.ts +2 -2
  130. package/dist/queries/dataflow.js +1 -1
  131. package/dist/queries/dead.d.ts +10 -3
  132. package/dist/queries/dead.js +1 -1
  133. package/dist/queries/deep-chains.d.ts +6 -2
  134. package/dist/queries/deep-chains.js +1 -1
  135. package/dist/queries/deps.d.ts +2 -2
  136. package/dist/queries/deps.js +1 -1
  137. package/dist/queries/diff-gate.d.ts +66 -3
  138. package/dist/queries/diff-gate.js +1 -1
  139. package/dist/queries/diff-impact.d.ts +20 -4
  140. package/dist/queries/diff-impact.js +1 -1
  141. package/dist/queries/doc-drift.d.ts +20 -3
  142. package/dist/queries/doc-drift.js +1 -1
  143. package/dist/queries/drift.d.ts +10 -3
  144. package/dist/queries/drift.js +1 -1
  145. package/dist/queries/extract-candidates.d.ts +11 -3
  146. package/dist/queries/extract-candidates.js +1 -1
  147. package/dist/queries/fan.d.ts +2 -2
  148. package/dist/queries/fan.js +1 -1
  149. package/dist/queries/files.d.ts +2 -2
  150. package/dist/queries/files.js +1 -1
  151. package/dist/queries/health.d.ts +3 -3
  152. package/dist/queries/health.js +1 -1
  153. package/dist/queries/hierarchy.d.ts +2 -2
  154. package/dist/queries/hierarchy.js +1 -1
  155. package/dist/queries/hotspots.d.ts +2 -2
  156. package/dist/queries/hotspots.js +1 -1
  157. package/dist/queries/imports.d.ts +2 -2
  158. package/dist/queries/imports.js +1 -1
  159. package/dist/queries/incomplete-migration.d.ts +16 -3
  160. package/dist/queries/incomplete-migration.js +1 -1
  161. package/dist/queries/index.d.ts +20 -12
  162. package/dist/queries/index.js +1 -1
  163. package/dist/queries/isolated.d.ts +2 -2
  164. package/dist/queries/isolated.js +1 -1
  165. package/dist/queries/locality-candidates.d.ts +51 -0
  166. package/dist/queries/locality-candidates.js +2 -0
  167. package/dist/queries/members.d.ts +2 -2
  168. package/dist/queries/members.js +1 -1
  169. package/dist/queries/methods.d.ts +2 -2
  170. package/dist/queries/methods.js +1 -1
  171. package/dist/queries/outline.d.ts +2 -2
  172. package/dist/queries/outline.js +1 -1
  173. package/dist/queries/passthrough-candidates.d.ts +8 -3
  174. package/dist/queries/passthrough-candidates.js +1 -1
  175. package/dist/queries/plan-context.d.ts +4 -2
  176. package/dist/queries/plan-context.js +1 -1
  177. package/dist/queries/react-component-duplicates.d.ts +31 -0
  178. package/dist/queries/react-component-duplicates.js +2 -0
  179. package/dist/queries/react-hook-candidates.d.ts +40 -0
  180. package/dist/queries/react-hook-candidates.js +2 -0
  181. package/dist/queries/react-large-component-pressure.d.ts +34 -0
  182. package/dist/queries/react-large-component-pressure.js +2 -0
  183. package/dist/queries/recent-duplicates.d.ts +32 -3
  184. package/dist/queries/recent-duplicates.js +1 -1
  185. package/dist/queries/redundant-reexports.d.ts +7 -3
  186. package/dist/queries/redundant-reexports.js +1 -1
  187. package/dist/queries/refs.d.ts +2 -2
  188. package/dist/queries/refs.js +1 -1
  189. package/dist/queries/self-audit.d.ts +2 -2
  190. package/dist/queries/self-audit.js +1 -1
  191. package/dist/queries/similar-chains.d.ts +2 -2
  192. package/dist/queries/similar-chains.js +1 -1
  193. package/dist/queries/similar-files.d.ts +2 -2
  194. package/dist/queries/similar-files.js +1 -1
  195. package/dist/queries/similar-signatures.d.ts +2 -2
  196. package/dist/queries/similar-signatures.js +1 -1
  197. package/dist/queries/similar.d.ts +21 -3
  198. package/dist/queries/similar.js +1 -1
  199. package/dist/queries/slice.d.ts +2 -2
  200. package/dist/queries/slice.js +1 -1
  201. package/dist/queries/stale-abstractions.d.ts +10 -3
  202. package/dist/queries/stale-abstractions.js +1 -1
  203. package/dist/queries/stats.d.ts +2 -2
  204. package/dist/queries/stats.js +1 -1
  205. package/dist/queries/surface.d.ts +2 -2
  206. package/dist/queries/surface.js +1 -1
  207. package/dist/queries/symbols.d.ts +2 -2
  208. package/dist/queries/symbols.js +1 -1
  209. package/dist/queries/system.d.ts +2 -2
  210. package/dist/queries/system.js +1 -1
  211. package/dist/queries/trace.d.ts +2 -2
  212. package/dist/queries/trace.js +1 -1
  213. package/dist/queries/unused-imports.d.ts +4 -0
  214. package/dist/queries/unused-imports.js +2 -0
  215. package/dist/queries/unused-params.d.ts +2 -2
  216. package/dist/queries/unused-params.js +1 -1
  217. package/dist/queries/vue-component-duplicates.d.ts +35 -0
  218. package/dist/queries/vue-component-duplicates.js +2 -0
  219. package/dist/queries/vue-composable-candidates.d.ts +40 -0
  220. package/dist/queries/vue-composable-candidates.js +2 -0
  221. package/dist/queries/vue-large-view-pressure.d.ts +37 -0
  222. package/dist/queries/vue-large-view-pressure.js +2 -0
  223. package/dist/queries/wrapper-candidates.d.ts +6 -3
  224. package/dist/queries/wrapper-candidates.js +1 -1
  225. package/dist/reindex-worker.js +10 -10
  226. package/dist/reindex.d.ts +1 -1
  227. package/dist/reindex.js +22 -22
  228. package/dist/runtime.d.ts +1 -1
  229. package/dist/runtime.js +2 -2
  230. package/docs/AGENT_GUIDE.md +353 -0
  231. package/docs/AI_FAILURE_MODES.md +278 -0
  232. package/docs/API.md +40 -0
  233. package/docs/COMMAND_REFERENCE.md +131 -0
  234. package/docs/DETECTOR_GUIDE.md +119 -0
  235. package/docs/accuracy-hardening-goal.md +54 -0
  236. package/docs/analyzer-inventory.md +162 -0
  237. package/docs/analyzer-validation-ledger.md +262 -0
  238. package/docs/analyzer-validation-protocol.md +192 -0
  239. package/docs/assets/scip-query-logo-dark.svg +21 -0
  240. package/docs/assets/scip-query-logo.svg +24 -0
  241. package/docs/locality-analyzer-design.md +193 -0
  242. package/package.json +44 -5
  243. package/skills/scip-directory-architecture/SKILL.md +178 -0
  244. package/skills/scip-maintainability/SKILL.md +24 -3
  245. package/skills/scip-query/SKILL.md +4 -2
  246. package/skills/scip-query-setup/SKILL.md +118 -0
  247. package/skills/scip-react-maintainability/SKILL.md +114 -0
  248. package/skills/scip-vue-maintainability/SKILL.md +130 -0
  249. package/dist/chunk-4DAPXOWD.js +0 -2
  250. package/dist/chunk-4JQFTUKD.js +0 -2
  251. package/dist/chunk-4MHT7LKP.js +0 -3
  252. package/dist/chunk-5OHZEO3U.js +0 -3
  253. package/dist/chunk-5QJIEYFB.js +0 -34
  254. package/dist/chunk-6IGXZZQ4.js +0 -4
  255. package/dist/chunk-6K2JQ2VI.js +0 -61
  256. package/dist/chunk-6QVCPUK6.js +0 -2
  257. package/dist/chunk-6VL4AIEO.js +0 -8
  258. package/dist/chunk-A2VTV2QB.js +0 -7
  259. package/dist/chunk-AI2ECT7L.js +0 -2
  260. package/dist/chunk-BUAC4Q4G.js +0 -2
  261. package/dist/chunk-BZ6LCGE6.js +0 -2
  262. package/dist/chunk-CMXFASVD.js +0 -2
  263. package/dist/chunk-CO3AL7NZ.js +0 -2
  264. package/dist/chunk-FVVT7GV6.js +0 -4
  265. package/dist/chunk-HXXRN77A.js +0 -2
  266. package/dist/chunk-IC3RC3KJ.js +0 -4
  267. package/dist/chunk-ITHQJZTG.js +0 -2
  268. package/dist/chunk-IW7ASGVF.js +0 -2
  269. package/dist/chunk-JODYQDE4.js +0 -2
  270. package/dist/chunk-MCW36F2D.js +0 -2
  271. package/dist/chunk-MX6F756F.js +0 -2
  272. package/dist/chunk-NGI4V4AB.js +0 -18
  273. package/dist/chunk-O6KCZPJQ.js +0 -62
  274. package/dist/chunk-OAI5GEIN.js +0 -6
  275. package/dist/chunk-OH5HIAID.js +0 -4
  276. package/dist/chunk-OXKEUWMJ.js +0 -2
  277. package/dist/chunk-PBGTMPJ7.js +0 -2
  278. package/dist/chunk-PRVDXGSK.js +0 -2
  279. package/dist/chunk-QYKKTYBN.js +0 -6
  280. package/dist/chunk-R3G6ERW7.js +0 -7
  281. package/dist/chunk-R6XDPWJA.js +0 -10
  282. package/dist/chunk-SJR4SB7B.js +0 -2
  283. package/dist/chunk-SYKCO25G.js +0 -16
  284. package/dist/chunk-T22X7WT6.js +0 -2
  285. package/dist/chunk-TH4JVC34.js +0 -71
  286. package/dist/chunk-VDY4HYNK.js +0 -2
  287. package/dist/chunk-VDZIEDJB.js +0 -2
  288. package/dist/chunk-VDZL45XI.js +0 -2
  289. package/dist/chunk-WJIS6BNI.js +0 -3
  290. package/dist/chunk-WN5Z3UVT.js +0 -7
  291. package/dist/chunk-XCW7DYHM.js +0 -2
  292. package/dist/chunk-ZF6P2NAT.js +0 -63
  293. package/dist/chunk-ZGIK464P.js +0 -2
@@ -1,2 +0,0 @@
1
- import{a as I}from"./chunk-OXKEUWMJ.js";import{a as u}from"./chunk-B32FX5KB.js";import{a as F}from"./chunk-6IGXZZQ4.js";import{a as k}from"./chunk-AQYBOORI.js";import{a as z}from"./chunk-WN5Z3UVT.js";import{a as _}from"./chunk-BUAC4Q4G.js";import{a as M}from"./chunk-VDY4HYNK.js";import{a as B}from"./chunk-MCW36F2D.js";import{b as $}from"./chunk-OAI5GEIN.js";import{a as T}from"./chunk-NGI4V4AB.js";import{a as x,b as R}from"./chunk-6QVCPUK6.js";import{b as A}from"./chunk-JODYQDE4.js";import{b as E,c as P}from"./chunk-R3G6ERW7.js";import{a as L}from"./chunk-772YYL6I.js";import{a as D}from"./chunk-4HTJZC6G.js";import{e as C,f as H}from"./chunk-QYKKTYBN.js";function y(e){let i=K(e),{breakdown:t}=Z(e),r=O(t,"risk"),n=O(t,"hygiene");return{score:Math.min(r,n),riskScore:r,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null},axes:Q(e),validation:X(e),suppressions:e.suppressions,actions:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Q(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:Y(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function Y(e){let i=e.gitEvidence?.fileStats;return i?e.complexity.top.map(t=>{let r=t.file?i[t.file]?.changes??0:0;return{...t,changes:r,weighted:p(t.score*Math.log2(1+r))}}).sort((t,r)=>r.weighted-t.weighted):null}function X(e){let i=e.gitEvidence?.fileStats;if(!i)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[]},r=new Set(Object.values(t).flat()),n=0,o=0,a=0;for(let[f,d]of Object.entries(i))r.has(f)?n+=d.fixChanges:(o+=d.fixChanges,a+=1);let m=r.size>0?p(n/r.size):0,l=a>0?p(o/a):0,g={};for(let[f,d]of Object.entries(t)){let h=new Set(d);if(h.size===0)continue;let b=0;for(let q of h)b+=i[q]?.fixChanges??0;let w=p(b/h.size);g[f]={flaggedFiles:h.size,fixDensity:w,lift:l>0?p(w/l):null}}return{flaggedFiles:r.size,flaggedFixDensity:m,baselineFixDensity:l,ratio:r.size>0&&l>0?p(m/l):null,byCategory:g}}function p(e){return Math.round(e*100)/100}function K(e){let i=[];if(e.dead.count>0&&i.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&i.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&i.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&i.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.extractCount>0&&i.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&i.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&i.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let n=[];e.stale.unused>0&&n.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&n.push(`${e.stale.singleUse} single-consumer (not in types file)`),i.push({category:"Stale abstractions",evidence:"heuristic",description:`${n.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let n=[];e.drift.unusedImports>0&&n.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&n.push(`${e.drift.layerViolations} layer violations`),i.push({category:"Structural drift",evidence:"heuristic",description:n.join(", "),effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let n=e.gitEvidence.hiddenCoupling.top[0];i.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a dependency edge`+(n?` (e.g. ${n.fileA} \u2194 ${n.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},r={low:3,medium:2,high:1};return i.sort((n,o)=>{let a=t[n.impact]*r[n.effort];return t[o.impact]*r[o.effort]-a}),i}var J={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk",similar:"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene"};function O(e,i){let t=e.filter(r=>r.kind===i).reduce((r,n)=>r+n.points,0);return Math.max(0,Math.min(100,100-t))}function Z(e){let i=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),r=[],n=(d,h,b)=>{h>0&&r.push({axis:d,points:h,detail:b,kind:J[d]??"hygiene"})},o=e.dead.count/t;n("dead-code",Math.min(20,Math.round(o*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let a=e.isolated.count/t;n("isolated",Math.min(10,Math.round(a*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let m=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(m)),`${e.similarCount} similar function pair(s)`);let l=e.extractCount/t*1e3;n("extract",Math.min(5,Math.round(l/2)),`${e.extractCount} extraction candidate(s)`),n("wrappers",Math.min(3,e.wrappers.count),`${e.wrappers.count} wrapper candidate(s)`),n("passthroughs",Math.min(3,e.passthroughs.count),`${e.passthroughs.count} passthrough candidate(s)`);let g=e.stale.count/Math.max(t*.1,1);n("stale-abstractions",Math.min(8,Math.round(g*10)),`${e.stale.count} stale abstraction(s)`);let f=e.drift.count/i;return n("drift",Math.min(5,Math.round(f*50)),`${e.drift.count} drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence&&n("hidden-coupling",Math.min(5,e.gitEvidence.hiddenCoupling.pairCount),`${e.gitEvidence.hiddenCoupling.pairCount} co-changing pair(s) without a dependency edge`),{breakdown:r}}import{getHeapStatistics as ee}from"v8";var te=64*1024*1024;function S(){let e=globalThis.gc;if(!e)return;let i=ee();i.heap_size_limit-i.used_heap_size<te||e()}var ie=50,re=75e3,ne=5e3,V=2500,oe=["overview","dead","isolated","cycles","similar","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions"],N={overview:(e,i,t,r)=>({phase:"overview",statsResult:r,warnings:t.warnings}),dead:(e,i,t)=>({phase:"dead",dead:se(e,i,t)}),isolated:(e,i,t)=>({phase:"isolated",isolated:ce(e,i,t)}),cycles:(e,i,t)=>({phase:"cycles",realCycleCount:ue(e,i,t)}),similar:(e,i,t)=>({phase:"similar",similarCount:le(e,i,t)}),"extract-candidates":(e,i,t)=>({phase:"extract-candidates",extractCount:de(e,i,t)}),"wrapper-candidates":(e,i,t)=>({phase:"wrapper-candidates",wrappers:he(e,i,t)}),"passthrough-candidates":(e,i,t)=>({phase:"passthrough-candidates",passthroughs:pe(e,i,t)}),"stale-abstractions":(e,i,t)=>({phase:"stale-abstractions",stale:me(e,i,t)}),drift:(e,i,t)=>({phase:"drift",drift:be(e,i,t)}),"complexity-hotspots":(e,i,t)=>({phase:"complexity-hotspots",complexity:Ce(e,i,t)}),"git-evidence":(e,i,t)=>({phase:"git-evidence",gitEvidence:fe(e,t)}),suppressions:(e,i,t)=>({phase:"suppressions",suppressions:ge(e,t)})};function Ue(e,i={}){return G(e,i.full===!0,(t,r)=>{let n=ae(e,i.scope,t,r);return y(n)})}function qe(e,i,t={}){return G(e,t.full===!0,(r,n)=>N[i](e,t.scope,n,r))}function G(e,i,t){let r=k(e),n=He(r,i);try{return t(r,n)}finally{x(e,{semanticProvider:!0}),S()}}function Qe(e){return y(W(e))}function W(e){let i=s(e,"overview");return{statsResult:i.statsResult,warnings:i.warnings,dead:s(e,"dead").dead,isolated:s(e,"isolated").isolated,realCycleCount:s(e,"cycles").realCycleCount,similarCount:s(e,"similar").similarCount,extractCount:s(e,"extract-candidates").extractCount,wrappers:s(e,"wrapper-candidates").wrappers,passthroughs:s(e,"passthrough-candidates").passthroughs,stale:s(e,"stale-abstractions").stale,drift:s(e,"drift").drift,complexity:s(e,"complexity-hotspots").complexity,gitEvidence:j(e,"git-evidence")?.gitEvidence??null,suppressions:j(e,"suppressions")?.suppressions??null}}function j(e,i){return e.find(t=>t.phase===i)}function s(e,i){let t=e.find(r=>r.phase===i);if(!t)throw new Error(`Missing health phase result: ${i}`);return t}function ae(e,i,t,r){return W(oe.map(n=>N[n](e,i,r,t)))}function se(e,i,t){return c(e,t,"dead",()=>{let r=R(e,{scope:i,...u.dead,scanLimit:t.candidateScanLimit});return v(Se(e,r.symbols))})}function ce(e,i,t){return c(e,t,"isolated",()=>{let r=_(e,{scope:i,...u.isolated,scanLimit:t.candidateScanLimit});return v(ve(e,r))})}function ue(e,i,t){return c(e,t,"cycles",()=>D(e,{scope:i}).filter(n=>n.kind==="real").length)}function le(e,i,t){return c(e,t,"similar",()=>$(e,{scope:i,...u.similar,scanLimit:t.candidateScanLimit}).length)}function de(e,i,t){return c(e,t,"extract-candidates",()=>B(e,{scope:i,...u.extract,scanLimit:t.candidateScanLimit}).length)}function he(e,i,t){return U(e,t,"wrapper-candidates",()=>z(e,{scope:i,...u.wrappers,scanLimit:t.candidateScanLimit}))}function pe(e,i,t){return U(e,t,"passthrough-candidates",()=>M(e,{scope:i,...u.passthroughs,scanLimit:t.candidateScanLimit}))}function me(e,i,t){return c(e,t,"stale-abstractions",()=>{let r=F(e,{scope:i,...u.stale,scanLimit:t.candidateScanLimit}),n=r.filter(o=>o.consumers===0).length;return{count:r.length,loc:r.reduce((o,a)=>o+a.loc,0),files:[...new Set(r.map(o=>o.file))],unused:n,singleUse:r.length-n}})}function fe(e,i){return c(e,i,"git-evidence",()=>{let t=E(e);if(!t)return null;let r=A(e,void 0,{limit:50}),n={};for(let[o,a]of t)n[o]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:P(e),hiddenCoupling:{pairCount:r.findings.length,top:r.findings.slice(0,5).map(o=>({fileA:o.fileA,fileB:o.fileB,together:o.together,confidence:o.confidence}))},fileStats:n}})}function ge(e,i){return c(e,i,"suppressions",()=>{let t=I(e);return{total:t.total,byCategory:{...t.byCategory}}})}function be(e,i,t){return c(e,t,"drift",()=>{let r=T(e,{scope:i,...u.drift});return{count:r.unusedImports+r.layerViolations,unusedImports:r.unusedImports,layerViolations:r.layerViolations}})}function Ce(e,i,t){return c(e,t,"complexity-hotspots",()=>{let r=L(e,{scope:i,minLoc:10,limit:10,scanLimit:t.candidateScanLimit,semantic:!1});return{top:r.slice(0,5).map(n=>({symbol:n.shortName,score:n.score,file:n.file})),extremeCount:r.filter(n=>n.score>ie).length}})}function He(e,i){return e.symbols>=re||e.documents>=ne?i?{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:["Large index detected; running unbounded health analyses because --full was supplied."]}:{candidateScanLimit:V,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${V} symbols. Run "scip-query health --full" for unbounded candidate counts.`]}:{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:[]}}function xe(e,i){i.releaseCachesBetweenPhases&&(x(e),S())}function c(e,i,t,r){ye(t);try{return r()}finally{xe(e,i)}}function U(e,i,t,r){return c(e,i,t,()=>v(r()))}function ye(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function Se(e,i){return i.filter(t=>!C(e,t.relativePath)&&!H(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function ve(e,i){return i.filter(t=>!C(e,t.relativePath)&&!H(e,t.symbol,t.relativePath))}function v(e){let i=new Set;for(let t of e){let r=t.relativePath??t.file;r&&i.add(r)}return{count:e.length,loc:e.reduce((t,r)=>t+r.loc,0),files:[...i]}}export{oe as a,Ue as b,qe as c,Qe as d};
2
- //# sourceMappingURL=chunk-AI2ECT7L.js.map
@@ -1,2 +0,0 @@
1
- import{a as o,c as p}from"./chunk-MX6F756F.js";import{a as y}from"./chunk-IW7ASGVF.js";import{c as b}from"./chunk-O6KCZPJQ.js";function P(u,c={}){let{scope:f,minLoc:L=3,scanLimit:l}=c,s=new y(u),r=c.semantic!==!1,t=p(s.productionCallableDefinitions({scope:f,minLoc:L,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,sortByLocDesc:typeof l=="number"&&l>0}),l),h=s.crossFileCallerMap(t,{semantic:r}),a=new Set(h.keys());for(let e of s.frameworkReferencedSymbolIds(t))a.add(e);let n=s.symbolsWithNonSelfCallees(t,{additive:!1,semantic:r}),m=t.filter(e=>!a.has(e.symbolId)).filter(e=>!n.has(e.symbolId)),I=s.sourceFallbackCallerFiles(m);for(let e of I.keys())a.add(e);let d=m.filter(e=>!a.has(e.symbolId)),C=s.symbolsWithNonSelfCallees(d,{additive:!0,semantic:r});for(let e of C)n.add(e);return d.filter(e=>!n.has(e.symbolId)).sort((e,i)=>o(i)-o(e)||e.relativePath.localeCompare(i.relativePath)||e.startLine-i.startLine).map(e=>({symbol:e.symbol,shortName:b(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o(e)}))}export{P as a};
2
- //# sourceMappingURL=chunk-BUAC4Q4G.js.map
@@ -1,2 +0,0 @@
1
- import{b}from"./chunk-OAI5GEIN.js";import{e as d}from"./chunk-R3G6ERW7.js";function C(m,r={}){let{windowCommits:a=100,minSimilarity:u=.7,limit:c=30,scope:g,scanLimit:f}=r,o=d(m);if(!o)return{available:!1,windowCommits:a,findings:[]};let A=b(m,{scope:g,minSimilarity:u,limit:c*5,crossFileOnly:!0,scanLimit:f,semantic:r.semantic}),n=[];for(let e of A){let i=o.get(e.fileA)?.commitsAgo??null,t=o.get(e.fileB)?.commitsAgo??null,s=i!==null&&i<=a,h=t!==null&&t<=a;if(!(!s&&!h)){if(s&&h){let l=(i??0)<=(t??0);n.push({kind:"twin",echoSymbol:l?e.shortNameA:e.shortNameB,echoFile:l?e.fileA:e.fileB,echoAgeCommits:(l?i:t)??0,establishedSymbol:l?e.shortNameB:e.shortNameA,establishedFile:l?e.fileB:e.fileA,establishedAgeCommits:l?t:i,similarity:e.similarity,sharedCallees:e.sharedCallees})}else n.push({kind:"echo",echoSymbol:s?e.shortNameA:e.shortNameB,echoFile:s?e.fileA:e.fileB,echoAgeCommits:(s?i:t)??0,establishedSymbol:s?e.shortNameB:e.shortNameA,establishedFile:s?e.fileB:e.fileA,establishedAgeCommits:s?t:i,similarity:e.similarity,sharedCallees:e.sharedCallees});if(n.length>=c)break}}return n.sort((e,i)=>(e.kind===i.kind?0:e.kind==="echo"?-1:1)||i.similarity-e.similarity),{available:!0,windowCommits:a,findings:n}}export{C as a};
2
- //# sourceMappingURL=chunk-BZ6LCGE6.js.map
@@ -1,2 +0,0 @@
1
- import{b}from"./chunk-ZOT3WUZW.js";import{l as d,u as f}from"./chunk-O6KCZPJQ.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
- //# sourceMappingURL=chunk-CMXFASVD.js.map
@@ -1,2 +0,0 @@
1
- import{c as b}from"./chunk-MX6F756F.js";import{a as u}from"./chunk-IW7ASGVF.js";import{a as f}from"./chunk-VDZIEDJB.js";import{a as c}from"./chunk-5QJIEYFB.js";import{c as l}from"./chunk-O6KCZPJQ.js";function R(o,e={}){let{limit:r=20,scope:s,minFanIn:i=2,minFanOut:n=2,scanLimit:m}=e,p=new u(o);return b(p.productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof m=="number"&&m>0}),m).map(t=>y(o,t,e.semantic!==!1)).filter(t=>t.fanIn>=i&&t.fanOut>=n).sort((t,a)=>a.score-t.score||a.fanIn-t.fanIn).slice(0,r)}function y(o,e,r){let s=new Set(f(o,e,{limit:500,semantic:r}).map(n=>n.file)).size,i=new Set(c(o,e,{limit:500,semantic:r}).filter(n=>n.file!==e.relativePath).map(n=>`${n.symbol}|${n.file}`)).size;return{symbol:e.symbol,shortName:l(e.symbol),fanIn:s,fanOut:i,score:s*i,definedIn:e.relativePath}}export{R as a};
2
- //# sourceMappingURL=chunk-CO3AL7NZ.js.map
@@ -1,4 +0,0 @@
1
- import{a as te,b as re,c as b,d as se,e as ne,f as oe,g as j,h as ie,i as U,j as ae,k as pe,l as E,m as W,n as T,o as V,p as z,q as S,r as Q,s as J,u as R,v as h,w as M,x as G}from"./chunk-WEJYUS5O.js";import{a as v,c as ce,d as me,e as C}from"./chunk-OH5HIAID.js";import{c as L}from"./chunk-VDZL45XI.js";import{basename as le}from"path";var Oe=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(t){let r=[],e=0,s=0;for(let n=0;n<t.length;n++){let o=t[n];(o==="{"||o==="["||o==="(")&&e++,(o==="}"||o==="]"||o===")")&&e--,o===","&&e===0&&(r.push(t.slice(s,n)),s=n+1)}return r.push(t.slice(s)),r}function y(t,r){for(let e of t.namedChildren)if(e.type===r)return e;return null}function g(t,r){let e=new Set,s=(n,o)=>{let i=o||r.has(n.type);!i&&Oe.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function P(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,pe(r)),kind:"named",used:h(e,o),usedMembers:[]}}function f(t,r,e,s,n="named",o={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function $(t,r,e,s,n="named",o=[],i={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s,usedMembers:o,isTypeOnly:i.isTypeOnly}}function D(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function O(t,r,e={}){return{importedName:t,localName:e.localName??null,sourcePath:r,kind:"namespace",used:e.used??!0,usedMembers:e.usedMembers??[],isTypeOnly:e.isTypeOnly}}function N(t,r,e){let s=[];for(let n of t.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=R(t,n.index,n.index+o.length);for(let a of e(n,i))s.push(a)}return s}function I(t,r,e,s){let n=C(t,r);if(n){let o=e(n);if(o)return o}return s()}function X(t,r,e,s){let n=C(t,r),o=ce(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function ue(t,r,e){return I(t,r,s=>Ae(t,r,s),()=>ke(t,r,e))}function ke(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=le(o).replace(/\.[^.]+$/,"");return[$(o,i,z(t,r,o),h(n,i))]})}function Ae(t,r,e){let s=g(e,new Set(["preproc_include"])),n=[];for(let o of e.rootNode.descendantsOfType("preproc_include")){let i=null;for(let p of o.namedChildren){if(p.type==="system_lib_string"){i=p.text.replace(/^<|>$/g,"");break}if(p.type==="string_literal"){i=p.namedChildren.find(c=>c.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=le(i).replace(/\.[^.]+$/,"");n.push(f(i,a,z(t,r,i),s))}return n}function de(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=n[1]?.trim(),i=n[2]?.trim()??null,a=n[0];if(!o||!a||typeof n.index!="number")continue;let p=R(e,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:Q(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function fe(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:Q(t,r,o)})}return s}function ge(t,r,e){return X(t,r,{csharp:s=>Le(t,r,s),vb:s=>we(t,r,s)},()=>{let s=ae(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(e,s,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let[a,p]=i.split(/\s*=\s*/),m=!!p,c=(m?p:a)?.trim()??i,l=c.split(".").pop()??c,u=m?a?.trim()??l:l;return[P(t,r,o,c,l,u,S(t,c,j))]})})}function we(t,r,e){let s=g(e,new Set(["imports_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(u=>u.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],p=i.length>1?i[0]:null,m=a.text,c=m.split(".").pop()??m,l=p?.text??c;n.push(f(c,l,S(t,m,j),s,p?"namespace":"named"))}return n}function Le(t,r,e){let s=g(e,new Set(["using_directive"])),n=[];for(let o of e.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,p;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],p=i[1]):p=i[i.length-1];let m=p.text,c=m.split(".").pop()??m,l=a?.text??c;n.push(f(c,l,S(t,m,j),s,a?"namespace":"named"))}return n}var je=L("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Se(t,r){return je.get(t,r,()=>{let e=new Set,s=v(t,r);if(!s)return e;let o=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))e.add(i[0]);return e})}function Y(t,r,e){return I(t,r,s=>Me(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return ze(e).flatMap(s=>Qe(t,r,s.clause,s.specifier,s.start,s.end,e))}function Me(t,r,e){let s=$e(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...qe(t,r,e,o,s));return n}function $e(t,r,e){let s=g(e,new Set(["import_statement"]));if(me(r))for(let n of Se(t,r))s.add(n);return s}function qe(t,r,e,s,n){let o=Xe(s);if(!o)return[];let i=E(t,r,o),a=y(s,"import_clause");return a?Ue(e,a,i,n,Be(s.text)):[D("*",i)]}function Ue(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(We(i.text,e,s,n));else if(i.type==="namespace_import"){let a=Fe(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Je(i,e,s,n));return o}function We(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function Fe(t,r,e,s,n){let i=y(r,"identifier")?.text??"";if(!i)return null;let a=Ve(t,i);return O("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Je(t,r,e,s){let n=[];for(let o of t.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let p=i.text,m=a?.text??p;n.push(f(p,m,r,e,"named",{isTypeOnly:s||He(o.text)}))}return n}function Xe(t){let r=y(t,"string");if(!r)return null;let e=y(r,"string_fragment");return e?e.text:null}function Be(t){return/^\s*import\s+type\b/.test(t)}function He(t){return/^\s*type\b/.test(t.trim())}function Ve(t,r){let e=new Set;for(let s of t.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),o=s.namedChild(1);!n||!o||n.type!=="identifier"||n.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&e.add(o.text)}return[...e]}function ze(t){let r=[],e=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(e)){let o=n[0],i=n[1],a=n[2];!o||!a||typeof n.index!="number"||r.push({clause:i,specifier:a,start:n.index,end:n.index+o.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(s)){let o=n[0],i=n[1];!o||!i||typeof n.index!="number"||r.push({clause:null,specifier:i,start:n.index,end:n.index+o.length})}return r.sort((n,o)=>n.start-o.start)}function Qe(t,r,e,s,n,o,i){let a=E(t,r,s),p=R(i,n,o);return e?Ge(e).map(c=>({...c,sourcePath:a})).map(c=>{if(c.kind==="namespace"){let l=M(p,c.localName);return O(c.importedName,c.sourcePath,{localName:c.localName,usedMembers:l,used:l.length>0||h(p,c.localName),isTypeOnly:c.isTypeOnly})}return c.kind==="side-effect"?D(c.importedName,c.sourcePath):$(c.importedName,c.localName??"",c.sourcePath,c.localName?h(p,c.localName):!1,c.kind,[],{isTypeOnly:c.isTypeOnly})}):[D("*",a)]}function Ge(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=Ye(s),i=[];return n&&i.push(...he(n,e)),o&&i.push(...he(o,e)),i}function he(t,r){let e=t.trim();if(!e)return[];if(e.startsWith("{")){let s=e.slice(1,-1).trim();return s?x(s).map(n=>{let o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[p,m]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(m??p).trim(),kind:"named",isTypeOnly:i}}):[]}return e.startsWith("* as ")?[{importedName:"*",localName:e.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:e,kind:"default",isTypeOnly:r}]}function Ye(t){let r=0;for(let e=0;e<t.length;e++){let s=t[e];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[t.slice(0,e).trim(),t.slice(e+1).trim()]}return[t.trim(),null]}function K(t,r,e){let s=C(t,r);return s?st(t,r,s):Ke(t,r,e)}function Ke(t,r,e){return[...Ze(t,r,e),...et(t,r,e),...tt(t,r,e)]}function Ze(t,r,e){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",p=x(i).map(l=>rt(l.trim())).filter(l=>!!l),m=q(e,o.index),c=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:E(t,r,a),names:p,startLine:m,endLine:c})}return s}function et(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function tt(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function rt(t){if(!t)return null;let r=t.replace(/^type\s+/,"").trim();if(!r)return null;let e=r.match(/^(\w+)\s+as\s+(\w+)$/);if(e)return e[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function q(t,r){let e=0;for(let s=0;s<r&&s<t.length;s++)t.charCodeAt(s)===10&&e++;return e}function st(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=nt(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=ot(n,o,i,a);s.push(p)}return s}function nt(t,r,e){let s=y(e,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return E(t,r,n.text)}function ot(t,r,e,s){let n=y(t,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let p=a.namedChild(0),m=a.namedChild(1);p&&i.push((m??p).text)}return{kind:"named",sourcePath:r,names:i,startLine:e,endLine:s}}return y(t,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:e,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:e,endLine:s}}function xe(t,r,e){return X(t,r,{java:s=>it(t,r,s),kotlin:s=>at(t,r,s),scala:s=>pt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?ct(t,r,o,n):[]}))}function it(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(l=>l.type==="asterisk"),p=o.namedChildren.find(l=>l.type==="scoped_identifier")??o.namedChildren.find(l=>l.type==="identifier");if(!p)continue;let m=p.text;if(i){n.push(O("*",S(t,m,b)));continue}let c=m.split(".").pop()??m;n.push(f(c,c,S(t,m,b),s))}return n}function at(t,r,e){let s=g(e,new Set(["import_header","import_list"])),n=[];for(let o of e.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),p=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push(O("*",S(t,i.text,b)));continue}let m=i.text,c=m.split(".").pop()??m,u=p?.namedChild(0)?.text??c;n.push(f(c,u,S(t,m,b),s))}return n}function pt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(l=>l.type==="namespace_selectors"||l.type==="namespace_wildcard"),a=o.namedChildren.filter(l=>l!==i&&(l.type==="identifier"||l.type==="stable_identifier")),p=a.map(l=>l.text).join(".");if(!p)continue;if(i?.type==="namespace_wildcard"){n.push(O("*",S(t,p,b)));continue}if(i?.type==="namespace_selectors"){for(let l of i.namedChildren)if(l.type==="arrow_renamed_identifier"){let[u,d]=l.namedChildren;if(!u)continue;let _=u.text,A=d?.text??_;if(_==="_")continue;n.push(f(_,A,S(t,`${p}.${_}`,b),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,b),s))}continue}let m=a[a.length-1]?.text??p,c=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(m,m,S(t,c&&a.length>1?`${c}.${m}`:p,b),s))}return n}function ct(t,r,e,s){if(e.includes("{")&&e.includes("}")){let n=e.slice(0,e.indexOf("{")).replace(/\.$/,"").trim(),o=e.slice(e.indexOf("{")+1,e.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),c=p?.trim();if(!c||c==="_")return[];let l=(m??c.split(".").pop()??c).trim(),u=c==="_"?n:`${n}.${c}`.replace(/\.\./g,".");return[P(t,r,s,u,c,l)]})}return[P(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function Ne(t,r,e){return I(t,r,s=>mt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.split(/\s+as\s+/i),c=p?.trim()??a,l=c.split("\\").pop()??c,u=(m??l).trim();return[P(t,r,n,c,l,u,S(t,c.replace(/\\/g,"."),U))]}):[]}))}function mt(t,r,e){let s=g(e,new Set(["namespace_use_declaration"])),n=[],o=(i,a,p)=>{n.push(f(a,p,S(t,i.replace(/\\/g,"."),U),s))};for(let i of e.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(p=>p.type==="namespace_use_group");if(a){let p=i.namedChildren.find(m=>m.type==="namespace_name")?.text??"";for(let m of a.namedChildren){if(m.type!=="namespace_use_clause")continue;let{importedName:c,localName:l,qualified:u}=ye(m,p);c&&o(u,c,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:m,localName:c,qualified:l}=ye(p,"");m&&o(l,m,c)}}return n}function ye(t,r){let e=t.namedChildren.find(m=>m.type==="qualified_name"),s=t.namedChildren.filter(m=>m.type==="name"),n="";e?n=e.text:s.length>=1&&(n=s[0].text);let o=e&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,p=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:p}}function be(t,r,e){return I(t,r,s=>lt(t,r,s),()=>dt(e).flatMap(s=>gt(t,r,s,e)))}function lt(t,r,e){let s=g(e,new Set(["import_statement","import_from_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Ie(i);if(!a)continue;let p=W(t,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:p,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of e.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ut(i);if(a===null)continue;let p=W(t,r,a);for(let m=1;m<o.namedChildCount;m+=1){let c=o.namedChild(m);if(c.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=Ie(c);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Ie(t){if(t.type==="aliased_import"){let r=t.namedChild(0),e=t.namedChild(1);return!r||!e?null:{qualifiedName:r.text,localName:e.text}}if(t.type==="dotted_name"){let r=t.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return t.type==="identifier"?{qualifiedName:t.text,localName:t.text}:null}function ut(t){if(t.type==="dotted_name")return t.text;if(t.type==="relative_import"){let r=y(t,"import_prefix")?.text??"",e=y(t,"dotted_name")?.text??"";return`${r}${e}`}return null}function dt(t){let r=t.split(`
2
- `),e=[],s=0;for(let n=0;n<r.length;n++){let o=r[n],i=o.trimStart(),a=s;if(s+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let p=o,m=a+o.length,c=G(o);for(;n+1<r.length&&(c>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
3
- ${u}`,m+=1+u.length,c+=G(u),s+=u.length+1}let l=ft(p);l&&e.push({...l,start:a,end:m})}return e}function ft(t){let r=t.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let e=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!e)return null;let s=e[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:e[1],clause:s}}function gt(t,r,e,s){let n=R(s,e.start,e.end),o=e.clause.replace(/\n/g," ").trim();if(e.kind==="import")return x(o).flatMap(p=>{let m=p.trim().replace(/,$/,"");if(!m)return[];let[c,l]=m.split(/\s+as\s+/),u=c.trim(),d=(l??u.split(".")[0]??u).trim(),_=W(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:_,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?W(t,r,e.module):null,a=[];for(let p of x(o)){let m=p.trim().replace(/,$/,"");if(!m)continue;if(m==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[c,l]=m.split(/\s+as\s+/),u=(l??c).trim();a.push({importedName:c.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as St}from"path";function Pe(t,r,e){return I(t,r,s=>xt(t,r,s),()=>ht(t,r,e))}function ht(t,r,e){return N(e,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(s,n)=>{let o=s[1],i=s[2];if(!o||!i)return[];let a=o==="require_relative"?V(t,r,i):null;if(a){let p=_e(i);return[$(p,p,a,h(n,p))]}return[D(i,a)]})}function xt(t,r,e){let s=g(e,new Set([])),n=[],o=new Set(["require","require_relative","load"]);for(let i of e.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let m=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!m||m.type!=="string")continue;let l=m.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?V(t,r,l):null;if(u){let d=_e(l);n.push(f(d,d,u,s))}else n.push(D(l,u))}return n}function _e(t){return St(t).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function Ee(t,r,e){return I(t,r,s=>yt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?Nt(t,r,o,n):[]}))}function yt(t,r,e){let s=g(e,new Set(["use_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of F(i,"")){if(!a.importedName||a.importedName==="*")continue;let p=T(t,r,a.qualifiedName)??T(t,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push(f(a.importedName,a.localName,p,s))}}return n}function F(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:B(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:B(r,e),importedName:s,localName:s}]}case"scoped_use_list":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=B(r,e.text),o=[];for(let i of s.namedChildren)o.push(...F(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...F(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=F(e,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let e=t.namedChild(0),s=e?e.text:"";return[{qualifiedName:B(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function B(t,r){return t?r?`${t}::${r}`:t:r}function Nt(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let c=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),l=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(l).flatMap(u=>{let d=u.trim();if(!d||d==="self")return[];let[_,A]=d.split(/\s+as\s+/),w=_?.trim();if(!w)return[];let Ce=(A??w.split("::").pop()??w).trim(),De=`${c}::${w}`.replace(/::::/g,"::");return[P(t,r,s,De,w.split("::").pop()??w,Ce,T(t,r,c))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),m=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[P(t,r,s,a,a.split("::").pop()??a,p,m)]}function Te(t,r,e){let s=C(t,r);if(s)return It(t,r,s);let n=[];for(let o of e.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(...Pt(t,r,i))}return n}function It(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!bt(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of F(o,""))i.importedName&&s.push(Z(t,r,i.qualifiedName))}return s}function bt(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Pt(t,r,e){let s=e.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),o=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[p]=a.split(/\s+as\s+/),m=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[Z(t,r,m)]})}return[Z(t,r,s)]}function Z(t,r,e){return{specifier:e,sourcePath:T(t,r,e)??T(t,r,e.split("::").slice(0,-1).join("::"))}}function k({language:t,extensions:r,imports:e,parseImports:s}){return{language:t,extensions:r,capabilities:{imports:e},parseImports:s}}function Re(t,r){let e=r.toLowerCase();for(let s of t)for(let n of s.extensions)if(e.endsWith(n))return s;return null}var _t={language:"javascript",extensions:te,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Y,parseReExports:K},Et=k({language:"python",extensions:re,imports:"ast-with-regex-fallback",parseImports:be}),Tt=k({language:"jvm",extensions:b,imports:"ast-dispatch-with-regex-fallback",parseImports:xe}),Rt={language:"rust",extensions:se,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Ee,parseExports:Te},Ct=k({language:"ruby",extensions:ne,imports:"ast-with-regex-fallback",parseImports:Pe}),Dt=k({language:"c/cpp",extensions:oe,imports:"ast-with-regex-fallback",parseImports:ue}),Ot=k({language:"dotnet",extensions:j,imports:"ast-dispatch-with-regex-fallback",parseImports:ge}),kt={language:"dart",extensions:ie,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:de,parseExports:fe},At=k({language:"php",extensions:U,imports:"ast-with-regex-fallback",parseImports:Ne}),wt=[_t,Et,Tt,Rt,Ct,Dt,Ot,kt,At];function H(t){return Re(wt,t)}var ee={clearGroups:["whole-project","source-file"]},Lt=L("source-imports",ee),jt=L("source-exports",ee),vt=L("source-reexports",ee);function Yr(t,r){let e=J(r);return vt.get(t,e,()=>{let s=H(e);if(!s?.parseReExports)return[];let n=v(t,e);return n?s.parseReExports(t,e,n):[]})}function Kr(t,r){let e=J(r);return Lt.get(t,e,()=>{let s=H(e);if(!s)return[];let n=v(t,e);return n?s.parseImports(t,e,n):[]})}function Zr(t,r){let e=J(r);return jt.get(t,e,()=>{let s=H(e);if(!s?.parseExports)return[];let n=v(t,e);return n?s.parseExports(t,e,n):[]})}export{Yr as a,Kr as b,Zr as c};
4
- //# sourceMappingURL=chunk-FVVT7GV6.js.map
@@ -1,2 +0,0 @@
1
- import{a as j,d as v}from"./chunk-R3G6ERW7.js";import{b as k,c as A,d as w}from"./chunk-ISCKLDSS.js";import{existsSync as F,readFileSync as U}from"fs";import{join as C}from"path";var S=/\.(?:md|mdx|rst|txt)$/i;function _(e){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(e)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(e)}var H=3,L=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function B(e,t={}){let{doc:s,limit:f=20,minCoupling:a=H}=t,n=j(e);if(!n)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=v(e)??new Set,d=new Map,g=new Map,p=new Set;for(let o of n.commits){let h=[...new Set(o.files)],m=h.filter(r=>S.test(r)),y=h.filter(r=>!S.test(r));for(let r of h){p.add(r);let l=d.get(r)??[];l.push(o.timestamp),d.set(r,l)}for(let r of m){let l=g.get(r);l||(l=new Map,g.set(r,l));for(let i of y)l.set(i,(l.get(i)??0)+1)}}let R=[...c].filter(o=>S.test(o)),z=M(c),D=[];for(let o of R){if(s!==void 0&&!o.includes(s)||s===void 0&&!E(e,o)||s!==void 0&&!F(C(e.config.projectRoot,o)))continue;let h=Math.max(0,...d.get(o)??[]),m=new Map,{resolved:y,broken:r}=N(e,o,c,z,p);for(let i of y){if(i===o||S.test(i))continue;let u=(d.get(i)??[]).filter(b=>b>h).length;u!==0&&m.set(i,{file:i,evidence:"reference",coChanges:0,changesSinceDocUpdate:u})}for(let[i,u]of g.get(o)??[]){if(u<a||!c.has(i))continue;let b=(d.get(i)??[]).filter(T=>T>h).length;if(b===0)continue;let x=m.get(i);x?(x.evidence="both",x.coChanges=u):m.set(i,{file:i,evidence:"co-change",coChanges:u,changesSinceDocUpdate:b})}if(m.size===0&&r.length===0)continue;let l=[...m.values()].sort((i,u)=>u.changesSinceDocUpdate-i.changesSinceDocUpdate);D.push({doc:o,docLastChangedAt:h,staleness:l.reduce((i,u)=>i+u.changesSinceDocUpdate,0)+r.length*10,subjects:l.slice(0,8),brokenReferences:r})}return D.sort((o,h)=>h.staleness-o.staleness),{available:!0,commitsAnalyzed:n.commits.length,docsScanned:R.length,findings:D.slice(0,f)}}function J(e,t){let s=v(e)??new Set,f=M(s),a=[];for(let n of s){if(!E(e,n))continue;let{resolved:c}=N(e,n,s,f,new Set),d=[...c].filter(g=>t.has(g));d.length>0&&a.push({doc:n,cited:d.sort()})}return a}function E(e,t){return S.test(t)&&!_(t)&&F(C(e.config.projectRoot,t))}function M(e){let t=new Map;for(let s of e){let f=s.split("/");for(let a of[2,3]){if(f.length<a)continue;let n=f.slice(-a).join("/"),c=t.get(n)??[];c.push(s),t.set(n,c)}}return t}function N(e,t,s,f,a){let n=new Set,c=new Set,d=I(e,t);if(!d)return{resolved:n,broken:[]};for(let g of d){if(s.has(g)){n.add(g);continue}let p=f.get(g);if(p&&p.length===1){n.add(p[0]);continue}p&&p.length>1||a.has(g)&&c.add(g)}return{resolved:n,broken:[...c]}}function I(e,t){let s;try{s=U(C(e.config.projectRoot,t),"utf-8")}catch{return null}let f=k(e,t,s),a=A(e,"doc-path-tokens",t,f);if(a!==null)try{return JSON.parse(a)}catch{}let n=[...new Set([...s.matchAll(L)].map(c=>c[0].replace(/^\.?\//,"")))];return w(e,"doc-path-tokens",t,f,JSON.stringify(n)),n}export{_ as a,B as b,J as c};
2
- //# sourceMappingURL=chunk-HXXRN77A.js.map
@@ -1,4 +0,0 @@
1
- import{o as f}from"./chunk-VGBSY6N7.js";import{a as d}from"./chunk-4MHT7LKP.js";import{c as s,g as u,o as m,p as g}from"./chunk-O6KCZPJQ.js";import{a as c}from"./chunk-OH5HIAID.js";function E(e,r,i={}){let n=d(e,r);if(!n)return{definitions:[],referencedBy:[]};let t=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),a=g(t?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:y(a,t?.display_name??null,n.symbol),source:S(e,n.relativePath,n.startLine,n.endLine)}],b=f(e,n,{semantic:i.semantic}).map(l=>({relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?s(l.enclosingSymbol):"(top-level)"}));return{definitions:o,referencedBy:b}}function S(e,r,i,n){let t=c(e,r);if(!t)return null;let o=t.split(`
2
- `).slice(i,n+1).join(`
3
- `).trimEnd();return o.length>0?o:null}function y(e,r,i){let n=m(e);if(n&&!p(n))return n;let t=(r??"").trim();return t?u(i)&&!t.endsWith("()")?`${t}()`:t:s(i)}function p(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{E as a};
4
- //# sourceMappingURL=chunk-IC3RC3KJ.js.map
@@ -1,2 +0,0 @@
1
- import{b as r}from"./chunk-ZOT3WUZW.js";import{u as e}from"./chunk-O6KCZPJQ.js";function l(t,s){let o=r(t,s);return e(t,o).map(({relativePath:n,...a})=>a)}export{l as a};
2
- //# sourceMappingURL=chunk-ITHQJZTG.js.map
@@ -1,2 +0,0 @@
1
- import{a as R,e as T,f as k}from"./chunk-QYKKTYBN.js";import{b as V,c as j,d as G}from"./chunk-VDZIEDJB.js";import{c as B}from"./chunk-5QJIEYFB.js";import{a as K,k as I,l as O}from"./chunk-VGBSY6N7.js";import{a as C}from"./chunk-IVAIPXNO.js";import{c as M}from"./chunk-PBGTMPJ7.js";import{f as P,g as N,i as A,j as w,r as E,t as q}from"./chunk-O6KCZPJQ.js";import{b as h,c as m,d as v,f as x,k as b}from"./chunk-OH5HIAID.js";import{a as L}from"./chunk-NN3O7TPH.js";function H(i,e,t){let a=e.identifierResolution==="strict"?I:O;for(let n of e.paths)if(!(!m(n)&&!(e.includeVueSfc&&v(n)))&&!i.isIgnored(n)&&!e.skipPath?.(n))try{let l=(r,c,p,d)=>{if(e.candidateNames&&!e.candidateNames.has(r))return;let y=e.resolveTargets?e.resolveTargets({sourceFile:n,name:r,kind:c,defaultTargets:d}):d();for(let S of y)t({sourceFile:n,name:r,target:S,occurrences:p,kind:c})},f=K(i,n);for(let[r,c]of f)l(r,"identifier",c.length,()=>a(i,n,r));for(let r of b(i,n,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let c=r.kind==="cross-language-dispatch"?()=>I(i,n,r.name):()=>a(i,n,r.name);l(r.name,r.kind,r.occurrences,c)}}finally{e.afterPath?.(n)}}var W=class{constructor(e){this.db=e}db;scopedDefinitions(e){return q(this.db,e)}definitionsForFile(e){return E(this.db,e)}productionCallableDefinitions(e={}){let{scope:t,minLoc:a=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:l=!1,excludeTypesFiles:f=!1,excludeRootedSymbols:r=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:p=!1,excludeRustTraitImplMembers:d=!1,includeSuppressed:y=!1,sortByLocDesc:S=!1}=e,g=[];for(let s of this.scopedDefinitions(t)){let u=s.relativePath;if(this.db.isIgnored(u)||l&&T(this.db,u)||!Y(s,{requireFunctionLikeSymbol:c,requireCallableSymbol:p})||o!==void 0&&s.symbol===o)continue;let F=D(s);F<a||F>n||f&&_(u)||r&&k(this.db,s.symbol,u)||d&&A(s.symbol)||R(u)!=="test"&&(w(s.symbol)||!y&&h(this.db,u,s.startLine)||g.push(s))}return S?g.sort((s,u)=>D(u)-D(s)):g}calleeMap(e,t={}){return B(this.db,e,t)}crossFileCallerMap(e,t={}){return V(this.db,e,t)}sourceFallbackCallerFiles(e){return j(this.db,e)}callerFileMap(e,t={}){return G(this.db,e,t)}frameworkReferencedSymbolIds(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let o=t.get(n.leaf)??[];o.push(n.symbolId),t.set(n.leaf,o)}let a=new Set;for(let n of L(this.db,{includeIgnored:!1}))if(m(n)==="rust")for(let{name:o}of b(this.db,n,{includeRustAttributeNames:!0}))for(let l of t.get(o)??[])a.add(l);return a}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let a=new Map(e.map(o=>[o.symbolId,o.symbol])),n=this.calleeMap(e,t);return new Set([...n.entries()].filter(([o,l])=>{let f=a.get(o);return l.some(r=>r.symbol!==f)}).map(([o])=>o))}fileDependencyGraph(e){return C(this.db,e)}fileKind(e){return R(e)}hasSuppressionComment(e){return h(this.db,e.relativePath,e.startLine)}sourceFiles(){return M(this.db)}scanSourceReferences(e,t){H(this.db,e,t)}callableSignature(e){let t=x(this.db,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};function Y(i,e){return e.requireCallableSymbol?P(i.symbol):e.requireFunctionLikeSymbol?N(i.symbol):i.isFunctionLike}function D(i){return i.endLine-i.startLine+1}function _(i){return(i.split("/").pop()??"").includes("types")}export{W as a};
2
- //# sourceMappingURL=chunk-IW7ASGVF.js.map
@@ -1,2 +0,0 @@
1
- import{a as p,f as h}from"./chunk-R3G6ERW7.js";import{a as c}from"./chunk-QYKKTYBN.js";import{a as d}from"./chunk-IVAIPXNO.js";import{existsSync as A}from"fs";import{join as S}from"path";function T(e){return m.test(e)}var m=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|CHANGELOG(?:\.[a-z]+)?|.*\.map)$|(?:^|\/)(?:dist|build|out|node_modules)\//i;function j(e,i,t={}){let{minTogether:o=4,minConfidence:r=.6,limit:a=30}=t,u=p(e),s=i!==void 0,f=h(e,{minTogether:s?Math.min(o,2):o,minConfidence:s?0:r});if(!u||!f)return{available:!1,commitsAnalyzed:0,findings:[]};let C=d(e),y=t.includeLinked===!0||s,l=[];for(let n of f){if(m.test(n.fileA)||m.test(n.fileB)||!b(e,n.fileA)||!b(e,n.fileB)||s&&!n.fileA.includes(i)&&!n.fileB.includes(i)||!s&&(c(n.fileA)==="test"||c(n.fileB)==="test"||k(n.fileA,n.fileB)))continue;let g=x(C,n.fileA,n.fileB);if(!(!y&&g)&&(l.push({...n,structurallyLinked:g}),l.length>=a))break}return{available:!0,commitsAnalyzed:u.commits.length,findings:l}}function b(e,i){return A(S(e.config.projectRoot,i))}function k(e,i){let t=e.lastIndexOf("/"),o=i.lastIndexOf("/");if(e.slice(0,t)!==i.slice(0,o))return!1;let r=e.slice(t+1).split(".")[0],a=i.slice(o+1).split(".")[0];return r!==""&&r===a}function x(e,i,t){return e.get(i)?.has(t)===!0||e.get(t)?.has(i)===!0}export{T as a,j as b};
2
- //# sourceMappingURL=chunk-JODYQDE4.js.map
@@ -1,2 +0,0 @@
1
- import{a as f}from"./chunk-V76FCF5F.js";import{a as m}from"./chunk-MX6F756F.js";import{a as d}from"./chunk-IW7ASGVF.js";import{c as u}from"./chunk-O6KCZPJQ.js";function w(n,a={}){let{scope:e,minLoc:r=10,minCallees:o=6,limit:t=20,scanLimit:i}=a,s=new d(n);return f({candidates:()=>s.productionCallableDefinitions({scope:e,minLoc:r,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,prepare:l=>s.calleeMap(l,{semantic:a.semantic!==!1}),evaluate:(l,c)=>g(l,c.get(l.symbolId)??[],o),orderResults:(l,c)=>c.clusters.length-l.clusters.length||c.loc-l.loc,limit:t})}function g(n,a,e){let r=new Set(a.map(s=>s.symbol));if(r.size<e)return null;let o=b(r,a),t=p(r,o);if(t.length<2)return null;let i=h(t,o);return i.length===0?null:{symbol:n.symbol,shortName:u(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:m(n),totalCallees:r.size,clusters:i}}function b(n,a){let e=new Map;for(let o of n)e.set(o,new Set);let r=new Map;for(let o of a){let t=r.get(o.chunkId);t||(t=new Set,r.set(o.chunkId,t)),t.add(o.symbol)}for(let o of r.values()){let t=[...o];for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)e.get(t[i]).add(t[s]),e.get(t[s]).add(t[i])}return e}function p(n,a){let e=new Set,r=[];for(let o of n){if(e.has(o))continue;let t=new Set,i=[o];for(;i.length>0;){let s=i.pop();if(!e.has(s)){e.add(s),t.add(s);for(let l of a.get(s)??[])e.has(l)||i.push(l)}}r.push(t)}return r}function h(n,a){return n.filter(e=>e.size>=3).map(e=>C(e,n,a)).filter(e=>e.isolation>.5).sort((e,r)=>r.isolation-e.isolation)}function C(n,a,e){let r=new Set;for(let s of a)if(s!==n)for(let l of s)r.add(l);let o=0;for(let s of n)for(let l of e.get(s)??[])r.has(l)&&o++;let t=n.size*r.size,i=t>0?1-o/t:1;return{callees:[...n].map(u),isolation:i}}export{w as a};
2
- //# sourceMappingURL=chunk-MCW36F2D.js.map
@@ -1,2 +0,0 @@
1
- function r(e){return e.endLine-e.startLine+1}function u(e,n){return r(e)-r(n)||e.relativePath.localeCompare(n.relativePath)}function d(e,n){return typeof n!="number"||n<=0||e.length<=n?e:e.slice(0,n)}function f(e){let n=new Set,o=[];for(let t of e){let i=`${t.symbol}|${t.file}`;n.has(i)||(n.add(i),o.push(t))}return o}export{r as a,u as b,d as c,f as d};
2
- //# sourceMappingURL=chunk-MX6F756F.js.map
@@ -1,18 +0,0 @@
1
- import{a as m}from"./chunk-IW7ASGVF.js";import{a as S}from"./chunk-QYKKTYBN.js";import{c as h}from"./chunk-ZF6P2NAT.js";import{b as d}from"./chunk-FVVT7GV6.js";import{a as y}from"./chunk-NN3O7TPH.js";import f from"path";function l(e){let n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n.length<=1?"(root)":n.length>=3&&["src","lib","app","server","client"].includes(n[0])?`${n[0]}/${n[1]}`:n[0]}function p(e,t){if(e===t)return"ok";let n=g(e),i=g(t);return n&&i?v(n,i)?"ok":"violation":w(e,t)}function D(e,t){let n=g(l(e)),i=g(l(t));return!!n&&!!i}function g(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function v(e,t){return t==="domain"?!0:e==="domain"?!1:{analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),"language-parsers":new Set(["domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","semantic","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["domain","queries","reindex","resolution","semantic","source","storage","symbols"]),semantic:new Set(["domain","resolution","storage","symbols"]),source:new Set(["domain","storage"]),storage:new Set(["domain","source"]),symbols:new Set(["analysis","domain","language-parsers","resolution","semantic","source","storage"])}[e]?.has(t)??!1}function w(e,t){if(t==="shared")return"ok";let n={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return n[e]?n[e].has(t)?"ok":"violation":null}function G(e,t){let{scope:n,minDeviation:i=5}=t??{},r=t?.semantic!==!1,c=new m(e).fileDependencyGraph(n),a=O(e,n);return _([...R(e,c,a,{semantic:r}),...k(c),...I(c,i)])}function R(e,t,n,i){let r=[];for(let[s,c]of t){if(u(s))continue;let a=n.get(s)??new Set;for(let o of c)if(!u(o)&&!a.has(o)){if(i.semantic&&L(e,s,o)||A(e,s,o)||T(e,s,o)||F(o)||j(e,s,o)||V(o))continue;r.push({file:s,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o})}}return r}function k(e){let t=[],n=$(e);for(let[i,r]of e){if(u(i))continue;let s=l(i);for(let c of r){if(u(c))continue;let a=l(c);if(s===a)continue;(p(s,a)??n.get(`${s}->${a}`))==="violation"&&t.push({file:i,kind:"layer-violation",description:`Imports from ${a}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${s}/ should not depend on ${a}/`})}}return t}function I(e,t){let n=[];for(let[i,r]of M(e)){let s=r.filter(a=>!u(a));if(s.length<t)continue;let c=x(e,s);for(let a of s)for(let o of e.get(a)??[])u(o)||(c.get(o)??0)===1&&f.dirname(o)!==i&&f.dirname(o)!==f.dirname(i)&&(D(a,o)||n.push({file:a,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${o}`,dep:o}))}return n}function _(e){return{results:e,unusedImports:e.filter(t=>t.kind==="unused-import").length,layerViolations:e.filter(t=>t.kind==="layer-violation").length,patternDeviations:e.filter(t=>t.kind==="pattern-deviation").length}}function M(e){let t=new Map;for(let n of e.keys()){let i=f.dirname(n),r=t.get(i);r||(r=[],t.set(i,r)),r.push(n)}return t}function x(e,t){let n=new Map;for(let i of t)for(let r of e.get(i)??[])u(r)||n.set(r,(n.get(r)??0)+1);return n}function O(e,t){let n=new Map;return E(e,n,t),P(e,n),n}function E(e,t,n){for(let i of N(e,n))b(e,t,i.from_file,i.to_file)}function N(e,t){let n=t?`AND d1.relative_path LIKE '%${t}%'`:"";return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents d1 ON c.document_id = d1.id
5
- JOIN global_symbols gs ON m.symbol_id = gs.id
6
- JOIN (
7
- SELECT m2.symbol_id, c2.document_id
8
- FROM mentions m2
9
- JOIN chunks c2 ON m2.chunk_id = c2.id
10
- WHERE m2.role = 1
11
- GROUP BY m2.symbol_id
12
- ) sym_def ON sym_def.symbol_id = gs.id
13
- JOIN documents d2 ON sym_def.document_id = d2.id
14
- WHERE d1.id != d2.id
15
- AND m.role != 1
16
- ${e.pathExclusionsFor("d1","d2")}
17
- ${n}`)}function P(e,t){new m(e).scanSourceReferences({paths:y(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},i=>{i.target.relativePath!==i.sourceFile&&(e.isIgnored(i.target.relativePath)||b(e,t,i.sourceFile,i.target.relativePath))})}function b(e,t,n,i){if(e.isIgnored(n)||e.isIgnored(i))return;let r=t.get(n);r||(r=new Set,t.set(n,r)),r.add(i)}function $(e){let t=new Map;for(let[i,r]of e){if(u(i))continue;let s=l(i);for(let c of r){if(u(c))continue;let a=l(c);if(s===a||p(s,a))continue;let o=`${s}->${a}`;t.set(o,(t.get(o)??0)+1)}}let n=new Map;for(let[i,r]of t)n.set(i,r<=2?"violation":"ok");return n}function F(e){return e.includes("types")||e.endsWith(".d.ts")}function L(e,t,n){let i=h(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.some(r=>r.isUsed)}function A(e,t,n){let i=d(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.some(r=>r.used)}function T(e,t,n){let i=d(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.every(r=>r.isTypeOnly===!0)}function V(e){return e.endsWith(".vue")}function j(e,t,n){let i=d(e,t).filter(r=>r.sourcePath===n);return i.length===0?!1:i.every(r=>r.kind==="side-effect"||r.kind==="namespace"&&r.usedMembers.length===0&&!r.used)}function u(e){let t=S(e);return!!(t==="entry"||t==="barrel"||t==="test"||t==="worker"||J(f.basename(e)))}function J(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{G as a};
18
- //# sourceMappingURL=chunk-NGI4V4AB.js.map
@@ -1,62 +0,0 @@
1
- import{a as h,h as S}from"./chunk-OH5HIAID.js";import{a as x}from"./chunk-NN3O7TPH.js";import{c as y}from"./chunk-VDZL45XI.js";var v={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function d(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let t=e.split(" ");if(t.length<4)return{scheme:t[0]??"",manager:t[1]??"",packageName:t[2]??"",version:"",descriptors:[],raw:e};let n=t[0],i=t[1],r=e.slice(n.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=F(r);return{scheme:n,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function m(e){let t=d(e);if("kind"in t)return null;for(let n=t.descriptors.length-2;n>=0;n--){let i=t.descriptors[n];if(i?.suffix==="type")return i.name}return null}function F(e){let t=[],n=0;for(;n<e.length;){if(e[n]==="["){let s=e.indexOf("]",n+1);if(s===-1){t.push({name:e.slice(n+1),suffix:"type-param"});break}t.push({name:e.slice(n+1,s),suffix:"type-param"}),n=s+1;continue}if(e[n]==="("&&(t.length===0||n===0||D(e[n-1]))){let s=e.indexOf(")",n+1);if(s!==-1&&e[s+1]!=="."){t.push({name:e.slice(n+1,s),suffix:"parameter"}),n=s+1;continue}}let i;if(e[n]==="`"){let s=e.indexOf("`",n+1);if(s===-1){i=e.slice(n+1),t.push({name:i,suffix:"term"});break}i=e.slice(n+1,s),n=s+1}else{let s=n;for(;n<e.length&&!D(e[n]);)n++;i=e.slice(s,n)}if(n>=e.length){i&&t.push({name:i,suffix:"term"});break}let r=e[n];if(r==="("){let s=e.indexOf(")",n+1);s!==-1&&e[s+1]==="."?(t.push({name:i,suffix:"method"}),n=s+2):s!==-1?(t.push({name:i,suffix:"method"}),n=s+1):(t.push({name:i,suffix:"term"}),n++)}else{let s=v[r];s&&t.push({name:i,suffix:s}),n+=1}}return t}function D(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function _(e){let t=d(e);if("kind"in t&&t.kind==="local")return`local:${t.id}`;let n=t;if(n.descriptors.length===0)return n.raw;let i=[];for(let r of n.descriptors){let s=w(r);s&&i.push(s)}return i.join(":")}function w(e){let t=e.suffix==="namespace"?C(e.name):e.name;return t?e.suffix==="method"?`${t}()`:t:""}function C(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function L(e){let t=d(e);if("kind"in t&&t.kind==="local")return t.id;let n=t;return n.descriptors.length===0?"":n.descriptors[n.descriptors.length-1].name}function f(e){let t=d(e);if("kind"in t&&t.kind==="local")return null;let n=t;return n.descriptors[n.descriptors.length-1]?.suffix??null}function te(e){return e.endsWith("().")||f(e)==="method"}function I(e){let t=f(e);return t==="method"||t==="term"}function re(e){return f(e)==="namespace"}var A=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function ie(e){return A.test(e)}var T=new Set(["test","tests","_tests"]);function se(e){let t=d(e);if("kind"in t)return!1;for(let n=0;n<t.descriptors.length-1;n+=1){let i=t.descriptors[n];if(i?.suffix==="namespace"&&i.name&&T.has(i.name))return!0}return!1}function oe(e,t){let n=d(e),i=d(t);if("kind"in n||"kind"in i)return!1;let r=n.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ae(e,t){let n=d(e),i=d(t);if("kind"in n||"kind"in i)return!1;let r=n.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ce(e,t){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
2
- FROM global_symbols gs
3
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
4
- JOIN documents d ON der.document_id = d.id
5
- WHERE ${t.where}
6
- ${e.pathExclusionsFor("d")}
7
- ${M(t.orderBy)}
8
- ${k(t.limit)}`,...t.params??[])}function ue(e,t){return e.all(`SELECT
9
- gs.id,
10
- gs.symbol,
11
- c.document_id,
12
- MIN(c.start_line) AS start_line,
13
- MAX(c.end_line) AS end_line,
14
- d.relative_path,
15
- gs.display_name,
16
- gs.documentation
17
- FROM global_symbols gs
18
- JOIN mentions m ON m.symbol_id = gs.id
19
- JOIN chunks c ON m.chunk_id = c.id
20
- JOIN documents d ON c.document_id = d.id
21
- WHERE m.role = 1
22
- AND ${t.where}
23
- ${e.pathExclusionsFor("d")}
24
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
25
- ${M(t.orderBy)}
26
- ${k(t.limit)}`,...t.params??[])}function M(e){return e?`ORDER BY ${e}`:""}function k(e){return typeof e=="number"?`LIMIT ${e}`:""}function N(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function O(e){if(!e)return null;let t=R(e);if(t)return t.replace(/\n/g," ");let n=e.indexOf("|");if(n===-1)return e.replace(/\n/g," ");let i=e.slice(n+1);return(R(i)??i).replace(/\n/g," ")}function R(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function Q(e){if(m(e.symbol)!==null)return!1;let n=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(n)}function $(e,t,n={}){let i=new Map;for(let s of t)e.length>0&&!Q(s)||i.set(s.id,s);for(let s of e)i.set(s.id,s);let r=[...i.values()];return n.sort?r.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):r}var P=y("file-definitions",{clearGroups:["definition-catalog"]});function g(e,t){return P.get(e,t,()=>{let n=$(B(e,t),j(e,t),{sort:!0});return H(e,t,n.map(J))})}function B(e,t){return e.all(`SELECT
27
- gs.id,
28
- gs.symbol,
29
- der.document_id,
30
- der.start_line,
31
- der.end_line,
32
- d.relative_path,
33
- gs.display_name,
34
- gs.kind,
35
- gs.documentation,
36
- gs.enclosing_symbol
37
- FROM global_symbols gs
38
- JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
39
- JOIN documents d ON der.document_id = d.id
40
- WHERE d.relative_path = ?
41
- ${e.symbolNoiseFor("gs")}
42
- ORDER BY der.start_line, der.end_line`,t)}function j(e,t){return e.all(`SELECT
43
- gs.id,
44
- gs.symbol,
45
- c.document_id,
46
- MIN(c.start_line) AS start_line,
47
- MAX(c.end_line) AS end_line,
48
- d.relative_path,
49
- gs.display_name,
50
- gs.kind,
51
- gs.documentation,
52
- gs.enclosing_symbol
53
- FROM global_symbols gs
54
- JOIN mentions m ON m.symbol_id = gs.id
55
- JOIN chunks c ON m.chunk_id = c.id
56
- JOIN documents d ON c.document_id = d.id
57
- WHERE d.relative_path = ?
58
- AND m.role = 1
59
- ${e.symbolNoiseFor("gs")}
60
- GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
61
- ORDER BY start_line, end_line`,t)}function J(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,endLine:e.end_line,relativePath:e.relative_path,leaf:L(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:I(e.symbol),isTypeLike:f(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function De(e,t={}){return W(e,t.scope)}function W(e,t){return x(e,{scope:t,includeIgnored:!1}).flatMap(n=>g(e,n)).filter(n=>!e.isIgnored(n.relativePath))}function _e(e,t,n={}){if(t.length===0)return[];let i=t.flatMap(r=>g(e,r)).filter(r=>!e.isIgnored(r.relativePath));return n.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),n.sort&&(i=i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:_(r.symbol),signature:N(O(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Le(e,t){let n=null;for(let i of e)i.startLine>t||i.endLine<t||(!n||i.endLine-i.startLine<n.endLine-n.startLine)&&(n=i);return n}function Ie(e,t){let n=g(e,t.relative_path).find(i=>i.symbolId===t.id);return n?{symbolId:n.symbolId,symbol:n.symbol,documentId:n.documentId,startLine:n.startLine,endLine:n.endLine,relativePath:n.relativePath}:{symbolId:t.id,symbol:t.symbol,documentId:t.document_id,startLine:t.start_line,endLine:t.end_line,relativePath:t.relative_path}}function H(e,t,n){let i=h(e,t),r=S(e,t);return r?X(n,r,i):i?z(n,i):n}function z(e,t){let n=t.split(/\r?\n/),i=U(e,n),r=Y(e,i),s=Z(r,n);return G(e,s)}function U(e,t){let n=e.some(r=>b(r.symbol))?q(t):null,i=new Map;for(let r of e)i.set(r.symbolId,V(t,n,r));return i}function Y(e,t){return e.filter(n=>b(n.symbol)).map(n=>({definition:n,startLine:t.get(n.symbolId)??n.startLine})).sort((n,i)=>n.startLine-i.startLine||n.definition.startLine-i.definition.startLine||n.definition.symbol.localeCompare(i.definition.symbol))}function Z(e,t){let n=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],s=e[i+1],o=s?Math.max(r.startLine,s.startLine-1):t.length-1;n.set(r.definition.symbolId,{startLine:r.startLine,endLine:ee(t,r.definition,r.startLine,o)})}return n}function G(e,t){return e.map(n=>{let i=t.get(n.symbolId);return i?{...n,startLine:i.startLine,endLine:i.endLine}:n})}function X(e,t,n=null){let i=new Map;for(let r of t){let s=i.get(r.name);s?s.push(r):i.set(r.name,[r])}return e.map(r=>{if(!K(r)||!r.leaf)return E(r,n);let s=i.get(r.leaf);if(!s||s.length===0)return E(r,n);let o=s[0],a=Math.abs(o.startLine-r.startLine);for(let c=1;c<s.length;c+=1){let l=s[c],u=Math.abs(l.startLine-r.startLine);u<a&&(o=l,a=u)}return{...r,startLine:o.startLine,endLine:o.endLine}})}function K(e){return b(e.symbol)?!0:f(e.symbol)==="term"&&m(e.symbol)===null}function E(e,t){if(!t||!e.leaf||f(e.symbol)!=="term"||m(e.symbol)!==null)return e;let n=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${n}\\b`),s=t.split(/\r?\n/).findIndex(o=>i.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function V(e,t,n){if(!b(n.symbol))return n.startLine;let i=Math.max(0,Math.min(n.startLine,e.length-1));if(!t)return i;let r=t.get(n.leaf);if(!r||r.length===0)return i;let s=null;for(let o of r){let a=Math.abs(o-n.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??i}function q(e){let t=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,n=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let u of c.matchAll(t))u[1]&&o(u[1],a);for(let u of c.matchAll(n))u[1]&&o(u[1],a);let l=c.match(i);l?.[1]&&o(l[1],a);for(let u of c.matchAll(r))u[1]&&o(u[1],a)}return s}function ee(e,t,n,i){let r=Math.max(n,Math.min(e.length-1,i)),s=Math.max(n,Math.min(r,t.endLine)),o=0,a=0,c=!1;for(let l=n;l<=r;l+=1){let u=ne(e[l]??"");for(let p of u)p==="{"?(o+=1,c=!0):p==="}"?o=Math.max(0,o-1):p==="("?a+=1:p===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function ne(e){let t="",n=null,i=!1;for(let r=0;r<e.length;r+=1){let s=e[r],o=e[r+1];if(!n&&s==="/"&&o==="/"){t+=" ".repeat(e.length-r);break}if(n){if(i){i=!1,t+=" ";continue}if(s==="\\"){i=!0,t+=" ";continue}s===n&&(n=null),t+=" ";continue}if(s==='"'||s==="'"||s==="`"){n=s,t+=" ";continue}t+=s}return t}function b(e){return e.includes("().")}function Re(e){let t=d(e);if("kind"in t)return[];let n=[];for(let i=t.descriptors.length-2;i>=0;i-=1){let r=t.descriptors[i];r?.suffix==="type"&&r.name&&n.push(r.name)}return n}export{d as a,m as b,_ as c,L as d,f as e,te as f,I as g,re as h,ie as i,se as j,oe as k,ae as l,ce as m,ue as n,N as o,O as p,$ as q,g as r,De as s,W as t,_e as u,Le as v,Ie as w,Re as x};
62
- //# sourceMappingURL=chunk-O6KCZPJQ.js.map
@@ -1,6 +0,0 @@
1
- import{a as k,b as y,e as L,f as E}from"./chunk-UIWAZ2NT.js";import{c as q}from"./chunk-MX6F756F.js";import{a as F}from"./chunk-IW7ASGVF.js";import{a as N}from"./chunk-5QJIEYFB.js";import{a as A}from"./chunk-4MHT7LKP.js";import{c as p,d as M,g as R}from"./chunk-O6KCZPJQ.js";import{a as z}from"./chunk-OH5HIAID.js";import{d as w}from"./chunk-VDZL45XI.js";function ue(e,n,i={}){let{minSimilarity:r=.4,limit:s=20}=i,l=V(e,n,{semantic:i.semantic!==!1});if(!l)return[];if(!R(l.symbol))return[];let t=U(e,l,r,{scanLimit:i.scanLimit,semantic:i.semantic!==!1});return t.length>0?t.slice(0,s):H(e,n,{minSimilarity:r,limit:s})}function U(e,n,i,r){let s=I(e,{minCallees:3,excludeSymbol:n.symbol,scanLimit:r.scanLimit,semantic:r.semantic}),l=L([n,...s].map(o=>o.callees)),t=[];for(let o of s){if(o.callees.size<3)continue;let a=$(n,o,l,{minSimilarity:i,requireSignificantShared:1,requireSharedCount:0});a&&t.push(a)}return t.sort((o,a)=>a.similarity-o.similarity),t}function $(e,n,i,r){let{similarity:s,significantShared:l}=E(e.callees,n.callees,i);if(s<r.minSimilarity)return null;let t=k(e.callees,n.callees).size;if(l.length<r.requireSignificantShared&&t<r.requireSharedCount)return null;let o=l.length>0?l:[...k(e.callees,n.callees)];return{symbolA:e.symbol,shortNameA:p(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:p(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:o.map(p),uniqueToA:[...y(e.callees,n.callees)].map(p),uniqueToB:[...y(n.callees,e.callees)].map(p)}}function be(e,n={}){let{minSimilarity:i=.5,limit:r=20,scope:s,minCallees:l=4,crossFileOnly:t=!1,scanLimit:o}=n,a=I(e,{minCallees:l,scope:s,scanLimit:o,semantic:n.semantic!==!1}),c=L(a.map(u=>u.callees)),m=new Map;for(let u of a)for(let b of u.callees)m.set(b,(m.get(b)??0)+1);let h=Math.max(8,Math.ceil(Math.sqrt(a.length))),x=new Map;for(let u=0;u<a.length;u+=1)for(let b of a[u].callees){if((m.get(b)??0)>h)continue;let g=x.get(b);g||(g=[],x.set(b,g)),g.push(u)}let C=[],P=new Set;e:for(let u=0;u<a.length;u+=1){let b=a[u],g=new Set;for(let D of b.callees){let S=x.get(D);if(S)for(let f of S)f>u&&g.add(f)}for(let D of g){let S=`${u}|${D}`;if(P.has(S))continue;P.add(S);let f=a[D];if(t&&b.file===f.file)continue;if(b.paramCount>=0&&f.paramCount>=0){let _=Math.abs(b.paramCount-f.paramCount),O=Math.max(2,Math.ceil(Math.max(b.paramCount,f.paramCount)*.5));if(_>O)continue}let B=$(b,f,c,{minSimilarity:i,requireSignificantShared:2,requireSharedCount:4});if(B&&(C.push(B),C.length>r*5))break e}}return C.sort((u,b)=>b.similarity-u.similarity),C.slice(0,r)}var G=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function V(e,n,i){let r=A(e,n),s=new F(e);if(!r)return null;let l=N(e,r,{semantic:i.semantic});return{symbol:r.symbol,file:r.relativePath,callees:T(l.map(t=>t.symbol)),paramCount:s.callableSignature(r)?.paramCount??-1}}var Z=w("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]});function I(e,n){let{minCallees:i,scope:r,excludeSymbol:s,scanLimit:l}=n,t=n.semantic!==!1,o=Z.get(e,()=>new Map),a=`${i}|${r??""}|${l??""}|${t}`,c=o.get(a);return c||(c=W(e,{minCallees:i,scope:r,scanLimit:l,semantic:t}),o.set(a,c)),s===void 0?c:c.filter(m=>m.symbol!==s)}function W(e,n){let{minCallees:i,scope:r,scanLimit:s,semantic:l}=n,t=new F(e),o=q(t.productionCallableDefinitions({scope:r,minLoc:5,sortByLocDesc:typeof s=="number"&&s>0}),s),a=t.calleeMap(o,{semantic:l});return o.map(c=>({symbol:c.symbol,file:c.relativePath,callees:T((a.get(c.symbolId)??[]).map(m=>m.symbol)),paramCount:t.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=i)}function T(e){return new Set([...e].filter(n=>!K(n)))}function K(e){return G.some(n=>e.includes(n))}function H(e,n,i){let r=J(e,n);if(!r||r.tokens.size<3)return[];let s=i.minSimilarity>=.5?i.minSimilarity:.3,l=[];for(let t of Y(e)){if(t.symbol===r.symbol||t.tokens.size<3)continue;let o=k(r.tokens,t.tokens);if(o.size<2)continue;let a=new Set([...r.tokens,...t.tokens]),c=a.size>0?o.size/a.size:0;c<s||l.push({symbolA:r.symbol,shortNameA:p(r.symbol),fileA:r.file,symbolB:t.symbol,shortNameB:p(t.symbol),fileB:t.file,similarity:c,similarityBasis:"source-tokens",sharedCallees:[...o].sort(),uniqueToA:[...y(r.tokens,t.tokens)].sort(),uniqueToB:[...y(t.tokens,r.tokens)].sort()})}return l.sort((t,o)=>o.similarity-t.similarity||t.shortNameB.localeCompare(o.shortNameB)),l.slice(0,i.limit)}function J(e,n){let i=A(e,n);if(!i||!R(i.symbol))return null;let r=Q(e,i);return r?{symbol:i.symbol,file:i.relativePath,tokens:r}:null}function Q(e,n){let i=M(n.symbol),r=v(e,n.relativePath,n.startLine,n.endLine,i),s=j(r,i);return s.size>0?s:null}var X=w("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]});function Y(e){return X.get(e,()=>ee(e))}function ee(e){return new F(e).productionCallableDefinitions().map(i=>({symbol:i.symbol,file:i.relativePath,tokens:j(v(e,i.relativePath,i.startLine,i.endLine,i.leaf),i.leaf)})).filter(i=>i.tokens.size>0)}function v(e,n,i,r,s){let l=z(e,n);if(!l)return"";let t=l.split(`
2
- `);if(r>=i&&r-i<=12)return t.slice(i,r+1).join(`
3
- `);let o=[new RegExp(`\\bdef\\s+${d(s)}\\b`),new RegExp(`\\bfun\\s+${d(s)}\\b`),new RegExp(`\\bfn\\s+${d(s)}\\b`),new RegExp(`\\bfunction\\s+${d(s)}\\b`),new RegExp(`\\b${d(s)}\\s*\\(`)],a=t.findIndex(c=>o.some(m=>m.test(c)));if(a>=0){let c=a;for(let m=a+1;m<t.length&&m<=a+8;m++){let h=t[m]??"";if(m>a&&te(h)||(c=m,h.trim()===""&&m>a+1))break}return t.slice(a,c+1).join(`
4
- `)}return t.slice(i,Math.min(t.length,i+8)).join(`
5
- `)}function j(e,n){if(!e)return new Set;let i=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),r=ie(n),l=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(t=>t.trim()).filter(t=>t.length>1).filter(t=>!i.has(t)).filter(t=>!r.has(t));return new Set(l)}function ie(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function te(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{ue as a,be as b,I as c,T as d};
6
- //# sourceMappingURL=chunk-OAI5GEIN.js.map
@@ -1,4 +0,0 @@
1
- import{b as F,c as k,d as R}from"./chunk-ISCKLDSS.js";import{c as w,e as b}from"./chunk-VDZL45XI.js";import{existsSync as X,readFileSync as $}from"fs";import{join as Z}from"path";var ee=w("source-text",{clearGroups:["whole-project","source-file"]});function g(e,t){let r=t.replace(/\\/g,"/");return ee.get(e,r,()=>{let n=Z(e.config.projectRoot,r);return X(n)?$(n,"utf-8"):""})}var te=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift|extract)?/i;function Qe(e,t,r){if(r<=0)return!1;let n=g(e,t);if(!n)return!1;let s=n.split(`
2
- `);for(let a=r-1;a>=0&&a>=r-5;a-=1){let i=(s[a]??"").trim();if(i!==""){if(te.test(i))return!0;if(!i.startsWith("//")&&!i.startsWith("*")&&!i.startsWith("/*")&&!i.startsWith("@")&&!i.startsWith("#"))return!1}}return!1}import{extname as T}from"path";var re={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"};function h(e){return re[T(e).toLowerCase()]??null}function C(e){return T(e).toLowerCase()===".vue"}import{createRequire as ne}from"module";var f=ne(import.meta.url),x=null,j=!1;function se(){if(j)return null;if(x)return x;try{return x=f("tree-sitter"),x}catch{return j=!0,null}}var E=new Map,N=new Set;function ae(e){if(N.has(e))return null;let t=E.get(e);if(t)return t;let r;try{switch(e){case"rust":r=f("tree-sitter-rust");break;case"typescript":r=f("tree-sitter-typescript").typescript;break;case"tsx":r=f("tree-sitter-typescript").tsx;break;case"javascript":r=f("tree-sitter-javascript");break;case"python":r=f("tree-sitter-python");break;case"java":r=f("tree-sitter-java");break;case"kotlin":r=f("tree-sitter-kotlin");break;case"scala":r=f("tree-sitter-scala");break;case"ruby":r=f("tree-sitter-ruby");break;case"c":r=f("tree-sitter-c");break;case"cpp":r=f("tree-sitter-cpp");break;case"csharp":r=f("tree-sitter-c-sharp");break;case"php":r=f("tree-sitter-php").php;break;case"vb":{let n=f("tree-sitter-vb-dotnet");r=n.language??n;break}}}catch{return N.add(e),null}return E.set(e,r),r}var D=new Map;function ie(e){let t=D.get(e);if(t)return t;let r=ae(e);if(!r)return null;let n=se();if(!n)return null;let s=new n;try{s.setLanguage(r)}catch{return N.add(e),null}return D.set(e,s),s}function oe(e,t){return e.parse(n=>n>=t.length?null:t.slice(n,Math.min(t.length,n+16384)))}function L(e,t){let r=ie(e);if(!r)return null;try{return oe(r,t)}catch{return null}}function I(e){let t=[],r=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let o of e.matchAll(r))typeof o.index=="number"&&t.push({tagOpen:o[1]??"",body:o[2]??"",openIdx:o.index+(o[0].length-(o[2]?.length??0)-9)});if(t.length===0)return null;let n=t.find(o=>/\bsetup\b/.test(o.tagOpen))??t[0],a=n.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),i=a==="ts"||a==="typescript"?"typescript":a==="tsx"?"tsx":"javascript";return{body:n.body,startLine:ce(e,n.openIdx),language:i}}function ce(e,t){let r=0;for(let n=0;n<t&&n<e.length;n++)e.charCodeAt(n)===10&&r++;return r}var M=b("ast-trees",{clearGroups:["whole-project","source-file"]});function _(e,t){if(C(t))return ue(e,t);let r=h(t);if(!r)return null;let n=g(e,t);return n?M.get(e,t,n,()=>L(r,n)):null}function ue(e,t){let r=g(e,t);return r?M.get(e,t,r,()=>{let n=I(r);if(!n)return null;let s=`
3
- `.repeat(n.startLine)+n.body;return L(n.language,s)}):null}function S(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var le=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function H(e,t){let r=fe(e,t);if(r)return{name:r.name,startLine:r.definitionNode.startPosition.row,endLine:r.definitionNode.endPosition.row,paramCount:O(r.functionNode),params:v(r.functionNode),paramsEndLine:P(r.functionNode),isLiteralPassthrough:B(r.functionNode,t)};if(!pe(e.type,t))return null;let n=e.childForFieldName("name")??e.namedChildren.find(s=>s.type==="identifier"||s.type==="property_identifier");return n?{name:n.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:O(e),params:v(e),paramsEndLine:P(e),isLiteralPassthrough:B(e,t)}:null}function Q(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function v(e){let t=Q(e);if(!t)return[];let r=[];for(let n of t.namedChildren){if(S(n))continue;if(n.type==="identifier"){r.push({name:n.text,simple:!0});continue}let s=n.namedChildren.some(o=>o.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(n.text),a=n.childForFieldName("pattern");if(!s&&a&&a.type==="identifier"){r.push({name:a.text,simple:!0});continue}let i=n.namedChildren.find(o=>o.type==="identifier");r.push({name:a?.type==="identifier"?a.text:i?.text??"",simple:!1})}return r}function P(e){let t=Q(e);return t?t.endPosition.row:e.startPosition.row}function pe(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?le.has(e):!1}function fe(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let r=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1);return!r||!n||n.type!=="arrow_function"&&n.type!=="function_expression"?null:{name:r.text,definitionNode:e,functionNode:n}}if(e.type==="public_field_definition"){let r=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1);return!r||!n||n.type!=="arrow_function"&&n.type!=="function_expression"?null:{name:r.text,definitionNode:e,functionNode:n}}return null}function O(e){let t=e.namedChildren.find(n=>n.type==="parameters"||n.type==="formal_parameters");if(!t)return 0;let r=0;for(let n of t.namedChildren)S(n)||(r+=1);return r}function B(e,t){let r=e.namedChildren.find(l=>l.type==="block"||l.type==="statement_block");if(!r)return!1;let n=r.namedChildren.filter(l=>!S(l));if(n.length!==1)return!1;let s=n[0],a=null;if(s.type==="return_statement"||s.type==="expression_statement"?a=s.namedChild(0)??null:t==="rust"&&(s.type==="call_expression"||s.type==="macro_invocation")&&(a=s),!a)return!1;let i=t==="python"?"call":"call_expression";if(a.type!==i)return!1;let o=a.namedChildren.find(l=>l.type==="arguments"||l.type==="argument_list");if(!o)return!1;let u=o.namedChildren.filter(l=>!S(l)),c=e.namedChildren.find(l=>l.type==="parameters"||l.type==="formal_parameters");if(!c)return!1;let p=[];for(let l of c.namedChildren){if(l.type==="identifier"){p.push(l.text);continue}let d=l.namedChildren.find(J=>J.type==="identifier");d&&p.push(d.text)}if(u.length!==p.length)return!1;for(let l=0;l<p.length;l+=1){let d=u[l];if(d.type!=="identifier"||d.text!==p[l])return!1}return!0}function z(e,t){let r=me(e,t);if(!r)return null;let n=y(r);return n?{calleeLeaf:n,memberAccess:de(r),line:e.startPosition.row}:null}function me(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function de(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function y(e){switch(e.type){case"identifier":case"type_identifier":case"property_identifier":case"shorthand_property_identifier":return e.text;case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?y(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?y(t):null}case"super":case"self":case"this":return null;default:return null}}var ge=new Set(["identifier","type_identifier","field_identifier"]),ye=new Set(["identifier"]),he=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Se=new Set(["rust","python"]),be=/\{([^{}]*)\}/g,xe=/\b([A-Za-z_][\w]*)\b/g;function V(e,t){return Ce(t).has(e.type)}function G(e,t){return Se.has(t)&&e.type==="string_content"}function A(e){let t=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>t&&(t=s)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,s]of e)for(let a of s)r[a].add(n);return r}function Ce(e){return e==="rust"?ge:e==="python"?ye:he}function U(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(be)){let s=n[1]??"";for(let a of s.matchAll(xe))a[1]&&t(a[1],r)}}var Ne=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Le=/^#!?\[\s*serde\s*\(/,_e=/^#!?\[\s*schemars\s*\(/,Ae=/^#!?\[\s*validate\s*\(/,we=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function W(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=y(n);if(!s||!we.has(s))return;let a=e.namedChildren.find(u=>u.type==="arguments");if(!a)return;let i=a.namedChild(0);if(!i||i.type!=="string")return;let o=i.namedChildren.find(u=>u.type==="string_fragment");o&&r.add(o.text)}function Y(e,t){let r=Le.test(e),n=_e.test(e),s=Ae.test(e);if(!(!r&&!n&&!s))for(let a of Ne){a.lastIndex=0;let i;for(;(i=a.exec(e))!==null;){let o=i[1],u=o.split("::").pop()??o;u==="is_none"&&/\bOption\b/.test(o)||u==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||u&&t.add(u)}}}function K(e,t){let r=new Map,n=(i,o)=>{if(i===o)return;let u=r.get(i);u||(u=new Set,r.set(i,u)),u.add(o)},s=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),a=(i,o)=>{let u=c=>{s.has(c.type)&&c.text!==o&&n(c.text,o);for(let p of c.children)u(p)};for(let c of i.children)u(c)};if(t==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=i.namedChildren.find(c=>c.type==="type_identifier")?.text;if(!o)continue;let u=i.namedChildren.find(c=>c.type==="field_declaration_list"||c.type==="enum_variant_list"||c.type==="ordered_field_declaration_list");u&&a(u,o),i.type==="type_item"&&a(i,o)}else if(t==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let o=i.namedChildren.find(c=>c.type==="identifier")?.text;if(!o)continue;let u=i.namedChildren.find(c=>c.type==="block");if(u)for(let c of u.descendantsOfType("type"))for(let p of c.descendantsOfType("identifier"))p.text!==o&&n(p.text,o)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=i.namedChildren.find(u=>u.type==="type_identifier")?.text;o&&a(i,o)}return r}var Fe=b("source-facts",{clearGroups:["whole-project","source-file"]});function m(e,t){let r=h(t);if(!r)return null;let n=g(e,t);return n?Fe.get(e,t,n,()=>ke(e,t,r,n)):null}function ke(e,t,r,n){let s=F(e,t,n),a=k(e,"source-facts",t,s);if(a){let u=Te(a);if(u&&u.language===r)return u}let i=_(e,t);if(!i)return null;let o=De(i,r);return R(e,"source-facts",t,s,Re(o)),o}function Re(e){let t={language:e.language,callables:e.callables,callSites:e.callSites,typeContainerMap:[...e.typeContainerMap.entries()].map(([r,n])=>[r,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function Te(e){try{let t=JSON.parse(e),r=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,typeContainerMap:new Map(t.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:r,identifiersByLine:A(r),fileIdentifiers:new Set(r.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function je(e,t,r,n){let s=m(e,t);return s?Ee(s,r,n)?.isLiteralPassthrough??!0:!0}function Ee(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function De(e,t){let r=[],n=[],s=new Set,a=new Set,i=new Map,o=(c,p)=>{let l=i.get(c);if(!l){i.set(c,[p]);return}l[l.length-1]!==p&&l.push(p)},u=c=>{let p=H(c,t);p&&r.push(p);let l=z(c,t);l&&n.push(l),W(c,t,a),t==="rust"&&(c.type==="attribute_item"||c.type==="inner_attribute_item")&&Y(c.text,s),V(c,t)&&o(c.text,c.startPosition.row),G(c,t)&&U(c,o);for(let d of c.children)u(d)};return u(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:K(e,t),identifierLineMap:i,identifiersByLine:A(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:a}}var q=new Set(["rust","typescript","tsx","javascript","python"]);function Ie(e,t){let r=m(e,t);return!r||!q.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function Me(e,t){let r=m(e,t);return!r||!q.has(r.language)?null:r.callSites}function ve(e,t){return m(e,t)?.typeContainerMap??new Map}function Pe(e,t,r={}){let n=m(e,t);if(!n)return[];let s=[];if(r.includeCrossLanguageDispatchNames)for(let a of n.crossLanguageDispatchNames)s.push({name:a,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let a of n.rustAttrReferencedNames)s.push({name:a,kind:"rust-attribute",occurrences:1});return s}export{g as a,Qe as b,h as c,C as d,_ as e,m as f,je as g,Ie as h,Me as i,ve as j,Pe as k};
4
- //# sourceMappingURL=chunk-OH5HIAID.js.map
@@ -1,2 +0,0 @@
1
- import{c as p}from"./chunk-PBGTMPJ7.js";import{a as i}from"./chunk-OH5HIAID.js";import{d as a}from"./chunk-VDZL45XI.js";var g=/scip-query[\s:-]*ignore[\s:-]*(dead(?:-code)?|stale|wrapper|passthrough|drift|extract|similar)?/gi,y=a("suppression-inventory",{clearGroups:["whole-project"]});function b(e){return y.get(e,()=>d(e))}function d(e){let r={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,uncategorized:0},t=new Map,n=0;for(let o of p(e)){let s=i(e,o);if(!(!s||!s.includes("scip-query")))for(let c of s.matchAll(g)){n+=1,t.set(o,(t.get(o)??0)+1);let u=l(c[1]);r[u]+=1}}return{total:n,byCategory:r,byFile:t}}function l(e){if(!e)return"uncategorized";let r=e.toLowerCase();return r==="dead-code"?"dead":r}export{b as a};
2
- //# sourceMappingURL=chunk-OXKEUWMJ.js.map
@@ -1,2 +0,0 @@
1
- import{a as l}from"./chunk-NN3O7TPH.js";import{c as d}from"./chunk-VDZL45XI.js";import{readdirSync as x}from"fs";import{extname as p,join as f}from"path";var m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],j=[".vue"],S=new Set(m.map(t=>t.toLowerCase())),g=[...S].sort().join(","),y=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function w(t,o={}){let s=o.includeIndexed??!0,i=o.includeAuxiliary??!0,e=o.extensions?.map(c=>c.toLowerCase()),r=e?new Set(e):S,u=e?[...r].sort().join(","):g,n=`${s?"1":"0"}|${i?"1":"0"}|${u}`;return h.get(t,n,()=>{let c=new Set;if(s)for(let a of l(t,{includeIgnored:!1}))r.has(p(a).toLowerCase())&&c.add(a);if(i)for(let a of E(t.config.projectRoot,r))t.isIgnored(a)||c.add(a);return[...c].sort()})}var h=d("source-files",{clearGroups:[]});function E(t,o){let s=new Set,i=e=>{let r=e?f(t,e):t,u;try{u=x(r,{withFileTypes:!0})}catch{return}for(let n of u)if(!y.has(n.name)){if(n.isDirectory()){i(e?`${e}/${n.name}`:n.name);continue}o.has(p(n.name).toLowerCase())&&s.add(e?`${e}/${n.name}`:n.name)}};return i(""),s}export{j as a,y as b,w as c};
2
- //# sourceMappingURL=chunk-PBGTMPJ7.js.map
@@ -1,2 +0,0 @@
1
- import{a as u}from"./chunk-IW7ASGVF.js";import{a as h}from"./chunk-5QJIEYFB.js";import{o as S}from"./chunk-VGBSY6N7.js";import{a as d,b}from"./chunk-4MHT7LKP.js";import{c as m,v as y}from"./chunk-O6KCZPJQ.js";function v(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=d(e,o);return r?c==="backward"?w(e,r,s,{semantic:l.semantic!==!1}):M(e,r,{semantic:l.semantic!==!1}):null}function w(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let p of t){let g=h(e,p,{semantic:c.semantic});for(let a of g){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function M(e,o,l){let c=new Set,s=[],r=new u(e);for(let t of S(e,o,{semantic:l.semantic})){if(s.length>=30)break;let n=t.enclosingSymbol??y(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{v as a};
2
- //# sourceMappingURL=chunk-PRVDXGSK.js.map
@@ -1,6 +0,0 @@
1
- import{a as b}from"./chunk-IVAIPXNO.js";import{c as p}from"./chunk-PBGTMPJ7.js";import{f as g}from"./chunk-OH5HIAID.js";import{d as u}from"./chunk-VDZL45XI.js";import{readFileSync as j}from"fs";import{join as m}from"path";var k={files:new Set,pathPrefixes:[]},l=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,y=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,P=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],w=u("package-surface",{clearGroups:["whole-project"]});function E(t){return w.get(t,()=>v(t.config.projectRoot))}function S(t,r){let e=E(t);return e.files.has(r)?!0:e.pathPrefixes.some(s=>r.startsWith(s))}function v(t){let r=D(t);if(!r)return k;let e=new Set,s=[];for(let i of $(r))R(i,e,s);return{files:e,pathPrefixes:s}}function D(t){try{let r=j(m(t,"package.json"),"utf-8"),e=JSON.parse(r);return e&&typeof e=="object"?e:null}catch{return null}}function $(t){let r=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&r.push(t[s]);let e=t.bin;if(typeof e=="string")r.push(e);else if(e&&typeof e=="object")for(let s of Object.values(e))typeof s=="string"&&r.push(s);return x(t.exports,r),r}function x(t,r){if(typeof t=="string"){r.push(t);return}if(!(!t||typeof t!="object"))for(let e of Object.values(t))x(e,r)}function R(t,r,e){let s=t.replace(/\\/g,"/").replace(/^\.\//,"");if(s===""||s.startsWith(".."))return;let i=s.indexOf("*");if(i>=0){let o=s.slice(0,i);for(let a of h(o))a!==""&&e.push(a);return}let n=s.replace(y,"");for(let o of h(n)){o===n&&o===s&&r.add(s);for(let a of P)r.add(o+a)}r.add(s)}function h(t){let r=[t];return l.test(t)&&(r.push(t.replace(l,"src/")),r.push(t.replace(l,""))),r}function f(t){let r=c(t);return W(r)?"test":B(r)?"worker":A(r)?"entry":I(r)?"barrel":"source"}function T(t){return f(t)==="barrel"}function _(t){return F.get(t,()=>{let r=b(t),e=p(t).filter(n=>{let o=f(n);return o==="entry"||o==="worker"}),s=new Set,i=new Set;for(;e.length>0;){let n=e.shift();if(!s.has(n)){s.add(n),f(n)==="barrel"&&i.add(n);for(let o of r.get(n)??[])s.has(o)||e.push(o)}}return i})}var F=u("live-barrels",{clearGroups:["whole-project"]});function N(t,r){return _(t).has(c(r))}function Q(t){let r=_(t);return p(t).filter(e=>T(e)&&!r.has(e)&&!O(t,e))}function O(t,r){let e=c(r),s=g(t,e)?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
2
- FROM defn_enclosing_ranges der
3
- JOIN documents d ON d.id = der.document_id
4
- WHERE d.relative_path = ?
5
- AND der.end_line - der.start_line >= 2`,e)?.n??0)>0}function Y(t,r){let e=f(r);return e==="entry"||e==="worker"||N(t,r)}function Z(t,r,e){let s=c(e);if(S(t,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>c(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(c(n)))||i.qualifiedVars?.some(n=>C(r,n))||i.symbolPatterns?.some(n=>{try{return new RegExp(n).test(r)}catch{return!1}})):!1}function W(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function B(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function A(t){let r=t.split("/"),e=r[r.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:r.length<=2:!1}function I(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function c(t){return t.replace(/\\/g,"/")}function C(t,r){let e=r.lastIndexOf("/");if(e<0)return!1;let s=r.slice(0,e),i=r.slice(e+1);return t.includes(d(s)+"/")&&t.includes(d(i)+".")}function d(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{f as a,T as b,N as c,Q as d,Y as e,Z as f};
6
- //# sourceMappingURL=chunk-QYKKTYBN.js.map
@@ -1,7 +0,0 @@
1
- import{d as b}from"./chunk-VDZL45XI.js";import{execFileSync as y}from"child_process";var A=2e3,F=50,R=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i;function d(e){let n=b(e,{clearGroups:["whole-project"]});return(t,i)=>{let s=M(t.config.projectRoot);if(!s)return null;let r=n.has(t)?n.get(t,()=>({head:"",value:null})):null;return r&&r.head===s?r.value:(n.invalidate(t),n.get(t,()=>({head:s,value:i(t.config.projectRoot,s)})).value)}}var S=d("git-commit-history");function p(e){return S(e,w)}function M(e){try{return g(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function g(e,n){return y("git",["-C",e,...n],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function w(e,n){let t;try{t=g(e,["log","--no-merges","--name-only","-n",String(A),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let i=[],s=0;for(let r of t.split("")){if(r.trim()==="")continue;let c=r.indexOf(`
2
- `),f=c>=0?r.slice(0,c):r,[a,o,l]=f.split("\0");if(!a||!o)continue;let m=c>=0?r.slice(c+1).split(`
3
- `).map(u=>u.trim()).filter(u=>u!==""):[];if(m.length>F){s+=1;continue}i.push({hash:a,timestamp:Number(o)||0,subject:l??"",files:m})}return{head:n,commits:i,skippedBulkCommits:s}}function k(e){return R.test(e.subject)}function B(e){let n=p(e);if(!n)return null;let t=new Map;for(let i of n.commits){let s=k(i);for(let r of i.files){let c=t.get(r)??{changes:0,fixChanges:0,lastChangedAt:0};c.changes+=1,s&&(c.fixChanges+=1),i.timestamp>c.lastChangedAt&&(c.lastChangedAt=i.timestamp),t.set(r,c)}}return t}function v(e){let n=p(e);if(!n||n.commits.length===0)return null;let t=n.commits.map(i=>i.files.length).filter(i=>i>0).sort((i,s)=>i-s);return t.length===0?null:{medianFilesPerCommit:x(t,.5),p90FilesPerCommit:x(t,.9),commitsAnalyzed:t.length}}function x(e,n){let t=Math.min(e.length-1,Math.floor(e.length*n));return e[t]}var P=d("git-tracked-files");function _(e){return P(e,n=>{try{let t=g(n,["ls-files"]);return new Set(t.split(`
4
- `).map(i=>i.trim()).filter(i=>i!==""))}catch{return null}})}var T=d("git-file-adds");function E(e){return T(e,n=>j(n))}function j(e){let n;try{n=g(e,["log","--no-merges","--diff-filter=A","--name-only","-n",String(A),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let t=new Map,i=-1;for(let s of n.split("")){if(s.trim()==="")continue;i+=1;let r=s.indexOf(`
5
- `),c=r>=0?s.slice(0,r):s,[,f]=c.split("\0"),a=Number(f)||0;if(!(r<0))for(let o of s.slice(r+1).split(`
6
- `)){let l=o.trim();l!==""&&t.set(l,{commitsAgo:i,addedAt:a})}}return t}function I(e,n={}){let{minTogether:t=4,minConfidence:i=.6}=n,s=p(e);if(!s)return null;let r=new Map,c=new Map;for(let a of s.commits){let o=[...new Set(a.files)].sort();for(let l of o)r.set(l,(r.get(l)??0)+1);for(let l=0;l<o.length;l++)for(let m=l+1;m<o.length;m++){let u=`${o[l]}\0${o[m]}`;c.set(u,(c.get(u)??0)+1)}}let f=[];for(let[a,o]of c){if(o<t)continue;let[l,m]=a.split("\0"),u=r.get(l)??o,h=r.get(m)??o,C=Math.max(o/u,o/h);C<i||f.push({fileA:l,fileB:m,together:o,confidence:C,changesA:u,changesB:h})}return f.sort((a,o)=>o.together-a.together||o.confidence-a.confidence||a.fileA.localeCompare(o.fileA)),f}export{p as a,B as b,v as c,_ as d,E as e,I as f};
7
- //# sourceMappingURL=chunk-R3G6ERW7.js.map
@@ -1,10 +0,0 @@
1
- import{a as N}from"./chunk-VDZIEDJB.js";import{a as I,b as S}from"./chunk-4MHT7LKP.js";import{c as h,e as b,r as p,v as g}from"./chunk-O6KCZPJQ.js";function x(o,s,r={}){let{maxDepth:c=5,scope:a}=r,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let i=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&i.push(n.symbolMatch)}t=i}return u.sort((e,i)=>e.depth-i.depth||e.file.localeCompare(i.file)),u}function D(o,s,r){let c=N(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!r||t.file.includes(r)),a=new Set(c.map(t=>t.file)),l=[];for(let t of M(o,s,r)){if(a.has(t))continue;let e=p(o,t),i=e.length>0?g(e,e[0].startLine):null;l.push({symbol:i?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=S(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:h(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!_(e.symbol))continue;let i=`${e.symbolId}|${e.relativePath}`;m.has(i)||(m.add(i),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function M(o,s,r){let c=r?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return r&&a.push(`%${r}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
2
- FROM mentions m
3
- JOIN chunks c ON m.chunk_id = c.id
4
- JOIN documents consumer_d ON consumer_d.id = c.document_id
5
- WHERE m.symbol_id = ?
6
- AND m.role != 1
7
- AND c.document_id != ?
8
- ${o.pathExclusionsFor("consumer_d")}
9
- ${c}`,...a).map(l=>l.relative_path).filter(l=>!o.isIgnored(l)))}function _(o){let s=b(o);return s==="method"||s==="type"||o.endsWith("().")}export{x as a};
10
- //# sourceMappingURL=chunk-R6XDPWJA.js.map
@@ -1,2 +0,0 @@
1
- import{a as b}from"./chunk-V76FCF5F.js";import{a as g}from"./chunk-IW7ASGVF.js";import{a as d}from"./chunk-VGBSY6N7.js";import{c as p}from"./chunk-O6KCZPJQ.js";import{c as o,f as c}from"./chunk-OH5HIAID.js";function T(t,r={}){let{scope:l,limit:s=30,scanLimit:f}=r,u=r.files===void 0?null:new Set(r.files),L=new g(t);return b({candidates:()=>L.productionCallableDefinitions({scope:l,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}).filter(e=>h(e.relativePath)&&(u===null||u.has(e.relativePath))),scanLimit:f,evaluate:e=>{let n=c(t,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(a=>!a.simple)||n.paramsEndLine>=n.endLine)return null;let y=d(t,e.relativePath),m=[];for(let a=n.params.length-1;a>=0;a--){let i=n.params[a];if(i.name===""||i.name.startsWith("_")||P(y.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function h(t){let r=o(t);return r==="typescript"||r==="tsx"||r==="javascript"}function P(t,r,l){return t?t.some(s=>s>r&&s<=l):!1}export{T as a};
2
- //# sourceMappingURL=chunk-SJR4SB7B.js.map
@@ -1,16 +0,0 @@
1
- import{a as h}from"./chunk-IW7ASGVF.js";import{e as y}from"./chunk-ZF6P2NAT.js";import{c as g,f as d,h as p}from"./chunk-O6KCZPJQ.js";import{execFileSync as u}from"child_process";var I="Unable to compute git diff.";function k(e,n={}){let t=S(e,n);return t.note?F(t.note,t.changedFileLines):t.changedFiles.length===0?_(t.changedFileLines):D(t.changedFiles,[C(e,t.changedFiles,t.changedFiles)])}function S(e,n={}){let{base:t="HEAD"}=n;try{let s=x(e.config.projectRoot,t);return{changedFileLines:s,changedFiles:N(e,s),note:s.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],note:I}}}function C(e,n,t){let s=new h(e),o=new Set(t),a=[],l=new Map,i=n.flatMap(r=>s.definitionsForFile(r)).filter(w).sort((r,f)=>r.relativePath.localeCompare(f.relativePath)||r.startLine-f.startLine),m=new Map(i.map(r=>[r.symbolId,M(e,r.symbolId)])),c=y(e,i.filter(r=>m.get(r.symbolId)===0));for(let r of i)E(e,r,t,o,a,l,c.get(r.symbolId)??new Set,m.get(r.symbolId)??0);return{changedSymbols:a,consumerEntries:[...l.entries()].map(([r,f])=>({file:r,symbols:[...f].sort()}))}}function D(e,n){let t=new Map,s=n.flatMap(a=>a.changedSymbols);for(let a of n)for(let l of a.consumerEntries){let i=t.get(l.file);i||(i=new Set,t.set(l.file,i));for(let m of l.symbols)i.add(m)}let o=L(t);return{changedFiles:[...e],changedSymbols:s,affectedConsumers:o,summary:{totalChangedFiles:e.length,totalChangedSymbols:s.length,totalAffectedFiles:o.length}}}function F(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function _(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function x(e,n){let t=u("git",["diff","--name-only",n],{encoding:"utf-8",cwd:e,timeout:1e4}),s=u("git",["diff","--name-only","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4}),o=u("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([t,s,o].flatMap(a=>a.split(`
2
- `)).map(a=>a.trim()).filter(a=>a.length>0))]}function N(e,n){let t=[];for(let s of n){let o=e.get(`SELECT relative_path FROM documents
3
- WHERE relative_path LIKE ?
4
- LIMIT 1`,`%${s}`);o&&!e.isIgnored(o.relative_path)&&t.push(o.relative_path)}return t}function E(e,n,t,s,o,a,l,i){let m=Math.max(i,l.size);if(!A(n,m))return;let c=g(n.symbol);o.push({symbol:n.symbol,shortName:c,file:n.relativePath,fanIn:m});for(let r of R(e,n.symbolId,t))b(e,s,a,r,c);for(let r of l)b(e,s,a,r,c)}function M(e,n){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS fan_in
5
- FROM mentions m
6
- JOIN chunks c ON m.chunk_id = c.id
7
- WHERE m.symbol_id = ?
8
- AND m.role != 1`,n)?.fan_in??0}function R(e,n,t){return t.length===0?[]:e.all(`SELECT DISTINCT ref_d.relative_path
9
- FROM mentions m
10
- JOIN chunks c ON m.chunk_id = c.id
11
- JOIN documents ref_d ON c.document_id = ref_d.id
12
- WHERE m.symbol_id = ?
13
- AND m.role != 1
14
- AND ref_d.relative_path NOT IN (${t.map(()=>"?").join(",")})
15
- ${e.pathExclusionsFor("ref_d")}`,n,...t).map(o=>o.relative_path)}function b(e,n,t,s,o){if(e.isIgnored(s)||n.has(s))return;let a=t.get(s);a||(a=new Set,t.set(s,a)),a.add(o)}function L(e){return[...e.entries()].map(([n,t])=>({file:n,consumedSymbols:t.size})).sort((n,t)=>t.consumedSymbols-n.consumedSymbols)}function w(e){return!(p(e.symbol)||e.parentTypeName!==null&&!d(e.symbol))}function A(e,n){return d(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{I as a,k as b,S as c,C as d,D as e};
16
- //# sourceMappingURL=chunk-SYKCO25G.js.map
@@ -1,2 +0,0 @@
1
- import{c as m}from"./chunk-UIWAZ2NT.js";import{a as d}from"./chunk-IVAIPXNO.js";function v(t,s={}){let{minSimilarity:o=.5,limit:f=20,scope:n,filePattern:p}=s,l=s.minDeps??(p?1:3),{profiles:e,distinctiveDeps:c}=h(t,{scope:n,minDeps:l}),i=[];if(p){let r=e.find(u=>u.file.includes(p));if(!r)return[];for(let u of e){if(u.file===r.file)continue;let a=g(r,u,o,c);a&&i.push(a)}}else for(let r=0;r<e.length;r++){for(let u=r+1;u<e.length;u++){let a=g(e[r],e[u],o,c);a&&i.push(a)}if(i.length>f*5)break}return i.sort((r,u)=>u.similarity-r.similarity),i.slice(0,f)}function h(t,s){let{scope:o,minDeps:f}=s,n=d(t,o),{universalDeps:p,distinctiveDeps:l}=D(n),e=[];for(let[c,i]of n)i.size>=f&&e.push({file:c,deps:new Set([...i].filter(r=>!p.has(r)))});return{profiles:e,distinctiveDeps:l}}function D(t){let s=new Set,o=new Set,f=t.size;if(f===0)return{universalDeps:s,distinctiveDeps:o};let n=new Map;for(let l of t.values())for(let e of l)n.set(e,(n.get(e)??0)+1);let p=Math.max(3,Math.ceil(f*.03));for(let[l,e]of n)e>=5&&e/f>.3?s.add(l):e<=p&&o.add(l);return{universalDeps:s,distinctiveDeps:o}}function g(t,s,o,f){let n=new Set;for(let i of t.deps)s.deps.has(i)&&n.add(i);if(n.size<3||t.deps.size<4||s.deps.size<4)return null;let p=0;for(let i of n)f.has(i)&&p++;if(p<2)return null;let l=m(t.deps,s.deps);if(l<o)return null;let e=[];for(let i of t.deps)s.deps.has(i)||e.push(i);let c=[];for(let i of s.deps)t.deps.has(i)||c.push(i);return{fileA:t.file,fileB:s.file,similarity:l,sharedDeps:[...n],uniqueToA:e,uniqueToB:c}}export{v as a};
2
- //# sourceMappingURL=chunk-T22X7WT6.js.map
@@ -1,71 +0,0 @@
1
- import Pe from"better-sqlite3";import{existsSync as Ot,readFileSync as At,writeFileSync as Pt}from"fs";import{dirname as Mt,join as _t,resolve as Ne}from"path";import te from"better-sqlite3";import{execFileSync as ne}from"child_process";import{existsSync as re,readdirSync as oe,readFileSync as ie}from"fs";import{extname as m,join as F}from"path";import K from"ignore";import{readFileSync as U,existsSync as b}from"fs";import{dirname as h,isAbsolute as V,join as S,relative as B,resolve as J}from"path";function C(e){let t=K(),r=!1,n=z(e);for(let i of n)try{let o=U(i,"utf-8");t.add(o),r=!0}catch{}return r||t.add(X),{isIgnored:i=>x(t,e,i),filter:i=>i.filter(o=>!x(t,e,o))}}function z(e){let t=[],r=S(e,".gitignore");b(r)&&t.push(r);let n=h(e),i=0;for(;n!==h(n)&&i<5;){let o=S(n,".gitignore");if(b(o)&&t.push(o),b(S(n,".git")))break;n=h(n),i++}return t}var X=`
2
- # Dependencies
3
- node_modules/
4
- vendor/
5
- .bundle/
6
-
7
- # Build output
8
- dist/
9
- build/
10
- out/
11
- target/
12
- bin/
13
- obj/
14
-
15
- # Python
16
- __pycache__/
17
- *.pyc
18
- *.pyo
19
- .venv/
20
- venv/
21
- .env/
22
- env/
23
- *.egg-info/
24
-
25
- # Rust
26
- target/
27
-
28
- # Java / Kotlin / Scala
29
- *.class
30
- .gradle/
31
- .mvn/
32
-
33
- # C# / .NET
34
- bin/
35
- obj/
36
- packages/
37
-
38
- # Go
39
- vendor/
40
-
41
- # Dart
42
- .dart_tool/
43
- build/
44
-
45
- # PHP
46
- vendor/
47
-
48
- # IDE / OS
49
- .idea/
50
- .vscode/
51
- *.swp
52
- *.swo
53
- .DS_Store
54
- Thumbs.db
55
-
56
- # Type definitions (often noise in queries)
57
- *.d.ts
58
- `;function x(e,t,r){let n=q(t,r);if(!n)return!1;try{return e.ignores(n)}catch{return!1}}function q(e,t){if(!t||t===".")return null;if(!V(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=V(t)?t:J(e,t),n=B(e,r).replaceAll("\\","/");return!n||n==="."||n.startsWith("..")?null:n}import{readdirSync as Ze}from"fs";import{extname as tt,join as nt}from"path";var Y=[];function k(e){e.groups.length>0&&Y.push(e)}function Q(){let e=new WeakMap;return{cache:e,ensure(t){let r=e.get(t);return r||(r=new Map,e.set(t,r)),r}}}function T(e,t){let{cache:r,ensure:n}=Q(),i={get(o,s,a){let u=n(o);if(u.has(s))return u.get(s);let c=a();return u.set(s,c),c},invalidate(o,s){r.get(o)?.delete(s)},invalidateAll(o){r.delete(o)},size(o){return r.get(o)?.size??0}};return k({name:e,groups:t.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,s)=>i.invalidate(o,s)}),i}var Z=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],L=[".vue"],ee=new Set(Z.map(e=>e.toLowerCase())),ot=[...ee].sort().join(","),D=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var it=T("source-files",{clearGroups:[]});function ft(e){let t=new Set((e.extensions??L).map(o=>o.toLowerCase()));if(t.size===0)return{scanned:0,inserted:0,existing:0};if(!re(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=C(e.projectRoot),n=se(e.projectRoot,t).filter(o=>!r.isIgnored(o)),i=new te(e.dbPath);try{let o=ue(i,n),s=i.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
59
- VALUES (?, ?, NULL, ?)`),u=i.transaction(l=>{let p=0;for(let g of l){if(o.has(g))continue;let d=ie(F(e.projectRoot,g),"utf-8"),H=s.run(ce(g),g,d);p+=Number(H.changes)}return p})(n),c={scanned:n.length,inserted:u,existing:n.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{i.close()}}function se(e,t){let r=ae(e,t);if(r)return r;let n=[],i=o=>{let s=o?F(e,o):e,a;try{a=oe(s,{withFileTypes:!0})}catch{return}for(let u of a){if(D.has(u.name))continue;let c=o?`${o}/${u.name}`:u.name;if(u.isDirectory()){i(c);continue}t.has(m(u.name).toLowerCase())&&n.push(c)}};return i(""),n.sort()}function ae(e,t){try{return ne("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
60
- `).filter(n=>n&&t.has(m(n).toLowerCase())).sort()}catch{return null}}function ue(e,t){let r=new Set,n=500;for(let i=0;i<t.length;i+=n){let o=t.slice(i,i+n),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${o.map(()=>"?").join(",")})`).all(...o);for(let a of s)r.add(a.relative_path)}return r}function ce(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as le}from"child_process";import{createHash as ge}from"crypto";import{readdirSync as de,readFileSync as fe}from"fs";import{join as I}from"path";function pe(e){return(me(e)??be(e)).filter(t=>t&&!w(t)).sort()}function yt(e){return pe(e).map(t=>{let r=I(e,t);try{let n=fe(r);return{path:t,size:n.byteLength,hash:ge("sha256").update(n).digest("hex")}}catch{return{path:t,size:-1,hash:"unreadable"}}})}function me(e){try{return le("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
61
- `).filter(Boolean)}catch{return null}}function be(e){let t=[],r=[""];for(;r.length>0;){let n=r.pop(),i=n?I(e,n):e,o;try{o=de(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){w(a)||r.push(a);continue}t.push(a)}}return t}function w(e){return e.split("/").some(r=>he.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var he=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);import{createRequire as Se}from"module";import{existsSync as ye,readFileSync as v}from"fs";import{dirname as E,extname as ve,join as O,relative as Re,resolve as Ct}from"path";import{pathToFileURL as Ve}from"url";function A(e,t){let{vueCore:r,ts:n,volarTs:i}=xe(e),{parsed:o,vueOptions:s}=Ce(r,n,t),a=E(t),u=r.createVueLanguagePlugin(n,o.options,s,d=>d),c=ke(r,n,u),l=Te(a,o),{languageServiceHost:p}=i.createLanguageServiceHost(n,n.sys,c,d=>d,l),g=n.createLanguageService(p);return{ts:n,language:c,languageService:g,fileNames:o.fileNames,configDir:a}}function xe(e){let t=Se(Ve(O(e,"package.json")).href);return{vueCore:y(t,"@vue/language-core",e),ts:y(t,"typescript",e),volarTs:y(t,"@volar/typescript",e)}}function Ce(e,t,r){let n=t.readConfigFile(r,t.sys.readFile);if(n.error||!n.config)throw new Error(`Failed to read ${r}`);let o=e.createParsedCommandLine(t,t.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(o.globalTypesPath=e.createGlobalTypesWriter(o,t.sys.writeFile)),{parsed:t.parseJsonConfigFileContent(n.config,t.sys,E(r),void 0,r,void 0,e.getAllExtensions(o).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:t.ScriptKind.Deferred}))),vueOptions:o}}function ke(e,t,r){let n={},i=e.createLanguage([r],new Map,o=>{if(!ye(o))return;let s=v(o,"utf-8");n.current?.scripts.set(o,t.ScriptSnapshot.fromString(s),r.getLanguageId(o)??Ie(o))});return n.current=i,i}function Te(e,t){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>t.options,getScriptFileNames:()=>t.fileNames,getProjectReferences:()=>t.projectReferences,getProjectVersion:()=>"0"}}function y(e,t,r){try{return e(t)}catch(n){throw(typeof n=="object"&&n!==null&&"code"in n?n.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${t} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:n}):n}}function P(e,t,r){let n=Le(e);return i=>{let o=f(t,i.fileName),s=r.get(i.fileName);if(!s)return null;let a=r.positionAt(s,i.textSpan.start),u=n.get(o);if(!u)return null;let c=u.containingByLine.get(a.line);return c!==void 0?c:De(u.starts,a.line,2)}}function Le(e){let t=e.prepare(`
62
- SELECT
63
- d.relative_path AS relativePath,
64
- der.start_line AS startLine,
65
- der.end_line AS endLine,
66
- der.symbol_id AS symbolId
67
- FROM defn_enclosing_ranges der
68
- JOIN documents d ON d.id = der.document_id
69
- ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
70
- `).all(),r=new Map;for(let n of t){let i=r.get(n.relativePath);i||(i={containingByLine:new Map,starts:[]},r.set(n.relativePath,i)),i.starts.push({line:n.startLine,symbolId:n.symbolId});for(let o=n.startLine;o<=n.endLine;o++)i.containingByLine.set(o,n.symbolId)}for(let n of r.values())n.starts.sort((i,o)=>i.line-o.line);return r}function De(e,t,r){let n=0,i=e.length-1;for(;n<=i;){let s=Math.floor((n+i)/2);e[s].line<t?n=s+1:i=s-1}let o=null;for(let s of[i,n]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-t);u>r||(!o||u<o.distance)&&(o={distance:u,symbolId:a.symbolId})}return o?.symbolId??null}function N(e,t){let r=Ee(t),n=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),i=new Map;return{get(o){if(i.has(o))return i.get(o)??null;let s=Oe(n,r,t,o);return i.set(o,s),s}}}function M(e,t,r,n,i){if(e.fileName.endsWith(".vue")){let o=n.language.scripts.get(e.fileName),s=o?.generated?.languagePlugin.typescript?.getServiceScript(o.generated.root)?.code;if(o&&s){let a=n.language.maps.get(s,o);if(R(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(i)?r.get(e.fileName):null}return t(e)}function*_(e){let t=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),n;for(;n=t.exec(e);){let i=n[0];r.has(i)||(yield{text:i,start:n.index,end:n.index+i.length})}}function j(e,t){for(let[r]of e.toGeneratedLocation(t,n=>!!n.navigation))return r;return null}function R(e,t){let r=e;for(let[n]of r.toSourceLocation(t,i=>!!i.navigation))return n;return null}function Fe(e,t){let r=0,n=e.lineStarts.length-1;for(;r<=n;){let o=Math.floor((r+n)/2);e.lineStarts[o]<=t?r=o+1:n=o-1}let i=Math.max(0,n);return{line:i,character:t-e.lineStarts[i]}}function G(e,t){return f(e,t).startsWith("node_modules/")}function f(e,t){return Re(e,t).replaceAll("\\","/")}function Ie(e){switch(ve(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function $(){let e=new Map;return{get(t){if(e.has(t))return e.get(t)??null;try{let r=v(t,"utf-8"),n={text:r,lineStarts:we(r)};return e.set(t,n),n}catch{return e.set(t,null),null}},positionAt:Fe}}function we(e){let t=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&t.push(r+1);return t}function Ee(e){try{let t=JSON.parse(v(O(e,"package.json"),"utf-8"));return{name:t.name??"workspace",version:t.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function Oe(e,t,r,n){let i=f(r,n),o=Ae(t.name,t.version,i);return e.get(o)?.id??null}function Ae(e,t,r){let n=r.split("/").map(i=>`\`${i.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${t} ${n}/default.`}function Gt(e){let t=Ne(e.projectRoot,e.tsconfig),r=new Pe(e.dbPath,{readonly:!0});try{let n=Me({db:r,projectRoot:e.projectRoot,configPath:t,vueSymbolLookup:N(r,e.projectRoot)});return _e({vueFiles:e.vueFiles??[],tasks:e.tasks,...n})}finally{r.close()}}function Me(e){let t=$();return{projectRoot:e.projectRoot,context:A(e.projectRoot,e.configPath),symbolLookup:P(e.db,e.projectRoot,t),vueSymbolLookup:e.vueSymbolLookup,sourceReader:t}}function _e(e){let t=[],r=0,n=e.tasks??e.vueFiles.map(i=>({fileName:i,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let i of n){let o=je(e,i);t.push(...o.occurrences),r+=o.skippedReferences}return{occurrences:t,skippedReferences:r}}function je(e,t){let r=e.context.language.scripts.get(t.fileName),n=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!n)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let i=e.sourceReader.get(t.fileName);if(!i)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let o=e.context.language.maps.get(n,r),s=f(e.projectRoot,t.fileName),a=[..._(i.text)],u={tokens:a.filter(c=>c.start>=t.startOffset&&c.start<t.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:We(a),processedStarts:new Set};return Ge({...e,fileName:t.fileName,sourceInfo:i,sourceFile:s,map:o,tokenContext:u})}function Ge(e){let t=[],r=0;for(let n of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(n.start))continue;let i=j(e.map,n.start);if(i===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,i+1)??[]).find(u=>!G(e.projectRoot,u.fileName));if(!s){r++;continue}let a=M(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}W(t,e.sourceReader,e.sourceInfo,e.sourceFile,n,a),e.tokenContext.processedStarts.add(n.start),$e(t,e,n,i,a)}return{occurrences:t,skippedReferences:r}}function $e(e,t,r,n,i){if(!((t.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let o of He(t.context.languageService,t.fileName,n+1,t.map,r,t.tokenContext.tokenByStart)){if(t.tokenContext.processedStarts.has(o))continue;let s=t.tokenContext.tokenByStart.get(o);s&&(W(e,t.sourceReader,t.sourceInfo,t.sourceFile,s,i),t.tokenContext.processedStarts.add(o))}}function W(e,t,r,n,i,o){let s=t.positionAt(r,i.start);e.push({sourceFile:n,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+i.text.length,symbolId:o})}function We(e){let t=new Map;for(let r of e)t.set(r.text,(t.get(r.text)??0)+1);return t}function He(e,t,r,n,i,o){let s=e.getDocumentHighlights?.(t,r,[t])??[],a=[];for(let u of s)if(u.fileName===t)for(let c of u.highlightSpans){let l=Ke(n,c.textSpan.start,o,i.text);l!==null&&a.push(l)}return a}function Ke(e,t,r,n){let i=r.get(t);if(i?.text===n)return i.start;let o=R(e,t);if(o===null)return null;let s=r.get(o);return s?.text===n?s.start:null}export{ft as a,yt as b,Gt as c};
71
- //# sourceMappingURL=chunk-TH4JVC34.js.map
@@ -1,2 +0,0 @@
1
- import{a as b}from"./chunk-V76FCF5F.js";import{a as c,b as f}from"./chunk-MX6F756F.js";import{a as u}from"./chunk-IW7ASGVF.js";import{c as a,g as l}from"./chunk-O6KCZPJQ.js";import{g as d}from"./chunk-OH5HIAID.js";function D(i,e){let{scope:n,maxLoc:t=15,limit:r=30,scanLimit:g}=e??{},m=new u(i);return b({candidates:()=>y(m,n,t),orderCandidates:f,scanLimit:g,prepare:o=>m.calleeMap(o,{semantic:e?.semantic!==!1}),evaluate:(o,s)=>p(i,o,s.get(o.symbolId)??[]),orderResults:(o,s)=>o.loc-s.loc||o.file.localeCompare(s.file),limit:r})}function p(i,e,n){let t=h(n);if(t.size!==1||!d(i,e.relativePath,e.startLine,e.endLine))return null;let[,r]=[...t.entries()][0];return{symbol:e.symbol,shortName:a(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:c(e),forwardsTo:r.symbol,forwardsToShort:a(r.symbol),forwardsToFile:r.file}}function h(i){let e=i.some(t=>l(t.symbol))?i.filter(t=>l(t.symbol)):i,n=new Map;for(let t of e)n.has(t.symbol)||n.set(t.symbol,t);return n}function y(i,e,n){return i.productionCallableDefinitions({scope:e,minLoc:3,maxLoc:n,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0})}export{D as a};
2
- //# sourceMappingURL=chunk-VDY4HYNK.js.map